d2coreui 21.0.34 → 23.0.0

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 (295) hide show
  1. package/components/clipboard/clipboardUtils.d.ts +4 -3
  2. package/components/clipboard/clipboardUtils.js +47 -22
  3. package/components/clipboard/clipboardUtils.js.map +1 -1
  4. package/components/codemirror/SyntaxHighlighter.d.ts +21 -21
  5. package/components/codemirror/SyntaxHighlighter.js +45 -44
  6. package/components/codemirror/SyntaxHighlighter.js.map +1 -1
  7. package/components/collapse/expandable.d.ts +13 -12
  8. package/components/collapse/expandable.js +20 -20
  9. package/components/collapse/expandable.js.map +1 -1
  10. package/components/color/colorPicker.d.ts +20 -20
  11. package/components/color/colorPicker.js +53 -53
  12. package/components/color/colorPicker.js.map +1 -1
  13. package/components/color/colorSwatch.d.ts +13 -12
  14. package/components/color/colorSwatch.js +62 -62
  15. package/components/color/colorSwatch.js.map +1 -1
  16. package/components/color/colorUtils.d.ts +7 -7
  17. package/components/color/colorUtils.js +43 -43
  18. package/components/color/colorUtils.js.map +1 -1
  19. package/components/date/dateRangeInput.d.ts +66 -64
  20. package/components/date/dateRangeInput.js +292 -297
  21. package/components/date/dateRangeInput.js.map +1 -1
  22. package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -26
  23. package/components/date/dateRangeInputAdvancedPanel.js +130 -115
  24. package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
  25. package/components/date/dateRangeInputConfirm.d.ts +31 -29
  26. package/components/date/dateRangeInputConfirm.js +132 -121
  27. package/components/date/dateRangeInputConfirm.js.map +1 -1
  28. package/components/date/dateTimeInput.d.ts +72 -69
  29. package/components/date/dateTimeInput.js +440 -412
  30. package/components/date/dateTimeInput.js.map +1 -1
  31. package/components/date/durationInput.d.ts +59 -56
  32. package/components/date/durationInput.js +269 -280
  33. package/components/date/durationInput.js.map +1 -1
  34. package/components/form/NiceFormItem.d.ts +14 -14
  35. package/components/form/NiceFormItem.js +28 -31
  36. package/components/form/NiceFormItem.js.map +1 -1
  37. package/components/grid/cell/beanAccessor.d.ts +9 -0
  38. package/components/grid/cell/beanAccessor.js +13 -0
  39. package/components/grid/cell/beanAccessor.js.map +1 -0
  40. package/components/grid/cell/cellEditorUtils.d.ts +4 -4
  41. package/components/grid/cell/cellEditorUtils.js +8 -8
  42. package/components/grid/cell/customEnumCellEditor.d.ts +4 -27
  43. package/components/grid/cell/customEnumCellEditor.js +82 -91
  44. package/components/grid/cell/customEnumCellEditor.js.map +1 -1
  45. package/components/grid/cell/dataGridCellEditorComponent.d.ts +14 -0
  46. package/components/grid/cell/dataGridCellEditorComponent.js +49 -0
  47. package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -0
  48. package/components/grid/cell/dateCellEditor.d.ts +4 -25
  49. package/components/grid/cell/dateCellEditor.js +53 -72
  50. package/components/grid/cell/dateCellEditor.js.map +1 -1
  51. package/components/grid/cell/durationCellEditor.d.ts +4 -24
  52. package/components/grid/cell/durationCellEditor.js +74 -97
  53. package/components/grid/cell/durationCellEditor.js.map +1 -1
  54. package/components/grid/cell/hexaOctetStringCellEditor.d.ts +4 -24
  55. package/components/grid/cell/hexaOctetStringCellEditor.js +70 -94
  56. package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
  57. package/components/grid/cell/hexaValueCellEditor.d.ts +4 -24
  58. package/components/grid/cell/hexaValueCellEditor.js +65 -89
  59. package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
  60. package/components/grid/cell/numberCellEditor.d.ts +4 -27
  61. package/components/grid/cell/numberCellEditor.js +73 -95
  62. package/components/grid/cell/numberCellEditor.js.map +1 -1
  63. package/components/grid/cell/rangeSelector.d.ts +78 -78
  64. package/components/grid/cell/rangeSelector.js +526 -518
  65. package/components/grid/cell/rangeSelector.js.map +1 -1
  66. package/components/grid/cell/simpleStatusTextCellEditor.d.ts +4 -32
  67. package/components/grid/cell/simpleStatusTextCellEditor.js +106 -116
  68. package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
  69. package/components/grid/cell/statusTextCellEditor.d.ts +4 -32
  70. package/components/grid/cell/statusTextCellEditor.js +136 -159
  71. package/components/grid/cell/statusTextCellEditor.js.map +1 -1
  72. package/components/grid/cell/tableDefaultRowStyleRules.d.ts +20 -20
  73. package/components/grid/cell/tableDefaultRowStyleRules.js +29 -18
  74. package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
  75. package/components/grid/cell/textCellEditor.d.ts +4 -21
  76. package/components/grid/cell/textCellEditor.js +63 -85
  77. package/components/grid/cell/textCellEditor.js.map +1 -1
  78. package/components/grid/cell/withAgGridHooks.d.ts +3 -0
  79. package/components/grid/cell/withAgGridHooks.js +15 -0
  80. package/components/grid/cell/withAgGridHooks.js.map +1 -0
  81. package/components/grid/columnUtils.d.ts +5 -5
  82. package/components/grid/columnUtils.js +26 -26
  83. package/components/grid/columnUtils.js.map +1 -1
  84. package/components/grid/config/columnTransfer.d.ts +21 -22
  85. package/components/grid/config/columnTransfer.js +205 -201
  86. package/components/grid/config/columnTransfer.js.map +1 -1
  87. package/components/grid/config/dataGridEditor.d.ts +41 -41
  88. package/components/grid/config/dataGridEditor.js +181 -160
  89. package/components/grid/config/dataGridEditor.js.map +1 -1
  90. package/components/grid/config/rowHeightCalculator.d.ts +8 -0
  91. package/components/grid/config/rowHeightCalculator.js +20 -0
  92. package/components/grid/config/rowHeightCalculator.js.map +1 -0
  93. package/components/grid/config/rowStylePicker.d.ts +27 -25
  94. package/components/grid/config/rowStylePicker.js +127 -109
  95. package/components/grid/config/rowStylePicker.js.map +1 -1
  96. package/components/grid/dataGrid.d.ts +218 -206
  97. package/components/grid/dataGrid.js +1629 -1538
  98. package/components/grid/dataGrid.js.map +1 -1
  99. package/components/grid/detail/detailHeaderPanel.d.ts +13 -13
  100. package/components/grid/detail/detailHeaderPanel.js +25 -25
  101. package/components/grid/detail/detailHeaderPanel.js.map +1 -1
  102. package/components/grid/export/contextMenu.d.ts +18 -24
  103. package/components/grid/export/contextMenu.js +116 -113
  104. package/components/grid/export/contextMenu.js.map +1 -1
  105. package/components/grid/export/progressPopup.d.ts +29 -29
  106. package/components/grid/export/progressPopup.js +93 -93
  107. package/components/grid/export/progressPopup.js.map +1 -1
  108. package/components/grid/export/worker/clipboardExport.d.ts +1 -1
  109. package/components/grid/export/worker/clipboardExport.js +8 -8
  110. package/components/grid/export/worker/csvExport.d.ts +1 -1
  111. package/components/grid/export/worker/csvExport.js +8 -8
  112. package/components/grid/export/worker/pdfExport.d.ts +1 -1
  113. package/components/grid/export/worker/pdfExport.js +81 -81
  114. package/components/grid/export/worker/pdfExport.js.map +1 -1
  115. package/components/grid/export/worker/txtExport.d.ts +1 -1
  116. package/components/grid/export/worker/txtExport.js +19 -19
  117. package/components/grid/extendedDataGrid.d.ts +140 -140
  118. package/components/grid/extendedDataGrid.js +704 -695
  119. package/components/grid/extendedDataGrid.js.map +1 -1
  120. package/components/grid/filter/customColumnFilter.d.ts +5 -21
  121. package/components/grid/filter/customColumnFilter.js +11 -82
  122. package/components/grid/filter/customColumnFilter.js.map +1 -1
  123. package/components/grid/filter/dataGridColumnFilter.d.ts +17 -0
  124. package/components/grid/filter/dataGridColumnFilter.js +49 -0
  125. package/components/grid/filter/dataGridColumnFilter.js.map +1 -0
  126. package/components/grid/filter/dateColumnFilter.d.ts +7 -11
  127. package/components/grid/filter/dateColumnFilter.js +22 -56
  128. package/components/grid/filter/dateColumnFilter.js.map +1 -1
  129. package/components/grid/filter/textColumnFilter.d.ts +8 -20
  130. package/components/grid/filter/textColumnFilter.js +24 -76
  131. package/components/grid/filter/textColumnFilter.js.map +1 -1
  132. package/components/grid/filter/wildcardQuickFilterEngine.d.ts +7 -0
  133. package/components/grid/filter/wildcardQuickFilterEngine.js +48 -0
  134. package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -0
  135. package/components/grid/header/simpleHeader.d.ts +17 -16
  136. package/components/grid/header/simpleHeader.js +230 -186
  137. package/components/grid/header/simpleHeader.js.map +1 -1
  138. package/components/grid/panel/dataGridPagination.d.ts +16 -16
  139. package/components/grid/panel/dataGridPagination.js +58 -58
  140. package/components/grid/panel/dataGridPagination.js.map +1 -1
  141. package/components/grid/panel/loadingOverlay.d.ts +6 -6
  142. package/components/grid/panel/loadingOverlay.js +10 -10
  143. package/components/grid/panel/loadingOverlay.js.map +1 -1
  144. package/components/grid/panel/noRecordsOverlay.d.ts +6 -6
  145. package/components/grid/panel/noRecordsOverlay.js +10 -10
  146. package/components/grid/panel/noRecordsOverlay.js.map +1 -1
  147. package/components/grid/panel/tablePagination.d.ts +10 -10
  148. package/components/grid/panel/tablePagination.js +45 -45
  149. package/components/grid/panel/tablePagination.js.map +1 -1
  150. package/components/icons/dropdownArrow.d.ts +8 -0
  151. package/components/icons/dropdownArrow.js +59 -0
  152. package/components/icons/dropdownArrow.js.map +1 -0
  153. package/components/icons/undoIcon.d.ts +8 -8
  154. package/components/icons/undoIcon.js +6 -6
  155. package/components/input/autoCompleteInput.d.ts +35 -35
  156. package/components/input/autoCompleteInput.js +122 -121
  157. package/components/input/autoCompleteInput.js.map +1 -1
  158. package/components/input/draftUtils.d.ts +4 -4
  159. package/components/input/draftUtils.js +48 -48
  160. package/components/input/draftUtils.js.map +1 -1
  161. package/components/input/draftail.d.ts +1 -1
  162. package/components/input/draftail.js +1 -1
  163. package/components/input/hexaFormattedInput.d.ts +16 -16
  164. package/components/input/hexaFormattedInput.js +54 -54
  165. package/components/input/hexaFormattedInput.js.map +1 -1
  166. package/components/input/mask/helpers.d.ts +28 -28
  167. package/components/input/mask/helpers.js +112 -112
  168. package/components/input/mask/helpers.js.map +1 -1
  169. package/components/input/mask/inputMaskCore.d.ts +46 -46
  170. package/components/input/mask/inputMaskCore.js +278 -278
  171. package/components/input/mask/inputMaskCore.js.map +1 -1
  172. package/components/input/mask/pattern.d.ts +20 -20
  173. package/components/input/mask/pattern.js +78 -78
  174. package/components/input/mask/pattern.js.map +1 -1
  175. package/components/input/maskedInput.d.ts +373 -351
  176. package/components/input/maskedInput.js +224 -224
  177. package/components/input/maskedInput.js.map +1 -1
  178. package/components/input/passwordInput.d.ts +9 -9
  179. package/components/input/passwordInput.js +55 -55
  180. package/components/input/passwordInput.js.map +1 -1
  181. package/components/input/simpleAutoComplete.d.ts +12 -12
  182. package/components/input/simpleAutoComplete.js +41 -43
  183. package/components/input/simpleAutoComplete.js.map +1 -1
  184. package/components/input/textarea/extractSpansOfClasses.d.ts +15 -15
  185. package/components/input/textarea/extractSpansOfClasses.js +96 -96
  186. package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
  187. package/components/input/textarea/getRanges.d.ts +1 -1
  188. package/components/input/textarea/getRanges.js +73 -73
  189. package/components/input/textarea/getRanges.js.map +1 -1
  190. package/components/input/textarea/getType.d.ts +1 -1
  191. package/components/input/textarea/getType.js +26 -26
  192. package/components/input/textarea/getType.js.map +1 -1
  193. package/components/input/textarea/highlighedContents.d.ts +6 -6
  194. package/components/input/textarea/highlighedContents.js +10 -10
  195. package/components/input/textarea/mentionsWithHighlighting.d.ts +27 -27
  196. package/components/input/textarea/mentionsWithHighlighting.js +60 -60
  197. package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
  198. package/components/keyboard/keyboardUtils.d.ts +5 -5
  199. package/components/keyboard/keyboardUtils.js +32 -32
  200. package/components/modal/draggableModalProvider.d.ts +4 -4
  201. package/components/modal/draggableModalProvider.js +21 -21
  202. package/components/modal/draggableModalProvider.js.map +1 -1
  203. package/components/modal/impl/clamp.d.ts +1 -1
  204. package/components/modal/impl/clamp.js +1 -1
  205. package/components/modal/impl/clamp.js.map +1 -1
  206. package/components/modal/impl/draggableModal.d.ts +12 -12
  207. package/components/modal/impl/draggableModal.js +17 -17
  208. package/components/modal/impl/draggableModal.js.map +1 -1
  209. package/components/modal/impl/draggableModalContext.d.ts +9 -9
  210. package/components/modal/impl/draggableModalContext.js +2 -2
  211. package/components/modal/impl/draggableModalContext.js.map +1 -1
  212. package/components/modal/impl/draggableModalInner.d.ts +15 -13
  213. package/components/modal/impl/draggableModalInner.js +57 -55
  214. package/components/modal/impl/draggableModalInner.js.map +1 -1
  215. package/components/modal/impl/draggableModalReducer.d.ts +66 -62
  216. package/components/modal/impl/draggableModalReducer.js +77 -78
  217. package/components/modal/impl/draggableModalReducer.js.map +1 -1
  218. package/components/modal/impl/getWindowSize.d.ts +4 -4
  219. package/components/modal/impl/getWindowSize.js +4 -4
  220. package/components/modal/impl/getWindowSize.js.map +1 -1
  221. package/components/modal/impl/index.d.ts +3 -3
  222. package/components/modal/impl/index.js +3 -3
  223. package/components/modal/impl/index.js.map +1 -1
  224. package/components/modal/impl/resizeHandle.d.ts +3 -3
  225. package/components/modal/impl/resizeHandle.js +4 -4
  226. package/components/modal/impl/resizeHandle.js.map +1 -1
  227. package/components/modal/impl/useDrag.d.ts +5 -5
  228. package/components/modal/impl/useDrag.js +42 -42
  229. package/components/modal/impl/useDrag.js.map +1 -1
  230. package/components/modal/impl/usePrevious.d.ts +1 -1
  231. package/components/modal/impl/usePrevious.js +8 -8
  232. package/components/modal/impl/usePrevious.js.map +1 -1
  233. package/components/modal/impl/useResize.d.ts +7 -7
  234. package/components/modal/impl/useResize.js +46 -46
  235. package/components/modal/impl/useResize.js.map +1 -1
  236. package/components/modal/modalDialog.d.ts +49 -49
  237. package/components/modal/modalDialog.js +152 -152
  238. package/components/modal/modalDialog.js.map +1 -1
  239. package/components/picker/enumValuePicker.d.ts +16 -16
  240. package/components/picker/enumValuePicker.js +34 -34
  241. package/components/picker/enumValuePicker.js.map +1 -1
  242. package/components/platformSpecific.d.ts +10 -10
  243. package/components/platformSpecific.js +27 -27
  244. package/components/scrollTo/onlyText.d.ts +4 -4
  245. package/components/scrollTo/onlyText.js +30 -30
  246. package/components/scrollTo/onlyText.js.map +1 -1
  247. package/components/scrollTo/scrollTo.d.ts +41 -39
  248. package/components/scrollTo/scrollTo.js +264 -264
  249. package/components/scrollTo/scrollTo.js.map +1 -1
  250. package/components/style/withCss.d.ts +9 -0
  251. package/components/style/withCss.js +6 -0
  252. package/components/style/withCss.js.map +1 -0
  253. package/components/style/withInputNumberCss.d.ts +6 -0
  254. package/components/style/withInputNumberCss.js +13 -0
  255. package/components/style/withInputNumberCss.js.map +1 -0
  256. package/components/table/dragSortingTable.d.ts +13 -14
  257. package/components/table/dragSortingTable.js +96 -82
  258. package/components/table/dragSortingTable.js.map +1 -1
  259. package/components/text/impl/innerSize.d.ts +2 -2
  260. package/components/text/impl/innerSize.js +12 -12
  261. package/components/text/impl/series.d.ts +1 -1
  262. package/components/text/impl/series.js +28 -28
  263. package/components/text/impl/shallowEqual.d.ts +1 -1
  264. package/components/text/impl/shallowEqual.js +18 -18
  265. package/components/text/impl/shallowEqual.js.map +1 -1
  266. package/components/text/impl/uniqueId.d.ts +1 -1
  267. package/components/text/impl/uniqueId.js +4 -4
  268. package/components/text/impl/whilst.d.ts +1 -1
  269. package/components/text/impl/whilst.js +19 -19
  270. package/components/text/impl/whilst.js.map +1 -1
  271. package/components/text/textFit.d.ts +38 -38
  272. package/components/text/textFit.js +165 -168
  273. package/components/text/textFit.js.map +1 -1
  274. package/i18n/components.cs.json +101 -100
  275. package/i18n/components.sk.json +101 -100
  276. package/i18n/components.uk.json +101 -100
  277. package/i18n/componentsLocaleHolder.d.ts +3 -3
  278. package/i18n/componentsLocaleHolder.js +28 -28
  279. package/i18n/componentsLocaleHolder.js.map +1 -1
  280. package/package.json +71 -70
  281. package/style/index.less +274 -298
  282. package/style/modal/DraggableModal.css +43 -40
  283. package/style/modal/ResizeHandle.css +27 -19
  284. package/tsconfig.build.json +24 -24
  285. package/tsconfig.json +11 -11
  286. package/components/grid/cell/wildcardQuickFilter.d.ts +0 -11
  287. package/components/grid/cell/wildcardQuickFilter.js +0 -61
  288. package/components/grid/cell/wildcardQuickFilter.js.map +0 -1
  289. package/components/table/dataTable.d.ts +0 -17
  290. package/components/table/dataTable.js +0 -79
  291. package/components/table/dataTable.js.map +0 -1
  292. package/style/antd/antd-tree-showline.css +0 -25
  293. package/style/antd/full-height-tabs.scss +0 -63
  294. package/style/draftail/draftail-editor.css +0 -179
  295. package/style/table/dragSortingTable.css +0 -7
@@ -1,281 +1,270 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React from "react";
13
- import MaskedInput from "d2coreui/components/input/maskedInput";
14
- import moment from "moment";
15
- import { LocaleHolder } from "d2core/i18n/localeHolder";
16
- import { AutoComplete } from "antd";
17
- import { DownOutlined } from "@ant-design/icons";
18
- const DURATION_DATA_MAP = [
19
- { key: "SSS", min: 0, max: 999, len: 3, mult: 1, unit: "ms" },
20
- { key: "s", min: 0, max: 59, len: 2, mult: 1000, unit: "s" },
21
- { key: "m", min: 0, max: 59, len: 2, mult: 60 * 1000, unit: "m" },
22
- { key: "H", min: 0, max: 23, len: 2, mult: 60 * 60 * 1000, unit: "h" },
23
- { key: "D", min: 0, max: 24854, len: 5, mult: 24 * 60 * 60 * 1000, unit: "d" },
24
- ];
25
- export const MAX_VALID_DURATION = 24854 * 24 * 60 * 60 * 1000 + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000 + 499;
26
- export function parseDuration(value, mask, cursorPos, maskResult) {
27
- const result = moment.duration(0);
28
- const clearMaskResult = () => {
29
- if (maskResult) {
30
- maskResult.info = undefined;
31
- maskResult.length = 0;
32
- maskResult.infoFromMask = undefined;
33
- maskResult.time = undefined;
34
- }
35
- };
36
- let maskPos = 0;
37
- let valPos;
38
- for (valPos = 0; valPos < value.length; valPos++) {
39
- const c = value.charAt(valPos);
40
- if (['D', 'H', 'm', 's', 'S'].includes(mask.charAt(maskPos))) {
41
- if (/\d/.test(c)) {
42
- const entry = getInfoFromMask(mask, maskPos);
43
- if (entry) {
44
- let str = c;
45
- while (/\d/.test(value.charAt(valPos + 1))) {
46
- valPos++;
47
- str += value.charAt(valPos);
48
- }
49
- const time = parseInt(str);
50
- result.add(moment.duration(time, entry.infoEntry.unit));
51
- if (maskResult) {
52
- const item = {
53
- value: time,
54
- length: str.length,
55
- infoEntry: entry.infoEntry,
56
- };
57
- if (maskResult.infoFromMask) {
58
- maskResult.infoFromMask.push(item);
59
- }
60
- else {
61
- maskResult.infoFromMask = [item];
62
- }
63
- }
64
- maskPos += entry.length;
65
- if (cursorPos !== undefined && maskResult !== undefined && cursorPos >= valPos - str.length + 1 && cursorPos <= valPos + 1) {
66
- maskResult.info = entry.infoEntry;
67
- maskResult.length = str.length;
68
- }
69
- }
70
- else {
71
- clearMaskResult();
72
- return null;
73
- }
74
- }
75
- else {
76
- clearMaskResult();
77
- return null;
78
- }
79
- }
80
- else {
81
- if (c === mask.charAt(maskPos)) {
82
- maskPos++;
83
- }
84
- }
85
- }
86
- if (maskPos === mask.length && valPos === value.length && result.asMilliseconds() <= MAX_VALID_DURATION) {
87
- if (maskResult !== undefined) {
88
- maskResult.time = result;
89
- }
90
- return result;
91
- }
92
- clearMaskResult();
93
- return null;
94
- }
95
- export default class DurationInput extends React.Component {
96
- constructor(props) {
97
- var _a;
98
- super(props);
99
- this.inputRef = React.createRef();
100
- this.state = {
101
- valid: !!((_a = props.value) === null || _a === void 0 ? void 0 : _a.isValid()),
102
- selectionStart: null,
103
- selectionEnd: null,
104
- currentInfo: {
105
- info: undefined,
106
- infoFromMask: undefined,
107
- time: undefined,
108
- length: 0
109
- },
110
- opened: false,
111
- value: formatDuration(props.value, props.mask),
112
- hover: false,
113
- };
114
- this.recalc = this.recalc.bind(this);
115
- this.increment = this.increment.bind(this);
116
- this.decrement = this.decrement.bind(this);
117
- }
118
- componentDidUpdate() {
119
- var _a, _b;
120
- if (this.inputRef.current !== null) {
121
- this.inputRef.current.input.selectionStart = this.state.selectionStart;
122
- this.inputRef.current.input.selectionEnd = this.state.selectionEnd;
123
- }
124
- const value = formatDuration(this.props.value, this.props.mask);
125
- if (this.state.value !== value) {
126
- this.setState({
127
- value: value,
128
- valid: (_b = (_a = this.props.value) === null || _a === void 0 ? void 0 : _a.isValid()) !== null && _b !== void 0 ? _b : false,
129
- });
130
- }
131
- }
132
- recalc() {
133
- var _a;
134
- if (this.inputRef.current !== null) {
135
- const value = { length: 0 };
136
- parseDuration(this.inputRef.current.input.value, this.props.mask, (_a = this.inputRef.current.input.selectionStart) !== null && _a !== void 0 ? _a : undefined, value);
137
- this.setState({
138
- currentInfo: value,
139
- selectionStart: this.inputRef.current.input.selectionStart,
140
- selectionEnd: this.inputRef.current.input.selectionEnd,
141
- });
142
- }
143
- }
144
- increment() {
145
- var _a, _b, _c, _d, _e;
146
- if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, 1)) {
147
- (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, (_d = (_c = this.props.value) === null || _c === void 0 ? void 0 : _c.add(1, this.state.currentInfo.info.unit)) !== null && _d !== void 0 ? _d : null);
148
- this.setState({ selectionEnd: this.state.selectionStart });
149
- }
150
- (_e = this.inputRef.current) === null || _e === void 0 ? void 0 : _e.focus();
151
- }
152
- decrement() {
153
- var _a, _b, _c, _d, _e;
154
- if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, -1)) {
155
- (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, (_d = (_c = this.props.value) === null || _c === void 0 ? void 0 : _c.subtract(1, this.state.currentInfo.info.unit)) !== null && _d !== void 0 ? _d : null);
156
- this.setState({ selectionEnd: this.state.selectionStart });
157
- }
158
- (_e = this.inputRef.current) === null || _e === void 0 ? void 0 : _e.focus();
159
- }
160
- get input() {
161
- var _a;
162
- return (_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
163
- }
164
- focus() {
165
- var _a;
166
- (_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
167
- }
168
- render() {
169
- const _a = this.props, { mask, value, onChange, style, disabled, predefinedValues, autoFocus } = _a, props = __rest(_a, ["mask", "value", "onChange", "style", "disabled", "predefinedValues", "autoFocus"]);
170
- const incrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, 1);
171
- const decrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, -1);
172
- return (React.createElement("div", Object.assign({ style: Object.assign({}, style, {
173
- display: "flex",
174
- flexDirection: "row",
175
- alignItems: "center",
176
- position: "relative",
177
- }) }, props, { onKeyDown: (event) => {
178
- if (event.keyCode === 38) {
179
- this.increment();
180
- event.preventDefault();
181
- event.stopPropagation();
182
- }
183
- else if (event.keyCode === 40) {
184
- this.decrement();
185
- event.preventDefault();
186
- event.stopPropagation();
187
- }
188
- }, onMouseEnter: () => {
189
- this.setState({ hover: true });
190
- }, onMouseLeave: () => {
191
- this.setState({ hover: false });
192
- } }),
193
- React.createElement(AutoComplete, { className: (this.state.opened ? "autocomplete-open" : "") + " " + (this.state.valid ? "" : "invalid"), options: this.state.opened ? predefinedValues === null || predefinedValues === void 0 ? void 0 : predefinedValues.map(v => {
194
- return { value: v.value, label: v.key };
195
- }) : [], defaultOpen: false, defaultActiveFirstOption: false, defaultValue: undefined, disabled: disabled, autoFocus: autoFocus, style: { width: "100%" }, value: this.state.valid ? this.state.value : "", onSelect: (e) => {
196
- const val = moment.duration(Number(e));
197
- this.setState({
198
- opened: false,
199
- valid: val !== undefined && val.isValid(),
200
- value: formatDuration(val, this.props.mask),
201
- });
202
- onChange === null || onChange === void 0 ? void 0 : onChange(val === undefined ? null : val);
203
- }, onBlur: () => {
204
- this.setState({ opened: false });
205
- } },
206
- React.createElement(MaskedInput, { mask: this.props.mask.replace(/[a-zA-Z]/g, '1'), ref: this.inputRef, style: this.props.inputStyle, placeholder: this.props.mask.replace(/[a-zA-Z]/g, '_'), autoFocus: autoFocus, onFocus: (event => {
207
- event.target.selectionStart = event.target.selectionEnd = this.state.selectionStart;
208
- }), suffix: this.props.predefinedValues !== undefined && this.props.predefinedValues.length > 0 &&
209
- React.createElement("span", { className: "dropdown-arrow" },
210
- React.createElement(DownOutlined, { className: "dropdown-arrow-icon ant-input-clear-icon", role: "button", tabIndex: -1, onClick: () => {
211
- if (!this.props.disabled) {
212
- this.setState({ opened: !this.state.opened });
213
- }
214
- } })), onMouseUp: this.recalc, onKeyUp: this.recalc, onChange: (event) => {
215
- var _a;
216
- const value = { length: 0 };
217
- parseDuration(event.target.value, this.props.mask, (_a = event.target.selectionStart) !== null && _a !== void 0 ? _a : undefined, value);
218
- onChange === null || onChange === void 0 ? void 0 : onChange(value.time === undefined ? null : value.time);
219
- this.setState({
220
- valid: value.time !== undefined && value.time.isValid(),
221
- currentInfo: value,
222
- value: event.target.value,
223
- });
224
- } })),
225
- React.createElement("div", { style: { position: "absolute", right: 2, height: 30 } },
226
- React.createElement("div", { className: "ant-input-number-handler-wrap", ref: ref => {
227
- if (ref) {
228
- ref.style.setProperty("opacity", this.state.hover ? "1" : "0", "important");
229
- }
230
- } },
231
- React.createElement("span", { onClick: this.increment, unselectable: "on", role: "button", "aria-label": "Increase Value", className: `ant-input-number-handler ant-input-number-handler-up ${incrementButtonDisabled ? "ant-input-number-handler-up-disabled" : ""}` },
232
- React.createElement("span", { role: "img", "aria-label": "up", className: "anticon anticon-up ant-input-number-handler-up-inner" },
233
- React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "up", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
234
- React.createElement("path", { d: "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" })))),
235
- React.createElement("span", { onClick: this.decrement, unselectable: "on", role: "button", "aria-label": "Decrease Value", className: `ant-input-number-handler ant-input-number-handler-down ${decrementButtonDisabled ? "ant-input-number-handler-down-disabled" : ""}` },
236
- React.createElement("span", { role: "img", "aria-label": "down", className: "anticon anticon-down ant-input-number-handler-down-inner" },
237
- React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "down", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
238
- React.createElement("path", { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" }))))))));
239
- }
240
- }
241
- function checkValue(info, value, offset = 0) {
242
- var _a;
243
- const currentMillis = value ? value.clone().add(offset, (_a = info.info) === null || _a === void 0 ? void 0 : _a.unit).asMilliseconds() : 0;
244
- const maxValues = (info === null || info === void 0 ? void 0 : info.infoFromMask) ? info.infoFromMask.map((i) => (i.length !== i.infoEntry.len ? (Math.pow(10, i.length) - 1) : i.infoEntry.max) * i.infoEntry.mult) : [];
245
- const maxMaskedValue = (info === null || info === void 0 ? void 0 : info.infoFromMask) ? maxValues.reduce((p, n) => p + n, 0) : 0;
246
- return !!value && currentMillis >= 0 && currentMillis <= MAX_VALID_DURATION && currentMillis <= maxMaskedValue;
247
- }
248
- function formatDuration(value, mask) {
249
- return (value !== null && value !== void 0 ? value : moment.duration(0)).locale("locale.d2000").format(mask, {
250
- trim: false,
251
- decimalSeparator: LocaleHolder.decimalSeparator,
252
- useGrouping: false,
253
- groupingSeparator: "",
254
- userLocale: LocaleHolder.formattingLocale
255
- });
256
- }
257
- function getInfoFromMask(mask, fromPos) {
258
- if (fromPos < mask.length) {
259
- const ch = mask.charAt(fromPos);
260
- const info = DURATION_DATA_MAP.find((d) => d.key.includes(ch));
261
- if (info) {
262
- const entry = {
263
- length: 1,
264
- value: 0,
265
- infoEntry: info,
266
- };
267
- for (let i = fromPos + 1; i < mask.length; i++) {
268
- const c = mask.charAt(i);
269
- if (c === ch) {
270
- entry.length++;
271
- }
272
- else {
273
- break;
274
- }
275
- }
276
- return entry;
277
- }
278
- }
279
- return undefined;
280
- }
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from "react";
13
+ import MaskedInput from "d2coreui/components/input/maskedInput";
14
+ import dayjs, { isDuration } from "dayjs";
15
+ import { LocaleHolder } from "d2core/i18n/localeHolder";
16
+ import { AutoComplete } from "antd";
17
+ import DropdownArrow from "../icons/dropdownArrow";
18
+ import WithInputNumberCss from "d2coreui/components/style/withInputNumberCss";
19
+ const DURATION_DATA_MAP = [
20
+ { key: "SSS", min: 0, max: 999, minLen: 3, maxLen: 3, mult: 1, unit: "ms" },
21
+ { key: "s", min: 0, max: 59, minLen: 1, maxLen: 2, mult: 1000, unit: "s" },
22
+ { key: "m", min: 0, max: 59, minLen: 1, maxLen: 2, mult: 60 * 1000, unit: "m" },
23
+ { key: "H", min: 0, max: 23, minLen: 1, maxLen: 2, mult: 60 * 60 * 1000, unit: "h" },
24
+ { key: "D", min: 0, max: 24854, minLen: 1, maxLen: 5, mult: 24 * 60 * 60 * 1000, unit: "d" },
25
+ ];
26
+ export const MAX_VALID_DURATION = 24854 * 24 * 60 * 60 * 1000 + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000 + 499;
27
+ export function parseDuration(value, mask, cursorPos, maskResult) {
28
+ let result = dayjs.duration(0);
29
+ const clearMaskResult = () => {
30
+ if (maskResult) {
31
+ maskResult.info = undefined;
32
+ maskResult.length = 0;
33
+ maskResult.infoFromMask = undefined;
34
+ maskResult.time = undefined;
35
+ }
36
+ };
37
+ let maskPos = 0;
38
+ let valPos;
39
+ for (valPos = 0; valPos < value.length; valPos++) {
40
+ const c = value.charAt(valPos);
41
+ if (['D', 'H', 'm', 's', 'S'].includes(mask.charAt(maskPos))) {
42
+ if (/\d/.test(c)) {
43
+ const entry = getInfoFromMask(mask, maskPos);
44
+ if (entry) {
45
+ let str = c;
46
+ while (/\d/.test(value.charAt(valPos + 1))) {
47
+ valPos++;
48
+ str += value.charAt(valPos);
49
+ }
50
+ if (str.length !== entry.length) {
51
+ clearMaskResult();
52
+ return null;
53
+ }
54
+ const time = parseInt(str);
55
+ result = result.add(dayjs.duration(time, entry.infoEntry.unit));
56
+ if (maskResult) {
57
+ const item = {
58
+ value: time,
59
+ length: str.length,
60
+ infoEntry: entry.infoEntry,
61
+ };
62
+ if (maskResult.infoFromMask) {
63
+ maskResult.infoFromMask.push(item);
64
+ }
65
+ else {
66
+ maskResult.infoFromMask = [item];
67
+ }
68
+ }
69
+ maskPos += entry.length;
70
+ if (cursorPos !== undefined && maskResult !== undefined && cursorPos >= valPos - str.length + 1 && cursorPos <= valPos + 1) {
71
+ maskResult.info = entry.infoEntry;
72
+ maskResult.length = str.length;
73
+ }
74
+ }
75
+ else {
76
+ clearMaskResult();
77
+ return null;
78
+ }
79
+ }
80
+ else {
81
+ clearMaskResult();
82
+ return null;
83
+ }
84
+ }
85
+ else {
86
+ if (c === mask.charAt(maskPos)) {
87
+ maskPos++;
88
+ }
89
+ }
90
+ }
91
+ if (maskPos === mask.length && valPos === value.length && result.asMilliseconds() <= MAX_VALID_DURATION) {
92
+ if (maskResult !== undefined) {
93
+ maskResult.time = result;
94
+ }
95
+ return result;
96
+ }
97
+ clearMaskResult();
98
+ return null;
99
+ }
100
+ export default class DurationInput extends React.Component {
101
+ constructor(props) {
102
+ super(props);
103
+ this.inputRef = React.createRef();
104
+ this.state = {
105
+ valid: isDuration(props.value),
106
+ selectionStart: null,
107
+ selectionEnd: null,
108
+ currentInfo: {
109
+ info: undefined,
110
+ infoFromMask: undefined,
111
+ time: undefined,
112
+ length: 0
113
+ },
114
+ opened: false,
115
+ value: formatDuration(props.value, props.mask),
116
+ };
117
+ this.recalc = this.recalc.bind(this);
118
+ this.increment = this.increment.bind(this);
119
+ this.decrement = this.decrement.bind(this);
120
+ }
121
+ componentDidUpdate() {
122
+ if (this.inputRef.current !== null) {
123
+ this.inputRef.current.input.selectionStart = this.state.selectionStart;
124
+ this.inputRef.current.input.selectionEnd = this.state.selectionEnd;
125
+ }
126
+ const value = formatDuration(this.props.value, this.props.mask);
127
+ if (this.state.value !== value) {
128
+ this.setState({
129
+ value: value,
130
+ valid: isDuration(this.props.value),
131
+ });
132
+ }
133
+ }
134
+ recalc() {
135
+ var _a;
136
+ if (this.inputRef.current !== null) {
137
+ const value = { length: 0 };
138
+ parseDuration(this.inputRef.current.input.value, this.props.mask, (_a = this.inputRef.current.input.selectionStart) !== null && _a !== void 0 ? _a : undefined, value);
139
+ this.setState({
140
+ currentInfo: value,
141
+ selectionStart: this.inputRef.current.input.selectionStart,
142
+ selectionEnd: this.inputRef.current.input.selectionEnd,
143
+ });
144
+ }
145
+ }
146
+ increment() {
147
+ var _a, _b, _c, _d, _e;
148
+ if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, 1)) {
149
+ (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, (_d = (_c = this.props.value) === null || _c === void 0 ? void 0 : _c.add(1, this.state.currentInfo.info.unit)) !== null && _d !== void 0 ? _d : null);
150
+ this.setState({ selectionEnd: this.state.selectionStart });
151
+ }
152
+ (_e = this.inputRef.current) === null || _e === void 0 ? void 0 : _e.focus();
153
+ }
154
+ decrement() {
155
+ var _a, _b, _c, _d, _e;
156
+ if (this.state.currentInfo.info !== undefined && checkValue(this.state.currentInfo, this.props.value, -1)) {
157
+ (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, (_d = (_c = this.props.value) === null || _c === void 0 ? void 0 : _c.subtract(1, this.state.currentInfo.info.unit)) !== null && _d !== void 0 ? _d : null);
158
+ this.setState({ selectionEnd: this.state.selectionStart });
159
+ }
160
+ (_e = this.inputRef.current) === null || _e === void 0 ? void 0 : _e.focus();
161
+ }
162
+ get input() {
163
+ var _a;
164
+ return (_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
165
+ }
166
+ focus() {
167
+ var _a;
168
+ (_a = this.inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
169
+ }
170
+ render() {
171
+ const _a = this.props, { mask, value, onChange, style, disabled, predefinedValues, autoFocus, size } = _a, props = __rest(_a, ["mask", "value", "onChange", "style", "disabled", "predefinedValues", "autoFocus", "size"]);
172
+ const incrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, 1);
173
+ const decrementButtonDisabled = this.state.currentInfo.info === undefined || !checkValue(this.state.currentInfo, this.props.value, -1);
174
+ return (React.createElement(WithInputNumberCss, null,
175
+ React.createElement("div", Object.assign({ style: Object.assign({ width: "100%" }, style) }, props, { className: !predefinedValues ? "ant-input-number ant-input-number-outlined" : "", onKeyDown: (event) => {
176
+ if (event.code === "ArrowUp") {
177
+ this.increment();
178
+ event.preventDefault();
179
+ event.stopPropagation();
180
+ }
181
+ else if (event.code === "ArrowDown") {
182
+ this.decrement();
183
+ event.preventDefault();
184
+ event.stopPropagation();
185
+ }
186
+ } }),
187
+ React.createElement(AutoComplete, { className: this.state.valid ? "" : "invalid", options: this.state.opened ? predefinedValues === null || predefinedValues === void 0 ? void 0 : predefinedValues.map(v => {
188
+ return { value: v.value, label: v.key };
189
+ }) : [], defaultOpen: false, defaultActiveFirstOption: false, defaultValue: undefined, disabled: disabled, autoFocus: autoFocus, style: { width: "100%", height: "inherit" }, value: this.state.valid ? this.state.value : "", onSelect: (e) => {
190
+ const val = dayjs.duration(Number(e));
191
+ this.setState({
192
+ opened: false,
193
+ valid: isDuration(val),
194
+ value: formatDuration(val, this.props.mask),
195
+ });
196
+ onChange === null || onChange === void 0 ? void 0 : onChange(val === undefined ? null : val);
197
+ }, onBlur: () => {
198
+ this.setState({ opened: false });
199
+ } },
200
+ React.createElement(MaskedInput, { mask: this.props.mask.replace(/[a-zA-Z]/g, '1'), ref: this.inputRef, style: Object.assign({ border: predefinedValues ? undefined : "none" }, this.props.inputStyle), size: size, placeholder: this.props.mask.replace(/[a-zA-Z]/g, '_'), autoFocus: autoFocus, onFocus: (event => {
201
+ event.target.selectionStart = event.target.selectionEnd = this.state.selectionStart;
202
+ }), suffix: this.props.predefinedValues !== undefined && this.props.predefinedValues.length > 0 &&
203
+ React.createElement(DropdownArrow, { opened: this.state.opened, onClick: () => {
204
+ if (!this.props.disabled) {
205
+ this.setState({ opened: !this.state.opened });
206
+ }
207
+ } }), onMouseUp: this.recalc, onKeyUp: this.recalc, onChange: (event) => {
208
+ var _a;
209
+ const value = { length: 0 };
210
+ parseDuration(event.target.value, this.props.mask, (_a = event.target.selectionStart) !== null && _a !== void 0 ? _a : undefined, value);
211
+ onChange === null || onChange === void 0 ? void 0 : onChange(value.time === undefined ? null : value.time);
212
+ this.setState({
213
+ valid: isDuration(value.time),
214
+ currentInfo: value,
215
+ value: event.target.value,
216
+ });
217
+ } })),
218
+ !predefinedValues && !disabled &&
219
+ React.createElement("div", { className: "ant-input-number-handler-wrap" },
220
+ React.createElement("span", { onClick: this.increment, className: `ant-input-number-handler ant-input-number-handler-up ${incrementButtonDisabled ? "ant-input-number-handler-up-disabled" : ""}` },
221
+ React.createElement("span", { className: "anticon anticon-up ant-input-number-handler-up-inner" },
222
+ React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "up", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
223
+ React.createElement("path", { d: "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" })))),
224
+ React.createElement("span", { onClick: this.decrement, className: `ant-input-number-handler ant-input-number-handler-down ${decrementButtonDisabled ? "ant-input-number-handler-down-disabled" : ""}` },
225
+ React.createElement("span", { className: "anticon anticon-down ant-input-number-handler-down-inner" },
226
+ React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "down", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
227
+ React.createElement("path", { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" }))))))));
228
+ }
229
+ }
230
+ function checkValue(info, value, offset = 0) {
231
+ var _a;
232
+ const currentMillis = value ? value.add(offset, (_a = info.info) === null || _a === void 0 ? void 0 : _a.unit).asMilliseconds() : 0;
233
+ const maxValues = (info === null || info === void 0 ? void 0 : info.infoFromMask) ? info.infoFromMask.map((i) => (i.length !== i.infoEntry.maxLen ? (Math.pow(10, i.length) - 1) : i.infoEntry.max) * i.infoEntry.mult) : [];
234
+ const maxMaskedValue = (info === null || info === void 0 ? void 0 : info.infoFromMask) ? maxValues.reduce((p, n) => p + n, 0) : 0;
235
+ return !!value && currentMillis >= 0 && currentMillis <= MAX_VALID_DURATION && currentMillis <= maxMaskedValue;
236
+ }
237
+ function formatDuration(value, mask) {
238
+ return (isDuration(value) ? value : dayjs.duration(0)).locale("locale.d2000").format(mask, {
239
+ trim: false,
240
+ decimalSeparator: LocaleHolder.decimalSeparator,
241
+ useGrouping: false,
242
+ groupingSeparator: "",
243
+ userLocale: LocaleHolder.formattingLocale
244
+ });
245
+ }
246
+ function getInfoFromMask(mask, fromPos) {
247
+ if (fromPos < mask.length) {
248
+ const ch = mask.charAt(fromPos);
249
+ const info = DURATION_DATA_MAP.find((d) => d.key.includes(ch));
250
+ if (info) {
251
+ const entry = {
252
+ length: 1,
253
+ value: 0,
254
+ infoEntry: info,
255
+ };
256
+ for (let i = fromPos + 1; i < mask.length; i++) {
257
+ const c = mask.charAt(i);
258
+ if (c === ch) {
259
+ entry.length++;
260
+ }
261
+ else {
262
+ break;
263
+ }
264
+ }
265
+ return entry;
266
+ }
267
+ }
268
+ return undefined;
269
+ }
281
270
  //# sourceMappingURL=durationInput.js.map