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