@gobolt/genesis 0.0.10 → 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 +26 -15
- 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
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import { E as lr, a0 as fr, a1 as Ye, a2 as cr, x as O, _ as Be, d as Ze, e as oe, a3 as q, f as le, a4 as ie, U as Q, W as B, $ as Le } from "./index-oK7z6jnz.js";
|
|
2
1
|
import * as E from "react";
|
|
3
|
-
import { useRef as we, useState as
|
|
4
|
-
import { w as D,
|
|
5
|
-
import { _ as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var X = "RC_FORM_INTERNAL_HOOKS", S = function() {
|
|
2
|
+
import { useRef as we, useState as lr, useMemo as fr, useContext as cr, useEffect as dr } from "react";
|
|
3
|
+
import { w as D, f as W, _ as x, b as d, g as Ae, d as Ye, a as ue } from "./presets-Djh_L_6R.js";
|
|
4
|
+
import { _ as oe, a as Y } from "./asyncToGenerator-CKP9bEZn.js";
|
|
5
|
+
import { a3 as gr, a4 as Be, a5 as vr, h as k, v as Ze, w as Xe, d as le, a6 as q, _ as fe, a7 as ie, X, Y as B, $ as Le } from "./index-ByspLxrB.js";
|
|
6
|
+
import { t as hr } from "./toArray-DGvPoJP_.js";
|
|
7
|
+
import { o as mr } from "./omit-B_u6A-HL.js";
|
|
8
|
+
var Q = "RC_FORM_INTERNAL_HOOKS", I = function() {
|
|
11
9
|
D(!1, "Can not find FormContext. Please make sure you wrap Field under Form.");
|
|
12
10
|
}, ne = /* @__PURE__ */ E.createContext({
|
|
13
|
-
getFieldValue:
|
|
14
|
-
getFieldsValue:
|
|
15
|
-
getFieldError:
|
|
16
|
-
getFieldWarning:
|
|
17
|
-
getFieldsError:
|
|
18
|
-
isFieldsTouched:
|
|
19
|
-
isFieldTouched:
|
|
20
|
-
isFieldValidating:
|
|
21
|
-
isFieldsValidating:
|
|
22
|
-
resetFields:
|
|
23
|
-
setFields:
|
|
24
|
-
setFieldValue:
|
|
25
|
-
setFieldsValue:
|
|
26
|
-
validateFields:
|
|
27
|
-
submit:
|
|
11
|
+
getFieldValue: I,
|
|
12
|
+
getFieldsValue: I,
|
|
13
|
+
getFieldError: I,
|
|
14
|
+
getFieldWarning: I,
|
|
15
|
+
getFieldsError: I,
|
|
16
|
+
isFieldsTouched: I,
|
|
17
|
+
isFieldTouched: I,
|
|
18
|
+
isFieldValidating: I,
|
|
19
|
+
isFieldsValidating: I,
|
|
20
|
+
resetFields: I,
|
|
21
|
+
setFields: I,
|
|
22
|
+
setFieldValue: I,
|
|
23
|
+
setFieldsValue: I,
|
|
24
|
+
validateFields: I,
|
|
25
|
+
submit: I,
|
|
28
26
|
getInternalHooks: function() {
|
|
29
|
-
return
|
|
30
|
-
dispatch:
|
|
31
|
-
initEntityValue:
|
|
32
|
-
registerField:
|
|
33
|
-
useSubscribe:
|
|
34
|
-
setInitialValues:
|
|
35
|
-
destroyForm:
|
|
36
|
-
setCallbacks:
|
|
37
|
-
registerWatch:
|
|
38
|
-
getFields:
|
|
39
|
-
setValidateMessages:
|
|
40
|
-
setPreserve:
|
|
41
|
-
getInitialValue:
|
|
27
|
+
return I(), {
|
|
28
|
+
dispatch: I,
|
|
29
|
+
initEntityValue: I,
|
|
30
|
+
registerField: I,
|
|
31
|
+
useSubscribe: I,
|
|
32
|
+
setInitialValues: I,
|
|
33
|
+
destroyForm: I,
|
|
34
|
+
setCallbacks: I,
|
|
35
|
+
registerWatch: I,
|
|
36
|
+
getFields: I,
|
|
37
|
+
setValidateMessages: I,
|
|
38
|
+
setPreserve: I,
|
|
39
|
+
getInitialValue: I
|
|
42
40
|
};
|
|
43
41
|
}
|
|
44
42
|
}), he = /* @__PURE__ */ E.createContext(null);
|
|
45
43
|
function Ve(s) {
|
|
46
44
|
return s == null ? [] : Array.isArray(s) ? s : [s];
|
|
47
45
|
}
|
|
48
|
-
function
|
|
46
|
+
function pr(s) {
|
|
49
47
|
return s && !!s._init;
|
|
50
48
|
}
|
|
51
49
|
function Ee() {
|
|
@@ -102,31 +100,31 @@ function Ee() {
|
|
|
102
100
|
};
|
|
103
101
|
}
|
|
104
102
|
var be = Ee();
|
|
105
|
-
function
|
|
103
|
+
function Fr(s) {
|
|
106
104
|
try {
|
|
107
105
|
return Function.toString.call(s).indexOf("[native code]") !== -1;
|
|
108
106
|
} catch {
|
|
109
107
|
return typeof s == "function";
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
|
-
function
|
|
113
|
-
if (
|
|
110
|
+
function yr(s, t, e) {
|
|
111
|
+
if (gr()) return Reflect.construct.apply(null, arguments);
|
|
114
112
|
var n = [null];
|
|
115
113
|
n.push.apply(n, t);
|
|
116
114
|
var r = new (s.bind.apply(s, n))();
|
|
117
|
-
return e &&
|
|
115
|
+
return e && Be(r, e.prototype), r;
|
|
118
116
|
}
|
|
119
117
|
function Pe(s) {
|
|
120
118
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
121
119
|
return Pe = function(n) {
|
|
122
|
-
if (n === null || !
|
|
120
|
+
if (n === null || !Fr(n)) return n;
|
|
123
121
|
if (typeof n != "function") throw new TypeError("Super expression must either be null or a function");
|
|
124
122
|
if (t !== void 0) {
|
|
125
123
|
if (t.has(n)) return t.get(n);
|
|
126
124
|
t.set(n, r);
|
|
127
125
|
}
|
|
128
126
|
function r() {
|
|
129
|
-
return
|
|
127
|
+
return yr(n, arguments, vr(this).constructor);
|
|
130
128
|
}
|
|
131
129
|
return r.prototype = Object.create(n.prototype, {
|
|
132
130
|
constructor: {
|
|
@@ -135,12 +133,12 @@ function Pe(s) {
|
|
|
135
133
|
writable: !0,
|
|
136
134
|
configurable: !0
|
|
137
135
|
}
|
|
138
|
-
}),
|
|
136
|
+
}), Be(r, n);
|
|
139
137
|
}, Pe(s);
|
|
140
138
|
}
|
|
141
|
-
var
|
|
139
|
+
var wr = /%[sdj%]/g, Qe = function() {
|
|
142
140
|
};
|
|
143
|
-
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (
|
|
141
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Qe = function(t, e) {
|
|
144
142
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(n) {
|
|
145
143
|
return typeof n == "string";
|
|
146
144
|
}) && console.warn(t, e);
|
|
@@ -160,7 +158,7 @@ function H(s) {
|
|
|
160
158
|
if (typeof s == "function")
|
|
161
159
|
return s.apply(null, e);
|
|
162
160
|
if (typeof s == "string") {
|
|
163
|
-
var a = s.replace(
|
|
161
|
+
var a = s.replace(wr, function(u) {
|
|
164
162
|
if (u === "%%")
|
|
165
163
|
return "%";
|
|
166
164
|
if (r >= i)
|
|
@@ -185,16 +183,16 @@ function H(s) {
|
|
|
185
183
|
}
|
|
186
184
|
return s;
|
|
187
185
|
}
|
|
188
|
-
function
|
|
186
|
+
function Vr(s) {
|
|
189
187
|
return s === "string" || s === "url" || s === "hex" || s === "email" || s === "date" || s === "pattern";
|
|
190
188
|
}
|
|
191
189
|
function j(s, t) {
|
|
192
|
-
return !!(s == null || t === "array" && Array.isArray(s) && !s.length ||
|
|
190
|
+
return !!(s == null || t === "array" && Array.isArray(s) && !s.length || Vr(t) && typeof s == "string" && !s);
|
|
193
191
|
}
|
|
194
|
-
function
|
|
192
|
+
function Er(s, t, e) {
|
|
195
193
|
var n = [], r = 0, i = s.length;
|
|
196
194
|
function a(u) {
|
|
197
|
-
n.push.apply(n,
|
|
195
|
+
n.push.apply(n, k(u || [])), r++, r === i && e(n);
|
|
198
196
|
}
|
|
199
197
|
s.forEach(function(u) {
|
|
200
198
|
t(u, a);
|
|
@@ -212,27 +210,27 @@ function je(s, t, e) {
|
|
|
212
210
|
}
|
|
213
211
|
i([]);
|
|
214
212
|
}
|
|
215
|
-
function
|
|
213
|
+
function br(s) {
|
|
216
214
|
var t = [];
|
|
217
215
|
return Object.keys(s).forEach(function(e) {
|
|
218
|
-
t.push.apply(t,
|
|
216
|
+
t.push.apply(t, k(s[e] || []));
|
|
219
217
|
}), t;
|
|
220
218
|
}
|
|
221
219
|
var De = /* @__PURE__ */ function(s) {
|
|
222
|
-
|
|
223
|
-
var t =
|
|
220
|
+
Ze(e, s);
|
|
221
|
+
var t = Xe(e);
|
|
224
222
|
function e(n, r) {
|
|
225
223
|
var i;
|
|
226
|
-
return
|
|
224
|
+
return le(this, e), i = t.call(this, "Async Validation Error"), d(q(i), "errors", void 0), d(q(i), "fields", void 0), i.errors = n, i.fields = r, i;
|
|
227
225
|
}
|
|
228
|
-
return
|
|
226
|
+
return fe(e);
|
|
229
227
|
}(/* @__PURE__ */ Pe(Error));
|
|
230
|
-
function
|
|
228
|
+
function Pr(s, t, e, n, r) {
|
|
231
229
|
if (t.first) {
|
|
232
230
|
var i = new Promise(function(h, b) {
|
|
233
231
|
var p = function(F) {
|
|
234
232
|
return n(F), F.length ? b(new De(F, Ce(F))) : h(r);
|
|
235
|
-
}, m =
|
|
233
|
+
}, m = br(s);
|
|
236
234
|
je(m, e, p);
|
|
237
235
|
});
|
|
238
236
|
return i.catch(function(h) {
|
|
@@ -246,14 +244,14 @@ function Cr(s, t, e, n, r) {
|
|
|
246
244
|
};
|
|
247
245
|
u.length || (n(o), h(r)), u.forEach(function(m) {
|
|
248
246
|
var c = s[m];
|
|
249
|
-
a.indexOf(m) !== -1 ? je(c, e, p) :
|
|
247
|
+
a.indexOf(m) !== -1 ? je(c, e, p) : Er(c, e, p);
|
|
250
248
|
});
|
|
251
249
|
});
|
|
252
250
|
return g.catch(function(h) {
|
|
253
251
|
return h;
|
|
254
252
|
}), g;
|
|
255
253
|
}
|
|
256
|
-
function
|
|
254
|
+
function Cr(s) {
|
|
257
255
|
return !!(s && s.message !== void 0);
|
|
258
256
|
}
|
|
259
257
|
function Nr(s, t) {
|
|
@@ -267,7 +265,7 @@ function Nr(s, t) {
|
|
|
267
265
|
function _e(s, t) {
|
|
268
266
|
return function(e) {
|
|
269
267
|
var n;
|
|
270
|
-
return s.fullFields ? n = Nr(t, s.fullFields) : n = t[e.field || s.fullField],
|
|
268
|
+
return s.fullFields ? n = Nr(t, s.fullFields) : n = t[e.field || s.fullField], Cr(e) ? (e.field = e.field || s.fullField, e.fieldValue = n, e) : {
|
|
271
269
|
message: typeof e == "function" ? e() : e,
|
|
272
270
|
fieldValue: n,
|
|
273
271
|
field: e.field || s.fullField
|
|
@@ -279,14 +277,14 @@ function We(s, t) {
|
|
|
279
277
|
for (var e in t)
|
|
280
278
|
if (t.hasOwnProperty(e)) {
|
|
281
279
|
var n = t[e];
|
|
282
|
-
W(n) === "object" && W(s[e]) === "object" ? s[e] =
|
|
280
|
+
W(n) === "object" && W(s[e]) === "object" ? s[e] = x(x({}, s[e]), n) : s[e] = n;
|
|
283
281
|
}
|
|
284
282
|
}
|
|
285
283
|
return s;
|
|
286
284
|
}
|
|
287
|
-
var ee = "enum",
|
|
285
|
+
var ee = "enum", xr = function(t, e, n, r, i) {
|
|
288
286
|
t[ee] = Array.isArray(t[ee]) ? t[ee] : [], t[ee].indexOf(e) === -1 && r.push(H(i.messages[ee], t.fullField, t[ee].join(", ")));
|
|
289
|
-
},
|
|
287
|
+
}, Rr = function(t, e, n, r, i) {
|
|
290
288
|
if (t.pattern) {
|
|
291
289
|
if (t.pattern instanceof RegExp)
|
|
292
290
|
t.pattern.lastIndex = 0, t.pattern.test(e) || r.push(H(i.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
@@ -303,7 +301,7 @@ var ee = "enum", Rr = function(t, e, n, r, i) {
|
|
|
303
301
|
}, er = function(t, e, n, r, i, a) {
|
|
304
302
|
t.required && (!n.hasOwnProperty(t.field) || j(e, a || t.type)) && r.push(H(i.messages.required, t.fullField));
|
|
305
303
|
}, ve;
|
|
306
|
-
const
|
|
304
|
+
const kr = function() {
|
|
307
305
|
if (ve)
|
|
308
306
|
return ve;
|
|
309
307
|
var s = "[a-fA-F\\d:]", t = function(A) {
|
|
@@ -379,30 +377,30 @@ var Ue = {
|
|
|
379
377
|
return typeof t == "string" && t.length <= 320 && !!t.match(Ue.email);
|
|
380
378
|
},
|
|
381
379
|
url: function(t) {
|
|
382
|
-
return typeof t == "string" && t.length <= 2048 && !!t.match(
|
|
380
|
+
return typeof t == "string" && t.length <= 2048 && !!t.match(kr());
|
|
383
381
|
},
|
|
384
382
|
hex: function(t) {
|
|
385
383
|
return typeof t == "string" && !!t.match(Ue.hex);
|
|
386
384
|
}
|
|
387
|
-
},
|
|
385
|
+
}, $r = function(t, e, n, r, i) {
|
|
388
386
|
if (t.required && e === void 0) {
|
|
389
387
|
er(t, e, n, r, i);
|
|
390
388
|
return;
|
|
391
389
|
}
|
|
392
390
|
var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], u = t.type;
|
|
393
391
|
a.indexOf(u) > -1 ? ae[u](e) || r.push(H(i.messages.types[u], t.fullField, t.type)) : u && W(e) !== t.type && r.push(H(i.messages.types[u], t.fullField, t.type));
|
|
394
|
-
},
|
|
392
|
+
}, Ar = function(t, e, n, r, i) {
|
|
395
393
|
(/^\s+$/.test(e) || e === "") && r.push(H(i.messages.whitespace, t.fullField));
|
|
396
394
|
};
|
|
397
395
|
const $ = {
|
|
398
396
|
required: er,
|
|
399
|
-
whitespace:
|
|
400
|
-
type:
|
|
397
|
+
whitespace: Ar,
|
|
398
|
+
type: $r,
|
|
401
399
|
range: Or,
|
|
402
|
-
enum:
|
|
403
|
-
pattern:
|
|
400
|
+
enum: xr,
|
|
401
|
+
pattern: Rr
|
|
404
402
|
};
|
|
405
|
-
var
|
|
403
|
+
var qr = function(t, e, n, r, i) {
|
|
406
404
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
407
405
|
if (u) {
|
|
408
406
|
if (j(e) && !t.required)
|
|
@@ -410,7 +408,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
410
408
|
$.required(t, e, r, a, i);
|
|
411
409
|
}
|
|
412
410
|
n(a);
|
|
413
|
-
},
|
|
411
|
+
}, Mr = function(t, e, n, r, i) {
|
|
414
412
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
415
413
|
if (u) {
|
|
416
414
|
if (e == null && !t.required)
|
|
@@ -426,7 +424,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
426
424
|
$.required(t, e, r, a, i), e !== void 0 && $.type(t, e, r, a, i);
|
|
427
425
|
}
|
|
428
426
|
n(a);
|
|
429
|
-
},
|
|
427
|
+
}, Sr = function(t, e, n, r, i) {
|
|
430
428
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
431
429
|
if (u) {
|
|
432
430
|
if (j(e, "date") && !t.required)
|
|
@@ -437,15 +435,15 @@ var Mr = function(t, e, n, r, i) {
|
|
|
437
435
|
}
|
|
438
436
|
}
|
|
439
437
|
n(a);
|
|
440
|
-
},
|
|
438
|
+
}, Tr = "enum", Lr = function(t, e, n, r, i) {
|
|
441
439
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
442
440
|
if (u) {
|
|
443
441
|
if (j(e) && !t.required)
|
|
444
442
|
return n();
|
|
445
|
-
$.required(t, e, r, a, i), e !== void 0 && $[
|
|
443
|
+
$.required(t, e, r, a, i), e !== void 0 && $[Tr](t, e, r, a, i);
|
|
446
444
|
}
|
|
447
445
|
n(a);
|
|
448
|
-
},
|
|
446
|
+
}, jr = function(t, e, n, r, i) {
|
|
449
447
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
450
448
|
if (u) {
|
|
451
449
|
if (j(e) && !t.required)
|
|
@@ -453,7 +451,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
453
451
|
$.required(t, e, r, a, i), e !== void 0 && ($.type(t, e, r, a, i), $.range(t, e, r, a, i));
|
|
454
452
|
}
|
|
455
453
|
n(a);
|
|
456
|
-
},
|
|
454
|
+
}, Dr = function(t, e, n, r, i) {
|
|
457
455
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
458
456
|
if (u) {
|
|
459
457
|
if (j(e) && !t.required)
|
|
@@ -461,7 +459,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
461
459
|
$.required(t, e, r, a, i), e !== void 0 && ($.type(t, e, r, a, i), $.range(t, e, r, a, i));
|
|
462
460
|
}
|
|
463
461
|
n(a);
|
|
464
|
-
},
|
|
462
|
+
}, _r = function(t, e, n, r, i) {
|
|
465
463
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
466
464
|
if (u) {
|
|
467
465
|
if (j(e) && !t.required)
|
|
@@ -469,7 +467,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
469
467
|
$.required(t, e, r, a, i), e !== void 0 && $.type(t, e, r, a, i);
|
|
470
468
|
}
|
|
471
469
|
n(a);
|
|
472
|
-
},
|
|
470
|
+
}, Wr = function(t, e, n, r, i) {
|
|
473
471
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
474
472
|
if (u) {
|
|
475
473
|
if (e === "" && (e = void 0), j(e) && !t.required)
|
|
@@ -477,7 +475,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
477
475
|
$.required(t, e, r, a, i), e !== void 0 && ($.type(t, e, r, a, i), $.range(t, e, r, a, i));
|
|
478
476
|
}
|
|
479
477
|
n(a);
|
|
480
|
-
},
|
|
478
|
+
}, Ur = function(t, e, n, r, i) {
|
|
481
479
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
482
480
|
if (u) {
|
|
483
481
|
if (j(e) && !t.required)
|
|
@@ -485,7 +483,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
485
483
|
$.required(t, e, r, a, i), e !== void 0 && $.type(t, e, r, a, i);
|
|
486
484
|
}
|
|
487
485
|
n(a);
|
|
488
|
-
},
|
|
486
|
+
}, Hr = function(t, e, n, r, i) {
|
|
489
487
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
490
488
|
if (u) {
|
|
491
489
|
if (j(e, "string") && !t.required)
|
|
@@ -493,7 +491,7 @@ var Mr = function(t, e, n, r, i) {
|
|
|
493
491
|
$.required(t, e, r, a, i), j(e, "string") || $.pattern(t, e, r, a, i);
|
|
494
492
|
}
|
|
495
493
|
n(a);
|
|
496
|
-
},
|
|
494
|
+
}, Kr = function(t, e, n, r, i) {
|
|
497
495
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
498
496
|
if (u) {
|
|
499
497
|
if (j(e) && !t.required)
|
|
@@ -501,10 +499,10 @@ var Mr = function(t, e, n, r, i) {
|
|
|
501
499
|
$.required(t, e, r, a, i), j(e) || $.type(t, e, r, a, i);
|
|
502
500
|
}
|
|
503
501
|
n(a);
|
|
504
|
-
},
|
|
502
|
+
}, zr = function(t, e, n, r, i) {
|
|
505
503
|
var a = [], u = Array.isArray(e) ? "array" : W(e);
|
|
506
504
|
$.required(t, e, r, a, i, u), n(a);
|
|
507
|
-
},
|
|
505
|
+
}, Gr = function(t, e, n, r, i) {
|
|
508
506
|
var a = [], u = t.required || !t.required && r.hasOwnProperty(t.field);
|
|
509
507
|
if (u) {
|
|
510
508
|
if (j(e, "string") && !t.required)
|
|
@@ -522,29 +520,29 @@ var Mr = function(t, e, n, r, i) {
|
|
|
522
520
|
n(u);
|
|
523
521
|
};
|
|
524
522
|
const se = {
|
|
525
|
-
string:
|
|
526
|
-
method:
|
|
527
|
-
number:
|
|
523
|
+
string: Gr,
|
|
524
|
+
method: _r,
|
|
525
|
+
number: Wr,
|
|
528
526
|
boolean: Ir,
|
|
529
|
-
regexp:
|
|
530
|
-
integer:
|
|
531
|
-
float:
|
|
532
|
-
array:
|
|
533
|
-
object:
|
|
534
|
-
enum:
|
|
535
|
-
pattern:
|
|
536
|
-
date:
|
|
527
|
+
regexp: Kr,
|
|
528
|
+
integer: Dr,
|
|
529
|
+
float: jr,
|
|
530
|
+
array: Mr,
|
|
531
|
+
object: Ur,
|
|
532
|
+
enum: Lr,
|
|
533
|
+
pattern: Hr,
|
|
534
|
+
date: Sr,
|
|
537
535
|
url: pe,
|
|
538
536
|
hex: pe,
|
|
539
537
|
email: pe,
|
|
540
|
-
required:
|
|
541
|
-
any:
|
|
538
|
+
required: zr,
|
|
539
|
+
any: qr
|
|
542
540
|
};
|
|
543
541
|
var ce = /* @__PURE__ */ function() {
|
|
544
542
|
function s(t) {
|
|
545
|
-
|
|
543
|
+
le(this, s), d(this, "rules", null), d(this, "_messages", be), this.define(t);
|
|
546
544
|
}
|
|
547
|
-
return
|
|
545
|
+
return fe(s, [{
|
|
548
546
|
key: "define",
|
|
549
547
|
value: function(e) {
|
|
550
548
|
var n = this;
|
|
@@ -574,7 +572,7 @@ var ce = /* @__PURE__ */ function() {
|
|
|
574
572
|
function F(y) {
|
|
575
573
|
if (Array.isArray(y)) {
|
|
576
574
|
var C;
|
|
577
|
-
m = (C = m).concat.apply(C,
|
|
575
|
+
m = (C = m).concat.apply(C, k(y));
|
|
578
576
|
} else
|
|
579
577
|
m.push(y);
|
|
580
578
|
}
|
|
@@ -592,9 +590,9 @@ var ce = /* @__PURE__ */ function() {
|
|
|
592
590
|
var m = n.rules[p], c = a[p];
|
|
593
591
|
m.forEach(function(F) {
|
|
594
592
|
var v = F;
|
|
595
|
-
typeof v.transform == "function" && (a === e && (a =
|
|
593
|
+
typeof v.transform == "function" && (a === e && (a = x({}, a)), c = a[p] = v.transform(c), c != null && (v.type = v.type || (Array.isArray(c) ? "array" : W(c)))), typeof v == "function" ? v = {
|
|
596
594
|
validator: v
|
|
597
|
-
} : v =
|
|
595
|
+
} : v = x({}, v), v.validator = n.getValidationMethod(v), v.validator && (v.field = p, v.fullField = v.fullField || p, v.type = n.getType(v), g[p] = g[p] || [], g[p].push({
|
|
598
596
|
rule: v,
|
|
599
597
|
value: c,
|
|
600
598
|
source: a,
|
|
@@ -603,17 +601,17 @@ var ce = /* @__PURE__ */ function() {
|
|
|
603
601
|
});
|
|
604
602
|
});
|
|
605
603
|
var b = {};
|
|
606
|
-
return
|
|
604
|
+
return Pr(g, u, function(p, m) {
|
|
607
605
|
var c = p.rule, F = (c.type === "object" || c.type === "array") && (W(c.fields) === "object" || W(c.defaultField) === "object");
|
|
608
606
|
F = F && (c.required || !c.required && p.value), c.field = p.field;
|
|
609
|
-
function v(
|
|
610
|
-
return
|
|
611
|
-
fullField: "".concat(c.fullField, ".").concat(
|
|
612
|
-
fullFields: c.fullFields ? [].concat(
|
|
607
|
+
function v(N, R) {
|
|
608
|
+
return x(x({}, R), {}, {
|
|
609
|
+
fullField: "".concat(c.fullField, ".").concat(N),
|
|
610
|
+
fullFields: c.fullFields ? [].concat(k(c.fullFields), [N]) : [N]
|
|
613
611
|
});
|
|
614
612
|
}
|
|
615
613
|
function y() {
|
|
616
|
-
var
|
|
614
|
+
var N = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], R = Array.isArray(N) ? N : [N];
|
|
617
615
|
!u.suppressWarning && R.length && s.warning("async-validator:", R), R.length && c.message !== void 0 && (R = [].concat(c.message));
|
|
618
616
|
var w = R.map(_e(c, a));
|
|
619
617
|
if (u.first && w.length)
|
|
@@ -624,18 +622,18 @@ var ce = /* @__PURE__ */ function() {
|
|
|
624
622
|
if (c.required && !p.value)
|
|
625
623
|
return c.message !== void 0 ? w = [].concat(c.message).map(_e(c, a)) : u.error && (w = [u.error(c, H(u.messages.required, c.field))]), m(w);
|
|
626
624
|
var P = {};
|
|
627
|
-
c.defaultField && Object.keys(p.value).map(function(
|
|
628
|
-
P[
|
|
629
|
-
}), P =
|
|
630
|
-
var
|
|
631
|
-
Object.keys(P).forEach(function(
|
|
632
|
-
var M = P[
|
|
633
|
-
|
|
625
|
+
c.defaultField && Object.keys(p.value).map(function(S) {
|
|
626
|
+
P[S] = c.defaultField;
|
|
627
|
+
}), P = x(x({}, P), p.rule.fields);
|
|
628
|
+
var O = {};
|
|
629
|
+
Object.keys(P).forEach(function(S) {
|
|
630
|
+
var M = P[S], z = Array.isArray(M) ? M : [M];
|
|
631
|
+
O[S] = z.map(v.bind(null, S));
|
|
634
632
|
});
|
|
635
|
-
var T = new s(
|
|
636
|
-
T.messages(u.messages), p.rule.options && (p.rule.options.messages = u.messages, p.rule.options.error = u.error), T.validate(p.value, p.rule.options || u, function(
|
|
633
|
+
var T = new s(O);
|
|
634
|
+
T.messages(u.messages), p.rule.options && (p.rule.options.messages = u.messages, p.rule.options.error = u.error), T.validate(p.value, p.rule.options || u, function(S) {
|
|
637
635
|
var M = [];
|
|
638
|
-
w && w.length && M.push.apply(M,
|
|
636
|
+
w && w.length && M.push.apply(M, k(w)), S && S.length && M.push.apply(M, k(S)), m(M.length ? M : null);
|
|
639
637
|
});
|
|
640
638
|
}
|
|
641
639
|
}
|
|
@@ -645,18 +643,18 @@ var ce = /* @__PURE__ */ function() {
|
|
|
645
643
|
else if (c.validator) {
|
|
646
644
|
try {
|
|
647
645
|
C = c.validator(c, p.value, y, p.source, u);
|
|
648
|
-
} catch (
|
|
646
|
+
} catch (N) {
|
|
649
647
|
var V, A;
|
|
650
|
-
(V = (A = console).error) === null || V === void 0 || V.call(A,
|
|
651
|
-
throw
|
|
652
|
-
}, 0), y(
|
|
648
|
+
(V = (A = console).error) === null || V === void 0 || V.call(A, N), u.suppressValidatorError || setTimeout(function() {
|
|
649
|
+
throw N;
|
|
650
|
+
}, 0), y(N.message);
|
|
653
651
|
}
|
|
654
652
|
C === !0 ? y() : C === !1 ? y(typeof c.message == "function" ? c.message(c.fullField || c.field) : c.message || "".concat(c.fullField || c.field, " fails")) : C instanceof Array ? y(C) : C instanceof Error && y(C.message);
|
|
655
653
|
}
|
|
656
654
|
C && C.then && C.then(function() {
|
|
657
655
|
return y();
|
|
658
|
-
}, function(
|
|
659
|
-
return y(
|
|
656
|
+
}, function(N) {
|
|
657
|
+
return y(N);
|
|
660
658
|
});
|
|
661
659
|
}, function(p) {
|
|
662
660
|
f(p);
|
|
@@ -684,7 +682,7 @@ d(ce, "register", function(t, e) {
|
|
|
684
682
|
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
685
683
|
se[t] = e;
|
|
686
684
|
});
|
|
687
|
-
d(ce, "warning",
|
|
685
|
+
d(ce, "warning", Qe);
|
|
688
686
|
d(ce, "messages", be);
|
|
689
687
|
d(ce, "validators", se);
|
|
690
688
|
var U = "'${name}' is not a valid ${type}", rr = {
|
|
@@ -734,7 +732,7 @@ var U = "'${name}' is not a valid ${type}", rr = {
|
|
|
734
732
|
mismatch: "'${name}' does not match pattern ${pattern}"
|
|
735
733
|
}
|
|
736
734
|
}, He = ce;
|
|
737
|
-
function
|
|
735
|
+
function Jr(s, t) {
|
|
738
736
|
return s.replace(/\\?\$\{\w+\}/g, function(e) {
|
|
739
737
|
if (e.startsWith("\\"))
|
|
740
738
|
return e.slice(1);
|
|
@@ -743,23 +741,23 @@ function Yr(s, t) {
|
|
|
743
741
|
});
|
|
744
742
|
}
|
|
745
743
|
var Ke = "CODE_LOGIC_ERROR";
|
|
746
|
-
function
|
|
747
|
-
return
|
|
744
|
+
function Ne(s, t, e, n, r) {
|
|
745
|
+
return xe.apply(this, arguments);
|
|
748
746
|
}
|
|
749
|
-
function
|
|
750
|
-
return
|
|
747
|
+
function xe() {
|
|
748
|
+
return xe = oe(/* @__PURE__ */ Y().mark(function s(t, e, n, r, i) {
|
|
751
749
|
var a, u, l, f, o, g, h, b, p;
|
|
752
750
|
return Y().wrap(function(c) {
|
|
753
751
|
for (; ; ) switch (c.prev = c.next) {
|
|
754
752
|
case 0:
|
|
755
|
-
return a =
|
|
753
|
+
return a = x({}, n), delete a.ruleIndex, He.warning = function() {
|
|
756
754
|
}, a.validator && (u = a.validator, a.validator = function() {
|
|
757
755
|
try {
|
|
758
756
|
return u.apply(void 0, arguments);
|
|
759
757
|
} catch (F) {
|
|
760
758
|
return console.error(F), Promise.reject(Ke);
|
|
761
759
|
}
|
|
762
|
-
}), l = null, a && a.type === "array" && a.defaultField && (l = a.defaultField, delete a.defaultField), f = new He(d({}, t, [a])), o = ie(rr, r.validateMessages), f.messages(o), g = [], c.prev = 10, c.next = 13, Promise.resolve(f.validate(d({}, t, e),
|
|
760
|
+
}), l = null, a && a.type === "array" && a.defaultField && (l = a.defaultField, delete a.defaultField), f = new He(d({}, t, [a])), o = ie(rr, r.validateMessages), f.messages(o), g = [], c.prev = 10, c.next = 13, Promise.resolve(f.validate(d({}, t, e), x({}, r)));
|
|
763
761
|
case 13:
|
|
764
762
|
c.next = 18;
|
|
765
763
|
break;
|
|
@@ -779,35 +777,35 @@ function Ne() {
|
|
|
779
777
|
break;
|
|
780
778
|
}
|
|
781
779
|
return c.next = 21, Promise.all(e.map(function(F, v) {
|
|
782
|
-
return
|
|
780
|
+
return Ne("".concat(t, ".").concat(v), F, l, r, i);
|
|
783
781
|
}));
|
|
784
782
|
case 21:
|
|
785
783
|
return h = c.sent, c.abrupt("return", h.reduce(function(F, v) {
|
|
786
|
-
return [].concat(
|
|
784
|
+
return [].concat(k(F), k(v));
|
|
787
785
|
}, []));
|
|
788
786
|
case 23:
|
|
789
|
-
return b =
|
|
787
|
+
return b = x(x({}, n), {}, {
|
|
790
788
|
name: t,
|
|
791
789
|
enum: (n.enum || []).join(", ")
|
|
792
790
|
}, i), p = g.map(function(F) {
|
|
793
|
-
return typeof F == "string" ?
|
|
791
|
+
return typeof F == "string" ? Jr(F, b) : F;
|
|
794
792
|
}), c.abrupt("return", p);
|
|
795
793
|
case 26:
|
|
796
794
|
case "end":
|
|
797
795
|
return c.stop();
|
|
798
796
|
}
|
|
799
797
|
}, s, null, [[10, 15]]);
|
|
800
|
-
})),
|
|
798
|
+
})), xe.apply(this, arguments);
|
|
801
799
|
}
|
|
802
|
-
function
|
|
800
|
+
function Yr(s, t, e, n, r, i) {
|
|
803
801
|
var a = s.join("."), u = e.map(function(o, g) {
|
|
804
|
-
var h = o.validator, b =
|
|
802
|
+
var h = o.validator, b = x(x({}, o), {}, {
|
|
805
803
|
ruleIndex: g
|
|
806
804
|
});
|
|
807
805
|
return h && (b.validator = function(p, m, c) {
|
|
808
806
|
var F = !1, v = function() {
|
|
809
|
-
for (var V = arguments.length, A = new Array(V),
|
|
810
|
-
A[
|
|
807
|
+
for (var V = arguments.length, A = new Array(V), N = 0; N < V; N++)
|
|
808
|
+
A[N] = arguments[N];
|
|
811
809
|
Promise.resolve().then(function() {
|
|
812
810
|
D(!F, "Your validator function has already return a promise. `callback` will be ignored."), F || c.apply(void 0, A);
|
|
813
811
|
});
|
|
@@ -824,7 +822,7 @@ function Br(s, t, e, n, r, i) {
|
|
|
824
822
|
}), l;
|
|
825
823
|
if (r === !0)
|
|
826
824
|
l = new Promise(/* @__PURE__ */ function() {
|
|
827
|
-
var o =
|
|
825
|
+
var o = oe(/* @__PURE__ */ Y().mark(function g(h, b) {
|
|
828
826
|
var p, m, c;
|
|
829
827
|
return Y().wrap(function(v) {
|
|
830
828
|
for (; ; ) switch (v.prev = v.next) {
|
|
@@ -835,7 +833,7 @@ function Br(s, t, e, n, r, i) {
|
|
|
835
833
|
v.next = 12;
|
|
836
834
|
break;
|
|
837
835
|
}
|
|
838
|
-
return m = u[p], v.next = 5,
|
|
836
|
+
return m = u[p], v.next = 5, Ne(a, t, m, n, i);
|
|
839
837
|
case 5:
|
|
840
838
|
if (c = v.sent, !c.length) {
|
|
841
839
|
v.next = 9;
|
|
@@ -862,14 +860,14 @@ function Br(s, t, e, n, r, i) {
|
|
|
862
860
|
}());
|
|
863
861
|
else {
|
|
864
862
|
var f = u.map(function(o) {
|
|
865
|
-
return
|
|
863
|
+
return Ne(a, t, o, n, i).then(function(g) {
|
|
866
864
|
return {
|
|
867
865
|
errors: g,
|
|
868
866
|
rule: o
|
|
869
867
|
};
|
|
870
868
|
});
|
|
871
869
|
});
|
|
872
|
-
l = (r ?
|
|
870
|
+
l = (r ? Zr(f) : Br(f)).then(function(o) {
|
|
873
871
|
return Promise.reject(o);
|
|
874
872
|
});
|
|
875
873
|
}
|
|
@@ -877,16 +875,16 @@ function Br(s, t, e, n, r, i) {
|
|
|
877
875
|
return o;
|
|
878
876
|
}), l;
|
|
879
877
|
}
|
|
880
|
-
function
|
|
878
|
+
function Br(s) {
|
|
881
879
|
return Re.apply(this, arguments);
|
|
882
880
|
}
|
|
883
881
|
function Re() {
|
|
884
|
-
return Re =
|
|
882
|
+
return Re = oe(/* @__PURE__ */ Y().mark(function s(t) {
|
|
885
883
|
return Y().wrap(function(n) {
|
|
886
884
|
for (; ; ) switch (n.prev = n.next) {
|
|
887
885
|
case 0:
|
|
888
886
|
return n.abrupt("return", Promise.all(t).then(function(r) {
|
|
889
|
-
var i, a = (i = []).concat.apply(i,
|
|
887
|
+
var i, a = (i = []).concat.apply(i, k(r));
|
|
890
888
|
return a;
|
|
891
889
|
}));
|
|
892
890
|
case 1:
|
|
@@ -896,11 +894,11 @@ function Re() {
|
|
|
896
894
|
}, s);
|
|
897
895
|
})), Re.apply(this, arguments);
|
|
898
896
|
}
|
|
899
|
-
function
|
|
900
|
-
return
|
|
897
|
+
function Zr(s) {
|
|
898
|
+
return Oe.apply(this, arguments);
|
|
901
899
|
}
|
|
902
|
-
function
|
|
903
|
-
return
|
|
900
|
+
function Oe() {
|
|
901
|
+
return Oe = oe(/* @__PURE__ */ Y().mark(function s(t) {
|
|
904
902
|
var e;
|
|
905
903
|
return Y().wrap(function(r) {
|
|
906
904
|
for (; ; ) switch (r.prev = r.next) {
|
|
@@ -917,7 +915,7 @@ function ke() {
|
|
|
917
915
|
return r.stop();
|
|
918
916
|
}
|
|
919
917
|
}, s);
|
|
920
|
-
})),
|
|
918
|
+
})), Oe.apply(this, arguments);
|
|
921
919
|
}
|
|
922
920
|
function L(s) {
|
|
923
921
|
return Ve(s);
|
|
@@ -925,7 +923,7 @@ function L(s) {
|
|
|
925
923
|
function ze(s, t) {
|
|
926
924
|
var e = {};
|
|
927
925
|
return t.forEach(function(n) {
|
|
928
|
-
var r =
|
|
926
|
+
var r = X(s, n);
|
|
929
927
|
e = B(e, n, r);
|
|
930
928
|
}), e;
|
|
931
929
|
}
|
|
@@ -947,12 +945,12 @@ function Xr(s, t) {
|
|
|
947
945
|
if (!s && t || !t || !s || !t || W(s) !== "object" || W(t) !== "object")
|
|
948
946
|
return !1;
|
|
949
947
|
var e = Object.keys(s), n = Object.keys(t), r = new Set([].concat(e, n));
|
|
950
|
-
return
|
|
948
|
+
return k(r).every(function(i) {
|
|
951
949
|
var a = s[i], u = t[i];
|
|
952
950
|
return typeof a == "function" && typeof u == "function" ? !0 : a === u;
|
|
953
951
|
});
|
|
954
952
|
}
|
|
955
|
-
function
|
|
953
|
+
function Qr(s) {
|
|
956
954
|
var t = arguments.length <= 1 ? void 0 : arguments[1];
|
|
957
955
|
return t && t.target && W(t.target) === "object" && s in t.target ? t.target[s] : t;
|
|
958
956
|
}
|
|
@@ -961,27 +959,27 @@ function Ge(s, t, e) {
|
|
|
961
959
|
if (t < 0 || t >= n || e < 0 || e >= n)
|
|
962
960
|
return s;
|
|
963
961
|
var r = s[t], i = t - e;
|
|
964
|
-
return i > 0 ? [].concat(
|
|
962
|
+
return i > 0 ? [].concat(k(s.slice(0, e)), [r], k(s.slice(e, t)), k(s.slice(t + 1, n))) : i < 0 ? [].concat(k(s.slice(0, t)), k(s.slice(t + 1, e + 1)), [r], k(s.slice(e + 1, n))) : s;
|
|
965
963
|
}
|
|
966
|
-
var
|
|
964
|
+
var et = ["name"], K = [];
|
|
967
965
|
function Fe(s, t, e, n, r, i) {
|
|
968
966
|
return typeof s == "function" ? s(t, e, "source" in i ? {
|
|
969
967
|
source: i.source
|
|
970
968
|
} : {}) : n !== r;
|
|
971
969
|
}
|
|
972
970
|
var qe = /* @__PURE__ */ function(s) {
|
|
973
|
-
|
|
974
|
-
var t =
|
|
971
|
+
Ze(e, s);
|
|
972
|
+
var t = Xe(e);
|
|
975
973
|
function e(n) {
|
|
976
974
|
var r;
|
|
977
|
-
if (
|
|
975
|
+
if (le(this, e), r = t.call(this, n), d(q(r), "state", {
|
|
978
976
|
resetCount: 0
|
|
979
977
|
}), d(q(r), "cancelRegisterFunc", null), d(q(r), "mounted", !1), d(q(r), "touched", !1), d(q(r), "dirty", !1), d(q(r), "validatePromise", void 0), d(q(r), "prevValidating", void 0), d(q(r), "errors", K), d(q(r), "warnings", K), d(q(r), "cancelRegister", function() {
|
|
980
978
|
var l = r.props, f = l.preserve, o = l.isListField, g = l.name;
|
|
981
979
|
r.cancelRegisterFunc && r.cancelRegisterFunc(o, f, L(g)), r.cancelRegisterFunc = null;
|
|
982
980
|
}), d(q(r), "getNamePath", function() {
|
|
983
981
|
var l = r.props, f = l.name, o = l.fieldContext, g = o.prefixName, h = g === void 0 ? [] : g;
|
|
984
|
-
return f !== void 0 ? [].concat(
|
|
982
|
+
return f !== void 0 ? [].concat(k(h), k(f)) : [];
|
|
985
983
|
}), d(q(r), "getRules", function() {
|
|
986
984
|
var l = r.props, f = l.rules, o = f === void 0 ? [] : f, g = l.fieldContext;
|
|
987
985
|
return o.map(function(h) {
|
|
@@ -997,7 +995,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
997
995
|
}), d(q(r), "metaCache", null), d(q(r), "triggerMetaEvent", function(l) {
|
|
998
996
|
var f = r.props.onMetaChange;
|
|
999
997
|
if (f) {
|
|
1000
|
-
var o =
|
|
998
|
+
var o = x(x({}, r.getMeta()), {}, {
|
|
1001
999
|
destroy: l
|
|
1002
1000
|
});
|
|
1003
1001
|
Le(r.metaCache, o) || f(o), r.metaCache = o;
|
|
@@ -1036,8 +1034,8 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1036
1034
|
}
|
|
1037
1035
|
case "dependenciesUpdate": {
|
|
1038
1036
|
var A = p.map(L);
|
|
1039
|
-
if (A.some(function(
|
|
1040
|
-
return te(o.relatedFields,
|
|
1037
|
+
if (A.some(function(N) {
|
|
1038
|
+
return te(o.relatedFields, N);
|
|
1041
1039
|
})) {
|
|
1042
1040
|
r.reRender();
|
|
1043
1041
|
return;
|
|
@@ -1053,8 +1051,8 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1053
1051
|
}
|
|
1054
1052
|
h === !0 && r.reRender();
|
|
1055
1053
|
}), d(q(r), "validateRules", function(l) {
|
|
1056
|
-
var f = r.getNamePath(), o = r.getValue(), g = l || {}, h = g.triggerName, b = g.validateOnly, p = b === void 0 ? !1 : b, m = Promise.resolve().then(/* @__PURE__ */
|
|
1057
|
-
var F, v, y, C, V, A,
|
|
1054
|
+
var f = r.getNamePath(), o = r.getValue(), g = l || {}, h = g.triggerName, b = g.validateOnly, p = b === void 0 ? !1 : b, m = Promise.resolve().then(/* @__PURE__ */ oe(/* @__PURE__ */ Y().mark(function c() {
|
|
1055
|
+
var F, v, y, C, V, A, N;
|
|
1058
1056
|
return Y().wrap(function(w) {
|
|
1059
1057
|
for (; ; ) switch (w.prev = w.next) {
|
|
1060
1058
|
case 0:
|
|
@@ -1067,10 +1065,10 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1067
1065
|
if (F = r.props, v = F.validateFirst, y = v === void 0 ? !1 : v, C = F.messageVariables, V = F.validateDebounce, A = r.getRules(), h && (A = A.filter(function(P) {
|
|
1068
1066
|
return P;
|
|
1069
1067
|
}).filter(function(P) {
|
|
1070
|
-
var
|
|
1071
|
-
if (!
|
|
1068
|
+
var O = P.validateTrigger;
|
|
1069
|
+
if (!O)
|
|
1072
1070
|
return !0;
|
|
1073
|
-
var T = Ve(
|
|
1071
|
+
var T = Ve(O);
|
|
1074
1072
|
return T.includes(h);
|
|
1075
1073
|
})), !(V && h)) {
|
|
1076
1074
|
w.next = 10;
|
|
@@ -1086,20 +1084,20 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1086
1084
|
}
|
|
1087
1085
|
return w.abrupt("return", []);
|
|
1088
1086
|
case 10:
|
|
1089
|
-
return
|
|
1087
|
+
return N = Yr(f, o, A, l, y, C), N.catch(function(P) {
|
|
1090
1088
|
return P;
|
|
1091
1089
|
}).then(function() {
|
|
1092
1090
|
var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K;
|
|
1093
1091
|
if (r.validatePromise === m) {
|
|
1094
|
-
var
|
|
1092
|
+
var O;
|
|
1095
1093
|
r.validatePromise = null;
|
|
1096
|
-
var T = [],
|
|
1097
|
-
(
|
|
1094
|
+
var T = [], S = [];
|
|
1095
|
+
(O = P.forEach) === null || O === void 0 || O.call(P, function(M) {
|
|
1098
1096
|
var z = M.rule.warningOnly, _ = M.errors, G = _ === void 0 ? K : _;
|
|
1099
|
-
z ?
|
|
1100
|
-
}), r.errors = T, r.warnings =
|
|
1097
|
+
z ? S.push.apply(S, k(G)) : T.push.apply(T, k(G));
|
|
1098
|
+
}), r.errors = T, r.warnings = S, r.triggerMetaEvent(), r.reRender();
|
|
1101
1099
|
}
|
|
1102
|
-
}), w.abrupt("return",
|
|
1100
|
+
}), w.abrupt("return", N);
|
|
1103
1101
|
case 13:
|
|
1104
1102
|
case "end":
|
|
1105
1103
|
return w.stop();
|
|
@@ -1114,7 +1112,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1114
1112
|
}), d(q(r), "isFieldDirty", function() {
|
|
1115
1113
|
if (r.dirty || r.props.initialValue !== void 0)
|
|
1116
1114
|
return !0;
|
|
1117
|
-
var l = r.props.fieldContext, f = l.getInternalHooks(
|
|
1115
|
+
var l = r.props.fieldContext, f = l.getInternalHooks(Q), o = f.getInitialValue;
|
|
1118
1116
|
return o(r.getNamePath()) !== void 0;
|
|
1119
1117
|
}), d(q(r), "getErrors", function() {
|
|
1120
1118
|
return r.errors;
|
|
@@ -1140,11 +1138,11 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1140
1138
|
}), d(q(r), "getOnlyChild", function(l) {
|
|
1141
1139
|
if (typeof l == "function") {
|
|
1142
1140
|
var f = r.getMeta();
|
|
1143
|
-
return
|
|
1141
|
+
return x(x({}, r.getOnlyChild(l(r.getControlled(), f, r.props.fieldContext))), {}, {
|
|
1144
1142
|
isFunction: !0
|
|
1145
1143
|
});
|
|
1146
1144
|
}
|
|
1147
|
-
var o =
|
|
1145
|
+
var o = hr(l);
|
|
1148
1146
|
return o.length !== 1 || !/* @__PURE__ */ E.isValidElement(o[0]) ? {
|
|
1149
1147
|
child: o,
|
|
1150
1148
|
isFunction: !1
|
|
@@ -1154,32 +1152,32 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1154
1152
|
};
|
|
1155
1153
|
}), d(q(r), "getValue", function(l) {
|
|
1156
1154
|
var f = r.props.fieldContext.getFieldsValue, o = r.getNamePath();
|
|
1157
|
-
return
|
|
1155
|
+
return X(l || f(!0), o);
|
|
1158
1156
|
}), d(q(r), "getControlled", function() {
|
|
1159
|
-
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, f = r.props, o = f.name, g = f.trigger, h = f.validateTrigger, b = f.getValueFromEvent, p = f.normalize, m = f.valuePropName, c = f.getValueProps, F = f.fieldContext, v = h !== void 0 ? h : F.validateTrigger, y = r.getNamePath(), C = F.getInternalHooks, V = F.getFieldsValue, A = C(
|
|
1157
|
+
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, f = r.props, o = f.name, g = f.trigger, h = f.validateTrigger, b = f.getValueFromEvent, p = f.normalize, m = f.valuePropName, c = f.getValueProps, F = f.fieldContext, v = h !== void 0 ? h : F.validateTrigger, y = r.getNamePath(), C = F.getInternalHooks, V = F.getFieldsValue, A = C(Q), N = A.dispatch, R = r.getValue(), w = c || function(M) {
|
|
1160
1158
|
return d({}, m, M);
|
|
1161
|
-
}, P = l[g],
|
|
1162
|
-
process.env.NODE_ENV !== "production" &&
|
|
1163
|
-
D(typeof
|
|
1159
|
+
}, P = l[g], O = o !== void 0 ? w(R) : {};
|
|
1160
|
+
process.env.NODE_ENV !== "production" && O && Object.keys(O).forEach(function(M) {
|
|
1161
|
+
D(typeof O[M] != "function", "It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(M, ")"));
|
|
1164
1162
|
});
|
|
1165
|
-
var T =
|
|
1163
|
+
var T = x(x({}, l), O);
|
|
1166
1164
|
T[g] = function() {
|
|
1167
1165
|
r.touched = !0, r.dirty = !0, r.triggerMetaEvent();
|
|
1168
1166
|
for (var M, z = arguments.length, _ = new Array(z), G = 0; G < z; G++)
|
|
1169
1167
|
_[G] = arguments[G];
|
|
1170
|
-
b ? M = b.apply(void 0, _) : M =
|
|
1168
|
+
b ? M = b.apply(void 0, _) : M = Qr.apply(void 0, [m].concat(_)), p && (M = p(M, R, V(!0))), M !== R && N({
|
|
1171
1169
|
type: "updateValue",
|
|
1172
1170
|
namePath: y,
|
|
1173
1171
|
value: M
|
|
1174
1172
|
}), P && P.apply(void 0, _);
|
|
1175
1173
|
};
|
|
1176
|
-
var
|
|
1177
|
-
return
|
|
1174
|
+
var S = Ve(v || []);
|
|
1175
|
+
return S.forEach(function(M) {
|
|
1178
1176
|
var z = T[M];
|
|
1179
1177
|
T[M] = function() {
|
|
1180
1178
|
z && z.apply(void 0, arguments);
|
|
1181
1179
|
var _ = r.props.rules;
|
|
1182
|
-
_ && _.length &&
|
|
1180
|
+
_ && _.length && N({
|
|
1183
1181
|
type: "validateField",
|
|
1184
1182
|
namePath: y,
|
|
1185
1183
|
triggerName: M
|
|
@@ -1187,17 +1185,17 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1187
1185
|
};
|
|
1188
1186
|
}), T;
|
|
1189
1187
|
}), n.fieldContext) {
|
|
1190
|
-
var i = n.fieldContext.getInternalHooks, a = i(
|
|
1188
|
+
var i = n.fieldContext.getInternalHooks, a = i(Q), u = a.initEntityValue;
|
|
1191
1189
|
u(q(r));
|
|
1192
1190
|
}
|
|
1193
1191
|
return r;
|
|
1194
1192
|
}
|
|
1195
|
-
return
|
|
1193
|
+
return fe(e, [{
|
|
1196
1194
|
key: "componentDidMount",
|
|
1197
1195
|
value: function() {
|
|
1198
1196
|
var r = this.props, i = r.shouldUpdate, a = r.fieldContext;
|
|
1199
1197
|
if (this.mounted = !0, a) {
|
|
1200
|
-
var u = a.getInternalHooks, l = u(
|
|
1198
|
+
var u = a.getInternalHooks, l = u(Q), f = l.registerField;
|
|
1201
1199
|
this.cancelRegisterFunc = f(this);
|
|
1202
1200
|
}
|
|
1203
1201
|
i === !0 && this.reRender();
|
|
@@ -1228,8 +1226,8 @@ d(qe, "defaultProps", {
|
|
|
1228
1226
|
valuePropName: "value"
|
|
1229
1227
|
});
|
|
1230
1228
|
function nr(s) {
|
|
1231
|
-
var t, e = s.name, n = Ae(s,
|
|
1232
|
-
return u || (l = "_".concat((a || []).join("_"))), process.env.NODE_ENV !== "production" && n.preserve === !1 && u && a.length <= 1 && D(!1, "`preserve` should not apply on Form.List fields."), /* @__PURE__ */ E.createElement(qe,
|
|
1229
|
+
var t, e = s.name, n = Ae(s, et), r = E.useContext(ne), i = E.useContext(he), a = e !== void 0 ? L(e) : void 0, u = (t = n.isListField) !== null && t !== void 0 ? t : !!i, l = "keep";
|
|
1230
|
+
return u || (l = "_".concat((a || []).join("_"))), process.env.NODE_ENV !== "production" && n.preserve === !1 && u && a.length <= 1 && D(!1, "`preserve` should not apply on Form.List fields."), /* @__PURE__ */ E.createElement(qe, Ye({
|
|
1233
1231
|
key: l,
|
|
1234
1232
|
name: a,
|
|
1235
1233
|
isListField: u
|
|
@@ -1237,15 +1235,15 @@ function nr(s) {
|
|
|
1237
1235
|
fieldContext: r
|
|
1238
1236
|
}));
|
|
1239
1237
|
}
|
|
1240
|
-
function
|
|
1238
|
+
function rt(s) {
|
|
1241
1239
|
var t = s.name, e = s.initialValue, n = s.children, r = s.rules, i = s.validateTrigger, a = s.isListField, u = E.useContext(ne), l = E.useContext(he), f = E.useRef({
|
|
1242
1240
|
keys: [],
|
|
1243
1241
|
id: 0
|
|
1244
1242
|
}), o = f.current, g = E.useMemo(function() {
|
|
1245
1243
|
var m = L(u.prefixName) || [];
|
|
1246
|
-
return [].concat(
|
|
1244
|
+
return [].concat(k(m), k(L(t)));
|
|
1247
1245
|
}, [u.prefixName, t]), h = E.useMemo(function() {
|
|
1248
|
-
return
|
|
1246
|
+
return x(x({}, u), {}, {
|
|
1249
1247
|
prefixName: g
|
|
1250
1248
|
});
|
|
1251
1249
|
}, [u, g]), b = E.useMemo(function() {
|
|
@@ -1280,25 +1278,25 @@ function tt(s) {
|
|
|
1280
1278
|
return w || [];
|
|
1281
1279
|
}, A = {
|
|
1282
1280
|
add: function(w, P) {
|
|
1283
|
-
var
|
|
1284
|
-
P >= 0 && P <=
|
|
1281
|
+
var O = V();
|
|
1282
|
+
P >= 0 && P <= O.length ? (o.keys = [].concat(k(o.keys.slice(0, P)), [o.id], k(o.keys.slice(P))), y([].concat(k(O.slice(0, P)), [w], k(O.slice(P))))) : (process.env.NODE_ENV !== "production" && (P < 0 || P > O.length) && D(!1, "The second parameter of the add function should be a valid positive number."), o.keys = [].concat(k(o.keys), [o.id]), y([].concat(k(O), [w]))), o.id += 1;
|
|
1285
1283
|
},
|
|
1286
1284
|
remove: function(w) {
|
|
1287
|
-
var P = V(),
|
|
1288
|
-
|
|
1289
|
-
return !
|
|
1290
|
-
}), y(P.filter(function(T,
|
|
1291
|
-
return !
|
|
1285
|
+
var P = V(), O = new Set(Array.isArray(w) ? w : [w]);
|
|
1286
|
+
O.size <= 0 || (o.keys = o.keys.filter(function(T, S) {
|
|
1287
|
+
return !O.has(S);
|
|
1288
|
+
}), y(P.filter(function(T, S) {
|
|
1289
|
+
return !O.has(S);
|
|
1292
1290
|
})));
|
|
1293
1291
|
},
|
|
1294
1292
|
move: function(w, P) {
|
|
1295
1293
|
if (w !== P) {
|
|
1296
|
-
var
|
|
1297
|
-
w < 0 || w >=
|
|
1294
|
+
var O = V();
|
|
1295
|
+
w < 0 || w >= O.length || P < 0 || P >= O.length || (o.keys = Ge(o.keys, w, P), y(Ge(O, w, P)));
|
|
1298
1296
|
}
|
|
1299
1297
|
}
|
|
1300
|
-
},
|
|
1301
|
-
return Array.isArray(
|
|
1298
|
+
}, N = v || [];
|
|
1299
|
+
return Array.isArray(N) || (N = [], process.env.NODE_ENV !== "production" && D(!1, "Current value of '".concat(g.join(" > "), "' is not an array type."))), n(N.map(function(R, w) {
|
|
1302
1300
|
var P = o.keys[w];
|
|
1303
1301
|
return P === void 0 && (o.keys[w] = o.id, P = o.keys[w], o.id += 1), {
|
|
1304
1302
|
name: w,
|
|
@@ -1308,7 +1306,7 @@ function tt(s) {
|
|
|
1308
1306
|
}), A, c);
|
|
1309
1307
|
})));
|
|
1310
1308
|
}
|
|
1311
|
-
function
|
|
1309
|
+
function tt(s) {
|
|
1312
1310
|
var t = !1, e = s.length, n = [];
|
|
1313
1311
|
return s.length ? new Promise(function(r, i) {
|
|
1314
1312
|
s.forEach(function(a, u) {
|
|
@@ -1328,9 +1326,9 @@ function ye(s) {
|
|
|
1328
1326
|
}
|
|
1329
1327
|
var re = /* @__PURE__ */ function() {
|
|
1330
1328
|
function s() {
|
|
1331
|
-
|
|
1329
|
+
le(this, s), d(this, "kvs", /* @__PURE__ */ new Map());
|
|
1332
1330
|
}
|
|
1333
|
-
return
|
|
1331
|
+
return fe(s, [{
|
|
1334
1332
|
key: "set",
|
|
1335
1333
|
value: function(e, n) {
|
|
1336
1334
|
this.kvs.set(ye(e), n);
|
|
@@ -1355,7 +1353,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1355
1353
|
}, {
|
|
1356
1354
|
key: "map",
|
|
1357
1355
|
value: function(e) {
|
|
1358
|
-
return
|
|
1356
|
+
return k(this.kvs.entries()).map(function(n) {
|
|
1359
1357
|
var r = ue(n, 2), i = r[0], a = r[1], u = i.split(ir);
|
|
1360
1358
|
return e({
|
|
1361
1359
|
key: u.map(function(l) {
|
|
@@ -1376,9 +1374,9 @@ var re = /* @__PURE__ */ function() {
|
|
|
1376
1374
|
}), e;
|
|
1377
1375
|
}
|
|
1378
1376
|
}]), s;
|
|
1379
|
-
}(),
|
|
1377
|
+
}(), nt = ["name"], it = /* @__PURE__ */ fe(function s(t) {
|
|
1380
1378
|
var e = this;
|
|
1381
|
-
|
|
1379
|
+
le(this, s), d(this, "formHooked", !1), d(this, "forceRootUpdate", void 0), d(this, "subscribable", !0), d(this, "store", {}), d(this, "fieldEntities", []), d(this, "initialValues", {}), d(this, "callbacks", {}), d(this, "validateMessages", null), d(this, "preserve", null), d(this, "lastValidatePromise", null), d(this, "getForm", function() {
|
|
1382
1380
|
return {
|
|
1383
1381
|
getFieldValue: e.getFieldValue,
|
|
1384
1382
|
getFieldsValue: e.getFieldsValue,
|
|
@@ -1399,7 +1397,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1399
1397
|
getInternalHooks: e.getInternalHooks
|
|
1400
1398
|
};
|
|
1401
1399
|
}), d(this, "getInternalHooks", function(n) {
|
|
1402
|
-
return n ===
|
|
1400
|
+
return n === Q ? (e.formHooked = !0, {
|
|
1403
1401
|
dispatch: e.dispatch,
|
|
1404
1402
|
initEntityValue: e.initEntityValue,
|
|
1405
1403
|
registerField: e.registerField,
|
|
@@ -1420,7 +1418,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1420
1418
|
var i, a = ie(n, e.store);
|
|
1421
1419
|
(i = e.prevWithoutPreserves) === null || i === void 0 || i.map(function(u) {
|
|
1422
1420
|
var l = u.key;
|
|
1423
|
-
a = B(a, l,
|
|
1421
|
+
a = B(a, l, X(n, l));
|
|
1424
1422
|
}), e.prevWithoutPreserves = null, e.updateStore(a);
|
|
1425
1423
|
}
|
|
1426
1424
|
}), d(this, "destroyForm", function(n) {
|
|
@@ -1433,7 +1431,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1433
1431
|
}), e.prevWithoutPreserves = r;
|
|
1434
1432
|
}
|
|
1435
1433
|
}), d(this, "getInitialValue", function(n) {
|
|
1436
|
-
var r =
|
|
1434
|
+
var r = X(e.initialValues, n);
|
|
1437
1435
|
return n.length ? ie(r) : r;
|
|
1438
1436
|
}), d(this, "setCallbacks", function(n) {
|
|
1439
1437
|
e.callbacks = n;
|
|
@@ -1506,7 +1504,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1506
1504
|
}), d(this, "getFieldValue", function(n) {
|
|
1507
1505
|
e.warningUnhooked();
|
|
1508
1506
|
var r = L(n);
|
|
1509
|
-
return
|
|
1507
|
+
return X(e.store, r);
|
|
1510
1508
|
}), d(this, "getFieldsError", function(n) {
|
|
1511
1509
|
e.warningUnhooked();
|
|
1512
1510
|
var r = e.getFieldEntitiesForNamePathList(n);
|
|
@@ -1551,7 +1549,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1551
1549
|
F.every(function(v, y) {
|
|
1552
1550
|
return c[y] === v;
|
|
1553
1551
|
}) && h.update(F, function(v) {
|
|
1554
|
-
return [].concat(
|
|
1552
|
+
return [].concat(k(v), [m]);
|
|
1555
1553
|
});
|
|
1556
1554
|
});
|
|
1557
1555
|
});
|
|
@@ -1603,7 +1601,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1603
1601
|
D(!1, "Multiple Field with path '".concat(h.join("."), "' set 'initialValue'. Can not decide which one to pick."));
|
|
1604
1602
|
else if (p) {
|
|
1605
1603
|
var m = e.getFieldValue(h), c = o.isListField();
|
|
1606
|
-
!c && (!n.skipExist || m === void 0) && e.updateStore(B(e.store, h,
|
|
1604
|
+
!c && (!n.skipExist || m === void 0) && e.updateStore(B(e.store, h, k(p)[0].value));
|
|
1607
1605
|
}
|
|
1608
1606
|
}
|
|
1609
1607
|
}
|
|
@@ -1613,7 +1611,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1613
1611
|
var f = r.get(l);
|
|
1614
1612
|
if (f) {
|
|
1615
1613
|
var o;
|
|
1616
|
-
(o = u).push.apply(o,
|
|
1614
|
+
(o = u).push.apply(o, k(k(f).map(function(g) {
|
|
1617
1615
|
return g.entity;
|
|
1618
1616
|
})));
|
|
1619
1617
|
}
|
|
@@ -1640,7 +1638,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1640
1638
|
e.warningUnhooked();
|
|
1641
1639
|
var r = e.store, i = [];
|
|
1642
1640
|
n.forEach(function(a) {
|
|
1643
|
-
var u = a.name, l = Ae(a,
|
|
1641
|
+
var u = a.name, l = Ae(a, nt), f = L(u);
|
|
1644
1642
|
i.push(f), "value" in l && e.updateStore(B(e.store, f, l.value)), e.notifyObservers(r, [f], {
|
|
1645
1643
|
type: "setField",
|
|
1646
1644
|
data: a
|
|
@@ -1648,7 +1646,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1648
1646
|
}), e.notifyWatch(i);
|
|
1649
1647
|
}), d(this, "getFields", function() {
|
|
1650
1648
|
var n = e.getFieldEntities(!0), r = n.map(function(i) {
|
|
1651
|
-
var a = i.getNamePath(), u = i.getMeta(), l =
|
|
1649
|
+
var a = i.getNamePath(), u = i.getMeta(), l = x(x({}, u), {}, {
|
|
1652
1650
|
name: a,
|
|
1653
1651
|
value: e.getFieldValue(a)
|
|
1654
1652
|
});
|
|
@@ -1660,7 +1658,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1660
1658
|
}), d(this, "initEntityValue", function(n) {
|
|
1661
1659
|
var r = n.props.initialValue;
|
|
1662
1660
|
if (r !== void 0) {
|
|
1663
|
-
var i = n.getNamePath(), a =
|
|
1661
|
+
var i = n.getNamePath(), a = X(e.store, i);
|
|
1664
1662
|
a === void 0 && e.updateStore(B(e.store, i, r));
|
|
1665
1663
|
}
|
|
1666
1664
|
}), d(this, "isMergedPreserve", function(n) {
|
|
@@ -1716,7 +1714,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1716
1714
|
}
|
|
1717
1715
|
}), d(this, "notifyObservers", function(n, r, i) {
|
|
1718
1716
|
if (e.subscribable) {
|
|
1719
|
-
var a =
|
|
1717
|
+
var a = x(x({}, i), {}, {
|
|
1720
1718
|
store: e.getFieldsValue(!0)
|
|
1721
1719
|
});
|
|
1722
1720
|
e.getFieldEntities().forEach(function(u) {
|
|
@@ -1729,7 +1727,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1729
1727
|
var i = e.getDependencyChildrenFields(r);
|
|
1730
1728
|
return i.length && e.validateFields(i), e.notifyObservers(n, i, {
|
|
1731
1729
|
type: "dependenciesUpdate",
|
|
1732
|
-
relatedFields: [r].concat(
|
|
1730
|
+
relatedFields: [r].concat(k(i))
|
|
1733
1731
|
}), i;
|
|
1734
1732
|
}), d(this, "updateValue", function(n, r) {
|
|
1735
1733
|
var i = L(n), a = e.store;
|
|
@@ -1742,7 +1740,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1742
1740
|
var f = ze(e.store, [i]);
|
|
1743
1741
|
l(f, e.getFieldsValue());
|
|
1744
1742
|
}
|
|
1745
|
-
e.triggerOnFieldsChange([i].concat(
|
|
1743
|
+
e.triggerOnFieldsChange([i].concat(k(u)));
|
|
1746
1744
|
}), d(this, "setFieldsValue", function(n) {
|
|
1747
1745
|
e.warningUnhooked();
|
|
1748
1746
|
var r = e.store;
|
|
@@ -1812,8 +1810,8 @@ var re = /* @__PURE__ */ function() {
|
|
|
1812
1810
|
if (u || l.push(v.getNamePath()), !(!v.props.rules || !v.props.rules.length) && !(p && !v.isFieldDirty())) {
|
|
1813
1811
|
var y = v.getNamePath();
|
|
1814
1812
|
if (g.add(y.join(o)), !u || te(l, y, b)) {
|
|
1815
|
-
var C = v.validateRules(
|
|
1816
|
-
validateMessages:
|
|
1813
|
+
var C = v.validateRules(x({
|
|
1814
|
+
validateMessages: x(x({}, rr), e.validateMessages)
|
|
1817
1815
|
}, a));
|
|
1818
1816
|
f.push(C.then(function() {
|
|
1819
1817
|
return {
|
|
@@ -1822,24 +1820,24 @@ var re = /* @__PURE__ */ function() {
|
|
|
1822
1820
|
warnings: []
|
|
1823
1821
|
};
|
|
1824
1822
|
}).catch(function(V) {
|
|
1825
|
-
var A,
|
|
1823
|
+
var A, N = [], R = [];
|
|
1826
1824
|
return (A = V.forEach) === null || A === void 0 || A.call(V, function(w) {
|
|
1827
|
-
var P = w.rule.warningOnly,
|
|
1828
|
-
P ? R.push.apply(R, O
|
|
1829
|
-
}),
|
|
1825
|
+
var P = w.rule.warningOnly, O = w.errors;
|
|
1826
|
+
P ? R.push.apply(R, k(O)) : N.push.apply(N, k(O));
|
|
1827
|
+
}), N.length ? Promise.reject({
|
|
1830
1828
|
name: y,
|
|
1831
|
-
errors:
|
|
1829
|
+
errors: N,
|
|
1832
1830
|
warnings: R
|
|
1833
1831
|
}) : {
|
|
1834
1832
|
name: y,
|
|
1835
|
-
errors:
|
|
1833
|
+
errors: N,
|
|
1836
1834
|
warnings: R
|
|
1837
1835
|
};
|
|
1838
1836
|
}));
|
|
1839
1837
|
}
|
|
1840
1838
|
}
|
|
1841
1839
|
});
|
|
1842
|
-
var m =
|
|
1840
|
+
var m = tt(f);
|
|
1843
1841
|
e.lastValidatePromise = m, m.catch(function(v) {
|
|
1844
1842
|
return v;
|
|
1845
1843
|
}).then(function(v) {
|
|
@@ -1893,12 +1891,12 @@ function ar(s) {
|
|
|
1893
1891
|
else {
|
|
1894
1892
|
var i = function() {
|
|
1895
1893
|
r({});
|
|
1896
|
-
}, a = new
|
|
1894
|
+
}, a = new it(i);
|
|
1897
1895
|
t.current = a.getForm();
|
|
1898
1896
|
}
|
|
1899
1897
|
return [t.current];
|
|
1900
1898
|
}
|
|
1901
|
-
var
|
|
1899
|
+
var ke = /* @__PURE__ */ E.createContext({
|
|
1902
1900
|
triggerFormChange: function() {
|
|
1903
1901
|
},
|
|
1904
1902
|
triggerFormFinish: function() {
|
|
@@ -1908,10 +1906,10 @@ var Oe = /* @__PURE__ */ E.createContext({
|
|
|
1908
1906
|
unregisterForm: function() {
|
|
1909
1907
|
}
|
|
1910
1908
|
}), sr = function(t) {
|
|
1911
|
-
var e = t.validateMessages, n = t.onFormChange, r = t.onFormFinish, i = t.children, a = E.useContext(
|
|
1912
|
-
return /* @__PURE__ */ E.createElement(
|
|
1913
|
-
value:
|
|
1914
|
-
validateMessages:
|
|
1909
|
+
var e = t.validateMessages, n = t.onFormChange, r = t.onFormFinish, i = t.children, a = E.useContext(ke), u = E.useRef({});
|
|
1910
|
+
return /* @__PURE__ */ E.createElement(ke.Provider, {
|
|
1911
|
+
value: x(x({}, a), {}, {
|
|
1912
|
+
validateMessages: x(x({}, a.validateMessages), e),
|
|
1915
1913
|
// =========================================================
|
|
1916
1914
|
// = Global Form Control =
|
|
1917
1915
|
// =========================================================
|
|
@@ -1928,25 +1926,25 @@ var Oe = /* @__PURE__ */ E.createContext({
|
|
|
1928
1926
|
}), a.triggerFormFinish(f, o);
|
|
1929
1927
|
},
|
|
1930
1928
|
registerForm: function(f, o) {
|
|
1931
|
-
f && (u.current =
|
|
1929
|
+
f && (u.current = x(x({}, u.current), {}, d({}, f, o))), a.registerForm(f, o);
|
|
1932
1930
|
},
|
|
1933
1931
|
unregisterForm: function(f) {
|
|
1934
|
-
var o =
|
|
1932
|
+
var o = x({}, u.current);
|
|
1935
1933
|
delete o[f], u.current = o, a.unregisterForm(f);
|
|
1936
1934
|
}
|
|
1937
1935
|
})
|
|
1938
1936
|
}, i);
|
|
1939
|
-
},
|
|
1940
|
-
var n = t.name, r = t.initialValues, i = t.fields, a = t.form, u = t.preserve, l = t.children, f = t.component, o = f === void 0 ? "form" : f, g = t.validateMessages, h = t.validateTrigger, b = h === void 0 ? "onChange" : h, p = t.onValuesChange, m = t.onFieldsChange, c = t.onFinish, F = t.onFinishFailed, v = t.clearOnDestroy, y = Ae(t,
|
|
1937
|
+
}, at = ["name", "initialValues", "fields", "form", "preserve", "children", "component", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed", "clearOnDestroy"], st = function(t, e) {
|
|
1938
|
+
var n = t.name, r = t.initialValues, i = t.fields, a = t.form, u = t.preserve, l = t.children, f = t.component, o = f === void 0 ? "form" : f, g = t.validateMessages, h = t.validateTrigger, b = h === void 0 ? "onChange" : h, p = t.onValuesChange, m = t.onFieldsChange, c = t.onFinish, F = t.onFinishFailed, v = t.clearOnDestroy, y = Ae(t, at), C = E.useRef(null), V = E.useContext(ke), A = ar(a), N = ue(A, 1), R = N[0], w = R.getInternalHooks(Q), P = w.useSubscribe, O = w.setInitialValues, T = w.setCallbacks, S = w.setValidateMessages, M = w.setPreserve, z = w.destroyForm;
|
|
1941
1939
|
E.useImperativeHandle(e, function() {
|
|
1942
|
-
return
|
|
1940
|
+
return x(x({}, R), {}, {
|
|
1943
1941
|
nativeElement: C.current
|
|
1944
1942
|
});
|
|
1945
1943
|
}), E.useEffect(function() {
|
|
1946
1944
|
return V.registerForm(n, R), function() {
|
|
1947
1945
|
V.unregisterForm(n);
|
|
1948
1946
|
};
|
|
1949
|
-
}, [V, R, n]),
|
|
1947
|
+
}, [V, R, n]), S(x(x({}, V.validateMessages), g)), T({
|
|
1950
1948
|
onValuesChange: p,
|
|
1951
1949
|
onFieldsChange: function(J) {
|
|
1952
1950
|
if (V.triggerFormChange(n, J), m) {
|
|
@@ -1961,7 +1959,7 @@ var Oe = /* @__PURE__ */ E.createContext({
|
|
|
1961
1959
|
onFinishFailed: F
|
|
1962
1960
|
}), M(u);
|
|
1963
1961
|
var _ = E.useRef(null);
|
|
1964
|
-
|
|
1962
|
+
O(r, !_.current), _.current || (_.current = !0), E.useEffect(
|
|
1965
1963
|
function() {
|
|
1966
1964
|
return function() {
|
|
1967
1965
|
return z(v);
|
|
@@ -1977,20 +1975,20 @@ var Oe = /* @__PURE__ */ E.createContext({
|
|
|
1977
1975
|
} else
|
|
1978
1976
|
G = l;
|
|
1979
1977
|
P(!Me);
|
|
1980
|
-
var
|
|
1978
|
+
var Ie = E.useRef();
|
|
1981
1979
|
E.useEffect(function() {
|
|
1982
|
-
Xr(
|
|
1980
|
+
Xr(Ie.current || [], i || []) || R.setFields(i || []), Ie.current = i;
|
|
1983
1981
|
}, [i, R]);
|
|
1984
1982
|
var or = E.useMemo(function() {
|
|
1985
|
-
return
|
|
1983
|
+
return x(x({}, R), {}, {
|
|
1986
1984
|
validateTrigger: b
|
|
1987
1985
|
});
|
|
1988
|
-
}, [R, b]),
|
|
1986
|
+
}, [R, b]), Se = /* @__PURE__ */ E.createElement(he.Provider, {
|
|
1989
1987
|
value: null
|
|
1990
1988
|
}, /* @__PURE__ */ E.createElement(ne.Provider, {
|
|
1991
1989
|
value: or
|
|
1992
1990
|
}, G));
|
|
1993
|
-
return o === !1 ?
|
|
1991
|
+
return o === !1 ? Se : /* @__PURE__ */ E.createElement(o, Ye({}, y, {
|
|
1994
1992
|
ref: C,
|
|
1995
1993
|
onSubmit: function(J) {
|
|
1996
1994
|
J.preventDefault(), J.stopPropagation(), R.submit();
|
|
@@ -1999,7 +1997,7 @@ var Oe = /* @__PURE__ */ E.createContext({
|
|
|
1999
1997
|
var Z;
|
|
2000
1998
|
J.preventDefault(), R.resetFields(), (Z = y.onReset) === null || Z === void 0 || Z.call(y, J);
|
|
2001
1999
|
}
|
|
2002
|
-
}),
|
|
2000
|
+
}), Se);
|
|
2003
2001
|
};
|
|
2004
2002
|
function Je(s) {
|
|
2005
2003
|
try {
|
|
@@ -2008,33 +2006,33 @@ function Je(s) {
|
|
|
2008
2006
|
return Math.random();
|
|
2009
2007
|
}
|
|
2010
2008
|
}
|
|
2011
|
-
var
|
|
2009
|
+
var ut = process.env.NODE_ENV !== "production" ? function(s) {
|
|
2012
2010
|
var t = s.join("__RC_FIELD_FORM_SPLIT__"), e = we(t);
|
|
2013
2011
|
D(e.current === t, "`useWatch` is not support dynamic `namePath`. Please provide static instead.");
|
|
2014
2012
|
} : function() {
|
|
2015
2013
|
};
|
|
2016
|
-
function
|
|
2014
|
+
function ot() {
|
|
2017
2015
|
for (var s = arguments.length, t = new Array(s), e = 0; e < s; e++)
|
|
2018
2016
|
t[e] = arguments[e];
|
|
2019
|
-
var n = t[0], r = t[1], i = r === void 0 ? {} : r, a =
|
|
2017
|
+
var n = t[0], r = t[1], i = r === void 0 ? {} : r, a = pr(i) ? {
|
|
2020
2018
|
form: i
|
|
2021
|
-
} : i, u = a.form, l =
|
|
2019
|
+
} : i, u = a.form, l = lr(), f = ue(l, 2), o = f[0], g = f[1], h = fr(function() {
|
|
2022
2020
|
return Je(o);
|
|
2023
2021
|
}, [o]), b = we(h);
|
|
2024
2022
|
b.current = h;
|
|
2025
|
-
var p =
|
|
2023
|
+
var p = cr(ne), m = u || p, c = m && m._init;
|
|
2026
2024
|
process.env.NODE_ENV !== "production" && D(t.length === 2 ? u ? c : !0 : c, "useWatch requires a form instance since it can not auto detect from context.");
|
|
2027
2025
|
var F = L(n), v = we(F);
|
|
2028
|
-
return v.current = F,
|
|
2026
|
+
return v.current = F, ut(F), dr(
|
|
2029
2027
|
function() {
|
|
2030
2028
|
if (c) {
|
|
2031
|
-
var y = m.getFieldsValue, C = m.getInternalHooks, V = C(
|
|
2032
|
-
var
|
|
2033
|
-
return typeof n == "function" ? n(
|
|
2034
|
-
}, R = A(function(P,
|
|
2035
|
-
var T =
|
|
2036
|
-
b.current !==
|
|
2037
|
-
}), w =
|
|
2029
|
+
var y = m.getFieldsValue, C = m.getInternalHooks, V = C(Q), A = V.registerWatch, N = function(O, T) {
|
|
2030
|
+
var S = a.preserve ? T : O;
|
|
2031
|
+
return typeof n == "function" ? n(S) : X(S, v.current);
|
|
2032
|
+
}, R = A(function(P, O) {
|
|
2033
|
+
var T = N(P, O), S = Je(T);
|
|
2034
|
+
b.current !== S && (b.current = S, g(T));
|
|
2035
|
+
}), w = N(y(), y(!0));
|
|
2038
2036
|
return o !== w && g(w), R;
|
|
2039
2037
|
}
|
|
2040
2038
|
},
|
|
@@ -2043,19 +2041,19 @@ function lt() {
|
|
|
2043
2041
|
[c]
|
|
2044
2042
|
), o;
|
|
2045
2043
|
}
|
|
2046
|
-
var
|
|
2044
|
+
var lt = /* @__PURE__ */ E.forwardRef(st), de = lt;
|
|
2047
2045
|
de.FormProvider = sr;
|
|
2048
2046
|
de.Field = nr;
|
|
2049
|
-
de.List =
|
|
2047
|
+
de.List = rt;
|
|
2050
2048
|
de.useForm = ar;
|
|
2051
|
-
de.useWatch =
|
|
2049
|
+
de.useWatch = ot;
|
|
2052
2050
|
const mt = /* @__PURE__ */ E.createContext({
|
|
2053
2051
|
labelAlign: "right",
|
|
2054
2052
|
vertical: !1,
|
|
2055
2053
|
itemRef: () => {
|
|
2056
2054
|
}
|
|
2057
2055
|
}), pt = /* @__PURE__ */ E.createContext(null), Ft = (s) => {
|
|
2058
|
-
const t =
|
|
2056
|
+
const t = mr(s, ["prefixCls"]);
|
|
2059
2057
|
return /* @__PURE__ */ E.createElement(sr, Object.assign({}, t));
|
|
2060
2058
|
}, yt = /* @__PURE__ */ E.createContext({
|
|
2061
2059
|
prefixCls: ""
|
|
@@ -2084,11 +2082,10 @@ export {
|
|
|
2084
2082
|
Vt as V,
|
|
2085
2083
|
nr as W,
|
|
2086
2084
|
yt as a,
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
ht as u
|
|
2085
|
+
Ft as b,
|
|
2086
|
+
mt as c,
|
|
2087
|
+
pt as d,
|
|
2088
|
+
rt as e,
|
|
2089
|
+
ot as f,
|
|
2090
|
+
ar as u
|
|
2094
2091
|
};
|