infinity-forge 3.4.6 → 3.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system/presentation/components/data/menu/components/menu-item/index.js +1 -3
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +1 -2
- package/dist/system/presentation/components/data/menu/modes/opened/index.js +1 -2
- package/dist/system/presentation/components/data/tab/component.d.ts +1 -1
- package/dist/system/presentation/components/data/tab/component.js +3 -3
- package/dist/system/presentation/components/data/tab/component.js.map +1 -1
- package/dist/system/presentation/components/data/tab/interfaces.d.ts +1 -0
- package/dist/system/presentation/components/data/tab/styles.js +1 -1
- package/dist/system/presentation/components/data/tab/styles.js.map +1 -1
- package/dist/system/presentation/components/layout/header/components/menu-right/component.d.ts +1 -2
- package/dist/system/presentation/components/layout/header/components/menu-right/component.js +1 -2
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.d.ts +0 -2
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.js +0 -47
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/index.js +0 -92
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/interfaces.d.ts +0 -6
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +0 -36
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/content/index.js +0 -36
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +0 -38
- package/dist/system/presentation/components/layout/header/components/search-modal/search-list/index.js +0 -52
- package/dist/system/presentation/components/layout/header/components/search-modal/trigger/index.js +0 -45
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.d.ts +0 -5
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.js +0 -80
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.d.ts +0 -5
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +0 -111
- package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js +0 -78
- package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.d.ts +0 -4
- package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.js +0 -60
- package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.d.ts +0 -4
- package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.js +0 -35
- package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.js +0 -144
- package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.js +0 -56
- package/dist/system/presentation/hooks/ui/use-table/components/table/skeleton-table/index.js +0 -34
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js +0 -50
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/interfaces.d.ts +0 -6
- package/dist/ui/components/form/handler/i18n/index.js +1 -1
- package/dist/ui/components/form/handler/i18n/index.js.map +1 -1
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +0 -13
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +0 -18
- package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +0 -10
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +0 -204
- package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +0 -2
- package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +0 -17
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +0 -2
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +0 -25
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +0 -18
- package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +0 -16
- package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +0 -13
- package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +0 -7
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +0 -20
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +0 -123
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +0 -11
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +0 -5
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +0 -24
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/components/form/handler/i18n/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAA+B;AAE/B,2BAA8B;AAC9B,mCAA8B;AAE9B,iEAAyC;AACzC,6DAAyD;AAIzD,SAAgB,QAAQ,CAAC,KAAmB;;IAClC,IAAA,SAAS,GAAK,IAAA,YAAO,GAAE,UAAd,CAAc;IAE/B,IAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,uFAA4B,CAAA;IACrC,CAAC;IAED,IAAM,oBAAoB,GAAG;QAC3B,IAAI,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CAAC,UAAC,OAAO,EAAE,QAAQ;;YAAK,OAAA,uBAAM,OAAO,gBAAG,QAAQ,CAAC,MAAM,IAAG,EAAE,OAAG;QAAvC,CAAuC,EAAE,EAAE,CAAC;KAC5F,CAAA;IAED,IAAM,aAAa,GAAG,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,0CAAE,IAAI;QAC5C,CAAC,CAAC,KAAK,CAAC,WAAW;QACnB,CAAC,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,uBAAM,oBAAoB,GAAK,KAAK,CAAC,WAAW,EACjD,CAAC,CAAC,oBAAoB,CAAA;IAExB,OAAO,CACL,2DACE,uBAAC,eAAM,IAAC,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAO,CAAC,EAAE,aAAa,EAAE,aAAa,YACtG,wBAAC,sBAAW,eAAK,KAAK,IAAE,IAAI,wBAAO,KAAK,CAAC,IAAI,KAAE,SAAS,WAAA,gBACtD,uBAAC,YAAG,IACF,UAAU,QACV,IAAI,EACF,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK;;4BAAK,OAAA,CAAC;gCAC/B,GAAG,EAAE,IAAI,CAAC,MAAM;gCAChB,KAAK,EAAE,IAAI,CAAC,MAAM;gCAClB,KAAK,EAAE,EAAE,GAAG,EAAE,CAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAG,CAAC,CAAC,0CAAE,GAAG,KAAI,EAAE,EAAC;gCACzC,QAAQ,EAAE,KAAK;gCACf,OAAO,EAAE,UAAC,QAAQ;oCAChB,OAAO,CACL,6DACG,KAAK,KAAK,CAAC,IAAI,uBAAC,uCAAiB,aAAC,SAAS,EAAE,SAAS,IAAM,QAAQ,EAAI,EAEzE,uBAAC,KAAK,CAAC,IAAI,CAAC,YAAY,IAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,MAAM,GAAI,IACzD,CACJ,CAAA;gCACH,CAAC;6BACF,CAAC,CAAA;yBAAA,CAAC,KAAI,EAAE,GAEX,EAED,KAAK,CAAC,QAAQ,KACH,GACP,GACR,CACJ,CAAA;AACH,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/components/form/handler/i18n/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAA+B;AAE/B,2BAA8B;AAC9B,mCAA8B;AAE9B,iEAAyC;AACzC,6DAAyD;AAIzD,SAAgB,QAAQ,CAAC,KAAmB;;IAClC,IAAA,SAAS,GAAK,IAAA,YAAO,GAAE,UAAd,CAAc;IAE/B,IAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,uFAA4B,CAAA;IACrC,CAAC;IAED,IAAM,oBAAoB,GAAG;QAC3B,IAAI,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CAAC,UAAC,OAAO,EAAE,QAAQ;;YAAK,OAAA,uBAAM,OAAO,gBAAG,QAAQ,CAAC,MAAM,IAAG,EAAE,OAAG;QAAvC,CAAuC,EAAE,EAAE,CAAC;KAC5F,CAAA;IAED,IAAM,aAAa,GAAG,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,0CAAE,IAAI;QAC5C,CAAC,CAAC,KAAK,CAAC,WAAW;QACnB,CAAC,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,uBAAM,oBAAoB,GAAK,KAAK,CAAC,WAAW,EACjD,CAAC,CAAC,oBAAoB,CAAA;IAExB,OAAO,CACL,2DACE,uBAAC,eAAM,IAAC,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAO,CAAC,EAAE,aAAa,EAAE,aAAa,YACtG,wBAAC,sBAAW,eAAK,KAAK,IAAE,IAAI,wBAAO,KAAK,CAAC,IAAI,KAAE,SAAS,WAAA,gBACtD,uBAAC,YAAG,IACF,sBAAsB,QACtB,UAAU,QACV,IAAI,EACF,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK;;4BAAK,OAAA,CAAC;gCAC/B,GAAG,EAAE,IAAI,CAAC,MAAM;gCAChB,KAAK,EAAE,IAAI,CAAC,MAAM;gCAClB,KAAK,EAAE,EAAE,GAAG,EAAE,CAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAG,CAAC,CAAC,0CAAE,GAAG,KAAI,EAAE,EAAC;gCACzC,QAAQ,EAAE,KAAK;gCACf,OAAO,EAAE,UAAC,QAAQ;oCAChB,OAAO,CACL,6DACG,KAAK,KAAK,CAAC,IAAI,uBAAC,uCAAiB,aAAC,SAAS,EAAE,SAAS,IAAM,QAAQ,EAAI,EAEzE,uBAAC,KAAK,CAAC,IAAI,CAAC,YAAY,IAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,MAAM,GAAI,IACzD,CACJ,CAAA;gCACH,CAAC;6BACF,CAAC,CAAA;yBAAA,CAAC,KAAI,EAAE,GAEX,EAED,KAAK,CAAC,QAAQ,KACH,GACP,GACR,CACJ,CAAA;AACH,CAAC;AApDD,4BAoDC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RenderFileProps } from '../../../../../../../ui/index.js';
|
|
2
|
-
export type ButtonUploadImageMobileProps = {
|
|
3
|
-
mobile?: {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
multiple: boolean;
|
|
7
|
-
isAccumalativeFile: boolean;
|
|
8
|
-
nameFileMobile: string;
|
|
9
|
-
mobileFilesAlredyExist: boolean;
|
|
10
|
-
};
|
|
11
|
-
isMobile?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare function ButtonUploadImageMobile(props: RenderFileProps & ButtonUploadImageMobileProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ButtonUploadImageMobile = void 0;
|
|
4
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
var ui_1 = require("../../../../../../../ui/index.js");
|
|
6
|
-
function ButtonUploadImageMobile(props) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
var _c = (0, ui_1.useFile)(props.mobile), InputFile = _c.InputFile, LabelFileArea = _c.LabelFileArea;
|
|
9
|
-
if ((props === null || props === void 0 ? void 0 : props.isMobile) ||
|
|
10
|
-
!(props === null || props === void 0 ? void 0 : props.enableMobileImage) ||
|
|
11
|
-
((_a = props === null || props === void 0 ? void 0 : props.mobile) === null || _a === void 0 ? void 0 : _a.mobileFilesAlredyExist) ||
|
|
12
|
-
!((_b = props.mobile) === null || _b === void 0 ? void 0 : _b.nameFileMobile)) {
|
|
13
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
14
|
-
}
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { idTooltip: 'MobileFile', bgColor: '#fff', enableHover: true, enableArrow: true, content: 'Arquivo Mobile', trigger: (0, jsx_runtime_1.jsx)(LabelFileArea, { children: (0, jsx_runtime_1.jsxs)("div", { className: 'action-button', children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'none' }, children: (0, jsx_runtime_1.jsx)(InputFile, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconMobile' })] }) }) }));
|
|
16
|
-
}
|
|
17
|
-
exports.ButtonUploadImageMobile = ButtonUploadImageMobile;
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { InputAttributes } from '../types.js';
|
|
2
|
-
interface SyntheticChangeError {
|
|
3
|
-
cause?: {
|
|
4
|
-
__attributes?: Partial<InputAttributes>;
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Кастомная ошибка обрабатывается в хуке `useInput` с возможностью
|
|
9
|
-
* передать аттрибуты для установки в `input` элемент.
|
|
10
|
-
*/
|
|
11
|
-
declare class SyntheticChangeError extends Error {
|
|
12
|
-
constructor(message: string, cause?: SyntheticChangeError['cause']);
|
|
13
|
-
}
|
|
14
|
-
export default SyntheticChangeError;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CustomInputEvent, CustomInputEventHandler, Init, Tracking } from '../types.js';
|
|
3
|
-
interface UseInputParam<D> {
|
|
4
|
-
init: Init;
|
|
5
|
-
tracking: Tracking<D>;
|
|
6
|
-
eventType?: string;
|
|
7
|
-
eventHandler?: CustomInputEventHandler<CustomInputEvent<D>>;
|
|
8
|
-
}
|
|
9
|
-
export default function useInput<D = unknown>({ init, tracking, eventType, eventHandler, }: UseInputParam<D>): React.MutableRefObject<HTMLInputElement | null>;
|
|
10
|
-
export {};
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var react_dom_1 = require("react-dom");
|
|
8
|
-
var SyntheticChangeError_1 = __importDefault(require("../errors/SyntheticChangeError.js"));
|
|
9
|
-
var setInputAttributes_1 = __importDefault(require("../utils/setInputAttributes.js"));
|
|
10
|
-
var TYPES = ['text', 'email', 'tel', 'search', 'url'];
|
|
11
|
-
function proxy(inputRef, init, _a) {
|
|
12
|
-
var onFocus = _a.onFocus, onBlur = _a.onBlur, onInput = _a.onInput;
|
|
13
|
-
return new Proxy(inputRef, {
|
|
14
|
-
set: function (target, property, inputElement) {
|
|
15
|
-
var _a;
|
|
16
|
-
if (property !== 'current') {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
var isValidType = inputElement !== null && TYPES.includes(inputElement.type);
|
|
20
|
-
if (process.env.NODE_ENV !== 'production' && inputElement !== null && !isValidType) {
|
|
21
|
-
console.warn("Warn: The input element type does not match one of the types: ".concat(TYPES.join(', '), "."));
|
|
22
|
-
}
|
|
23
|
-
if (inputElement !== inputRef.current) {
|
|
24
|
-
if (inputRef.current !== null) {
|
|
25
|
-
inputRef.current.removeEventListener('focus', onFocus);
|
|
26
|
-
inputRef.current.removeEventListener('blur', onBlur);
|
|
27
|
-
inputRef.current.removeEventListener('input', onInput);
|
|
28
|
-
}
|
|
29
|
-
if (inputElement !== null && isValidType) {
|
|
30
|
-
var _b = (_a = inputElement._wrapperState) !== null && _a !== void 0 ? _a : {}, _c = _b.controlled, controlled = _c === void 0 ? false : _c, _d = _b.initialValue, initialValue = _d === void 0 ? '' : _d;
|
|
31
|
-
var initResult = init({ controlled: controlled, initialValue: inputElement.value || initialValue });
|
|
32
|
-
(0, setInputAttributes_1.default)(inputElement, { value: initResult.value });
|
|
33
|
-
if (document.activeElement === inputElement) {
|
|
34
|
-
onFocus();
|
|
35
|
-
}
|
|
36
|
-
inputElement.addEventListener('focus', onFocus);
|
|
37
|
-
inputElement.addEventListener('blur', onBlur);
|
|
38
|
-
inputElement.addEventListener('input', onInput);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
target[property] = inputElement;
|
|
42
|
-
return true;
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function useInput(_a) {
|
|
47
|
-
var init = _a.init, tracking = _a.tracking, eventType = _a.eventType, eventHandler = _a.eventHandler;
|
|
48
|
-
var selection = (0, react_1.useRef)({
|
|
49
|
-
timeoutId: -1,
|
|
50
|
-
fallbackTimeoutId: -1,
|
|
51
|
-
cachedTimeoutId: -1,
|
|
52
|
-
start: 0,
|
|
53
|
-
end: 0,
|
|
54
|
-
});
|
|
55
|
-
var dispatchedCustomInputEvent = (0, react_1.useRef)(true);
|
|
56
|
-
var inputRef = (0, react_1.useRef)(null);
|
|
57
|
-
var props = (0, react_1.useRef)({
|
|
58
|
-
init: init,
|
|
59
|
-
tracking: tracking,
|
|
60
|
-
eventType: eventType,
|
|
61
|
-
eventHandler: eventHandler,
|
|
62
|
-
});
|
|
63
|
-
props.current.init = init;
|
|
64
|
-
props.current.tracking = tracking;
|
|
65
|
-
props.current.eventType = eventType;
|
|
66
|
-
props.current.eventHandler = eventHandler;
|
|
67
|
-
return (0, react_1.useMemo)(function () {
|
|
68
|
-
return proxy(inputRef, props.current.init, {
|
|
69
|
-
onFocus: function () {
|
|
70
|
-
var setSelection = function () {
|
|
71
|
-
var _a, _b, _c, _d;
|
|
72
|
-
if (dispatchedCustomInputEvent.current) {
|
|
73
|
-
selection.current.start = (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.selectionStart) !== null && _b !== void 0 ? _b : 0;
|
|
74
|
-
selection.current.end = (_d = (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.selectionEnd) !== null && _d !== void 0 ? _d : 0;
|
|
75
|
-
selection.current.timeoutId = window.setTimeout(setSelection);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
selection.current.fallbackTimeoutId = window.setTimeout(setSelection);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
selection.current.timeoutId = window.setTimeout(setSelection);
|
|
82
|
-
},
|
|
83
|
-
onBlur: function () {
|
|
84
|
-
window.clearTimeout(selection.current.timeoutId);
|
|
85
|
-
window.clearTimeout(selection.current.fallbackTimeoutId);
|
|
86
|
-
selection.current.timeoutId = -1;
|
|
87
|
-
selection.current.fallbackTimeoutId = -1;
|
|
88
|
-
selection.current.cachedTimeoutId = -1;
|
|
89
|
-
},
|
|
90
|
-
onInput: function (event) {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
92
|
-
var inputElement = inputRef.current;
|
|
93
|
-
if (inputElement === null) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
if (selection.current.cachedTimeoutId === selection.current.timeoutId) {
|
|
98
|
-
throw new SyntheticChangeError_1.default('The input selection has not been updated.');
|
|
99
|
-
}
|
|
100
|
-
selection.current.cachedTimeoutId = selection.current.timeoutId;
|
|
101
|
-
var value = inputElement.value, selectionStart = inputElement.selectionStart, selectionEnd = inputElement.selectionEnd;
|
|
102
|
-
if (selectionStart === null || selectionEnd === null) {
|
|
103
|
-
throw new SyntheticChangeError_1.default('The selection attributes have not been initialized.');
|
|
104
|
-
}
|
|
105
|
-
var previousValue = (_c = (_b = (_a = inputElement._valueTracker) === null || _a === void 0 ? void 0 : _a.getValue) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '';
|
|
106
|
-
var inputType = void 0;
|
|
107
|
-
if (selectionStart > selection.current.start) {
|
|
108
|
-
inputType = 'insert';
|
|
109
|
-
}
|
|
110
|
-
else if (selectionStart <= selection.current.start && selectionStart < selection.current.end) {
|
|
111
|
-
inputType = 'deleteBackward';
|
|
112
|
-
}
|
|
113
|
-
else if (selectionStart === selection.current.end && value.length < previousValue.length) {
|
|
114
|
-
inputType = 'deleteForward';
|
|
115
|
-
}
|
|
116
|
-
if (inputType === undefined ||
|
|
117
|
-
((inputType === 'deleteBackward' || inputType === 'deleteForward') && value.length > previousValue.length)) {
|
|
118
|
-
throw new SyntheticChangeError_1.default('Input type detection error.');
|
|
119
|
-
}
|
|
120
|
-
var addedValue = '';
|
|
121
|
-
var deletedValue = '';
|
|
122
|
-
var changeStart = selection.current.start;
|
|
123
|
-
var changeEnd = selection.current.end;
|
|
124
|
-
if (inputType === 'insert') {
|
|
125
|
-
addedValue = value.slice(selection.current.start, selectionStart);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
var countDeleted = previousValue.length - value.length;
|
|
129
|
-
changeStart = selectionStart;
|
|
130
|
-
changeEnd = selectionStart + countDeleted;
|
|
131
|
-
deletedValue = previousValue.slice(changeStart, changeEnd);
|
|
132
|
-
}
|
|
133
|
-
var trackingResult_1 = props.current.tracking({
|
|
134
|
-
inputType: inputType,
|
|
135
|
-
previousValue: previousValue,
|
|
136
|
-
value: value,
|
|
137
|
-
addedValue: addedValue,
|
|
138
|
-
deletedValue: deletedValue,
|
|
139
|
-
changeStart: changeStart,
|
|
140
|
-
changeEnd: changeEnd,
|
|
141
|
-
selectionStart: selectionStart,
|
|
142
|
-
selectionEnd: selectionEnd,
|
|
143
|
-
});
|
|
144
|
-
(0, setInputAttributes_1.default)(inputElement, {
|
|
145
|
-
value: trackingResult_1.value,
|
|
146
|
-
selectionStart: trackingResult_1.selectionStart,
|
|
147
|
-
selectionEnd: trackingResult_1.selectionEnd,
|
|
148
|
-
});
|
|
149
|
-
var customEventType_1 = props.current.eventType;
|
|
150
|
-
var customEventHandler_1 = props.current.eventHandler;
|
|
151
|
-
if (typeof customEventType_1 === 'string' && customEventHandler_1) {
|
|
152
|
-
var value_1 = inputElement.value, selectionStart_1 = inputElement.selectionStart, selectionEnd_1 = inputElement.selectionEnd;
|
|
153
|
-
dispatchedCustomInputEvent.current = false;
|
|
154
|
-
requestAnimationFrame(function () {
|
|
155
|
-
(0, setInputAttributes_1.default)(inputElement, {
|
|
156
|
-
value: value_1,
|
|
157
|
-
selectionStart: selectionStart_1 !== null && selectionStart_1 !== void 0 ? selectionStart_1 : value_1.length,
|
|
158
|
-
selectionEnd: selectionEnd_1 !== null && selectionEnd_1 !== void 0 ? selectionEnd_1 : value_1.length,
|
|
159
|
-
});
|
|
160
|
-
var customInputEvent = new CustomEvent(customEventType_1, {
|
|
161
|
-
bubbles: true,
|
|
162
|
-
cancelable: false,
|
|
163
|
-
composed: true,
|
|
164
|
-
detail: trackingResult_1.__detail,
|
|
165
|
-
});
|
|
166
|
-
inputElement.dispatchEvent(customInputEvent);
|
|
167
|
-
if (react_dom_1.unstable_batchedUpdates) {
|
|
168
|
-
(0, react_dom_1.unstable_batchedUpdates)(customEventHandler_1, customInputEvent);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
customEventHandler_1(customInputEvent);
|
|
172
|
-
}
|
|
173
|
-
dispatchedCustomInputEvent.current = true;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
(_e = (_d = inputElement._valueTracker) === null || _d === void 0 ? void 0 : _d.setValue) === null || _e === void 0 ? void 0 : _e.call(_d, previousValue);
|
|
177
|
-
selection.current.start = trackingResult_1.selectionStart;
|
|
178
|
-
selection.current.end = trackingResult_1.selectionEnd;
|
|
179
|
-
}
|
|
180
|
-
catch (error) {
|
|
181
|
-
var _s = error, name_1 = _s.name, cause = _s.cause;
|
|
182
|
-
(0, setInputAttributes_1.default)(inputElement, {
|
|
183
|
-
value: (_k = (_g = (_f = cause === null || cause === void 0 ? void 0 : cause.__attributes) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : (_j = (_h = inputElement._valueTracker) === null || _h === void 0 ? void 0 : _h.getValue) === null || _j === void 0 ? void 0 : _j.call(_h)) !== null && _k !== void 0 ? _k : '',
|
|
184
|
-
selectionStart: (_m = (_l = cause === null || cause === void 0 ? void 0 : cause.__attributes) === null || _l === void 0 ? void 0 : _l.selectionStart) !== null && _m !== void 0 ? _m : selection.current.start,
|
|
185
|
-
selectionEnd: (_p = (_o = cause === null || cause === void 0 ? void 0 : cause.__attributes) === null || _o === void 0 ? void 0 : _o.selectionEnd) !== null && _p !== void 0 ? _p : selection.current.end,
|
|
186
|
-
});
|
|
187
|
-
if (((_q = cause === null || cause === void 0 ? void 0 : cause.__attributes) === null || _q === void 0 ? void 0 : _q.selectionStart) !== undefined) {
|
|
188
|
-
selection.current.start = cause.__attributes.selectionStart;
|
|
189
|
-
}
|
|
190
|
-
if (((_r = cause === null || cause === void 0 ? void 0 : cause.__attributes) === null || _r === void 0 ? void 0 : _r.selectionEnd) !== undefined) {
|
|
191
|
-
selection.current.end = cause.__attributes.selectionEnd;
|
|
192
|
-
}
|
|
193
|
-
event.preventDefault();
|
|
194
|
-
event.stopPropagation();
|
|
195
|
-
if (name_1 !== 'SyntheticChangeError') {
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
}, []);
|
|
202
|
-
}
|
|
203
|
-
exports.default = useInput;
|
|
204
|
-
//# sourceMappingURL=useInput.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Replacement } from '../types.js';
|
|
2
|
-
interface Options {
|
|
3
|
-
replacementChars: string;
|
|
4
|
-
replacement: Replacement;
|
|
5
|
-
separate: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Фильтрует символы для соответствия значениям `replacement`
|
|
9
|
-
* @param value
|
|
10
|
-
* @param options
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export default function filter(value: string, { replacementChars, replacement, separate }: Options): string;
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Replacement } from '../types.js';
|
|
2
|
-
interface Options {
|
|
3
|
-
mask: string;
|
|
4
|
-
replacement: Replacement;
|
|
5
|
-
showMask: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Форматирует значение по заданной маске
|
|
9
|
-
* @param input
|
|
10
|
-
* @param options
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export default function format(input: string, { mask, replacement, showMask }: Options): string;
|
|
14
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { MaskPart, Replacement } from '../types.js';
|
|
2
|
-
interface Options {
|
|
3
|
-
mask: string;
|
|
4
|
-
replacement: Replacement;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Форматирует значение по заданной маске возвращая массив объектов,
|
|
8
|
-
* где каждый объект представляет собой информацию о символе:
|
|
9
|
-
* - `replacement` - символ замены;
|
|
10
|
-
* - `mask` - символ маски;
|
|
11
|
-
* - `input` - символ, введенный пользователем.
|
|
12
|
-
* @param formattedValue
|
|
13
|
-
* @param options
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export default function formatToParts(formattedValue: string, { mask, replacement }: Options): MaskPart[];
|
|
17
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { MaskEventDetail, Replacement } from '../types.js';
|
|
2
|
-
interface Options {
|
|
3
|
-
mask: string;
|
|
4
|
-
replacement: Replacement;
|
|
5
|
-
showMask: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Формирует данные маскированного значения возвращая
|
|
9
|
-
* @param input пользовательские символы без учета символов маски
|
|
10
|
-
* @param options
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export default function resolveDetail(input: string, { mask, replacement, showMask }: Options): MaskEventDetail;
|
|
14
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var utils_1 = require("../utils.js");
|
|
7
|
-
var format_1 = __importDefault(require("./format.js"));
|
|
8
|
-
var formatToParts_1 = __importDefault(require("./formatToParts.js"));
|
|
9
|
-
/**
|
|
10
|
-
* Формирует данные маскированного значения возвращая
|
|
11
|
-
* @param input пользовательские символы без учета символов маски
|
|
12
|
-
* @param options
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
function resolveDetail(input, _a) {
|
|
16
|
-
var mask = _a.mask, replacement = _a.replacement, showMask = _a.showMask;
|
|
17
|
-
var formattedValue = (0, format_1.default)(input, { mask: mask, replacement: replacement, showMask: showMask });
|
|
18
|
-
var parts = (0, formatToParts_1.default)(formattedValue, { mask: mask, replacement: replacement });
|
|
19
|
-
var pattern = (0, utils_1.generatePattern)({ mask: mask, replacement: replacement });
|
|
20
|
-
var patternWithDisableReplacementKey = (0, utils_1.generatePattern)({ mask: mask, replacement: replacement }, true);
|
|
21
|
-
var isValid = RegExp(patternWithDisableReplacementKey).test(formattedValue);
|
|
22
|
-
return { value: formattedValue, input: input, parts: parts, pattern: pattern, isValid: isValid };
|
|
23
|
-
}
|
|
24
|
-
exports.default = resolveDetail;
|
|
25
|
-
//# sourceMappingURL=resolveDetail.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { MaskPart, Replacement } from '../types.js';
|
|
2
|
-
import type { InputType } from '../../core/index.js';
|
|
3
|
-
interface ResolveSelectionParam {
|
|
4
|
-
inputType: InputType;
|
|
5
|
-
value: string;
|
|
6
|
-
addedValue: string;
|
|
7
|
-
beforeChangeValue: string;
|
|
8
|
-
parts: MaskPart[];
|
|
9
|
-
replacement: Replacement;
|
|
10
|
-
separate: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Определяет позицию курсора для последующей установки
|
|
14
|
-
* @param param
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export default function resolveSelection({ inputType, value, addedValue, beforeChangeValue, parts, replacement, separate, }: ResolveSelectionParam): number;
|
|
18
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Replacement } from '../types.js';
|
|
2
|
-
interface Options {
|
|
3
|
-
start?: number;
|
|
4
|
-
end?: number;
|
|
5
|
-
mask: string;
|
|
6
|
-
replacement: Replacement;
|
|
7
|
-
separate: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param formattedValue
|
|
12
|
-
* @param options
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export default function unformat(formattedValue: string, { start, end, mask, replacement, separate }: Options): string;
|
|
16
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Replacement } from '../types.js';
|
|
2
|
-
interface ValidateParam {
|
|
3
|
-
initialValue: string;
|
|
4
|
-
mask: string;
|
|
5
|
-
replacement: Replacement;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Выводит в консоль сообщения об ошибках.
|
|
9
|
-
* Сообщения выводятся на этапе инициализации элеменета.
|
|
10
|
-
* @param param
|
|
11
|
-
*/
|
|
12
|
-
export default function validate({ initialValue, mask, replacement }: ValidateParam): void;
|
|
13
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LocalizedNumberFormatValues } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Возвращает применяемые значения по заданной локали
|
|
4
|
-
* @param locales
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export default function localizeValues(locales: string | string[] | undefined): LocalizedNumberFormatValues;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { LocalizedNumberFormatValues, NumberFormatOptions, ResolvedNumberFormatOptions } from '../types.js';
|
|
2
|
-
import type { InputType } from '../../core/index.js';
|
|
3
|
-
interface Options {
|
|
4
|
-
inputType: InputType;
|
|
5
|
-
locales: string | string[] | undefined;
|
|
6
|
-
localizedValues: LocalizedNumberFormatValues;
|
|
7
|
-
currentOptions: NumberFormatOptions | undefined;
|
|
8
|
-
resolvedOptions: ResolvedNumberFormatOptions;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param value
|
|
13
|
-
* @param options
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export default function resolveDetail(value: string, { inputType, locales, localizedValues, currentOptions, resolvedOptions }: Options): {
|
|
17
|
-
value: string;
|
|
18
|
-
number: number;
|
|
19
|
-
};
|
|
20
|
-
export {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
var resolveMinimumFractionDigits_1 = __importDefault(require("./resolveMinimumFractionDigits.js"));
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param value
|
|
32
|
-
* @param options
|
|
33
|
-
* @returns
|
|
34
|
-
*/
|
|
35
|
-
function resolveDetail(value, _a) {
|
|
36
|
-
var inputType = _a.inputType, locales = _a.locales, localizedValues = _a.localizedValues, currentOptions = _a.currentOptions, resolvedOptions = _a.resolvedOptions;
|
|
37
|
-
if ((inputType === 'deleteBackward' || inputType === 'deleteForward') &&
|
|
38
|
-
(value === '' || value === '-' || /^-?\.?0*$/.test(value))) {
|
|
39
|
-
return { value: '', number: 0 };
|
|
40
|
-
}
|
|
41
|
-
var isNegative = value.startsWith('-');
|
|
42
|
-
var absValue = isNegative ? value.slice(1) : value;
|
|
43
|
-
// При `fraction` равном `undefined` - разделитель не был введён
|
|
44
|
-
var _b = absValue.split('.'), integer = _b[0], _c = _b[1], fraction = _c === void 0 ? undefined : _c;
|
|
45
|
-
// Определяем настройки для применения в `Intl.NumberFormat`
|
|
46
|
-
var currentMinimumFractionDigits = resolvedOptions.minimumFractionDigits;
|
|
47
|
-
var currentMaximumFractionDigits = resolvedOptions.maximumFractionDigits;
|
|
48
|
-
// let currentMinimumSignificantDigits = resolvedOptions.minimumSignificantDigits;
|
|
49
|
-
// Поскольку состояние ввода хранит последний введенный символ,
|
|
50
|
-
// при форматировании может произойти округление, поэтому нам важно
|
|
51
|
-
// заранее обрезать символ не соответствующий максимальному количеству символов
|
|
52
|
-
// - `replace` - Учитываем `minimumSignificantDigits` и `minimumIntegerDigits`.
|
|
53
|
-
// Так, при `addedValue` "2": "000 001" -> "000 0012" -> "12" -> "000 012"
|
|
54
|
-
integer = integer.replace(/^0+/g, '').slice(0, resolvedOptions.maximumIntegerDigits);
|
|
55
|
-
// if (fraction !== undefined && resolvedOptions.maximumSignificantDigits !== undefined) {
|
|
56
|
-
// currentMaximumFractionDigits = resolvedOptions.maximumSignificantDigits - integer.length;
|
|
57
|
-
// if (/^0*$/.test(integer) && /^0*$/.test(fraction)) {
|
|
58
|
-
// currentMaximumFractionDigits -= 1;
|
|
59
|
-
// } else if (/^0*$/.test(integer) && /^0*[1-9]+/.test(fraction)) {
|
|
60
|
-
// currentMaximumFractionDigits += fraction.match(/^0+/g)?.[0].length ?? 0;
|
|
61
|
-
// }
|
|
62
|
-
// }
|
|
63
|
-
fraction = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, currentMaximumFractionDigits);
|
|
64
|
-
var number = Number((isNegative ? '-' : '') + (integer || '0') + (fraction ? ".".concat(fraction) : ''));
|
|
65
|
-
// Чтобы иметь возможность прописывать "0" и сохранять его с каждой итерацией,
|
|
66
|
-
// переопределяем `minimumFractionDigits` и `minimumSignificantDigits`
|
|
67
|
-
currentMinimumFractionDigits = (0, resolveMinimumFractionDigits_1.default)({
|
|
68
|
-
// integer,
|
|
69
|
-
// fraction: fraction ?? '',
|
|
70
|
-
resolvedOptions: resolvedOptions,
|
|
71
|
-
});
|
|
72
|
-
// Если `currentMinimumFractionDigits` равен нулю, дробная часть будет округлена
|
|
73
|
-
if (inputType === 'insert' &&
|
|
74
|
-
fraction === '' &&
|
|
75
|
-
currentMinimumFractionDigits === 0 &&
|
|
76
|
-
currentMaximumFractionDigits > 0) {
|
|
77
|
-
currentMinimumFractionDigits = 1;
|
|
78
|
-
// if (currentMinimumSignificantDigits !== undefined) {
|
|
79
|
-
// currentMinimumSignificantDigits = (integer.length || 1) + 1;
|
|
80
|
-
// }
|
|
81
|
-
}
|
|
82
|
-
if (fraction !== undefined && fraction.length > currentMinimumFractionDigits) {
|
|
83
|
-
currentMinimumFractionDigits = fraction.length;
|
|
84
|
-
// `minimumFractionDigits` игнорируется при указанном `minimumSignificantDigits` или
|
|
85
|
-
// `maximumSignificantDigits`, поэтому указываем правило для `minimumSignificantDigits`
|
|
86
|
-
// if (currentMinimumSignificantDigits !== undefined) {
|
|
87
|
-
// if (/^0*$/.test(integer) && /^0*$/.test(fraction)) {
|
|
88
|
-
// currentMinimumSignificantDigits = fraction.length + 1;
|
|
89
|
-
// } else if (/^0*$/.test(integer) && /^0*[1-9]+/.test(fraction)) {
|
|
90
|
-
// currentMinimumSignificantDigits = fraction.replace(/^0+/g, '').length;
|
|
91
|
-
// } else if (/^0*[1-9]+/.test(integer)) {
|
|
92
|
-
// currentMinimumSignificantDigits = integer.length + fraction.length;
|
|
93
|
-
// }
|
|
94
|
-
// }
|
|
95
|
-
}
|
|
96
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
97
|
-
var _d = currentOptions !== null && currentOptions !== void 0 ? currentOptions : {}, format = _d.format, groupDisplay = _d.groupDisplay, maximumIntegerDigits = _d.maximumIntegerDigits, options = __rest(_d, ["format", "groupDisplay", "maximumIntegerDigits"]);
|
|
98
|
-
var nextValue = Intl.NumberFormat(locales, __assign(__assign({}, options), { style: format, useGrouping: groupDisplay, minimumFractionDigits: currentMinimumFractionDigits })).format(number);
|
|
99
|
-
// В значении может встречаться юникод, нам важно заменить
|
|
100
|
-
// такие символы для соответствия стандартному значению
|
|
101
|
-
nextValue = nextValue.replace(/\s/g, ' ');
|
|
102
|
-
var sign = nextValue.includes('+')
|
|
103
|
-
? '+'
|
|
104
|
-
: nextValue.includes(localizedValues.minusSign)
|
|
105
|
-
? localizedValues.minusSign
|
|
106
|
-
: undefined;
|
|
107
|
-
// Арабская локаль содержит юникод, что приводит к неожидаемому
|
|
108
|
-
// сдвигу курсора при смещении через клавиатуру, для предотвращения
|
|
109
|
-
// устанавливаем знак в конец числа с удалением нежелательного юникода
|
|
110
|
-
if (sign !== undefined && localizedValues.signBackwards) {
|
|
111
|
-
nextValue = nextValue.replace(RegExp("[\u200E\u061C\\".concat(sign, "]"), 'g'), '');
|
|
112
|
-
var lastDigitIndex = nextValue.search(RegExp("[".concat(localizedValues.digits, "](?!.*[").concat(localizedValues.digits, "])")));
|
|
113
|
-
if (lastDigitIndex !== -1) {
|
|
114
|
-
nextValue = nextValue.slice(0, lastDigitIndex + 1) + sign + nextValue.slice(lastDigitIndex + 1);
|
|
115
|
-
if (!nextValue.startsWith('')) {
|
|
116
|
-
nextValue = "\u200F".concat(nextValue);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return { value: nextValue, number: number };
|
|
121
|
-
}
|
|
122
|
-
exports.default = resolveDetail;
|
|
123
|
-
//# sourceMappingURL=resolveDetail.js.map
|
package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ResolvedNumberFormatOptions } from '../types.js';
|
|
2
|
-
interface ResolveMinimumFractionDigitsParam {
|
|
3
|
-
resolvedOptions: ResolvedNumberFormatOptions;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Высчитываем фактический `minimumFractionDigits`
|
|
7
|
-
* @param param
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export default function resolveMinimumFractionDigits({ resolvedOptions, }: ResolveMinimumFractionDigitsParam): number;
|
|
11
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { NumberFormatOptions, ResolvedNumberFormatOptions } from '../types.js';
|
|
2
|
-
export default function resolveOptions(locales: string | string[] | undefined, options?: NumberFormatOptions | undefined): {
|
|
3
|
-
current: NumberFormatOptions;
|
|
4
|
-
resolved: ResolvedNumberFormatOptions;
|
|
5
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { LocalizedNumberFormatValues, ResolvedNumberFormatOptions } from '../types.js';
|
|
2
|
-
import type { InputType } from '../../core/index.js';
|
|
3
|
-
interface ResolveSelectionParam {
|
|
4
|
-
localizedValues: LocalizedNumberFormatValues;
|
|
5
|
-
previousLocalizedValues: LocalizedNumberFormatValues;
|
|
6
|
-
resolvedOptions: ResolvedNumberFormatOptions;
|
|
7
|
-
inputType: InputType;
|
|
8
|
-
addedValue: string;
|
|
9
|
-
previousValue: string;
|
|
10
|
-
nextValue: string;
|
|
11
|
-
changeStart: number;
|
|
12
|
-
changeEnd: number;
|
|
13
|
-
}
|
|
14
|
-
interface ResolveSelectionReturn {
|
|
15
|
-
start: number;
|
|
16
|
-
end: number;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Определяет позицию каретки для последующей установки
|
|
20
|
-
* @param param
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export default function resolveSelection({ localizedValues, previousLocalizedValues, resolvedOptions, inputType, previousValue, addedValue, nextValue, changeStart, changeEnd, }: ResolveSelectionParam): ResolveSelectionReturn;
|
|
24
|
-
export {};
|