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