@seakoi/native-ui 1.1.3 → 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 +52 -0
- package/dist/commonjs/components/base/carousel/carousel-indicator.js +56 -0
- package/dist/commonjs/components/base/carousel/carousel-slides.js +140 -0
- package/dist/commonjs/components/base/carousel/carousel.js +114 -122
- package/dist/commonjs/components/base/carousel/hooks/index.js +0 -14
- package/dist/commonjs/components/base/carousel/hooks/use-carousel-index.js +16 -13
- package/dist/commonjs/components/base/carousel/hooks/use-carousel-lifecycle.js +6 -2
- package/dist/commonjs/components/base/carousel/hooks/use-carousel-pan-responder.js +40 -12
- package/dist/commonjs/components/base/carousel/hooks/use-carousel-position.js +6 -2
- package/dist/commonjs/components/base/carousel/index.js +1 -15
- package/dist/commonjs/components/base/carousel/style/index.js +12 -0
- package/dist/commonjs/components/base/date-picker/date-picker.js +56 -44
- package/dist/commonjs/components/base/date-picker/date-range-picker.js +142 -50
- package/dist/commonjs/components/base/date-picker/style/index.js +15 -0
- package/dist/commonjs/components/base/date-picker-view/date-picker-view.js +19 -53
- package/dist/commonjs/components/base/date-picker-view/index.js +0 -22
- package/dist/commonjs/components/base/index.js +53 -9
- 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/index.js +26 -4
- package/dist/commonjs/components/base/picker/picker-content.js +64 -0
- package/dist/commonjs/components/base/picker/picker-context.js +9 -0
- package/dist/commonjs/components/base/picker/picker-field.js +39 -0
- package/dist/commonjs/components/base/picker/picker.js +26 -95
- package/dist/commonjs/components/base/picker/style/index.js +8 -4
- package/dist/commonjs/components/base/picker-backup/base-picker-container.js +50 -0
- package/dist/commonjs/components/base/picker-backup/index.js +27 -0
- package/dist/commonjs/components/base/picker-backup/picker-backup.js +75 -0
- package/dist/commonjs/components/base/picker-backup/picker-copy.js +106 -0
- package/dist/commonjs/components/base/{picker → picker-backup}/picker-trigger.js +5 -5
- package/dist/commonjs/components/base/picker-backup/style/index.js +19 -0
- package/dist/commonjs/components/base/picker-backup/utils.js +53 -0
- package/dist/commonjs/components/base/picker-view/picker-view-column.js +15 -0
- package/dist/commonjs/components/base/picker-view/picker-view.js +4 -4
- 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/components/base/tag/index.js +20 -0
- package/dist/commonjs/components/base/tag/style/index.js +89 -0
- package/dist/commonjs/components/base/tag/tag-context.js +12 -0
- package/dist/commonjs/components/base/tag/tag-group.js +35 -0
- package/dist/commonjs/components/base/tag/tag.js +47 -0
- package/dist/commonjs/components/base/tag/types.js +5 -0
- 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/carousel/carousel-indicator.js +51 -0
- package/dist/module/components/base/carousel/carousel-slides.js +135 -0
- package/dist/module/components/base/carousel/carousel.js +116 -124
- package/dist/module/components/base/carousel/hooks/index.js +0 -2
- package/dist/module/components/base/carousel/hooks/use-carousel-index.js +15 -11
- package/dist/module/components/base/carousel/hooks/use-carousel-lifecycle.js +6 -2
- package/dist/module/components/base/carousel/hooks/use-carousel-pan-responder.js +40 -11
- package/dist/module/components/base/carousel/hooks/use-carousel-position.js +5 -1
- package/dist/module/components/base/carousel/index.js +1 -5
- package/dist/module/components/base/carousel/style/index.js +12 -0
- package/dist/module/components/base/date-picker/date-picker.js +60 -48
- package/dist/module/components/base/date-picker/date-range-picker.js +146 -54
- package/dist/module/components/base/date-picker/style/index.js +11 -0
- package/dist/module/components/base/date-picker-view/date-picker-view.js +23 -57
- package/dist/module/components/base/date-picker-view/index.js +1 -3
- package/dist/module/components/base/index.js +4 -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/index.js +9 -1
- package/dist/module/components/base/picker/picker-content.js +58 -0
- package/dist/module/components/base/picker/picker-context.js +4 -0
- package/dist/module/components/base/picker/picker-field.js +34 -0
- package/dist/module/components/base/picker/picker.js +29 -98
- package/dist/module/components/base/picker/style/index.js +7 -3
- package/dist/module/components/base/picker-backup/base-picker-container.js +44 -0
- package/dist/module/components/base/picker-backup/index.js +4 -0
- package/dist/module/components/base/picker-backup/picker-backup.js +69 -0
- package/dist/module/components/base/picker-backup/picker-copy.js +101 -0
- package/dist/module/components/base/{picker → picker-backup}/picker-trigger.js +2 -2
- package/dist/module/components/base/picker-backup/style/index.js +15 -0
- package/dist/module/components/base/picker-backup/utils.js +48 -0
- package/dist/module/components/base/picker-view/picker-view-column.js +15 -0
- package/dist/module/components/base/picker-view/picker-view.js +4 -4
- 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/components/base/tag/index.js +5 -0
- package/dist/module/components/base/tag/style/index.js +85 -0
- package/dist/module/components/base/tag/tag-context.js +8 -0
- package/dist/module/components/base/tag/tag-group.js +29 -0
- package/dist/module/components/base/tag/tag.js +41 -0
- package/dist/module/components/base/tag/types.js +3 -0
- 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/carousel/carousel-indicator.d.ts +42 -0
- package/dist/typescript/components/base/carousel/carousel-indicator.d.ts.map +1 -0
- package/dist/typescript/components/base/carousel/carousel-slides.d.ts +49 -0
- package/dist/typescript/components/base/carousel/carousel-slides.d.ts.map +1 -0
- package/dist/typescript/components/base/carousel/carousel.d.ts +16 -11
- package/dist/typescript/components/base/carousel/carousel.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/hooks/index.d.ts +0 -2
- package/dist/typescript/components/base/carousel/hooks/index.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/hooks/use-carousel-index.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/hooks/use-carousel-lifecycle.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/hooks/use-carousel-pan-responder.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/hooks/use-carousel-position.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/index.d.ts +1 -4
- package/dist/typescript/components/base/carousel/index.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/style/index.d.ts +12 -0
- package/dist/typescript/components/base/carousel/style/index.d.ts.map +1 -1
- package/dist/typescript/components/base/carousel/types.d.ts +8 -17
- package/dist/typescript/components/base/carousel/types.d.ts.map +1 -1
- package/dist/typescript/components/base/date-picker/date-picker.d.ts +4 -2
- package/dist/typescript/components/base/date-picker/date-picker.d.ts.map +1 -1
- package/dist/typescript/components/base/date-picker/date-range-picker.d.ts +12 -3
- package/dist/typescript/components/base/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/typescript/components/base/date-picker/style/index.d.ts +9 -0
- package/dist/typescript/components/base/date-picker/style/index.d.ts.map +1 -0
- package/dist/typescript/components/base/date-picker-view/date-picker-view.d.ts +1 -6
- package/dist/typescript/components/base/date-picker-view/date-picker-view.d.ts.map +1 -1
- package/dist/typescript/components/base/date-picker-view/index.d.ts +0 -2
- package/dist/typescript/components/base/date-picker-view/index.d.ts.map +1 -1
- package/dist/typescript/components/base/date-picker-view/types.d.ts +1 -1
- package/dist/typescript/components/base/index.d.ts +4 -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/index.d.ts +7 -1
- package/dist/typescript/components/base/picker/index.d.ts.map +1 -1
- package/dist/typescript/components/base/picker/picker-content.d.ts +27 -0
- package/dist/typescript/components/base/picker/picker-content.d.ts.map +1 -0
- package/dist/typescript/components/base/picker/picker-context.d.ts +18 -0
- package/dist/typescript/components/base/picker/picker-context.d.ts.map +1 -0
- package/dist/typescript/components/base/picker/picker-field.d.ts +10 -0
- package/dist/typescript/components/base/picker/picker-field.d.ts.map +1 -0
- package/dist/typescript/components/base/picker/picker.d.ts +22 -11
- package/dist/typescript/components/base/picker/picker.d.ts.map +1 -1
- package/dist/typescript/components/base/picker/style/index.d.ts +6 -2
- package/dist/typescript/components/base/picker/style/index.d.ts.map +1 -1
- package/dist/typescript/components/base/picker-backup/base-picker-container.d.ts +15 -0
- package/dist/typescript/components/base/picker-backup/base-picker-container.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-backup/index.d.ts +3 -0
- package/dist/typescript/components/base/picker-backup/index.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-backup/picker-backup.d.ts +26 -0
- package/dist/typescript/components/base/picker-backup/picker-backup.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-backup/picker-copy.d.ts +13 -0
- package/dist/typescript/components/base/picker-backup/picker-copy.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-backup/picker-trigger.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-backup/style/index.d.ts +13 -0
- package/dist/typescript/components/base/picker-backup/style/index.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-backup/utils.d.ts +8 -0
- package/dist/typescript/components/base/picker-backup/utils.d.ts.map +1 -0
- package/dist/typescript/components/base/picker-view/picker-view-column.d.ts.map +1 -1
- package/dist/typescript/components/base/picker-view/utils/picker.d.ts +3 -3
- package/dist/typescript/components/base/picker-view/utils/picker.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/components/base/tag/index.d.ts +5 -0
- package/dist/typescript/components/base/tag/index.d.ts.map +1 -0
- package/dist/typescript/components/base/tag/style/index.d.ts +61 -0
- package/dist/typescript/components/base/tag/style/index.d.ts.map +1 -0
- package/dist/typescript/components/base/tag/tag-context.d.ts +3 -0
- package/dist/typescript/components/base/tag/tag-context.d.ts.map +1 -0
- package/dist/typescript/components/base/tag/tag-group.d.ts +4 -0
- package/dist/typescript/components/base/tag/tag-group.d.ts.map +1 -0
- package/dist/typescript/components/base/tag/tag.d.ts +4 -0
- package/dist/typescript/components/base/tag/tag.d.ts.map +1 -0
- package/dist/typescript/components/base/tag/types.d.ts +48 -0
- package/dist/typescript/components/base/tag/types.d.ts.map +1 -0
- 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/carousel/carousel-indicator.tsx +80 -0
- package/src/components/base/carousel/carousel-slides.tsx +177 -0
- package/src/components/base/carousel/carousel.tsx +108 -118
- package/src/components/base/carousel/hooks/index.ts +0 -2
- package/src/components/base/carousel/hooks/use-carousel-index.ts +13 -9
- package/src/components/base/carousel/hooks/use-carousel-lifecycle.ts +4 -3
- package/src/components/base/carousel/hooks/use-carousel-pan-responder.ts +40 -16
- package/src/components/base/carousel/hooks/use-carousel-position.ts +4 -1
- package/src/components/base/carousel/index.ts +1 -3
- package/src/components/base/carousel/style/index.ts +12 -0
- package/src/components/base/carousel/types.ts +8 -21
- package/src/components/base/date-picker/date-picker.tsx +64 -61
- package/src/components/base/date-picker/date-range-picker.tsx +178 -70
- package/src/components/base/date-picker/style/index.ts +10 -0
- package/src/components/base/date-picker-view/date-picker-view.tsx +21 -68
- package/src/components/base/date-picker-view/index.ts +0 -2
- package/src/components/base/date-picker-view/types.ts +1 -1
- package/src/components/base/index.ts +4 -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/index.ts +11 -1
- package/src/components/base/picker/picker-content.tsx +90 -0
- package/src/components/base/picker/picker-context.ts +19 -0
- package/src/components/base/picker/picker-field.tsx +56 -0
- package/src/components/base/picker/picker.tsx +49 -116
- package/src/components/base/picker/style/index.ts +4 -2
- package/src/components/base/picker-backup/base-picker-container.tsx +55 -0
- package/src/components/base/picker-backup/index.ts +2 -0
- package/src/components/base/picker-backup/picker-backup.tsx +110 -0
- package/src/components/base/picker-backup/picker-copy.tsx +125 -0
- package/src/components/base/{picker → picker-backup}/picker-trigger.tsx +2 -2
- package/src/components/base/picker-backup/style/index.ts +14 -0
- package/src/components/base/picker-backup/utils.ts +62 -0
- package/src/components/base/picker-view/picker-view-column.tsx +20 -0
- package/src/components/base/picker-view/picker-view.tsx +4 -4
- package/src/components/base/picker-view/utils/picker.ts +3 -5
- 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/components/base/tag/index.ts +5 -0
- package/src/components/base/tag/style/index.tsx +84 -0
- package/src/components/base/tag/tag-context.ts +9 -0
- package/src/components/base/tag/tag-group.tsx +31 -0
- package/src/components/base/tag/tag.tsx +50 -0
- package/src/components/base/tag/types.ts +71 -0
- 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
- package/dist/commonjs/components/base/carousel/carousel-item.js +0 -45
- package/dist/commonjs/components/base/carousel/constants.js +0 -25
- package/dist/commonjs/components/base/carousel/hooks/use-carousel-indicator.js +0 -63
- package/dist/commonjs/components/base/carousel/hooks/use-carousel-slides.js +0 -95
- package/dist/commonjs/components/base/carousel/utils.js +0 -63
- package/dist/commonjs/components/base/date-picker-view/date-range-picker-view.js +0 -145
- package/dist/commonjs/components/base/date-picker-view/date-time-picker.js +0 -39
- package/dist/module/components/base/carousel/carousel-item.js +0 -40
- package/dist/module/components/base/carousel/constants.js +0 -21
- package/dist/module/components/base/carousel/hooks/use-carousel-indicator.js +0 -58
- package/dist/module/components/base/carousel/hooks/use-carousel-slides.js +0 -90
- package/dist/module/components/base/carousel/utils.js +0 -55
- package/dist/module/components/base/date-picker-view/date-range-picker-view.js +0 -138
- package/dist/module/components/base/date-picker-view/date-time-picker.js +0 -34
- package/dist/typescript/components/base/carousel/carousel-item.d.ts +0 -26
- package/dist/typescript/components/base/carousel/carousel-item.d.ts.map +0 -1
- package/dist/typescript/components/base/carousel/constants.d.ts +0 -17
- package/dist/typescript/components/base/carousel/constants.d.ts.map +0 -1
- package/dist/typescript/components/base/carousel/hooks/use-carousel-indicator.d.ts +0 -37
- package/dist/typescript/components/base/carousel/hooks/use-carousel-indicator.d.ts.map +0 -1
- package/dist/typescript/components/base/carousel/hooks/use-carousel-slides.d.ts +0 -51
- package/dist/typescript/components/base/carousel/hooks/use-carousel-slides.d.ts.map +0 -1
- package/dist/typescript/components/base/carousel/utils.d.ts +0 -25
- package/dist/typescript/components/base/carousel/utils.d.ts.map +0 -1
- package/dist/typescript/components/base/date-picker-view/date-range-picker-view.d.ts +0 -26
- package/dist/typescript/components/base/date-picker-view/date-range-picker-view.d.ts.map +0 -1
- package/dist/typescript/components/base/date-picker-view/date-time-picker.d.ts +0 -3
- package/dist/typescript/components/base/date-picker-view/date-time-picker.d.ts.map +0 -1
- package/dist/typescript/components/base/picker/picker-trigger.d.ts.map +0 -1
- package/src/components/base/carousel/carousel-item.tsx +0 -35
- package/src/components/base/carousel/constants.ts +0 -19
- package/src/components/base/carousel/hooks/use-carousel-indicator.tsx +0 -84
- package/src/components/base/carousel/hooks/use-carousel-slides.tsx +0 -131
- package/src/components/base/carousel/utils.ts +0 -55
- package/src/components/base/date-picker-view/date-range-picker-view.tsx +0 -191
- package/src/components/base/date-picker-view/date-time-picker.tsx +0 -34
- /package/dist/typescript/components/base/{picker → picker-backup}/picker-trigger.d.ts +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ModalProps } from '../modal';
|
|
3
|
+
import { type PickerTriggerProps } from './picker-trigger';
|
|
4
|
+
export interface PickerController {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
/** 控制弹窗 */
|
|
7
|
+
setVisible: (v: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface BasePickerContainerProps {
|
|
10
|
+
children: (controller: PickerController) => React.ReactNode;
|
|
11
|
+
pickerTriggerProps?: PickerTriggerProps;
|
|
12
|
+
modalProps?: ModalProps;
|
|
13
|
+
}
|
|
14
|
+
export declare const BasePickerContainer: ({ children, pickerTriggerProps, modalProps, }: BasePickerContainerProps) => React.JSX.Element;
|
|
15
|
+
//# sourceMappingURL=base-picker-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-picker-container.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-backup/base-picker-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IAEjB,WAAW;IACX,UAAU,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5D,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,eAAO,MAAM,mBAAmB,GAAI,+CAIjC,wBAAwB,sBA8B1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-backup/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AnyObject } from '#shared/utils/types';
|
|
3
|
+
import type { PickerMergeProps } from '../picker/picker';
|
|
4
|
+
import { type Column, type PickerOption, type PickerValue, type PickerViewProps } from '../picker-view';
|
|
5
|
+
export interface FieldNames {
|
|
6
|
+
/** 选项文本对应的字段名 @default 'label' */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** 选项值对应的字段名 @default 'value' */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** 级联子选项对应的字段名 @default 'children' */
|
|
11
|
+
children?: string;
|
|
12
|
+
}
|
|
13
|
+
export type ColumnInput = Column | AnyObject | AnyObject[];
|
|
14
|
+
export interface PickerBackupProps extends PickerMergeProps<PickerValue[]>, Omit<PickerViewProps, 'onChange' | 'columns'> {
|
|
15
|
+
formatter?: (value: PickerValue[], options: PickerOption[]) => React.ReactNode;
|
|
16
|
+
confirmText?: string;
|
|
17
|
+
/** 选择器列,支持标准格式或自定义字段名格式(需配合 fieldNames 使用) */
|
|
18
|
+
columns: ColumnInput[];
|
|
19
|
+
/**
|
|
20
|
+
* 自定义字段名,用于映射数据中的属性到组件内部使用的标准字段
|
|
21
|
+
* @example { label: 'name', value: 'id', children: 'items' }
|
|
22
|
+
*/
|
|
23
|
+
fieldNames?: FieldNames;
|
|
24
|
+
}
|
|
25
|
+
export declare const PickerBackup: React.FC<PickerBackupProps>;
|
|
26
|
+
//# sourceMappingURL=picker-backup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-backup.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-backup/picker-backup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;AAE3D,MAAM,WAAW,iBACf,SAAQ,gBAAgB,CAAC,WAAW,EAAE,CAAC,EACrC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkEpD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ModalHeaderBaseProps } from '../modal';
|
|
2
|
+
import { type PickerOption, type PickerValue, type PickerViewProps } from '../picker-view';
|
|
3
|
+
import { type PickerTriggerControlledProps } from './picker-trigger';
|
|
4
|
+
export interface PickerProps extends PickerTriggerControlledProps<PickerValue[]>, Omit<PickerViewProps, 'onChange' | 'value' | 'defaultValue'>, Pick<ModalHeaderBaseProps, 'title'> {
|
|
5
|
+
/**
|
|
6
|
+
* 自定义格式化函数
|
|
7
|
+
*/
|
|
8
|
+
formatter?: (value: PickerValue[], options: PickerOption[]) => React.ReactNode;
|
|
9
|
+
/** 确定按钮文案 */
|
|
10
|
+
confirmText?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Picker: React.FC<PickerProps>;
|
|
13
|
+
//# sourceMappingURL=picker-copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-copy.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-backup/picker-copy.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAiB,KAAK,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAEpF,MAAM,WAAW,WACf,SAAQ,4BAA4B,CAAC,WAAW,EAAE,CAAC,EACjD,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,GAAG,cAAc,CAAC,EAC5D,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/E,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgGxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-trigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-backup/picker-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAShF,yBAAyB;AACzB,MAAM,WAAW,kBAAkB;IACjC,YAAY;IACZ,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B,CAAC,CAAC,CAC7C,SAAQ,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,SAAS,CAAC;IAC3D,gBAAgB;IAChB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,cAAc;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,eAAe;IACf,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmDtD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const usePickerFieldStyles: (options?: import("../../../../shared/utils").AnyObject | undefined) => {
|
|
2
|
+
container: {
|
|
3
|
+
flex: number;
|
|
4
|
+
alignSelf: "stretch";
|
|
5
|
+
backgroundColor: "rgba(255, 255, 255, 1)";
|
|
6
|
+
paddingVertical: number;
|
|
7
|
+
paddingHorizontal: number;
|
|
8
|
+
};
|
|
9
|
+
disabled: {
|
|
10
|
+
backgroundColor: "rgba(238, 238, 240, 1)";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/picker-backup/style/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;;;;;;;;;;CAW9B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Column } from '../picker-view/types';
|
|
2
|
+
import type { ColumnInput, FieldNames } from './picker-backup';
|
|
3
|
+
/**
|
|
4
|
+
* 将自定义字段名的数据标准化为内部使用的 { label, value, children } 格式
|
|
5
|
+
* 如果 fieldNames 与默认值相同,则直接返回原始数据(零开销)
|
|
6
|
+
*/
|
|
7
|
+
export declare const normalizeColumns: (columns: ColumnInput[], fieldNames?: FieldNames) => Column[];
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-backup/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,MAAM,EAGZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAS/D;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,WAAW,EAAE,EACtB,aAAa,UAAU,KACtB,MAAM,EAsCR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker-view-column.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-view/picker-view-column.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGrD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"picker-view-column.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/picker-view/picker-view-column.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGrD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyI5D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Column, PickerOption, PickerOptionCascade, PickerOptionType, PickerValue
|
|
1
|
+
import type { Column, PickerOption, PickerOptionCascade, PickerOptionType, PickerValue } from '../types';
|
|
2
2
|
export declare const getVisibleItemCount: (n: number) => number;
|
|
3
3
|
/**
|
|
4
4
|
* 获取当前选项是什么数据
|
|
@@ -21,9 +21,9 @@ export declare const findDefaultValue: (value: PickerValue, options: PickerOptio
|
|
|
21
21
|
/**
|
|
22
22
|
* 根据 value 和 columns 计算对应的 options
|
|
23
23
|
*/
|
|
24
|
-
export declare const findOptionsByValue: (value: PickerValue[], columns:
|
|
24
|
+
export declare const findOptionsByValue: (value: PickerValue[], columns: Column[]) => PickerOption[];
|
|
25
25
|
/**
|
|
26
26
|
* 获取 columns 的默认值(每列的第一个选项)
|
|
27
27
|
*/
|
|
28
|
-
export declare const getDefaultValues: (columns:
|
|
28
|
+
export declare const getDefaultValues: (columns: Column[]) => PickerValue[];
|
|
29
29
|
//# sourceMappingURL=picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/picker-view/utils/picker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,
|
|
1
|
+
{"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/picker-view/utils/picker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,mBAAmB,GAAI,GAAG,MAAM,WAK5C,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,KAAG,gBAc/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,gBAAgB,EAC1B,SAAS,MAAM,EAAE,EACjB,SAAS,WAAW,EAAE,KACrB,CAAC,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,WAAW,EAAE,CAsCjD,CAAC;AAEF,yBAAyB;AACzB,eAAO,MAAM,sBAAsB,GACjC,SAAS,mBAAmB,EAAE,EAC9B,QAAQ,WAAW,EAAE,qBAetB,CAAC;AAEF,mBAAmB;AACnB,eAAO,MAAM,kBAAkB,GAAI,SAAS,mBAAmB,EAAE;;;CAqBhE,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,WAAW,EAAE,EACrB,SAAS,YAAY,EAAE,EAAE,KACxB,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAM1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,WAAW,EAAE,SAAS,YAAY,EAAE,uBAgB3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,WAAW,EAAE,EACpB,SAAS,MAAM,EAAE,KAChB,YAAY,EAkCd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,KAAG,WAAW,EAkB/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-host.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/portal/portal-host.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal-host.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/portal/portal-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAgBf,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6GhD,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
3
|
import { type PortalMethods } from './portal-context';
|
|
3
4
|
export declare const DEFAULT_PORTAL_HOST = "default";
|
|
4
5
|
export interface PortalHostProps extends PropsWithChildren {
|
|
5
6
|
name?: string;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
6
8
|
}
|
|
7
9
|
export interface PortalProps {
|
|
8
10
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/portal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/portal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IAExD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { GestureResponderEvent } from 'react-native';
|
|
2
|
+
import type { SelectMode, SelectOption } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 选项操作 Hook 参数
|
|
5
|
+
*
|
|
6
|
+
* @template ValueType - 选项值的类型
|
|
7
|
+
*/
|
|
8
|
+
export interface UseSelectActionsParams<ValueType = unknown, RealValueType = unknown> {
|
|
9
|
+
/**
|
|
10
|
+
* 当前值
|
|
11
|
+
*/
|
|
12
|
+
value: RealValueType;
|
|
13
|
+
/**
|
|
14
|
+
* 选择模式
|
|
15
|
+
*/
|
|
16
|
+
mode?: SelectMode;
|
|
17
|
+
/**
|
|
18
|
+
* 是否禁用
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 最大选择数量
|
|
23
|
+
*/
|
|
24
|
+
maxCount?: number;
|
|
25
|
+
/**
|
|
26
|
+
* 自动清空搜索
|
|
27
|
+
*/
|
|
28
|
+
autoClearSearchValue?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 设置值
|
|
31
|
+
*/
|
|
32
|
+
setValue: (value: RealValueType) => void;
|
|
33
|
+
/**
|
|
34
|
+
* 清空搜索
|
|
35
|
+
*/
|
|
36
|
+
clearSearch: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* 关闭下拉框
|
|
39
|
+
*/
|
|
40
|
+
closePopup: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* 判断选项是否被选中
|
|
43
|
+
*/
|
|
44
|
+
isOptionSelected: (option: SelectOption<ValueType>) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 激活回调
|
|
47
|
+
*/
|
|
48
|
+
onActive?: (value: ValueType) => void;
|
|
49
|
+
/**
|
|
50
|
+
* 选择回调
|
|
51
|
+
*/
|
|
52
|
+
onSelect?: (value: ValueType, option: SelectOption<ValueType>) => void;
|
|
53
|
+
/**
|
|
54
|
+
* 取消选择回调
|
|
55
|
+
*/
|
|
56
|
+
onDeselect?: (value: ValueType) => void;
|
|
57
|
+
/**
|
|
58
|
+
* 清除回调
|
|
59
|
+
*/
|
|
60
|
+
onClear?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* 创建选项回调
|
|
63
|
+
*/
|
|
64
|
+
onCreateOption?: (inputValue: string) => SelectOption<ValueType> | void | undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 选项操作 Hook 返回值
|
|
68
|
+
*/
|
|
69
|
+
export interface UseSelectActionsResult<ValueType = unknown> {
|
|
70
|
+
/**
|
|
71
|
+
* 处理选项点击
|
|
72
|
+
*/
|
|
73
|
+
handleOptionPress: (option: SelectOption<ValueType>) => void;
|
|
74
|
+
/**
|
|
75
|
+
* 处理标签移除
|
|
76
|
+
*/
|
|
77
|
+
handleTagClose: (option: SelectOption<ValueType>) => void;
|
|
78
|
+
/**
|
|
79
|
+
* 处理清除
|
|
80
|
+
*/
|
|
81
|
+
handleClear: (e: GestureResponderEvent) => void;
|
|
82
|
+
/**
|
|
83
|
+
* 处理创建新选项
|
|
84
|
+
*/
|
|
85
|
+
handleCreateOption: (searchValue: string) => void;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 选项操作 Hook
|
|
89
|
+
*
|
|
90
|
+
* 封装 Select 组件中与选项操作相关的逻辑,包括:
|
|
91
|
+
* - 选项点击处理
|
|
92
|
+
* - 标签移除处理
|
|
93
|
+
* - 清除操作处理
|
|
94
|
+
* - 创建新选项处理
|
|
95
|
+
*
|
|
96
|
+
* @template ValueType - 选项值的类型
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* const {
|
|
100
|
+
* handleOptionPress,
|
|
101
|
+
* handleTagClose,
|
|
102
|
+
* handleClear,
|
|
103
|
+
* handleCreateOption
|
|
104
|
+
* } = useSelectActions({
|
|
105
|
+
* value,
|
|
106
|
+
* mode,
|
|
107
|
+
* disabled,
|
|
108
|
+
* maxCount,
|
|
109
|
+
* autoClearSearchValue,
|
|
110
|
+
* setValue,
|
|
111
|
+
* clearSearch,
|
|
112
|
+
* closePopup,
|
|
113
|
+
* isOptionSelected,
|
|
114
|
+
* onSelect,
|
|
115
|
+
* onDeselect,
|
|
116
|
+
* onClear
|
|
117
|
+
* });
|
|
118
|
+
*/
|
|
119
|
+
export declare const useSelectActions: <ValueType = unknown, RealValueType = unknown>(params: UseSelectActionsParams<ValueType, RealValueType>) => UseSelectActionsResult<ValueType>;
|
|
120
|
+
/**
|
|
121
|
+
* 搜索配置
|
|
122
|
+
*
|
|
123
|
+
* @template OptionType - 选项类型
|
|
124
|
+
*/
|
|
125
|
+
export interface SelectSearchConfig<OptionType extends SelectOption = SelectOption> {
|
|
126
|
+
/**
|
|
127
|
+
* 是否在选中项后清空搜索框(仅 multiple/tags 模式)
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
autoClearSearchValue?: boolean;
|
|
131
|
+
/** 是否根据输入项进行筛选 */
|
|
132
|
+
filterOption?: boolean | ((inputValue: string, option: OptionType) => boolean);
|
|
133
|
+
/** 搜索时对筛选结果排序 */
|
|
134
|
+
filterSort?: (optionA: OptionType, optionB: OptionType, info: {
|
|
135
|
+
searchValue: string;
|
|
136
|
+
}) => number;
|
|
137
|
+
/** 搜索时过滤对应的 option 属性 */
|
|
138
|
+
optionFilterProp?: string | string[];
|
|
139
|
+
/** 控制搜索文本 */
|
|
140
|
+
searchValue?: string;
|
|
141
|
+
/** 文本框值变化时回调 */
|
|
142
|
+
onSearch?: (value: string) => void;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=use-select-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-select-actions.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/hooks/use-select-actions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CACrC,SAAS,GAAG,OAAO,EACnB,aAAa,GAAG,OAAO;IAEvB;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,gBAAgB,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK,OAAO,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACvE;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,CACf,UAAU,EAAE,MAAM,KACf,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,SAAS,GAAG,OAAO;IACzD;;OAEG;IACH,iBAAiB,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAC1D;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,GAAG,OAAO,EAAE,aAAa,GAAG,OAAO,EAC3E,QAAQ,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC,KACvD,sBAAsB,CAAC,SAAS,CAuGlC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,kBAAkB,CACjC,UAAU,SAAS,YAAY,GAAG,YAAY;IAE9C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC;IAC/E,iBAAiB;IACjB,UAAU,CAAC,EAAE,CACX,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,KAC1B,MAAM,CAAC;IACZ,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACrC,aAAa;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { SelectSearchConfig } from '#components/base/select/hooks/use-select-actions';
|
|
2
|
+
import type { SelectMode, SelectOption, SelectOptionGroup } from '../types';
|
|
3
|
+
export interface SelectFlattenedGroupOption extends Pick<SelectOptionGroup, 'label' | 'key'> {
|
|
4
|
+
/** 是否为分组标题 */
|
|
5
|
+
isGroup?: boolean;
|
|
6
|
+
/** 分组 key */
|
|
7
|
+
groupKey?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 判断选项是否为分组
|
|
11
|
+
*
|
|
12
|
+
* @template ValueType - 选项值的类型
|
|
13
|
+
*/
|
|
14
|
+
export declare const isSelectOptionGroup: <ValueType = unknown, OptionType extends SelectOption<ValueType> = SelectOption<ValueType>>(item: SelectOption<ValueType> | SelectOptionGroup<OptionType>) => item is SelectOptionGroup<OptionType>;
|
|
15
|
+
export declare function isSelectFlattenedGroupOption<OptionType extends SelectOption>(v: SelectFlattenedGroupOption | OptionType): v is SelectFlattenedGroupOption;
|
|
16
|
+
/**
|
|
17
|
+
* Select 选项处理 Hook 参数
|
|
18
|
+
*
|
|
19
|
+
* @template ValueType - 选项值的类型
|
|
20
|
+
* @template OptionType - 选项类型
|
|
21
|
+
* @template M - 选择模式
|
|
22
|
+
* @template RealValueType - 实际值类型
|
|
23
|
+
*/
|
|
24
|
+
export interface UseSelectOptionsParams<ValueType = unknown, OptionType extends SelectOption<ValueType> = SelectOption<ValueType>, M extends SelectMode | undefined = undefined, RealValueType = unknown> extends SelectSearchConfig<OptionType> {
|
|
25
|
+
/**
|
|
26
|
+
* 选项列表
|
|
27
|
+
*/
|
|
28
|
+
options: (OptionType | SelectOptionGroup<OptionType>)[];
|
|
29
|
+
/**
|
|
30
|
+
* 当前选中的值
|
|
31
|
+
*/
|
|
32
|
+
value: RealValueType;
|
|
33
|
+
/**
|
|
34
|
+
* 选择模式
|
|
35
|
+
*/
|
|
36
|
+
mode?: M;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Select 选项处理 Hook 返回值
|
|
40
|
+
*
|
|
41
|
+
* @template ValueType - 选项值的类型
|
|
42
|
+
* @template OptionType - 选项类型
|
|
43
|
+
*/
|
|
44
|
+
export interface UseSelectOptionsResult<ValueType = unknown, OptionType extends SelectOption<ValueType> = SelectOption<ValueType>> {
|
|
45
|
+
/**
|
|
46
|
+
* 扁平化后的选项列表(包含分组标题)
|
|
47
|
+
*/
|
|
48
|
+
flattenedOptions: (OptionType | SelectFlattenedGroupOption)[];
|
|
49
|
+
/**
|
|
50
|
+
* 所有可选项(不包含分组标题)
|
|
51
|
+
*/
|
|
52
|
+
allOptions: SelectOption<ValueType>[];
|
|
53
|
+
/**
|
|
54
|
+
* 过滤后的选项列表
|
|
55
|
+
*/
|
|
56
|
+
filteredOptions: (OptionType | SelectFlattenedGroupOption)[];
|
|
57
|
+
/**
|
|
58
|
+
* 当前选中的选项
|
|
59
|
+
*/
|
|
60
|
+
selectedOptions: OptionType[];
|
|
61
|
+
/**
|
|
62
|
+
* 判断选项是否被选中
|
|
63
|
+
*/
|
|
64
|
+
isOptionSelected: (option: OptionType) => boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Select 选项处理 Hook
|
|
68
|
+
*
|
|
69
|
+
* 封装 Select 组件中与选项相关的逻辑,包括:
|
|
70
|
+
* - 扁平化选项列表
|
|
71
|
+
* - 过滤选项
|
|
72
|
+
* - 获取选中的选项
|
|
73
|
+
* - 判断选项是否被选中
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const {
|
|
77
|
+
* allOptions,
|
|
78
|
+
* filteredOptions,
|
|
79
|
+
* selectedOptions,
|
|
80
|
+
* isOptionSelected
|
|
81
|
+
* } = useSelectOptions({
|
|
82
|
+
* options,
|
|
83
|
+
* value,
|
|
84
|
+
* mode,
|
|
85
|
+
* searchValue,
|
|
86
|
+
* filterOption: true,
|
|
87
|
+
* optionFilterProp: 'label'
|
|
88
|
+
* });
|
|
89
|
+
*/
|
|
90
|
+
export declare const useSelectOptions: <ValueType = unknown, OptionType extends SelectOption<ValueType> = SelectOption<ValueType>, M extends SelectMode | undefined = undefined, RealValueType = unknown>(params: UseSelectOptionsParams<ValueType, OptionType, M, RealValueType>) => UseSelectOptionsResult<ValueType>;
|
|
91
|
+
//# sourceMappingURL=use-select-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-select-options.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/hooks/use-select-options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAE3F,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE5E,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,KAAK,CAAC;IAChD,cAAc;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,GAAG,OAAO,EACnB,UAAU,SAAS,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,EAEpE,MAAM,YAAY,CAAC,SAAS,CAAC,GAAG,iBAAiB,CAAC,UAAU,CAAC,KAC5D,IAAI,IAAI,iBAAiB,CAAC,UAAU,CAEtC,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,UAAU,SAAS,YAAY,EAC1E,CAAC,EAAE,0BAA0B,GAAG,UAAU,GACzC,CAAC,IAAI,0BAA0B,CAEjC;AAQD;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB,CACrC,SAAS,GAAG,OAAO,EACnB,UAAU,SAAS,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,EACpE,CAAC,SAAS,UAAU,GAAG,SAAS,GAAG,SAAS,EAC5C,aAAa,GAAG,OAAO,CACvB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;IACtC;;OAEG;IACH,OAAO,EAAE,CAAC,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;IACxD;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB,CACrC,SAAS,GAAG,OAAO,EACnB,UAAU,SAAS,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC;IAEpE;;OAEG;IACH,gBAAgB,EAAE,CAAC,UAAU,GAAG,0BAA0B,CAAC,EAAE,CAAC;IAC9D;;OAEG;IACH,UAAU,EAAE,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IACtC;;OAEG;IACH,eAAe,EAAE,CAAC,UAAU,GAAG,0BAA0B,CAAC,EAAE,CAAC;IAC7D;;OAEG;IACH,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B;;OAEG;IACH,gBAAgB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,GAAG,OAAO,EACnB,UAAU,SAAS,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,EACpE,CAAC,SAAS,UAAU,GAAG,SAAS,GAAG,SAAS,EAC5C,aAAa,GAAG,OAAO,EAEvB,QAAQ,sBAAsB,CAAC,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,CAAC,KACtE,sBAAsB,CAAC,SAAS,CAqHlC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type LayoutRectangle, type View } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* 选择器 Hook 参数
|
|
5
|
+
*/
|
|
6
|
+
export interface UseSelectorParams {
|
|
7
|
+
/**
|
|
8
|
+
* 默认打开状态
|
|
9
|
+
*/
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 受控的打开状态
|
|
13
|
+
*/
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 是否禁用
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 打开状态变化回调
|
|
21
|
+
*/
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 选择器 Hook 返回值
|
|
26
|
+
*/
|
|
27
|
+
export interface UseSelectorResult {
|
|
28
|
+
/**
|
|
29
|
+
* 选择器 ref
|
|
30
|
+
*/
|
|
31
|
+
selectorRef: RefObject<View | null>;
|
|
32
|
+
/**
|
|
33
|
+
* 是否打开
|
|
34
|
+
*/
|
|
35
|
+
open: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 选择器布局信息
|
|
38
|
+
*/
|
|
39
|
+
selectorLayout: LayoutRectangle | null;
|
|
40
|
+
/**
|
|
41
|
+
* 是否聚焦
|
|
42
|
+
*/
|
|
43
|
+
isFocused: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 设置打开状态
|
|
46
|
+
*/
|
|
47
|
+
setOpen: (open: boolean) => void;
|
|
48
|
+
/**
|
|
49
|
+
* 更新选择器位置
|
|
50
|
+
*/
|
|
51
|
+
updateSelectorLayout: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* 处理选择器点击
|
|
54
|
+
*/
|
|
55
|
+
handleSelectorPress: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* 处理选择器布局变化
|
|
58
|
+
*/
|
|
59
|
+
handleSelectorLayout: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* 关闭下拉框
|
|
62
|
+
*/
|
|
63
|
+
closePopup: () => void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 选择器 Hook
|
|
67
|
+
*
|
|
68
|
+
* 封装 Select 组件中与选择器相关的逻辑,包括:
|
|
69
|
+
* - 选择器 ref 管理
|
|
70
|
+
* - 打开/关闭状态管理
|
|
71
|
+
* - 选择器位置获取
|
|
72
|
+
* - 焦点状态管理
|
|
73
|
+
* - 选择器点击处理
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const {
|
|
77
|
+
* selectorRef,
|
|
78
|
+
* open,
|
|
79
|
+
* selectorLayout,
|
|
80
|
+
* isFocused,
|
|
81
|
+
* handleSelectorPress,
|
|
82
|
+
* handleSelectorLayout
|
|
83
|
+
* } = useSelector({
|
|
84
|
+
* defaultOpen: false,
|
|
85
|
+
* disabled: false,
|
|
86
|
+
* onOpenChange
|
|
87
|
+
* });
|
|
88
|
+
*/
|
|
89
|
+
export declare const useSelector: (params: UseSelectorParams) => UseSelectorResult;
|
|
90
|
+
//# sourceMappingURL=use-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-selector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/base/select/hooks/use-selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpC;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,cAAc,EAAE,eAAe,GAAG,IAAI,CAAC;IACvC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC;;OAEG;IACH,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,iBAAiB,KAAG,iBA8DvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { SelectMode, SelectOption, SelectProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Select 多选内容组件的 Props
|
|
6
|
+
*/
|
|
7
|
+
export interface SelectMultipleContentProps<ValueType> extends Pick<SelectProps<ValueType>, 'maxTagCount' | 'maxTagPlaceholder' | 'maxTagTextLength' | 'tagRender'> {
|
|
8
|
+
/** 选中的选项列表 */
|
|
9
|
+
selectedOptions: SelectOption<ValueType>[];
|
|
10
|
+
/** 是否禁用 */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** 自定义标签渲染 */
|
|
13
|
+
labelRender?: SelectProps<ValueType>['labelRender'];
|
|
14
|
+
/** 占位符样式 */
|
|
15
|
+
placeholderStyle?: StyleProp<TextStyle>;
|
|
16
|
+
/** 输入框样式 */
|
|
17
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
18
|
+
/** 标签项容器样式 */
|
|
19
|
+
tagItemStyle?: StyleProp<ViewStyle>;
|
|
20
|
+
/** 标签文本内容样式 */
|
|
21
|
+
tagContentStyle?: StyleProp<TextStyle>;
|
|
22
|
+
/** 标签删除按钮样式 */
|
|
23
|
+
tagRemoveStyle?: StyleProp<ViewStyle>;
|
|
24
|
+
/** 标签整体容器样式 */
|
|
25
|
+
tagContainerStyle?: StyleProp<ViewStyle>;
|
|
26
|
+
/** 标签关闭事件 */
|
|
27
|
+
onTagClose: (option: SelectOption<ValueType>) => void;
|
|
28
|
+
/** 是否显示搜索输入框 */
|
|
29
|
+
showSearchInput?: boolean;
|
|
30
|
+
/** 搜索值 */
|
|
31
|
+
searchValue?: string;
|
|
32
|
+
/** 搜索值变化回调 */
|
|
33
|
+
onSearchChange?: (value: string) => void;
|
|
34
|
+
/** 占位符文本 */
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
/** 选择模式 */
|
|
37
|
+
mode?: SelectMode;
|
|
38
|
+
/** 创建选项回调 */
|
|
39
|
+
onCreateOption?: (value: string) => void;
|
|
40
|
+
/** 下拉框是否打开 */
|
|
41
|
+
open: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Select 多选内容组件
|
|
45
|
+
*
|
|
46
|
+
* 负责渲染多选模式下的标签列表,包括标签的显示、关闭按钮等功能。
|
|
47
|
+
*
|
|
48
|
+
* @template ValueType - 选项值的类型
|
|
49
|
+
*/
|
|
50
|
+
export declare const SelectMultipleContent: <ValueType = unknown>({ selectedOptions, disabled, maxTagCount, maxTagTextLength, maxTagPlaceholder, tagRender, labelRender, placeholderStyle, inputStyle, tagItemStyle, tagContentStyle, tagRemoveStyle, tagContainerStyle, onTagClose, showSearchInput, searchValue, onSearchChange, placeholder, mode, onCreateOption, open, }: SelectMultipleContentProps<ValueType>) => React.JSX.Element;
|
|
51
|
+
//# sourceMappingURL=select-multiple-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-multiple-content.d.ts","sourceRoot":"","sources":["../../../../../src/components/base/select/select-multiple-content.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAIrE;;GAEG;AACH,MAAM,WAAW,0BAA0B,CAAC,SAAS,CACnD,SAAQ,IAAI,CACV,WAAW,CAAC,SAAS,CAAC,EACtB,aAAa,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,WAAW,CACvE;IACD,cAAc;IACd,eAAe,EAAE,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3C,WAAW;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc;IACd,WAAW,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;IACpD,YAAY;IACZ,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,YAAY;IACZ,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,cAAc;IACd,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,eAAe;IACf,eAAe,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,eAAe;IACf,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,eAAe;IACf,iBAAiB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,aAAa;IACb,UAAU,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACtD,gBAAgB;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU;IACV,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,aAAa;IACb,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,cAAc;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAGD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,GAAG,OAAO,EAAG,6SAsBzD,0BAA0B,CAAC,SAAS,CAAC,sBAgMvC,CAAC"}
|