@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,375 @@
1
+ function changeFieldValue(dataUnit, recordId, fieldName, value) {
2
+ return {
3
+ type: 'FORM/CHANGEFIELD',
4
+ payload: { dataUnit, recordId, fieldName, value }
5
+ };
6
+ }
7
+ function changeTab(formId, index) {
8
+ return {
9
+ type: 'FORM/CHANGETAB',
10
+ payload: { formId, index }
11
+ };
12
+ }
13
+ function clearEdition(dataUnit, recordsLimit) {
14
+ return {
15
+ type: 'FORM/CLEAREDITION',
16
+ payload: {
17
+ dataUnit,
18
+ recordsLimit
19
+ }
20
+ };
21
+ }
22
+ function collapseExpandGroup(collapseId, collapsed) {
23
+ return {
24
+ type: 'FORM/COLLAPSEGROUP',
25
+ payload: { collapseId, collapsed }
26
+ };
27
+ }
28
+ function previousRecord(dataUnit) {
29
+ return {
30
+ type: 'FORM/NAVIGATE',
31
+ payload: {
32
+ dataUnit,
33
+ limit: 0,
34
+ backward: true
35
+ }
36
+ };
37
+ }
38
+ function nextRecord(dataUnit, limit) {
39
+ return {
40
+ type: 'FORM/NAVIGATE',
41
+ payload: {
42
+ dataUnit,
43
+ limit,
44
+ backward: false
45
+ }
46
+ };
47
+ }
48
+ function insertRecord(dataUnit, insertionIndex) {
49
+ return {
50
+ type: 'FORM/INSERT',
51
+ payload: {
52
+ dataUnit,
53
+ insertionIndex
54
+ }
55
+ };
56
+ }
57
+ function formLoad() {
58
+ return {
59
+ type: 'FORM/LOAD'
60
+ };
61
+ }
62
+ function dataLoading(dataUnit) {
63
+ return {
64
+ type: 'FORM/DATALOADING',
65
+ payload: {
66
+ dataUnit
67
+ }
68
+ };
69
+ }
70
+ function savingChanges(dataUnit) {
71
+ return {
72
+ type: 'FORM/SAVINGCHANGES',
73
+ payload: {
74
+ dataUnit
75
+ }
76
+ };
77
+ }
78
+ function dataLoaded(dataUnit) {
79
+ return {
80
+ type: 'FORM/DATALOADED',
81
+ payload: {
82
+ dataUnit
83
+ }
84
+ };
85
+ }
86
+ function changesSaved(dataUnit) {
87
+ return {
88
+ type: 'FORM/CHANGESSAVED',
89
+ payload: {
90
+ dataUnit
91
+ }
92
+ };
93
+ }
94
+ function removingRecord(dataUnit) {
95
+ return {
96
+ type: 'FORM/REMOVINGRECORD',
97
+ payload: {
98
+ dataUnit
99
+ }
100
+ };
101
+ }
102
+ function recordRemoved(dataUnit) {
103
+ return {
104
+ type: 'FORM/RECORDREMOVED',
105
+ payload: {
106
+ dataUnit
107
+ }
108
+ };
109
+ }
110
+ 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
+ function showHideNavigationButtons(buttonName, status) {
125
+ return {
126
+ type: 'FORM/SHOWHIDENAVBTN',
127
+ payload: {
128
+ buttonName,
129
+ status
130
+ }
131
+ };
132
+ }
133
+
134
+ //histórico
135
+ const selectCurrentTab = (state, formName) => {
136
+ const data = state.hist.present.currentTabIndex;
137
+ return data[formName] || 0;
138
+ };
139
+ const selectIsCollapsedFieldSet = (state, fieldSetName) => {
140
+ const data = state.hist.present.collapsedGroups;
141
+ return data[fieldSetName];
142
+ };
143
+ const selectRecordChanges = (state, dataUnit, recordId) => {
144
+ const data = selectDataUnitChanges(state, dataUnit);
145
+ return data ? data[recordId] : undefined;
146
+ };
147
+ const selectDataUnitChanges = (state, dataUnit) => {
148
+ const data = state.hist.present.changes;
149
+ return data[dataUnit];
150
+ };
151
+ const selectCurrentRecordIndex = (state, dataUnit) => {
152
+ const data = state.hist.present.currentRecordIndex;
153
+ return data[dataUnit] || 0;
154
+ };
155
+ const selectNewRecordIndex = (state, dataUnit) => {
156
+ const data = state.hist.present.newRecordIndex;
157
+ return data[dataUnit] || 0;
158
+ };
159
+ //não histórico
160
+ const selectLoadingData = (state, dataUnit) => {
161
+ const data = state.nonhist.dataLoading;
162
+ return data[dataUnit];
163
+ };
164
+ const selectErrorMessage = (state, dataUnit, recordId, fieldName) => {
165
+ const data = state.nonhist.invalidFields;
166
+ const dataUnitMessages = data[dataUnit] || {};
167
+ const recordMessages = dataUnitMessages[recordId] || {};
168
+ return recordMessages[fieldName] || "";
169
+ };
170
+ const selectVisibleButtons = state => state.nonhist.visibleButtons;
171
+
172
+ class DataUnit {
173
+ constructor(name, unitLabel, cardinality = '1') {
174
+ this.name = name;
175
+ this.unitLabel = unitLabel;
176
+ this.cardinality = cardinality;
177
+ }
178
+ set store(store) {
179
+ this._store = store;
180
+ }
181
+ isLoading() {
182
+ return selectLoadingData(this._store.getState(), this.name);
183
+ }
184
+ hasChanges() {
185
+ const state = this._store.getState();
186
+ return selectDataUnitChanges(state, this.name) !== undefined || selectNewRecordIndex(state, this.name) > 0;
187
+ }
188
+ hasNext() {
189
+ return selectCurrentRecordIndex(this._store.getState(), this.name) < (this.records.length - 1);
190
+ }
191
+ hasPrevious() {
192
+ return selectCurrentRecordIndex(this._store.getState(), this.name) > 0;
193
+ }
194
+ hasCurrentRecord() {
195
+ return this.getCurrentRecord() != undefined;
196
+ }
197
+ previous() {
198
+ this._store.dispatch(previousRecord(this.name));
199
+ }
200
+ next() {
201
+ this._store.dispatch(nextRecord(this.name, this.records.length));
202
+ }
203
+ getValue(fieldName) {
204
+ const currentRecord = this.getCurrentRecord();
205
+ if (!currentRecord) {
206
+ return undefined;
207
+ }
208
+ const changes = this.getRecordChanges(currentRecord);
209
+ return changes && changes[fieldName] !== undefined ? changes[fieldName] : currentRecord[fieldName] || null;
210
+ }
211
+ getErrorMessage(fieldName) {
212
+ const currentRecord = this.getCurrentRecord();
213
+ return selectErrorMessage(this._store.getState(), this.name, currentRecord === null || currentRecord === void 0 ? void 0 : currentRecord.record__id, fieldName);
214
+ }
215
+ changeValue(fieldName, newValue) {
216
+ if (this.records.length == 0) {
217
+ this.insert();
218
+ }
219
+ if (this._changeDeboucing) {
220
+ window.clearTimeout(this._changeDeboucing);
221
+ }
222
+ this._changeDeboucing = window.setTimeout(() => {
223
+ const currentRecord = this.getCurrentRecord();
224
+ this._store.dispatch(changeFieldValue(this.name, currentRecord.record__id, fieldName, newValue));
225
+ }, 100);
226
+ }
227
+ cancel() {
228
+ this.records = this.records.filter(r => !r.record__id.startsWith('NEW_'));
229
+ this._store.dispatch(clearEdition(this.name, this.records.length - 1));
230
+ }
231
+ insert() {
232
+ const insertionIndex = this.records.length;
233
+ const newRecordIndex = selectNewRecordIndex(this._store.getState(), this.name);
234
+ this.records.push({ record__id: 'NEW_' + (newRecordIndex + 1) });
235
+ this._store.dispatch(insertRecord(this.name, insertionIndex));
236
+ }
237
+ getChangesToSave() {
238
+ const duChanges = selectDataUnitChanges(this._store.getState(), this.name);
239
+ const changesByRecord = Object.keys(duChanges).map(record__id => {
240
+ const record = { record__id };
241
+ const recordChanges = duChanges[record__id];
242
+ Object.keys(recordChanges).forEach(fieldName => { record[fieldName] = recordChanges[fieldName]; });
243
+ return record;
244
+ });
245
+ return [{
246
+ dataUnit: this.name,
247
+ records: changesByRecord
248
+ }];
249
+ }
250
+ save() {
251
+ if (!this.validateRecords()) {
252
+ return;
253
+ }
254
+ this._store.dispatch(savingChanges(this.name));
255
+ let saveResult;
256
+ if (this.saveExecutor) {
257
+ saveResult = this.saveExecutor(this.getChangesToSave());
258
+ }
259
+ if (saveResult instanceof Promise) {
260
+ saveResult.then(r => this.processSaveResult(r));
261
+ }
262
+ else {
263
+ this.processSaveResult(saveResult);
264
+ }
265
+ }
266
+ load() {
267
+ this._store.dispatch(dataLoading(this.name));
268
+ let result;
269
+ if (this.loadExecutor) {
270
+ result = this.loadExecutor({ dataUnit: this.name });
271
+ }
272
+ if (result instanceof Promise) {
273
+ result.then(r => this.processLoadResult(r));
274
+ }
275
+ else {
276
+ this.processLoadResult(result);
277
+ }
278
+ }
279
+ remove() {
280
+ const currentIndex = selectCurrentRecordIndex(this._store.getState(), this.name);
281
+ this._store.dispatch(removingRecord(this.name));
282
+ let removeResult;
283
+ if (this.removeExecutor) {
284
+ const record = this.getCurrentRecord();
285
+ removeResult = this.removeExecutor({ dataUnit: this.name, recordId: record.record__id, record });
286
+ }
287
+ else {
288
+ removeResult = true;
289
+ }
290
+ if (removeResult) {
291
+ if (removeResult instanceof Promise) {
292
+ removeResult.then(r => this.processRemoveResult(r, currentIndex));
293
+ }
294
+ else {
295
+ this.processRemoveResult(removeResult, currentIndex);
296
+ }
297
+ }
298
+ }
299
+ processSaveResult(result) {
300
+ if (result) {
301
+ if (result instanceof Array) {
302
+ result.forEach(item => this.processSaveResult(item));
303
+ }
304
+ else {
305
+ if (result.dataUnit === this.name) {
306
+ result.records.forEach(savedRecord => {
307
+ let rID = savedRecord.oldRecord__id;
308
+ delete savedRecord.oldRecord__id;
309
+ if (rID === undefined) {
310
+ rID = savedRecord.record__id;
311
+ }
312
+ this.records.forEach((r, index) => {
313
+ if (r.record__id === rID) {
314
+ this.records[index] = Object.assign(r, savedRecord);
315
+ }
316
+ });
317
+ });
318
+ }
319
+ }
320
+ }
321
+ this._store.dispatch(clearEdition(this.name, this.records.length - 1));
322
+ this._store.dispatch(changesSaved(this.name));
323
+ }
324
+ processLoadResult(records) {
325
+ this.records = records;
326
+ this._store.dispatch(clearEdition(this.name, this.records.length - 1));
327
+ this._store.dispatch(dataLoaded(this.name));
328
+ }
329
+ processRemoveResult(removed, recordIndex) {
330
+ if (removed) {
331
+ this.records.splice(recordIndex, 1);
332
+ this._store.dispatch(clearEdition(this.name, this.records.length - 1));
333
+ }
334
+ this._store.dispatch(recordRemoved(this.name));
335
+ }
336
+ set records(records) {
337
+ this._records = records;
338
+ }
339
+ get records() {
340
+ if (!this._records) {
341
+ this._records = [];
342
+ }
343
+ return this._records;
344
+ }
345
+ getCurrentRecord() {
346
+ const currentIndex = selectCurrentRecordIndex(this._store.getState(), this.name);
347
+ return this.records[currentIndex];
348
+ }
349
+ getRecordChanges(currentRecord = undefined) {
350
+ if (currentRecord === undefined) {
351
+ currentRecord = this.getCurrentRecord();
352
+ }
353
+ return currentRecord ? selectRecordChanges(this._store.getState(), this.name, currentRecord.record__id) : undefined;
354
+ }
355
+ validateRecords() {
356
+ if (!this.recordsValidator) {
357
+ return true;
358
+ }
359
+ const duChanges = selectDataUnitChanges(this._store.getState(), this.name);
360
+ const recordsToValidate = [];
361
+ this.records.forEach((record, i) => {
362
+ const changes = duChanges[record.record__id];
363
+ if (changes) {
364
+ recordsToValidate.push(Object.assign(Object.assign(Object.assign({}, record), changes), { record__index: i, record__changedfields: Object.keys(changes) }));
365
+ }
366
+ });
367
+ const result = this.recordsValidator.validateRecords(this, recordsToValidate);
368
+ if (result.message) {
369
+ alert(result.message);
370
+ }
371
+ return result.isValid;
372
+ }
373
+ }
374
+
375
+ export { DataUnit as D, selectCurrentTab as a, selectVisibleButtons as b, collapseExpandGroup as c, changeTab as d, showHideNavigationButtons as e, formLoad as f, invalidField as i, selectIsCollapsedFieldSet as s };
@@ -0,0 +1,527 @@
1
+ const NUMBERINPUTS_REGEX_SCIENTIFIC_PARTS = /^([+-])?(\d+).?(\d*)[eE]([-+]?\d+)$/;
2
+ /**
3
+ * `NumberUtils` é uma biblioteca para manipulação de números
4
+ *
5
+ * `Métodos`:
6
+ *
7
+ * @stringToNumber: converte um número em formato de string em um valor numérico nativo do javascript
8
+ * @format: arredonda um número em formato de string baseado nos parâmetros "presision" e "prettyPrecision";
9
+ */
10
+ class NumberUtils {
11
+ }
12
+ /**
13
+ * @stringToNumber: converte um numero em formato de string em numero
14
+ *
15
+ * @param value numero em formato de string a ser convertido (Importante: formato PT-BR ou já em formato numérico: ######.##)
16
+ *
17
+ * @returns string based number
18
+ *
19
+ * @Exemples
20
+ * @"100,12" | 100.12
21
+ * @"100.12" | 100.12
22
+ * @"-100,12" | -100.12
23
+ * @"R$100,12" | 100.12
24
+ * @"-R$100,12" | -100.12
25
+ * @"string" | NaN
26
+ */
27
+ NumberUtils.stringToNumber = (value) => {
28
+ if (value === '' || value === null || value === undefined) {
29
+ return NaN;
30
+ }
31
+ if (value) {
32
+ value = value.toString();
33
+ var negative = (value.charAt(0) === '-');
34
+ if (!NUMBERINPUTS_REGEX_SCIENTIFIC_PARTS.test(value)) {
35
+ value = value.replace(/[^\d.,]/g, '');
36
+ }
37
+ else {
38
+ value = value.replace(/^-/g, '');
39
+ }
40
+ //In case of simple string such as: "@@@@@@@"
41
+ if (value === '') {
42
+ return Number(NaN);
43
+ }
44
+ var indexV = value.indexOf(',');
45
+ var indexP = value.indexOf('.');
46
+ if (indexP > indexV) {
47
+ value = value.replace(',', '');
48
+ }
49
+ else if (indexP < indexV) {
50
+ value = value.replace(/\./g, '@').replace(',', '.').replace(/@/g, '');
51
+ }
52
+ if (negative) {
53
+ value = '-' + value;
54
+ }
55
+ }
56
+ return Number(value);
57
+ };
58
+ /**
59
+ * @format: converte um numero em formato de string em um numero em formato de string formatado de acordo com os parametros de "precision" e "prettyPrecision"
60
+ *
61
+ * @param value numero em formato de string a ser convertido (Importante: formato PT-BR ou já em formato numérico<sem separadors de milhares>: ######.##)
62
+ * @param precision (numero de decimais)
63
+ * @param prettyPrecision (numero de zeros nos decimais)
64
+ *
65
+ * @returns numero em formato de string formatado em PT-BR
66
+ */
67
+ NumberUtils.format = (value, precision, prettyPrecision = NaN) => {
68
+ if (value === '' || value === undefined || value === "NaN") {
69
+ return NaN.toString();
70
+ }
71
+ let newValue = NumberUtils.stringToNumber(value);
72
+ if (newValue === NaN) {
73
+ return NaN.toString();
74
+ }
75
+ //Validation "precision":
76
+ // Case1: precision < 0 => does not use precision
77
+ // Case2: presicion not int => does not use precision
78
+ if (precision < 0 || Math.abs(Math.round(precision * 1) / 1) !== precision) {
79
+ //Once stringToNumber returns number format, we need to change to pt-br
80
+ return NumberUtils.changeFormat(newValue.toString());
81
+ }
82
+ //Validation "prettyPrecision"
83
+ let prettyPrecisionInternal = 0;
84
+ // Case1: prettyPrecision < 0 => prettyPrecision does not change de format that means: prettyPrecisionInternal = precision;
85
+ // Case2: prettyPrecision not int => prettyPrecision does not change de format that means: prettyPrecisionInternal = precision;
86
+ if (prettyPrecision === NaN || Math.abs(Math.round(prettyPrecision * 1) / 1) !== prettyPrecision) {
87
+ prettyPrecisionInternal = precision;
88
+ }
89
+ else {
90
+ prettyPrecisionInternal = prettyPrecision;
91
+ }
92
+ let newValueStr;
93
+ newValueStr = (Math.round(newValue * Math.pow(10, precision)) / Math.pow(10, precision)).toLocaleString('pt-br', { minimumFractionDigits: precision });
94
+ //prettyPrecision
95
+ const varSettingPP = precision - prettyPrecisionInternal;
96
+ if (varSettingPP > 0) {
97
+ for (let i = 0; i < varSettingPP; i++) {
98
+ if (newValueStr.substring(newValueStr.length - 1) == "0" && precision > 0) {
99
+ newValueStr = newValueStr.substring(0, newValueStr.length - 1);
100
+ }
101
+ }
102
+ }
103
+ //in Case "." or "," in the end of the string
104
+ if (newValueStr.substring(newValueStr.length - 1) == "." || newValueStr.substring(newValueStr.length - 1) == ",") {
105
+ newValueStr = newValueStr.substring(0, newValueStr.length - 1);
106
+ }
107
+ return newValueStr;
108
+ };
109
+ /**
110
+ * @keepOnlyDecimalSeparator: retira os separadores de milhar de um número em formato de string
111
+ *
112
+ * @param value numero em formato de string a ser convertido
113
+ * @param formatnumber (formatação de ENTRADA e SAÍDA do utilitário: pt-BR="###.###,##" en-US="###,###.##"; Default: "pt-BR")
114
+ *
115
+ * @returns numero em formato de string formatado apenas com separador decimal
116
+ */
117
+ NumberUtils.keepOnlyDecimalSeparator = (value, formatnumber = 'pt-BR') => {
118
+ //Formatting formatnumber to be able to get lowercases
119
+ formatnumber = formatnumber.toUpperCase();
120
+ //Formatting value following formatnumber parameter
121
+ //keep only decimal character in order to correct format the string
122
+ //This transformation is due the "stringtoNumber" method is a general method that tries to convert all formated strings
123
+ if (formatnumber === 'EN-US') {
124
+ value = value.replace(/\,/g, '');
125
+ }
126
+ else {
127
+ value = value.replace(/\./g, '');
128
+ }
129
+ return value;
130
+ };
131
+ /**
132
+ * @changeFormat: troca o formato do numero string de "PT-BR" para "EN-US" e vice-versa
133
+ *
134
+ * @param value numero em formato de string a ser convertido
135
+ *
136
+ * @returns numero em formato de string formatado de "PT-BR" para "EN-US" e vice-versa
137
+ */
138
+ NumberUtils.changeFormat = (value) => {
139
+ //Formatting output following formatnumber
140
+ return value.replace(/\./g, '_').replace(/\,/g, '.').replace(/\_/g, ',');
141
+ };
142
+
143
+ /**
144
+ * `MaskFormatter` é usado para formatar strings. Seu comportamento
145
+ * é controlado pela formato do atributo `mask` que especifica quais
146
+ * caracteres são válidos e onde devem estar posicionados, intercalando-os
147
+ * com eventuais caracteres literais expressados no padrão informado.
148
+ * Sua implementação é inspirada pela implementação em Java do [MaskFormatter](https://docs.oracle.com/javase/7/docs/api/javax/swing/text/MaskFormatter.html).
149
+ *
150
+ * Para o padrão da máscara podem ser usados os seguintes caracteres especiais:
151
+ *
152
+ * | Caractere | Comportamento |
153
+ * |:---------:|-------------------------------------------------------------------------------------------------------------|
154
+ * | # | Qualquer número |
155
+ * | ' | "Escapa" o caractere que vem na sequência. Útil quando desejamos converter um caractere especial em literal.|
156
+ * | U | Qualquer letra. Transforma letras maiúsculas em maiúsculas. |
157
+ * | L | Qualquer letra. Transforma letras maiúsculas em minúsculas. |
158
+ * | A | Qualquer letra ou número. |
159
+ * | ? | Qualquer letra. Preserva maiúsculas e minúsculas. |
160
+ * | * | Qualquer caractere. |
161
+ *
162
+ * Os demais caracteres presentes no padrão serão tratados como literais, isto é,
163
+ * serão apenas inseridos naquela posição.
164
+ *
165
+ * Quando o o valor a ser formatado é menor que a máscara um 'placeHolder'
166
+ * será inserido em cada posição ausente, completando a formatação.
167
+ * Por padrão será usado um espaço em branco como 'placeHolder' mas
168
+ * esse valor pode ser alterado.
169
+ *
170
+ * For por exemplo:
171
+ * '''
172
+ * const formatter: MaskFormatter = new MaskFormatter("###-####");
173
+ * formatter.placeholder = '_';
174
+ * console.log(formatter.format("123"));
175
+ * '''
176
+ * resultaria na string '123-____'.
177
+ *
178
+ * ##Veja mais alguns exemplos:
179
+ * |Padrão |Máscara |Entrada |Saída |
180
+ * |----------------|------------------|--------------|------------------|
181
+ * |Telefone |(##) ####-#### |3432192515 |(34) 3219-2515 |
182
+ * |CPF |###.###.###-## |12345678901 |123.456.789-01 |
183
+ * |CNPJ |##.###.###/####-##|12345678901234|12.345.678/9012-34|
184
+ * |CEP |##.###-### |12345678 |12.345-678 |
185
+ * |PLACA (veículo) |UUU-#### |abc1234 |ABC-1234 |
186
+ * |Cor RGB |'#AAAAAA |00000F0 |#0000F0 |
187
+ *
188
+ */
189
+ class MaskFormatter {
190
+ constructor(mask) {
191
+ this._mask = '';
192
+ this._maskChars = new Array();
193
+ /**
194
+ * Determina qual caractere será usado dos caracteres não presentes no valor
195
+ * ou seja, aqueles que o usuário ainda não informou. Por padrão usamos um espaço
196
+ */
197
+ this.placeholder = ' ';
198
+ this.mask = mask;
199
+ }
200
+ /**
201
+ * Setter para mask. Trata-se do padrão que se espera ao formatar o texto.
202
+ */
203
+ set mask(mask) {
204
+ this._mask = mask;
205
+ this.updateInternalMask();
206
+ }
207
+ /**
208
+ * Getter para mask
209
+ *
210
+ * @return A última máscara informada.
211
+ */
212
+ get mask() {
213
+ return this._mask;
214
+ }
215
+ /**
216
+ * Formata a string passada baseada na máscara definda pelo atributo mask.
217
+ *
218
+ * @param value Valor a ser formatado
219
+ * @return O valor processado de acordo com o padrão
220
+ */
221
+ format(value) {
222
+ let result = '';
223
+ const index = [0];
224
+ let counter = 0;
225
+ const maxCounter = this._maskChars.length;
226
+ while (counter < maxCounter) {
227
+ result = this._maskChars[counter].append(result, value, index);
228
+ counter++;
229
+ }
230
+ return result;
231
+ }
232
+ /**
233
+ * Preparamos a formatação internamente de acordo com o padrão.
234
+ */
235
+ updateInternalMask() {
236
+ this._maskChars.length = 0;
237
+ if (this.mask != null) {
238
+ let counter = 0;
239
+ const maxCounter = this.mask.length;
240
+ while (counter < maxCounter) {
241
+ let maskChar = this.mask.charAt(counter);
242
+ switch (maskChar) {
243
+ case MaskFormatter.DIGIT_KEY:
244
+ this._maskChars.push(new MaskFormatter.DigitMaskCharacter(this, maskChar));
245
+ break;
246
+ case MaskFormatter.LITERAL_KEY:
247
+ if (++counter < maxCounter) {
248
+ maskChar = this.mask.charAt(counter);
249
+ this._maskChars.push(new MaskFormatter.LiteralCharacter(this, maskChar));
250
+ }
251
+ break;
252
+ case MaskFormatter.UPPERCASE_KEY:
253
+ this._maskChars.push(new MaskFormatter.UpperCaseCharacter(this, maskChar));
254
+ break;
255
+ case MaskFormatter.LOWERCASE_KEY:
256
+ this._maskChars.push(new MaskFormatter.LowerCaseCharacter(this, maskChar));
257
+ break;
258
+ case MaskFormatter.ALPHA_NUMERIC_KEY:
259
+ this._maskChars.push(new MaskFormatter.AlphaNumericCharacter(this, maskChar));
260
+ break;
261
+ case MaskFormatter.CHARACTER_KEY:
262
+ this._maskChars.push(new MaskFormatter.CharCharacter(this, maskChar));
263
+ break;
264
+ case MaskFormatter.ANYTHING_KEY:
265
+ this._maskChars.push(new MaskFormatter.MaskCharacter(this, maskChar));
266
+ break;
267
+ default:
268
+ this._maskChars.push(new MaskFormatter.LiteralCharacter(this, maskChar));
269
+ break;
270
+ }
271
+ counter++;
272
+ }
273
+ }
274
+ }
275
+ }
276
+ MaskFormatter.DIGIT_KEY = "#";
277
+ MaskFormatter.LITERAL_KEY = "'";
278
+ MaskFormatter.UPPERCASE_KEY = "U";
279
+ MaskFormatter.LOWERCASE_KEY = "L";
280
+ MaskFormatter.ALPHA_NUMERIC_KEY = "A";
281
+ MaskFormatter.CHARACTER_KEY = "?";
282
+ MaskFormatter.ANYTHING_KEY = "*";
283
+ //
284
+ // Classes internas usadas para representar a máscara.
285
+ //
286
+ MaskFormatter.MaskCharacter = class {
287
+ constructor(maskFormatter, type) {
288
+ this.maskFormatter = maskFormatter;
289
+ this.type = type;
290
+ }
291
+ /**
292
+ * Cada subclasse deve sobrescrever o retornando true, caso represente
293
+ * um caractere literal. Por padrão o retorno é false.
294
+ */
295
+ isLiteral() {
296
+ return false;
297
+ }
298
+ /**
299
+ * Returns true if <code>aChar</code> is a valid reprensentation of
300
+ * the receiver. The default implementation returns true if the
301
+ * receiver represents a literal character and <code>getChar</code>
302
+ * == aChar. Otherwise, this will return true is <code>aChar</code>
303
+ * is contained in the valid characters and not contained
304
+ * in the invalid characters.
305
+ */
306
+ isValidCharacter(aChar) {
307
+ if (this.isLiteral()) {
308
+ return (this.getChar(aChar) == aChar);
309
+ }
310
+ aChar = this.getChar(aChar);
311
+ return true;
312
+ }
313
+ /**
314
+ * Returns the character to insert for <code>aChar</code>. The
315
+ * default implementation returns <code>aChar</code>. Subclasses
316
+ * that wish to do some sort of mapping, perhaps lower case to upper
317
+ * case should override this and do the necessary mapping.
318
+ */
319
+ getChar(aChar) {
320
+ return aChar;
321
+ }
322
+ /**
323
+ * Appends the necessary character in <code>formatting</code> at
324
+ * <code>index</code> to <code>buff</code>.
325
+ */
326
+ append(result, formatting, index) {
327
+ const inString = index[0] < formatting.length;
328
+ const aChar = inString ? formatting.charAt(index[0]) : '';
329
+ if (this.isLiteral()) {
330
+ const literal = this.getChar(aChar);
331
+ result += literal;
332
+ if (literal === aChar) {
333
+ index[0] = index[0] + 1;
334
+ }
335
+ }
336
+ else if (index[0] >= formatting.length) {
337
+ result += this.maskFormatter.placeholder;
338
+ index[0] = index[0] + 1;
339
+ }
340
+ else if (this.isValidCharacter(aChar)) {
341
+ result += this.getChar(aChar);
342
+ index[0] = index[0] + 1;
343
+ }
344
+ else {
345
+ throw new Error(`Valor inválido: "${aChar}". Na posição ${index[0] + 1} espera-se ${this.getFormatMessage()}.`);
346
+ }
347
+ return result;
348
+ }
349
+ getFormatMessage() {
350
+ let message;
351
+ switch (this.type) {
352
+ case MaskFormatter.UPPERCASE_KEY:
353
+ case MaskFormatter.LOWERCASE_KEY:
354
+ case MaskFormatter.CHARACTER_KEY:
355
+ message = 'uma letra';
356
+ break;
357
+ case MaskFormatter.DIGIT_KEY:
358
+ message = 'um número';
359
+ break;
360
+ case MaskFormatter.ALPHA_NUMERIC_KEY:
361
+ message = 'uma letra ou um número';
362
+ break;
363
+ default:
364
+ message = '';
365
+ }
366
+ return message;
367
+ }
368
+ };
369
+ MaskFormatter.LiteralCharacter = class extends MaskFormatter.MaskCharacter {
370
+ constructor(maskFormatter, fixedChar) {
371
+ super(maskFormatter, fixedChar);
372
+ this._fixedChar = fixedChar;
373
+ }
374
+ isLiteral() {
375
+ return true;
376
+ }
377
+ getChar(aChar) {
378
+ return this._fixedChar;
379
+ }
380
+ };
381
+ MaskFormatter.DigitMaskCharacter = class extends MaskFormatter.MaskCharacter {
382
+ isValidCharacter(aChar) {
383
+ return (this.isDigit(aChar) && super.isValidCharacter(aChar));
384
+ }
385
+ isDigit(char) {
386
+ return char >= '0' && char <= '9';
387
+ }
388
+ };
389
+ MaskFormatter.UpperCaseCharacter = class extends MaskFormatter.MaskCharacter {
390
+ isValidCharacter(aChar) {
391
+ return (/[a-z]/i.test(aChar) && super.isValidCharacter(aChar));
392
+ }
393
+ getChar(aChar) {
394
+ return aChar.toUpperCase();
395
+ }
396
+ };
397
+ MaskFormatter.LowerCaseCharacter = class extends MaskFormatter.MaskCharacter {
398
+ isValidCharacter(aChar) {
399
+ return (/[a-z]/i.test(aChar) && super.isValidCharacter(aChar));
400
+ }
401
+ getChar(aChar) {
402
+ return aChar.toLocaleLowerCase();
403
+ }
404
+ };
405
+ MaskFormatter.AlphaNumericCharacter = class extends MaskFormatter.MaskCharacter {
406
+ isValidCharacter(aChar) {
407
+ //FIXME: talvez seja problema usar regex aqui... avaliar se existe forma mais barata
408
+ return (/[a-z0-9]/i.test(aChar)) && super.isValidCharacter(aChar);
409
+ }
410
+ };
411
+ MaskFormatter.CharCharacter = class extends MaskFormatter.MaskCharacter {
412
+ isValidCharacter(aChar) {
413
+ //FIXME: talvez seja problema usar regex aqui... avaliar se existe forma mais barata
414
+ return (/[a-z]/i.test(aChar) && super.isValidCharacter(aChar));
415
+ }
416
+ };
417
+
418
+ /**
419
+ * `TimeFormatter` é um utilitário para formatação de strings desformatadas em strings válidas de horários
420
+ */
421
+ class TimeFormatter {
422
+ /**
423
+ * @prepareValue: converts an unformated time string into a formatted time.
424
+ *
425
+ * @param value unformated time string to convert
426
+ *
427
+ * @returns formatted time string
428
+ *
429
+ * @Exemples
430
+ * @"1012" | "10:12"
431
+ * @"10:12" | "10:12:00"
432
+ * @"100112" | "10:01:12"
433
+ */
434
+ static prepareValue(value, showSeconds) {
435
+ if (value && value.length > 0 && value != "NaN") {
436
+ let validationValue = value.replace(/:/g, "");
437
+ if (showSeconds) {
438
+ this._maskFormatter.mask = "##:##:##";
439
+ if (validationValue.length < 6) {
440
+ while (validationValue.length < 6) {
441
+ validationValue = "0".concat(validationValue);
442
+ }
443
+ }
444
+ }
445
+ else {
446
+ this._maskFormatter.mask = "##:##";
447
+ if (validationValue.length < 4) {
448
+ while (validationValue.length < 4) {
449
+ validationValue = "0".concat(validationValue);
450
+ }
451
+ }
452
+ }
453
+ if (this._maskFormatter) {
454
+ try {
455
+ value = this._maskFormatter.format(validationValue);
456
+ return value;
457
+ }
458
+ catch (e) {
459
+ throw new Error(e.message);
460
+ }
461
+ }
462
+ }
463
+ return '';
464
+ }
465
+ /**
466
+ * @validateTime: validates if an input string has the corect time format.
467
+ *
468
+ * @param value input string to validate
469
+ *
470
+ * @returns true or false
471
+ *
472
+ * @Exemples
473
+ * @"1012" | true
474
+ * @"14e4" | false
475
+ * @"2624" | false
476
+ */
477
+ static validateTime(value, showSeconds) {
478
+ let isValid = true;
479
+ if (value) {
480
+ let validationValue = value.replace(/:/g, "");
481
+ if (showSeconds) {
482
+ if (!["1", "2", "0"].includes(validationValue[0])) {
483
+ isValid = false;
484
+ }
485
+ if (!["0", "1", "2", "3", "4", "5"].includes(validationValue[2])) {
486
+ isValid = false;
487
+ }
488
+ if (!["0", "1", "2", "3", "4", "5"].includes(validationValue[4])) {
489
+ isValid = false;
490
+ }
491
+ if (validationValue[0] == "2" && !["0", "1", "2", "3"].includes(validationValue[1])) {
492
+ isValid = false;
493
+ }
494
+ }
495
+ else {
496
+ if (!["1", "2", "0"].includes(validationValue[0])) {
497
+ isValid = false;
498
+ }
499
+ if (!["0", "1", "2", "3", "4", "5"].includes(validationValue[2])) {
500
+ isValid = false;
501
+ }
502
+ if (validationValue[0] == "2" && !["0", "1", "2", "3"].includes(validationValue[1])) {
503
+ isValid = false;
504
+ }
505
+ }
506
+ }
507
+ else {
508
+ isValid = false;
509
+ }
510
+ return isValid;
511
+ }
512
+ }
513
+ TimeFormatter._maskFormatter = new MaskFormatter("##:##");
514
+
515
+ /**
516
+ * Representa as propriedades necessárias para se executar uma requisição.
517
+ */
518
+ /** Representa os verbos HTTP suportados */
519
+ var Method;
520
+ (function (Method) {
521
+ Method[Method["GET"] = 0] = "GET";
522
+ Method[Method["PUT"] = 1] = "PUT";
523
+ Method[Method["POST"] = 2] = "POST";
524
+ Method[Method["DELETE"] = 3] = "DELETE";
525
+ })(Method || (Method = {}));
526
+
527
+ export { MaskFormatter as M, NumberUtils as N, TimeFormatter as T };