@gobolt/genesis 0.0.9 → 0.0.11
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/README.md +2 -2
- package/dist/AntdIcon-nCNB0J1E.js +192 -0
- package/dist/CheckCircleFilled-BKgizvyl.js +13 -0
- package/dist/{CheckOutlined-CeTKr6II.js → CheckOutlined-cEBrx_Ag.js} +2 -2
- package/dist/{CloseCircleFilled-DXCxlIQL.js → CloseCircleFilled-B9e7yFwo.js} +2 -2
- package/dist/{CloseOutlined-ClXDNn82.js → CloseOutlined-ogxnm7Oy.js} +2 -2
- package/dist/{Compact-CGY560JF.js → Compact-DBh6nSYB.js} +42 -45
- package/dist/{ContextIsolator-D5x2Ih51.js → ContextIsolator-CwuJooYf.js} +2 -2
- package/dist/{PurePanel-BqPLRtc2.js → DownOutlined-5-15jS0h.js} +42 -40
- package/dist/{index-C8haFnXI.js → EllipsisOutlined-CJ2pgE2d.js} +153 -150
- package/dist/ExclamationCircleFilled-BHELVsTg.js +13 -0
- package/dist/Keyframes-sPZXYuXt.js +17 -0
- package/dist/{LoadingOutlined-8EnJdZ7I.js → LoadingOutlined-C1qu6ymP.js} +6 -6
- package/dist/MinusCircleOutlined-Shz0RRQV.js +37 -0
- package/dist/{Overflow-PBZD-PFm.js → Overflow-DdNKJLQh.js} +67 -66
- package/dist/{SearchOutlined-BP3Z2K6j.js → SearchOutlined-DNj-7b_h.js} +2 -2
- package/dist/Skeleton-B3vg9CbL.js +560 -0
- package/dist/{TextArea-DKwCct3i.js → TextArea-CKWbFr0u.js} +26 -18
- package/dist/Typography-DqI7RslA.js +705 -0
- package/dist/_baseIsEqual-L0-w1QRI.js +598 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/asyncToGenerator-CKP9bEZn.js +312 -0
- package/dist/{button-CDQgO1OK.js → button-B2Rgggx2.js} +127 -116
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Avatar/Avatar.d.ts +12 -0
- package/dist/components/Avatar/Avatar.js +61 -0
- package/dist/components/Avatar/__stories__/Avatar.stories.d.ts +8 -0
- package/dist/components/Avatar/__tests__/Avatar.test.d.ts +1 -0
- package/dist/components/Avatar/__tests__/Avatar.test.js +17 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.js +4 -0
- package/dist/components/Avatar/styles.d.ts +18 -0
- package/dist/components/Avatar/styles.js +326 -0
- package/dist/components/Badge/Badge.d.ts +5 -3
- package/dist/components/Badge/Badge.js +67 -100
- package/dist/components/Badge/__stories__/Badge.stories.d.ts +5 -4
- package/dist/components/Badge/__tests__/Badge.test.js +9 -10
- package/dist/components/Badge/styles.d.ts +12 -3
- package/dist/components/Badge/styles.js +30 -27
- package/dist/components/Breadcrumb/Breadcrumb.js +2 -2
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +1 -1
- package/dist/components/Breadcrumb/styles.js +239 -2260
- package/dist/components/Button/Button.d.ts +4 -3
- package/dist/components/Button/Button.js +10 -6
- package/dist/components/Button/__stories__/Button.stories.d.ts +3 -0
- package/dist/components/Button/__tests__/Button.test.js +1 -1
- package/dist/components/Button/styles.d.ts +2 -2
- package/dist/components/Button/styles.js +20 -17
- package/dist/components/Card/Card.d.ts +9 -0
- package/dist/components/Card/Card.js +16 -0
- package/dist/components/Card/__stories__/Card.stories.d.ts +7 -0
- package/dist/components/Card/__tests__/Card.test.d.ts +1 -0
- package/dist/components/Card/__tests__/Card.test.js +16 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/index.js +4 -0
- package/dist/components/Card/styles.d.ts +16 -0
- package/dist/components/Card/styles.js +12 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/Checkbox/Checkbox.js +28 -16
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +1 -1
- package/dist/components/Checkbox/styles.js +22 -457
- package/dist/components/Dashboard/Dashboard.d.ts +5 -0
- package/dist/components/Dashboard/Dashboard.js +5 -0
- package/dist/components/Dashboard/__mocks__/dashboard-data.d.ts +14 -0
- package/dist/components/Dashboard/__mocks__/dashboard-data.js +186 -0
- package/dist/components/Dashboard/__stories__/Dashboard.stories.d.ts +7 -0
- package/dist/components/Dashboard/__stories__/DashboardLayoutContent.d.ts +2 -0
- package/dist/components/Dashboard/__stories__/DashboardLayoutContent.js +948 -0
- package/dist/components/Dashboard/__stories__/DashboardLayoutHeader.d.ts +2 -0
- package/dist/components/Dashboard/__stories__/DashboardLayoutHeader.js +85 -0
- package/dist/components/Dashboard/__stories__/DashboardLayoutStory.d.ts +13 -0
- package/dist/components/Dashboard/__stories__/DashboardLayoutStory.js +22 -0
- package/dist/components/Dashboard/__stories__/charts/LineChart.d.ts +12 -0
- package/dist/components/Dashboard/__stories__/charts/LineChart.js +536 -0
- package/dist/components/Dashboard/__tests__/Dashboard.test.d.ts +1 -0
- package/dist/components/Dashboard/__tests__/Dashboard.test.js +16 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/index.js +4 -0
- package/dist/components/Dashboard/styles.d.ts +14 -0
- package/dist/components/Dashboard/styles.js +11 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +19 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js +72 -0
- package/dist/components/ErrorBoundary/__stories__/ErrorBoundary.stories.d.ts +8 -0
- package/dist/components/ErrorBoundary/__tests__/ErrorBoundary.test.d.ts +1 -0
- package/dist/components/ErrorBoundary/__tests__/ErrorBoundary.test.js +25 -0
- package/dist/components/ErrorBoundary/index.d.ts +2 -0
- package/dist/components/ErrorBoundary/index.js +4 -0
- package/dist/components/ErrorBoundary/styles.d.ts +14 -0
- package/dist/components/ErrorBoundary/styles.js +11 -0
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +2 -2
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +33 -18
- package/dist/components/ErrorBoundaryFallback/__stories__/ErrorBoundaryFallback.stories.d.ts +1 -1
- package/dist/components/ErrorBoundaryFallback/styles.js +17 -15
- package/dist/components/Form/Form.js +3 -3
- package/dist/components/Form/__stories__/FormStory.js +127 -50
- package/dist/components/Form/__tests__/form.test.js +2 -2
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Form/styles.js +1 -1
- package/dist/components/Glyph/Glyph.d.ts +4 -0
- package/dist/components/Glyph/Glyph.js +9 -0
- package/dist/components/Glyph/__stories__/Glyph.stories.d.ts +7 -0
- package/dist/components/Glyph/index.d.ts +2 -0
- package/dist/components/Glyph/index.js +4 -0
- package/dist/components/Glyph/styles.d.ts +14 -0
- package/dist/components/Glyph/styles.js +11 -0
- package/dist/components/Input/Input.d.ts +1 -2
- package/dist/components/Input/Input.js +14 -10
- package/dist/components/Input/__tests__/Input.test.js +1 -1
- package/dist/components/Input/styles.js +58 -466
- package/dist/components/Layout/Content/Content.d.ts +11 -0
- package/dist/components/Layout/Content/Content.js +32 -0
- package/dist/components/Layout/Content/ResponsiveContent.d.ts +7 -0
- package/dist/components/Layout/Content/ResponsiveContent.js +81 -0
- package/dist/components/Layout/Content/index.d.ts +2 -0
- package/dist/components/Layout/Content/index.js +4 -0
- package/dist/components/Layout/Content/styles.d.ts +11 -0
- package/dist/components/Layout/Content/styles.js +16 -0
- package/dist/components/Layout/Layout.d.ts +8 -0
- package/dist/components/Layout/Layout.js +6 -0
- package/dist/components/Layout/MainLayout/MainLayout.d.ts +10 -0
- package/dist/components/Layout/MainLayout/MainLayout.js +28 -0
- package/dist/components/Layout/MainLayout/__stories__/MainLayout.stories.d.ts +9 -0
- package/dist/components/Layout/MainLayout/index.d.ts +2 -0
- package/dist/components/Layout/MainLayout/index.js +4 -0
- package/dist/components/Layout/MainLayout/styles.d.ts +4 -0
- package/dist/components/Layout/MainLayout/styles.js +69 -0
- package/dist/components/Layout/__stories__/Layout.stories.d.ts +7 -0
- package/dist/components/Layout/__tests__/Layout.test.d.ts +1 -0
- package/dist/components/Layout/__tests__/Layout.test.js +14 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.js +4 -0
- package/dist/components/Message/Message.d.ts +6 -4
- package/dist/components/Message/Message.js +70 -43
- package/dist/components/Message/__tests__/Message.test.js +1 -1
- package/dist/components/Message/styles.d.ts +1 -0
- package/dist/components/Message/styles.js +15 -11
- package/dist/components/Notification/Notification.js +145 -120
- package/dist/components/Notification/NotificationBadge/NotificationBadge.d.ts +6 -0
- package/dist/components/Notification/NotificationBadge/NotificationBadge.js +49 -0
- package/dist/components/Notification/NotificationBadge/__stories__/NotificationBadge.stories.d.ts +13 -0
- package/dist/components/Notification/NotificationBadge/__tests__/NotificationBadge.test.d.ts +1 -0
- package/dist/components/Notification/NotificationBadge/__tests__/NotificationBadge.test.js +18 -0
- package/dist/components/Notification/NotificationBadge/index.d.ts +2 -0
- package/dist/components/Notification/NotificationBadge/index.js +4 -0
- package/dist/components/Notification/NotificationBadge/styles.d.ts +3 -0
- package/dist/components/Notification/NotificationBadge/styles.js +34 -0
- package/dist/components/Notification/__tests__/Notification.test.js +1 -1
- package/dist/components/Notification/styles.d.ts +1 -1
- package/dist/components/Notification/styles.js +1 -1
- package/dist/components/Popover/Popover.d.ts +10 -0
- package/dist/components/Popover/Popover.js +21 -0
- package/dist/components/Popover/__stories__/Popover.stories.d.ts +7 -0
- package/dist/components/Popover/__tests__/Popover.test.d.ts +1 -0
- package/dist/components/Popover/__tests__/Popover.test.js +40 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/index.js +4 -0
- package/dist/components/Popover/styles.d.ts +15 -0
- package/dist/components/Popover/styles.js +6 -0
- package/dist/components/Progress/Progress.d.ts +18 -0
- package/dist/components/Progress/Progress.js +91 -0
- package/dist/components/Progress/Progress.util.d.ts +4 -0
- package/dist/components/Progress/Progress.util.js +62 -0
- package/dist/components/Progress/ProgressText.d.ts +11 -0
- package/dist/components/Progress/ProgressText.js +67 -0
- package/dist/components/Progress/__stories__/Progress.stories.d.ts +12 -0
- package/dist/components/Progress/__tests__/Progress.test.d.ts +1 -0
- package/dist/components/Progress/__tests__/Progress.test.js +21 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/index.js +4 -0
- package/dist/components/Progress/styles.d.ts +17 -0
- package/dist/components/Progress/styles.js +793 -0
- package/dist/components/Radio/Radio.js +22 -6
- package/dist/components/Radio/RadioGroup.js +1 -1
- package/dist/components/Radio/__tests__/RadioGroup.test.js +1 -1
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Row/Row.d.ts +14 -0
- package/dist/components/Row/Row.js +38 -0
- package/dist/components/Row/RowActions/RowActions.d.ts +9 -0
- package/dist/components/Row/RowActions/RowActions.js +59 -0
- package/dist/components/Row/RowActions/styles.d.ts +2 -0
- package/dist/components/Row/RowActions/styles.js +32 -0
- package/dist/components/Row/RowLabelValue/RowLabelValue.d.ts +11 -0
- package/dist/components/Row/RowLabelValue/RowLabelValue.js +62 -0
- package/dist/components/Row/RowLabelValue/RowSkeleton.d.ts +3 -0
- package/dist/components/Row/RowLabelValue/RowSkeleton.js +24 -0
- package/dist/components/Row/RowLabelValue/styles.d.ts +15 -0
- package/dist/components/Row/RowLabelValue/styles.js +25 -0
- package/dist/components/Row/__stories__/Row.stories.d.ts +13 -0
- package/dist/components/Row/__tests__/Row.test.d.ts +1 -0
- package/dist/components/Row/__tests__/Row.test.js +16 -0
- package/dist/components/Row/index.d.ts +2 -0
- package/dist/components/Row/index.js +4 -0
- package/dist/components/Row/styles.d.ts +15 -0
- package/dist/components/Row/styles.js +15 -0
- package/dist/components/SegmentedControls/SegmentedControls.d.ts +12 -0
- package/dist/components/SegmentedControls/SegmentedControls.js +26 -0
- package/dist/components/SegmentedControls/__stories__/SegmentedControls.stories.d.ts +9 -0
- package/dist/components/SegmentedControls/__tests__/SegmentedControls.test.d.ts +1 -0
- package/dist/components/SegmentedControls/__tests__/SegmentedControls.test.js +24 -0
- package/dist/components/SegmentedControls/index.d.ts +2 -0
- package/dist/components/SegmentedControls/index.js +4 -0
- package/dist/components/SegmentedControls/styles.d.ts +12 -0
- package/dist/components/SegmentedControls/styles.js +511 -0
- package/dist/components/Select/Select.d.ts +2 -4
- package/dist/components/Select/Select.js +12 -11
- package/dist/components/Select/__tests__/Select.test.js +1 -1
- package/dist/components/Select/styles.js +39 -3654
- package/dist/components/Shapes/Shapes.d.ts +6 -0
- package/dist/components/Shapes/Shapes.js +8 -0
- package/dist/components/Shapes/__stories__/Shapes.stories.d.ts +9 -0
- package/dist/components/Shapes/__tests__/Shapes.test.d.ts +1 -0
- package/dist/components/Shapes/__tests__/Shapes.test.js +16 -0
- package/dist/components/Shapes/index.d.ts +2 -0
- package/dist/components/Shapes/index.js +4 -0
- package/dist/components/Shapes/variants/Circle.d.ts +5 -0
- package/dist/components/Shapes/variants/Circle.js +23 -0
- package/dist/components/Shapes/variants/Rectangle.d.ts +5 -0
- package/dist/components/Shapes/variants/Rectangle.js +23 -0
- package/dist/components/Shapes/variants/Triangle.d.ts +5 -0
- package/dist/components/Shapes/variants/Triangle.js +23 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Switch/Switch.js +22 -0
- package/dist/components/Switch/__stories__/Switch.stories.d.ts +8 -0
- package/dist/components/Switch/__tests__/Switch.test.d.ts +1 -0
- package/dist/components/Switch/__tests__/Switch.test.js +25 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +4 -0
- package/dist/components/Switch/styles.d.ts +9 -0
- package/dist/components/Switch/styles.js +456 -0
- package/dist/components/Table/Table.d.ts +15 -0
- package/dist/components/Table/Table.js +23 -0
- package/dist/components/Table/__mocks__/table-mocks.d.ts +20 -0
- package/dist/components/Table/__mocks__/table-mocks.js +321 -0
- package/dist/components/Table/__stories__/Table.stories.d.ts +7 -0
- package/dist/components/Table/__tests__/Table.test.d.ts +1 -0
- package/dist/components/Table/__tests__/Table.test.js +34 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +4 -0
- package/dist/components/Table/styles.d.ts +8 -0
- package/dist/components/Table/styles.js +6 -0
- package/dist/components/Tabs/Tabs.d.ts +10 -0
- package/dist/components/Tabs/Tabs.js +23 -0
- package/dist/components/Tabs/__stories__/Tabs.stories.d.ts +8 -0
- package/dist/components/Tabs/__tests__/Tabs.test.d.ts +1 -0
- package/dist/components/Tabs/__tests__/Tabs.test.js +37 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +4 -0
- package/dist/components/Tabs/styles.d.ts +12 -0
- package/dist/components/Tabs/styles.js +102 -0
- package/dist/components/Tile/Tile.d.ts +10 -0
- package/dist/components/Tile/Tile.js +21 -0
- package/dist/components/Tile/__stories__/Tile.stories.d.ts +7 -0
- package/dist/components/Tile/__tests__/Tile.test.d.ts +1 -0
- package/dist/components/Tile/__tests__/Tile.test.js +21 -0
- package/dist/components/Tile/index.d.ts +2 -0
- package/dist/components/Tile/index.js +4 -0
- package/dist/components/Tile/styles.d.ts +11 -0
- package/dist/components/Tile/styles.js +12 -0
- package/dist/components/Toast/Toast.js +23 -6
- package/dist/components/Toast/__tests__/Toast.test.js +2 -2
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/styles.d.ts +0 -1
- package/dist/components/Toast/styles.js +14 -23
- package/dist/components/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/Tooltip/Tooltip.js +50 -0
- package/dist/components/Tooltip/__stories__/Tooltip.stories.d.ts +7 -0
- package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/components/Tooltip/__tests__/Tooltip.test.js +25 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/components/Tooltip/styles.d.ts +20 -0
- package/dist/components/Tooltip/styles.js +11 -0
- package/dist/components/Typography/Typography.d.ts +5 -1
- package/dist/components/Typography/Typography.js +2 -2
- package/dist/components/Typography/__stories__/Typography.stories.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +2 -2
- package/dist/components/Typography/index.js +1 -1
- package/dist/components/Typography/styles.d.ts +1 -0
- package/dist/components/Typography/styles.js +53 -17
- package/dist/components/index.d.ts +31 -1
- package/dist/components/index.js +54 -24
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +4 -2
- package/dist/{context-BMW3aJEf.js → context-Cx7GtZpz.js} +281 -284
- package/dist/dropdown-zGGFIyJ_.js +2044 -0
- package/dist/generateCategoricalChart-7ceYaiZ2.js +15597 -0
- package/dist/genesis/GenesisThemeBreakdown.js +38 -22
- package/dist/genesis/styles.js +7 -2923
- package/dist/iconBase-LROS5hdG.js +112 -0
- package/dist/index-BRUI9igj.js +11 -0
- package/dist/index-BTGF--50.js +1845 -0
- package/dist/index-BW_7pvTr.js +538 -0
- package/dist/{index-oK7z6jnz.js → index-ByspLxrB.js} +8640 -8798
- package/dist/{index-bKlRxQp4.js → index-CRotrkWm.js} +7 -7
- package/dist/{index-C0SmxWLS.js → index-CSPlXIlA.js} +136 -143
- package/dist/index-CdiHBmVe.js +445 -0
- package/dist/index-CodMmNWv.js +102 -0
- package/dist/{index-DPW8XdWj.js → index-CqqwGTME.js} +34 -30
- package/dist/index-D0P16DlX.js +286 -0
- package/dist/index-DLdU7Tpd.js +183 -0
- package/dist/index-DWUXwgXK.js +809 -0
- package/dist/index-DmZOkMjs.js +3628 -0
- package/dist/{index-1CBpubM3.js → index-Dyl-ddV6.js} +47 -44
- package/dist/index-hoPiccJv.js +415 -0
- package/dist/index.js +61 -31
- package/dist/interface/address.d.ts +10 -0
- package/dist/interface/address.js +1 -0
- package/dist/interface/appointment.d.ts +57 -0
- package/dist/interface/appointment.js +5 -0
- package/dist/interface/appointmentV2.d.ts +65 -0
- package/dist/interface/appointmentV2.js +1 -0
- package/dist/interface/appointmentsState.d.ts +21 -0
- package/dist/interface/appointmentsState.js +1 -0
- package/dist/interface/common.d.ts +2 -0
- package/dist/interface/common.js +1 -0
- package/dist/interface/completionData.d.ts +18 -0
- package/dist/interface/completionData.js +1 -0
- package/dist/interface/deliveryPartner.d.ts +25 -0
- package/dist/interface/deliveryPartner.js +1 -0
- package/dist/interface/organization.d.ts +9 -0
- package/dist/interface/organization.js +1 -0
- package/dist/interface/pagination.d.ts +8 -0
- package/dist/interface/pagination.js +1 -0
- package/dist/interface/roles.d.ts +9 -0
- package/dist/interface/roles.js +1 -0
- package/dist/interface/route.d.ts +73 -0
- package/dist/interface/route.js +1 -0
- package/dist/interface/routeAnalysis.d.ts +108 -0
- package/dist/interface/routeAnalysis.js +1 -0
- package/dist/interface/routeAutomationJob.d.ts +95 -0
- package/dist/interface/routeAutomationJob.js +10 -0
- package/dist/interface/routeAutomationLog.d.ts +10 -0
- package/dist/interface/routeAutomationLog.js +1 -0
- package/dist/interface/routeEvent.d.ts +55 -0
- package/dist/interface/routeEvent.js +5 -0
- package/dist/interface/serviceArea.d.ts +18 -0
- package/dist/interface/serviceArea.js +1 -0
- package/dist/interface/util.d.ts +3 -0
- package/dist/interface/util.js +1 -0
- package/dist/interface/vehicle.d.ts +120 -0
- package/dist/interface/vehicle.js +1 -0
- package/dist/interface/workOrder.d.ts +22 -0
- package/dist/interface/workOrder.js +1 -0
- package/dist/isVisible-D3-B85BJ.js +22 -0
- package/dist/{magic-string.es-D2FWSwU3.js → magic-string.es-BKBb7z-1.js} +1 -1
- package/dist/omit-B_u6A-HL.js +9 -0
- package/dist/{pickAttrs-B0YTfcV1.js → pickAttrs-CleuMJFR.js} +1 -1
- package/dist/{warning-C63HNL9U.js → presets-Djh_L_6R.js} +333 -356
- package/dist/providers/BreakpointThemeProvider.d.ts +9 -0
- package/dist/providers/BreakpointThemeProvider.js +21 -0
- package/dist/providers/GenesisProvider.js +3 -3
- package/dist/providers/ToastProvider.js +22 -6
- package/dist/providers/index.js +1 -1
- package/dist/providers/useGenesis.js +2 -2
- package/dist/responsiveObserver-O1kw80RG.js +73 -0
- package/dist/setup-CKu7-AfI.js +24706 -0
- package/dist/setup.types-dBtAXXGp.js +8824 -0
- package/dist/shadow-BoMGMNn3.js +13 -0
- package/dist/styleChecker-Cotu61d0.js +21 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +28 -12
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.d.ts +1 -3
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +37 -16
- package/dist/styles/design-tokens/sizing-tokens/index.stories.d.ts +0 -1
- package/dist/styles/theme/genesis-theme.js +468 -263
- package/dist/styles/theme/genesis-theme.types.d.ts +53 -12
- package/dist/styles/theme/theme-tree/ThemeTree.d.ts +1 -0
- package/dist/styles/theme/theme-tree/ThemeTree.js +1651 -0
- package/dist/styles/theme/theme-tree/ThemeTree.stories.d.ts +6 -0
- package/dist/{styles-CT_fyXBd.js → styles-BDbHpHsc.js} +587 -643
- package/dist/styles-BSD221S5.js +289 -0
- package/dist/styles-D9iYILpv.js +9195 -0
- package/dist/test/setup.d.ts +2 -3
- package/dist/test/setup.js +87 -4
- package/dist/test/setup.types.d.ts +7 -0
- package/dist/test/setup.types.js +1 -0
- package/dist/toArray-DGvPoJP_.js +11 -0
- package/dist/useBreakpoint-CAMzKscx.js +22 -0
- package/dist/useCSSVarCls-C-MlZC6a.js +11 -0
- package/dist/useId-D2tzlufo.js +26 -0
- package/dist/useLocale-DWRfeMSS.js +16 -0
- package/dist/useMergedState-BoELfaU9.js +23 -0
- package/dist/useSize-CPo2bUE3.js +9 -0
- package/dist/{useVariants-DvhXfgJY.js → useVariants-Cin23jEC.js} +3 -3
- package/dist/useZIndex-D81lkWy4.js +44 -0
- package/dist/utils/icon-util.d.ts +2 -0
- package/dist/utils/icon-util.js +95 -0
- package/package.json +33 -14
- package/dist/AntdIcon-BoLh1dP8.js +0 -202
- package/dist/ExclamationCircleFilled-C0Kj5KQV.js +0 -21
- package/dist/Typography-aGoDUl4R.js +0 -710
- package/dist/index-BZAhCB_K.js +0 -97
- package/dist/index-CfDY25LP.js +0 -873
- package/dist/isVisible-A-IfeFoT.js +0 -367
- package/dist/providers/ThemeProvider.d.ts +0 -9
- package/dist/providers/ThemeProvider.js +0 -21
- package/dist/setup-BvfREoHl.js +0 -33891
- package/dist/useLocale-DT-z_vQ6.js +0 -16
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/ASN.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/ASN.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Appointment.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Appointment.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Inventory.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Inventory.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Parcel.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Parcel.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Product.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Product.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Route.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Route.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Shipment.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/Shipment.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/ShoppingCart.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/ShoppingCart.js +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/System.d.ts +0 -0
- /package/dist/components/{Badge → Notification/NotificationBadge}/icons/System.js +0 -0
|
@@ -0,0 +1,3628 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import On, { useState as Ln, useRef as he, useEffect as qn, useMemo as vr, useContext as gr } from "react";
|
|
3
|
+
import { e as Ve, f as pn, a as te, j as pr, _ as ee, b as ae, d as on, g as yn, w as Ue, c as hr, n as St, F as zn } from "./presets-Djh_L_6R.js";
|
|
4
|
+
import { p as br, a8 as Sr, h as qe, z as wr, f as $n, B as un, _ as Cr, d as yr, A as Er, a as wt, E as Ct, Z as Ir, c as rt, g as zt, m as Mn, C as ot, e as at, r as it, t as Qn, j as He, M as At, D as xr } from "./index-ByspLxrB.js";
|
|
5
|
+
import { u as Zn } from "./useMergedState-BoELfaU9.js";
|
|
6
|
+
import { T as Rr, a as Or, g as $r } from "./index-DWUXwgXK.js";
|
|
7
|
+
import { K as W } from "./KeyCode-DM2sFh3-.js";
|
|
8
|
+
import { p as An } from "./pickAttrs-CleuMJFR.js";
|
|
9
|
+
import { F as Mr, s as Dr, a as Nr, b as Pr, c as _r, i as yt } from "./Overflow-DdNKJLQh.js";
|
|
10
|
+
import { o as Ft } from "./omit-B_u6A-HL.js";
|
|
11
|
+
import { R as jt } from "./index-CRotrkWm.js";
|
|
12
|
+
import "./index-DLdU7Tpd.js";
|
|
13
|
+
import { t as Jn } from "./toArray-DGvPoJP_.js";
|
|
14
|
+
import { u as Tr } from "./useZIndex-D81lkWy4.js";
|
|
15
|
+
import { i as Et, R as Lr, g as Hr } from "./DownOutlined-5-15jS0h.js";
|
|
16
|
+
import { u as Br, a as Vr, g as zr } from "./useVariants-Cin23jEC.js";
|
|
17
|
+
import { u as lt } from "./useLocale-DWRfeMSS.js";
|
|
18
|
+
import { u as Ar } from "./useCSSVarCls-C-MlZC6a.js";
|
|
19
|
+
import { u as Fr } from "./useSize-CPo2bUE3.js";
|
|
20
|
+
import { F as jr } from "./context-Cx7GtZpz.js";
|
|
21
|
+
import { u as Wr } from "./Compact-DBh6nSYB.js";
|
|
22
|
+
import { g as Kr } from "./compact-item-DH13cl8A.js";
|
|
23
|
+
import { R as Xr } from "./CheckOutlined-cEBrx_Ag.js";
|
|
24
|
+
import { R as Ur } from "./CloseCircleFilled-B9e7yFwo.js";
|
|
25
|
+
import { R as Gr } from "./CloseOutlined-ogxnm7Oy.js";
|
|
26
|
+
import { R as Yr } from "./LoadingOutlined-C1qu6ymP.js";
|
|
27
|
+
import { R as qr } from "./SearchOutlined-DNj-7b_h.js";
|
|
28
|
+
var jn = function(n) {
|
|
29
|
+
var t = n.className, r = n.customizeIcon, a = n.customizeIconProps, i = n.children, l = n.onMouseDown, u = n.onClick, d = typeof r == "function" ? r(a) : r;
|
|
30
|
+
return /* @__PURE__ */ o.createElement("span", {
|
|
31
|
+
className: t,
|
|
32
|
+
onMouseDown: function(v) {
|
|
33
|
+
v.preventDefault(), l == null || l(v);
|
|
34
|
+
},
|
|
35
|
+
style: {
|
|
36
|
+
userSelect: "none",
|
|
37
|
+
WebkitUserSelect: "none"
|
|
38
|
+
},
|
|
39
|
+
unselectable: "on",
|
|
40
|
+
onClick: u,
|
|
41
|
+
"aria-hidden": !0
|
|
42
|
+
}, d !== void 0 ? d : /* @__PURE__ */ o.createElement("span", {
|
|
43
|
+
className: Ve(t.split(/\s+/).map(function(f) {
|
|
44
|
+
return "".concat(f, "-icon");
|
|
45
|
+
}))
|
|
46
|
+
}, i));
|
|
47
|
+
}, Qr = function(n, t, r, a, i) {
|
|
48
|
+
var l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1, u = arguments.length > 6 ? arguments[6] : void 0, d = arguments.length > 7 ? arguments[7] : void 0, f = On.useMemo(function() {
|
|
49
|
+
if (pn(a) === "object")
|
|
50
|
+
return a.clearIcon;
|
|
51
|
+
if (i)
|
|
52
|
+
return i;
|
|
53
|
+
}, [a, i]), v = On.useMemo(function() {
|
|
54
|
+
return !!(!l && a && (r.length || u) && !(d === "combobox" && u === ""));
|
|
55
|
+
}, [a, l, r.length, u, d]);
|
|
56
|
+
return {
|
|
57
|
+
allowClear: v,
|
|
58
|
+
clearIcon: /* @__PURE__ */ On.createElement(jn, {
|
|
59
|
+
className: "".concat(n, "-clear"),
|
|
60
|
+
onMouseDown: t,
|
|
61
|
+
customizeIcon: f
|
|
62
|
+
}, "×")
|
|
63
|
+
};
|
|
64
|
+
}, Wt = /* @__PURE__ */ o.createContext(null);
|
|
65
|
+
function Zr() {
|
|
66
|
+
return o.useContext(Wt);
|
|
67
|
+
}
|
|
68
|
+
function Jr() {
|
|
69
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10, n = o.useState(!1), t = te(n, 2), r = t[0], a = t[1], i = o.useRef(null), l = function() {
|
|
70
|
+
window.clearTimeout(i.current);
|
|
71
|
+
};
|
|
72
|
+
o.useEffect(function() {
|
|
73
|
+
return l;
|
|
74
|
+
}, []);
|
|
75
|
+
var u = function(f, v) {
|
|
76
|
+
l(), i.current = window.setTimeout(function() {
|
|
77
|
+
a(f), v && v();
|
|
78
|
+
}, e);
|
|
79
|
+
};
|
|
80
|
+
return [r, u, l];
|
|
81
|
+
}
|
|
82
|
+
function Kt() {
|
|
83
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, n = o.useRef(null), t = o.useRef(null);
|
|
84
|
+
o.useEffect(function() {
|
|
85
|
+
return function() {
|
|
86
|
+
window.clearTimeout(t.current);
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
function r(a) {
|
|
90
|
+
(a || n.current === null) && (n.current = a), window.clearTimeout(t.current), t.current = window.setTimeout(function() {
|
|
91
|
+
n.current = null;
|
|
92
|
+
}, e);
|
|
93
|
+
}
|
|
94
|
+
return [function() {
|
|
95
|
+
return n.current;
|
|
96
|
+
}, r];
|
|
97
|
+
}
|
|
98
|
+
function kr(e, n, t, r) {
|
|
99
|
+
var a = o.useRef(null);
|
|
100
|
+
a.current = {
|
|
101
|
+
open: n,
|
|
102
|
+
triggerOpen: t,
|
|
103
|
+
customizedTrigger: r
|
|
104
|
+
}, o.useEffect(function() {
|
|
105
|
+
function i(l) {
|
|
106
|
+
var u;
|
|
107
|
+
if (!((u = a.current) !== null && u !== void 0 && u.customizedTrigger)) {
|
|
108
|
+
var d = l.target;
|
|
109
|
+
d.shadowRoot && l.composed && (d = l.composedPath()[0] || d), a.current.open && e().filter(function(f) {
|
|
110
|
+
return f;
|
|
111
|
+
}).every(function(f) {
|
|
112
|
+
return !f.contains(d) && f !== d;
|
|
113
|
+
}) && a.current.triggerOpen(!1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return window.addEventListener("mousedown", i), function() {
|
|
117
|
+
return window.removeEventListener("mousedown", i);
|
|
118
|
+
};
|
|
119
|
+
}, []);
|
|
120
|
+
}
|
|
121
|
+
function eo(e) {
|
|
122
|
+
return (
|
|
123
|
+
// Undefined for Edge bug:
|
|
124
|
+
// https://github.com/ant-design/ant-design/issues/51292
|
|
125
|
+
e && // Other keys
|
|
126
|
+
![
|
|
127
|
+
// System function button
|
|
128
|
+
W.ESC,
|
|
129
|
+
W.SHIFT,
|
|
130
|
+
W.BACKSPACE,
|
|
131
|
+
W.TAB,
|
|
132
|
+
W.WIN_KEY,
|
|
133
|
+
W.ALT,
|
|
134
|
+
W.META,
|
|
135
|
+
W.WIN_KEY_RIGHT,
|
|
136
|
+
W.CTRL,
|
|
137
|
+
W.SEMICOLON,
|
|
138
|
+
W.EQUALS,
|
|
139
|
+
W.CAPS_LOCK,
|
|
140
|
+
W.CONTEXT_MENU,
|
|
141
|
+
// F1-F12
|
|
142
|
+
W.F1,
|
|
143
|
+
W.F2,
|
|
144
|
+
W.F3,
|
|
145
|
+
W.F4,
|
|
146
|
+
W.F5,
|
|
147
|
+
W.F6,
|
|
148
|
+
W.F7,
|
|
149
|
+
W.F8,
|
|
150
|
+
W.F9,
|
|
151
|
+
W.F10,
|
|
152
|
+
W.F11,
|
|
153
|
+
W.F12
|
|
154
|
+
].includes(e)
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
var no = function(n, t) {
|
|
158
|
+
var r, a = n.prefixCls, i = n.id, l = n.inputElement, u = n.disabled, d = n.tabIndex, f = n.autoFocus, v = n.autoComplete, s = n.editable, b = n.activeDescendantId, c = n.value, g = n.maxLength, m = n.onKeyDown, S = n.onMouseDown, w = n.onChange, h = n.onPaste, E = n.onCompositionStart, C = n.onCompositionEnd, T = n.onBlur, p = n.open, I = n.attrs, B = l || /* @__PURE__ */ o.createElement("input", null), z = B, q = z.ref, _ = z.props, F = _.onKeyDown, U = _.onChange, Q = _.onMouseDown, G = _.onCompositionStart, j = _.onCompositionEnd, ne = _.onBlur, Z = _.style;
|
|
159
|
+
return pr(!("maxLength" in B.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."), B = /* @__PURE__ */ o.cloneElement(B, ee(ee(ee({
|
|
160
|
+
type: "search"
|
|
161
|
+
}, _), {}, {
|
|
162
|
+
// Override over origin props
|
|
163
|
+
id: i,
|
|
164
|
+
ref: br(t, q),
|
|
165
|
+
disabled: u,
|
|
166
|
+
tabIndex: d,
|
|
167
|
+
autoComplete: v || "off",
|
|
168
|
+
autoFocus: f,
|
|
169
|
+
className: Ve("".concat(a, "-selection-search-input"), (r = B) === null || r === void 0 || (r = r.props) === null || r === void 0 ? void 0 : r.className),
|
|
170
|
+
role: "combobox",
|
|
171
|
+
"aria-expanded": p || !1,
|
|
172
|
+
"aria-haspopup": "listbox",
|
|
173
|
+
"aria-owns": "".concat(i, "_list"),
|
|
174
|
+
"aria-autocomplete": "list",
|
|
175
|
+
"aria-controls": "".concat(i, "_list"),
|
|
176
|
+
"aria-activedescendant": p ? b : void 0
|
|
177
|
+
}, I), {}, {
|
|
178
|
+
value: s ? c : "",
|
|
179
|
+
maxLength: g,
|
|
180
|
+
readOnly: !s,
|
|
181
|
+
unselectable: s ? null : "on",
|
|
182
|
+
style: ee(ee({}, Z), {}, {
|
|
183
|
+
opacity: s ? null : 0
|
|
184
|
+
}),
|
|
185
|
+
onKeyDown: function(x) {
|
|
186
|
+
m(x), F && F(x);
|
|
187
|
+
},
|
|
188
|
+
onMouseDown: function(x) {
|
|
189
|
+
S(x), Q && Q(x);
|
|
190
|
+
},
|
|
191
|
+
onChange: function(x) {
|
|
192
|
+
w(x), U && U(x);
|
|
193
|
+
},
|
|
194
|
+
onCompositionStart: function(x) {
|
|
195
|
+
E(x), G && G(x);
|
|
196
|
+
},
|
|
197
|
+
onCompositionEnd: function(x) {
|
|
198
|
+
C(x), j && j(x);
|
|
199
|
+
},
|
|
200
|
+
onPaste: h,
|
|
201
|
+
onBlur: function(x) {
|
|
202
|
+
T(x), ne && ne(x);
|
|
203
|
+
}
|
|
204
|
+
})), B;
|
|
205
|
+
}, ut = /* @__PURE__ */ o.forwardRef(no);
|
|
206
|
+
process.env.NODE_ENV !== "production" && (ut.displayName = "Input");
|
|
207
|
+
function ct(e) {
|
|
208
|
+
return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
|
|
209
|
+
}
|
|
210
|
+
var to = typeof window < "u" && window.document && window.document.documentElement, ro = process.env.NODE_ENV !== "test" && to;
|
|
211
|
+
function oo(e) {
|
|
212
|
+
return e != null;
|
|
213
|
+
}
|
|
214
|
+
function ao(e) {
|
|
215
|
+
return !e && e !== 0;
|
|
216
|
+
}
|
|
217
|
+
function It(e) {
|
|
218
|
+
return ["string", "number"].includes(pn(e));
|
|
219
|
+
}
|
|
220
|
+
function Xt(e) {
|
|
221
|
+
var n = void 0;
|
|
222
|
+
return e && (It(e.title) ? n = e.title.toString() : It(e.label) && (n = e.label.toString())), n;
|
|
223
|
+
}
|
|
224
|
+
function io(e, n) {
|
|
225
|
+
ro ? o.useLayoutEffect(e, n) : o.useEffect(e, n);
|
|
226
|
+
}
|
|
227
|
+
function lo(e) {
|
|
228
|
+
var n;
|
|
229
|
+
return (n = e.key) !== null && n !== void 0 ? n : e.value;
|
|
230
|
+
}
|
|
231
|
+
var xt = function(n) {
|
|
232
|
+
n.preventDefault(), n.stopPropagation();
|
|
233
|
+
}, uo = function(n) {
|
|
234
|
+
var t = n.id, r = n.prefixCls, a = n.values, i = n.open, l = n.searchValue, u = n.autoClearSearchValue, d = n.inputRef, f = n.placeholder, v = n.disabled, s = n.mode, b = n.showSearch, c = n.autoFocus, g = n.autoComplete, m = n.activeDescendantId, S = n.tabIndex, w = n.removeIcon, h = n.maxTagCount, E = n.maxTagTextLength, C = n.maxTagPlaceholder, T = C === void 0 ? function(K) {
|
|
235
|
+
return "+ ".concat(K.length, " ...");
|
|
236
|
+
} : C, p = n.tagRender, I = n.onToggleOpen, B = n.onRemove, z = n.onInputChange, q = n.onInputPaste, _ = n.onInputKeyDown, F = n.onInputMouseDown, U = n.onInputCompositionStart, Q = n.onInputCompositionEnd, G = n.onInputBlur, j = o.useRef(null), ne = Ln(0), Z = te(ne, 2), Y = Z[0], x = Z[1], M = Ln(!1), fe = te(M, 2), ie = fe[0], J = fe[1], se = "".concat(r, "-selection"), Ce = i || s === "multiple" && u === !1 || s === "tags" ? l : "", ge = s === "tags" || s === "multiple" && u === !1 || b && (i || ie);
|
|
237
|
+
io(function() {
|
|
238
|
+
x(j.current.scrollWidth);
|
|
239
|
+
}, [Ce]);
|
|
240
|
+
var Oe = function(R, A, le, me, re) {
|
|
241
|
+
return /* @__PURE__ */ o.createElement("span", {
|
|
242
|
+
title: Xt(R),
|
|
243
|
+
className: Ve("".concat(se, "-item"), ae({}, "".concat(se, "-item-disabled"), le))
|
|
244
|
+
}, /* @__PURE__ */ o.createElement("span", {
|
|
245
|
+
className: "".concat(se, "-item-content")
|
|
246
|
+
}, A), me && /* @__PURE__ */ o.createElement(jn, {
|
|
247
|
+
className: "".concat(se, "-item-remove"),
|
|
248
|
+
onMouseDown: xt,
|
|
249
|
+
onClick: re,
|
|
250
|
+
customizeIcon: w
|
|
251
|
+
}, "×"));
|
|
252
|
+
}, ce = function(R, A, le, me, re, we) {
|
|
253
|
+
var Be = function(Ne) {
|
|
254
|
+
xt(Ne), I(!i);
|
|
255
|
+
};
|
|
256
|
+
return /* @__PURE__ */ o.createElement("span", {
|
|
257
|
+
onMouseDown: Be
|
|
258
|
+
}, p({
|
|
259
|
+
label: A,
|
|
260
|
+
value: R,
|
|
261
|
+
disabled: le,
|
|
262
|
+
closable: me,
|
|
263
|
+
onClose: re,
|
|
264
|
+
isMaxTag: !!we
|
|
265
|
+
}));
|
|
266
|
+
}, pe = function(R) {
|
|
267
|
+
var A = R.disabled, le = R.label, me = R.value, re = !v && !A, we = le;
|
|
268
|
+
if (typeof E == "number" && (typeof le == "string" || typeof le == "number")) {
|
|
269
|
+
var Be = String(we);
|
|
270
|
+
Be.length > E && (we = "".concat(Be.slice(0, E), "..."));
|
|
271
|
+
}
|
|
272
|
+
var xe = function(de) {
|
|
273
|
+
de && de.stopPropagation(), B(R);
|
|
274
|
+
};
|
|
275
|
+
return typeof p == "function" ? ce(me, we, A, re, xe) : Oe(R, we, A, re, xe);
|
|
276
|
+
}, O = function(R) {
|
|
277
|
+
if (!a.length)
|
|
278
|
+
return null;
|
|
279
|
+
var A = typeof T == "function" ? T(R) : T;
|
|
280
|
+
return typeof p == "function" ? ce(void 0, A, !1, !1, void 0, !0) : Oe({
|
|
281
|
+
title: A
|
|
282
|
+
}, A, !1);
|
|
283
|
+
}, y = /* @__PURE__ */ o.createElement("div", {
|
|
284
|
+
className: "".concat(se, "-search"),
|
|
285
|
+
style: {
|
|
286
|
+
width: Y
|
|
287
|
+
},
|
|
288
|
+
onFocus: function() {
|
|
289
|
+
J(!0);
|
|
290
|
+
},
|
|
291
|
+
onBlur: function() {
|
|
292
|
+
J(!1);
|
|
293
|
+
}
|
|
294
|
+
}, /* @__PURE__ */ o.createElement(ut, {
|
|
295
|
+
ref: d,
|
|
296
|
+
open: i,
|
|
297
|
+
prefixCls: r,
|
|
298
|
+
id: t,
|
|
299
|
+
inputElement: null,
|
|
300
|
+
disabled: v,
|
|
301
|
+
autoFocus: c,
|
|
302
|
+
autoComplete: g,
|
|
303
|
+
editable: ge,
|
|
304
|
+
activeDescendantId: m,
|
|
305
|
+
value: Ce,
|
|
306
|
+
onKeyDown: _,
|
|
307
|
+
onMouseDown: F,
|
|
308
|
+
onChange: z,
|
|
309
|
+
onPaste: q,
|
|
310
|
+
onCompositionStart: U,
|
|
311
|
+
onCompositionEnd: Q,
|
|
312
|
+
onBlur: G,
|
|
313
|
+
tabIndex: S,
|
|
314
|
+
attrs: An(n, !0)
|
|
315
|
+
}), /* @__PURE__ */ o.createElement("span", {
|
|
316
|
+
ref: j,
|
|
317
|
+
className: "".concat(se, "-search-mirror"),
|
|
318
|
+
"aria-hidden": !0
|
|
319
|
+
}, Ce, " ")), D = /* @__PURE__ */ o.createElement(Mr, {
|
|
320
|
+
prefixCls: "".concat(se, "-overflow"),
|
|
321
|
+
data: a,
|
|
322
|
+
renderItem: pe,
|
|
323
|
+
renderRest: O,
|
|
324
|
+
suffix: y,
|
|
325
|
+
itemKey: lo,
|
|
326
|
+
maxCount: h
|
|
327
|
+
});
|
|
328
|
+
return /* @__PURE__ */ o.createElement("span", {
|
|
329
|
+
className: "".concat(se, "-wrap")
|
|
330
|
+
}, D, !a.length && !Ce && /* @__PURE__ */ o.createElement("span", {
|
|
331
|
+
className: "".concat(se, "-placeholder")
|
|
332
|
+
}, f));
|
|
333
|
+
}, co = function(n) {
|
|
334
|
+
var t = n.inputElement, r = n.prefixCls, a = n.id, i = n.inputRef, l = n.disabled, u = n.autoFocus, d = n.autoComplete, f = n.activeDescendantId, v = n.mode, s = n.open, b = n.values, c = n.placeholder, g = n.tabIndex, m = n.showSearch, S = n.searchValue, w = n.activeValue, h = n.maxLength, E = n.onInputKeyDown, C = n.onInputMouseDown, T = n.onInputChange, p = n.onInputPaste, I = n.onInputCompositionStart, B = n.onInputCompositionEnd, z = n.onInputBlur, q = n.title, _ = o.useState(!1), F = te(_, 2), U = F[0], Q = F[1], G = v === "combobox", j = G || m, ne = b[0], Z = S || "";
|
|
335
|
+
G && w && !U && (Z = w), o.useEffect(function() {
|
|
336
|
+
G && Q(!1);
|
|
337
|
+
}, [G, w]);
|
|
338
|
+
var Y = v !== "combobox" && !s && !m ? !1 : !!Z, x = q === void 0 ? Xt(ne) : q, M = o.useMemo(function() {
|
|
339
|
+
return ne ? null : /* @__PURE__ */ o.createElement("span", {
|
|
340
|
+
className: "".concat(r, "-selection-placeholder"),
|
|
341
|
+
style: Y ? {
|
|
342
|
+
visibility: "hidden"
|
|
343
|
+
} : void 0
|
|
344
|
+
}, c);
|
|
345
|
+
}, [ne, Y, c, r]);
|
|
346
|
+
return /* @__PURE__ */ o.createElement("span", {
|
|
347
|
+
className: "".concat(r, "-selection-wrap")
|
|
348
|
+
}, /* @__PURE__ */ o.createElement("span", {
|
|
349
|
+
className: "".concat(r, "-selection-search")
|
|
350
|
+
}, /* @__PURE__ */ o.createElement(ut, {
|
|
351
|
+
ref: i,
|
|
352
|
+
prefixCls: r,
|
|
353
|
+
id: a,
|
|
354
|
+
open: s,
|
|
355
|
+
inputElement: t,
|
|
356
|
+
disabled: l,
|
|
357
|
+
autoFocus: u,
|
|
358
|
+
autoComplete: d,
|
|
359
|
+
editable: j,
|
|
360
|
+
activeDescendantId: f,
|
|
361
|
+
value: Z,
|
|
362
|
+
onKeyDown: E,
|
|
363
|
+
onMouseDown: C,
|
|
364
|
+
onChange: function(ie) {
|
|
365
|
+
Q(!0), T(ie);
|
|
366
|
+
},
|
|
367
|
+
onPaste: p,
|
|
368
|
+
onCompositionStart: I,
|
|
369
|
+
onCompositionEnd: B,
|
|
370
|
+
onBlur: z,
|
|
371
|
+
tabIndex: g,
|
|
372
|
+
attrs: An(n, !0),
|
|
373
|
+
maxLength: G ? h : void 0
|
|
374
|
+
})), !G && ne ? /* @__PURE__ */ o.createElement("span", {
|
|
375
|
+
className: "".concat(r, "-selection-item"),
|
|
376
|
+
title: x,
|
|
377
|
+
style: Y ? {
|
|
378
|
+
visibility: "hidden"
|
|
379
|
+
} : void 0
|
|
380
|
+
}, ne.label) : null, M);
|
|
381
|
+
}, so = function(n, t) {
|
|
382
|
+
var r = he(null), a = he(!1), i = n.prefixCls, l = n.open, u = n.mode, d = n.showSearch, f = n.tokenWithEnter, v = n.disabled, s = n.prefix, b = n.autoClearSearchValue, c = n.onSearch, g = n.onSearchSubmit, m = n.onToggleOpen, S = n.onInputKeyDown, w = n.onInputBlur, h = n.domRef;
|
|
383
|
+
o.useImperativeHandle(t, function() {
|
|
384
|
+
return {
|
|
385
|
+
focus: function(x) {
|
|
386
|
+
r.current.focus(x);
|
|
387
|
+
},
|
|
388
|
+
blur: function() {
|
|
389
|
+
r.current.blur();
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
});
|
|
393
|
+
var E = Kt(0), C = te(E, 2), T = C[0], p = C[1], I = function(x) {
|
|
394
|
+
var M = x.which, fe = r.current instanceof HTMLTextAreaElement;
|
|
395
|
+
!fe && l && (M === W.UP || M === W.DOWN) && x.preventDefault(), S && S(x), M === W.ENTER && u === "tags" && !a.current && !l && (g == null || g(x.target.value)), !(fe && !l && ~[W.UP, W.DOWN, W.LEFT, W.RIGHT].indexOf(M)) && eo(M) && m(!0);
|
|
396
|
+
}, B = function() {
|
|
397
|
+
p(!0);
|
|
398
|
+
}, z = he(null), q = function(x) {
|
|
399
|
+
c(x, !0, a.current) !== !1 && m(!0);
|
|
400
|
+
}, _ = function() {
|
|
401
|
+
a.current = !0;
|
|
402
|
+
}, F = function(x) {
|
|
403
|
+
a.current = !1, u !== "combobox" && q(x.target.value);
|
|
404
|
+
}, U = function(x) {
|
|
405
|
+
var M = x.target.value;
|
|
406
|
+
if (f && z.current && /[\r\n]/.test(z.current)) {
|
|
407
|
+
var fe = z.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
|
|
408
|
+
M = M.replace(fe, z.current);
|
|
409
|
+
}
|
|
410
|
+
z.current = null, q(M);
|
|
411
|
+
}, Q = function(x) {
|
|
412
|
+
var M = x.clipboardData, fe = M == null ? void 0 : M.getData("text");
|
|
413
|
+
z.current = fe || "";
|
|
414
|
+
}, G = function(x) {
|
|
415
|
+
var M = x.target;
|
|
416
|
+
if (M !== r.current) {
|
|
417
|
+
var fe = document.body.style.msTouchAction !== void 0;
|
|
418
|
+
fe ? setTimeout(function() {
|
|
419
|
+
r.current.focus();
|
|
420
|
+
}) : r.current.focus();
|
|
421
|
+
}
|
|
422
|
+
}, j = function(x) {
|
|
423
|
+
var M = T();
|
|
424
|
+
x.target !== r.current && !M && !(u === "combobox" && v) && x.preventDefault(), (u !== "combobox" && (!d || !M) || !l) && (l && b !== !1 && c("", !0, !1), m());
|
|
425
|
+
}, ne = {
|
|
426
|
+
inputRef: r,
|
|
427
|
+
onInputKeyDown: I,
|
|
428
|
+
onInputMouseDown: B,
|
|
429
|
+
onInputChange: U,
|
|
430
|
+
onInputPaste: Q,
|
|
431
|
+
onInputCompositionStart: _,
|
|
432
|
+
onInputCompositionEnd: F,
|
|
433
|
+
onInputBlur: w
|
|
434
|
+
}, Z = u === "multiple" || u === "tags" ? /* @__PURE__ */ o.createElement(uo, on({}, n, ne)) : /* @__PURE__ */ o.createElement(co, on({}, n, ne));
|
|
435
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
436
|
+
ref: h,
|
|
437
|
+
className: "".concat(i, "-selector"),
|
|
438
|
+
onClick: G,
|
|
439
|
+
onMouseDown: j
|
|
440
|
+
}, s && /* @__PURE__ */ o.createElement("div", {
|
|
441
|
+
className: "".concat(i, "-prefix")
|
|
442
|
+
}, s), Z);
|
|
443
|
+
}, Ut = /* @__PURE__ */ o.forwardRef(so);
|
|
444
|
+
process.env.NODE_ENV !== "production" && (Ut.displayName = "Selector");
|
|
445
|
+
var fo = ["prefixCls", "disabled", "visible", "children", "popupElement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"], mo = function(n) {
|
|
446
|
+
var t = n === !0 ? 0 : 1;
|
|
447
|
+
return {
|
|
448
|
+
bottomLeft: {
|
|
449
|
+
points: ["tl", "bl"],
|
|
450
|
+
offset: [0, 4],
|
|
451
|
+
overflow: {
|
|
452
|
+
adjustX: t,
|
|
453
|
+
adjustY: 1
|
|
454
|
+
},
|
|
455
|
+
htmlRegion: "scroll"
|
|
456
|
+
},
|
|
457
|
+
bottomRight: {
|
|
458
|
+
points: ["tr", "br"],
|
|
459
|
+
offset: [0, 4],
|
|
460
|
+
overflow: {
|
|
461
|
+
adjustX: t,
|
|
462
|
+
adjustY: 1
|
|
463
|
+
},
|
|
464
|
+
htmlRegion: "scroll"
|
|
465
|
+
},
|
|
466
|
+
topLeft: {
|
|
467
|
+
points: ["bl", "tl"],
|
|
468
|
+
offset: [0, -4],
|
|
469
|
+
overflow: {
|
|
470
|
+
adjustX: t,
|
|
471
|
+
adjustY: 1
|
|
472
|
+
},
|
|
473
|
+
htmlRegion: "scroll"
|
|
474
|
+
},
|
|
475
|
+
topRight: {
|
|
476
|
+
points: ["br", "tr"],
|
|
477
|
+
offset: [0, -4],
|
|
478
|
+
overflow: {
|
|
479
|
+
adjustX: t,
|
|
480
|
+
adjustY: 1
|
|
481
|
+
},
|
|
482
|
+
htmlRegion: "scroll"
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
}, vo = function(n, t) {
|
|
486
|
+
var r = n.prefixCls;
|
|
487
|
+
n.disabled;
|
|
488
|
+
var a = n.visible, i = n.children, l = n.popupElement, u = n.animation, d = n.transitionName, f = n.dropdownStyle, v = n.dropdownClassName, s = n.direction, b = s === void 0 ? "ltr" : s, c = n.placement, g = n.builtinPlacements, m = n.dropdownMatchSelectWidth, S = n.dropdownRender, w = n.dropdownAlign, h = n.getPopupContainer, E = n.empty, C = n.getTriggerDOMNode, T = n.onPopupVisibleChange, p = n.onPopupMouseEnter, I = yn(n, fo), B = "".concat(r, "-dropdown"), z = l;
|
|
489
|
+
S && (z = S(l));
|
|
490
|
+
var q = o.useMemo(function() {
|
|
491
|
+
return g || mo(m);
|
|
492
|
+
}, [g, m]), _ = u ? "".concat(B, "-").concat(u) : d, F = typeof m == "number", U = o.useMemo(function() {
|
|
493
|
+
return F ? null : m === !1 ? "minWidth" : "width";
|
|
494
|
+
}, [m, F]), Q = f;
|
|
495
|
+
F && (Q = ee(ee({}, Q), {}, {
|
|
496
|
+
width: m
|
|
497
|
+
}));
|
|
498
|
+
var G = o.useRef(null);
|
|
499
|
+
return o.useImperativeHandle(t, function() {
|
|
500
|
+
return {
|
|
501
|
+
getPopupElement: function() {
|
|
502
|
+
var ne;
|
|
503
|
+
return (ne = G.current) === null || ne === void 0 ? void 0 : ne.popupElement;
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
}), /* @__PURE__ */ o.createElement(Rr, on({}, I, {
|
|
507
|
+
showAction: T ? ["click"] : [],
|
|
508
|
+
hideAction: T ? ["click"] : [],
|
|
509
|
+
popupPlacement: c || (b === "rtl" ? "bottomRight" : "bottomLeft"),
|
|
510
|
+
builtinPlacements: q,
|
|
511
|
+
prefixCls: B,
|
|
512
|
+
popupTransitionName: _,
|
|
513
|
+
popup: /* @__PURE__ */ o.createElement("div", {
|
|
514
|
+
onMouseEnter: p
|
|
515
|
+
}, z),
|
|
516
|
+
ref: G,
|
|
517
|
+
stretch: U,
|
|
518
|
+
popupAlign: w,
|
|
519
|
+
popupVisible: a,
|
|
520
|
+
getPopupContainer: h,
|
|
521
|
+
popupClassName: Ve(v, ae({}, "".concat(B, "-empty"), E)),
|
|
522
|
+
popupStyle: Q,
|
|
523
|
+
getTriggerDOMNode: C,
|
|
524
|
+
onPopupVisibleChange: T
|
|
525
|
+
}), i);
|
|
526
|
+
}, Gt = /* @__PURE__ */ o.forwardRef(vo);
|
|
527
|
+
process.env.NODE_ENV !== "production" && (Gt.displayName = "SelectTrigger");
|
|
528
|
+
function Rt(e, n) {
|
|
529
|
+
var t = e.key, r;
|
|
530
|
+
return "value" in e && (r = e.value), t ?? (r !== void 0 ? r : "rc-index-key-".concat(n));
|
|
531
|
+
}
|
|
532
|
+
function kn(e) {
|
|
533
|
+
return typeof e < "u" && !Number.isNaN(e);
|
|
534
|
+
}
|
|
535
|
+
function Yt(e, n) {
|
|
536
|
+
var t = e || {}, r = t.label, a = t.value, i = t.options, l = t.groupLabel, u = r || (n ? "children" : "label");
|
|
537
|
+
return {
|
|
538
|
+
label: u,
|
|
539
|
+
value: a || "value",
|
|
540
|
+
options: i || "options",
|
|
541
|
+
groupLabel: l || u
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
function go(e) {
|
|
545
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = n.fieldNames, r = n.childrenAsData, a = [], i = Yt(t, !1), l = i.label, u = i.value, d = i.options, f = i.groupLabel;
|
|
546
|
+
function v(s, b) {
|
|
547
|
+
Array.isArray(s) && s.forEach(function(c) {
|
|
548
|
+
if (b || !(d in c)) {
|
|
549
|
+
var g = c[u];
|
|
550
|
+
a.push({
|
|
551
|
+
key: Rt(c, a.length),
|
|
552
|
+
groupOption: b,
|
|
553
|
+
data: c,
|
|
554
|
+
label: c[l],
|
|
555
|
+
value: g
|
|
556
|
+
});
|
|
557
|
+
} else {
|
|
558
|
+
var m = c[f];
|
|
559
|
+
m === void 0 && r && (m = c.label), a.push({
|
|
560
|
+
key: Rt(c, a.length),
|
|
561
|
+
group: !0,
|
|
562
|
+
data: c,
|
|
563
|
+
label: m
|
|
564
|
+
}), v(c[d], !0);
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
return v(e, !1), a;
|
|
569
|
+
}
|
|
570
|
+
function et(e) {
|
|
571
|
+
var n = ee({}, e);
|
|
572
|
+
return "props" in n || Object.defineProperty(n, "props", {
|
|
573
|
+
get: function() {
|
|
574
|
+
return Ue(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), n;
|
|
575
|
+
}
|
|
576
|
+
}), n;
|
|
577
|
+
}
|
|
578
|
+
var po = function(n, t, r) {
|
|
579
|
+
if (!t || !t.length)
|
|
580
|
+
return null;
|
|
581
|
+
var a = !1, i = function u(d, f) {
|
|
582
|
+
var v = Sr(f), s = v[0], b = v.slice(1);
|
|
583
|
+
if (!s)
|
|
584
|
+
return [d];
|
|
585
|
+
var c = d.split(s);
|
|
586
|
+
return a = a || c.length > 1, c.reduce(function(g, m) {
|
|
587
|
+
return [].concat(qe(g), qe(u(m, b)));
|
|
588
|
+
}, []).filter(Boolean);
|
|
589
|
+
}, l = i(n, t);
|
|
590
|
+
return a ? typeof r < "u" ? l.slice(0, r) : l : null;
|
|
591
|
+
}, st = /* @__PURE__ */ o.createContext(null);
|
|
592
|
+
function ho(e) {
|
|
593
|
+
var n = e.visible, t = e.values;
|
|
594
|
+
if (!n)
|
|
595
|
+
return null;
|
|
596
|
+
var r = 50;
|
|
597
|
+
return /* @__PURE__ */ o.createElement("span", {
|
|
598
|
+
"aria-live": "polite",
|
|
599
|
+
style: {
|
|
600
|
+
width: 0,
|
|
601
|
+
height: 0,
|
|
602
|
+
position: "absolute",
|
|
603
|
+
overflow: "hidden",
|
|
604
|
+
opacity: 0
|
|
605
|
+
}
|
|
606
|
+
}, "".concat(t.slice(0, r).map(function(a) {
|
|
607
|
+
var i = a.label, l = a.value;
|
|
608
|
+
return ["number", "string"].includes(pn(i)) ? i : l;
|
|
609
|
+
}).join(", ")), t.length > r ? ", ..." : null);
|
|
610
|
+
}
|
|
611
|
+
var bo = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "prefix", "suffixIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"], So = ["value", "onChange", "removeIcon", "placeholder", "autoFocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex"], Fn = function(n) {
|
|
612
|
+
return n === "tags" || n === "multiple";
|
|
613
|
+
}, qt = /* @__PURE__ */ o.forwardRef(function(e, n) {
|
|
614
|
+
var t, r = e.id, a = e.prefixCls, i = e.className, l = e.showSearch, u = e.tagRender, d = e.direction, f = e.omitDomProps, v = e.displayValues, s = e.onDisplayValuesChange, b = e.emptyOptions, c = e.notFoundContent, g = c === void 0 ? "Not Found" : c, m = e.onClear, S = e.mode, w = e.disabled, h = e.loading, E = e.getInputElement, C = e.getRawInputElement, T = e.open, p = e.defaultOpen, I = e.onDropdownVisibleChange, B = e.activeValue, z = e.onActiveValueChange, q = e.activeDescendantId, _ = e.searchValue, F = e.autoClearSearchValue, U = e.onSearch, Q = e.onSearchSplit, G = e.tokenSeparators, j = e.allowClear, ne = e.prefix, Z = e.suffixIcon, Y = e.clearIcon, x = e.OptionList, M = e.animation, fe = e.transitionName, ie = e.dropdownStyle, J = e.dropdownClassName, se = e.dropdownMatchSelectWidth, Ce = e.dropdownRender, ge = e.dropdownAlign, Oe = e.placement, ce = e.builtinPlacements, pe = e.getPopupContainer, O = e.showAction, y = O === void 0 ? [] : O, D = e.onFocus, K = e.onBlur, R = e.onKeyUp, A = e.onKeyDown, le = e.onMouseDown, me = yn(e, bo), re = Fn(S), we = (l !== void 0 ? l : re) || S === "combobox", Be = ee({}, me);
|
|
615
|
+
So.forEach(function(ue) {
|
|
616
|
+
delete Be[ue];
|
|
617
|
+
}), f == null || f.forEach(function(ue) {
|
|
618
|
+
delete Be[ue];
|
|
619
|
+
});
|
|
620
|
+
var xe = o.useState(!1), Ne = te(xe, 2), de = Ne[0], Ge = Ne[1];
|
|
621
|
+
o.useEffect(function() {
|
|
622
|
+
Ge(Or());
|
|
623
|
+
}, []);
|
|
624
|
+
var Ye = o.useRef(null), Se = o.useRef(null), $e = o.useRef(null), ye = o.useRef(null), Re = o.useRef(null), Pe = o.useRef(!1), en = Jr(), je = te(en, 3), Ae = je[0], Ee = je[1], hn = je[2];
|
|
625
|
+
o.useImperativeHandle(n, function() {
|
|
626
|
+
var ue, X;
|
|
627
|
+
return {
|
|
628
|
+
focus: (ue = ye.current) === null || ue === void 0 ? void 0 : ue.focus,
|
|
629
|
+
blur: (X = ye.current) === null || X === void 0 ? void 0 : X.blur,
|
|
630
|
+
scrollTo: function(Xe) {
|
|
631
|
+
var Le;
|
|
632
|
+
return (Le = Re.current) === null || Le === void 0 ? void 0 : Le.scrollTo(Xe);
|
|
633
|
+
},
|
|
634
|
+
nativeElement: Ye.current || Se.current
|
|
635
|
+
};
|
|
636
|
+
});
|
|
637
|
+
var Fe = o.useMemo(function() {
|
|
638
|
+
var ue;
|
|
639
|
+
if (S !== "combobox")
|
|
640
|
+
return _;
|
|
641
|
+
var X = (ue = v[0]) === null || ue === void 0 ? void 0 : ue.value;
|
|
642
|
+
return typeof X == "string" || typeof X == "number" ? String(X) : "";
|
|
643
|
+
}, [_, S, v]), _e = S === "combobox" && typeof E == "function" && E() || null, De = typeof C == "function" && C(), Nn = wr(Se, De == null || (t = De.props) === null || t === void 0 ? void 0 : t.ref), En = o.useState(!1), dn = te(En, 2), bn = dn[0], In = dn[1];
|
|
644
|
+
$n(function() {
|
|
645
|
+
In(!0);
|
|
646
|
+
}, []);
|
|
647
|
+
var cn = Zn(!1, {
|
|
648
|
+
defaultValue: p,
|
|
649
|
+
value: T
|
|
650
|
+
}), Qe = te(cn, 2), fn = Qe[0], mn = Qe[1], Me = bn ? fn : !1, vn = !g && b;
|
|
651
|
+
(w || vn && Me && S === "combobox") && (Me = !1);
|
|
652
|
+
var an = vn ? !1 : Me, N = o.useCallback(function(ue) {
|
|
653
|
+
var X = ue !== void 0 ? ue : !Me;
|
|
654
|
+
w || (mn(X), Me !== X && (I == null || I(X)));
|
|
655
|
+
}, [w, Me, mn, I]), V = o.useMemo(function() {
|
|
656
|
+
return (G || []).some(function(ue) {
|
|
657
|
+
return [`
|
|
658
|
+
`, `\r
|
|
659
|
+
`].includes(ue);
|
|
660
|
+
});
|
|
661
|
+
}, [G]), L = o.useContext(st) || {}, H = L.maxCount, oe = L.rawValues, be = function(X, Ke, Xe) {
|
|
662
|
+
if (!(re && kn(H) && (oe == null ? void 0 : oe.size) >= H)) {
|
|
663
|
+
var Le = !0, ze = X;
|
|
664
|
+
z == null || z(null);
|
|
665
|
+
var sn = po(X, G, kn(H) ? H - oe.size : void 0), ln = Xe ? null : sn;
|
|
666
|
+
return S !== "combobox" && ln && (ze = "", Q == null || Q(ln), N(!1), Le = !1), U && Fe !== ze && U(ze, {
|
|
667
|
+
source: Ke ? "typing" : "effect"
|
|
668
|
+
}), Le;
|
|
669
|
+
}
|
|
670
|
+
}, Ze = function(X) {
|
|
671
|
+
!X || !X.trim() || U(X, {
|
|
672
|
+
source: "submit"
|
|
673
|
+
});
|
|
674
|
+
};
|
|
675
|
+
o.useEffect(function() {
|
|
676
|
+
!Me && !re && S !== "combobox" && be("", !1, !1);
|
|
677
|
+
}, [Me]), o.useEffect(function() {
|
|
678
|
+
fn && w && mn(!1), w && !Pe.current && Ee(!1);
|
|
679
|
+
}, [w]);
|
|
680
|
+
var We = Kt(), nn = te(We, 2), Ie = nn[0], tn = nn[1], Je = o.useRef(!1), Pn = function(X) {
|
|
681
|
+
var Ke = Ie(), Xe = X.key, Le = Xe === "Enter";
|
|
682
|
+
if (Le && (S !== "combobox" && X.preventDefault(), Me || N(!0)), tn(!!Fe), Xe === "Backspace" && !Ke && re && !Fe && v.length) {
|
|
683
|
+
for (var ze = qe(v), sn = null, ln = ze.length - 1; ln >= 0; ln -= 1) {
|
|
684
|
+
var wn = ze[ln];
|
|
685
|
+
if (!wn.disabled) {
|
|
686
|
+
ze.splice(ln, 1), sn = wn;
|
|
687
|
+
break;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
sn && s(ze, {
|
|
691
|
+
type: "remove",
|
|
692
|
+
values: [sn]
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
for (var Rn = arguments.length, Cn = new Array(Rn > 1 ? Rn - 1 : 0), Bn = 1; Bn < Rn; Bn++)
|
|
696
|
+
Cn[Bn - 1] = arguments[Bn];
|
|
697
|
+
if (Me && (!Le || !Je.current)) {
|
|
698
|
+
var Vn;
|
|
699
|
+
Le && (Je.current = !0), (Vn = Re.current) === null || Vn === void 0 || Vn.onKeyDown.apply(Vn, [X].concat(Cn));
|
|
700
|
+
}
|
|
701
|
+
A == null || A.apply(void 0, [X].concat(Cn));
|
|
702
|
+
}, Hn = function(X) {
|
|
703
|
+
for (var Ke = arguments.length, Xe = new Array(Ke > 1 ? Ke - 1 : 0), Le = 1; Le < Ke; Le++)
|
|
704
|
+
Xe[Le - 1] = arguments[Le];
|
|
705
|
+
if (Me) {
|
|
706
|
+
var ze;
|
|
707
|
+
(ze = Re.current) === null || ze === void 0 || ze.onKeyUp.apply(ze, [X].concat(Xe));
|
|
708
|
+
}
|
|
709
|
+
X.key === "Enter" && (Je.current = !1), R == null || R.apply(void 0, [X].concat(Xe));
|
|
710
|
+
}, rn = function(X) {
|
|
711
|
+
var Ke = v.filter(function(Xe) {
|
|
712
|
+
return Xe !== X;
|
|
713
|
+
});
|
|
714
|
+
s(Ke, {
|
|
715
|
+
type: "remove",
|
|
716
|
+
values: [X]
|
|
717
|
+
});
|
|
718
|
+
}, ke = function() {
|
|
719
|
+
Je.current = !1;
|
|
720
|
+
}, P = o.useRef(!1), $ = function() {
|
|
721
|
+
Ee(!0), w || (D && !P.current && D.apply(void 0, arguments), y.includes("focus") && N(!0)), P.current = !0;
|
|
722
|
+
}, k = function() {
|
|
723
|
+
Pe.current = !0, Ee(!1, function() {
|
|
724
|
+
P.current = !1, Pe.current = !1, N(!1);
|
|
725
|
+
}), !w && (Fe && (S === "tags" ? U(Fe, {
|
|
726
|
+
source: "submit"
|
|
727
|
+
}) : S === "multiple" && U("", {
|
|
728
|
+
source: "blur"
|
|
729
|
+
})), K && K.apply(void 0, arguments));
|
|
730
|
+
}, ve = [];
|
|
731
|
+
o.useEffect(function() {
|
|
732
|
+
return function() {
|
|
733
|
+
ve.forEach(function(ue) {
|
|
734
|
+
return clearTimeout(ue);
|
|
735
|
+
}), ve.splice(0, ve.length);
|
|
736
|
+
};
|
|
737
|
+
}, []);
|
|
738
|
+
var Te = function(X) {
|
|
739
|
+
var Ke, Xe = X.target, Le = (Ke = $e.current) === null || Ke === void 0 ? void 0 : Ke.getPopupElement();
|
|
740
|
+
if (Le && Le.contains(Xe)) {
|
|
741
|
+
var ze = setTimeout(function() {
|
|
742
|
+
var Rn = ve.indexOf(ze);
|
|
743
|
+
if (Rn !== -1 && ve.splice(Rn, 1), hn(), !de && !Le.contains(document.activeElement)) {
|
|
744
|
+
var Cn;
|
|
745
|
+
(Cn = ye.current) === null || Cn === void 0 || Cn.focus();
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
ve.push(ze);
|
|
749
|
+
}
|
|
750
|
+
for (var sn = arguments.length, ln = new Array(sn > 1 ? sn - 1 : 0), wn = 1; wn < sn; wn++)
|
|
751
|
+
ln[wn - 1] = arguments[wn];
|
|
752
|
+
le == null || le.apply(void 0, [X].concat(ln));
|
|
753
|
+
}, xn = o.useState({}), Sn = te(xn, 2), Wn = Sn[1];
|
|
754
|
+
function Kn() {
|
|
755
|
+
Wn({});
|
|
756
|
+
}
|
|
757
|
+
var _n;
|
|
758
|
+
De && (_n = function(X) {
|
|
759
|
+
N(X);
|
|
760
|
+
}), kr(function() {
|
|
761
|
+
var ue;
|
|
762
|
+
return [Ye.current, (ue = $e.current) === null || ue === void 0 ? void 0 : ue.getPopupElement()];
|
|
763
|
+
}, an, N, !!De);
|
|
764
|
+
var Tn = o.useMemo(function() {
|
|
765
|
+
return ee(ee({}, e), {}, {
|
|
766
|
+
notFoundContent: g,
|
|
767
|
+
open: Me,
|
|
768
|
+
triggerOpen: an,
|
|
769
|
+
id: r,
|
|
770
|
+
showSearch: we,
|
|
771
|
+
multiple: re,
|
|
772
|
+
toggleOpen: N
|
|
773
|
+
});
|
|
774
|
+
}, [e, g, an, Me, r, we, re, N]), gt = !!Z || h, pt;
|
|
775
|
+
gt && (pt = /* @__PURE__ */ o.createElement(jn, {
|
|
776
|
+
className: Ve("".concat(a, "-arrow"), ae({}, "".concat(a, "-arrow-loading"), h)),
|
|
777
|
+
customizeIcon: Z,
|
|
778
|
+
customizeIconProps: {
|
|
779
|
+
loading: h,
|
|
780
|
+
searchValue: Fe,
|
|
781
|
+
open: Me,
|
|
782
|
+
focused: Ae,
|
|
783
|
+
showSearch: we
|
|
784
|
+
}
|
|
785
|
+
}));
|
|
786
|
+
var cr = function() {
|
|
787
|
+
var X;
|
|
788
|
+
m == null || m(), (X = ye.current) === null || X === void 0 || X.focus(), s([], {
|
|
789
|
+
type: "clear",
|
|
790
|
+
values: v
|
|
791
|
+
}), be("", !1, !1);
|
|
792
|
+
}, ht = Qr(a, cr, v, j, Y, w, Fe, S), sr = ht.allowClear, dr = ht.clearIcon, fr = /* @__PURE__ */ o.createElement(x, {
|
|
793
|
+
ref: Re
|
|
794
|
+
}), mr = Ve(a, i, ae(ae(ae(ae(ae(ae(ae(ae(ae(ae({}, "".concat(a, "-focused"), Ae), "".concat(a, "-multiple"), re), "".concat(a, "-single"), !re), "".concat(a, "-allow-clear"), j), "".concat(a, "-show-arrow"), gt), "".concat(a, "-disabled"), w), "".concat(a, "-loading"), h), "".concat(a, "-open"), Me), "".concat(a, "-customize-input"), _e), "".concat(a, "-show-search"), we)), bt = /* @__PURE__ */ o.createElement(Gt, {
|
|
795
|
+
ref: $e,
|
|
796
|
+
disabled: w,
|
|
797
|
+
prefixCls: a,
|
|
798
|
+
visible: an,
|
|
799
|
+
popupElement: fr,
|
|
800
|
+
animation: M,
|
|
801
|
+
transitionName: fe,
|
|
802
|
+
dropdownStyle: ie,
|
|
803
|
+
dropdownClassName: J,
|
|
804
|
+
direction: d,
|
|
805
|
+
dropdownMatchSelectWidth: se,
|
|
806
|
+
dropdownRender: Ce,
|
|
807
|
+
dropdownAlign: ge,
|
|
808
|
+
placement: Oe,
|
|
809
|
+
builtinPlacements: ce,
|
|
810
|
+
getPopupContainer: pe,
|
|
811
|
+
empty: b,
|
|
812
|
+
getTriggerDOMNode: function(X) {
|
|
813
|
+
return (
|
|
814
|
+
// TODO: This is workaround and should be removed in `rc-select`
|
|
815
|
+
// And use new standard `nativeElement` for ref.
|
|
816
|
+
// But we should update `rc-resize-observer` first.
|
|
817
|
+
Se.current || X
|
|
818
|
+
);
|
|
819
|
+
},
|
|
820
|
+
onPopupVisibleChange: _n,
|
|
821
|
+
onPopupMouseEnter: Kn
|
|
822
|
+
}, De ? /* @__PURE__ */ o.cloneElement(De, {
|
|
823
|
+
ref: Nn
|
|
824
|
+
}) : /* @__PURE__ */ o.createElement(Ut, on({}, e, {
|
|
825
|
+
domRef: Se,
|
|
826
|
+
prefixCls: a,
|
|
827
|
+
inputElement: _e,
|
|
828
|
+
ref: ye,
|
|
829
|
+
id: r,
|
|
830
|
+
prefix: ne,
|
|
831
|
+
showSearch: we,
|
|
832
|
+
autoClearSearchValue: F,
|
|
833
|
+
mode: S,
|
|
834
|
+
activeDescendantId: q,
|
|
835
|
+
tagRender: u,
|
|
836
|
+
values: v,
|
|
837
|
+
open: Me,
|
|
838
|
+
onToggleOpen: N,
|
|
839
|
+
activeValue: B,
|
|
840
|
+
searchValue: Fe,
|
|
841
|
+
onSearch: be,
|
|
842
|
+
onSearchSubmit: Ze,
|
|
843
|
+
onRemove: rn,
|
|
844
|
+
tokenWithEnter: V,
|
|
845
|
+
onInputBlur: ke
|
|
846
|
+
}))), Xn;
|
|
847
|
+
return De ? Xn = bt : Xn = /* @__PURE__ */ o.createElement("div", on({
|
|
848
|
+
className: mr
|
|
849
|
+
}, Be, {
|
|
850
|
+
ref: Ye,
|
|
851
|
+
onMouseDown: Te,
|
|
852
|
+
onKeyDown: Pn,
|
|
853
|
+
onKeyUp: Hn,
|
|
854
|
+
onFocus: $,
|
|
855
|
+
onBlur: k
|
|
856
|
+
}), /* @__PURE__ */ o.createElement(ho, {
|
|
857
|
+
visible: Ae && !Me,
|
|
858
|
+
values: v
|
|
859
|
+
}), bt, pt, sr && dr), /* @__PURE__ */ o.createElement(Wt.Provider, {
|
|
860
|
+
value: Tn
|
|
861
|
+
}, Xn);
|
|
862
|
+
});
|
|
863
|
+
process.env.NODE_ENV !== "production" && (qt.displayName = "BaseSelect");
|
|
864
|
+
var dt = function() {
|
|
865
|
+
return null;
|
|
866
|
+
};
|
|
867
|
+
dt.isSelectOptGroup = !0;
|
|
868
|
+
var ft = function() {
|
|
869
|
+
return null;
|
|
870
|
+
};
|
|
871
|
+
ft.isSelectOption = !0;
|
|
872
|
+
var Qt = /* @__PURE__ */ o.forwardRef(function(e, n) {
|
|
873
|
+
var t = e.height, r = e.offsetY, a = e.offsetX, i = e.children, l = e.prefixCls, u = e.onInnerResize, d = e.innerProps, f = e.rtl, v = e.extra, s = {}, b = {
|
|
874
|
+
display: "flex",
|
|
875
|
+
flexDirection: "column"
|
|
876
|
+
};
|
|
877
|
+
return r !== void 0 && (s = {
|
|
878
|
+
height: t,
|
|
879
|
+
position: "relative",
|
|
880
|
+
overflow: "hidden"
|
|
881
|
+
}, b = ee(ee({}, b), {}, ae(ae(ae(ae(ae({
|
|
882
|
+
transform: "translateY(".concat(r, "px)")
|
|
883
|
+
}, f ? "marginRight" : "marginLeft", -a), "position", "absolute"), "left", 0), "right", 0), "top", 0))), /* @__PURE__ */ o.createElement("div", {
|
|
884
|
+
style: s
|
|
885
|
+
}, /* @__PURE__ */ o.createElement(jt, {
|
|
886
|
+
onResize: function(g) {
|
|
887
|
+
var m = g.offsetHeight;
|
|
888
|
+
m && u && u();
|
|
889
|
+
}
|
|
890
|
+
}, /* @__PURE__ */ o.createElement("div", on({
|
|
891
|
+
style: b,
|
|
892
|
+
className: Ve(ae({}, "".concat(l, "-holder-inner"), l)),
|
|
893
|
+
ref: n
|
|
894
|
+
}, d), i, v)));
|
|
895
|
+
});
|
|
896
|
+
Qt.displayName = "Filler";
|
|
897
|
+
function wo(e) {
|
|
898
|
+
var n = e.children, t = e.setRef, r = o.useCallback(function(a) {
|
|
899
|
+
t(a);
|
|
900
|
+
}, []);
|
|
901
|
+
return /* @__PURE__ */ o.cloneElement(n, {
|
|
902
|
+
ref: r
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
function Co(e, n, t, r, a, i, l, u) {
|
|
906
|
+
var d = u.getKey;
|
|
907
|
+
return e.slice(n, t + 1).map(function(f, v) {
|
|
908
|
+
var s = n + v, b = l(f, s, {
|
|
909
|
+
style: {
|
|
910
|
+
width: r
|
|
911
|
+
},
|
|
912
|
+
offsetX: a
|
|
913
|
+
}), c = d(f);
|
|
914
|
+
return /* @__PURE__ */ o.createElement(wo, {
|
|
915
|
+
key: c,
|
|
916
|
+
setRef: function(m) {
|
|
917
|
+
return i(f, m);
|
|
918
|
+
}
|
|
919
|
+
}, b);
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
function yo(e, n, t) {
|
|
923
|
+
var r = e.length, a = n.length, i, l;
|
|
924
|
+
if (r === 0 && a === 0)
|
|
925
|
+
return null;
|
|
926
|
+
r < a ? (i = e, l = n) : (i = n, l = e);
|
|
927
|
+
var u = {
|
|
928
|
+
__EMPTY_ITEM__: !0
|
|
929
|
+
};
|
|
930
|
+
function d(g) {
|
|
931
|
+
return g !== void 0 ? t(g) : u;
|
|
932
|
+
}
|
|
933
|
+
for (var f = null, v = Math.abs(r - a) !== 1, s = 0; s < l.length; s += 1) {
|
|
934
|
+
var b = d(i[s]), c = d(l[s]);
|
|
935
|
+
if (b !== c) {
|
|
936
|
+
f = s, v = v || b !== d(l[s + 1]);
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return f === null ? null : {
|
|
941
|
+
index: f,
|
|
942
|
+
multiple: v
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
function Eo(e, n, t) {
|
|
946
|
+
var r = o.useState(e), a = te(r, 2), i = a[0], l = a[1], u = o.useState(null), d = te(u, 2), f = d[0], v = d[1];
|
|
947
|
+
return o.useEffect(function() {
|
|
948
|
+
var s = yo(i || [], e, n);
|
|
949
|
+
(s == null ? void 0 : s.index) !== void 0 && v(e[s.index]), l(e);
|
|
950
|
+
}, [e]), [f];
|
|
951
|
+
}
|
|
952
|
+
var Ot = (typeof navigator > "u" ? "undefined" : pn(navigator)) === "object" && /Firefox/i.test(navigator.userAgent);
|
|
953
|
+
const Zt = function(e, n, t, r) {
|
|
954
|
+
var a = he(!1), i = he(null);
|
|
955
|
+
function l() {
|
|
956
|
+
clearTimeout(i.current), a.current = !0, i.current = setTimeout(function() {
|
|
957
|
+
a.current = !1;
|
|
958
|
+
}, 50);
|
|
959
|
+
}
|
|
960
|
+
var u = he({
|
|
961
|
+
top: e,
|
|
962
|
+
bottom: n,
|
|
963
|
+
left: t,
|
|
964
|
+
right: r
|
|
965
|
+
});
|
|
966
|
+
return u.current.top = e, u.current.bottom = n, u.current.left = t, u.current.right = r, function(d, f) {
|
|
967
|
+
var v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, s = d ? (
|
|
968
|
+
// Pass origin wheel when on the left
|
|
969
|
+
f < 0 && u.current.left || // Pass origin wheel when on the right
|
|
970
|
+
f > 0 && u.current.right
|
|
971
|
+
) : f < 0 && u.current.top || // Pass origin wheel when on the bottom
|
|
972
|
+
f > 0 && u.current.bottom;
|
|
973
|
+
return v && s ? (clearTimeout(i.current), a.current = !1) : (!s || a.current) && l(), !a.current && s;
|
|
974
|
+
};
|
|
975
|
+
};
|
|
976
|
+
function Io(e, n, t, r, a, i, l) {
|
|
977
|
+
var u = he(0), d = he(null), f = he(null), v = he(!1), s = Zt(n, t, r, a);
|
|
978
|
+
function b(h, E) {
|
|
979
|
+
if (un.cancel(d.current), !s(!1, E)) {
|
|
980
|
+
var C = h;
|
|
981
|
+
if (!C._virtualHandled)
|
|
982
|
+
C._virtualHandled = !0;
|
|
983
|
+
else
|
|
984
|
+
return;
|
|
985
|
+
u.current += E, f.current = E, Ot || C.preventDefault(), d.current = un(function() {
|
|
986
|
+
var T = v.current ? 10 : 1;
|
|
987
|
+
l(u.current * T, !1), u.current = 0;
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function c(h, E) {
|
|
992
|
+
l(E, !0), Ot || h.preventDefault();
|
|
993
|
+
}
|
|
994
|
+
var g = he(null), m = he(null);
|
|
995
|
+
function S(h) {
|
|
996
|
+
if (e) {
|
|
997
|
+
un.cancel(m.current), m.current = un(function() {
|
|
998
|
+
g.current = null;
|
|
999
|
+
}, 2);
|
|
1000
|
+
var E = h.deltaX, C = h.deltaY, T = h.shiftKey, p = E, I = C;
|
|
1001
|
+
(g.current === "sx" || !g.current && T && C && !E) && (p = C, I = 0, g.current = "sx");
|
|
1002
|
+
var B = Math.abs(p), z = Math.abs(I);
|
|
1003
|
+
g.current === null && (g.current = i && B > z ? "x" : "y"), g.current === "y" ? b(h, I) : c(h, p);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
function w(h) {
|
|
1007
|
+
e && (v.current = h.detail === f.current);
|
|
1008
|
+
}
|
|
1009
|
+
return [S, w];
|
|
1010
|
+
}
|
|
1011
|
+
function xo(e, n, t, r) {
|
|
1012
|
+
var a = o.useMemo(function() {
|
|
1013
|
+
return [/* @__PURE__ */ new Map(), []];
|
|
1014
|
+
}, [e, t.id, r]), i = te(a, 2), l = i[0], u = i[1], d = function(v) {
|
|
1015
|
+
var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : v, b = l.get(v), c = l.get(s);
|
|
1016
|
+
if (b === void 0 || c === void 0)
|
|
1017
|
+
for (var g = e.length, m = u.length; m < g; m += 1) {
|
|
1018
|
+
var S, w = e[m], h = n(w);
|
|
1019
|
+
l.set(h, m);
|
|
1020
|
+
var E = (S = t.get(h)) !== null && S !== void 0 ? S : r;
|
|
1021
|
+
if (u[m] = (u[m - 1] || 0) + E, h === v && (b = m), h === s && (c = m), b !== void 0 && c !== void 0)
|
|
1022
|
+
break;
|
|
1023
|
+
}
|
|
1024
|
+
return {
|
|
1025
|
+
top: u[b - 1] || 0,
|
|
1026
|
+
bottom: u[c]
|
|
1027
|
+
};
|
|
1028
|
+
};
|
|
1029
|
+
return d;
|
|
1030
|
+
}
|
|
1031
|
+
var Ro = /* @__PURE__ */ function() {
|
|
1032
|
+
function e() {
|
|
1033
|
+
yr(this, e), ae(this, "maps", void 0), ae(this, "id", 0), ae(this, "diffKeys", /* @__PURE__ */ new Set()), this.maps = /* @__PURE__ */ Object.create(null);
|
|
1034
|
+
}
|
|
1035
|
+
return Cr(e, [{
|
|
1036
|
+
key: "set",
|
|
1037
|
+
value: function(t, r) {
|
|
1038
|
+
this.maps[t] = r, this.id += 1, this.diffKeys.add(t);
|
|
1039
|
+
}
|
|
1040
|
+
}, {
|
|
1041
|
+
key: "get",
|
|
1042
|
+
value: function(t) {
|
|
1043
|
+
return this.maps[t];
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* CacheMap will record the key changed.
|
|
1047
|
+
* To help to know what's update in the next render.
|
|
1048
|
+
*/
|
|
1049
|
+
}, {
|
|
1050
|
+
key: "resetRecord",
|
|
1051
|
+
value: function() {
|
|
1052
|
+
this.diffKeys.clear();
|
|
1053
|
+
}
|
|
1054
|
+
}, {
|
|
1055
|
+
key: "getRecord",
|
|
1056
|
+
value: function() {
|
|
1057
|
+
return this.diffKeys;
|
|
1058
|
+
}
|
|
1059
|
+
}]), e;
|
|
1060
|
+
}();
|
|
1061
|
+
function $t(e) {
|
|
1062
|
+
var n = parseFloat(e);
|
|
1063
|
+
return isNaN(n) ? 0 : n;
|
|
1064
|
+
}
|
|
1065
|
+
function Oo(e, n, t) {
|
|
1066
|
+
var r = o.useState(0), a = te(r, 2), i = a[0], l = a[1], u = he(/* @__PURE__ */ new Map()), d = he(new Ro()), f = he(0);
|
|
1067
|
+
function v() {
|
|
1068
|
+
f.current += 1;
|
|
1069
|
+
}
|
|
1070
|
+
function s() {
|
|
1071
|
+
var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1072
|
+
v();
|
|
1073
|
+
var g = function() {
|
|
1074
|
+
var w = !1;
|
|
1075
|
+
u.current.forEach(function(h, E) {
|
|
1076
|
+
if (h && h.offsetParent) {
|
|
1077
|
+
var C = Er(h), T = C.offsetHeight, p = getComputedStyle(C), I = p.marginTop, B = p.marginBottom, z = $t(I), q = $t(B), _ = T + z + q;
|
|
1078
|
+
d.current.get(E) !== _ && (d.current.set(E, _), w = !0);
|
|
1079
|
+
}
|
|
1080
|
+
}), w && l(function(h) {
|
|
1081
|
+
return h + 1;
|
|
1082
|
+
});
|
|
1083
|
+
};
|
|
1084
|
+
if (c)
|
|
1085
|
+
g();
|
|
1086
|
+
else {
|
|
1087
|
+
f.current += 1;
|
|
1088
|
+
var m = f.current;
|
|
1089
|
+
Promise.resolve().then(function() {
|
|
1090
|
+
m === f.current && g();
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
function b(c, g) {
|
|
1095
|
+
var m = e(c);
|
|
1096
|
+
u.current.get(m), g ? (u.current.set(m, g), s()) : u.current.delete(m);
|
|
1097
|
+
}
|
|
1098
|
+
return qn(function() {
|
|
1099
|
+
return v;
|
|
1100
|
+
}, []), [b, s, d.current, i];
|
|
1101
|
+
}
|
|
1102
|
+
var Mt = 14 / 15;
|
|
1103
|
+
function $o(e, n, t) {
|
|
1104
|
+
var r = he(!1), a = he(0), i = he(0), l = he(null), u = he(null), d, f = function(c) {
|
|
1105
|
+
if (r.current) {
|
|
1106
|
+
var g = Math.ceil(c.touches[0].pageX), m = Math.ceil(c.touches[0].pageY), S = a.current - g, w = i.current - m, h = Math.abs(S) > Math.abs(w);
|
|
1107
|
+
h ? a.current = g : i.current = m;
|
|
1108
|
+
var E = t(h, h ? S : w, !1, c);
|
|
1109
|
+
E && c.preventDefault(), clearInterval(u.current), E && (u.current = setInterval(function() {
|
|
1110
|
+
h ? S *= Mt : w *= Mt;
|
|
1111
|
+
var C = Math.floor(h ? S : w);
|
|
1112
|
+
(!t(h, C, !0) || Math.abs(C) <= 0.1) && clearInterval(u.current);
|
|
1113
|
+
}, 16));
|
|
1114
|
+
}
|
|
1115
|
+
}, v = function() {
|
|
1116
|
+
r.current = !1, d();
|
|
1117
|
+
}, s = function(c) {
|
|
1118
|
+
d(), c.touches.length === 1 && !r.current && (r.current = !0, a.current = Math.ceil(c.touches[0].pageX), i.current = Math.ceil(c.touches[0].pageY), l.current = c.target, l.current.addEventListener("touchmove", f, {
|
|
1119
|
+
passive: !1
|
|
1120
|
+
}), l.current.addEventListener("touchend", v, {
|
|
1121
|
+
passive: !0
|
|
1122
|
+
}));
|
|
1123
|
+
};
|
|
1124
|
+
d = function() {
|
|
1125
|
+
l.current && (l.current.removeEventListener("touchmove", f), l.current.removeEventListener("touchend", v));
|
|
1126
|
+
}, $n(function() {
|
|
1127
|
+
return e && n.current.addEventListener("touchstart", s, {
|
|
1128
|
+
passive: !0
|
|
1129
|
+
}), function() {
|
|
1130
|
+
var b;
|
|
1131
|
+
(b = n.current) === null || b === void 0 || b.removeEventListener("touchstart", s), d(), clearInterval(u.current);
|
|
1132
|
+
};
|
|
1133
|
+
}, [e]);
|
|
1134
|
+
}
|
|
1135
|
+
function Dt(e) {
|
|
1136
|
+
return Math.floor(Math.pow(e, 0.5));
|
|
1137
|
+
}
|
|
1138
|
+
function nt(e, n) {
|
|
1139
|
+
var t = "touches" in e ? e.touches[0] : e;
|
|
1140
|
+
return t[n ? "pageX" : "pageY"] - window[n ? "scrollX" : "scrollY"];
|
|
1141
|
+
}
|
|
1142
|
+
function Mo(e, n, t) {
|
|
1143
|
+
o.useEffect(function() {
|
|
1144
|
+
var r = n.current;
|
|
1145
|
+
if (e && r) {
|
|
1146
|
+
var a = !1, i, l, u = function() {
|
|
1147
|
+
un.cancel(i);
|
|
1148
|
+
}, d = function b() {
|
|
1149
|
+
u(), i = un(function() {
|
|
1150
|
+
t(l), b();
|
|
1151
|
+
});
|
|
1152
|
+
}, f = function(c) {
|
|
1153
|
+
var g = c;
|
|
1154
|
+
g._virtualHandled || (g._virtualHandled = !0, a = !0);
|
|
1155
|
+
}, v = function() {
|
|
1156
|
+
a = !1, u();
|
|
1157
|
+
}, s = function(c) {
|
|
1158
|
+
if (a) {
|
|
1159
|
+
var g = nt(c, !1), m = r.getBoundingClientRect(), S = m.top, w = m.bottom;
|
|
1160
|
+
if (g <= S) {
|
|
1161
|
+
var h = S - g;
|
|
1162
|
+
l = -Dt(h), d();
|
|
1163
|
+
} else if (g >= w) {
|
|
1164
|
+
var E = g - w;
|
|
1165
|
+
l = Dt(E), d();
|
|
1166
|
+
} else
|
|
1167
|
+
u();
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
return r.addEventListener("mousedown", f), r.ownerDocument.addEventListener("mouseup", v), r.ownerDocument.addEventListener("mousemove", s), function() {
|
|
1171
|
+
r.removeEventListener("mousedown", f), r.ownerDocument.removeEventListener("mouseup", v), r.ownerDocument.removeEventListener("mousemove", s), u();
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
}, [e]);
|
|
1175
|
+
}
|
|
1176
|
+
var Nt = 10;
|
|
1177
|
+
function Do(e, n, t, r, a, i, l, u) {
|
|
1178
|
+
var d = o.useRef(), f = o.useState(null), v = te(f, 2), s = v[0], b = v[1];
|
|
1179
|
+
return $n(function() {
|
|
1180
|
+
if (s && s.times < Nt) {
|
|
1181
|
+
if (!e.current) {
|
|
1182
|
+
b(function(Y) {
|
|
1183
|
+
return ee({}, Y);
|
|
1184
|
+
});
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
i();
|
|
1188
|
+
var c = s.targetAlign, g = s.originAlign, m = s.index, S = s.offset, w = e.current.clientHeight, h = !1, E = c, C = null;
|
|
1189
|
+
if (w) {
|
|
1190
|
+
for (var T = c || g, p = 0, I = 0, B = 0, z = Math.min(n.length - 1, m), q = 0; q <= z; q += 1) {
|
|
1191
|
+
var _ = a(n[q]);
|
|
1192
|
+
I = p;
|
|
1193
|
+
var F = t.get(_);
|
|
1194
|
+
B = I + (F === void 0 ? r : F), p = B;
|
|
1195
|
+
}
|
|
1196
|
+
for (var U = T === "top" ? S : w - S, Q = z; Q >= 0; Q -= 1) {
|
|
1197
|
+
var G = a(n[Q]), j = t.get(G);
|
|
1198
|
+
if (j === void 0) {
|
|
1199
|
+
h = !0;
|
|
1200
|
+
break;
|
|
1201
|
+
}
|
|
1202
|
+
if (U -= j, U <= 0)
|
|
1203
|
+
break;
|
|
1204
|
+
}
|
|
1205
|
+
switch (T) {
|
|
1206
|
+
case "top":
|
|
1207
|
+
C = I - S;
|
|
1208
|
+
break;
|
|
1209
|
+
case "bottom":
|
|
1210
|
+
C = B - w + S;
|
|
1211
|
+
break;
|
|
1212
|
+
default: {
|
|
1213
|
+
var ne = e.current.scrollTop, Z = ne + w;
|
|
1214
|
+
I < ne ? E = "top" : B > Z && (E = "bottom");
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
C !== null && l(C), C !== s.lastTop && (h = !0);
|
|
1218
|
+
}
|
|
1219
|
+
h && b(ee(ee({}, s), {}, {
|
|
1220
|
+
times: s.times + 1,
|
|
1221
|
+
targetAlign: E,
|
|
1222
|
+
lastTop: C
|
|
1223
|
+
}));
|
|
1224
|
+
} else process.env.NODE_ENV !== "production" && (s == null ? void 0 : s.times) === Nt && Ue(!1, "Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.");
|
|
1225
|
+
}, [s, e.current]), function(c) {
|
|
1226
|
+
if (c == null) {
|
|
1227
|
+
u();
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
if (un.cancel(d.current), typeof c == "number")
|
|
1231
|
+
l(c);
|
|
1232
|
+
else if (c && pn(c) === "object") {
|
|
1233
|
+
var g, m = c.align;
|
|
1234
|
+
"index" in c ? g = c.index : g = n.findIndex(function(h) {
|
|
1235
|
+
return a(h) === c.key;
|
|
1236
|
+
});
|
|
1237
|
+
var S = c.offset, w = S === void 0 ? 0 : S;
|
|
1238
|
+
b({
|
|
1239
|
+
times: 0,
|
|
1240
|
+
index: g,
|
|
1241
|
+
offset: w,
|
|
1242
|
+
originAlign: m
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
var tt = /* @__PURE__ */ o.forwardRef(function(e, n) {
|
|
1248
|
+
var t = e.prefixCls, r = e.rtl, a = e.scrollOffset, i = e.scrollRange, l = e.onStartMove, u = e.onStopMove, d = e.onScroll, f = e.horizontal, v = e.spinSize, s = e.containerSize, b = e.style, c = e.thumbStyle, g = e.showScrollBar, m = o.useState(!1), S = te(m, 2), w = S[0], h = S[1], E = o.useState(null), C = te(E, 2), T = C[0], p = C[1], I = o.useState(null), B = te(I, 2), z = B[0], q = B[1], _ = !r, F = o.useRef(), U = o.useRef(), Q = o.useState(g), G = te(Q, 2), j = G[0], ne = G[1], Z = o.useRef(), Y = function() {
|
|
1249
|
+
g === !0 || g === !1 || (clearTimeout(Z.current), ne(!0), Z.current = setTimeout(function() {
|
|
1250
|
+
ne(!1);
|
|
1251
|
+
}, 3e3));
|
|
1252
|
+
}, x = i - s || 0, M = s - v || 0, fe = o.useMemo(function() {
|
|
1253
|
+
if (a === 0 || x === 0)
|
|
1254
|
+
return 0;
|
|
1255
|
+
var O = a / x;
|
|
1256
|
+
return O * M;
|
|
1257
|
+
}, [a, x, M]), ie = function(y) {
|
|
1258
|
+
y.stopPropagation(), y.preventDefault();
|
|
1259
|
+
}, J = o.useRef({
|
|
1260
|
+
top: fe,
|
|
1261
|
+
dragging: w,
|
|
1262
|
+
pageY: T,
|
|
1263
|
+
startTop: z
|
|
1264
|
+
});
|
|
1265
|
+
J.current = {
|
|
1266
|
+
top: fe,
|
|
1267
|
+
dragging: w,
|
|
1268
|
+
pageY: T,
|
|
1269
|
+
startTop: z
|
|
1270
|
+
};
|
|
1271
|
+
var se = function(y) {
|
|
1272
|
+
h(!0), p(nt(y, f)), q(J.current.top), l(), y.stopPropagation(), y.preventDefault();
|
|
1273
|
+
};
|
|
1274
|
+
o.useEffect(function() {
|
|
1275
|
+
var O = function(R) {
|
|
1276
|
+
R.preventDefault();
|
|
1277
|
+
}, y = F.current, D = U.current;
|
|
1278
|
+
return y.addEventListener("touchstart", O, {
|
|
1279
|
+
passive: !1
|
|
1280
|
+
}), D.addEventListener("touchstart", se, {
|
|
1281
|
+
passive: !1
|
|
1282
|
+
}), function() {
|
|
1283
|
+
y.removeEventListener("touchstart", O), D.removeEventListener("touchstart", se);
|
|
1284
|
+
};
|
|
1285
|
+
}, []);
|
|
1286
|
+
var Ce = o.useRef();
|
|
1287
|
+
Ce.current = x;
|
|
1288
|
+
var ge = o.useRef();
|
|
1289
|
+
ge.current = M, o.useEffect(function() {
|
|
1290
|
+
if (w) {
|
|
1291
|
+
var O, y = function(R) {
|
|
1292
|
+
var A = J.current, le = A.dragging, me = A.pageY, re = A.startTop;
|
|
1293
|
+
un.cancel(O);
|
|
1294
|
+
var we = F.current.getBoundingClientRect(), Be = s / (f ? we.width : we.height);
|
|
1295
|
+
if (le) {
|
|
1296
|
+
var xe = (nt(R, f) - me) * Be, Ne = re;
|
|
1297
|
+
!_ && f ? Ne -= xe : Ne += xe;
|
|
1298
|
+
var de = Ce.current, Ge = ge.current, Ye = Ge ? Ne / Ge : 0, Se = Math.ceil(Ye * de);
|
|
1299
|
+
Se = Math.max(Se, 0), Se = Math.min(Se, de), O = un(function() {
|
|
1300
|
+
d(Se, f);
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
}, D = function() {
|
|
1304
|
+
h(!1), u();
|
|
1305
|
+
};
|
|
1306
|
+
return window.addEventListener("mousemove", y, {
|
|
1307
|
+
passive: !0
|
|
1308
|
+
}), window.addEventListener("touchmove", y, {
|
|
1309
|
+
passive: !0
|
|
1310
|
+
}), window.addEventListener("mouseup", D, {
|
|
1311
|
+
passive: !0
|
|
1312
|
+
}), window.addEventListener("touchend", D, {
|
|
1313
|
+
passive: !0
|
|
1314
|
+
}), function() {
|
|
1315
|
+
window.removeEventListener("mousemove", y), window.removeEventListener("touchmove", y), window.removeEventListener("mouseup", D), window.removeEventListener("touchend", D), un.cancel(O);
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
}, [w]), o.useEffect(function() {
|
|
1319
|
+
return Y(), function() {
|
|
1320
|
+
clearTimeout(Z.current);
|
|
1321
|
+
};
|
|
1322
|
+
}, [a]), o.useImperativeHandle(n, function() {
|
|
1323
|
+
return {
|
|
1324
|
+
delayHidden: Y
|
|
1325
|
+
};
|
|
1326
|
+
});
|
|
1327
|
+
var Oe = "".concat(t, "-scrollbar"), ce = {
|
|
1328
|
+
position: "absolute",
|
|
1329
|
+
visibility: j ? null : "hidden"
|
|
1330
|
+
}, pe = {
|
|
1331
|
+
position: "absolute",
|
|
1332
|
+
background: "rgba(0, 0, 0, 0.5)",
|
|
1333
|
+
borderRadius: 99,
|
|
1334
|
+
cursor: "pointer",
|
|
1335
|
+
userSelect: "none"
|
|
1336
|
+
};
|
|
1337
|
+
return f ? (ce.height = 8, ce.left = 0, ce.right = 0, ce.bottom = 0, pe.height = "100%", pe.width = v, _ ? pe.left = fe : pe.right = fe) : (ce.width = 8, ce.top = 0, ce.bottom = 0, _ ? ce.right = 0 : ce.left = 0, pe.width = "100%", pe.height = v, pe.top = fe), /* @__PURE__ */ o.createElement("div", {
|
|
1338
|
+
ref: F,
|
|
1339
|
+
className: Ve(Oe, ae(ae(ae({}, "".concat(Oe, "-horizontal"), f), "".concat(Oe, "-vertical"), !f), "".concat(Oe, "-visible"), j)),
|
|
1340
|
+
style: ee(ee({}, ce), b),
|
|
1341
|
+
onMouseDown: ie,
|
|
1342
|
+
onMouseMove: Y
|
|
1343
|
+
}, /* @__PURE__ */ o.createElement("div", {
|
|
1344
|
+
ref: U,
|
|
1345
|
+
className: Ve("".concat(Oe, "-thumb"), ae({}, "".concat(Oe, "-thumb-moving"), w)),
|
|
1346
|
+
style: ee(ee({}, pe), c),
|
|
1347
|
+
onMouseDown: se
|
|
1348
|
+
}));
|
|
1349
|
+
});
|
|
1350
|
+
process.env.NODE_ENV !== "production" && (tt.displayName = "ScrollBar");
|
|
1351
|
+
var No = 20;
|
|
1352
|
+
function Pt() {
|
|
1353
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, t = e / n * e;
|
|
1354
|
+
return isNaN(t) && (t = 0), t = Math.max(t, No), Math.floor(t);
|
|
1355
|
+
}
|
|
1356
|
+
var Po = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles", "showScrollBar"], _o = [], To = {
|
|
1357
|
+
overflowY: "auto",
|
|
1358
|
+
overflowAnchor: "none"
|
|
1359
|
+
};
|
|
1360
|
+
function Lo(e, n) {
|
|
1361
|
+
var t = e.prefixCls, r = t === void 0 ? "rc-virtual-list" : t, a = e.className, i = e.height, l = e.itemHeight, u = e.fullHeight, d = u === void 0 ? !0 : u, f = e.style, v = e.data, s = e.children, b = e.itemKey, c = e.virtual, g = e.direction, m = e.scrollWidth, S = e.component, w = S === void 0 ? "div" : S, h = e.onScroll, E = e.onVirtualScroll, C = e.onVisibleChange, T = e.innerProps, p = e.extraRender, I = e.styles, B = e.showScrollBar, z = B === void 0 ? "optional" : B, q = yn(e, Po), _ = o.useCallback(function(P) {
|
|
1362
|
+
return typeof b == "function" ? b(P) : P == null ? void 0 : P[b];
|
|
1363
|
+
}, [b]), F = Oo(_), U = te(F, 4), Q = U[0], G = U[1], j = U[2], ne = U[3], Z = !!(c !== !1 && i && l), Y = o.useMemo(function() {
|
|
1364
|
+
return Object.values(j.maps).reduce(function(P, $) {
|
|
1365
|
+
return P + $;
|
|
1366
|
+
}, 0);
|
|
1367
|
+
}, [j.id, j.maps]), x = Z && v && (Math.max(l * v.length, Y) > i || !!m), M = g === "rtl", fe = Ve(r, ae({}, "".concat(r, "-rtl"), M), a), ie = v || _o, J = he(), se = he(), Ce = he(), ge = Ln(0), Oe = te(ge, 2), ce = Oe[0], pe = Oe[1], O = Ln(0), y = te(O, 2), D = y[0], K = y[1], R = Ln(!1), A = te(R, 2), le = A[0], me = A[1], re = function() {
|
|
1368
|
+
me(!0);
|
|
1369
|
+
}, we = function() {
|
|
1370
|
+
me(!1);
|
|
1371
|
+
}, Be = {
|
|
1372
|
+
getKey: _
|
|
1373
|
+
};
|
|
1374
|
+
function xe(P) {
|
|
1375
|
+
pe(function($) {
|
|
1376
|
+
var k;
|
|
1377
|
+
typeof P == "function" ? k = P($) : k = P;
|
|
1378
|
+
var ve = In(k);
|
|
1379
|
+
return J.current.scrollTop = ve, ve;
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
var Ne = he({
|
|
1383
|
+
start: 0,
|
|
1384
|
+
end: ie.length
|
|
1385
|
+
}), de = he(), Ge = Eo(ie, _), Ye = te(Ge, 1), Se = Ye[0];
|
|
1386
|
+
de.current = Se;
|
|
1387
|
+
var $e = o.useMemo(function() {
|
|
1388
|
+
if (!Z)
|
|
1389
|
+
return {
|
|
1390
|
+
scrollHeight: void 0,
|
|
1391
|
+
start: 0,
|
|
1392
|
+
end: ie.length - 1,
|
|
1393
|
+
offset: void 0
|
|
1394
|
+
};
|
|
1395
|
+
if (!x) {
|
|
1396
|
+
var P;
|
|
1397
|
+
return {
|
|
1398
|
+
scrollHeight: ((P = se.current) === null || P === void 0 ? void 0 : P.offsetHeight) || 0,
|
|
1399
|
+
start: 0,
|
|
1400
|
+
end: ie.length - 1,
|
|
1401
|
+
offset: void 0
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
for (var $ = 0, k, ve, Te, xn = ie.length, Sn = 0; Sn < xn; Sn += 1) {
|
|
1405
|
+
var Wn = ie[Sn], Kn = _(Wn), _n = j.get(Kn), Tn = $ + (_n === void 0 ? l : _n);
|
|
1406
|
+
Tn >= ce && k === void 0 && (k = Sn, ve = $), Tn > ce + i && Te === void 0 && (Te = Sn), $ = Tn;
|
|
1407
|
+
}
|
|
1408
|
+
return k === void 0 && (k = 0, ve = 0, Te = Math.ceil(i / l)), Te === void 0 && (Te = ie.length - 1), Te = Math.min(Te + 1, ie.length - 1), {
|
|
1409
|
+
scrollHeight: $,
|
|
1410
|
+
start: k,
|
|
1411
|
+
end: Te,
|
|
1412
|
+
offset: ve
|
|
1413
|
+
};
|
|
1414
|
+
}, [x, Z, ce, ie, ne, i]), ye = $e.scrollHeight, Re = $e.start, Pe = $e.end, en = $e.offset;
|
|
1415
|
+
Ne.current.start = Re, Ne.current.end = Pe, o.useLayoutEffect(function() {
|
|
1416
|
+
var P = j.getRecord();
|
|
1417
|
+
if (P.size === 1) {
|
|
1418
|
+
var $ = Array.from(P)[0], k = _(ie[Re]);
|
|
1419
|
+
if (k === $) {
|
|
1420
|
+
var ve = j.get($), Te = ve - l;
|
|
1421
|
+
xe(function(xn) {
|
|
1422
|
+
return xn + Te;
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
j.resetRecord();
|
|
1427
|
+
}, [ye]);
|
|
1428
|
+
var je = o.useState({
|
|
1429
|
+
width: 0,
|
|
1430
|
+
height: i
|
|
1431
|
+
}), Ae = te(je, 2), Ee = Ae[0], hn = Ae[1], Fe = function($) {
|
|
1432
|
+
hn({
|
|
1433
|
+
width: $.offsetWidth,
|
|
1434
|
+
height: $.offsetHeight
|
|
1435
|
+
});
|
|
1436
|
+
}, _e = he(), De = he(), Nn = o.useMemo(function() {
|
|
1437
|
+
return Pt(Ee.width, m);
|
|
1438
|
+
}, [Ee.width, m]), En = o.useMemo(function() {
|
|
1439
|
+
return Pt(Ee.height, ye);
|
|
1440
|
+
}, [Ee.height, ye]), dn = ye - i, bn = he(dn);
|
|
1441
|
+
bn.current = dn;
|
|
1442
|
+
function In(P) {
|
|
1443
|
+
var $ = P;
|
|
1444
|
+
return Number.isNaN(bn.current) || ($ = Math.min($, bn.current)), $ = Math.max($, 0), $;
|
|
1445
|
+
}
|
|
1446
|
+
var cn = ce <= 0, Qe = ce >= dn, fn = D <= 0, mn = D >= m, Me = Zt(cn, Qe, fn, mn), vn = function() {
|
|
1447
|
+
return {
|
|
1448
|
+
x: M ? -D : D,
|
|
1449
|
+
y: ce
|
|
1450
|
+
};
|
|
1451
|
+
}, an = he(vn()), N = wt(function(P) {
|
|
1452
|
+
if (E) {
|
|
1453
|
+
var $ = ee(ee({}, vn()), P);
|
|
1454
|
+
(an.current.x !== $.x || an.current.y !== $.y) && (E($), an.current = $);
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
function V(P, $) {
|
|
1458
|
+
var k = P;
|
|
1459
|
+
$ ? (Ct.flushSync(function() {
|
|
1460
|
+
K(k);
|
|
1461
|
+
}), N()) : xe(k);
|
|
1462
|
+
}
|
|
1463
|
+
function L(P) {
|
|
1464
|
+
var $ = P.currentTarget.scrollTop;
|
|
1465
|
+
$ !== ce && xe($), h == null || h(P), N();
|
|
1466
|
+
}
|
|
1467
|
+
var H = function($) {
|
|
1468
|
+
var k = $, ve = m ? m - Ee.width : 0;
|
|
1469
|
+
return k = Math.max(k, 0), k = Math.min(k, ve), k;
|
|
1470
|
+
}, oe = wt(function(P, $) {
|
|
1471
|
+
$ ? (Ct.flushSync(function() {
|
|
1472
|
+
K(function(k) {
|
|
1473
|
+
var ve = k + (M ? -P : P);
|
|
1474
|
+
return H(ve);
|
|
1475
|
+
});
|
|
1476
|
+
}), N()) : xe(function(k) {
|
|
1477
|
+
var ve = k + P;
|
|
1478
|
+
return ve;
|
|
1479
|
+
});
|
|
1480
|
+
}), be = Io(Z, cn, Qe, fn, mn, !!m, oe), Ze = te(be, 2), We = Ze[0], nn = Ze[1];
|
|
1481
|
+
$o(Z, J, function(P, $, k, ve) {
|
|
1482
|
+
var Te = ve;
|
|
1483
|
+
return Me(P, $, k) ? !1 : !Te || !Te._virtualHandled ? (Te && (Te._virtualHandled = !0), We({
|
|
1484
|
+
preventDefault: function() {
|
|
1485
|
+
},
|
|
1486
|
+
deltaX: P ? $ : 0,
|
|
1487
|
+
deltaY: P ? 0 : $
|
|
1488
|
+
}), !0) : !1;
|
|
1489
|
+
}), Mo(x, J, function(P) {
|
|
1490
|
+
xe(function($) {
|
|
1491
|
+
return $ + P;
|
|
1492
|
+
});
|
|
1493
|
+
}), $n(function() {
|
|
1494
|
+
function P(k) {
|
|
1495
|
+
var ve = cn && k.detail < 0, Te = Qe && k.detail > 0;
|
|
1496
|
+
Z && !ve && !Te && k.preventDefault();
|
|
1497
|
+
}
|
|
1498
|
+
var $ = J.current;
|
|
1499
|
+
return $.addEventListener("wheel", We, {
|
|
1500
|
+
passive: !1
|
|
1501
|
+
}), $.addEventListener("DOMMouseScroll", nn, {
|
|
1502
|
+
passive: !0
|
|
1503
|
+
}), $.addEventListener("MozMousePixelScroll", P, {
|
|
1504
|
+
passive: !1
|
|
1505
|
+
}), function() {
|
|
1506
|
+
$.removeEventListener("wheel", We), $.removeEventListener("DOMMouseScroll", nn), $.removeEventListener("MozMousePixelScroll", P);
|
|
1507
|
+
};
|
|
1508
|
+
}, [Z, cn, Qe]), $n(function() {
|
|
1509
|
+
if (m) {
|
|
1510
|
+
var P = H(D);
|
|
1511
|
+
K(P), N({
|
|
1512
|
+
x: P
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
}, [Ee.width, m]);
|
|
1516
|
+
var Ie = function() {
|
|
1517
|
+
var $, k;
|
|
1518
|
+
($ = _e.current) === null || $ === void 0 || $.delayHidden(), (k = De.current) === null || k === void 0 || k.delayHidden();
|
|
1519
|
+
}, tn = Do(J, ie, j, l, _, function() {
|
|
1520
|
+
return G(!0);
|
|
1521
|
+
}, xe, Ie);
|
|
1522
|
+
o.useImperativeHandle(n, function() {
|
|
1523
|
+
return {
|
|
1524
|
+
nativeElement: Ce.current,
|
|
1525
|
+
getScrollInfo: vn,
|
|
1526
|
+
scrollTo: function($) {
|
|
1527
|
+
function k(ve) {
|
|
1528
|
+
return ve && pn(ve) === "object" && ("left" in ve || "top" in ve);
|
|
1529
|
+
}
|
|
1530
|
+
k($) ? ($.left !== void 0 && K(H($.left)), tn($.top)) : tn($);
|
|
1531
|
+
}
|
|
1532
|
+
};
|
|
1533
|
+
}), $n(function() {
|
|
1534
|
+
if (C) {
|
|
1535
|
+
var P = ie.slice(Re, Pe + 1);
|
|
1536
|
+
C(P, ie);
|
|
1537
|
+
}
|
|
1538
|
+
}, [Re, Pe, ie]);
|
|
1539
|
+
var Je = xo(ie, _, j, l), Pn = p == null ? void 0 : p({
|
|
1540
|
+
start: Re,
|
|
1541
|
+
end: Pe,
|
|
1542
|
+
virtual: x,
|
|
1543
|
+
offsetX: D,
|
|
1544
|
+
offsetY: en,
|
|
1545
|
+
rtl: M,
|
|
1546
|
+
getSize: Je
|
|
1547
|
+
}), Hn = Co(ie, Re, Pe, m, D, Q, s, Be), rn = null;
|
|
1548
|
+
i && (rn = ee(ae({}, d ? "height" : "maxHeight", i), To), Z && (rn.overflowY = "hidden", m && (rn.overflowX = "hidden"), le && (rn.pointerEvents = "none")));
|
|
1549
|
+
var ke = {};
|
|
1550
|
+
return M && (ke.dir = "rtl"), /* @__PURE__ */ o.createElement("div", on({
|
|
1551
|
+
ref: Ce,
|
|
1552
|
+
style: ee(ee({}, f), {}, {
|
|
1553
|
+
position: "relative"
|
|
1554
|
+
}),
|
|
1555
|
+
className: fe
|
|
1556
|
+
}, ke, q), /* @__PURE__ */ o.createElement(jt, {
|
|
1557
|
+
onResize: Fe
|
|
1558
|
+
}, /* @__PURE__ */ o.createElement(w, {
|
|
1559
|
+
className: "".concat(r, "-holder"),
|
|
1560
|
+
style: rn,
|
|
1561
|
+
ref: J,
|
|
1562
|
+
onScroll: L,
|
|
1563
|
+
onMouseEnter: Ie
|
|
1564
|
+
}, /* @__PURE__ */ o.createElement(Qt, {
|
|
1565
|
+
prefixCls: r,
|
|
1566
|
+
height: ye,
|
|
1567
|
+
offsetX: D,
|
|
1568
|
+
offsetY: en,
|
|
1569
|
+
scrollWidth: m,
|
|
1570
|
+
onInnerResize: G,
|
|
1571
|
+
ref: se,
|
|
1572
|
+
innerProps: T,
|
|
1573
|
+
rtl: M,
|
|
1574
|
+
extra: Pn
|
|
1575
|
+
}, Hn))), x && ye > i && /* @__PURE__ */ o.createElement(tt, {
|
|
1576
|
+
ref: _e,
|
|
1577
|
+
prefixCls: r,
|
|
1578
|
+
scrollOffset: ce,
|
|
1579
|
+
scrollRange: ye,
|
|
1580
|
+
rtl: M,
|
|
1581
|
+
onScroll: V,
|
|
1582
|
+
onStartMove: re,
|
|
1583
|
+
onStopMove: we,
|
|
1584
|
+
spinSize: En,
|
|
1585
|
+
containerSize: Ee.height,
|
|
1586
|
+
style: I == null ? void 0 : I.verticalScrollBar,
|
|
1587
|
+
thumbStyle: I == null ? void 0 : I.verticalScrollBarThumb,
|
|
1588
|
+
showScrollBar: z
|
|
1589
|
+
}), x && m > Ee.width && /* @__PURE__ */ o.createElement(tt, {
|
|
1590
|
+
ref: De,
|
|
1591
|
+
prefixCls: r,
|
|
1592
|
+
scrollOffset: D,
|
|
1593
|
+
scrollRange: m,
|
|
1594
|
+
rtl: M,
|
|
1595
|
+
onScroll: V,
|
|
1596
|
+
onStartMove: re,
|
|
1597
|
+
onStopMove: we,
|
|
1598
|
+
spinSize: Nn,
|
|
1599
|
+
containerSize: Ee.width,
|
|
1600
|
+
horizontal: !0,
|
|
1601
|
+
style: I == null ? void 0 : I.horizontalScrollBar,
|
|
1602
|
+
thumbStyle: I == null ? void 0 : I.horizontalScrollBarThumb,
|
|
1603
|
+
showScrollBar: z
|
|
1604
|
+
}));
|
|
1605
|
+
}
|
|
1606
|
+
var Jt = /* @__PURE__ */ o.forwardRef(Lo);
|
|
1607
|
+
Jt.displayName = "List";
|
|
1608
|
+
function Ho() {
|
|
1609
|
+
return /(mac\sos|macintosh)/i.test(navigator.appVersion);
|
|
1610
|
+
}
|
|
1611
|
+
var Bo = ["disabled", "title", "children", "style", "className"];
|
|
1612
|
+
function _t(e) {
|
|
1613
|
+
return typeof e == "string" || typeof e == "number";
|
|
1614
|
+
}
|
|
1615
|
+
var Vo = function(n, t) {
|
|
1616
|
+
var r = Zr(), a = r.prefixCls, i = r.id, l = r.open, u = r.multiple, d = r.mode, f = r.searchValue, v = r.toggleOpen, s = r.notFoundContent, b = r.onPopupScroll, c = o.useContext(st), g = c.maxCount, m = c.flattenOptions, S = c.onActiveValue, w = c.defaultActiveFirstOption, h = c.onSelect, E = c.menuItemSelectedIcon, C = c.rawValues, T = c.fieldNames, p = c.virtual, I = c.direction, B = c.listHeight, z = c.listItemHeight, q = c.optionRender, _ = "".concat(a, "-item"), F = Ir(function() {
|
|
1617
|
+
return m;
|
|
1618
|
+
}, [l, m], function(O, y) {
|
|
1619
|
+
return y[0] && O[1] !== y[1];
|
|
1620
|
+
}), U = o.useRef(null), Q = o.useMemo(function() {
|
|
1621
|
+
return u && kn(g) && (C == null ? void 0 : C.size) >= g;
|
|
1622
|
+
}, [u, g, C == null ? void 0 : C.size]), G = function(y) {
|
|
1623
|
+
y.preventDefault();
|
|
1624
|
+
}, j = function(y) {
|
|
1625
|
+
var D;
|
|
1626
|
+
(D = U.current) === null || D === void 0 || D.scrollTo(typeof y == "number" ? {
|
|
1627
|
+
index: y
|
|
1628
|
+
} : y);
|
|
1629
|
+
}, ne = o.useCallback(function(O) {
|
|
1630
|
+
return d === "combobox" ? !1 : C.has(O);
|
|
1631
|
+
}, [d, qe(C).toString(), C.size]), Z = function(y) {
|
|
1632
|
+
for (var D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, K = F.length, R = 0; R < K; R += 1) {
|
|
1633
|
+
var A = (y + R * D + K) % K, le = F[A] || {}, me = le.group, re = le.data;
|
|
1634
|
+
if (!me && !(re != null && re.disabled) && (ne(re.value) || !Q))
|
|
1635
|
+
return A;
|
|
1636
|
+
}
|
|
1637
|
+
return -1;
|
|
1638
|
+
}, Y = o.useState(function() {
|
|
1639
|
+
return Z(0);
|
|
1640
|
+
}), x = te(Y, 2), M = x[0], fe = x[1], ie = function(y) {
|
|
1641
|
+
var D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1642
|
+
fe(y);
|
|
1643
|
+
var K = {
|
|
1644
|
+
source: D ? "keyboard" : "mouse"
|
|
1645
|
+
}, R = F[y];
|
|
1646
|
+
if (!R) {
|
|
1647
|
+
S(null, -1, K);
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
S(R.value, y, K);
|
|
1651
|
+
};
|
|
1652
|
+
qn(function() {
|
|
1653
|
+
ie(w !== !1 ? Z(0) : -1);
|
|
1654
|
+
}, [F.length, f]);
|
|
1655
|
+
var J = o.useCallback(function(O) {
|
|
1656
|
+
return d === "combobox" ? String(O).toLowerCase() === f.toLowerCase() : C.has(O);
|
|
1657
|
+
}, [d, f, qe(C).toString(), C.size]);
|
|
1658
|
+
qn(function() {
|
|
1659
|
+
var O = setTimeout(function() {
|
|
1660
|
+
if (!u && l && C.size === 1) {
|
|
1661
|
+
var D = Array.from(C)[0], K = F.findIndex(function(R) {
|
|
1662
|
+
var A = R.data;
|
|
1663
|
+
return A.value === D;
|
|
1664
|
+
});
|
|
1665
|
+
K !== -1 && (ie(K), j(K));
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
if (l) {
|
|
1669
|
+
var y;
|
|
1670
|
+
(y = U.current) === null || y === void 0 || y.scrollTo(void 0);
|
|
1671
|
+
}
|
|
1672
|
+
return function() {
|
|
1673
|
+
return clearTimeout(O);
|
|
1674
|
+
};
|
|
1675
|
+
}, [l, f]);
|
|
1676
|
+
var se = function(y) {
|
|
1677
|
+
y !== void 0 && h(y, {
|
|
1678
|
+
selected: !C.has(y)
|
|
1679
|
+
}), u || v(!1);
|
|
1680
|
+
};
|
|
1681
|
+
if (o.useImperativeHandle(t, function() {
|
|
1682
|
+
return {
|
|
1683
|
+
onKeyDown: function(y) {
|
|
1684
|
+
var D = y.which, K = y.ctrlKey;
|
|
1685
|
+
switch (D) {
|
|
1686
|
+
case W.N:
|
|
1687
|
+
case W.P:
|
|
1688
|
+
case W.UP:
|
|
1689
|
+
case W.DOWN: {
|
|
1690
|
+
var R = 0;
|
|
1691
|
+
if (D === W.UP ? R = -1 : D === W.DOWN ? R = 1 : Ho() && K && (D === W.N ? R = 1 : D === W.P && (R = -1)), R !== 0) {
|
|
1692
|
+
var A = Z(M + R, R);
|
|
1693
|
+
j(A), ie(A, !0);
|
|
1694
|
+
}
|
|
1695
|
+
break;
|
|
1696
|
+
}
|
|
1697
|
+
case W.TAB:
|
|
1698
|
+
case W.ENTER: {
|
|
1699
|
+
var le, me = F[M];
|
|
1700
|
+
me && !(me != null && (le = me.data) !== null && le !== void 0 && le.disabled) && !Q ? se(me.value) : se(void 0), l && y.preventDefault();
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
case W.ESC:
|
|
1704
|
+
v(!1), l && y.stopPropagation();
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
onKeyUp: function() {
|
|
1708
|
+
},
|
|
1709
|
+
scrollTo: function(y) {
|
|
1710
|
+
j(y);
|
|
1711
|
+
}
|
|
1712
|
+
};
|
|
1713
|
+
}), F.length === 0)
|
|
1714
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
1715
|
+
role: "listbox",
|
|
1716
|
+
id: "".concat(i, "_list"),
|
|
1717
|
+
className: "".concat(_, "-empty"),
|
|
1718
|
+
onMouseDown: G
|
|
1719
|
+
}, s);
|
|
1720
|
+
var Ce = Object.keys(T).map(function(O) {
|
|
1721
|
+
return T[O];
|
|
1722
|
+
}), ge = function(y) {
|
|
1723
|
+
return y.label;
|
|
1724
|
+
};
|
|
1725
|
+
function Oe(O, y) {
|
|
1726
|
+
var D = O.group;
|
|
1727
|
+
return {
|
|
1728
|
+
role: D ? "presentation" : "option",
|
|
1729
|
+
id: "".concat(i, "_list_").concat(y)
|
|
1730
|
+
};
|
|
1731
|
+
}
|
|
1732
|
+
var ce = function(y) {
|
|
1733
|
+
var D = F[y];
|
|
1734
|
+
if (!D)
|
|
1735
|
+
return null;
|
|
1736
|
+
var K = D.data || {}, R = K.value, A = D.group, le = An(K, !0), me = ge(D);
|
|
1737
|
+
return D ? /* @__PURE__ */ o.createElement("div", on({
|
|
1738
|
+
"aria-label": typeof me == "string" && !A ? me : null
|
|
1739
|
+
}, le, {
|
|
1740
|
+
key: y
|
|
1741
|
+
}, Oe(D, y), {
|
|
1742
|
+
"aria-selected": J(R)
|
|
1743
|
+
}), R) : null;
|
|
1744
|
+
}, pe = {
|
|
1745
|
+
role: "listbox",
|
|
1746
|
+
id: "".concat(i, "_list")
|
|
1747
|
+
};
|
|
1748
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, p && /* @__PURE__ */ o.createElement("div", on({}, pe, {
|
|
1749
|
+
style: {
|
|
1750
|
+
height: 0,
|
|
1751
|
+
width: 0,
|
|
1752
|
+
overflow: "hidden"
|
|
1753
|
+
}
|
|
1754
|
+
}), ce(M - 1), ce(M), ce(M + 1)), /* @__PURE__ */ o.createElement(Jt, {
|
|
1755
|
+
itemKey: "key",
|
|
1756
|
+
ref: U,
|
|
1757
|
+
data: F,
|
|
1758
|
+
height: B,
|
|
1759
|
+
itemHeight: z,
|
|
1760
|
+
fullHeight: !1,
|
|
1761
|
+
onMouseDown: G,
|
|
1762
|
+
onScroll: b,
|
|
1763
|
+
virtual: p,
|
|
1764
|
+
direction: I,
|
|
1765
|
+
innerProps: p ? null : pe
|
|
1766
|
+
}, function(O, y) {
|
|
1767
|
+
var D = O.group, K = O.groupOption, R = O.data, A = O.label, le = O.value, me = R.key;
|
|
1768
|
+
if (D) {
|
|
1769
|
+
var re, we = (re = R.title) !== null && re !== void 0 ? re : _t(A) ? A.toString() : void 0;
|
|
1770
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
1771
|
+
className: Ve(_, "".concat(_, "-group"), R.className),
|
|
1772
|
+
title: we
|
|
1773
|
+
}, A !== void 0 ? A : me);
|
|
1774
|
+
}
|
|
1775
|
+
var Be = R.disabled, xe = R.title;
|
|
1776
|
+
R.children;
|
|
1777
|
+
var Ne = R.style, de = R.className, Ge = yn(R, Bo), Ye = Ft(Ge, Ce), Se = ne(le), $e = Be || !Se && Q, ye = "".concat(_, "-option"), Re = Ve(_, ye, de, ae(ae(ae(ae({}, "".concat(ye, "-grouped"), K), "".concat(ye, "-active"), M === y && !$e), "".concat(ye, "-disabled"), $e), "".concat(ye, "-selected"), Se)), Pe = ge(O), en = !E || typeof E == "function" || Se, je = typeof Pe == "number" ? Pe : Pe || le, Ae = _t(je) ? je.toString() : void 0;
|
|
1778
|
+
return xe !== void 0 && (Ae = xe), /* @__PURE__ */ o.createElement("div", on({}, An(Ye), p ? {} : Oe(O, y), {
|
|
1779
|
+
"aria-selected": J(le),
|
|
1780
|
+
className: Re,
|
|
1781
|
+
title: Ae,
|
|
1782
|
+
onMouseMove: function() {
|
|
1783
|
+
M === y || $e || ie(y);
|
|
1784
|
+
},
|
|
1785
|
+
onClick: function() {
|
|
1786
|
+
$e || se(le);
|
|
1787
|
+
},
|
|
1788
|
+
style: Ne
|
|
1789
|
+
}), /* @__PURE__ */ o.createElement("div", {
|
|
1790
|
+
className: "".concat(ye, "-content")
|
|
1791
|
+
}, typeof q == "function" ? q(O, {
|
|
1792
|
+
index: y
|
|
1793
|
+
}) : je), /* @__PURE__ */ o.isValidElement(E) || Se, en && /* @__PURE__ */ o.createElement(jn, {
|
|
1794
|
+
className: "".concat(_, "-option-state"),
|
|
1795
|
+
customizeIcon: E,
|
|
1796
|
+
customizeIconProps: {
|
|
1797
|
+
value: le,
|
|
1798
|
+
disabled: $e,
|
|
1799
|
+
isSelected: Se
|
|
1800
|
+
}
|
|
1801
|
+
}, Se ? "✓" : null));
|
|
1802
|
+
}));
|
|
1803
|
+
}, kt = /* @__PURE__ */ o.forwardRef(Vo);
|
|
1804
|
+
process.env.NODE_ENV !== "production" && (kt.displayName = "OptionList");
|
|
1805
|
+
const zo = function(e, n) {
|
|
1806
|
+
var t = o.useRef({
|
|
1807
|
+
values: /* @__PURE__ */ new Map(),
|
|
1808
|
+
options: /* @__PURE__ */ new Map()
|
|
1809
|
+
}), r = o.useMemo(function() {
|
|
1810
|
+
var i = t.current, l = i.values, u = i.options, d = e.map(function(s) {
|
|
1811
|
+
if (s.label === void 0) {
|
|
1812
|
+
var b;
|
|
1813
|
+
return ee(ee({}, s), {}, {
|
|
1814
|
+
label: (b = l.get(s.value)) === null || b === void 0 ? void 0 : b.label
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
return s;
|
|
1818
|
+
}), f = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
1819
|
+
return d.forEach(function(s) {
|
|
1820
|
+
f.set(s.value, s), v.set(s.value, n.get(s.value) || u.get(s.value));
|
|
1821
|
+
}), t.current.values = f, t.current.options = v, d;
|
|
1822
|
+
}, [e, n]), a = o.useCallback(function(i) {
|
|
1823
|
+
return n.get(i) || t.current.options.get(i);
|
|
1824
|
+
}, [n]);
|
|
1825
|
+
return [r, a];
|
|
1826
|
+
};
|
|
1827
|
+
function Un(e, n) {
|
|
1828
|
+
return ct(e).join("").toUpperCase().includes(n);
|
|
1829
|
+
}
|
|
1830
|
+
const Ao = function(e, n, t, r, a) {
|
|
1831
|
+
return o.useMemo(function() {
|
|
1832
|
+
if (!t || r === !1)
|
|
1833
|
+
return e;
|
|
1834
|
+
var i = n.options, l = n.label, u = n.value, d = [], f = typeof r == "function", v = t.toUpperCase(), s = f ? r : function(c, g) {
|
|
1835
|
+
return a ? Un(g[a], v) : g[i] ? Un(g[l !== "children" ? l : "label"], v) : Un(g[u], v);
|
|
1836
|
+
}, b = f ? function(c) {
|
|
1837
|
+
return et(c);
|
|
1838
|
+
} : function(c) {
|
|
1839
|
+
return c;
|
|
1840
|
+
};
|
|
1841
|
+
return e.forEach(function(c) {
|
|
1842
|
+
if (c[i]) {
|
|
1843
|
+
var g = s(t, b(c));
|
|
1844
|
+
if (g)
|
|
1845
|
+
d.push(c);
|
|
1846
|
+
else {
|
|
1847
|
+
var m = c[i].filter(function(S) {
|
|
1848
|
+
return s(t, b(S));
|
|
1849
|
+
});
|
|
1850
|
+
m.length && d.push(ee(ee({}, c), {}, ae({}, i, m)));
|
|
1851
|
+
}
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
s(t, b(c)) && d.push(c);
|
|
1855
|
+
}), d;
|
|
1856
|
+
}, [e, r, a, t, n]);
|
|
1857
|
+
};
|
|
1858
|
+
var Tt = 0, Fo = process.env.NODE_ENV !== "test" && hr();
|
|
1859
|
+
function jo() {
|
|
1860
|
+
var e;
|
|
1861
|
+
return Fo ? (e = Tt, Tt += 1) : e = "TEST_OR_SSR", e;
|
|
1862
|
+
}
|
|
1863
|
+
function Wo(e) {
|
|
1864
|
+
var n = o.useState(), t = te(n, 2), r = t[0], a = t[1];
|
|
1865
|
+
return o.useEffect(function() {
|
|
1866
|
+
a("rc_select_".concat(jo()));
|
|
1867
|
+
}, []), e || r;
|
|
1868
|
+
}
|
|
1869
|
+
var Ko = ["children", "value"], Xo = ["children"];
|
|
1870
|
+
function Uo(e) {
|
|
1871
|
+
var n = e, t = n.key, r = n.props, a = r.children, i = r.value, l = yn(r, Ko);
|
|
1872
|
+
return ee({
|
|
1873
|
+
key: t,
|
|
1874
|
+
value: i !== void 0 ? i : t,
|
|
1875
|
+
children: a
|
|
1876
|
+
}, l);
|
|
1877
|
+
}
|
|
1878
|
+
function mt(e) {
|
|
1879
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1880
|
+
return Jn(e).map(function(t, r) {
|
|
1881
|
+
if (!/* @__PURE__ */ o.isValidElement(t) || !t.type)
|
|
1882
|
+
return null;
|
|
1883
|
+
var a = t, i = a.type.isSelectOptGroup, l = a.key, u = a.props, d = u.children, f = yn(u, Xo);
|
|
1884
|
+
return n || !i ? Uo(t) : ee(ee({
|
|
1885
|
+
key: "__RC_SELECT_GRP__".concat(l === null ? r : l, "__"),
|
|
1886
|
+
label: l
|
|
1887
|
+
}, f), {}, {
|
|
1888
|
+
options: mt(d)
|
|
1889
|
+
});
|
|
1890
|
+
}).filter(function(t) {
|
|
1891
|
+
return t;
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
var Go = function(n, t, r, a, i) {
|
|
1895
|
+
return o.useMemo(function() {
|
|
1896
|
+
var l = n, u = !n;
|
|
1897
|
+
u && (l = mt(t));
|
|
1898
|
+
var d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), v = function(c, g, m) {
|
|
1899
|
+
m && typeof m == "string" && c.set(g[m], g);
|
|
1900
|
+
}, s = function b(c) {
|
|
1901
|
+
for (var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, m = 0; m < c.length; m += 1) {
|
|
1902
|
+
var S = c[m];
|
|
1903
|
+
!S[r.options] || g ? (d.set(S[r.value], S), v(f, S, r.label), v(f, S, a), v(f, S, i)) : b(S[r.options], !0);
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
return s(l), {
|
|
1907
|
+
options: l,
|
|
1908
|
+
valueOptions: d,
|
|
1909
|
+
labelOptions: f
|
|
1910
|
+
};
|
|
1911
|
+
}, [n, t, r, a, i]);
|
|
1912
|
+
};
|
|
1913
|
+
function Lt(e) {
|
|
1914
|
+
var n = o.useRef();
|
|
1915
|
+
n.current = e;
|
|
1916
|
+
var t = o.useCallback(function() {
|
|
1917
|
+
return n.current.apply(n, arguments);
|
|
1918
|
+
}, []);
|
|
1919
|
+
return t;
|
|
1920
|
+
}
|
|
1921
|
+
function Yo(e) {
|
|
1922
|
+
var n = e.mode, t = e.options, r = e.children, a = e.backfill, i = e.allowClear, l = e.placeholder, u = e.getInputElement, d = e.showSearch, f = e.onSearch, v = e.defaultOpen, s = e.autoFocus, b = e.labelInValue, c = e.value, g = e.inputValue, m = e.optionLabelProp, S = Fn(n), w = d !== void 0 ? d : S || n === "combobox", h = t || mt(r);
|
|
1923
|
+
if (Ue(n !== "tags" || h.every(function(p) {
|
|
1924
|
+
return !p.disabled;
|
|
1925
|
+
}), "Please avoid setting option to disabled in tags mode since user can always type text as tag."), n === "tags" || n === "combobox") {
|
|
1926
|
+
var E = h.some(function(p) {
|
|
1927
|
+
return p.options ? p.options.some(function(I) {
|
|
1928
|
+
return typeof ("value" in I ? I.value : I.key) == "number";
|
|
1929
|
+
}) : typeof ("value" in p ? p.value : p.key) == "number";
|
|
1930
|
+
});
|
|
1931
|
+
Ue(!E, "`value` of Option should not use number type when `mode` is `tags` or `combobox`.");
|
|
1932
|
+
}
|
|
1933
|
+
if (Ue(n !== "combobox" || !m, "`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."), Ue(n === "combobox" || !a, "`backfill` only works with `combobox` mode."), Ue(n === "combobox" || !u, "`getInputElement` only work with `combobox` mode."), St(n !== "combobox" || !u || !i || !l, "Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."), f && !w && n !== "combobox" && n !== "tags" && Ue(!1, "`onSearch` should work with `showSearch` instead of use alone."), St(!v || s, "`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."), c != null) {
|
|
1934
|
+
var C = ct(c);
|
|
1935
|
+
Ue(!b || C.every(function(p) {
|
|
1936
|
+
return pn(p) === "object" && ("key" in p || "value" in p);
|
|
1937
|
+
}), "`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"), Ue(!S || Array.isArray(c), "`value` should be array when `mode` is `multiple` or `tags`");
|
|
1938
|
+
}
|
|
1939
|
+
if (r) {
|
|
1940
|
+
var T = null;
|
|
1941
|
+
Jn(r).some(function(p) {
|
|
1942
|
+
if (!/* @__PURE__ */ o.isValidElement(p) || !p.type)
|
|
1943
|
+
return !1;
|
|
1944
|
+
var I = p, B = I.type;
|
|
1945
|
+
if (B.isSelectOption)
|
|
1946
|
+
return !1;
|
|
1947
|
+
if (B.isSelectOptGroup) {
|
|
1948
|
+
var z = Jn(p.props.children).every(function(q) {
|
|
1949
|
+
return !/* @__PURE__ */ o.isValidElement(q) || !p.type || q.type.isSelectOption ? !0 : (T = q.type, !1);
|
|
1950
|
+
});
|
|
1951
|
+
return !z;
|
|
1952
|
+
}
|
|
1953
|
+
return T = B, !0;
|
|
1954
|
+
}), T && Ue(!1, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(T.displayName || T.name || T, "`.")), Ue(g === void 0, "`inputValue` is deprecated, please use `searchValue` instead.");
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
function qo(e, n) {
|
|
1958
|
+
if (e) {
|
|
1959
|
+
var t = function r(a) {
|
|
1960
|
+
for (var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, l = 0; l < a.length; l++) {
|
|
1961
|
+
var u = a[l];
|
|
1962
|
+
if (u[n == null ? void 0 : n.value] === null)
|
|
1963
|
+
return Ue(!1, "`value` in Select options should not be `null`."), !0;
|
|
1964
|
+
if (!i && Array.isArray(u[n == null ? void 0 : n.options]) && r(u[n == null ? void 0 : n.options], !0))
|
|
1965
|
+
break;
|
|
1966
|
+
}
|
|
1967
|
+
};
|
|
1968
|
+
t(e);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
var Qo = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "optionRender", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "direction", "listHeight", "listItemHeight", "labelRender", "value", "defaultValue", "labelInValue", "onChange", "maxCount"], Zo = ["inputValue"];
|
|
1972
|
+
function Jo(e) {
|
|
1973
|
+
return !e || pn(e) !== "object";
|
|
1974
|
+
}
|
|
1975
|
+
var er = /* @__PURE__ */ o.forwardRef(function(e, n) {
|
|
1976
|
+
var t = e.id, r = e.mode, a = e.prefixCls, i = a === void 0 ? "rc-select" : a, l = e.backfill, u = e.fieldNames, d = e.inputValue, f = e.searchValue, v = e.onSearch, s = e.autoClearSearchValue, b = s === void 0 ? !0 : s, c = e.onSelect, g = e.onDeselect, m = e.dropdownMatchSelectWidth, S = m === void 0 ? !0 : m, w = e.filterOption, h = e.filterSort, E = e.optionFilterProp, C = e.optionLabelProp, T = e.options, p = e.optionRender, I = e.children, B = e.defaultActiveFirstOption, z = e.menuItemSelectedIcon, q = e.virtual, _ = e.direction, F = e.listHeight, U = F === void 0 ? 200 : F, Q = e.listItemHeight, G = Q === void 0 ? 20 : Q, j = e.labelRender, ne = e.value, Z = e.defaultValue, Y = e.labelInValue, x = e.onChange, M = e.maxCount, fe = yn(e, Qo), ie = Wo(t), J = Fn(r), se = !!(!T && I), Ce = o.useMemo(function() {
|
|
1977
|
+
return w === void 0 && r === "combobox" ? !1 : w;
|
|
1978
|
+
}, [w, r]), ge = o.useMemo(
|
|
1979
|
+
function() {
|
|
1980
|
+
return Yt(u, se);
|
|
1981
|
+
},
|
|
1982
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
1983
|
+
[
|
|
1984
|
+
// We stringify fieldNames to avoid unnecessary re-renders.
|
|
1985
|
+
JSON.stringify(u),
|
|
1986
|
+
se
|
|
1987
|
+
]
|
|
1988
|
+
/* eslint-enable react-hooks/exhaustive-deps */
|
|
1989
|
+
), Oe = Zn("", {
|
|
1990
|
+
value: f !== void 0 ? f : d,
|
|
1991
|
+
postState: function(V) {
|
|
1992
|
+
return V || "";
|
|
1993
|
+
}
|
|
1994
|
+
}), ce = te(Oe, 2), pe = ce[0], O = ce[1], y = Go(T, I, ge, E, C), D = y.valueOptions, K = y.labelOptions, R = y.options, A = o.useCallback(function(N) {
|
|
1995
|
+
var V = ct(N);
|
|
1996
|
+
return V.map(function(L) {
|
|
1997
|
+
var H, oe, be, Ze, We;
|
|
1998
|
+
if (Jo(L))
|
|
1999
|
+
H = L;
|
|
2000
|
+
else {
|
|
2001
|
+
var nn;
|
|
2002
|
+
be = L.key, oe = L.label, H = (nn = L.value) !== null && nn !== void 0 ? nn : be;
|
|
2003
|
+
}
|
|
2004
|
+
var Ie = D.get(H);
|
|
2005
|
+
if (Ie) {
|
|
2006
|
+
var tn;
|
|
2007
|
+
if (oe === void 0 && (oe = Ie == null ? void 0 : Ie[C || ge.label]), be === void 0 && (be = (tn = Ie == null ? void 0 : Ie.key) !== null && tn !== void 0 ? tn : H), Ze = Ie == null ? void 0 : Ie.disabled, We = Ie == null ? void 0 : Ie.title, process.env.NODE_ENV !== "production" && !C) {
|
|
2008
|
+
var Je = Ie == null ? void 0 : Ie[ge.label];
|
|
2009
|
+
Je !== void 0 && !/* @__PURE__ */ o.isValidElement(Je) && !/* @__PURE__ */ o.isValidElement(oe) && Je !== oe && Ue(!1, "`label` of `value` is not same as `label` in Select options.");
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
return {
|
|
2013
|
+
label: oe,
|
|
2014
|
+
value: H,
|
|
2015
|
+
key: be,
|
|
2016
|
+
disabled: Ze,
|
|
2017
|
+
title: We
|
|
2018
|
+
};
|
|
2019
|
+
});
|
|
2020
|
+
}, [ge, C, D]), le = Zn(Z, {
|
|
2021
|
+
value: ne
|
|
2022
|
+
}), me = te(le, 2), re = me[0], we = me[1], Be = o.useMemo(function() {
|
|
2023
|
+
var N, V = J && re === null ? [] : re, L = A(V);
|
|
2024
|
+
return r === "combobox" && ao((N = L[0]) === null || N === void 0 ? void 0 : N.value) ? [] : L;
|
|
2025
|
+
}, [re, A, r, J]), xe = zo(Be, D), Ne = te(xe, 2), de = Ne[0], Ge = Ne[1], Ye = o.useMemo(function() {
|
|
2026
|
+
if (!r && de.length === 1) {
|
|
2027
|
+
var N = de[0];
|
|
2028
|
+
if (N.value === null && (N.label === null || N.label === void 0))
|
|
2029
|
+
return [];
|
|
2030
|
+
}
|
|
2031
|
+
return de.map(function(V) {
|
|
2032
|
+
var L;
|
|
2033
|
+
return ee(ee({}, V), {}, {
|
|
2034
|
+
label: (L = typeof j == "function" ? j(V) : V.label) !== null && L !== void 0 ? L : V.value
|
|
2035
|
+
});
|
|
2036
|
+
});
|
|
2037
|
+
}, [r, de, j]), Se = o.useMemo(function() {
|
|
2038
|
+
return new Set(de.map(function(N) {
|
|
2039
|
+
return N.value;
|
|
2040
|
+
}));
|
|
2041
|
+
}, [de]);
|
|
2042
|
+
o.useEffect(function() {
|
|
2043
|
+
if (r === "combobox") {
|
|
2044
|
+
var N, V = (N = de[0]) === null || N === void 0 ? void 0 : N.value;
|
|
2045
|
+
O(oo(V) ? String(V) : "");
|
|
2046
|
+
}
|
|
2047
|
+
}, [de]);
|
|
2048
|
+
var $e = Lt(function(N, V) {
|
|
2049
|
+
var L = V ?? N;
|
|
2050
|
+
return ae(ae({}, ge.value, N), ge.label, L);
|
|
2051
|
+
}), ye = o.useMemo(function() {
|
|
2052
|
+
if (r !== "tags")
|
|
2053
|
+
return R;
|
|
2054
|
+
var N = qe(R), V = function(H) {
|
|
2055
|
+
return D.has(H);
|
|
2056
|
+
};
|
|
2057
|
+
return qe(de).sort(function(L, H) {
|
|
2058
|
+
return L.value < H.value ? -1 : 1;
|
|
2059
|
+
}).forEach(function(L) {
|
|
2060
|
+
var H = L.value;
|
|
2061
|
+
V(H) || N.push($e(H, L.label));
|
|
2062
|
+
}), N;
|
|
2063
|
+
}, [$e, R, D, de, r]), Re = Ao(ye, ge, pe, Ce, E), Pe = o.useMemo(function() {
|
|
2064
|
+
return r !== "tags" || !pe || Re.some(function(N) {
|
|
2065
|
+
return N[E || "value"] === pe;
|
|
2066
|
+
}) || Re.some(function(N) {
|
|
2067
|
+
return N[ge.value] === pe;
|
|
2068
|
+
}) ? Re : [$e(pe)].concat(qe(Re));
|
|
2069
|
+
}, [$e, E, r, Re, pe, ge]), en = function N(V) {
|
|
2070
|
+
var L = qe(V).sort(function(H, oe) {
|
|
2071
|
+
return h(H, oe, {
|
|
2072
|
+
searchValue: pe
|
|
2073
|
+
});
|
|
2074
|
+
});
|
|
2075
|
+
return L.map(function(H) {
|
|
2076
|
+
return Array.isArray(H.options) ? ee(ee({}, H), {}, {
|
|
2077
|
+
options: H.options.length > 0 ? N(H.options) : H.options
|
|
2078
|
+
}) : H;
|
|
2079
|
+
});
|
|
2080
|
+
}, je = o.useMemo(function() {
|
|
2081
|
+
return h ? en(Pe) : Pe;
|
|
2082
|
+
}, [Pe, h, pe]), Ae = o.useMemo(function() {
|
|
2083
|
+
return go(je, {
|
|
2084
|
+
fieldNames: ge,
|
|
2085
|
+
childrenAsData: se
|
|
2086
|
+
});
|
|
2087
|
+
}, [je, ge, se]), Ee = function(V) {
|
|
2088
|
+
var L = A(V);
|
|
2089
|
+
if (we(L), x && // Trigger event only when value changed
|
|
2090
|
+
(L.length !== de.length || L.some(function(be, Ze) {
|
|
2091
|
+
var We;
|
|
2092
|
+
return ((We = de[Ze]) === null || We === void 0 ? void 0 : We.value) !== (be == null ? void 0 : be.value);
|
|
2093
|
+
}))) {
|
|
2094
|
+
var H = Y ? L : L.map(function(be) {
|
|
2095
|
+
return be.value;
|
|
2096
|
+
}), oe = L.map(function(be) {
|
|
2097
|
+
return et(Ge(be.value));
|
|
2098
|
+
});
|
|
2099
|
+
x(
|
|
2100
|
+
// Value
|
|
2101
|
+
J ? H : H[0],
|
|
2102
|
+
// Option
|
|
2103
|
+
J ? oe : oe[0]
|
|
2104
|
+
);
|
|
2105
|
+
}
|
|
2106
|
+
}, hn = o.useState(null), Fe = te(hn, 2), _e = Fe[0], De = Fe[1], Nn = o.useState(0), En = te(Nn, 2), dn = En[0], bn = En[1], In = B !== void 0 ? B : r !== "combobox", cn = o.useCallback(function(N, V) {
|
|
2107
|
+
var L = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, H = L.source, oe = H === void 0 ? "keyboard" : H;
|
|
2108
|
+
bn(V), l && r === "combobox" && N !== null && oe === "keyboard" && De(String(N));
|
|
2109
|
+
}, [l, r]), Qe = function(V, L, H) {
|
|
2110
|
+
var oe = function() {
|
|
2111
|
+
var rn, ke = Ge(V);
|
|
2112
|
+
return [Y ? {
|
|
2113
|
+
label: ke == null ? void 0 : ke[ge.label],
|
|
2114
|
+
value: V,
|
|
2115
|
+
key: (rn = ke == null ? void 0 : ke.key) !== null && rn !== void 0 ? rn : V
|
|
2116
|
+
} : V, et(ke)];
|
|
2117
|
+
};
|
|
2118
|
+
if (L && c) {
|
|
2119
|
+
var be = oe(), Ze = te(be, 2), We = Ze[0], nn = Ze[1];
|
|
2120
|
+
c(We, nn);
|
|
2121
|
+
} else if (!L && g && H !== "clear") {
|
|
2122
|
+
var Ie = oe(), tn = te(Ie, 2), Je = tn[0], Pn = tn[1];
|
|
2123
|
+
g(Je, Pn);
|
|
2124
|
+
}
|
|
2125
|
+
}, fn = Lt(function(N, V) {
|
|
2126
|
+
var L, H = J ? V.selected : !0;
|
|
2127
|
+
H ? L = J ? [].concat(qe(de), [N]) : [N] : L = de.filter(function(oe) {
|
|
2128
|
+
return oe.value !== N;
|
|
2129
|
+
}), Ee(L), Qe(N, H), r === "combobox" ? De("") : (!Fn || b) && (O(""), De(""));
|
|
2130
|
+
}), mn = function(V, L) {
|
|
2131
|
+
Ee(V);
|
|
2132
|
+
var H = L.type, oe = L.values;
|
|
2133
|
+
(H === "remove" || H === "clear") && oe.forEach(function(be) {
|
|
2134
|
+
Qe(be.value, !1, H);
|
|
2135
|
+
});
|
|
2136
|
+
}, Me = function(V, L) {
|
|
2137
|
+
if (O(V), De(null), L.source === "submit") {
|
|
2138
|
+
var H = (V || "").trim();
|
|
2139
|
+
if (H) {
|
|
2140
|
+
var oe = Array.from(new Set([].concat(qe(Se), [H])));
|
|
2141
|
+
Ee(oe), Qe(H, !0), O("");
|
|
2142
|
+
}
|
|
2143
|
+
return;
|
|
2144
|
+
}
|
|
2145
|
+
L.source !== "blur" && (r === "combobox" && Ee(V), v == null || v(V));
|
|
2146
|
+
}, vn = function(V) {
|
|
2147
|
+
var L = V;
|
|
2148
|
+
r !== "tags" && (L = V.map(function(oe) {
|
|
2149
|
+
var be = K.get(oe);
|
|
2150
|
+
return be == null ? void 0 : be.value;
|
|
2151
|
+
}).filter(function(oe) {
|
|
2152
|
+
return oe !== void 0;
|
|
2153
|
+
}));
|
|
2154
|
+
var H = Array.from(new Set([].concat(qe(Se), qe(L))));
|
|
2155
|
+
Ee(H), H.forEach(function(oe) {
|
|
2156
|
+
Qe(oe, !0);
|
|
2157
|
+
});
|
|
2158
|
+
}, an = o.useMemo(function() {
|
|
2159
|
+
var N = q !== !1 && S !== !1;
|
|
2160
|
+
return ee(ee({}, y), {}, {
|
|
2161
|
+
flattenOptions: Ae,
|
|
2162
|
+
onActiveValue: cn,
|
|
2163
|
+
defaultActiveFirstOption: In,
|
|
2164
|
+
onSelect: fn,
|
|
2165
|
+
menuItemSelectedIcon: z,
|
|
2166
|
+
rawValues: Se,
|
|
2167
|
+
fieldNames: ge,
|
|
2168
|
+
virtual: N,
|
|
2169
|
+
direction: _,
|
|
2170
|
+
listHeight: U,
|
|
2171
|
+
listItemHeight: G,
|
|
2172
|
+
childrenAsData: se,
|
|
2173
|
+
maxCount: M,
|
|
2174
|
+
optionRender: p
|
|
2175
|
+
});
|
|
2176
|
+
}, [M, y, Ae, cn, In, fn, z, Se, ge, q, S, _, U, G, se, p]);
|
|
2177
|
+
return process.env.NODE_ENV !== "production" && (Yo(e), qo(R, ge)), /* @__PURE__ */ o.createElement(st.Provider, {
|
|
2178
|
+
value: an
|
|
2179
|
+
}, /* @__PURE__ */ o.createElement(qt, on({}, fe, {
|
|
2180
|
+
// >>> MISC
|
|
2181
|
+
id: ie,
|
|
2182
|
+
prefixCls: i,
|
|
2183
|
+
ref: n,
|
|
2184
|
+
omitDomProps: Zo,
|
|
2185
|
+
mode: r,
|
|
2186
|
+
displayValues: Ye,
|
|
2187
|
+
onDisplayValuesChange: mn,
|
|
2188
|
+
direction: _,
|
|
2189
|
+
searchValue: pe,
|
|
2190
|
+
onSearch: Me,
|
|
2191
|
+
autoClearSearchValue: b,
|
|
2192
|
+
onSearchSplit: vn,
|
|
2193
|
+
dropdownMatchSelectWidth: S,
|
|
2194
|
+
OptionList: kt,
|
|
2195
|
+
emptyOptions: !Ae.length,
|
|
2196
|
+
activeValue: _e,
|
|
2197
|
+
activeDescendantId: "".concat(ie, "_list_").concat(dn)
|
|
2198
|
+
})));
|
|
2199
|
+
});
|
|
2200
|
+
process.env.NODE_ENV !== "production" && (er.displayName = "Select");
|
|
2201
|
+
var vt = er;
|
|
2202
|
+
vt.Option = ft;
|
|
2203
|
+
vt.OptGroup = dt;
|
|
2204
|
+
const nr = () => {
|
|
2205
|
+
const [, e] = rt(), [n] = lt("Empty"), r = new zn(e.colorBgBase).toHsl().l < 0.5 ? {
|
|
2206
|
+
opacity: 0.65
|
|
2207
|
+
} : {};
|
|
2208
|
+
return /* @__PURE__ */ o.createElement("svg", {
|
|
2209
|
+
style: r,
|
|
2210
|
+
width: "184",
|
|
2211
|
+
height: "152",
|
|
2212
|
+
viewBox: "0 0 184 152",
|
|
2213
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2214
|
+
}, /* @__PURE__ */ o.createElement("title", null, (n == null ? void 0 : n.description) || "Empty"), /* @__PURE__ */ o.createElement("g", {
|
|
2215
|
+
fill: "none",
|
|
2216
|
+
fillRule: "evenodd"
|
|
2217
|
+
}, /* @__PURE__ */ o.createElement("g", {
|
|
2218
|
+
transform: "translate(24 31.67)"
|
|
2219
|
+
}, /* @__PURE__ */ o.createElement("ellipse", {
|
|
2220
|
+
fillOpacity: ".8",
|
|
2221
|
+
fill: "#F5F5F7",
|
|
2222
|
+
cx: "67.797",
|
|
2223
|
+
cy: "106.89",
|
|
2224
|
+
rx: "67.797",
|
|
2225
|
+
ry: "12.668"
|
|
2226
|
+
}), /* @__PURE__ */ o.createElement("path", {
|
|
2227
|
+
d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
|
|
2228
|
+
fill: "#AEB8C2"
|
|
2229
|
+
}), /* @__PURE__ */ o.createElement("path", {
|
|
2230
|
+
d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
|
|
2231
|
+
fill: "url(#linearGradient-1)",
|
|
2232
|
+
transform: "translate(13.56)"
|
|
2233
|
+
}), /* @__PURE__ */ o.createElement("path", {
|
|
2234
|
+
d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
|
|
2235
|
+
fill: "#F5F5F7"
|
|
2236
|
+
}), /* @__PURE__ */ o.createElement("path", {
|
|
2237
|
+
d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
|
|
2238
|
+
fill: "#DCE0E6"
|
|
2239
|
+
})), /* @__PURE__ */ o.createElement("path", {
|
|
2240
|
+
d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
|
|
2241
|
+
fill: "#DCE0E6"
|
|
2242
|
+
}), /* @__PURE__ */ o.createElement("g", {
|
|
2243
|
+
transform: "translate(149.65 15.383)",
|
|
2244
|
+
fill: "#FFF"
|
|
2245
|
+
}, /* @__PURE__ */ o.createElement("ellipse", {
|
|
2246
|
+
cx: "20.654",
|
|
2247
|
+
cy: "3.167",
|
|
2248
|
+
rx: "2.849",
|
|
2249
|
+
ry: "2.815"
|
|
2250
|
+
}), /* @__PURE__ */ o.createElement("path", {
|
|
2251
|
+
d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
|
|
2252
|
+
}))));
|
|
2253
|
+
};
|
|
2254
|
+
process.env.NODE_ENV !== "production" && (nr.displayName = "EmptyImage");
|
|
2255
|
+
const tr = () => {
|
|
2256
|
+
const [, e] = rt(), [n] = lt("Empty"), {
|
|
2257
|
+
colorFill: t,
|
|
2258
|
+
colorFillTertiary: r,
|
|
2259
|
+
colorFillQuaternary: a,
|
|
2260
|
+
colorBgContainer: i
|
|
2261
|
+
} = e, {
|
|
2262
|
+
borderColor: l,
|
|
2263
|
+
shadowColor: u,
|
|
2264
|
+
contentColor: d
|
|
2265
|
+
} = vr(() => ({
|
|
2266
|
+
borderColor: new zn(t).onBackground(i).toHexString(),
|
|
2267
|
+
shadowColor: new zn(r).onBackground(i).toHexString(),
|
|
2268
|
+
contentColor: new zn(a).onBackground(i).toHexString()
|
|
2269
|
+
}), [t, r, a, i]);
|
|
2270
|
+
return /* @__PURE__ */ o.createElement("svg", {
|
|
2271
|
+
width: "64",
|
|
2272
|
+
height: "41",
|
|
2273
|
+
viewBox: "0 0 64 41",
|
|
2274
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2275
|
+
}, /* @__PURE__ */ o.createElement("title", null, (n == null ? void 0 : n.description) || "Empty"), /* @__PURE__ */ o.createElement("g", {
|
|
2276
|
+
transform: "translate(0 1)",
|
|
2277
|
+
fill: "none",
|
|
2278
|
+
fillRule: "evenodd"
|
|
2279
|
+
}, /* @__PURE__ */ o.createElement("ellipse", {
|
|
2280
|
+
fill: u,
|
|
2281
|
+
cx: "32",
|
|
2282
|
+
cy: "33",
|
|
2283
|
+
rx: "32",
|
|
2284
|
+
ry: "7"
|
|
2285
|
+
}), /* @__PURE__ */ o.createElement("g", {
|
|
2286
|
+
fillRule: "nonzero",
|
|
2287
|
+
stroke: l
|
|
2288
|
+
}, /* @__PURE__ */ o.createElement("path", {
|
|
2289
|
+
d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
|
|
2290
|
+
}), /* @__PURE__ */ o.createElement("path", {
|
|
2291
|
+
d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
|
|
2292
|
+
fill: d
|
|
2293
|
+
}))));
|
|
2294
|
+
};
|
|
2295
|
+
process.env.NODE_ENV !== "production" && (tr.displayName = "SimpleImage");
|
|
2296
|
+
const ko = (e) => {
|
|
2297
|
+
const {
|
|
2298
|
+
componentCls: n,
|
|
2299
|
+
margin: t,
|
|
2300
|
+
marginXS: r,
|
|
2301
|
+
marginXL: a,
|
|
2302
|
+
fontSize: i,
|
|
2303
|
+
lineHeight: l
|
|
2304
|
+
} = e;
|
|
2305
|
+
return {
|
|
2306
|
+
[n]: {
|
|
2307
|
+
marginInline: r,
|
|
2308
|
+
fontSize: i,
|
|
2309
|
+
lineHeight: l,
|
|
2310
|
+
textAlign: "center",
|
|
2311
|
+
// 原来 &-image 没有父子结构,现在为了外层承担我们的 hashId,改成父子结构
|
|
2312
|
+
[`${n}-image`]: {
|
|
2313
|
+
height: e.emptyImgHeight,
|
|
2314
|
+
marginBottom: r,
|
|
2315
|
+
opacity: e.opacityImage,
|
|
2316
|
+
img: {
|
|
2317
|
+
height: "100%"
|
|
2318
|
+
},
|
|
2319
|
+
svg: {
|
|
2320
|
+
maxWidth: "100%",
|
|
2321
|
+
height: "100%",
|
|
2322
|
+
margin: "auto"
|
|
2323
|
+
}
|
|
2324
|
+
},
|
|
2325
|
+
[`${n}-description`]: {
|
|
2326
|
+
color: e.colorTextDescription
|
|
2327
|
+
},
|
|
2328
|
+
// 原来 &-footer 没有父子结构,现在为了外层承担我们的 hashId,改成父子结构
|
|
2329
|
+
[`${n}-footer`]: {
|
|
2330
|
+
marginTop: t
|
|
2331
|
+
},
|
|
2332
|
+
"&-normal": {
|
|
2333
|
+
marginBlock: a,
|
|
2334
|
+
color: e.colorTextDescription,
|
|
2335
|
+
[`${n}-description`]: {
|
|
2336
|
+
color: e.colorTextDescription
|
|
2337
|
+
},
|
|
2338
|
+
[`${n}-image`]: {
|
|
2339
|
+
height: e.emptyImgHeightMD
|
|
2340
|
+
}
|
|
2341
|
+
},
|
|
2342
|
+
"&-small": {
|
|
2343
|
+
marginBlock: r,
|
|
2344
|
+
color: e.colorTextDescription,
|
|
2345
|
+
[`${n}-image`]: {
|
|
2346
|
+
height: e.emptyImgHeightSM
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
};
|
|
2351
|
+
}, ea = zt("Empty", (e) => {
|
|
2352
|
+
const {
|
|
2353
|
+
componentCls: n,
|
|
2354
|
+
controlHeightLG: t,
|
|
2355
|
+
calc: r
|
|
2356
|
+
} = e, a = Mn(e, {
|
|
2357
|
+
emptyImgCls: `${n}-img`,
|
|
2358
|
+
emptyImgHeight: r(t).mul(2.5).equal(),
|
|
2359
|
+
emptyImgHeightMD: t,
|
|
2360
|
+
emptyImgHeightSM: r(t).mul(0.875).equal()
|
|
2361
|
+
});
|
|
2362
|
+
return [ko(a)];
|
|
2363
|
+
});
|
|
2364
|
+
var na = function(e, n) {
|
|
2365
|
+
var t = {};
|
|
2366
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
2367
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
|
|
2368
|
+
n.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (t[r[a]] = e[r[a]]);
|
|
2369
|
+
return t;
|
|
2370
|
+
};
|
|
2371
|
+
const rr = /* @__PURE__ */ o.createElement(nr, null), or = /* @__PURE__ */ o.createElement(tr, null), gn = (e) => {
|
|
2372
|
+
var n, t, r, a, i, l, u, d;
|
|
2373
|
+
const {
|
|
2374
|
+
className: f,
|
|
2375
|
+
rootClassName: v,
|
|
2376
|
+
prefixCls: s,
|
|
2377
|
+
image: b = rr,
|
|
2378
|
+
description: c,
|
|
2379
|
+
children: g,
|
|
2380
|
+
imageStyle: m,
|
|
2381
|
+
style: S,
|
|
2382
|
+
classNames: w,
|
|
2383
|
+
styles: h
|
|
2384
|
+
} = e, E = na(e, ["className", "rootClassName", "prefixCls", "image", "description", "children", "imageStyle", "style", "classNames", "styles"]), {
|
|
2385
|
+
getPrefixCls: C,
|
|
2386
|
+
direction: T,
|
|
2387
|
+
empty: p
|
|
2388
|
+
} = o.useContext(ot), I = C("empty", s), [B, z, q] = ea(I), [_] = lt("Empty"), F = typeof c < "u" ? c : _ == null ? void 0 : _.description, U = typeof F == "string" ? F : "empty";
|
|
2389
|
+
let Q = null;
|
|
2390
|
+
if (typeof b == "string" ? Q = /* @__PURE__ */ o.createElement("img", {
|
|
2391
|
+
alt: U,
|
|
2392
|
+
src: b
|
|
2393
|
+
}) : Q = b, process.env.NODE_ENV !== "production") {
|
|
2394
|
+
const G = at("Empty");
|
|
2395
|
+
[["imageStyle", "styles: { image: {} }"]].forEach((j) => {
|
|
2396
|
+
let [ne, Z] = j;
|
|
2397
|
+
G.deprecated(!(ne in e), ne, Z);
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
return B(/* @__PURE__ */ o.createElement("div", Object.assign({
|
|
2401
|
+
className: Ve(z, q, I, p == null ? void 0 : p.className, {
|
|
2402
|
+
[`${I}-normal`]: b === or,
|
|
2403
|
+
[`${I}-rtl`]: T === "rtl"
|
|
2404
|
+
}, f, v, (n = p == null ? void 0 : p.classNames) === null || n === void 0 ? void 0 : n.root, w == null ? void 0 : w.root),
|
|
2405
|
+
style: Object.assign(Object.assign(Object.assign(Object.assign({}, (t = p == null ? void 0 : p.styles) === null || t === void 0 ? void 0 : t.root), p == null ? void 0 : p.style), h == null ? void 0 : h.root), S)
|
|
2406
|
+
}, E), /* @__PURE__ */ o.createElement("div", {
|
|
2407
|
+
className: Ve(`${I}-image`, (r = p == null ? void 0 : p.classNames) === null || r === void 0 ? void 0 : r.image, w == null ? void 0 : w.image),
|
|
2408
|
+
style: Object.assign(Object.assign(Object.assign({}, m), (a = p == null ? void 0 : p.styles) === null || a === void 0 ? void 0 : a.image), h == null ? void 0 : h.image)
|
|
2409
|
+
}, Q), F && /* @__PURE__ */ o.createElement("div", {
|
|
2410
|
+
className: Ve(`${I}-description`, (i = p == null ? void 0 : p.classNames) === null || i === void 0 ? void 0 : i.description, w == null ? void 0 : w.description),
|
|
2411
|
+
style: Object.assign(Object.assign({}, (l = p == null ? void 0 : p.styles) === null || l === void 0 ? void 0 : l.description), h == null ? void 0 : h.description)
|
|
2412
|
+
}, F), g && /* @__PURE__ */ o.createElement("div", {
|
|
2413
|
+
className: Ve(`${I}-footer`, (u = p == null ? void 0 : p.classNames) === null || u === void 0 ? void 0 : u.footer, w == null ? void 0 : w.footer),
|
|
2414
|
+
style: Object.assign(Object.assign({}, (d = p == null ? void 0 : p.styles) === null || d === void 0 ? void 0 : d.footer), h == null ? void 0 : h.footer)
|
|
2415
|
+
}, g)));
|
|
2416
|
+
};
|
|
2417
|
+
gn.PRESENTED_IMAGE_DEFAULT = rr;
|
|
2418
|
+
gn.PRESENTED_IMAGE_SIMPLE = or;
|
|
2419
|
+
process.env.NODE_ENV !== "production" && (gn.displayName = "Empty");
|
|
2420
|
+
const ta = (e) => {
|
|
2421
|
+
const {
|
|
2422
|
+
componentName: n
|
|
2423
|
+
} = e, {
|
|
2424
|
+
getPrefixCls: t
|
|
2425
|
+
} = gr(ot), r = t("empty");
|
|
2426
|
+
switch (n) {
|
|
2427
|
+
case "Table":
|
|
2428
|
+
case "List":
|
|
2429
|
+
return /* @__PURE__ */ On.createElement(gn, {
|
|
2430
|
+
image: gn.PRESENTED_IMAGE_SIMPLE
|
|
2431
|
+
});
|
|
2432
|
+
case "Select":
|
|
2433
|
+
case "TreeSelect":
|
|
2434
|
+
case "Cascader":
|
|
2435
|
+
case "Transfer":
|
|
2436
|
+
case "Mentions":
|
|
2437
|
+
return /* @__PURE__ */ On.createElement(gn, {
|
|
2438
|
+
image: gn.PRESENTED_IMAGE_SIMPLE,
|
|
2439
|
+
className: `${r}-small`
|
|
2440
|
+
});
|
|
2441
|
+
case "Table.filter":
|
|
2442
|
+
return null;
|
|
2443
|
+
default:
|
|
2444
|
+
return /* @__PURE__ */ On.createElement(gn, null);
|
|
2445
|
+
}
|
|
2446
|
+
}, ra = (e) => {
|
|
2447
|
+
const t = {
|
|
2448
|
+
overflow: {
|
|
2449
|
+
adjustX: !0,
|
|
2450
|
+
adjustY: !0,
|
|
2451
|
+
shiftY: !0
|
|
2452
|
+
},
|
|
2453
|
+
htmlRegion: e === "scroll" ? "scroll" : "visible",
|
|
2454
|
+
dynamicInset: !0
|
|
2455
|
+
};
|
|
2456
|
+
return {
|
|
2457
|
+
bottomLeft: Object.assign(Object.assign({}, t), {
|
|
2458
|
+
points: ["tl", "bl"],
|
|
2459
|
+
offset: [0, 4]
|
|
2460
|
+
}),
|
|
2461
|
+
bottomRight: Object.assign(Object.assign({}, t), {
|
|
2462
|
+
points: ["tr", "br"],
|
|
2463
|
+
offset: [0, 4]
|
|
2464
|
+
}),
|
|
2465
|
+
topLeft: Object.assign(Object.assign({}, t), {
|
|
2466
|
+
points: ["bl", "tl"],
|
|
2467
|
+
offset: [0, -4]
|
|
2468
|
+
}),
|
|
2469
|
+
topRight: Object.assign(Object.assign({}, t), {
|
|
2470
|
+
points: ["br", "tr"],
|
|
2471
|
+
offset: [0, -4]
|
|
2472
|
+
})
|
|
2473
|
+
};
|
|
2474
|
+
};
|
|
2475
|
+
function oa(e, n) {
|
|
2476
|
+
return e || ra(n);
|
|
2477
|
+
}
|
|
2478
|
+
const Ht = (e) => {
|
|
2479
|
+
const {
|
|
2480
|
+
optionHeight: n,
|
|
2481
|
+
optionFontSize: t,
|
|
2482
|
+
optionLineHeight: r,
|
|
2483
|
+
optionPadding: a
|
|
2484
|
+
} = e;
|
|
2485
|
+
return {
|
|
2486
|
+
position: "relative",
|
|
2487
|
+
display: "block",
|
|
2488
|
+
minHeight: n,
|
|
2489
|
+
padding: a,
|
|
2490
|
+
color: e.colorText,
|
|
2491
|
+
fontWeight: "normal",
|
|
2492
|
+
fontSize: t,
|
|
2493
|
+
lineHeight: r,
|
|
2494
|
+
boxSizing: "border-box"
|
|
2495
|
+
};
|
|
2496
|
+
}, aa = (e) => {
|
|
2497
|
+
const {
|
|
2498
|
+
antCls: n,
|
|
2499
|
+
componentCls: t
|
|
2500
|
+
} = e, r = `${t}-item`, a = `&${n}-slide-up-enter${n}-slide-up-enter-active`, i = `&${n}-slide-up-appear${n}-slide-up-appear-active`, l = `&${n}-slide-up-leave${n}-slide-up-leave-active`, u = `${t}-dropdown-placement-`, d = `${r}-option-selected`;
|
|
2501
|
+
return [
|
|
2502
|
+
{
|
|
2503
|
+
[`${t}-dropdown`]: Object.assign(Object.assign({}, it(e)), {
|
|
2504
|
+
position: "absolute",
|
|
2505
|
+
top: -9999,
|
|
2506
|
+
zIndex: e.zIndexPopup,
|
|
2507
|
+
boxSizing: "border-box",
|
|
2508
|
+
padding: e.paddingXXS,
|
|
2509
|
+
overflow: "hidden",
|
|
2510
|
+
fontSize: e.fontSize,
|
|
2511
|
+
// Fix select render lag of long text in chrome
|
|
2512
|
+
// https://github.com/ant-design/ant-design/issues/11456
|
|
2513
|
+
// https://github.com/ant-design/ant-design/issues/11843
|
|
2514
|
+
fontVariant: "initial",
|
|
2515
|
+
backgroundColor: e.colorBgElevated,
|
|
2516
|
+
borderRadius: e.borderRadiusLG,
|
|
2517
|
+
outline: "none",
|
|
2518
|
+
boxShadow: e.boxShadowSecondary,
|
|
2519
|
+
[`
|
|
2520
|
+
${a}${u}bottomLeft,
|
|
2521
|
+
${i}${u}bottomLeft
|
|
2522
|
+
`]: {
|
|
2523
|
+
animationName: Dr
|
|
2524
|
+
},
|
|
2525
|
+
[`
|
|
2526
|
+
${a}${u}topLeft,
|
|
2527
|
+
${i}${u}topLeft,
|
|
2528
|
+
${a}${u}topRight,
|
|
2529
|
+
${i}${u}topRight
|
|
2530
|
+
`]: {
|
|
2531
|
+
animationName: Nr
|
|
2532
|
+
},
|
|
2533
|
+
[`${l}${u}bottomLeft`]: {
|
|
2534
|
+
animationName: Pr
|
|
2535
|
+
},
|
|
2536
|
+
[`
|
|
2537
|
+
${l}${u}topLeft,
|
|
2538
|
+
${l}${u}topRight
|
|
2539
|
+
`]: {
|
|
2540
|
+
animationName: _r
|
|
2541
|
+
},
|
|
2542
|
+
"&-hidden": {
|
|
2543
|
+
display: "none"
|
|
2544
|
+
},
|
|
2545
|
+
[r]: Object.assign(Object.assign({}, Ht(e)), {
|
|
2546
|
+
cursor: "pointer",
|
|
2547
|
+
transition: `background ${e.motionDurationSlow} ease`,
|
|
2548
|
+
borderRadius: e.borderRadiusSM,
|
|
2549
|
+
// =========== Group ============
|
|
2550
|
+
"&-group": {
|
|
2551
|
+
color: e.colorTextDescription,
|
|
2552
|
+
fontSize: e.fontSizeSM,
|
|
2553
|
+
cursor: "default"
|
|
2554
|
+
},
|
|
2555
|
+
// =========== Option ===========
|
|
2556
|
+
"&-option": {
|
|
2557
|
+
display: "flex",
|
|
2558
|
+
"&-content": Object.assign({
|
|
2559
|
+
flex: "auto"
|
|
2560
|
+
}, Qn),
|
|
2561
|
+
"&-state": {
|
|
2562
|
+
flex: "none",
|
|
2563
|
+
display: "flex",
|
|
2564
|
+
alignItems: "center"
|
|
2565
|
+
},
|
|
2566
|
+
[`&-active:not(${r}-option-disabled)`]: {
|
|
2567
|
+
backgroundColor: e.optionActiveBg
|
|
2568
|
+
},
|
|
2569
|
+
[`&-selected:not(${r}-option-disabled)`]: {
|
|
2570
|
+
color: e.optionSelectedColor,
|
|
2571
|
+
fontWeight: e.optionSelectedFontWeight,
|
|
2572
|
+
backgroundColor: e.optionSelectedBg,
|
|
2573
|
+
[`${r}-option-state`]: {
|
|
2574
|
+
color: e.colorPrimary
|
|
2575
|
+
}
|
|
2576
|
+
},
|
|
2577
|
+
"&-disabled": {
|
|
2578
|
+
[`&${r}-option-selected`]: {
|
|
2579
|
+
backgroundColor: e.colorBgContainerDisabled
|
|
2580
|
+
},
|
|
2581
|
+
color: e.colorTextDisabled,
|
|
2582
|
+
cursor: "not-allowed"
|
|
2583
|
+
},
|
|
2584
|
+
"&-grouped": {
|
|
2585
|
+
paddingInlineStart: e.calc(e.controlPaddingHorizontal).mul(2).equal()
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
"&-empty": Object.assign(Object.assign({}, Ht(e)), {
|
|
2589
|
+
color: e.colorTextDisabled
|
|
2590
|
+
})
|
|
2591
|
+
}),
|
|
2592
|
+
// https://github.com/ant-design/ant-design/pull/46646
|
|
2593
|
+
[`${d}:has(+ ${d})`]: {
|
|
2594
|
+
borderEndStartRadius: 0,
|
|
2595
|
+
borderEndEndRadius: 0,
|
|
2596
|
+
[`& + ${d}`]: {
|
|
2597
|
+
borderStartStartRadius: 0,
|
|
2598
|
+
borderStartEndRadius: 0
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
// =========================== RTL ===========================
|
|
2602
|
+
"&-rtl": {
|
|
2603
|
+
direction: "rtl"
|
|
2604
|
+
}
|
|
2605
|
+
})
|
|
2606
|
+
},
|
|
2607
|
+
// Follow code may reuse in other components
|
|
2608
|
+
yt(e, "slide-up"),
|
|
2609
|
+
yt(e, "slide-down"),
|
|
2610
|
+
Et(e, "move-up"),
|
|
2611
|
+
Et(e, "move-down")
|
|
2612
|
+
];
|
|
2613
|
+
}, ia = (e) => {
|
|
2614
|
+
const {
|
|
2615
|
+
multipleSelectItemHeight: n,
|
|
2616
|
+
paddingXXS: t,
|
|
2617
|
+
lineWidth: r,
|
|
2618
|
+
INTERNAL_FIXED_ITEM_MARGIN: a
|
|
2619
|
+
} = e, i = e.max(e.calc(t).sub(r).equal(), 0), l = e.max(e.calc(i).sub(a).equal(), 0);
|
|
2620
|
+
return {
|
|
2621
|
+
basePadding: i,
|
|
2622
|
+
containerPadding: l,
|
|
2623
|
+
itemHeight: He(n),
|
|
2624
|
+
itemLineHeight: He(e.calc(n).sub(e.calc(e.lineWidth).mul(2)).equal())
|
|
2625
|
+
};
|
|
2626
|
+
}, la = (e) => {
|
|
2627
|
+
const {
|
|
2628
|
+
multipleSelectItemHeight: n,
|
|
2629
|
+
selectHeight: t,
|
|
2630
|
+
lineWidth: r
|
|
2631
|
+
} = e;
|
|
2632
|
+
return e.calc(t).sub(n).div(2).sub(r).equal();
|
|
2633
|
+
}, ua = (e) => {
|
|
2634
|
+
const {
|
|
2635
|
+
componentCls: n,
|
|
2636
|
+
iconCls: t,
|
|
2637
|
+
borderRadiusSM: r,
|
|
2638
|
+
motionDurationSlow: a,
|
|
2639
|
+
paddingXS: i,
|
|
2640
|
+
multipleItemColorDisabled: l,
|
|
2641
|
+
multipleItemBorderColorDisabled: u,
|
|
2642
|
+
colorIcon: d,
|
|
2643
|
+
colorIconHover: f,
|
|
2644
|
+
INTERNAL_FIXED_ITEM_MARGIN: v
|
|
2645
|
+
} = e;
|
|
2646
|
+
return {
|
|
2647
|
+
/**
|
|
2648
|
+
* Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
|
|
2649
|
+
* may update to redesign with its align logic.
|
|
2650
|
+
*/
|
|
2651
|
+
// =========================== Overflow ===========================
|
|
2652
|
+
[`${n}-selection-overflow`]: {
|
|
2653
|
+
position: "relative",
|
|
2654
|
+
display: "flex",
|
|
2655
|
+
flex: "auto",
|
|
2656
|
+
flexWrap: "wrap",
|
|
2657
|
+
maxWidth: "100%",
|
|
2658
|
+
"&-item": {
|
|
2659
|
+
flex: "none",
|
|
2660
|
+
alignSelf: "center",
|
|
2661
|
+
maxWidth: "100%",
|
|
2662
|
+
display: "inline-flex"
|
|
2663
|
+
},
|
|
2664
|
+
// ======================== Selections ==========================
|
|
2665
|
+
[`${n}-selection-item`]: {
|
|
2666
|
+
display: "flex",
|
|
2667
|
+
alignSelf: "center",
|
|
2668
|
+
flex: "none",
|
|
2669
|
+
boxSizing: "border-box",
|
|
2670
|
+
maxWidth: "100%",
|
|
2671
|
+
marginBlock: v,
|
|
2672
|
+
borderRadius: r,
|
|
2673
|
+
cursor: "default",
|
|
2674
|
+
transition: `font-size ${a}, line-height ${a}, height ${a}`,
|
|
2675
|
+
marginInlineEnd: e.calc(v).mul(2).equal(),
|
|
2676
|
+
paddingInlineStart: i,
|
|
2677
|
+
paddingInlineEnd: e.calc(i).div(2).equal(),
|
|
2678
|
+
[`${n}-disabled&`]: {
|
|
2679
|
+
color: l,
|
|
2680
|
+
borderColor: u,
|
|
2681
|
+
cursor: "not-allowed"
|
|
2682
|
+
},
|
|
2683
|
+
// It's ok not to do this, but 24px makes bottom narrow in view should adjust
|
|
2684
|
+
"&-content": {
|
|
2685
|
+
display: "inline-block",
|
|
2686
|
+
marginInlineEnd: e.calc(i).div(2).equal(),
|
|
2687
|
+
overflow: "hidden",
|
|
2688
|
+
whiteSpace: "pre",
|
|
2689
|
+
// fix whitespace wrapping. custom tags display all whitespace within.
|
|
2690
|
+
textOverflow: "ellipsis"
|
|
2691
|
+
},
|
|
2692
|
+
"&-remove": Object.assign(Object.assign({}, At()), {
|
|
2693
|
+
display: "inline-flex",
|
|
2694
|
+
alignItems: "center",
|
|
2695
|
+
color: d,
|
|
2696
|
+
fontWeight: "bold",
|
|
2697
|
+
fontSize: 10,
|
|
2698
|
+
lineHeight: "inherit",
|
|
2699
|
+
cursor: "pointer",
|
|
2700
|
+
[`> ${t}`]: {
|
|
2701
|
+
verticalAlign: "-0.2em"
|
|
2702
|
+
},
|
|
2703
|
+
"&:hover": {
|
|
2704
|
+
color: f
|
|
2705
|
+
}
|
|
2706
|
+
})
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
};
|
|
2710
|
+
}, ca = (e, n) => {
|
|
2711
|
+
const {
|
|
2712
|
+
componentCls: t,
|
|
2713
|
+
INTERNAL_FIXED_ITEM_MARGIN: r
|
|
2714
|
+
} = e, a = `${t}-selection-overflow`, i = e.multipleSelectItemHeight, l = la(e), u = n ? `${t}-${n}` : "", d = ia(e);
|
|
2715
|
+
return {
|
|
2716
|
+
[`${t}-multiple${u}`]: Object.assign(Object.assign({}, ua(e)), {
|
|
2717
|
+
// ========================= Selector =========================
|
|
2718
|
+
[`${t}-selector`]: {
|
|
2719
|
+
display: "flex",
|
|
2720
|
+
alignItems: "center",
|
|
2721
|
+
width: "100%",
|
|
2722
|
+
height: "100%",
|
|
2723
|
+
// Multiple is little different that horizontal is follow the vertical
|
|
2724
|
+
paddingInline: d.basePadding,
|
|
2725
|
+
paddingBlock: d.containerPadding,
|
|
2726
|
+
borderRadius: e.borderRadius,
|
|
2727
|
+
[`${t}-disabled&`]: {
|
|
2728
|
+
background: e.multipleSelectorBgDisabled,
|
|
2729
|
+
cursor: "not-allowed"
|
|
2730
|
+
},
|
|
2731
|
+
"&:after": {
|
|
2732
|
+
display: "inline-block",
|
|
2733
|
+
width: 0,
|
|
2734
|
+
margin: `${He(r)} 0`,
|
|
2735
|
+
lineHeight: He(i),
|
|
2736
|
+
visibility: "hidden",
|
|
2737
|
+
content: '"\\a0"'
|
|
2738
|
+
}
|
|
2739
|
+
},
|
|
2740
|
+
// ======================== Selections ========================
|
|
2741
|
+
[`${t}-selection-item`]: {
|
|
2742
|
+
height: d.itemHeight,
|
|
2743
|
+
lineHeight: He(d.itemLineHeight)
|
|
2744
|
+
},
|
|
2745
|
+
// ========================== Wrap ===========================
|
|
2746
|
+
[`${t}-selection-wrap`]: {
|
|
2747
|
+
alignSelf: "flex-start",
|
|
2748
|
+
"&:after": {
|
|
2749
|
+
lineHeight: He(i),
|
|
2750
|
+
marginBlock: r
|
|
2751
|
+
}
|
|
2752
|
+
},
|
|
2753
|
+
// ========================== Input ==========================
|
|
2754
|
+
[`${t}-prefix`]: {
|
|
2755
|
+
marginInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(d.basePadding).equal()
|
|
2756
|
+
},
|
|
2757
|
+
[`${a}-item + ${a}-item,
|
|
2758
|
+
${t}-prefix + ${t}-selection-wrap
|
|
2759
|
+
`]: {
|
|
2760
|
+
[`${t}-selection-search`]: {
|
|
2761
|
+
marginInlineStart: 0
|
|
2762
|
+
},
|
|
2763
|
+
[`${t}-selection-placeholder`]: {
|
|
2764
|
+
insetInlineStart: 0
|
|
2765
|
+
}
|
|
2766
|
+
},
|
|
2767
|
+
// https://github.com/ant-design/ant-design/issues/44754
|
|
2768
|
+
// Same as `wrap:after`
|
|
2769
|
+
[`${a}-item-suffix`]: {
|
|
2770
|
+
minHeight: d.itemHeight,
|
|
2771
|
+
marginBlock: r
|
|
2772
|
+
},
|
|
2773
|
+
[`${t}-selection-search`]: {
|
|
2774
|
+
display: "inline-flex",
|
|
2775
|
+
position: "relative",
|
|
2776
|
+
maxWidth: "100%",
|
|
2777
|
+
marginInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(l).equal(),
|
|
2778
|
+
"\n &-input,\n &-mirror\n ": {
|
|
2779
|
+
height: i,
|
|
2780
|
+
fontFamily: e.fontFamily,
|
|
2781
|
+
lineHeight: He(i),
|
|
2782
|
+
transition: `all ${e.motionDurationSlow}`
|
|
2783
|
+
},
|
|
2784
|
+
"&-input": {
|
|
2785
|
+
width: "100%",
|
|
2786
|
+
minWidth: 4.1
|
|
2787
|
+
// fix search cursor missing
|
|
2788
|
+
},
|
|
2789
|
+
"&-mirror": {
|
|
2790
|
+
position: "absolute",
|
|
2791
|
+
top: 0,
|
|
2792
|
+
insetInlineStart: 0,
|
|
2793
|
+
insetInlineEnd: "auto",
|
|
2794
|
+
zIndex: 999,
|
|
2795
|
+
whiteSpace: "pre",
|
|
2796
|
+
// fix whitespace wrapping caused width calculation bug
|
|
2797
|
+
visibility: "hidden"
|
|
2798
|
+
}
|
|
2799
|
+
},
|
|
2800
|
+
// ======================= Placeholder =======================
|
|
2801
|
+
[`${t}-selection-placeholder`]: {
|
|
2802
|
+
position: "absolute",
|
|
2803
|
+
top: "50%",
|
|
2804
|
+
insetInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(d.basePadding).equal(),
|
|
2805
|
+
insetInlineEnd: e.inputPaddingHorizontalBase,
|
|
2806
|
+
transform: "translateY(-50%)",
|
|
2807
|
+
transition: `all ${e.motionDurationSlow}`
|
|
2808
|
+
}
|
|
2809
|
+
})
|
|
2810
|
+
};
|
|
2811
|
+
};
|
|
2812
|
+
function Gn(e, n) {
|
|
2813
|
+
const {
|
|
2814
|
+
componentCls: t
|
|
2815
|
+
} = e, r = n ? `${t}-${n}` : "", a = {
|
|
2816
|
+
[`${t}-multiple${r}`]: {
|
|
2817
|
+
fontSize: e.fontSize,
|
|
2818
|
+
// ========================= Selector =========================
|
|
2819
|
+
[`${t}-selector`]: {
|
|
2820
|
+
[`${t}-show-search&`]: {
|
|
2821
|
+
cursor: "text"
|
|
2822
|
+
}
|
|
2823
|
+
},
|
|
2824
|
+
[`
|
|
2825
|
+
&${t}-show-arrow ${t}-selector,
|
|
2826
|
+
&${t}-allow-clear ${t}-selector
|
|
2827
|
+
`]: {
|
|
2828
|
+
paddingInlineEnd: e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
};
|
|
2832
|
+
return [ca(e, n), a];
|
|
2833
|
+
}
|
|
2834
|
+
const sa = (e) => {
|
|
2835
|
+
const {
|
|
2836
|
+
componentCls: n
|
|
2837
|
+
} = e, t = Mn(e, {
|
|
2838
|
+
selectHeight: e.controlHeightSM,
|
|
2839
|
+
multipleSelectItemHeight: e.multipleItemHeightSM,
|
|
2840
|
+
borderRadius: e.borderRadiusSM,
|
|
2841
|
+
borderRadiusSM: e.borderRadiusXS
|
|
2842
|
+
}), r = Mn(e, {
|
|
2843
|
+
fontSize: e.fontSizeLG,
|
|
2844
|
+
selectHeight: e.controlHeightLG,
|
|
2845
|
+
multipleSelectItemHeight: e.multipleItemHeightLG,
|
|
2846
|
+
borderRadius: e.borderRadiusLG,
|
|
2847
|
+
borderRadiusSM: e.borderRadius
|
|
2848
|
+
});
|
|
2849
|
+
return [
|
|
2850
|
+
Gn(e),
|
|
2851
|
+
// ======================== Small ========================
|
|
2852
|
+
Gn(t, "sm"),
|
|
2853
|
+
// Padding
|
|
2854
|
+
{
|
|
2855
|
+
[`${n}-multiple${n}-sm`]: {
|
|
2856
|
+
[`${n}-selection-placeholder`]: {
|
|
2857
|
+
insetInline: e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()
|
|
2858
|
+
},
|
|
2859
|
+
// https://github.com/ant-design/ant-design/issues/29559
|
|
2860
|
+
[`${n}-selection-search`]: {
|
|
2861
|
+
marginInlineStart: 2
|
|
2862
|
+
// Magic Number
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
},
|
|
2866
|
+
// ======================== Large ========================
|
|
2867
|
+
Gn(r, "lg")
|
|
2868
|
+
];
|
|
2869
|
+
};
|
|
2870
|
+
function Yn(e, n) {
|
|
2871
|
+
const {
|
|
2872
|
+
componentCls: t,
|
|
2873
|
+
inputPaddingHorizontalBase: r,
|
|
2874
|
+
borderRadius: a
|
|
2875
|
+
} = e, i = e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(), l = n ? `${t}-${n}` : "";
|
|
2876
|
+
return {
|
|
2877
|
+
[`${t}-single${l}`]: {
|
|
2878
|
+
fontSize: e.fontSize,
|
|
2879
|
+
height: e.controlHeight,
|
|
2880
|
+
// ========================= Selector =========================
|
|
2881
|
+
[`${t}-selector`]: Object.assign(Object.assign({}, it(e, !0)), {
|
|
2882
|
+
display: "flex",
|
|
2883
|
+
borderRadius: a,
|
|
2884
|
+
flex: "1 1 auto",
|
|
2885
|
+
[`${t}-selection-search`]: {
|
|
2886
|
+
position: "absolute",
|
|
2887
|
+
inset: 0,
|
|
2888
|
+
width: "100%",
|
|
2889
|
+
"&-input": {
|
|
2890
|
+
width: "100%",
|
|
2891
|
+
WebkitAppearance: "textfield"
|
|
2892
|
+
}
|
|
2893
|
+
},
|
|
2894
|
+
[`
|
|
2895
|
+
${t}-selection-item,
|
|
2896
|
+
${t}-selection-placeholder
|
|
2897
|
+
`]: {
|
|
2898
|
+
display: "block",
|
|
2899
|
+
padding: 0,
|
|
2900
|
+
lineHeight: He(i),
|
|
2901
|
+
transition: `all ${e.motionDurationSlow}, visibility 0s`,
|
|
2902
|
+
alignSelf: "center"
|
|
2903
|
+
},
|
|
2904
|
+
[`${t}-selection-placeholder`]: {
|
|
2905
|
+
transition: "none",
|
|
2906
|
+
pointerEvents: "none"
|
|
2907
|
+
},
|
|
2908
|
+
// For common baseline align
|
|
2909
|
+
[[
|
|
2910
|
+
"&:after",
|
|
2911
|
+
/* For '' value baseline align */
|
|
2912
|
+
`${t}-selection-item:empty:after`,
|
|
2913
|
+
/* For undefined value baseline align */
|
|
2914
|
+
`${t}-selection-placeholder:empty:after`
|
|
2915
|
+
].join(",")]: {
|
|
2916
|
+
display: "inline-block",
|
|
2917
|
+
width: 0,
|
|
2918
|
+
visibility: "hidden",
|
|
2919
|
+
content: '"\\a0"'
|
|
2920
|
+
}
|
|
2921
|
+
}),
|
|
2922
|
+
[`
|
|
2923
|
+
&${t}-show-arrow ${t}-selection-item,
|
|
2924
|
+
&${t}-show-arrow ${t}-selection-search,
|
|
2925
|
+
&${t}-show-arrow ${t}-selection-placeholder
|
|
2926
|
+
`]: {
|
|
2927
|
+
paddingInlineEnd: e.showArrowPaddingInlineEnd
|
|
2928
|
+
},
|
|
2929
|
+
// Opacity selection if open
|
|
2930
|
+
[`&${t}-open ${t}-selection-item`]: {
|
|
2931
|
+
color: e.colorTextPlaceholder
|
|
2932
|
+
},
|
|
2933
|
+
// ========================== Input ==========================
|
|
2934
|
+
// We only change the style of non-customize input which is only support by `combobox` mode.
|
|
2935
|
+
// Not customize
|
|
2936
|
+
[`&:not(${t}-customize-input)`]: {
|
|
2937
|
+
[`${t}-selector`]: {
|
|
2938
|
+
width: "100%",
|
|
2939
|
+
height: "100%",
|
|
2940
|
+
alignItems: "center",
|
|
2941
|
+
padding: `0 ${He(r)}`,
|
|
2942
|
+
[`${t}-selection-search-input`]: {
|
|
2943
|
+
height: i
|
|
2944
|
+
},
|
|
2945
|
+
"&:after": {
|
|
2946
|
+
lineHeight: He(i)
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
[`&${t}-customize-input`]: {
|
|
2951
|
+
[`${t}-selector`]: {
|
|
2952
|
+
"&:after": {
|
|
2953
|
+
display: "none"
|
|
2954
|
+
},
|
|
2955
|
+
[`${t}-selection-search`]: {
|
|
2956
|
+
position: "static",
|
|
2957
|
+
width: "100%"
|
|
2958
|
+
},
|
|
2959
|
+
[`${t}-selection-placeholder`]: {
|
|
2960
|
+
position: "absolute",
|
|
2961
|
+
insetInlineStart: 0,
|
|
2962
|
+
insetInlineEnd: 0,
|
|
2963
|
+
padding: `0 ${He(r)}`,
|
|
2964
|
+
"&:after": {
|
|
2965
|
+
display: "none"
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
};
|
|
2972
|
+
}
|
|
2973
|
+
function da(e) {
|
|
2974
|
+
const {
|
|
2975
|
+
componentCls: n
|
|
2976
|
+
} = e, t = e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();
|
|
2977
|
+
return [
|
|
2978
|
+
Yn(e),
|
|
2979
|
+
// ======================== Small ========================
|
|
2980
|
+
// Shared
|
|
2981
|
+
Yn(Mn(e, {
|
|
2982
|
+
controlHeight: e.controlHeightSM,
|
|
2983
|
+
borderRadius: e.borderRadiusSM
|
|
2984
|
+
}), "sm"),
|
|
2985
|
+
// padding
|
|
2986
|
+
{
|
|
2987
|
+
[`${n}-single${n}-sm`]: {
|
|
2988
|
+
[`&:not(${n}-customize-input)`]: {
|
|
2989
|
+
[`${n}-selector`]: {
|
|
2990
|
+
padding: `0 ${He(t)}`
|
|
2991
|
+
},
|
|
2992
|
+
// With arrow should provides `padding-right` to show the arrow
|
|
2993
|
+
[`&${n}-show-arrow ${n}-selection-search`]: {
|
|
2994
|
+
insetInlineEnd: e.calc(t).add(e.calc(e.fontSize).mul(1.5)).equal()
|
|
2995
|
+
},
|
|
2996
|
+
[`
|
|
2997
|
+
&${n}-show-arrow ${n}-selection-item,
|
|
2998
|
+
&${n}-show-arrow ${n}-selection-placeholder
|
|
2999
|
+
`]: {
|
|
3000
|
+
paddingInlineEnd: e.calc(e.fontSize).mul(1.5).equal()
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
},
|
|
3005
|
+
// ======================== Large ========================
|
|
3006
|
+
// Shared
|
|
3007
|
+
Yn(Mn(e, {
|
|
3008
|
+
controlHeight: e.singleItemHeightLG,
|
|
3009
|
+
fontSize: e.fontSizeLG,
|
|
3010
|
+
borderRadius: e.borderRadiusLG
|
|
3011
|
+
}), "lg")
|
|
3012
|
+
];
|
|
3013
|
+
}
|
|
3014
|
+
const fa = (e) => {
|
|
3015
|
+
const {
|
|
3016
|
+
fontSize: n,
|
|
3017
|
+
lineHeight: t,
|
|
3018
|
+
lineWidth: r,
|
|
3019
|
+
controlHeight: a,
|
|
3020
|
+
controlHeightSM: i,
|
|
3021
|
+
controlHeightLG: l,
|
|
3022
|
+
paddingXXS: u,
|
|
3023
|
+
controlPaddingHorizontal: d,
|
|
3024
|
+
zIndexPopupBase: f,
|
|
3025
|
+
colorText: v,
|
|
3026
|
+
fontWeightStrong: s,
|
|
3027
|
+
controlItemBgActive: b,
|
|
3028
|
+
controlItemBgHover: c,
|
|
3029
|
+
colorBgContainer: g,
|
|
3030
|
+
colorFillSecondary: m,
|
|
3031
|
+
colorBgContainerDisabled: S,
|
|
3032
|
+
colorTextDisabled: w,
|
|
3033
|
+
colorPrimaryHover: h,
|
|
3034
|
+
colorPrimary: E,
|
|
3035
|
+
controlOutline: C
|
|
3036
|
+
} = e, T = u * 2, p = r * 2, I = Math.min(a - T, a - p), B = Math.min(i - T, i - p), z = Math.min(l - T, l - p);
|
|
3037
|
+
return {
|
|
3038
|
+
INTERNAL_FIXED_ITEM_MARGIN: Math.floor(u / 2),
|
|
3039
|
+
zIndexPopup: f + 50,
|
|
3040
|
+
optionSelectedColor: v,
|
|
3041
|
+
optionSelectedFontWeight: s,
|
|
3042
|
+
optionSelectedBg: b,
|
|
3043
|
+
optionActiveBg: c,
|
|
3044
|
+
optionPadding: `${(a - n * t) / 2}px ${d}px`,
|
|
3045
|
+
optionFontSize: n,
|
|
3046
|
+
optionLineHeight: t,
|
|
3047
|
+
optionHeight: a,
|
|
3048
|
+
selectorBg: g,
|
|
3049
|
+
clearBg: g,
|
|
3050
|
+
singleItemHeightLG: l,
|
|
3051
|
+
multipleItemBg: m,
|
|
3052
|
+
multipleItemBorderColor: "transparent",
|
|
3053
|
+
multipleItemHeight: I,
|
|
3054
|
+
multipleItemHeightSM: B,
|
|
3055
|
+
multipleItemHeightLG: z,
|
|
3056
|
+
multipleSelectorBgDisabled: S,
|
|
3057
|
+
multipleItemColorDisabled: w,
|
|
3058
|
+
multipleItemBorderColorDisabled: "transparent",
|
|
3059
|
+
showArrowPaddingInlineEnd: Math.ceil(e.fontSize * 1.25),
|
|
3060
|
+
hoverBorderColor: h,
|
|
3061
|
+
activeBorderColor: E,
|
|
3062
|
+
activeOutlineColor: C,
|
|
3063
|
+
selectAffixPadding: u
|
|
3064
|
+
};
|
|
3065
|
+
}, ar = (e, n) => {
|
|
3066
|
+
const {
|
|
3067
|
+
componentCls: t,
|
|
3068
|
+
antCls: r,
|
|
3069
|
+
controlOutlineWidth: a
|
|
3070
|
+
} = e;
|
|
3071
|
+
return {
|
|
3072
|
+
[`&:not(${t}-customize-input) ${t}-selector`]: {
|
|
3073
|
+
border: `${He(e.lineWidth)} ${e.lineType} ${n.borderColor}`,
|
|
3074
|
+
background: e.selectorBg
|
|
3075
|
+
},
|
|
3076
|
+
[`&:not(${t}-disabled):not(${t}-customize-input):not(${r}-pagination-size-changer)`]: {
|
|
3077
|
+
[`&:hover ${t}-selector`]: {
|
|
3078
|
+
borderColor: n.hoverBorderHover
|
|
3079
|
+
},
|
|
3080
|
+
[`${t}-focused& ${t}-selector`]: {
|
|
3081
|
+
borderColor: n.activeBorderColor,
|
|
3082
|
+
boxShadow: `0 0 0 ${He(a)} ${n.activeOutlineColor}`,
|
|
3083
|
+
outline: 0
|
|
3084
|
+
},
|
|
3085
|
+
[`${t}-prefix`]: {
|
|
3086
|
+
color: n.color
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
};
|
|
3090
|
+
}, Bt = (e, n) => ({
|
|
3091
|
+
[`&${e.componentCls}-status-${n.status}`]: Object.assign({}, ar(e, n))
|
|
3092
|
+
}), ma = (e) => ({
|
|
3093
|
+
"&-outlined": Object.assign(Object.assign(Object.assign(Object.assign({}, ar(e, {
|
|
3094
|
+
borderColor: e.colorBorder,
|
|
3095
|
+
hoverBorderHover: e.hoverBorderColor,
|
|
3096
|
+
activeBorderColor: e.activeBorderColor,
|
|
3097
|
+
activeOutlineColor: e.activeOutlineColor,
|
|
3098
|
+
color: e.colorText
|
|
3099
|
+
})), Bt(e, {
|
|
3100
|
+
status: "error",
|
|
3101
|
+
borderColor: e.colorError,
|
|
3102
|
+
hoverBorderHover: e.colorErrorHover,
|
|
3103
|
+
activeBorderColor: e.colorError,
|
|
3104
|
+
activeOutlineColor: e.colorErrorOutline,
|
|
3105
|
+
color: e.colorError
|
|
3106
|
+
})), Bt(e, {
|
|
3107
|
+
status: "warning",
|
|
3108
|
+
borderColor: e.colorWarning,
|
|
3109
|
+
hoverBorderHover: e.colorWarningHover,
|
|
3110
|
+
activeBorderColor: e.colorWarning,
|
|
3111
|
+
activeOutlineColor: e.colorWarningOutline,
|
|
3112
|
+
color: e.colorWarning
|
|
3113
|
+
})), {
|
|
3114
|
+
[`&${e.componentCls}-disabled`]: {
|
|
3115
|
+
[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
|
|
3116
|
+
background: e.colorBgContainerDisabled,
|
|
3117
|
+
color: e.colorTextDisabled
|
|
3118
|
+
}
|
|
3119
|
+
},
|
|
3120
|
+
[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
|
|
3121
|
+
background: e.multipleItemBg,
|
|
3122
|
+
border: `${He(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`
|
|
3123
|
+
}
|
|
3124
|
+
})
|
|
3125
|
+
}), ir = (e, n) => {
|
|
3126
|
+
const {
|
|
3127
|
+
componentCls: t,
|
|
3128
|
+
antCls: r
|
|
3129
|
+
} = e;
|
|
3130
|
+
return {
|
|
3131
|
+
[`&:not(${t}-customize-input) ${t}-selector`]: {
|
|
3132
|
+
background: n.bg,
|
|
3133
|
+
border: `${He(e.lineWidth)} ${e.lineType} transparent`,
|
|
3134
|
+
color: n.color
|
|
3135
|
+
},
|
|
3136
|
+
[`&:not(${t}-disabled):not(${t}-customize-input):not(${r}-pagination-size-changer)`]: {
|
|
3137
|
+
[`&:hover ${t}-selector`]: {
|
|
3138
|
+
background: n.hoverBg
|
|
3139
|
+
},
|
|
3140
|
+
[`${t}-focused& ${t}-selector`]: {
|
|
3141
|
+
background: e.selectorBg,
|
|
3142
|
+
borderColor: n.activeBorderColor,
|
|
3143
|
+
outline: 0
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
}, Vt = (e, n) => ({
|
|
3148
|
+
[`&${e.componentCls}-status-${n.status}`]: Object.assign({}, ir(e, n))
|
|
3149
|
+
}), va = (e) => ({
|
|
3150
|
+
"&-filled": Object.assign(Object.assign(Object.assign(Object.assign({}, ir(e, {
|
|
3151
|
+
bg: e.colorFillTertiary,
|
|
3152
|
+
hoverBg: e.colorFillSecondary,
|
|
3153
|
+
activeBorderColor: e.activeBorderColor,
|
|
3154
|
+
color: e.colorText
|
|
3155
|
+
})), Vt(e, {
|
|
3156
|
+
status: "error",
|
|
3157
|
+
bg: e.colorErrorBg,
|
|
3158
|
+
hoverBg: e.colorErrorBgHover,
|
|
3159
|
+
activeBorderColor: e.colorError,
|
|
3160
|
+
color: e.colorError
|
|
3161
|
+
})), Vt(e, {
|
|
3162
|
+
status: "warning",
|
|
3163
|
+
bg: e.colorWarningBg,
|
|
3164
|
+
hoverBg: e.colorWarningBgHover,
|
|
3165
|
+
activeBorderColor: e.colorWarning,
|
|
3166
|
+
color: e.colorWarning
|
|
3167
|
+
})), {
|
|
3168
|
+
[`&${e.componentCls}-disabled`]: {
|
|
3169
|
+
[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
|
|
3170
|
+
borderColor: e.colorBorder,
|
|
3171
|
+
background: e.colorBgContainerDisabled,
|
|
3172
|
+
color: e.colorTextDisabled
|
|
3173
|
+
}
|
|
3174
|
+
},
|
|
3175
|
+
[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
|
|
3176
|
+
background: e.colorBgContainer,
|
|
3177
|
+
border: `${He(e.lineWidth)} ${e.lineType} ${e.colorSplit}`
|
|
3178
|
+
}
|
|
3179
|
+
})
|
|
3180
|
+
}), ga = (e) => ({
|
|
3181
|
+
"&-borderless": {
|
|
3182
|
+
[`${e.componentCls}-selector`]: {
|
|
3183
|
+
background: "transparent",
|
|
3184
|
+
border: `${He(e.lineWidth)} ${e.lineType} transparent`
|
|
3185
|
+
},
|
|
3186
|
+
[`&${e.componentCls}-disabled`]: {
|
|
3187
|
+
[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
|
|
3188
|
+
color: e.colorTextDisabled
|
|
3189
|
+
}
|
|
3190
|
+
},
|
|
3191
|
+
[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
|
|
3192
|
+
background: e.multipleItemBg,
|
|
3193
|
+
border: `${He(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`
|
|
3194
|
+
},
|
|
3195
|
+
// Status
|
|
3196
|
+
[`&${e.componentCls}-status-error`]: {
|
|
3197
|
+
[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]: {
|
|
3198
|
+
color: e.colorError
|
|
3199
|
+
}
|
|
3200
|
+
},
|
|
3201
|
+
[`&${e.componentCls}-status-warning`]: {
|
|
3202
|
+
[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]: {
|
|
3203
|
+
color: e.colorWarning
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
}), pa = (e) => ({
|
|
3208
|
+
[e.componentCls]: Object.assign(Object.assign(Object.assign({}, ma(e)), va(e)), ga(e))
|
|
3209
|
+
}), ha = (e) => {
|
|
3210
|
+
const {
|
|
3211
|
+
componentCls: n
|
|
3212
|
+
} = e;
|
|
3213
|
+
return {
|
|
3214
|
+
position: "relative",
|
|
3215
|
+
transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`,
|
|
3216
|
+
input: {
|
|
3217
|
+
cursor: "pointer"
|
|
3218
|
+
},
|
|
3219
|
+
[`${n}-show-search&`]: {
|
|
3220
|
+
cursor: "text",
|
|
3221
|
+
input: {
|
|
3222
|
+
cursor: "auto",
|
|
3223
|
+
color: "inherit",
|
|
3224
|
+
height: "100%"
|
|
3225
|
+
}
|
|
3226
|
+
},
|
|
3227
|
+
[`${n}-disabled&`]: {
|
|
3228
|
+
cursor: "not-allowed",
|
|
3229
|
+
input: {
|
|
3230
|
+
cursor: "not-allowed"
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
}, ba = (e) => {
|
|
3235
|
+
const {
|
|
3236
|
+
componentCls: n
|
|
3237
|
+
} = e;
|
|
3238
|
+
return {
|
|
3239
|
+
[`${n}-selection-search-input`]: {
|
|
3240
|
+
margin: 0,
|
|
3241
|
+
padding: 0,
|
|
3242
|
+
background: "transparent",
|
|
3243
|
+
border: "none",
|
|
3244
|
+
outline: "none",
|
|
3245
|
+
appearance: "none",
|
|
3246
|
+
fontFamily: "inherit",
|
|
3247
|
+
"&::-webkit-search-cancel-button": {
|
|
3248
|
+
display: "none",
|
|
3249
|
+
"-webkit-appearance": "none"
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
};
|
|
3253
|
+
}, Sa = (e) => {
|
|
3254
|
+
const {
|
|
3255
|
+
antCls: n,
|
|
3256
|
+
componentCls: t,
|
|
3257
|
+
inputPaddingHorizontalBase: r,
|
|
3258
|
+
iconCls: a
|
|
3259
|
+
} = e;
|
|
3260
|
+
return {
|
|
3261
|
+
[t]: Object.assign(Object.assign({}, it(e)), {
|
|
3262
|
+
position: "relative",
|
|
3263
|
+
display: "inline-flex",
|
|
3264
|
+
cursor: "pointer",
|
|
3265
|
+
[`&:not(${t}-customize-input) ${t}-selector`]: Object.assign(Object.assign({}, ha(e)), ba(e)),
|
|
3266
|
+
// ======================== Selection ========================
|
|
3267
|
+
[`${t}-selection-item`]: Object.assign(Object.assign({
|
|
3268
|
+
flex: 1,
|
|
3269
|
+
fontWeight: "normal",
|
|
3270
|
+
position: "relative",
|
|
3271
|
+
userSelect: "none"
|
|
3272
|
+
}, Qn), {
|
|
3273
|
+
// https://github.com/ant-design/ant-design/issues/40421
|
|
3274
|
+
[`> ${n}-typography`]: {
|
|
3275
|
+
display: "inline"
|
|
3276
|
+
}
|
|
3277
|
+
}),
|
|
3278
|
+
// ======================= Placeholder =======================
|
|
3279
|
+
[`${t}-selection-placeholder`]: Object.assign(Object.assign({}, Qn), {
|
|
3280
|
+
flex: 1,
|
|
3281
|
+
color: e.colorTextPlaceholder,
|
|
3282
|
+
pointerEvents: "none"
|
|
3283
|
+
}),
|
|
3284
|
+
// ========================== Arrow ==========================
|
|
3285
|
+
[`${t}-arrow`]: Object.assign(Object.assign({}, At()), {
|
|
3286
|
+
position: "absolute",
|
|
3287
|
+
top: "50%",
|
|
3288
|
+
insetInlineStart: "auto",
|
|
3289
|
+
insetInlineEnd: r,
|
|
3290
|
+
height: e.fontSizeIcon,
|
|
3291
|
+
marginTop: e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),
|
|
3292
|
+
color: e.colorTextQuaternary,
|
|
3293
|
+
fontSize: e.fontSizeIcon,
|
|
3294
|
+
lineHeight: 1,
|
|
3295
|
+
textAlign: "center",
|
|
3296
|
+
pointerEvents: "none",
|
|
3297
|
+
display: "flex",
|
|
3298
|
+
alignItems: "center",
|
|
3299
|
+
transition: `opacity ${e.motionDurationSlow} ease`,
|
|
3300
|
+
[a]: {
|
|
3301
|
+
verticalAlign: "top",
|
|
3302
|
+
transition: `transform ${e.motionDurationSlow}`,
|
|
3303
|
+
"> svg": {
|
|
3304
|
+
verticalAlign: "top"
|
|
3305
|
+
},
|
|
3306
|
+
[`&:not(${t}-suffix)`]: {
|
|
3307
|
+
pointerEvents: "auto"
|
|
3308
|
+
}
|
|
3309
|
+
},
|
|
3310
|
+
[`${t}-disabled &`]: {
|
|
3311
|
+
cursor: "not-allowed"
|
|
3312
|
+
},
|
|
3313
|
+
"> *:not(:last-child)": {
|
|
3314
|
+
marginInlineEnd: 8
|
|
3315
|
+
// FIXME: magic
|
|
3316
|
+
}
|
|
3317
|
+
}),
|
|
3318
|
+
// ========================== Wrap ===========================
|
|
3319
|
+
[`${t}-selection-wrap`]: {
|
|
3320
|
+
display: "flex",
|
|
3321
|
+
width: "100%",
|
|
3322
|
+
position: "relative",
|
|
3323
|
+
minWidth: 0,
|
|
3324
|
+
// https://github.com/ant-design/ant-design/issues/51669
|
|
3325
|
+
"&:after": {
|
|
3326
|
+
content: '"\\a0"',
|
|
3327
|
+
width: 0,
|
|
3328
|
+
overflow: "hidden"
|
|
3329
|
+
}
|
|
3330
|
+
},
|
|
3331
|
+
// ========================= Prefix ==========================
|
|
3332
|
+
[`${t}-prefix`]: {
|
|
3333
|
+
flex: "none",
|
|
3334
|
+
marginInlineEnd: e.selectAffixPadding
|
|
3335
|
+
},
|
|
3336
|
+
// ========================== Clear ==========================
|
|
3337
|
+
[`${t}-clear`]: {
|
|
3338
|
+
position: "absolute",
|
|
3339
|
+
top: "50%",
|
|
3340
|
+
insetInlineStart: "auto",
|
|
3341
|
+
insetInlineEnd: r,
|
|
3342
|
+
zIndex: 1,
|
|
3343
|
+
display: "inline-block",
|
|
3344
|
+
width: e.fontSizeIcon,
|
|
3345
|
+
height: e.fontSizeIcon,
|
|
3346
|
+
marginTop: e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),
|
|
3347
|
+
color: e.colorTextQuaternary,
|
|
3348
|
+
fontSize: e.fontSizeIcon,
|
|
3349
|
+
fontStyle: "normal",
|
|
3350
|
+
lineHeight: 1,
|
|
3351
|
+
textAlign: "center",
|
|
3352
|
+
textTransform: "none",
|
|
3353
|
+
cursor: "pointer",
|
|
3354
|
+
opacity: 0,
|
|
3355
|
+
transition: `color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,
|
|
3356
|
+
textRendering: "auto",
|
|
3357
|
+
"&:before": {
|
|
3358
|
+
display: "block"
|
|
3359
|
+
},
|
|
3360
|
+
"&:hover": {
|
|
3361
|
+
color: e.colorTextTertiary
|
|
3362
|
+
}
|
|
3363
|
+
},
|
|
3364
|
+
[`&:hover ${t}-clear`]: {
|
|
3365
|
+
opacity: 1,
|
|
3366
|
+
background: e.colorBgBase,
|
|
3367
|
+
borderRadius: "50%"
|
|
3368
|
+
}
|
|
3369
|
+
}),
|
|
3370
|
+
// ========================= Feedback ==========================
|
|
3371
|
+
[`${t}-status`]: {
|
|
3372
|
+
"&-error, &-warning, &-success, &-validating": {
|
|
3373
|
+
[`&${t}-has-feedback`]: {
|
|
3374
|
+
[`${t}-clear`]: {
|
|
3375
|
+
insetInlineEnd: e.calc(r).add(e.fontSize).add(e.paddingXS).equal()
|
|
3376
|
+
}
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
};
|
|
3381
|
+
}, wa = (e) => {
|
|
3382
|
+
const {
|
|
3383
|
+
componentCls: n
|
|
3384
|
+
} = e;
|
|
3385
|
+
return [
|
|
3386
|
+
{
|
|
3387
|
+
[n]: {
|
|
3388
|
+
// ==================== In Form ====================
|
|
3389
|
+
[`&${n}-in-form-item`]: {
|
|
3390
|
+
width: "100%"
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
},
|
|
3394
|
+
// =====================================================
|
|
3395
|
+
// == LTR ==
|
|
3396
|
+
// =====================================================
|
|
3397
|
+
// Base
|
|
3398
|
+
Sa(e),
|
|
3399
|
+
// Single
|
|
3400
|
+
da(e),
|
|
3401
|
+
// Multiple
|
|
3402
|
+
sa(e),
|
|
3403
|
+
// Dropdown
|
|
3404
|
+
aa(e),
|
|
3405
|
+
// =====================================================
|
|
3406
|
+
// == RTL ==
|
|
3407
|
+
// =====================================================
|
|
3408
|
+
{
|
|
3409
|
+
[`${n}-rtl`]: {
|
|
3410
|
+
direction: "rtl"
|
|
3411
|
+
}
|
|
3412
|
+
},
|
|
3413
|
+
// =====================================================
|
|
3414
|
+
// == Space Compact ==
|
|
3415
|
+
// =====================================================
|
|
3416
|
+
Kr(e, {
|
|
3417
|
+
borderElCls: `${n}-selector`,
|
|
3418
|
+
focusElCls: `${n}-focused`
|
|
3419
|
+
})
|
|
3420
|
+
];
|
|
3421
|
+
}, Ca = zt("Select", (e, n) => {
|
|
3422
|
+
let {
|
|
3423
|
+
rootPrefixCls: t
|
|
3424
|
+
} = n;
|
|
3425
|
+
const r = Mn(e, {
|
|
3426
|
+
rootPrefixCls: t,
|
|
3427
|
+
inputPaddingHorizontalBase: e.calc(e.paddingSM).sub(1).equal(),
|
|
3428
|
+
multipleSelectItemHeight: e.multipleItemHeight,
|
|
3429
|
+
selectHeight: e.controlHeight
|
|
3430
|
+
});
|
|
3431
|
+
return [wa(r), pa(r)];
|
|
3432
|
+
}, fa, {
|
|
3433
|
+
unitless: {
|
|
3434
|
+
optionLineHeight: !0,
|
|
3435
|
+
optionSelectedFontWeight: !0
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
function ya(e) {
|
|
3439
|
+
let {
|
|
3440
|
+
suffixIcon: n,
|
|
3441
|
+
clearIcon: t,
|
|
3442
|
+
menuItemSelectedIcon: r,
|
|
3443
|
+
removeIcon: a,
|
|
3444
|
+
loading: i,
|
|
3445
|
+
multiple: l,
|
|
3446
|
+
hasFeedback: u,
|
|
3447
|
+
prefixCls: d,
|
|
3448
|
+
showSuffixIcon: f,
|
|
3449
|
+
feedbackIcon: v,
|
|
3450
|
+
showArrow: s,
|
|
3451
|
+
componentName: b
|
|
3452
|
+
} = e;
|
|
3453
|
+
process.env.NODE_ENV !== "production" && at(b).deprecated(!t, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
|
|
3454
|
+
const c = t ?? /* @__PURE__ */ o.createElement(Ur, null), g = (h) => n === null && !u && !s ? null : /* @__PURE__ */ o.createElement(o.Fragment, null, f !== !1 && h, u && v);
|
|
3455
|
+
let m = null;
|
|
3456
|
+
if (n !== void 0)
|
|
3457
|
+
m = g(n);
|
|
3458
|
+
else if (i)
|
|
3459
|
+
m = g(/* @__PURE__ */ o.createElement(Yr, {
|
|
3460
|
+
spin: !0
|
|
3461
|
+
}));
|
|
3462
|
+
else {
|
|
3463
|
+
const h = `${d}-suffix`;
|
|
3464
|
+
m = (E) => {
|
|
3465
|
+
let {
|
|
3466
|
+
open: C,
|
|
3467
|
+
showSearch: T
|
|
3468
|
+
} = E;
|
|
3469
|
+
return g(C && T ? /* @__PURE__ */ o.createElement(qr, {
|
|
3470
|
+
className: h
|
|
3471
|
+
}) : /* @__PURE__ */ o.createElement(Lr, {
|
|
3472
|
+
className: h
|
|
3473
|
+
}));
|
|
3474
|
+
};
|
|
3475
|
+
}
|
|
3476
|
+
let S = null;
|
|
3477
|
+
r !== void 0 ? S = r : l ? S = /* @__PURE__ */ o.createElement(Xr, null) : S = null;
|
|
3478
|
+
let w = null;
|
|
3479
|
+
return a !== void 0 ? w = a : w = /* @__PURE__ */ o.createElement(Gr, null), {
|
|
3480
|
+
clearIcon: c,
|
|
3481
|
+
suffixIcon: m,
|
|
3482
|
+
itemIcon: S,
|
|
3483
|
+
removeIcon: w
|
|
3484
|
+
};
|
|
3485
|
+
}
|
|
3486
|
+
function Ea(e, n) {
|
|
3487
|
+
return n !== void 0 ? n : e !== null;
|
|
3488
|
+
}
|
|
3489
|
+
var Ia = function(e, n) {
|
|
3490
|
+
var t = {};
|
|
3491
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
3492
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
|
|
3493
|
+
n.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (t[r[a]] = e[r[a]]);
|
|
3494
|
+
return t;
|
|
3495
|
+
};
|
|
3496
|
+
const lr = "SECRET_COMBOBOX_MODE_DO_NOT_USE", ur = (e, n) => {
|
|
3497
|
+
var t;
|
|
3498
|
+
const {
|
|
3499
|
+
prefixCls: r,
|
|
3500
|
+
bordered: a,
|
|
3501
|
+
className: i,
|
|
3502
|
+
rootClassName: l,
|
|
3503
|
+
getPopupContainer: u,
|
|
3504
|
+
popupClassName: d,
|
|
3505
|
+
dropdownClassName: f,
|
|
3506
|
+
listHeight: v = 256,
|
|
3507
|
+
placement: s,
|
|
3508
|
+
listItemHeight: b,
|
|
3509
|
+
size: c,
|
|
3510
|
+
disabled: g,
|
|
3511
|
+
notFoundContent: m,
|
|
3512
|
+
status: S,
|
|
3513
|
+
builtinPlacements: w,
|
|
3514
|
+
dropdownMatchSelectWidth: h,
|
|
3515
|
+
popupMatchSelectWidth: E,
|
|
3516
|
+
direction: C,
|
|
3517
|
+
style: T,
|
|
3518
|
+
allowClear: p,
|
|
3519
|
+
variant: I,
|
|
3520
|
+
dropdownStyle: B,
|
|
3521
|
+
transitionName: z,
|
|
3522
|
+
tagRender: q,
|
|
3523
|
+
maxCount: _,
|
|
3524
|
+
prefix: F
|
|
3525
|
+
} = e, U = Ia(e, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount", "prefix"]), {
|
|
3526
|
+
getPopupContainer: Q,
|
|
3527
|
+
getPrefixCls: G,
|
|
3528
|
+
renderEmpty: j,
|
|
3529
|
+
direction: ne,
|
|
3530
|
+
virtual: Z,
|
|
3531
|
+
popupMatchSelectWidth: Y,
|
|
3532
|
+
popupOverflow: x,
|
|
3533
|
+
select: M
|
|
3534
|
+
} = o.useContext(ot), [, fe] = rt(), ie = b ?? (fe == null ? void 0 : fe.controlHeight), J = G("select", r), se = G(), Ce = C ?? ne, {
|
|
3535
|
+
compactSize: ge,
|
|
3536
|
+
compactItemClassnames: Oe
|
|
3537
|
+
} = Wr(J, Ce), [ce, pe] = Br("select", I, a), O = Ar(J), [y, D, K] = Ca(J, O), R = o.useMemo(() => {
|
|
3538
|
+
const {
|
|
3539
|
+
mode: _e
|
|
3540
|
+
} = e;
|
|
3541
|
+
if (_e !== "combobox")
|
|
3542
|
+
return _e === lr ? "combobox" : _e;
|
|
3543
|
+
}, [e.mode]), A = R === "multiple" || R === "tags", le = Ea(e.suffixIcon, e.showArrow), me = (t = E ?? h) !== null && t !== void 0 ? t : Y, {
|
|
3544
|
+
status: re,
|
|
3545
|
+
hasFeedback: we,
|
|
3546
|
+
isFormItemInput: Be,
|
|
3547
|
+
feedbackIcon: xe
|
|
3548
|
+
} = o.useContext(jr), Ne = zr(re, S);
|
|
3549
|
+
let de;
|
|
3550
|
+
m !== void 0 ? de = m : R === "combobox" ? de = null : de = (j == null ? void 0 : j("Select")) || /* @__PURE__ */ o.createElement(ta, {
|
|
3551
|
+
componentName: "Select"
|
|
3552
|
+
});
|
|
3553
|
+
const {
|
|
3554
|
+
suffixIcon: Ge,
|
|
3555
|
+
itemIcon: Ye,
|
|
3556
|
+
removeIcon: Se,
|
|
3557
|
+
clearIcon: $e
|
|
3558
|
+
} = ya(Object.assign(Object.assign({}, U), {
|
|
3559
|
+
multiple: A,
|
|
3560
|
+
hasFeedback: we,
|
|
3561
|
+
feedbackIcon: xe,
|
|
3562
|
+
showSuffixIcon: le,
|
|
3563
|
+
prefixCls: J,
|
|
3564
|
+
componentName: "Select"
|
|
3565
|
+
})), ye = p === !0 ? {
|
|
3566
|
+
clearIcon: $e
|
|
3567
|
+
} : p, Re = Ft(U, ["suffixIcon", "itemIcon"]), Pe = Ve(d || f, {
|
|
3568
|
+
[`${J}-dropdown-${Ce}`]: Ce === "rtl"
|
|
3569
|
+
}, l, K, O, D), en = Fr((_e) => {
|
|
3570
|
+
var De;
|
|
3571
|
+
return (De = c ?? ge) !== null && De !== void 0 ? De : _e;
|
|
3572
|
+
}), je = o.useContext(xr), Ae = g ?? je, Ee = Ve({
|
|
3573
|
+
[`${J}-lg`]: en === "large",
|
|
3574
|
+
[`${J}-sm`]: en === "small",
|
|
3575
|
+
[`${J}-rtl`]: Ce === "rtl",
|
|
3576
|
+
[`${J}-${ce}`]: pe,
|
|
3577
|
+
[`${J}-in-form-item`]: Be
|
|
3578
|
+
}, Vr(J, Ne, we), Oe, M == null ? void 0 : M.className, i, l, K, O, D), hn = o.useMemo(() => s !== void 0 ? s : Ce === "rtl" ? "bottomRight" : "bottomLeft", [s, Ce]);
|
|
3579
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3580
|
+
const _e = at("Select");
|
|
3581
|
+
_e.deprecated(!f, "dropdownClassName", "popupClassName"), _e.deprecated(h === void 0, "dropdownMatchSelectWidth", "popupMatchSelectWidth"), process.env.NODE_ENV !== "production" && _e(!("showArrow" in e), "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null."), _e.deprecated(!("bordered" in e), "bordered", "variant"), process.env.NODE_ENV !== "production" && _e(!(typeof _ < "u" && !A), "usage", "`maxCount` only works with mode `multiple` or `tags`");
|
|
3582
|
+
}
|
|
3583
|
+
const [Fe] = Tr("SelectLike", B == null ? void 0 : B.zIndex);
|
|
3584
|
+
return y(/* @__PURE__ */ o.createElement(vt, Object.assign({
|
|
3585
|
+
ref: n,
|
|
3586
|
+
virtual: Z,
|
|
3587
|
+
showSearch: M == null ? void 0 : M.showSearch
|
|
3588
|
+
}, Re, {
|
|
3589
|
+
style: Object.assign(Object.assign({}, M == null ? void 0 : M.style), T),
|
|
3590
|
+
dropdownMatchSelectWidth: me,
|
|
3591
|
+
transitionName: $r(se, "slide-up", z),
|
|
3592
|
+
builtinPlacements: oa(w, x),
|
|
3593
|
+
listHeight: v,
|
|
3594
|
+
listItemHeight: ie,
|
|
3595
|
+
mode: R,
|
|
3596
|
+
prefixCls: J,
|
|
3597
|
+
placement: hn,
|
|
3598
|
+
direction: Ce,
|
|
3599
|
+
prefix: F,
|
|
3600
|
+
suffixIcon: Ge,
|
|
3601
|
+
menuItemSelectedIcon: Ye,
|
|
3602
|
+
removeIcon: Se,
|
|
3603
|
+
allowClear: ye,
|
|
3604
|
+
notFoundContent: de,
|
|
3605
|
+
className: Ee,
|
|
3606
|
+
getPopupContainer: u || Q,
|
|
3607
|
+
dropdownClassName: Pe,
|
|
3608
|
+
disabled: Ae,
|
|
3609
|
+
dropdownStyle: Object.assign(Object.assign({}, B), {
|
|
3610
|
+
zIndex: Fe
|
|
3611
|
+
}),
|
|
3612
|
+
maxCount: A ? _ : void 0,
|
|
3613
|
+
tagRender: A ? q : void 0
|
|
3614
|
+
})));
|
|
3615
|
+
};
|
|
3616
|
+
process.env.NODE_ENV !== "production" && (ur.displayName = "Select");
|
|
3617
|
+
const Dn = /* @__PURE__ */ o.forwardRef(ur), xa = Hr(Dn, "dropdownAlign");
|
|
3618
|
+
Dn.SECRET_COMBOBOX_MODE_DO_NOT_USE = lr;
|
|
3619
|
+
Dn.Option = ft;
|
|
3620
|
+
Dn.OptGroup = dt;
|
|
3621
|
+
Dn._InternalPanelDoNotUseOrYouWillBeFired = xa;
|
|
3622
|
+
process.env.NODE_ENV !== "production" && (Dn.displayName = "Select");
|
|
3623
|
+
export {
|
|
3624
|
+
ta as D,
|
|
3625
|
+
gn as E,
|
|
3626
|
+
Jt as L,
|
|
3627
|
+
Dn as S
|
|
3628
|
+
};
|