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,257 @@
1
+ import h from "../core/change-details.js";
2
+ import f from "../core/continuous-tail-details.js";
3
+ import { isString as v, DIRECTION as o, objectIncludes as V, forceDirection as I } from "../core/utils.js";
4
+ import _ from "../core/holder.js";
5
+ class p {
6
+ /** */
7
+ /** */
8
+ /** Transforms value before mask processing */
9
+ /** Transforms each char before mask processing */
10
+ /** Validates if value is acceptable */
11
+ /** Does additional processing at the end of editing */
12
+ /** Format typed value to string */
13
+ /** Parse string to get typed value */
14
+ /** Enable characters overwriting */
15
+ /** */
16
+ /** */
17
+ /** */
18
+ /** */
19
+ constructor(t) {
20
+ this._value = "", this._update({
21
+ ...p.DEFAULTS,
22
+ ...t
23
+ }), this._initialized = !0;
24
+ }
25
+ /** Sets and applies new options */
26
+ updateOptions(t) {
27
+ this.optionsIsChanged(t) && this.withValueRefresh(this._update.bind(this, t));
28
+ }
29
+ /** Sets new options */
30
+ _update(t) {
31
+ Object.assign(this, t);
32
+ }
33
+ /** Mask state */
34
+ get state() {
35
+ return {
36
+ _value: this.value,
37
+ _rawInputValue: this.rawInputValue
38
+ };
39
+ }
40
+ set state(t) {
41
+ this._value = t._value;
42
+ }
43
+ /** Resets value */
44
+ reset() {
45
+ this._value = "";
46
+ }
47
+ get value() {
48
+ return this._value;
49
+ }
50
+ set value(t) {
51
+ this.resolve(t, {
52
+ input: !0
53
+ });
54
+ }
55
+ /** Resolve new value */
56
+ resolve(t, e) {
57
+ e === void 0 && (e = {
58
+ input: !0
59
+ }), this.reset(), this.append(t, e, ""), this.doCommit();
60
+ }
61
+ get unmaskedValue() {
62
+ return this.value;
63
+ }
64
+ set unmaskedValue(t) {
65
+ this.resolve(t, {});
66
+ }
67
+ get typedValue() {
68
+ return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
69
+ }
70
+ set typedValue(t) {
71
+ this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
72
+ }
73
+ /** Value that includes raw user input */
74
+ get rawInputValue() {
75
+ return this.extractInput(0, this.displayValue.length, {
76
+ raw: !0
77
+ });
78
+ }
79
+ set rawInputValue(t) {
80
+ this.resolve(t, {
81
+ raw: !0
82
+ });
83
+ }
84
+ get displayValue() {
85
+ return this.value;
86
+ }
87
+ get isComplete() {
88
+ return !0;
89
+ }
90
+ get isFilled() {
91
+ return this.isComplete;
92
+ }
93
+ /** Finds nearest input position in direction */
94
+ nearestInputPos(t, e) {
95
+ return t;
96
+ }
97
+ totalInputPositions(t, e) {
98
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
99
+ }
100
+ /** Extracts value in range considering flags */
101
+ extractInput(t, e, i) {
102
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
103
+ }
104
+ /** Extracts tail in range */
105
+ extractTail(t, e) {
106
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new f(this.extractInput(t, e), t);
107
+ }
108
+ /** Appends tail */
109
+ appendTail(t) {
110
+ return v(t) && (t = new f(String(t))), t.appendTo(this);
111
+ }
112
+ /** Appends char */
113
+ _appendCharRaw(t, e) {
114
+ return t ? (this._value += t, new h({
115
+ inserted: t,
116
+ rawInserted: t
117
+ })) : new h();
118
+ }
119
+ /** Appends char */
120
+ _appendChar(t, e, i) {
121
+ e === void 0 && (e = {});
122
+ const s = this.state;
123
+ let a;
124
+ if ([t, a] = this.doPrepareChar(t, e), t && (a = a.aggregate(this._appendCharRaw(t, e)), !a.rawInserted && this.autofix === "pad")) {
125
+ const n = this.state;
126
+ this.state = s;
127
+ let r = this.pad(e);
128
+ const l = this._appendCharRaw(t, e);
129
+ r = r.aggregate(l), l.rawInserted || r.equals(a) ? a = r : this.state = n;
130
+ }
131
+ if (a.inserted) {
132
+ let n, r = this.doValidate(e) !== !1;
133
+ if (r && i != null) {
134
+ const l = this.state;
135
+ if (this.overwrite === !0) {
136
+ n = i.state;
137
+ for (let d = 0; d < a.rawInserted.length; ++d)
138
+ i.unshift(this.displayValue.length - a.tailShift);
139
+ }
140
+ let u = this.appendTail(i);
141
+ if (r = u.rawInserted.length === i.toString().length, !(r && u.inserted) && this.overwrite === "shift") {
142
+ this.state = l, n = i.state;
143
+ for (let d = 0; d < a.rawInserted.length; ++d)
144
+ i.shift();
145
+ u = this.appendTail(i), r = u.rawInserted.length === i.toString().length;
146
+ }
147
+ r && u.inserted && (this.state = l);
148
+ }
149
+ r || (a = new h(), this.state = s, i && n && (i.state = n));
150
+ }
151
+ return a;
152
+ }
153
+ /** Appends optional placeholder at the end */
154
+ _appendPlaceholder() {
155
+ return new h();
156
+ }
157
+ /** Appends optional eager placeholder at the end */
158
+ _appendEager() {
159
+ return new h();
160
+ }
161
+ /** Appends symbols considering flags */
162
+ append(t, e, i) {
163
+ if (!v(t))
164
+ throw new Error("value should be string");
165
+ const s = v(i) ? new f(String(i)) : i;
166
+ e != null && e.tail && (e._beforeTailState = this.state);
167
+ let a;
168
+ [t, a] = this.doPrepare(t, e);
169
+ for (let n = 0; n < t.length; ++n) {
170
+ const r = this._appendChar(t[n], e, s);
171
+ if (!r.rawInserted && !this.doSkipInvalid(t[n], e, s))
172
+ break;
173
+ a.aggregate(r);
174
+ }
175
+ return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && a.aggregate(this._appendEager()), s != null && (a.tailShift += this.appendTail(s).tailShift), a;
176
+ }
177
+ remove(t, e) {
178
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new h();
179
+ }
180
+ /** Calls function and reapplies current value */
181
+ withValueRefresh(t) {
182
+ if (this._refreshing || !this._initialized)
183
+ return t();
184
+ this._refreshing = !0;
185
+ const e = this.rawInputValue, i = this.value, s = t();
186
+ return this.rawInputValue = e, this.value && this.value !== i && i.indexOf(this.value) === 0 && (this.append(i.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, s;
187
+ }
188
+ runIsolated(t) {
189
+ if (this._isolated || !this._initialized)
190
+ return t(this);
191
+ this._isolated = !0;
192
+ const e = this.state, i = t(this);
193
+ return this.state = e, delete this._isolated, i;
194
+ }
195
+ doSkipInvalid(t, e, i) {
196
+ return !!this.skipInvalid;
197
+ }
198
+ /** Prepares string before mask processing */
199
+ doPrepare(t, e) {
200
+ return e === void 0 && (e = {}), h.normalize(this.prepare ? this.prepare(t, this, e) : t);
201
+ }
202
+ /** Prepares each char before mask processing */
203
+ doPrepareChar(t, e) {
204
+ return e === void 0 && (e = {}), h.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
205
+ }
206
+ /** Validates if value is acceptable */
207
+ doValidate(t) {
208
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
209
+ }
210
+ /** Does additional processing at the end of editing */
211
+ doCommit() {
212
+ this.commit && this.commit(this.value, this);
213
+ }
214
+ splice(t, e, i, s, a) {
215
+ i === void 0 && (i = ""), s === void 0 && (s = o.NONE), a === void 0 && (a = {
216
+ input: !0
217
+ });
218
+ const n = t + e, r = this.extractTail(n), l = this.eager === !0 || this.eager === "remove";
219
+ let u;
220
+ l && (s = I(s), u = this.extractInput(0, n, {
221
+ raw: !0
222
+ }));
223
+ let d = t;
224
+ const g = new h();
225
+ if (s !== o.NONE && (d = this.nearestInputPos(t, e > 1 && t !== 0 && !l ? o.NONE : s), g.tailShift = d - t), g.aggregate(this.remove(d)), l && s !== o.NONE && u === this.rawInputValue)
226
+ if (s === o.FORCE_LEFT) {
227
+ let w;
228
+ for (; u === this.rawInputValue && (w = this.displayValue.length); )
229
+ g.aggregate(new h({
230
+ tailShift: -1
231
+ })).aggregate(this.remove(w - 1));
232
+ } else
233
+ s === o.FORCE_RIGHT && r.unshift();
234
+ return g.aggregate(this.append(i, a, r));
235
+ }
236
+ maskEquals(t) {
237
+ return this.mask === t;
238
+ }
239
+ optionsIsChanged(t) {
240
+ return !V(this, t);
241
+ }
242
+ typedValueEquals(t) {
243
+ const e = this.typedValue;
244
+ return t === e || p.EMPTY_VALUES.includes(t) && p.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
245
+ }
246
+ pad(t) {
247
+ return new h();
248
+ }
249
+ }
250
+ p.DEFAULTS = {
251
+ skipInvalid: !0
252
+ };
253
+ p.EMPTY_VALUES = [void 0, null, ""];
254
+ _.Masked = p;
255
+ export {
256
+ p as default
257
+ };
@@ -0,0 +1,118 @@
1
+ import u from "./pattern.js";
2
+ import m from "./range.js";
3
+ import l from "../core/holder.js";
4
+ import { isString as o } from "../core/utils.js";
5
+ import "../core/change-details.js";
6
+ import "./base.js";
7
+ import "./factory.js";
8
+ import "./pattern/input-definition.js";
9
+ import "./regexp.js";
10
+ const d = "d{.}`m{.}`Y";
11
+ class r extends u {
12
+ static extractPatternOptions(t) {
13
+ const {
14
+ mask: e,
15
+ pattern: s,
16
+ ...n
17
+ } = t;
18
+ return {
19
+ ...n,
20
+ mask: o(e) ? e : s
21
+ };
22
+ }
23
+ /** Pattern mask for date according to {@link MaskedDate#format} */
24
+ /** Start date */
25
+ /** End date */
26
+ /** Format typed value to string */
27
+ /** Parse string to get typed value */
28
+ constructor(t) {
29
+ super(r.extractPatternOptions({
30
+ ...r.DEFAULTS,
31
+ ...t
32
+ }));
33
+ }
34
+ updateOptions(t) {
35
+ super.updateOptions(t);
36
+ }
37
+ _update(t) {
38
+ const {
39
+ mask: e,
40
+ pattern: s,
41
+ blocks: n,
42
+ ...p
43
+ } = {
44
+ ...r.DEFAULTS,
45
+ ...t
46
+ }, a = Object.assign({}, r.GET_DEFAULT_BLOCKS());
47
+ t.min && (a.Y.from = t.min.getFullYear()), t.max && (a.Y.to = t.max.getFullYear()), t.min && t.max && a.Y.from === a.Y.to && (a.m.from = t.min.getMonth() + 1, a.m.to = t.max.getMonth() + 1, a.m.from === a.m.to && (a.d.from = t.min.getDate(), a.d.to = t.max.getDate())), Object.assign(a, this.blocks, n), super._update({
48
+ ...p,
49
+ mask: o(e) ? e : s,
50
+ blocks: a
51
+ });
52
+ }
53
+ doValidate(t) {
54
+ const e = this.date;
55
+ return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
56
+ }
57
+ /** Checks if date is exists */
58
+ isDateExist(t) {
59
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
60
+ }
61
+ /** Parsed Date */
62
+ get date() {
63
+ return this.typedValue;
64
+ }
65
+ set date(t) {
66
+ this.typedValue = t;
67
+ }
68
+ get typedValue() {
69
+ return this.isComplete ? super.typedValue : null;
70
+ }
71
+ set typedValue(t) {
72
+ super.typedValue = t;
73
+ }
74
+ maskEquals(t) {
75
+ return t === Date || super.maskEquals(t);
76
+ }
77
+ optionsIsChanged(t) {
78
+ return super.optionsIsChanged(r.extractPatternOptions(t));
79
+ }
80
+ }
81
+ r.GET_DEFAULT_BLOCKS = () => ({
82
+ d: {
83
+ mask: m,
84
+ from: 1,
85
+ to: 31,
86
+ maxLength: 2
87
+ },
88
+ m: {
89
+ mask: m,
90
+ from: 1,
91
+ to: 12,
92
+ maxLength: 2
93
+ },
94
+ Y: {
95
+ mask: m,
96
+ from: 1900,
97
+ to: 9999
98
+ }
99
+ });
100
+ r.DEFAULTS = {
101
+ ...u.DEFAULTS,
102
+ mask: Date,
103
+ pattern: d,
104
+ format: (i, t) => {
105
+ if (!i)
106
+ return "";
107
+ const e = String(i.getDate()).padStart(2, "0"), s = String(i.getMonth() + 1).padStart(2, "0"), n = i.getFullYear();
108
+ return [e, s, n].join(".");
109
+ },
110
+ parse: (i, t) => {
111
+ const [e, s, n] = i.split(".").map(Number);
112
+ return new Date(n, s - 1, e);
113
+ }
114
+ };
115
+ l.MaskedDate = r;
116
+ export {
117
+ r as default
118
+ };
@@ -0,0 +1,224 @@
1
+ import { DIRECTION as c, objectIncludes as d } from "../core/utils.js";
2
+ import l from "../core/change-details.js";
3
+ import v, { normalizeOpts as _ } from "./factory.js";
4
+ import k from "./base.js";
5
+ import g from "../core/holder.js";
6
+ class h extends k {
7
+ constructor(e) {
8
+ super({
9
+ ...h.DEFAULTS,
10
+ ...e
11
+ }), this.currentMask = void 0;
12
+ }
13
+ updateOptions(e) {
14
+ super.updateOptions(e);
15
+ }
16
+ _update(e) {
17
+ super._update(e), "mask" in e && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(e.mask) ? e.mask.map((t) => {
18
+ const {
19
+ expose: s,
20
+ ...a
21
+ } = _(t), i = v({
22
+ overwrite: this._overwrite,
23
+ eager: this._eager,
24
+ skipInvalid: this._skipInvalid,
25
+ ...a
26
+ });
27
+ return s && (this.exposeMask = i), i;
28
+ }) : []);
29
+ }
30
+ _appendCharRaw(e, t) {
31
+ t === void 0 && (t = {});
32
+ const s = this._applyDispatch(e, t);
33
+ return this.currentMask && s.aggregate(this.currentMask._appendChar(e, this.currentMaskFlags(t))), s;
34
+ }
35
+ _applyDispatch(e, t, s) {
36
+ e === void 0 && (e = ""), t === void 0 && (t = {}), s === void 0 && (s = "");
37
+ const a = t.tail && t._beforeTailState != null ? t._beforeTailState._value : this.value, i = this.rawInputValue, r = t.tail && t._beforeTailState != null ? t._beforeTailState._rawInputValue : i, u = i.slice(r.length), n = this.currentMask, p = new l(), o = n == null ? void 0 : n.state;
38
+ return this.currentMask = this.doDispatch(e, {
39
+ ...t
40
+ }, s), this.currentMask && (this.currentMask !== n ? (this.currentMask.reset(), r && (this.currentMask.append(r, {
41
+ raw: !0
42
+ }), p.tailShift = this.currentMask.value.length - a.length), u && (p.tailShift += this.currentMask.append(u, {
43
+ raw: !0,
44
+ tail: !0
45
+ }).tailShift)) : o && (this.currentMask.state = o)), p;
46
+ }
47
+ _appendPlaceholder() {
48
+ const e = this._applyDispatch();
49
+ return this.currentMask && e.aggregate(this.currentMask._appendPlaceholder()), e;
50
+ }
51
+ _appendEager() {
52
+ const e = this._applyDispatch();
53
+ return this.currentMask && e.aggregate(this.currentMask._appendEager()), e;
54
+ }
55
+ appendTail(e) {
56
+ const t = new l();
57
+ return e && t.aggregate(this._applyDispatch("", {}, e)), t.aggregate(this.currentMask ? this.currentMask.appendTail(e) : super.appendTail(e));
58
+ }
59
+ currentMaskFlags(e) {
60
+ var t, s;
61
+ return {
62
+ ...e,
63
+ _beforeTailState: ((t = e._beforeTailState) == null ? void 0 : t.currentMaskRef) === this.currentMask && ((s = e._beforeTailState) == null ? void 0 : s.currentMask) || e._beforeTailState
64
+ };
65
+ }
66
+ doDispatch(e, t, s) {
67
+ return t === void 0 && (t = {}), s === void 0 && (s = ""), this.dispatch(e, this, t, s);
68
+ }
69
+ doValidate(e) {
70
+ return super.doValidate(e) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(e)));
71
+ }
72
+ doPrepare(e, t) {
73
+ t === void 0 && (t = {});
74
+ let [s, a] = super.doPrepare(e, t);
75
+ if (this.currentMask) {
76
+ let i;
77
+ [s, i] = super.doPrepare(s, this.currentMaskFlags(t)), a = a.aggregate(i);
78
+ }
79
+ return [s, a];
80
+ }
81
+ doPrepareChar(e, t) {
82
+ t === void 0 && (t = {});
83
+ let [s, a] = super.doPrepareChar(e, t);
84
+ if (this.currentMask) {
85
+ let i;
86
+ [s, i] = super.doPrepareChar(s, this.currentMaskFlags(t)), a = a.aggregate(i);
87
+ }
88
+ return [s, a];
89
+ }
90
+ reset() {
91
+ var e;
92
+ (e = this.currentMask) == null || e.reset(), this.compiledMasks.forEach((t) => t.reset());
93
+ }
94
+ get value() {
95
+ return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
96
+ }
97
+ set value(e) {
98
+ this.exposeMask ? (this.exposeMask.value = e, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = e;
99
+ }
100
+ get unmaskedValue() {
101
+ return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
102
+ }
103
+ set unmaskedValue(e) {
104
+ this.exposeMask ? (this.exposeMask.unmaskedValue = e, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = e;
105
+ }
106
+ get typedValue() {
107
+ return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
108
+ }
109
+ set typedValue(e) {
110
+ if (this.exposeMask) {
111
+ this.exposeMask.typedValue = e, this.currentMask = this.exposeMask, this._applyDispatch();
112
+ return;
113
+ }
114
+ let t = String(e);
115
+ this.currentMask && (this.currentMask.typedValue = e, t = this.currentMask.unmaskedValue), this.unmaskedValue = t;
116
+ }
117
+ get displayValue() {
118
+ return this.currentMask ? this.currentMask.displayValue : "";
119
+ }
120
+ get isComplete() {
121
+ var e;
122
+ return !!((e = this.currentMask) != null && e.isComplete);
123
+ }
124
+ get isFilled() {
125
+ var e;
126
+ return !!((e = this.currentMask) != null && e.isFilled);
127
+ }
128
+ remove(e, t) {
129
+ const s = new l();
130
+ return this.currentMask && s.aggregate(this.currentMask.remove(e, t)).aggregate(this._applyDispatch()), s;
131
+ }
132
+ get state() {
133
+ var e;
134
+ return {
135
+ ...super.state,
136
+ _rawInputValue: this.rawInputValue,
137
+ compiledMasks: this.compiledMasks.map((t) => t.state),
138
+ currentMaskRef: this.currentMask,
139
+ currentMask: (e = this.currentMask) == null ? void 0 : e.state
140
+ };
141
+ }
142
+ set state(e) {
143
+ const {
144
+ compiledMasks: t,
145
+ currentMaskRef: s,
146
+ currentMask: a,
147
+ ...i
148
+ } = e;
149
+ t && this.compiledMasks.forEach((r, u) => r.state = t[u]), s != null && (this.currentMask = s, this.currentMask.state = a), super.state = i;
150
+ }
151
+ extractInput(e, t, s) {
152
+ return this.currentMask ? this.currentMask.extractInput(e, t, s) : "";
153
+ }
154
+ extractTail(e, t) {
155
+ return this.currentMask ? this.currentMask.extractTail(e, t) : super.extractTail(e, t);
156
+ }
157
+ doCommit() {
158
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
159
+ }
160
+ nearestInputPos(e, t) {
161
+ return this.currentMask ? this.currentMask.nearestInputPos(e, t) : super.nearestInputPos(e, t);
162
+ }
163
+ get overwrite() {
164
+ return this.currentMask ? this.currentMask.overwrite : this._overwrite;
165
+ }
166
+ set overwrite(e) {
167
+ this._overwrite = e;
168
+ }
169
+ get eager() {
170
+ return this.currentMask ? this.currentMask.eager : this._eager;
171
+ }
172
+ set eager(e) {
173
+ this._eager = e;
174
+ }
175
+ get skipInvalid() {
176
+ return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
177
+ }
178
+ set skipInvalid(e) {
179
+ this._skipInvalid = e;
180
+ }
181
+ get autofix() {
182
+ return this.currentMask ? this.currentMask.autofix : this._autofix;
183
+ }
184
+ set autofix(e) {
185
+ this._autofix = e;
186
+ }
187
+ maskEquals(e) {
188
+ return Array.isArray(e) ? this.compiledMasks.every((t, s) => {
189
+ if (!e[s])
190
+ return;
191
+ const {
192
+ mask: a,
193
+ ...i
194
+ } = e[s];
195
+ return d(t, i) && t.maskEquals(a);
196
+ }) : super.maskEquals(e);
197
+ }
198
+ typedValueEquals(e) {
199
+ var t;
200
+ return !!((t = this.currentMask) != null && t.typedValueEquals(e));
201
+ }
202
+ }
203
+ h.DEFAULTS = {
204
+ ...k.DEFAULTS,
205
+ dispatch: (M, e, t, s) => {
206
+ if (!e.compiledMasks.length)
207
+ return;
208
+ const a = e.rawInputValue, i = e.compiledMasks.map((r, u) => {
209
+ const n = e.currentMask === r, p = n ? r.displayValue.length : r.nearestInputPos(r.displayValue.length, c.FORCE_LEFT);
210
+ return r.rawInputValue !== a ? (r.reset(), r.append(a, {
211
+ raw: !0
212
+ })) : n || r.remove(p), r.append(M, e.currentMaskFlags(t)), r.appendTail(s), {
213
+ index: u,
214
+ weight: r.rawInputValue.length,
215
+ totalInputPositions: r.totalInputPositions(0, Math.max(p, r.nearestInputPos(r.displayValue.length, c.FORCE_LEFT)))
216
+ };
217
+ });
218
+ return i.sort((r, u) => u.weight - r.weight || u.totalInputPositions - r.totalInputPositions), e.compiledMasks[i[0].index];
219
+ }
220
+ };
221
+ g.MaskedDynamic = h;
222
+ export {
223
+ h as default
224
+ };
@@ -0,0 +1,70 @@
1
+ import m from "./pattern.js";
2
+ import c from "../core/holder.js";
3
+ import l from "../core/change-details.js";
4
+ import { DIRECTION as p } from "../core/utils.js";
5
+ import d from "../core/continuous-tail-details.js";
6
+ import "./base.js";
7
+ import "./factory.js";
8
+ import "./pattern/input-definition.js";
9
+ import "./regexp.js";
10
+ class r extends m {
11
+ constructor(e) {
12
+ super({
13
+ ...r.DEFAULTS,
14
+ ...e
15
+ });
16
+ }
17
+ updateOptions(e) {
18
+ super.updateOptions(e);
19
+ }
20
+ _update(e) {
21
+ const {
22
+ enum: t,
23
+ ...s
24
+ } = e;
25
+ if (t) {
26
+ const i = t.map((h) => h.length), a = Math.min(...i), n = Math.max(...i) - a;
27
+ s.mask = "*".repeat(a), n && (s.mask += "[" + "*".repeat(n) + "]"), this.enum = t;
28
+ }
29
+ super._update(s);
30
+ }
31
+ _appendCharRaw(e, t) {
32
+ t === void 0 && (t = {});
33
+ const s = Math.min(this.nearestInputPos(0, p.FORCE_RIGHT), this.value.length), i = this.enum.filter((a) => this.matchValue(a, this.unmaskedValue + e, s));
34
+ if (i.length) {
35
+ i.length === 1 && this._forEachBlocksInRange(0, this.value.length, (n, h) => {
36
+ const u = i[0][h];
37
+ h >= this.value.length || u === n.value || (n.reset(), n._appendChar(u, t));
38
+ });
39
+ const a = super._appendCharRaw(i[0][this.value.length], t);
40
+ return i.length === 1 && i[0].slice(this.unmaskedValue.length).split("").forEach((n) => a.aggregate(super._appendCharRaw(n))), a;
41
+ }
42
+ return new l({
43
+ skip: !this.isComplete
44
+ });
45
+ }
46
+ extractTail(e, t) {
47
+ return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), new d("", e);
48
+ }
49
+ remove(e, t) {
50
+ if (e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), e === t)
51
+ return new l();
52
+ const s = Math.min(super.nearestInputPos(0, p.FORCE_RIGHT), this.value.length);
53
+ let i;
54
+ for (i = e; i >= 0 && !(this.enum.filter((h) => this.matchValue(h, this.value.slice(s, i), s)).length > 1); --i)
55
+ ;
56
+ const a = super.remove(i, t);
57
+ return a.tailShift += i - e, a;
58
+ }
59
+ get isComplete() {
60
+ return this.enum.indexOf(this.value) >= 0;
61
+ }
62
+ }
63
+ r.DEFAULTS = {
64
+ ...m.DEFAULTS,
65
+ matchValue: (o, e, t) => o.indexOf(e, t) === t
66
+ };
67
+ c.MaskedEnum = r;
68
+ export {
69
+ r as default
70
+ };