d2coreui 23.0.15 → 23.0.16

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 (403) hide show
  1. package/components/color/colorSwatch.d.ts +13 -18
  2. package/components/grid/cell/rangeSelector.d.ts +78 -9
  3. package/components/grid/cell/rangeSelector.js +527 -674
  4. package/{lib/esm/components → components}/grid/export/contextMenu.js +4 -4
  5. package/components/input/draftail.d.ts +1 -186
  6. package/components/input/draftail.js +2 -1
  7. package/i18n/components.cs.json +101 -101
  8. package/i18n/components.sk.json +101 -101
  9. package/i18n/components.uk.json +101 -101
  10. package/i18n/componentsLocaleHolder.js +29 -24
  11. package/package.json +1 -1
  12. package/tsconfig.build.json +24 -24
  13. package/tsconfig.json +11 -11
  14. package/components/clipboard/clipboardUtils.ts +0 -53
  15. package/components/codemirror/SyntaxHighlighter.tsx +0 -58
  16. package/components/collapse/expandable.tsx +0 -48
  17. package/components/color/colorPicker.tsx +0 -121
  18. package/components/color/colorSwatch.jsx +0 -87
  19. package/components/color/colorUtils.ts +0 -60
  20. package/components/date/dateRangeInput.tsx +0 -468
  21. package/components/date/dateRangeInputAdvancedPanel.tsx +0 -238
  22. package/components/date/dateRangeInputConfirm.tsx +0 -200
  23. package/components/date/dateTimeInput.tsx +0 -633
  24. package/components/date/durationInput.tsx +0 -375
  25. package/components/form/NiceFormItem.tsx +0 -32
  26. package/components/grid/cell/beanAccessor.ts +0 -17
  27. package/components/grid/cell/cellEditorUtils.ts +0 -12
  28. package/components/grid/cell/customEnumCellEditor.tsx +0 -130
  29. package/components/grid/cell/dataGridCellEditorComponent.tsx +0 -61
  30. package/components/grid/cell/dateCellEditor.tsx +0 -83
  31. package/components/grid/cell/durationCellEditor.tsx +0 -105
  32. package/components/grid/cell/hexaOctetStringCellEditor.tsx +0 -101
  33. package/components/grid/cell/hexaValueCellEditor.tsx +0 -92
  34. package/components/grid/cell/numberCellEditor.tsx +0 -115
  35. package/components/grid/cell/simpleStatusTextCellEditor.tsx +0 -168
  36. package/components/grid/cell/statusTextCellEditor.tsx +0 -198
  37. package/components/grid/cell/tableDefaultRowStyleRules.ts +0 -51
  38. package/components/grid/cell/textCellEditor.tsx +0 -94
  39. package/components/grid/cell/withAgGridHooks.tsx +0 -15
  40. package/components/grid/columnUtils.ts +0 -29
  41. package/components/grid/config/columnTransfer.tsx +0 -258
  42. package/components/grid/config/dataGridEditor.tsx +0 -328
  43. package/components/grid/config/rowHeightCalculator.tsx +0 -29
  44. package/components/grid/config/rowStylePicker.tsx +0 -196
  45. package/components/grid/dataGrid.tsx +0 -2183
  46. package/components/grid/detail/detailHeaderPanel.tsx +0 -59
  47. package/components/grid/export/contextMenu.tsx +0 -154
  48. package/components/grid/export/progressPopup.tsx +0 -106
  49. package/components/grid/export/worker/clipboardExport.ts +0 -10
  50. package/components/grid/export/worker/csvExport.ts +0 -10
  51. package/components/grid/export/worker/pdfExport.ts +0 -98
  52. package/components/grid/export/worker/txtExport.ts +0 -21
  53. package/components/grid/extendedDataGrid.tsx +0 -974
  54. package/components/grid/filter/customColumnFilter.tsx +0 -14
  55. package/components/grid/filter/dataGridColumnFilter.tsx +0 -70
  56. package/components/grid/filter/dateColumnFilter.tsx +0 -34
  57. package/components/grid/filter/textColumnFilter.tsx +0 -37
  58. package/components/grid/filter/wildcardQuickFilterEngine.ts +0 -50
  59. package/components/grid/header/simpleHeader.tsx +0 -270
  60. package/components/grid/panel/dataGridPagination.tsx +0 -123
  61. package/components/grid/panel/loadingOverlay.tsx +0 -14
  62. package/components/grid/panel/noRecordsOverlay.tsx +0 -16
  63. package/components/grid/panel/tablePagination.tsx +0 -77
  64. package/components/icons/dropdownArrow.tsx +0 -67
  65. package/components/icons/undoIcon.tsx +0 -16
  66. package/components/input/autoCompleteInput.tsx +0 -174
  67. package/components/input/draftUtils.tsx +0 -62
  68. package/components/input/hexaFormattedInput.tsx +0 -64
  69. package/components/input/mask/helpers.ts +0 -154
  70. package/components/input/mask/inputMaskCore.ts +0 -452
  71. package/components/input/mask/pattern.ts +0 -122
  72. package/components/input/maskedInput.tsx +0 -275
  73. package/components/input/passwordInput.tsx +0 -62
  74. package/components/input/simpleAutoComplete.tsx +0 -60
  75. package/components/input/textarea/extractSpansOfClasses.tsx +0 -125
  76. package/components/input/textarea/getRanges.ts +0 -82
  77. package/components/input/textarea/getType.ts +0 -23
  78. package/components/input/textarea/highlighedContents.tsx +0 -20
  79. package/components/input/textarea/highlightedTextarea.css +0 -61
  80. package/components/input/textarea/mentionsWithHighlighting.tsx +0 -95
  81. package/components/keyboard/keyboardUtils.ts +0 -42
  82. package/components/modal/draggableModalProvider.tsx +0 -37
  83. package/components/modal/impl/clamp.ts +0 -4
  84. package/components/modal/impl/draggableModal.tsx +0 -36
  85. package/components/modal/impl/draggableModalContext.ts +0 -14
  86. package/components/modal/impl/draggableModalInner.tsx +0 -114
  87. package/components/modal/impl/draggableModalReducer.ts +0 -285
  88. package/components/modal/impl/getWindowSize.ts +0 -6
  89. package/components/modal/impl/index.ts +0 -5
  90. package/components/modal/impl/resizeHandle.tsx +0 -12
  91. package/components/modal/impl/useDrag.ts +0 -57
  92. package/components/modal/impl/usePrevious.ts +0 -11
  93. package/components/modal/impl/useResize.ts +0 -79
  94. package/components/modal/modalDialog.tsx +0 -172
  95. package/components/picker/enumValuePicker.tsx +0 -48
  96. package/components/platformSpecific.ts +0 -39
  97. package/components/scrollTo/dom-scroll-into-view.d.ts +0 -1
  98. package/components/scrollTo/onlyText.ts +0 -36
  99. package/components/scrollTo/scrollTo.tsx +0 -324
  100. package/components/style/withCss.tsx +0 -14
  101. package/components/style/withInputNumberCss.tsx +0 -18
  102. package/components/svg.d.ts +0 -1
  103. package/components/table/dragSortingTable.tsx +0 -123
  104. package/components/text/impl/innerSize.ts +0 -15
  105. package/components/text/impl/series.ts +0 -37
  106. package/components/text/impl/shallowEqual.ts +0 -19
  107. package/components/text/impl/uniqueId.ts +0 -5
  108. package/components/text/impl/whilst.ts +0 -25
  109. package/components/text/textFit.tsx +0 -229
  110. package/i18n/componentsLocaleLoader.d.ts +0 -9
  111. package/lib/esm/components/color/colorSwatch.d.ts +0 -13
  112. package/lib/esm/components/grid/cell/rangeSelector.d.ts +0 -78
  113. package/lib/esm/components/grid/cell/rangeSelector.js +0 -527
  114. package/lib/esm/components/input/draftail.d.ts +0 -1
  115. package/lib/esm/components/input/draftail.js +0 -2
  116. package/lib/esm/i18n/components.cs.json +0 -101
  117. package/lib/esm/i18n/components.sk.json +0 -101
  118. package/lib/esm/i18n/components.uk.json +0 -101
  119. package/lib/esm/i18n/componentsLocaleHolder.js +0 -29
  120. package/lib/esm/package.json +0 -70
  121. package/lib/esm/tsconfig.build.json +0 -24
  122. package/lib/esm/tsconfig.json +0 -11
  123. /package/{lib/esm/components → components}/clipboard/clipboardUtils.d.ts +0 -0
  124. /package/{lib/esm/components → components}/clipboard/clipboardUtils.js +0 -0
  125. /package/{lib/esm/components → components}/clipboard/clipboardUtils.js.map +0 -0
  126. /package/{lib/esm/components → components}/codemirror/SyntaxHighlighter.d.ts +0 -0
  127. /package/{lib/esm/components → components}/codemirror/SyntaxHighlighter.js +0 -0
  128. /package/{lib/esm/components → components}/codemirror/SyntaxHighlighter.js.map +0 -0
  129. /package/{lib/esm/components → components}/collapse/expandable.d.ts +0 -0
  130. /package/{lib/esm/components → components}/collapse/expandable.js +0 -0
  131. /package/{lib/esm/components → components}/collapse/expandable.js.map +0 -0
  132. /package/{lib/esm/components → components}/color/colorPicker.d.ts +0 -0
  133. /package/{lib/esm/components → components}/color/colorPicker.js +0 -0
  134. /package/{lib/esm/components → components}/color/colorPicker.js.map +0 -0
  135. /package/{lib/esm/components → components}/color/colorSwatch.js +0 -0
  136. /package/{lib/esm/components → components}/color/colorSwatch.js.map +0 -0
  137. /package/{lib/esm/components → components}/color/colorUtils.d.ts +0 -0
  138. /package/{lib/esm/components → components}/color/colorUtils.js +0 -0
  139. /package/{lib/esm/components → components}/color/colorUtils.js.map +0 -0
  140. /package/{lib/esm/components → components}/date/dateRangeInput.d.ts +0 -0
  141. /package/{lib/esm/components → components}/date/dateRangeInput.js +0 -0
  142. /package/{lib/esm/components → components}/date/dateRangeInput.js.map +0 -0
  143. /package/{lib/esm/components → components}/date/dateRangeInputAdvancedPanel.d.ts +0 -0
  144. /package/{lib/esm/components → components}/date/dateRangeInputAdvancedPanel.js +0 -0
  145. /package/{lib/esm/components → components}/date/dateRangeInputAdvancedPanel.js.map +0 -0
  146. /package/{lib/esm/components → components}/date/dateRangeInputConfirm.d.ts +0 -0
  147. /package/{lib/esm/components → components}/date/dateRangeInputConfirm.js +0 -0
  148. /package/{lib/esm/components → components}/date/dateRangeInputConfirm.js.map +0 -0
  149. /package/{lib/esm/components → components}/date/dateTimeInput.d.ts +0 -0
  150. /package/{lib/esm/components → components}/date/dateTimeInput.js +0 -0
  151. /package/{lib/esm/components → components}/date/dateTimeInput.js.map +0 -0
  152. /package/{lib/esm/components → components}/date/durationInput.d.ts +0 -0
  153. /package/{lib/esm/components → components}/date/durationInput.js +0 -0
  154. /package/{lib/esm/components → components}/date/durationInput.js.map +0 -0
  155. /package/{lib/esm/components → components}/form/NiceFormItem.d.ts +0 -0
  156. /package/{lib/esm/components → components}/form/NiceFormItem.js +0 -0
  157. /package/{lib/esm/components → components}/form/NiceFormItem.js.map +0 -0
  158. /package/{lib/esm/components → components}/grid/cell/beanAccessor.d.ts +0 -0
  159. /package/{lib/esm/components → components}/grid/cell/beanAccessor.js +0 -0
  160. /package/{lib/esm/components → components}/grid/cell/beanAccessor.js.map +0 -0
  161. /package/{lib/esm/components → components}/grid/cell/cellEditorUtils.d.ts +0 -0
  162. /package/{lib/esm/components → components}/grid/cell/cellEditorUtils.js +0 -0
  163. /package/{lib/esm/components → components}/grid/cell/cellEditorUtils.js.map +0 -0
  164. /package/{lib/esm/components → components}/grid/cell/customEnumCellEditor.d.ts +0 -0
  165. /package/{lib/esm/components → components}/grid/cell/customEnumCellEditor.js +0 -0
  166. /package/{lib/esm/components → components}/grid/cell/customEnumCellEditor.js.map +0 -0
  167. /package/{lib/esm/components → components}/grid/cell/dataGridCellEditorComponent.d.ts +0 -0
  168. /package/{lib/esm/components → components}/grid/cell/dataGridCellEditorComponent.js +0 -0
  169. /package/{lib/esm/components → components}/grid/cell/dataGridCellEditorComponent.js.map +0 -0
  170. /package/{lib/esm/components → components}/grid/cell/dateCellEditor.d.ts +0 -0
  171. /package/{lib/esm/components → components}/grid/cell/dateCellEditor.js +0 -0
  172. /package/{lib/esm/components → components}/grid/cell/dateCellEditor.js.map +0 -0
  173. /package/{lib/esm/components → components}/grid/cell/durationCellEditor.d.ts +0 -0
  174. /package/{lib/esm/components → components}/grid/cell/durationCellEditor.js +0 -0
  175. /package/{lib/esm/components → components}/grid/cell/durationCellEditor.js.map +0 -0
  176. /package/{lib/esm/components → components}/grid/cell/hexaOctetStringCellEditor.d.ts +0 -0
  177. /package/{lib/esm/components → components}/grid/cell/hexaOctetStringCellEditor.js +0 -0
  178. /package/{lib/esm/components → components}/grid/cell/hexaOctetStringCellEditor.js.map +0 -0
  179. /package/{lib/esm/components → components}/grid/cell/hexaValueCellEditor.d.ts +0 -0
  180. /package/{lib/esm/components → components}/grid/cell/hexaValueCellEditor.js +0 -0
  181. /package/{lib/esm/components → components}/grid/cell/hexaValueCellEditor.js.map +0 -0
  182. /package/{lib/esm/components → components}/grid/cell/numberCellEditor.d.ts +0 -0
  183. /package/{lib/esm/components → components}/grid/cell/numberCellEditor.js +0 -0
  184. /package/{lib/esm/components → components}/grid/cell/numberCellEditor.js.map +0 -0
  185. /package/{lib/esm/components → components}/grid/cell/rangeSelector.js.map +0 -0
  186. /package/{lib/esm/components → components}/grid/cell/simpleStatusTextCellEditor.d.ts +0 -0
  187. /package/{lib/esm/components → components}/grid/cell/simpleStatusTextCellEditor.js +0 -0
  188. /package/{lib/esm/components → components}/grid/cell/simpleStatusTextCellEditor.js.map +0 -0
  189. /package/{lib/esm/components → components}/grid/cell/statusTextCellEditor.d.ts +0 -0
  190. /package/{lib/esm/components → components}/grid/cell/statusTextCellEditor.js +0 -0
  191. /package/{lib/esm/components → components}/grid/cell/statusTextCellEditor.js.map +0 -0
  192. /package/{lib/esm/components → components}/grid/cell/tableDefaultRowStyleRules.d.ts +0 -0
  193. /package/{lib/esm/components → components}/grid/cell/tableDefaultRowStyleRules.js +0 -0
  194. /package/{lib/esm/components → components}/grid/cell/tableDefaultRowStyleRules.js.map +0 -0
  195. /package/{lib/esm/components → components}/grid/cell/textCellEditor.d.ts +0 -0
  196. /package/{lib/esm/components → components}/grid/cell/textCellEditor.js +0 -0
  197. /package/{lib/esm/components → components}/grid/cell/textCellEditor.js.map +0 -0
  198. /package/{lib/esm/components → components}/grid/cell/withAgGridHooks.d.ts +0 -0
  199. /package/{lib/esm/components → components}/grid/cell/withAgGridHooks.js +0 -0
  200. /package/{lib/esm/components → components}/grid/cell/withAgGridHooks.js.map +0 -0
  201. /package/{lib/esm/components → components}/grid/columnUtils.d.ts +0 -0
  202. /package/{lib/esm/components → components}/grid/columnUtils.js +0 -0
  203. /package/{lib/esm/components → components}/grid/columnUtils.js.map +0 -0
  204. /package/{lib/esm/components → components}/grid/config/columnTransfer.d.ts +0 -0
  205. /package/{lib/esm/components → components}/grid/config/columnTransfer.js +0 -0
  206. /package/{lib/esm/components → components}/grid/config/columnTransfer.js.map +0 -0
  207. /package/{lib/esm/components → components}/grid/config/dataGridEditor.d.ts +0 -0
  208. /package/{lib/esm/components → components}/grid/config/dataGridEditor.js +0 -0
  209. /package/{lib/esm/components → components}/grid/config/dataGridEditor.js.map +0 -0
  210. /package/{lib/esm/components → components}/grid/config/rowHeightCalculator.d.ts +0 -0
  211. /package/{lib/esm/components → components}/grid/config/rowHeightCalculator.js +0 -0
  212. /package/{lib/esm/components → components}/grid/config/rowHeightCalculator.js.map +0 -0
  213. /package/{lib/esm/components → components}/grid/config/rowStylePicker.d.ts +0 -0
  214. /package/{lib/esm/components → components}/grid/config/rowStylePicker.js +0 -0
  215. /package/{lib/esm/components → components}/grid/config/rowStylePicker.js.map +0 -0
  216. /package/{lib/esm/components → components}/grid/dataGrid.d.ts +0 -0
  217. /package/{lib/esm/components → components}/grid/dataGrid.js +0 -0
  218. /package/{lib/esm/components → components}/grid/dataGrid.js.map +0 -0
  219. /package/{lib/esm/components → components}/grid/detail/detailHeaderPanel.d.ts +0 -0
  220. /package/{lib/esm/components → components}/grid/detail/detailHeaderPanel.js +0 -0
  221. /package/{lib/esm/components → components}/grid/detail/detailHeaderPanel.js.map +0 -0
  222. /package/{lib/esm/components → components}/grid/export/contextMenu.d.ts +0 -0
  223. /package/{lib/esm/components → components}/grid/export/contextMenu.js.map +0 -0
  224. /package/{lib/esm/components → components}/grid/export/progressPopup.d.ts +0 -0
  225. /package/{lib/esm/components → components}/grid/export/progressPopup.js +0 -0
  226. /package/{lib/esm/components → components}/grid/export/progressPopup.js.map +0 -0
  227. /package/{lib/esm/components → components}/grid/export/worker/clipboardExport.d.ts +0 -0
  228. /package/{lib/esm/components → components}/grid/export/worker/clipboardExport.js +0 -0
  229. /package/{lib/esm/components → components}/grid/export/worker/clipboardExport.js.map +0 -0
  230. /package/{lib/esm/components → components}/grid/export/worker/csvExport.d.ts +0 -0
  231. /package/{lib/esm/components → components}/grid/export/worker/csvExport.js +0 -0
  232. /package/{lib/esm/components → components}/grid/export/worker/csvExport.js.map +0 -0
  233. /package/{lib/esm/components → components}/grid/export/worker/pdfExport.d.ts +0 -0
  234. /package/{lib/esm/components → components}/grid/export/worker/pdfExport.js +0 -0
  235. /package/{lib/esm/components → components}/grid/export/worker/pdfExport.js.map +0 -0
  236. /package/{lib/esm/components → components}/grid/export/worker/txtExport.d.ts +0 -0
  237. /package/{lib/esm/components → components}/grid/export/worker/txtExport.js +0 -0
  238. /package/{lib/esm/components → components}/grid/export/worker/txtExport.js.map +0 -0
  239. /package/{lib/esm/components → components}/grid/extendedDataGrid.d.ts +0 -0
  240. /package/{lib/esm/components → components}/grid/extendedDataGrid.js +0 -0
  241. /package/{lib/esm/components → components}/grid/extendedDataGrid.js.map +0 -0
  242. /package/{lib/esm/components → components}/grid/filter/customColumnFilter.d.ts +0 -0
  243. /package/{lib/esm/components → components}/grid/filter/customColumnFilter.js +0 -0
  244. /package/{lib/esm/components → components}/grid/filter/customColumnFilter.js.map +0 -0
  245. /package/{lib/esm/components → components}/grid/filter/dataGridColumnFilter.d.ts +0 -0
  246. /package/{lib/esm/components → components}/grid/filter/dataGridColumnFilter.js +0 -0
  247. /package/{lib/esm/components → components}/grid/filter/dataGridColumnFilter.js.map +0 -0
  248. /package/{lib/esm/components → components}/grid/filter/dateColumnFilter.d.ts +0 -0
  249. /package/{lib/esm/components → components}/grid/filter/dateColumnFilter.js +0 -0
  250. /package/{lib/esm/components → components}/grid/filter/dateColumnFilter.js.map +0 -0
  251. /package/{lib/esm/components → components}/grid/filter/textColumnFilter.d.ts +0 -0
  252. /package/{lib/esm/components → components}/grid/filter/textColumnFilter.js +0 -0
  253. /package/{lib/esm/components → components}/grid/filter/textColumnFilter.js.map +0 -0
  254. /package/{lib/esm/components → components}/grid/filter/wildcardQuickFilterEngine.d.ts +0 -0
  255. /package/{lib/esm/components → components}/grid/filter/wildcardQuickFilterEngine.js +0 -0
  256. /package/{lib/esm/components → components}/grid/filter/wildcardQuickFilterEngine.js.map +0 -0
  257. /package/{lib/esm/components → components}/grid/header/simpleHeader.d.ts +0 -0
  258. /package/{lib/esm/components → components}/grid/header/simpleHeader.js +0 -0
  259. /package/{lib/esm/components → components}/grid/header/simpleHeader.js.map +0 -0
  260. /package/{lib/esm/components → components}/grid/panel/dataGridPagination.d.ts +0 -0
  261. /package/{lib/esm/components → components}/grid/panel/dataGridPagination.js +0 -0
  262. /package/{lib/esm/components → components}/grid/panel/dataGridPagination.js.map +0 -0
  263. /package/{lib/esm/components → components}/grid/panel/loadingOverlay.d.ts +0 -0
  264. /package/{lib/esm/components → components}/grid/panel/loadingOverlay.js +0 -0
  265. /package/{lib/esm/components → components}/grid/panel/loadingOverlay.js.map +0 -0
  266. /package/{lib/esm/components → components}/grid/panel/noRecordsOverlay.d.ts +0 -0
  267. /package/{lib/esm/components → components}/grid/panel/noRecordsOverlay.js +0 -0
  268. /package/{lib/esm/components → components}/grid/panel/noRecordsOverlay.js.map +0 -0
  269. /package/{lib/esm/components → components}/grid/panel/tablePagination.d.ts +0 -0
  270. /package/{lib/esm/components → components}/grid/panel/tablePagination.js +0 -0
  271. /package/{lib/esm/components → components}/grid/panel/tablePagination.js.map +0 -0
  272. /package/{lib/esm/components → components}/icons/dropdownArrow.d.ts +0 -0
  273. /package/{lib/esm/components → components}/icons/dropdownArrow.js +0 -0
  274. /package/{lib/esm/components → components}/icons/dropdownArrow.js.map +0 -0
  275. /package/{lib/esm/components → components}/icons/undoIcon.d.ts +0 -0
  276. /package/{lib/esm/components → components}/icons/undoIcon.js +0 -0
  277. /package/{lib/esm/components → components}/icons/undoIcon.js.map +0 -0
  278. /package/{lib/esm/components → components}/input/autoCompleteInput.d.ts +0 -0
  279. /package/{lib/esm/components → components}/input/autoCompleteInput.js +0 -0
  280. /package/{lib/esm/components → components}/input/autoCompleteInput.js.map +0 -0
  281. /package/{lib/esm/components → components}/input/draftUtils.d.ts +0 -0
  282. /package/{lib/esm/components → components}/input/draftUtils.js +0 -0
  283. /package/{lib/esm/components → components}/input/draftUtils.js.map +0 -0
  284. /package/{lib/esm/components → components}/input/draftail.js.map +0 -0
  285. /package/{lib/esm/components → components}/input/hexaFormattedInput.d.ts +0 -0
  286. /package/{lib/esm/components → components}/input/hexaFormattedInput.js +0 -0
  287. /package/{lib/esm/components → components}/input/hexaFormattedInput.js.map +0 -0
  288. /package/{lib/esm/components → components}/input/mask/helpers.d.ts +0 -0
  289. /package/{lib/esm/components → components}/input/mask/helpers.js +0 -0
  290. /package/{lib/esm/components → components}/input/mask/helpers.js.map +0 -0
  291. /package/{lib/esm/components → components}/input/mask/inputMaskCore.d.ts +0 -0
  292. /package/{lib/esm/components → components}/input/mask/inputMaskCore.js +0 -0
  293. /package/{lib/esm/components → components}/input/mask/inputMaskCore.js.map +0 -0
  294. /package/{lib/esm/components → components}/input/mask/pattern.d.ts +0 -0
  295. /package/{lib/esm/components → components}/input/mask/pattern.js +0 -0
  296. /package/{lib/esm/components → components}/input/mask/pattern.js.map +0 -0
  297. /package/{lib/esm/components → components}/input/maskedInput.d.ts +0 -0
  298. /package/{lib/esm/components → components}/input/maskedInput.js +0 -0
  299. /package/{lib/esm/components → components}/input/maskedInput.js.map +0 -0
  300. /package/{lib/esm/components → components}/input/passwordInput.d.ts +0 -0
  301. /package/{lib/esm/components → components}/input/passwordInput.js +0 -0
  302. /package/{lib/esm/components → components}/input/passwordInput.js.map +0 -0
  303. /package/{lib/esm/components → components}/input/simpleAutoComplete.d.ts +0 -0
  304. /package/{lib/esm/components → components}/input/simpleAutoComplete.js +0 -0
  305. /package/{lib/esm/components → components}/input/simpleAutoComplete.js.map +0 -0
  306. /package/{lib/esm/components → components}/input/textarea/extractSpansOfClasses.d.ts +0 -0
  307. /package/{lib/esm/components → components}/input/textarea/extractSpansOfClasses.js +0 -0
  308. /package/{lib/esm/components → components}/input/textarea/extractSpansOfClasses.js.map +0 -0
  309. /package/{lib/esm/components → components}/input/textarea/getRanges.d.ts +0 -0
  310. /package/{lib/esm/components → components}/input/textarea/getRanges.js +0 -0
  311. /package/{lib/esm/components → components}/input/textarea/getRanges.js.map +0 -0
  312. /package/{lib/esm/components → components}/input/textarea/getType.d.ts +0 -0
  313. /package/{lib/esm/components → components}/input/textarea/getType.js +0 -0
  314. /package/{lib/esm/components → components}/input/textarea/getType.js.map +0 -0
  315. /package/{lib/esm/components → components}/input/textarea/highlighedContents.d.ts +0 -0
  316. /package/{lib/esm/components → components}/input/textarea/highlighedContents.js +0 -0
  317. /package/{lib/esm/components → components}/input/textarea/highlighedContents.js.map +0 -0
  318. /package/{lib/esm/components → components}/input/textarea/mentionsWithHighlighting.d.ts +0 -0
  319. /package/{lib/esm/components → components}/input/textarea/mentionsWithHighlighting.js +0 -0
  320. /package/{lib/esm/components → components}/input/textarea/mentionsWithHighlighting.js.map +0 -0
  321. /package/{lib/esm/components → components}/keyboard/keyboardUtils.d.ts +0 -0
  322. /package/{lib/esm/components → components}/keyboard/keyboardUtils.js +0 -0
  323. /package/{lib/esm/components → components}/keyboard/keyboardUtils.js.map +0 -0
  324. /package/{lib/esm/components → components}/modal/draggableModalProvider.d.ts +0 -0
  325. /package/{lib/esm/components → components}/modal/draggableModalProvider.js +0 -0
  326. /package/{lib/esm/components → components}/modal/draggableModalProvider.js.map +0 -0
  327. /package/{lib/esm/components → components}/modal/impl/clamp.d.ts +0 -0
  328. /package/{lib/esm/components → components}/modal/impl/clamp.js +0 -0
  329. /package/{lib/esm/components → components}/modal/impl/clamp.js.map +0 -0
  330. /package/{lib/esm/components → components}/modal/impl/draggableModal.d.ts +0 -0
  331. /package/{lib/esm/components → components}/modal/impl/draggableModal.js +0 -0
  332. /package/{lib/esm/components → components}/modal/impl/draggableModal.js.map +0 -0
  333. /package/{lib/esm/components → components}/modal/impl/draggableModalContext.d.ts +0 -0
  334. /package/{lib/esm/components → components}/modal/impl/draggableModalContext.js +0 -0
  335. /package/{lib/esm/components → components}/modal/impl/draggableModalContext.js.map +0 -0
  336. /package/{lib/esm/components → components}/modal/impl/draggableModalInner.d.ts +0 -0
  337. /package/{lib/esm/components → components}/modal/impl/draggableModalInner.js +0 -0
  338. /package/{lib/esm/components → components}/modal/impl/draggableModalInner.js.map +0 -0
  339. /package/{lib/esm/components → components}/modal/impl/draggableModalReducer.d.ts +0 -0
  340. /package/{lib/esm/components → components}/modal/impl/draggableModalReducer.js +0 -0
  341. /package/{lib/esm/components → components}/modal/impl/draggableModalReducer.js.map +0 -0
  342. /package/{lib/esm/components → components}/modal/impl/getWindowSize.d.ts +0 -0
  343. /package/{lib/esm/components → components}/modal/impl/getWindowSize.js +0 -0
  344. /package/{lib/esm/components → components}/modal/impl/getWindowSize.js.map +0 -0
  345. /package/{lib/esm/components → components}/modal/impl/index.d.ts +0 -0
  346. /package/{lib/esm/components → components}/modal/impl/index.js +0 -0
  347. /package/{lib/esm/components → components}/modal/impl/index.js.map +0 -0
  348. /package/{lib/esm/components → components}/modal/impl/resizeHandle.d.ts +0 -0
  349. /package/{lib/esm/components → components}/modal/impl/resizeHandle.js +0 -0
  350. /package/{lib/esm/components → components}/modal/impl/resizeHandle.js.map +0 -0
  351. /package/{lib/esm/components → components}/modal/impl/useDrag.d.ts +0 -0
  352. /package/{lib/esm/components → components}/modal/impl/useDrag.js +0 -0
  353. /package/{lib/esm/components → components}/modal/impl/useDrag.js.map +0 -0
  354. /package/{lib/esm/components → components}/modal/impl/usePrevious.d.ts +0 -0
  355. /package/{lib/esm/components → components}/modal/impl/usePrevious.js +0 -0
  356. /package/{lib/esm/components → components}/modal/impl/usePrevious.js.map +0 -0
  357. /package/{lib/esm/components → components}/modal/impl/useResize.d.ts +0 -0
  358. /package/{lib/esm/components → components}/modal/impl/useResize.js +0 -0
  359. /package/{lib/esm/components → components}/modal/impl/useResize.js.map +0 -0
  360. /package/{lib/esm/components → components}/modal/modalDialog.d.ts +0 -0
  361. /package/{lib/esm/components → components}/modal/modalDialog.js +0 -0
  362. /package/{lib/esm/components → components}/modal/modalDialog.js.map +0 -0
  363. /package/{lib/esm/components → components}/picker/enumValuePicker.d.ts +0 -0
  364. /package/{lib/esm/components → components}/picker/enumValuePicker.js +0 -0
  365. /package/{lib/esm/components → components}/picker/enumValuePicker.js.map +0 -0
  366. /package/{lib/esm/components → components}/platformSpecific.d.ts +0 -0
  367. /package/{lib/esm/components → components}/platformSpecific.js +0 -0
  368. /package/{lib/esm/components → components}/platformSpecific.js.map +0 -0
  369. /package/{lib/esm/components → components}/scrollTo/onlyText.d.ts +0 -0
  370. /package/{lib/esm/components → components}/scrollTo/onlyText.js +0 -0
  371. /package/{lib/esm/components → components}/scrollTo/onlyText.js.map +0 -0
  372. /package/{lib/esm/components → components}/scrollTo/scrollTo.d.ts +0 -0
  373. /package/{lib/esm/components → components}/scrollTo/scrollTo.js +0 -0
  374. /package/{lib/esm/components → components}/scrollTo/scrollTo.js.map +0 -0
  375. /package/{lib/esm/components → components}/style/withCss.d.ts +0 -0
  376. /package/{lib/esm/components → components}/style/withCss.js +0 -0
  377. /package/{lib/esm/components → components}/style/withCss.js.map +0 -0
  378. /package/{lib/esm/components → components}/style/withInputNumberCss.d.ts +0 -0
  379. /package/{lib/esm/components → components}/style/withInputNumberCss.js +0 -0
  380. /package/{lib/esm/components → components}/style/withInputNumberCss.js.map +0 -0
  381. /package/{lib/esm/components → components}/table/dragSortingTable.d.ts +0 -0
  382. /package/{lib/esm/components → components}/table/dragSortingTable.js +0 -0
  383. /package/{lib/esm/components → components}/table/dragSortingTable.js.map +0 -0
  384. /package/{lib/esm/components → components}/text/impl/innerSize.d.ts +0 -0
  385. /package/{lib/esm/components → components}/text/impl/innerSize.js +0 -0
  386. /package/{lib/esm/components → components}/text/impl/innerSize.js.map +0 -0
  387. /package/{lib/esm/components → components}/text/impl/series.d.ts +0 -0
  388. /package/{lib/esm/components → components}/text/impl/series.js +0 -0
  389. /package/{lib/esm/components → components}/text/impl/series.js.map +0 -0
  390. /package/{lib/esm/components → components}/text/impl/shallowEqual.d.ts +0 -0
  391. /package/{lib/esm/components → components}/text/impl/shallowEqual.js +0 -0
  392. /package/{lib/esm/components → components}/text/impl/shallowEqual.js.map +0 -0
  393. /package/{lib/esm/components → components}/text/impl/uniqueId.d.ts +0 -0
  394. /package/{lib/esm/components → components}/text/impl/uniqueId.js +0 -0
  395. /package/{lib/esm/components → components}/text/impl/uniqueId.js.map +0 -0
  396. /package/{lib/esm/components → components}/text/impl/whilst.d.ts +0 -0
  397. /package/{lib/esm/components → components}/text/impl/whilst.js +0 -0
  398. /package/{lib/esm/components → components}/text/impl/whilst.js.map +0 -0
  399. /package/{lib/esm/components → components}/text/textFit.d.ts +0 -0
  400. /package/{lib/esm/components → components}/text/textFit.js +0 -0
  401. /package/{lib/esm/components → components}/text/textFit.js.map +0 -0
  402. /package/{lib/esm/i18n → i18n}/componentsLocaleHolder.d.ts +0 -0
  403. /package/{lib/esm/i18n → i18n}/componentsLocaleHolder.js.map +0 -0
@@ -1,452 +0,0 @@
1
- import {DEFAULT_PLACEHOLDER_CHAR, FormatCharacters, mergeFormatCharacters} from './helpers';
2
- import {Pattern} from './pattern';
3
-
4
- type SelectionObject = { start: number; end: number };
5
-
6
- type Options = {
7
- formatCharacters: FormatCharacters;
8
- pattern: string;
9
- isRevealingMask: boolean;
10
- placeholderChar: string;
11
- selection: SelectionObject;
12
- value: string;
13
- };
14
-
15
- export class InputMask {
16
- static Pattern = Pattern;
17
-
18
- formatCharacters!: FormatCharacters;
19
- pattern!: Pattern;
20
- isRevealingMask!: boolean;
21
- placeholderChar!: string;
22
- selection!: SelectionObject;
23
- value!: string[];
24
- emptyValue = '';
25
-
26
- _history: {
27
- value: string;
28
- selection: SelectionObject;
29
- lastOp: string | null;
30
- startUndo?: boolean;
31
- }[] = [];
32
-
33
- _historyIndex: null | number = null;
34
- _lastOp: null | string = null;
35
- _lastSelection: null | SelectionObject = null;
36
-
37
- constructor(options: Partial<Options>) {
38
- const mergedOptions: Options = {
39
- ...{
40
- isRevealingMask: false,
41
- placeholderChar: DEFAULT_PLACEHOLDER_CHAR,
42
- selection: {start: 0, end: 0},
43
- value: ''
44
- },
45
- ...options
46
- } as Options;
47
-
48
- if (!mergedOptions.pattern) {
49
- throw new Error('InputMask: you must provide a pattern.');
50
- }
51
-
52
- if (
53
- typeof mergedOptions.placeholderChar !== 'string' ||
54
- mergedOptions.placeholderChar.length > 1
55
- ) {
56
- throw new Error(
57
- 'InputMask: placeholderChar should be a single character or an empty string.'
58
- );
59
- }
60
-
61
- this.placeholderChar = mergedOptions.placeholderChar;
62
- this.formatCharacters = mergeFormatCharacters(
63
- mergedOptions.formatCharacters
64
- );
65
-
66
- this.setPattern(mergedOptions.pattern, {
67
- value: mergedOptions.value,
68
- selection: mergedOptions.selection,
69
- isRevealingMask: mergedOptions.isRevealingMask
70
- });
71
- }
72
-
73
- setPattern(patternSource: string, options: Partial<Options>) {
74
- const merged = {
75
- selection: {start: 0, end: 0},
76
- value: '',
77
- ...options
78
- };
79
-
80
- this.pattern = new Pattern(
81
- patternSource,
82
- this.formatCharacters,
83
- this.placeholderChar,
84
- merged.isRevealingMask
85
- );
86
-
87
- this.setValue(merged.value);
88
-
89
- this.emptyValue = this.pattern.formatValue([]).join('');
90
- this.selection = merged.selection;
91
- this._resetHistory();
92
- }
93
-
94
- setValue(value?: string) {
95
- if (value == null) {
96
- value = '';
97
- }
98
- this.value = this.pattern.formatValue((value || '').split(''));
99
- }
100
-
101
- _resetHistory() {
102
- this._history = [];
103
- this._historyIndex = null;
104
- this._lastOp = null;
105
- this._lastSelection = {...this.selection};
106
- }
107
-
108
- getValue(): string {
109
- if (this.pattern.isRevealingMask) {
110
- this.value = this.pattern.formatValue(
111
- (this.getRawValue() || '').split('')
112
- );
113
- }
114
- return (this.value || []).join('');
115
- }
116
-
117
- getRawValue(): string {
118
- var rawValue = [];
119
- for (var i = 0; i < this.value.length; i++) {
120
- if (this.pattern._editableIndices[i] === true) {
121
- rawValue.push(this.value[i]);
122
- }
123
- }
124
- return rawValue.join('');
125
- }
126
-
127
- /**
128
- * Applies a single character of input based on the current selection.
129
- * @param {string} char
130
- * @return {boolean} true if a change has been made to value or selection as a
131
- * result of the input, false otherwise.
132
- */
133
- input(char: string) {
134
- // Ignore additional input if the cursor's at the end of the pattern
135
- if (
136
- this.selection.start === this.selection.end &&
137
- this.selection.start === this.pattern.length
138
- ) {
139
- return false;
140
- }
141
-
142
- const selectionBefore = copy(this.selection);
143
- const valueBefore = this.getValue();
144
-
145
- let inputIndex = this.selection.start;
146
-
147
- // If the cursor or selection is prior to the first editable character, make
148
- // sure any input given is applied to it.
149
- if (this.pattern.firstEditableIndex && inputIndex < this.pattern.firstEditableIndex) {
150
- inputIndex = this.pattern.firstEditableIndex;
151
- }
152
-
153
- // Bail out or add the character to input
154
- if (this.pattern.isEditableIndex(inputIndex)) {
155
- if (!this.pattern.isValidAtIndex(char, inputIndex)) {
156
- return false;
157
- }
158
- this.value[inputIndex] = this.pattern.transform(char, inputIndex);
159
- } else {
160
- console.log('not editable');
161
- }
162
-
163
- // If multiple characters were selected, blank the remainder out based on the
164
- // pattern.
165
- let end = this.selection.end - 1;
166
- while (end > inputIndex) {
167
- if (this.pattern.isEditableIndex(end)) {
168
- this.value[end] = this.placeholderChar;
169
- }
170
- end--;
171
- }
172
-
173
- // Advance the cursor to the next character
174
- this.selection.start = this.selection.end = inputIndex + 1;
175
-
176
- // Skip over any subsequent static characters
177
- while (
178
- this.pattern.length > this.selection.start &&
179
- !this.pattern.isEditableIndex(this.selection.start)
180
- ) {
181
- this.selection.start++;
182
- this.selection.end++;
183
- }
184
-
185
- // History
186
- if (this._historyIndex != null) {
187
- // Took more input after undoing, so blow any subsequent history away
188
- this._history.splice(
189
- this._historyIndex,
190
- this._history.length - this._historyIndex
191
- );
192
- this._historyIndex = null;
193
- }
194
- if (
195
- this._lastOp !== 'input' ||
196
- selectionBefore.start !== selectionBefore.end ||
197
- (this._lastSelection !== null &&
198
- selectionBefore.start !== this._lastSelection.start)
199
- ) {
200
- this._history.push({
201
- value: valueBefore,
202
- selection: selectionBefore,
203
- lastOp: this._lastOp
204
- });
205
- }
206
- this._lastOp = 'input';
207
- this._lastSelection = copy(this.selection);
208
-
209
- return true;
210
- }
211
-
212
- /**
213
- * Attempts to delete from the value based on the current cursor position or
214
- * selection.
215
- * @return {boolean} true if the value or selection changed as the result of
216
- * backspacing, false otherwise.
217
- */
218
- backspace() {
219
- // If the cursor is at the start there's nothing to do
220
- if (this.selection.start === 0 && this.selection.end === 0) {
221
- return false;
222
- }
223
-
224
- var selectionBefore = {...this.selection};
225
- var valueBefore = this.getValue();
226
-
227
- // No range selected - work on the character preceding the cursor
228
- if (this.selection.start === this.selection.end) {
229
- if (this.pattern.isEditableIndex(this.selection.start - 1)) {
230
- if (this.pattern.isRevealingMask) {
231
- this.value.splice(this.selection.start - 1);
232
- } else {
233
- this.value[this.selection.start - 1] = this.placeholderChar;
234
- }
235
- }
236
- this.selection.start--;
237
- this.selection.end--;
238
- }
239
- // Range selected - delete characters and leave the cursor at the start of the selection
240
- else {
241
- var end = this.selection.end - 1;
242
- while (end >= this.selection.start) {
243
- if (this.pattern.isEditableIndex(end)) {
244
- this.value[end] = this.placeholderChar;
245
- }
246
- end--;
247
- }
248
- this.selection.end = this.selection.start;
249
- }
250
-
251
- // History
252
- if (this._historyIndex != null) {
253
- // Took more input after undoing, so blow any subsequent history away
254
- this._history.splice(
255
- this._historyIndex,
256
- this._history.length - this._historyIndex
257
- );
258
- }
259
- if (
260
- this._lastOp !== 'backspace' ||
261
- selectionBefore.start !== selectionBefore.end ||
262
- (this._lastSelection !== null &&
263
- selectionBefore.start !== this._lastSelection.start)
264
- ) {
265
- this._history.push({
266
- value: valueBefore,
267
- selection: selectionBefore,
268
- lastOp: this._lastOp
269
- });
270
- }
271
- this._lastOp = 'backspace';
272
- this._lastSelection = {...this.selection};
273
-
274
- return true;
275
- }
276
-
277
- /**
278
- * Attempts to paste a string of input at the current cursor position or over
279
- * the top of the current selection.
280
- * Invalid content at any position will cause the paste to be rejected, and it
281
- * may contain static parts of the mask's pattern.
282
- * @param {string} input
283
- * @return {boolean} true if the paste was successful, false otherwise.
284
- */
285
- paste(input: string) {
286
- // This is necessary because we're just calling input() with each character
287
- // and rolling back if any were invalid, rather than checking up-front.
288
- var initialState = {
289
- value: this.value.slice(),
290
- selection: {...this.selection},
291
- _lastOp: this._lastOp,
292
- _history: this._history.slice(),
293
- _historyIndex: this._historyIndex,
294
- _lastSelection: {...this._lastSelection}
295
- };
296
-
297
- // If there are static characters at the start of the pattern and the cursor
298
- // or selection is within them, the static characters must match for a valid
299
- // paste.
300
- if (this.selection.start < this.pattern.firstEditableIndex!) {
301
- for (
302
- var i = 0, l = this.pattern.firstEditableIndex! - this.selection.start;
303
- i < l;
304
- i++
305
- ) {
306
- if (input.charAt(i) !== this.pattern.pattern[i]) {
307
- return false;
308
- }
309
- }
310
-
311
- // Continue as if the selection and input started from the editable part of
312
- // the pattern.
313
- input = input.substring(
314
- this.pattern.firstEditableIndex! - this.selection.start
315
- );
316
- this.selection.start = this.pattern.firstEditableIndex!;
317
- }
318
-
319
- for (
320
- i = 0, l = input.length;
321
- i < l && this.selection.start <= this.pattern.lastEditableIndex!;
322
- i++
323
- ) {
324
- var valid = this.input(input.charAt(i));
325
- // Allow static parts of the pattern to appear in pasted input - they will
326
- // already have been stepped over by input(), so verify that the value
327
- // deemed invalid by input() was the expected static character.
328
- if (!valid) {
329
- if (this.selection.start > 0) {
330
- // XXX This only allows for one static character to be skipped
331
- var patternIndex = this.selection.start - 1;
332
- if (
333
- !this.pattern.isEditableIndex(patternIndex) &&
334
- input.charAt(i) === this.pattern.pattern[patternIndex]
335
- ) {
336
- continue;
337
- }
338
- }
339
-
340
- Object.keys(initialState).forEach(key => {
341
- // @ts-ignore
342
- this[key] = initialState[key];
343
- });
344
-
345
- return false;
346
- }
347
- }
348
-
349
- return true;
350
- }
351
-
352
- undo() {
353
- // If there is no history, or nothing more on the history stack, we can't undo
354
- if (this._history.length === 0 || this._historyIndex === 0) {
355
- return false;
356
- }
357
-
358
- var historyItem;
359
- if (this._historyIndex == null) {
360
- // Not currently undoing, set up the initial history index
361
- this._historyIndex = this._history.length - 1;
362
- historyItem = this._history[this._historyIndex];
363
- // Add a new history entry if anything has changed since the last one, so we
364
- // can redo back to the initial state we started undoing from.
365
- var value = this.getValue();
366
- if (
367
- historyItem.value !== value ||
368
- historyItem.selection.start !== this.selection.start ||
369
- historyItem.selection.end !== this.selection.end
370
- ) {
371
- this._history.push({
372
- value: value,
373
- selection: {...this.selection},
374
- lastOp: this._lastOp,
375
- startUndo: true
376
- });
377
- }
378
- } else {
379
- historyItem = this._history[--this._historyIndex];
380
- }
381
-
382
- this.value = historyItem.value.split('');
383
- this.selection = historyItem.selection;
384
- this._lastOp = historyItem.lastOp;
385
- return true;
386
- }
387
-
388
- redo() {
389
- if (this._history.length === 0 || this._historyIndex == null) {
390
- return false;
391
- }
392
- var historyItem = this._history[++this._historyIndex];
393
- // If this is the last history item, we're done redoing
394
- if (this._historyIndex === this._history.length - 1) {
395
- this._historyIndex = null;
396
- // If the last history item was only added to start undoing, remove it
397
- if (historyItem.startUndo) {
398
- this._history.pop();
399
- }
400
- }
401
- this.value = historyItem.value.split('');
402
- this.selection = historyItem.selection;
403
- this._lastOp = historyItem.lastOp;
404
- return true;
405
- }
406
-
407
- setSelection(selection: SelectionObject) {
408
- this.selection = {...selection};
409
-
410
- if (this.selection.start === this.selection.end) {
411
- if (this.selection.start < this.pattern.firstEditableIndex!) {
412
- this.selection!.start = this.selection!.end = this.pattern
413
- .firstEditableIndex as number;
414
- return true;
415
- }
416
- // Set selection to the first editable, non-placeholder character before the selection
417
- // OR to the beginning of the pattern
418
- var index = this.selection.start;
419
- while (index >= this.pattern.firstEditableIndex!) {
420
- if (
421
- (this.pattern.isEditableIndex(index - 1) &&
422
- this.value[index - 1] !== this.placeholderChar) ||
423
- index === this.pattern.firstEditableIndex
424
- ) {
425
- this.selection.start = this.selection.end = index;
426
- break;
427
- }
428
- index--;
429
- }
430
- return true;
431
- }
432
- return false;
433
- }
434
- }
435
-
436
- function extend(dest: any, src: any) {
437
- if (src) {
438
- let props = Object.keys(src);
439
-
440
- for (var i = 0, l = props.length; i < l; i++) {
441
- dest[props[i]] = src[props[i]];
442
- }
443
- }
444
-
445
- return dest;
446
- }
447
-
448
- function copy<T = any>(obj: T): T {
449
- return extend({}, obj);
450
- }
451
-
452
- export default InputMask;
@@ -1,122 +0,0 @@
1
- import {DEFAULT_FORMAT_CHARACTERS, DEFAULT_PLACEHOLDER_CHAR, ESCAPE_CHAR, FormatCharacters,} from './helpers';
2
-
3
- export class Pattern {
4
- placeholderChar: string;
5
- formatCharacters: FormatCharacters;
6
- source: string;
7
-
8
- /** Pattern characters after escape characters have been processed. */
9
- pattern = [];
10
-
11
- /** Length of the pattern after escape characters have been processed. */
12
- length = 0;
13
-
14
- /** Index of the first editable character. */
15
- firstEditableIndex: null | number = null;
16
-
17
- /** Index of the last editable character. */
18
- lastEditableIndex: null | number = null;
19
-
20
- /** Lookup for indices of editable characters in the pattern. */
21
- _editableIndices: { [key: number]: boolean } = {};
22
-
23
- /** If true, only the pattern before the last valid value character shows. */
24
- isRevealingMask: boolean;
25
-
26
- constructor(
27
- source: string,
28
- formatCharacters: FormatCharacters,
29
- placeholderChar: string,
30
- isRevealingMask = false,
31
- ) {
32
- /** Placeholder character */
33
- this.placeholderChar = placeholderChar || DEFAULT_PLACEHOLDER_CHAR;
34
- /** Format character definitions. */
35
- this.formatCharacters = formatCharacters || DEFAULT_FORMAT_CHARACTERS;
36
- /** Pattern definition string with escape characters. */
37
- this.source = source;
38
-
39
- this.isRevealingMask = isRevealingMask;
40
-
41
- this._parse();
42
- }
43
-
44
- _parse() {
45
- var sourceChars = this.source.split('');
46
- var patternIndex = 0;
47
- var pattern: string[] = [];
48
-
49
- for (var i = 0, l = sourceChars.length; i < l; i++) {
50
- var char = sourceChars[i];
51
- if (char === ESCAPE_CHAR) {
52
- if (i === l - 1) {
53
- throw new Error('InputMask: pattern ends with a raw ' + ESCAPE_CHAR);
54
- }
55
- char = sourceChars[++i];
56
- } else if (char in this.formatCharacters) {
57
- if (this.firstEditableIndex === null) {
58
- this.firstEditableIndex = patternIndex;
59
- }
60
- this.lastEditableIndex = patternIndex;
61
- this._editableIndices[patternIndex] = true;
62
- }
63
-
64
- pattern.push(char);
65
- patternIndex++;
66
- }
67
-
68
- if (this.firstEditableIndex === null) {
69
- throw new Error(
70
- 'InputMask: pattern "' + this.source + '" does not contain any editable characters.',
71
- );
72
- }
73
-
74
- // @ts-ignore
75
- this.pattern = pattern;
76
- this.length = pattern.length;
77
- }
78
-
79
- formatValue(value: string[]): string[] {
80
- var valueBuffer = new Array(this.length);
81
- var valueIndex = 0;
82
-
83
- for (var i = 0, l = this.length; i < l; i++) {
84
- if (this.isEditableIndex(i)) {
85
- if (
86
- this.isRevealingMask &&
87
- value.length <= valueIndex &&
88
- !this.isValidAtIndex(value[valueIndex], i)
89
- ) {
90
- break;
91
- }
92
- valueBuffer[i] =
93
- value.length > valueIndex && this.isValidAtIndex(value[valueIndex], i)
94
- ? this.transform(value[valueIndex], i)
95
- : this.placeholderChar;
96
- valueIndex++;
97
- } else {
98
- valueBuffer[i] = this.pattern[i];
99
- // Also allow the value to contain static values from the pattern by
100
- // advancing its index.
101
- if (value.length > valueIndex && value[valueIndex] === this.pattern[i]) {
102
- valueIndex++;
103
- }
104
- }
105
- }
106
-
107
- return valueBuffer;
108
- }
109
-
110
- isEditableIndex(index: number) {
111
- return !!this._editableIndices[index];
112
- }
113
-
114
- isValidAtIndex(char: string, index: number) {
115
- return this.formatCharacters[this.pattern[index]].validate(char);
116
- }
117
-
118
- transform(char: string, index: number) {
119
- var format = this.formatCharacters[this.pattern[index]];
120
- return typeof format.transform == 'function' ? format.transform(char) : char;
121
- }
122
- }