selection_box.d.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { ContextMenu } from './context_menu.js';
  2. import { AbstractMenu } from './abstract_menu.js';
  3. import { Info } from './info.js';
  4. import { ParserFactory } from './parser_factory.js';
  5. declare type selection = {
  6. title: string;
  7. values: string[];
  8. variable: string;
  9. };
  10. export declare class SelectionMenu extends AbstractMenu {
  11. anchor: SelectionBox;
  12. protected className: import("./html_classes.js").HtmlClass;
  13. static fromJson(factory: ParserFactory, { title: title, values: values, variable: variable }: selection, sb: SelectionBox): SelectionMenu;
  14. constructor(anchor: SelectionBox);
  15. generateHtml(): void;
  16. protected display(): void;
  17. right(event: KeyboardEvent): void;
  18. left(event: KeyboardEvent): void;
  19. }
  20. export declare const enum SelectionOrder {
  21. NONE = "none",
  22. ALPHABETICAL = "alphabetical",
  23. INCREASING = "increasing",
  24. DECREASING = "decreasing"
  25. }
  26. export declare const enum SelectionGrid {
  27. SQUARE = "square",
  28. VERTICAL = "vertical",
  29. HORIZONTAL = "horizontal"
  30. }
  31. export declare class SelectionBox extends Info {
  32. style: SelectionOrder;
  33. grid: SelectionGrid;
  34. private _selections;
  35. private prefix;
  36. private _balanced;
  37. static chunkSize: number;
  38. static fromJson(factory: ParserFactory, { title: title, signature: signature, selections: selections, order: order, grid: grid }: {
  39. title: string;
  40. signature: string;
  41. selections: selection[];
  42. order?: SelectionOrder;
  43. grid?: SelectionGrid;
  44. }, ctxt: ContextMenu): SelectionBox;
  45. constructor(title: string, signature: string, style?: SelectionOrder, grid?: SelectionGrid);
  46. attachMenu(menu: ContextMenu): void;
  47. get selections(): SelectionMenu[];
  48. set selections(selections: SelectionMenu[]);
  49. addSelection(selection: SelectionMenu): void;
  50. private rowDiv;
  51. protected display(): void;
  52. private getChunkSize;
  53. private balanceColumn;
  54. private combineColumn;
  55. left(event: KeyboardEvent): void;
  56. right(event: KeyboardEvent): void;
  57. generateHtml(): void;
  58. protected generateContent(): HTMLElement;
  59. private findSelection;
  60. private move;
  61. static orderMethod: Map<SelectionOrder, (x: SelectionMenu, y: SelectionMenu) => number>;
  62. private order;
  63. toJson(): {
  64. type: string;
  65. };
  66. }
  67. export {};