@vtx/components 4.0.0-beta.4 → 4.0.0-beta.40
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/index.js +76 -0
- package/es/utils/columnSort.js +23 -0
- package/es/utils/components/DropdownFooter/index.js +53 -0
- package/es/utils/components/DropdownFooter/style.js +25 -0
- package/es/utils/components/ErrorBoundary/index.js +53 -0
- package/es/utils/components/FieldLabel/index.js +144 -0
- package/es/utils/components/FieldLabel/style.js +93 -0
- package/es/utils/components/FilterDropdown/index.js +62 -0
- package/es/utils/components/FilterDropdown/style.js +26 -0
- package/es/utils/components/InlineErrorFormItem/index.js +156 -0
- package/es/utils/components/InlineErrorFormItem/style.js +47 -0
- package/es/utils/components/LabelIconTip/index.js +68 -0
- package/es/utils/components/LabelIconTip/style.js +47 -0
- package/es/utils/components/ProFormContext/index.js +41 -0
- package/es/utils/conversionMomentValue/index.js +163 -0
- package/es/utils/dateArrayFormatter/index.js +36 -0
- package/es/utils/filterSpecialCharacters.js +83 -0
- package/es/utils/genColumnKey.js +6 -0
- package/es/utils/genCopyable/index.js +59 -0
- package/es/utils/getComponentProps.js +7 -0
- package/es/utils/getFieldPropsOrFormItemProps/index.js +16 -0
- package/es/utils/getPlaceholder.js +5 -0
- package/es/utils/getToken.js +6 -0
- package/es/utils/hooks/useDebounceFn/index.js +71 -0
- package/es/utils/hooks/useDebounceValue/index.js +40 -0
- package/es/utils/hooks/useDeepCompareEffect/index.js +24 -0
- package/es/utils/hooks/useDeepCompareMemo/index.js +15 -0
- package/es/utils/hooks/useDocumentTitle/index.js +10 -0
- package/es/utils/hooks/useForceRender/index.js +18 -0
- package/es/utils/hooks/useLatest/index.js +10 -0
- package/es/utils/hooks/usePrevious/index.js +8 -0
- package/es/utils/hooks/useReactiveRef/index.js +7 -0
- package/es/utils/hooks/useRefCallback/index.js +26 -0
- package/es/utils/hooks/useRefFunction/index.js +13 -0
- package/es/utils/index.js +72 -0
- package/es/utils/isBrowser/index.d.ts +9 -0
- package/es/utils/isBrowser/index.js +16 -0
- package/es/utils/isDeepEqualReact/index.js +95 -0
- package/es/utils/isDropdownValueType/index.js +7 -0
- package/es/utils/isFunction.js +3 -0
- package/es/utils/isImg/index.js +4 -0
- package/es/utils/isNil/index.js +3 -0
- package/es/utils/isObject/index.js +3 -0
- package/es/utils/isObject.js +3 -0
- package/es/utils/isUrl/index.js +17 -0
- package/es/utils/merge/index.js +36 -0
- package/es/utils/nanoid/index.js +29 -0
- package/es/utils/omitBoolean/index.js +11 -0
- package/es/utils/omitUndefined/index.js +12 -0
- package/es/utils/omitUndefinedAndEmptyArr/index.js +14 -0
- package/es/utils/parseValueToMoment/index.js +28 -0
- package/es/utils/pickProFormItemProps/index.js +15 -0
- package/es/utils/pickProProps/index.js +15 -0
- package/es/utils/proFieldParsingText/index.js +161 -0
- package/es/utils/runFunction/index.js +10 -0
- package/es/utils/sortByGivenOrder.js +36 -0
- package/es/utils/sortByKeyArrayExtract.js +38 -0
- package/es/utils/stringify/index.js +10 -0
- package/es/utils/transformKeySubmitValue/index.js +330 -0
- package/es/utils/useColSize.js +20 -0
- package/es/utils/useEditableArray/index.js +906 -0
- package/es/utils/useEditableMap/index.js +214 -0
- package/es/utils/useInterval.js +12 -0
- package/es/utils/useMediaQuery/index.js +106 -0
- package/es/utils/useMediaQuery/query.js +30 -0
- package/es/utils/useMountMergeState/index.js +2 -0
- package/es/utils/useSet.js +38 -0
- package/es/version.js +3 -0
- package/es/vtx-color-picker/index.js +175 -0
- package/es/vtx-color-picker/style/index.js +54 -0
- package/es/vtx-combogrid/Combogrid.js +252 -0
- package/es/vtx-combogrid/index.js +121 -0
- package/es/vtx-combogrid/style/index.js +42 -0
- package/es/vtx-datagrid/Alert/index.js +49 -0
- package/es/vtx-datagrid/Alert/style.js +44 -0
- package/es/vtx-datagrid/Store/Provide.js +493 -0
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +531 -0
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +86 -0
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +53 -0
- package/es/vtx-datagrid/ToolBar/components/Fullscreen/index.js +77 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +74 -0
- package/es/vtx-datagrid/ToolBar/index.js +88 -0
- package/es/vtx-datagrid/ToolBar/style.js +59 -0
- package/es/vtx-datagrid/index.js +434 -0
- package/es/vtx-datagrid/renderColumnButtons.js +117 -0
- package/es/vtx-datagrid/style/index.js +142 -0
- package/es/vtx-datagrid/style/index.less +242 -0
- package/es/vtx-date-picker/QdatePicker.js +152 -0
- package/es/vtx-date-picker/generatePicker.js +104 -0
- package/es/vtx-date-picker/index.js +49 -0
- package/es/vtx-date-picker/style/index.js +39 -0
- package/es/vtx-date-picker/style/index.less +39 -0
- package/es/vtx-descriptions/Descriptions.js +30 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +57 -0
- package/es/vtx-ellipsis-text/style/index.js +31 -0
- package/es/vtx-export/index.js +196 -0
- package/es/vtx-export/style/index.js +24 -0
- package/es/vtx-export-async/ColumnsSelect.js +63 -0
- package/es/vtx-export-async/History.js +260 -0
- package/es/vtx-export-async/index.js +429 -0
- package/es/vtx-export-async/style/index.js +49 -0
- package/es/vtx-export-async/util.js +51 -0
- package/es/vtx-form-layout/Card.js +74 -0
- package/es/vtx-form-layout/Divider.js +22 -0
- package/es/vtx-form-layout/FormItem.js +136 -0
- package/es/vtx-form-layout/Pane.js +52 -0
- package/es/vtx-form-layout/Row.js +19 -0
- package/es/vtx-form-layout/context.js +2 -0
- package/es/vtx-form-layout/index.js +80 -0
- package/es/vtx-form-layout/style/index.js +261 -0
- package/es/vtx-icon/index.js +115 -0
- package/es/vtx-icon/svg/alignRightOutlined.js +29 -0
- package/es/vtx-icon/svg/columnHeightOutlined.js +25 -0
- package/es/vtx-icon/svg/downOutlined.js +24 -0
- package/es/vtx-icon/svg/fullscreen.js +25 -0
- package/es/vtx-icon/svg/redoOutlined.js +29 -0
- package/es/vtx-icon/svg/rightOutlined.js +24 -0
- package/es/vtx-icon/svg/settingOutlined.js +29 -0
- package/es/vtx-image/Image.js +257 -0
- package/es/vtx-image/Preview.js +145 -0
- package/es/vtx-image/PreviewGroup.js +81 -0
- package/es/vtx-image/index.js +4 -0
- package/es/vtx-image/style/index.js +91 -0
- package/es/vtx-import/index.js +460 -0
- package/es/vtx-import/result.js +85 -0
- package/es/vtx-import/style/index.js +29 -0
- package/es/vtx-import2/CheckResult.js +45 -0
- package/es/vtx-import2/Content.js +104 -0
- package/es/vtx-import2/DownloadSvg.js +41 -0
- package/es/vtx-import2/ImportResult.js +57 -0
- package/es/vtx-import2/UploadSvg.js +41 -0
- package/es/vtx-import2/index.js +462 -0
- package/es/vtx-import2/style/index.js +151 -0
- package/es/vtx-input/TextArea/index.js +66 -0
- package/es/vtx-input/TextArea/style.js +30 -0
- package/es/vtx-input/index.js +92 -0
- package/es/vtx-input/style/index.js +24 -0
- package/es/vtx-input/useLength.js +21 -0
- package/es/vtx-modal/Title.js +34 -0
- package/es/vtx-modal/index.js +246 -0
- package/es/vtx-modal/style/index.js +111 -0
- package/es/vtx-page-layout/Basic.js +28 -0
- package/es/vtx-page-layout/Content.js +43 -0
- package/es/vtx-page-layout/Pane.js +40 -0
- package/es/vtx-page-layout/TabLayout.js +59 -0
- package/es/vtx-page-layout/TableLayout.js +173 -0
- package/es/vtx-page-layout/TableWrap.js +37 -0
- package/es/vtx-page-layout/TreeLayout.js +73 -0
- package/es/vtx-page-layout/container.js +69 -0
- package/es/vtx-page-layout/index.js +26 -0
- package/es/vtx-page-layout/style/index.js +129 -0
- package/es/vtx-provider/index.js +324 -0
- package/es/vtx-provider/intl.js +140 -0
- package/es/vtx-provider/locale/ar_EG.js +71 -0
- package/es/vtx-provider/locale/ca_ES.js +71 -0
- package/es/vtx-provider/locale/cs_CZ.js +74 -0
- package/es/vtx-provider/locale/de_DE.js +71 -0
- package/es/vtx-provider/locale/en_GB.js +73 -0
- package/es/vtx-provider/locale/en_US.js +189 -0
- package/es/vtx-provider/locale/es_ES.js +71 -0
- package/es/vtx-provider/locale/fa_IR.js +71 -0
- package/es/vtx-provider/locale/fr_FR.js +71 -0
- package/es/vtx-provider/locale/he_IL.js +74 -0
- package/es/vtx-provider/locale/hr_HR.js +71 -0
- package/es/vtx-provider/locale/id_ID.js +71 -0
- package/es/vtx-provider/locale/it_IT.js +71 -0
- package/es/vtx-provider/locale/ja_JP.js +71 -0
- package/es/vtx-provider/locale/ko_KR.js +71 -0
- package/es/vtx-provider/locale/mn_MN.js +71 -0
- package/es/vtx-provider/locale/ms_MY.js +71 -0
- package/es/vtx-provider/locale/nl_NL.js +74 -0
- package/es/vtx-provider/locale/pl_PL.js +71 -0
- package/es/vtx-provider/locale/pt_BR.js +71 -0
- package/es/vtx-provider/locale/ro_RO.js +74 -0
- package/es/vtx-provider/locale/ru_RU.js +71 -0
- package/es/vtx-provider/locale/sk_SK.js +74 -0
- package/es/vtx-provider/locale/sr_RS.js +71 -0
- package/es/vtx-provider/locale/sv_SE.js +74 -0
- package/es/vtx-provider/locale/th_TH.js +74 -0
- package/es/vtx-provider/locale/tr_TR.js +71 -0
- package/es/vtx-provider/locale/uk_UA.js +74 -0
- package/es/vtx-provider/locale/uz_UZ.js +71 -0
- package/es/vtx-provider/locale/vi_VN.js +71 -0
- package/es/vtx-provider/locale/zh_CN.js +201 -0
- package/es/vtx-provider/locale/zh_HK.js +83 -0
- package/es/vtx-provider/locale/zh_TW.js +74 -0
- package/es/vtx-provider/typing/layoutToken.js +60 -0
- package/es/vtx-provider/useStyle/index.js +110 -0
- package/es/vtx-provider/utils/merge.js +27 -0
- package/es/vtx-rps-frame/index.js +164 -0
- package/es/vtx-rps-frame/style/index.js +26 -0
- package/es/vtx-scrollable-row/index.js +193 -0
- package/es/vtx-scrollable-row/style/index.js +108 -0
- package/es/vtx-search/index.js +354 -0
- package/es/vtx-search/style/index.js +95 -0
- package/es/vtx-select/index.js +264 -0
- package/es/vtx-select/style/index.js +31 -0
- package/es/vtx-signature/index.js +120 -0
- package/es/vtx-signature/style/index.js +47 -0
- package/es/vtx-split-pane/Resizer.js +47 -0
- package/es/vtx-split-pane/SplitPane.js +70 -0
- package/es/vtx-split-pane/index.js +3 -0
- package/es/vtx-split-pane/style/index.js +29 -0
- package/es/vtx-statistics-column/Back.js +27 -0
- package/es/vtx-statistics-column/Item.js +54 -0
- package/es/vtx-statistics-column/Total.js +54 -0
- package/es/vtx-statistics-column/context.js +2 -0
- package/es/vtx-statistics-column/index.js +54 -0
- package/es/vtx-statistics-column/style/index.js +72 -0
- package/es/vtx-time-picker/index.js +63 -0
- package/es/vtx-time-picker/style/index.js +0 -0
- package/es/vtx-transfer/Transfer.js +30 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +405 -0
- package/es/vtx-tree/style/index.js +50 -0
- package/es/vtx-tree/utils.js +73 -0
- package/es/vtx-tree-select/index.js +258 -0
- package/es/vtx-tree-select/style/index.js +79 -0
- package/es/vtx-upload/FilePreview.js +112 -0
- package/es/vtx-upload/index.js +468 -0
- package/es/vtx-upload/style/index.js +83 -0
- package/es/vtx-wang-editor/index.js +421 -0
- package/es/vtx-wang-editor/style/index.js +33 -0
- package/es/vtx-wang-editor/style/index.less +12 -0
- package/es/vtx-wang-editor/wangEditorUtil.js +276 -0
- package/lib/index.js +399 -0
- package/lib/utils/columnSort.js +29 -0
- package/lib/utils/components/DropdownFooter/index.js +62 -0
- package/lib/utils/components/DropdownFooter/style.js +31 -0
- package/lib/utils/components/ErrorBoundary/index.js +59 -0
- package/lib/utils/components/FieldLabel/index.js +152 -0
- package/lib/utils/components/FieldLabel/style.js +99 -0
- package/lib/utils/components/FilterDropdown/index.js +70 -0
- package/lib/utils/components/FilterDropdown/style.js +32 -0
- package/lib/utils/components/InlineErrorFormItem/index.js +162 -0
- package/lib/utils/components/InlineErrorFormItem/style.js +53 -0
- package/lib/utils/components/LabelIconTip/index.js +73 -0
- package/lib/utils/components/LabelIconTip/style.js +53 -0
- package/lib/utils/components/ProFormContext/index.js +48 -0
- package/lib/utils/conversionMomentValue/index.js +170 -0
- package/lib/utils/dateArrayFormatter/index.js +43 -0
- package/lib/utils/filterSpecialCharacters.js +91 -0
- package/lib/utils/genColumnKey.js +12 -0
- package/lib/utils/genCopyable/index.js +66 -0
- package/lib/utils/getComponentProps.js +13 -0
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +21 -0
- package/lib/utils/getPlaceholder.js +11 -0
- package/lib/utils/getToken.js +12 -0
- package/lib/utils/hooks/useDebounceFn/index.js +77 -0
- package/lib/utils/hooks/useDebounceValue/index.js +45 -0
- package/lib/utils/hooks/useDeepCompareEffect/index.js +33 -0
- package/lib/utils/hooks/useDeepCompareMemo/index.js +21 -0
- package/lib/utils/hooks/useDocumentTitle/index.js +16 -0
- package/lib/utils/hooks/useForceRender/index.js +24 -0
- package/lib/utils/hooks/useLatest/index.js +15 -0
- package/lib/utils/hooks/usePrevious/index.js +14 -0
- package/lib/utils/hooks/useReactiveRef/index.js +14 -0
- package/lib/utils/hooks/useRefCallback/index.js +31 -0
- package/lib/utils/hooks/useRefFunction/index.js +18 -0
- package/lib/utils/index.js +429 -0
- package/lib/utils/isBrowser/index.d.ts +9 -0
- package/lib/utils/isBrowser/index.js +22 -0
- package/lib/utils/isDeepEqualReact/index.js +101 -0
- package/lib/utils/isDropdownValueType/index.js +13 -0
- package/lib/utils/isFunction.js +9 -0
- package/lib/utils/isImg/index.js +10 -0
- package/lib/utils/isNil/index.js +9 -0
- package/lib/utils/isObject/index.js +9 -0
- package/lib/utils/isObject.js +9 -0
- package/lib/utils/isUrl/index.js +23 -0
- package/lib/utils/merge/index.js +41 -0
- package/lib/utils/nanoid/index.js +35 -0
- package/lib/utils/omitBoolean/index.js +17 -0
- package/lib/utils/omitUndefined/index.js +18 -0
- package/lib/utils/omitUndefinedAndEmptyArr/index.js +20 -0
- package/lib/utils/parseValueToMoment/index.js +35 -0
- package/lib/utils/pickProFormItemProps/index.js +21 -0
- package/lib/utils/pickProProps/index.js +21 -0
- package/lib/utils/proFieldParsingText/index.js +166 -0
- package/lib/utils/runFunction/index.js +16 -0
- package/lib/utils/sortByGivenOrder.js +42 -0
- package/lib/utils/sortByKeyArrayExtract.js +44 -0
- package/lib/utils/stringify/index.js +21 -0
- package/lib/utils/transformKeySubmitValue/index.js +337 -0
- package/lib/utils/useColSize.js +26 -0
- package/lib/utils/useEditableArray/index.js +918 -0
- package/lib/utils/useEditableMap/index.js +219 -0
- package/lib/utils/useInterval.js +18 -0
- package/lib/utils/useMediaQuery/index.js +112 -0
- package/lib/utils/useMediaQuery/query.js +36 -0
- package/lib/utils/useMountMergeState/index.js +12 -0
- package/lib/utils/useSet.js +43 -0
- package/lib/version.js +9 -0
- package/lib/vtx-color-picker/index.js +182 -0
- package/lib/vtx-color-picker/style/index.js +60 -0
- package/lib/vtx-combogrid/Combogrid.js +260 -0
- package/lib/vtx-combogrid/index.js +129 -0
- package/lib/vtx-combogrid/style/index.js +48 -0
- package/lib/vtx-datagrid/Alert/index.js +57 -0
- package/lib/vtx-datagrid/Alert/style.js +50 -0
- package/lib/vtx-datagrid/Store/Provide.js +499 -0
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +535 -0
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +92 -0
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +59 -0
- package/lib/vtx-datagrid/ToolBar/components/Fullscreen/index.js +83 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +80 -0
- package/lib/vtx-datagrid/ToolBar/index.js +96 -0
- package/lib/vtx-datagrid/ToolBar/style.js +65 -0
- package/lib/vtx-datagrid/index.js +443 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +123 -0
- package/lib/vtx-datagrid/style/index.js +148 -0
- package/lib/vtx-datagrid/style/index.less +242 -0
- package/lib/vtx-date-picker/QdatePicker.js +157 -0
- package/lib/vtx-date-picker/generatePicker.js +111 -0
- package/lib/vtx-date-picker/index.js +55 -0
- package/lib/vtx-date-picker/style/index.js +45 -0
- package/lib/vtx-date-picker/style/index.less +39 -0
- package/lib/vtx-descriptions/Descriptions.js +39 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +65 -0
- package/lib/vtx-ellipsis-text/style/index.js +37 -0
- package/lib/vtx-export/index.js +202 -0
- package/lib/vtx-export/style/index.js +30 -0
- package/lib/vtx-export-async/ColumnsSelect.js +69 -0
- package/lib/vtx-export-async/History.js +268 -0
- package/lib/vtx-export-async/index.js +436 -0
- package/lib/vtx-export-async/style/index.js +55 -0
- package/lib/vtx-export-async/util.js +57 -0
- package/lib/vtx-form-layout/Card.js +83 -0
- package/lib/vtx-form-layout/Divider.js +31 -0
- package/lib/vtx-form-layout/FormItem.js +142 -0
- package/lib/vtx-form-layout/Pane.js +61 -0
- package/lib/vtx-form-layout/Row.js +26 -0
- package/lib/vtx-form-layout/context.js +8 -0
- package/lib/vtx-form-layout/index.js +89 -0
- package/lib/vtx-form-layout/style/index.js +267 -0
- package/lib/vtx-icon/index.js +135 -0
- package/lib/vtx-icon/svg/alignRightOutlined.js +34 -0
- package/lib/vtx-icon/svg/columnHeightOutlined.js +31 -0
- package/lib/vtx-icon/svg/downOutlined.js +30 -0
- package/lib/vtx-icon/svg/fullscreen.js +31 -0
- package/lib/vtx-icon/svg/redoOutlined.js +34 -0
- package/lib/vtx-icon/svg/rightOutlined.js +30 -0
- package/lib/vtx-icon/svg/settingOutlined.js +34 -0
- package/lib/vtx-image/Image.js +264 -0
- package/lib/vtx-image/Preview.js +151 -0
- package/lib/vtx-image/PreviewGroup.js +91 -0
- package/lib/vtx-image/index.js +31 -0
- package/lib/vtx-image/style/index.js +97 -0
- package/lib/vtx-import/index.js +468 -0
- package/lib/vtx-import/result.js +92 -0
- package/lib/vtx-import/style/index.js +35 -0
- package/lib/vtx-import2/CheckResult.js +50 -0
- package/lib/vtx-import2/Content.js +113 -0
- package/lib/vtx-import2/DownloadSvg.js +47 -0
- package/lib/vtx-import2/ImportResult.js +62 -0
- package/lib/vtx-import2/UploadSvg.js +47 -0
- package/lib/vtx-import2/index.js +467 -0
- package/lib/vtx-import2/style/index.js +157 -0
- package/lib/vtx-input/TextArea/index.js +75 -0
- package/lib/vtx-input/TextArea/style.js +36 -0
- package/lib/vtx-input/index.js +100 -0
- package/lib/vtx-input/style/index.js +30 -0
- package/lib/vtx-input/useLength.js +27 -0
- package/lib/vtx-modal/Title.js +42 -0
- package/lib/vtx-modal/index.js +252 -0
- package/lib/vtx-modal/style/index.js +117 -0
- package/lib/vtx-page-layout/Basic.js +36 -0
- package/lib/vtx-page-layout/Content.js +50 -0
- package/lib/vtx-page-layout/Pane.js +47 -0
- package/lib/vtx-page-layout/TabLayout.js +64 -0
- package/lib/vtx-page-layout/TableLayout.js +182 -0
- package/lib/vtx-page-layout/TableWrap.js +44 -0
- package/lib/vtx-page-layout/TreeLayout.js +78 -0
- package/lib/vtx-page-layout/container.js +75 -0
- package/lib/vtx-page-layout/index.js +32 -0
- package/lib/vtx-page-layout/style/index.js +136 -0
- package/lib/vtx-provider/index.js +359 -0
- package/lib/vtx-provider/intl.js +145 -0
- package/lib/vtx-provider/locale/ar_EG.js +77 -0
- package/lib/vtx-provider/locale/ca_ES.js +77 -0
- package/lib/vtx-provider/locale/cs_CZ.js +80 -0
- package/lib/vtx-provider/locale/de_DE.js +77 -0
- package/lib/vtx-provider/locale/en_GB.js +79 -0
- package/lib/vtx-provider/locale/en_US.js +195 -0
- package/lib/vtx-provider/locale/es_ES.js +77 -0
- package/lib/vtx-provider/locale/fa_IR.js +77 -0
- package/lib/vtx-provider/locale/fr_FR.js +77 -0
- package/lib/vtx-provider/locale/he_IL.js +80 -0
- package/lib/vtx-provider/locale/hr_HR.js +77 -0
- package/lib/vtx-provider/locale/id_ID.js +77 -0
- package/lib/vtx-provider/locale/it_IT.js +77 -0
- package/lib/vtx-provider/locale/ja_JP.js +77 -0
- package/lib/vtx-provider/locale/ko_KR.js +77 -0
- package/lib/vtx-provider/locale/mn_MN.js +77 -0
- package/lib/vtx-provider/locale/ms_MY.js +77 -0
- package/lib/vtx-provider/locale/nl_NL.js +80 -0
- package/lib/vtx-provider/locale/pl_PL.js +77 -0
- package/lib/vtx-provider/locale/pt_BR.js +77 -0
- package/lib/vtx-provider/locale/ro_RO.js +80 -0
- package/lib/vtx-provider/locale/ru_RU.js +77 -0
- package/lib/vtx-provider/locale/sk_SK.js +80 -0
- package/lib/vtx-provider/locale/sr_RS.js +77 -0
- package/lib/vtx-provider/locale/sv_SE.js +80 -0
- package/lib/vtx-provider/locale/th_TH.js +80 -0
- package/lib/vtx-provider/locale/tr_TR.js +77 -0
- package/lib/vtx-provider/locale/uk_UA.js +80 -0
- package/lib/vtx-provider/locale/uz_UZ.js +77 -0
- package/lib/vtx-provider/locale/vi_VN.js +77 -0
- package/lib/vtx-provider/locale/zh_CN.js +207 -0
- package/lib/vtx-provider/locale/zh_HK.js +89 -0
- package/lib/vtx-provider/locale/zh_TW.js +80 -0
- package/lib/vtx-provider/typing/layoutToken.js +66 -0
- package/lib/vtx-provider/useStyle/index.js +116 -0
- package/lib/vtx-provider/utils/merge.js +33 -0
- package/lib/vtx-rps-frame/index.js +173 -0
- package/lib/vtx-rps-frame/style/index.js +32 -0
- package/lib/vtx-scrollable-row/index.js +203 -0
- package/lib/vtx-scrollable-row/style/index.js +114 -0
- package/lib/vtx-search/index.js +359 -0
- package/lib/vtx-search/style/index.js +102 -0
- package/lib/vtx-select/index.js +271 -0
- package/lib/vtx-select/style/index.js +37 -0
- package/lib/vtx-signature/index.js +128 -0
- package/lib/vtx-signature/style/index.js +53 -0
- package/lib/vtx-split-pane/Resizer.js +52 -0
- package/lib/vtx-split-pane/SplitPane.js +78 -0
- package/lib/vtx-split-pane/index.js +15 -0
- package/lib/vtx-split-pane/style/index.js +35 -0
- package/lib/vtx-statistics-column/Back.js +36 -0
- package/lib/vtx-statistics-column/Item.js +62 -0
- package/lib/vtx-statistics-column/Total.js +62 -0
- package/lib/vtx-statistics-column/context.js +8 -0
- package/lib/vtx-statistics-column/index.js +63 -0
- package/lib/vtx-statistics-column/style/index.js +78 -0
- package/lib/vtx-time-picker/index.js +71 -0
- package/lib/vtx-time-picker/style/index.js +1 -0
- package/lib/vtx-transfer/Transfer.js +39 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +412 -0
- package/lib/vtx-tree/style/index.js +56 -0
- package/lib/vtx-tree/utils.js +80 -0
- package/lib/vtx-tree-select/index.js +264 -0
- package/lib/vtx-tree-select/style/index.js +85 -0
- package/lib/vtx-upload/FilePreview.js +117 -0
- package/lib/vtx-upload/index.js +474 -0
- package/lib/vtx-upload/style/index.js +89 -0
- package/lib/vtx-wang-editor/index.js +425 -0
- package/lib/vtx-wang-editor/style/index.js +39 -0
- package/lib/vtx-wang-editor/style/index.less +12 -0
- package/lib/vtx-wang-editor/wangEditorUtil.js +285 -0
- package/package.json +44 -29
|
@@ -0,0 +1,151 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _style = require("./style");
|
|
12
|
+
var _vtxProvider = require("../vtx-provider");
|
|
13
|
+
var _vtxIcon = _interopRequireDefault(require("../vtx-icon"));
|
|
14
|
+
var _vtxDatagrid = _interopRequireDefault(require("../vtx-datagrid"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
var _excluded = ["leftColumns", "rightColumns"],
|
|
17
|
+
_excluded2 = ["popoverProps", "disabled", "leftColumns", "rightColumns", "styles"];
|
|
18
|
+
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); }
|
|
19
|
+
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 && Object.prototype.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; }
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
+
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."); }
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
+
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; } }
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
31
|
+
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); }
|
|
32
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
33
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
34
|
+
var mockTags = ['cat', 'dog', 'bird'];
|
|
35
|
+
var mockData = Array.from({
|
|
36
|
+
length: 20
|
|
37
|
+
}).map(function (_, i) {
|
|
38
|
+
return {
|
|
39
|
+
key: i.toString(),
|
|
40
|
+
title: "content".concat(i + 1),
|
|
41
|
+
description: "description of content".concat(i + 1),
|
|
42
|
+
tag: mockTags[i % 3]
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
var TableTransfer = function TableTransfer(props) {
|
|
46
|
+
var leftColumns = props.leftColumns,
|
|
47
|
+
rightColumns = props.rightColumns,
|
|
48
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Transfer, _objectSpread(_objectSpread({
|
|
50
|
+
style: {
|
|
51
|
+
width: '100%'
|
|
52
|
+
}
|
|
53
|
+
}, restProps), {}, {
|
|
54
|
+
children: function children(_ref) {
|
|
55
|
+
var direction = _ref.direction,
|
|
56
|
+
filteredItems = _ref.filteredItems,
|
|
57
|
+
onItemSelect = _ref.onItemSelect,
|
|
58
|
+
onItemSelectAll = _ref.onItemSelectAll,
|
|
59
|
+
listSelectedKeys = _ref.selectedKeys,
|
|
60
|
+
listDisabled = _ref.disabled;
|
|
61
|
+
var columns = direction === 'left' ? leftColumns : rightColumns;
|
|
62
|
+
var rowSelection = {
|
|
63
|
+
getCheckboxProps: function getCheckboxProps() {
|
|
64
|
+
return {
|
|
65
|
+
disabled: listDisabled
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
onChange: function onChange(selectedRowKeys) {
|
|
69
|
+
onItemSelectAll(selectedRowKeys, 'replace');
|
|
70
|
+
},
|
|
71
|
+
selectedRowKeys: listSelectedKeys,
|
|
72
|
+
selections: [_antd.Table.SELECTION_ALL, _antd.Table.SELECTION_INVERT, _antd.Table.SELECTION_NONE]
|
|
73
|
+
};
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Table, {
|
|
75
|
+
rowSelection: rowSelection,
|
|
76
|
+
columns: columns,
|
|
77
|
+
dataSource: filteredItems,
|
|
78
|
+
size: "small",
|
|
79
|
+
style: {
|
|
80
|
+
pointerEvents: listDisabled ? 'none' : undefined
|
|
81
|
+
},
|
|
82
|
+
onRow: function onRow(_ref2) {
|
|
83
|
+
var key = _ref2.key,
|
|
84
|
+
itemDisabled = _ref2.disabled;
|
|
85
|
+
return {
|
|
86
|
+
onClick: function onClick() {
|
|
87
|
+
if (itemDisabled || listDisabled) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
onItemSelect(key, !listSelectedKeys.includes(key));
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
function TransferSelect(props) {
|
|
99
|
+
var _useState = (0, _react.useState)(function () {
|
|
100
|
+
return [];
|
|
101
|
+
}),
|
|
102
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
103
|
+
selectedRowKeys = _useState2[0],
|
|
104
|
+
setSelectedRowKeys = _useState2[1];
|
|
105
|
+
var _useState3 = (0, _react.useState)([]),
|
|
106
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
107
|
+
targetKeys = _useState4[0],
|
|
108
|
+
setTargetKeys = _useState4[1];
|
|
109
|
+
var onChange = function onChange(nextTargetKeys) {
|
|
110
|
+
setTargetKeys(nextTargetKeys);
|
|
111
|
+
};
|
|
112
|
+
var _useState5 = (0, _react.useState)(false),
|
|
113
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
114
|
+
visible = _useState6[0],
|
|
115
|
+
setVisible = _useState6[1];
|
|
116
|
+
var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
|
|
117
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
118
|
+
var prefixCls = getPrefixCls('VtxTransferSelect', props.prefixCls);
|
|
119
|
+
var _useStyle = (0, _style.useStyle)(prefixCls),
|
|
120
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
121
|
+
hashId = _useStyle.hashId;
|
|
122
|
+
var _props$popoverProps = props.popoverProps,
|
|
123
|
+
popoverProps = _props$popoverProps === void 0 ? {} : _props$popoverProps,
|
|
124
|
+
_props$disabled = props.disabled,
|
|
125
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
126
|
+
leftColumns = props.leftColumns,
|
|
127
|
+
rightColumns = props.rightColumns,
|
|
128
|
+
styles = props.styles,
|
|
129
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
130
|
+
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Select, {
|
|
131
|
+
suffixIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
|
|
132
|
+
type: "downOutlined",
|
|
133
|
+
fileType: "svg"
|
|
134
|
+
}),
|
|
135
|
+
styles: _objectSpread({}, styles),
|
|
136
|
+
popupRender: function popupRender(node) {
|
|
137
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TableTransfer, {
|
|
138
|
+
classNames: {
|
|
139
|
+
root: (0, _classnames.default)(hashId, prefixCls)
|
|
140
|
+
},
|
|
141
|
+
dataSource: mockData,
|
|
142
|
+
onChange: onChange,
|
|
143
|
+
leftColumns: leftColumns,
|
|
144
|
+
rightColumns: rightColumns,
|
|
145
|
+
targetKeys: targetKeys
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
TransferSelect.propTypes = {};
|
|
151
|
+
var _default = exports.default = TransferSelect;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "VtxTransferSelect", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _TransferSelect.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
var _TransferSelect = _interopRequireDefault(require("./TransferSelect"));
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
var _default = exports.default = _TransferSelect.default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useStyle = useStyle;
|
|
7
|
+
var _vtxProvider = require("../../vtx-provider");
|
|
8
|
+
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); }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
var genStyle = function genStyle(token) {
|
|
15
|
+
var componentCls = token.componentCls;
|
|
16
|
+
return _defineProperty({}, componentCls, {});
|
|
17
|
+
};
|
|
18
|
+
function useStyle(prefixCls) {
|
|
19
|
+
return (0, _vtxProvider.useStyle)('', function (token) {
|
|
20
|
+
var _token = _objectSpread(_objectSpread({}, token), {}, {
|
|
21
|
+
componentCls: ".".concat(prefixCls)
|
|
22
|
+
});
|
|
23
|
+
return [genStyle(_token)];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,412 @@
|
|
|
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 = exports.VtxTree = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _icons = require("@ant-design/icons");
|
|
12
|
+
var _utils = require("./utils");
|
|
13
|
+
var _ahooks = require("ahooks");
|
|
14
|
+
var _utils2 = require("@vtx/utils");
|
|
15
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
|
+
var _index = require("./style/index");
|
|
17
|
+
var _vtxProvider = require("../vtx-provider");
|
|
18
|
+
var _vtxIcon = _interopRequireDefault(require("../vtx-icon"));
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
var _excluded = ["showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames", "titleClassName", "expandAction", "maxButtonCount"];
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
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); }
|
|
23
|
+
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 && Object.prototype.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; }
|
|
24
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
|
+
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."); }
|
|
26
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
27
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
28
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
34
|
+
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."); }
|
|
35
|
+
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; } }
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
38
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
39
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
40
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
41
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
42
|
+
var getParentKey = function getParentKey(keyValue, key, tree) {
|
|
43
|
+
var parentKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
44
|
+
var _iterator = _createForOfIteratorHelper(tree),
|
|
45
|
+
_step;
|
|
46
|
+
try {
|
|
47
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
48
|
+
var node = _step.value;
|
|
49
|
+
if (node[keyValue] === key) return parentKey;
|
|
50
|
+
if (node.children) {
|
|
51
|
+
var found = getParentKey(keyValue, key, node.children, node[keyValue]);
|
|
52
|
+
if (found !== undefined) return found;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_iterator.e(err);
|
|
57
|
+
} finally {
|
|
58
|
+
_iterator.f();
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
};
|
|
62
|
+
var VtxTree = exports.VtxTree = /*#__PURE__*/(0, _react.forwardRef)(function (propsAll, ref) {
|
|
63
|
+
var intl = (0, _vtxProvider.useIntl)();
|
|
64
|
+
var _propsAll$showSearch = propsAll.showSearch,
|
|
65
|
+
showSearch = _propsAll$showSearch === void 0 ? true : _propsAll$showSearch,
|
|
66
|
+
_propsAll$treeData = propsAll.treeData,
|
|
67
|
+
treeData = _propsAll$treeData === void 0 ? [] : _propsAll$treeData,
|
|
68
|
+
_propsAll$searchPlace = propsAll.searchPlaceholder,
|
|
69
|
+
searchPlaceholder = _propsAll$searchPlace === void 0 ? intl.getMessage('tree.searchPlaceholder', '请输入要查询的关键字') : _propsAll$searchPlace,
|
|
70
|
+
renderMenuList = propsAll.renderMenuList,
|
|
71
|
+
fieldNames = propsAll.fieldNames,
|
|
72
|
+
titleClassName = propsAll.titleClassName,
|
|
73
|
+
_propsAll$expandActio = propsAll.expandAction,
|
|
74
|
+
expandAction = _propsAll$expandActio === void 0 ? 'click' : _propsAll$expandActio,
|
|
75
|
+
_propsAll$maxButtonCo = propsAll.maxButtonCount,
|
|
76
|
+
maxButtonCount = _propsAll$maxButtonCo === void 0 ? 3 : _propsAll$maxButtonCo,
|
|
77
|
+
props = _objectWithoutProperties(propsAll, _excluded);
|
|
78
|
+
var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
|
|
79
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
80
|
+
var prefixCls = getPrefixCls('tree', props.prefixCls);
|
|
81
|
+
var _useStyle = (0, _index.useStyle)(prefixCls),
|
|
82
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
83
|
+
hashId = _useStyle.hashId;
|
|
84
|
+
var treeRef = (0, _react.useRef)();
|
|
85
|
+
var _useState = (0, _react.useState)(0),
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
height = _useState2[0],
|
|
88
|
+
setHeight = _useState2[1];
|
|
89
|
+
var _useState3 = (0, _react.useState)([]),
|
|
90
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
91
|
+
expandedKeys = _useState4[0],
|
|
92
|
+
setExpandedKeys = _useState4[1];
|
|
93
|
+
var _useState5 = (0, _react.useState)(props.autoExpandParent || false),
|
|
94
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
95
|
+
autoExpandParent = _useState6[0],
|
|
96
|
+
setAutoExpandParent = _useState6[1];
|
|
97
|
+
var _useState7 = (0, _react.useState)(props.selectedKeys || props.defaultSelectedKeys || []),
|
|
98
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
99
|
+
selectedKeys = _useState8[0],
|
|
100
|
+
setSelectedKeys = _useState8[1];
|
|
101
|
+
var inputRef = (0, _react.useRef)();
|
|
102
|
+
var lastSelectedKey = _react.default.useRef();
|
|
103
|
+
var cachedSelectedKeys = _react.default.useRef();
|
|
104
|
+
var dataList = (0, _react.useMemo)(function () {
|
|
105
|
+
var dataList = [];
|
|
106
|
+
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
107
|
+
var keyName = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key';
|
|
108
|
+
var generateList = function generateList(data) {
|
|
109
|
+
for (var i = 0; i < data.length; i++) {
|
|
110
|
+
var node = data[i];
|
|
111
|
+
dataList.push({
|
|
112
|
+
key: node[keyName],
|
|
113
|
+
title: node[titleKey]
|
|
114
|
+
});
|
|
115
|
+
if (node.children) {
|
|
116
|
+
generateList(node.children);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
generateList(treeData);
|
|
121
|
+
return dataList;
|
|
122
|
+
}, [treeData]);
|
|
123
|
+
(0, _react.useEffect)(function () {
|
|
124
|
+
if ('selectedKeys' in props) {
|
|
125
|
+
setSelectedKeys(props.selectedKeys);
|
|
126
|
+
}
|
|
127
|
+
}, [props.selectedKeys]);
|
|
128
|
+
(0, _react.useEffect)(function () {
|
|
129
|
+
if ('expandedKeys' in props) {
|
|
130
|
+
setExpandedKeys(props.expandedKeys);
|
|
131
|
+
}
|
|
132
|
+
}, [props.expandedKeys]);
|
|
133
|
+
var onExpand = function onExpand(newExpandedKeys, info) {
|
|
134
|
+
var _props$onExpand;
|
|
135
|
+
setAutoExpandParent(false);
|
|
136
|
+
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0 || _props$onExpand.call(props, newExpandedKeys, info);
|
|
137
|
+
if (!('expandedKeys' in props)) {
|
|
138
|
+
setExpandedKeys(newExpandedKeys);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var _useState9 = (0, _react.useState)(treeData),
|
|
142
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
143
|
+
newTreeData = _useState10[0],
|
|
144
|
+
setNewTreeData = _useState10[1];
|
|
145
|
+
(0, _react.useEffect)(function () {
|
|
146
|
+
if (treeData !== null && treeData !== void 0 && treeData.length) {
|
|
147
|
+
filterTreeData(inputRef.current ? inputRef.current.input.value : '');
|
|
148
|
+
}
|
|
149
|
+
}, [treeData]);
|
|
150
|
+
var filterTreeData = (0, _ahooks.useMemoizedFn)(function () {
|
|
151
|
+
var searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
152
|
+
var newTreeData = (0, _utils2.parseTreeData)(treeData, {
|
|
153
|
+
renderNode: function renderNode(item) {
|
|
154
|
+
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
155
|
+
var keyName = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key';
|
|
156
|
+
var strTitle = item[titleKey] || '';
|
|
157
|
+
var index = strTitle.indexOf(searchValue);
|
|
158
|
+
var beforeStr = strTitle.substring(0, index);
|
|
159
|
+
var afterStr = strTitle.slice(index + searchValue.length);
|
|
160
|
+
var className = titleClassName ? titleClassName(item) : '';
|
|
161
|
+
var title = index > -1 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
162
|
+
className: className,
|
|
163
|
+
children: [beforeStr, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
164
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-search-value"), hashId),
|
|
165
|
+
children: searchValue
|
|
166
|
+
}), afterStr]
|
|
167
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
168
|
+
className: className,
|
|
169
|
+
children: strTitle
|
|
170
|
+
});
|
|
171
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title), keyName, item[keyName]), "strTitle", strTitle));
|
|
172
|
+
},
|
|
173
|
+
filterNode: function filterNode(item) {
|
|
174
|
+
return item.strTitle.indexOf(searchValue) > -1;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return setNewTreeData(newTreeData);
|
|
178
|
+
});
|
|
179
|
+
var _useDebounceFn = (0, _ahooks.useDebounceFn)(function (value) {
|
|
180
|
+
var _props$onExpand2;
|
|
181
|
+
var newExpandedKeys = dataList.map(function (item) {
|
|
182
|
+
if (item.title.indexOf(value) > -1) {
|
|
183
|
+
return getParentKey((fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.key) || 'key', item.key, treeData);
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
}).filter(function (item, i, self) {
|
|
187
|
+
return item && self.indexOf(item) === i;
|
|
188
|
+
});
|
|
189
|
+
setAutoExpandParent(true);
|
|
190
|
+
filterTreeData(value);
|
|
191
|
+
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0 || _props$onExpand2.call(props, newExpandedKeys);
|
|
192
|
+
if (!('expandedKeys' in props)) {
|
|
193
|
+
setExpandedKeys(newExpandedKeys);
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
wait: 300
|
|
197
|
+
}),
|
|
198
|
+
onSearch = _useDebounceFn.run;
|
|
199
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
200
|
+
return {
|
|
201
|
+
onSearch: onSearch
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
(0, _react.useEffect)(function () {
|
|
205
|
+
var element = treeRef.current;
|
|
206
|
+
if (!element) return; // 提前返回,避免后续问题
|
|
207
|
+
|
|
208
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
209
|
+
var _iterator2 = _createForOfIteratorHelper(entries),
|
|
210
|
+
_step2;
|
|
211
|
+
try {
|
|
212
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
213
|
+
var entry = _step2.value;
|
|
214
|
+
setHeight(entry.contentRect.height);
|
|
215
|
+
}
|
|
216
|
+
} catch (err) {
|
|
217
|
+
_iterator2.e(err);
|
|
218
|
+
} finally {
|
|
219
|
+
_iterator2.f();
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
resizeObserver.observe(element, {
|
|
223
|
+
box: 'border-box'
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// 初始化高度
|
|
227
|
+
setHeight(element.offsetHeight);
|
|
228
|
+
return function () {
|
|
229
|
+
resizeObserver.disconnect();
|
|
230
|
+
};
|
|
231
|
+
}, []);
|
|
232
|
+
var onSelect = function onSelect(keys, event) {
|
|
233
|
+
var _props$onSelect;
|
|
234
|
+
var multiple = props.multiple;
|
|
235
|
+
var node = event.node,
|
|
236
|
+
nativeEvent = event.nativeEvent;
|
|
237
|
+
var _node$key = node.key,
|
|
238
|
+
key = _node$key === void 0 ? '' : _node$key;
|
|
239
|
+
// const newState: DirectoryTreeState = {};
|
|
240
|
+
|
|
241
|
+
// We need wrap this event since some value is not same
|
|
242
|
+
var newEvent = _objectSpread(_objectSpread({}, event), {}, {
|
|
243
|
+
selected: true // Directory selected always true
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Windows / Mac single pick
|
|
247
|
+
var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
248
|
+
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
249
|
+
|
|
250
|
+
// Generate new selected keys
|
|
251
|
+
var newSelectedKeys;
|
|
252
|
+
if (multiple && ctrlPick) {
|
|
253
|
+
// Control click
|
|
254
|
+
newSelectedKeys = keys;
|
|
255
|
+
lastSelectedKey.current = key;
|
|
256
|
+
cachedSelectedKeys.current = newSelectedKeys;
|
|
257
|
+
newEvent.selectedNodes = (0, _utils.convertDirectoryKeysToNodes)(treeData, newSelectedKeys);
|
|
258
|
+
} else if (multiple && shiftPick) {
|
|
259
|
+
// Shift click
|
|
260
|
+
newSelectedKeys = Array.from(new Set([].concat(_toConsumableArray(cachedSelectedKeys.current || []), _toConsumableArray((0, _utils.calcRangeKeys)({
|
|
261
|
+
treeData: treeData,
|
|
262
|
+
expandedKeys: expandedKeys,
|
|
263
|
+
startKey: key,
|
|
264
|
+
endKey: lastSelectedKey.current
|
|
265
|
+
})))));
|
|
266
|
+
newEvent.selectedNodes = (0, _utils.convertDirectoryKeysToNodes)(treeData, newSelectedKeys);
|
|
267
|
+
} else {
|
|
268
|
+
// Single click
|
|
269
|
+
newSelectedKeys = [key];
|
|
270
|
+
lastSelectedKey.current = key;
|
|
271
|
+
cachedSelectedKeys.current = newSelectedKeys;
|
|
272
|
+
newEvent.selectedNodes = (0, _utils.convertDirectoryKeysToNodes)(treeData, newSelectedKeys);
|
|
273
|
+
}
|
|
274
|
+
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
275
|
+
if (!('selectedKeys' in props)) {
|
|
276
|
+
setSelectedKeys(newSelectedKeys);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var renderMenuIcon = function renderMenuIcon(arr, nodeData) {
|
|
280
|
+
return arr.map(function (item) {
|
|
281
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
282
|
+
title: item.label,
|
|
283
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
284
|
+
className: "".concat(prefixCls, "-menu-item-icon"),
|
|
285
|
+
onClick: function onClick(e) {
|
|
286
|
+
e.stopPropagation();
|
|
287
|
+
item.onClick && item.onClick(nodeData);
|
|
288
|
+
},
|
|
289
|
+
children: item.icon
|
|
290
|
+
})
|
|
291
|
+
}, item.label);
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
295
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-wraaper"), hashId),
|
|
296
|
+
children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
297
|
+
style: {
|
|
298
|
+
marginBottom: 8
|
|
299
|
+
},
|
|
300
|
+
placeholder: searchPlaceholder,
|
|
301
|
+
onChange: function onChange(e) {
|
|
302
|
+
return onSearch(e.target.value);
|
|
303
|
+
},
|
|
304
|
+
ref: inputRef
|
|
305
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
306
|
+
className: (0, _classnames.default)("".concat(prefixCls), hashId),
|
|
307
|
+
ref: treeRef,
|
|
308
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tree, _objectSpread(_objectSpread(_objectSpread({}, props), {}, {
|
|
309
|
+
height: height,
|
|
310
|
+
switcherIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
|
|
311
|
+
type: "downOutlined",
|
|
312
|
+
fileType: "svg"
|
|
313
|
+
}),
|
|
314
|
+
showLine: {
|
|
315
|
+
showLeafIcon: false
|
|
316
|
+
},
|
|
317
|
+
blockNode: true,
|
|
318
|
+
treeData: newTreeData,
|
|
319
|
+
onExpand: onExpand
|
|
320
|
+
}, expandedKeys.length === 0 && props.defaultExpandAll ? {} : {
|
|
321
|
+
expandedKeys: expandedKeys
|
|
322
|
+
}), {}, {
|
|
323
|
+
autoExpandParent: autoExpandParent,
|
|
324
|
+
selectedKeys: selectedKeys,
|
|
325
|
+
onSelect: onSelect,
|
|
326
|
+
fieldNames: fieldNames,
|
|
327
|
+
expandAction: expandAction,
|
|
328
|
+
titleRender: function titleRender(nodeData) {
|
|
329
|
+
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
330
|
+
var title = nodeData[titleKey];
|
|
331
|
+
if (renderMenuList) {
|
|
332
|
+
var menuList = renderMenuList(nodeData).filter(function (item) {
|
|
333
|
+
return item.visible;
|
|
334
|
+
});
|
|
335
|
+
var arr = [];
|
|
336
|
+
if (menuList.length > maxButtonCount) {
|
|
337
|
+
arr = arr.concat(renderMenuIcon(menuList.slice(0, maxButtonCount - 1), nodeData));
|
|
338
|
+
arr.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, {
|
|
339
|
+
placement: "bottom",
|
|
340
|
+
menu: {
|
|
341
|
+
items: menuList.slice(maxButtonCount - 1).map(function (item) {
|
|
342
|
+
return {
|
|
343
|
+
key: item.label,
|
|
344
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
345
|
+
className: "".concat(prefixCls, "-menu-item-label"),
|
|
346
|
+
children: [item.icon, item.label]
|
|
347
|
+
})
|
|
348
|
+
};
|
|
349
|
+
}),
|
|
350
|
+
onClick: function onClick(obj) {
|
|
351
|
+
var key = obj.key,
|
|
352
|
+
domEvent = obj.domEvent;
|
|
353
|
+
domEvent.stopPropagation();
|
|
354
|
+
var temp = menuList.find(function (v) {
|
|
355
|
+
return v.label == key;
|
|
356
|
+
});
|
|
357
|
+
(temp === null || temp === void 0 ? void 0 : temp.onClick) && temp.onClick(nodeData);
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
trigger: ['click'],
|
|
361
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
362
|
+
className: "".concat(prefixCls, "-menu-item-icon"),
|
|
363
|
+
onClick: function onClick(e) {
|
|
364
|
+
e.stopPropagation();
|
|
365
|
+
},
|
|
366
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.EllipsisOutlined, {})
|
|
367
|
+
})
|
|
368
|
+
}));
|
|
369
|
+
} else {
|
|
370
|
+
arr = arr.concat(renderMenuIcon(menuList, nodeData));
|
|
371
|
+
}
|
|
372
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
373
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-menu-wrap"), hashId),
|
|
374
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
375
|
+
children: title
|
|
376
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
377
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-menu-list"), hashId),
|
|
378
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
379
|
+
children: [arr, " "]
|
|
380
|
+
})
|
|
381
|
+
})]
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
return title;
|
|
385
|
+
}
|
|
386
|
+
}))
|
|
387
|
+
})]
|
|
388
|
+
}));
|
|
389
|
+
});
|
|
390
|
+
VtxTree.propTypes = {
|
|
391
|
+
showSearch: _propTypes.default.bool,
|
|
392
|
+
prefixCls: _propTypes.default.string,
|
|
393
|
+
treeData: _propTypes.default.array,
|
|
394
|
+
selectedKeys: _propTypes.default.array,
|
|
395
|
+
defaultSelectedKeys: _propTypes.default.array,
|
|
396
|
+
expandedKeys: _propTypes.default.array,
|
|
397
|
+
onExpand: _propTypes.default.func,
|
|
398
|
+
multiple: _propTypes.default.bool,
|
|
399
|
+
autoExpandParent: _propTypes.default.bool,
|
|
400
|
+
onSelect: _propTypes.default.func,
|
|
401
|
+
searchPlaceholder: _propTypes.default.string,
|
|
402
|
+
renderMenuList: _propTypes.default.func,
|
|
403
|
+
titleClassName: _propTypes.default.func,
|
|
404
|
+
fieldNames: _propTypes.default.shape({
|
|
405
|
+
title: _propTypes.default.string,
|
|
406
|
+
key: _propTypes.default.string,
|
|
407
|
+
children: _propTypes.default.string
|
|
408
|
+
}),
|
|
409
|
+
defaultExpandAll: _propTypes.default.bool,
|
|
410
|
+
expandAction: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool])
|
|
411
|
+
};
|
|
412
|
+
var _default = exports.default = VtxTree;
|