@korsolutions/ui 0.0.93 → 0.0.95
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/module/components/combobox/components/combobox-content.js +2 -0
- package/dist/module/components/combobox/components/combobox-content.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-list.js +8 -15
- package/dist/module/components/combobox/components/combobox-list.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-option.js +7 -2
- package/dist/module/components/combobox/components/combobox-option.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-overlay.js +9 -3
- package/dist/module/components/combobox/components/combobox-overlay.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-root.js +18 -71
- package/dist/module/components/combobox/components/combobox-root.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-trigger.js +11 -33
- package/dist/module/components/combobox/components/combobox-trigger.js.map +1 -1
- package/dist/module/components/combobox/context.js.map +1 -1
- package/dist/module/components/focus/focus-prevent.js +10 -0
- package/dist/module/components/focus/focus-prevent.js.map +1 -0
- package/dist/module/components/select/components/select-content.js +2 -3
- package/dist/module/components/select/components/select-content.js.map +1 -1
- package/dist/module/components/select/components/select-option.js +2 -2
- package/dist/module/components/select/components/select-option.js.map +1 -1
- package/dist/module/components/select/components/select-overlay.js +2 -3
- package/dist/module/components/select/components/select-overlay.js.map +1 -1
- package/dist/module/components/select/components/select-root.js +3 -3
- package/dist/module/components/select/components/select-root.js.map +1 -1
- package/dist/module/components/select/components/select-trigger.js +3 -4
- package/dist/module/components/select/components/select-trigger.js.map +1 -1
- package/dist/module/components/select/variants/default.js +0 -5
- package/dist/module/components/select/variants/default.js.map +1 -1
- package/dist/module/utils/calculate-styles.js +6 -0
- package/dist/module/utils/calculate-styles.js.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-content.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-list.d.ts +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-list.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-option.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-root.d.ts +8 -25
- package/dist/typescript/src/components/combobox/components/combobox-root.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-trigger.d.ts +2 -1
- package/dist/typescript/src/components/combobox/components/combobox-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/context.d.ts +9 -8
- package/dist/typescript/src/components/combobox/context.d.ts.map +1 -1
- package/dist/typescript/src/components/focus/focus-prevent.d.ts +6 -0
- package/dist/typescript/src/components/focus/focus-prevent.d.ts.map +1 -0
- package/dist/typescript/src/components/select/components/select-content.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-option.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-root.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-trigger.d.ts +2 -2
- package/dist/typescript/src/components/select/components/select-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/select/types.d.ts +2 -2
- package/dist/typescript/src/components/select/types.d.ts.map +1 -1
- package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/utils/calculate-styles.d.ts +2 -0
- package/dist/typescript/src/utils/calculate-styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/combobox/components/combobox-content.tsx +2 -0
- package/src/components/combobox/components/combobox-list.tsx +9 -17
- package/src/components/combobox/components/combobox-option.tsx +7 -2
- package/src/components/combobox/components/combobox-overlay.tsx +10 -3
- package/src/components/combobox/components/combobox-root.tsx +33 -117
- package/src/components/combobox/components/combobox-trigger.tsx +13 -38
- package/src/components/combobox/context.ts +12 -9
- package/src/components/focus/focus-prevent.ts +8 -0
- package/src/components/select/components/select-content.tsx +6 -7
- package/src/components/select/components/select-option.tsx +5 -4
- package/src/components/select/components/select-overlay.tsx +6 -7
- package/src/components/select/components/select-root.tsx +14 -3
- package/src/components/select/components/select-trigger.tsx +12 -12
- package/src/components/select/types.ts +2 -2
- package/src/components/select/variants/default.tsx +0 -5
- package/src/utils/calculate-styles.ts +16 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","Pressable","Text","
|
|
1
|
+
{"version":3,"names":["React","useRef","Pressable","StyleSheet","Text","extractPressableStyles","measureLayoutPosition","useSelect","jsx","_jsx","Fragment","_Fragment","SelectTrigger","props","select","triggerRef","onTriggerPress","isOpen","current","layout","setTriggerPosition","setIsOpen","ref","onPress","disabled","isDisabled","style","styleProp","flatten","styles","trigger","default","state","children","SelectValue","placeholder","selectedOption","options","find","option","value","selectedOptionLabel","label","displayValue","key","slotStyles","composedStyles"],"sourceRoot":"../../../../../src","sources":["components/select/components/select-trigger.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,SACEC,SAAS,EACTC,UAAU,EACVC,IAAI,QAIC,cAAc;AAErB,SAASC,sBAAsB,QAAQ,oCAAiC;AACxE,SAASC,qBAAqB,QAAQ,oCAAiC;AACvE,SAASC,SAAS,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAOvC,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAE;EACvD,MAAMC,MAAM,GAAGP,SAAS,CAAC,CAAC;EAC1B,MAAMQ,UAAU,GAAGd,MAAM,CAAU,IAAI,CAAC;EAExC,MAAMe,cAAc,GAAGA,CAAA,KAAM;IAC3B,IAAI,CAACF,MAAM,CAACG,MAAM,EAAE;MAClBX,qBAAqB,CAACS,UAAU,CAACG,OAAO,EAAGC,MAAM,IAAK;QACpDL,MAAM,CAACM,kBAAkB,CAACD,MAAM,CAAC;QACjCL,MAAM,CAACO,SAAS,CAAC,IAAI,CAAC;MACxB,CAAC,CAAC;IACJ,CAAC,MAAM;MACLP,MAAM,CAACO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,EAAE;IACtD,oBAAOlC,IAAA,CAAAE,SAAA;MAAAsB,QAAA,EAAGU;IAAY,CAAG,CAAC;EAC5B;EACA,oBAAOlC,IAAA,CAACL,IAAI;IAACsB,KAAK,EAAEoB,cAAe;IAAAb,QAAA,EAAEU,YAAY,IAAI9B,KAAK,CAACsB;EAAW,CAAO,CAAC;AAChF","ignoreList":[]}
|
|
@@ -73,15 +73,10 @@ export function useSelectVariantDefault(size) {
|
|
|
73
73
|
default: {
|
|
74
74
|
paddingVertical: s.paddingVertical,
|
|
75
75
|
paddingHorizontal: s.paddingHorizontal,
|
|
76
|
-
fontFamily,
|
|
77
|
-
fontSize: s.fontSize,
|
|
78
|
-
lineHeight: s.lineHeight,
|
|
79
|
-
color: colors.foreground,
|
|
80
76
|
borderRadius: radius / 2,
|
|
81
77
|
cursor: "pointer"
|
|
82
78
|
},
|
|
83
79
|
disabled: {
|
|
84
|
-
color: colors.mutedForeground,
|
|
85
80
|
cursor: "not-allowed"
|
|
86
81
|
},
|
|
87
82
|
selected: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useThemedStyles","useSelectVariantDefault","size","colors","radius","fontFamily","sizeScale","s","root","default","disabled","trigger","borderWidth","borderColor","border","borderRadius","backgroundColor","surface","justifyContent","paddingHorizontal","minHeight","height","muted","cursor","value","fontSize","lineHeight","color","foreground","mutedForeground","placeholder","overlay","zIndex","content","padding","gap","option","paddingVertical","selected","hovered"],"sourceRoot":"../../../../../src","sources":["components/select/variants/default.tsx"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,SAASC,uBAAuBA,CAACC,IAAU,EAAgB;EAChE,OAAOF,eAAe,CAAC,CAAC;IAAEG,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAU,CAAC,KAAmB;IAClF,MAAMC,CAAC,GAAGD,SAAS,CAACJ,IAAI,CAAC;IAEzB,OAAO;MACLM,IAAI,EAAE;QACJC,OAAO,EAAE,CAA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EAAE,CAAC;UACNH,MAAM,EAAE;QACV,CAAC;QACDtB,QAAQ,EAAE,CAAC;MACb,CAAC;MACD0B,MAAM,EAAE;QACN3B,OAAO,EAAE;UACP4B,eAAe,EAAE9B,CAAC,CAAC8B,eAAe;UAClClB,iBAAiB,EAAEZ,CAAC,CAACY,iBAAiB;
|
|
1
|
+
{"version":3,"names":["useThemedStyles","useSelectVariantDefault","size","colors","radius","fontFamily","sizeScale","s","root","default","disabled","trigger","borderWidth","borderColor","border","borderRadius","backgroundColor","surface","justifyContent","paddingHorizontal","minHeight","height","muted","cursor","value","fontSize","lineHeight","color","foreground","mutedForeground","placeholder","overlay","zIndex","content","padding","gap","option","paddingVertical","selected","hovered"],"sourceRoot":"../../../../../src","sources":["components/select/variants/default.tsx"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,qCAAkC;AAGlE,OAAO,SAASC,uBAAuBA,CAACC,IAAU,EAAgB;EAChE,OAAOF,eAAe,CAAC,CAAC;IAAEG,MAAM;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAU,CAAC,KAAmB;IAClF,MAAMC,CAAC,GAAGD,SAAS,CAACJ,IAAI,CAAC;IAEzB,OAAO;MACLM,IAAI,EAAE;QACJC,OAAO,EAAE,CAAC,CAAC;QACXC,QAAQ,EAAE,CAAC;MACb,CAAC;MACDC,OAAO,EAAE;QACPF,OAAO,EAAE;UACPG,WAAW,EAAE,CAAC;UACdC,WAAW,EAAEV,MAAM,CAACW,MAAM;UAC1BC,YAAY,EAAEX,MAAM;UACpBY,eAAe,EAAEb,MAAM,CAACc,OAAO;UAC/BC,cAAc,EAAE,QAAQ;UACxBC,iBAAiB,EAAEZ,CAAC,CAACY,iBAAiB;UACtCC,SAAS,EAAEb,CAAC,CAACc;QACf,CAAC;QACDX,QAAQ,EAAE;UACRM,eAAe,EAAEb,MAAM,CAACmB,KAAK;UAC7BC,MAAM,EAAE;QACV;MACF,CAAC;MACDC,KAAK,EAAE;QACLf,OAAO,EAAE;UACPJ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CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -40,4 +40,10 @@ export const mergeStyles = (variantStyles, globalStyles) => {
|
|
|
40
40
|
}
|
|
41
41
|
return returnStyles;
|
|
42
42
|
};
|
|
43
|
+
export const extractPressableStyles = (style, props) => {
|
|
44
|
+
if (typeof style === "function") {
|
|
45
|
+
return style(props);
|
|
46
|
+
}
|
|
47
|
+
return style;
|
|
48
|
+
};
|
|
43
49
|
//# sourceMappingURL=calculate-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","calculateComposedStyles","styles","state","component","style","result","componentStyles","push","mergeProps","variantProps","globalProps","mergedProps","isPropsObject","props","mergeStyles","variantStyles","globalStyles","returnStyles","key","flatten"],"sourceRoot":"../../../src","sources":["utils/calculate-styles.ts"],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"names":["StyleSheet","calculateComposedStyles","styles","state","component","style","result","componentStyles","push","mergeProps","variantProps","globalProps","mergedProps","isPropsObject","props","mergeStyles","variantStyles","globalStyles","returnStyles","key","flatten","extractPressableStyles"],"sourceRoot":"../../../src","sources":["utils/calculate-styles.ts"],"mappings":";;AAAA,SACEA,UAAU,QAIL,cAAc;AAErB,OAAO,MAAMC,uBAAuB,GAAGA,CAKrCC,MAAyE,GAAG,CAAC,CAAC,EAC9EC,KAAY,EACZC,SAAoB,EACpBC,KAAc,KACD;EACb,MAAMC,MAAgB,GAAG,EAAE;EAC3B,MAAMC,eAAe,GAAGL,MAAM,GAAGE,SAAS,CAAC;EAC3C,IAAIG,eAAe,IAAI,SAAS,IAAIA,eAAe,IAAIA,eAAe,CAAC,SAAS,CAAC,EAAE;IACjFD,MAAM,CAACE,IAAI,CAACD,eAAe,CAAC,SAAS,CAAW,CAAC;EACnD;EACA,IAAIA,eAAe,GAAGJ,KAAK,CAAC,EAAE;IAC5BG,MAAM,CAACE,IAAI,CAACD,eAAe,CAACJ,KAAK,CAAC,CAAC;EACrC;EACA,I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E;IAC/B,OAAOA,KAAK,CAACS,KAAK,CAAC;EACrB;EACA,OAAOT,KAAK;AACd,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKtF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAgC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-list.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox-list.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,YAAY,CAAC;IACrE,WAAW,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC;CAC5C;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,qBAY1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIpE,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAaF,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"combobox-option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIpE,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAaF,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,qBAgC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-overlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,KAAK,SAAS,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox-overlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,KAAK,SAAS,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIrF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBA0B1D"}
|
|
@@ -3,35 +3,18 @@ import { type StyleProp, type ViewStyle } from "react-native";
|
|
|
3
3
|
import type { Size } from "../../../utils/size-scale";
|
|
4
4
|
import { ComboboxVariants } from "../variants";
|
|
5
5
|
export interface ComboboxRootProps<T> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Extracts a unique string identifier from an item.
|
|
14
|
-
* Defaults to reading `item.value` or `String(item)`.
|
|
15
|
-
*/
|
|
16
|
-
getItemValue?: (item: T) => string;
|
|
17
|
-
/**
|
|
18
|
-
* Extracts a display label from an item (shown in the trigger when selected).
|
|
19
|
-
* Defaults to reading `item.label` or falling back to `getItemValue`.
|
|
20
|
-
*/
|
|
21
|
-
getItemLabel?: (item: T) => string;
|
|
22
|
-
/**
|
|
23
|
-
* Custom filter function. Return `true` to include the item.
|
|
24
|
-
* Defaults to case-insensitive label includes query.
|
|
25
|
-
* Pass `null` to disable built-in filtering (useful for async search).
|
|
26
|
-
*/
|
|
27
|
-
filter?: ((item: T, query: string) => boolean) | null;
|
|
28
|
-
/** Called when the text input value changes. Useful for async search. */
|
|
29
|
-
onInputChange?: (text: string) => void;
|
|
6
|
+
items: T[];
|
|
7
|
+
value: T | null;
|
|
8
|
+
onChange: (item: T) => void;
|
|
9
|
+
inputValue: string;
|
|
10
|
+
onInputChange: (text: string) => void;
|
|
11
|
+
getItemValue: (item: T) => string;
|
|
12
|
+
getItemLabel: (item: T) => string;
|
|
30
13
|
variant?: keyof typeof ComboboxVariants;
|
|
31
14
|
size?: Size;
|
|
32
15
|
isDisabled?: boolean;
|
|
33
16
|
children?: React.ReactNode;
|
|
34
17
|
style?: StyleProp<ViewStyle>;
|
|
35
18
|
}
|
|
36
|
-
export declare function ComboboxRoot<T>(props: ComboboxRootProps<T>): React.JSX.Element;
|
|
19
|
+
export declare function ComboboxRoot<T>({ variant, size, isDisabled, ...props }: ComboboxRootProps<T>): React.JSX.Element;
|
|
37
20
|
//# sourceMappingURL=combobox-root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-root.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-root.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"combobox-root.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAEL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,CAAC,EAAE,CAAC;IAEX,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAE5B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAClC,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAElC,OAAO,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACxC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAOD,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,OAAmB,EACnB,IAAW,EACX,UAAkB,EAClB,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,CAAC,CAAC,qBA4DtB"}
|
|
@@ -5,7 +5,8 @@ type ExtendableProps = Omit<TextInputProps, "value" | "onChange" | "onChangeText
|
|
|
5
5
|
type RenderProps = {
|
|
6
6
|
inputRef: React.RefObject<TextInputRef | null>;
|
|
7
7
|
open: () => void;
|
|
8
|
-
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (value: string) => void;
|
|
9
10
|
};
|
|
10
11
|
export type ComboboxTriggerProps = ExtendableProps & {
|
|
11
12
|
render?: (props: RenderProps) => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"combobox-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAKjE,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC,CAAC;AAEnF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC/C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG;IACnD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC;CAClD,CAAC;AAQF,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,mSAyDzE"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { type Dispatch } from "react";
|
|
2
2
|
import type { LayoutRectangle } from "react-native";
|
|
3
3
|
import type { LayoutPosition } from "../../hooks";
|
|
4
|
+
import type { TextInputRef } from "../../types/element.types";
|
|
4
5
|
import type { ComboboxState, ComboboxStyles } from "./types";
|
|
5
6
|
export interface ComboboxContext {
|
|
6
|
-
items: readonly
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
items: readonly any[];
|
|
8
|
+
value: any | undefined;
|
|
9
|
+
onChange: (item: any) => void;
|
|
10
|
+
inputValue: string;
|
|
11
|
+
onInputChange: (text: string) => void;
|
|
12
|
+
getItemValue: (item: any) => string;
|
|
13
|
+
getItemLabel: (item: any) => string;
|
|
14
|
+
inputRef: React.RefObject<TextInputRef | null>;
|
|
12
15
|
isOpen: boolean;
|
|
13
16
|
setIsOpen: Dispatch<React.SetStateAction<boolean>>;
|
|
14
17
|
triggerPosition: LayoutPosition;
|
|
15
18
|
setTriggerPosition: Dispatch<React.SetStateAction<LayoutPosition>>;
|
|
16
19
|
contentLayout: LayoutRectangle;
|
|
17
20
|
setContentLayout: Dispatch<React.SetStateAction<LayoutRectangle>>;
|
|
18
|
-
inputValue: string;
|
|
19
|
-
setInputValue: Dispatch<React.SetStateAction<string>>;
|
|
20
21
|
isDisabled: boolean;
|
|
21
22
|
state: ComboboxState;
|
|
22
23
|
styles: ComboboxStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/combobox/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,QAAQ,EAAc,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/combobox/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,QAAQ,EAAc,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,GAAG,EAAE,CAAC;IAEtB,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAE9B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,YAAY,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,YAAY,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC;IAEpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAE/C,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,eAAe,EAAE,cAAc,CAAC;IAChC,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IACnE,aAAa,EAAE,eAAe,CAAC;IAC/B,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAElE,UAAU,EAAE,OAAO,CAAC;IAEpB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,sDAAwD,CAAC;AAErF,eAAO,MAAM,WAAW,uBAMvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-prevent.d.ts","sourceRoot":"","sources":["../../../../../src/components/focus/focus-prevent.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;qBAET,KAAK,CAAC,UAAU;;;CAGnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIhF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,YAAY,CAAC;IAE3D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA8BtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAmBF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAuCzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-overlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-overlay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-overlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,KAAK,SAAS,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,YAAY,CAAC;CAC5D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAsBtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-root.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"select-root.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAEL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACtC,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,KAAK,CAAC,YAAY,CAAC;IAEhE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AASD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAwChD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type PressableProps, type StyleProp, type TextStyle } from "react-native";
|
|
3
3
|
export interface SelectTriggerProps {
|
|
4
4
|
placeholder?: string;
|
|
5
|
-
style?:
|
|
5
|
+
style?: PressableProps["style"];
|
|
6
6
|
}
|
|
7
7
|
export declare function SelectTrigger(props: SelectTriggerProps): React.JSX.Element;
|
|
8
8
|
export interface SelectValueProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"select-trigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AACtC,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACjC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA+BtD;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAelD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TextStyle } from "react-native";
|
|
2
1
|
import type { SelectContentProps } from "./components/select-content";
|
|
2
|
+
import type { SelectOptionProps } from "./components/select-option";
|
|
3
3
|
import type { SelectOverlayProps } from "./components/select-overlay";
|
|
4
4
|
import type { SelectRootProps } from "./components/select-root";
|
|
5
5
|
import type { SelectTriggerProps, SelectValueProps } from "./components/select-trigger";
|
|
@@ -12,7 +12,7 @@ export interface SelectStyles {
|
|
|
12
12
|
placeholder?: Partial<Record<SelectState, SelectValueProps["style"]>>;
|
|
13
13
|
overlay?: Partial<Record<SelectState, SelectOverlayProps["style"]>>;
|
|
14
14
|
content?: Partial<Record<SelectState, SelectContentProps["style"]>>;
|
|
15
|
-
option?: Partial<Record<SelectOptionState,
|
|
15
|
+
option?: Partial<Record<SelectOptionState, SelectOptionProps["style"]>>;
|
|
16
16
|
}
|
|
17
17
|
export interface SelectOption {
|
|
18
18
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAA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2BAA2B,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/variants/default.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAmFhE"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type PressableProps, type PressableStateCallbackType, type ViewStyle } from "react-native";
|
|
1
2
|
export declare const calculateComposedStyles: <TStyle, State extends string | "default", Component extends string>(styles: (Partial<Record<Component, Partial<Record<State, TStyle>>>> | null) | undefined, state: State, component: Component, style?: TStyle) => TStyle[];
|
|
2
3
|
export declare const mergeStyles: <TStyle extends Record<string, any>>(variantStyles: TStyle, globalStyles: TStyle | undefined) => TStyle;
|
|
4
|
+
export declare const extractPressableStyles: (style: PressableProps["style"], props: PressableStateCallbackType) => ViewStyle;
|
|
3
5
|
//# sourceMappingURL=calculate-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculate-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculate-styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calculate-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculate-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,uBAAuB,GAClC,MAAM,EACN,KAAK,SAAS,MAAM,GAAG,SAAS,EAChC,SAAS,SAAS,MAAM,EAExB,SAAQ,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,aAAK,EAC9E,OAAO,KAAK,EACZ,WAAW,SAAS,EACpB,QAAQ,MAAM,KACb,MAAM,EAaR,CAAC;AAmBF,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5D,eAAe,MAAM,EACrB,cAAc,MAAM,GAAG,SAAS,KAC/B,MAYF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,OAAO,cAAc,CAAC,OAAO,CAAC,EAC9B,OAAO,0BAA0B,KAChC,SAKF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView, StyleSheet, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import { useRelativePosition } from "../../../hooks/use-relative-position";
|
|
4
|
+
import { focusPreventProps } from "../../focus/focus-prevent";
|
|
4
5
|
import { useCombobox } from "../context";
|
|
5
6
|
|
|
6
7
|
export interface ComboboxContentProps {
|
|
@@ -35,6 +36,7 @@ export function ComboboxContent(props: ComboboxContentProps) {
|
|
|
35
36
|
}}
|
|
36
37
|
keyboardShouldPersistTaps="handled"
|
|
37
38
|
nestedScrollEnabled
|
|
39
|
+
{...focusPreventProps}
|
|
38
40
|
>
|
|
39
41
|
{props.children}
|
|
40
42
|
</ScrollView>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { List } from "../../list";
|
|
2
3
|
import { useCombobox } from "../context";
|
|
3
4
|
|
|
4
5
|
export interface ComboboxListProps<T> {
|
|
5
|
-
keyExtractor
|
|
6
|
+
keyExtractor: (item: T, index: number) => string;
|
|
6
7
|
renderItem: (info: { item: T; index: number }) => React.ReactElement;
|
|
7
8
|
renderEmpty?: () => React.ReactElement;
|
|
8
9
|
renderSeparator?: () => React.ReactElement;
|
|
@@ -10,23 +11,14 @@ export interface ComboboxListProps<T> {
|
|
|
10
11
|
|
|
11
12
|
export function ComboboxList<T>(props: ComboboxListProps<T>) {
|
|
12
13
|
const combobox = useCombobox();
|
|
13
|
-
const items = combobox.filteredItems as T[];
|
|
14
|
-
|
|
15
|
-
const keyExtractor =
|
|
16
|
-
props.keyExtractor ?? ((item: T, index: number) => combobox.getItemValue(item) ?? String(index));
|
|
17
|
-
|
|
18
|
-
if (items.length === 0) {
|
|
19
|
-
return <>{props.renderEmpty?.()}</>;
|
|
20
|
-
}
|
|
21
14
|
|
|
22
15
|
return (
|
|
23
|
-
|
|
24
|
-
{items
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</>
|
|
16
|
+
<List
|
|
17
|
+
data={combobox.items as T[]}
|
|
18
|
+
keyExtractor={props.keyExtractor}
|
|
19
|
+
renderItem={props.renderItem}
|
|
20
|
+
renderEmpty={props.renderEmpty}
|
|
21
|
+
renderSeparator={props.renderSeparator}
|
|
22
|
+
/>
|
|
31
23
|
);
|
|
32
24
|
}
|
|
@@ -33,8 +33,13 @@ export function ComboboxOption<T>(props: ComboboxOptionProps<T>) {
|
|
|
33
33
|
const composedStyles = StyleSheet.flatten([optionStyles?.default, optionStyles?.[optionState]]);
|
|
34
34
|
|
|
35
35
|
const handlePress = () => {
|
|
36
|
-
combobox.
|
|
37
|
-
combobox.
|
|
36
|
+
const itemLabel = combobox.getItemLabel(props.item);
|
|
37
|
+
combobox.onChange(props.item);
|
|
38
|
+
combobox.onInputChange?.(itemLabel);
|
|
39
|
+
combobox.inputRef.current?.blur();
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
|
+
combobox.setIsOpen(false);
|
|
42
|
+
});
|
|
38
43
|
};
|
|
39
44
|
|
|
40
45
|
return (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Pressable, type StyleProp, StyleSheet, type ViewStyle } from "react-native";
|
|
3
|
+
import { focusPreventProps } from "../../focus/focus-prevent";
|
|
3
4
|
import { useCombobox } from "../context";
|
|
4
5
|
|
|
5
6
|
export interface ComboboxOverlayProps {
|
|
@@ -10,6 +11,13 @@ export interface ComboboxOverlayProps {
|
|
|
10
11
|
export function ComboboxOverlay(props: ComboboxOverlayProps) {
|
|
11
12
|
const combobox = useCombobox();
|
|
12
13
|
|
|
14
|
+
const onPress = () => {
|
|
15
|
+
combobox.inputRef.current?.blur();
|
|
16
|
+
requestAnimationFrame(() => {
|
|
17
|
+
combobox.setIsOpen(false);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
13
21
|
const composedStyles = StyleSheet.flatten([
|
|
14
22
|
combobox.styles?.overlay?.default,
|
|
15
23
|
combobox.styles?.overlay?.[combobox.state],
|
|
@@ -18,11 +26,10 @@ export function ComboboxOverlay(props: ComboboxOverlayProps) {
|
|
|
18
26
|
|
|
19
27
|
return (
|
|
20
28
|
<Pressable
|
|
21
|
-
onPress={
|
|
22
|
-
combobox.setIsOpen(false);
|
|
23
|
-
}}
|
|
29
|
+
onPress={onPress}
|
|
24
30
|
pointerEvents="auto"
|
|
25
31
|
style={[StyleSheet.absoluteFill, composedStyles]}
|
|
32
|
+
{...focusPreventProps}
|
|
26
33
|
>
|
|
27
34
|
{props.children}
|
|
28
35
|
</Pressable>
|