stone-kit 0.0.875 → 0.0.877

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 (243) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/Router.js +9 -9
  3. package/dist/_virtual/_commonjsHelpers.js +6 -0
  4. package/dist/_virtual/bind.js +4 -0
  5. package/dist/_virtual/index.js +4 -0
  6. package/dist/_virtual/index2.js +4 -0
  7. package/dist/_virtual/index3.js +4 -0
  8. package/dist/_virtual/react-is.development.js +4 -0
  9. package/dist/_virtual/react-is.production.min.js +4 -0
  10. package/dist/components/Button/ui/Button.js +44 -73
  11. package/dist/components/CheckBox/CheckBox.js +35 -46
  12. package/dist/components/CheckBoxNew/CheckBoxNew.js +19 -23
  13. package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +24 -31
  14. package/dist/components/DestinationTab/ui/DestinationTab.js +35 -48
  15. package/dist/components/FieldInput/ui/FieldInput.js +7 -10
  16. package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +61 -5
  17. package/dist/components/FilterWithSave/ui/FilterWithSave.js +266 -7
  18. package/dist/components/Flex/ui/Flex.js +26 -61
  19. package/dist/components/FormModal/ui/ModalForm.js +289 -14
  20. package/dist/components/GroupedInput/ui/GroupedInputs.js +5 -6
  21. package/dist/components/Input/ui/Input.js +74 -3307
  22. package/dist/components/Logo/ui/Logo.js +19 -31
  23. package/dist/components/Logo/ui/Logo.types.js +18 -10
  24. package/dist/components/LotCard/hooks/useLotCard.js +125 -11
  25. package/dist/components/LotCard/index.js +2 -2
  26. package/dist/components/LotCard/ui/LotCard.js +150 -9
  27. package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +31 -58
  28. package/dist/components/MetroLabel/ui/MetroLabel.js +19 -24
  29. package/dist/components/MetroTag/ui/MetroTag.js +59 -72
  30. package/dist/components/Modal/ui/Modal.js +33 -38
  31. package/dist/components/ModalSuccess/ModalSuccess.js +26 -35
  32. package/dist/components/NewIcon/icons/PinTrans.js +3 -3
  33. package/dist/components/NewIcon/icons/SmallFilter.js +1 -1
  34. package/dist/components/NewIcon/ui/NewIcon.js +141 -301
  35. package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +5 -15
  36. package/dist/components/RoundButton/ui/RoundButton.js +42 -60
  37. package/dist/components/Select/ui/Category.js +30 -29
  38. package/dist/components/Select/ui/Option.js +52 -5
  39. package/dist/components/Select/ui/Select.js +24 -23
  40. package/dist/components/SliderNavigation/ui/SliderNavigation.js +27 -28
  41. package/dist/components/SortSelect/hooks/useSortSelect.js +59 -4
  42. package/dist/components/SortSelect/index.js +1 -1
  43. package/dist/components/SortSelect/ui/SortSelect.js +114 -9
  44. package/dist/components/SummarySelect/ui/SummarySelect.js +59 -69
  45. package/dist/components/Switcher/ui/Switcher.js +13 -24
  46. package/dist/components/TabSelect/ui/TabSelect.js +28 -34
  47. package/dist/components/TabSwitcher/index.js +2 -2
  48. package/dist/components/TabSwitcher/ui/TabSwitcher.js +84 -7
  49. package/dist/components/Tag/ui/Tag.js +19 -67
  50. package/dist/components/Text/ui/Text.js +12 -13
  51. package/dist/components/TextArea/TextArea.js +11 -14
  52. package/dist/components/ZoomControls/ui/ZoomControls.js +8 -11
  53. package/dist/components/mobileButton/ui/MobileButton.js +34 -39
  54. package/dist/layout/Layout.js +7 -8
  55. package/dist/layout/components/Header/Header.js +41 -44
  56. package/dist/layout/components/Menu.js +111 -6
  57. package/dist/main.js +46 -42
  58. package/dist/node_modules/@remix-run/router/dist/router.js +431 -0
  59. package/dist/node_modules/classnames/bind.js +42 -0
  60. package/dist/{index-rKuIKazb.js → node_modules/classnames/index.js} +12 -15
  61. package/dist/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +35 -0
  62. package/dist/node_modules/imask/esm/controls/html-input-mask-element.js +31 -0
  63. package/dist/node_modules/imask/esm/controls/html-mask-element.js +48 -0
  64. package/dist/node_modules/imask/esm/controls/input-history.js +30 -0
  65. package/dist/node_modules/imask/esm/controls/input.js +224 -0
  66. package/dist/node_modules/imask/esm/controls/mask-element.js +43 -0
  67. package/dist/node_modules/imask/esm/core/action-details.js +51 -0
  68. package/dist/node_modules/imask/esm/core/change-details.js +36 -0
  69. package/dist/node_modules/imask/esm/core/continuous-tail-details.js +44 -0
  70. package/dist/node_modules/imask/esm/core/holder.js +6 -0
  71. package/dist/node_modules/imask/esm/core/utils.js +80 -0
  72. package/dist/node_modules/imask/esm/index.js +50 -0
  73. package/dist/node_modules/imask/esm/masked/base.js +257 -0
  74. package/dist/node_modules/imask/esm/masked/date.js +118 -0
  75. package/dist/node_modules/imask/esm/masked/dynamic.js +224 -0
  76. package/dist/node_modules/imask/esm/masked/enum.js +70 -0
  77. package/dist/node_modules/imask/esm/masked/factory.js +51 -0
  78. package/dist/node_modules/imask/esm/masked/function.js +23 -0
  79. package/dist/node_modules/imask/esm/masked/number.js +215 -0
  80. package/dist/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +110 -0
  81. package/dist/node_modules/imask/esm/masked/pattern/cursor.js +102 -0
  82. package/dist/node_modules/imask/esm/masked/pattern/fixed-definition.js +103 -0
  83. package/dist/node_modules/imask/esm/masked/pattern/input-definition.js +134 -0
  84. package/dist/node_modules/imask/esm/masked/pattern.js +339 -0
  85. package/dist/node_modules/imask/esm/masked/pipe.js +23 -0
  86. package/dist/node_modules/imask/esm/masked/range.js +82 -0
  87. package/dist/node_modules/imask/esm/masked/regexp.js +21 -0
  88. package/dist/node_modules/imask/esm/masked/repeat.js +106 -0
  89. package/dist/node_modules/object-assign/index.js +55 -0
  90. package/dist/node_modules/prop-types/checkPropTypes.js +55 -0
  91. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +53 -0
  92. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +330 -0
  93. package/dist/node_modules/prop-types/index.js +15 -0
  94. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +11 -0
  95. package/dist/node_modules/prop-types/lib/has.js +7 -0
  96. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +95 -0
  97. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +79 -0
  98. package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
  99. package/dist/node_modules/react-hook-form/dist/index.esm.js +1062 -0
  100. package/dist/node_modules/react-imask/esm/input.js +25 -0
  101. package/dist/node_modules/react-imask/esm/mixin.js +131 -0
  102. package/dist/node_modules/react-router/dist/index.js +486 -0
  103. package/dist/node_modules/react-router-dom/dist/index.js +424 -0
  104. package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +1 -1
  105. package/dist/pages/ButtonsPage/Buttons.js +54 -62
  106. package/dist/pages/CheckboxPage/CheckboxPage.js +47 -51
  107. package/dist/pages/FormsPage/FormsPage.js +31 -32
  108. package/dist/pages/HomePage/HomePage.js +3 -4
  109. package/dist/pages/IconsPage/IconsPage.js +12 -10
  110. package/dist/pages/InputPage/InputPage.js +17 -12
  111. package/dist/pages/LogoPage/LogoPage.js +17 -14
  112. package/dist/pages/LotsPage/LotsPage.js +15 -15
  113. package/dist/pages/ModalsPage/ModalPage.js +19 -14
  114. package/dist/pages/SelectPage/SelectPage.js +42 -41
  115. package/dist/pages/TabsPage/TabsPage.js +49 -51
  116. package/dist/pages/TagsPage/TagsPage.js +10 -7
  117. package/dist/src/components/Button/ui/Button.module.scss.js +49 -0
  118. package/dist/src/components/CheckBox/s.module.scss.js +24 -0
  119. package/dist/src/components/CheckBoxNew/s.module.scss.js +13 -0
  120. package/dist/src/components/CheckboxSelect/ui/s.module.scss.js +19 -0
  121. package/dist/src/components/DestinationTab/ui/DestinationTab.module.scss.js +23 -0
  122. package/dist/src/components/FieldInput/ui/FieldInput.module.scss.js +11 -0
  123. package/dist/src/components/FilterWithSave/ui/s.module.scss.js +39 -0
  124. package/dist/src/components/Flex/ui/Flex.module.scss.js +41 -0
  125. package/dist/src/components/FormModal/ui/ModalForm.module.scss.js +31 -0
  126. package/dist/src/components/GroupedInput/ui/GroupedInputs.module.scss.js +7 -0
  127. package/dist/src/components/Input/ui/Input.module.scss.js +43 -0
  128. package/dist/src/components/Logo/assets/LogoBlack.svg.js +4 -0
  129. package/dist/src/components/Logo/assets/LogoDom.svg.js +4 -0
  130. package/dist/src/components/Logo/assets/LogoNewDom.svg.js +4 -0
  131. package/dist/src/components/Logo/assets/LogoNewOffice.svg.js +4 -0
  132. package/dist/src/components/Logo/assets/LogoOffice.svg.js +4 -0
  133. package/dist/src/components/Logo/assets/LogoRealty.svg.js +4 -0
  134. package/dist/src/components/Logo/assets/LogoValue.svg.js +4 -0
  135. package/dist/src/components/Logo/assets/LogoWhite.svg.js +4 -0
  136. package/dist/src/components/Logo/ui/Logo.module.scss.js +29 -0
  137. package/dist/src/components/LotCard/assets/testLot.webp.js +4 -0
  138. package/dist/src/components/LotCard/ui/LotCard.module.scss.js +71 -0
  139. package/dist/src/components/LotCardSkeleton/ui/LotCardSkeleton.module.scss.js +59 -0
  140. package/dist/src/components/MetroLabel/ui/MetroLabel.module.scss.js +15 -0
  141. package/dist/src/components/MetroTag/ui/MetroTag.module.scss.js +31 -0
  142. package/dist/src/components/Modal/ui/Modal.module.scss.js +15 -0
  143. package/dist/src/components/ModalSuccess/styles.module.scss.js +23 -0
  144. package/dist/src/components/NewIcon/assets/ArrowLong.svg.js +10 -0
  145. package/dist/src/components/NewIcon/assets/ArrowShort.svg.js +10 -0
  146. package/dist/src/components/NewIcon/assets/Auto.svg.js +10 -0
  147. package/dist/src/components/NewIcon/assets/Building.svg.js +10 -0
  148. package/dist/src/components/NewIcon/assets/Burger.svg.js +10 -0
  149. package/dist/src/components/NewIcon/assets/BurgerClose.svg.js +10 -0
  150. package/dist/src/components/NewIcon/assets/Call.svg.js +10 -0
  151. package/dist/src/components/NewIcon/assets/Callback.svg.js +10 -0
  152. package/dist/src/components/NewIcon/assets/Case.svg.js +10 -0
  153. package/dist/src/components/NewIcon/assets/Check.svg.js +10 -0
  154. package/dist/src/components/NewIcon/assets/Circle.svg.js +10 -0
  155. package/dist/src/components/NewIcon/assets/Close.svg.js +10 -0
  156. package/dist/src/components/NewIcon/assets/DirectionDown.svg.js +10 -0
  157. package/dist/src/components/NewIcon/assets/Download.svg.js +10 -0
  158. package/dist/src/components/NewIcon/assets/Filter.svg.js +10 -0
  159. package/dist/src/components/NewIcon/assets/Food.svg.js +10 -0
  160. package/dist/src/components/NewIcon/assets/Fullscreen.svg.js +10 -0
  161. package/dist/src/components/NewIcon/assets/Heart.svg.js +10 -0
  162. package/dist/src/components/NewIcon/assets/Layers.svg.js +10 -0
  163. package/dist/src/components/NewIcon/assets/LayersFilled.svg.js +10 -0
  164. package/dist/src/components/NewIcon/assets/Loader.svg.js +10 -0
  165. package/dist/src/components/NewIcon/assets/Lock.svg.js +10 -0
  166. package/dist/src/components/NewIcon/assets/Metro.svg.js +10 -0
  167. package/dist/src/components/NewIcon/assets/Minus.svg.js +10 -0
  168. package/dist/src/components/NewIcon/assets/MinusCheck.svg.js +10 -0
  169. package/dist/src/components/NewIcon/assets/Moon.svg.js +10 -0
  170. package/dist/src/components/NewIcon/assets/Park.svg.js +10 -0
  171. package/dist/src/components/NewIcon/assets/Pedestrian.svg.js +10 -0
  172. package/dist/src/components/NewIcon/assets/Phone.svg.js +10 -0
  173. package/dist/src/components/NewIcon/assets/PhoneFilled.svg.js +10 -0
  174. package/dist/src/components/NewIcon/assets/Pin.svg.js +10 -0
  175. package/dist/{PinTrans-D6OZq76b.js → src/components/NewIcon/assets/PinTrans.svg.js} +4 -4
  176. package/dist/src/components/NewIcon/assets/Play.svg.js +10 -0
  177. package/dist/src/components/NewIcon/assets/Play2.svg.js +10 -0
  178. package/dist/src/components/NewIcon/assets/Plus.svg.js +10 -0
  179. package/dist/src/components/NewIcon/assets/Redo.svg.js +10 -0
  180. package/dist/src/components/NewIcon/assets/Ruble.svg.js +10 -0
  181. package/dist/src/components/NewIcon/assets/Search.svg.js +10 -0
  182. package/dist/src/components/NewIcon/assets/SelectChecked.svg.js +10 -0
  183. package/dist/src/components/NewIcon/assets/SelectUnchecked.svg.js +10 -0
  184. package/dist/src/components/NewIcon/assets/Share.svg.js +10 -0
  185. package/dist/{SmallFilter-C-VKnbkP.js → src/components/NewIcon/assets/SmallFilter.svg.js} +3 -3
  186. package/dist/src/components/NewIcon/assets/Sport.svg.js +10 -0
  187. package/dist/src/components/NewIcon/assets/SquareMeter.svg.js +10 -0
  188. package/dist/src/components/NewIcon/assets/Star.svg.js +10 -0
  189. package/dist/src/components/NewIcon/assets/StarFilled.svg.js +10 -0
  190. package/dist/src/components/NewIcon/assets/Sun.svg.js +10 -0
  191. package/dist/src/components/NewIcon/assets/Telegram.svg.js +10 -0
  192. package/dist/src/components/NewIcon/assets/Timer.svg.js +10 -0
  193. package/dist/src/components/NewIcon/assets/TwoArrows.svg.js +10 -0
  194. package/dist/src/components/NewIcon/assets/User.svg.js +10 -0
  195. package/dist/src/components/NewIcon/assets/WhatsApp.svg.js +10 -0
  196. package/dist/src/components/NewIcon/assets/WithoutDecor.svg.js +10 -0
  197. package/dist/src/components/NewIcon/assets/arrowRight.svg.js +10 -0
  198. package/dist/src/components/NewIcon/assets/mail.svg.js +10 -0
  199. package/dist/src/components/NewIcon/ui/NewIcon.module.scss.js +4 -0
  200. package/dist/src/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.module.scss.js +25 -0
  201. package/dist/src/components/RoundButton/ui/RoundButton.module.scss.js +29 -0
  202. package/dist/src/components/Select/ui/Select.module.scss.js +52 -0
  203. package/dist/src/components/SliderNavigation/ui/SliderNavigation.module.scss.js +7 -0
  204. package/dist/src/components/SortSelect/ui/SortSelect.module.scss.js +41 -0
  205. package/dist/src/components/SummarySelect/ui/SummarySelect.module.scss.js +25 -0
  206. package/dist/src/components/Switcher/ui/Switcher.module.scss.js +27 -0
  207. package/dist/src/components/TabSelect/ui/TabSelect.module.scss.js +17 -0
  208. package/dist/src/components/TabSwitcher/ui/TabSwitcher.module.scss.js +57 -0
  209. package/dist/src/components/Tag/ui/Tag.module.scss.js +70 -0
  210. package/dist/src/components/Text/ui/Text.module.scss.js +7 -0
  211. package/dist/src/components/TextArea/styles.module.scss.js +9 -0
  212. package/dist/src/components/ZoomControls/ui/ZoomControls.module.scss.js +11 -0
  213. package/dist/src/components/mobileButton/ui/MobileButton.module.scss.js +12 -0
  214. package/dist/src/layout/components/Header/s.module.scss.js +19 -0
  215. package/dist/src/layout/components/Menu.module.scss.js +9 -0
  216. package/dist/src/layout/style.module.scss.js +7 -0
  217. package/dist/src/pages/ButtonsPage/ButtonState/ButtonState.js +18 -0
  218. package/dist/{ButtonState.module-DtW3aevR.js → src/pages/ButtonsPage/ButtonState/ButtonState.module.scss.js} +4 -1
  219. package/dist/src/pages/ButtonsPage/ButtonsPage.module.scss.js +9 -0
  220. package/dist/src/pages/CheckboxPage/CheckboxPage.module.scss.js +13 -0
  221. package/dist/src/pages/FormsPage/FormsPage.module.scss.js +15 -0
  222. package/dist/src/pages/HomePage/HomePage.module.scss.js +7 -0
  223. package/dist/src/pages/IconsPage/IconsPage.module.scss.js +9 -0
  224. package/dist/src/pages/InputPage/InputPage.module.scss.js +4 -0
  225. package/dist/src/pages/LogoPage/LogoPage.module.scss.js +7 -0
  226. package/dist/src/pages/LotsPage/LotsPage.module.scss.js +13 -0
  227. package/dist/src/pages/ModalsPage/ModalPage.module.scss.js +4 -0
  228. package/dist/src/pages/SelectPage/SelectPage.module.scss.js +11 -0
  229. package/dist/src/pages/TabsPage/TabsPage.module.scss.js +17 -0
  230. package/dist/src/pages/TagsPage/TagsPage.module.scss.js +7 -0
  231. package/dist/src/stories/button.css.js +1 -0
  232. package/dist/src/stories/header.css.js +1 -0
  233. package/dist/src/stories/page.css.js +1 -0
  234. package/dist/stories/Button.js +24 -0
  235. package/dist/stories/Header.js +45 -0
  236. package/dist/stories/Page.js +59 -0
  237. package/dist/style.css +1 -1
  238. package/package.json +11 -6
  239. package/dist/FilterWithSave-Bp6rH8Pe.js +0 -2230
  240. package/dist/Menu-CgCfinVZ.js +0 -513
  241. package/dist/Option-BVIm7wOW.js +0 -83
  242. package/dist/index-DmANy9jd.js +0 -890
  243. package/dist/useSortSelect-CjZXLFOG.js +0 -80
@@ -0,0 +1,134 @@
1
+ import D from "../factory.js";
2
+ import t from "../../core/change-details.js";
3
+ import { DIRECTION as i } from "../../core/utils.js";
4
+ class E {
5
+ /** */
6
+ /** */
7
+ /** */
8
+ /** */
9
+ /** */
10
+ /** */
11
+ /** */
12
+ /** */
13
+ constructor(u) {
14
+ const {
15
+ parent: A,
16
+ isOptional: e,
17
+ placeholderChar: F,
18
+ displayChar: B,
19
+ lazy: C,
20
+ eager: a,
21
+ ...s
22
+ } = u;
23
+ this.masked = D(s), Object.assign(this, {
24
+ parent: A,
25
+ isOptional: e,
26
+ placeholderChar: F,
27
+ displayChar: B,
28
+ lazy: C,
29
+ eager: a
30
+ });
31
+ }
32
+ reset() {
33
+ this.isFilled = !1, this.masked.reset();
34
+ }
35
+ remove(u, A) {
36
+ return u === void 0 && (u = 0), A === void 0 && (A = this.value.length), u === 0 && A >= 1 ? (this.isFilled = !1, this.masked.remove(u, A)) : new t();
37
+ }
38
+ get value() {
39
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
40
+ }
41
+ get unmaskedValue() {
42
+ return this.masked.unmaskedValue;
43
+ }
44
+ get rawInputValue() {
45
+ return this.masked.rawInputValue;
46
+ }
47
+ get displayValue() {
48
+ return this.masked.value && this.displayChar || this.value;
49
+ }
50
+ get isComplete() {
51
+ return !!this.masked.value || this.isOptional;
52
+ }
53
+ _appendChar(u, A) {
54
+ if (A === void 0 && (A = {}), this.isFilled)
55
+ return new t();
56
+ const e = this.masked.state;
57
+ let F = this.masked._appendChar(u, this.currentMaskFlags(A));
58
+ return F.inserted && this.doValidate(A) === !1 && (F = new t(), this.masked.state = e), !F.inserted && !this.isOptional && !this.lazy && !A.input && (F.inserted = this.placeholderChar), F.skip = !F.inserted && !this.isOptional, this.isFilled = !!F.inserted, F;
59
+ }
60
+ append(u, A, e) {
61
+ return this.masked.append(u, this.currentMaskFlags(A), e);
62
+ }
63
+ _appendPlaceholder() {
64
+ return this.isFilled || this.isOptional ? new t() : (this.isFilled = !0, new t({
65
+ inserted: this.placeholderChar
66
+ }));
67
+ }
68
+ _appendEager() {
69
+ return new t();
70
+ }
71
+ extractTail(u, A) {
72
+ return this.masked.extractTail(u, A);
73
+ }
74
+ appendTail(u) {
75
+ return this.masked.appendTail(u);
76
+ }
77
+ extractInput(u, A, e) {
78
+ return u === void 0 && (u = 0), A === void 0 && (A = this.value.length), this.masked.extractInput(u, A, e);
79
+ }
80
+ nearestInputPos(u, A) {
81
+ A === void 0 && (A = i.NONE);
82
+ const e = 0, F = this.value.length, B = Math.min(Math.max(u, e), F);
83
+ switch (A) {
84
+ case i.LEFT:
85
+ case i.FORCE_LEFT:
86
+ return this.isComplete ? B : e;
87
+ case i.RIGHT:
88
+ case i.FORCE_RIGHT:
89
+ return this.isComplete ? B : F;
90
+ case i.NONE:
91
+ default:
92
+ return B;
93
+ }
94
+ }
95
+ totalInputPositions(u, A) {
96
+ return u === void 0 && (u = 0), A === void 0 && (A = this.value.length), this.value.slice(u, A).length;
97
+ }
98
+ doValidate(u) {
99
+ return this.masked.doValidate(this.currentMaskFlags(u)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(u)));
100
+ }
101
+ doCommit() {
102
+ this.masked.doCommit();
103
+ }
104
+ get state() {
105
+ return {
106
+ _value: this.value,
107
+ _rawInputValue: this.rawInputValue,
108
+ masked: this.masked.state,
109
+ isFilled: this.isFilled
110
+ };
111
+ }
112
+ set state(u) {
113
+ this.masked.state = u.masked, this.isFilled = u.isFilled;
114
+ }
115
+ currentMaskFlags(u) {
116
+ var A;
117
+ return {
118
+ ...u,
119
+ _beforeTailState: (u == null || (A = u._beforeTailState) == null ? void 0 : A.masked) || (u == null ? void 0 : u._beforeTailState)
120
+ };
121
+ }
122
+ pad(u) {
123
+ return new t();
124
+ }
125
+ }
126
+ E.DEFAULT_DEFINITIONS = {
127
+ 0: /\d/,
128
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
129
+ // http://stackoverflow.com/a/22075070
130
+ "*": /./
131
+ };
132
+ export {
133
+ E as default
134
+ };
@@ -0,0 +1,339 @@
1
+ import k from "../core/change-details.js";
2
+ import x from "../core/holder.js";
3
+ import { DIRECTION as r } from "../core/utils.js";
4
+ import y from "./base.js";
5
+ import T, { normalizeOpts as b } from "./factory.js";
6
+ import m from "./pattern/chunk-tail-details.js";
7
+ import I from "./pattern/cursor.js";
8
+ import C from "./pattern/fixed-definition.js";
9
+ import _ from "./pattern/input-definition.js";
10
+ import "./regexp.js";
11
+ class h extends y {
12
+ /** */
13
+ /** */
14
+ /** Single char for empty input */
15
+ /** Single char for filled input */
16
+ /** Show placeholder only when needed */
17
+ /** Enable characters overwriting */
18
+ /** */
19
+ /** */
20
+ /** */
21
+ constructor(e) {
22
+ super({
23
+ ...h.DEFAULTS,
24
+ ...e,
25
+ definitions: Object.assign({}, _.DEFAULT_DEFINITIONS, e == null ? void 0 : e.definitions)
26
+ });
27
+ }
28
+ updateOptions(e) {
29
+ super.updateOptions(e);
30
+ }
31
+ _update(e) {
32
+ e.definitions = Object.assign({}, this.definitions, e.definitions), super._update(e), this._rebuildMask();
33
+ }
34
+ _rebuildMask() {
35
+ const e = this.definitions;
36
+ this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
37
+ const s = this.mask;
38
+ if (!s || !e)
39
+ return;
40
+ let t = !1, l = !1;
41
+ for (let i = 0; i < s.length; ++i) {
42
+ if (this.blocks) {
43
+ const p = s.slice(i), g = Object.keys(this.blocks).filter((u) => p.indexOf(u) === 0);
44
+ g.sort((u, d) => d.length - u.length);
45
+ const c = g[0];
46
+ if (c) {
47
+ const {
48
+ expose: u,
49
+ repeat: d,
50
+ ...E
51
+ } = b(this.blocks[c]), B = {
52
+ lazy: this.lazy,
53
+ eager: this.eager,
54
+ placeholderChar: this.placeholderChar,
55
+ displayChar: this.displayChar,
56
+ overwrite: this.overwrite,
57
+ autofix: this.autofix,
58
+ ...E,
59
+ repeat: d,
60
+ parent: this
61
+ }, f = d != null ? new x.RepeatBlock(
62
+ B
63
+ /* TODO */
64
+ ) : T(B);
65
+ f && (this._blocks.push(f), u && (this.exposeBlock = f), this._maskedBlocks[c] || (this._maskedBlocks[c] = []), this._maskedBlocks[c].push(this._blocks.length - 1)), i += c.length - 1;
66
+ continue;
67
+ }
68
+ }
69
+ let o = s[i], a = o in e;
70
+ if (o === h.STOP_CHAR) {
71
+ this._stops.push(this._blocks.length);
72
+ continue;
73
+ }
74
+ if (o === "{" || o === "}") {
75
+ t = !t;
76
+ continue;
77
+ }
78
+ if (o === "[" || o === "]") {
79
+ l = !l;
80
+ continue;
81
+ }
82
+ if (o === h.ESCAPE_CHAR) {
83
+ if (++i, o = s[i], !o)
84
+ break;
85
+ a = !1;
86
+ }
87
+ const n = a ? new _({
88
+ isOptional: l,
89
+ lazy: this.lazy,
90
+ eager: this.eager,
91
+ placeholderChar: this.placeholderChar,
92
+ displayChar: this.displayChar,
93
+ ...b(e[o]),
94
+ parent: this
95
+ }) : new C({
96
+ char: o,
97
+ eager: this.eager,
98
+ isUnmasking: t
99
+ });
100
+ this._blocks.push(n);
101
+ }
102
+ }
103
+ get state() {
104
+ return {
105
+ ...super.state,
106
+ _blocks: this._blocks.map((e) => e.state)
107
+ };
108
+ }
109
+ set state(e) {
110
+ if (!e) {
111
+ this.reset();
112
+ return;
113
+ }
114
+ const {
115
+ _blocks: s,
116
+ ...t
117
+ } = e;
118
+ this._blocks.forEach((l, i) => l.state = s[i]), super.state = t;
119
+ }
120
+ reset() {
121
+ super.reset(), this._blocks.forEach((e) => e.reset());
122
+ }
123
+ get isComplete() {
124
+ return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((e) => e.isComplete);
125
+ }
126
+ get isFilled() {
127
+ return this._blocks.every((e) => e.isFilled);
128
+ }
129
+ get isFixed() {
130
+ return this._blocks.every((e) => e.isFixed);
131
+ }
132
+ get isOptional() {
133
+ return this._blocks.every((e) => e.isOptional);
134
+ }
135
+ doCommit() {
136
+ this._blocks.forEach((e) => e.doCommit()), super.doCommit();
137
+ }
138
+ get unmaskedValue() {
139
+ return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((e, s) => e += s.unmaskedValue, "");
140
+ }
141
+ set unmaskedValue(e) {
142
+ if (this.exposeBlock) {
143
+ const s = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
144
+ this.exposeBlock.unmaskedValue = e, this.appendTail(s), this.doCommit();
145
+ } else
146
+ super.unmaskedValue = e;
147
+ }
148
+ get value() {
149
+ return this.exposeBlock ? this.exposeBlock.value : (
150
+ // TODO return _value when not in change?
151
+ this._blocks.reduce((e, s) => e += s.value, "")
152
+ );
153
+ }
154
+ set value(e) {
155
+ if (this.exposeBlock) {
156
+ const s = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
157
+ this.exposeBlock.value = e, this.appendTail(s), this.doCommit();
158
+ } else
159
+ super.value = e;
160
+ }
161
+ get typedValue() {
162
+ return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
163
+ }
164
+ set typedValue(e) {
165
+ if (this.exposeBlock) {
166
+ const s = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
167
+ this.exposeBlock.typedValue = e, this.appendTail(s), this.doCommit();
168
+ } else
169
+ super.typedValue = e;
170
+ }
171
+ get displayValue() {
172
+ return this._blocks.reduce((e, s) => e += s.displayValue, "");
173
+ }
174
+ appendTail(e) {
175
+ return super.appendTail(e).aggregate(this._appendPlaceholder());
176
+ }
177
+ _appendEager() {
178
+ var e;
179
+ const s = new k();
180
+ let t = (e = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : e.index;
181
+ if (t == null)
182
+ return s;
183
+ this._blocks[t].isFilled && ++t;
184
+ for (let l = t; l < this._blocks.length; ++l) {
185
+ const i = this._blocks[l]._appendEager();
186
+ if (!i.inserted)
187
+ break;
188
+ s.aggregate(i);
189
+ }
190
+ return s;
191
+ }
192
+ _appendCharRaw(e, s) {
193
+ s === void 0 && (s = {});
194
+ const t = this._mapPosToBlock(this.displayValue.length), l = new k();
195
+ if (!t)
196
+ return l;
197
+ for (let o = t.index, a; a = this._blocks[o]; ++o) {
198
+ var i;
199
+ const n = a._appendChar(e, {
200
+ ...s,
201
+ _beforeTailState: (i = s._beforeTailState) == null || (i = i._blocks) == null ? void 0 : i[o]
202
+ });
203
+ if (l.aggregate(n), n.consumed)
204
+ break;
205
+ }
206
+ return l;
207
+ }
208
+ extractTail(e, s) {
209
+ e === void 0 && (e = 0), s === void 0 && (s = this.displayValue.length);
210
+ const t = new m();
211
+ return e === s || this._forEachBlocksInRange(e, s, (l, i, o, a) => {
212
+ const n = l.extractTail(o, a);
213
+ n.stop = this._findStopBefore(i), n.from = this._blockStartPos(i), n instanceof m && (n.blockIndex = i), t.extend(n);
214
+ }), t;
215
+ }
216
+ extractInput(e, s, t) {
217
+ if (e === void 0 && (e = 0), s === void 0 && (s = this.displayValue.length), t === void 0 && (t = {}), e === s)
218
+ return "";
219
+ let l = "";
220
+ return this._forEachBlocksInRange(e, s, (i, o, a, n) => {
221
+ l += i.extractInput(a, n, t);
222
+ }), l;
223
+ }
224
+ _findStopBefore(e) {
225
+ let s;
226
+ for (let t = 0; t < this._stops.length; ++t) {
227
+ const l = this._stops[t];
228
+ if (l <= e)
229
+ s = l;
230
+ else
231
+ break;
232
+ }
233
+ return s;
234
+ }
235
+ /** Appends placeholder depending on laziness */
236
+ _appendPlaceholder(e) {
237
+ const s = new k();
238
+ if (this.lazy && e == null)
239
+ return s;
240
+ const t = this._mapPosToBlock(this.displayValue.length);
241
+ if (!t)
242
+ return s;
243
+ const l = t.index, i = e ?? this._blocks.length;
244
+ return this._blocks.slice(l, i).forEach((o) => {
245
+ if (!o.lazy || e != null) {
246
+ var a;
247
+ s.aggregate(o._appendPlaceholder((a = o._blocks) == null ? void 0 : a.length));
248
+ }
249
+ }), s;
250
+ }
251
+ /** Finds block in pos */
252
+ _mapPosToBlock(e) {
253
+ let s = "";
254
+ for (let t = 0; t < this._blocks.length; ++t) {
255
+ const l = this._blocks[t], i = s.length;
256
+ if (s += l.displayValue, e <= s.length)
257
+ return {
258
+ index: t,
259
+ offset: e - i
260
+ };
261
+ }
262
+ }
263
+ _blockStartPos(e) {
264
+ return this._blocks.slice(0, e).reduce((s, t) => s += t.displayValue.length, 0);
265
+ }
266
+ _forEachBlocksInRange(e, s, t) {
267
+ s === void 0 && (s = this.displayValue.length);
268
+ const l = this._mapPosToBlock(e);
269
+ if (l) {
270
+ const i = this._mapPosToBlock(s), o = i && l.index === i.index, a = l.offset, n = i && o ? i.offset : this._blocks[l.index].displayValue.length;
271
+ if (t(this._blocks[l.index], l.index, a, n), i && !o) {
272
+ for (let p = l.index + 1; p < i.index; ++p)
273
+ t(this._blocks[p], p, 0, this._blocks[p].displayValue.length);
274
+ t(this._blocks[i.index], i.index, 0, i.offset);
275
+ }
276
+ }
277
+ }
278
+ remove(e, s) {
279
+ e === void 0 && (e = 0), s === void 0 && (s = this.displayValue.length);
280
+ const t = super.remove(e, s);
281
+ return this._forEachBlocksInRange(e, s, (l, i, o, a) => {
282
+ t.aggregate(l.remove(o, a));
283
+ }), t;
284
+ }
285
+ nearestInputPos(e, s) {
286
+ if (s === void 0 && (s = r.NONE), !this._blocks.length)
287
+ return 0;
288
+ const t = new I(this, e);
289
+ if (s === r.NONE)
290
+ return t.pushRightBeforeInput() || (t.popState(), t.pushLeftBeforeInput()) ? t.pos : this.displayValue.length;
291
+ if (s === r.LEFT || s === r.FORCE_LEFT) {
292
+ if (s === r.LEFT) {
293
+ if (t.pushRightBeforeFilled(), t.ok && t.pos === e)
294
+ return e;
295
+ t.popState();
296
+ }
297
+ if (t.pushLeftBeforeInput(), t.pushLeftBeforeRequired(), t.pushLeftBeforeFilled(), s === r.LEFT) {
298
+ if (t.pushRightBeforeInput(), t.pushRightBeforeRequired(), t.ok && t.pos <= e || (t.popState(), t.ok && t.pos <= e))
299
+ return t.pos;
300
+ t.popState();
301
+ }
302
+ return t.ok ? t.pos : s === r.FORCE_LEFT ? 0 : (t.popState(), t.ok || (t.popState(), t.ok) ? t.pos : 0);
303
+ }
304
+ return s === r.RIGHT || s === r.FORCE_RIGHT ? (t.pushRightBeforeInput(), t.pushRightBeforeRequired(), t.pushRightBeforeFilled() ? t.pos : s === r.FORCE_RIGHT ? this.displayValue.length : (t.popState(), t.ok || (t.popState(), t.ok) ? t.pos : this.nearestInputPos(e, r.LEFT))) : e;
305
+ }
306
+ totalInputPositions(e, s) {
307
+ e === void 0 && (e = 0), s === void 0 && (s = this.displayValue.length);
308
+ let t = 0;
309
+ return this._forEachBlocksInRange(e, s, (l, i, o, a) => {
310
+ t += l.totalInputPositions(o, a);
311
+ }), t;
312
+ }
313
+ /** Get block by name */
314
+ maskedBlock(e) {
315
+ return this.maskedBlocks(e)[0];
316
+ }
317
+ /** Get all blocks by name */
318
+ maskedBlocks(e) {
319
+ const s = this._maskedBlocks[e];
320
+ return s ? s.map((t) => this._blocks[t]) : [];
321
+ }
322
+ pad(e) {
323
+ const s = new k();
324
+ return this._forEachBlocksInRange(0, this.displayValue.length, (t) => s.aggregate(t.pad(e))), s;
325
+ }
326
+ }
327
+ h.DEFAULTS = {
328
+ ...y.DEFAULTS,
329
+ lazy: !0,
330
+ placeholderChar: "_"
331
+ };
332
+ h.STOP_CHAR = "`";
333
+ h.ESCAPE_CHAR = "\\";
334
+ h.InputDefinition = _;
335
+ h.FixedDefinition = C;
336
+ x.MaskedPattern = h;
337
+ export {
338
+ h as default
339
+ };
@@ -0,0 +1,23 @@
1
+ import P from "./factory.js";
2
+ import n from "../core/holder.js";
3
+ const a = {
4
+ MASKED: "value",
5
+ UNMASKED: "unmaskedValue",
6
+ TYPED: "typedValue"
7
+ };
8
+ function u(t, e, r) {
9
+ e === void 0 && (e = a.MASKED), r === void 0 && (r = a.MASKED);
10
+ const i = P(t);
11
+ return (E) => i.runIsolated((p) => (p[e] = E, p[r]));
12
+ }
13
+ function o(t, e, r, i) {
14
+ return u(e, r, i)(t);
15
+ }
16
+ n.PIPE_TYPE = a;
17
+ n.createPipe = u;
18
+ n.pipe = o;
19
+ export {
20
+ a as PIPE_TYPE,
21
+ u as createPipe,
22
+ o as pipe
23
+ };
@@ -0,0 +1,82 @@
1
+ import p from "../core/change-details.js";
2
+ import u from "../core/holder.js";
3
+ import m from "./pattern.js";
4
+ import "./base.js";
5
+ import "./factory.js";
6
+ import "./pattern/input-definition.js";
7
+ import "./regexp.js";
8
+ class d extends m {
9
+ /**
10
+ Optionally sets max length of pattern.
11
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
12
+ */
13
+ /** Min bound */
14
+ /** Max bound */
15
+ get _matchFrom() {
16
+ return this.maxLength - String(this.from).length;
17
+ }
18
+ constructor(e) {
19
+ super(e);
20
+ }
21
+ updateOptions(e) {
22
+ super.updateOptions(e);
23
+ }
24
+ _update(e) {
25
+ const {
26
+ to: t = this.to || 0,
27
+ from: r = this.from || 0,
28
+ maxLength: i = this.maxLength || 0,
29
+ autofix: a = this.autofix,
30
+ ...h
31
+ } = e;
32
+ this.to = t, this.from = r, this.maxLength = Math.max(String(t).length, i), this.autofix = a;
33
+ const o = String(this.from).padStart(this.maxLength, "0"), n = String(this.to).padStart(this.maxLength, "0");
34
+ let s = 0;
35
+ for (; s < n.length && n[s] === o[s]; )
36
+ ++s;
37
+ h.mask = n.slice(0, s).replace(/0/g, "\\0") + "0".repeat(this.maxLength - s), super._update(h);
38
+ }
39
+ get isComplete() {
40
+ return super.isComplete && !!this.value;
41
+ }
42
+ boundaries(e) {
43
+ let t = "", r = "";
44
+ const [, i, a] = e.match(/^(\D*)(\d*)(\D*)/) || [];
45
+ return a && (t = "0".repeat(i.length) + a, r = "9".repeat(i.length) + a), t = t.padEnd(this.maxLength, "0"), r = r.padEnd(this.maxLength, "9"), [t, r];
46
+ }
47
+ doPrepareChar(e, t) {
48
+ t === void 0 && (t = {});
49
+ let r;
50
+ return [e, r] = super.doPrepareChar(e.replace(/\D/g, ""), t), e || (r.skip = !this.isComplete), [e, r];
51
+ }
52
+ _appendCharRaw(e, t) {
53
+ if (t === void 0 && (t = {}), !this.autofix || this.value.length + 1 > this.maxLength)
54
+ return super._appendCharRaw(e, t);
55
+ const r = String(this.from).padStart(this.maxLength, "0"), i = String(this.to).padStart(this.maxLength, "0"), [a, h] = this.boundaries(this.value + e);
56
+ return Number(h) < this.from ? super._appendCharRaw(r[this.value.length], t) : Number(a) > this.to ? !t.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(r[this.value.length], t).aggregate(this._appendCharRaw(e, t)) : super._appendCharRaw(i[this.value.length], t) : super._appendCharRaw(e, t);
57
+ }
58
+ doValidate(e) {
59
+ const t = this.value;
60
+ if (t.search(/[^0]/) === -1 && t.length <= this._matchFrom)
61
+ return !0;
62
+ const [i, a] = this.boundaries(t);
63
+ return this.from <= Number(a) && Number(i) <= this.to && super.doValidate(e);
64
+ }
65
+ pad(e) {
66
+ const t = new p();
67
+ if (this.value.length === this.maxLength)
68
+ return t;
69
+ const r = this.value, i = this.maxLength - this.value.length;
70
+ if (i) {
71
+ this.reset();
72
+ for (let a = 0; a < i; ++a)
73
+ t.aggregate(super._appendCharRaw("0", e));
74
+ r.split("").forEach((a) => this._appendCharRaw(a));
75
+ }
76
+ return t;
77
+ }
78
+ }
79
+ u.MaskedRange = d;
80
+ export {
81
+ d as default
82
+ };
@@ -0,0 +1,21 @@
1
+ import p from "./base.js";
2
+ import t from "../core/holder.js";
3
+ import "../core/change-details.js";
4
+ class d extends p {
5
+ /** */
6
+ /** Enable characters overwriting */
7
+ /** */
8
+ /** */
9
+ /** */
10
+ updateOptions(e) {
11
+ super.updateOptions(e);
12
+ }
13
+ _update(e) {
14
+ const a = e.mask;
15
+ a && (e.validate = (s) => s.search(a) >= 0), super._update(e);
16
+ }
17
+ }
18
+ t.MaskedRegExp = d;
19
+ export {
20
+ d as default
21
+ };