@sankhyalabs/ezui 5.22.0-dev.4 → 5.22.0-dev.41
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/DataBinder-3b083480.js +445 -0
- package/dist/cjs/FocusResolver-885f2173.js +35 -0
- package/dist/cjs/ez-button.cjs.entry.js +11 -5
- package/dist/cjs/ez-card-item_3.cjs.entry.js +21 -6
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.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 +64 -11
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +33 -4
- package/dist/cjs/ez-date-input.cjs.entry.js +12 -3
- package/dist/cjs/ez-date-time-input.cjs.entry.js +9 -3
- package/dist/cjs/ez-dialog.cjs.entry.js +9 -1
- package/dist/cjs/{ez-dropdown.cjs.entry.js → ez-dropdown_2.cjs.entry.js} +75 -8
- package/dist/cjs/ez-form-view.cjs.entry.js +5 -4
- package/dist/cjs/ez-form.cjs.entry.js +4 -324
- package/dist/cjs/ez-grid.cjs.entry.js +14742 -70307
- package/dist/cjs/ez-list.cjs.entry.js +6 -7
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -1
- package/dist/cjs/ez-modal.cjs.entry.js +19 -4
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +13 -1
- package/dist/cjs/ez-popup.cjs.entry.js +21 -2
- package/dist/cjs/ez-scroller_2.cjs.entry.js +3 -3
- package/dist/cjs/ez-search.cjs.entry.js +66 -33
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +67 -5
- package/dist/cjs/ez-text-input.cjs.entry.js +51 -5
- package/dist/cjs/ez-time-input.cjs.entry.js +6 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-9e5554cb.js +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-button/ez-button.css +21 -11
- package/dist/collection/components/ez-button/ez-button.js +12 -6
- package/dist/collection/components/ez-card-item/ez-card-item.css +60 -10
- package/dist/collection/components/ez-card-item/ez-card-item.js +30 -3
- package/dist/collection/components/ez-check/ez-check.css +1 -6
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +109 -13
- package/dist/collection/components/ez-date-input/ez-date-input.css +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +38 -4
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +1 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +35 -4
- package/dist/collection/components/ez-dialog/ez-dialog.js +9 -1
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -8
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +35 -4
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +47 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -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 +238 -55
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +107 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +222 -42
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +16 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +2 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +4 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +2 -0
- package/dist/collection/components/ez-grid/ez-grid.css +17 -7
- package/dist/collection/components/ez-grid/ez-grid.js +181 -7
- package/dist/collection/components/ez-list/ez-list.css +2 -1
- package/dist/collection/components/ez-list/ez-list.js +6 -7
- package/dist/collection/components/ez-modal/ez-modal.css +1 -1
- package/dist/collection/components/ez-modal/ez-modal.js +36 -3
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +49 -1
- package/dist/collection/components/ez-popup/ez-popup.css +5 -1
- package/dist/collection/components/ez-popup/ez-popup.js +38 -1
- package/dist/collection/components/ez-scroller/ez-scroller.css +1 -0
- package/dist/collection/components/ez-search/ez-search.css +21 -10
- package/dist/collection/components/ez-search/ez-search.js +147 -34
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +3 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +3 -1
- package/dist/collection/components/ez-split-button/ez-split-button.css +48 -12
- package/dist/collection/components/ez-split-button/ez-split-button.js +3 -3
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +1 -0
- package/dist/collection/components/ez-text-area/ez-text-area.css +73 -28
- package/dist/collection/components/ez-text-area/ez-text-area.js +103 -3
- package/dist/collection/components/ez-text-input/ez-text-input.css +41 -71
- package/dist/collection/components/ez-text-input/ez-text-input.js +86 -4
- package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
- package/dist/collection/sw.js +46 -0
- package/dist/collection/utils/FocusResolver.js +31 -0
- package/dist/collection/utils/form/DataBinder.js +20 -5
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js +1 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js +7 -1
- package/dist/custom-elements/index.js +15623 -70811
- package/dist/esm/DataBinder-02fa9bb9.js +441 -0
- package/dist/esm/FocusResolver-1ccbf850.js +33 -0
- package/dist/esm/ez-button.entry.js +11 -5
- package/dist/esm/ez-card-item_3.entry.js +21 -6
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +65 -12
- package/dist/esm/ez-custom-form-input_2.entry.js +34 -5
- package/dist/esm/ez-date-input.entry.js +12 -3
- package/dist/esm/ez-date-time-input.entry.js +9 -3
- package/dist/esm/ez-dialog.entry.js +9 -1
- package/dist/esm/{ez-dropdown.entry.js → ez-dropdown_2.entry.js} +75 -9
- package/dist/esm/ez-form-view.entry.js +5 -4
- package/dist/esm/ez-form.entry.js +3 -323
- package/dist/esm/ez-grid.entry.js +14685 -70250
- package/dist/esm/ez-list.entry.js +6 -7
- package/dist/esm/ez-modal-container.entry.js +2 -1
- package/dist/esm/ez-modal.entry.js +19 -4
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +13 -1
- package/dist/esm/ez-popup.entry.js +21 -2
- package/dist/esm/ez-scroller_2.entry.js +3 -3
- package/dist/esm/ez-search.entry.js +66 -33
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +67 -5
- package/dist/esm/ez-text-input.entry.js +51 -5
- package/dist/esm/ez-time-input.entry.js +6 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-5a720e56.js +2 -6
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-076e868b.entry.js +1 -0
- package/dist/ezui/p-0e1cc2d1.entry.js +1 -0
- package/dist/ezui/p-16e21a40.entry.js +1 -0
- package/dist/ezui/p-2de9f0aa.entry.js +1 -0
- package/dist/ezui/p-3b546374.entry.js +1 -0
- package/dist/ezui/p-3cc9b84a.entry.js +1 -0
- package/dist/ezui/p-3d38bfea.entry.js +1 -0
- package/dist/ezui/p-455e737c.js +1 -0
- package/dist/ezui/p-554522db.entry.js +1 -0
- package/dist/ezui/p-57528846.entry.js +1 -0
- package/dist/ezui/p-6bc25bc8.entry.js +1 -0
- package/dist/ezui/p-70f1c812.entry.js +1 -0
- package/dist/ezui/p-7f5afb1f.entry.js +1 -0
- package/dist/ezui/p-802dc63e.entry.js +1 -0
- package/dist/ezui/p-880f73ea.entry.js +309 -0
- package/dist/ezui/p-8f026744.entry.js +1 -0
- package/dist/ezui/p-940760bf.entry.js +1 -0
- package/dist/ezui/p-a4ee2991.entry.js +1 -0
- package/dist/ezui/{p-82ac8b06.entry.js → p-a563df31.entry.js} +1 -1
- package/dist/ezui/p-a921e3e7.entry.js +1 -0
- package/dist/ezui/p-b858fc6e.entry.js +1 -0
- package/dist/ezui/p-be34c77f.entry.js +1 -0
- package/dist/ezui/{p-9aa27e69.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/p-bfc30e61.entry.js +1 -0
- package/dist/ezui/p-bfc59380.entry.js +1 -0
- package/dist/ezui/p-d960a031.entry.js +1 -0
- package/dist/ezui/p-dc628ed3.js +1 -0
- package/dist/ezui/{p-33792b2b.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/p-e3ec7422.entry.js +1 -0
- package/dist/ezui/{p-31674f8e.entry.js → p-e7395eae.entry.js} +1 -1
- package/dist/types/components/ez-button/ez-button.d.ts +2 -1
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +5 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +12 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +6 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +6 -1
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -0
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +4 -0
- package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +1 -1
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +6 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +7 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.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-grid/controller/EzGridController.d.ts +56 -4
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +32 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +23 -1
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +33 -7
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +4 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +27 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +6 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +8 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +7 -0
- package/dist/types/components/ez-search/ez-search.d.ts +23 -2
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +9 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components.d.ts +211 -10
- package/dist/types/utils/FocusResolver.d.ts +5 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +2 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/dist/types/utils/validators/recordvalidator/IInvalidCells.d.ts +5 -0
- package/dist/types/utils/validators/recordvalidator/RecordValidationProcessor.d.ts +1 -1
- package/package.json +12 -4
- package/dist/cjs/RecordValidationProcessor-4c893e04.js +0 -102
- package/dist/cjs/ez-skeleton.cjs.entry.js +0 -67
- package/dist/esm/RecordValidationProcessor-b00b8b77.js +0 -99
- package/dist/esm/ez-skeleton.entry.js +0 -63
- package/dist/ezui/p-034e21ca.entry.js +0 -1
- package/dist/ezui/p-044d46d5.entry.js +0 -1
- package/dist/ezui/p-04f24913.js +0 -1
- package/dist/ezui/p-24ca32a3.entry.js +0 -1
- package/dist/ezui/p-2af4e2de.entry.js +0 -1
- package/dist/ezui/p-36180f4d.entry.js +0 -1
- package/dist/ezui/p-5fefcdc9.entry.js +0 -1
- package/dist/ezui/p-752c4069.entry.js +0 -1
- package/dist/ezui/p-81cffa53.entry.js +0 -1
- package/dist/ezui/p-81f99ace.entry.js +0 -1
- package/dist/ezui/p-8eef0f70.entry.js +0 -1
- package/dist/ezui/p-9634631d.entry.js +0 -1
- package/dist/ezui/p-9a11e223.entry.js +0 -1
- package/dist/ezui/p-9a23d513.entry.js +0 -1
- package/dist/ezui/p-9c2e2d68.entry.js +0 -1
- package/dist/ezui/p-a35b41e6.entry.js +0 -1
- package/dist/ezui/p-b0e71d23.entry.js +0 -1
- package/dist/ezui/p-b150ccd3.entry.js +0 -304
- package/dist/ezui/p-c3b7a23e.entry.js +0 -1
- package/dist/ezui/p-cd1a2e6b.entry.js +0 -1
- package/dist/ezui/p-dbeee5aa.entry.js +0 -1
- package/dist/ezui/p-de870657.entry.js +0 -1
- package/dist/ezui/p-e151e795.entry.js +0 -1
- package/dist/ezui/p-ee9315ff.entry.js +0 -1
- package/dist/ezui/p-f1c3f85d.entry.js +0 -1
- package/dist/ezui/p-f291db18.entry.js +0 -1
|
@@ -36,6 +36,10 @@ export class EzGrid {
|
|
|
36
36
|
this.recordsValidator = undefined;
|
|
37
37
|
this.canEdit = true;
|
|
38
38
|
this.autoFocus = true;
|
|
39
|
+
this.paginationCounterMode = 'show';
|
|
40
|
+
this.enableGridInsert = false;
|
|
41
|
+
this.enableContinuousInsert = true;
|
|
42
|
+
this.enableLockManger = true;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Aplica a definição de colunas.
|
|
@@ -160,6 +164,18 @@ export class EzGrid {
|
|
|
160
164
|
async setFocus() {
|
|
161
165
|
this._gridController.setFocus();
|
|
162
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Para a edição da grade.
|
|
169
|
+
*/
|
|
170
|
+
async stopEdit() {
|
|
171
|
+
this._gridController.stopEdit();
|
|
172
|
+
}
|
|
173
|
+
async checkStopEditOutsideClick(event) {
|
|
174
|
+
var _a;
|
|
175
|
+
if ((_a = this._container) === null || _a === void 0 ? void 0 : _a.contains(event.target))
|
|
176
|
+
return;
|
|
177
|
+
this._gridController.stopEdit();
|
|
178
|
+
}
|
|
163
179
|
observeConfig(config) {
|
|
164
180
|
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
165
181
|
}
|
|
@@ -171,12 +187,23 @@ export class EzGrid {
|
|
|
171
187
|
this._refPaginationLabelTooltip.setAttribute('data-tooltip', this._getPaginationTooltip());
|
|
172
188
|
}
|
|
173
189
|
}
|
|
190
|
+
observePaginationCounterMode(newValue) {
|
|
191
|
+
if (newValue === 'hidden') {
|
|
192
|
+
this._hidePaginationDescription();
|
|
193
|
+
}
|
|
194
|
+
if (newValue === 'show') {
|
|
195
|
+
this._showPaginationDescription();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
174
198
|
onSelectionChange(evt) {
|
|
175
199
|
this._currentPageSelected = evt.detail.selectionHeaderStatus === true;
|
|
176
200
|
if (this.dataUnit) {
|
|
177
201
|
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
178
202
|
}
|
|
179
203
|
}
|
|
204
|
+
async handleClick(event) {
|
|
205
|
+
this.checkStopEditOutsideClick(event);
|
|
206
|
+
}
|
|
180
207
|
setSelection(selectionInfo) {
|
|
181
208
|
var _a;
|
|
182
209
|
this._selectionCount = (_a = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.length) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -332,13 +359,18 @@ export class EzGrid {
|
|
|
332
359
|
resetPaginationState() {
|
|
333
360
|
var _a;
|
|
334
361
|
this._paginationChangedByKeyboard = false;
|
|
335
|
-
(_a = this.
|
|
362
|
+
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.resetPaginationState();
|
|
363
|
+
}
|
|
364
|
+
resolvePaginationClassMode() {
|
|
365
|
+
if (this.paginationCounterMode == 'show')
|
|
366
|
+
return "pagination-expanded";
|
|
367
|
+
return "pagination-contracted";
|
|
336
368
|
}
|
|
337
369
|
getPaginationControl() {
|
|
338
370
|
if (!this._paginationInfo)
|
|
339
371
|
return null;
|
|
340
372
|
const { currentPage, hasMore } = this._paginationInfo;
|
|
341
|
-
return (h("div", { class:
|
|
373
|
+
return (h("div", { class: `grid-header__container grid-header__pagination ${this.resolvePaginationClassMode()}`, ref: ref => (this._refPaginationControl = ref) }, h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, this.paginationCounterMode == 'show' && h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this.paginationCounterMode == 'show' && this._getRemainingPageLabel())), h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium", title: `${this._getActualPageLabel()} ${this._getRemainingPageLabel()}` }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
|
|
342
374
|
}
|
|
343
375
|
componentDidLoad() {
|
|
344
376
|
this._gridController.initDatagrid(this._container, {
|
|
@@ -362,11 +394,14 @@ export class EzGrid {
|
|
|
362
394
|
editionIsDisabled: () => !this.canEdit,
|
|
363
395
|
customFormatters: this._customFormatters,
|
|
364
396
|
autoFocus: this.autoFocus,
|
|
397
|
+
enableGridInsert: this.enableGridInsert,
|
|
398
|
+
enableContinuousInsert: this.enableContinuousInsert,
|
|
365
399
|
onRefresh: () => {
|
|
366
400
|
if (this.dataUnit) {
|
|
367
401
|
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
368
402
|
}
|
|
369
|
-
}
|
|
403
|
+
},
|
|
404
|
+
enableLockManger: this.enableLockManger
|
|
370
405
|
});
|
|
371
406
|
if (this.config) {
|
|
372
407
|
this.observeConfig(this.config);
|
|
@@ -378,7 +413,8 @@ export class EzGrid {
|
|
|
378
413
|
this.setEvents();
|
|
379
414
|
this.componentReady.emit();
|
|
380
415
|
this._gridController.configFilterColumn(this._filterColumn);
|
|
381
|
-
this.
|
|
416
|
+
if (this.paginationCounterMode === 'auto')
|
|
417
|
+
this._initHeaderOverflowWatcher();
|
|
382
418
|
}
|
|
383
419
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
384
420
|
var _a;
|
|
@@ -405,7 +441,8 @@ export class EzGrid {
|
|
|
405
441
|
return this._getActualPageLabel() + this._getRemainingPageLabel();
|
|
406
442
|
}
|
|
407
443
|
_initHeaderOverflowWatcher() {
|
|
408
|
-
|
|
444
|
+
if (this._refPaginationControl)
|
|
445
|
+
this._headerOverflowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
|
|
409
446
|
}
|
|
410
447
|
buildOverFlowWatcherParams() {
|
|
411
448
|
return {
|
|
@@ -436,8 +473,13 @@ export class EzGrid {
|
|
|
436
473
|
this._refPaginationLabelTooltip.removeAttribute('data-tooltip');
|
|
437
474
|
}
|
|
438
475
|
disconnectedCallback() {
|
|
439
|
-
var _a;
|
|
476
|
+
var _a, _b;
|
|
440
477
|
(_a = this._headerOverflowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
478
|
+
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
479
|
+
}
|
|
480
|
+
connectedCallback() {
|
|
481
|
+
var _a;
|
|
482
|
+
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.registryListeners();
|
|
441
483
|
}
|
|
442
484
|
componentWillRender() {
|
|
443
485
|
this.configSelectionCounter();
|
|
@@ -454,6 +496,11 @@ export class EzGrid {
|
|
|
454
496
|
}
|
|
455
497
|
componentDidUpdate() {
|
|
456
498
|
this._gridController.setAutoFocus(this.autoFocus);
|
|
499
|
+
this._gridController.setEnableGridInsert(this.enableGridInsert);
|
|
500
|
+
this._gridController.setEnableContinuousInsert(this.enableContinuousInsert);
|
|
501
|
+
if (this.dataUnit) {
|
|
502
|
+
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
503
|
+
}
|
|
457
504
|
}
|
|
458
505
|
getDataSource() {
|
|
459
506
|
var _a;
|
|
@@ -462,9 +509,14 @@ export class EzGrid {
|
|
|
462
509
|
hideHeader() {
|
|
463
510
|
return (!!this._element.getAttribute("no-header") && !this._paginationInfo);
|
|
464
511
|
}
|
|
512
|
+
resolveLeftHeaderClass() {
|
|
513
|
+
if (this.paginationCounterMode == 'show')
|
|
514
|
+
return "left__header-expanded";
|
|
515
|
+
return "left__header-contracted";
|
|
516
|
+
}
|
|
465
517
|
render() {
|
|
466
518
|
var _a;
|
|
467
|
-
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--
|
|
519
|
+
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--small grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: `grid-header__container grid-header__left-container ${this.resolveLeftHeaderClass()}` }, h("slot", { name: "leftButtons" })), this.getPaginationControl())), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
468
520
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
469
521
|
` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
|
|
470
522
|
}
|
|
@@ -694,6 +746,78 @@ export class EzGrid {
|
|
|
694
746
|
"attribute": "auto-focus",
|
|
695
747
|
"reflect": false,
|
|
696
748
|
"defaultValue": "true"
|
|
749
|
+
},
|
|
750
|
+
"paginationCounterMode": {
|
|
751
|
+
"type": "string",
|
|
752
|
+
"mutable": false,
|
|
753
|
+
"complexType": {
|
|
754
|
+
"original": "'show' | 'hidden' | 'auto'",
|
|
755
|
+
"resolved": "\"auto\" | \"hidden\" | \"show\"",
|
|
756
|
+
"references": {}
|
|
757
|
+
},
|
|
758
|
+
"required": false,
|
|
759
|
+
"optional": true,
|
|
760
|
+
"docs": {
|
|
761
|
+
"tags": [],
|
|
762
|
+
"text": "Define se a grid ser\u00E1 focada ao ser carregada."
|
|
763
|
+
},
|
|
764
|
+
"attribute": "pagination-counter-mode",
|
|
765
|
+
"reflect": false,
|
|
766
|
+
"defaultValue": "'show'"
|
|
767
|
+
},
|
|
768
|
+
"enableGridInsert": {
|
|
769
|
+
"type": "boolean",
|
|
770
|
+
"mutable": false,
|
|
771
|
+
"complexType": {
|
|
772
|
+
"original": "boolean",
|
|
773
|
+
"resolved": "boolean",
|
|
774
|
+
"references": {}
|
|
775
|
+
},
|
|
776
|
+
"required": false,
|
|
777
|
+
"optional": true,
|
|
778
|
+
"docs": {
|
|
779
|
+
"tags": [],
|
|
780
|
+
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
|
781
|
+
},
|
|
782
|
+
"attribute": "enable-grid-insert",
|
|
783
|
+
"reflect": false,
|
|
784
|
+
"defaultValue": "false"
|
|
785
|
+
},
|
|
786
|
+
"enableContinuousInsert": {
|
|
787
|
+
"type": "boolean",
|
|
788
|
+
"mutable": false,
|
|
789
|
+
"complexType": {
|
|
790
|
+
"original": "boolean",
|
|
791
|
+
"resolved": "boolean",
|
|
792
|
+
"references": {}
|
|
793
|
+
},
|
|
794
|
+
"required": false,
|
|
795
|
+
"optional": true,
|
|
796
|
+
"docs": {
|
|
797
|
+
"tags": [],
|
|
798
|
+
"text": "Ativa/desativa a inser\u00E7\u00E3o continua na grade\nS\u00F3 funciona quando a prop enableGridInsert est\u00E1 ativa"
|
|
799
|
+
},
|
|
800
|
+
"attribute": "enable-continuous-insert",
|
|
801
|
+
"reflect": false,
|
|
802
|
+
"defaultValue": "true"
|
|
803
|
+
},
|
|
804
|
+
"enableLockManger": {
|
|
805
|
+
"type": "boolean",
|
|
806
|
+
"mutable": false,
|
|
807
|
+
"complexType": {
|
|
808
|
+
"original": "boolean",
|
|
809
|
+
"resolved": "boolean",
|
|
810
|
+
"references": {}
|
|
811
|
+
},
|
|
812
|
+
"required": false,
|
|
813
|
+
"optional": true,
|
|
814
|
+
"docs": {
|
|
815
|
+
"tags": [],
|
|
816
|
+
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
|
817
|
+
},
|
|
818
|
+
"attribute": "enable-lock-manger",
|
|
819
|
+
"reflect": false,
|
|
820
|
+
"defaultValue": "true"
|
|
697
821
|
}
|
|
698
822
|
};
|
|
699
823
|
}
|
|
@@ -1198,6 +1322,47 @@ export class EzGrid {
|
|
|
1198
1322
|
"text": "Atribui o foco para a grade.",
|
|
1199
1323
|
"tags": []
|
|
1200
1324
|
}
|
|
1325
|
+
},
|
|
1326
|
+
"stopEdit": {
|
|
1327
|
+
"complexType": {
|
|
1328
|
+
"signature": "() => Promise<void>",
|
|
1329
|
+
"parameters": [],
|
|
1330
|
+
"references": {
|
|
1331
|
+
"Promise": {
|
|
1332
|
+
"location": "global"
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
"return": "Promise<void>"
|
|
1336
|
+
},
|
|
1337
|
+
"docs": {
|
|
1338
|
+
"text": "Para a edi\u00E7\u00E3o da grade.",
|
|
1339
|
+
"tags": []
|
|
1340
|
+
}
|
|
1341
|
+
},
|
|
1342
|
+
"checkStopEditOutsideClick": {
|
|
1343
|
+
"complexType": {
|
|
1344
|
+
"signature": "(event: MouseEvent) => Promise<void>",
|
|
1345
|
+
"parameters": [{
|
|
1346
|
+
"tags": [],
|
|
1347
|
+
"text": ""
|
|
1348
|
+
}],
|
|
1349
|
+
"references": {
|
|
1350
|
+
"Promise": {
|
|
1351
|
+
"location": "global"
|
|
1352
|
+
},
|
|
1353
|
+
"MouseEvent": {
|
|
1354
|
+
"location": "global"
|
|
1355
|
+
},
|
|
1356
|
+
"Node": {
|
|
1357
|
+
"location": "global"
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
"return": "Promise<void>"
|
|
1361
|
+
},
|
|
1362
|
+
"docs": {
|
|
1363
|
+
"text": "",
|
|
1364
|
+
"tags": []
|
|
1365
|
+
}
|
|
1201
1366
|
}
|
|
1202
1367
|
};
|
|
1203
1368
|
}
|
|
@@ -1209,6 +1374,9 @@ export class EzGrid {
|
|
|
1209
1374
|
}, {
|
|
1210
1375
|
"propName": "_paginationInfo",
|
|
1211
1376
|
"methodName": "updatePaginationTooltip"
|
|
1377
|
+
}, {
|
|
1378
|
+
"propName": "paginationCounterMode",
|
|
1379
|
+
"methodName": "observePaginationCounterMode"
|
|
1212
1380
|
}];
|
|
1213
1381
|
}
|
|
1214
1382
|
static get listeners() {
|
|
@@ -1218,6 +1386,12 @@ export class EzGrid {
|
|
|
1218
1386
|
"target": undefined,
|
|
1219
1387
|
"capture": false,
|
|
1220
1388
|
"passive": false
|
|
1389
|
+
}, {
|
|
1390
|
+
"name": "click",
|
|
1391
|
+
"method": "handleClick",
|
|
1392
|
+
"target": undefined,
|
|
1393
|
+
"capture": true,
|
|
1394
|
+
"passive": false
|
|
1221
1395
|
}];
|
|
1222
1396
|
}
|
|
1223
1397
|
}
|
|
@@ -147,6 +147,7 @@ p {
|
|
|
147
147
|
|
|
148
148
|
.item-content {
|
|
149
149
|
display: flex;
|
|
150
|
+
align-items: center;
|
|
150
151
|
overflow: hidden;
|
|
151
152
|
justify-content: flex-start;
|
|
152
153
|
width: 100%;
|
|
@@ -176,7 +177,7 @@ p {
|
|
|
176
177
|
|
|
177
178
|
.draggable-list li > div {
|
|
178
179
|
/*public*/
|
|
179
|
-
padding: var(--space--
|
|
180
|
+
padding: var(--space--3xs, 4px) var(--space--3xs, 4px);
|
|
180
181
|
margin: var(--ez-list__item--margin);
|
|
181
182
|
}
|
|
182
183
|
|
|
@@ -25,10 +25,10 @@ export class EzList {
|
|
|
25
25
|
*/
|
|
26
26
|
async scrollToTop() {
|
|
27
27
|
if (this.useGroups) {
|
|
28
|
-
this._element.
|
|
28
|
+
this._element.querySelector('.group-container').scrollTop = 0;
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
|
-
this._element.
|
|
31
|
+
this._element.querySelector('.items-container').scrollTop = 0;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
@@ -148,8 +148,7 @@ export class EzList {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
buildIdDraggableListAndSelectable() {
|
|
151
|
-
const
|
|
152
|
-
const draggableList = shadow.querySelectorAll('.draggable-list');
|
|
151
|
+
const draggableList = this._element.querySelectorAll('.draggable-list');
|
|
153
152
|
draggableList === null || draggableList === void 0 ? void 0 : draggableList.forEach((draggable, index) => {
|
|
154
153
|
var _a, _b;
|
|
155
154
|
let suffix = 'draggableList';
|
|
@@ -159,7 +158,7 @@ export class EzList {
|
|
|
159
158
|
}
|
|
160
159
|
ElementIDUtils.addIDInfoIfNotExists(draggable, suffix);
|
|
161
160
|
});
|
|
162
|
-
const selectable =
|
|
161
|
+
const selectable = this._element.querySelectorAll('.selectable-container');
|
|
163
162
|
selectable === null || selectable === void 0 ? void 0 : selectable.forEach((item) => {
|
|
164
163
|
ElementIDUtils.addIDInfoIfNotExists(item, 'selectable');
|
|
165
164
|
});
|
|
@@ -288,7 +287,7 @@ export class EzList {
|
|
|
288
287
|
}
|
|
289
288
|
if (this._draggingElement) {
|
|
290
289
|
try {
|
|
291
|
-
this._element.
|
|
290
|
+
this._element.removeChild(this._draggingElement);
|
|
292
291
|
}
|
|
293
292
|
catch (err) { }
|
|
294
293
|
this._draggingElement = undefined;
|
|
@@ -551,7 +550,7 @@ export class EzList {
|
|
|
551
550
|
}, onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDropLastIndex(event) }))))));
|
|
552
551
|
}
|
|
553
552
|
static get is() { return "ez-list"; }
|
|
554
|
-
static get encapsulation() { return "
|
|
553
|
+
static get encapsulation() { return "scoped"; }
|
|
555
554
|
static get originalStyleUrls() {
|
|
556
555
|
return {
|
|
557
556
|
"$": ["ez-list.css"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/*@doc Define a camada em que o componente será exibido.*/
|
|
3
|
-
--ez-modal-z-index: var(--elevation--
|
|
3
|
+
--ez-modal-z-index: var(--elevation--22, 22);
|
|
4
4
|
/*@doc Define o espaçamento vertical do conteúdo do modal.*/
|
|
5
5
|
--ez-modal-vertical-padding: var(--space--large, 24px);
|
|
6
6
|
/*@doc Define o padding entre o conteúdo e o modal */
|
|
@@ -8,6 +8,7 @@ export class EzModal {
|
|
|
8
8
|
this.opened = true;
|
|
9
9
|
this.closeEsc = false;
|
|
10
10
|
this.closeOutsideClick = false;
|
|
11
|
+
this.closeOutsideLeave = false;
|
|
11
12
|
this.scrim = "medium";
|
|
12
13
|
}
|
|
13
14
|
observeOpened() {
|
|
@@ -30,15 +31,29 @@ export class EzModal {
|
|
|
30
31
|
.bind("Esc", () => this.closeModal());
|
|
31
32
|
}
|
|
32
33
|
componentDidRender() {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
this.modalFocus();
|
|
35
|
+
}
|
|
36
|
+
modalFocus() {
|
|
37
|
+
if (!this.opened) {
|
|
38
|
+
return;
|
|
35
39
|
}
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
|
+
const slot = this._element.shadowRoot.querySelector("ez-modal-container");
|
|
42
|
+
if (this._modalRef && slot === null) {
|
|
43
|
+
this._modalRef.focus();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
36
46
|
}
|
|
37
47
|
onMouseDownHandler(event) {
|
|
38
48
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
39
49
|
this.closeModal();
|
|
40
50
|
}
|
|
41
51
|
}
|
|
52
|
+
onMouseLeaveHandler() {
|
|
53
|
+
if (this.closeOutsideLeave) {
|
|
54
|
+
this.closeModal();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
42
57
|
render() {
|
|
43
58
|
const positionSufix = this.align === "left" ? "left" : "right";
|
|
44
59
|
const regularVerticalPaddingClass = this.heightMode === "regular" ? 'modal__vertical-padding' : '';
|
|
@@ -46,7 +61,7 @@ export class EzModal {
|
|
|
46
61
|
const scrimType = `modal__screen-${this.scrim}`;
|
|
47
62
|
return (h(Host, null, this.opened
|
|
48
63
|
?
|
|
49
|
-
h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
|
|
64
|
+
h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { onMouseLeave: () => this.onMouseLeaveHandler(), class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
|
|
50
65
|
:
|
|
51
66
|
undefined));
|
|
52
67
|
}
|
|
@@ -174,6 +189,24 @@ export class EzModal {
|
|
|
174
189
|
"reflect": false,
|
|
175
190
|
"defaultValue": "false"
|
|
176
191
|
},
|
|
192
|
+
"closeOutsideLeave": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": true,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": "Define se o modal ser\u00E1 fechado se o mouse sair para fora do conte\u00FAdo."
|
|
205
|
+
},
|
|
206
|
+
"attribute": "close-outside-leave",
|
|
207
|
+
"reflect": false,
|
|
208
|
+
"defaultValue": "false"
|
|
209
|
+
},
|
|
177
210
|
"scrim": {
|
|
178
211
|
"type": "string",
|
|
179
212
|
"mutable": false,
|
|
@@ -11,6 +11,7 @@ export class EzModalContainer {
|
|
|
11
11
|
this.okButtonLabel = undefined;
|
|
12
12
|
this.cancelButtonStatus = undefined;
|
|
13
13
|
this.okButtonStatus = undefined;
|
|
14
|
+
this.showCloseButton = true;
|
|
14
15
|
}
|
|
15
16
|
async handleEzModalAction(event) {
|
|
16
17
|
var _a;
|
|
@@ -47,7 +48,7 @@ export class EzModalContainer {
|
|
|
47
48
|
this._closeButton.focus();
|
|
48
49
|
}
|
|
49
50
|
render() {
|
|
50
|
-
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--
|
|
51
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
51
52
|
}
|
|
52
53
|
static get is() { return "ez-modal-container"; }
|
|
53
54
|
static get encapsulation() { return "scoped"; }
|
|
@@ -182,6 +183,24 @@ export class EzModalContainer {
|
|
|
182
183
|
},
|
|
183
184
|
"attribute": "ok-button-status",
|
|
184
185
|
"reflect": false
|
|
186
|
+
},
|
|
187
|
+
"showCloseButton": {
|
|
188
|
+
"type": "boolean",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "boolean",
|
|
192
|
+
"resolved": "boolean",
|
|
193
|
+
"references": {}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": true,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": "Define a visibilidade do bot\u00E3o de fechar."
|
|
200
|
+
},
|
|
201
|
+
"attribute": "show-close-button",
|
|
202
|
+
"reflect": false,
|
|
203
|
+
"defaultValue": "true"
|
|
185
204
|
}
|
|
186
205
|
};
|
|
187
206
|
}
|
|
@@ -96,7 +96,7 @@ export class EzMuiltiSelectionList {
|
|
|
96
96
|
}
|
|
97
97
|
async searchWithDataSource(searchArgument, fieldName) {
|
|
98
98
|
const { argument, mode } = searchArgument;
|
|
99
|
-
if (mode !== 'PRELOAD') {
|
|
99
|
+
if (mode !== 'PRELOAD' && fieldName) {
|
|
100
100
|
return this.dataSource.fetchData(argument, fieldName);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -12,9 +12,11 @@ export class EzNumberInput {
|
|
|
12
12
|
this.enabled = true;
|
|
13
13
|
this.canShowError = true;
|
|
14
14
|
this.errorMessage = undefined;
|
|
15
|
+
this.allowNegative = true;
|
|
15
16
|
this.precision = undefined;
|
|
16
17
|
this.prettyPrecision = undefined;
|
|
17
18
|
this.mode = "regular";
|
|
19
|
+
this.autoFocus = false;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Aplica o foco no campo.
|
|
@@ -155,15 +157,25 @@ export class EzNumberInput {
|
|
|
155
157
|
const textValue = this.getTextValue(this.value) || '';
|
|
156
158
|
if ((this._value || '') !== textValue) {
|
|
157
159
|
this._value = textValue;
|
|
160
|
+
this._textInput.value = this._value;
|
|
158
161
|
}
|
|
159
162
|
}
|
|
160
163
|
componentDidLoad() {
|
|
161
164
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
162
165
|
this.setInputValue();
|
|
166
|
+
if (this.autoFocus) {
|
|
167
|
+
requestAnimationFrame(() => {
|
|
168
|
+
this.setFocus({ selectText: true });
|
|
169
|
+
});
|
|
170
|
+
}
|
|
163
171
|
}
|
|
164
172
|
render() {
|
|
165
173
|
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
166
|
-
|
|
174
|
+
let restrict = this.precision > 0 ? "0123456789,." : "0123456789";
|
|
175
|
+
if (this.allowNegative) {
|
|
176
|
+
restrict += '-';
|
|
177
|
+
}
|
|
178
|
+
return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: restrict, enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError, value: this._value }));
|
|
167
179
|
}
|
|
168
180
|
static get is() { return "ez-number-input"; }
|
|
169
181
|
static get encapsulation() { return "shadow"; }
|
|
@@ -266,6 +278,24 @@ export class EzNumberInput {
|
|
|
266
278
|
"attribute": "error-message",
|
|
267
279
|
"reflect": true
|
|
268
280
|
},
|
|
281
|
+
"allowNegative": {
|
|
282
|
+
"type": "boolean",
|
|
283
|
+
"mutable": false,
|
|
284
|
+
"complexType": {
|
|
285
|
+
"original": "boolean",
|
|
286
|
+
"resolved": "boolean",
|
|
287
|
+
"references": {}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": false,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": "Se false, o input n\u00E3o aceitar\u00E1 n\u00FAmeros negativos."
|
|
294
|
+
},
|
|
295
|
+
"attribute": "allow-negative",
|
|
296
|
+
"reflect": false,
|
|
297
|
+
"defaultValue": "true"
|
|
298
|
+
},
|
|
269
299
|
"precision": {
|
|
270
300
|
"type": "number",
|
|
271
301
|
"mutable": false,
|
|
@@ -317,6 +347,24 @@ export class EzNumberInput {
|
|
|
317
347
|
"attribute": "mode",
|
|
318
348
|
"reflect": true,
|
|
319
349
|
"defaultValue": "\"regular\""
|
|
350
|
+
},
|
|
351
|
+
"autoFocus": {
|
|
352
|
+
"type": "boolean",
|
|
353
|
+
"mutable": false,
|
|
354
|
+
"complexType": {
|
|
355
|
+
"original": "boolean",
|
|
356
|
+
"resolved": "boolean",
|
|
357
|
+
"references": {}
|
|
358
|
+
},
|
|
359
|
+
"required": false,
|
|
360
|
+
"optional": false,
|
|
361
|
+
"docs": {
|
|
362
|
+
"tags": [],
|
|
363
|
+
"text": "Se true o campo de texto receber\u00E1 o foco ao ser renderizado."
|
|
364
|
+
},
|
|
365
|
+
"attribute": "auto-focus",
|
|
366
|
+
"reflect": false,
|
|
367
|
+
"defaultValue": "false"
|
|
320
368
|
}
|
|
321
369
|
};
|
|
322
370
|
}
|
|
@@ -68,13 +68,17 @@
|
|
|
68
68
|
border-radius: 12px;
|
|
69
69
|
box-shadow: 0px 0px 16px rgba(0, 38, 111, 0.122);
|
|
70
70
|
box-sizing: border-box;
|
|
71
|
-
padding: var(--ez-popup__container--padding)
|
|
71
|
+
padding: var(--ez-popup__container--padding);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.popup__container--auto {
|
|
75
75
|
height: auto;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
.popup__overflow-y--auto {
|
|
79
|
+
overflow-y: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
78
82
|
.popup__content {
|
|
79
83
|
box-sizing: border-box;
|
|
80
84
|
height: 100%;
|