@sankhyalabs/ezui 1.1.8 → 1.1.9
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.
- package/README.md +72 -72
- package/dist/cjs/{DataUnit-28b290cb.js → DataUnit-9a4a35ca.js} +415 -371
- package/dist/cjs/ez-action-chip.cjs.entry.js +41 -41
- package/dist/cjs/ez-button_14.cjs.entry.js +1911 -1911
- package/dist/cjs/ez-label-chip.cjs.entry.js +120 -120
- package/dist/cjs/ez-modal.cjs.entry.js +104 -104
- package/dist/cjs/ez-number-input.cjs.entry.js +236 -236
- package/dist/cjs/ez-time-input.cjs.entry.js +168 -168
- package/dist/cjs/form-metadata.cjs.entry.js +65 -65
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +82 -82
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +109 -109
- package/dist/collection/components/ez-button/ez-button.css +94 -94
- package/dist/collection/components/ez-button/ez-button.js +125 -125
- package/dist/collection/components/ez-calendar/ez-calendar.css +210 -210
- package/dist/collection/components/ez-calendar/ez-calendar.js +215 -215
- package/dist/collection/components/ez-check/ez-check.css +265 -265
- package/dist/collection/components/ez-check/ez-check.js +168 -168
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +67 -67
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +108 -108
- package/dist/collection/components/ez-combo-box/ez-combo-box-interfaces.js +2 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +167 -167
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +363 -363
- package/dist/collection/components/ez-date-input/ez-date-input.css +38 -38
- package/dist/collection/components/ez-date-input/ez-date-input.js +172 -172
- package/dist/collection/components/ez-form/ez-form.css +19 -19
- package/dist/collection/components/ez-form/ez-form.js +368 -368
- package/dist/collection/components/ez-form/store/Form.actions.js +132 -132
- package/dist/collection/components/ez-form/store/Form.reducer.js +194 -194
- package/dist/collection/components/ez-form/store/Form.selectors.js +44 -44
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +251 -207
- package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +16 -16
- package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +23 -23
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +173 -173
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +14 -14
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +71 -71
- package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +27 -27
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +40 -40
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +27 -27
- package/dist/collection/components/ez-icon/ez-icon.css +36 -36
- package/dist/collection/components/ez-icon/ez-icon.js +56 -56
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +117 -117
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +276 -276
- package/dist/collection/components/ez-modal/ez-modal.css +86 -86
- package/dist/collection/components/ez-modal/ez-modal.js +224 -224
- package/dist/collection/components/ez-number-input/ez-number-input.css +144 -144
- package/dist/collection/components/ez-number-input/ez-number-input.js +465 -465
- package/dist/collection/components/ez-popover/ez-popover.css +38 -38
- package/dist/collection/components/ez-popover/ez-popover.js +323 -323
- package/dist/collection/components/ez-search/ez-search.css +295 -295
- package/dist/collection/components/ez-search/ez-search.js +527 -527
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +125 -125
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +283 -283
- package/dist/collection/components/ez-text-area/ez-text-area.css +139 -139
- package/dist/collection/components/ez-text-area/ez-text-area.js +267 -267
- package/dist/collection/components/ez-text-input/ez-text-input.css +169 -169
- package/dist/collection/components/ez-text-input/ez-text-input.js +395 -395
- package/dist/collection/components/ez-time-input/ez-time-input.css +155 -155
- package/dist/collection/components/ez-time-input/ez-time-input.js +326 -326
- package/dist/collection/index.js +1 -1
- package/dist/collection/servidor.js +100 -100
- package/dist/collection/utils/FloatingManager.js +15 -15
- package/dist/collection/utils/utils.js +6 -6
- package/dist/custom-elements/index.js +3125 -3081
- package/dist/esm/{DataUnit-69e518fa.js → DataUnit-d5d4c9a3.js} +415 -371
- package/dist/esm/ez-action-chip.entry.js +41 -41
- package/dist/esm/ez-button_14.entry.js +1911 -1911
- package/dist/esm/ez-label-chip.entry.js +120 -120
- package/dist/esm/ez-modal.entry.js +104 -104
- package/dist/esm/ez-number-input.entry.js +236 -236
- package/dist/esm/ez-time-input.entry.js +168 -168
- package/dist/esm/form-metadata.entry.js +65 -65
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-b0974f4f.entry.js → p-0fcdfb51.entry.js} +1 -1
- package/dist/ezui/p-dac7a6c2.js +1 -0
- package/dist/ezui/{p-db11c600.entry.js → p-dbef7060.entry.js} +1 -1
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +16 -16
- package/dist/types/components/ez-button/ez-button.d.ts +20 -20
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +42 -42
- package/dist/types/components/ez-check/ez-check.d.ts +32 -32
- package/dist/types/components/ez-collapsable-box/ez-collapsable-box.d.ts +18 -18
- package/dist/types/components/ez-combo-box/ez-combo-box-interfaces.d.ts +4 -4
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +68 -68
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +31 -31
- package/dist/types/components/ez-form/ez-form.d.ts +26 -31
- package/dist/types/components/ez-form/store/Form.actions.d.ts +111 -111
- package/dist/types/components/ez-form/store/Form.reducer.d.ts +20 -20
- package/dist/types/components/ez-form/store/Form.selectors.d.ts +14 -14
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +60 -55
- package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +41 -41
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +15 -15
- package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +3 -3
- package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +10 -10
- package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +12 -12
- package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +13 -13
- package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +17 -17
- package/dist/types/components/ez-icon/ez-icon.d.ts +5 -5
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +40 -40
- package/dist/types/components/ez-modal/ez-modal.d.ts +32 -32
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +73 -73
- package/dist/types/components/ez-popover/ez-popover.d.ts +52 -52
- package/dist/types/components/ez-search/ez-search.d.ts +95 -95
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +31 -31
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +49 -49
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +64 -64
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +53 -53
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/package.json +114 -114
- package/dist/ezui/p-10ef58b3.js +0 -1
- package/react/components.d.ts +0 -22
- package/react/components.js +0 -25
- package/react/components.js.map +0 -1
- package/react/react-component-lib/createComponent.d.ts +0 -10
- package/react/react-component-lib/createComponent.js +0 -59
- package/react/react-component-lib/createComponent.js.map +0 -1
- package/react/react-component-lib/createOverlayComponent.d.ts +0 -20
- package/react/react-component-lib/createOverlayComponent.js +0 -89
- package/react/react-component-lib/createOverlayComponent.js.map +0 -1
- package/react/react-component-lib/index.d.ts +0 -2
- package/react/react-component-lib/index.js +0 -3
- package/react/react-component-lib/index.js.map +0 -1
- package/react/react-component-lib/interfaces.d.ts +0 -29
- package/react/react-component-lib/interfaces.js +0 -1
- package/react/react-component-lib/interfaces.js.map +0 -1
- package/react/react-component-lib/utils/attachProps.d.ts +0 -12
- package/react/react-component-lib/utils/attachProps.js +0 -96
- package/react/react-component-lib/utils/attachProps.js.map +0 -1
- package/react/react-component-lib/utils/case.d.ts +0 -2
- package/react/react-component-lib/utils/case.js +0 -7
- package/react/react-component-lib/utils/case.js.map +0 -1
- package/react/react-component-lib/utils/dev.d.ts +0 -2
- package/react/react-component-lib/utils/dev.js +0 -13
- package/react/react-component-lib/utils/dev.js.map +0 -1
- package/react/react-component-lib/utils/index.d.ts +0 -7
- package/react/react-component-lib/utils/index.js +0 -21
- package/react/react-component-lib/utils/index.js.map +0 -1
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
import { Component, Host, h, Element, Prop } from '@stencil/core';
|
|
2
|
-
import DataUnit from './DataUnit';
|
|
3
|
-
export class FormMetadata {
|
|
4
|
-
buildField(element) {
|
|
5
|
-
const label = element.textContent;
|
|
6
|
-
let name = element.getAttribute("name") || label;
|
|
7
|
-
let userInterface = element.getAttribute("ui") || "SHORTTEXT";
|
|
8
|
-
const defaultValue = element.getAttribute("defaultValue");
|
|
9
|
-
const required = element.getAttribute("required") === "true";
|
|
10
|
-
const readOnly = element.getAttribute("readonly") === "true";
|
|
11
|
-
return { name, userInterface, label, defaultValue, required, readOnly };
|
|
12
|
-
}
|
|
13
|
-
buildFieldSet(element) {
|
|
14
|
-
const label = element.getAttribute("label");
|
|
15
|
-
const fields = Array.from(element.getElementsByTagName('FIELD')).map(f => this.buildField(f));
|
|
16
|
-
return { label, fields };
|
|
17
|
-
}
|
|
18
|
-
fromElements(elements, label, name, dataUnit, many, autoLoad) {
|
|
19
|
-
const form = {
|
|
20
|
-
name: name || label,
|
|
21
|
-
label,
|
|
22
|
-
autoLoad
|
|
23
|
-
};
|
|
24
|
-
if (dataUnit) {
|
|
25
|
-
form.dataUnit = new DataUnit(dataUnit, many ? 'N' : '1');
|
|
26
|
-
}
|
|
27
|
-
Array.from(elements).forEach(child => {
|
|
28
|
-
const tagName = child.tagName.toUpperCase();
|
|
29
|
-
switch (tagName) {
|
|
30
|
-
case 'FIELD':
|
|
31
|
-
if (!form.items) {
|
|
32
|
-
form.items = [];
|
|
33
|
-
}
|
|
34
|
-
form.items.push(this.buildField(child));
|
|
35
|
-
break;
|
|
36
|
-
case 'FIELD-SET':
|
|
37
|
-
if (!form.items) {
|
|
38
|
-
form.items = [];
|
|
39
|
-
}
|
|
40
|
-
form.items.push(this.buildFieldSet(child));
|
|
41
|
-
break;
|
|
42
|
-
case 'SUB-FORM':
|
|
43
|
-
if (!form.subForms) {
|
|
44
|
-
form.subForms = [];
|
|
45
|
-
}
|
|
46
|
-
const label = child.getAttribute("label") || "Subform " + (form.subForms.length + 1);
|
|
47
|
-
const name = child.getAttribute("name") || label;
|
|
48
|
-
form.subForms.push(this.fromElements(child.children, label, name, child.getAttribute("dataunit"), child.hasAttribute("many"), child.getAttribute("autoload") === "true"));
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return form;
|
|
53
|
-
}
|
|
54
|
-
componentWillLoad() {
|
|
55
|
-
if (!this.dataunit) {
|
|
56
|
-
this.dataunit = "dataunit_" + (this.name || this.label || new Date().getTime());
|
|
57
|
-
}
|
|
58
|
-
this.metadata = this.fromElements(this._host.children, this.label, this.name, this.dataunit, this.many, this.autoload);
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
return h(Host, null);
|
|
62
|
-
}
|
|
63
|
-
static get is() { return "form-metadata"; }
|
|
64
|
-
static get encapsulation() { return "shadow"; }
|
|
65
|
-
static get properties() { return {
|
|
66
|
-
"name": {
|
|
67
|
-
"type": "string",
|
|
68
|
-
"mutable": false,
|
|
69
|
-
"complexType": {
|
|
70
|
-
"original": "string",
|
|
71
|
-
"resolved": "string",
|
|
72
|
-
"references": {}
|
|
73
|
-
},
|
|
74
|
-
"required": false,
|
|
75
|
-
"optional": false,
|
|
76
|
-
"docs": {
|
|
77
|
-
"tags": [],
|
|
78
|
-
"text": ""
|
|
79
|
-
},
|
|
80
|
-
"attribute": "name",
|
|
81
|
-
"reflect": false
|
|
82
|
-
},
|
|
83
|
-
"label": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"mutable": false,
|
|
86
|
-
"complexType": {
|
|
87
|
-
"original": "string",
|
|
88
|
-
"resolved": "string",
|
|
89
|
-
"references": {}
|
|
90
|
-
},
|
|
91
|
-
"required": false,
|
|
92
|
-
"optional": false,
|
|
93
|
-
"docs": {
|
|
94
|
-
"tags": [],
|
|
95
|
-
"text": ""
|
|
96
|
-
},
|
|
97
|
-
"attribute": "label",
|
|
98
|
-
"reflect": false
|
|
99
|
-
},
|
|
100
|
-
"dataunit": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"mutable": true,
|
|
103
|
-
"complexType": {
|
|
104
|
-
"original": "string",
|
|
105
|
-
"resolved": "string",
|
|
106
|
-
"references": {}
|
|
107
|
-
},
|
|
108
|
-
"required": false,
|
|
109
|
-
"optional": false,
|
|
110
|
-
"docs": {
|
|
111
|
-
"tags": [],
|
|
112
|
-
"text": ""
|
|
113
|
-
},
|
|
114
|
-
"attribute": "dataunit",
|
|
115
|
-
"reflect": false
|
|
116
|
-
},
|
|
117
|
-
"many": {
|
|
118
|
-
"type": "boolean",
|
|
119
|
-
"mutable": false,
|
|
120
|
-
"complexType": {
|
|
121
|
-
"original": "boolean",
|
|
122
|
-
"resolved": "boolean",
|
|
123
|
-
"references": {}
|
|
124
|
-
},
|
|
125
|
-
"required": false,
|
|
126
|
-
"optional": false,
|
|
127
|
-
"docs": {
|
|
128
|
-
"tags": [],
|
|
129
|
-
"text": ""
|
|
130
|
-
},
|
|
131
|
-
"attribute": "many",
|
|
132
|
-
"reflect": false
|
|
133
|
-
},
|
|
134
|
-
"autoload": {
|
|
135
|
-
"type": "boolean",
|
|
136
|
-
"mutable": false,
|
|
137
|
-
"complexType": {
|
|
138
|
-
"original": "boolean",
|
|
139
|
-
"resolved": "boolean",
|
|
140
|
-
"references": {}
|
|
141
|
-
},
|
|
142
|
-
"required": false,
|
|
143
|
-
"optional": false,
|
|
144
|
-
"docs": {
|
|
145
|
-
"tags": [],
|
|
146
|
-
"text": ""
|
|
147
|
-
},
|
|
148
|
-
"attribute": "autoload",
|
|
149
|
-
"reflect": false
|
|
150
|
-
},
|
|
151
|
-
"metadata": {
|
|
152
|
-
"type": "unknown",
|
|
153
|
-
"mutable": true,
|
|
154
|
-
"complexType": {
|
|
155
|
-
"original": "Form",
|
|
156
|
-
"resolved": "Form",
|
|
157
|
-
"references": {
|
|
158
|
-
"Form": {
|
|
159
|
-
"location": "import",
|
|
160
|
-
"path": "./FormMetadata"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"required": false,
|
|
165
|
-
"optional": false,
|
|
166
|
-
"docs": {
|
|
167
|
-
"tags": [],
|
|
168
|
-
"text": ""
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}; }
|
|
172
|
-
static get elementRef() { return "_host"; }
|
|
173
|
-
}
|
|
1
|
+
import { Component, Host, h, Element, Prop } from '@stencil/core';
|
|
2
|
+
import DataUnit from './DataUnit';
|
|
3
|
+
export class FormMetadata {
|
|
4
|
+
buildField(element) {
|
|
5
|
+
const label = element.textContent;
|
|
6
|
+
let name = element.getAttribute("name") || label;
|
|
7
|
+
let userInterface = element.getAttribute("ui") || "SHORTTEXT";
|
|
8
|
+
const defaultValue = element.getAttribute("defaultValue");
|
|
9
|
+
const required = element.getAttribute("required") === "true";
|
|
10
|
+
const readOnly = element.getAttribute("readonly") === "true";
|
|
11
|
+
return { name, userInterface, label, defaultValue, required, readOnly };
|
|
12
|
+
}
|
|
13
|
+
buildFieldSet(element) {
|
|
14
|
+
const label = element.getAttribute("label");
|
|
15
|
+
const fields = Array.from(element.getElementsByTagName('FIELD')).map(f => this.buildField(f));
|
|
16
|
+
return { label, fields };
|
|
17
|
+
}
|
|
18
|
+
fromElements(elements, label, name, dataUnit, many, autoLoad) {
|
|
19
|
+
const form = {
|
|
20
|
+
name: name || label,
|
|
21
|
+
label,
|
|
22
|
+
autoLoad
|
|
23
|
+
};
|
|
24
|
+
if (dataUnit) {
|
|
25
|
+
form.dataUnit = new DataUnit(dataUnit, many ? 'N' : '1');
|
|
26
|
+
}
|
|
27
|
+
Array.from(elements).forEach(child => {
|
|
28
|
+
const tagName = child.tagName.toUpperCase();
|
|
29
|
+
switch (tagName) {
|
|
30
|
+
case 'FIELD':
|
|
31
|
+
if (!form.items) {
|
|
32
|
+
form.items = [];
|
|
33
|
+
}
|
|
34
|
+
form.items.push(this.buildField(child));
|
|
35
|
+
break;
|
|
36
|
+
case 'FIELD-SET':
|
|
37
|
+
if (!form.items) {
|
|
38
|
+
form.items = [];
|
|
39
|
+
}
|
|
40
|
+
form.items.push(this.buildFieldSet(child));
|
|
41
|
+
break;
|
|
42
|
+
case 'SUB-FORM':
|
|
43
|
+
if (!form.subForms) {
|
|
44
|
+
form.subForms = [];
|
|
45
|
+
}
|
|
46
|
+
const label = child.getAttribute("label") || "Subform " + (form.subForms.length + 1);
|
|
47
|
+
const name = child.getAttribute("name") || label;
|
|
48
|
+
form.subForms.push(this.fromElements(child.children, label, name, child.getAttribute("dataunit"), child.hasAttribute("many"), child.getAttribute("autoload") === "true"));
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return form;
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
if (!this.dataunit) {
|
|
56
|
+
this.dataunit = "dataunit_" + (this.name || this.label || new Date().getTime());
|
|
57
|
+
}
|
|
58
|
+
this.metadata = this.fromElements(this._host.children, this.label, this.name, this.dataunit, this.many, this.autoload);
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return h(Host, null);
|
|
62
|
+
}
|
|
63
|
+
static get is() { return "form-metadata"; }
|
|
64
|
+
static get encapsulation() { return "shadow"; }
|
|
65
|
+
static get properties() { return {
|
|
66
|
+
"name": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "string",
|
|
71
|
+
"resolved": "string",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": ""
|
|
79
|
+
},
|
|
80
|
+
"attribute": "name",
|
|
81
|
+
"reflect": false
|
|
82
|
+
},
|
|
83
|
+
"label": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "string",
|
|
88
|
+
"resolved": "string",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": ""
|
|
96
|
+
},
|
|
97
|
+
"attribute": "label",
|
|
98
|
+
"reflect": false
|
|
99
|
+
},
|
|
100
|
+
"dataunit": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": true,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": ""
|
|
113
|
+
},
|
|
114
|
+
"attribute": "dataunit",
|
|
115
|
+
"reflect": false
|
|
116
|
+
},
|
|
117
|
+
"many": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "boolean",
|
|
122
|
+
"resolved": "boolean",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": ""
|
|
130
|
+
},
|
|
131
|
+
"attribute": "many",
|
|
132
|
+
"reflect": false
|
|
133
|
+
},
|
|
134
|
+
"autoload": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "boolean",
|
|
139
|
+
"resolved": "boolean",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": false,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": ""
|
|
147
|
+
},
|
|
148
|
+
"attribute": "autoload",
|
|
149
|
+
"reflect": false
|
|
150
|
+
},
|
|
151
|
+
"metadata": {
|
|
152
|
+
"type": "unknown",
|
|
153
|
+
"mutable": true,
|
|
154
|
+
"complexType": {
|
|
155
|
+
"original": "Form",
|
|
156
|
+
"resolved": "Form",
|
|
157
|
+
"references": {
|
|
158
|
+
"Form": {
|
|
159
|
+
"location": "import",
|
|
160
|
+
"path": "./FormMetadata"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": ""
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}; }
|
|
172
|
+
static get elementRef() { return "_host"; }
|
|
173
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Component, Host, h } from '@stencil/core';
|
|
2
|
-
export class PlaceHolder {
|
|
3
|
-
render() {
|
|
4
|
-
return h(Host, null);
|
|
5
|
-
}
|
|
6
|
-
static get is() { return "place-holder"; }
|
|
7
|
-
static get encapsulation() { return "shadow"; }
|
|
8
|
-
static get originalStyleUrls() { return {
|
|
9
|
-
"$": ["css/place-holder.css"]
|
|
10
|
-
}; }
|
|
11
|
-
static get styleUrls() { return {
|
|
12
|
-
"$": ["./css/place-holder.css"]
|
|
13
|
-
}; }
|
|
14
|
-
}
|
|
1
|
+
import { Component, Host, h } from '@stencil/core';
|
|
2
|
+
export class PlaceHolder {
|
|
3
|
+
render() {
|
|
4
|
+
return h(Host, null);
|
|
5
|
+
}
|
|
6
|
+
static get is() { return "place-holder"; }
|
|
7
|
+
static get encapsulation() { return "shadow"; }
|
|
8
|
+
static get originalStyleUrls() { return {
|
|
9
|
+
"$": ["css/place-holder.css"]
|
|
10
|
+
}; }
|
|
11
|
+
static get styleUrls() { return {
|
|
12
|
+
"$": ["./css/place-holder.css"]
|
|
13
|
+
}; }
|
|
14
|
+
}
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { DateUtils } from "@sankhyalabs/core";
|
|
2
|
-
import { h } from "@stencil/core";
|
|
3
|
-
import { DependencyType } from "../FormMetadata";
|
|
4
|
-
function scrollToView(forceScroll, elem) {
|
|
5
|
-
if (forceScroll) {
|
|
6
|
-
window.requestAnimationFrame(() => elem.scrollIntoView());
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export const Field = ({ dataUnit, source, forceScroll }) => {
|
|
10
|
-
const { name, label, userInterface, properties, required, dependencies } = source;
|
|
11
|
-
const value = dataUnit.getValue(name) || null;
|
|
12
|
-
const loadingData = dataUnit.isLoading();
|
|
13
|
-
const formattedLabel = required ? `* ${label} (obrigatório)` : label;
|
|
14
|
-
const errorMessage = dataUnit.getErrorMessage(name);
|
|
15
|
-
const changeFieldHandler = (newValue) => {
|
|
16
|
-
dataUnit.changeValue(name, newValue);
|
|
17
|
-
};
|
|
18
|
-
switch (userInterface) {
|
|
19
|
-
case 'LONGTEXT':
|
|
20
|
-
return h("div", { class: "col col--sd-12 padding--small" },
|
|
21
|
-
h("ez-text-area", { label: formattedLabel, onInput: evt => changeFieldHandler(evt.target['value']), value: value || '', errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }));
|
|
22
|
-
case 'CHECKBOX':
|
|
23
|
-
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
24
|
-
h("ez-check", { onInput: evt => changeFieldHandler(evt.target['value']), ref: elem => scrollToView(forceScroll, elem) }));
|
|
25
|
-
case 'SWITCH':
|
|
26
|
-
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
27
|
-
h("div", { class: "row" },
|
|
28
|
-
h("div", { class: "col col--sd-2" },
|
|
29
|
-
h("ez-check", { mode: "switch", value: value === "S", ref: elem => scrollToView(forceScroll, elem) })),
|
|
30
|
-
h("div", { class: "col col--sd-10" },
|
|
31
|
-
h("label", { class: "text text--primary text--medium" }, label))));
|
|
32
|
-
case 'OPTIONSELECTOR':
|
|
33
|
-
const optsObj = JSON.parse(properties.find(prop => prop.name === 'options').value);
|
|
34
|
-
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
35
|
-
h("ez-combo-box", { value: value, label: formattedLabel, onEzChange: (event) => changeFieldHandler(event.target['value']), errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }, Object.keys(optsObj).map(key => h("option", { value: key }, optsObj[key]))));
|
|
36
|
-
case 'SEARCH':
|
|
37
|
-
const context = {};
|
|
38
|
-
properties.forEach(({ name, value }) => {
|
|
39
|
-
context[name] = value;
|
|
40
|
-
});
|
|
41
|
-
let criteriaList = [];
|
|
42
|
-
dependencies === null || dependencies === void 0 ? void 0 : dependencies.forEach(dependency => {
|
|
43
|
-
var _a;
|
|
44
|
-
if (dependency.type === DependencyType.SEARCHING) {
|
|
45
|
-
if (((_a = dependency.masterFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
46
|
-
let criteria = {
|
|
47
|
-
expression: dependency.expression,
|
|
48
|
-
paramNames: [...dependency.masterFields],
|
|
49
|
-
paramResolver: name => dataUnit.getValue(name)
|
|
50
|
-
};
|
|
51
|
-
criteriaList.push(criteria);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
if (criteriaList.length > 0) {
|
|
56
|
-
context['CRITERIA'] = criteriaList;
|
|
57
|
-
}
|
|
58
|
-
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
59
|
-
h("ez-search", { label: label, onEzChange: (event) => changeFieldHandler(event.target['value']), showvalue: true, value: value, loadexecutor: (argument, callback) => dataUnit.fieldSearchExecutor(argument, context, callback) }));
|
|
60
|
-
case 'DATE':
|
|
61
|
-
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
62
|
-
h("ez-date-input", { label: formattedLabel, enabled: true, value: !value ? null : DateUtils.clearTime(value), onEzChange: (event) => changeFieldHandler(event.target['value']), errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }));
|
|
63
|
-
//IMAGE, FILE, DATE, DATETIME, ELAPSEDTIME, DECIMALNUMBER, INTEGERNUMBER, PASSWORD, MASKEDTEXT, HTML
|
|
64
|
-
default:
|
|
65
|
-
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData
|
|
66
|
-
?
|
|
67
|
-
h("place-holder", null)
|
|
68
|
-
:
|
|
69
|
-
h("ez-text-input", { loading: loadingData, label: formattedLabel, onInput: (event) => changeFieldHandler(event.target['value']), value: value, errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }));
|
|
70
|
-
}
|
|
71
|
-
};
|
|
1
|
+
import { DateUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
import { DependencyType } from "../FormMetadata";
|
|
4
|
+
function scrollToView(forceScroll, elem) {
|
|
5
|
+
if (forceScroll) {
|
|
6
|
+
window.requestAnimationFrame(() => elem.scrollIntoView());
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export const Field = ({ dataUnit, source, forceScroll }) => {
|
|
10
|
+
const { name, label, userInterface, properties, required, dependencies } = source;
|
|
11
|
+
const value = dataUnit.getValue(name) || null;
|
|
12
|
+
const loadingData = dataUnit.isLoading();
|
|
13
|
+
const formattedLabel = required ? `* ${label} (obrigatório)` : label;
|
|
14
|
+
const errorMessage = dataUnit.getErrorMessage(name);
|
|
15
|
+
const changeFieldHandler = (newValue) => {
|
|
16
|
+
dataUnit.changeValue(name, newValue);
|
|
17
|
+
};
|
|
18
|
+
switch (userInterface) {
|
|
19
|
+
case 'LONGTEXT':
|
|
20
|
+
return h("div", { class: "col col--sd-12 padding--small" },
|
|
21
|
+
h("ez-text-area", { label: formattedLabel, onInput: evt => changeFieldHandler(evt.target['value']), value: value || '', errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }));
|
|
22
|
+
case 'CHECKBOX':
|
|
23
|
+
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
24
|
+
h("ez-check", { onInput: evt => changeFieldHandler(evt.target['value']), ref: elem => scrollToView(forceScroll, elem) }));
|
|
25
|
+
case 'SWITCH':
|
|
26
|
+
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
27
|
+
h("div", { class: "row" },
|
|
28
|
+
h("div", { class: "col col--sd-2" },
|
|
29
|
+
h("ez-check", { mode: "switch", value: value === "S", ref: elem => scrollToView(forceScroll, elem) })),
|
|
30
|
+
h("div", { class: "col col--sd-10" },
|
|
31
|
+
h("label", { class: "text text--primary text--medium" }, label))));
|
|
32
|
+
case 'OPTIONSELECTOR':
|
|
33
|
+
const optsObj = JSON.parse(properties.find(prop => prop.name === 'options').value);
|
|
34
|
+
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
35
|
+
h("ez-combo-box", { value: value, label: formattedLabel, onEzChange: (event) => changeFieldHandler(event.target['value']), errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }, Object.keys(optsObj).map(key => h("option", { value: key }, optsObj[key]))));
|
|
36
|
+
case 'SEARCH':
|
|
37
|
+
const context = {};
|
|
38
|
+
properties.forEach(({ name, value }) => {
|
|
39
|
+
context[name] = value;
|
|
40
|
+
});
|
|
41
|
+
let criteriaList = [];
|
|
42
|
+
dependencies === null || dependencies === void 0 ? void 0 : dependencies.forEach(dependency => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (dependency.type === DependencyType.SEARCHING) {
|
|
45
|
+
if (((_a = dependency.masterFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
46
|
+
let criteria = {
|
|
47
|
+
expression: dependency.expression,
|
|
48
|
+
paramNames: [...dependency.masterFields],
|
|
49
|
+
paramResolver: name => dataUnit.getValue(name)
|
|
50
|
+
};
|
|
51
|
+
criteriaList.push(criteria);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
if (criteriaList.length > 0) {
|
|
56
|
+
context['CRITERIA'] = criteriaList;
|
|
57
|
+
}
|
|
58
|
+
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
59
|
+
h("ez-search", { label: label, onEzChange: (event) => changeFieldHandler(event.target['value']), showvalue: true, value: value, loadexecutor: (argument, callback) => dataUnit.fieldSearchExecutor(argument, context, callback) }));
|
|
60
|
+
case 'DATE':
|
|
61
|
+
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" },
|
|
62
|
+
h("ez-date-input", { label: formattedLabel, enabled: true, value: !value ? null : DateUtils.clearTime(value), onEzChange: (event) => changeFieldHandler(event.target['value']), errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }));
|
|
63
|
+
//IMAGE, FILE, DATE, DATETIME, ELAPSEDTIME, DECIMALNUMBER, INTEGERNUMBER, PASSWORD, MASKEDTEXT, HTML
|
|
64
|
+
default:
|
|
65
|
+
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData
|
|
66
|
+
?
|
|
67
|
+
h("place-holder", null)
|
|
68
|
+
:
|
|
69
|
+
h("ez-text-input", { loading: loadingData, label: formattedLabel, onInput: (event) => changeFieldHandler(event.target['value']), value: value, errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem) }));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { collapseExpandGroup } from "../../store/Form.actions";
|
|
3
|
-
import { selectIsCollapsedFieldSet } from "../../store/Form.selectors";
|
|
4
|
-
import { Field } from "./Field";
|
|
5
|
-
export const FieldSet = ({ store, formName, source, dataUnit }) => {
|
|
6
|
-
const { label, fields } = source;
|
|
7
|
-
const fieldSetName = formName + label;
|
|
8
|
-
let isCollapsed = selectIsCollapsedFieldSet(store.getState(), formName + label);
|
|
9
|
-
let fieldToScroll;
|
|
10
|
-
source.fields.forEach((field) => {
|
|
11
|
-
if (fieldToScroll === undefined) {
|
|
12
|
-
const fieldError = dataUnit.getErrorMessage(field.name);
|
|
13
|
-
if (fieldError !== undefined && fieldError !== null && fieldError !== "") {
|
|
14
|
-
fieldToScroll = field.name;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
if (fieldToScroll) {
|
|
19
|
-
isCollapsed = false;
|
|
20
|
-
}
|
|
21
|
-
return h("div", { class: "col col--sd-12 padding--small" },
|
|
22
|
-
h("div", { class: "row margin-top--large" },
|
|
23
|
-
h("div", { class: "col col--sd-12 align--middle padding-horizontal--medium" },
|
|
24
|
-
h("ez-collapsable-box", { value: isCollapsed, label: label, onEzChange: () => store.dispatch(collapseExpandGroup(fieldSetName, !isCollapsed)) }),
|
|
25
|
-
isCollapsed ? null :
|
|
26
|
-
h("div", { class: "col col--sd-12" }, fields.map(field => h(Field, { source: field, dataUnit: dataUnit, forceScroll: fieldToScroll === field.name }))))));
|
|
27
|
-
};
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { collapseExpandGroup } from "../../store/Form.actions";
|
|
3
|
+
import { selectIsCollapsedFieldSet } from "../../store/Form.selectors";
|
|
4
|
+
import { Field } from "./Field";
|
|
5
|
+
export const FieldSet = ({ store, formName, source, dataUnit }) => {
|
|
6
|
+
const { label, fields } = source;
|
|
7
|
+
const fieldSetName = formName + label;
|
|
8
|
+
let isCollapsed = selectIsCollapsedFieldSet(store.getState(), formName + label);
|
|
9
|
+
let fieldToScroll;
|
|
10
|
+
source.fields.forEach((field) => {
|
|
11
|
+
if (fieldToScroll === undefined) {
|
|
12
|
+
const fieldError = dataUnit.getErrorMessage(field.name);
|
|
13
|
+
if (fieldError !== undefined && fieldError !== null && fieldError !== "") {
|
|
14
|
+
fieldToScroll = field.name;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
if (fieldToScroll) {
|
|
19
|
+
isCollapsed = false;
|
|
20
|
+
}
|
|
21
|
+
return h("div", { class: "col col--sd-12 padding--small" },
|
|
22
|
+
h("div", { class: "row margin-top--large" },
|
|
23
|
+
h("div", { class: "col col--sd-12 align--middle padding-horizontal--medium" },
|
|
24
|
+
h("ez-collapsable-box", { value: isCollapsed, label: label, onEzChange: () => store.dispatch(collapseExpandGroup(fieldSetName, !isCollapsed)) }),
|
|
25
|
+
isCollapsed ? null :
|
|
26
|
+
h("div", { class: "col col--sd-12" }, fields.map(field => h(Field, { source: field, dataUnit: dataUnit, forceScroll: fieldToScroll === field.name }))))));
|
|
27
|
+
};
|