diginet-core-ui 1.4.14-beta.2 → 1.4.14-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.
Files changed (128) hide show
  1. package/components/accordion/details.js +36 -25
  2. package/components/accordion/group.js +33 -18
  3. package/components/accordion/index.js +42 -28
  4. package/components/accordion/summary.js +60 -52
  5. package/components/alert/index.js +84 -75
  6. package/components/alert/notify.js +53 -41
  7. package/components/avatar/index.js +97 -94
  8. package/components/badge/index.js +80 -78
  9. package/components/breadcrumb/index.js +62 -44
  10. package/components/button/icon.js +90 -70
  11. package/components/button/index.js +110 -88
  12. package/components/button/more.js +60 -39
  13. package/components/button/ripple-effect.js +1 -1
  14. package/components/card/body.js +38 -28
  15. package/components/card/extra.js +38 -28
  16. package/components/card/footer.js +38 -28
  17. package/components/card/header.js +39 -28
  18. package/components/card/index.js +79 -70
  19. package/components/chart/bar/Labels.js +14 -8
  20. package/components/chart/bar-v2/Labels.js +14 -8
  21. package/components/chart/line/Labels.js +14 -8
  22. package/components/chart/line/Path.js +3 -3
  23. package/components/chart/line/Point.js +12 -11
  24. package/components/chart/line-v2/Labels.js +14 -8
  25. package/components/check-text/index.js +21 -16
  26. package/components/check-text/interview-confirmation.js +21 -15
  27. package/components/check-text/interview-status.js +21 -15
  28. package/components/chip/attach.js +11 -7
  29. package/components/chip/index.js +83 -82
  30. package/components/collapse/index.js +1 -1
  31. package/components/dialogs/colors.js +13 -11
  32. package/components/divider/index.js +40 -22
  33. package/components/form-control/attachment/index.js +94 -57
  34. package/components/form-control/calendar/function.js +173 -169
  35. package/components/form-control/calendar/index.js +48 -36
  36. package/components/form-control/calendar/range.js +38 -22
  37. package/components/form-control/checkbox/index.js +87 -63
  38. package/components/form-control/control/index.js +9 -10
  39. package/components/form-control/date-picker/index.js +81 -64
  40. package/components/form-control/date-range-picker/index.js +98 -81
  41. package/components/form-control/dropdown/index.js +240 -215
  42. package/components/form-control/dropdown-box/index.js +56 -43
  43. package/components/form-control/form-group/index.js +7 -6
  44. package/components/form-control/helper-text/index.js +45 -41
  45. package/components/form-control/input-base/index.js +165 -133
  46. package/components/form-control/label/index.js +48 -41
  47. package/components/form-control/money-input/index.js +87 -79
  48. package/components/form-control/number-input/index.js +579 -521
  49. package/components/form-control/number-input/index2.js +107 -87
  50. package/components/form-control/password-input/index.js +71 -63
  51. package/components/form-control/radio/index.js +90 -74
  52. package/components/form-control/text-input/index.js +83 -74
  53. package/components/form-control/time-picker/index.js +79 -56
  54. package/components/form-control/time-picker/v2/index.js +90 -84
  55. package/components/form-control/toggle/index.js +144 -133
  56. package/components/form-view/helper-text.js +2 -2
  57. package/components/form-view/index.js +34 -31
  58. package/components/form-view/input.js +70 -69
  59. package/components/form-view/label.js +14 -9
  60. package/components/grid/Col.js +48 -39
  61. package/components/grid/Container.js +31 -38
  62. package/components/grid/Row.js +28 -32
  63. package/components/grid/index.js +66 -54
  64. package/components/image/index.js +37 -27
  65. package/components/list/list-item-action.js +36 -26
  66. package/components/list/list-item-icon.js +34 -29
  67. package/components/list/list-item-text.js +27 -22
  68. package/components/list/list-item.js +42 -36
  69. package/components/list/list.js +46 -38
  70. package/components/list/sub-header.js +33 -26
  71. package/components/modal/body.js +24 -14
  72. package/components/modal/footer.js +23 -13
  73. package/components/modal/header.js +39 -28
  74. package/components/modal/index.js +3 -3
  75. package/components/modal/modal.js +60 -49
  76. package/components/others/extra/index.js +31 -30
  77. package/components/others/import/index.js +2 -2
  78. package/components/others/scrollbar/index.js +32 -26
  79. package/components/paging/page-info.js +67 -68
  80. package/components/paging/page-selector.js +49 -49
  81. package/components/paper/index.js +32 -28
  82. package/components/popover/body.js +14 -8
  83. package/components/popover/footer.js +13 -8
  84. package/components/popover/header.js +17 -15
  85. package/components/popover/index.js +103 -92
  86. package/components/popup/danger_popup.js +17 -16
  87. package/components/popup/index.js +16 -17
  88. package/components/popup/v2/index.js +41 -54
  89. package/components/progress/circular.js +65 -80
  90. package/components/progress/linear.js +73 -58
  91. package/components/rating/index.js +49 -63
  92. package/components/slider/slider-container.js +49 -57
  93. package/components/slider/slider-item.js +30 -29
  94. package/components/status/index.js +23 -34
  95. package/components/tab/tab-header.js +20 -11
  96. package/components/tab/tab-panel.js +12 -7
  97. package/components/tab/tab.js +35 -22
  98. package/components/tooltip/index.js +24 -35
  99. package/components/transfer/index.js +105 -106
  100. package/components/tree-view/index.js +133 -115
  101. package/components/typography/index.js +72 -55
  102. package/global/index.js +2 -17
  103. package/icons/basic.js +975 -972
  104. package/icons/effect.js +21 -20
  105. package/package.json +3 -1
  106. package/styles/color-helper.js +105 -105
  107. package/styles/colors.js +168 -30
  108. package/styles/general.js +84 -16
  109. package/styles/sx/index.js +7 -4
  110. package/styles/utils.js +20 -19
  111. package/theme/createSpacing.js +10 -0
  112. package/theme/createTheme.js +26 -0
  113. package/theme/createZIndex.js +9 -0
  114. package/theme/index.js +13 -2
  115. package/theme/make-styles.js +2 -1
  116. package/theme/settings.js +699 -8
  117. package/theme/theme-provider.js +32 -15
  118. package/theme/theme.js +57 -56
  119. package/theme/use-classes.js +15 -0
  120. package/theme/utils/getThemeProps.js +12 -0
  121. package/theme/utils/resolveProps.js +17 -0
  122. package/theme/utils/useThemeProps.js +14 -0
  123. package/utils/handleBreakpoints.js +2 -2
  124. package/utils/hexToRGBA/index.js +7 -7
  125. package/utils/object/deepmerge.js +104 -0
  126. package/utils/object/object.js +7 -12
  127. package/utils/render-portal.js +4 -3
  128. package/theme/set-theme.js +0 -38
@@ -1,8 +1,8 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
- import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
4
3
  import { css, jsx } from '@emotion/core';
5
4
  import PropTypes from 'prop-types';
5
+ import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
6
6
  import { displayBlock, parseWidthHeight, positionRelative } from "../../styles/general";
7
7
  const Collapse = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
8
8
  children,
@@ -1,11 +1,13 @@
1
- export const iconDefault = '#687799';
2
- export const iconHover = '#111d5e';
3
- export const iconDisabled = '#8f9bb3';
4
- export const fillHover = '#eff5ff';
5
- export const fillDisabled = '#e7eaf0';
6
- export const fillDefault = '#8f9bb3';
7
- export const fillPath = '#fff';
8
- export const uiSuccess = '#00c875';
9
- export const uiWarning = '#ffaa00';
10
- export const uiDanger = '#ff3d71';
11
- export const uiInfo = '#0095ff';
1
+ // export const iconDefault = '#687799';
2
+ // export const iconHover = '#111d5e';
3
+ // export const iconDisabled = '#8f9bb3';
4
+
5
+ // export const fillHover = '#eff5ff';
6
+ // export const fillDisabled = '#e7eaf0';
7
+ // export const fillDefault = '#8f9bb3';
8
+ // export const fillPath = '#fff';
9
+
10
+ // export const uiSuccess = '#00c875';
11
+ // export const uiWarning = '#ffaa00';
12
+ // export const uiDanger = '#ff3d71';
13
+ // export const uiInfo = '#0095ff';
@@ -4,22 +4,36 @@ import { css, jsx } from '@emotion/core';
4
4
  import OptionWrapper from "../others/option-wrapper";
5
5
  import PropTypes from 'prop-types';
6
6
  import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
7
- import { bgColor, borderNone, flexShrink0, mg, parseWidthHeight } from "../../styles/general";
8
- import { classNames } from "../../utils";
9
- const Divider = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
- action = {},
11
- className,
12
- color,
13
- direction,
14
- height,
15
- id,
16
- style,
17
- width
18
- }, reference) => {
7
+ import { bgColor, borderNone, flexShrink0, parseWidthHeight } from "../../styles/general";
8
+ import { useTheme } from "../../theme";
9
+ import useThemeProps from "../../theme/utils/useThemeProps";
10
+ import { classNames, getProp } from "../../utils";
11
+ const Divider = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference) => {
19
12
  if (!reference) reference = useRef(null);
13
+ const theme = useTheme();
14
+ const {
15
+ colors
16
+ } = theme;
17
+
18
+ // props priority: `inProps` > `themeDefaultProps`
19
+ const props = useThemeProps({
20
+ props: inProps,
21
+ name: 'Divider'
22
+ });
23
+ const {
24
+ action = {},
25
+ className,
26
+ color: colorProp,
27
+ direction,
28
+ height,
29
+ id,
30
+ style,
31
+ width
32
+ } = props;
20
33
  const ref = useRef(null);
21
34
  const isVertical = direction === 'vertical';
22
- const _DividerRoot = DividerRoot(color, width, height, isVertical);
35
+ const color = getProp(colors, colorProp, colorProp);
36
+ const _DividerRoot = DividerRoot(color, width, height, isVertical, theme);
23
37
  useImperativeHandle(reference, () => {
24
38
  const currentRef = ref.current || {};
25
39
  currentRef.element = ref.current;
@@ -38,21 +52,25 @@ const Divider = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
38
52
  style: style,
39
53
  className: classNames('DGN-UI-Divider', className)
40
54
  });
41
- }, [className, color, direction, height, id, style, width]);
55
+ }, [className, color, direction, height, id, style, width, theme]);
42
56
  }));
43
- const DividerRoot = (color, width, height, isVertical) => css`
57
+ const DividerRoot = (color, width, height, isVertical, {
58
+ spacing
59
+ }) => css`
44
60
  ${borderNone};
45
61
  ${flexShrink0};
46
- ${mg(0)};
62
+ margin: ${spacing([0])};
47
63
  ${bgColor(color)};
48
64
  ${parseWidthHeight(width || (isVertical ? 1 : '100%'), height || (isVertical ? 'auto' : 1))};
49
65
  `;
50
- Divider.defaultProps = {
51
- className: '',
52
- color: 'system.disabled',
53
- direction: 'horizontal',
54
- style: {}
55
- };
66
+
67
+ // Divider.defaultProps = {
68
+ // className: '',
69
+ // color: 'system/disabled',
70
+ // direction: 'horizontal',
71
+ // style: {},
72
+ // };
73
+
56
74
  Divider.propTypes = {
57
75
  /** Class for component. */
58
76
  className: PropTypes.string,
@@ -6,7 +6,7 @@ import { ButtonIcon, Grid, HelperText, Icon, Image, Label, LinearProgress, List,
6
6
  import { getGlobal } from "../../../global";
7
7
  import PropTypes from 'prop-types';
8
8
  import { forwardRef, memo, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
9
- import { aspectSquare, bgColor, border, borderDashed, borderRadius4px, borderRadius50, borderRight, bottom, boxBorder, cursorPointer, displayFlex, displayInlineBlock, displayNone, flexCol, floatRight, gap, itemsCenter, justifyBetween, justifyCenter, justifyEnd, justifyStart, left, mg, mgl, mgr, overflowHidden, parseHeight, parseMaxWidth, parseMinHeight, parseMinWidth, parseWidth, parseWidthHeight, pd, positionAbsolute, positionRelative, textCenter, textColor, textLeft, textRight, top, truncate, userSelectNone } from "../../../styles/general";
9
+ import { aspectSquare, bgColor, border, borderDashed, borderRadius4px, borderRadius50, borderRight, bottom, boxBorder, cursorPointer, displayFlex, displayInlineBlock, displayNone, flexCol, floatRight, itemsCenter, justifyBetween, justifyCenter, justifyEnd, justifyStart, left, overflowHidden, parseHeight, parseMaxWidth, parseMinHeight, parseMinWidth, parseWidth, parseWidthHeight, positionAbsolute, positionRelative, textCenter, textColor, textLeft, textRight, top, truncate, userSelectNone } from "../../../styles/general";
10
10
  import { useTheme } from "../../../theme";
11
11
  import { classNames, getFileType, getProp, date as moment } from "../../../utils";
12
12
  const oldAttached = [];
@@ -181,19 +181,24 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
181
181
  const isSpecialCase = viewTypeState === 'picture' && maxFile === 1;
182
182
  const isEnable = !readOnly && !disabled;
183
183
  const isEmpty = !((dataState === null || dataState === void 0 ? void 0 : dataState.length) + (newDataState === null || newDataState === void 0 ? void 0 : newDataState.length));
184
+ const theme = useTheme();
184
185
  const {
185
- colors
186
+ colors,
187
+ spacing
186
188
  } = useTheme();
187
189
  const _AttachmentRootCSS = AttachmentRootCSS(isEmpty, isEnable, height, colors);
188
- const _AttachmentHandleIconCSS = AttachmentHandleIconCSS(colors);
189
- const _ButtonAttachmentCSS = ButtonAttachmentCSS(colors);
190
+ const _AttachmentHandleIconCSS = AttachmentHandleIconCSS(theme);
191
+ const _ButtonAttachmentCSS = ButtonAttachmentCSS(theme);
190
192
  const _DotNewFileDetailCSS = DotNewFileDetailCSS(colors);
191
193
  const _DotNewFileIconCSS = DotNewFileIconCSS(colors);
192
194
  const _AttachedItemOwnerCSS = AttachedItemOwnerCSS(colors);
193
195
  const _AttachedLinearCSS = AttachedLinearCSS(colors);
194
196
  const _AttachedItemCSS = AttachedItemCSS(colors);
195
197
  const _AttachedItemPictureCSS = AttachedItemPictureCSS(colors);
196
- const _ItemPictureInfoCSS = ItemPictureInfoCSS(colors);
198
+ const _ItemPictureInfoCSS = ItemPictureInfoCSS(theme);
199
+ const _AttachmentInfoCSS = AttachmentInfoCSS(theme);
200
+ const _AttachedItemInfoCSS = AttachedItemInfoCSS(theme);
201
+ const _AttachmentListCSS = AttachmentListCSS(theme);
197
202
 
198
203
  // Start handler
199
204
  const onSortElement = (e, type) => {
@@ -843,10 +848,10 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
843
848
  // Start view
844
849
  const AttachHeaderView = useMemo(() => {
845
850
  return jsx("div", {
846
- css: AttachmentHeaderCSS,
851
+ css: AttachmentHeaderCSS(theme),
847
852
  className: 'DGN-UI-Attachment-Header'
848
853
  }, jsx("div", {
849
- css: AttachmentInfoCSS
854
+ css: _AttachmentInfoCSS
850
855
  }, jsx(Label, {
851
856
  uppercase: true,
852
857
  required: required,
@@ -873,7 +878,9 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
873
878
  name: 'delete',
874
879
  onClick: onShowPopup
875
880
  }) : null), jsx("div", {
876
- css: isEmpty ? AttachmentImageEmptyCSS : mgr([isSpecialCase ? 0 : 2])
881
+ css: isEmpty ? AttachmentImageEmptyCSS : css`
882
+ margin-right: ${spacing([isSpecialCase ? 0 : 2])};
883
+ `
877
884
  }, jsx("div", {
878
885
  css: [AttachmentImageCenterCSS, !isEnable && [parseHeight('calc(100% - 32px)'), justifyEnd]]
879
886
  }, isEnable ? jsx("div", {
@@ -962,9 +969,9 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
962
969
  onDoubleClick: e => onView(e.currentTarget, isNew ? null : item.AttachmentID),
963
970
  className: classNames('DGN-UI-Attachment-List-Attached-Row', 'attachment-row')
964
971
  }, jsx("div", {
965
- css: [_AttachedItemCSS, AttachedItemDetailCSS]
972
+ css: [_AttachedItemCSS, AttachedItemDetailCSS(theme)]
966
973
  }, jsx("span", {
967
- css: AttachedItemInfoCSS
974
+ css: _AttachedItemInfoCSS
968
975
  }, jsx(Icon, {
969
976
  css: (item.lastModifiedDate || isNew) && _DotNewFileDetailCSS,
970
977
  width: 16,
@@ -975,7 +982,9 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
975
982
  className: 'filetype'
976
983
  }, type), jsx(Typography, {
977
984
  className: 'filename',
978
- css: [mgl([3])],
985
+ css: css`
986
+ margin-left: ${spacing([3])};
987
+ `,
979
988
  type: 'p1',
980
989
  lineClamp: 1
981
990
  }, name)), jsx("span", {
@@ -1018,7 +1027,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1018
1027
  }, jsx("div", {
1019
1028
  css: _AttachedItemCSS
1020
1029
  }, jsx("span", {
1021
- css: AttachedItemIconInfoCSS
1030
+ css: AttachedItemIconInfoCSS(theme)
1022
1031
  }, jsx(Icon, {
1023
1032
  css: [(item.lastModifiedDate || isNew) && _DotNewFileIconCSS],
1024
1033
  width: 40,
@@ -1133,7 +1142,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1133
1142
  };
1134
1143
  const AttachedView = useMemo(() => {
1135
1144
  return jsx(ScrollBar, {
1136
- css: AttachmentListCSS,
1145
+ css: _AttachmentListCSS,
1137
1146
  className: 'DGN-UI-Attachment-List'
1138
1147
  }, jsx(Grid, {
1139
1148
  container: true,
@@ -1191,26 +1200,33 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1191
1200
  color: 'danger'
1192
1201
  }));
1193
1202
  }));
1194
- const AttachmentHandleIconCSS = colors => css`
1203
+ const AttachmentHandleIconCSS = ({
1204
+ colors,
1205
+ spacing
1206
+ }) => css`
1195
1207
  ${displayNone};
1196
1208
  ${parseHeight(24)};
1197
- ${mgr([2])};
1209
+ margin-right: ${spacing([2])};
1198
1210
  ${borderRight(1, getProp(colors, 'line/normal'))};
1199
1211
  button {
1200
- ${mgr([2])};
1212
+ margin-right: ${spacing([2])};
1201
1213
  }
1202
1214
  `;
1203
- const AttachmentHeaderCSS = css`
1215
+ const AttachmentHeaderCSS = ({
1216
+ spacing
1217
+ }) => css`
1204
1218
  ${displayFlex};
1205
1219
  ${itemsCenter};
1206
1220
  ${justifyBetween};
1207
1221
  ${boxBorder};
1208
1222
  ${parseWidth('100%')};
1209
- ${pd([4, 4])};
1223
+ padding: ${spacing([4, 4])};
1210
1224
  `;
1211
- const AttachmentInfoCSS = css`
1225
+ const AttachmentInfoCSS = ({
1226
+ spacing
1227
+ }) => css`
1212
1228
  ${displayFlex};
1213
- ${gap([2])};
1229
+ gap: ${spacing([2])};
1214
1230
  `;
1215
1231
  const AttachmentHeaderIconCSS = css`
1216
1232
  ${displayFlex};
@@ -1223,10 +1239,13 @@ const AttachmentImageCenterCSS = css`
1223
1239
  ${itemsCenter};
1224
1240
  ${parseWidthHeight('100%')};
1225
1241
  `;
1226
- const ButtonAttachmentCSS = colors => css`
1242
+ const ButtonAttachmentCSS = ({
1243
+ colors,
1244
+ spacing
1245
+ }) => css`
1227
1246
  ${border(1, getProp(colors, 'line/normal'))};
1228
1247
  ${borderDashed};
1229
- ${mg([0, 'auto', 4])};
1248
+ margin: ${spacing([0, 'auto', 4])};
1230
1249
  `;
1231
1250
  const AttachmentImageEmptyCSS = css`
1232
1251
  ${positionAbsolute};
@@ -1234,12 +1253,14 @@ const AttachmentImageEmptyCSS = css`
1234
1253
  ${top(0)};
1235
1254
  ${left(0)};
1236
1255
  `;
1237
- const AttachedItemInfoCSS = css`
1256
+ const AttachedItemInfoCSS = ({
1257
+ spacing
1258
+ }) => css`
1238
1259
  ${displayFlex};
1239
1260
  ${itemsCenter};
1240
1261
  ${userSelectNone};
1241
1262
  ${parseMinWidth('calc(50% - 10px)')};
1242
- ${mgr([2])};
1263
+ margin-right: ${spacing([2])};
1243
1264
  `;
1244
1265
  const DotNewFileDetailCSS = colors => css`
1245
1266
  :after {
@@ -1288,7 +1309,7 @@ const DetailInfoCSS = css`
1288
1309
  .filesize {
1289
1310
  ${floatRight};
1290
1311
  ${textRight};
1291
- ${mgl(['auto'])};
1312
+ margin-left: auto;
1292
1313
  }
1293
1314
  `;
1294
1315
  const AttachedLinearCSS = colors => css`
@@ -1314,25 +1335,31 @@ const AttachedItemCSS = colors => css`
1314
1335
  ${bgColor(getProp(colors, 'fill/focus'))};
1315
1336
  }
1316
1337
  `;
1317
- const AttachedItemDetailCSS = css`
1338
+ const AttachedItemDetailCSS = ({
1339
+ spacing
1340
+ }) => css`
1318
1341
  ${displayFlex};
1319
1342
  ${justifyBetween};
1320
1343
  ${itemsCenter};
1321
1344
  ${parseMinHeight(24)};
1322
- ${pd([0, 2])};
1345
+ padding: ${spacing([0, 2])};
1323
1346
  `;
1324
- const AttachedItemIconInfoCSS = css`
1347
+ const AttachedItemIconInfoCSS = ({
1348
+ spacing
1349
+ }) => css`
1325
1350
  ${displayFlex};
1326
1351
  ${flexCol};
1327
1352
  ${itemsCenter};
1328
1353
  ${positionRelative};
1329
1354
  ${textCenter};
1330
- ${pd([1, 2])};
1355
+ padding: ${spacing([1, 2])};
1331
1356
  `;
1332
- const AttachmentListCSS = css`
1357
+ const AttachmentListCSS = ({
1358
+ spacing
1359
+ }) => css`
1333
1360
  ${boxBorder};
1334
- ${mgr([1.25])};
1335
- ${pd([0, 1, 2, 4])};
1361
+ margin-right: ${spacing([1.25])};
1362
+ padding: ${spacing([0, 1, 2, 4])};
1336
1363
  overflow-y: scroll;
1337
1364
  `;
1338
1365
  const AttachmentRootCSS = (isEmpty, isEnable, height, colors) => css`
@@ -1372,28 +1399,38 @@ const AttachedItemPictureImageCSS = css`
1372
1399
  ${justifyCenter};
1373
1400
  ${aspectSquare};
1374
1401
  `;
1375
- const ItemPictureInfoCSS = colors => css`
1402
+ const ItemPictureInfoCSS = ({
1403
+ colors,
1404
+ spacing
1405
+ }) => css`
1376
1406
  ${positionAbsolute};
1377
1407
  ${boxBorder};
1378
1408
  ${bottom(0)};
1379
1409
  ${left(0)};
1380
- ${pd([1, 2])};
1410
+ padding: ${spacing([1, 2])};
1381
1411
  ${bgColor(getProp(colors, 'fill/tooltip'))};
1382
1412
  ${parseWidth('100%')};
1383
1413
  `;
1384
1414
  Attachment.defaultProps = {
1415
+ allowSort: true,
1416
+ className: '',
1417
+ data: [],
1385
1418
  deleteNotifyText: getGlobal('deleteNotifyText'),
1419
+ disabled: false,
1420
+ height: 280,
1386
1421
  hintText: getGlobal('dropFileHere'),
1387
1422
  label: getGlobal('attachText'),
1388
1423
  maxSize: getGlobal('maxSizeUpload'),
1424
+ maxFile: Infinity,
1425
+ multiple: true,
1426
+ style: {},
1389
1427
  uploadErrorInfo: {
1390
1428
  maxFile: getGlobal(['errorDefault', 'maxFile']),
1391
1429
  maxSize: getGlobal(['errorDefault', 'maxSize']),
1392
1430
  fileType: getGlobal(['errorDefault', 'fileType']),
1393
1431
  existingFile: getGlobal(['errorDefault', 'existingFile'])
1394
1432
  },
1395
- height: 280,
1396
- ...getGlobal(['components', 'attachment', 'defaultProps'])
1433
+ viewType: 'detail'
1397
1434
  };
1398
1435
  Attachment.propTypes = {
1399
1436
  /** File types that can be accepted. */
@@ -1402,17 +1439,17 @@ Attachment.propTypes = {
1402
1439
  allowSort: PropTypes.bool,
1403
1440
  /** Class for component. */
1404
1441
  className: PropTypes.string,
1405
- /** List attachment:<br />
1406
- * [{<br />
1407
- * &nbsp;&nbsp;&nbsp;&nbsp;"AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
1408
- * &nbsp;&nbsp;&nbsp;&nbsp;"URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
1409
- * &nbsp;&nbsp;&nbsp;&nbsp;"FileName": "8a07bee1eeff17a14eee.jpg",<br />
1410
- * &nbsp;&nbsp;&nbsp;&nbsp;"FileSize": 248837,<br />
1411
- * &nbsp;&nbsp;&nbsp;&nbsp;"KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
1412
- * &nbsp;&nbsp;&nbsp;&nbsp;"CreateUserID": "LEMONADMIN",<br />
1413
- * &nbsp;&nbsp;&nbsp;&nbsp;"CreateDate": "2020-08-24T11:54:04.307Z",<br />
1414
- * &nbsp;&nbsp;&nbsp;&nbsp;"UserName": "Quản trị hệ thống"<br />
1415
- * }, ...]
1442
+ /** List attachment:<br />
1443
+ * [{<br />
1444
+ * &nbsp;&nbsp;&nbsp;&nbsp;"AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
1445
+ * &nbsp;&nbsp;&nbsp;&nbsp;"URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
1446
+ * &nbsp;&nbsp;&nbsp;&nbsp;"FileName": "8a07bee1eeff17a14eee.jpg",<br />
1447
+ * &nbsp;&nbsp;&nbsp;&nbsp;"FileSize": 248837,<br />
1448
+ * &nbsp;&nbsp;&nbsp;&nbsp;"KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
1449
+ * &nbsp;&nbsp;&nbsp;&nbsp;"CreateUserID": "LEMONADMIN",<br />
1450
+ * &nbsp;&nbsp;&nbsp;&nbsp;"CreateDate": "2020-08-24T11:54:04.307Z",<br />
1451
+ * &nbsp;&nbsp;&nbsp;&nbsp;"UserName": "Quản trị hệ thống"<br />
1452
+ * }, ...]
1416
1453
  */
1417
1454
  data: PropTypes.array,
1418
1455
  /** The message to display when deleting files. */
@@ -1443,16 +1480,16 @@ Attachment.propTypes = {
1443
1480
  onChange: PropTypes.func,
1444
1481
  /** Download attached event, if not it will use default. */
1445
1482
  onDownload: PropTypes.func,
1446
- /**
1447
- * event when removed file(s)
1448
- *
1449
- * return data: {<br/>
1450
- * &nbsp;&nbsp;&nbsp;&nbsp;attached: [Files] (insist old and all new files )<br/>
1451
- * &nbsp;&nbsp;&nbsp;&nbsp;allNewAttached: [Files]<br/>
1452
- * &nbsp;&nbsp;&nbsp;&nbsp;oldAttached: [Files]<br/>
1453
- * &nbsp;&nbsp;&nbsp;&nbsp;removedAttached: [Files]<br/>
1454
- * &nbsp;&nbsp;&nbsp;&nbsp;element: [NodeList (just removed)]<br/>
1455
- * }
1483
+ /**
1484
+ * event when removed file(s)
1485
+ *
1486
+ * return data: {<br/>
1487
+ * &nbsp;&nbsp;&nbsp;&nbsp;attached: [Files] (insist old and all new files )<br/>
1488
+ * &nbsp;&nbsp;&nbsp;&nbsp;allNewAttached: [Files]<br/>
1489
+ * &nbsp;&nbsp;&nbsp;&nbsp;oldAttached: [Files]<br/>
1490
+ * &nbsp;&nbsp;&nbsp;&nbsp;removedAttached: [Files]<br/>
1491
+ * &nbsp;&nbsp;&nbsp;&nbsp;element: [NodeList (just removed)]<br/>
1492
+ * }
1456
1493
  */
1457
1494
  onRemove: PropTypes.func,
1458
1495
  /** View attached event, if not it will use default. */