@genexus/genexus-ide-ui 0.0.62 → 0.0.63

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 (113) hide show
  1. package/dist/cjs/{ch-tree-x_3.cjs.entry.js → ch-checkbox_4.cjs.entry.js} +277 -71
  2. package/dist/cjs/ch-next-data-modeling-render.cjs.entry.js +242 -0
  3. package/dist/cjs/{ch-next-data-modeling-item.cjs.entry.js → ch-next-data-modeling_2.cjs.entry.js} +20 -1
  4. package/dist/cjs/ch-tree-view-render-wrapper.cjs.entry.js +160 -0
  5. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  6. package/dist/cjs/gx-ide-kb-manager-export.cjs.entry.js +41 -39
  7. package/dist/cjs/gx-ide-kb-manager-import.cjs.entry.js +23 -11
  8. package/dist/cjs/gx-ide-test.cjs.entry.js +107 -122
  9. package/dist/cjs/gxg-color-picker.cjs.entry.js +2 -2
  10. package/dist/cjs/gxg-title-editable.cjs.entry.js +11 -4
  11. package/dist/cjs/{gxg-tree_2.cjs.entry.js → gxg-tree-item.cjs.entry.js} +0 -212
  12. package/dist/cjs/gxg-tree-view.cjs.entry.js +165 -0
  13. package/dist/cjs/gxg-tree.cjs.entry.js +218 -0
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/collection/collection-manifest.json +5 -3
  16. package/dist/collection/components/_test/test.css +5 -0
  17. package/dist/collection/components/_test/test.js +109 -220
  18. package/dist/collection/components/kb-manager-export/helpers.js +7 -23
  19. package/dist/collection/components/kb-manager-export/kb-manager-export.css +20 -0
  20. package/dist/collection/components/kb-manager-export/kb-manager-export.js +42 -22
  21. package/dist/collection/components/kb-manager-import/gx-ide-assets/kb-manager-import/langs/kb-manager-import.lang.en.json +1 -0
  22. package/dist/collection/components/kb-manager-import/kb-manager-import.js +23 -11
  23. package/dist/components/ch-next-data-modeling-item.js +1 -457
  24. package/dist/components/ch-next-data-modeling-render.js +295 -0
  25. package/dist/components/ch-next-data-modeling.js +1 -27
  26. package/dist/components/ch-tree-view-item.js +6 -0
  27. package/dist/components/ch-tree-view-render-wrapper.js +224 -0
  28. package/dist/components/ch-tree-view-render.js +6 -0
  29. package/dist/components/ch-tree-view.js +6 -0
  30. package/dist/components/gx-ide-kb-manager-export.js +75 -73
  31. package/dist/components/gx-ide-kb-manager-import.js +38 -20
  32. package/dist/components/gx-ide-references.js +21 -15
  33. package/dist/components/gx-ide-test.js +120 -160
  34. package/dist/components/gxg-color-picker.js +2 -2
  35. package/dist/components/gxg-title-editable.js +12 -4
  36. package/dist/components/gxg-tree-item.js +614 -1
  37. package/dist/components/gxg-tree-view.js +2 -2
  38. package/dist/components/gxg-tree.js +236 -1
  39. package/dist/components/index.js +5 -3
  40. package/dist/components/next-data-modeling-item.js +466 -0
  41. package/dist/{esm/ch-next-data-modeling.entry.js → components/next-data-modeling.js} +21 -7
  42. package/dist/components/{tree-x-list-item.js → tree-view-item.js} +9 -9
  43. package/dist/components/{ch-test-tree-x.js → tree-view-render.js} +168 -28
  44. package/dist/components/tree-view.js +410 -435
  45. package/dist/components/tree-view2.js +226 -0
  46. package/dist/esm/{ch-tree-x_3.entry.js → ch-checkbox_4.entry.js} +275 -70
  47. package/dist/esm/ch-next-data-modeling-render.entry.js +238 -0
  48. package/dist/esm/{ch-next-data-modeling-item.entry.js → ch-next-data-modeling_2.entry.js} +21 -3
  49. package/dist/esm/ch-tree-view-render-wrapper.entry.js +156 -0
  50. package/dist/esm/genexus-ide-ui.js +1 -1
  51. package/dist/esm/gx-ide-kb-manager-export.entry.js +41 -39
  52. package/dist/esm/gx-ide-kb-manager-import.entry.js +23 -11
  53. package/dist/esm/gx-ide-test.entry.js +108 -123
  54. package/dist/esm/gxg-color-picker.entry.js +2 -2
  55. package/dist/esm/gxg-title-editable.entry.js +11 -4
  56. package/dist/{components/gxg-tree-item2.js → esm/gxg-tree-item.entry.js} +9 -79
  57. package/dist/esm/gxg-tree-view.entry.js +161 -0
  58. package/dist/{components/gxg-tree2.js → esm/gxg-tree.entry.js} +8 -32
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/genexus-ide-ui/genexus-ide-ui.css +1 -1
  61. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  62. package/dist/genexus-ide-ui/gx-ide-assets/kb-manager-import/langs/kb-manager-import.lang.en.json +1 -0
  63. package/dist/genexus-ide-ui/p-13177896.entry.js +1 -0
  64. package/dist/genexus-ide-ui/p-19fef562.entry.js +1 -0
  65. package/dist/genexus-ide-ui/p-2781b92a.entry.js +1 -0
  66. package/dist/genexus-ide-ui/p-2c17e71d.entry.js +1 -0
  67. package/dist/genexus-ide-ui/p-40a57a36.entry.js +1 -0
  68. package/dist/genexus-ide-ui/p-636d02fa.entry.js +1 -0
  69. package/dist/genexus-ide-ui/p-7b63be93.entry.js +1 -0
  70. package/dist/genexus-ide-ui/p-8a7c4561.entry.js +1 -0
  71. package/dist/genexus-ide-ui/p-a2cb0e6b.entry.js +1 -0
  72. package/dist/genexus-ide-ui/p-a9c8b373.entry.js +1 -0
  73. package/dist/genexus-ide-ui/p-b819706e.entry.js +1 -0
  74. package/dist/genexus-ide-ui/p-bacd879c.entry.js +1 -0
  75. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/next/data-modeling-render/next-data-modeling-render.css +3 -0
  76. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/renders/tree-view/tree-view-render.css +3 -0
  77. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-tree-view/tree-view-render-wrapper.css +0 -0
  78. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-view/tree-view/tree-view.css +45 -0
  79. package/dist/node_modules/@genexus/gemini/dist/collection/components/title-editable/title-editable.css +17 -3
  80. package/dist/node_modules/@genexus/gemini/dist/collection/components/tree-view/tree-view.css +5 -2
  81. package/dist/types/common/helpers.d.ts +2 -2
  82. package/dist/types/components/_test/test.d.ts +3 -35
  83. package/dist/types/components/kb-manager-export/helpers.d.ts +4 -4
  84. package/dist/types/components/kb-manager-export/kb-manager-export.d.ts +10 -5
  85. package/dist/types/components/kb-manager-import/helpers.d.ts +3 -3
  86. package/dist/types/components/kb-manager-import/kb-manager-import.d.ts +7 -6
  87. package/dist/types/components/references/helpers.d.ts +2 -2
  88. package/dist/types/components/references/references.d.ts +3 -3
  89. package/dist/types/components.d.ts +3 -60
  90. package/package.json +3 -3
  91. package/dist/cjs/ch-checkbox.cjs.entry.js +0 -93
  92. package/dist/cjs/ch-next-data-modeling.cjs.entry.js +0 -19
  93. package/dist/cjs/ch-test-tree-x.cjs.entry.js +0 -458
  94. package/dist/components/ch-tree-x-list-item.js +0 -6
  95. package/dist/components/ch-tree-x.js +0 -6
  96. package/dist/components/tree-x.js +0 -504
  97. package/dist/esm/ch-checkbox.entry.js +0 -89
  98. package/dist/esm/ch-test-tree-x.entry.js +0 -454
  99. package/dist/esm/gxg-tree_2.entry.js +0 -757
  100. package/dist/genexus-ide-ui/p-092ccacd.entry.js +0 -1
  101. package/dist/genexus-ide-ui/p-1ad68b23.entry.js +0 -3
  102. package/dist/genexus-ide-ui/p-3442d19a.entry.js +0 -1
  103. package/dist/genexus-ide-ui/p-39968306.entry.js +0 -1
  104. package/dist/genexus-ide-ui/p-5755f985.entry.js +0 -1
  105. package/dist/genexus-ide-ui/p-85597097.entry.js +0 -1
  106. package/dist/genexus-ide-ui/p-9e530c7d.entry.js +0 -1
  107. package/dist/genexus-ide-ui/p-ad5040e4.entry.js +0 -1
  108. package/dist/genexus-ide-ui/p-aeb3b032.entry.js +0 -1
  109. package/dist/genexus-ide-ui/p-c53522c9.entry.js +0 -1
  110. package/dist/genexus-ide-ui/p-d104f9a4.entry.js +0 -1
  111. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/test/test-tree-x.css +0 -3
  112. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-view/tree-x/tree-x.css +0 -45
  113. /package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/tree-view/{tree-x-list-item/tree-x-list-item.css → tree-view-item/tree-view-item.css} +0 -0
@@ -194,7 +194,24 @@ const GxIdeKbManagerImport = class {
194
194
  }
195
195
  };
196
196
  this.objectsTreeCheckedItemsChangedHandler = (event) => {
197
+ /* Begin of evaluate 'select/unselect checkbox' state*/
198
+ if (event.detail == null) {
199
+ this.toggleObjectsCheckboxEl.checked = false;
200
+ this.toggleObjectsCheckboxEl.indeterminate = false;
201
+ return;
202
+ }
197
203
  const allItemsWithCheckbox = [...event.detail.values()];
204
+ if (allItemsWithCheckbox.length === 0) {
205
+ this.toggleObjectsCheckboxEl.checked = false;
206
+ this.toggleObjectsCheckboxEl.indeterminate = false;
207
+ return;
208
+ }
209
+ const firstItemCheckedValue = allItemsWithCheckbox[0].item.checked;
210
+ const allItemsHaveTheSameCheckedValue = allItemsWithCheckbox.every(treeItem => treeItem.item.checked === firstItemCheckedValue);
211
+ this.toggleObjectsCheckboxEl.checked = firstItemCheckedValue;
212
+ this.toggleObjectsCheckboxEl.indeterminate =
213
+ !allItemsHaveTheSameCheckedValue;
214
+ /* End of evaluate 'select/unselect checkbox' state*/
198
215
  const checkedItems = allItemsWithCheckbox.filter(node => node.item.checked);
199
216
  // objects checked
200
217
  const checkedObjects = checkedItems.filter(node => node.item.class === "object");
@@ -224,12 +241,10 @@ const GxIdeKbManagerImport = class {
224
241
  this.statusInfo.warning.number = 0;
225
242
  this.statusInfo.success.number = 0;
226
243
  };
227
- this.selectAllClickedHandler = (e) => {
228
- const checked = e.target.checked;
229
- if (checked && this.objectsTreeEl) {
230
- console.log("select all");
231
- this.objectsTreeEl.updateAllItemsProperties({ checked: true });
232
- }
244
+ this.toggleSelectionHandler = (e) => {
245
+ const checked = e.detail.value;
246
+ this.toggleObjectsCheckboxEl.indeterminate = false;
247
+ this.objectsTreeEl.updateAllItemsProperties({ checked: checked });
233
248
  };
234
249
  this.statusButtonsSelectionChangedHandler = (e) => {
235
250
  const activeStates = e.detail;
@@ -325,11 +340,8 @@ const GxIdeKbManagerImport = class {
325
340
  "tree-container": true,
326
341
  "tree-container--objects-in-file": true,
327
342
  "tree-container--empty": this.noObjects
328
- } }, !this.noObjects ? (index.h("gxg-tree-view", { treeModel: this.objectsTreeState, dragDisabled: true, dropDisabled: true, toggleCheckboxes: true, onCheckedItemsChange: this.objectsTreeCheckedItemsChangedHandler, ref: el => (this.objectsTreeEl = el) })) : (index.h("div", { class: "gx-ide-message" }, index.h("gxg-text", { textAlign: config.config.gxgMessage.common.textAlign, padding: config.config.gxgMessage.common.textAlign, type: config.config.gxgMessage.common.type, maxWidth: config.config.gxgMessage.common.maxWidth, part: "objects-in-file-empty-status-message" }, "There are no Objects. ", index.h("br", null), index.h("gxg-text", { type: "text-link-no-line", onClick: this.selectFileHandler }, "Begin by selecting a file."))))), index.h("gxg-form-checkbox", { label: this.objectsTreeState.length > 0 &&
329
- this.objectsInFileTotalNodes ===
330
- this.checkedObjectsIds.length
331
- ? this._componentLocale.main.objectsInFile.deselectAll
332
- : this._componentLocale.main.objectsInFile.selectAll, part: "select-all-checkbox", slot: "footer-start", disabled: this.importingObjects || this.objectsTreeState.length === 0, checked: this.evaluateCheckAllValue(), onClick: this.selectAllClickedHandler }), index.h("gxg-button-group", { slot: "footer-end", ref: (el) => (this.objectsButtonsGroup = el) }, index.h("button", { id: "import-btn", part: "import-button", disabled: this.importingObjects ||
343
+ } }, !this.noObjects ? (index.h("gxg-tree-view", { treeModel: this.objectsTreeState, dragDisabled: true, dropDisabled: true, toggleCheckboxes: true, onCheckedItemsChange: this.objectsTreeCheckedItemsChangedHandler, ref: el => (this.objectsTreeEl = el) })) : (index.h("div", { class: "gx-ide-message" }, index.h("gxg-text", { textAlign: config.config.gxgMessage.common.textAlign, padding: config.config.gxgMessage.common.textAlign, type: config.config.gxgMessage.common.type, maxWidth: config.config.gxgMessage.common.maxWidth, part: "objects-in-file-empty-status-message" }, "There are no Objects. ", index.h("br", null), index.h("gxg-text", { type: "text-link-no-line", onClick: this.selectFileHandler }, "Begin by selecting a file."))))), index.h("gxg-form-checkbox", { label: this._componentLocale.main.objectsInFile.selectUnselect, part: "select-all-checkbox", slot: "footer-start", disabled: this.importingObjects || this.objectsTreeState.length === 0, checked: this.evaluateCheckAllValue(), onChange: this.toggleSelectionHandler, ref: (el) => (this.toggleObjectsCheckboxEl =
344
+ el) }), index.h("gxg-button-group", { slot: "footer-end", ref: (el) => (this.objectsButtonsGroup = el) }, index.h("button", { id: "import-btn", part: "import-button", disabled: this.importingObjects ||
333
345
  this.checkedObjectsIds.length === 0, onClick: this.importObjectsHandler }, this._componentLocale.main.objectsInFile.importButton), index.h("button", { id: "cancel-import-btn", part: "cancel-import-button", disabled: !this.importingObjects, onClick: this.cancelImportHandler }, this._componentLocale.main.objectsInFile.cancelButton)), index.h("gxg-button", { type: "secondary-icon-only", icon: "gemini-tools/settings", slot: "footer-end", part: "select-kb-btn", onClick: this.optionsHandler }, this._componentLocale.header.optionsButton)), index.h("gx-ide-container", { containerTitle: this._componentLocale.main.importStatus.title, noContentPadding: true, noBorderFooter: true, slimmerFooter: true, inactiveTitle: this.noImport, footerSubtleShadow: !this.noImport, titleType: "secondary" }, index.h("div", { class: {
334
346
  "tree-container": true,
335
347
  "tree-container--import-status": true,
@@ -4,113 +4,34 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5a32426a.js');
6
6
 
7
- /* eslint-disable @typescript-eslint/no-use-before-define */
8
- const renderTreeItems = (treeItemsModel, firstCall = true) => {
9
- if (treeItemsModel === null || treeItemsModel === void 0 ? void 0 : treeItemsModel.length) {
10
- if (firstCall) {
11
- return treeItemsModel.map((item) => {
12
- return renderTreeItem(item);
13
- });
14
- }
15
- else {
16
- return (index.h("gxg-tree", { slot: "tree" }, treeItemsModel.map((item) => {
17
- return renderTreeItem(item);
18
- })));
19
- }
20
- }
21
- return [];
22
- };
23
- const renderTreeItem = (item) => {
24
- var _a;
25
- const childrenLength = item.items ? item.items.length : 0;
26
- const isLeaf = !!(childrenLength === 0 || item.leaf);
27
- const lazy = !!item.lazy;
28
- return (index.h("gxg-tree-item", { checkbox: item.checkbox, checked: item.checked, description: item.description, disabled: item.disabled, icon: item.icon, indeterminate: item.indeterminate, id: item.id, key: `tree-item-${item.id}`, label: item.label, leaf: isLeaf && !lazy, numberOfChildren: childrenLength, opened: item.opened, selected: item.selected }, [item.label, ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) && renderTreeItems(item.items, false)]));
29
- };
30
-
31
- const updateNodeById = (actualModel, nodeUpdatedState, updatedNodeId) => {
32
- return actualModel.map(nodeActualState => {
33
- if (nodeActualState.id === updatedNodeId) {
34
- return Object.assign(Object.assign({}, nodeActualState), nodeUpdatedState);
35
- }
36
- else if (nodeActualState.items) {
37
- return Object.assign(Object.assign({}, nodeActualState), { items: updateNodeById(nodeActualState.items, nodeUpdatedState, updatedNodeId) });
38
- }
39
- else {
40
- return nodeActualState;
41
- }
42
- });
43
- };
44
- const updateTreeModel = (actualModel, updatedNodeModel, updatedNodeId) => {
45
- if (actualModel.length && updatedNodeModel && updatedNodeId) {
46
- return updateNodeById(actualModel, updatedNodeModel, updatedNodeId);
47
- }
48
- else {
49
- /* If no newItemModel was passed, at least return the actualModel, to avoid having an updated empty tree */
50
- return actualModel;
51
- }
52
- };
53
-
54
- const testCss = ":host{display:block}";
7
+ const testCss = ":host{display:block}.tree-container{display:flex;height:200px}";
55
8
 
56
9
  const GxIdeTest = class {
57
10
  constructor(hostRef) {
58
11
  index.registerInstance(this, hostRef);
59
12
  this.componentDidRenderFirstTime = index.createEvent(this, "componentDidRenderFirstTime", 7);
13
+ /* THIS IS A COMPONENT FOR TESTING PURPOSES. DO WHATEVER YOU WANT.*/
14
+ /*
15
+ INDEX:
16
+ 1.OWN PROPERTIES
17
+ 2.REFERENCE TO ELEMENTS
18
+ 3.STATE() VARIABLES
19
+ 4.PUBLIC PROPERTY API | WATCH'S
20
+ 5.EVENTS (EMIT)
21
+ 6.COMPONENT LIFECYCLE METHODS
22
+ 7.LISTENERS
23
+ 8.PUBLIC METHODS API
24
+ 9.LOCAL METHODS
25
+ 10.RENDER() FUNCTION
26
+ */
27
+ // 1.OWN PROPERTIES //
60
28
  this.renderedFirstTime = false;
29
+ // 7.LISTENERS //
61
30
  // 8.PUBLIC METHODS API //
62
31
  // 9.LOCAL METHODS //
63
- /* Gxg-Tree Methods*/
64
- this.closeTreeNodeHandler = () => {
65
- this.tree.toggleItems(["number-1-1-2"], false);
66
- };
67
- this.openTreeNodeHandler = () => {
68
- this.tree.toggleItems(["number-1-1-2"], true);
32
+ this.checkAllHandler = () => {
33
+ this.treeViewEl.updateAllItemsProperties({ checked: true });
69
34
  };
70
- this.toggleTreeNodeHandler = () => {
71
- this.tree.toggleItems(["number-1-1-2"]);
72
- };
73
- this.getSelectedItemsHandler = () => {
74
- (async () => {
75
- const selected = await this.tree.getSelectedItems();
76
- console.log(selected);
77
- })();
78
- };
79
- this.getCheckedItemsHandler = () => {
80
- (async () => {
81
- const checked = await this.tree.getCheckedItems();
82
- console.log(checked);
83
- })();
84
- };
85
- this.deleteNodeHandler = () => {
86
- this.treeModel = [];
87
- };
88
- /* Update model test*/
89
- // private showTree = () => {
90
- // this.treeModel = [];
91
- // };
92
- // private updateTree = () => {
93
- // this.treeModel = [];
94
- // };
95
- this.treeItemStateChangedHandler = (e) => {
96
- // const event = e.detail.emittedBy;
97
- const nodeData = e.detail.itemData;
98
- const nodeId = e.detail.itemData.id;
99
- if (nodeData.lazy) {
100
- this.updateLazyCallback(nodeId).then(children => {
101
- if (children === null || children === void 0 ? void 0 : children.length) {
102
- const updatedTreeModel = updateTreeModel(this.treeModel, { id: nodeId, label: nodeData.label, items: children }, nodeId);
103
- this.treeModel = updatedTreeModel;
104
- }
105
- });
106
- }
107
- };
108
- this.treeModel = undefined;
109
- this.lazyNode = undefined;
110
- this.updateLazyCallback = undefined;
111
- this.newNode = undefined;
112
- this.testUpdateNode = false;
113
- this.lazyLoadTreeItemsCallback = undefined;
114
35
  }
115
36
  // 6.COMPONENT LIFECYCLE METHODS //
116
37
  componentDidRender() {
@@ -119,33 +40,97 @@ const GxIdeTest = class {
119
40
  this.renderedFirstTime = true;
120
41
  }
121
42
  }
122
- // 7.LISTENERS //
123
- loadLazyChildrenHandler(e) {
124
- const treeItemId = e.detail;
125
- if (this.lazyLoadTreeItemsCallback) {
126
- const promise = this.lazyLoadTreeItemsCallback(treeItemId);
127
- setTimeout(() => {
128
- promise.then(result => {
129
- this.treeModel = result;
130
- });
131
- }, 1000);
132
- }
133
- }
134
- treeItemStateChanged(event) {
135
- const updatedTreeModel = updateTreeModel(this.treeModel, event.detail, event.detail.id);
136
- console.log("updatedTreeModel", updatedTreeModel);
43
+ componentDidLoad() {
44
+ this.treeViewEl.treeModel = [
45
+ {
46
+ id: "number-1",
47
+ caption: "number-1 label (always editable)",
48
+ class: "tree-view-item tree-view-item--success",
49
+ leaf: false,
50
+ leftImgSrc: "./objects/datastore",
51
+ editable: true,
52
+ checkbox: true,
53
+ items: [
54
+ {
55
+ id: "number-1-1",
56
+ caption: "number-1-1 (always editable)",
57
+ leaf: false,
58
+ leftImgSrc: "/build/ch-icon-assets/patterns",
59
+ editable: true,
60
+ checkbox: true,
61
+ items: [
62
+ {
63
+ id: "number-1-1-1",
64
+ caption: "number-1-1-1",
65
+ leaf: true,
66
+ checkbox: true,
67
+ leftImgSrc: "./objects/knowledge-base"
68
+ },
69
+ {
70
+ id: "number-1-1-2",
71
+ caption: "number-1-1-2",
72
+ leaf: false,
73
+ checkbox: true,
74
+ leftImgSrc: "./objects/knowledge-base",
75
+ items: [
76
+ {
77
+ id: "number-1-1-2-1",
78
+ caption: "number-1-1-2-1 (lazy, drag disabled)",
79
+ leaf: false,
80
+ leftImgSrc: "./objects/knowledge-base",
81
+ lazy: true,
82
+ checkbox: true,
83
+ dragDisabled: true,
84
+ toggleCheckboxes: true
85
+ },
86
+ {
87
+ id: "number-1-1-2-2",
88
+ caption: "number-1-1-2-2",
89
+ leaf: true,
90
+ checkbox: true,
91
+ leftImgSrc: "/build/ch-icon-assets/java"
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ id: "number-1-2",
99
+ caption: "number-1-2",
100
+ leaf: true,
101
+ checkbox: true,
102
+ leftImgSrc: "./objects/knowledge-base"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ id: "number-2",
108
+ caption: "number-2",
109
+ class: "tree-view-item tree-view-item--custom-image",
110
+ checkbox: true,
111
+ leaf: false,
112
+ items: [
113
+ {
114
+ id: "number-2-1",
115
+ caption: "number-2-1",
116
+ leaf: true,
117
+ checkbox: true,
118
+ leftImgSrc: "/build/ch-icon-assets/java"
119
+ },
120
+ {
121
+ id: "number-2-2",
122
+ caption: "number-2-2",
123
+ leaf: true,
124
+ checkbox: true,
125
+ leftImgSrc: "./objects/knowledge-base"
126
+ }
127
+ ]
128
+ }
129
+ ];
137
130
  }
138
131
  // 10.RENDER() FUNCTION //
139
132
  render() {
140
- if (!this.testUpdateNode && this.treeModel) {
141
- return (index.h(index.Host, null, index.h("gxg-tree", { checked: true, checkbox: true, multiSelection: true, ref: (el) => (this.tree = el) }, renderTreeItems(this.treeModel)), ",", index.h("div", { class: "tree-buttons" }, index.h("gxg-button", { type: "outlined", onClick: this.closeTreeNodeHandler }, "Close 1-1-2"), index.h("gxg-button", { type: "outlined", onClick: this.openTreeNodeHandler }, "Open 1-1-2"), index.h("gxg-button", { type: "outlined", onClick: this.toggleTreeNodeHandler }, "Toggle 1-1-2"), index.h("gxg-button", { type: "outlined", onClick: this.getSelectedItemsHandler }, "Get Selected Items"), index.h("gxg-button", { type: "outlined", onClick: this.getCheckedItemsHandler }, "Get Checked Items"), index.h("gxg-button", { type: "outlined", onClick: this.deleteNodeHandler }, "Delete Tree"))));
142
- }
143
- else if (this.testUpdateNode) {
144
- return (index.h(index.Host, null, index.h("gxg-tree", { checked: true, checkbox: true, multiSelection: true, ref: (el) => (this.tree = el), onTreeItemStateChanged: this.treeItemStateChangedHandler }, renderTreeItems(this.treeModel))));
145
- }
146
- else {
147
- return index.h("slot", null);
148
- }
133
+ return (index.h("div", null, index.h("div", { class: "tree-container" }, index.h("gxg-tree-view", { ref: el => (this.treeViewEl = el) })), index.h("label", null, "Check item", index.h("input", { type: "checkbox", name: "", id: "check-all", onInput: this.checkAllHandler }))));
149
134
  }
150
135
  };
151
136
  GxIdeTest.style = testCss;
@@ -6,8 +6,8 @@ const index = require('./index-5a32426a.js');
6
6
  const _commonjsHelpers = require('./_commonjsHelpers-4213291f.js');
7
7
 
8
8
  var pickr_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
9
- /*! Pickr 1.8.2 MIT | https://github.com/Simonwep/pickr */
10
- !function(t,e){module.exports=e();}(self,(function(){return (()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]});},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});}},e={};t.d(e,{default:()=>L});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n);}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"));}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)));}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return [255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else {a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1);}return [360*r,100*a,100*i]}function y(t,e,o,n){e/=100,o/=100;return [...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return [t,isNaN(n)?0:n,i]}function _(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function w(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return "#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e){if(!(n=e[i].exec(t)))continue;const s=t=>!!n[2]==("number"==typeof t);switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return {values:y(t,e,s,r),type:i}}case"rgba":{const[,,,t,e,r,a]=o(n);if(t>255||e>255||r>255||a<0||a>1||!s(a))break t;return {values:[...b(t,e,r),a],a,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[..._(e),o],a:o,type:i}}case"hsla":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[...g(t,e,r),a],a,type:i}}case"hsva":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[t,e,r,a],a,type:i}}}}return {values:null,type:null}}function A(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return [100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>A(s.h,s.s,s.v,s.a)};return s}const C=t=>Math.max(Math.min(t,1),0);function $(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update(C(e.cache.x+.01*n),C(e.cache.y+.01*i)),t.preventDefault();}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault());}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t);},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top;}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=C(l/a.width),u=C(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove);},trigger(){e._tapmove();},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o});},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1});}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function k(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation();}));return {destroy:()=>s(...e)}}const S={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8},O=(t,e,o)=>{const{container:n,margin:i,position:s,variantFlipOrder:r,positionFlipOrder:a}={container:document.documentElement.getBoundingClientRect(),...S,...o},{left:l,top:c}=e.style;e.style.left="0",e.style.top="0";const p=t.getBoundingClientRect(),u=e.getBoundingClientRect(),h={t:p.top-u.height-i,b:p.bottom+i,r:p.right+i,l:p.left-u.width-i},d={vs:p.left,vm:p.left+p.width/2+-u.width/2,ve:p.left+p.width-u.width,hs:p.top,hm:p.bottom-p.height/2-u.height/2,he:p.bottom-u.height},[m,f="middle"]=s.split("-"),v=a[m],b=r[f],{top:y,left:g,bottom:_,right:w}=n;for(const t of v){const o="t"===t||"b"===t,n=h[t],[i,s]=o?["top","left"]:["left","top"],[r,a]=o?[u.height,u.width]:[u.width,u.height],[l,c]=o?[_,w]:[w,_],[p,m]=o?[y,g]:[g,y];if(!(n<p||n+r>l))for(const r of b){const l=d[(o?"v":"h")+r];if(!(l<m||l+a>c))return e.style[s]=l-u[s]+"px",e.style[i]=n-u[i]+"px",t+r}}return e.style.left=l,e.style.top=c,null};function E(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class L{constructor(t){E(this,"_initializingActive",!0),E(this,"_recalc",!0),E(this,"_nanopop",null),E(this,"_root",null),E(this,"_color",A()),E(this,"_lastColor",A()),E(this,"_swatchColors",[]),E(this,"_setupAnimationFrame",null),E(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=t=Object.assign({...L.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return {update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return O(e,o,n)}}})(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init");}));}_preBuild(){const{options:t}=this;for(const e of ["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root);}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app);}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide();}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:$({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p);}}),hue:$({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger();}}),opacity:$({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger();}}),selectable:k({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch");}})};this._components=r;}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel");})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide();})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation();})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null);})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide();}),{capture:!0}));}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}));}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e);}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)));}),{capture:!0}));}this._eventBindings=o;}_rePositioningPicker(){const{options:t}=this;if(!t.inline){if(!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px";}}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):"";}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this);}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"));}_parseLocalColor(t){const{values:e,type:o,a:n}=w(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||L.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)));}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return ~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=A(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this);}))),!0}return !1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return !1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()));}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null));}hide(){return !!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return !this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return !1;this._color=A(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return !!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return !1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return E(L,"utils",o),E(L,"version","1.8.2"),E(L,"I18N_DEFAULTS",{"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"}),E(L,"DEFAULT_OPTIONS",{appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"}),E(L,"create",(t=>new L(t))),e=e.default})()}));
9
+ /*! Pickr 1.9.0 MIT | https://github.com/Simonwep/pickr */
10
+ !function(t,e){module.exports=e();}(self,(()=>(()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]});},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});}},e={};t.d(e,{default:()=>E});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n);}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"));}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)));}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return [255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else {a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1);}return [360*r,100*a,100*i]}function y(t,e,o,n){e/=100,o/=100;return [...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return [t,isNaN(n)?0:n,i]}function _(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function w(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return "#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e)if(n=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return {values:y(t,e,s,r),type:i}}case"rgba":{let[,t,,e,,s,,,r]=o(n);if(t="%"===n[2]?t/100*255:t,e="%"===n[4]?e/100*255:e,s="%"===n[6]?s/100*255:s,r="%"===n[9]?r/100:r,t>255||e>255||s>255||r<0||r>1)break t;return {values:[...b(t,e,s),r],a:r,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[..._(e),o],a:o,type:i}}case"hsla":{let[,t,e,s,,r]=o(n);if(r="%"===n[6]?r/100:r,t>360||e>100||s>100||r<0||r>1)break t;return {values:[...g(t,e,s),r],a:r,type:i}}case"hsva":{let[,t,e,s,,r]=o(n);if(r="%"===n[6]?r/100:r,t>360||e>100||s>100||r<0||r>1)break t;return {values:[t,e,s,r],a:r,type:i}}}return {values:null,type:null}}function A(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return [100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>A(s.h,s.s,s.v,s.a)};return s}const $=t=>Math.max(Math.min(t,1),0);function C(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update($(e.cache.x+.01*n),$(e.cache.y+.01*i)),t.preventDefault();}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault());}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t);},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top;}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=$(l/a.width),u=$(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove);},trigger(){e._tapmove();},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o});},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1});}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function k(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation();}));return {destroy:()=>s(...e)}}const S={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0},O=(t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return {update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return ((t,e,o)=>{const{container:n,arrow:i,margin:s,padding:r,position:a,variantFlipOrder:l,positionFlipOrder:c}={container:document.documentElement.getBoundingClientRect(),...S,...o},{left:p,top:u}=e.style;e.style.left="0",e.style.top="0";const h=t.getBoundingClientRect(),d=e.getBoundingClientRect(),m={t:h.top-d.height-s,b:h.bottom+s,r:h.right+s,l:h.left-d.width-s},f={vs:h.left,vm:h.left+h.width/2-d.width/2,ve:h.left+h.width-d.width,hs:h.top,hm:h.bottom-h.height/2-d.height/2,he:h.bottom-d.height},[v,b="middle"]=a.split("-"),y=c[v],g=l[b],{top:_,left:w,bottom:A,right:$}=n;for(const t of y){const o="t"===t||"b"===t;let n=m[t];const[s,a]=o?["top","left"]:["left","top"],[l,c]=o?[d.height,d.width]:[d.width,d.height],[p,u]=o?[A,$]:[$,A],[v,b]=o?[_,w]:[w,_];if(!(n<v||n+l+r>p))for(const p of g){let m=f[(o?"v":"h")+p];if(!(m<b||m+c+r>u)){if(m-=d[a],n-=d[s],e.style[a]=`${m}px`,e.style[s]=`${n}px`,i){const t=o?h.width/2:h.height/2,e=2*t<c?h[a]+t:m+c/2;n<h[s]&&(n+=l),i.style[a]=`${e}px`,i.style[s]=`${n}px`;}return t+p}}}return e.style.left=p,e.style.top=u,null})(e,o,n)}}};class E{static utils=o;static version="1.9.0";static I18N_DEFAULTS={"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"};static DEFAULT_OPTIONS={appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=A();_lastColor=A();_swatchColors=[];_setupAnimationFrame=null;_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(t){this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=O(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init");}));}static create=t=>new E(t);_preBuild(){const{options:t}=this;for(const e of ["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root);}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app);}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide();}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:C({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p);}}),hue:C({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger();}}),opacity:C({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger();}}),selectable:k({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch");}})};this._components=r;}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel");})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide();})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation();})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null);})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide();}),{capture:!0}));}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}));}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e);}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)));}),{capture:!0}));}this._eventBindings=o;}_rePositioningPicker(){const{options:t}=this;if(!t.inline){if(!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px";}}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):"";}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this);}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"));}_parseLocalColor(t){const{values:e,type:o,a:n}=w(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)));}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return ~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=A(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this);}))),!0}return !1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return !1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()));}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null));}hide(){return !!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return !this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return !1;this._color=A(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return !!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return !1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return e=e.default})()));
11
11
  //# sourceMappingURL=pickr.min.js.map
12
12
  });
13
13
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-5a32426a.js');
6
6
  const detectClickOutside = require('./detect-click-outside-d18e5541.js');
7
7
 
8
- const titleEditableCss = ":host{display:block}:host .wrapper{font-family:var(--font-family-primary);color:var(--color-on-background);position:relative;max-width:100%}:host input{font-family:inherit;font-size:inherit;font-weight:inherit;text-transform:inherit;color:inherit;background-color:transparent;border:none;padding:0;box-sizing:border-box;flex-grow:1;cursor:auto}:host input:focus{outline:none}.wrapper{display:flex;align-items:center;gap:var(--spacing-comp-02)}:host(:not([editing])) input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([click-to-edit]:not[disable-edition]) .wrapper,:host([click-to-edit]:not[disable-edition]) input{cursor:pointer}:host([title-type=h1]) .wrapper{font-size:24px;font-weight:var(--font-weight-bold);text-transform:capitalize}:host([title-type=h2]) .wrapper{font-size:16px;font-weight:var(--font-weight-bold)}:host([fluid]) .wrapper{display:inline-flex}.ghost{font-family:inherit;font-size:inherit;position:fixed;visibility:hidden;height:auto;width:auto;white-space:nowrap}";
8
+ const titleEditableCss = ":host{display:block}:host .wrapper{font-family:var(--font-family-primary);color:var(--color-on-background);position:relative;max-width:100%}:host input{font-family:inherit;font-size:inherit;font-weight:inherit;text-transform:inherit;color:inherit;background-color:transparent;border:none;padding:0;box-sizing:border-box;flex-grow:1;cursor:auto;border-bottom:2px solid transparent}:host input:focus{outline:none}.wrapper{display:flex;align-items:center;gap:var(--spacing-comp-02)}:host(:not([editing])) input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([click-to-edit]:not([disable-edition])) .wrapper,:host([click-to-edit]:not([disable-edition])) input{cursor:pointer}:host([title-type=h1]) .wrapper{font-size:24px;font-weight:var(--font-weight-bold);text-transform:capitalize}:host([title-type=h2]) .wrapper{font-size:16px;font-weight:var(--font-weight-bold)}:host([fluid]) .wrapper{display:inline-flex}:host(.focus--text.editing) input{color:var(--gxg-editable-title-focus-color)}:host(.focus--line.editing) input{border-bottom-color:var(--gxg-editable-title-focus-color)}.ghost{font-family:inherit;font-size:inherit;position:fixed;visibility:hidden;height:auto;width:auto;white-space:nowrap;bottom:0;left:0;transform:translate(-100%, -100%)}";
9
9
 
10
10
  const GxgTitleEditable = class {
11
11
  constructor(hostRef) {
@@ -73,7 +73,8 @@ const GxgTitleEditable = class {
73
73
  };
74
74
  this.updateInputWidth = () => {
75
75
  if (this.fluid) {
76
- const ghostDivWidth = this.ghostDiv.clientWidth;
76
+ const ghostDivWidth = this.ghostDiv.getBoundingClientRect().width;
77
+ console.log(ghostDivWidth);
77
78
  this.textInput.style.width = `${ghostDivWidth}px`;
78
79
  }
79
80
  };
@@ -94,10 +95,16 @@ const GxgTitleEditable = class {
94
95
  }
95
96
  /*RENDER*/
96
97
  render() {
97
- return (index.h(index.Host, null, index.h("div", { class: "wrapper", onMouseUp: this.clickToEdit &&
98
+ return (index.h(index.Host, { class: {
99
+ editing: this.editing,
100
+ "focus--text": this.focusType === "text",
101
+ "focus--line": this.focusType === "line",
102
+ } }, index.h("div", { onMouseUp: this.clickToEdit &&
98
103
  !this.editing &&
99
104
  !this.disableEdition &&
100
- this.wrapperClickedHandler, ref: (el) => (this.wrapperEl = el) }, this.fluid ? (index.h("div", { class: "ghost", ref: (el) => (this.ghostDiv = el) })) : null, index.h("input", { type: "text", value: this.value, readOnly: !this.editing, ref: (el) => (this.textInput = el), onKeyDown: this.inputKeyDownHandler, onInput: this.fluid && this.inputInputHandler, tabIndex: this.editing ? 0 : -1 }), !this.disableEdition ? (index.h("gxg-button", { type: "secondary-icon-only", icon: "gemini-tools/edit", onClick: this.edit, ref: (el) => (this.editButtonEl = el) })) : null)));
105
+ this.wrapperClickedHandler, class: {
106
+ wrapper: true,
107
+ }, ref: (el) => (this.wrapperEl = el) }, this.fluid ? (index.h("div", { class: "ghost", ref: (el) => (this.ghostDiv = el) })) : null, index.h("input", { type: "text", value: this.value, readOnly: !this.editing, ref: (el) => (this.textInput = el), onKeyDown: this.inputKeyDownHandler, onInput: this.fluid && this.inputInputHandler, tabIndex: this.editing ? 0 : -1 }), !this.disableEdition ? (index.h("gxg-button", { type: "secondary-icon-only", icon: "gemini-tools/edit", onClick: this.edit, ref: (el) => (this.editButtonEl = el) })) : null)));
101
108
  }
102
109
  get el() { return index.getElement(this); }
103
110
  static get watchers() { return {