@controleonline/ui-default 1.0.270 → 1.0.272
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/.github/workflows/integration-source-gate.yml +68 -0
- package/.github/workflows/manager-worker.yml +19 -0
- package/AGENTS.md +46 -50
- package/docs/technical/Contrato-de-colunas.md +67 -0
- package/docs/technical/Default-Components.md +76 -0
- package/docs/technical/DefaultForm.md +80 -0
- package/docs/technical/DefaultInput-e-DefaultSelect.md +73 -0
- package/docs/technical/DefaultTable.md +203 -0
- package/docs/wiki.md +1 -0
- package/package.json +22 -21
- package/scripts/validate-wiki-pointer.cjs +13 -0
- package/src/react/components/address/DefaultAddress.js +435 -0
- package/src/react/components/address/DefaultAddress.styles.js +133 -0
- package/src/react/components/address/DefaultAddressMapPane.js +55 -0
- package/src/react/components/address/LatLonReadonlyFields.js +51 -0
- package/src/react/components/address/defaultAddressHelpers.js +163 -0
- package/src/react/components/address/defaultAddressStyles.js +136 -0
- package/src/react/components/address/defaultAddressUtils.js +129 -0
- package/src/react/components/extra-data/DefaultExtraData.js +152 -0
- package/src/react/components/extra-data/DefaultExtraData.styles.js +61 -0
- package/src/react/components/files/DefaultFile.js +231 -46
- package/src/react/components/files/DefaultFileColumn.js +123 -0
- package/src/react/components/files/DefaultFileColumn.styles.js +52 -0
- package/src/react/components/files/DefaultFileColumn.utils.js +104 -0
- package/src/react/components/filters/CompactFilterSelector.js +51 -35
- package/src/react/components/filters/DefaultColumnFilter.js +58 -41
- package/src/react/components/filters/DefaultExternalFilters.js +331 -265
- package/src/react/components/form/DefaultForm.js +99 -79
- package/src/react/components/help/DefaultTooltip.js +59 -33
- package/src/react/components/help/DefaultTooltip.styles.js +23 -3
- package/src/react/components/inputs/DefaultColorInput.js +153 -0
- package/src/react/components/inputs/DefaultFeatherIconPicker.js +146 -0
- package/src/react/components/inputs/DefaultFeatherIconPicker.styles.js +113 -0
- package/src/react/components/inputs/DefaultInput.js +69 -5
- package/src/react/components/inputs/DefaultInput.styles.js +26 -0
- package/src/react/components/inputs/DefaultSelect.js +134 -123
- package/src/react/components/inputs/defaultInputUtils.js +69 -43
- package/src/react/components/map/DefaultMap.native.js +73 -73
- package/src/react/components/map/DefaultMap.shared.js +911 -762
- package/src/react/components/map/DefaultMap.web.js +124 -68
- package/src/react/components/table/DefaultColumnMenu.js +109 -108
- package/src/react/components/table/DefaultDebug.js +44 -37
- package/src/react/components/table/DefaultSearchModal.js +9 -1
- package/src/react/components/table/DefaultTable.grouping.js +98 -0
- package/src/react/components/table/DefaultTable.js +213 -107
- package/src/react/components/table/DefaultTable.styles.js +367 -314
- package/src/react/components/table/DefaultTableBody.js +13 -8
- package/src/react/components/table/DefaultTableCards.js +20 -1
- package/src/react/components/table/DefaultTableControls.js +180 -205
- package/src/react/components/table/DefaultTableImportModal.js +108 -0
- package/src/react/components/table/DefaultTableInput.js +1 -0
- package/src/react/components/table/DefaultTableRowActions.js +1 -1
- package/src/react/components/table/DefaultTableRows.js +224 -363
- package/src/react/components/table/DefaultTableSearch.js +28 -5
- package/src/react/components/table/DefaultTableToolbar.js +92 -3
- package/src/react/components/table/useDefaultTablePagination.js +56 -7
- package/src/react/components/table/useDefaultTableStoreSync.js +164 -0
- package/src/react/components/upload/DefaultUpload.js +436 -0
- package/src/react/components/upload/DefaultUpload.styles.js +153 -0
- package/src/react/components/upload/DefaultUploadAttachmentsList.js +138 -0
- package/src/react/components/upload/DefaultUploadManagerModal.js +247 -0
- package/src/react/components/upload/defaultUploadHelpers.js +108 -0
- package/src/react/components/upload/defaultUploadLibrary.js +248 -0
- package/src/react/components/upload/fileUpload.js +93 -0
- package/src/react/hooks/usePostalCodeLookup.js +145 -0
- package/src/react/index.js +6 -0
- package/src/react/services/addressFormUtils.js +196 -0
- package/src/react/services/addressGeo.js +227 -0
- package/src/react/utils/tableVisibleColumnsPreferences.js +29 -12
- package/src/tests/react/components/address/defaultAddressHelpers.test.js +104 -0
- package/src/tests/react/components/files/DefaultFile.test.js +6 -6
- package/src/tests/react/components/form/DefaultForm.test.js +123 -0
- package/src/tests/react/components/inputs/DefaultSelect.test.js +108 -79
- package/src/tests/react/components/table/DefaultTable.grouping.test.js +49 -0
- package/src/tests/react/components/table/DefaultTable.test.js +53 -2
- package/src/tests/react/components/table/DefaultTableControls.filters.test.mjs +21 -0
- package/src/tests/react/components/table/resolveRowBackgroundColor.test.mjs +45 -0
- package/src/tests/react/components/table/useDefaultTableStoreSync.test.js +161 -0
- package/src/tests/react/components/upload/DefaultUpload.test.js +353 -0
- package/src/tests/react/components/upload/defaultUploadLibrary.test.js +82 -0
- package/src/tests/react/components/upload/peopleMediaLibraryPreview.test.mjs +57 -0
- package/src/tests/react/hooks/usePostalCodeLookup.test.js +40 -0
- package/src/tests/react/services/SMOKE-637-cep-hydrate.md +45 -0
- package/src/tests/react/services/addressFormUtils.test.js +176 -0
- package/src/tests/react/services/addressGeoLookup.async.test.js +104 -0
- package/src/tests/react/services/addressGeoLookup.test.js +105 -0
- package/src/tests/react/services/smoke-637/form-cep-12941040.png +0 -0
- package/src/tests/react/services/smoke-637/index.html +132 -0
- package/src/tests/react/utils/tableVisibleColumnsPreferences.test.js +84 -48
|
@@ -44,6 +44,7 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
44
44
|
{ name: 'price', visible: false },
|
|
45
45
|
];
|
|
46
46
|
const scope = {
|
|
47
|
+
companyKey: '42',
|
|
47
48
|
storeKey: 'financialEntries',
|
|
48
49
|
routeKey: 'receivables',
|
|
49
50
|
};
|
|
@@ -76,15 +77,17 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
76
77
|
});
|
|
77
78
|
});
|
|
78
79
|
|
|
79
|
-
it('builds the route and store preference scope', () => {
|
|
80
|
+
it('builds the company, route and store preference scope', () => {
|
|
80
81
|
global.location = {pathname: '/order-history-page'};
|
|
81
82
|
|
|
82
83
|
expect(
|
|
83
84
|
resolveDefaultTablePreferenceScope({
|
|
85
|
+
companyId: 42,
|
|
84
86
|
route: {name: 'IgnoredRoute'},
|
|
85
87
|
storeName: 'orders',
|
|
86
88
|
}),
|
|
87
89
|
).toEqual({
|
|
90
|
+
companyKey: '42',
|
|
88
91
|
routeKey: 'order-history-page',
|
|
89
92
|
storeKey: 'orders',
|
|
90
93
|
});
|
|
@@ -97,11 +100,13 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
97
100
|
|
|
98
101
|
expect(
|
|
99
102
|
resolveDefaultTablePreferenceScope({
|
|
103
|
+
companyId: '99',
|
|
100
104
|
preferenceKey: 'product_showcase_items',
|
|
101
105
|
route: {name: 'ProductShowcasesPage'},
|
|
102
106
|
storeName: 'product_showcase_items',
|
|
103
107
|
}),
|
|
104
108
|
).toEqual({
|
|
109
|
+
companyKey: '99',
|
|
105
110
|
routeKey: 'product_showcase_items',
|
|
106
111
|
storeKey: 'product_showcase_items',
|
|
107
112
|
});
|
|
@@ -129,15 +134,17 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
129
134
|
});
|
|
130
135
|
});
|
|
131
136
|
|
|
132
|
-
it('reads and writes visible columns under default-table[store][route]', () => {
|
|
137
|
+
it('reads and writes visible columns under default-table[company][store][route]', () => {
|
|
133
138
|
global.localStorage.setItem(
|
|
134
139
|
DEFAULT_TABLE_PREFERENCES_STORAGE_KEY,
|
|
135
140
|
JSON.stringify({
|
|
136
141
|
theme: 'light',
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
'42': {
|
|
143
|
+
financialEntries: {
|
|
144
|
+
receivables: {
|
|
145
|
+
[TABLE_VISIBLE_COLUMNS_PREFERENCES_KEY]: {
|
|
146
|
+
id: false,
|
|
147
|
+
},
|
|
141
148
|
},
|
|
142
149
|
},
|
|
143
150
|
},
|
|
@@ -149,6 +156,7 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
149
156
|
});
|
|
150
157
|
|
|
151
158
|
persistVisibleColumnsPreference({
|
|
159
|
+
companyKey: '42',
|
|
152
160
|
storeKey: 'financialEntries',
|
|
153
161
|
routeKey: 'payables',
|
|
154
162
|
}, {
|
|
@@ -162,29 +170,33 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
162
170
|
),
|
|
163
171
|
).toEqual({
|
|
164
172
|
theme: 'light',
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
'42': {
|
|
174
|
+
financialEntries: {
|
|
175
|
+
receivables: {
|
|
176
|
+
[TABLE_VISIBLE_COLUMNS_PREFERENCES_KEY]: {
|
|
177
|
+
id: false,
|
|
178
|
+
},
|
|
169
179
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
payables: {
|
|
181
|
+
[TABLE_VISIBLE_COLUMNS_PREFERENCES_KEY]: {
|
|
182
|
+
id: true,
|
|
183
|
+
status: false,
|
|
184
|
+
},
|
|
175
185
|
},
|
|
176
186
|
},
|
|
177
187
|
},
|
|
178
188
|
});
|
|
179
189
|
});
|
|
180
190
|
|
|
181
|
-
it('reads and writes view mode under default-table[store][route]', () => {
|
|
191
|
+
it('reads and writes view mode under default-table[company][store][route]', () => {
|
|
182
192
|
global.localStorage.setItem(
|
|
183
193
|
DEFAULT_TABLE_PREFERENCES_STORAGE_KEY,
|
|
184
194
|
JSON.stringify({
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
195
|
+
'42': {
|
|
196
|
+
financialEntries: {
|
|
197
|
+
payables: {
|
|
198
|
+
[TABLE_VIEW_MODE_PREFERENCES_KEY]: 'cards',
|
|
199
|
+
},
|
|
188
200
|
},
|
|
189
201
|
},
|
|
190
202
|
}),
|
|
@@ -192,7 +204,7 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
192
204
|
|
|
193
205
|
expect(
|
|
194
206
|
resolveStoredTableViewModePreference(
|
|
195
|
-
{storeKey: 'financialEntries', routeKey: 'payables'},
|
|
207
|
+
{companyKey: '42', storeKey: 'financialEntries', routeKey: 'payables'},
|
|
196
208
|
'table',
|
|
197
209
|
),
|
|
198
210
|
).toBe('cards');
|
|
@@ -208,26 +220,30 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
208
220
|
global.localStorage.getItem(DEFAULT_TABLE_PREFERENCES_STORAGE_KEY),
|
|
209
221
|
),
|
|
210
222
|
).toEqual({
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
'42': {
|
|
224
|
+
financialEntries: {
|
|
225
|
+
payables: {
|
|
226
|
+
[TABLE_VIEW_MODE_PREFERENCES_KEY]: 'cards',
|
|
227
|
+
},
|
|
228
|
+
receivables: {
|
|
229
|
+
[TABLE_VIEW_MODE_PREFERENCES_KEY]: 'table',
|
|
230
|
+
},
|
|
217
231
|
},
|
|
218
232
|
},
|
|
219
233
|
});
|
|
220
234
|
});
|
|
221
235
|
|
|
222
|
-
it('reads and writes sort under default-table[store][route]', () => {
|
|
236
|
+
it('reads and writes sort under default-table[company][store][route]', () => {
|
|
223
237
|
global.localStorage.setItem(
|
|
224
238
|
DEFAULT_TABLE_PREFERENCES_STORAGE_KEY,
|
|
225
239
|
JSON.stringify({
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
240
|
+
'42': {
|
|
241
|
+
financialEntries: {
|
|
242
|
+
payables: {
|
|
243
|
+
[TABLE_SORT_PREFERENCES_KEY]: {
|
|
244
|
+
direction: 'asc',
|
|
245
|
+
field: 'price',
|
|
246
|
+
},
|
|
231
247
|
},
|
|
232
248
|
},
|
|
233
249
|
},
|
|
@@ -236,6 +252,7 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
236
252
|
|
|
237
253
|
expect(
|
|
238
254
|
resolveStoredTableSortPreference({
|
|
255
|
+
companyKey: '42',
|
|
239
256
|
storeKey: 'financialEntries',
|
|
240
257
|
routeKey: 'payables',
|
|
241
258
|
}),
|
|
@@ -256,24 +273,26 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
256
273
|
global.localStorage.getItem(DEFAULT_TABLE_PREFERENCES_STORAGE_KEY),
|
|
257
274
|
),
|
|
258
275
|
).toEqual({
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
276
|
+
'42': {
|
|
277
|
+
financialEntries: {
|
|
278
|
+
payables: {
|
|
279
|
+
[TABLE_SORT_PREFERENCES_KEY]: {
|
|
280
|
+
direction: 'asc',
|
|
281
|
+
field: 'price',
|
|
282
|
+
},
|
|
264
283
|
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
284
|
+
receivables: {
|
|
285
|
+
[TABLE_SORT_PREFERENCES_KEY]: {
|
|
286
|
+
direction: 'desc',
|
|
287
|
+
field: 'dueDate',
|
|
288
|
+
},
|
|
270
289
|
},
|
|
271
290
|
},
|
|
272
291
|
},
|
|
273
292
|
});
|
|
274
293
|
});
|
|
275
294
|
|
|
276
|
-
it('reads and writes filters under default-table[store][route]', () => {
|
|
295
|
+
it('reads and writes filters under default-table[company][store][route]', () => {
|
|
277
296
|
persistTableFiltersPreference(scope, {
|
|
278
297
|
search: '72813',
|
|
279
298
|
status: 'paid',
|
|
@@ -289,14 +308,31 @@ describe('tableVisibleColumnsPreferences', () => {
|
|
|
289
308
|
global.localStorage.getItem(DEFAULT_TABLE_PREFERENCES_STORAGE_KEY),
|
|
290
309
|
),
|
|
291
310
|
).toEqual({
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
311
|
+
'42': {
|
|
312
|
+
financialEntries: {
|
|
313
|
+
receivables: {
|
|
314
|
+
[TABLE_FILTER_PREFERENCES_KEY]: {
|
|
315
|
+
search: '72813',
|
|
316
|
+
status: 'paid',
|
|
317
|
+
},
|
|
297
318
|
},
|
|
298
319
|
},
|
|
299
320
|
},
|
|
300
321
|
});
|
|
301
322
|
});
|
|
323
|
+
|
|
324
|
+
it('ignores scopes without a company key', () => {
|
|
325
|
+
persistTableFiltersPreference(
|
|
326
|
+
{storeKey: 'orders', routeKey: 'order-history-page'},
|
|
327
|
+
{app: 'POS'},
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
expect(global.localStorage.getItem(DEFAULT_TABLE_PREFERENCES_STORAGE_KEY)).toBeNull();
|
|
331
|
+
expect(
|
|
332
|
+
resolveStoredTableFiltersPreference({
|
|
333
|
+
storeKey: 'orders',
|
|
334
|
+
routeKey: 'order-history-page',
|
|
335
|
+
}),
|
|
336
|
+
).toBeNull();
|
|
337
|
+
});
|
|
302
338
|
});
|