@sankhyalabs/ezui 1.1.4 → 1.1.5

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 (186) hide show
  1. package/README.md +72 -72
  2. package/dist/{ezui/DataUnit-285bec19.js → cjs/DataUnit-6a98d9de.js} +379 -369
  3. package/dist/{ezui/index-919090de.js → cjs/RequestMetadata-2cd01e8a.js} +4 -383
  4. package/dist/cjs/ez-action-chip.cjs.entry.js +52 -0
  5. package/dist/cjs/ez-button_14.cjs.entry.js +3338 -0
  6. package/dist/cjs/ez-label-chip.cjs.entry.js +131 -0
  7. package/dist/cjs/ez-modal.cjs.entry.js +115 -0
  8. package/dist/cjs/ez-number-input.cjs.entry.js +248 -0
  9. package/dist/cjs/ez-time-input.cjs.entry.js +180 -0
  10. package/dist/cjs/ezui.cjs.js +19 -0
  11. package/dist/cjs/form-metadata.cjs.entry.js +74 -0
  12. package/dist/cjs/index-9403fe8f.js +1322 -0
  13. package/dist/cjs/index.cjs.js +2 -0
  14. package/dist/cjs/loader.cjs.js +21 -0
  15. package/dist/collection/collection-manifest.json +31 -0
  16. package/dist/collection/components/ez-action-chip/ez-action-chip.css +82 -0
  17. package/dist/collection/components/ez-action-chip/ez-action-chip.js +109 -0
  18. package/dist/collection/components/ez-button/ez-button.css +94 -0
  19. package/dist/collection/components/ez-button/ez-button.js +125 -0
  20. package/dist/collection/components/ez-calendar/ez-calendar.css +210 -0
  21. package/dist/collection/components/ez-calendar/ez-calendar.js +215 -0
  22. package/dist/collection/components/ez-check/ez-check.css +266 -0
  23. package/dist/collection/components/ez-check/ez-check.js +168 -0
  24. package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +68 -0
  25. package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +108 -0
  26. package/dist/collection/components/ez-combo-box/ez-combo-box-interfaces.js +2 -0
  27. package/dist/collection/components/ez-combo-box/ez-combo-box.css +167 -0
  28. package/dist/collection/components/ez-combo-box/ez-combo-box.js +363 -0
  29. package/dist/collection/components/ez-date-input/ez-date-input.css +39 -0
  30. package/dist/collection/components/ez-date-input/ez-date-input.js +172 -0
  31. package/dist/collection/components/ez-form/ez-form.css +19 -0
  32. package/dist/collection/components/ez-form/ez-form.js +365 -0
  33. package/dist/collection/components/ez-form/store/Form.actions.js +132 -0
  34. package/dist/collection/components/ez-form/store/Form.reducer.js +194 -0
  35. package/dist/collection/components/ez-form/store/Form.selectors.js +44 -0
  36. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +204 -0
  37. package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +16 -0
  38. package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +24 -0
  39. package/dist/collection/components/ez-form/subcomponents/form-metadata.js +173 -0
  40. package/dist/collection/components/ez-form/subcomponents/place-holder.js +14 -0
  41. package/dist/collection/components/ez-form/subcomponents/structure/Field.js +71 -0
  42. package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +27 -0
  43. package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +40 -0
  44. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +27 -0
  45. package/dist/collection/components/ez-icon/ez-icon.css +37 -0
  46. package/dist/collection/components/ez-icon/ez-icon.js +56 -0
  47. package/dist/collection/components/ez-label-chip/ez-label-chip.css +117 -0
  48. package/dist/collection/components/ez-label-chip/ez-label-chip.js +276 -0
  49. package/dist/collection/components/ez-modal/ez-modal.css +87 -0
  50. package/dist/collection/components/ez-modal/ez-modal.js +224 -0
  51. package/dist/collection/components/ez-number-input/ez-number-input.css +144 -0
  52. package/dist/collection/components/ez-number-input/ez-number-input.js +465 -0
  53. package/dist/collection/components/ez-popover/ez-popover.css +39 -0
  54. package/dist/collection/components/ez-popover/ez-popover.js +323 -0
  55. package/dist/collection/components/ez-search/ez-search.css +296 -0
  56. package/dist/{ezui/ez-search.entry.js → collection/components/ez-search/ez-search.js} +527 -334
  57. package/dist/collection/components/ez-tabselector/ez-tabselector.css +126 -0
  58. package/dist/{ezui/ez-tabselector.entry.js → collection/components/ez-tabselector/ez-tabselector.js} +283 -209
  59. package/dist/collection/components/ez-text-area/ez-text-area.css +140 -0
  60. package/dist/collection/components/ez-text-area/ez-text-area.js +267 -0
  61. package/dist/collection/components/ez-text-input/ez-text-input.css +170 -0
  62. package/dist/collection/components/ez-text-input/ez-text-input.js +395 -0
  63. package/dist/collection/components/ez-time-input/ez-time-input.css +155 -0
  64. package/dist/collection/components/ez-time-input/ez-time-input.js +326 -0
  65. package/dist/collection/index.js +1 -0
  66. package/dist/collection/servidor.js +101 -0
  67. package/dist/collection/utils/FloatingManager.js +16 -0
  68. package/dist/collection/utils/utils.js +6 -0
  69. package/dist/custom-elements/index.js +5065 -0
  70. package/dist/esm/DataUnit-ac4cc054.js +375 -0
  71. package/dist/esm/RequestMetadata-c265c9d5.js +527 -0
  72. package/dist/{ezui → esm}/ez-action-chip.entry.js +42 -42
  73. package/dist/esm/ez-button_14.entry.js +3321 -0
  74. package/dist/{ezui → esm}/ez-label-chip.entry.js +121 -121
  75. package/dist/{ezui → esm}/ez-modal.entry.js +105 -96
  76. package/dist/{ezui → esm}/ez-number-input.entry.js +238 -238
  77. package/dist/{ezui → esm}/ez-time-input.entry.js +170 -170
  78. package/dist/esm/ezui.js +17 -0
  79. package/dist/{ezui → esm}/form-metadata.entry.js +66 -66
  80. package/dist/esm/index-95bb3fd9.js +1293 -0
  81. package/dist/esm/index.js +1 -0
  82. package/dist/esm/loader.js +17 -0
  83. package/dist/esm/polyfills/core-js.js +11 -0
  84. package/dist/esm/polyfills/css-shim.js +1 -0
  85. package/dist/esm/polyfills/dom.js +79 -0
  86. package/dist/esm/polyfills/es5-html-element.js +1 -0
  87. package/dist/esm/polyfills/index.js +34 -0
  88. package/dist/esm/polyfills/system.js +6 -0
  89. package/dist/ezui/ezui.esm.js +1 -122
  90. package/dist/ezui/index.esm.js +0 -1
  91. package/dist/ezui/p-185c57f4.js +1 -0
  92. package/dist/ezui/p-22b82efb.entry.js +1 -0
  93. package/dist/ezui/p-346050cf.entry.js +1 -0
  94. package/dist/ezui/p-593c03ba.js +1 -0
  95. package/dist/ezui/p-77fdb4fd.entry.js +1 -0
  96. package/dist/ezui/p-9dfccb16.js +1 -0
  97. package/dist/ezui/p-dd4331b7.entry.js +1 -0
  98. package/dist/ezui/p-f6fd31ab.entry.js +1 -0
  99. package/dist/ezui/p-f95e3c71.entry.js +1 -0
  100. package/dist/ezui/p-fa260f22.entry.js +1 -0
  101. package/dist/index.cjs.js +1 -0
  102. package/dist/index.js +1 -0
  103. package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +16 -16
  104. package/dist/types/components/ez-button/ez-button.d.ts +20 -20
  105. package/dist/types/components/ez-calendar/ez-calendar.d.ts +42 -42
  106. package/dist/types/components/ez-check/ez-check.d.ts +32 -32
  107. package/dist/types/components/ez-collapsable-box/ez-collapsable-box.d.ts +18 -18
  108. package/dist/types/components/ez-combo-box/ez-combo-box-interfaces.d.ts +4 -4
  109. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +68 -68
  110. package/dist/types/components/ez-date-input/ez-date-input.d.ts +31 -31
  111. package/dist/types/components/ez-form/ez-form.d.ts +31 -27
  112. package/dist/types/components/ez-form/store/Form.actions.d.ts +111 -104
  113. package/dist/types/components/ez-form/store/Form.reducer.d.ts +20 -11
  114. package/dist/types/components/ez-form/store/Form.selectors.d.ts +14 -13
  115. package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +55 -48
  116. package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +41 -41
  117. package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +15 -15
  118. package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +3 -3
  119. package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +10 -10
  120. package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +12 -12
  121. package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +13 -13
  122. package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +17 -7
  123. package/dist/types/components/ez-icon/ez-icon.d.ts +5 -5
  124. package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +40 -40
  125. package/dist/types/components/ez-modal/ez-modal.d.ts +32 -26
  126. package/dist/types/components/ez-number-input/ez-number-input.d.ts +73 -73
  127. package/dist/types/components/ez-popover/ez-popover.d.ts +52 -52
  128. package/dist/types/components/ez-search/ez-search.d.ts +95 -95
  129. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +31 -31
  130. package/dist/types/components/ez-text-area/ez-text-area.d.ts +49 -49
  131. package/dist/types/components/ez-text-input/ez-text-input.d.ts +64 -64
  132. package/dist/types/components/ez-time-input/ez-time-input.d.ts +53 -53
  133. package/dist/types/components.d.ts +8 -0
  134. package/dist/types/index.d.ts +1 -1
  135. package/dist/types/utils/utils.d.ts +2 -2
  136. package/loader/cdn.js +3 -0
  137. package/loader/index.cjs.js +3 -0
  138. package/loader/index.d.ts +13 -0
  139. package/loader/index.es2017.js +3 -0
  140. package/loader/index.js +4 -0
  141. package/loader/package.json +10 -0
  142. package/package.json +114 -114
  143. package/react/components.d.ts +22 -0
  144. package/react/components.js +25 -0
  145. package/react/components.js.map +1 -0
  146. package/react/react-component-lib/createComponent.d.ts +10 -0
  147. package/react/react-component-lib/createComponent.js +59 -0
  148. package/react/react-component-lib/createComponent.js.map +1 -0
  149. package/react/react-component-lib/createOverlayComponent.d.ts +20 -0
  150. package/react/react-component-lib/createOverlayComponent.js +89 -0
  151. package/react/react-component-lib/createOverlayComponent.js.map +1 -0
  152. package/react/react-component-lib/index.d.ts +2 -0
  153. package/react/react-component-lib/index.js +3 -0
  154. package/react/react-component-lib/index.js.map +1 -0
  155. package/react/react-component-lib/interfaces.d.ts +29 -0
  156. package/react/react-component-lib/interfaces.js +1 -0
  157. package/react/react-component-lib/interfaces.js.map +1 -0
  158. package/react/react-component-lib/utils/attachProps.d.ts +12 -0
  159. package/react/react-component-lib/utils/attachProps.js +96 -0
  160. package/react/react-component-lib/utils/attachProps.js.map +1 -0
  161. package/react/react-component-lib/utils/case.d.ts +2 -0
  162. package/react/react-component-lib/utils/case.js +7 -0
  163. package/react/react-component-lib/utils/case.js.map +1 -0
  164. package/react/react-component-lib/utils/dev.d.ts +2 -0
  165. package/react/react-component-lib/utils/dev.js +13 -0
  166. package/react/react-component-lib/utils/dev.js.map +1 -0
  167. package/react/react-component-lib/utils/index.d.ts +7 -0
  168. package/react/react-component-lib/utils/index.js +21 -0
  169. package/react/react-component-lib/utils/index.js.map +1 -0
  170. package/dist/ezui/app-globals-0f993ce5.js +0 -3
  171. package/dist/ezui/css-shim-003e9264.js +0 -4
  172. package/dist/ezui/dom-1b195079.js +0 -73
  173. package/dist/ezui/ez-button.entry.js +0 -47
  174. package/dist/ezui/ez-calendar.entry.js +0 -102
  175. package/dist/ezui/ez-check.entry.js +0 -62
  176. package/dist/ezui/ez-collapsable-box.entry.js +0 -32
  177. package/dist/ezui/ez-combo-box.entry.js +0 -181
  178. package/dist/ezui/ez-date-input.entry.js +0 -77
  179. package/dist/ezui/ez-form.entry.js +0 -1907
  180. package/dist/ezui/ez-icon.entry.js +0 -17
  181. package/dist/ezui/ez-popover.entry.js +0 -112
  182. package/dist/ezui/ez-text-area.entry.js +0 -105
  183. package/dist/ezui/ez-text-input.entry.js +0 -202
  184. package/dist/ezui/index-39044be2.js +0 -2832
  185. package/dist/ezui/place-holder.entry.js +0 -15
  186. package/dist/ezui/shadow-css-c1ad5fdc.js +0 -383
@@ -0,0 +1,19 @@
1
+ ez-form {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ }
6
+
7
+ .form-sheet {
8
+ display: flex;
9
+ width: 100%;
10
+ flex-wrap: wrap;
11
+ position: relative;
12
+ }
13
+
14
+ .tab__container {
15
+ display: flex;
16
+ width: 100%;
17
+ flex-wrap: wrap;
18
+ position: relative;
19
+ }
@@ -0,0 +1,365 @@
1
+ import { Component, h, Element, forceUpdate, Prop, Method } from '@stencil/core';
2
+ import { createStore, applyMiddleware, combineReducers } from 'redux';
3
+ import thunk from 'redux-thunk';
4
+ import { formLoad, invalidField, showHideNavigationButtons } from './store/Form.actions';
5
+ import undoable from 'redux-undo';
6
+ import formReducer, { formNonHistoricReducer } from './store/Form.reducer';
7
+ import { FormSheet } from './subcomponents/structure/FormSheet';
8
+ import DataUnit from './subcomponents/DataUnit';
9
+ export class EzForm {
10
+ constructor() {
11
+ this._dataUnits = [];
12
+ this._requiredFieldsByDU = {};
13
+ }
14
+ async validate() {
15
+ for (let i = 0; i < this._dataUnits.length; i++) {
16
+ if (!this._dataUnits[i].validateRecords()) {
17
+ return false;
18
+ }
19
+ }
20
+ }
21
+ async getChanges() {
22
+ let allChanges = [];
23
+ for (let i = 0; i < this._dataUnits.length; i++) {
24
+ allChanges = allChanges.concat(this._dataUnits[i].getChangesToSave());
25
+ }
26
+ return allChanges;
27
+ }
28
+ validateRecords(dataUnit, records) {
29
+ const result = { isValid: true, message: '' };
30
+ const reqFields = this._requiredFieldsByDU[dataUnit.name];
31
+ const recordValidator = record => {
32
+ reqFields.forEach(field => {
33
+ const recordIndex = record["record__index"];
34
+ const fieldName = field.name;
35
+ const fieldValue = record[fieldName];
36
+ if (fieldValue === null || fieldValue === undefined || fieldValue === '') {
37
+ this._store.dispatch(invalidField(field.tabControler, field.tabIndex, dataUnit.name, recordIndex, record.record__id, field.name, "Essa informação é obrigatória"));
38
+ result.isValid = false;
39
+ result.message = "Há pelo menos um campo obrigatório não preenchido.";
40
+ }
41
+ });
42
+ };
43
+ if (records.length == 0) {
44
+ recordValidator({});
45
+ }
46
+ else {
47
+ records.forEach(recordValidator);
48
+ }
49
+ return result;
50
+ }
51
+ componentWillRender() {
52
+ if (this._store === undefined) {
53
+ const rootReducer = combineReducers({
54
+ "hist": undoable(formReducer),
55
+ "nonhist": formNonHistoricReducer
56
+ });
57
+ this._store = createStore(rootReducer, applyMiddleware(thunk));
58
+ this._store.subscribe(() => { forceUpdate(this); });
59
+ if (this.slavemode) {
60
+ this._store.dispatch(showHideNavigationButtons("saveVisible", false));
61
+ this._store.dispatch(showHideNavigationButtons("cancelVisible", false));
62
+ this._store.dispatch(showHideNavigationButtons("reloadVisible", false));
63
+ }
64
+ }
65
+ }
66
+ loadMDFromExecutor(callBack) {
67
+ if (this._loadMetadataFunction) {
68
+ const result = this._loadMetadataFunction();
69
+ if (result) {
70
+ if (result instanceof Promise) {
71
+ result.then(md => {
72
+ callBack(md);
73
+ });
74
+ }
75
+ else {
76
+ callBack(result);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ loadMDFromElement(callBack) {
82
+ const metadata = [];
83
+ Array.from(this._host.children).forEach(elem => {
84
+ if (elem.tagName === "FORM-METADATA") {
85
+ const formMetadata = elem;
86
+ metadata.push(formMetadata.metadata);
87
+ }
88
+ });
89
+ callBack(metadata.length > 0 ? metadata : null);
90
+ }
91
+ updateMetadata(metadata) {
92
+ if (metadata) {
93
+ const processFields = (duName, form, tabController, tabIndex) => {
94
+ var _a;
95
+ let requiredFields = this._requiredFieldsByDU[duName];
96
+ if (requiredFields === undefined) {
97
+ requiredFields = [];
98
+ this._requiredFieldsByDU[duName] = requiredFields;
99
+ }
100
+ form.items.forEach(item => {
101
+ if ("fields" in item) {
102
+ const fSet = item;
103
+ fSet.fields.forEach(f => {
104
+ f.tabControler = tabController;
105
+ f.tabIndex = tabIndex;
106
+ if (f.required) {
107
+ requiredFields.push(f);
108
+ }
109
+ });
110
+ }
111
+ else {
112
+ const f = item;
113
+ f.tabControler = tabController;
114
+ f.tabIndex = tabIndex;
115
+ if (f.required) {
116
+ requiredFields.push(f);
117
+ }
118
+ }
119
+ });
120
+ (_a = form.subForms) === null || _a === void 0 ? void 0 : _a.forEach((subForm, index) => {
121
+ const subDU = subForm.dataUnit ? subForm.dataUnit.name : duName;
122
+ processFields(subDU, subForm, form.name, index);
123
+ });
124
+ };
125
+ this.metadata = metadata;
126
+ metadata.map((form, index) => {
127
+ processFields(form.dataUnit.name, form, "__MAIN__FORM__", index);
128
+ });
129
+ this._store.dispatch(formLoad());
130
+ }
131
+ }
132
+ parseExecutor(executor) {
133
+ if (executor) {
134
+ return executor instanceof Function ? executor : eval(executor);
135
+ }
136
+ return null;
137
+ }
138
+ componentDidLoad() {
139
+ this._loadMetadataFunction = this.parseExecutor(this.metadataexecutor);
140
+ this._loadDataFunction = this.parseExecutor(this.loadexecutor);
141
+ this._saveFunction = this.parseExecutor(this.saveexecutor);
142
+ this._removeFunction = this.parseExecutor(this.removeexecutor);
143
+ this._fieldSearchFunction = this.parseExecutor(this.fieldsearchexecutor);
144
+ if (this.metadata) {
145
+ this.updateMetadata(this.metadata);
146
+ }
147
+ else {
148
+ this.loadMDFromElement((md) => this.updateMetadata(md));
149
+ if (!this.metadata) {
150
+ this.loadMDFromExecutor((md) => this.updateMetadata(md));
151
+ }
152
+ }
153
+ }
154
+ buildDataUnit(dataUnit) {
155
+ if (dataUnit) {
156
+ const { name, unitLabel, records, cardinality } = dataUnit;
157
+ if (!(dataUnit instanceof DataUnit)) {
158
+ dataUnit = new DataUnit(name, unitLabel, cardinality);
159
+ this._dataUnits.push(dataUnit);
160
+ if (records) {
161
+ dataUnit.records = records;
162
+ }
163
+ dataUnit.store = this._store;
164
+ dataUnit.loadExecutor = this._loadDataFunction;
165
+ dataUnit.saveExecutor = this._saveFunction;
166
+ dataUnit.removeExecutor = this._removeFunction;
167
+ dataUnit.recordsValidator = this;
168
+ dataUnit.fieldSearchExecutor = this._fieldSearchFunction;
169
+ }
170
+ }
171
+ return dataUnit;
172
+ }
173
+ render() {
174
+ return this.metadata ? h(FormSheet, { store: this._store, source: this.metadata, parentName: "__MAIN__FORM__", dataUnitBuilder: (du) => this.buildDataUnit(du) }) : null;
175
+ }
176
+ static get is() { return "ez-form"; }
177
+ static get originalStyleUrls() { return {
178
+ "$": ["ez-form.css"]
179
+ }; }
180
+ static get styleUrls() { return {
181
+ "$": ["ez-form.css"]
182
+ }; }
183
+ static get properties() { return {
184
+ "metadataexecutor": {
185
+ "type": "string",
186
+ "mutable": false,
187
+ "complexType": {
188
+ "original": "string | Function",
189
+ "resolved": "Function | string",
190
+ "references": {
191
+ "Function": {
192
+ "location": "global"
193
+ }
194
+ }
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": ""
201
+ },
202
+ "attribute": "metadataexecutor",
203
+ "reflect": false
204
+ },
205
+ "loadexecutor": {
206
+ "type": "string",
207
+ "mutable": false,
208
+ "complexType": {
209
+ "original": "string | Function",
210
+ "resolved": "Function | string",
211
+ "references": {
212
+ "Function": {
213
+ "location": "global"
214
+ }
215
+ }
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": ""
222
+ },
223
+ "attribute": "loadexecutor",
224
+ "reflect": false
225
+ },
226
+ "saveexecutor": {
227
+ "type": "string",
228
+ "mutable": false,
229
+ "complexType": {
230
+ "original": "string | Function",
231
+ "resolved": "Function | string",
232
+ "references": {
233
+ "Function": {
234
+ "location": "global"
235
+ }
236
+ }
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": ""
243
+ },
244
+ "attribute": "saveexecutor",
245
+ "reflect": false
246
+ },
247
+ "removeexecutor": {
248
+ "type": "string",
249
+ "mutable": false,
250
+ "complexType": {
251
+ "original": "string | Function",
252
+ "resolved": "Function | string",
253
+ "references": {
254
+ "Function": {
255
+ "location": "global"
256
+ }
257
+ }
258
+ },
259
+ "required": false,
260
+ "optional": false,
261
+ "docs": {
262
+ "tags": [],
263
+ "text": ""
264
+ },
265
+ "attribute": "removeexecutor",
266
+ "reflect": false
267
+ },
268
+ "fieldsearchexecutor": {
269
+ "type": "string",
270
+ "mutable": false,
271
+ "complexType": {
272
+ "original": "string | Function",
273
+ "resolved": "Function | string",
274
+ "references": {
275
+ "Function": {
276
+ "location": "global"
277
+ }
278
+ }
279
+ },
280
+ "required": false,
281
+ "optional": false,
282
+ "docs": {
283
+ "tags": [],
284
+ "text": ""
285
+ },
286
+ "attribute": "fieldsearchexecutor",
287
+ "reflect": false
288
+ },
289
+ "metadata": {
290
+ "type": "unknown",
291
+ "mutable": true,
292
+ "complexType": {
293
+ "original": "Array<Form>",
294
+ "resolved": "Form[]",
295
+ "references": {
296
+ "Array": {
297
+ "location": "global"
298
+ },
299
+ "Form": {
300
+ "location": "import",
301
+ "path": "./subcomponents/FormMetadata"
302
+ }
303
+ }
304
+ },
305
+ "required": false,
306
+ "optional": false,
307
+ "docs": {
308
+ "tags": [],
309
+ "text": ""
310
+ }
311
+ },
312
+ "slavemode": {
313
+ "type": "boolean",
314
+ "mutable": false,
315
+ "complexType": {
316
+ "original": "boolean",
317
+ "resolved": "boolean",
318
+ "references": {}
319
+ },
320
+ "required": false,
321
+ "optional": false,
322
+ "docs": {
323
+ "tags": [],
324
+ "text": ""
325
+ },
326
+ "attribute": "slavemode",
327
+ "reflect": false
328
+ }
329
+ }; }
330
+ static get methods() { return {
331
+ "validate": {
332
+ "complexType": {
333
+ "signature": "() => Promise<boolean>",
334
+ "parameters": [],
335
+ "references": {
336
+ "Promise": {
337
+ "location": "global"
338
+ }
339
+ },
340
+ "return": "Promise<boolean>"
341
+ },
342
+ "docs": {
343
+ "text": "",
344
+ "tags": []
345
+ }
346
+ },
347
+ "getChanges": {
348
+ "complexType": {
349
+ "signature": "() => Promise<any[]>",
350
+ "parameters": [],
351
+ "references": {
352
+ "Promise": {
353
+ "location": "global"
354
+ }
355
+ },
356
+ "return": "Promise<any[]>"
357
+ },
358
+ "docs": {
359
+ "text": "",
360
+ "tags": []
361
+ }
362
+ }
363
+ }; }
364
+ static get elementRef() { return "_host"; }
365
+ }
@@ -0,0 +1,132 @@
1
+ export function changeFieldValue(dataUnit, recordId, fieldName, value) {
2
+ return {
3
+ type: 'FORM/CHANGEFIELD',
4
+ payload: { dataUnit, recordId, fieldName, value }
5
+ };
6
+ }
7
+ export function changeTab(formId, index) {
8
+ return {
9
+ type: 'FORM/CHANGETAB',
10
+ payload: { formId, index }
11
+ };
12
+ }
13
+ export function clearEdition(dataUnit, recordsLimit) {
14
+ return {
15
+ type: 'FORM/CLEAREDITION',
16
+ payload: {
17
+ dataUnit,
18
+ recordsLimit
19
+ }
20
+ };
21
+ }
22
+ export function collapseExpandGroup(collapseId, collapsed) {
23
+ return {
24
+ type: 'FORM/COLLAPSEGROUP',
25
+ payload: { collapseId, collapsed }
26
+ };
27
+ }
28
+ export function previousRecord(dataUnit) {
29
+ return {
30
+ type: 'FORM/NAVIGATE',
31
+ payload: {
32
+ dataUnit,
33
+ limit: 0,
34
+ backward: true
35
+ }
36
+ };
37
+ }
38
+ export function nextRecord(dataUnit, limit) {
39
+ return {
40
+ type: 'FORM/NAVIGATE',
41
+ payload: {
42
+ dataUnit,
43
+ limit,
44
+ backward: false
45
+ }
46
+ };
47
+ }
48
+ export function insertRecord(dataUnit, insertionIndex) {
49
+ return {
50
+ type: 'FORM/INSERT',
51
+ payload: {
52
+ dataUnit,
53
+ insertionIndex
54
+ }
55
+ };
56
+ }
57
+ export function formLoad() {
58
+ return {
59
+ type: 'FORM/LOAD'
60
+ };
61
+ }
62
+ export function dataLoading(dataUnit) {
63
+ return {
64
+ type: 'FORM/DATALOADING',
65
+ payload: {
66
+ dataUnit
67
+ }
68
+ };
69
+ }
70
+ export function savingChanges(dataUnit) {
71
+ return {
72
+ type: 'FORM/SAVINGCHANGES',
73
+ payload: {
74
+ dataUnit
75
+ }
76
+ };
77
+ }
78
+ export function dataLoaded(dataUnit) {
79
+ return {
80
+ type: 'FORM/DATALOADED',
81
+ payload: {
82
+ dataUnit
83
+ }
84
+ };
85
+ }
86
+ export function changesSaved(dataUnit) {
87
+ return {
88
+ type: 'FORM/CHANGESSAVED',
89
+ payload: {
90
+ dataUnit
91
+ }
92
+ };
93
+ }
94
+ export function removingRecord(dataUnit) {
95
+ return {
96
+ type: 'FORM/REMOVINGRECORD',
97
+ payload: {
98
+ dataUnit
99
+ }
100
+ };
101
+ }
102
+ export function recordRemoved(dataUnit) {
103
+ return {
104
+ type: 'FORM/RECORDREMOVED',
105
+ payload: {
106
+ dataUnit
107
+ }
108
+ };
109
+ }
110
+ export function invalidField(tabController, tabIndex, dataUnit, recordIndex, recordId, fieldName, errorMessage) {
111
+ return {
112
+ type: 'FORM/INVALIDFIELD',
113
+ payload: {
114
+ tabController,
115
+ tabIndex,
116
+ dataUnit,
117
+ recordId,
118
+ recordIndex,
119
+ fieldName,
120
+ errorMessage
121
+ }
122
+ };
123
+ }
124
+ export function showHideNavigationButtons(buttonName, status) {
125
+ return {
126
+ type: 'FORM/SHOWHIDENAVBTN',
127
+ payload: {
128
+ buttonName,
129
+ status
130
+ }
131
+ };
132
+ }