infinity-forge 3.4.6 → 3.4.7

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.
Files changed (141) hide show
  1. package/dist/sites/components/default-pages/blog/components/blog-item/index.d.ts +1 -1
  2. package/dist/sites/components/default-pages/blog/components/blog-item/index.js +1 -1
  3. package/dist/sites/components/default-pages/blog/components/categorias/index.js +1 -1
  4. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +0 -4
  5. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +0 -42
  6. package/dist/sites/components/default-pages/blog/components/featured-blog/index.js +1 -1
  7. package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.js +1 -1
  8. package/dist/sites/components/default-pages/blog/components/side-box-search/index.js +1 -1
  9. package/dist/sites/components/default-pages/blog/components/title-blog/index.js +1 -1
  10. package/dist/system/presentation/components/data/buttons/sidebar-button/index.js +1 -1
  11. package/dist/system/presentation/components/data/chat/card-message/index.d.ts +1 -1
  12. package/dist/system/presentation/components/data/chat/card-message/index.js +1 -1
  13. package/dist/system/presentation/components/data/chat/loader/index.js +1 -1
  14. package/dist/system/presentation/components/data/menu/components/menu-item/index.js +0 -80
  15. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +0 -44
  16. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +0 -15
  17. package/dist/system/presentation/components/data/menu/modes/opened/index.js +0 -51
  18. package/dist/system/presentation/components/data/menu/modes/opened/styles.js +0 -15
  19. package/dist/system/presentation/components/data/notifications/card/index.d.ts +1 -1
  20. package/dist/system/presentation/components/data/notifications/card/index.js +1 -1
  21. package/dist/system/presentation/components/data/profile-infos/profile/index.js +1 -1
  22. package/dist/system/presentation/components/data/tab/component.d.ts +1 -1
  23. package/dist/system/presentation/components/data/tab/component.js +3 -3
  24. package/dist/system/presentation/components/data/tab/component.js.map +1 -1
  25. package/dist/system/presentation/components/data/tab/interfaces.d.ts +1 -0
  26. package/dist/system/presentation/components/data/tab/styles.js +1 -1
  27. package/dist/system/presentation/components/data/tab/styles.js.map +1 -1
  28. package/dist/system/presentation/components/data/tab/tab-item/index.js +1 -1
  29. package/dist/system/presentation/components/layout/header/components/menu-right/component.d.ts +0 -6
  30. package/dist/system/presentation/components/layout/header/components/menu-right/component.js +0 -35
  31. package/dist/system/presentation/components/layout/header/components/menu-right/index.d.ts +0 -3
  32. package/dist/system/presentation/components/layout/header/components/menu-right/index.js +0 -20
  33. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.d.ts +1 -1
  34. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.js +3 -3
  35. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/index.js +3 -3
  36. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/interfaces.d.ts +1 -1
  37. package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +4 -4
  38. package/dist/system/presentation/components/layout/header/components/menu-right/profile/content/index.js +3 -3
  39. package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +4 -4
  40. package/dist/system/presentation/components/layout/header/components/search-modal/index.js +0 -40
  41. package/dist/system/presentation/components/layout/header/components/search-modal/search-list/index.js +3 -3
  42. package/dist/system/presentation/components/layout/header/components/search-modal/trigger/index.js +2 -2
  43. package/dist/system/presentation/components/layout/header/version-01/index.js +1 -1
  44. package/dist/system/presentation/components/pages/menus/table/columns.d.ts +1 -1
  45. package/dist/system/presentation/components/pages/menus/table/create.d.ts +1 -1
  46. package/dist/system/presentation/components/pages/menus/table/create.js +1 -1
  47. package/dist/system/presentation/components/pages/menus/table/delete.js +1 -1
  48. package/dist/system/presentation/components/pages/menus/table/edit.d.ts +1 -1
  49. package/dist/system/presentation/components/pages/menus/table/edit.js +0 -1
  50. package/dist/system/presentation/components/pages/menus/table/icon/index.js +0 -34
  51. package/dist/system/presentation/components/pages/users/table/columns.d.ts +1 -1
  52. package/dist/system/presentation/components/pages/users/table/create.d.ts +1 -1
  53. package/dist/system/presentation/components/pages/users/table/create.js +1 -1
  54. package/dist/system/presentation/components/pages/users/table/delete.js +1 -1
  55. package/dist/system/presentation/components/pages/users/table/edit.d.ts +1 -1
  56. package/dist/system/presentation/components/pages/users/table/edit.js +0 -1
  57. package/dist/system/presentation/context/auth/components/login/form-login/index.js +0 -12
  58. package/dist/system/presentation/context/auth/components/login/index.js +1 -1
  59. package/dist/system/presentation/context/auth/components/private-page/index.js +1 -1
  60. package/dist/system/presentation/hooks/locales/ibge/use-load-cities-by-uf/index.d.ts +1 -1
  61. package/dist/system/presentation/hooks/locales/ibge/use-load-cities-by-uf/index.js +1 -1
  62. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.d.ts +1 -1
  63. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.js +2 -2
  64. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.d.ts +1 -1
  65. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +4 -4
  66. package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.d.ts +1 -1
  67. package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js +2 -2
  68. package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.d.ts +1 -1
  69. package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.js +3 -3
  70. package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.d.ts +1 -1
  71. package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.js +2 -2
  72. package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.d.ts +1 -1
  73. package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.js +3 -3
  74. package/dist/system/presentation/hooks/ui/use-table/components/table/index.d.ts +0 -2
  75. package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +0 -105
  76. package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +0 -14
  77. package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.d.ts +1 -1
  78. package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.js +3 -3
  79. package/dist/system/presentation/hooks/ui/use-table/components/table/skeleton-table/index.js +2 -2
  80. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.d.ts +1 -1
  81. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js +2 -2
  82. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/interfaces.d.ts +1 -1
  83. package/dist/system/presentation/hooks/ui/use-table/query/hook.js +1 -1
  84. package/dist/ui/components/carousel/carousel-lib/core/modules/observer/observer.js +2 -2
  85. package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
  86. package/dist/ui/components/form/handler/i18n/index.js +1 -1
  87. package/dist/ui/components/form/handler/i18n/index.js.map +1 -1
  88. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
  89. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
  90. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
  91. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
  92. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +0 -62
  93. package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +0 -2
  94. package/dist/ui/components/form/input-date-picker/calendar/days/index.js +0 -87
  95. package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +0 -2
  96. package/dist/ui/components/form/input-date-picker/calendar/months/index.js +0 -66
  97. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +1 -1
  98. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +1 -1
  99. package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +0 -3
  100. package/dist/ui/components/form/input-file/render-files/file-item/index.js +0 -49
  101. package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +1 -1
  102. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +1 -1
  103. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +2 -2
  104. package/dist/ui/components/form/input-mask/lib/core/index.d.ts +0 -5
  105. package/dist/ui/components/form/input-mask/lib/core/index.js +0 -15
  106. package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +1 -1
  107. package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +0 -6
  108. package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +0 -44
  109. package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +0 -5
  110. package/dist/ui/components/form/input-mask/lib/mask/index.js +0 -26
  111. package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +0 -61
  112. package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +0 -3
  113. package/dist/ui/components/form/input-mask/lib/mask/useMask.js +0 -150
  114. package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +1 -1
  115. package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +1 -1
  116. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +1 -1
  117. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +1 -1
  118. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +1 -1
  119. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +3 -3
  120. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +2 -2
  121. package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +1 -1
  122. package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +1 -1
  123. package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +0 -63
  124. package/dist/ui/components/form/input-mask/lib/mask/utils.js +0 -114
  125. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +0 -6
  126. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +0 -58
  127. package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +0 -4
  128. package/dist/ui/components/form/input-mask/lib/number-format/index.js +0 -11
  129. package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +0 -26
  130. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +0 -3
  131. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +0 -208
  132. package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +1 -1
  133. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +2 -2
  134. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +1 -1
  135. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +1 -1
  136. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +1 -1
  137. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +2 -2
  138. package/dist/ui/components/form/input-seo/input-meta-image/index.d.ts +1 -1
  139. package/dist/ui/components/form/input-seo/input-meta-image/index.js +1 -1
  140. package/dist/ui/components/menu-mobile/components/nav-links/index.js +1 -1
  141. package/package.json +1 -1
@@ -1,150 +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 __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = require("react");
18
- var core_1 = require("../core/index.js");
19
- var filter_1 = __importDefault(require("./utils/filter.js"));
20
- var formatToReplacementObject_1 = __importDefault(require("./utils/formatToReplacementObject.js"));
21
- var resolveDetail_1 = __importDefault(require("./utils/resolveDetail.js"));
22
- var resolveSelection_1 = __importDefault(require("./utils/resolveSelection.js"));
23
- var unformat_1 = __importDefault(require("./utils/unformat.js"));
24
- var validate_1 = __importDefault(require("./utils/validate.js"));
25
- function useMask(_a) {
26
- var _b = _a === void 0 ? {} : _a, _c = _b.mask, mask = _c === void 0 ? '' : _c, _d = _b.replacement, replacement = _d === void 0 ? {} : _d, _e = _b.showMask, showMask = _e === void 0 ? false : _e, _f = _b.separate, separate = _f === void 0 ? false : _f, track = _b.track, modify = _b.modify, onMask = _b.onMask;
27
- var replacementObject = typeof replacement === 'string' ? (0, formatToReplacementObject_1.default)(replacement) : replacement;
28
- var cache = (0, react_1.useRef)(null);
29
- var init = function (_a) {
30
- var controlled = _a.controlled, initialValue = _a.initialValue;
31
- if (process.env.NODE_ENV !== 'production') {
32
- (0, validate_1.default)({ initialValue: initialValue, mask: mask, replacement: replacementObject });
33
- }
34
- initialValue = controlled || initialValue ? initialValue : showMask ? mask : '';
35
- var cachedProps = { mask: mask, replacement: replacementObject, showMask: showMask, separate: separate };
36
- cache.current = { value: initialValue, props: cachedProps, fallbackProps: cachedProps };
37
- return { value: initialValue };
38
- };
39
- var tracking = function (_a) {
40
- var _b;
41
- var inputType = _a.inputType, previousValue = _a.previousValue, addedValue = _a.addedValue, changeStart = _a.changeStart, changeEnd = _a.changeEnd;
42
- if (cache.current === null) {
43
- throw new core_1.SyntheticChangeError('The state has not been initialized.');
44
- }
45
- if (cache.current.value !== previousValue) {
46
- cache.current.props = cache.current.fallbackProps;
47
- }
48
- else {
49
- cache.current.fallbackProps = cache.current.props;
50
- }
51
- var beforeChangeValue = (0, unformat_1.default)(previousValue, {
52
- end: changeStart,
53
- mask: cache.current.props.mask,
54
- replacement: cache.current.props.replacement,
55
- separate: cache.current.props.separate,
56
- });
57
- var regExp$1 = RegExp("[^".concat(Object.keys(cache.current.props.replacement).join(''), "]"), 'g');
58
- var replacementChars = cache.current.props.mask.replace(regExp$1, '');
59
- if (beforeChangeValue) {
60
- beforeChangeValue = (0, filter_1.default)(beforeChangeValue, {
61
- replacementChars: replacementChars,
62
- replacement: cache.current.props.replacement,
63
- separate: cache.current.props.separate,
64
- });
65
- }
66
- var _addedValue = track === null || track === void 0 ? void 0 : track(__assign(__assign({}, (inputType === 'insert' ? { inputType: inputType, data: addedValue } : { inputType: inputType, data: null })), { value: previousValue, selectionStart: changeStart, selectionEnd: changeEnd }));
67
- if (_addedValue === false) {
68
- throw new core_1.SyntheticChangeError('Custom trekking stop.');
69
- }
70
- else if (_addedValue === null) {
71
- addedValue = '';
72
- }
73
- else if (_addedValue !== true && _addedValue !== undefined) {
74
- addedValue = _addedValue;
75
- }
76
- if (addedValue) {
77
- addedValue = (0, filter_1.default)(addedValue, {
78
- replacementChars: replacementChars.slice(beforeChangeValue.length),
79
- replacement: cache.current.props.replacement,
80
- separate: false,
81
- });
82
- }
83
- if (inputType === 'insert' && addedValue === '') {
84
- throw new core_1.SyntheticChangeError('The character does not match the key value of the `replacement` object.');
85
- }
86
- var afterChangeValue = (0, unformat_1.default)(previousValue, {
87
- start: changeEnd,
88
- mask: cache.current.props.mask,
89
- replacement: cache.current.props.replacement,
90
- separate: cache.current.props.separate,
91
- });
92
- if (cache.current.props.separate) {
93
- var separateChars = cache.current.props.mask.slice(changeStart, changeEnd).replace(regExp$1, '');
94
- var countSeparateChars = separateChars.length - addedValue.length;
95
- if (countSeparateChars < 0) {
96
- afterChangeValue = afterChangeValue.slice(-countSeparateChars);
97
- }
98
- else if (countSeparateChars > 0) {
99
- afterChangeValue = separateChars.slice(-countSeparateChars) + afterChangeValue;
100
- }
101
- }
102
- if (afterChangeValue) {
103
- afterChangeValue = (0, filter_1.default)(afterChangeValue, {
104
- replacementChars: replacementChars.slice(beforeChangeValue.length + addedValue.length),
105
- replacement: cache.current.props.replacement,
106
- separate: cache.current.props.separate,
107
- });
108
- }
109
- var input = beforeChangeValue + addedValue + afterChangeValue;
110
- var _c = (_b = modify === null || modify === void 0 ? void 0 : modify(input)) !== null && _b !== void 0 ? _b : {}, _d = _c.mask, modifiedMask = _d === void 0 ? mask : _d, _e = _c.replacement, modifiedReplacement = _e === void 0 ? replacementObject : _e, _f = _c.showMask, modifiedShowMask = _f === void 0 ? showMask : _f, _g = _c.separate, modifiedSeparate = _g === void 0 ? separate : _g;
111
- if (typeof modifiedReplacement === 'string') {
112
- modifiedReplacement = (0, formatToReplacementObject_1.default)(modifiedReplacement);
113
- }
114
- var detail = (0, resolveDetail_1.default)(input, {
115
- mask: modifiedMask,
116
- replacement: modifiedReplacement,
117
- showMask: modifiedShowMask,
118
- });
119
- var selection = (0, resolveSelection_1.default)({
120
- inputType: inputType,
121
- value: detail.value,
122
- addedValue: addedValue,
123
- beforeChangeValue: beforeChangeValue,
124
- parts: detail.parts,
125
- replacement: modifiedReplacement,
126
- separate: modifiedSeparate,
127
- });
128
- cache.current.value = detail.value;
129
- cache.current.props = {
130
- mask: modifiedMask,
131
- replacement: modifiedReplacement,
132
- showMask: modifiedShowMask,
133
- separate: modifiedSeparate,
134
- };
135
- return {
136
- value: detail.value,
137
- selectionStart: selection,
138
- selectionEnd: selection,
139
- __detail: detail,
140
- };
141
- };
142
- return (0, core_1.useInput)({
143
- init: init,
144
- tracking: tracking,
145
- eventType: 'input-mask',
146
- eventHandler: onMask,
147
- });
148
- }
149
- exports.default = useMask;
150
- //# sourceMappingURL=useMask.js.map
@@ -1,4 +1,4 @@
1
- import type { Replacement } from '../types.js';
1
+ import type { Replacement } from '../types';
2
2
  interface Options {
3
3
  replacementChars: string;
4
4
  replacement: Replacement;
@@ -1,4 +1,4 @@
1
- import type { Replacement } from '../types.js';
1
+ import type { Replacement } from '../types';
2
2
  interface Options {
3
3
  mask: string;
4
4
  replacement: Replacement;
@@ -1,4 +1,4 @@
1
- import type { MaskPart, Replacement } from '../types.js';
1
+ import type { MaskPart, Replacement } from '../types';
2
2
  interface Options {
3
3
  mask: string;
4
4
  replacement: Replacement;
@@ -1,2 +1,2 @@
1
- import type { Replacement } from '../types.js';
1
+ import type { Replacement } from '../types';
2
2
  export default function formatToReplacementObject(replacement: string): Replacement;
@@ -1,4 +1,4 @@
1
- import type { MaskEventDetail, Replacement } from '../types.js';
1
+ import type { MaskEventDetail, Replacement } from '../types';
2
2
  interface Options {
3
3
  mask: string;
4
4
  replacement: Replacement;
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
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"));
6
+ var utils_1 = require("../utils");
7
+ var format_1 = __importDefault(require("./format"));
8
+ var formatToParts_1 = __importDefault(require("./formatToParts"));
9
9
  /**
10
10
  * Формирует данные маскированного значения возвращая
11
11
  * @param input пользовательские символы без учета символов маски
@@ -1,5 +1,5 @@
1
- import type { MaskPart, Replacement } from '../types.js';
2
- import type { InputType } from '../../core/index.js';
1
+ import type { MaskPart, Replacement } from '../types';
2
+ import type { InputType } from '../../core';
3
3
  interface ResolveSelectionParam {
4
4
  inputType: InputType;
5
5
  value: string;
@@ -1,4 +1,4 @@
1
- import type { Replacement } from '../types.js';
1
+ import type { Replacement } from '../types';
2
2
  interface Options {
3
3
  start?: number;
4
4
  end?: number;
@@ -1,4 +1,4 @@
1
- import type { Replacement } from '../types.js';
1
+ import type { Replacement } from '../types';
2
2
  interface ValidateParam {
3
3
  initialValue: string;
4
4
  mask: string;
@@ -1,63 +0,0 @@
1
- import type { MaskPart, Replacement } from './types.js';
2
- interface Options {
3
- mask: string;
4
- replacement: string | Replacement;
5
- }
6
- /**
7
- * Masks a value using the specified mask (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#format)»).
8
- *
9
- * The result fully corresponds to the value obtained when entering.
10
- * Useful when you need to get a masked value without calling an input event.
11
- *
12
- * Since the principle of operation of `InputMask` is fully consistent with the operation
13
- * of the `input` element, `InputMask` will not change the value outside the input event, so
14
- * you may find yourself in a situation where the `input` element will have a value that does not
15
- * correspond to the mask, for example when initializing the value of the received from the backend.
16
- *
17
- * `format('1', { mask: '+__', replacement: { _: /\d/ } })` → "+1"
18
- */
19
- export declare function format(value: string, { mask, replacement }: Options): string;
20
- /**
21
- * Unmasks the value using the specified mask (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#unformat)»).
22
- *
23
- * Returns all characters entered by the user. Essentially does the opposite of the `format` utility.
24
- *
25
- * `unformat('+1_', { mask: '+__', replacement: { _: /\d/ } })` → "1"
26
- */
27
- export declare function unformat(formattedValue: string, { mask, replacement }: Options): string;
28
- /**
29
- * Specifies the parts of the masked value (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#formattoparts)»).
30
- *
31
- * The masked value parts are an array of objects, where each object contains the
32
- * necessary information about each character of the value. Parts of the masked value
33
- * are used to manipulate a character or group of characters in a point-by-point manner.
34
- *
35
- * Parts of the masked value, where each object contains the character type:
36
- * - `replacement` - the replacement character;
37
- * - `mask` - the mask character;
38
- * - `input` - the character entered by the user.
39
- *
40
- * `formatToParts('1', { mask: '+__', replacement: { _: /\d/ } })` →
41
- * ```
42
- * [
43
- * { index: 0, value: '+', type: 'mask' },
44
- * { index: 1, value: '1', type: 'input' },
45
- * { index: 2, value: '_', type: 'replacement' },
46
- * ]
47
- * ```
48
- */
49
- export declare function formatToParts(value: string, { mask, replacement }: Options): MaskPart[];
50
- /**
51
- * Generates a regular expression to match a masked value (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#generatepattern)»).
52
- *
53
- * If `takeReplacementKey: true`, then the regular expression search will not take into account the
54
- * `replacement` parameter key, that is, the character at the index of the replacement character in the
55
- * value can be any character corresponding to the `replacement` value except the `replacement` key itself.
56
- *
57
- * So, if `mask: '_'` and `replacement: { _: /\D/ }` then:
58
- * - if `takeReplacementKey: false`, the regular expression (pattern) will match `/^(\D)$/` and `RegExp(pattern).test(mask)` will return `true`;
59
- * - if `takeReplacementKey: true`, the regular expression (pattern) will match `/^(?!_)(\D)$/` and `RegExp(pattern).test(mask)` will return `false`,
60
- * but any a valid character, in addition to the replacement character, will contribute to the return of `true`.
61
- */
62
- export declare function generatePattern({ mask, replacement }: Options, takeReplacementKey?: boolean): string;
63
- export {};
@@ -1,114 +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
- exports.generatePattern = exports.formatToParts = exports.unformat = exports.format = void 0;
7
- var filter_1 = __importDefault(require("./utils/filter.js"));
8
- var format_1 = __importDefault(require("./utils/format.js"));
9
- var formatToParts_1 = __importDefault(require("./utils/formatToParts.js"));
10
- var formatToReplacementObject_1 = __importDefault(require("./utils/formatToReplacementObject.js"));
11
- var unformat_1 = __importDefault(require("./utils/unformat.js"));
12
- /**
13
- * Masks a value using the specified mask (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#format)»).
14
- *
15
- * The result fully corresponds to the value obtained when entering.
16
- * Useful when you need to get a masked value without calling an input event.
17
- *
18
- * Since the principle of operation of `InputMask` is fully consistent with the operation
19
- * of the `input` element, `InputMask` will not change the value outside the input event, so
20
- * you may find yourself in a situation where the `input` element will have a value that does not
21
- * correspond to the mask, for example when initializing the value of the received from the backend.
22
- *
23
- * `format('1', { mask: '+__', replacement: { _: /\d/ } })` → "+1"
24
- */
25
- function format(value, _a) {
26
- var mask = _a.mask, replacement = _a.replacement;
27
- var replacementObject = typeof replacement === 'string' ? (0, formatToReplacementObject_1.default)(replacement) : replacement;
28
- var regExp$1 = RegExp("[^".concat(Object.keys(replacementObject).join(''), "]"), 'g');
29
- var replacementChars = mask.replace(regExp$1, '');
30
- var input = (0, filter_1.default)(value, { replacementChars: replacementChars, replacement: replacementObject, separate: false });
31
- return (0, format_1.default)(input, { mask: mask, replacement: replacementObject, showMask: false });
32
- }
33
- exports.format = format;
34
- /**
35
- * Unmasks the value using the specified mask (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#unformat)»).
36
- *
37
- * Returns all characters entered by the user. Essentially does the opposite of the `format` utility.
38
- *
39
- * `unformat('+1_', { mask: '+__', replacement: { _: /\d/ } })` → "1"
40
- */
41
- function unformat(formattedValue, _a) {
42
- var mask = _a.mask, replacement = _a.replacement;
43
- var replacementObject = typeof replacement === 'string' ? (0, formatToReplacementObject_1.default)(replacement) : replacement;
44
- var value = (0, unformat_1.default)(formattedValue, { mask: mask, replacement: replacementObject, separate: false });
45
- var regExp$1 = RegExp("[^".concat(Object.keys(replacementObject).join(''), "]"), 'g');
46
- var replacementChars = mask.replace(regExp$1, '');
47
- return (0, filter_1.default)(value, { replacementChars: replacementChars, replacement: replacementObject, separate: false });
48
- }
49
- exports.unformat = unformat;
50
- /**
51
- * Specifies the parts of the masked value (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#formattoparts)»).
52
- *
53
- * The masked value parts are an array of objects, where each object contains the
54
- * necessary information about each character of the value. Parts of the masked value
55
- * are used to manipulate a character or group of characters in a point-by-point manner.
56
- *
57
- * Parts of the masked value, where each object contains the character type:
58
- * - `replacement` - the replacement character;
59
- * - `mask` - the mask character;
60
- * - `input` - the character entered by the user.
61
- *
62
- * `formatToParts('1', { mask: '+__', replacement: { _: /\d/ } })` →
63
- * ```
64
- * [
65
- * { index: 0, value: '+', type: 'mask' },
66
- * { index: 1, value: '1', type: 'input' },
67
- * { index: 2, value: '_', type: 'replacement' },
68
- * ]
69
- * ```
70
- */
71
- function formatToParts(value, _a) {
72
- var mask = _a.mask, replacement = _a.replacement;
73
- var replacementObject = typeof replacement === 'string' ? (0, formatToReplacementObject_1.default)(replacement) : replacement;
74
- var formattedValue = format(value, { mask: mask, replacement: replacementObject });
75
- return (0, formatToParts_1.default)(formattedValue, { mask: mask, replacement: replacementObject });
76
- }
77
- exports.formatToParts = formatToParts;
78
- /**
79
- * Generates a regular expression to match a masked value (see «[Utils](https://github.com/GoncharukBro/react-input/tree/main/packages/mask#generatepattern)»).
80
- *
81
- * If `takeReplacementKey: true`, then the regular expression search will not take into account the
82
- * `replacement` parameter key, that is, the character at the index of the replacement character in the
83
- * value can be any character corresponding to the `replacement` value except the `replacement` key itself.
84
- *
85
- * So, if `mask: '_'` and `replacement: { _: /\D/ }` then:
86
- * - if `takeReplacementKey: false`, the regular expression (pattern) will match `/^(\D)$/` and `RegExp(pattern).test(mask)` will return `true`;
87
- * - if `takeReplacementKey: true`, the regular expression (pattern) will match `/^(?!_)(\D)$/` and `RegExp(pattern).test(mask)` will return `false`,
88
- * but any a valid character, in addition to the replacement character, will contribute to the return of `true`.
89
- */
90
- function generatePattern(_a, takeReplacementKey) {
91
- var mask = _a.mask, replacement = _a.replacement;
92
- if (takeReplacementKey === void 0) { takeReplacementKey = false; }
93
- var replacementObject = typeof replacement === 'string' ? (0, formatToReplacementObject_1.default)(replacement) : replacement;
94
- var special = ['[', ']', '\\', '/', '^', '$', '.', '|', '?', '*', '+', '(', ')', '{', '}'];
95
- var pattern = '';
96
- for (var i = 0; i < mask.length; i++) {
97
- var isReplacementKey = Object.prototype.hasOwnProperty.call(replacementObject, mask[i]);
98
- var lookahead = takeReplacementKey ? "(?!".concat(mask[i], ")") : '';
99
- if (i === 0) {
100
- pattern += '^';
101
- }
102
- pattern += isReplacementKey
103
- ? "".concat(lookahead, "(").concat(replacementObject[mask[i]].toString().slice(1, -1), ")")
104
- : special.includes(mask[i])
105
- ? "\\".concat(mask[i])
106
- : mask[i];
107
- if (i === mask.length - 1) {
108
- pattern += '$';
109
- }
110
- }
111
- return pattern;
112
- }
113
- exports.generatePattern = generatePattern;
114
- //# sourceMappingURL=utils.js.map
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import type { NumberFormatProps } from './types.js';
3
- import type { InputComponent, InputComponentProps } from '../core/index.js';
4
- export type InputNumberFormatProps<C extends React.ComponentType | undefined = undefined> = NumberFormatProps & InputComponentProps<C>;
5
- declare const InputNumberFormat: InputComponent<NumberFormatProps>;
6
- export default InputNumberFormat;
@@ -1,58 +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 jsx_runtime_1 = require("react/jsx-runtime");
29
- var react_1 = require("react");
30
- var core_1 = require("../core/index.js");
31
- var useNumberFormat_1 = __importDefault(require("./useNumberFormat.js"));
32
- function ForwardedInputNumberFormat(_a, forwardedInputRef) {
33
- var Component = _a.component, locales = _a.locales, format = _a.format, currency = _a.currency, currencyDisplay = _a.currencyDisplay, unit = _a.unit, unitDisplay = _a.unitDisplay, signDisplay = _a.signDisplay, groupDisplay = _a.groupDisplay, minimumIntegerDigits = _a.minimumIntegerDigits, maximumIntegerDigits = _a.maximumIntegerDigits, minimumFractionDigits = _a.minimumFractionDigits, maximumFractionDigits = _a.maximumFractionDigits, onNumberFormat = _a.onNumberFormat, props = __rest(_a, ["component", "locales", "format", "currency", "currencyDisplay", "unit", "unitDisplay", "signDisplay", "groupDisplay", "minimumIntegerDigits", "maximumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "onNumberFormat"]);
34
- var inputRef = (0, useNumberFormat_1.default)({
35
- locales: locales,
36
- format: format,
37
- currency: currency,
38
- currencyDisplay: currencyDisplay,
39
- unit: unit,
40
- unitDisplay: unitDisplay,
41
- signDisplay: signDisplay,
42
- groupDisplay: groupDisplay,
43
- minimumIntegerDigits: minimumIntegerDigits,
44
- maximumIntegerDigits: maximumIntegerDigits,
45
- minimumFractionDigits: minimumFractionDigits,
46
- maximumFractionDigits: maximumFractionDigits,
47
- onNumberFormat: onNumberFormat,
48
- });
49
- var connectedInputRef = (0, core_1.useConnectedInputRef)(inputRef, forwardedInputRef);
50
- if (Component) {
51
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
- return (0, jsx_runtime_1.jsx)(Component, __assign({ ref: connectedInputRef }, props));
53
- }
54
- return (0, jsx_runtime_1.jsx)("input", __assign({ ref: connectedInputRef }, props));
55
- }
56
- var InputNumberFormat = (0, react_1.forwardRef)(ForwardedInputNumberFormat);
57
- exports.default = InputNumberFormat;
58
- //# sourceMappingURL=InputNumberFormat.js.map
@@ -1,4 +0,0 @@
1
- export { default as InputNumberFormat } from './InputNumberFormat.js';
2
- export { default as useNumberFormat } from './useNumberFormat.js';
3
- export type { InputNumberFormatProps } from './InputNumberFormat.js';
4
- export type { NumberFormatProps, NumberFormatEvent, NumberFormatEventDetail, NumberFormatEventHandler } from './types.js';
@@ -1,11 +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
- exports.useNumberFormat = exports.InputNumberFormat = void 0;
7
- var InputNumberFormat_1 = require("./InputNumberFormat.js");
8
- Object.defineProperty(exports, "InputNumberFormat", { enumerable: true, get: function () { return __importDefault(InputNumberFormat_1).default; } });
9
- var useNumberFormat_1 = require("./useNumberFormat.js");
10
- Object.defineProperty(exports, "useNumberFormat", { enumerable: true, get: function () { return __importDefault(useNumberFormat_1).default; } });
11
- //# sourceMappingURL=index.js.map
@@ -1,26 +0,0 @@
1
- import type { CustomInputEvent, CustomInputEventHandler } from '../core/index.js';
2
- export interface NumberFormatEventDetail {
3
- value: string;
4
- number: number;
5
- }
6
- export type NumberFormatEvent = CustomInputEvent<NumberFormatEventDetail>;
7
- export type NumberFormatEventHandler = CustomInputEventHandler<NumberFormatEvent>;
8
- type ResolveOptions<T extends Record<string, any>> = Pick<T, 'currency' | 'currencyDisplay' | 'unit' | 'unitDisplay' | 'signDisplay' | 'minimumIntegerDigits' | 'minimumFractionDigits' | 'maximumFractionDigits'>;
9
- interface IncludedOptions {
10
- format?: Intl.NumberFormatOptions['style'];
11
- groupDisplay?: Intl.NumberFormatOptions['useGrouping'];
12
- maximumIntegerDigits?: number;
13
- }
14
- export type NumberFormatOptions = ResolveOptions<Intl.NumberFormatOptions> & IncludedOptions;
15
- export type ResolvedNumberFormatOptions = ResolveOptions<Intl.ResolvedNumberFormatOptions> & Required<IncludedOptions>;
16
- export interface LocalizedNumberFormatValues {
17
- signBackwards: boolean;
18
- minusSign: string;
19
- decimal: string;
20
- digits: string;
21
- }
22
- export interface NumberFormatProps extends NumberFormatOptions {
23
- locales?: string | string[];
24
- onNumberFormat?: NumberFormatEventHandler;
25
- }
26
- export {};
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { NumberFormatProps } from './types.js';
3
- export default function useNumberFormat({ locales, format, currency, currencyDisplay, unit, unitDisplay, signDisplay, groupDisplay, minimumIntegerDigits, maximumIntegerDigits, minimumFractionDigits, maximumFractionDigits, onNumberFormat, }?: NumberFormatProps): React.MutableRefObject<HTMLInputElement | null>;