@omegagrid/core 0.8.4 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/common/index.d.ts +1 -0
  2. package/dist/common/index.d.ts.map +1 -1
  3. package/dist/common/index.js +1 -0
  4. package/dist/common/index.js.map +1 -1
  5. package/dist/common/shortcutManager.d.ts +17 -0
  6. package/dist/common/shortcutManager.d.ts.map +1 -0
  7. package/dist/common/shortcutManager.js +49 -0
  8. package/dist/common/shortcutManager.js.map +1 -0
  9. package/dist/constants.d.ts +1 -0
  10. package/dist/constants.d.ts.map +1 -1
  11. package/dist/constants.js +2 -1
  12. package/dist/constants.js.map +1 -1
  13. package/dist/themes/definitions/tmDark.js +1 -1
  14. package/dist/themes/definitions/tmDark.js.map +1 -1
  15. package/dist/themes/definitions/tmLight.js +1 -1
  16. package/dist/themes/definitions/tmLight.js.map +1 -1
  17. package/dist/ui/container.d.ts +4 -1
  18. package/dist/ui/container.d.ts.map +1 -1
  19. package/dist/ui/container.js +51 -12
  20. package/dist/ui/container.js.map +1 -1
  21. package/dist/ui/dropdown.js +1 -1
  22. package/dist/ui/dropdown.js.map +1 -1
  23. package/dist/ui/dropdownList.js +3 -3
  24. package/dist/ui/dropdownList.js.map +1 -1
  25. package/dist/ui/floatingWindow.d.ts +16 -0
  26. package/dist/ui/floatingWindow.d.ts.map +1 -0
  27. package/dist/ui/floatingWindow.js +80 -0
  28. package/dist/ui/floatingWindow.js.map +1 -0
  29. package/dist/ui/index.d.ts +1 -0
  30. package/dist/ui/index.d.ts.map +1 -1
  31. package/dist/ui/index.js +1 -0
  32. package/dist/ui/index.js.map +1 -1
  33. package/dist/ui/list.d.ts.map +1 -1
  34. package/dist/ui/list.js +8 -4
  35. package/dist/ui/list.js.map +1 -1
  36. package/dist/ui/slider.style.js +1 -1
  37. package/dist/ui/slider.style.js.map +1 -1
  38. package/package.json +2 -2
@@ -15,4 +15,5 @@ export * as device from './device';
15
15
  export * from './options';
16
16
  export * from './loaders';
17
17
  export * from './linkedList';
18
+ export * from './shortcutManager';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -15,4 +15,5 @@ export * as device from './device';
15
15
  export * from './options';
16
16
  export * from './loaders';
17
17
  export * from './linkedList';
18
+ export * from './shortcutManager';
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC","sourcesContent":["export * as dom from './dom';\nexport * as html from './html';\nexport * as numbers from './numbers';\nexport * as dates from './dates';\nexport * as csv from './csv';\nexport * as log from './logger';\nexport * as tree from './tree';\nexport * as colors from './colors';\nexport * as actions from './actions';\nexport * as utils from './utils';\nexport * as matrix from './matrix';\nexport * as events from './events';\nexport * as paper from './paper';\nexport * as device from './device';\nexport * from './options';\nexport * from './loaders';\nexport * from './linkedList';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC","sourcesContent":["export * as dom from './dom';\nexport * as html from './html';\nexport * as numbers from './numbers';\nexport * as dates from './dates';\nexport * as csv from './csv';\nexport * as log from './logger';\nexport * as tree from './tree';\nexport * as colors from './colors';\nexport * as actions from './actions';\nexport * as utils from './utils';\nexport * as matrix from './matrix';\nexport * as events from './events';\nexport * as paper from './paper';\nexport * as device from './device';\nexport * from './options';\nexport * from './loaders';\nexport * from './linkedList';\nexport * from './shortcutManager';"]}
@@ -0,0 +1,17 @@
1
+ export declare class ShortcutEvent extends Event {
2
+ readonly shortcut: string;
3
+ readonly action: string;
4
+ constructor(shortcut: string, action: string);
5
+ }
6
+ export declare class ShortcutManager extends EventTarget {
7
+ readonly target: HTMLElement;
8
+ private shortcuts;
9
+ private stack;
10
+ constructor(target: HTMLElement);
11
+ matchStack(): string;
12
+ private _onKeyUp;
13
+ private _onKeyDown;
14
+ reset(): void;
15
+ register(shortcut: string, action: string): void;
16
+ }
17
+ //# sourceMappingURL=shortcutManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortcutManager.d.ts","sourceRoot":"","sources":["../../src/common/shortcutManager.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAK5C;AAMD,qBAAa,eAAgB,SAAQ,WAAW;IAInC,QAAQ,CAAC,MAAM,EAAE,WAAW;IAHxC,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAqB;gBAEb,MAAM,EAAE,WAAW;IAMxC,UAAU;IAKV,OAAO,CAAC,QAAQ,CAEf;IAED,OAAO,CAAC,UAAU,CAejB;IAED,KAAK;IAIL,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAKzC"}
@@ -0,0 +1,49 @@
1
+ export class ShortcutEvent extends Event {
2
+ constructor(shortcut, action) {
3
+ super('shortcut', { cancelable: true });
4
+ this.shortcut = shortcut;
5
+ this.action = action;
6
+ }
7
+ }
8
+ const keyMap = {
9
+ 'control': 'ctrl',
10
+ };
11
+ export class ShortcutManager extends EventTarget {
12
+ constructor(target) {
13
+ super();
14
+ this.target = target;
15
+ this.shortcuts = new Map();
16
+ this.stack = new Set();
17
+ this._onKeyUp = () => {
18
+ this.reset();
19
+ };
20
+ this._onKeyDown = (e) => {
21
+ let key = e.key.toLowerCase();
22
+ if (key in keyMap)
23
+ key = keyMap[key];
24
+ if (this.stack.has(key))
25
+ return;
26
+ this.stack.add(key);
27
+ const shortcut = this.matchStack();
28
+ if (shortcut == null)
29
+ return;
30
+ e.preventDefault();
31
+ e.stopImmediatePropagation();
32
+ this.reset();
33
+ this.dispatchEvent(new ShortcutEvent(shortcut, this.shortcuts.get(shortcut)));
34
+ };
35
+ target.addEventListener('keydown', this._onKeyDown);
36
+ target.addEventListener('keyup', this._onKeyUp);
37
+ }
38
+ matchStack() {
39
+ const shortcut = [...this.stack.values()].join('+').toLowerCase();
40
+ return this.shortcuts.has(shortcut) ? shortcut : null;
41
+ }
42
+ reset() {
43
+ this.stack.clear();
44
+ }
45
+ register(shortcut, action) {
46
+ this.shortcuts.set(shortcut.toLowerCase(), action);
47
+ }
48
+ }
49
+ //# sourceMappingURL=shortcutManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortcutManager.js","sourceRoot":"","sources":["../../src/common/shortcutManager.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAc,SAAQ,KAAK;IAIvC,YAAY,QAAgB,EAAE,MAAc;QAC3C,KAAK,CAAC,UAAU,EAAE,EAAC,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED,MAAM,MAAM,GAA2B;IACtC,SAAS,EAAE,MAAM;CACjB,CAAA;AAED,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAI/C,YAAqB,MAAmB;QACvC,KAAK,EAAE,CAAC;QADY,WAAM,GAAN,MAAM,CAAa;QA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C,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACvD,CAAC;IAuBD,KAAK;QACJ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,QAAgB,EAAE,MAAc;QACxC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CAGD","sourcesContent":["export class ShortcutEvent extends Event {\n\treadonly shortcut: string;\n\treadonly action: string;\n\t\n\tconstructor(shortcut: string, action: string) {\n\t\tsuper('shortcut', {cancelable: true});\n\t\tthis.shortcut = shortcut;\n\t\tthis.action = action;\n\t}\n}\n\nconst keyMap: Record<string, string> = {\n\t'control': 'ctrl',\n}\n\nexport class ShortcutManager extends EventTarget {\n\tprivate shortcuts = new Map<string, string>();\n\tprivate stack = new Set<string>();\n\n\tconstructor(readonly target: HTMLElement) {\n\t\tsuper();\n\t\ttarget.addEventListener('keydown', this._onKeyDown);\n\t\ttarget.addEventListener('keyup', this._onKeyUp);\n\t}\n\n\tmatchStack() {\n\t\tconst shortcut = [...this.stack.values()].join('+').toLowerCase();\n\t\treturn this.shortcuts.has(shortcut) ? shortcut : null;\n\t}\n\t\n\tprivate _onKeyUp = () => {\n\t\tthis.reset();\n\t}\n\n\tprivate _onKeyDown = (e: KeyboardEvent) => {\n\t\tlet key = e.key.toLowerCase();\n\t\tif (key in keyMap) key = keyMap[key];\n\n\t\tif (this.stack.has(key)) return;\n\t\tthis.stack.add(key);\n\n\t\tconst shortcut = this.matchStack();\n\t\tif (shortcut == null) return;\n\t\t\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\n\t\tthis.reset();\n\t\tthis.dispatchEvent(new ShortcutEvent(shortcut, this.shortcuts.get(shortcut)));\n\t}\n\n\treset() {\n\t\tthis.stack.clear();\n\t}\n\n\tregister(shortcut: string, action: string) {\n\t\tthis.shortcuts.set(shortcut.toLowerCase(), action);\n\t}\n\n\t\n}"]}
@@ -42,6 +42,7 @@ declare const _default: {
42
42
  DEFAULT_NUMBER_FORMAT: string;
43
43
  BUTTON_HEIGHT: number;
44
44
  FONT_SIZE: number;
45
+ FLOATING_WINDOW_MAX_WIDTH: number;
45
46
  };
46
47
  export default _default;
47
48
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI1B,wBAmBC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI1B,wBAoBC"}
package/dist/constants.js CHANGED
@@ -5,7 +5,7 @@ export default {
5
5
  DEFAULT_ACCENT_COLOR: DEFAULT_ACCENT_COLOR,
6
6
  DEFAULT_ACCENT_COLOR_2: Color(DEFAULT_ACCENT_COLOR).darken(0.6),
7
7
  SIZER_SIZE: 5,
8
- SLIDER_SIZE: 12,
8
+ SLIDER_SIZE: 10,
9
9
  SLIDER_MIN_LENGTH: 30,
10
10
  EXPANDER_SIZE: 13,
11
11
  LIST_ITEM_HEIGHT: 22,
@@ -19,5 +19,6 @@ export default {
19
19
  DEFAULT_NUMBER_FORMAT: '#,0.#####',
20
20
  BUTTON_HEIGHT: 22,
21
21
  FONT_SIZE: 12,
22
+ FLOATING_WINDOW_MAX_WIDTH: 500
22
23
  };
23
24
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,eAAe;IACd,MAAM,EAAE,IAAI;IACZ,oBAAoB,EAAE,oBAAoB;IAC1C,sBAAsB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC/D,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,EAAE;IACf,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE,EAAE;IACjB,gBAAgB,EAAE,EAAE;IACpB,uBAAuB,EAAE,EAAE;IAC3B,wBAAwB,EAAE,EAAE;IAC5B,qBAAqB,EAAE,GAAG;IAC1B,4BAA4B,EAAE,gCAAgC;IAC9D,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EAAE;IAC1B,qBAAqB,EAAE,WAAW;IAClC,aAAa,EAAE,EAAE;IACjB,SAAS,EAAE,EAAE;CACb,CAAA","sourcesContent":["import Color from 'color';\n\nconst DEFAULT_ACCENT_COLOR = '#00955d';\n\nexport default {\n\tPREFIX: 'og',\n\tDEFAULT_ACCENT_COLOR: DEFAULT_ACCENT_COLOR,\n\tDEFAULT_ACCENT_COLOR_2: Color(DEFAULT_ACCENT_COLOR).darken(0.6),\n\tSIZER_SIZE: 5,\n\tSLIDER_SIZE: 12,\n\tSLIDER_MIN_LENGTH: 30,\n\tEXPANDER_SIZE: 13,\n\tLIST_ITEM_HEIGHT: 22,\n\tLIST_RENDERING_TRESHOLD: 30,\n\tLIST_AUTOSCROLL_TRESHOLD: 30,\n\tLIST_AUTOSCROLL_DELAY: 100,\n\tDEFAULT_TEXT_HIGHLIGHT_COLOR: 'var(--og-text-highlight-color)',\n\tTOOLTIP_MARGIN: 8,\n\tMENU_ITEM_HEIGHT: 25,\n\tCOLORPICKER_COLOR_SIZE: 16,\n\tDEFAULT_NUMBER_FORMAT: '#,0.#####',\n\tBUTTON_HEIGHT: 22,\n\tFONT_SIZE: 12,\n}"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,eAAe;IACd,MAAM,EAAE,IAAI;IACZ,oBAAoB,EAAE,oBAAoB;IAC1C,sBAAsB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC/D,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,EAAE;IACf,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE,EAAE;IACjB,gBAAgB,EAAE,EAAE;IACpB,uBAAuB,EAAE,EAAE;IAC3B,wBAAwB,EAAE,EAAE;IAC5B,qBAAqB,EAAE,GAAG;IAC1B,4BAA4B,EAAE,gCAAgC;IAC9D,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EAAE;IAC1B,qBAAqB,EAAE,WAAW;IAClC,aAAa,EAAE,EAAE;IACjB,SAAS,EAAE,EAAE;IACb,yBAAyB,EAAE,GAAG;CAC9B,CAAA","sourcesContent":["import Color from 'color';\n\nconst DEFAULT_ACCENT_COLOR = '#00955d';\n\nexport default {\n\tPREFIX: 'og',\n\tDEFAULT_ACCENT_COLOR: DEFAULT_ACCENT_COLOR,\n\tDEFAULT_ACCENT_COLOR_2: Color(DEFAULT_ACCENT_COLOR).darken(0.6),\n\tSIZER_SIZE: 5,\n\tSLIDER_SIZE: 10,\n\tSLIDER_MIN_LENGTH: 30,\n\tEXPANDER_SIZE: 13,\n\tLIST_ITEM_HEIGHT: 22,\n\tLIST_RENDERING_TRESHOLD: 30,\n\tLIST_AUTOSCROLL_TRESHOLD: 30,\n\tLIST_AUTOSCROLL_DELAY: 100,\n\tDEFAULT_TEXT_HIGHLIGHT_COLOR: 'var(--og-text-highlight-color)',\n\tTOOLTIP_MARGIN: 8,\n\tMENU_ITEM_HEIGHT: 25,\n\tCOLORPICKER_COLOR_SIZE: 16,\n\tDEFAULT_NUMBER_FORMAT: '#,0.#####',\n\tBUTTON_HEIGHT: 22,\n\tFONT_SIZE: 12,\n\tFLOATING_WINDOW_MAX_WIDTH: 500\n}"]}
@@ -38,7 +38,7 @@ export default {
38
38
  'commands-color': '#ffffff',
39
39
  'commands-background': '#181818',
40
40
  'commands-header-background': '#363636',
41
- 'commands-input-background': '#363636',
41
+ 'commands-input-background': '#1D1D1D',
42
42
  'commands-shadow': '#151515',
43
43
  'dialog-color': '#ffffff',
44
44
  'dialog-background': '#181818',
@@ -1 +1 @@
1
- {"version":3,"file":"tmDark.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC;QACjD,aAAa,EAAE,SAAS;QACxB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,wBAAwB;QACxC,yBAAyB,EAAE,SAAS;QACpC,mCAAmC,EAAE,SAAS;QAC9C,0BAA0B;QAC1B,kBAAkB,EAAE,SAAS;QAC7B,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,SAAS;QAC/B,sBAAsB,EAAE,SAAS;QACjC,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS;QACzB,qBAAqB,EAAE,SAAS;QAChC,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,SAAS;QACzB,gBAAgB,EAAE,SAAS;QAC3B,iBAAiB,EAAE,SAAS;QAC5B,aAAa,EAAE,mBAAmB;QAClC,kBAAkB,EAAE,SAAS;QAC7B,yBAAyB,EAAE,SAAS;QACpC,0BAA0B,EAAE,SAAS;QACrC,kBAAkB,EAAE,SAAS;QAC7B,mBAAmB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,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'dark',\n\ttype: 'dark',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#1e1e1e',\n\t\t'button-background-color-highlight': '#3a3a3a',\n\t\t//'background': '#1e1e1e',\n\t\t'background-color': '#181818',\n\t\t'background-color-2': '#1f1f1f',\n\t\t'background-color-3': '#292929',\n\t\t'text-highlight-color': '#FFFF00',\n\t\t'text-color': '#9b9b9b',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#ffffff',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#3a3a3a',\n\t\t'border-color': '#3a3a3a',\n\t\t'border-color-2': '#2a2a2a',\n\t\t'cell-background': '#1e1e1e',\n\t\t'cell-border': '1px solid #3a3a3a',\n\t\t'hcell-background': '#2e2e2e',\n\t\t'slider-background-color': '#272727',\n\t\t'slider-background-active': '#313131',\n\t\t'slider-bar-color': '#494949',\n\t\t'slider-bar-active': '#494949',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#3F3F3F',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#000000',\n\t\t'inset-shadow-color': '#000000',\n\t\n\t\t'commands-color': '#ffffff',\n\t\t'commands-background': '#181818',\n\t\t'commands-header-background': '#363636',\n\t\t'commands-input-background': '#363636',\n\t\t'commands-shadow': '#151515',\n\t\n\t\t'dialog-color': '#ffffff',\n\t\t'dialog-background': '#181818',\n\t\t'dialog-header-background': '#363636',\n\t\t'dialog-shadow': '#151515',\n\t\t\n\t\t'tab-border-color': '#2a2a2a',\n\t\t'tab-background-color': '#181818',\n\t\t'tab-panel-background-color': '#181818',\n\t\t'tab-background-color-active': '#1f1f1f',\n\t\t\n\t\t'bucket-tab-background-color': '#2d2d2d',\n\t\t'bucket-tab-panel-background-color': '#252526',\n\t\t'bucket-tab-background-color-active': '#1f1f1f',\n\t\t'bucket-right-background-color': '#1e1e1e',\n\t\t'bucket-border-color': '#2a2a2a',\n\t\t'bucket-center-background-color': '#181818',\n\t\t'bucket-left-background-color': '#181818',\n\t\t'bucket-top-background-color': '#181818',\n\t\t'bucket-sidebar-background-color': '#272727',\n\t\t\n\t\t'form-background-color': '#323233',\n\t\n\t\t'colortype-yellow-background-color': '#655600',\n\t\t'colortype-yellow-border-color': '#9b8100',\n\t\t'colortype-yellow-text-color': '#ffffff',\n\t\n\t\t'colortype-green-background-color': '#015d00',\n\t\t'colortype-green-border-color': '#00b420',\n\t\t'colortype-green-text-color': '#ffffff',\n\t\n\t\t'colortype-red-background-color': '#730505',\n\t\t'colortype-red-border-color': '#fb1515',\n\t\t'colortype-red-text-color': '#ffffff',\n\t\n\t\t'colortype-blue-background-color': '#002265',\n\t\t'colortype-blue-border-color': '#007cdc',\n\t\t'colortype-blue-text-color': '#ffffff',\n\t\n\t\t'colortype-gray-background-color': '#434343',\n\t\t'colortype-gray-border-color': '#6e6e6e',\n\t\t'colortype-gray-text-color': '#ffffff',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#474747',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
1
+ {"version":3,"file":"tmDark.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC;QACjD,a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1C,qBAAqB,EAAE,SAAS;QAChC,gCAAgC,EAAE,SAAS;QAC3C,8BAA8B,EAAE,SAAS;QACzC,6BAA6B,EAAE,SAAS;QACxC,iCAAiC,EAAE,SAAS;QAE5C,uBAAuB,EAAE,SAAS;QAElC,mCAAmC,EAAE,SAAS;QAC9C,+BAA+B,EAAE,SAAS;QAC1C,6BAA6B,EAAE,SAAS;QAExC,kCAAkC,EAAE,SAAS;QAC7C,8BAA8B,EAAE,SAAS;QACzC,4BAA4B,EAAE,SAAS;QAEvC,gCAAgC,EAAE,SAAS;QAC3C,4BAA4B,EAAE,SAAS;QACvC,0BAA0B,EAAE,SAAS;QAErC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,6BAA6B,EAAE,SAAS;QAExC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'dark',\n\ttype: 'dark',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#1e1e1e',\n\t\t'button-background-color-highlight': '#3a3a3a',\n\t\t//'background': '#1e1e1e',\n\t\t'background-color': '#181818',\n\t\t'background-color-2': '#1f1f1f',\n\t\t'background-color-3': '#292929',\n\t\t'text-highlight-color': '#FFFF00',\n\t\t'text-color': '#9b9b9b',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#ffffff',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#3a3a3a',\n\t\t'border-color': '#3a3a3a',\n\t\t'border-color-2': '#2a2a2a',\n\t\t'cell-background': '#1e1e1e',\n\t\t'cell-border': '1px solid #3a3a3a',\n\t\t'hcell-background': '#2e2e2e',\n\t\t'slider-background-color': '#272727',\n\t\t'slider-background-active': '#313131',\n\t\t'slider-bar-color': '#494949',\n\t\t'slider-bar-active': '#494949',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#3F3F3F',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#000000',\n\t\t'inset-shadow-color': '#000000',\n\t\n\t\t'commands-color': '#ffffff',\n\t\t'commands-background': '#181818',\n\t\t'commands-header-background': '#363636',\n\t\t'commands-input-background': '#1D1D1D',\n\t\t'commands-shadow': '#151515',\n\t\n\t\t'dialog-color': '#ffffff',\n\t\t'dialog-background': '#181818',\n\t\t'dialog-header-background': '#363636',\n\t\t'dialog-shadow': '#151515',\n\t\t\n\t\t'tab-border-color': '#2a2a2a',\n\t\t'tab-background-color': '#181818',\n\t\t'tab-panel-background-color': '#181818',\n\t\t'tab-background-color-active': '#1f1f1f',\n\t\t\n\t\t'bucket-tab-background-color': '#2d2d2d',\n\t\t'bucket-tab-panel-background-color': '#252526',\n\t\t'bucket-tab-background-color-active': '#1f1f1f',\n\t\t'bucket-right-background-color': '#1e1e1e',\n\t\t'bucket-border-color': '#2a2a2a',\n\t\t'bucket-center-background-color': '#181818',\n\t\t'bucket-left-background-color': '#181818',\n\t\t'bucket-top-background-color': '#181818',\n\t\t'bucket-sidebar-background-color': '#272727',\n\t\t\n\t\t'form-background-color': '#323233',\n\t\n\t\t'colortype-yellow-background-color': '#655600',\n\t\t'colortype-yellow-border-color': '#9b8100',\n\t\t'colortype-yellow-text-color': '#ffffff',\n\t\n\t\t'colortype-green-background-color': '#015d00',\n\t\t'colortype-green-border-color': '#00b420',\n\t\t'colortype-green-text-color': '#ffffff',\n\t\n\t\t'colortype-red-background-color': '#730505',\n\t\t'colortype-red-border-color': '#fb1515',\n\t\t'colortype-red-text-color': '#ffffff',\n\t\n\t\t'colortype-blue-background-color': '#002265',\n\t\t'colortype-blue-border-color': '#007cdc',\n\t\t'colortype-blue-text-color': '#ffffff',\n\t\n\t\t'colortype-gray-background-color': '#434343',\n\t\t'colortype-gray-border-color': '#6e6e6e',\n\t\t'colortype-gray-text-color': '#ffffff',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#474747',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
@@ -38,7 +38,7 @@ export default {
38
38
  'commands-color': '#000000',
39
39
  'commands-background': '#ffffff',
40
40
  'commands-header-background': '#cdcdcd',
41
- 'commands-input-background': '#cdcdcd',
41
+ 'commands-input-background': '#f1f1f1',
42
42
  'commands-shadow': '#7e7e7e',
43
43
  'dialog-color': '#000000',
44
44
  'dialog-background': '#ffffff',
@@ -1 +1 @@
1
- {"version":3,"file":"tmLight.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmLight.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,eAAe;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACX,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC;QACjD,aAAa,EAAE,SAAS;QACxB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,wBAAwB;QACxC,yBAAyB,EAAE,SAAS;QACpC,mCAAmC,EAAE,SAAS;QAC9C,YAAY,EAAE,SAAS;QACvB,kBAAkB,EAAE,SAAS;QAC7B,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,SAAS;QAC/B,sBAAsB,EAAE,SAAS;QACjC,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS;QACzB,qBAAqB,EAAE,SAAS;QAChC,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE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0B,EAAE,SAAS;QAErC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,6BAA6B,EAAE,SAAS;QAExC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'light',\n\ttype: 'light',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#ffffff',\n\t\t'button-background-color-highlight': '#cccccc',\n\t\t'background': '#ffffff',\n\t\t'background-color': '#ffffff',\n\t\t'background-color-2': '#eeeeee',\n\t\t'background-color-3': '#eeeeee',\n\t\t'text-highlight-color': '#9b8400',\n\t\t'text-color': '#000000',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#000000',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#cccccc',\n\t\t'border-color': '#cccccc',\n\t\t'border-color-2': '#939393',\n\t\t'cell-background': '#ffffff',\n\t\t'cell-border': '1px solid #cccccc',\n\t\t'hcell-background': '#ececec',\n\t\t'slider-background-color': '#eeeeee',\n\t\t'slider-background-active': '#e2e2e2',\n\t\t'slider-bar-color': '#aaaaaa',\n\t\t'slider-bar-active': '#aaaaaa',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#dbdbdb',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#b7b7b7',\n\t\t'inset-shadow-color': '#707070',\n\t\t\n\t\t'commands-color': '#000000',\n\t\t'commands-background': '#ffffff',\n\t\t'commands-header-background': '#cdcdcd',\n\t\t'commands-input-background': '#cdcdcd',\n\t\t'commands-shadow': '#7e7e7e',\n\t\n\t\t'dialog-color': '#000000',\n\t\t'dialog-background': '#ffffff',\n\t\t'dialog-header-background': '#cdcdcd',\n\t\t'dialog-shadow': '#7e7e7e',\n\t\t\n\t\t'tab-border-color': '#939393',\n\t\t'tab-background-color': '#f4f4f4',\n\t\t'tab-panel-background-color': '#f4f4f4',\n\t\t'tab-background-color-active': '#ffffff',\n\t\t\n\t\t'bucket-tab-background-color': '#f4f4f4',\n\t\t'bucket-tab-panel-background-color': '#f4f4f4',\n\t\t'bucket-tab-background-color-active': '#ffffff',\n\t\t'bucket-right-background-color': '#ffffff',\n\t\t'bucket-border-color': '#939393',\n\t\t'bucket-center-background-color': '#d8d8d8',\n\t\t'bucket-left-background-color': '#f3f3f3',\n\t\t'bucket-top-background-color': '#e5e5e5',\n\t\t'bucket-sidebar-background-color': '#f3f3f3',\n\t\t\n\t\t'form-background-color': '#e5e5e5',\n\t\n\t\t'colortype-yellow-background-color': '#e2d68d',\n\t\t'colortype-yellow-border-color': '#9b8100',\n\t\t'colortype-yellow-text-color': '#000000',\n\t\n\t\t'colortype-green-background-color': '#7ecf7e',\n\t\t'colortype-green-border-color': '#00b420',\n\t\t'colortype-green-text-color': '#000000',\n\t\n\t\t'colortype-red-background-color': '#ed8181',\n\t\t'colortype-red-border-color': '#fb1515',\n\t\t'colortype-red-text-color': '#000000',\n\t\n\t\t'colortype-blue-background-color': '#88b0ff',\n\t\t'colortype-blue-border-color': '#007cdc',\n\t\t'colortype-blue-text-color': '#000000',\n\t\n\t\t'colortype-gray-background-color': '#dadada',\n\t\t'colortype-gray-border-color': '#cbcbcb',\n\t\t'colortype-gray-text-color': '#000000',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#cccccc',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
1
+ {"version":3,"file":"tmLight.js","sourceRoot":"","sources":["../../../src/themes/definitions/tmLight.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0B,EAAE,SAAS;QACrC,eAAe,EAAE,SAAS;QAE1B,kBAAkB,EAAE,SAAS;QAC7B,sBAAsB,EAAE,SAAS;QACjC,4BAA4B,EAAE,SAAS;QACvC,6BAA6B,EAAE,SAAS;QAExC,6BAA6B,EAAE,SAAS;QACxC,mCAAmC,EAAE,SAAS;QAC9C,oCAAoC,EAAE,SAAS;QAC/C,+BAA+B,EAAE,SAAS;QAC1C,qBAAqB,EAAE,SAAS;QAChC,gCAAgC,EAAE,SAAS;QAC3C,8BAA8B,EAAE,SAAS;QACzC,6BAA6B,EAAE,SAAS;QACxC,iCAAiC,EAAE,SAAS;QAE5C,uBAAuB,EAAE,SAAS;QAElC,mCAAmC,EAAE,SAAS;QAC9C,+BAA+B,EAAE,SAAS;QAC1C,6BAA6B,EAAE,SAAS;QAExC,kCAAkC,EAAE,SAAS;QAC7C,8BAA8B,EAAE,SAAS;QACzC,4BAA4B,EAAE,SAAS;QAEvC,gCAAgC,EAAE,SAAS;QAC3C,4BAA4B,EAAE,SAAS;QACvC,0BAA0B,EAAE,SAAS;QAErC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,iCAAiC,EAAE,SAAS;QAC5C,6BAA6B,EAAE,SAAS;QACxC,2BAA2B,EAAE,SAAS;QAEtC,6BAA6B,EAAE,SAAS;QAExC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;KAChC;CACQ,CAAC","sourcesContent":["import constants from '../../constants';\nimport { dom } from '../../common';\nimport { Theme } from '../../types';\n\nexport default {\n\tname: 'light',\n\ttype: 'light',\n\tdefinition: {\n\t\t'font-size': dom.numToPixels(constants.FONT_SIZE),\n\t\t'font-family': 'verdana',\n\t\t'base-radius': '3px',\n\t\t'button-color': 'var(--og-accent-color)',\n\t\t'button-background-color': '#ffffff',\n\t\t'button-background-color-highlight': '#cccccc',\n\t\t'background': '#ffffff',\n\t\t'background-color': '#ffffff',\n\t\t'background-color-2': '#eeeeee',\n\t\t'background-color-3': '#eeeeee',\n\t\t'text-highlight-color': '#9b8400',\n\t\t'text-color': '#000000',\n\t\t'text-color-2': '#ffffff',\n\t\t'text-color-3': '#000000',\n\t\t'text-color-reversed': '#ffffff',\n\t\t'border': '#cccccc',\n\t\t'border-color': '#cccccc',\n\t\t'border-color-2': '#939393',\n\t\t'cell-background': '#ffffff',\n\t\t'cell-border': '1px solid #cccccc',\n\t\t'hcell-background': '#ececec',\n\t\t'slider-background-color': '#eeeeee',\n\t\t'slider-background-active': '#e2e2e2',\n\t\t'slider-bar-color': '#aaaaaa',\n\t\t'slider-bar-active': '#aaaaaa',\n\t\t'expander-color': '#707070',\n\t\t'expander-hover': '#00955d',\n\t\t'expander-background-color': '#dbdbdb',\n\t\t'sizer-background': '#00955d',\n\t\t'frozen-border': '#b7b7b7',\n\t\t'inset-shadow-color': '#707070',\n\t\t\n\t\t'commands-color': '#000000',\n\t\t'commands-background': '#ffffff',\n\t\t'commands-header-background': '#cdcdcd',\n\t\t'commands-input-background': '#f1f1f1',\n\t\t'commands-shadow': '#7e7e7e',\n\t\n\t\t'dialog-color': '#000000',\n\t\t'dialog-background': '#ffffff',\n\t\t'dialog-header-background': '#cdcdcd',\n\t\t'dialog-shadow': '#7e7e7e',\n\t\t\n\t\t'tab-border-color': '#939393',\n\t\t'tab-background-color': '#f4f4f4',\n\t\t'tab-panel-background-color': '#f4f4f4',\n\t\t'tab-background-color-active': '#ffffff',\n\t\t\n\t\t'bucket-tab-background-color': '#f4f4f4',\n\t\t'bucket-tab-panel-background-color': '#f4f4f4',\n\t\t'bucket-tab-background-color-active': '#ffffff',\n\t\t'bucket-right-background-color': '#ffffff',\n\t\t'bucket-border-color': '#939393',\n\t\t'bucket-center-background-color': '#d8d8d8',\n\t\t'bucket-left-background-color': '#f3f3f3',\n\t\t'bucket-top-background-color': '#e5e5e5',\n\t\t'bucket-sidebar-background-color': '#f3f3f3',\n\t\t\n\t\t'form-background-color': '#e5e5e5',\n\t\n\t\t'colortype-yellow-background-color': '#e2d68d',\n\t\t'colortype-yellow-border-color': '#9b8100',\n\t\t'colortype-yellow-text-color': '#000000',\n\t\n\t\t'colortype-green-background-color': '#7ecf7e',\n\t\t'colortype-green-border-color': '#00b420',\n\t\t'colortype-green-text-color': '#000000',\n\t\n\t\t'colortype-red-background-color': '#ed8181',\n\t\t'colortype-red-border-color': '#fb1515',\n\t\t'colortype-red-text-color': '#000000',\n\t\n\t\t'colortype-blue-background-color': '#88b0ff',\n\t\t'colortype-blue-border-color': '#007cdc',\n\t\t'colortype-blue-text-color': '#000000',\n\t\n\t\t'colortype-gray-background-color': '#dadada',\n\t\t'colortype-gray-border-color': '#cbcbcb',\n\t\t'colortype-gray-text-color': '#000000',\n\t\n\t\t'colortype-accent-text-color': '#ffffff',\n\t\n\t\t'switch-background-color': '#cccccc',\n\t\t'switch-slider-color': '#ffffff',\n\t},\n} as Theme;"]}
@@ -1,13 +1,16 @@
1
1
  import { Slider } from "./slider";
2
2
  import { OmegaComponent } from "../model";
3
- import { ComponentFactory, ComponentId } from "../types";
3
+ import { ComponentFactory, ComponentId, HorizontalPosition, VerticalPosition } from "../types";
4
4
  export declare class Container extends OmegaComponent {
5
5
  static styles: import("lit").CSSResult;
6
6
  componentId: ComponentId;
7
7
  createComponent: ComponentFactory;
8
8
  overscroll: boolean;
9
+ scrollMode: 'vertical' | 'horizontal' | 'both';
9
10
  sliderSize: number;
10
11
  scrollbarPadding: boolean;
12
+ horizontalSliderPosition: VerticalPosition;
13
+ verticalSliderPosition: HorizontalPosition;
11
14
  inner: HTMLDivElement;
12
15
  private verticalSliderRef;
13
16
  get verticalSlider(): Slider;
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/ui/container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,MAAM,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OA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W,EAAE,WAAW,CAAC;IAGzB,eAAe,EAAE,gBAAgB,CAAC;IAGlC,UAAU,UAAS;IAGnB,UAAU,EAAE,UAAU,GAAC,YAAY,GAAC,MAAM,CAAc;IAGxD,UAAU,SAAK;IAGf,gBAAgB,UAAS;IAGzB,wBAAwB,EAAE,gBAAgB,CAAY;IAGtD,sBAAsB,EAAE,kBAAkB,CAAW;IAGrD,KAAK,EAAE,cAAc,CAAC;IAEtB,OAAO,CAAC,iBAAiB,CAA4B;IACrD,IAAI,cAAc,WAA0C;IAE5D,OAAO,CAAC,mBAAmB,CAA4B;IACvD,IAAI,gBAAgB,WAA4C;IAEhE,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,QAAQ,CAAS;IAEzB,IAAI,WAAW,YAA6E;IAE5F,iBAAiB;IAQjB,iBAAiB;IAKjB,oBAAoB;IAKpB,gBAAgB;IAUhB,mBAAmB;IAKnB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAc/C,gBAAgB,CAAC,GAAG,EAAE,MAAM;IAS5B,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAQjD,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAO/B,YAAY;IA2DN,OAAO;IAYb,MAAM,6CAwBJ;IAEF,IAAI,YAAY,WAEf;IAED,IAAI,WAAW,WAEd;IAED,aAAa;CAoCb"}
@@ -16,8 +16,11 @@ let Container = class Container extends OmegaComponent {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  this.overscroll = false;
19
+ this.scrollMode = 'vertical';
19
20
  this.sliderSize = 0;
20
21
  this.scrollbarPadding = false;
22
+ this.horizontalSliderPosition = 'bottom';
23
+ this.verticalSliderPosition = 'right';
21
24
  this.verticalSliderRef = createRef();
22
25
  this.horizontalSliderRef = createRef();
23
26
  this._mouseIn = false;
@@ -30,22 +33,26 @@ let Container = class Container extends OmegaComponent {
30
33
  </div>
31
34
  `}
32
35
 
33
- <og-slider ${ref(this.verticalSliderRef)}
34
- style="${styleMap(this.sliderSize > 0 ? { width: `${this.sliderSize}px` } : {})}"
35
- direction="vertical"
36
- hidden>
37
- </og-slider>
36
+ ${this.scrollMode === 'vertical' || this.scrollMode === 'both' ? html `
37
+ <og-slider ${ref(this.verticalSliderRef)}
38
+ style="${styleMap(this.sliderSize > 0 ? { width: `${this.sliderSize}px` } : {})}"
39
+ direction="vertical"
40
+ hidden>
41
+ </og-slider>
42
+ ` : ''}
38
43
 
39
- <og-slider ${ref(this.horizontalSliderRef)}
40
- style="${styleMap(this.sliderSize > 0 ? { height: `${this.sliderSize}px` } : {})}"
41
- direction="horizontal"
42
- hidden>
43
- </og-slider>
44
+ ${this.scrollMode === 'horizontal' || this.scrollMode === 'both' ? html `
45
+ <og-slider ${ref(this.horizontalSliderRef)}
46
+ style="${styleMap(this.sliderSize > 0 ? { height: `${this.sliderSize}px` } : {})}"
47
+ direction="horizontal"
48
+ hidden>
49
+ </og-slider>
50
+ ` : ''}
44
51
  `;
45
52
  }
46
53
  get verticalSlider() { return this.verticalSliderRef.value; }
47
54
  get horizontalSlider() { return this.horizontalSliderRef.value; }
48
- get isScrolling() { return this.verticalSliderRef.value.sliding || this.horizontalSliderRef.value.sliding; }
55
+ get isScrolling() { return this.verticalSlider?.sliding || this.horizontalSlider?.sliding; }
49
56
  fixScrollPosition() {
50
57
  if (this.inner.offsetTop < 0) {
51
58
  if (this.clientHeight - this.inner.offsetHeight - this.inner.offsetTop > 0) {
@@ -231,13 +238,36 @@ Container.styles = css `
231
238
  box-shadow: none;
232
239
  }
233
240
 
241
+ :host([horizontalSliderPosition="top"]) og-slider[direction="horizontal"] {
242
+ left: 0;
243
+ right: 0;
244
+ top: 0;
245
+ bottom: auto;
246
+ }
247
+
248
+ :host([horizontalSliderPosition="left"]) og-slider[direction="vertical"] {
249
+ left: 0;
250
+ right: auto;
251
+ top: 0;
252
+ bottom: 0;
253
+ }
254
+
234
255
  og-slider[direction="vertical"] {
235
256
  right: 0;
236
257
  top: 0;
237
258
  bottom: 0;
238
259
  }
239
260
 
240
- .inner {
261
+ :host([scrollMode="horizontal"]) .inner {
262
+ width: auto;
263
+ min-width: 100%;
264
+ position: absolute;
265
+ top: 0;
266
+ left: 0;
267
+ }
268
+
269
+ :host([scrollMode="vertical"]) .inner,
270
+ :host([scrollMode="both"]) .inner {
241
271
  width: 100%;
242
272
  }
243
273
 
@@ -258,12 +288,21 @@ __decorate([
258
288
  __decorate([
259
289
  property({ type: Boolean })
260
290
  ], Container.prototype, "overscroll", void 0);
291
+ __decorate([
292
+ property({ type: String, reflect: true })
293
+ ], Container.prototype, "scrollMode", void 0);
261
294
  __decorate([
262
295
  property({ type: Number })
263
296
  ], Container.prototype, "sliderSize", void 0);
264
297
  __decorate([
265
298
  property({ type: Boolean, reflect: true })
266
299
  ], Container.prototype, "scrollbarPadding", void 0);
300
+ __decorate([
301
+ property({ type: String, reflect: true })
302
+ ], Container.prototype, "horizontalSliderPosition", void 0);
303
+ __decorate([
304
+ property({ type: String, reflect: true })
305
+ ], Container.prototype, "verticalSliderPosition", void 0);
267
306
  __decorate([
268
307
  query('.inner')
269
308
  ], Container.prototype, "inner", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/ui/container.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAU,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAO,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAA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C,KAAK,CAAC,QAAQ,CAAC;wCACM;AArDV,SAAS;IADrB,aAAa,CAAC,cAAc,CAAC;GACjB,SAAS,CAmRrB","sourcesContent":["import * as dom from \"../common/dom\";\nimport { html, css } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { SlideEvent, Slider } from \"./slider\";\nimport { createRef, Ref, ref } from \"lit/directives/ref.js\";\nimport { OmegaComponent } from \"../model\";\nimport { ComponentFactory, ComponentId } from \"../types\";\nimport constants from \"../constants\";\nimport { styleMap } from \"lit-html/directives/style-map.js\";\n\n@customElement('og-container')\nexport class Container extends OmegaComponent {\n\n\tstatic styles = css`\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host {\n\t\t\tposition: relative;\n\t\t\tdisplay: block;\n\t\t\toverflow: hidden;\n\t\t\tbox-shadow: inset 0px 4px 3px -2px var(--og-inset-shadow-color);\n\t\t}\n\n\t\t:host(.scroll-top-0) {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\tog-slider[direction=\"vertical\"] {\n\t\t\tright: 0;\n\t\t\ttop: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\t.inner {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t:host([scrollbarPadding]) .inner {\n\t\t\tright: ${constants.SLIDER_SIZE}px;\n\t\t}\n\n\t\t:host([scrollbarPadding]) {\t\n\t\t\tpadding-right: ${constants.SLIDER_SIZE}px;\n\t\t}\n\t`;\n\n\t@property({type: String})\n\tcomponentId: ComponentId;\n\n\t@property({type: Object})\n\tcreateComponent: ComponentFactory;\n\n\t@property({type: Boolean})\n\toverscroll = false;\n\n\t@property({type: Number})\n\tsliderSize = 0;\n\n\t@property({type: Boolean, reflect: true})\n\tscrollbarPadding = false;\n\n\t@query('.inner')\n\tinner: HTMLDivElement;\n\n\tprivate verticalSliderRef: Ref<Slider> = createRef();\n\tget verticalSlider() { return this.verticalSliderRef.value }\n\t\n\tprivate horizontalSliderRef: Ref<Slider> = createRef();\n\tget horizontalSlider() { return this.horizontalSliderRef.value }\n\n\tprivate resizeObserver: ResizeObserver;\n\tprivate touchStart: Touch;\n\tprivate _mouseIn = false;\n\t\n\tget isScrolling() { return this.verticalSliderRef.value.sliding || this.horizontalSliderRef.value.sliding; }\n\n\tfixScrollPosition() {\n\t\tif (this.inner.offsetTop < 0) {\n\t\t\tif (this.clientHeight - this.inner.offsetHeight - this.inner.offsetTop > 0) {\n\t\t\t\tthis.scrollVerticalTo(Math.max(0, this.inner.offsetHeight - this.clientHeight));\n\t\t\t}\n\t\t}\n\t}\n\t\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.connectObservers();\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.disconnectObservers();\n\t}\n\n\tconnectObservers() {\n\t\tthis.resizeObserver = this.resizeObserver ?? new ResizeObserver(() => {\n\t\t\tthis.updateSliders();\n\t\t\tthis.fixScrollPosition();\n\t\t});\n\n\t\tthis.resizeObserver.observe(this);\n\t\tif (this.inner)\tthis.resizeObserver.observe(this.inner);\n\t}\n\n\tdisconnectObservers() {\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.resizeObserver = null;\n\t}\n\n\tscrollVerticalByPixels(deltaY: number): boolean {\n\t\tif (this.inner.offsetHeight <= this.clientHeight) return false;\n\t\tconst top = this.scrollHeight > 0\n\t\t\t? (Math.max(-this.verticalSlider.maxValue, Math.min(0, this.inner.offsetTop - deltaY)) ?? 0)\n\t\t\t: 0;\n\n\t\tif (this.inner.offsetTop === top) return false;\n\t\tdom.setPosition(this.inner, {t: top});\n\t\tthis.verticalSlider.value = -top;\n\t\tthis.classList.toggle('scroll-top-0', top === 0);\n\t\tthis.dispatchEvent(new SlideEvent('verticalscroll', -top));\n\t\treturn true;\n\t}\n\n\tscrollVerticalTo(top: number) {\n\t\tif (this.inner) {\n\t\t\ttop = Math.min(this.verticalSlider?.maxValue || 0, Math.max(0, top));\n\t\t\tdom.setPosition(this.inner, {t: -top});\n\t\t\tthis.classList.toggle('scroll-top-0', top === 0);\n\t\t\tif (this.verticalSlider) this.verticalSlider.value = top;\n\t\t}\n\t}\n\t\n\tscrollHorizontalByPixels(deltaX: number): boolean {\n\t\tconst left = Math.max(-this.horizontalSliderRef.value.maxValue, Math.min(0, this.inner.offsetLeft - deltaX)) ?? 0;\n\t\tif (this.inner.offsetLeft == left) return false;\n\t\tdom.setPosition(this.inner, {l: left});\n\t\tthis.horizontalSliderRef.value.value = left;\n\t\treturn true;\n\t}\n\t\n\tscrollHorizontalTo(left: number) {\n\t\tif (this.inner) {\n\t\t\tdom.setPosition(this.inner, {l: -left});\n\t\t\tif (this.horizontalSlider) this.horizontalSlider.value = left;\n\t\t}\n\t}\n\t\n\tfirstUpdated() {\n\t\tthis.connectObservers();\n\t\tthis.classList.add('scroll-top-0');\n\t\tthis.verticalSlider?.hide();\n\t\tthis.horizontalSlider?.hide();\n\t\t\n\t\tthis.verticalSlider?.addEventListener('slide', (e: SlideEvent) => {\n\t\t\tthis.scrollVerticalTo(e.value);\n\t\t\tthis.dispatchEvent(new SlideEvent('verticalscroll', e.value));\n\t\t});\n\t\tthis.horizontalSlider?.addEventListener('slide', (e: SlideEvent) => {\n\t\t\tthis.scrollHorizontalTo(e.value);\n\t\t\tthis.dispatchEvent(new SlideEvent('horizontalscroll', e.value));\n\t\t});\n\n\t\tthis.verticalSlider?.addEventListener('slideEnd', () => {\n\t\t\tthis.updateSliders();\n\t\t});\n\n\t\tthis.addEventListener('mouseenter', () => {\n\t\t\tthis._mouseIn = true;\n\t\t\tthis.updateSliders();\n\t\t});\n\n\t\tthis.addEventListener('mouseleave', () => {\n\t\t\tthis._mouseIn = false;\n\t\t\tthis.updateSliders();\n\t\t});\n\n\t\tthis.addEventListener('wheel', (e) => {\n\t\t\tif (e.deltaY != 0) {\n\t\t\t\tif (this.scrollVerticalByPixels(e.deltaY)) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}\n\t\t}, {passive: true});\n\n\t\tthis.addEventListener('touchstart', e => {\n\t\t\tthis.touchStart = e.touches[0];\n\t\t\tthis._mouseIn = true;\n\t\t}, {passive: true});\n\n\t\tthis.addEventListener('touchend', () => {\n\t\t\tthis.touchStart = null;\n\t\t\tthis._mouseIn = false;\n\t\t\tthis.updateSliders();\n\t\t}, {passive: true});\n\n\t\tthis.addEventListener('touchmove', (e: TouchEvent) => {\n\t\t\tif (this.touchStart) {\n\t\t\t\tconst touch = e.touches[0];\n\t\t\t\tthis.scrollVerticalByPixels(this.touchStart.clientY - touch.clientY);\n\t\t\t\tthis.scrollVerticalByPixels(this.touchStart.clientX - touch.clientX);\n\t\t\t\tthis.updateSliders();\n\t\t\t\tthis.touchStart = touch;\n\t\t\t}\n\t\t}, {passive: true});\n\t}\n\n\tasync updated() {\n\t\tif (this.createComponent) {\n\t\t\tdom.empty(this.inner);\n\t\t\tthis.inner.appendChild(await this.createComponent(this.componentId));\n\t\t}\n\n\t\t// set absolute poitioning if height is set to allow proper scrolling\n\t\tif (this.inner.style.height && this.inner.style.position !== 'absolute') {\n\t\t\tdom.setPosition(this.inner, {t: 0, l: 0});\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t${this.createComponent ? html`\n\t\t\t<div class=\"inner\"></div>\n\t\t` : html`\n\t\t\t<div class=\"inner\">\n\t\t\t\t<slot name=\"content\"></slot>\n\t\t\t</div>\n\t\t`}\n\t\t\n\t\t<og-slider ${ref(this.verticalSliderRef)}\n\t\t\tstyle=\"${styleMap(this.sliderSize > 0 ? {width: `${this.sliderSize}px`} : {})}\"\n\t\t\tdirection=\"vertical\"\n\t\t\thidden>\n\t\t</og-slider>\n\t\t\n\t\t<og-slider ${ref(this.horizontalSliderRef)}\n\t\t\tstyle=\"${styleMap(this.sliderSize > 0 ? {height: `${this.sliderSize}px`} : {})}\"\n\t\t\tdirection=\"horizontal\" \n\t\t\thidden>\n\t\t</og-slider>\n\t`;\n\n\tget scrollHeight() {\n\t\treturn this.inner?.clientHeight - (this.overscroll ? 0 : this.clientHeight);\n\t}\n\n\tget scrollWidth() {\n\t\treturn this.inner?.clientWidth - this.clientWidth;\n\t}\n\n\tupdateSliders() {\n\t\tif (this.verticalSliderRef.value) {\n\t\t\tconst containerHeight = this.clientHeight;\n\t\t\t\n\t\t\tif (containerHeight < this.inner.clientHeight) {\n\t\t\t\tthis.verticalSliderRef.value.pageSize = containerHeight;\n\t\t\t\tthis.verticalSliderRef.value.maxValue = this.scrollHeight;\n\t\t\t\tthis.verticalSliderRef.value.requestUpdate();\n\t\t\t\tif (this._mouseIn || this.verticalSliderRef.value.sliding) {\n\t\t\t\t\tthis.verticalSliderRef.value.show();\n\t\t\t\t} else {\n\t\t\t\t\tthis.verticalSliderRef.value.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.verticalSliderRef.value.hide();\n\t\t\t}\n\t\t}\n\n\t\tif (this.horizontalSliderRef.value) {\n\t\t\tconst containerWidth = this.clientWidth;\n\t\t\t\n\t\t\tif (containerWidth < this.inner.clientWidth) {\n\t\t\t\tthis.horizontalSliderRef.value.pageSize = containerWidth;\n\t\t\t\tthis.horizontalSliderRef.value.maxValue = this.scrollWidth;\n\t\t\t\tthis.horizontalSliderRef.value.requestUpdate();\n\t\t\t\tif (this._mouseIn || this.horizontalSliderRef.value.sliding) {\n\t\t\t\t\tthis.horizontalSliderRef.value.show();\n\t\t\t\t} else {\n\t\t\t\t\tthis.horizontalSliderRef.value.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.horizontalSliderRef.value.hide();\n\t\t\t}\n\t\t}\n\t}\n\n}"]}
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/ui/container.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK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AmB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC;QACF,CAAC;IACF,CAAC;;AAnTM,gBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkDR,SAAS,CAAC,WAAW;;;;oBAIb,SAAS,CAAC,WAAW;;EAEvC,AAxDY,CAwDX;AAGF;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CACA;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACS;AAGlC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;6CACP;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACgB;AAGxD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACV;AAGf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDAChB;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2DACc;AAGtD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yDACa;AAGrD;IADC,KAAK,CAAC,QAAQ,CAAC;wCACM;AArFV,SAAS;IADrB,aAAa,CAAC,cAAc,CAAC;GACjB,SAAS,CAuTrB","sourcesContent":["import * as dom from \"../common/dom\";\nimport { html, css } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { SlideEvent, Slider } from \"./slider\";\nimport { createRef, Ref, ref } from \"lit/directives/ref.js\";\nimport { OmegaComponent } from \"../model\";\nimport { ComponentFactory, ComponentId, HorizontalPosition, VerticalPosition } from \"../types\";\nimport constants from \"../constants\";\nimport { styleMap } from \"lit-html/directives/style-map.js\";\n\n@customElement('og-container')\nexport class Container extends OmegaComponent {\n\n\tstatic styles = css`\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host {\n\t\t\tposition: relative;\n\t\t\tdisplay: block;\n\t\t\toverflow: hidden;\n\t\t\tbox-shadow: inset 0px 4px 3px -2px var(--og-inset-shadow-color);\n\t\t}\n\n\t\t:host(.scroll-top-0) {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t:host([horizontalSliderPosition=\"top\"]) og-slider[direction=\"horizontal\"] {\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\ttop: 0;\n\t\t\tbottom: auto;\n\t\t}\n\n\t\t:host([horizontalSliderPosition=\"left\"]) og-slider[direction=\"vertical\"] {\n\t\t\tleft: 0;\n\t\t\tright: auto;\n\t\t\ttop: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\tog-slider[direction=\"vertical\"] {\n\t\t\tright: 0;\n\t\t\ttop: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\t:host([scrollMode=\"horizontal\"]) .inner {\n\t\t\twidth: auto;\n\t\t\tmin-width: 100%;\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t}\n\n\t\t:host([scrollMode=\"vertical\"]) .inner,\n\t\t:host([scrollMode=\"both\"]) .inner {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t:host([scrollbarPadding]) .inner {\n\t\t\tright: ${constants.SLIDER_SIZE}px;\n\t\t}\n\n\t\t:host([scrollbarPadding]) {\t\n\t\t\tpadding-right: ${constants.SLIDER_SIZE}px;\n\t\t}\n\t`;\n\n\t@property({type: String})\n\tcomponentId: ComponentId;\n\n\t@property({type: Object})\n\tcreateComponent: ComponentFactory;\n\n\t@property({type: Boolean})\n\toverscroll = false;\n\n\t@property({type: String, reflect: true})\n\tscrollMode: 'vertical'|'horizontal'|'both' = 'vertical';\n\n\t@property({type: Number})\n\tsliderSize = 0;\n\n\t@property({type: Boolean, reflect: true})\n\tscrollbarPadding = false;\n\n\t@property({type: String, reflect: true})\n\thorizontalSliderPosition: VerticalPosition = 'bottom';\n\n\t@property({type: String, reflect: true})\n\tverticalSliderPosition: HorizontalPosition = 'right';\n\n\t@query('.inner')\n\tinner: HTMLDivElement;\n\n\tprivate verticalSliderRef: Ref<Slider> = createRef();\n\tget verticalSlider() { return this.verticalSliderRef.value }\n\t\n\tprivate horizontalSliderRef: Ref<Slider> = createRef();\n\tget horizontalSlider() { return this.horizontalSliderRef.value }\n\n\tprivate resizeObserver: ResizeObserver;\n\tprivate touchStart: Touch;\n\tprivate _mouseIn = false;\n\n\tget isScrolling() { return this.verticalSlider?.sliding || this.horizontalSlider?.sliding; }\n\n\tfixScrollPosition() {\n\t\tif (this.inner.offsetTop < 0) {\n\t\t\tif (this.clientHeight - this.inner.offsetHeight - this.inner.offsetTop > 0) {\n\t\t\t\tthis.scrollVerticalTo(Math.max(0, this.inner.offsetHeight - this.clientHeight));\n\t\t\t}\n\t\t}\n\t}\n\t\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.connectObservers();\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.disconnectObservers();\n\t}\n\n\tconnectObservers() {\n\t\tthis.resizeObserver = this.resizeObserver ?? new ResizeObserver(() => {\n\t\t\tthis.updateSliders();\n\t\t\tthis.fixScrollPosition();\n\t\t});\n\n\t\tthis.resizeObserver.observe(this);\n\t\tif (this.inner)\tthis.resizeObserver.observe(this.inner);\n\t}\n\n\tdisconnectObservers() {\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.resizeObserver = null;\n\t}\n\n\tscrollVerticalByPixels(deltaY: number): boolean {\n\t\tif (this.inner.offsetHeight <= this.clientHeight) return false;\n\t\tconst top = this.scrollHeight > 0\n\t\t\t? (Math.max(-this.verticalSlider.maxValue, Math.min(0, this.inner.offsetTop - deltaY)) ?? 0)\n\t\t\t: 0;\n\n\t\tif (this.inner.offsetTop === top) return false;\n\t\tdom.setPosition(this.inner, {t: top});\n\t\tthis.verticalSlider.value = -top;\n\t\tthis.classList.toggle('scroll-top-0', top === 0);\n\t\tthis.dispatchEvent(new SlideEvent('verticalscroll', -top));\n\t\treturn true;\n\t}\n\n\tscrollVerticalTo(top: number) {\n\t\tif (this.inner) {\n\t\t\ttop = Math.min(this.verticalSlider?.maxValue || 0, Math.max(0, top));\n\t\t\tdom.setPosition(this.inner, {t: -top});\n\t\t\tthis.classList.toggle('scroll-top-0', top === 0);\n\t\t\tif (this.verticalSlider) this.verticalSlider.value = top;\n\t\t}\n\t}\n\t\n\tscrollHorizontalByPixels(deltaX: number): boolean {\n\t\tconst left = Math.max(-this.horizontalSliderRef.value.maxValue, Math.min(0, this.inner.offsetLeft - deltaX)) ?? 0;\n\t\tif (this.inner.offsetLeft == left) return false;\n\t\tdom.setPosition(this.inner, {l: left});\n\t\tthis.horizontalSliderRef.value.value = left;\n\t\treturn true;\n\t}\n\t\n\tscrollHorizontalTo(left: number) {\n\t\tif (this.inner) {\n\t\t\tdom.setPosition(this.inner, {l: -left});\n\t\t\tif (this.horizontalSlider) this.horizontalSlider.value = left;\n\t\t}\n\t}\n\t\n\tfirstUpdated() {\n\t\tthis.connectObservers();\n\t\tthis.classList.add('scroll-top-0');\n\t\tthis.verticalSlider?.hide();\n\t\tthis.horizontalSlider?.hide();\n\t\t\n\t\tthis.verticalSlider?.addEventListener('slide', (e: SlideEvent) => {\n\t\t\tthis.scrollVerticalTo(e.value);\n\t\t\tthis.dispatchEvent(new SlideEvent('verticalscroll', e.value));\n\t\t});\n\t\tthis.horizontalSlider?.addEventListener('slide', (e: SlideEvent) => {\n\t\t\tthis.scrollHorizontalTo(e.value);\n\t\t\tthis.dispatchEvent(new SlideEvent('horizontalscroll', e.value));\n\t\t});\n\n\t\tthis.verticalSlider?.addEventListener('slideEnd', () => {\n\t\t\tthis.updateSliders();\n\t\t});\n\n\t\tthis.addEventListener('mouseenter', () => {\n\t\t\tthis._mouseIn = true;\n\t\t\tthis.updateSliders();\n\t\t});\n\n\t\tthis.addEventListener('mouseleave', () => {\n\t\t\tthis._mouseIn = false;\n\t\t\tthis.updateSliders();\n\t\t});\n\n\t\tthis.addEventListener('wheel', (e) => {\n\t\t\tif (e.deltaY != 0) {\n\t\t\t\tif (this.scrollVerticalByPixels(e.deltaY)) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}\n\t\t}, {passive: true});\n\n\t\tthis.addEventListener('touchstart', e => {\n\t\t\tthis.touchStart = e.touches[0];\n\t\t\tthis._mouseIn = true;\n\t\t}, {passive: true});\n\n\t\tthis.addEventListener('touchend', () => {\n\t\t\tthis.touchStart = null;\n\t\t\tthis._mouseIn = false;\n\t\t\tthis.updateSliders();\n\t\t}, {passive: true});\n\n\t\tthis.addEventListener('touchmove', (e: TouchEvent) => {\n\t\t\tif (this.touchStart) {\n\t\t\t\tconst touch = e.touches[0];\n\t\t\t\tthis.scrollVerticalByPixels(this.touchStart.clientY - touch.clientY);\n\t\t\t\tthis.scrollVerticalByPixels(this.touchStart.clientX - touch.clientX);\n\t\t\t\tthis.updateSliders();\n\t\t\t\tthis.touchStart = touch;\n\t\t\t}\n\t\t}, {passive: true});\n\t}\n\n\tasync updated() {\n\t\tif (this.createComponent) {\n\t\t\tdom.empty(this.inner);\n\t\t\tthis.inner.appendChild(await this.createComponent(this.componentId));\n\t\t}\n\n\t\t// set absolute poitioning if height is set to allow proper scrolling\n\t\tif (this.inner.style.height && this.inner.style.position !== 'absolute') {\n\t\t\tdom.setPosition(this.inner, {t: 0, l: 0});\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t${this.createComponent ? html`\n\t\t\t<div class=\"inner\"></div>\n\t\t` : html`\n\t\t\t<div class=\"inner\">\n\t\t\t\t<slot name=\"content\"></slot>\n\t\t\t</div>\n\t\t`}\n\t\t\n\t\t${this.scrollMode === 'vertical' || this.scrollMode === 'both' ? html`\n\t\t\t<og-slider ${ref(this.verticalSliderRef)}\n\t\t\t\tstyle=\"${styleMap(this.sliderSize > 0 ? {width: `${this.sliderSize}px`} : {})}\"\n\t\t\t\tdirection=\"vertical\"\n\t\t\t\thidden>\n\t\t\t</og-slider>\t\n\t\t` : ''}\n\t\t\n\t\t${this.scrollMode === 'horizontal' || this.scrollMode === 'both' ? html`\n\t\t\t<og-slider ${ref(this.horizontalSliderRef)}\n\t\t\t\tstyle=\"${styleMap(this.sliderSize > 0 ? {height: `${this.sliderSize}px`} : {})}\"\n\t\t\t\tdirection=\"horizontal\" \n\t\t\t\thidden>\n\t\t\t</og-slider>\n\t\t` : ''}\n\t`;\n\n\tget scrollHeight() {\n\t\treturn this.inner?.clientHeight - (this.overscroll ? 0 : this.clientHeight);\n\t}\n\n\tget scrollWidth() {\n\t\treturn this.inner?.clientWidth - this.clientWidth;\n\t}\n\n\tupdateSliders() {\n\t\tif (this.verticalSliderRef.value) {\n\t\t\tconst containerHeight = this.clientHeight;\n\t\t\t\n\t\t\tif (containerHeight < this.inner.clientHeight) {\n\t\t\t\tthis.verticalSliderRef.value.pageSize = containerHeight;\n\t\t\t\tthis.verticalSliderRef.value.maxValue = this.scrollHeight;\n\t\t\t\tthis.verticalSliderRef.value.requestUpdate();\n\t\t\t\tif (this._mouseIn || this.verticalSliderRef.value.sliding) {\n\t\t\t\t\tthis.verticalSliderRef.value.show();\n\t\t\t\t} else {\n\t\t\t\t\tthis.verticalSliderRef.value.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.verticalSliderRef.value.hide();\n\t\t\t}\n\t\t}\n\n\t\tif (this.horizontalSliderRef.value) {\n\t\t\tconst containerWidth = this.clientWidth;\n\t\t\t\n\t\t\tif (containerWidth < this.inner.clientWidth) {\n\t\t\t\tthis.horizontalSliderRef.value.pageSize = containerWidth;\n\t\t\t\tthis.horizontalSliderRef.value.maxValue = this.scrollWidth;\n\t\t\t\tthis.horizontalSliderRef.value.requestUpdate();\n\t\t\t\tif (this._mouseIn || this.horizontalSliderRef.value.sliding) {\n\t\t\t\t\tthis.horizontalSliderRef.value.show();\n\t\t\t\t} else {\n\t\t\t\t\tthis.horizontalSliderRef.value.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.horizontalSliderRef.value.hide();\n\t\t\t}\n\t\t}\n\t}\n\n}"]}
@@ -185,7 +185,7 @@ Dropdown.styles = [css `
185
185
 
186
186
  div.text {
187
187
  flex: 1;
188
- color: var(--og-text-color-2);
188
+ color: var(--og-text-color-1);
189
189
  padding-left: 2px;
190
190
  white-space: nowrap;
191
191
  text-overflow: ellipsis;
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/ui/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAU,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,OAAO,aAAc,SAAQ,KAAK;IAEvC,YAAY,KAAa;QACxB,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;IAC5B,CAAC;CACD;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAsBhD;QACC,KAAK,EAAE,CAAC;Q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AAC,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAE,CAAC;SAC/E,CAAC,CAAC;QAEH,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;;AApLM,eAAM,GAAG,CAAC,GAAG,CAAA;;;;;;;;;;;;aAYR,SAAS,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;EAuBlC,CAAC,AAnCW,CAmCV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;2CACW;AAGpC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACN;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACmB;AAG5C;IADC,QAAQ,EAAE;uCAC8B;AAGzC;IADC,QAAQ,EAAE;sCACW;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACX;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACd;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACV;AAGhB;IADC,KAAK,CAAC,QAAQ,CAAC;0CACS;AAhEb,QAAQ;IAFpB,aAAa,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAClB,QAAQ,CAwLpB","sourcesContent":["import { LitElement, html, css, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ColorTypes, Layout } from '../types';\nimport * as dom from '../common/dom';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { guard } from 'lit/directives/guard.js';\nimport { IconSpec } from './icon';\nimport { utils } from '../common';\nimport { colorable } from '../themes';\nimport constants from '../constants';\n\nexport class DropdownEvent extends Event {\n\n\tconstructor(event: string) {\n\t\tsuper(`dropdown.${event}`);\n\t}\n}\n\n@customElement('og-dropdown-container')\nexport class DropdownContainer extends LitElement {\n\n\tstatic styles = css`\n\t\t:host {\n\t\t\tborder: 1px solid var(--og-accent-color);\n\t\t\tbackground-color: var(--og-background-color);\n\t\t\tposition: absolute;\n\t\t\toverflow: hidden;\n\t\t\tbox-sizing: border-box;\n\t\t\tcolor: var(--og-text-color);\n\t\t\tz-index: 60000;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-top-right-radius: 0;\n\t\t}\n\t`;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', (e: MouseEvent) => e.stopPropagation());\n\t}\n\n\trender = () => html`<div><slot name=\"inner-content\"></slot></div>`;\n}\n\n@customElement('og-dropdown')\n@colorable({props: ['border']})\nexport class Dropdown extends LitElement implements Layout {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: flex;\n\t\t\talign-items: stretch;\n\t\t\tflex-direction: row;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\toutline: none;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t\theight: ${constants.BUTTON_HEIGHT}px;\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\tdiv.text {\n\t\t\tflex: 1;\n\t\t\tcolor: var(--og-text-color-2);\n\t\t\tpadding-left: 2px;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tog-button {\n\t\t\tflex: 1;\n\t\t\tborder-radius: 0;\n\t\t\tborder: none;\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: String})\n\talignment: 'left'|'right' = 'right';\n\n\t@property({type: Number})\n\tpositionOffset = 0;\n\n\t@property({type: Object})\n\tdropdownParent: HTMLElement = document.body;\n\n\t@property()\n\tlabel: string|HTMLElement|TemplateResult;\n\n\t@property()\n\ticon: IconSpec|string;\n\n\t@property({type: Number})\n\twidth: number;\n\n\t@property({type: String, reflect: true})\n\tcolor = ColorTypes.Accent;\n\n\t@property({type: Boolean})\n\tnoCaret = false;\n\n\t@query('.label')\n\tlabelElm: HTMLDivElement;\n\n\tprivate _contentElm: HTMLElement;\n\n\tprotected dropdownRef = createRef<DropdownContainer>();\n\tget dropdown() { return this.dropdownRef?.value }\n\n\tget isOpen() { return this.dropdown && !dom.isHidden(this.dropdown) }\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\t_onDocumentMouseDown = (e: MouseEvent) => {\n\t\tfor (const elm of e.composedPath()) {\n\t\t\tif (elm == this.dropdown || elm == this) return;\n\t\t}\n\t\tthis.close();\n\t}\n\n\tasync open() {\n\t\tthis.dispatchEvent(new DropdownEvent('beforeOpen'));\n\t\tawait this.updateComplete;\n\t\t\n\t\tif (this.dropdown.parentElement !== this.dropdownParent) {\n\t\t\tthis.dropdownParent.appendChild(this.dropdown);\n\t\t}\n\n\t\tif (this.children.length > 0 && !this._contentElm) {\n\t\t\tthis._contentElm = [...this.children].find(elm => elm.slot == 'content') as HTMLElement;\n\t\t\tif (this._contentElm) {\n\t\t\t\tthis._contentElm.slot = 'inner-content';\n\t\t\t\tthis.dropdown.appendChild(this._contentElm);\n\t\t\t}\n\t\t}\n\n\t\tif (this.width > 0) dom.setSize(this.dropdown, {w: this.width});\n\t\tdom.showElement(this.dropdown);\n\t\tthis.requestUpdate();\n\t\tawait this.dropdown.updateComplete;\n\t\tthis.dispatchEvent(new DropdownEvent('open'));\n\t\tthis.layout();\n\t\tdocument.body.addEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\tclose() {\n\t\tif (this.dropdown) dom.hideElement(this.dropdown);\n\t\tthis.layout();\n\t\tdocument.body.removeEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\ttoggle() {\n\t\tif (this.isOpen) this.close();\n\t\telse this.open();\n\t}\n\n\t_onMousedown = async () => this.toggle();\n\n\tdisconnectedCallback() {\n\t\tthis.dropdown?.remove();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\trenderDropdown = () => html`\n\t\t<og-dropdown-container ${ref(this.dropdownRef)}\n\t\t\tstyle=\"display: none\">\n\t\t</og-dropdown-container>\n\t`;\n\n\trenderLabel = () => {\n\t\tif (utils.isString(this.label)) {\n\t\t\treturn this.label === '' ? unsafeHTML('&nbsp;') : html`<div class=\"text\">${this.label}</div>`;\n\t\t} else {\n\t\t\treturn this.label;\n\t\t}\n\t};\n\n\tget hasLabelSlot() {\n\t\treturn this.querySelector('[slot=\"label\"]') != null;\n\t}\n\n\tget hasLabel() {\n\t\treturn this.label !== '' && this.label != null;\n\t}\n\n\trender = () => html`\n\t\t<og-button\n\t\t\t@mousedown=\"${this._onMousedown}\"\n\t\t\tclass=\"main\"\n\t\t\tcolor=\"${this.color}\"\n\t\t\t.icon=\"${this.icon}\"\n\t\t\t?caret=\"${!this.noCaret}\">\n\t\t\t${this.hasLabelSlot ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\"><slot name=\"label\"></slot></div>\n\t\t\t` : guard([this.label], () => (this.hasLabel ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\">${this.renderLabel()}</div>\n\t\t\t` : ''))}\n\t\t</og-button>\n\n\t\t${this.renderDropdown()}\n\t`;\n\n\tlayout() {\n\t\tthis.classList.toggle('radiusfix', this.isOpen);\n\t\tif (!this.dropdown) return;\n\t\tthis.dropdown.classList.toggle('radiusfix', this.isOpen);\n\t\tif (!this.isOpen) return;\n\n\t\tconst offset = dom.getElementOffset(this, this.dropdownParent);\n\t\tdom.setSize(this.dropdown, {w: this.offsetWidth}, true);\n\t\tdom.setPosition(this.dropdown, {\n\t\t\tt: offset.top + this.offsetHeight - 1, \n\t\t\tl: this.positionOffset + (this.alignment == 'left' \n\t\t\t\t? offset.left : (offset.left + this.offsetWidth - this.dropdown.offsetWidth ))\n\t\t});\n\n\t\tdom.fixElementPosition(this.dropdown);\n\t}\n\n}"]}
1
+ {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/ui/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAU,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,OAAO,aAAc,SAAQ,KAAK;IAEvC,YAAY,KAAa;QACxB,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;IAC5B,CAAC;CACD;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAsBhD;QACC,KAAK,EAAE,CAAC;QAIT,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA,+CAA+C,CAAC;QAHl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AAC,QAAQ,CAAC,WAAW,CAAE,CAAC;SAC/E,CAAC,CAAC;QAEH,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;;AApLM,eAAM,GAAG,CAAC,GAAG,CAAA;;;;;;;;;;;;aAYR,SAAS,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;EAuBlC,CAAC,AAnCW,CAmCV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;2CACW;AAGpC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACN;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACmB;AAG5C;IADC,QAAQ,EAAE;uCAC8B;AAGzC;IADC,QAAQ,EAAE;sCACW;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACX;AAGd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACd;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACV;AAGhB;IADC,KAAK,CAAC,QAAQ,CAAC;0CACS;AAhEb,QAAQ;IAFpB,aAAa,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAClB,QAAQ,CAwLpB","sourcesContent":["import { LitElement, html, css, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ColorTypes, Layout } from '../types';\nimport * as dom from '../common/dom';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { createRef, ref } from 'lit-html/directives/ref.js';\nimport { guard } from 'lit/directives/guard.js';\nimport { IconSpec } from './icon';\nimport { utils } from '../common';\nimport { colorable } from '../themes';\nimport constants from '../constants';\n\nexport class DropdownEvent extends Event {\n\n\tconstructor(event: string) {\n\t\tsuper(`dropdown.${event}`);\n\t}\n}\n\n@customElement('og-dropdown-container')\nexport class DropdownContainer extends LitElement {\n\n\tstatic styles = css`\n\t\t:host {\n\t\t\tborder: 1px solid var(--og-accent-color);\n\t\t\tbackground-color: var(--og-background-color);\n\t\t\tposition: absolute;\n\t\t\toverflow: hidden;\n\t\t\tbox-sizing: border-box;\n\t\t\tcolor: var(--og-text-color);\n\t\t\tz-index: 60000;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-top-right-radius: 0;\n\t\t}\n\t`;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', (e: MouseEvent) => e.stopPropagation());\n\t}\n\n\trender = () => html`<div><slot name=\"inner-content\"></slot></div>`;\n}\n\n@customElement('og-dropdown')\n@colorable({props: ['border']})\nexport class Dropdown extends LitElement implements Layout {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: flex;\n\t\t\talign-items: stretch;\n\t\t\tflex-direction: row;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\toutline: none;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t\theight: ${constants.BUTTON_HEIGHT}px;\n\t\t}\n\n\t\t:host(.radiusfix) {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\tdiv.text {\n\t\t\tflex: 1;\n\t\t\tcolor: var(--og-text-color-1);\n\t\t\tpadding-left: 2px;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tog-button {\n\t\t\tflex: 1;\n\t\t\tborder-radius: 0;\n\t\t\tborder: none;\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: String})\n\talignment: 'left'|'right' = 'right';\n\n\t@property({type: Number})\n\tpositionOffset = 0;\n\n\t@property({type: Object})\n\tdropdownParent: HTMLElement = document.body;\n\n\t@property()\n\tlabel: string|HTMLElement|TemplateResult;\n\n\t@property()\n\ticon: IconSpec|string;\n\n\t@property({type: Number})\n\twidth: number;\n\n\t@property({type: String, reflect: true})\n\tcolor = ColorTypes.Accent;\n\n\t@property({type: Boolean})\n\tnoCaret = false;\n\n\t@query('.label')\n\tlabelElm: HTMLDivElement;\n\n\tprivate _contentElm: HTMLElement;\n\n\tprotected dropdownRef = createRef<DropdownContainer>();\n\tget dropdown() { return this.dropdownRef?.value }\n\n\tget isOpen() { return this.dropdown && !dom.isHidden(this.dropdown) }\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t}\n\n\t_onDocumentMouseDown = (e: MouseEvent) => {\n\t\tfor (const elm of e.composedPath()) {\n\t\t\tif (elm == this.dropdown || elm == this) return;\n\t\t}\n\t\tthis.close();\n\t}\n\n\tasync open() {\n\t\tthis.dispatchEvent(new DropdownEvent('beforeOpen'));\n\t\tawait this.updateComplete;\n\t\t\n\t\tif (this.dropdown.parentElement !== this.dropdownParent) {\n\t\t\tthis.dropdownParent.appendChild(this.dropdown);\n\t\t}\n\n\t\tif (this.children.length > 0 && !this._contentElm) {\n\t\t\tthis._contentElm = [...this.children].find(elm => elm.slot == 'content') as HTMLElement;\n\t\t\tif (this._contentElm) {\n\t\t\t\tthis._contentElm.slot = 'inner-content';\n\t\t\t\tthis.dropdown.appendChild(this._contentElm);\n\t\t\t}\n\t\t}\n\n\t\tif (this.width > 0) dom.setSize(this.dropdown, {w: this.width});\n\t\tdom.showElement(this.dropdown);\n\t\tthis.requestUpdate();\n\t\tawait this.dropdown.updateComplete;\n\t\tthis.dispatchEvent(new DropdownEvent('open'));\n\t\tthis.layout();\n\t\tdocument.body.addEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\tclose() {\n\t\tif (this.dropdown) dom.hideElement(this.dropdown);\n\t\tthis.layout();\n\t\tdocument.body.removeEventListener('mousedown', this._onDocumentMouseDown);\n\t}\n\n\ttoggle() {\n\t\tif (this.isOpen) this.close();\n\t\telse this.open();\n\t}\n\n\t_onMousedown = async () => this.toggle();\n\n\tdisconnectedCallback() {\n\t\tthis.dropdown?.remove();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\trenderDropdown = () => html`\n\t\t<og-dropdown-container ${ref(this.dropdownRef)}\n\t\t\tstyle=\"display: none\">\n\t\t</og-dropdown-container>\n\t`;\n\n\trenderLabel = () => {\n\t\tif (utils.isString(this.label)) {\n\t\t\treturn this.label === '' ? unsafeHTML('&nbsp;') : html`<div class=\"text\">${this.label}</div>`;\n\t\t} else {\n\t\t\treturn this.label;\n\t\t}\n\t};\n\n\tget hasLabelSlot() {\n\t\treturn this.querySelector('[slot=\"label\"]') != null;\n\t}\n\n\tget hasLabel() {\n\t\treturn this.label !== '' && this.label != null;\n\t}\n\n\trender = () => html`\n\t\t<og-button\n\t\t\t@mousedown=\"${this._onMousedown}\"\n\t\t\tclass=\"main\"\n\t\t\tcolor=\"${this.color}\"\n\t\t\t.icon=\"${this.icon}\"\n\t\t\t?caret=\"${!this.noCaret}\">\n\t\t\t${this.hasLabelSlot ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\"><slot name=\"label\"></slot></div>\n\t\t\t` : guard([this.label], () => (this.hasLabel ? html`\n\t\t\t\t<div class=\"label\" slot=\"content\">${this.renderLabel()}</div>\n\t\t\t` : ''))}\n\t\t</og-button>\n\n\t\t${this.renderDropdown()}\n\t`;\n\n\tlayout() {\n\t\tthis.classList.toggle('radiusfix', this.isOpen);\n\t\tif (!this.dropdown) return;\n\t\tthis.dropdown.classList.toggle('radiusfix', this.isOpen);\n\t\tif (!this.isOpen) return;\n\n\t\tconst offset = dom.getElementOffset(this, this.dropdownParent);\n\t\tdom.setSize(this.dropdown, {w: this.offsetWidth}, true);\n\t\tdom.setPosition(this.dropdown, {\n\t\t\tt: offset.top + this.offsetHeight - 1, \n\t\t\tl: this.positionOffset + (this.alignment == 'left' \n\t\t\t\t? offset.left : (offset.left + this.offsetWidth - this.dropdown.offsetWidth ))\n\t\t});\n\n\t\tdom.fixElementPosition(this.dropdown);\n\t}\n\n}"]}
@@ -12,7 +12,7 @@ let DropdownList = class DropdownList extends DropdownMenu {
12
12
  super();
13
13
  this.label = String.fromCharCode(160);
14
14
  this.addEventListener('menu.select', (e) => {
15
- this.value = e.item.key;
15
+ this.value = e.item.key ?? e.item.k;
16
16
  this.dispatchEvent(new ChangeEvent(this.value));
17
17
  });
18
18
  }
@@ -27,10 +27,10 @@ let DropdownList = class DropdownList extends DropdownMenu {
27
27
  willUpdate(props) {
28
28
  super.willUpdate(props);
29
29
  if (props.has('value')) {
30
- const index = this.items.findIndex(i => i.key == this.value);
30
+ const index = this.items.findIndex(i => (i.key ?? i.k) == this.value);
31
31
  if (index > -1) {
32
32
  const item = this.items[index];
33
- this.label = item.renderer ? item.renderer(this.labelElm, index, item) : item.value;
33
+ this.label = item.renderer ? item.renderer(this.labelElm, index, item) : (item.value ?? item.v);
34
34
  }
35
35
  else {
36
36
  this.label = this.value;
@@ -1 +1 @@
1
- {"version":3,"file":"dropdownList.js","sourceRoot":"","sources":["../../src/ui/dropdownList.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGvC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,YAAY;IAK7C;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,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CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACrF,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;YACnC,CAAC;QACF,CAAC;IACF,CAAC;CAED,CAAA;AAhCA;IADC,QAAQ,EAAE;2CACkB;AAHjB,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CAmCxB","sourcesContent":["import { customElement, property } from 'lit/decorators.js';\nimport { MenuEvent } from './menu';\nimport { ChangeEvent } from '../common/events';\nimport { DropdownMenu } from './dropdownMenu';\n\n@customElement(`og-dropdown-list`)\nexport class DropdownList extends DropdownMenu {\n\n\t@property()\n\tvalue: string|number|boolean;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.label = String.fromCharCode(160);\n\t\tthis.addEventListener('menu.select', (e: MenuEvent) => {\n\t\t\tthis.value = e.item.key;\n\t\t\tthis.dispatchEvent(new ChangeEvent(this.value));\n\t\t});\n\t}\n\n\tasync open() {\n\t\tawait super.open();\n\t\tif (this.value != null) {\n\t\t\tconst index = this.items.findIndex(i => i.key == this.value);\n\t\t\tif (index > -1) setTimeout(() => this.menu.list.scrollToIndex(index), 10);\n\t\t}\n\t}\n\n\twillUpdate(props: Map<string, unknown>) {\n\t\tsuper.willUpdate(props);\n\t\tif (props.has('value')) {\n\t\t\tconst index = this.items.findIndex(i => i.key == this.value);\n\t\t\tif (index > -1) {\n\t\t\t\tconst item = this.items[index];\n\t\t\t\tthis.label = item.renderer ? item.renderer(this.labelElm, index, item) : item.value;\n\t\t\t} else {\n\t\t\t\tthis.label = this.value as string;\n\t\t\t}\n\t\t}\n\t}\n\t\n}"]}
1
+ {"version":3,"file":"dropdownList.js","sourceRoot":"","sources":["../../src/ui/dropdownList.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kB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AC,KAAK,CAAC,CAAC;YACtE,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;gBAChB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;YACjG,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;YACnC,CAAC;QACF,CAAC;IACF,CAAC;CAED,CAAA;AAhCA;IADC,QAAQ,EAAE;2CACkB;AAHjB,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CAmCxB","sourcesContent":["import { customElement, property } from 'lit/decorators.js';\nimport { MenuEvent } from './menu';\nimport { ChangeEvent } from '../common/events';\nimport { DropdownMenu } from './dropdownMenu';\n\n@customElement(`og-dropdown-list`)\nexport class DropdownList extends DropdownMenu {\n\n\t@property()\n\tvalue: string|number|boolean;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.label = String.fromCharCode(160);\n\t\tthis.addEventListener('menu.select', (e: MenuEvent) => {\n\t\t\tthis.value = e.item.key ?? e.item.k;\n\t\t\tthis.dispatchEvent(new ChangeEvent(this.value));\n\t\t});\n\t}\n\n\tasync open() {\n\t\tawait super.open();\n\t\tif (this.value != null) {\n\t\t\tconst index = this.items.findIndex(i => i.key == this.value);\n\t\t\tif (index > -1) setTimeout(() => this.menu.list.scrollToIndex(index), 10);\n\t\t}\n\t}\n\n\twillUpdate(props: Map<string, unknown>) {\n\t\tsuper.willUpdate(props);\n\t\tif (props.has('value')) {\n\t\t\tconst index = this.items.findIndex(i => (i.key ?? i.k) == this.value);\n\t\t\tif (index > -1) {\n\t\t\t\tconst item = this.items[index];\n\t\t\t\tthis.label = item.renderer ? item.renderer(this.labelElm, index, item) : (item.value ?? item.v);\n\t\t\t} else {\n\t\t\t\tthis.label = this.value as string;\n\t\t\t}\n\t\t}\n\t}\n\t\n}"]}
@@ -0,0 +1,16 @@
1
+ import { OmegaComponent } from "../model";
2
+ export declare class FloatingWindow extends OmegaComponent {
3
+ static styles: import("lit").CSSResult;
4
+ noAutoHide: boolean;
5
+ hideKey: string;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ firstUpdated(): void;
10
+ updated(): Promise<void>;
11
+ render: () => import("lit-html").TemplateResult<1>;
12
+ registerHideEvents(): void;
13
+ show(dispatchEvent?: boolean): void;
14
+ hide(dispatchEvent?: boolean): void;
15
+ }
16
+ //# sourceMappingURL=floatingWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floatingWindow.d.ts","sourceRoot":"","sources":["../../src/ui/floatingWindow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,qBACa,cAAe,SAAQ,cAAc;IAEjD,MAAM,CAAC,MAAM,0BAiBX;IAGF,UAAU,UAAS;IAGnB,OAAO,SAAY;;IAOnB,iBAAiB;IAIjB,oBAAoB;IAIpB,YAAY;IAIN,OAAO;IAIb,MAAM,6CAA4C;IAElD,kBAAkB;IAWlB,IAAI,CAAC,aAAa,UAAQ;IAM1B,IAAI,CAAC,aAAa,UAAQ;CAI1B"}
@@ -0,0 +1,80 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import * as dom from "../common/dom";
8
+ import { html, css } from 'lit';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { OmegaComponent } from "../model";
11
+ import constants from "../constants";
12
+ let FloatingWindow = class FloatingWindow extends OmegaComponent {
13
+ constructor() {
14
+ super();
15
+ this.noAutoHide = false;
16
+ this.hideKey = 'Escape';
17
+ this.render = () => html `<slot name="content"></slot>`;
18
+ this.addEventListener('mousedown', (e) => e.stopPropagation());
19
+ }
20
+ connectedCallback() {
21
+ super.connectedCallback();
22
+ }
23
+ disconnectedCallback() {
24
+ super.disconnectedCallback();
25
+ }
26
+ firstUpdated() {
27
+ }
28
+ async updated() {
29
+ }
30
+ registerHideEvents() {
31
+ if (!this.noAutoHide) {
32
+ document.addEventListener('mousedown', () => this.hide(true), { once: true });
33
+ }
34
+ this.addEventListener('keydown', (e) => {
35
+ if (e.key === this.hideKey) {
36
+ this.hide(true);
37
+ }
38
+ }, { once: true });
39
+ }
40
+ show(dispatchEvent = false) {
41
+ dom.showElement(this);
42
+ this.registerHideEvents();
43
+ if (dispatchEvent)
44
+ this.dispatchEvent(new CustomEvent('show'));
45
+ }
46
+ hide(dispatchEvent = false) {
47
+ dom.hideElement(this);
48
+ if (dispatchEvent)
49
+ this.dispatchEvent(new CustomEvent('hide'));
50
+ }
51
+ };
52
+ FloatingWindow.styles = css `
53
+ * {
54
+ box-sizing: border-box;
55
+ }
56
+
57
+ :host {
58
+ position: absolute;
59
+ display: block;
60
+ overflow: hidden;
61
+ box-shadow: inset 0px 4px 3px -2px var(--og-inset-shadow-color);
62
+ max-width: ${constants.FLOATING_WINDOW_MAX_WIDTH}px;
63
+ z-index: 100000;
64
+ }
65
+
66
+ slot[name="content"] {
67
+ border: 2px solid red;
68
+ }
69
+ `;
70
+ __decorate([
71
+ property({ type: Boolean })
72
+ ], FloatingWindow.prototype, "noAutoHide", void 0);
73
+ __decorate([
74
+ property({ type: String })
75
+ ], FloatingWindow.prototype, "hideKey", void 0);
76
+ FloatingWindow = __decorate([
77
+ customElement('og-floating-window')
78
+ ], FloatingWindow);
79
+ export { FloatingWindow };
80
+ //# sourceMappingURL=floatingWindow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floatingWindow.js","sourceRoot":"","sources":["../../src/ui/floatingWindow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,SAAS,MAAM,cAAc,CAAC;AAG9B,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,cAAc;IA2BjD;QACC,KAAK,EAAE,CAAC;QANT,eAAU,GAAG,KAAK,CAAC;QAGnB,YAAO,GAAG,QAAQ,CAAC;QAuBnB,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA,8BAA8B,CAAC;QAnBjD,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,iBAAiB;QAChB,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAED,oBAAoB;QACnB,KAAK,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,YAAY;IAEZ,CAAC;IAED,KAAK,CAAC,OAAO;IAEb,CAAC;IAID,kBAAkB;QACjB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACtB,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;YACrD,IAAI,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,CAAC;QACF,CAAC,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,aAAa,GAAG,KAAK;QACzB,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,aAAa;YAAE,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,CAAC,aAAa,GAAG,KAAK;QACzB,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,aAAa;YAAE,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;;AApEM,qBAAM,GAAG,GAAG,CAAA;;;;;;;;;;gBAUJ,SAAS,CAAC,yBAAyB;;;;;;;EAOjD,AAjBY,CAiBX;AAGF;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;kDACP;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;+CACN;AAzBP,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CAuE1B","sourcesContent":["import * as dom from \"../common/dom\";\nimport { html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { OmegaComponent } from \"../model\";\nimport constants from \"../constants\";\n\n@customElement('og-floating-window')\nexport class FloatingWindow extends OmegaComponent {\n\n\tstatic styles = css`\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host {\n\t\t\tposition: absolute;\n\t\t\tdisplay: block;\n\t\t\toverflow: hidden;\n\t\t\tbox-shadow: inset 0px 4px 3px -2px var(--og-inset-shadow-color);\n\t\t\tmax-width: ${constants.FLOATING_WINDOW_MAX_WIDTH}px;\n\t\t\tz-index: 100000;\n\t\t}\n\n\t\tslot[name=\"content\"] {\n\t\t\tborder: 2px solid red;\n\t\t}\n\t`;\n\n\t@property({type: Boolean})\n\tnoAutoHide = false;\n\t\n\t@property({type: String})\n\thideKey = 'Escape';\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', (e: MouseEvent) => e.stopPropagation());\n\t}\n\t\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t}\n\n\tfirstUpdated() {\n\t\t\n\t}\n\n\tasync updated() {\n\t\t\n\t}\n\n\trender = () => html`<slot name=\"content\"></slot>`;\n\n\tregisterHideEvents() {\n\t\tif (!this.noAutoHide) {\n\t\t\tdocument.addEventListener('mousedown', () => this.hide(true), {once: true});\n\t\t}\n\t\tthis.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\t\tif (e.key === this.hideKey) {\n\t\t\t\tthis.hide(true);\n\t\t\t}\n\t\t}, {once: true});\n\t}\n\n\tshow(dispatchEvent = false) {\n\t\tdom.showElement(this);\n\t\tthis.registerHideEvents();\n\t\tif (dispatchEvent) this.dispatchEvent(new CustomEvent('show'));\n\t}\n\n\thide(dispatchEvent = false) {\n\t\tdom.hideElement(this);\n\t\tif (dispatchEvent) this.dispatchEvent(new CustomEvent('hide'));\n\t}\n}"]}
@@ -10,6 +10,7 @@ export * from './dropdownColorPicker';
10
10
  export * from './dropdownList';
11
11
  export * from './dropdownMenu';
12
12
  export * from './expander';
13
+ export * from './floatingWindow';
13
14
  export * from './icon';
14
15
  export * from './images';
15
16
  export * from './input';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src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AAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
package/dist/ui/index.js CHANGED
@@ -10,6 +10,7 @@ export * from './dropdownColorPicker';
10
10
  export * from './dropdownList';
11
11
  export * from './dropdownMenu';
12
12
  export * from './expander';
13
+ export * from './floatingWindow';
13
14
  export * from './icon';
14
15
  export * from './images';
15
16
  export * from './input';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC","sourcesContent":["export * from './accordion';\nexport * from './alert';\nexport * from './baseElement';\nexport * from './button';\nexport * from './checkbox';\nexport * from './container';\nexport * from './colorpicker';\nexport * from './dropdown';\nexport * from './dropdownColorPicker';\nexport * from './dropdownList';\nexport * from './dropdownMenu';\nexport * from './expander';\nexport * from './icon';\nexport * from './images';\nexport * from './input';\nexport * from './fileInput';\nexport * from './numericInput';\nexport * from './list';\nexport * from './menu';\nexport * from './overlay';\nexport * from './panel';\nexport * from './sizer';\nexport * from './splitContainer';\nexport * from './slider';\nexport * from './sortableList';\nexport * from './switch';\nexport * from './tooltip';\nexport * from './loader';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC","sourcesContent":["export * from './accordion';\nexport * from './alert';\nexport * from './baseElement';\nexport * from './button';\nexport * from './checkbox';\nexport * from './container';\nexport * from './colorpicker';\nexport * from './dropdown';\nexport * from './dropdownColorPicker';\nexport * from './dropdownList';\nexport * from './dropdownMenu';\nexport * from './expander';\nexport * from './floatingWindow';\nexport * from './icon';\nexport * from './images';\nexport * from './input';\nexport * from './fileInput';\nexport * from './numericInput';\nexport * from './list';\nexport * from './menu';\nexport * from './overlay';\nexport * from './panel';\nexport * from './sizer';\nexport * from './splitContainer';\nexport * from './slider';\nexport * from './sortableList';\nexport * from './switch';\nexport * from './tooltip';\nexport * from './loader';"]}
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/ui/list.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAU,iBAAiB,EAAa,MAAM,KAAK,CAAC;AAKlG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,uBAAuB,GAAG;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,KAAK,MAAM,GAAC,cAAc,CAAC,CAAC,CAAC,GAAC,IAAI,CAAC;AAErI,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC;AAE/D,oBAAY,iBAAiB;IAC5B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;CACf;AAED,qBAAa,eAAgB,SAAQ,KAAK;aAGxB,OAAO,EAAE,iBAAiB;aAC1B,KAAK,EAAE,MAAM;aACb,GAAG,EAAE,WAAW;gBAHhC,IAAI,EAAE,MAAM,EACI,OAAO,EAAE,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AGD,IAAI,mBAAmB,IAAI,iBAAiB,EAAE,CAK7C;IAED,MAAM,0BAWL;CAED"}
package/dist/ui/list.js CHANGED
@@ -93,11 +93,11 @@ let List = class List extends LitElement {
93
93
  }
94
94
  reset() {
95
95
  this.items.clear();
96
- this.offset = 0;
96
+ // this.scrollToOffset(0);
97
97
  this.itemHeights.clear();
98
98
  }
99
99
  scrollToOffset(offset) {
100
- this.containerRef.value.scrollVerticalTo(offset);
100
+ this.containerRef?.value?.scrollVerticalTo(offset);
101
101
  this.offset = offset;
102
102
  }
103
103
  scrollToIndex(index) {
@@ -105,12 +105,16 @@ let List = class List extends LitElement {
105
105
  }
106
106
  scrollToView(item) {
107
107
  if (!item || dom.getElementOffset(item, this.containerRef.value).top < 0) {
108
- const scrollTo = this._selectedIndex == this.size - 1 ? (((this._selectedIndex + 1) * this.itemHeight) - this.containerRef.value.clientHeight) : (this._selectedIndex * this.itemHeight);
108
+ const scrollTo = this._selectedIndex == this.size - 1
109
+ ? (this.calculateItemContainerOffset(this._selectedIndex + 1) - this.containerRef.value.clientHeight)
110
+ : this.calculateItemContainerOffset(this._selectedIndex);
109
111
  this.containerRef.value.scrollVerticalTo(scrollTo);
110
112
  this.offset = scrollTo;
111
113
  }
112
114
  else if (dom.getElementOffset(item, this.containerRef.value).top + this.itemHeight > this.containerRef.value.offsetHeight) {
113
- const scrollTo = this._selectedIndex == 0 ? 0 : ((this._selectedIndex + 1) * this.itemHeight) - this.containerRef.value.clientHeight;
115
+ const scrollTo = this._selectedIndex > 0
116
+ ? this.calculateItemContainerOffset(this._selectedIndex + 1) - this.containerRef.value.clientHeight
117
+ : 0;
114
118
  this.containerRef.value.scrollVerticalTo(scrollTo);
115
119
  this.offset = scrollTo;
116
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/ui/list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,QAAQ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;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CAkZhB","sourcesContent":["import * as dom from \"../common/dom\";\nimport { isString } from \"../common/utils\";\nimport constants from \"../constants\";\nimport { LitElement, html, css, TemplateResult, render, CSSResultOrNative, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { createRef, Ref, ref } from 'lit/directives/ref.js';\nimport { map } from 'lit/directives/map.js';\nimport { SlideEvent } from './slider';\nimport { Container } from \"./container\";\nimport { ComponentEvent } from \"./baseElement\";\nimport { style } from \"./list.style\";\nimport { Layout } from \"../types\";\n\nexport type ListItemRendererOptions = {\n\tmeasure?: boolean;\n}\n\nexport type ListItemRenderer = (div: HTMLDivElement, index: number, opts?: ListItemRendererOptions) => string|TemplateResult<1>|void;\n\nexport type ListItemElement = HTMLDivElement & {index: number};\n\nexport enum ListSelectTrigger {\n\tEnter = \"enter\",\n\tClick = \"click\",\n\tArrow = \"arrow\",\n}\n\nexport class ListSelectEvent extends Event {\n\tconstructor(\n\t\ttype: string,\n\t\tpublic readonly trigger: ListSelectTrigger,\n\t\tpublic readonly index: number,\n\t\tpublic readonly elm: HTMLElement,\n\t) {\n\t\tsuper(type, {bubbles: true, composed: true});\n\t}\n}\n\nexport class ListPointerEvent extends PointerEvent {\n\n\tlist: List;\n\tindex: number;\n\n\tconstructor(type: string, e: PointerEvent, args?: Partial<ListPointerEvent>) {\n\t\tsuper(`list.${type}`, e);\n\t\tObject.assign(this, args);\n\t}\n}\n\n@customElement('og-list')\nexport class List extends LitElement implements Layout {\n\n\tstatic styles = [style];\n\n\tstatic contentStyles = [css`\n\t\t:host {\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tfont-size: var(--og-font-size);\n\t\t}\n\t`];\n\n\tprivate _selectedIndex = -1;\n\n\tget selectedIndex() { return this._selectedIndex; }\n\tset selectedIndex(value: number) { this._selectedIndex = value; }\n\n\t@property({type: Number})\n\titemHeight: number = constants.LIST_ITEM_HEIGHT;\n\n\t@property({type: Boolean})\n\tdynamicItemHeight = false;\n\n\t@property({type: Number})\n\tlineHeight: number = null;\n\n\t@property({type: Number})\n\tsize: number;\n\n\t@property({type: Object})\n\tcustomStyle: CSSResultOrNative|string|(CSSResultOrNative|string)[];\n\n\t@property({type: Boolean})\n\tnativeHeight = false;\n\n\t@property({type: Boolean})\n\tarrowEvents = false;\n\n\t@property({type: Boolean, reflect: true})\n\tdisabledSelect = false;\n\n\t@property({type: Boolean, reflect: true})\n\tdisabledFocus = false;\n\n\t@property({type: Number})\n\tmaxHeight: number = null;\n\n\t@property({type: Boolean})\n\tscrollbarPadding = false;\n\n\t@property()\n\titemRenderer: ListItemRenderer;\n\t\n\tpublic readonly items = new Map<number, HTMLDivElement>();\n\tprivate containerRef: Ref<Container> = createRef();\n\tget container() { return this.containerRef?.value }\n\tprivate scrollContainerRef: Ref<HTMLDivElement> = createRef();\n\tget scrollContainer() { return this.scrollContainerRef?.value }\n\n\tprivate itemContainerRef: Ref<HTMLDivElement> = createRef();\n\tget itemContainer() { return this.itemContainerRef?.value }\n\n\tprivate scrolling = false;\n\tprivate renderEvent = new ComponentEvent('render', {bubbles: true, composed: true});\n\tprivate itemHeights = new Map<number, number>();\n\tprivate measuredWidths = new Map<number, number>();\n\t\n\tprivate _offset = 0;\n\tget offset() { return this._offset }\n\tset offset(value: number) {\n\t\tthis._offset = value;\n\t\tthis.requestRender();\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tget pageSize() {\n\t\treturn Math.floor(this.containerRef.value.offsetHeight / this.itemHeight);\n\t}\n\n\tget calculatedHeight() {\n\t\treturn Math.min(this.maxHeight ?? (this.parentElement?.clientHeight ?? 0), this.itemHeight * this.size);\n\t}\n\n\treset() {\n\t\tthis.items.clear();\n\t\tthis.offset = 0;\n\t\tthis.itemHeights.clear();\n\t}\n\t\n\tscrollToOffset(offset: number) {\n\t\tthis.containerRef.value.scrollVerticalTo(offset);\n\t\tthis.offset = offset;\n\t}\n\n\tscrollToIndex(index: number) {\n\t\tthis.scrollToOffset(this.calculateItemContainerOffset(index));\n\t}\n\n\tscrollToView(item: HTMLDivElement) {\n\t\tif (!item || dom.getElementOffset(item, this.containerRef.value).top < 0) {\n\t\t\tconst scrollTo = this._selectedIndex == this.size - 1 ? (((this._selectedIndex + 1) * this.itemHeight) - this.containerRef.value.clientHeight) : (this._selectedIndex * this.itemHeight);\n\t\t\tthis.containerRef.value.scrollVerticalTo(scrollTo);\n\t\t\tthis.offset = scrollTo;\n\t\t} else if (dom.getElementOffset(item, this.containerRef.value).top + this.itemHeight > this.containerRef.value.offsetHeight) {\n\t\t\tconst scrollTo = this._selectedIndex == 0 ? 0 : ((this._selectedIndex + 1) * this.itemHeight) - this.containerRef.value.clientHeight;\n\t\t\tthis.containerRef.value.scrollVerticalTo(scrollTo);\n\t\t\tthis.offset = scrollTo;\n\t\t}\n\t}\n\n\tmoveUp(count = 1) {\n\t\tif (this.size == 0) return;\n\t\tthis._selectedIndex = this._selectedIndex ?? 0;\n\t\tthis.select(this._selectedIndex - count, ListSelectTrigger.Arrow);\n\t\tthis.scrollToView(this.items.get(this._selectedIndex));\n\t}\n\t\n\tmoveDown(count = 1) {\n\t\tif (this.size == 0) return;\n\t\tthis._selectedIndex = this._selectedIndex ?? 0;\n\t\tthis.select(this._selectedIndex + count, ListSelectTrigger.Arrow);\n\t\tthis.scrollToView(this.items.get(this._selectedIndex));\n\t}\n\n\tdeselect() {\n\t\tif (this._selectedIndex >= 0) {\n\t\t\tif (this.items.has(this._selectedIndex)) {\n\t\t\t\tthis.items.get(this._selectedIndex).classList.remove('selected');\n\t\t\t}\n\t\t}\n\t\tthis._selectedIndex = -1;\n\t}\n\n\tselect(index: number, trigger: ListSelectTrigger = null, elm: HTMLElement = null) {\n\t\tthis.deselect();\n\t\tindex = index >= this.size ? 0 : index;\n\t\tindex = index < 0 ? this.size - 1 : index;\n\t\tif (this.items.has(index)) {\n\t\t\tthis.getItem(index).classList.add('selected');\n\t\t}\n\t\tthis._selectedIndex = index;\n\t\t\n\t\tif (trigger && (trigger != ListSelectTrigger.Arrow || this.arrowEvents)) {\n\t\t\tthis.dispatchEvent(new ListSelectEvent('select', trigger, index, elm)); // TODO - remove\n\t\t\tthis.dispatchEvent(new ListSelectEvent('list.select', trigger, index, elm));\n\t\t}\n\t}\n\n\tgetItem(index: number) : HTMLDivElement {\n\t\tif (!this.items.has(index)) {\n\t\t\tconst div = dom.createElement<ListItemElement>('div');\n\t\t\tdiv.index = index;\n\t\t\tdom.setClasses(div, ['item', index == this._selectedIndex ? 'selected' : null]);\n\n\t\t\tif (!this.dynamicItemHeight) {\n\t\t\t\tdom.setSize(div, {h: this.itemHeight});\n\t\t\t\tdiv.style.lineHeight = dom.numToPixels(this.lineHeight ?? this.itemHeight);\n\t\t\t}\n\t\t\t\n\t\t\tif (this.itemRenderer) {\n\t\t\t\tconst result = this.itemRenderer(div, index);\n\t\t\t\tif (isString(result)) {\n\t\t\t\t\tdiv.innerHTML = result as string;\n\t\t\t\t} else if (result) {\n\t\t\t\t\tdom.empty(div);\n\t\t\t\t\trender(result, div);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdiv.innerHTML = `item-${index}`;\n\t\t\t}\n\t\t\t\n\t\t\tif (this.dynamicItemHeight) {\n\t\t\t\tif (this.itemHeights.get(index) != div.offsetHeight) {\n\t\t\t\t\tthis.itemHeights.set(index, null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.items.set(index, div);\n\t\t}\n\t\treturn this.items.get(index);\n\t}\n\n\tprivate keyActions = {\n\t\t'ArrowUp': () => this.moveUp(),\n\t\t'PageUp': () => this.moveUp(this.pageSize),\n\t\t'ArrowDown': () => this.moveDown(),\n\t\t'PageDown': () => this.moveDown(this.pageSize),\n\t\t'Enter': () => this._selectedIndex > -1 ? this.select(this._selectedIndex, ListSelectTrigger.Enter) : null,\n\t};\n\t\n\tfirstUpdated() {\n\t\tthis.addEventListener('keydown', e => {\n\t\t\tif (this.disabledSelect) return;\n\t\t\tconst action = this.keyActions[e.key as keyof typeof this.keyActions];\n\t\t\tif (action) action();\n\t\t});\n\n\t\tthis.container.addEventListener('verticalscroll', (e: SlideEvent) => {\n\t\t\tthis.offset = e.value;\n\t\t});\n\t\t\n\t\tdom.on(this.container, 'mousedown', '.item', (e: MouseEvent, elm: ListItemElement) => {\n\t\t\tif (this.disabledSelect) return;\n\t\t\tif (!this.container.isScrolling && e.button == 0 && elm.parentElement == this.itemContainerRef.value) {\n\t\t\t\tconst tabIndex = (e.target as HTMLElement).tabIndex;\n\t\t\t\tif (tabIndex == null || tabIndex < 0) {\n\t\t\t\t\te.preventDefault(); // prevents from stealing focus from another element in select event\n\t\t\t\t\tthis.focus(); // default focus is on list\n\t\t\t\t}\n\t\t\t\tthis.select(elm.index, ListSelectTrigger.Click, e.target as HTMLElement);\n\t\t\t}\n\t\t});\n\n\t\tdom.on(this.container, 'contextmenu', '.item', (e: PointerEvent, elm: ListItemElement) => {\n\t\t\tthis.dispatchEvent(new ListPointerEvent('menu', e, {list: this, index: elm.index}));\n\t\t});\n\t}\n\n\twillUpdate(changedProps: Map<PropertyKey, unknown>) {\n\t\tif (changedProps.has('size') && this.offset >= this.scrollHeight) {\n\t\t\tthis._offset = 0;\n\t\t\tthis.container?.scrollVerticalTo(0);\n\t\t}\n\n\t\tif (!this.nativeHeight) {\n\t\t\tdom.setSize(this, {h: this.calculatedHeight});\n\t\t}\n\n\t\tif (this.disabledFocus) {\n\t\t\tthis.removeAttribute('tabindex');\n\t\t} else {\n\t\t\tthis.tabIndex = 0;\n\t\t}\n\t}\n\n\tupdated() {\n\t\tthis.items.clear();\n\t\tthis.renderItems(true);\n\t}\n\n\trequestRender() {\n\t\tif (!this.scrolling) {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\tthis.renderItems();\n\t\t\t\tthis.scrolling = false;\n\t\t\t});\n\t\t\tthis.scrolling = true;\n\t\t}\n\t}\n\n\trenderItems(all = false) {\n\t\tif (all) this.items.clear();\n\n\t\tconst itemContainer = this.itemContainer;\n\t\tif (!itemContainer) return;\n\n\t\t// min visible index\n\t\tconst minIndex1 = Math.floor(this.offset / this.itemHeight);\n\t\t// min rendered index\n\t\tconst minIndex2 = Math.max(0, minIndex1 - constants.LIST_RENDERING_TRESHOLD);\n\t\t// max visible index\n\t\tconst maxIndex1 = minIndex1 + Math.ceil(this.clientHeight / this.itemHeight);\n\t\t// max rendered index\n\t\tconst maxIndex2 = Math.min(this.size - 1, maxIndex1 + constants.LIST_RENDERING_TRESHOLD);\n\t\t\n\t\tdom.empty(itemContainer);\n\t\tdom.hideElement(itemContainer);\n\t\t\n\t\t// delete\n\t\tfor (const [i, item] of this.items) {\n\t\t\tif (i < minIndex2 || i > maxIndex2) {\n\t\t\t\titem.remove();\n\t\t\t\tthis.items.delete(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// insert\n\t\tfor (let i = minIndex2; i <= maxIndex2; i++) {\n\t\t\titemContainer.appendChild(this.getItem(i));\n\t\t}\n\t\t\n\t\tdom.setPosition(itemContainer, {t: this.calculateItemContainerOffset(minIndex2)});\n\t\tdom.showElement(itemContainer);\n\n\t\tthis.layout();\n\t\tthis.dispatchEvent(this.renderEvent);\n\t}\n\n\tcalculateItemContainerOffset(index: number) {\n\t\tif (!this.dynamicItemHeight) return index * this.itemHeight;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\tlet itemHeight = this.itemHeights.get(i);\n\t\t\t\n\t\t\tif (itemHeight) {\n\t\t\t\toffset += itemHeight;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\titemHeight = this.getItem(i).offsetHeight;\n\t\t\tif (itemHeight) this.itemHeights.set(i, itemHeight);\n\t\t\telse itemHeight = this.itemHeight;\n\n\t\t\toffset += itemHeight;\n\t\t}\n\t\treturn offset;\n\t}\n\n\tcalculateViewportMaxItemWidth() {\n\t\tconst minIndex = Math.floor(this.offset / this.itemHeight);\n\t\tconst maxIndex = Math.min(this.size - 1, minIndex + Math.ceil(this.clientHeight / this.itemHeight));\n\t\tlet maxWidth = 0;\n\t\tfor (let i = minIndex; i <= maxIndex; i++) {\n\t\t\tmaxWidth = Math.max(maxWidth, this.measureItemWidth(i) + 20);\n\t\t}\n\t\treturn maxWidth;\n\t}\n\n\tmeasureItemWidth(index: number) {\n\t\tlet width: number = this.measuredWidths.get(index);\n\t\tif (width != null) return width;\n\t\tif (!this.itemRenderer || !this.itemContainer) return 0;\n\t\tconst measureDiv = dom.createElement<HTMLDivElement>('div');\n\t\tmeasureDiv.style.overflow = 'hidden';\n\t\tdom.setPosition(measureDiv, {t: 0, l: 0});\n\t\tthis.itemContainer.appendChild(measureDiv);\n\t\tconst div = dom.createElement<HTMLDivElement>('div');\n\t\tdiv.className = 'item';\n\t\tmeasureDiv.appendChild(div);\n\t\tconst result = this.itemRenderer(div, index, {measure: true});\n\t\tif (isString(result)) div.innerHTML = result as string;\n\t\telse if (result) render(result, div);\n\t\twidth = div.offsetWidth;\n\t\tmeasureDiv.remove();\n\t\tif (width > 0) this.measuredWidths.set(index, width);\n\t\treturn width + 10;\n\t}\n\n\tupdateSliders() {\n\t\tthis.container?.updateSliders();\n\t}\n\n\tasync layout() {\n\t\tif (this.scrollContainer) {\n\t\t\tif (this.dynamicItemHeight) {\n\t\t\t\t// wait for all items to be rendered\n\t\t\t\tlet isLit = false;\n\t\t\t\tfor (const div of this.items.values()) {\n\t\t\t\t\tif (div.firstElementChild instanceof LitElement) {\n\t\t\t\t\t\tisLit = true;\n\t\t\t\t\t\tawait (div.firstElementChild as LitElement).updateComplete;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if item is not LitElement, deffer execution to be sure that all items are rendered\n\t\t\t\tif (!isLit) await new Promise(resolve => setTimeout(resolve, 0));\n\t\t\t}\n\n\t\t\tdom.setSize(this.scrollContainer, {h: this.scrollHeight});\n\t\t\tthis.updateSliders();\n\t\t}\n\t}\n\n\tget scrollHeight() {\n\t\tif (!this.dynamicItemHeight) return this.size * this.itemHeight;\n\t\t\n\t\tlet h = 0;\n\t\tfor (const index of this.itemHeights.keys()) {\n\t\t\tlet itemHeight = this.itemHeights.get(index);\n\t\t\tif (!itemHeight) {\n\t\t\t\titemHeight = this.getItem(index).offsetHeight;\n\t\t\t\tif (itemHeight) this.itemHeights.set(index, itemHeight);\n\t\t\t\telse itemHeight = this.itemHeight;\n\t\t\t}\n\t\t\th += itemHeight;\n\t\t}\n\t\treturn h + (this.size - this.itemHeights.size) * this.itemHeight;\n\t}\n\n\n\tget normalizedItemStyle(): CSSResultOrNative[] {\n\t\tif (!this.customStyle) return [];\n\t\treturn (Array.isArray(this.customStyle) ? this.customStyle : [this.customStyle]).map(style => {\n\t\t\treturn isString(style) ? unsafeCSS(style) : (style as CSSResultOrNative);\n\t\t});\n\t}\n\n\trender = () => {\n\t\tconst styles = this.normalizedItemStyle;\n\t\treturn html`\n\t\t\t<og-container ${ref(this.containerRef)} ?scrollbarPadding=\"${this.scrollbarPadding}\">\n\t\t\t\t<div slot=\"content\" style=\"position: relative; height: ${this.scrollHeight}px\" ${ref(this.scrollContainerRef)}>\n\t\t\t\t\t<style>${Object.getPrototypeOf(this).constructor.contentStyles}</style>\n\t\t\t\t\t${styles.length ? html`<style>${map(styles, s => s)}</style>` : ``}\n\t\t\t\t\t<div class=\"item-container\" ${ref(this.itemContainerRef)}></div>\n\t\t\t\t</div>\n\t\t\t</og-container>\n\t\t`;\n\t}\n\n}"]}
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/ui/list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,EAAqB,SAAS,EAAE,MAAM,KAAK,CAAC;AAClG,OAAO,EAAE,a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C1E,CAAC,CAAC,CAAC;IACJ,CAAC;;AAtYM,WAAM,GAAG,CAAC,KAAK,CAAC,AAAV,CAAW;AAEjB,kBAAa,GAAG,CAAC,GAAG,CAAA;;;;;EAK1B,CAAC,AALkB,CAKjB;AAQH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCACuB;AAGhD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CACA;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCACC;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kCACZ;AAGb;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yCAC0C;AAGnE;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CACL;AAGrB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACN;AAGpB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAClB;AAGvB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CACnB;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACA;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;8CACD;AAGzB;IADC,QAAQ,EAAE;0CACoB;AAlDnB,IAAI;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CAuZhB","sourcesContent":["import * as dom from \"../common/dom\";\nimport { isString } from \"../common/utils\";\nimport constants from \"../constants\";\nimport { LitElement, html, css, TemplateResult, render, CSSResultOrNative, unsafeCSS } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { createRef, Ref, ref } from 'lit/directives/ref.js';\nimport { map } from 'lit/directives/map.js';\nimport { SlideEvent } from './slider';\nimport { Container } from \"./container\";\nimport { ComponentEvent } from \"./baseElement\";\nimport { style } from \"./list.style\";\nimport { Layout } from \"../types\";\n\nexport type ListItemRendererOptions = {\n\tmeasure?: boolean;\n}\n\nexport type ListItemRenderer = (div: HTMLDivElement, index: number, opts?: ListItemRendererOptions) => string|TemplateResult<1>|void;\n\nexport type ListItemElement = HTMLDivElement & {index: number};\n\nexport enum ListSelectTrigger {\n\tEnter = \"enter\",\n\tClick = \"click\",\n\tArrow = \"arrow\",\n}\n\nexport class ListSelectEvent extends Event {\n\tconstructor(\n\t\ttype: string,\n\t\tpublic readonly trigger: ListSelectTrigger,\n\t\tpublic readonly index: number,\n\t\tpublic readonly elm: HTMLElement,\n\t) {\n\t\tsuper(type, {bubbles: true, composed: true});\n\t}\n}\n\nexport class ListPointerEvent extends PointerEvent {\n\n\tlist: List;\n\tindex: number;\n\n\tconstructor(type: string, e: PointerEvent, args?: Partial<ListPointerEvent>) {\n\t\tsuper(`list.${type}`, e);\n\t\tObject.assign(this, args);\n\t}\n}\n\n@customElement('og-list')\nexport class List extends LitElement implements Layout {\n\n\tstatic styles = [style];\n\n\tstatic contentStyles = [css`\n\t\t:host {\n\t\t\tfont-family: var(--og-font-family);\n\t\t\tfont-size: var(--og-font-size);\n\t\t}\n\t`];\n\n\tprivate _selectedIndex = -1;\n\n\tget selectedIndex() { return this._selectedIndex; }\n\tset selectedIndex(value: number) { this._selectedIndex = value; }\n\n\t@property({type: Number})\n\titemHeight: number = constants.LIST_ITEM_HEIGHT;\n\n\t@property({type: Boolean})\n\tdynamicItemHeight = false;\n\n\t@property({type: Number})\n\tlineHeight: number = null;\n\n\t@property({type: Number})\n\tsize: number;\n\n\t@property({type: Object})\n\tcustomStyle: CSSResultOrNative|string|(CSSResultOrNative|string)[];\n\n\t@property({type: Boolean})\n\tnativeHeight = false;\n\n\t@property({type: Boolean})\n\tarrowEvents = false;\n\n\t@property({type: Boolean, reflect: true})\n\tdisabledSelect = false;\n\n\t@property({type: Boolean, reflect: true})\n\tdisabledFocus = false;\n\n\t@property({type: Number})\n\tmaxHeight: number = null;\n\n\t@property({type: Boolean})\n\tscrollbarPadding = false;\n\n\t@property()\n\titemRenderer: ListItemRenderer;\n\t\n\tpublic readonly items = new Map<number, HTMLDivElement>();\n\tprivate containerRef: Ref<Container> = createRef();\n\tget container() { return this.containerRef?.value }\n\tprivate scrollContainerRef: Ref<HTMLDivElement> = createRef();\n\tget scrollContainer() { return this.scrollContainerRef?.value }\n\n\tprivate itemContainerRef: Ref<HTMLDivElement> = createRef();\n\tget itemContainer() { return this.itemContainerRef?.value }\n\n\tprivate scrolling = false;\n\tprivate renderEvent = new ComponentEvent('render', {bubbles: true, composed: true});\n\tprivate itemHeights = new Map<number, number>();\n\tprivate measuredWidths = new Map<number, number>();\n\t\n\tprivate _offset = 0;\n\tget offset() { return this._offset }\n\tset offset(value: number) {\n\t\tthis._offset = value;\n\t\tthis.requestRender();\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tget pageSize() {\n\t\treturn Math.floor(this.containerRef.value.offsetHeight / this.itemHeight);\n\t}\n\n\tget calculatedHeight() {\n\t\treturn Math.min(this.maxHeight ?? (this.parentElement?.clientHeight ?? 0), this.itemHeight * this.size);\n\t}\n\n\treset() {\n\t\tthis.items.clear();\n\t\t// this.scrollToOffset(0);\n\t\tthis.itemHeights.clear();\n\t}\n\t\n\tscrollToOffset(offset: number) {\n\t\tthis.containerRef?.value?.scrollVerticalTo(offset);\n\t\tthis.offset = offset;\n\t}\n\n\tscrollToIndex(index: number) {\n\t\tthis.scrollToOffset(this.calculateItemContainerOffset(index));\n\t}\n\n\tscrollToView(item: HTMLDivElement) {\n\t\tif (!item || dom.getElementOffset(item, this.containerRef.value).top < 0) {\n\t\t\tconst scrollTo = this._selectedIndex == this.size - 1 \n\t\t\t\t? (this.calculateItemContainerOffset(this._selectedIndex + 1) - this.containerRef.value.clientHeight) \n\t\t\t\t: this.calculateItemContainerOffset(this._selectedIndex);\n\t\t\tthis.containerRef.value.scrollVerticalTo(scrollTo);\n\t\t\tthis.offset = scrollTo;\n\t\t} else if (dom.getElementOffset(item, this.containerRef.value).top + this.itemHeight > this.containerRef.value.offsetHeight) {\n\t\t\tconst scrollTo = this._selectedIndex > 0\n\t\t\t\t? this.calculateItemContainerOffset(this._selectedIndex + 1) - this.containerRef.value.clientHeight\n\t\t\t\t: 0;\n\t\t\t\n\t\t\tthis.containerRef.value.scrollVerticalTo(scrollTo);\n\t\t\tthis.offset = scrollTo;\n\t\t}\n\t}\n\n\tmoveUp(count = 1) {\n\t\tif (this.size == 0) return;\n\t\tthis._selectedIndex = this._selectedIndex ?? 0;\n\t\tthis.select(this._selectedIndex - count, ListSelectTrigger.Arrow);\n\t\tthis.scrollToView(this.items.get(this._selectedIndex));\n\t}\n\t\n\tmoveDown(count = 1) {\n\t\tif (this.size == 0) return;\n\t\tthis._selectedIndex = this._selectedIndex ?? 0;\n\t\tthis.select(this._selectedIndex + count, ListSelectTrigger.Arrow);\n\t\tthis.scrollToView(this.items.get(this._selectedIndex));\n\t}\n\n\tdeselect() {\n\t\tif (this._selectedIndex >= 0) {\n\t\t\tif (this.items.has(this._selectedIndex)) {\n\t\t\t\tthis.items.get(this._selectedIndex).classList.remove('selected');\n\t\t\t}\n\t\t}\n\t\tthis._selectedIndex = -1;\n\t}\n\n\tselect(index: number, trigger: ListSelectTrigger = null, elm: HTMLElement = null) {\n\t\tthis.deselect();\n\t\tindex = index >= this.size ? 0 : index;\n\t\tindex = index < 0 ? this.size - 1 : index;\n\t\tif (this.items.has(index)) {\n\t\t\tthis.getItem(index).classList.add('selected');\n\t\t}\n\t\tthis._selectedIndex = index;\n\t\t\n\t\tif (trigger && (trigger != ListSelectTrigger.Arrow || this.arrowEvents)) {\n\t\t\tthis.dispatchEvent(new ListSelectEvent('select', trigger, index, elm)); // TODO - remove\n\t\t\tthis.dispatchEvent(new ListSelectEvent('list.select', trigger, index, elm));\n\t\t}\n\t}\n\n\tgetItem(index: number) : HTMLDivElement {\n\t\tif (!this.items.has(index)) {\n\t\t\tconst div = dom.createElement<ListItemElement>('div');\n\t\t\tdiv.index = index;\n\t\t\tdom.setClasses(div, ['item', index == this._selectedIndex ? 'selected' : null]);\n\n\t\t\tif (!this.dynamicItemHeight) {\n\t\t\t\tdom.setSize(div, {h: this.itemHeight});\n\t\t\t\tdiv.style.lineHeight = dom.numToPixels(this.lineHeight ?? this.itemHeight);\n\t\t\t}\n\t\t\t\n\t\t\tif (this.itemRenderer) {\n\t\t\t\tconst result = this.itemRenderer(div, index);\n\t\t\t\tif (isString(result)) {\n\t\t\t\t\tdiv.innerHTML = result as string;\n\t\t\t\t} else if (result) {\n\t\t\t\t\tdom.empty(div);\n\t\t\t\t\trender(result, div);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdiv.innerHTML = `item-${index}`;\n\t\t\t}\n\t\t\t\n\t\t\tif (this.dynamicItemHeight) {\n\t\t\t\tif (this.itemHeights.get(index) != div.offsetHeight) {\n\t\t\t\t\tthis.itemHeights.set(index, null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.items.set(index, div);\n\t\t}\n\t\treturn this.items.get(index);\n\t}\n\n\tprivate keyActions = {\n\t\t'ArrowUp': () => this.moveUp(),\n\t\t'PageUp': () => this.moveUp(this.pageSize),\n\t\t'ArrowDown': () => this.moveDown(),\n\t\t'PageDown': () => this.moveDown(this.pageSize),\n\t\t'Enter': () => this._selectedIndex > -1 ? this.select(this._selectedIndex, ListSelectTrigger.Enter) : null,\n\t};\n\t\n\tfirstUpdated() {\n\t\tthis.addEventListener('keydown', e => {\n\t\t\tif (this.disabledSelect) return;\n\t\t\tconst action = this.keyActions[e.key as keyof typeof this.keyActions];\n\t\t\tif (action) action();\n\t\t});\n\n\t\tthis.container.addEventListener('verticalscroll', (e: SlideEvent) => {\n\t\t\tthis.offset = e.value;\n\t\t});\n\t\t\n\t\tdom.on(this.container, 'mousedown', '.item', (e: MouseEvent, elm: ListItemElement) => {\n\t\t\tif (this.disabledSelect) return;\n\t\t\tif (!this.container.isScrolling && e.button == 0 && elm.parentElement == this.itemContainerRef.value) {\n\t\t\t\tconst tabIndex = (e.target as HTMLElement).tabIndex;\n\t\t\t\tif (tabIndex == null || tabIndex < 0) {\n\t\t\t\t\te.preventDefault(); // prevents from stealing focus from another element in select event\n\t\t\t\t\tthis.focus(); // default focus is on list\n\t\t\t\t}\n\t\t\t\tthis.select(elm.index, ListSelectTrigger.Click, e.target as HTMLElement);\n\t\t\t}\n\t\t});\n\n\t\tdom.on(this.container, 'contextmenu', '.item', (e: PointerEvent, elm: ListItemElement) => {\n\t\t\tthis.dispatchEvent(new ListPointerEvent('menu', e, {list: this, index: elm.index}));\n\t\t});\n\t}\n\n\twillUpdate(changedProps: Map<PropertyKey, unknown>) {\n\t\tif (changedProps.has('size') && this.offset >= this.scrollHeight) {\n\t\t\tthis._offset = 0;\n\t\t\tthis.container?.scrollVerticalTo(0);\n\t\t}\n\n\t\tif (!this.nativeHeight) {\n\t\t\tdom.setSize(this, {h: this.calculatedHeight});\n\t\t}\n\n\t\tif (this.disabledFocus) {\n\t\t\tthis.removeAttribute('tabindex');\n\t\t} else {\n\t\t\tthis.tabIndex = 0;\n\t\t}\n\t}\n\n\tupdated() {\n\t\tthis.items.clear();\n\t\tthis.renderItems(true);\n\t}\n\n\trequestRender() {\n\t\tif (!this.scrolling) {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\tthis.renderItems();\n\t\t\t\tthis.scrolling = false;\n\t\t\t});\n\t\t\tthis.scrolling = true;\n\t\t}\n\t}\n\n\trenderItems(all = false) {\n\t\tif (all) this.items.clear();\n\n\t\tconst itemContainer = this.itemContainer;\n\t\tif (!itemContainer) return;\n\n\t\t// min visible index\n\t\tconst minIndex1 = Math.floor(this.offset / this.itemHeight);\n\t\t// min rendered index\n\t\tconst minIndex2 = Math.max(0, minIndex1 - constants.LIST_RENDERING_TRESHOLD);\n\t\t// max visible index\n\t\tconst maxIndex1 = minIndex1 + Math.ceil(this.clientHeight / this.itemHeight);\n\t\t// max rendered index\n\t\tconst maxIndex2 = Math.min(this.size - 1, maxIndex1 + constants.LIST_RENDERING_TRESHOLD);\n\t\t\n\t\tdom.empty(itemContainer);\n\t\tdom.hideElement(itemContainer);\n\t\t\n\t\t// delete\n\t\tfor (const [i, item] of this.items) {\n\t\t\tif (i < minIndex2 || i > maxIndex2) {\n\t\t\t\titem.remove();\n\t\t\t\tthis.items.delete(i);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// insert\n\t\tfor (let i = minIndex2; i <= maxIndex2; i++) {\n\t\t\titemContainer.appendChild(this.getItem(i));\n\t\t}\n\t\t\n\t\tdom.setPosition(itemContainer, {t: this.calculateItemContainerOffset(minIndex2)});\n\t\tdom.showElement(itemContainer);\n\n\t\tthis.layout();\n\t\tthis.dispatchEvent(this.renderEvent);\n\t}\n\n\tcalculateItemContainerOffset(index: number) {\n\t\tif (!this.dynamicItemHeight) return index * this.itemHeight;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < index; i++) {\n\t\t\tlet itemHeight = this.itemHeights.get(i);\n\t\t\t\n\t\t\tif (itemHeight) {\n\t\t\t\toffset += itemHeight;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\titemHeight = this.getItem(i).offsetHeight;\n\t\t\tif (itemHeight) this.itemHeights.set(i, itemHeight);\n\t\t\telse itemHeight = this.itemHeight;\n\n\t\t\toffset += itemHeight;\n\t\t}\n\t\treturn offset;\n\t}\n\n\tcalculateViewportMaxItemWidth() {\n\t\tconst minIndex = Math.floor(this.offset / this.itemHeight);\n\t\tconst maxIndex = Math.min(this.size - 1, minIndex + Math.ceil(this.clientHeight / this.itemHeight));\n\t\tlet maxWidth = 0;\n\t\tfor (let i = minIndex; i <= maxIndex; i++) {\n\t\t\tmaxWidth = Math.max(maxWidth, this.measureItemWidth(i) + 20);\n\t\t}\n\t\treturn maxWidth;\n\t}\n\n\tmeasureItemWidth(index: number) {\n\t\tlet width: number = this.measuredWidths.get(index);\n\t\tif (width != null) return width;\n\t\tif (!this.itemRenderer || !this.itemContainer) return 0;\n\t\tconst measureDiv = dom.createElement<HTMLDivElement>('div');\n\t\tmeasureDiv.style.overflow = 'hidden';\n\t\tdom.setPosition(measureDiv, {t: 0, l: 0});\n\t\tthis.itemContainer.appendChild(measureDiv);\n\t\tconst div = dom.createElement<HTMLDivElement>('div');\n\t\tdiv.className = 'item';\n\t\tmeasureDiv.appendChild(div);\n\t\tconst result = this.itemRenderer(div, index, {measure: true});\n\t\tif (isString(result)) div.innerHTML = result as string;\n\t\telse if (result) render(result, div);\n\t\twidth = div.offsetWidth;\n\t\tmeasureDiv.remove();\n\t\tif (width > 0) this.measuredWidths.set(index, width);\n\t\treturn width + 10;\n\t}\n\n\tupdateSliders() {\n\t\tthis.container?.updateSliders();\n\t}\n\n\tasync layout() {\n\t\tif (this.scrollContainer) {\n\t\t\tif (this.dynamicItemHeight) {\n\t\t\t\t// wait for all items to be rendered\n\t\t\t\tlet isLit = false;\n\t\t\t\tfor (const div of this.items.values()) {\n\t\t\t\t\tif (div.firstElementChild instanceof LitElement) {\n\t\t\t\t\t\tisLit = true;\n\t\t\t\t\t\tawait (div.firstElementChild as LitElement).updateComplete;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if item is not LitElement, deffer execution to be sure that all items are rendered\n\t\t\t\tif (!isLit) await new Promise(resolve => setTimeout(resolve, 0));\n\t\t\t}\n\n\t\t\tdom.setSize(this.scrollContainer, {h: this.scrollHeight});\n\t\t\tthis.updateSliders();\n\t\t}\n\t}\n\n\tget scrollHeight() {\n\t\tif (!this.dynamicItemHeight) return this.size * this.itemHeight;\n\t\t\n\t\tlet h = 0;\n\t\tfor (const index of this.itemHeights.keys()) {\n\t\t\tlet itemHeight = this.itemHeights.get(index);\n\t\t\tif (!itemHeight) {\n\t\t\t\titemHeight = this.getItem(index).offsetHeight;\n\t\t\t\tif (itemHeight) this.itemHeights.set(index, itemHeight);\n\t\t\t\telse itemHeight = this.itemHeight;\n\t\t\t}\n\t\t\th += itemHeight;\n\t\t}\n\t\treturn h + (this.size - this.itemHeights.size) * this.itemHeight;\n\t}\n\n\n\tget normalizedItemStyle(): CSSResultOrNative[] {\n\t\tif (!this.customStyle) return [];\n\t\treturn (Array.isArray(this.customStyle) ? this.customStyle : [this.customStyle]).map(style => {\n\t\t\treturn isString(style) ? unsafeCSS(style) : (style as CSSResultOrNative);\n\t\t});\n\t}\n\n\trender = () => {\n\t\tconst styles = this.normalizedItemStyle;\n\t\treturn html`\n\t\t\t<og-container ${ref(this.containerRef)} ?scrollbarPadding=\"${this.scrollbarPadding}\">\n\t\t\t\t<div slot=\"content\" style=\"position: relative; height: ${this.scrollHeight}px\" ${ref(this.scrollContainerRef)}>\n\t\t\t\t\t<style>${Object.getPrototypeOf(this).constructor.contentStyles}</style>\n\t\t\t\t\t${styles.length ? html`<style>${map(styles, s => s)}</style>` : ``}\n\t\t\t\t\t<div class=\"item-container\" ${ref(this.itemContainerRef)}></div>\n\t\t\t\t</div>\n\t\t\t</og-container>\n\t\t`;\n\t}\n\n}"]}
@@ -51,7 +51,7 @@ export const style = css `
51
51
  background-color: var(--og-slider-bar-color);
52
52
  border-color: var(--og-slider-background-color);
53
53
  text-align: center;
54
- border-radius: var(--og-base-radius);
54
+ border-radius: 6px;
55
55
  }
56
56
  `;
57
57
  //# sourceMappingURL=slider.style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider.style.js","sourceRoot":"","sources":["../../src/ui/slider.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;WAqBb,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;YAgB/B,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;CAgB3C,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport constants from '../constants';\n\nexport const style = css`\n\t:host {\n\t\tdisplay: block;\n\t\tbackground-color: var(--og-slider-background-color);\n\t\tposition: relative;\n\t\topacity: 0.8;\n\t\ttransition: visibility 0s, opacity 0.1s linear;\n\t\tfont-size: var(--og-font-size);\n\t}\n\n\t:host([hidden]) {\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\ttransition: opacity 1s linear, visibility 0s 1s;\n\t}\n\n\t:host([direction=\"vertical\"]) {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\twidth: ${unsafeCSS(constants.SLIDER_SIZE)}px\n\t}\n\n\t:host([direction=\"vertical\"]) .bar {\n\t\twidth: 100%;\n\t}\n\n\t:host([direction=\"horizontal\"]) .bar {\n\t\theight: 100%;\n\t}\n\n\t:host([direction=\"horizontal\"]) {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\theight: ${unsafeCSS(constants.SLIDER_SIZE)}px\n\t}\n\n\t.bar {\n\t\tposition: absolute;\n\t}\n\n\t.bar-inner {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-width: 3px;\n\t\tbackground-color: var(--og-slider-bar-color);\n\t\tborder-color: var(--og-slider-background-color);\n\t\ttext-align: center;\n\t\tborder-radius: var(--og-base-radius);\n\t}\n`;\n"]}
1
+ {"version":3,"file":"slider.style.js","sourceRoot":"","sources":["../../src/ui/slider.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;WAqBb,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;YAgB/B,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;CAgB3C,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\nimport constants from '../constants';\n\nexport const style = css`\n\t:host {\n\t\tdisplay: block;\n\t\tbackground-color: var(--og-slider-background-color);\n\t\tposition: relative;\n\t\topacity: 0.8;\n\t\ttransition: visibility 0s, opacity 0.1s linear;\n\t\tfont-size: var(--og-font-size);\n\t}\n\n\t:host([hidden]) {\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\ttransition: opacity 1s linear, visibility 0s 1s;\n\t}\n\n\t:host([direction=\"vertical\"]) {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\twidth: ${unsafeCSS(constants.SLIDER_SIZE)}px\n\t}\n\n\t:host([direction=\"vertical\"]) .bar {\n\t\twidth: 100%;\n\t}\n\n\t:host([direction=\"horizontal\"]) .bar {\n\t\theight: 100%;\n\t}\n\n\t:host([direction=\"horizontal\"]) {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\theight: ${unsafeCSS(constants.SLIDER_SIZE)}px\n\t}\n\n\t.bar {\n\t\tposition: absolute;\n\t}\n\n\t.bar-inner {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-width: 3px;\n\t\tbackground-color: var(--og-slider-bar-color);\n\t\tborder-color: var(--og-slider-background-color);\n\t\ttext-align: center;\n\t\tborder-radius: 6px;\n\t}\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/core",
3
- "version": "0.8.4",
3
+ "version": "0.9.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Core components",
6
6
  "main": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@fortawesome/fontawesome-svg-core": "^7.0.1",
39
- "@omegagrid/localize": "^0.8.4",
39
+ "@omegagrid/localize": "^0.9.0",
40
40
  "color": "^4.2.3",
41
41
  "date-fns": "^3.2.0",
42
42
  "lit": "^3.1.1",