diginet-core-ui 1.3.37 → 1.3.39

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 (251) hide show
  1. package/assets/avatar/default.svg +3 -3
  2. package/assets/images/icons/wifi.svg +3 -3
  3. package/assets/images/menu/dhr/ALL.svg +6 -6
  4. package/assets/images/menu/dhr/D00.svg +12 -12
  5. package/assets/images/menu/dhr/D09.svg +8 -8
  6. package/assets/images/menu/dhr/D13.svg +10 -10
  7. package/assets/images/menu/dhr/D15.svg +10 -10
  8. package/assets/images/menu/dhr/D21.svg +10 -10
  9. package/assets/images/menu/dhr/D25.svg +11 -11
  10. package/assets/images/menu/dhr/D29.svg +11 -11
  11. package/assets/images/menu/dhr/D38.svg +6 -6
  12. package/assets/images/menu/dhr/D39.svg +10 -10
  13. package/assets/images/menu/dhr/D51.svg +12 -12
  14. package/assets/images/menu/dhr/D52.svg +16 -16
  15. package/assets/images/menu/dhr/D77.svg +16 -16
  16. package/assets/images/menu/dhr/D84.svg +12 -12
  17. package/assets/images/menu/dhr/D89.svg +8 -8
  18. package/assets/images/menu/dhr/Default.svg +13 -13
  19. package/assets/images/menu/dhr/MHRM00N0001.svg +14 -14
  20. package/assets/images/menu/dhr/MHRM09N0002.svg +3 -3
  21. package/assets/images/menu/dhr/MHRM09N0003.svg +25 -25
  22. package/assets/images/menu/dhr/MHRM09N0004.svg +14 -14
  23. package/assets/images/menu/dhr/MHRM09N0005.svg +7 -7
  24. package/assets/images/menu/dhr/MHRM13N0001.svg +16 -16
  25. package/assets/images/menu/dhr/MHRM25N0001.svg +26 -26
  26. package/assets/images/menu/dhr/MHRM29N0001.svg +30 -30
  27. package/assets/images/menu/dhr/MHRM29N0002.svg +13 -13
  28. package/assets/images/menu/dhr/MHRM29N0003.svg +17 -0
  29. package/assets/images/menu/dhr/MHRM29N0015.svg +63 -63
  30. package/assets/images/menu/dhr/MHRM39N0012.svg +43 -43
  31. package/assets/images/menu/dhr/MHRM39N0013.svg +24 -24
  32. package/assets/images/menu/dhr/MHRM39N0014.svg +14 -14
  33. package/assets/images/menu/dhr/MHRM39N0015.svg +36 -36
  34. package/assets/images/menu/dhr/MHRM39N0016.svg +23 -23
  35. package/assets/images/menu/dhr/MHRM77N0001.svg +28 -28
  36. package/assets/images/menu/dhr/MHRM84N0001.svg +27 -27
  37. package/assets/images/menu/dhr/MHRM84N0002.svg +24 -24
  38. package/assets/images/menu/dhr/MHRM89N0001.svg +16 -16
  39. package/assets/images/menu/dhr/MHRP00N0001.svg +10 -10
  40. package/assets/images/menu/dhr/MHRP09N0001.svg +22 -22
  41. package/assets/images/menu/dhr/MHRP09N0002.svg +19 -19
  42. package/assets/images/menu/dhr/MHRP09N0003.svg +12 -12
  43. package/assets/images/menu/dhr/MHRP09N0004.svg +6 -6
  44. package/assets/images/menu/dhr/MHRP09N0005.svg +10 -10
  45. package/assets/images/menu/dhr/MHRP09N0006.svg +17 -17
  46. package/assets/images/menu/dhr/MHRP09N0007.svg +15 -15
  47. package/assets/images/menu/dhr/MHRP09N0008.svg +8 -8
  48. package/assets/images/menu/dhr/MHRP09N0009.svg +10 -10
  49. package/assets/images/menu/dhr/MHRP09N0010.svg +12 -12
  50. package/assets/images/menu/dhr/MHRP09N0011.svg +16 -16
  51. package/assets/images/menu/dhr/MHRP09N0012.svg +6 -6
  52. package/assets/images/menu/dhr/MHRP09N0013.svg +8 -8
  53. package/assets/images/menu/dhr/MHRP09N0014.svg +11 -11
  54. package/assets/images/menu/dhr/MHRP09N0015.svg +12 -12
  55. package/assets/images/menu/dhr/MHRP09N0016.svg +18 -18
  56. package/assets/images/menu/dhr/MHRP09N0017.svg +18 -18
  57. package/assets/images/menu/dhr/MHRP09N0018.svg +12 -12
  58. package/assets/images/menu/dhr/MHRP09N0019.svg +13 -13
  59. package/assets/images/menu/dhr/MHRP09N0020.svg +17 -17
  60. package/assets/images/menu/dhr/MHRP09N0021.svg +10 -10
  61. package/assets/images/menu/dhr/MHRP09N0022.svg +16 -16
  62. package/assets/images/menu/dhr/MHRP09N0023.svg +8 -8
  63. package/assets/images/menu/dhr/MHRP09N0024.svg +15 -15
  64. package/assets/images/menu/dhr/MHRP09N0025.svg +16 -16
  65. package/assets/images/menu/dhr/MHRP09N0026.svg +13 -13
  66. package/assets/images/menu/dhr/MHRP09N0027.svg +10 -10
  67. package/assets/images/menu/dhr/MHRP09N0028.svg +6 -6
  68. package/assets/images/menu/dhr/MHRP09N0029.svg +14 -14
  69. package/assets/images/menu/dhr/MHRP09N0030.svg +4 -4
  70. package/assets/images/menu/dhr/MHRP09N0031.svg +5 -5
  71. package/assets/images/menu/dhr/MHRP09N0032.svg +7 -7
  72. package/assets/images/menu/dhr/MHRP13N0001.svg +9 -9
  73. package/assets/images/menu/dhr/MHRP21N0001.svg +12 -12
  74. package/assets/images/menu/dhr/MHRP21N0002.svg +13 -13
  75. package/assets/images/menu/dhr/MHRP25N0001.svg +13 -13
  76. package/assets/images/menu/dhr/MHRP25N0002.svg +16 -16
  77. package/assets/images/menu/dhr/MHRP25N0003.svg +38 -38
  78. package/assets/images/menu/dhr/MHRP25N0004.svg +17 -17
  79. package/assets/images/menu/dhr/MHRP25N0005.svg +20 -20
  80. package/assets/images/menu/dhr/MHRP29N0001.svg +18 -18
  81. package/assets/images/menu/dhr/MHRP29N0002.svg +15 -15
  82. package/assets/images/menu/dhr/MHRP29N0003.svg +20 -20
  83. package/assets/images/menu/dhr/MHRP29N0004.svg +21 -21
  84. package/assets/images/menu/dhr/MHRP29N0005.svg +21 -21
  85. package/assets/images/menu/dhr/MHRP29N0006.svg +14 -14
  86. package/assets/images/menu/dhr/MHRP29N0007.svg +19 -19
  87. package/assets/images/menu/dhr/MHRP29N0008.svg +20 -20
  88. package/assets/images/menu/dhr/MHRP29N0009.svg +11 -11
  89. package/assets/images/menu/dhr/MHRP29N0010.svg +11 -11
  90. package/assets/images/menu/dhr/MHRP29N0011.svg +12 -12
  91. package/assets/images/menu/dhr/MHRP29N0012.svg +7 -7
  92. package/assets/images/menu/dhr/MHRP29N0013.svg +27 -27
  93. package/assets/images/menu/dhr/MHRP29N0014.svg +32 -32
  94. package/assets/images/menu/dhr/MHRP29N0016.svg +54 -54
  95. package/assets/images/menu/dhr/MHRP29N0017.svg +24 -24
  96. package/assets/images/menu/dhr/MHRP29N0018.svg +44 -44
  97. package/assets/images/menu/dhr/MHRP29N0019.svg +17 -17
  98. package/assets/images/menu/dhr/MHRP29N0020.svg +11 -11
  99. package/assets/images/menu/dhr/MHRP29N0021.svg +8 -8
  100. package/assets/images/menu/dhr/MHRP29N0022.svg +9 -9
  101. package/assets/images/menu/dhr/MHRP29N0023.svg +22 -22
  102. package/assets/images/menu/dhr/MHRP38N0001.svg +13 -13
  103. package/assets/images/menu/dhr/MHRP38N0002.svg +14 -14
  104. package/assets/images/menu/dhr/MHRP39N0001.svg +15 -15
  105. package/assets/images/menu/dhr/MHRP39N0002.svg +13 -13
  106. package/assets/images/menu/dhr/MHRP39N0003.svg +16 -16
  107. package/assets/images/menu/dhr/MHRP39N0004.svg +22 -22
  108. package/assets/images/menu/dhr/MHRP39N0005.svg +16 -16
  109. package/assets/images/menu/dhr/MHRP39N0006.svg +17 -17
  110. package/assets/images/menu/dhr/MHRP39N0007.svg +13 -13
  111. package/assets/images/menu/dhr/MHRP39N0008.svg +3 -3
  112. package/assets/images/menu/dhr/MHRP39N0009.svg +3 -3
  113. package/assets/images/menu/dhr/MHRP39N0010.svg +7 -7
  114. package/assets/images/menu/dhr/MHRP39N0011.svg +14 -14
  115. package/assets/images/menu/dhr/MHRP39N0013.svg +10 -10
  116. package/assets/images/menu/dhr/MHRP39N0014.svg +11 -11
  117. package/assets/images/menu/dhr/MHRP39N0015.svg +5 -5
  118. package/assets/images/menu/dhr/MHRP39N0017.svg +11 -11
  119. package/assets/images/menu/dhr/MHRP39N0018.svg +11 -11
  120. package/assets/images/menu/dhr/MHRP39N1222.svg +12 -12
  121. package/assets/images/menu/dhr/MHRP51N0001.svg +9 -9
  122. package/assets/images/menu/dhr/MHRP51N0002.svg +13 -13
  123. package/assets/images/menu/dhr/MHRP52N0001.svg +21 -21
  124. package/assets/images/menu/dhr/MHRP52N0002.svg +21 -21
  125. package/assets/images/menu/dhr/MHRP52N0003.svg +16 -16
  126. package/assets/images/menu/dhr/MHRP75N0001.svg +19 -19
  127. package/assets/images/menu/dhr/MHRP75N0002.svg +25 -25
  128. package/assets/images/menu/dhr/MHRP75N0003.svg +3 -3
  129. package/assets/images/menu/dhr/MHRP75N0006.svg +14 -14
  130. package/assets/images/menu/dhr/MHRP75N0007.svg +19 -19
  131. package/assets/images/menu/dhr/MHRP75N0008.svg +19 -19
  132. package/assets/images/menu/dhr/MHRP77N0007.svg +28 -28
  133. package/assets/images/menu/dhr/MHRP77N0008.svg +17 -17
  134. package/assets/images/menu/dhr/MHRP77N0009.svg +19 -19
  135. package/assets/images/menu/dhr/MHRP77N0010.svg +20 -20
  136. package/assets/images/menu/dhr/MHRP89N1000.svg +6 -6
  137. package/assets/images/menu/dhr/MHRP89N1001.svg +6 -6
  138. package/assets/images/menu/dhr/TASK.svg +9 -9
  139. package/assets/images/menu/dhr/W00F0001.svg +3 -3
  140. package/assets/images/menu/dhr/W00F0002.svg +3 -3
  141. package/assets/images/menu/dhr/W00F0003.svg +3 -3
  142. package/assets/images/menu/dhr/W00F0004.svg +3 -3
  143. package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -17
  144. package/assets/images/menu/dhr/W09F2000.svg +6 -6
  145. package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -21
  146. package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -13
  147. package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -16
  148. package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -20
  149. package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -16
  150. package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -20
  151. package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -14
  152. package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -18
  153. package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -19
  154. package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -15
  155. package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -19
  156. package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -13
  157. package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -21
  158. package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -17
  159. package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -14
  160. package/assets/images/menu/dhr/W77F1011.svg +19 -19
  161. package/assets/images/menu/dhr/W77F1013.svg +22 -22
  162. package/assets/images/menu/erp/D05.svg +8 -8
  163. package/assets/images/menu/erp/D06.svg +4 -4
  164. package/assets/images/menu/erp/D90R.svg +9 -9
  165. package/assets/images/menu/erp/DBC.svg +9 -9
  166. package/assets/images/menu/erp/W00F0001.svg +3 -3
  167. package/assets/images/menu/erp/W00F0002.svg +3 -3
  168. package/assets/images/menu/erp/W00F0003.svg +3 -3
  169. package/assets/images/menu/erp/W00F0004.svg +3 -3
  170. package/assets/images/menu/erp/W05F0001.svg +16 -16
  171. package/assets/images/menu/erp/W05F0001N0000.svg +16 -16
  172. package/assets/images/menu/erp/W05F0004N0000.svg +6 -6
  173. package/assets/images/menu/erp/W05F0006N0000.svg +30 -30
  174. package/assets/images/menu/erp/W05F0007N0000.svg +6 -6
  175. package/assets/images/menu/erp/W05F0008N0000.svg +14 -14
  176. package/assets/images/menu/erp/W05F0011N0000.svg +20 -20
  177. package/assets/images/menu/erp/W05F0013N0000.svg +9 -9
  178. package/assets/images/menu/erp/W05F4000N0000.svg +9 -9
  179. package/assets/images/menu/erp/W06F0001.svg +17 -17
  180. package/assets/images/menu/erp/W06F0001N0000.svg +17 -17
  181. package/assets/images/menu/erp/W06F0004N0000.svg +22 -22
  182. package/assets/images/menu/erp/W06F0005N0000.svg +22 -22
  183. package/assets/images/menu/erp/W06F0006N0000.svg +55 -55
  184. package/assets/images/menu/erp/W06F0008N0000.svg +17 -17
  185. package/assets/images/menu/erp/W94F1000N0000.svg +9 -9
  186. package/assets/images/menu/erp/W94F1000N0001.svg +9 -9
  187. package/assets/images/menu/erp/WA3F1025.svg +5 -5
  188. package/assets/images/menu/erp/WA3F2100.svg +10 -10
  189. package/components/accordion/css.js +42 -35
  190. package/components/accordion/details.js +48 -42
  191. package/components/accordion/group.js +88 -82
  192. package/components/accordion/index.js +54 -48
  193. package/components/accordion/summary.js +52 -43
  194. package/components/alert/notify.js +16 -16
  195. package/components/avatar/index.js +19 -19
  196. package/components/badge/index.js +5 -5
  197. package/components/button/icon.js +21 -21
  198. package/components/button/index.js +13 -13
  199. package/components/chart/Pie/Sector.js +2 -2
  200. package/components/chart/Pie-v2/Sector.js +2 -2
  201. package/components/chip/attach.js +5 -5
  202. package/components/divider/index.js +17 -15
  203. package/components/form-control/attachment/index.js +20 -20
  204. package/components/form-control/calendar/function.js +295 -289
  205. package/components/form-control/calendar/index.js +16 -16
  206. package/components/form-control/checkbox/index.js +5 -5
  207. package/components/form-control/date-picker/index.js +7 -3
  208. package/components/form-control/date-range-picker/index.js +12 -8
  209. package/components/form-control/dropdown/index.js +7 -3
  210. package/components/form-control/input-base/index.js +32 -27
  211. package/components/form-control/money-input/index.js +17 -17
  212. package/components/form-control/number-input/index.js +11 -11
  213. package/components/form-control/number-input/index2.js +432 -0
  214. package/components/form-control/phone-input/index.js +7 -7
  215. package/components/form-control/radio/index.js +98 -146
  216. package/components/form-control/text-input/index.js +4 -4
  217. package/components/form-control/time-picker/index.js +305 -300
  218. package/components/form-control/toggle/index.js +92 -90
  219. package/components/index.js +1 -1
  220. package/components/paging/page-selector.js +53 -49
  221. package/components/popover/index.js +21 -21
  222. package/components/popup/index.js +5 -1
  223. package/components/popup/proposals_popup.js +5 -1
  224. package/components/popup/v2/index.js +12 -8
  225. package/components/progress/circular.js +12 -12
  226. package/components/rating/index.js +3 -3
  227. package/components/tab/tab-container.js +2 -2
  228. package/components/tab/tab-header.js +2 -2
  229. package/components/tab/tab-panel.js +2 -2
  230. package/components/tab/tab.js +2 -2
  231. package/components/transfer/index.js +3 -3
  232. package/components/tree-view/index.js +38 -38
  233. package/components/typography/index.js +11 -11
  234. package/icons/effect.js +15 -15
  235. package/package.json +45 -45
  236. package/readme.md +677 -668
  237. package/styles/color-helper.js +103 -103
  238. package/styles/colors.js +7 -7
  239. package/styles/general.js +11 -11
  240. package/styles/utils.js +5 -5
  241. package/theme/set-theme.js +3 -3
  242. package/utils/array/array.js +36 -36
  243. package/utils/date.js +56 -56
  244. package/utils/error/error.js +2 -2
  245. package/utils/error/errors.js +99 -99
  246. package/utils/number.js +6 -6
  247. package/utils/render-portal.js +5 -1
  248. package/utils/renderIcon.js +5 -5
  249. package/utils/useOnClickOutside.js +2 -2
  250. package/utils/usePortal.js +9 -9
  251. package/utils/validate.js +33 -33
@@ -7,11 +7,30 @@ import { forwardRef, memo, useEffect, useMemo, useRef, useState } from 'react';
7
7
  import theme from '../../../theme/settings';
8
8
  import generateRandom from '../../../utils/randomString';
9
9
  import Typography from '../../typography';
10
+ import { alignCenter, cursorNotAllowed, cursorPointer, displayBlock, flexRow, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from '../../../styles/general';
11
+ const {
12
+ colors: {
13
+ system: {
14
+ rest: clRest,
15
+ active: clActive
16
+ },
17
+ text: {
18
+ main: clTextMain
19
+ },
20
+ fill: {
21
+ focus: clFillFocus
22
+ },
23
+ primary: clPrimary,
24
+ hover: clHover,
25
+ disabled: clDisabled,
26
+ white: clWhite
27
+ },
28
+ spacing
29
+ } = theme;
10
30
  const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
11
31
  id,
12
32
  disabled,
13
33
  name,
14
- size,
15
34
  height,
16
35
  width,
17
36
  label,
@@ -20,6 +39,8 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
20
39
  onChange,
21
40
  inputRef,
22
41
  inputProps,
42
+ lineClamp,
43
+ hoverTooltip,
23
44
  ...props
24
45
  }, ref) => {
25
46
  if (!inputRef) {
@@ -27,115 +48,88 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
27
48
  }
28
49
 
29
50
  const [checkedState, setCheckedState] = useState(Boolean(checked !== undefined ? checked : defaultChecked));
30
-
31
- if (size === 'small') {
32
- height = 10;
33
- width = 20;
34
- } else {
35
- width = 38;
36
- height = 19;
37
- }
38
-
39
51
  const formCheck = css`
40
- position: relative;
41
- cursor: pointer;
42
- user-select: none;
43
- padding-left: 3px;
52
+ ${positionRelative};
53
+ ${cursorPointer};
54
+ ${userSelectNone};
55
+ min-height: ${height}px;
44
56
  &.disabled {
45
- pointer-events: none;
57
+ ${pointerEventsNone};
46
58
  }
47
59
  `;
48
60
  const toggle = css`
49
- display: flex;
50
- align-items: center;
51
- cursor: pointer;
52
- position: relative;
53
- box-sizing: border-box;
61
+ ${flexRow};
62
+ ${alignCenter};
63
+ ${cursorPointer};
64
+ ${positionRelative};
54
65
  margin: 0;
55
66
  `;
56
67
  const slider = css`
57
- position: relative;
58
- cursor: pointer;
59
- display: block;
68
+ ${positionRelative};
69
+ ${cursorPointer};
70
+ ${displayBlock};
60
71
  height: ${height}px;
61
72
  width: ${width}px;
73
+ min-width: ${width}px;
62
74
  border-radius: ${height}px;
63
- background: white;
64
- border: 1px solid ${theme.colors.border};
65
- margin: 0px auto;
75
+ background: ${clWhite};
76
+ outline: 1px solid ${clRest};
66
77
  &::after {
78
+ ${positionAbsolute};
79
+ background: ${clRest};
80
+ width: ${height - spacing(1)}px;
81
+ height: ${height - spacing(1)}px;
67
82
  content: '';
68
- box-sizing: border-box;
69
- position: absolute;
83
+ top: 2px;
84
+ left: 2px;
70
85
  border-radius: 100%;
71
- left: 3%;
72
- z-index: 2;
73
- background: ${theme.colors.border};
74
86
  transition: 0.3s ease-in-out;
75
- top: 49%;
76
- transform: translateY(-49%);
77
87
  margin: 0px auto;
78
- width: ${width / 12 * 5}px;
79
- height: ${width / 12 * 5}px;
80
88
  }
81
89
  &:hover {
82
- box-shadow: 0 0 2px 2px ${theme.colors.focus};
83
- background-color: ${theme.colors.focus};
84
- border: 1px solid ${theme.colors.primary};
90
+ box-shadow: 0 0 0 2px ${clHover};
91
+ background-color: ${clHover};
92
+ outline-color: ${clPrimary};
93
+ }
94
+ &:hover:after {
95
+ background-color: ${clActive};
96
+ }
97
+ &:active,
98
+ &:focus {
99
+ box-shadow: 0 0 0 2px ${clFillFocus};
100
+ background-color: ${clFillFocus};
85
101
  }
86
102
  `;
87
103
  const checkbox = css`
88
- box-sizing: border-box;
89
104
  left: 0;
90
- top: 50%;
91
- z-index: 2;
92
105
  &:checked + label > span.css-${slider.name} {
93
- border: none;
94
- background: ${theme.colors.primary};
95
- border: 1px solid transparent;
96
- transition: 0.3s ease-in-out;
97
- box-shadow: 0 0 2px 2px ${theme.colors.focus};
106
+ background: ${clPrimary};
107
+ outline-color: ${clPrimary};
98
108
  &::after {
99
- transform: translate(${height}px, -50%);
100
- background: white;
101
- }
102
- }
103
- &:hover:checked + label > span.css-${slider.name} {
104
- border: none;
105
- background: ${theme.colors.primary};
106
- border: 1px solid transparent;
107
- &::after {
108
- background: ${theme.colors.hover};
109
+ background: ${clWhite};
110
+ left: ${width - height}px;
109
111
  }
110
112
  }
111
113
  &:disabled:checked + label > span.css-${slider.name} {
112
- user-select: none;
113
- pointer-events: none;
114
- cursor: not-allowed;
115
- border: none;
116
- background: ${theme.colors.disabled};
117
- border: 1px solid transparent;
118
- box-shadow: initial;
119
- &::after {
120
- background: ${theme.colors.dark12};
121
- }
114
+ ${userSelectNone};
115
+ ${pointerEventsNone};
116
+ ${cursorNotAllowed};
117
+ background: ${clDisabled};
118
+ outline-color: ${clDisabled};
122
119
  }
123
120
  &:hover:not(:checked) + label > span.css-${slider.name} {
124
- background: ${theme.colors.hover};
125
- border: 1px solid ${theme.colors.primary};
121
+ background: ${clHover};
122
+ outline: 1px solid ${clPrimary};
126
123
  transition: 0.3s ease-in-out;
127
124
  ::after {
128
- background: ${theme.colors.primary};
125
+ background: ${clPrimary};
129
126
  }
130
127
  }
131
128
  &:disabled:not(:checked) + label > span.css-${slider.name} {
132
- background: ${theme.colors.dark12};
133
- cursor: not-allowed;
134
- user-select: none;
135
- border: 1px solid ${theme.colors.disabled};
136
- pointer-events: none;
129
+ ${pointerEventsNone};
130
+ outline-color: ${clDisabled};
137
131
  ::after {
138
- background: ${theme.colors.disabled};
132
+ background: ${clDisabled};
139
133
  }
140
134
  }
141
135
  `;
@@ -180,6 +174,7 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
180
174
  }, jsx("input", { ...inputProps,
181
175
  ref: inputRef,
182
176
  hidden: true,
177
+ name: name,
183
178
  type: "checkbox",
184
179
  css: checkbox,
185
180
  checked: checkedState,
@@ -190,10 +185,14 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
190
185
  }, jsx("span", {
191
186
  css: slider
192
187
  }), label !== undefined && jsx(Typography, {
188
+ type: 'p1',
193
189
  style: {
194
- marginLeft: '8px',
195
- marginBottom: 0
190
+ color: disabled ? clDisabled : clTextMain,
191
+ marginBottom: 0,
192
+ marginLeft: spacing(2.5)
196
193
  },
194
+ hoverTooltip: hoverTooltip,
195
+ lineClamp: lineClamp || null,
197
196
  mapping: 'label'
198
197
  }, label))), [disabled, onChange, checkedState]);
199
198
  }));
@@ -203,7 +202,9 @@ Toggle.defaultProps = {
203
202
  label: '',
204
203
  value: '',
205
204
  id: '',
206
- size: ''
205
+ width: 40,
206
+ height: 20,
207
+ lineClamp: null
207
208
  };
208
209
  Toggle.propTypes = {
209
210
  /** * If `true`, the component is disabled. */
@@ -215,33 +216,34 @@ Toggle.propTypes = {
215
216
  /** If `true`, the component is checked. */
216
217
  checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf([0, 1])]),
217
218
 
218
- /** the size options default and small */
219
- size: PropTypes.string,
220
-
221
219
  /** Id is randomized randomly to avoid duplication. */
222
220
  id: PropTypes.string,
223
221
 
224
- /**
225
- * Name attribute of the `input` element.
226
- */
222
+ /** Name attribute of the `input` element. */
227
223
  name: PropTypes.string,
228
224
 
229
225
  /** The name of the Radio is displayed on the interface */
230
226
  label: PropTypes.string,
231
227
 
232
- /** height is a number, height of Toggle default 19 */
228
+ /** height is a number, height of Toggle default 20 */
233
229
  height: PropTypes.number,
234
230
 
235
- /** width is a number, width of Toggle default 38 */
231
+ /** width is a number, width of Toggle default 40 */
236
232
  width: PropTypes.number,
237
233
 
238
234
  /** props for input */
239
235
  inputProps: PropTypes.object,
240
236
 
241
- /** * Callback fired when the state is changed.
242
- *
243
- * @param {object} event The event source of the callback.
244
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
237
+ /** The line-clamp property truncates text at a specific number of Label. */
238
+ lineClamp: PropTypes.number,
239
+
240
+ /** Shows tooltip containing Label on hover */
241
+ hoverTooltip: PropTypes.bool,
242
+
243
+ /** * Callback fired when the state is changed.
244
+ *
245
+ * @param {object} event The event source of the callback.
246
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
245
247
  */
246
248
  onChange: PropTypes.func
247
249
  };
@@ -52,7 +52,7 @@ export { default as Label } from './form-control/label';
52
52
  export { default as HelperText } from './form-control/helper-text';
53
53
  export { default as TextInput } from './form-control/text-input';
54
54
  export { default as MoneyInput } from './form-control/money-input';
55
- export { default as NumberInput } from './form-control/number-input';
55
+ export { default as NumberInput } from './form-control/number-input/index2';
56
56
  export { default as Toggle } from './form-control/toggle'; // List
57
57
 
58
58
  export { default as List } from './list/list';
@@ -6,6 +6,10 @@ import PropTypes from 'prop-types';
6
6
  import { jsx, css } from '@emotion/core';
7
7
  import theme from '../../theme/settings';
8
8
  import { typography } from '../../styles/typography';
9
+ import { useTheme } from '../../theme';
10
+ const {
11
+ zIndex
12
+ } = useTheme();
9
13
  const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
14
  size,
11
15
  style,
@@ -23,57 +27,57 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
23
27
  const [currentPage, setCurrentPage] = useState(currentPageProps);
24
28
  const [paging, setPaging] = useState([1]);
25
29
  const PageItemNum = css`
26
- color: #FFF;
27
- ${typography.heading3};
28
- z-index: 1502;
29
- `;
30
+ color: #fff;
31
+ ${typography.heading3};
32
+ z-index: ${zIndex(2)};
33
+ `;
30
34
  const morePaging = css`
31
- position: absolute;
32
- display: inline-flex;
33
- opacity: 0;
34
- transform: scaleX(0);
35
- transition: all 0.5s;
36
- z-index: 1503;
37
- max-width: 176px;
38
- overflow: scroll hidden;
39
- padding-bottom: 2px;
40
- outline: none;
41
- &.visible {
42
- opacity: 1;
43
- transform: scaleX(1);
44
- }
45
- &::-webkit-scrollbar {
46
- height: 4px;
47
- }
48
- &::-webkit-scrollbar-thumb {
49
- border-radius: 10px;
50
- background-color: #c1c1c1;
51
- }
52
- `;
35
+ position: absolute;
36
+ display: inline-flex;
37
+ opacity: 0;
38
+ transform: scaleX(0);
39
+ transition: all 0.5s;
40
+ z-index: ${zIndex(3)};
41
+ max-width: 176px;
42
+ overflow: scroll hidden;
43
+ padding-bottom: 2px;
44
+ outline: none;
45
+ &.visible {
46
+ opacity: 1;
47
+ transform: scaleX(1);
48
+ }
49
+ &::-webkit-scrollbar {
50
+ height: 4px;
51
+ }
52
+ &::-webkit-scrollbar-thumb {
53
+ border-radius: 10px;
54
+ background-color: #c1c1c1;
55
+ }
56
+ `;
53
57
  const PageItem = css`
54
- width: ${size === 'small' ? 20 : 24}px;
55
- height: ${size === 'small' ? 20 : 24}px;
56
- font-size: ${size === 'small' ? 12 : 14}px;
57
- background-color: ${theme.colors.border};
58
- border-radius: 50%;
59
- text-align: center;
60
- display: flex;
61
- justify-content: center;
62
- align-items: center;
63
- margin: 0px 4px;
64
- user-select: none;
65
- cursor: pointer;
66
- position: relative;
67
- &:hover {
68
- background-color: ${theme.colors.hover};
69
- &:not(.active) .css-${PageItemNum.name} {
70
- color: ${theme.colors.primary};
71
- }
72
- }
73
- &.active {
74
- background-color: ${theme.colors.brand};
75
- }
76
- `;
58
+ width: ${size === 'small' ? 20 : 24}px;
59
+ height: ${size === 'small' ? 20 : 24}px;
60
+ font-size: ${size === 'small' ? 12 : 14}px;
61
+ background-color: ${theme.colors.border};
62
+ border-radius: 50%;
63
+ text-align: center;
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ margin: 0px 4px;
68
+ user-select: none;
69
+ cursor: pointer;
70
+ position: relative;
71
+ &:hover {
72
+ background-color: ${theme.colors.hover};
73
+ &:not(.active) .css-${PageItemNum.name} {
74
+ color: ${theme.colors.primary};
75
+ }
76
+ }
77
+ &.active {
78
+ background-color: ${theme.colors.brand};
79
+ }
80
+ `;
77
81
 
78
82
  const setPagination = (newCurrentPage = 1) => {
79
83
  const newLastPage = Math.ceil(totalItems / itemsPerPage);
@@ -437,32 +437,32 @@ Popover.propTypes = {
437
437
  /** An HTML element, or a function that returns one. It's used to set the position of the popover. */
438
438
  anchor: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.func, PropTypes.object]),
439
439
 
440
- /**
441
- * This is the point on the anchor where the popover's anchor will attach to.
442
- * Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
440
+ /**
441
+ * This is the point on the anchor where the popover's anchor will attach to.
442
+ * Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
443
443
  */
444
444
  anchorOrigin: PropTypes.shape({
445
445
  horizontal: PropTypes.oneOf(['center', 'left', 'right']),
446
446
  vertical: PropTypes.oneOf(['bottom', 'center', 'top'])
447
447
  }),
448
448
 
449
- /**
450
- * This is the point on the popover which will attach to the anchor's origin.
451
- * Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
449
+ /**
450
+ * This is the point on the popover which will attach to the anchor's origin.
451
+ * Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
452
452
  */
453
453
  transformOrigin: PropTypes.shape({
454
454
  horizontal: PropTypes.oneOf(['center', 'left', 'right']),
455
455
  vertical: PropTypes.oneOf(['bottom', 'center', 'top'])
456
456
  }),
457
457
 
458
- /**
459
- * Direction when Popover shown.
460
- * Note: This prop will overwrite anchorOrigin & transformOrigin.
461
- *
462
- * * top: anchorOrigin: { vertical: 'top', horizontal: 'center' }, transformOrigin: { vertical: 'bottom', horizontal: 'center' }
463
- * * left: anchorOrigin: { vertical: 'center', horizontal: 'left' }, transformOrigin: { vertical: 'center', horizontal: 'right' }
464
- * * right: anchorOrigin: { vertical: 'center', horizontal: 'right' }, transformOrigin: { vertical: 'center', horizontal: 'left' }
465
- * * right: anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }
458
+ /**
459
+ * Direction when Popover shown.
460
+ * Note: This prop will overwrite anchorOrigin & transformOrigin.
461
+ *
462
+ * * top: anchorOrigin: { vertical: 'top', horizontal: 'center' }, transformOrigin: { vertical: 'bottom', horizontal: 'center' }
463
+ * * left: anchorOrigin: { vertical: 'center', horizontal: 'left' }, transformOrigin: { vertical: 'center', horizontal: 'right' }
464
+ * * right: anchorOrigin: { vertical: 'center', horizontal: 'right' }, transformOrigin: { vertical: 'center', horizontal: 'left' }
465
+ * * right: anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }
466
466
  */
467
467
  direction: PropTypes.oneOf(['top', 'left', 'right', 'bottom']),
468
468
 
@@ -481,13 +481,13 @@ Popover.propTypes = {
481
481
  /** The content of the component. */
482
482
  children: PropTypes.node,
483
483
 
484
- /**
485
- * ref methods (ref.current.instance.*method*)
486
- *
487
- * * show: Show popover
488
- * * close: Close popover
489
- * * setPosition(element): Set position of popover
490
- * * @param {element} - element
484
+ /**
485
+ * ref methods (ref.current.instance.*method*)
486
+ *
487
+ * * show: Show popover
488
+ * * close: Close popover
489
+ * * setPosition(element): Set position of popover
490
+ * * @param {element} - element
491
491
  */
492
492
  reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
493
493
  current: PropTypes.instanceOf(Element)
@@ -10,6 +10,10 @@ import { Info, ApprovalFilled, Warning, Failed } from '../../icons';
10
10
  import theme from '../../theme/settings';
11
11
  import { getGlobal } from '../../global';
12
12
  import { typography } from '../../styles/typography';
13
+ import { useTheme } from '../../theme';
14
+ const {
15
+ zIndex
16
+ } = useTheme();
13
17
  export const icons = {
14
18
  info: jsx(Info, {
15
19
  viewBox: true
@@ -72,7 +76,7 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
72
76
  pointer-events: ${!fullScreen ? 'none' : 'auto'};
73
77
  opacity: 0;
74
78
  transition: opacity 0.3s ease;
75
- z-index: 9001;
79
+ z-index: ${zIndex(1)};
76
80
  `;
77
81
  const fadeInDown = keyframes`
78
82
  from {
@@ -8,6 +8,10 @@ import theme from '../../theme/settings';
8
8
  import { Button, ButtonIcon } from '../';
9
9
  import { Close, Approval } from '../../icons';
10
10
  import TextInput from '../form-control/text-input';
11
+ import { useTheme } from '../../theme';
12
+ const {
13
+ zIndex
14
+ } = useTheme();
11
15
  const ProposalsPopup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
12
16
  open,
13
17
  clearAble,
@@ -42,7 +46,7 @@ const ProposalsPopup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
42
46
  position: fixed;
43
47
  width: 80%;
44
48
  max-width: 480px;
45
- z-index: 1000;
49
+ z-index: ${zIndex()};
46
50
  transform: scale(0);
47
51
  transition: transform 0.2s linear;
48
52
  &.open {
@@ -13,6 +13,10 @@ import { capitalize, renderIcon } from '../../../utils';
13
13
  import { animations } from '../../../styles/animation';
14
14
  import { color as colors } from '../../../styles/colors';
15
15
  import { alignCenter, border, borderBox, borderRadius4px, cursorPointer, displayBlock, ellipsis, flexCol, flexRow, justifyCenter, justifyEnd, overflowHidden, positionFixed, positionRelative } from '../../../styles/general';
16
+ import { useTheme } from '../../../theme';
17
+ const {
18
+ zIndex
19
+ } = useTheme();
16
20
  const {
17
21
  system: {
18
22
  white
@@ -102,7 +106,7 @@ const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
102
106
  background-color: rgba(21, 26, 48, 0.5);
103
107
  opacity: 0;
104
108
  transition: opacity 0.3s ease;
105
- z-index: 9002;
109
+ z-index: ${zIndex(2)};
106
110
  word-break: break-word;
107
111
  .DGN-UI-Popup {
108
112
  ${flexCol}
@@ -461,13 +465,13 @@ Popup.propTypes = {
461
465
  /** the function will run when click on cancel button */
462
466
  onCancel: func,
463
467
 
464
- /**
465
- * named ref: get ref of Popup component, insist:<br />
466
- * * element<br />
467
- * * show: the method to show Popup (ref.current.show(options, callback))<br />
468
- * &nbsp;&nbsp; + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
469
- * &nbsp;&nbsp; + callback: the function will run after click on button (callback(true) with confirm Button and callback(false) with cancel Button). Alternate both onCancel, onConfirm methods of options<br />
470
- * * close: the method to close Popup<br />
468
+ /**
469
+ * named ref: get ref of Popup component, insist:<br />
470
+ * * element<br />
471
+ * * show: the method to show Popup (ref.current.show(options, callback))<br />
472
+ * &nbsp;&nbsp; + options: {type, title, icon, yesNo, description, confirmProps, cancelProps, onCancel, onConfirm}<br />
473
+ * &nbsp;&nbsp; + callback: the function will run after click on button (callback(true) with confirm Button and callback(false) with cancel Button). Alternate both onCancel, onConfirm methods of options<br />
474
+ * * close: the method to close Popup<br />
471
475
  */
472
476
  reference: oneOfType([func, shape({
473
477
  current: instanceOf(elementType)
@@ -63,8 +63,8 @@ const getDimension = size => {
63
63
  strokeWidth
64
64
  };
65
65
  };
66
- /**
67
- * Determinate circular progress
66
+ /**
67
+ * Determinate circular progress
68
68
  */
69
69
 
70
70
 
@@ -113,8 +113,8 @@ const Determinate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
113
113
 
114
114
  return angle;
115
115
  };
116
- /**
117
- * style
116
+ /**
117
+ * style
118
118
  */
119
119
 
120
120
 
@@ -216,8 +216,8 @@ Determinate.propTypes = {
216
216
  width: PropTypes.number
217
217
  };
218
218
  export const DeterminateCircularProgress = Determinate;
219
- /**
220
- * Indeterminate circular progress
219
+ /**
220
+ * Indeterminate circular progress
221
221
  */
222
222
 
223
223
  const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
@@ -254,8 +254,8 @@ const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
254
254
  stroke-dashoffset: -${r * 124 / 200};
255
255
  }
256
256
  `;
257
- /**
258
- * style
257
+ /**
258
+ * style
259
259
  */
260
260
 
261
261
 
@@ -286,8 +286,8 @@ const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
286
286
  stroke-linecap: round;
287
287
  stroke-width: ${circleStrokeW};
288
288
  `;
289
- /**
290
- * component
289
+ /**
290
+ * component
291
291
  */
292
292
 
293
293
  const CircleBackgroundMemo = useMemo(() => jsx("circle", {
@@ -330,8 +330,8 @@ Indeterminate.propTypes = {
330
330
  width: PropTypes.number
331
331
  };
332
332
  export const IndeterminateCircularProgress = Indeterminate;
333
- /**
334
- * Circular progress
333
+ /**
334
+ * Circular progress
335
335
  */
336
336
 
337
337
  const CircularProgress = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
@@ -264,9 +264,9 @@ Rating.propTypes = {
264
264
  /** style inline of stars icon */
265
265
  starStyle: PropTypes.object,
266
266
 
267
- /**
268
- * the function for rating handler, return e:{value, ...element}<br />
269
- * value: the quantity of star was selected (insist half)
267
+ /**
268
+ * the function for rating handler, return e:{value, ...element}<br />
269
+ * value: the quantity of star was selected (insist half)
270
270
  */
271
271
  onRating: PropTypes.func
272
272
  };
@@ -93,8 +93,8 @@ TabContainer.propTypes = {
93
93
  /** any props else */
94
94
  props: PropTypes.any,
95
95
 
96
- /**
97
- * ref methods
96
+ /**
97
+ * ref methods
98
98
  */
99
99
  reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
100
100
  current: PropTypes.instanceOf(Element)
@@ -157,8 +157,8 @@ TabHeader.propTypes = {
157
157
  /** any props else */
158
158
  props: PropTypes.any,
159
159
 
160
- /**
161
- * ref methods
160
+ /**
161
+ * ref methods
162
162
  */
163
163
  reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
164
164
  current: PropTypes.instanceOf(Element)