infinity-forge 3.2.7 → 3.3.1
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/LICENSE +20 -20
- package/dist/infinity-forge.css +3 -0
- package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +6 -0
- package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +42 -0
- package/dist/sites/public/fonts/fonts.css +760 -760
- package/dist/system/presentation/components/data/menu/components/menu-item/index.js +80 -0
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +44 -0
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +15 -0
- package/dist/system/presentation/components/data/menu/modes/opened/index.js +51 -0
- package/dist/system/presentation/components/data/menu/modes/opened/styles.js +15 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/component.d.ts +6 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/component.js +35 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/index.d.ts +3 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/index.js +3 -3
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.d.ts +1 -1
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.js +3 -3
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/index.js +3 -3
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/interfaces.d.ts +1 -1
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +4 -4
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/content/index.js +3 -3
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +4 -4
- package/dist/system/presentation/components/layout/header/components/search-modal/index.js +4 -4
- package/dist/system/presentation/components/layout/header/components/search-modal/search-list/index.js +3 -3
- package/dist/system/presentation/components/layout/header/components/search-modal/trigger/index.js +2 -2
- package/dist/system/presentation/components/pages/menus/table/icon/index.js +1 -1
- package/dist/system/presentation/context/auth/components/login/form-login/index.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +4 -4
- package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.js +3 -3
- package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.js +3 -3
- package/dist/system/presentation/hooks/ui/use-table/components/table/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +10 -10
- package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.js +3 -3
- package/dist/system/presentation/hooks/ui/use-table/components/table/skeleton-table/index.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.d.ts +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/interfaces.d.ts +1 -1
- package/dist/ui/components/carousel/carousel-lib/core/modules/observer/observer.js +2 -2
- package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
- package/dist/ui/components/carousel/carousel-lib/core/translate/translateTo.js +81 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/index.d.ts +21 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/index.js +26 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateActiveIndex.js +125 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateSize.js +45 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateSlides.js +306 -0
- package/dist/ui/components/carousel/carousel-lib/core/update/updateSlidesClasses.js +69 -0
- package/dist/ui/components/form/handler/dynamic_form_handler/component.js +2 -1
- package/dist/ui/components/form/handler/dynamic_form_handler/component.js.map +1 -1
- package/dist/ui/components/form/handler/i18n/capture-i18n-errors/index.d.ts +6 -0
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
- package/dist/ui/components/form/input-cep/use-cep/providers/index.d.ts +1 -0
- package/dist/ui/components/form/input-cep/use-cep/providers/index.js +18 -0
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.d.ts +8 -0
- package/dist/ui/components/form/input-currency/components/utils/cleanValue.js +62 -0
- package/dist/ui/components/form/input-currency/components/utils/formatValue.d.ts +49 -0
- package/dist/ui/components/form/input-currency/components/utils/formatValue.js +132 -0
- package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.d.ts +13 -0
- package/dist/ui/components/form/input-currency/components/utils/getSuffix.js +12 -0
- package/dist/ui/components/form/input-currency/components/utils/index.d.ts +8 -0
- package/dist/ui/components/form/input-currency/components/utils/index.js +25 -0
- package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js +40 -0
- package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js +14 -0
- package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js +14 -0
- package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.d.ts +2 -0
- package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +62 -0
- package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +2 -0
- package/dist/ui/components/form/input-date-picker/calendar/days/index.js +87 -0
- package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +2 -0
- package/dist/ui/components/form/input-date-picker/calendar/months/index.js +66 -0
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +1 -1
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +1 -1
- package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +3 -0
- package/dist/ui/components/form/input-file/render-files/file-item/index.js +49 -0
- package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +2 -2
- package/dist/ui/components/form/input-mask/lib/core/index.d.ts +5 -0
- package/dist/ui/components/form/input-mask/lib/core/index.js +15 -0
- package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +6 -0
- package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +44 -0
- package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +5 -0
- package/dist/ui/components/form/input-mask/lib/mask/index.js +26 -0
- package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +61 -0
- package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +3 -0
- package/dist/ui/components/form/input-mask/lib/mask/useMask.js +150 -0
- package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +3 -3
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +2 -2
- package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +63 -0
- package/dist/ui/components/form/input-mask/lib/mask/utils.js +114 -0
- package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +6 -0
- package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +58 -0
- package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +4 -0
- package/dist/ui/components/form/input-mask/lib/number-format/index.js +11 -0
- package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +26 -0
- package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +3 -0
- package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +208 -0
- package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +2 -2
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +1 -1
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +2 -2
- package/dist/ui/components/form/input-switch/interfaces.d.ts +2 -2
- package/dist/ui/components/form/input-youtube/index.js +1 -1
- package/dist/ui/components/form/input-youtube/index.js.map +1 -1
- package/dist/ui/contexts/toast/styles.js +1 -1
- package/dist/ui/contexts/toast/styles.js.map +1 -1
- package/dist/ui/icons/render/mobile.js +1 -1
- package/dist/ui/icons/render/mobile.js.map +1 -1
- package/dist/ui/styles/reset.css +356 -356
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.formatValue = void 0;
|
|
24
|
+
var escapeRegExp_1 = require("./escapeRegExp.js");
|
|
25
|
+
var getSuffix_1 = require("./getSuffix.js");
|
|
26
|
+
/**
|
|
27
|
+
* Format value with decimal separator, group separator and prefix
|
|
28
|
+
*/
|
|
29
|
+
var formatValue = function (options) {
|
|
30
|
+
var _value = options.value, decimalSeparator = options.decimalSeparator, intlConfig = options.intlConfig, decimalScale = options.decimalScale, _a = options.prefix, prefix = _a === void 0 ? '' : _a, _b = options.suffix, suffix = _b === void 0 ? '' : _b;
|
|
31
|
+
if (_value === '' || _value === undefined) {
|
|
32
|
+
return '';
|
|
33
|
+
}
|
|
34
|
+
if (_value === '-') {
|
|
35
|
+
return '-';
|
|
36
|
+
}
|
|
37
|
+
var isNegative = new RegExp("^\\d?-".concat(prefix ? "".concat((0, escapeRegExp_1.escapeRegExp)(prefix), "?") : '', "\\d")).test(_value);
|
|
38
|
+
var value = decimalSeparator !== '.'
|
|
39
|
+
? replaceDecimalSeparator(_value, decimalSeparator, isNegative)
|
|
40
|
+
: _value;
|
|
41
|
+
if (decimalSeparator && decimalSeparator !== '-' && value.startsWith(decimalSeparator)) {
|
|
42
|
+
value = '0' + value;
|
|
43
|
+
}
|
|
44
|
+
var defaultNumberFormatOptions = {
|
|
45
|
+
minimumFractionDigits: decimalScale || 0,
|
|
46
|
+
maximumFractionDigits: 20,
|
|
47
|
+
};
|
|
48
|
+
var numberFormatter = intlConfig
|
|
49
|
+
? new Intl.NumberFormat(intlConfig.locale, intlConfig.currency
|
|
50
|
+
? __assign(__assign({}, defaultNumberFormatOptions), { style: 'currency', currency: intlConfig.currency }) : defaultNumberFormatOptions)
|
|
51
|
+
: new Intl.NumberFormat(undefined, defaultNumberFormatOptions);
|
|
52
|
+
var parts = numberFormatter.formatToParts(Number(value));
|
|
53
|
+
var formatted = replaceParts(parts, options);
|
|
54
|
+
// Does intl formatting add a suffix?
|
|
55
|
+
var intlSuffix = (0, getSuffix_1.getSuffix)(formatted, __assign({}, options));
|
|
56
|
+
// Include decimal separator if user input ends with decimal separator
|
|
57
|
+
var includeDecimalSeparator = _value.slice(-1) === decimalSeparator ? decimalSeparator : '';
|
|
58
|
+
var _c = value.match(RegExp('\\d+\\.(\\d+)')) || [], decimals = _c[1];
|
|
59
|
+
// Keep original decimal padding if no decimalScale
|
|
60
|
+
if (decimalScale === undefined && decimals && decimalSeparator) {
|
|
61
|
+
if (formatted.includes(decimalSeparator)) {
|
|
62
|
+
formatted = formatted.replace(RegExp("(\\d+)(".concat((0, escapeRegExp_1.escapeRegExp)(decimalSeparator), ")(\\d+)"), 'g'), "$1$2".concat(decimals));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if (intlSuffix && !suffix) {
|
|
66
|
+
formatted = formatted.replace(intlSuffix, "".concat(decimalSeparator).concat(decimals).concat(intlSuffix));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
formatted = "".concat(formatted).concat(decimalSeparator).concat(decimals);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (suffix && includeDecimalSeparator) {
|
|
74
|
+
return "".concat(formatted).concat(includeDecimalSeparator).concat(suffix);
|
|
75
|
+
}
|
|
76
|
+
if (intlSuffix && includeDecimalSeparator) {
|
|
77
|
+
return formatted.replace(intlSuffix, "".concat(includeDecimalSeparator).concat(intlSuffix));
|
|
78
|
+
}
|
|
79
|
+
if (intlSuffix && suffix) {
|
|
80
|
+
return formatted.replace(intlSuffix, "".concat(includeDecimalSeparator).concat(suffix));
|
|
81
|
+
}
|
|
82
|
+
return [formatted, includeDecimalSeparator, suffix].join('');
|
|
83
|
+
};
|
|
84
|
+
exports.formatValue = formatValue;
|
|
85
|
+
/**
|
|
86
|
+
* Before converting to Number, decimal separator has to be .
|
|
87
|
+
*/
|
|
88
|
+
var replaceDecimalSeparator = function (value, decimalSeparator, isNegative) {
|
|
89
|
+
var newValue = value;
|
|
90
|
+
if (decimalSeparator && decimalSeparator !== '.') {
|
|
91
|
+
newValue = newValue.replace(RegExp((0, escapeRegExp_1.escapeRegExp)(decimalSeparator), 'g'), '.');
|
|
92
|
+
if (isNegative && decimalSeparator === '-') {
|
|
93
|
+
newValue = "-".concat(newValue.slice(1));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return newValue;
|
|
97
|
+
};
|
|
98
|
+
var replaceParts = function (parts, _a) {
|
|
99
|
+
var prefix = _a.prefix, groupSeparator = _a.groupSeparator, decimalSeparator = _a.decimalSeparator, decimalScale = _a.decimalScale, _b = _a.disableGroupSeparators, disableGroupSeparators = _b === void 0 ? false : _b;
|
|
100
|
+
return parts
|
|
101
|
+
.reduce(function (prev, _a, i) {
|
|
102
|
+
var type = _a.type, value = _a.value;
|
|
103
|
+
if (i === 0 && prefix) {
|
|
104
|
+
if (type === 'minusSign') {
|
|
105
|
+
return [value, prefix];
|
|
106
|
+
}
|
|
107
|
+
if (type === 'currency') {
|
|
108
|
+
return __spreadArray(__spreadArray([], prev, true), [prefix], false);
|
|
109
|
+
}
|
|
110
|
+
return [prefix, value];
|
|
111
|
+
}
|
|
112
|
+
if (type === 'currency') {
|
|
113
|
+
return prefix ? prev : __spreadArray(__spreadArray([], prev, true), [value], false);
|
|
114
|
+
}
|
|
115
|
+
if (type === 'group') {
|
|
116
|
+
return !disableGroupSeparators
|
|
117
|
+
? __spreadArray(__spreadArray([], prev, true), [groupSeparator !== undefined ? groupSeparator : value], false) : prev;
|
|
118
|
+
}
|
|
119
|
+
if (type === 'decimal') {
|
|
120
|
+
if (decimalScale !== undefined && decimalScale === 0) {
|
|
121
|
+
return prev;
|
|
122
|
+
}
|
|
123
|
+
return __spreadArray(__spreadArray([], prev, true), [decimalSeparator !== undefined ? decimalSeparator : value], false);
|
|
124
|
+
}
|
|
125
|
+
if (type === 'fraction') {
|
|
126
|
+
return __spreadArray(__spreadArray([], prev, true), [decimalScale !== undefined ? value.slice(0, decimalScale) : value], false);
|
|
127
|
+
}
|
|
128
|
+
return __spreadArray(__spreadArray([], prev, true), [value], false);
|
|
129
|
+
}, [''])
|
|
130
|
+
.join('');
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=formatValue.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IntlConfig } from '../CurrencyInputProps.js';
|
|
2
|
+
type LocaleConfig = {
|
|
3
|
+
currencySymbol: string;
|
|
4
|
+
groupSeparator: string;
|
|
5
|
+
decimalSeparator: string;
|
|
6
|
+
prefix: string;
|
|
7
|
+
suffix: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Get locale config from input or default
|
|
11
|
+
*/
|
|
12
|
+
export declare const getLocaleConfig: (intlConfig?: IntlConfig) => LocaleConfig;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSuffix = void 0;
|
|
4
|
+
var escapeRegExp_1 = require("./escapeRegExp.js");
|
|
5
|
+
var getSuffix = function (value, _a) {
|
|
6
|
+
var _b = _a.groupSeparator, groupSeparator = _b === void 0 ? ',' : _b, _c = _a.decimalSeparator, decimalSeparator = _c === void 0 ? '.' : _c;
|
|
7
|
+
var suffixReg = new RegExp("\\d([^".concat((0, escapeRegExp_1.escapeRegExp)(groupSeparator)).concat((0, escapeRegExp_1.escapeRegExp)(decimalSeparator), "0-9]+)"));
|
|
8
|
+
var suffixMatch = value.match(suffixReg);
|
|
9
|
+
return suffixMatch ? suffixMatch[1] : undefined;
|
|
10
|
+
};
|
|
11
|
+
exports.getSuffix = getSuffix;
|
|
12
|
+
//# sourceMappingURL=getSuffix.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './cleanValue.js';
|
|
2
|
+
export * from './fixedDecimalValue.js';
|
|
3
|
+
export * from './formatValue.js';
|
|
4
|
+
export * from './getLocaleConfig.js';
|
|
5
|
+
export * from './getSuffix.js';
|
|
6
|
+
export * from './isNumber.js';
|
|
7
|
+
export * from './padTrimValue.js';
|
|
8
|
+
export * from './repositionCursor.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cleanValue.js"), exports);
|
|
18
|
+
__exportStar(require("./fixedDecimalValue.js"), exports);
|
|
19
|
+
__exportStar(require("./formatValue.js"), exports);
|
|
20
|
+
__exportStar(require("./getLocaleConfig.js"), exports);
|
|
21
|
+
__exportStar(require("./getSuffix.js"), exports);
|
|
22
|
+
__exportStar(require("./isNumber.js"), exports);
|
|
23
|
+
__exportStar(require("./padTrimValue.js"), exports);
|
|
24
|
+
__exportStar(require("./repositionCursor.js"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAbbrValue = exports.abbrValue = void 0;
|
|
4
|
+
var escapeRegExp_1 = require("./escapeRegExp.js");
|
|
5
|
+
/**
|
|
6
|
+
* Abbreviate number eg. 1000 = 1k
|
|
7
|
+
*
|
|
8
|
+
* Source: https://stackoverflow.com/a/9345181
|
|
9
|
+
*/
|
|
10
|
+
var abbrValue = function (value, decimalSeparator, _decimalPlaces) {
|
|
11
|
+
if (decimalSeparator === void 0) { decimalSeparator = '.'; }
|
|
12
|
+
if (_decimalPlaces === void 0) { _decimalPlaces = 10; }
|
|
13
|
+
if (value > 999) {
|
|
14
|
+
var valueLength = ('' + value).length;
|
|
15
|
+
var p = Math.pow;
|
|
16
|
+
var d = p(10, _decimalPlaces);
|
|
17
|
+
valueLength -= valueLength % 3;
|
|
18
|
+
var abbrValue_1 = Math.round((value * d) / p(10, valueLength)) / d + ' kMGTPE'[valueLength / 3];
|
|
19
|
+
return abbrValue_1.replace('.', decimalSeparator);
|
|
20
|
+
}
|
|
21
|
+
return String(value);
|
|
22
|
+
};
|
|
23
|
+
exports.abbrValue = abbrValue;
|
|
24
|
+
var abbrMap = { k: 1000, m: 1000000, b: 1000000000 };
|
|
25
|
+
/**
|
|
26
|
+
* Parse a value with abbreviation e.g 1k = 1000
|
|
27
|
+
*/
|
|
28
|
+
var parseAbbrValue = function (value, decimalSeparator) {
|
|
29
|
+
if (decimalSeparator === void 0) { decimalSeparator = '.'; }
|
|
30
|
+
var reg = new RegExp("(\\d+(".concat((0, escapeRegExp_1.escapeRegExp)(decimalSeparator), "\\d*)?)([kmb])$"), 'i');
|
|
31
|
+
var match = value.match(reg);
|
|
32
|
+
if (match) {
|
|
33
|
+
var digits = match[1], abbr = match[3];
|
|
34
|
+
var multiplier = abbrMap[abbr.toLowerCase()];
|
|
35
|
+
return Number(digits.replace(decimalSeparator, '.')) * multiplier;
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
};
|
|
39
|
+
exports.parseAbbrValue = parseAbbrValue;
|
|
40
|
+
//# sourceMappingURL=parseAbbrValue.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeInvalidChars = void 0;
|
|
4
|
+
var escapeRegExp_1 = require("./escapeRegExp.js");
|
|
5
|
+
/**
|
|
6
|
+
* Remove invalid characters
|
|
7
|
+
*/
|
|
8
|
+
var removeInvalidChars = function (value, validChars) {
|
|
9
|
+
var chars = (0, escapeRegExp_1.escapeRegExp)(validChars.join(''));
|
|
10
|
+
var reg = new RegExp("[^\\d".concat(chars, "]"), 'gi');
|
|
11
|
+
return value.replace(reg, '');
|
|
12
|
+
};
|
|
13
|
+
exports.removeInvalidChars = removeInvalidChars;
|
|
14
|
+
//# sourceMappingURL=removeInvalidChars.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeSeparators = void 0;
|
|
4
|
+
var escapeRegExp_1 = require("./escapeRegExp.js");
|
|
5
|
+
/**
|
|
6
|
+
* Remove group separator from value eg. 1,000 > 1000
|
|
7
|
+
*/
|
|
8
|
+
var removeSeparators = function (value, separator) {
|
|
9
|
+
if (separator === void 0) { separator = ','; }
|
|
10
|
+
var reg = new RegExp((0, escapeRegExp_1.escapeRegExp)(separator), 'g');
|
|
11
|
+
return value.replace(reg, '');
|
|
12
|
+
};
|
|
13
|
+
exports.removeSeparators = removeSeparators;
|
|
14
|
+
//# sourceMappingURL=removeSeparators.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.CalendarHeader = void 0;
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var ui_1 = require("../../../../../../ui/index.js");
|
|
40
|
+
var mock_1 = require("../../mock/index.js");
|
|
41
|
+
var S = __importStar(require("./styles.js"));
|
|
42
|
+
function CalendarHeader(_a) {
|
|
43
|
+
var step = _a.step, language = _a.language, setStep = _a.setStep, dateSelected = _a.dateSelected, setDateSelected = _a.setDateSelected, handleToggle = _a.handleToggle;
|
|
44
|
+
var currentMonth = mock_1.translations[language].months[dateSelected.month];
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(S.CalendarHeader, { className: 'calendar-header', children: [(0, jsx_runtime_1.jsxs)("h4", { children: [step === 2 && ((0, jsx_runtime_1.jsx)("div", { className: 'icon-arrow-left', onClick: function () { setStep(1); }, children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconArrowLeft', fill: '#000' }) })), step === 2 && currentMonth.substring(0, 3), " ", dateSelected.year] }), (0, jsx_runtime_1.jsx)("button", { onClick: function () {
|
|
46
|
+
if (step === 1) {
|
|
47
|
+
setDateSelected(function (state) { return (__assign(__assign({}, state), { year: state.year > 0 ? state.year - 1 : state.year })); });
|
|
48
|
+
}
|
|
49
|
+
if (step === 2) {
|
|
50
|
+
setDateSelected(function (state) { return (__assign(__assign({}, state), { month: state.month > 0 ? state.month - 1 : state.month })); });
|
|
51
|
+
}
|
|
52
|
+
}, children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconArrowLeft' }) }), (0, jsx_runtime_1.jsx)("button", { onClick: function () {
|
|
53
|
+
if (step === 1) {
|
|
54
|
+
setDateSelected(function (state) { return (__assign(__assign({}, state), { year: state.year + 1 })); });
|
|
55
|
+
}
|
|
56
|
+
if (step === 2) {
|
|
57
|
+
setDateSelected(function (state) { return (__assign(__assign({}, state), { month: state.month === 12 ? state.month : state.month + 1 })); });
|
|
58
|
+
}
|
|
59
|
+
}, children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconArrowRight' }) })] }));
|
|
60
|
+
}
|
|
61
|
+
exports.CalendarHeader = CalendarHeader;
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Days = void 0;
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var formik_1 = require("formik");
|
|
40
|
+
var mock_1 = require("../../mock/index.js");
|
|
41
|
+
var S = __importStar(require("./styles.js"));
|
|
42
|
+
function Days(_a) {
|
|
43
|
+
var name = _a.name, language = _a.language, date = _a.date, dateSelected = _a.dateSelected, handleToggle = _a.handleToggle, setDateSelected = _a.setDateSelected;
|
|
44
|
+
var _b = (0, formik_1.useFormikContext)(), values = _b.values, setFieldValue = _b.setFieldValue;
|
|
45
|
+
var week = mock_1.translations[language].days;
|
|
46
|
+
var value = values[name];
|
|
47
|
+
var currentDate = new Date();
|
|
48
|
+
function createButton(text, isDisabled, type) {
|
|
49
|
+
if (isDisabled === void 0) { isDisabled = false; }
|
|
50
|
+
if (type === void 0) { type = 0; }
|
|
51
|
+
var comparisonDate = new Date(dateSelected.year, dateSelected.month + type, text);
|
|
52
|
+
var isDateInRange = (!date.minDate || comparisonDate >= date.minDate) &&
|
|
53
|
+
(!(date === null || date === void 0 ? void 0 : date.maxDate) || comparisonDate <= (date === null || date === void 0 ? void 0 : date.maxDate));
|
|
54
|
+
var isSelected = value.getTime() === comparisonDate.getTime();
|
|
55
|
+
var isToday = currentDate.getDate() === text &&
|
|
56
|
+
currentDate.getFullYear() === dateSelected.year &&
|
|
57
|
+
currentDate.getMonth() === dateSelected.month;
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)("button", { className: "".concat(isToday ? 'today' : '', " ").concat(isSelected ? 'selected' : '', " ").concat(isDateInRange ? '' : 'disabled'), onClick: function () {
|
|
59
|
+
if (!isDateInRange)
|
|
60
|
+
return;
|
|
61
|
+
setDateSelected(__assign(__assign({}, dateSelected), { day: text }));
|
|
62
|
+
setFieldValue(name, new Date(comparisonDate));
|
|
63
|
+
setTimeout(function () { return handleToggle(false); }, 0);
|
|
64
|
+
}, disabled: !isDateInRange, type: 'button', children: text }, "".concat(type, "-").concat(text)));
|
|
65
|
+
}
|
|
66
|
+
function displayDates() {
|
|
67
|
+
var dates = [];
|
|
68
|
+
var lastOfPrevMonth = new Date(dateSelected.year, dateSelected.month, 0);
|
|
69
|
+
for (var i = 0; i <= lastOfPrevMonth.getDay(); i++) {
|
|
70
|
+
var text = lastOfPrevMonth.getDate() - lastOfPrevMonth.getDay() + i;
|
|
71
|
+
dates.push(createButton(text, true, -1));
|
|
72
|
+
}
|
|
73
|
+
var lastOfMonth = new Date(dateSelected.year, dateSelected.month + 1, 0);
|
|
74
|
+
for (var i = 1; i <= lastOfMonth.getDate(); i++) {
|
|
75
|
+
dates.push(createButton(i, false));
|
|
76
|
+
}
|
|
77
|
+
var firstOfNextMonth = new Date(dateSelected.year, dateSelected.month + 1, 1);
|
|
78
|
+
for (var i = firstOfNextMonth.getDay(); i < 7; i++) {
|
|
79
|
+
var text = firstOfNextMonth.getDate() - firstOfNextMonth.getDay() + i;
|
|
80
|
+
dates.push(createButton(text, true, 1));
|
|
81
|
+
}
|
|
82
|
+
return dates;
|
|
83
|
+
}
|
|
84
|
+
return ((0, jsx_runtime_1.jsxs)(S.Days, { className: 'days-box', children: [(0, jsx_runtime_1.jsx)("div", { className: 'week', children: week.map(function (day) { return ((0, jsx_runtime_1.jsx)("p", { children: day }, day)); }) }), (0, jsx_runtime_1.jsx)("div", { className: 'days', children: displayDates() })] }));
|
|
85
|
+
}
|
|
86
|
+
exports.Days = Days;
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Months = void 0;
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var formik_1 = require("formik");
|
|
40
|
+
var mock_1 = require("../../mock/index.js");
|
|
41
|
+
var S = __importStar(require("./styles.js"));
|
|
42
|
+
function Months(_a) {
|
|
43
|
+
var language = _a.language, name = _a.name, mode = _a.mode, date = _a.date, dateSelected = _a.dateSelected, setStep = _a.setStep, handleToggle = _a.handleToggle, setDateSelected = _a.setDateSelected;
|
|
44
|
+
var _b = (0, formik_1.useFormikContext)(), values = _b.values, setFieldValue = _b.setFieldValue;
|
|
45
|
+
var months = mock_1.translations[language].months;
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(S.Months, { className: 'months-box', children: months.map(function (monthName, index) {
|
|
47
|
+
var monthDate = new Date(dateSelected.year, index, 1);
|
|
48
|
+
var isMonthInRange = ((date === null || date === void 0 ? void 0 : date.minDate) ? monthDate >= new Date(date === null || date === void 0 ? void 0 : date.minDate.getFullYear(), date === null || date === void 0 ? void 0 : date.minDate.getMonth(), 1) : true) &&
|
|
49
|
+
((date === null || date === void 0 ? void 0 : date.maxDate) ? monthDate <= new Date(date === null || date === void 0 ? void 0 : date.maxDate.getFullYear(), date === null || date === void 0 ? void 0 : date.maxDate.getMonth(), 1) : true);
|
|
50
|
+
var isSelected = values[name].getMonth() === index &&
|
|
51
|
+
values[name].getMonth() === dateSelected.month &&
|
|
52
|
+
values[name].getFullYear() === dateSelected.year;
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: 'button', className: "".concat(isSelected && 'selected', " ").concat(new Date().getMonth() === index && !isSelected && 'current', " ").concat(!isMonthInRange && 'disabled'), onClick: function () {
|
|
54
|
+
if (!isMonthInRange)
|
|
55
|
+
return;
|
|
56
|
+
setDateSelected(__assign(__assign({}, dateSelected), { month: index }));
|
|
57
|
+
if (mode === 'month') {
|
|
58
|
+
setFieldValue(name, new Date(dateSelected.year, index, 1));
|
|
59
|
+
handleToggle(false);
|
|
60
|
+
}
|
|
61
|
+
setStep(2);
|
|
62
|
+
}, disabled: !isMonthInRange, children: monthName.substring(0, 3) }, monthName));
|
|
63
|
+
}) }));
|
|
64
|
+
}
|
|
65
|
+
exports.Months = Months;
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ButtonUploadImageMobile = void 0;
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
var ui_1 = require("../../../../../../../ui");
|
|
5
|
+
var ui_1 = require("../../../../../../../ui/index.js");
|
|
6
6
|
function ButtonUploadImageMobile(props) {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
var _c = (0, ui_1.useFile)(props.mobile), InputFile = _c.InputFile, LabelFileArea = _c.LabelFileArea;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.FileItem = void 0;
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var ui_1 = require("../../../../../../ui/index.js");
|
|
40
|
+
var button_upload_image_mobile_1 = require("./button-upload-image-mobile/index.js");
|
|
41
|
+
var S = __importStar(require("./styles.js"));
|
|
42
|
+
function FileItem(props) {
|
|
43
|
+
var _a;
|
|
44
|
+
var _b = (0, ui_1.useFile)(props), loading = _b.loading, InputFile = _b.InputFile;
|
|
45
|
+
var _c = (0, ui_1.useRenderedFile)(props), Image = _c.Image, fileName = _c.fileName, ShowDetailFileButton = _c.ShowDetailFileButton, DeleteFileButton = _c.DeleteFileButton, DownloadButton = _c.DownloadButton;
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(S.FileItem, { children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'none' }, children: (0, jsx_runtime_1.jsx)(InputFile, {}) }), (0, jsx_runtime_1.jsx)("div", { className: 'image', children: loading ? (0, jsx_runtime_1.jsx)(ui_1.LoaderCircle, { size: 30, color: '#000' }) : (0, jsx_runtime_1.jsx)(Image, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: 'text', children: [(0, jsx_runtime_1.jsxs)("h3", { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'left', children: [props.enableMobileImage && ((0, jsx_runtime_1.jsx)("span", { className: 'font-13-regular type_size_file', children: props.isMobile ? 'Mobile' : 'Desktop' })), fileName && (0, jsx_runtime_1.jsx)("span", { className: 'font-13-regular file-name', children: fileName })] }), (props.sizeImageFile || props.sizeImageFileMobile) && ((0, jsx_runtime_1.jsxs)("span", { className: 'font-13-regular size', children: [!props.isMobile && ((0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconComputer' }), " ", props.sizeImageFile] })), !((_a = props === null || props === void 0 ? void 0 : props.mobile) === null || _a === void 0 ? void 0 : _a.mobileFilesAlredyExist) && props.enableMobileImage && ((0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconMobile' }), props.sizeImageFileMobile] }))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: 'actions', children: [(0, jsx_runtime_1.jsx)(ShowDetailFileButton, {}), (0, jsx_runtime_1.jsx)(DeleteFileButton, {}), (0, jsx_runtime_1.jsx)(DownloadButton, {}), (0, jsx_runtime_1.jsx)(button_upload_image_mobile_1.ButtonUploadImageMobile, __assign({}, props))] })] })] }));
|
|
47
|
+
}
|
|
48
|
+
exports.FileItem = FileItem;
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { CustomInputEvent, CustomInputEventHandler, Init, Tracking } from '../types';
|
|
2
|
+
import type { CustomInputEvent, CustomInputEventHandler, Init, Tracking } from '../types.js';
|
|
3
3
|
interface UseInputParam<D> {
|
|
4
4
|
init: Init;
|
|
5
5
|
tracking: Tracking<D>;
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = require("react");
|
|
7
7
|
var react_dom_1 = require("react-dom");
|
|
8
|
-
var SyntheticChangeError_1 = __importDefault(require("../errors/SyntheticChangeError"));
|
|
9
|
-
var setInputAttributes_1 = __importDefault(require("../utils/setInputAttributes"));
|
|
8
|
+
var SyntheticChangeError_1 = __importDefault(require("../errors/SyntheticChangeError.js"));
|
|
9
|
+
var setInputAttributes_1 = __importDefault(require("../utils/setInputAttributes.js"));
|
|
10
10
|
var TYPES = ['text', 'email', 'tel', 'search', 'url'];
|
|
11
11
|
function proxy(inputRef, init, _a) {
|
|
12
12
|
var onFocus = _a.onFocus, onBlur = _a.onBlur, onInput = _a.onInput;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as SyntheticChangeError } from './errors/SyntheticChangeError.js';
|
|
2
|
+
export { default as useConnectedInputRef } from './hooks/useConnectedInputRef.js';
|
|
3
|
+
export { default as useInput } from './hooks/useInput.js';
|
|
4
|
+
export { default as setInputAttributes } from './utils/setInputAttributes.js';
|
|
5
|
+
export type * from './types.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
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.setInputAttributes = exports.useInput = exports.useConnectedInputRef = exports.SyntheticChangeError = void 0;
|
|
7
|
+
var SyntheticChangeError_1 = require("./errors/SyntheticChangeError.js");
|
|
8
|
+
Object.defineProperty(exports, "SyntheticChangeError", { enumerable: true, get: function () { return __importDefault(SyntheticChangeError_1).default; } });
|
|
9
|
+
var useConnectedInputRef_1 = require("./hooks/useConnectedInputRef.js");
|
|
10
|
+
Object.defineProperty(exports, "useConnectedInputRef", { enumerable: true, get: function () { return __importDefault(useConnectedInputRef_1).default; } });
|
|
11
|
+
var useInput_1 = require("./hooks/useInput.js");
|
|
12
|
+
Object.defineProperty(exports, "useInput", { enumerable: true, get: function () { return __importDefault(useInput_1).default; } });
|
|
13
|
+
var setInputAttributes_1 = require("./utils/setInputAttributes.js");
|
|
14
|
+
Object.defineProperty(exports, "setInputAttributes", { enumerable: true, get: function () { return __importDefault(setInputAttributes_1).default; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InputAttributes } from '../types';
|
|
1
|
+
import type { InputAttributes } from '../types.js';
|
|
2
2
|
export default function setInputAttributes(inputElement: HTMLInputElement, { value, selectionStart, selectionEnd }: Partial<InputAttributes>): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MaskProps } from './types.js';
|
|
3
|
+
import type { InputComponent, InputComponentProps } from '../core/index.js';
|
|
4
|
+
export type InputMaskProps<C extends React.ComponentType | undefined = undefined> = MaskProps & InputComponentProps<C>;
|
|
5
|
+
declare const InputMask: InputComponent<MaskProps>;
|
|
6
|
+
export default InputMask;
|