diginet-core-ui 1.3.79 → 1.3.80

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 (158) hide show
  1. package/components/accordion/css.js +2 -2
  2. package/components/accordion/details.js +3 -3
  3. package/components/accordion/group.js +3 -3
  4. package/components/accordion/index.js +5 -5
  5. package/components/accordion/summary.js +4 -4
  6. package/components/alert/index.js +8 -8
  7. package/components/alert/notify.js +4 -4
  8. package/components/avatar/index.js +11 -12
  9. package/components/badge/index.js +5 -5
  10. package/components/button/icon.js +9 -9
  11. package/components/button/index.js +10 -10
  12. package/components/button/more.js +181 -109
  13. package/components/button/ripple-effect.js +2 -2
  14. package/components/card/body.js +2 -2
  15. package/components/card/extra.js +2 -2
  16. package/components/card/footer.js +2 -2
  17. package/components/card/header.js +3 -3
  18. package/components/card/index.js +8 -8
  19. package/components/chart/Pie/index.js +37 -38
  20. package/components/chart/Pie-v2/Sectors.js +3 -3
  21. package/components/chart/Pie-v2/index.js +6 -6
  22. package/components/chart/bar/Bar.js +2 -2
  23. package/components/chart/bar/Labels.js +2 -3
  24. package/components/chart/bar/index.js +6 -6
  25. package/components/chart/bar-v2/Bar.js +3 -3
  26. package/components/chart/bar-v2/Labels.js +2 -3
  27. package/components/chart/bar-v2/index.js +6 -6
  28. package/components/chart/line/Labels.js +2 -3
  29. package/components/chart/line/Path.js +1 -1
  30. package/components/chart/line/Point.js +2 -2
  31. package/components/chart/line/Title.js +1 -1
  32. package/components/chart/line/index.js +6 -6
  33. package/components/chart/line-v2/Labels.js +2 -3
  34. package/components/chart/line-v2/Point.js +2 -2
  35. package/components/chart/line-v2/Title.js +1 -1
  36. package/components/chart/line-v2/index.js +6 -6
  37. package/components/check-text/index.js +2 -2
  38. package/components/check-text/interview-confirmation.js +2 -2
  39. package/components/check-text/interview-status.js +2 -2
  40. package/components/chip/attach.js +4 -4
  41. package/components/chip/index.js +5 -5
  42. package/components/collapse/index.js +1 -1
  43. package/components/divider/index.js +2 -2
  44. package/components/form-control/attachment/index.js +6 -6
  45. package/components/form-control/calendar/function.js +8 -8
  46. package/components/form-control/calendar/index.js +2 -2
  47. package/components/form-control/calendar/range.js +3 -3
  48. package/components/form-control/checkbox/index.js +5 -5
  49. package/components/form-control/control/index.js +2 -2
  50. package/components/form-control/date-picker/index.js +10 -10
  51. package/components/form-control/date-range-picker/index.js +8 -8
  52. package/components/form-control/dropdown/index.js +7 -7
  53. package/components/form-control/dropdown-box/index.js +6 -6
  54. package/components/form-control/form/index.js +1 -1
  55. package/components/form-control/form-group/index.js +1 -1
  56. package/components/form-control/helper-text/index.js +4 -4
  57. package/components/form-control/input-base/index.js +7 -7
  58. package/components/form-control/label/index.js +13 -13
  59. package/components/form-control/money-input/index.js +5 -5
  60. package/components/form-control/number-input/index.js +3 -3
  61. package/components/form-control/number-input/index2.js +36 -27
  62. package/components/form-control/phone-input/index.js +2 -2
  63. package/components/form-control/radio/index.js +4 -4
  64. package/components/form-control/text-input/index.js +4 -4
  65. package/components/form-control/time-picker/index.js +7 -7
  66. package/components/form-control/time-picker/swiper.js +1 -1
  67. package/components/form-control/toggle/index.js +4 -4
  68. package/components/form-view/helper-text.js +1 -1
  69. package/components/form-view/index.js +4 -4
  70. package/components/form-view/input.js +3 -3
  71. package/components/form-view/label.js +2 -2
  72. package/components/grid/Col.js +2 -2
  73. package/components/grid/Container.js +1 -1
  74. package/components/grid/Row.js +1 -1
  75. package/components/grid/index.js +5 -5
  76. package/components/image/index.js +5 -5
  77. package/components/index.js +83 -83
  78. package/components/list/list-item-action.js +1 -1
  79. package/components/list/list-item-icon.js +2 -2
  80. package/components/list/list-item-text.js +1 -1
  81. package/components/list/list-item.js +2 -2
  82. package/components/list/list.js +1 -1
  83. package/components/list/sub-header.js +2 -2
  84. package/components/modal/body.js +4 -4
  85. package/components/modal/footer.js +3 -3
  86. package/components/modal/header.js +5 -5
  87. package/components/modal/index.js +4 -4
  88. package/components/modal/modal.js +6 -6
  89. package/components/others/extra/index.js +2 -2
  90. package/components/others/import/index.js +1 -1
  91. package/components/others/scrollbar/index.js +1 -3
  92. package/components/paging/page-info.js +5 -5
  93. package/components/paging/page-selector.js +3 -3
  94. package/components/paging/page-selector2.js +5 -5
  95. package/components/paper/index.js +2 -2
  96. package/components/popover/body.js +4 -4
  97. package/components/popover/footer.js +4 -4
  98. package/components/popover/header.js +5 -5
  99. package/components/popover/index.js +4 -4
  100. package/components/popup/danger_popup.js +5 -5
  101. package/components/popup/index.js +6 -6
  102. package/components/popup/proposals_popup.js +5 -5
  103. package/components/popup/v2/index.js +9 -9
  104. package/components/progress/circular.js +169 -260
  105. package/components/progress/linear.js +2 -2
  106. package/components/rating/index.js +6 -6
  107. package/components/slider/slider-container.js +4 -4
  108. package/components/slider/slider-item.js +5 -5
  109. package/components/status/index.js +5 -5
  110. package/components/tab/tab-container.js +4 -4
  111. package/components/tab/tab-header.js +5 -5
  112. package/components/tab/tab-panel.js +4 -4
  113. package/components/tab/tab.js +8 -8
  114. package/components/tooltip/index.js +3 -3
  115. package/components/tooltip/portal.js +1 -1
  116. package/components/transfer/index.js +5 -5
  117. package/components/tree-view/css.js +2 -2
  118. package/components/tree-view/index.js +4 -4
  119. package/components/typography/index.js +3 -3
  120. package/global/index.js +1 -1
  121. package/icons/basic.js +1 -1
  122. package/icons/effect.js +5 -5
  123. package/icons/general/index.js +21 -21
  124. package/icons/index.js +2 -2
  125. package/icons/menu/index.js +2 -2
  126. package/icons/menu/v2/index.js +1 -1
  127. package/locale/index.js +1 -1
  128. package/package.json +1 -1
  129. package/readme.md +6 -0
  130. package/styles/animation.js +1 -1
  131. package/styles/colors.js +1 -1
  132. package/styles/font.js +3 -3
  133. package/styles/general.js +3 -2
  134. package/styles/typography.js +2 -2
  135. package/styles/utils.js +1 -1
  136. package/theme/index.js +3 -3
  137. package/theme/make-styles.js +1 -1
  138. package/theme/set-theme.js +1 -1
  139. package/theme/settings.js +6 -6
  140. package/theme/theme-provider.js +2 -2
  141. package/theme/theme.js +1 -1
  142. package/utils/array/array.js +3 -3
  143. package/utils/console.js +1 -1
  144. package/utils/date.js +2 -2
  145. package/utils/error/error.js +3 -3
  146. package/utils/error/errors.js +1 -1
  147. package/utils/handleBreakpoints.js +2 -2
  148. package/utils/index.js +28 -28
  149. package/utils/object/extend.js +1 -1
  150. package/utils/object/object.js +1 -1
  151. package/utils/render-portal.js +1 -1
  152. package/utils/renderHTML.js +1 -1
  153. package/utils/renderIcon.js +3 -3
  154. package/utils/sb-template.js +4 -4
  155. package/utils/string/capitalizeSentenceCase.js +1 -1
  156. package/utils/string/string.js +1 -1
  157. package/utils/useElementSize.js +1 -1
  158. package/utils/validate.js +2 -2
@@ -4,14 +4,14 @@ import { css, jsx } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
6
6
  import { render } from 'react-dom';
7
- import { Button, ButtonIcon, Divider, HelperText, InputBase, Label, Typography } from '../..';
8
- import { getGlobal } from '../../../global';
9
- import locale from '../../../locale';
10
- import { alignCenter, borderRadius4px, cursorPointer, displayBlock, displayNone, flexCol, flexRow, justifyEnd, parseHeight, parseMaxWidth, parseMinWidth, parseWidth, parseWidthHeight, pointerEventsNone, positionFixed, textCenter, userSelectNone, whiteSpaceNoWrap } from '../../../styles/general';
11
- import { useTheme } from '../../../theme';
12
- import { capitalizeSentenceCase, classNames, date as moment, isEqual, randomString, updatePosition } from '../../../utils';
13
- import { generateCalendarCSS, onUpdateNavigator, renderHeader, renderNavigator } from '../calendar/function';
14
- import ControlComp from '../control';
7
+ import { Button, ButtonIcon, Divider, HelperText, InputBase, Label, Typography } from "../..";
8
+ import { getGlobal } from "../../../global";
9
+ import locale from "../../../locale";
10
+ import { alignCenter, borderRadius4px, cursorPointer, displayBlock, displayNone, flexCol, flexRow, justifyEnd, parseHeight, parseMaxWidth, parseMinWidth, parseWidth, parseWidthHeight, pointerEventsNone, positionFixed, textCenter, userSelectNone, whiteSpaceNoWrap } from "../../../styles/general";
11
+ import { useTheme } from "../../../theme";
12
+ import { capitalizeSentenceCase, classNames, date as moment, isEqual, randomString, updatePosition } from "../../../utils";
13
+ import { generateCalendarCSS, onUpdateNavigator, renderHeader, renderNavigator } from "../calendar/function";
14
+ import ControlComp from "../control";
15
15
  const {
16
16
  colors: {
17
17
  system: {
@@ -5,13 +5,13 @@ import ReactDOM from 'react-dom';
5
5
  import { createPortal } from 'react-dom';
6
6
  import PropTypes from 'prop-types';
7
7
  import { jsx, css } from '@emotion/core';
8
- import { InputBase, Chip, CircularProgress, Checkbox, TreeView, HelperText, Label, ButtonIcon, Typography } from '../../';
9
- import { mapParent, randomString, updatePosition } from '../../../utils';
10
- import { getGlobal } from '../../../global';
11
- import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, breakWord, cursorPointer, displayBlock, flexColReverse, flexRow, flexWrap, justifyCenter, justifyStart, outlineNone, overflowAuto, overflowHidden, parseWidth, parseWidthHeight, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, userSelectNone } from '../../../styles/general';
12
- import isMobile from '../../../utils/isMobile';
13
- import theme from '../../../theme/settings';
14
- import Avatar from '../../avatar';
8
+ import { InputBase, Chip, CircularProgress, Checkbox, TreeView, HelperText, Label, ButtonIcon, Typography } from "../../";
9
+ import { mapParent, randomString, updatePosition } from "../../../utils";
10
+ import { getGlobal } from "../../../global";
11
+ import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, breakWord, cursorPointer, displayBlock, flexColReverse, flexRow, flexWrap, justifyCenter, justifyStart, outlineNone, overflowAuto, overflowHidden, parseWidth, parseWidthHeight, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, userSelectNone } from "../../../styles/general";
12
+ import isMobile from "../../../utils/isMobile";
13
+ import theme from "../../../theme/settings";
14
+ import Avatar from "../../avatar";
15
15
  const {
16
16
  colors: {
17
17
  system: {
@@ -4,12 +4,12 @@ import { memo, useState, useEffect, useRef, useImperativeHandle, forwardRef, Fra
4
4
  import { createPortal } from 'react-dom';
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
- import { ButtonIcon, InputBase, Label } from '../../';
8
- import { randomString } from '../../../utils';
9
- import { color as colors } from '../../../styles/colors';
10
- import { typography } from '../../../styles/typography';
11
- import { borderBox, borderRadius4px, displayBlock, positionFixed, positionRelative } from '../../../styles/general';
12
- import { useTheme } from '../../../theme';
7
+ import { ButtonIcon, InputBase, Label } from "../../";
8
+ import { randomString } from "../../../utils";
9
+ import { color as colors } from "../../../styles/colors";
10
+ import { typography } from "../../../styles/typography";
11
+ import { borderBox, borderRadius4px, displayBlock, positionFixed, positionRelative } from "../../../styles/general";
12
+ import { useTheme } from "../../../theme";
13
13
  const {
14
14
  paragraph1
15
15
  } = typography;
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/display-name */
2
2
  import React, { memo, useMemo, useRef, useEffect, forwardRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import FormContext from './context';
4
+ import FormContext from "./context";
5
5
  const Form = /*#__PURE__*/forwardRef(({
6
6
  onLoaded,
7
7
  onValidate,
@@ -3,7 +3,7 @@
3
3
  import { memo, useRef, useEffect, forwardRef, Children, useImperativeHandle } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { jsx, css } from '@emotion/core';
6
- import theme from '../../../theme/settings';
6
+ import theme from "../../../theme/settings";
7
7
  const {
8
8
  spacing
9
9
  } = theme;
@@ -3,10 +3,10 @@
3
3
  import { css, jsx } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import { forwardRef, memo, useImperativeHandle, useRef } from 'react';
6
- import { Typography } from '../../';
7
- import { getGlobal } from '../../../global';
8
- import { useTheme } from '../../../theme';
9
- import { classNames } from '../../../utils';
6
+ import { Typography } from "../../";
7
+ import { getGlobal } from "../../../global";
8
+ import { useTheme } from "../../../theme";
9
+ import { classNames } from "../../../utils";
10
10
  const {
11
11
  colors: {
12
12
  system: {
@@ -1,15 +1,15 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
3
  import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
4
- import useInput from '../../../utils/useInput';
4
+ import useInput from "../../../utils/useInput";
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
- import { getGlobal } from '../../../global';
8
- import Icon from '../../../icons';
9
- import { Typography } from '../..';
10
- import { useTheme, useColor as colors } from '../../../theme';
11
- import { classNames, refType as ref } from '../../../utils';
12
- import { alignCenter, border, borderBox, borderNone, borderRadius4px, displayBlock, flexRow, outlineNone, parseHeight, parseWidth, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative } from '../../../styles/general';
7
+ import { getGlobal } from "../../../global";
8
+ import Icon from "../../../icons";
9
+ import { Typography } from "../..";
10
+ import { useTheme, useColor as colors } from "../../../theme";
11
+ import { classNames, refType as ref } from "../../../utils";
12
+ import { alignCenter, border, borderBox, borderNone, borderRadius4px, displayBlock, flexRow, outlineNone, parseHeight, parseWidth, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative } from "../../../styles/general";
13
13
  const {
14
14
  colors: {
15
15
  system: {
@@ -1,13 +1,13 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
- import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
3
+ import { css, jsx } from '@emotion/core';
4
+ import { Typography } from "../..";
5
+ import OptionWrapper from "../../others/option-wrapper";
4
6
  import PropTypes from 'prop-types';
5
- import { jsx, css } from '@emotion/core';
6
- import OptionWrapper from '../../others/option-wrapper';
7
- import { Typography } from '../../';
8
- import { flexRow, typographyTypes } from '../../../styles/general';
9
- import { classNames } from '../../../utils';
10
- import { useTheme } from '../../../theme';
7
+ import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
8
+ import { flexRow, typographyTypes } from "../../../styles/general";
9
+ import { useTheme } from "../../../theme";
10
+ import { classNames } from "../../../utils";
11
11
  const {
12
12
  colors: {
13
13
  system: {
@@ -21,16 +21,16 @@ const {
21
21
  } = useTheme();
22
22
  const Label = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
23
23
  action = {},
24
+ children,
25
+ className,
26
+ color,
24
27
  disabled,
28
+ hoverTooltip,
29
+ id,
30
+ lineClamp,
25
31
  readOnly,
26
32
  required,
27
- className,
28
- children,
29
33
  type,
30
- lineClamp,
31
- hoverTooltip,
32
- id,
33
- color,
34
34
  ...props
35
35
  }, reference) => {
36
36
  const ref = useRef(null);
@@ -4,11 +4,11 @@
4
4
  import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
- import locale from '../../../locale';
8
- import { InputBase, Label, HelperText } from '../../';
9
- import { onValidate } from '../../../utils';
10
- import { displayBlock, positionRelative } from '../../../styles/general';
11
- import { getGlobal } from '../../../global';
7
+ import locale from "../../../locale";
8
+ import { InputBase, Label, HelperText } from "../../";
9
+ import { onValidate } from "../../../utils";
10
+ import { displayBlock, positionRelative } from "../../../styles/general";
11
+ import { getGlobal } from "../../../global";
12
12
  const num2WordsVi = function () {
13
13
  let t = ['không', 'một', 'hai', 'ba', 'bốn', 'năm', 'sáu', 'bảy', 'tám', 'chín'],
14
14
  r = function (r, n) {
@@ -3,9 +3,9 @@
3
3
  import { memo, useEffect, useRef, forwardRef, useState, useImperativeHandle } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { jsx, css } from '@emotion/core';
6
- import locale from '../../../locale';
7
- import { InputBase, Label, HelperText } from '../../';
8
- import { onValidate } from '../../../utils';
6
+ import locale from "../../../locale";
7
+ import { InputBase, Label, HelperText } from "../../";
8
+ import { onValidate } from "../../../utils";
9
9
  const NumberInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
10
  viewType,
11
11
  required,
@@ -1,16 +1,16 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
- import { useState, useRef, forwardRef, useMemo, useCallback, useEffect, useImperativeHandle } from 'react';
3
+ import { css, jsx } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
- import { jsx, css } from '@emotion/core';
6
- import locale from '../../../locale';
7
- import { InputBase, Label, HelperText } from '../..';
8
- import { classNames, onValidate, refType as ref } from '../../../utils';
9
- import { displayBlock, positionRelative } from '../../../styles/general';
10
- import theme from '../../../theme/settings';
5
+ import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
6
+ import { HelperText, InputBase, Label } from "../..";
7
+ import locale from "../../../locale";
8
+ import { cursorNotAllowed, displayBlock, positionRelative } from "../../../styles/general";
9
+ import { useTheme } from "../../../theme";
10
+ import { classNames, onValidate, refType as ref } from "../../../utils";
11
11
  const {
12
12
  spacing
13
- } = theme;
13
+ } = useTheme();
14
14
  const regexValidNumber = /[^0-9.,-]/g;
15
15
  const regexNumber = /[^0-9]/g;
16
16
  const regexThousandNumber = /(\d)(?=(\d{3})+\b)/g;
@@ -18,6 +18,7 @@ const regexThousandNumber = /(\d)(?=(\d{3})+\b)/g;
18
18
  // Clamp number between two values with the following line:
19
19
  const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
20
20
  const NumberInput = /*#__PURE__*/forwardRef(({
21
+ action = {},
21
22
  autoFocus,
22
23
  autoWidth,
23
24
  className,
@@ -51,6 +52,7 @@ const NumberInput = /*#__PURE__*/forwardRef(({
51
52
  required,
52
53
  startIcon,
53
54
  step,
55
+ style,
54
56
  thousandSeparator: thousandSymbol,
55
57
  validates,
56
58
  value: valueProps,
@@ -61,6 +63,7 @@ const NumberInput = /*#__PURE__*/forwardRef(({
61
63
  const ref = useRef(null);
62
64
  const globalRef = useRef({});
63
65
  const [value, setValue] = useState(defaultValue);
66
+ const isError = !!error;
64
67
 
65
68
  // nếu không cho nhập số âm mà max là âm thì remove giá trị max
66
69
  if (max < 0 && disabledNegative) max = null;
@@ -255,7 +258,9 @@ const NumberInput = /*#__PURE__*/forwardRef(({
255
258
  useImperativeHandle(reference, () => {
256
259
  const currentRef = ref.current || {};
257
260
  currentRef.element = ref.current;
258
- const _instance = {}; // methods
261
+ const _instance = {
262
+ ...action
263
+ }; // methods
259
264
  _instance.__proto__ = {}; // hidden methods
260
265
  currentRef.instance = _instance;
261
266
  return currentRef;
@@ -263,11 +268,12 @@ const NumberInput = /*#__PURE__*/forwardRef(({
263
268
  return jsx("div", {
264
269
  ref: ref,
265
270
  css: NumberInputRoot,
266
- className: classNames('DGN-UI-NumberInput', className)
271
+ className: classNames('DGN-UI-NumberInput', className, disabled && 'disabled'),
272
+ style: style
267
273
  }, !!label && jsx(Label, {
268
- ...labelProps,
269
274
  required: required,
270
- disabled: disabled
275
+ disabled: disabled,
276
+ ...labelProps
271
277
  }, label), jsx(InputBase, {
272
278
  inputRef: inputRef,
273
279
  viewType: viewType,
@@ -277,18 +283,19 @@ const NumberInput = /*#__PURE__*/forwardRef(({
277
283
  autoFocus: autoFocus,
278
284
  disabled: disabled,
279
285
  readOnly: readOnly,
280
- status: !!error || validateResult ? 'danger' : 'default',
281
- inputProps: inputProps,
282
286
  autoWidth: autoWidth,
287
+ status: isError || validateResult ? 'danger' : 'default',
288
+ inputProps: inputProps,
283
289
  inputStyle: inputStyle,
284
290
  startIcon: startIcon,
285
291
  endIcon: endIcon,
286
- nonStyle: nonStyle,
292
+ onBlur: e => _onBlur(e),
287
293
  onFocus: onFocus,
288
294
  onInput: _onInput,
295
+ onKeyDown: _onKeyDown,
289
296
  onKeyUp: onKeyUp,
290
297
  delayOnChange: delayOnChange,
291
- onKeyDown: _onKeyDown,
298
+ nonStyle: nonStyle,
292
299
  onChange: e => {
293
300
  const target = e.target;
294
301
  target.value = globalRef.current.valueString;
@@ -298,12 +305,11 @@ const NumberInput = /*#__PURE__*/forwardRef(({
298
305
  value: globalRef.current.value,
299
306
  target
300
307
  });
301
- },
302
- onBlur: e => _onBlur(e)
303
- }), !!error && jsx(HelperText, {
308
+ }
309
+ }), isError && jsx(HelperText, {
304
310
  ...helperTextProps,
305
311
  disabled: disabled
306
- }, error), !error && validateResult && jsx(HelperText, {
312
+ }, error), !isError && validateResult && jsx(HelperText, {
307
313
  ...helperTextProps,
308
314
  disabled: disabled
309
315
  }, validateResult));
@@ -312,6 +318,9 @@ const NumberInputRoot = css`
312
318
  ${displayBlock};
313
319
  ${positionRelative};
314
320
  margin-bottom: ${spacing([5])};
321
+ &.disabled {
322
+ ${cursorNotAllowed};
323
+ }
315
324
  `;
316
325
  NumberInput.defaultProps = {
317
326
  autoFocus: false,
@@ -326,16 +335,16 @@ NumberInput.defaultProps = {
326
335
  label: '',
327
336
  max: Infinity,
328
337
  min: -Infinity,
329
- nonStyle: false,
330
338
  readOnly: false,
331
339
  required: false,
332
340
  startIcon: '',
333
341
  step: 1,
342
+ style: {},
334
343
  thousandSeparator: false,
335
344
  viewType: 'underlined'
336
345
  };
337
346
  NumberInput.propTypes = {
338
- /** If `true`, the `input` element is focused during the first mount. */
347
+ /** If `true`, the input element is focused during the first mount. */
339
348
  autoFocus: PropTypes.bool,
340
349
  /** If `true`, width of input will resize according to content. */
341
350
  autoWidth: PropTypes.bool,
@@ -345,7 +354,7 @@ NumberInput.propTypes = {
345
354
  decimalDigit: PropTypes.number,
346
355
  /** Separator symbol. */
347
356
  decimalSymbol: PropTypes.oneOf([',', '.']),
348
- /** Default value of the component. */
357
+ /** The default value. Use when the component is not controlled. */
349
358
  defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
350
359
  /** The number of milliseconds to wait before call onChange. */
351
360
  delayOnChange: PropTypes.number,
@@ -357,7 +366,7 @@ NumberInput.propTypes = {
357
366
  endIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
358
367
  /** Error displayed below input. */
359
368
  error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
360
- /** fixedDecimalDigit. */
369
+ /** If `true`, decimal digit is fixed. */
361
370
  fixedDecimalDigit: PropTypes.bool,
362
371
  /** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
363
372
  helperTextProps: PropTypes.object,
@@ -377,8 +386,6 @@ NumberInput.propTypes = {
377
386
  maxDigit: PropTypes.number,
378
387
  /** Minimal possible value. */
379
388
  min: PropTypes.number,
380
- /** If `true`, component will have no style */
381
- nonStyle: PropTypes.bool,
382
389
  /** Callback fired when the input is blurred. */
383
390
  onBlur: PropTypes.func,
384
391
  /** Callback fired when the value is changed. */
@@ -401,6 +408,8 @@ NumberInput.propTypes = {
401
408
  startIcon: PropTypes.any,
402
409
  /** Specify how much the values should increase/decrease upon clicking on up/down button. */
403
410
  step: PropTypes.number,
411
+ /** Style inline of component. */
412
+ style: PropTypes.object,
404
413
  /** Thousand separator character. */
405
414
  thousandSeparator: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['.', ','])]),
406
415
  /** Validation value, argument can:<br/>
@@ -412,6 +421,6 @@ NumberInput.propTypes = {
412
421
  /** The value of the input element, required for a controlled component. */
413
422
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
414
423
  /** The variant to use. */
415
- viewType: PropTypes.oneOf(['underlined', 'outlined'])
424
+ viewType: PropTypes.oneOf(['underlined', 'outlined', 'none'])
416
425
  };
417
426
  export default NumberInput;
@@ -3,8 +3,8 @@
3
3
  import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { jsx, css } from '@emotion/core';
6
- import { InputBase, Label, HelperText, Typography } from '../../';
7
- import { Vietnam, England } from '../../../icons';
6
+ import { InputBase, Label, HelperText, Typography } from "../../";
7
+ import { Vietnam, England } from "../../../icons";
8
8
  const ensigns = {
9
9
  Vietnam: {
10
10
  icon: jsx(Vietnam, null),
@@ -3,10 +3,10 @@
3
3
  import { css, jsx } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import { forwardRef, memo, useState, useRef, useEffect, useMemo, Fragment } from 'react';
6
- import theme from '../../../theme/settings';
7
- import { randomString } from '../../../utils';
8
- import Typography from './../../typography';
9
- import { cursorPointer, borderBox, positionAbsolute, positionRelative, displayNone, displayBlock, cursorNoDrop } from '../../../styles/general';
6
+ import theme from "../../../theme/settings";
7
+ import { randomString } from "../../../utils";
8
+ import Typography from "./../../typography";
9
+ import { cursorPointer, borderBox, positionAbsolute, positionRelative, displayNone, displayBlock, cursorNoDrop } from "../../../styles/general";
10
10
  const {
11
11
  spacing,
12
12
  colors: {
@@ -1,12 +1,12 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/core';
4
+ import { HelperText, InputBase, Label } from "../..";
4
5
  import PropTypes from 'prop-types';
5
6
  import { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
6
- import { HelperText, InputBase, Label } from '../../';
7
- import { cursorNotAllowed, displayBlock, positionRelative } from '../../../styles/general';
8
- import { useTheme } from '../../../theme';
9
- import { classNames, onValidate, refType as ref } from '../../../utils';
7
+ import { cursorNotAllowed, displayBlock, positionRelative } from "../../../styles/general";
8
+ import { useTheme } from "../../../theme";
9
+ import { classNames, onValidate, refType as ref } from "../../../utils";
10
10
  const {
11
11
  spacing
12
12
  } = useTheme();
@@ -3,13 +3,13 @@
3
3
  import { jsx, css } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import React, { forwardRef, memo, useEffect, useMemo, useRef } from 'react';
6
- import { Cancel as CancelIcon, Clock as ClockIcon } from '../../../icons';
7
- import HelperText from '../helper-text';
8
- import { randomString, useOnClickOutside } from '../../../utils';
9
- import theme from '../../../theme/settings';
10
- import Swiper from './swiper';
11
- import { typography } from '../../../styles/typography';
12
- import { useTheme } from '../../../theme';
6
+ import { Cancel as CancelIcon, Clock as ClockIcon } from "../../../icons";
7
+ import HelperText from "../helper-text";
8
+ import { randomString, useOnClickOutside } from "../../../utils";
9
+ import theme from "../../../theme/settings";
10
+ import Swiper from "./swiper";
11
+ import { typography } from "../../../styles/typography";
12
+ import { useTheme } from "../../../theme";
13
13
  const {
14
14
  zIndex
15
15
  } = useTheme();
@@ -5,7 +5,7 @@
5
5
  import { useEffect, useRef } from 'react';
6
6
  import { jsx, css } from '@emotion/core';
7
7
  import PropTypes from 'prop-types';
8
- import { randomString } from '../../../utils';
8
+ import { randomString } from "../../../utils";
9
9
  const easing = {
10
10
  easingOutCubic: pos => {
11
11
  return Math.pow(pos - 1, 3) + 1;
@@ -3,10 +3,10 @@
3
3
  import { css, jsx } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import { forwardRef, memo, useEffect, useMemo, useRef, useState, Fragment } from 'react';
6
- import theme from '../../../theme/settings';
7
- import generateRandom from '../../../utils/randomString';
8
- import Typography from '../../typography';
9
- import { alignCenter, cursorNoDrop, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative } from '../../../styles/general';
6
+ import theme from "../../../theme/settings";
7
+ import generateRandom from "../../../utils/randomString";
8
+ import Typography from "../../typography";
9
+ import { alignCenter, cursorNoDrop, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative } from "../../../styles/general";
10
10
  const {
11
11
  colors: {
12
12
  system: {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/display-name */
2
2
  import React, { memo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { Typography } from '../';
4
+ import { Typography } from "../";
5
5
  const HelperText = /*#__PURE__*/memo(({
6
6
  text,
7
7
  style,
@@ -2,10 +2,10 @@
2
2
  /** @jsx jsx */
3
3
  import { jsx, css } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
- import Input from '../form-view/input';
6
- import Label from '../form-view/label';
7
- import HelperText from '../form-view/helper-text';
8
- import { dark4 } from '../../styles/colors';
5
+ import Input from "../form-view/input";
6
+ import Label from "../form-view/label";
7
+ import HelperText from "../form-view/helper-text";
8
+ import { dark4 } from "../../styles/colors";
9
9
  const FormLabel = ({
10
10
  label,
11
11
  inputProps,
@@ -3,9 +3,9 @@
3
3
  import { jsx, css } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import { forwardRef, useRef, memo, useEffect, useMemo } from 'react';
6
- import { dark4 } from '../../styles/colors';
7
- import { typography } from '../../styles/typography';
8
- import { formatDate } from '../../utils';
6
+ import { dark4 } from "../../styles/colors";
7
+ import { typography } from "../../styles/typography";
8
+ import { formatDate } from "../../utils";
9
9
  const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
10
  inputProps,
11
11
  inputStyleProps,
@@ -3,8 +3,8 @@
3
3
  import { jsx, css } from '@emotion/core';
4
4
  import PropTypes from 'prop-types';
5
5
  import { memo } from 'react';
6
- import { dark8 } from '../../styles/colors';
7
- import { typography } from '../../styles/typography';
6
+ import { dark8 } from "../../styles/colors";
7
+ import { typography } from "../../styles/typography";
8
8
  const Label = /*#__PURE__*/memo(({
9
9
  label,
10
10
  labelProps
@@ -3,8 +3,8 @@
3
3
  import PropTypes from 'prop-types';
4
4
  import { jsx } from '@emotion/core';
5
5
  import Grid from '.';
6
- import { makeStyles } from '../../theme';
7
- import { classNames } from '../../utils';
6
+ import { makeStyles } from "../../theme";
7
+ import { classNames } from "../../utils";
8
8
  const useStyles = makeStyles({
9
9
  customCol: {
10
10
  '& .DGN-UI-Control': {
@@ -3,7 +3,7 @@
3
3
  import PropTypes from 'prop-types';
4
4
  import { jsx } from '@emotion/core';
5
5
  import Grid from '.';
6
- import { classNames } from '../../utils';
6
+ import { classNames } from "../../utils";
7
7
  const checkChildren = children => {
8
8
  if (!children) return false;
9
9
  if (Array.isArray(children)) {
@@ -3,7 +3,7 @@
3
3
  import PropTypes from 'prop-types';
4
4
  import { jsx } from '@emotion/core';
5
5
  import Grid from '.';
6
- import { classNames } from '../../utils';
6
+ import { classNames } from "../../utils";
7
7
  const checkChildren = children => {
8
8
  if (!children) return false;
9
9
  if (Array.isArray(children)) {
@@ -3,11 +3,11 @@
3
3
  import { memo, useContext, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { jsx, css } from '@emotion/core';
6
- import GridContext from './context';
7
- import theme from '../../theme/settings';
8
- import { breakpointKeys } from '../../theme/createBreakpoints';
9
- import { borderBox } from '../../styles/general';
10
- import { classNames, handleBreakpoints } from '../../utils';
6
+ import GridContext from "./context";
7
+ import theme from "../../theme/settings";
8
+ import { breakpointKeys } from "../../theme/createBreakpoints";
9
+ import { borderBox } from "../../styles/general";
10
+ import { classNames, handleBreakpoints } from "../../utils";
11
11
  const {
12
12
  breakpoints: themeBreakpoints,
13
13
  spacing: themeSpacing
@@ -3,11 +3,11 @@
3
3
  import { forwardRef, Fragment, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { jsx, css, keyframes } from '@emotion/core';
6
- import OptionWrapper from '../others/option-wrapper';
7
- import { useIntersection } from '../../utils/intersectionObserver';
8
- import { classNames } from '../../utils';
9
- import AvatarDefault from '../../assets/avatar/default.svg';
10
- import { alignCenter, inlineFlex, overflowHidden, parseWidthHeight, positionRelative } from '../../styles/general';
6
+ import OptionWrapper from "../others/option-wrapper";
7
+ import { useIntersection } from "../../utils/intersectionObserver";
8
+ import { classNames } from "../../utils";
9
+ import AvatarDefault from "../../assets/avatar/default.svg";
10
+ import { alignCenter, inlineFlex, overflowHidden, parseWidthHeight, positionRelative } from "../../styles/general";
11
11
  const blurKeyframe = keyframes`
12
12
  0% { -webkit-filter: blur(4px);}
13
13
  25% { -webkit-filter: blur(3px);}