@codeleap/web 5.8.20 → 6.0.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/dist/components/ActionIcon/index.d.ts +1 -1
- package/dist/components/ActionIcon/index.js +1 -1
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActivityIndicator/index.d.ts +9 -2
- package/dist/components/ActivityIndicator/index.js +8 -16
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/types.d.ts +1 -2
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Carousel/index.d.ts +5 -0
- package/dist/components/Carousel/index.js +168 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/Carousel/styles.d.ts +3 -0
- package/dist/components/Carousel/styles.js.map +1 -0
- package/dist/components/Carousel/types.d.ts +34 -0
- package/dist/components/{Grid → Carousel}/types.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.d.ts +1 -1
- package/dist/components/Collapse/index.js +3 -3
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/Collapse/types.d.ts +1 -2
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/ColorPicker/index.js +4 -4
- package/dist/components/ColorPicker/index.js.map +1 -1
- package/dist/components/ColorPicker/types.d.ts +3 -3
- package/dist/components/CropPicker/index.d.ts +9 -2
- package/dist/components/CropPicker/index.js +6 -6
- package/dist/components/CropPicker/index.js.map +1 -1
- package/dist/components/CropPicker/types.d.ts +3 -1
- package/dist/components/DatePicker/components/DayContent.js +1 -1
- package/dist/components/DatePicker/components/DayContent.js.map +1 -1
- package/dist/components/DatePicker/components/Header.js +1 -1
- package/dist/components/DatePicker/components/Header.js.map +1 -1
- package/dist/components/DatePicker/components/OuterInput.js +2 -12
- package/dist/components/DatePicker/components/OuterInput.js.map +1 -1
- package/dist/components/DatePicker/components/YearContent.js +1 -1
- package/dist/components/DatePicker/components/YearContent.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.js +12 -13
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DatePicker/types.d.ts +8 -6
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropzone/index.d.ts +9 -2
- package/dist/components/Dropzone/index.js +7 -6
- package/dist/components/Dropzone/index.js.map +1 -1
- package/dist/components/Dropzone/types.d.ts +3 -2
- package/dist/components/EmptyPlaceholder/index.d.ts +1 -1
- package/dist/components/EmptyPlaceholder/index.js +3 -3
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/types.d.ts +2 -2
- package/dist/components/FileInput/index.d.ts +5 -9
- package/dist/components/FileInput/index.js +6 -5
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.d.ts +2 -0
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/InputBase/index.js +2 -2
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +0 -1
- package/dist/components/InputBase/useInputBase.d.ts +2 -3
- package/dist/components/InputBase/useInputBase.js +2 -3
- package/dist/components/InputBase/useInputBase.js.map +1 -1
- package/dist/components/InputBase/useInputBasePartialStyles.js +1 -2
- package/dist/components/InputBase/useInputBasePartialStyles.js.map +1 -1
- package/dist/components/InputBase/utils.d.ts +1 -1
- package/dist/components/InputBase/utils.js +3 -3
- package/dist/components/InputBase/utils.js.map +1 -1
- package/dist/components/List/index.d.ts +2 -3
- package/dist/components/List/index.js +87 -40
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/styles.d.ts +2 -4
- package/dist/components/List/types.d.ts +10 -52
- package/dist/components/LoadingOverlay/index.d.ts +1 -1
- package/dist/components/LoadingOverlay/index.js +1 -1
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/MaskedTextInput/index.d.ts +7 -0
- package/dist/components/MaskedTextInput/index.js +69 -0
- package/dist/components/MaskedTextInput/index.js.map +1 -0
- package/dist/components/MaskedTextInput/mask.d.ts +8 -0
- package/dist/components/MaskedTextInput/mask.js +37 -0
- package/dist/components/MaskedTextInput/mask.js.map +1 -0
- package/dist/components/MaskedTextInput/types.d.ts +10 -0
- package/dist/components/MaskedTextInput/types.js.map +1 -0
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +6 -6
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/NumberIncrement/index.d.ts +1 -1
- package/dist/components/NumberIncrement/index.js +1 -3
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/useNumberIncrement.d.ts +4 -4
- package/dist/components/NumberIncrement/useNumberIncrement.js +1 -2
- package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -1
- package/dist/components/Overlay/index.d.ts +1 -1
- package/dist/components/PaginationButtons/index.d.ts +1 -1
- package/dist/components/PaginationButtons/index.js +2 -2
- package/dist/components/PaginationButtons/index.js.map +1 -1
- package/dist/components/PaginationButtons/types.d.ts +1 -2
- package/dist/components/PaginationIndicator/index.d.ts +2 -3
- package/dist/components/PaginationIndicator/index.js +2 -2
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/types.d.ts +3 -3
- package/dist/components/Progress/Bar/index.d.ts +1 -1
- package/dist/components/Progress/Bar/index.js +1 -1
- package/dist/components/Progress/Bar/index.js.map +1 -1
- package/dist/components/Progress/Bar/types.d.ts +2 -3
- package/dist/components/Progress/Circle/index.d.ts +1 -1
- package/dist/components/Progress/Circle/index.js +2 -2
- package/dist/components/Progress/Circle/index.js.map +1 -1
- package/dist/components/Progress/Circle/types.d.ts +1 -2
- package/dist/components/Progress/index.d.ts +0 -1
- package/dist/components/Progress/utils.js +1 -2
- package/dist/components/Progress/utils.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +1 -1
- package/dist/components/RadioInput/index.js +2 -2
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/index.d.ts +1 -1
- package/dist/components/SectionFilters/index.js +4 -4
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/types.d.ts +1 -2
- package/dist/components/SegmentedControl/index.d.ts +1 -1
- package/dist/components/SegmentedControl/index.js +12 -21
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/types.d.ts +2 -2
- package/dist/components/Select/index.js +5 -5
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +1 -2
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Select/types.d.ts +6 -6
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.js +3 -3
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +10 -2
- package/dist/components/Text/index.js +12 -20
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/types.d.ts +3 -2
- package/dist/components/TextEditor/index.d.ts +1 -1
- package/dist/components/TextEditor/index.js +21 -9
- package/dist/components/TextEditor/index.js.map +1 -1
- package/dist/components/TextEditor/types.d.ts +4 -5
- package/dist/components/TextInput/index.d.ts +9 -3
- package/dist/components/TextInput/index.js +14 -30
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/types.d.ts +4 -40
- package/dist/components/TextInput/useTextInput.d.ts +2 -6
- package/dist/components/TextInput/useTextInput.js +7 -16
- package/dist/components/TextInput/useTextInput.js.map +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/Tooltip/types.d.ts +1 -1
- package/dist/components/Touchable/index.d.ts +10 -2
- package/dist/components/Touchable/index.js +9 -19
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/types.d.ts +2 -1
- package/dist/components/View/index.d.ts +10 -2
- package/dist/components/View/index.js +7 -7
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/types.d.ts +2 -2
- package/dist/components/VirtualList/context.d.ts +3 -0
- package/dist/components/VirtualList/context.js +93 -0
- package/dist/components/VirtualList/context.js.map +1 -0
- package/dist/components/VirtualList/index.d.ts +5 -0
- package/dist/components/VirtualList/index.js +14 -0
- package/dist/components/VirtualList/index.js.map +1 -0
- package/dist/components/VirtualList/list.d.ts +3 -0
- package/dist/components/VirtualList/list.js +102 -0
- package/dist/components/VirtualList/list.js.map +1 -0
- package/dist/components/VirtualList/types.d.ts +33 -0
- package/dist/components/{Pager/styles.js → VirtualList/types.js} +1 -1
- package/dist/components/VirtualList/types.js.map +1 -0
- package/dist/components/components.d.ts +4 -2
- package/dist/components/components.js +4 -2
- package/dist/components/components.js.map +1 -1
- package/dist/lib/ListMasonry.js +3 -3
- package/dist/lib/ListMasonry.js.map +1 -1
- package/dist/lib/WebStyleRegistry.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +0 -1
- package/dist/lib/hooks/index.js +0 -1
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useAnimatedStyle.d.ts +8 -4
- package/dist/lib/hooks/useAnimatedStyle.js.map +1 -1
- package/dist/lib/hooks/useAnimatedVariantStyles.d.ts +3 -3
- package/dist/lib/hooks/useAnimatedVariantStyles.js +1 -2
- package/dist/lib/hooks/useAnimatedVariantStyles.js.map +1 -1
- package/dist/lib/hooks/useBreakpointMatch.js +1 -2
- package/dist/lib/hooks/useBreakpointMatch.js.map +1 -1
- package/dist/lib/hooks/useClick.js +1 -2
- package/dist/lib/hooks/useClick.js.map +1 -1
- package/dist/lib/hooks/useClickOutside.d.ts +1 -2
- package/dist/lib/hooks/useClickOutside.js +2 -3
- package/dist/lib/hooks/useClickOutside.js.map +1 -1
- package/dist/lib/hooks/useCropPicker.d.ts +1 -2
- package/dist/lib/hooks/useCropPicker.js +19 -7
- package/dist/lib/hooks/useCropPicker.js.map +1 -1
- package/dist/lib/hooks/useFileInput.d.ts +1 -2
- package/dist/lib/hooks/useKeydown.js +2 -2
- package/dist/lib/hooks/useKeydown.js.map +1 -1
- package/dist/lib/hooks/useMediaQuery.js +2 -3
- package/dist/lib/hooks/useMediaQuery.js.map +1 -1
- package/dist/lib/hooks/usePageExitBlocker.js.map +1 -1
- package/dist/lib/hooks/usePagination.js +1 -2
- package/dist/lib/hooks/usePagination.js.map +1 -1
- package/dist/lib/hooks/usePopState.js.map +1 -1
- package/dist/lib/hooks/useRefresh.d.ts +1 -1
- package/dist/lib/hooks/useRefresh.js.map +1 -1
- package/dist/lib/hooks/useScrollEffect.js +1 -2
- package/dist/lib/hooks/useScrollEffect.js.map +1 -1
- package/dist/lib/hooks/useSearchParams.d.ts +0 -1
- package/dist/lib/hooks/useSearchParams.js +1 -2
- package/dist/lib/hooks/useSearchParams.js.map +1 -1
- package/dist/lib/hooks/useStaticAnimationStyles.js +1 -2
- package/dist/lib/hooks/useStaticAnimationStyles.js.map +1 -1
- package/dist/lib/hooks/useWindowSize.js +1 -2
- package/dist/lib/hooks/useWindowSize.js.map +1 -1
- package/dist/lib/tools/localStorage.js.map +1 -1
- package/dist/lib/tools/mediaQuery.js +3 -4
- package/dist/lib/tools/mediaQuery.js.map +1 -1
- package/dist/lib/tools/modal.js +3 -3
- package/dist/lib/tools/modal.js.map +1 -1
- package/dist/lib/utils/pollyfils/scroll.js.map +1 -1
- package/dist/lib/utils/stopPropagation.js +1 -2
- package/dist/lib/utils/stopPropagation.js.map +1 -1
- package/dist/lib/utils/test.js.map +1 -1
- package/dist/types/utility.d.ts +2 -2
- package/package.json +39 -39
- package/package.json.bak +24 -24
- package/src/components/ActionIcon/index.tsx +1 -1
- package/src/components/ActivityIndicator/index.tsx +3 -4
- package/src/components/Badge/types.ts +1 -1
- package/src/components/Carousel/index.tsx +230 -0
- package/src/components/{Pager → Carousel}/styles.ts +2 -2
- package/src/components/Carousel/types.ts +41 -0
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Collapse/index.tsx +1 -1
- package/src/components/Collapse/types.ts +1 -1
- package/src/components/ColorPicker/types.ts +3 -3
- package/src/components/CropPicker/index.tsx +4 -3
- package/src/components/CropPicker/types.ts +3 -1
- package/src/components/DatePicker/components/OuterInput.tsx +3 -12
- package/src/components/DatePicker/index.tsx +18 -10
- package/src/components/DatePicker/types.ts +8 -5
- package/src/components/Dropzone/index.tsx +3 -2
- package/src/components/Dropzone/types.ts +3 -1
- package/src/components/EmptyPlaceholder/types.ts +2 -2
- package/src/components/FileInput/index.tsx +4 -3
- package/src/components/FileInput/types.ts +2 -0
- package/src/components/InputBase/useInputBase.ts +1 -1
- package/src/components/InputBase/utils.ts +1 -1
- package/src/components/List/index.tsx +56 -78
- package/src/components/List/styles.ts +2 -10
- package/src/components/List/types.ts +10 -52
- package/src/components/MaskedTextInput/index.tsx +58 -0
- package/src/components/MaskedTextInput/mask.ts +41 -0
- package/src/components/MaskedTextInput/types.ts +18 -0
- package/src/components/NumberIncrement/index.tsx +1 -3
- package/src/components/PaginationButtons/types.ts +1 -1
- package/src/components/PaginationIndicator/types.ts +2 -2
- package/src/components/Progress/Bar/types.ts +2 -2
- package/src/components/Progress/Circle/types.ts +1 -1
- package/src/components/SectionFilters/types.ts +1 -1
- package/src/components/SegmentedControl/index.tsx +6 -5
- package/src/components/SegmentedControl/types.ts +2 -2
- package/src/components/Select/index.tsx +3 -3
- package/src/components/Select/types.ts +6 -6
- package/src/components/Switch/index.tsx +1 -1
- package/src/components/Text/index.tsx +4 -3
- package/src/components/Text/types.ts +3 -2
- package/src/components/TextEditor/index.tsx +20 -18
- package/src/components/TextEditor/types.ts +5 -5
- package/src/components/TextInput/index.tsx +14 -34
- package/src/components/TextInput/types.ts +5 -57
- package/src/components/TextInput/useTextInput.ts +10 -19
- package/src/components/Tooltip/types.ts +1 -1
- package/src/components/Touchable/index.tsx +4 -4
- package/src/components/Touchable/types.ts +2 -1
- package/src/components/View/index.tsx +6 -5
- package/src/components/View/types.ts +3 -3
- package/src/components/VirtualList/context.tsx +93 -0
- package/src/components/VirtualList/index.tsx +11 -0
- package/src/components/VirtualList/list.tsx +85 -0
- package/src/components/VirtualList/types.ts +38 -0
- package/src/components/components.ts +4 -2
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useAnimatedStyle.ts +11 -7
- package/src/lib/hooks/useAnimatedVariantStyles.ts +2 -2
- package/src/lib/hooks/useClickOutside.ts +1 -1
- package/src/lib/hooks/useMediaQuery.ts +1 -1
- package/src/types/utility.ts +2 -2
- package/dist/components/Grid/index.d.ts +0 -13
- package/dist/components/Grid/index.js +0 -94
- package/dist/components/Grid/index.js.map +0 -1
- package/dist/components/Grid/styles.d.ts +0 -2
- package/dist/components/Grid/styles.js.map +0 -1
- package/dist/components/Grid/types.d.ts +0 -9
- package/dist/components/List/ListLayout.d.ts +0 -2
- package/dist/components/List/ListLayout.js +0 -39
- package/dist/components/List/ListLayout.js.map +0 -1
- package/dist/components/Pager/index.d.ts +0 -7
- package/dist/components/Pager/index.js +0 -118
- package/dist/components/Pager/index.js.map +0 -1
- package/dist/components/Pager/styles.d.ts +0 -3
- package/dist/components/Pager/styles.js.map +0 -1
- package/dist/components/Pager/types.d.ts +0 -27
- package/dist/components/Pager/types.js.map +0 -1
- package/dist/components/TextInput/mask.d.ts +0 -5
- package/dist/components/TextInput/mask.js +0 -110
- package/dist/components/TextInput/mask.js.map +0 -1
- package/dist/lib/deprecated/OSAlert.d.ts +0 -38
- package/dist/lib/deprecated/OSAlert.js +0 -139
- package/dist/lib/deprecated/OSAlert.js.map +0 -1
- package/dist/lib/deprecated/index.d.ts +0 -1
- package/dist/lib/deprecated/index.js +0 -22
- package/dist/lib/deprecated/index.js.map +0 -1
- package/dist/lib/hooks/useInfiniteScroll.d.ts +0 -22
- package/dist/lib/hooks/useInfiniteScroll.js +0 -98
- package/dist/lib/hooks/useInfiniteScroll.js.map +0 -1
- package/src/components/Grid/index.tsx +0 -126
- package/src/components/Grid/styles.ts +0 -3
- package/src/components/Grid/types.ts +0 -13
- package/src/components/List/ListLayout.tsx +0 -87
- package/src/components/Pager/index.tsx +0 -156
- package/src/components/Pager/types.ts +0 -35
- package/src/components/TextInput/mask.tsx +0 -117
- package/src/lib/deprecated/OSAlert.tsx +0 -200
- package/src/lib/deprecated/index.ts +0 -6
- package/src/lib/hooks/useInfiniteScroll.ts +0 -77
- /package/dist/components/{Grid → Carousel}/styles.js +0 -0
- /package/dist/components/{Grid → Carousel}/types.js +0 -0
- /package/dist/components/{Pager → MaskedTextInput}/types.js +0 -0
|
@@ -1,110 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.maskPreset = exports.getMaskInputProps = void 0;
|
|
15
|
-
var types_1 = require("@codeleap/types");
|
|
16
|
-
var getMaskInputProps = function (_a) {
|
|
17
|
-
var _b, _c, _d;
|
|
18
|
-
var masking = _a.masking;
|
|
19
|
-
var _e = masking.type, type = _e === void 0 ? 'custom' : _e, _f = masking.options, options = _f === void 0 ? {} : _f;
|
|
20
|
-
var maskType = (_c = (_b = masking === null || masking === void 0 ? void 0 : masking.options) === null || _b === void 0 ? void 0 : _b.maskType) !== null && _c !== void 0 ? _c : 'INTERNATIONAL';
|
|
21
|
-
var phoneType = maskType === 'INTERNATIONAL' ? 'cel-phone' : 'cel-phone-brl';
|
|
22
|
-
var presetProps = (masking === null || masking === void 0 ? void 0 : masking.type) === 'cel-phone' ? exports.maskPreset[phoneType] : exports.maskPreset[type];
|
|
23
|
-
var isObfuscated = (options === null || options === void 0 ? void 0 : options.obfuscated) === true && {
|
|
24
|
-
type: 'password',
|
|
25
|
-
};
|
|
26
|
-
var notSaveFormatted = (types_1.TypeGuards.isBoolean(masking === null || masking === void 0 ? void 0 : masking.saveFormatted) && (masking === null || masking === void 0 ? void 0 : masking.saveFormatted) === false);
|
|
27
|
-
var props = __assign(__assign(__assign(__assign({}, presetProps), options), isObfuscated), { notSaveFormatted: notSaveFormatted, beforeMaskedValueChange: masking === null || masking === void 0 ? void 0 : masking.onChangeMask });
|
|
28
|
-
var defaultGetRawValue = function (value) {
|
|
29
|
-
var _a;
|
|
30
|
-
return (_a = String(value)) === null || _a === void 0 ? void 0 : _a.replace(/\D/g, '');
|
|
31
|
-
};
|
|
32
|
-
return __assign(__assign({}, props), { validator: notSaveFormatted ? null : props === null || props === void 0 ? void 0 : props.validator, getRawValue: (_d = props === null || props === void 0 ? void 0 : props.getRawValue) !== null && _d !== void 0 ? _d : defaultGetRawValue });
|
|
33
|
-
};
|
|
34
|
-
exports.getMaskInputProps = getMaskInputProps;
|
|
35
|
-
var format = {
|
|
36
|
-
number: "['0123456789']",
|
|
37
|
-
};
|
|
38
|
-
var validatorRegExp = function (value, regex, error) {
|
|
39
|
-
var isValid = regex.test(String(value));
|
|
40
|
-
return {
|
|
41
|
-
valid: isValid,
|
|
42
|
-
message: error,
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
exports.maskPreset = {
|
|
46
|
-
'credit-card': {
|
|
47
|
-
mask: '9999 9999 9999 9999',
|
|
48
|
-
placeholder: 'xxxx xxxx xxxx xxxx',
|
|
49
|
-
formatChars: {
|
|
50
|
-
'9': format.number,
|
|
51
|
-
},
|
|
52
|
-
validator: function (value) {
|
|
53
|
-
return validatorRegExp(value, /^\d{4}\s?\d{4}\s?\d{4}\s?\d{4}$/, 'Invalid information');
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
'cpf': {
|
|
57
|
-
mask: '999.999.999-99',
|
|
58
|
-
placeholder: 'xxx.xxx.xxx-xx',
|
|
59
|
-
formatChars: {
|
|
60
|
-
'9': format.number,
|
|
61
|
-
},
|
|
62
|
-
validator: function (value) {
|
|
63
|
-
return validatorRegExp(value, /^\d{3}\.\d{3}\.\d{3}-\d{2}$/, 'Invalid CPF');
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
'cnpj': {
|
|
67
|
-
mask: '99.999.999/9999-99',
|
|
68
|
-
placeholder: 'xx.xxx.xxx/xxxx-xx',
|
|
69
|
-
formatChars: {
|
|
70
|
-
'9': format.number,
|
|
71
|
-
},
|
|
72
|
-
validator: function (value) {
|
|
73
|
-
return validatorRegExp(value, /^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$/, 'Invalid CNPJ');
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
'zip-code': {
|
|
77
|
-
mask: '99999-999',
|
|
78
|
-
placeholder: 'xxxxx-xxx',
|
|
79
|
-
formatChars: {
|
|
80
|
-
'9': format.number,
|
|
81
|
-
},
|
|
82
|
-
validator: function (value) {
|
|
83
|
-
return validatorRegExp(value, /^\d{5}-\d{3}$/, 'Invalid zip code');
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
'cel-phone': {
|
|
87
|
-
mask: '+999 999 999 999',
|
|
88
|
-
placeholder: '+xxx xxx xxx xxx',
|
|
89
|
-
maskType: 'INTERNATIONAL',
|
|
90
|
-
formatChars: {
|
|
91
|
-
'9': format.number,
|
|
92
|
-
},
|
|
93
|
-
validator: function (value) {
|
|
94
|
-
return validatorRegExp(value, /^\+\d{3}\s\d{3}\s\d{3}\s\d{3}$/, 'Invalid phone');
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
'cel-phone-brl': {
|
|
98
|
-
mask: '(99) 99999-9999',
|
|
99
|
-
placeholder: '(xx) xxxxx-xxxx',
|
|
100
|
-
maskType: 'BRL',
|
|
101
|
-
formatChars: {
|
|
102
|
-
'9': format.number,
|
|
103
|
-
},
|
|
104
|
-
validator: function (value) {
|
|
105
|
-
return validatorRegExp(value, /^\(?\d{2}\)?\s?9?\d{4}-\d{4}$/, 'Invalid phone');
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
'custom': {},
|
|
109
|
-
};
|
|
110
|
-
//# sourceMappingURL=mask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mask.js","sourceRoot":"","sources":["../../../src/components/TextInput/mask.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yCAA4C;AAGrC,IAAM,iBAAiB,GAAG,UAAC,EAA2B;;QAAzB,OAAO,aAAA;IAEvC,IAAA,KAEE,OAAO,KAFM,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,KACE,OAAO,QADG,EAAZ,OAAO,mBAAG,EAAE,KAAA,CACH;IAEX,IAAM,QAAQ,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,QAAQ,mCAAI,eAAe,CAAA;IAC9D,IAAM,SAAS,GAAG,QAAQ,KAAK,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAA;IAE9E,IAAM,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,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ACvB,OAAO,eAAe,CAAC,KAAK,EAAE,gCAAgC,EAAE,eAAe,CAAC,CAAA;QAClF,CAAC;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE;YACX,GAAG,EAAE,MAAM,CAAC,MAAM;SACnB;QACD,SAAS,EAAE,UAAC,KAAa;YACvB,OAAO,eAAe,CAAC,KAAK,EAAE,+BAA+B,EAAE,eAAe,CAAC,CAAA;QACjF,CAAC;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AnyFunction } from '@codeleap/types';
|
|
2
|
-
type AlertButton = {
|
|
3
|
-
text: string;
|
|
4
|
-
onPress: AnyFunction;
|
|
5
|
-
variants?: any[];
|
|
6
|
-
};
|
|
7
|
-
type OSAlertArgs = {
|
|
8
|
-
title: string;
|
|
9
|
-
body?: string;
|
|
10
|
-
options?: AlertButton[];
|
|
11
|
-
onDismiss?: AnyFunction;
|
|
12
|
-
onAction?: AnyFunction;
|
|
13
|
-
type?: Exclude<GlobalAlertType, 'custom'> | string;
|
|
14
|
-
};
|
|
15
|
-
type AlertEvent = AlertButton['onPress'];
|
|
16
|
-
type NamedEvents<E extends string> = Partial<Record<E, AlertEvent>>;
|
|
17
|
-
export type GlobalAlertType = 'info' | 'error' | 'warn' | 'ask' | 'custom';
|
|
18
|
-
export type GlobalAlertComponentProps = {
|
|
19
|
-
args: OSAlertArgs;
|
|
20
|
-
removeSelf: AnyFunction;
|
|
21
|
-
type: GlobalAlertType;
|
|
22
|
-
id: string;
|
|
23
|
-
};
|
|
24
|
-
export declare function useGlobalAlertComponent(props: GlobalAlertComponentProps): {
|
|
25
|
-
visible: boolean;
|
|
26
|
-
toggle: (value?: boolean) => void;
|
|
27
|
-
};
|
|
28
|
-
export declare function CreateOSAlert(Component: any): {
|
|
29
|
-
ask: ({ title, body, options }: OSAlertArgs) => void;
|
|
30
|
-
warn: (args: OSAlertArgs & NamedEvents<'onReject' | 'onAccept'>) => void;
|
|
31
|
-
info: (args: OSAlertArgs & NamedEvents<'onDismiss'>) => void;
|
|
32
|
-
error: (args: OSAlertArgs & NamedEvents<'onDismiss'>) => void;
|
|
33
|
-
custom: (args: OSAlertArgs & {
|
|
34
|
-
type: string;
|
|
35
|
-
}) => void;
|
|
36
|
-
};
|
|
37
|
-
export declare const AlertOutlet: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
-
export {};
|
|
@@ -1,139 +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
|
-
exports.AlertOutlet = exports.CreateOSAlert = exports.useGlobalAlertComponent = void 0;
|
|
29
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
-
var hooks_1 = require("@codeleap/hooks");
|
|
31
|
-
var react_dom_1 = __importDefault(require("react-dom"));
|
|
32
|
-
var uuid_1 = require("uuid");
|
|
33
|
-
function useGlobalAlertComponent(props) {
|
|
34
|
-
var _a = (0, hooks_1.useBooleanToggle)(false), visible = _a[0], toggle = _a[1];
|
|
35
|
-
var previousVisible = (0, hooks_1.usePrevious)(visible);
|
|
36
|
-
(0, hooks_1.onMount)(function () {
|
|
37
|
-
toggle();
|
|
38
|
-
});
|
|
39
|
-
(0, hooks_1.onUpdate)(function () {
|
|
40
|
-
if (!visible && previousVisible) {
|
|
41
|
-
setTimeout(props.removeSelf, 1000);
|
|
42
|
-
}
|
|
43
|
-
}, [visible]);
|
|
44
|
-
return {
|
|
45
|
-
visible: visible,
|
|
46
|
-
toggle: toggle,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
exports.useGlobalAlertComponent = useGlobalAlertComponent;
|
|
50
|
-
function RenderModal(props) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
var MODAL_ID = '__CODELEAP_MODAL__';
|
|
54
|
-
function OSAlert(props) {
|
|
55
|
-
if (!document)
|
|
56
|
-
return;
|
|
57
|
-
var modalId = MODAL_ID + '_' + (0, uuid_1.v4)();
|
|
58
|
-
var modalsRootDiv = document.getElementById(MODAL_ID);
|
|
59
|
-
var modalDiv = document.getElementById(modalId);
|
|
60
|
-
var remove = function () {
|
|
61
|
-
react_dom_1.default.unmountComponentAtNode(modalDiv);
|
|
62
|
-
};
|
|
63
|
-
if (!modalDiv) {
|
|
64
|
-
modalDiv = document.createElement('div');
|
|
65
|
-
modalDiv.setAttribute('id', MODAL_ID);
|
|
66
|
-
modalsRootDiv.appendChild(modalDiv);
|
|
67
|
-
}
|
|
68
|
-
react_dom_1.default.render((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(OSAlert.Component, { removeSelf: remove, args: props, type: props.type, id: modalId }) }), modalDiv);
|
|
69
|
-
}
|
|
70
|
-
OSAlert.Component = RenderModal;
|
|
71
|
-
function CreateOSAlert(Component) {
|
|
72
|
-
OSAlert.Component = Component;
|
|
73
|
-
function ask(_a) {
|
|
74
|
-
var title = _a.title, body = _a.body, options = _a.options;
|
|
75
|
-
if (!title) {
|
|
76
|
-
title = 'Quick quetion';
|
|
77
|
-
}
|
|
78
|
-
OSAlert({
|
|
79
|
-
title: title,
|
|
80
|
-
body: body,
|
|
81
|
-
options: options,
|
|
82
|
-
type: 'ask',
|
|
83
|
-
onAction: null,
|
|
84
|
-
onDismiss: null,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function OSError(args) {
|
|
88
|
-
var title = args.title, body = args.body;
|
|
89
|
-
if (!title) {
|
|
90
|
-
title = 'Whoops!';
|
|
91
|
-
}
|
|
92
|
-
if (!body) {
|
|
93
|
-
body = 'Something went wrong';
|
|
94
|
-
}
|
|
95
|
-
OSAlert({
|
|
96
|
-
title: title,
|
|
97
|
-
body: body,
|
|
98
|
-
type: 'error',
|
|
99
|
-
onAction: args.onDismiss,
|
|
100
|
-
onDismiss: args.onDismiss,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function warn(args) {
|
|
104
|
-
var _a = args.title, title = _a === void 0 ? 'Hang on' : _a, _b = args.body, body = _b === void 0 ? 'Are you sure?' : _b, onAccept = args.onAccept, _c = args.onReject, onReject = _c === void 0 ? function () { return null; } : _c;
|
|
105
|
-
OSAlert({
|
|
106
|
-
title: title,
|
|
107
|
-
body: body,
|
|
108
|
-
type: 'warn',
|
|
109
|
-
onAction: onAccept,
|
|
110
|
-
onDismiss: onReject,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function info(args) {
|
|
114
|
-
var _a = args.title, title = _a === void 0 ? 'FYI' : _a, body = args.body, _b = args.onDismiss, onDismiss = _b === void 0 ? function () { return null; } : _b;
|
|
115
|
-
OSAlert({
|
|
116
|
-
title: title,
|
|
117
|
-
body: body,
|
|
118
|
-
type: 'info',
|
|
119
|
-
onDismiss: onDismiss,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function custom(args) {
|
|
123
|
-
var _a = args.title, title = _a === void 0 ? 'Hang on' : _a, _b = args.body, body = _b === void 0 ? 'Are you sure?' : _b, type = args.type, rest = __rest(args, ["title", "body", "type"]);
|
|
124
|
-
OSAlert(__assign({ title: title, body: body, type: type }, rest));
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
ask: ask,
|
|
128
|
-
warn: warn,
|
|
129
|
-
info: info,
|
|
130
|
-
error: OSError,
|
|
131
|
-
custom: custom,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
exports.CreateOSAlert = CreateOSAlert;
|
|
135
|
-
var AlertOutlet = function () {
|
|
136
|
-
return (0, jsx_runtime_1.jsx)("div", { id: MODAL_ID });
|
|
137
|
-
};
|
|
138
|
-
exports.AlertOutlet = AlertOutlet;
|
|
139
|
-
//# sourceMappingURL=OSAlert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OSAlert.js","sourceRoot":"","sources":["../../../src/lib/deprecated/OSAlert.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAkF;AAElF,wDAAgC;AAChC,6BAAiC;AA6BjC,SAAgB,uBAAuB,CAAC,KAAgC;IAChE,IAAA,KAAoB,IAAA,wBAAgB,EAAC,KAAK,CAAC,EAA1C,OAAO,QAAA,EAAE,MAAM,QAA2B,CAAA;IAEjD,IAAM,eAAe,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAA;IAE5C,IAAA,eAAO,EAAC;QACN,MAAM,EAAE,CAAA;IACV,CAAC,CAAC,CAAA;IAEF,IAAA,gBAAQ,EAAC;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,KAGE,IAAI,MAHO,EAAb,KAAK,mBAAG,KAAK,KAAA,EACb,IAAI,GAEF,IAAI,KAFF,EACJ,KACE,IAAI,UADgB,EAAtB,SAAS,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA,CAChB;QAER,OAAO,CAAC;YACN,KAAK,OAAA;YACL,IAAI,MAAA;YACJ,IAAI,EAAE,MAAM;YACZ,SAAS,WAAA;SACV,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,MAAM,CAAC,IAAkC;QAE9C,IAAA,KAIE,IAAI,MAJW,EAAjB,KAAK,mBAAG,SAAS,KAAA,EACjB,KAGE,IAAI,KAHgB,EAAtB,IAAI,mBAAG,eAAe,KAAA,EACtB,IAAI,GAEF,IAAI,KAFF,EACD,IAAI,UACL,IAAI,EALF,yBAKL,CADQ,CACD;QAER,OAAO,YACL,KAAK,OAAA,EACL,IAAI,MAAA,EACJ,IAAI,EAAE,IAAuB,IAC1B,IAAI,EACP,CAAA;IACJ,CAAC;IAED,OAAO;QACL,GAAG,KAAA;QACH,IAAI,MAAA;QACJ,IAAI,MAAA;QACJ,KAAK,EAAE,OAAO;QACd,MAAM,QAAA;KACP,CAAA;AACH,CAAC;AAlGD,sCAkGC;AAEM,IAAM,WAAW,GAAG;IACzB,OAAO,gCAAK,EAAE,EAAE,QAAQ,GAAI,CAAA;AAC9B,CAAC,CAAA;AAFY,QAAA,WAAW,eAEvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './OSAlert';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @Deprecated module
|
|
3
|
-
// All things here are discontinued and will be removed over time.
|
|
4
|
-
// They are no longer updated and are only here because other projects
|
|
5
|
-
// still use them and it is important not to affect their functioning.
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
__exportStar(require("./OSAlert"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/deprecated/index.ts"],"names":[],"mappings":";AAAA,qBAAqB;AACrB,mEAAmE;AACnE,uEAAuE;AACvE,sEAAsE;;;;;;;;;;;;;;;;AAEtE,4CAAyB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnyFunction } from '@codeleap/types';
|
|
3
|
-
import { LoadMoreItemsCallback, UseInfiniteLoaderOptions } from 'masonic';
|
|
4
|
-
import { ListProps } from '../../components/List';
|
|
5
|
-
import { GridProps } from '../../components/Grid';
|
|
6
|
-
export type UseInfiniteScrollArgs<Item extends Element = any> = {
|
|
7
|
-
threshold?: number;
|
|
8
|
-
onLoadMore?: AnyFunction;
|
|
9
|
-
loadMoreOptions?: Partial<UseInfiniteLoaderOptions<Item>>;
|
|
10
|
-
};
|
|
11
|
-
export type UseInfiniteScrollProps<Item extends Element = any> = Partial<ListProps> & Partial<GridProps> & UseInfiniteScrollArgs<Item>;
|
|
12
|
-
export type UseInfiniteScrollReturn<Item extends Element = any> = {
|
|
13
|
-
onLoadMore: LoadMoreItemsCallback<Item>;
|
|
14
|
-
isRefresh: boolean;
|
|
15
|
-
layoutProps: {
|
|
16
|
-
isEmpty: boolean;
|
|
17
|
-
refreshing: boolean;
|
|
18
|
-
scrollableRef: React.MutableRefObject<undefined>;
|
|
19
|
-
};
|
|
20
|
-
onRefreshItems: AnyFunction;
|
|
21
|
-
};
|
|
22
|
-
export declare function useInfiniteScroll<Item extends Element = any>(props: UseInfiniteScrollProps<Item>): UseInfiniteScrollReturn<Item>;
|
|
@@ -1,98 +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.useInfiniteScroll = void 0;
|
|
54
|
-
var react_1 = __importDefault(require("react"));
|
|
55
|
-
var types_1 = require("@codeleap/types");
|
|
56
|
-
var masonic_1 = require("masonic");
|
|
57
|
-
var useRefresh_1 = require("./useRefresh");
|
|
58
|
-
function useInfiniteScroll(props) {
|
|
59
|
-
var _this = this;
|
|
60
|
-
var onRefresh = props.onRefresh, data = props.data, hasNextPage = props.hasNextPage, refreshEnabled = props.refresh, fetchNextPage = props.fetchNextPage, refreshThreshold = props.refreshThreshold, refreshDebounce = props.refreshDebounce, _a = props.loadMoreOptions, loadMoreOptions = _a === void 0 ? {} : _a, onLoadMore = props.onLoadMore, _b = props.threshold, threshold = _b === void 0 ? 16 : _b;
|
|
61
|
-
var infiniteLoader = (0, masonic_1.useInfiniteLoader)(function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
62
|
-
return __generator(this, function (_a) {
|
|
63
|
-
switch (_a.label) {
|
|
64
|
-
case 0:
|
|
65
|
-
if (!hasNextPage) return [3 /*break*/, 2];
|
|
66
|
-
return [4 /*yield*/, (fetchNextPage === null || fetchNextPage === void 0 ? void 0 : fetchNextPage())];
|
|
67
|
-
case 1:
|
|
68
|
-
_a.sent();
|
|
69
|
-
_a.label = 2;
|
|
70
|
-
case 2:
|
|
71
|
-
if (!types_1.TypeGuards.isFunction(onLoadMore)) return [3 /*break*/, 4];
|
|
72
|
-
return [4 /*yield*/, (onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore(args))];
|
|
73
|
-
case 3:
|
|
74
|
-
_a.sent();
|
|
75
|
-
_a.label = 4;
|
|
76
|
-
case 4: return [2 /*return*/];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}); }, __assign({ isItemLoaded: function (index, items) { return !!(items === null || items === void 0 ? void 0 : items[index]); }, threshold: threshold }, loadMoreOptions));
|
|
80
|
-
var refreshHookReturn = (0, useRefresh_1.useRefresh)(onRefresh, {
|
|
81
|
-
threshold: refreshThreshold,
|
|
82
|
-
debounce: refreshDebounce,
|
|
83
|
-
enabled: refreshEnabled,
|
|
84
|
-
});
|
|
85
|
-
var isEmpty = react_1.default.useMemo(function () { return (!data || !(data === null || data === void 0 ? void 0 : data.length)); }, [data === null || data === void 0 ? void 0 : data.length]);
|
|
86
|
-
return {
|
|
87
|
-
onLoadMore: infiniteLoader,
|
|
88
|
-
isRefresh: refreshHookReturn.refresh,
|
|
89
|
-
layoutProps: {
|
|
90
|
-
scrollableRef: refreshHookReturn.scrollableRef,
|
|
91
|
-
refreshing: refreshHookReturn.refresh,
|
|
92
|
-
isEmpty: isEmpty,
|
|
93
|
-
},
|
|
94
|
-
onRefreshItems: refreshHookReturn.refresher,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
exports.useInfiniteScroll = useInfiniteScroll;
|
|
98
|
-
//# sourceMappingURL=useInfiniteScroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteScroll.js","sourceRoot":"","sources":["../../../src/lib/hooks/useInfiniteScroll.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,yCAAyD;AACzD,mCAA4F;AAG5F,2CAAyC;AAwBzC,SAAgB,iBAAiB,CAA6B,KAAmC;IAAjG,iBA+CC;IA7CG,IAAA,SAAS,GAUP,KAAK,UAVE,EACT,IAAI,GASF,KAAK,KATH,EACJ,WAAW,GAQT,KAAK,YARI,EACF,cAAc,GAOrB,KAAK,QAPgB,EACvB,aAAa,GAMX,KAAK,cANM,EACb,gBAAgB,GAKd,KAAK,iBALS,EAChB,eAAe,GAIb,KAAK,gBAJQ,EACf,KAGE,KAAK,gBAHa,EAApB,eAAe,mBAAG,EAAE,KAAA,EACpB,UAAU,GAER,KAAK,WAFG,EACV,KACE,KAAK,UADO,EAAd,SAAS,mBAAG,EAAE,KAAA,CACP;IAET,IAAM,cAAc,GAAG,IAAA,2BAAiB,EACtC,UAAO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} from '../View'
|
|
3
|
-
import { EmptyPlaceholder } from '../EmptyPlaceholder'
|
|
4
|
-
import { GridProps } from './types'
|
|
5
|
-
import { ListItem, ListLayout } from '../List'
|
|
6
|
-
import { ItemMasonryProps, ListMasonry, useInfiniteScroll, useMasonryReload } from '../../lib'
|
|
7
|
-
import { useStylesFor } from '../../lib/hooks/useStylesFor'
|
|
8
|
-
import { AnyRecord, IJSX, StyledComponentProps } from '@codeleap/styles'
|
|
9
|
-
import { WebStyleRegistry } from '../../lib/WebStyleRegistry'
|
|
10
|
-
|
|
11
|
-
export * from './styles'
|
|
12
|
-
export * from './types'
|
|
13
|
-
|
|
14
|
-
const RenderSeparator = (props: { separatorStyles: ViewProps['style'] }) => {
|
|
15
|
-
return <View style={props?.separatorStyles} />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const Grid = (props: GridProps) => {
|
|
19
|
-
const allProps = {
|
|
20
|
-
...Grid.defaultProps,
|
|
21
|
-
...props,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
style,
|
|
26
|
-
renderItem: RenderItem,
|
|
27
|
-
columnItemsSpacing,
|
|
28
|
-
rowItemsSpacing,
|
|
29
|
-
ListSeparatorComponent,
|
|
30
|
-
data,
|
|
31
|
-
overscan,
|
|
32
|
-
separators,
|
|
33
|
-
masonryProps,
|
|
34
|
-
numColumns,
|
|
35
|
-
reloadTimeout,
|
|
36
|
-
showFooter,
|
|
37
|
-
} = allProps
|
|
38
|
-
|
|
39
|
-
const styles = useStylesFor(Grid.styleRegistryName, style)
|
|
40
|
-
|
|
41
|
-
const { layoutProps, onLoadMore } = useInfiniteScroll(allProps)
|
|
42
|
-
|
|
43
|
-
const { reloadingLayout, previousLength } = useMasonryReload({
|
|
44
|
-
data,
|
|
45
|
-
reloadTimeout,
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const separator = React.useMemo(() => {
|
|
49
|
-
return separators ? <ListSeparatorComponent separatorStyles={styles.separator} /> : null
|
|
50
|
-
}, [])
|
|
51
|
-
|
|
52
|
-
const renderItem = React.useCallback((_item: ItemMasonryProps<any>) => {
|
|
53
|
-
if (!RenderItem) return null
|
|
54
|
-
|
|
55
|
-
const gridLength = data?.length || 0
|
|
56
|
-
|
|
57
|
-
const isFirst = _item?.index === 0
|
|
58
|
-
const isLast = _item?.index === gridLength - 1
|
|
59
|
-
const isOnly = isFirst && isLast
|
|
60
|
-
|
|
61
|
-
const _itemProps = {
|
|
62
|
-
..._item,
|
|
63
|
-
isOnly,
|
|
64
|
-
isLast,
|
|
65
|
-
isFirst,
|
|
66
|
-
item: _item?.data,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (!_itemProps?.item) return null
|
|
70
|
-
|
|
71
|
-
return <>
|
|
72
|
-
{_item?.index <= numColumns ? null : separator}
|
|
73
|
-
<RenderItem {..._itemProps} />
|
|
74
|
-
</>
|
|
75
|
-
}, [])
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<ListLayout
|
|
79
|
-
{...allProps}
|
|
80
|
-
{...layoutProps}
|
|
81
|
-
styles={styles}
|
|
82
|
-
showFooter={reloadingLayout ? false : showFooter}
|
|
83
|
-
>
|
|
84
|
-
<ListMasonry
|
|
85
|
-
items={data}
|
|
86
|
-
render={renderItem}
|
|
87
|
-
itemKey={(item, _index) => (item?.id ?? _index)}
|
|
88
|
-
columnGutter={columnItemsSpacing}
|
|
89
|
-
rowGutter={rowItemsSpacing}
|
|
90
|
-
columnCount={numColumns}
|
|
91
|
-
maxColumnCount={numColumns}
|
|
92
|
-
onRender={onLoadMore}
|
|
93
|
-
overscanBy={overscan}
|
|
94
|
-
previousItemsLength={previousLength}
|
|
95
|
-
reloadingLayout={reloadingLayout}
|
|
96
|
-
{...masonryProps}
|
|
97
|
-
/>
|
|
98
|
-
</ListLayout>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
Grid.styleRegistryName = 'Grid'
|
|
103
|
-
Grid.elements = ['wrapper', 'innerWrapper', 'separator', 'refreshControl', 'refreshControlIndicator']
|
|
104
|
-
Grid.rootElement = 'wrapper'
|
|
105
|
-
|
|
106
|
-
Grid.withVariantTypes = <S extends AnyRecord>(styles: S) => {
|
|
107
|
-
return Grid as <T extends ListItem = ListItem>(props: StyledComponentProps<GridProps<T>, typeof styles>) => IJSX
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
Grid.defaultProps = {
|
|
111
|
-
ListEmptyComponent: EmptyPlaceholder,
|
|
112
|
-
ListSeparatorComponent: RenderSeparator,
|
|
113
|
-
refreshDebounce: 1500,
|
|
114
|
-
refreshSize: 40,
|
|
115
|
-
refreshThreshold: 0.1,
|
|
116
|
-
refreshPosition: 16,
|
|
117
|
-
refresh: true,
|
|
118
|
-
columnItemsSpacing: 8,
|
|
119
|
-
rowItemsSpacing: 8,
|
|
120
|
-
overscan: 2,
|
|
121
|
-
reloadTimeout: 350,
|
|
122
|
-
showFooter: true,
|
|
123
|
-
numColumns: 2,
|
|
124
|
-
} as Partial<GridProps>
|
|
125
|
-
|
|
126
|
-
WebStyleRegistry.registerComponent(Grid)
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StyledProp } from '@codeleap/styles'
|
|
2
|
-
import { GridComposition } from './styles'
|
|
3
|
-
import { ComponentCommonProps } from '../../types'
|
|
4
|
-
import { ListItem, ListProps } from '../List'
|
|
5
|
-
|
|
6
|
-
export type GridProps<T extends ListItem = ListItem> =
|
|
7
|
-
Omit<ListProps<T>, 'style'> &
|
|
8
|
-
ComponentCommonProps &
|
|
9
|
-
{
|
|
10
|
-
style?: StyledProp<GridComposition>
|
|
11
|
-
columnItemsSpacing?: number
|
|
12
|
-
numColumns?: number
|
|
13
|
-
}
|