smoothly 0.1.114 → 0.1.117

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 (257) hide show
  1. package/dist/cjs/{Notice-9c2b52b7.js → Notice-839702d8.js} +34 -26
  2. package/dist/cjs/{Trigger-74bd1ee8.js → Trigger-cf376531.js} +55 -146
  3. package/dist/cjs/{index-41a36ce2.js → index-1c61bdd3.js} +27 -1
  4. package/dist/cjs/index.cjs.js +20 -8
  5. package/dist/cjs/loader.cjs.js +3 -19
  6. package/dist/cjs/{smoothly-accordion_50.cjs.entry.js → smoothly-accordion_51.cjs.entry.js} +7694 -1488
  7. package/dist/cjs/smoothly-google-font.cjs.entry.js +2 -2
  8. package/dist/cjs/smoothly-radio-group.cjs.entry.js +2 -2
  9. package/dist/cjs/smoothly-reorder.cjs.entry.js +2 -2
  10. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +5 -5
  11. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +5 -5
  12. package/dist/cjs/smoothly.cjs.js +5 -113
  13. package/dist/collection/collection-manifest.json +5 -4
  14. package/dist/collection/components/app/style.css +6 -7
  15. package/dist/collection/components/app-demo/index.js +6 -1
  16. package/dist/collection/components/button/index.js +168 -0
  17. package/dist/collection/components/button/style.css +49 -0
  18. package/dist/collection/components/menu-options/style.css +2 -2
  19. package/dist/collection/components/picker/index.js +10 -6
  20. package/dist/collection/components/picker/style.css +14 -14
  21. package/dist/collection/components/selector/style.css +3 -3
  22. package/dist/collection/components/tab/style.css +3 -3
  23. package/dist/collection/components/table/{exandable → expandable}/cell/index.js +0 -0
  24. package/dist/collection/components/table/{exandable → expandable}/cell/style.css +0 -0
  25. package/dist/collection/components/table/{exandable → expandable}/row/index.js +0 -0
  26. package/dist/collection/components/table/{exandable → expandable}/row/style.css +0 -0
  27. package/dist/collection/components/table/header/style.css +5 -5
  28. package/dist/collection/components/trigger/style.css +3 -3
  29. package/dist/custom-elements/index.d.ts +6 -0
  30. package/dist/custom-elements/index.js +7781 -2971
  31. package/dist/esm/{Notice-4131b4e0.js → Notice-608b552c.js} +34 -26
  32. package/dist/esm/{Trigger-d7b181ec.js → Trigger-365408f0.js} +55 -146
  33. package/dist/esm/{index-dcb2b612.js → index-a3737440.js} +27 -1
  34. package/dist/esm/index.js +17 -4
  35. package/dist/esm/loader.js +3 -19
  36. package/dist/esm/polyfills/css-shim.js +1 -1
  37. package/dist/esm/{smoothly-accordion_50.entry.js → smoothly-accordion_51.entry.js} +7694 -1489
  38. package/dist/esm/smoothly-google-font.entry.js +2 -2
  39. package/dist/esm/smoothly-radio-group.entry.js +2 -2
  40. package/dist/esm/smoothly-reorder.entry.js +2 -2
  41. package/dist/esm/smoothly-trigger-sink.entry.js +3 -3
  42. package/dist/esm/smoothly-trigger-source.entry.js +3 -3
  43. package/dist/esm/smoothly.js +5 -113
  44. package/dist/smoothly/index.esm.js +1 -376
  45. package/dist/smoothly/p-0215b4da.entry.js +1 -0
  46. package/dist/smoothly/{p-074a0448.js → p-0cba3e3d.js} +1 -1
  47. package/dist/smoothly/p-4fa231df.entry.js +1 -0
  48. package/dist/smoothly/p-6ca0d36c.js +1 -0
  49. package/dist/smoothly/p-6f009ac9.entry.js +1 -0
  50. package/dist/smoothly/p-7a30d9b8.js +1 -0
  51. package/dist/smoothly/p-8ae38136.entry.js +1 -0
  52. package/dist/smoothly/p-993534fa.entry.js +1 -0
  53. package/dist/smoothly/p-eec1c703.entry.js +1 -0
  54. package/dist/smoothly/smoothly.esm.js +1 -125
  55. package/dist/types/components/button/index.d.ts +11 -0
  56. package/dist/types/components/table/{exandable → expandable}/cell/index.d.ts +0 -0
  57. package/dist/types/components/table/{exandable → expandable}/row/index.d.ts +0 -0
  58. package/dist/types/components.d.ts +27 -0
  59. package/dist/types/stencil-public-runtime.d.ts +6 -4
  60. package/package.json +17 -17
  61. package/dist/cjs/App-339acc9b.js +0 -647
  62. package/dist/cjs/_commonjsHelpers-10109b76.js +0 -48
  63. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  64. package/dist/cjs/css-shim-88cc6900.js +0 -6
  65. package/dist/cjs/dom-95afd968.js +0 -75
  66. package/dist/cjs/generate-f9a36f25.js +0 -66
  67. package/dist/cjs/index-138c41c2.js +0 -3066
  68. package/dist/cjs/index-36da3c23.js +0 -1673
  69. package/dist/cjs/index-40d009d5.js +0 -1354
  70. package/dist/cjs/index-ac32385c.js +0 -18850
  71. package/dist/cjs/shadow-css-71d0f821.js +0 -391
  72. package/dist/cjs/smoothly-accordion-item.cjs.entry.js +0 -54
  73. package/dist/cjs/smoothly-accordion.cjs.entry.js +0 -55
  74. package/dist/cjs/smoothly-app-demo.cjs.entry.js +0 -29
  75. package/dist/cjs/smoothly-app.cjs.entry.js +0 -19
  76. package/dist/cjs/smoothly-backtotop.cjs.entry.js +0 -37
  77. package/dist/cjs/smoothly-calendar.cjs.entry.js +0 -95
  78. package/dist/cjs/smoothly-checkbox.cjs.entry.js +0 -18671
  79. package/dist/cjs/smoothly-dialog-demo.cjs.entry.js +0 -16
  80. package/dist/cjs/smoothly-dialog.cjs.entry.js +0 -38
  81. package/dist/cjs/smoothly-display-amount.cjs.entry.js +0 -59
  82. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +0 -20
  83. package/dist/cjs/smoothly-display-demo.cjs.entry.js +0 -25
  84. package/dist/cjs/smoothly-display.cjs.entry.js +0 -41
  85. package/dist/cjs/smoothly-frame.cjs.entry.js +0 -50
  86. package/dist/cjs/smoothly-icon-demo.cjs.entry.js +0 -491
  87. package/dist/cjs/smoothly-icon.cjs.entry.js +0 -52
  88. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +0 -50
  89. package/dist/cjs/smoothly-input-date.cjs.entry.js +0 -44
  90. package/dist/cjs/smoothly-input-demo.cjs.entry.js +0 -19
  91. package/dist/cjs/smoothly-input-month.cjs.entry.js +0 -41
  92. package/dist/cjs/smoothly-input.cjs.entry.js +0 -202
  93. package/dist/cjs/smoothly-item.cjs.entry.js +0 -43
  94. package/dist/cjs/smoothly-menu-options.cjs.entry.js +0 -108
  95. package/dist/cjs/smoothly-notification.cjs.entry.js +0 -67
  96. package/dist/cjs/smoothly-notifier.cjs.entry.js +0 -29
  97. package/dist/cjs/smoothly-option.cjs.entry.js +0 -33
  98. package/dist/cjs/smoothly-picker.cjs.entry.js +0 -151
  99. package/dist/cjs/smoothly-popup.cjs.entry.js +0 -38
  100. package/dist/cjs/smoothly-quiet.cjs.entry.js +0 -19
  101. package/dist/cjs/smoothly-radio.cjs.entry.js +0 -28
  102. package/dist/cjs/smoothly-room.cjs.entry.js +0 -16
  103. package/dist/cjs/smoothly-select-demo.cjs.entry.js +0 -86
  104. package/dist/cjs/smoothly-select.cjs.entry.js +0 -31
  105. package/dist/cjs/smoothly-selector.cjs.entry.js +0 -119
  106. package/dist/cjs/smoothly-skeleton.cjs.entry.js +0 -27
  107. package/dist/cjs/smoothly-spinner.cjs.entry.js +0 -24
  108. package/dist/cjs/smoothly-submit.cjs.entry.js +0 -60
  109. package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
  110. package/dist/cjs/smoothly-tab-switch.cjs.entry.js +0 -32
  111. package/dist/cjs/smoothly-tab.cjs.entry.js +0 -37
  112. package/dist/cjs/smoothly-table-cell.cjs.entry.js +0 -19
  113. package/dist/cjs/smoothly-table-demo.cjs.entry.js +0 -22
  114. package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +0 -45
  115. package/dist/cjs/smoothly-table-expandable-row.cjs.entry.js +0 -32
  116. package/dist/cjs/smoothly-table-header.cjs.entry.js +0 -41
  117. package/dist/cjs/smoothly-table-row.cjs.entry.js +0 -38
  118. package/dist/cjs/smoothly-table.cjs.entry.js +0 -26
  119. package/dist/cjs/smoothly-trigger.cjs.entry.js +0 -36
  120. package/dist/cjs/smoothly-tuple.cjs.entry.js +0 -16
  121. package/dist/cjs/smoothly-urlencoded.cjs.entry.js +0 -19
  122. package/dist/esm/App-22187759.js +0 -645
  123. package/dist/esm/_commonjsHelpers-8fe71198.js +0 -44
  124. package/dist/esm/app-globals-0f993ce5.js +0 -3
  125. package/dist/esm/css-shim-c64026cd.js +0 -4
  126. package/dist/esm/dom-a712b575.js +0 -73
  127. package/dist/esm/generate-50b98474.js +0 -61
  128. package/dist/esm/index-02a70ac1.js +0 -3027
  129. package/dist/esm/index-a5a08f46.js +0 -18848
  130. package/dist/esm/index-c8b5d468.js +0 -1349
  131. package/dist/esm/index-d1360bcf.js +0 -1671
  132. package/dist/esm/shadow-css-1e16431b.js +0 -389
  133. package/dist/esm/smoothly-accordion-item.entry.js +0 -50
  134. package/dist/esm/smoothly-accordion.entry.js +0 -51
  135. package/dist/esm/smoothly-app-demo.entry.js +0 -25
  136. package/dist/esm/smoothly-app.entry.js +0 -15
  137. package/dist/esm/smoothly-backtotop.entry.js +0 -33
  138. package/dist/esm/smoothly-calendar.entry.js +0 -91
  139. package/dist/esm/smoothly-checkbox.entry.js +0 -18667
  140. package/dist/esm/smoothly-dialog-demo.entry.js +0 -12
  141. package/dist/esm/smoothly-dialog.entry.js +0 -34
  142. package/dist/esm/smoothly-display-amount.entry.js +0 -55
  143. package/dist/esm/smoothly-display-date-time.entry.js +0 -16
  144. package/dist/esm/smoothly-display-demo.entry.js +0 -21
  145. package/dist/esm/smoothly-display.entry.js +0 -37
  146. package/dist/esm/smoothly-frame.entry.js +0 -46
  147. package/dist/esm/smoothly-icon-demo.entry.js +0 -487
  148. package/dist/esm/smoothly-icon.entry.js +0 -48
  149. package/dist/esm/smoothly-input-date-range.entry.js +0 -46
  150. package/dist/esm/smoothly-input-date.entry.js +0 -40
  151. package/dist/esm/smoothly-input-demo.entry.js +0 -15
  152. package/dist/esm/smoothly-input-month.entry.js +0 -37
  153. package/dist/esm/smoothly-input.entry.js +0 -198
  154. package/dist/esm/smoothly-item.entry.js +0 -39
  155. package/dist/esm/smoothly-menu-options.entry.js +0 -104
  156. package/dist/esm/smoothly-notification.entry.js +0 -63
  157. package/dist/esm/smoothly-notifier.entry.js +0 -25
  158. package/dist/esm/smoothly-option.entry.js +0 -29
  159. package/dist/esm/smoothly-picker.entry.js +0 -147
  160. package/dist/esm/smoothly-popup.entry.js +0 -34
  161. package/dist/esm/smoothly-quiet.entry.js +0 -15
  162. package/dist/esm/smoothly-radio.entry.js +0 -24
  163. package/dist/esm/smoothly-room.entry.js +0 -12
  164. package/dist/esm/smoothly-select-demo.entry.js +0 -82
  165. package/dist/esm/smoothly-select.entry.js +0 -27
  166. package/dist/esm/smoothly-selector.entry.js +0 -115
  167. package/dist/esm/smoothly-skeleton.entry.js +0 -23
  168. package/dist/esm/smoothly-spinner.entry.js +0 -20
  169. package/dist/esm/smoothly-submit.entry.js +0 -56
  170. package/dist/esm/smoothly-svg.entry.js +0 -37
  171. package/dist/esm/smoothly-tab-switch.entry.js +0 -28
  172. package/dist/esm/smoothly-tab.entry.js +0 -33
  173. package/dist/esm/smoothly-table-cell.entry.js +0 -15
  174. package/dist/esm/smoothly-table-demo.entry.js +0 -18
  175. package/dist/esm/smoothly-table-expandable-cell.entry.js +0 -41
  176. package/dist/esm/smoothly-table-expandable-row.entry.js +0 -28
  177. package/dist/esm/smoothly-table-header.entry.js +0 -37
  178. package/dist/esm/smoothly-table-row.entry.js +0 -34
  179. package/dist/esm/smoothly-table.entry.js +0 -22
  180. package/dist/esm/smoothly-trigger.entry.js +0 -32
  181. package/dist/esm/smoothly-tuple.entry.js +0 -12
  182. package/dist/esm/smoothly-urlencoded.entry.js +0 -15
  183. package/dist/smoothly/App-22187759.js +0 -645
  184. package/dist/smoothly/GoogleFont-8474516b.js +0 -21
  185. package/dist/smoothly/_commonjsHelpers-8fe71198.js +0 -44
  186. package/dist/smoothly/app-globals-0f993ce5.js +0 -3
  187. package/dist/smoothly/css-shim-c64026cd.js +0 -4
  188. package/dist/smoothly/dom-a712b575.js +0 -73
  189. package/dist/smoothly/generate-50b98474.js +0 -61
  190. package/dist/smoothly/index-02a70ac1.js +0 -3027
  191. package/dist/smoothly/index-a5a08f46.js +0 -18848
  192. package/dist/smoothly/index-c8b5d468.js +0 -1349
  193. package/dist/smoothly/index-d1360bcf.js +0 -1671
  194. package/dist/smoothly/p-0bad2c46.entry.js +0 -1
  195. package/dist/smoothly/p-0c1e9588.entry.js +0 -1
  196. package/dist/smoothly/p-14232157.entry.js +0 -1
  197. package/dist/smoothly/p-19518931.js +0 -1
  198. package/dist/smoothly/p-22d4d5a7.entry.js +0 -1
  199. package/dist/smoothly/p-2cda1784.js +0 -1
  200. package/dist/smoothly/p-9fa3ab06.entry.js +0 -1
  201. package/dist/smoothly/p-b8a3e273.entry.js +0 -1
  202. package/dist/smoothly/shadow-css-1e16431b.js +0 -389
  203. package/dist/smoothly/smoothly-accordion-item.entry.js +0 -50
  204. package/dist/smoothly/smoothly-accordion.entry.js +0 -51
  205. package/dist/smoothly/smoothly-app-demo.entry.js +0 -25
  206. package/dist/smoothly/smoothly-app.entry.js +0 -15
  207. package/dist/smoothly/smoothly-backtotop.entry.js +0 -33
  208. package/dist/smoothly/smoothly-calendar.entry.js +0 -91
  209. package/dist/smoothly/smoothly-checkbox.entry.js +0 -18667
  210. package/dist/smoothly/smoothly-dialog-demo.entry.js +0 -12
  211. package/dist/smoothly/smoothly-dialog.entry.js +0 -34
  212. package/dist/smoothly/smoothly-display-amount.entry.js +0 -55
  213. package/dist/smoothly/smoothly-display-date-time.entry.js +0 -16
  214. package/dist/smoothly/smoothly-display-demo.entry.js +0 -21
  215. package/dist/smoothly/smoothly-display.entry.js +0 -37
  216. package/dist/smoothly/smoothly-frame.entry.js +0 -46
  217. package/dist/smoothly/smoothly-google-font.entry.js +0 -13
  218. package/dist/smoothly/smoothly-icon-demo.entry.js +0 -487
  219. package/dist/smoothly/smoothly-icon.entry.js +0 -48
  220. package/dist/smoothly/smoothly-input-date-range.entry.js +0 -46
  221. package/dist/smoothly/smoothly-input-date.entry.js +0 -40
  222. package/dist/smoothly/smoothly-input-demo.entry.js +0 -15
  223. package/dist/smoothly/smoothly-input-month.entry.js +0 -37
  224. package/dist/smoothly/smoothly-input.entry.js +0 -198
  225. package/dist/smoothly/smoothly-item.entry.js +0 -39
  226. package/dist/smoothly/smoothly-menu-options.entry.js +0 -104
  227. package/dist/smoothly/smoothly-notification.entry.js +0 -63
  228. package/dist/smoothly/smoothly-notifier.entry.js +0 -25
  229. package/dist/smoothly/smoothly-option.entry.js +0 -29
  230. package/dist/smoothly/smoothly-picker.entry.js +0 -147
  231. package/dist/smoothly/smoothly-popup.entry.js +0 -34
  232. package/dist/smoothly/smoothly-quiet.entry.js +0 -15
  233. package/dist/smoothly/smoothly-radio-group.entry.js +0 -16
  234. package/dist/smoothly/smoothly-radio.entry.js +0 -24
  235. package/dist/smoothly/smoothly-reorder.entry.js +0 -99
  236. package/dist/smoothly/smoothly-room.entry.js +0 -12
  237. package/dist/smoothly/smoothly-select-demo.entry.js +0 -82
  238. package/dist/smoothly/smoothly-select.entry.js +0 -27
  239. package/dist/smoothly/smoothly-selector.entry.js +0 -115
  240. package/dist/smoothly/smoothly-skeleton.entry.js +0 -23
  241. package/dist/smoothly/smoothly-spinner.entry.js +0 -20
  242. package/dist/smoothly/smoothly-submit.entry.js +0 -56
  243. package/dist/smoothly/smoothly-svg.entry.js +0 -37
  244. package/dist/smoothly/smoothly-tab-switch.entry.js +0 -28
  245. package/dist/smoothly/smoothly-tab.entry.js +0 -33
  246. package/dist/smoothly/smoothly-table-cell.entry.js +0 -15
  247. package/dist/smoothly/smoothly-table-demo.entry.js +0 -18
  248. package/dist/smoothly/smoothly-table-expandable-cell.entry.js +0 -41
  249. package/dist/smoothly/smoothly-table-expandable-row.entry.js +0 -28
  250. package/dist/smoothly/smoothly-table-header.entry.js +0 -37
  251. package/dist/smoothly/smoothly-table-row.entry.js +0 -34
  252. package/dist/smoothly/smoothly-table.entry.js +0 -22
  253. package/dist/smoothly/smoothly-trigger-sink.entry.js +0 -29
  254. package/dist/smoothly/smoothly-trigger-source.entry.js +0 -28
  255. package/dist/smoothly/smoothly-trigger.entry.js +0 -32
  256. package/dist/smoothly/smoothly-tuple.entry.js +0 -12
  257. package/dist/smoothly/smoothly-urlencoded.entry.js +0 -15
@@ -1,1671 +0,0 @@
1
- import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-8fe71198.js';
2
- import { d as dist$1 } from './index-a5a08f46.js';
3
-
4
- var getAdjecentWordBreakIndex_1 = createCommonjsModule(function (module, exports) {
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getAdjecentWordBreakIndex = void 0;
8
- function getForwardWordBreakIndex(str, index, wordRegex) {
9
- let result = 0;
10
- while (wordRegex.exec(str) != null) {
11
- result = wordRegex.lastIndex;
12
- if (wordRegex.lastIndex > index)
13
- break;
14
- }
15
- wordRegex.lastIndex <= index && (result = str.length);
16
- return result;
17
- }
18
- function getBackwardWordBreakIndex(str, index, wordRegex) {
19
- let result = 0;
20
- let execArray;
21
- while ((execArray = wordRegex.exec(str)) != null) {
22
- if (wordRegex.lastIndex - execArray[0].length < index)
23
- result = wordRegex.lastIndex - execArray[0].length;
24
- else
25
- break;
26
- }
27
- return result;
28
- }
29
- function getAdjecentWordBreakIndex(str, index, direction) {
30
- const wordRegex = /([\wåäöüéáúíóßðœøæñµçþ_]+|[@-]+)/gi;
31
- return direction == "backward"
32
- ? getBackwardWordBreakIndex(str, index, wordRegex)
33
- : getForwardWordBreakIndex(str, index, wordRegex);
34
- }
35
- exports.getAdjecentWordBreakIndex = getAdjecentWordBreakIndex;
36
- //# sourceMappingURL=getAdjecentWordBreakIndex.js.map
37
- });
38
-
39
- const getAdjecentWordBreakIndex = /*@__PURE__*/getDefaultExportFromCjs(getAdjecentWordBreakIndex_1);
40
-
41
- var Selection_1 = createCommonjsModule(function (module, exports) {
42
- "use strict";
43
- Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.Selection = void 0;
45
- var Selection;
46
- (function (Selection) {
47
- function getCursor(selection) {
48
- return selection.direction == "backward" ? selection.start : selection.end;
49
- }
50
- Selection.getCursor = getCursor;
51
- function getStalker(selection) {
52
- return selection.direction != "backward" ? selection.start : selection.end;
53
- }
54
- Selection.getStalker = getStalker;
55
- })(Selection = exports.Selection || (exports.Selection = {}));
56
- //# sourceMappingURL=Selection.js.map
57
- });
58
-
59
- const Selection = /*@__PURE__*/getDefaultExportFromCjs(Selection_1);
60
-
61
- var State_1 = createCommonjsModule(function (module, exports) {
62
- "use strict";
63
- Object.defineProperty(exports, "__esModule", { value: true });
64
- exports.State = void 0;
65
- var State;
66
- (function (State) {
67
- function copy(state) {
68
- return {
69
- value: state.value,
70
- selection: { start: state.selection.start, end: state.selection.end, direction: state.selection.direction },
71
- };
72
- }
73
- State.copy = copy;
74
- })(State = exports.State || (exports.State = {}));
75
- //# sourceMappingURL=State.js.map
76
- });
77
-
78
- const State = /*@__PURE__*/getDefaultExportFromCjs(State_1);
79
-
80
- var StateEditor_1 = createCommonjsModule(function (module, exports) {
81
- "use strict";
82
- Object.defineProperty(exports, "__esModule", { value: true });
83
- exports.StateEditor = void 0;
84
- class StateEditor {
85
- constructor(state) {
86
- var _a, _b, _c;
87
- this.value = state.value;
88
- this.selection = { start: (_a = state.selection) === null || _a === void 0 ? void 0 : _a.start, end: (_b = state.selection) === null || _b === void 0 ? void 0 : _b.end, direction: (_c = state.selection) === null || _c === void 0 ? void 0 : _c.direction };
89
- }
90
- get(index, length = 1) {
91
- return this.value.substr(index, length);
92
- }
93
- is(index, ...character) {
94
- const c = this.get(index);
95
- return character.some(d => c == d);
96
- }
97
- isDigit(index) {
98
- const character = this.get(index);
99
- return character >= "0" && character <= "9";
100
- }
101
- match(matcher) {
102
- return this.value.match(matcher);
103
- }
104
- replace(start, end, value) {
105
- let result;
106
- if (typeof start == "string" && typeof end == "string") {
107
- let s;
108
- result = this;
109
- while ((s = result.value.search(start)) > -1)
110
- result = result.replace(s, s + start.length, end);
111
- }
112
- else if (typeof start == "number" && typeof end == "number") {
113
- const state = {
114
- value: this.value,
115
- selection: { start: this.selection.start, end: this.selection.end, direction: this.selection.direction },
116
- };
117
- if (!value)
118
- value = "";
119
- state.value = this.value.slice(0, start) + value + this.value.slice(end, this.value.length);
120
- if (this.selection.start >= end)
121
- state.selection.start = this.selection.start + value.length - end + start;
122
- else if (this.selection.start > start && this.selection.start < end)
123
- state.selection.start = Math.min(this.selection.start, start + value.length);
124
- if (this.selection.end >= end)
125
- state.selection.end = this.selection.end + value.length - end + start;
126
- else if (this.selection.end > start && this.selection.end < end)
127
- state.selection.end = Math.min(this.selection.end, start + value.length);
128
- result = new StateEditor(state);
129
- }
130
- return result || this;
131
- }
132
- insert(index, value) {
133
- return this.replace(index, index, value);
134
- }
135
- append(value) {
136
- return this.insert(this.value.length, value);
137
- }
138
- prepend(value) {
139
- return this.insert(0, value);
140
- }
141
- suffix(value) {
142
- return new StateEditor({ value: this.value + value, selection: this.selection });
143
- }
144
- delete(start, end) {
145
- let result;
146
- if (!this.value)
147
- result = this;
148
- else if (typeof start == "string") {
149
- let s;
150
- result = this;
151
- while ((s = result.value.search(start)) > -1)
152
- result = result.delete(s, s + start.length);
153
- }
154
- else
155
- result = this.replace(start, end || start + 1, "");
156
- return result;
157
- }
158
- truncate(end) {
159
- return this.value.length >= end ? this.delete(end, this.value.length) : this;
160
- }
161
- pad(length, padding, index) {
162
- let result = this;
163
- while (length > result.value.length + padding.length)
164
- result = result.insert(index, padding);
165
- if (length > result.value.length)
166
- result = result.insert(index, padding.substring(0, length - result.value.length));
167
- return result;
168
- }
169
- padEnd(length, padding) {
170
- return this.pad(length, padding, this.value.length);
171
- }
172
- padStart(length, padding) {
173
- return this.pad(length, padding, 0);
174
- }
175
- map(mapping) {
176
- let result = this;
177
- let j = 0;
178
- for (let i = 0; i < this.value.length; i++) {
179
- const replacement = mapping(this.get(i), i);
180
- result = result.replace(j, j + 1, replacement);
181
- j += replacement.length;
182
- }
183
- return result;
184
- }
185
- static copy(state) {
186
- return new StateEditor(Object.assign({}, state));
187
- }
188
- static create() {
189
- return new StateEditor({ value: "", selection: { start: 0, end: 0 } });
190
- }
191
- static modify(state) {
192
- return new StateEditor(typeof state == "string" ? { value: state, selection: { start: state.length, end: state.length } } : state);
193
- }
194
- }
195
- exports.StateEditor = StateEditor;
196
- //# sourceMappingURL=StateEditor.js.map
197
- });
198
-
199
- const StateEditor = /*@__PURE__*/getDefaultExportFromCjs(StateEditor_1);
200
-
201
- var Action_1 = createCommonjsModule(function (module, exports) {
202
- "use strict";
203
- Object.defineProperty(exports, "__esModule", { value: true });
204
- exports.Action = void 0;
205
-
206
-
207
-
208
-
209
- var Action;
210
- (function (Action) {
211
- function apply(formatter, state, action) {
212
- var _a, _b;
213
- let result = State_1.State.copy(formatter.unformat(StateEditor_1.StateEditor.copy(state)));
214
- if (state.autocomplete == "cc-exp" && /^\d\d \/$/g.test(state.value))
215
- (action === null || action === void 0 ? void 0 : action.key) && (action.key = "Backspace");
216
- if (action) {
217
- if (action.ctrlKey || action.metaKey) {
218
- if (action.key == "a")
219
- select(result, 0, result.value.length, "forward");
220
- else if (["ArrowLeft", "ArrowRight"].includes(action.key) && ((_a = state) === null || _a === void 0 ? void 0 : _a.type) != "password")
221
- result = ctrlArrow(formatter, state, action);
222
- else if (["Delete", "Backspace"].includes(action.key) && ((_b = state) === null || _b === void 0 ? void 0 : _b.type) != "password")
223
- result = ctrlBackspaceDelete(formatter, state, action);
224
- }
225
- else if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(action.key))
226
- arrowHomeEnd(result, action);
227
- else if (["Delete", "Backspace"].includes(action.key)) {
228
- result.selection.start == result.selection.end &&
229
- select(result, result.selection.start + (action.key == "Backspace" ? -1 : 0), result.selection.end + (action.key == "Delete" ? 1 : 0));
230
- erase(result);
231
- }
232
- else if (action.key != "Unidentified") {
233
- erase(result);
234
- formatter.allowed(action.key, result) && replace(result, action.key);
235
- }
236
- }
237
- return formatter.format(StateEditor_1.StateEditor.copy(result));
238
- }
239
- Action.apply = apply;
240
- function ctrlArrow(formatter, state, action) {
241
- let cursorPosition = Selection_1.Selection.getCursor(state.selection);
242
- let stalkPosition = Selection_1.Selection.getStalker(state.selection);
243
- cursorPosition = getAdjecentWordBreakIndex_1.getAdjecentWordBreakIndex(state.value, cursorPosition, action.key == "ArrowLeft" ? "backward" : "forward");
244
- stalkPosition = action.shiftKey ? stalkPosition : cursorPosition;
245
- return State_1.State.copy(formatter.unformat(StateEditor_1.StateEditor.copy(Object.assign(Object.assign({}, state), { selection: {
246
- start: Math.min(stalkPosition, cursorPosition),
247
- end: Math.max(stalkPosition, cursorPosition),
248
- direction: stalkPosition < cursorPosition ? "forward" : stalkPosition > cursorPosition ? "backward" : "none",
249
- } }))));
250
- }
251
- function ctrlBackspaceDelete(formatter, state, action) {
252
- const cursorPosition = Selection_1.Selection.getCursor(state.selection);
253
- const adjecentIndex = getAdjecentWordBreakIndex_1.getAdjecentWordBreakIndex(state.value, cursorPosition, action.key == "Backspace" ? "backward" : "forward");
254
- const result = State_1.State.copy(formatter.unformat(StateEditor_1.StateEditor.copy(Object.assign(Object.assign({}, state), { selection: {
255
- start: Math.min(cursorPosition, adjecentIndex),
256
- end: Math.max(cursorPosition, adjecentIndex),
257
- direction: "none",
258
- } }))));
259
- result.value = result.value.substring(0, result.selection.start) + result.value.substring(result.selection.end);
260
- result.selection.end = result.selection.start;
261
- return result;
262
- }
263
- function arrowHomeEnd(state, action) {
264
- let cursorPosition = Selection_1.Selection.getCursor(state.selection);
265
- let stalkPosition = Selection_1.Selection.getStalker(state.selection);
266
- cursorPosition =
267
- action.key == "Home"
268
- ? 0
269
- : action.key == "End"
270
- ? state.value.length
271
- : state.selection.start == state.selection.end || action.shiftKey
272
- ? Math.min(Math.max(cursorPosition + (action.key == "ArrowLeft" ? -1 : 1), 0), state.value.length)
273
- : action.key == "ArrowLeft"
274
- ? state.selection.start
275
- : state.selection.end;
276
- stalkPosition = action.shiftKey ? stalkPosition : cursorPosition;
277
- state.selection.direction =
278
- stalkPosition < cursorPosition ? "forward" : stalkPosition > cursorPosition ? "backward" : "none";
279
- state.selection.start = Math.min(stalkPosition, cursorPosition);
280
- state.selection.end = Math.max(stalkPosition, cursorPosition);
281
- }
282
- function select(state, from, to, direction) {
283
- state.selection.start = from;
284
- state.selection.end = to;
285
- direction && (state.selection.direction = direction);
286
- }
287
- function erase(state) {
288
- replace(state, "");
289
- }
290
- function replace(state, insertString) {
291
- state.value =
292
- state.value.substring(0, state.selection.start) + insertString + state.value.substring(state.selection.end);
293
- state.selection.start = state.selection.start + insertString.length;
294
- state.selection.end = state.selection.start;
295
- }
296
- })(Action = exports.Action || (exports.Action = {}));
297
- //# sourceMappingURL=Action.js.map
298
- });
299
-
300
- const Action = /*@__PURE__*/getDefaultExportFromCjs(Action_1);
301
-
302
- var base = createCommonjsModule(function (module, exports) {
303
- "use strict";
304
- Object.defineProperty(exports, "__esModule", { value: true });
305
- exports.parse = exports.format = exports.get = exports.add = void 0;
306
-
307
- const handlers = {};
308
- function add(type, create) {
309
- handlers[type] = create;
310
- }
311
- exports.add = add;
312
- function get(type, ...argument) {
313
- const create = handlers[type];
314
- return create && create(argument);
315
- }
316
- exports.get = get;
317
- function format(data, type, ...argument) {
318
- const handler = get(type, argument);
319
- return handler
320
- ? handler.format(StateEditor_1.StateEditor.modify(handler.toString(typeof data == "string" ? parse(data, type, argument) : data)))
321
- .value
322
- : "";
323
- }
324
- exports.format = format;
325
- function parse(value, type, ...argument) {
326
- const handler = get(type, argument);
327
- return handler ? handler.fromString(handler.unformat(StateEditor_1.StateEditor.modify(value)).value) : undefined;
328
- }
329
- exports.parse = parse;
330
- //# sourceMappingURL=base.js.map
331
- });
332
-
333
- const base$1 = /*@__PURE__*/getDefaultExportFromCjs(base);
334
-
335
- var cardCsc = createCommonjsModule(function (module, exports) {
336
- "use strict";
337
- Object.defineProperty(exports, "__esModule", { value: true });
338
-
339
- class Handler {
340
- toString(data) {
341
- return typeof data == "string" ? data : "";
342
- }
343
- fromString(value) {
344
- return typeof value == "string" ? value : undefined;
345
- }
346
- format(unformated) {
347
- return Object.assign(Object.assign({}, unformated), { type: "tel", autocomplete: "cc-csc", length: [3, 3], pattern: /^\d{3}$/ });
348
- }
349
- unformat(formated) {
350
- return formated;
351
- }
352
- allowed(symbol, state) {
353
- return state.value.length < 3 && symbol >= "0" && symbol <= "9";
354
- }
355
- }
356
- base.add("card-csc", () => new Handler());
357
- //# sourceMappingURL=card-csc.js.map
358
- });
359
-
360
- const cardCsc$1 = /*@__PURE__*/getDefaultExportFromCjs(cardCsc);
361
-
362
- var cardExpires = createCommonjsModule(function (module, exports) {
363
- "use strict";
364
- Object.defineProperty(exports, "__esModule", { value: true });
365
-
366
- class Handler {
367
- toString(data) {
368
- return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
369
- ? data[0].toString().padStart(2, "0") + data[1].toString().padStart(2, "0")
370
- : "";
371
- }
372
- fromString(value) {
373
- return typeof value == "string" && value.length == 4
374
- ? [Number.parseInt(value.slice(0, 2)), Number.parseInt(value.slice(2))]
375
- : undefined;
376
- }
377
- format(unformated) {
378
- let result = unformated;
379
- if (unformated.value.length > 0 && !unformated.is(0, "0", "1"))
380
- result = result.prepend("0");
381
- if (result.value.length > 1)
382
- result = result.insert(2, " / ");
383
- return Object.assign(Object.assign({}, result), { type: "tel", autocomplete: "cc-exp", length: [7, 7], pattern: /^(0[1-9]|1[012]) \/ \d\d$/ });
384
- }
385
- unformat(formated) {
386
- return formated.delete(" / ");
387
- }
388
- allowed(symbol, state) {
389
- return state.value.length < 4 && symbol >= "0" && symbol <= "9";
390
- }
391
- }
392
- base.add("card-expires", () => new Handler());
393
- //# sourceMappingURL=card-expires.js.map
394
- });
395
-
396
- const cardExpires$1 = /*@__PURE__*/getDefaultExportFromCjs(cardExpires);
397
-
398
- var cardNumber = createCommonjsModule(function (module, exports) {
399
- "use strict";
400
- Object.defineProperty(exports, "__esModule", { value: true });
401
-
402
- class Handler {
403
- toString(data) {
404
- return typeof data == "string" ? data : "";
405
- }
406
- fromString(value) {
407
- return typeof value == "string" ? value : undefined;
408
- }
409
- format(unformated) {
410
- const issuer = getIssuer(unformated.value);
411
- const result = unformated.map((symbol, index) => (index != 0 && index % 4 == 0 && index + 1 < issuer.length[0] ? " " : "") + symbol);
412
- return Object.assign(Object.assign({}, result), { type: "tel", autocomplete: "cc-number", length: issuer.length.slice(1), pattern: issuer.verification, classes: ["issuer-" + issuer.icon] });
413
- }
414
- unformat(formated) {
415
- return formated.delete(" ");
416
- }
417
- allowed(symbol, state) {
418
- const issuer = getIssuer(state.value);
419
- return symbol >= "0" && symbol <= "9" && state.value.length < issuer.length[0];
420
- }
421
- }
422
- base.add("card-number", () => new Handler());
423
- function getIssuer(value) {
424
- let result = defaultIssuer;
425
- for (const key in issuers)
426
- if (Object.prototype.hasOwnProperty.call(issuers, key) && issuers[key].identification.test(value)) {
427
- result = Object.assign(Object.assign(Object.assign({}, defaultIssuer), { name: key }), issuers[key]);
428
- break;
429
- }
430
- return result;
431
- }
432
- const defaultIssuer = {
433
- name: "unknown",
434
- verification: /^\d{19}$/,
435
- identification: /^\d/,
436
- length: [16, 16, 19],
437
- icon: "generic",
438
- };
439
- const issuers = {
440
- amex: {
441
- verification: /^3[47][0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{3}$/,
442
- identification: /^3[47]/,
443
- length: [15, 18, 18],
444
- icon: "amex",
445
- },
446
- dankort: {
447
- verification: /^(5019)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
448
- identification: /^(5019)\d+/,
449
- length: [16, 19, 19],
450
- icon: "generic",
451
- },
452
- diners: {
453
- verification: /^3(?:0[0-5]|[68][0-9])[0-9]\s[0-9]{4}\s[0-9]{4}\s[0-9]{2}$/,
454
- identification: /^3(?:0[0-5]|[68][0-9])/,
455
- length: [14, 17, 17],
456
- icon: "diners",
457
- },
458
- discover: {
459
- verification: /^6(?:011|5[0-9]{2})\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
460
- identification: /^6(?:011|5[0-9]{2})/,
461
- length: [16, 19, 19],
462
- icon: "generic",
463
- },
464
- electron: {
465
- verification: /^((4026|4405|4508|4844|4913|4917)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4})|((4175)\s(00)[0-9]{2}\s[0-9]{4}\s[0-9]{4})$/,
466
- identification: /^(4026|417500|4405|4508|4844|4913|4917)/,
467
- length: [16, 19, 19],
468
- icon: "generic",
469
- },
470
- interpayment: {
471
- verification: /^(636)[0-9]\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
472
- identification: /^(636)/,
473
- length: [16, 19, 19],
474
- icon: "generic",
475
- },
476
- jcb: {
477
- verification: /^((?:2131|1800)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4})|(35[0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4})$/,
478
- identification: /^(?:2131|1800|35\d{3})/,
479
- length: [16, 19, 19],
480
- icon: "generic",
481
- },
482
- unionpay: {
483
- verification: /^(62|88)[0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
484
- identification: /^(62|88)/,
485
- length: [16, 19, 19],
486
- icon: "generic",
487
- },
488
- maestro: {
489
- verification: /^(5018|5020|5038|5612|5893|6304|6759|6761|6762|6763|0604|6390)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
490
- identification: /^(5018|5020|5038|5612|5893|6304|6759|6761|6762|6763|0604|6390)/,
491
- length: [16, 19, 19],
492
- icon: "maestro",
493
- },
494
- mastercard: {
495
- verification: /^5[1-5][0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
496
- identification: /^5[1-5][0-9]/,
497
- length: [16, 19, 19],
498
- icon: "mastercard",
499
- },
500
- visa: {
501
- verification: /^4[0-9]{3}\s[0-9]{4}\s[0-9]{4}\s[0-9](?:[0-9]{3})?$/,
502
- identification: /^4[0-9]/,
503
- length: [16, 16, 19],
504
- icon: "visa",
505
- },
506
- };
507
- //# sourceMappingURL=card-number.js.map
508
- });
509
-
510
- const cardNumber$1 = /*@__PURE__*/getDefaultExportFromCjs(cardNumber);
511
-
512
- var DateFormat_1 = createCommonjsModule(function (module, exports) {
513
- "use strict";
514
- Object.defineProperty(exports, "__esModule", { value: true });
515
- exports.DateFormat = void 0;
516
- var DateFormat;
517
- (function (DateFormat) {
518
- function fromLocale(locale) {
519
- let result;
520
- switch (locale) {
521
- case "sq-AL":
522
- case "es-AR":
523
- case "it-IT":
524
- case "en-GB":
525
- case "fr-FR":
526
- result = "dd/mm/YYYY";
527
- break;
528
- case "en-US":
529
- result = "mm/dd/YYYY";
530
- break;
531
- case "et-EE":
532
- case "de-AT":
533
- case "de-DE":
534
- case "he-IL":
535
- case "is-IS":
536
- case "lv-LV":
537
- case "pl-PL":
538
- case "ru-RU":
539
- case "fi-FI":
540
- result = "dd.mm.YYYY";
541
- break;
542
- case "hi-IN":
543
- case "en-IN":
544
- result = "dd-mm-YYYY";
545
- break;
546
- default:
547
- result = "YYYY-mm-dd";
548
- break;
549
- }
550
- return result;
551
- }
552
- DateFormat.fromLocale = fromLocale;
553
- function toLocale(format) {
554
- let result;
555
- switch (format) {
556
- case "dd/mm/YYYY":
557
- result = "en-GB";
558
- break;
559
- case "mm/dd/YYYY":
560
- result = "en-US";
561
- break;
562
- case "dd.mm.YYYY":
563
- result = "de-DE";
564
- break;
565
- default:
566
- result = "sv-SE";
567
- break;
568
- }
569
- return result;
570
- }
571
- DateFormat.toLocale = toLocale;
572
- function is(value) {
573
- return (typeof value == "string" &&
574
- (value == "YYYY-mm-dd" || value == "dd/mm/YYYY" || value == "dd.mm.YYYY" || value == "mm/dd/YYYY"));
575
- }
576
- DateFormat.is = is;
577
- })(DateFormat = exports.DateFormat || (exports.DateFormat = {}));
578
- //# sourceMappingURL=DateFormat.js.map
579
- });
580
-
581
- const DateFormat = /*@__PURE__*/getDefaultExportFromCjs(DateFormat_1);
582
-
583
- var Base_1 = createCommonjsModule(function (module, exports) {
584
- "use strict";
585
- Object.defineProperty(exports, "__esModule", { value: true });
586
- exports.register = exports.Base = void 0;
587
-
588
-
589
-
590
- class Base {
591
- constructor(seperator) {
592
- this.seperator = seperator;
593
- }
594
- unformat(formated) {
595
- return formated.delete(this.seperator);
596
- }
597
- daysInMonth(value) {
598
- var _a;
599
- return (32 -
600
- Number.parseInt(dist$1.Date.next(((_a = this.fromString(value.padEnd(8, "1"))) !== null && _a !== void 0 ? _a : "1970-01-01").substring(0, 8) + "28", 4).substring(8, 10)));
601
- }
602
- validMonth(day, month, year) {
603
- return (new Date(Number.parseInt(year !== null && year !== void 0 ? year : "2004"), Number.parseInt(month), 0).getDate() >=
604
- Number.parseInt(day));
605
- }
606
- }
607
- exports.Base = Base;
608
- const handlers = {};
609
- function register(format, create) {
610
- handlers[format] = create;
611
- }
612
- exports.register = register;
613
- base.add("date", (parameters) => {
614
- var _a;
615
- const argument = parameters && parameters.length > 0 ? parameters[0] : undefined;
616
- const format = DateFormat_1.DateFormat.is(argument) ? argument : DateFormat_1.DateFormat.fromLocale(argument);
617
- const create = (_a = handlers[format]) !== null && _a !== void 0 ? _a : handlers["YYYY-mm-dd"];
618
- return create();
619
- });
620
- //# sourceMappingURL=Base.js.map
621
- });
622
-
623
- const Base = /*@__PURE__*/getDefaultExportFromCjs(Base_1);
624
-
625
- var dmy = createCommonjsModule(function (module, exports) {
626
- "use strict";
627
- Object.defineProperty(exports, "__esModule", { value: true });
628
-
629
-
630
- class Handler extends Base_1.Base {
631
- constructor(seperator) {
632
- super(seperator);
633
- }
634
- toString(data) {
635
- return (data === null || data === void 0 ? void 0 : data.length) == 10
636
- ? [data.substring(8, 10), data.substring(5, 7), data.substring(0, 4)].join(this.seperator)
637
- : "";
638
- }
639
- fromString(value) {
640
- const result = (value === null || value === void 0 ? void 0 : value.length) == 8 ? `${value.substring(4, 8)}-${value.substring(2, 4)}-${value.substring(0, 2)}` : undefined;
641
- return dist$1.Date.is(result) ? result : undefined;
642
- }
643
- format(unformatted) {
644
- let result = unformatted;
645
- if (result.get(0, 1) > "3")
646
- result = result.insert(0, "0");
647
- if (result.value.length > 1)
648
- result = result.insert(2, this.seperator);
649
- if (result.get(3, 1) > "1")
650
- result = result.insert(3, "0");
651
- if (result.value.length > 4)
652
- result = result.insert(5, this.seperator);
653
- return Object.assign(Object.assign({}, result), { type: "text", length: [0, 10], pattern: new RegExp(["^(0[1-9]|[12][0-9]|3[01])", "(0[1-9]|1[012])", "\\d{4}$"].join(this.seperator)) });
654
- }
655
- allowed(symbol, state) {
656
- return state.selection.start == 1 && state.value[0] == "3"
657
- ? symbol >= "0" && symbol <= "1"
658
- : state.selection.start == 1 && state.value[0] == "0"
659
- ? symbol >= "1" && symbol <= "9"
660
- : state.selection.start == 2
661
- ? symbol >= "0" &&
662
- symbol <= "9" &&
663
- (symbol == "0" || symbol == "1" || this.validMonth(state.value.substring(0, 2), symbol))
664
- : state.selection.start == 3
665
- ? symbol >= "0" && symbol <= "9" && this.validMonth(state.value.substring(0, 2), state.value[2] + symbol)
666
- : state.selection.start == 7
667
- ? symbol >= "0" &&
668
- symbol <= "9" &&
669
- this.validMonth(state.value.substring(0, 2), state.value.substring(2, 4), state.value.substring(4, 7) + symbol)
670
- : state.selection.start < 8 && symbol >= "0" && symbol <= "9";
671
- }
672
- }
673
- Base_1.register("dd.mm.YYYY", () => new Handler("."));
674
- Base_1.register("dd/mm/YYYY", () => new Handler("/"));
675
- Base_1.register("dd-mm-YYYY", () => new Handler("-"));
676
- //# sourceMappingURL=dmy.js.map
677
- });
678
-
679
- const dmy$1 = /*@__PURE__*/getDefaultExportFromCjs(dmy);
680
-
681
- var mdy = createCommonjsModule(function (module, exports) {
682
- "use strict";
683
- Object.defineProperty(exports, "__esModule", { value: true });
684
-
685
-
686
- class Handler extends Base_1.Base {
687
- constructor(seperator) {
688
- super(seperator);
689
- }
690
- toString(data) {
691
- return (data === null || data === void 0 ? void 0 : data.length) == 10
692
- ? [data.substring(5, 7), data.substring(8, 10), data.substring(0, 4)].join(this.seperator)
693
- : "";
694
- }
695
- fromString(value) {
696
- const result = value.length == 8 ? `${value.substring(4, 8)}-${value.substring(0, 2)}-${value.substring(2, 4)}` : undefined;
697
- return dist$1.Date.is(result) ? result : undefined;
698
- }
699
- format(unformatted) {
700
- let result = unformatted;
701
- if (result.get(0, 1) > "1")
702
- result = result.insert(0, "0");
703
- if (result.value.length > 1)
704
- result = result.insert(2, this.seperator);
705
- if (result.get(3, 1) > (result.get(0, 2) == "02" ? "2" : "3"))
706
- result = result.insert(3, "0");
707
- if (result.value.length > 4)
708
- result = result.insert(5, this.seperator);
709
- return Object.assign(Object.assign({}, result), { type: "text", length: [0, 10], pattern: new RegExp(["^(0[1-9]|1[012])", "(0[1-9]|[12][0-9]|3[01])", "\\d{4}$"].join(this.seperator)) });
710
- }
711
- allowed(symbol, state) {
712
- const result = state.selection.start == 1 && state.value[0] == "1"
713
- ? symbol >= "0" && symbol <= "2"
714
- : state.selection.start == 1 && state.value[0] == "0"
715
- ? symbol >= "1" && symbol <= "9"
716
- : state.selection.start == 3
717
- ? symbol >= "0" && symbol <= "9" && this.validMonth(state.value[2] + symbol, state.value.substring(0, 2))
718
- : state.selection.start == 7
719
- ? symbol >= "0" &&
720
- symbol <= "9" &&
721
- this.validMonth(state.value.substring(2, 4), state.value.substring(0, 2), state.value.substring(4, 7) + symbol)
722
- : state.selection.start < 8 && symbol >= "0" && symbol <= "9";
723
- return result;
724
- }
725
- }
726
- Base_1.register("mm/dd/YYYY", () => new Handler("/"));
727
- //# sourceMappingURL=mdy.js.map
728
- });
729
-
730
- const mdy$1 = /*@__PURE__*/getDefaultExportFromCjs(mdy);
731
-
732
- var ymd = createCommonjsModule(function (module, exports) {
733
- "use strict";
734
- Object.defineProperty(exports, "__esModule", { value: true });
735
-
736
-
737
- class Handler extends Base_1.Base {
738
- constructor(seperator) {
739
- super(seperator);
740
- }
741
- toString(data) {
742
- return typeof data != "string" ? "" : data;
743
- }
744
- fromString(value) {
745
- const result = (value === null || value === void 0 ? void 0 : value.length) == 8 ? `${value.substring(0, 4)}-${value.substring(4, 6)}-${value.substring(6, 8)}` : undefined;
746
- return dist$1.Date.is(result) ? result : undefined;
747
- }
748
- format(unformatted) {
749
- let result = unformatted;
750
- if (result.value.length > 3) {
751
- result = result.insert(4, this.seperator);
752
- if (result.get(5, 1) > "1")
753
- result = result.insert(5, "0");
754
- if (result.value.length > 6) {
755
- result = result.insert(7, this.seperator);
756
- if (result.get(8, 1) > this.daysInMonth(unformatted.value).toString().substring(0, 1))
757
- result = result.insert(8, "0");
758
- }
759
- }
760
- return Object.assign(Object.assign({}, result), { type: "text", length: [0, 10], pattern: new RegExp(["^\\d{4}", "(0[1-9]|1[012])", "(0[1-9]|[12][0-9]|3[01])$"].join(this.seperator)) });
761
- }
762
- allowed(symbol, state) {
763
- const daysInMonth = this.daysInMonth(state.value);
764
- return state.selection.start == 5 && state.value[4] == "0"
765
- ? symbol >= "1" && symbol <= "9"
766
- : state.selection.start == 5 && state.value[4] == "1"
767
- ? symbol >= "0" && symbol <= "2"
768
- : state.selection.start == 7 && state.value[6] == "0"
769
- ? symbol >= "1" && symbol <= "9"
770
- : state.selection.start == 7 && ((state.value[6] == "2" && daysInMonth < 30) || state.value[6] == "3")
771
- ? symbol >= "0" && symbol <= daysInMonth.toString().substring(1)
772
- : state.selection.start < 8 && symbol >= "0" && symbol <= "9";
773
- }
774
- }
775
- Base_1.register("YYYY-mm-dd", () => new Handler("-"));
776
- //# sourceMappingURL=ymd.js.map
777
- });
778
-
779
- const ymd$1 = /*@__PURE__*/getDefaultExportFromCjs(ymd);
780
-
781
- var date = createCommonjsModule(function (module, exports) {
782
- "use strict";
783
- Object.defineProperty(exports, "__esModule", { value: true });
784
-
785
-
786
-
787
- //# sourceMappingURL=index.js.map
788
- });
789
-
790
- const index$2 = /*@__PURE__*/getDefaultExportFromCjs(date);
791
-
792
- var dateTime = createCommonjsModule(function (module, exports) {
793
- "use strict";
794
- Object.defineProperty(exports, "__esModule", { value: true });
795
- exports.formatDate = void 0;
796
-
797
-
798
- class Handler {
799
- toString(data) {
800
- return typeof data == "string" ? data : "";
801
- }
802
- fromString(value) {
803
- let result = value.replace(" ", "T");
804
- const fillerDate = "0000-01-01T00:00:00.000Z";
805
- if (result === null || result === void 0 ? void 0 : result.match(/-\d$/))
806
- result = result.substring(0, result.length - 1) + "0" + result.substring(result.length - 1, result.length);
807
- result = !result.match(/^\d{4}-(0[1-9]|1[012])/)
808
- ? undefined
809
- : result + fillerDate.substring(result.length, fillerDate.length);
810
- return dist$1.DateTime.is(result) ? result : undefined;
811
- }
812
- format(unformated) {
813
- let result = formatDate(unformated);
814
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[\d:.-]$/))
815
- result = result.insert(10, " ");
816
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 3$/))
817
- result = result.replace(11, 12, "23:");
818
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [45]$/))
819
- result = result.insert(11, "23:");
820
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [6-9]$/))
821
- result = result.insert(11, "23:5");
822
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 24$/))
823
- result = result.replace(10, 13, "00:");
824
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 25$/))
825
- result = result.insert(12, "3:");
826
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 2[6-9]$/))
827
- result = result.insert(12, "3:5").append(":");
828
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])\d[\s\S]$/))
829
- result = result.insert(13, ":");
830
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[6-9]$/))
831
- result = result.insert(14, "5");
832
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d\d$/))
833
- result = result.insert(16, ":");
834
- if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d:[6-9]$/))
835
- result = result.insert(17, "5");
836
- return Object.assign(Object.assign({}, result), { type: "text", length: [0, 19], pattern: /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])(:[0-5]\d){2}$/ });
837
- }
838
- unformat(formated) {
839
- return formated;
840
- }
841
- allowed(symbol, state) {
842
- return (state.value.length < 19 &&
843
- ((symbol >= "0" && symbol <= "9") || symbol == "-" || symbol == ":" || symbol == "." || symbol == " "));
844
- }
845
- }
846
- base.add("date-time", () => new Handler());
847
- function formatDate(unformated, format) {
848
- let result = unformated;
849
- switch (format) {
850
- case "dd/mm/YYYY":
851
- case "dd.mm.YYYY":
852
- if (!validDate(result.value, format))
853
- result = result.replace(0, 10, validDate("31" + result.value.substring(2, 10), format)
854
- ? "31" + result.value.substring(2, 10)
855
- : validDate("30" + result.value.substring(2, 10), format)
856
- ? "30" + result.value.substring(2, 10)
857
- : validDate("29" + result.value.substring(2, 10), format)
858
- ? "29" + result.value.substring(2, 10)
859
- : validDate("28" + result.value.substring(2, 10), format)
860
- ? "28" + result.value.substring(2, 10)
861
- : result.value);
862
- break;
863
- case "mm/dd/YYYY":
864
- if (!validDate(result.value, format))
865
- result = result.replace(0, 10, validDate(result.value.substring(0, 3) + "31" + result.value.substring(5, 10), format)
866
- ? result.value.substring(0, 3) + "31" + result.value.substring(5, 10)
867
- : validDate(result.value.substring(0, 3) + "30" + result.value.substring(5, 10), format)
868
- ? result.value.substring(0, 3) + "30" + result.value.substring(5, 10)
869
- : validDate(result.value.substring(0, 3) + "29" + result.value.substring(5, 10), format)
870
- ? result.value.substring(0, 3) + "29" + result.value.substring(5, 10)
871
- : validDate(result.value.substring(0, 3) + "28" + result.value.substring(5, 10), format)
872
- ? result.value.substring(0, 3) + "28" + result.value.substring(5, 10)
873
- : result.value);
874
- break;
875
- default:
876
- if (unformated.value.length == 10) {
877
- if (!validDate(result.value)) {
878
- result = result.replace(0, 10, validDate(result.value.substring(0, 8) + "31")
879
- ? result.value.substring(0, 8) + "31"
880
- : validDate(result.value.substring(0, 8) + "30")
881
- ? result.value.substring(0, 8) + "30"
882
- : validDate(result.value.substring(0, 8) + "29")
883
- ? result.value.substring(0, 8) + "29"
884
- : validDate(result.value.substring(0, 8) + "28")
885
- ? result.value.substring(0, 8) + "28"
886
- : result.value);
887
- break;
888
- }
889
- return unformated;
890
- }
891
- }
892
- return result;
893
- }
894
- exports.formatDate = formatDate;
895
- function validDate(date, format) {
896
- let year;
897
- let month;
898
- let day;
899
- switch (format) {
900
- case "dd/mm/YYYY":
901
- case "dd.mm.YYYY":
902
- year = parseInt(date.substring(6, 10));
903
- month = parseInt(date.substring(3, 5));
904
- day = parseInt(date.substring(0, 2));
905
- return year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
906
- case "mm/dd/YYYY":
907
- year = parseInt(date.substring(6, 10));
908
- month = parseInt(date.substring(0, 2));
909
- day = parseInt(date.substring(3, 5));
910
- return year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
911
- default:
912
- year = parseInt(date.substring(0, 4));
913
- month = parseInt(date.substring(5, 7));
914
- day = parseInt(date.substring(8, 10));
915
- return year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
916
- }
917
- }
918
- function daysPerMonth(year, month) {
919
- let result;
920
- switch (month) {
921
- case 1:
922
- case 3:
923
- case 5:
924
- case 7:
925
- case 8:
926
- case 10:
927
- case 12:
928
- default:
929
- result = 31;
930
- break;
931
- case 4:
932
- case 6:
933
- case 9:
934
- case 11:
935
- result = 30;
936
- break;
937
- case 2:
938
- result = 28;
939
- break;
940
- }
941
- return result;
942
- }
943
- //# sourceMappingURL=date-time.js.map
944
- });
945
-
946
- const dateTime$1 = /*@__PURE__*/getDefaultExportFromCjs(dateTime);
947
-
948
- var divisor = createCommonjsModule(function (module, exports) {
949
- "use strict";
950
- Object.defineProperty(exports, "__esModule", { value: true });
951
-
952
- class Handler {
953
- toString(data) {
954
- return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
955
- ? data[0].toString() + " / " + data[1].toString()
956
- : typeof data == "number"
957
- ? data.toString()
958
- : "";
959
- }
960
- fromString(value) {
961
- return typeof value == "string" && value.match(/^\d{1,2}\s+\/\s+\d{1,2}$/)
962
- ? [Number.parseInt(value.slice(0, 2)), Number.parseInt(value.slice(value.length - 2))]
963
- : typeof value == "string" && value.match(/\d{1,2}/)
964
- ? Number.parseInt(value)
965
- : undefined;
966
- }
967
- format(unformated) {
968
- let result = unformated;
969
- if (unformated.match(/^\d\/$/))
970
- result = unformated.replace(1, 2, " / ");
971
- else if (unformated.match(/^\d{1,2}\s$/))
972
- result = unformated.replace(unformated.value.length - 1, unformated.value.length, " / ");
973
- else if (unformated.match(/^[\D.]+\/[\D.]+$/))
974
- result = unformated.delete(0, unformated.value.length);
975
- else if (unformated.match(/^[\D.]+\/[\D.]+\d$/))
976
- result = unformated.delete(0, unformated.value.length - 1);
977
- else if (unformated.match(/^[\D.]+\/[\D.]+\d\d$/))
978
- result = unformated.delete(0, unformated.value.length - 2);
979
- else if (unformated.match(/^[\D.]+\//))
980
- result = unformated.delete(0, unformated.value.search("/") + 1);
981
- else if (unformated.match(/^\d\d\/$/))
982
- result = unformated.replace(2, 3, " / ");
983
- else if (unformated.match(/^\d\d\s+\/$/))
984
- result = unformated.delete(2, unformated.value.length);
985
- else if (unformated.match(/^\d\s+\/$/))
986
- result = unformated.delete(1, unformated.value.length);
987
- else if (unformated.match(/^\d\d\s\s+\/\s*$/))
988
- result = unformated.replace(2, unformated.value.length, " / ");
989
- else if (unformated.match(/^\d\s\s+(\/\s*)?$/))
990
- result = unformated.replace(1, unformated.value.length, " / ");
991
- else if (unformated.match(/^\d\s\/\s\d\d.+$/))
992
- result = unformated.delete(6, unformated.value.length);
993
- else if (unformated.value.length > 1 && unformated.value.indexOf("/") < 1)
994
- result = unformated.insert(2, " / ");
995
- else if (unformated.value.length > 1 && unformated.value.split("/").length > 2)
996
- result = unformated.delete(unformated.value.lastIndexOf("/"));
997
- else if (unformated.value.length == 1 && !unformated.isDigit(0))
998
- result = unformated.delete(0);
999
- return Object.assign(Object.assign({}, result), { type: "text", length: [1, 7], pattern: /^(\d{1,2}|\d{1,2} \/ \d{1,2})$/ });
1000
- }
1001
- unformat(formated) {
1002
- return formated;
1003
- }
1004
- allowed(symbol, state) {
1005
- return state.value.length < 7 && ((symbol >= "0" && symbol <= "9") || symbol == "/" || symbol == " ");
1006
- }
1007
- }
1008
- base.add("divisor", () => new Handler());
1009
- //# sourceMappingURL=divisor.js.map
1010
- });
1011
-
1012
- const divisor$1 = /*@__PURE__*/getDefaultExportFromCjs(divisor);
1013
-
1014
- var identityNumber = createCommonjsModule(function (module, exports) {
1015
- "use strict";
1016
- Object.defineProperty(exports, "__esModule", { value: true });
1017
-
1018
- class Handler {
1019
- constructor(country) {
1020
- this.country = country;
1021
- }
1022
- toString(data) {
1023
- return typeof data == "string" ? data : "";
1024
- }
1025
- fromString(value) {
1026
- return typeof value == "string" ? value : undefined;
1027
- }
1028
- format(unformated) {
1029
- let result = unformated;
1030
- const year = new Date().getFullYear().toString();
1031
- if (unformated.value.length > 1 && unformated.get(0, 2) != "19" && unformated.get(0, 2) != "20")
1032
- result = result.prepend(unformated.get(0, 2) > year.substr(2, 2) ? "19" : "20");
1033
- if (result.value.length >= 8)
1034
- result = result.insert(8, "-");
1035
- return Object.assign(Object.assign({}, result.truncate(13)), { type: "text", length: [11, 13], pattern: /^\d{6,8}-\d{4}$/ });
1036
- }
1037
- unformat(formated) {
1038
- return formated.delete("-");
1039
- }
1040
- allowed(symbol, state) {
1041
- return state.value.length < 13 && symbol >= "0" && symbol <= "9";
1042
- }
1043
- }
1044
- base.add("identity-number", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
1045
- //# sourceMappingURL=identity-number.js.map
1046
- });
1047
-
1048
- const identityNumber$1 = /*@__PURE__*/getDefaultExportFromCjs(identityNumber);
1049
-
1050
- var password = createCommonjsModule(function (module, exports) {
1051
- "use strict";
1052
- Object.defineProperty(exports, "__esModule", { value: true });
1053
-
1054
- class Handler {
1055
- toString(data) {
1056
- return typeof data == "string" ? data : "";
1057
- }
1058
- fromString(value) {
1059
- return typeof value == "string" ? value : undefined;
1060
- }
1061
- format(unformated) {
1062
- return Object.assign(Object.assign({}, unformated), { type: "password", autocomplete: "current-password" });
1063
- }
1064
- unformat(formated) {
1065
- return formated;
1066
- }
1067
- allowed(symbol, state) {
1068
- return true;
1069
- }
1070
- }
1071
- base.add("password", () => new Handler());
1072
- //# sourceMappingURL=password.js.map
1073
- });
1074
-
1075
- const password$1 = /*@__PURE__*/getDefaultExportFromCjs(password);
1076
-
1077
- var percent = createCommonjsModule(function (module, exports) {
1078
- "use strict";
1079
- Object.defineProperty(exports, "__esModule", { value: true });
1080
-
1081
- class Handler {
1082
- toString(data) {
1083
- return data && typeof data == "number" ? (data * 100).toString() : "";
1084
- }
1085
- fromString(value) {
1086
- return typeof value != "string" || !Number.parseFloat(value) ? undefined : Number.parseFloat(value) / 100;
1087
- }
1088
- format(unformated) {
1089
- return Object.assign(Object.assign({}, (unformated.value ? unformated.suffix(" %") : unformated)), { type: "text", length: [3, undefined], pattern: /^\d+(.\d)? %+$/ });
1090
- }
1091
- unformat(formated) {
1092
- return formated.delete(" %");
1093
- }
1094
- allowed(symbol, state) {
1095
- return (symbol >= "0" && symbol <= "9") || (symbol == "." && !state.value.includes("."));
1096
- }
1097
- }
1098
- base.add("percent", () => new Handler());
1099
- //# sourceMappingURL=percent.js.map
1100
- });
1101
-
1102
- const percent$1 = /*@__PURE__*/getDefaultExportFromCjs(percent);
1103
-
1104
- var phonePrefix = createCommonjsModule(function (module, exports) {
1105
- "use strict";
1106
- Object.defineProperty(exports, "__esModule", { value: true });
1107
- exports.phonePrefix = void 0;
1108
- exports.phonePrefix = [
1109
- {
1110
- countryCode: "+46",
1111
- areaCodes: [
1112
- "011",
1113
- "0120",
1114
- "0121",
1115
- "0122",
1116
- "0123",
1117
- "0125",
1118
- "013",
1119
- "0140",
1120
- "0141",
1121
- "0142",
1122
- "0143",
1123
- "0144",
1124
- "0150",
1125
- "0151",
1126
- "0152",
1127
- "0155",
1128
- "0156",
1129
- "0157",
1130
- "0158",
1131
- "0159",
1132
- "016",
1133
- "0171",
1134
- "0173",
1135
- "0174",
1136
- "0175",
1137
- "0176",
1138
- "018",
1139
- "019",
1140
- "021",
1141
- "0220",
1142
- "0221",
1143
- "0222",
1144
- "0223",
1145
- "0224",
1146
- "0225",
1147
- "0226",
1148
- "0227",
1149
- "023",
1150
- "0240",
1151
- "0241",
1152
- "0243",
1153
- "0246",
1154
- "0247",
1155
- "0248",
1156
- "0250",
1157
- "0251",
1158
- "0253",
1159
- "0258",
1160
- "026",
1161
- "0270",
1162
- "0271",
1163
- "0278",
1164
- "0280",
1165
- "0281",
1166
- "0290",
1167
- "0291",
1168
- "0292",
1169
- "0293",
1170
- "0294",
1171
- "0295",
1172
- "0297",
1173
- "0300",
1174
- "0301",
1175
- "0302",
1176
- "0303",
1177
- "0304",
1178
- "031",
1179
- "0320",
1180
- "0321",
1181
- "0322",
1182
- "0325",
1183
- "033",
1184
- "0340",
1185
- "0345",
1186
- "0346",
1187
- "035",
1188
- "036",
1189
- "0370",
1190
- "0371",
1191
- "0372",
1192
- "0380",
1193
- "0381",
1194
- "0382",
1195
- "0383",
1196
- "0390",
1197
- "0392",
1198
- "0393",
1199
- "040",
1200
- "0410",
1201
- "0411",
1202
- "0413",
1203
- "0414",
1204
- "0415",
1205
- "0416",
1206
- "0417",
1207
- "0418",
1208
- "042",
1209
- "0430",
1210
- "0431",
1211
- "0433",
1212
- "0435",
1213
- "044",
1214
- "0451",
1215
- "0454",
1216
- "0455",
1217
- "0456",
1218
- "0457",
1219
- "0459",
1220
- "046",
1221
- "0470",
1222
- "0471",
1223
- "0472",
1224
- "0474",
1225
- "0476",
1226
- "0477",
1227
- "0478",
1228
- "0479",
1229
- "0480",
1230
- "0481",
1231
- "0485",
1232
- "0486",
1233
- "0490",
1234
- "0491",
1235
- "0492",
1236
- "0493",
1237
- "0494",
1238
- "0495",
1239
- "0496",
1240
- "0498",
1241
- "0499",
1242
- "0500",
1243
- "0501",
1244
- "0502",
1245
- "0503",
1246
- "0504",
1247
- "0505",
1248
- "0506",
1249
- "0510",
1250
- "0511",
1251
- "0512",
1252
- "0513",
1253
- "0514",
1254
- "0515",
1255
- "0520",
1256
- "0521",
1257
- "0522",
1258
- "0523",
1259
- "0524",
1260
- "0525",
1261
- "0526",
1262
- "0528",
1263
- "0530",
1264
- "0531",
1265
- "0532",
1266
- "0533",
1267
- "0534",
1268
- "054",
1269
- "0550",
1270
- "0551",
1271
- "0552",
1272
- "0553",
1273
- "0554",
1274
- "0555",
1275
- "0560",
1276
- "0563",
1277
- "0564",
1278
- "0565",
1279
- "0570",
1280
- "0571",
1281
- "0573",
1282
- "0580",
1283
- "0581",
1284
- "0582",
1285
- "0583",
1286
- "0584",
1287
- "0585",
1288
- "0586",
1289
- "0587",
1290
- "0589",
1291
- "0590",
1292
- "0591",
1293
- "060",
1294
- "0611",
1295
- "0612",
1296
- "0613",
1297
- "0620",
1298
- "0621",
1299
- "0622",
1300
- "0623",
1301
- "0624",
1302
- "063",
1303
- "0640",
1304
- "0642",
1305
- "0643",
1306
- "0644",
1307
- "0645",
1308
- "0647",
1309
- "0650",
1310
- "0651",
1311
- "0652",
1312
- "0653",
1313
- "0657",
1314
- "0660",
1315
- "0661",
1316
- "0662",
1317
- "0663",
1318
- "0670",
1319
- "0671",
1320
- "0672",
1321
- "0680",
1322
- "0682",
1323
- "0684",
1324
- "0687",
1325
- "0690",
1326
- "0691",
1327
- "0692",
1328
- "0693",
1329
- "0695",
1330
- "0696",
1331
- "08",
1332
- "090",
1333
- "0910",
1334
- "0911",
1335
- "0912",
1336
- "0913",
1337
- "0914",
1338
- "0915",
1339
- "0916",
1340
- "0918",
1341
- "0920",
1342
- "0921",
1343
- "0922",
1344
- "0923",
1345
- "0924",
1346
- "0925",
1347
- "0926",
1348
- "0927",
1349
- "0928",
1350
- "0929",
1351
- "0930",
1352
- "0932",
1353
- "0933",
1354
- "0934",
1355
- "0935",
1356
- "0940",
1357
- "0941",
1358
- "0942",
1359
- "0943",
1360
- "0950",
1361
- "0951",
1362
- "0952",
1363
- "0953",
1364
- "0954",
1365
- "0960",
1366
- "0961",
1367
- "0970",
1368
- "0971",
1369
- "0973",
1370
- "0975",
1371
- "0976",
1372
- "0977",
1373
- "0978",
1374
- "0980",
1375
- "0981",
1376
- "010",
1377
- "020",
1378
- "0378",
1379
- "070",
1380
- "072",
1381
- "073",
1382
- "076",
1383
- "079",
1384
- "0710",
1385
- "0740",
1386
- "0746",
1387
- "0749",
1388
- "0741",
1389
- "0742",
1390
- "0743",
1391
- "0744",
1392
- "0745",
1393
- "0747",
1394
- "075",
1395
- "077",
1396
- "078",
1397
- "0900",
1398
- "0939",
1399
- "0944",
1400
- "0969",
1401
- "099",
1402
- ],
1403
- },
1404
- ];
1405
- //# sourceMappingURL=phonePrefix.js.map
1406
- });
1407
-
1408
- const phonePrefix$1 = /*@__PURE__*/getDefaultExportFromCjs(phonePrefix);
1409
-
1410
- var phone = createCommonjsModule(function (module, exports) {
1411
- "use strict";
1412
- Object.defineProperty(exports, "__esModule", { value: true });
1413
-
1414
-
1415
- class Handler {
1416
- toString(data) {
1417
- return typeof data == "string" ? data : "";
1418
- }
1419
- fromString(value) {
1420
- return typeof value == "string" ? value : undefined;
1421
- }
1422
- format(unformated) {
1423
- let result = unformated;
1424
- if (result.value.startsWith("+")) {
1425
- for (const country of phonePrefix.phonePrefix)
1426
- if (result.value.startsWith(country.countryCode))
1427
- for (let prefix of country.areaCodes) {
1428
- prefix = prefix.substring(1);
1429
- if (result.value.startsWith(country.countryCode + prefix) && !result.value.includes("-"))
1430
- result = result
1431
- .insert(country.countryCode.length, "-")
1432
- .insert(country.countryCode.length + 1 + prefix.length, "-");
1433
- }
1434
- }
1435
- else {
1436
- const first = phonePrefix.phonePrefix[0];
1437
- for (const prefix of first.areaCodes)
1438
- if (result.value.startsWith(prefix) && !result.value.includes("-")) {
1439
- result = result.insert(prefix.length, "-");
1440
- result = result.delete(0);
1441
- result = result.insert(0, "-").insert(0, first.countryCode);
1442
- }
1443
- }
1444
- if (result.value.includes("-")) {
1445
- const digitIndex = result.value.indexOf("-", result.value.indexOf("-") + 1) + 1;
1446
- const digitCount = result.value.substring(digitIndex, result.value.length + 1).length;
1447
- switch (digitCount) {
1448
- case 4:
1449
- result = result.insert(digitIndex + 2, " ");
1450
- break;
1451
- case 5:
1452
- result = result.insert(digitIndex + 3, " ");
1453
- break;
1454
- case 6:
1455
- result = result.insert(digitIndex + 2, " ");
1456
- result = result.insert(digitIndex + 5, " ");
1457
- break;
1458
- case 7:
1459
- result = result.insert(digitIndex + 3, " ");
1460
- result = result.insert(digitIndex + 6, " ");
1461
- break;
1462
- case 8:
1463
- case 9:
1464
- result = result.insert(digitIndex + 3, " ");
1465
- result = result.insert(digitIndex + 7, " ");
1466
- break;
1467
- default:
1468
- break;
1469
- }
1470
- if (digitCount > 9) {
1471
- const spaces = Math.ceil(digitCount / 3) - 1;
1472
- if (spaces > 0) {
1473
- for (let i = 0; i < spaces; i++) {
1474
- const position = i * 3 + 3 + i;
1475
- result = result.insert(position + digitIndex, " ");
1476
- }
1477
- }
1478
- }
1479
- }
1480
- return Object.assign(Object.assign({}, result), { type: "text", autocomplete: "tel" });
1481
- }
1482
- unformat(formated) {
1483
- return formated.delete(" ").delete("-");
1484
- }
1485
- allowed(symbol, state) {
1486
- return ((symbol >= "0" && symbol <= "9") || (state.selection.start == 0 && symbol == "+" && !state.value.includes("+")));
1487
- }
1488
- }
1489
- base.add("phone", () => new Handler());
1490
- //# sourceMappingURL=phone.js.map
1491
- });
1492
-
1493
- const phone$1 = /*@__PURE__*/getDefaultExportFromCjs(phone);
1494
-
1495
- var postalCode = createCommonjsModule(function (module, exports) {
1496
- "use strict";
1497
- Object.defineProperty(exports, "__esModule", { value: true });
1498
-
1499
- class Handler {
1500
- constructor(country) {
1501
- this.country = country;
1502
- }
1503
- toString(data) {
1504
- return typeof data == "string" ? data : "";
1505
- }
1506
- fromString(value) {
1507
- return typeof value == "string" ? value : undefined;
1508
- }
1509
- format(unformated) {
1510
- const result = !unformated.value.includes(" ") && unformated.value.length >= 4 ? unformated.insert(3, " ") : unformated;
1511
- return Object.assign(Object.assign({}, result.truncate(6)), { type: "text", autocomplete: "postal-code", length: [6, 6], pattern: /^\d{3} \d{2}$/ });
1512
- }
1513
- unformat(formated) {
1514
- return formated.delete(" ");
1515
- }
1516
- allowed(symbol, state) {
1517
- return state.value.length <= 5 && symbol >= "0" && symbol <= "9";
1518
- }
1519
- }
1520
- base.add("postal-code", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
1521
- //# sourceMappingURL=postal-code.js.map
1522
- });
1523
-
1524
- const postalCode$1 = /*@__PURE__*/getDefaultExportFromCjs(postalCode);
1525
-
1526
- var price = createCommonjsModule(function (module, exports) {
1527
- "use strict";
1528
- Object.defineProperty(exports, "__esModule", { value: true });
1529
-
1530
-
1531
-
1532
- class Handler {
1533
- constructor(currency) {
1534
- this.currency = currency;
1535
- }
1536
- toString(data) {
1537
- return typeof data == "number" ? (isNaN(data) ? "" : data.toString()) : "";
1538
- }
1539
- fromString(value) {
1540
- const result = typeof value == "string" ? Number.parseFloat(value) : undefined;
1541
- return result != undefined && !isNaN(result) ? result : undefined;
1542
- }
1543
- format(unformated) {
1544
- var _a;
1545
- let separator = unformated.value && unformated.value.includes(".") ? unformated.value.indexOf(".") : undefined;
1546
- let result = unformated.value == "NaN" ? unformated.replace(0, unformated.value.length, "") : StateEditor_1.StateEditor.copy(unformated);
1547
- if (separator == 0) {
1548
- result = result.prepend("0");
1549
- separator++;
1550
- }
1551
- if (separator != undefined) {
1552
- const adjust = separator +
1553
- 1 +
1554
- (!this.currency || dist$1.Currency.decimalDigits(this.currency) == undefined
1555
- ? 2
1556
- : (_a = dist$1.Currency.decimalDigits(this.currency)) !== null && _a !== void 0 ? _a : 2) -
1557
- result.value.length;
1558
- result = adjust < 0 ? result.truncate(result.value.length + adjust) : result.suffix("0".repeat(adjust));
1559
- }
1560
- else
1561
- separator = result.value.length;
1562
- const spaces = separator <= 0 ? 0 : Math.ceil(separator / 3) - 1;
1563
- for (let i = 0; i < spaces; i++) {
1564
- const position = separator - (spaces - i) * 3;
1565
- result = result.insert(position, " ");
1566
- separator++;
1567
- }
1568
- if (result.match(/^[0\s]{2,}$/))
1569
- result = result.replace(0, result.value.length, "0");
1570
- else if (result.match(/^[0\s]{2,}(\s\w{3}){1}$/))
1571
- result = result.replace(0, result.value.length - 4, "0");
1572
- result =
1573
- this.currency && (result.value.length > 1 || (result.value.length == 1 && result.value.charAt(0) != "."))
1574
- ? result.suffix(" " + this.currency)
1575
- : result;
1576
- return Object.assign(Object.assign({}, result), { type: "text", length: [3, undefined], pattern: new RegExp("^(\\d{0,3})( \\d{3})*(\\.\\d+)?" + (this.currency ? " " + this.currency : "") + "$") });
1577
- }
1578
- unformat(formated) {
1579
- return this.currency ? formated.delete(" ").delete("" + this.currency) : formated.delete(" ");
1580
- }
1581
- allowed(symbol, state) {
1582
- return (symbol >= "0" && symbol <= "9") || (symbol == "." && !state.value.includes("."));
1583
- }
1584
- }
1585
- base.add("price", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
1586
- //# sourceMappingURL=price.js.map
1587
- });
1588
-
1589
- const price$1 = /*@__PURE__*/getDefaultExportFromCjs(price);
1590
-
1591
- var text = createCommonjsModule(function (module, exports) {
1592
- "use strict";
1593
- Object.defineProperty(exports, "__esModule", { value: true });
1594
-
1595
- class Handler {
1596
- constructor(settings) {
1597
- this.settings = settings;
1598
- }
1599
- toString(data) {
1600
- return typeof data == "string" ? data : "";
1601
- }
1602
- fromString(value) {
1603
- return typeof value == "string" ? value : undefined;
1604
- }
1605
- format(unformated) {
1606
- return Object.assign(Object.assign(Object.assign({}, unformated), { type: "text" }), this.settings);
1607
- }
1608
- unformat(formated) {
1609
- return formated;
1610
- }
1611
- allowed(symbol, state) {
1612
- return (this.settings.length == undefined ||
1613
- this.settings.length[1] == undefined ||
1614
- state.value.length < this.settings.length[1]);
1615
- }
1616
- }
1617
- base.add("text", (settings) => new Handler(settings || {}));
1618
- base.add("email", (settings) => new Handler(settings || {}));
1619
- //# sourceMappingURL=text.js.map
1620
- });
1621
-
1622
- const text$1 = /*@__PURE__*/getDefaultExportFromCjs(text);
1623
-
1624
- var Handler = createCommonjsModule(function (module, exports) {
1625
- "use strict";
1626
- Object.defineProperty(exports, "__esModule", { value: true });
1627
- exports.parse = exports.format = exports.get = void 0;
1628
-
1629
-
1630
-
1631
-
1632
-
1633
-
1634
-
1635
-
1636
-
1637
-
1638
-
1639
-
1640
-
1641
-
1642
- Object.defineProperty(exports, "format", { enumerable: true, get: function () { return base.format; } });
1643
- Object.defineProperty(exports, "get", { enumerable: true, get: function () { return base.get; } });
1644
- Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return base.parse; } });
1645
- //# sourceMappingURL=index.js.map
1646
- });
1647
-
1648
- const index$1 = /*@__PURE__*/getDefaultExportFromCjs(Handler);
1649
-
1650
- var dist = createCommonjsModule(function (module, exports) {
1651
- "use strict";
1652
- Object.defineProperty(exports, "__esModule", { value: true });
1653
- exports.parse = exports.format = exports.get = exports.StateEditor = exports.State = exports.Selection = exports.Action = void 0;
1654
-
1655
- Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Action_1.Action; } });
1656
-
1657
- Object.defineProperty(exports, "format", { enumerable: true, get: function () { return Handler.format; } });
1658
- Object.defineProperty(exports, "get", { enumerable: true, get: function () { return Handler.get; } });
1659
- Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return Handler.parse; } });
1660
-
1661
- Object.defineProperty(exports, "Selection", { enumerable: true, get: function () { return Selection_1.Selection; } });
1662
-
1663
- Object.defineProperty(exports, "State", { enumerable: true, get: function () { return State_1.State; } });
1664
-
1665
- Object.defineProperty(exports, "StateEditor", { enumerable: true, get: function () { return StateEditor_1.StateEditor; } });
1666
- //# sourceMappingURL=index.js.map
1667
- });
1668
-
1669
- const index = /*@__PURE__*/getDefaultExportFromCjs(dist);
1670
-
1671
- export { dist as d };