@hanwenbo/x-taro-ui 0.0.1
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/LICENSE +21 -0
- package/es/adapters/miniapp/index.d.ts +9 -0
- package/es/adapters/miniapp/index.js +9 -0
- package/es/adapters/miniapp/measure.d.ts +43 -0
- package/es/adapters/miniapp/measure.js +135 -0
- package/es/adapters/miniapp/overlayHost.d.ts +23 -0
- package/es/adapters/miniapp/overlayHost.js +141 -0
- package/es/adapters/miniapp/portal.d.ts +26 -0
- package/es/adapters/miniapp/portal.js +45 -0
- package/es/adapters/miniapp/scroll.d.ts +29 -0
- package/es/adapters/miniapp/scroll.js +87 -0
- package/es/adapters/miniapp/touch.d.ts +57 -0
- package/es/adapters/miniapp/touch.js +140 -0
- package/es/auth/components.d.ts +117 -0
- package/es/auth/components.js +1058 -0
- package/es/auth/entries/account-security.d.ts +3 -0
- package/es/auth/entries/account-security.js +2 -0
- package/es/auth/entries/change-password.d.ts +3 -0
- package/es/auth/entries/change-password.js +2 -0
- package/es/auth/entries/forgot-password.d.ts +3 -0
- package/es/auth/entries/forgot-password.js +2 -0
- package/es/auth/entries/identifier-binding.d.ts +3 -0
- package/es/auth/entries/identifier-binding.js +2 -0
- package/es/auth/entries/phone-number-input.d.ts +3 -0
- package/es/auth/entries/phone-number-input.js +2 -0
- package/es/auth/entries/provider.d.ts +2 -0
- package/es/auth/entries/provider.js +1 -0
- package/es/auth/entries/quick-sign-in.d.ts +3 -0
- package/es/auth/entries/quick-sign-in.js +2 -0
- package/es/auth/entries/sign-in.d.ts +3 -0
- package/es/auth/entries/sign-in.js +2 -0
- package/es/auth/entries/sign-up.d.ts +3 -0
- package/es/auth/entries/sign-up.js +2 -0
- package/es/auth/entries/theme.d.ts +2 -0
- package/es/auth/entries/theme.js +1 -0
- package/es/auth/entries/third-party-sign-in.d.ts +3 -0
- package/es/auth/entries/third-party-sign-in.js +2 -0
- package/es/auth/entries/types.d.ts +2 -0
- package/es/auth/entries/types.js +1 -0
- package/es/auth/index.d.ts +7 -0
- package/es/auth/index.js +6 -0
- package/es/auth/internal.d.ts +55 -0
- package/es/auth/internal.js +167 -0
- package/es/auth/phoneNumberInput.d.ts +22 -0
- package/es/auth/phoneNumberInput.js +110 -0
- package/es/auth/provider.d.ts +13 -0
- package/es/auth/provider.js +29 -0
- package/es/auth/styles.css +316 -0
- package/es/auth/theme.d.ts +12 -0
- package/es/auth/theme.js +23 -0
- package/es/auth/types.d.ts +17 -0
- package/es/auth/types.js +1 -0
- package/es/components/_shared/render.d.ts +16 -0
- package/es/components/_shared/render.js +33 -0
- package/es/components/_shared/seedSurface.d.ts +8 -0
- package/es/components/_shared/seedSurface.js +34 -0
- package/es/components/actionSheet/actionSheet.d.ts +14 -0
- package/es/components/actionSheet/actionSheet.js +382 -0
- package/es/components/actionSheet/index.d.ts +4 -0
- package/es/components/actionSheet/index.js +2 -0
- package/es/components/actionSheet/tokens.d.ts +36 -0
- package/es/components/actionSheet/tokens.js +121 -0
- package/es/components/actionSheet/types.d.ts +82 -0
- package/es/components/actionSheet/types.js +1 -0
- package/es/components/affix/affix.d.ts +5 -0
- package/es/components/affix/affix.js +43 -0
- package/es/components/affix/index.d.ts +3 -0
- package/es/components/affix/index.js +1 -0
- package/es/components/affix/types.d.ts +14 -0
- package/es/components/affix/types.js +1 -0
- package/es/components/alert/alert.d.ts +5 -0
- package/es/components/alert/alert.js +181 -0
- package/es/components/alert/index.d.ts +5 -0
- package/es/components/alert/index.js +3 -0
- package/es/components/alert/tokens.d.ts +37 -0
- package/es/components/alert/tokens.js +113 -0
- package/es/components/alert/types.d.ts +54 -0
- package/es/components/alert/types.js +1 -0
- package/es/components/attachment/attachment.d.ts +22 -0
- package/es/components/attachment/attachment.js +451 -0
- package/es/components/attachment/index.d.ts +3 -0
- package/es/components/attachment/index.js +1 -0
- package/es/components/attachment/types.d.ts +141 -0
- package/es/components/attachment/types.js +1 -0
- package/es/components/avatar/avatar.d.ts +15 -0
- package/es/components/avatar/avatar.js +344 -0
- package/es/components/avatar/index.d.ts +7 -0
- package/es/components/avatar/index.js +6 -0
- package/es/components/avatar/style.css +14 -0
- package/es/components/avatar/tokens.d.ts +30 -0
- package/es/components/avatar/tokens.js +114 -0
- package/es/components/avatar/types.d.ts +73 -0
- package/es/components/avatar/types.js +1 -0
- package/es/components/badge/badge.d.ts +13 -0
- package/es/components/badge/badge.js +223 -0
- package/es/components/badge/index.d.ts +7 -0
- package/es/components/badge/index.js +6 -0
- package/es/components/badge/tokens.d.ts +44 -0
- package/es/components/badge/tokens.js +181 -0
- package/es/components/badge/types.d.ts +74 -0
- package/es/components/badge/types.js +1 -0
- package/es/components/barLoading/barLoading.d.ts +12 -0
- package/es/components/barLoading/barLoading.js +73 -0
- package/es/components/barLoading/index.d.ts +4 -0
- package/es/components/barLoading/index.js +3 -0
- package/es/components/barLoading/style.css +16 -0
- package/es/components/barLoading/types.d.ts +18 -0
- package/es/components/barLoading/types.js +1 -0
- package/es/components/breadcrumb/breadcrumb.d.ts +7 -0
- package/es/components/breadcrumb/breadcrumb.js +137 -0
- package/es/components/breadcrumb/index.d.ts +3 -0
- package/es/components/breadcrumb/index.js +1 -0
- package/es/components/breadcrumb/types.d.ts +21 -0
- package/es/components/breadcrumb/types.js +1 -0
- package/es/components/button/button.d.ts +11 -0
- package/es/components/button/button.js +261 -0
- package/es/components/button/index.d.ts +7 -0
- package/es/components/button/index.js +6 -0
- package/es/components/button/style.css +4 -0
- package/es/components/button/tokens.d.ts +37 -0
- package/es/components/button/tokens.js +176 -0
- package/es/components/button/types.d.ts +69 -0
- package/es/components/button/types.js +1 -0
- package/es/components/capsuleTabs/capsuleTabs.d.ts +6 -0
- package/es/components/capsuleTabs/capsuleTabs.js +500 -0
- package/es/components/capsuleTabs/index.d.ts +3 -0
- package/es/components/capsuleTabs/index.js +1 -0
- package/es/components/capsuleTabs/types.d.ts +48 -0
- package/es/components/capsuleTabs/types.js +1 -0
- package/es/components/card/card.d.ts +20 -0
- package/es/components/card/card.js +289 -0
- package/es/components/card/index.d.ts +7 -0
- package/es/components/card/index.js +6 -0
- package/es/components/card/tokens.d.ts +37 -0
- package/es/components/card/tokens.js +167 -0
- package/es/components/card/types.d.ts +74 -0
- package/es/components/card/types.js +1 -0
- package/es/components/cascadePicker/cascadePicker.d.ts +5 -0
- package/es/components/cascadePicker/cascadePicker.js +125 -0
- package/es/components/cascadePicker/index.d.ts +4 -0
- package/es/components/cascadePicker/index.js +3 -0
- package/es/components/cascadePicker/shared.d.ts +29 -0
- package/es/components/cascadePicker/shared.js +257 -0
- package/es/components/cascadePicker/types.d.ts +59 -0
- package/es/components/cascadePicker/types.js +1 -0
- package/es/components/cascadePickerView/cascadePickerView.d.ts +5 -0
- package/es/components/cascadePickerView/cascadePickerView.js +76 -0
- package/es/components/cascadePickerView/index.d.ts +4 -0
- package/es/components/cascadePickerView/index.js +3 -0
- package/es/components/cascadePickerView/types.d.ts +27 -0
- package/es/components/cascadePickerView/types.js +1 -0
- package/es/components/cascader/cascader.d.ts +5 -0
- package/es/components/cascader/cascader.js +427 -0
- package/es/components/cascader/index.d.ts +4 -0
- package/es/components/cascader/index.js +3 -0
- package/es/components/cascader/types.d.ts +54 -0
- package/es/components/cascader/types.js +1 -0
- package/es/components/cascaderView/cascaderView.d.ts +5 -0
- package/es/components/cascaderView/cascaderView.js +626 -0
- package/es/components/cascaderView/index.d.ts +4 -0
- package/es/components/cascaderView/index.js +3 -0
- package/es/components/cascaderView/types.d.ts +25 -0
- package/es/components/cascaderView/types.js +1 -0
- package/es/components/checkList/checkList.d.ts +9 -0
- package/es/components/checkList/checkList.js +352 -0
- package/es/components/checkList/index.d.ts +5 -0
- package/es/components/checkList/index.js +4 -0
- package/es/components/checkList/types.d.ts +41 -0
- package/es/components/checkList/types.js +1 -0
- package/es/components/checkbox/checkbox.d.ts +15 -0
- package/es/components/checkbox/checkbox.js +249 -0
- package/es/components/checkbox/index.d.ts +7 -0
- package/es/components/checkbox/index.js +6 -0
- package/es/components/checkbox/tokens.d.ts +38 -0
- package/es/components/checkbox/tokens.js +135 -0
- package/es/components/checkbox/types.d.ts +73 -0
- package/es/components/checkbox/types.js +1 -0
- package/es/components/collapse/collapse.d.ts +9 -0
- package/es/components/collapse/collapse.js +306 -0
- package/es/components/collapse/index.d.ts +4 -0
- package/es/components/collapse/index.js +3 -0
- package/es/components/collapse/types.d.ts +33 -0
- package/es/components/collapse/types.js +1 -0
- package/es/components/command/command.d.ts +7 -0
- package/es/components/command/command.js +657 -0
- package/es/components/command/index.d.ts +4 -0
- package/es/components/command/index.js +3 -0
- package/es/components/command/style.css +5 -0
- package/es/components/command/types.d.ts +69 -0
- package/es/components/command/types.js +1 -0
- package/es/components/configProvider/configProvider.d.ts +12 -0
- package/es/components/configProvider/configProvider.js +147 -0
- package/es/components/configProvider/index.d.ts +4 -0
- package/es/components/configProvider/index.js +3 -0
- package/es/components/configProvider/types.d.ts +48 -0
- package/es/components/configProvider/types.js +1 -0
- package/es/components/contextMenu/contextMenu.d.ts +6 -0
- package/es/components/contextMenu/contextMenu.js +652 -0
- package/es/components/contextMenu/index.d.ts +4 -0
- package/es/components/contextMenu/index.js +3 -0
- package/es/components/contextMenu/types.d.ts +69 -0
- package/es/components/contextMenu/types.js +1 -0
- package/es/components/datePicker/datePicker.d.ts +6 -0
- package/es/components/datePicker/datePicker.js +375 -0
- package/es/components/datePicker/index.d.ts +4 -0
- package/es/components/datePicker/index.js +3 -0
- package/es/components/datePicker/shared.d.ts +35 -0
- package/es/components/datePicker/shared.js +262 -0
- package/es/components/datePicker/types.d.ts +77 -0
- package/es/components/datePicker/types.js +1 -0
- package/es/components/datePickerView/datePickerView.d.ts +5 -0
- package/es/components/datePickerView/datePickerView.js +132 -0
- package/es/components/datePickerView/index.d.ts +4 -0
- package/es/components/datePickerView/index.js +3 -0
- package/es/components/datePickerView/types.d.ts +35 -0
- package/es/components/datePickerView/types.js +1 -0
- package/es/components/descriptions/descriptions.d.ts +5 -0
- package/es/components/descriptions/descriptions.js +207 -0
- package/es/components/descriptions/index.d.ts +3 -0
- package/es/components/descriptions/index.js +1 -0
- package/es/components/descriptions/types.d.ts +28 -0
- package/es/components/descriptions/types.js +1 -0
- package/es/components/dialog/dialog.d.ts +21 -0
- package/es/components/dialog/dialog.js +613 -0
- package/es/components/dialog/index.d.ts +6 -0
- package/es/components/dialog/index.js +4 -0
- package/es/components/dialog/tokens.d.ts +38 -0
- package/es/components/dialog/tokens.js +154 -0
- package/es/components/dialog/types.d.ts +104 -0
- package/es/components/dialog/types.js +1 -0
- package/es/components/dimensions/dimensions.d.ts +27 -0
- package/es/components/dimensions/dimensions.js +412 -0
- package/es/components/dimensions/index.d.ts +4 -0
- package/es/components/dimensions/index.js +3 -0
- package/es/components/dimensions/types.d.ts +85 -0
- package/es/components/dimensions/types.js +1 -0
- package/es/components/divider/divider.d.ts +8 -0
- package/es/components/divider/divider.js +149 -0
- package/es/components/divider/index.d.ts +7 -0
- package/es/components/divider/index.js +6 -0
- package/es/components/divider/tokens.d.ts +24 -0
- package/es/components/divider/tokens.js +103 -0
- package/es/components/divider/types.d.ts +29 -0
- package/es/components/divider/types.js +1 -0
- package/es/components/dotLoading/dotLoading.d.ts +12 -0
- package/es/components/dotLoading/dotLoading.js +76 -0
- package/es/components/dotLoading/index.d.ts +4 -0
- package/es/components/dotLoading/index.js +3 -0
- package/es/components/dotLoading/style.css +16 -0
- package/es/components/dotLoading/types.d.ts +24 -0
- package/es/components/dotLoading/types.js +1 -0
- package/es/components/drawer/drawer.d.ts +5 -0
- package/es/components/drawer/drawer.js +130 -0
- package/es/components/drawer/index.d.ts +3 -0
- package/es/components/drawer/index.js +1 -0
- package/es/components/drawer/types.d.ts +32 -0
- package/es/components/drawer/types.js +1 -0
- package/es/components/dropdown/dropdown.d.ts +5 -0
- package/es/components/dropdown/dropdown.js +620 -0
- package/es/components/dropdown/index.d.ts +4 -0
- package/es/components/dropdown/index.js +3 -0
- package/es/components/dropdown/types.d.ts +84 -0
- package/es/components/dropdown/types.js +1 -0
- package/es/components/dropdownMenu/dropdownMenu.d.ts +5 -0
- package/es/components/dropdownMenu/dropdownMenu.js +586 -0
- package/es/components/dropdownMenu/index.d.ts +4 -0
- package/es/components/dropdownMenu/index.js +3 -0
- package/es/components/dropdownMenu/types.d.ts +47 -0
- package/es/components/dropdownMenu/types.js +1 -0
- package/es/components/ellipsis/ellipsis.d.ts +6 -0
- package/es/components/ellipsis/ellipsis.js +232 -0
- package/es/components/ellipsis/index.d.ts +4 -0
- package/es/components/ellipsis/index.js +3 -0
- package/es/components/ellipsis/types.d.ts +36 -0
- package/es/components/ellipsis/types.js +1 -0
- package/es/components/empty/empty.d.ts +9 -0
- package/es/components/empty/empty.js +38 -0
- package/es/components/empty/index.d.ts +3 -0
- package/es/components/empty/index.js +1 -0
- package/es/components/empty/types.d.ts +14 -0
- package/es/components/empty/types.js +1 -0
- package/es/components/errorBlock/errorBlock.d.ts +5 -0
- package/es/components/errorBlock/errorBlock.js +230 -0
- package/es/components/errorBlock/index.d.ts +4 -0
- package/es/components/errorBlock/index.js +3 -0
- package/es/components/errorBlock/types.d.ts +25 -0
- package/es/components/errorBlock/types.js +1 -0
- package/es/components/flatList/flatList.d.ts +7 -0
- package/es/components/flatList/flatList.js +564 -0
- package/es/components/flatList/index.d.ts +4 -0
- package/es/components/flatList/index.js +3 -0
- package/es/components/flatList/scrollTargetMeasurement.d.ts +17 -0
- package/es/components/flatList/scrollTargetMeasurement.h5.d.ts +3 -0
- package/es/components/flatList/scrollTargetMeasurement.h5.js +15 -0
- package/es/components/flatList/scrollTargetMeasurement.js +16 -0
- package/es/components/flatList/types.d.ts +88 -0
- package/es/components/flatList/types.js +1 -0
- package/es/components/form/form.d.ts +5 -0
- package/es/components/form/form.js +516 -0
- package/es/components/form/index.d.ts +4 -0
- package/es/components/form/index.js +3 -0
- package/es/components/form/types.d.ts +156 -0
- package/es/components/form/types.js +1 -0
- package/es/components/grid/grid.d.ts +9 -0
- package/es/components/grid/grid.js +263 -0
- package/es/components/grid/index.d.ts +4 -0
- package/es/components/grid/index.js +3 -0
- package/es/components/grid/types.d.ts +53 -0
- package/es/components/grid/types.js +1 -0
- package/es/components/icon/aliases.d.ts +7 -0
- package/es/components/icon/aliases.js +45 -0
- package/es/components/icon/icon.d.ts +5 -0
- package/es/components/icon/icon.js +135 -0
- package/es/components/icon/index.d.ts +5 -0
- package/es/components/icon/index.js +4 -0
- package/es/components/icon/lucide.generated.d.ts +576 -0
- package/es/components/icon/lucide.generated.js +577 -0
- package/es/components/icon/types.d.ts +36 -0
- package/es/components/icon/types.js +1 -0
- package/es/components/image/image.d.ts +11 -0
- package/es/components/image/image.js +151 -0
- package/es/components/image/index.d.ts +4 -0
- package/es/components/image/index.js +3 -0
- package/es/components/image/types.d.ts +48 -0
- package/es/components/image/types.js +1 -0
- package/es/components/input/index.d.ts +7 -0
- package/es/components/input/index.js +6 -0
- package/es/components/input/input.d.ts +10 -0
- package/es/components/input/input.js +274 -0
- package/es/components/input/style.css +9 -0
- package/es/components/input/tokens.d.ts +27 -0
- package/es/components/input/tokens.js +66 -0
- package/es/components/input/types.d.ts +72 -0
- package/es/components/input/types.js +1 -0
- package/es/components/inputItem/index.d.ts +5 -0
- package/es/components/inputItem/index.js +3 -0
- package/es/components/inputItem/inputItem.d.ts +9 -0
- package/es/components/inputItem/inputItem.js +386 -0
- package/es/components/inputItem/tokens.d.ts +31 -0
- package/es/components/inputItem/tokens.js +84 -0
- package/es/components/inputItem/types.d.ts +66 -0
- package/es/components/inputItem/types.js +1 -0
- package/es/components/internal/index.d.ts +3 -0
- package/es/components/internal/index.js +1 -0
- package/es/components/internal/internal.d.ts +5 -0
- package/es/components/internal/internal.js +49 -0
- package/es/components/internal/selectionControl/presentation.d.ts +31 -0
- package/es/components/internal/selectionControl/presentation.js +36 -0
- package/es/components/internal/selectionControl/useTaroScrollIntoView.d.ts +19 -0
- package/es/components/internal/selectionControl/useTaroScrollIntoView.js +90 -0
- package/es/components/internal/selectionControl/useTaroSelectionIndicator.d.ts +22 -0
- package/es/components/internal/selectionControl/useTaroSelectionIndicator.js +166 -0
- package/es/components/internal/types.d.ts +10 -0
- package/es/components/internal/types.js +1 -0
- package/es/components/item/index.d.ts +4 -0
- package/es/components/item/index.js +3 -0
- package/es/components/item/item.d.ts +14 -0
- package/es/components/item/item.js +471 -0
- package/es/components/item/types.d.ts +58 -0
- package/es/components/item/types.js +1 -0
- package/es/components/kbd/index.d.ts +4 -0
- package/es/components/kbd/index.js +3 -0
- package/es/components/kbd/kbd.d.ts +6 -0
- package/es/components/kbd/kbd.js +199 -0
- package/es/components/kbd/types.d.ts +38 -0
- package/es/components/kbd/types.js +1 -0
- package/es/components/layout/index.d.ts +5 -0
- package/es/components/layout/index.js +2 -0
- package/es/components/layout/layout.d.ts +17 -0
- package/es/components/layout/layout.js +244 -0
- package/es/components/layout/types.d.ts +54 -0
- package/es/components/layout/types.js +1 -0
- package/es/components/list/index.d.ts +3 -0
- package/es/components/list/index.js +1 -0
- package/es/components/list/list.d.ts +9 -0
- package/es/components/list/list.js +420 -0
- package/es/components/list/types.d.ts +49 -0
- package/es/components/list/types.js +1 -0
- package/es/components/mask/index.d.ts +5 -0
- package/es/components/mask/index.js +4 -0
- package/es/components/mask/mask.d.ts +11 -0
- package/es/components/mask/mask.js +150 -0
- package/es/components/mask/tokens.d.ts +29 -0
- package/es/components/mask/tokens.js +75 -0
- package/es/components/mask/types.d.ts +49 -0
- package/es/components/mask/types.js +1 -0
- package/es/components/masonryList/index.d.ts +4 -0
- package/es/components/masonryList/index.js +3 -0
- package/es/components/masonryList/masonryList.d.ts +7 -0
- package/es/components/masonryList/masonryList.js +501 -0
- package/es/components/masonryList/types.d.ts +65 -0
- package/es/components/masonryList/types.js +1 -0
- package/es/components/menu/index.d.ts +4 -0
- package/es/components/menu/index.js +3 -0
- package/es/components/menu/menu.d.ts +5 -0
- package/es/components/menu/menu.js +559 -0
- package/es/components/menu/types.d.ts +79 -0
- package/es/components/menu/types.js +1 -0
- package/es/components/menubar/index.d.ts +4 -0
- package/es/components/menubar/index.js +3 -0
- package/es/components/menubar/menubar.d.ts +5 -0
- package/es/components/menubar/menubar.js +810 -0
- package/es/components/menubar/types.d.ts +71 -0
- package/es/components/menubar/types.js +1 -0
- package/es/components/modal/index.d.ts +5 -0
- package/es/components/modal/index.js +4 -0
- package/es/components/modal/modal.d.ts +11 -0
- package/es/components/modal/modal.js +235 -0
- package/es/components/modal/tokens.d.ts +37 -0
- package/es/components/modal/tokens.js +118 -0
- package/es/components/modal/types.d.ts +63 -0
- package/es/components/modal/types.js +1 -0
- package/es/components/navBar/index.d.ts +4 -0
- package/es/components/navBar/index.js +3 -0
- package/es/components/navBar/navBar.d.ts +11 -0
- package/es/components/navBar/navBar.js +238 -0
- package/es/components/navBar/types.d.ts +32 -0
- package/es/components/navBar/types.js +1 -0
- package/es/components/needWrap/index.d.ts +4 -0
- package/es/components/needWrap/index.js +3 -0
- package/es/components/needWrap/needWrap.d.ts +12 -0
- package/es/components/needWrap/needWrap.js +23 -0
- package/es/components/needWrap/types.d.ts +12 -0
- package/es/components/needWrap/types.js +1 -0
- package/es/components/notification/index.d.ts +5 -0
- package/es/components/notification/index.js +4 -0
- package/es/components/notification/notification.d.ts +13 -0
- package/es/components/notification/notification.js +532 -0
- package/es/components/notification/tokens.d.ts +43 -0
- package/es/components/notification/tokens.js +95 -0
- package/es/components/notification/types.d.ts +76 -0
- package/es/components/notification/types.js +1 -0
- package/es/components/pageIndicator/index.d.ts +4 -0
- package/es/components/pageIndicator/index.js +3 -0
- package/es/components/pageIndicator/pageIndicator.d.ts +5 -0
- package/es/components/pageIndicator/pageIndicator.js +218 -0
- package/es/components/pageIndicator/types.d.ts +51 -0
- package/es/components/pageIndicator/types.js +1 -0
- package/es/components/pagination/index.d.ts +4 -0
- package/es/components/pagination/index.js +3 -0
- package/es/components/pagination/pagination.d.ts +5 -0
- package/es/components/pagination/pagination.js +448 -0
- package/es/components/pagination/tokens.d.ts +36 -0
- package/es/components/pagination/tokens.js +102 -0
- package/es/components/pagination/types.d.ts +36 -0
- package/es/components/pagination/types.js +1 -0
- package/es/components/picker/index.d.ts +6 -0
- package/es/components/picker/index.js +4 -0
- package/es/components/picker/picker.d.ts +9 -0
- package/es/components/picker/picker.js +547 -0
- package/es/components/picker/shared.d.ts +16 -0
- package/es/components/picker/shared.js +114 -0
- package/es/components/picker/tokens.d.ts +43 -0
- package/es/components/picker/tokens.js +108 -0
- package/es/components/picker/types.d.ts +110 -0
- package/es/components/picker/types.js +1 -0
- package/es/components/pickerView/index.d.ts +4 -0
- package/es/components/pickerView/index.js +2 -0
- package/es/components/pickerView/pickerView.d.ts +9 -0
- package/es/components/pickerView/pickerView.js +173 -0
- package/es/components/pickerView/types.d.ts +30 -0
- package/es/components/pickerView/types.js +1 -0
- package/es/components/popconfirm/index.d.ts +4 -0
- package/es/components/popconfirm/index.js +3 -0
- package/es/components/popconfirm/popconfirm.d.ts +20 -0
- package/es/components/popconfirm/popconfirm.js +490 -0
- package/es/components/popconfirm/types.d.ts +91 -0
- package/es/components/popconfirm/types.js +1 -0
- package/es/components/popover/index.d.ts +5 -0
- package/es/components/popover/index.js +2 -0
- package/es/components/popover/popover.d.ts +5 -0
- package/es/components/popover/popover.js +174 -0
- package/es/components/popover/types.d.ts +51 -0
- package/es/components/popover/types.js +1 -0
- package/es/components/popup/index.d.ts +4 -0
- package/es/components/popup/index.js +2 -0
- package/es/components/popup/popup.d.ts +9 -0
- package/es/components/popup/popup.js +205 -0
- package/es/components/popup/tokens.d.ts +38 -0
- package/es/components/popup/tokens.js +162 -0
- package/es/components/popup/types.d.ts +61 -0
- package/es/components/popup/types.js +1 -0
- package/es/components/portal/index.d.ts +4 -0
- package/es/components/portal/index.js +3 -0
- package/es/components/portal/portal.d.ts +11 -0
- package/es/components/portal/portal.h5.d.ts +5 -0
- package/es/components/portal/portal.h5.js +67 -0
- package/es/components/portal/portal.js +48 -0
- package/es/components/portal/types.d.ts +25 -0
- package/es/components/portal/types.js +1 -0
- package/es/components/progress/index.d.ts +3 -0
- package/es/components/progress/index.js +1 -0
- package/es/components/progress/progress.d.ts +5 -0
- package/es/components/progress/progress.js +132 -0
- package/es/components/progress/types.d.ts +16 -0
- package/es/components/progress/types.js +1 -0
- package/es/components/progressBar/index.d.ts +3 -0
- package/es/components/progressBar/index.js +1 -0
- package/es/components/progressBar/progressBar.d.ts +6 -0
- package/es/components/progressBar/progressBar.js +162 -0
- package/es/components/progressBar/style.css +13 -0
- package/es/components/progressBar/tokens.d.ts +18 -0
- package/es/components/progressBar/tokens.js +42 -0
- package/es/components/progressBar/types.d.ts +40 -0
- package/es/components/progressBar/types.js +1 -0
- package/es/components/provider/index.d.ts +4 -0
- package/es/components/provider/index.js +3 -0
- package/es/components/provider/provider.d.ts +5 -0
- package/es/components/provider/provider.js +70 -0
- package/es/components/provider/types.d.ts +33 -0
- package/es/components/provider/types.js +1 -0
- package/es/components/radio/index.d.ts +7 -0
- package/es/components/radio/index.js +6 -0
- package/es/components/radio/radio.d.ts +12 -0
- package/es/components/radio/radio.js +215 -0
- package/es/components/radio/tokens.d.ts +41 -0
- package/es/components/radio/tokens.js +147 -0
- package/es/components/radio/types.d.ts +66 -0
- package/es/components/radio/types.js +1 -0
- package/es/components/rate/index.d.ts +4 -0
- package/es/components/rate/index.js +3 -0
- package/es/components/rate/rate.d.ts +5 -0
- package/es/components/rate/rate.js +195 -0
- package/es/components/rate/types.d.ts +33 -0
- package/es/components/rate/types.js +1 -0
- package/es/components/result/index.d.ts +3 -0
- package/es/components/result/index.js +1 -0
- package/es/components/result/result.d.ts +5 -0
- package/es/components/result/result.js +62 -0
- package/es/components/result/types.d.ts +27 -0
- package/es/components/result/types.js +1 -0
- package/es/components/resultPage/index.d.ts +4 -0
- package/es/components/resultPage/index.js +3 -0
- package/es/components/resultPage/resultPage.d.ts +5 -0
- package/es/components/resultPage/resultPage.js +344 -0
- package/es/components/resultPage/types.d.ts +56 -0
- package/es/components/resultPage/types.js +1 -0
- package/es/components/rollingNumber/index.d.ts +4 -0
- package/es/components/rollingNumber/index.js +3 -0
- package/es/components/rollingNumber/rollingNumber.d.ts +5 -0
- package/es/components/rollingNumber/rollingNumber.js +298 -0
- package/es/components/rollingNumber/types.d.ts +40 -0
- package/es/components/rollingNumber/types.js +1 -0
- package/es/components/safeArea/index.d.ts +4 -0
- package/es/components/safeArea/index.js +3 -0
- package/es/components/safeArea/safeArea.d.ts +7 -0
- package/es/components/safeArea/safeArea.js +74 -0
- package/es/components/safeArea/types.d.ts +22 -0
- package/es/components/safeArea/types.js +1 -0
- package/es/components/scrollFade/index.d.ts +3 -0
- package/es/components/scrollFade/index.js +1 -0
- package/es/components/scrollFade/scrollFade.d.ts +15 -0
- package/es/components/scrollFade/scrollFade.js +212 -0
- package/es/components/scrollFade/types.d.ts +44 -0
- package/es/components/scrollFade/types.js +1 -0
- package/es/components/scrollView/index.d.ts +4 -0
- package/es/components/scrollView/index.js +3 -0
- package/es/components/scrollView/scrollView.d.ts +6 -0
- package/es/components/scrollView/scrollView.js +270 -0
- package/es/components/scrollView/style.css +7 -0
- package/es/components/scrollView/types.d.ts +48 -0
- package/es/components/scrollView/types.js +1 -0
- package/es/components/searchBar/index.d.ts +5 -0
- package/es/components/searchBar/index.js +3 -0
- package/es/components/searchBar/searchBar.d.ts +9 -0
- package/es/components/searchBar/searchBar.js +358 -0
- package/es/components/searchBar/tokens.d.ts +40 -0
- package/es/components/searchBar/tokens.js +87 -0
- package/es/components/searchBar/types.d.ts +65 -0
- package/es/components/searchBar/types.js +1 -0
- package/es/components/sectionList/index.d.ts +4 -0
- package/es/components/sectionList/index.js +3 -0
- package/es/components/sectionList/sectionList.d.ts +8 -0
- package/es/components/sectionList/sectionList.js +489 -0
- package/es/components/sectionList/types.d.ts +64 -0
- package/es/components/sectionList/types.js +1 -0
- package/es/components/segmented/index.d.ts +4 -0
- package/es/components/segmented/index.js +3 -0
- package/es/components/segmented/segmented.d.ts +5 -0
- package/es/components/segmented/segmented.js +286 -0
- package/es/components/segmented/types.d.ts +61 -0
- package/es/components/segmented/types.js +1 -0
- package/es/components/select/index.d.ts +5 -0
- package/es/components/select/index.js +3 -0
- package/es/components/select/select.d.ts +11 -0
- package/es/components/select/select.js +723 -0
- package/es/components/select/tokens.d.ts +60 -0
- package/es/components/select/tokens.js +138 -0
- package/es/components/select/types.d.ts +79 -0
- package/es/components/select/types.js +1 -0
- package/es/components/sendCode/index.d.ts +5 -0
- package/es/components/sendCode/index.js +3 -0
- package/es/components/sendCode/sendCode.d.ts +12 -0
- package/es/components/sendCode/sendCode.js +196 -0
- package/es/components/sendCode/tokens.d.ts +13 -0
- package/es/components/sendCode/tokens.js +19 -0
- package/es/components/sendCode/types.d.ts +54 -0
- package/es/components/sendCode/types.js +1 -0
- package/es/components/shimmer/index.d.ts +3 -0
- package/es/components/shimmer/index.js +1 -0
- package/es/components/shimmer/shimmer.d.ts +21 -0
- package/es/components/shimmer/shimmer.js +213 -0
- package/es/components/shimmer/style.css +31 -0
- package/es/components/shimmer/types.d.ts +34 -0
- package/es/components/shimmer/types.js +1 -0
- package/es/components/showMoreText/index.d.ts +4 -0
- package/es/components/showMoreText/index.js +3 -0
- package/es/components/showMoreText/showMoreText.d.ts +5 -0
- package/es/components/showMoreText/showMoreText.js +305 -0
- package/es/components/showMoreText/types.d.ts +33 -0
- package/es/components/showMoreText/types.js +1 -0
- package/es/components/sideBar/index.d.ts +5 -0
- package/es/components/sideBar/index.js +4 -0
- package/es/components/sideBar/sideBar.d.ts +8 -0
- package/es/components/sideBar/sideBar.js +364 -0
- package/es/components/sideBar/types.d.ts +40 -0
- package/es/components/sideBar/types.js +1 -0
- package/es/components/skeleton/index.d.ts +4 -0
- package/es/components/skeleton/index.js +2 -0
- package/es/components/skeleton/skeleton.d.ts +15 -0
- package/es/components/skeleton/skeleton.js +312 -0
- package/es/components/skeleton/style.css +16 -0
- package/es/components/skeleton/types.d.ts +71 -0
- package/es/components/skeleton/types.js +1 -0
- package/es/components/slider/index.d.ts +5 -0
- package/es/components/slider/index.js +3 -0
- package/es/components/slider/slider.d.ts +10 -0
- package/es/components/slider/slider.js +565 -0
- package/es/components/slider/tokens.d.ts +33 -0
- package/es/components/slider/tokens.js +97 -0
- package/es/components/slider/types.d.ts +43 -0
- package/es/components/slider/types.js +1 -0
- package/es/components/sonner/index.d.ts +5 -0
- package/es/components/sonner/index.js +2 -0
- package/es/components/sonner/sonner.d.ts +35 -0
- package/es/components/sonner/sonner.js +731 -0
- package/es/components/sonner/style.css +67 -0
- package/es/components/sonner/types.d.ts +119 -0
- package/es/components/sonner/types.js +1 -0
- package/es/components/space/index.d.ts +4 -0
- package/es/components/space/index.js +3 -0
- package/es/components/space/space.d.ts +15 -0
- package/es/components/space/space.js +108 -0
- package/es/components/space/types.d.ts +41 -0
- package/es/components/space/types.js +1 -0
- package/es/components/spin/index.d.ts +3 -0
- package/es/components/spin/index.js +1 -0
- package/es/components/spin/spin.d.ts +6 -0
- package/es/components/spin/spin.js +157 -0
- package/es/components/spin/style.css +13 -0
- package/es/components/spin/types.d.ts +21 -0
- package/es/components/spin/types.js +1 -0
- package/es/components/spinner/index.d.ts +4 -0
- package/es/components/spinner/index.js +3 -0
- package/es/components/spinner/spinner.d.ts +12 -0
- package/es/components/spinner/spinner.js +141 -0
- package/es/components/spinner/style.css +11 -0
- package/es/components/spinner/types.d.ts +33 -0
- package/es/components/spinner/types.js +1 -0
- package/es/components/stepper/index.d.ts +5 -0
- package/es/components/stepper/index.js +3 -0
- package/es/components/stepper/stepper.d.ts +10 -0
- package/es/components/stepper/stepper.js +317 -0
- package/es/components/stepper/style.css +13 -0
- package/es/components/stepper/tokens.d.ts +36 -0
- package/es/components/stepper/tokens.js +130 -0
- package/es/components/stepper/types.d.ts +50 -0
- package/es/components/stepper/types.js +1 -0
- package/es/components/steps/index.d.ts +3 -0
- package/es/components/steps/index.js +1 -0
- package/es/components/steps/steps.d.ts +5 -0
- package/es/components/steps/steps.js +204 -0
- package/es/components/steps/types.d.ts +29 -0
- package/es/components/steps/types.js +1 -0
- package/es/components/swiper/index.d.ts +4 -0
- package/es/components/swiper/index.js +3 -0
- package/es/components/swiper/swiper.d.ts +6 -0
- package/es/components/swiper/swiper.js +326 -0
- package/es/components/swiper/types.d.ts +51 -0
- package/es/components/swiper/types.js +1 -0
- package/es/components/switch/index.d.ts +5 -0
- package/es/components/switch/index.js +3 -0
- package/es/components/switch/style.css +10 -0
- package/es/components/switch/switch.d.ts +10 -0
- package/es/components/switch/switch.js +252 -0
- package/es/components/switch/tokens.d.ts +33 -0
- package/es/components/switch/tokens.js +108 -0
- package/es/components/switch/types.d.ts +42 -0
- package/es/components/switch/types.js +1 -0
- package/es/components/tabBar/index.d.ts +4 -0
- package/es/components/tabBar/index.js +2 -0
- package/es/components/tabBar/tabBar.d.ts +12 -0
- package/es/components/tabBar/tabBar.js +411 -0
- package/es/components/tabBar/types.d.ts +46 -0
- package/es/components/tabBar/types.js +1 -0
- package/es/components/table/index.d.ts +4 -0
- package/es/components/table/index.js +3 -0
- package/es/components/table/table.d.ts +13 -0
- package/es/components/table/table.js +2001 -0
- package/es/components/table/types.d.ts +272 -0
- package/es/components/table/types.js +1 -0
- package/es/components/tabs/index.d.ts +3 -0
- package/es/components/tabs/index.js +1 -0
- package/es/components/tabs/tabs.d.ts +16 -0
- package/es/components/tabs/tabs.js +796 -0
- package/es/components/tabs/types.d.ts +124 -0
- package/es/components/tabs/types.js +1 -0
- package/es/components/tag/index.d.ts +7 -0
- package/es/components/tag/index.js +6 -0
- package/es/components/tag/tag.d.ts +17 -0
- package/es/components/tag/tag.js +542 -0
- package/es/components/tag/tokens.d.ts +43 -0
- package/es/components/tag/tokens.js +173 -0
- package/es/components/tag/types.d.ts +107 -0
- package/es/components/tag/types.js +1 -0
- package/es/components/text/index.d.ts +4 -0
- package/es/components/text/index.js +3 -0
- package/es/components/text/text.d.ts +5 -0
- package/es/components/text/text.js +235 -0
- package/es/components/text/types.d.ts +50 -0
- package/es/components/text/types.js +1 -0
- package/es/components/textInput/index.d.ts +4 -0
- package/es/components/textInput/index.js +3 -0
- package/es/components/textInput/style.css +37 -0
- package/es/components/textInput/textInput.d.ts +10 -0
- package/es/components/textInput/textInput.js +371 -0
- package/es/components/textInput/types.d.ts +79 -0
- package/es/components/textInput/types.js +1 -0
- package/es/components/textarea/index.d.ts +5 -0
- package/es/components/textarea/index.js +3 -0
- package/es/components/textarea/style.css +32 -0
- package/es/components/textarea/textarea.d.ts +10 -0
- package/es/components/textarea/textarea.js +342 -0
- package/es/components/textarea/tokens.d.ts +29 -0
- package/es/components/textarea/tokens.js +123 -0
- package/es/components/textarea/types.d.ts +120 -0
- package/es/components/textarea/types.js +1 -0
- package/es/components/toast/index.d.ts +4 -0
- package/es/components/toast/index.js +2 -0
- package/es/components/toast/style.css +9 -0
- package/es/components/toast/toast.d.ts +21 -0
- package/es/components/toast/toast.js +348 -0
- package/es/components/toast/tokens.d.ts +48 -0
- package/es/components/toast/tokens.js +179 -0
- package/es/components/toast/types.d.ts +47 -0
- package/es/components/toast/types.js +1 -0
- package/es/components/tooltip/index.d.ts +5 -0
- package/es/components/tooltip/index.js +4 -0
- package/es/components/tooltip/tokens.d.ts +32 -0
- package/es/components/tooltip/tokens.js +71 -0
- package/es/components/tooltip/tooltip.d.ts +28 -0
- package/es/components/tooltip/tooltip.js +514 -0
- package/es/components/tooltip/types.d.ts +75 -0
- package/es/components/tooltip/types.js +1 -0
- package/es/components/touchableOpacity/index.d.ts +4 -0
- package/es/components/touchableOpacity/index.js +3 -0
- package/es/components/touchableOpacity/touchableOpacity.d.ts +5 -0
- package/es/components/touchableOpacity/touchableOpacity.js +177 -0
- package/es/components/touchableOpacity/types.d.ts +34 -0
- package/es/components/touchableOpacity/types.js +1 -0
- package/es/components/transfer/index.d.ts +4 -0
- package/es/components/transfer/index.js +3 -0
- package/es/components/transfer/tokens.d.ts +17 -0
- package/es/components/transfer/tokens.js +41 -0
- package/es/components/transfer/transfer.d.ts +5 -0
- package/es/components/transfer/transfer.js +617 -0
- package/es/components/transfer/types.d.ts +59 -0
- package/es/components/transfer/types.js +1 -0
- package/es/components/treeSelect/index.d.ts +4 -0
- package/es/components/treeSelect/index.js +3 -0
- package/es/components/treeSelect/style.css +11 -0
- package/es/components/treeSelect/tokens.d.ts +16 -0
- package/es/components/treeSelect/tokens.js +26 -0
- package/es/components/treeSelect/treeSelect.d.ts +6 -0
- package/es/components/treeSelect/treeSelect.js +842 -0
- package/es/components/treeSelect/types.d.ts +61 -0
- package/es/components/treeSelect/types.js +1 -0
- package/es/components/typography/index.d.ts +4 -0
- package/es/components/typography/index.js +2 -0
- package/es/components/typography/style.css +3 -0
- package/es/components/typography/types.d.ts +68 -0
- package/es/components/typography/types.js +1 -0
- package/es/components/typography/typography.d.ts +2 -0
- package/es/components/typography/typography.js +209 -0
- package/es/components/view/index.d.ts +4 -0
- package/es/components/view/index.js +3 -0
- package/es/components/view/observeLayout.d.ts +2 -0
- package/es/components/view/observeLayout.h5.d.ts +2 -0
- package/es/components/view/observeLayout.h5.js +9 -0
- package/es/components/view/observeLayout.js +3 -0
- package/es/components/view/types.d.ts +81 -0
- package/es/components/view/types.js +1 -0
- package/es/components/view/view.d.ts +5 -0
- package/es/components/view/view.js +194 -0
- package/es/components/withDivider/index.d.ts +4 -0
- package/es/components/withDivider/index.js +3 -0
- package/es/components/withDivider/types.d.ts +56 -0
- package/es/components/withDivider/types.js +1 -0
- package/es/components/withDivider/withDivider.d.ts +6 -0
- package/es/components/withDivider/withDivider.js +156 -0
- package/es/index.d.ts +117 -0
- package/es/index.js +149 -0
- package/es/patterns/fieldControl/index.d.ts +36 -0
- package/es/patterns/fieldControl/index.js +43 -0
- package/es/patterns/index.d.ts +8 -0
- package/es/patterns/index.js +8 -0
- package/es/patterns/listItem/index.d.ts +30 -0
- package/es/patterns/listItem/index.js +41 -0
- package/es/patterns/overlay/index.d.ts +25 -0
- package/es/patterns/overlay/index.js +176 -0
- package/es/patterns/overlay/types.d.ts +38 -0
- package/es/patterns/overlay/types.js +1 -0
- package/es/patterns/overlay/useOverlayTransition.d.ts +6 -0
- package/es/patterns/overlay/useOverlayTransition.js +60 -0
- package/es/patterns/pickerColumns/WheelPicker.d.ts +32 -0
- package/es/patterns/pickerColumns/WheelPicker.js +356 -0
- package/es/patterns/pickerColumns/index.d.ts +38 -0
- package/es/patterns/pickerColumns/index.js +85 -0
- package/es/patterns/pressable/index.d.ts +47 -0
- package/es/patterns/pressable/index.js +104 -0
- package/es/taro-components.d.ts +51 -0
- package/es/theme/default-theme.d.ts +28 -0
- package/es/theme/default-theme.js +130 -0
- package/es/theme/generated/design-system.generated.d.ts +1486 -0
- package/es/theme/generated/design-system.generated.js +1398 -0
- package/es/theme/hooks/useTheme.d.ts +5 -0
- package/es/theme/hooks/useTheme.js +5 -0
- package/es/theme/hooks/useToken.d.ts +408 -0
- package/es/theme/hooks/useToken.js +113 -0
- package/es/theme/index.d.ts +18 -0
- package/es/theme/index.js +27 -0
- package/es/theme/listTypography.d.ts +44 -0
- package/es/theme/listTypography.js +99 -0
- package/es/theme/runtime/ThemeProvider.d.ts +30 -0
- package/es/theme/runtime/ThemeProvider.js +308 -0
- package/es/theme/runtime/componentTokens.d.ts +10 -0
- package/es/theme/runtime/componentTokens.js +542 -0
- package/es/theme/runtime/cssVariables.d.ts +28 -0
- package/es/theme/runtime/cssVariables.js +221 -0
- package/es/theme/runtime/slotOverrides.d.ts +35 -0
- package/es/theme/runtime/slotOverrides.js +80 -0
- package/es/theme/selectionControl.d.ts +126 -0
- package/es/theme/selectionControl.js +135 -0
- package/es/theme/types.d.ts +94 -0
- package/es/theme/types.js +1 -0
- package/es/theme/typography.d.ts +88 -0
- package/es/theme/typography.js +29 -0
- package/es/utils/iconSlot.d.ts +3 -0
- package/es/utils/iconSlot.js +16 -0
- package/es/utils/index.d.ts +50 -0
- package/es/utils/index.js +131 -0
- package/es/utils/inlineAlignment.d.ts +12 -0
- package/es/utils/inlineAlignment.js +34 -0
- package/es/utils/locale.d.ts +3 -0
- package/es/utils/locale.js +8 -0
- package/es/utils/resolveThemeColor.d.ts +6 -0
- package/es/utils/resolveThemeColor.js +11 -0
- package/es/utils/style.d.ts +8 -0
- package/es/utils/style.js +70 -0
- package/es/utils/taroProps.d.ts +20 -0
- package/es/utils/taroProps.js +62 -0
- package/lib/adapters/miniapp/index.d.ts +9 -0
- package/lib/adapters/miniapp/index.js +31 -0
- package/lib/adapters/miniapp/measure.d.ts +43 -0
- package/lib/adapters/miniapp/measure.js +147 -0
- package/lib/adapters/miniapp/overlayHost.d.ts +23 -0
- package/lib/adapters/miniapp/overlayHost.js +152 -0
- package/lib/adapters/miniapp/portal.d.ts +26 -0
- package/lib/adapters/miniapp/portal.js +55 -0
- package/lib/adapters/miniapp/scroll.d.ts +29 -0
- package/lib/adapters/miniapp/scroll.js +96 -0
- package/lib/adapters/miniapp/touch.d.ts +57 -0
- package/lib/adapters/miniapp/touch.js +158 -0
- package/lib/auth/components.d.ts +117 -0
- package/lib/auth/components.js +932 -0
- package/lib/auth/entries/account-security.d.ts +3 -0
- package/lib/auth/entries/account-security.js +30 -0
- package/lib/auth/entries/change-password.d.ts +3 -0
- package/lib/auth/entries/change-password.js +30 -0
- package/lib/auth/entries/forgot-password.d.ts +3 -0
- package/lib/auth/entries/forgot-password.js +30 -0
- package/lib/auth/entries/identifier-binding.d.ts +3 -0
- package/lib/auth/entries/identifier-binding.js +38 -0
- package/lib/auth/entries/phone-number-input.d.ts +3 -0
- package/lib/auth/entries/phone-number-input.js +30 -0
- package/lib/auth/entries/provider.d.ts +2 -0
- package/lib/auth/entries/provider.js +23 -0
- package/lib/auth/entries/quick-sign-in.d.ts +3 -0
- package/lib/auth/entries/quick-sign-in.js +32 -0
- package/lib/auth/entries/sign-in.d.ts +3 -0
- package/lib/auth/entries/sign-in.js +30 -0
- package/lib/auth/entries/sign-up.d.ts +3 -0
- package/lib/auth/entries/sign-up.js +30 -0
- package/lib/auth/entries/theme.d.ts +2 -0
- package/lib/auth/entries/theme.js +23 -0
- package/lib/auth/entries/third-party-sign-in.d.ts +3 -0
- package/lib/auth/entries/third-party-sign-in.js +30 -0
- package/lib/auth/entries/types.d.ts +2 -0
- package/lib/auth/entries/types.js +23 -0
- package/lib/auth/index.d.ts +7 -0
- package/lib/auth/index.js +32 -0
- package/lib/auth/internal.d.ts +55 -0
- package/lib/auth/internal.js +186 -0
- package/lib/auth/phoneNumberInput.d.ts +22 -0
- package/lib/auth/phoneNumberInput.js +120 -0
- package/lib/auth/provider.d.ts +13 -0
- package/lib/auth/provider.js +67 -0
- package/lib/auth/styles.css +316 -0
- package/lib/auth/theme.d.ts +12 -0
- package/lib/auth/theme.js +47 -0
- package/lib/auth/types.d.ts +17 -0
- package/lib/auth/types.js +29 -0
- package/lib/components/_shared/render.d.ts +16 -0
- package/lib/components/_shared/render.js +63 -0
- package/lib/components/_shared/seedSurface.d.ts +8 -0
- package/lib/components/_shared/seedSurface.js +60 -0
- package/lib/components/actionSheet/actionSheet.d.ts +14 -0
- package/lib/components/actionSheet/actionSheet.js +431 -0
- package/lib/components/actionSheet/index.d.ts +4 -0
- package/lib/components/actionSheet/index.js +38 -0
- package/lib/components/actionSheet/tokens.d.ts +36 -0
- package/lib/components/actionSheet/tokens.js +145 -0
- package/lib/components/actionSheet/types.d.ts +82 -0
- package/lib/components/actionSheet/types.js +17 -0
- package/lib/components/affix/affix.d.ts +5 -0
- package/lib/components/affix/affix.js +74 -0
- package/lib/components/affix/index.d.ts +3 -0
- package/lib/components/affix/index.js +29 -0
- package/lib/components/affix/types.d.ts +14 -0
- package/lib/components/affix/types.js +17 -0
- package/lib/components/alert/alert.d.ts +5 -0
- package/lib/components/alert/alert.js +230 -0
- package/lib/components/alert/index.d.ts +5 -0
- package/lib/components/alert/index.js +50 -0
- package/lib/components/alert/tokens.d.ts +37 -0
- package/lib/components/alert/tokens.js +125 -0
- package/lib/components/alert/types.d.ts +54 -0
- package/lib/components/alert/types.js +17 -0
- package/lib/components/attachment/attachment.d.ts +22 -0
- package/lib/components/attachment/attachment.js +432 -0
- package/lib/components/attachment/index.d.ts +3 -0
- package/lib/components/attachment/index.js +56 -0
- package/lib/components/attachment/types.d.ts +141 -0
- package/lib/components/attachment/types.js +17 -0
- package/lib/components/avatar/avatar.d.ts +15 -0
- package/lib/components/avatar/avatar.js +360 -0
- package/lib/components/avatar/index.d.ts +7 -0
- package/lib/components/avatar/index.js +38 -0
- package/lib/components/avatar/style.css +14 -0
- package/lib/components/avatar/tokens.d.ts +30 -0
- package/lib/components/avatar/tokens.js +129 -0
- package/lib/components/avatar/types.d.ts +73 -0
- package/lib/components/avatar/types.js +17 -0
- package/lib/components/badge/badge.d.ts +13 -0
- package/lib/components/badge/badge.js +301 -0
- package/lib/components/badge/index.d.ts +7 -0
- package/lib/components/badge/index.js +44 -0
- package/lib/components/badge/tokens.d.ts +44 -0
- package/lib/components/badge/tokens.js +155 -0
- package/lib/components/badge/types.d.ts +74 -0
- package/lib/components/badge/types.js +17 -0
- package/lib/components/barLoading/barLoading.d.ts +12 -0
- package/lib/components/barLoading/barLoading.js +88 -0
- package/lib/components/barLoading/index.d.ts +4 -0
- package/lib/components/barLoading/index.js +44 -0
- package/lib/components/barLoading/style.css +16 -0
- package/lib/components/barLoading/types.d.ts +18 -0
- package/lib/components/barLoading/types.js +17 -0
- package/lib/components/breadcrumb/breadcrumb.d.ts +7 -0
- package/lib/components/breadcrumb/breadcrumb.js +140 -0
- package/lib/components/breadcrumb/index.d.ts +3 -0
- package/lib/components/breadcrumb/index.js +29 -0
- package/lib/components/breadcrumb/types.d.ts +21 -0
- package/lib/components/breadcrumb/types.js +17 -0
- package/lib/components/button/button.d.ts +11 -0
- package/lib/components/button/button.js +259 -0
- package/lib/components/button/index.d.ts +7 -0
- package/lib/components/button/index.js +38 -0
- package/lib/components/button/style.css +4 -0
- package/lib/components/button/tokens.d.ts +37 -0
- package/lib/components/button/tokens.js +184 -0
- package/lib/components/button/types.d.ts +69 -0
- package/lib/components/button/types.js +17 -0
- package/lib/components/capsuleTabs/capsuleTabs.d.ts +6 -0
- package/lib/components/capsuleTabs/capsuleTabs.js +537 -0
- package/lib/components/capsuleTabs/index.d.ts +3 -0
- package/lib/components/capsuleTabs/index.js +31 -0
- package/lib/components/capsuleTabs/types.d.ts +48 -0
- package/lib/components/capsuleTabs/types.js +17 -0
- package/lib/components/card/card.d.ts +20 -0
- package/lib/components/card/card.js +288 -0
- package/lib/components/card/index.d.ts +7 -0
- package/lib/components/card/index.js +40 -0
- package/lib/components/card/tokens.d.ts +37 -0
- package/lib/components/card/tokens.js +178 -0
- package/lib/components/card/types.d.ts +74 -0
- package/lib/components/card/types.js +17 -0
- package/lib/components/cascadePicker/cascadePicker.d.ts +5 -0
- package/lib/components/cascadePicker/cascadePicker.js +164 -0
- package/lib/components/cascadePicker/index.d.ts +4 -0
- package/lib/components/cascadePicker/index.js +44 -0
- package/lib/components/cascadePicker/shared.d.ts +29 -0
- package/lib/components/cascadePicker/shared.js +211 -0
- package/lib/components/cascadePicker/types.d.ts +59 -0
- package/lib/components/cascadePicker/types.js +17 -0
- package/lib/components/cascadePickerView/cascadePickerView.d.ts +5 -0
- package/lib/components/cascadePickerView/cascadePickerView.js +121 -0
- package/lib/components/cascadePickerView/index.d.ts +4 -0
- package/lib/components/cascadePickerView/index.js +44 -0
- package/lib/components/cascadePickerView/types.d.ts +27 -0
- package/lib/components/cascadePickerView/types.js +17 -0
- package/lib/components/cascader/cascader.d.ts +5 -0
- package/lib/components/cascader/cascader.js +436 -0
- package/lib/components/cascader/index.d.ts +4 -0
- package/lib/components/cascader/index.js +44 -0
- package/lib/components/cascader/types.d.ts +54 -0
- package/lib/components/cascader/types.js +17 -0
- package/lib/components/cascaderView/cascaderView.d.ts +5 -0
- package/lib/components/cascaderView/cascaderView.js +683 -0
- package/lib/components/cascaderView/index.d.ts +4 -0
- package/lib/components/cascaderView/index.js +44 -0
- package/lib/components/cascaderView/types.d.ts +25 -0
- package/lib/components/cascaderView/types.js +17 -0
- package/lib/components/checkList/checkList.d.ts +9 -0
- package/lib/components/checkList/checkList.js +408 -0
- package/lib/components/checkList/index.d.ts +5 -0
- package/lib/components/checkList/index.js +47 -0
- package/lib/components/checkList/types.d.ts +41 -0
- package/lib/components/checkList/types.js +17 -0
- package/lib/components/checkbox/checkbox.d.ts +15 -0
- package/lib/components/checkbox/checkbox.js +274 -0
- package/lib/components/checkbox/index.d.ts +7 -0
- package/lib/components/checkbox/index.js +40 -0
- package/lib/components/checkbox/tokens.d.ts +38 -0
- package/lib/components/checkbox/tokens.js +147 -0
- package/lib/components/checkbox/types.d.ts +73 -0
- package/lib/components/checkbox/types.js +17 -0
- package/lib/components/collapse/collapse.d.ts +9 -0
- package/lib/components/collapse/collapse.js +351 -0
- package/lib/components/collapse/index.d.ts +4 -0
- package/lib/components/collapse/index.js +46 -0
- package/lib/components/collapse/types.d.ts +33 -0
- package/lib/components/collapse/types.js +17 -0
- package/lib/components/command/command.d.ts +7 -0
- package/lib/components/command/command.js +658 -0
- package/lib/components/command/index.d.ts +4 -0
- package/lib/components/command/index.js +44 -0
- package/lib/components/command/style.css +5 -0
- package/lib/components/command/types.d.ts +69 -0
- package/lib/components/command/types.js +17 -0
- package/lib/components/configProvider/configProvider.d.ts +12 -0
- package/lib/components/configProvider/configProvider.js +176 -0
- package/lib/components/configProvider/index.d.ts +4 -0
- package/lib/components/configProvider/index.js +52 -0
- package/lib/components/configProvider/types.d.ts +48 -0
- package/lib/components/configProvider/types.js +17 -0
- package/lib/components/contextMenu/contextMenu.d.ts +6 -0
- package/lib/components/contextMenu/contextMenu.js +652 -0
- package/lib/components/contextMenu/index.d.ts +4 -0
- package/lib/components/contextMenu/index.js +46 -0
- package/lib/components/contextMenu/types.d.ts +69 -0
- package/lib/components/contextMenu/types.js +17 -0
- package/lib/components/datePicker/datePicker.d.ts +6 -0
- package/lib/components/datePicker/datePicker.js +427 -0
- package/lib/components/datePicker/index.d.ts +4 -0
- package/lib/components/datePicker/index.js +44 -0
- package/lib/components/datePicker/shared.d.ts +35 -0
- package/lib/components/datePicker/shared.js +304 -0
- package/lib/components/datePicker/types.d.ts +77 -0
- package/lib/components/datePicker/types.js +17 -0
- package/lib/components/datePickerView/datePickerView.d.ts +5 -0
- package/lib/components/datePickerView/datePickerView.js +175 -0
- package/lib/components/datePickerView/index.d.ts +4 -0
- package/lib/components/datePickerView/index.js +44 -0
- package/lib/components/datePickerView/types.d.ts +35 -0
- package/lib/components/datePickerView/types.js +17 -0
- package/lib/components/descriptions/descriptions.d.ts +5 -0
- package/lib/components/descriptions/descriptions.js +239 -0
- package/lib/components/descriptions/index.d.ts +3 -0
- package/lib/components/descriptions/index.js +29 -0
- package/lib/components/descriptions/types.d.ts +28 -0
- package/lib/components/descriptions/types.js +17 -0
- package/lib/components/dialog/dialog.d.ts +21 -0
- package/lib/components/dialog/dialog.js +574 -0
- package/lib/components/dialog/index.d.ts +6 -0
- package/lib/components/dialog/index.js +45 -0
- package/lib/components/dialog/tokens.d.ts +38 -0
- package/lib/components/dialog/tokens.js +154 -0
- package/lib/components/dialog/types.d.ts +104 -0
- package/lib/components/dialog/types.js +17 -0
- package/lib/components/dimensions/dimensions.d.ts +27 -0
- package/lib/components/dimensions/dimensions.js +424 -0
- package/lib/components/dimensions/index.d.ts +4 -0
- package/lib/components/dimensions/index.js +54 -0
- package/lib/components/dimensions/types.d.ts +85 -0
- package/lib/components/dimensions/types.js +17 -0
- package/lib/components/divider/divider.d.ts +8 -0
- package/lib/components/divider/divider.js +221 -0
- package/lib/components/divider/index.d.ts +7 -0
- package/lib/components/divider/index.js +36 -0
- package/lib/components/divider/tokens.d.ts +24 -0
- package/lib/components/divider/tokens.js +90 -0
- package/lib/components/divider/types.d.ts +29 -0
- package/lib/components/divider/types.js +17 -0
- package/lib/components/dotLoading/dotLoading.d.ts +12 -0
- package/lib/components/dotLoading/dotLoading.js +93 -0
- package/lib/components/dotLoading/index.d.ts +4 -0
- package/lib/components/dotLoading/index.js +44 -0
- package/lib/components/dotLoading/style.css +16 -0
- package/lib/components/dotLoading/types.d.ts +24 -0
- package/lib/components/dotLoading/types.js +17 -0
- package/lib/components/drawer/drawer.d.ts +5 -0
- package/lib/components/drawer/drawer.js +173 -0
- package/lib/components/drawer/index.d.ts +3 -0
- package/lib/components/drawer/index.js +29 -0
- package/lib/components/drawer/types.d.ts +32 -0
- package/lib/components/drawer/types.js +17 -0
- package/lib/components/dropdown/dropdown.d.ts +5 -0
- package/lib/components/dropdown/dropdown.js +588 -0
- package/lib/components/dropdown/index.d.ts +4 -0
- package/lib/components/dropdown/index.js +44 -0
- package/lib/components/dropdown/types.d.ts +84 -0
- package/lib/components/dropdown/types.js +17 -0
- package/lib/components/dropdownMenu/dropdownMenu.d.ts +5 -0
- package/lib/components/dropdownMenu/dropdownMenu.js +524 -0
- package/lib/components/dropdownMenu/index.d.ts +4 -0
- package/lib/components/dropdownMenu/index.js +44 -0
- package/lib/components/dropdownMenu/types.d.ts +47 -0
- package/lib/components/dropdownMenu/types.js +17 -0
- package/lib/components/ellipsis/ellipsis.d.ts +6 -0
- package/lib/components/ellipsis/ellipsis.js +237 -0
- package/lib/components/ellipsis/index.d.ts +4 -0
- package/lib/components/ellipsis/index.js +46 -0
- package/lib/components/ellipsis/types.d.ts +36 -0
- package/lib/components/ellipsis/types.js +17 -0
- package/lib/components/empty/empty.d.ts +9 -0
- package/lib/components/empty/empty.js +80 -0
- package/lib/components/empty/index.d.ts +3 -0
- package/lib/components/empty/index.js +29 -0
- package/lib/components/empty/types.d.ts +14 -0
- package/lib/components/empty/types.js +17 -0
- package/lib/components/errorBlock/errorBlock.d.ts +5 -0
- package/lib/components/errorBlock/errorBlock.js +263 -0
- package/lib/components/errorBlock/index.d.ts +4 -0
- package/lib/components/errorBlock/index.js +44 -0
- package/lib/components/errorBlock/types.d.ts +25 -0
- package/lib/components/errorBlock/types.js +17 -0
- package/lib/components/flatList/flatList.d.ts +7 -0
- package/lib/components/flatList/flatList.js +533 -0
- package/lib/components/flatList/index.d.ts +4 -0
- package/lib/components/flatList/index.js +44 -0
- package/lib/components/flatList/scrollTargetMeasurement.d.ts +17 -0
- package/lib/components/flatList/scrollTargetMeasurement.h5.d.ts +3 -0
- package/lib/components/flatList/scrollTargetMeasurement.h5.js +43 -0
- package/lib/components/flatList/scrollTargetMeasurement.js +54 -0
- package/lib/components/flatList/types.d.ts +88 -0
- package/lib/components/flatList/types.js +17 -0
- package/lib/components/form/form.d.ts +5 -0
- package/lib/components/form/form.js +508 -0
- package/lib/components/form/index.d.ts +4 -0
- package/lib/components/form/index.js +44 -0
- package/lib/components/form/types.d.ts +156 -0
- package/lib/components/form/types.js +17 -0
- package/lib/components/grid/grid.d.ts +9 -0
- package/lib/components/grid/grid.js +259 -0
- package/lib/components/grid/index.d.ts +4 -0
- package/lib/components/grid/index.js +46 -0
- package/lib/components/grid/types.d.ts +53 -0
- package/lib/components/grid/types.js +17 -0
- package/lib/components/icon/aliases.d.ts +7 -0
- package/lib/components/icon/aliases.js +71 -0
- package/lib/components/icon/icon.d.ts +5 -0
- package/lib/components/icon/icon.js +130 -0
- package/lib/components/icon/index.d.ts +5 -0
- package/lib/components/icon/index.js +47 -0
- package/lib/components/icon/lucide.generated.d.ts +576 -0
- package/lib/components/icon/lucide.generated.js +1404 -0
- package/lib/components/icon/types.d.ts +36 -0
- package/lib/components/icon/types.js +17 -0
- package/lib/components/image/image.d.ts +11 -0
- package/lib/components/image/image.js +158 -0
- package/lib/components/image/index.d.ts +4 -0
- package/lib/components/image/index.js +44 -0
- package/lib/components/image/types.d.ts +48 -0
- package/lib/components/image/types.js +17 -0
- package/lib/components/input/index.d.ts +7 -0
- package/lib/components/input/index.js +34 -0
- package/lib/components/input/input.d.ts +10 -0
- package/lib/components/input/input.js +292 -0
- package/lib/components/input/style.css +9 -0
- package/lib/components/input/tokens.d.ts +27 -0
- package/lib/components/input/tokens.js +83 -0
- package/lib/components/input/types.d.ts +72 -0
- package/lib/components/input/types.js +17 -0
- package/lib/components/inputItem/index.d.ts +5 -0
- package/lib/components/inputItem/index.js +46 -0
- package/lib/components/inputItem/inputItem.d.ts +9 -0
- package/lib/components/inputItem/inputItem.js +413 -0
- package/lib/components/inputItem/tokens.d.ts +31 -0
- package/lib/components/inputItem/tokens.js +99 -0
- package/lib/components/inputItem/types.d.ts +66 -0
- package/lib/components/inputItem/types.js +17 -0
- package/lib/components/internal/index.d.ts +3 -0
- package/lib/components/internal/index.js +29 -0
- package/lib/components/internal/internal.d.ts +5 -0
- package/lib/components/internal/internal.js +85 -0
- package/lib/components/internal/selectionControl/presentation.d.ts +31 -0
- package/lib/components/internal/selectionControl/presentation.js +58 -0
- package/lib/components/internal/selectionControl/useTaroScrollIntoView.d.ts +19 -0
- package/lib/components/internal/selectionControl/useTaroScrollIntoView.js +78 -0
- package/lib/components/internal/selectionControl/useTaroSelectionIndicator.d.ts +22 -0
- package/lib/components/internal/selectionControl/useTaroSelectionIndicator.js +150 -0
- package/lib/components/internal/types.d.ts +10 -0
- package/lib/components/internal/types.js +17 -0
- package/lib/components/item/index.d.ts +4 -0
- package/lib/components/item/index.js +62 -0
- package/lib/components/item/item.d.ts +14 -0
- package/lib/components/item/item.js +460 -0
- package/lib/components/item/types.d.ts +58 -0
- package/lib/components/item/types.js +17 -0
- package/lib/components/kbd/index.d.ts +4 -0
- package/lib/components/kbd/index.js +46 -0
- package/lib/components/kbd/kbd.d.ts +6 -0
- package/lib/components/kbd/kbd.js +238 -0
- package/lib/components/kbd/types.d.ts +38 -0
- package/lib/components/kbd/types.js +17 -0
- package/lib/components/layout/index.d.ts +5 -0
- package/lib/components/layout/index.js +45 -0
- package/lib/components/layout/layout.d.ts +17 -0
- package/lib/components/layout/layout.js +239 -0
- package/lib/components/layout/types.d.ts +54 -0
- package/lib/components/layout/types.js +17 -0
- package/lib/components/list/index.d.ts +3 -0
- package/lib/components/list/index.js +31 -0
- package/lib/components/list/list.d.ts +9 -0
- package/lib/components/list/list.js +444 -0
- package/lib/components/list/types.d.ts +49 -0
- package/lib/components/list/types.js +17 -0
- package/lib/components/mask/index.d.ts +5 -0
- package/lib/components/mask/index.js +53 -0
- package/lib/components/mask/mask.d.ts +11 -0
- package/lib/components/mask/mask.js +156 -0
- package/lib/components/mask/tokens.d.ts +29 -0
- package/lib/components/mask/tokens.js +84 -0
- package/lib/components/mask/types.d.ts +49 -0
- package/lib/components/mask/types.js +17 -0
- package/lib/components/masonryList/index.d.ts +4 -0
- package/lib/components/masonryList/index.js +44 -0
- package/lib/components/masonryList/masonryList.d.ts +7 -0
- package/lib/components/masonryList/masonryList.js +479 -0
- package/lib/components/masonryList/types.d.ts +65 -0
- package/lib/components/masonryList/types.js +17 -0
- package/lib/components/menu/index.d.ts +4 -0
- package/lib/components/menu/index.js +44 -0
- package/lib/components/menu/menu.d.ts +5 -0
- package/lib/components/menu/menu.js +547 -0
- package/lib/components/menu/types.d.ts +79 -0
- package/lib/components/menu/types.js +17 -0
- package/lib/components/menubar/index.d.ts +4 -0
- package/lib/components/menubar/index.js +44 -0
- package/lib/components/menubar/menubar.d.ts +5 -0
- package/lib/components/menubar/menubar.js +800 -0
- package/lib/components/menubar/types.d.ts +71 -0
- package/lib/components/menubar/types.js +17 -0
- package/lib/components/modal/index.d.ts +5 -0
- package/lib/components/modal/index.js +51 -0
- package/lib/components/modal/modal.d.ts +11 -0
- package/lib/components/modal/modal.js +228 -0
- package/lib/components/modal/tokens.d.ts +37 -0
- package/lib/components/modal/tokens.js +122 -0
- package/lib/components/modal/types.d.ts +63 -0
- package/lib/components/modal/types.js +17 -0
- package/lib/components/navBar/index.d.ts +4 -0
- package/lib/components/navBar/index.js +44 -0
- package/lib/components/navBar/navBar.d.ts +11 -0
- package/lib/components/navBar/navBar.js +259 -0
- package/lib/components/navBar/types.d.ts +32 -0
- package/lib/components/navBar/types.js +17 -0
- package/lib/components/needWrap/index.d.ts +4 -0
- package/lib/components/needWrap/index.js +44 -0
- package/lib/components/needWrap/needWrap.d.ts +12 -0
- package/lib/components/needWrap/needWrap.js +58 -0
- package/lib/components/needWrap/types.d.ts +12 -0
- package/lib/components/needWrap/types.js +17 -0
- package/lib/components/notification/index.d.ts +5 -0
- package/lib/components/notification/index.js +57 -0
- package/lib/components/notification/notification.d.ts +13 -0
- package/lib/components/notification/notification.js +568 -0
- package/lib/components/notification/tokens.d.ts +43 -0
- package/lib/components/notification/tokens.js +129 -0
- package/lib/components/notification/types.d.ts +76 -0
- package/lib/components/notification/types.js +17 -0
- package/lib/components/pageIndicator/index.d.ts +4 -0
- package/lib/components/pageIndicator/index.js +44 -0
- package/lib/components/pageIndicator/pageIndicator.d.ts +5 -0
- package/lib/components/pageIndicator/pageIndicator.js +230 -0
- package/lib/components/pageIndicator/types.d.ts +51 -0
- package/lib/components/pageIndicator/types.js +17 -0
- package/lib/components/pagination/index.d.ts +4 -0
- package/lib/components/pagination/index.js +44 -0
- package/lib/components/pagination/pagination.d.ts +5 -0
- package/lib/components/pagination/pagination.js +460 -0
- package/lib/components/pagination/tokens.d.ts +36 -0
- package/lib/components/pagination/tokens.js +128 -0
- package/lib/components/pagination/types.d.ts +36 -0
- package/lib/components/pagination/types.js +17 -0
- package/lib/components/picker/index.d.ts +6 -0
- package/lib/components/picker/index.js +55 -0
- package/lib/components/picker/picker.d.ts +9 -0
- package/lib/components/picker/picker.js +573 -0
- package/lib/components/picker/shared.d.ts +16 -0
- package/lib/components/picker/shared.js +109 -0
- package/lib/components/picker/tokens.d.ts +43 -0
- package/lib/components/picker/tokens.js +94 -0
- package/lib/components/picker/types.d.ts +110 -0
- package/lib/components/picker/types.js +17 -0
- package/lib/components/pickerView/index.d.ts +4 -0
- package/lib/components/pickerView/index.js +41 -0
- package/lib/components/pickerView/pickerView.d.ts +9 -0
- package/lib/components/pickerView/pickerView.js +204 -0
- package/lib/components/pickerView/types.d.ts +30 -0
- package/lib/components/pickerView/types.js +17 -0
- package/lib/components/popconfirm/index.d.ts +4 -0
- package/lib/components/popconfirm/index.js +44 -0
- package/lib/components/popconfirm/popconfirm.d.ts +20 -0
- package/lib/components/popconfirm/popconfirm.js +448 -0
- package/lib/components/popconfirm/types.d.ts +91 -0
- package/lib/components/popconfirm/types.js +17 -0
- package/lib/components/popover/index.d.ts +5 -0
- package/lib/components/popover/index.js +41 -0
- package/lib/components/popover/popover.d.ts +5 -0
- package/lib/components/popover/popover.js +206 -0
- package/lib/components/popover/types.d.ts +51 -0
- package/lib/components/popover/types.js +17 -0
- package/lib/components/popup/index.d.ts +4 -0
- package/lib/components/popup/index.js +38 -0
- package/lib/components/popup/popup.d.ts +9 -0
- package/lib/components/popup/popup.js +239 -0
- package/lib/components/popup/tokens.d.ts +38 -0
- package/lib/components/popup/tokens.js +168 -0
- package/lib/components/popup/types.d.ts +61 -0
- package/lib/components/popup/types.js +17 -0
- package/lib/components/portal/index.d.ts +4 -0
- package/lib/components/portal/index.js +44 -0
- package/lib/components/portal/portal.d.ts +11 -0
- package/lib/components/portal/portal.h5.d.ts +5 -0
- package/lib/components/portal/portal.h5.js +84 -0
- package/lib/components/portal/portal.js +63 -0
- package/lib/components/portal/types.d.ts +25 -0
- package/lib/components/portal/types.js +17 -0
- package/lib/components/progress/index.d.ts +3 -0
- package/lib/components/progress/index.js +29 -0
- package/lib/components/progress/progress.d.ts +5 -0
- package/lib/components/progress/progress.js +182 -0
- package/lib/components/progress/types.d.ts +16 -0
- package/lib/components/progress/types.js +17 -0
- package/lib/components/progressBar/index.d.ts +3 -0
- package/lib/components/progressBar/index.js +29 -0
- package/lib/components/progressBar/progressBar.d.ts +6 -0
- package/lib/components/progressBar/progressBar.js +214 -0
- package/lib/components/progressBar/style.css +13 -0
- package/lib/components/progressBar/tokens.d.ts +18 -0
- package/lib/components/progressBar/tokens.js +75 -0
- package/lib/components/progressBar/types.d.ts +40 -0
- package/lib/components/progressBar/types.js +17 -0
- package/lib/components/provider/index.d.ts +4 -0
- package/lib/components/provider/index.js +44 -0
- package/lib/components/provider/provider.d.ts +5 -0
- package/lib/components/provider/provider.js +79 -0
- package/lib/components/provider/types.d.ts +33 -0
- package/lib/components/provider/types.js +17 -0
- package/lib/components/radio/index.d.ts +7 -0
- package/lib/components/radio/index.js +42 -0
- package/lib/components/radio/radio.d.ts +12 -0
- package/lib/components/radio/radio.js +240 -0
- package/lib/components/radio/tokens.d.ts +41 -0
- package/lib/components/radio/tokens.js +158 -0
- package/lib/components/radio/types.d.ts +66 -0
- package/lib/components/radio/types.js +17 -0
- package/lib/components/rate/index.d.ts +4 -0
- package/lib/components/rate/index.js +44 -0
- package/lib/components/rate/rate.d.ts +5 -0
- package/lib/components/rate/rate.js +221 -0
- package/lib/components/rate/types.d.ts +33 -0
- package/lib/components/rate/types.js +17 -0
- package/lib/components/result/index.d.ts +3 -0
- package/lib/components/result/index.js +29 -0
- package/lib/components/result/result.d.ts +5 -0
- package/lib/components/result/result.js +96 -0
- package/lib/components/result/types.d.ts +27 -0
- package/lib/components/result/types.js +17 -0
- package/lib/components/resultPage/index.d.ts +4 -0
- package/lib/components/resultPage/index.js +44 -0
- package/lib/components/resultPage/resultPage.d.ts +5 -0
- package/lib/components/resultPage/resultPage.js +365 -0
- package/lib/components/resultPage/types.d.ts +56 -0
- package/lib/components/resultPage/types.js +17 -0
- package/lib/components/rollingNumber/index.d.ts +4 -0
- package/lib/components/rollingNumber/index.js +44 -0
- package/lib/components/rollingNumber/rollingNumber.d.ts +5 -0
- package/lib/components/rollingNumber/rollingNumber.js +306 -0
- package/lib/components/rollingNumber/types.d.ts +40 -0
- package/lib/components/rollingNumber/types.js +17 -0
- package/lib/components/safeArea/index.d.ts +4 -0
- package/lib/components/safeArea/index.js +46 -0
- package/lib/components/safeArea/safeArea.d.ts +7 -0
- package/lib/components/safeArea/safeArea.js +101 -0
- package/lib/components/safeArea/types.d.ts +22 -0
- package/lib/components/safeArea/types.js +17 -0
- package/lib/components/scrollFade/index.d.ts +3 -0
- package/lib/components/scrollFade/index.js +40 -0
- package/lib/components/scrollFade/scrollFade.d.ts +15 -0
- package/lib/components/scrollFade/scrollFade.js +204 -0
- package/lib/components/scrollFade/types.d.ts +44 -0
- package/lib/components/scrollFade/types.js +17 -0
- package/lib/components/scrollView/index.d.ts +4 -0
- package/lib/components/scrollView/index.js +44 -0
- package/lib/components/scrollView/scrollView.d.ts +6 -0
- package/lib/components/scrollView/scrollView.js +297 -0
- package/lib/components/scrollView/style.css +7 -0
- package/lib/components/scrollView/types.d.ts +48 -0
- package/lib/components/scrollView/types.js +17 -0
- package/lib/components/searchBar/index.d.ts +5 -0
- package/lib/components/searchBar/index.js +46 -0
- package/lib/components/searchBar/searchBar.d.ts +9 -0
- package/lib/components/searchBar/searchBar.js +374 -0
- package/lib/components/searchBar/tokens.d.ts +40 -0
- package/lib/components/searchBar/tokens.js +102 -0
- package/lib/components/searchBar/types.d.ts +65 -0
- package/lib/components/searchBar/types.js +17 -0
- package/lib/components/sectionList/index.d.ts +4 -0
- package/lib/components/sectionList/index.js +44 -0
- package/lib/components/sectionList/sectionList.d.ts +8 -0
- package/lib/components/sectionList/sectionList.js +464 -0
- package/lib/components/sectionList/types.d.ts +64 -0
- package/lib/components/sectionList/types.js +17 -0
- package/lib/components/segmented/index.d.ts +4 -0
- package/lib/components/segmented/index.js +44 -0
- package/lib/components/segmented/segmented.d.ts +5 -0
- package/lib/components/segmented/segmented.js +309 -0
- package/lib/components/segmented/types.d.ts +61 -0
- package/lib/components/segmented/types.js +17 -0
- package/lib/components/select/index.d.ts +5 -0
- package/lib/components/select/index.js +48 -0
- package/lib/components/select/select.d.ts +11 -0
- package/lib/components/select/select.js +769 -0
- package/lib/components/select/tokens.d.ts +60 -0
- package/lib/components/select/tokens.js +152 -0
- package/lib/components/select/types.d.ts +79 -0
- package/lib/components/select/types.js +17 -0
- package/lib/components/sendCode/index.d.ts +5 -0
- package/lib/components/sendCode/index.js +46 -0
- package/lib/components/sendCode/sendCode.d.ts +12 -0
- package/lib/components/sendCode/sendCode.js +179 -0
- package/lib/components/sendCode/tokens.d.ts +13 -0
- package/lib/components/sendCode/tokens.js +37 -0
- package/lib/components/sendCode/types.d.ts +54 -0
- package/lib/components/sendCode/types.js +17 -0
- package/lib/components/shimmer/index.d.ts +3 -0
- package/lib/components/shimmer/index.js +40 -0
- package/lib/components/shimmer/shimmer.d.ts +21 -0
- package/lib/components/shimmer/shimmer.js +214 -0
- package/lib/components/shimmer/style.css +31 -0
- package/lib/components/shimmer/types.d.ts +34 -0
- package/lib/components/shimmer/types.js +17 -0
- package/lib/components/showMoreText/index.d.ts +4 -0
- package/lib/components/showMoreText/index.js +44 -0
- package/lib/components/showMoreText/showMoreText.d.ts +5 -0
- package/lib/components/showMoreText/showMoreText.js +329 -0
- package/lib/components/showMoreText/types.d.ts +33 -0
- package/lib/components/showMoreText/types.js +17 -0
- package/lib/components/sideBar/index.d.ts +5 -0
- package/lib/components/sideBar/index.js +49 -0
- package/lib/components/sideBar/sideBar.d.ts +8 -0
- package/lib/components/sideBar/sideBar.js +396 -0
- package/lib/components/sideBar/types.d.ts +40 -0
- package/lib/components/sideBar/types.js +17 -0
- package/lib/components/skeleton/index.d.ts +4 -0
- package/lib/components/skeleton/index.js +51 -0
- package/lib/components/skeleton/skeleton.d.ts +15 -0
- package/lib/components/skeleton/skeleton.js +364 -0
- package/lib/components/skeleton/style.css +16 -0
- package/lib/components/skeleton/types.d.ts +71 -0
- package/lib/components/skeleton/types.js +17 -0
- package/lib/components/slider/index.d.ts +5 -0
- package/lib/components/slider/index.js +46 -0
- package/lib/components/slider/slider.d.ts +10 -0
- package/lib/components/slider/slider.js +470 -0
- package/lib/components/slider/tokens.d.ts +33 -0
- package/lib/components/slider/tokens.js +90 -0
- package/lib/components/slider/types.d.ts +43 -0
- package/lib/components/slider/types.js +17 -0
- package/lib/components/sonner/index.d.ts +5 -0
- package/lib/components/sonner/index.js +45 -0
- package/lib/components/sonner/sonner.d.ts +35 -0
- package/lib/components/sonner/sonner.js +717 -0
- package/lib/components/sonner/style.css +67 -0
- package/lib/components/sonner/types.d.ts +119 -0
- package/lib/components/sonner/types.js +17 -0
- package/lib/components/space/index.d.ts +4 -0
- package/lib/components/space/index.js +46 -0
- package/lib/components/space/space.d.ts +15 -0
- package/lib/components/space/space.js +124 -0
- package/lib/components/space/types.d.ts +41 -0
- package/lib/components/space/types.js +17 -0
- package/lib/components/spin/index.d.ts +3 -0
- package/lib/components/spin/index.js +29 -0
- package/lib/components/spin/spin.d.ts +6 -0
- package/lib/components/spin/spin.js +188 -0
- package/lib/components/spin/style.css +13 -0
- package/lib/components/spin/types.d.ts +21 -0
- package/lib/components/spin/types.js +17 -0
- package/lib/components/spinner/index.d.ts +4 -0
- package/lib/components/spinner/index.js +44 -0
- package/lib/components/spinner/spinner.d.ts +12 -0
- package/lib/components/spinner/spinner.js +175 -0
- package/lib/components/spinner/style.css +11 -0
- package/lib/components/spinner/types.d.ts +33 -0
- package/lib/components/spinner/types.js +17 -0
- package/lib/components/stepper/index.d.ts +5 -0
- package/lib/components/stepper/index.js +46 -0
- package/lib/components/stepper/stepper.d.ts +10 -0
- package/lib/components/stepper/stepper.js +362 -0
- package/lib/components/stepper/style.css +13 -0
- package/lib/components/stepper/tokens.d.ts +36 -0
- package/lib/components/stepper/tokens.js +119 -0
- package/lib/components/stepper/types.d.ts +50 -0
- package/lib/components/stepper/types.js +17 -0
- package/lib/components/steps/index.d.ts +3 -0
- package/lib/components/steps/index.js +29 -0
- package/lib/components/steps/steps.d.ts +5 -0
- package/lib/components/steps/steps.js +259 -0
- package/lib/components/steps/types.d.ts +29 -0
- package/lib/components/steps/types.js +17 -0
- package/lib/components/swiper/index.d.ts +4 -0
- package/lib/components/swiper/index.js +46 -0
- package/lib/components/swiper/swiper.d.ts +6 -0
- package/lib/components/swiper/swiper.js +336 -0
- package/lib/components/swiper/types.d.ts +51 -0
- package/lib/components/swiper/types.js +17 -0
- package/lib/components/switch/index.d.ts +5 -0
- package/lib/components/switch/index.js +46 -0
- package/lib/components/switch/style.css +10 -0
- package/lib/components/switch/switch.d.ts +10 -0
- package/lib/components/switch/switch.js +292 -0
- package/lib/components/switch/tokens.d.ts +33 -0
- package/lib/components/switch/tokens.js +90 -0
- package/lib/components/switch/types.d.ts +42 -0
- package/lib/components/switch/types.js +17 -0
- package/lib/components/tabBar/index.d.ts +4 -0
- package/lib/components/tabBar/index.js +43 -0
- package/lib/components/tabBar/tabBar.d.ts +12 -0
- package/lib/components/tabBar/tabBar.js +429 -0
- package/lib/components/tabBar/types.d.ts +46 -0
- package/lib/components/tabBar/types.js +17 -0
- package/lib/components/table/index.d.ts +4 -0
- package/lib/components/table/index.js +44 -0
- package/lib/components/table/table.d.ts +13 -0
- package/lib/components/table/table.js +1983 -0
- package/lib/components/table/types.d.ts +272 -0
- package/lib/components/table/types.js +17 -0
- package/lib/components/tabs/index.d.ts +3 -0
- package/lib/components/tabs/index.js +33 -0
- package/lib/components/tabs/tabs.d.ts +16 -0
- package/lib/components/tabs/tabs.js +785 -0
- package/lib/components/tabs/types.d.ts +124 -0
- package/lib/components/tabs/types.js +17 -0
- package/lib/components/tag/index.d.ts +7 -0
- package/lib/components/tag/index.js +42 -0
- package/lib/components/tag/tag.d.ts +17 -0
- package/lib/components/tag/tag.js +527 -0
- package/lib/components/tag/tokens.d.ts +43 -0
- package/lib/components/tag/tokens.js +155 -0
- package/lib/components/tag/types.d.ts +107 -0
- package/lib/components/tag/types.js +17 -0
- package/lib/components/text/index.d.ts +4 -0
- package/lib/components/text/index.js +44 -0
- package/lib/components/text/text.d.ts +5 -0
- package/lib/components/text/text.js +220 -0
- package/lib/components/text/types.d.ts +50 -0
- package/lib/components/text/types.js +17 -0
- package/lib/components/textInput/index.d.ts +4 -0
- package/lib/components/textInput/index.js +44 -0
- package/lib/components/textInput/style.css +37 -0
- package/lib/components/textInput/textInput.d.ts +10 -0
- package/lib/components/textInput/textInput.js +361 -0
- package/lib/components/textInput/types.d.ts +79 -0
- package/lib/components/textInput/types.js +17 -0
- package/lib/components/textarea/index.d.ts +5 -0
- package/lib/components/textarea/index.js +48 -0
- package/lib/components/textarea/style.css +32 -0
- package/lib/components/textarea/textarea.d.ts +10 -0
- package/lib/components/textarea/textarea.js +375 -0
- package/lib/components/textarea/tokens.d.ts +29 -0
- package/lib/components/textarea/tokens.js +115 -0
- package/lib/components/textarea/types.d.ts +120 -0
- package/lib/components/textarea/types.js +17 -0
- package/lib/components/toast/index.d.ts +4 -0
- package/lib/components/toast/index.js +42 -0
- package/lib/components/toast/style.css +9 -0
- package/lib/components/toast/toast.d.ts +21 -0
- package/lib/components/toast/toast.js +329 -0
- package/lib/components/toast/tokens.d.ts +48 -0
- package/lib/components/toast/tokens.js +174 -0
- package/lib/components/toast/types.d.ts +47 -0
- package/lib/components/toast/types.js +17 -0
- package/lib/components/tooltip/index.d.ts +5 -0
- package/lib/components/tooltip/index.js +46 -0
- package/lib/components/tooltip/tokens.d.ts +32 -0
- package/lib/components/tooltip/tokens.js +81 -0
- package/lib/components/tooltip/tooltip.d.ts +28 -0
- package/lib/components/tooltip/tooltip.js +537 -0
- package/lib/components/tooltip/types.d.ts +75 -0
- package/lib/components/tooltip/types.js +17 -0
- package/lib/components/touchableOpacity/index.d.ts +4 -0
- package/lib/components/touchableOpacity/index.js +44 -0
- package/lib/components/touchableOpacity/touchableOpacity.d.ts +5 -0
- package/lib/components/touchableOpacity/touchableOpacity.js +207 -0
- package/lib/components/touchableOpacity/types.d.ts +34 -0
- package/lib/components/touchableOpacity/types.js +17 -0
- package/lib/components/transfer/index.d.ts +4 -0
- package/lib/components/transfer/index.js +44 -0
- package/lib/components/transfer/tokens.d.ts +17 -0
- package/lib/components/transfer/tokens.js +59 -0
- package/lib/components/transfer/transfer.d.ts +5 -0
- package/lib/components/transfer/transfer.js +662 -0
- package/lib/components/transfer/types.d.ts +59 -0
- package/lib/components/transfer/types.js +17 -0
- package/lib/components/treeSelect/index.d.ts +4 -0
- package/lib/components/treeSelect/index.js +44 -0
- package/lib/components/treeSelect/style.css +11 -0
- package/lib/components/treeSelect/tokens.d.ts +16 -0
- package/lib/components/treeSelect/tokens.js +47 -0
- package/lib/components/treeSelect/treeSelect.d.ts +6 -0
- package/lib/components/treeSelect/treeSelect.js +781 -0
- package/lib/components/treeSelect/types.d.ts +61 -0
- package/lib/components/treeSelect/types.js +17 -0
- package/lib/components/typography/index.d.ts +4 -0
- package/lib/components/typography/index.js +41 -0
- package/lib/components/typography/style.css +3 -0
- package/lib/components/typography/types.d.ts +68 -0
- package/lib/components/typography/types.js +17 -0
- package/lib/components/typography/typography.d.ts +2 -0
- package/lib/components/typography/typography.js +247 -0
- package/lib/components/view/index.d.ts +4 -0
- package/lib/components/view/index.js +44 -0
- package/lib/components/view/observeLayout.d.ts +2 -0
- package/lib/components/view/observeLayout.h5.d.ts +2 -0
- package/lib/components/view/observeLayout.h5.js +35 -0
- package/lib/components/view/observeLayout.js +31 -0
- package/lib/components/view/types.d.ts +81 -0
- package/lib/components/view/types.js +17 -0
- package/lib/components/view/view.d.ts +5 -0
- package/lib/components/view/view.js +166 -0
- package/lib/components/withDivider/index.d.ts +4 -0
- package/lib/components/withDivider/index.js +48 -0
- package/lib/components/withDivider/types.d.ts +56 -0
- package/lib/components/withDivider/types.js +17 -0
- package/lib/components/withDivider/withDivider.d.ts +6 -0
- package/lib/components/withDivider/withDivider.js +181 -0
- package/lib/index.d.ts +117 -0
- package/lib/index.js +251 -0
- package/lib/patterns/fieldControl/index.d.ts +36 -0
- package/lib/patterns/fieldControl/index.js +58 -0
- package/lib/patterns/index.d.ts +8 -0
- package/lib/patterns/index.js +29 -0
- package/lib/patterns/listItem/index.d.ts +30 -0
- package/lib/patterns/listItem/index.js +45 -0
- package/lib/patterns/overlay/index.d.ts +25 -0
- package/lib/patterns/overlay/index.js +156 -0
- package/lib/patterns/overlay/types.d.ts +38 -0
- package/lib/patterns/overlay/types.js +17 -0
- package/lib/patterns/overlay/useOverlayTransition.d.ts +6 -0
- package/lib/patterns/overlay/useOverlayTransition.js +61 -0
- package/lib/patterns/pickerColumns/WheelPicker.d.ts +32 -0
- package/lib/patterns/pickerColumns/WheelPicker.js +383 -0
- package/lib/patterns/pickerColumns/index.d.ts +38 -0
- package/lib/patterns/pickerColumns/index.js +84 -0
- package/lib/patterns/pressable/index.d.ts +47 -0
- package/lib/patterns/pressable/index.js +108 -0
- package/lib/taro-components.d.ts +51 -0
- package/lib/theme/default-theme.d.ts +28 -0
- package/lib/theme/default-theme.js +139 -0
- package/lib/theme/generated/design-system.generated.d.ts +1486 -0
- package/lib/theme/generated/design-system.generated.js +1522 -0
- package/lib/theme/hooks/useTheme.d.ts +5 -0
- package/lib/theme/hooks/useTheme.js +37 -0
- package/lib/theme/hooks/useToken.d.ts +408 -0
- package/lib/theme/hooks/useToken.js +109 -0
- package/lib/theme/index.d.ts +18 -0
- package/lib/theme/index.js +182 -0
- package/lib/theme/listTypography.d.ts +44 -0
- package/lib/theme/listTypography.js +107 -0
- package/lib/theme/runtime/ThemeProvider.d.ts +30 -0
- package/lib/theme/runtime/ThemeProvider.js +278 -0
- package/lib/theme/runtime/componentTokens.d.ts +10 -0
- package/lib/theme/runtime/componentTokens.js +578 -0
- package/lib/theme/runtime/cssVariables.d.ts +28 -0
- package/lib/theme/runtime/cssVariables.js +213 -0
- package/lib/theme/runtime/slotOverrides.d.ts +35 -0
- package/lib/theme/runtime/slotOverrides.js +76 -0
- package/lib/theme/selectionControl.d.ts +126 -0
- package/lib/theme/selectionControl.js +151 -0
- package/lib/theme/types.d.ts +94 -0
- package/lib/theme/types.js +17 -0
- package/lib/theme/typography.d.ts +88 -0
- package/lib/theme/typography.js +61 -0
- package/lib/utils/iconSlot.d.ts +3 -0
- package/lib/utils/iconSlot.js +39 -0
- package/lib/utils/index.d.ts +50 -0
- package/lib/utils/index.js +109 -0
- package/lib/utils/inlineAlignment.d.ts +12 -0
- package/lib/utils/inlineAlignment.js +51 -0
- package/lib/utils/locale.d.ts +3 -0
- package/lib/utils/locale.js +34 -0
- package/lib/utils/resolveThemeColor.d.ts +6 -0
- package/lib/utils/resolveThemeColor.js +38 -0
- package/lib/utils/style.d.ts +8 -0
- package/lib/utils/style.js +81 -0
- package/lib/utils/taroProps.d.ts +20 -0
- package/lib/utils/taroProps.js +72 -0
- package/package.json +95 -0
|
@@ -0,0 +1,1983 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/table.tsx
|
|
30
|
+
var table_exports = {};
|
|
31
|
+
__export(table_exports, {
|
|
32
|
+
TableColumn: () => TableColumn,
|
|
33
|
+
TableColumnGroup: () => TableColumnGroup,
|
|
34
|
+
default: () => table_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(table_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_components = require("@tarojs/components");
|
|
39
|
+
var import_theme = require("../../theme");
|
|
40
|
+
var import_utils = require("../../utils");
|
|
41
|
+
var import_checkbox = require("../checkbox");
|
|
42
|
+
var import_configProvider = require("../configProvider");
|
|
43
|
+
var import_dimensions = require("../dimensions");
|
|
44
|
+
var import_icon = require("../icon");
|
|
45
|
+
var import_pagination = require("../pagination");
|
|
46
|
+
var import_radio = require("../radio");
|
|
47
|
+
var sizeMetrics = {
|
|
48
|
+
mini: {
|
|
49
|
+
rowMinHeight: 32,
|
|
50
|
+
paddingX: 8,
|
|
51
|
+
paddingY: 6,
|
|
52
|
+
fontSize: 12,
|
|
53
|
+
lineHeight: 18,
|
|
54
|
+
iconSize: 14
|
|
55
|
+
},
|
|
56
|
+
small: {
|
|
57
|
+
rowMinHeight: 36,
|
|
58
|
+
paddingX: 12,
|
|
59
|
+
paddingY: 8,
|
|
60
|
+
fontSize: 14,
|
|
61
|
+
lineHeight: 20,
|
|
62
|
+
iconSize: 14
|
|
63
|
+
},
|
|
64
|
+
middle: {
|
|
65
|
+
rowMinHeight: 40,
|
|
66
|
+
paddingX: 16,
|
|
67
|
+
paddingY: 10,
|
|
68
|
+
fontSize: 14,
|
|
69
|
+
lineHeight: 20,
|
|
70
|
+
iconSize: 16
|
|
71
|
+
},
|
|
72
|
+
large: {
|
|
73
|
+
rowMinHeight: 48,
|
|
74
|
+
paddingX: 20,
|
|
75
|
+
paddingY: 14,
|
|
76
|
+
fontSize: 14,
|
|
77
|
+
lineHeight: 20,
|
|
78
|
+
iconSize: 18
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
function TableColumn(_props) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
TableColumn.displayName = "Table.Column";
|
|
85
|
+
function TableColumnGroup(_props) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
TableColumnGroup.displayName = "Table.ColumnGroup";
|
|
89
|
+
function renderNode(node, style) {
|
|
90
|
+
return typeof node === "string" || typeof node === "number" ? /* @__PURE__ */ import_react.default.createElement(import_components.Text, { style }, node) : node;
|
|
91
|
+
}
|
|
92
|
+
function toCssSize(value) {
|
|
93
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
94
|
+
}
|
|
95
|
+
function getValueByDataIndex(record, dataIndex) {
|
|
96
|
+
if (dataIndex === void 0) return void 0;
|
|
97
|
+
const path = Array.isArray(dataIndex) ? dataIndex : String(dataIndex).split(".");
|
|
98
|
+
return path.reduce((current, part) => current == null ? void 0 : current[part], record);
|
|
99
|
+
}
|
|
100
|
+
function getColumnKey(column, index) {
|
|
101
|
+
if (column.key !== void 0) return String(column.key);
|
|
102
|
+
if (column.dataIndex !== void 0) {
|
|
103
|
+
return Array.isArray(column.dataIndex) ? column.dataIndex.map(String).join(".") : String(column.dataIndex);
|
|
104
|
+
}
|
|
105
|
+
return `column-${index}`;
|
|
106
|
+
}
|
|
107
|
+
function flattenColumns(columns) {
|
|
108
|
+
return columns.flatMap(
|
|
109
|
+
(column) => {
|
|
110
|
+
var _a;
|
|
111
|
+
return ((_a = column.children) == null ? void 0 : _a.length) ? flattenColumns(column.children) : [column];
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function getActiveBreakpoints(viewportWidth) {
|
|
116
|
+
if (viewportWidth <= 0) {
|
|
117
|
+
return /* @__PURE__ */ new Set(["xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
118
|
+
}
|
|
119
|
+
const active = /* @__PURE__ */ new Set();
|
|
120
|
+
if (viewportWidth < 576) active.add("xs");
|
|
121
|
+
if (viewportWidth >= 576) active.add("sm");
|
|
122
|
+
if (viewportWidth >= 768) active.add("md");
|
|
123
|
+
if (viewportWidth >= 992) active.add("lg");
|
|
124
|
+
if (viewportWidth >= 1200) active.add("xl");
|
|
125
|
+
if (viewportWidth >= 1600) active.add("xxl");
|
|
126
|
+
return active;
|
|
127
|
+
}
|
|
128
|
+
function filterVisibleColumnTree(columns, activeBreakpoints) {
|
|
129
|
+
return columns.flatMap((column) => {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
if (column.hidden || ((_a = column.responsive) == null ? void 0 : _a.length) && !column.responsive.some((breakpoint) => activeBreakpoints.has(breakpoint))) {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
if (!((_b = column.children) == null ? void 0 : _b.length)) return [column];
|
|
135
|
+
const children = filterVisibleColumnTree(column.children, activeBreakpoints);
|
|
136
|
+
return children.length ? [{ ...column, children }] : [];
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function getColumnDepth(column) {
|
|
140
|
+
var _a;
|
|
141
|
+
return ((_a = column.children) == null ? void 0 : _a.length) ? 1 + Math.max(...column.children.map(getColumnDepth)) : 1;
|
|
142
|
+
}
|
|
143
|
+
function getHeaderBandCells(columns, targetDepth, currentDepth = 0) {
|
|
144
|
+
return columns.flatMap((column) => {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
const leaves = flattenColumns([column]);
|
|
147
|
+
if (currentDepth === targetDepth) {
|
|
148
|
+
return [{ column, leaves, placeholder: !((_a = column.children) == null ? void 0 : _a.length) }];
|
|
149
|
+
}
|
|
150
|
+
return ((_b = column.children) == null ? void 0 : _b.length) ? getHeaderBandCells(column.children, targetDepth, currentDepth + 1) : [{ column, leaves, placeholder: true }];
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function isActivationKey(event) {
|
|
154
|
+
const key = event == null ? void 0 : event.key;
|
|
155
|
+
return key === "Enter" || key === " " || key === "Spacebar";
|
|
156
|
+
}
|
|
157
|
+
function convertChildrenToColumns(children) {
|
|
158
|
+
const columns = [];
|
|
159
|
+
import_react.default.Children.forEach(children, (child) => {
|
|
160
|
+
if (!import_react.default.isValidElement(child)) return;
|
|
161
|
+
if (child.type === TableColumn) {
|
|
162
|
+
const { children: _children, ...columnProps } = child.props;
|
|
163
|
+
columns.push({
|
|
164
|
+
...columnProps,
|
|
165
|
+
key: child.key ?? void 0
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (child.type === TableColumnGroup) {
|
|
170
|
+
const props = child.props;
|
|
171
|
+
columns.push({
|
|
172
|
+
...props,
|
|
173
|
+
key: child.key ?? void 0,
|
|
174
|
+
children: convertChildrenToColumns(props.children)
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return columns;
|
|
179
|
+
}
|
|
180
|
+
function flattenFilterItems(items) {
|
|
181
|
+
return items.flatMap((item) => [item, ...item.children ? flattenFilterItems(item.children) : []]);
|
|
182
|
+
}
|
|
183
|
+
function resolveRowKey(record, index, rowKey) {
|
|
184
|
+
if (typeof rowKey === "function") return rowKey(record, index);
|
|
185
|
+
const dataIndex = rowKey === void 0 ? "key" : String(rowKey);
|
|
186
|
+
return getValueByDataIndex(record, dataIndex) ?? index;
|
|
187
|
+
}
|
|
188
|
+
function resolveSemanticValue(value, props) {
|
|
189
|
+
return typeof value === "function" ? value({ props }) : value;
|
|
190
|
+
}
|
|
191
|
+
function getSorterCompare(column) {
|
|
192
|
+
if (typeof (column == null ? void 0 : column.sorter) === "function") return column.sorter;
|
|
193
|
+
if ((column == null ? void 0 : column.sorter) && typeof column.sorter === "object") return column.sorter.compare;
|
|
194
|
+
return void 0;
|
|
195
|
+
}
|
|
196
|
+
function getSorterMultiple(column) {
|
|
197
|
+
return (column == null ? void 0 : column.sorter) && typeof column.sorter === "object" ? column.sorter.multiple : void 0;
|
|
198
|
+
}
|
|
199
|
+
function applyTransforms(data, columns, filters, sortState) {
|
|
200
|
+
const filtered = columns.reduce(
|
|
201
|
+
(current, column, index) => {
|
|
202
|
+
const values = filters[getColumnKey(column, index)];
|
|
203
|
+
if (!(values == null ? void 0 : values.length) || !column.onFilter) return current;
|
|
204
|
+
return current.filter((record) => values.some((value) => {
|
|
205
|
+
var _a;
|
|
206
|
+
return (_a = column.onFilter) == null ? void 0 : _a.call(column, value, record);
|
|
207
|
+
}));
|
|
208
|
+
},
|
|
209
|
+
[...data]
|
|
210
|
+
);
|
|
211
|
+
if (!sortState.length) return filtered;
|
|
212
|
+
return [...filtered].sort((a, b) => {
|
|
213
|
+
for (const state of sortState) {
|
|
214
|
+
const column = columns.find((item, index) => getColumnKey(item, index) === state.columnKey);
|
|
215
|
+
const compare = getSorterCompare(column);
|
|
216
|
+
if (!compare) continue;
|
|
217
|
+
const result = compare(a, b);
|
|
218
|
+
if (result !== 0) return state.order === "ascend" ? result : -result;
|
|
219
|
+
}
|
|
220
|
+
return 0;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function stopPropagation(event) {
|
|
224
|
+
var _a;
|
|
225
|
+
(_a = event == null ? void 0 : event.stopPropagation) == null ? void 0 : _a.call(event);
|
|
226
|
+
}
|
|
227
|
+
function isInteractiveEventTarget(event) {
|
|
228
|
+
var _a;
|
|
229
|
+
const target = event == null ? void 0 : event.target;
|
|
230
|
+
return Boolean((_a = target == null ? void 0 : target.closest) == null ? void 0 : _a.call(target, 'button,a,input,label,select,textarea,[role="button"]'));
|
|
231
|
+
}
|
|
232
|
+
function normalizeFixed(fixed) {
|
|
233
|
+
if (fixed === true || fixed === "start") return "left";
|
|
234
|
+
if (fixed === "end") return "right";
|
|
235
|
+
return fixed;
|
|
236
|
+
}
|
|
237
|
+
function InternalTable(props, ref) {
|
|
238
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
239
|
+
const {
|
|
240
|
+
bordered = false,
|
|
241
|
+
children,
|
|
242
|
+
className,
|
|
243
|
+
classNames: semanticClassNamesProp,
|
|
244
|
+
columns: propColumns,
|
|
245
|
+
components,
|
|
246
|
+
dataSource = [],
|
|
247
|
+
defaultExpandedRowKeys = [],
|
|
248
|
+
defaultSelectedRowKeys = [],
|
|
249
|
+
emptyText,
|
|
250
|
+
expandable,
|
|
251
|
+
expandedRowRender,
|
|
252
|
+
footer,
|
|
253
|
+
loading = false,
|
|
254
|
+
locale,
|
|
255
|
+
onChange,
|
|
256
|
+
onHeaderRow,
|
|
257
|
+
onRow,
|
|
258
|
+
onScroll,
|
|
259
|
+
onSelectionChange,
|
|
260
|
+
pagination = {},
|
|
261
|
+
paginationVariant = "section",
|
|
262
|
+
rowClassName,
|
|
263
|
+
rowHoverable = true,
|
|
264
|
+
rowKey,
|
|
265
|
+
rowSelection,
|
|
266
|
+
scroll,
|
|
267
|
+
selectable = false,
|
|
268
|
+
selectedRowKeys: legacySelectedRowKeys,
|
|
269
|
+
showHeader = true,
|
|
270
|
+
showSorterTooltip = { target: "full-header" },
|
|
271
|
+
size: sizeProp,
|
|
272
|
+
sortDirections = ["ascend", "descend"],
|
|
273
|
+
sticky = false,
|
|
274
|
+
striped = false,
|
|
275
|
+
style,
|
|
276
|
+
styles: semanticStylesProp,
|
|
277
|
+
summary,
|
|
278
|
+
tableLayout = "auto",
|
|
279
|
+
testID,
|
|
280
|
+
title,
|
|
281
|
+
virtual = false
|
|
282
|
+
} = props;
|
|
283
|
+
const { theme } = (0, import_theme.useTheme)();
|
|
284
|
+
const providerSize = (0, import_configProvider.useSize)();
|
|
285
|
+
const providerDisabled = (0, import_configProvider.useDisabled)();
|
|
286
|
+
const { width: viewportWidth } = (0, import_dimensions.useWindowDimensions)();
|
|
287
|
+
const size = sizeProp ?? providerSize;
|
|
288
|
+
const disabled = Boolean(providerDisabled);
|
|
289
|
+
const metrics = sizeMetrics[size];
|
|
290
|
+
const rootRef = (0, import_react.useRef)(null);
|
|
291
|
+
const cellRenderCacheRef = (0, import_react.useRef)(
|
|
292
|
+
/* @__PURE__ */ new Map()
|
|
293
|
+
);
|
|
294
|
+
const selectionRecordCacheRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
295
|
+
const [scrollTop, setScrollTop] = (0, import_react.useState)(0);
|
|
296
|
+
const [scrollTarget, setScrollTarget] = (0, import_react.useState)("");
|
|
297
|
+
const [virtualScrollTop, setVirtualScrollTop] = (0, import_react.useState)(0);
|
|
298
|
+
const [horizontalScrollState, setHorizontalScrollState] = (0, import_react.useState)({
|
|
299
|
+
canScrollLeft: false,
|
|
300
|
+
canScrollRight: Boolean(scroll == null ? void 0 : scroll.x)
|
|
301
|
+
});
|
|
302
|
+
const [hoveredRowKey, setHoveredRowKey] = (0, import_react.useState)(null);
|
|
303
|
+
const [focusedControlKey, setFocusedControlKey] = (0, import_react.useState)(null);
|
|
304
|
+
const declaredColumns = (0, import_react.useMemo)(
|
|
305
|
+
() => (propColumns == null ? void 0 : propColumns.length) ? propColumns : convertChildrenToColumns(children),
|
|
306
|
+
[children, propColumns]
|
|
307
|
+
);
|
|
308
|
+
const activeBreakpoints = (0, import_react.useMemo)(() => getActiveBreakpoints(viewportWidth), [viewportWidth]);
|
|
309
|
+
const resolvedColumns = (0, import_react.useMemo)(
|
|
310
|
+
() => filterVisibleColumnTree(declaredColumns, activeBreakpoints),
|
|
311
|
+
[activeBreakpoints, declaredColumns]
|
|
312
|
+
);
|
|
313
|
+
const visibleColumns = (0, import_react.useMemo)(() => flattenColumns(resolvedColumns), [resolvedColumns]);
|
|
314
|
+
const headerDepth = (0, import_react.useMemo)(
|
|
315
|
+
() => Math.max(1, ...resolvedColumns.map(getColumnDepth)),
|
|
316
|
+
[resolvedColumns]
|
|
317
|
+
);
|
|
318
|
+
const semanticClassNames = resolveSemanticValue(semanticClassNamesProp, props) ?? {};
|
|
319
|
+
const semanticStyles = resolveSemanticValue(semanticStylesProp, props) ?? {};
|
|
320
|
+
const interactiveControlProps = (controlKey, onActivate, controlDisabled = disabled) => ({
|
|
321
|
+
tabIndex: controlDisabled ? -1 : 0,
|
|
322
|
+
"aria-disabled": controlDisabled,
|
|
323
|
+
"data-focused": focusedControlKey === controlKey ? "true" : "false",
|
|
324
|
+
onFocus: () => {
|
|
325
|
+
if (!controlDisabled) setFocusedControlKey(controlKey);
|
|
326
|
+
},
|
|
327
|
+
onBlur: () => setFocusedControlKey((current2) => current2 === controlKey ? null : current2),
|
|
328
|
+
onKeyDown: (event) => {
|
|
329
|
+
var _a2, _b2;
|
|
330
|
+
if (controlDisabled || !isActivationKey(event)) return;
|
|
331
|
+
const keyboardEvent = event;
|
|
332
|
+
(_a2 = keyboardEvent.preventDefault) == null ? void 0 : _a2.call(keyboardEvent);
|
|
333
|
+
(_b2 = keyboardEvent.stopPropagation) == null ? void 0 : _b2.call(keyboardEvent);
|
|
334
|
+
onActivate(event);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
const interactiveFocusStyle = (controlKey) => focusedControlKey === controlKey ? { boxShadow: "0 0 0 2px var(--x-table-focus-ring)" } : void 0;
|
|
338
|
+
const controlledSortColumns = visibleColumns.filter((column) => column.sortOrder !== void 0);
|
|
339
|
+
const controlledSortState = controlledSortColumns.length ? controlledSortColumns.flatMap(
|
|
340
|
+
(column) => column.sortOrder ? [
|
|
341
|
+
{
|
|
342
|
+
columnKey: getColumnKey(column, visibleColumns.indexOf(column)),
|
|
343
|
+
order: column.sortOrder
|
|
344
|
+
}
|
|
345
|
+
] : []
|
|
346
|
+
) : void 0;
|
|
347
|
+
const [innerSortState, setInnerSortState] = (0, import_react.useState)(() => {
|
|
348
|
+
const defaults = visibleColumns.flatMap(
|
|
349
|
+
(column, index) => column.defaultSortOrder ? [{ columnKey: getColumnKey(column, index), order: column.defaultSortOrder }] : []
|
|
350
|
+
);
|
|
351
|
+
return defaults.sort((first, second) => {
|
|
352
|
+
const firstColumn = visibleColumns.find(
|
|
353
|
+
(column, index) => getColumnKey(column, index) === first.columnKey
|
|
354
|
+
);
|
|
355
|
+
const secondColumn = visibleColumns.find(
|
|
356
|
+
(column, index) => getColumnKey(column, index) === second.columnKey
|
|
357
|
+
);
|
|
358
|
+
return (getSorterMultiple(secondColumn) ?? 0) - (getSorterMultiple(firstColumn) ?? 0);
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
const sortState = controlledSortState ?? innerSortState;
|
|
362
|
+
const [innerFilters, setInnerFilters] = (0, import_react.useState)(
|
|
363
|
+
() => visibleColumns.reduce((current2, column, index) => {
|
|
364
|
+
var _a2;
|
|
365
|
+
if ((_a2 = column.defaultFilteredValue) == null ? void 0 : _a2.length) {
|
|
366
|
+
current2[getColumnKey(column, index)] = column.defaultFilteredValue;
|
|
367
|
+
}
|
|
368
|
+
return current2;
|
|
369
|
+
}, {})
|
|
370
|
+
);
|
|
371
|
+
const filtersForChange = (0, import_react.useMemo)(
|
|
372
|
+
() => visibleColumns.reduce((current2, column, index) => {
|
|
373
|
+
if (!column.filters && column.filteredValue === void 0) return current2;
|
|
374
|
+
const key = getColumnKey(column, index);
|
|
375
|
+
current2[key] = column.filteredValue !== void 0 ? column.filteredValue : innerFilters[key] ?? null;
|
|
376
|
+
return current2;
|
|
377
|
+
}, {}),
|
|
378
|
+
[innerFilters, visibleColumns]
|
|
379
|
+
);
|
|
380
|
+
const [openFilterKey, setOpenFilterKey] = (0, import_react.useState)(null);
|
|
381
|
+
const [draftFilters, setDraftFilters] = (0, import_react.useState)({});
|
|
382
|
+
const draftFiltersRef = (0, import_react.useRef)({});
|
|
383
|
+
draftFiltersRef.current = draftFilters;
|
|
384
|
+
const paginationConfig = pagination === false ? false : pagination;
|
|
385
|
+
const paginationEnabled = paginationConfig !== false;
|
|
386
|
+
const [innerCurrent, setInnerCurrent] = (0, import_react.useState)(
|
|
387
|
+
paginationEnabled ? paginationConfig.defaultCurrent ?? 1 : 1
|
|
388
|
+
);
|
|
389
|
+
const [innerPageSize, setInnerPageSize] = (0, import_react.useState)(
|
|
390
|
+
paginationEnabled ? paginationConfig.defaultPageSize ?? paginationConfig.pageSize ?? 10 : 10
|
|
391
|
+
);
|
|
392
|
+
const current = paginationEnabled ? paginationConfig.current ?? innerCurrent : 1;
|
|
393
|
+
const pageSize = paginationEnabled ? paginationConfig.pageSize ?? innerPageSize : dataSource.length || 1;
|
|
394
|
+
const transformedData = (0, import_react.useMemo)(
|
|
395
|
+
() => applyTransforms(dataSource, visibleColumns, filtersForChange, sortState),
|
|
396
|
+
[dataSource, filtersForChange, sortState, visibleColumns]
|
|
397
|
+
);
|
|
398
|
+
const isRemotePagination = paginationEnabled && paginationConfig.total !== void 0 && paginationConfig.total > transformedData.length;
|
|
399
|
+
const total = paginationEnabled ? paginationConfig.total ?? transformedData.length : transformedData.length;
|
|
400
|
+
const totalPages = Math.max(1, Math.ceil(Math.max(total, 1) / Math.max(pageSize, 1)));
|
|
401
|
+
const safeCurrent = Math.min(Math.max(current, 1), totalPages);
|
|
402
|
+
const currentPageData = (0, import_react.useMemo)(() => {
|
|
403
|
+
if (!paginationEnabled || isRemotePagination) return transformedData;
|
|
404
|
+
const start = (safeCurrent - 1) * pageSize;
|
|
405
|
+
return transformedData.slice(start, start + pageSize);
|
|
406
|
+
}, [isRemotePagination, pageSize, paginationEnabled, safeCurrent, transformedData]);
|
|
407
|
+
(0, import_react.useEffect)(() => {
|
|
408
|
+
if (paginationEnabled && paginationConfig.current === void 0 && safeCurrent !== innerCurrent) {
|
|
409
|
+
setInnerCurrent(safeCurrent);
|
|
410
|
+
}
|
|
411
|
+
}, [innerCurrent, paginationConfig, paginationEnabled, safeCurrent]);
|
|
412
|
+
const resolvedRowSelection = rowSelection ? rowSelection : selectable ? {
|
|
413
|
+
selectedRowKeys: legacySelectedRowKeys,
|
|
414
|
+
defaultSelectedRowKeys
|
|
415
|
+
} : void 0;
|
|
416
|
+
const selectionControlled = (resolvedRowSelection == null ? void 0 : resolvedRowSelection.selectedRowKeys) !== void 0;
|
|
417
|
+
const [innerSelectedKeys, setInnerSelectedKeys] = (0, import_react.useState)(
|
|
418
|
+
(resolvedRowSelection == null ? void 0 : resolvedRowSelection.defaultSelectedRowKeys) ?? defaultSelectedRowKeys
|
|
419
|
+
);
|
|
420
|
+
const selectedKeys = (resolvedRowSelection == null ? void 0 : resolvedRowSelection.selectedRowKeys) ?? innerSelectedKeys;
|
|
421
|
+
const selectedKeySet = (0, import_react.useMemo)(() => new Set(selectedKeys.map(String)), [selectedKeys]);
|
|
422
|
+
const resolvedExpandable = expandable ? expandable : expandedRowRender ? {
|
|
423
|
+
defaultExpandedRowKeys,
|
|
424
|
+
expandedRowRender: (record, index) => expandedRowRender(record, index)
|
|
425
|
+
} : void 0;
|
|
426
|
+
const childrenColumnName = (resolvedExpandable == null ? void 0 : resolvedExpandable.childrenColumnName) ?? "children";
|
|
427
|
+
const allRows = (0, import_react.useMemo)(() => {
|
|
428
|
+
const result = [];
|
|
429
|
+
const visit = (records, indent = 0, prefix = "") => {
|
|
430
|
+
records.forEach((record, index) => {
|
|
431
|
+
const absoluteIndex = result.length;
|
|
432
|
+
const key = resolveRowKey(record, absoluteIndex, rowKey);
|
|
433
|
+
result.push({ key, record, index: absoluteIndex, indent });
|
|
434
|
+
const nested = record[childrenColumnName];
|
|
435
|
+
if (Array.isArray(nested)) visit(nested, indent + 1, `${prefix}-${index}`);
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
visit(dataSource);
|
|
439
|
+
return result;
|
|
440
|
+
}, [childrenColumnName, dataSource, rowKey]);
|
|
441
|
+
const [innerExpandedKeys, setInnerExpandedKeys] = (0, import_react.useState)(() => {
|
|
442
|
+
if (resolvedExpandable == null ? void 0 : resolvedExpandable.defaultExpandAllRows) {
|
|
443
|
+
return allRows.filter((row) => {
|
|
444
|
+
if (resolvedExpandable.rowExpandable && !resolvedExpandable.rowExpandable(row.record)) {
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
return Boolean(
|
|
448
|
+
resolvedExpandable.expandedRowRender || Array.isArray(row.record[childrenColumnName]) && row.record[childrenColumnName].length
|
|
449
|
+
);
|
|
450
|
+
}).map((row) => row.key);
|
|
451
|
+
}
|
|
452
|
+
return (resolvedExpandable == null ? void 0 : resolvedExpandable.defaultExpandedRowKeys) ?? defaultExpandedRowKeys;
|
|
453
|
+
});
|
|
454
|
+
const expandedKeys = (resolvedExpandable == null ? void 0 : resolvedExpandable.expandedRowKeys) ?? innerExpandedKeys;
|
|
455
|
+
const expandedKeySet = (0, import_react.useMemo)(() => new Set(expandedKeys.map(String)), [expandedKeys]);
|
|
456
|
+
(0, import_react.useEffect)(() => {
|
|
457
|
+
allRows.forEach((row) => selectionRecordCacheRef.current.set(String(row.key), row.record));
|
|
458
|
+
if (!(resolvedRowSelection == null ? void 0 : resolvedRowSelection.preserveSelectedRowKeys)) {
|
|
459
|
+
const availableKeys = new Set(allRows.map((row) => String(row.key)));
|
|
460
|
+
selectionRecordCacheRef.current.forEach((_record, key) => {
|
|
461
|
+
if (!availableKeys.has(key)) selectionRecordCacheRef.current.delete(key);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
}, [allRows, resolvedRowSelection == null ? void 0 : resolvedRowSelection.preserveSelectedRowKeys]);
|
|
465
|
+
(0, import_react.useEffect)(() => {
|
|
466
|
+
if (selectionControlled || (resolvedRowSelection == null ? void 0 : resolvedRowSelection.preserveSelectedRowKeys)) return;
|
|
467
|
+
const availableKeys = new Set(allRows.map((row) => String(row.key)));
|
|
468
|
+
setInnerSelectedKeys((current2) => {
|
|
469
|
+
const next = current2.filter((key) => availableKeys.has(String(key)));
|
|
470
|
+
return next.length === current2.length ? current2 : next;
|
|
471
|
+
});
|
|
472
|
+
}, [allRows, resolvedRowSelection == null ? void 0 : resolvedRowSelection.preserveSelectedRowKeys, selectionControlled]);
|
|
473
|
+
(0, import_react.useEffect)(() => {
|
|
474
|
+
if (!resolvedExpandable || resolvedExpandable.expandedRowKeys !== void 0) return;
|
|
475
|
+
const availableKeys = new Set(allRows.map((row) => String(row.key)));
|
|
476
|
+
setInnerExpandedKeys((current2) => {
|
|
477
|
+
const next = current2.filter((key) => availableKeys.has(String(key)));
|
|
478
|
+
return next.length === current2.length ? current2 : next;
|
|
479
|
+
});
|
|
480
|
+
}, [allRows, resolvedExpandable]);
|
|
481
|
+
const isRowExpandable = (0, import_react.useCallback)(
|
|
482
|
+
(record) => {
|
|
483
|
+
if ((resolvedExpandable == null ? void 0 : resolvedExpandable.rowExpandable) && !resolvedExpandable.rowExpandable(record))
|
|
484
|
+
return false;
|
|
485
|
+
return Boolean(
|
|
486
|
+
(resolvedExpandable == null ? void 0 : resolvedExpandable.expandedRowRender) || Array.isArray(record[childrenColumnName]) && record[childrenColumnName].length
|
|
487
|
+
);
|
|
488
|
+
},
|
|
489
|
+
[childrenColumnName, resolvedExpandable]
|
|
490
|
+
);
|
|
491
|
+
const visibleRows = (0, import_react.useMemo)(() => {
|
|
492
|
+
const result = [];
|
|
493
|
+
const visit = (records, indent = 0) => {
|
|
494
|
+
records.forEach((record) => {
|
|
495
|
+
const sourceMeta = allRows.find((item) => item.record === record);
|
|
496
|
+
const index = sourceMeta.index;
|
|
497
|
+
const key = sourceMeta.key;
|
|
498
|
+
result.push({ key, record, index, indent });
|
|
499
|
+
const nested = record[childrenColumnName];
|
|
500
|
+
if (expandedKeySet.has(String(key)) && Array.isArray(nested)) {
|
|
501
|
+
visit(nested, indent + 1);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
visit(currentPageData);
|
|
506
|
+
return result;
|
|
507
|
+
}, [allRows, childrenColumnName, currentPageData, expandedKeySet, rowKey]);
|
|
508
|
+
const canVirtualize = virtual && typeof (scroll == null ? void 0 : scroll.y) === "number" && !(resolvedExpandable == null ? void 0 : resolvedExpandable.expandedRowRender);
|
|
509
|
+
const virtualRange = (0, import_react.useMemo)(() => {
|
|
510
|
+
if (!canVirtualize || typeof (scroll == null ? void 0 : scroll.y) !== "number") {
|
|
511
|
+
return { start: 0, end: visibleRows.length };
|
|
512
|
+
}
|
|
513
|
+
const overscan = 3;
|
|
514
|
+
const start = Math.max(0, Math.floor(virtualScrollTop / metrics.rowMinHeight) - overscan);
|
|
515
|
+
const count = Math.ceil(scroll.y / metrics.rowMinHeight) + overscan * 2;
|
|
516
|
+
return { start, end: Math.min(visibleRows.length, start + count) };
|
|
517
|
+
}, [canVirtualize, metrics.rowMinHeight, scroll == null ? void 0 : scroll.y, virtualScrollTop, visibleRows.length]);
|
|
518
|
+
const renderedRows = visibleRows.slice(virtualRange.start, virtualRange.end);
|
|
519
|
+
const loadingState = typeof loading === "boolean" ? { spinning: loading, delay: 0, tip: (locale == null ? void 0 : locale.loadingText) ?? "加载中..." } : {
|
|
520
|
+
...loading,
|
|
521
|
+
spinning: loading.spinning ?? true,
|
|
522
|
+
delay: loading.delay ?? 0,
|
|
523
|
+
tip: loading.tip ?? (locale == null ? void 0 : locale.loadingText) ?? "加载中..."
|
|
524
|
+
};
|
|
525
|
+
const [showLoading, setShowLoading] = (0, import_react.useState)(
|
|
526
|
+
Boolean(loadingState.spinning && !loadingState.delay)
|
|
527
|
+
);
|
|
528
|
+
(0, import_react.useEffect)(() => {
|
|
529
|
+
if (!loadingState.spinning) {
|
|
530
|
+
setShowLoading(false);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (!loadingState.delay) {
|
|
534
|
+
setShowLoading(true);
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
setShowLoading(false);
|
|
538
|
+
const timer = setTimeout(() => setShowLoading(true), loadingState.delay);
|
|
539
|
+
return () => clearTimeout(timer);
|
|
540
|
+
}, [loadingState.delay, loadingState.spinning]);
|
|
541
|
+
const scrollToFirstRow = (0, import_react.useCallback)(() => {
|
|
542
|
+
if (!(scroll == null ? void 0 : scroll.scrollToFirstRowOnChange)) return;
|
|
543
|
+
setScrollTarget("");
|
|
544
|
+
setScrollTop(0);
|
|
545
|
+
setVirtualScrollTop(0);
|
|
546
|
+
}, [scroll == null ? void 0 : scroll.scrollToFirstRowOnChange]);
|
|
547
|
+
const buildSorterResult = (0, import_react.useCallback)(
|
|
548
|
+
(nextSortState) => {
|
|
549
|
+
const results = nextSortState.map((state) => {
|
|
550
|
+
const column = visibleColumns.find(
|
|
551
|
+
(item, index) => getColumnKey(item, index) === state.columnKey
|
|
552
|
+
);
|
|
553
|
+
return {
|
|
554
|
+
column,
|
|
555
|
+
columnKey: state.columnKey,
|
|
556
|
+
field: column == null ? void 0 : column.dataIndex,
|
|
557
|
+
order: state.order
|
|
558
|
+
};
|
|
559
|
+
});
|
|
560
|
+
if (!results.length) return {};
|
|
561
|
+
return results.length === 1 ? results[0] : results;
|
|
562
|
+
},
|
|
563
|
+
[visibleColumns]
|
|
564
|
+
);
|
|
565
|
+
const notifyChange = (0, import_react.useCallback)(
|
|
566
|
+
(action, nextCurrent, nextPageSize, nextFilters, nextSortState) => {
|
|
567
|
+
const nextData = applyTransforms(dataSource, visibleColumns, nextFilters, nextSortState);
|
|
568
|
+
const nextTotal = paginationEnabled ? paginationConfig.total ?? nextData.length : nextData.length;
|
|
569
|
+
const remote = paginationEnabled && paginationConfig.total !== void 0 && paginationConfig.total > nextData.length;
|
|
570
|
+
const nextCurrentData = !paginationEnabled || remote ? nextData : nextData.slice((nextCurrent - 1) * nextPageSize, nextCurrent * nextPageSize);
|
|
571
|
+
onChange == null ? void 0 : onChange(
|
|
572
|
+
{
|
|
573
|
+
...paginationConfig || {},
|
|
574
|
+
current: nextCurrent,
|
|
575
|
+
pageSize: nextPageSize,
|
|
576
|
+
total: nextTotal
|
|
577
|
+
},
|
|
578
|
+
nextFilters,
|
|
579
|
+
buildSorterResult(nextSortState),
|
|
580
|
+
{ action, currentDataSource: nextCurrentData }
|
|
581
|
+
);
|
|
582
|
+
},
|
|
583
|
+
[buildSorterResult, dataSource, onChange, paginationConfig, paginationEnabled, visibleColumns]
|
|
584
|
+
);
|
|
585
|
+
const changePagination = (nextCurrent, nextPageSize) => {
|
|
586
|
+
var _a2;
|
|
587
|
+
if (disabled) return;
|
|
588
|
+
if (paginationEnabled) {
|
|
589
|
+
if (paginationConfig.current === void 0) setInnerCurrent(nextCurrent);
|
|
590
|
+
if (paginationConfig.pageSize === void 0) setInnerPageSize(nextPageSize);
|
|
591
|
+
(_a2 = paginationConfig.onChange) == null ? void 0 : _a2.call(paginationConfig, nextCurrent, nextPageSize);
|
|
592
|
+
}
|
|
593
|
+
scrollToFirstRow();
|
|
594
|
+
notifyChange("paginate", nextCurrent, nextPageSize, filtersForChange, sortState);
|
|
595
|
+
};
|
|
596
|
+
const cycleSort = (column, columnIndex) => {
|
|
597
|
+
var _a2;
|
|
598
|
+
if (disabled || !column.sorter) return;
|
|
599
|
+
const columnKey = getColumnKey(column, columnIndex);
|
|
600
|
+
const directions = column.sortDirections ?? sortDirections;
|
|
601
|
+
const currentOrder = ((_a2 = sortState.find((state) => state.columnKey === columnKey)) == null ? void 0 : _a2.order) ?? null;
|
|
602
|
+
const currentIndex = currentOrder ? directions.indexOf(currentOrder) : -1;
|
|
603
|
+
const nextOrder = currentIndex < directions.length - 1 ? directions[currentIndex + 1] : null;
|
|
604
|
+
const multiple = getSorterMultiple(column);
|
|
605
|
+
const retained = multiple === void 0 ? [] : sortState.filter((state) => {
|
|
606
|
+
if (state.columnKey === columnKey) return false;
|
|
607
|
+
const stateColumn = visibleColumns.find(
|
|
608
|
+
(item, index) => getColumnKey(item, index) === state.columnKey
|
|
609
|
+
);
|
|
610
|
+
return getSorterMultiple(stateColumn) !== void 0;
|
|
611
|
+
});
|
|
612
|
+
const nextSortState = nextOrder ? [...retained, { columnKey, order: nextOrder }] : retained;
|
|
613
|
+
nextSortState.sort((first, second) => {
|
|
614
|
+
const firstColumn = visibleColumns.find(
|
|
615
|
+
(item, index) => getColumnKey(item, index) === first.columnKey
|
|
616
|
+
);
|
|
617
|
+
const secondColumn = visibleColumns.find(
|
|
618
|
+
(item, index) => getColumnKey(item, index) === second.columnKey
|
|
619
|
+
);
|
|
620
|
+
return (getSorterMultiple(secondColumn) ?? 0) - (getSorterMultiple(firstColumn) ?? 0);
|
|
621
|
+
});
|
|
622
|
+
if (!controlledSortColumns.length) setInnerSortState(nextSortState);
|
|
623
|
+
if (paginationEnabled && paginationConfig.current === void 0) setInnerCurrent(1);
|
|
624
|
+
scrollToFirstRow();
|
|
625
|
+
notifyChange("sort", 1, pageSize, filtersForChange, nextSortState);
|
|
626
|
+
};
|
|
627
|
+
const openFilter = (column, columnIndex) => {
|
|
628
|
+
if (disabled) return;
|
|
629
|
+
const key = getColumnKey(column, columnIndex);
|
|
630
|
+
if (openFilterKey === key) {
|
|
631
|
+
setOpenFilterKey(null);
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
const nextDraftFilters = {
|
|
635
|
+
...draftFiltersRef.current,
|
|
636
|
+
[key]: [...filtersForChange[key] ?? []]
|
|
637
|
+
};
|
|
638
|
+
draftFiltersRef.current = nextDraftFilters;
|
|
639
|
+
setDraftFilters(nextDraftFilters);
|
|
640
|
+
setOpenFilterKey(key);
|
|
641
|
+
};
|
|
642
|
+
const commitFilter = (column, columnIndex, reset = false) => {
|
|
643
|
+
if (disabled) return;
|
|
644
|
+
const key = getColumnKey(column, columnIndex);
|
|
645
|
+
const values = reset ? [] : draftFiltersRef.current[key] ?? [];
|
|
646
|
+
const nextFilters = { ...filtersForChange, [key]: values.length ? values : null };
|
|
647
|
+
if (column.filteredValue === void 0) {
|
|
648
|
+
setInnerFilters((current2) => ({ ...current2, [key]: values }));
|
|
649
|
+
}
|
|
650
|
+
if (paginationEnabled && paginationConfig.current === void 0) setInnerCurrent(1);
|
|
651
|
+
setOpenFilterKey(null);
|
|
652
|
+
scrollToFirstRow();
|
|
653
|
+
notifyChange("filter", 1, pageSize, nextFilters, sortState);
|
|
654
|
+
};
|
|
655
|
+
const selectedRowsForKeys = (0, import_react.useCallback)(
|
|
656
|
+
(keys) => {
|
|
657
|
+
const currentRecords = new Map(allRows.map((item) => [String(item.key), item.record]));
|
|
658
|
+
return keys.flatMap((key) => {
|
|
659
|
+
const record = currentRecords.get(String(key)) ?? ((resolvedRowSelection == null ? void 0 : resolvedRowSelection.preserveSelectedRowKeys) ? selectionRecordCacheRef.current.get(String(key)) : void 0);
|
|
660
|
+
return record ? [record] : [];
|
|
661
|
+
});
|
|
662
|
+
},
|
|
663
|
+
[allRows, resolvedRowSelection == null ? void 0 : resolvedRowSelection.preserveSelectedRowKeys]
|
|
664
|
+
);
|
|
665
|
+
const updateSelection = (nextKeys, type, changedRows = []) => {
|
|
666
|
+
var _a2, _b2;
|
|
667
|
+
const normalized = Array.from(new Map(nextKeys.map((key) => [String(key), key])).values());
|
|
668
|
+
if (!selectionControlled) setInnerSelectedKeys(normalized);
|
|
669
|
+
const nextRows = selectedRowsForKeys(normalized);
|
|
670
|
+
(_a2 = resolvedRowSelection == null ? void 0 : resolvedRowSelection.onChange) == null ? void 0 : _a2.call(resolvedRowSelection, normalized, nextRows, { type });
|
|
671
|
+
onSelectionChange == null ? void 0 : onSelectionChange(normalized, nextRows);
|
|
672
|
+
if (type === "all" || type === "none") {
|
|
673
|
+
(_b2 = resolvedRowSelection == null ? void 0 : resolvedRowSelection.onSelectAll) == null ? void 0 : _b2.call(resolvedRowSelection, type === "all", nextRows, changedRows);
|
|
674
|
+
}
|
|
675
|
+
return nextRows;
|
|
676
|
+
};
|
|
677
|
+
const toggleRowSelection = (row) => {
|
|
678
|
+
var _a2;
|
|
679
|
+
const selection = resolvedRowSelection;
|
|
680
|
+
const checked = selectedKeySet.has(String(row.key));
|
|
681
|
+
const nextKeys = selection.type === "radio" ? [row.key] : checked ? selectedKeys.filter((key) => String(key) !== String(row.key)) : [...selectedKeys, row.key];
|
|
682
|
+
const nextRows = updateSelection(nextKeys, "single");
|
|
683
|
+
(_a2 = selection.onSelect) == null ? void 0 : _a2.call(selection, row.record, !checked, nextRows);
|
|
684
|
+
};
|
|
685
|
+
const selectableRows = visibleRows.filter(
|
|
686
|
+
(row) => {
|
|
687
|
+
var _a2;
|
|
688
|
+
return !((_a2 = resolvedRowSelection == null ? void 0 : resolvedRowSelection.getCheckboxProps) == null ? void 0 : _a2.call(resolvedRowSelection, row.record).disabled);
|
|
689
|
+
}
|
|
690
|
+
);
|
|
691
|
+
const allPageSelected = selectableRows.length > 0 && selectableRows.every((row) => selectedKeySet.has(String(row.key)));
|
|
692
|
+
const somePageSelected = selectableRows.some((row) => selectedKeySet.has(String(row.key)));
|
|
693
|
+
const toggleSelectAll = () => {
|
|
694
|
+
const pageKeys = selectableRows.map((row) => row.key);
|
|
695
|
+
const pageKeySet = new Set(pageKeys.map(String));
|
|
696
|
+
const nextKeys = allPageSelected ? selectedKeys.filter((key) => !pageKeySet.has(String(key))) : [...selectedKeys, ...pageKeys.filter((key) => !selectedKeySet.has(String(key)))];
|
|
697
|
+
updateSelection(
|
|
698
|
+
nextKeys,
|
|
699
|
+
allPageSelected ? "none" : "all",
|
|
700
|
+
selectableRows.map((row) => row.record)
|
|
701
|
+
);
|
|
702
|
+
};
|
|
703
|
+
const toggleExpand = (row) => {
|
|
704
|
+
var _a2, _b2;
|
|
705
|
+
if (disabled || !resolvedExpandable || !isRowExpandable(row.record)) return;
|
|
706
|
+
const expanded = expandedKeySet.has(String(row.key));
|
|
707
|
+
const nextKeys = expanded ? expandedKeys.filter((key) => String(key) !== String(row.key)) : [...expandedKeys, row.key];
|
|
708
|
+
if (resolvedExpandable.expandedRowKeys === void 0) setInnerExpandedKeys(nextKeys);
|
|
709
|
+
(_a2 = resolvedExpandable.onExpand) == null ? void 0 : _a2.call(resolvedExpandable, !expanded, row.record);
|
|
710
|
+
(_b2 = resolvedExpandable.onExpandedRowsChange) == null ? void 0 : _b2.call(resolvedExpandable, nextKeys);
|
|
711
|
+
};
|
|
712
|
+
(0, import_react.useImperativeHandle)(
|
|
713
|
+
ref,
|
|
714
|
+
() => ({
|
|
715
|
+
nativeElement: rootRef.current,
|
|
716
|
+
scrollTo: ({ index, key, offset = 0, top }) => {
|
|
717
|
+
var _a2;
|
|
718
|
+
if (top !== void 0) {
|
|
719
|
+
setScrollTarget("");
|
|
720
|
+
setScrollTop(top);
|
|
721
|
+
setVirtualScrollTop(top);
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
if (key === void 0 && index === void 0) return;
|
|
725
|
+
let targetIndex = key !== void 0 ? visibleRows.findIndex((row) => String(row.key) === String(key)) : index;
|
|
726
|
+
if (key !== void 0 && targetIndex < 0 && paginationEnabled && !isRemotePagination) {
|
|
727
|
+
const absoluteIndex = transformedData.findIndex(
|
|
728
|
+
(record, recordIndex) => String(resolveRowKey(record, recordIndex, rowKey)) === String(key)
|
|
729
|
+
);
|
|
730
|
+
if (absoluteIndex >= 0) {
|
|
731
|
+
const targetPage = Math.floor(absoluteIndex / pageSize) + 1;
|
|
732
|
+
if (paginationConfig.current === void 0) setInnerCurrent(targetPage);
|
|
733
|
+
(_a2 = paginationConfig.onChange) == null ? void 0 : _a2.call(paginationConfig, targetPage, pageSize);
|
|
734
|
+
targetIndex = absoluteIndex % pageSize;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
if (targetIndex < 0 || targetIndex >= visibleRows.length) return;
|
|
738
|
+
const nextTop = targetIndex * metrics.rowMinHeight + offset;
|
|
739
|
+
setScrollTop(nextTop);
|
|
740
|
+
setVirtualScrollTop(nextTop);
|
|
741
|
+
setScrollTarget(`x-table-row-${String(key ?? visibleRows[targetIndex].key)}`);
|
|
742
|
+
}
|
|
743
|
+
}),
|
|
744
|
+
[
|
|
745
|
+
isRemotePagination,
|
|
746
|
+
metrics.rowMinHeight,
|
|
747
|
+
pageSize,
|
|
748
|
+
paginationConfig,
|
|
749
|
+
paginationEnabled,
|
|
750
|
+
rowKey,
|
|
751
|
+
transformedData,
|
|
752
|
+
visibleRows
|
|
753
|
+
]
|
|
754
|
+
);
|
|
755
|
+
const selectionWidth = (resolvedRowSelection == null ? void 0 : resolvedRowSelection.columnWidth) ?? 44;
|
|
756
|
+
const showExpandColumn = Boolean(resolvedExpandable) && (resolvedExpandable == null ? void 0 : resolvedExpandable.showExpandColumn) !== false;
|
|
757
|
+
const expandWidth = (resolvedExpandable == null ? void 0 : resolvedExpandable.columnWidth) ?? 40;
|
|
758
|
+
const getFixedStyle = (column, columnIndex) => {
|
|
759
|
+
var _a2, _b2;
|
|
760
|
+
const fixed = normalizeFixed(column.fixed);
|
|
761
|
+
if (!fixed) return void 0;
|
|
762
|
+
if (fixed === "left") {
|
|
763
|
+
let left = resolvedRowSelection ? Number(selectionWidth) || 44 : 0;
|
|
764
|
+
if (showExpandColumn) left += Number(expandWidth) || 40;
|
|
765
|
+
for (let index = 0; index < columnIndex; index += 1) {
|
|
766
|
+
left += Number((_a2 = visibleColumns[index]) == null ? void 0 : _a2.width) || 120;
|
|
767
|
+
}
|
|
768
|
+
return {
|
|
769
|
+
position: "sticky",
|
|
770
|
+
left,
|
|
771
|
+
zIndex: 4,
|
|
772
|
+
backgroundColor: "var(--x-table-row-surface)",
|
|
773
|
+
boxShadow: horizontalScrollState.canScrollLeft ? "4px 0 8px var(--x-table-fixed-edge-shadow-start)" : "none"
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
let right = 0;
|
|
777
|
+
for (let index = visibleColumns.length - 1; index > columnIndex; index -= 1) {
|
|
778
|
+
right += Number((_b2 = visibleColumns[index]) == null ? void 0 : _b2.width) || 120;
|
|
779
|
+
}
|
|
780
|
+
return {
|
|
781
|
+
position: "sticky",
|
|
782
|
+
right,
|
|
783
|
+
zIndex: 4,
|
|
784
|
+
backgroundColor: "var(--x-table-row-surface)",
|
|
785
|
+
boxShadow: horizontalScrollState.canScrollRight ? "-4px 0 8px var(--x-table-fixed-edge-shadow-start)" : "none"
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
const tableMinWidth = (() => {
|
|
789
|
+
if (typeof (scroll == null ? void 0 : scroll.x) === "number") return `${scroll.x}px`;
|
|
790
|
+
if (typeof (scroll == null ? void 0 : scroll.x) === "string" && scroll.x !== "max-content") return scroll.x;
|
|
791
|
+
if ((scroll == null ? void 0 : scroll.x) === true || (scroll == null ? void 0 : scroll.x) === "max-content") {
|
|
792
|
+
const controls = (resolvedRowSelection ? Number(selectionWidth) || 44 : 0) + (showExpandColumn ? Number(expandWidth) || 40 : 0);
|
|
793
|
+
return `${visibleColumns.reduce((sum, column) => sum + (Number(column.width) || 120), controls)}px`;
|
|
794
|
+
}
|
|
795
|
+
return "100%";
|
|
796
|
+
})();
|
|
797
|
+
const cellBaseStyle = (column, columnIndex) => ({
|
|
798
|
+
boxSizing: "border-box",
|
|
799
|
+
display: "flex",
|
|
800
|
+
minWidth: toCssSize(column.minWidth) ?? (column.width ? toCssSize(column.width) : 0),
|
|
801
|
+
width: toCssSize(column.width),
|
|
802
|
+
minHeight: metrics.rowMinHeight,
|
|
803
|
+
flex: column.width ? "0 0 auto" : 1,
|
|
804
|
+
alignItems: "center",
|
|
805
|
+
justifyContent: column.align === "right" ? "flex-end" : column.align === "center" ? "center" : "flex-start",
|
|
806
|
+
padding: `${metrics.paddingY}px ${metrics.paddingX}px`,
|
|
807
|
+
overflow: column.ellipsis ? "hidden" : void 0,
|
|
808
|
+
borderRight: bordered ? "1px solid var(--x-table-border)" : "none",
|
|
809
|
+
...getFixedStyle(column, columnIndex),
|
|
810
|
+
...semanticStyles.cell,
|
|
811
|
+
...column.style
|
|
812
|
+
});
|
|
813
|
+
const renderCellContent = (column, record, index, indent, columnIndex, selected) => {
|
|
814
|
+
const value = getValueByDataIndex(record, column.dataIndex);
|
|
815
|
+
const cacheKey = `${String(resolveRowKey(record, index, rowKey))}:${getColumnKey(
|
|
816
|
+
column,
|
|
817
|
+
columnIndex
|
|
818
|
+
)}`;
|
|
819
|
+
const cached = cellRenderCacheRef.current.get(cacheKey);
|
|
820
|
+
const shouldUpdate = !cached || !column.shouldCellUpdate || column.shouldCellUpdate(record, cached.record);
|
|
821
|
+
const content = shouldUpdate ? column.render ? column.render(value, record, index) : value : cached.content;
|
|
822
|
+
if (shouldUpdate) cellRenderCacheRef.current.set(cacheKey, { content, record });
|
|
823
|
+
const primitiveStyle = {
|
|
824
|
+
maxWidth: "100%",
|
|
825
|
+
fontSize: metrics.fontSize,
|
|
826
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
827
|
+
color: selected ? "var(--x-table-row-selected-foreground)" : "var(--x-table-body-foreground)",
|
|
828
|
+
textAlign: column.align ?? "left",
|
|
829
|
+
...column.ellipsis ? { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } : void 0,
|
|
830
|
+
...columnIndex === 0 && indent > 0 ? { paddingLeft: indent * ((resolvedExpandable == null ? void 0 : resolvedExpandable.indentSize) ?? 16) } : void 0
|
|
831
|
+
};
|
|
832
|
+
return renderNode(content ?? "-", primitiveStyle);
|
|
833
|
+
};
|
|
834
|
+
const HeaderWrapper = ((_a = components == null ? void 0 : components.header) == null ? void 0 : _a.wrapper) ?? import_components.View;
|
|
835
|
+
const HeaderRow = ((_b = components == null ? void 0 : components.header) == null ? void 0 : _b.row) ?? import_components.View;
|
|
836
|
+
const HeaderCell = ((_c = components == null ? void 0 : components.header) == null ? void 0 : _c.cell) ?? import_components.View;
|
|
837
|
+
const BodyWrapper = ((_d = components == null ? void 0 : components.body) == null ? void 0 : _d.wrapper) ?? import_components.View;
|
|
838
|
+
const BodyRow = ((_e = components == null ? void 0 : components.body) == null ? void 0 : _e.row) ?? import_components.View;
|
|
839
|
+
const BodyCell = ((_f = components == null ? void 0 : components.body) == null ? void 0 : _f.cell) ?? import_components.View;
|
|
840
|
+
const TableSurface = (components == null ? void 0 : components.table) ?? import_components.View;
|
|
841
|
+
const headerSpanStyle = (leaves) => {
|
|
842
|
+
const fixedWidths = leaves.map((column) => toCssSize(column.width)).filter((width) => Boolean(width));
|
|
843
|
+
const flexibleCount = leaves.length - fixedWidths.length;
|
|
844
|
+
const fixedBasis = fixedWidths.length ? `calc(${fixedWidths.join(" + ")})` : 0;
|
|
845
|
+
return flexibleCount > 0 ? { minWidth: 0, flexGrow: flexibleCount, flexShrink: 1, flexBasis: fixedBasis } : { width: fixedBasis, flex: "0 0 auto" };
|
|
846
|
+
};
|
|
847
|
+
const renderHeaderRowShell = (content, rowIndex) => {
|
|
848
|
+
const headerRowProps = (onHeaderRow == null ? void 0 : onHeaderRow(visibleColumns, rowIndex)) ?? {};
|
|
849
|
+
const {
|
|
850
|
+
className: headerRowClassName,
|
|
851
|
+
style: headerRowStyle,
|
|
852
|
+
...headerRowRest
|
|
853
|
+
} = headerRowProps;
|
|
854
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
855
|
+
HeaderRow,
|
|
856
|
+
{
|
|
857
|
+
...headerRowRest,
|
|
858
|
+
key: `header-row-${rowIndex}`,
|
|
859
|
+
"data-slot": "table-header-row",
|
|
860
|
+
"data-header-row": rowIndex,
|
|
861
|
+
className: (0, import_utils.classNames)("x-table__header-row", headerRowClassName),
|
|
862
|
+
style: {
|
|
863
|
+
display: "flex",
|
|
864
|
+
minWidth: tableMinWidth,
|
|
865
|
+
flexDirection: "row",
|
|
866
|
+
borderBottom: "1px solid var(--x-table-border)",
|
|
867
|
+
...headerRowStyle
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
content
|
|
871
|
+
);
|
|
872
|
+
};
|
|
873
|
+
const utilityHeaderStyle = (kind, placeholder = false) => ({
|
|
874
|
+
boxSizing: "border-box",
|
|
875
|
+
display: "flex",
|
|
876
|
+
width: toCssSize(kind === "selection" ? selectionWidth : expandWidth),
|
|
877
|
+
minHeight: metrics.rowMinHeight,
|
|
878
|
+
flexShrink: 0,
|
|
879
|
+
alignItems: "center",
|
|
880
|
+
justifyContent: "center",
|
|
881
|
+
visibility: placeholder ? "hidden" : void 0,
|
|
882
|
+
borderRight: bordered ? "1px solid var(--x-table-border)" : "none",
|
|
883
|
+
backgroundColor: "var(--x-table-header-surface)",
|
|
884
|
+
...kind === "selection" && (resolvedRowSelection == null ? void 0 : resolvedRowSelection.fixed) ? { position: "sticky", left: 0, zIndex: 6 } : void 0,
|
|
885
|
+
...kind === "expand" && (resolvedExpandable == null ? void 0 : resolvedExpandable.fixed) ? {
|
|
886
|
+
position: "sticky",
|
|
887
|
+
left: resolvedRowSelection ? Number(selectionWidth) || 44 : 0,
|
|
888
|
+
zIndex: 6
|
|
889
|
+
} : void 0,
|
|
890
|
+
...semanticStyles.cell
|
|
891
|
+
});
|
|
892
|
+
const renderSelectionHeader = () => {
|
|
893
|
+
if (!resolvedRowSelection) return null;
|
|
894
|
+
let originalNode = null;
|
|
895
|
+
if (resolvedRowSelection.type !== "radio" && !resolvedRowSelection.hideSelectAll) {
|
|
896
|
+
originalNode = /* @__PURE__ */ import_react.default.createElement(
|
|
897
|
+
import_checkbox.Checkbox,
|
|
898
|
+
{
|
|
899
|
+
checked: allPageSelected,
|
|
900
|
+
indeterminate: somePageSelected && !allPageSelected,
|
|
901
|
+
disabled: disabled || selectableRows.length === 0,
|
|
902
|
+
size,
|
|
903
|
+
ariaLabel: "选择当前页全部行",
|
|
904
|
+
onChange: toggleSelectAll
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
const content = typeof resolvedRowSelection.columnTitle === "function" ? resolvedRowSelection.columnTitle(originalNode) : resolvedRowSelection.columnTitle ?? originalNode;
|
|
909
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
910
|
+
HeaderCell,
|
|
911
|
+
{
|
|
912
|
+
"data-slot": "table-selection-cell",
|
|
913
|
+
className: (0, import_utils.classNames)("x-table__selection-cell", semanticClassNames.cell),
|
|
914
|
+
style: {
|
|
915
|
+
...utilityHeaderStyle("selection"),
|
|
916
|
+
justifyContent: resolvedRowSelection.align === "right" ? "flex-end" : resolvedRowSelection.align === "left" ? "flex-start" : "center"
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
content
|
|
920
|
+
);
|
|
921
|
+
};
|
|
922
|
+
const renderHeader = () => {
|
|
923
|
+
if (!showHeader) return null;
|
|
924
|
+
const groupRows = Array.from({ length: Math.max(0, headerDepth - 1) }, (_, depth) => {
|
|
925
|
+
const cells = getHeaderBandCells(resolvedColumns, depth);
|
|
926
|
+
return renderHeaderRowShell(
|
|
927
|
+
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, resolvedRowSelection ? /* @__PURE__ */ import_react.default.createElement(
|
|
928
|
+
HeaderCell,
|
|
929
|
+
{
|
|
930
|
+
"data-slot": "table-selection-placeholder",
|
|
931
|
+
"aria-hidden": "true",
|
|
932
|
+
style: utilityHeaderStyle("selection", true)
|
|
933
|
+
}
|
|
934
|
+
) : null, showExpandColumn ? /* @__PURE__ */ import_react.default.createElement(
|
|
935
|
+
HeaderCell,
|
|
936
|
+
{
|
|
937
|
+
"data-slot": "table-expand-placeholder",
|
|
938
|
+
"aria-hidden": "true",
|
|
939
|
+
style: utilityHeaderStyle("expand", true)
|
|
940
|
+
}
|
|
941
|
+
) : null, cells.map((cell, cellIndex) => {
|
|
942
|
+
const groupKey = `${depth}-${getColumnKey(cell.column, cellIndex)}`;
|
|
943
|
+
const groupTitle = typeof cell.column.title === "function" ? cell.column.title({ filters: filtersForChange }) : cell.column.title;
|
|
944
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
945
|
+
HeaderCell,
|
|
946
|
+
{
|
|
947
|
+
key: groupKey,
|
|
948
|
+
"data-slot": cell.placeholder ? "table-column-group-placeholder" : "table-column-group",
|
|
949
|
+
"data-column-group-key": groupKey,
|
|
950
|
+
"aria-hidden": cell.placeholder ? "true" : void 0,
|
|
951
|
+
className: (0, import_utils.classNames)(
|
|
952
|
+
"x-table__cell",
|
|
953
|
+
"x-table__header-cell",
|
|
954
|
+
"x-table__column-group-cell",
|
|
955
|
+
semanticClassNames.cell,
|
|
956
|
+
cell.column.className
|
|
957
|
+
),
|
|
958
|
+
style: {
|
|
959
|
+
boxSizing: "border-box",
|
|
960
|
+
display: "flex",
|
|
961
|
+
minHeight: metrics.rowMinHeight,
|
|
962
|
+
alignItems: "center",
|
|
963
|
+
justifyContent: cell.column.align === "right" ? "flex-end" : cell.column.align === "center" ? "center" : "flex-start",
|
|
964
|
+
padding: `${metrics.paddingY}px ${metrics.paddingX}px`,
|
|
965
|
+
visibility: cell.placeholder ? "hidden" : void 0,
|
|
966
|
+
borderRight: bordered ? "1px solid var(--x-table-border)" : "none",
|
|
967
|
+
backgroundColor: "var(--x-table-header-surface)",
|
|
968
|
+
color: "var(--x-table-header-foreground)",
|
|
969
|
+
fontSize: metrics.fontSize,
|
|
970
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
971
|
+
fontWeight: 600,
|
|
972
|
+
...headerSpanStyle(cell.leaves),
|
|
973
|
+
...semanticStyles.cell,
|
|
974
|
+
...cell.column.style
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
cell.placeholder ? null : renderNode(groupTitle)
|
|
978
|
+
);
|
|
979
|
+
})),
|
|
980
|
+
depth
|
|
981
|
+
);
|
|
982
|
+
});
|
|
983
|
+
const leafRow = renderHeaderRowShell(
|
|
984
|
+
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderSelectionHeader(), showExpandColumn ? /* @__PURE__ */ import_react.default.createElement(
|
|
985
|
+
HeaderCell,
|
|
986
|
+
{
|
|
987
|
+
"data-slot": "table-expand-cell",
|
|
988
|
+
className: (0, import_utils.classNames)("x-table__expand-cell", semanticClassNames.cell),
|
|
989
|
+
style: utilityHeaderStyle("expand")
|
|
990
|
+
},
|
|
991
|
+
resolvedExpandable == null ? void 0 : resolvedExpandable.columnTitle
|
|
992
|
+
) : null, visibleColumns.map((column, columnIndex) => {
|
|
993
|
+
var _a2, _b2, _c2;
|
|
994
|
+
const key = getColumnKey(column, columnIndex);
|
|
995
|
+
const order = ((_a2 = sortState.find((state) => state.columnKey === key)) == null ? void 0 : _a2.order) ?? null;
|
|
996
|
+
const filtered = Boolean((_b2 = filtersForChange[key]) == null ? void 0 : _b2.length);
|
|
997
|
+
const sorterResult = buildSorterResult(sortState);
|
|
998
|
+
const sortColumns = Array.isArray(sorterResult) ? sorterResult : sorterResult.order ? [sorterResult] : [];
|
|
999
|
+
const titleContent2 = typeof column.title === "function" ? column.title({
|
|
1000
|
+
sortOrder: order,
|
|
1001
|
+
sortColumn: order ? column : void 0,
|
|
1002
|
+
sortColumns,
|
|
1003
|
+
filters: filtersForChange
|
|
1004
|
+
}) : column.title;
|
|
1005
|
+
const titleLabel = typeof titleContent2 === "string" || typeof titleContent2 === "number" ? String(titleContent2) : key;
|
|
1006
|
+
const headerCellProps = ((_c2 = column.onHeaderCell) == null ? void 0 : _c2.call(column, column)) ?? {};
|
|
1007
|
+
const {
|
|
1008
|
+
className: headerCellClassName,
|
|
1009
|
+
style: headerCellStyle,
|
|
1010
|
+
onClick: headerCellOnClick,
|
|
1011
|
+
...headerCellRest
|
|
1012
|
+
} = headerCellProps;
|
|
1013
|
+
const sortControlKey = `${key}-sort`;
|
|
1014
|
+
const filterControlKey = `${key}-filter`;
|
|
1015
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1016
|
+
HeaderCell,
|
|
1017
|
+
{
|
|
1018
|
+
...headerCellRest,
|
|
1019
|
+
...column.sorter ? interactiveControlProps(sortControlKey, (event) => {
|
|
1020
|
+
headerCellOnClick == null ? void 0 : headerCellOnClick(event);
|
|
1021
|
+
cycleSort(column, columnIndex);
|
|
1022
|
+
}) : {},
|
|
1023
|
+
key,
|
|
1024
|
+
"data-slot": "table-cell",
|
|
1025
|
+
"data-column-key": key,
|
|
1026
|
+
"data-sort-order": order ?? "none",
|
|
1027
|
+
"data-sorter-tooltip": column.sorter && showSorterTooltip !== false ? String((locale == null ? void 0 : locale.sortTitle) ?? "点击排序") : void 0,
|
|
1028
|
+
className: (0, import_utils.classNames)(
|
|
1029
|
+
"x-table__cell",
|
|
1030
|
+
"x-table__header-cell",
|
|
1031
|
+
semanticClassNames.cell,
|
|
1032
|
+
column.className,
|
|
1033
|
+
headerCellClassName
|
|
1034
|
+
),
|
|
1035
|
+
role: column.sorter ? "button" : void 0,
|
|
1036
|
+
ariaRole: column.sorter ? "button" : void 0,
|
|
1037
|
+
ariaLabel: titleLabel,
|
|
1038
|
+
style: {
|
|
1039
|
+
...cellBaseStyle(column, columnIndex),
|
|
1040
|
+
fontWeight: 600,
|
|
1041
|
+
color: "var(--x-table-header-foreground)",
|
|
1042
|
+
backgroundColor: "var(--x-table-header-surface)",
|
|
1043
|
+
...interactiveFocusStyle(sortControlKey),
|
|
1044
|
+
...headerCellStyle
|
|
1045
|
+
},
|
|
1046
|
+
onClick: (event) => {
|
|
1047
|
+
headerCellOnClick == null ? void 0 : headerCellOnClick(event);
|
|
1048
|
+
cycleSort(column, columnIndex);
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1052
|
+
import_components.View,
|
|
1053
|
+
{
|
|
1054
|
+
style: {
|
|
1055
|
+
display: "flex",
|
|
1056
|
+
minWidth: 0,
|
|
1057
|
+
flex: 1,
|
|
1058
|
+
alignItems: "center",
|
|
1059
|
+
justifyContent: column.align === "right" ? "flex-end" : column.align === "center" ? "center" : "flex-start",
|
|
1060
|
+
gap: 6
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
renderNode(titleContent2, {
|
|
1064
|
+
minWidth: 0,
|
|
1065
|
+
fontSize: metrics.fontSize,
|
|
1066
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1067
|
+
fontWeight: 600,
|
|
1068
|
+
color: "var(--x-table-header-foreground)",
|
|
1069
|
+
textAlign: column.align ?? "left"
|
|
1070
|
+
}),
|
|
1071
|
+
column.sorter ? /* @__PURE__ */ import_react.default.createElement(
|
|
1072
|
+
import_components.View,
|
|
1073
|
+
{
|
|
1074
|
+
"data-slot": "table-sorter",
|
|
1075
|
+
"data-active": order ? "true" : "false",
|
|
1076
|
+
className: "x-table__sorter",
|
|
1077
|
+
style: {
|
|
1078
|
+
display: "flex",
|
|
1079
|
+
width: 28,
|
|
1080
|
+
height: 28,
|
|
1081
|
+
flexShrink: 0,
|
|
1082
|
+
alignItems: "center",
|
|
1083
|
+
justifyContent: "center",
|
|
1084
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1085
|
+
backgroundColor: order ? "var(--x-table-toolbar-active-surface)" : "transparent"
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1089
|
+
import_icon.Icon,
|
|
1090
|
+
{
|
|
1091
|
+
name: order === "ascend" ? "ArrowUp" : order === "descend" ? "ArrowDown" : "ChevronsUpDown",
|
|
1092
|
+
size: metrics.iconSize,
|
|
1093
|
+
color: order ? "var(--x-table-toolbar-active-foreground)" : "var(--x-table-toolbar-foreground)",
|
|
1094
|
+
block: true
|
|
1095
|
+
}
|
|
1096
|
+
)
|
|
1097
|
+
) : null,
|
|
1098
|
+
column.filters || column.filterDropdown ? /* @__PURE__ */ import_react.default.createElement(
|
|
1099
|
+
import_components.View,
|
|
1100
|
+
{
|
|
1101
|
+
...interactiveControlProps(filterControlKey, (event) => {
|
|
1102
|
+
stopPropagation(event);
|
|
1103
|
+
openFilter(column, columnIndex);
|
|
1104
|
+
}),
|
|
1105
|
+
"data-slot": "table-filter-trigger",
|
|
1106
|
+
"data-active": filtered ? "true" : "false",
|
|
1107
|
+
"data-open": openFilterKey === key ? "true" : "false",
|
|
1108
|
+
className: "x-table__filter-trigger",
|
|
1109
|
+
role: "button",
|
|
1110
|
+
ariaRole: "button",
|
|
1111
|
+
"aria-expanded": openFilterKey === key,
|
|
1112
|
+
ariaLabel: `${titleLabel},${String((locale == null ? void 0 : locale.filterTitle) ?? "筛选")}`,
|
|
1113
|
+
style: {
|
|
1114
|
+
display: "flex",
|
|
1115
|
+
width: 28,
|
|
1116
|
+
height: 28,
|
|
1117
|
+
flexShrink: 0,
|
|
1118
|
+
alignItems: "center",
|
|
1119
|
+
justifyContent: "center",
|
|
1120
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1121
|
+
backgroundColor: filtered ? "var(--x-table-toolbar-active-surface)" : "transparent",
|
|
1122
|
+
...interactiveFocusStyle(filterControlKey)
|
|
1123
|
+
},
|
|
1124
|
+
onClick: (event) => {
|
|
1125
|
+
stopPropagation(event);
|
|
1126
|
+
openFilter(column, columnIndex);
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1130
|
+
import_icon.Icon,
|
|
1131
|
+
{
|
|
1132
|
+
name: "Filter",
|
|
1133
|
+
size: metrics.iconSize,
|
|
1134
|
+
color: filtered ? "var(--x-table-toolbar-active-foreground)" : "var(--x-table-toolbar-foreground)",
|
|
1135
|
+
block: true
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1138
|
+
) : null
|
|
1139
|
+
)
|
|
1140
|
+
);
|
|
1141
|
+
})),
|
|
1142
|
+
headerDepth - 1
|
|
1143
|
+
);
|
|
1144
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1145
|
+
HeaderWrapper,
|
|
1146
|
+
{
|
|
1147
|
+
"data-slot": "table-header",
|
|
1148
|
+
className: (0, import_utils.classNames)("x-table__header", semanticClassNames.header),
|
|
1149
|
+
style: {
|
|
1150
|
+
position: sticky ? "sticky" : "relative",
|
|
1151
|
+
top: typeof sticky === "object" ? sticky.offsetHeader ?? 0 : 0,
|
|
1152
|
+
zIndex: sticky ? 8 : 2,
|
|
1153
|
+
backgroundColor: "var(--x-table-header-surface)",
|
|
1154
|
+
...semanticStyles.header
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
groupRows,
|
|
1158
|
+
leafRow
|
|
1159
|
+
);
|
|
1160
|
+
};
|
|
1161
|
+
const renderFilterPanel = () => {
|
|
1162
|
+
if (!openFilterKey) return null;
|
|
1163
|
+
const columnIndex = visibleColumns.findIndex(
|
|
1164
|
+
(column2, index) => getColumnKey(column2, index) === openFilterKey
|
|
1165
|
+
);
|
|
1166
|
+
const column = visibleColumns[columnIndex];
|
|
1167
|
+
if (!column) return null;
|
|
1168
|
+
const selected = draftFilters[openFilterKey];
|
|
1169
|
+
const setSelectedKeys = (keys) => {
|
|
1170
|
+
const nextDraftFilters = { ...draftFiltersRef.current, [openFilterKey]: keys };
|
|
1171
|
+
draftFiltersRef.current = nextDraftFilters;
|
|
1172
|
+
setDraftFilters(nextDraftFilters);
|
|
1173
|
+
};
|
|
1174
|
+
const customProps = {
|
|
1175
|
+
clearFilters: () => commitFilter(column, columnIndex, true),
|
|
1176
|
+
close: () => setOpenFilterKey(null),
|
|
1177
|
+
column,
|
|
1178
|
+
confirm: () => commitFilter(column, columnIndex),
|
|
1179
|
+
filters: column.filters,
|
|
1180
|
+
selectedKeys: selected,
|
|
1181
|
+
setSelectedKeys,
|
|
1182
|
+
visible: true
|
|
1183
|
+
};
|
|
1184
|
+
const customContent = typeof column.filterDropdown === "function" ? column.filterDropdown(customProps) : column.filterDropdown;
|
|
1185
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1186
|
+
import_components.View,
|
|
1187
|
+
{
|
|
1188
|
+
"data-slot": "table-filter-panel",
|
|
1189
|
+
"data-column-key": openFilterKey,
|
|
1190
|
+
className: "x-table__filter-panel",
|
|
1191
|
+
role: "dialog",
|
|
1192
|
+
ariaRole: "dialog",
|
|
1193
|
+
ariaLabel: `${String(column.title ?? openFilterKey)}筛选`,
|
|
1194
|
+
style: {
|
|
1195
|
+
boxSizing: "border-box",
|
|
1196
|
+
display: "flex",
|
|
1197
|
+
position: "absolute",
|
|
1198
|
+
top: headerDepth * metrics.rowMinHeight + 8,
|
|
1199
|
+
right: 12,
|
|
1200
|
+
zIndex: 20,
|
|
1201
|
+
width: 224,
|
|
1202
|
+
maxWidth: "calc(100% - 24px)",
|
|
1203
|
+
flexDirection: "column",
|
|
1204
|
+
gap: 8,
|
|
1205
|
+
padding: 12,
|
|
1206
|
+
border: "1px solid var(--x-table-filter-border)",
|
|
1207
|
+
borderRadius: "var(--x-table-filter-radius)",
|
|
1208
|
+
backgroundColor: "var(--x-table-filter-surface)",
|
|
1209
|
+
color: "var(--x-table-filter-foreground)",
|
|
1210
|
+
boxShadow: "var(--x-table-filter-shadow)"
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
customContent ?? (column.filters ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { style: { display: "flex", flexDirection: "column", gap: 6 } }, flattenFilterItems(column.filters).map((item) => {
|
|
1214
|
+
const checked = selected.some((value) => String(value) === String(item.value));
|
|
1215
|
+
const optionControlKey = `${openFilterKey}-option-${String(item.value)}`;
|
|
1216
|
+
const toggleOption = () => {
|
|
1217
|
+
if (disabled) return;
|
|
1218
|
+
const next = column.filterMultiple === false ? [item.value] : checked ? selected.filter((value) => String(value) !== String(item.value)) : [...selected, item.value];
|
|
1219
|
+
setSelectedKeys(next);
|
|
1220
|
+
};
|
|
1221
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1222
|
+
import_components.View,
|
|
1223
|
+
{
|
|
1224
|
+
...interactiveControlProps(optionControlKey, toggleOption),
|
|
1225
|
+
key: String(item.value),
|
|
1226
|
+
"data-slot": "table-filter-option",
|
|
1227
|
+
"data-value": String(item.value),
|
|
1228
|
+
"data-checked": checked ? "true" : "false",
|
|
1229
|
+
className: "x-table__filter-option",
|
|
1230
|
+
role: "button",
|
|
1231
|
+
ariaRole: "button",
|
|
1232
|
+
"aria-pressed": checked,
|
|
1233
|
+
style: {
|
|
1234
|
+
display: "flex",
|
|
1235
|
+
alignItems: "center",
|
|
1236
|
+
gap: 8,
|
|
1237
|
+
padding: "6px 8px",
|
|
1238
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1239
|
+
backgroundColor: checked ? "var(--x-table-toolbar-active-surface)" : "transparent",
|
|
1240
|
+
...interactiveFocusStyle(optionControlKey)
|
|
1241
|
+
},
|
|
1242
|
+
onClick: toggleOption
|
|
1243
|
+
},
|
|
1244
|
+
/* @__PURE__ */ import_react.default.createElement(import_checkbox.Checkbox, { checked, size, ariaLabel: String(item.text) }),
|
|
1245
|
+
renderNode(item.text, {
|
|
1246
|
+
fontSize: metrics.fontSize,
|
|
1247
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1248
|
+
color: "var(--x-table-filter-foreground)"
|
|
1249
|
+
})
|
|
1250
|
+
);
|
|
1251
|
+
})) : null),
|
|
1252
|
+
/* @__PURE__ */ import_react.default.createElement(import_components.View, { style: { display: "flex", justifyContent: "flex-end", gap: 8 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
1253
|
+
import_components.View,
|
|
1254
|
+
{
|
|
1255
|
+
...interactiveControlProps(
|
|
1256
|
+
`${openFilterKey}-reset`,
|
|
1257
|
+
() => commitFilter(column, columnIndex, true)
|
|
1258
|
+
),
|
|
1259
|
+
"data-slot": "table-filter-reset",
|
|
1260
|
+
className: "x-table__filter-reset",
|
|
1261
|
+
role: "button",
|
|
1262
|
+
ariaRole: "button",
|
|
1263
|
+
style: {
|
|
1264
|
+
padding: "6px 10px",
|
|
1265
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1266
|
+
...interactiveFocusStyle(`${openFilterKey}-reset`)
|
|
1267
|
+
},
|
|
1268
|
+
onClick: () => commitFilter(column, columnIndex, true)
|
|
1269
|
+
},
|
|
1270
|
+
renderNode((locale == null ? void 0 : locale.filterReset) ?? "重置", {
|
|
1271
|
+
fontSize: metrics.fontSize,
|
|
1272
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1273
|
+
color: "var(--x-table-toolbar-foreground)"
|
|
1274
|
+
})
|
|
1275
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
1276
|
+
import_components.View,
|
|
1277
|
+
{
|
|
1278
|
+
...interactiveControlProps(
|
|
1279
|
+
`${openFilterKey}-confirm`,
|
|
1280
|
+
() => commitFilter(column, columnIndex)
|
|
1281
|
+
),
|
|
1282
|
+
"data-slot": "table-filter-confirm",
|
|
1283
|
+
className: "x-table__filter-confirm",
|
|
1284
|
+
role: "button",
|
|
1285
|
+
ariaRole: "button",
|
|
1286
|
+
style: {
|
|
1287
|
+
padding: "6px 10px",
|
|
1288
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1289
|
+
backgroundColor: theme.colors.primary,
|
|
1290
|
+
...interactiveFocusStyle(`${openFilterKey}-confirm`)
|
|
1291
|
+
},
|
|
1292
|
+
onClick: () => commitFilter(column, columnIndex)
|
|
1293
|
+
},
|
|
1294
|
+
renderNode((locale == null ? void 0 : locale.filterConfirm) ?? "确定", {
|
|
1295
|
+
fontSize: metrics.fontSize,
|
|
1296
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1297
|
+
color: theme.colors["primary-foreground"]
|
|
1298
|
+
})
|
|
1299
|
+
))
|
|
1300
|
+
);
|
|
1301
|
+
};
|
|
1302
|
+
const renderSelectionActions = () => {
|
|
1303
|
+
if (!(resolvedRowSelection == null ? void 0 : resolvedRowSelection.selections) || resolvedRowSelection.type === "radio") return null;
|
|
1304
|
+
const changeableKeys = selectableRows.map((row) => row.key);
|
|
1305
|
+
const actions = Array.isArray(resolvedRowSelection.selections) ? resolvedRowSelection.selections : [
|
|
1306
|
+
{ key: "all", text: (locale == null ? void 0 : locale.selectAll) ?? "全选" },
|
|
1307
|
+
{ key: "invert", text: (locale == null ? void 0 : locale.selectInvert) ?? "反选" },
|
|
1308
|
+
{ key: "none", text: (locale == null ? void 0 : locale.selectNone) ?? "清空" }
|
|
1309
|
+
];
|
|
1310
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1311
|
+
import_components.View,
|
|
1312
|
+
{
|
|
1313
|
+
"data-slot": "table-selection-actions",
|
|
1314
|
+
style: { display: "flex", flexWrap: "wrap", gap: 8, padding: "8px 12px" }
|
|
1315
|
+
},
|
|
1316
|
+
actions.map((action) => {
|
|
1317
|
+
const controlKey = `selection-${String(action.key ?? action.text)}`;
|
|
1318
|
+
const activate = () => {
|
|
1319
|
+
var _a2, _b2;
|
|
1320
|
+
if (disabled) return;
|
|
1321
|
+
if (action.onSelect) {
|
|
1322
|
+
action.onSelect(changeableKeys);
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1325
|
+
if (action.key === "all") {
|
|
1326
|
+
toggleSelectAll();
|
|
1327
|
+
} else if (action.key === "invert") {
|
|
1328
|
+
const changeableSet = new Set(changeableKeys.map(String));
|
|
1329
|
+
const retained = selectedKeys.filter((key) => !changeableSet.has(String(key)));
|
|
1330
|
+
const inverted = changeableKeys.filter((key) => !selectedKeySet.has(String(key)));
|
|
1331
|
+
const nextKeys = [...retained, ...inverted];
|
|
1332
|
+
updateSelection(nextKeys, "invert");
|
|
1333
|
+
(_a2 = resolvedRowSelection.onSelectInvert) == null ? void 0 : _a2.call(resolvedRowSelection, nextKeys);
|
|
1334
|
+
} else if (action.key === "none") {
|
|
1335
|
+
updateSelection([], "none");
|
|
1336
|
+
(_b2 = resolvedRowSelection.onSelectNone) == null ? void 0 : _b2.call(resolvedRowSelection);
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1340
|
+
import_components.View,
|
|
1341
|
+
{
|
|
1342
|
+
...interactiveControlProps(controlKey, activate),
|
|
1343
|
+
key: String(action.key ?? action.text),
|
|
1344
|
+
"data-selection-action": String(action.key ?? ""),
|
|
1345
|
+
role: "button",
|
|
1346
|
+
ariaRole: "button",
|
|
1347
|
+
style: {
|
|
1348
|
+
padding: "4px 8px",
|
|
1349
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1350
|
+
...interactiveFocusStyle(controlKey)
|
|
1351
|
+
},
|
|
1352
|
+
onClick: activate
|
|
1353
|
+
},
|
|
1354
|
+
renderNode(action.text, {
|
|
1355
|
+
fontSize: metrics.fontSize,
|
|
1356
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1357
|
+
color: theme.colors.primary
|
|
1358
|
+
})
|
|
1359
|
+
);
|
|
1360
|
+
})
|
|
1361
|
+
);
|
|
1362
|
+
};
|
|
1363
|
+
const renderSelectionCell = (row) => {
|
|
1364
|
+
var _a2, _b2;
|
|
1365
|
+
if (!resolvedRowSelection) return null;
|
|
1366
|
+
const checked = selectedKeySet.has(String(row.key));
|
|
1367
|
+
const disabled2 = Boolean((_a2 = resolvedRowSelection.getCheckboxProps) == null ? void 0 : _a2.call(resolvedRowSelection, row.record).disabled);
|
|
1368
|
+
const originNode = resolvedRowSelection.type === "radio" ? /* @__PURE__ */ import_react.default.createElement(
|
|
1369
|
+
import_radio.Radio,
|
|
1370
|
+
{
|
|
1371
|
+
checked,
|
|
1372
|
+
disabled: disabled2 || providerDisabled,
|
|
1373
|
+
size,
|
|
1374
|
+
ariaLabel: `选择第 ${row.index + 1} 行`,
|
|
1375
|
+
onChange: () => toggleRowSelection(row)
|
|
1376
|
+
}
|
|
1377
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
1378
|
+
import_checkbox.Checkbox,
|
|
1379
|
+
{
|
|
1380
|
+
checked,
|
|
1381
|
+
disabled: disabled2 || providerDisabled,
|
|
1382
|
+
size,
|
|
1383
|
+
ariaLabel: `选择第 ${row.index + 1} 行`,
|
|
1384
|
+
onChange: () => toggleRowSelection(row)
|
|
1385
|
+
}
|
|
1386
|
+
);
|
|
1387
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1388
|
+
BodyCell,
|
|
1389
|
+
{
|
|
1390
|
+
"data-slot": "table-selection-cell",
|
|
1391
|
+
className: (0, import_utils.classNames)("x-table__selection-cell", semanticClassNames.cell),
|
|
1392
|
+
style: {
|
|
1393
|
+
boxSizing: "border-box",
|
|
1394
|
+
display: "flex",
|
|
1395
|
+
width: toCssSize(selectionWidth),
|
|
1396
|
+
minHeight: metrics.rowMinHeight,
|
|
1397
|
+
flexShrink: 0,
|
|
1398
|
+
alignItems: "center",
|
|
1399
|
+
justifyContent: resolvedRowSelection.align === "right" ? "flex-end" : resolvedRowSelection.align === "left" ? "flex-start" : "center",
|
|
1400
|
+
borderRight: bordered ? "1px solid var(--x-table-border)" : "none",
|
|
1401
|
+
...resolvedRowSelection.fixed ? {
|
|
1402
|
+
position: "sticky",
|
|
1403
|
+
left: 0,
|
|
1404
|
+
zIndex: 5,
|
|
1405
|
+
backgroundColor: "var(--x-table-row-surface)"
|
|
1406
|
+
} : void 0,
|
|
1407
|
+
...semanticStyles.cell
|
|
1408
|
+
},
|
|
1409
|
+
onClick: stopPropagation
|
|
1410
|
+
},
|
|
1411
|
+
((_b2 = resolvedRowSelection.renderCell) == null ? void 0 : _b2.call(resolvedRowSelection, checked, row.record, row.index, originNode)) ?? originNode
|
|
1412
|
+
);
|
|
1413
|
+
};
|
|
1414
|
+
const renderExpandCell = (row) => {
|
|
1415
|
+
var _a2;
|
|
1416
|
+
if (!showExpandColumn || !resolvedExpandable) return null;
|
|
1417
|
+
const expandableRow = isRowExpandable(row.record);
|
|
1418
|
+
const expanded = expandedKeySet.has(String(row.key));
|
|
1419
|
+
const originNode = expandableRow ? /* @__PURE__ */ import_react.default.createElement(
|
|
1420
|
+
import_components.View,
|
|
1421
|
+
{
|
|
1422
|
+
...interactiveControlProps(`expand-${String(row.key)}`, (event) => {
|
|
1423
|
+
stopPropagation(event);
|
|
1424
|
+
toggleExpand(row);
|
|
1425
|
+
}),
|
|
1426
|
+
"data-slot": "table-expand-trigger",
|
|
1427
|
+
"data-expanded": expanded ? "true" : "false",
|
|
1428
|
+
className: "x-table__expand-trigger",
|
|
1429
|
+
role: "button",
|
|
1430
|
+
ariaRole: "button",
|
|
1431
|
+
ariaLabel: String(expanded ? (locale == null ? void 0 : locale.collapse) ?? "收起" : (locale == null ? void 0 : locale.expand) ?? "展开"),
|
|
1432
|
+
style: {
|
|
1433
|
+
display: "flex",
|
|
1434
|
+
width: 28,
|
|
1435
|
+
height: 28,
|
|
1436
|
+
alignItems: "center",
|
|
1437
|
+
justifyContent: "center",
|
|
1438
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1439
|
+
...interactiveFocusStyle(`expand-${String(row.key)}`)
|
|
1440
|
+
},
|
|
1441
|
+
onClick: (event) => {
|
|
1442
|
+
stopPropagation(event);
|
|
1443
|
+
toggleExpand(row);
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1447
|
+
import_icon.Icon,
|
|
1448
|
+
{
|
|
1449
|
+
name: expanded ? "ChevronDown" : "ChevronRight",
|
|
1450
|
+
size: metrics.iconSize,
|
|
1451
|
+
color: theme.colors["muted-foreground"],
|
|
1452
|
+
block: true
|
|
1453
|
+
}
|
|
1454
|
+
)
|
|
1455
|
+
) : null;
|
|
1456
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1457
|
+
BodyCell,
|
|
1458
|
+
{
|
|
1459
|
+
"data-slot": "table-expand-cell",
|
|
1460
|
+
className: (0, import_utils.classNames)("x-table__expand-cell", semanticClassNames.cell),
|
|
1461
|
+
style: {
|
|
1462
|
+
boxSizing: "border-box",
|
|
1463
|
+
display: "flex",
|
|
1464
|
+
width: toCssSize(expandWidth),
|
|
1465
|
+
minHeight: metrics.rowMinHeight,
|
|
1466
|
+
flexShrink: 0,
|
|
1467
|
+
alignItems: "center",
|
|
1468
|
+
justifyContent: "center",
|
|
1469
|
+
borderRight: bordered ? "1px solid var(--x-table-border)" : "none",
|
|
1470
|
+
...resolvedExpandable.fixed ? {
|
|
1471
|
+
position: "sticky",
|
|
1472
|
+
left: resolvedRowSelection ? Number(selectionWidth) || 44 : 0,
|
|
1473
|
+
zIndex: 5,
|
|
1474
|
+
backgroundColor: "var(--x-table-row-surface)"
|
|
1475
|
+
} : void 0,
|
|
1476
|
+
...semanticStyles.cell
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
((_a2 = resolvedExpandable.expandIcon) == null ? void 0 : _a2.call(resolvedExpandable, {
|
|
1480
|
+
expanded,
|
|
1481
|
+
expandable: expandableRow,
|
|
1482
|
+
onExpand: () => toggleExpand(row),
|
|
1483
|
+
record: row.record
|
|
1484
|
+
})) ?? originNode
|
|
1485
|
+
);
|
|
1486
|
+
};
|
|
1487
|
+
const renderRow = (row, renderedIndex) => {
|
|
1488
|
+
const selected = selectedKeySet.has(String(row.key));
|
|
1489
|
+
const expanded = expandedKeySet.has(String(row.key));
|
|
1490
|
+
const rowProps = (onRow == null ? void 0 : onRow(row.record, row.index)) ?? {};
|
|
1491
|
+
const {
|
|
1492
|
+
className: rowPropClassName,
|
|
1493
|
+
style: rowPropStyle,
|
|
1494
|
+
onClick: rowOnClick,
|
|
1495
|
+
onMouseEnter: rowOnMouseEnter,
|
|
1496
|
+
onMouseLeave: rowOnMouseLeave,
|
|
1497
|
+
onTouchStart: rowOnTouchStart,
|
|
1498
|
+
onTouchEnd: rowOnTouchEnd,
|
|
1499
|
+
onTouchCancel: rowOnTouchCancel,
|
|
1500
|
+
...rowRest
|
|
1501
|
+
} = rowProps;
|
|
1502
|
+
const resolvedRowClassName = typeof rowClassName === "function" ? rowClassName(row.record, row.index) : rowClassName;
|
|
1503
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, { key: String(row.key) }, /* @__PURE__ */ import_react.default.createElement(
|
|
1504
|
+
BodyRow,
|
|
1505
|
+
{
|
|
1506
|
+
...rowRest,
|
|
1507
|
+
id: `x-table-row-${String(row.key)}`,
|
|
1508
|
+
"data-slot": "table-row",
|
|
1509
|
+
"data-row-key": String(row.key),
|
|
1510
|
+
"data-row-index": row.index,
|
|
1511
|
+
"data-selected": selected ? "true" : "false",
|
|
1512
|
+
"data-expanded": expanded ? "true" : "false",
|
|
1513
|
+
"data-hoverable": rowHoverable ? "true" : "false",
|
|
1514
|
+
"data-hovered": hoveredRowKey === String(row.key) ? "true" : "false",
|
|
1515
|
+
className: (0, import_utils.classNames)(
|
|
1516
|
+
"x-table__row",
|
|
1517
|
+
selected && "x-table__row--selected",
|
|
1518
|
+
rowHoverable && "x-table__row--hoverable",
|
|
1519
|
+
semanticClassNames.row,
|
|
1520
|
+
resolvedRowClassName,
|
|
1521
|
+
rowPropClassName
|
|
1522
|
+
),
|
|
1523
|
+
style: {
|
|
1524
|
+
display: "flex",
|
|
1525
|
+
minWidth: tableMinWidth,
|
|
1526
|
+
flexDirection: "row",
|
|
1527
|
+
borderBottom: "1px solid var(--x-table-border)",
|
|
1528
|
+
backgroundColor: selected ? "var(--x-table-row-selected-surface)" : hoveredRowKey === String(row.key) ? "var(--x-table-row-hover-surface)" : striped && (virtualRange.start + renderedIndex) % 2 === 1 ? "var(--x-table-row-surface-alt)" : "var(--x-table-row-surface)",
|
|
1529
|
+
boxShadow: selected ? "inset 0 0 0 1px var(--x-table-row-selected-ring)" : void 0,
|
|
1530
|
+
cursor: (resolvedExpandable == null ? void 0 : resolvedExpandable.expandRowByClick) ? "pointer" : void 0,
|
|
1531
|
+
transition: "background-color var(--x-motion-duration-standard) ease",
|
|
1532
|
+
...semanticStyles.row,
|
|
1533
|
+
...rowPropStyle
|
|
1534
|
+
},
|
|
1535
|
+
onClick: (event) => {
|
|
1536
|
+
rowOnClick == null ? void 0 : rowOnClick(event);
|
|
1537
|
+
if ((resolvedExpandable == null ? void 0 : resolvedExpandable.expandRowByClick) && !event.defaultPrevented && !isInteractiveEventTarget(event)) {
|
|
1538
|
+
toggleExpand(row);
|
|
1539
|
+
}
|
|
1540
|
+
},
|
|
1541
|
+
onMouseEnter: (event) => {
|
|
1542
|
+
rowOnMouseEnter == null ? void 0 : rowOnMouseEnter(event);
|
|
1543
|
+
if (rowHoverable) setHoveredRowKey(String(row.key));
|
|
1544
|
+
},
|
|
1545
|
+
onMouseLeave: (event) => {
|
|
1546
|
+
rowOnMouseLeave == null ? void 0 : rowOnMouseLeave(event);
|
|
1547
|
+
setHoveredRowKey((current2) => current2 === String(row.key) ? null : current2);
|
|
1548
|
+
},
|
|
1549
|
+
onTouchStart: (event) => {
|
|
1550
|
+
rowOnTouchStart == null ? void 0 : rowOnTouchStart(event);
|
|
1551
|
+
if (rowHoverable) setHoveredRowKey(String(row.key));
|
|
1552
|
+
},
|
|
1553
|
+
onTouchEnd: (event) => {
|
|
1554
|
+
rowOnTouchEnd == null ? void 0 : rowOnTouchEnd(event);
|
|
1555
|
+
setHoveredRowKey((current2) => current2 === String(row.key) ? null : current2);
|
|
1556
|
+
},
|
|
1557
|
+
onTouchCancel: (event) => {
|
|
1558
|
+
rowOnTouchCancel == null ? void 0 : rowOnTouchCancel(event);
|
|
1559
|
+
setHoveredRowKey((current2) => current2 === String(row.key) ? null : current2);
|
|
1560
|
+
}
|
|
1561
|
+
},
|
|
1562
|
+
renderSelectionCell(row),
|
|
1563
|
+
renderExpandCell(row),
|
|
1564
|
+
visibleColumns.map((column, columnIndex) => {
|
|
1565
|
+
var _a2;
|
|
1566
|
+
const cellProps = ((_a2 = column.onCell) == null ? void 0 : _a2.call(column, row.record, row.index)) ?? {};
|
|
1567
|
+
const {
|
|
1568
|
+
className: cellPropClassName,
|
|
1569
|
+
style: cellPropStyle,
|
|
1570
|
+
...cellRest
|
|
1571
|
+
} = cellProps;
|
|
1572
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1573
|
+
BodyCell,
|
|
1574
|
+
{
|
|
1575
|
+
...cellRest,
|
|
1576
|
+
key: getColumnKey(column, columnIndex),
|
|
1577
|
+
"data-slot": "table-cell",
|
|
1578
|
+
"data-column-key": getColumnKey(column, columnIndex),
|
|
1579
|
+
className: (0, import_utils.classNames)(
|
|
1580
|
+
"x-table__cell",
|
|
1581
|
+
"x-table__body-cell",
|
|
1582
|
+
semanticClassNames.cell,
|
|
1583
|
+
column.className,
|
|
1584
|
+
cellPropClassName
|
|
1585
|
+
),
|
|
1586
|
+
style: {
|
|
1587
|
+
...cellBaseStyle(column, columnIndex),
|
|
1588
|
+
backgroundColor: selected ? "var(--x-table-row-selected-surface)" : void 0,
|
|
1589
|
+
...cellPropStyle
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
renderCellContent(
|
|
1593
|
+
column,
|
|
1594
|
+
row.record,
|
|
1595
|
+
row.index,
|
|
1596
|
+
row.indent,
|
|
1597
|
+
columnIndex,
|
|
1598
|
+
selected
|
|
1599
|
+
)
|
|
1600
|
+
);
|
|
1601
|
+
})
|
|
1602
|
+
), expanded && isRowExpandable(row.record) && (resolvedExpandable == null ? void 0 : resolvedExpandable.expandedRowRender) ? /* @__PURE__ */ import_react.default.createElement(
|
|
1603
|
+
import_components.View,
|
|
1604
|
+
{
|
|
1605
|
+
"data-slot": "table-expanded-row",
|
|
1606
|
+
className: (0, import_utils.classNames)(
|
|
1607
|
+
"x-table__expanded-row",
|
|
1608
|
+
typeof resolvedExpandable.expandedRowClassName === "function" ? resolvedExpandable.expandedRowClassName(row.record, row.index, row.indent) : resolvedExpandable.expandedRowClassName
|
|
1609
|
+
),
|
|
1610
|
+
style: {
|
|
1611
|
+
boxSizing: "border-box",
|
|
1612
|
+
minWidth: tableMinWidth,
|
|
1613
|
+
padding: `${metrics.paddingY}px ${metrics.paddingX}px`,
|
|
1614
|
+
borderBottom: "1px solid var(--x-table-border)",
|
|
1615
|
+
backgroundColor: "var(--x-table-row-surface-alt)"
|
|
1616
|
+
}
|
|
1617
|
+
},
|
|
1618
|
+
resolvedExpandable.expandedRowRender(row.record, row.index, row.indent, expanded)
|
|
1619
|
+
) : null);
|
|
1620
|
+
};
|
|
1621
|
+
const renderBody = () => /* @__PURE__ */ import_react.default.createElement(
|
|
1622
|
+
BodyWrapper,
|
|
1623
|
+
{
|
|
1624
|
+
"data-slot": "table-body",
|
|
1625
|
+
className: (0, import_utils.classNames)(
|
|
1626
|
+
"x-table__body",
|
|
1627
|
+
semanticClassNames.body,
|
|
1628
|
+
typeof loading === "object" && loading.wrapperClassName
|
|
1629
|
+
),
|
|
1630
|
+
style: {
|
|
1631
|
+
position: "relative",
|
|
1632
|
+
minHeight: showLoading ? 160 : void 0,
|
|
1633
|
+
...semanticStyles.body
|
|
1634
|
+
}
|
|
1635
|
+
},
|
|
1636
|
+
canVirtualize && virtualRange.start > 0 ? /* @__PURE__ */ import_react.default.createElement(
|
|
1637
|
+
import_components.View,
|
|
1638
|
+
{
|
|
1639
|
+
"data-slot": "table-virtual-spacer-top",
|
|
1640
|
+
style: { height: virtualRange.start * metrics.rowMinHeight }
|
|
1641
|
+
}
|
|
1642
|
+
) : null,
|
|
1643
|
+
!showLoading && visibleRows.length === 0 ? /* @__PURE__ */ import_react.default.createElement(
|
|
1644
|
+
import_components.View,
|
|
1645
|
+
{
|
|
1646
|
+
"data-slot": "table-empty",
|
|
1647
|
+
className: (0, import_utils.classNames)("x-table__empty", semanticClassNames.empty),
|
|
1648
|
+
style: {
|
|
1649
|
+
boxSizing: "border-box",
|
|
1650
|
+
display: "flex",
|
|
1651
|
+
minHeight: 220,
|
|
1652
|
+
flexDirection: "column",
|
|
1653
|
+
alignItems: "center",
|
|
1654
|
+
justifyContent: "center",
|
|
1655
|
+
gap: 12,
|
|
1656
|
+
padding: 24,
|
|
1657
|
+
...semanticStyles.empty
|
|
1658
|
+
}
|
|
1659
|
+
},
|
|
1660
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1661
|
+
import_components.View,
|
|
1662
|
+
{
|
|
1663
|
+
"data-slot": "table-empty-icon",
|
|
1664
|
+
"aria-hidden": "true",
|
|
1665
|
+
style: {
|
|
1666
|
+
display: "flex",
|
|
1667
|
+
width: 48,
|
|
1668
|
+
height: 48,
|
|
1669
|
+
alignItems: "center",
|
|
1670
|
+
justifyContent: "center",
|
|
1671
|
+
borderRadius: 16,
|
|
1672
|
+
backgroundColor: "var(--x-table-empty-icon-surface)"
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
/* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "FileX", size: 24, color: "var(--x-table-empty-icon-foreground)", block: true })
|
|
1676
|
+
),
|
|
1677
|
+
renderNode((locale == null ? void 0 : locale.emptyText) ?? emptyText ?? "暂无数据", {
|
|
1678
|
+
fontSize: metrics.fontSize,
|
|
1679
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1680
|
+
color: "var(--x-table-empty-foreground)"
|
|
1681
|
+
})
|
|
1682
|
+
) : renderedRows.map(renderRow),
|
|
1683
|
+
canVirtualize && virtualRange.end < visibleRows.length ? /* @__PURE__ */ import_react.default.createElement(
|
|
1684
|
+
import_components.View,
|
|
1685
|
+
{
|
|
1686
|
+
"data-slot": "table-virtual-spacer-bottom",
|
|
1687
|
+
style: { height: (visibleRows.length - virtualRange.end) * metrics.rowMinHeight }
|
|
1688
|
+
}
|
|
1689
|
+
) : null,
|
|
1690
|
+
showLoading ? /* @__PURE__ */ import_react.default.createElement(
|
|
1691
|
+
import_components.View,
|
|
1692
|
+
{
|
|
1693
|
+
"data-slot": "table-loading",
|
|
1694
|
+
className: (0, import_utils.classNames)(
|
|
1695
|
+
"x-table__loading",
|
|
1696
|
+
typeof loading === "object" && loading.className,
|
|
1697
|
+
typeof loading === "object" && loading.wrapperClassName
|
|
1698
|
+
),
|
|
1699
|
+
role: "status",
|
|
1700
|
+
ariaRole: "status",
|
|
1701
|
+
"aria-live": "polite",
|
|
1702
|
+
style: {
|
|
1703
|
+
boxSizing: "border-box",
|
|
1704
|
+
display: "flex",
|
|
1705
|
+
position: "absolute",
|
|
1706
|
+
top: 0,
|
|
1707
|
+
right: 0,
|
|
1708
|
+
bottom: 0,
|
|
1709
|
+
left: 0,
|
|
1710
|
+
zIndex: 12,
|
|
1711
|
+
minHeight: 160,
|
|
1712
|
+
flexDirection: "column",
|
|
1713
|
+
alignItems: "center",
|
|
1714
|
+
justifyContent: "center",
|
|
1715
|
+
gap: 12,
|
|
1716
|
+
padding: 24,
|
|
1717
|
+
backgroundColor: "var(--x-table-loading-surface)",
|
|
1718
|
+
...typeof loading === "object" ? loading.style : void 0
|
|
1719
|
+
}
|
|
1720
|
+
},
|
|
1721
|
+
(typeof loading === "object" && loading.indicator) ?? /* @__PURE__ */ import_react.default.createElement(
|
|
1722
|
+
import_icon.Icon,
|
|
1723
|
+
{
|
|
1724
|
+
name: "Loader2",
|
|
1725
|
+
size: typeof loading === "object" && loading.size === "small" ? 16 : typeof loading === "object" && loading.size === "large" ? 28 : 20,
|
|
1726
|
+
color: "var(--x-table-loading-spinner)",
|
|
1727
|
+
spin: true,
|
|
1728
|
+
block: true
|
|
1729
|
+
}
|
|
1730
|
+
),
|
|
1731
|
+
renderNode(loadingState.tip, {
|
|
1732
|
+
fontSize: metrics.fontSize,
|
|
1733
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1734
|
+
color: "var(--x-table-loading-foreground)"
|
|
1735
|
+
})
|
|
1736
|
+
) : null
|
|
1737
|
+
);
|
|
1738
|
+
const paginationPositions = paginationEnabled ? ((_g = paginationConfig.placement) == null ? void 0 : _g.map(
|
|
1739
|
+
(position) => position === "topStart" ? "topLeft" : position === "topEnd" ? "topRight" : position === "bottomStart" ? "bottomLeft" : position === "bottomEnd" ? "bottomRight" : position
|
|
1740
|
+
)) ?? paginationConfig.position : void 0;
|
|
1741
|
+
const showTopPagination = Boolean(
|
|
1742
|
+
paginationEnabled && (paginationPositions == null ? void 0 : paginationPositions.some((position) => position.startsWith("top")))
|
|
1743
|
+
);
|
|
1744
|
+
const showBottomPagination = Boolean(
|
|
1745
|
+
paginationEnabled && (!(paginationPositions == null ? void 0 : paginationPositions.length) || paginationPositions.some((position) => position.startsWith("bottom")))
|
|
1746
|
+
);
|
|
1747
|
+
const range = total === 0 || currentPageData.length === 0 ? [0, 0] : [(safeCurrent - 1) * pageSize + 1, (safeCurrent - 1) * pageSize + currentPageData.length];
|
|
1748
|
+
const renderPagination = (placement) => {
|
|
1749
|
+
if (!paginationEnabled) return null;
|
|
1750
|
+
if (placement === "top" ? !showTopPagination : !showBottomPagination) return null;
|
|
1751
|
+
const shouldShow = totalPages > 1 || paginationConfig.showTotal || paginationConfig.showSizeChanger;
|
|
1752
|
+
if (!shouldShow) return null;
|
|
1753
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1754
|
+
import_components.View,
|
|
1755
|
+
{
|
|
1756
|
+
"data-slot": "table-pagination",
|
|
1757
|
+
"data-placement": placement,
|
|
1758
|
+
className: (0, import_utils.classNames)(
|
|
1759
|
+
"x-table__pagination",
|
|
1760
|
+
`x-table__pagination--${paginationVariant}`,
|
|
1761
|
+
semanticClassNames.pagination
|
|
1762
|
+
),
|
|
1763
|
+
style: {
|
|
1764
|
+
boxSizing: "border-box",
|
|
1765
|
+
display: "flex",
|
|
1766
|
+
flexWrap: "wrap",
|
|
1767
|
+
alignItems: "center",
|
|
1768
|
+
justifyContent: (paginationPositions == null ? void 0 : paginationPositions.some((position) => position.endsWith("Center"))) ? "center" : (paginationPositions == null ? void 0 : paginationPositions.some((position) => position.endsWith("Left"))) ? "flex-start" : "flex-end",
|
|
1769
|
+
gap: 12,
|
|
1770
|
+
padding: paginationVariant === "section" ? 16 : "12px 0",
|
|
1771
|
+
borderTop: placement === "bottom" && paginationVariant === "section" ? "1px solid var(--x-table-border)" : void 0,
|
|
1772
|
+
borderBottom: placement === "top" && paginationVariant === "section" ? "1px solid var(--x-table-border)" : void 0,
|
|
1773
|
+
backgroundColor: paginationVariant === "section" ? "var(--x-table-section-surface)" : "transparent",
|
|
1774
|
+
...semanticStyles.pagination
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
paginationConfig.showSizeChanger ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { "data-slot": "table-page-size", style: { display: "flex", flexWrap: "wrap", gap: 4 } }, (paginationConfig.pageSizeOptions ?? [10, 20, 50, 100]).map((option) => /* @__PURE__ */ import_react.default.createElement(
|
|
1778
|
+
import_components.View,
|
|
1779
|
+
{
|
|
1780
|
+
...interactiveControlProps(
|
|
1781
|
+
`page-size-${option}`,
|
|
1782
|
+
() => changePagination(1, option)
|
|
1783
|
+
),
|
|
1784
|
+
key: option,
|
|
1785
|
+
"data-page-size": option,
|
|
1786
|
+
"data-active": option === pageSize ? "true" : "false",
|
|
1787
|
+
role: "button",
|
|
1788
|
+
ariaRole: "button",
|
|
1789
|
+
ariaLabel: `每页 ${option} 条`,
|
|
1790
|
+
style: {
|
|
1791
|
+
padding: "5px 8px",
|
|
1792
|
+
border: "1px solid var(--x-table-border)",
|
|
1793
|
+
borderRadius: "var(--x-table-toolbar-radius)",
|
|
1794
|
+
backgroundColor: option === pageSize ? theme.colors.primary : "var(--x-table-section-surface)",
|
|
1795
|
+
...interactiveFocusStyle(`page-size-${option}`)
|
|
1796
|
+
},
|
|
1797
|
+
onClick: () => changePagination(1, option)
|
|
1798
|
+
},
|
|
1799
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1800
|
+
import_components.Text,
|
|
1801
|
+
{
|
|
1802
|
+
style: {
|
|
1803
|
+
fontSize: 12,
|
|
1804
|
+
lineHeight: "18px",
|
|
1805
|
+
color: option === pageSize ? theme.colors["primary-foreground"] : "var(--x-table-body-foreground)"
|
|
1806
|
+
}
|
|
1807
|
+
},
|
|
1808
|
+
option,
|
|
1809
|
+
" / 页"
|
|
1810
|
+
)
|
|
1811
|
+
))) : null,
|
|
1812
|
+
paginationConfig.showTotal ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { "data-slot": "table-pagination-total" }, renderNode(paginationConfig.showTotal(total, range), {
|
|
1813
|
+
fontSize: metrics.fontSize,
|
|
1814
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1815
|
+
color: "var(--x-table-section-foreground)"
|
|
1816
|
+
})) : null,
|
|
1817
|
+
totalPages > 1 ? /* @__PURE__ */ import_react.default.createElement(
|
|
1818
|
+
import_pagination.Pagination,
|
|
1819
|
+
{
|
|
1820
|
+
current: safeCurrent,
|
|
1821
|
+
total,
|
|
1822
|
+
pageSize,
|
|
1823
|
+
size: paginationConfig.size ?? size,
|
|
1824
|
+
showQuickJumper: paginationConfig.showQuickJumper,
|
|
1825
|
+
onChange: (page) => changePagination(page, pageSize)
|
|
1826
|
+
}
|
|
1827
|
+
) : null
|
|
1828
|
+
);
|
|
1829
|
+
};
|
|
1830
|
+
const titleContent = typeof title === "function" ? title(currentPageData) : title;
|
|
1831
|
+
const summaryContent = typeof summary === "function" ? summary(currentPageData) : summary;
|
|
1832
|
+
const footerContent = typeof footer === "function" ? footer(currentPageData) : footer;
|
|
1833
|
+
const scrollHeight = toCssSize(scroll == null ? void 0 : scroll.y);
|
|
1834
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
1835
|
+
import_components.View,
|
|
1836
|
+
{
|
|
1837
|
+
ref: rootRef,
|
|
1838
|
+
"data-slot": "table-root",
|
|
1839
|
+
"data-size": size,
|
|
1840
|
+
"data-bordered": bordered ? "true" : "false",
|
|
1841
|
+
"data-disabled": disabled ? "true" : "false",
|
|
1842
|
+
"data-loading": showLoading ? "true" : "false",
|
|
1843
|
+
"data-virtual": canVirtualize ? "true" : "false",
|
|
1844
|
+
"data-testid": testID,
|
|
1845
|
+
"aria-disabled": disabled,
|
|
1846
|
+
"aria-busy": showLoading,
|
|
1847
|
+
className: (0, import_utils.classNames)(
|
|
1848
|
+
"x-table",
|
|
1849
|
+
`x-table--${size}`,
|
|
1850
|
+
bordered && "x-table--bordered",
|
|
1851
|
+
semanticClassNames.root,
|
|
1852
|
+
className
|
|
1853
|
+
),
|
|
1854
|
+
style: {
|
|
1855
|
+
boxSizing: "border-box",
|
|
1856
|
+
position: "relative",
|
|
1857
|
+
overflow: "hidden",
|
|
1858
|
+
border: bordered ? "1px solid var(--x-table-border)" : "none",
|
|
1859
|
+
borderRadius: "var(--x-table-root-radius)",
|
|
1860
|
+
backgroundColor: "var(--x-table-surface)",
|
|
1861
|
+
color: "var(--x-table-foreground)",
|
|
1862
|
+
...semanticStyles.root,
|
|
1863
|
+
...style
|
|
1864
|
+
}
|
|
1865
|
+
},
|
|
1866
|
+
titleContent !== void 0 && titleContent !== null ? /* @__PURE__ */ import_react.default.createElement(
|
|
1867
|
+
import_components.View,
|
|
1868
|
+
{
|
|
1869
|
+
"data-slot": "table-title",
|
|
1870
|
+
className: (0, import_utils.classNames)("x-table__title", semanticClassNames.title),
|
|
1871
|
+
style: {
|
|
1872
|
+
boxSizing: "border-box",
|
|
1873
|
+
display: "flex",
|
|
1874
|
+
alignItems: "center",
|
|
1875
|
+
minHeight: metrics.rowMinHeight,
|
|
1876
|
+
padding: `${metrics.paddingY}px ${metrics.paddingX}px`,
|
|
1877
|
+
borderBottom: "1px solid var(--x-table-border)",
|
|
1878
|
+
backgroundColor: "var(--x-table-section-surface)",
|
|
1879
|
+
color: "var(--x-table-section-foreground)",
|
|
1880
|
+
...semanticStyles.title
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
titleContent
|
|
1884
|
+
) : null,
|
|
1885
|
+
renderPagination("top"),
|
|
1886
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1887
|
+
import_components.View,
|
|
1888
|
+
{
|
|
1889
|
+
"data-slot": "table-container",
|
|
1890
|
+
className: (0, import_utils.classNames)("x-table__container", semanticClassNames.container),
|
|
1891
|
+
style: { position: "relative", minWidth: 0, ...semanticStyles.container }
|
|
1892
|
+
},
|
|
1893
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1894
|
+
import_components.ScrollView,
|
|
1895
|
+
{
|
|
1896
|
+
scrollX: true,
|
|
1897
|
+
scrollY: (scroll == null ? void 0 : scroll.y) !== void 0,
|
|
1898
|
+
scrollTop,
|
|
1899
|
+
scrollIntoView: scrollTarget,
|
|
1900
|
+
"data-slot": "table-scroll",
|
|
1901
|
+
"data-scroll-top": scrollTop,
|
|
1902
|
+
"data-scroll-target": scrollTarget,
|
|
1903
|
+
style: { width: "100%", height: scrollHeight, maxHeight: scrollHeight },
|
|
1904
|
+
onScroll: (event) => {
|
|
1905
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
1906
|
+
const scrollEvent = event;
|
|
1907
|
+
const nextTop = ((_a2 = scrollEvent.detail) == null ? void 0 : _a2.scrollTop) ?? ((_b2 = scrollEvent.currentTarget) == null ? void 0 : _b2.scrollTop) ?? 0;
|
|
1908
|
+
const nextLeft = ((_c2 = scrollEvent.detail) == null ? void 0 : _c2.scrollLeft) ?? ((_d2 = scrollEvent.currentTarget) == null ? void 0 : _d2.scrollLeft) ?? 0;
|
|
1909
|
+
const scrollWidth = ((_e2 = scrollEvent.detail) == null ? void 0 : _e2.scrollWidth) ?? ((_f2 = scrollEvent.currentTarget) == null ? void 0 : _f2.scrollWidth) ?? 0;
|
|
1910
|
+
const clientWidth = ((_g2 = scrollEvent.currentTarget) == null ? void 0 : _g2.clientWidth) ?? 0;
|
|
1911
|
+
setVirtualScrollTop(nextTop);
|
|
1912
|
+
setHorizontalScrollState({
|
|
1913
|
+
canScrollLeft: nextLeft > 1,
|
|
1914
|
+
canScrollRight: scrollWidth > 0 && clientWidth > 0 ? nextLeft + clientWidth < scrollWidth - 1 : Boolean(scroll == null ? void 0 : scroll.x)
|
|
1915
|
+
});
|
|
1916
|
+
onScroll == null ? void 0 : onScroll(event);
|
|
1917
|
+
}
|
|
1918
|
+
},
|
|
1919
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1920
|
+
TableSurface,
|
|
1921
|
+
{
|
|
1922
|
+
"data-slot": "table-table",
|
|
1923
|
+
"data-layout": tableLayout,
|
|
1924
|
+
className: (0, import_utils.classNames)("x-table__table", semanticClassNames.table),
|
|
1925
|
+
style: { position: "relative", minWidth: tableMinWidth, ...semanticStyles.table }
|
|
1926
|
+
},
|
|
1927
|
+
renderHeader(),
|
|
1928
|
+
renderFilterPanel(),
|
|
1929
|
+
renderSelectionActions(),
|
|
1930
|
+
renderBody(),
|
|
1931
|
+
summaryContent !== void 0 && summaryContent !== null ? /* @__PURE__ */ import_react.default.createElement(
|
|
1932
|
+
import_components.View,
|
|
1933
|
+
{
|
|
1934
|
+
"data-slot": "table-summary",
|
|
1935
|
+
style: {
|
|
1936
|
+
boxSizing: "border-box",
|
|
1937
|
+
minWidth: tableMinWidth,
|
|
1938
|
+
padding: `${metrics.paddingY}px ${metrics.paddingX}px`,
|
|
1939
|
+
borderTop: "1px solid var(--x-table-border)",
|
|
1940
|
+
backgroundColor: "var(--x-table-row-surface-alt)"
|
|
1941
|
+
}
|
|
1942
|
+
},
|
|
1943
|
+
renderNode(summaryContent, {
|
|
1944
|
+
fontSize: metrics.fontSize,
|
|
1945
|
+
lineHeight: `${metrics.lineHeight}px`,
|
|
1946
|
+
color: "var(--x-table-body-foreground)"
|
|
1947
|
+
})
|
|
1948
|
+
) : null
|
|
1949
|
+
)
|
|
1950
|
+
)
|
|
1951
|
+
),
|
|
1952
|
+
footerContent !== void 0 && footerContent !== null ? /* @__PURE__ */ import_react.default.createElement(
|
|
1953
|
+
import_components.View,
|
|
1954
|
+
{
|
|
1955
|
+
"data-slot": "table-footer",
|
|
1956
|
+
className: (0, import_utils.classNames)("x-table__footer", semanticClassNames.footer),
|
|
1957
|
+
style: {
|
|
1958
|
+
boxSizing: "border-box",
|
|
1959
|
+
display: "flex",
|
|
1960
|
+
alignItems: "center",
|
|
1961
|
+
minHeight: metrics.rowMinHeight,
|
|
1962
|
+
padding: `${metrics.paddingY}px ${metrics.paddingX}px`,
|
|
1963
|
+
borderTop: "1px solid var(--x-table-border)",
|
|
1964
|
+
backgroundColor: "var(--x-table-section-surface)",
|
|
1965
|
+
color: "var(--x-table-section-foreground)",
|
|
1966
|
+
...semanticStyles.footer
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
footerContent
|
|
1970
|
+
) : null,
|
|
1971
|
+
renderPagination("bottom")
|
|
1972
|
+
);
|
|
1973
|
+
}
|
|
1974
|
+
var ForwardTable = (0, import_react.forwardRef)(InternalTable);
|
|
1975
|
+
var Table = ForwardTable;
|
|
1976
|
+
Table.Column = TableColumn;
|
|
1977
|
+
Table.ColumnGroup = TableColumnGroup;
|
|
1978
|
+
var table_default = Table;
|
|
1979
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1980
|
+
0 && (module.exports = {
|
|
1981
|
+
TableColumn,
|
|
1982
|
+
TableColumnGroup
|
|
1983
|
+
});
|