@sankhyalabs/ezui 3.6.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +12 -2
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +16 -10
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -12
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input_4.cjs.entry.js +67 -6
- package/dist/cjs/ez-form-view.cjs.entry.js +30 -23
- package/dist/cjs/ez-form.cjs.entry.js +562 -545
- package/dist/cjs/ez-grid.cjs.entry.js +8 -5
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +51 -3
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-b54f47a1.js → index-892780f1.js} +0 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js +12 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +16 -10
- package/dist/collection/components/ez-date-input/ez-date-input.js +1 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +3 -11
- package/dist/collection/components/ez-form/ez-form.css +0 -6
- package/dist/collection/components/ez-form/ez-form.js +18 -239
- package/dist/collection/components/ez-form-view/ez-form-view.js +51 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +4 -4
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +6 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +5 -2
- package/dist/collection/components/ez-grid/ez-grid.css +4 -2
- package/dist/collection/components/ez-grid/ez-grid.js +1 -1
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css +1 -1
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js +218 -1
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +2 -0
- package/dist/collection/components/ez-tree/ez-tree.js +151 -3
- package/dist/collection/components/ez-tree/types/Node.js +7 -1
- package/dist/collection/components/ez-tree/types/Tree.js +6 -0
- package/dist/collection/{components/ez-form → utils/form}/DataBinder.js +118 -4
- package/dist/collection/{components/ez-form → utils/form}/FormMetadata.js +83 -36
- package/dist/collection/utils/form/index.js +2 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.js +701 -557
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +13 -3
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +17 -11
- package/dist/esm/ez-date-input.entry.js +2 -2
- package/dist/esm/ez-date-time-input.entry.js +4 -12
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input_4.entry.js +67 -6
- package/dist/esm/ez-form-view.entry.js +30 -23
- package/dist/esm/ez-form.entry.js +563 -546
- package/dist/esm/ez-grid.entry.js +8 -5
- package/dist/esm/ez-guide-navigator.entry.js +51 -3
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-edit.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/{index-c27164d3.js → index-de655f48.js} +0 -5
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-85c1e00f.entry.js → p-06b3e801.entry.js} +1 -1
- package/dist/ezui/{p-216e1153.entry.js → p-07b99b94.entry.js} +1 -1
- package/dist/ezui/p-09271677.entry.js +1 -0
- package/dist/ezui/{p-044a3427.entry.js → p-0c7e81fe.entry.js} +1 -1
- package/dist/ezui/p-0e53898b.entry.js +1 -0
- package/dist/ezui/{p-124859c3.entry.js → p-36f7ec68.entry.js} +1 -1
- package/dist/ezui/p-4555df8f.entry.js +1 -0
- package/dist/ezui/{p-1806b3c6.entry.js → p-493e2af4.entry.js} +1 -1
- package/dist/ezui/p-50883460.entry.js +1 -0
- package/dist/ezui/p-581df847.entry.js +1 -0
- package/dist/ezui/{p-78b28632.entry.js → p-600f1732.entry.js} +1 -1
- package/dist/ezui/{p-74379544.entry.js → p-622c2d53.entry.js} +1 -1
- package/dist/ezui/{p-bb011a51.entry.js → p-62481744.entry.js} +1 -1
- package/dist/ezui/{p-064e558f.entry.js → p-6818dd0a.entry.js} +1 -1
- package/dist/ezui/{p-e8271a0e.entry.js → p-695facd0.entry.js} +1 -1
- package/dist/ezui/p-6cf406ff.entry.js +1 -0
- package/dist/ezui/{p-07d71b7a.entry.js → p-7147d43a.entry.js} +1 -1
- package/dist/ezui/{p-108acc0f.entry.js → p-7c8fb43e.entry.js} +1 -1
- package/dist/ezui/{p-00ea9b50.js → p-7ffd12e7.js} +2 -2
- package/dist/ezui/{p-aaba630e.entry.js → p-86d29565.entry.js} +1 -1
- package/dist/ezui/{p-f978bebc.entry.js → p-8d5ec02b.entry.js} +1 -1
- package/dist/ezui/{p-149442dd.entry.js → p-9613fae6.entry.js} +1 -1
- package/dist/ezui/{p-38520b9c.entry.js → p-99d822cc.entry.js} +1 -1
- package/dist/ezui/p-9a1549c2.entry.js +1 -0
- package/dist/ezui/{p-330aef41.entry.js → p-a323b415.entry.js} +1 -1
- package/dist/ezui/{p-7ff5d0cc.entry.js → p-a4b281ca.entry.js} +1 -1
- package/dist/ezui/{p-e6cf82e8.entry.js → p-a67e056f.entry.js} +1 -1
- package/dist/ezui/p-ada6e6b0.entry.js +1 -0
- package/dist/ezui/{p-93c8bdc6.entry.js → p-b3c7b243.entry.js} +1 -1
- package/dist/ezui/{p-936ae3ac.entry.js → p-b941aeee.entry.js} +1 -1
- package/dist/ezui/{p-d015295f.entry.js → p-bbccda3f.entry.js} +1 -1
- package/dist/ezui/{p-66dba09c.entry.js → p-c0184982.entry.js} +1 -1
- package/dist/ezui/{p-ce1408dd.entry.js → p-cc40fcb3.entry.js} +1 -1
- package/dist/ezui/{p-80f79b1c.entry.js → p-cc5cfcb7.entry.js} +1 -1
- package/dist/ezui/{p-77c1ae43.entry.js → p-dc15b6d1.entry.js} +2 -2
- package/dist/ezui/{p-eae59101.entry.js → p-e6f3d036.entry.js} +1 -1
- package/dist/ezui/p-e748b5d3.entry.js +1 -0
- package/dist/ezui/{p-be4cc43f.entry.js → p-e85f1a6a.entry.js} +1 -1
- package/dist/ezui/{p-1cfae451.entry.js → p-eceb9382.entry.js} +1 -1
- package/dist/ezui/{p-bb0607a6.entry.js → p-fd87638e.entry.js} +1 -1
- package/dist/types/components/ez-breadcrumb/ez-breadcrumb.d.ts +2 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +0 -1
- package/dist/types/components/ez-form/ez-form.d.ts +3 -23
- package/dist/types/components/ez-form/store/form.slice.d.ts +2 -2
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +7 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +2 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/interfaces/IFormViewField.d.ts +1 -0
- package/dist/types/components/ez-guide-navigator/ez-guide-navigator.d.ts +32 -0
- package/dist/types/components/ez-guide-navigator/interfaces/IGuideItem.d.ts +1 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +18 -0
- package/dist/types/components.d.ts +71 -31
- package/dist/types/utils/form/DataBinder.d.ts +31 -0
- package/dist/types/utils/form/FormMetadata.d.ts +23 -0
- package/dist/types/utils/form/index.d.ts +2 -0
- package/dist/types/utils/form/interfaces/IFormCardConfig.d.ts +5 -0
- package/dist/types/utils/form/interfaces/IFormConfig.d.ts +12 -0
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +6 -0
- package/dist/types/{components/ez-form → utils/form}/interfaces/IRecordValidator.d.ts +1 -2
- package/dist/types/utils/form/interfaces/ISummaryField.d.ts +4 -0
- package/dist/types/{interfaces/ez-form → utils/form/interfaces}/ITabConfig.d.ts +1 -0
- package/dist/types/{components/ez-form → utils/form}/interfaces/index.d.ts +6 -4
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -2
- package/dist/collection/interfaces/ez-form/IDefaultConfig.js +0 -1
- package/dist/collection/interfaces/ez-form/IFieldConfig.js +0 -1
- package/dist/collection/interfaces/ez-form/IFieldMetadata.js +0 -1
- package/dist/collection/interfaces/ez-form/IFieldSetMetadata.js +0 -1
- package/dist/collection/interfaces/ez-form/IFormSheetMetadata.js +0 -1
- package/dist/collection/interfaces/ez-form/IInvalidField.js +0 -1
- package/dist/collection/interfaces/ez-form/IRecordValidator.js +0 -1
- package/dist/collection/interfaces/ez-form/IValidationResult.js +0 -1
- package/dist/collection/interfaces/ez-form/index.js +0 -1
- package/dist/ezui/p-1a1c2eda.entry.js +0 -1
- package/dist/ezui/p-51ecf138.entry.js +0 -1
- package/dist/ezui/p-5473e08d.entry.js +0 -1
- package/dist/ezui/p-77d70bae.entry.js +0 -1
- package/dist/ezui/p-90c3d4fd.entry.js +0 -1
- package/dist/ezui/p-97cfbd29.entry.js +0 -1
- package/dist/ezui/p-a0e47238.entry.js +0 -1
- package/dist/ezui/p-bfca509e.entry.js +0 -1
- package/dist/ezui/p-cd1e0679.entry.js +0 -1
- package/dist/types/components/ez-form/DataBinder.d.ts +0 -22
- package/dist/types/components/ez-form/FormMetadata.d.ts +0 -16
- package/dist/types/components/ez-form/interfaces/IFormConfig.d.ts +0 -7
- package/dist/types/components/ez-form/interfaces/IFormSheetMetadata.d.ts +0 -9
- package/dist/types/components/ez-form/interfaces/ITabConfig.d.ts +0 -5
- package/dist/types/interfaces/ez-form/IDefaultConfig.d.ts +0 -5
- package/dist/types/interfaces/ez-form/IFieldConfig.d.ts +0 -13
- package/dist/types/interfaces/ez-form/IFieldMetadata.d.ts +0 -6
- package/dist/types/interfaces/ez-form/IFieldSetMetadata.d.ts +0 -5
- package/dist/types/interfaces/ez-form/IFormConfig.d.ts +0 -7
- package/dist/types/interfaces/ez-form/IFormSheetMetadata.d.ts +0 -10
- package/dist/types/interfaces/ez-form/IInvalidField.d.ts +0 -4
- package/dist/types/interfaces/ez-form/IRecordValidator.d.ts +0 -6
- package/dist/types/interfaces/ez-form/IValidationResult.d.ts +0 -8
- package/dist/types/interfaces/ez-form/index.d.ts +0 -10
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/IDefaultConfig.js +0 -0
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/IFieldConfig.js +0 -0
- /package/dist/collection/{components/ez-form/interfaces/IFormConfig.js → utils/form/interfaces/IFormCardConfig.js} +0 -0
- /package/dist/collection/{interfaces/ez-form → utils/form/interfaces}/IFormConfig.js +0 -0
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/IFormSheetMetadata.js +0 -0
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/IInvalidField.js +0 -0
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/IRecordValidator.js +0 -0
- /package/dist/collection/{components/ez-form/interfaces/ITabConfig.js → utils/form/interfaces/ISummaryField.js} +0 -0
- /package/dist/collection/{interfaces/ez-form → utils/form/interfaces}/ITabConfig.js +0 -0
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/IValidationResult.js +0 -0
- /package/dist/collection/{components/ez-form → utils/form}/interfaces/index.js +0 -0
- /package/dist/types/{components/ez-form → utils/form}/interfaces/IDefaultConfig.d.ts +0 -0
- /package/dist/types/{components/ez-form → utils/form}/interfaces/IFieldConfig.d.ts +0 -0
- /package/dist/types/{components/ez-form → utils/form}/interfaces/IInvalidField.d.ts +0 -0
- /package/dist/types/{components/ez-form → utils/form}/interfaces/IValidationResult.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { CheckMode } from "../../../ez-check/CheckMode";
|
|
3
3
|
export const buildSwitch = (field) => {
|
|
4
|
-
return buildField(field.name, field.label, field.readOnly, true);
|
|
4
|
+
return buildField(field.name, field.label, field.readOnly, field.contextName, true);
|
|
5
5
|
};
|
|
6
6
|
export const buildCheckBox = (field) => {
|
|
7
|
-
return buildField(field.name, field.label, field.readOnly, false);
|
|
7
|
+
return buildField(field.name, field.label, field.readOnly, field.contextName, false);
|
|
8
8
|
};
|
|
9
|
-
function buildField(fieldName, fieldLabel, readOnly, switchMode
|
|
10
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" }, h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
|
|
9
|
+
function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
|
|
10
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" }, h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildComboBox = ({ name, label, readOnly, required, props }) => {
|
|
2
|
+
export const buildComboBox = ({ name, label, readOnly, required, props, contextName }) => {
|
|
3
3
|
const prop = props === null || props === void 0 ? void 0 : props.options;
|
|
4
4
|
let options;
|
|
5
5
|
if (typeof prop === "string") {
|
|
@@ -9,5 +9,5 @@ export const buildComboBox = ({ name, label, readOnly, required, props }) => {
|
|
|
9
9
|
else {
|
|
10
10
|
options = prop;
|
|
11
11
|
}
|
|
12
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
12
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options })));
|
|
13
13
|
};
|
|
@@ -5,6 +5,6 @@ export const buildDate = ({ name, label, readOnly }) => {
|
|
|
5
5
|
export const buildTime = ({ name, label, readOnly }) => {
|
|
6
6
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
7
7
|
};
|
|
8
|
-
export const buildDateTime = ({ name, label, readOnly }) => {
|
|
9
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
8
|
+
export const buildDateTime = ({ name, label, readOnly, contextName }) => {
|
|
9
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildFile = ({ name, label, readOnly }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
2
|
+
export const buildFile = ({ name, label, readOnly, contextName }) => {
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
4
4
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildDecimal = ({ name, label, readOnly, props }) => {
|
|
2
|
+
export const buildDecimal = ({ name, label, readOnly, props, contextName }) => {
|
|
3
3
|
const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
|
|
4
4
|
const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
|
|
5
|
-
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
5
|
+
return buildNumeric(name, label, readOnly, precision, prettyPrecision, contextName);
|
|
6
6
|
};
|
|
7
|
-
export const buildInteger = ({ name, label, readOnly }) => {
|
|
8
|
-
return buildNumeric(name, label, readOnly, 0, 0);
|
|
7
|
+
export const buildInteger = ({ name, label, readOnly, contextName }) => {
|
|
8
|
+
return buildNumeric(name, label, readOnly, 0, 0, contextName);
|
|
9
9
|
};
|
|
10
|
-
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
11
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
10
|
+
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName) {
|
|
11
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildSearch = ({ name, label, readOnly, required }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
2
|
+
export const buildSearch = ({ name, label, readOnly, required, contextName }) => {
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name })));
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildTextArea = ({ name, label, readOnly }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name }, h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
2
|
+
export const buildTextArea = ({ name, label, readOnly, contextName }) => {
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name }, h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName })));
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildTextInput = ({ name, label, readOnly }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
2
|
+
export const buildTextInput = ({ name, label, readOnly, contextName }) => {
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly })));
|
|
4
4
|
};
|
|
@@ -37,6 +37,7 @@ export default class AgGridController {
|
|
|
37
37
|
}
|
|
38
38
|
;
|
|
39
39
|
initDatagrid(container, options) {
|
|
40
|
+
var _a;
|
|
40
41
|
if (this._grid === undefined) {
|
|
41
42
|
LicenseManager.setLicenseKey(ApplicationContext.getContextValue("__EZUI__GRID_LICENSE__"));
|
|
42
43
|
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
@@ -86,8 +87,10 @@ export default class AgGridController {
|
|
|
86
87
|
else {
|
|
87
88
|
this._grid = new Grid(container, this._gridOptions);
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
91
|
+
if (selection) {
|
|
92
|
+
this.selectRows(selection);
|
|
93
|
+
}
|
|
91
94
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
92
95
|
}
|
|
93
96
|
}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
/*public*/
|
|
8
8
|
/*@doc Define a cor de fundo do header do componente.*/
|
|
9
|
-
--ezgrid__header--background-color: var(--background--xlight, #FFF)
|
|
9
|
+
--ezgrid__header--background-color: var(--background--xlight, #FFF);
|
|
10
|
+
/*@doc Define o sombreamento usado como borda.*/
|
|
11
|
+
--ezgrid__container--shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
.grid-header {
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
.grid__container{
|
|
24
|
-
box-shadow:
|
|
26
|
+
box-shadow: var(--ezgrid__container--shadow);
|
|
25
27
|
padding-top: 15px;
|
|
26
28
|
margin-top: -12px;
|
|
27
29
|
|
|
@@ -134,7 +134,7 @@ export class EzGrid {
|
|
|
134
134
|
onSelectionChange: (selection) => this.ezSelectionChange.emit(selection),
|
|
135
135
|
onPaginationChange: (paginationInfo) => {
|
|
136
136
|
var _a;
|
|
137
|
-
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > paginationInfo.currentPage && this._paginationChangedByKeyboard) {
|
|
137
|
+
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
138
138
|
this._gridController.setFocusLastRow();
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
/*@doc Define o espaçamento entre as ações*/
|
|
16
16
|
--ez-guide-navigator--actions-gap: var(--space--medium);
|
|
17
17
|
/*@doc Define a margem vertical do elemento*/
|
|
18
|
-
--ez-guide-navigator--actions-margin: var(--space--
|
|
18
|
+
--ez-guide-navigator--actions-margin: var(--space--large) 0 var(--space--medium);
|
|
19
19
|
/*@doc Define o espaçamento da direita do elemento*/
|
|
20
20
|
--ez-guide-navigator--actions-padding-right: calc(var(--space--medium, 12px) + var(--space--small, 6px));
|
|
21
21
|
}
|
|
@@ -5,6 +5,7 @@ const ENTER_KEY = "Enter";
|
|
|
5
5
|
export class EzGuideNavigator {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.open = true;
|
|
8
|
+
this.selectedId = undefined;
|
|
8
9
|
this.items = [];
|
|
9
10
|
this.tooltipResolver = undefined;
|
|
10
11
|
this.filterText = "";
|
|
@@ -21,6 +22,48 @@ export class EzGuideNavigator {
|
|
|
21
22
|
async enableItem(id) {
|
|
22
23
|
[].concat(id).forEach(item => this._tree.enableItem(item));
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Atualiza um ou mais items
|
|
27
|
+
*/
|
|
28
|
+
async updateItem(item) {
|
|
29
|
+
[].concat(item).forEach(item => this._tree.updateItem(item));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Obtem um item pelo id
|
|
33
|
+
*/
|
|
34
|
+
async getItem(id) {
|
|
35
|
+
return this._tree.getItem(id);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Obtem um array do caminho de itens da seleção atual.
|
|
39
|
+
* @returns Retorna um array do caminho de itens da seleção atual.
|
|
40
|
+
*/
|
|
41
|
+
async getCurrentPath() {
|
|
42
|
+
var _a;
|
|
43
|
+
return (_a = this._tree) === null || _a === void 0 ? void 0 : _a.getCurrentPath();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Seleciona o item desejado pelo ID.
|
|
47
|
+
* @param id - ID do item que receberá a seleção.
|
|
48
|
+
*/
|
|
49
|
+
async selectGuide(id) {
|
|
50
|
+
if (this._tree == undefined || id == undefined) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this._tree.selectItem(id);
|
|
54
|
+
this.getCurrentPath()
|
|
55
|
+
.then((currentPath) => {
|
|
56
|
+
currentPath === null || currentPath === void 0 ? void 0 : currentPath.forEach((item) => {
|
|
57
|
+
this._tree.openItem(item.id);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Obtem o item pai a partir de um id
|
|
63
|
+
*/
|
|
64
|
+
async getParent(id) {
|
|
65
|
+
return this._tree.getParent(id);
|
|
66
|
+
}
|
|
24
67
|
async handleToggleSidebar() {
|
|
25
68
|
this.open = !this.open;
|
|
26
69
|
}
|
|
@@ -29,9 +72,13 @@ export class EzGuideNavigator {
|
|
|
29
72
|
this._tree.applyFilter(this.filterText);
|
|
30
73
|
}
|
|
31
74
|
}
|
|
75
|
+
onFilterChanged(event) {
|
|
76
|
+
this.filterText = event.detail;
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
}
|
|
32
79
|
render() {
|
|
33
80
|
ElementIDUtils.addIDInfoIfNotExists(this._element);
|
|
34
|
-
return (h(Host, null, h("ez-sidebar-button", { class: this.open ? "hidden" : "", onEzClick: this.handleToggleSidebar.bind(this), "aria-controls": "navigator", "aria-expanded": this.open, "data-element-id": ElementIDUtils.getInternalIDInfo("openButton") }), h("aside", { tabIndex: -1, id: "navigator", class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-guide-navigator " + (this.open ? "" : "hidden"), "data-element-id": ElementIDUtils.getInternalIDInfo("sidebar") }, h("div", { role: "search", class: "ez-guide-navigator__actions" }, h("ez-filter-input", { mode: "slim", value: this.filterText, onEzChange: (event) =>
|
|
81
|
+
return (h(Host, null, h("ez-sidebar-button", { class: this.open ? "hidden" : "", onEzClick: this.handleToggleSidebar.bind(this), "aria-controls": "navigator", "aria-expanded": this.open, "data-element-id": ElementIDUtils.getInternalIDInfo("openButton") }), h("aside", { tabIndex: -1, id: "navigator", class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-guide-navigator " + (this.open ? "" : "hidden"), "data-element-id": ElementIDUtils.getInternalIDInfo("sidebar") }, h("div", { role: "search", class: "ez-guide-navigator__actions" }, h("ez-filter-input", { mode: "slim", value: this.filterText, onEzChange: (event) => this.onFilterChanged(event), label: "Buscar guia", "aria-placeholder": "Buscar guia", onKeyUp: this.handleFilterTree.bind(this), "data-element-id": ElementIDUtils.getInternalIDInfo("textinput") }), h("ez-button", { onClick: this.handleToggleSidebar.bind(this), class: "inverted", mode: "icon", size: "small", iconName: "show_menu", title: "Ocultar menu", "aria-label": "Ocultar menu", "aria-controls": "navigator", "data-element-id": ElementIDUtils.getInternalIDInfo("closeButton") })), h("ez-scroller", { direction: EzScrollDirection.VERTICAL, activeShadow: true }, h("ez-tree", { ref: element => (this._tree = element), items: this.items, "data-element-id": ElementIDUtils.getInternalIDInfo("tree"), tooltipResolver: this.tooltipResolver, onEzChange: evt => this.ezSelectionChange.emit(evt.detail), selectedId: this.selectedId })))));
|
|
35
82
|
}
|
|
36
83
|
static get is() { return "ez-guide-navigator"; }
|
|
37
84
|
static get encapsulation() { return "shadow"; }
|
|
@@ -65,6 +112,23 @@ export class EzGuideNavigator {
|
|
|
65
112
|
"reflect": true,
|
|
66
113
|
"defaultValue": "true"
|
|
67
114
|
},
|
|
115
|
+
"selectedId": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"mutable": true,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "string",
|
|
120
|
+
"resolved": "string",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": "Define o id do item selecionado."
|
|
128
|
+
},
|
|
129
|
+
"attribute": "selected-id",
|
|
130
|
+
"reflect": true
|
|
131
|
+
},
|
|
68
132
|
"items": {
|
|
69
133
|
"type": "unknown",
|
|
70
134
|
"mutable": false,
|
|
@@ -116,6 +180,29 @@ export class EzGuideNavigator {
|
|
|
116
180
|
"filterText": {}
|
|
117
181
|
};
|
|
118
182
|
}
|
|
183
|
+
static get events() {
|
|
184
|
+
return [{
|
|
185
|
+
"method": "ezSelectionChange",
|
|
186
|
+
"name": "ezSelectionChange",
|
|
187
|
+
"bubbles": true,
|
|
188
|
+
"cancelable": true,
|
|
189
|
+
"composed": true,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "Evento emitido quando o item selecionado no navigator \u00E9 alterado."
|
|
193
|
+
},
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "IGuideItem",
|
|
196
|
+
"resolved": "IGuideItem",
|
|
197
|
+
"references": {
|
|
198
|
+
"IGuideItem": {
|
|
199
|
+
"location": "import",
|
|
200
|
+
"path": "./interfaces"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}];
|
|
205
|
+
}
|
|
119
206
|
static get methods() {
|
|
120
207
|
return {
|
|
121
208
|
"disableItem": {
|
|
@@ -161,6 +248,136 @@ export class EzGuideNavigator {
|
|
|
161
248
|
"text": "Habilita um ou mais itens.",
|
|
162
249
|
"tags": []
|
|
163
250
|
}
|
|
251
|
+
},
|
|
252
|
+
"updateItem": {
|
|
253
|
+
"complexType": {
|
|
254
|
+
"signature": "(item: IGuideItem | Array<IGuideItem>) => Promise<void>",
|
|
255
|
+
"parameters": [{
|
|
256
|
+
"tags": [],
|
|
257
|
+
"text": ""
|
|
258
|
+
}],
|
|
259
|
+
"references": {
|
|
260
|
+
"Promise": {
|
|
261
|
+
"location": "global"
|
|
262
|
+
},
|
|
263
|
+
"IGuideItem": {
|
|
264
|
+
"location": "import",
|
|
265
|
+
"path": "./interfaces"
|
|
266
|
+
},
|
|
267
|
+
"Array": {
|
|
268
|
+
"location": "global"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"return": "Promise<void>"
|
|
272
|
+
},
|
|
273
|
+
"docs": {
|
|
274
|
+
"text": "Atualiza um ou mais items",
|
|
275
|
+
"tags": []
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"getItem": {
|
|
279
|
+
"complexType": {
|
|
280
|
+
"signature": "(id: string) => Promise<IGuideItem>",
|
|
281
|
+
"parameters": [{
|
|
282
|
+
"tags": [],
|
|
283
|
+
"text": ""
|
|
284
|
+
}],
|
|
285
|
+
"references": {
|
|
286
|
+
"Promise": {
|
|
287
|
+
"location": "global"
|
|
288
|
+
},
|
|
289
|
+
"IGuideItem": {
|
|
290
|
+
"location": "import",
|
|
291
|
+
"path": "./interfaces"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"return": "Promise<IGuideItem>"
|
|
295
|
+
},
|
|
296
|
+
"docs": {
|
|
297
|
+
"text": "Obtem um item pelo id",
|
|
298
|
+
"tags": []
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"getCurrentPath": {
|
|
302
|
+
"complexType": {
|
|
303
|
+
"signature": "() => Promise<Array<IGuideItem>>",
|
|
304
|
+
"parameters": [],
|
|
305
|
+
"references": {
|
|
306
|
+
"Promise": {
|
|
307
|
+
"location": "global"
|
|
308
|
+
},
|
|
309
|
+
"IGuideItem": {
|
|
310
|
+
"location": "import",
|
|
311
|
+
"path": "./interfaces"
|
|
312
|
+
},
|
|
313
|
+
"Array": {
|
|
314
|
+
"location": "global"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"return": "Promise<IGuideItem[]>"
|
|
318
|
+
},
|
|
319
|
+
"docs": {
|
|
320
|
+
"text": "Obtem um array do caminho de itens da sele\u00E7\u00E3o atual.",
|
|
321
|
+
"tags": [{
|
|
322
|
+
"name": "returns",
|
|
323
|
+
"text": "Retorna um array do caminho de itens da sele\u00E7\u00E3o atual."
|
|
324
|
+
}]
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"selectGuide": {
|
|
328
|
+
"complexType": {
|
|
329
|
+
"signature": "(id: string) => Promise<void>",
|
|
330
|
+
"parameters": [{
|
|
331
|
+
"tags": [{
|
|
332
|
+
"name": "param",
|
|
333
|
+
"text": "id - ID do item que receber\u00E1 a sele\u00E7\u00E3o."
|
|
334
|
+
}],
|
|
335
|
+
"text": "- ID do item que receber\u00E1 a sele\u00E7\u00E3o."
|
|
336
|
+
}],
|
|
337
|
+
"references": {
|
|
338
|
+
"Promise": {
|
|
339
|
+
"location": "global"
|
|
340
|
+
},
|
|
341
|
+
"Array": {
|
|
342
|
+
"location": "global"
|
|
343
|
+
},
|
|
344
|
+
"IGuideItem": {
|
|
345
|
+
"location": "import",
|
|
346
|
+
"path": "./interfaces"
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"return": "Promise<void>"
|
|
350
|
+
},
|
|
351
|
+
"docs": {
|
|
352
|
+
"text": "Seleciona o item desejado pelo ID.",
|
|
353
|
+
"tags": [{
|
|
354
|
+
"name": "param",
|
|
355
|
+
"text": "id - ID do item que receber\u00E1 a sele\u00E7\u00E3o."
|
|
356
|
+
}]
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"getParent": {
|
|
360
|
+
"complexType": {
|
|
361
|
+
"signature": "(id: string) => Promise<IGuideItem>",
|
|
362
|
+
"parameters": [{
|
|
363
|
+
"tags": [],
|
|
364
|
+
"text": ""
|
|
365
|
+
}],
|
|
366
|
+
"references": {
|
|
367
|
+
"Promise": {
|
|
368
|
+
"location": "global"
|
|
369
|
+
},
|
|
370
|
+
"IGuideItem": {
|
|
371
|
+
"location": "import",
|
|
372
|
+
"path": "./interfaces"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"return": "Promise<IGuideItem>"
|
|
376
|
+
},
|
|
377
|
+
"docs": {
|
|
378
|
+
"text": "Obtem o item pai a partir de um id",
|
|
379
|
+
"tags": []
|
|
380
|
+
}
|
|
164
381
|
}
|
|
165
382
|
};
|
|
166
383
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
position: relative;
|
|
2
3
|
|
|
3
4
|
/* dimensão */
|
|
4
5
|
/*@doc Define a largura do span do botão.*/
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
button {
|
|
38
|
+
position: absolute;
|
|
37
39
|
display: flex;
|
|
38
40
|
background: var(--ez-sidebar-button--background-color--xlight);
|
|
39
41
|
border: 0;
|
|
@@ -80,6 +80,55 @@ export class EzTree {
|
|
|
80
80
|
async applyFilter(pattern) {
|
|
81
81
|
this._tree.setFilterPattern(pattern);
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Atualiza um item
|
|
85
|
+
*/
|
|
86
|
+
async updateItem(item) {
|
|
87
|
+
this._tree.updateItem(item);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Obtem um item pelo id
|
|
91
|
+
*/
|
|
92
|
+
async getItem(id) {
|
|
93
|
+
return new Promise(resolve => {
|
|
94
|
+
const node = this._tree.getNode(id);
|
|
95
|
+
resolve(node === null || node === void 0 ? void 0 : node.item);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Obtem um array do caminho de itens da seleção atual.
|
|
100
|
+
* @returns Retorna um array do caminho de itens da seleção atual.
|
|
101
|
+
*/
|
|
102
|
+
async getCurrentPath() {
|
|
103
|
+
var _a, _b, _c;
|
|
104
|
+
const node = (_a = this._tree) === null || _a === void 0 ? void 0 : _a.getNode(this.selectedId);
|
|
105
|
+
if (node == undefined) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const currentPath = [];
|
|
109
|
+
let parentNode;
|
|
110
|
+
let parentItem = (_b = node.parent) === null || _b === void 0 ? void 0 : _b.item;
|
|
111
|
+
currentPath.push(this.getItemPathAttrs(node.item));
|
|
112
|
+
while (parentItem != undefined) {
|
|
113
|
+
currentPath.unshift(this.getItemPathAttrs(parentItem));
|
|
114
|
+
parentNode = this._tree.getNode(parentItem.id);
|
|
115
|
+
parentItem = (_c = parentNode === null || parentNode === void 0 ? void 0 : parentNode.parent) === null || _c === void 0 ? void 0 : _c.item;
|
|
116
|
+
}
|
|
117
|
+
return currentPath;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Obtem o item pai a partir de um id
|
|
121
|
+
*/
|
|
122
|
+
async getParent(id) {
|
|
123
|
+
return new Promise(resolve => {
|
|
124
|
+
var _a;
|
|
125
|
+
const node = this._tree.getNode(id);
|
|
126
|
+
if (node) {
|
|
127
|
+
resolve((_a = node.parent) === null || _a === void 0 ? void 0 : _a.item);
|
|
128
|
+
}
|
|
129
|
+
resolve(undefined);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
83
132
|
observeItems(newValue, oldValue) {
|
|
84
133
|
if (ObjectUtils.objectToString(newValue) !== ObjectUtils.objectToString(oldValue)) {
|
|
85
134
|
this._tree.load(this.items || []);
|
|
@@ -122,6 +171,9 @@ export class EzTree {
|
|
|
122
171
|
event.preventDefault();
|
|
123
172
|
}
|
|
124
173
|
}
|
|
174
|
+
getItemPathAttrs({ id, label }) {
|
|
175
|
+
return { id, label };
|
|
176
|
+
}
|
|
125
177
|
openClose(item) {
|
|
126
178
|
if (item == undefined) {
|
|
127
179
|
return;
|
|
@@ -205,9 +257,6 @@ export class EzTree {
|
|
|
205
257
|
if (node) {
|
|
206
258
|
this.value = node.item;
|
|
207
259
|
}
|
|
208
|
-
else {
|
|
209
|
-
this.selectedId = undefined;
|
|
210
|
-
}
|
|
211
260
|
}
|
|
212
261
|
render() {
|
|
213
262
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezTree');
|
|
@@ -518,6 +567,105 @@ export class EzTree {
|
|
|
518
567
|
"text": "Efetua a sele\u00E7\u00E3o de um item.",
|
|
519
568
|
"tags": []
|
|
520
569
|
}
|
|
570
|
+
},
|
|
571
|
+
"updateItem": {
|
|
572
|
+
"complexType": {
|
|
573
|
+
"signature": "(item: ITreeItem) => Promise<void>",
|
|
574
|
+
"parameters": [{
|
|
575
|
+
"tags": [],
|
|
576
|
+
"text": ""
|
|
577
|
+
}],
|
|
578
|
+
"references": {
|
|
579
|
+
"Promise": {
|
|
580
|
+
"location": "global"
|
|
581
|
+
},
|
|
582
|
+
"ITreeItem": {
|
|
583
|
+
"location": "import",
|
|
584
|
+
"path": "./interfaces/ITreeItem"
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
"return": "Promise<void>"
|
|
588
|
+
},
|
|
589
|
+
"docs": {
|
|
590
|
+
"text": "Atualiza um item",
|
|
591
|
+
"tags": []
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
"getItem": {
|
|
595
|
+
"complexType": {
|
|
596
|
+
"signature": "(id: string) => Promise<ITreeItem>",
|
|
597
|
+
"parameters": [{
|
|
598
|
+
"tags": [],
|
|
599
|
+
"text": ""
|
|
600
|
+
}],
|
|
601
|
+
"references": {
|
|
602
|
+
"Promise": {
|
|
603
|
+
"location": "global"
|
|
604
|
+
},
|
|
605
|
+
"ITreeItem": {
|
|
606
|
+
"location": "import",
|
|
607
|
+
"path": "./interfaces/ITreeItem"
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
"return": "Promise<ITreeItem>"
|
|
611
|
+
},
|
|
612
|
+
"docs": {
|
|
613
|
+
"text": "Obtem um item pelo id",
|
|
614
|
+
"tags": []
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
"getCurrentPath": {
|
|
618
|
+
"complexType": {
|
|
619
|
+
"signature": "() => Promise<Array<ITreeItem>>",
|
|
620
|
+
"parameters": [],
|
|
621
|
+
"references": {
|
|
622
|
+
"Promise": {
|
|
623
|
+
"location": "global"
|
|
624
|
+
},
|
|
625
|
+
"ITreeItem": {
|
|
626
|
+
"location": "import",
|
|
627
|
+
"path": "./interfaces/ITreeItem"
|
|
628
|
+
},
|
|
629
|
+
"Array": {
|
|
630
|
+
"location": "global"
|
|
631
|
+
},
|
|
632
|
+
"Node": {
|
|
633
|
+
"location": "import",
|
|
634
|
+
"path": "./types/Node"
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
"return": "Promise<ITreeItem[]>"
|
|
638
|
+
},
|
|
639
|
+
"docs": {
|
|
640
|
+
"text": "Obtem um array do caminho de itens da sele\u00E7\u00E3o atual.",
|
|
641
|
+
"tags": [{
|
|
642
|
+
"name": "returns",
|
|
643
|
+
"text": "Retorna um array do caminho de itens da sele\u00E7\u00E3o atual."
|
|
644
|
+
}]
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
"getParent": {
|
|
648
|
+
"complexType": {
|
|
649
|
+
"signature": "(id: string) => Promise<ITreeItem>",
|
|
650
|
+
"parameters": [{
|
|
651
|
+
"tags": [],
|
|
652
|
+
"text": ""
|
|
653
|
+
}],
|
|
654
|
+
"references": {
|
|
655
|
+
"Promise": {
|
|
656
|
+
"location": "global"
|
|
657
|
+
},
|
|
658
|
+
"ITreeItem": {
|
|
659
|
+
"location": "import",
|
|
660
|
+
"path": "./interfaces/ITreeItem"
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
"return": "Promise<ITreeItem>"
|
|
664
|
+
},
|
|
665
|
+
"docs": {
|
|
666
|
+
"text": "Obtem o item pai a partir de um id",
|
|
667
|
+
"tags": []
|
|
668
|
+
}
|
|
521
669
|
}
|
|
522
670
|
};
|
|
523
671
|
}
|
|
@@ -81,7 +81,13 @@ export class Node {
|
|
|
81
81
|
return this._isLazyLoad && !this._childrenLoaded;
|
|
82
82
|
}
|
|
83
83
|
isExpandable() {
|
|
84
|
-
|
|
84
|
+
if (this._isLazyLoad) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
if (this.children.size > 0) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
85
91
|
}
|
|
86
92
|
getChildren() {
|
|
87
93
|
if (this.isPlaceHolder) {
|
|
@@ -57,6 +57,12 @@ export class Tree extends Node {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
Object.keys(item).forEach(attrib => node.item[attrib] = item[attrib]);
|
|
60
|
+
if (item.children == undefined) {
|
|
61
|
+
node.children.clear();
|
|
62
|
+
}
|
|
63
|
+
else if (Array.isArray(item.children)) {
|
|
64
|
+
node.updateChildren(item.children);
|
|
65
|
+
}
|
|
60
66
|
this._changeCallback();
|
|
61
67
|
}
|
|
62
68
|
async open(path) {
|