@sankhyalabs/ezui 1.1.125 → 1.1.126

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 (48) hide show
  1. package/dist/cjs/ez-collapsible-box.cjs.entry.js +22 -9
  2. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  3. package/dist/cjs/ez-grid.cjs.entry.js +112 -22
  4. package/dist/cjs/ez-list.cjs.entry.js +6 -0
  5. package/dist/cjs/ez-text-area.cjs.entry.js +13 -3
  6. package/dist/cjs/ezui.cjs.js +1 -1
  7. package/dist/cjs/grid-config.cjs.entry.js +164 -32
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/ez-check/ez-check.js +1 -1
  10. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +91 -83
  11. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +49 -18
  12. package/dist/collection/components/ez-form/ez-form.css +5 -0
  13. package/dist/collection/components/ez-form/structure/FormItem.js +1 -1
  14. package/dist/collection/components/ez-form/structure/FormSheet.js +1 -1
  15. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +38 -18
  16. package/dist/collection/components/ez-grid/ez-grid.js +117 -7
  17. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +187 -38
  18. package/dist/collection/components/ez-list/ez-list.js +23 -1
  19. package/dist/collection/components/ez-text-area/ez-text-area.js +15 -4
  20. package/dist/custom-elements/index.js +323 -72
  21. package/dist/esm/ez-collapsible-box.entry.js +23 -10
  22. package/dist/esm/ez-form.entry.js +3 -3
  23. package/dist/esm/ez-grid.entry.js +112 -22
  24. package/dist/esm/ez-list.entry.js +6 -0
  25. package/dist/esm/ez-text-area.entry.js +13 -3
  26. package/dist/esm/ezui.js +1 -1
  27. package/dist/esm/grid-config.entry.js +164 -32
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/ezui/ezui.esm.js +1 -1
  30. package/dist/ezui/{p-4262a462.entry.js → p-248d8511.entry.js} +1 -1
  31. package/dist/ezui/p-5a9ab4f7.entry.js +1 -0
  32. package/dist/ezui/p-7d5b2ebf.entry.js +1 -0
  33. package/dist/ezui/p-7f87f762.entry.js +1 -0
  34. package/dist/ezui/p-91706181.entry.js +1 -0
  35. package/dist/ezui/p-b59ab2d5.entry.js +1 -0
  36. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +12 -3
  37. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +35 -1
  38. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -3
  39. package/dist/types/components/ez-grid/ez-grid.d.ts +14 -3
  40. package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +10 -4
  41. package/dist/types/components/ez-list/ez-list.d.ts +5 -0
  42. package/dist/types/components.d.ts +34 -8
  43. package/package.json +2 -2
  44. package/dist/ezui/p-46d1340b.entry.js +0 -1
  45. package/dist/ezui/p-6745931a.entry.js +0 -1
  46. package/dist/ezui/p-7ee0ff27.entry.js +0 -1
  47. package/dist/ezui/p-91e51dc9.entry.js +0 -1
  48. package/dist/ezui/p-c621cab9.entry.js +0 -1
@@ -4,42 +4,55 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0e284e03.js');
6
6
 
7
- const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--height:42px;--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--ez-collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--ez-collapsible-box__btn--image--medium:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--ez-collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--ez-collapsible-box__btn--fill:var(--ez-collapsible-box--color);--ez-collapsible-box__btn--width:10px;--ez-collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--ez-collapsible-box__btn--fill);width:var(--ez-collapsible-box__btn--width);height:var(--ez-collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xsmall);mask-image:var(--ez-collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--small);mask-image:var(--ez-collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--medium);mask-image:var(--ez-collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--large);mask-image:var(--ez-collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xlarge);mask-image:var(--ez-collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
7
+ const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;margin-bottom:var(--space--medium, 12px)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition);--ez-icon--color:var(--ez-collapsible-box__icon--color, --ez-collapsible-box--color)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__content{display:flex;flex-wrap:wrap;overflow:hidden;width:100%;height:0px;max-height:0px;opacity:0;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
8
8
 
9
9
  let EzCollapsibleBox = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.ezChange = index.createEvent(this, "ezChange", 7);
13
13
  /**
14
- * Valor externalizado que garante a exibição ou não do componente
14
+ * Valor externalizado que garante a exibição ou não do componente.
15
15
  */
16
16
  this.value = false;
17
17
  /**
18
18
  * Define o tamanho do texto e do ícone do componente.
19
+ * Tamanhos suportados: "x-small", "small", "medium", "large" e "x-large".
19
20
  */
20
21
  this.headerSize = "small";
21
22
  /**
22
23
  * Define o local onde o ícone será renderizado.
23
24
  */
24
25
  this.iconPlacement = "left";
26
+ /**
27
+ * Define se o titulo irá ocupar toda a largura do componente.
28
+ */
29
+ this.stretchTitle = false;
25
30
  }
26
- observeValue() {
31
+ observeCollapsedValue() {
27
32
  this.ezChange.emit(this.value);
28
33
  }
29
34
  /**
30
- * Esconde ou revela o conteúdo do componente
35
+ * Esconde ou revela o conteúdo do componente.
31
36
  */
32
37
  async showHide() {
33
38
  this.value = !this.value;
34
39
  }
40
+ /**
41
+ * Retorna o tamanho configurado do texto e do ícone.
42
+ */
43
+ getHeaderSize() {
44
+ const sizeAlias = ["xsmall", "xlarge"];
45
+ const sizeList = ["x-small", "small", "medium", "large", "x-large"];
46
+ const headerSize = sizeAlias.includes(this.headerSize) ? this.headerSize.replace('x', 'x-') : this.headerSize;
47
+ return sizeList.includes(headerSize) ? headerSize : "small";
48
+ }
35
49
  render() {
36
- return (index.h(index.Host, null, this.iconPlacement == "right" ?
37
- index.h("div", { class: "collapsible-box__title" }, index.h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label), index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }))
38
- :
39
- index.h("div", { class: "collapsible-box__title" }, index.h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }), index.h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label)), !this.value ? index.h("slot", null) : null));
50
+ return (index.h("div", { class: "collapsible-box" }, index.h("div", { class: "collapsible-box__header" }, index.h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
51
+ (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
52
+ (this.stretchTitle ? " collapsible-box__title--stretched" : "") }, index.h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), index.h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), index.h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, index.h("slot", null))));
40
53
  }
41
54
  static get watchers() { return {
42
- "value": ["observeValue"]
55
+ "value": ["observeCollapsedValue"]
43
56
  }; }
44
57
  };
45
58
  EzCollapsibleBox.style = ezCollapsibleBoxCss;
@@ -122,7 +122,7 @@ const buildField = (field) => {
122
122
  const FormItem = ({ source }) => {
123
123
  if ("items" in source) {
124
124
  const fieldSet = source;
125
- return index.h("ez-collapsible-box", { label: source.label }, fieldSet.items.map(fi => buildField(fi)));
125
+ return index.h("ez-collapsible-box", { label: source.label, "header-size": "large" }, fieldSet.items.map(fi => buildField(fi)));
126
126
  }
127
127
  else {
128
128
  return buildField(source);
@@ -130,7 +130,7 @@ const FormItem = ({ source }) => {
130
130
  };
131
131
 
132
132
  const FormSheet = ({ store, source }) => {
133
- return (index.h("div", { class: "box__container" },
133
+ return (index.h("div", { class: "dynamic-content box__container" },
134
134
  index.h("div", { class: "row padding-vertical--small" }, source.items.map(item => index.h(FormItem, { store: store, source: item })))));
135
135
  };
136
136
 
@@ -708,7 +708,7 @@ class Bind {
708
708
  }
709
709
  }
710
710
 
711
- const ezFormCss = "ez-form{display:flex;flex-direction:column;width:100%}";
711
+ const ezFormCss = "ez-form{display:flex;flex-direction:column;width:100%}.dynamic-content ez-collapsible-box{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";
712
712
 
713
713
  let EzForm = class {
714
714
  constructor(hostRef) {
@@ -110100,6 +110100,7 @@ class AgGridController {
110100
110100
  serverSideStoreType: "partial",
110101
110101
  rowSelection: this._multipleSelection ? "multiple" : "single",
110102
110102
  serverSideDatasource: this._dataSource,
110103
+ sortingOrder: ['desc', 'asc', null],
110103
110104
  getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
110104
110105
  getMainMenuItems: (params) => {
110105
110106
  const column = params.column;
@@ -110139,6 +110140,7 @@ class AgGridController {
110139
110140
  opt.onSelectionChanged = e => this.onSelectionChange(e);
110140
110141
  opt.onPaginationChanged = () => this.onPaginationChange();
110141
110142
  opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
110143
+ opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
110142
110144
  opt.onViewportChanged = () => {
110143
110145
  if (this._dataUnit) {
110144
110146
  this.selectRows(this._dataUnit.getSelection());
@@ -110226,6 +110228,7 @@ class AgGridController {
110226
110228
  const colDefs = [];
110227
110229
  if (showCheckSelection) {
110228
110230
  colDefs.push({
110231
+ colId: "checkBoxColumn",
110229
110232
  headerName: "",
110230
110233
  checkboxSelection: true,
110231
110234
  headerCheckboxSelection: false,
@@ -110263,13 +110266,24 @@ class AgGridController {
110263
110266
  if (this._grid === undefined) {
110264
110267
  throw new Error("Erro interno: Grid ainda não inicializado.");
110265
110268
  }
110266
- //TODO neste ponto estamos utilizando um método descontinuado,
110267
- //pelo fato de que o applyColumnState não reordena as colunas conforme
110268
- //o estado passado.
110269
- //https://stackoverflow.com/questions/51488241/ag-grid-how-to-save-and-reload-column-order
110270
- //Assim que for corrigido o applyColumnState devemos substituir o setColumnState por ele.
110271
- // this._gridOptions.columnApi.applyColumnState({ state: state.map(s => this.buildColState(s)) });
110272
- this._gridOptions.columnApi.setColumnState(state.map(s => this.buildColState(s)));
110269
+ let columns = this.getColumnsDef();
110270
+ let visibleColumns = [];
110271
+ let sort = [];
110272
+ state.forEach((cfgColumn, index) => {
110273
+ this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + 1);
110274
+ this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, cfgColumn.width);
110275
+ visibleColumns.push(cfgColumn.name);
110276
+ if (cfgColumn.ascending !== undefined) {
110277
+ sort.push({ colId: cfgColumn.name, sort: cfgColumn.ascending !== true ? 'desc' : 'asc', sortIndex: cfgColumn.orderIndex });
110278
+ }
110279
+ });
110280
+ let invisibleColumns = columns.filter(column => !visibleColumns.includes(column.name)).map(column => column.name);
110281
+ this._gridOptions.columnApi.setColumnsVisible(visibleColumns, true);
110282
+ this._gridOptions.columnApi.setColumnsVisible(invisibleColumns, false);
110283
+ this._gridOptions.columnApi.applyColumnState({
110284
+ state: sort,
110285
+ defaultState: { sort: null },
110286
+ });
110273
110287
  }
110274
110288
  getColumnsState() {
110275
110289
  if (this._grid === undefined) {
@@ -110362,21 +110376,27 @@ class AgGridController {
110362
110376
  }
110363
110377
  }
110364
110378
  }
110365
- buildColState(source) {
110366
- return {
110367
- colId: source.name,
110368
- sort: source.sort,
110369
- sortIndex: source.sortIndex,
110370
- width: source.width,
110371
- pinned: source.pinned ? "left" : null,
110372
- hide: source.hidden
110373
- };
110374
- }
110375
110379
  onCallStateChange(type, e) {
110376
110380
  const finished = !("finished" in e) || e["finished"];
110377
110381
  if (finished && this._columnStateChangeCallback) {
110378
- this._columnStateChangeCallback(type, this.getColumnsState());
110382
+ let info = {};
110383
+ let isUserChange = this.isUIEvent(e['source'], e['type']);
110384
+ if (type === 'columnResize') {
110385
+ info['column'] = { colId: e['column'].colId, actualWidth: e['column'].actualWidth };
110386
+ }
110387
+ info['isUserChange'] = isUserChange;
110388
+ this._columnStateChangeCallback(type, this.getColumnsState(), info);
110389
+ }
110390
+ }
110391
+ isUIEvent(source, type) {
110392
+ let optionsArr = ["uiColumnMoved", "uiColumnResized", "uiColumnDragged", "uiColumnExpanded", "uiColumnSorted"];
110393
+ if (type === 'dragStopped') {
110394
+ return true;
110395
+ }
110396
+ if (source) {
110397
+ return optionsArr.includes(source);
110379
110398
  }
110399
+ return false;
110380
110400
  }
110381
110401
  onSelectionChange(e) {
110382
110402
  if (this._selectionChangeCallback) {
@@ -110474,6 +110494,7 @@ let EzGrid = class {
110474
110494
  this.ezColumnStateChange = index.createEvent(this, "ezColumnStateChange", 7);
110475
110495
  this.ezSelectionChange = index.createEvent(this, "ezSelectionChange", 7);
110476
110496
  this.ezDoubleClick = index.createEvent(this, "ezDoubleClick", 7);
110497
+ this.configChange = index.createEvent(this, "configChange", 7);
110477
110498
  this._gridController = new AgGridController(false);
110478
110499
  this._popUpVisible = false;
110479
110500
  /**
@@ -110543,9 +110564,72 @@ let EzGrid = class {
110543
110564
  addEventListener("ezSelectionChange", (evt) => this.dataUnit.setSelection(evt.detail.map((r) => r.__record__id__)));
110544
110565
  }
110545
110566
  }
110567
+ onColumnStateChange(type, state, info) {
110568
+ var _a;
110569
+ this.ezColumnStateChange.emit({ type, state, isUserChange: info.isUserChange });
110570
+ if (info.isUserChange) {
110571
+ if (type === 'columnMovedEnd') {
110572
+ let newConfig;
110573
+ if (this.config) {
110574
+ newConfig = { columns: [] };
110575
+ state.forEach(columnState => {
110576
+ let newConfigColumn = this.config.columns.find(column => column.name === columnState.name);
110577
+ if (newConfigColumn) {
110578
+ newConfigColumn.width = columnState.width;
110579
+ newConfig.columns.push(newConfigColumn);
110580
+ }
110581
+ });
110582
+ }
110583
+ else {
110584
+ newConfig = this.createConfigFromState(state);
110585
+ }
110586
+ if (newConfig.columns.length > 0) {
110587
+ this.configChange.emit(newConfig);
110588
+ }
110589
+ }
110590
+ else if (type === 'columnResize') {
110591
+ if ((_a = info.column) === null || _a === void 0 ? void 0 : _a.colId) {
110592
+ let newConfig;
110593
+ if (this.config) {
110594
+ newConfig = Object.assign({}, this.config);
110595
+ }
110596
+ else {
110597
+ newConfig = this.createConfigFromState(state);
110598
+ }
110599
+ let newColumn = newConfig.columns.find(column => column.name === info.column.colId);
110600
+ if (newColumn) {
110601
+ newColumn.width = info.column.actualWidth;
110602
+ this.configChange.emit(newConfig);
110603
+ }
110604
+ }
110605
+ }
110606
+ }
110607
+ }
110608
+ createConfigFromState(state) {
110609
+ let newConfig = { columns: [] };
110610
+ state.forEach(columnState => {
110611
+ if (!columnState.hidden) {
110612
+ let newConfigColumn = { name: columnState.name };
110613
+ if (columnState.width) {
110614
+ newConfigColumn['width'] = columnState.width;
110615
+ }
110616
+ if (columnState.sort) {
110617
+ newConfigColumn['ascending'] = (columnState.sort.toUpperCase() === 'ASC');
110618
+ newConfigColumn['orderIndex'] = columnState.sortIndex;
110619
+ }
110620
+ else {
110621
+ newConfigColumn['orderIndex'] = 0;
110622
+ }
110623
+ if (newConfigColumn) {
110624
+ newConfig.columns.push(newConfigColumn);
110625
+ }
110626
+ }
110627
+ });
110628
+ return newConfig;
110629
+ }
110546
110630
  componentDidLoad() {
110547
110631
  this._gridController.initDatagrid(this._container, {
110548
- onColumnStateChange: (type, state) => this.ezColumnStateChange.emit({ type, state }),
110632
+ onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
110549
110633
  onSelectionChange: (selection) => this.ezSelectionChange.emit(selection),
110550
110634
  onPaginationChange: (status) => {
110551
110635
  this._navigationHasPrevious = status.hasPrevious;
@@ -110565,6 +110649,9 @@ let EzGrid = class {
110565
110649
  if (this._dataUnitBridge) {
110566
110650
  this._gridController.setColumnsDef(this._dataUnitBridge.buildColumnDefs(), true);
110567
110651
  }
110652
+ if (this.config) {
110653
+ this.applyConfig(this.config);
110654
+ }
110568
110655
  }
110569
110656
  disconnectedCallback() {
110570
110657
  if (this._dataUnitBridge) {
@@ -110581,8 +110668,8 @@ let EzGrid = class {
110581
110668
  index.h("ez-button", { size: "small", iconName: "chevron-right", class: "margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this._gridController.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
110582
110669
  ];
110583
110670
  }
110584
- applyConfig(cols) {
110585
- this._gridController.setColumnsState(cols);
110671
+ applyConfig(config) {
110672
+ this._gridController.setColumnsState(config.columns);
110586
110673
  this.closeConfig();
110587
110674
  }
110588
110675
  closeConfig() {
@@ -110594,9 +110681,12 @@ let EzGrid = class {
110594
110681
  this._popUpVisible = true;
110595
110682
  }
110596
110683
  render() {
110597
- return (index.h(index.Host, null, index.h("div", { class: "box box--shadow padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl(), index.h("ez-button", { size: "small", iconName: "settings", class: "button--secondary", mode: "icon", onClick: () => { this.openConfig(); } }))), index.h("div", { class: "grid__container ag-sankhya-theme", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }), index.h("ez-modal", { modalSize: "small", closeEsc: true, closeOutsideClick: true, opened: this._popUpVisible, onEzCloseModal: () => this._popUpVisible = false }, index.h("grid-config", { ref: ref => this._gridConfig = ref, selectedTab: "Colunas", onConfigFinish: evt => this.applyConfig(evt.detail), onConfigCancel: _evt => this.closeConfig() }))));
110684
+ return (index.h(index.Host, null, index.h("div", { class: "box box--shadow padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl(), index.h("ez-button", { size: "small", iconName: "settings", class: "button--secondary", mode: "icon", onClick: () => { this.openConfig(); } }))), index.h("div", { class: "grid__container ag-sankhya-theme", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }), index.h("ez-modal", { modalSize: "small", closeEsc: true, closeOutsideClick: true, opened: this._popUpVisible, onEzCloseModal: () => this._popUpVisible = false }, index.h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.applyConfig(evt.detail); this.configChange.emit(evt.detail); }, onConfigCancel: _evt => this.closeConfig() }))));
110598
110685
  }
110599
110686
  static get assetsDirs() { return ["../assets"]; }
110687
+ static get watchers() { return {
110688
+ "config": ["applyConfig"]
110689
+ }; }
110600
110690
  };
110601
110691
  EzGrid.style = ezGridCss;
110602
110692
 
@@ -53,6 +53,12 @@ let EzList = class {
53
53
  }
54
54
  }
55
55
  /**
56
+ * Responsável por limpar a lista de histórico do componente.
57
+ */
58
+ async clearHistory() {
59
+ this._listItemsHistory = [];
60
+ }
61
+ /**
56
62
  * Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
57
63
  */
58
64
  async setSelection(selectedItem, scrollToOption) {
@@ -14,6 +14,10 @@ let EzTextArea = class {
14
14
  * Deixa o campo disponível ou não para digitação.
15
15
  */
16
16
  this.enabled = true;
17
+ /**
18
+ * Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
19
+ */
20
+ this.rows = 4;
17
21
  /**
18
22
  * Permite exibir a mensagem de erro.
19
23
  */
@@ -45,11 +49,17 @@ let EzTextArea = class {
45
49
  if (this._initialRows == undefined) {
46
50
  this._initialRows = this.rows > 0 ? this.rows : undefined;
47
51
  }
48
- this.rows = this._initialRows > 0 ? this._initialRows : this.mode != "slim" ? 4 : 2;
52
+ const rows = this._initialRows > 0 ? this._initialRows : this.mode != "slim" ? 4 : 2;
53
+ if (rows !== this.rows) {
54
+ this.rows = rows;
55
+ }
49
56
  }
50
57
  adjustRowsValue() {
51
- this.rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
52
- this._initialRows = this.rows;
58
+ const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
59
+ if (rows !== this.rows) {
60
+ this.rows = rows;
61
+ this._initialRows = rows;
62
+ }
53
63
  }
54
64
  adjustFloatingLabel() {
55
65
  if (this.label && this._labelElem) {
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
18
+ return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040],"config":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"],"showHide":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]]], options);
19
19
  });