smoothly 0.1.113 → 0.1.116

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