diginet-core-ui 1.3.90-beta.6 → 1.3.91

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.
@@ -1301,8 +1301,7 @@ Attachment.defaultProps = {
1301
1301
  maxSize: getGlobal(['errorDefault', 'maxSize']),
1302
1302
  fileType: getGlobal(['errorDefault', 'fileType']),
1303
1303
  existingFile: getGlobal(['errorDefault', 'existingFile'])
1304
- },
1305
- viewType: 'detail'
1304
+ }
1306
1305
  };
1307
1306
  Attachment.propTypes = {
1308
1307
  /** File types that can be accepted. */
@@ -61,80 +61,78 @@ const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) =>
61
61
  padding: 0;
62
62
  table-layout: fixed;
63
63
  .${unique.table.data} {
64
- &:not(.empty) {
65
- ${cursorPointer};
66
- ${positionRelative};
67
- ${textCenter};
68
- ${userSelectNone};
69
- ${textColor('text.main')};
70
- &:nth-of-type(7n - 1) {
71
- ${textColor('info8')};
72
- }
73
- &:nth-of-type(7n) {
74
- ${textColor('danger8')};
75
- }
76
- &.next_month,
77
- &.previous_month,
78
- &.${unique.day.limit} {
79
- opacity: 0.25;
80
- }
81
- &.${unique.day.limit} {
82
- ${pointerEventsNone};
83
- ${cursorDefault};
84
- }
85
- &:hover {
86
- span.${unique.day.day} {
87
- ${bgColor('fill.hover')};
88
- }
64
+ ${cursorPointer};
65
+ ${positionRelative};
66
+ ${textCenter};
67
+ ${userSelectNone};
68
+ ${textColor('text.main')};
69
+ &:nth-of-type(7n - 1) {
70
+ ${textColor('info8')};
71
+ }
72
+ &:nth-of-type(7n) {
73
+ ${textColor('danger8')};
74
+ }
75
+ &.next_month,
76
+ &.previous_month,
77
+ &.${unique.day.limit} {
78
+ opacity: 0.25;
79
+ }
80
+ &.${unique.day.limit} {
81
+ ${pointerEventsNone};
82
+ ${cursorDefault};
83
+ }
84
+ &:hover {
85
+ span.${unique.day.day} {
86
+ ${bgColor('fill.hover')};
89
87
  }
90
- ${onClickActive && css`
91
- &:active {
92
- span.${unique.day.day} {
93
- ${bgColor('fill.pressed')};
94
- }
95
- }
96
- `}
97
- &.${unique.day.active} {
88
+ }
89
+ ${onClickActive && css`
90
+ &:active {
98
91
  span.${unique.day.day} {
99
- ${bgColor('fill.focus')};
92
+ ${bgColor('fill.pressed')};
100
93
  }
101
94
  }
102
- &.${unique.day.today} {
103
- span {
104
- ${boxBorder};
105
- ${border(1, 'system.active')};
106
- }
95
+ `}
96
+ &.${unique.day.active} {
97
+ span.${unique.day.day} {
98
+ ${bgColor('fill.focus')};
107
99
  }
108
- &.${unique.day.between} {
109
- opacity: 1;
110
- &::before {
111
- ${bgColor('fill.hover')};
112
- }
100
+ }
101
+ &.${unique.day.today} {
102
+ span {
103
+ ${boxBorder};
104
+ ${border(1, 'system.active')};
113
105
  }
114
- &.${unique.day.from} {
115
- opacity: 1;
116
- &::before {
117
- ${bgColor('fill.hover')};
118
- border-bottom-left-radius: 12px;
119
- border-top-left-radius: 12px;
120
- left: calc((100% - 24px) / 2);
121
- }
106
+ }
107
+ &.${unique.day.between} {
108
+ opacity: 1;
109
+ &::before {
110
+ ${bgColor('fill.hover')};
122
111
  }
123
- &.${unique.day.to} {
124
- opacity: 1;
125
- &::before {
126
- ${bgColor('fill.hover')};
127
- border-bottom-right-radius: 12px;
128
- border-top-right-radius: 12px;
129
- right: calc((100% - 24px) / 2);
130
- }
112
+ }
113
+ &.${unique.day.from} {
114
+ opacity: 1;
115
+ &::before {
116
+ ${bgColor('fill.hover')};
117
+ border-bottom-left-radius: 12px;
118
+ border-top-left-radius: 12px;
119
+ left: calc((100% - 24px) / 2);
131
120
  }
132
- ::before {
133
- ${positionAbsolute};
134
- ${inset('1px -2px')};
135
- content: '';
121
+ }
122
+ &.${unique.day.to} {
123
+ opacity: 1;
124
+ &::before {
125
+ ${bgColor('fill.hover')};
126
+ border-bottom-right-radius: 12px;
127
+ border-top-right-radius: 12px;
128
+ right: calc((100% - 24px) / 2);
136
129
  }
137
130
  }
131
+ ::before {
132
+ ${positionAbsolute};
133
+ ${inset('1px -2px')};
134
+ content: '';
135
+ }
138
136
  }
139
137
  .${unique.table.header} {
140
138
  ${userSelectNone};
@@ -7,12 +7,17 @@ import locale from "../../../locale";
7
7
  import PropTypes from 'prop-types';
8
8
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
9
9
  import { render } from 'react-dom';
10
- import { bgColor, borderRadius4px, cursorPointer, displayBlock, displayFlex, displayNone, flexCol, flexRow, justifyEnd, left, mg, parseHeight, parseMaxWidth, parseMinWidth, parseWidthHeight, pd, pointerEventsNone, positionFixed, textCenter, top, userSelectNone, whiteSpaceNoWrap } from "../../../styles/general";
10
+ import { itemsCenter, borderRadius4px, cursorPointer, displayBlock, displayNone, flexCol, flexRow, justifyEnd, parseHeight, parseMaxWidth, parseMinWidth, parseWidth, parseWidthHeight, pointerEventsNone, positionFixed, textCenter, userSelectNone, whiteSpaceNoWrap } from "../../../styles/general";
11
11
  import { useTheme } from "../../../theme";
12
12
  import { capitalizeSentenceCase, classNames, date as moment, isEqual, randomString, updatePosition } from "../../../utils";
13
13
  import { generateCalendarCSS, onUpdateNavigator, renderHeader, renderNavigator } from "../calendar/function";
14
14
  import ControlComp from "../control";
15
15
  const {
16
+ colors: {
17
+ system: {
18
+ white: systemWhite
19
+ }
20
+ },
16
21
  boxShadows: {
17
22
  large: boxShadowsLarge
18
23
  },
@@ -255,7 +260,7 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
255
260
  tableData.push(jsx("td", {
256
261
  key: `previous_month-${prevDate - i + 1}`,
257
262
  "data-time": day - 1,
258
- className: classNames(unique.table.data, 'previous_month', isBetween(day - 1), 'empty')
263
+ className: classNames(unique.table.data, 'previous_month', isBetween(day - 1))
259
264
  }, jsx("span", {
260
265
  className: unique.day.day
261
266
  })));
@@ -295,7 +300,7 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
295
300
  tableData.push(jsx("td", {
296
301
  key: `next_month-${i + 1}`,
297
302
  "data-time": i < 6 - weekDateLast && day + 1,
298
- className: classNames(unique.table.data, 'next_month', i < 6 - weekDateLast && isBetween(day + 1), 'empty')
303
+ className: classNames(unique.table.data, 'next_month', i < 6 - weekDateLast && isBetween(day + 1))
299
304
  }, jsx("span", {
300
305
  className: unique.day.day
301
306
  })));
@@ -806,11 +811,32 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
806
811
  if (ipRef.current.value !== '') {
807
812
  update(values.current);
808
813
  }
814
+ // if (disabled) {
815
+ // iconRef.current.childNodes[0].style.pointerEvents = 'none';
816
+ // closePicker();
817
+ // } else if (!readOnly) {
818
+ // ipRef.current.addEventListener('focus', onInputFocus);
819
+ // } else {
820
+ // iconRef.current.childNodes[0].style.pointerEvents = 'none';
821
+ // closePicker();
822
+ // }
823
+
809
824
  if (isEnable) {
825
+ // iconRef.current.childNodes[0].style.pointerEvents = 'none';
810
826
  closePicker();
811
827
  }
812
828
  return () => {
813
829
  if (!iconRef.current || !ipRef.current) return;
830
+ // if (disabled) {
831
+ // iconRef.current.childNodes[0].style.pointerEvents = null;
832
+ // } else if (!readOnly) {
833
+ // ipRef.current.removeEventListener('focus', onInputFocus);
834
+ // } else {
835
+ // iconRef.current.childNodes[0].style.pointerEvents = null;
836
+ // }
837
+ // if (isEnable) {
838
+ // iconRef.current.childNodes[0].style.pointerEvents = null;
839
+ // }
814
840
  closePicker();
815
841
  };
816
842
  }, [actionIconAt, clearAble, controls, disabled, displayFormat, max, min, pressESCToClose, readOnly, startFromZero, unitCount, viewType]);
@@ -835,7 +861,7 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
835
861
  onClick: triggerFocus,
836
862
  className: `${unique.icon} ${unique.icon}-accept`,
837
863
  viewBox: true,
838
- name: 'Calendar'
864
+ name: 'CalendarNew'
839
865
  }), jsx(ButtonIcon, {
840
866
  viewType: 'ghost',
841
867
  onClick: onClear,
@@ -885,7 +911,7 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
885
911
  className: unique.tooltip,
886
912
  ref: tooltipRef
887
913
  }, jsx(Typography, {
888
- color: 'system.white',
914
+ color: systemWhite,
889
915
  type: 'p2'
890
916
  }));
891
917
  const pickerComp = jsx("div", {
@@ -995,6 +1021,13 @@ const buttonProps = {
995
1021
  }
996
1022
  };
997
1023
  const IconAreaCSS = css`
1024
+ ${flexRow};
1025
+ ${itemsCenter};
1026
+ ${parseWidth(24)};
1027
+ color: inherit;
1028
+ & span {
1029
+ padding: 0;
1030
+ }
998
1031
  .${unique.icon} {
999
1032
  ${displayNone};
1000
1033
  ${cursorPointer};
@@ -1008,10 +1041,9 @@ const IconAreaCSS = css`
1008
1041
  }
1009
1042
  `;
1010
1043
  const ControlContainerCSS = css`
1011
- ${displayFlex};
1012
1044
  ${flexRow};
1013
1045
  ${justifyEnd};
1014
- ${mg([0, 4, 4])};
1046
+ margin: ${spacing([0, 4, 4])};
1015
1047
  `;
1016
1048
  const pickerCSS = {
1017
1049
  backGr: `
@@ -1020,13 +1052,11 @@ const pickerCSS = {
1020
1052
  position: fixed;
1021
1053
  z-index: ${zIndexCORE(1)};`,
1022
1054
  container: css`
1023
- ${displayFlex};
1024
1055
  ${flexCol};
1025
1056
  ${borderRadius4px};
1026
- ${bgColor('system.white')};
1057
+ background-color: ${systemWhite};
1027
1058
  box-shadow: ${boxShadowsLarge};
1028
1059
  .${unique.wrapper} {
1029
- ${displayFlex};
1030
1060
  ${flexRow};
1031
1061
  ${parseMinWidth(633)};
1032
1062
  }
@@ -1039,8 +1069,8 @@ const pickerCSS = {
1039
1069
  ${whiteSpaceNoWrap};
1040
1070
  ${parseHeight(18)};
1041
1071
  ${parseMinWidth(65)};
1042
- ${bgColor('rgba(21, 26, 48, 0.9)')};
1043
- ${pd([0.75, 1.5])};
1072
+ background-color: rgba(21, 26, 48, 0.9);
1073
+ padding: ${spacing([0.75, 1.5])};
1044
1074
  transition: left 0.05s ease-in, top 0.05s ease-in;
1045
1075
  vertical-align: middle;
1046
1076
  visibility: hidden;
@@ -1050,8 +1080,7 @@ const pickerCSS = {
1050
1080
  @media only screen and (max-width: 599px) {
1051
1081
  ${parseMaxWidth(400)};
1052
1082
  .${unique.wrapper} {
1053
- ${displayFlex};
1054
- ${flexCol};
1083
+ flex-direction: column;
1055
1084
  ${parseMinWidth(260)};
1056
1085
  }
1057
1086
  .${unique.divider} {
@@ -1067,8 +1096,8 @@ const pickerCSS = {
1067
1096
  ${parseWidthHeight(width, 'max-content')};
1068
1097
  ${parseMinWidth(window.innerWidth <= 633 ? 300 : 633)};
1069
1098
  ${parseMaxWidth(805)};
1070
- ${top(position.top)};
1071
- ${left(position.left)};
1099
+ top: ${position.top}px;
1100
+ left: ${position.left}px;
1072
1101
  opacity: 0;
1073
1102
  transform: scale(0);
1074
1103
  transform-origin: ${position.transformOrigin};
@@ -1109,6 +1138,8 @@ DateRangePicker.propTypes = {
1109
1138
  clearAble: PropTypes.bool,
1110
1139
  /** If `true`, the calendar will have a footer controls. */
1111
1140
  controls: PropTypes.bool,
1141
+ /** The count unit when select. */
1142
+ unitCount: PropTypes.oneOf(['day', 'night']),
1112
1143
  /** Default value of the component. */
1113
1144
  defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.instanceOf(Date)), PropTypes.arrayOf(PropTypes.string)]),
1114
1145
  /** If `true`, the component is disabled. */
@@ -1127,10 +1158,10 @@ DateRangePicker.propTypes = {
1127
1158
  label: PropTypes.string,
1128
1159
  /** [Props](https://core.diginet.com.vn/ui/?path=/docs/form-control-text-label--simple) of label. */
1129
1160
  labelProps: PropTypes.object,
1130
- /** Max value of date picker. */
1131
- max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),
1132
1161
  /** Min value of date picker. */
1133
1162
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),
1163
+ /** Max value of date picker. */
1164
+ max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),
1134
1165
  /** Callback fired when the value is changed. */
1135
1166
  onChange: PropTypes.func,
1136
1167
  /** The short hint displayed in the input before the user enters a value. */
@@ -1151,8 +1182,6 @@ DateRangePicker.propTypes = {
1151
1182
  style: PropTypes.object,
1152
1183
  /** Text align of the input. */
1153
1184
  textAlign: PropTypes.oneOf(['center', 'end', 'start']),
1154
- /** The count unit when select. */
1155
- unitCount: PropTypes.oneOf(['day', 'night']),
1156
1185
  /** The value of the input element, required for a controlled component. String must be [Date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date): YYYY/MM/DD, MM/DD/YYYY,...*/
1157
1186
  value: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string])),
1158
1187
  /** The variant to use. */
@@ -6,18 +6,29 @@ 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, 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";
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";
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,
15
18
  white: systemWhite
16
19
  },
20
+ semantic: {
21
+ danger: semanticDanger
22
+ },
17
23
  fill: {
24
+ hover: fillHover,
18
25
  'scrollbar-tabbar': fillScrollbar
19
26
  },
27
+ line: {
28
+ focus: lineFocus
29
+ },
20
30
  text: {
31
+ main: textMain,
21
32
  sub: textSub
22
33
  }
23
34
  },
@@ -1178,17 +1189,16 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1178
1189
  return false;
1179
1190
  }
1180
1191
  }
1181
- }) : jsx("div", {
1182
- css: _DropdownInputCSS,
1183
- onClick: onClickInput
1184
- }, jsx(Typography, {
1192
+ }) : jsx(Fragment, null, jsx(Typography, {
1185
1193
  ref: inputRef,
1194
+ css: _DropdownInputCSS,
1186
1195
  hoverTooltip: true,
1187
1196
  lineClamp: multilineSelectedItem ? undefined : 1,
1188
1197
  type: 'p1',
1189
1198
  style: {
1190
1199
  lineHeight: multiple ? '30px' : '24px'
1191
1200
  },
1201
+ onClick: onClickInput,
1192
1202
  tabIndex: -1
1193
1203
  }, textValue))), jsx("div", {
1194
1204
  ref: iconRef,
@@ -1246,7 +1256,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
1246
1256
  ${paragraph1};
1247
1257
  ${disabled ? cursorNotAllowed : readOnly ? cursorDefault : cursorPointer};
1248
1258
  ${parseWidth('100%')};
1249
- ${textColor('text.main')};
1259
+ color: ${textMain};
1250
1260
  ${pdt(0)};
1251
1261
  ${pdb([viewType !== 'outlined' ? 0 : 'inherit'])};
1252
1262
  ${pdl([viewType !== 'outlined' ? 0 : 4])};
@@ -1267,7 +1277,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
1267
1277
  ${itemsCenter};
1268
1278
  ${justifyCenter};
1269
1279
  content: '${placeholder}';
1270
- ${textColor('text.sub')};
1280
+ color: ${textSub};
1271
1281
  }
1272
1282
  &:not(:empty)::after {
1273
1283
  visibility: hidden;
@@ -1286,7 +1296,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
1286
1296
  }
1287
1297
  }
1288
1298
  .DGN-UI-Typography {
1289
- ${disabled && textColor('system.disabled')};
1299
+ ${disabled && `color: ${systemDisabled}`};
1290
1300
  }
1291
1301
  `;
1292
1302
  const IconCSS = viewType => css`
@@ -1303,24 +1313,24 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
1303
1313
  ${boxBorder};
1304
1314
  ${parseWidth('100%')};
1305
1315
  ${pdy([multiple ? 0.25 : 1])};
1306
- ${!disabled && css`
1307
- &:not(:focus-within):hover {
1308
- &::before {
1309
- ${borderBottomColor('system.active')};
1310
- }
1311
- .css-${DropdownInputCSSName} {
1312
- ${textColor('system.active')};
1313
- }
1314
- }
1316
+ ${!disabled && `
1317
+ &:not(:focus-within):hover {
1318
+ &::before {
1319
+ border-bottom-color: ${systemActive};
1320
+ }
1321
+ .css-${DropdownInputCSSName} {
1322
+ color: ${systemActive};
1323
+ }
1324
+ }
1315
1325
  `}
1316
1326
  &:focus-within {
1317
- ${borderBottomColor('line.focus')};
1327
+ border-bottom-color: ${lineFocus};
1318
1328
  &::after {
1319
- ${borderBottomColor('inherit')};
1329
+ border-bottom-color: inherit;
1320
1330
  transform: scaleX(1);
1321
1331
  }
1322
1332
  .css-${DropdownInputCSSName} {
1323
- ${textColor('system.active')};
1333
+ color: ${systemActive};
1324
1334
  }
1325
1335
  }
1326
1336
  &.dropdown-showing {
@@ -1332,27 +1342,27 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
1332
1342
  content: '${placeholder}';
1333
1343
  ${parseHeight('100%')};
1334
1344
  ${overflowHidden};
1335
- ${textColor('text.sub')};
1345
+ color: ${textSub};
1336
1346
  display: -webkit-box;
1337
1347
  -webkit-line-clamp: 1;
1338
1348
  -webkit-box-orient: vertical;
1339
1349
  }
1340
1350
  &::placeholder {
1341
- ${textColor('text.sub')};
1351
+ color: ${textSub};
1342
1352
  }
1343
1353
  &::before {
1344
1354
  ${positionAbsolute};
1345
1355
  content: '';
1346
1356
  ${insetX(0)};
1347
1357
  bottom: 0;
1348
- ${viewType === 'underlined' && borderBottom(1, disabled ? 'system.disabled' : 'system.rest')}
1358
+ ${viewType === 'underlined' && `border-bottom: 1px solid ${disabled ? systemDisabled : systemRest};`}
1349
1359
  }
1350
1360
  &::after {
1351
1361
  ${positionAbsolute};
1352
1362
  content: '';
1353
1363
  ${insetX(0)};
1354
1364
  bottom: -1px;
1355
- ${borderBottom(2, 'transparent')};
1365
+ border-bottom: 2px solid transparent;
1356
1366
  transform: scaleX(0);
1357
1367
  transform-origin: center;
1358
1368
  transition: all 0.2s ease;
@@ -1364,21 +1374,21 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
1364
1374
  ${positionRelative};
1365
1375
  ${borderRadius4px};
1366
1376
  ${boxBorder};
1367
- ${border(1, disabled ? 'system.disabled' : 'system.rest')};
1377
+ ${border(1, disabled ? systemDisabled : systemRest)};
1368
1378
  ${parseWidth('100%')};
1369
1379
  ${parseMinHeight(40)};
1370
1380
  ${mgt([0.5])};
1371
- ${!disabled && css`
1372
- &:not(:focus-within):hover {
1373
- ${bgColor('fill.hover')};
1374
- ${borderColor('system.active')};
1375
- input {
1376
- ${bgColor('fill.hover')};
1377
- }
1378
- }
1381
+ ${!disabled && `
1382
+ &:not(:focus-within):hover {
1383
+ ${bgColor(fillHover)};
1384
+ border-color: ${systemActive};
1385
+ input {
1386
+ ${bgColor(fillHover)};
1387
+ }
1388
+ }
1379
1389
  `}
1380
1390
  &:focus-within {
1381
- ${borderColor('line.focus')};
1391
+ border-color: ${lineFocus};
1382
1392
  }
1383
1393
  &.dropdown-showing {
1384
1394
  .icon-dropdown {
@@ -1389,13 +1399,13 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
1389
1399
  content: '${placeholder}';
1390
1400
  ${parseHeight('100%')};
1391
1401
  ${overflowHidden};
1392
- ${textColor('text.sub')};
1402
+ color: ${textSub};
1393
1403
  display: -webkit-box;
1394
1404
  -webkit-line-clamp: 1;
1395
1405
  -webkit-box-orient: vertical;
1396
1406
  }
1397
1407
  &::placeholder {
1398
- ${textColor('text.sub')};
1408
+ color: ${textSub};
1399
1409
  }
1400
1410
  &::after {
1401
1411
  ${positionAbsolute};
@@ -1414,7 +1424,7 @@ const DropdownListCSS = loading => css`
1414
1424
  ${parseWidth('100%')};
1415
1425
  ${parseMaxHeight(280)};
1416
1426
  ${loading ? overflowHidden : overflowAuto};
1417
- ${bgColor('system.white')};
1427
+ ${bgColor(systemWhite)};
1418
1428
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
1419
1429
  ${z(1)};
1420
1430
  &::-webkit-scrollbar {
@@ -1444,19 +1454,19 @@ const DropdownItemCSS = (multiple, selectBox) => css`
1444
1454
  ${userSelectNone};
1445
1455
  ${parseMinHeight(40)};
1446
1456
  ${parseWidth('100%')};
1447
- ${bgColor('system.white')};
1457
+ ${bgColor(systemWhite)};
1448
1458
  ${pd([2, multiple && selectBox ? 0 : 4])};
1449
- ${textColor('text.main')};
1459
+ color: ${textMain};
1450
1460
  &.no-data {
1451
1461
  ${justifyCenter};
1452
1462
  ${cursorDefault};
1453
- ${italic};
1463
+ font-style: italic;
1454
1464
  }
1455
1465
  &:not(.no-data):hover,
1456
1466
  &:not(.no-data):focus {
1457
1467
  ${outlineNone};
1458
- ${bgColor('fill.hover')};
1459
- ${textColor('system.active')};
1468
+ ${bgColor(fillHover)};
1469
+ color: ${systemActive};
1460
1470
  }
1461
1471
  `;
1462
1472
  const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
@@ -1466,21 +1476,21 @@ const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
1466
1476
  ${parseHeight('max-content')};
1467
1477
  &.error {
1468
1478
  .css-${DropdownFormCSSName} {
1469
- ${borderColor('semantic.danger')};
1479
+ border-color: ${semanticDanger};
1470
1480
  path {
1471
- ${fill('semantic.danger')};
1481
+ fill: ${semanticDanger};
1472
1482
  }
1473
1483
  &::before {
1474
- ${borderColor('semantic.danger')};
1484
+ border-color: ${semanticDanger};
1475
1485
  }
1476
1486
  }
1477
1487
  }
1478
1488
  &.dgn-dropdown-loading,
1479
1489
  &.disabled {
1480
1490
  .css-${DropdownFormCSSName} {
1481
- ${borderColor('system.disabled')};
1491
+ border-color: ${systemDisabled};
1482
1492
  &::before {
1483
- ${borderColor('system.disabled')};
1493
+ border-color: ${systemDisabled};
1484
1494
  }
1485
1495
  }
1486
1496
  }
@@ -1497,11 +1507,10 @@ const DropdownCSS = (top, left, width, isMobile, allowSearch) => css`
1497
1507
  ${parseWidth(width)};
1498
1508
  top: ${top}px;
1499
1509
  left: ${left}px;
1500
- ${bgColor('system.white')};
1510
+ ${bgColor(systemWhite)};
1501
1511
  ${z(1)};
1502
- ${isMobile && allowSearch && css`
1512
+ ${isMobile && allowSearch && `
1503
1513
  ${parseHeight('max-content')};
1504
- ${displayFlex};
1505
1514
  ${flexColReverse};
1506
1515
  bottom: 0;
1507
1516
  top: auto;
@@ -126,7 +126,6 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
126
126
  height,
127
127
  marginThreshold,
128
128
  onClose,
129
- onOpen,
130
129
  open,
131
130
  pressESCToClose,
132
131
  style,
@@ -154,7 +153,6 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
154
153
  }
155
154
  const onOpenPopover = () => {
156
155
  if (!openState) setOpenState(true);
157
- onOpen && onOpen();
158
156
  };
159
157
  const onClosePopover = () => {
160
158
  if (openState) {
@@ -590,8 +588,6 @@ Popover.propTypes = {
590
588
  marginThreshold: PropTypes.number,
591
589
  /** Callback fired when the component requests to be closed. */
592
590
  onClose: PropTypes.func,
593
- /** Callback fired when the component requests to be opened. */
594
- onOpen: PropTypes.func,
595
591
  /** If `true`, the component is shown. */
596
592
  open: PropTypes.bool,
597
593
  /** If `true`, hitting escape will close component. */
package/package.json CHANGED
@@ -1,73 +1,42 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.3.90-beta.6",
4
- "description": "",
3
+ "version": "1.3.91",
4
+ "description": "The DigiNet core ui",
5
+ "homepage": "https://diginet.com.vn",
5
6
  "main": "index.js",
6
- "license": "UNLICENSED",
7
7
  "scripts": {
8
- "start": "npm-run-all --parallel start-sb eslint-test",
9
- "start-sb": "start-storybook -p 9050",
10
- "build-storybook": "build-storybook -c .storybook -s src",
11
- "build": "run-script-os",
12
- "build:windows": "rimraf dist && mkdirp dist/components && npm run compile && sass --style=compressed src/scss:dist/css && xcopy src\\\\assets dist\\\\assets\\ /e /y",
13
- "build:darwin:linux:default": "rm -rf dist && npm run compile && sass --style=compressed src/scss:dist/css && cp -rf src/assets dist/assets",
14
- "compile": "babel src --out-dir dist --ignore **/*.stories.js",
15
- "pack": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm pack",
16
- "production-keep-version": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish",
17
- "beta": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish --tag beta",
18
- "production": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm publish",
19
- "version:add": "run-script-os",
20
- "version:add:windows": "cat package.json.tmp | sed \"s/0.0.0/%npm_package_version%/g\" > dist/package.json",
21
- "version:add:darwin:linux:default": "VERSION=$(npm run version:extract --silent) && cat package.json.tmp | sed \"s/0.0.0/${VERSION}/g\" > dist/package.json",
22
- "version:bump": "npm version patch --no-git-tag-version --silent",
23
- "version:extract": "cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'",
24
- "test": "echo \"Error: no test specified\" && exit 1",
25
- "lint": "eslint --fix --config .eslintrc.js \"**/*.js\"",
26
- "eslint-test": "onchange \"src/**/*.{js,jsx,json}\" -- eslint . --fix",
27
- "test-storybook": "test-storybook --url http://localhost:9050"
8
+ "start-js": "react-scripts start --max_old_space_size=4096",
9
+ "start": "npx npm-run-all -p start-js",
10
+ "build": "GENERATE_SOURCEMAP=false && react-scripts build --env=production --max_old_space_size=8192",
11
+ "eject": "react-scripts eject",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
28
13
  },
29
14
  "dependencies": {
30
15
  "@emotion/core": "^10.0.35",
31
- "babel-plugin-module-resolver": "^4.1.0",
32
16
  "prop-types": "^15.7.2"
33
17
  },
34
- "lint-staged": {
35
- "*/**/*.{js,jsx,json}": [
36
- "prettier --write",
37
- "git add"
38
- ]
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://diginetvn@bitbucket.org/diginetvn/diginet-core-ui.git"
39
21
  },
40
- "devDependencies": {
41
- "@babel/cli": "^7.14.3",
42
- "@babel/plugin-proposal-class-properties": "^7.13.0",
43
- "@babel/plugin-proposal-logical-assignment-operators": "^7.16.0",
44
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
45
- "@babel/plugin-proposal-optional-chaining": "^7.14.2",
46
- "@babel/plugin-proposal-private-methods": "^7.18.6",
47
- "@babel/plugin-proposal-private-property-in-object": "^7.18.6",
48
- "@babel/preset-react": "^7.13.13",
49
- "@storybook/addon-actions": "6.2.9",
50
- "@storybook/addon-essentials": "6.2.9",
51
- "@storybook/addon-links": "6.2.9",
52
- "@storybook/addon-postcss": "^2.0.0",
53
- "@storybook/react": "6.2.9",
54
- "@storybook/test-runner": "^0.7.1",
55
- "autoprefixer": "^10.3.1",
56
- "babel-loader": "^8.2.2",
57
- "eslint": "^8.4.1",
58
- "eslint-plugin-react": "^7.27.1",
59
- "eslint-plugin-regex": "^1.10.0",
60
- "husky": "^7.0.4",
61
- "jest": "^27.5.1",
62
- "lint-staged": "^12.1.2",
63
- "mkdirp": "^1.0.4",
64
- "npm-run-all": "^4.1.5",
65
- "onchange": "^7.1.0",
66
- "postcss-flexbugs-fixes": "^5.0.2",
67
- "react": "^17.0.1",
68
- "react-dom": "^17.0.1",
69
- "rimraf": "^3.0.2",
70
- "run-script-os": "^1.1.6",
71
- "sass": "^1.37.0"
72
- }
22
+ "keywords": [
23
+ "core ui",
24
+ "diginet"
25
+ ],
26
+ "author": "rocachien",
27
+ "contributors": [
28
+ {
29
+ "name": "Chien Do",
30
+ "email": "rocachien@gmail.com"
31
+ },
32
+ {
33
+ "name": "Nhat Tran",
34
+ "email": "tranminhnhat1005@gmail.com"
35
+ },
36
+ {
37
+ "name": "Thuan Nguyen",
38
+ "email": "nt.thuan.hutech@gmail.com"
39
+ }
40
+ ],
41
+ "license": "MIT"
73
42
  }
package/readme.md CHANGED
@@ -38,6 +38,16 @@ npm test
38
38
  ```
39
39
 
40
40
  ## Changelog
41
+ ## 1.3.91
42
+ - \[Changed\]: TreeView – Optimize code
43
+ - \[Changed\]: Popup – Add defaultProps description
44
+ - \[Changed\]: Grid – Add sx prop handle responsive css display
45
+ - \[Changed\]: ButtonMore – Export component ButtonMore
46
+ - \[Changed\]: DateRangePicker – Add description for prop value
47
+ - \[Fixed\]: Avatar – Fix bug not clear avatar when src null
48
+ - \[Fixed\]: Typography – Add min-width to popover hover tooltip
49
+ - \[Fixed\]: DatePicker – Fix disabled button previous month in navigator
50
+
41
51
  ## 1.3.90
42
52
  - \[Added\]: Breadcrumb – Add component Breadcrumb
43
53
  - \[Added\]: Icon – Question, Pause, Cake, ChatAnswer