@seakoi/native-ui 1.2.0 → 1.3.0
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/CHANGELOG.md +35 -0
- package/dist/commonjs/components/base/index.js +33 -11
- package/dist/commonjs/components/base/input/base-input.js +4 -2
- package/dist/commonjs/components/base/overflow/all-mode-overflow.js +49 -0
- package/dist/commonjs/components/base/overflow/fixed-count-overflow.js +70 -0
- package/dist/commonjs/components/base/overflow/index.js +16 -0
- package/dist/commonjs/components/base/overflow/overflow.js +72 -0
- package/dist/commonjs/components/base/overflow/responsive-overflow.js +280 -0
- package/dist/commonjs/components/base/overflow/style/index.js +39 -0
- package/dist/commonjs/components/base/overflow/types.js +5 -0
- package/dist/commonjs/components/base/picker/picker-content.js +16 -12
- package/dist/commonjs/components/base/picker/picker-field.js +9 -7
- package/dist/commonjs/components/base/picker/picker.js +6 -1
- package/dist/commonjs/components/base/picker/style/index.js +7 -1
- package/dist/commonjs/components/base/portal/portal-host.js +5 -3
- package/dist/commonjs/components/base/select/hooks/use-select-actions.js +155 -0
- package/dist/commonjs/components/base/select/hooks/use-select-options.js +169 -0
- package/dist/commonjs/components/base/select/hooks/use-selector.js +104 -0
- package/dist/commonjs/components/base/select/index.js +16 -0
- package/dist/commonjs/components/base/select/select-multiple-content.js +182 -0
- package/dist/commonjs/components/base/select/select-popup.js +233 -0
- package/dist/commonjs/components/base/select/select-single-content.js +100 -0
- package/dist/commonjs/components/base/select/select-suffix.js +67 -0
- package/dist/commonjs/components/base/select/select.js +285 -0
- package/dist/commonjs/components/base/select/style/index.js +40 -0
- package/dist/commonjs/components/base/select/style/select-multiple-content-styles.js +46 -0
- package/dist/commonjs/components/base/select/style/select-popup-styles.js +67 -0
- package/dist/commonjs/components/base/select/style/select-single-content-styles.js +28 -0
- package/dist/commonjs/components/base/select/style/select-styles.js +46 -0
- package/dist/commonjs/components/base/select/style/select-suffix-styles.js +21 -0
- package/dist/commonjs/components/base/select/types.js +5 -0
- package/dist/commonjs/components/base/tabs/style/index.js +37 -0
- package/dist/commonjs/components/base/tabs/tabs.js +90 -45
- package/dist/commonjs/native-provider/native-provider.js +5 -5
- package/dist/commonjs/shared/utils/index.js +11 -0
- package/dist/commonjs/shared/utils/object.js +39 -0
- package/dist/module/components/base/index.js +2 -0
- package/dist/module/components/base/input/base-input.js +4 -2
- package/dist/module/components/base/overflow/all-mode-overflow.js +43 -0
- package/dist/module/components/base/overflow/fixed-count-overflow.js +64 -0
- package/dist/module/components/base/overflow/index.js +3 -0
- package/dist/module/components/base/overflow/overflow.js +66 -0
- package/dist/module/components/base/overflow/responsive-overflow.js +274 -0
- package/dist/module/components/base/overflow/style/index.js +36 -0
- package/dist/module/components/base/overflow/types.js +3 -0
- package/dist/module/components/base/picker/picker-content.js +16 -12
- package/dist/module/components/base/picker/picker-field.js +9 -7
- package/dist/module/components/base/picker/picker.js +6 -1
- package/dist/module/components/base/picker/style/index.js +6 -0
- package/dist/module/components/base/portal/portal-host.js +4 -3
- package/dist/module/components/base/select/hooks/use-select-actions.js +151 -0
- package/dist/module/components/base/select/hooks/use-select-options.js +162 -0
- package/dist/module/components/base/select/hooks/use-selector.js +100 -0
- package/dist/module/components/base/select/index.js +3 -0
- package/dist/module/components/base/select/select-multiple-content.js +176 -0
- package/dist/module/components/base/select/select-popup.js +227 -0
- package/dist/module/components/base/select/select-single-content.js +94 -0
- package/dist/module/components/base/select/select-suffix.js +61 -0
- package/dist/module/components/base/select/select.js +279 -0
- package/dist/module/components/base/select/style/index.js +7 -0
- package/dist/module/components/base/select/style/select-multiple-content-styles.js +43 -0
- package/dist/module/components/base/select/style/select-popup-styles.js +64 -0
- package/dist/module/components/base/select/style/select-single-content-styles.js +25 -0
- package/dist/module/components/base/select/style/select-styles.js +43 -0
- package/dist/module/components/base/select/style/select-suffix-styles.js +18 -0
- package/dist/module/components/base/select/types.js +3 -0
- package/dist/module/components/base/tabs/style/index.js +33 -0
- package/dist/module/components/base/tabs/tabs.js +92 -47
- package/dist/module/native-provider/native-provider.js +5 -5
- package/dist/module/shared/utils/index.js +2 -1
- package/dist/module/shared/utils/object.js +35 -0
- package/dist/typescript/components/base/index.d.ts +2 -0
- package/dist/typescript/components/base/index.d.ts.map +1 -1
- package/dist/typescript/components/base/input/base-input.d.ts.map +1 -1
- package/dist/typescript/components/base/overflow/all-mode-overflow.d.ts +11 -0
- package/dist/typescript/components/base/overflow/all-mode-overflow.d.ts.map +1 -0
- package/dist/typescript/components/base/overflow/fixed-count-overflow.d.ts +11 -0
- package/dist/typescript/components/base/overflow/fixed-count-overflow.d.ts.map +1 -0
- package/dist/typescript/components/base/overflow/index.d.ts +3 -0
- package/dist/typescript/components/base/overflow/index.d.ts.map +1 -0
- package/dist/typescript/components/base/overflow/overflow.d.ts +13 -0
- package/dist/typescript/components/base/overflow/overflow.d.ts.map +1 -0
- package/dist/typescript/components/base/overflow/responsive-overflow.d.ts +12 -0
- package/dist/typescript/components/base/overflow/responsive-overflow.d.ts.map +1 -0
- package/dist/typescript/components/base/overflow/style/index.d.ts +31 -0
- package/dist/typescript/components/base/overflow/style/index.d.ts.map +1 -0
- package/dist/typescript/components/base/overflow/types.d.ts +77 -0
- package/dist/typescript/components/base/overflow/types.d.ts.map +1 -0
- package/dist/typescript/components/base/picker/picker-content.d.ts +12 -0
- package/dist/typescript/components/base/picker/picker-content.d.ts.map +1 -1
- package/dist/typescript/components/base/picker/picker-field.d.ts.map +1 -1
- package/dist/typescript/components/base/picker/picker.d.ts +9 -0
- package/dist/typescript/components/base/picker/picker.d.ts.map +1 -1
- package/dist/typescript/components/base/picker/style/index.d.ts +6 -0
- package/dist/typescript/components/base/picker/style/index.d.ts.map +1 -1
- package/dist/typescript/components/base/portal/portal-host.d.ts +1 -0
- package/dist/typescript/components/base/portal/portal-host.d.ts.map +1 -1
- package/dist/typescript/components/base/portal/types.d.ts +2 -0
- package/dist/typescript/components/base/portal/types.d.ts.map +1 -1
- package/dist/typescript/components/base/select/hooks/use-select-actions.d.ts +144 -0
- package/dist/typescript/components/base/select/hooks/use-select-actions.d.ts.map +1 -0
- package/dist/typescript/components/base/select/hooks/use-select-options.d.ts +91 -0
- package/dist/typescript/components/base/select/hooks/use-select-options.d.ts.map +1 -0
- package/dist/typescript/components/base/select/hooks/use-selector.d.ts +90 -0
- package/dist/typescript/components/base/select/hooks/use-selector.d.ts.map +1 -0
- package/dist/typescript/components/base/select/index.d.ts +3 -0
- package/dist/typescript/components/base/select/index.d.ts.map +1 -0
- package/dist/typescript/components/base/select/select-multiple-content.d.ts +51 -0
- package/dist/typescript/components/base/select/select-multiple-content.d.ts.map +1 -0
- package/dist/typescript/components/base/select/select-popup.d.ts +107 -0
- package/dist/typescript/components/base/select/select-popup.d.ts.map +1 -0
- package/dist/typescript/components/base/select/select-single-content.d.ts +48 -0
- package/dist/typescript/components/base/select/select-single-content.d.ts.map +1 -0
- package/dist/typescript/components/base/select/select-suffix.d.ts +43 -0
- package/dist/typescript/components/base/select/select-suffix.d.ts.map +1 -0
- package/dist/typescript/components/base/select/select.d.ts +40 -0
- package/dist/typescript/components/base/select/select.d.ts.map +1 -0
- package/dist/typescript/components/base/select/style/index.d.ts +6 -0
- package/dist/typescript/components/base/select/style/index.d.ts.map +1 -0
- package/dist/typescript/components/base/select/style/select-multiple-content-styles.d.ts +40 -0
- package/dist/typescript/components/base/select/style/select-multiple-content-styles.d.ts.map +1 -0
- package/dist/typescript/components/base/select/style/select-popup-styles.d.ts +61 -0
- package/dist/typescript/components/base/select/style/select-popup-styles.d.ts.map +1 -0
- package/dist/typescript/components/base/select/style/select-single-content-styles.d.ts +22 -0
- package/dist/typescript/components/base/select/style/select-single-content-styles.d.ts.map +1 -0
- package/dist/typescript/components/base/select/style/select-styles.d.ts +40 -0
- package/dist/typescript/components/base/select/style/select-styles.d.ts.map +1 -0
- package/dist/typescript/components/base/select/style/select-suffix-styles.d.ts +15 -0
- package/dist/typescript/components/base/select/style/select-suffix-styles.d.ts.map +1 -0
- package/dist/typescript/components/base/select/types.d.ts +206 -0
- package/dist/typescript/components/base/select/types.d.ts.map +1 -0
- package/dist/typescript/components/base/tabs/style/index.d.ts +29 -0
- package/dist/typescript/components/base/tabs/style/index.d.ts.map +1 -0
- package/dist/typescript/components/base/tabs/tabs.d.ts +26 -5
- package/dist/typescript/components/base/tabs/tabs.d.ts.map +1 -1
- package/dist/typescript/native-provider/native-provider.d.ts +2 -0
- package/dist/typescript/native-provider/native-provider.d.ts.map +1 -1
- package/dist/typescript/shared/utils/index.d.ts +1 -0
- package/dist/typescript/shared/utils/index.d.ts.map +1 -1
- package/dist/typescript/shared/utils/object.d.ts +21 -0
- package/dist/typescript/shared/utils/object.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/base/index.ts +2 -0
- package/src/components/base/input/base-input.tsx +4 -2
- package/src/components/base/overflow/all-mode-overflow.tsx +49 -0
- package/src/components/base/overflow/fixed-count-overflow.tsx +71 -0
- package/src/components/base/overflow/index.ts +2 -0
- package/src/components/base/overflow/overflow.tsx +60 -0
- package/src/components/base/overflow/responsive-overflow.tsx +349 -0
- package/src/components/base/overflow/style/index.ts +32 -0
- package/src/components/base/overflow/types.ts +75 -0
- package/src/components/base/picker/picker-content.tsx +24 -9
- package/src/components/base/picker/picker-field.tsx +19 -13
- package/src/components/base/picker/picker.tsx +10 -1
- package/src/components/base/picker/style/index.ts +4 -0
- package/src/components/base/portal/portal-host.tsx +13 -3
- package/src/components/base/portal/types.ts +2 -0
- package/src/components/base/select/hooks/use-select-actions.ts +263 -0
- package/src/components/base/select/hooks/use-select-options.ts +250 -0
- package/src/components/base/select/hooks/use-selector.ts +155 -0
- package/src/components/base/select/index.ts +2 -0
- package/src/components/base/select/select-multiple-content.tsx +292 -0
- package/src/components/base/select/select-popup.tsx +384 -0
- package/src/components/base/select/select-single-content.tsx +127 -0
- package/src/components/base/select/select-suffix.tsx +100 -0
- package/src/components/base/select/select.tsx +302 -0
- package/src/components/base/select/style/index.ts +5 -0
- package/src/components/base/select/style/select-multiple-content-styles.ts +41 -0
- package/src/components/base/select/style/select-popup-styles.ts +62 -0
- package/src/components/base/select/style/select-single-content-styles.ts +23 -0
- package/src/components/base/select/style/select-styles.ts +41 -0
- package/src/components/base/select/style/select-suffix-styles.ts +16 -0
- package/src/components/base/select/types.ts +261 -0
- package/src/components/base/tabs/style/index.ts +32 -0
- package/src/components/base/tabs/tabs.tsx +146 -55
- package/src/native-provider/native-provider.tsx +4 -4
- package/src/shared/utils/index.ts +1 -0
- package/src/shared/utils/object.ts +37 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useSelectMultipleContentStyles } from './select-multiple-content-styles';
|
|
2
|
+
export { useSelectPopupStyles } from './select-popup-styles';
|
|
3
|
+
export { useSelectSingleContentStyles } from './select-single-content-styles';
|
|
4
|
+
export { useSelectStyles } from './select-styles';
|
|
5
|
+
export { useSelectSuffixStyles } from './select-suffix-styles';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/style/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectMultipleContent 组件样式
|
|
3
|
+
*/
|
|
4
|
+
export declare const useSelectMultipleContentStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
5
|
+
input: {
|
|
6
|
+
flex: number;
|
|
7
|
+
minWidth: number;
|
|
8
|
+
margin: number;
|
|
9
|
+
paddingHorizontal: number;
|
|
10
|
+
paddingVertical: number;
|
|
11
|
+
maxWidth: "100%";
|
|
12
|
+
};
|
|
13
|
+
inputInner: {
|
|
14
|
+
color: "rgba(0, 0, 0, 0.9)";
|
|
15
|
+
padding: number;
|
|
16
|
+
margin: number;
|
|
17
|
+
minWidth: number;
|
|
18
|
+
width: "auto";
|
|
19
|
+
fontSize: number;
|
|
20
|
+
};
|
|
21
|
+
tagItem: {
|
|
22
|
+
flexDirection: "row";
|
|
23
|
+
alignItems: "center";
|
|
24
|
+
paddingHorizontal: 6;
|
|
25
|
+
paddingVertical: 4;
|
|
26
|
+
borderRadius: 2;
|
|
27
|
+
gap: 4;
|
|
28
|
+
flexShrink: number;
|
|
29
|
+
height: "100%";
|
|
30
|
+
backgroundColor: "rgba(243, 243, 243, 1)";
|
|
31
|
+
};
|
|
32
|
+
tagRemoveButton: {
|
|
33
|
+
marginLeft: 4;
|
|
34
|
+
padding: 4;
|
|
35
|
+
};
|
|
36
|
+
overflowSuffix: {
|
|
37
|
+
flexShrink: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=select-multiple-content-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-multiple-content-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/style/select-multiple-content-styles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCxC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectPopup 组件样式
|
|
3
|
+
*/
|
|
4
|
+
export declare const useSelectPopupStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
5
|
+
popupRoot: {
|
|
6
|
+
position: "absolute";
|
|
7
|
+
backgroundColor: "rgba(255, 255, 255, 1)";
|
|
8
|
+
borderRadius: 4;
|
|
9
|
+
borderWidth: number;
|
|
10
|
+
borderColor: "rgba(220, 220, 220, 1)";
|
|
11
|
+
zIndex: number;
|
|
12
|
+
};
|
|
13
|
+
popupList: {};
|
|
14
|
+
popupListItem: {
|
|
15
|
+
paddingHorizontal: 12;
|
|
16
|
+
paddingVertical: 8;
|
|
17
|
+
flexDirection: "row";
|
|
18
|
+
alignItems: "center";
|
|
19
|
+
justifyContent: "space-between";
|
|
20
|
+
};
|
|
21
|
+
popupListItemSelected: {
|
|
22
|
+
backgroundColor: "rgba(241, 248, 255, 1)";
|
|
23
|
+
};
|
|
24
|
+
popupListItemDisabled: {
|
|
25
|
+
opacity: number;
|
|
26
|
+
};
|
|
27
|
+
popupListItemText: {
|
|
28
|
+
flex: number;
|
|
29
|
+
};
|
|
30
|
+
popupGroupLabel: {
|
|
31
|
+
paddingHorizontal: 12;
|
|
32
|
+
paddingVertical: 6;
|
|
33
|
+
backgroundColor: "rgba(243, 243, 243, 1)";
|
|
34
|
+
};
|
|
35
|
+
popupCreateOption: {
|
|
36
|
+
paddingHorizontal: 12;
|
|
37
|
+
paddingVertical: 8;
|
|
38
|
+
borderBottomWidth: number;
|
|
39
|
+
borderBottomColor: "rgba(231, 231, 231, 1)";
|
|
40
|
+
};
|
|
41
|
+
loading: {
|
|
42
|
+
paddingHorizontal: 12;
|
|
43
|
+
paddingVertical: 16;
|
|
44
|
+
alignItems: "center";
|
|
45
|
+
justifyContent: "center";
|
|
46
|
+
};
|
|
47
|
+
empty: {
|
|
48
|
+
paddingHorizontal: 12;
|
|
49
|
+
paddingVertical: 16;
|
|
50
|
+
alignItems: "center";
|
|
51
|
+
justifyContent: "center";
|
|
52
|
+
};
|
|
53
|
+
backdrop: {
|
|
54
|
+
position: "absolute";
|
|
55
|
+
top: number;
|
|
56
|
+
left: number;
|
|
57
|
+
right: number;
|
|
58
|
+
bottom: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=select-popup-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-popup-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/style/select-popup-styles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD9B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectSingleContent 组件样式
|
|
3
|
+
*/
|
|
4
|
+
export declare const useSelectSingleContentStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
5
|
+
input: {
|
|
6
|
+
flex: number;
|
|
7
|
+
minWidth: number;
|
|
8
|
+
margin: number;
|
|
9
|
+
paddingHorizontal: number;
|
|
10
|
+
paddingVertical: number;
|
|
11
|
+
maxWidth: "100%";
|
|
12
|
+
};
|
|
13
|
+
inputInner: {
|
|
14
|
+
color: "rgba(0, 0, 0, 0.9)";
|
|
15
|
+
padding: number;
|
|
16
|
+
margin: number;
|
|
17
|
+
minWidth: number;
|
|
18
|
+
width: "auto";
|
|
19
|
+
fontSize: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=select-single-content-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-single-content-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/style/select-single-content-styles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;CAiBtC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select 主组件样式
|
|
3
|
+
*/
|
|
4
|
+
export declare const useSelectStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
5
|
+
root: {
|
|
6
|
+
position: "relative";
|
|
7
|
+
minHeight: number;
|
|
8
|
+
width: "100%";
|
|
9
|
+
};
|
|
10
|
+
selector: {
|
|
11
|
+
flexDirection: "row";
|
|
12
|
+
alignItems: "center";
|
|
13
|
+
minHeight: number;
|
|
14
|
+
paddingHorizontal: 12;
|
|
15
|
+
paddingVertical: 6;
|
|
16
|
+
backgroundColor: "rgba(255, 255, 255, 1)";
|
|
17
|
+
borderWidth: number;
|
|
18
|
+
borderColor: "rgba(220, 220, 220, 1)";
|
|
19
|
+
borderRadius: 4;
|
|
20
|
+
};
|
|
21
|
+
selectorDisabled: {
|
|
22
|
+
backgroundColor: "rgba(238, 238, 238, 1)";
|
|
23
|
+
borderColor: "rgba(231, 231, 231, 1)";
|
|
24
|
+
};
|
|
25
|
+
selectorFocused: {
|
|
26
|
+
borderColor: "rgba(43, 152, 254, 1)";
|
|
27
|
+
borderWidth: number;
|
|
28
|
+
};
|
|
29
|
+
prefix: {
|
|
30
|
+
marginRight: 6;
|
|
31
|
+
};
|
|
32
|
+
content: {
|
|
33
|
+
flex: number;
|
|
34
|
+
flexDirection: "row";
|
|
35
|
+
flexWrap: "wrap";
|
|
36
|
+
alignItems: "center";
|
|
37
|
+
gap: 6;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=select-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/style/select-styles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectSuffix 组件样式
|
|
3
|
+
*/
|
|
4
|
+
export declare const useSelectSuffixStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
5
|
+
suffix: {
|
|
6
|
+
flexDirection: "row";
|
|
7
|
+
alignItems: "center";
|
|
8
|
+
marginLeft: 6;
|
|
9
|
+
gap: 6;
|
|
10
|
+
};
|
|
11
|
+
clearButton: {
|
|
12
|
+
padding: 4;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=select-suffix-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-suffix-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/style/select-suffix-styles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;CAU/B,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { NativeScrollEvent, NativeSyntheticEvent, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { SelectSearchConfig } from '#components/base/select/hooks/use-select-actions';
|
|
4
|
+
/**
|
|
5
|
+
* 选项数据类型
|
|
6
|
+
*
|
|
7
|
+
* @template ValueType - 选项值的类型
|
|
8
|
+
*/
|
|
9
|
+
export interface SelectOption<ValueType = unknown> {
|
|
10
|
+
/** 选项标签 */
|
|
11
|
+
label: React.ReactNode;
|
|
12
|
+
/** 选项值 */
|
|
13
|
+
value: ValueType;
|
|
14
|
+
/** 是否禁用 */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** 选项自定义样式 */
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
/** 自定义数据(用于扩展) */
|
|
19
|
+
[key: PropertyKey]: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 选项分组类型
|
|
23
|
+
*
|
|
24
|
+
* @template ValueType - 选项值的类型
|
|
25
|
+
*/
|
|
26
|
+
export interface SelectOptionGroup<OptionType extends SelectOption = SelectOption> {
|
|
27
|
+
/** 分组标识 */
|
|
28
|
+
key: string;
|
|
29
|
+
/** 分组名称 */
|
|
30
|
+
label: React.ReactNode;
|
|
31
|
+
/** 分组选项 */
|
|
32
|
+
options: OptionType[];
|
|
33
|
+
/** 分组自定义样式 */
|
|
34
|
+
style?: StyleProp<ViewStyle>;
|
|
35
|
+
}
|
|
36
|
+
/** 选择模式 */
|
|
37
|
+
export type SelectMode = 'multiple' | 'tags';
|
|
38
|
+
/**
|
|
39
|
+
* Select 组件属性
|
|
40
|
+
*
|
|
41
|
+
* @template ValueType - 选项值的类型
|
|
42
|
+
* @template M - 选择模式
|
|
43
|
+
*/
|
|
44
|
+
export interface SelectProps<ValueType = unknown, OptionType extends SelectOption<ValueType> = SelectOption<ValueType>, M extends SelectMode | undefined = undefined, RealValueType extends M extends SelectMode ? ValueType[] : ValueType = M extends SelectMode ? ValueType[] : ValueType> extends SelectSearchConfig<OptionType> {
|
|
45
|
+
/**
|
|
46
|
+
* 是否允许清除
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
allowClear?: boolean | {
|
|
50
|
+
clearIcon?: React.ReactNode;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 默认选中的值
|
|
54
|
+
*/
|
|
55
|
+
defaultValue?: RealValueType;
|
|
56
|
+
/**
|
|
57
|
+
* 是否禁用
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 自定义当前选中的标签内容渲染
|
|
63
|
+
*/
|
|
64
|
+
labelRender?: (props: OptionType, info: {
|
|
65
|
+
index: number;
|
|
66
|
+
}) => React.ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* 选择模式(多选或标签)
|
|
69
|
+
*/
|
|
70
|
+
mode?: M;
|
|
71
|
+
/**
|
|
72
|
+
* 数据化配置选项内容
|
|
73
|
+
* @default []
|
|
74
|
+
*/
|
|
75
|
+
options?: (OptionType | SelectOptionGroup<OptionType>)[];
|
|
76
|
+
/**
|
|
77
|
+
* 占位符文本
|
|
78
|
+
* @default '请选择'
|
|
79
|
+
*/
|
|
80
|
+
placeholder?: string;
|
|
81
|
+
/**
|
|
82
|
+
* 自定义前缀
|
|
83
|
+
*/
|
|
84
|
+
prefix?: React.ReactNode;
|
|
85
|
+
/**
|
|
86
|
+
* 自定义多选框清除图标
|
|
87
|
+
*/
|
|
88
|
+
removeIcon?: React.ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* 配置搜索功能
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
showSearch?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 自定义后缀图标
|
|
96
|
+
*/
|
|
97
|
+
suffixIcon?: React.ReactNode | ((open: boolean) => React.ReactNode);
|
|
98
|
+
/**
|
|
99
|
+
* 当前选中的值
|
|
100
|
+
*/
|
|
101
|
+
value?: RealValueType;
|
|
102
|
+
/**
|
|
103
|
+
* 是否展开下拉菜单
|
|
104
|
+
*/
|
|
105
|
+
open?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* 是否默认展开下拉菜单
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
defaultOpen?: boolean;
|
|
111
|
+
/** 自定义下拉框内容 */
|
|
112
|
+
popupRender?: (menu: React.ReactElement) => React.ReactElement;
|
|
113
|
+
/** 下拉列表滚动时回调 */
|
|
114
|
+
onPopupScroll?: (e: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
115
|
+
/**
|
|
116
|
+
* 下拉菜单和选择器同宽
|
|
117
|
+
*/
|
|
118
|
+
popupMatchWidth?: boolean | number;
|
|
119
|
+
/**
|
|
120
|
+
* 下拉菜单位置,不指定时自动计算
|
|
121
|
+
*/
|
|
122
|
+
popupPlacement?: 'top' | 'bottom';
|
|
123
|
+
/**
|
|
124
|
+
* 加载中状态
|
|
125
|
+
*/
|
|
126
|
+
popupLoading?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 下拉列表为空时显示的内容
|
|
129
|
+
*/
|
|
130
|
+
popupNotFoundContent?: React.ReactNode;
|
|
131
|
+
/**
|
|
132
|
+
* 自定义选中项图标
|
|
133
|
+
*/
|
|
134
|
+
popupSelectedIcon?: React.ReactNode;
|
|
135
|
+
/**
|
|
136
|
+
* 自定义渲染下拉选项
|
|
137
|
+
*/
|
|
138
|
+
popupOptionRender?: (option: OptionType, info: {
|
|
139
|
+
index: number;
|
|
140
|
+
selected: boolean;
|
|
141
|
+
}) => React.ReactNode;
|
|
142
|
+
/**
|
|
143
|
+
* 下拉菜单最大高度
|
|
144
|
+
* @default {@link DEFAULT_POPUP_MAX_HEIGHT}
|
|
145
|
+
*/
|
|
146
|
+
popupMaxHeight?: number;
|
|
147
|
+
/** 最多可选中的数量 */
|
|
148
|
+
tagMaxCount?: number;
|
|
149
|
+
/** 最大标签数量 */
|
|
150
|
+
maxTagCount?: number | 'responsive' | 'all';
|
|
151
|
+
/** 超出最大数量时的占位符 */
|
|
152
|
+
maxTagPlaceholder?: React.ReactNode | ((omittedItems: OptionType[]) => React.ReactNode);
|
|
153
|
+
/** 最大标签文本长度 */
|
|
154
|
+
maxTagTextLength?: number;
|
|
155
|
+
/** 自定义标签渲染 */
|
|
156
|
+
tagRender?: (option: OptionType, props: {
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
onClose: () => void;
|
|
159
|
+
closable: boolean;
|
|
160
|
+
}) => React.ReactNode;
|
|
161
|
+
/** 根元素自定义样式 */
|
|
162
|
+
style?: StyleProp<ViewStyle>;
|
|
163
|
+
/** 前缀元素样式 */
|
|
164
|
+
prefixStyle?: StyleProp<ViewStyle>;
|
|
165
|
+
/** 内容容器样式 */
|
|
166
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
167
|
+
/** 占位符样式 */
|
|
168
|
+
placeholderStyle?: StyleProp<TextStyle>;
|
|
169
|
+
/** 输入框样式 */
|
|
170
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
171
|
+
/** 多选标签项容器样式 */
|
|
172
|
+
tagItemStyle?: StyleProp<ViewStyle>;
|
|
173
|
+
/** 多选标签文本内容样式 */
|
|
174
|
+
tagContentStyle?: StyleProp<TextStyle>;
|
|
175
|
+
/** 多选标签删除按钮样式 */
|
|
176
|
+
tagRemoveStyle?: StyleProp<ViewStyle>;
|
|
177
|
+
/** 多选标签整体容器样式 */
|
|
178
|
+
tagContainerStyle?: StyleProp<ViewStyle>;
|
|
179
|
+
/** 后缀元素样式 */
|
|
180
|
+
suffixStyle?: StyleProp<ViewStyle>;
|
|
181
|
+
/** 清除按钮样式 */
|
|
182
|
+
clearStyle?: StyleProp<ViewStyle>;
|
|
183
|
+
/** 弹出菜单容器样式 */
|
|
184
|
+
popupRootStyle?: StyleProp<ViewStyle>;
|
|
185
|
+
/** 弹出菜单列表样式 */
|
|
186
|
+
popupListStyle?: StyleProp<ViewStyle>;
|
|
187
|
+
/** 弹出菜单条目样式 */
|
|
188
|
+
popupListItemStyle?: StyleProp<ViewStyle>;
|
|
189
|
+
/** 分组标签样式 */
|
|
190
|
+
popupGroupLabelStyle?: StyleProp<TextStyle>;
|
|
191
|
+
/** 键盘和鼠标交互时触发 */
|
|
192
|
+
onActive?: (value: ValueType) => void;
|
|
193
|
+
/** 选中值变化时回调 */
|
|
194
|
+
onChange?: (value: RealValueType) => void;
|
|
195
|
+
/** 清除内容时回调 */
|
|
196
|
+
onClear?: () => void;
|
|
197
|
+
/** 取消选中时回调(仅 multiple/tags 模式) */
|
|
198
|
+
onDeselect?: (value: ValueType) => void;
|
|
199
|
+
/** 展开下拉菜单的回调 */
|
|
200
|
+
onOpenChange?: (open: boolean) => void;
|
|
201
|
+
/** 被选中时回调 */
|
|
202
|
+
onSelect?: (value: ValueType, option: OptionType) => void;
|
|
203
|
+
/** 创建新选项时回调(仅 tags 模式) */
|
|
204
|
+
onCreateOption?: (inputValue: string) => OptionType | void;
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,iBA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;IAC1B,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAAC;CAC5D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const useTabsStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
2
|
+
container: {
|
|
3
|
+
width: "100%";
|
|
4
|
+
};
|
|
5
|
+
tabItem: {
|
|
6
|
+
paddingVertical: number;
|
|
7
|
+
paddingHorizontal: number;
|
|
8
|
+
};
|
|
9
|
+
labelText: {
|
|
10
|
+
color: "rgba(0, 0, 0, 0.6)";
|
|
11
|
+
};
|
|
12
|
+
labelTab: {
|
|
13
|
+
paddingHorizontal: number;
|
|
14
|
+
paddingVertical: number;
|
|
15
|
+
borderWidth: number;
|
|
16
|
+
borderColor: "rgba(243, 243, 244, 1)";
|
|
17
|
+
backgroundColor: "rgba(243, 243, 244, 1)";
|
|
18
|
+
borderRadius: 4;
|
|
19
|
+
gap: number;
|
|
20
|
+
};
|
|
21
|
+
labelTabActive: {
|
|
22
|
+
backgroundColor: "rgba(241, 248, 255, 1)";
|
|
23
|
+
borderColor: "rgba(43, 152, 254, 1)";
|
|
24
|
+
};
|
|
25
|
+
labelTextActive: {
|
|
26
|
+
color: "rgba(43, 152, 254, 1)";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/tabs/style/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BxB,CAAC"}
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
/** 标签文本 */
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
/** 标签值,唯一标识 */
|
|
6
|
+
value: string | number;
|
|
7
|
+
/** 徽标内容(数字或红点) */
|
|
8
|
+
badge?: number | boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TabsProps {
|
|
11
|
+
/** 标签数据 */
|
|
12
|
+
tabs: TabItem[];
|
|
13
|
+
/** 当前激活的标签值(受控) */
|
|
14
|
+
value?: string | number;
|
|
15
|
+
/** 默认激活的标签值(非受控) */
|
|
16
|
+
defaultValue?: string | number;
|
|
17
|
+
/** 标签切换回调 */
|
|
18
|
+
onChange?: (value: string | number) => void;
|
|
19
|
+
/** 样式类型 */
|
|
20
|
+
variant?: 'underline' | 'label';
|
|
21
|
+
/** 容器样式 */
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
/** 右侧操作区域 */
|
|
24
|
+
extra?: React.ReactNode;
|
|
25
|
+
/** 是否均分宽度(仅 underline 和 isometric 支持) */
|
|
26
|
+
equalWidth?: boolean;
|
|
5
27
|
}
|
|
6
28
|
export declare const Tabs: React.FC<TabsProps>;
|
|
7
|
-
export {};
|
|
8
29
|
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/tabs/tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/tabs/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,MAAM,WAAW,OAAO;IACtB,WAAW;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,eAAe;IACf,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,WAAW;IACX,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,aAAa;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW;IACX,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAChC,WAAW;IACX,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA0NpC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type PortalHostProps } from '#components/base';
|
|
2
3
|
import { type ThemeConfig } from '#shared/theme';
|
|
3
4
|
import { type ConfigContextValue, type RequestInstance } from './contexts';
|
|
4
5
|
import { type ErrorBoundaryProps } from './error-boundary';
|
|
@@ -13,6 +14,7 @@ export interface NativeProviderProps {
|
|
|
13
14
|
errorBoundary?: Omit<ErrorBoundaryProps, 'children'>;
|
|
14
15
|
/** 导航配置 */
|
|
15
16
|
navigators?: ConfigContextValue['navigators'];
|
|
17
|
+
portalHostProps: PortalHostProps;
|
|
16
18
|
}
|
|
17
19
|
export declare const NativeProvider: React.FC<NativeProviderProps>;
|
|
18
20
|
//# sourceMappingURL=native-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-provider.d.ts","sourceRoot":"","sources":["../../../src/native-provider/native-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"native-provider.d.ts","sourceRoot":"","sources":["../../../src/native-provider/native-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG1E,MAAM,WAAW,mBAAmB;IAClC,UAAU;IACV,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW;IACX,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW;IACX,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,aAAa;IACb,aAAa,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACrD,WAAW;IACX,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,mBAAmB,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 浅比较两个对象是否相等
|
|
3
|
+
*
|
|
4
|
+
* 仅比较对象的第一层属性,使用严格相等(===)进行比较。
|
|
5
|
+
* 不会递归比较嵌套对象或数组的内容。
|
|
6
|
+
*
|
|
7
|
+
* @param a - 第一个对象
|
|
8
|
+
* @param b - 第二个对象
|
|
9
|
+
* @returns 如果两个对象的所有第一层属性都相等则返回 true,否则返回 false。如果 a/b 有一个非对象,则直接比较二者
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* shallowEqual({ a: 1, b: 2 }, { a: 1, b: 2 }); // true
|
|
13
|
+
* shallowEqual({ a: 1 }, { a: 1, b: 2 }); // false
|
|
14
|
+
* shallowEqual({ a: { x: 1 } }, { a: { x: 1 } }); // false
|
|
15
|
+
* shallowEqual(null, null); // true
|
|
16
|
+
* shallowEqual(null, undefined); // false
|
|
17
|
+
* shallowEqual(1, 1); // true
|
|
18
|
+
* shallowEqual(1, '1'); // false
|
|
19
|
+
*/
|
|
20
|
+
export declare const shallowEqual: (a?: object, b?: object) => boolean;
|
|
21
|
+
//# sourceMappingURL=object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/object.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,KAAG,OAerD,CAAC"}
|
package/package.json
CHANGED
|
@@ -22,12 +22,14 @@ export * from './link';
|
|
|
22
22
|
export * from './loading';
|
|
23
23
|
export * from './modal';
|
|
24
24
|
export * from './nav-bar';
|
|
25
|
+
export * from './overflow';
|
|
25
26
|
export * from './picker';
|
|
26
27
|
export * from './picker-backup';
|
|
27
28
|
export * from './picker-view';
|
|
28
29
|
export * from './portal';
|
|
29
30
|
export * from './radio';
|
|
30
31
|
export * from './result';
|
|
32
|
+
export * from './select';
|
|
31
33
|
export * from './surface';
|
|
32
34
|
export * from './switch';
|
|
33
35
|
export * from './tabs';
|
|
@@ -194,7 +194,9 @@ export const BaseInput: React.FC<BaseInputProps> = ({
|
|
|
194
194
|
if (!elementState.current.pointerDown) {
|
|
195
195
|
props.onBlur?.(event);
|
|
196
196
|
setInputIsFocused(false);
|
|
197
|
-
|
|
197
|
+
if (inputValue && inputValue?.trimEnd() !== inputValue) {
|
|
198
|
+
setInputValue(inputValue?.trimEnd());
|
|
199
|
+
}
|
|
198
200
|
} else {
|
|
199
201
|
inputRef.current?.focus();
|
|
200
202
|
}
|
|
@@ -203,7 +205,7 @@ export const BaseInput: React.FC<BaseInputProps> = ({
|
|
|
203
205
|
};
|
|
204
206
|
}}
|
|
205
207
|
/>
|
|
206
|
-
{
|
|
208
|
+
{hasSuffixNode && (
|
|
207
209
|
<Flex align="center" gap={theme.spacing.sm}>
|
|
208
210
|
{!!props.allowClear && (
|
|
209
211
|
<Animated.View
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { type useOverflowStyles } from './style';
|
|
5
|
+
import type { OverflowProps } from './types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 全部显示模式组件
|
|
9
|
+
*/
|
|
10
|
+
export const AllModeOverflow = <ItemType = unknown,>({
|
|
11
|
+
data,
|
|
12
|
+
renderItem,
|
|
13
|
+
prefix,
|
|
14
|
+
suffix,
|
|
15
|
+
style,
|
|
16
|
+
prefixStyle,
|
|
17
|
+
itemStyle,
|
|
18
|
+
suffixStyle,
|
|
19
|
+
onVisibleCountChange,
|
|
20
|
+
styles,
|
|
21
|
+
getKey,
|
|
22
|
+
}: OverflowProps<ItemType> & {
|
|
23
|
+
styles: ReturnType<typeof useOverflowStyles>;
|
|
24
|
+
getKey: (item: ItemType, index: number) => React.Key;
|
|
25
|
+
}) => {
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
onVisibleCountChange?.(data.length);
|
|
28
|
+
}, [data.length, onVisibleCountChange]);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={[styles.container, style]}>
|
|
32
|
+
{/* 前缀 */}
|
|
33
|
+
{prefix && <View style={[styles.item, prefixStyle]}>{prefix}</View>}
|
|
34
|
+
|
|
35
|
+
{/* 显示所有元素 */}
|
|
36
|
+
{data.map((item, index) => {
|
|
37
|
+
const key = getKey(item, index);
|
|
38
|
+
return (
|
|
39
|
+
<View key={key} style={[styles.item, itemStyle]}>
|
|
40
|
+
{renderItem(item, { index })}
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
})}
|
|
44
|
+
|
|
45
|
+
{/* 后缀 */}
|
|
46
|
+
{suffix && <View style={[styles.item, suffixStyle]}>{suffix}</View>}
|
|
47
|
+
</View>
|
|
48
|
+
);
|
|
49
|
+
};
|