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
|
@@ -11,53 +11,129 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
11
11
|
* @Author: 郑泳健
|
|
12
12
|
* @Date: 2024-08-05 10:50:17
|
|
13
13
|
* @LastEditors: 郑泳健
|
|
14
|
-
* @LastEditTime: 2024-08-
|
|
14
|
+
* @LastEditTime: 2024-08-20 15:03:16
|
|
15
15
|
*/
|
|
16
|
-
import React, { useMemo } from 'react';
|
|
16
|
+
import React, { useState, useRef, useMemo } from 'react';
|
|
17
17
|
import RcSelect from '../tntd-rc-select';
|
|
18
|
-
import
|
|
18
|
+
import TntdVirtualTree from '../tntd-virtual-tree';
|
|
19
|
+
import { filterLastestNode, flatWithParents } from './utils.js';
|
|
19
20
|
import './index.less';
|
|
20
21
|
const TntdVirtualTreeSelect = _a => {
|
|
21
22
|
var {
|
|
22
23
|
value,
|
|
23
24
|
onChange,
|
|
24
|
-
renderItem,
|
|
25
25
|
treeData,
|
|
26
26
|
showSearch,
|
|
27
|
-
treeDefaultExpandAll,
|
|
28
|
-
treeExpandedKeys,
|
|
29
27
|
fieldNames,
|
|
30
28
|
dropdownMatchSelectWidth,
|
|
31
|
-
dropdownStyle
|
|
29
|
+
dropdownStyle,
|
|
30
|
+
showCheckedStrategy,
|
|
31
|
+
treeCheckable,
|
|
32
|
+
treeCheckStrictly,
|
|
33
|
+
treeDefaultExpandAll,
|
|
34
|
+
treeExpandedKeys,
|
|
35
|
+
onTreeCheck,
|
|
36
|
+
onTreeExpand,
|
|
37
|
+
treeTitleRender
|
|
32
38
|
} = _a,
|
|
33
|
-
restProps = __rest(_a, ["value", "onChange", "
|
|
39
|
+
restProps = __rest(_a, ["value", "onChange", "treeData", "showSearch", "fieldNames", "dropdownMatchSelectWidth", "dropdownStyle", "showCheckedStrategy", "treeCheckable", "treeCheckStrictly", "treeDefaultExpandAll", "treeExpandedKeys", "onTreeCheck", "onTreeExpand", "treeTitleRender"]);
|
|
40
|
+
const selectRef = useRef(null);
|
|
41
|
+
const [filterKey, setFilterKey] = useState(undefined);
|
|
34
42
|
const mergeDropdownStyle = useMemo(() => {
|
|
35
43
|
return Array.isArray(treeData) && treeData.length ? dropdownStyle : {};
|
|
36
44
|
}, [dropdownStyle, treeData]);
|
|
37
45
|
const mergeDropdownMatchSelectWidth = useMemo(() => {
|
|
38
46
|
return Array.isArray(treeData) && treeData.length ? dropdownMatchSelectWidth : true;
|
|
39
47
|
}, [dropdownMatchSelectWidth, treeData]);
|
|
40
|
-
const
|
|
48
|
+
const treeNodeWithParents = useMemo(() => {
|
|
49
|
+
return flatWithParents(treeData, fieldNames);
|
|
50
|
+
}, [treeData, fieldNames]);
|
|
51
|
+
const selectValue = useMemo(() => {
|
|
52
|
+
if (!treeCheckable) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
if (showCheckedStrategy === TntdVirtualTreeSelect.SHOW_ALL) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
// 过滤掉有子节点,
|
|
60
|
+
return value.filter(i => {
|
|
61
|
+
return filterLastestNode(treeNodeWithParents, i, value);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}, [treeCheckable, treeNodeWithParents, value, showCheckedStrategy]);
|
|
66
|
+
const mergeMode = useMemo(() => {
|
|
67
|
+
if (treeCheckable) {
|
|
68
|
+
return {
|
|
69
|
+
multiple: true,
|
|
70
|
+
mode: 'tags'
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {};
|
|
74
|
+
}, [treeCheckable]);
|
|
75
|
+
const handleRender = _a => {
|
|
76
|
+
var {
|
|
77
|
+
showSearch
|
|
78
|
+
} = _a,
|
|
79
|
+
rest = __rest(_a, ["showSearch"]);
|
|
41
80
|
return React.createElement("div", {
|
|
42
|
-
className:
|
|
43
|
-
}, React.createElement(
|
|
81
|
+
className: "virtual-tree-options"
|
|
82
|
+
}, React.createElement(TntdVirtualTree, Object.assign({}, rest)));
|
|
83
|
+
};
|
|
84
|
+
const handleChange = val => {
|
|
85
|
+
onChange(val);
|
|
86
|
+
};
|
|
87
|
+
const handleSearch = val => {
|
|
88
|
+
setFilterKey(val);
|
|
89
|
+
};
|
|
90
|
+
const handleSelect = val => {
|
|
91
|
+
var _a;
|
|
92
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(val);
|
|
93
|
+
if (selectRef.current) {
|
|
94
|
+
// 主动触发下拉框消失
|
|
95
|
+
(_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
96
|
+
}
|
|
44
97
|
};
|
|
45
|
-
return React.createElement(RcSelect, Object.assign({
|
|
98
|
+
return React.createElement(RcSelect, Object.assign({
|
|
99
|
+
ref: selectRef,
|
|
100
|
+
value: selectValue,
|
|
101
|
+
onChange: handleChange,
|
|
102
|
+
showSearch: showSearch,
|
|
103
|
+
onSearch: handleSearch
|
|
104
|
+
}, mergeMode, restProps, {
|
|
46
105
|
dropdownMatchSelectWidth: mergeDropdownMatchSelectWidth,
|
|
47
106
|
dropdownStyle: Object.assign({
|
|
48
107
|
maxHeight: '100vh',
|
|
49
108
|
overflow: 'auto'
|
|
50
109
|
}, mergeDropdownStyle),
|
|
51
|
-
dropdownRender: () =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
110
|
+
dropdownRender: () => {
|
|
111
|
+
let obj = {
|
|
112
|
+
treeData,
|
|
113
|
+
filterKey,
|
|
114
|
+
defaultExpandAll: treeDefaultExpandAll,
|
|
115
|
+
expandedKeys: treeExpandedKeys,
|
|
116
|
+
fieldNames,
|
|
117
|
+
onExpand: onTreeExpand,
|
|
118
|
+
titleRender: treeTitleRender,
|
|
119
|
+
onSelect: handleSelect
|
|
120
|
+
};
|
|
121
|
+
if (treeCheckable) {
|
|
122
|
+
obj = Object.assign(Object.assign({}, obj), {
|
|
123
|
+
checkedKeys: value,
|
|
124
|
+
checkStrictly: treeCheckStrictly,
|
|
125
|
+
checkable: treeCheckable,
|
|
126
|
+
onCheck: onTreeCheck
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
obj = Object.assign(Object.assign({}, obj), {
|
|
130
|
+
value
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return handleRender(obj);
|
|
134
|
+
}
|
|
61
135
|
}));
|
|
62
136
|
};
|
|
137
|
+
TntdVirtualTreeSelect.SHOW_CHILD = 'SHOW_CHILD';
|
|
138
|
+
TntdVirtualTreeSelect.SHOW_ALL = 'SHOW_ALL';
|
|
63
139
|
export default TntdVirtualTreeSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/index.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/index.jsx"],"names":[],"mappings":"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","sourcesContent":["/*\n * @Descripttion: 用select包裹虚拟树\n * @Author: 郑泳健\n * @Date: 2024-08-05 10:50:17\n * @LastEditors: 郑泳健\n * @LastEditTime: 2024-08-20 15:03:16\n */\nimport React, { useState, useRef, useMemo } from 'react';\nimport RcSelect from '../tntd-rc-select';\nimport TntdVirtualTree from '../tntd-virtual-tree';\nimport { filterLastestNode, flatWithParents } from './utils.js'\nimport './index.less';\n\nconst TntdVirtualTreeSelect = ({\n value,\n onChange,\n treeData,\n showSearch,\n fieldNames,\n dropdownMatchSelectWidth,\n dropdownStyle,\n showCheckedStrategy,\n treeCheckable,\n treeCheckStrictly,\n treeDefaultExpandAll,\n treeExpandedKeys,\n onTreeCheck,\n onTreeExpand,\n treeTitleRender,\n ...restProps\n}) => {\n const selectRef = useRef(null);\n const [filterKey, setFilterKey] = useState(undefined);\n\n const mergeDropdownStyle = useMemo(() => {\n return Array.isArray(treeData) && treeData.length ? dropdownStyle : {};\n }, [dropdownStyle, treeData]);\n\n const mergeDropdownMatchSelectWidth = useMemo(() => {\n return Array.isArray(treeData) && treeData.length ? dropdownMatchSelectWidth : true;\n }, [dropdownMatchSelectWidth, treeData]);\n\n const treeNodeWithParents = useMemo(() => {\n return flatWithParents(treeData, fieldNames)\n }, [treeData, fieldNames])\n\n const selectValue = useMemo(() => {\n if(!treeCheckable) {\n return value\n }\n\n if(Array.isArray(value)) {\n if(showCheckedStrategy === TntdVirtualTreeSelect.SHOW_ALL) {\n return value;\n }\n // 过滤掉有子节点,\n return value.filter(i => {\n return filterLastestNode(treeNodeWithParents, i, value)\n })\n }\n return undefined\n\n }, [treeCheckable, treeNodeWithParents, value, showCheckedStrategy])\n\n const mergeMode = useMemo(() => {\n if(treeCheckable) {\n return {\n multiple: true,\n mode: 'tags'\n }\n }\n return {}\n }, [treeCheckable])\n\n const handleRender = ({ showSearch, ...rest }) => {\n return (\n <div className=\"virtual-tree-options\">\n <TntdVirtualTree {...rest} />\n </div>\n );\n };\n\n const handleChange = (val) => {\n onChange(val);\n };\n\n const handleSearch = (val) => {\n setFilterKey(val);\n };\n\n const handleSelect = (val) => {\n onChange?.(val);\n if (selectRef.current) {\n // 主动触发下拉框消失\n selectRef.current?.blur();\n }\n };\n\n return (\n <RcSelect\n ref={selectRef}\n value={selectValue}\n onChange={handleChange}\n showSearch={showSearch}\n onSearch={handleSearch}\n {...mergeMode}\n {...restProps}\n dropdownMatchSelectWidth={mergeDropdownMatchSelectWidth}\n dropdownStyle={{ maxHeight: '100vh', overflow: 'auto', ...mergeDropdownStyle }}\n dropdownRender={() => {\n let obj = {\n treeData,\n filterKey,\n defaultExpandAll: treeDefaultExpandAll,\n expandedKeys: treeExpandedKeys,\n fieldNames,\n onExpand: onTreeExpand,\n titleRender: treeTitleRender,\n onSelect: handleSelect\n };\n if (treeCheckable) {\n obj = { ...obj, checkedKeys: value, checkStrictly: treeCheckStrictly, checkable: treeCheckable, onCheck: onTreeCheck };\n } else {\n obj = { ...obj, value };\n }\n return handleRender(obj);\n }}\n />\n );\n};\n\nTntdVirtualTreeSelect.SHOW_CHILD = 'SHOW_CHILD'\nTntdVirtualTreeSelect.SHOW_ALL = 'SHOW_ALL'\n\nexport default TntdVirtualTreeSelect;\n"]}
|
|
@@ -1,135 +1,31 @@
|
|
|
1
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
-
}
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
1
|
/**
|
|
10
|
-
*
|
|
11
|
-
* 用于判断后续展开/收起
|
|
2
|
+
* 给每个节点增加一个parent字段,记录其父节点用于showCheckedStrategy
|
|
12
3
|
* @param {*} treeData
|
|
4
|
+
* @param {*} fieldNames
|
|
5
|
+
* @param {*} parents
|
|
6
|
+
* @returns
|
|
13
7
|
*/
|
|
14
|
-
export const
|
|
8
|
+
export const flatWithParents = (treeData, fieldNames = {
|
|
15
9
|
title: 'title',
|
|
16
10
|
value: 'value',
|
|
17
|
-
children: 'children'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return treeData.map(item => {
|
|
21
|
-
item.children = item[fieldNames['children']];
|
|
22
|
-
item.title = item[fieldNames['title']];
|
|
23
|
-
item.value = item[fieldNames['value']];
|
|
24
|
-
const {
|
|
25
|
-
children
|
|
26
|
-
} = item,
|
|
27
|
-
query = __rest(item, ["children"]);
|
|
28
|
-
if (Array.isArray(children) && !!children.length) {
|
|
29
|
-
query.children = addTreeNodeKeys(children, fieldNames);
|
|
30
|
-
}
|
|
31
|
-
return Object.assign(Object.assign({}, query), {
|
|
32
|
-
title: query[fieldNames['title']],
|
|
33
|
-
value: query[fieldNames['value']],
|
|
34
|
-
keys: getNodeKeys(query),
|
|
35
|
-
titleTotal: getNodeStr(query, fieldNames['title'])
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return [];
|
|
40
|
-
};
|
|
41
|
-
export const getNodeStr = (node, key, result = []) => {
|
|
42
|
-
result.push(node[key]);
|
|
43
|
-
if (Array.isArray(node.children) && !!node.children.length) {
|
|
44
|
-
node.children.forEach(element => {
|
|
45
|
-
result = [...result, ...getNodeStr(element, key)];
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* 获取每个节点下面所有子节点的value值
|
|
52
|
-
* @param {*} node
|
|
53
|
-
* @param {*} widthSelf 是否包含自己
|
|
54
|
-
* @param {*} result
|
|
55
|
-
* @returns []
|
|
56
|
-
*/
|
|
57
|
-
export const getNodeKeys = (node, widthSelf = true, result = []) => {
|
|
58
|
-
if (widthSelf) {
|
|
59
|
-
result.push(node.value);
|
|
60
|
-
}
|
|
61
|
-
if (Array.isArray(node.children) && !!node.children.length) {
|
|
62
|
-
node.children.forEach(element => {
|
|
63
|
-
result = [...result, ...getNodeKeys(element)];
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return result;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* 扁平树
|
|
70
|
-
* @param {*} treeData
|
|
71
|
-
* @param {*} expandedKeys 展开的节点
|
|
72
|
-
* @param {*} treeDefaultExpandAll
|
|
73
|
-
* @param {*} level
|
|
74
|
-
* @param {*} result
|
|
75
|
-
* @returns
|
|
76
|
-
*/
|
|
77
|
-
export const flatTreeData = (treeData, filterKey = '', expandedKeys = [], treeDefaultExpandAll = false, level = 0, result = []) => {
|
|
11
|
+
children: 'children',
|
|
12
|
+
disabled: 'disabled'
|
|
13
|
+
}, parents = [], result = {}) => {
|
|
78
14
|
if (Array.isArray(treeData)) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
rest = __rest(i, ["value", "children", "titleTotal", "title"]);
|
|
87
|
-
// 判断是否命中过滤
|
|
88
|
-
let bingo = true;
|
|
89
|
-
const transFilterKey = !['', null, undefined].includes(filterKey);
|
|
90
|
-
if (transFilterKey) {
|
|
91
|
-
bingo = Array.isArray(titleTotal) ? titleTotal.some(i => i.includes(filterKey)) : false;
|
|
92
|
-
}
|
|
93
|
-
if (bingo) {
|
|
94
|
-
result.push({
|
|
95
|
-
value,
|
|
96
|
-
children,
|
|
97
|
-
title,
|
|
98
|
-
level,
|
|
99
|
-
titleTotal
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
const selfIn = Array.isArray(expandedKeys) ? expandedKeys.includes(value) : false;
|
|
103
|
-
if ((treeDefaultExpandAll || selfIn || transFilterKey && bingo) && Array.isArray(children) && !!children.length) {
|
|
104
|
-
result = [...result, ...flatTreeData(children, filterKey, expandedKeys, treeDefaultExpandAll, level + 1)];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
15
|
+
treeData.forEach(i => {
|
|
16
|
+
result[i[fieldNames['value']]] = parents;
|
|
17
|
+
if (Array.isArray(i[fieldNames['children']])) {
|
|
18
|
+
const list = flatWithParents(i[fieldNames['children']], fieldNames, [...parents, i[fieldNames['value']]]);
|
|
19
|
+
result = Object.assign(Object.assign({}, result), list);
|
|
20
|
+
} else {}
|
|
21
|
+
});
|
|
107
22
|
}
|
|
108
23
|
return result;
|
|
109
24
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
* @param {*} result
|
|
115
|
-
* @returns
|
|
116
|
-
*/
|
|
117
|
-
export const getFullExpandedKeys = (treeDataWithKeys, treeExpandedKeys = [], treeDefaultExpandAll, result = []) => {
|
|
118
|
-
if (!treeDefaultExpandAll && (!Array.isArray(treeDataWithKeys) || !treeDataWithKeys.length || !Array.isArray(treeExpandedKeys) || !treeExpandedKeys.length)) {
|
|
119
|
-
return [];
|
|
25
|
+
export const filterLastestNode = (treeNodeWithParents, item, list) => {
|
|
26
|
+
const parents = treeNodeWithParents[item] || {};
|
|
27
|
+
if (Array.isArray(parents) && !!parents.length && Array.isArray(list) && !!list.length) {
|
|
28
|
+
return parents.every(el => !list.includes(el));
|
|
120
29
|
}
|
|
121
|
-
|
|
122
|
-
const {
|
|
123
|
-
keys,
|
|
124
|
-
value,
|
|
125
|
-
children
|
|
126
|
-
} = i;
|
|
127
|
-
if (treeDefaultExpandAll || Array.isArray(keys) && keys.some(el => treeExpandedKeys.includes(el))) {
|
|
128
|
-
result.push(value);
|
|
129
|
-
if (Array.isArray(children) && !!children.length) {
|
|
130
|
-
result = [...result, ...getFullExpandedKeys(children, treeExpandedKeys, treeDefaultExpandAll)];
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
return result;
|
|
30
|
+
return false;
|
|
135
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tntd-virtual-tree-select/utils.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE;IAClK,IAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC1B,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACnB,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;YACzC,IAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,EAAC;gBAC1C,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;gBACzG,MAAM,mCAAO,MAAM,GAAK,IAAI,CAAC,CAAA;aAC9B;iBAAI;aAEJ;QACH,CAAC,CAAC,CAAA;KACH;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IACnE,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAE/C,IAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;QACrF,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;KAC/C;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["/**\n * 给每个节点增加一个parent字段,记录其父节点用于showCheckedStrategy\n * @param {*} treeData \n * @param {*} fieldNames \n * @param {*} parents \n * @returns \n */\nexport const flatWithParents = (treeData, fieldNames = { title: 'title', value: 'value', children: 'children', disabled: 'disabled' }, parents = [], result = {}) => {\n if(Array.isArray(treeData)) {\n treeData.forEach(i => {\n result[i[fieldNames['value']]] = parents;\n if(Array.isArray(i[fieldNames['children']])){\n const list = flatWithParents(i[fieldNames['children']], fieldNames, [...parents, i[fieldNames['value']]])\n result = {...result, ...list}\n }else{\n \n }\n })\n }\n return result\n}\n\nexport const filterLastestNode = (treeNodeWithParents, item, list) => {\n const parents = treeNodeWithParents[item] || {}\n \n if(Array.isArray(parents) && !!parents.length && Array.isArray(list) && !!list.length) {\n return parents.every(el => !list.includes(el))\n }\n\n return false\n}\n\n"]}
|
package/lib/_util/context.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultIconPrefixCls = exports.ConfigContext = exports.ConfigConsumer = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
9
|
var defaultGetPrefixCls = function defaultGetPrefixCls(suffixCls, customizePrefixCls) {
|
|
10
10
|
if (customizePrefixCls) return customizePrefixCls;
|
|
11
11
|
return "tnt-".concat(suffixCls);
|
|
@@ -8,7 +8,7 @@ exports["default"] = void 0;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _context = require("./context");
|
|
10
10
|
var _LocaleReceiver = _interopRequireDefault(require("antd/lib/locale-provider/LocaleReceiver"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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
14
|
/*
|
|
@@ -9,12 +9,12 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _styleChecker = require("../styleChecker");
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
|
-
function _slicedToArray(
|
|
12
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
13
13
|
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."); }
|
|
14
|
-
function _unsupportedIterableToArray(
|
|
15
|
-
function _arrayLikeToArray(
|
|
14
|
+
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; } }
|
|
15
|
+
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; }
|
|
16
16
|
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; } }
|
|
17
|
-
function _arrayWithHoles(
|
|
17
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
18
|
var _default = exports["default"] = function _default() {
|
|
19
19
|
var _React$useState = React.useState(false),
|
|
20
20
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8,12 +8,12 @@ exports["default"] = useForceUpdate;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
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); }
|
|
10
10
|
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; }
|
|
11
|
-
function _slicedToArray(
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
12
|
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."); }
|
|
13
|
-
function _unsupportedIterableToArray(
|
|
14
|
-
function _arrayLikeToArray(
|
|
13
|
+
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; } }
|
|
14
|
+
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; }
|
|
15
15
|
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; } }
|
|
16
|
-
function _arrayWithHoles(
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
17
|
function useForceUpdate() {
|
|
18
18
|
var _React$useReducer = React.useReducer(function (x) {
|
|
19
19
|
return x + 1;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.responsiveMap = exports.responsiveArray = exports["default"] = void 0;
|
|
7
7
|
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); }
|
|
8
|
-
function _defineProperty(
|
|
8
|
+
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; }
|
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
10
|
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); }
|
|
11
11
|
var responsiveArray = exports.responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "isStyleSupport", {
|
|
|
12
12
|
});
|
|
13
13
|
var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom"));
|
|
14
14
|
var _styleChecker = require("rc-util/lib/Dom/styleChecker");
|
|
15
|
-
function _interopRequireDefault(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
16
|
var canUseDocElement = exports.canUseDocElement = function canUseDocElement() {
|
|
17
17
|
return (0, _canUseDom["default"])() && window.document.documentElement;
|
|
18
18
|
};
|
package/lib/actions/index.js
CHANGED
|
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
require("./index.less");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
var ProCardActions = function ProCardActions(props) {
|
|
12
12
|
var actions = props.actions,
|
|
13
13
|
prefixCls = props.prefixCls;
|
package/lib/alert/alert.js
CHANGED
|
@@ -23,11 +23,11 @@ Object.keys(_alert).forEach(function (key) {
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
26
|
-
function _interopRequireDefault(
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
27
27
|
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); }
|
|
28
28
|
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; }
|
|
29
29
|
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); }
|
|
30
|
-
function _defineProperty(
|
|
30
|
+
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; }
|
|
31
31
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
32
32
|
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); }
|
|
33
33
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
package/lib/alert/index.js
CHANGED
|
@@ -19,5 +19,5 @@ Object.keys(_alert2).forEach(function (key) {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
function _interopRequireDefault(
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
23
23
|
var _default = exports["default"] = _alert["default"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array-input/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array-input/index.js"],"names":[],"mappings":"AAsUA,sEAQC"}
|
package/lib/array-input/index.js
CHANGED
|
@@ -26,20 +26,20 @@ var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
|
26
26
|
require("./index.less");
|
|
27
27
|
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); }
|
|
28
28
|
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; }
|
|
29
|
-
function _interopRequireDefault(
|
|
30
|
-
function _toConsumableArray(
|
|
29
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
30
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
31
31
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
-
function _iterableToArray(
|
|
33
|
-
function _arrayWithoutHoles(
|
|
34
|
-
function _defineProperty(
|
|
32
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
33
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
34
|
+
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; }
|
|
35
35
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
36
36
|
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); }
|
|
37
|
-
function _slicedToArray(
|
|
37
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
38
38
|
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."); }
|
|
39
|
-
function _unsupportedIterableToArray(
|
|
40
|
-
function _arrayLikeToArray(
|
|
39
|
+
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; } }
|
|
40
|
+
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; }
|
|
41
41
|
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; } }
|
|
42
|
-
function _arrayWithHoles(
|
|
42
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
43
43
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
44
44
|
var t = {};
|
|
45
45
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -130,7 +130,20 @@ function ArrayInput(_ref) {
|
|
|
130
130
|
_value = _useState2[0],
|
|
131
131
|
setValue = _useState2[1];
|
|
132
132
|
(0, _react.useEffect)(function () {
|
|
133
|
-
|
|
133
|
+
var newValue = value;
|
|
134
|
+
// 如果数组没有key
|
|
135
|
+
if (Array.isArray(value) && value.some(function (obj) {
|
|
136
|
+
return !obj.key;
|
|
137
|
+
})) {
|
|
138
|
+
newValue = value.map(function (obj) {
|
|
139
|
+
return Object.assign(Object.assign({}, obj), {
|
|
140
|
+
key: obj.key || key++
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
_onChange(newValue);
|
|
144
|
+
} else {
|
|
145
|
+
setValue(newValue);
|
|
146
|
+
}
|
|
134
147
|
}, [value]);
|
|
135
148
|
var _onChange = (0, _react.useCallback)(function (value) {
|
|
136
149
|
if (onChange) {
|