plain-design 1.0.0-beta.98 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plain-design.commonjs.min.js +2 -18
- package/dist/plain-design.commonjs.min.js.LICENSE.txt +18 -0
- package/dist/plain-design.min.css +25 -24
- package/dist/plain-design.min.js +2 -18
- package/dist/plain-design.min.js.LICENSE.txt +18 -0
- package/dist/report.html +3 -3
- package/package.json +43 -40
- package/src/packages/components/$address/createAddressService.tsx +8 -3
- package/src/packages/components/$ai/index.tsx +368 -0
- package/src/packages/components/$configuration/index.tsx +4 -2
- package/src/packages/components/$file/index.tsx +44 -1
- package/src/packages/components/$imageSelector/index.tsx +56 -0
- package/src/packages/components/$message/image.service.utils.tsx +1 -1
- package/src/packages/components/$object/createObjectService.tsx +8 -6
- package/src/packages/components/$object/object.conver.ts +3 -3
- package/src/packages/components/$object/object.service.utils.ts +2 -2
- package/src/packages/components/$ov/createOvService.ts +2 -2
- package/src/packages/components/$previewer/ImagePreviewerFixedContainer.tsx +6 -6
- package/src/packages/components/$previewer/index.tsx +1 -1
- package/src/packages/components/$search/SearchFooter.tsx +1 -1
- package/src/packages/components/$search/SearchList.tsx +2 -2
- package/src/packages/components/$search/SearchServicePanel.tsx +4 -4
- package/src/packages/components/$search/createSearchService.tsx +1 -1
- package/src/packages/components/$search/search-service.scss +1 -0
- package/src/packages/components/$search/search.utils.tsx +1 -1
- package/src/packages/components/$upload/upload.utils.ts +7 -6
- package/src/packages/components/Address/index.tsx +2 -2
- package/src/packages/components/AddressCascade/address-cascade.utils.ts +1 -1
- package/src/packages/components/AddressCascade/createAddressCascade.hooks.ts +1 -1
- package/src/packages/components/AddressCascade/createAddressCascade.multiple.tsx +5 -6
- package/src/packages/components/AddressCascade/createAddressCascade.single.tsx +6 -7
- package/src/packages/components/AddressCascade/index.tsx +1 -1
- package/src/packages/components/AiChatBox/ai-chat-box.scss +74 -0
- package/src/packages/components/AiChatBox/index.tsx +306 -0
- package/src/packages/components/Alert/index.tsx +1 -1
- package/src/packages/components/Application/index.tsx +1 -1
- package/src/packages/components/Application/service/createApplicationService.tsx +2 -2
- package/src/packages/components/Application/service/createApplicationServiceComponent.tsx +1 -1
- package/src/packages/components/Application/service/createApplicationServiceManager.tsx +2 -2
- package/src/packages/components/Application/service/useApplicationService.tsx +3 -3
- package/src/packages/components/Application/utils/application.utils.ts +3 -4
- package/src/packages/components/Application/utils/createServiceReadyObserver.ts +1 -1
- package/src/packages/components/ArrowStep/index.tsx +1 -1
- package/src/packages/components/ArrowStepGroup/index.tsx +2 -2
- package/src/packages/components/AutoLoadingObserver/index.tsx +3 -3
- package/src/packages/components/AutoTable/AutoTable.tsx +1 -1
- package/src/packages/components/AutoTable/auto-table.scss +35 -4
- package/src/packages/components/AutoTable/createTableOptionUser.tsx +3 -1
- package/src/packages/components/AutoTable/filter/useTableOption.filter.form.tsx +8 -5
- package/src/packages/components/AutoTable/filter/useTableOption.filter.search.tsx +2 -2
- package/src/packages/components/AutoTable/filter/useTableOption.filter.state.ts +12 -7
- package/src/packages/components/AutoTable/setting/useTableOption.setting.all.fitler.tsx +1 -1
- package/src/packages/components/AutoTable/setting/useTableOption.setting.cache.tsx +3 -3
- package/src/packages/components/AutoTable/setting/useTableOption.setting.config.tsx +59 -17
- package/src/packages/components/AutoTable/setting/useTableOption.setting.export.tsx +5 -30
- package/src/packages/components/AutoTable/setting/useTableOption.setting.import.tsx +3 -3
- package/src/packages/components/AutoTable/setting/useTableOption.setting.senior.filter.tsx +388 -385
- package/src/packages/components/AutoTable/setting/useTableOption.setting.senior.sort.tsx +15 -8
- package/src/packages/components/AutoTable/setting/useTableOption.setting.tsx +109 -109
- package/src/packages/components/AutoTable/setting/useTableOption.setting.utils.ts +2 -2
- package/src/packages/components/AutoTable/use/useTableOption.ai.tsx +640 -0
- package/src/packages/components/AutoTable/use/useTableOption.buttons.tsx +27 -17
- package/src/packages/components/AutoTable/use/useTableOption.cache.ts +2 -2
- package/src/packages/components/AutoTable/use/useTableOption.check.tsx +3 -3
- package/src/packages/components/AutoTable/use/useTableOption.column.popper.tsx +5 -5
- package/src/packages/components/AutoTable/use/useTableOption.confirm.tsx +2 -2
- package/src/packages/components/AutoTable/use/useTableOption.fill.tsx +8 -8
- package/src/packages/components/AutoTable/use/useTableOption.hooks.tsx +6 -4
- package/src/packages/components/AutoTable/use/useTableOption.loading.tsx +3 -3
- package/src/packages/components/AutoTable/use/useTableOption.methods.tsx +7 -4
- package/src/packages/components/AutoTable/use/useTableOption.pagination.tsx +3 -3
- package/src/packages/components/AutoTable/use/useTableOption.parent.tsx +5 -2
- package/src/packages/components/AutoTable/use/useTableOption.permission.tsx +1 -1
- package/src/packages/components/AutoTable/use/useTableOption.sort.ts +8 -7
- package/src/packages/components/AutoTable/use/useTableOption.state.tsx +1 -1
- package/src/packages/components/AutoTable/use/useTableOption.table.tsx +14 -5
- package/src/packages/components/AutoTable/use/useTableOption.tips.tsx +3 -3
- package/src/packages/components/AutoTable/use/useTableOptionKeyboard.tsx +13 -4
- package/src/packages/components/AutoTable/utils/AutoModule.ts +1 -1
- package/src/packages/components/AutoTable/utils/AutoTable.utils.ts +76 -1
- package/src/packages/components/AutoTable/utils/TableOption.space.tsx +10 -6
- package/src/packages/components/AutoTable/utils/TableOption.url.ts +1 -1
- package/src/packages/components/AutoTable/utils/TableOption.utils.tsx +3 -3
- package/src/packages/components/AutoTable/utils/buildPlainDefaultUrlConfig.ts +6 -6
- package/src/packages/components/AutoWidthInput/index.tsx +2 -2
- package/src/packages/components/Badge/badge.scss +4 -0
- package/src/packages/components/Badge/index.tsx +1 -1
- package/src/packages/components/Box/index.tsx +31 -30
- package/src/packages/components/Button/index.tsx +11 -4
- package/src/packages/components/ButtonGroup/index.tsx +2 -2
- package/src/packages/components/Card/index.tsx +2 -2
- package/src/packages/components/Carousel/index.tsx +8 -8
- package/src/packages/components/CarouselItem/index.tsx +3 -3
- package/src/packages/components/Cascade/CascadeKeys.tsx +158 -0
- package/src/packages/components/Cascade/cascade.utils.ts +1 -1
- package/src/packages/components/Cascade/createCascadeHooks.ts +1 -1
- package/src/packages/components/Cascade/createCascadePopper.tsx +5 -4
- package/src/packages/components/Cascade/createCascadeUtils.ts +2 -2
- package/src/packages/components/Cascade/createMultipleCascadeRender.tsx +5 -6
- package/src/packages/components/Cascade/createSingleCascadeRender.tsx +7 -7
- package/src/packages/components/Cascade/index.tsx +3 -3
- package/src/packages/components/CascadeKeys/index.tsx +5 -0
- package/src/packages/components/CascadePanel/cascade-panel.utils.ts +3 -3
- package/src/packages/components/CascadePanel/flat/CascadeFlatPanelNode.tsx +1 -1
- package/src/packages/components/CascadePanel/flat/createCascadeFlatRender.tsx +14 -9
- package/src/packages/components/CascadePanel/index.tsx +22 -4
- package/src/packages/components/CascadePanel/list/CascadeListPanelItem.tsx +1 -1
- package/src/packages/components/CascadePanel/list/CascadeListPanelNode.tsx +1 -1
- package/src/packages/components/CascadePanel/list/createCascadeListRender.tsx +6 -2
- package/src/packages/components/Checkbox/index.tsx +8 -10
- package/src/packages/components/CheckboxGroup/index.tsx +1 -1
- package/src/packages/components/CheckboxInner/index.tsx +1 -1
- package/src/packages/components/Collapse/index.tsx +2 -2
- package/src/packages/components/CollapseGroup/index.tsx +1 -1
- package/src/packages/components/CollapseTransition/index.tsx +5 -5
- package/src/packages/components/ColorPicker/ColorPanel.tsx +146 -125
- package/src/packages/components/ColorPicker/color-panel.scss +117 -97
- package/src/packages/components/ColorPicker/index.tsx +144 -131
- package/src/packages/components/ColorPicker/sub/ColorAlphaSlider.tsx +1 -1
- package/src/packages/components/ColorPicker/sub/ColorHueSlider.tsx +1 -1
- package/src/packages/components/ColorPicker/sub/ColorSlider.tsx +5 -5
- package/src/packages/components/ColorPicker/sub/ColorSvPanel.tsx +4 -4
- package/src/packages/components/ColorPicker/useColorPanelEditor.tsx +1 -1
- package/src/packages/components/ColorPicker/useColorPanelHistory.tsx +1 -1
- package/src/packages/components/ColorPicker/utils/color-picker.utils.tsx +1 -1
- package/src/packages/components/ConfirmPopup/index.tsx +1 -1
- package/src/packages/components/Corner/index.tsx +3 -3
- package/src/packages/components/DatePicker/createDateRender.multiple.tsx +7 -7
- package/src/packages/components/DatePicker/createDateRender.single.tsx +8 -7
- package/src/packages/components/DatePicker/createRangeDateRender.range.tsx +3 -3
- package/src/packages/components/DatePicker/createRangeDateRender.separate.tsx +3 -3
- package/src/packages/components/DatePicker/date.utils.tsx +2 -2
- package/src/packages/components/DatePicker/index.tsx +3 -1
- package/src/packages/components/DatePicker/panel/DatePanel.tsx +1 -1
- package/src/packages/components/DatePicker/panel/DatePanelDate.tsx +2 -2
- package/src/packages/components/DatePicker/panel/DatePanelMonth.tsx +1 -1
- package/src/packages/components/DatePicker/panel/DatePanelQuarter.tsx +1 -1
- package/src/packages/components/DatePicker/panel/DatePanelRange.tsx +1 -1
- package/src/packages/components/DatePicker/panel/DatePanelWeek.tsx +1 -1
- package/src/packages/components/DatePicker/panel/DatePanelYear.tsx +1 -1
- package/src/packages/components/DatePicker/panel/useDatePanel.tsx +2 -2
- package/src/packages/components/DatePicker/panel/useDateWeek.tsx +2 -2
- package/src/packages/components/DatePicker/useRangeDateRender.tsx +8 -8
- package/src/packages/components/Dialog/dialog.scss +2 -2
- package/src/packages/components/Dialog/index.tsx +11 -7
- package/src/packages/components/Dialog/useDialogMovable.tsx +1 -1
- package/src/packages/components/Dialog/utils/dialog.utils.ts +1 -1
- package/src/packages/components/Dropdown/dropdown.utils.tsx +2 -3
- package/src/packages/components/Dropdown/index.tsx +18 -5
- package/src/packages/components/DropdownGroup/index.tsx +1 -1
- package/src/packages/components/DropdownOption/index.tsx +2 -2
- package/src/packages/components/DropdownSeparator/index.tsx +1 -1
- package/src/packages/components/Empty/index.tsx +1 -1
- package/src/packages/components/FilterFormMultiple/index.tsx +12 -7
- package/src/packages/components/FilterFormSingle/index.tsx +178 -173
- package/src/packages/components/FilterService/filter/filter.city.tsx +4 -3
- package/src/packages/components/FilterService/filter/filter.district.tsx +4 -3
- package/src/packages/components/FilterService/filter/filter.number.tsx +2 -2
- package/src/packages/components/FilterService/filter/filter.province.tsx +1 -1
- package/src/packages/components/FilterService/filter/filter.select.tsx +3 -2
- package/src/packages/components/FilterService/filter/fitler.object.tsx +1 -1
- package/src/packages/components/FilterService/index.tsx +2 -2
- package/src/packages/components/FilterService/utils/filter.service.utils.ts +2 -2
- package/src/packages/components/FilterService/utils/mergeQueryParam.ts +3 -3
- package/src/packages/components/Form/form.scss +4 -0
- package/src/packages/components/Form/index.tsx +1 -1
- package/src/packages/components/Form/layout/useFormLayout.tsx +6 -5
- package/src/packages/components/Form/types/any.tsx +1 -1
- package/src/packages/components/Form/types/array.tsx +1 -1
- package/src/packages/components/Form/types/date.tsx +1 -1
- package/src/packages/components/Form/types/number.tsx +1 -1
- package/src/packages/components/Form/types/string.tsx +1 -1
- package/src/packages/components/Form/validate/createValidation.tsx +2 -2
- package/src/packages/components/Form/validate/useFormItemValidation.tsx +32 -31
- package/src/packages/components/Form/validate/useFormValidation.tsx +2 -2
- package/src/packages/components/Form/validate/validate.utils.tsx +4 -4
- package/src/packages/components/FormItem/FormItemValidateMessage.tsx +1 -1
- package/src/packages/components/FormItem/createFormEditor.tsx +2 -2
- package/src/packages/components/FormItem/index.tsx +8 -1
- package/src/packages/components/Grid/GridCol.tsx +1 -1
- package/src/packages/components/Grid/GridRow.tsx +3 -3
- package/src/packages/components/Icon/icon.external.tsx +117 -0
- package/src/packages/components/Icon/icon.registry.tsx +2 -2
- package/src/packages/components/Icon/index.tsx +13 -7
- package/src/packages/components/IconPicker/DefaultIcons.ts +7 -0
- package/src/packages/components/IconPicker/icon-picker.scss +43 -0
- package/src/packages/components/IconPicker/index.tsx +189 -0
- package/src/packages/components/Illustration/index.tsx +1 -1
- package/src/packages/components/Image/image.scss +11 -2
- package/src/packages/components/Image/index.tsx +27 -18
- package/src/packages/components/ImagePreviewer/ImagePreviewer.tsx +6 -6
- package/src/packages/components/ImagePreviewer/ImagePreviewerButtonBar.tsx +1 -1
- package/src/packages/components/ImagePreviewer/ImagePreviewerCarouselImage.tsx +2 -2
- package/src/packages/components/ImagePreviewer/ImagePreviewerGallery.tsx +3 -3
- package/src/packages/components/ImagePreviewer/PreviewerLoading.tsx +1 -1
- package/src/packages/components/ImagePreviewer/image-previewer.utils.tsx +4 -4
- package/src/packages/components/ImageSelector/image-selector.scss +70 -0
- package/src/packages/components/ImageSelector/index.tsx +59 -0
- package/src/packages/components/ImageUploader/index.tsx +41 -23
- package/src/packages/components/Input/index.scss +14 -2
- package/src/packages/components/Input/index.tsx +3 -3
- package/src/packages/components/Input/input.utils.ts +1 -1
- package/src/packages/components/Input/useMultipleInput.tsx +11 -10
- package/src/packages/components/Input/useSingleInput.tsx +2 -2
- package/src/packages/components/Input/useSuggestionInput.tsx +9 -9
- package/src/packages/components/Input/useTextareaInput.tsx +6 -6
- package/src/packages/components/Input/uses/useInputEnterHandler.tsx +24 -13
- package/src/packages/components/Input/uses/useInputHooks.tsx +1 -1
- package/src/packages/components/Input/uses/useInputMaxLength.tsx +1 -1
- package/src/packages/components/Input/uses/useInputSuffixIcon.tsx +2 -2
- package/src/packages/components/InputGroup/index.tsx +1 -1
- package/src/packages/components/InputGroup/input-group.scss +9 -0
- package/src/packages/components/InputNumber/NumberResize.tsx +4 -4
- package/src/packages/components/InputNumber/index.tsx +1 -1
- package/src/packages/components/InputNumber/input-number.utils.tsx +1 -1
- package/src/packages/components/InputNumber/number.scss +3 -0
- package/src/packages/components/InputNumber/number.utils.ts +1 -1
- package/src/packages/components/InputNumber/useInputNumber.multiple.tsx +2 -2
- package/src/packages/components/InputNumber/useInputNumber.public.tsx +12 -11
- package/src/packages/components/InputNumber/useInputNumber.single.tsx +2 -2
- package/src/packages/components/Layout/index.tsx +9 -2
- package/src/packages/components/Layout/layout.scss +20 -0
- package/src/packages/components/Layout/layout.utils.ts +1 -1
- package/src/packages/components/LayoutSection/index.tsx +12 -3
- package/src/packages/components/LayoutSection/useLayoutSectionResizer.tsx +2 -2
- package/src/packages/components/List/index.tsx +1 -1
- package/src/packages/components/ListOption/index.tsx +20 -0
- package/src/packages/components/ListPanel/index.tsx +30 -0
- package/src/packages/components/ListPanel/list-panel.scss +20 -0
- package/src/packages/components/Loading/index.tsx +2 -2
- package/src/packages/components/LoadingMask/index.tsx +2 -2
- package/src/packages/components/NumberRange/index.tsx +94 -93
- package/src/packages/components/Object/createObjectHooks.tsx +1 -1
- package/src/packages/components/Object/createObjectRender.multiple.tsx +10 -10
- package/src/packages/components/Object/createObjectRender.single.tsx +18 -14
- package/src/packages/components/Object/index.tsx +3 -3
- package/src/packages/components/Object/object.scss +6 -0
- package/src/packages/components/Object/object.utils.ts +5 -3
- package/src/packages/components/Ov/index.tsx +1 -1
- package/src/packages/components/Ov/ov.utils.ts +1 -1
- package/src/packages/components/Ov/usePublicOv.tsx +1 -1
- package/src/packages/components/PageCard/index.tsx +4 -1
- package/src/packages/components/PageCardContent/index.tsx +4 -1
- package/src/packages/components/PageCardTitle/index.tsx +1 -1
- package/src/packages/components/PageRenderList/index.tsx +1 -1
- package/src/packages/components/PageThemeUtils/index.tsx +3 -3
- package/src/packages/components/Pagination/index.tsx +3 -3
- package/src/packages/components/Paragraph/index.tsx +1 -1
- package/src/packages/components/ParagraphItem/index.tsx +1 -1
- package/src/packages/components/PlcImage/index.tsx +14 -8
- package/src/packages/components/PlcObject/index.tsx +2 -2
- package/src/packages/components/PlcOv/index.tsx +1 -1
- package/src/packages/components/Popup/PopupProvider.tsx +1 -2
- package/src/packages/components/Popup/index.tsx +2 -2
- package/src/packages/components/ProgressBar/index.tsx +1 -1
- package/src/packages/components/ProgressBar/progress.utils.ts +2 -2
- package/src/packages/components/ProgressCircle/index.tsx +2 -2
- package/src/packages/components/ProgressMini/index.tsx +2 -2
- package/src/packages/components/Radio/index.tsx +4 -4
- package/src/packages/components/RadioGroup/index.tsx +1 -1
- package/src/packages/components/RadioInner/index.tsx +1 -1
- package/src/packages/components/Rate/index.tsx +3 -3
- package/src/packages/components/Reference/ReferenceProvider.tsx +1 -1
- package/src/packages/components/Reference/index.tsx +1 -1
- package/src/packages/components/RollingNumber/index.tsx +2 -2
- package/src/packages/components/Scroll/HorizontalScrollbar.tsx +4 -4
- package/src/packages/components/Scroll/VerticalScrollbar.tsx +4 -4
- package/src/packages/components/Scroll/index.tsx +6 -5
- package/src/packages/components/Scroll/useAutoScroll.ts +1 -1
- package/src/packages/components/Segment/index.tsx +1 -1
- package/src/packages/components/SegmentGroup/index.tsx +1 -1
- package/src/packages/components/Select/SelectPanel.tsx +1 -1
- package/src/packages/components/Select/createMultipleSelectRender.tsx +12 -8
- package/src/packages/components/Select/createPublicSelectRender.tsx +18 -12
- package/src/packages/components/Select/createSelectOptionDecoder.tsx +1 -1
- package/src/packages/components/Select/createSingleSelectRender.tsx +13 -9
- package/src/packages/components/Select/decodeSelectRenderNode.tsx +6 -4
- package/src/packages/components/Select/index.tsx +13 -1
- package/src/packages/components/Select/select.utils.tsx +5 -4
- package/src/packages/components/SelectDisplay/index.tsx +3 -3
- package/src/packages/components/SelectGroup/index.tsx +1 -1
- package/src/packages/components/SelectOption/index.tsx +2 -2
- package/src/packages/components/Skeleton/index.tsx +44 -0
- package/src/packages/components/Skeleton/skeleton.scss +27 -0
- package/src/packages/components/Slider/index.tsx +3 -3
- package/src/packages/components/Slider/slider.utils.tsx +1 -1
- package/src/packages/components/Slider/useSlider.range.tsx +13 -10
- package/src/packages/components/Slider/useSlider.single.tsx +8 -9
- package/src/packages/components/Slider/useSliderDotDragier.tsx +4 -4
- package/src/packages/components/SortList/index.tsx +4 -4
- package/src/packages/components/Space/index.tsx +1 -1
- package/src/packages/components/StackCard/index.tsx +4 -4
- package/src/packages/components/StackCardItem/index.tsx +1 -1
- package/src/packages/components/Step/index.tsx +1 -1
- package/src/packages/components/StepGroup/index.tsx +1 -1
- package/src/packages/components/Tab/index.tsx +1 -1
- package/src/packages/components/TabGroup/TabsHeader.tsx +1 -1
- package/src/packages/components/TabGroup/TabsInner.tsx +1 -1
- package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontal.tsx +3 -3
- package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontalCard.tsx +1 -1
- package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontalShadow.tsx +1 -1
- package/src/packages/components/TabGroup/header/horizontal/TabsHeaderHorizontalText.tsx +2 -2
- package/src/packages/components/TabGroup/header/vertical/TabsHeaderVertical.tsx +1 -1
- package/src/packages/components/TabGroup/index.tsx +1 -1
- package/src/packages/components/TabGroup/tabs.scss +23 -0
- package/src/packages/components/TabGroup/tabs.utils.tsx +1 -1
- package/src/packages/components/Table/editor/PlcAddress.tsx +1 -1
- package/src/packages/components/Table/editor/PlcAddressItem.tsx +1 -1
- package/src/packages/components/Table/editor/PlcCheckbox.tsx +1 -1
- package/src/packages/components/Table/editor/PlcColorPicker.tsx +1 -1
- package/src/packages/components/Table/editor/PlcDate.tsx +1 -1
- package/src/packages/components/Table/editor/PlcDate.utils.tsx +2 -2
- package/src/packages/components/Table/editor/PlcDateRange.tsx +1 -1
- package/src/packages/components/Table/editor/PlcInput.tsx +1 -1
- package/src/packages/components/Table/editor/PlcNumber.tsx +1 -1
- package/src/packages/components/Table/editor/PlcRate.tsx +1 -1
- package/src/packages/components/Table/editor/PlcSelect.tsx +2 -1
- package/src/packages/components/Table/editor/PlcTextarea.tsx +1 -1
- package/src/packages/components/Table/editor/PlcTime.tsx +1 -1
- package/src/packages/components/Table/editor/PlcTime.utils.ts +2 -2
- package/src/packages/components/Table/editor/PlcTimeRange.tsx +1 -1
- package/src/packages/components/Table/editor/PlcToggle.tsx +1 -1
- package/src/packages/components/Table/plc/group/PlcGroup.tsx +1 -1
- package/src/packages/components/Table/plc/plc/Plc.tsx +1 -1
- package/src/packages/components/Table/plc/process/copyPlcList.ts +1 -1
- package/src/packages/components/Table/plc/process/processPlcFixed.ts +1 -1
- package/src/packages/components/Table/plc/process/processPlcSort.ts +1 -1
- package/src/packages/components/Table/plc/use/useBasePlc.tsx +3 -3
- package/src/packages/components/Table/plc/use/useBasePlcGroup.tsx +1 -1
- package/src/packages/components/Table/plc/use/usePlc.tsx +1 -1
- package/src/packages/components/Table/plc/use/usePlcPropsState.tsx +2 -2
- package/src/packages/components/Table/plc/use/useTableAutoSpan.tsx +112 -0
- package/src/packages/components/Table/plc/useTablePlc.tsx +7 -4
- package/src/packages/components/Table/plc/utils/plc.render.ts +1 -1
- package/src/packages/components/Table/plc/utils/plc.scope-slots.ts +1 -1
- package/src/packages/components/Table/plc/utils/plc.utils.ts +9 -6
- package/src/packages/components/Table/standard/PlcCheck/PlcCheck.hooks.tsx +3 -3
- package/src/packages/components/Table/standard/PlcCheck/PlcCheck.multiple.tsx +7 -8
- package/src/packages/components/Table/standard/PlcCheck/PlcCheck.single.tsx +4 -5
- package/src/packages/components/Table/standard/PlcCheck/PlcCheck.tsx +2 -2
- package/src/packages/components/Table/standard/PlcCheck/PlcCheck.utils.ts +3 -3
- package/src/packages/components/Table/standard/PlcDraggier/PlcDraggier.tsx +2 -2
- package/src/packages/components/Table/standard/PlcExclusion.tsx +2 -2
- package/src/packages/components/Table/standard/PlcExpand.tsx +2 -2
- package/src/packages/components/Table/standard/PlcIndex.tsx +1 -1
- package/src/packages/components/Table/standard/PlcOperation/OuterOperation.tsx +3 -2
- package/src/packages/components/Table/standard/PlcOperation/PlcOperation.tsx +12 -6
- package/src/packages/components/Table/standard/PlcOperation/PlcOperation.utils.tsx +4 -4
- package/src/packages/components/Table/standard/PlcOperation/useOperationPermission.ts +1 -1
- package/src/packages/components/Table/standard/PlcTree/PlcTree.autoWidth.tsx +1 -1
- package/src/packages/components/Table/standard/PlcTree/PlcTree.renderNode.tsx +2 -2
- package/src/packages/components/Table/standard/PlcTree/PlcTree.tsx +4 -4
- package/src/packages/components/Table/standard/PlcTree/PlcTree.utils.ts +2 -2
- package/src/packages/components/Table/standard/PlcTree/PlcTreeHeader.tsx +3 -3
- package/src/packages/components/Table/standard/PlcTree/RenderPlcTreeNode.tsx +6 -5
- package/src/packages/components/Table/table/Table.tsx +14 -10
- package/src/packages/components/Table/table/body/cell.tsx +36 -5
- package/src/packages/components/Table/table/body/row.tsx +1 -1
- package/src/packages/components/Table/table/body/useCellValue.tsx +15 -6
- package/src/packages/components/Table/table/head/head-cell.tsx +8 -2
- package/src/packages/components/Table/table/head/useHeadCellResize.ts +4 -4
- package/src/packages/components/Table/table/node/useTableNode.tsx +2 -2
- package/src/packages/components/Table/table/table.scss +4 -0
- package/src/packages/components/Table/table/use/useFixedShadow.ts +2 -2
- package/src/packages/components/Table/table/use/useTableDraggier.col.tsx +6 -6
- package/src/packages/components/Table/table/use/useTableDraggier.row.tsx +7 -7
- package/src/packages/components/Table/table/use/useTableDraggier.tsx +3 -3
- package/src/packages/components/Table/table/use/useTableFormEditor.tsx +47 -39
- package/src/packages/components/Table/table/use/useTableLoading.tsx +2 -2
- package/src/packages/components/Table/table/use/useTableMethods.tsx +2 -2
- package/src/packages/components/Table/table/use/useTableModifyEditor.tsx +12 -6
- package/src/packages/components/Table/table/use/useTableScroll.tsx +1 -1
- package/src/packages/components/Table/table/utils/createTableHooks.ts +7 -5
- package/src/packages/components/Table/table/utils/table.utils.ts +7 -5
- package/src/packages/components/Tag/index.tsx +8 -3
- package/src/packages/components/Tag/tag.scss +10 -1
- package/src/packages/components/ThemeColor/index.tsx +1 -1
- package/src/packages/components/ThemeColorSelector/index.tsx +1 -1
- package/src/packages/components/ThemeDarkSelector/index.tsx +1 -2
- package/src/packages/components/ThemeEditor/index.tsx +3 -3
- package/src/packages/components/ThemeLocaleSelector/index.tsx +1 -2
- package/src/packages/components/ThemeShapeSelector/index.tsx +1 -2
- package/src/packages/components/ThemeSizeSelector/index.tsx +1 -2
- package/src/packages/components/TimePicker/createRangeTimeRender.tsx +3 -3
- package/src/packages/components/TimePicker/createSeparateRangeTimeRender.tsx +3 -3
- package/src/packages/components/TimePicker/createSingleTimeRender.tsx +7 -8
- package/src/packages/components/TimePicker/index.tsx +1 -1
- package/src/packages/components/TimePicker/panel/TimeBaseColumn.tsx +4 -4
- package/src/packages/components/TimePicker/panel/TimeBasePanel.tsx +1 -1
- package/src/packages/components/TimePicker/panel/TimePanel.tsx +2 -2
- package/src/packages/components/TimePicker/panel/TimeRangePanel.tsx +1 -1
- package/src/packages/components/TimePicker/panel/time-panel.utils.ts +1 -1
- package/src/packages/components/TimePicker/time.utils.ts +1 -1
- package/src/packages/components/TimePicker/useRangeTimeRender.tsx +9 -9
- package/src/packages/components/TimePicker/useTimeHooks.ts +1 -1
- package/src/packages/components/Toggle/index.tsx +4 -4
- package/src/packages/components/Tooltip/index.tsx +2 -2
- package/src/packages/components/Transition/index.tsx +2 -2
- package/src/packages/components/Tree/RenderTreeNode.tsx +4 -3
- package/src/packages/components/Tree/index.tsx +2 -2
- package/src/packages/components/TreeCore/TreeCore.type.tsx +3 -1
- package/src/packages/components/TreeCore/createTreeCore.tsx +3 -3
- package/src/packages/components/TreeCore/createTreeDraggier.tsx +9 -9
- package/src/packages/components/TreeCore/createTreeHooks.ts +1 -1
- package/src/packages/components/TreeCore/createTreeMethods.tsx +2 -2
- package/src/packages/components/TreeCore/createTreeNode.tsx +11 -6
- package/src/packages/components/TreeCore/createTreeProps.ts +4 -3
- package/src/packages/components/TreeCore/createTreeUtils.ts +2 -2
- package/src/packages/components/TreeNodeWithMenu/index.tsx +5 -1
- package/src/packages/components/TreeNodeWithMenu/treeNodeWithMenu.utils.ts +1 -1
- package/src/packages/components/Triangle/index.tsx +2 -2
- package/src/packages/components/Upload/index.tsx +6 -6
- package/src/packages/components/VirtualList/createVirtualDraggier.ts +7 -7
- package/src/packages/components/VirtualList/index.tsx +1 -1
- package/src/packages/components/VirtualList/useVirtualList.tsx +11 -11
- package/src/packages/components/VirtualTable/index.tsx +10 -4
- package/src/packages/components/VirtualTable/virtual-table.scss +3 -3
- package/src/packages/components/createPlainAddressService/index.tsx +2 -2
- package/src/packages/components/createRequestInterceptor/index.ts +2 -2
- package/src/packages/components/createScrollDraggier/index.ts +5 -5
- package/src/packages/components/createScrollUtils/index.tsx +1 -1
- package/src/packages/components/createSimpleDate/index.ts +49 -0
- package/src/packages/components/createTransitionHandler/index.ts +1 -1
- package/src/packages/components/useAutoScrollUtils/index.tsx +4 -4
- package/src/packages/components/useContextmenuOptions/index.tsx +40 -0
- package/src/packages/components/useDialog/DialogService.tsx +10 -10
- package/src/packages/components/useDialog/dialog.service.utils.tsx +5 -5
- package/src/packages/components/useDialog/index.tsx +4 -4
- package/src/packages/components/useImage/ImageService.tsx +5 -5
- package/src/packages/components/useLoading/LoadingService.tsx +3 -3
- package/src/packages/components/useLoading/index.tsx +1 -1
- package/src/packages/components/useLoading/loading.service.utils.tsx +2 -2
- package/src/packages/components/useMessage/Message.tsx +1 -1
- package/src/packages/components/useMessage/MessageContainer.tsx +1 -1
- package/src/packages/components/useMessage/MessageManager.tsx +1 -1
- package/src/packages/components/useMessage/index.tsx +1 -1
- package/src/packages/components/useMessage/message.service.utils.tsx +4 -4
- package/src/packages/components/useNotice/Notice.tsx +1 -1
- package/src/packages/components/useNotice/NoticeContainer.tsx +1 -1
- package/src/packages/components/useNotice/NoticeManager.tsx +1 -1
- package/src/packages/components/useNotice/index.tsx +1 -1
- package/src/packages/components/useNotice/noitice.service.utils.tsx +4 -4
- package/src/packages/components/usePageRenderContext/index.tsx +1 -1
- package/src/packages/components/usePopup/PopupItem.tsx +17 -10
- package/src/packages/components/usePopup/refresh/refreshArrow.ts +1 -1
- package/src/packages/components/usePopup/trigger/useManagerTrigger.clickOutside.tsx +19 -24
- package/src/packages/components/usePopup/trigger/usePopupTrigger.tsx +2 -2
- package/src/packages/components/usePopup/trigger/useReferenceTrigger.tsx +52 -46
- package/src/packages/components/usePopup/usePopup.tsx +2 -2
- package/src/packages/components/usePopup/usePopupManager.tsx +14 -3
- package/src/packages/components/usePopup/utils/createPopupManagerHooks.tsx +1 -1
- package/src/packages/components/usePopup/utils/ids2map.ts +1 -1
- package/src/packages/components/usePopup/utils/popup.utils.ts +3 -4
- package/src/packages/components/usePopupEditor/index.tsx +6 -9
- package/src/packages/components/usePopupEditor/popup-editor.utils.ts +1 -1
- package/src/packages/components/useTableFilter/index.ts +73 -0
- package/src/packages/components/useTooltip/index.tsx +6 -7
- package/src/packages/directives/ClickWave/index.tsx +2 -2
- package/src/packages/directives/ResizeDetector/index.tsx +2 -2
- package/src/packages/entry.tsx +326 -287
- package/src/packages/i18n/i18n.utils.ts +5 -5
- package/src/packages/i18n/lang/en-us.ts +37 -14
- package/src/packages/i18n/lang/zh-cn.ts +24 -1
- package/src/packages/styles/application/application.public.scss +7 -0
- package/src/packages/styles/global.import.scss +60 -15
- package/src/packages/uses/createInputPopperAttrs.ts +10 -3
- package/src/packages/uses/useCollapseStyles.tsx +2 -2
- package/src/packages/uses/useDragHorizontalScroll.ts +4 -5
- package/src/packages/uses/useEdit.ts +42 -15
- package/src/packages/uses/useFocusHandler.ts +26 -13
- package/src/packages/uses/useFunctionWrapper.ts +3 -1
- package/src/packages/uses/useMultipleModel.tsx +6 -4
- package/src/packages/uses/useRenderReference.tsx +1 -1
- package/src/packages/uses/useStyle.tsx +4 -4
- package/src/packages/utils/ClientZoom.ts +1 -1
- package/src/packages/utils/FixInput.ts +1 -1
- package/src/packages/utils/InnerTransition.ts +2 -2
- package/src/packages/utils/LoadingText.ts +1 -1
- package/src/packages/utils/OpenController.ts +1 -1
- package/src/packages/utils/constant.tsx +1 -1
- package/src/packages/utils/createDraggier.ts +7 -7
- package/src/packages/utils/createFlagManager.ts +1 -1
- package/src/packages/utils/findReactElement.tsx +1 -1
- package/src/packages/utils/getDeviceInfo.ts +1 -1
- package/src/packages/utils/getRowEl.ts +2 -2
- package/src/packages/utils/incrementalMerge.ts +1 -1
- package/src/packages/utils/inheritSlots.ts +3 -1
- package/src/packages/utils/installAllIcons.ts +20 -19
- package/src/packages/utils/installAllLazyIcons.ts +1 -1
- package/src/packages/utils/isObjectCommonMatch.ts +1 -1
- package/src/packages/utils/onParentElementsScroll.tsx +2 -2
- package/src/packages/utils/plainDate.ts +1 -1
- package/src/packages/utils/useMove.tsx +3 -3
- package/src/packages/utils/watchEffectAutoClear.ts +2 -2
- package/src/packages/components/KeyboardService/index.ts +0 -214
- package/src/packages/components/ThemeDarkSelector/theme-dark-selector.scss +0 -5
- package/src/packages/components/ThemeLocaleSelector/theme-locale-selector.scss +0 -5
- package/src/packages/components/ThemeShapeSelector/theme-shape-selector.scss +0 -5
- package/src/packages/components/ThemeSizeSelector/theme-size-selector.scss +0 -5
- package/src/packages/components/createProvider/index.ts +0 -5
- package/src/packages/utils/createProvider.tsx +0 -35
@@ -14,7 +14,7 @@
|
|
14
14
|
padding: 0 4px;
|
15
15
|
}
|
16
16
|
|
17
|
-
.#{componentName(loading)}, .#{componentName(icon)} {
|
17
|
+
& > .#{componentName(loading)}, & > .#{componentName(icon)}, & > .tag-close-wrapper {
|
18
18
|
&:last-child {
|
19
19
|
cursor: pointer;
|
20
20
|
margin-left: 4px;
|
@@ -24,4 +24,13 @@
|
|
24
24
|
margin-right: 4px !important;
|
25
25
|
}
|
26
26
|
}
|
27
|
+
|
28
|
+
.tag-close-wrapper {
|
29
|
+
vertical-align: middle;
|
30
|
+
height: 1em;
|
31
|
+
width: 1em;
|
32
|
+
display: inline-flex;
|
33
|
+
align-items: center;
|
34
|
+
justify-content: center;
|
35
|
+
}
|
27
36
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, designComponent, getComponentCls, useClasses, useStyles} from "
|
1
|
+
import {computed, designComponent, getComponentCls, useClasses, useStyles} from "@peryl/react-compose";
|
2
2
|
import {getPrimaryColor} from "../PageThemeUtils";
|
3
3
|
import './theme-color.scss';
|
4
4
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {designComponent, getComponentCls, useClassCache} from "
|
1
|
+
import {designComponent, getComponentCls, useClassCache} from "@peryl/react-compose";
|
2
2
|
import Dropdown from "../Dropdown";
|
3
3
|
import {ThemeColor} from "../ThemeColor";
|
4
4
|
import PageThemeUtils from "../PageThemeUtils";
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import {designComponent, getComponentCls, useClassCache} from "
|
1
|
+
import {designComponent, getComponentCls, useClassCache} from "@peryl/react-compose";
|
2
2
|
import i18n from "../i18n";
|
3
3
|
import Tooltip from "../Tooltip";
|
4
4
|
import PageThemeUtils from "../PageThemeUtils";
|
5
5
|
import Icon from "../Icon";
|
6
|
-
import './theme-dark-selector.scss';
|
7
6
|
|
8
7
|
export const ThemeDarkSelector = designComponent({
|
9
8
|
name: 'theme-dark-selector',
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import './theme-editor.scss';
|
2
|
-
import {designComponent, getComponentCls, iHTMLDivElement, onBeforeUnmount, reactive, useClasses, useRefs, useStyles} from "
|
2
|
+
import {designComponent, getComponentCls, iHTMLDivElement, onBeforeUnmount, reactive, useClasses, useRefs, useStyles} from "@peryl/react-compose";
|
3
3
|
import Icon from "../Icon";
|
4
4
|
import ApplicationConfigurationProvider from "../ApplicationConfigurationProvider";
|
5
|
-
import {unit} from "
|
5
|
+
import {unit} from "@peryl/utils/unit";
|
6
6
|
import {Select} from '../Select';
|
7
7
|
import {SelectOption} from "../SelectOption";
|
8
8
|
import PageThemeUtils, {ThemePrimaryColors} from "../PageThemeUtils";
|
9
9
|
import ClientZoom from "../ClientZoom";
|
10
|
-
import {addWindowListener} from '
|
10
|
+
import {addWindowListener} from '@peryl/utils/addWindowListener';
|
11
11
|
import i18n from "../i18n";
|
12
12
|
import Button from "../Button";
|
13
13
|
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import {designComponent, getComponentCls, useClassCache} from "
|
1
|
+
import {designComponent, getComponentCls, useClassCache} from "@peryl/react-compose";
|
2
2
|
import Dropdown from "../Dropdown";
|
3
3
|
import DropdownOption from "../DropdownOption";
|
4
4
|
import Icon from "../Icon";
|
5
5
|
import i18n from "../i18n";
|
6
|
-
import './theme-locale-selector.scss';
|
7
6
|
|
8
7
|
export const ThemeLocaleSelector = designComponent({
|
9
8
|
name: 'theme-locale-selector',
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import {computed, designComponent, getComponentCls, useClassCache} from "
|
1
|
+
import {computed, designComponent, getComponentCls, useClassCache} from "@peryl/react-compose";
|
2
2
|
import Dropdown from "../Dropdown";
|
3
3
|
import DropdownOption from "../DropdownOption";
|
4
4
|
import i18n from "../i18n";
|
5
5
|
import Icon from "../Icon";
|
6
6
|
import {ThemeShape} from "../../uses/useStyle";
|
7
7
|
import PageThemeUtils from "../PageThemeUtils";
|
8
|
-
import './theme-shape-selector.scss';
|
9
8
|
|
10
9
|
export const ThemeShapeSelector = designComponent({
|
11
10
|
name: 'theme-shape-selector',
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import {computed, designComponent, getComponentCls, useClassCache} from "
|
1
|
+
import {computed, designComponent, getComponentCls, useClassCache} from "@peryl/react-compose";
|
2
2
|
import Dropdown from "../Dropdown";
|
3
3
|
import DropdownOption from "../DropdownOption";
|
4
4
|
import i18n from "../i18n";
|
5
5
|
import Icon from "../Icon";
|
6
6
|
import PageThemeUtils from "../PageThemeUtils";
|
7
|
-
import './theme-size-selector.scss';
|
8
7
|
import {ThemeSize} from "../../uses/useStyle";
|
9
8
|
|
10
9
|
export const ThemeSizeSelector = designComponent({
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import Input from "../Input";
|
2
2
|
import {TimePanel} from "./panel/TimePanel";
|
3
3
|
import {tTimeCompositionParams} from "./time.utils";
|
4
|
-
import {handleKeyboard} from "
|
4
|
+
import {handleKeyboard} from "@peryl/utils/keyboard";
|
5
5
|
import {useRangeTimeRender} from "./useRangeTimeRender";
|
6
6
|
import {createPopupEditor} from "../usePopupEditor";
|
7
7
|
import {FixInput} from "../../utils/FixInput";
|
8
|
-
import {iKeyboardEvent} from "
|
8
|
+
import {iKeyboardEvent} from "@peryl/react-compose";
|
9
9
|
import {renderInputModeTextRangeValue} from "../../utils/renderInputModeTextRangeValue";
|
10
10
|
|
11
11
|
export function createRangeTimeRender(params: tTimeCompositionParams,) {
|
@@ -48,7 +48,7 @@ export function createRangeTimeRender(params: tTimeCompositionParams,) {
|
|
48
48
|
* @author 韦胜健
|
49
49
|
* @date 2022.7.3 19:29
|
50
50
|
*/
|
51
|
-
onKeyboardInput: (e: iKeyboardEvent) => handleKeyboard({
|
51
|
+
onKeyboardInput: (e: iKeyboardEvent) => handleKeyboard<iKeyboardEvent>({
|
52
52
|
enter: () => popper.methods.toggle(),
|
53
53
|
esc: () => popper.methods.hide(),
|
54
54
|
})(e),
|
@@ -2,11 +2,11 @@ import {tTimeCompositionParams} from "./time.utils";
|
|
2
2
|
import Input from "../Input";
|
3
3
|
import {TimeRangePanelType} from "./panel/TimeRangePanel";
|
4
4
|
import {TimePanel} from "./panel/TimePanel";
|
5
|
-
import {handleKeyboard} from "
|
5
|
+
import {handleKeyboard} from "@peryl/utils/keyboard";
|
6
6
|
import {useRangeTimeRender} from "./useRangeTimeRender";
|
7
7
|
import {createPopupEditor} from "../usePopupEditor";
|
8
8
|
import {FixInput} from "../../utils/FixInput";
|
9
|
-
import {iKeyboardEvent} from "
|
9
|
+
import {iKeyboardEvent} from "@peryl/react-compose";
|
10
10
|
import {renderInputModeTextRangeValue} from "../../utils/renderInputModeTextRangeValue";
|
11
11
|
|
12
12
|
export function createSeparateRangeTimeRender(params: tTimeCompositionParams) {
|
@@ -71,7 +71,7 @@ export function createSeparateRangeTimeRender(params: tTimeCompositionParams) {
|
|
71
71
|
* @author 韦胜健
|
72
72
|
* @date 2022.7.3 19:29
|
73
73
|
*/
|
74
|
-
onKeyboardInput: (e: iKeyboardEvent, range: TimeRangePanelType) => handleKeyboard({
|
74
|
+
onKeyboardInput: (e: iKeyboardEvent, range: TimeRangePanelType) => handleKeyboard<iKeyboardEvent>({
|
75
75
|
enter: () => {
|
76
76
|
utils.handleRangeType({ range, start: () => startPopper.methods.toggle(), end: () => endPopper.methods.toggle() });
|
77
77
|
},
|
@@ -1,22 +1,21 @@
|
|
1
1
|
import {TimePanel} from "./panel/TimePanel";
|
2
2
|
import Input from "../Input";
|
3
|
-
import {
|
4
|
-
import {delay} from "
|
3
|
+
import {createEffectsOfReaction, getComponentCls, reactive, useModel, useRefs} from "@peryl/react-compose";
|
4
|
+
import {delay} from "@peryl/utils/delay";
|
5
5
|
import {PDate, plainDate} from "../../utils/plainDate";
|
6
6
|
import {limitDatetimeTimePlainData, TimeLayoutToFormat, tTimeCompositionParams} from "./time.utils";
|
7
7
|
import {TimePanelLayout} from "./panel/TimeBasePanel";
|
8
|
-
import {debounce} from "
|
8
|
+
import {debounce} from "@peryl/utils/debounce";
|
9
9
|
import {useRenderReference} from "../../uses/useRenderReference";
|
10
|
-
import {createEffects} from "plain-utils/utils/createEffects";
|
11
10
|
import {createPopupEditor} from "../usePopupEditor";
|
12
11
|
|
13
12
|
export function createSingleTimeRender({ emit, props, hooks, displayPattern, today, maxmin, editComputed, slots, getPublicPopperAttrs, getInheritPublicTimeAttrs, formatString }: tTimeCompositionParams) {
|
14
13
|
|
15
|
-
const { effects } =
|
16
|
-
const { refs, onRef } = useRefs({ input: Input });
|
14
|
+
const { effects, effectComputed } = createEffectsOfReaction();
|
15
|
+
const { refs, onRef } = useRefs({ input: Input }, { effects });
|
17
16
|
const reference = useRenderReference();
|
18
|
-
const model = useModel(() => props.modelValue, emit.onUpdateModelValue, { onChange: () => delay().then(() => state.input = format.value?.getDisplay()) });
|
19
|
-
const format =
|
17
|
+
const model = useModel(() => props.modelValue, emit.onUpdateModelValue, { onChange: () => delay().then(() => state.input = format.value?.getDisplay()) }, effects);
|
18
|
+
const format = effectComputed((): null | PDate => !model.value ? null : plainDate(model.value, formatString.value));
|
20
19
|
const state = reactive({
|
21
20
|
input: format.value?.getDisplay(),
|
22
21
|
hoverColumnType: null as null | TimePanelLayout,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, designComponent} from "
|
1
|
+
import {computed, designComponent} from "@peryl/react-compose";
|
2
2
|
import {TimeBaseColumn} from "./panel/TimeBaseColumn";
|
3
3
|
import {TimeBasePanel} from "./panel/TimeBasePanel";
|
4
4
|
import {TimePanel} from "./panel/TimePanel";
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {classnames, computed, designComponent, getComponentCls, iHTMLDivElement, onMounted, PropType, useModel, useRefList, useRefs} from '
|
1
|
+
import {classnames, computed, designComponent, getComponentCls, iHTMLDivElement, onMounted, PropType, useModel, useRefList, useRefs} from '@peryl/react-compose';
|
2
2
|
import './time-base-column.scss';
|
3
|
-
import {zeroize} from "
|
4
|
-
import {delay} from "
|
5
|
-
import {findOne} from "
|
3
|
+
import {zeroize} from "@peryl/utils/zeroize";
|
4
|
+
import {delay} from "@peryl/utils/delay";
|
5
|
+
import {findOne} from "@peryl/utils/findOne";
|
6
6
|
import {EditProps, useEdit} from "../../../uses/useEdit";
|
7
7
|
import Scroll from "../../Scroll";
|
8
8
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, designComponent, getComponentCls} from '
|
1
|
+
import {computed, designComponent, getComponentCls} from '@peryl/react-compose';
|
2
2
|
import './time-base-panel.scss';
|
3
3
|
import {TimePublicProps} from "./time-panel.utils";
|
4
4
|
import {plainDate} from "../../../utils/plainDate";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import './time-range-panel.scss';
|
2
2
|
import {TimePublicProps} from "./time-panel.utils";
|
3
|
-
import {computed, designComponent, iMouseEvent, PropType, RenderNode, useModel} from "
|
3
|
+
import {computed, designComponent, iMouseEvent, PropType, RenderNode, useModel} from "@peryl/react-compose";
|
4
4
|
import TimeRangePanel, {TimeRangePanelType} from "./TimeRangePanel";
|
5
|
-
import {delay} from "
|
5
|
+
import {delay} from "@peryl/utils/delay";
|
6
6
|
import TimeBasePanel, {TimePanelLayout} from "./TimeBasePanel";
|
7
7
|
|
8
8
|
export const TimePanelProps = {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, designComponent, getComponentCls, useModel} from "
|
1
|
+
import {computed, designComponent, getComponentCls, useModel} from "@peryl/react-compose";
|
2
2
|
import {TimePublicProps} from "./time-panel.utils";
|
3
3
|
import {plainDate} from "../../../utils/plainDate";
|
4
4
|
import {TimeBasePanel, TimePanelLayout} from "./TimeBasePanel";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {useTimeHooks} from "./useTimeHooks";
|
2
2
|
import {PDate} from "../../utils/plainDate";
|
3
|
-
import {ComponentEvent, ComponentPropsType, computed, ExtractPropTypes, PropType, tSlotsType} from "
|
3
|
+
import {ComponentEvent, ComponentPropsType, computed, ExtractPropTypes, PropType, tSlotsType} from "@peryl/react-compose";
|
4
4
|
import {EditProps, tEditComputed} from "../../uses/useEdit";
|
5
5
|
import {StyleProps, tStyleComputed} from "../../uses/useStyle";
|
6
6
|
import {TimePanelProps} from "./panel/TimePanel";
|
@@ -1,23 +1,23 @@
|
|
1
|
-
import {
|
1
|
+
import {createEffectsOfReaction, getComponentCls, iHTMLInputElement, reactive, useModel, useRefs} from "@peryl/react-compose";
|
2
2
|
import Input from "../Input";
|
3
|
-
import {delay} from "
|
3
|
+
import {delay} from "@peryl/utils/delay";
|
4
4
|
import {useFocusHandler} from "../../uses/useFocusHandler";
|
5
5
|
import {PDate, plainDate} from "../../utils/plainDate";
|
6
6
|
import {TimePanelLayout} from "./panel/TimeBasePanel";
|
7
7
|
import {TimeRangePanelType} from "./panel/TimeRangePanel";
|
8
8
|
import {limitDatetimeTimePlainData, TimeLayoutToFormat, tTimeCompositionParams} from "./time.utils";
|
9
|
-
import {debounce} from "
|
9
|
+
import {debounce} from "@peryl/utils/debounce";
|
10
10
|
import {useRenderReference} from "../../uses/useRenderReference";
|
11
|
-
import {createEffects} from "plain-utils/utils/createEffects";
|
12
11
|
|
13
12
|
export function useRangeTimeRender({ props, emit, onBlur, slots, displayPattern, today, onInputClear, maxmin, formatString }: tTimeCompositionParams & { onBlur: () => void, onInputClear?: (range: TimeRangePanelType) => void, }) {
|
14
|
-
const { effects } =
|
15
|
-
const { refs, onRef } = useRefs({ input: Input, start: iHTMLInputElement, end: iHTMLInputElement, });
|
13
|
+
const { effects, effectComputed } = createEffectsOfReaction();
|
14
|
+
const { refs, onRef } = useRefs({ input: Input, start: iHTMLInputElement, end: iHTMLInputElement, }, { effects });
|
16
15
|
const reference = useRenderReference();
|
17
|
-
const startModel = useModel(() => props.start, emit.onUpdateStart, { onChange: () => delay().then(() => state.input.start = format.value.start?.getDisplay()) });
|
18
|
-
const endModel = useModel(() => props.end, emit.onUpdateEnd, { onChange: () => delay().then(() => state.input.end = format.value.end?.getDisplay()) });
|
16
|
+
const startModel = useModel(() => props.start, emit.onUpdateStart, { onChange: () => delay().then(() => state.input.start = format.value.start?.getDisplay()) }, effects);
|
17
|
+
const endModel = useModel(() => props.end, emit.onUpdateEnd, { onChange: () => delay().then(() => state.input.end = format.value.end?.getDisplay()) }, effects);
|
19
18
|
|
20
19
|
const { isFocus } = useFocusHandler({
|
20
|
+
effects,
|
21
21
|
getEls: () => [refs.start, refs.end],
|
22
22
|
/**
|
23
23
|
* Input失去焦点事件,将文本框的值重置为display的值,以避免显示输入不正确的值
|
@@ -33,7 +33,7 @@ export function useRangeTimeRender({ props, emit, onBlur, slots, displayPattern,
|
|
33
33
|
onFocus: emit.onFocus,
|
34
34
|
});
|
35
35
|
|
36
|
-
const format =
|
36
|
+
const format = effectComputed((): { start: null | PDate, end: null | PDate } => ({
|
37
37
|
start: !startModel.value ? null : plainDate(startModel.value, formatString.value),
|
38
38
|
end: !endModel.value ? null : plainDate(endModel.value, formatString.value),
|
39
39
|
}));
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import {computed, designComponent, getComponentCls, iFocusEvent, iKeyboardEvent, iMouseEvent, reactive, useClasses, useModel, useRefs} from "
|
1
|
+
import {computed, designComponent, getComponentCls, iFocusEvent, iKeyboardEvent, iMouseEvent, reactive, useClasses, useModel, useRefs} from "@peryl/react-compose";
|
2
2
|
import {useClickWave} from "../../directives/ClickWave";
|
3
3
|
import './toggle.scss';
|
4
4
|
import {EditProps, useEdit} from "../../uses/useEdit";
|
5
5
|
import {StyleProps, ThemeStatus, useStyle} from "../../uses/useStyle";
|
6
|
-
import {
|
6
|
+
import {eKeyboardKeys, getKeyNameByKeyboardEvent} from "@peryl/utils/keyboard";
|
7
7
|
import i18n from "../i18n";
|
8
8
|
|
9
9
|
export const Toggle = designComponent({
|
@@ -79,8 +79,8 @@ export const Toggle = designComponent({
|
|
79
79
|
emit.onClick(e);
|
80
80
|
},
|
81
81
|
keydown: (e: iKeyboardEvent) => {
|
82
|
-
const key =
|
83
|
-
if (key ===
|
82
|
+
const key = getKeyNameByKeyboardEvent(e);
|
83
|
+
if (key === eKeyboardKeys.space || key === eKeyboardKeys.enter) {
|
84
84
|
e.preventDefault();
|
85
85
|
e.stopPropagation();
|
86
86
|
handler.click(e as any);
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {designComponent, getComponentCls, mergeAttrs, nextTick, onMounted, onUpdated, PropType, reactive, useClasses, useModel, useRefs, watch} from "
|
2
|
-
import {debounce} from "
|
1
|
+
import {designComponent, getComponentCls, mergeAttrs, nextTick, onMounted, onUpdated, PropType, reactive, useClasses, useModel, useRefs, watch} from "@peryl/react-compose";
|
2
|
+
import {debounce} from "@peryl/utils/debounce";
|
3
3
|
import './tooltip.scss';
|
4
4
|
import {ThemeSize} from "../../uses/useStyle";
|
5
5
|
import {Popup} from "../Popup";
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {designClassComponent, designComponent, onBeforeMount, PropType, useReference} from "
|
2
|
-
import {createCounter} from '
|
1
|
+
import {designClassComponent, designComponent, onBeforeMount, PropType, useReference} from "@peryl/react-compose";
|
2
|
+
import {createCounter} from '@peryl/utils/createCounter';
|
3
3
|
import React from "react";
|
4
4
|
import {CSSTransition, SwitchTransition} from "react-transition-group";
|
5
5
|
import {findDOMNode} from "react-dom";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {cacheComputed, classnames, computed, designComponent, getComponentCls, iHTMLDivElement, iMouseEvent, PropType, useClasses, useRefs} from "
|
1
|
+
import {cacheComputed, classnames, computed, designComponent, getComponentCls, iHTMLDivElement, iMouseEvent, PropType, useClasses, useRefs} from "@peryl/react-compose";
|
2
2
|
import {Tree} from "./index";
|
3
3
|
import {iTreeNode} from "../TreeCore/createTreeNode";
|
4
4
|
import {Loading} from "../Loading";
|
@@ -33,7 +33,7 @@ export const RenderTreeNode = designComponent({
|
|
33
33
|
const classes = useClasses(() => [
|
34
34
|
getComponentCls('tree-node'),
|
35
35
|
{
|
36
|
-
'tree-node-current': tree.state.current === props.treeNode.key,
|
36
|
+
'tree-node-current': !tree.props.disableCurrent && tree.state.current === props.treeNode.key,
|
37
37
|
'tree-node-lead': isLeaf.value,
|
38
38
|
'tree-node-single-check': !props.multiple && props.treeNode.checkStatus() === CheckboxStatus.check,
|
39
39
|
'tree-node-multi-check': props.multiple && props.treeNode.checkStatus() === CheckboxStatus.check,
|
@@ -44,6 +44,7 @@ export const RenderTreeNode = designComponent({
|
|
44
44
|
const checkStatus = cacheComputed(() => props.treeNode.checkStatus());
|
45
45
|
const isExpanded = cacheComputed(() => props.treeNode.isExpanded());
|
46
46
|
const isLeaf = cacheComputed(() => props.treeNode.isLeaf());
|
47
|
+
const leafIcon = computed(() => props.treeNode.leafIcon());
|
47
48
|
|
48
49
|
const connectorClassesList = computed(() => {
|
49
50
|
|
@@ -124,7 +125,7 @@ export const RenderTreeNode = designComponent({
|
|
124
125
|
props.treeNode.isLoading() ?
|
125
126
|
<Loading type="gamma"/> :
|
126
127
|
<Icon
|
127
|
-
icon={props.treeNode.isLeaf() || props.treeNode.empty ?
|
128
|
+
icon={props.treeNode.isLeaf() || props.treeNode.empty ? leafIcon.value : isExpanded.value ? tree.props.folderExpandIcon : tree.props.folderCollapseIcon}
|
128
129
|
/>
|
129
130
|
}
|
130
131
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {designComponent, getComponentCls, mergeAttrs, onBeforeUnmount, onMounted, PropType, useClasses} from "
|
1
|
+
import {designComponent, getComponentCls, mergeAttrs, onBeforeUnmount, onMounted, PropType, useClasses} from "@peryl/react-compose";
|
2
2
|
import {TreeEmitOptions, TreePropsOptions} from "../TreeCore/createTreeProps";
|
3
3
|
import {createTreeCore} from "../TreeCore/createTreeCore";
|
4
4
|
import {RenderTreeNode} from "./RenderTreeNode";
|
@@ -10,7 +10,7 @@ import {TreeScopeSlotsOption, TreeSlotsOption} from "../TreeCore/TreeCore.type";
|
|
10
10
|
import {StyleProps, useStyle} from "../../uses/useStyle";
|
11
11
|
import {Empty} from "../Empty";
|
12
12
|
import {LoadingMask} from "../LoadingMask";
|
13
|
-
import {PlainObject} from "
|
13
|
+
import {PlainObject} from "@peryl/utils/event";
|
14
14
|
|
15
15
|
export const Tree = designComponent({
|
16
16
|
name: '-tree',
|
@@ -35,6 +35,8 @@ export interface iTreeProps {
|
|
35
35
|
getChildrenData?: (treeNode: iTreeNode | null) => Promise<any[] | null>,
|
36
36
|
/*当前高亮的选中行,单选时这个值与modelValue逻辑一致*/
|
37
37
|
current?: string,
|
38
|
+
/*禁用高亮当前选中行*/
|
39
|
+
disableCurrent?: boolean,
|
38
40
|
/*是否为多选*/
|
39
41
|
multiple?: boolean,
|
40
42
|
/*单选的时候绑定值类型,last点击的最后一个节点,all所有父子节点*/
|
@@ -70,7 +72,7 @@ export interface iTreeProps {
|
|
70
72
|
/*判断节点是否可以放置*/
|
71
73
|
isAllowDroppable?: (startNode: iTreeNode, moveNode: iTreeNode, dropType: typeof eTreeDropType.TYPE) => boolean | void,
|
72
74
|
/*叶子节点图标*/
|
73
|
-
leafIcon: string,
|
75
|
+
leafIcon: string | ((treeNode: iTreeNode) => string),
|
74
76
|
/*节点收起时显示图标*/
|
75
77
|
folderCollapseIcon: string,
|
76
78
|
/*节点展开时显示的图标*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, ComputedRef, reactive, useModel, useRefs, watchEffect} from "
|
1
|
+
import {computed, ComputedRef, reactive, useModel, useRefs, watchEffect} from "@peryl/react-compose";
|
2
2
|
import {iTreeNodeComputedData, iTreeProps, iTreeState} from "./TreeCore.type";
|
3
3
|
import {createTreeUtils} from "./createTreeUtils";
|
4
4
|
import {formatNodeData2TreeNode} from "./fromatNodeData";
|
@@ -10,8 +10,8 @@ import {CheckboxStatus} from "../../utils/constant";
|
|
10
10
|
import {createTreeDraggier} from "./createTreeDraggier";
|
11
11
|
import {VirtualList} from "../VirtualList";
|
12
12
|
import {Scroll} from "../Scroll";
|
13
|
-
import {createEffects} from "
|
14
|
-
import {toArray} from "
|
13
|
+
import {createEffects} from "@peryl/utils/createEffects";
|
14
|
+
import {toArray} from "@peryl/utils/toArray";
|
15
15
|
|
16
16
|
export function createTreeCore(
|
17
17
|
{
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import Scroll from "../Scroll";
|
2
2
|
import {iTreeNode} from "./createTreeNode";
|
3
|
-
import {createEnum} from "
|
3
|
+
import {createEnum} from "@peryl/utils/createEnum";
|
4
4
|
import {iTreeMethods} from "./createTreeMethods";
|
5
|
-
import {getComponentCls, iMouseEvent, nextTick, reactive} from "
|
5
|
+
import {getComponentCls, iMouseEvent, nextTick, reactive} from "@peryl/react-compose";
|
6
6
|
import {iElementRect} from "../../utils/getRowEl";
|
7
7
|
import {iTreeUtils} from "./createTreeUtils";
|
8
|
-
import {createEffects} from "
|
8
|
+
import {createEffects} from "@peryl/utils/createEffects";
|
9
9
|
import {useAutoScrollUtils} from "../useAutoScrollUtils";
|
10
|
-
import {findParentElement} from "
|
11
|
-
import {hasClass} from "
|
12
|
-
import {disabledUserSelect} from "
|
13
|
-
import {enableUserSelect} from "
|
10
|
+
import {findParentElement} from "@peryl/utils/findParentElement";
|
11
|
+
import {hasClass} from "@peryl/utils/hasClass";
|
12
|
+
import {disabledUserSelect} from "@peryl/utils/disabledUserSelect";
|
13
|
+
import {enableUserSelect} from "@peryl/utils/enableUserSelect";
|
14
14
|
import {onParentElementsScroll} from "../../utils/onParentElementsScroll";
|
15
|
-
import {addClass} from "
|
15
|
+
import {addClass} from "@peryl/utils/addClass";
|
16
16
|
import {iTreeHooks} from "./createTreeHooks";
|
17
17
|
import {ClientZoom} from "../ClientZoom";
|
18
|
-
import {delay} from "
|
18
|
+
import {delay} from "@peryl/utils/delay";
|
19
19
|
|
20
20
|
export function createTreeDraggier(
|
21
21
|
{
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import {iTreeUtils} from "./createTreeUtils";
|
2
2
|
import {iTreeKeyOrNode, iTreeProps, iTreeState} from "./TreeCore.type";
|
3
|
-
import {nextTick, toRaw} from "
|
3
|
+
import {nextTick, toRaw} from "@peryl/react-compose";
|
4
4
|
import {CheckboxStatus} from "../../utils/constant";
|
5
|
-
import {toArray} from "
|
5
|
+
import {toArray} from "@peryl/utils/toArray";
|
6
6
|
import {iTreeNode} from "./createTreeNode";
|
7
7
|
|
8
8
|
export function createTreeMethods(
|
@@ -53,11 +53,11 @@ export function createTreeNode(
|
|
53
53
|
/*设置子节点数据*/
|
54
54
|
const setChildrenData = (childrenData: any[] | null | undefined) => {
|
55
55
|
const { childrenField, setChildrenData } = props;
|
56
|
-
if (
|
57
|
-
(data
|
56
|
+
if (!!setChildrenData) {
|
57
|
+
setChildrenData(data, childrenData);
|
58
58
|
} else {
|
59
|
-
if (
|
60
|
-
|
59
|
+
if (typeof childrenField === "string") {
|
60
|
+
(data as any)[childrenField] = childrenData;
|
61
61
|
} else {
|
62
62
|
throw new Error('tree: props.setChildrenData is required when childrenField is function');
|
63
63
|
}
|
@@ -112,6 +112,8 @@ export function createTreeNode(
|
|
112
112
|
/*默认情况下,没有设置isLeaf来判断节点是否为叶子节点的话,则判断是否存在有子节点数据来判断是否为叶子节点,如果子节点数据是一个空数组也视为非叶子节点*/
|
113
113
|
return !props.isLeaf ? !childrenData() : props.isLeaf(data);
|
114
114
|
};
|
115
|
+
/*叶子节点的图标*/
|
116
|
+
const leafIcon = () => {return typeof props.leafIcon === "string" ? props.leafIcon : props.leafIcon(self);};
|
115
117
|
/*是否已经选中*/
|
116
118
|
const checkStatus = (): typeof CheckboxStatus.TYPE => getCheckStatus()[key];
|
117
119
|
/*是否可选中*/
|
@@ -134,8 +136,9 @@ export function createTreeNode(
|
|
134
136
|
};
|
135
137
|
/*当前节点的文本是否匹配搜索关键词*/
|
136
138
|
const isMatchSearch = () => {
|
139
|
+
if (empty) {return false;}
|
137
140
|
const { filterMethod, filterText } = props;
|
138
|
-
if (filterText == null) {
|
141
|
+
if (filterText == null || !filterText.trim().length) {
|
139
142
|
return true;
|
140
143
|
}
|
141
144
|
const label = self.label();
|
@@ -152,7 +155,7 @@ export function createTreeNode(
|
|
152
155
|
return true;
|
153
156
|
}
|
154
157
|
/*当前节点有子节点匹配搜索关键词*/
|
155
|
-
const children = self.children();
|
158
|
+
const children = self.children().filter(i => !i.empty);
|
156
159
|
if (!!children && children.length > 0 && children.some(i => i.isPassFilter())) {
|
157
160
|
return true;
|
158
161
|
}
|
@@ -194,6 +197,7 @@ export function createTreeNode(
|
|
194
197
|
setChildrenData,
|
195
198
|
children,
|
196
199
|
isLeaf,
|
200
|
+
leafIcon,
|
197
201
|
checkStatus,
|
198
202
|
isCheckAble,
|
199
203
|
isExpanded,
|
@@ -225,6 +229,7 @@ export interface iTreeNode {
|
|
225
229
|
setChildrenData: (childrenData: any[] | null | undefined) => void, // 设置节点子数据
|
226
230
|
children: () => iTreeNode[], // 子节点
|
227
231
|
isLeaf: () => boolean, // 节点是否为叶子节点
|
232
|
+
leafIcon: () => string, // 叶子节点的图标
|
228
233
|
checkStatus: () => typeof CheckboxStatus.TYPE, // 节点的选中状态,check选中,uncheck未选中,minus半选
|
229
234
|
isCheckAble: () => boolean, // 节点是否可以选中
|
230
235
|
isExpanded: () => boolean, // 节点是否已经展开
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {ComponentEvent, PropType} from "
|
1
|
+
import {ComponentEvent, PropType} from "@peryl/react-compose";
|
2
2
|
import {iTreeProps} from "./TreeCore.type";
|
3
3
|
import {iTreeNode} from "./createTreeNode";
|
4
|
-
import {PlainObject} from "
|
4
|
+
import {PlainObject} from "@peryl/utils/event";
|
5
5
|
|
6
6
|
export const TreePropsOptions = {
|
7
7
|
data: { type: Array as PropType<iTreeProps["data"]> },
|
@@ -15,6 +15,7 @@ export const TreePropsOptions = {
|
|
15
15
|
lazy: { type: Boolean as PropType<iTreeProps["lazy"]> },
|
16
16
|
getChildrenData: { type: Function as PropType<iTreeProps["getChildrenData"]> },
|
17
17
|
current: { type: String as PropType<iTreeProps["current"]> },
|
18
|
+
disableCurrent: { type: Boolean as PropType<iTreeProps["disableCurrent"]> },
|
18
19
|
multiple: { type: Boolean as PropType<iTreeProps["multiple"]> },
|
19
20
|
singleValueType: { type: String as PropType<iTreeProps['singleValueType']> },
|
20
21
|
checkLast: { type: Boolean as PropType<iTreeProps['checkLast']>, default: null },
|
@@ -32,7 +33,7 @@ export const TreePropsOptions = {
|
|
32
33
|
customDraggier: { type: Boolean as PropType<iTreeProps["customDraggier"]> },
|
33
34
|
isAllowDraggable: { type: Function as PropType<iTreeProps["isAllowDraggable"]> },
|
34
35
|
isAllowDroppable: { type: Function as PropType<iTreeProps["isAllowDroppable"]> },
|
35
|
-
leafIcon: { type: String as PropType<iTreeProps["leafIcon"]>, default: 'pi-drive-file' as string },
|
36
|
+
leafIcon: { type: [String, Function] as PropType<iTreeProps["leafIcon"]>, default: 'pi-drive-file' as string },
|
36
37
|
folderCollapseIcon: { type: String as PropType<iTreeProps["folderCollapseIcon"]>, default: 'pi-caret-right' as string },
|
37
38
|
folderExpandIcon: { type: String as PropType<iTreeProps["folderExpandIcon"]>, default: 'pi-down' as string },
|
38
39
|
expanderCover: { type: Boolean as PropType<iTreeProps["expanderCover"]>, default: true },
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {iTreeKeyOrNode, iTreeNodeComputedData, iTreeProps} from "./TreeCore.type";
|
2
2
|
import {iTreeNode} from "./createTreeNode";
|
3
|
-
import {toArray} from "
|
4
|
-
import {iterate as utilsIterate} from "
|
3
|
+
import {toArray} from "@peryl/utils/toArray";
|
4
|
+
import {iterate as utilsIterate} from "@peryl/utils/iterate";
|
5
5
|
import {eTreeDropType} from "./createTreeDraggier";
|
6
6
|
|
7
7
|
export function createTreeUtils(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {cacheComputed, ComponentPropsType, computed, designComponent, getComponentCls, iHTMLDivElement, iMouseEvent, PropType, useClassCache, useRefs} from "
|
1
|
+
import {cacheComputed, ComponentPropsType, computed, designComponent, getComponentCls, iHTMLDivElement, iMouseEvent, PropType, useClassCache, useRefs} from "@peryl/react-compose";
|
2
2
|
import {Icon} from "../Icon";
|
3
3
|
import {iTreeNode} from "../TreeCore/createTreeNode";
|
4
4
|
import './tree-node-with-menu.scss';
|
@@ -14,6 +14,7 @@ export const TreeNodeWithMenu = designComponent({
|
|
14
14
|
treeNode: { type: Object as PropType<iTreeNode>, required: true },
|
15
15
|
dropdownOptions: { type: Array as PropType<iTreeNodeWithMenuOption[]> },
|
16
16
|
dropdownAttrs: { type: Object as PropType<ComponentPropsType<typeof Dropdown>> },
|
17
|
+
hideButton: { type: Boolean },
|
17
18
|
},
|
18
19
|
setup({ props }) {
|
19
20
|
|
@@ -56,6 +57,9 @@ export const TreeNodeWithMenu = designComponent({
|
|
56
57
|
<div className={classes.value}>
|
57
58
|
<div className="tree-node-with-menu-content" ref={onRef.content}>{props.treeNode.label()}</div>
|
58
59
|
{(() => {
|
60
|
+
if (props.hideButton) {
|
61
|
+
return;
|
62
|
+
}
|
59
63
|
let btn = (
|
60
64
|
<div className="tree-node-with-menu-button" onMouseDown={handler.onMousedownDraggier.value}>
|
61
65
|
<Icon icon="pi-drag-dot-vertical"/>
|