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.
- package/dist/App.js +1 -1
- package/dist/{src/pages/ButtonsPage/ButtonState/ButtonState.module.scss.js → ButtonState.module-DtW3aevR.js} +1 -4
- package/dist/FilterWithSave-Bp6rH8Pe.js +2230 -0
- package/dist/Menu-CgCfinVZ.js +513 -0
- package/dist/Option-BVIm7wOW.js +83 -0
- package/dist/{src/components/NewIcon/assets/PinTrans.svg.js → PinTrans-D6OZq76b.js} +4 -4
- package/dist/Router.js +9 -9
- package/dist/{src/components/NewIcon/assets/SmallFilter.svg.js → SmallFilter-C-VKnbkP.js} +3 -3
- package/dist/components/Button/ui/Button.js +73 -44
- package/dist/components/CheckBox/CheckBox.js +46 -35
- package/dist/components/CheckBoxNew/CheckBoxNew.js +23 -19
- package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +31 -24
- package/dist/components/DestinationTab/ui/DestinationTab.js +48 -35
- package/dist/components/FieldInput/ui/FieldInput.js +10 -7
- package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +5 -61
- package/dist/components/FilterWithSave/ui/FilterWithSave.js +7 -266
- package/dist/components/Flex/ui/Flex.js +61 -26
- package/dist/components/FormModal/ui/ModalForm.js +14 -289
- package/dist/components/GroupedInput/ui/GroupedInputs.js +6 -5
- package/dist/components/Input/ui/Input.js +3307 -74
- package/dist/components/Logo/ui/Logo.js +31 -19
- package/dist/components/Logo/ui/Logo.types.js +10 -18
- package/dist/components/LotCard/hooks/useLotCard.js +11 -125
- package/dist/components/LotCard/index.js +2 -2
- package/dist/components/LotCard/ui/LotCard.js +9 -150
- package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +58 -31
- package/dist/components/MetroLabel/ui/MetroLabel.js +24 -19
- package/dist/components/MetroTag/ui/MetroTag.js +72 -59
- package/dist/components/Modal/ui/Modal.js +38 -33
- package/dist/components/ModalSuccess/ModalSuccess.js +35 -26
- 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 +301 -141
- package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +15 -5
- package/dist/components/RoundButton/ui/RoundButton.js +60 -42
- package/dist/components/Select/ui/Category.js +29 -30
- package/dist/components/Select/ui/Option.js +5 -52
- package/dist/components/Select/ui/Select.js +23 -24
- package/dist/components/SliderNavigation/ui/SliderNavigation.js +28 -27
- package/dist/components/SortSelect/hooks/useSortSelect.js +4 -59
- package/dist/components/SortSelect/index.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.js +9 -114
- package/dist/components/SummarySelect/ui/SummarySelect.js +69 -59
- package/dist/components/Switcher/ui/Switcher.js +24 -13
- package/dist/components/TabSelect/ui/TabSelect.js +34 -28
- package/dist/components/TabSwitcher/index.js +2 -2
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +7 -84
- package/dist/components/Tag/ui/Tag.js +67 -19
- package/dist/components/Text/ui/Text.js +13 -12
- package/dist/components/TextArea/TextArea.js +14 -11
- package/dist/components/ZoomControls/ui/ZoomControls.js +11 -8
- package/dist/components/mobileButton/ui/MobileButton.js +39 -34
- package/dist/index-DmANy9jd.js +890 -0
- package/dist/{node_modules/classnames/index.js → index-rKuIKazb.js} +15 -12
- package/dist/layout/Layout.js +8 -7
- package/dist/layout/components/Header/Header.js +44 -41
- package/dist/layout/components/Menu.js +6 -111
- package/dist/main.js +42 -46
- package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +1 -1
- package/dist/pages/ButtonsPage/Buttons.js +62 -54
- package/dist/pages/CheckboxPage/CheckboxPage.js +51 -47
- package/dist/pages/FormsPage/FormsPage.js +32 -31
- package/dist/pages/HomePage/HomePage.js +4 -3
- package/dist/pages/IconsPage/IconsPage.js +10 -12
- package/dist/pages/InputPage/InputPage.js +12 -17
- package/dist/pages/LogoPage/LogoPage.js +14 -17
- package/dist/pages/LotsPage/LotsPage.js +15 -15
- package/dist/pages/ModalsPage/ModalPage.js +14 -19
- package/dist/pages/SelectPage/SelectPage.js +41 -42
- package/dist/pages/TabsPage/TabsPage.js +51 -49
- package/dist/pages/TagsPage/TagsPage.js +7 -10
- package/dist/stories/Button.js +4 -5
- package/dist/stories/Header.js +3 -4
- package/dist/stories/Page.js +2 -3
- package/dist/style.css +1 -1
- package/dist/useSortSelect-CjZXLFOG.js +80 -0
- package/package.json +4 -3
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/_virtual/bind.js +0 -4
- package/dist/_virtual/index.js +0 -4
- package/dist/_virtual/index2.js +0 -4
- package/dist/_virtual/index3.js +0 -4
- package/dist/_virtual/react-is.development.js +0 -4
- package/dist/_virtual/react-is.production.min.js +0 -4
- package/dist/node_modules/@remix-run/router/dist/router.js +0 -431
- package/dist/node_modules/classnames/bind.js +0 -42
- package/dist/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -35
- package/dist/node_modules/imask/esm/controls/html-input-mask-element.js +0 -31
- package/dist/node_modules/imask/esm/controls/html-mask-element.js +0 -48
- package/dist/node_modules/imask/esm/controls/input-history.js +0 -30
- package/dist/node_modules/imask/esm/controls/input.js +0 -224
- package/dist/node_modules/imask/esm/controls/mask-element.js +0 -43
- package/dist/node_modules/imask/esm/core/action-details.js +0 -51
- package/dist/node_modules/imask/esm/core/change-details.js +0 -36
- package/dist/node_modules/imask/esm/core/continuous-tail-details.js +0 -44
- package/dist/node_modules/imask/esm/core/holder.js +0 -6
- package/dist/node_modules/imask/esm/core/utils.js +0 -80
- package/dist/node_modules/imask/esm/index.js +0 -50
- package/dist/node_modules/imask/esm/masked/base.js +0 -257
- package/dist/node_modules/imask/esm/masked/date.js +0 -118
- package/dist/node_modules/imask/esm/masked/dynamic.js +0 -224
- package/dist/node_modules/imask/esm/masked/enum.js +0 -70
- package/dist/node_modules/imask/esm/masked/factory.js +0 -51
- package/dist/node_modules/imask/esm/masked/function.js +0 -23
- package/dist/node_modules/imask/esm/masked/number.js +0 -215
- package/dist/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -110
- package/dist/node_modules/imask/esm/masked/pattern/cursor.js +0 -102
- package/dist/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -103
- package/dist/node_modules/imask/esm/masked/pattern/input-definition.js +0 -134
- package/dist/node_modules/imask/esm/masked/pattern.js +0 -339
- package/dist/node_modules/imask/esm/masked/pipe.js +0 -23
- package/dist/node_modules/imask/esm/masked/range.js +0 -82
- package/dist/node_modules/imask/esm/masked/regexp.js +0 -21
- package/dist/node_modules/imask/esm/masked/repeat.js +0 -106
- package/dist/node_modules/object-assign/index.js +0 -55
- package/dist/node_modules/prop-types/checkPropTypes.js +0 -55
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -53
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -330
- package/dist/node_modules/prop-types/index.js +0 -15
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -11
- package/dist/node_modules/prop-types/lib/has.js +0 -7
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -95
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -79
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -10
- package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -1062
- package/dist/node_modules/react-imask/esm/input.js +0 -25
- package/dist/node_modules/react-imask/esm/mixin.js +0 -131
- package/dist/node_modules/react-router/dist/index.js +0 -486
- package/dist/node_modules/react-router-dom/dist/index.js +0 -424
- package/dist/src/components/Button/ui/Button.module.scss.js +0 -49
- package/dist/src/components/CheckBox/s.module.scss.js +0 -24
- package/dist/src/components/CheckBoxNew/s.module.scss.js +0 -13
- package/dist/src/components/CheckboxSelect/ui/s.module.scss.js +0 -19
- package/dist/src/components/DestinationTab/ui/DestinationTab.module.scss.js +0 -23
- package/dist/src/components/FieldInput/ui/FieldInput.module.scss.js +0 -11
- package/dist/src/components/FilterWithSave/ui/s.module.scss.js +0 -39
- package/dist/src/components/Flex/ui/Flex.module.scss.js +0 -41
- package/dist/src/components/FormModal/ui/ModalForm.module.scss.js +0 -31
- package/dist/src/components/GroupedInput/ui/GroupedInputs.module.scss.js +0 -7
- package/dist/src/components/Input/ui/Input.module.scss.js +0 -43
- package/dist/src/components/Logo/assets/LogoBlack.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoDom.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoNewDom.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoNewOffice.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoOffice.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoRealty.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoValue.svg.js +0 -4
- package/dist/src/components/Logo/assets/LogoWhite.svg.js +0 -4
- package/dist/src/components/Logo/ui/Logo.module.scss.js +0 -29
- package/dist/src/components/LotCard/assets/testLot.webp.js +0 -4
- package/dist/src/components/LotCard/ui/LotCard.module.scss.js +0 -71
- package/dist/src/components/LotCardSkeleton/ui/LotCardSkeleton.module.scss.js +0 -59
- package/dist/src/components/MetroLabel/ui/MetroLabel.module.scss.js +0 -15
- package/dist/src/components/MetroTag/ui/MetroTag.module.scss.js +0 -31
- package/dist/src/components/Modal/ui/Modal.module.scss.js +0 -15
- package/dist/src/components/ModalSuccess/styles.module.scss.js +0 -23
- package/dist/src/components/NewIcon/assets/ArrowLong.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/ArrowShort.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Auto.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Building.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Burger.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/BurgerClose.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Call.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Callback.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Case.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Check.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Circle.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Close.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/DirectionDown.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Download.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Filter.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Food.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Fullscreen.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Heart.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Layers.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/LayersFilled.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Loader.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Lock.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Metro.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Minus.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/MinusCheck.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Moon.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Park.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Pedestrian.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Phone.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/PhoneFilled.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Pin.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Play.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Play2.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Plus.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Redo.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Ruble.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Search.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/SelectChecked.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/SelectUnchecked.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Share.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Sport.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/SquareMeter.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Star.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/StarFilled.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Sun.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Telegram.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/Timer.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/TwoArrows.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/User.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/WhatsApp.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/WithoutDecor.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/arrowRight.svg.js +0 -10
- package/dist/src/components/NewIcon/assets/mail.svg.js +0 -10
- package/dist/src/components/NewIcon/ui/NewIcon.module.scss.js +0 -4
- package/dist/src/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.module.scss.js +0 -25
- package/dist/src/components/RoundButton/ui/RoundButton.module.scss.js +0 -29
- package/dist/src/components/Select/ui/Select.module.scss.js +0 -52
- package/dist/src/components/SliderNavigation/ui/SliderNavigation.module.scss.js +0 -7
- package/dist/src/components/SortSelect/ui/SortSelect.module.scss.js +0 -41
- package/dist/src/components/SummarySelect/ui/SummarySelect.module.scss.js +0 -25
- package/dist/src/components/Switcher/ui/Switcher.module.scss.js +0 -27
- package/dist/src/components/TabSelect/ui/TabSelect.module.scss.js +0 -17
- package/dist/src/components/TabSwitcher/ui/TabSwitcher.module.scss.js +0 -57
- package/dist/src/components/Tag/ui/Tag.module.scss.js +0 -70
- package/dist/src/components/Text/ui/Text.module.scss.js +0 -7
- package/dist/src/components/TextArea/styles.module.scss.js +0 -9
- package/dist/src/components/ZoomControls/ui/ZoomControls.module.scss.js +0 -11
- package/dist/src/components/mobileButton/ui/MobileButton.module.scss.js +0 -12
- package/dist/src/layout/components/Header/s.module.scss.js +0 -19
- package/dist/src/layout/components/Menu.module.scss.js +0 -9
- package/dist/src/layout/style.module.scss.js +0 -7
- package/dist/src/pages/ButtonsPage/ButtonState/ButtonState.js +0 -18
- package/dist/src/pages/ButtonsPage/ButtonsPage.module.scss.js +0 -9
- package/dist/src/pages/CheckboxPage/CheckboxPage.module.scss.js +0 -13
- package/dist/src/pages/FormsPage/FormsPage.module.scss.js +0 -15
- package/dist/src/pages/HomePage/HomePage.module.scss.js +0 -7
- package/dist/src/pages/IconsPage/IconsPage.module.scss.js +0 -9
- package/dist/src/pages/InputPage/InputPage.module.scss.js +0 -4
- package/dist/src/pages/LogoPage/LogoPage.module.scss.js +0 -7
- package/dist/src/pages/LotsPage/LotsPage.module.scss.js +0 -13
- package/dist/src/pages/ModalsPage/ModalPage.module.scss.js +0 -4
- package/dist/src/pages/SelectPage/SelectPage.module.scss.js +0 -11
- package/dist/src/pages/TabsPage/TabsPage.module.scss.js +0 -17
- package/dist/src/pages/TagsPage/TagsPage.module.scss.js +0 -7
- package/dist/src/stories/button.css.js +0 -1
- package/dist/src/stories/header.css.js +0 -1
- package/dist/src/stories/page.css.js +0 -1
|
@@ -1,257 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,224 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
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
|
-
};
|