@codeleap/mobile 4.2.9 → 4.2.10
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/Registry.js +28 -53
- package/dist/Registry.js.map +1 -1
- package/dist/components/ActionIcon/index.js +27 -67
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActionIcon/styles.js +1 -2
- package/dist/components/ActionIcon/types.js +1 -2
- package/dist/components/ActivityIndicator/index.js +22 -62
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/ActivityIndicator/styles.js +1 -2
- package/dist/components/ActivityIndicator/types.js +1 -2
- package/dist/components/Autocomplete/index.js +73 -121
- package/dist/components/Autocomplete/index.js.map +1 -1
- package/dist/components/Autocomplete/styles.js +1 -2
- package/dist/components/Autocomplete/types.js +1 -2
- package/dist/components/Avatar/index.js +49 -90
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Avatar/styles.js +1 -2
- package/dist/components/Avatar/types.js +1 -2
- package/dist/components/AvatarGroup/index.js +30 -75
- package/dist/components/AvatarGroup/index.js.map +1 -1
- package/dist/components/AvatarGroup/styles.js +1 -2
- package/dist/components/AvatarGroup/types.js +1 -2
- package/dist/components/Backdrop/index.js +26 -66
- package/dist/components/Backdrop/index.js.map +1 -1
- package/dist/components/Backdrop/styles.js +1 -2
- package/dist/components/Backdrop/types.js +1 -2
- package/dist/components/Badge/index.js +44 -85
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/styles.js +1 -2
- package/dist/components/Badge/types.js +1 -2
- package/dist/components/Button/index.js +49 -98
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.js +1 -2
- package/dist/components/Button/types.js +1 -2
- package/dist/components/Calendar/index.js +27 -68
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/types.d.ts +1 -2
- package/dist/components/Calendar/types.js +1 -2
- package/dist/components/Checkbox/index.js +52 -85
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.js +1 -2
- package/dist/components/Checkbox/types.js +1 -2
- package/dist/components/DatePickerModal/index.js +61 -113
- package/dist/components/DatePickerModal/index.js.map +1 -1
- package/dist/components/DatePickerModal/styles.js +1 -2
- package/dist/components/DatePickerModal/types.js +1 -2
- package/dist/components/EmptyPlaceholder/index.js +40 -69
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/styles.js +1 -2
- package/dist/components/EmptyPlaceholder/types.js +1 -2
- package/dist/components/FileInput/index.js +112 -178
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.js +1 -2
- package/dist/components/Grid/index.js +47 -97
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Grid/styles.js +1 -2
- package/dist/components/Grid/types.js +1 -2
- package/dist/components/Icon/index.js +34 -75
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/styles.js +1 -2
- package/dist/components/Icon/types.js +1 -2
- package/dist/components/Image/index.js +53 -96
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Image/styles.js +1 -2
- package/dist/components/Image/types.js +1 -2
- package/dist/components/ImageView/Spotlight.js +75 -131
- package/dist/components/ImageView/Spotlight.js.map +1 -1
- package/dist/components/ImageView/component.js +8 -15
- package/dist/components/ImageView/component.js.map +1 -1
- package/dist/components/ImageView/index.js +2 -18
- package/dist/components/ImageView/index.js.map +1 -1
- package/dist/components/InputBase/index.js +35 -75
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/styles.d.ts +3 -3
- package/dist/components/InputBase/styles.js +49 -50
- package/dist/components/InputBase/styles.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +1 -0
- package/dist/components/InputBase/types.js +1 -2
- package/dist/components/InputBase/utils.js +4 -19
- package/dist/components/InputBase/utils.js.map +1 -1
- package/dist/components/List/index.js +46 -86
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/styles.js +1 -2
- package/dist/components/List/types.js +1 -2
- package/dist/components/LoadingOverlay/index.js +28 -66
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/LoadingOverlay/styles.js +1 -2
- package/dist/components/LoadingOverlay/types.js +1 -2
- package/dist/components/Modal/index.js +77 -113
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.js +1 -2
- package/dist/components/Modal/types.js +1 -2
- package/dist/components/Navigation/Navigation.js +23 -66
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/constants.js +7 -10
- package/dist/components/Navigation/constants.js.map +1 -1
- package/dist/components/Navigation/index.js +3 -19
- package/dist/components/Navigation/index.js.map +1 -1
- package/dist/components/Navigation/types.js +1 -2
- package/dist/components/Navigation/utils.js +24 -59
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/NumberIncrement/index.js +132 -165
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/styles.js +1 -2
- package/dist/components/NumberIncrement/types.d.ts +2 -2
- package/dist/components/NumberIncrement/types.js +1 -2
- package/dist/components/NumberIncrement/utils.js +8 -12
- package/dist/components/NumberIncrement/utils.js.map +1 -1
- package/dist/components/Pager/PagerDots.js +17 -54
- package/dist/components/Pager/PagerDots.js.map +1 -1
- package/dist/components/Pager/index.js +43 -97
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.js +1 -2
- package/dist/components/Pager/types.js +1 -2
- package/dist/components/PaginationIndicator/index.js +23 -38
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/styles.js +1 -2
- package/dist/components/PaginationIndicator/types.js +1 -2
- package/dist/components/PlacesAutocomplete/index.js +55 -106
- package/dist/components/PlacesAutocomplete/index.js.map +1 -1
- package/dist/components/PlacesAutocomplete/styles.js +1 -2
- package/dist/components/PlacesAutocomplete/types.js +1 -2
- package/dist/components/RadioInput/index.js +46 -84
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.js +1 -2
- package/dist/components/RadioInput/types.js +1 -2
- package/dist/components/RefreshControl/index.js +22 -63
- package/dist/components/RefreshControl/index.js.map +1 -1
- package/dist/components/RefreshControl/styles.js +1 -2
- package/dist/components/RefreshControl/types.js +1 -2
- package/dist/components/Scroll/index.js +33 -81
- package/dist/components/Scroll/index.js.map +1 -1
- package/dist/components/Scroll/styles.js +1 -2
- package/dist/components/Scroll/types.js +1 -2
- package/dist/components/SearchInput/index.js +22 -69
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/context.d.ts +6 -0
- package/dist/components/SectionFilters/context.js +4 -8
- package/dist/components/SectionFilters/context.js.map +1 -1
- package/dist/components/SectionFilters/index.js +33 -76
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/types.js +1 -2
- package/dist/components/SectionFilters/useSectionFilters.d.ts +3 -0
- package/dist/components/SectionFilters/useSectionFilters.js +71 -73
- package/dist/components/SectionFilters/useSectionFilters.js.map +1 -1
- package/dist/components/Sections/index.d.ts +8 -8
- package/dist/components/Sections/index.js +61 -106
- package/dist/components/Sections/index.js.map +1 -1
- package/dist/components/Sections/styles.d.ts +1 -1
- package/dist/components/Sections/styles.js +1 -2
- package/dist/components/Sections/types.js +1 -2
- package/dist/components/SegmentedControl/Option.js +13 -31
- package/dist/components/SegmentedControl/Option.js.map +1 -1
- package/dist/components/SegmentedControl/index.js +71 -114
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.js +1 -2
- package/dist/components/SegmentedControl/types.js +1 -2
- package/dist/components/Select/index.js +94 -157
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +1 -2
- package/dist/components/Select/types.js +1 -2
- package/dist/components/Slider/index.js +89 -129
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +0 -6
- package/dist/components/Slider/styles.js +1 -2
- package/dist/components/Slider/types.js +1 -2
- package/dist/components/SortablePhotos/index.js +58 -91
- package/dist/components/SortablePhotos/index.js.map +1 -1
- package/dist/components/SortablePhotos/styles.js +1 -2
- package/dist/components/SortablePhotos/types.js +1 -2
- package/dist/components/SortablePhotos/useSortablePhotos.js +93 -157
- package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -1
- package/dist/components/Switch/index.js +51 -84
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/styles.js +1 -2
- package/dist/components/Switch/types.js +1 -2
- package/dist/components/Text/index.js +40 -88
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.js +1 -2
- package/dist/components/Text/types.js +1 -2
- package/dist/components/TextInput/index.js +83 -131
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/styles.js +1 -2
- package/dist/components/TextInput/types.js +1 -2
- package/dist/components/Touchable/index.js +69 -122
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/styles.js +1 -2
- package/dist/components/Touchable/types.js +1 -2
- package/dist/components/View/index.js +19 -51
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/styles.js +1 -2
- package/dist/components/View/types.js +1 -2
- package/dist/components/components.js +43 -59
- package/dist/components/components.js.map +1 -1
- package/dist/hooks/index.js +7 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +8 -43
- package/dist/index.js.map +1 -1
- package/dist/modules/PressableRipple/index.js +2 -8
- package/dist/modules/PressableRipple/index.js.map +1 -1
- package/dist/modules/PressableRipple/ripple.js +125 -163
- package/dist/modules/PressableRipple/ripple.js.map +1 -1
- package/dist/modules/PressableRipple/styles.js +9 -20
- package/dist/modules/PressableRipple/styles.js.map +1 -1
- package/dist/modules/PressableRipple/type.js +1 -2
- package/dist/modules/reactNavigation.js +10 -21
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.js +3 -20
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/modules/types/textInputMask.js +1 -2
- package/dist/types/index.js +1 -17
- package/dist/types/index.js.map +1 -1
- package/dist/types/utility.js +1 -2
- package/dist/utils/KeyboardAware/context.js +5 -14
- package/dist/utils/KeyboardAware/context.js.map +1 -1
- package/dist/utils/KeyboardAware/index.js +3 -19
- package/dist/utils/KeyboardAware/index.js.map +1 -1
- package/dist/utils/KeyboardAware/keyboardHooks.js +36 -41
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +1 -1
- package/dist/utils/KeyboardAware/types.js +1 -2
- package/dist/utils/KeyboardAware/types.js.map +1 -1
- package/dist/utils/ModalManager/components.js +24 -54
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.js +94 -89
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.js +7 -10
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/index.js +115 -245
- package/dist/utils/NotificationManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/types.js +1 -2
- package/dist/utils/OSAlert.js +32 -48
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +138 -255
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/PermissionManager/index.js +2 -8
- package/dist/utils/PermissionManager/index.js.map +1 -1
- package/dist/utils/PermissionManager/types.js +1 -2
- package/dist/utils/StorageManager.js +39 -46
- package/dist/utils/StorageManager.js.map +1 -1
- package/dist/utils/Subscription.js +30 -54
- package/dist/utils/Subscription.js.map +1 -1
- package/dist/utils/deprecated/notifications.js +143 -250
- package/dist/utils/deprecated/notifications.js.map +1 -1
- package/dist/utils/hooks.js +101 -120
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.js +14 -43
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/input.js +15 -19
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/locale.js +5 -9
- package/dist/utils/locale.js.map +1 -1
- package/dist/utils/misc.js +25 -40
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/theme.js +24 -33
- package/dist/utils/theme.js.map +1 -1
- package/dist/utils/useQueryListRefresh.js +16 -26
- package/dist/utils/useQueryListRefresh.js.map +1 -1
- package/package.json +6 -6
- package/package.json.bak +2 -2
- package/src/components/Calendar/types.ts +3 -3
- package/src/components/InputBase/styles.ts +35 -23
- package/src/components/InputBase/types.ts +1 -0
- package/src/components/NumberIncrement/index.tsx +8 -2
- package/src/components/NumberIncrement/types.ts +3 -3
- package/src/components/RadioInput/index.tsx +4 -0
- package/src/components/SectionFilters/useSectionFilters.tsx +31 -1
- package/src/components/Sections/index.tsx +3 -2
- package/src/components/Sections/styles.ts +2 -2
- package/src/components/Slider/index.tsx +9 -1
- package/src/components/Slider/styles.ts +0 -6
- package/src/components/TextInput/index.tsx +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SearchInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SearchInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGvC,OAAO,EAAkB,SAAS,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAc7C,MAAM,CAAC,MAAM,WAAW,GAAgD,CAAC,KAAK,EAAE,EAAE;IAChF,MAAM,EACJ,SAAS,EACT,OAAO,EACP,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,QAAQ,EACR,WAAW,EACX,KAAK,EACL,aAAa,EACb,GAAG,MAAM,EACV,GAAG;QACF,GAAG,WAAW,CAAC,YAAY;QAC3B,GAAG,KAAK;KACT,CAAA;IAED,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,a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CAAC,CAAC;YACR,IAAI,EAAE,UAAU;SACjB,CAAC,CACF,IAAI,MAAM,CAAC,EACX,CACH,CAAA;AACH,CAAC,CAAA;AAED,WAAW,CAAC,YAAY,GAAG;IACzB,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,GAAc;IACzB,UAAU,EAAE,QAAmB;CACH,CAAA"}
|
|
@@ -23,6 +23,9 @@ export declare const SectionsFilterContext: import("react").Context<{
|
|
|
23
23
|
limitReached: () => boolean;
|
|
24
24
|
disableItemsOnLimitReached: boolean;
|
|
25
25
|
clearSelectedItemsWithSection: (sectionIndex: number) => void;
|
|
26
|
+
changed: () => boolean;
|
|
27
|
+
areItemsEqual: any;
|
|
28
|
+
getAllItems: () => TSectionFilterItem[];
|
|
26
29
|
}>;
|
|
27
30
|
export declare function useSectionFiltersContext<T = TSectionFilterItem>(): {
|
|
28
31
|
isSelected: (item: T) => boolean;
|
|
@@ -43,4 +46,7 @@ export declare function useSectionFiltersContext<T = TSectionFilterItem>(): {
|
|
|
43
46
|
limitReached: () => boolean;
|
|
44
47
|
disableItemsOnLimitReached: boolean;
|
|
45
48
|
clearSelectedItemsWithSection: (sectionIndex: number) => void;
|
|
49
|
+
changed: () => boolean;
|
|
50
|
+
areItemsEqual: any;
|
|
51
|
+
getAllItems: () => T[];
|
|
46
52
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.SectionsFilterContext = (0, react_1.createContext)({});
|
|
6
|
-
function useSectionFiltersContext() {
|
|
7
|
-
return (0, react_1.useContext)(exports.SectionsFilterContext);
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const SectionsFilterContext = createContext({});
|
|
3
|
+
export function useSectionFiltersContext() {
|
|
4
|
+
return useContext(SectionsFilterContext);
|
|
8
5
|
}
|
|
9
|
-
exports.useSectionFiltersContext = useSectionFiltersContext;
|
|
10
6
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/SectionFilters/context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/SectionFilters/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAUjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,EAA4B,CAAC,CAAA;AAEhF,MAAM,UAAU,wBAAwB;IACtC,OAAO,UAAU,CAAC,qBAAqB,CAA8B,CAAA;AACvE,CAAC"}
|
|
@@ -1,85 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.SectionFilters = void 0;
|
|
40
|
-
var common_1 = require("@codeleap/common");
|
|
41
|
-
var Button_1 = require("../Button");
|
|
42
|
-
var Sections_1 = require("../Sections");
|
|
43
|
-
var Text_1 = require("../Text");
|
|
44
|
-
var context_1 = require("./context");
|
|
45
|
-
var useSectionFilters_1 = require("./useSectionFilters");
|
|
46
|
-
__exportStar(require("./types"), exports);
|
|
47
|
-
__exportStar(require("./context"), exports);
|
|
48
|
-
__exportStar(require("./useSectionFilters"), exports);
|
|
49
|
-
var SectionComponent = (0, common_1.memoBy)(function (props) {
|
|
50
|
-
var _a;
|
|
51
|
-
var Component = props.renderWith, index = props.index;
|
|
52
|
-
var handle = (0, context_1.useSectionFiltersContext)();
|
|
1
|
+
import { memoBy, TypeGuards } from '@codeleap/common';
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
import { Sections } from '../Sections';
|
|
4
|
+
import { Text } from '../Text';
|
|
5
|
+
import { SectionsFilterContext, useSectionFiltersContext } from './context';
|
|
6
|
+
import { useSectionFilters } from './useSectionFilters';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './context';
|
|
9
|
+
export * from './useSectionFilters';
|
|
10
|
+
const SectionComponent = memoBy((props) => {
|
|
11
|
+
const { renderWith: Component, index } = props;
|
|
12
|
+
const handle = useSectionFiltersContext();
|
|
53
13
|
if (!Component)
|
|
54
14
|
return null;
|
|
55
|
-
return (<Component {...props} selectedItems={
|
|
15
|
+
return (<Component {...props} selectedItems={handle.selectedItems[index] ?? []} clearSelectedItems={() => handle.clearSelectedItemsWithSection(index)}/>);
|
|
56
16
|
}, ['renderWith']);
|
|
57
|
-
function SectionFilters(props) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
17
|
+
export function SectionFilters(props) {
|
|
18
|
+
const { sections, renderItem: RenderItem, renderSectionHeader, renderSectionFooter, children, ...rest } = {
|
|
19
|
+
...SectionFilters.defaultProps,
|
|
20
|
+
...props,
|
|
21
|
+
};
|
|
22
|
+
const handle = props.handle ?? useSectionFilters(props);
|
|
23
|
+
const renderItem = (section) => {
|
|
24
|
+
const hasSection = !TypeGuards.isNil(section?.index) && !TypeGuards.isNil(section);
|
|
25
|
+
const sectionLimitReached = hasSection && handle.sectionLimitReached(section?.index);
|
|
26
|
+
const limitReached = handle.limitReached();
|
|
27
|
+
const disableOnReachLimit = handle.disableItemsOnLimitReached;
|
|
28
|
+
const disableNonSelectedItems = (limitReached || sectionLimitReached) && disableOnReachLimit;
|
|
29
|
+
const isSelected = handle.isSelected(section?.item);
|
|
30
|
+
const isDisabled = disableNonSelectedItems && !isSelected;
|
|
31
|
+
return (<RenderItem {...section} onPress={() => handle.toggleItem(section?.item)} selected={isSelected} disabled={isDisabled} text={section?.item?.label}/>);
|
|
71
32
|
};
|
|
72
|
-
return (<
|
|
73
|
-
<
|
|
33
|
+
return (<SectionsFilterContext.Provider value={handle}>
|
|
34
|
+
<Sections {...rest} sections={sections} renderItem={renderItem} renderSectionHeader={(props) => <SectionComponent {...props} renderWith={renderSectionHeader}/>} renderSectionFooter={(props) => <SectionComponent {...props} renderWith={renderSectionFooter}/>}/>
|
|
74
35
|
{children}
|
|
75
|
-
</
|
|
36
|
+
</SectionsFilterContext.Provider>);
|
|
76
37
|
}
|
|
77
|
-
exports.SectionFilters = SectionFilters;
|
|
78
38
|
SectionFilters.defaultProps = {
|
|
79
|
-
renderItem:
|
|
80
|
-
renderSectionHeader:
|
|
81
|
-
var title = _a.title;
|
|
82
|
-
return <Text_1.Text text={title}/>;
|
|
83
|
-
}
|
|
39
|
+
renderItem: Button,
|
|
40
|
+
renderSectionHeader: ({ title }) => <Text text={title}/>
|
|
84
41
|
};
|
|
85
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SectionFilters/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SectionFilters/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAyD,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAE3E,OAAO,EAAsB,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE3E,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AAEnC,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,KAA0I,EAAE,EAAE;IAC7K,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IAE9C,MAAM,MAAM,GAAG,wBAAwB,EAAE,CAAA;IAEzC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAA;IAE3B,OAAO,CACL,CAAC,SAAS,CACR,IAAI,KAAK,CAAC,CACV,aAAa,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,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UAAU,CAAC,CACrB,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EAC3B,CACH,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAC5C;MAAA,CAAC,QAAQ,CACP,IAAI,IAAI,CAAC,CACT,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,mBAAmB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,mBAAmB,CAAC,EAAG,CAAC,CACjG,mBAAmB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,mBAAmB,CAAC,EAAG,CAAC,EAEnG;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAClC,CAAA;AACH,CAAC;AAED,cAAc,CAAC,YAAY,GAAG;IAC5B,UAAU,EAAE,MAAiB;IAC7B,mBAAmB,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAG;CAC1B,CAAA"}
|
|
@@ -31,5 +31,8 @@ export declare function useSectionFilters<T = TSectionFilterItem>(props: UseSect
|
|
|
31
31
|
limitReached: () => boolean;
|
|
32
32
|
disableItemsOnLimitReached: boolean;
|
|
33
33
|
clearSelectedItemsWithSection: (sectionIndex: number) => void;
|
|
34
|
+
changed: () => boolean;
|
|
35
|
+
areItemsEqual: any;
|
|
36
|
+
getAllItems: () => T[];
|
|
34
37
|
};
|
|
35
38
|
export {};
|
|
@@ -1,50 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useSectionFilters = void 0;
|
|
27
|
-
var common_1 = require("@codeleap/common");
|
|
28
|
-
var react_1 = __importDefault(require("react"));
|
|
29
|
-
function useSectionFilters(props) {
|
|
30
|
-
var sections = props.sections, _a = props.areItemsEqual, areItemsEqual = _a === void 0 ? common_1.deepEqual : _a, _b = props.selectionLimit, selectionLimit = _b === void 0 ? 1 : _b, _c = props.sectionSelectionLimit, sectionSelectionLimit = _c === void 0 ? null : _c, _d = props.disableItemsOnLimitReached, disableItemsOnLimitReached = _d === void 0 ? selectionLimit > 1 && !sectionSelectionLimit : _d, _e = props.initialSelectedItems, initialSelectedItems = _e === void 0 ? [] : _e;
|
|
31
|
-
var _f = react_1.default.useState(function () {
|
|
32
|
-
if (common_1.TypeGuards.isArray(initialSelectedItems)) {
|
|
1
|
+
import { deepEqual, TypeGuards } from '@codeleap/common';
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
export function useSectionFilters(props) {
|
|
4
|
+
const { sections, areItemsEqual = deepEqual, selectionLimit = 1, sectionSelectionLimit = null, disableItemsOnLimitReached = selectionLimit > 1 && !sectionSelectionLimit, initialSelectedItems = [], } = props;
|
|
5
|
+
const [selectedItems, setSelectedItems] = React.useState(() => {
|
|
6
|
+
if (TypeGuards.isArray(initialSelectedItems)) {
|
|
33
7
|
return {
|
|
34
8
|
0: initialSelectedItems,
|
|
35
9
|
};
|
|
36
10
|
}
|
|
37
|
-
return initialSelectedItems
|
|
38
|
-
})
|
|
39
|
-
|
|
11
|
+
return initialSelectedItems ?? {};
|
|
12
|
+
});
|
|
13
|
+
const changed = useCallback(() => {
|
|
14
|
+
return Object.entries(selectedItems).some(([sectionIndex, items]) => {
|
|
15
|
+
const initialItems = initialSelectedItems[sectionIndex] ?? [];
|
|
16
|
+
if (!initialItems) {
|
|
17
|
+
return items.length > 0;
|
|
18
|
+
}
|
|
19
|
+
if (items.length !== initialItems.length) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return items.some((item) => !initialItems.some((i) => areItemsEqual(i, item)));
|
|
23
|
+
});
|
|
24
|
+
}, [selectedItems, initialSelectedItems]);
|
|
25
|
+
const getAllItems = () => {
|
|
26
|
+
return sections?.flatMap((section) => section.data) ?? [];
|
|
27
|
+
};
|
|
28
|
+
const findItemSection = (item) => {
|
|
40
29
|
if (!sections) {
|
|
41
30
|
return {
|
|
42
31
|
sectionIndex: 0,
|
|
43
32
|
section: null,
|
|
44
33
|
};
|
|
45
34
|
}
|
|
46
|
-
|
|
47
|
-
return section.data.some(
|
|
35
|
+
const sectionIndex = sections?.findIndex((section) => {
|
|
36
|
+
return section.data.some((i) => areItemsEqual(item, i));
|
|
48
37
|
});
|
|
49
38
|
if (sectionIndex === -1) {
|
|
50
39
|
return {
|
|
@@ -52,41 +41,44 @@ function useSectionFilters(props) {
|
|
|
52
41
|
section: null,
|
|
53
42
|
};
|
|
54
43
|
}
|
|
55
|
-
|
|
44
|
+
const section = sections[sectionIndex];
|
|
56
45
|
return {
|
|
57
|
-
sectionIndex
|
|
58
|
-
section
|
|
46
|
+
sectionIndex,
|
|
47
|
+
section,
|
|
59
48
|
};
|
|
60
49
|
};
|
|
61
|
-
|
|
62
|
-
var _a, _b;
|
|
50
|
+
const isSelected = (item) => {
|
|
63
51
|
if (sections) {
|
|
64
|
-
|
|
65
|
-
return
|
|
52
|
+
const { sectionIndex } = findItemSection(item);
|
|
53
|
+
return selectedItems[sectionIndex]?.some((i) => areItemsEqual(i, item));
|
|
66
54
|
}
|
|
67
|
-
return
|
|
55
|
+
return selectedItems[0]?.some((i) => areItemsEqual(i, item));
|
|
68
56
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var sectionIndex = -1;
|
|
73
|
-
var limit = selectionLimit;
|
|
57
|
+
const toggleItem = (item) => {
|
|
58
|
+
let sectionIndex = -1;
|
|
59
|
+
let limit = selectionLimit;
|
|
74
60
|
if (sections) {
|
|
75
|
-
|
|
61
|
+
const { sectionIndex: si, section } = findItemSection(item);
|
|
76
62
|
if (si === null) {
|
|
77
63
|
return;
|
|
78
64
|
}
|
|
79
65
|
sectionIndex = si;
|
|
80
|
-
limit =
|
|
66
|
+
limit = section.selectionLimit ?? selectionLimit;
|
|
81
67
|
}
|
|
82
68
|
else {
|
|
83
69
|
sectionIndex = 0;
|
|
84
70
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
if (selectionLimit === 1) {
|
|
72
|
+
setSelectedItems({
|
|
73
|
+
[sectionIndex]: [item],
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const currentItems = selectedItems[sectionIndex] ?? [];
|
|
78
|
+
const isItemSelected = currentItems.some((i) => areItemsEqual(i, item));
|
|
79
|
+
const newItems = [...currentItems];
|
|
88
80
|
if (isItemSelected) {
|
|
89
|
-
|
|
81
|
+
const index = newItems.findIndex((i) => areItemsEqual(i, item));
|
|
90
82
|
newItems.splice(index, 1);
|
|
91
83
|
}
|
|
92
84
|
else {
|
|
@@ -95,39 +87,45 @@ function useSectionFilters(props) {
|
|
|
95
87
|
}
|
|
96
88
|
newItems.push(item);
|
|
97
89
|
}
|
|
98
|
-
setSelectedItems(
|
|
90
|
+
setSelectedItems({
|
|
91
|
+
...selectedItems,
|
|
92
|
+
[sectionIndex]: newItems,
|
|
93
|
+
});
|
|
99
94
|
};
|
|
100
95
|
function sectionLimitReached(sectionIndex) {
|
|
101
|
-
|
|
102
|
-
var section = sections[sectionIndex];
|
|
96
|
+
const section = sections[sectionIndex];
|
|
103
97
|
if (!section) {
|
|
104
98
|
return false;
|
|
105
99
|
}
|
|
106
|
-
|
|
100
|
+
const limit = section.selectionLimit ?? sectionSelectionLimit ?? selectionLimit;
|
|
107
101
|
if (!limit) {
|
|
108
102
|
return false;
|
|
109
103
|
}
|
|
110
|
-
|
|
104
|
+
const nItems = selectedItems[sectionIndex]?.length;
|
|
111
105
|
return nItems >= limit;
|
|
112
106
|
}
|
|
113
107
|
function limitReached() {
|
|
114
|
-
|
|
108
|
+
const nItems = Object.values(selectedItems).flatMap((i) => i).length;
|
|
115
109
|
return nItems >= selectionLimit;
|
|
116
110
|
}
|
|
117
111
|
function clearSelectedItemsWithSection(sectionIndex) {
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
setSelectedItems({
|
|
113
|
+
...selectedItems,
|
|
114
|
+
[sectionIndex]: [],
|
|
115
|
+
});
|
|
120
116
|
}
|
|
121
117
|
return {
|
|
122
|
-
isSelected
|
|
123
|
-
toggleItem
|
|
124
|
-
findItemSection
|
|
125
|
-
selectedItems
|
|
126
|
-
sectionLimitReached
|
|
127
|
-
limitReached
|
|
128
|
-
disableItemsOnLimitReached
|
|
129
|
-
clearSelectedItemsWithSection
|
|
118
|
+
isSelected,
|
|
119
|
+
toggleItem,
|
|
120
|
+
findItemSection,
|
|
121
|
+
selectedItems,
|
|
122
|
+
sectionLimitReached,
|
|
123
|
+
limitReached,
|
|
124
|
+
disableItemsOnLimitReached,
|
|
125
|
+
clearSelectedItemsWithSection,
|
|
126
|
+
changed,
|
|
127
|
+
areItemsEqual,
|
|
128
|
+
getAllItems,
|
|
130
129
|
};
|
|
131
130
|
}
|
|
132
|
-
exports.useSectionFilters = useSectionFilters;
|
|
133
131
|
//# sourceMappingURL=useSectionFilters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSectionFilters.js","sourceRoot":"","sources":["../../../src/components/SectionFilters/useSectionFilters.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSectionFilters.js","sourceRoot":"","sources":["../../../src/components/SectionFilters/useSectionFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAW,MAAM,OAAO,CAAA;AAyBnD,MAAM,UAAU,iBAAiB,CAAyB,KAA2B;IACnF,MAAM,EACJ,QAAQ,EACR,aAAa,GAAG,SAAS,EACzB,cAAc,GAAG,CAAC,EAClB,qBAAqB,GAAG,IAAI,EAC5B,0BAA0B,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC,qBAAqB,EACzE,oBAAoB,GAAG,EAAE,GAC1B,GAAG,KAAK,CAAA;IAET,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA6B,GAAG,EAAE;QACxF,IAAI,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE;YAC5C,OAAO;gBACL,CAAC,EAAE,oBAAoB;aACxB,CAAA;SACF;QAED,OAAO,oBAAoB,IAAI,EAAE,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,EAAE;YAClE,M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,CAAC,EAAE,EAAE;SACnB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,UAAU;QACV,UAAU;QACV,eAAe;QACf,aAAa;QACb,mBAAmB;QACnB,YAAY;QACZ,0BAA0B;QAC1B,6BAA6B;QAC7B,OAAO;QACP,aAAa;QACb,WAAW;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { SectionProps } from './types';
|
|
|
3
3
|
import { AnyRecord, IJSX, StyledComponentProps } from '@codeleap/styles';
|
|
4
4
|
export * from './styles';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
styleRegistryName: string;
|
|
9
|
-
elements: string[];
|
|
10
|
-
rootElement: string;
|
|
11
|
-
withVariantTypes<S extends AnyRecord>(styles: S)
|
|
12
|
-
defaultProps: Partial<SectionProps>;
|
|
13
|
-
}
|
|
6
|
+
export declare function Sections<T>(sectionsProps: SectionProps<T>): JSX.Element;
|
|
7
|
+
export declare namespace Sections {
|
|
8
|
+
var styleRegistryName: string;
|
|
9
|
+
var elements: string[];
|
|
10
|
+
var rootElement: string;
|
|
11
|
+
var withVariantTypes: <S extends AnyRecord>(styles: S) => <T>(props: StyledComponentProps<SectionProps<T>, S>) => IJSX;
|
|
12
|
+
var defaultProps: Partial<SectionProps>;
|
|
13
|
+
}
|