@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,106 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
import { MaskElement } from './mask-element.js';
|
|
17
|
-
/** Bridge between HTMLElement and {@link Masked} */
|
|
18
|
-
var HTMLMaskElement = /** @class */ (function (_super) {
|
|
19
|
-
__extends(HTMLMaskElement, _super);
|
|
20
|
-
function HTMLMaskElement(input) {
|
|
21
|
-
var _this = _super.call(this) || this;
|
|
22
|
-
_this.input = input;
|
|
23
|
-
_this._onKeydown = _this._onKeydown.bind(_this);
|
|
24
|
-
_this._onInput = _this._onInput.bind(_this);
|
|
25
|
-
_this._onBeforeinput = _this._onBeforeinput.bind(_this);
|
|
26
|
-
_this._onCompositionEnd = _this._onCompositionEnd.bind(_this);
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
Object.defineProperty(HTMLMaskElement.prototype, "rootElement", {
|
|
30
|
-
get: function () {
|
|
31
|
-
var _a, _b, _c;
|
|
32
|
-
return ((_c = (_b = (_a = this.input).getRootNode) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : document);
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(HTMLMaskElement.prototype, "isActive", {
|
|
38
|
-
/** Is element in focus */
|
|
39
|
-
get: function () {
|
|
40
|
-
return this.input === this.rootElement.activeElement;
|
|
41
|
-
},
|
|
42
|
-
enumerable: false,
|
|
43
|
-
configurable: true
|
|
44
|
-
});
|
|
45
|
-
/** Binds HTMLElement events to mask internal events */
|
|
46
|
-
HTMLMaskElement.prototype.bindEvents = function (handlers) {
|
|
47
|
-
this.input.addEventListener('keydown', this._onKeydown);
|
|
48
|
-
this.input.addEventListener('input', this._onInput);
|
|
49
|
-
this.input.addEventListener('beforeinput', this._onBeforeinput);
|
|
50
|
-
this.input.addEventListener('compositionend', this._onCompositionEnd);
|
|
51
|
-
this.input.addEventListener('drop', handlers.drop);
|
|
52
|
-
this.input.addEventListener('click', handlers.click);
|
|
53
|
-
this.input.addEventListener('focus', handlers.focus);
|
|
54
|
-
this.input.addEventListener('blur', handlers.commit);
|
|
55
|
-
this._handlers = handlers;
|
|
56
|
-
};
|
|
57
|
-
HTMLMaskElement.prototype._onKeydown = function (e) {
|
|
58
|
-
var isUndo = (e.key === 'z' || e.key === 'Z') && (e.metaKey || e.ctrlKey) && !e.shiftKey;
|
|
59
|
-
var isRedo = ((e.key === 'y' || e.key === 'Y') && (e.metaKey || e.ctrlKey)) ||
|
|
60
|
-
((e.key === 'z' || e.key === 'Z') && e.shiftKey && (e.metaKey || e.ctrlKey));
|
|
61
|
-
if (this._handlers.redo && isRedo) {
|
|
62
|
-
e.preventDefault();
|
|
63
|
-
return this._handlers.redo(e);
|
|
64
|
-
}
|
|
65
|
-
if (this._handlers.undo && isUndo) {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
return this._handlers.undo(e);
|
|
68
|
-
}
|
|
69
|
-
if (!e.isComposing) {
|
|
70
|
-
this._handlers.selectionChange(e);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
HTMLMaskElement.prototype._onBeforeinput = function (e) {
|
|
74
|
-
if (e.inputType === 'historyUndo' && this._handlers.undo) {
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
return this._handlers.undo(e);
|
|
77
|
-
}
|
|
78
|
-
if (e.inputType === 'historyRedo' && this._handlers.redo) {
|
|
79
|
-
e.preventDefault();
|
|
80
|
-
return this._handlers.redo(e);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
HTMLMaskElement.prototype._onCompositionEnd = function (e) {
|
|
84
|
-
this._handlers.input(e);
|
|
85
|
-
};
|
|
86
|
-
HTMLMaskElement.prototype._onInput = function (e) {
|
|
87
|
-
if (!e.isComposing) {
|
|
88
|
-
this._handlers.input(e);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
/** Unbinds HTMLElement events to mask internal events */
|
|
92
|
-
HTMLMaskElement.prototype.unbindEvents = function () {
|
|
93
|
-
this.input.removeEventListener('keydown', this._onKeydown);
|
|
94
|
-
this.input.removeEventListener('input', this._onInput);
|
|
95
|
-
this.input.removeEventListener('beforeinput', this._onBeforeinput);
|
|
96
|
-
this.input.removeEventListener('compositionend', this._onCompositionEnd);
|
|
97
|
-
this.input.removeEventListener('drop', this._handlers.drop);
|
|
98
|
-
this.input.removeEventListener('click', this._handlers.click);
|
|
99
|
-
this.input.removeEventListener('focus', this._handlers.focus);
|
|
100
|
-
this.input.removeEventListener('blur', this._handlers.commit);
|
|
101
|
-
this._handlers = {};
|
|
102
|
-
};
|
|
103
|
-
return HTMLMaskElement;
|
|
104
|
-
}(MaskElement));
|
|
105
|
-
export { HTMLMaskElement };
|
|
106
|
-
//# sourceMappingURL=html-mask-element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-mask-element.js","sourceRoot":"","sources":["html-mask-element.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAsB,MAAM,mBAAmB,CAAC;AAEpE,oDAAoD;AACpD;IAA8C,mCAAW;IAMvD,yBAAY,KAAkB;QAC5B,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,UAAU,GAAG,KAAI,CAAC,UAAU,CAAC,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C5D,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,SAAS,GAAG,EAAmB,CAAC;IACvC,CAAC;IACH,sBAAC;AAAD,CAAC,AA5FD,CAA8C,WAAW,GA4FxD","sourcesContent":["import { MaskElement, type EventHandlers } from './mask-element.js';\n\n/** Bridge between HTMLElement and {@link Masked} */\nexport abstract class HTMLMaskElement extends MaskElement {\n /** HTMLElement to use mask on */\n input!: HTMLElement;\n _handlers!: EventHandlers;\n abstract value: string;\n\n constructor(input: HTMLElement) {\n super();\n this.input = input;\n this._onKeydown = this._onKeydown.bind(this);\n this._onInput = this._onInput.bind(this);\n this._onBeforeinput = this._onBeforeinput.bind(this);\n this._onCompositionEnd = this._onCompositionEnd.bind(this);\n }\n\n get rootElement(): HTMLDocument {\n return (this.input.getRootNode?.() ?? document) as HTMLDocument;\n }\n\n /** Is element in focus */\n get isActive(): boolean {\n return this.input === this.rootElement.activeElement;\n }\n\n /** Binds HTMLElement events to mask internal events */\n override bindEvents(handlers: EventHandlers): void {\n this.input.addEventListener('keydown', this._onKeydown as EventListener);\n this.input.addEventListener('input', this._onInput as EventListener);\n this.input.addEventListener('beforeinput', this._onBeforeinput as EventListener);\n this.input.addEventListener('compositionend', this._onCompositionEnd as EventListener);\n this.input.addEventListener('drop', handlers.drop);\n this.input.addEventListener('click', handlers.click);\n this.input.addEventListener('focus', handlers.focus);\n this.input.addEventListener('blur', handlers.commit);\n this._handlers = handlers;\n }\n\n _onKeydown(e: KeyboardEvent): void {\n const isUndo = (e.key === 'z' || e.key === 'Z') && (e.metaKey || e.ctrlKey) && !e.shiftKey;\n const isRedo =\n ((e.key === 'y' || e.key === 'Y') && (e.metaKey || e.ctrlKey)) ||\n ((e.key === 'z' || e.key === 'Z') && e.shiftKey && (e.metaKey || e.ctrlKey));\n\n if (this._handlers.redo && isRedo) {\n e.preventDefault();\n return this._handlers.redo(e);\n }\n\n if (this._handlers.undo && isUndo) {\n e.preventDefault();\n return this._handlers.undo(e);\n }\n\n if (!e.isComposing) {\n this._handlers.selectionChange(e);\n }\n }\n\n _onBeforeinput(e: InputEvent): void {\n if (e.inputType === 'historyUndo' && this._handlers.undo) {\n e.preventDefault();\n return this._handlers.undo(e);\n }\n\n if (e.inputType === 'historyRedo' && this._handlers.redo) {\n e.preventDefault();\n return this._handlers.redo(e);\n }\n }\n\n _onCompositionEnd(e: CompositionEvent): void {\n this._handlers.input(e);\n }\n\n _onInput(e: InputEvent): void {\n if (!e.isComposing) {\n this._handlers.input(e);\n }\n }\n\n /** Unbinds HTMLElement events to mask internal events */\n override unbindEvents(): void {\n this.input.removeEventListener('keydown', this._onKeydown as EventListener);\n this.input.removeEventListener('input', this._onInput as EventListener);\n this.input.removeEventListener('beforeinput', this._onBeforeinput as EventListener);\n this.input.removeEventListener('compositionend', this._onCompositionEnd as EventListener);\n this.input.removeEventListener('drop', this._handlers.drop);\n this.input.removeEventListener('click', this._handlers.click);\n this.input.removeEventListener('focus', this._handlers.focus);\n this.input.removeEventListener('blur', this._handlers.commit);\n this._handlers = {} as EventHandlers;\n }\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Selection } from '../core/utils.js';
|
|
2
|
-
export interface InputHistoryState {
|
|
3
|
-
unmaskedValue: string;
|
|
4
|
-
selection: Selection;
|
|
5
|
-
}
|
|
6
|
-
export declare class InputHistory {
|
|
7
|
-
static MAX_LENGTH: number;
|
|
8
|
-
states: InputHistoryState[];
|
|
9
|
-
currentIndex: number;
|
|
10
|
-
get currentState(): InputHistoryState | undefined;
|
|
11
|
-
get isEmpty(): boolean;
|
|
12
|
-
push(state: InputHistoryState): void;
|
|
13
|
-
go(steps: number): InputHistoryState | undefined;
|
|
14
|
-
undo(): InputHistoryState | undefined;
|
|
15
|
-
redo(): InputHistoryState | undefined;
|
|
16
|
-
clear(): void;
|
|
17
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var InputHistory = /** @class */ (function () {
|
|
2
|
-
function InputHistory() {
|
|
3
|
-
this.states = [];
|
|
4
|
-
this.currentIndex = 0;
|
|
5
|
-
}
|
|
6
|
-
Object.defineProperty(InputHistory.prototype, "currentState", {
|
|
7
|
-
get: function () {
|
|
8
|
-
return this.states[this.currentIndex];
|
|
9
|
-
},
|
|
10
|
-
enumerable: false,
|
|
11
|
-
configurable: true
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(InputHistory.prototype, "isEmpty", {
|
|
14
|
-
get: function () {
|
|
15
|
-
return this.states.length === 0;
|
|
16
|
-
},
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true
|
|
19
|
-
});
|
|
20
|
-
InputHistory.prototype.push = function (state) {
|
|
21
|
-
// if current index points before the last element then remove the future
|
|
22
|
-
if (this.currentIndex < this.states.length - 1) {
|
|
23
|
-
this.states.length = this.currentIndex + 1;
|
|
24
|
-
}
|
|
25
|
-
this.states.push(state);
|
|
26
|
-
if (this.states.length > InputHistory.MAX_LENGTH) {
|
|
27
|
-
this.states.shift();
|
|
28
|
-
}
|
|
29
|
-
this.currentIndex = this.states.length - 1;
|
|
30
|
-
};
|
|
31
|
-
InputHistory.prototype.go = function (steps) {
|
|
32
|
-
this.currentIndex = Math.min(Math.max(this.currentIndex + steps, 0), this.states.length - 1);
|
|
33
|
-
return this.currentState;
|
|
34
|
-
};
|
|
35
|
-
InputHistory.prototype.undo = function () {
|
|
36
|
-
return this.go(-1);
|
|
37
|
-
};
|
|
38
|
-
InputHistory.prototype.redo = function () {
|
|
39
|
-
return this.go(+1);
|
|
40
|
-
};
|
|
41
|
-
InputHistory.prototype.clear = function () {
|
|
42
|
-
this.states.length = 0;
|
|
43
|
-
this.currentIndex = 0;
|
|
44
|
-
};
|
|
45
|
-
InputHistory.MAX_LENGTH = 100;
|
|
46
|
-
return InputHistory;
|
|
47
|
-
}());
|
|
48
|
-
export { InputHistory };
|
|
49
|
-
//# sourceMappingURL=input-history.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-history.js","sourceRoot":"","sources":["input-history.ts"],"names":[],"mappings":"AAOA;IAAA;QAEE,WAAM,GAAwB,EAAE,CAAC;QACjC,iBAAY,GAAG,CAAC,CAAC;IAuCnB,CAAC;IArCC,sBAAI,sCAAY;aAAhB;YACE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,CAAC;;;OAAA;IAED,sBAAI,iCAAO;aAAX;YACE,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;QAClC,CAAC;;;OAAA;IAED,2BAAI,GAAJ,UAAK,KAAwB;QAC3B,yEAAyE;QACzE,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;YACjD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED,yBAAE,GAAF,UAAG,KAAa;QACd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7F,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,2BAAI,GAAJ;QACE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,2BAAI,GAAJ;QACE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,4BAAK,GAAL;QACE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IACxB,CAAC;IAxCM,uBAAU,GAAG,GAAG,AAAN,CAAO;IAyC1B,mBAAC;CAAA,AA1CD,IA0CC;SA1CY,YAAY","sourcesContent":["import { type Selection } from '../core/utils.js';\n\nexport interface InputHistoryState {\n unmaskedValue: string;\n selection: Selection;\n}\n\nexport class InputHistory {\n static MAX_LENGTH = 100;\n states: InputHistoryState[] = [];\n currentIndex = 0;\n\n get currentState(): InputHistoryState | undefined {\n return this.states[this.currentIndex];\n }\n\n get isEmpty(): boolean {\n return this.states.length === 0;\n }\n\n push(state: InputHistoryState): void {\n // if current index points before the last element then remove the future\n if (this.currentIndex < this.states.length - 1) {\n this.states.length = this.currentIndex + 1;\n }\n this.states.push(state);\n if (this.states.length > InputHistory.MAX_LENGTH) {\n this.states.shift();\n }\n this.currentIndex = this.states.length - 1;\n }\n\n go(steps: number): InputHistoryState | undefined {\n this.currentIndex = Math.min(Math.max(this.currentIndex + steps, 0), this.states.length - 1);\n return this.currentState;\n }\n\n undo(): InputHistoryState | undefined {\n return this.go(-1);\n }\n\n redo(): InputHistoryState | undefined {\n return this.go(+1);\n }\n\n clear(): void {\n this.states.length = 0;\n this.currentIndex = 0;\n }\n}\n"]}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { type Selection } from '../core/utils.js';
|
|
2
|
-
import { type UpdateOpts, type FactoryArg, type FactoryReturnMasked } from '../masked/factory.js';
|
|
3
|
-
import { type InputElement } from './html-input-mask-element.js';
|
|
4
|
-
import { InputHistory, type InputHistoryState } from './input-history.js';
|
|
5
|
-
import { MaskElement } from './mask-element.js';
|
|
6
|
-
export type InputMaskElement = MaskElement | InputElement | HTMLElement;
|
|
7
|
-
export type InputMaskEventListener = (e?: InputEvent) => void;
|
|
8
|
-
/** Listens to element events and controls changes between element and {@link Masked} */
|
|
9
|
-
export declare class InputMask<Opts extends FactoryArg = Record<string, unknown>> {
|
|
10
|
-
/**
|
|
11
|
-
View element. Set to null after destroy() to release the reference.
|
|
12
|
-
*/
|
|
13
|
-
el: MaskElement | null;
|
|
14
|
-
/** Internal {@link Masked} model */
|
|
15
|
-
masked: FactoryReturnMasked<Opts>;
|
|
16
|
-
_listeners: Record<string, InputMaskEventListener[]>;
|
|
17
|
-
_value: string;
|
|
18
|
-
_changingCursorPos: number;
|
|
19
|
-
_unmaskedValue: string;
|
|
20
|
-
_rawInputValue: string;
|
|
21
|
-
_selection: Selection;
|
|
22
|
-
_cursorChanging?: ReturnType<typeof setTimeout>;
|
|
23
|
-
_historyChanging?: boolean;
|
|
24
|
-
_inputEvent?: InputEvent;
|
|
25
|
-
history: InputHistory;
|
|
26
|
-
constructor(el: InputMaskElement, opts: Opts);
|
|
27
|
-
maskEquals(mask: unknown): boolean;
|
|
28
|
-
/** Masked */
|
|
29
|
-
get mask(): FactoryReturnMasked<Opts>['mask'];
|
|
30
|
-
set mask(mask: unknown);
|
|
31
|
-
/** Raw value */
|
|
32
|
-
get value(): string;
|
|
33
|
-
set value(str: string);
|
|
34
|
-
/** Unmasked value */
|
|
35
|
-
get unmaskedValue(): string;
|
|
36
|
-
set unmaskedValue(str: string);
|
|
37
|
-
/** Raw input value */
|
|
38
|
-
get rawInputValue(): string;
|
|
39
|
-
set rawInputValue(str: string);
|
|
40
|
-
/** Typed unmasked value */
|
|
41
|
-
get typedValue(): FactoryReturnMasked<Opts>['typedValue'];
|
|
42
|
-
set typedValue(val: FactoryReturnMasked<Opts>['typedValue']);
|
|
43
|
-
/** Display value */
|
|
44
|
-
get displayValue(): string;
|
|
45
|
-
/** Starts listening to element events */
|
|
46
|
-
_bindEvents(): void;
|
|
47
|
-
/** Stops listening to element events */
|
|
48
|
-
_unbindEvents(): void;
|
|
49
|
-
/** Fires custom event */
|
|
50
|
-
_fireEvent(ev: string, e?: InputEvent): void;
|
|
51
|
-
/** Current selection start */
|
|
52
|
-
get selectionStart(): number;
|
|
53
|
-
/** Current cursor position */
|
|
54
|
-
get cursorPos(): number;
|
|
55
|
-
set cursorPos(pos: number);
|
|
56
|
-
/** Stores current selection */
|
|
57
|
-
_saveSelection(): void;
|
|
58
|
-
/** Syncronizes model value from view */
|
|
59
|
-
updateValue(): void;
|
|
60
|
-
/** Syncronizes view from model value, fires change events */
|
|
61
|
-
updateControl(cursorPos?: number | 'auto'): void;
|
|
62
|
-
/** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
|
|
63
|
-
updateOptions(opts: UpdateOpts<Opts>): void;
|
|
64
|
-
/** Updates cursor */
|
|
65
|
-
updateCursor(cursorPos: number): void;
|
|
66
|
-
/** Delays cursor update to support mobile browsers */
|
|
67
|
-
_delayUpdateCursor(cursorPos: number): void;
|
|
68
|
-
/** Fires custom events */
|
|
69
|
-
_fireChangeEvents(): void;
|
|
70
|
-
/** Aborts delayed cursor update */
|
|
71
|
-
_abortUpdateCursor(): void;
|
|
72
|
-
/** Aligns cursor to nearest available position */
|
|
73
|
-
alignCursor(): void;
|
|
74
|
-
/** Aligns cursor only if selection is empty */
|
|
75
|
-
alignCursorFriendly(): void;
|
|
76
|
-
/** Adds listener on custom event */
|
|
77
|
-
on(ev: string, handler: InputMaskEventListener): this;
|
|
78
|
-
/** Removes custom event listener */
|
|
79
|
-
off(ev: string, handler: InputMaskEventListener): this;
|
|
80
|
-
/** Handles view input event */
|
|
81
|
-
_onInput(e: InputEvent): void;
|
|
82
|
-
/** Handles view change event and commits model value */
|
|
83
|
-
_onChange(): void;
|
|
84
|
-
/** Handles view drop event, prevents by default */
|
|
85
|
-
_onDrop(ev: Event): void;
|
|
86
|
-
/** Restore last selection on focus */
|
|
87
|
-
_onFocus(): void;
|
|
88
|
-
/** Restore last selection on focus */
|
|
89
|
-
_onClick(): void;
|
|
90
|
-
_onUndo(): void;
|
|
91
|
-
_onRedo(): void;
|
|
92
|
-
_applyHistoryState(state: InputHistoryState | undefined): void;
|
|
93
|
-
/** Unbind view events and removes element reference */
|
|
94
|
-
destroy(): void;
|
|
95
|
-
}
|