react-native-molecules 0.5.0-beta.23 → 0.5.0-beta.25
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/components/Accordion/Accordion.tsx +1 -1
- package/components/Accordion/AccordionItem.tsx +1 -1
- package/components/Checkbox/Checkbox.tsx +2 -1
- package/components/DateField/useDateFieldState.ts +2 -2
- package/components/DatePicker/DatePickerProvider.tsx +1 -1
- package/components/DatePickerInline/DatePickerInline.tsx +1 -1
- package/components/DatePickerInline/DatePickerInlineBase.tsx +1 -1
- package/components/DatePickerInline/Day.tsx +1 -1
- package/components/DatePickerInline/Swiper.tsx +1 -1
- package/components/DatePickerInline/SwiperUtils.ts +1 -1
- package/components/DatePickerInline/dateUtils.tsx +1 -1
- package/components/DatePickerInline/store.tsx +2 -1
- package/components/Divider/index.tsx +2 -3
- package/components/ElementGroup/ElementGroup.tsx +1 -1
- package/components/FilePicker/FilePicker.tsx +1 -1
- package/components/Icon/iconFactory.tsx +2 -1
- package/components/IconButton/IconButton.tsx +39 -13
- package/components/IconButton/index.tsx +1 -0
- package/components/IconButton/types.ts +2 -0
- package/components/List/List.tsx +2 -1
- package/components/List/context.tsx +2 -1
- package/components/Portal/Portal.tsx +1 -2
- package/components/RadioButton/RadioButtonGroup.tsx +1 -2
- package/components/Rating/Rating.tsx +1 -1
- package/components/Select/Select.tsx +103 -34
- package/components/Select/context.tsx +3 -1
- package/components/Select/index.ts +20 -2
- package/components/Select/types.ts +2 -0
- package/components/Select/utils.ts +11 -4
- package/components/Switch/Switch.ios.tsx +1 -1
- package/components/Switch/Switch.tsx +2 -1
- package/components/Tabs/Tabs.tsx +2 -2
- package/components/TextInput/TextInput.tsx +4 -3
- package/components/TimePicker/AnalogClock.tsx +1 -1
- package/components/TimePicker/TimeInputs.tsx +1 -1
- package/components/TimePicker/TimePicker.tsx +1 -1
- package/components/TimePicker/TimePickerModal.tsx +1 -1
- package/components/Tooltip/Tooltip.tsx +1 -1
- package/components/TouchableRipple/TouchableRipple.tsx +1 -1
- package/hocs/index.tsx +1 -1
- package/hocs/withKeyboardAccessibility.tsx +2 -3
- package/hooks/index.tsx +2 -6
- package/hooks/useContrastColor.ts +1 -2
- package/hooks/useFilePicker.tsx +1 -1
- package/hooks/useHandleNumberFormat.tsx +2 -2
- package/hooks/useMediaQuery.tsx +1 -2
- package/package.json +95 -118
- package/shortcuts-manager/ShortcutsManager/ShortcutsManager.tsx +1 -1
- package/shortcuts-manager/ShortcutsManager/utils.tsx +1 -1
- package/shortcuts-manager/useSetScopes/useSetScopes.tsx +1 -1
- package/shortcuts-manager/useShortcut/useShortcut.tsx +1 -1
- package/utils/extractTextStyles.ts +1 -2
- package/utils/formatNumberWithMask/formatNumberWithMask.ts +2 -1
- package/utils/index.ts +0 -3
- package/utils/normalizeToNumberString/normalizeToNumberString.ts +1 -1
- package/context-bridge/index.tsx +0 -87
- package/fast-context/index.tsx +0 -190
- package/hocs/typedMemo.tsx +0 -5
- package/hooks/useControlledValue.tsx +0 -84
- package/hooks/useLatest.tsx +0 -9
- package/hooks/useMergedRefs.ts +0 -14
- package/hooks/usePrevious.ts +0 -13
- package/hooks/useToggle.tsx +0 -24
- package/hooks/useWhatHasUpdated.tsx +0 -48
- package/utils/color.ts +0 -22
- package/utils/compare/index.ts +0 -54
- package/utils/lodash.ts +0 -121
- package/utils/repository.ts +0 -53
package/utils/repository.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
interface RepositoryConstructor<T> {
|
|
2
|
-
onRegister?: (arg: T, name: string, registery: Record<string, T>) => T;
|
|
3
|
-
name?: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
let id = Date.now();
|
|
7
|
-
|
|
8
|
-
export class Repository<T> {
|
|
9
|
-
private registry: Record<string, T> = {};
|
|
10
|
-
readonly #name!: string;
|
|
11
|
-
|
|
12
|
-
readonly #onRegister!: (arg: T, name: string, registery: Record<string, T>) => T;
|
|
13
|
-
|
|
14
|
-
get name() {
|
|
15
|
-
return this.#name;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static get uniqueId() {
|
|
19
|
-
return (id++).toString(36).substring(0, 15);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
constructor({
|
|
23
|
-
onRegister = arg => arg,
|
|
24
|
-
name = Repository.uniqueId,
|
|
25
|
-
}: RepositoryConstructor<T> = {}) {
|
|
26
|
-
this.#onRegister = onRegister;
|
|
27
|
-
this.#name = name;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
has = (itemName: string): boolean => {
|
|
31
|
-
return !!this.registry[itemName];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Register a item with the src.
|
|
36
|
-
*/
|
|
37
|
-
register = <X extends T = T, ItemName extends string = ''>(itemName: ItemName, item: X) => {
|
|
38
|
-
let updatedItem = this.#onRegister?.(item, itemName, { ...this.registry });
|
|
39
|
-
if (!updatedItem) updatedItem = item;
|
|
40
|
-
|
|
41
|
-
this.registry = {
|
|
42
|
-
...this.registry,
|
|
43
|
-
[itemName]: updatedItem,
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get all registered module from the registry.
|
|
49
|
-
*/
|
|
50
|
-
getAll = () => {
|
|
51
|
-
return this.registry;
|
|
52
|
-
};
|
|
53
|
-
}
|