@genexus/genexus-ide-ui 1.1.24 → 1.1.25

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 (31) hide show
  1. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  2. package/dist/cjs/gx-ide-ww-files.cjs.entry.js +235 -211
  3. package/dist/cjs/gx-ide-ww-files.cjs.entry.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/components/ww-files/gx-ide-assets/ww-files/langs/ww-files.lang.en.json +10 -1
  6. package/dist/collection/components/ww-files/gx-ide-assets/ww-files/langs/ww-files.lang.ja.json +9 -0
  7. package/dist/collection/components/ww-files/gx-ide-assets/ww-files/langs/ww-files.lang.zh.json +9 -0
  8. package/dist/collection/components/ww-files/helpers.js +12 -0
  9. package/dist/collection/components/ww-files/helpers.js.map +1 -1
  10. package/dist/collection/components/ww-files/ww-files.css +49 -63
  11. package/dist/collection/components/ww-files/ww-files.js +270 -421
  12. package/dist/collection/components/ww-files/ww-files.js.map +1 -1
  13. package/dist/components/gx-ide-ww-files.js +258 -233
  14. package/dist/components/gx-ide-ww-files.js.map +1 -1
  15. package/dist/esm/genexus-ide-ui.js +1 -1
  16. package/dist/esm/gx-ide-ww-files.entry.js +236 -212
  17. package/dist/esm/gx-ide-ww-files.entry.js.map +1 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  20. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js.map +1 -1
  21. package/dist/genexus-ide-ui/gx-ide-assets/ww-files/langs/ww-files.lang.en.json +10 -1
  22. package/dist/genexus-ide-ui/gx-ide-assets/ww-files/langs/ww-files.lang.ja.json +9 -0
  23. package/dist/genexus-ide-ui/gx-ide-assets/ww-files/langs/ww-files.lang.zh.json +9 -0
  24. package/dist/genexus-ide-ui/p-163bfc6a.entry.js +611 -0
  25. package/dist/genexus-ide-ui/p-163bfc6a.entry.js.map +1 -0
  26. package/dist/types/components/ww-files/helpers.d.ts +1 -0
  27. package/dist/types/components/ww-files/ww-files.d.ts +36 -76
  28. package/dist/types/components.d.ts +10 -89
  29. package/package.json +1 -1
  30. package/dist/genexus-ide-ui/p-385c9544.entry.js +0 -564
  31. package/dist/genexus-ide-ui/p-385c9544.entry.js.map +0 -1
@@ -1,6 +1,8 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-10af18cf.js';
1
+ import { h, r as registerInstance, H as Host, a as getElement } from './index-10af18cf.js';
2
+ import { g as getIconPath } from './MERCURY_ASSETS-ccf43ae3.js';
2
3
  import { L as Locale } from './locale-e5107fad.js';
3
4
  import { c as config } from './config-1ef9d75a.js';
5
+ import { f as formatDate } from './helpers-a4f16ffb.js';
4
6
 
5
7
  const mapOptionsToComboBoxItemModel = (options) => {
6
8
  return options.map(option => {
@@ -12,16 +14,20 @@ const mapOptionsToComboBoxItemModel = (options) => {
12
14
  };
13
15
  });
14
16
  };
17
+ const escapeRegExp = (string) => {
18
+ return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
19
+ };
20
+ const hiChar = (text, search) => {
21
+ if (!search) {
22
+ return text;
23
+ }
24
+ const escapedSearch = escapeRegExp(search);
25
+ const parts = text.split(new RegExp(`(${escapedSearch})`, "gi"));
26
+ return parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (h("span", { key: i, class: "hiChar" }, part)) : (part));
27
+ };
15
28
 
16
- const wwFilesCss = "/*Gx Ide*/\n/*@container queries*/\n/* hiChar styles\nFound on /common/helpers.tsx hiChar function is used to add a span/class to every character that matches a search value. It is used to help the user see why the filter results are filtered. The span/class on the characters are useless without proper styling.\n*/\n:host {\n container-type: inline-size;\n display: grid;\n block-size: 100%;\n overflow: auto;\n grid-template-rows: max-content 1fr max-content;\n}\n\n.hide {\n display: none !important;\n}\n\n.section {\n display: contents;\n}\n\n.header {\n grid-template-areas: \"name module-folder\" \"advanced-filter-accordion advanced-filter-accordion\";\n grid-template-columns: 1fr 1fr;\n grid-auto-rows: max-content max-content;\n}\n\n.name {\n grid-area: name;\n}\n\n.module-folder {\n grid-area: module-folder;\n}\n\n.advanced-filter-accordion {\n grid-area: advanced-filter-accordion;\n}\n\n.main {\n display: grid;\n grid-template-columns: 1fr auto;\n gap: var(--mer-spacing--md);\n overflow: auto;\n padding-block-start: var(--mer-spacing--md);\n}\n\n.main__grid {\n display: grid;\n grid-template-rows: max-content 1fr;\n gap: var(--mer-spacing--md);\n overflow: auto;\n}\n\n.main__filter {\n display: grid;\n grid-auto-rows: max-content;\n gap: var(--mer-spacing--sm);\n overflow: auto;\n}\n\n.search-content {\n inline-size: 100%;\n}\n\n.filter-row {\n display: grid;\n grid-template-columns: 1fr 2fr;\n gap: var(--mer-spacing--md);\n}\n\n.category-column {\n grid-column: 1;\n}\n\n.checkboxes-column {\n grid-column: 2;\n display: flex;\n flex-direction: row;\n gap: var(--mer-spacing--md);\n align-items: center;\n min-block-size: 100%;\n justify-content: flex-start;\n padding-block-start: 1.75rem;\n}\n\n.modified-inputs {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--mer-spacing--md);\n margin-block-start: var(--mer-spacing--sm);\n}\n.modified-inputs .field {\n display: flex;\n flex-direction: column;\n gap: var(--mer-spacing--sm);\n}\n.modified-inputs .field.hide {\n display: none;\n}\n.modified-inputs .field .input,\n.modified-inputs .field .combo-box {\n width: 100%;\n}\n\n.tabular-grid-ww-files {\n overflow: auto;\n inline-size: 100%;\n border-inline-end: var(--section-common-border);\n}\n\n.main__files-container {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: var(--mer-spacing--xs);\n position: relative;\n z-index: 1;\n}\n\n.hiChar {\n color: var(--mer-color__primary--200);\n filter: brightness(1.3);\n}\n\n.tabular-grid-ww-files ch-tabular-grid-cell:is(:nth-child(4)) {\n padding-block: var(--grid-cell__padding-block);\n padding-inline: var(--grid-cell__padding-inline);\n align-items: start;\n justify-content: start;\n display: inline-block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-inline-size: 0;\n}\n@container (max-width: 992px) {\n .main__files-container {\n grid-template-columns: repeat(3, 1fr);\n }\n}";
29
+ const wwFilesCss = ":host{container-type:inline-size;display:grid;block-size:100%;overflow:auto;grid-template-rows:max-content 1fr max-content}.section{display:contents}.header{grid-template-areas:\"name module-folder\" \"advanced-filter advanced-filter\";grid-template-columns:1fr 1fr;grid-auto-rows:max-content max-content}.name{grid-area:name}.module-folder{grid-area:module-folder}.advanced-filter{grid-area:advanced-filter}.advanced-filter__container{display:grid;grid-auto-rows:max-content}.advanced-filter__first-row{grid-template-columns:1fr 1fr}.advanced-filter__second-row{grid-template-columns:1fr 1fr 1fr}.advanced-filter .all-descendants__modified{display:flex;flex-direction:row;align-items:center;block-size:32px;gap:16px;align-self:self-end}.field-date{grid-template-areas:\"label-date-time label-date-time\" \"input-date-time icon-clear-date-time\";grid-template-columns:1fr max-content;column-gap:var(--mer-spacing--2xs)}.label-date-time{display:flex;align-items:center;gap:6px;grid-area:label-date-time}.label-date-time .icon-md{--mer-icon__box--md:16.8px}.input-date-time{block-size:31.98px;grid-area:input-date-time}.icon-clear-date-time{grid-area:icon-clear-date-time}.tabular-grid{overflow:auto;inline-size:100%;border-inline-end:var(--section-common-border)}.tabular-grid.empty::part(main),.tabular-grid.loading::part(main){overflow:hidden}ch-tabular-grid-rowset-empty{position:relative}.main__files-container{display:grid;grid-template-columns:repeat(4, 1fr);gap:var(--mer-spacing--xs);position:relative;z-index:1}.hiChar{color:var(--mer-color__primary--200);filter:brightness(1.3)}.tabular-grid ch-tabular-grid-cell:is(:nth-child(4)){padding-block:var(--grid-cell__padding-block);padding-inline:var(--grid-cell__padding-inline);align-items:start;justify-content:start;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-inline-size:0}.tabular-grid-cell-description{min-inline-size:max-content !important}.hiChar{color:var(--mer-color__primary--200);filter:brightness(1.3)}";
17
30
 
18
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
19
- if (kind === "a" && !f)
20
- throw new TypeError("Private accessor was defined without a getter");
21
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
22
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
23
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
24
- };
25
31
  var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
26
32
  if (kind === "m")
27
33
  throw new TypeError("Private method is not writable");
@@ -31,7 +37,14 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
31
37
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
32
38
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
33
39
  };
34
- var _GxIdeWWFiles_componentLocale, _GxIdeWWFiles_ACCORDION_FILTER_ID, _GxIdeWWFiles_ACCORDION_MODEL, _GxIdeWWFiles_chGridEl, _GxIdeWWFiles_filterAfterTypeEl, _GxIdeWWFiles_filterAllDescendantsEl, _GxIdeWWFiles_filterCategoryEl, _GxIdeWWFiles_filterModifiedDateEl, _GxIdeWWFiles_filterModuleEl, _GxIdeWWFiles_filterModifiedEl, _GxIdeWWFiles_filterNameEl, _GxIdeWWFiles_filterSearchContentsEl, _GxIdeWWFiles_filterUserEl, _GxIdeWWFiles_renderHeader, _GxIdeWWFiles_renderObjects, _GxIdeWWFiles_hiChar, _GxIdeWWFiles_formatDate, _GxIdeWWFiles_getObjects, _GxIdeWWFiles_filterFiles, _GxIdeWWFiles_handleFilterInput, _GxIdeWWFiles_handleSearchContentsInput, _GxIdeWWFiles_deleteSelectionCallbackHandle, _GxIdeWWFiles_deselectAll, _GxIdeWWFiles_expandedHandler, _GxIdeWWFiles_filterModifiedCallbackHandle, _GxIdeWWFiles_filterAfterTypeCallbackHandle, _GxIdeWWFiles_listenChanges, _GxIdeWWFiles_newFileCallbackHandle, _GxIdeWWFiles_openSelectionCallbackHandle, _GxIdeWWFiles_selectAll;
40
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
41
+ if (kind === "a" && !f)
42
+ throw new TypeError("Private accessor was defined without a getter");
43
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
44
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
45
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
46
+ };
47
+ var _GxIdeWWFiles_componentLocale, _GxIdeWWFiles_ACCORDION_MODEL, _GxIdeWWFiles_nameValue, _GxIdeWWFiles_moduleValue, _GxIdeWWFiles_searchContentsValue, _GxIdeWWFiles_categoryValue, _GxIdeWWFiles_allDescendants, _GxIdeWWFiles_userValue, _GxIdeWWFiles_selectedObjectsIds, _GxIdeWWFiles_chGridEl, _GxIdeWWFiles_filterModuleEl, _GxIdeWWFiles_setFilterDefaultValues, _GxIdeWWFiles_allDescendantsCheckboxHandler, _GxIdeWWFiles_attachGridListeners, _GxIdeWWFiles_categoryInputHandler, _GxIdeWWFiles_clearDateTimeValue, _GxIdeWWFiles_dateTimeInputHandler, _GxIdeWWFiles_deleteSelectionCallbackHandler, _GxIdeWWFiles_deselectAll, _GxIdeWWFiles_evaluateModifiedDates, _GxIdeWWFiles_filterAfterTypeCallbackHandler, _GxIdeWWFiles_formatDate, _GxIdeWWFiles_getObjects, _GxIdeWWFiles_renderHeader, _GxIdeWWFiles_renderObjects, _GxIdeWWFiles_moduleValueChangedHandler, _GxIdeWWFiles_nameInputHandler, _GxIdeWWFiles_newFileCallbackHandler, _GxIdeWWFiles_openSelectionCallbackHandler, _GxIdeWWFiles_searchContentsInputHandler, _GxIdeWWFiles_setLoadingState, _GxIdeWWFiles_userInputHandler, _GxIdeWWFiles_showModifiedCheckboxHandler, _GxIdeWWFiles_selectAll;
35
48
  const CSS_BUNDLES = [
36
49
  "resets/box-sizing",
37
50
  "components/button",
@@ -39,237 +52,266 @@ const CSS_BUNDLES = [
39
52
  "components/combo-box",
40
53
  "components/accordion",
41
54
  "components/edit",
55
+ "components/icon",
56
+ "components/tooltip",
42
57
  "components/tabular-grid",
43
58
  "utils/form",
44
59
  "utils/layout",
45
60
  "utils/typography",
46
61
  "utils/spacing"
47
62
  ];
63
+ const CLEAR_ICON = getIconPath({
64
+ category: "system",
65
+ name: "close",
66
+ colorType: "neutral"
67
+ });
68
+ const FILTER_ICON = getIconPath({
69
+ category: "window-tools",
70
+ name: "filter",
71
+ colorType: "on-elevation"
72
+ });
73
+ const INFO_ICON = getIconPath({
74
+ category: "system",
75
+ name: "information",
76
+ colorType: "on-elevation"
77
+ });
78
+ const ACCORDION_FILTER_ID = "advanced-filter";
48
79
  const FILTER_AFTER_DATE_TIME = "afterDateTime";
49
80
  const FILTER_AFTER_LAST_BUILD = "afterLastBuild";
50
81
  const FILTER_AFTER_IMPORT = "afterImport";
82
+ const CHECKBOX_CHECKED_VALUE = "checked";
83
+ const CHECKBOX_UNCHECKED_VALUE = "unchecked";
51
84
  const GxIdeWWFiles = class {
52
85
  constructor(hostRef) {
53
86
  registerInstance(this, hostRef);
54
- this.componentDidLoadEvent = createEvent(this, "componentDidLoadEvent", 7);
55
87
  _GxIdeWWFiles_componentLocale.set(this, void 0);
56
- _GxIdeWWFiles_ACCORDION_FILTER_ID.set(this, "advanced-filter");
57
88
  _GxIdeWWFiles_ACCORDION_MODEL.set(this, []);
89
+ // Filter Values
90
+ _GxIdeWWFiles_nameValue.set(this, void 0);
91
+ _GxIdeWWFiles_moduleValue.set(this, void 0);
92
+ // Advanced Filter Values
93
+ _GxIdeWWFiles_searchContentsValue.set(this, void 0);
94
+ _GxIdeWWFiles_categoryValue.set(this, void 0);
95
+ _GxIdeWWFiles_allDescendants.set(this, void 0);
96
+ _GxIdeWWFiles_userValue.set(this, void 0);
97
+ // Other
98
+ _GxIdeWWFiles_selectedObjectsIds.set(this, []);
58
99
  _GxIdeWWFiles_chGridEl.set(this, void 0);
59
- _GxIdeWWFiles_filterAfterTypeEl.set(this, void 0);
60
- _GxIdeWWFiles_filterAllDescendantsEl.set(this, void 0);
61
- _GxIdeWWFiles_filterCategoryEl.set(this, void 0);
62
- _GxIdeWWFiles_filterModifiedDateEl.set(this, void 0);
63
100
  _GxIdeWWFiles_filterModuleEl.set(this, void 0);
64
- _GxIdeWWFiles_filterModifiedEl.set(this, void 0);
65
- _GxIdeWWFiles_filterNameEl.set(this, void 0);
66
- _GxIdeWWFiles_filterSearchContentsEl.set(this, void 0);
67
- _GxIdeWWFiles_filterUserEl.set(this, void 0);
68
- _GxIdeWWFiles_renderHeader.set(this, () => {
69
- return [
70
- h("div", { class: "field field-block name" }, h("label", { class: "label", htmlFor: "filter-files" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.name), h("ch-edit", { id: "filter-files", class: "input", ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterNameEl, el, "f")), value: this.filterFilesInputValue, onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_handleFilterInput, "f"), part: "filter-files" })),
71
- h("div", { class: "field field-block module-folder" }, h("label", { class: "label", htmlFor: "module-folder" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.moduleFolder), h("gx-ide-entity-selector", { part: "filter-module-folder", id: "module/folder", labelPosition: "none", value: this.defaultModule, defaultValue: this.defaultModule, selectEntityCallback: this.selectModuleCallback, ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterModuleEl, el, "f")) })),
72
- h("ch-accordion-render", { class: "accordion-outlined advanced-filter-accordion", model: __classPrivateFieldGet(this, _GxIdeWWFiles_ACCORDION_MODEL, "f"), onExpandedChange: __classPrivateFieldGet(this, _GxIdeWWFiles_expandedHandler, "f") }, h("div", { slot: __classPrivateFieldGet(this, _GxIdeWWFiles_ACCORDION_FILTER_ID, "f"), class: "spacing-body" }, h("div", { class: "main__filter" }, this.showSearchContents && (h("div", { class: "search-content" }, h("div", { class: "field field-block" }, h("label", { class: "label", htmlFor: "filter-content" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.content), h("ch-edit", { id: "filter-content", class: "input", ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterSearchContentsEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_handleSearchContentsInput, "f"), part: "filter-content" })))), h("div", { class: "filter-row" }, h("div", { class: "category-column" }, h("div", { class: "field field-block" }, h("label", { class: "label", htmlFor: "filter-category" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.category), h("ch-combo-box-render", { id: "filter-category", class: "combo-box", value: this.defaultCategory, disabled: !this.categories, ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterCategoryEl, el, "f")), model: this.categoriesComboBoxModel, part: "filter-category", onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f") }))), h("div", { class: "checkboxes-column" }, h("ch-checkbox", { class: "checkbox", caption: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.allDescendants, checkedValue: "filterAllDescendants", ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterAllDescendantsEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f"), part: "filter-all-descendants" }), h("ch-checkbox", { class: "checkbox align-center", caption: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.modified, checkedValue: "filterModified", ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterModifiedEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_filterModifiedCallbackHandle, "f"), part: "filter-modified" })), h("div", { class: "empty-column" })), h("div", { class: { "modified-inputs": true, "hide": !this.filterModified } }, h("div", { class: "field field-block" }, h("label", { class: "label", htmlFor: "filter-after-type" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.after), h("ch-combo-box-render", { id: "filter-after-type", class: "combo-box", value: this.afterCurrentValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterAfterTypeEl, el, "f")), model: this.filterAfterOptions, onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeCallbackHandle, "f"), part: "filter-after-type" })), h("div", { class: "field field-block" }, h("label", { class: "label", htmlFor: "filter-user" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.user), h("ch-edit", { id: "filter-user", class: "input", ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterUserEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f"), part: "filter-user" })), h("div", { class: {
73
- "field field-block": true,
74
- "hide": this.afterCurrentValue !== FILTER_AFTER_DATE_TIME
75
- } }, h("label", { class: "label", htmlFor: "filter-modified-date" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.dateTime), h("ch-edit", { id: "filter-modified-date", type: "date", class: "input", ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterModifiedDateEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f"), part: "filter-modified-date" }))))))
76
- ];
77
- });
78
- _GxIdeWWFiles_renderObjects.set(this, () => {
79
- return (h("div", { class: "field-group main__grid" }, h("ch-tabular-grid", { ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_chGridEl, el, "f")), class: "tabular-grid tabular-grid-ww-files", rowSelectionMode: "multiple", part: "ch-grid-files" }, h("ch-tabular-grid-columnset", { class: "tabular-grid-column-set" }, h("ch-tabular-grid-column", { columnName: "", columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.name, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.common, class: "tabular-grid-column" }), this.showType && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.type, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.common, class: "tabular-grid-column" })), h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.module, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.common, class: "tabular-grid-column" }), this.showDescription && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.description, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.commonDouble, class: "tabular-grid-column" })), this.showModifiedDate && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.modifiedDate, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.showLastUser && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.lastUser, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.showImportDate && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.importDate, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.showLastBuildDate && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.lastBuildDate, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }))), this.filteredFiles.length ? (h("ch-tabular-grid-rowset", { class: "tabular-grid-rowset" }, this.filteredFiles.map((obj) => {
80
- var _a;
81
- return (h("ch-tabular-grid-row", { rowid: obj.id, class: "tabular-grid-row" }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-image", { src: obj.icon })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.name.toLowerCase(), this.filterFilesInputValue)), this.showType && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.type.toLowerCase(), this.filterFilesInputValue))), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.module.toLowerCase(), this.filterFilesInputValue)), this.showDescription && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.description.toLowerCase(), this.filterFilesInputValue))), this.showModifiedDate && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.modifiedDate
82
- ? __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, obj.modifiedDate)
83
- : "", this.filterFilesInputValue))), this.showLastUser && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, ((_a = obj.lastUser) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "", this.filterFilesInputValue))), this.showImportDate && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.importDate ? __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, obj.importDate) : "", this.filterFilesInputValue))), this.showLastBuildDate && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_hiChar, "f").call(this, obj.lastBuildDate
84
- ? __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, obj.lastBuildDate)
85
- : "", this.filterFilesInputValue)))));
86
- }))) : null)));
87
- });
88
- _GxIdeWWFiles_hiChar.set(this, (text, search) => {
89
- if (!search)
90
- return text;
91
- const parts = text.split(new RegExp(`(${search})`, "gi"));
92
- return parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (h("span", { key: i, class: "highlight" }, part)) : (part));
101
+ _GxIdeWWFiles_setFilterDefaultValues.set(this, () => {
102
+ __classPrivateFieldSet(this, _GxIdeWWFiles_nameValue, "", "f");
103
+ __classPrivateFieldSet(this, _GxIdeWWFiles_moduleValue, Object.assign({}, this.defaultModule), "f");
104
+ __classPrivateFieldSet(this, _GxIdeWWFiles_searchContentsValue, "", "f");
105
+ __classPrivateFieldSet(this, _GxIdeWWFiles_categoryValue, this.defaultCategory || this.categoriesComboBoxModel[0].value, "f");
106
+ __classPrivateFieldSet(this, _GxIdeWWFiles_allDescendants, CHECKBOX_UNCHECKED_VALUE, "f");
107
+ this.afterValue = this.filterAfterComboBoxModel[0].value;
108
+ __classPrivateFieldSet(this, _GxIdeWWFiles_userValue, "", "f");
109
+ this.dateTimeValue = undefined;
93
110
  });
94
- _GxIdeWWFiles_formatDate.set(this, (date) => {
95
- return date.toISOString().slice(0, 10);
111
+ _GxIdeWWFiles_allDescendantsCheckboxHandler.set(this, (event) => {
112
+ __classPrivateFieldSet(this, _GxIdeWWFiles_allDescendants, event.detail === CHECKBOX_CHECKED_VALUE
113
+ ? CHECKBOX_CHECKED_VALUE
114
+ : CHECKBOX_UNCHECKED_VALUE, "f");
115
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
96
116
  });
97
- _GxIdeWWFiles_getObjects.set(this, () => {
98
- var _a;
99
- const filters = {
100
- name: __classPrivateFieldGet(this, _GxIdeWWFiles_filterNameEl, "f").value,
101
- searchContents: this.showSearchContents
102
- ? (_a = __classPrivateFieldGet(this, _GxIdeWWFiles_filterSearchContentsEl, "f")) === null || _a === void 0 ? void 0 : _a.value
103
- : null,
104
- category: __classPrivateFieldGet(this, _GxIdeWWFiles_filterCategoryEl, "f").value,
105
- parent: __classPrivateFieldGet(this, _GxIdeWWFiles_filterModuleEl, "f").value ? __classPrivateFieldGet(this, _GxIdeWWFiles_filterModuleEl, "f").value.id : null,
106
- allDescendants: !!__classPrivateFieldGet(this, _GxIdeWWFiles_filterAllDescendantsEl, "f").value,
107
- modifiedAfter: this.filterModified ? this.afterCurrentValue : null,
108
- modifiedBy: this.filterModified ? __classPrivateFieldGet(this, _GxIdeWWFiles_filterUserEl, "f").value : null,
109
- modifiedDate: this.filterModified && this.afterCurrentValue === FILTER_AFTER_DATE_TIME
110
- ? new Date(__classPrivateFieldGet(this, _GxIdeWWFiles_filterModifiedDateEl, "f").value)
111
- : null
112
- };
113
- this.loadCallback(filters).then((items) => {
114
- this.objects = items;
115
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterFiles, "f").call(this);
116
- this.selectedObjectsIds = [];
117
- __classPrivateFieldGet(this, _GxIdeWWFiles_deselectAll, "f").call(this);
117
+ _GxIdeWWFiles_attachGridListeners.set(this, () => {
118
+ __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").addEventListener("selectionChanged", (ev) => {
119
+ __classPrivateFieldSet(this, _GxIdeWWFiles_selectedObjectsIds, ev.detail.rowsId, "f");
120
+ this.selectionChangeCallback(__classPrivateFieldGet(this, _GxIdeWWFiles_selectedObjectsIds, "f"));
118
121
  });
119
- });
120
- _GxIdeWWFiles_filterFiles.set(this, () => {
121
- var _a, _b;
122
- const filterValue = this.filterFilesInputValue.toLowerCase();
123
- const searchContents = this.showSearchContents
124
- ? ((_b = (_a = __classPrivateFieldGet(this, _GxIdeWWFiles_filterSearchContentsEl, "f")) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || ""
125
- : "";
126
- this.filteredFiles = this.objects.filter(file => {
127
- var _a, _b, _c, _d, _e;
128
- const nameMatch = file.name.toLowerCase().includes(filterValue);
129
- const typeMatch = file.type.toLowerCase().includes(filterValue);
130
- const moduleMatch = file.module.toLowerCase().includes(filterValue);
131
- const descriptionMatch = (_a = file.description) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(filterValue);
132
- const modifiedDateMatch = (_b = file.modifiedDate) === null || _b === void 0 ? void 0 : _b.toString().includes(filterValue);
133
- const lastUserMatch = (_c = file.lastUser) === null || _c === void 0 ? void 0 : _c.toLowerCase().includes(filterValue);
134
- const importDateMatch = (_d = file.importDate) === null || _d === void 0 ? void 0 : _d.toString().includes(filterValue);
135
- const contentsMatch = searchContents
136
- ? (_e = file.description) === null || _e === void 0 ? void 0 : _e.toLowerCase().includes(searchContents)
137
- : true;
138
- return ((nameMatch ||
139
- typeMatch ||
140
- moduleMatch ||
141
- descriptionMatch ||
142
- modifiedDateMatch ||
143
- lastUserMatch ||
144
- importDateMatch) &&
145
- contentsMatch);
122
+ __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").addEventListener("rowDoubleClicked", () => {
123
+ __classPrivateFieldGet(this, _GxIdeWWFiles_openSelectionCallbackHandler, "f").call(this);
124
+ });
125
+ __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").addEventListener("rowContextMenu", (ev) => {
126
+ ev.preventDefault();
127
+ ev.stopPropagation();
128
+ this.contextMenuCallback({
129
+ selection: ev.detail.selectedRowsId,
130
+ clientX: ev.detail.clientX,
131
+ clientY: ev.detail.clientY
132
+ });
146
133
  });
147
134
  });
148
- _GxIdeWWFiles_handleFilterInput.set(this, (event) => {
149
- this.filterFilesInputValue = event.detail.toLowerCase();
150
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterFiles, "f").call(this);
135
+ _GxIdeWWFiles_categoryInputHandler.set(this, async (event) => {
136
+ __classPrivateFieldSet(this, _GxIdeWWFiles_categoryValue, event.detail, "f");
137
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
138
+ });
139
+ _GxIdeWWFiles_clearDateTimeValue.set(this, () => {
140
+ this.dateTimeValue = undefined;
151
141
  });
152
- _GxIdeWWFiles_handleSearchContentsInput.set(this, () => {
153
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterFiles, "f").call(this);
142
+ _GxIdeWWFiles_dateTimeInputHandler.set(this, (event) => {
143
+ this.dateTimeValue = event.detail;
144
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
154
145
  });
155
- _GxIdeWWFiles_deleteSelectionCallbackHandle.set(this, () => {
156
- this.deleteSelectionCallback(this.selectedObjectsIds);
146
+ _GxIdeWWFiles_deleteSelectionCallbackHandler.set(this, () => {
147
+ this.deleteSelectionCallback(__classPrivateFieldGet(this, _GxIdeWWFiles_selectedObjectsIds, "f"));
157
148
  });
158
149
  _GxIdeWWFiles_deselectAll.set(this, () => {
159
150
  __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").selectAllRows(false);
160
151
  });
161
- _GxIdeWWFiles_expandedHandler.set(this, (e) => {
162
- if (e.detail.id === __classPrivateFieldGet(this, _GxIdeWWFiles_ACCORDION_FILTER_ID, "f")) {
163
- this.advancedFilterAccordionExpanded = e.detail.expanded;
164
- this.filterMore = e.detail.expanded;
165
- }
166
- });
167
- _GxIdeWWFiles_filterModifiedCallbackHandle.set(this, () => {
168
- this.filterModified = !!__classPrivateFieldGet(this, _GxIdeWWFiles_filterModifiedEl, "f").value;
169
- this.enabledModifiedControls = this.filterModified;
170
- if (!this.filterModified) {
171
- // Reset related fields when unchecking Modified
172
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterUserEl, "f").value = null;
173
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeEl, "f").value = null;
174
- this.afterCurrentValue = null;
175
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterModifiedDateEl, "f").value = null;
152
+ _GxIdeWWFiles_evaluateModifiedDates.set(this, (objectModifiedDate, filterSelectedModifiedDate) => {
153
+ const filterSelectedModifiedDateAsDate = new Date(filterSelectedModifiedDate);
154
+ if (filterSelectedModifiedDateAsDate >= objectModifiedDate) {
155
+ // Object modifed date matches with filter date, or was modified after that date.
156
+ // Highlight to show that it matches.
157
+ return h("span", { class: "hiChar" }, __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, objectModifiedDate));
176
158
  }
177
159
  else {
178
- // Restore default values when checking Modified
179
- this.afterCurrentValue = FILTER_AFTER_DATE_TIME;
180
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeEl, "f").value = FILTER_AFTER_DATE_TIME;
160
+ return __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, objectModifiedDate);
181
161
  }
182
- __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
183
162
  });
184
- _GxIdeWWFiles_filterAfterTypeCallbackHandle.set(this, () => {
185
- const newValue = __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeEl, "f").value;
186
- // Validar que el valor sea uno de los permitidos
187
- if ([
188
- FILTER_AFTER_DATE_TIME,
189
- FILTER_AFTER_LAST_BUILD,
190
- FILTER_AFTER_IMPORT
191
- ].includes(newValue)) {
192
- this.afterCurrentValue = newValue;
193
- }
194
- else {
195
- // Si no es un valor válido, establecer el valor por defecto
196
- this.afterCurrentValue = FILTER_AFTER_DATE_TIME;
197
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeEl, "f").value = FILTER_AFTER_DATE_TIME;
198
- }
163
+ _GxIdeWWFiles_filterAfterTypeCallbackHandler.set(this, (event) => {
164
+ this.afterValue = event.detail;
199
165
  __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
200
166
  });
201
- _GxIdeWWFiles_listenChanges.set(this, () => {
202
- /* module/folder */
203
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterModuleEl, "f").addEventListener("valueChanged", () => {
204
- __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
205
- });
206
- // for grid selection
207
- __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").addEventListener("selectionChanged", (ev) => {
208
- this.selectedObjectsIds = ev.detail.rowsId;
209
- this.selectionChangeCallback(this.selectedObjectsIds);
210
- });
211
- __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").addEventListener("rowDoubleClicked", () => {
212
- __classPrivateFieldGet(this, _GxIdeWWFiles_openSelectionCallbackHandle, "f").call(this);
213
- });
214
- __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").addEventListener("rowContextMenu", (ev) => {
215
- ev.preventDefault();
216
- ev.stopPropagation();
217
- this.contextMenuCallback({
218
- selection: ev.detail.selectedRowsId,
219
- clientX: ev.detail.clientX,
220
- clientY: ev.detail.clientY
221
- });
167
+ _GxIdeWWFiles_formatDate.set(this, (date) => {
168
+ return formatDate(date, "date-time-short");
169
+ });
170
+ _GxIdeWWFiles_getObjects.set(this, () => {
171
+ __classPrivateFieldGet(this, _GxIdeWWFiles_setLoadingState, "f").call(this);
172
+ const filtersValues = {
173
+ name: __classPrivateFieldGet(this, _GxIdeWWFiles_nameValue, "f"),
174
+ searchContents: __classPrivateFieldGet(this, _GxIdeWWFiles_searchContentsValue, "f"),
175
+ category: __classPrivateFieldGet(this, _GxIdeWWFiles_categoryValue, "f"),
176
+ parent: __classPrivateFieldGet(this, _GxIdeWWFiles_filterModuleEl, "f").value.id,
177
+ allDescendants: __classPrivateFieldGet(this, _GxIdeWWFiles_allDescendants, "f") === CHECKBOX_CHECKED_VALUE,
178
+ modifiedAfter: this.showModified ? this.afterValue : undefined,
179
+ modifiedBy: this.showModified ? __classPrivateFieldGet(this, _GxIdeWWFiles_userValue, "f") : undefined,
180
+ modifiedDate: this.showModified ? new Date(this.dateTimeValue) : undefined
181
+ };
182
+ this.loadCallback(filtersValues).then((items) => {
183
+ this.objects = items;
184
+ __classPrivateFieldSet(this, _GxIdeWWFiles_selectedObjectsIds, [], "f");
185
+ __classPrivateFieldGet(this, _GxIdeWWFiles_deselectAll, "f").call(this);
186
+ this.isLoading = false;
222
187
  });
223
188
  });
224
- _GxIdeWWFiles_newFileCallbackHandle.set(this, () => {
189
+ _GxIdeWWFiles_renderHeader.set(this, () => {
190
+ return [
191
+ h("div", {
192
+ // Name
193
+ class: "field field-block field-name"
194
+ }, h("label", { class: "label", htmlFor: "name" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.name), h("ch-edit", { id: "name", class: "input", value: __classPrivateFieldGet(this, _GxIdeWWFiles_nameValue, "f"), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_nameInputHandler, "f"), part: "filter-files", debounce: config.inputDebounce, disabled: this.isLoading })),
195
+ h("div", {
196
+ // Module
197
+ class: "field field-block field-module-folder"
198
+ }, h("label", { class: "label", htmlFor: "module-folder" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.moduleFolder), h("gx-ide-entity-selector", { part: "filter-module-folder", id: "module/folder", labelPosition: "none", value: __classPrivateFieldGet(this, _GxIdeWWFiles_moduleValue, "f"), defaultValue: this.defaultModule, selectEntityCallback: this.selectModuleCallback, ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_filterModuleEl, el, "f")), onValueChanged: __classPrivateFieldGet(this, _GxIdeWWFiles_moduleValueChangedHandler, "f"), disabled: this.isLoading })),
199
+ h("ch-accordion-render", { class: "accordion-outlined advanced-filter", model: __classPrivateFieldGet(this, _GxIdeWWFiles_ACCORDION_MODEL, "f") }, h("div", { slot: ACCORDION_FILTER_ID, class: "spacing-body field-group advanced-filter__container" }, this.showSearchContents && (h("div", {
200
+ // Search contents
201
+ class: "field field-block field-search-contents"
202
+ }, h("label", { class: "label", htmlFor: "filter-content" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.content), h("ch-edit", { id: "filter-content", class: "input", onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_searchContentsInputHandler, "f"), part: "filter-content" }))), h("div", { class: "field-group advanced-filter__first-row" }, h("div", {
203
+ // Category
204
+ class: "field field-block field-category"
205
+ }, h("label", { class: "label", htmlFor: "filter-category" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.category), h("ch-combo-box-render", { id: "filter-category", class: "combo-box disabled", value: __classPrivateFieldGet(this, _GxIdeWWFiles_categoryValue, "f"), disabled: !this.categories || this.isLoading, model: this.categoriesComboBoxModel, part: "filter-category", onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_categoryInputHandler, "f") })), h("div", {
206
+ // All descendants / Modified
207
+ class: "all-descendants__modified field field-inline"
208
+ }, h("ch-checkbox", {
209
+ // All descendants
210
+ class: "checkbox", caption: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.allDescendants, checkedValue: CHECKBOX_CHECKED_VALUE, unCheckedValue: CHECKBOX_UNCHECKED_VALUE, value: __classPrivateFieldGet(this, _GxIdeWWFiles_allDescendants, "f"), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_allDescendantsCheckboxHandler, "f"), part: "filter-all-descendants", disabled: this.isLoading
211
+ }), h("ch-checkbox", {
212
+ // Modified
213
+ class: "checkbox align-center", caption: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.modified, checkedValue: CHECKBOX_CHECKED_VALUE, unCheckedValue: CHECKBOX_UNCHECKED_VALUE, value: this.showModified, onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_showModifiedCheckboxHandler, "f"), part: "filter-modified"
214
+ }))), this.showModified === CHECKBOX_CHECKED_VALUE && (h("div", { class: "field-group advanced-filter__second-row" }, h("div", {
215
+ // After
216
+ class: "field field-block field-after"
217
+ }, h("label", { class: "label", htmlFor: "filter-after-type" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.after), h("ch-combo-box-render", { id: "filter-after-type", class: "combo-box", value: this.afterValue, model: this.filterAfterComboBoxModel, onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeCallbackHandler, "f"), part: "filter-after-type", disabled: this.isLoading })), h("div", {
218
+ // User
219
+ class: "field field-block field-user"
220
+ }, h("label", { class: "label", htmlFor: "filter-user" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.user), h("ch-edit", { id: "filter-user", class: "input", value: __classPrivateFieldGet(this, _GxIdeWWFiles_userValue, "f"), onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_userInputHandler, "f"), part: "filter-user", debounce: config.inputDebounce, disabled: this.isLoading })), this.afterValue === FILTER_AFTER_DATE_TIME && (h("div", {
221
+ // Date/Time
222
+ class: {
223
+ "field field-block field-date": true,
224
+ "hide": this.afterValue !== FILTER_AFTER_DATE_TIME
225
+ }
226
+ }, h("label", { class: "label label-date-time", htmlFor: "filter-date-time" }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.dateTime, h("ch-image", { class: "icon-md icon-clear-date-time", src: INFO_ICON }), h("ch-tooltip", { class: "tooltip", actionElement: null, blockAlign: "outside-start", inlineAlign: "inside-start", delay: config.tooltipSettings.delay }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.dateTimeTooltip)), h("ch-edit", { id: "filter-date-time", type: "datetime-local", class: "input input-date-time", value: this.dateTimeValue, onInput: __classPrivateFieldGet(this, _GxIdeWWFiles_dateTimeInputHandler, "f"), part: "filter-date-time", disabled: this.isLoading }), h("button", { class: "button-tertiary button-icon-only", onClick: __classPrivateFieldGet(this, _GxIdeWWFiles_clearDateTimeValue, "f"), disabled: this.isLoading }, h("ch-image", { class: "icon-md", src: CLEAR_ICON, type: "mask" }))))))))
227
+ ];
228
+ });
229
+ _GxIdeWWFiles_renderObjects.set(this, () => {
230
+ var _a;
231
+ const gridIsEmpty = !this.objects.length;
232
+ return (h("ch-tabular-grid", { ref: (el) => (__classPrivateFieldSet(this, _GxIdeWWFiles_chGridEl, el, "f")), class: {
233
+ "tabular-grid": true,
234
+ "loading": this.isLoading,
235
+ "empty": this.objects.length === 0
236
+ }, rowSelectionMode: "multiple", part: "ch-grid-files" }, h("ch-tabular-grid-columnset", { class: "tabular-grid-column-set" }, h("ch-tabular-grid-column", { columnName: "", columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.name, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.module, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), this.gridColumnsVisibility.description && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.description, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.auto, class: "tabular-grid-column" })), this.gridColumnsVisibility.modifiedDate && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.modifiedDate, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.gridColumnsVisibility.lastUser && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.lastUser, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.gridColumnsVisibility.importDate && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.importDate, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.gridColumnsVisibility.lastBuildDate && (h("ch-tabular-grid-column", { columnName: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").tableHead.lastBuildDate, columnNameHidden: false, settingable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }))), !gridIsEmpty ? (h("ch-tabular-grid-rowset", { class: "tabular-grid-rowset" }, (_a = this.objects) === null || _a === void 0 ? void 0 : _a.map((object) => {
237
+ var _a;
238
+ return (h("ch-tabular-grid-row", { rowid: object.id, class: "tabular-grid-row" }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-image", { src: object.icon })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, hiChar(object.name.toLowerCase(), __classPrivateFieldGet(this, _GxIdeWWFiles_nameValue, "f").toLowerCase())), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, hiChar(object.parent, __classPrivateFieldGet(this, _GxIdeWWFiles_moduleValue, "f").name)), this.gridColumnsVisibility.description && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell tabular-grid-cell-description" }, object.description)), this.gridColumnsVisibility.modifiedDate && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, __classPrivateFieldGet(this, _GxIdeWWFiles_evaluateModifiedDates, "f").call(this, object.modifiedDate, this.dateTimeValue))), this.gridColumnsVisibility.lastUser && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, hiChar((_a = object.lastUser) === null || _a === void 0 ? void 0 : _a.toLowerCase(), __classPrivateFieldGet(this, _GxIdeWWFiles_userValue, "f")))), this.gridColumnsVisibility.importDate && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, hiChar(object.importDate
239
+ ? __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, object.importDate)
240
+ : "", __classPrivateFieldGet(this, _GxIdeWWFiles_nameValue, "f")))), this.gridColumnsVisibility.lastBuildDate && (h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, hiChar(object.lastBuildDate
241
+ ? __classPrivateFieldGet(this, _GxIdeWWFiles_formatDate, "f").call(this, object.lastBuildDate)
242
+ : "", __classPrivateFieldGet(this, _GxIdeWWFiles_nameValue, "f"))))));
243
+ }))) : (h("ch-tabular-grid-rowset", { class: "tabular-grid-rowset" }, h("ch-tabular-grid-rowset-empty", null, this.isLoading ? (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").loader.title, description: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").loader.description, show: true })) : (h("gx-ide-empty-state", { isAnimated: true, stateIconSrc: FILTER_ICON, stateTitle: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").emptyState.title })))))));
244
+ });
245
+ _GxIdeWWFiles_moduleValueChangedHandler.set(this, (event) => {
246
+ __classPrivateFieldSet(this, _GxIdeWWFiles_moduleValue, event.detail, "f");
247
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
248
+ });
249
+ _GxIdeWWFiles_nameInputHandler.set(this, (event) => {
250
+ __classPrivateFieldSet(this, _GxIdeWWFiles_nameValue, event.detail, "f");
251
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
252
+ });
253
+ _GxIdeWWFiles_newFileCallbackHandler.set(this, () => {
225
254
  this.newFileCallback();
226
255
  });
227
- _GxIdeWWFiles_openSelectionCallbackHandle.set(this, () => {
228
- this.openSelectionCallback(this.selectedObjectsIds);
256
+ _GxIdeWWFiles_openSelectionCallbackHandler.set(this, () => {
257
+ this.openSelectionCallback(__classPrivateFieldGet(this, _GxIdeWWFiles_selectedObjectsIds, "f"));
258
+ });
259
+ _GxIdeWWFiles_searchContentsInputHandler.set(this, (event) => {
260
+ __classPrivateFieldSet(this, _GxIdeWWFiles_searchContentsValue, event.detail, "f");
261
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
262
+ });
263
+ _GxIdeWWFiles_setLoadingState.set(this, () => {
264
+ this.objects = [];
265
+ this.isLoading = true;
266
+ });
267
+ _GxIdeWWFiles_userInputHandler.set(this, (event) => {
268
+ __classPrivateFieldSet(this, _GxIdeWWFiles_userValue, event.detail, "f");
269
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
270
+ });
271
+ _GxIdeWWFiles_showModifiedCheckboxHandler.set(this, (event) => {
272
+ this.showModified = event.detail;
229
273
  });
230
274
  _GxIdeWWFiles_selectAll.set(this, () => {
231
275
  __classPrivateFieldGet(this, _GxIdeWWFiles_chGridEl, "f").selectAllRows();
232
276
  });
277
+ this.afterValue = undefined;
233
278
  this.categoriesComboBoxModel = [];
234
- this.afterCurrentValue = FILTER_AFTER_DATE_TIME;
235
- this.filterAfterOptions = undefined;
236
- this.enabledModifiedControls = false;
237
- this.filterModified = false;
238
- this.filterMore = false;
279
+ this.dateTimeValue = undefined;
280
+ this.isLoading = true;
281
+ this.filterAfterComboBoxModel = undefined;
282
+ this.showModified = CHECKBOX_CHECKED_VALUE;
239
283
  this.objects = [];
240
- this.filterFilesInputValue = "";
241
- this.filteredFiles = [];
242
- this.selectedObjectsIds = [];
243
- this.advancedFilterAccordionExpanded = false;
244
284
  this.categories = undefined;
285
+ this.contextMenuCallback = undefined;
245
286
  this.defaultCategory = undefined;
246
287
  this.defaultModule = undefined;
247
- this.filterModules = undefined;
248
- this.types = undefined;
249
- this.contextMenuCallback = undefined;
250
288
  this.deleteSelectionCallback = undefined;
289
+ this.gridColumnsVisibility = {
290
+ description: true,
291
+ importDate: true,
292
+ lastBuildDate: true,
293
+ lastUser: true,
294
+ modifiedDate: true
295
+ };
251
296
  this.loadCallback = undefined;
252
297
  this.newFileCallback = undefined;
253
298
  this.openSelectionCallback = undefined;
254
299
  this.selectModuleCallback = undefined;
255
300
  this.selectionChangeCallback = undefined;
256
301
  this.showSearchContents = false;
257
- this.showDescription = false;
258
- this.showModifiedDate = false;
259
- this.showLastUser = false;
260
- this.showImportDate = false;
261
- this.showType = false;
262
- this.showLastBuildDate = false;
302
+ }
303
+ dateTimeValueChanged() {
304
+ __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
263
305
  }
264
306
  categoriesChanged(newCategories) {
265
307
  this.categoriesComboBoxModel = mapOptionsToComboBoxItemModel(newCategories);
266
308
  }
267
309
  async componentWillLoad() {
268
310
  __classPrivateFieldSet(this, _GxIdeWWFiles_componentLocale, await Locale.getComponentStrings(this.el), "f");
269
- // initialize combo-box models
311
+ // initialize combo-box models
270
312
  this.categoriesChanged(this.categories);
271
313
  // initialize "After" combo-box options
272
- this.filterAfterOptions = [
314
+ this.filterAfterComboBoxModel = [
273
315
  {
274
316
  caption: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter[FILTER_AFTER_DATE_TIME],
275
317
  value: FILTER_AFTER_DATE_TIME
@@ -283,21 +325,18 @@ const GxIdeWWFiles = class {
283
325
  value: FILTER_AFTER_IMPORT
284
326
  }
285
327
  ];
286
- this.afterCurrentValue = FILTER_AFTER_DATE_TIME;
287
328
  // initialize accordion model with proper configuration
288
329
  __classPrivateFieldSet(this, _GxIdeWWFiles_ACCORDION_MODEL, [
289
330
  {
290
- id: __classPrivateFieldGet(this, _GxIdeWWFiles_ACCORDION_FILTER_ID, "f"),
331
+ id: ACCORDION_FILTER_ID,
291
332
  caption: __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").filter.accordionCaption,
292
- expanded: this.advancedFilterAccordionExpanded
333
+ expanded: false
293
334
  }
294
335
  ], "f");
295
- // initialize filtered files
296
- this.filteredFiles = this.objects;
297
- this.componentDidLoadEvent.emit(true);
336
+ __classPrivateFieldGet(this, _GxIdeWWFiles_setFilterDefaultValues, "f").call(this);
298
337
  }
299
338
  componentDidLoad() {
300
- __classPrivateFieldGet(this, _GxIdeWWFiles_listenChanges, "f").call(this);
339
+ __classPrivateFieldGet(this, _GxIdeWWFiles_attachGridListeners, "f").call(this);
301
340
  __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
302
341
  }
303
342
  keyDownHandler(eventInfo) {
@@ -305,11 +344,11 @@ const GxIdeWWFiles = class {
305
344
  switch (eventInfo.key) {
306
345
  case "Enter":
307
346
  eventInfo.preventDefault();
308
- __classPrivateFieldGet(this, _GxIdeWWFiles_openSelectionCallbackHandle, "f").call(this);
347
+ __classPrivateFieldGet(this, _GxIdeWWFiles_openSelectionCallbackHandler, "f").call(this);
309
348
  break;
310
349
  case "Delete":
311
350
  eventInfo.preventDefault();
312
- __classPrivateFieldGet(this, _GxIdeWWFiles_deleteSelectionCallbackHandle, "f").call(this);
351
+ __classPrivateFieldGet(this, _GxIdeWWFiles_deleteSelectionCallbackHandler, "f").call(this);
313
352
  break;
314
353
  case "Escape":
315
354
  eventInfo.preventDefault();
@@ -318,49 +357,34 @@ const GxIdeWWFiles = class {
318
357
  }
319
358
  }
320
359
  }
321
- /**
322
- * Validate necessary data input
323
- */
324
- async validate() {
325
- const isValid = true;
326
- return isValid;
327
- }
328
360
  /**
329
361
  * This method reload the view, refreshing the filters and the table of files.
330
362
  */
331
363
  async reload() {
332
- this.filterFilesInputValue = "";
333
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterUserEl, "f").value = null;
334
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterAfterTypeEl, "f").value = null;
335
- this.afterCurrentValue = null;
336
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterModifiedEl, "f").value = undefined;
337
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterAllDescendantsEl, "f").value = undefined;
338
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterModuleEl, "f").value = this.defaultModule;
339
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterCategoryEl, "f").value = null;
340
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterSearchContentsEl, "f").value = null;
341
- __classPrivateFieldGet(this, _GxIdeWWFiles_filterNameEl, "f").value = null;
342
- this.filterMore = false;
364
+ __classPrivateFieldGet(this, _GxIdeWWFiles_setFilterDefaultValues, "f").call(this);
343
365
  __classPrivateFieldGet(this, _GxIdeWWFiles_getObjects, "f").call(this);
344
366
  }
345
367
  render() {
346
- return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("section", { class: "section" }, h("header", { class: "header control-header-with-border spacing-body-inline spacing-body-block-start field-group" }, __classPrivateFieldGet(this, _GxIdeWWFiles_renderHeader, "f").call(this)), h("div", { class: "main" }, __classPrivateFieldGet(this, _GxIdeWWFiles_renderObjects, "f").call(this)), h("footer", { class: "control-footer-with-border control-footer-space-between spacing-body" }, h("p", {
368
+ var _a;
369
+ return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("section", { class: "section" }, h("header", { class: "header control-header-with-border spacing-body-inline spacing-body-block-start field-group" }, __classPrivateFieldGet(this, _GxIdeWWFiles_renderHeader, "f").call(this)), __classPrivateFieldGet(this, _GxIdeWWFiles_renderObjects, "f").call(this), h("footer", { class: "control-footer-with-border control-footer-space-between spacing-body" }, h("p", {
347
370
  // matching objects
348
371
  class: "text-body", part: "objects-matching"
349
- }, `${this.filteredFiles.length} ${__classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").objCount.matching}`), h("div", { class: "buttons-spacer" }, h("button", {
372
+ }, `${(_a = this.objects) === null || _a === void 0 ? void 0 : _a.length} ${__classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").objCount.matching}`), h("div", { class: "buttons-spacer" }, h("button", {
350
373
  // select all button
351
- id: "button-select-all", class: "button-secondary", onClick: __classPrivateFieldGet(this, _GxIdeWWFiles_selectAll, "f"), part: "button button--select-all"
374
+ id: "button-select-all", class: "button-secondary", onClick: __classPrivateFieldGet(this, _GxIdeWWFiles_selectAll, "f"), part: "button button--select-all", disabled: this.isLoading
352
375
  }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").footer.btnSelectAll), h("button", {
353
376
  // new file button
354
- id: "button-new-file", class: "button-primary button-icon-and-text", onClick: __classPrivateFieldGet(this, _GxIdeWWFiles_newFileCallbackHandle, "f"), part: "button button--new-file"
377
+ id: "button-new-file", class: "button-primary button-icon-and-text", onClick: __classPrivateFieldGet(this, _GxIdeWWFiles_newFileCallbackHandler, "f"), part: "button button--new-file", disabled: this.isLoading
355
378
  }, __classPrivateFieldGet(this, _GxIdeWWFiles_componentLocale, "f").footer.btnNew))))));
356
379
  }
357
380
  static get assetsDirs() { return ["gx-ide-assets/ww-files"]; }
358
381
  get el() { return getElement(this); }
359
382
  static get watchers() { return {
383
+ "dateTimeValue": ["dateTimeValueChanged"],
360
384
  "categories": ["categoriesChanged"]
361
385
  }; }
362
386
  };
363
- _GxIdeWWFiles_componentLocale = new WeakMap(), _GxIdeWWFiles_ACCORDION_FILTER_ID = new WeakMap(), _GxIdeWWFiles_ACCORDION_MODEL = new WeakMap(), _GxIdeWWFiles_chGridEl = new WeakMap(), _GxIdeWWFiles_filterAfterTypeEl = new WeakMap(), _GxIdeWWFiles_filterAllDescendantsEl = new WeakMap(), _GxIdeWWFiles_filterCategoryEl = new WeakMap(), _GxIdeWWFiles_filterModifiedDateEl = new WeakMap(), _GxIdeWWFiles_filterModuleEl = new WeakMap(), _GxIdeWWFiles_filterModifiedEl = new WeakMap(), _GxIdeWWFiles_filterNameEl = new WeakMap(), _GxIdeWWFiles_filterSearchContentsEl = new WeakMap(), _GxIdeWWFiles_filterUserEl = new WeakMap(), _GxIdeWWFiles_renderHeader = new WeakMap(), _GxIdeWWFiles_renderObjects = new WeakMap(), _GxIdeWWFiles_hiChar = new WeakMap(), _GxIdeWWFiles_formatDate = new WeakMap(), _GxIdeWWFiles_getObjects = new WeakMap(), _GxIdeWWFiles_filterFiles = new WeakMap(), _GxIdeWWFiles_handleFilterInput = new WeakMap(), _GxIdeWWFiles_handleSearchContentsInput = new WeakMap(), _GxIdeWWFiles_deleteSelectionCallbackHandle = new WeakMap(), _GxIdeWWFiles_deselectAll = new WeakMap(), _GxIdeWWFiles_expandedHandler = new WeakMap(), _GxIdeWWFiles_filterModifiedCallbackHandle = new WeakMap(), _GxIdeWWFiles_filterAfterTypeCallbackHandle = new WeakMap(), _GxIdeWWFiles_listenChanges = new WeakMap(), _GxIdeWWFiles_newFileCallbackHandle = new WeakMap(), _GxIdeWWFiles_openSelectionCallbackHandle = new WeakMap(), _GxIdeWWFiles_selectAll = new WeakMap();
387
+ _GxIdeWWFiles_componentLocale = new WeakMap(), _GxIdeWWFiles_ACCORDION_MODEL = new WeakMap(), _GxIdeWWFiles_nameValue = new WeakMap(), _GxIdeWWFiles_moduleValue = new WeakMap(), _GxIdeWWFiles_searchContentsValue = new WeakMap(), _GxIdeWWFiles_categoryValue = new WeakMap(), _GxIdeWWFiles_allDescendants = new WeakMap(), _GxIdeWWFiles_userValue = new WeakMap(), _GxIdeWWFiles_selectedObjectsIds = new WeakMap(), _GxIdeWWFiles_chGridEl = new WeakMap(), _GxIdeWWFiles_filterModuleEl = new WeakMap(), _GxIdeWWFiles_setFilterDefaultValues = new WeakMap(), _GxIdeWWFiles_allDescendantsCheckboxHandler = new WeakMap(), _GxIdeWWFiles_attachGridListeners = new WeakMap(), _GxIdeWWFiles_categoryInputHandler = new WeakMap(), _GxIdeWWFiles_clearDateTimeValue = new WeakMap(), _GxIdeWWFiles_dateTimeInputHandler = new WeakMap(), _GxIdeWWFiles_deleteSelectionCallbackHandler = new WeakMap(), _GxIdeWWFiles_deselectAll = new WeakMap(), _GxIdeWWFiles_evaluateModifiedDates = new WeakMap(), _GxIdeWWFiles_filterAfterTypeCallbackHandler = new WeakMap(), _GxIdeWWFiles_formatDate = new WeakMap(), _GxIdeWWFiles_getObjects = new WeakMap(), _GxIdeWWFiles_renderHeader = new WeakMap(), _GxIdeWWFiles_renderObjects = new WeakMap(), _GxIdeWWFiles_moduleValueChangedHandler = new WeakMap(), _GxIdeWWFiles_nameInputHandler = new WeakMap(), _GxIdeWWFiles_newFileCallbackHandler = new WeakMap(), _GxIdeWWFiles_openSelectionCallbackHandler = new WeakMap(), _GxIdeWWFiles_searchContentsInputHandler = new WeakMap(), _GxIdeWWFiles_setLoadingState = new WeakMap(), _GxIdeWWFiles_userInputHandler = new WeakMap(), _GxIdeWWFiles_showModifiedCheckboxHandler = new WeakMap(), _GxIdeWWFiles_selectAll = new WeakMap();
364
388
  GxIdeWWFiles.style = wwFilesCss;
365
389
 
366
390
  export { GxIdeWWFiles as gx_ide_ww_files };