@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
@@ -0,0 +1,284 @@
1
+ import { h } from '@stencil/core';
2
+ import { ChartContext, ChartType } from './interfaces';
3
+ import { ColumnChartStrategy, BarChartStrategy, LineChartStrategy, PieChartStrategy, DonutChartStrategy } from './components';
4
+ export class EzChart {
5
+ constructor() {
6
+ this.STRATEGY_BY_CHART_TYPE = new Map();
7
+ this.type = ChartType.LINE;
8
+ this.xAxis = undefined;
9
+ this.yAxis = undefined;
10
+ this.chartTitle = "";
11
+ this.chartSubTitle = "";
12
+ this.legendEnabled = true;
13
+ this.series = undefined;
14
+ this.width = undefined;
15
+ this.height = undefined;
16
+ this.initializeStrategies();
17
+ }
18
+ initializeStrategies() {
19
+ this.STRATEGY_BY_CHART_TYPE.set(ChartType.COLUMN, new ColumnChartStrategy());
20
+ this.STRATEGY_BY_CHART_TYPE.set(ChartType.BAR, new BarChartStrategy());
21
+ this.STRATEGY_BY_CHART_TYPE.set(ChartType.LINE, new LineChartStrategy());
22
+ this.STRATEGY_BY_CHART_TYPE.set(ChartType.PIE, new PieChartStrategy());
23
+ this.STRATEGY_BY_CHART_TYPE.set(ChartType.DONUT, new DonutChartStrategy());
24
+ }
25
+ renderChart() {
26
+ this.chartContext.render(this._container, this.series, this.xAxis, this.yAxis, {
27
+ title: this.chartTitle,
28
+ subTitle: this.chartSubTitle,
29
+ legendEnabled: this.legendEnabled,
30
+ onClickSerie: this.ezSerieClick,
31
+ });
32
+ }
33
+ componentWillLoad() {
34
+ this.setChartStrategy();
35
+ }
36
+ componentWillUpdate() {
37
+ this.renderChart();
38
+ }
39
+ componentDidLoad() {
40
+ this.renderChart();
41
+ }
42
+ disconnectedCallback() {
43
+ this.chartContext.destroy();
44
+ }
45
+ handleTypeChange() {
46
+ this.setChartStrategy();
47
+ }
48
+ setChartStrategy() {
49
+ const strategy = this.STRATEGY_BY_CHART_TYPE.get(this.type);
50
+ if (strategy) {
51
+ this.chartContext = new ChartContext(strategy);
52
+ return;
53
+ }
54
+ this.chartContext = new ChartContext(new LineChartStrategy());
55
+ }
56
+ render() {
57
+ return (h("div", { ref: (el) => this._container = el }));
58
+ }
59
+ static get is() { return "ez-chart"; }
60
+ static get encapsulation() { return "shadow"; }
61
+ static get originalStyleUrls() {
62
+ return {
63
+ "$": ["ez-chart.css"]
64
+ };
65
+ }
66
+ static get styleUrls() {
67
+ return {
68
+ "$": ["ez-chart.css"]
69
+ };
70
+ }
71
+ static get properties() {
72
+ return {
73
+ "type": {
74
+ "type": "string",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "ChartType",
78
+ "resolved": "ChartType.BAR | ChartType.COLUMN | ChartType.DONUT | ChartType.LINE | ChartType.PIE",
79
+ "references": {
80
+ "ChartType": {
81
+ "location": "import",
82
+ "path": "./interfaces"
83
+ }
84
+ }
85
+ },
86
+ "required": false,
87
+ "optional": false,
88
+ "docs": {
89
+ "tags": [],
90
+ "text": "Define o tipo de gr\u00E1fico apresentado pelo componente"
91
+ },
92
+ "attribute": "type",
93
+ "reflect": false,
94
+ "defaultValue": "ChartType.LINE"
95
+ },
96
+ "xAxis": {
97
+ "type": "unknown",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "ChartAxis | Array<ChartAxis>",
101
+ "resolved": "ChartAxis[] | ({ color?: string; categories?: string[]; formatter?: (value: string | number) => string; text?: string; invertedPosition?: boolean; })",
102
+ "references": {
103
+ "ChartAxis": {
104
+ "location": "import",
105
+ "path": "./interfaces"
106
+ },
107
+ "Array": {
108
+ "location": "global"
109
+ }
110
+ }
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [],
116
+ "text": "Defini\u00E7\u00F5es do eixo X do gr\u00E1fico"
117
+ }
118
+ },
119
+ "yAxis": {
120
+ "type": "unknown",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "ChartAxis | Array<ChartAxis>",
124
+ "resolved": "ChartAxis[] | ({ color?: string; categories?: string[]; formatter?: (value: string | number) => string; text?: string; invertedPosition?: boolean; })",
125
+ "references": {
126
+ "ChartAxis": {
127
+ "location": "import",
128
+ "path": "./interfaces"
129
+ },
130
+ "Array": {
131
+ "location": "global"
132
+ }
133
+ }
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": "Defini\u00E7\u00F5es do eixo Y do gr\u00E1fico"
140
+ }
141
+ },
142
+ "chartTitle": {
143
+ "type": "string",
144
+ "mutable": false,
145
+ "complexType": {
146
+ "original": "string",
147
+ "resolved": "string",
148
+ "references": {}
149
+ },
150
+ "required": false,
151
+ "optional": false,
152
+ "docs": {
153
+ "tags": [],
154
+ "text": "Define o titulo a ser apresentado no gr\u00E1fico"
155
+ },
156
+ "attribute": "chart-title",
157
+ "reflect": false,
158
+ "defaultValue": "\"\""
159
+ },
160
+ "chartSubTitle": {
161
+ "type": "string",
162
+ "mutable": false,
163
+ "complexType": {
164
+ "original": "string",
165
+ "resolved": "string",
166
+ "references": {}
167
+ },
168
+ "required": false,
169
+ "optional": false,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": "Define o sub titulo a ser apresentado no gr\u00E1fico"
173
+ },
174
+ "attribute": "chart-sub-title",
175
+ "reflect": false,
176
+ "defaultValue": "\"\""
177
+ },
178
+ "legendEnabled": {
179
+ "type": "boolean",
180
+ "mutable": false,
181
+ "complexType": {
182
+ "original": "boolean",
183
+ "resolved": "boolean",
184
+ "references": {}
185
+ },
186
+ "required": false,
187
+ "optional": false,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": "Define se a legenda do gr\u00E1fico deve ser apresentada ou n\u00E3o."
191
+ },
192
+ "attribute": "legend-enabled",
193
+ "reflect": false,
194
+ "defaultValue": "true"
195
+ },
196
+ "series": {
197
+ "type": "unknown",
198
+ "mutable": false,
199
+ "complexType": {
200
+ "original": "ChartSerie | Array<ChartSerie>",
201
+ "resolved": "ChartSerie[] | ({ data: (number | ChartSerieData)[]; name?: string; color?: string; type?: \"line\" | \"column\" | \"bar\"; yAxis?: number; toolTipFormatter?: (serieName: string, xAxis: string | number, yAxis: number, dataName: string, percentage: number) => string; showDataLabel?: boolean; })",
202
+ "references": {
203
+ "ChartSerie": {
204
+ "location": "import",
205
+ "path": "./interfaces/ChartSerie"
206
+ },
207
+ "Array": {
208
+ "location": "global"
209
+ }
210
+ }
211
+ },
212
+ "required": false,
213
+ "optional": false,
214
+ "docs": {
215
+ "tags": [],
216
+ "text": "Define as series a serem apresentadas no gr\u00E1fico"
217
+ }
218
+ },
219
+ "width": {
220
+ "type": "number",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "number",
224
+ "resolved": "number",
225
+ "references": {}
226
+ },
227
+ "required": false,
228
+ "optional": false,
229
+ "docs": {
230
+ "tags": [],
231
+ "text": "Define uma largura do gr\u00E1fico"
232
+ },
233
+ "attribute": "width",
234
+ "reflect": false
235
+ },
236
+ "height": {
237
+ "type": "number",
238
+ "mutable": false,
239
+ "complexType": {
240
+ "original": "number",
241
+ "resolved": "number",
242
+ "references": {}
243
+ },
244
+ "required": false,
245
+ "optional": false,
246
+ "docs": {
247
+ "tags": [],
248
+ "text": "Define a altura do gr\u00E1fico"
249
+ },
250
+ "attribute": "height",
251
+ "reflect": false
252
+ }
253
+ };
254
+ }
255
+ static get events() {
256
+ return [{
257
+ "method": "ezSerieClick",
258
+ "name": "ezSerieClick",
259
+ "bubbles": true,
260
+ "cancelable": true,
261
+ "composed": true,
262
+ "docs": {
263
+ "tags": [],
264
+ "text": "Evento emitido quando ocorre um click em uma serie do gr\u00E1fico"
265
+ },
266
+ "complexType": {
267
+ "original": "SerieClickEvent",
268
+ "resolved": "{ name: string; data: number[]; type: string; yAxis: number; }",
269
+ "references": {
270
+ "SerieClickEvent": {
271
+ "location": "import",
272
+ "path": "./interfaces/ChartSerie"
273
+ }
274
+ }
275
+ }
276
+ }];
277
+ }
278
+ static get watchers() {
279
+ return [{
280
+ "propName": "type",
281
+ "methodName": "handleTypeChange"
282
+ }];
283
+ }
284
+ }
@@ -0,0 +1,14 @@
1
+ export class ChartContext {
2
+ constructor(strategy) {
3
+ this.strategy = strategy;
4
+ }
5
+ setStrategy(strategy) {
6
+ this.strategy = strategy;
7
+ }
8
+ render(container, series, xAxis, yAxis, options) {
9
+ return this.strategy.render(container, series, xAxis, yAxis, options);
10
+ }
11
+ destroy() {
12
+ return this.strategy.destroy();
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ export var ChartType;
2
+ (function (ChartType) {
3
+ ChartType["COLUMN"] = "column";
4
+ ChartType["BAR"] = "bar";
5
+ ChartType["LINE"] = "line";
6
+ ChartType["PIE"] = "pie";
7
+ ChartType["DONUT"] = "donut";
8
+ })(ChartType || (ChartType = {}));
@@ -0,0 +1,5 @@
1
+ export * from './ChartContext';
2
+ export * from './ChartStrategies';
3
+ export * from './ChartType';
4
+ export * from './ChartAxis';
5
+ export * from './ChartSerie';
@@ -0,0 +1,137 @@
1
+ export const mockChartProp = {
2
+ chartTitle: "Titulo do gráfico",
3
+ chartSubTitle: "Sub-titulo do gráfico",
4
+ series: [{
5
+ name: 'Qtd. Vendas',
6
+ data: [23, 20, 22, 26, 24, 28],
7
+ yAxis: 1,
8
+ showDataLabel: true,
9
+ }, {
10
+ name: 'Vlr. Vendas',
11
+ data: [25600, 21600, 24500, 26890, 20560, 22508],
12
+ yAxis: 0,
13
+ toolTipFormatter: jest.fn(),
14
+ }],
15
+ yAxis: [{
16
+ text: 'Valor das vendas no semestre',
17
+ },
18
+ {
19
+ text: 'Quantidade de itens vendidos',
20
+ invertedPosition: true,
21
+ }],
22
+ xAxis: {
23
+ text: 'Defina uma descrição para o eixo',
24
+ formatter: jest.fn(),
25
+ color: '#008561',
26
+ categories: ['Jan', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun']
27
+ },
28
+ }
29
+
30
+ export const expectChart = {
31
+ title: { text: "Titulo do gráfico" },
32
+ subtitle: { text: "Sub-titulo do gráfico" },
33
+ tooltip: { formatter: function () { return jest.fn(); } },
34
+ yAxis: [
35
+ {
36
+ title: { text: "Valor das vendas no semestre" }
37
+ },
38
+ {
39
+ title: { text: "Quantidade de itens vendidos" },
40
+ opposite: true,
41
+ },
42
+ ],
43
+ xAxis: {
44
+ categories: ["Jan", "Feb", "Mar", "Abr", "Mai", "Jun"],
45
+ title: {
46
+ text: "Defina uma descrição para o eixo",
47
+ style: { color: "#008561" }
48
+ }
49
+ },
50
+ series: [{
51
+ name: "Qtd. Vendas",
52
+ data: [23, 20, 22, 26, 24, 28],
53
+ dataLabels: { enabled: true },
54
+ yAxis: 1,
55
+ }, {
56
+ name: "Vlr. Vendas",
57
+ data: [25600, 21600, 24500, 26890, 20560, 22508],
58
+ yAxis: 0,
59
+ }],
60
+ rules: [
61
+ {
62
+ condition: { maxWidth: 500 },
63
+ chartOptions: {
64
+ legend: { enabled: false },
65
+ xAxis: {
66
+ labels: { enabled: false },
67
+ gridLineWidth: 0,
68
+ },
69
+ yAxis: {
70
+ labels: { enabled: false },
71
+ gridLineWidth: 0,
72
+ },
73
+ },
74
+ },
75
+ {
76
+ condition: { maxWidth: 600 },
77
+ chartOptions: {
78
+ xAxis: {
79
+ labels: {
80
+ style: { fontSize: "10px" },
81
+ },
82
+ },
83
+ yAxis: {
84
+ labels: {
85
+ style: { fontSize: "10px" },
86
+ },
87
+ },
88
+ title: {
89
+ style: { fontSize: "14px" },
90
+ },
91
+ subtitle: {
92
+ style: { fontSize: "12px" },
93
+ },
94
+ },
95
+ },
96
+ {
97
+ condition: { maxWidth: 400 },
98
+ chartOptions: {
99
+ chart: { margin: [10, 10, 15, 10] },
100
+ subtitle: { text: null },
101
+ title: { text: null },
102
+ },
103
+ },
104
+ ],
105
+ credits: { enabled: false },
106
+ }
107
+
108
+
109
+ export const mockChartPieProp = {
110
+ chartTitle: "Titulo do gráfico",
111
+ chartSubTitle: "Sub-titulo do gráfico",
112
+ series: {
113
+ name: 'venda',
114
+ data: [
115
+ { name: 'Chrome', y: 74.03 },
116
+ { name: 'Edge', y: 12.66 },
117
+ { name: 'Firefox', y: 4 },
118
+ { name: 'Internet Explorer', y: 2 },
119
+ { name: 'Other', y: 3 }
120
+ ],
121
+ showDataLabel: true,
122
+ }
123
+ }
124
+
125
+ export const expectPieChart = {
126
+ series: [{
127
+ name: "venda",
128
+ data: [
129
+ { name: 'Chrome', y: 74.03 },
130
+ { name: 'Edge', y: 12.66 },
131
+ { name: 'Firefox', y: 4 },
132
+ { name: 'Internet Explorer', y: 2 },
133
+ { name: 'Other', y: 3 }
134
+ ],
135
+ dataLabels: { enabled: true },
136
+ }],
137
+ }
@@ -0,0 +1,146 @@
1
+ export class BaseHighChartsRender {
2
+ parseSerie(series) {
3
+ if (Array.isArray(series)) {
4
+ const seriesOptions = series.map(serie => this.chartSerieToSeriesOptions(serie));
5
+ return seriesOptions;
6
+ }
7
+ const seriesOptions = this.chartSerieToSeriesOptions(series);
8
+ return [seriesOptions];
9
+ }
10
+ parseAxis(axis) {
11
+ if (Array.isArray(axis)) {
12
+ const axisOptions = axis.map(value => this.chartAxisToAxisOptions(value));
13
+ return axisOptions;
14
+ }
15
+ const axisOptions = this.chartAxisToAxisOptions(axis);
16
+ return axisOptions;
17
+ }
18
+ parseTitle(title) {
19
+ return {
20
+ text: title,
21
+ };
22
+ }
23
+ parseSubTitle(subTtile) {
24
+ return {
25
+ text: subTtile,
26
+ };
27
+ }
28
+ buildFormatterTooltip(series) {
29
+ const seriesArray = Array.isArray(series) ? series : [series];
30
+ return {
31
+ formatter: function (tooltip) {
32
+ const indexSerie = seriesArray.findIndex(serie => serie.name === this.series.name && serie.toolTipFormatter);
33
+ if (indexSerie !== -1) {
34
+ return seriesArray[indexSerie].toolTipFormatter(this.series.name, this.x, this.y, this.point.name, this.point.percentage);
35
+ }
36
+ return tooltip.defaultFormatter.call(this, tooltip);
37
+ }
38
+ };
39
+ }
40
+ buildOnClickCallBack(evt) {
41
+ return function (_e) {
42
+ evt.emit({
43
+ name: this.series.name,
44
+ data: this.series.data,
45
+ type: this.series.type,
46
+ yAxis: this.x,
47
+ });
48
+ };
49
+ }
50
+ buildResposiveConfig() {
51
+ return {
52
+ rules: [
53
+ {
54
+ condition: {
55
+ maxWidth: 500
56
+ },
57
+ chartOptions: {
58
+ legend: {
59
+ enabled: false
60
+ },
61
+ xAxis: {
62
+ labels: {
63
+ enabled: false
64
+ },
65
+ gridLineWidth: 0
66
+ },
67
+ yAxis: {
68
+ labels: {
69
+ enabled: false
70
+ },
71
+ gridLineWidth: 0
72
+ }
73
+ }
74
+ },
75
+ {
76
+ condition: {
77
+ maxWidth: 600
78
+ },
79
+ chartOptions: {
80
+ xAxis: {
81
+ labels: {
82
+ style: {
83
+ fontSize: '10px'
84
+ }
85
+ }
86
+ },
87
+ yAxis: {
88
+ labels: {
89
+ style: {
90
+ fontSize: '10px'
91
+ },
92
+ }
93
+ },
94
+ title: {
95
+ style: {
96
+ fontSize: '14px'
97
+ }
98
+ },
99
+ subtitle: {
100
+ style: {
101
+ fontSize: '12px'
102
+ }
103
+ }
104
+ }
105
+ },
106
+ {
107
+ condition: {
108
+ maxWidth: 400
109
+ },
110
+ chartOptions: {
111
+ chart: {
112
+ margin: [10, 10, 15, 10],
113
+ },
114
+ subtitle: {
115
+ text: null
116
+ },
117
+ title: {
118
+ text: null
119
+ }
120
+ }
121
+ }
122
+ ]
123
+ };
124
+ }
125
+ buildDefaultChartOptions() {
126
+ return {
127
+ credits: {
128
+ enabled: false
129
+ }
130
+ };
131
+ }
132
+ chartSerieToSeriesOptions(serie) {
133
+ const { name, data, color, showDataLabel, type, yAxis } = serie;
134
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (name && { name })), (type && { type })), (data && { data })), (color && { color })), (showDataLabel && { dataLabels: { enabled: showDataLabel } })), (yAxis !== undefined && { yAxis }));
135
+ }
136
+ chartAxisToAxisOptions(axis) {
137
+ const { categories, color, text, invertedPosition, formatter } = axis;
138
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, (categories && { categories })), (text && {
139
+ title: Object.assign({ text }, (color && { style: { color } }))
140
+ })), (formatter && {
141
+ labels: {
142
+ formatter: function () { return formatter(this.value); },
143
+ }
144
+ })), (invertedPosition && { opposite: invertedPosition }));
145
+ }
146
+ }
@@ -41,8 +41,6 @@ export class EzCustomFormInput {
41
41
  value: this.value,
42
42
  name: this.formViewField.name,
43
43
  currentEditor: this.builderFallback(this.formViewField),
44
- setValue: (value) => this.setValue(value),
45
- getValue: this.getValue,
46
44
  editorMetadata: {
47
45
  label: this.formViewField.label,
48
46
  hidden: ((_a = this.formViewField.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
@@ -72,12 +70,6 @@ export class EzCustomFormInput {
72
70
  gui.setAttribute('value', this.value);
73
71
  this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
74
72
  }
75
- setValue(value) {
76
- this.value = value;
77
- }
78
- getValue() {
79
- return this.value;
80
- }
81
73
  handleValue(gui) {
82
74
  //@ts-ignore
83
75
  gui.$children$.forEach((child) => {
@@ -136,7 +128,7 @@ export class EzCustomFormInput {
136
128
  },
137
129
  "value": {
138
130
  "type": "any",
139
- "mutable": true,
131
+ "mutable": false,
140
132
  "complexType": {
141
133
  "original": "any",
142
134
  "resolved": "any",
@@ -23,7 +23,7 @@ export class EzFormView {
23
23
  */
24
24
  async setFieldProp(fieldName, propName, value) {
25
25
  const fields = this.fields.map(field => {
26
- if (field.name === fieldName) {
26
+ if (field.name === fieldName && (value || value === 0)) {
27
27
  field.props = field.props || {};
28
28
  field.props[propName] = value;
29
29
  }
@@ -1,7 +1,8 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const buildDecimal = ({ name, label, readOnly, props, contextName, canShowError }) => {
3
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
4
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
3
+ var _a, _b;
4
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
5
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
5
6
  return buildNumeric(name, label, readOnly, precision, prettyPrecision, contextName, canShowError);
6
7
  };
7
8
  export const buildInteger = ({ name, label, readOnly, contextName, canShowError }) => {
@@ -670,7 +670,7 @@ export default class AgGridController {
670
670
  showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
671
671
  },
672
672
  valueFormatter: params => {
673
- if (params.value === undefined) {
673
+ if (params.value === undefined || params.value === null) {
674
674
  return "";
675
675
  }
676
676
  if (params.value instanceof Promise) {
@@ -1,7 +1,8 @@
1
1
  import { HTMLBuilder } from "@sankhyalabs/core";
2
2
  export const buildDecimal = ({ readOnly, props }) => {
3
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
4
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
3
+ var _a, _b;
4
+ const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
5
+ const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
5
6
  return buildNumeric(readOnly, precision, prettyPrecision);
6
7
  };
7
8
  export const buildInteger = ({ readOnly }) => {