@controleonline/ui-default 1.0.270 → 1.0.273

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 (100) hide show
  1. package/.github/workflows/integration-source-gate.yml +68 -0
  2. package/.github/workflows/manager-worker.yml +19 -0
  3. package/.github/workflows/publish-npm.yml +91 -0
  4. package/AGENTS.md +46 -50
  5. package/docs/technical/Contrato-de-colunas.md +67 -0
  6. package/docs/technical/Default-Components.md +76 -0
  7. package/docs/technical/DefaultForm.md +80 -0
  8. package/docs/technical/DefaultInput-e-DefaultSelect.md +73 -0
  9. package/docs/technical/DefaultTable.md +272 -0
  10. package/docs/wiki.md +1 -0
  11. package/package.json +4 -3
  12. package/scripts/validate-wiki-pointer.cjs +13 -0
  13. package/src/react/components/address/DefaultAddress.js +446 -0
  14. package/src/react/components/address/DefaultAddress.styles.js +133 -0
  15. package/src/react/components/address/DefaultAddressCoordFields.js +59 -0
  16. package/src/react/components/address/DefaultAddressMapPane.js +55 -0
  17. package/src/react/components/address/LatLonReadonlyFields.js +51 -0
  18. package/src/react/components/address/defaultAddressHelpers.js +163 -0
  19. package/src/react/components/address/defaultAddressStyles.js +148 -0
  20. package/src/react/components/address/defaultAddressUtils.js +129 -0
  21. package/src/react/components/extra-data/DefaultExtraData.js +152 -0
  22. package/src/react/components/extra-data/DefaultExtraData.styles.js +61 -0
  23. package/src/react/components/files/DefaultFile.js +231 -46
  24. package/src/react/components/files/DefaultFileColumn.js +123 -0
  25. package/src/react/components/files/DefaultFileColumn.styles.js +52 -0
  26. package/src/react/components/files/DefaultFileColumn.utils.js +104 -0
  27. package/src/react/components/filters/CompactFilterSelector.js +51 -35
  28. package/src/react/components/filters/DefaultColumnFilter.js +60 -48
  29. package/src/react/components/filters/DefaultExternalFilters.js +324 -265
  30. package/src/react/components/filters/filterValue.js +65 -0
  31. package/src/react/components/form/DefaultForm.js +99 -79
  32. package/src/react/components/help/DefaultTooltip.js +48 -12
  33. package/src/react/components/help/DefaultTooltip.styles.js +20 -0
  34. package/src/react/components/inputs/DefaultColorInput.js +153 -0
  35. package/src/react/components/inputs/DefaultFeatherIconPicker.js +146 -0
  36. package/src/react/components/inputs/DefaultFeatherIconPicker.styles.js +113 -0
  37. package/src/react/components/inputs/DefaultInput.js +296 -141
  38. package/src/react/components/inputs/DefaultInput.styles.js +26 -0
  39. package/src/react/components/inputs/DefaultSelect.js +134 -123
  40. package/src/react/components/inputs/defaultInputUtils.js +262 -213
  41. package/src/react/components/map/DefaultMap.native.js +73 -73
  42. package/src/react/components/map/DefaultMap.shared.js +911 -762
  43. package/src/react/components/map/DefaultMap.web.js +124 -68
  44. package/src/react/components/table/DefaultColumnMenu.js +22 -3
  45. package/src/react/components/table/DefaultDebug.js +44 -37
  46. package/src/react/components/table/DefaultSearchModal.js +9 -1
  47. package/src/react/components/table/DefaultTable.grouping.js +98 -0
  48. package/src/react/components/table/DefaultTable.js +217 -111
  49. package/src/react/components/table/DefaultTable.styles.js +369 -310
  50. package/src/react/components/table/DefaultTable.utils.js +38 -4
  51. package/src/react/components/table/DefaultTableBody.js +13 -8
  52. package/src/react/components/table/DefaultTableCards.js +20 -1
  53. package/src/react/components/table/DefaultTableControls.js +180 -205
  54. package/src/react/components/table/DefaultTableImportModal.js +108 -0
  55. package/src/react/components/table/DefaultTableInput.js +1 -0
  56. package/src/react/components/table/DefaultTableRowActions.js +1 -1
  57. package/src/react/components/table/DefaultTableRows.js +357 -325
  58. package/src/react/components/table/DefaultTableSearch.js +28 -5
  59. package/src/react/components/table/DefaultTableToolbar.js +92 -3
  60. package/src/react/components/table/useDefaultTablePagination.js +56 -7
  61. package/src/react/components/table/useDefaultTableStoreSync.js +164 -0
  62. package/src/react/components/upload/DefaultUpload.js +406 -0
  63. package/src/react/components/upload/DefaultUpload.styles.js +153 -0
  64. package/src/react/components/upload/DefaultUploadAttachmentsList.js +146 -0
  65. package/src/react/components/upload/DefaultUploadManagerModal.js +247 -0
  66. package/src/react/components/upload/defaultUploadHelpers.js +108 -0
  67. package/src/react/components/upload/defaultUploadLibrary.js +248 -0
  68. package/src/react/components/upload/fileUpload.js +93 -0
  69. package/src/react/hooks/usePostalCodeLookup.js +159 -0
  70. package/src/react/index.js +6 -0
  71. package/src/react/services/addressFormUtils.js +262 -0
  72. package/src/react/services/addressGeo.js +230 -0
  73. package/src/react/utils/tableVisibleColumnsPreferences.js +113 -15
  74. package/src/tests/react/components/address/defaultAddressHelpers.test.js +104 -0
  75. package/src/tests/react/components/files/DefaultFile.test.js +22 -6
  76. package/src/tests/react/components/files/DefaultFileColumn.company.test.js +24 -0
  77. package/src/tests/react/components/form/DefaultForm.test.js +123 -0
  78. package/src/tests/react/components/help/DefaultTooltip.test.js +93 -0
  79. package/src/tests/react/components/inputs/DefaultSelect.test.js +108 -79
  80. package/src/tests/react/components/table/DefaultTable.grouping.test.js +49 -0
  81. package/src/tests/react/components/table/DefaultTable.test.js +53 -2
  82. package/src/tests/react/components/table/DefaultTable.utils.test.js +10 -0
  83. package/src/tests/react/components/table/DefaultTableControls.filters.test.mjs +21 -0
  84. package/src/tests/react/components/table/DefaultTableRowActions.test.js +23 -0
  85. package/src/tests/react/components/table/DefaultTableRows.rowActions.test.js +152 -0
  86. package/src/tests/react/components/table/resolveRowBackgroundColor.test.mjs +45 -0
  87. package/src/tests/react/components/table/useDefaultTableStoreSync.test.js +161 -0
  88. package/src/tests/react/components/upload/DefaultUpload.test.js +353 -0
  89. package/src/tests/react/components/upload/defaultUploadLibrary.test.js +104 -0
  90. package/src/tests/react/components/upload/peopleMediaLibraryPreview.test.mjs +57 -0
  91. package/src/tests/react/filters/filterValue.test.js +46 -0
  92. package/src/tests/react/hooks/usePostalCodeLookup.test.js +107 -0
  93. package/src/tests/react/inputs/defaultInputUtils.test.js +9 -1
  94. package/src/tests/react/services/SMOKE-637-cep-hydrate.md +45 -0
  95. package/src/tests/react/services/addressFormUtils.test.js +179 -0
  96. package/src/tests/react/services/addressGeoLookup.async.test.js +104 -0
  97. package/src/tests/react/services/addressGeoLookup.test.js +105 -0
  98. package/src/tests/react/services/smoke-637/form-cep-12941040.png +0 -0
  99. package/src/tests/react/services/smoke-637/index.html +132 -0
  100. package/src/tests/react/utils/tableVisibleColumnsPreferences.test.js +96 -49
@@ -2,31 +2,31 @@ import { getAllStores } from '@store';
2
2
  import Formatter from '@controleonline/ui-common/src/utils/formatter.js';
3
3
  import { formatStoreColumnValue } from '@controleonline/ui-common/src/react/utils/storeColumns';
4
4
  import FeatherGlyphMap from 'react-native-vector-icons/glyphmaps/Feather.json';
5
-
5
+
6
6
  export const normalizeText = value => String(value ?? '').trim();
7
7
  export const isValidFeatherIcon = icon => Boolean(FeatherGlyphMap[normalizeText(icon)]);
8
8
  const formatHumanLabel = value =>
9
- normalizeText(value)
10
- .replace(/([a-z])([A-Z])/g, '$1 $2')
11
- .replace(/[_-]+/g, ' ')
12
- .replace(/^\w/, letter => letter.toUpperCase());
13
- const DEFAULT_TRANSLATABLE_FIELDS = new Set([
14
- 'active',
15
- 'app',
16
- 'channel',
17
- 'displaytype',
18
- 'featured',
19
- 'frequency',
20
- 'invoicetype',
21
- 'installments',
22
- 'ordertype',
23
- 'peopletype',
24
- 'pricecalculation',
25
- 'productcondition',
26
- 'realstatus',
27
- 'status',
28
- ]);
29
-
9
+ normalizeText(value)
10
+ .replace(/([a-z])([A-Z])/g, '$1 $2')
11
+ .replace(/[_-]+/g, ' ')
12
+ .replace(/^\w/, letter => letter.toUpperCase());
13
+ const DEFAULT_TRANSLATABLE_FIELDS = new Set([
14
+ 'active',
15
+ 'app',
16
+ 'channel',
17
+ 'displaytype',
18
+ 'featured',
19
+ 'frequency',
20
+ 'invoicetype',
21
+ 'installments',
22
+ 'ordertype',
23
+ 'peopletype',
24
+ 'pricecalculation',
25
+ 'productcondition',
26
+ 'realstatus',
27
+ 'status',
28
+ ]);
29
+
30
30
  export const getColumnKey = column => column?.key || column?.name || '';
31
31
 
32
32
  export const isDateColumn = column =>
@@ -39,120 +39,197 @@ export const isDateRangeColumn = column =>
39
39
 
40
40
  export const isDateLikeColumn = column =>
41
41
  isDateColumn(column) || isDateRangeColumn(column);
42
-
43
- const normalizeColumnKey = value =>
44
- normalizeText(value)
45
- .replace(/[^a-zA-Z0-9]/g, '')
46
- .toLowerCase();
47
-
48
- const shouldTranslateOptionLabel = (column, storeName, rawLabel) => {
49
- if (column?.translate === false || !normalizeText(rawLabel) || !normalizeText(storeName)) {
50
- return false;
51
- }
52
-
53
- if (column?.translate === true || Array.isArray(column?.list)) {
54
- return true;
55
- }
56
-
57
- return [column?.key, column?.name, column?.label]
58
- .map(normalizeColumnKey)
59
- .filter(Boolean)
60
- .some(candidate => DEFAULT_TRANSLATABLE_FIELDS.has(candidate));
61
- };
62
-
63
- export const normalizeId = value => {
64
- if (!value) return '';
65
- if (typeof value === 'number') return String(value);
66
- if (typeof value === 'string') {
67
- const match = value.match(/\d+/g);
68
- return match ? match[match.length - 1] : value;
69
- }
70
- return normalizeId(value?.id || value?.['@id'] || '');
71
- };
72
-
73
- export const isEditableColumn = column =>
74
- column?.editable !== false &&
75
- !column?.isIdentity &&
76
- column?.inputType !== 'increase' &&
77
- column?.inputType !== 'image' &&
78
- !String(getColumnKey(column)).includes('.');
79
-
80
- export const normalizeOptionKey = option => {
81
- if (!option) return '';
82
- if (typeof option !== 'object') return normalizeId(option) || normalizeText(option);
83
- return normalizeText(
84
- option.value ??
85
- option.id ??
86
- normalizeId(option['@id']) ??
87
- option.key ??
88
- '',
89
- );
90
- };
91
-
92
- export const resolveOptionLabel = (column, option, storeName = '') => {
93
- if (!option) return '';
94
-
95
- const translateOptionLabel = rawLabel => {
96
- const normalizedLabel = normalizeText(rawLabel);
97
- if (!shouldTranslateOptionLabel(column, storeName, normalizedLabel)) {
98
- return normalizedLabel;
99
- }
100
-
101
- const translated = global.t?.t(storeName, 'label', normalizedLabel) || normalizedLabel;
102
- return normalizeText(translated) === formatHumanLabel(normalizedLabel)
103
- ? normalizedLabel
104
- : translated;
105
- };
106
-
107
- if (typeof column?.formatList === 'function') {
108
- const formatted = column.formatList(option, null, column);
109
- if (formatted && typeof formatted === 'object') {
110
- return translateOptionLabel(formatted.label ?? formatted.value);
111
- }
112
- if (formatted) return translateOptionLabel(formatted);
113
- }
114
-
115
- const rawLabel = normalizeText(
116
- option.label ??
117
- option[column?.searchParam] ??
118
- option[column?.name] ??
119
- option.name ??
120
- option.status ??
121
- option.wallet ??
122
- option.paymentType ??
123
- option.alias ??
124
- option.id,
125
- );
126
-
127
- return translateOptionLabel(rawLabel);
128
- };
129
-
42
+
43
+ export const isColorColumn = column => {
44
+ const fieldName = normalizeColumnKey(getColumnKey(column));
45
+ const inputType = normalizeColumnKey(column?.inputType || column?.type);
46
+
47
+ return (
48
+ inputType === 'color' ||
49
+ inputType === 'hexcolor' ||
50
+ fieldName === 'color' ||
51
+ fieldName === 'bgcolor' ||
52
+ fieldName === 'backgroundcolor' ||
53
+ fieldName === 'bordercolor'
54
+ );
55
+ };
56
+
57
+ export const isIconColumn = column => {
58
+ const fieldName = normalizeColumnKey(getColumnKey(column));
59
+ const inputType = normalizeColumnKey(column?.inputType || column?.type);
60
+
61
+ return inputType === 'icon' || fieldName === 'icon';
62
+ };
63
+
64
+ export const isFileColumn = column => {
65
+ const inputType = normalizeColumnKey(column?.inputType || column?.type);
66
+
67
+ return [
68
+ 'document',
69
+ 'documents',
70
+ 'file',
71
+ 'files',
72
+ 'image',
73
+ 'images',
74
+ 'pdf',
75
+ ].includes(inputType);
76
+ };
77
+
78
+ export const isExtraDataColumn = column =>
79
+ normalizeColumnKey(column?.inputType || column?.type) === 'extradata';
80
+
81
+ const normalizeColumnKey = value =>
82
+ normalizeText(value)
83
+ .replace(/[^a-zA-Z0-9]/g, '')
84
+ .toLowerCase();
85
+
86
+ const shouldTranslateOptionLabel = (column, storeName, rawLabel) => {
87
+ if (column?.translate === false || !normalizeText(rawLabel) || !normalizeText(storeName)) {
88
+ return false;
89
+ }
90
+
91
+ if (column?.translate === true || Array.isArray(column?.list)) {
92
+ return true;
93
+ }
94
+
95
+ return [column?.key, column?.name, column?.label]
96
+ .map(normalizeColumnKey)
97
+ .filter(Boolean)
98
+ .some(candidate => DEFAULT_TRANSLATABLE_FIELDS.has(candidate));
99
+ };
100
+
101
+ export const normalizeId = value => {
102
+ if (!value) return '';
103
+ if (typeof value === 'number') return String(value);
104
+ if (typeof value === 'string') {
105
+ const match = value.match(/\d+/g);
106
+ return match ? match[match.length - 1] : value;
107
+ }
108
+ return normalizeId(value?.id || value?.['@id'] || '');
109
+ };
110
+
111
+ export const isEditableColumn = column =>
112
+ column?.editable !== false &&
113
+ !column?.isIdentity &&
114
+ column?.inputType !== 'increase' &&
115
+ !isFileColumn(column) &&
116
+ !String(getColumnKey(column)).includes('.');
117
+
118
+ export const normalizeOptionKey = option => {
119
+ if (!option) return '';
120
+ if (typeof option !== 'object') return normalizeId(option) || normalizeText(option);
121
+ return normalizeText(
122
+ option.value ??
123
+ option.id ??
124
+ normalizeId(option['@id']) ??
125
+ option.key ??
126
+ '',
127
+ );
128
+ };
129
+
130
+ export const resolveOptionLabel = (column, option, storeName = '') => {
131
+ if (!option) return '';
132
+
133
+ const STATUS_DISPLAY_PT = {
134
+ paid: 'Pago',
135
+ 'waiting payment': 'Aguardando pagamento',
136
+ waiting_payment: 'Aguardando pagamento',
137
+ };
138
+
139
+ const translateOptionLabel = rawLabel => {
140
+ const normalizedLabel = normalizeText(rawLabel);
141
+ const statusFallback = STATUS_DISPLAY_PT[normalizedLabel.toLowerCase()] || '';
142
+ if (!shouldTranslateOptionLabel(column, storeName, normalizedLabel)) {
143
+ return statusFallback || normalizedLabel;
144
+ }
145
+
146
+ const translated = global.t?.t(storeName, 'label', normalizedLabel) || normalizedLabel;
147
+ const translatedText = normalizeText(translated);
148
+ if (
149
+ statusFallback &&
150
+ (!translatedText ||
151
+ translatedText.toLowerCase() === normalizedLabel.toLowerCase() ||
152
+ translatedText === formatHumanLabel(normalizedLabel))
153
+ ) {
154
+ return statusFallback;
155
+ }
156
+ return translatedText === formatHumanLabel(normalizedLabel)
157
+ ? normalizedLabel
158
+ : translated;
159
+ };
160
+
161
+ if (typeof column?.formatList === 'function') {
162
+ const formatted = column.formatList(option, null, column);
163
+ if (formatted && typeof formatted === 'object') {
164
+ return translateOptionLabel(formatted.label ?? formatted.value);
165
+ }
166
+ if (formatted) return translateOptionLabel(formatted);
167
+ }
168
+
169
+ const rawLabel = normalizeText(
170
+ option.label ??
171
+ option[column?.searchParam] ??
172
+ option[column?.name] ??
173
+ option.name ??
174
+ option.status ??
175
+ option.wallet ??
176
+ option.paymentType ??
177
+ option.alias ??
178
+ option.id,
179
+ );
180
+
181
+ return translateOptionLabel(rawLabel);
182
+ };
183
+
130
184
  export const resolveStoreNameFromList = list =>
131
185
  typeof list === 'string' ? normalizeText(list).split('/')[0] || '' : '';
132
-
186
+
133
187
  const filterItemsByListRequestParams = (items = [], column = null) => {
134
- const requestParams =
135
- column?.listRequestParams &&
136
- typeof column.listRequestParams === 'object' &&
137
- !Array.isArray(column.listRequestParams)
138
- ? column.listRequestParams
139
- : null;
140
-
141
- if (!requestParams || Object.keys(requestParams).length === 0) {
142
- return Array.isArray(items) ? items : [];
143
- }
144
-
145
- return (Array.isArray(items) ? items : []).filter(item =>
146
- Object.entries(requestParams).every(([key, expectedValue]) => {
147
- if (expectedValue === undefined || expectedValue === null || expectedValue === '') {
148
- return true;
149
- }
150
-
151
- return normalizeText(item?.[key]) === normalizeText(expectedValue);
152
- }),
188
+ const requestParams =
189
+ column?.listRequestParams &&
190
+ typeof column.listRequestParams === 'object' &&
191
+ !Array.isArray(column.listRequestParams)
192
+ ? column.listRequestParams
193
+ : null;
194
+
195
+ if (!requestParams || Object.keys(requestParams).length === 0) {
196
+ return Array.isArray(items) ? items : [];
197
+ }
198
+
199
+ return (Array.isArray(items) ? items : []).filter(item =>
200
+ Object.entries(requestParams).every(([key, expectedValue]) => {
201
+ if (expectedValue === undefined || expectedValue === null || expectedValue === '') {
202
+ return true;
203
+ }
204
+
205
+ return normalizeText(item?.[key]) === normalizeText(expectedValue);
206
+ }),
153
207
  );
154
208
  };
155
209
 
210
+ export const resolveColorToken = (value, themeColors = {}) => {
211
+ const normalized = normalizeText(value);
212
+ if (!normalized) return '';
213
+
214
+ if (normalized.startsWith('$')) {
215
+ return normalizeText(themeColors?.[normalized.slice(1)]);
216
+ }
217
+
218
+ const cssVarMatch = normalized.match(/^var\([^,]+,\s*(#[0-9a-fA-F]{3,8})\s*\)$/);
219
+ if (cssVarMatch?.[1]) return cssVarMatch[1];
220
+
221
+ return normalized;
222
+ };
223
+
224
+ export const resolveDefaultColorValue = (column, themeColors = {}, fallbackColor = '') =>
225
+ resolveColorToken(
226
+ column?.defaultColor ??
227
+ column?.defaultColour ??
228
+ column?.defaultValue ??
229
+ fallbackColor,
230
+ themeColors,
231
+ );
232
+
156
233
  const normalizeObject = value =>
157
234
  value && typeof value === 'object' && !Array.isArray(value) ? value : {};
158
235
 
@@ -161,31 +238,21 @@ export const mapOptions = (column, items = [], storeName = '') => {
161
238
  const options = [];
162
239
 
163
240
  (Array.isArray(items) ? items : []).forEach(item => {
164
- const formatted =
165
- typeof column?.formatList === 'function'
166
- ? column.formatList(item, null, column)
167
- : item;
168
- const key = normalizeOptionKey(formatted) || normalizeOptionKey(item);
169
- const dedupeKey = key || normalizeText(resolveOptionLabel(column, item, storeName)).toLowerCase();
170
-
171
- if (dedupeKey && seenKeys.has(dedupeKey)) return;
172
- if (dedupeKey) seenKeys.add(dedupeKey);
173
-
241
+ const formatted =
242
+ typeof column?.formatList === 'function'
243
+ ? column.formatList(item, null, column)
244
+ : item;
245
+ const key = normalizeOptionKey(formatted) || normalizeOptionKey(item);
246
+ const dedupeKey = key || normalizeText(resolveOptionLabel(column, item, storeName)).toLowerCase();
247
+
248
+ if (dedupeKey && seenKeys.has(dedupeKey)) return;
249
+ if (dedupeKey) seenKeys.add(dedupeKey);
250
+
174
251
  const formattedMeta = normalizeObject(formatted);
175
252
  const itemMeta = normalizeObject(item);
176
253
  const color = formattedMeta.color ?? itemMeta.color;
177
- const icon =
178
- formattedMeta.icon ??
179
- formattedMeta.iconName ??
180
- itemMeta.icon ??
181
- itemMeta.iconName;
182
- const image =
183
- formattedMeta.image ??
184
- formattedMeta.logo ??
185
- formattedMeta.source ??
186
- itemMeta.image ??
187
- itemMeta.logo ??
188
- itemMeta.source;
254
+ const icon = formattedMeta.icon ?? itemMeta.icon;
255
+ const image = formattedMeta.image ?? itemMeta.image;
189
256
 
190
257
  options.push({
191
258
  ...(color ? { color } : {}),
@@ -196,10 +263,10 @@ export const mapOptions = (column, items = [], storeName = '') => {
196
263
  raw: item,
197
264
  });
198
265
  });
199
-
200
- return options;
201
- };
202
-
266
+
267
+ return options;
268
+ };
269
+
203
270
  export const buildOptionsFromColumn = (column, getOptionsForColumn = null, storeName = '') => {
204
271
  const explicitOptions = getOptionsForColumn?.(column);
205
272
  if (Array.isArray(explicitOptions) && explicitOptions.length > 0) {
@@ -211,26 +278,26 @@ export const buildOptionsFromColumn = (column, getOptionsForColumn = null, store
211
278
  }
212
279
 
213
280
  const listStoreName = resolveStoreNameFromList(column?.list);
214
- if (!listStoreName) return [];
215
-
216
- const listStore = getAllStores()?.[listStoreName];
217
- return mapOptions(
218
- column,
219
- filterItemsByListRequestParams(listStore?.getters?.items || [], column),
220
- storeName,
221
- );
222
- };
223
-
281
+ if (!listStoreName) return [];
282
+
283
+ const listStore = getAllStores()?.[listStoreName];
284
+ return mapOptions(
285
+ column,
286
+ filterItemsByListRequestParams(listStore?.getters?.items || [], column),
287
+ storeName,
288
+ );
289
+ };
290
+
224
291
  export const resolveCellText = ({ column, columns = [], row, storeName, value }) => {
225
292
  const fieldName = getColumnKey(column);
226
293
  const rawValue = value ?? row?.[fieldName];
227
294
  const formattedValue = formatStoreColumnValue({
228
- columns: columns.length ? columns : [column],
229
- fieldName,
230
- row,
231
- storeName,
232
- value: rawValue,
233
- });
295
+ columns: columns.length ? columns : [column],
296
+ fieldName,
297
+ row,
298
+ storeName,
299
+ value: rawValue,
300
+ });
234
301
 
235
302
  return normalizeText(formattedValue) || '-';
236
303
  };
@@ -286,12 +353,8 @@ export const resolveCellPresentation = ({
286
353
  backgroundColor:
287
354
  formattedValueMeta.backgroundColor ??
288
355
  formattedMeta.backgroundColor ??
289
- formattedValueMeta.bgColor ??
290
- formattedMeta.bgColor ??
291
356
  rawMeta.backgroundColor ??
292
- rawMeta.bgColor ??
293
- styleMeta.backgroundColor ??
294
- styleMeta.bgColor,
357
+ styleMeta.backgroundColor,
295
358
  borderColor:
296
359
  formattedValueMeta.borderColor ??
297
360
  formattedMeta.borderColor ??
@@ -301,31 +364,17 @@ export const resolveCellPresentation = ({
301
364
  formattedValueMeta.color ??
302
365
  formattedMeta.color ??
303
366
  rawMeta.color ??
304
- rawMeta.statusColor ??
305
- rawMeta.categoryColor ??
306
367
  styleMeta.color,
307
368
  icon:
308
369
  formattedValueMeta.icon ??
309
- formattedValueMeta.iconName ??
310
370
  formattedMeta.icon ??
311
- formattedMeta.iconName ??
312
371
  rawMeta.icon ??
313
- rawMeta.iconName ??
314
- styleMeta.icon ??
315
- styleMeta.iconName,
372
+ styleMeta.icon,
316
373
  image:
317
374
  formattedValueMeta.image ??
318
- formattedValueMeta.logo ??
319
- formattedValueMeta.source ??
320
375
  formattedMeta.image ??
321
- formattedMeta.logo ??
322
- formattedMeta.source ??
323
376
  rawMeta.image ??
324
- rawMeta.logo ??
325
- rawMeta.source ??
326
- styleMeta.image ??
327
- styleMeta.logo ??
328
- styleMeta.source,
377
+ styleMeta.image,
329
378
  label,
330
379
  };
331
380
  };
@@ -382,29 +431,29 @@ export const buildReadPresentationStyles = presentation => {
382
431
  export const resolveEditValue = (column, row, value) => {
383
432
  const rawValue = value ?? row?.[getColumnKey(column)];
384
433
  if (column?.list) {
385
- return normalizeOptionKey(
386
- typeof column?.formatList === 'function'
387
- ? column.formatList(rawValue, row, column)
388
- : rawValue,
389
- );
390
- }
391
-
392
- if (typeof column?.editFormat === 'function') {
393
- return normalizeText(column.editFormat(rawValue, column, row, true));
394
- }
395
-
434
+ return normalizeOptionKey(
435
+ typeof column?.formatList === 'function'
436
+ ? column.formatList(rawValue, row, column)
437
+ : rawValue,
438
+ );
439
+ }
440
+
441
+ if (typeof column?.editFormat === 'function') {
442
+ return normalizeText(column.editFormat(rawValue, column, row, true));
443
+ }
444
+
396
445
  if (isDateLikeColumn(column) && rawValue) {
397
446
  return normalizeText(Formatter.formatDateYmdTodmY(rawValue));
398
447
  }
399
-
400
- return normalizeText(rawValue);
401
- };
402
-
403
- export const formatSaveValue = (column, value, row) => {
404
- if (typeof column?.saveFormat === 'function') {
405
- return column.saveFormat(value, column, row);
406
- }
407
-
448
+
449
+ return normalizeText(rawValue);
450
+ };
451
+
452
+ export const formatSaveValue = (column, value, row) => {
453
+ if (typeof column?.saveFormat === 'function') {
454
+ return column.saveFormat(value, column, row);
455
+ }
456
+
408
457
  if (value && typeof value === 'object') {
409
458
  if (value.value) return Number.isNaN(Number(value.value)) ? value.value : Number(value.value);
410
459
  if (value['@id']) return value['@id'];