@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-52057.0 → 0.0.0-bugfix-dev-59880.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/cjs/ICustomRender-6fafffce.js +13 -0
  2. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
  3. package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
  4. package/dist/cjs/ez-button.cjs.entry.js +2 -2
  5. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
  6. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
  7. package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +86 -0
  8. package/dist/cjs/ez-date-input.cjs.entry.js +1 -0
  9. package/dist/cjs/ez-form-view.cjs.entry.js +36 -4
  10. package/dist/cjs/ez-form.cjs.entry.js +51 -2
  11. package/dist/cjs/ez-grid.cjs.entry.js +322 -19
  12. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-number-input.cjs.entry.js +9 -2
  15. package/dist/cjs/ez-search.cjs.entry.js +6 -2
  16. package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
  17. package/dist/cjs/ezui.cjs.js +1 -1
  18. package/dist/cjs/index-a7b0c73d.js +4 -4
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/collection/collection-manifest.json +1 -0
  21. package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
  22. package/dist/collection/components/ez-button/ez-button.css +7 -0
  23. package/dist/collection/components/ez-button/ez-button.js +1 -1
  24. package/dist/collection/components/ez-date-input/ez-date-input.js +1 -0
  25. package/dist/collection/components/ez-form/ez-form.js +130 -4
  26. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +245 -0
  27. package/dist/collection/components/ez-form-view/ez-form-view.js +92 -2
  28. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
  29. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +62 -4
  30. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
  31. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
  32. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
  33. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
  34. package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
  35. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
  36. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
  37. package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
  38. package/dist/collection/components/ez-grid/ez-grid.js +206 -2
  39. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
  40. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  41. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
  42. package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
  43. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
  44. package/dist/collection/components/ez-list/ez-list.css +6 -2
  45. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
  46. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  47. package/dist/collection/components/ez-number-input/ez-number-input.js +12 -1
  48. package/dist/collection/components/ez-search/ez-search.js +5 -2
  49. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
  50. package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
  51. package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
  52. package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
  53. package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
  54. package/dist/collection/utils/index.js +2 -0
  55. package/dist/custom-elements/index.d.ts +6 -0
  56. package/dist/custom-elements/index.js +539 -44
  57. package/dist/esm/ICustomRender-875b5a40.js +13 -0
  58. package/dist/esm/ez-actions-button.entry.js +1 -0
  59. package/dist/esm/ez-alert-list.entry.js +6 -4
  60. package/dist/esm/ez-button.entry.js +2 -2
  61. package/dist/esm/ez-collapsible-box.entry.js +1 -0
  62. package/dist/esm/ez-combo-box.entry.js +1 -0
  63. package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +88 -3
  64. package/dist/esm/ez-date-input.entry.js +1 -0
  65. package/dist/esm/ez-form-view.entry.js +36 -4
  66. package/dist/esm/ez-form.entry.js +51 -2
  67. package/dist/esm/ez-grid.entry.js +322 -19
  68. package/dist/esm/ez-list.entry.js +1 -1
  69. package/dist/esm/ez-modal-container.entry.js +2 -2
  70. package/dist/esm/ez-number-input.entry.js +9 -2
  71. package/dist/esm/ez-search.entry.js +6 -2
  72. package/dist/esm/ez-split-item.entry.js +2 -1
  73. package/dist/esm/ezui.js +1 -1
  74. package/dist/esm/index-baa5e267.js +4 -4
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/ezui/ezui.esm.js +1 -1
  77. package/dist/ezui/p-09de35a2.entry.js +1 -0
  78. package/dist/ezui/p-13d2fe2d.entry.js +1 -0
  79. package/dist/ezui/{p-384247cd.entry.js → p-1f96ba9a.entry.js} +2 -2
  80. package/dist/ezui/p-204b1439.entry.js +1 -0
  81. package/dist/ezui/p-2b8da3a4.entry.js +1 -0
  82. package/dist/ezui/p-30775e7f.entry.js +1 -0
  83. package/dist/ezui/p-4607fb89.js +1 -0
  84. package/dist/ezui/{p-2a1a0e04.entry.js → p-77362d3a.entry.js} +1 -1
  85. package/dist/ezui/{p-8defa6d3.entry.js → p-786559c5.entry.js} +1 -1
  86. package/dist/ezui/p-7922142b.entry.js +1 -0
  87. package/dist/ezui/p-84e439b9.entry.js +1 -0
  88. package/dist/ezui/p-922ac38b.entry.js +1 -0
  89. package/dist/ezui/p-bae4e180.entry.js +1 -0
  90. package/dist/ezui/p-bcb53f27.entry.js +1 -0
  91. package/dist/ezui/p-c942e4a7.entry.js +1 -0
  92. package/dist/ezui/p-e90dd4eb.entry.js +1 -0
  93. package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
  94. package/dist/types/components/ez-form/ez-form.d.ts +20 -1
  95. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +41 -0
  96. package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
  97. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +29 -0
  98. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +11 -0
  99. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
  100. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
  101. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
  102. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
  103. package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
  104. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
  105. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
  106. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
  107. package/dist/types/components/ez-grid/ez-grid.d.ts +30 -1
  108. package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
  109. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  110. package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
  111. package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
  112. package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
  113. package/dist/types/components.d.ts +120 -4
  114. package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
  115. package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
  116. package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
  117. package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
  118. package/dist/types/utils/index.d.ts +2 -0
  119. package/package.json +1 -1
  120. package/react/components.d.ts +1 -0
  121. package/react/components.js +1 -0
  122. package/react/components.js.map +1 -1
  123. package/dist/ezui/p-0447d17c.entry.js +0 -1
  124. package/dist/ezui/p-20ec22c0.entry.js +0 -1
  125. package/dist/ezui/p-44c5b6a5.entry.js +0 -1
  126. package/dist/ezui/p-5ef056ce.entry.js +0 -1
  127. package/dist/ezui/p-86ff298d.entry.js +0 -1
  128. package/dist/ezui/p-99ead599.entry.js +0 -1
  129. package/dist/ezui/p-9aefaa52.entry.js +0 -1
  130. package/dist/ezui/p-9f1e89c9.entry.js +0 -1
  131. package/dist/ezui/p-b041333c.entry.js +0 -1
  132. package/dist/ezui/p-b567fa8c.entry.js +0 -1
  133. package/dist/ezui/p-bae3d0aa.entry.js +0 -1
  134. package/dist/ezui/p-db77a984.entry.js +0 -1
@@ -0,0 +1,11 @@
1
+ import { DataType, UserInterface } from "@sankhyalabs/core";
2
+ export const metadata = {
3
+ name: 'metadatada',
4
+ label: 'metadatada',
5
+ fields: [{
6
+ name: 'FIELDNAME',
7
+ label: 'Test',
8
+ dataType: DataType.TEXT,
9
+ userInterface: UserInterface.SHORTTEXT,
10
+ }],
11
+ };
@@ -0,0 +1,11 @@
1
+ import { DataType, UserInterface } from "@sankhyalabs/core";
2
+ export const metadata = {
3
+ name: 'metadatada',
4
+ label: 'metadatada',
5
+ fields: [{
6
+ name: 'FIELDNAME',
7
+ label: 'Test',
8
+ dataType: DataType.TEXT,
9
+ userInterface: UserInterface.SHORTTEXT,
10
+ }],
11
+ };
@@ -20,9 +20,9 @@ export default class EzCellEditor {
20
20
  init(params) {
21
21
  const fieldName = params.column.getColId();
22
22
  const dataUnit = params.context.dataUnit;
23
- const fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
24
- const builder = uiBuilders.get(fieldMetadata.userInterface) || buildTextInput;
25
- this._gui = builder(fieldMetadata);
23
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
24
+ const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
25
+ this._gui = builder(this._fieldMetadata);
26
26
  if (this._gui.valueSetter != undefined) {
27
27
  this._gui.valueSetter(params.value);
28
28
  }
@@ -46,4 +46,7 @@ export default class EzCellEditor {
46
46
  isPopup() {
47
47
  return this._gui.isPopUp;
48
48
  }
49
+ getFieldMetadata() {
50
+ return this._fieldMetadata;
51
+ }
49
52
  }
@@ -0,0 +1,40 @@
1
+ import { buildEditorMetadata } from "./IEditorMetadata";
2
+ export default class EzCellRender {
3
+ init(params) {
4
+ const span = document.createElement('span');
5
+ this._currentParams = params;
6
+ span.textContent = params.value;
7
+ const fieldName = params.column.getColId();
8
+ const dataUnit = params.context.dataUnit;
9
+ this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
10
+ this._gui = span;
11
+ }
12
+ refresh() {
13
+ try {
14
+ this._currentParams.refreshCell();
15
+ return true;
16
+ }
17
+ catch (_a) {
18
+ return false;
19
+ }
20
+ }
21
+ getGui() {
22
+ return this._gui;
23
+ }
24
+ afterGuiAttached() {
25
+ this.focusIn();
26
+ }
27
+ focusIn() {
28
+ this._gui.focus();
29
+ this._gui.setFocus({ selectText: true });
30
+ }
31
+ getValue() {
32
+ return this._currentParams.getValue();
33
+ }
34
+ isPopup() {
35
+ return this._gui.isPopUp;
36
+ }
37
+ getFieldMetadata() {
38
+ return this._fieldMetadata;
39
+ }
40
+ }
@@ -15,6 +15,8 @@ export class EzGrid {
15
15
  constructor() {
16
16
  this._gridController = new AgGridController(false);
17
17
  this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
18
+ this._customEditor = new Map();
19
+ this._customRenders = new Map();
18
20
  this._paginationInfo = undefined;
19
21
  this._paginationChangedByKeyboard = true;
20
22
  this._showSelectionCounter = false;
@@ -22,6 +24,7 @@ export class EzGrid {
22
24
  this._currentPageSelected = undefined;
23
25
  this._selectionCount = undefined;
24
26
  this._hasLeftButtons = false;
27
+ this._customFormatters = new Map();
25
28
  this.multipleSelection = undefined;
26
29
  this.config = undefined;
27
30
  this.selectionToastConfig = undefined;
@@ -93,6 +96,63 @@ export class EzGrid {
93
96
  async filterColumns(search) {
94
97
  return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
95
98
  }
99
+ /**
100
+ * Registra um editor customizado para campos da grade e formulário.
101
+ */
102
+ async addCustomEditor(fieldName, customEditor, detailContext) {
103
+ const newCustomEditor = new Map(this._customEditor);
104
+ newCustomEditor.set(fieldName, {
105
+ customEditor,
106
+ detailContext,
107
+ });
108
+ this._customEditor = newCustomEditor;
109
+ this._gridController.setCellEditors(newCustomEditor);
110
+ }
111
+ /**
112
+ * Registra um render customizado para colunas da grid.
113
+ */
114
+ async addGridCustomRender(fieldName, customRender, detailContext) {
115
+ const newCustomRenders = new Map(this._customRenders);
116
+ newCustomRenders.set(fieldName, { customRender, detailContext });
117
+ this._customRenders = newCustomRenders;
118
+ this._gridController.setCellRenders(newCustomRenders);
119
+ }
120
+ /**
121
+ * Registra um formatador de valores para uma coluna da grid.
122
+ */
123
+ async addCustomValueFormatter(columnName, customFormatter) {
124
+ if (!columnName || !customFormatter) {
125
+ return;
126
+ }
127
+ const newCustomFormatters = new Map(this._customFormatters);
128
+ newCustomFormatters.set(columnName, customFormatter);
129
+ this._customFormatters = newCustomFormatters;
130
+ this._gridController.setCustomFormatters(newCustomFormatters);
131
+ }
132
+ /**
133
+ * Remove o formatador de valores de uma coluna da grid.
134
+ */
135
+ async removeCustomValueFormatter(columnName) {
136
+ if (!columnName) {
137
+ return;
138
+ }
139
+ const newCustomFormatters = new Map(this._customFormatters);
140
+ newCustomFormatters.delete(columnName);
141
+ this._customFormatters = newCustomFormatters;
142
+ this._gridController.setCustomFormatters(newCustomFormatters);
143
+ }
144
+ /**
145
+ * Atualiza linhas da grade.
146
+ */
147
+ async refreshSelectedRows() {
148
+ this._gridController.refreshSelectedRows();
149
+ }
150
+ /**
151
+ * Retorna o formatador customizado da coluna caso exista.
152
+ */
153
+ async getCustomValueFormatter(columnName) {
154
+ return this._customFormatters.get(columnName);
155
+ }
96
156
  observeConfig(config) {
97
157
  this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
98
158
  }
@@ -294,7 +354,8 @@ export class EzGrid {
294
354
  statusResolver: this.statusResolver,
295
355
  useEnterLikeTab: this.useEnterLikeTab,
296
356
  recordsValidator: this.recordsValidator,
297
- editionIsDisabled: () => !this.canEdit
357
+ editionIsDisabled: () => !this.canEdit,
358
+ customFormatters: this._customFormatters
298
359
  });
299
360
  if (this.config) {
300
361
  this.observeConfig(this.config);
@@ -612,7 +673,8 @@ export class EzGrid {
612
673
  "_isAllSelection": {},
613
674
  "_currentPageSelected": {},
614
675
  "_selectionCount": {},
615
- "_hasLeftButtons": {}
676
+ "_hasLeftButtons": {},
677
+ "_customFormatters": {}
616
678
  };
617
679
  }
618
680
  static get events() {
@@ -946,6 +1008,148 @@ export class EzGrid {
946
1008
  "text": "Usa um argumento para filtrar as colunas po label",
947
1009
  "tags": []
948
1010
  }
1011
+ },
1012
+ "addCustomEditor": {
1013
+ "complexType": {
1014
+ "signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
1015
+ "parameters": [{
1016
+ "tags": [],
1017
+ "text": ""
1018
+ }, {
1019
+ "tags": [],
1020
+ "text": ""
1021
+ }, {
1022
+ "tags": [],
1023
+ "text": ""
1024
+ }],
1025
+ "references": {
1026
+ "Promise": {
1027
+ "location": "global"
1028
+ },
1029
+ "ICustomEditor": {
1030
+ "location": "import",
1031
+ "path": "../../utils/customEditor/interfaces/ICustomEditor"
1032
+ }
1033
+ },
1034
+ "return": "Promise<void>"
1035
+ },
1036
+ "docs": {
1037
+ "text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
1038
+ "tags": []
1039
+ }
1040
+ },
1041
+ "addGridCustomRender": {
1042
+ "complexType": {
1043
+ "signature": "(fieldName: string, customRender: ICustomRender, detailContext?: string) => Promise<void>",
1044
+ "parameters": [{
1045
+ "tags": [],
1046
+ "text": ""
1047
+ }, {
1048
+ "tags": [],
1049
+ "text": ""
1050
+ }, {
1051
+ "tags": [],
1052
+ "text": ""
1053
+ }],
1054
+ "references": {
1055
+ "Promise": {
1056
+ "location": "global"
1057
+ },
1058
+ "ICustomRender": {
1059
+ "location": "import",
1060
+ "path": "../../utils/customRender/interfaces/ICustomRender"
1061
+ }
1062
+ },
1063
+ "return": "Promise<void>"
1064
+ },
1065
+ "docs": {
1066
+ "text": "Registra um render customizado para colunas da grid.",
1067
+ "tags": []
1068
+ }
1069
+ },
1070
+ "addCustomValueFormatter": {
1071
+ "complexType": {
1072
+ "signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
1073
+ "parameters": [{
1074
+ "tags": [],
1075
+ "text": ""
1076
+ }, {
1077
+ "tags": [],
1078
+ "text": ""
1079
+ }],
1080
+ "references": {
1081
+ "Promise": {
1082
+ "location": "global"
1083
+ },
1084
+ "ICustomFormatter": {
1085
+ "location": "import",
1086
+ "path": "./interfaces"
1087
+ }
1088
+ },
1089
+ "return": "Promise<void>"
1090
+ },
1091
+ "docs": {
1092
+ "text": "Registra um formatador de valores para uma coluna da grid.",
1093
+ "tags": []
1094
+ }
1095
+ },
1096
+ "removeCustomValueFormatter": {
1097
+ "complexType": {
1098
+ "signature": "(columnName: string) => Promise<void>",
1099
+ "parameters": [{
1100
+ "tags": [],
1101
+ "text": ""
1102
+ }],
1103
+ "references": {
1104
+ "Promise": {
1105
+ "location": "global"
1106
+ }
1107
+ },
1108
+ "return": "Promise<void>"
1109
+ },
1110
+ "docs": {
1111
+ "text": "Remove o formatador de valores de uma coluna da grid.",
1112
+ "tags": []
1113
+ }
1114
+ },
1115
+ "refreshSelectedRows": {
1116
+ "complexType": {
1117
+ "signature": "() => Promise<void>",
1118
+ "parameters": [],
1119
+ "references": {
1120
+ "Promise": {
1121
+ "location": "global"
1122
+ }
1123
+ },
1124
+ "return": "Promise<void>"
1125
+ },
1126
+ "docs": {
1127
+ "text": "Atualiza linhas da grade.",
1128
+ "tags": []
1129
+ }
1130
+ },
1131
+ "getCustomValueFormatter": {
1132
+ "complexType": {
1133
+ "signature": "(columnName: string) => Promise<ICustomFormatter | undefined>",
1134
+ "parameters": [{
1135
+ "tags": [],
1136
+ "text": ""
1137
+ }],
1138
+ "references": {
1139
+ "Promise": {
1140
+ "location": "global"
1141
+ },
1142
+ "ICustomFormatter": {
1143
+ "location": "import",
1144
+ "path": "./interfaces"
1145
+ }
1146
+ },
1147
+ "return": "Promise<ICustomFormatter>"
1148
+ },
1149
+ "docs": {
1150
+ "text": "Retorna o formatador customizado da coluna caso exista.",
1151
+ "tags": []
1152
+ }
949
1153
  }
950
1154
  };
951
1155
  }
@@ -1,3 +1,4 @@
1
1
  export * from './ISelection';
2
2
  export * from './ISelectionToastConfig';
3
3
  export * from './IColumnFilter';
4
+ export * from './ICustomFormatter';
@@ -1,8 +1,9 @@
1
1
  import { ElementIDUtils } from "@sankhyalabs/core";
2
2
  import { h } from "@stencil/core";
3
+ import { buildSelectAllLabel, buildSelectAllTitle, enableSelectAll, getText } from './utils/selectionCounterUtils';
3
4
  export const SelectionCounter = (props) => {
4
5
  const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
5
- const { total, hasMore } = paginationInfo || {};
6
+ const { total, hasMore, count } = paginationInfo || {};
6
7
  const shouldRenderSelectionButton = () => {
7
8
  if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
8
9
  return false;
@@ -11,17 +12,8 @@ export const SelectionCounter = (props) => {
11
12
  return !!paginationInfo && (currentPageSelected || allRecordSelected);
12
13
  };
13
14
  return (h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")), h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" }, h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" }, 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"))), h("div", { class: "ez-flex ez-margin-right--medium" }, shouldRenderSelectionButton() &&
14
- 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"}`))), h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))), h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")), h("ez-icon", { iconName: "close" })))));
15
+ h("ez-button", Object.assign({ title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))), h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))), h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")), h("ez-icon", { iconName: "close" })))));
15
16
  };
16
- function getText(selectionCount, allSelectedRecords) {
17
- if (allSelectedRecords) {
18
- return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
19
- }
20
- else {
21
- const pluralChar = selectionCount > 1 ? "s" : "";
22
- return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
23
- }
24
- }
25
17
  function getElementID(sufix) {
26
18
  return {
27
19
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
@@ -0,0 +1,22 @@
1
+ export function enableSelectAll(total) {
2
+ return total !== undefined;
3
+ }
4
+ export function buildSelectAllLabel(allRecordSelected, count, total) {
5
+ if (allRecordSelected)
6
+ return 'Selecionar apenas a página atual';
7
+ if (total === undefined)
8
+ return `Carregando todos os ${count} registros`;
9
+ return `Selecionar todos os ${total} registros`;
10
+ }
11
+ export function buildSelectAllTitle(total) {
12
+ if (enableSelectAll(total))
13
+ return '';
14
+ return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
15
+ }
16
+ export function getText(selectionCount, allSelectedRecords) {
17
+ if (allSelectedRecords) {
18
+ return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
19
+ }
20
+ const pluralCharacter = selectionCount > 1 ? "s" : "";
21
+ return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
22
+ }
@@ -0,0 +1,19 @@
1
+ import { DataType, DataUnit, StringUtils } from "@sankhyalabs/core";
2
+ export function getDataUnit() {
3
+ const dataUnit = new DataUnit('EzGridDU');
4
+ dataUnit.pageSize = 3;
5
+ dataUnit.metadata = {
6
+ name: "exemplo.datagrid",
7
+ label: "Exemplo data grid",
8
+ fields: [
9
+ { name: "PRODUTO", label: "Produto", dataType: DataType.TEXT },
10
+ { name: "QUANTIDADE", label: "Quantidade", dataType: DataType.NUMBER }
11
+ ]
12
+ };
13
+ dataUnit.records = [
14
+ { __record__id__: StringUtils.generateUUID(), "PRODUTO": "Mamão", "QUANTIDADE": 1 },
15
+ { __record__id__: StringUtils.generateUUID(), "PRODUTO": "Mexerica", "QUANTIDADE": 2 }
16
+ ];
17
+ dataUnit.selectFirst();
18
+ return dataUnit;
19
+ }
@@ -168,14 +168,18 @@ p {
168
168
  display: flex;
169
169
 
170
170
  /*public*/
171
- padding: var(--space--2xs, 8px) var(--space--3xs, 4px);
172
- margin: var(--ez-list__item--margin);
173
171
  font-family: var(--ez-list__item--font-family);
174
172
  font-size: var(--ez-list__item--font-size);
175
173
  color: var(--ez-list__item--color);
176
174
  border-bottom: var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color);
177
175
  }
178
176
 
177
+ .draggable-list li > div {
178
+ /*public*/
179
+ padding: var(--space--2xs, 8px) var(--space--3xs, 4px);
180
+ margin: var(--ez-list__item--margin);
181
+ }
182
+
179
183
  .over {
180
184
  /*public*/
181
185
  border-top: 1px dashed var(--ez-list__over--border--color);
@@ -7,6 +7,10 @@
7
7
  height: 100%;
8
8
  }
9
9
 
10
+ .ez-modal-container__header-container{
11
+ outline: none;
12
+ }
13
+
10
14
  .ez-modal-container__header {
11
15
  display: flex;
12
16
  flex-wrap: nowrap;
@@ -47,7 +47,7 @@ export class EzModalContainer {
47
47
  this._closeButton.focus();
48
48
  }
49
49
  render() {
50
- return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1 }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
50
+ return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
51
51
  }
52
52
  static get is() { return "ez-modal-container"; }
53
53
  static get encapsulation() { return "scoped"; }
@@ -82,12 +82,17 @@ export class EzNumberInput {
82
82
  }
83
83
  this._changePending = false;
84
84
  }
85
+ observePrecision() {
86
+ if (this._textInput) {
87
+ this.setInputValue();
88
+ }
89
+ }
85
90
  validateValue(value) {
86
91
  return isNaN(value) || value === undefined ? null : value;
87
92
  }
88
93
  getTextValue(value) {
89
94
  if (value != undefined) {
90
- return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
95
+ return this.precision >= 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
91
96
  }
92
97
  return undefined;
93
98
  }
@@ -455,6 +460,12 @@ export class EzNumberInput {
455
460
  }, {
456
461
  "propName": "value",
457
462
  "methodName": "observeValue"
463
+ }, {
464
+ "propName": "precision",
465
+ "methodName": "observePrecision"
466
+ }, {
467
+ "propName": "prettyPrecision",
468
+ "methodName": "observePrecision"
458
469
  }];
459
470
  }
460
471
  }
@@ -308,9 +308,12 @@ export class EzSearch {
308
308
  }
309
309
  scrollToOption(opt) {
310
310
  window.requestAnimationFrame(() => {
311
- const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`div#item_${this.replaceHighlight(opt.value).replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
312
- if (liElem)
311
+ const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
312
+ ? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
313
+ : undefined;
314
+ if (liElem) {
313
315
  liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
316
+ }
314
317
  });
315
318
  }
316
319
  selectCurrentOption() {
@@ -17,7 +17,7 @@ export class SplitItem {
17
17
  CSSVarsUtils.applyVarsGrid(this._element, this._slot.children[0]);
18
18
  }
19
19
  render() {
20
- return (h(Host, { class: `box_split-item ${this._expanded ? 'expanded__item' : ''}`, ref: el => (this._element = el) }, h("div", { class: "ez-split-item--header" }, h("slot", { name: "leftButtons" }), h("div", { class: "ez-split-item--header-title" }, this.label && (h("h3", { class: "ez-text ez-text--primary ez-title ez-title--small ez-margin--small", title: this.label }, this.label))), h("div", { class: "ez-split-item--header-buttons" }, this.enableExpand && (h("ez-button", { size: "small", mode: "icon", iconName: "expand", class: 'ez-button--tertiary', onClick: () => this.toggleExpandItem(), title: this._expanded ? 'Resumir' : 'Expandir' })), h("slot", { name: "rightButtons" }))), h("div", { class: "ez-split-item--content grid_height-0", ref: el => (this._slot = el) }, h("slot", null))));
20
+ return (h(Host, { class: `box_split-item ${this._expanded ? 'expanded__item' : ''}`, ref: el => (this._element = el) }, h("div", { class: "ez-split-item--header" }, h("slot", { name: "leftButtons" }), h("div", { class: "ez-split-item--header-title" }, this.label && (h("h3", { class: "ez-text ez-text--primary ez-title ez-title--small ez-margin--small", title: this.label }, this.label))), h("div", { class: "ez-split-item--header-buttons" }, h("slot", { name: "rightButtons" }), this.enableExpand && (h("ez-button", { size: "small", mode: "icon", iconName: "expand", class: 'ez-button--tertiary', onClick: () => this.toggleExpandItem(), title: this._expanded ? 'Resumir' : 'Expandir' })))), h("div", { class: "ez-split-item--content grid_height-0", ref: el => (this._slot = el) }, h("slot", null))));
21
21
  }
22
22
  static get is() { return "ez-split-item"; }
23
23
  static get originalStyleUrls() {
@@ -0,0 +1,5 @@
1
+ export var CustomEditorSource;
2
+ (function (CustomEditorSource) {
3
+ CustomEditorSource["GRID"] = "GRID";
4
+ CustomEditorSource["FORM"] = "FORM";
5
+ })(CustomEditorSource || (CustomEditorSource = {}));
@@ -0,0 +1,5 @@
1
+ export var CustomRenderSource;
2
+ (function (CustomRenderSource) {
3
+ CustomRenderSource["GRID"] = "GRID";
4
+ CustomRenderSource["FORM"] = "FORM";
5
+ })(CustomRenderSource || (CustomRenderSource = {}));
@@ -4,3 +4,5 @@ export { DialogType } from '../components/ez-dialog/DialogType';
4
4
  export { CheckMode } from '../components/ez-check/CheckMode';
5
5
  export { FormMetadata } from './form/FormMetadata';
6
6
  export { default as DataBinder } from './form/DataBinder';
7
+ export { CustomEditorSource } from './customEditor/interfaces/ICustomEditor';
8
+ export { CustomRenderSource } from './customRender/interfaces/ICustomRender';
@@ -80,6 +80,12 @@ export const EzComboBox: {
80
80
  new (): EzComboBox;
81
81
  };
82
82
 
83
+ interface EzCustomFormInput extends Components.EzCustomFormInput, HTMLElement {}
84
+ export const EzCustomFormInput: {
85
+ prototype: EzCustomFormInput;
86
+ new (): EzCustomFormInput;
87
+ };
88
+
83
89
  interface EzDateInput extends Components.EzDateInput, HTMLElement {}
84
90
  export const EzDateInput: {
85
91
  prototype: EzDateInput;