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