tntd 3.0.9 → 3.0.11-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/array-input/index.js +10 -1
- package/es/array-input/index.js.map +1 -1
- package/es/index.js +3 -1
- package/es/index.js.map +1 -1
- package/es/locale/en_US.js +17 -1
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +16 -0
- package/es/locale/zh_CN.js.map +1 -1
- package/es/prev-locale.js +32 -2
- package/es/prev-locale.js.map +1 -1
- package/es/query-form-v3/Field/Checkbox.js +23 -0
- package/es/query-form-v3/Field/Checkbox.js.map +1 -0
- package/es/query-form-v3/Field/Composition/FieldPopover.js +330 -0
- package/es/query-form-v3/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form-v3/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form-v3/Field/Composition/Select.js +107 -0
- package/es/query-form-v3/Field/Composition/Select.js.map +1 -0
- package/es/query-form-v3/Field/Composition/index.js +208 -0
- package/es/query-form-v3/Field/Composition/index.js.map +1 -0
- package/es/query-form-v3/Field/Composition/index.less +118 -0
- package/es/query-form-v3/Field/Composition/utils.js +132 -0
- package/es/query-form-v3/Field/Composition/utils.js.map +1 -0
- package/es/query-form-v3/Field/Select.js +59 -0
- package/es/query-form-v3/Field/Select.js.map +1 -0
- package/es/query-form-v3/Field/SelectInput.js +87 -0
- package/es/query-form-v3/Field/SelectInput.js.map +1 -0
- package/es/query-form-v3/Field/fieldsMap.js +28 -0
- package/es/query-form-v3/Field/fieldsMap.js.map +1 -0
- package/es/query-form-v3/Field/index.js +117 -0
- package/es/query-form-v3/Field/index.js.map +1 -0
- package/es/query-form-v3/createActions.js +47 -0
- package/es/query-form-v3/createActions.js.map +1 -0
- package/es/query-form-v3/index.js +175 -0
- package/es/query-form-v3/index.js.map +1 -0
- package/es/query-form-v3/index.less +91 -0
- package/es/query-form-v3/useForm.js +6 -0
- package/es/query-form-v3/useForm.js.map +1 -0
- package/es/query-list-scene/QueryForm.js +6 -3
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/query-list-scene/index.less +4 -0
- package/es/svg-components/illustration-offline.js +11 -29
- package/es/svg-components/illustration-offline.js.map +1 -1
- package/es/table/index.js +2 -2
- package/es/table/index.js.map +1 -1
- package/es/table/resizableTable/index.js +87 -0
- package/es/table/resizableTable/index.js.map +1 -0
- package/es/table/resizableTable/index.less +36 -0
- package/es/table/table-hoc.js +26 -0
- package/es/table/table-hoc.js.map +1 -0
- package/es/tabs/tabs.less +23 -0
- package/es/title/index.js +18 -4
- package/es/title/index.js.map +1 -1
- package/es/title/index.less +88 -34
- package/es/tntd-reference/AHref/index.js +39 -0
- package/es/tntd-reference/AHref/index.js.map +1 -0
- package/es/tntd-reference/ReferenceBatchCheck/index.js +153 -0
- package/es/tntd-reference/ReferenceBatchCheck/index.js.map +1 -0
- package/es/tntd-reference/ReferenceBatchCheck/index.less +21 -0
- package/es/tntd-reference/ReferenceBatchDrawer/index.js +102 -0
- package/es/tntd-reference/ReferenceBatchDrawer/index.js.map +1 -0
- package/es/tntd-reference/ReferenceBatchDrawer/index.less +0 -0
- package/es/tntd-reference/ReferenceCheck/index.js +117 -0
- package/es/tntd-reference/ReferenceCheck/index.js.map +1 -0
- package/es/tntd-reference/ReferenceCheck/index.less +10 -0
- package/es/tntd-reference/ReferenceDrawer/index.js +69 -0
- package/es/tntd-reference/ReferenceDrawer/index.js.map +1 -0
- package/es/tntd-reference/ReferenceDrawer/index.less +0 -0
- package/es/tntd-reference/ReferenceInfo/index.js +150 -0
- package/es/tntd-reference/ReferenceInfo/index.js.map +1 -0
- package/es/tntd-reference/ReferenceInfo/index.less +31 -0
- package/es/tntd-reference/index.js +13 -0
- package/es/tntd-reference/index.js.map +1 -0
- package/es/tntd-virtual-tree/index.js +229 -0
- package/es/tntd-virtual-tree/index.js.map +1 -0
- package/es/tntd-virtual-tree/index.less +59 -0
- package/es/tntd-virtual-tree/utils.js +296 -0
- package/es/tntd-virtual-tree/utils.js.map +1 -0
- package/es/tntd-virtual-tree-select/index.js +98 -22
- package/es/tntd-virtual-tree-select/index.js.map +1 -1
- package/es/tntd-virtual-tree-select/utils.js +20 -124
- package/es/tntd-virtual-tree-select/utils.js.map +1 -1
- package/lib/_util/context.js +1 -1
- package/lib/_util/defaultRenderEmpty.js +1 -1
- package/lib/_util/hooks/useFlexGapSupport.js +4 -4
- package/lib/_util/hooks/useForceUpdate.js +4 -4
- package/lib/_util/responsiveObserve.js +1 -1
- package/lib/_util/styleChecker.js +1 -1
- package/lib/actions/index.js +1 -1
- package/lib/alert/alert.js +2 -2
- package/lib/alert/index.js +1 -1
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +23 -10
- package/lib/array-input/index.js.map +1 -1
- package/lib/button/button.js +2 -2
- package/lib/cascader/cascader.js +1 -1
- package/lib/check-card/group.js +8 -8
- package/lib/check-card/index.js +6 -6
- package/lib/checkbox/checkbox.js +1 -1
- package/lib/color-picker/ColorPicker.js +6 -6
- package/lib/color-picker/index.js +1 -1
- package/lib/columns/index.js +1 -1
- package/lib/config-provider/config-provider.js +1 -1
- package/lib/date-picker/DatePicker.js +1 -1
- package/lib/descriptions/descriptions.js +5 -5
- package/lib/development-login/LoginModal.js +6 -6
- package/lib/development-login/index.js +4 -4
- package/lib/drawer/drawer.js +2 -2
- package/lib/ellipsis/Svg/CopySVG.js +1 -1
- package/lib/ellipsis/Svg/TickSVG.js +1 -1
- package/lib/ellipsis/index.js +5 -5
- package/lib/empty/empty.js +2 -2
- package/lib/empty/empty.stories.js +2 -2
- package/lib/exception/exception.js +1 -1
- package/lib/form/form.js +2 -2
- package/lib/grid-v4/col.js +2 -2
- package/lib/grid-v4/hooks/useBreakpoint.js +1 -1
- package/lib/grid-v4/index.js +1 -1
- package/lib/grid-v4/row.js +6 -6
- package/lib/handle/index.js +1 -1
- package/lib/handle-icon/index.js +11 -11
- package/lib/icon/IconFont.js +1 -1
- package/lib/icon/components/Icon.js +9 -9
- package/lib/icon/components/index.js +1 -1
- package/lib/icon/components/utils.js +3 -3
- package/lib/icon/index.js +7 -7
- package/lib/icon/twoTonePrimaryColor.js +1 -1
- package/lib/icon/utils.js +1 -1
- package/lib/img/Contain.js +1 -1
- package/lib/img/Cover.js +5 -5
- package/lib/img/index.js +5 -5
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -3
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +2 -2
- package/lib/input-number/inputNumber.js +1 -1
- package/lib/label/index.js +2 -2
- package/lib/loading-button/index.js +5 -5
- package/lib/locale/default.d.ts +16 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/default.js +1 -1
- package/lib/locale/en_US.d.ts +16 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +18 -2
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +16 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +17 -1
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/modal/modal.js +1 -1
- package/lib/notification/assets/index.js +1 -1
- package/lib/notification/index.js +1 -1
- package/lib/notification/notification.js +1 -1
- package/lib/page/Box.js +1 -1
- package/lib/page/index.js +7 -7
- package/lib/page-container/index.js +1 -1
- package/lib/page-loading/index.js +1 -1
- package/lib/popconfirm/popconfirm.js +1 -1
- package/lib/popover/popover.js +1 -1
- package/lib/prev-locale.d.ts +42 -0
- package/lib/prev-locale.d.ts.map +1 -1
- package/lib/prev-locale.js +32 -2
- package/lib/prev-locale.js.map +1 -1
- package/lib/preview-text/index.js +7 -7
- package/lib/progress/progress.js +2 -2
- package/lib/query-form/Field/Checkbox.js +1 -1
- package/lib/query-form/Field/Select.js +6 -6
- package/lib/query-form/Field/SelectInput.js +6 -6
- package/lib/query-form/Field/fieldsMap.js +1 -1
- package/lib/query-form/Field/index.js +10 -10
- package/lib/query-form/createActions.js +1 -1
- package/lib/query-form/index.js +10 -10
- package/lib/query-form/useForm.js +1 -1
- package/lib/query-form-v3/Field/Checkbox.d.ts +8 -0
- package/lib/query-form-v3/Field/Checkbox.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Checkbox.js +28 -0
- package/lib/query-form-v3/Field/Checkbox.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.js +370 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/FieldPopover.less +35 -0
- package/lib/query-form-v3/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form-v3/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/Select.js +131 -0
- package/lib/query-form-v3/Field/Composition/Select.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/index.d.ts +10 -0
- package/lib/query-form-v3/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/index.js +255 -0
- package/lib/query-form-v3/Field/Composition/index.js.map +1 -0
- package/lib/query-form-v3/Field/Composition/index.less +118 -0
- package/lib/query-form-v3/Field/Composition/utils.d.ts +22 -0
- package/lib/query-form-v3/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Composition/utils.js +147 -0
- package/lib/query-form-v3/Field/Composition/utils.js.map +1 -0
- package/lib/query-form-v3/Field/Select.d.ts +4 -0
- package/lib/query-form-v3/Field/Select.d.ts.map +1 -0
- package/lib/query-form-v3/Field/Select.js +80 -0
- package/lib/query-form-v3/Field/Select.js.map +1 -0
- package/lib/query-form-v3/Field/SelectInput.d.ts +4 -0
- package/lib/query-form-v3/Field/SelectInput.d.ts.map +1 -0
- package/lib/query-form-v3/Field/SelectInput.js +100 -0
- package/lib/query-form-v3/Field/SelectInput.js.map +1 -0
- package/lib/query-form-v3/Field/fieldsMap.d.ts +27 -0
- package/lib/query-form-v3/Field/fieldsMap.d.ts.map +1 -0
- package/lib/query-form-v3/Field/fieldsMap.js +35 -0
- package/lib/query-form-v3/Field/fieldsMap.js.map +1 -0
- package/lib/query-form-v3/Field/index.d.ts +14 -0
- package/lib/query-form-v3/Field/index.d.ts.map +1 -0
- package/lib/query-form-v3/Field/index.js +147 -0
- package/lib/query-form-v3/Field/index.js.map +1 -0
- package/lib/query-form-v3/createActions.d.ts +14 -0
- package/lib/query-form-v3/createActions.d.ts.map +1 -0
- package/lib/query-form-v3/createActions.js +54 -0
- package/lib/query-form-v3/createActions.js.map +1 -0
- package/lib/query-form-v3/index.d.ts +27 -0
- package/lib/query-form-v3/index.d.ts.map +1 -0
- package/lib/query-form-v3/index.js +206 -0
- package/lib/query-form-v3/index.js.map +1 -0
- package/lib/query-form-v3/index.less +91 -0
- package/lib/query-form-v3/useForm.d.ts +13 -0
- package/lib/query-form-v3/useForm.d.ts.map +1 -0
- package/lib/query-form-v3/useForm.js +13 -0
- package/lib/query-form-v3/useForm.js.map +1 -0
- package/lib/query-list-scene/List.js +13 -13
- package/lib/query-list-scene/QueryForm.d.ts +2 -2
- package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
- package/lib/query-list-scene/QueryForm.js +19 -17
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/QueryListScene.js +10 -10
- package/lib/query-list-scene/Title.js +1 -1
- package/lib/query-list-scene/Toolbar.js +2 -2
- package/lib/query-list-scene/createActions.js +1 -1
- package/lib/query-list-scene/index.js +1 -1
- package/lib/query-list-scene/index.less +4 -0
- package/lib/query-list-scene/useActions.js +1 -1
- package/lib/radio/radio.js +1 -1
- package/lib/render-empty/render-empty.js +1 -1
- package/lib/segmented/index.d.ts +1 -1
- package/lib/segmented/index.js +2 -2
- package/lib/select/select.js +2 -2
- package/lib/spin/spin.js +1 -1
- package/lib/steps/steps.js +2 -2
- package/lib/svg-components/illustration-offline.d.ts.map +1 -1
- package/lib/svg-components/illustration-offline.js +11 -29
- package/lib/svg-components/illustration-offline.js.map +1 -1
- package/lib/svg-components/index.js +1 -1
- package/lib/table/hooks/use-column-setting.js +4 -4
- package/lib/table/hooks/use-expand-fixed.js +6 -6
- package/lib/table/index.d.ts +2 -2
- package/lib/table/index.d.ts.map +1 -1
- package/lib/table/index.js +7 -7
- package/lib/table/index.js.map +1 -1
- package/lib/table/resizableTable/index.d.ts +12 -0
- package/lib/table/resizableTable/index.d.ts.map +1 -0
- package/lib/table/resizableTable/index.js +110 -0
- package/lib/table/resizableTable/index.js.map +1 -0
- package/lib/table/resizableTable/index.less +36 -0
- package/lib/table/table-hoc.d.ts +7 -0
- package/lib/table/table-hoc.d.ts.map +1 -0
- package/lib/table/table-hoc.js +34 -0
- package/lib/table/table-hoc.js.map +1 -0
- package/lib/table/table.js +9 -9
- package/lib/table/table.stories.d.ts +1 -1
- package/lib/table/table.stories.js +2 -2
- package/lib/table/total-shower.js +1 -1
- package/lib/table/utils.js +1 -1
- package/lib/table-container/index.js +1 -1
- package/lib/tabs/tabs.js +2 -2
- package/lib/tabs/tabs.less +23 -0
- package/lib/tabs-container/index.js +1 -1
- package/lib/tag/tag.js +2 -2
- package/lib/time-picker/TimePicker.js +1 -1
- package/lib/time-picker/index.js +1 -1
- package/lib/title/index.d.ts +1 -0
- package/lib/title/index.d.ts.map +1 -1
- package/lib/title/index.js +19 -5
- package/lib/title/index.js.map +1 -1
- package/lib/title/index.less +88 -34
- package/lib/tntd-action/Action.js +9 -9
- package/lib/tntd-action/index.js +8 -8
- package/lib/tntd-cascader/AntdCascader/component/context.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
- package/lib/tntd-cascader/AntdCascader/config/utils.js +2 -2
- package/lib/tntd-cascader/AntdCascader/index.js +7 -7
- package/lib/tntd-cascader/index.js +1 -1
- package/lib/tntd-cascader/rc-cascader/Cascader.js +8 -8
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
- package/lib/tntd-cascader/rc-cascader/index.js +1 -1
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
- package/lib/tntd-form/ErrorList.js +7 -7
- package/lib/tntd-form/Form.js +6 -6
- package/lib/tntd-form/FormItem/ItemHolder.js +6 -6
- package/lib/tntd-form/FormItem/index.js +8 -8
- package/lib/tntd-form/FormItemInput.js +1 -1
- package/lib/tntd-form/FormItemLabel.js +2 -2
- package/lib/tntd-form/FormList.js +1 -1
- package/lib/tntd-form/context.js +1 -1
- package/lib/tntd-form/hooks/useDebounce.js +4 -4
- package/lib/tntd-form/hooks/useForm.js +5 -5
- package/lib/tntd-form/hooks/useFormItemStatus.js +1 -1
- package/lib/tntd-form/hooks/useFrameState.js +5 -5
- package/lib/tntd-form/index.js +1 -1
- package/lib/tntd-icon/index.js +1 -1
- package/lib/tntd-layout/AppList.js +6 -6
- package/lib/tntd-layout/Application.js +6 -6
- package/lib/tntd-layout/Avatar.js +2 -2
- package/lib/tntd-layout/CompatibleLanguage.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
- package/lib/tntd-layout/EnterpriseLayout/Language.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/index.js +1 -1
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
- package/lib/tntd-layout/GlobalNavigation/index.js +9 -9
- package/lib/tntd-layout/Header.js +2 -2
- package/lib/tntd-layout/HeaderActions.js +2 -2
- package/lib/tntd-layout/HeaderNavs.js +6 -6
- package/lib/tntd-layout/HeaderTabs.js +7 -7
- package/lib/tntd-layout/Iconfont.js +1 -1
- package/lib/tntd-layout/Language.js +6 -6
- package/lib/tntd-layout/Layout.js +6 -6
- package/lib/tntd-layout/Logo.js +2 -2
- package/lib/tntd-layout/OrgAppList.js +6 -6
- package/lib/tntd-layout/SideMenu.js +6 -6
- package/lib/tntd-layout/Theme.js +6 -6
- package/lib/tntd-layout/createActions.js +1 -1
- package/lib/tntd-layout/images/index.js +1 -1
- package/lib/tntd-layout/index.js +1 -1
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
- package/lib/tntd-layout/paaslayout/Header.js +2 -2
- package/lib/tntd-layout/paaslayout/Logo.js +2 -2
- package/lib/tntd-layout/paaslayout/SideMenu.js +6 -6
- package/lib/tntd-layout/paaslayout/index.js +6 -6
- package/lib/tntd-layout/storage.js +1 -1
- package/lib/tntd-modal/index.js +6 -6
- package/lib/tntd-rc-select/_util/PurePanel.js +5 -5
- package/lib/tntd-rc-select/_util/context.js +1 -1
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
- package/lib/tntd-rc-select/_util/getIcons.js +1 -1
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +2 -2
- package/lib/tntd-rc-select/index.js +2 -2
- package/lib/tntd-reference/AHref/index.d.ts +4 -0
- package/lib/tntd-reference/AHref/index.d.ts.map +1 -0
- package/lib/tntd-reference/AHref/index.js +44 -0
- package/lib/tntd-reference/AHref/index.js.map +1 -0
- package/lib/tntd-reference/ReferenceBatchCheck/index.d.ts +3 -0
- package/lib/tntd-reference/ReferenceBatchCheck/index.d.ts.map +1 -0
- package/lib/tntd-reference/ReferenceBatchCheck/index.js +165 -0
- package/lib/tntd-reference/ReferenceBatchCheck/index.js.map +1 -0
- package/lib/tntd-reference/ReferenceBatchCheck/index.less +21 -0
- package/lib/tntd-reference/ReferenceBatchDrawer/index.d.ts +4 -0
- package/lib/tntd-reference/ReferenceBatchDrawer/index.d.ts.map +1 -0
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js +126 -0
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js.map +1 -0
- package/lib/tntd-reference/ReferenceBatchDrawer/index.less +0 -0
- package/lib/tntd-reference/ReferenceCheck/index.d.ts +3 -0
- package/lib/tntd-reference/ReferenceCheck/index.d.ts.map +1 -0
- package/lib/tntd-reference/ReferenceCheck/index.js +126 -0
- package/lib/tntd-reference/ReferenceCheck/index.js.map +1 -0
- package/lib/tntd-reference/ReferenceCheck/index.less +10 -0
- package/lib/tntd-reference/ReferenceDrawer/index.d.ts +4 -0
- package/lib/tntd-reference/ReferenceDrawer/index.d.ts.map +1 -0
- package/lib/tntd-reference/ReferenceDrawer/index.js +93 -0
- package/lib/tntd-reference/ReferenceDrawer/index.js.map +1 -0
- package/lib/tntd-reference/ReferenceDrawer/index.less +0 -0
- package/lib/tntd-reference/ReferenceInfo/index.d.ts +4 -0
- package/lib/tntd-reference/ReferenceInfo/index.d.ts.map +1 -0
- package/lib/tntd-reference/ReferenceInfo/index.js +164 -0
- package/lib/tntd-reference/ReferenceInfo/index.js.map +1 -0
- package/lib/tntd-reference/ReferenceInfo/index.less +31 -0
- package/lib/tntd-reference/index.d.ts +15 -0
- package/lib/tntd-reference/index.d.ts.map +1 -0
- package/lib/tntd-reference/index.js +20 -0
- package/lib/tntd-reference/index.js.map +1 -0
- package/lib/tntd-second-page/index.js +1 -1
- package/lib/tntd-select/DropDownWrap.js +8 -8
- package/lib/tntd-select/index.js +10 -9
- package/lib/tntd-virtual-tree/index.d.ts +20 -0
- package/lib/tntd-virtual-tree/index.d.ts.map +1 -0
- package/lib/tntd-virtual-tree/index.js +263 -0
- package/lib/tntd-virtual-tree/index.js.map +1 -0
- package/lib/tntd-virtual-tree/index.less +59 -0
- package/lib/tntd-virtual-tree/utils.d.ts +17 -0
- package/lib/tntd-virtual-tree/utils.d.ts.map +1 -0
- package/lib/tntd-virtual-tree/utils.js +353 -0
- package/lib/tntd-virtual-tree/utils.js.map +1 -0
- package/lib/tntd-virtual-tree-select/index.d.ts +13 -4
- package/lib/tntd-virtual-tree-select/index.d.ts.map +1 -1
- package/lib/tntd-virtual-tree-select/index.js +103 -22
- package/lib/tntd-virtual-tree-select/index.js.map +1 -1
- package/lib/tntd-virtual-tree-select/utils.d.ts +2 -9
- package/lib/tntd-virtual-tree-select/utils.d.ts.map +1 -1
- package/lib/tntd-virtual-tree-select/utils.js +28 -147
- package/lib/tntd-virtual-tree-select/utils.js.map +1 -1
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/upload/index.js +1 -1
- package/lib/utils/checkAuth.js +4 -4
- package/lib/utils/index.js +9 -9
- package/lib/utils/lang.js +3 -3
- package/lib/water-mark/index.js +5 -5
- package/package.json +4 -2
- package/es/tntd-virtual-tree-select/VirtualTree.js +0 -125
- package/es/tntd-virtual-tree-select/VirtualTree.js.map +0 -1
- package/es/tntd-virtual-tree-select/tree.less +0 -29
- package/lib/tntd-virtual-tree-select/VirtualTree.d.ts +0 -13
- package/lib/tntd-virtual-tree-select/VirtualTree.d.ts.map +0 -1
- package/lib/tntd-virtual-tree-select/VirtualTree.js +0 -155
- package/lib/tntd-virtual-tree-select/VirtualTree.js.map +0 -1
- package/lib/tntd-virtual-tree-select/tree.less +0 -29
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _fieldsMap = _interopRequireWildcard(require("./fieldsMap"));
|
|
11
|
+
var _form = _interopRequireDefault(require("../../form"));
|
|
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
|
+
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(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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
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
|
+
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(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
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
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
|
+
var FormItem = _form["default"].Item;
|
|
29
|
+
var isInput = function isInput(type) {
|
|
30
|
+
return ['input', 'string', 'search', 'aloneSearch'].includes(type);
|
|
31
|
+
};
|
|
32
|
+
var Field = exports["default"] = /*#__PURE__*/function (_PureComponent) {
|
|
33
|
+
function Field(props) {
|
|
34
|
+
var _this;
|
|
35
|
+
_classCallCheck(this, Field);
|
|
36
|
+
_this = _callSuper(this, Field, [props]);
|
|
37
|
+
Object.defineProperty(_this, "updateValue", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: function value(name, _value) {
|
|
42
|
+
if (name === _this.props.name) {
|
|
43
|
+
_this.setState({
|
|
44
|
+
value: _value
|
|
45
|
+
});
|
|
46
|
+
_this.props.onChange(name, _value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(_this, "onChange", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: function value() {
|
|
55
|
+
var _this$props = _this.props,
|
|
56
|
+
name = _this$props.name,
|
|
57
|
+
_this$props$type = _this$props.type,
|
|
58
|
+
type = _this$props$type === void 0 ? 'input' : _this$props$type,
|
|
59
|
+
component = _this$props.component,
|
|
60
|
+
fieldProps = _this$props.props;
|
|
61
|
+
var _ref = fieldProps || {},
|
|
62
|
+
onChange = _ref.onChange;
|
|
63
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
64
|
+
args[_key] = arguments[_key];
|
|
65
|
+
}
|
|
66
|
+
onChange && onChange.apply(void 0, args);
|
|
67
|
+
// Input onChange第一个参数为Event对象,取值特殊处理
|
|
68
|
+
if (!component && isInput(type)) {
|
|
69
|
+
args[0] = (0, _get2["default"])(args[0], 'target.value');
|
|
70
|
+
}
|
|
71
|
+
_this.setState({
|
|
72
|
+
value: args[0]
|
|
73
|
+
});
|
|
74
|
+
_this.props.onChange(name, args[0]);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(_this, "onFormChange", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
value: function value(formData) {
|
|
82
|
+
_this.setState({
|
|
83
|
+
value: (0, _get2["default"])(formData, _this.props.name)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
_this.state = {
|
|
88
|
+
value: props.initialValue
|
|
89
|
+
};
|
|
90
|
+
return _this;
|
|
91
|
+
}
|
|
92
|
+
_inherits(Field, _PureComponent);
|
|
93
|
+
return _createClass(Field, [{
|
|
94
|
+
key: "render",
|
|
95
|
+
value: function render() {
|
|
96
|
+
var _a;
|
|
97
|
+
var _this$props2 = this.props,
|
|
98
|
+
_this$props2$type = _this$props2.type,
|
|
99
|
+
type = _this$props2$type === void 0 ? 'input' : _this$props2$type,
|
|
100
|
+
title = _this$props2.title,
|
|
101
|
+
name = _this$props2.name,
|
|
102
|
+
_this$props2$isFieldI = _this$props2.isFieldInDrawer,
|
|
103
|
+
isFieldInDrawer = _this$props2$isFieldI === void 0 ? false : _this$props2$isFieldI,
|
|
104
|
+
_this$props2$classNam = _this$props2.className,
|
|
105
|
+
className = _this$props2$classNam === void 0 ? '' : _this$props2$classNam,
|
|
106
|
+
component = _this$props2.component,
|
|
107
|
+
form = _this$props2.form,
|
|
108
|
+
fieldProps = _this$props2.props;
|
|
109
|
+
var value = this.state.value;
|
|
110
|
+
var _Field = component || _fieldsMap["default"][type];
|
|
111
|
+
return _react["default"].createElement(FormItem, {
|
|
112
|
+
label: title,
|
|
113
|
+
className: className
|
|
114
|
+
}, _react["default"].createElement(_Field, Object.assign({
|
|
115
|
+
form: form,
|
|
116
|
+
value: value
|
|
117
|
+
}, isInput(type) ? {
|
|
118
|
+
onPressEnter: function onPressEnter(evt) {
|
|
119
|
+
var _a;
|
|
120
|
+
return form.emit('search', _defineProperty(_defineProperty({}, name, (_a = evt === null || evt === void 0 ? void 0 : evt.target) === null || _a === void 0 ? void 0 : _a.value), "current", 1));
|
|
121
|
+
},
|
|
122
|
+
onSearch: function onSearch(value) {
|
|
123
|
+
return form.emit('search', _defineProperty(_defineProperty({}, name, value), "current", 1));
|
|
124
|
+
}
|
|
125
|
+
} : {}, fieldProps, {
|
|
126
|
+
style: Object.assign(Object.assign({}, fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style), {
|
|
127
|
+
width: isFieldInDrawer ? '100%' : ((_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style) === null || _a === void 0 ? void 0 : _a.width) || (0, _fieldsMap.getFieldWidth)(type)
|
|
128
|
+
}),
|
|
129
|
+
onChange: this.onChange
|
|
130
|
+
})));
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "componentDidMount",
|
|
134
|
+
value: function componentDidMount() {
|
|
135
|
+
var form = this.props.form;
|
|
136
|
+
form.on('setValue', this.updateValue);
|
|
137
|
+
form.on('setValues', this.onFormChange);
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
key: "componentWillUnmount",
|
|
141
|
+
value: function componentWillUnmount() {
|
|
142
|
+
var form = this.props.form;
|
|
143
|
+
form.off('setValue', this.updateValue);
|
|
144
|
+
form.off('setValues', this.onFormChange);
|
|
145
|
+
}
|
|
146
|
+
}]);
|
|
147
|
+
}(_react.PureComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/query-form-v3/Field/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,mCAA4B;AAC5B,yDAAsD;AAEtD,sDAA6B;AAE7B,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAA;AAE1B,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAErF,MAAqB,KAAM,SAAQ,qBAA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KAAK,KAAI,IAAA,yBAAa,EAAC,IAAI,CAAC,KAEnF,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACvB,CACO,CACZ,CAAA;IACH,CAAC;IA8BD,iBAAiB;QACf,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE3B,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;QACrC,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IACzC,CAAC;IAED,oBAAoB;QAClB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE3B,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;QACtC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;IAC1C,CAAC;CACF;AAvFD,wBAuFC","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 {...(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"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function _default(): {
|
|
2
|
+
setData(key: any, value: any): void;
|
|
3
|
+
getData(key: any): void;
|
|
4
|
+
setValues(values: any): void;
|
|
5
|
+
getValues(): {};
|
|
6
|
+
resetValues(): void;
|
|
7
|
+
setValue(name: any, value: any): void;
|
|
8
|
+
getValue(name: any): any;
|
|
9
|
+
on: (eventName: any, callback: any) => void;
|
|
10
|
+
emit: (...args: any[]) => void;
|
|
11
|
+
off: (...args: any[]) => void;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=createActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createActions.d.ts","sourceRoot":"","sources":["../../src/query-form-v3/createActions.js"],"names":[],"mappings":"AAGe;;;;;;;;;;;EA+Cd"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
8
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
|
+
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
var _default = exports["default"] = function _default() {
|
|
12
|
+
var eventEmitter = new _eventemitter["default"]();
|
|
13
|
+
var data = {
|
|
14
|
+
initialValues: {},
|
|
15
|
+
values: {}
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
setData: function setData(key, value) {
|
|
19
|
+
(0, _set2["default"])(data, key, value);
|
|
20
|
+
},
|
|
21
|
+
getData: function getData(key) {
|
|
22
|
+
(0, _get2["default"])(data, key);
|
|
23
|
+
},
|
|
24
|
+
setValues: function setValues(values) {
|
|
25
|
+
data.values = values;
|
|
26
|
+
eventEmitter.emit('setValues', values);
|
|
27
|
+
},
|
|
28
|
+
getValues: function getValues() {
|
|
29
|
+
return data.values;
|
|
30
|
+
},
|
|
31
|
+
resetValues: function resetValues() {
|
|
32
|
+
data.values = Object.assign({}, data.initialValues);
|
|
33
|
+
eventEmitter.emit('setValues', data.values);
|
|
34
|
+
},
|
|
35
|
+
setValue: function setValue(name, value) {
|
|
36
|
+
data.values = data.values || {};
|
|
37
|
+
data.values[name] = value;
|
|
38
|
+
eventEmitter.emit('setValue', name, value);
|
|
39
|
+
},
|
|
40
|
+
getValue: function getValue(name) {
|
|
41
|
+
var _a;
|
|
42
|
+
return (_a = data.values) === null || _a === void 0 ? void 0 : _a[name];
|
|
43
|
+
},
|
|
44
|
+
on: function on(eventName, callback) {
|
|
45
|
+
eventEmitter.on(eventName, callback);
|
|
46
|
+
},
|
|
47
|
+
emit: function emit() {
|
|
48
|
+
eventEmitter.emit.apply(eventEmitter, arguments);
|
|
49
|
+
},
|
|
50
|
+
off: function off() {
|
|
51
|
+
eventEmitter.removeListener.apply(eventEmitter, arguments);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@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AE,QAAQ,EAAE,EAAE;YAC1B,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QACtC,CAAC;QAED,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE;YAChB,YAAY,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;QAC5B,CAAC;QAED,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE;YACf,YAAY,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAA;QACtC,CAAC;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import EventEmitter from 'eventemitter3'\nimport { get, set } from 'lodash'\n\nexport default () => {\n const eventEmitter = new EventEmitter()\n const data = {\n initialValues: {},\n values: {},\n }\n\n return {\n setData(key, value) {\n set(data, key, value)\n },\n getData(key) {\n get(data, key)\n },\n\n setValues(values) {\n data.values = values\n eventEmitter.emit('setValues', values)\n },\n getValues() {\n return data.values\n },\n resetValues() {\n data.values = { ...data.initialValues }\n eventEmitter.emit('setValues', data.values)\n },\n setValue(name, value) {\n data.values = data.values || {}\n data.values[name] = value\n eventEmitter.emit('setValue', name, value)\n },\n getValue(name) {\n return data.values?.[name]\n },\n\n on: (eventName, callback) => {\n eventEmitter.on(eventName, callback)\n },\n\n emit: (...args) => {\n eventEmitter.emit(...args)\n },\n\n off: (...args) => {\n eventEmitter.removeListener(...args)\n },\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default QueryForm;
|
|
2
|
+
declare function QueryForm({ form, className, initialValues: _initialValues, language, onSearch, onReset, onChange, renderActions, extraActions, children, showSearch, showReset, showFieldCount, minGroupCount, }: {
|
|
3
|
+
form: any;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
initialValues: any;
|
|
6
|
+
language: any;
|
|
7
|
+
onSearch: any;
|
|
8
|
+
onReset: any;
|
|
9
|
+
onChange: any;
|
|
10
|
+
renderActions: any;
|
|
11
|
+
extraActions: any;
|
|
12
|
+
children: any;
|
|
13
|
+
showSearch?: boolean | undefined;
|
|
14
|
+
showReset?: boolean | undefined;
|
|
15
|
+
showFieldCount?: number | undefined;
|
|
16
|
+
minGroupCount?: number | undefined;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare namespace QueryForm {
|
|
19
|
+
export { Field };
|
|
20
|
+
export { useForm };
|
|
21
|
+
export { createActions as createForm };
|
|
22
|
+
}
|
|
23
|
+
import React from "react";
|
|
24
|
+
import Field from "./Field";
|
|
25
|
+
import useForm from "./useForm";
|
|
26
|
+
import createActions from "./createActions";
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query-form-v3/index.js"],"names":[],"mappings":";AAcA;;;;;;;;;;;;;;;sBAqLC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
11
|
+
var _Field = _interopRequireDefault(require("./Field"));
|
|
12
|
+
var _Composition = _interopRequireDefault(require("./Field/Composition"));
|
|
13
|
+
var _useForm = _interopRequireDefault(require("./useForm"));
|
|
14
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
15
|
+
var _form = _interopRequireDefault(require("../form"));
|
|
16
|
+
var _prevLocale = require("../prev-locale");
|
|
17
|
+
require("./index.less");
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); }
|
|
24
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
25
|
+
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."); }
|
|
26
|
+
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; } }
|
|
27
|
+
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; }
|
|
28
|
+
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; } }
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
30
|
+
var clsPrefix = 'tnt-queryform';
|
|
31
|
+
function QueryForm(_ref) {
|
|
32
|
+
var form = _ref.form,
|
|
33
|
+
_ref$className = _ref.className,
|
|
34
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
35
|
+
_initialValues = _ref.initialValues,
|
|
36
|
+
language = _ref.language,
|
|
37
|
+
onSearch = _ref.onSearch,
|
|
38
|
+
onReset = _ref.onReset,
|
|
39
|
+
onChange = _ref.onChange,
|
|
40
|
+
renderActions = _ref.renderActions,
|
|
41
|
+
extraActions = _ref.extraActions,
|
|
42
|
+
children = _ref.children,
|
|
43
|
+
_ref$showSearch = _ref.showSearch,
|
|
44
|
+
showSearch = _ref$showSearch === void 0 ? false : _ref$showSearch,
|
|
45
|
+
_ref$showReset = _ref.showReset,
|
|
46
|
+
showReset = _ref$showReset === void 0 ? false : _ref$showReset,
|
|
47
|
+
_ref$showFieldCount = _ref.showFieldCount,
|
|
48
|
+
showFieldCount = _ref$showFieldCount === void 0 ? 3 : _ref$showFieldCount,
|
|
49
|
+
_ref$minGroupCount = _ref.minGroupCount,
|
|
50
|
+
minGroupCount = _ref$minGroupCount === void 0 ? 3 : _ref$minGroupCount;
|
|
51
|
+
var _useState = (0, _react.useState)(_initialValues || {}),
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
initialValues = _useState2[0],
|
|
54
|
+
setInitialValues = _useState2[1];
|
|
55
|
+
var formRef = (0, _react.useRef)(form || (0, _createActions["default"])());
|
|
56
|
+
(0, _react.useEffect)(function () {
|
|
57
|
+
var _search = function _search() {
|
|
58
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
|
+
onSearch(Object.assign(Object.assign({}, formRef.current.getValues()), params));
|
|
60
|
+
};
|
|
61
|
+
formRef.current.setData('initialValues', initialValues);
|
|
62
|
+
formRef.current.setData('values', initialValues);
|
|
63
|
+
formRef.current.on('search', _search);
|
|
64
|
+
return function () {
|
|
65
|
+
formRef.current.off('search', _search);
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
var _getText = function _getText(key) {
|
|
69
|
+
return (0, _prevLocale.getText)(key, language || (0, _prevLocale.getLanguage)());
|
|
70
|
+
};
|
|
71
|
+
var _onSearch = function _onSearch() {
|
|
72
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(formRef.current.getValues());
|
|
73
|
+
};
|
|
74
|
+
var _onReset = function _onReset() {
|
|
75
|
+
formRef.current.setValues(Object.assign({}, initialValues));
|
|
76
|
+
onReset === null || onReset === void 0 ? void 0 : onReset(initialValues);
|
|
77
|
+
setInitialValues(Object.assign({}, initialValues));
|
|
78
|
+
};
|
|
79
|
+
var _onFieldChange = function _onFieldChange(name, value) {
|
|
80
|
+
var values = formRef.current.getValues();
|
|
81
|
+
var newValues = Object.assign(Object.assign({}, values), _defineProperty({}, name, value));
|
|
82
|
+
var changedInfo = {
|
|
83
|
+
name: name,
|
|
84
|
+
value: value,
|
|
85
|
+
preValue: values === null || values === void 0 ? void 0 : values[name]
|
|
86
|
+
};
|
|
87
|
+
formRef.current.setData('values', newValues);
|
|
88
|
+
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
89
|
+
rest[_key - 2] = arguments[_key];
|
|
90
|
+
}
|
|
91
|
+
onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
|
|
92
|
+
};
|
|
93
|
+
var _onCompositionFieldChange = function _onCompositionFieldChange(value, deleteKeys, needSearch) {
|
|
94
|
+
var _a;
|
|
95
|
+
var values = formRef.current.getValues();
|
|
96
|
+
var newValues = Object.assign(Object.assign({}, values), value);
|
|
97
|
+
if (deleteKeys === null || deleteKeys === void 0 ? void 0 : deleteKeys.length) {
|
|
98
|
+
deleteKeys === null || deleteKeys === void 0 ? void 0 : deleteKeys.forEach(function (key) {
|
|
99
|
+
if (values === null || values === void 0 ? void 0 : values[key]) {
|
|
100
|
+
delete newValues[key];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
formRef.current.setData('values', newValues);
|
|
105
|
+
if (onChange) {
|
|
106
|
+
(_a = Object.keys(values)) === null || _a === void 0 ? void 0 : _a.forEach(function (key) {
|
|
107
|
+
if (JSON.stringify(value[key]) !== JSON.stringify(values[key] || '')) {
|
|
108
|
+
var changedInfo = {
|
|
109
|
+
name: key,
|
|
110
|
+
value: value[key],
|
|
111
|
+
preValue: values === null || values === void 0 ? void 0 : values[key]
|
|
112
|
+
};
|
|
113
|
+
onChange(newValues, changedInfo);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
if (needSearch) {
|
|
117
|
+
formRef.current.emit('search', newValues);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
122
|
+
var _a;
|
|
123
|
+
var groupFields = [];
|
|
124
|
+
var outFields = [];
|
|
125
|
+
var otherFields = [];
|
|
126
|
+
var rightChildren = [];
|
|
127
|
+
var compositionInitValues = {};
|
|
128
|
+
_react["default"].Children.map(children, function (child) {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
if (child) {
|
|
131
|
+
if (((_a = child.props) === null || _a === void 0 ? void 0 : _a.align) === 'right') {
|
|
132
|
+
rightChildren.push(child);
|
|
133
|
+
return;
|
|
134
|
+
} else if (((_b = child.props) === null || _b === void 0 ? void 0 : _b.isGroup) === false) {
|
|
135
|
+
outFields.push(child);
|
|
136
|
+
} else {
|
|
137
|
+
groupFields.push(child);
|
|
138
|
+
}
|
|
139
|
+
otherFields.push(child);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
if (groupFields.length <= minGroupCount) {
|
|
143
|
+
groupFields = [];
|
|
144
|
+
outFields = otherFields;
|
|
145
|
+
} else {
|
|
146
|
+
// 初始值
|
|
147
|
+
for (var i = 0; i < groupFields.length; i++) {
|
|
148
|
+
var name = (_a = groupFields[i].props) === null || _a === void 0 ? void 0 : _a.name;
|
|
149
|
+
if (initialValues[name] !== undefined) {
|
|
150
|
+
compositionInitValues[name] = initialValues[name];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return [groupFields, outFields, rightChildren, compositionInitValues];
|
|
155
|
+
}, [children, minGroupCount, initialValues]),
|
|
156
|
+
_useMemo2 = _slicedToArray(_useMemo, 4),
|
|
157
|
+
groupFields = _useMemo2[0],
|
|
158
|
+
outFields = _useMemo2[1],
|
|
159
|
+
rightChildren = _useMemo2[2],
|
|
160
|
+
compositionInitValues = _useMemo2[3];
|
|
161
|
+
var isGroupMode = groupFields.length > 0;
|
|
162
|
+
var hasOutField = outFields.length > 0;
|
|
163
|
+
var showExtra = rightChildren.length > 0 || extraActions;
|
|
164
|
+
return _react["default"].createElement("div", {
|
|
165
|
+
className: (0, _classnames["default"])(clsPrefix, _defineProperty({}, className, className))
|
|
166
|
+
}, _react["default"].createElement(_form["default"], {
|
|
167
|
+
layout: "inline"
|
|
168
|
+
}, _react["default"].createElement("div", {
|
|
169
|
+
className: "".concat(clsPrefix, "-top")
|
|
170
|
+
}, _react["default"].createElement("div", {
|
|
171
|
+
className: "".concat(clsPrefix, "-top-body")
|
|
172
|
+
}, hasOutField ? outFields.map(function (child, i) {
|
|
173
|
+
var _a;
|
|
174
|
+
return _react["default"].cloneElement(child, {
|
|
175
|
+
form: formRef.current,
|
|
176
|
+
initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[(_a = child.props) === null || _a === void 0 ? void 0 : _a.name],
|
|
177
|
+
onChange: _onFieldChange,
|
|
178
|
+
key: i
|
|
179
|
+
});
|
|
180
|
+
}) : isGroupMode ? _react["default"].createElement(_Composition["default"], {
|
|
181
|
+
clsPrefix: clsPrefix,
|
|
182
|
+
fieldItems: groupFields,
|
|
183
|
+
initialValues: compositionInitValues,
|
|
184
|
+
onChange: _onCompositionFieldChange,
|
|
185
|
+
form: formRef.current
|
|
186
|
+
}) : null, renderActions ? renderActions() : _react["default"].createElement(_react["default"].Fragment, null, showSearch && _react["default"].createElement(_button["default"], {
|
|
187
|
+
type: "primary",
|
|
188
|
+
onClick: _onSearch
|
|
189
|
+
}, _getText('search')), showReset && _react["default"].createElement(_button["default"], {
|
|
190
|
+
onClick: _onReset
|
|
191
|
+
}, _getText('reset')))), showExtra && _react["default"].createElement("div", {
|
|
192
|
+
className: "".concat(clsPrefix, "-extra")
|
|
193
|
+
}, rightChildren, extraActions)), isGroupMode && hasOutField && _react["default"].createElement("div", {
|
|
194
|
+
className: "".concat(clsPrefix, "-bottom")
|
|
195
|
+
}, _react["default"].createElement(_Composition["default"], {
|
|
196
|
+
clsPrefix: clsPrefix,
|
|
197
|
+
fieldItems: groupFields,
|
|
198
|
+
initialValues: compositionInitValues,
|
|
199
|
+
onChange: _onCompositionFieldChange,
|
|
200
|
+
form: formRef.current
|
|
201
|
+
}))));
|
|
202
|
+
}
|
|
203
|
+
QueryForm.Field = _Field["default"];
|
|
204
|
+
QueryForm.useForm = _useForm["default"];
|
|
205
|
+
QueryForm.createForm = _createActions["default"];
|
|
206
|
+
var _default = exports["default"] = QueryForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query-form-v3/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmE;AACnE,4DAA2B;AAC3B,oEAA2C;AAC3C,oDAA2B;AAC3B,sEAA6C;AAC7C,wDAA+B;AAC/B,uDAA8B;AAC9B,mDAA0B;AAC1B,gDAAqD;AAErD,wBAAqB;AAErB,MAAM,SAAS,GAAG,eAAe,CAAA;AAEjC,SAAS,SAAS,CAAC,EACjB,IAAI,EACJ,SAAS,GAAG,EAAE,EACd,aAAa,EAAE,cAAc,EAC7B,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,cAAc,GAAG,CAAC,EAClB,aAAa,GAAG,CAAC,EAAE,SAAS;EAC7B;IACC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,cAAc,IAAI,EAAE,CAAC,CAAA;IACxE,MAAM,OAAO,GAAG,IAAA,cAAM,EAAC,IAAI,IAAI,IAAA,uBAAa,GAAE,CAAC,CAAA;IAE/C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,EAAE,EAAE;YAC9B,QAAQ,iCACH,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,GAC3B,MAAM,EACT,CAAA;QACJ,CAAC,CAAA;QACD,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,aAAa,CAAC,CAAA;QACvD,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;QAChD,OAAO,CAAC,OAAO,CAAC,E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a,EAAE,CAChB,CAAC,CAAC,CAAC,CACF;wBACG,UAAU,IAAI,CACb,8BAAC,gBAAM,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,SAAS,IACtC,QAAQ,CAAC,QAAQ,CAAC,CACZ,CACV;wBACA,SAAS,IAAI,8BAAC,gBAAM,IAAC,OAAO,EAAE,QAAQ,IAAG,QAAQ,CAAC,OAAO,CAAC,CAAU,CACpE,CACJ,CACG;gBACL,SAAS,IAAI,CACZ,uCAAK,SAAS,EAAE,GAAG,SAAS,QAAQ;oBACjC,aAAa;oBACb,YAAY,CACT,CACP,CACG;YACL,WAAW,IAAI,WAAW,IAAI,CAC7B,uCAAK,SAAS,EAAE,GAAG,SAAS,SAAS;gBACnC,8BAAC,qBAAW,IACV,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,WAAW,EACvB,aAAa,EAAE,qBAAqB,EACpC,QAAQ,EAAE,yBAAyB,EACnC,IAAI,EAAE,OAAO,CAAC,OAAO,GACrB,CACE,CACP,CACI,CACH,CACP,CAAA;AACH,CAAC;AAED,SAAS,CAAC,KAAK,GAAG,eAAK,CAAA;AACvB,SAAS,CAAC,OAAO,GAAG,iBAAO,CAAA;AAC3B,SAAS,CAAC,UAAU,GAAG,uBAAa,CAAA;AAEpC,kBAAe,SAAS,CAAA","sourcesContent":["import React, { useMemo, useRef, useEffect, useState } from 'react'\nimport cn from 'classnames'\nimport createActions from './createActions'\nimport Field from './Field'\nimport Composition from './Field/Composition'\nimport useForm from './useForm'\nimport Button from '../button'\nimport Form from '../form'\nimport { getLanguage, getText } from '../prev-locale'\n\nimport './index.less'\n\nconst clsPrefix = 'tnt-queryform'\n\nfunction QueryForm({\n form,\n className = '',\n initialValues: _initialValues,\n language,\n onSearch,\n onReset,\n onChange,\n renderActions,\n extraActions,\n children,\n showSearch = false,\n showReset = false,\n showFieldCount = 3,\n minGroupCount = 3, // 最小聚合个数\n}) {\n const [initialValues, setInitialValues] = useState(_initialValues || {})\n const formRef = useRef(form || createActions())\n\n useEffect(() => {\n const _search = (params = {}) => {\n onSearch({\n ...formRef.current.getValues(),\n ...params,\n })\n }\n formRef.current.setData('initialValues', initialValues)\n formRef.current.setData('values', initialValues)\n formRef.current.on('search', _search)\n return () => {\n formRef.current.off('search', _search)\n }\n }, [])\n\n const _getText = (key) => {\n return getText(key, language || getLanguage())\n }\n const _onSearch = () => {\n onSearch?.(formRef.current.getValues())\n }\n\n const _onReset = () => {\n formRef.current.setValues({ ...initialValues })\n onReset?.(initialValues)\n setInitialValues({ ...initialValues })\n }\n\n const _onFieldChange = (name, value, ...rest) => {\n const values = formRef.current.getValues()\n const newValues = {\n ...values,\n [name]: value,\n }\n const changedInfo = { name, value, preValue: values?.[name] }\n formRef.current.setData('values', newValues)\n onChange && onChange(newValues, changedInfo, ...rest)\n }\n\n const _onCompositionFieldChange = (value, deleteKeys, needSearch) => {\n const values = formRef.current.getValues()\n const newValues = {\n ...values,\n ...value,\n }\n if (deleteKeys?.length) {\n deleteKeys?.forEach((key) => {\n if (values?.[key]) {\n delete newValues[key]\n }\n })\n }\n formRef.current.setData('values', newValues)\n if (onChange) {\n Object.keys(values)?.forEach((key) => {\n if (JSON.stringify(value[key]) !== JSON.stringify(values[key] || '')) {\n const changedInfo = { name: key, value: value[key], preValue: values?.[key] }\n onChange(newValues, changedInfo)\n }\n })\n if(needSearch) {\n formRef.current.emit('search', newValues)\n }\n }\n }\n\n const [groupFields, outFields, rightChildren, compositionInitValues] = useMemo(() => {\n let groupFields = []\n let outFields = []\n let otherFields = []\n const rightChildren = []\n const compositionInitValues = {}\n React.Children.map(children, (child) => {\n if (child) {\n if (child.props?.align === 'right') {\n rightChildren.push(child)\n return\n } else if (child.props?.isGroup === false) {\n outFields.push(child)\n } else {\n groupFields.push(child)\n }\n otherFields.push(child)\n }\n })\n if (groupFields.length <= minGroupCount) {\n groupFields = []\n outFields = otherFields\n } else {\n // 初始值\n for (let i = 0; i < groupFields.length; i++) {\n const name = groupFields[i].props?.name\n if (initialValues[name] !== undefined) {\n compositionInitValues[name] = initialValues[name]\n }\n }\n }\n return [groupFields, outFields, rightChildren, compositionInitValues]\n }, [children, minGroupCount, initialValues])\n\n const isGroupMode = groupFields.length > 0\n const hasOutField = outFields.length > 0\n const showExtra = rightChildren.length > 0 || extraActions\n\n return (\n <div className={cn(clsPrefix, { [className]: className })}>\n <Form layout=\"inline\">\n <div className={`${clsPrefix}-top`}>\n <div className={`${clsPrefix}-top-body`}>\n {hasOutField ? (\n outFields.map((child, i) =>\n React.cloneElement(child, {\n form: formRef.current,\n initialValue: initialValues?.[child.props?.name],\n onChange: _onFieldChange,\n key: i,\n })\n )\n ) : isGroupMode ? (\n <Composition\n clsPrefix={clsPrefix}\n fieldItems={groupFields}\n initialValues={compositionInitValues}\n onChange={_onCompositionFieldChange}\n form={formRef.current}\n />\n ) : null}\n\n {renderActions ? (\n renderActions()\n ) : (\n <>\n {showSearch && (\n <Button type=\"primary\" onClick={_onSearch}>\n {_getText('search')}\n </Button>\n )}\n {showReset && <Button onClick={_onReset}>{_getText('reset')}</Button>}\n </>\n )}\n </div>\n {showExtra && (\n <div className={`${clsPrefix}-extra`}>\n {rightChildren}\n {extraActions}\n </div>\n )}\n </div>\n {isGroupMode && hasOutField && (\n <div className={`${clsPrefix}-bottom`}>\n <Composition\n clsPrefix={clsPrefix}\n fieldItems={groupFields}\n initialValues={compositionInitValues}\n onChange={_onCompositionFieldChange}\n form={formRef.current}\n />\n </div>\n )}\n </Form>\n </div>\n )\n}\n\nQueryForm.Field = Field\nQueryForm.useForm = useForm\nQueryForm.createForm = createActions\n\nexport default QueryForm\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
.tnt-queryform {
|
|
2
|
+
&-top {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex: 1;
|
|
5
|
+
&-body {
|
|
6
|
+
flex: 1;
|
|
7
|
+
.ant-btn {
|
|
8
|
+
margin-right: 10px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-extra {
|
|
14
|
+
& > * {
|
|
15
|
+
margin-left: 10px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ant-form {
|
|
20
|
+
// margin-bottom: @margin-sm;
|
|
21
|
+
&.ant-form-inline {
|
|
22
|
+
flex-wrap: unset;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.ant-form-inline .ant-form-item {
|
|
27
|
+
margin-right: 10px;
|
|
28
|
+
margin-bottom: @margin-sm;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ant-form-item-control {
|
|
33
|
+
// min-width: 160px;
|
|
34
|
+
line-height: unset;
|
|
35
|
+
.ant-calendar-picker-input {
|
|
36
|
+
padding: 0 @padding-sm;
|
|
37
|
+
}
|
|
38
|
+
.ant-form-item-children {
|
|
39
|
+
& > .ant-input,
|
|
40
|
+
& > .ant-input-affix-wrapper {
|
|
41
|
+
width: 160px;
|
|
42
|
+
// width: 200px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-drawer {
|
|
49
|
+
margin-top: @margin-xxl;
|
|
50
|
+
&.large-size {
|
|
51
|
+
margin-top: 60px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.ant-drawer.ant-drawer-open {
|
|
55
|
+
.ant-drawer-mask {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
background: unset;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
.ant-drawer-body {
|
|
61
|
+
.ant-form-item {
|
|
62
|
+
display: block;
|
|
63
|
+
margin-right: 0;
|
|
64
|
+
margin-bottom: @margin-md;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
.ant-form-item-label {
|
|
68
|
+
display: block;
|
|
69
|
+
text-align: left;
|
|
70
|
+
line-height: 22px;
|
|
71
|
+
margin-bottom: 10px;
|
|
72
|
+
}
|
|
73
|
+
.ant-form-item-control-wrapper,
|
|
74
|
+
.ant-form-item-control,
|
|
75
|
+
.ant-calendar-picker,
|
|
76
|
+
.ant-input {
|
|
77
|
+
min-width: 100%;
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& > .ant-btn {
|
|
82
|
+
display: block;
|
|
83
|
+
width: 100%;
|
|
84
|
+
margin-bottom: 10px;
|
|
85
|
+
&.ant-btn-primary {
|
|
86
|
+
margin-top: @margin-md;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function useForm(): {
|
|
2
|
+
setData(key: any, value: any): void;
|
|
3
|
+
getData(key: any): void;
|
|
4
|
+
setValues(values: any): void;
|
|
5
|
+
getValues(): {};
|
|
6
|
+
resetValues(): void;
|
|
7
|
+
setValue(name: any, value: any): void;
|
|
8
|
+
getValue(name: any): any;
|
|
9
|
+
on: (eventName: any, callback: any) => void;
|
|
10
|
+
emit: (...args: any[]) => void;
|
|
11
|
+
off: (...args: any[]) => void;
|
|
12
|
+
}[];
|
|
13
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/query-form-v3/useForm.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;IAIC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = useForm;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function useForm() {
|
|
11
|
+
var form = (0, _react.useRef)((0, _createActions["default"])());
|
|
12
|
+
return [form.current];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.js","sourceRoot":"","sources":["../../src/query-form-v3/useForm.js"],"names":[],"mappings":";;;;;AAAA,iCAA8B;AAC9B,oEAA2C;AAE3C,SAAwB,OAAO;IAC7B,MAAM,IAAI,GAAG,IAAA,cAAM,EAAC,IAAA,uBAAa,GAAE,CAAC,CAAA;IAEpC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACvB,CAAC;AAJD,0BAIC","sourcesContent":["import { useRef } from 'react'\nimport createActions from './createActions'\n\nexport default function useForm() {\n const form = useRef(createActions())\n\n return [form.current]\n}\n"]}
|