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.
- package/dist/App.js +1 -1
- package/dist/Router.js +9 -9
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/bind.js +4 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/index3.js +4 -0
- package/dist/_virtual/react-is.development.js +4 -0
- package/dist/_virtual/react-is.production.min.js +4 -0
- package/dist/components/Button/ui/Button.js +44 -73
- package/dist/components/CheckBox/CheckBox.js +35 -46
- package/dist/components/CheckBoxNew/CheckBoxNew.js +19 -23
- package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +24 -31
- package/dist/components/DestinationTab/ui/DestinationTab.js +35 -48
- package/dist/components/FieldInput/ui/FieldInput.js +7 -10
- package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +61 -5
- package/dist/components/FilterWithSave/ui/FilterWithSave.js +266 -7
- package/dist/components/Flex/ui/Flex.js +26 -61
- package/dist/components/FormModal/ui/ModalForm.js +289 -14
- package/dist/components/GroupedInput/ui/GroupedInputs.js +5 -6
- package/dist/components/Input/ui/Input.js +74 -3307
- package/dist/components/Logo/ui/Logo.js +19 -31
- package/dist/components/Logo/ui/Logo.types.js +18 -10
- package/dist/components/LotCard/hooks/useLotCard.js +125 -11
- package/dist/components/LotCard/index.js +2 -2
- package/dist/components/LotCard/ui/LotCard.js +150 -9
- package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +31 -58
- package/dist/components/MetroLabel/ui/MetroLabel.js +19 -24
- package/dist/components/MetroTag/ui/MetroTag.js +59 -72
- package/dist/components/Modal/ui/Modal.js +33 -38
- package/dist/components/ModalSuccess/ModalSuccess.js +26 -35
- package/dist/components/NewIcon/icons/PinTrans.js +3 -3
- package/dist/components/NewIcon/icons/SmallFilter.js +1 -1
- package/dist/components/NewIcon/ui/NewIcon.js +141 -301
- package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +5 -15
- package/dist/components/RoundButton/ui/RoundButton.js +42 -60
- package/dist/components/Select/ui/Category.js +30 -29
- package/dist/components/Select/ui/Option.js +52 -5
- package/dist/components/Select/ui/Select.js +24 -23
- package/dist/components/SliderNavigation/ui/SliderNavigation.js +27 -28
- package/dist/components/SortSelect/hooks/useSortSelect.js +59 -4
- package/dist/components/SortSelect/index.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.js +114 -9
- package/dist/components/SummarySelect/ui/SummarySelect.js +59 -69
- package/dist/components/Switcher/ui/Switcher.js +13 -24
- package/dist/components/TabSelect/ui/TabSelect.js +28 -34
- package/dist/components/TabSwitcher/index.js +2 -2
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +84 -7
- package/dist/components/Tag/ui/Tag.js +19 -67
- package/dist/components/Text/ui/Text.js +12 -13
- package/dist/components/TextArea/TextArea.js +11 -14
- package/dist/components/ZoomControls/ui/ZoomControls.js +8 -11
- package/dist/components/mobileButton/ui/MobileButton.js +34 -39
- package/dist/layout/Layout.js +7 -8
- package/dist/layout/components/Header/Header.js +41 -44
- package/dist/layout/components/Menu.js +111 -6
- package/dist/main.js +46 -42
- package/dist/node_modules/@remix-run/router/dist/router.js +431 -0
- package/dist/node_modules/classnames/bind.js +42 -0
- package/dist/{index-rKuIKazb.js → node_modules/classnames/index.js} +12 -15
- package/dist/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +35 -0
- package/dist/node_modules/imask/esm/controls/html-input-mask-element.js +31 -0
- package/dist/node_modules/imask/esm/controls/html-mask-element.js +48 -0
- package/dist/node_modules/imask/esm/controls/input-history.js +30 -0
- package/dist/node_modules/imask/esm/controls/input.js +224 -0
- package/dist/node_modules/imask/esm/controls/mask-element.js +43 -0
- package/dist/node_modules/imask/esm/core/action-details.js +51 -0
- package/dist/node_modules/imask/esm/core/change-details.js +36 -0
- package/dist/node_modules/imask/esm/core/continuous-tail-details.js +44 -0
- package/dist/node_modules/imask/esm/core/holder.js +6 -0
- package/dist/node_modules/imask/esm/core/utils.js +80 -0
- package/dist/node_modules/imask/esm/index.js +50 -0
- package/dist/node_modules/imask/esm/masked/base.js +257 -0
- package/dist/node_modules/imask/esm/masked/date.js +118 -0
- package/dist/node_modules/imask/esm/masked/dynamic.js +224 -0
- package/dist/node_modules/imask/esm/masked/enum.js +70 -0
- package/dist/node_modules/imask/esm/masked/factory.js +51 -0
- package/dist/node_modules/imask/esm/masked/function.js +23 -0
- package/dist/node_modules/imask/esm/masked/number.js +215 -0
- package/dist/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +110 -0
- package/dist/node_modules/imask/esm/masked/pattern/cursor.js +102 -0
- package/dist/node_modules/imask/esm/masked/pattern/fixed-definition.js +103 -0
- package/dist/node_modules/imask/esm/masked/pattern/input-definition.js +134 -0
- package/dist/node_modules/imask/esm/masked/pattern.js +339 -0
- package/dist/node_modules/imask/esm/masked/pipe.js +23 -0
- package/dist/node_modules/imask/esm/masked/range.js +82 -0
- package/dist/node_modules/imask/esm/masked/regexp.js +21 -0
- package/dist/node_modules/imask/esm/masked/repeat.js +106 -0
- package/dist/node_modules/object-assign/index.js +55 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +55 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +53 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +330 -0
- package/dist/node_modules/prop-types/index.js +15 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +11 -0
- package/dist/node_modules/prop-types/lib/has.js +7 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +95 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +79 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
- package/dist/node_modules/react-hook-form/dist/index.esm.js +1062 -0
- package/dist/node_modules/react-imask/esm/input.js +25 -0
- package/dist/node_modules/react-imask/esm/mixin.js +131 -0
- package/dist/node_modules/react-router/dist/index.js +486 -0
- package/dist/node_modules/react-router-dom/dist/index.js +424 -0
- package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +1 -1
- package/dist/pages/ButtonsPage/Buttons.js +54 -62
- package/dist/pages/CheckboxPage/CheckboxPage.js +47 -51
- package/dist/pages/FormsPage/FormsPage.js +31 -32
- package/dist/pages/HomePage/HomePage.js +3 -4
- package/dist/pages/IconsPage/IconsPage.js +12 -10
- package/dist/pages/InputPage/InputPage.js +17 -12
- package/dist/pages/LogoPage/LogoPage.js +17 -14
- package/dist/pages/LotsPage/LotsPage.js +15 -15
- package/dist/pages/ModalsPage/ModalPage.js +19 -14
- package/dist/pages/SelectPage/SelectPage.js +42 -41
- package/dist/pages/TabsPage/TabsPage.js +49 -51
- package/dist/pages/TagsPage/TagsPage.js +10 -7
- package/dist/src/components/Button/ui/Button.module.scss.js +49 -0
- package/dist/src/components/CheckBox/s.module.scss.js +24 -0
- package/dist/src/components/CheckBoxNew/s.module.scss.js +13 -0
- package/dist/src/components/CheckboxSelect/ui/s.module.scss.js +19 -0
- package/dist/src/components/DestinationTab/ui/DestinationTab.module.scss.js +23 -0
- package/dist/src/components/FieldInput/ui/FieldInput.module.scss.js +11 -0
- package/dist/src/components/FilterWithSave/ui/s.module.scss.js +39 -0
- package/dist/src/components/Flex/ui/Flex.module.scss.js +41 -0
- package/dist/src/components/FormModal/ui/ModalForm.module.scss.js +31 -0
- package/dist/src/components/GroupedInput/ui/GroupedInputs.module.scss.js +7 -0
- package/dist/src/components/Input/ui/Input.module.scss.js +43 -0
- package/dist/src/components/Logo/assets/LogoBlack.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoDom.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoNewDom.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoNewOffice.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoOffice.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoRealty.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoValue.svg.js +4 -0
- package/dist/src/components/Logo/assets/LogoWhite.svg.js +4 -0
- package/dist/src/components/Logo/ui/Logo.module.scss.js +29 -0
- package/dist/src/components/LotCard/assets/testLot.webp.js +4 -0
- package/dist/src/components/LotCard/ui/LotCard.module.scss.js +71 -0
- package/dist/src/components/LotCardSkeleton/ui/LotCardSkeleton.module.scss.js +59 -0
- package/dist/src/components/MetroLabel/ui/MetroLabel.module.scss.js +15 -0
- package/dist/src/components/MetroTag/ui/MetroTag.module.scss.js +31 -0
- package/dist/src/components/Modal/ui/Modal.module.scss.js +15 -0
- package/dist/src/components/ModalSuccess/styles.module.scss.js +23 -0
- package/dist/src/components/NewIcon/assets/ArrowLong.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/ArrowShort.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Auto.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Building.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Burger.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/BurgerClose.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Call.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Callback.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Case.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Check.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Circle.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Close.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/DirectionDown.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Download.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Filter.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Food.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Fullscreen.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Heart.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Layers.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/LayersFilled.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Loader.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Lock.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Metro.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Minus.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/MinusCheck.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Moon.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Park.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Pedestrian.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Phone.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/PhoneFilled.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Pin.svg.js +10 -0
- package/dist/{PinTrans-D6OZq76b.js → src/components/NewIcon/assets/PinTrans.svg.js} +4 -4
- package/dist/src/components/NewIcon/assets/Play.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Play2.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Plus.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Redo.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Ruble.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Search.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/SelectChecked.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/SelectUnchecked.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Share.svg.js +10 -0
- package/dist/{SmallFilter-C-VKnbkP.js → src/components/NewIcon/assets/SmallFilter.svg.js} +3 -3
- package/dist/src/components/NewIcon/assets/Sport.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/SquareMeter.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Star.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/StarFilled.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Sun.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Telegram.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/Timer.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/TwoArrows.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/User.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/WhatsApp.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/WithoutDecor.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/arrowRight.svg.js +10 -0
- package/dist/src/components/NewIcon/assets/mail.svg.js +10 -0
- package/dist/src/components/NewIcon/ui/NewIcon.module.scss.js +4 -0
- package/dist/src/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.module.scss.js +25 -0
- package/dist/src/components/RoundButton/ui/RoundButton.module.scss.js +29 -0
- package/dist/src/components/Select/ui/Select.module.scss.js +52 -0
- package/dist/src/components/SliderNavigation/ui/SliderNavigation.module.scss.js +7 -0
- package/dist/src/components/SortSelect/ui/SortSelect.module.scss.js +41 -0
- package/dist/src/components/SummarySelect/ui/SummarySelect.module.scss.js +25 -0
- package/dist/src/components/Switcher/ui/Switcher.module.scss.js +27 -0
- package/dist/src/components/TabSelect/ui/TabSelect.module.scss.js +17 -0
- package/dist/src/components/TabSwitcher/ui/TabSwitcher.module.scss.js +57 -0
- package/dist/src/components/Tag/ui/Tag.module.scss.js +70 -0
- package/dist/src/components/Text/ui/Text.module.scss.js +7 -0
- package/dist/src/components/TextArea/styles.module.scss.js +9 -0
- package/dist/src/components/ZoomControls/ui/ZoomControls.module.scss.js +11 -0
- package/dist/src/components/mobileButton/ui/MobileButton.module.scss.js +12 -0
- package/dist/src/layout/components/Header/s.module.scss.js +19 -0
- package/dist/src/layout/components/Menu.module.scss.js +9 -0
- package/dist/src/layout/style.module.scss.js +7 -0
- package/dist/src/pages/ButtonsPage/ButtonState/ButtonState.js +18 -0
- package/dist/{ButtonState.module-DtW3aevR.js → src/pages/ButtonsPage/ButtonState/ButtonState.module.scss.js} +4 -1
- package/dist/src/pages/ButtonsPage/ButtonsPage.module.scss.js +9 -0
- package/dist/src/pages/CheckboxPage/CheckboxPage.module.scss.js +13 -0
- package/dist/src/pages/FormsPage/FormsPage.module.scss.js +15 -0
- package/dist/src/pages/HomePage/HomePage.module.scss.js +7 -0
- package/dist/src/pages/IconsPage/IconsPage.module.scss.js +9 -0
- package/dist/src/pages/InputPage/InputPage.module.scss.js +4 -0
- package/dist/src/pages/LogoPage/LogoPage.module.scss.js +7 -0
- package/dist/src/pages/LotsPage/LotsPage.module.scss.js +13 -0
- package/dist/src/pages/ModalsPage/ModalPage.module.scss.js +4 -0
- package/dist/src/pages/SelectPage/SelectPage.module.scss.js +11 -0
- package/dist/src/pages/TabsPage/TabsPage.module.scss.js +17 -0
- package/dist/src/pages/TagsPage/TagsPage.module.scss.js +7 -0
- package/dist/src/stories/button.css.js +1 -0
- package/dist/src/stories/header.css.js +1 -0
- package/dist/src/stories/page.css.js +1 -0
- package/dist/stories/Button.js +24 -0
- package/dist/stories/Header.js +45 -0
- package/dist/stories/Page.js +59 -0
- package/dist/style.css +1 -1
- package/package.json +11 -6
- package/dist/FilterWithSave-Bp6rH8Pe.js +0 -2230
- package/dist/Menu-CgCfinVZ.js +0 -513
- package/dist/Option-BVIm7wOW.js +0 -83
- package/dist/index-DmANy9jd.js +0 -890
- package/dist/useSortSelect-CjZXLFOG.js +0 -80
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import e from "./html-mask-element.js";
|
|
2
|
+
import s from "../core/holder.js";
|
|
3
|
+
import "./mask-element.js";
|
|
4
|
+
class r extends e {
|
|
5
|
+
/** InputElement to use mask on */
|
|
6
|
+
constructor(t) {
|
|
7
|
+
super(t), this.input = t;
|
|
8
|
+
}
|
|
9
|
+
/** Returns InputElement selection start */
|
|
10
|
+
get _unsafeSelectionStart() {
|
|
11
|
+
return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
|
|
12
|
+
}
|
|
13
|
+
/** Returns InputElement selection end */
|
|
14
|
+
get _unsafeSelectionEnd() {
|
|
15
|
+
return this.input.selectionEnd;
|
|
16
|
+
}
|
|
17
|
+
/** Sets InputElement selection */
|
|
18
|
+
_unsafeSelect(t, n) {
|
|
19
|
+
this.input.setSelectionRange(t, n);
|
|
20
|
+
}
|
|
21
|
+
get value() {
|
|
22
|
+
return this.input.value;
|
|
23
|
+
}
|
|
24
|
+
set value(t) {
|
|
25
|
+
this.input.value = t;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
s.HTMLMaskElement = e;
|
|
29
|
+
export {
|
|
30
|
+
r as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import s from "./mask-element.js";
|
|
2
|
+
import o from "../core/holder.js";
|
|
3
|
+
const e = 90, r = 89;
|
|
4
|
+
class h extends s {
|
|
5
|
+
/** HTMLElement to use mask on */
|
|
6
|
+
constructor(t) {
|
|
7
|
+
super(), this.input = t, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this);
|
|
8
|
+
}
|
|
9
|
+
get rootElement() {
|
|
10
|
+
var t, n, i;
|
|
11
|
+
return (t = (n = (i = this.input).getRootNode) == null ? void 0 : n.call(i)) != null ? t : document;
|
|
12
|
+
}
|
|
13
|
+
/** Is element in focus */
|
|
14
|
+
get isActive() {
|
|
15
|
+
return this.input === this.rootElement.activeElement;
|
|
16
|
+
}
|
|
17
|
+
/** Binds HTMLElement events to mask internal events */
|
|
18
|
+
bindEvents(t) {
|
|
19
|
+
this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", t.drop), this.input.addEventListener("click", t.click), this.input.addEventListener("focus", t.focus), this.input.addEventListener("blur", t.commit), this._handlers = t;
|
|
20
|
+
}
|
|
21
|
+
_onKeydown(t) {
|
|
22
|
+
if (this._handlers.redo && (t.keyCode === e && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === r && t.ctrlKey))
|
|
23
|
+
return t.preventDefault(), this._handlers.redo(t);
|
|
24
|
+
if (this._handlers.undo && t.keyCode === e && (t.metaKey || t.ctrlKey))
|
|
25
|
+
return t.preventDefault(), this._handlers.undo(t);
|
|
26
|
+
t.isComposing || this._handlers.selectionChange(t);
|
|
27
|
+
}
|
|
28
|
+
_onBeforeinput(t) {
|
|
29
|
+
if (t.inputType === "historyUndo" && this._handlers.undo)
|
|
30
|
+
return t.preventDefault(), this._handlers.undo(t);
|
|
31
|
+
if (t.inputType === "historyRedo" && this._handlers.redo)
|
|
32
|
+
return t.preventDefault(), this._handlers.redo(t);
|
|
33
|
+
}
|
|
34
|
+
_onCompositionEnd(t) {
|
|
35
|
+
this._handlers.input(t);
|
|
36
|
+
}
|
|
37
|
+
_onInput(t) {
|
|
38
|
+
t.isComposing || this._handlers.input(t);
|
|
39
|
+
}
|
|
40
|
+
/** Unbinds HTMLElement events to mask internal events */
|
|
41
|
+
unbindEvents() {
|
|
42
|
+
this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
o.HTMLMaskElement = h;
|
|
46
|
+
export {
|
|
47
|
+
h as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
class s {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.states = [], this.currentIndex = 0;
|
|
4
|
+
}
|
|
5
|
+
get currentState() {
|
|
6
|
+
return this.states[this.currentIndex];
|
|
7
|
+
}
|
|
8
|
+
get isEmpty() {
|
|
9
|
+
return this.states.length === 0;
|
|
10
|
+
}
|
|
11
|
+
push(t) {
|
|
12
|
+
this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(t), this.states.length > s.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1;
|
|
13
|
+
}
|
|
14
|
+
go(t) {
|
|
15
|
+
return this.currentIndex = Math.min(Math.max(this.currentIndex + t, 0), this.states.length - 1), this.currentState;
|
|
16
|
+
}
|
|
17
|
+
undo() {
|
|
18
|
+
return this.go(-1);
|
|
19
|
+
}
|
|
20
|
+
redo() {
|
|
21
|
+
return this.go(1);
|
|
22
|
+
}
|
|
23
|
+
clear() {
|
|
24
|
+
this.states.length = 0, this.currentIndex = 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
s.MAX_LENGTH = 100;
|
|
28
|
+
export {
|
|
29
|
+
s as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
};
|