@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-52057.0 → 0.0.0-bugfix-dev-59880.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/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +86 -0
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +36 -4
- package/dist/cjs/ez-form.cjs.entry.js +51 -2
- package/dist/cjs/ez-grid.cjs.entry.js +322 -19
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -2
- package/dist/cjs/ez-search.cjs.entry.js +6 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
- package/dist/collection/components/ez-button/ez-button.css +7 -0
- package/dist/collection/components/ez-button/ez-button.js +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +1 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +245 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +92 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +62 -4
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +206 -2
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.css +6 -2
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +12 -1
- package/dist/collection/components/ez-search/ez-search.js +5 -2
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +539 -44
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -0
- package/dist/esm/ez-alert-list.entry.js +6 -4
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-collapsible-box.entry.js +1 -0
- package/dist/esm/ez-combo-box.entry.js +1 -0
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +88 -3
- package/dist/esm/ez-date-input.entry.js +1 -0
- package/dist/esm/ez-form-view.entry.js +36 -4
- package/dist/esm/ez-form.entry.js +51 -2
- package/dist/esm/ez-grid.entry.js +322 -19
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +2 -2
- package/dist/esm/ez-number-input.entry.js +9 -2
- package/dist/esm/ez-search.entry.js +6 -2
- package/dist/esm/ez-split-item.entry.js +2 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-09de35a2.entry.js +1 -0
- package/dist/ezui/p-13d2fe2d.entry.js +1 -0
- package/dist/ezui/{p-384247cd.entry.js → p-1f96ba9a.entry.js} +2 -2
- package/dist/ezui/p-204b1439.entry.js +1 -0
- package/dist/ezui/p-2b8da3a4.entry.js +1 -0
- package/dist/ezui/p-30775e7f.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/{p-2a1a0e04.entry.js → p-77362d3a.entry.js} +1 -1
- package/dist/ezui/{p-8defa6d3.entry.js → p-786559c5.entry.js} +1 -1
- package/dist/ezui/p-7922142b.entry.js +1 -0
- package/dist/ezui/p-84e439b9.entry.js +1 -0
- package/dist/ezui/p-922ac38b.entry.js +1 -0
- package/dist/ezui/p-bae4e180.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-c942e4a7.entry.js +1 -0
- package/dist/ezui/p-e90dd4eb.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +41 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +29 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +30 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
- package/dist/types/components.d.ts +120 -4
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-44c5b6a5.entry.js +0 -1
- package/dist/ezui/p-5ef056ce.entry.js +0 -1
- package/dist/ezui/p-86ff298d.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
- package/dist/ezui/p-9f1e89c9.entry.js +0 -1
- package/dist/ezui/p-b041333c.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.CustomEditorSource = void 0;
|
|
4
|
+
(function (CustomEditorSource) {
|
|
5
|
+
CustomEditorSource["GRID"] = "GRID";
|
|
6
|
+
CustomEditorSource["FORM"] = "FORM";
|
|
7
|
+
})(exports.CustomEditorSource || (exports.CustomEditorSource = {}));
|
|
8
|
+
|
|
9
|
+
exports.CustomRenderSource = void 0;
|
|
10
|
+
(function (CustomRenderSource) {
|
|
11
|
+
CustomRenderSource["GRID"] = "GRID";
|
|
12
|
+
CustomRenderSource["FORM"] = "FORM";
|
|
13
|
+
})(exports.CustomRenderSource || (exports.CustomRenderSource = {}));
|
|
@@ -8,6 +8,7 @@ require('./ApplicationUtils-c9d1205c.js');
|
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
9
9
|
require('./DialogType-2114c337.js');
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
|
+
require('./ICustomRender-6fafffce.js');
|
|
11
12
|
|
|
12
13
|
const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__actions-list--z-index:var(--ez-elevation--8, 8);--ez-actions-button__actions-max-height:415px;--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;overflow-y:auto;scrollbar-width:thin;z-index:var(--ez-actions-button__actions-list--z-index);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--max-height{max-height:var(--ez-actions-button__actions-max-height)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;z-index:calc(var(--ez-actions-button__actions-list--z-index) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 2px) * -1)}.ez-actions-button__arrow--small{margin-left:6px}.ez-actions-button__arrow--medium{margin-left:11px}.ez-actions-button__arrow--large{margin-left:13px}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}.ez-actions-button--bottom-padding{padding-bottom:var(--space--small, 6px)}";
|
|
13
14
|
|
|
@@ -40,10 +40,12 @@ const EzAlertList = class {
|
|
|
40
40
|
/**
|
|
41
41
|
* Retorna o link para o titulo do alerta a partir do id.
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
getLinkActionClick(item) {
|
|
44
44
|
var _a;
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const action = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.onClickLink;
|
|
46
|
+
if (action)
|
|
47
|
+
return action;
|
|
48
|
+
return () => { };
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
49
51
|
* Retorna o texto do título do alerta.
|
|
@@ -135,7 +137,7 @@ const EzAlertList = class {
|
|
|
135
137
|
(index.h("div", { ref: elem => (this._overlayRef = elem) }, index.h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, index.h("div", { class: "alert-list__content" }, index.h("div", { class: "alert-list__header" }, index.h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), index.h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (index.h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": core.ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), index.h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": core.ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
|
|
136
138
|
this.opened = false;
|
|
137
139
|
}, title: 'Fechar' }))), index.h("div", { class: "alert-list__expandable-content" }, index.h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
|
|
138
|
-
return (index.h("a", {
|
|
140
|
+
return (index.h("a", { onClick: this.getLinkActionClick(item), style: {
|
|
139
141
|
fontFamily: "var(--font-pattern, 'Roboto')",
|
|
140
142
|
fontSize: 'var(--text--medium, 14px)',
|
|
141
143
|
fontWeight: 'var(--text-weight--medium, 400)',
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
|
|
8
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link-disabled-color:var(--color--disable-primary, '#e5eaf0');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
|
|
9
9
|
|
|
10
10
|
const EzButton = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -74,7 +74,7 @@ const EzButton = class {
|
|
|
74
74
|
return (index.h("div", { class: "label-icon" }, index.h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize() })), index.h("label", { title: this.label }, this.label)));
|
|
75
75
|
}
|
|
76
76
|
else if (this.mode == "link") {
|
|
77
|
-
return (index.h("a", { class: this.getIconSize()
|
|
77
|
+
return (index.h("a", { class: `${this.getIconSize()} ${!this.enabled ? "disabled" : ""}`, ref: (el) => this._button = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
80
|
return (index.h("button", { class: this.getIconSize(""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
@@ -7,6 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
|
|
8
8
|
require('./DialogType-2114c337.js');
|
|
9
9
|
require('./CheckMode-ecb90b87.js');
|
|
10
|
+
require('./ICustomRender-6fafffce.js');
|
|
10
11
|
|
|
11
12
|
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--subtitle--font-size:var(--text--medium, 14px);--ez-collapsible-box--subtitle--font-family:var(--font-pattern, 'Roboto');--ez-collapsible-box--subtitle--font-weight:var(--text-weight--medium, 400);--ez-collapsible-box--subtitle--color:var(--text--primary);--ez-collapsible-box--subtitle--margin-bottom:var(--space--medium, 12px);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsable-box--bordered{border:var(--border--small);border-color:var(--color--strokes);border-radius:var(--border--radius-medium);padding:var(--space--xs)}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.subtitle-box__label{display:flex;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;font-family:var(--ez-collapsible-box--subtitle--font-family);font-size:var(--ez-collapsible-box--subtitle--font-size);font-weight:var(--ez-collapsible-box--subtitle--font-weight);color:var(--ez-collapsible-box--subtitle--color);margin-bottom:var(--ez-collapsible-box--subtitle--margin-bottom)}.subtitle-box__content{width:100%}.collapsible-box__label ez-icon{visibility:hidden;transition:2s all ease-in-out}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--left{margin-right:auto}.collapsible-box__title--right{margin-left:auto}.collapsible-box__title--center{margin-left:auto;margin-right:auto}.collapsible-box__title--stretch{justify-content:space-between;width:100%}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
|
|
12
13
|
|
|
@@ -8,6 +8,7 @@ require('./ApplicationUtils-c9d1205c.js');
|
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-10c9d5b4.js');
|
|
9
9
|
require('./DialogType-2114c337.js');
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
|
+
require('./ICustomRender-6fafffce.js');
|
|
11
12
|
|
|
12
13
|
const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box__list-min-width:64px;--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-combo-box__list-min-width);position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
13
14
|
|
|
@@ -3,11 +3,96 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
|
+
const ICustomRender = require('./ICustomRender-6fafffce.js');
|
|
6
7
|
const core = require('@sankhyalabs/core');
|
|
7
8
|
const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
|
|
8
9
|
require('./DialogType-2114c337.js');
|
|
9
10
|
require('./CheckMode-ecb90b87.js');
|
|
10
11
|
|
|
12
|
+
const EzCustomFormInput = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
this.gui = undefined;
|
|
16
|
+
this.customEditor = undefined;
|
|
17
|
+
this.formViewField = undefined;
|
|
18
|
+
this.value = undefined;
|
|
19
|
+
this.detailContext = undefined;
|
|
20
|
+
this.builderFallback = undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Aplica foco no campo.
|
|
24
|
+
*/
|
|
25
|
+
async setFocus() {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
(_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Remove o foco do campo.
|
|
31
|
+
*/
|
|
32
|
+
async setBlur() {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
(_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setBlur"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retorna se o conteúdo é inválido.
|
|
38
|
+
*/
|
|
39
|
+
async isInvalid() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return ((_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["isInvalid"]) === null || _b === void 0 ? void 0 : _b.call(_a)) || false;
|
|
42
|
+
}
|
|
43
|
+
getContent() {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
const fieldProps = new Map();
|
|
46
|
+
for (const prop in this.formViewField.props) {
|
|
47
|
+
fieldProps.set(prop, this.formViewField.props[prop]);
|
|
48
|
+
}
|
|
49
|
+
const params = {
|
|
50
|
+
value: this.value,
|
|
51
|
+
name: this.formViewField.name,
|
|
52
|
+
currentEditor: this.builderFallback(this.formViewField),
|
|
53
|
+
editorMetadata: {
|
|
54
|
+
label: this.formViewField.label,
|
|
55
|
+
hidden: ((_a = this.formViewField.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
56
|
+
userInterface: this.formViewField.userInterface,
|
|
57
|
+
options: (_b = this.formViewField.props) === null || _b === void 0 ? void 0 : _b.options,
|
|
58
|
+
props: this.formViewField.props ? fieldProps : undefined,
|
|
59
|
+
optionLoader: this.formViewField.optionLoader
|
|
60
|
+
},
|
|
61
|
+
source: ICustomRender.CustomEditorSource.FORM,
|
|
62
|
+
detailContext: this.detailContext
|
|
63
|
+
};
|
|
64
|
+
let gui = this.customEditor.getEditorElement(params);
|
|
65
|
+
if (!gui) {
|
|
66
|
+
gui = this.builderFallback(this.formViewField);
|
|
67
|
+
this.handleValue(gui);
|
|
68
|
+
this.gui = gui;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (!(gui instanceof HTMLElement) && typeof gui !== 'string') {
|
|
72
|
+
this.handleValue(gui);
|
|
73
|
+
this.gui = gui;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (typeof gui === 'string') {
|
|
77
|
+
gui = core.HTMLBuilder.parseElement(gui);
|
|
78
|
+
}
|
|
79
|
+
gui.setAttribute('value', this.value);
|
|
80
|
+
this.gui = index.h("div", { key: core.StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
81
|
+
}
|
|
82
|
+
handleValue(gui) {
|
|
83
|
+
//@ts-ignore
|
|
84
|
+
gui.$children$.forEach((child) => {
|
|
85
|
+
child.$attrs$.value = this.value;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
componentWillRender() {
|
|
89
|
+
this.getContent();
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return (index.h(index.Host, null, this.gui));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
11
96
|
const ezTextEditCss = ":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";
|
|
12
97
|
|
|
13
98
|
const EzTextEdit = class {
|
|
@@ -104,4 +189,5 @@ const EzTextEdit = class {
|
|
|
104
189
|
};
|
|
105
190
|
EzTextEdit.style = ezTextEditCss;
|
|
106
191
|
|
|
192
|
+
exports.ez_custom_form_input = EzCustomFormInput;
|
|
107
193
|
exports.ez_text_edit = EzTextEdit;
|
|
@@ -59,8 +59,9 @@ const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
const buildDecimal = ({ name, label, readOnly, props, contextName, canShowError }) => {
|
|
62
|
-
|
|
63
|
-
const
|
|
62
|
+
var _a, _b;
|
|
63
|
+
const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
|
|
64
|
+
const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
|
|
64
65
|
return buildNumeric(name, label, readOnly, precision, prettyPrecision, contextName, canShowError);
|
|
65
66
|
};
|
|
66
67
|
const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
@@ -149,11 +150,35 @@ const EzFormView = class {
|
|
|
149
150
|
index.registerInstance(this, hostRef);
|
|
150
151
|
this.ezContentReady = index.createEvent(this, "ezContentReady", 7);
|
|
151
152
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
153
|
+
this._customEditors = new Map();
|
|
152
154
|
this.fields = undefined;
|
|
153
155
|
}
|
|
154
156
|
async showUp() {
|
|
155
157
|
this._element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
156
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
161
|
+
*/
|
|
162
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
163
|
+
const newCustomEditors = new Map(this._customEditors);
|
|
164
|
+
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
|
165
|
+
this._customEditors = newCustomEditors;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Altera/adiciona uma propriedade nos metados do campo.
|
|
169
|
+
*/
|
|
170
|
+
async setFieldProp(fieldName, propName, value) {
|
|
171
|
+
const fields = this.fields.map(field => {
|
|
172
|
+
if (field.name === fieldName) {
|
|
173
|
+
field.props = field.props || {};
|
|
174
|
+
if (value || value === 0) {
|
|
175
|
+
field.props[propName] = value;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return field;
|
|
179
|
+
});
|
|
180
|
+
this.fields = [...fields];
|
|
181
|
+
}
|
|
157
182
|
groupFields(fields) {
|
|
158
183
|
const result = new Map();
|
|
159
184
|
fields.forEach(item => {
|
|
@@ -173,8 +198,9 @@ const EzFormView = class {
|
|
|
173
198
|
return result;
|
|
174
199
|
}
|
|
175
200
|
componentDidRender() {
|
|
176
|
-
this.
|
|
177
|
-
|
|
201
|
+
this._formElements = Array.from(this._element.querySelectorAll("[data-field-name]"));
|
|
202
|
+
this.ezContentReady.emit(this._formElements);
|
|
203
|
+
const formItems = new FormItems(this._formElements);
|
|
178
204
|
this.formItemsReady.emit(formItems);
|
|
179
205
|
}
|
|
180
206
|
isItemFullWidth(userInterface) {
|
|
@@ -184,9 +210,15 @@ const EzFormView = class {
|
|
|
184
210
|
].includes(userInterface);
|
|
185
211
|
}
|
|
186
212
|
buildFormItemElement(item, classItem = "") {
|
|
213
|
+
var _a;
|
|
187
214
|
if (this.isItemFullWidth(item.userInterface)) {
|
|
188
215
|
classItem += " input-full_width";
|
|
189
216
|
}
|
|
217
|
+
if (this._customEditors.has(item.name)) {
|
|
218
|
+
const value = (_a = this._formElements.map(el => ({ name: el.dataset.fieldName, value: el['value'] })).find(field => field.name === item.name)) === null || _a === void 0 ? void 0 : _a.value;
|
|
219
|
+
const customEditor = this._customEditors.get(item.name).customEditor;
|
|
220
|
+
return index.h("div", { class: classItem }, index.h("ez-custom-form-input", { "data-field-name": item.name, customEditor: customEditor, formViewField: item, builderFallback: fieldBuilder, value: value }));
|
|
221
|
+
}
|
|
190
222
|
return index.h("div", { class: classItem }, fieldBuilder(item));
|
|
191
223
|
}
|
|
192
224
|
render() {
|
|
@@ -849,15 +849,18 @@ const EzForm = class {
|
|
|
849
849
|
this.ezFormSetFields = index.createEvent(this, "ezFormSetFields", 7);
|
|
850
850
|
this.ezReady = index.createEvent(this, "ezReady", 7);
|
|
851
851
|
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
852
|
+
this._customEditors = new Map();
|
|
852
853
|
this.onDataUnitAction = (action) => {
|
|
853
854
|
if (action.type === core.Action.METADATA_LOADED) {
|
|
854
855
|
this.processMetadata();
|
|
855
856
|
}
|
|
856
857
|
};
|
|
858
|
+
this._fieldsProps = new Map();
|
|
857
859
|
this.dataUnit = undefined;
|
|
858
860
|
this.config = undefined;
|
|
859
861
|
this.recordsValidator = undefined;
|
|
860
862
|
this.fieldToFocus = undefined;
|
|
863
|
+
this.onlyStaticFields = false;
|
|
861
864
|
}
|
|
862
865
|
/**
|
|
863
866
|
* Realiza validação no conteúdo de todos os campos.
|
|
@@ -865,9 +868,30 @@ const EzForm = class {
|
|
|
865
868
|
validate() {
|
|
866
869
|
return this._dataBinder.validate();
|
|
867
870
|
}
|
|
871
|
+
/**
|
|
872
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
873
|
+
*/
|
|
874
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
875
|
+
if (this._formView) {
|
|
876
|
+
this._formView.addCustomEditor(fieldName, customEditor, detailContext);
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
const newCustomEditors = new Map(this._customEditors);
|
|
880
|
+
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
|
881
|
+
this._customEditors = newCustomEditors;
|
|
882
|
+
}
|
|
868
883
|
observeConfig() {
|
|
869
884
|
this.processMetadata();
|
|
870
885
|
}
|
|
886
|
+
/**
|
|
887
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
888
|
+
*/
|
|
889
|
+
async setFieldProp(fieldName, propName, value) {
|
|
890
|
+
const newCustomFieldProps = new Map(this._fieldsProps);
|
|
891
|
+
const currentProps = this._fieldsProps.get(fieldName);
|
|
892
|
+
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
893
|
+
this._fieldsProps = newCustomFieldProps;
|
|
894
|
+
}
|
|
871
895
|
getDynamicContent() {
|
|
872
896
|
var _a;
|
|
873
897
|
const formMD = selectFormMetadata(this._store.getState());
|
|
@@ -894,10 +918,10 @@ const EzForm = class {
|
|
|
894
918
|
}
|
|
895
919
|
this.ezFormSetFields.emit(fields);
|
|
896
920
|
const idFormSheet = `${core.StringUtils.replaceAccentuatedChars(core.StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
|
|
897
|
-
return (index.h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, index.h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
921
|
+
return (index.h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, index.h("ez-form-view", { ref: (element) => (this._formView = element), class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
898
922
|
}
|
|
899
923
|
processMetadata() {
|
|
900
|
-
if (
|
|
924
|
+
if (this.bindFields() && this.dataUnit && this._store) {
|
|
901
925
|
const metadata = buildFormMetadata(this.config, this.dataUnit);
|
|
902
926
|
this._store.dispatch(loadMetadata(metadata));
|
|
903
927
|
}
|
|
@@ -906,6 +930,9 @@ const EzForm = class {
|
|
|
906
930
|
var _a;
|
|
907
931
|
return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
908
932
|
}
|
|
933
|
+
bindFields() {
|
|
934
|
+
return !this.isStatic() || this.onlyStaticFields === false;
|
|
935
|
+
}
|
|
909
936
|
componentWillLoad() {
|
|
910
937
|
if (this.dataUnit === undefined) {
|
|
911
938
|
this.dataUnit = new core.DataUnit("ez-form");
|
|
@@ -925,6 +952,17 @@ const EzForm = class {
|
|
|
925
952
|
this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
|
|
926
953
|
this.ezReady.emit();
|
|
927
954
|
this.handleFieldToFocus();
|
|
955
|
+
this.setCustomEditors();
|
|
956
|
+
this.setFieldsProps();
|
|
957
|
+
}
|
|
958
|
+
setCustomEditors() {
|
|
959
|
+
if (!this._formView) {
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
for (const [fieldName, customEditorProps] of this._customEditors) {
|
|
963
|
+
this._formView.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
|
|
964
|
+
this._customEditors.delete(fieldName);
|
|
965
|
+
}
|
|
928
966
|
}
|
|
929
967
|
handleFieldToFocus() {
|
|
930
968
|
var _a;
|
|
@@ -941,6 +979,17 @@ const EzForm = class {
|
|
|
941
979
|
this.ezFormRequestClearFieldToFocus.emit();
|
|
942
980
|
});
|
|
943
981
|
}
|
|
982
|
+
setFieldsProps() {
|
|
983
|
+
if (!this._formView) {
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
for (const [fieldName, props] of this._fieldsProps) {
|
|
987
|
+
for (const prop in props) {
|
|
988
|
+
this._formView.setFieldProp(fieldName, prop, props[prop]);
|
|
989
|
+
}
|
|
990
|
+
this._fieldsProps.delete(fieldName);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
944
993
|
disconnectedCallback() {
|
|
945
994
|
this.dataUnit.unsubscribe(this.onDataUnitAction);
|
|
946
995
|
this._dataBinder.onDisconnectedCallback();
|