tntd 3.0.43 → 3.0.45-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_util/context.js +1 -1
- package/es/_util/defaultRenderEmpty.js +1 -1
- package/es/_util/hooks/useFlexGapSupport.js +4 -4
- package/es/_util/hooks/useForceUpdate.js +4 -4
- package/es/_util/responsiveObserve.js +1 -1
- package/es/_util/styleChecker.js +1 -1
- package/es/actions/index.js +1 -1
- package/es/alert/alert.js +2 -2
- package/es/alert/index.js +1 -1
- package/es/array-input/index.js +9 -9
- package/es/button/button.js +2 -2
- package/es/cascader/cascader.js +1 -1
- package/es/check-card/group.js +8 -8
- package/es/check-card/index.js +6 -6
- package/es/checkbox/checkbox.js +1 -1
- package/es/color-picker/ColorPicker.js +6 -6
- package/es/color-picker/index.js +1 -1
- package/es/columns/index.js +1 -1
- package/es/config-provider/config-provider.js +1 -1
- package/es/date-picker/DatePicker.js +1 -1
- package/es/descriptions/descriptions.js +5 -5
- package/es/development-login/LoginModal.js +6 -6
- package/es/development-login/index.js +4 -4
- package/es/drawer/drawer.js +2 -2
- package/es/ellipsis/Svg/CopySVG.js +1 -1
- package/es/ellipsis/Svg/TickSVG.js +1 -1
- package/es/ellipsis/index.js +5 -5
- package/es/empty/empty.js +2 -2
- package/es/empty/empty.stories.js +2 -2
- package/es/exception/exception.js +1 -1
- package/es/form/form.js +2 -2
- package/es/form/style/index.less +5 -5
- package/es/grid-v4/col.js +2 -2
- package/es/grid-v4/hooks/useBreakpoint.js +1 -1
- package/es/grid-v4/index.js +1 -1
- package/es/grid-v4/row.js +6 -6
- package/es/handle/index.js +1 -1
- package/es/handle-icon/index.js +11 -11
- package/es/icon/IconFont.js +1 -1
- package/es/icon/components/Icon.js +9 -9
- package/es/icon/components/index.js +1 -1
- package/es/icon/components/utils.js +3 -3
- package/es/icon/index.js +7 -7
- package/es/icon/twoTonePrimaryColor.js +1 -1
- package/es/icon/utils.js +1 -1
- package/es/img/Contain.js +1 -1
- package/es/img/Cover.js +5 -5
- package/es/img/index.js +5 -5
- package/es/index.js +8 -1
- package/es/index.js.map +1 -1
- package/es/input/input.js +2 -2
- package/es/input-number/inputNumber.js +1 -1
- package/es/label/index.js +2 -2
- package/es/loading-button/index.js +5 -5
- package/es/locale/default.js +1 -1
- package/es/locale/en_US.js +1 -1
- package/es/locale/zh_CN.js +1 -1
- package/es/modal/modal.js +1 -1
- package/es/notification/assets/index.js +1 -1
- package/es/notification/index.js +1 -1
- package/es/notification/notification.js +1 -1
- package/es/page/Box.js +1 -1
- package/es/page/index.js +7 -7
- package/es/page-container/index.js +1 -1
- package/es/page-loading/index.js +1 -1
- package/es/popconfirm/popconfirm.js +1 -1
- package/es/popover/popover.js +1 -1
- package/es/preview-text/index.js +7 -7
- package/es/progress/progress.js +2 -2
- package/es/query-form/Field/Checkbox.js +2 -2
- package/es/query-form/Field/Checkbox.js.map +1 -1
- package/es/query-form/Field/Composition/FieldPopover.js +361 -0
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form/Field/Composition/Select.js +157 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/SelectInput.js +34 -0
- package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
- package/es/query-form/Field/Composition/ValueTag.js +162 -0
- package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +337 -0
- package/es/query-form/Field/Composition/index.js.map +1 -0
- package/es/query-form/Field/Composition/index.less +145 -0
- package/es/query-form/Field/Composition/utils.js +169 -0
- package/es/query-form/Field/Composition/utils.js.map +1 -0
- package/es/query-form/Field/Select.js +6 -6
- package/es/query-form/Field/SelectInput.js +26 -15
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/fieldsMap.js +3 -3
- package/es/query-form/Field/fieldsMap.js.map +1 -1
- package/es/query-form/Field/index.js +13 -11
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-form/createActions.js +1 -1
- package/es/query-form/index.js +228 -359
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +26 -60
- package/es/query-form/useForm.js +1 -1
- package/es/query-form-v2/index.less +133 -0
- package/es/query-list-scene/List.js +29 -16
- package/es/query-list-scene/List.js.map +1 -1
- package/es/query-list-scene/QueryForm.js +44 -22
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/query-list-scene/QueryListScene.js +10 -10
- package/es/query-list-scene/Title.js +1 -1
- package/es/query-list-scene/Toolbar.js +2 -2
- package/es/query-list-scene/createActions.js +1 -1
- package/es/query-list-scene/index.js +3 -2
- package/es/query-list-scene/index.js.map +1 -1
- package/es/query-list-scene/useActions.js +1 -1
- package/es/radio/radio.js +1 -1
- package/es/render-empty/render-empty.js +1 -1
- package/es/scroll-bar/Bar.js +91 -0
- package/es/scroll-bar/Bar.js.map +1 -0
- package/es/scroll-bar/Context.js +13 -0
- package/es/scroll-bar/Context.js.map +1 -0
- package/es/scroll-bar/ScrollBar.js +97 -0
- package/es/scroll-bar/ScrollBar.js.map +1 -0
- package/es/scroll-bar/Thumb.js +125 -0
- package/es/scroll-bar/Thumb.js.map +1 -0
- package/es/scroll-bar/index.js +10 -0
- package/es/scroll-bar/index.js.map +1 -0
- package/es/scroll-bar/scrollBar.less +59 -0
- package/es/scroll-bar/util.js +39 -0
- package/es/scroll-bar/util.js.map +1 -0
- package/es/segmented/index.js +2 -2
- package/es/select/select.js +2 -2
- package/es/spin/spin.js +1 -1
- package/es/steps/steps.js +2 -2
- package/es/svg-components/index.js +1 -1
- package/es/table/hooks/use-column-setting.js +4 -4
- package/es/table/hooks/use-column-setting.js.map +1 -1
- package/es/table/hooks/use-expand-fixed.js +6 -6
- package/es/table/resizableTable/index.js +40 -11
- package/es/table/resizableTable/index.js.map +1 -1
- package/es/table/resizableTable/index.less +9 -1
- package/es/table/table-hoc.js +1 -1
- package/es/table/table.js +17 -11
- package/es/table/table.js.map +1 -1
- package/es/table/table.stories.js +2 -2
- package/es/table/utils.js +1 -1
- package/es/table-container/index.js +1 -1
- package/es/tabs/tabs.js +2 -2
- package/es/tabs-container/index.js +1 -1
- package/es/tag/tag.js +2 -2
- package/es/time-picker/TimePicker.js +1 -1
- package/es/time-picker/index.js +1 -1
- package/es/title/index.js +1 -1
- package/es/tntd-action/Action.js +9 -9
- package/es/tntd-action/index.js +8 -8
- package/es/tntd-cascader/AntdCascader/component/context.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
- package/es/tntd-cascader/AntdCascader/config/utils.js +2 -2
- package/es/tntd-cascader/AntdCascader/index.js +7 -7
- package/es/tntd-cascader/index.js +1 -1
- package/es/tntd-cascader/rc-cascader/Cascader.js +8 -8
- package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
- package/es/tntd-cascader/rc-cascader/index.js +1 -1
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
- package/es/tntd-form/ErrorList.js +7 -7
- package/es/tntd-form/Form.js +6 -6
- package/es/tntd-form/FormItem/ItemHolder.js +6 -6
- package/es/tntd-form/FormItem/index.js +8 -8
- package/es/tntd-form/FormItemInput.js +1 -1
- package/es/tntd-form/FormItemLabel.js +2 -2
- package/es/tntd-form/FormList.js +1 -1
- package/es/tntd-form/context.js +1 -1
- package/es/tntd-form/hooks/useDebounce.js +4 -4
- package/es/tntd-form/hooks/useForm.js +5 -5
- package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
- package/es/tntd-form/hooks/useFrameState.js +5 -5
- package/es/tntd-form/index.js +1 -1
- package/es/tntd-icon/index.js +1 -1
- package/es/tntd-layout/AppList.js +6 -6
- package/es/tntd-layout/Application.js +6 -6
- package/es/tntd-layout/Avatar.js +2 -2
- package/es/tntd-layout/CompatibleLanguage.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
- package/es/tntd-layout/EnterpriseLayout/Language.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/Theme.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/index.js +1 -1
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
- package/es/tntd-layout/GlobalNavigation/index.js +9 -9
- package/es/tntd-layout/Header.js +2 -2
- package/es/tntd-layout/HeaderActions.js +2 -2
- package/es/tntd-layout/HeaderNavs.js +6 -6
- package/es/tntd-layout/HeaderTabs.js +7 -7
- package/es/tntd-layout/Iconfont.js +1 -1
- package/es/tntd-layout/Language.js +6 -6
- package/es/tntd-layout/Layout.js +6 -6
- package/es/tntd-layout/Logo.js +2 -2
- package/es/tntd-layout/OrgAppList.js +6 -6
- package/es/tntd-layout/SideMenu.js +6 -6
- package/es/tntd-layout/Theme.js +6 -6
- package/es/tntd-layout/createActions.js +1 -1
- package/es/tntd-layout/images/index.js +1 -1
- package/es/tntd-layout/index.js +1 -1
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
- package/es/tntd-layout/paaslayout/Header.js +2 -2
- package/es/tntd-layout/paaslayout/Logo.js +2 -2
- package/es/tntd-layout/paaslayout/SideMenu.js +6 -6
- package/es/tntd-layout/paaslayout/index.js +6 -6
- package/es/tntd-layout/storage.js +1 -1
- package/es/tntd-modal/index.js +6 -6
- package/es/tntd-rc-select/_util/PurePanel.js +5 -5
- package/es/tntd-rc-select/_util/context.js +1 -1
- package/es/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
- package/es/tntd-rc-select/_util/getIcons.js +1 -1
- package/es/tntd-rc-select/_util/useCompactItemContext.js +2 -2
- package/es/tntd-rc-select/index.js +2 -2
- package/es/tntd-reference/AHref/index.js +1 -1
- package/es/tntd-reference/ReferenceBatchCheck/index.js +1 -1
- package/es/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
- package/es/tntd-reference/ReferenceCheck/index.js +1 -1
- package/es/tntd-reference/ReferenceDrawer/index.js +5 -5
- package/es/tntd-reference/ReferenceInfo/index.js +1 -1
- package/es/tntd-reference/index.js +1 -1
- package/es/tntd-second-page/index.js +1 -1
- package/es/tntd-select/DropDownWrap.js +8 -8
- package/es/tntd-select/index.js +10 -9
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-virtual-tree/index.js +8 -11
- package/es/tntd-virtual-tree/index.js.map +1 -1
- package/es/tntd-virtual-tree/utils.js +28 -28
- package/es/tntd-virtual-tree-select/index.js +10 -10
- package/es/tntd-virtual-tree-select/utils.js +9 -9
- package/es/tooltip/tooltip.js +1 -1
- package/es/upload/index.js +6 -6
- package/es/upload/svg/UploadSVG.js +1 -1
- package/es/utils/checkAuth.js +4 -4
- package/es/utils/index.js +9 -9
- package/es/utils/lang.js +3 -3
- package/es/water-mark/index.js +5 -5
- package/lib/_util/context.js +3 -3
- package/lib/_util/defaultRenderEmpty.js +3 -3
- package/lib/_util/hooks/useFlexGapSupport.js +14 -15
- package/lib/_util/hooks/useForceUpdate.js +14 -15
- package/lib/_util/responsiveObserve.js +7 -13
- package/lib/_util/styleChecker.js +3 -3
- package/lib/actions/index.js +3 -3
- package/lib/alert/alert.js +10 -16
- package/lib/alert/index.js +3 -3
- package/lib/array-input/index.js +30 -37
- package/lib/button/button.js +10 -16
- package/lib/cascader/cascader.js +3 -3
- package/lib/check-card/group.js +23 -24
- package/lib/check-card/index.js +24 -31
- package/lib/checkbox/checkbox.js +3 -3
- package/lib/color-picker/ColorPicker.js +24 -31
- package/lib/color-picker/index.js +3 -3
- package/lib/columns/index.js +3 -3
- package/lib/config-provider/config-provider.js +3 -3
- package/lib/date-picker/DatePicker.js +3 -3
- package/lib/descriptions/descriptions.js +13 -19
- package/lib/development-login/LoginModal.js +24 -31
- package/lib/development-login/index.js +14 -15
- package/lib/drawer/drawer.js +10 -16
- package/lib/ellipsis/Svg/CopySVG.js +3 -3
- package/lib/ellipsis/Svg/TickSVG.js +3 -3
- package/lib/ellipsis/index.js +17 -18
- package/lib/empty/empty.js +10 -16
- package/lib/empty/empty.stories.js +6 -9
- package/lib/exception/exception.js +3 -3
- package/lib/form/form.js +10 -16
- package/lib/form/style/index.less +5 -5
- package/lib/grid-v4/col.js +10 -16
- package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
- package/lib/grid-v4/index.js +3 -3
- package/lib/grid-v4/row.js +24 -31
- package/lib/handle/index.js +3 -3
- package/lib/handle-icon/index.js +13 -13
- package/lib/icon/IconFont.js +3 -3
- package/lib/icon/components/Icon.js +44 -70
- package/lib/icon/components/index.js +3 -3
- package/lib/icon/components/utils.js +10 -18
- package/lib/icon/index.js +26 -33
- package/lib/icon/twoTonePrimaryColor.js +3 -3
- package/lib/icon/utils.js +3 -3
- package/lib/img/Contain.js +3 -3
- package/lib/img/Cover.js +17 -18
- package/lib/img/index.js +17 -18
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -3
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +10 -16
- package/lib/input-number/inputNumber.js +3 -3
- package/lib/label/index.js +10 -16
- package/lib/loading-button/index.js +17 -18
- package/lib/locale/default.js +3 -3
- package/lib/locale/en_US.js +3 -3
- package/lib/locale/zh_CN.js +3 -3
- package/lib/modal/modal.js +3 -3
- package/lib/notification/assets/index.js +3 -3
- package/lib/notification/index.js +3 -3
- package/lib/notification/notification.js +3 -3
- package/lib/page/Box.js +3 -3
- package/lib/page/index.js +26 -33
- package/lib/page-container/index.js +3 -3
- package/lib/page-loading/index.js +3 -3
- package/lib/popconfirm/popconfirm.js +3 -3
- package/lib/popover/popover.js +3 -3
- package/lib/preview-text/index.js +9 -9
- package/lib/progress/progress.js +10 -16
- package/lib/query-form/Field/Checkbox.js +4 -4
- package/lib/query-form/Field/Checkbox.js.map +1 -1
- package/lib/query-form/Field/Composition/FieldPopover.js +46 -8
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -1
- package/lib/query-form/Field/Composition/SelectInput.d.ts +3 -0
- package/lib/query-form/Field/Composition/SelectInput.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/SelectInput.js +111 -0
- package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/ValueTag.js +6 -3
- package/lib/query-form/Field/Composition/ValueTag.js.map +1 -1
- package/lib/query-form/Field/Composition/index.d.ts +2 -0
- package/lib/query-form/Field/Composition/index.js +32 -16
- package/lib/query-form/Field/Composition/index.js.map +1 -1
- package/lib/query-form/Field/Composition/index.less +4 -4
- package/lib/query-form/Field/Composition/utils.d.ts +1 -1
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/utils.js +47 -46
- package/lib/query-form/Field/Composition/utils.js.map +1 -1
- package/lib/query-form/Field/Select.js +24 -31
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +44 -40
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.d.ts +6 -3
- package/lib/query-form/Field/fieldsMap.d.ts.map +1 -1
- package/lib/query-form/Field/fieldsMap.js +5 -5
- package/lib/query-form/Field/fieldsMap.js.map +1 -1
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +49 -73
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/createActions.js +3 -3
- package/lib/query-form/index.d.ts +1 -36
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +271 -432
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +26 -60
- package/lib/query-form/useForm.js +3 -3
- package/lib/query-list-scene/List.d.ts.map +1 -1
- package/lib/query-list-scene/List.js +57 -64
- package/lib/query-list-scene/List.js.map +1 -1
- package/lib/query-list-scene/QueryForm.d.ts +5 -4
- package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
- package/lib/query-list-scene/QueryForm.js +72 -70
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/QueryListScene.js +44 -70
- package/lib/query-list-scene/Title.js +3 -3
- package/lib/query-list-scene/Toolbar.js +10 -16
- package/lib/query-list-scene/createActions.js +3 -3
- package/lib/query-list-scene/index.d.ts.map +1 -1
- package/lib/query-list-scene/index.js +5 -4
- package/lib/query-list-scene/index.js.map +1 -1
- package/lib/query-list-scene/useActions.js +3 -3
- package/lib/radio/radio.js +3 -3
- package/lib/render-empty/render-empty.js +3 -3
- package/lib/segmented/index.d.ts +1 -1
- package/lib/segmented/index.js +10 -16
- package/lib/select/select.js +10 -16
- package/lib/spin/spin.js +3 -3
- package/lib/steps/steps.js +10 -16
- package/lib/svg-components/index.js +3 -3
- package/lib/table/hooks/use-column-setting.d.ts +1 -0
- package/lib/table/hooks/use-column-setting.d.ts.map +1 -1
- package/lib/table/hooks/use-column-setting.js +14 -15
- package/lib/table/hooks/use-column-setting.js.map +1 -1
- package/lib/table/hooks/use-expand-fixed.js +30 -36
- package/lib/table/resizableTable/index.d.ts +3 -0
- package/lib/table/resizableTable/index.d.ts.map +1 -1
- package/lib/table/resizableTable/index.js +58 -36
- package/lib/table/resizableTable/index.js.map +1 -1
- package/lib/table/resizableTable/index.less +9 -1
- package/lib/table/table-hoc.js +3 -3
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +35 -36
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.stories.js +10 -16
- package/lib/table/utils.js +3 -3
- package/lib/table-container/index.js +3 -3
- package/lib/tabs/tabs.js +10 -16
- package/lib/tabs-container/index.js +3 -3
- package/lib/tag/tag.js +10 -16
- package/lib/time-picker/TimePicker.js +3 -3
- package/lib/time-picker/index.js +3 -3
- package/lib/title/index.js +3 -3
- package/lib/tntd-action/Action.js +21 -22
- package/lib/tntd-action/index.js +20 -21
- package/lib/tntd-cascader/AntdCascader/component/context.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +10 -16
- package/lib/tntd-cascader/AntdCascader/config/utils.js +10 -16
- package/lib/tntd-cascader/AntdCascader/index.js +26 -33
- package/lib/tntd-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/Cascader.js +23 -24
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +10 -16
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +26 -33
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +30 -37
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +17 -18
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +23 -24
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +16 -17
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +23 -30
- package/lib/tntd-cascader/rc-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +6 -6
- package/lib/tntd-form/ErrorList.js +26 -33
- package/lib/tntd-form/Form.js +24 -31
- package/lib/tntd-form/FormItem/ItemHolder.js +24 -31
- package/lib/tntd-form/FormItem/index.js +23 -24
- package/lib/tntd-form/FormItemInput.js +3 -3
- package/lib/tntd-form/FormItemLabel.js +10 -16
- package/lib/tntd-form/FormList.js +3 -3
- package/lib/tntd-form/context.js +3 -3
- package/lib/tntd-form/hooks/useDebounce.js +14 -15
- package/lib/tntd-form/hooks/useForm.js +17 -18
- package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
- package/lib/tntd-form/hooks/useFrameState.js +17 -18
- package/lib/tntd-form/index.js +3 -3
- package/lib/tntd-icon/index.js +3 -3
- package/lib/tntd-layout/AppList.js +20 -24
- package/lib/tntd-layout/Application.js +20 -24
- package/lib/tntd-layout/Avatar.js +6 -9
- package/lib/tntd-layout/CompatibleLanguage.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +6 -9
- package/lib/tntd-layout/EnterpriseLayout/Language.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +20 -24
- package/lib/tntd-layout/GlobalNavigation/index.js +26 -30
- package/lib/tntd-layout/Header.js +6 -9
- package/lib/tntd-layout/HeaderActions.js +6 -9
- package/lib/tntd-layout/HeaderNavs.js +20 -24
- package/lib/tntd-layout/HeaderTabs.js +27 -37
- package/lib/tntd-layout/Iconfont.js +3 -3
- package/lib/tntd-layout/Language.js +20 -24
- package/lib/tntd-layout/Layout.js +20 -24
- package/lib/tntd-layout/Logo.js +6 -9
- package/lib/tntd-layout/OrgAppList.js +20 -24
- package/lib/tntd-layout/SideMenu.js +20 -24
- package/lib/tntd-layout/Theme.js +20 -24
- package/lib/tntd-layout/createActions.js +3 -3
- package/lib/tntd-layout/images/index.js +3 -3
- package/lib/tntd-layout/index.js +3 -3
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +20 -24
- package/lib/tntd-layout/paaslayout/Header.js +6 -9
- package/lib/tntd-layout/paaslayout/Logo.js +6 -9
- package/lib/tntd-layout/paaslayout/SideMenu.js +20 -24
- package/lib/tntd-layout/paaslayout/index.js +20 -24
- package/lib/tntd-layout/storage.js +3 -3
- package/lib/tntd-modal/index.js +24 -31
- package/lib/tntd-rc-select/_util/PurePanel.js +17 -18
- package/lib/tntd-rc-select/_util/context.js +3 -3
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +3 -3
- package/lib/tntd-rc-select/_util/getIcons.js +3 -3
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +10 -16
- package/lib/tntd-rc-select/index.js +10 -16
- package/lib/tntd-reference/AHref/index.js +3 -3
- package/lib/tntd-reference/ReferenceBatchCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js +17 -18
- package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceDrawer/index.js +17 -18
- package/lib/tntd-reference/ReferenceInfo/index.js +3 -3
- package/lib/tntd-reference/index.js +3 -3
- package/lib/tntd-second-page/index.js +3 -3
- package/lib/tntd-select/DropDownWrap.js +34 -54
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +40 -57
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-virtual-tree/index.js +23 -27
- package/lib/tntd-virtual-tree/index.js.map +1 -1
- package/lib/tntd-virtual-tree/utils.js +62 -66
- package/lib/tntd-virtual-tree-select/index.js +22 -23
- package/lib/tntd-virtual-tree-select/utils.js +20 -21
- package/lib/tooltip/tooltip.js +3 -3
- package/lib/upload/index.js +41 -45
- package/lib/upload/svg/UploadSVG.js +3 -3
- package/lib/utils/checkAuth.js +6 -6
- package/lib/utils/index.js +20 -21
- package/lib/utils/lang.js +5 -5
- package/lib/water-mark/index.js +17 -18
- package/package.json +3 -2
- package/CHANGELOG.json +0 -1034
- package/CHANGELOG.md +0 -605
- package/es/checkbox/checkbox-group.js +0 -16
- package/es/checkbox/checkbox-group.js.map +0 -1
- package/es/radio/radio-group.js +0 -16
- package/es/radio/radio-group.js.map +0 -1
- package/es/steps/stepStyle/small.less +0 -5
- package/es/table/total-shower.js +0 -20
- package/es/table/total-shower.js.map +0 -1
- package/es/utils/simple-template.js +0 -19
- package/es/utils/simple-template.js.map +0 -1
- package/lib/checkbox/checkbox-group.d.ts +0 -8
- package/lib/checkbox/checkbox-group.d.ts.map +0 -1
- package/lib/checkbox/checkbox-group.js +0 -16
- package/lib/checkbox/checkbox-group.js.map +0 -1
- package/lib/radio/radio-group.d.ts +0 -8
- package/lib/radio/radio-group.d.ts.map +0 -1
- package/lib/radio/radio-group.js +0 -16
- package/lib/radio/radio-group.js.map +0 -1
- package/lib/steps/stepStyle/small.less +0 -5
- package/lib/table/total-shower.d.ts +0 -9
- package/lib/table/total-shower.d.ts.map +0 -1
- package/lib/table/total-shower.js +0 -20
- package/lib/table/total-shower.js.map +0 -1
- package/lib/utils/simple-template.d.ts +0 -9
- package/lib/utils/simple-template.d.ts.map +0 -1
- package/lib/utils/simple-template.js +0 -19
- package/lib/utils/simple-template.js.map +0 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatLabel = formatLabel;
|
|
7
|
+
exports.getLabel = getLabel;
|
|
8
|
+
exports.getLabelByValue = getLabelByValue;
|
|
9
|
+
exports.highlightSubstring = highlightSubstring;
|
|
10
|
+
exports.isInput = void 0;
|
|
11
|
+
exports.parseArrayToObject = parseArrayToObject;
|
|
12
|
+
exports.parseObjectToArray = parseObjectToArray;
|
|
13
|
+
var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
|
|
14
|
+
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
15
|
+
var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
function highlightSubstring(str, substring) {
|
|
20
|
+
var highlighted = "<span class=\"tnt-highlight\">".concat(substring, "</span>");
|
|
21
|
+
return str.replace(new RegExp(substring, 'g'), highlighted);
|
|
22
|
+
}
|
|
23
|
+
function getLabelByValue(_ref) {
|
|
24
|
+
var value = _ref.value,
|
|
25
|
+
options = _ref.options,
|
|
26
|
+
_ref$fieldNames = _ref.fieldNames,
|
|
27
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
28
|
+
label: 'label',
|
|
29
|
+
value: 'value'
|
|
30
|
+
} : _ref$fieldNames;
|
|
31
|
+
var getLabel = function getLabel(value) {
|
|
32
|
+
var target = options === null || options === void 0 ? void 0 : options.find(function (item) {
|
|
33
|
+
var valueKey = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
|
|
34
|
+
var itemValue = item instanceof Object ? item[valueKey] : item;
|
|
35
|
+
return itemValue === value;
|
|
36
|
+
});
|
|
37
|
+
if (target) {
|
|
38
|
+
return target instanceof Object ? target === null || target === void 0 ? void 0 : target[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label] : target;
|
|
39
|
+
} else {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
if ((0, _isArray2["default"])(value)) {
|
|
44
|
+
return value.map(getLabel).join(' | ');
|
|
45
|
+
} else {
|
|
46
|
+
return getLabel(value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function formatLabel(reactDom) {
|
|
50
|
+
return (0, _flatten2["default"])(_react["default"].Children.map(reactDom.props.children, function (child) {
|
|
51
|
+
if (_react["default"].isValidElement(child)) {
|
|
52
|
+
return formatLabel(child);
|
|
53
|
+
} else if ((0, _isString2["default"])(child)) {
|
|
54
|
+
return child;
|
|
55
|
+
}
|
|
56
|
+
return '';
|
|
57
|
+
})).join('');
|
|
58
|
+
}
|
|
59
|
+
function parseObjectToArray(value, data) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
return (_b = (_a = Object.keys(value || {})) === null || _a === void 0 ? void 0 : _a.map(function (key) {
|
|
62
|
+
var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key || ((_b = item.props) === null || _b === void 0 ? void 0 : _b.pName) === key;
|
|
65
|
+
});
|
|
66
|
+
if (!target) return null;
|
|
67
|
+
var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
|
|
68
|
+
var _ref2 = dataItem || {},
|
|
69
|
+
_ref2$type = _ref2.type,
|
|
70
|
+
type = _ref2$type === void 0 ? 'input' : _ref2$type,
|
|
71
|
+
component = _ref2.component,
|
|
72
|
+
setLabel = _ref2.setLabel;
|
|
73
|
+
if (!type && component && !setLabel) {
|
|
74
|
+
console.error('自定义组件需要传入setLabel()方法');
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
key: key,
|
|
78
|
+
value: value[key]
|
|
79
|
+
};
|
|
80
|
+
})) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
81
|
+
return !!item;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function parseArrayToObject(value) {
|
|
85
|
+
return value === null || value === void 0 ? void 0 : value.reduce(function (acc, v) {
|
|
86
|
+
acc[v.key] = v.value;
|
|
87
|
+
return acc;
|
|
88
|
+
}, {});
|
|
89
|
+
}
|
|
90
|
+
function getLabel(_ref3, data, locale) {
|
|
91
|
+
var key = _ref3.key,
|
|
92
|
+
value = _ref3.value;
|
|
93
|
+
var _a, _b, _c, _d;
|
|
94
|
+
var otherTarget = data === null || data === void 0 ? void 0 : data.find(function (item) {
|
|
95
|
+
var _a;
|
|
96
|
+
return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.pName) === key;
|
|
97
|
+
});
|
|
98
|
+
if (otherTarget) {
|
|
99
|
+
// otherInput
|
|
100
|
+
var selectKey = (_a = Object.keys(value || {})) === null || _a === void 0 ? void 0 : _a[0];
|
|
101
|
+
if (!selectKey) {
|
|
102
|
+
// 17. inputSelect组件,初始值{},展示undefined:undefined
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
var otherTargetObj = data.find(function (item) {
|
|
106
|
+
return item.props.pName === key && item.props.cName === selectKey;
|
|
107
|
+
});
|
|
108
|
+
if (!otherTargetObj) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
return otherTargetObj.props.title + ':' + (value[selectKey] || '');
|
|
112
|
+
}
|
|
113
|
+
var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
|
|
114
|
+
var _a;
|
|
115
|
+
return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key;
|
|
116
|
+
});
|
|
117
|
+
if (!target) return null;
|
|
118
|
+
var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
|
|
119
|
+
var _ref4 = dataItem || {},
|
|
120
|
+
_ref4$type = _ref4.type,
|
|
121
|
+
type = _ref4$type === void 0 ? 'input' : _ref4$type,
|
|
122
|
+
setLabel = _ref4.setLabel,
|
|
123
|
+
fieldProps = _ref4.props,
|
|
124
|
+
propsTitle = _ref4.propsTitle,
|
|
125
|
+
title = _ref4.title,
|
|
126
|
+
name = _ref4.name;
|
|
127
|
+
var _propsTitle = propsTitle || title || name;
|
|
128
|
+
var _ref5 = fieldProps || {},
|
|
129
|
+
options = _ref5.options,
|
|
130
|
+
format = _ref5.format;
|
|
131
|
+
var labelValue = value;
|
|
132
|
+
if (setLabel) {
|
|
133
|
+
// setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制
|
|
134
|
+
labelValue = setLabel(value);
|
|
135
|
+
} else if (options) {
|
|
136
|
+
if (type === 'selectInput') {
|
|
137
|
+
var _selectKey = (_b = Object.keys(value || {})) === null || _b === void 0 ? void 0 : _b[0];
|
|
138
|
+
if (!_selectKey) {
|
|
139
|
+
// 17. inputSelect组件,初始值{},展示undefined:undefined
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
var inputValue = value[_selectKey];
|
|
143
|
+
var selectLabel = (_c = options === null || options === void 0 ? void 0 : options.find(function (v) {
|
|
144
|
+
return v.value === _selectKey;
|
|
145
|
+
})) === null || _c === void 0 ? void 0 : _c.label;
|
|
146
|
+
return selectLabel + ':' + inputValue;
|
|
147
|
+
}
|
|
148
|
+
labelValue = getLabelByValue({
|
|
149
|
+
value: value,
|
|
150
|
+
options: options,
|
|
151
|
+
fieldNames: ((_d = dataItem === null || dataItem === void 0 ? void 0 : dataItem.props) === null || _d === void 0 ? void 0 : _d.fieldNames) || {
|
|
152
|
+
label: 'label',
|
|
153
|
+
value: 'value'
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
} else if (type === 'checkbox') {
|
|
157
|
+
labelValue = value ? locale.yes : locale.no;
|
|
158
|
+
} else if (type === 'dateRange' && format) {
|
|
159
|
+
if (value === null || value === void 0 ? void 0 : value.length) {
|
|
160
|
+
labelValue = [(0, _moment["default"])(value === null || value === void 0 ? void 0 : value[0]).format(format), (0, _moment["default"])(value === null || value === void 0 ? void 0 : value[1]).format(format)].join('~');
|
|
161
|
+
}
|
|
162
|
+
} else if (type === 'date' && format) {
|
|
163
|
+
labelValue = value ? (0, _moment["default"])(value).format(format) : undefined;
|
|
164
|
+
}
|
|
165
|
+
return _propsTitle + ':' + (labelValue === undefined ? '' : labelValue);
|
|
166
|
+
}
|
|
167
|
+
var isInput = exports.isInput = function isInput(type) {
|
|
168
|
+
return ['input', 'string', 'search', 'aloneSearch', 'number', 'inputNumber', 'otherInput'].includes(type);
|
|
169
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/utils.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,UAAU,kBAAk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CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { isArray, isString, flatten } from 'lodash'\nimport moment from 'moment'\n\nexport function highlightSubstring(str, substring) {\n const highlighted = `<span class=\"tnt-highlight\">${substring}</span>`\n return str.replace(new RegExp(substring, 'g'), highlighted)\n}\n\nexport function getLabelByValue({\n value,\n options,\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n}) {\n const getLabel = (value) => {\n const target = options?.find((item) => {\n const valueKey = fieldNames?.value\n const itemValue = item instanceof Object ? item[valueKey] : item\n return itemValue === value\n })\n if (target) {\n return target instanceof Object ? target?.[fieldNames?.label] : target\n } else {\n return value\n }\n }\n if (isArray(value)) {\n return value.map(getLabel).join(' | ')\n } else {\n return getLabel(value)\n }\n}\n\nexport function formatLabel(reactDom) {\n return flatten(\n React.Children.map(reactDom.props.children, (child) => {\n if (React.isValidElement(child)) {\n return formatLabel(child)\n } else if (isString(child)) {\n return child\n }\n return ''\n })\n ).join('')\n}\n\nexport function parseObjectToArray(value, data) {\n return Object.keys(value || {})\n ?.map((key) => {\n const target = data?.find((item) => item.props?.name === key || item.props?.pName === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const { type = 'input', component, setLabel } = dataItem || {}\n if (!type && component && !setLabel) {\n console.error('自定义组件需要传入setLabel()方法')\n }\n return {\n key,\n value: value[key],\n }\n })\n ?.filter((item) => !!item)\n}\n\nexport function parseArrayToObject(value) {\n return value?.reduce((acc, v) => {\n acc[v.key] = v.value\n return acc\n }, {})\n}\n\nexport function getLabel({ key, value }, data, locale) {\n const otherTarget = data?.find((item) => item.props?.pName === key)\n if (otherTarget) {\n // otherInput\n const selectKey = Object.keys(value || {})?.[0]\n if (!selectKey) {\n // 17. inputSelect组件,初始值{},展示undefined:undefined\n return false\n }\n const otherTargetObj = data.find(\n (item) => item.props.pName === key && item.props.cName === selectKey\n )\n if (!otherTargetObj) {\n return false\n }\n return otherTargetObj.props.title + ':' + (value[selectKey] || '')\n }\n\n const target = data?.find((item) => item.props?.name === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const { type = 'input', setLabel, props: fieldProps, propsTitle, title, name } = dataItem || {}\n const _propsTitle = propsTitle || title || name\n const { options, format } = fieldProps || {}\n let labelValue = value\n if (setLabel) {\n // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制\n labelValue = setLabel(value)\n } else if (options) {\n if (type === 'selectInput') {\n const selectKey = Object.keys(value || {})?.[0]\n if (!selectKey) {\n // 17. inputSelect组件,初始值{},展示undefined:undefined\n return false\n }\n const inputValue = value[selectKey]\n const selectLabel = options?.find((v) => v.value === selectKey)?.label\n return selectLabel + ':' + inputValue\n }\n labelValue = getLabelByValue({\n value,\n options,\n fieldNames: dataItem?.props?.fieldNames || {\n label: 'label',\n value: 'value',\n },\n })\n } else if (type === 'checkbox') {\n labelValue = value ? locale.yes : locale.no\n } else if (type === 'dateRange' && format) {\n if (value?.length) {\n labelValue = [moment(value?.[0]).format(format), moment(value?.[1]).format(format)].join('~')\n }\n } else if (type === 'date' && format) {\n labelValue = value ? moment(value).format(format) : undefined\n }\n return _propsTitle + ':' + (labelValue === undefined ? '' : labelValue)\n}\n\nexport const isInput = (type) =>\n ['input', 'string', 'search', 'aloneSearch', 'number', 'inputNumber', 'otherInput'].includes(type)\n"]}
|
|
@@ -7,18 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _select = _interopRequireDefault(require("../../select"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
13
|
-
function _defineProperty(
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
function _slicedToArray(
|
|
16
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
17
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(
|
|
19
|
-
function _arrayLikeToArray(
|
|
18
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
20
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
-
function _arrayWithHoles(
|
|
21
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
22
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
23
23
|
var t = {};
|
|
24
24
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -11,16 +11,16 @@ var _select = _interopRequireDefault(require("../../select"));
|
|
|
11
11
|
var _input = _interopRequireDefault(require("../../input"));
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
function _defineProperty(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
-
function _slicedToArray(
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
-
function _unsupportedIterableToArray(
|
|
21
|
-
function _arrayLikeToArray(
|
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
22
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
23
|
-
function _arrayWithHoles(
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
24
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
25
25
|
var t = {};
|
|
26
26
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -35,7 +35,11 @@ var _default = exports["default"] = function _default(props) {
|
|
|
35
35
|
options = _props$options === void 0 ? [] : _props$options,
|
|
36
36
|
addonBeforeStyle = props.addonBeforeStyle,
|
|
37
37
|
selectProps = props.selectProps,
|
|
38
|
-
|
|
38
|
+
form = props.form,
|
|
39
|
+
close = props.close,
|
|
40
|
+
name = props.name,
|
|
41
|
+
_onChange = props._onChange,
|
|
42
|
+
inputProps = __rest(props, ["options", "addonBeforeStyle", "selectProps", "form", "close", "name", "_onChange"]);
|
|
39
43
|
var _useState = (0, _react.useState)(options),
|
|
40
44
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
45
|
items = _useState2[0],
|
|
@@ -73,16 +77,23 @@ var _default = exports["default"] = function _default(props) {
|
|
|
73
77
|
value: value
|
|
74
78
|
}, label);
|
|
75
79
|
}));
|
|
76
|
-
var
|
|
77
|
-
|
|
80
|
+
var doSearch = function doSearch(value) {
|
|
81
|
+
var newValue = _defineProperty({}, key, value);
|
|
82
|
+
_onChange && _onChange(newValue);
|
|
83
|
+
form.emit('search', _defineProperty({}, name, newValue));
|
|
84
|
+
close && close();
|
|
78
85
|
};
|
|
79
|
-
|
|
80
|
-
setItems(options);
|
|
81
|
-
setKey(getInitialKey());
|
|
82
|
-
}, [options, inputProps.value]);
|
|
83
|
-
return _react["default"].createElement(_input["default"], Object.assign({}, inputProps, {
|
|
84
|
-
value: getInputValue(),
|
|
86
|
+
return _react["default"].createElement(_input["default"].Search, Object.assign({
|
|
85
87
|
addonBefore: addonBefore,
|
|
88
|
+
onPressEnter: function onPressEnter(evt) {
|
|
89
|
+
var _a;
|
|
90
|
+
return doSearch((_a = evt === null || evt === void 0 ? void 0 : evt.target) === null || _a === void 0 ? void 0 : _a.value);
|
|
91
|
+
},
|
|
92
|
+
onSearch: function onSearch(value) {
|
|
93
|
+
return doSearch(value);
|
|
94
|
+
}
|
|
95
|
+
}, inputProps, {
|
|
96
|
+
value: (0, _get2["default"])(inputProps.value, key),
|
|
86
97
|
onChange: onChange
|
|
87
98
|
}));
|
|
88
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.js","sourceRoot":"","sources":["../../../src/query-form/Field/SelectInput.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"SelectInput.js","sourceRoot":"","sources":["../../../src/query-form/Field/SelectInput.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAA;AACjC,OAAO,KAAK,MAAM,aAAa,CAAA;AAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;AAEzB,eAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EACJ,OAAO,GAAG,EAAE,EACZ,gBAAgB,EAChB,WAAW,EACX,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,KAEP,KAAK,EADJ,UAAU,UACX,KAAK,EATH,oFASL,CAAQ,CAAA;IACT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,aAAa,GAAG,GAA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AE,CAAA;QACjC,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;QACzC,KAAK,IAAI,KAAK,EAAE,CAAA;IAClB,CAAC,CAAA;IAED,OAAO,CACL,oBAAC,KAAK,CAAC,MAAM,kBACX,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,WAAC,OAAA,QAAQ,CAAC,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,0CAAE,KAAK,CAAC,CAAA,EAAA,EACnD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAChC,UAAU,IACd,KAAK,EAAE,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,EACjC,QAAQ,EAAE,QAAQ,IAClB,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useState, useEffect } from 'react'\nimport { get } from 'lodash'\nimport Select from '../../select'\nimport Input from '../../input'\n\nconst { Option } = Select\n\nexport default (props) => {\n const {\n options = [],\n addonBeforeStyle,\n selectProps,\n form,\n close,\n name,\n _onChange,\n ...inputProps\n } = props\n const [items, setItems] = useState(options)\n const getInitialKey = () => {\n let key = get(options, '0.value')\n\n if (inputProps.value) {\n key = get(Object.keys(inputProps.value), '0') || key\n }\n\n return key\n }\n const [key, setKey] = useState(getInitialKey())\n const onKeyChange = (key) => {\n setKey(key)\n props.onChange({\n [key]: '',\n })\n }\n const onChange = (evt) => {\n props.onChange({\n [key]: evt.target.value,\n })\n }\n const addonBefore = (\n <Select\n value={key}\n onChange={onKeyChange}\n style={{\n width: '120px',\n ...addonBeforeStyle,\n }}\n dropdownMatchSelectWidth={false}\n {...(selectProps || {})}\n >\n {items.map(({ label, value }) => (\n <Option key={value} value={value}>\n {label}\n </Option>\n ))}\n </Select>\n )\n\n const doSearch = (value) => {\n const newValue = { [key]: value }\n _onChange && _onChange(newValue)\n form.emit('search', { [name]: newValue })\n close && close()\n }\n\n return (\n <Input.Search\n addonBefore={addonBefore}\n onPressEnter={(evt) => doSearch(evt?.target?.value)}\n onSearch={(value) => doSearch(value)}\n {...inputProps}\n value={get(inputProps.value, key)}\n onChange={onChange}\n />\n )\n}\n"]}
|
|
@@ -11,7 +11,7 @@ var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
|
11
11
|
var _datePicker = _interopRequireDefault(require("../../date-picker"));
|
|
12
12
|
var _input = _interopRequireDefault(require("../../input"));
|
|
13
13
|
var _inputNumber = _interopRequireDefault(require("../../input-number"));
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
15
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
16
16
|
var t = {};
|
|
17
17
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -43,8 +43,8 @@ function DataRange(_a) {
|
|
|
43
43
|
}));
|
|
44
44
|
}
|
|
45
45
|
var _default = exports["default"] = {
|
|
46
|
-
string: _input["default"],
|
|
47
|
-
input: _input["default"],
|
|
46
|
+
string: _input["default"].Search,
|
|
47
|
+
input: _input["default"].Search,
|
|
48
48
|
search: _input["default"].Search,
|
|
49
49
|
inputNumber: _inputNumber["default"],
|
|
50
50
|
number: _inputNumber["default"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldsMap.js","sourceRoot":"","sources":["../../../src/query-form/Field/fieldsMap.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,YAAY,CAAA;AACtC,OAAO,WAAW,MAAM,UAAU,CAAA;AAClC,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,UAAU,M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C,MAAM,iBAAiB,GAAG,OAAO,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,EAAE;IACpC,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO,OAAO,CAAA;KACf;IAED,OAAO,CACL;QACE,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE,OAAO;KACrB,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAC7B,CAAA;AACH,CAAC,CAAA;AAED,SAAS,SAAS,CAAC,EAAkC;QAAlC,EAAE,QAAQ,EAAE,KAAK,OAAiB,EAAZ,UAAU,cAAhC,qBAAkC,CAAF;IACjD,OAAO,CACL,oBAAC,UAAU,CAAC,WAAW,oBACjB,UAAU,IACd,QAAQ,EACN,KAAK;YACH,CAAC,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;gBACrB,IAAI,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE;oBAC7B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;iBAC7B;YACH,CAAC;YACH,CAAC,CAAC,QAAQ,IAEd,CACH,CAAA;AACH,CAAC;AAED,eAAe;IACb,MAAM,EAAE,KAAK,CAAC,MAAM;IACpB,KAAK,EAAE,KAAK,CAAC,MAAM;IACnB,MAAM,EAAE,KAAK,CAAC,MAAM;IACpB,WAAW,EAAE,WAAW;IACxB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,WAAW;CACzB,CAAA","sourcesContent":["import React from 'react'\nimport CheckboxField from './Checkbox'\nimport SelectField from './Select'\nimport SelectInput from './SelectInput'\nimport DatePicker from '../../date-picker'\nimport Input from '../../input'\nimport InputNumber from '../../input-number'\n\nexport const defaultFieldWidth = '200px'\n\nexport const getFieldWidth = (type) => {\n if (type === 'dateRange') {\n return '340px'\n }\n\n return (\n {\n dateRange: '340px',\n selectInput: '320px',\n }[type] || defaultFieldWidth\n )\n}\n\nfunction DataRange({ onChange, check, ...otherProps }) {\n return (\n <DatePicker.RangePicker\n {...otherProps}\n onChange={\n check\n ? (dates, dateStrings) => {\n if (check(dates, dateStrings)) {\n onChange(dates, dateStrings)\n }\n }\n : onChange\n }\n />\n )\n}\n\nexport default {\n string: Input.Search,\n input: Input.Search,\n search: Input.Search,\n inputNumber: InputNumber,\n number: InputNumber,\n select: SelectField,\n checkbox: CheckboxField,\n date: DatePicker,\n dateRange: DataRange,\n selectInput: SelectInput,\n}\n"]}
|
|
@@ -11,20 +11,20 @@ var _fieldsMap = _interopRequireWildcard(require("./fieldsMap"));
|
|
|
11
11
|
var _form = _interopRequireDefault(require("../../form"));
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
function _defineProperty(
|
|
16
|
-
function _classCallCheck(
|
|
17
|
-
function _defineProperties(
|
|
18
|
-
function _createClass(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
20
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
21
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
22
|
-
function _possibleConstructorReturn(
|
|
23
|
-
function _assertThisInitialized(
|
|
22
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
23
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
24
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
-
function _getPrototypeOf(
|
|
26
|
-
function _inherits(
|
|
27
|
-
function _setPrototypeOf(
|
|
25
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
26
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
27
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
28
28
|
var FormItem = _form["default"].Item;
|
|
29
29
|
var isInput = function isInput(type) {
|
|
30
30
|
return ['input', 'string', 'search', 'aloneSearch'].includes(type);
|
|
@@ -112,7 +112,9 @@ var Field = exports["default"] = /*#__PURE__*/function (_PureComponent) {
|
|
|
112
112
|
label: title,
|
|
113
113
|
className: className
|
|
114
114
|
}, _react["default"].createElement(_Field, Object.assign({
|
|
115
|
-
|
|
115
|
+
form: form,
|
|
116
|
+
value: value,
|
|
117
|
+
name: name
|
|
116
118
|
}, isInput(type) ? {
|
|
117
119
|
onPressEnter: function onPressEnter(evt) {
|
|
118
120
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/query-form/Field/index.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,IAAI,MAAM,YAAY,CAAA;AAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAA;AAE1B,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,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AI,CAAC,YAAY,CAAC,CAAA;IAC1C,CAAC;CACF","sourcesContent":["import React, { PureComponent } from 'react'\nimport { get } from 'lodash'\nimport fieldsMap, { getFieldWidth } from './fieldsMap'\n\nimport Form from '../../form'\n\nconst FormItem = Form.Item\n\nconst isInput = (type) => ['input', 'string', 'search', 'aloneSearch'].includes(type)\n\nexport default class Field extends PureComponent {\n constructor(props) {\n super(props)\n\n this.state = {\n value: props.initialValue,\n }\n }\n\n render () {\n const {\n type = 'input',\n title,\n name,\n isFieldInDrawer = false,\n className = '',\n component,\n form,\n props: fieldProps,\n } = this.props\n const { value } = this.state\n const Field = component || fieldsMap[type]\n\n return (\n <FormItem label={title} className={className}>\n <Field\n form={form}\n value={value}\n name={name}\n {...(isInput(type)\n ? {\n onPressEnter: (evt) =>\n form.emit('search', { [name]: evt?.target?.value, current: 1 }),\n onSearch: (value) => form.emit('search', { [name]: value, current: 1 })\n }\n : {})}\n {...fieldProps}\n style={{\n ...fieldProps?.style,\n width: isFieldInDrawer ? '100%' : fieldProps?.style?.width || getFieldWidth(type),\n }}\n onChange={this.onChange}\n />\n </FormItem>\n )\n }\n\n updateValue = (name, value) => {\n if (name === this.props.name) {\n this.setState({ value })\n this.props.onChange(name, value)\n }\n }\n\n onChange = (...args) => {\n const { name, type = 'input', component, props: fieldProps } = this.props\n const { onChange } = fieldProps || {}\n\n onChange && onChange(...args)\n\n // Input onChange第一个参数为Event对象,取值特殊处理\n if (!component && isInput(type)) {\n args[0] = get(args[0], 'target.value')\n }\n\n this.setState({ value: args[0] })\n this.props.onChange(name, args[0])\n }\n\n onFormChange = (formData) => {\n this.setState({\n value: get(formData, this.props.name),\n })\n }\n\n componentDidMount () {\n const { form } = this.props\n\n form.on('setValue', this.updateValue)\n form.on('setValues', this.onFormChange)\n }\n\n componentWillUnmount () {\n const { form } = this.props\n\n form.off('setValue', this.updateValue)\n form.off('setValues', this.onFormChange)\n }\n}\n"]}
|
|
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
8
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
9
|
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
var _default = exports["default"] = function _default() {
|
|
12
12
|
var eventEmitter = new _eventemitter["default"]();
|
|
13
13
|
var data = {
|