diginet-core-ui 1.4.68 → 1.4.69
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.
|
@@ -14,6 +14,7 @@ import { capitalizeSentenceCase, classNames, isValidDate, useControlled } from "
|
|
|
14
14
|
import Calendar from "../calendar";
|
|
15
15
|
import { lowerCaseDayYear } from "../date-input/utils";
|
|
16
16
|
import { parseDateString } from "../../../utils/getLang";
|
|
17
|
+
import { detectDateFormat } from "../../../utils/type";
|
|
17
18
|
const unique = {
|
|
18
19
|
footer: 'DGN-UI-DatePicker-Footer',
|
|
19
20
|
cancel: 'DGN-UI-DatePicker-cancel',
|
|
@@ -230,7 +231,11 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
230
231
|
return value;
|
|
231
232
|
} else if (value === null) {
|
|
232
233
|
return null;
|
|
233
|
-
} else
|
|
234
|
+
} else {
|
|
235
|
+
let formatType = returnFormat;
|
|
236
|
+
if (detectDateFormat(value) !== returnFormat) formatType = detectDateFormat(value);
|
|
237
|
+
return parse(value, lowerCaseDayYear(formatType), new Date());
|
|
238
|
+
}
|
|
234
239
|
}, [value]);
|
|
235
240
|
return jsx(Fragment, null, jsx("div", {
|
|
236
241
|
ref: ref,
|
|
@@ -317,13 +317,12 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
317
317
|
const target = e.target;
|
|
318
318
|
target.value = globalRef.current.valueString;
|
|
319
319
|
target.valueString = globalRef.current.returnValue;
|
|
320
|
+
let value = globalRef.current.value;
|
|
320
321
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
321
|
-
if (String(e.target.valueString).slice(-1) === decimalSymbol)
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
322
|
+
if (String(e.target.valueString).slice(-1) === decimalSymbol) return;else if (value > Number.MAX_SAFE_INTEGER) value = Number.MAX_SAFE_INTEGER;else if (value < Number.MIN_SAFE_INTEGER) value = Number.MIN_SAFE_INTEGER;
|
|
324
323
|
onChange({
|
|
325
324
|
...e,
|
|
326
|
-
value
|
|
325
|
+
value,
|
|
327
326
|
target
|
|
328
327
|
});
|
|
329
328
|
};
|
|
@@ -201,7 +201,7 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
201
201
|
determinateCheckbox(selectAllRef.current, false);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
selectAllRef.current.checked =
|
|
204
|
+
selectAllRef.current.checked = isCheckedAll;
|
|
205
205
|
} else if (selectAllRef.current.checked) {
|
|
206
206
|
selectAllRef.current.checked = false;
|
|
207
207
|
}
|
|
@@ -729,7 +729,7 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
729
729
|
}, [isChanged, isChecked]);
|
|
730
730
|
useEffect(() => {
|
|
731
731
|
if (selectAllRef.current) {
|
|
732
|
-
checkedSelectAllCheckbox();
|
|
732
|
+
setTimeout(() => checkedSelectAllCheckbox());
|
|
733
733
|
}
|
|
734
734
|
if (ref.current.querySelector('.DGN-UI-Accordion-Details-Content')) {
|
|
735
735
|
if (!ref.current.parentNode.classList.contains('expand-able')) {
|
|
@@ -806,7 +806,13 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
806
806
|
viewType: 'outlined',
|
|
807
807
|
...searchProps
|
|
808
808
|
}) : null, multiple && selectAll ? jsx(Fragment, null, jsx("div", {
|
|
809
|
-
className: 'TreeView-All'
|
|
809
|
+
className: 'TreeView-All',
|
|
810
|
+
style: {
|
|
811
|
+
display: 'flex',
|
|
812
|
+
alignItems: 'center',
|
|
813
|
+
minHeight: '40px',
|
|
814
|
+
paddingLeft: '4px'
|
|
815
|
+
}
|
|
810
816
|
}, jsx(Checkbox, {
|
|
811
817
|
label: selectAllLabel,
|
|
812
818
|
onChange: onSelectAll,
|
|
@@ -931,9 +937,6 @@ const TreeViewRootCSS = ({
|
|
|
931
937
|
}
|
|
932
938
|
}
|
|
933
939
|
&.expand-able {
|
|
934
|
-
.TreeView-All {
|
|
935
|
-
margin-left: ${spacing([8.5])};
|
|
936
|
-
}
|
|
937
940
|
.TreeView-Item.non-child {
|
|
938
941
|
padding-left: ${spacing([8.5])};
|
|
939
942
|
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -41,6 +41,17 @@ npm test
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Changelog
|
|
44
|
+
|
|
45
|
+
## 1.4.69
|
|
46
|
+
- \[Fixed\]: DatePicker - Fix allow manual input in DatePicker (Fix "Invalid Date" for default value when typing + Add delayOnChange prop)
|
|
47
|
+
- \[Fixed\]: NumberInput - Fix NumberInput value issue when input exceeds JavaScript numeric limits
|
|
48
|
+
- \[Fixed\]: TreeView - Fix "Check All" display issue in TreeView Core
|
|
49
|
+
|
|
50
|
+
## 1.4.68
|
|
51
|
+
- \[Added\]: Icon – Add Icon PersonEdit
|
|
52
|
+
- \[Fixed\]: TreeView - Fix unchecked values are restored unexpectedly
|
|
53
|
+
- \[Fixed\]: Dropdown - Fix Displays incorrect selected value
|
|
54
|
+
|
|
44
55
|
## 1.4.67
|
|
45
56
|
- \[Added\]: ButtonIcon – Add the title prop to ButtonIcon to display the text as a tooltip on hover.
|
|
46
57
|
- \[Added\]: Icon – Add IconMenu MHRP75N0025
|
package/utils/type.js
CHANGED
|
@@ -94,4 +94,10 @@ const isDeferred = object => {
|
|
|
94
94
|
const isEvent = object => {
|
|
95
95
|
return !!(object && object.preventDefault);
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
const detectDateFormat = dateStr => {
|
|
98
|
+
if (!dateStr || typeof dateStr !== 'string') return null;
|
|
99
|
+
if (/^\d{2}\/\d{2}\/\d{4}$/.test(dateStr)) return 'DD/MM/YYYY';
|
|
100
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(dateStr)) return 'YYYY-MM-DD';
|
|
101
|
+
return null;
|
|
102
|
+
};
|
|
103
|
+
export { isBoolean, isExponential, isDate, isDefined, isFunction, isString, isNumeric, isObject, isEmptyObject, isPlainObject, isPrimitive, isWindow, isRenderer, isPromise, isDeferred, type, isEvent, isEmpty, typeOf, detectDateFormat };
|