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