diginet-core-ui 1.3.79-beta.1 → 1.3.79-beta.3
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/components/accordion/css.js +2 -2
- package/components/accordion/details.js +3 -3
- package/components/accordion/group.js +3 -3
- package/components/accordion/index.js +5 -5
- package/components/accordion/summary.js +4 -4
- package/components/alert/index.js +8 -8
- package/components/alert/notify.js +4 -4
- package/components/avatar/index.js +11 -12
- package/components/badge/index.js +5 -5
- package/components/button/icon.js +14 -11
- package/components/button/index.js +10 -10
- package/components/button/more.js +5 -5
- package/components/button/ripple-effect.js +2 -2
- package/components/card/body.js +2 -2
- package/components/card/extra.js +2 -2
- package/components/card/footer.js +2 -2
- package/components/card/header.js +3 -3
- package/components/card/index.js +8 -8
- package/components/chart/Pie/index.js +4 -4
- package/components/chart/Pie-v2/Sectors.js +3 -3
- package/components/chart/Pie-v2/index.js +6 -6
- package/components/chart/bar/Bar.js +2 -2
- package/components/chart/bar/Labels.js +2 -2
- package/components/chart/bar/index.js +6 -6
- package/components/chart/bar-v2/Bar.js +3 -3
- package/components/chart/bar-v2/Labels.js +2 -2
- package/components/chart/bar-v2/index.js +6 -6
- package/components/chart/line/Labels.js +2 -2
- package/components/chart/line/Path.js +1 -1
- package/components/chart/line/Point.js +2 -2
- package/components/chart/line/Title.js +1 -1
- package/components/chart/line/index.js +6 -6
- package/components/chart/line-v2/Labels.js +2 -2
- package/components/chart/line-v2/Point.js +2 -2
- package/components/chart/line-v2/Title.js +1 -1
- package/components/chart/line-v2/index.js +6 -6
- package/components/check-text/index.js +2 -2
- package/components/check-text/interview-confirmation.js +2 -2
- package/components/check-text/interview-status.js +2 -2
- package/components/chip/attach.js +4 -4
- package/components/chip/index.js +5 -5
- package/components/collapse/index.js +1 -1
- package/components/divider/index.js +2 -2
- package/components/form-control/attachment/index.js +132 -241
- package/components/form-control/calendar/function.js +8 -8
- package/components/form-control/calendar/index.js +2 -2
- package/components/form-control/calendar/range.js +3 -3
- package/components/form-control/checkbox/index.js +5 -5
- package/components/form-control/control/index.js +2 -2
- package/components/form-control/date-picker/index.js +10 -10
- package/components/form-control/date-range-picker/index.js +8 -8
- package/components/form-control/dropdown/index.js +7 -7
- package/components/form-control/dropdown-box/index.js +6 -6
- package/components/form-control/form/index.js +1 -1
- package/components/form-control/form-group/index.js +1 -1
- package/components/form-control/helper-text/index.js +4 -4
- package/components/form-control/input-base/index.js +7 -7
- package/components/form-control/label/index.js +7 -7
- package/components/form-control/money-input/index.js +5 -5
- package/components/form-control/number-input/index.js +3 -3
- package/components/form-control/number-input/index2.js +5 -5
- package/components/form-control/phone-input/index.js +2 -2
- package/components/form-control/radio/index.js +4 -4
- package/components/form-control/text-input/index.js +4 -4
- package/components/form-control/time-picker/index.js +7 -7
- package/components/form-control/time-picker/swiper.js +1 -1
- package/components/form-control/toggle/index.js +4 -4
- package/components/form-view/helper-text.js +1 -1
- package/components/form-view/index.js +4 -4
- package/components/form-view/input.js +3 -3
- package/components/form-view/label.js +2 -2
- package/components/grid/Col.js +2 -2
- package/components/grid/Container.js +1 -1
- package/components/grid/Row.js +1 -1
- package/components/grid/index.js +5 -5
- package/components/image/index.js +5 -5
- package/components/index.js +83 -83
- package/components/list/list-item-action.js +1 -1
- package/components/list/list-item-icon.js +2 -2
- package/components/list/list-item-text.js +1 -1
- package/components/list/list-item.js +2 -2
- package/components/list/list.js +1 -1
- package/components/list/sub-header.js +2 -2
- package/components/modal/body.js +4 -4
- package/components/modal/footer.js +3 -3
- package/components/modal/header.js +5 -5
- package/components/modal/index.js +4 -4
- package/components/modal/modal.js +6 -6
- package/components/others/extra/index.js +2 -2
- package/components/others/import/index.js +1 -1
- package/components/others/scrollbar/index.js +1 -1
- package/components/paging/page-info.js +5 -5
- package/components/paging/page-selector.js +3 -3
- package/components/paging/page-selector2.js +5 -5
- package/components/paper/index.js +2 -2
- package/components/popover/body.js +4 -4
- package/components/popover/footer.js +4 -4
- package/components/popover/header.js +5 -5
- package/components/popover/index.js +4 -4
- package/components/popup/danger_popup.js +5 -5
- package/components/popup/index.js +6 -6
- package/components/popup/proposals_popup.js +5 -5
- package/components/popup/v2/index.js +9 -9
- package/components/progress/circular.js +169 -260
- package/components/progress/linear.js +2 -2
- package/components/rating/index.js +6 -6
- package/components/slider/slider-container.js +4 -4
- package/components/slider/slider-item.js +5 -5
- package/components/status/index.js +5 -5
- package/components/tab/tab-container.js +4 -4
- package/components/tab/tab-header.js +5 -5
- package/components/tab/tab-panel.js +4 -4
- package/components/tab/tab.js +8 -8
- package/components/tooltip/index.js +3 -3
- package/components/tooltip/portal.js +1 -1
- package/components/transfer/index.js +5 -5
- package/components/tree-view/css.js +2 -2
- package/components/tree-view/index.js +4 -4
- package/components/typography/index.js +3 -3
- package/global/index.js +2 -2
- package/icons/basic.js +1 -1
- package/icons/effect.js +5 -5
- package/icons/general/index.js +21 -21
- package/icons/index.js +2 -2
- package/icons/menu/index.js +2 -2
- package/icons/menu/v2/index.js +1 -1
- package/locale/index.js +1 -1
- package/package.json +2 -1
- package/styles/animation.js +1 -1
- package/styles/colors.js +1 -1
- package/styles/font.js +3 -3
- package/styles/general.js +2 -2
- package/styles/typography.js +2 -2
- package/styles/utils.js +1 -1
- package/theme/index.js +3 -3
- package/theme/make-styles.js +1 -1
- package/theme/set-theme.js +1 -1
- package/theme/settings.js +6 -6
- package/theme/theme-provider.js +2 -2
- package/theme/theme.js +1 -1
- package/utils/array/array.js +3 -3
- package/utils/console.js +1 -1
- package/utils/date.js +2 -2
- package/utils/error/error.js +3 -3
- package/utils/error/errors.js +1 -1
- package/utils/handleBreakpoints.js +2 -2
- package/utils/index.js +28 -28
- package/utils/object/extend.js +1 -1
- package/utils/object/object.js +1 -1
- package/utils/render-portal.js +1 -1
- package/utils/renderHTML.js +1 -1
- package/utils/renderIcon.js +3 -3
- package/utils/sb-template.js +4 -4
- package/utils/string/capitalizeSentenceCase.js +1 -1
- package/utils/string/string.js +1 -1
- package/utils/useElementSize.js +1 -1
- package/utils/validate.js +2 -2
|
@@ -1,49 +1,45 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import {
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import { forwardRef, Fragment, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
5
6
|
import ReactDOM from 'react-dom';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
const theme = useTheme();
|
|
7
|
+
import { ButtonIcon, HelperText, LinearProgress, List, ListItem, ListItemText, ModalSample, Notify, Popover, Popup, ScrollBar, Slider, SliderItem, Typography } from "../../";
|
|
8
|
+
import { getGlobal } from "../../../global";
|
|
9
|
+
import { Another, Compressed, Image, Pdf, Presentation, Sheet, Word } from "../../../icons";
|
|
10
|
+
import { alignCenter, border, borderBox, borderRadius4px, borderRadius50, breakWord, cursorPointer, displayBlock, displayInlineBlock, displayNone, ellipsis, flexCol, flexRow, flexWrap, justifyBetween, justifyCenter, justifyStart, parseHeight, parseMaxWidthHeight, parseMinHeight, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative, textCenter, userSelectNone } from "../../../styles/general";
|
|
11
|
+
import { makeStyles, useTheme } from "../../../theme";
|
|
12
|
+
import { classNames, date as moment, getFileType } from "../../../utils";
|
|
13
|
+
import Label from "../label";
|
|
14
14
|
const {
|
|
15
15
|
colors: {
|
|
16
16
|
system: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dark
|
|
17
|
+
rest: systemRest,
|
|
18
|
+
white: systemWhite,
|
|
19
|
+
dark: systemDark
|
|
21
20
|
},
|
|
22
21
|
semantic: {
|
|
23
|
-
success
|
|
24
|
-
danger
|
|
22
|
+
success: semanticSuccess
|
|
25
23
|
},
|
|
26
24
|
fill: {
|
|
27
25
|
hover: fillHover,
|
|
28
|
-
pressed,
|
|
29
|
-
focus
|
|
26
|
+
pressed: fillPressed,
|
|
27
|
+
focus: fillFocus
|
|
30
28
|
},
|
|
31
29
|
line: {
|
|
32
|
-
normal
|
|
33
|
-
hover: lineHover
|
|
30
|
+
normal: lineNormal
|
|
34
31
|
},
|
|
35
32
|
text: {
|
|
36
|
-
sub
|
|
33
|
+
sub: textSub
|
|
37
34
|
}
|
|
38
35
|
},
|
|
39
36
|
typography: {
|
|
40
|
-
heading5,
|
|
41
37
|
paragraph1,
|
|
42
38
|
paragraph2,
|
|
43
39
|
paragraph3
|
|
44
40
|
},
|
|
45
41
|
spacing
|
|
46
|
-
} =
|
|
42
|
+
} = useTheme();
|
|
47
43
|
const useStyles = makeStyles({
|
|
48
44
|
listItem: {
|
|
49
45
|
'&.DGN-UI-List-Item': {
|
|
@@ -195,16 +191,10 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
195
191
|
}, reference) => {
|
|
196
192
|
const classes = useStyles();
|
|
197
193
|
const ref = useRef(null);
|
|
198
|
-
const [open, setOpen] = useState(false);
|
|
199
|
-
const [popup, setPopup] = useState(false);
|
|
200
|
-
const [popover, setPopover] = useState(false);
|
|
201
|
-
const [viewTypeState, setViewTypeState] = useState(viewType);
|
|
202
194
|
const attachTextRef = useRef(null);
|
|
203
195
|
const attachmentHandleIconRef = useRef(null);
|
|
204
196
|
const sortIconRef = useRef(null);
|
|
205
|
-
const attachmentImageIconRef = useRef(null);
|
|
206
197
|
const attachmentInputRef = useRef(null);
|
|
207
|
-
const attachmentImageRef = useRef(null);
|
|
208
198
|
const attachedRef = useRef(null);
|
|
209
199
|
const newAttachedRef = useRef([]);
|
|
210
200
|
const popupRef = useRef(null);
|
|
@@ -212,6 +202,11 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
212
202
|
const isDeleteAll = useRef(false);
|
|
213
203
|
const PushNotify = useRef(null);
|
|
214
204
|
const removedAttachedRef = useRef([]);
|
|
205
|
+
const [open, setOpen] = useState(false);
|
|
206
|
+
const [popup, setPopup] = useState(false);
|
|
207
|
+
const [popover, setPopover] = useState(false);
|
|
208
|
+
const [viewTypeState, setViewTypeState] = useState(viewType);
|
|
209
|
+
const [isEmpty, setIsEmpty] = useState(null);
|
|
215
210
|
|
|
216
211
|
// Start handler
|
|
217
212
|
const onShowSortPopover = () => {
|
|
@@ -279,21 +274,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
279
274
|
setPopover(false);
|
|
280
275
|
};
|
|
281
276
|
const afterChangeFile = (length = 0) => {
|
|
282
|
-
|
|
283
|
-
if (!length) {
|
|
284
|
-
if (!attachmentImageRef.current.classList.contains('hint-center')) {
|
|
285
|
-
attachmentImageRef.current.classList.add('hint-center');
|
|
286
|
-
}
|
|
287
|
-
} else {
|
|
288
|
-
attachmentImageRef.current.classList.remove('hint-center');
|
|
289
|
-
}
|
|
290
|
-
if ((_sortIconRef$current = sortIconRef.current) !== null && _sortIconRef$current !== void 0 && _sortIconRef$current.element) {
|
|
291
|
-
if (length > 1) {
|
|
292
|
-
sortIconRef.current.element.style.display = null;
|
|
293
|
-
} else {
|
|
294
|
-
sortIconRef.current.element.style.display = 'none';
|
|
295
|
-
}
|
|
296
|
-
}
|
|
277
|
+
setIsEmpty(!length);
|
|
297
278
|
};
|
|
298
279
|
const onChangeFiles = async e => {
|
|
299
280
|
if (readOnly || disabled) return;
|
|
@@ -646,16 +627,21 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
646
627
|
}
|
|
647
628
|
return false;
|
|
648
629
|
};
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
}
|
|
630
|
+
|
|
631
|
+
// const checkExistingFileInData = newFile => {
|
|
632
|
+
// const files = data;
|
|
633
|
+
|
|
634
|
+
// if (files && files.length) {
|
|
635
|
+
// const length = files.length;
|
|
636
|
+
|
|
637
|
+
// for (let i = 0; i < length; i++) {
|
|
638
|
+
// if (parseStringify2(newFile) === parseStringify2(files[i], true)) return true;
|
|
639
|
+
// }
|
|
640
|
+
// }
|
|
641
|
+
|
|
642
|
+
// return false;
|
|
643
|
+
// };
|
|
644
|
+
|
|
659
645
|
const checkAcceptFileType = newFile => {
|
|
660
646
|
if (!accept || !accept.length) return true;
|
|
661
647
|
const type = typeof accept === 'string' ? accept : accept.join('-');
|
|
@@ -859,10 +845,13 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
859
845
|
type: fileInfo.type,
|
|
860
846
|
webkitRelativePath: fileInfo.webkitRelativePath
|
|
861
847
|
});
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
848
|
+
|
|
849
|
+
// const parseStringify2 = (fileInfo, inData) =>
|
|
850
|
+
// JSON.stringify({
|
|
851
|
+
// name: fileInfo?.[inData ? 'FileName' : 'name'],
|
|
852
|
+
// size: fileInfo?.[inData ? 'FileSize' : 'size'],
|
|
853
|
+
// });
|
|
854
|
+
|
|
866
855
|
const mountDomain = item => {
|
|
867
856
|
if (!item) return item;
|
|
868
857
|
const cloneItem = JSON.parse(JSON.stringify(item));
|
|
@@ -897,26 +886,6 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
897
886
|
existClickOutOfItem = false;
|
|
898
887
|
};
|
|
899
888
|
}, []);
|
|
900
|
-
useEffect(() => {
|
|
901
|
-
let el = null;
|
|
902
|
-
if (error) {
|
|
903
|
-
attachTextRef.current.style.color = danger;
|
|
904
|
-
ref.current.style.borderColor = danger;
|
|
905
|
-
el = document.createElement('p');
|
|
906
|
-
el.classList.add('attachment-error');
|
|
907
|
-
el.innerHTML = error;
|
|
908
|
-
attachTextRef.current.parentNode.insertAdjacentElement('afterend', el);
|
|
909
|
-
}
|
|
910
|
-
return () => {
|
|
911
|
-
if (attachTextRef.current && ref.current) {
|
|
912
|
-
attachTextRef.current.style.color = null;
|
|
913
|
-
ref.current.style.borderColor = null;
|
|
914
|
-
}
|
|
915
|
-
if (el) {
|
|
916
|
-
el.remove();
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
}, [error]);
|
|
920
889
|
useEffect(() => {
|
|
921
890
|
setViewTypeState(viewType);
|
|
922
891
|
}, [viewType]);
|
|
@@ -983,36 +952,38 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
983
952
|
// Load files data was uploaded
|
|
984
953
|
const length = data.length;
|
|
985
954
|
for (let i = 0; i < length; i++) {
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
955
|
+
const newAttach = getItemHTMLFromData(data[i], i);
|
|
956
|
+
if (Object.prototype.toString.call(data[i]) === '[object File]') {
|
|
957
|
+
allNewAttached.append('files', data[i]);
|
|
958
|
+
newAttachedRef.current.push(data[i]);
|
|
959
|
+
attached.push(data[i]);
|
|
991
960
|
} else {
|
|
961
|
+
const item = mountDomain(data[i]);
|
|
992
962
|
oldAttached.push(item);
|
|
963
|
+
attached.push(item);
|
|
993
964
|
}
|
|
994
|
-
attached.push(item);
|
|
995
965
|
const newElement = document.createElement('div');
|
|
996
966
|
newElement.className = 'attachment-row';
|
|
997
967
|
ReactDOM.render(newAttach, attachedRef.current.appendChild(newElement));
|
|
998
968
|
}
|
|
999
969
|
}
|
|
1000
|
-
if (newAttachedRef.current) {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
}
|
|
970
|
+
// if (newAttachedRef.current) {
|
|
971
|
+
// const length = newAttachedRef.current.length;
|
|
972
|
+
|
|
973
|
+
// for (let i = length - 1; i >= 0; i--) {
|
|
974
|
+
// const item = newAttachedRef.current[i];
|
|
975
|
+
// if (checkExistingFileInData(item)) {
|
|
976
|
+
// newAttachedRef.current.splice(i, 1);
|
|
977
|
+
// } else {
|
|
978
|
+
// const newAttach = getItemHTMLFromData(item, i);
|
|
979
|
+
// allNewAttached.append('files', item);
|
|
980
|
+
// attached.push(item);
|
|
981
|
+
// const newElement = document.createElement('div');
|
|
982
|
+
// newElement.className = 'attachment-row';
|
|
983
|
+
// ReactDOM.render(newAttach, attachedRef.current.appendChild(newElement));
|
|
984
|
+
// }
|
|
985
|
+
// }
|
|
986
|
+
// }
|
|
1016
987
|
return () => {
|
|
1017
988
|
if (attachedRef.current) {
|
|
1018
989
|
attachedRef.current.innerHTML = null;
|
|
@@ -1065,66 +1036,61 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1065
1036
|
className: 'DGN-UI-Attachment-Header'
|
|
1066
1037
|
}, jsx("div", {
|
|
1067
1038
|
css: AttachmentInfoCSS
|
|
1068
|
-
}, jsx(
|
|
1069
|
-
|
|
1039
|
+
}, jsx(Label, {
|
|
1040
|
+
uppercase: true,
|
|
1041
|
+
required: required,
|
|
1042
|
+
disabled: disabled,
|
|
1043
|
+
type: 'h5',
|
|
1044
|
+
color: textSub,
|
|
1070
1045
|
ref: attachTextRef
|
|
1071
|
-
}, label,
|
|
1072
|
-
style: {
|
|
1073
|
-
color: danger
|
|
1074
|
-
}
|
|
1075
|
-
}, " *"))), jsx("div", {
|
|
1046
|
+
}, label), error ? jsx(HelperText, null, error) : null), jsx("div", {
|
|
1076
1047
|
css: AttachmentHeaderIconCSS
|
|
1077
1048
|
}, jsx("div", {
|
|
1078
1049
|
css: AttachmentHandleIconCSS,
|
|
1079
1050
|
ref: attachmentHandleIconRef
|
|
1080
|
-
}, jsx(
|
|
1051
|
+
}, jsx(ButtonIcon, {
|
|
1052
|
+
viewType: 'ghost',
|
|
1081
1053
|
className: 'view',
|
|
1054
|
+
name: 'view',
|
|
1082
1055
|
onClick: () => onGetViewItem()
|
|
1083
|
-
}, jsx(
|
|
1084
|
-
|
|
1085
|
-
viewBox: true
|
|
1086
|
-
})), jsx("span", {
|
|
1056
|
+
}), jsx(ButtonIcon, {
|
|
1057
|
+
viewType: 'ghost',
|
|
1087
1058
|
className: 'download',
|
|
1059
|
+
name: 'download',
|
|
1088
1060
|
onClick: onDownloadMultiple
|
|
1089
|
-
}, jsx(
|
|
1090
|
-
|
|
1091
|
-
viewBox: true
|
|
1092
|
-
})), !readOnly && jsx("span", {
|
|
1061
|
+
}), !readOnly && jsx(ButtonIcon, {
|
|
1062
|
+
viewType: 'ghost',
|
|
1093
1063
|
className: 'delete',
|
|
1064
|
+
name: 'delete',
|
|
1094
1065
|
onClick: onShowPopup
|
|
1095
|
-
}, jsx(
|
|
1096
|
-
|
|
1097
|
-
viewBox: true
|
|
1098
|
-
}))), jsx("div", {
|
|
1099
|
-
css: AttachmentImageCSS,
|
|
1100
|
-
ref: attachmentImageRef
|
|
1066
|
+
})), jsx("div", {
|
|
1067
|
+
css: isEmpty ? AttachmentImageEmptyCSS : AttachmentImageCSS
|
|
1101
1068
|
}, !(readOnly || disabled) && jsx("div", {
|
|
1102
1069
|
css: AttachmentImageCenterCSS
|
|
1103
|
-
}, jsx(
|
|
1104
|
-
css:
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1070
|
+
}, jsx(ButtonIcon, {
|
|
1071
|
+
css: isEmpty && ButtonAttachmentCSS,
|
|
1072
|
+
circular: isEmpty,
|
|
1073
|
+
viewType: isEmpty ? 'text' : 'ghost',
|
|
1074
|
+
name: 'Attachment',
|
|
1075
|
+
size: isEmpty ? 'extraGiant' : 'medium',
|
|
1108
1076
|
onClick: triggerClickInput
|
|
1109
|
-
}, jsx(
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}, hintText)))), allowSort && jsx(ButtonIcon, {
|
|
1077
|
+
}), isEmpty ? jsx(Typography, {
|
|
1078
|
+
css: userSelectNone,
|
|
1079
|
+
type: 'p3',
|
|
1080
|
+
color: systemRest
|
|
1081
|
+
}, hintText) : null)), allowSort && !isEmpty ? jsx(ButtonIcon, {
|
|
1115
1082
|
viewType: 'ghost',
|
|
1116
1083
|
name: 'Sort',
|
|
1117
1084
|
ref: sortIconRef,
|
|
1118
1085
|
style: {
|
|
1119
|
-
marginRight: 8
|
|
1120
|
-
display: 'none'
|
|
1086
|
+
marginRight: 8
|
|
1121
1087
|
},
|
|
1122
1088
|
onClick: onShowSortPopover
|
|
1123
|
-
}), jsx(ButtonIcon, {
|
|
1089
|
+
}) : null, jsx(ButtonIcon, {
|
|
1124
1090
|
viewType: 'ghost',
|
|
1125
1091
|
name: viewTypeState === 'detail' ? 'IconView' : 'ListView',
|
|
1126
1092
|
onClick: () => setViewTypeState(viewTypeState === 'icon' ? 'detail' : 'icon')
|
|
1127
|
-
}))), [allowSort, disabled, readOnly, label, required, hintText, viewTypeState]);
|
|
1093
|
+
}))), [error, allowSort, disabled, readOnly, label, required, hintText, domain, viewTypeState, isEmpty]);
|
|
1128
1094
|
const AttachmentInputView = useMemo(() => jsx("div", {
|
|
1129
1095
|
css: AttachmentInputCSS,
|
|
1130
1096
|
className: 'DGN-UI-Attachment-Input'
|
|
@@ -1254,26 +1220,13 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1254
1220
|
color: 'danger'
|
|
1255
1221
|
}));
|
|
1256
1222
|
}));
|
|
1257
|
-
const ViewAttachTypeCSS = css`
|
|
1258
|
-
${cursorPointer};
|
|
1259
|
-
${parseHeight(24)};
|
|
1260
|
-
color: ${rest};
|
|
1261
|
-
&:hover {
|
|
1262
|
-
color: ${active};
|
|
1263
|
-
}
|
|
1264
|
-
`;
|
|
1265
1223
|
const AttachmentHandleIconCSS = css`
|
|
1266
1224
|
${displayNone};
|
|
1267
1225
|
${parseHeight(24)};
|
|
1268
|
-
margin-right: ${spacing([2
|
|
1269
|
-
border-right: 1px solid ${
|
|
1270
|
-
|
|
1271
|
-
${
|
|
1272
|
-
margin-right: ${spacing([2.5])};
|
|
1273
|
-
color: ${rest};
|
|
1274
|
-
&:hover {
|
|
1275
|
-
color: ${active};
|
|
1276
|
-
}
|
|
1226
|
+
margin-right: ${spacing([2])};
|
|
1227
|
+
border-right: 1px solid ${lineNormal};
|
|
1228
|
+
button {
|
|
1229
|
+
margin-right: ${spacing([2])};
|
|
1277
1230
|
}
|
|
1278
1231
|
`;
|
|
1279
1232
|
const AttachmentHeaderCSS = css`
|
|
@@ -1281,26 +1234,11 @@ const AttachmentHeaderCSS = css`
|
|
|
1281
1234
|
${alignCenter};
|
|
1282
1235
|
${justifyBetween};
|
|
1283
1236
|
${borderBox};
|
|
1284
|
-
${parseHeight(48)};
|
|
1285
1237
|
padding: ${spacing([4, 4])};
|
|
1286
|
-
.css-${AttachmentHandleIconCSS.name}, .css-${ViewAttachTypeCSS.name} {
|
|
1287
|
-
z-index: 1;
|
|
1288
|
-
}
|
|
1289
1238
|
`;
|
|
1290
1239
|
const AttachmentInfoCSS = css`
|
|
1291
1240
|
${flexRow};
|
|
1292
|
-
${
|
|
1293
|
-
${alignCenter};
|
|
1294
|
-
margin: 0;
|
|
1295
|
-
& + p.attachment-error {
|
|
1296
|
-
color: ${danger};
|
|
1297
|
-
}
|
|
1298
|
-
`;
|
|
1299
|
-
const AttachmentTextCSS = css`
|
|
1300
|
-
${userSelectNone};
|
|
1301
|
-
${textUppercase};
|
|
1302
|
-
${heading5};
|
|
1303
|
-
color: ${sub};
|
|
1241
|
+
gap: ${spacing([2])};
|
|
1304
1242
|
`;
|
|
1305
1243
|
const AttachmentHeaderIconCSS = css`
|
|
1306
1244
|
${flexRow};
|
|
@@ -1322,64 +1260,23 @@ const AttachmentInputCSS = css`
|
|
|
1322
1260
|
}
|
|
1323
1261
|
`;
|
|
1324
1262
|
const AttachmentImageCenterCSS = css`
|
|
1325
|
-
${
|
|
1263
|
+
${flexCol};
|
|
1326
1264
|
${justifyCenter};
|
|
1327
1265
|
${alignCenter};
|
|
1328
1266
|
${parseWidthHeight('100%', '100%')};
|
|
1329
1267
|
`;
|
|
1330
|
-
const
|
|
1331
|
-
${
|
|
1332
|
-
|
|
1333
|
-
`;
|
|
1334
|
-
const AttachmentImageIconCSS = css`
|
|
1335
|
-
${parseWidthHeight(24, 24)};
|
|
1336
|
-
margin-bottom: 0;
|
|
1337
|
-
z-index: 3;
|
|
1338
|
-
svg {
|
|
1339
|
-
color: ${rest};
|
|
1340
|
-
}
|
|
1341
|
-
&:hover {
|
|
1342
|
-
border-color: ${lineHover};
|
|
1343
|
-
svg {
|
|
1344
|
-
color: ${active};
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
`;
|
|
1348
|
-
const AttachmentImageTextCSS = css`
|
|
1349
|
-
${displayNone};
|
|
1350
|
-
${userSelectNone};
|
|
1351
|
-
${paragraph3};
|
|
1352
|
-
color: ${rest};
|
|
1268
|
+
const ButtonAttachmentCSS = css`
|
|
1269
|
+
border: 1px dashed ${lineNormal} !important;
|
|
1270
|
+
margin: ${spacing([0, 'auto', 4])};
|
|
1353
1271
|
`;
|
|
1354
1272
|
const AttachmentImageCSS = css`
|
|
1355
|
-
margin-right:
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
z-index: 1;
|
|
1363
|
-
.css-${AttachmentImageTextCSS.name} {
|
|
1364
|
-
${displayBlock};
|
|
1365
|
-
}
|
|
1366
|
-
.css-${AttachmentImageIconCSS.name} {
|
|
1367
|
-
${flexRow};
|
|
1368
|
-
${justifyCenter};
|
|
1369
|
-
${alignCenter};
|
|
1370
|
-
${parseWidthHeight(64, 64)};
|
|
1371
|
-
margin: 0 auto 8px auto;
|
|
1372
|
-
border: 1px dashed ${normal};
|
|
1373
|
-
border-radius: 50%;
|
|
1374
|
-
svg {
|
|
1375
|
-
${parseWidthHeight(40, 40)};
|
|
1376
|
-
}
|
|
1377
|
-
&:hover {
|
|
1378
|
-
border-color: ${lineHover};
|
|
1379
|
-
background-color: ${fillHover};
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1273
|
+
margin-right: ${spacing([2])};
|
|
1274
|
+
`;
|
|
1275
|
+
const AttachmentImageEmptyCSS = css`
|
|
1276
|
+
${positionAbsolute};
|
|
1277
|
+
${parseWidthHeight('100%', '100%')};
|
|
1278
|
+
top: 0;
|
|
1279
|
+
left: 0;
|
|
1383
1280
|
`;
|
|
1384
1281
|
const AttachedItemInfoCSS = css`
|
|
1385
1282
|
${flexRow};
|
|
@@ -1393,25 +1290,24 @@ const AttachedItemInfoIconCSS = css`
|
|
|
1393
1290
|
${flexRow};
|
|
1394
1291
|
${positionRelative};
|
|
1395
1292
|
${cursorPointer};
|
|
1396
|
-
|
|
1397
|
-
max-width: 14px;
|
|
1293
|
+
${parseMaxWidthHeight(14, 16)};
|
|
1398
1294
|
padding: ${spacing([1, 1.25])};
|
|
1399
1295
|
box-sizing: content-box;
|
|
1400
1296
|
&.new-file:after {
|
|
1401
1297
|
content: '';
|
|
1402
1298
|
${positionAbsolute};
|
|
1299
|
+
${borderRadius50};
|
|
1403
1300
|
${parseWidthHeight(4, 4)}
|
|
1404
1301
|
top: 4.5px;
|
|
1405
1302
|
left: -2px;
|
|
1406
|
-
|
|
1407
|
-
background: ${success};
|
|
1303
|
+
background: ${semanticSuccess};
|
|
1408
1304
|
}
|
|
1409
1305
|
`;
|
|
1410
1306
|
const AttachedItemInfoNameCSS = css`
|
|
1411
1307
|
${paragraph1};
|
|
1412
1308
|
${cursorPointer};
|
|
1413
1309
|
${ellipsis};
|
|
1414
|
-
color: ${
|
|
1310
|
+
color: ${systemDark};
|
|
1415
1311
|
margin-left: ${spacing([3])};
|
|
1416
1312
|
padding-top: ${spacing([0.25])};
|
|
1417
1313
|
box-sizing: content-box;
|
|
@@ -1424,7 +1320,7 @@ const AttachedItemOwnerCSS = css`
|
|
|
1424
1320
|
${cursorPointer};
|
|
1425
1321
|
${userSelectNone};
|
|
1426
1322
|
height: 100%;
|
|
1427
|
-
color: ${
|
|
1323
|
+
color: ${textSub};
|
|
1428
1324
|
.detail-info {
|
|
1429
1325
|
${flexRow};
|
|
1430
1326
|
min-width: 333px;
|
|
@@ -1452,7 +1348,7 @@ const AttachedLinearCSS = css`
|
|
|
1452
1348
|
${alignCenter};
|
|
1453
1349
|
${parseWidthHeight('100%', '100%')};
|
|
1454
1350
|
top: 0;
|
|
1455
|
-
background: ${
|
|
1351
|
+
background: ${systemWhite};
|
|
1456
1352
|
`;
|
|
1457
1353
|
const AttachedItemCSS = css`
|
|
1458
1354
|
${flexRow};
|
|
@@ -1562,15 +1458,10 @@ const AttachmentRootCSS = css`
|
|
|
1562
1458
|
${justifyStart};
|
|
1563
1459
|
${positionRelative};
|
|
1564
1460
|
${borderRadius4px};
|
|
1565
|
-
${
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
background-color: ${
|
|
1569
|
-
&:hover:not(.disabled) {
|
|
1570
|
-
.css-${AttachmentImageIconCSS.name} {
|
|
1571
|
-
${cursorPointer};
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1461
|
+
${borderBox};
|
|
1462
|
+
${border(1, lineNormal)};
|
|
1463
|
+
${parseMinHeight(280)};
|
|
1464
|
+
background-color: ${systemWhite};
|
|
1574
1465
|
.css-${AttachedCSS.name} {
|
|
1575
1466
|
&:not(.disabled) {
|
|
1576
1467
|
.css-${AttachedItemCSS.name} {
|
|
@@ -1581,15 +1472,15 @@ const AttachmentRootCSS = css`
|
|
|
1581
1472
|
}
|
|
1582
1473
|
}
|
|
1583
1474
|
&:active {
|
|
1584
|
-
background-color: ${
|
|
1475
|
+
background-color: ${fillPressed};
|
|
1585
1476
|
.css-${AttachedLinearCSS.name} {
|
|
1586
|
-
background-color: ${
|
|
1477
|
+
background-color: ${fillPressed};
|
|
1587
1478
|
}
|
|
1588
1479
|
}
|
|
1589
1480
|
&.chosen {
|
|
1590
|
-
background-color: ${
|
|
1481
|
+
background-color: ${fillFocus};
|
|
1591
1482
|
.css-${AttachedItemInfoCSS.name}, .css-${AttachedItemOwnerCSS.name} {
|
|
1592
|
-
background-color: ${
|
|
1483
|
+
background-color: ${fillFocus};
|
|
1593
1484
|
}
|
|
1594
1485
|
}
|
|
1595
1486
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
import { css, jsx } from '@emotion/core';
|
|
5
5
|
import { render } from 'react-dom';
|
|
6
|
-
import { Button, ButtonIcon, Typography } from
|
|
7
|
-
import { getGlobal } from
|
|
8
|
-
import locale from
|
|
9
|
-
import theme from
|
|
10
|
-
import { date as moment } from
|
|
11
|
-
import { color as colors } from
|
|
12
|
-
import { typography } from
|
|
13
|
-
import { alignCenter, border, borderBox, borderRadius4px, cursorPointer, flexCol, flexRow, inlineFlex, justifyBetween, pointerEventsNone, positionAbsolute, positionRelative, textCenter, userSelectNone } from
|
|
6
|
+
import { Button, ButtonIcon, Typography } from "../..";
|
|
7
|
+
import { getGlobal } from "../../../global";
|
|
8
|
+
import locale from "../../../locale";
|
|
9
|
+
import theme from "../../../theme/settings";
|
|
10
|
+
import { date as moment } from "../../../utils";
|
|
11
|
+
import { color as colors } from "../../../styles/colors";
|
|
12
|
+
import { typography } from "../../../styles/typography";
|
|
13
|
+
import { alignCenter, border, borderBox, borderRadius4px, cursorPointer, flexCol, flexRow, inlineFlex, justifyBetween, pointerEventsNone, positionAbsolute, positionRelative, textCenter, userSelectNone } from "../../../styles/general";
|
|
14
14
|
const {
|
|
15
15
|
heading6
|
|
16
16
|
} = typography;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { jsx } from '@emotion/core';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
7
|
-
import { date as moment } from
|
|
8
|
-
import { isAfterLimit, isBeforeLimit, onUpdateCalendar, renderHeader, renderNavigator, isValidDate, generateCalendarCSS } from
|
|
7
|
+
import { date as moment } from "../../../utils";
|
|
8
|
+
import { isAfterLimit, isBeforeLimit, onUpdateCalendar, renderHeader, renderNavigator, isValidDate, generateCalendarCSS } from "./function";
|
|
9
9
|
const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
10
|
actions,
|
|
11
11
|
className,
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { css, jsx } from '@emotion/core';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
7
|
-
import { Divider } from
|
|
8
|
-
import theme from
|
|
9
|
-
import { generateCalendarCSS, isValidDate, onUpdateCalendar, renderHeader, renderNavigator } from
|
|
7
|
+
import { Divider } from "../..";
|
|
8
|
+
import theme from "../../../theme/settings";
|
|
9
|
+
import { generateCalendarCSS, isValidDate, onUpdateCalendar, renderHeader, renderNavigator } from "./function";
|
|
10
10
|
const CalendarRange = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
11
11
|
actions,
|
|
12
12
|
defaultValue,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { forwardRef, memo, useEffect, useRef, useState, useImperativeHandle, Fragment } from 'react';
|
|
6
|
-
import { Typography } from
|
|
7
|
-
import { alignCenter, alignStart, borderBox, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative, cursorNoDrop, parseWidthHeight, border } from
|
|
8
|
-
import { classNames, randomString, refType as ref } from
|
|
9
|
-
import { color as colors } from
|
|
10
|
-
import theme from
|
|
6
|
+
import { Typography } from "../..";
|
|
7
|
+
import { alignCenter, alignStart, borderBox, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative, cursorNoDrop, parseWidthHeight, border } from "../../../styles/general";
|
|
8
|
+
import { classNames, randomString, refType as ref } from "../../../utils";
|
|
9
|
+
import { color as colors } from "../../../styles/colors";
|
|
10
|
+
import theme from "../../../theme/settings";
|
|
11
11
|
const {
|
|
12
12
|
colors: {
|
|
13
13
|
system: {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { forwardRef, memo, useImperativeHandle, useLayoutEffect, useRef } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { displayBlock, pointerEventsNone, positionRelative, userSelectNone } from
|
|
8
|
-
import { color as colors } from
|
|
7
|
+
import { displayBlock, pointerEventsNone, positionRelative, userSelectNone } from "../../../styles/general";
|
|
8
|
+
import { color as colors } from "../../../styles/colors";
|
|
9
9
|
const {
|
|
10
10
|
semantic: {
|
|
11
11
|
danger
|