@skbkontur/react-ui 6.1.4-ff219.0 → 6.2.0-beta.0
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/components/Autocomplete/Autocomplete.js +2 -3
- package/components/Autocomplete/Autocomplete.js.map +1 -1
- package/components/FxInput/FxInput.js +2 -2
- package/components/FxInput/FxInput.js.map +1 -1
- package/components/Group/Group.js +3 -2
- package/components/Group/Group.js.map +1 -1
- package/components/Input/Input.d.ts +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/MaskedInput/MaskedInput.d.ts +0 -2
- package/components/MaskedInput/MaskedInput.js +0 -6
- package/components/MaskedInput/MaskedInput.js.map +1 -1
- package/components/TimePicker/TimeClockIcon.d.ts +3 -0
- package/components/TimePicker/TimeClockIcon.js +11 -0
- package/components/TimePicker/TimeClockIcon.js.map +1 -0
- package/components/TimePicker/TimePicker.d.ts +79 -0
- package/components/TimePicker/TimePicker.js +513 -0
- package/components/TimePicker/TimePicker.js.map +1 -0
- package/components/TimePicker/TimePicker.styles.d.ts +11 -0
- package/components/TimePicker/TimePicker.styles.js +36 -0
- package/components/TimePicker/TimePicker.styles.js.map +1 -0
- package/components/TimePicker/TimePickerItems.d.ts +17 -0
- package/components/TimePicker/TimePickerItems.js +80 -0
- package/components/TimePicker/TimePickerItems.js.map +1 -0
- package/components/TimePicker/TimePickerMobilePopup.d.ts +38 -0
- package/components/TimePicker/TimePickerMobilePopup.js +21 -0
- package/components/TimePicker/TimePickerMobilePopup.js.map +1 -0
- package/components/TimePicker/TimePickerPopup.d.ts +20 -0
- package/components/TimePicker/TimePickerPopup.js +18 -0
- package/components/TimePicker/TimePickerPopup.js.map +1 -0
- package/components/TimePicker/helpers/TimePicker.constants.d.ts +22 -0
- package/components/TimePicker/helpers/TimePicker.constants.js +31 -0
- package/components/TimePicker/helpers/TimePicker.constants.js.map +1 -0
- package/components/TimePicker/helpers/TimePicker.editing.d.ts +23 -0
- package/components/TimePicker/helpers/TimePicker.editing.js +101 -0
- package/components/TimePicker/helpers/TimePicker.editing.js.map +1 -0
- package/components/TimePicker/helpers/TimePicker.layout.d.ts +6 -0
- package/components/TimePicker/helpers/TimePicker.layout.js +49 -0
- package/components/TimePicker/helpers/TimePicker.layout.js.map +1 -0
- package/components/TimePicker/helpers/TimePicker.selection.d.ts +5 -0
- package/components/TimePicker/helpers/TimePicker.selection.js +23 -0
- package/components/TimePicker/helpers/TimePicker.selection.js.map +1 -0
- package/components/TimePicker/helpers/TimePicker.shared.d.ts +47 -0
- package/components/TimePicker/helpers/TimePicker.shared.js +70 -0
- package/components/TimePicker/helpers/TimePicker.shared.js.map +1 -0
- package/components/TimePicker/helpers/TimePicker.value.d.ts +30 -0
- package/components/TimePicker/helpers/TimePicker.value.js +96 -0
- package/components/TimePicker/helpers/TimePicker.value.js.map +1 -0
- package/components/TimePicker/helpers/scrollSelectedItemIntoView.d.ts +4 -0
- package/components/TimePicker/helpers/scrollSelectedItemIntoView.js +24 -0
- package/components/TimePicker/helpers/scrollSelectedItemIntoView.js.map +1 -0
- package/components/TimePicker/helpers/validateTimePicker.d.ts +8 -0
- package/components/TimePicker/helpers/validateTimePicker.js +16 -0
- package/components/TimePicker/helpers/validateTimePicker.js.map +1 -0
- package/components/TimePicker/hooks/useTimePickerDropdown.d.ts +17 -0
- package/components/TimePicker/hooks/useTimePickerDropdown.js +62 -0
- package/components/TimePicker/hooks/useTimePickerDropdown.js.map +1 -0
- package/components/TimePicker/hooks/useTimePickerSelection.d.ts +18 -0
- package/components/TimePicker/hooks/useTimePickerSelection.js +66 -0
- package/components/TimePicker/hooks/useTimePickerSelection.js.map +1 -0
- package/components/TimePicker/hooks/useTimePickerValue.d.ts +18 -0
- package/components/TimePicker/hooks/useTimePickerValue.js +59 -0
- package/components/TimePicker/hooks/useTimePickerValue.js.map +1 -0
- package/components/TimePicker/index.d.ts +2 -0
- package/components/TimePicker/index.js +2 -0
- package/components/TimePicker/index.js.map +1 -0
- package/components/TimePicker/locale/index.d.ts +4 -0
- package/components/TimePicker/locale/index.js +9 -0
- package/components/TimePicker/locale/index.js.map +1 -0
- package/components/TimePicker/locale/locales/en.d.ts +2 -0
- package/components/TimePicker/locale/locales/en.js +5 -0
- package/components/TimePicker/locale/locales/en.js.map +1 -0
- package/components/TimePicker/locale/locales/ru.d.ts +2 -0
- package/components/TimePicker/locale/locales/ru.js +5 -0
- package/components/TimePicker/locale/locales/ru.js.map +1 -0
- package/components/TimePicker/locale/types.d.ts +4 -0
- package/components/TimePicker/locale/types.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxView.js +2 -2
- package/internal/CustomComboBox/ComboBoxView.js.map +1 -1
- package/internal/NativeTimeInput/NativeTimeInput.d.ts +16 -0
- package/internal/NativeTimeInput/NativeTimeInput.js +25 -0
- package/internal/NativeTimeInput/NativeTimeInput.js.map +1 -0
- package/internal/NativeTimeInput/NativeTimeInput.styles.d.ts +3 -0
- package/internal/NativeTimeInput/NativeTimeInput.styles.js +15 -0
- package/internal/NativeTimeInput/NativeTimeInput.styles.js.map +1 -0
- package/internal/NativeTimeInput/NativeTimeInput.utils.d.ts +7 -0
- package/internal/NativeTimeInput/NativeTimeInput.utils.js +28 -0
- package/internal/NativeTimeInput/NativeTimeInput.utils.js.map +1 -0
- package/internal/NativeTimeInput/index.d.ts +1 -0
- package/internal/NativeTimeInput/index.js +2 -0
- package/internal/NativeTimeInput/index.js.map +1 -0
- package/internal/TimeInput/TimeFragments.d.ts +15 -0
- package/internal/TimeInput/TimeFragments.js +72 -0
- package/internal/TimeInput/TimeFragments.js.map +1 -0
- package/internal/TimeInput/TimeFragments.styles.d.ts +12 -0
- package/internal/TimeInput/TimeFragments.styles.js +43 -0
- package/internal/TimeInput/TimeFragments.styles.js.map +1 -0
- package/internal/TimeInput/TimeInput.d.ts +22 -0
- package/internal/TimeInput/TimeInput.js +103 -0
- package/internal/TimeInput/TimeInput.js.map +1 -0
- package/{components/MaskedInputV2/MaskedInputV2.styles.d.ts → internal/TimeInput/TimeInput.styles.d.ts} +3 -4
- package/internal/TimeInput/TimeInput.styles.js +21 -0
- package/internal/TimeInput/TimeInput.styles.js.map +1 -0
- package/internal/TimeInput/index.d.ts +1 -0
- package/internal/TimeInput/index.js +2 -0
- package/internal/TimeInput/index.js.map +1 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.d.ts +2 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.js +20 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.js.map +1 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.d.ts +2 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.js +20 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.js.map +1 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.d.ts +2 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.js +20 -0
- package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.js.map +1 -0
- package/internal/themes/BasicTheme.d.ts +34 -0
- package/internal/themes/BasicTheme.js +96 -0
- package/internal/themes/BasicTheme.js.map +1 -1
- package/lib/events/keyboard/KeyboardEventCodes.d.ts +0 -2
- package/lib/events/keyboard/KeyboardEventCodes.js +0 -2
- package/lib/events/keyboard/KeyboardEventCodes.js.map +1 -1
- package/lib/events/keyboard/KeyboardMapKeys.js +0 -2
- package/lib/events/keyboard/KeyboardMapKeys.js.map +1 -1
- package/lib/events/keyboard/identifiers.d.ts +0 -2
- package/lib/events/keyboard/identifiers.js +0 -6
- package/lib/events/keyboard/identifiers.js.map +1 -1
- package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +0 -2
- package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js +0 -1
- package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
- package/lib/locale/types.d.ts +2 -0
- package/lib/locale/types.js.map +1 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +1 -0
- package/lib/utils.js.map +1 -1
- package/package.json +9 -4
- package/components/MaskedInputV2/MaskedInputV2.d.ts +0 -57
- package/components/MaskedInputV2/MaskedInputV2.helpers.d.ts +0 -9
- package/components/MaskedInputV2/MaskedInputV2.helpers.js +0 -17
- package/components/MaskedInputV2/MaskedInputV2.helpers.js.map +0 -1
- package/components/MaskedInputV2/MaskedInputV2.js +0 -234
- package/components/MaskedInputV2/MaskedInputV2.js.map +0 -1
- package/components/MaskedInputV2/MaskedInputV2.styles.js +0 -19
- package/components/MaskedInputV2/MaskedInputV2.styles.js.map +0 -1
- package/components/MaskedInputV2/index.d.ts +0 -1
- package/components/MaskedInputV2/index.js +0 -2
- package/components/MaskedInputV2/index.js.map +0 -1
- package/components/MaskedInputV2/internal/MaskOverlay.d.ts +0 -19
- package/components/MaskedInputV2/internal/MaskOverlay.js +0 -54
- package/components/MaskedInputV2/internal/MaskOverlay.js.map +0 -1
- package/components/MaskedInputV2/internal/MaskedCore.d.ts +0 -8
- package/components/MaskedInputV2/internal/MaskedCore.js +0 -101
- package/components/MaskedInputV2/internal/MaskedCore.js.map +0 -1
- package/components/MaskedInputV2/internal/MaskedCore.types.d.ts +0 -30
- package/components/MaskedInputV2/internal/MaskedCore.types.js +0 -2
- package/components/MaskedInputV2/internal/MaskedCore.types.js.map +0 -1
- package/components/MaskedInputV2/internal/MaskedInternal.styles.d.ts +0 -15
- package/components/MaskedInputV2/internal/MaskedInternal.styles.js +0 -34
- package/components/MaskedInputV2/internal/MaskedInternal.styles.js.map +0 -1
- package/components/MaskedInputV2/internal/buildSlotMap.d.ts +0 -11
- package/components/MaskedInputV2/internal/buildSlotMap.js +0 -37
- package/components/MaskedInputV2/internal/buildSlotMap.js.map +0 -1
- package/components/MaskedInputV2/internal/extractRaw.d.ts +0 -10
- package/components/MaskedInputV2/internal/extractRaw.js +0 -16
- package/components/MaskedInputV2/internal/extractRaw.js.map +0 -1
- package/components/MaskedInputV2/internal/findNearestRawLeft.d.ts +0 -10
- package/components/MaskedInputV2/internal/findNearestRawLeft.js +0 -18
- package/components/MaskedInputV2/internal/findNearestRawLeft.js.map +0 -1
- package/components/MaskedInputV2/internal/helpers.d.ts +0 -5
- package/components/MaskedInputV2/internal/helpers.js +0 -6
- package/components/MaskedInputV2/internal/helpers.js.map +0 -1
- package/components/MaskedInputV2/internal/maskedCoreClipboard.d.ts +0 -25
- package/components/MaskedInputV2/internal/maskedCoreClipboard.js +0 -30
- package/components/MaskedInputV2/internal/maskedCoreClipboard.js.map +0 -1
- package/components/MaskedInputV2/internal/maskedCoreDeletion.d.ts +0 -28
- package/components/MaskedInputV2/internal/maskedCoreDeletion.js +0 -70
- package/components/MaskedInputV2/internal/maskedCoreDeletion.js.map +0 -1
- package/components/MaskedInputV2/internal/maskedCoreInputChange.d.ts +0 -35
- package/components/MaskedInputV2/internal/maskedCoreInputChange.js +0 -31
- package/components/MaskedInputV2/internal/maskedCoreInputChange.js.map +0 -1
- package/components/MaskedInputV2/internal/maskedCoreNavigation.d.ts +0 -13
- package/components/MaskedInputV2/internal/maskedCoreNavigation.js +0 -79
- package/components/MaskedInputV2/internal/maskedCoreNavigation.js.map +0 -1
- package/components/MaskedInputV2/internal/stripMaskChars.d.ts +0 -11
- package/components/MaskedInputV2/internal/stripMaskChars.js +0 -20
- package/components/MaskedInputV2/internal/stripMaskChars.js.map +0 -1
- package/components/MaskedInputV2/internal/types.d.ts +0 -74
- package/components/MaskedInputV2/internal/types.js.map +0 -1
- package/components/MaskedInputV2/internal/useMaskEngine.d.ts +0 -42
- package/components/MaskedInputV2/internal/useMaskEngine.js +0 -82
- package/components/MaskedInputV2/internal/useMaskEngine.js.map +0 -1
- package/components/MaskedInputV2/internal/useMaskedCoreHandlers.d.ts +0 -28
- package/components/MaskedInputV2/internal/useMaskedCoreHandlers.js +0 -190
- package/components/MaskedInputV2/internal/useMaskedCoreHandlers.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.d.ts +0 -16
- package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.js +0 -59
- package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.d.ts +0 -20
- package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.js +0 -106
- package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/controls/input-history.d.ts +0 -17
- package/components/MaskedInputV2/react-imask/imask/controls/input-history.js +0 -49
- package/components/MaskedInputV2/react-imask/imask/controls/input-history.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/controls/input.d.ts +0 -95
- package/components/MaskedInputV2/react-imask/imask/controls/input.js +0 -420
- package/components/MaskedInputV2/react-imask/imask/controls/input.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/controls/mask-element.d.ts +0 -30
- package/components/MaskedInputV2/react-imask/imask/controls/mask-element.js +0 -59
- package/components/MaskedInputV2/react-imask/imask/controls/mask-element.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/core/action-details.d.ts +0 -30
- package/components/MaskedInputV2/react-imask/imask/core/action-details.js +0 -100
- package/components/MaskedInputV2/react-imask/imask/core/action-details.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/core/change-details.d.ts +0 -20
- package/components/MaskedInputV2/react-imask/imask/core/change-details.js +0 -46
- package/components/MaskedInputV2/react-imask/imask/core/change-details.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.d.ts +0 -21
- package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.js +0 -52
- package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/core/holder.d.ts +0 -34
- package/components/MaskedInputV2/react-imask/imask/core/holder.js +0 -38
- package/components/MaskedInputV2/react-imask/imask/core/holder.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/core/tail-details.d.ts +0 -20
- package/components/MaskedInputV2/react-imask/imask/core/tail-details.js +0 -2
- package/components/MaskedInputV2/react-imask/imask/core/tail-details.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/core/utils.d.ts +0 -24
- package/components/MaskedInputV2/react-imask/imask/core/utils.js +0 -100
- package/components/MaskedInputV2/react-imask/imask/core/utils.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/imask.d.ts +0 -5
- package/components/MaskedInputV2/react-imask/imask/imask.js +0 -7
- package/components/MaskedInputV2/react-imask/imask/imask.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/index.d.ts +0 -17
- package/components/MaskedInputV2/react-imask/imask/index.js +0 -16
- package/components/MaskedInputV2/react-imask/imask/index.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/base.d.ts +0 -114
- package/components/MaskedInputV2/react-imask/imask/masked/base.js +0 -411
- package/components/MaskedInputV2/react-imask/imask/masked/base.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/factory.d.ts +0 -62
- package/components/MaskedInputV2/react-imask/imask/masked/factory.js +0 -96
- package/components/MaskedInputV2/react-imask/imask/masked/factory.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/pattern.d.ts +0 -101
- package/components/MaskedInputV2/react-imask/imask/masked/pattern.js +0 -543
- package/components/MaskedInputV2/react-imask/imask/masked/pattern.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.d.ts +0 -30
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.js +0 -2
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.d.ts +0 -21
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.js +0 -180
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.d.ts +0 -31
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.js +0 -163
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.d.ts +0 -42
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.js +0 -158
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.d.ts +0 -56
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.js +0 -185
- package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.js.map +0 -1
- package/components/MaskedInputV2/react-imask/imask/masked/regexp.d.ts +0 -17
- package/components/MaskedInputV2/react-imask/imask/masked/regexp.js +0 -36
- package/components/MaskedInputV2/react-imask/imask/masked/regexp.js.map +0 -1
- package/components/MaskedInputV2/react-imask/index.d.ts +0 -3
- package/components/MaskedInputV2/react-imask/index.js +0 -4
- package/components/MaskedInputV2/react-imask/index.js.map +0 -1
- package/components/MaskedInputV2/react-imask/input.d.ts +0 -8
- package/components/MaskedInputV2/react-imask/input.js +0 -35
- package/components/MaskedInputV2/react-imask/input.js.map +0 -1
- package/components/MaskedInputV2/react-imask/mixin.d.ts +0 -31
- package/components/MaskedInputV2/react-imask/mixin.js +0 -246
- package/components/MaskedInputV2/react-imask/mixin.js.map +0 -1
- package/internal/FeaturedMaskedInput/FeaturedMaskedInput.d.ts +0 -4
- package/internal/FeaturedMaskedInput/FeaturedMaskedInput.js +0 -24
- package/internal/FeaturedMaskedInput/FeaturedMaskedInput.js.map +0 -1
- /package/components/{MaskedInputV2/internal → TimePicker/locale}/types.js +0 -0
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { DIRECTION } from './utils.js';
|
|
2
|
-
/** Provides details of changing input */
|
|
3
|
-
var ActionDetails = /** @class */ (function () {
|
|
4
|
-
function ActionDetails(opts) {
|
|
5
|
-
Object.assign(this, opts);
|
|
6
|
-
// double check if left part was changed (autofilling, other non-standard input triggers)
|
|
7
|
-
while (this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos)) {
|
|
8
|
-
--this.oldSelection.start;
|
|
9
|
-
}
|
|
10
|
-
if (this.insertedCount) {
|
|
11
|
-
// double check right part
|
|
12
|
-
while (this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end)) {
|
|
13
|
-
if (this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end) {
|
|
14
|
-
++this.oldSelection.end;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
++this.cursorPos;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(ActionDetails.prototype, "startChangePos", {
|
|
23
|
-
/** Start changing position */
|
|
24
|
-
get: function () {
|
|
25
|
-
return Math.min(this.cursorPos, this.oldSelection.start);
|
|
26
|
-
},
|
|
27
|
-
enumerable: false,
|
|
28
|
-
configurable: true
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(ActionDetails.prototype, "insertedCount", {
|
|
31
|
-
/** Inserted symbols count */
|
|
32
|
-
get: function () {
|
|
33
|
-
return this.cursorPos - this.startChangePos;
|
|
34
|
-
},
|
|
35
|
-
enumerable: false,
|
|
36
|
-
configurable: true
|
|
37
|
-
});
|
|
38
|
-
Object.defineProperty(ActionDetails.prototype, "inserted", {
|
|
39
|
-
/** Inserted symbols */
|
|
40
|
-
get: function () {
|
|
41
|
-
return this.value.substr(this.startChangePos, this.insertedCount);
|
|
42
|
-
},
|
|
43
|
-
enumerable: false,
|
|
44
|
-
configurable: true
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(ActionDetails.prototype, "removedCount", {
|
|
47
|
-
/** Removed symbols count */
|
|
48
|
-
get: function () {
|
|
49
|
-
// Math.max for opposite operation
|
|
50
|
-
return Math.max(this.oldSelection.end - this.startChangePos ||
|
|
51
|
-
// for Delete
|
|
52
|
-
this.oldValue.length - this.value.length, 0);
|
|
53
|
-
},
|
|
54
|
-
enumerable: false,
|
|
55
|
-
configurable: true
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(ActionDetails.prototype, "removed", {
|
|
58
|
-
/** Removed symbols */
|
|
59
|
-
get: function () {
|
|
60
|
-
return this.oldValue.substr(this.startChangePos, this.removedCount);
|
|
61
|
-
},
|
|
62
|
-
enumerable: false,
|
|
63
|
-
configurable: true
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(ActionDetails.prototype, "head", {
|
|
66
|
-
/** Unchanged head symbols */
|
|
67
|
-
get: function () {
|
|
68
|
-
return this.value.substring(0, this.startChangePos);
|
|
69
|
-
},
|
|
70
|
-
enumerable: false,
|
|
71
|
-
configurable: true
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(ActionDetails.prototype, "tail", {
|
|
74
|
-
/** Unchanged tail symbols */
|
|
75
|
-
get: function () {
|
|
76
|
-
return this.value.substring(this.startChangePos + this.insertedCount);
|
|
77
|
-
},
|
|
78
|
-
enumerable: false,
|
|
79
|
-
configurable: true
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(ActionDetails.prototype, "removeDirection", {
|
|
82
|
-
/** Remove direction */
|
|
83
|
-
get: function () {
|
|
84
|
-
if (!this.removedCount || this.insertedCount) {
|
|
85
|
-
return DIRECTION.NONE;
|
|
86
|
-
}
|
|
87
|
-
// align right if delete at right
|
|
88
|
-
return (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) &&
|
|
89
|
-
// if not range removed (event with backspace)
|
|
90
|
-
this.oldSelection.end === this.oldSelection.start
|
|
91
|
-
? DIRECTION.RIGHT
|
|
92
|
-
: DIRECTION.LEFT;
|
|
93
|
-
},
|
|
94
|
-
enumerable: false,
|
|
95
|
-
configurable: true
|
|
96
|
-
});
|
|
97
|
-
return ActionDetails;
|
|
98
|
-
}());
|
|
99
|
-
export { ActionDetails };
|
|
100
|
-
//# sourceMappingURL=action-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-details.js","sourceRoot":"","sources":["action-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvE,yCAAyC;AACzC;IAUE,uBAAY,IAA0B;QACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE1B,yFAAyF;QACzF,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YAChG,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QAC5B,CAAC;QAED,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,0BAA0B;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvF,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;oBACtF,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;gBAC1B,CAAC;qBAAM,CAAC;oBACN,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAGD,sBAAI,yCAAc;QADlB,8BAA8B;aAC9B;YACE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC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iC;YACjC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,KAAK,IAAI,CAAC,SAAS,CAAC;gBAC7F,8CAA8C;gBAC9C,IAAI,CAAC,YAAY,CAAC,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK;gBACjD,CAAC,CAAC,SAAS,CAAC,KAAK;gBACjB,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC;QACrB,CAAC;;;OAAA;IACH,oBAAC;AAAD,CAAC,AApFD,IAoFC","sourcesContent":["import { type Direction, type Selection, DIRECTION } from './utils.js';\n\nexport type ActionDetailsOptions = Pick<ActionDetails, 'value' | 'cursorPos' | 'oldValue' | 'oldSelection'>;\n\n/** Provides details of changing input */\nexport class ActionDetails {\n /** Current input value */\n value!: string;\n /** Current cursor position */\n cursorPos!: number;\n /** Old input value */\n oldValue!: string;\n /** Old selection */\n oldSelection!: Selection;\n\n constructor(opts: ActionDetailsOptions) {\n Object.assign(this, opts);\n\n // double check if left part was changed (autofilling, other non-standard input triggers)\n while (this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos)) {\n --this.oldSelection.start;\n }\n\n if (this.insertedCount) {\n // double check right part\n while (this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end)) {\n if (this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end) {\n ++this.oldSelection.end;\n } else {\n ++this.cursorPos;\n }\n }\n }\n }\n\n /** Start changing position */\n get startChangePos(): number {\n return Math.min(this.cursorPos, this.oldSelection.start);\n }\n\n /** Inserted symbols count */\n get insertedCount(): number {\n return this.cursorPos - this.startChangePos;\n }\n\n /** Inserted symbols */\n get inserted(): string {\n return this.value.substr(this.startChangePos, this.insertedCount);\n }\n\n /** Removed symbols count */\n get removedCount(): number {\n // Math.max for opposite operation\n return Math.max(\n this.oldSelection.end - this.startChangePos ||\n // for Delete\n this.oldValue.length - this.value.length,\n 0,\n );\n }\n\n /** Removed symbols */\n get removed(): string {\n return this.oldValue.substr(this.startChangePos, this.removedCount);\n }\n\n /** Unchanged head symbols */\n get head(): string {\n return this.value.substring(0, this.startChangePos);\n }\n\n /** Unchanged tail symbols */\n get tail(): string {\n return this.value.substring(this.startChangePos + this.insertedCount);\n }\n\n /** Remove direction */\n get removeDirection(): Direction {\n if (!this.removedCount || this.insertedCount) {\n return DIRECTION.NONE;\n }\n\n // align right if delete at right\n return (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) &&\n // if not range removed (event with backspace)\n this.oldSelection.end === this.oldSelection.start\n ? DIRECTION.RIGHT\n : DIRECTION.LEFT;\n }\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type ChangeDetailsOptions = Pick<ChangeDetails, 'inserted' | 'tailShift' | 'rawInserted' | 'skip'>;
|
|
2
|
-
/** Provides details of changing model value */
|
|
3
|
-
export declare class ChangeDetails {
|
|
4
|
-
/** Inserted symbols */
|
|
5
|
-
inserted: string;
|
|
6
|
-
/** Additional offset if any changes occurred before tail */
|
|
7
|
-
tailShift: number;
|
|
8
|
-
/** Raw inserted is used by dynamic mask */
|
|
9
|
-
rawInserted: string;
|
|
10
|
-
/** Can skip chars */
|
|
11
|
-
skip: boolean;
|
|
12
|
-
static normalize(prep: string | [string, ChangeDetails]): [string, ChangeDetails];
|
|
13
|
-
constructor(details?: Partial<ChangeDetailsOptions>);
|
|
14
|
-
/** Aggregate changes */
|
|
15
|
-
aggregate(details: ChangeDetails): this;
|
|
16
|
-
/** Total offset considering all changes */
|
|
17
|
-
get offset(): number;
|
|
18
|
-
get consumed(): boolean;
|
|
19
|
-
equals(details: ChangeDetails): boolean;
|
|
20
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/** Provides details of changing model value */
|
|
2
|
-
var ChangeDetails = /** @class */ (function () {
|
|
3
|
-
function ChangeDetails(details) {
|
|
4
|
-
Object.assign(this, {
|
|
5
|
-
inserted: '',
|
|
6
|
-
rawInserted: '',
|
|
7
|
-
tailShift: 0,
|
|
8
|
-
skip: false,
|
|
9
|
-
}, details);
|
|
10
|
-
}
|
|
11
|
-
ChangeDetails.normalize = function (prep) {
|
|
12
|
-
return Array.isArray(prep) ? prep : [prep, new ChangeDetails()];
|
|
13
|
-
};
|
|
14
|
-
/** Aggregate changes */
|
|
15
|
-
ChangeDetails.prototype.aggregate = function (details) {
|
|
16
|
-
this.inserted += details.inserted;
|
|
17
|
-
this.rawInserted += details.rawInserted;
|
|
18
|
-
this.tailShift += details.tailShift;
|
|
19
|
-
this.skip = this.skip || details.skip;
|
|
20
|
-
return this;
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(ChangeDetails.prototype, "offset", {
|
|
23
|
-
/** Total offset considering all changes */
|
|
24
|
-
get: function () {
|
|
25
|
-
return this.tailShift + this.inserted.length;
|
|
26
|
-
},
|
|
27
|
-
enumerable: false,
|
|
28
|
-
configurable: true
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(ChangeDetails.prototype, "consumed", {
|
|
31
|
-
get: function () {
|
|
32
|
-
return Boolean(this.rawInserted) || this.skip;
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
ChangeDetails.prototype.equals = function (details) {
|
|
38
|
-
return (this.inserted === details.inserted &&
|
|
39
|
-
this.tailShift === details.tailShift &&
|
|
40
|
-
this.rawInserted === details.rawInserted &&
|
|
41
|
-
this.skip === details.skip);
|
|
42
|
-
};
|
|
43
|
-
return ChangeDetails;
|
|
44
|
-
}());
|
|
45
|
-
export { ChangeDetails };
|
|
46
|
-
//# sourceMappingURL=change-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"change-details.js","sourceRoot":"","sources":["change-details.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C;IAcE,uBAAY,OAAuC;QACjD,MAAM,CAAC,MAAM,C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":["export type ChangeDetailsOptions = Pick<ChangeDetails, 'inserted' | 'tailShift' | 'rawInserted' | 'skip'>;\n\n/** Provides details of changing model value */\nexport class ChangeDetails {\n /** Inserted symbols */\n inserted!: string;\n /** Additional offset if any changes occurred before tail */\n tailShift!: number;\n /** Raw inserted is used by dynamic mask */\n rawInserted!: string;\n /** Can skip chars */\n skip!: boolean;\n\n static normalize(prep: string | [string, ChangeDetails]): [string, ChangeDetails] {\n return Array.isArray(prep) ? prep : [prep, new ChangeDetails()];\n }\n\n constructor(details?: Partial<ChangeDetailsOptions>) {\n Object.assign(\n this,\n {\n inserted: '',\n rawInserted: '',\n tailShift: 0,\n skip: false,\n },\n details,\n );\n }\n\n /** Aggregate changes */\n aggregate(details: ChangeDetails): this {\n this.inserted += details.inserted;\n this.rawInserted += details.rawInserted;\n this.tailShift += details.tailShift;\n this.skip = this.skip || details.skip;\n\n return this;\n }\n\n /** Total offset considering all changes */\n get offset(): number {\n return this.tailShift + this.inserted.length;\n }\n\n get consumed(): boolean {\n return Boolean(this.rawInserted) || this.skip;\n }\n\n equals(details: ChangeDetails): boolean {\n return (\n this.inserted === details.inserted &&\n this.tailShift === details.tailShift &&\n this.rawInserted === details.rawInserted &&\n this.skip === details.skip\n );\n }\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ChangeDetails } from './change-details.js';
|
|
2
|
-
import type { TailDetails, AppendTail } from './tail-details.js';
|
|
3
|
-
type ContinuousTailState = Pick<ContinuousTailDetails, 'value' | 'from' | 'stop'>;
|
|
4
|
-
/** Provides details of continuous extracted tail */
|
|
5
|
-
export declare class ContinuousTailDetails implements TailDetails {
|
|
6
|
-
/** Tail value as string */
|
|
7
|
-
value: string;
|
|
8
|
-
/** Tail start position */
|
|
9
|
-
from: number;
|
|
10
|
-
/** Start position */
|
|
11
|
-
stop?: number;
|
|
12
|
-
constructor(value?: string, from?: number, stop?: number);
|
|
13
|
-
toString(): string;
|
|
14
|
-
extend(tail: string | TailDetails): void;
|
|
15
|
-
appendTo(masked: AppendTail): ChangeDetails;
|
|
16
|
-
get state(): ContinuousTailState;
|
|
17
|
-
set state(state: ContinuousTailState);
|
|
18
|
-
unshift(beforePos?: number): string;
|
|
19
|
-
shift(): string;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/** Provides details of continuous extracted tail */
|
|
2
|
-
var ContinuousTailDetails = /** @class */ (function () {
|
|
3
|
-
function ContinuousTailDetails(value, from, stop) {
|
|
4
|
-
if (value === void 0) { value = ''; }
|
|
5
|
-
if (from === void 0) { from = 0; }
|
|
6
|
-
this.value = value;
|
|
7
|
-
this.from = from;
|
|
8
|
-
this.stop = stop;
|
|
9
|
-
}
|
|
10
|
-
ContinuousTailDetails.prototype.toString = function () {
|
|
11
|
-
return this.value;
|
|
12
|
-
};
|
|
13
|
-
ContinuousTailDetails.prototype.extend = function (tail) {
|
|
14
|
-
this.value += String(tail);
|
|
15
|
-
};
|
|
16
|
-
ContinuousTailDetails.prototype.appendTo = function (masked) {
|
|
17
|
-
return masked.append(this.toString(), { tail: true }).aggregate(masked._appendPlaceholder());
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(ContinuousTailDetails.prototype, "state", {
|
|
20
|
-
get: function () {
|
|
21
|
-
return {
|
|
22
|
-
value: this.value,
|
|
23
|
-
from: this.from,
|
|
24
|
-
stop: this.stop,
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
set: function (state) {
|
|
28
|
-
Object.assign(this, state);
|
|
29
|
-
},
|
|
30
|
-
enumerable: false,
|
|
31
|
-
configurable: true
|
|
32
|
-
});
|
|
33
|
-
ContinuousTailDetails.prototype.unshift = function (beforePos) {
|
|
34
|
-
if (!this.value.length || (beforePos != null && this.from >= beforePos)) {
|
|
35
|
-
return '';
|
|
36
|
-
}
|
|
37
|
-
var shiftChar = this.value[0];
|
|
38
|
-
this.value = this.value.slice(1);
|
|
39
|
-
return shiftChar;
|
|
40
|
-
};
|
|
41
|
-
ContinuousTailDetails.prototype.shift = function () {
|
|
42
|
-
if (!this.value.length) {
|
|
43
|
-
return '';
|
|
44
|
-
}
|
|
45
|
-
var shiftChar = this.value[this.value.length - 1];
|
|
46
|
-
this.value = this.value.slice(0, -1);
|
|
47
|
-
return shiftChar;
|
|
48
|
-
};
|
|
49
|
-
return ContinuousTailDetails;
|
|
50
|
-
}());
|
|
51
|
-
export { ContinuousTailDetails };
|
|
52
|
-
//# sourceMappingURL=continuous-tail-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuous-tail-details.js","sourceRoot":"","sources":["continuous-tail-details.ts"],"names":[],"mappings":"AAMA,oDAAoD;AACpD;IAQE,+BAAY,KAAkB,EAAE,IAAgB,EAAE,IAAa;QAAnD,sBAAA,EAAA,UAAkB;QAAE,qBAAA,EAAA,QAAgB;QAC9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,wCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,sCAAM,GAAN,UAAO,IAA0B;QAC/B,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,wCAAQ,GAAR,UAAS,MAAkB;QACzB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED,sBAAI,wCAAK;aAAT;YACE,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC;QACJ,CAAC;aAED,UAAU,KAA0B;YAClC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;;;OAJA;IAMD,uCAAO,GAAP,UAAQ,SAAkB;QACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,SAAS,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,CAAC;YACxE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,qCAAK,GAAL;QACE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IACH,4BAAC;AAAD,CAAC,AAzDD,IAyDC","sourcesContent":["import type { ChangeDetails } from './change-details.js';\n/* eslint-disable default-param-last, eqeqeq */\nimport type { TailDetails, AppendTail } from './tail-details.js';\n\ntype ContinuousTailState = Pick<ContinuousTailDetails, 'value' | 'from' | 'stop'>;\n\n/** Provides details of continuous extracted tail */\nexport class ContinuousTailDetails implements TailDetails {\n /** Tail value as string */\n value!: string;\n /** Tail start position */\n from!: number;\n /** Start position */\n stop?: number;\n\n constructor(value: string = '', from: number = 0, stop?: number) {\n this.value = value;\n this.from = from;\n this.stop = stop;\n }\n\n toString(): string {\n return this.value;\n }\n\n extend(tail: string | TailDetails): void {\n this.value += String(tail);\n }\n\n appendTo(masked: AppendTail): ChangeDetails {\n return masked.append(this.toString(), { tail: true }).aggregate(masked._appendPlaceholder());\n }\n\n get state(): ContinuousTailState {\n return {\n value: this.value,\n from: this.from,\n stop: this.stop,\n };\n }\n\n set state(state: ContinuousTailState) {\n Object.assign(this, state);\n }\n\n unshift(beforePos?: number): string {\n if (!this.value.length || (beforePos != null && this.from >= beforePos)) {\n return '';\n }\n\n const shiftChar = this.value[0];\n this.value = this.value.slice(1);\n return shiftChar;\n }\n\n shift(): string {\n if (!this.value.length) {\n return '';\n }\n\n const shiftChar = this.value[this.value.length - 1];\n this.value = this.value.slice(0, -1);\n return shiftChar;\n }\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { HTMLInputMaskElement as HTMLInputMaskElementImpl } from '../controls/html-input-mask-element.js';
|
|
2
|
-
import { HTMLMaskElement as HTMLMaskElementImpl } from '../controls/html-mask-element.js';
|
|
3
|
-
import { InputMask } from '../controls/input.js';
|
|
4
|
-
import type { InputMaskElement } from '../controls/input.js';
|
|
5
|
-
import { MaskElement as MaskElementImpl } from '../controls/mask-element.js';
|
|
6
|
-
import { Masked as MaskedBase } from '../masked/base.js';
|
|
7
|
-
import type { FactoryArg } from '../masked/factory.js';
|
|
8
|
-
import { createMask as createMaskFn } from '../masked/factory.js';
|
|
9
|
-
import { MaskedPattern as MaskedPatternImpl } from '../masked/pattern.js';
|
|
10
|
-
import { MaskedRegExp as MaskedRegExpImpl } from '../masked/regexp.js';
|
|
11
|
-
import { ChangeDetails as ChangeDetailsImpl } from './change-details.js';
|
|
12
|
-
export { InputMask } from '../controls/input.js';
|
|
13
|
-
export { Masked } from '../masked/base.js';
|
|
14
|
-
export { MaskedPattern } from '../masked/pattern.js';
|
|
15
|
-
export { MaskedRegExp } from '../masked/regexp.js';
|
|
16
|
-
export { ChangeDetails } from './change-details.js';
|
|
17
|
-
export { MaskElement } from '../controls/mask-element.js';
|
|
18
|
-
export { HTMLMaskElement } from '../controls/html-mask-element.js';
|
|
19
|
-
export { HTMLInputMaskElement } from '../controls/html-input-mask-element.js';
|
|
20
|
-
export { createMask } from '../masked/factory.js';
|
|
21
|
-
interface IMaskFunction {
|
|
22
|
-
<Opts extends FactoryArg>(el: InputMaskElement, opts: Opts): InputMask<Opts>;
|
|
23
|
-
InputMask: typeof InputMask;
|
|
24
|
-
Masked: typeof MaskedBase;
|
|
25
|
-
MaskedPattern: typeof MaskedPatternImpl;
|
|
26
|
-
MaskedRegExp: typeof MaskedRegExpImpl;
|
|
27
|
-
ChangeDetails: typeof ChangeDetailsImpl;
|
|
28
|
-
MaskElement: typeof MaskElementImpl;
|
|
29
|
-
HTMLMaskElement: typeof HTMLMaskElementImpl;
|
|
30
|
-
HTMLInputMaskElement: typeof HTMLInputMaskElementImpl;
|
|
31
|
-
createMask: typeof createMaskFn;
|
|
32
|
-
}
|
|
33
|
-
declare const IMask: IMaskFunction;
|
|
34
|
-
export { IMask };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Re-export everything from submodules
|
|
2
|
-
// This is side-effect free
|
|
3
|
-
import { HTMLInputMaskElement as HTMLInputMaskElementImpl } from '../controls/html-input-mask-element.js';
|
|
4
|
-
import { HTMLMaskElement as HTMLMaskElementImpl } from '../controls/html-mask-element.js';
|
|
5
|
-
// Import all implementations
|
|
6
|
-
import { InputMask } from '../controls/input.js';
|
|
7
|
-
import { MaskElement as MaskElementImpl } from '../controls/mask-element.js';
|
|
8
|
-
import { Masked as MaskedBase } from '../masked/base.js';
|
|
9
|
-
import { createMask as createMaskFn } from '../masked/factory.js';
|
|
10
|
-
import { MaskedPattern as MaskedPatternImpl } from '../masked/pattern.js';
|
|
11
|
-
import { MaskedRegExp as MaskedRegExpImpl } from '../masked/regexp.js';
|
|
12
|
-
import { ChangeDetails as ChangeDetailsImpl } from './change-details.js';
|
|
13
|
-
// Export types and implementations
|
|
14
|
-
export { InputMask } from '../controls/input.js';
|
|
15
|
-
export { Masked } from '../masked/base.js';
|
|
16
|
-
export { MaskedPattern } from '../masked/pattern.js';
|
|
17
|
-
export { MaskedRegExp } from '../masked/regexp.js';
|
|
18
|
-
export { ChangeDetails } from './change-details.js';
|
|
19
|
-
export { MaskElement } from '../controls/mask-element.js';
|
|
20
|
-
export { HTMLMaskElement } from '../controls/html-mask-element.js';
|
|
21
|
-
export { HTMLInputMaskElement } from '../controls/html-input-mask-element.js';
|
|
22
|
-
export { createMask } from '../masked/factory.js';
|
|
23
|
-
function IMaskFn(el, opts) {
|
|
24
|
-
return new InputMask(el, opts);
|
|
25
|
-
}
|
|
26
|
-
// Attach all static properties
|
|
27
|
-
IMaskFn.InputMask = InputMask;
|
|
28
|
-
IMaskFn.Masked = MaskedBase;
|
|
29
|
-
IMaskFn.MaskedPattern = MaskedPatternImpl;
|
|
30
|
-
IMaskFn.MaskedRegExp = MaskedRegExpImpl;
|
|
31
|
-
IMaskFn.ChangeDetails = ChangeDetailsImpl;
|
|
32
|
-
IMaskFn.MaskElement = MaskElementImpl;
|
|
33
|
-
IMaskFn.HTMLMaskElement = HTMLMaskElementImpl;
|
|
34
|
-
IMaskFn.HTMLInputMaskElement = HTMLInputMaskElementImpl;
|
|
35
|
-
IMaskFn.createMask = createMaskFn;
|
|
36
|
-
var IMask = IMaskFn;
|
|
37
|
-
export { IMask };
|
|
38
|
-
//# sourceMappingURL=holder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"holder.js","sourceRoot":"","sources":["holder.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,2BAA2B;AAE3B,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAC1G,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,6BAA6B;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WA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AG,eAAe,CAAC;AACxD,OAAyB,CAAC,eAAe,GAAG,mBAAmB,CAAC;AAChE,OAAyB,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;AAC1E,OAAyB,CAAC,UAAU,GAAG,YAAY,CAAC;AAErD,IAAM,KAAK,GAAkB,OAAwB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["// Re-export everything from submodules\n// This is side-effect free\n\nimport { HTMLInputMaskElement as HTMLInputMaskElementImpl } from '../controls/html-input-mask-element.js';\nimport { HTMLMaskElement as HTMLMaskElementImpl } from '../controls/html-mask-element.js';\n// Import all implementations\nimport { InputMask } from '../controls/input.js';\nimport type { InputMaskElement } from '../controls/input.js';\nimport { MaskElement as MaskElementImpl } from '../controls/mask-element.js';\nimport { Masked as MaskedBase } from '../masked/base.js';\nimport type { FactoryArg } from '../masked/factory.js';\nimport { createMask as createMaskFn } from '../masked/factory.js';\nimport { MaskedPattern as MaskedPatternImpl } from '../masked/pattern.js';\nimport { MaskedRegExp as MaskedRegExpImpl } from '../masked/regexp.js';\nimport { ChangeDetails as ChangeDetailsImpl } from './change-details.js';\n\n// Export types and implementations\nexport { InputMask } from '../controls/input.js';\nexport { Masked } from '../masked/base.js';\nexport { MaskedPattern } from '../masked/pattern.js';\nexport { MaskedRegExp } from '../masked/regexp.js';\nexport { ChangeDetails } from './change-details.js';\nexport { MaskElement } from '../controls/mask-element.js';\nexport { HTMLMaskElement } from '../controls/html-mask-element.js';\nexport { HTMLInputMaskElement } from '../controls/html-input-mask-element.js';\nexport { createMask } from '../masked/factory.js';\n\ninterface IMaskFunction {\n <Opts extends FactoryArg>(el: InputMaskElement, opts: Opts): InputMask<Opts>;\n // Attach static properties\n InputMask: typeof InputMask;\n Masked: typeof MaskedBase;\n MaskedPattern: typeof MaskedPatternImpl;\n MaskedRegExp: typeof MaskedRegExpImpl;\n ChangeDetails: typeof ChangeDetailsImpl;\n MaskElement: typeof MaskElementImpl;\n HTMLMaskElement: typeof HTMLMaskElementImpl;\n HTMLInputMaskElement: typeof HTMLInputMaskElementImpl;\n createMask: typeof createMaskFn;\n}\n\nfunction IMaskFn<Opts extends FactoryArg>(el: InputMaskElement, opts: Opts): InputMask<Opts> {\n return new InputMask(el, opts);\n}\n\n// Attach all static properties\n(IMaskFn as IMaskFunction).InputMask = InputMask;\n(IMaskFn as IMaskFunction).Masked = MaskedBase;\n(IMaskFn as IMaskFunction).MaskedPattern = MaskedPatternImpl;\n(IMaskFn as IMaskFunction).MaskedRegExp = MaskedRegExpImpl;\n(IMaskFn as IMaskFunction).ChangeDetails = ChangeDetailsImpl;\n(IMaskFn as IMaskFunction).MaskElement = MaskElementImpl;\n(IMaskFn as IMaskFunction).HTMLMaskElement = HTMLMaskElementImpl;\n(IMaskFn as IMaskFunction).HTMLInputMaskElement = HTMLInputMaskElementImpl;\n(IMaskFn as IMaskFunction).createMask = createMaskFn;\n\nconst IMask: IMaskFunction = IMaskFn as IMaskFunction;\nexport { IMask };\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AppendFlags } from '../masked/base.js';
|
|
2
|
-
import type { ChangeDetails } from './change-details.js';
|
|
3
|
-
export interface AppendTail {
|
|
4
|
-
append(str: string, flags?: AppendFlags): ChangeDetails;
|
|
5
|
-
_appendPlaceholder(): ChangeDetails;
|
|
6
|
-
}
|
|
7
|
-
/** Provides details of extracted tail */
|
|
8
|
-
export interface TailDetails {
|
|
9
|
-
/** Tail start position */
|
|
10
|
-
from: number;
|
|
11
|
-
/** Start position */
|
|
12
|
-
stop?: number;
|
|
13
|
-
/** */
|
|
14
|
-
state: any;
|
|
15
|
-
toString(): string;
|
|
16
|
-
extend(value: string | TailDetails): void;
|
|
17
|
-
appendTo(masked: AppendTail): ChangeDetails;
|
|
18
|
-
unshift(beforePos?: number): string;
|
|
19
|
-
shift(): string;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tail-details.js","sourceRoot":"","sources":["tail-details.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppendFlags } from '../masked/base.js';\nimport type { ChangeDetails } from './change-details.js';\n\nexport interface AppendTail {\n append(str: string, flags?: AppendFlags): ChangeDetails;\n _appendPlaceholder(): ChangeDetails;\n}\n\n/** Provides details of extracted tail */\nexport interface TailDetails {\n /** Tail start position */\n from: number;\n /** Start position */\n stop?: number;\n /** */\n state: any;\n\n toString(): string;\n extend(value: string | TailDetails): void;\n appendTo(masked: AppendTail): ChangeDetails;\n unshift(beforePos?: number): string;\n shift(): string;\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** Checks if value is string */
|
|
2
|
-
export declare function isString(str: unknown): str is string;
|
|
3
|
-
/** Checks if value is object */
|
|
4
|
-
export declare function isObject(obj: unknown): obj is object;
|
|
5
|
-
export declare function pick<T extends Record<string, any>, K extends keyof T, V extends T[keyof T]>(obj: T, keys: K[] | ((v: V, k: K) => boolean)): Pick<T, K>;
|
|
6
|
-
/** Direction */
|
|
7
|
-
export declare const DIRECTION: {
|
|
8
|
-
readonly NONE: "NONE";
|
|
9
|
-
readonly LEFT: "LEFT";
|
|
10
|
-
readonly FORCE_LEFT: "FORCE_LEFT";
|
|
11
|
-
readonly RIGHT: "RIGHT";
|
|
12
|
-
readonly FORCE_RIGHT: "FORCE_RIGHT";
|
|
13
|
-
};
|
|
14
|
-
/** Direction */
|
|
15
|
-
export type Direction = (typeof DIRECTION)[keyof typeof DIRECTION];
|
|
16
|
-
export declare function forceDirection(direction: Direction): Direction;
|
|
17
|
-
/** Escapes regular expression control chars */
|
|
18
|
-
export declare function escapeRegExp(str: string): string;
|
|
19
|
-
export declare function objectIncludes(b: unknown, a: unknown): boolean;
|
|
20
|
-
/** Selection range */
|
|
21
|
-
export interface Selection {
|
|
22
|
-
start: number;
|
|
23
|
-
end: number;
|
|
24
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/* eslint-disable eqeqeq */
|
|
2
|
-
/** Checks if value is string */
|
|
3
|
-
export function isString(str) {
|
|
4
|
-
return typeof str === 'string' || str instanceof String;
|
|
5
|
-
}
|
|
6
|
-
/** Checks if value is object */
|
|
7
|
-
export function isObject(obj) {
|
|
8
|
-
var _a;
|
|
9
|
-
return typeof obj === 'object' && obj != null && ((_a = obj === null || obj === void 0 ? void 0 : obj.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Object';
|
|
10
|
-
}
|
|
11
|
-
export function pick(obj, keys) {
|
|
12
|
-
if (Array.isArray(keys)) {
|
|
13
|
-
return pick(obj, function (_, k) { return keys.includes(k); });
|
|
14
|
-
}
|
|
15
|
-
return Object.entries(obj).reduce(function (acc, _a) {
|
|
16
|
-
var k = _a[0], v = _a[1];
|
|
17
|
-
if (keys(v, k)) {
|
|
18
|
-
acc[k] = v;
|
|
19
|
-
}
|
|
20
|
-
return acc;
|
|
21
|
-
}, {});
|
|
22
|
-
}
|
|
23
|
-
/** Direction */
|
|
24
|
-
export var DIRECTION = {
|
|
25
|
-
NONE: 'NONE',
|
|
26
|
-
LEFT: 'LEFT',
|
|
27
|
-
FORCE_LEFT: 'FORCE_LEFT',
|
|
28
|
-
RIGHT: 'RIGHT',
|
|
29
|
-
FORCE_RIGHT: 'FORCE_RIGHT',
|
|
30
|
-
};
|
|
31
|
-
export function forceDirection(direction) {
|
|
32
|
-
switch (direction) {
|
|
33
|
-
case DIRECTION.LEFT:
|
|
34
|
-
return DIRECTION.FORCE_LEFT;
|
|
35
|
-
case DIRECTION.RIGHT:
|
|
36
|
-
return DIRECTION.FORCE_RIGHT;
|
|
37
|
-
default:
|
|
38
|
-
return direction;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/** Escapes regular expression control chars */
|
|
42
|
-
export function escapeRegExp(str) {
|
|
43
|
-
return str.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1');
|
|
44
|
-
}
|
|
45
|
-
// cloned from https://github.com/epoberezkin/fast-deep-equal with small changes
|
|
46
|
-
export function objectIncludes(b, a) {
|
|
47
|
-
if (a === b) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
var arrA = Array.isArray(a), arrB = Array.isArray(b);
|
|
51
|
-
var i;
|
|
52
|
-
if (arrA && arrB) {
|
|
53
|
-
if (a.length != b.length) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
for (i = 0; i < a.length; i++) {
|
|
57
|
-
if (!objectIncludes(a[i], b[i])) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
if (arrA != arrB) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
if (a && b && typeof a === 'object' && typeof b === 'object') {
|
|
67
|
-
var dateA = a instanceof Date, dateB = b instanceof Date;
|
|
68
|
-
if (dateA && dateB) {
|
|
69
|
-
return a.getTime() == b.getTime();
|
|
70
|
-
}
|
|
71
|
-
if (dateA != dateB) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
var regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
|
|
75
|
-
if (regexpA && regexpB) {
|
|
76
|
-
return a.toString() == b.toString();
|
|
77
|
-
}
|
|
78
|
-
if (regexpA != regexpB) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
var keys = Object.keys(a);
|
|
82
|
-
// if (keys.length !== Object.keys(b).length) return false;
|
|
83
|
-
for (i = 0; i < keys.length; i++) {
|
|
84
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
for (i = 0; i < keys.length; i++) {
|
|
89
|
-
if (!objectIncludes(b[keys[i]], a[keys[i]])) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
else if (a && b && typeof a === 'function' && typeof b === 'function') {
|
|
96
|
-
return a.toString() === b.toString();
|
|
97
|
-
}
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,gCAAgC;AAChC,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,YAAY,MAAM,CAAC;AAC1D,CAAC;AAED,gCAAgC;AAChC,MAAM,UAAU,QAAQ,CAAC,GAAY;;IACnC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,IAAI,IAAI,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,0CAAE,IAAI,MAAK,QAAQ,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,IAAI,CAClB,GAAM,EACN,IAAqC;IAErC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,GAAG,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAhB,CAAgB,CAAC,CAAC;IAC/C,CAAC;IACD,OAAQ,MAAM,CAAC,OAAO,CAAC,GAAG,CAA8B,CAAC,MAAM,CAC7D,UAAC,GAAG,EAAE,EAAM;YAAL,CAAC,QAAA,EAAE,CAAC,QAAA;QACT,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACd,GAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAgB,CACjB,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,IAAM,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,UA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AAC,CAAC,CAAmB,CAAC,CAAC,EAAE,CAAC;gBAChF,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,KAAK,UAAU,EAAE,CAAC;QACxE,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/* eslint-disable eqeqeq */\n\n/** Checks if value is string */\nexport function isString(str: unknown): str is string {\n return typeof str === 'string' || str instanceof String;\n}\n\n/** Checks if value is object */\nexport function isObject(obj: unknown): obj is object {\n return typeof obj === 'object' && obj != null && obj?.constructor?.name === 'Object';\n}\n\nexport function pick<T extends Record<string, any>, K extends keyof T, V extends T[keyof T]>(\n obj: T,\n keys: K[] | ((v: V, k: K) => boolean),\n): Pick<T, K> {\n if (Array.isArray(keys)) {\n return pick(obj, (_, k) => keys.includes(k));\n }\n return (Object.entries(obj) as unknown as Array<[K, V]>).reduce(\n (acc, [k, v]) => {\n if (keys(v, k)) {\n (acc as Record<K, V>)[k] = v;\n }\n return acc;\n },\n {} as Pick<T, K>,\n );\n}\n\n/** Direction */\nexport const DIRECTION = {\n NONE: 'NONE',\n LEFT: 'LEFT',\n FORCE_LEFT: 'FORCE_LEFT',\n RIGHT: 'RIGHT',\n FORCE_RIGHT: 'FORCE_RIGHT',\n} as const;\n\n/** Direction */\nexport type Direction = (typeof DIRECTION)[keyof typeof DIRECTION];\n\nexport function forceDirection(direction: Direction): Direction {\n switch (direction) {\n case DIRECTION.LEFT:\n return DIRECTION.FORCE_LEFT;\n case DIRECTION.RIGHT:\n return DIRECTION.FORCE_RIGHT;\n default:\n return direction;\n }\n}\n\n/** Escapes regular expression control chars */\nexport function escapeRegExp(str: string): string {\n return str.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1');\n}\n\n// cloned from https://github.com/epoberezkin/fast-deep-equal with small changes\nexport function objectIncludes(b: unknown, a: unknown): boolean {\n if (a === b) {\n return true;\n }\n\n const arrA = Array.isArray(a),\n arrB = Array.isArray(b);\n let i;\n\n if (arrA && arrB) {\n if (a.length != b.length) {\n return false;\n }\n for (i = 0; i < a.length; i++) {\n if (!objectIncludes(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n\n if (arrA != arrB) {\n return false;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n const dateA = a instanceof Date,\n dateB = b instanceof Date;\n if (dateA && dateB) {\n return a.getTime() == b.getTime();\n }\n if (dateA != dateB) {\n return false;\n }\n\n const regexpA = a instanceof RegExp,\n regexpB = b instanceof RegExp;\n if (regexpA && regexpB) {\n return a.toString() == b.toString();\n }\n if (regexpA != regexpB) {\n return false;\n }\n\n const keys = Object.keys(a);\n // if (keys.length !== Object.keys(b).length) return false;\n\n for (i = 0; i < keys.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n\n for (i = 0; i < keys.length; i++) {\n if (!objectIncludes(b[keys[i] as keyof typeof b], a[keys[i] as keyof typeof a])) {\n return false;\n }\n }\n\n return true;\n } else if (a && b && typeof a === 'function' && typeof b === 'function') {\n return a.toString() === b.toString();\n }\n\n return false;\n}\n\n/** Selection range */\nexport interface Selection {\n start: number;\n end: number;\n}\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { InputMaskElement } from './controls/input.js';
|
|
2
|
-
import { InputMask } from './controls/input.js';
|
|
3
|
-
import type { FactoryArg, FactoryOpts } from './masked/factory.js';
|
|
4
|
-
export { InputMask };
|
|
5
|
-
export declare function IMask(el: InputMaskElement, opts: FactoryOpts): InputMask<FactoryArg>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imask.js","sourceRoot":"","sources":["imask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,mBAAmB;AACnB,MAAM,UAAU,KAAK,CAAC,EAAoB,EAAE,IAAiB;IAC3D,OAAO,IAAI,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import type { InputMaskElement } from './controls/input.js';\nimport { InputMask } from './controls/input.js';\nimport type { FactoryArg, FactoryOpts } from './masked/factory.js';\nexport { InputMask };\n\n// Factory function\nexport function IMask(el: InputMaskElement, opts: FactoryOpts): InputMask<FactoryArg> {\n return new InputMask(el, opts);\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IMask } from './imask.js';
|
|
2
|
-
export { HTMLInputMaskElement, type InputElement } from './controls/html-input-mask-element.js';
|
|
3
|
-
export { HTMLMaskElement } from './controls/html-mask-element.js';
|
|
4
|
-
export { InputMask, type InputMaskElement } from './controls/input.js';
|
|
5
|
-
export { MaskElement } from './controls/mask-element.js';
|
|
6
|
-
export { ChangeDetails, type ChangeDetailsOptions } from './core/change-details.js';
|
|
7
|
-
export { type AppendTail, type TailDetails } from './core/tail-details.js';
|
|
8
|
-
export { DIRECTION, forceDirection, type Direction, type Selection } from './core/utils.js';
|
|
9
|
-
export { Masked, type AppendFlags, type ExtractFlags, type MaskedOptions, type MaskedState } from './masked/base.js';
|
|
10
|
-
export { createMask, normalizeOpts, type AllFactoryStaticOpts, type FactoryArg, type FactoryConstructorOpts, type FactoryConstructorReturnMasked, type FactoryInstanceOpts, type FactoryInstanceReturnMasked, type FactoryOpts, type FactoryReturnMasked, type FactoryStaticOpts, type FactoryStaticReturnMasked, type NormalizedOpts, type UpdateOpts, } from './masked/factory.js';
|
|
11
|
-
export { MaskedPattern, type BlockPosData, type Definitions, type MaskedPatternOptions, type MaskedPatternState, } from './masked/pattern.js';
|
|
12
|
-
export type { PatternBlock } from './masked/patterns/block.js';
|
|
13
|
-
export { ChunksTailDetails, type ChunksTailState } from './masked/patterns/chunk-tail-details.js';
|
|
14
|
-
export { PatternFixedDefinition, type PatternFixedDefinitionOptions } from './masked/patterns/fixed-definition.js';
|
|
15
|
-
export { PatternInputDefinition, type PatternInputDefinitionOptions, type PatternInputDefinitionState, } from './masked/patterns/input-definition.js';
|
|
16
|
-
export { MaskedRegExp, type MaskedRegExpOptions } from './masked/regexp.js';
|
|
17
|
-
export { IMask };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IMask } from './imask.js';
|
|
2
|
-
export { HTMLInputMaskElement } from './controls/html-input-mask-element.js';
|
|
3
|
-
export { HTMLMaskElement } from './controls/html-mask-element.js';
|
|
4
|
-
export { InputMask } from './controls/input.js';
|
|
5
|
-
export { MaskElement } from './controls/mask-element.js';
|
|
6
|
-
export { ChangeDetails } from './core/change-details.js';
|
|
7
|
-
export { DIRECTION, forceDirection } from './core/utils.js';
|
|
8
|
-
export { Masked } from './masked/base.js';
|
|
9
|
-
export { createMask, normalizeOpts, } from './masked/factory.js';
|
|
10
|
-
export { MaskedPattern, } from './masked/pattern.js';
|
|
11
|
-
export { ChunksTailDetails } from './masked/patterns/chunk-tail-details.js';
|
|
12
|
-
export { PatternFixedDefinition } from './masked/patterns/fixed-definition.js';
|
|
13
|
-
export { PatternInputDefinition, } from './masked/patterns/input-definition.js';
|
|
14
|
-
export { MaskedRegExp } from './masked/regexp.js';
|
|
15
|
-
export { IMask };
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAqB,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAyB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAA6B,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAkC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,MAAM,EAA6E,MAAM,kBAAkB,CAAC;AACrH,OAAO,EACL,UAAU,EACV,aAAa,GAad,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,GAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAwB,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAsC,MAAM,uCAAuC,CAAC;AACnH,OAAO,EACL,sBAAsB,GAGvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,YAAY,EAA4B,MAAM,oBAAoB,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import { IMask } from './imask.js';\nexport { HTMLInputMaskElement, type InputElement } from './controls/html-input-mask-element.js';\nexport { HTMLMaskElement } from './controls/html-mask-element.js';\nexport { InputMask, type InputMaskElement } from './controls/input.js';\nexport { MaskElement } from './controls/mask-element.js';\nexport { ChangeDetails, type ChangeDetailsOptions } from './core/change-details.js';\nexport { type AppendTail, type TailDetails } from './core/tail-details.js';\nexport { DIRECTION, forceDirection, type Direction, type Selection } from './core/utils.js';\nexport { Masked, type AppendFlags, type ExtractFlags, type MaskedOptions, type MaskedState } from './masked/base.js';\nexport {\n createMask,\n normalizeOpts,\n type AllFactoryStaticOpts,\n type FactoryArg,\n type FactoryConstructorOpts,\n type FactoryConstructorReturnMasked,\n type FactoryInstanceOpts,\n type FactoryInstanceReturnMasked,\n type FactoryOpts,\n type FactoryReturnMasked,\n type FactoryStaticOpts,\n type FactoryStaticReturnMasked,\n type NormalizedOpts,\n type UpdateOpts,\n} from './masked/factory.js';\nexport {\n MaskedPattern,\n type BlockPosData,\n type Definitions,\n type MaskedPatternOptions,\n type MaskedPatternState,\n} from './masked/pattern.js';\nexport type { PatternBlock } from './masked/patterns/block.js';\nexport { ChunksTailDetails, type ChunksTailState } from './masked/patterns/chunk-tail-details.js';\nexport { PatternFixedDefinition, type PatternFixedDefinitionOptions } from './masked/patterns/fixed-definition.js';\nexport {\n PatternInputDefinition,\n type PatternInputDefinitionOptions,\n type PatternInputDefinitionState,\n} from './masked/patterns/input-definition.js';\nexport { MaskedRegExp, type MaskedRegExpOptions } from './masked/regexp.js';\n\nexport { IMask };\n"]}
|