@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-61161.0 → 0.0.0-bugfix-dev-KB-59008.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 (74) hide show
  1. package/dist/cjs/ez-chart.cjs.entry.js +433 -0
  2. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -8
  3. package/dist/cjs/ez-form-view.cjs.entry.js +4 -3
  4. package/dist/cjs/ez-grid.cjs.entry.js +9 -12
  5. package/dist/cjs/ez-number-input.cjs.entry.js +26 -27
  6. package/dist/cjs/ezui.cjs.js +1 -1
  7. package/dist/cjs/index-a7b0c73d.js +4 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/collection-manifest.json +1 -0
  10. package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
  11. package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
  12. package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
  13. package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
  14. package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
  15. package/dist/collection/components/ez-chart/components/index.js +5 -0
  16. package/dist/collection/components/ez-chart/ez-chart.css +5 -0
  17. package/dist/collection/components/ez-chart/ez-chart.js +284 -0
  18. package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
  19. package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
  20. package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
  21. package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
  22. package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
  23. package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
  24. package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
  25. package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
  26. package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
  27. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +1 -9
  28. package/dist/collection/components/ez-form-view/ez-form-view.js +1 -1
  29. package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
  30. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +1 -1
  31. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
  32. package/dist/collection/components/ez-grid/ez-grid.js +5 -9
  33. package/dist/collection/components/ez-number-input/ez-number-input.js +31 -27
  34. package/dist/custom-elements/index.d.ts +6 -0
  35. package/dist/custom-elements/index.js +472 -53
  36. package/dist/esm/ez-chart.entry.js +429 -0
  37. package/dist/esm/ez-custom-form-input_2.entry.js +0 -8
  38. package/dist/esm/ez-form-view.entry.js +4 -3
  39. package/dist/esm/ez-grid.entry.js +9 -12
  40. package/dist/esm/ez-number-input.entry.js +26 -27
  41. package/dist/esm/ezui.js +1 -1
  42. package/dist/esm/index-baa5e267.js +4 -0
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/ezui/ezui.esm.js +1 -1
  45. package/dist/ezui/{p-362c3c80.entry.js → p-065e735d.entry.js} +1 -1
  46. package/dist/ezui/p-3b9e5664.entry.js +1 -0
  47. package/dist/ezui/p-93a19a8c.entry.js +1 -0
  48. package/dist/ezui/p-e90dd4eb.entry.js +1 -0
  49. package/dist/ezui/p-ffef392d.entry.js +1 -0
  50. package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
  51. package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
  52. package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
  53. package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
  54. package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
  55. package/dist/types/components/ez-chart/components/index.d.ts +5 -0
  56. package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
  57. package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
  58. package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
  59. package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
  60. package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
  61. package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
  62. package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
  63. package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
  64. package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
  65. package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +0 -2
  66. package/dist/types/components/ez-number-input/ez-number-input.d.ts +2 -0
  67. package/dist/types/components.d.ts +95 -0
  68. package/package.json +2 -1
  69. package/react/components.d.ts +1 -0
  70. package/react/components.js +1 -0
  71. package/react/components.js.map +1 -1
  72. package/dist/ezui/p-13727aec.entry.js +0 -1
  73. package/dist/ezui/p-1a35324b.entry.js +0 -1
  74. package/dist/ezui/p-99f46950.entry.js +0 -1
@@ -332,14 +332,10 @@ export class EzGrid {
332
332
  (_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
333
333
  }
334
334
  getPaginationControl() {
335
- if (this._paginationInfo) {
336
- const { currentPage, hasMore } = this._paginationInfo;
337
- return [
338
- h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())),
339
- h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
340
- ];
341
- }
342
- return null;
335
+ if (!this._paginationInfo)
336
+ return null;
337
+ const { currentPage, hasMore } = this._paginationInfo;
338
+ return (h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
343
339
  }
344
340
  componentDidLoad() {
345
341
  this._gridController.initDatagrid(this._container, {
@@ -456,7 +452,7 @@ export class EzGrid {
456
452
  }
457
453
  render() {
458
454
  var _a;
459
- return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
455
+ return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), this.getPaginationControl())), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
460
456
  ${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
461
457
  ` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
462
458
  }
@@ -6,6 +6,7 @@ export class EzNumberInput {
6
6
  this._focused = false;
7
7
  this._changePending = false;
8
8
  this._valuePromiseCallbacks = [];
9
+ this._value = undefined;
9
10
  this.label = undefined;
10
11
  this.value = undefined;
11
12
  this.enabled = true;
@@ -61,24 +62,7 @@ export class EzNumberInput {
61
62
  }
62
63
  observeValue(newValue, oldValue) {
63
64
  if (this._textInput && newValue != oldValue) {
64
- const newValueValidated = this.validateValue(newValue);
65
- const oldValueValidated = this.validateValue(oldValue);
66
- if (newValueValidated === null) {
67
- this._textInput.value = '';
68
- }
69
- if (newValueValidated != oldValueValidated) {
70
- const textValue = this.getTextValue(newValueValidated) || '';
71
- if ((this._textInput.value || '') !== textValue) {
72
- const parsedNumber = this.getParsedNumber(textValue);
73
- if (parsedNumber !== undefined || !this._focused) {
74
- this._textInput.value = textValue;
75
- this._focused = false;
76
- this.errorMessage = "";
77
- }
78
- }
79
- const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
80
- this.ezChange.emit(valueEmitted);
81
- }
65
+ this.handleNewValue(newValue, oldValue);
82
66
  }
83
67
  this._changePending = false;
84
68
  }
@@ -87,12 +71,31 @@ export class EzNumberInput {
87
71
  this.setInputValue();
88
72
  }
89
73
  }
74
+ handleNewValue(newValue, oldValue) {
75
+ const newValueValidated = this.validateValue(newValue);
76
+ const oldValueValidated = this.validateValue(oldValue);
77
+ if (newValueValidated === null) {
78
+ this._value = '';
79
+ }
80
+ if (newValueValidated === oldValueValidated) {
81
+ return;
82
+ }
83
+ const textValue = this.getTextValue(newValueValidated) || '';
84
+ const parsedNumber = this.getParsedNumber(textValue);
85
+ if ((this._value || '') !== textValue && (parsedNumber !== undefined || !this._focused)) {
86
+ this._value = textValue;
87
+ this._focused = false;
88
+ this.errorMessage = "";
89
+ }
90
+ const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
91
+ this.ezChange.emit(valueEmitted);
92
+ }
90
93
  validateValue(value) {
91
94
  return isNaN(value) || value === undefined ? null : value;
92
95
  }
93
96
  getTextValue(value) {
94
97
  if (value != undefined) {
95
- return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
98
+ return this.precision >= 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
96
99
  }
97
100
  return undefined;
98
101
  }
@@ -145,17 +148,13 @@ export class EzNumberInput {
145
148
  this.ezStartChange.emit({ waitmessage: "", blocking: false });
146
149
  }
147
150
  }
148
- getParsedNumber(value) {
149
- var _a;
150
- if (value === void 0) {
151
- value = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value;
152
- }
151
+ getParsedNumber(value = this._textInput.value) {
153
152
  return (value === null || value === void 0 ? void 0 : value.trim()) ? NumberUtils.stringToNumber(value) : undefined;
154
153
  }
155
154
  setInputValue() {
156
155
  const textValue = this.getTextValue(this.value) || '';
157
- if ((this._textInput.value || '') !== textValue) {
158
- this._textInput.value = textValue;
156
+ if ((this._value || '') !== textValue) {
157
+ this._value = textValue;
159
158
  }
160
159
  }
161
160
  componentDidLoad() {
@@ -164,7 +163,7 @@ export class EzNumberInput {
164
163
  }
165
164
  render() {
166
165
  ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
167
- return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }));
166
+ return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError, value: this._value }));
168
167
  }
169
168
  static get is() { return "ez-number-input"; }
170
169
  static get encapsulation() { return "shadow"; }
@@ -321,6 +320,11 @@ export class EzNumberInput {
321
320
  }
322
321
  };
323
322
  }
323
+ static get states() {
324
+ return {
325
+ "_value": {}
326
+ };
327
+ }
324
328
  static get events() {
325
329
  return [{
326
330
  "method": "ezChange",
@@ -56,6 +56,12 @@ export const EzCardItem: {
56
56
  new (): EzCardItem;
57
57
  };
58
58
 
59
+ interface EzChart extends Components.EzChart, HTMLElement {}
60
+ export const EzChart: {
61
+ prototype: EzChart;
62
+ new (): EzChart;
63
+ };
64
+
59
65
  interface EzCheck extends Components.EzCheck, HTMLElement {}
60
66
  export const EzCheck: {
61
67
  prototype: EzCheck;