ebta-workflow-prod 4.1.1 → 4.1.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebta-workflow-prod",
3
3
  "private": false,
4
- "version": "4.1.1",
4
+ "version": "4.1.2",
5
5
  "description": "",
6
6
  "license": "UNLICENSED",
7
7
  "author": "",
@@ -1310,6 +1310,8 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
1310
1310
  setProperty("filteredValues" as any, filterrangeResult)
1311
1311
  };
1312
1312
 
1313
+ const normalizeNumber = (value: number) => Number(value.toFixed(10));
1314
+
1313
1315
  const maxStringLength = 28
1314
1316
  function itemText(item: fieldValue, type?: string) {
1315
1317
  let rawResult: string = ''
@@ -1398,7 +1400,7 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
1398
1400
  const newStart = event.target.value ? dayjs(event.target.value) : startDate;
1399
1401
  handleDateRangeChange(newStart, endDate);
1400
1402
  }}
1401
- style={{ color: 'var(--accentIconBorder)', border: '1px solid var(--accentIconBorder)', borderRadius: 4, padding: '4px 8px', marginRight: 8 }}
1403
+ style={{ color: 'var(--accentIconBorder)', backgroundColor: '#fff', colorScheme: 'light', border: '1px solid var(--accentIconBorder)', borderRadius: 4, padding: '4px 8px', marginRight: 8 }}
1402
1404
  />
1403
1405
  <span>to</span>
1404
1406
  <input
@@ -1410,7 +1412,7 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
1410
1412
  const newEnd = event.target.value ? dayjs(event.target.value) : endDate;
1411
1413
  handleDateRangeChange(startDate, newEnd);
1412
1414
  }}
1413
- style={{ color: 'var(--accentIconBorder)', border: '1px solid var(--accentIconBorder)', borderRadius: 4, padding: '4px 8px', marginLeft: 8 }}
1415
+ style={{ color: 'var(--accentIconBorder)', backgroundColor: '#fff', colorScheme: 'light', border: '1px solid var(--accentIconBorder)', borderRadius: 4, padding: '4px 8px', marginLeft: 8 }}
1414
1416
  />
1415
1417
  </Box>
1416
1418
  :
@@ -1420,16 +1422,17 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
1420
1422
  <CustomNumberInput aria-label="min value input" placeholder={`Min (${attributeMin} ~ ${attributeMax})`} min={attributeMin - 1} max={attributeMax + 1}
1421
1423
  value={minValue == -Infinity ? undefined : minValue} step={0.1}
1422
1424
  onChange={(event, val) => {
1423
- if (((val || val == 0) && (val <= maxValue))) { setProperty("minValue" as any, val) };
1424
- if (val == undefined || val == null) { setProperty("minValue" as any, -Infinity) };
1425
+ const normalizedValue = typeof val === 'number' ? normalizeNumber(val) : val;
1426
+ if (((normalizedValue || normalizedValue == 0) && (normalizedValue <= maxValue))) { setProperty("minValue" as any, normalizedValue) };
1427
+ if (normalizedValue == undefined || normalizedValue == null) { setProperty("minValue" as any, -Infinity) };
1425
1428
 
1426
- if ((val || val == 0) && val > maxValue) {
1429
+ if ((normalizedValue || normalizedValue == 0) && normalizedValue > maxValue) {
1427
1430
  setProperty("minValue" as any, maxValue - 1)
1428
1431
  const filterrangeResult = filterRange(attribute, maxValue - 1, maxValue)
1429
1432
  setProperty("filteredValues" as any, filterrangeResult)
1430
1433
  }
1431
1434
  else {
1432
- const filterrangeResult = filterRange(attribute, val !== null ? val : -Infinity, maxValue !== Infinity ? maxValue : Infinity)
1435
+ const filterrangeResult = filterRange(attribute, normalizedValue !== null && normalizedValue !== undefined ? normalizedValue : -Infinity, maxValue !== Infinity ? maxValue : Infinity)
1433
1436
  setProperty("filteredValues" as any, filterrangeResult)
1434
1437
  }
1435
1438
  }}
@@ -1437,15 +1440,16 @@ function AttributeFilter(props: AttributeFilterProps): React.ReactElement {
1437
1440
  <CustomNumberInput aria-label="max value input" placeholder={`Max (${attributeMin} ~ ${attributeMax})`} min={attributeMin - 1} max={attributeMax + 1}
1438
1441
  value={maxValue == Infinity ? undefined : maxValue} step={0.1}
1439
1442
  onChange={(_event, val) => {
1440
- if ((val || val == 0) && (val >= minValue)) { setProperty("maxValue" as any, val) };
1441
- if (val == undefined) { setProperty("maxValue" as any, Infinity) };
1442
- if ((val || val == 0) && val < minValue) {
1443
+ const normalizedValue = typeof val === 'number' ? normalizeNumber(val) : val;
1444
+ if ((normalizedValue || normalizedValue == 0) && (normalizedValue >= minValue)) { setProperty("maxValue" as any, normalizedValue) };
1445
+ if (normalizedValue == undefined || normalizedValue == null) { setProperty("maxValue" as any, Infinity) };
1446
+ if ((normalizedValue || normalizedValue == 0) && normalizedValue < minValue) {
1443
1447
  setProperty("maxValue" as any, minValue + 1)
1444
1448
  const filterrangeResult = filterRange(attribute, minValue, minValue + 1)
1445
1449
  setProperty("filteredValues" as any, filterrangeResult)
1446
1450
  }
1447
1451
  else {
1448
- const filterrangeResult = filterRange(attribute, minValue !== -Infinity ? minValue : -Infinity, val !== null ? val : Infinity || Infinity)
1452
+ const filterrangeResult = filterRange(attribute, minValue !== -Infinity ? minValue : -Infinity, normalizedValue !== null && normalizedValue !== undefined ? normalizedValue : Infinity)
1449
1453
  setProperty("filteredValues" as any, filterrangeResult)
1450
1454
  }
1451
1455
  }}
@@ -156,12 +156,10 @@ const CustomNumberInput = React.forwardRef(function CustomNumberInput(
156
156
  }}
157
157
  slotProps={{
158
158
  incrementButton: {
159
- children: 'Increase value',
160
- 'aria-label': 'Increase value',
159
+ children: '▴',
161
160
  },
162
161
  decrementButton: {
163
- children: 'Decrease value',
164
- 'aria-label': 'Decrease value',
162
+ children: '▾',
165
163
  },
166
164
  }}
167
165
  {...props}