stone-kit 0.0.877 → 0.0.879

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/{src/pages/ButtonsPage/ButtonState/ButtonState.module.scss.js → ButtonState.module-DtW3aevR.js} +1 -4
  3. package/dist/FilterWithSave-Bp6rH8Pe.js +2230 -0
  4. package/dist/Menu-CgCfinVZ.js +513 -0
  5. package/dist/Option-BVIm7wOW.js +83 -0
  6. package/dist/{src/components/NewIcon/assets/PinTrans.svg.js → PinTrans-D6OZq76b.js} +4 -4
  7. package/dist/Router.js +9 -9
  8. package/dist/{src/components/NewIcon/assets/SmallFilter.svg.js → SmallFilter-C-VKnbkP.js} +3 -3
  9. package/dist/components/Button/ui/Button.js +73 -44
  10. package/dist/components/CheckBox/CheckBox.js +46 -35
  11. package/dist/components/CheckBoxNew/CheckBoxNew.js +23 -19
  12. package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +31 -24
  13. package/dist/components/DestinationTab/ui/DestinationTab.js +48 -35
  14. package/dist/components/FieldInput/ui/FieldInput.js +10 -7
  15. package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +5 -61
  16. package/dist/components/FilterWithSave/ui/FilterWithSave.js +7 -266
  17. package/dist/components/Flex/ui/Flex.js +61 -26
  18. package/dist/components/FormModal/ui/ModalForm.js +14 -289
  19. package/dist/components/GroupedInput/ui/GroupedInputs.js +6 -5
  20. package/dist/components/Input/ui/Input.js +3307 -74
  21. package/dist/components/Logo/ui/Logo.js +31 -19
  22. package/dist/components/Logo/ui/Logo.types.js +10 -18
  23. package/dist/components/LotCard/hooks/useLotCard.js +11 -125
  24. package/dist/components/LotCard/index.js +2 -2
  25. package/dist/components/LotCard/ui/LotCard.js +9 -150
  26. package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +58 -31
  27. package/dist/components/MetroLabel/ui/MetroLabel.js +24 -19
  28. package/dist/components/MetroTag/ui/MetroTag.js +72 -59
  29. package/dist/components/Modal/ui/Modal.js +38 -33
  30. package/dist/components/ModalSuccess/ModalSuccess.js +35 -26
  31. package/dist/components/NewIcon/icons/PinTrans.js +3 -3
  32. package/dist/components/NewIcon/icons/SmallFilter.js +1 -1
  33. package/dist/components/NewIcon/ui/NewIcon.js +301 -141
  34. package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +15 -5
  35. package/dist/components/RoundButton/ui/RoundButton.js +60 -42
  36. package/dist/components/Select/ui/Category.js +29 -30
  37. package/dist/components/Select/ui/Option.js +5 -52
  38. package/dist/components/Select/ui/Select.js +23 -24
  39. package/dist/components/SliderNavigation/ui/SliderNavigation.js +28 -27
  40. package/dist/components/SortSelect/hooks/useSortSelect.js +4 -59
  41. package/dist/components/SortSelect/index.js +1 -1
  42. package/dist/components/SortSelect/ui/SortSelect.js +9 -114
  43. package/dist/components/SummarySelect/ui/SummarySelect.js +69 -59
  44. package/dist/components/Switcher/ui/Switcher.js +24 -13
  45. package/dist/components/TabSelect/ui/TabSelect.js +34 -28
  46. package/dist/components/TabSwitcher/index.js +2 -2
  47. package/dist/components/TabSwitcher/ui/TabSwitcher.js +7 -84
  48. package/dist/components/Tag/ui/Tag.js +67 -19
  49. package/dist/components/Text/ui/Text.js +13 -12
  50. package/dist/components/TextArea/TextArea.js +14 -11
  51. package/dist/components/ZoomControls/ui/ZoomControls.js +11 -8
  52. package/dist/components/mobileButton/ui/MobileButton.js +39 -34
  53. package/dist/index-DmANy9jd.js +890 -0
  54. package/dist/{node_modules/classnames/index.js → index-rKuIKazb.js} +15 -12
  55. package/dist/layout/Layout.js +8 -7
  56. package/dist/layout/components/Header/Header.js +44 -41
  57. package/dist/layout/components/Menu.js +6 -111
  58. package/dist/main.js +42 -46
  59. package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +1 -1
  60. package/dist/pages/ButtonsPage/Buttons.js +62 -54
  61. package/dist/pages/CheckboxPage/CheckboxPage.js +51 -47
  62. package/dist/pages/FormsPage/FormsPage.js +32 -31
  63. package/dist/pages/HomePage/HomePage.js +4 -3
  64. package/dist/pages/IconsPage/IconsPage.js +10 -12
  65. package/dist/pages/InputPage/InputPage.js +12 -17
  66. package/dist/pages/LogoPage/LogoPage.js +14 -17
  67. package/dist/pages/LotsPage/LotsPage.js +15 -15
  68. package/dist/pages/ModalsPage/ModalPage.js +14 -19
  69. package/dist/pages/SelectPage/SelectPage.js +41 -42
  70. package/dist/pages/TabsPage/TabsPage.js +51 -49
  71. package/dist/pages/TagsPage/TagsPage.js +7 -10
  72. package/dist/stories/Button.js +4 -5
  73. package/dist/stories/Header.js +3 -4
  74. package/dist/stories/Page.js +2 -3
  75. package/dist/style.css +1 -1
  76. package/dist/useSortSelect-CjZXLFOG.js +80 -0
  77. package/package.json +4 -3
  78. package/dist/_virtual/_commonjsHelpers.js +0 -6
  79. package/dist/_virtual/bind.js +0 -4
  80. package/dist/_virtual/index.js +0 -4
  81. package/dist/_virtual/index2.js +0 -4
  82. package/dist/_virtual/index3.js +0 -4
  83. package/dist/_virtual/react-is.development.js +0 -4
  84. package/dist/_virtual/react-is.production.min.js +0 -4
  85. package/dist/node_modules/@remix-run/router/dist/router.js +0 -431
  86. package/dist/node_modules/classnames/bind.js +0 -42
  87. package/dist/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -35
  88. package/dist/node_modules/imask/esm/controls/html-input-mask-element.js +0 -31
  89. package/dist/node_modules/imask/esm/controls/html-mask-element.js +0 -48
  90. package/dist/node_modules/imask/esm/controls/input-history.js +0 -30
  91. package/dist/node_modules/imask/esm/controls/input.js +0 -224
  92. package/dist/node_modules/imask/esm/controls/mask-element.js +0 -43
  93. package/dist/node_modules/imask/esm/core/action-details.js +0 -51
  94. package/dist/node_modules/imask/esm/core/change-details.js +0 -36
  95. package/dist/node_modules/imask/esm/core/continuous-tail-details.js +0 -44
  96. package/dist/node_modules/imask/esm/core/holder.js +0 -6
  97. package/dist/node_modules/imask/esm/core/utils.js +0 -80
  98. package/dist/node_modules/imask/esm/index.js +0 -50
  99. package/dist/node_modules/imask/esm/masked/base.js +0 -257
  100. package/dist/node_modules/imask/esm/masked/date.js +0 -118
  101. package/dist/node_modules/imask/esm/masked/dynamic.js +0 -224
  102. package/dist/node_modules/imask/esm/masked/enum.js +0 -70
  103. package/dist/node_modules/imask/esm/masked/factory.js +0 -51
  104. package/dist/node_modules/imask/esm/masked/function.js +0 -23
  105. package/dist/node_modules/imask/esm/masked/number.js +0 -215
  106. package/dist/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -110
  107. package/dist/node_modules/imask/esm/masked/pattern/cursor.js +0 -102
  108. package/dist/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -103
  109. package/dist/node_modules/imask/esm/masked/pattern/input-definition.js +0 -134
  110. package/dist/node_modules/imask/esm/masked/pattern.js +0 -339
  111. package/dist/node_modules/imask/esm/masked/pipe.js +0 -23
  112. package/dist/node_modules/imask/esm/masked/range.js +0 -82
  113. package/dist/node_modules/imask/esm/masked/regexp.js +0 -21
  114. package/dist/node_modules/imask/esm/masked/repeat.js +0 -106
  115. package/dist/node_modules/object-assign/index.js +0 -55
  116. package/dist/node_modules/prop-types/checkPropTypes.js +0 -55
  117. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -53
  118. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -330
  119. package/dist/node_modules/prop-types/index.js +0 -15
  120. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -11
  121. package/dist/node_modules/prop-types/lib/has.js +0 -7
  122. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -95
  123. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -79
  124. package/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -10
  125. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -1062
  126. package/dist/node_modules/react-imask/esm/input.js +0 -25
  127. package/dist/node_modules/react-imask/esm/mixin.js +0 -131
  128. package/dist/node_modules/react-router/dist/index.js +0 -486
  129. package/dist/node_modules/react-router-dom/dist/index.js +0 -424
  130. package/dist/src/components/Button/ui/Button.module.scss.js +0 -49
  131. package/dist/src/components/CheckBox/s.module.scss.js +0 -24
  132. package/dist/src/components/CheckBoxNew/s.module.scss.js +0 -13
  133. package/dist/src/components/CheckboxSelect/ui/s.module.scss.js +0 -19
  134. package/dist/src/components/DestinationTab/ui/DestinationTab.module.scss.js +0 -23
  135. package/dist/src/components/FieldInput/ui/FieldInput.module.scss.js +0 -11
  136. package/dist/src/components/FilterWithSave/ui/s.module.scss.js +0 -39
  137. package/dist/src/components/Flex/ui/Flex.module.scss.js +0 -41
  138. package/dist/src/components/FormModal/ui/ModalForm.module.scss.js +0 -31
  139. package/dist/src/components/GroupedInput/ui/GroupedInputs.module.scss.js +0 -7
  140. package/dist/src/components/Input/ui/Input.module.scss.js +0 -43
  141. package/dist/src/components/Logo/assets/LogoBlack.svg.js +0 -4
  142. package/dist/src/components/Logo/assets/LogoDom.svg.js +0 -4
  143. package/dist/src/components/Logo/assets/LogoNewDom.svg.js +0 -4
  144. package/dist/src/components/Logo/assets/LogoNewOffice.svg.js +0 -4
  145. package/dist/src/components/Logo/assets/LogoOffice.svg.js +0 -4
  146. package/dist/src/components/Logo/assets/LogoRealty.svg.js +0 -4
  147. package/dist/src/components/Logo/assets/LogoValue.svg.js +0 -4
  148. package/dist/src/components/Logo/assets/LogoWhite.svg.js +0 -4
  149. package/dist/src/components/Logo/ui/Logo.module.scss.js +0 -29
  150. package/dist/src/components/LotCard/assets/testLot.webp.js +0 -4
  151. package/dist/src/components/LotCard/ui/LotCard.module.scss.js +0 -71
  152. package/dist/src/components/LotCardSkeleton/ui/LotCardSkeleton.module.scss.js +0 -59
  153. package/dist/src/components/MetroLabel/ui/MetroLabel.module.scss.js +0 -15
  154. package/dist/src/components/MetroTag/ui/MetroTag.module.scss.js +0 -31
  155. package/dist/src/components/Modal/ui/Modal.module.scss.js +0 -15
  156. package/dist/src/components/ModalSuccess/styles.module.scss.js +0 -23
  157. package/dist/src/components/NewIcon/assets/ArrowLong.svg.js +0 -10
  158. package/dist/src/components/NewIcon/assets/ArrowShort.svg.js +0 -10
  159. package/dist/src/components/NewIcon/assets/Auto.svg.js +0 -10
  160. package/dist/src/components/NewIcon/assets/Building.svg.js +0 -10
  161. package/dist/src/components/NewIcon/assets/Burger.svg.js +0 -10
  162. package/dist/src/components/NewIcon/assets/BurgerClose.svg.js +0 -10
  163. package/dist/src/components/NewIcon/assets/Call.svg.js +0 -10
  164. package/dist/src/components/NewIcon/assets/Callback.svg.js +0 -10
  165. package/dist/src/components/NewIcon/assets/Case.svg.js +0 -10
  166. package/dist/src/components/NewIcon/assets/Check.svg.js +0 -10
  167. package/dist/src/components/NewIcon/assets/Circle.svg.js +0 -10
  168. package/dist/src/components/NewIcon/assets/Close.svg.js +0 -10
  169. package/dist/src/components/NewIcon/assets/DirectionDown.svg.js +0 -10
  170. package/dist/src/components/NewIcon/assets/Download.svg.js +0 -10
  171. package/dist/src/components/NewIcon/assets/Filter.svg.js +0 -10
  172. package/dist/src/components/NewIcon/assets/Food.svg.js +0 -10
  173. package/dist/src/components/NewIcon/assets/Fullscreen.svg.js +0 -10
  174. package/dist/src/components/NewIcon/assets/Heart.svg.js +0 -10
  175. package/dist/src/components/NewIcon/assets/Layers.svg.js +0 -10
  176. package/dist/src/components/NewIcon/assets/LayersFilled.svg.js +0 -10
  177. package/dist/src/components/NewIcon/assets/Loader.svg.js +0 -10
  178. package/dist/src/components/NewIcon/assets/Lock.svg.js +0 -10
  179. package/dist/src/components/NewIcon/assets/Metro.svg.js +0 -10
  180. package/dist/src/components/NewIcon/assets/Minus.svg.js +0 -10
  181. package/dist/src/components/NewIcon/assets/MinusCheck.svg.js +0 -10
  182. package/dist/src/components/NewIcon/assets/Moon.svg.js +0 -10
  183. package/dist/src/components/NewIcon/assets/Park.svg.js +0 -10
  184. package/dist/src/components/NewIcon/assets/Pedestrian.svg.js +0 -10
  185. package/dist/src/components/NewIcon/assets/Phone.svg.js +0 -10
  186. package/dist/src/components/NewIcon/assets/PhoneFilled.svg.js +0 -10
  187. package/dist/src/components/NewIcon/assets/Pin.svg.js +0 -10
  188. package/dist/src/components/NewIcon/assets/Play.svg.js +0 -10
  189. package/dist/src/components/NewIcon/assets/Play2.svg.js +0 -10
  190. package/dist/src/components/NewIcon/assets/Plus.svg.js +0 -10
  191. package/dist/src/components/NewIcon/assets/Redo.svg.js +0 -10
  192. package/dist/src/components/NewIcon/assets/Ruble.svg.js +0 -10
  193. package/dist/src/components/NewIcon/assets/Search.svg.js +0 -10
  194. package/dist/src/components/NewIcon/assets/SelectChecked.svg.js +0 -10
  195. package/dist/src/components/NewIcon/assets/SelectUnchecked.svg.js +0 -10
  196. package/dist/src/components/NewIcon/assets/Share.svg.js +0 -10
  197. package/dist/src/components/NewIcon/assets/Sport.svg.js +0 -10
  198. package/dist/src/components/NewIcon/assets/SquareMeter.svg.js +0 -10
  199. package/dist/src/components/NewIcon/assets/Star.svg.js +0 -10
  200. package/dist/src/components/NewIcon/assets/StarFilled.svg.js +0 -10
  201. package/dist/src/components/NewIcon/assets/Sun.svg.js +0 -10
  202. package/dist/src/components/NewIcon/assets/Telegram.svg.js +0 -10
  203. package/dist/src/components/NewIcon/assets/Timer.svg.js +0 -10
  204. package/dist/src/components/NewIcon/assets/TwoArrows.svg.js +0 -10
  205. package/dist/src/components/NewIcon/assets/User.svg.js +0 -10
  206. package/dist/src/components/NewIcon/assets/WhatsApp.svg.js +0 -10
  207. package/dist/src/components/NewIcon/assets/WithoutDecor.svg.js +0 -10
  208. package/dist/src/components/NewIcon/assets/arrowRight.svg.js +0 -10
  209. package/dist/src/components/NewIcon/assets/mail.svg.js +0 -10
  210. package/dist/src/components/NewIcon/ui/NewIcon.module.scss.js +0 -4
  211. package/dist/src/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.module.scss.js +0 -25
  212. package/dist/src/components/RoundButton/ui/RoundButton.module.scss.js +0 -29
  213. package/dist/src/components/Select/ui/Select.module.scss.js +0 -52
  214. package/dist/src/components/SliderNavigation/ui/SliderNavigation.module.scss.js +0 -7
  215. package/dist/src/components/SortSelect/ui/SortSelect.module.scss.js +0 -41
  216. package/dist/src/components/SummarySelect/ui/SummarySelect.module.scss.js +0 -25
  217. package/dist/src/components/Switcher/ui/Switcher.module.scss.js +0 -27
  218. package/dist/src/components/TabSelect/ui/TabSelect.module.scss.js +0 -17
  219. package/dist/src/components/TabSwitcher/ui/TabSwitcher.module.scss.js +0 -57
  220. package/dist/src/components/Tag/ui/Tag.module.scss.js +0 -70
  221. package/dist/src/components/Text/ui/Text.module.scss.js +0 -7
  222. package/dist/src/components/TextArea/styles.module.scss.js +0 -9
  223. package/dist/src/components/ZoomControls/ui/ZoomControls.module.scss.js +0 -11
  224. package/dist/src/components/mobileButton/ui/MobileButton.module.scss.js +0 -12
  225. package/dist/src/layout/components/Header/s.module.scss.js +0 -19
  226. package/dist/src/layout/components/Menu.module.scss.js +0 -9
  227. package/dist/src/layout/style.module.scss.js +0 -7
  228. package/dist/src/pages/ButtonsPage/ButtonState/ButtonState.js +0 -18
  229. package/dist/src/pages/ButtonsPage/ButtonsPage.module.scss.js +0 -9
  230. package/dist/src/pages/CheckboxPage/CheckboxPage.module.scss.js +0 -13
  231. package/dist/src/pages/FormsPage/FormsPage.module.scss.js +0 -15
  232. package/dist/src/pages/HomePage/HomePage.module.scss.js +0 -7
  233. package/dist/src/pages/IconsPage/IconsPage.module.scss.js +0 -9
  234. package/dist/src/pages/InputPage/InputPage.module.scss.js +0 -4
  235. package/dist/src/pages/LogoPage/LogoPage.module.scss.js +0 -7
  236. package/dist/src/pages/LotsPage/LotsPage.module.scss.js +0 -13
  237. package/dist/src/pages/ModalsPage/ModalPage.module.scss.js +0 -4
  238. package/dist/src/pages/SelectPage/SelectPage.module.scss.js +0 -11
  239. package/dist/src/pages/TabsPage/TabsPage.module.scss.js +0 -17
  240. package/dist/src/pages/TagsPage/TagsPage.module.scss.js +0 -7
  241. package/dist/src/stories/button.css.js +0 -1
  242. package/dist/src/stories/header.css.js +0 -1
  243. package/dist/src/stories/page.css.js +0 -1
@@ -1,224 +0,0 @@
1
- import { DIRECTION as r } from "../core/utils.js";
2
- import h from "../core/action-details.js";
3
- import u, { maskedClass as l } from "../masked/factory.js";
4
- import d from "./mask-element.js";
5
- import p from "./html-input-mask-element.js";
6
- import _ from "./html-contenteditable-mask-element.js";
7
- import o from "../core/holder.js";
8
- import m from "./input-history.js";
9
- import "./html-mask-element.js";
10
- class c {
11
- /**
12
- View element
13
- */
14
- /** Internal {@link Masked} model */
15
- constructor(t, s) {
16
- this.el = t instanceof d ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new _(t) : new p(t), this.masked = u(s), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new m(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
17
- }
18
- maskEquals(t) {
19
- var s;
20
- return t == null || ((s = this.masked) == null ? void 0 : s.maskEquals(t));
21
- }
22
- /** Masked */
23
- get mask() {
24
- return this.masked.mask;
25
- }
26
- set mask(t) {
27
- if (this.maskEquals(t))
28
- return;
29
- if (!(t instanceof o.Masked) && this.masked.constructor === l(t)) {
30
- this.masked.updateOptions({
31
- mask: t
32
- });
33
- return;
34
- }
35
- const s = t instanceof o.Masked ? t : u({
36
- mask: t
37
- });
38
- s.unmaskedValue = this.masked.unmaskedValue, this.masked = s;
39
- }
40
- /** Raw value */
41
- get value() {
42
- return this._value;
43
- }
44
- set value(t) {
45
- this.value !== t && (this.masked.value = t, this.updateControl("auto"));
46
- }
47
- /** Unmasked value */
48
- get unmaskedValue() {
49
- return this._unmaskedValue;
50
- }
51
- set unmaskedValue(t) {
52
- this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl("auto"));
53
- }
54
- /** Raw input value */
55
- get rawInputValue() {
56
- return this._rawInputValue;
57
- }
58
- set rawInputValue(t) {
59
- this.rawInputValue !== t && (this.masked.rawInputValue = t, this.updateControl(), this.alignCursor());
60
- }
61
- /** Typed unmasked value */
62
- get typedValue() {
63
- return this.masked.typedValue;
64
- }
65
- set typedValue(t) {
66
- this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl("auto"));
67
- }
68
- /** Display value */
69
- get displayValue() {
70
- return this.masked.displayValue;
71
- }
72
- /** Starts listening to element events */
73
- _bindEvents() {
74
- this.el.bindEvents({
75
- selectionChange: this._saveSelection,
76
- input: this._onInput,
77
- drop: this._onDrop,
78
- click: this._onClick,
79
- focus: this._onFocus,
80
- commit: this._onChange,
81
- undo: this._onUndo,
82
- redo: this._onRedo
83
- });
84
- }
85
- /** Stops listening to element events */
86
- _unbindEvents() {
87
- this.el && this.el.unbindEvents();
88
- }
89
- /** Fires custom event */
90
- _fireEvent(t, s) {
91
- const e = this._listeners[t];
92
- e && e.forEach((i) => i(s));
93
- }
94
- /** Current selection start */
95
- get selectionStart() {
96
- return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
97
- }
98
- /** Current cursor position */
99
- get cursorPos() {
100
- return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
101
- }
102
- set cursorPos(t) {
103
- !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
104
- }
105
- /** Stores current selection */
106
- _saveSelection() {
107
- this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
108
- start: this.selectionStart,
109
- end: this.cursorPos
110
- };
111
- }
112
- /** Syncronizes model value from view */
113
- updateValue() {
114
- this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue;
115
- }
116
- /** Syncronizes view from model value, fires change events */
117
- updateControl(t) {
118
- const s = this.masked.unmaskedValue, e = this.masked.value, i = this.masked.rawInputValue, n = this.displayValue, a = this.unmaskedValue !== s || this.value !== e || this._rawInputValue !== i;
119
- this._unmaskedValue = s, this._value = e, this._rawInputValue = i, this.el.value !== n && (this.el.value = n), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), a && this._fireChangeEvents(), !this._historyChanging && (a || this.history.isEmpty) && this.history.push({
120
- unmaskedValue: s,
121
- selection: {
122
- start: this.selectionStart,
123
- end: this.cursorPos
124
- }
125
- });
126
- }
127
- /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
128
- updateOptions(t) {
129
- const {
130
- mask: s,
131
- ...e
132
- } = t, i = !this.maskEquals(s), n = this.masked.optionsIsChanged(e);
133
- i && (this.mask = s), n && this.masked.updateOptions(e), (i || n) && this.updateControl();
134
- }
135
- /** Updates cursor */
136
- updateCursor(t) {
137
- t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
138
- }
139
- /** Delays cursor update to support mobile browsers */
140
- _delayUpdateCursor(t) {
141
- this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
142
- this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
143
- }, 10);
144
- }
145
- /** Fires custom events */
146
- _fireChangeEvents() {
147
- this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
148
- }
149
- /** Aborts delayed cursor update */
150
- _abortUpdateCursor() {
151
- this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
152
- }
153
- /** Aligns cursor to nearest available position */
154
- alignCursor() {
155
- this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, r.LEFT));
156
- }
157
- /** Aligns cursor only if selection is empty */
158
- alignCursorFriendly() {
159
- this.selectionStart === this.cursorPos && this.alignCursor();
160
- }
161
- /** Adds listener on custom event */
162
- on(t, s) {
163
- return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(s), this;
164
- }
165
- /** Removes custom event listener */
166
- off(t, s) {
167
- if (!this._listeners[t])
168
- return this;
169
- if (!s)
170
- return delete this._listeners[t], this;
171
- const e = this._listeners[t].indexOf(s);
172
- return e >= 0 && this._listeners[t].splice(e, 1), this;
173
- }
174
- /** Handles view input event */
175
- _onInput(t) {
176
- this._inputEvent = t, this._abortUpdateCursor();
177
- const s = new h({
178
- // new state
179
- value: this.el.value,
180
- cursorPos: this.cursorPos,
181
- // old state
182
- oldValue: this.displayValue,
183
- oldSelection: this._selection
184
- }), e = this.masked.rawInputValue, i = this.masked.splice(s.startChangePos, s.removed.length, s.inserted, s.removeDirection, {
185
- input: !0,
186
- raw: !0
187
- }).offset, n = e === this.masked.rawInputValue ? s.removeDirection : r.NONE;
188
- let a = this.masked.nearestInputPos(s.startChangePos + i, n);
189
- n !== r.NONE && (a = this.masked.nearestInputPos(a, r.NONE)), this.updateControl(a), delete this._inputEvent;
190
- }
191
- /** Handles view change event and commits model value */
192
- _onChange() {
193
- this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
194
- }
195
- /** Handles view drop event, prevents by default */
196
- _onDrop(t) {
197
- t.preventDefault(), t.stopPropagation();
198
- }
199
- /** Restore last selection on focus */
200
- _onFocus(t) {
201
- this.alignCursorFriendly();
202
- }
203
- /** Restore last selection on focus */
204
- _onClick(t) {
205
- this.alignCursorFriendly();
206
- }
207
- _onUndo() {
208
- this._applyHistoryState(this.history.undo());
209
- }
210
- _onRedo() {
211
- this._applyHistoryState(this.history.redo());
212
- }
213
- _applyHistoryState(t) {
214
- t && (this._historyChanging = !0, this.unmaskedValue = t.unmaskedValue, this.el.select(t.selection.start, t.selection.end), this._saveSelection(), this._historyChanging = !1);
215
- }
216
- /** Unbind view events and removes element reference */
217
- destroy() {
218
- this._unbindEvents(), this._listeners.length = 0, delete this.el;
219
- }
220
- }
221
- o.InputMask = c;
222
- export {
223
- c as default
224
- };
@@ -1,43 +0,0 @@
1
- import l from "../core/holder.js";
2
- class n {
3
- /** */
4
- /** */
5
- /** */
6
- /** Safely returns selection start */
7
- get selectionStart() {
8
- let t;
9
- try {
10
- t = this._unsafeSelectionStart;
11
- } catch {
12
- }
13
- return t ?? this.value.length;
14
- }
15
- /** Safely returns selection end */
16
- get selectionEnd() {
17
- let t;
18
- try {
19
- t = this._unsafeSelectionEnd;
20
- } catch {
21
- }
22
- return t ?? this.value.length;
23
- }
24
- /** Safely sets element selection */
25
- select(t, e) {
26
- if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
27
- try {
28
- this._unsafeSelect(t, e);
29
- } catch {
30
- }
31
- }
32
- /** */
33
- get isActive() {
34
- return !1;
35
- }
36
- /** */
37
- /** */
38
- /** */
39
- }
40
- l.MaskElement = n;
41
- export {
42
- n as default
43
- };
@@ -1,51 +0,0 @@
1
- import { DIRECTION as t } from "./utils.js";
2
- class o {
3
- /** Current input value */
4
- /** Current cursor position */
5
- /** Old input value */
6
- /** Old selection */
7
- constructor(s) {
8
- for (Object.assign(this, s); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
9
- --this.oldSelection.start;
10
- if (this.insertedCount)
11
- for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); )
12
- this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos;
13
- }
14
- /** Start changing position */
15
- get startChangePos() {
16
- return Math.min(this.cursorPos, this.oldSelection.start);
17
- }
18
- /** Inserted symbols count */
19
- get insertedCount() {
20
- return this.cursorPos - this.startChangePos;
21
- }
22
- /** Inserted symbols */
23
- get inserted() {
24
- return this.value.substr(this.startChangePos, this.insertedCount);
25
- }
26
- /** Removed symbols count */
27
- get removedCount() {
28
- return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
29
- this.oldValue.length - this.value.length, 0);
30
- }
31
- /** Removed symbols */
32
- get removed() {
33
- return this.oldValue.substr(this.startChangePos, this.removedCount);
34
- }
35
- /** Unchanged head symbols */
36
- get head() {
37
- return this.value.substring(0, this.startChangePos);
38
- }
39
- /** Unchanged tail symbols */
40
- get tail() {
41
- return this.value.substring(this.startChangePos + this.insertedCount);
42
- }
43
- /** Remove direction */
44
- get removeDirection() {
45
- return !this.removedCount || this.insertedCount ? t.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
46
- this.oldSelection.end === this.oldSelection.start ? t.RIGHT : t.LEFT;
47
- }
48
- }
49
- export {
50
- o as default
51
- };
@@ -1,36 +0,0 @@
1
- import i from "./holder.js";
2
- class s {
3
- /** Inserted symbols */
4
- /** Additional offset if any changes occurred before tail */
5
- /** Raw inserted is used by dynamic mask */
6
- /** Can skip chars */
7
- static normalize(t) {
8
- return Array.isArray(t) ? t : [t, new s()];
9
- }
10
- constructor(t) {
11
- Object.assign(this, {
12
- inserted: "",
13
- rawInserted: "",
14
- tailShift: 0,
15
- skip: !1
16
- }, t);
17
- }
18
- /** Aggregate changes */
19
- aggregate(t) {
20
- return this.inserted += t.inserted, this.rawInserted += t.rawInserted, this.tailShift += t.tailShift, this.skip = this.skip || t.skip, this;
21
- }
22
- /** Total offset considering all changes */
23
- get offset() {
24
- return this.tailShift + this.inserted.length;
25
- }
26
- get consumed() {
27
- return !!this.rawInserted || this.skip;
28
- }
29
- equals(t) {
30
- return this.inserted === t.inserted && this.tailShift === t.tailShift && this.rawInserted === t.rawInserted && this.skip === t.skip;
31
- }
32
- }
33
- i.ChangeDetails = s;
34
- export {
35
- s as default
36
- };
@@ -1,44 +0,0 @@
1
- class h {
2
- /** Tail value as string */
3
- /** Tail start position */
4
- /** Start position */
5
- constructor(t, i, s) {
6
- t === void 0 && (t = ""), i === void 0 && (i = 0), this.value = t, this.from = i, this.stop = s;
7
- }
8
- toString() {
9
- return this.value;
10
- }
11
- extend(t) {
12
- this.value += String(t);
13
- }
14
- appendTo(t) {
15
- return t.append(this.toString(), {
16
- tail: !0
17
- }).aggregate(t._appendPlaceholder());
18
- }
19
- get state() {
20
- return {
21
- value: this.value,
22
- from: this.from,
23
- stop: this.stop
24
- };
25
- }
26
- set state(t) {
27
- Object.assign(this, t);
28
- }
29
- unshift(t) {
30
- if (!this.value.length || t != null && this.from >= t)
31
- return "";
32
- const i = this.value[0];
33
- return this.value = this.value.slice(1), i;
34
- }
35
- shift() {
36
- if (!this.value.length)
37
- return "";
38
- const t = this.value[this.value.length - 1];
39
- return this.value = this.value.slice(0, -1), t;
40
- }
41
- }
42
- export {
43
- h as default
44
- };
@@ -1,6 +0,0 @@
1
- function a(n, t) {
2
- return new a.InputMask(n, t);
3
- }
4
- export {
5
- a as default
6
- };
@@ -1,80 +0,0 @@
1
- function p(e) {
2
- return typeof e == "string" || e instanceof String;
3
- }
4
- function E(e) {
5
- var t;
6
- return typeof e == "object" && e != null && (e == null || (t = e.constructor) == null ? void 0 : t.name) === "Object";
7
- }
8
- function a(e, t) {
9
- return Array.isArray(t) ? a(e, (n, i) => t.includes(i)) : Object.entries(e).reduce((n, i) => {
10
- let [r, f] = i;
11
- return t(f, r) && (n[r] = f), n;
12
- }, {});
13
- }
14
- const o = {
15
- NONE: "NONE",
16
- LEFT: "LEFT",
17
- FORCE_LEFT: "FORCE_LEFT",
18
- RIGHT: "RIGHT",
19
- FORCE_RIGHT: "FORCE_RIGHT"
20
- };
21
- function R(e) {
22
- switch (e) {
23
- case o.LEFT:
24
- return o.FORCE_LEFT;
25
- case o.RIGHT:
26
- return o.FORCE_RIGHT;
27
- default:
28
- return e;
29
- }
30
- }
31
- function O(e) {
32
- return e.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
33
- }
34
- function g(e, t) {
35
- if (t === e)
36
- return !0;
37
- const n = Array.isArray(t), i = Array.isArray(e);
38
- let r;
39
- if (n && i) {
40
- if (t.length != e.length)
41
- return !1;
42
- for (r = 0; r < t.length; r++)
43
- if (!g(t[r], e[r]))
44
- return !1;
45
- return !0;
46
- }
47
- if (n != i)
48
- return !1;
49
- if (t && e && typeof t == "object" && typeof e == "object") {
50
- const f = t instanceof Date, c = e instanceof Date;
51
- if (f && c)
52
- return t.getTime() == e.getTime();
53
- if (f != c)
54
- return !1;
55
- const s = t instanceof RegExp, l = e instanceof RegExp;
56
- if (s && l)
57
- return t.toString() == e.toString();
58
- if (s != l)
59
- return !1;
60
- const u = Object.keys(t);
61
- for (r = 0; r < u.length; r++)
62
- if (!Object.prototype.hasOwnProperty.call(e, u[r]))
63
- return !1;
64
- for (r = 0; r < u.length; r++)
65
- if (!g(e[u[r]], t[u[r]]))
66
- return !1;
67
- return !0;
68
- } else if (t && e && typeof t == "function" && typeof e == "function")
69
- return t.toString() === e.toString();
70
- return !1;
71
- }
72
- export {
73
- o as DIRECTION,
74
- O as escapeRegExp,
75
- R as forceDirection,
76
- E as isObject,
77
- p as isString,
78
- g as objectIncludes,
79
- a as pick
80
- };
@@ -1,50 +0,0 @@
1
- import { default as f } from "./controls/input.js";
2
- import e from "./core/holder.js";
3
- import { default as p } from "./controls/html-contenteditable-mask-element.js";
4
- import { default as d } from "./controls/html-input-mask-element.js";
5
- import { default as u } from "./controls/html-mask-element.js";
6
- import { default as n } from "./controls/mask-element.js";
7
- import { default as k } from "./core/change-details.js";
8
- import { default as E } from "./masked/base.js";
9
- import { default as I } from "./masked/date.js";
10
- import { default as T } from "./masked/dynamic.js";
11
- import { default as D } from "./masked/enum.js";
12
- import { default as h, normalizeOpts as H } from "./masked/factory.js";
13
- import { default as R } from "./masked/function.js";
14
- import { default as C } from "./masked/number.js";
15
- import { default as B } from "./masked/pattern.js";
16
- import { default as N } from "./masked/pattern/input-definition.js";
17
- import { PIPE_TYPE as Y, createPipe as _, pipe as j } from "./masked/pipe.js";
18
- import { default as v } from "./masked/range.js";
19
- import { default as A } from "./masked/regexp.js";
20
- import { default as J } from "./masked/repeat.js";
21
- import "./controls/input-history.js";
22
- try {
23
- globalThis.IMask = e;
24
- } catch {
25
- }
26
- export {
27
- k as ChangeDetails,
28
- p as HTMLContenteditableMaskElement,
29
- d as HTMLInputMaskElement,
30
- u as HTMLMaskElement,
31
- f as InputMask,
32
- n as MaskElement,
33
- E as Masked,
34
- I as MaskedDate,
35
- T as MaskedDynamic,
36
- D as MaskedEnum,
37
- R as MaskedFunction,
38
- C as MaskedNumber,
39
- B as MaskedPattern,
40
- v as MaskedRange,
41
- A as MaskedRegExp,
42
- Y as PIPE_TYPE,
43
- N as PatternInputDefinition,
44
- J as RepeatBlock,
45
- h as createMask,
46
- _ as createPipe,
47
- e as default,
48
- H as normalizeOpts,
49
- j as pipe
50
- };