@masterteam/components 0.0.193 → 0.0.194
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/assets/common.css +1 -1
- package/assets/i18n/ar.json +1 -0
- package/assets/i18n/en.json +1 -0
- package/fesm2022/masterteam-components-business-fields.mjs +157 -72
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +16 -2
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/fesm2022/masterteam-components-location-field.mjs +141 -49
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +10 -1
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-business-fields.d.ts +94 -19
- package/types/masterteam-components-entities.d.ts +1 -1
- package/types/masterteam-components-location-field.d.ts +27 -9
- package/types/masterteam-components-table.d.ts +2 -2
- package/types/masterteam-components.d.ts +17 -2
|
@@ -3013,6 +3013,9 @@ const CONDITION_WRAPPER_NAMES = new Set([
|
|
|
3013
3013
|
'disable',
|
|
3014
3014
|
]);
|
|
3015
3015
|
const PROPERTY_PREFIXES = ['@', '*.', '$.'];
|
|
3016
|
+
// Matches plain integers / decimals (optionally signed). Such values are
|
|
3017
|
+
// numbers, never dates — see `toDate`.
|
|
3018
|
+
const NUMERIC_STRING_PATTERN = /^[+-]?(\d+\.?\d*|\.\d+)$/;
|
|
3016
3019
|
class FormulaParser {
|
|
3017
3020
|
tokens;
|
|
3018
3021
|
current = 0;
|
|
@@ -3613,8 +3616,19 @@ function toDate(value) {
|
|
|
3613
3616
|
if (value instanceof Date) {
|
|
3614
3617
|
return Number.isNaN(value.getTime()) ? null : value;
|
|
3615
3618
|
}
|
|
3616
|
-
|
|
3617
|
-
|
|
3619
|
+
// Plain numbers and numeric strings are NOT dates. `new Date('100')` parses
|
|
3620
|
+
// as the year 0100, which would otherwise hijack equality/ordering of a
|
|
3621
|
+
// numeric value (e.g. a percentage `== 100`) into a bogus date comparison.
|
|
3622
|
+
// Leave those to the numeric path.
|
|
3623
|
+
if (typeof value === 'number') {
|
|
3624
|
+
return null;
|
|
3625
|
+
}
|
|
3626
|
+
if (typeof value === 'string') {
|
|
3627
|
+
const trimmed = value.trim();
|
|
3628
|
+
if (trimmed === '' || NUMERIC_STRING_PATTERN.test(trimmed)) {
|
|
3629
|
+
return null;
|
|
3630
|
+
}
|
|
3631
|
+
const date = new Date(trimmed);
|
|
3618
3632
|
return Number.isNaN(date.getTime()) ? null : date;
|
|
3619
3633
|
}
|
|
3620
3634
|
return null;
|