diginet-core-ui 1.3.91 → 1.3.92
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.
|
@@ -6,28 +6,13 @@ import { getGlobal } from "../../../global";
|
|
|
6
6
|
import { Another, Compressed, Image, Pdf, Presentation, Sheet, Word } from "../../../icons";
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
9
|
-
import { bgColor, border, borderRadius4px, borderRadius50, boxBorder, boxContent, cursorPointer, displayBlock, displayFlex, displayInlineBlock, displayNone, flexCol, flexRow, flexWrap, floatRight, gap, itemsCenter, justifyBetween, justifyCenter, justifyEnd, justifyStart, mg, mgb, mgl, mgr, mgx, parseHeight, parseMaxWidth, parseMaxWidthHeight, parseMinWidth, parseWidth, parseWidthHeight, pd, positionAbsolute, positionRelative, textCenter, textRight, truncate, userSelectNone } from "../../../styles/general";
|
|
9
|
+
import { bgColor, border, borderRadius4px, borderRadius50, bottom, boxBorder, boxContent, cursorPointer, displayBlock, displayFlex, displayInlineBlock, displayNone, flexCol, flexRow, flexWrap, floatRight, gap, itemsCenter, justifyBetween, justifyCenter, justifyEnd, justifyStart, left, mg, mgb, mgl, mgr, mgx, parseHeight, parseMaxWidth, parseMaxWidthHeight, parseMinWidth, parseWidth, parseWidthHeight, pd, positionAbsolute, positionRelative, textCenter, textColor, textRight, top, truncate, userSelectNone } from "../../../styles/general";
|
|
10
10
|
import { useTheme } from "../../../theme";
|
|
11
11
|
import { classNames, date as moment, getFileType } from "../../../utils";
|
|
12
12
|
const {
|
|
13
13
|
colors: {
|
|
14
|
-
system: {
|
|
15
|
-
rest: systemRest,
|
|
16
|
-
white: systemWhite
|
|
17
|
-
},
|
|
18
|
-
semantic: {
|
|
19
|
-
success: semanticSuccess
|
|
20
|
-
},
|
|
21
|
-
fill: {
|
|
22
|
-
hover: fillHover,
|
|
23
|
-
pressed: fillPressed,
|
|
24
|
-
focus: fillFocus
|
|
25
|
-
},
|
|
26
14
|
line: {
|
|
27
15
|
normal: lineNormal
|
|
28
|
-
},
|
|
29
|
-
text: {
|
|
30
|
-
sub: textSub
|
|
31
16
|
}
|
|
32
17
|
}
|
|
33
18
|
} = useTheme();
|
|
@@ -157,7 +142,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
157
142
|
const attachmentHandleIconRef = useRef(null);
|
|
158
143
|
const attachmentInputRef = useRef(null);
|
|
159
144
|
const attachedRef = useRef(null);
|
|
160
|
-
const newAttachedRef = useRef([]);
|
|
145
|
+
// const newAttachedRef = useRef([]);
|
|
161
146
|
const popupRef = useRef(null);
|
|
162
147
|
const popoverRef = useRef(null);
|
|
163
148
|
const isDeleteAll = useRef(false);
|
|
@@ -172,6 +157,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
172
157
|
const [viewTypeState, setViewTypeState] = useState(viewType);
|
|
173
158
|
const [isEmpty, setIsEmpty] = useState(null);
|
|
174
159
|
const [newDataState, setNewDataState] = useState([]);
|
|
160
|
+
const [dataState, setDataState] = useState([]);
|
|
175
161
|
const isEnable = !readOnly && !disabled;
|
|
176
162
|
const _AttachmentRootCSS = AttachmentRootCSS(isEmpty, isEnable);
|
|
177
163
|
|
|
@@ -377,14 +363,14 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
377
363
|
const parent = itemEl.parentNode;
|
|
378
364
|
const index = Array.from(attachedRef.current.children).indexOf(parent);
|
|
379
365
|
const deletedFile = attached.splice(index, 1)[0];
|
|
380
|
-
|
|
366
|
+
removedAttachedRef.current.push(deletedFile);
|
|
367
|
+
recentRemovedAttached.push(deletedFile);
|
|
368
|
+
if (Object.prototype.toString.call(deletedFile) === '[object File]' && newDataState !== null && newDataState !== void 0 && newDataState.length) {
|
|
381
369
|
removeFileOutInputFiles(allNewAttached.getAll('files').findIndex(attach => attach.FileName === deletedFile.FileName && attach.CreateDate === deletedFile.CreateDate));
|
|
382
370
|
} else {
|
|
383
371
|
oldAttached.splice(oldAttached.findIndex(attach => attach.FileName === deletedFile.FileName && attach.CreateDate === deletedFile.CreateDate), 1);
|
|
372
|
+
setDataState(dataState.filter(attach => attach.FileName !== deletedFile.FileName && attach.CreateDate !== deletedFile.CreateDate));
|
|
384
373
|
}
|
|
385
|
-
removedAttachedRef.current.push(deletedFile);
|
|
386
|
-
recentRemovedAttached.push(deletedFile);
|
|
387
|
-
parent.remove();
|
|
388
374
|
});
|
|
389
375
|
if (attached.length < 2) {
|
|
390
376
|
afterChangeFile(attached.length);
|
|
@@ -455,21 +441,26 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
455
441
|
files.splice(index, 1);
|
|
456
442
|
allNewAttached.delete('files');
|
|
457
443
|
files.forEach(file => allNewAttached.append('files', file));
|
|
458
|
-
newAttachedRef.current = files || [];
|
|
444
|
+
// newAttachedRef.current = files || [];
|
|
445
|
+
setNewDataState(files || []);
|
|
459
446
|
}
|
|
460
447
|
attachmentInputRef.current.files = dt.files;
|
|
461
448
|
return dt.files;
|
|
462
449
|
};
|
|
463
450
|
const insertAttached = files => {
|
|
464
451
|
if (multiple || inputProps && inputProps.multiple) {
|
|
452
|
+
let tempArr = [];
|
|
465
453
|
for (let file of files) {
|
|
466
454
|
allNewAttached.append('files', file);
|
|
467
|
-
newAttachedRef.current.push(file);
|
|
455
|
+
// newAttachedRef.current.push(file);
|
|
456
|
+
tempArr.push(file);
|
|
468
457
|
}
|
|
458
|
+
setNewDataState(tempArr);
|
|
469
459
|
} else if (files[0]) {
|
|
470
460
|
allNewAttached.delete('files');
|
|
471
461
|
allNewAttached.append('files', files[0]);
|
|
472
|
-
newAttachedRef.current = [files[0]];
|
|
462
|
+
// newAttachedRef.current = [files[0]];
|
|
463
|
+
setNewDataState([files[0]]);
|
|
473
464
|
}
|
|
474
465
|
// attachmentInputRef.current.files = allNewAttached.getAll('files');
|
|
475
466
|
};
|
|
@@ -714,7 +705,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
714
705
|
}
|
|
715
706
|
};
|
|
716
707
|
useEffect(() => {
|
|
717
|
-
if (attached.length) {
|
|
708
|
+
if (attached !== null && attached !== void 0 && attached.length) {
|
|
718
709
|
attached.length = 0;
|
|
719
710
|
}
|
|
720
711
|
return () => {
|
|
@@ -743,16 +734,15 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
743
734
|
};
|
|
744
735
|
}, [maxFile, maxSizeProp, multiple, accept]);
|
|
745
736
|
useEffect(() => {
|
|
746
|
-
var _newAttachedRef$curre;
|
|
747
737
|
oldAttached.length = 0;
|
|
748
|
-
afterChangeFile(((data === null || data === void 0 ? void 0 : data.length) || 0) + ((
|
|
738
|
+
afterChangeFile(((data === null || data === void 0 ? void 0 : data.length) || 0) + ((newDataState === null || newDataState === void 0 ? void 0 : newDataState.length) || 0));
|
|
749
739
|
if (data) {
|
|
750
740
|
// Load files data was uploaded
|
|
751
741
|
const length = data.length;
|
|
752
742
|
for (let i = 0; i < length; i++) {
|
|
753
743
|
if (Object.prototype.toString.call(data[i]) === '[object File]') {
|
|
754
744
|
allNewAttached.append('files', data[i]);
|
|
755
|
-
newAttachedRef.current.push(data[i]);
|
|
745
|
+
// newAttachedRef.current.push(data[i]);
|
|
756
746
|
attached.push(data[i]);
|
|
757
747
|
} else {
|
|
758
748
|
const item = mountDomain(data[i]);
|
|
@@ -760,12 +750,12 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
760
750
|
attached.push(item);
|
|
761
751
|
}
|
|
762
752
|
}
|
|
753
|
+
setDataState(data);
|
|
763
754
|
}
|
|
764
755
|
return () => {
|
|
765
756
|
// if (attachedRef.current) {
|
|
766
757
|
// attachedRef.current.innerHTML = null;
|
|
767
758
|
// }
|
|
768
|
-
setNewDataState([]);
|
|
769
759
|
oldAttached.length = 0;
|
|
770
760
|
attached.length = 0;
|
|
771
761
|
chosenItems.length = 0;
|
|
@@ -840,7 +830,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
840
830
|
uppercase: true,
|
|
841
831
|
required: required,
|
|
842
832
|
type: 'h5',
|
|
843
|
-
color:
|
|
833
|
+
color: 'text.sub',
|
|
844
834
|
ref: attachTextRef
|
|
845
835
|
}, label), error ? jsx(HelperText, null, error) : null), jsx("div", {
|
|
846
836
|
css: AttachmentHeaderIconCSS
|
|
@@ -878,11 +868,11 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
878
868
|
}), isEmpty ? jsx(Typography, {
|
|
879
869
|
css: userSelectNone,
|
|
880
870
|
type: 'p3',
|
|
881
|
-
color:
|
|
871
|
+
color: 'system.rest'
|
|
882
872
|
}, hintText) : null) : isEmpty ? jsx(Typography, {
|
|
883
873
|
css: userSelectNone,
|
|
884
874
|
type: 'p3',
|
|
885
|
-
color:
|
|
875
|
+
color: 'system.rest'
|
|
886
876
|
}, getGlobal('noFileText')) : null)), allowSort && !isEmpty ? jsx(Popover, {
|
|
887
877
|
ref: popoverRef,
|
|
888
878
|
anchor: jsx(ButtonIcon, {
|
|
@@ -968,15 +958,15 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
968
958
|
}, jsx(Typography, {
|
|
969
959
|
className: 'username',
|
|
970
960
|
type: 'p2',
|
|
971
|
-
color:
|
|
961
|
+
color: 'text.sub'
|
|
972
962
|
}, (item === null || item === void 0 ? void 0 : item.UserName) || item.lastModifiedDate && ownerName || ''), jsx(Typography, {
|
|
973
963
|
className: 'datetime',
|
|
974
964
|
type: 'p2',
|
|
975
|
-
color:
|
|
965
|
+
color: 'text.sub'
|
|
976
966
|
}, getDateTime(date)), jsx(Typography, {
|
|
977
967
|
className: 'filesize',
|
|
978
968
|
type: 'p2',
|
|
979
|
-
color:
|
|
969
|
+
color: 'text.sub'
|
|
980
970
|
}, calculateSize(item.FileSize || item.size))) : null, isNew ? jsx("span", {
|
|
981
971
|
css: AttachedLinearCSS
|
|
982
972
|
}, jsx(LinearProgress, {
|
|
@@ -994,12 +984,12 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
994
984
|
css: AttachedCSS,
|
|
995
985
|
ref: attachedRef,
|
|
996
986
|
className: classNames(isViewTypeIcon && 'icon-view')
|
|
997
|
-
},
|
|
987
|
+
}, dataState.map((item, idx) => {
|
|
998
988
|
return renderAttachmentItem(item, idx);
|
|
999
989
|
}), newDataState.map((item, idx) => {
|
|
1000
990
|
return renderAttachmentItem(item, (data === null || data === void 0 ? void 0 : data.length) + idx, true);
|
|
1001
991
|
})));
|
|
1002
|
-
}, [data, onViewProp, unitSize, newDataState, viewTypeState]);
|
|
992
|
+
}, [data, onViewProp, unitSize, dataState, newDataState, viewTypeState]);
|
|
1003
993
|
const PopupView = useMemo(() => {
|
|
1004
994
|
return jsx(Popup, {
|
|
1005
995
|
open: showPopup,
|
|
@@ -1070,8 +1060,8 @@ const AttachmentInputCSS = css`
|
|
|
1070
1060
|
${displayNone};
|
|
1071
1061
|
${positionAbsolute};
|
|
1072
1062
|
${parseWidthHeight('100%')};
|
|
1073
|
-
top
|
|
1074
|
-
left
|
|
1063
|
+
${top(0)};
|
|
1064
|
+
${left(0)};
|
|
1075
1065
|
input {
|
|
1076
1066
|
${positionRelative};
|
|
1077
1067
|
${parseWidthHeight('100%', 'calc(100% + 20px)')};
|
|
@@ -1095,8 +1085,8 @@ const AttachmentImageCSS = css`
|
|
|
1095
1085
|
const AttachmentImageEmptyCSS = css`
|
|
1096
1086
|
${positionAbsolute};
|
|
1097
1087
|
${parseWidthHeight('100%')};
|
|
1098
|
-
top
|
|
1099
|
-
left
|
|
1088
|
+
${top(0)};
|
|
1089
|
+
${left(0)};
|
|
1100
1090
|
`;
|
|
1101
1091
|
const AttachedItemInfoCSS = css`
|
|
1102
1092
|
${displayFlex};
|
|
@@ -1107,6 +1097,7 @@ const AttachedItemInfoCSS = css`
|
|
|
1107
1097
|
${mgr([2])};
|
|
1108
1098
|
`;
|
|
1109
1099
|
const AttachedItemInfoIconCSS = css`
|
|
1100
|
+
${displayFlex};
|
|
1110
1101
|
${flexRow};
|
|
1111
1102
|
${positionRelative};
|
|
1112
1103
|
${boxContent};
|
|
@@ -1117,9 +1108,9 @@ const AttachedItemInfoIconCSS = css`
|
|
|
1117
1108
|
${positionAbsolute};
|
|
1118
1109
|
${borderRadius50};
|
|
1119
1110
|
${parseWidthHeight(4, 4)};
|
|
1120
|
-
${bgColor(
|
|
1121
|
-
top
|
|
1122
|
-
left
|
|
1111
|
+
${bgColor('semantic.success')};
|
|
1112
|
+
${top(4.5)};
|
|
1113
|
+
${left(-2)}
|
|
1123
1114
|
}
|
|
1124
1115
|
`;
|
|
1125
1116
|
const AttachedItemOwnerCSS = css`
|
|
@@ -1128,7 +1119,7 @@ const AttachedItemOwnerCSS = css`
|
|
|
1128
1119
|
${itemsCenter};
|
|
1129
1120
|
${userSelectNone};
|
|
1130
1121
|
${parseHeight('100%')};
|
|
1131
|
-
|
|
1122
|
+
${textColor('text.sub')};
|
|
1132
1123
|
`;
|
|
1133
1124
|
const DetailInfoCSS = css`
|
|
1134
1125
|
${displayFlex};
|
|
@@ -1154,9 +1145,9 @@ const AttachedLinearCSS = css`
|
|
|
1154
1145
|
${displayFlex};
|
|
1155
1146
|
${positionAbsolute};
|
|
1156
1147
|
${itemsCenter};
|
|
1157
|
-
${bgColor(
|
|
1148
|
+
${bgColor('system.white')};
|
|
1158
1149
|
${parseWidthHeight('100%')};
|
|
1159
|
-
top
|
|
1150
|
+
${top(0)};
|
|
1160
1151
|
`;
|
|
1161
1152
|
const AttachedItemCSS = css`
|
|
1162
1153
|
${displayFlex};
|
|
@@ -1217,8 +1208,8 @@ const AttachedCSS = css`
|
|
|
1217
1208
|
${pd(0)};
|
|
1218
1209
|
&.new-file:after {
|
|
1219
1210
|
${parseWidthHeight(8)};
|
|
1220
|
-
top
|
|
1221
|
-
left
|
|
1211
|
+
${top(-1)};
|
|
1212
|
+
${left(-7)};
|
|
1222
1213
|
}
|
|
1223
1214
|
}
|
|
1224
1215
|
}
|
|
@@ -1227,7 +1218,7 @@ const AttachedCSS = css`
|
|
|
1227
1218
|
position: inherit;
|
|
1228
1219
|
.css-${AttachedLinearCSS.name} {
|
|
1229
1220
|
${parseHeight('auto')};
|
|
1230
|
-
bottom
|
|
1221
|
+
${bottom(0)};
|
|
1231
1222
|
top: unset;
|
|
1232
1223
|
background: none;
|
|
1233
1224
|
}
|
|
@@ -1251,27 +1242,27 @@ const AttachmentRootCSS = (isEmpty, isEnable) => css`
|
|
|
1251
1242
|
${positionRelative};
|
|
1252
1243
|
${borderRadius4px};
|
|
1253
1244
|
${boxBorder};
|
|
1254
|
-
${border(1,
|
|
1245
|
+
${border(1, 'line.normal')};
|
|
1255
1246
|
${parseHeight(isEmpty && !isEnable ? 120 : 280)};
|
|
1256
|
-
${bgColor(
|
|
1247
|
+
${bgColor('system.white')};
|
|
1257
1248
|
.css-${AttachedCSS.name} {
|
|
1258
1249
|
.css-${AttachedItemCSS.name} {
|
|
1259
1250
|
&:hover {
|
|
1260
|
-
${bgColor(
|
|
1251
|
+
${bgColor('fill.hover')};
|
|
1261
1252
|
.css-${AttachedLinearCSS.name} {
|
|
1262
|
-
${bgColor(
|
|
1253
|
+
${bgColor('fill.hover')};
|
|
1263
1254
|
}
|
|
1264
1255
|
}
|
|
1265
1256
|
&:active {
|
|
1266
|
-
${bgColor(
|
|
1257
|
+
${bgColor('fill.pressed')};
|
|
1267
1258
|
.css-${AttachedLinearCSS.name} {
|
|
1268
|
-
${bgColor(
|
|
1259
|
+
${bgColor('fill.pressed')};
|
|
1269
1260
|
}
|
|
1270
1261
|
}
|
|
1271
1262
|
&.chosen {
|
|
1272
|
-
${bgColor(
|
|
1263
|
+
${bgColor('fill.focus')};
|
|
1273
1264
|
.css-${AttachedItemInfoCSS.name}, .css-${AttachedItemOwnerCSS.name} {
|
|
1274
|
-
${bgColor(
|
|
1265
|
+
${bgColor('fill.focus')};
|
|
1275
1266
|
}
|
|
1276
1267
|
}
|
|
1277
1268
|
}
|
|
@@ -6,29 +6,18 @@ import { getGlobal } from "../../../global";
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { forwardRef, Fragment, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
9
|
-
import { bgColor, bgTransparent, border, borderNone, borderRadius, borderRadius4px, boxBorder, breakWord, cursorDefault, cursorNotAllowed, cursorPointer, displayBlock, displayFlex, flexColReverse, flexRow, flexWrap, inset, insetX, itemsCenter, justifyCenter, justifyStart, mgb, mgl, mgr, mgt, outlineNone, overflowAuto, overflowHidden, parseHeight, parseMaxHeight, parseMaxWidth, parseMinHeight, parseWidth, parseWidthHeight, pd, pdb, pdl, pdt, pdy, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, userSelectNone, z } from "../../../styles/general";
|
|
9
|
+
import { bgColor, bgTransparent, border, borderBottom, borderBottomColor, borderColor, borderNone, borderRadius, borderRadius4px, boxBorder, breakWord, cursorDefault, cursorNotAllowed, cursorPointer, displayBlock, displayFlex, fill, flexColReverse, flexRow, flexWrap, inset, insetX, italic, itemsCenter, justifyCenter, justifyStart, mgb, mgl, mgr, mgt, outlineNone, overflowAuto, overflowHidden, parseHeight, parseMaxHeight, parseMaxWidth, parseMinHeight, parseWidth, parseWidthHeight, pd, pdb, pdl, pdt, pdy, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, textColor, userSelectNone, z } from "../../../styles/general";
|
|
10
10
|
import { useTheme } from "../../../theme";
|
|
11
11
|
import { classNames, isMobile, mapParent, randomString, refType as ref, updatePosition } from "../../../utils";
|
|
12
12
|
const {
|
|
13
13
|
colors: {
|
|
14
14
|
system: {
|
|
15
|
-
active: systemActive,
|
|
16
|
-
disabled: systemDisabled,
|
|
17
|
-
rest: systemRest,
|
|
18
15
|
white: systemWhite
|
|
19
16
|
},
|
|
20
|
-
semantic: {
|
|
21
|
-
danger: semanticDanger
|
|
22
|
-
},
|
|
23
17
|
fill: {
|
|
24
|
-
hover: fillHover,
|
|
25
18
|
'scrollbar-tabbar': fillScrollbar
|
|
26
19
|
},
|
|
27
|
-
line: {
|
|
28
|
-
focus: lineFocus
|
|
29
|
-
},
|
|
30
20
|
text: {
|
|
31
|
-
main: textMain,
|
|
32
21
|
sub: textSub
|
|
33
22
|
}
|
|
34
23
|
},
|
|
@@ -1189,16 +1178,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1189
1178
|
return false;
|
|
1190
1179
|
}
|
|
1191
1180
|
}
|
|
1192
|
-
}) : jsx(
|
|
1193
|
-
ref: inputRef,
|
|
1181
|
+
}) : jsx("div", {
|
|
1194
1182
|
css: _DropdownInputCSS,
|
|
1183
|
+
onClick: onClickInput
|
|
1184
|
+
}, jsx(Typography, {
|
|
1185
|
+
ref: inputRef,
|
|
1195
1186
|
hoverTooltip: true,
|
|
1196
1187
|
lineClamp: multilineSelectedItem ? undefined : 1,
|
|
1197
1188
|
type: 'p1',
|
|
1198
1189
|
style: {
|
|
1199
1190
|
lineHeight: multiple ? '30px' : '24px'
|
|
1200
1191
|
},
|
|
1201
|
-
onClick: onClickInput,
|
|
1202
1192
|
tabIndex: -1
|
|
1203
1193
|
}, textValue))), jsx("div", {
|
|
1204
1194
|
ref: iconRef,
|
|
@@ -1256,7 +1246,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
|
|
|
1256
1246
|
${paragraph1};
|
|
1257
1247
|
${disabled ? cursorNotAllowed : readOnly ? cursorDefault : cursorPointer};
|
|
1258
1248
|
${parseWidth('100%')};
|
|
1259
|
-
|
|
1249
|
+
${textColor('text.main')};
|
|
1260
1250
|
${pdt(0)};
|
|
1261
1251
|
${pdb([viewType !== 'outlined' ? 0 : 'inherit'])};
|
|
1262
1252
|
${pdl([viewType !== 'outlined' ? 0 : 4])};
|
|
@@ -1277,7 +1267,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
|
|
|
1277
1267
|
${itemsCenter};
|
|
1278
1268
|
${justifyCenter};
|
|
1279
1269
|
content: '${placeholder}';
|
|
1280
|
-
|
|
1270
|
+
${textColor('text.sub')};
|
|
1281
1271
|
}
|
|
1282
1272
|
&:not(:empty)::after {
|
|
1283
1273
|
visibility: hidden;
|
|
@@ -1296,7 +1286,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
|
|
|
1296
1286
|
}
|
|
1297
1287
|
}
|
|
1298
1288
|
.DGN-UI-Typography {
|
|
1299
|
-
${disabled &&
|
|
1289
|
+
${disabled && textColor('system.disabled')};
|
|
1300
1290
|
}
|
|
1301
1291
|
`;
|
|
1302
1292
|
const IconCSS = viewType => css`
|
|
@@ -1313,24 +1303,24 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1313
1303
|
${boxBorder};
|
|
1314
1304
|
${parseWidth('100%')};
|
|
1315
1305
|
${pdy([multiple ? 0.25 : 1])};
|
|
1316
|
-
${!disabled && `
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1306
|
+
${!disabled && css`
|
|
1307
|
+
&:not(:focus-within):hover {
|
|
1308
|
+
&::before {
|
|
1309
|
+
${borderBottomColor('system.active')};
|
|
1310
|
+
}
|
|
1311
|
+
.css-${DropdownInputCSSName} {
|
|
1312
|
+
${textColor('system.active')};
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1325
1315
|
`}
|
|
1326
1316
|
&:focus-within {
|
|
1327
|
-
|
|
1317
|
+
${borderBottomColor('line.focus')};
|
|
1328
1318
|
&::after {
|
|
1329
|
-
|
|
1319
|
+
${borderBottomColor('inherit')};
|
|
1330
1320
|
transform: scaleX(1);
|
|
1331
1321
|
}
|
|
1332
1322
|
.css-${DropdownInputCSSName} {
|
|
1333
|
-
|
|
1323
|
+
${textColor('system.active')};
|
|
1334
1324
|
}
|
|
1335
1325
|
}
|
|
1336
1326
|
&.dropdown-showing {
|
|
@@ -1342,27 +1332,27 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1342
1332
|
content: '${placeholder}';
|
|
1343
1333
|
${parseHeight('100%')};
|
|
1344
1334
|
${overflowHidden};
|
|
1345
|
-
|
|
1335
|
+
${textColor('text.sub')};
|
|
1346
1336
|
display: -webkit-box;
|
|
1347
1337
|
-webkit-line-clamp: 1;
|
|
1348
1338
|
-webkit-box-orient: vertical;
|
|
1349
1339
|
}
|
|
1350
1340
|
&::placeholder {
|
|
1351
|
-
|
|
1341
|
+
${textColor('text.sub')};
|
|
1352
1342
|
}
|
|
1353
1343
|
&::before {
|
|
1354
1344
|
${positionAbsolute};
|
|
1355
1345
|
content: '';
|
|
1356
1346
|
${insetX(0)};
|
|
1357
1347
|
bottom: 0;
|
|
1358
|
-
${viewType === 'underlined' &&
|
|
1348
|
+
${viewType === 'underlined' && borderBottom(1, disabled ? 'system.disabled' : 'system.rest')}
|
|
1359
1349
|
}
|
|
1360
1350
|
&::after {
|
|
1361
1351
|
${positionAbsolute};
|
|
1362
1352
|
content: '';
|
|
1363
1353
|
${insetX(0)};
|
|
1364
1354
|
bottom: -1px;
|
|
1365
|
-
|
|
1355
|
+
${borderBottom(2, 'transparent')};
|
|
1366
1356
|
transform: scaleX(0);
|
|
1367
1357
|
transform-origin: center;
|
|
1368
1358
|
transition: all 0.2s ease;
|
|
@@ -1374,21 +1364,21 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1374
1364
|
${positionRelative};
|
|
1375
1365
|
${borderRadius4px};
|
|
1376
1366
|
${boxBorder};
|
|
1377
|
-
${border(1, disabled ?
|
|
1367
|
+
${border(1, disabled ? 'system.disabled' : 'system.rest')};
|
|
1378
1368
|
${parseWidth('100%')};
|
|
1379
1369
|
${parseMinHeight(40)};
|
|
1380
1370
|
${mgt([0.5])};
|
|
1381
|
-
${!disabled && `
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1371
|
+
${!disabled && css`
|
|
1372
|
+
&:not(:focus-within):hover {
|
|
1373
|
+
${bgColor('fill.hover')};
|
|
1374
|
+
${borderColor('system.active')};
|
|
1375
|
+
input {
|
|
1376
|
+
${bgColor('fill.hover')};
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1389
1379
|
`}
|
|
1390
1380
|
&:focus-within {
|
|
1391
|
-
|
|
1381
|
+
${borderColor('line.focus')};
|
|
1392
1382
|
}
|
|
1393
1383
|
&.dropdown-showing {
|
|
1394
1384
|
.icon-dropdown {
|
|
@@ -1399,13 +1389,13 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1399
1389
|
content: '${placeholder}';
|
|
1400
1390
|
${parseHeight('100%')};
|
|
1401
1391
|
${overflowHidden};
|
|
1402
|
-
|
|
1392
|
+
${textColor('text.sub')};
|
|
1403
1393
|
display: -webkit-box;
|
|
1404
1394
|
-webkit-line-clamp: 1;
|
|
1405
1395
|
-webkit-box-orient: vertical;
|
|
1406
1396
|
}
|
|
1407
1397
|
&::placeholder {
|
|
1408
|
-
|
|
1398
|
+
${textColor('text.sub')};
|
|
1409
1399
|
}
|
|
1410
1400
|
&::after {
|
|
1411
1401
|
${positionAbsolute};
|
|
@@ -1424,7 +1414,7 @@ const DropdownListCSS = loading => css`
|
|
|
1424
1414
|
${parseWidth('100%')};
|
|
1425
1415
|
${parseMaxHeight(280)};
|
|
1426
1416
|
${loading ? overflowHidden : overflowAuto};
|
|
1427
|
-
${bgColor(
|
|
1417
|
+
${bgColor('system.white')};
|
|
1428
1418
|
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
1429
1419
|
${z(1)};
|
|
1430
1420
|
&::-webkit-scrollbar {
|
|
@@ -1454,19 +1444,19 @@ const DropdownItemCSS = (multiple, selectBox) => css`
|
|
|
1454
1444
|
${userSelectNone};
|
|
1455
1445
|
${parseMinHeight(40)};
|
|
1456
1446
|
${parseWidth('100%')};
|
|
1457
|
-
${bgColor(
|
|
1447
|
+
${bgColor('system.white')};
|
|
1458
1448
|
${pd([2, multiple && selectBox ? 0 : 4])};
|
|
1459
|
-
|
|
1449
|
+
${textColor('text.main')};
|
|
1460
1450
|
&.no-data {
|
|
1461
1451
|
${justifyCenter};
|
|
1462
1452
|
${cursorDefault};
|
|
1463
|
-
|
|
1453
|
+
${italic};
|
|
1464
1454
|
}
|
|
1465
1455
|
&:not(.no-data):hover,
|
|
1466
1456
|
&:not(.no-data):focus {
|
|
1467
1457
|
${outlineNone};
|
|
1468
|
-
${bgColor(
|
|
1469
|
-
|
|
1458
|
+
${bgColor('fill.hover')};
|
|
1459
|
+
${textColor('system.active')};
|
|
1470
1460
|
}
|
|
1471
1461
|
`;
|
|
1472
1462
|
const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
|
|
@@ -1476,21 +1466,21 @@ const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
|
|
|
1476
1466
|
${parseHeight('max-content')};
|
|
1477
1467
|
&.error {
|
|
1478
1468
|
.css-${DropdownFormCSSName} {
|
|
1479
|
-
|
|
1469
|
+
${borderColor('semantic.danger')};
|
|
1480
1470
|
path {
|
|
1481
|
-
|
|
1471
|
+
${fill('semantic.danger')};
|
|
1482
1472
|
}
|
|
1483
1473
|
&::before {
|
|
1484
|
-
|
|
1474
|
+
${borderColor('semantic.danger')};
|
|
1485
1475
|
}
|
|
1486
1476
|
}
|
|
1487
1477
|
}
|
|
1488
1478
|
&.dgn-dropdown-loading,
|
|
1489
1479
|
&.disabled {
|
|
1490
1480
|
.css-${DropdownFormCSSName} {
|
|
1491
|
-
|
|
1481
|
+
${borderColor('system.disabled')};
|
|
1492
1482
|
&::before {
|
|
1493
|
-
|
|
1483
|
+
${borderColor('system.disabled')};
|
|
1494
1484
|
}
|
|
1495
1485
|
}
|
|
1496
1486
|
}
|
|
@@ -1507,10 +1497,11 @@ const DropdownCSS = (top, left, width, isMobile, allowSearch) => css`
|
|
|
1507
1497
|
${parseWidth(width)};
|
|
1508
1498
|
top: ${top}px;
|
|
1509
1499
|
left: ${left}px;
|
|
1510
|
-
${bgColor(
|
|
1500
|
+
${bgColor('system.white')};
|
|
1511
1501
|
${z(1)};
|
|
1512
|
-
${isMobile && allowSearch && `
|
|
1502
|
+
${isMobile && allowSearch && css`
|
|
1513
1503
|
${parseHeight('max-content')};
|
|
1504
|
+
${displayFlex};
|
|
1514
1505
|
${flexColReverse};
|
|
1515
1506
|
bottom: 0;
|
|
1516
1507
|
top: auto;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -38,6 +38,10 @@ npm test
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Changelog
|
|
41
|
+
## 1.3.92
|
|
42
|
+
- \[Fixed\]: Dropdown – Fix override css selected item Typography
|
|
43
|
+
- \[Fixed\]: Attachment – Fix crash when remove attached item
|
|
44
|
+
|
|
41
45
|
## 1.3.91
|
|
42
46
|
- \[Changed\]: TreeView – Optimize code
|
|
43
47
|
- \[Changed\]: Popup – Add defaultProps description
|
package/styles/general.js
CHANGED
|
@@ -413,6 +413,14 @@ const textLowercase = css`
|
|
|
413
413
|
const textRight = css`
|
|
414
414
|
text-align: right;
|
|
415
415
|
`;
|
|
416
|
+
const textSentence = css`
|
|
417
|
+
& {
|
|
418
|
+
text-transform: lowercase;
|
|
419
|
+
}
|
|
420
|
+
&:first-letter {
|
|
421
|
+
text-transform: uppercase;
|
|
422
|
+
}
|
|
423
|
+
`;
|
|
416
424
|
const textUnderline = css`
|
|
417
425
|
text-decoration: underline;
|
|
418
426
|
`;
|
|
@@ -445,4 +453,4 @@ const whiteSpacePreWrap = css`
|
|
|
445
453
|
const z = vl => css`
|
|
446
454
|
z-index: ${zIndex(vl)};
|
|
447
455
|
`;
|
|
448
|
-
export { bgColor, bgCurrent, bgTransparent, border, borderBottom, borderBottomColor, borderColor, borderNone, borderRadius, borderRadius100, borderRadius4px, borderRadius50, bottom, boxBorder, boxContent, breakAll, breakWord, cursorDefault, cursorInherit, cursorInitial, cursorMove, cursorNoDrop, cursorNotAllowed, cursorPointer, cursorText, displayBlock, displayFlex, displayInlineBlock, displayInlineFlex, displayNone, fill, flexCol, flexColReverse, flexNowrap, flexRow, flexRowReverse, flexShrink, flexShrink0, flexWrap, flexWrapReverse, floatLeft, floatNone, floatRight, gap, gapX, gapY, inset, insetX, insetY, invisible, italic, itemsCenter, itemsEnd, itemsStart, justifyAround, justifyBetween, justifyCenter, justifyEnd, justifyEvenly, justifyStart, left, mg, mgb, mgl, mgr, mgt, mgx, mgy, noBorder, noBoxShadow, noMargin, noPadding, objectContain, objectCover, objectFill, objectNone, order, outlineNone, overflowAuto, overflowHidden, parseHeight, parseMaxHeight, parseMaxWidth, parseMaxWidthHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidth, parseWidthHeight, pd, pdb, pdl, pdr, pdt, pdx, pdy, pointerEventsAuto, pointerEventsInherit, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, positionSticky, right, scale, scaleX, scaleY, selfCenter, selfEnd, selfStart, shadowNone, textCapitalize, textCenter, textColor, textCurrent, textEllipsis, textLeft, textLineThrough, textLowercase, textRight, textUnderline, textUppercase, top, truncate, userSelectNone, visible, whiteSpaceBreakSpaces, whiteSpaceNoWrap, whiteSpacePreWrap, z };
|
|
456
|
+
export { bgColor, bgCurrent, bgTransparent, border, borderBottom, borderBottomColor, borderColor, borderNone, borderRadius, borderRadius100, borderRadius4px, borderRadius50, bottom, boxBorder, boxContent, breakAll, breakWord, cursorDefault, cursorInherit, cursorInitial, cursorMove, cursorNoDrop, cursorNotAllowed, cursorPointer, cursorText, displayBlock, displayFlex, displayInlineBlock, displayInlineFlex, displayNone, fill, flexCol, flexColReverse, flexNowrap, flexRow, flexRowReverse, flexShrink, flexShrink0, flexWrap, flexWrapReverse, floatLeft, floatNone, floatRight, gap, gapX, gapY, inset, insetX, insetY, invisible, italic, itemsCenter, itemsEnd, itemsStart, justifyAround, justifyBetween, justifyCenter, justifyEnd, justifyEvenly, justifyStart, left, mg, mgb, mgl, mgr, mgt, mgx, mgy, noBorder, noBoxShadow, noMargin, noPadding, objectContain, objectCover, objectFill, objectNone, order, outlineNone, overflowAuto, overflowHidden, parseHeight, parseMaxHeight, parseMaxWidth, parseMaxWidthHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidth, parseWidthHeight, pd, pdb, pdl, pdr, pdt, pdx, pdy, pointerEventsAuto, pointerEventsInherit, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, positionSticky, right, scale, scaleX, scaleY, selfCenter, selfEnd, selfStart, shadowNone, textCapitalize, textCenter, textColor, textCurrent, textEllipsis, textLeft, textLineThrough, textLowercase, textRight, textSentence, textUnderline, textUppercase, top, truncate, userSelectNone, visible, whiteSpaceBreakSpaces, whiteSpaceNoWrap, whiteSpacePreWrap, z };
|