@sankhyalabs/ezui 4.6.0 → 4.7.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.
Files changed (52) hide show
  1. package/dist/cjs/{constants-5d588e38.js → constants-5a75e2f3.js} +0 -2
  2. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-form.cjs.entry.js +0 -1
  5. package/dist/cjs/ez-grid.cjs.entry.js +112 -213
  6. package/dist/cjs/ez-modal.cjs.entry.js +5 -2
  7. package/dist/cjs/ez-upload.cjs.entry.js +4 -2
  8. package/dist/cjs/ezui.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +86 -84
  11. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +5 -16
  12. package/dist/collection/components/ez-grid/ez-grid.js +21 -110
  13. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -5
  14. package/dist/collection/components/ez-modal/ez-modal.css +4 -2
  15. package/dist/collection/components/ez-modal/ez-modal.js +26 -1
  16. package/dist/collection/components/ez-upload/ez-upload.css +14 -1
  17. package/dist/collection/components/ez-upload/ez-upload.js +20 -1
  18. package/dist/collection/utils/form/DataBinder.js +0 -1
  19. package/dist/custom-elements/index.js +124 -221
  20. package/dist/esm/constants-ca136201.js +3 -0
  21. package/dist/esm/ez-combo-box.entry.js +1 -1
  22. package/dist/esm/ez-form-view.entry.js +1 -1
  23. package/dist/esm/ez-form.entry.js +0 -1
  24. package/dist/esm/ez-grid.entry.js +112 -213
  25. package/dist/esm/ez-modal.entry.js +5 -2
  26. package/dist/esm/ez-upload.entry.js +4 -2
  27. package/dist/esm/ezui.js +1 -1
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/ezui/ezui.esm.js +1 -1
  30. package/dist/ezui/p-03164b9f.entry.js +1 -0
  31. package/dist/ezui/p-22f4210d.entry.js +1 -0
  32. package/dist/ezui/p-3f4ae3a3.js +1 -0
  33. package/dist/ezui/{p-878646a0.entry.js → p-50883460.entry.js} +1 -1
  34. package/dist/ezui/{p-ef705232.entry.js → p-8654802d.entry.js} +2 -2
  35. package/dist/ezui/{p-b7ea9791.entry.js → p-e748b5d3.entry.js} +1 -1
  36. package/dist/ezui/p-f1dc3514.entry.js +1 -0
  37. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +6 -10
  38. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -5
  39. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +0 -1
  40. package/dist/types/components/ez-grid/ez-grid.d.ts +2 -9
  41. package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +2 -2
  42. package/dist/types/components/ez-modal/ez-modal.d.ts +9 -0
  43. package/dist/types/components/ez-upload/ez-upload.d.ts +4 -0
  44. package/dist/types/components.d.ts +16 -0
  45. package/package.json +1 -1
  46. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +0 -73
  47. package/dist/esm/constants-76d2e931.js +0 -4
  48. package/dist/ezui/p-1f841f3c.entry.js +0 -1
  49. package/dist/ezui/p-622c2d53.entry.js +0 -1
  50. package/dist/ezui/p-b01e3085.js +0 -1
  51. package/dist/ezui/p-eceb9382.entry.js +0 -1
  52. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +0 -11
@@ -4,7 +4,7 @@ import { A as ApplicationUtils } from './ApplicationUtils-79bf1d95.js';
4
4
  import { C as CSSVarsUtils } from './CSSVarsUtils-00f67f32.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
- import { R as REQUIRED_INFO } from './constants-76d2e931.js';
7
+ import { R as REQUIRED_INFO } from './constants-ca136201.js';
8
8
 
9
9
  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--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{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;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%;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)}}";
10
10
 
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-de655f48.js';
2
2
  import { UserInterface, ElementIDUtils } from '@sankhyalabs/core';
3
- import { R as REQUIRED_INFO } from './constants-76d2e931.js';
3
+ import { R as REQUIRED_INFO } from './constants-ca136201.js';
4
4
  import { C as CheckMode } from './CheckMode-bdb2ec19.js';
5
5
 
6
6
  const buildSwitch = (field) => {
@@ -210,7 +210,6 @@ class DataBinder {
210
210
  case Action.RECORDS_COPIED:
211
211
  case Action.EDITION_CANCELED:
212
212
  case Action.SELECTION_CHANGED:
213
- case Action.SELECTION_REMOVED:
214
213
  case Action.NEXT_SELECTED:
215
214
  case Action.PREVIOUS_SELECTED:
216
215
  this.clearInvalid();
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-de655f48.js';
2
2
  import { Action, ObjectUtils as ObjectUtils$1, ApplicationContext, StringUtils as StringUtils$1, UserInterface, NumberUtils as NumberUtils$1, DataType, SortMode, ElementIDUtils, JSUtils } from '@sankhyalabs/core';
3
- import { A as ALL_RECORD } from './constants-76d2e931.js';
3
+ import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
4
 
5
5
  /**
6
6
  * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
@@ -118930,6 +118930,7 @@ class DataSource {
118930
118930
  if (this._options) {
118931
118931
  this._options.onPaginationChange(this._dataUnit.getPaginationInfo());
118932
118932
  }
118933
+ this.updateSelection();
118933
118934
  break;
118934
118935
  case Action.RECORDS_REMOVED:
118935
118936
  case Action.DATA_SAVED:
@@ -118938,7 +118939,6 @@ class DataSource {
118938
118939
  this._controller.refresh();
118939
118940
  break;
118940
118941
  case Action.SELECTION_CHANGED:
118941
- case Action.SELECTION_REMOVED:
118942
118942
  case Action.NEXT_SELECTED:
118943
118943
  case Action.PREVIOUS_SELECTED:
118944
118944
  this.updateSelection();
@@ -118952,25 +118952,14 @@ class DataSource {
118952
118952
  this._dataUnit.subscribe(this.duObserver);
118953
118953
  }
118954
118954
  updateSelection() {
118955
- var _a;
118956
- if (this.isSelectionEquals()) {
118957
- return;
118958
- }
118959
- const dataSelection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
118960
- if ((dataSelection === null || dataSelection === void 0 ? void 0 : dataSelection.length) > 0) {
118961
- this._controller.selectRows(dataSelection);
118955
+ const selectionInfo = this._dataUnit.getSelectionInfo();
118956
+ if (selectionInfo.isAllRecords()) {
118957
+ this._controller.selectAll(true);
118962
118958
  }
118963
118959
  else {
118964
- this._controller.deselectAll();
118960
+ this._controller.selectRows(selectionInfo.recordIds, true);
118965
118961
  }
118966
118962
  }
118967
- isSelectionEquals() {
118968
- var _a, _b;
118969
- const dataSelection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
118970
- const controlSelection = (_b = this._controller) === null || _b === void 0 ? void 0 : _b.getSelection();
118971
- return ObjectUtils$1.objectToString(dataSelection || []) ===
118972
- ObjectUtils$1.objectToString(controlSelection || []);
118973
- }
118974
118963
  getRows(params) {
118975
118964
  if (this.needReload(params)) {
118976
118965
  this._lastLoadingParams = params;
@@ -119171,9 +119160,12 @@ class AgGridController {
119171
119160
  else {
119172
119161
  this._grid = new Grid(container, this._gridOptions);
119173
119162
  }
119174
- const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
119175
- if (selection) {
119176
- this.selectRows(selection);
119163
+ const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
119164
+ if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
119165
+ this.selectAll(true);
119166
+ }
119167
+ else {
119168
+ this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
119177
119169
  }
119178
119170
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
119179
119171
  }
@@ -119237,7 +119229,7 @@ class AgGridController {
119237
119229
  opt.onColumnPinned = e => this.onCallStateChange("columnPinned", e);
119238
119230
  opt.onColumnMoved = e => this.onCallStateChange("columnMoved", e);
119239
119231
  opt.onColumnVisible = e => this.onCallStateChange("visibleChange", e);
119240
- opt.onSelectionChanged = () => this.onSelectionChange();
119232
+ opt.onSelectionChanged = e => this.onSelectionChange(e);
119241
119233
  opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
119242
119234
  opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
119243
119235
  }
@@ -119245,72 +119237,31 @@ class AgGridController {
119245
119237
  opt.suppressDragLeaveHidesColumns = true;
119246
119238
  opt.suppressMenuHide = true;
119247
119239
  }
119248
- isAllRecordSetted(allSelection) {
119249
- return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
119250
- return selectedRecord.__record__id__ === ALL_RECORD;
119251
- });
119252
- }
119253
119240
  getSelectionHeaderStatus() {
119254
119241
  const records = this._dataUnit.records;
119255
119242
  if (records && records.length === 0) {
119256
119243
  return false;
119257
119244
  }
119258
- const allSelection = this._dataUnit.getSelection();
119259
- if (allSelection == undefined || allSelection.length === 0) {
119260
- return false;
119261
- }
119262
- if (this.isAllRecordSetted(allSelection)) {
119245
+ const selectionInfo = this._dataUnit.getSelectionInfo();
119246
+ if (selectionInfo.isAllRecords()) {
119263
119247
  return true;
119264
119248
  }
119265
- if (allSelection.length != records.length) {
119266
- return undefined;
119267
- }
119268
- const selectedRecords = this._dataUnit.getSelectedRecords();
119269
- if (selectedRecords.length < allSelection.length) {
119270
- return undefined;
119249
+ const selection = selectionInfo.recordIds;
119250
+ if (selection == undefined || selection.length === 0) {
119251
+ return false;
119271
119252
  }
119272
119253
  let status = undefined;
119273
119254
  for (let i = 0; i < records.length; i++) {
119274
- const current = allSelection.some((selectedRecord) => {
119275
- return selectedRecord.__record__id__ === records[i].__record__id__;
119276
- });
119255
+ const current = selection.includes(records[i].__record__id__);
119277
119256
  if (status != undefined && current !== status) {
119278
- return;
119257
+ return undefined;
119279
119258
  }
119280
119259
  status = current;
119281
119260
  }
119282
119261
  return status;
119283
119262
  }
119284
- async updateSelectionForAll(selectAll) {
119285
- if (this._dataUnit == undefined) {
119286
- return;
119287
- }
119288
- let allSelection = this._dataUnit.getSelection();
119289
- if (allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((sel) => sel.__record__id__ === ALL_RECORD)) {
119290
- await this._dataUnit.clearSelection();
119291
- }
119292
- let updateSelection = [];
119293
- const records = this._dataUnit.records;
119294
- const selectedRecords = this._dataUnit.getSelectedRecords();
119295
- allSelection = this._dataUnit.getSelection();
119296
- if (selectAll && selectedRecords.length < records.length) {
119297
- updateSelection = records;
119298
- allSelection.forEach((selectedRecord) => {
119299
- const recordIds = updateSelection.map((record) => record.__record__id__);
119300
- if (!recordIds.includes(selectedRecord.__record__id__)) {
119301
- updateSelection.push(selectedRecord);
119302
- }
119303
- });
119304
- }
119305
- else {
119306
- updateSelection = allSelection.filter((selectedRecord) => {
119307
- return !(records || [])
119308
- .some((record) => {
119309
- return record.__record__id__ === selectedRecord.__record__id__;
119310
- });
119311
- });
119312
- }
119313
- this._dataUnit.setSelection(updateSelection);
119263
+ updateSelectionForAll(selectAll) {
119264
+ this._dataUnit.updatePageSelection(selectAll ? this._dataUnit.records.map(r => r.__record__id__) : []);
119314
119265
  }
119315
119266
  setData(data) {
119316
119267
  if (this._grid === undefined) {
@@ -119328,21 +119279,55 @@ class AgGridController {
119328
119279
  throw new Error("Erro interno: Grid ainda não inicializado.");
119329
119280
  }
119330
119281
  }
119331
- selectRows(rowIds) {
119332
- if (this._grid === undefined) {
119333
- throw new Error("Erro interno: Grid ainda não inicializado.");
119282
+ selectAll(quietly = false) {
119283
+ try {
119284
+ this._gridOptions.context.selectionChangeQuietly = quietly;
119285
+ this._gridOptions.api.forEachNode(node => {
119286
+ if (!node.isSelected()) {
119287
+ node.setSelected(true);
119288
+ }
119289
+ });
119290
+ }
119291
+ finally {
119292
+ const newContext = Object.assign({}, this._gridOptions.context);
119293
+ delete newContext.selectionChangeQuietly;
119294
+ this._gridOptions.context = newContext;
119334
119295
  }
119335
- this._gridOptions.api.forEachNode(node => {
119336
- var _a;
119337
- if (rowIds && rowIds.find(row => row.__record__id__ === node.id)) {
119338
- node.setSelected(true);
119339
- (_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(node);
119296
+ }
119297
+ selectRows(rowIds, quietly = false) {
119298
+ var _a;
119299
+ try {
119300
+ this._gridOptions.context.selectionChangeQuietly = quietly;
119301
+ if (this._grid === undefined) {
119302
+ throw new Error("Erro interno: Grid ainda não inicializado.");
119340
119303
  }
119341
- else {
119342
- node.setSelected(false);
119304
+ let lastSelected;
119305
+ this._gridOptions.api.forEachNode(node => {
119306
+ if (rowIds && rowIds.includes(node.id)) {
119307
+ if (!node.isSelected()) {
119308
+ node.setSelected(true);
119309
+ lastSelected = node;
119310
+ }
119311
+ }
119312
+ else {
119313
+ if (node.isSelected()) {
119314
+ node.setSelected(false);
119315
+ }
119316
+ }
119317
+ });
119318
+ const selectionHeader = this._gridOptions.context.selectionHeader;
119319
+ if (selectionHeader) {
119320
+ selectionHeader.updateCheckbox();
119343
119321
  }
119344
- });
119345
- this.updateCheckbox();
119322
+ if (lastSelected) {
119323
+ (_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(lastSelected);
119324
+ }
119325
+ }
119326
+ finally {
119327
+ const newContext = Object.assign({}, this._gridOptions.context);
119328
+ delete newContext.selectionChangeQuietly;
119329
+ this._gridOptions.context = newContext;
119330
+ }
119346
119331
  }
119347
119332
  removeRows() {
119348
119333
  if (this._grid === undefined) {
@@ -119525,19 +119510,6 @@ class AgGridController {
119525
119510
  var _a;
119526
119511
  (_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
119527
119512
  }
119528
- deselectAll() {
119529
- var _a, _b;
119530
- (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.deselectAll();
119531
- this.updateCheckbox();
119532
- }
119533
- updateCheckbox() {
119534
- var _a, _b;
119535
- const selectionHeader = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.selectionHeader;
119536
- if (selectionHeader == undefined) {
119537
- return;
119538
- }
119539
- selectionHeader.updateCheckbox();
119540
- }
119541
119513
  buildColDef(source) {
119542
119514
  var _a, _b, _c;
119543
119515
  let tooltip = undefined;
@@ -119658,13 +119630,33 @@ class AgGridController {
119658
119630
  }
119659
119631
  return false;
119660
119632
  }
119661
- onSelectionChange() {
119633
+ onSelectionChange(event) {
119662
119634
  if (this._selectionChangeCallback) {
119663
119635
  clearTimeout(this._selectionChangeDeboucing);
119664
119636
  this._selectionChangeDeboucing = window.setTimeout(() => {
119665
- this._selectionChangeCallback({
119666
- selection: this._gridOptions.api.getSelectedRows()
119667
- });
119637
+ if (this._dataUnit) {
119638
+ if (event.context.selectionChangeQuietly) {
119639
+ const selectionInfo = this._dataUnit;
119640
+ this._selectionChangeCallback({
119641
+ selection: selectionInfo.records,
119642
+ selectionHeaderStatus: this.getSelectionHeaderStatus()
119643
+ });
119644
+ }
119645
+ else {
119646
+ this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((r) => r.__record__id__)).then(selectionInfo => {
119647
+ this._selectionChangeCallback({
119648
+ selection: selectionInfo.records,
119649
+ selectionHeaderStatus: this.getSelectionHeaderStatus()
119650
+ });
119651
+ });
119652
+ }
119653
+ }
119654
+ else {
119655
+ this._selectionChangeCallback({
119656
+ selection: this._gridOptions.api.getSelectedRows(),
119657
+ selectionHeaderStatus: this.getSelectionHeaderStatus()
119658
+ });
119659
+ }
119668
119660
  }, 0);
119669
119661
  }
119670
119662
  }
@@ -119696,16 +119688,14 @@ class AgGridController {
119696
119688
  }
119697
119689
 
119698
119690
  const SelectionCounter = (props) => {
119699
- const { selectionCount, selectionPageCount, total, recordsLength, onSelectAll, onSelectPage, onClearAll, onClose } = props;
119700
- const pageSelectedRecords = selectionPageCount === recordsLength;
119701
- const allSelectedRecords = selectionCount === total;
119691
+ const { selectionCount, currentPageSelected, total, allRecordSelected, onSelectAll, onSelectPage, onClearAll, onClose } = props;
119702
119692
  return (h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")),
119703
119693
  h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" },
119704
119694
  h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" },
119705
- h("label", Object.assign({ innerHTML: getText(selectionCount, allSelectedRecords), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
119695
+ h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
119706
119696
  h("div", { class: "ez-flex ez-margin-right--medium" },
119707
- (pageSelectedRecords || allSelectedRecords) &&
119708
- h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allSelectedRecords ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allSelectedRecords ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allSelectedRecords ? "Page" : "All"}`))),
119697
+ (currentPageSelected || allRecordSelected) &&
119698
+ h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allRecordSelected ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
119709
119699
  h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
119710
119700
  h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
119711
119701
  h("ez-icon", { iconName: "close" })))));
@@ -119735,13 +119725,12 @@ const EzGrid = class {
119735
119725
  this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
119736
119726
  this.configChange = createEvent(this, "configChange", 7);
119737
119727
  this._gridController = new AgGridController(false);
119738
- this._debounceTimer = 500;
119739
- this._selectionAll = false;
119740
119728
  this._paginationInfo = undefined;
119741
119729
  this._paginationChangedByKeyboard = true;
119742
119730
  this._showSelectionCounter = false;
119743
- this._selectionCount = 0;
119744
- this._selectionPageCount = 0;
119731
+ this._isAllSelection = false;
119732
+ this._currentPageSelected = undefined;
119733
+ this._selectionCount = undefined;
119745
119734
  this.multipleSelection = undefined;
119746
119735
  this.config = undefined;
119747
119736
  this.serverUrl = undefined;
@@ -119800,117 +119789,29 @@ const EzGrid = class {
119800
119789
  this._gridController.setColumnsState(config.columns);
119801
119790
  }
119802
119791
  onSelectionChange(evt) {
119803
- const { selection } = evt === null || evt === void 0 ? void 0 : evt.detail;
119804
- if (selection == undefined || this.dataUnit == undefined) {
119805
- return;
119806
- }
119807
- if (this.isAllRecordSetted()) {
119808
- this.updateSelectionPage(selection);
119809
- return;
119810
- }
119811
- this.setSelection(selection);
119812
- }
119813
- updateSelectionPage(selection) {
119814
- if (this._selectionAll) {
119815
- this._selectionAll = false;
119816
- }
119817
- else {
119818
- this.dataUnit.clearSelection()
119819
- .then(() => {
119820
- const records = this.dataUnit.records;
119821
- const selectionPage = selection.filter((selectedRecord) => {
119822
- return records.some((record) => {
119823
- return record.__record__id__ === selectedRecord.__record__id__;
119824
- });
119825
- });
119826
- this._gridController.selectRows(selectionPage);
119827
- });
119828
- }
119829
- }
119830
- isAllRecordSetted() {
119831
- var _a;
119832
- const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
119833
- return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
119834
- return selectedRecord.__record__id__ === ALL_RECORD;
119835
- });
119836
- }
119837
- setSelection(selection) {
119838
- if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
119839
- this.dataUnit.setSelection(selection)
119840
- .then(this.controlSelectionCounter.bind(this));
119841
- }
119842
- else {
119843
- this.dataUnit.clearSelection()
119844
- .then(this.controlSelectionCounter.bind(this));
119845
- }
119846
- }
119847
- setAutoSelectAll() {
119848
- var _a, _b, _c, _d;
119849
- const { total } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
119850
- if (total == undefined) {
119851
- return;
119852
- }
119853
- this._selectionCount = total;
119854
- this._selectionAll = true;
119855
- this._showSelectionCounter = true;
119856
- (_b = this._gridController) === null || _b === void 0 ? void 0 : _b.selectRows((_d = (_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.records) !== null && _d !== void 0 ? _d : []);
119857
- }
119858
- controlSelectionCounter() {
119859
- var _a, _b;
119860
- const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
119861
- const counter = (_b = allSelection === null || allSelection === void 0 ? void 0 : allSelection.length) !== null && _b !== void 0 ? _b : 0;
119862
- if (this.isAllRecordSetted()) {
119863
- this.setAutoSelectAll();
119864
- return;
119865
- }
119866
- if (!this.multipleSelection || !this.isPaginationActived()) {
119867
- this._showSelectionCounter = false;
119868
- setTimeout(this.setSelectionCount.bind(this), this._debounceTimer);
119869
- return;
119870
- }
119871
- if (counter > 1) {
119872
- setTimeout(() => {
119873
- this.setSelectionCount(counter);
119874
- this._showSelectionCounter = true;
119875
- }, this._debounceTimer);
119876
- }
119877
- else {
119878
- this._showSelectionCounter = false;
119879
- setTimeout(this.setSelectionCount.bind(this, counter), this._debounceTimer);
119792
+ this._currentPageSelected = evt.detail.selectionHeaderStatus === true;
119793
+ if (this.dataUnit) {
119794
+ this.setSelection(this.dataUnit.getSelectionInfo());
119880
119795
  }
119881
119796
  }
119882
- setSelectionCount(value = 0) {
119883
- var _a, _b;
119884
- this._selectionCount = value;
119885
- const selectPageRecords = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecords();
119886
- this._selectionPageCount = (_b = selectPageRecords === null || selectPageRecords === void 0 ? void 0 : selectPageRecords.length) !== null && _b !== void 0 ? _b : 0;
119887
- }
119888
- isPaginationActived() {
119797
+ setSelection(selectionInfo) {
119889
119798
  var _a;
119890
- const { total, lastRecord, firstRecord } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
119891
- if (total == undefined || lastRecord == undefined || firstRecord == undefined) {
119892
- return false;
119893
- }
119894
- return Math.ceil(total / (lastRecord - firstRecord + 1)) > 1;
119799
+ this._selectionCount = (_a = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.length) !== null && _a !== void 0 ? _a : 0;
119800
+ this._isAllSelection = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords();
119801
+ this._showSelectionCounter = this._selectionCount > 1 || this._isAllSelection;
119895
119802
  }
119896
119803
  onSelectAllRecords() {
119897
- const allRecord = {
119898
- __record__id__: ALL_RECORD,
119899
- filter: this.dataUnit.getFilters(),
119900
- sort: this.dataUnit.getSort()
119901
- };
119902
- this.setSelection([allRecord]);
119804
+ var _a;
119805
+ (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection(SelectionMode.ALL_RECORDS).then(selection => this.setSelection(selection));
119903
119806
  }
119904
119807
  onSelectPageRecords() {
119905
119808
  var _a;
119906
- (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection().then(() => {
119907
- var _a, _b, _c;
119908
- (_a = this._gridController) === null || _a === void 0 ? void 0 : _a.selectRows((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : []);
119909
- });
119809
+ (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection(this.dataUnit.records.map(record => record.__record__id__)).then(selection => this.setSelection(selection));
119910
119810
  }
119911
119811
  onClearSelectedRecords() {
119912
119812
  var _a;
119913
119813
  (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
119814
+ this.setSelection(undefined);
119914
119815
  }
119915
119816
  createConfigFromState(state) {
119916
119817
  let newConfig = { columns: [] };
@@ -120060,8 +119961,6 @@ const EzGrid = class {
120060
119961
  this._paginationChangedByKeyboard = true;
120061
119962
  }
120062
119963
  this._paginationInfo = paginationInfo;
120063
- this._gridController.updateCheckbox();
120064
- this.controlSelectionCounter();
120065
119964
  },
120066
119965
  onDoubleClick: (row) => {
120067
119966
  this.ezDoubleClick.emit(row);
@@ -120081,10 +119980,10 @@ const EzGrid = class {
120081
119980
  this.configSelectionCounter();
120082
119981
  }
120083
119982
  render() {
120084
- var _a, _b, _c;
119983
+ var _a;
120085
119984
  return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), h("div", { ref: (ref) => this._gridSelectionCounter = ref, class: `grid__selection-counter
120086
119985
  ${this._showSelectionCounter ? "grid__selection-counter--opened" : ""}
120087
- ` }, h(SelectionCounter, { selectionCount: this._selectionCount, selectionPageCount: this._selectionPageCount, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, recordsLength: (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length, onSelectAll: this.onSelectAllRecords.bind(this), onSelectPage: this.onSelectPageRecords.bind(this), onClearAll: this.onClearSelectedRecords.bind(this), onClose: () => this._showSelectionCounter = false })), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
119986
+ ` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => this._showSelectionCounter = false })), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
120088
119987
  }
120089
119988
  static get assetsDirs() { return ["../assets"]; }
120090
119989
  get _element() { return getElement(this); }
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-de655f48.js';
2
2
 
3
- const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
3
+ const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.modal__vertical-padding{padding:var(--ez-modal-vertical-padding) 0}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
4
4
 
5
5
  const EzModal = class {
6
6
  constructor(hostRef) {
@@ -14,6 +14,7 @@ const EzModal = class {
14
14
  };
15
15
  this.modalSize = undefined;
16
16
  this.align = undefined;
17
+ this.heightMode = "regular";
17
18
  this.opened = true;
18
19
  this.closeEsc = false;
19
20
  this.closeOutsideClick = false;
@@ -45,9 +46,11 @@ const EzModal = class {
45
46
  }
46
47
  render() {
47
48
  const positionSufix = this.align === "left" ? "left" : "right";
49
+ const regularVerticalPaddingClass = this.heightMode === "regular" ? 'modal__vertical-padding' : '';
50
+ const modalContentHeightMode = this.heightMode === "regular" ? `modal__content--${positionSufix}` : '';
48
51
  return (h(Host, null, this.opened
49
52
  ?
50
- h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, h("slot", null))))
53
+ h("div", { class: `modal ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
51
54
  :
52
55
  undefined));
53
56
  }
@@ -98,7 +98,7 @@ class RemoteFile {
98
98
  }
99
99
  }
100
100
 
101
- const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;padding-bottom:16px;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:var(--font-pattern, \"Roboto\");text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--ez-upload--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.appearanceNone{width:0px;height:0px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
101
+ const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--text--secondary:var(--text-secondary, #a2abb9);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;padding-bottom:16px;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.padding-large{padding:var(--ez-upload--padding--large) 0px}.padding-extra-small{padding:var(--ez-upload--padding--extra-small) 0px}.text{font-family:var(--font-pattern, \"Roboto\");text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--secondary{color:var(--ez-upload--text--secondary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.appearanceNone{width:0px;height:0px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
102
102
 
103
103
  const EzUpload = class {
104
104
  constructor(hostRef) {
@@ -108,6 +108,7 @@ const EzUpload = class {
108
108
  this.ezCancelWaitingChange = createEvent(this, "ezCancelWaitingChange", 7);
109
109
  this._filePointers = new Map();
110
110
  this.label = undefined;
111
+ this.subtitle = undefined;
111
112
  this.enabled = true;
112
113
  this.maxFileSize = undefined;
113
114
  this.maxFiles = undefined;
@@ -348,7 +349,8 @@ const EzUpload = class {
348
349
  }
349
350
  }
350
351
  render() {
351
- return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, class: "appearanceNone" })));
352
+ return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, h("div", { class: "padding-large" }, h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura")), this.subtitle &&
353
+ h("div", { class: this.evalDisabledClass("padding-extra-small text text--center text--small text--secondary", "text--disabled") }, this.subtitle))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, class: "appearanceNone" })));
352
354
  }
353
355
  buildFooter() {
354
356
  if (this._filePointers.size === 0) {