@korsolutions/ui 0.0.68 → 0.0.69
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-empty.js +8 -4
- package/dist/module/components/combobox/components/combobox-empty.js.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-empty.d.ts +2 -1
- package/dist/typescript/src/components/combobox/components/combobox-empty.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/combobox/components/combobox-empty.tsx +11 -8
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { Text } from "react-native";
|
|
5
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles.js";
|
|
4
|
+
import { StyleSheet, Text } from "react-native";
|
|
6
5
|
import { useCombobox } from "../context.js";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
export function ComboboxEmpty(props) {
|
|
9
8
|
const combobox = useCombobox();
|
|
10
9
|
const hasVisibleOptions = combobox.options.some(option => combobox.filter(option.value, combobox.searchQuery));
|
|
11
10
|
if (hasVisibleOptions) {
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
|
-
|
|
13
|
+
if (props.render) {
|
|
14
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
15
|
+
children: props.render()
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const composedStyles = StyleSheet.flatten([combobox.styles.empty?.default, combobox.styles.empty?.[combobox.state]]);
|
|
15
19
|
return /*#__PURE__*/_jsx(Text, {
|
|
16
20
|
style: composedStyles,
|
|
17
21
|
children: props.children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","useCombobox","Fragment","_Fragment","jsx","_jsx","ComboboxEmpty","props","combobox","hasVisibleOptions","options","some","option","filter","value","searchQuery","render","children","composedStyles","flatten","styles","empty","default","state","style"],"sourceRoot":"../../../../../src","sources":["components/combobox/components/combobox-empty.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,WAAW,QAAQ,eAAY;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAOzC,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAE;EACvD,MAAMC,QAAQ,GAAGP,WAAW,CAAC,CAAC;EAE9B,MAAMQ,iBAAiB,GAAGD,QAAQ,CAACE,OAAO,CAACC,IAAI,CAAEC,MAAM,IACrDJ,QAAQ,CAACK,MAAM,CAACD,MAAM,CAACE,KAAK,EAAEN,QAAQ,CAACO,WAAW,CACpD,CAAC;EAED,IAAIN,iBAAiB,EAAE;IACrB,OAAO,IAAI;EACb;EAEA,IAAIF,KAAK,CAACS,MAAM,EAAE;IAChB,oBAAOX,IAAA,CAAAF,SAAA;MAAAc,QAAA,EAAGV,KAAK,CAACS,MAAM,CAAC;IAAC,CAAG,CAAC;EAC9B;EAEA,MAAME,cAAc,GAAGnB,UAAU,CAACoB,OAAO,CAAC,CACxCX,QAAQ,CAACY,MAAM,CAACC,KAAK,EAAEC,OAAO,EAC9Bd,QAAQ,CAACY,MAAM,CAACC,KAAK,GAAGb,QAAQ,CAACe,KAAK,CAAC,CACxC,CAAC;EAEF,oBAAOlB,IAAA,CAACL,IAAI;IAACwB,KAAK,EAAEN,cAAe;IAAAD,QAAA,EAAEV,KAAK,CAACU;EAAQ,CAAO,CAAC;AAC7D","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface ComboboxEmptyProps {
|
|
3
|
-
children?:
|
|
3
|
+
children?: string;
|
|
4
|
+
render: () => React.ReactNode;
|
|
4
5
|
}
|
|
5
6
|
export declare function ComboboxEmpty(props: ComboboxEmptyProps): React.JSX.Element | null;
|
|
6
7
|
//# sourceMappingURL=combobox-empty.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-empty.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-empty.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox-empty.d.ts","sourceRoot":"","sources":["../../../../../../src/components/combobox/components/combobox-empty.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,4BAqBtD"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Text } from "react-native";
|
|
3
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
|
+
import { StyleSheet, Text } from "react-native";
|
|
4
3
|
import { useCombobox } from "../context";
|
|
5
4
|
|
|
6
5
|
export interface ComboboxEmptyProps {
|
|
7
|
-
children?:
|
|
6
|
+
children?: string;
|
|
7
|
+
render: () => React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function ComboboxEmpty(props: ComboboxEmptyProps) {
|
|
@@ -18,11 +18,14 @@ export function ComboboxEmpty(props: ComboboxEmptyProps) {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (props.render) {
|
|
22
|
+
return <>{props.render()}</>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const composedStyles = StyleSheet.flatten([
|
|
26
|
+
combobox.styles.empty?.default,
|
|
27
|
+
combobox.styles.empty?.[combobox.state],
|
|
28
|
+
]);
|
|
26
29
|
|
|
27
30
|
return <Text style={composedStyles}>{props.children}</Text>;
|
|
28
31
|
}
|