diginet-core-ui 1.4.46 → 1.4.47
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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2082_21)">
|
|
3
|
+
<path d="M0.100257 35C0.200514 34.2 0.701799 33.3 1.10283 32.5C2.8072 28.7 5.81491 26.1 9.72493 24.3C13.9357 22.5 18.347 21.9 22.8586 22.5C26.3676 22.9 29.5758 24 32.383 25.9C35.892 28.2 38.0977 31 38.8997 35C38.8997 35.1 38.8997 35.3 39 35.5C39 35.8 39 36.2 39 36.5C38.6992 37.8 37.6967 38.7 36.2931 39C37.0951 39 31.0797 39 27.2699 39C18.4473 39 2.00514 39 2.8072 39C2.20566 38.8 1.30334 38.5 0.902314 38C0.601542 37.7 0.401028 37.4 0.200514 36.9C-0.100257 36.4 0 35.6 0.100257 35Z" fill="#2680EB"/>
|
|
4
|
+
<path d="M20.6526 0.1C21.0537 0.1 21.7555 0.3 22.1565 0.4C26.0665 1.6 28.3724 4.1 28.8737 7.9C29.375 11.7 27.9714 15 24.9637 17.5C21.5549 20.3 17.0434 20.1 13.6346 17.2C11.5292 15.4 10.4264 13.1 10.0254 10.5C9.82486 8.2 10.2259 6 11.5292 4.1C13.0331 1.9 15.1385 0.6 17.8454 0.2C19.3493 -0.1 20.3519 0 20.6526 0.1Z" fill="#2680EB"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0_2082_21">
|
|
8
|
+
<rect width="39" height="39" fill="white"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -281,18 +281,13 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
281
281
|
attachedRef.current.appendChild(el);
|
|
282
282
|
});
|
|
283
283
|
};
|
|
284
|
-
|
|
285
|
-
// const afterChangeFile = (length = 0) => {
|
|
286
|
-
// setIsEmpty(!length);
|
|
287
|
-
// };
|
|
288
|
-
|
|
289
284
|
const onChangeFiles = async e => {
|
|
290
|
-
var _e$target, _e$target$files
|
|
285
|
+
var _e$target, _e$target$files, _Array$from$;
|
|
291
286
|
if (!isEnable) return;
|
|
292
287
|
e.persist();
|
|
293
|
-
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && (_e$target$files = _e$target.files) !== null && _e$target$files !== void 0 && _e$target$files.length) {
|
|
294
|
-
var _ref;
|
|
295
|
-
let files = e.target.files;
|
|
288
|
+
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && (_e$target$files = _e$target.files) !== null && _e$target$files !== void 0 && _e$target$files.length || (_Array$from$ = Array.from(document.getElementsByClassName('DGN-UI-Attachment-Input'))[0]) !== null && _Array$from$ !== void 0 && _Array$from$.files.length) {
|
|
289
|
+
var _Array$from$2, _ref;
|
|
290
|
+
let files = e.target.files || ((_Array$from$2 = Array.from(document.getElementsByClassName('DGN-UI-Attachment-Input'))[0]) === null || _Array$from$2 === void 0 ? void 0 : _Array$from$2.files);
|
|
296
291
|
// const lengthAttached = attached.length;
|
|
297
292
|
const lengthAttached = (_ref = [...dataState, ...newDataState]) === null || _ref === void 0 ? void 0 : _ref.length;
|
|
298
293
|
for (let i = 0; i < files.length; i++) {
|
|
@@ -433,7 +428,10 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
433
428
|
nodeList.forEach(itemEl => {
|
|
434
429
|
const index = Array.from(attachedRef.current.children).indexOf(itemEl.parentNode);
|
|
435
430
|
const deletedFile = attachedItems[index];
|
|
436
|
-
|
|
431
|
+
if (deletedFile.hasOwnProperty('AttachmentID')) {
|
|
432
|
+
// if attachment has ID (CDN uploaded) push it to removedAttachmentRef
|
|
433
|
+
removedAttachedRef.current.push(deletedFile);
|
|
434
|
+
}
|
|
437
435
|
recentRemovedAttached.push(deletedFile);
|
|
438
436
|
if (Object.prototype.toString.call(deletedFile) === '[object File]' && tempNewDataState !== null && tempNewDataState !== void 0 && tempNewDataState.length) {
|
|
439
437
|
removeFileOutInputFiles(tempNewDataState.findIndex(attach => (attach === null || attach === void 0 ? void 0 : attach.FileName) === (deletedFile === null || deletedFile === void 0 ? void 0 : deletedFile.FileName) && (attach === null || attach === void 0 ? void 0 : attach.CreateDate) === (deletedFile === null || deletedFile === void 0 ? void 0 : deletedFile.CreateDate)));
|
|
@@ -446,9 +444,6 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
446
444
|
}
|
|
447
445
|
});
|
|
448
446
|
const tempAttachedItems = [...tempDataState, ...tempNewDataState];
|
|
449
|
-
// if (tempAttachedItems.length < 2) {
|
|
450
|
-
// afterChangeFile(tempAttachedItems?.length || 0);
|
|
451
|
-
// }
|
|
452
447
|
stripDomain();
|
|
453
448
|
if (onChange) onChange({
|
|
454
449
|
element: nodeList,
|
|
@@ -514,7 +509,6 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
514
509
|
setNewDataState(files[0] ? [files[0]] : []);
|
|
515
510
|
});
|
|
516
511
|
}
|
|
517
|
-
// attachmentInputRef.current.files = allNewAttached.getAll('files');
|
|
518
512
|
};
|
|
519
513
|
const checkExistingFile = newFile => {
|
|
520
514
|
const files = [...dataState, ...newDataState];
|
|
@@ -534,7 +528,6 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
534
528
|
const ctrlKey = e.ctrlKey;
|
|
535
529
|
const shiftKey = e.shiftKey;
|
|
536
530
|
const itemEl = e.currentTarget.firstChild;
|
|
537
|
-
// timer.current = setTimeout(() => {
|
|
538
531
|
if (!prevent.current) {
|
|
539
532
|
if (shiftKey && !ctrlKey) {
|
|
540
533
|
let startIndex = chosenItems[chosenItems.length - 1] || 0;
|
|
@@ -586,7 +579,6 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
586
579
|
checkChosenMultiple();
|
|
587
580
|
}
|
|
588
581
|
prevent.current = false;
|
|
589
|
-
// }, 100);
|
|
590
582
|
};
|
|
591
583
|
const removeActiveChosenItem = () => {
|
|
592
584
|
attachedRef.current.querySelectorAll('.chosen').forEach(itemEl => {
|
|
@@ -777,7 +769,6 @@ const Attachment = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference
|
|
|
777
769
|
}, [accept]);
|
|
778
770
|
useEffect(() => {
|
|
779
771
|
oldAttached.length = 0;
|
|
780
|
-
// afterChangeFile((data?.length || 0) + (newDataState?.length || 0));
|
|
781
772
|
if (data !== null && data !== void 0 && data.length && !(dataState !== null && dataState !== void 0 && dataState.length) && !(newDataState !== null && newDataState !== void 0 && newDataState.length)) {
|
|
782
773
|
// Load files data was uploaded
|
|
783
774
|
const length = data.length;
|
|
@@ -1442,20 +1433,6 @@ const ItemPictureInfoCSS = ({
|
|
|
1442
1433
|
${bgColor(getProp(colors, 'fill/tooltip'))};
|
|
1443
1434
|
${parseWidth('100%')};
|
|
1444
1435
|
`;
|
|
1445
|
-
|
|
1446
|
-
// Attachment.defaultProps = {
|
|
1447
|
-
// allowDelete: true,
|
|
1448
|
-
// allowSort: true,
|
|
1449
|
-
// className: '',
|
|
1450
|
-
// data: [],
|
|
1451
|
-
// disabled: false,
|
|
1452
|
-
// height: 280,
|
|
1453
|
-
// maxFile: Infinity,
|
|
1454
|
-
// multiple: true,
|
|
1455
|
-
// style: {},
|
|
1456
|
-
// viewType: 'detail',
|
|
1457
|
-
// };
|
|
1458
|
-
|
|
1459
1436
|
Attachment.propTypes = {
|
|
1460
1437
|
/** File types that can be accepted. */
|
|
1461
1438
|
accept: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
@@ -249,7 +249,7 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
249
249
|
|
|
250
250
|
// disabled negative
|
|
251
251
|
// const disabled180 = (keyCode === 189 || keyCode === 109) && (disabledNegative || value.includes('-'));
|
|
252
|
-
const disabled180 = (keyCode === 189 || keyCode === 109) && (min === 0 ||
|
|
252
|
+
const disabled180 = (keyCode === 189 || keyCode === 109) && (min === 0 || disabledNegative);
|
|
253
253
|
|
|
254
254
|
// disabled max digit
|
|
255
255
|
const isMaxDigit = maxDigit && (value === null || value === void 0 ? void 0 : value.replace(regexNumber, '').length) === maxDigit && (isNumber || key === thousandSymbol || key === decimalSymbol) && selectionStart === selectionEnd;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -41,6 +41,11 @@ npm test
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Changelog
|
|
44
|
+
## 1.4.47
|
|
45
|
+
- \[Added\]: Icon – Add IconMenu MHRP09N2000
|
|
46
|
+
- \[Fixed\]: Attachment - Attachment error on older mobile devices
|
|
47
|
+
- \[Changed\]: NumberInput – Fix NumberInput when the error still allows entering symbols
|
|
48
|
+
|
|
44
49
|
## 1.4.46
|
|
45
50
|
- \[Added\]: Icon – Add Icon Sql
|
|
46
51
|
- \[Added\]: Icon – Add IconMenu MHRM29N0006
|