@genexus/genexus-ide-ui 1.0.71 → 1.0.73

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 (47) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-bpm-task-documents.cjs.entry.js +282 -0
  3. package/dist/cjs/gx-ide-bpm-task-documents.cjs.entry.js.map +1 -0
  4. package/dist/cjs/gx-ide-data-selector.cjs.entry.js +24 -11
  5. package/dist/cjs/gx-ide-data-selector.cjs.entry.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +1 -0
  8. package/dist/collection/components/bpm/task-documents/gx-ide-assets/bpm-task-documents/langs/bpm-task-documents.lang.en.json +23 -0
  9. package/dist/collection/components/bpm/task-documents/gx-ide-assets/bpm-task-documents/langs/bpm-task-documents.lang.ja.json +23 -0
  10. package/dist/collection/components/bpm/task-documents/gx-ide-assets/bpm-task-documents/langs/bpm-task-documents.lang.zh.json +23 -0
  11. package/dist/collection/components/bpm/task-documents/gx-ide-assets/bpm-task-documents/shortcuts.json +15 -0
  12. package/dist/collection/components/bpm/task-documents/helpers.js +34 -0
  13. package/dist/collection/components/bpm/task-documents/helpers.js.map +1 -0
  14. package/dist/collection/components/bpm/task-documents/task-documents.css +26 -0
  15. package/dist/collection/components/bpm/task-documents/task-documents.js +440 -0
  16. package/dist/collection/components/bpm/task-documents/task-documents.js.map +1 -0
  17. package/dist/collection/components/data-selector/data-selector.js +26 -13
  18. package/dist/collection/components/data-selector/data-selector.js.map +1 -1
  19. package/dist/collection/testing/locale.e2e.js +1 -0
  20. package/dist/collection/testing/locale.e2e.js.map +1 -1
  21. package/dist/components/gx-ide-bpm-task-documents.d.ts +11 -0
  22. package/dist/components/gx-ide-bpm-task-documents.js +313 -0
  23. package/dist/components/gx-ide-bpm-task-documents.js.map +1 -0
  24. package/dist/components/gx-ide-data-selector.js +24 -11
  25. package/dist/components/gx-ide-data-selector.js.map +1 -1
  26. package/dist/esm/genexus-ide-ui.js +1 -1
  27. package/dist/esm/gx-ide-bpm-task-documents.entry.js +278 -0
  28. package/dist/esm/gx-ide-bpm-task-documents.entry.js.map +1 -0
  29. package/dist/esm/gx-ide-data-selector.entry.js +24 -11
  30. package/dist/esm/gx-ide-data-selector.entry.js.map +1 -1
  31. package/dist/esm/loader.js +1 -1
  32. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  33. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  34. package/dist/genexus-ide-ui/gx-ide-assets/bpm-task-documents/langs/bpm-task-documents.lang.en.json +23 -0
  35. package/dist/genexus-ide-ui/gx-ide-assets/bpm-task-documents/langs/bpm-task-documents.lang.ja.json +23 -0
  36. package/dist/genexus-ide-ui/gx-ide-assets/bpm-task-documents/langs/bpm-task-documents.lang.zh.json +23 -0
  37. package/dist/genexus-ide-ui/gx-ide-assets/bpm-task-documents/shortcuts.json +15 -0
  38. package/dist/genexus-ide-ui/p-a3361024.entry.js +419 -0
  39. package/dist/genexus-ide-ui/p-a3361024.entry.js.map +1 -0
  40. package/dist/genexus-ide-ui/{p-c624a8da.entry.js → p-eee8a8a9.entry.js} +61 -47
  41. package/dist/genexus-ide-ui/p-eee8a8a9.entry.js.map +1 -0
  42. package/dist/types/components/bpm/task-documents/helpers.d.ts +8 -0
  43. package/dist/types/components/bpm/task-documents/task-documents.d.ts +71 -0
  44. package/dist/types/components/data-selector/data-selector.d.ts +2 -2
  45. package/dist/types/components.d.ts +152 -64
  46. package/package.json +1 -1
  47. package/dist/genexus-ide-ui/p-c624a8da.entry.js.map +0 -1
@@ -0,0 +1,440 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f)
3
+ throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
6
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
+ };
8
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9
+ if (kind === "m")
10
+ throw new TypeError("Private method is not writable");
11
+ if (kind === "a" && !f)
12
+ throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
14
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var _GxIdeBpmTaskDocuments_instances, _GxIdeBpmTaskDocuments__componentLocale, _GxIdeBpmTaskDocuments_renderedFirstTime, _GxIdeBpmTaskDocuments_shortcutsSrc, _GxIdeBpmTaskDocuments_chShortcutsEl, _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl, _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl, _GxIdeBpmTaskDocuments_newEnabledCheckboxEl, _GxIdeBpmTaskDocuments_newRequiredCheckboxEl, _GxIdeBpmTaskDocuments_readEnabledCheckboxEl, _GxIdeBpmTaskDocuments_readRequiredCheckboxEl, _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl, _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl, _GxIdeBpmTaskDocuments_getAllCheckboxes, _GxIdeBpmTaskDocuments_addDocument, _GxIdeBpmTaskDocuments_cancelCallbackHandler, _GxIdeBpmTaskDocuments_confirmCallbackHandler, _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler, _GxIdeBpmTaskDocuments_handleCheckboxChange, _GxIdeBpmTaskDocuments_handleDeleteButton, _GxIdeBpmTaskDocuments_listenDocumentSelected, _GxIdeBpmTaskDocuments_objectSelectionChangedHandler, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler, _GxIdeBpmTaskDocuments_renderActions, _GxIdeBpmTaskDocuments_renderEmptyState, _GxIdeBpmTaskDocuments_renderFooter, _GxIdeBpmTaskDocuments_renderMain;
18
+ import { Host, h, getAssetPath } from "@stencil/core";
19
+ import { Locale } from "../../../common/locale";
20
+ import { convertSuggestedDocumentsToSuggestItems, taskDocumentsToActionListItemModel } from "./helpers";
21
+ import { getIconPath } from "@genexus/mercury";
22
+ const CHECKED_VALUE = "true";
23
+ const CSS_BUNDLES = [
24
+ "resets/box-sizing",
25
+ "components/list-box",
26
+ "components/tabular-grid",
27
+ "utils/form--full",
28
+ "utils/layout",
29
+ "utils/spacing",
30
+ "chameleon/scrollbar"
31
+ ];
32
+ const MODULE_ICON = getIconPath({
33
+ category: "objects",
34
+ name: "module"
35
+ });
36
+ const MORE_ICON = getIconPath({
37
+ category: "gemini-tools",
38
+ name: "show-more-horizontal",
39
+ colorType: "primary"
40
+ });
41
+ const DELETE_ICON = getIconPath({
42
+ category: "menus",
43
+ name: "delete",
44
+ colorType: "primary"
45
+ });
46
+ const NODENAME = "CH-CHECKBOX";
47
+ export class GxIdeBpmTaskDocuments {
48
+ constructor() {
49
+ _GxIdeBpmTaskDocuments_instances.add(this);
50
+ _GxIdeBpmTaskDocuments__componentLocale.set(this, void 0);
51
+ _GxIdeBpmTaskDocuments_renderedFirstTime.set(this, false);
52
+ _GxIdeBpmTaskDocuments_shortcutsSrc.set(this, getAssetPath(`./gx-ide-assets/bpm-task-documents/shortcuts.json`));
53
+ _GxIdeBpmTaskDocuments_chShortcutsEl.set(this, void 0);
54
+ _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl.set(this, void 0);
55
+ _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl.set(this, void 0);
56
+ _GxIdeBpmTaskDocuments_newEnabledCheckboxEl.set(this, void 0);
57
+ _GxIdeBpmTaskDocuments_newRequiredCheckboxEl.set(this, void 0);
58
+ _GxIdeBpmTaskDocuments_readEnabledCheckboxEl.set(this, void 0);
59
+ _GxIdeBpmTaskDocuments_readRequiredCheckboxEl.set(this, void 0);
60
+ _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl.set(this, void 0);
61
+ _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl.set(this, void 0);
62
+ _GxIdeBpmTaskDocuments_cancelCallbackHandler.set(this, () => {
63
+ this.cancelCallback();
64
+ });
65
+ _GxIdeBpmTaskDocuments_confirmCallbackHandler.set(this, () => {
66
+ this.confirmCallback(this.documents);
67
+ });
68
+ _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler.set(this, async (e) => {
69
+ const value = e.detail;
70
+ this.suggestDocumentsCallback(value)
71
+ .then(result => {
72
+ this.suggestedDocuments =
73
+ convertSuggestedDocumentsToSuggestItems(result);
74
+ })
75
+ .catch(() => {
76
+ // to do
77
+ });
78
+ });
79
+ _GxIdeBpmTaskDocuments_handleDeleteButton.set(this, () => {
80
+ this.documents = this.documents.filter(doc => doc.name !== this.selectedDocument.name);
81
+ this.selectedDocument = null;
82
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, "f").call(this);
83
+ });
84
+ _GxIdeBpmTaskDocuments_listenDocumentSelected.set(this, async (e) => {
85
+ if (e.detail) {
86
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_addDocument).call(this, e.detail);
87
+ }
88
+ });
89
+ _GxIdeBpmTaskDocuments_objectSelectionChangedHandler.set(this, (e) => {
90
+ this.selectedDocument = this.documents.find(doc => { var _a; return doc.name === ((_a = e.detail[0]) === null || _a === void 0 ? void 0 : _a.item.caption); });
91
+ });
92
+ _GxIdeBpmTaskDocuments_refreshDocumentsActionListState.set(this, () => {
93
+ var _a, _b;
94
+ (_a = this.documents) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
95
+ return a.name.localeCompare(b.name);
96
+ });
97
+ this.documentsActionListState = taskDocumentsToActionListItemModel(this.documents, this.selectedDocument);
98
+ this.selectedDocument =
99
+ this.selectedDocument || ((_b = this.documents) === null || _b === void 0 ? void 0 : _b[0]) || null;
100
+ });
101
+ _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler.set(this, async () => {
102
+ const callbackResult = await this.selectDocumentCallback();
103
+ if (callbackResult) {
104
+ this.documentName = callbackResult;
105
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_addDocument).call(this, callbackResult);
106
+ }
107
+ });
108
+ _GxIdeBpmTaskDocuments_renderActions.set(this, () => {
109
+ var _a, _b, _c, _d, _e, _f, _g, _h;
110
+ return (h("ch-tabular-grid", { class: "tabular-grid scrollable", rowSelectionMode: "none", keyboardNavigationMode: "focus", columnResizeMode: "single" }, h("ch-tabular-grid-columnset", { class: "tabular-grid-column-set" }, h("ch-tabular-grid-column", { class: "tabular-grid-column", columnId: "code", columnName: "", settingable: false }), h("ch-tabular-grid-column", { class: "tabular-grid-column", columnId: "enabled", settingable: false, columnName: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.enabledCheckbox }), h("ch-tabular-grid-column", { class: "tabular-grid-column", columnId: "required", settingable: false, columnName: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.requiredCheckbox })), h("ch-tabular-grid-row", {
111
+ // read
112
+ class: "tabular-grid-row", rowid: "read"
113
+ }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.readLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_a = this.selectedDocument) === null || _a === void 0 ? void 0 : _a.readEnabled.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_readEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_b = this.selectedDocument) === null || _b === void 0 ? void 0 : _b.readRequired.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_readRequiredCheckboxEl, el, "f")) }))), h("ch-tabular-grid-row", {
114
+ // new
115
+ class: "tabular-grid-row", rowid: "read"
116
+ }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.newLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_c = this.selectedDocument) === null || _c === void 0 ? void 0 : _c.newEnabled.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_newEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_d = this.selectedDocument) === null || _d === void 0 ? void 0 : _d.newRequired.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_newRequiredCheckboxEl, el, "f")) }))), h("ch-tabular-grid-row", {
117
+ // update
118
+ class: "tabular-grid-row", rowid: "read"
119
+ }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.updateLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_e = this.selectedDocument) === null || _e === void 0 ? void 0 : _e.updateEnabled.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_f = this.selectedDocument) === null || _f === void 0 ? void 0 : _f.updateRequired.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl, el, "f")) }))), h("ch-tabular-grid-row", {
120
+ // delete
121
+ class: "tabular-grid-row", rowid: "read"
122
+ }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").actions.deleteLabel), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_g = this.selectedDocument) === null || _g === void 0 ? void 0 : _g.deleteEnabled.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl, el, "f")) })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-checkbox", { class: "checkbox", checkedValue: CHECKED_VALUE, value: (_h = this.selectedDocument) === null || _h === void 0 ? void 0 : _h.deleteRequired.toString(), ref: el => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl, el, "f")) })))));
123
+ });
124
+ _GxIdeBpmTaskDocuments_renderEmptyState.set(this, () => {
125
+ return (h("gx-ide-empty-state", { class: "recent-objects__empty-state", stateIconSrc: MODULE_ICON, isAnimated: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderedFirstTime, "f"), stateTitle: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").emptyRightPanelInfo.title }, h("button", { class: "button-secondary", onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler, "f") }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").emptyRightPanelInfo.buttonCaption)));
126
+ });
127
+ _GxIdeBpmTaskDocuments_renderFooter.set(this, () => {
128
+ return (h("footer", { class: "footer control-footer control-footer-with-border spacing-body-block-end spacing-body-inline" }, h("div", { class: "buttons-spacer" }, h("button", { class: "button-secondary", id: "button-cancel", onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_cancelCallbackHandler, "f"), part: "button-cancel" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").footer.cancelButton), h("button", { class: "button-primary", id: "button-create", onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_confirmCallbackHandler, "f"), part: "button-create" }, __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").footer.confirmButton))));
129
+ });
130
+ _GxIdeBpmTaskDocuments_renderMain.set(this, () => {
131
+ return [
132
+ h("div", { class: "documents__list spacing-body-inline" }, h("ch-action-list-render", { selection: "single", class: "list-box", model: this.documentsActionListState, onSelectedItemsChange: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_objectSelectionChangedHandler, "f") })),
133
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderActions, "f").call(this)
134
+ ];
135
+ });
136
+ this.documentsActionListState = [];
137
+ this.documentName = null;
138
+ this.selectedDocument = null;
139
+ this.suggestedDocuments = undefined;
140
+ this.documents = undefined;
141
+ this.cancelCallback = undefined;
142
+ this.confirmCallback = undefined;
143
+ this.selectDocumentCallback = undefined;
144
+ this.suggestDocumentsCallback = undefined;
145
+ }
146
+ async componentWillLoad() {
147
+ __classPrivateFieldSet(this, _GxIdeBpmTaskDocuments__componentLocale, await Locale.getComponentStrings(this.el), "f");
148
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, "f").call(this);
149
+ }
150
+ componentDidRender() {
151
+ if (!__classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderedFirstTime, "f")) {
152
+ this.componentDidRenderFirstTime.emit(__classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").componentName);
153
+ __classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_renderedFirstTime, true, "f");
154
+ }
155
+ const shadowRoot = this.el.shadowRoot;
156
+ const checkboxes = __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_getAllCheckboxes).call(this, shadowRoot);
157
+ if (checkboxes) {
158
+ checkboxes.forEach(checkbox => {
159
+ checkbox.addEventListener("input", __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_handleCheckboxChange).bind(this));
160
+ });
161
+ }
162
+ }
163
+ /**
164
+ * Suspends or reactivates the shortcuts
165
+ */
166
+ async suspendShortcuts(suspendShortcuts) {
167
+ if (suspendShortcuts) {
168
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_chShortcutsEl, "f").suspend = true;
169
+ }
170
+ else {
171
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_chShortcutsEl, "f").suspend = false;
172
+ }
173
+ }
174
+ render() {
175
+ return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeBpmTaskDocuments_chShortcutsEl, el, "f")) }), h("section", { class: "section" }, h("div", { class: "main field-group" }, h("div", { class: "documents__header buttons-spacer spacing-body-inline spacing-body-block-start" }, h("ch-combo-box-render", { class: "combo-box documents__suggest", model: this.suggestedDocuments, placeholder: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.suggestPlaceholder, suggest: true, onInput: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler, "f"), onChange: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_listenDocumentSelected, "f"), suggestOptions: {
176
+ alreadyProcessed: false,
177
+ autoExpand: true,
178
+ hideMatchesAndShowNonMatches: false,
179
+ highlightMatchedItems: false,
180
+ matchCase: false,
181
+ regularExpression: false,
182
+ strict: false
183
+ } }), h("span", null, h("button", { class: "button-tertiary button-icon-only", "aria-label": __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.addDocumentButtonLabel, title: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.addDocumentButtonLabel, onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler, "f") }, h("ch-image", { class: "icon-sm", src: MORE_ICON })), h("button", { class: "button-tertiary button-icon-only", "aria-label": __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.clearDocumentButtonLabel, title: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments__componentLocale, "f").documents.clearDocumentButtonLabel, onClick: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_handleDeleteButton, "f") }, h("ch-image", { class: "icon-sm", src: DELETE_ICON })))), this.documentsActionListState.length
184
+ ? __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderMain, "f").call(this)
185
+ : __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderEmptyState, "f").call(this)), __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_renderFooter, "f").call(this))));
186
+ }
187
+ static get is() { return "gx-ide-bpm-task-documents"; }
188
+ static get encapsulation() { return "shadow"; }
189
+ static get originalStyleUrls() {
190
+ return {
191
+ "$": ["task-documents.scss"]
192
+ };
193
+ }
194
+ static get styleUrls() {
195
+ return {
196
+ "$": ["task-documents.css"]
197
+ };
198
+ }
199
+ static get assetsDirs() { return ["gx-ide-assets/bpm-task-documents"]; }
200
+ static get properties() {
201
+ return {
202
+ "documents": {
203
+ "type": "unknown",
204
+ "mutable": true,
205
+ "complexType": {
206
+ "original": "TaskDocumentData[]",
207
+ "resolved": "TaskDocumentData[]",
208
+ "references": {
209
+ "TaskDocumentData": {
210
+ "location": "local",
211
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
212
+ "id": "src/components/bpm/task-documents/task-documents.tsx::TaskDocumentData"
213
+ }
214
+ }
215
+ },
216
+ "required": false,
217
+ "optional": false,
218
+ "docs": {
219
+ "tags": [{
220
+ "name": "property",
221
+ "text": "documents"
222
+ }, {
223
+ "name": "description",
224
+ "text": "The current value of the documents for the task"
225
+ }],
226
+ "text": ""
227
+ }
228
+ },
229
+ "cancelCallback": {
230
+ "type": "unknown",
231
+ "mutable": false,
232
+ "complexType": {
233
+ "original": "CancelCallback",
234
+ "resolved": "() => Promise<void>",
235
+ "references": {
236
+ "CancelCallback": {
237
+ "location": "local",
238
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
239
+ "id": "src/components/bpm/task-documents/task-documents.tsx::CancelCallback"
240
+ }
241
+ }
242
+ },
243
+ "required": false,
244
+ "optional": false,
245
+ "docs": {
246
+ "tags": [{
247
+ "name": "property",
248
+ "text": "cancelCallback"
249
+ }, {
250
+ "name": "description",
251
+ "text": "Callback invoked when the user cancels the application declaration (Cancel button)"
252
+ }],
253
+ "text": ""
254
+ }
255
+ },
256
+ "confirmCallback": {
257
+ "type": "unknown",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "ConfirmCallback",
261
+ "resolved": "(data: TaskDocumentData[]) => Promise<void>",
262
+ "references": {
263
+ "ConfirmCallback": {
264
+ "location": "local",
265
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
266
+ "id": "src/components/bpm/task-documents/task-documents.tsx::ConfirmCallback"
267
+ }
268
+ }
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [{
274
+ "name": "property",
275
+ "text": "confirmCallback"
276
+ }, {
277
+ "name": "description",
278
+ "text": "Callback invoked when the user confirms the application declaration (Ok button)"
279
+ }],
280
+ "text": ""
281
+ }
282
+ },
283
+ "selectDocumentCallback": {
284
+ "type": "unknown",
285
+ "mutable": false,
286
+ "complexType": {
287
+ "original": "SelectDocumentCallback",
288
+ "resolved": "() => Promise<string>",
289
+ "references": {
290
+ "SelectDocumentCallback": {
291
+ "location": "local",
292
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
293
+ "id": "src/components/bpm/task-documents/task-documents.tsx::SelectDocumentCallback"
294
+ }
295
+ }
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [{
301
+ "name": "property",
302
+ "text": "selectDocumentCallback"
303
+ }, {
304
+ "name": "description",
305
+ "text": "Callback invoked when the user presses the '...' button to access the WorkflowDocuments selection dialog. Returns the name of the document to be inserted in the input or 'undefined' if it was canceled."
306
+ }],
307
+ "text": ""
308
+ }
309
+ },
310
+ "suggestDocumentsCallback": {
311
+ "type": "unknown",
312
+ "mutable": false,
313
+ "complexType": {
314
+ "original": "SuggestDocumentsCallback",
315
+ "resolved": "(documentName: string) => Promise<string[]>",
316
+ "references": {
317
+ "SuggestDocumentsCallback": {
318
+ "location": "local",
319
+ "path": "/home/runner/work/genexus-ide-ui/genexus-ide-ui/src/components/bpm/task-documents/task-documents.tsx",
320
+ "id": "src/components/bpm/task-documents/task-documents.tsx::SuggestDocumentsCallback"
321
+ }
322
+ }
323
+ },
324
+ "required": false,
325
+ "optional": false,
326
+ "docs": {
327
+ "tags": [{
328
+ "name": "property",
329
+ "text": "suggestDocumentsCallback"
330
+ }, {
331
+ "name": "description",
332
+ "text": "Callback that must be called to obtain options for the document input."
333
+ }],
334
+ "text": ""
335
+ }
336
+ }
337
+ };
338
+ }
339
+ static get states() {
340
+ return {
341
+ "documentsActionListState": {},
342
+ "documentName": {},
343
+ "selectedDocument": {},
344
+ "suggestedDocuments": {}
345
+ };
346
+ }
347
+ static get events() {
348
+ return [{
349
+ "method": "componentDidRenderFirstTime",
350
+ "name": "componentDidRenderFirstTime",
351
+ "bubbles": true,
352
+ "cancelable": true,
353
+ "composed": true,
354
+ "docs": {
355
+ "tags": [{
356
+ "name": "description",
357
+ "text": "Gets fired when the component has rendered for the first time."
358
+ }],
359
+ "text": ""
360
+ },
361
+ "complexType": {
362
+ "original": "string",
363
+ "resolved": "string",
364
+ "references": {}
365
+ }
366
+ }];
367
+ }
368
+ static get methods() {
369
+ return {
370
+ "suspendShortcuts": {
371
+ "complexType": {
372
+ "signature": "(suspendShortcuts: boolean) => Promise<void>",
373
+ "parameters": [{
374
+ "name": "suspendShortcuts",
375
+ "type": "boolean",
376
+ "docs": ""
377
+ }],
378
+ "references": {
379
+ "Promise": {
380
+ "location": "global",
381
+ "id": "global::Promise"
382
+ }
383
+ },
384
+ "return": "Promise<void>"
385
+ },
386
+ "docs": {
387
+ "text": "Suspends or reactivates the shortcuts",
388
+ "tags": []
389
+ }
390
+ }
391
+ };
392
+ }
393
+ static get elementRef() { return "el"; }
394
+ }
395
+ _GxIdeBpmTaskDocuments__componentLocale = new WeakMap(), _GxIdeBpmTaskDocuments_renderedFirstTime = new WeakMap(), _GxIdeBpmTaskDocuments_shortcutsSrc = new WeakMap(), _GxIdeBpmTaskDocuments_chShortcutsEl = new WeakMap(), _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_newEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_newRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_readEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_readRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl = new WeakMap(), _GxIdeBpmTaskDocuments_cancelCallbackHandler = new WeakMap(), _GxIdeBpmTaskDocuments_confirmCallbackHandler = new WeakMap(), _GxIdeBpmTaskDocuments_documentSuggestValueChangedHandler = new WeakMap(), _GxIdeBpmTaskDocuments_handleDeleteButton = new WeakMap(), _GxIdeBpmTaskDocuments_listenDocumentSelected = new WeakMap(), _GxIdeBpmTaskDocuments_objectSelectionChangedHandler = new WeakMap(), _GxIdeBpmTaskDocuments_refreshDocumentsActionListState = new WeakMap(), _GxIdeBpmTaskDocuments_selectDocumentCallbackHandler = new WeakMap(), _GxIdeBpmTaskDocuments_renderActions = new WeakMap(), _GxIdeBpmTaskDocuments_renderEmptyState = new WeakMap(), _GxIdeBpmTaskDocuments_renderFooter = new WeakMap(), _GxIdeBpmTaskDocuments_renderMain = new WeakMap(), _GxIdeBpmTaskDocuments_instances = new WeakSet(), _GxIdeBpmTaskDocuments_getAllCheckboxes = function _GxIdeBpmTaskDocuments_getAllCheckboxes(node) {
396
+ const checkboxes = [];
397
+ node.childNodes.forEach(child => {
398
+ if (child.nodeName === NODENAME) {
399
+ checkboxes.push(child);
400
+ }
401
+ else if (child instanceof HTMLElement) {
402
+ checkboxes.push(...__classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_instances, "m", _GxIdeBpmTaskDocuments_getAllCheckboxes).call(this, child));
403
+ }
404
+ });
405
+ return checkboxes;
406
+ }, _GxIdeBpmTaskDocuments_addDocument = function _GxIdeBpmTaskDocuments_addDocument(documentName) {
407
+ const documentExists = this.documents.some(doc => doc.name === documentName);
408
+ if (!documentExists) {
409
+ this.documents = [
410
+ ...this.documents,
411
+ {
412
+ name: documentName,
413
+ deleteEnabled: false,
414
+ deleteRequired: false,
415
+ newEnabled: false,
416
+ newRequired: false,
417
+ readEnabled: false,
418
+ readRequired: false,
419
+ updateEnabled: false,
420
+ updateRequired: false
421
+ }
422
+ ];
423
+ __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_refreshDocumentsActionListState, "f").call(this);
424
+ }
425
+ }, _GxIdeBpmTaskDocuments_handleCheckboxChange = function _GxIdeBpmTaskDocuments_handleCheckboxChange() {
426
+ const data = {
427
+ name: this.selectedDocument.name,
428
+ readEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_readEnabledCheckboxEl, "f").value === CHECKED_VALUE,
429
+ readRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_readRequiredCheckboxEl, "f").value === CHECKED_VALUE,
430
+ newEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_newEnabledCheckboxEl, "f").value === CHECKED_VALUE,
431
+ newRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_newRequiredCheckboxEl, "f").value === CHECKED_VALUE,
432
+ updateEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_updateEnabledCheckboxEl, "f").value === CHECKED_VALUE,
433
+ updateRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_updateRequiredCheckboxEl, "f").value === CHECKED_VALUE,
434
+ deleteEnabled: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_deleteEnabledCheckboxEl, "f").value === CHECKED_VALUE,
435
+ deleteRequired: __classPrivateFieldGet(this, _GxIdeBpmTaskDocuments_deleteRequiredCheckboxEl, "f").value === CHECKED_VALUE
436
+ };
437
+ this.selectedDocument = data;
438
+ this.documents = this.documents.map(doc => doc.name === this.selectedDocument.name ? this.selectedDocument : doc);
439
+ };
440
+ //# sourceMappingURL=task-documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-documents.js","sourceRoot":"","sources":["../../../../src/components/bpm/task-documents/task-documents.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACL,uCAAuC,EACvC,kCAAkC,EACnC,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAK/D,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,WAAW,GAAmB;IAClC,mBAAmB;IACnB,qBAAqB;IACrB,yBAAyB;IACzB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,qBAAqB;CACtB,CAAC;AACF,MAAM,WAAW,GAAG,WAAW,CA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AC;QACF,uBAAA,IAAI,8DAAiC,MAArC,IAAI,CAAmC,CAAC;KACzC;AACH,CAAC;IAwBC,MAAM,IAAI,GAAqB;QAC7B,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI;QAChC,WAAW,EAAE,uBAAA,IAAI,oDAAuB,CAAC,KAAK,KAAK,aAAa;QAChE,YAAY,EAAE,uBAAA,IAAI,qDAAwB,CAAC,KAAK,KAAK,aAAa;QAClE,UAAU,EAAE,uBAAA,IAAI,mDAAsB,CAAC,KAAK,KAAK,aAAa;QAC9D,WAAW,EAAE,uBAAA,IAAI,oDAAuB,CAAC,KAAK,KAAK,aAAa;QAChE,aAAa,EAAE,uBAAA,IAAI,sDAAyB,CAAC,KAAK,KAAK,aAAa;QACpE,cAAc,EAAE,uBAAA,IAAI,uDAA0B,CAAC,KAAK,KAAK,aAAa;QACtE,aAAa,EAAE,uBAAA,IAAI,sDAAyB,CAAC,KAAK,KAAK,aAAa;QACpE,cAAc,EAAE,uBAAA,IAAI,uDAA0B,CAAC,KAAK,KAAK,aAAa;KACvE,CAAC;IAEF,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE7B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CACxC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CACtE,CAAC;AACJ,CAAC","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n getAssetPath,\n Method\n} from \"@stencil/core\";\nimport { Locale } from \"../../../common/locale\";\nimport {\n convertSuggestedDocumentsToSuggestItems,\n taskDocumentsToActionListItemModel\n} from \"./helpers\";\nimport { getIconPath, MercuryBundles } from \"@genexus/mercury\";\nimport { ActionListItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/action-list/types\";\nimport { ComboBoxItemModel } from \"@genexus/chameleon-controls-library/dist/types/components/combo-box/types\";\nimport { ChComboBoxRenderCustomEvent } from \"@genexus/chameleon-controls-library\";\n\nconst CHECKED_VALUE = \"true\";\nconst CSS_BUNDLES: MercuryBundles = [\n \"resets/box-sizing\",\n \"components/list-box\",\n \"components/tabular-grid\",\n \"utils/form--full\",\n \"utils/layout\",\n \"utils/spacing\",\n \"chameleon/scrollbar\"\n];\nconst MODULE_ICON = getIconPath({\n category: \"objects\",\n name: \"module\"\n});\nconst MORE_ICON = getIconPath({\n category: \"gemini-tools\",\n name: \"show-more-horizontal\",\n colorType: \"primary\"\n});\nconst DELETE_ICON = getIconPath({\n category: \"menus\",\n name: \"delete\",\n colorType: \"primary\"\n});\n\nconst NODENAME = \"CH-CHECKBOX\";\n@Component({\n tag: \"gx-ide-bpm-task-documents\",\n styleUrl: \"task-documents.scss\",\n shadow: true,\n assetsDirs: [\"gx-ide-assets/bpm-task-documents\"]\n})\nexport class GxIdeBpmTaskDocuments {\n #_componentLocale: any;\n #renderedFirstTime = false;\n #shortcutsSrc = getAssetPath(\n `./gx-ide-assets/bpm-task-documents/shortcuts.json`\n );\n\n @Element() el: HTMLGxIdeBpmTaskDocumentsElement;\n\n #chShortcutsEl: HTMLChShortcutsElement;\n #deleteEnabledCheckboxEl: HTMLChCheckboxElement;\n #deleteRequiredCheckboxEl: HTMLChCheckboxElement;\n\n #newEnabledCheckboxEl: HTMLChCheckboxElement;\n #newRequiredCheckboxEl: HTMLChCheckboxElement;\n #readEnabledCheckboxEl: HTMLChCheckboxElement;\n #readRequiredCheckboxEl: HTMLChCheckboxElement;\n #updateEnabledCheckboxEl: HTMLChCheckboxElement;\n #updateRequiredCheckboxEl: HTMLChCheckboxElement;\n\n /**\n * Documents state for the action list\n */\n @State() documentsActionListState: ActionListItemModel[] = [];\n\n @State() documentName: string = null;\n\n /**\n * Document selected in the action list\n */\n @State() selectedDocument: TaskDocumentData = null;\n\n /**\n * Possible suggestions for the documents\n */\n @State() suggestedDocuments: ComboBoxItemModel[];\n\n /**\n * @property documents\n * @description The current value of the documents for the task\n */\n\n @Prop({ mutable: true }) documents: TaskDocumentData[];\n\n /**\n * @property cancelCallback\n * @description Callback invoked when the user cancels the application declaration (Cancel button)\n */\n @Prop() readonly cancelCallback: CancelCallback;\n\n /**\n * @property confirmCallback\n * @description Callback invoked when the user confirms the application declaration (Ok button)\n */\n @Prop() readonly confirmCallback: ConfirmCallback;\n\n /**\n * @property selectDocumentCallback\n * @description Callback invoked when the user presses the '...' button to access the WorkflowDocuments selection dialog. Returns the name of the document to be inserted in the input or 'undefined' if it was canceled.\n */\n @Prop() readonly selectDocumentCallback: SelectDocumentCallback;\n\n /**\n * @property suggestDocumentsCallback\n * @description Callback that must be called to obtain options for the document input.\n */\n @Prop() readonly suggestDocumentsCallback: SuggestDocumentsCallback;\n\n /**\n * @description Gets fired when the component has rendered for the first time.\n */\n @Event() componentDidRenderFirstTime: EventEmitter<string>;\n\n async componentWillLoad() {\n this.#_componentLocale = await Locale.getComponentStrings(this.el);\n this.#refreshDocumentsActionListState();\n }\n\n componentDidRender() {\n if (!this.#renderedFirstTime) {\n this.componentDidRenderFirstTime.emit(\n this.#_componentLocale.componentName\n );\n this.#renderedFirstTime = true;\n }\n const shadowRoot = this.el.shadowRoot;\n const checkboxes = this.#getAllCheckboxes(\n shadowRoot as unknown as HTMLElement\n );\n if (checkboxes) {\n checkboxes.forEach(checkbox => {\n checkbox.addEventListener(\n \"input\",\n this.#handleCheckboxChange.bind(this)\n );\n });\n }\n }\n\n /**\n * Suspends or reactivates the shortcuts\n */\n @Method()\n async suspendShortcuts(suspendShortcuts: boolean) {\n if (suspendShortcuts) {\n this.#chShortcutsEl.suspend = true;\n } else {\n this.#chShortcutsEl.suspend = false;\n }\n }\n\n #getAllCheckboxes(node: HTMLElement): HTMLChCheckboxElement[] {\n const checkboxes: HTMLChCheckboxElement[] = [];\n\n node.childNodes.forEach(child => {\n if (child.nodeName === NODENAME) {\n checkboxes.push(child as HTMLChCheckboxElement);\n } else if (child instanceof HTMLElement) {\n checkboxes.push(...this.#getAllCheckboxes(child));\n }\n });\n\n return checkboxes;\n }\n #addDocument(documentName: string) {\n const documentExists = this.documents.some(\n doc => doc.name === documentName\n );\n if (!documentExists) {\n this.documents = [\n ...this.documents,\n {\n name: documentName,\n deleteEnabled: false,\n deleteRequired: false,\n newEnabled: false,\n newRequired: false,\n readEnabled: false,\n readRequired: false,\n updateEnabled: false,\n updateRequired: false\n }\n ];\n this.#refreshDocumentsActionListState();\n }\n }\n\n #cancelCallbackHandler = () => {\n this.cancelCallback();\n };\n #confirmCallbackHandler = () => {\n this.confirmCallback(this.documents);\n };\n\n #documentSuggestValueChangedHandler = async (\n e: ChComboBoxRenderCustomEvent<string> & InputEvent\n ) => {\n const value = e.detail;\n this.suggestDocumentsCallback(value)\n .then(result => {\n this.suggestedDocuments =\n convertSuggestedDocumentsToSuggestItems(result);\n })\n .catch(() => {\n // to do\n });\n };\n\n #handleCheckboxChange() {\n const data: TaskDocumentData = {\n name: this.selectedDocument.name,\n readEnabled: this.#readEnabledCheckboxEl.value === CHECKED_VALUE,\n readRequired: this.#readRequiredCheckboxEl.value === CHECKED_VALUE,\n newEnabled: this.#newEnabledCheckboxEl.value === CHECKED_VALUE,\n newRequired: this.#newRequiredCheckboxEl.value === CHECKED_VALUE,\n updateEnabled: this.#updateEnabledCheckboxEl.value === CHECKED_VALUE,\n updateRequired: this.#updateRequiredCheckboxEl.value === CHECKED_VALUE,\n deleteEnabled: this.#deleteEnabledCheckboxEl.value === CHECKED_VALUE,\n deleteRequired: this.#deleteRequiredCheckboxEl.value === CHECKED_VALUE\n };\n\n this.selectedDocument = data;\n\n this.documents = this.documents.map(doc =>\n doc.name === this.selectedDocument.name ? this.selectedDocument : doc\n );\n }\n\n #handleDeleteButton = () => {\n this.documents = this.documents.filter(\n doc => doc.name !== this.selectedDocument.name\n );\n this.selectedDocument = null;\n this.#refreshDocumentsActionListState();\n };\n\n #listenDocumentSelected = async (e: CustomEvent<string>) => {\n if (e.detail) {\n this.#addDocument(e.detail);\n }\n };\n\n #objectSelectionChangedHandler = (e: CustomEvent) => {\n this.selectedDocument = this.documents.find(\n doc => doc.name === e.detail[0]?.item.caption\n );\n };\n\n #refreshDocumentsActionListState = () => {\n this.documents?.sort((a, b) => {\n return a.name.localeCompare(b.name);\n });\n this.documentsActionListState = taskDocumentsToActionListItemModel(\n this.documents,\n this.selectedDocument\n );\n\n this.selectedDocument =\n this.selectedDocument || this.documents?.[0] || null;\n };\n\n #selectDocumentCallbackHandler = async () => {\n const callbackResult = await this.selectDocumentCallback();\n if (callbackResult) {\n this.documentName = callbackResult;\n this.#addDocument(callbackResult);\n }\n };\n\n #renderActions = () => {\n return (\n <ch-tabular-grid\n class=\"tabular-grid scrollable\"\n rowSelectionMode=\"none\"\n keyboardNavigationMode=\"focus\"\n columnResizeMode=\"single\"\n >\n <ch-tabular-grid-columnset class=\"tabular-grid-column-set\">\n <ch-tabular-grid-column\n class=\"tabular-grid-column\"\n columnId=\"code\"\n columnName=\"\"\n settingable={false}\n ></ch-tabular-grid-column>\n <ch-tabular-grid-column\n class=\"tabular-grid-column\"\n columnId=\"enabled\"\n settingable={false}\n columnName={this.#_componentLocale.actions.enabledCheckbox}\n ></ch-tabular-grid-column>\n <ch-tabular-grid-column\n class=\"tabular-grid-column\"\n columnId=\"required\"\n settingable={false}\n columnName={this.#_componentLocale.actions.requiredCheckbox}\n ></ch-tabular-grid-column>\n </ch-tabular-grid-columnset>\n\n <ch-tabular-grid-row\n // read\n class=\"tabular-grid-row\"\n rowid=\"read\"\n >\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n {this.#_componentLocale.actions.readLabel}\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.readEnabled.toString()}\n ref={el =>\n (this.#readEnabledCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.readRequired.toString()}\n ref={el =>\n (this.#readRequiredCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n </ch-tabular-grid-row>\n\n <ch-tabular-grid-row\n // new\n class=\"tabular-grid-row\"\n rowid=\"read\"\n >\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n {this.#_componentLocale.actions.newLabel}\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.newEnabled.toString()}\n ref={el =>\n (this.#newEnabledCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.newRequired.toString()}\n ref={el =>\n (this.#newRequiredCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n </ch-tabular-grid-row>\n\n <ch-tabular-grid-row\n // update\n class=\"tabular-grid-row\"\n rowid=\"read\"\n >\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n {this.#_componentLocale.actions.updateLabel}\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.updateEnabled.toString()}\n ref={el =>\n (this.#updateEnabledCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.updateRequired.toString()}\n ref={el =>\n (this.#updateRequiredCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n </ch-tabular-grid-row>\n\n <ch-tabular-grid-row\n // delete\n class=\"tabular-grid-row\"\n rowid=\"read\"\n >\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n {this.#_componentLocale.actions.deleteLabel}\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.deleteEnabled.toString()}\n ref={el =>\n (this.#deleteEnabledCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n <ch-tabular-grid-cell class=\"tabular-grid-cell\">\n <ch-checkbox\n class=\"checkbox\"\n checkedValue={CHECKED_VALUE}\n value={this.selectedDocument?.deleteRequired.toString()}\n ref={el =>\n (this.#deleteRequiredCheckboxEl = el as HTMLChCheckboxElement)\n }\n ></ch-checkbox>\n </ch-tabular-grid-cell>\n </ch-tabular-grid-row>\n </ch-tabular-grid>\n );\n };\n\n #renderEmptyState = () => {\n return (\n <gx-ide-empty-state\n class=\"recent-objects__empty-state\"\n stateIconSrc={MODULE_ICON}\n isAnimated={this.#renderedFirstTime}\n stateTitle={this.#_componentLocale.emptyRightPanelInfo.title}\n >\n <button\n class=\"button-secondary\"\n onClick={this.#selectDocumentCallbackHandler}\n >\n {this.#_componentLocale.emptyRightPanelInfo.buttonCaption}\n </button>\n </gx-ide-empty-state>\n );\n };\n\n #renderFooter = () => {\n return (\n <footer class=\"footer control-footer control-footer-with-border spacing-body-block-end spacing-body-inline\">\n <div class=\"buttons-spacer\">\n <button\n class=\"button-secondary\"\n id=\"button-cancel\"\n onClick={this.#cancelCallbackHandler}\n part=\"button-cancel\"\n >\n {this.#_componentLocale.footer.cancelButton}\n </button>\n <button\n class=\"button-primary\"\n id=\"button-create\"\n onClick={this.#confirmCallbackHandler}\n part=\"button-create\"\n >\n {this.#_componentLocale.footer.confirmButton}\n </button>\n </div>\n </footer>\n );\n };\n\n #renderMain = () => {\n return [\n <div class=\"documents__list spacing-body-inline\">\n <ch-action-list-render\n selection=\"single\"\n class=\"list-box\"\n model={this.documentsActionListState}\n onSelectedItemsChange={this.#objectSelectionChangedHandler}\n ></ch-action-list-render>\n </div>,\n this.#renderActions()\n ];\n };\n\n render() {\n return (\n <Host class=\"widget\">\n <ch-theme model={CSS_BUNDLES}></ch-theme>\n <ch-shortcuts\n src={this.#shortcutsSrc}\n ref={(el: HTMLChShortcutsElement) =>\n (this.#chShortcutsEl = el as HTMLChShortcutsElement)\n }\n ></ch-shortcuts>\n <section class=\"section\">\n <div class=\"main field-group\">\n <div class=\"documents__header buttons-spacer spacing-body-inline spacing-body-block-start\">\n <ch-combo-box-render\n class=\"combo-box documents__suggest\"\n model={this.suggestedDocuments}\n placeholder={\n this.#_componentLocale.documents.suggestPlaceholder\n }\n suggest={true}\n onInput={this.#documentSuggestValueChangedHandler}\n onChange={this.#listenDocumentSelected}\n suggestOptions={{\n alreadyProcessed: false,\n autoExpand: true,\n hideMatchesAndShowNonMatches: false,\n highlightMatchedItems: false,\n matchCase: false,\n regularExpression: false,\n strict: false\n }}\n ></ch-combo-box-render>\n\n <span>\n <button\n class=\"button-tertiary button-icon-only\"\n aria-label={\n this.#_componentLocale.documents.addDocumentButtonLabel\n }\n title={\n this.#_componentLocale.documents.addDocumentButtonLabel\n }\n onClick={this.#selectDocumentCallbackHandler}\n >\n <ch-image class=\"icon-sm\" src={MORE_ICON}></ch-image>\n </button>\n\n <button\n class=\"button-tertiary button-icon-only\"\n aria-label={\n this.#_componentLocale.documents.clearDocumentButtonLabel\n }\n title={\n this.#_componentLocale.documents.clearDocumentButtonLabel\n }\n onClick={this.#handleDeleteButton}\n >\n <ch-image class=\"icon-sm\" src={DELETE_ICON}></ch-image>\n </button>\n </span>\n </div>\n\n {this.documentsActionListState.length\n ? this.#renderMain()\n : this.#renderEmptyState()}\n </div>\n {this.#renderFooter()}\n </section>\n </Host>\n );\n }\n}\n\nexport type TaskDocumentData = {\n name: string;\n readEnabled: boolean;\n readRequired: boolean;\n newEnabled: boolean;\n newRequired: boolean;\n updateEnabled: boolean;\n updateRequired: boolean;\n deleteEnabled: boolean;\n deleteRequired: boolean;\n};\n\nexport type SuggestDocumentsCallback = (\n documentName: string\n) => Promise<string[] | undefined>;\nexport type SelectDocumentCallback = () => Promise<string | undefined>;\nexport type ConfirmCallback = (data: TaskDocumentData[]) => Promise<void>;\nexport type CancelCallback = () => Promise<void>;\n"]}
@@ -14,7 +14,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
14
14
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
15
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
16
  };
17
- var _GxIdeDataSelector_firstGridObjectId, _GxIdeDataSelector_loadItemsCallbackJustCalled, _GxIdeDataSelector_componentLocale, _GxIdeDataSelector_animateEmptyState, _GxIdeDataSelector_shortcutsSrc, _GxIdeDataSelector_filterPatternEl, _GxIdeDataSelector_filterObjectEl, _GxIdeDataSelector_chShortcutsEl, _GxIdeDataSelector_chTabularGridObjectsEl, _GxIdeDataSelector_evaluateFirstRowSelection, _GxIdeDataSelector_chGridKeyDownHandler, _GxIdeDataSelector_confirmCallbackHandler, _GxIdeDataSelector_editCallbackHandler, _GxIdeDataSelector_hostKeyPressHandler, _GxIdeDataSelector_objectsSelectionChangedHandler, _GxIdeDataSelector_newVariableCallbackHandler, _GxIdeDataSelector_refreshUIWithNewConfiguration, _GxIdeDataSelector_renderFilter, _GxIdeDataSelector_renderObjects, _GxIdeDataSelector_sortObjectsByName;
17
+ var _GxIdeDataSelector_firstGridObjectId, _GxIdeDataSelector_loadItemsCallbackJustCalled, _GxIdeDataSelector_componentLocale, _GxIdeDataSelector_animateEmptyState, _GxIdeDataSelector_shortcutsSrc, _GxIdeDataSelector_filterPatternEl, _GxIdeDataSelector_filterObjectEl, _GxIdeDataSelector_chShortcutsEl, _GxIdeDataSelector_chTabularGridObjectsEl, _GxIdeDataSelector_evaluateFirstRowSelection, _GxIdeDataSelector_chGridKeyDownHandler, _GxIdeDataSelector_confirmCallbackHandler, _GxIdeDataSelector_editCallbackHandler, _GxIdeDataSelector_hostKeyPressHandler, _GxIdeDataSelector_objectsSelectionChangedHandler, _GxIdeDataSelector_newVariableCallbackHandler, _GxIdeDataSelector_refreshUIWithNewConfiguration, _GxIdeDataSelector_renderFilter, _GxIdeDataSelector_renderObjects, _GxIdeDataSelector_renderEditButtons, _GxIdeDataSelector_sortObjectsByName;
18
18
  /* eslint-disable @stencil-community/own-props-must-be-private */
19
19
  import { Host, h, getAssetPath } from "@stencil/core";
20
20
  import { Locale } from "../../common/locale";
@@ -129,6 +129,20 @@ export class GxIdeDataSelector {
129
129
  ? "objects/attribute"
130
130
  : "objects-parts/variables", class: "icon-md" })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.name), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.dataType), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.description)))))) : (h("ch-tabular-grid-rowset", { class: "tabular-grid-rowset" }, h("ch-tabular-grid-rowset-empty", null, displayLoader ? (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").loader.title, show: true })) : (h("gx-ide-empty-state", { isAnimated: __classPrivateFieldGet(this, _GxIdeDataSelector_animateEmptyState, "f"), stateIconSrc: FILTER_ICON, stateTitle: __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").emptyState.title })))))));
131
131
  });
132
+ _GxIdeDataSelector_renderEditButtons.set(this, () => {
133
+ if (!this.editCallback && !this.newVariableCallback) {
134
+ return null;
135
+ }
136
+ const newVariableButtonEnabled = this.newVariableCallback && !this.loading;
137
+ const editButtonEnabled = this.editCallback && !this.loading && this.selectedObjectsIds.length;
138
+ return (h("div", { class: "buttons-spacer" }, this.newVariableCallback ? (h("button", {
139
+ // New Variable Button
140
+ class: "button-secondary", disabled: !newVariableButtonEnabled, part: "button button-new", type: "button", onClick: __classPrivateFieldGet(this, _GxIdeDataSelector_newVariableCallbackHandler, "f")
141
+ }, __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").footer.btnNew)) : ([]), this.editCallback ? (h("button", {
142
+ // Edit Button
143
+ class: "button-secondary", disabled: !editButtonEnabled, part: "button button-edit", type: "button", onClick: editButtonEnabled && __classPrivateFieldGet(this, _GxIdeDataSelector_editCallbackHandler, "f")
144
+ }, __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").footer.btnEdit)) : ([])));
145
+ });
132
146
  _GxIdeDataSelector_sortObjectsByName.set(this, (objects) =>
133
147
  // TODO (make this a common helper function
134
148
  // and use it in other dialog grids that
@@ -188,16 +202,15 @@ export class GxIdeDataSelector {
188
202
  return isValid;
189
203
  }
190
204
  render() {
191
- const newVariableButtonEnabled = !this.loading;
192
- const editButtonEnabled = !this.loading && this.selectedObjectsIds.length;
193
205
  const okButtonEnabled = !this.loading;
194
- return (h(Host, { onKeyPress: __classPrivateFieldGet(this, _GxIdeDataSelector_hostKeyPressHandler, "f"), class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeDataSelector_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeDataSelector_chShortcutsEl, el, "f")) }), h("section", { class: "section" }, h("header", { class: "header control-header-with-border spacing-body-block-start spacing-body-inline" }, __classPrivateFieldGet(this, _GxIdeDataSelector_renderFilter, "f").call(this)), __classPrivateFieldGet(this, _GxIdeDataSelector_renderObjects, "f").call(this), h("footer", { class: "footer control-footer-with-border control-footer-space-between spacing-body-inline spacing-body-block-end" }, h("div", { class: "buttons-spacer" }, h("button", {
195
- // New Variable Button
196
- class: "button-secondary", disabled: !newVariableButtonEnabled, part: "button button-new", type: "button", onClick: __classPrivateFieldGet(this, _GxIdeDataSelector_newVariableCallbackHandler, "f")
197
- }, __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").footer.btnNew), h("button", {
198
- // Edit Button
199
- class: "button-secondary", disabled: !editButtonEnabled, part: "button button-edit", type: "button", onClick: editButtonEnabled && __classPrivateFieldGet(this, _GxIdeDataSelector_editCallbackHandler, "f")
200
- }, __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").footer.btnEdit)), h("div", { class: "buttons-spacer" }, h("button", {
206
+ const footerJustifySpaceBetween = !!this.newVariableCallback || !!this.editCallback;
207
+ return (h(Host, { onKeyPress: __classPrivateFieldGet(this, _GxIdeDataSelector_hostKeyPressHandler, "f"), class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeDataSelector_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeDataSelector_chShortcutsEl, el, "f")) }), h("section", { class: "section" }, h("header", { class: "header control-header-with-border spacing-body-block-start spacing-body-inline" }, __classPrivateFieldGet(this, _GxIdeDataSelector_renderFilter, "f").call(this)), __classPrivateFieldGet(this, _GxIdeDataSelector_renderObjects, "f").call(this), h("footer", { class: {
208
+ "footer": true,
209
+ "control-footer-with-border": true,
210
+ "control-footer-space-between": footerJustifySpaceBetween,
211
+ "spacing-body-inline": true,
212
+ "spacing-body-block-end": true
213
+ } }, __classPrivateFieldGet(this, _GxIdeDataSelector_renderEditButtons, "f").call(this), h("div", { class: "buttons-spacer" }, h("button", {
201
214
  // Cancel Button
202
215
  class: "button-secondary", part: "button button-cancel", type: "button", onClick: this.cancelCallback
203
216
  }, __classPrivateFieldGet(this, _GxIdeDataSelector_componentLocale, "f").footer.btnCancel), h("button", {
@@ -316,7 +329,7 @@ export class GxIdeDataSelector {
316
329
  }
317
330
  }
318
331
  },
319
- "required": true,
332
+ "required": false,
320
333
  "optional": false,
321
334
  "docs": {
322
335
  "tags": [],
@@ -376,7 +389,7 @@ export class GxIdeDataSelector {
376
389
  }
377
390
  }
378
391
  },
379
- "required": true,
392
+ "required": false,
380
393
  "optional": false,
381
394
  "docs": {
382
395
  "tags": [],
@@ -475,5 +488,5 @@ export class GxIdeDataSelector {
475
488
  }
476
489
  static get elementRef() { return "el"; }
477
490
  }
478
- _GxIdeDataSelector_firstGridObjectId = new WeakMap(), _GxIdeDataSelector_loadItemsCallbackJustCalled = new WeakMap(), _GxIdeDataSelector_componentLocale = new WeakMap(), _GxIdeDataSelector_animateEmptyState = new WeakMap(), _GxIdeDataSelector_shortcutsSrc = new WeakMap(), _GxIdeDataSelector_filterPatternEl = new WeakMap(), _GxIdeDataSelector_filterObjectEl = new WeakMap(), _GxIdeDataSelector_chShortcutsEl = new WeakMap(), _GxIdeDataSelector_chTabularGridObjectsEl = new WeakMap(), _GxIdeDataSelector_evaluateFirstRowSelection = new WeakMap(), _GxIdeDataSelector_chGridKeyDownHandler = new WeakMap(), _GxIdeDataSelector_confirmCallbackHandler = new WeakMap(), _GxIdeDataSelector_editCallbackHandler = new WeakMap(), _GxIdeDataSelector_hostKeyPressHandler = new WeakMap(), _GxIdeDataSelector_objectsSelectionChangedHandler = new WeakMap(), _GxIdeDataSelector_newVariableCallbackHandler = new WeakMap(), _GxIdeDataSelector_refreshUIWithNewConfiguration = new WeakMap(), _GxIdeDataSelector_renderFilter = new WeakMap(), _GxIdeDataSelector_renderObjects = new WeakMap(), _GxIdeDataSelector_sortObjectsByName = new WeakMap();
491
+ _GxIdeDataSelector_firstGridObjectId = new WeakMap(), _GxIdeDataSelector_loadItemsCallbackJustCalled = new WeakMap(), _GxIdeDataSelector_componentLocale = new WeakMap(), _GxIdeDataSelector_animateEmptyState = new WeakMap(), _GxIdeDataSelector_shortcutsSrc = new WeakMap(), _GxIdeDataSelector_filterPatternEl = new WeakMap(), _GxIdeDataSelector_filterObjectEl = new WeakMap(), _GxIdeDataSelector_chShortcutsEl = new WeakMap(), _GxIdeDataSelector_chTabularGridObjectsEl = new WeakMap(), _GxIdeDataSelector_evaluateFirstRowSelection = new WeakMap(), _GxIdeDataSelector_chGridKeyDownHandler = new WeakMap(), _GxIdeDataSelector_confirmCallbackHandler = new WeakMap(), _GxIdeDataSelector_editCallbackHandler = new WeakMap(), _GxIdeDataSelector_hostKeyPressHandler = new WeakMap(), _GxIdeDataSelector_objectsSelectionChangedHandler = new WeakMap(), _GxIdeDataSelector_newVariableCallbackHandler = new WeakMap(), _GxIdeDataSelector_refreshUIWithNewConfiguration = new WeakMap(), _GxIdeDataSelector_renderFilter = new WeakMap(), _GxIdeDataSelector_renderObjects = new WeakMap(), _GxIdeDataSelector_renderEditButtons = new WeakMap(), _GxIdeDataSelector_sortObjectsByName = new WeakMap();
479
492
  //# sourceMappingURL=data-selector.js.map