ods-component-lib 1.21.2 → 1.21.3
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/dist/components/antd/currencyInput/CurrencySelect.js +16 -11
- package/dist/components/antd/currencyInput/CurrencySelect.js.map +1 -1
- package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.js +32 -43
- package/dist/components/devextreme/OdsBasicDataGrid/OdsBasicDataGrid.js.map +1 -1
- package/dist/components/devextreme/OdsDataGrid.Legacy.js +4 -4
- package/dist/components/devextreme/OdsRemoteDataGrid.js +1 -1
- package/dist/index.js +10 -10
- package/dist/node_modules/@ant-design/cssinjs/es/StyleContext.js +6 -6
- package/dist/node_modules/@ant-design/cssinjs/es/StyleContext.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js +20 -20
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js +101 -98
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/linters/utils.js +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/util/index.js +29 -27
- package/dist/node_modules/@ant-design/cssinjs/es/util/index.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs-utils/es/util/getComponentToken.js +1 -1
- package/dist/node_modules/@ant-design/fast-color/es/FastColor.js +66 -45
- package/dist/node_modules/@ant-design/fast-color/es/FastColor.js.map +1 -1
- package/dist/node_modules/@ant-design/icons/es/icons/FrownOutlined.js +5 -8
- package/dist/node_modules/@ant-design/icons/es/icons/HeartOutlined.js +3 -6
- package/dist/node_modules/@ant-design/icons/es/icons/MehOutlined.js +12 -15
- package/dist/node_modules/@ant-design/icons/es/icons/SmileOutlined.js +8 -11
- package/dist/node_modules/@ant-design/icons/es/utils.js +2 -9
- package/dist/node_modules/@ant-design/icons/es/utils.js.map +1 -1
- package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js +1 -9
- package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/index.js +20 -20
- package/dist/node_modules/@rc-component/async-validator/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/messages.js +1 -0
- package/dist/node_modules/@rc-component/async-validator/es/messages.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/rule/type.js +18 -8
- package/dist/node_modules/@rc-component/async-validator/es/rule/type.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/util.js +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/util.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/validator/index.js +1 -0
- package/dist/node_modules/@rc-component/async-validator/es/validator/index.js.map +1 -1
- package/dist/node_modules/@rc-component/collapse/es/Collapse.js +1 -1
- package/dist/node_modules/@rc-component/collapse/es/hooks/useItems.js +88 -68
- package/dist/node_modules/@rc-component/collapse/es/hooks/useItems.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/Panel.js +75 -96
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/Panel.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/index.js +22 -20
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/index.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/Dialog/index.js +92 -100
- package/dist/node_modules/@rc-component/dialog/es/Dialog/index.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/DialogWrap.js +40 -29
- package/dist/node_modules/@rc-component/dialog/es/DialogWrap.js.map +1 -1
- package/dist/node_modules/@rc-component/dropdown/es/Dropdown.js +2 -2
- package/dist/node_modules/@rc-component/form/es/Field.js +9 -9
- package/dist/node_modules/@rc-component/form/es/FieldContext.js +2 -3
- package/dist/node_modules/@rc-component/form/es/FieldContext.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/Form.js +78 -92
- package/dist/node_modules/@rc-component/form/es/Form.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/List.js +1 -1
- package/dist/node_modules/@rc-component/form/es/{useForm.js → hooks/useForm.js} +136 -143
- package/dist/node_modules/@rc-component/form/es/hooks/useForm.js.map +1 -0
- package/dist/node_modules/@rc-component/form/es/hooks/useNotifyWatch.js +43 -0
- package/dist/node_modules/@rc-component/form/es/hooks/useNotifyWatch.js.map +1 -0
- package/dist/node_modules/@rc-component/form/es/{useWatch.js → hooks/useWatch.js} +7 -7
- package/dist/node_modules/@rc-component/form/es/hooks/useWatch.js.map +1 -0
- package/dist/node_modules/@rc-component/form/es/index.js +2 -2
- package/dist/node_modules/@rc-component/form/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/utils/NameMap.js +28 -22
- package/dist/node_modules/@rc-component/form/es/utils/NameMap.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/utils/messages.js +1 -0
- package/dist/node_modules/@rc-component/form/es/utils/messages.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/utils/validateUtil.js +1 -1
- package/dist/node_modules/@rc-component/form/es/utils/valueUtil.js.map +1 -1
- package/dist/node_modules/@rc-component/image/es/Preview/index.js +111 -105
- package/dist/node_modules/@rc-component/image/es/Preview/index.js.map +1 -1
- package/dist/node_modules/@rc-component/input-number/es/hooks/useCursor.js +1 -1
- package/dist/node_modules/@rc-component/menu/es/Menu.js +1 -1
- package/dist/node_modules/@rc-component/menu/es/MenuItem.js +1 -1
- package/dist/node_modules/@rc-component/menu/es/SubMenu/index.js +1 -1
- package/dist/node_modules/@rc-component/menu/es/hooks/useKeyRecords.js +1 -1
- package/dist/node_modules/@rc-component/menu/es/placements.js +0 -1
- package/dist/node_modules/@rc-component/menu/es/utils/warnUtil.js +1 -1
- package/dist/node_modules/@rc-component/pagination/es/Pagination.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerInput/RangePicker.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerInput/Selector/hooks/useClearIcon.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerInput/Selector/hooks/useInputProps.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerInput/hooks/useCellRender.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerInput/hooks/useFilledProps.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerInput/hooks/usePresets.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/PickerPanel/index.js +1 -1
- package/dist/node_modules/@rc-component/picker/es/hooks/useTimeInfo.js +1 -1
- package/dist/node_modules/@rc-component/portal/es/Portal.js +41 -35
- package/dist/node_modules/@rc-component/portal/es/Portal.js.map +1 -1
- package/dist/node_modules/@rc-component/portal/es/useEscKeyDown.js +48 -0
- package/dist/node_modules/@rc-component/portal/es/useEscKeyDown.js.map +1 -0
- package/dist/node_modules/@rc-component/resize-observer/es/SingleObserver/index.js +18 -54
- package/dist/node_modules/@rc-component/resize-observer/es/SingleObserver/index.js.map +1 -1
- package/dist/node_modules/@rc-component/resize-observer/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/resize-observer/es/useResizeObserver.js +50 -0
- package/dist/node_modules/@rc-component/resize-observer/es/useResizeObserver.js.map +1 -0
- package/dist/node_modules/@rc-component/select/es/BaseSelect/index.js +141 -140
- package/dist/node_modules/@rc-component/select/es/BaseSelect/index.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/OptionList.js +92 -91
- package/dist/node_modules/@rc-component/select/es/OptionList.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/Select.js +5 -5
- package/dist/node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js +50 -50
- package/dist/node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/SelectInput/Content/SingleContent.js +41 -47
- package/dist/node_modules/@rc-component/select/es/SelectInput/Content/SingleContent.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/SelectInput/index.js +85 -80
- package/dist/node_modules/@rc-component/select/es/SelectInput/index.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/hooks/useOpen.js +27 -26
- package/dist/node_modules/@rc-component/select/es/hooks/useOpen.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/utils/valueUtil.js +1 -1
- package/dist/node_modules/@rc-component/select/es/utils/warningPropsUtil.js +6 -6
- package/dist/node_modules/@rc-component/table/es/Cell/useCellRender.js +1 -1
- package/dist/node_modules/@rc-component/table/es/Table.js +1 -1
- package/dist/node_modules/@rc-component/table/es/VirtualTable/BodyGrid.js +85 -80
- package/dist/node_modules/@rc-component/table/es/VirtualTable/BodyGrid.js.map +1 -1
- package/dist/node_modules/@rc-component/table/es/VirtualTable/index.js +1 -1
- package/dist/node_modules/@rc-component/table/es/hooks/useColumns/index.js +1 -1
- package/dist/node_modules/@rc-component/table/es/hooks/useExpand.js +1 -1
- package/dist/node_modules/@rc-component/table/es/utils/legacyUtil.js +1 -1
- package/dist/node_modules/@rc-component/tabs/es/hooks/useAnimateConfig.js +1 -1
- package/dist/node_modules/@rc-component/tooltip/es/placements.js +0 -1
- package/dist/node_modules/@rc-component/tree/es/Tree.js +1 -1
- package/dist/node_modules/@rc-component/tree/es/util.js +1 -1
- package/dist/node_modules/@rc-component/tree/es/utils/conductUtil.js +1 -1
- package/dist/node_modules/@rc-component/tree/es/utils/treeUtil.js +1 -1
- package/dist/node_modules/@rc-component/tree-select/es/TreeSelect.js +1 -1
- package/dist/node_modules/@rc-component/tree-select/es/hooks/useDataEntities.js +1 -1
- package/dist/node_modules/@rc-component/tree-select/es/utils/legacyUtil.js +1 -1
- package/dist/node_modules/@rc-component/tree-select/es/utils/warningPropsUtil.js +1 -1
- package/dist/node_modules/@rc-component/trigger/es/Popup/index.js +74 -72
- package/dist/node_modules/@rc-component/trigger/es/Popup/index.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/UniqueProvider/index.js +10 -9
- package/dist/node_modules/@rc-component/trigger/es/UniqueProvider/index.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/hooks/useAlign.js +126 -123
- package/dist/node_modules/@rc-component/trigger/es/hooks/useAlign.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/index.js +150 -140
- package/dist/node_modules/@rc-component/trigger/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/util.js +35 -34
- package/dist/node_modules/@rc-component/trigger/es/util.js.map +1 -1
- package/dist/node_modules/@rc-component/upload/es/attr-accept.js +1 -1
- package/dist/node_modules/@rc-component/util/es/Dom/focus.js +65 -20
- package/dist/node_modules/@rc-component/util/es/Dom/focus.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/KeyCode.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/hooks/useId.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/hooks/useState.js +6 -6
- package/dist/node_modules/@rc-component/util/es/hooks/useState.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/hooks/useSyncState.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/isEqual.js +1 -1
- package/dist/node_modules/@rc-component/util/es/utils/set.js +21 -21
- package/dist/node_modules/@rc-component/util/es/utils/set.js.map +1 -1
- package/dist/node_modules/@rc-component/virtual-list/es/hooks/useScrollTo.js +1 -1
- package/dist/node_modules/antd/es/_util/warning.js +1 -1
- package/dist/node_modules/antd/es/_util/wave/WaveEffect.js +53 -48
- package/dist/node_modules/antd/es/_util/wave/WaveEffect.js.map +1 -1
- package/dist/node_modules/antd/es/_util/wave/index.js +1 -1
- package/dist/node_modules/antd/es/_util/wave/index.js.map +1 -1
- package/dist/node_modules/antd/es/_util/wave/style.js +8 -7
- package/dist/node_modules/antd/es/_util/wave/style.js.map +1 -1
- package/dist/node_modules/antd/es/alert/Alert.js +133 -128
- package/dist/node_modules/antd/es/alert/Alert.js.map +1 -1
- package/dist/node_modules/antd/es/badge/Badge.js +29 -28
- package/dist/node_modules/antd/es/badge/Badge.js.map +1 -1
- package/dist/node_modules/antd/es/badge/style/index.js +1 -1
- package/dist/node_modules/antd/es/badge/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/button/buttonHelpers.js +47 -41
- package/dist/node_modules/antd/es/button/buttonHelpers.js.map +1 -1
- package/dist/node_modules/antd/es/button/style/compact.js +45 -36
- package/dist/node_modules/antd/es/button/style/compact.js.map +1 -1
- package/dist/node_modules/antd/es/button/style/variant.js +100 -90
- package/dist/node_modules/antd/es/button/style/variant.js.map +1 -1
- package/dist/node_modules/antd/es/calendar/generateCalendar.js +55 -57
- package/dist/node_modules/antd/es/calendar/generateCalendar.js.map +1 -1
- package/dist/node_modules/antd/es/calendar/style/index.js +18 -18
- package/dist/node_modules/antd/es/calendar/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/card/CardGrid.js.map +1 -1
- package/dist/node_modules/antd/es/card/style/index.js +23 -11
- package/dist/node_modules/antd/es/card/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/checkbox/Group.js +32 -30
- package/dist/node_modules/antd/es/checkbox/Group.js.map +1 -1
- package/dist/node_modules/antd/es/collapse/Collapse.js +61 -61
- package/dist/node_modules/antd/es/collapse/Collapse.js.map +1 -1
- package/dist/node_modules/antd/es/color-picker/color.js +9 -9
- package/dist/node_modules/antd/es/color-picker/color.js.map +1 -1
- package/dist/node_modules/antd/es/config-provider/index.js +76 -71
- package/dist/node_modules/antd/es/config-provider/index.js.map +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js +29 -31
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js.map +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js +7 -9
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js.map +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/{SuffixIcon.js → useSuffixIcon.js} +4 -4
- package/dist/node_modules/antd/es/date-picker/generatePicker/useSuffixIcon.js.map +1 -0
- package/dist/node_modules/antd/es/date-picker/style/panel.js +4 -4
- package/dist/node_modules/antd/es/date-picker/style/panel.js.map +1 -1
- package/dist/node_modules/antd/es/drawer/useFocusable.js +14 -0
- package/dist/node_modules/antd/es/drawer/useFocusable.js.map +1 -0
- package/dist/node_modules/antd/es/empty/empty.js +27 -32
- package/dist/node_modules/antd/es/empty/empty.js.map +1 -1
- package/dist/node_modules/antd/es/empty/simple.js +2 -2
- package/dist/node_modules/antd/es/empty/simple.js.map +1 -1
- package/dist/node_modules/antd/es/form/hooks/useForm.js +2 -2
- package/dist/node_modules/antd/es/form/index.js +1 -1
- package/dist/node_modules/antd/es/form/style/index.js +24 -24
- package/dist/node_modules/antd/es/form/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/grid/col.js +56 -54
- package/dist/node_modules/antd/es/grid/col.js.map +1 -1
- package/dist/node_modules/antd/es/grid/style/index.js +50 -50
- package/dist/node_modules/antd/es/grid/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/input/TextArea.js +16 -15
- package/dist/node_modules/antd/es/input/TextArea.js.map +1 -1
- package/dist/node_modules/antd/es/input/style/index.js +1 -0
- package/dist/node_modules/antd/es/input/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/input-number/index.js +91 -91
- package/dist/node_modules/antd/es/input-number/index.js.map +1 -1
- package/dist/node_modules/antd/es/input-number/style/index.js +80 -79
- package/dist/node_modules/antd/es/input-number/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/layout/Sider.js +1 -2
- package/dist/node_modules/antd/es/layout/style/sider.js +9 -9
- package/dist/node_modules/antd/es/layout/style/sider.js.map +1 -1
- package/dist/node_modules/antd/es/menu/MenuItem.js +6 -6
- package/dist/node_modules/antd/es/menu/MenuItem.js.map +1 -1
- package/dist/node_modules/antd/es/menu/SubMenu.js +8 -8
- package/dist/node_modules/antd/es/menu/SubMenu.js.map +1 -1
- package/dist/node_modules/antd/es/menu/style/horizontal.js +1 -1
- package/dist/node_modules/antd/es/menu/style/horizontal.js.map +1 -1
- package/dist/node_modules/antd/es/menu/style/index.js +58 -58
- package/dist/node_modules/antd/es/menu/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/menu/style/vertical.js +1 -1
- package/dist/node_modules/antd/es/menu/style/vertical.js.map +1 -1
- package/dist/node_modules/antd/es/message/index.js +1 -1
- package/dist/node_modules/antd/es/modal/ConfirmDialog.js +117 -112
- package/dist/node_modules/antd/es/modal/ConfirmDialog.js.map +1 -1
- package/dist/node_modules/antd/es/modal/Modal.js +115 -109
- package/dist/node_modules/antd/es/modal/Modal.js.map +1 -1
- package/dist/node_modules/antd/es/modal/confirm.js +3 -3
- package/dist/node_modules/antd/es/modal/style/index.js +83 -80
- package/dist/node_modules/antd/es/modal/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/pagination/Pagination.js +85 -81
- package/dist/node_modules/antd/es/pagination/Pagination.js.map +1 -1
- package/dist/node_modules/antd/es/pagination/style/bordered.js +2 -2
- package/dist/node_modules/antd/es/pagination/style/bordered.js.map +1 -1
- package/dist/node_modules/antd/es/pagination/style/index.js +100 -133
- package/dist/node_modules/antd/es/pagination/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/popover/index.js +77 -82
- package/dist/node_modules/antd/es/popover/index.js.map +1 -1
- package/dist/node_modules/antd/es/popover/style/index.js +65 -63
- package/dist/node_modules/antd/es/popover/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/progress/progress.js +4 -4
- package/dist/node_modules/antd/es/radio/context.js +3 -3
- package/dist/node_modules/antd/es/radio/context.js.map +1 -1
- package/dist/node_modules/antd/es/radio/group.js +31 -29
- package/dist/node_modules/antd/es/radio/group.js.map +1 -1
- package/dist/node_modules/antd/es/radio/style/index.js +1 -1
- package/dist/node_modules/antd/es/radio/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/select/style/dropdown.js +1 -1
- package/dist/node_modules/antd/es/select/style/dropdown.js.map +1 -1
- package/dist/node_modules/antd/es/select/style/select-input-multiple.js +71 -69
- package/dist/node_modules/antd/es/select/style/select-input-multiple.js.map +1 -1
- package/dist/node_modules/antd/es/select/style/select-input.js +113 -98
- package/dist/node_modules/antd/es/select/style/select-input.js.map +1 -1
- package/dist/node_modules/antd/es/skeleton/Image.js +9 -9
- package/dist/node_modules/antd/es/skeleton/Image.js.map +1 -1
- package/dist/node_modules/antd/es/space/Item.js +2 -2
- package/dist/node_modules/antd/es/space/Item.js.map +1 -1
- package/dist/node_modules/antd/es/space/index.js +4 -4
- package/dist/node_modules/antd/es/space/index.js.map +1 -1
- package/dist/node_modules/antd/es/space/style/addon.js +47 -46
- package/dist/node_modules/antd/es/space/style/addon.js.map +1 -1
- package/dist/node_modules/antd/es/steps/PanelArrow.js +2 -2
- package/dist/node_modules/antd/es/steps/PanelArrow.js.map +1 -1
- package/dist/node_modules/antd/es/steps/ProgressIcon.js +12 -10
- package/dist/node_modules/antd/es/steps/ProgressIcon.js.map +1 -1
- package/dist/node_modules/antd/es/steps/index.js +108 -106
- package/dist/node_modules/antd/es/steps/index.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/horizontal.js +13 -11
- package/dist/node_modules/antd/es/steps/style/horizontal.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/icon.js +23 -18
- package/dist/node_modules/antd/es/steps/style/icon.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/index.js +41 -41
- package/dist/node_modules/antd/es/steps/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/inline.js +28 -23
- package/dist/node_modules/antd/es/steps/style/inline.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/label-placement.js +44 -39
- package/dist/node_modules/antd/es/steps/style/label-placement.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/nav.js +29 -27
- package/dist/node_modules/antd/es/steps/style/nav.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/panel.js +61 -56
- package/dist/node_modules/antd/es/steps/style/panel.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/progress-dot.js +28 -26
- package/dist/node_modules/antd/es/steps/style/progress-dot.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/progress.js +24 -57
- package/dist/node_modules/antd/es/steps/style/progress.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/rtl.js +10 -8
- package/dist/node_modules/antd/es/steps/style/rtl.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/small.js +21 -16
- package/dist/node_modules/antd/es/steps/style/small.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/status.js +187 -176
- package/dist/node_modules/antd/es/steps/style/status.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/util.js +18 -16
- package/dist/node_modules/antd/es/steps/style/util.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/vertical.js +21 -16
- package/dist/node_modules/antd/es/steps/style/vertical.js.map +1 -1
- package/dist/node_modules/antd/es/style/placementArrow.js +31 -29
- package/dist/node_modules/antd/es/style/placementArrow.js.map +1 -1
- package/dist/node_modules/antd/es/table/InternalTable.js +65 -62
- package/dist/node_modules/antd/es/table/InternalTable.js.map +1 -1
- package/dist/node_modules/antd/es/table/TableMeasureRowContext.js +6 -0
- package/dist/node_modules/antd/es/table/TableMeasureRowContext.js.map +1 -0
- package/dist/node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js +145 -137
- package/dist/node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js.map +1 -1
- package/dist/node_modules/antd/es/table/style/index.js +3 -3
- package/dist/node_modules/antd/es/table/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/table/style/radius.js +10 -0
- package/dist/node_modules/antd/es/table/style/radius.js.map +1 -1
- package/dist/node_modules/antd/es/table/style/virtual.js +5 -5
- package/dist/node_modules/antd/es/table/style/virtual.js.map +1 -1
- package/dist/node_modules/antd/es/tag/style/index.js +5 -5
- package/dist/node_modules/antd/es/tag/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/theme/util/genStyleUtils.js +29 -32
- package/dist/node_modules/antd/es/theme/util/genStyleUtils.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/Timeline.js +76 -74
- package/dist/node_modules/antd/es/timeline/Timeline.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/style/horizontal.js +21 -18
- package/dist/node_modules/antd/es/timeline/style/horizontal.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/style/index.js +85 -70
- package/dist/node_modules/antd/es/timeline/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/useItems.js +38 -37
- package/dist/node_modules/antd/es/timeline/useItems.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/PurePanel.js +27 -27
- package/dist/node_modules/antd/es/tooltip/PurePanel.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/MotionContent.js +17 -22
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/MotionContent.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/index.js +27 -26
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/index.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/index.js +52 -51
- package/dist/node_modules/antd/es/tooltip/index.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/style/index.js +55 -52
- package/dist/node_modules/antd/es/tooltip/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/util.js +13 -12
- package/dist/node_modules/antd/es/tooltip/util.js.map +1 -1
- package/dist/node_modules/antd/es/transfer/ListBody.js +16 -16
- package/dist/node_modules/antd/es/transfer/ListBody.js.map +1 -1
- package/dist/node_modules/antd/es/transfer/ListItem.js +43 -43
- package/dist/node_modules/antd/es/transfer/ListItem.js.map +1 -1
- package/dist/node_modules/antd/es/transfer/style/index.js +1 -1
- package/dist/node_modules/antd/es/tree/DirectoryTree.js +42 -41
- package/dist/node_modules/antd/es/tree/DirectoryTree.js.map +1 -1
- package/dist/node_modules/antd/es/typography/Base/index.js +43 -42
- package/dist/node_modules/antd/es/typography/Base/index.js.map +1 -1
- package/dist/node_modules/antd/es/typography/style/index.js +43 -43
- package/dist/node_modules/antd/es/typography/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/typography/style/mixins.js +1 -1
- package/dist/node_modules/antd/es/typography/style/mixins.js.map +1 -1
- package/dist/node_modules/antd/es/version/version.js +1 -1
- package/dist/node_modules/antd/es/version/version.js.map +1 -1
- package/dist/node_modules/antd/es/watermark/context.js +5 -6
- package/dist/node_modules/antd/es/watermark/context.js.map +1 -1
- package/dist/node_modules/antd-style/node_modules/@ant-design/cssinjs/es/StyleContext.js +1 -2
- package/dist/node_modules/antd-style/node_modules/@ant-design/cssinjs/es/StyleContext.js.map +1 -1
- package/dist/node_modules/exceljs/dist/exceljs.min.js +91 -508
- package/dist/node_modules/exceljs/dist/exceljs.min.js.map +1 -1
- package/dist/node_modules/html2canvas/dist/html2canvas.esm.js +5 -55
- package/dist/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -1
- package/dist/node_modules/jspdf/dist/jspdf.es.min.js +8 -53
- package/dist/node_modules/jspdf/dist/jspdf.es.min.js.map +1 -1
- package/dist/node_modules/lodash/lodash.js +295 -278
- package/dist/node_modules/lodash/lodash.js.map +1 -1
- package/dist/node_modules/moment/dist/moment.js +2 -8
- package/dist/node_modules/moment/dist/moment.js.map +1 -1
- package/dist/node_modules/rc-util/es/isEqual.js +1 -1
- package/package.json +1 -1
- package/dist/node_modules/@rc-component/form/es/BatchUpdate.js +0 -21
- package/dist/node_modules/@rc-component/form/es/BatchUpdate.js.map +0 -1
- package/dist/node_modules/@rc-component/form/es/useForm.js.map +0 -1
- package/dist/node_modules/@rc-component/form/es/useWatch.js.map +0 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/SuffixIcon.js.map +0 -1
package/dist/node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultipleContent.js","sources":["../../../../../../../node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js"],"sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport { clsx } from 'clsx';\nimport Overflow from '@rc-component/overflow';\nimport Input from \"../Input\";\nimport { useSelectInputContext } from \"../context\";\nimport TransBtn from \"../../TransBtn\";\nimport { getTitle } from \"../../utils/commonUtil\";\nimport useBaseProps from \"../../hooks/useBaseProps\";\nimport Placeholder from \"./Placeholder\";\nfunction itemKey(value) {\n return value.key ?? value.value;\n}\nconst onPreventMouseDown = event => {\n event.preventDefault();\n event.stopPropagation();\n};\nexport default /*#__PURE__*/React.forwardRef(function MultipleContent({\n inputProps\n}, ref) {\n const {\n prefixCls,\n displayValues,\n searchValue,\n mode,\n onSelectorRemove,\n removeIcon: removeIconFromContext\n } = useSelectInputContext();\n const {\n disabled,\n showSearch,\n triggerOpen,\n toggleOpen,\n autoClearSearchValue,\n tagRender: tagRenderFromContext,\n maxTagPlaceholder: maxTagPlaceholderFromContext,\n maxTagTextLength,\n maxTagCount,\n classNames,\n styles\n } = useBaseProps();\n const selectionItemPrefixCls = `${prefixCls}-selection-item`;\n\n // ===================== Search ======================\n // Apply autoClearSearchValue logic: when dropdown is closed and autoClearSearchValue is not false (default true), clear search value\n let computedSearchValue = searchValue;\n if (!triggerOpen && mode === 'multiple' && autoClearSearchValue !== false) {\n computedSearchValue = '';\n }\n const inputValue = showSearch ? computedSearchValue || '' : '';\n const inputEditable = showSearch && !disabled;\n\n // Props from context with safe defaults\n const removeIcon = removeIconFromContext ?? '×';\n const maxTagPlaceholder = maxTagPlaceholderFromContext ?? (omittedValues => `+ ${omittedValues.length} ...`);\n const tagRender = tagRenderFromContext;\n const onToggleOpen = newOpen => {\n toggleOpen(newOpen);\n };\n const onRemove = value => {\n onSelectorRemove?.(value);\n };\n\n // ======================== Item ========================\n // >>> Render Selector Node. Includes Item & Rest\n const defaultRenderSelector = (item, content, itemDisabled, closable, onClose) => /*#__PURE__*/React.createElement(\"span\", {\n title: getTitle(item),\n className: clsx(selectionItemPrefixCls, {\n [`${selectionItemPrefixCls}-disabled`]: itemDisabled\n }, classNames?.item),\n style: styles?.item\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(`${selectionItemPrefixCls}-content`, classNames?.itemContent),\n style: styles?.itemContent\n }, content), closable && /*#__PURE__*/React.createElement(TransBtn, {\n className: clsx(`${selectionItemPrefixCls}-remove`, classNames?.itemRemove),\n style: styles?.itemRemove,\n onMouseDown: onPreventMouseDown,\n onClick: onClose,\n customizeIcon: removeIcon\n }, \"\\xD7\"));\n const customizeRenderSelector = (value, content, itemDisabled, closable, onClose, isMaxTag, info) => {\n const onMouseDown = e => {\n onPreventMouseDown(e);\n onToggleOpen(!triggerOpen);\n };\n return /*#__PURE__*/React.createElement(\"span\", {\n onMouseDown: onMouseDown\n }, tagRender({\n label: content,\n value,\n index: info?.index,\n disabled: itemDisabled,\n closable,\n onClose,\n isMaxTag: !!isMaxTag\n }));\n };\n\n // ====================== Overflow ======================\n const renderItem = (valueItem, info) => {\n const {\n disabled: itemDisabled,\n label,\n value\n } = valueItem;\n const closable = !disabled && !itemDisabled;\n let displayLabel = label;\n if (typeof maxTagTextLength === 'number') {\n if (typeof label === 'string' || typeof label === 'number') {\n const strLabel = String(displayLabel);\n if (strLabel.length > maxTagTextLength) {\n displayLabel = `${strLabel.slice(0, maxTagTextLength)}...`;\n }\n }\n }\n const onClose = event => {\n if (event) {\n event.stopPropagation();\n }\n onRemove(valueItem);\n };\n return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose, undefined, info) : defaultRenderSelector(valueItem, displayLabel, itemDisabled, closable, onClose);\n };\n const renderRest = omittedValues => {\n // https://github.com/ant-design/ant-design/issues/48930\n if (!displayValues.length) {\n return null;\n }\n const content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;\n return typeof tagRender === 'function' ? customizeRenderSelector(undefined, content, false, false, undefined, true) : defaultRenderSelector({\n title: content\n }, content, false);\n };\n\n // ======================= Render =======================\n return /*#__PURE__*/React.createElement(Overflow, {\n prefixCls: `${prefixCls}-content`,\n className: classNames?.content,\n style: styles?.content,\n prefix: !displayValues.length && (!searchValue || !triggerOpen) ? /*#__PURE__*/React.createElement(Placeholder, null) : null,\n data: displayValues,\n renderItem: renderItem,\n renderRest: renderRest,\n suffix: /*#__PURE__*/React.createElement(Input, _extends({\n ref: ref,\n disabled: disabled,\n readOnly: !inputEditable\n }, inputProps, {\n value: inputValue || '',\n syncWidth: true\n })),\n itemKey: itemKey,\n maxCount: maxTagCount\n });\n});"],"names":["_extends","target","i","source","key","itemKey","value","onPreventMouseDown","event","MultipleContent","React","inputProps","ref","prefixCls","displayValues","searchValue","mode","onSelectorRemove","removeIconFromContext","useSelectInputContext","disabled","showSearch","triggerOpen","toggleOpen","autoClearSearchValue","tagRenderFromContext","maxTagPlaceholderFromContext","maxTagTextLength","maxTagCount","classNames","styles","useBaseProps","selectionItemPrefixCls","computedSearchValue","inputValue","inputEditable","removeIcon","maxTagPlaceholder","omittedValues","tagRender","onToggleOpen","newOpen","onRemove","defaultRenderSelector","item","content","itemDisabled","closable","onClose","getTitle","clsx","TransBtn","customizeRenderSelector","isMaxTag","info","onMouseDown","e","renderItem","valueItem","label","displayLabel","strLabel","renderRest","Overflow","Placeholder","Input"],"mappings":";;;;;;;;;AAAA,SAASA,IAAW;AAAE,SAAAA,IAAW,OAAO,SAAS,OAAO,OAAO,SAAS,SAAUC,GAAQ;AAAE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAAE,UAAIC,IAAS,UAAUD,CAAC;AAAG,eAASE,KAAOD;AAAU,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAQC,CAAG,MAAKH,EAAOG,CAAG,IA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":[0]}
|
|
1
|
+
{"version":3,"file":"MultipleContent.js","sources":["../../../../../../../node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js"],"sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport { clsx } from 'clsx';\nimport Overflow from '@rc-component/overflow';\nimport Input from \"../Input\";\nimport { useSelectInputContext } from \"../context\";\nimport TransBtn from \"../../TransBtn\";\nimport { getTitle } from \"../../utils/commonUtil\";\nimport useBaseProps from \"../../hooks/useBaseProps\";\nimport Placeholder from \"./Placeholder\";\nfunction itemKey(value) {\n return value.key ?? value.value;\n}\nconst onPreventMouseDown = event => {\n event.preventDefault();\n event.stopPropagation();\n};\nexport default /*#__PURE__*/React.forwardRef(function MultipleContent({\n inputProps\n}, ref) {\n const {\n prefixCls,\n displayValues,\n searchValue,\n mode,\n onSelectorRemove,\n removeIcon: removeIconFromContext\n } = useSelectInputContext();\n const {\n disabled,\n showSearch,\n triggerOpen,\n toggleOpen,\n autoClearSearchValue,\n tagRender: tagRenderFromContext,\n maxTagPlaceholder: maxTagPlaceholderFromContext,\n maxTagTextLength,\n maxTagCount,\n classNames,\n styles\n } = useBaseProps();\n const selectionItemPrefixCls = `${prefixCls}-selection-item`;\n\n // ===================== Search ======================\n // Apply autoClearSearchValue logic: when dropdown is closed and autoClearSearchValue is not false (default true), clear search value\n let computedSearchValue = searchValue;\n if (!triggerOpen && mode === 'multiple' && autoClearSearchValue !== false) {\n computedSearchValue = '';\n }\n const inputValue = showSearch ? computedSearchValue || '' : '';\n const inputEditable = showSearch && !disabled;\n\n // Props from context with safe defaults\n const removeIcon = removeIconFromContext ?? '×';\n const maxTagPlaceholder = maxTagPlaceholderFromContext ?? (omittedValues => `+ ${omittedValues.length} ...`);\n const tagRender = tagRenderFromContext;\n const onToggleOpen = newOpen => {\n toggleOpen(newOpen);\n };\n const onRemove = value => {\n onSelectorRemove?.(value);\n };\n\n // ======================== Item ========================\n // >>> Render Selector Node. Includes Item & Rest\n const defaultRenderSelector = (item, content, itemDisabled, closable, onClose) => /*#__PURE__*/React.createElement(\"span\", {\n title: getTitle(item),\n className: clsx(selectionItemPrefixCls, {\n [`${selectionItemPrefixCls}-disabled`]: itemDisabled\n }, classNames?.item),\n style: styles?.item\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(`${selectionItemPrefixCls}-content`, classNames?.itemContent),\n style: styles?.itemContent\n }, content), closable && /*#__PURE__*/React.createElement(TransBtn, {\n className: clsx(`${selectionItemPrefixCls}-remove`, classNames?.itemRemove),\n style: styles?.itemRemove,\n onMouseDown: onPreventMouseDown,\n onClick: onClose,\n customizeIcon: removeIcon\n }, \"\\xD7\"));\n const customizeRenderSelector = (value, content, itemDisabled, closable, onClose, isMaxTag, info) => {\n const onMouseDown = e => {\n onPreventMouseDown(e);\n onToggleOpen(!triggerOpen);\n };\n return /*#__PURE__*/React.createElement(\"span\", {\n onMouseDown: onMouseDown\n }, tagRender({\n label: content,\n value,\n index: info?.index,\n disabled: itemDisabled,\n closable,\n onClose,\n isMaxTag: !!isMaxTag\n }));\n };\n\n // ====================== Overflow ======================\n const renderItem = (valueItem, info) => {\n const {\n disabled: itemDisabled,\n label,\n value\n } = valueItem;\n const closable = !disabled && !itemDisabled;\n let displayLabel = label;\n if (typeof maxTagTextLength === 'number') {\n if (typeof label === 'string' || typeof label === 'number') {\n const strLabel = String(displayLabel);\n if (strLabel.length > maxTagTextLength) {\n displayLabel = `${strLabel.slice(0, maxTagTextLength)}...`;\n }\n }\n }\n const onClose = event => {\n if (event) {\n event.stopPropagation();\n }\n onRemove(valueItem);\n };\n return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose, undefined, info) : defaultRenderSelector(valueItem, displayLabel, itemDisabled, closable, onClose);\n };\n const renderRest = omittedValues => {\n // https://github.com/ant-design/ant-design/issues/48930\n if (!displayValues.length) {\n return null;\n }\n const content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;\n return typeof tagRender === 'function' ? customizeRenderSelector(undefined, content, false, false, undefined, true) : defaultRenderSelector({\n title: content\n }, content, false);\n };\n\n // ======================= Render =======================\n return /*#__PURE__*/React.createElement(Overflow, {\n prefixCls: `${prefixCls}-content`,\n className: classNames?.content,\n style: styles?.content,\n prefix: !displayValues.length && !inputValue && /*#__PURE__*/React.createElement(Placeholder, null),\n data: displayValues,\n renderItem: renderItem,\n renderRest: renderRest,\n suffix: /*#__PURE__*/React.createElement(Input, _extends({\n ref: ref,\n disabled: disabled,\n readOnly: !inputEditable\n }, inputProps, {\n value: inputValue || '',\n syncWidth: true\n })),\n itemKey: itemKey,\n maxCount: maxTagCount\n });\n});"],"names":["_extends","target","i","source","key","itemKey","value","onPreventMouseDown","event","MultipleContent","React","inputProps","ref","prefixCls","displayValues","searchValue","mode","onSelectorRemove","removeIconFromContext","useSelectInputContext","disabled","showSearch","triggerOpen","toggleOpen","autoClearSearchValue","tagRenderFromContext","maxTagPlaceholderFromContext","maxTagTextLength","maxTagCount","classNames","styles","useBaseProps","selectionItemPrefixCls","computedSearchValue","inputValue","inputEditable","removeIcon","maxTagPlaceholder","omittedValues","tagRender","onToggleOpen","newOpen","onRemove","defaultRenderSelector","item","content","itemDisabled","closable","onClose","getTitle","clsx","TransBtn","customizeRenderSelector","isMaxTag","info","onMouseDown","e","renderItem","valueItem","label","displayLabel","strLabel","renderRest","Overflow","Placeholder","Input"],"mappings":";;;;;;;;;AAAA,SAASA,IAAW;AAAE,SAAAA,IAAW,OAAO,SAAS,OAAO,OAAO,SAAS,SAAUC,GAAQ;AAAE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAAE,UAAIC,IAAS,UAAUD,CAAC;AAAG,eAASE,KAAOD;AAAU,QAAI,OA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B;AAAA,EACd,CAAG;AACH,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,87 +1,81 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as e from "react";
|
|
2
2
|
import { clsx as y } from "../../../../../clsx/dist/clsx.js";
|
|
3
|
-
import
|
|
4
|
-
import { useSelectInputContext as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import w from "../Input.js";
|
|
4
|
+
import { useSelectInputContext as P } from "../context.js";
|
|
5
|
+
import I from "../../hooks/useBaseProps.js";
|
|
6
|
+
import L from "./Placeholder.js";
|
|
7
|
+
import M from "../../SelectContext.js";
|
|
8
8
|
import { getTitle as C } from "../../utils/commonUtil.js";
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
for (var
|
|
12
|
-
var n = arguments[
|
|
9
|
+
function d() {
|
|
10
|
+
return d = Object.assign ? Object.assign.bind() : function(a) {
|
|
11
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
12
|
+
var n = arguments[r];
|
|
13
13
|
for (var s in n)
|
|
14
14
|
Object.prototype.hasOwnProperty.call(n, s) && (a[s] = n[s]);
|
|
15
15
|
}
|
|
16
16
|
return a;
|
|
17
|
-
},
|
|
17
|
+
}, d.apply(this, arguments);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const A = /* @__PURE__ */ e.forwardRef(({
|
|
20
20
|
inputProps: a
|
|
21
|
-
},
|
|
21
|
+
}, r) => {
|
|
22
22
|
const {
|
|
23
23
|
prefixCls: n,
|
|
24
24
|
searchValue: s,
|
|
25
|
-
activeValue:
|
|
25
|
+
activeValue: l,
|
|
26
26
|
displayValues: O,
|
|
27
27
|
maxLength: N,
|
|
28
|
-
mode:
|
|
29
|
-
} =
|
|
30
|
-
triggerOpen:
|
|
28
|
+
mode: g
|
|
29
|
+
} = P(), {
|
|
30
|
+
triggerOpen: h,
|
|
31
31
|
title: m,
|
|
32
|
-
showSearch:
|
|
32
|
+
showSearch: b,
|
|
33
33
|
classNames: S,
|
|
34
34
|
styles: E
|
|
35
|
-
} =
|
|
36
|
-
|
|
35
|
+
} = I(), f = e.useContext(M), [x, v] = e.useState(!1), i = g === "combobox", o = O[0], c = e.useMemo(() => i && l && !x && h ? l : b ? s : "", [i, l, x, h, s, b]), V = e.useMemo(() => {
|
|
36
|
+
const t = {
|
|
37
37
|
className: `${n}-content-value`,
|
|
38
|
-
style: {
|
|
39
|
-
visibility:
|
|
40
|
-
}
|
|
38
|
+
style: c ? {
|
|
39
|
+
visibility: "hidden"
|
|
40
|
+
} : {}
|
|
41
41
|
};
|
|
42
42
|
if (o && f?.flattenOptions) {
|
|
43
|
-
const u = f.flattenOptions.find((
|
|
43
|
+
const u = f.flattenOptions.find((p) => p.value === o.value);
|
|
44
44
|
if (u?.data) {
|
|
45
45
|
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className: w,
|
|
49
|
-
style: P,
|
|
50
|
-
key: B,
|
|
51
|
-
...j
|
|
46
|
+
className: p,
|
|
47
|
+
style: j
|
|
52
48
|
} = u.data;
|
|
53
|
-
|
|
54
|
-
...e,
|
|
55
|
-
...j,
|
|
49
|
+
Object.assign(t, {
|
|
56
50
|
title: C(u.data),
|
|
57
|
-
className: y(
|
|
51
|
+
className: y(t.className, p),
|
|
58
52
|
style: {
|
|
59
|
-
...
|
|
60
|
-
...
|
|
53
|
+
...t.style,
|
|
54
|
+
...j
|
|
61
55
|
}
|
|
62
|
-
};
|
|
56
|
+
});
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
|
-
return o && !
|
|
59
|
+
return o && !t.title && (t.title = C(o)), m !== void 0 && (t.title = m), t;
|
|
66
60
|
}, [o, f?.flattenOptions, n, c, m]);
|
|
67
|
-
return
|
|
61
|
+
return e.useEffect(() => {
|
|
68
62
|
i && v(!1);
|
|
69
|
-
}, [i,
|
|
63
|
+
}, [i, l]), /* @__PURE__ */ e.createElement("div", {
|
|
70
64
|
className: y(`${n}-content`, S?.content),
|
|
71
65
|
style: E?.content
|
|
72
|
-
}, o ? /* @__PURE__ */
|
|
66
|
+
}, o ? /* @__PURE__ */ e.createElement("div", V, o.label) : /* @__PURE__ */ e.createElement(L, {
|
|
73
67
|
show: !c
|
|
74
|
-
}), /* @__PURE__ */
|
|
75
|
-
ref:
|
|
68
|
+
}), /* @__PURE__ */ e.createElement(w, d({
|
|
69
|
+
ref: r
|
|
76
70
|
}, a, {
|
|
77
71
|
value: c,
|
|
78
|
-
maxLength:
|
|
79
|
-
onChange: (
|
|
80
|
-
v(!0), a.onChange?.(
|
|
72
|
+
maxLength: g === "combobox" ? N : void 0,
|
|
73
|
+
onChange: (t) => {
|
|
74
|
+
v(!0), a.onChange?.(t);
|
|
81
75
|
}
|
|
82
76
|
})));
|
|
83
77
|
});
|
|
84
78
|
export {
|
|
85
|
-
|
|
79
|
+
A as default
|
|
86
80
|
};
|
|
87
81
|
//# sourceMappingURL=SingleContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleContent.js","sources":["../../../../../../../node_modules/@rc-component/select/es/SelectInput/Content/SingleContent.js"],"sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport { clsx } from 'clsx';\nimport Input from \"../Input\";\nimport { useSelectInputContext } from \"../context\";\nimport useBaseProps from \"../../hooks/useBaseProps\";\nimport Placeholder from \"./Placeholder\";\nimport SelectContext from \"../../SelectContext\";\nimport { getTitle } from \"../../utils/commonUtil\";\nconst SingleContent = /*#__PURE__*/React.forwardRef(({\n inputProps\n}, ref) => {\n const {\n prefixCls,\n searchValue,\n activeValue,\n displayValues,\n maxLength,\n mode\n } = useSelectInputContext();\n const {\n triggerOpen,\n title: rootTitle,\n showSearch,\n classNames,\n styles\n } = useBaseProps();\n const selectContext = React.useContext(SelectContext);\n const [inputChanged, setInputChanged] = React.useState(false);\n const combobox = mode === 'combobox';\n const displayValue = displayValues[0];\n\n // Implement the same logic as the old SingleSelector\n const mergedSearchValue = React.useMemo(() => {\n if (combobox && activeValue && !inputChanged && triggerOpen) {\n return activeValue;\n }\n return showSearch ? searchValue : '';\n }, [combobox, activeValue, inputChanged, triggerOpen, searchValue, showSearch]);\n\n // Extract option props, excluding label and value, and handle className/style merging\n const optionProps = React.useMemo(() => {\n
|
|
1
|
+
{"version":3,"file":"SingleContent.js","sources":["../../../../../../../node_modules/@rc-component/select/es/SelectInput/Content/SingleContent.js"],"sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport { clsx } from 'clsx';\nimport Input from \"../Input\";\nimport { useSelectInputContext } from \"../context\";\nimport useBaseProps from \"../../hooks/useBaseProps\";\nimport Placeholder from \"./Placeholder\";\nimport SelectContext from \"../../SelectContext\";\nimport { getTitle } from \"../../utils/commonUtil\";\nconst SingleContent = /*#__PURE__*/React.forwardRef(({\n inputProps\n}, ref) => {\n const {\n prefixCls,\n searchValue,\n activeValue,\n displayValues,\n maxLength,\n mode\n } = useSelectInputContext();\n const {\n triggerOpen,\n title: rootTitle,\n showSearch,\n classNames,\n styles\n } = useBaseProps();\n const selectContext = React.useContext(SelectContext);\n const [inputChanged, setInputChanged] = React.useState(false);\n const combobox = mode === 'combobox';\n const displayValue = displayValues[0];\n\n // Implement the same logic as the old SingleSelector\n const mergedSearchValue = React.useMemo(() => {\n if (combobox && activeValue && !inputChanged && triggerOpen) {\n return activeValue;\n }\n return showSearch ? searchValue : '';\n }, [combobox, activeValue, inputChanged, triggerOpen, searchValue, showSearch]);\n\n // Extract option props, excluding label and value, and handle className/style merging\n const optionProps = React.useMemo(() => {\n const restProps = {\n className: `${prefixCls}-content-value`,\n style: mergedSearchValue ? {\n visibility: 'hidden'\n } : {}\n };\n if (displayValue && selectContext?.flattenOptions) {\n const option = selectContext.flattenOptions.find(opt => opt.value === displayValue.value);\n if (option?.data) {\n const {\n className,\n style\n } = option.data;\n Object.assign(restProps, {\n title: getTitle(option.data),\n className: clsx(restProps.className, className),\n style: {\n ...restProps.style,\n ...style\n }\n });\n }\n }\n if (displayValue && !restProps.title) {\n restProps.title = getTitle(displayValue);\n }\n if (rootTitle !== undefined) {\n restProps.title = rootTitle;\n }\n return restProps;\n }, [displayValue, selectContext?.flattenOptions, prefixCls, mergedSearchValue, rootTitle]);\n React.useEffect(() => {\n if (combobox) {\n setInputChanged(false);\n }\n }, [combobox, activeValue]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: clsx(`${prefixCls}-content`, classNames?.content),\n style: styles?.content\n }, displayValue ? /*#__PURE__*/React.createElement(\"div\", optionProps, displayValue.label) : /*#__PURE__*/React.createElement(Placeholder, {\n show: !mergedSearchValue\n }), /*#__PURE__*/React.createElement(Input, _extends({\n ref: ref\n }, inputProps, {\n value: mergedSearchValue,\n maxLength: mode === 'combobox' ? maxLength : undefined,\n onChange: e => {\n setInputChanged(true);\n inputProps.onChange?.(e);\n }\n })));\n});\nexport default SingleContent;"],"names":["_extends","target","i","source","key","SingleContent","React","inputProps","ref","prefixCls","searchValue","activeValue","displayValues","maxLength","mode","useSelectInputContext","triggerOpen","rootTitle","showSearch","classNames","styles","useBaseProps","selectContext","SelectContext","inputChanged","setInputChanged","combobox","displayValue","mergedSearchValue","optionProps","restProps","option","opt","className","style","getTitle","clsx","Placeholder","Input","e"],"mappings":";;;;;;;;AAAA,SAASA,IAAW;AAAE,SAAAA,IAAW,OAAO,SAAS,OAAO,OAAO,SAAS,SAAUC,GAAQ;AAAE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAAE,UAAIC,IAAS,UAAUD,CAAC;AAAG,eAAS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A,UACvB,OAAOK,EAASJ,EAAO,IAAI;AAAA,UAC3B,WAAWK,EAAKN,EAAU,WAAWG,CAAS;AAAA,UAC9C,OAAO;AAAA,YACL,GAAGH,EAAU;AAAA,YACb,GAAGI;AAAA,UACf;AAAA,QACA,CAAS;AAAA,MACH;AAAA,IACF;AACA,WAAIP,KAAgB,CAACG,EAAU,UAC7BA,EAAU,QAAQK,EAASR,CAAY,IAErCV,MAAc,WAChBa,EAAU,QAAQb,IAEba;AAAA,EACT,GAAG,CAACH,GAAcL,GAAe,gBAAgBb,GAAWmB,GAAmBX,CAAS,CAAC;AACzF,SAAAX,EAAM,UAAU,MAAM;AACpB,IAAIoB,KACFD,EAAgB,EAAK;AAAA,EAEzB,GAAG,CAACC,GAAUf,CAAW,CAAC,GACN,gBAAAL,EAAM,cAAc,OAAO;AAAA,IAC7C,WAAW8B,EAAK,GAAG3B,CAAS,YAAYU,GAAY,OAAO;AAAA,IAC3D,OAAOC,GAAQ;AAAA,EACnB,GAAKO,IAA4B,gBAAArB,EAAM,cAAc,OAAOuB,GAAaF,EAAa,KAAK,IAAiB,gBAAArB,EAAM,cAAc+B,GAAa;AAAA,IACzI,MAAM,CAACT;AAAA,EACX,CAAG,GAAgB,gBAAAtB,EAAM,cAAcgC,GAAOtC,EAAS;AAAA,IACnD,KAAKQ;AAAA,EACT,GAAKD,GAAY;AAAA,IACb,OAAOqB;AAAA,IACP,WAAWd,MAAS,aAAaD,IAAY;AAAA,IAC7C,UAAU,CAAA0B,MAAK;AACb,MAAAd,EAAgB,EAAI,GACpBlB,EAAW,WAAWgC,CAAC;AAAA,IACzB;AAAA,EACJ,CAAG,CAAC,CAAC;AACL,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,72 +1,75 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import h from "./Affix.js";
|
|
3
|
+
import W from "./Content/index.js";
|
|
4
|
+
import z from "./context.js";
|
|
5
|
+
import B from "../hooks/useBaseProps.js";
|
|
6
6
|
import l from "../../../util/es/KeyCode.js";
|
|
7
|
-
import { isValidateOpenKey as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { getDOM as
|
|
10
|
-
import { composeRef as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
import { isValidateOpenKey as k } from "../utils/keyUtil.js";
|
|
8
|
+
import { clsx as E } from "../../../../clsx/dist/clsx.js";
|
|
9
|
+
import { getDOM as G } from "../../../util/es/Dom/findDOMNode.js";
|
|
10
|
+
import { composeRef as q } from "../../../util/es/ref.js";
|
|
11
|
+
import J from "../../../util/es/pickAttrs.js";
|
|
12
|
+
import O from "../../../util/es/hooks/useEvent.js";
|
|
13
|
+
import v from "../../../util/es/omit.js";
|
|
14
|
+
function p() {
|
|
15
|
+
return p = Object.assign ? Object.assign.bind() : function(d) {
|
|
16
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
17
|
+
var c = arguments[n];
|
|
18
|
+
for (var r in c)
|
|
19
|
+
Object.prototype.hasOwnProperty.call(c, r) && (d[r] = c[r]);
|
|
19
20
|
}
|
|
20
|
-
return
|
|
21
|
-
},
|
|
21
|
+
return d;
|
|
22
|
+
}, p.apply(this, arguments);
|
|
22
23
|
}
|
|
23
|
-
const
|
|
24
|
+
const Q = ["value", "onChange", "removeIcon", "placeholder", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex", "activeValue", "onSelectorRemove", "focused"], De = /* @__PURE__ */ t.forwardRef(function(n, c) {
|
|
24
25
|
const {
|
|
25
26
|
// Style
|
|
26
|
-
prefixCls:
|
|
27
|
-
className:
|
|
28
|
-
style:
|
|
27
|
+
prefixCls: r,
|
|
28
|
+
className: w,
|
|
29
|
+
style: P,
|
|
29
30
|
// UI
|
|
30
|
-
prefix:
|
|
31
|
+
prefix: b,
|
|
31
32
|
suffix: R,
|
|
32
|
-
clearIcon:
|
|
33
|
+
clearIcon: D,
|
|
33
34
|
children: S,
|
|
34
35
|
// Data
|
|
35
36
|
multiple: T,
|
|
36
|
-
displayValues:
|
|
37
|
-
placeholder:
|
|
38
|
-
mode:
|
|
37
|
+
displayValues: X,
|
|
38
|
+
placeholder: Y,
|
|
39
|
+
mode: M,
|
|
39
40
|
// Search
|
|
40
|
-
searchValue:
|
|
41
|
-
onSearch:
|
|
42
|
-
onSearchSubmit:
|
|
43
|
-
onInputBlur:
|
|
41
|
+
searchValue: Z,
|
|
42
|
+
onSearch: ee,
|
|
43
|
+
onSearchSubmit: te,
|
|
44
|
+
onInputBlur: oe,
|
|
44
45
|
// Input
|
|
45
|
-
maxLength:
|
|
46
|
-
autoFocus:
|
|
46
|
+
maxLength: re,
|
|
47
|
+
autoFocus: ne,
|
|
47
48
|
// Events
|
|
48
|
-
onMouseDown:
|
|
49
|
-
onClearMouseDown:
|
|
50
|
-
onInputKeyDown:
|
|
51
|
-
onSelectorRemove:
|
|
49
|
+
onMouseDown: K,
|
|
50
|
+
onClearMouseDown: C,
|
|
51
|
+
onInputKeyDown: I,
|
|
52
|
+
onSelectorRemove: ae,
|
|
52
53
|
// Token handling
|
|
53
|
-
tokenWithEnter:
|
|
54
|
+
tokenWithEnter: se,
|
|
54
55
|
// Components
|
|
55
56
|
components: N,
|
|
56
57
|
..._
|
|
57
|
-
} =
|
|
58
|
+
} = n, {
|
|
58
59
|
triggerOpen: u,
|
|
59
60
|
toggleOpen: x,
|
|
60
|
-
showSearch:
|
|
61
|
-
disabled:
|
|
61
|
+
showSearch: V,
|
|
62
|
+
disabled: A,
|
|
62
63
|
loading: L,
|
|
63
|
-
classNames:
|
|
64
|
-
styles:
|
|
65
|
-
} =
|
|
64
|
+
classNames: g,
|
|
65
|
+
styles: y
|
|
66
|
+
} = B(), a = t.useRef(null), s = t.useRef(null), j = O((e) => {
|
|
66
67
|
const {
|
|
67
|
-
which:
|
|
68
|
-
} = e,
|
|
69
|
-
!
|
|
68
|
+
which: o
|
|
69
|
+
} = e, m = s.current instanceof HTMLTextAreaElement;
|
|
70
|
+
if (!m && u && (o === l.UP || o === l.DOWN) && e.preventDefault(), I && I(e), m && !u && ~[l.UP, l.DOWN, l.LEFT, l.RIGHT].indexOf(o))
|
|
71
|
+
return;
|
|
72
|
+
!(e.ctrlKey || e.altKey || e.metaKey) && k(o) && x(!0);
|
|
70
73
|
});
|
|
71
74
|
t.useImperativeHandle(c, () => ({
|
|
72
75
|
focus: (e) => {
|
|
@@ -77,52 +80,54 @@ const q = ["value", "onChange", "removeIcon", "placeholder", "maxTagCount", "max
|
|
|
77
80
|
},
|
|
78
81
|
nativeElement: a.current
|
|
79
82
|
}));
|
|
80
|
-
const $ =
|
|
81
|
-
if (!
|
|
82
|
-
const
|
|
83
|
-
e.nativeEvent._ori_target =
|
|
84
|
-
const
|
|
85
|
-
e.nativeEvent._select_lazy ? u && x(!1) : (s.current?.focus(),
|
|
83
|
+
const $ = O((e) => {
|
|
84
|
+
if (!A) {
|
|
85
|
+
const o = G(s.current);
|
|
86
|
+
e.nativeEvent._ori_target = o, o && e.target !== o && !o.contains(e.target) && e.preventDefault();
|
|
87
|
+
const m = u && !T && (M === "combobox" || V);
|
|
88
|
+
e.nativeEvent._select_lazy ? u && x(!1) : (s.current?.focus(), m || x());
|
|
86
89
|
}
|
|
87
|
-
|
|
90
|
+
K?.(e);
|
|
88
91
|
}), {
|
|
89
92
|
root: i
|
|
90
|
-
} = N,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
} = N, f = v(_, Q), F = J(f, {
|
|
94
|
+
aria: !0
|
|
95
|
+
}), H = Object.keys(F), U = {
|
|
96
|
+
...n,
|
|
97
|
+
onInputKeyDown: j
|
|
93
98
|
};
|
|
94
99
|
return i ? /* @__PURE__ */ t.isValidElement(i) ? /* @__PURE__ */ t.cloneElement(i, {
|
|
95
|
-
...
|
|
96
|
-
ref:
|
|
97
|
-
}) : /* @__PURE__ */ t.createElement(i,
|
|
100
|
+
...f,
|
|
101
|
+
ref: q(i.ref, a)
|
|
102
|
+
}) : /* @__PURE__ */ t.createElement(i, p({}, f, {
|
|
98
103
|
ref: a
|
|
99
|
-
})) : /* @__PURE__ */ t.createElement(
|
|
100
|
-
value:
|
|
101
|
-
}, /* @__PURE__ */ t.createElement("div",
|
|
104
|
+
})) : /* @__PURE__ */ t.createElement(z.Provider, {
|
|
105
|
+
value: U
|
|
106
|
+
}, /* @__PURE__ */ t.createElement("div", p({}, v(f, H), {
|
|
102
107
|
// Style
|
|
103
108
|
ref: a,
|
|
104
|
-
className:
|
|
105
|
-
style:
|
|
109
|
+
className: w,
|
|
110
|
+
style: P,
|
|
106
111
|
onMouseDown: $
|
|
107
|
-
}), /* @__PURE__ */ t.createElement(
|
|
108
|
-
className:
|
|
109
|
-
style:
|
|
110
|
-
},
|
|
112
|
+
}), /* @__PURE__ */ t.createElement(h, {
|
|
113
|
+
className: E(`${r}-prefix`, g?.prefix),
|
|
114
|
+
style: y?.prefix
|
|
115
|
+
}, b), /* @__PURE__ */ t.createElement(W, {
|
|
111
116
|
ref: s
|
|
112
|
-
}), /* @__PURE__ */ t.createElement(
|
|
113
|
-
className:
|
|
114
|
-
[`${
|
|
115
|
-
},
|
|
116
|
-
style:
|
|
117
|
-
}, R),
|
|
118
|
-
className:
|
|
119
|
-
style:
|
|
117
|
+
}), /* @__PURE__ */ t.createElement(h, {
|
|
118
|
+
className: E(`${r}-suffix`, {
|
|
119
|
+
[`${r}-suffix-loading`]: L
|
|
120
|
+
}, g?.suffix),
|
|
121
|
+
style: y?.suffix
|
|
122
|
+
}, R), D && /* @__PURE__ */ t.createElement(h, {
|
|
123
|
+
className: E(`${r}-clear`, g?.clear),
|
|
124
|
+
style: y?.clear,
|
|
120
125
|
onMouseDown: (e) => {
|
|
121
|
-
e.nativeEvent._select_lazy = !0,
|
|
126
|
+
e.nativeEvent._select_lazy = !0, C?.(e);
|
|
122
127
|
}
|
|
123
|
-
},
|
|
128
|
+
}, D), S));
|
|
124
129
|
});
|
|
125
130
|
export {
|
|
126
|
-
|
|
131
|
+
De as default
|
|
127
132
|
};
|
|
128
133
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@rc-component/select/es/SelectInput/index.js"],"sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport Affix from \"./Affix\";\nimport SelectContent from \"./Content\";\nimport SelectInputContext from \"./context\";\nimport useBaseProps from \"../hooks/useBaseProps\";\nimport { omit, useEvent } from '@rc-component/util';\nimport KeyCode from \"@rc-component/util/es/KeyCode\";\nimport { isValidateOpenKey } from \"../utils/keyUtil\";\nimport { clsx } from 'clsx';\nimport { getDOM } from \"@rc-component/util/es/Dom/findDOMNode\";\nimport { composeRef } from \"@rc-component/util/es/ref\";\nconst DEFAULT_OMIT_PROPS = ['value', 'onChange', 'removeIcon', 'placeholder', 'maxTagCount', 'maxTagTextLength', 'maxTagPlaceholder', 'choiceTransitionName', 'onInputKeyDown', 'onPopupScroll', 'tabIndex', 'activeValue', 'onSelectorRemove', 'focused'];\nexport default /*#__PURE__*/React.forwardRef(function SelectInput(props, ref) {\n const {\n // Style\n prefixCls,\n className,\n style,\n // UI\n prefix,\n suffix,\n clearIcon,\n children,\n // Data\n multiple,\n displayValues,\n placeholder,\n mode,\n // Search\n searchValue,\n onSearch,\n onSearchSubmit,\n onInputBlur,\n // Input\n maxLength,\n autoFocus,\n // Events\n onMouseDown,\n onClearMouseDown,\n onInputKeyDown,\n onSelectorRemove,\n // Token handling\n tokenWithEnter,\n // Components\n components,\n ...restProps\n } = props;\n const {\n triggerOpen,\n toggleOpen,\n showSearch,\n disabled,\n loading,\n classNames,\n styles\n } = useBaseProps();\n const rootRef = React.useRef(null);\n const inputRef = React.useRef(null);\n\n // Handle keyboard events similar to original Selector\n const onInternalInputKeyDown = useEvent(event => {\n const {\n which\n } = event;\n\n // Compatible with multiple lines in TextArea\n const isTextAreaElement = inputRef.current instanceof HTMLTextAreaElement;\n\n // Prevent default behavior for up/down arrows when dropdown is open\n if (!isTextAreaElement && triggerOpen && (which === KeyCode.UP || which === KeyCode.DOWN)) {\n event.preventDefault();\n }\n\n // Call the original onInputKeyDown callback\n if (onInputKeyDown) {\n onInputKeyDown(event);\n }\n\n // Move within the text box for TextArea\n if (isTextAreaElement && !triggerOpen && ~[KeyCode.UP, KeyCode.DOWN, KeyCode.LEFT, KeyCode.RIGHT].indexOf(which)) {\n return;\n }\n\n // Open dropdown when a valid open key is pressed\n if (isValidateOpenKey(which)) {\n toggleOpen(true);\n }\n });\n\n // ====================== Refs ======================\n React.useImperativeHandle(ref, () => {\n return {\n focus: options => {\n // Focus the inner input if available, otherwise fall back to root div.\n (inputRef.current || rootRef.current).focus?.(options);\n },\n blur: () => {\n (inputRef.current || rootRef.current).blur?.();\n },\n nativeElement: rootRef.current\n };\n });\n\n // ====================== Open ======================\n const onInternalMouseDown = useEvent(event => {\n if (!disabled) {\n const inputDOM = getDOM(inputRef.current);\n\n // https://github.com/ant-design/ant-design/issues/56002\n // Tell `useSelectTriggerControl` to ignore this event\n // When icon is dynamic render, the parentNode will miss\n // so we need to mark the event directly\n event.nativeEvent._ori_target = inputDOM;\n if (inputDOM && event.target !== inputDOM && !inputDOM.contains(event.target)) {\n event.preventDefault();\n }\n\n // Check if we should prevent closing when clicking on selector\n // Don't close if: open && not multiple && (combobox mode || showSearch)\n const shouldPreventClose = triggerOpen && !multiple && (mode === 'combobox' || showSearch);\n if (!event.nativeEvent._select_lazy) {\n inputRef.current?.focus();\n\n // Only toggle open if we should not prevent close\n if (!shouldPreventClose) {\n toggleOpen();\n }\n } else if (triggerOpen) {\n // Lazy should also close when click clear icon\n toggleOpen(false);\n }\n }\n onMouseDown?.(event);\n });\n\n // =================== Components ===================\n const {\n root: RootComponent\n } = components;\n\n // ===================== Render =====================\n const domProps = omit(restProps, DEFAULT_OMIT_PROPS);\n\n // Create context value with wrapped callbacks\n const contextValue = {\n ...props,\n onInputKeyDown: onInternalInputKeyDown\n };\n if (RootComponent) {\n if ( /*#__PURE__*/React.isValidElement(RootComponent)) {\n return /*#__PURE__*/React.cloneElement(RootComponent, {\n ...domProps,\n ref: composeRef(RootComponent.ref, rootRef)\n });\n }\n return /*#__PURE__*/React.createElement(RootComponent, _extends({}, domProps, {\n ref: rootRef\n }));\n }\n return /*#__PURE__*/React.createElement(SelectInputContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(\"div\", _extends({}, domProps, {\n // Style\n ref: rootRef,\n className: className,\n style: style\n // Mouse Events\n ,\n onMouseDown: onInternalMouseDown\n }), /*#__PURE__*/React.createElement(Affix, {\n className: clsx(`${prefixCls}-prefix`, classNames?.prefix),\n style: styles?.prefix\n }, prefix), /*#__PURE__*/React.createElement(SelectContent, {\n ref: inputRef\n }), /*#__PURE__*/React.createElement(Affix, {\n className: clsx(`${prefixCls}-suffix`, {\n [`${prefixCls}-suffix-loading`]: loading\n }, classNames?.suffix),\n style: styles?.suffix\n }, suffix), clearIcon && /*#__PURE__*/React.createElement(Affix, {\n className: clsx(`${prefixCls}-clear`, classNames?.clear),\n style: styles?.clear,\n onMouseDown: e => {\n // Mark to tell not trigger open or focus\n e.nativeEvent._select_lazy = true;\n onClearMouseDown?.(e);\n }\n }, clearIcon), children));\n});"],"names":["_extends","target","i","source","key","DEFAULT_OMIT_PROPS","SelectInput","React","props","ref","prefixCls","className","style","prefix","suffix","clearIcon","children","multiple","displayValues","placeholder","mode","searchValue","onSearch","onSearchSubmit","onInputBlur","maxLength","autoFocus","onMouseDown","onClearMouseDown","onInputKeyDown","onSelectorRemove","tokenWithEnter","components","restProps","triggerOpen","toggleOpen","showSearch","disabled","loading","classNames","styles","useBaseProps","rootRef","inputRef","onInternalInputKeyDown","useEvent","event","which","isTextAreaElement","KeyCode","isValidateOpenKey","options","onInternalMouseDown","inputDOM","getDOM","shouldPreventClose","RootComponent","domProps","omit","contextValue","composeRef","SelectInputContext","Affix","clsx","SelectContent"],"mappings":";;;;;;;;;;;;AAAA,SAASA,IAAW;AAAE,SAAAA,IAAW,OAAO,SAAS,OAAO,OAAO,SAAS,SAAUC,GAAQ;AAAE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAAE,UAAIC,IAAS,UAAUD,CAAC;AAAG,eAASE,KAAOD;AAAU,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAQC,CAAG,MAAKH,EAAOG,CAAG,IAAID,EAAOC,CAAG;AAAA,IAAO;AAAE,WAAOH;AAAA,EAAQ,GAAUD,EAAS,MAAM,MAAM,SAAS;AAAG;AAYlV,MAAMK,IAAqB,CAAC,SAAS,YAAY,cAAc,eAAe,eAAe,oBAAoB,qBAAqB,wBAAwB,kBAAkB,iBAAiB,YAAY,eAAe,oBAAoB,SAAS,GACzPC,KAA4B,gBAAAC,EAAM,WAAW,SAAqBC,GAAOC,GAAK;AAC5E,QAAM;AAAA;AAAA,IAEJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA;AAAA,IAEA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA;AAAA,IAEA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC;AAAA;AAAA,IAEA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC;AAAA;AAAA,IAEA,WAAAC;AAAA,IACA,WAAAC;AAAA;AAAA,IAEA,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA;AAAA,IA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GAAOC,GAAY,MAAM;AAAA,IACrB,OAAOC,GAAQ;AAAA,EACnB,GAAK1B,CAAM,GAAGC,KAA0B,gBAAAR,EAAM,cAAcuD,GAAO;AAAA,IAC/D,WAAWC,EAAK,GAAGrD,CAAS,UAAU6B,GAAY,KAAK;AAAA,IACvD,OAAOC,GAAQ;AAAA,IACf,aAAa,OAAK;AAEhB,QAAE,YAAY,eAAe,IAC7BZ,IAAmB,CAAC;AAAA,IACtB;AAAA,EACJ,GAAKb,CAAS,GAAGC,CAAQ,CAAC;AAC1B,CAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@rc-component/select/es/SelectInput/index.js"],"sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport Affix from \"./Affix\";\nimport SelectContent from \"./Content\";\nimport SelectInputContext from \"./context\";\nimport useBaseProps from \"../hooks/useBaseProps\";\nimport { omit, useEvent } from '@rc-component/util';\nimport KeyCode from \"@rc-component/util/es/KeyCode\";\nimport { isValidateOpenKey } from \"../utils/keyUtil\";\nimport { clsx } from 'clsx';\nimport { getDOM } from \"@rc-component/util/es/Dom/findDOMNode\";\nimport { composeRef } from \"@rc-component/util/es/ref\";\nimport pickAttrs from \"@rc-component/util/es/pickAttrs\";\nconst DEFAULT_OMIT_PROPS = ['value', 'onChange', 'removeIcon', 'placeholder', 'maxTagCount', 'maxTagTextLength', 'maxTagPlaceholder', 'choiceTransitionName', 'onInputKeyDown', 'onPopupScroll', 'tabIndex', 'activeValue', 'onSelectorRemove', 'focused'];\nexport default /*#__PURE__*/React.forwardRef(function SelectInput(props, ref) {\n const {\n // Style\n prefixCls,\n className,\n style,\n // UI\n prefix,\n suffix,\n clearIcon,\n children,\n // Data\n multiple,\n displayValues,\n placeholder,\n mode,\n // Search\n searchValue,\n onSearch,\n onSearchSubmit,\n onInputBlur,\n // Input\n maxLength,\n autoFocus,\n // Events\n onMouseDown,\n onClearMouseDown,\n onInputKeyDown,\n onSelectorRemove,\n // Token handling\n tokenWithEnter,\n // Components\n components,\n ...restProps\n } = props;\n const {\n triggerOpen,\n toggleOpen,\n showSearch,\n disabled,\n loading,\n classNames,\n styles\n } = useBaseProps();\n const rootRef = React.useRef(null);\n const inputRef = React.useRef(null);\n\n // Handle keyboard events similar to original Selector\n const onInternalInputKeyDown = useEvent(event => {\n const {\n which\n } = event;\n\n // Compatible with multiple lines in TextArea\n const isTextAreaElement = inputRef.current instanceof HTMLTextAreaElement;\n\n // Prevent default behavior for up/down arrows when dropdown is open\n if (!isTextAreaElement && triggerOpen && (which === KeyCode.UP || which === KeyCode.DOWN)) {\n event.preventDefault();\n }\n\n // Call the original onInputKeyDown callback\n if (onInputKeyDown) {\n onInputKeyDown(event);\n }\n\n // Move within the text box for TextArea\n if (isTextAreaElement && !triggerOpen && ~[KeyCode.UP, KeyCode.DOWN, KeyCode.LEFT, KeyCode.RIGHT].indexOf(which)) {\n return;\n }\n\n // Open dropdown when a valid open key is pressed\n const isModifier = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifier && isValidateOpenKey(which)) {\n toggleOpen(true);\n }\n });\n\n // ====================== Refs ======================\n React.useImperativeHandle(ref, () => {\n return {\n focus: options => {\n // Focus the inner input if available, otherwise fall back to root div.\n (inputRef.current || rootRef.current).focus?.(options);\n },\n blur: () => {\n (inputRef.current || rootRef.current).blur?.();\n },\n nativeElement: rootRef.current\n };\n });\n\n // ====================== Open ======================\n const onInternalMouseDown = useEvent(event => {\n if (!disabled) {\n const inputDOM = getDOM(inputRef.current);\n\n // https://github.com/ant-design/ant-design/issues/56002\n // Tell `useSelectTriggerControl` to ignore this event\n // When icon is dynamic render, the parentNode will miss\n // so we need to mark the event directly\n event.nativeEvent._ori_target = inputDOM;\n if (inputDOM && event.target !== inputDOM && !inputDOM.contains(event.target)) {\n event.preventDefault();\n }\n\n // Check if we should prevent closing when clicking on selector\n // Don't close if: open && not multiple && (combobox mode || showSearch)\n const shouldPreventClose = triggerOpen && !multiple && (mode === 'combobox' || showSearch);\n if (!event.nativeEvent._select_lazy) {\n inputRef.current?.focus();\n\n // Only toggle open if we should not prevent close\n if (!shouldPreventClose) {\n toggleOpen();\n }\n } else if (triggerOpen) {\n // Lazy should also close when click clear icon\n toggleOpen(false);\n }\n }\n onMouseDown?.(event);\n });\n\n // =================== Components ===================\n const {\n root: RootComponent\n } = components;\n\n // ===================== Render =====================\n const domProps = omit(restProps, DEFAULT_OMIT_PROPS);\n const ariaProps = pickAttrs(domProps, {\n aria: true\n });\n const ariaKeys = Object.keys(ariaProps);\n\n // Create context value with wrapped callbacks\n const contextValue = {\n ...props,\n onInputKeyDown: onInternalInputKeyDown\n };\n if (RootComponent) {\n if ( /*#__PURE__*/React.isValidElement(RootComponent)) {\n return /*#__PURE__*/React.cloneElement(RootComponent, {\n ...domProps,\n ref: composeRef(RootComponent.ref, rootRef)\n });\n }\n return /*#__PURE__*/React.createElement(RootComponent, _extends({}, domProps, {\n ref: rootRef\n }));\n }\n return /*#__PURE__*/React.createElement(SelectInputContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(\"div\", _extends({}, omit(domProps, ariaKeys), {\n // Style\n ref: rootRef,\n className: className,\n style: style\n // Mouse Events\n ,\n onMouseDown: onInternalMouseDown\n }), /*#__PURE__*/React.createElement(Affix, {\n className: clsx(`${prefixCls}-prefix`, classNames?.prefix),\n style: styles?.prefix\n }, prefix), /*#__PURE__*/React.createElement(SelectContent, {\n ref: inputRef\n }), /*#__PURE__*/React.createElement(Affix, {\n className: clsx(`${prefixCls}-suffix`, {\n [`${prefixCls}-suffix-loading`]: loading\n }, classNames?.suffix),\n style: styles?.suffix\n }, suffix), clearIcon && /*#__PURE__*/React.createElement(Affix, {\n className: clsx(`${prefixCls}-clear`, classNames?.clear),\n style: styles?.clear,\n onMouseDown: e => {\n // Mark to tell not trigger open or focus\n e.nativeEvent._select_lazy = true;\n onClearMouseDown?.(e);\n }\n }, clearIcon), children));\n});"],"names":["_extends","target","i","source","key","DEFAULT_OMIT_PROPS","SelectInput","React","props","ref","prefixCls","className","style","prefix","suffix","clearIcon","children","multiple","displayValues","placeholder","mode","searchValue","onSearch","onSearchSubmit","onInputBlur","maxLength","autoFocus","onMouseDown","onClearMouseDown","onInputKeyDown","onSelectorRemove","tokenWithEnter","components","restProps","triggerOpen","toggleOpen","showSearch","disabled","loading","classNames","styles","useBaseProps","rootRef","inputRef","onInternalInputKeyDown","useEvent","event","which","isTextAreaElement","KeyCode","isValidateOpenKey","options","onInternalMouseDown","inputDOM","getDOM","shouldPreventClose","RootComponent","domProps","omit","ariaProps","pickAttrs","ariaKeys","contextValue","composeRef","SelectInputContext","Affix","clsx","SelectContent"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,IAAW;AAAE,SAAAA,IAAW,OAAO,SAAS,OAAO,OAAO,SAAS,SAAUC,GAAQ;AAAE,aAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAAE,UAAIC,IAAS,UAAUD,CAAC;AAAG,eAASE,KAAOD;AAAU,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAQC,CAAG,MAAKH,EAAOG,CAAG,IAAID,EAAOC,CAAG;AAAA,IAAO;AAAE,WAAOH;AAAA,EAAQ,GAAUD,EAAS,MAAM,MAAM,SAAS;AAAG;AAalV,MAAMK,IAAqB,CAAC,SAAS,YAAY,cAAc,eAAe,eAAe,oBAAoB,qBAAqB,wBAAwB,kBAAkB,iBAAiB,YAAY,eAAe,oBAAoB,SAAS,GACzPC,KAA4B,gBAAAC,EAAM,WAAW,SAAqBC,GAAOC,GAAK;AAC5E,QAAM;AAAA;AAAA,IAEJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA;AAAA,IAEA,QAAAC;AAAA,IACA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CAAA,GAAI0D,EAAKD,GAAUI,CAAQ,GAAG;AAAA;AAAA,IAEhF,KAAKnB;AAAA,IACL,WAAW/B;AAAA,IACX,OAAOC;AAAA,IAGP,aAAawC;AAAA,EACjB,CAAG,GAAgB,gBAAA7C,EAAM,cAAc0D,GAAO;AAAA,IAC1C,WAAWC,EAAK,GAAGxD,CAAS,WAAW6B,GAAY,MAAM;AAAA,IACzD,OAAOC,GAAQ;AAAA,EACnB,GAAK3B,CAAM,GAAgB,gBAAAN,EAAM,cAAc4D,GAAe;AAAA,IAC1D,KAAKxB;AAAA,EACT,CAAG,GAAgB,gBAAApC,EAAM,cAAc0D,GAAO;AAAA,IAC1C,WAAWC,EAAK,GAAGxD,CAAS,WAAW;AAAA,MACrC,CAAC,GAAGA,CAAS,iBAAiB,GAAG4B;AAAA,IACvC,GAAOC,GAAY,MAAM;AAAA,IACrB,OAAOC,GAAQ;AAAA,EACnB,GAAK1B,CAAM,GAAGC,KAA0B,gBAAAR,EAAM,cAAc0D,GAAO;AAAA,IAC/D,WAAWC,EAAK,GAAGxD,CAAS,UAAU6B,GAAY,KAAK;AAAA,IACvD,OAAOC,GAAQ;AAAA,IACf,aAAa,OAAK;AAEhB,QAAE,YAAY,eAAe,IAC7BZ,IAAmB,CAAC;AAAA,IACtB;AAAA,EACJ,GAAKb,CAAS,GAAGC,CAAQ,CAAC;AAC1B,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { useState as l, useEffect as v, useRef as C } from "react";
|
|
2
|
+
import T from "../../../util/es/hooks/useControlledState.js";
|
|
3
|
+
import u from "../../../util/es/hooks/useEvent.js";
|
|
4
|
+
const b = (t) => {
|
|
5
5
|
const e = new MessageChannel();
|
|
6
6
|
e.port1.onmessage = t, e.port2.postMessage(null);
|
|
7
|
-
},
|
|
7
|
+
}, i = (t, e = 1) => {
|
|
8
8
|
if (e <= 0) {
|
|
9
9
|
t();
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
b(() => {
|
|
13
|
+
i(t, e - 1);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
const [
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
function L(t, e, a, p) {
|
|
17
|
+
const [d, g] = l(!1);
|
|
18
|
+
v(() => {
|
|
19
|
+
g(!0);
|
|
20
20
|
}, []);
|
|
21
|
-
const [
|
|
22
|
-
|
|
23
|
-
}),
|
|
21
|
+
const [m, k] = T(t, e), [S, c] = l(!1), s = p(d ? m : !1), o = C(0), O = u((n) => {
|
|
22
|
+
a && s !== n && a(n), k(n);
|
|
23
|
+
}), E = u((n, M = {}) => {
|
|
24
24
|
const {
|
|
25
|
-
cancelFun:
|
|
26
|
-
} =
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
25
|
+
cancelFun: R
|
|
26
|
+
} = M;
|
|
27
|
+
o.current += 1;
|
|
28
|
+
const h = o.current, r = typeof n == "boolean" ? n : !s;
|
|
29
|
+
c(!r);
|
|
30
|
+
function f() {
|
|
30
31
|
// Always check if id is match
|
|
31
|
-
|
|
32
|
-
!
|
|
32
|
+
h === o.current && // Check if need to cancel
|
|
33
|
+
!R?.() && (O(r), c(!1));
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
r ? f() : i(() => {
|
|
36
|
+
f();
|
|
36
37
|
});
|
|
37
38
|
});
|
|
38
|
-
return [s,
|
|
39
|
+
return [s, E, S];
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
L as default,
|
|
43
|
+
i as macroTask
|
|
43
44
|
};
|
|
44
45
|
//# sourceMappingURL=useOpen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOpen.js","sources":["../../../../../../node_modules/@rc-component/select/es/hooks/useOpen.js"],"sourcesContent":["import { useControlledState, useEvent } from '@rc-component/util';\nimport { useRef, useState, useEffect } from 'react';\nconst internalMacroTask = fn => {\n const channel = new MessageChannel();\n channel.port1.onmessage = fn;\n channel.port2.postMessage(null);\n};\nexport const macroTask = (fn, times = 1) => {\n if (times <= 0) {\n fn();\n return;\n }\n internalMacroTask(() => {\n macroTask(fn, times - 1);\n });\n};\n\n/**\n * Trigger by latest open call, if nextOpen is undefined, means toggle.\n * `weak` means this call can be ignored if previous call exists.\n */\n\n/**\n * When `open` is controlled, follow the controlled value;\n * Otherwise use uncontrolled logic.\n * Setting `open` takes effect immediately,\n * but setting it to `false` is delayed via MessageChannel.\n *\n * SSR handling: During SSR, `open` is always false to avoid Portal issues.\n * On client-side hydration, it syncs with the actual open state.\n */\nexport default function useOpen(propOpen, onOpen, postOpen) {\n // SSR not support Portal which means we need delay `open` for the first time render\n const [rendered, setRendered] = useState(false);\n useEffect(() => {\n setRendered(true);\n }, []);\n const [stateOpen, internalSetOpen] = useControlledState(
|
|
1
|
+
{"version":3,"file":"useOpen.js","sources":["../../../../../../node_modules/@rc-component/select/es/hooks/useOpen.js"],"sourcesContent":["import { useControlledState, useEvent } from '@rc-component/util';\nimport { useRef, useState, useEffect } from 'react';\nconst internalMacroTask = fn => {\n const channel = new MessageChannel();\n channel.port1.onmessage = fn;\n channel.port2.postMessage(null);\n};\nexport const macroTask = (fn, times = 1) => {\n if (times <= 0) {\n fn();\n return;\n }\n internalMacroTask(() => {\n macroTask(fn, times - 1);\n });\n};\n\n/**\n * Trigger by latest open call, if nextOpen is undefined, means toggle.\n * `weak` means this call can be ignored if previous call exists.\n */\n\n/**\n * When `open` is controlled, follow the controlled value;\n * Otherwise use uncontrolled logic.\n * Setting `open` takes effect immediately,\n * but setting it to `false` is delayed via MessageChannel.\n *\n * SSR handling: During SSR, `open` is always false to avoid Portal issues.\n * On client-side hydration, it syncs with the actual open state.\n */\nexport default function useOpen(defaultOpen, propOpen, onOpen, postOpen) {\n // SSR not support Portal which means we need delay `open` for the first time render\n const [rendered, setRendered] = useState(false);\n useEffect(() => {\n setRendered(true);\n }, []);\n const [stateOpen, internalSetOpen] = useControlledState(defaultOpen, propOpen);\n\n // Lock for options update\n const [lock, setLock] = useState(false);\n\n // During SSR, always return false for open state\n const ssrSafeOpen = rendered ? stateOpen : false;\n const mergedOpen = postOpen(ssrSafeOpen);\n const taskIdRef = useRef(0);\n const triggerEvent = useEvent(nextOpen => {\n if (onOpen && mergedOpen !== nextOpen) {\n onOpen(nextOpen);\n }\n internalSetOpen(nextOpen);\n });\n const toggleOpen = useEvent((nextOpen, config = {}) => {\n const {\n cancelFun\n } = config;\n taskIdRef.current += 1;\n const id = taskIdRef.current;\n const nextOpenVal = typeof nextOpen === 'boolean' ? nextOpen : !mergedOpen;\n setLock(!nextOpenVal);\n function triggerUpdate() {\n if (\n // Always check if id is match\n id === taskIdRef.current &&\n // Check if need to cancel\n !cancelFun?.()) {\n triggerEvent(nextOpenVal);\n setLock(false);\n }\n }\n\n // Weak update can be ignored\n if (nextOpenVal) {\n triggerUpdate();\n } else {\n macroTask(() => {\n triggerUpdate();\n });\n }\n });\n return [mergedOpen, toggleOpen, lock];\n}"],"names":["internalMacroTask","fn","channel","macroTask","times","useOpen","defaultOpen","propOpen","onOpen","postOpen","rendered","setRendered","useState","useEffect","stateOpen","internalSetOpen","useControlledState","lock","setLock","mergedOpen","taskIdRef","useRef","triggerEvent","useEvent","nextOpen","toggleOpen","config","cancelFun","id","nextOpenVal","triggerUpdate"],"mappings":";;;AAEA,MAAMA,IAAoB,CAAAC,MAAM;AAC9B,QAAMC,IAAU,IAAI,eAAc;AAClC,EAAAA,EAAQ,MAAM,YAAYD,GAC1BC,EAAQ,MAAM,YAAY,IAAI;AAChC,GACaC,IAAY,CAACF,GAAIG,IAAQ,MAAM;AAC1C,MAAIA,KAAS,GAAG;AACd,IAAAH,EAAE;AACF;AAAA,EACF;AACA,EAAAD,EAAkB,MAAM;AACtB,IAAA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