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,51 @@
|
|
|
1
|
+
import { isObject as t, pick as o, isString as f } from "../core/utils.js";
|
|
2
|
+
import r from "../core/holder.js";
|
|
3
|
+
function d(e) {
|
|
4
|
+
if (e == null)
|
|
5
|
+
throw new Error("mask property should be defined");
|
|
6
|
+
return e instanceof RegExp ? r.MaskedRegExp : f(e) ? r.MaskedPattern : e === Date ? r.MaskedDate : e === Number ? r.MaskedNumber : Array.isArray(e) || e === Array ? r.MaskedDynamic : r.Masked && e.prototype instanceof r.Masked ? e : r.Masked && e instanceof r.Masked ? e.constructor : e instanceof Function ? r.MaskedFunction : (console.warn("Mask not found for mask", e), r.Masked);
|
|
7
|
+
}
|
|
8
|
+
function k(e) {
|
|
9
|
+
if (!e)
|
|
10
|
+
throw new Error("Options in not defined");
|
|
11
|
+
if (r.Masked) {
|
|
12
|
+
if (e.prototype instanceof r.Masked)
|
|
13
|
+
return {
|
|
14
|
+
mask: e
|
|
15
|
+
};
|
|
16
|
+
const {
|
|
17
|
+
mask: n = void 0,
|
|
18
|
+
...a
|
|
19
|
+
} = e instanceof r.Masked ? {
|
|
20
|
+
mask: e
|
|
21
|
+
} : t(e) && e.mask instanceof r.Masked ? e : {};
|
|
22
|
+
if (n) {
|
|
23
|
+
const s = n.mask;
|
|
24
|
+
return {
|
|
25
|
+
...o(n, (c, i) => !i.startsWith("_")),
|
|
26
|
+
mask: n.constructor,
|
|
27
|
+
_mask: s,
|
|
28
|
+
...a
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return t(e) ? {
|
|
33
|
+
...e
|
|
34
|
+
} : {
|
|
35
|
+
mask: e
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function u(e) {
|
|
39
|
+
if (r.Masked && e instanceof r.Masked)
|
|
40
|
+
return e;
|
|
41
|
+
const n = k(e), a = d(n.mask);
|
|
42
|
+
if (!a)
|
|
43
|
+
throw new Error("Masked class is not found for provided mask " + n.mask + ", appropriate module needs to be imported manually before creating mask.");
|
|
44
|
+
return n.mask === a && delete n.mask, n._mask && (n.mask = n._mask, delete n._mask), new a(n);
|
|
45
|
+
}
|
|
46
|
+
r.createMask = u;
|
|
47
|
+
export {
|
|
48
|
+
u as default,
|
|
49
|
+
d as maskedClass,
|
|
50
|
+
k as normalizeOpts
|
|
51
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import e from "./base.js";
|
|
2
|
+
import t from "../core/holder.js";
|
|
3
|
+
import "../core/change-details.js";
|
|
4
|
+
class s extends e {
|
|
5
|
+
/** */
|
|
6
|
+
/** Enable characters overwriting */
|
|
7
|
+
/** */
|
|
8
|
+
/** */
|
|
9
|
+
/** */
|
|
10
|
+
updateOptions(a) {
|
|
11
|
+
super.updateOptions(a);
|
|
12
|
+
}
|
|
13
|
+
_update(a) {
|
|
14
|
+
super._update({
|
|
15
|
+
...a,
|
|
16
|
+
validate: a.mask
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
t.MaskedFunction = s;
|
|
21
|
+
export {
|
|
22
|
+
s as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { escapeRegExp as d, DIRECTION as n } from "../core/utils.js";
|
|
2
|
+
import m from "../core/change-details.js";
|
|
3
|
+
import _ from "./base.js";
|
|
4
|
+
import x from "../core/holder.js";
|
|
5
|
+
var S;
|
|
6
|
+
class i extends _ {
|
|
7
|
+
/** Single char */
|
|
8
|
+
/** Single char */
|
|
9
|
+
/** Array of single chars */
|
|
10
|
+
/** */
|
|
11
|
+
/** */
|
|
12
|
+
/** Digits after point */
|
|
13
|
+
/** Flag to remove leading and trailing zeros in the end of editing */
|
|
14
|
+
/** Flag to pad trailing zeros after point in the end of editing */
|
|
15
|
+
/** Enable characters overwriting */
|
|
16
|
+
/** */
|
|
17
|
+
/** */
|
|
18
|
+
/** */
|
|
19
|
+
/** Format typed value to string */
|
|
20
|
+
/** Parse string to get typed value */
|
|
21
|
+
constructor(e) {
|
|
22
|
+
super({
|
|
23
|
+
...i.DEFAULTS,
|
|
24
|
+
...e
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
updateOptions(e) {
|
|
28
|
+
super.updateOptions(e);
|
|
29
|
+
}
|
|
30
|
+
_update(e) {
|
|
31
|
+
super._update(e), this._updateRegExps();
|
|
32
|
+
}
|
|
33
|
+
_updateRegExps() {
|
|
34
|
+
const e = "^" + (this.allowNegative ? "[+|\\-]?" : ""), t = "\\d*", a = (this.scale ? "(" + d(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
|
|
35
|
+
this._numberRegExp = new RegExp(e + t + a), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map(d).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp(d(this.thousandsSeparator), "g");
|
|
36
|
+
}
|
|
37
|
+
_removeThousandsSeparators(e) {
|
|
38
|
+
return e.replace(this._thousandsSeparatorRegExp, "");
|
|
39
|
+
}
|
|
40
|
+
_insertThousandsSeparators(e) {
|
|
41
|
+
const t = e.split(this.radix);
|
|
42
|
+
return t[0] = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), t.join(this.radix);
|
|
43
|
+
}
|
|
44
|
+
doPrepareChar(e, t) {
|
|
45
|
+
t === void 0 && (t = {});
|
|
46
|
+
const [a, s] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
|
|
47
|
+
radix should be mapped when
|
|
48
|
+
1) input is done from keyboard = flags.input && flags.raw
|
|
49
|
+
2) unmasked value is set = !flags.input && !flags.raw
|
|
50
|
+
and should not be mapped when
|
|
51
|
+
1) value is set = flags.input && !flags.raw
|
|
52
|
+
2) raw value is set = !flags.input && flags.raw
|
|
53
|
+
*/
|
|
54
|
+
(t.input && t.raw || !t.input && !t.raw) ? e.replace(this._mapToRadixRegExp, this.radix) : e), t);
|
|
55
|
+
return e && !a && (s.skip = !0), a && !this.allowPositive && !this.value && a !== "-" && s.aggregate(this._appendChar("-")), [a, s];
|
|
56
|
+
}
|
|
57
|
+
_separatorsCount(e, t) {
|
|
58
|
+
t === void 0 && (t = !1);
|
|
59
|
+
let a = 0;
|
|
60
|
+
for (let s = 0; s < e; ++s)
|
|
61
|
+
this._value.indexOf(this.thousandsSeparator, s) === s && (++a, t && (e += this.thousandsSeparator.length));
|
|
62
|
+
return a;
|
|
63
|
+
}
|
|
64
|
+
_separatorsCountFromSlice(e) {
|
|
65
|
+
return e === void 0 && (e = this._value), this._separatorsCount(this._removeThousandsSeparators(e).length, !0);
|
|
66
|
+
}
|
|
67
|
+
extractInput(e, t, a) {
|
|
68
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), [e, t] = this._adjustRangeWithSeparators(e, t), this._removeThousandsSeparators(super.extractInput(e, t, a));
|
|
69
|
+
}
|
|
70
|
+
_appendCharRaw(e, t) {
|
|
71
|
+
t === void 0 && (t = {});
|
|
72
|
+
const a = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value, s = this._separatorsCountFromSlice(a);
|
|
73
|
+
this._value = this._removeThousandsSeparators(this.value);
|
|
74
|
+
const r = this._value;
|
|
75
|
+
this._value += e;
|
|
76
|
+
const h = this.number;
|
|
77
|
+
let o = !isNaN(h), u = !1;
|
|
78
|
+
if (o) {
|
|
79
|
+
let p;
|
|
80
|
+
this.min != null && this.min < 0 && this.number < this.min && (p = this.min), this.max != null && this.max > 0 && this.number > this.max && (p = this.max), p != null && (this.autofix ? (this._value = this.format(p, this).replace(i.UNMASKED_RADIX, this.radix), u || (u = r === this._value && !t.tail)) : o = !1), o && (o = !!this._value.match(this._numberRegExp));
|
|
81
|
+
}
|
|
82
|
+
let l;
|
|
83
|
+
o ? l = new m({
|
|
84
|
+
inserted: this._value.slice(r.length),
|
|
85
|
+
rawInserted: u ? "" : e,
|
|
86
|
+
skip: u
|
|
87
|
+
}) : (this._value = r, l = new m()), this._value = this._insertThousandsSeparators(this._value);
|
|
88
|
+
const v = t.tail && t._beforeTailState ? t._beforeTailState._value : this._value, f = this._separatorsCountFromSlice(v);
|
|
89
|
+
return l.tailShift += (f - s) * this.thousandsSeparator.length, l;
|
|
90
|
+
}
|
|
91
|
+
_findSeparatorAround(e) {
|
|
92
|
+
if (this.thousandsSeparator) {
|
|
93
|
+
const t = e - this.thousandsSeparator.length + 1, a = this.value.indexOf(this.thousandsSeparator, t);
|
|
94
|
+
if (a <= e)
|
|
95
|
+
return a;
|
|
96
|
+
}
|
|
97
|
+
return -1;
|
|
98
|
+
}
|
|
99
|
+
_adjustRangeWithSeparators(e, t) {
|
|
100
|
+
const a = this._findSeparatorAround(e);
|
|
101
|
+
a >= 0 && (e = a);
|
|
102
|
+
const s = this._findSeparatorAround(t);
|
|
103
|
+
return s >= 0 && (t = s + this.thousandsSeparator.length), [e, t];
|
|
104
|
+
}
|
|
105
|
+
remove(e, t) {
|
|
106
|
+
e === void 0 && (e = 0), t === void 0 && (t = this.displayValue.length), [e, t] = this._adjustRangeWithSeparators(e, t);
|
|
107
|
+
const a = this.value.slice(0, e), s = this.value.slice(t), r = this._separatorsCount(a.length);
|
|
108
|
+
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(a + s));
|
|
109
|
+
const h = this._separatorsCountFromSlice(a);
|
|
110
|
+
return new m({
|
|
111
|
+
tailShift: (h - r) * this.thousandsSeparator.length
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
nearestInputPos(e, t) {
|
|
115
|
+
if (!this.thousandsSeparator)
|
|
116
|
+
return e;
|
|
117
|
+
switch (t) {
|
|
118
|
+
case n.NONE:
|
|
119
|
+
case n.LEFT:
|
|
120
|
+
case n.FORCE_LEFT: {
|
|
121
|
+
const a = this._findSeparatorAround(e - 1);
|
|
122
|
+
if (a >= 0) {
|
|
123
|
+
const s = a + this.thousandsSeparator.length;
|
|
124
|
+
if (e < s || this.value.length <= s || t === n.FORCE_LEFT)
|
|
125
|
+
return a;
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
case n.RIGHT:
|
|
130
|
+
case n.FORCE_RIGHT: {
|
|
131
|
+
const a = this._findSeparatorAround(e);
|
|
132
|
+
if (a >= 0)
|
|
133
|
+
return a + this.thousandsSeparator.length;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return e;
|
|
137
|
+
}
|
|
138
|
+
doCommit() {
|
|
139
|
+
if (this.value) {
|
|
140
|
+
const e = this.number;
|
|
141
|
+
let t = e;
|
|
142
|
+
this.min != null && (t = Math.max(t, this.min)), this.max != null && (t = Math.min(t, this.max)), t !== e && (this.unmaskedValue = this.format(t, this));
|
|
143
|
+
let a = this.value;
|
|
144
|
+
this.normalizeZeros && (a = this._normalizeZeros(a)), this.padFractionalZeros && this.scale > 0 && (a = this._padFractionalZeros(a)), this._value = a;
|
|
145
|
+
}
|
|
146
|
+
super.doCommit();
|
|
147
|
+
}
|
|
148
|
+
_normalizeZeros(e) {
|
|
149
|
+
const t = this._removeThousandsSeparators(e).split(this.radix);
|
|
150
|
+
return t[0] = t[0].replace(/^(\D*)(0*)(\d*)/, (a, s, r, h) => s + h), e.length && !/\d$/.test(t[0]) && (t[0] = t[0] + "0"), t.length > 1 && (t[1] = t[1].replace(/0*$/, ""), t[1].length || (t.length = 1)), this._insertThousandsSeparators(t.join(this.radix));
|
|
151
|
+
}
|
|
152
|
+
_padFractionalZeros(e) {
|
|
153
|
+
if (!e)
|
|
154
|
+
return e;
|
|
155
|
+
const t = e.split(this.radix);
|
|
156
|
+
return t.length < 2 && t.push(""), t[1] = t[1].padEnd(this.scale, "0"), t.join(this.radix);
|
|
157
|
+
}
|
|
158
|
+
doSkipInvalid(e, t, a) {
|
|
159
|
+
t === void 0 && (t = {});
|
|
160
|
+
const s = this.scale === 0 && e !== this.thousandsSeparator && (e === this.radix || e === i.UNMASKED_RADIX || this.mapToRadix.includes(e));
|
|
161
|
+
return super.doSkipInvalid(e, t, a) && !s;
|
|
162
|
+
}
|
|
163
|
+
get unmaskedValue() {
|
|
164
|
+
return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, i.UNMASKED_RADIX);
|
|
165
|
+
}
|
|
166
|
+
set unmaskedValue(e) {
|
|
167
|
+
super.unmaskedValue = e;
|
|
168
|
+
}
|
|
169
|
+
get typedValue() {
|
|
170
|
+
return this.parse(this.unmaskedValue, this);
|
|
171
|
+
}
|
|
172
|
+
set typedValue(e) {
|
|
173
|
+
this.rawInputValue = this.format(e, this).replace(i.UNMASKED_RADIX, this.radix);
|
|
174
|
+
}
|
|
175
|
+
/** Parsed Number */
|
|
176
|
+
get number() {
|
|
177
|
+
return this.typedValue;
|
|
178
|
+
}
|
|
179
|
+
set number(e) {
|
|
180
|
+
this.typedValue = e;
|
|
181
|
+
}
|
|
182
|
+
get allowNegative() {
|
|
183
|
+
return this.min != null && this.min < 0 || this.max != null && this.max < 0;
|
|
184
|
+
}
|
|
185
|
+
get allowPositive() {
|
|
186
|
+
return this.min != null && this.min > 0 || this.max != null && this.max > 0;
|
|
187
|
+
}
|
|
188
|
+
typedValueEquals(e) {
|
|
189
|
+
return (super.typedValueEquals(e) || i.EMPTY_VALUES.includes(e) && i.EMPTY_VALUES.includes(this.typedValue)) && !(e === 0 && this.value === "");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
S = i;
|
|
193
|
+
i.UNMASKED_RADIX = ".";
|
|
194
|
+
i.EMPTY_VALUES = [..._.EMPTY_VALUES, 0];
|
|
195
|
+
i.DEFAULTS = {
|
|
196
|
+
..._.DEFAULTS,
|
|
197
|
+
mask: Number,
|
|
198
|
+
radix: ",",
|
|
199
|
+
thousandsSeparator: "",
|
|
200
|
+
mapToRadix: [S.UNMASKED_RADIX],
|
|
201
|
+
min: Number.MIN_SAFE_INTEGER,
|
|
202
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
203
|
+
scale: 2,
|
|
204
|
+
normalizeZeros: !0,
|
|
205
|
+
padFractionalZeros: !1,
|
|
206
|
+
parse: Number,
|
|
207
|
+
format: (c) => c.toLocaleString("en-US", {
|
|
208
|
+
useGrouping: !1,
|
|
209
|
+
maximumFractionDigits: 20
|
|
210
|
+
})
|
|
211
|
+
};
|
|
212
|
+
x.MaskedNumber = i;
|
|
213
|
+
export {
|
|
214
|
+
i as default
|
|
215
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import p from "../../core/change-details.js";
|
|
2
|
+
import { isString as g } from "../../core/utils.js";
|
|
3
|
+
import c from "../../core/continuous-tail-details.js";
|
|
4
|
+
import u from "../../core/holder.js";
|
|
5
|
+
class r {
|
|
6
|
+
/** */
|
|
7
|
+
constructor(t, s) {
|
|
8
|
+
t === void 0 && (t = []), s === void 0 && (s = 0), this.chunks = t, this.from = s;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return this.chunks.map(String).join("");
|
|
12
|
+
}
|
|
13
|
+
extend(t) {
|
|
14
|
+
if (!String(t))
|
|
15
|
+
return;
|
|
16
|
+
t = g(t) ? new c(String(t)) : t;
|
|
17
|
+
const s = this.chunks[this.chunks.length - 1], n = s && // if stops are same or tail has no stop
|
|
18
|
+
(s.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
|
|
19
|
+
t.from === s.from + s.toString().length;
|
|
20
|
+
if (t instanceof c)
|
|
21
|
+
n ? s.extend(t.toString()) : this.chunks.push(t);
|
|
22
|
+
else if (t instanceof r) {
|
|
23
|
+
if (t.stop == null) {
|
|
24
|
+
let e;
|
|
25
|
+
for (; t.chunks.length && t.chunks[0].stop == null; )
|
|
26
|
+
e = t.chunks.shift(), e.from += t.from, this.extend(e);
|
|
27
|
+
}
|
|
28
|
+
t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
appendTo(t) {
|
|
32
|
+
if (!(t instanceof u.MaskedPattern))
|
|
33
|
+
return new c(this.toString()).appendTo(t);
|
|
34
|
+
const s = new p();
|
|
35
|
+
for (let n = 0; n < this.chunks.length; ++n) {
|
|
36
|
+
const e = this.chunks[n], i = t._mapPosToBlock(t.displayValue.length), o = e.stop;
|
|
37
|
+
let h;
|
|
38
|
+
if (o != null && // if block not found or stop is behind lastBlock
|
|
39
|
+
(!i || i.index <= o) && ((e instanceof r || // for continuous block also check if stop is exist
|
|
40
|
+
t._stops.indexOf(o) >= 0) && s.aggregate(t._appendPlaceholder(o)), h = e instanceof r && t._blocks[o]), h) {
|
|
41
|
+
const f = h.appendTail(e);
|
|
42
|
+
s.aggregate(f);
|
|
43
|
+
const l = e.toString().slice(f.rawInserted.length);
|
|
44
|
+
l && s.aggregate(t.append(l, {
|
|
45
|
+
tail: !0
|
|
46
|
+
}));
|
|
47
|
+
} else
|
|
48
|
+
s.aggregate(t.append(e.toString(), {
|
|
49
|
+
tail: !0
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
return s;
|
|
53
|
+
}
|
|
54
|
+
get state() {
|
|
55
|
+
return {
|
|
56
|
+
chunks: this.chunks.map((t) => t.state),
|
|
57
|
+
from: this.from,
|
|
58
|
+
stop: this.stop,
|
|
59
|
+
blockIndex: this.blockIndex
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
set state(t) {
|
|
63
|
+
const {
|
|
64
|
+
chunks: s,
|
|
65
|
+
...n
|
|
66
|
+
} = t;
|
|
67
|
+
Object.assign(this, n), this.chunks = s.map((e) => {
|
|
68
|
+
const i = "chunks" in e ? new r() : new c();
|
|
69
|
+
return i.state = e, i;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
unshift(t) {
|
|
73
|
+
if (!this.chunks.length || t != null && this.from >= t)
|
|
74
|
+
return "";
|
|
75
|
+
const s = t != null ? t - this.from : t;
|
|
76
|
+
let n = 0;
|
|
77
|
+
for (; n < this.chunks.length; ) {
|
|
78
|
+
const e = this.chunks[n], i = e.unshift(s);
|
|
79
|
+
if (e.toString()) {
|
|
80
|
+
if (!i)
|
|
81
|
+
break;
|
|
82
|
+
++n;
|
|
83
|
+
} else
|
|
84
|
+
this.chunks.splice(n, 1);
|
|
85
|
+
if (i)
|
|
86
|
+
return i;
|
|
87
|
+
}
|
|
88
|
+
return "";
|
|
89
|
+
}
|
|
90
|
+
shift() {
|
|
91
|
+
if (!this.chunks.length)
|
|
92
|
+
return "";
|
|
93
|
+
let t = this.chunks.length - 1;
|
|
94
|
+
for (; 0 <= t; ) {
|
|
95
|
+
const s = this.chunks[t], n = s.shift();
|
|
96
|
+
if (s.toString()) {
|
|
97
|
+
if (!n)
|
|
98
|
+
break;
|
|
99
|
+
--t;
|
|
100
|
+
} else
|
|
101
|
+
this.chunks.splice(t, 1);
|
|
102
|
+
if (n)
|
|
103
|
+
return n;
|
|
104
|
+
}
|
|
105
|
+
return "";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
r as default
|
|
110
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { DIRECTION as s } from "../../core/utils.js";
|
|
2
|
+
class f {
|
|
3
|
+
constructor(t, e) {
|
|
4
|
+
this.masked = t, this._log = [];
|
|
5
|
+
const {
|
|
6
|
+
offset: i,
|
|
7
|
+
index: h
|
|
8
|
+
} = t._mapPosToBlock(e) || (e < 0 ? (
|
|
9
|
+
// first
|
|
10
|
+
{
|
|
11
|
+
index: 0,
|
|
12
|
+
offset: 0
|
|
13
|
+
}
|
|
14
|
+
) : (
|
|
15
|
+
// last
|
|
16
|
+
{
|
|
17
|
+
index: this.masked._blocks.length,
|
|
18
|
+
offset: 0
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
this.offset = i, this.index = h, this.ok = !1;
|
|
22
|
+
}
|
|
23
|
+
get block() {
|
|
24
|
+
return this.masked._blocks[this.index];
|
|
25
|
+
}
|
|
26
|
+
get pos() {
|
|
27
|
+
return this.masked._blockStartPos(this.index) + this.offset;
|
|
28
|
+
}
|
|
29
|
+
get state() {
|
|
30
|
+
return {
|
|
31
|
+
index: this.index,
|
|
32
|
+
offset: this.offset,
|
|
33
|
+
ok: this.ok
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
set state(t) {
|
|
37
|
+
Object.assign(this, t);
|
|
38
|
+
}
|
|
39
|
+
pushState() {
|
|
40
|
+
this._log.push(this.state);
|
|
41
|
+
}
|
|
42
|
+
popState() {
|
|
43
|
+
const t = this._log.pop();
|
|
44
|
+
return t && (this.state = t), t;
|
|
45
|
+
}
|
|
46
|
+
bindBlock() {
|
|
47
|
+
this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
|
|
48
|
+
}
|
|
49
|
+
_pushLeft(t) {
|
|
50
|
+
for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
|
|
51
|
+
var e;
|
|
52
|
+
if (t())
|
|
53
|
+
return this.ok = !0;
|
|
54
|
+
}
|
|
55
|
+
return this.ok = !1;
|
|
56
|
+
}
|
|
57
|
+
_pushRight(t) {
|
|
58
|
+
for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
|
|
59
|
+
if (t())
|
|
60
|
+
return this.ok = !0;
|
|
61
|
+
return this.ok = !1;
|
|
62
|
+
}
|
|
63
|
+
pushLeftBeforeFilled() {
|
|
64
|
+
return this._pushLeft(() => {
|
|
65
|
+
if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, s.FORCE_LEFT), this.offset !== 0))
|
|
66
|
+
return !0;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
pushLeftBeforeInput() {
|
|
70
|
+
return this._pushLeft(() => {
|
|
71
|
+
if (!this.block.isFixed)
|
|
72
|
+
return this.offset = this.block.nearestInputPos(this.offset, s.LEFT), !0;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
pushLeftBeforeRequired() {
|
|
76
|
+
return this._pushLeft(() => {
|
|
77
|
+
if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
|
|
78
|
+
return this.offset = this.block.nearestInputPos(this.offset, s.LEFT), !0;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
pushRightBeforeFilled() {
|
|
82
|
+
return this._pushRight(() => {
|
|
83
|
+
if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, s.FORCE_RIGHT), this.offset !== this.block.value.length))
|
|
84
|
+
return !0;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
pushRightBeforeInput() {
|
|
88
|
+
return this._pushRight(() => {
|
|
89
|
+
if (!this.block.isFixed)
|
|
90
|
+
return this.offset = this.block.nearestInputPos(this.offset, s.NONE), !0;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
pushRightBeforeRequired() {
|
|
94
|
+
return this._pushRight(() => {
|
|
95
|
+
if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
|
|
96
|
+
return this.offset = this.block.nearestInputPos(this.offset, s.NONE), !0;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
f as default
|
|
102
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import n from "../../core/change-details.js";
|
|
2
|
+
import { DIRECTION as a, isString as l } from "../../core/utils.js";
|
|
3
|
+
import u from "../../core/continuous-tail-details.js";
|
|
4
|
+
class c {
|
|
5
|
+
/** */
|
|
6
|
+
/** */
|
|
7
|
+
/** */
|
|
8
|
+
/** */
|
|
9
|
+
/** */
|
|
10
|
+
/** */
|
|
11
|
+
constructor(e) {
|
|
12
|
+
Object.assign(this, e), this._value = "", this.isFixed = !0;
|
|
13
|
+
}
|
|
14
|
+
get value() {
|
|
15
|
+
return this._value;
|
|
16
|
+
}
|
|
17
|
+
get unmaskedValue() {
|
|
18
|
+
return this.isUnmasking ? this.value : "";
|
|
19
|
+
}
|
|
20
|
+
get rawInputValue() {
|
|
21
|
+
return this._isRawInput ? this.value : "";
|
|
22
|
+
}
|
|
23
|
+
get displayValue() {
|
|
24
|
+
return this.value;
|
|
25
|
+
}
|
|
26
|
+
reset() {
|
|
27
|
+
this._isRawInput = !1, this._value = "";
|
|
28
|
+
}
|
|
29
|
+
remove(e, t) {
|
|
30
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this._value.length), this._value = this._value.slice(0, e) + this._value.slice(t), this._value || (this._isRawInput = !1), new n();
|
|
31
|
+
}
|
|
32
|
+
nearestInputPos(e, t) {
|
|
33
|
+
t === void 0 && (t = a.NONE);
|
|
34
|
+
const i = 0, s = this._value.length;
|
|
35
|
+
switch (t) {
|
|
36
|
+
case a.LEFT:
|
|
37
|
+
case a.FORCE_LEFT:
|
|
38
|
+
return i;
|
|
39
|
+
case a.NONE:
|
|
40
|
+
case a.RIGHT:
|
|
41
|
+
case a.FORCE_RIGHT:
|
|
42
|
+
default:
|
|
43
|
+
return s;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
totalInputPositions(e, t) {
|
|
47
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this._value.length), this._isRawInput ? t - e : 0;
|
|
48
|
+
}
|
|
49
|
+
extractInput(e, t, i) {
|
|
50
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this._value.length), i === void 0 && (i = {}), i.raw && this._isRawInput && this._value.slice(e, t) || "";
|
|
51
|
+
}
|
|
52
|
+
get isComplete() {
|
|
53
|
+
return !0;
|
|
54
|
+
}
|
|
55
|
+
get isFilled() {
|
|
56
|
+
return !!this._value;
|
|
57
|
+
}
|
|
58
|
+
_appendChar(e, t) {
|
|
59
|
+
if (t === void 0 && (t = {}), this.isFilled)
|
|
60
|
+
return new n();
|
|
61
|
+
const i = this.eager === !0 || this.eager === "append", r = this.char === e && (this.isUnmasking || t.input || t.raw) && (!t.raw || !i) && !t.tail, h = new n({
|
|
62
|
+
inserted: this.char,
|
|
63
|
+
rawInserted: r ? this.char : ""
|
|
64
|
+
});
|
|
65
|
+
return this._value = this.char, this._isRawInput = r && (t.raw || t.input), h;
|
|
66
|
+
}
|
|
67
|
+
_appendEager() {
|
|
68
|
+
return this._appendChar(this.char, {
|
|
69
|
+
tail: !0
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
_appendPlaceholder() {
|
|
73
|
+
const e = new n();
|
|
74
|
+
return this.isFilled || (this._value = e.inserted = this.char), e;
|
|
75
|
+
}
|
|
76
|
+
extractTail() {
|
|
77
|
+
return new u("");
|
|
78
|
+
}
|
|
79
|
+
appendTail(e) {
|
|
80
|
+
return l(e) && (e = new u(String(e))), e.appendTo(this);
|
|
81
|
+
}
|
|
82
|
+
append(e, t, i) {
|
|
83
|
+
const s = this._appendChar(e[0], t);
|
|
84
|
+
return i != null && (s.tailShift += this.appendTail(i).tailShift), s;
|
|
85
|
+
}
|
|
86
|
+
doCommit() {
|
|
87
|
+
}
|
|
88
|
+
get state() {
|
|
89
|
+
return {
|
|
90
|
+
_value: this._value,
|
|
91
|
+
_rawInputValue: this.rawInputValue
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
set state(e) {
|
|
95
|
+
this._value = e._value, this._isRawInput = !!e._rawInputValue;
|
|
96
|
+
}
|
|
97
|
+
pad(e) {
|
|
98
|
+
return this._appendPlaceholder();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
c as default
|
|
103
|
+
};
|