@sankhyalabs/ezui 1.1.79 → 1.1.82

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 (91) hide show
  1. package/dist/cjs/ApplicationUtils-d1c1db56.js +35 -0
  2. package/dist/cjs/{AssetsUtils-02db4f46.js → AssetsUtils-caf95dab.js} +1 -1
  3. package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  5. package/dist/cjs/{ez-grid.cjs.entry.js → ez-button_11.cjs.entry.js} +1448 -22
  6. package/dist/cjs/ez-calendar.cjs.entry.js +217 -0
  7. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +853 -0
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +254 -0
  9. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-form.cjs.entry.js +728 -0
  11. package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-popover.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-time-input.cjs.entry.js +3 -3
  15. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  16. package/dist/cjs/ezui.cjs.js +2 -2
  17. package/dist/cjs/{index-2003dec4.js → index-0bce1636.js} +3 -0
  18. package/dist/cjs/{index-a2266984.js → index-d5d5a77c.js} +84 -56
  19. package/dist/cjs/loader.cjs.js +2 -2
  20. package/dist/collection/components/ez-form/DataBinder.js +7 -1
  21. package/dist/collection/components/ez-form/ez-form.js +6 -2
  22. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +2 -1
  23. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -0
  24. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +10 -7
  25. package/dist/collection/components/ez-grid/ez-grid.css +4 -1
  26. package/dist/collection/components/ez-grid/ez-grid.js +4 -0
  27. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +1 -1
  28. package/dist/collection/components/test-du/test-du.js +3 -27
  29. package/dist/custom-elements/index.js +106 -77
  30. package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
  31. package/dist/esm/{AssetsUtils-76ca41e1.js → AssetsUtils-9b1d9c38.js} +1 -1
  32. package/dist/esm/ez-action-chip.entry.js +1 -1
  33. package/dist/esm/ez-application.entry.js +1 -1
  34. package/dist/esm/{ez-grid.entry.js → ez-button_11.entry.js} +1428 -12
  35. package/dist/esm/ez-calendar.entry.js +213 -0
  36. package/dist/esm/ez-collapsible-box_7.entry.js +843 -0
  37. package/dist/esm/ez-combo-box.entry.js +250 -0
  38. package/dist/esm/ez-dialog.entry.js +1 -1
  39. package/dist/esm/ez-form.entry.js +724 -0
  40. package/dist/esm/ez-label-chip.entry.js +1 -1
  41. package/dist/esm/ez-popover.entry.js +2 -2
  42. package/dist/esm/ez-popup.entry.js +1 -1
  43. package/dist/esm/ez-time-input.entry.js +3 -3
  44. package/dist/esm/ez-toast.entry.js +1 -1
  45. package/dist/esm/ezui.js +2 -2
  46. package/dist/esm/{index-afe19542.js → index-2bb35caf.js} +85 -57
  47. package/dist/esm/{index-077c7fcf.js → index-d80a8d1f.js} +3 -0
  48. package/dist/esm/loader.js +2 -2
  49. package/dist/ezui/ezui.esm.js +1 -1
  50. package/dist/ezui/{p-57ea4b84.entry.js → p-091b27f2.entry.js} +1 -1
  51. package/dist/ezui/{p-6d157776.entry.js → p-19d8a928.entry.js} +1 -1
  52. package/dist/ezui/{p-7a1f2e0e.entry.js → p-2bb74de5.entry.js} +1 -1
  53. package/dist/ezui/p-3749c696.js +1 -0
  54. package/dist/ezui/{p-a4a39579.entry.js → p-39218c31.entry.js} +1 -1
  55. package/dist/ezui/{p-5509ee41.entry.js → p-48eddf77.entry.js} +46 -46
  56. package/dist/ezui/p-513f2d2e.entry.js +1 -0
  57. package/dist/ezui/{p-da31cd21.entry.js → p-6206515e.entry.js} +1 -1
  58. package/dist/ezui/p-7107d7ef.js +1 -0
  59. package/dist/ezui/{p-7de3c95d.js → p-7c101b34.js} +1 -1
  60. package/dist/ezui/{p-920bb8c9.entry.js → p-a52b3368.entry.js} +1 -1
  61. package/dist/ezui/{p-0a2056d9.entry.js → p-b678dc80.entry.js} +1 -1
  62. package/dist/ezui/p-c151c043.entry.js +1 -0
  63. package/dist/ezui/p-da6ac011.entry.js +1 -0
  64. package/dist/ezui/p-e346a7ff.entry.js +1 -0
  65. package/dist/ezui/{p-857ead8e.entry.js → p-ec261c08.entry.js} +1 -1
  66. package/dist/ezui/p-f87c7082.js +1 -0
  67. package/dist/types/components/ez-form/ez-form.d.ts +1 -0
  68. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
  69. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +2 -1
  70. package/dist/types/components/test-du/test-du.d.ts +0 -6
  71. package/package.json +2 -2
  72. package/dist/cjs/DateUtils-716769e0.js +0 -46
  73. package/dist/cjs/ez-button_3.cjs.entry.js +0 -520
  74. package/dist/cjs/ez-calendar_13.cjs.entry.js +0 -2417
  75. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -133
  76. package/dist/cjs/ez-icon.cjs.entry.js +0 -30
  77. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -370
  78. package/dist/esm/DateUtils-0a1bbd7a.js +0 -44
  79. package/dist/esm/ez-button_3.entry.js +0 -514
  80. package/dist/esm/ez-calendar_13.entry.js +0 -2401
  81. package/dist/esm/ez-date-time-input.entry.js +0 -129
  82. package/dist/esm/ez-icon.entry.js +0 -26
  83. package/dist/esm/ez-modal_2.entry.js +0 -365
  84. package/dist/ezui/p-00b837e2.js +0 -1
  85. package/dist/ezui/p-0d8368fc.entry.js +0 -1
  86. package/dist/ezui/p-1e36e3ff.entry.js +0 -1
  87. package/dist/ezui/p-446ec85b.js +0 -1
  88. package/dist/ezui/p-9be02ecf.entry.js +0 -1
  89. package/dist/ezui/p-c89629eb.js +0 -1
  90. package/dist/ezui/p-d5699f29.entry.js +0 -1
  91. package/dist/ezui/p-d64a3939.entry.js +0 -1
@@ -1128,11 +1128,7 @@ class AddedRecordsReducerImpl {
1128
1128
  reduce(_stateManager, currentState, action) {
1129
1129
  switch (action.type) {
1130
1130
  case Action.RECORDS_ADDED:
1131
- const newState = currentState ? currentState.slice() : [];
1132
- action.payload.forEach((r) => {
1133
- newState.push(Object.assign({ __record__id__: "NEW_" + (newState.length + 1) }, r));
1134
- });
1135
- return newState;
1131
+ return (currentState || []).concat(action.payload);
1136
1132
  case Action.DATA_SAVED:
1137
1133
  case Action.EDITION_CANCELED:
1138
1134
  return undefined;
@@ -1144,6 +1140,10 @@ const AddedRecordsReducer = new AddedRecordsReducerImpl();
1144
1140
  const getAddedRecords = (stateManager) => {
1145
1141
  return stateManager.select(AddedRecordsReducer.sliceName, (state) => state);
1146
1142
  };
1143
+ const prepareAddedRecordId = (stateManager, source) => {
1144
+ let index = (getAddedRecords(stateManager) || []).length;
1145
+ return source.map(item => { return Object.assign(Object.assign({}, item), { __record__id__: "NEW_" + (index++) }); });
1146
+ };
1147
1147
 
1148
1148
  class ChangesReducerImpl {
1149
1149
  constructor() {
@@ -1156,7 +1156,9 @@ class ChangesReducerImpl {
1156
1156
  if (selection) {
1157
1157
  const newState = new Map(currentState);
1158
1158
  selection.forEach(recordId => {
1159
- newState.set(recordId, Object.assign(Object.assign({}, newState.get(recordId)), action.payload));
1159
+ const newChanges = Object.assign(Object.assign({}, newState.get(recordId)), action.payload);
1160
+ delete newChanges.records;
1161
+ newState.set(recordId, newChanges);
1160
1162
  });
1161
1163
  return newState;
1162
1164
  }
@@ -1185,16 +1187,14 @@ const getChangesToSave = (dataUnit, stateManager) => {
1185
1187
  const result = [];
1186
1188
  const changes = getChanges(stateManager);
1187
1189
  const records = getRecords(stateManager);
1188
- if (records) {
1189
- records.forEach(r => {
1190
- if (changes) {
1191
- const c = changes.get(r.__record__id__);
1192
- if (c) {
1193
- result.push(new Change(dataUnit, r, c, ChangeOperation.UPDATE));
1194
- }
1190
+ records === null || records === void 0 ? void 0 : records.forEach(r => {
1191
+ if (changes) {
1192
+ const c = changes.get(r.__record__id__);
1193
+ if (c) {
1194
+ result.push(new Change(dataUnit, r, c, ChangeOperation.UPDATE));
1195
1195
  }
1196
- });
1197
- }
1196
+ }
1197
+ });
1198
1198
  const addedRecords = getAddedRecords(stateManager);
1199
1199
  if (addedRecords) {
1200
1200
  addedRecords.forEach(r => {
@@ -1203,7 +1203,7 @@ const getChangesToSave = (dataUnit, stateManager) => {
1203
1203
  }
1204
1204
  const removedRecords = getRemovedRecords(stateManager);
1205
1205
  const recordsById = {};
1206
- records.forEach(r => recordsById[r.__record__id__] = r);
1206
+ records === null || records === void 0 ? void 0 : records.forEach(r => recordsById[r.__record__id__] = r);
1207
1207
  if (removedRecords) {
1208
1208
  removedRecords.forEach(id => {
1209
1209
  result.push(new Change(dataUnit, recordsById[id], undefined, ChangeOperation.DELETE));
@@ -1259,6 +1259,8 @@ class SelectionReducerImpl {
1259
1259
  }
1260
1260
  reduce(stateManager, currentState, action) {
1261
1261
  switch (action.type) {
1262
+ case Action.RECORDS_ADDED:
1263
+ return action.payload.map((r) => r.__record__id__);
1262
1264
  case Action.DATA_SAVED:
1263
1265
  return updateSavedIds(stateManager, action.payload.records);
1264
1266
  case Action.RECORDS_REMOVED:
@@ -1360,6 +1362,15 @@ function updateSavedIds(stateManager, savedRecords) {
1360
1362
  return currentSelection;
1361
1363
  }
1362
1364
 
1365
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1366
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1367
+ return new (P || (P = Promise))(function (resolve, reject) {
1368
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1369
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1370
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1371
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1372
+ });
1373
+ };
1363
1374
  class DataUnit {
1364
1375
  constructor(name) {
1365
1376
  this._name = name;
@@ -1401,32 +1412,46 @@ class DataUnit {
1401
1412
  }
1402
1413
  // Loaders
1403
1414
  loadMetadata() {
1404
- this.dispatchAction(Action.LOADING_METADATA);
1405
- if (this.metadataLoader) {
1406
- this.metadataLoader(this._name).then(metadata => this.metadata = metadata);
1407
- }
1415
+ return __awaiter(this, void 0, void 0, function* () {
1416
+ this.dispatchAction(Action.LOADING_METADATA);
1417
+ return new Promise((resolve, fail) => {
1418
+ if (this.metadataLoader) {
1419
+ this.metadataLoader(this._name).then(metadata => {
1420
+ this.metadata = metadata;
1421
+ resolve(this.metadata);
1422
+ }).catch(error => fail(error));
1423
+ }
1424
+ });
1425
+ });
1408
1426
  }
1409
1427
  loadData() {
1410
- this.dispatchAction(Action.LOADING_DATA);
1411
- return new Promise((resolve, fail) => {
1412
- if (this.dataLoader) {
1413
- const sort = this.getSort();
1414
- const filters = this.getFilters();
1415
- this.dataLoader(this._name, sort, filters).then(records => {
1416
- this.records = records;
1417
- resolve(this.records);
1418
- }).catch(() => fail());
1419
- }
1428
+ return __awaiter(this, void 0, void 0, function* () {
1429
+ this.dispatchAction(Action.LOADING_DATA);
1430
+ return new Promise((resolve, fail) => {
1431
+ if (this.dataLoader) {
1432
+ const sort = this.getSort();
1433
+ const filters = this.getFilters();
1434
+ this.dataLoader(this._name, sort, filters).then(records => {
1435
+ this.records = records;
1436
+ resolve(this.records);
1437
+ }).catch(error => fail(error));
1438
+ }
1439
+ });
1420
1440
  });
1421
1441
  }
1422
1442
  saveData() {
1423
- const changes = getChangesToSave(this._name, this._stateManager);
1424
- if (changes.length > 0) {
1425
- this.dispatchAction(Action.SAVING_DATA);
1426
- if (this.saveLoader) {
1427
- this.saveLoader(this._name, changes).then(records => this.dispatchAction(Action.DATA_SAVED, { changes, records }));
1443
+ return __awaiter(this, void 0, void 0, function* () {
1444
+ const changes = getChangesToSave(this._name, this._stateManager);
1445
+ if (changes.length > 0) {
1446
+ this.dispatchAction(Action.SAVING_DATA);
1447
+ return new Promise((resolve, fail) => {
1448
+ if (this.saveLoader) {
1449
+ this.saveLoader(this._name, changes).then(records => this.dispatchAction(Action.DATA_SAVED, { changes, records })).catch(error => fail(error));
1450
+ }
1451
+ });
1428
1452
  }
1429
- }
1453
+ return Promise.resolve();
1454
+ });
1430
1455
  }
1431
1456
  // API
1432
1457
  addFilterProvider(provider) {
@@ -1452,7 +1477,7 @@ class DataUnit {
1452
1477
  return getField(this._stateManager, fieldName);
1453
1478
  }
1454
1479
  addRecord() {
1455
- this.dispatchAction(Action.RECORDS_ADDED, [{}]);
1480
+ this.dispatchAction(Action.RECORDS_ADDED, prepareAddedRecordId(this._stateManager, [{}]));
1456
1481
  }
1457
1482
  removeSelectedRecords() {
1458
1483
  const selection = getSelection(this._stateManager);
@@ -1525,9 +1550,9 @@ class DataUnit {
1525
1550
  }
1526
1551
  var ChangeOperation;
1527
1552
  (function (ChangeOperation) {
1528
- ChangeOperation[ChangeOperation["INSERT"] = 0] = "INSERT";
1529
- ChangeOperation[ChangeOperation["UPDATE"] = 1] = "UPDATE";
1530
- ChangeOperation[ChangeOperation["DELETE"] = 2] = "DELETE";
1553
+ ChangeOperation["INSERT"] = "INSERT";
1554
+ ChangeOperation["UPDATE"] = "UPDATE";
1555
+ ChangeOperation["DELETE"] = "DELETE";
1531
1556
  })(ChangeOperation || (ChangeOperation = {}));
1532
1557
  class Change {
1533
1558
  constructor(dataUnit, record, updates, operation) {
@@ -1536,6 +1561,9 @@ class Change {
1536
1561
  this.updatingFields = updates;
1537
1562
  this._operation = operation;
1538
1563
  }
1564
+ get operation() {
1565
+ return this._operation.toString();
1566
+ }
1539
1567
  isInsert() {
1540
1568
  return this._operation === ChangeOperation.INSERT;
1541
1569
  }
@@ -8654,6 +8682,10 @@ const buildDate = ({ name, label }) => {
8654
8682
  return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
8655
8683
  h("ez-date-input", { label: label, "data-field-name": name, key: name })));
8656
8684
  };
8685
+ const buildTimeDate = ({ name, label }) => {
8686
+ return (h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
8687
+ h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
8688
+ };
8657
8689
 
8658
8690
  const buildDecimal = ({ name, label }, properties) => {
8659
8691
  const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
@@ -8676,6 +8708,7 @@ uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
8676
8708
  uiBuilders.set(UserInterface.SEARCH, buildSearch);
8677
8709
  uiBuilders.set(UserInterface.FILE, buildFile);
8678
8710
  uiBuilders.set(UserInterface.DATE, buildDate);
8711
+ uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
8679
8712
  uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
8680
8713
  uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
8681
8714
  const buildField = (field) => {
@@ -9170,8 +9203,14 @@ var FormActions;
9170
9203
 
9171
9204
  class DataBinder {
9172
9205
  constructor(dataUnit) {
9173
- this._dataUnit = dataUnit;
9174
9206
  this._fields = new Map();
9207
+ this._dataUnit = dataUnit;
9208
+ this._dataUnit.subscribe(_action => {
9209
+ var _a;
9210
+ (_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
9211
+ this.updateValue(field.fieldName, field.field);
9212
+ });
9213
+ });
9175
9214
  }
9176
9215
  bind(fields) {
9177
9216
  fields.forEach(fieldElement => {
@@ -9312,11 +9351,15 @@ let EzForm$1 = class extends HTMLElement$1 {
9312
9351
  return result;
9313
9352
  }
9314
9353
  processMetadata() {
9315
- if (!this._staticFields || this._staticFields.length === 0) {
9354
+ if (!this.isStatic()) {
9316
9355
  const metadata = this.config && this.config.length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
9317
9356
  this._store.dispatch(loadMetadata(metadata));
9318
9357
  }
9319
9358
  }
9359
+ isStatic() {
9360
+ var _a;
9361
+ return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
9362
+ }
9320
9363
  componentWillLoad() {
9321
9364
  if (this.dataUnit === undefined) {
9322
9365
  this.dataUnit = new DataUnit("ez-form");
@@ -9336,7 +9379,7 @@ let EzForm$1 = class extends HTMLElement$1 {
9336
9379
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
9337
9380
  }
9338
9381
  render() {
9339
- return (h(Host, null, this._staticFields.length > 0 ? null : this.getDynamicContent()));
9382
+ return (h(Host, null, this.isStatic() ? null : this.getDynamicContent()));
9340
9383
  }
9341
9384
  get _element() { return this; }
9342
9385
  static get style() { return ezFormCss; }
@@ -119605,19 +119648,22 @@ class DataUnitBridge {
119605
119648
  processAction(action) {
119606
119649
  switch (action.type) {
119607
119650
  case Action.METADATA_LOADED:
119608
- const columnDefs = [];
119609
- this._dataUnit.metadata.fields.forEach(f => {
119610
- if (f.visible !== false) {
119611
- columnDefs.push({ label: f.label, name: f.name });
119612
- }
119613
- });
119614
- this._gridController.setColumnsDef(columnDefs, true);
119651
+ this._gridController.setColumnsDef(this.buildColumnDefs(), true);
119615
119652
  break;
119616
119653
  }
119617
119654
  }
119655
+ buildColumnDefs() {
119656
+ const columnDefs = [];
119657
+ this._dataUnit.metadata.fields.forEach(f => {
119658
+ if (f.visible !== false) {
119659
+ columnDefs.push({ label: f.label, name: f.name });
119660
+ }
119661
+ });
119662
+ return columnDefs;
119663
+ }
119618
119664
  }
119619
119665
 
119620
- const ezGridCss = ":host{--ezgrid__header--background-color:var(--background--xlight, #FFF)}.grid__header{display:flex;justify-content:flex-end;align-items:center;background-color:var(--ezgrid__header--background-color)}";
119666
+ const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ezgrid__header--background-color:var(--background--xlight, #FFF)}.grid__header.sc-ez-grid{display:flex;justify-content:flex-end;align-items:center;background-color:var(--ezgrid__header--background-color)}";
119621
119667
 
119622
119668
  let EzGrid$1 = class extends HTMLElement$1 {
119623
119669
  constructor() {
@@ -119698,6 +119744,9 @@ let EzGrid$1 = class extends HTMLElement$1 {
119698
119744
  serverURL: this.serverUrl,
119699
119745
  dataUnit: this.dataUnit
119700
119746
  });
119747
+ if (this._dataUnitBridge) {
119748
+ this._gridController.setColumnsDef(this._dataUnitBridge.buildColumnDefs(), true);
119749
+ }
119701
119750
  }
119702
119751
  getPaginationControl() {
119703
119752
  if (this.pageSize === -1) {
@@ -121593,13 +121642,12 @@ let EzUpload$1 = class extends HTMLElement$1 {
121593
121642
  static get style() { return ezUploadCss; }
121594
121643
  };
121595
121644
 
121596
- const gridConfigCss = ":host{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-weight:var(--text-weight--large, 14px);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__main__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__main__scrollbar--border-radius:var(--border--radius-medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.padding-right--medium{padding-right:var(--space--medium)}ez-list{height:100%}.grid-config__footer{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden{display:none}.grid-config__main{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container{display:flex;justify-content:center;align-items:center}.subtitle{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size)}.title{display:flex;font-family:var(--ez-grid-config__title--font-family);margin:0;font-weight:var(--ez-grid-config__title--font-weight);line-height:1.3}.grid-config__main::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__main__scrollbar--background-color);border-radius:var(--ez-grid-config__main__scrollbar--border-radius)}.grid-config__main::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}";
121645
+ const gridConfigCss = ".sc-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-weight:var(--text-weight--large, 14px);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__main__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__main__scrollbar--border-radius:var(--border--radius-medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.padding-right--medium.sc-grid-config{padding-right:var(--space--medium)}ez-list.sc-grid-config{height:100%}.grid-config__footer.sc-grid-config{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden.sc-grid-config{display:none}.grid-config__main.sc-grid-config{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container.sc-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-grid-config{display:flex;justify-content:center;align-items:center}.subtitle.sc-grid-config{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size)}.title.sc-grid-config{display:flex;font-family:var(--ez-grid-config__title--font-family);margin:0;font-weight:var(--ez-grid-config__title--font-weight);line-height:1.3}.grid-config__main.sc-grid-config::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main.sc-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__main__scrollbar--background-color);border-radius:var(--ez-grid-config__main__scrollbar--border-radius)}.grid-config__main.sc-grid-config::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}";
121597
121646
 
121598
121647
  let GridConfig$1 = class extends HTMLElement$1 {
121599
121648
  constructor() {
121600
121649
  super();
121601
121650
  this.__registerHost();
121602
- this.__attachShadow();
121603
121651
  this.configFinish = createEvent(this, "configFinish", 7);
121604
121652
  this.configCancel = createEvent(this, "configCancel", 7);
121605
121653
  this._columnListHistory = [];
@@ -121917,15 +121965,7 @@ let TestDu$1 = class extends HTMLElement$1 {
121917
121965
  }
121918
121966
  ]
121919
121967
  };
121920
- this.formConfig = [
121921
- { name: "CODPARC", label: "Parceiro" },
121922
- { name: "NOMEPARC", label: "Mamão" },
121923
- { name: "P", label: "Pêra", group: "Grupo 1" },
121924
- { name: "ME", label: "Melancia", tab: "aba 1", group: "Grupo 2" },
121925
- { name: "L", label: "Laranja", tab: "aba 1", group: "Grupo 1" },
121926
- { name: "LI", label: "Limão", tab: "aba 1", group: "Grupo 2" }
121927
- ];
121928
- this.dataUnit.records = [
121968
+ this.dataUnit.dataLoader = () => new Promise(accept => accept([
121929
121969
  {
121930
121970
  __record__id__: "1321321321321321",
121931
121971
  CODPARC: 10,
@@ -121934,21 +121974,10 @@ let TestDu$1 = class extends HTMLElement$1 {
121934
121974
  L: "Bagaço",
121935
121975
  LI: "Azedo"
121936
121976
  }
121937
- ];
121977
+ ]));
121938
121978
  }
121939
121979
  render() {
121940
- //return this.conteudoEstatico();
121941
- //return this.somenteDataUnit();
121942
- return this.configurado();
121943
- }
121944
- conteudoEstatico() {
121945
- return (h("div", null, h("button", { onClick: () => this.form.validate() }, "Validate"), h("ez-form", { ref: ref => this.form = ref }, h("div", null, h("ez-text-input", { label: "Nome (Label est\u00E1tico)", "data-field-name": "NOMEPARC", "data-required": "true" }), h("ez-text-input", { label: "C\u00F3d parc (Label est\u00E1tico)", "data-field-name": "CODPARC", "data-required": "true" })))));
121946
- }
121947
- somenteDataUnit() {
121948
- return (h("ez-form", { dataUnit: this.dataUnit }));
121949
- }
121950
- configurado() {
121951
- return (h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, ref: ref => this.form = ref }));
121980
+ return (h("ez-grid", { dataUnit: this.dataUnit }));
121952
121981
  }
121953
121982
  static get style() { return testDuCss; }
121954
121983
  };
@@ -121964,7 +121993,7 @@ const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-i
121964
121993
  const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"]}]);
121965
121994
  const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"]}]);
121966
121995
  const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"dataUnit":[1040],"config":[16]}]);
121967
- const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [0,"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]}]);
121996
+ const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [2,"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]}]);
121968
121997
  const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513]}]);
121969
121998
  const EzLabelChip = /*@__PURE__*/proxyCustomElement(EzLabelChip$1, [1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540]}]);
121970
121999
  const EzList = /*@__PURE__*/proxyCustomElement(EzList$1, [1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32]}]);
@@ -121979,7 +122008,7 @@ const EzTextInput = /*@__PURE__*/proxyCustomElement(EzTextInput$1, [1,"ez-text-i
121979
122008
  const EzTimeInput = /*@__PURE__*/proxyCustomElement(EzTimeInput$1, [1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"]}]);
121980
122009
  const EzToast = /*@__PURE__*/proxyCustomElement(EzToast$1, [1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"]}]);
121981
122010
  const EzUpload = /*@__PURE__*/proxyCustomElement(EzUpload$1, [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]}]);
121982
- const GridConfig = /*@__PURE__*/proxyCustomElement(GridConfig$1, [1,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]);
122011
+ const GridConfig = /*@__PURE__*/proxyCustomElement(GridConfig$1, [2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]);
121983
122012
  const SelectBox = /*@__PURE__*/proxyCustomElement(SelectBox$1, [1,"select-box",{"selectedOption":[1,"selected-option"]}]);
121984
122013
  const TestDu = /*@__PURE__*/proxyCustomElement(TestDu$1, [0,"test-du"]);
121985
122014
  const defineCustomElements = (opts) => {
@@ -0,0 +1,33 @@
1
+ class ApplicationUtils {
2
+ static async showDialog(title, message, icon = null, confirm, critical = false) {
3
+ return new Promise(resolve => {
4
+ let dialog = document.querySelector("ez-dialog");
5
+ if (!dialog) {
6
+ dialog = document.createElement("ez-dialog");
7
+ window.document.body.appendChild(dialog);
8
+ }
9
+ dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
10
+ });
11
+ }
12
+ static async alert(title, message, icon = null) {
13
+ return ApplicationUtils.showDialog(title, message, icon, false, false);
14
+ }
15
+ static async error(title, message, icon = null) {
16
+ return ApplicationUtils.showDialog(title, message, icon, false, true);
17
+ }
18
+ static async confirm(title, message, icon = null, critical = false) {
19
+ return ApplicationUtils.showDialog(title, message, icon, true, critical);
20
+ }
21
+ static async info(message) {
22
+ let toast = document.querySelector("ez-toast");
23
+ if (!toast) {
24
+ toast = document.createElement("ez-toast");
25
+ window.document.body.appendChild(toast);
26
+ }
27
+ toast.message = message;
28
+ toast.fadeTime = 4000;
29
+ toast.show();
30
+ }
31
+ }
32
+
33
+ export { ApplicationUtils as A };
@@ -1,4 +1,4 @@
1
- import { a as getAssetPath, s as setAssetPath } from './index-077c7fcf.js';
1
+ import { a as getAssetPath, s as setAssetPath } from './index-d80a8d1f.js';
2
2
 
3
3
  const getSpritePath = (sprite) => `${getContextAssetsPath("../assets/actions-sprite.svg")}#${sprite}`;
4
4
  let ctxLoaded = false;
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-077c7fcf.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-d80a8d1f.js';
2
2
 
3
3
  const ezActionChipCss = ":host{--ez-action-chip--height:36px;--ez-action-chip--border-radius:var(--border--radius-large, 24px);--ez-action-chip__border:1px solid;--ez-action-chip__border-color-strokes:var(--color--strokes, #DCE0E8);--ez-action-chip--font-size:var(--text--medium, 14px);--ez-action-chip--font-family:var(--font-pattern, Arial);--ez-action-chip--font-weight:var(--text-weight--large, 500);--ez-action-chip__label--title--primary:var(--title--primary, #919191);--ez-action-chip__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ez-action-chip__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--ez-action-chip__label__default--border-color--hover:var(--color--primary-600, #007a5a)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;background-color:#FFFFFF;align-items:center;align-self:center;cursor:pointer;color:var(--ez-action-chip__label--title--primary);fill:var(--ez-action-chip__label--title--primary);border:var(--ez-action-chip__border);border-radius:var(--ez-action-chip--border-radius);border-color:var(--ez-action-chip__border-color-strokes);padding-right:var(--space--medium, 12px);padding-left:var(--space--medium, 12px)}.label__container:hover{border-color:var(--ez-action-chip__label__default--border-color--hover);background-color:var(--ez-action-chip__label__default--background-color--hover)}label{display:flex;align-items:center;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--ez-action-chip--height);font-family:var(--ez-action-chip--font-family);font-size:var(--ez-action-chip--font-size)}";
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-077c7fcf.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-d80a8d1f.js';
2
2
 
3
3
  const ezApplicationCss = "";
4
4