cnhis-design-vue 3.1.18-beta.4 → 3.1.18-beta.7
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/components/annotation-edit/index.js +1 -10
- package/es/components/annotation-edit/index2.js +10 -0
- package/es/components/big-table/index.d.ts +47 -98
- package/es/components/big-table/index.js +2 -17
- package/es/components/big-table/index2.js +19 -0
- package/es/components/big-table/src/BigTable.vue.d.ts +63 -99
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +13 -13
- package/es/components/big-table/src/bigTableEmits.js +1 -53
- package/es/components/big-table/src/bigTableEmits2.js +53 -0
- package/es/components/big-table/src/bigTableProps.js +1 -119
- package/es/components/big-table/src/bigTableProps2.js +119 -0
- package/es/components/big-table/src/bigTableState.js +1 -62
- package/es/components/big-table/src/bigTableState2.js +62 -0
- package/es/components/big-table/src/components/edit-form/edit-date.js +2 -2
- package/es/components/big-table/src/components/edit-form/edit-input.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-separate.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.d.ts +6 -16
- package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/components/big-table/src/components/edit-form/useCommon.js +1 -19
- package/es/components/big-table/src/components/edit-form/useCommon2.js +19 -0
- package/es/components/big-table/src/components/input-button.vue.d.ts +28 -37
- package/es/components/big-table/src/components/separate.js +1 -1
- package/es/components/big-table/src/constants/index.js +1 -3
- package/es/components/big-table/src/constants/index2.js +3 -0
- package/es/components/big-table/src/hooks/export.js +1 -1
- package/es/components/big-table/src/hooks/index.js +8 -8
- package/es/components/big-table/src/hooks/useAnchor.js +1 -49
- package/es/components/big-table/src/hooks/useAnchor2.js +49 -0
- package/es/components/big-table/src/hooks/useAnnotation.js +1 -1
- package/es/components/big-table/src/hooks/useBatchEditing.js +1 -289
- package/es/components/big-table/src/hooks/useBatchEditing2.js +289 -0
- package/es/components/big-table/src/hooks/useColumnConfigAdaptor.js +1 -154
- package/es/components/big-table/src/hooks/useColumnConfigAdaptor2.js +154 -0
- package/es/components/big-table/src/hooks/useEdit.d.ts +6 -16
- package/es/components/big-table/src/hooks/useEdit.js +1 -122
- package/es/components/big-table/src/hooks/useEdit2.js +122 -0
- package/es/components/big-table/src/hooks/useEvent.js +1 -72
- package/es/components/big-table/src/hooks/useEvent2.js +72 -0
- package/es/components/big-table/src/hooks/useFormat.js +1 -492
- package/es/components/big-table/src/hooks/useFormat2.js +492 -0
- package/es/components/big-table/src/hooks/useNestTable.js +1 -86
- package/es/components/big-table/src/hooks/useNestTable2.js +86 -0
- package/es/components/big-table/src/hooks/useSeparateRow.js +1 -164
- package/es/components/big-table/src/hooks/useSeparateRow2.js +164 -0
- package/es/components/big-table/src/hooks/useTableParse.js +1 -136
- package/es/components/big-table/src/hooks/useTableParse2.js +136 -0
- package/es/components/big-table/src/utils.js +1 -630
- package/es/components/big-table/src/utils2.js +630 -0
- package/es/components/bpmn-workflow/index.js +1 -10
- package/es/components/bpmn-workflow/index2.js +10 -0
- package/es/{packages/components → components}/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/{packages/components → components}/bpmn-workflow/types/BpmnViewer.d.ts +0 -0
- package/es/{packages/components → components}/bpmn-workflow/types/ModelingModule.d.ts +0 -0
- package/es/{packages/components → components}/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -0
- package/es/components/button-print/index.d.ts +113 -190
- package/es/components/button-print/index.js +2 -11
- package/es/components/button-print/index2.js +11 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +113 -190
- package/es/components/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/components/button-print/src/components/IdentityVerification.js +2 -1
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +59 -117
- package/es/components/button-print/src/utils/dialog.d.ts +6 -0
- package/es/components/button-print/src/utils/dialog.js +65 -0
- package/es/components/button-print/src/utils/index.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +6 -0
- package/es/components/button-print/src/utils/print.js +1 -325
- package/es/components/button-print/src/utils/print2.js +330 -0
- package/es/components/chunk-upload/index.d.ts +22 -28
- package/es/components/chunk-upload/index.js +1 -14
- package/es/components/chunk-upload/index2.js +14 -0
- package/es/components/chunk-upload/src/chunk-upload-new.js +2 -2
- package/es/components/chunk-upload/src/chunk-upload-new.vue.d.ts +32 -38
- package/es/components/chunk-upload/src/hooks/upload-computed.js +1 -70
- package/es/components/chunk-upload/src/hooks/upload-computed2.js +70 -0
- package/es/components/chunk-upload/src/hooks/upload-data.js +1 -96
- package/es/components/chunk-upload/src/hooks/upload-data2.js +96 -0
- package/es/components/chunk-upload/src/hooks/vod-computed.js +1 -79
- package/es/components/chunk-upload/src/hooks/vod-computed2.js +79 -0
- package/es/components/chunk-upload/src/hooks/vod-data.js +1 -28
- package/es/components/chunk-upload/src/hooks/vod-data2.js +28 -0
- package/es/components/chunk-upload/src/vod-chunk-upload/index.js +0 -1
- package/es/components/chunk-upload/src/vod-chunk-upload/index2.js +2 -0
- package/es/components/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.js +2 -2
- package/es/components/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +22 -28
- package/es/components/drag-layout/index.d.ts +298 -478
- package/es/components/drag-layout/index.js +1 -11
- package/es/components/drag-layout/index2.js +11 -0
- package/es/components/drag-layout/src/DragFormLeftItem.vue.d.ts +92 -147
- package/es/components/drag-layout/src/DragFormRightItem.vue.d.ts +79 -110
- package/es/components/drag-layout/src/DragLayout.vue.d.ts +298 -478
- package/es/components/editor/index.js +1 -10
- package/es/components/editor/index2.js +10 -0
- package/es/components/fabric-chart/index.js +1 -10
- package/es/components/fabric-chart/index2.js +10 -0
- package/es/components/fabric-chart/src/FabricChart.js +9 -9
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/components/PopupTip.js +1 -1
- package/es/components/fabric-chart/src/components/useStyle.js +1 -36
- package/es/components/fabric-chart/src/components/useStyle2.js +36 -0
- package/es/components/fabric-chart/src/hooks/constant.js +1 -36
- package/es/components/fabric-chart/src/hooks/constant2.js +36 -0
- package/es/components/fabric-chart/src/hooks/index.js +9 -9
- package/es/components/fabric-chart/src/hooks/useBottom.js +1 -85
- package/es/components/fabric-chart/src/hooks/useBottom2.js +85 -0
- package/es/components/fabric-chart/src/hooks/useCenter.js +1 -534
- package/es/components/fabric-chart/src/hooks/useCenter2.js +534 -0
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -60
- package/es/components/fabric-chart/src/hooks/useCumputedPoint2.js +60 -0
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -153
- package/es/components/fabric-chart/src/hooks/useDraw2.js +153 -0
- package/es/components/fabric-chart/src/hooks/useEvent.js +1 -85
- package/es/components/fabric-chart/src/hooks/useEvent2.js +85 -0
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -50
- package/es/components/fabric-chart/src/hooks/useGrid2.js +50 -0
- package/es/components/fabric-chart/src/hooks/useLeft.js +1 -282
- package/es/components/fabric-chart/src/hooks/useLeft2.js +282 -0
- package/es/components/fabric-chart/src/hooks/useOther.js +1 -85
- package/es/components/fabric-chart/src/hooks/useOther2.js +85 -0
- package/es/components/fabric-chart/src/hooks/useRight.js +1 -27
- package/es/components/fabric-chart/src/hooks/useRight2.js +27 -0
- package/es/components/fabric-chart/src/hooks/useShadow.js +1 -127
- package/es/components/fabric-chart/src/hooks/useShadow2.js +127 -0
- package/es/components/fabric-chart/src/hooks/useTop.js +1 -138
- package/es/components/fabric-chart/src/hooks/useTop2.js +138 -0
- package/es/components/fabric-chart/src/interface.js +1 -4
- package/es/components/fabric-chart/src/interface2.js +4 -0
- package/es/{packages/components → components}/fabric-chart/src/utils/index.d.ts +0 -0
- package/es/components/field-set/index.d.ts +92 -142
- package/es/components/field-set/index.js +1 -10
- package/es/components/field-set/index2.js +10 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +92 -142
- package/es/components/form-config/index.d.ts +122 -264
- package/es/components/form-config/index.js +1 -10
- package/es/components/form-config/index2.js +10 -0
- package/es/components/form-config/src/FormConfig.js +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +122 -264
- package/es/components/form-config/src/components/FormConfigCreator.js +4 -4
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +57 -107
- package/es/components/form-config/src/components/FormConfigDragDisplay.js +2 -2
- package/es/components/form-config/src/components/FormConfigEdit.js +5 -5
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +43 -129
- package/es/components/form-config/src/components/renderer/CloseButton.js +1 -1
- package/es/components/form-config/src/components/renderer/CloseButton.vue.d.ts +22 -28
- package/es/components/form-config/src/components/renderer/ComplexNode.js +2 -2
- package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +22 -28
- package/es/components/form-config/src/components/renderer/DefaultNode.js +4 -4
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.d.ts +48 -61
- package/es/components/form-config/src/constants/index.js +1 -60
- package/es/components/form-config/src/constants/index2.js +60 -0
- package/es/components/form-config/src/hooks/index.js +2 -2
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -52
- package/es/components/form-config/src/hooks/useConfigurationField2.js +52 -0
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -27
- package/es/components/form-config/src/hooks/useSortalbeConfig2.js +27 -0
- package/es/components/form-config/src/utils/index.js +1 -26
- package/es/components/form-config/src/utils/index2.js +26 -0
- package/es/components/form-render/index.d.ts +31 -69
- package/es/components/form-render/index.js +14 -23
- package/es/components/form-render/index2.js +46 -0
- package/es/components/form-render/src/FormRender.js +12 -22
- package/es/components/form-render/src/FormRender.vue.d.ts +31 -69
- package/es/components/form-render/src/components/renderer/cascader.js +7 -7
- package/es/components/form-render/src/components/renderer/checkbox.js +2 -2
- package/es/components/form-render/src/components/renderer/combination.js +4 -4
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +4 -4
- package/es/components/form-render/src/components/renderer/formItem.js +3 -3
- package/es/components/form-render/src/components/renderer/index.js +1 -1
- package/es/components/form-render/src/components/renderer/index2.js +18 -0
- package/es/components/form-render/src/components/renderer/input.d.ts +10 -2
- package/es/components/form-render/src/components/renderer/input.js +20 -4
- package/es/components/form-render/src/components/renderer/inputGroup.js +1 -8
- package/es/components/form-render/src/components/renderer/inputGroup2.js +8 -0
- package/es/components/form-render/src/components/renderer/inputNumber.js +4 -2
- package/es/components/form-render/src/components/renderer/jsonCombination/hooks/useDeepValidate.js +1 -33
- package/es/components/form-render/src/components/renderer/jsonCombination/hooks/useDeepValidate2.js +33 -0
- package/es/components/form-render/src/components/renderer/jsonCombination/index.js +2 -2
- package/es/components/form-render/src/components/renderer/linebar.js +3 -3
- package/es/components/form-render/src/components/renderer/radio.js +2 -2
- package/es/components/form-render/src/components/renderer/select.js +7 -7
- package/es/components/form-render/src/components/renderer/slider.js +3 -3
- package/es/components/form-render/src/components/renderer/switch.js +2 -2
- package/es/components/form-render/src/components/renderer/textarea.d.ts +8 -845
- package/es/components/form-render/src/components/renderer/textarea.js +30 -7
- package/es/components/form-render/src/constants/index.js +1 -41
- package/es/components/form-render/src/constants/index2.js +41 -0
- package/es/components/form-render/src/hooks/index.js +13 -13
- package/es/components/form-render/src/hooks/useAnchor.js +1 -90
- package/es/components/form-render/src/hooks/useAnchor2.js +90 -0
- package/es/components/form-render/src/hooks/useAsyncQueue.js +1 -144
- package/es/components/form-render/src/hooks/useAsyncQueue2.js +144 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -98
- package/es/components/form-render/src/hooks/useBusinessBinding2.js +98 -0
- package/es/components/form-render/src/hooks/useChangeContext.js +1 -20
- package/es/components/form-render/src/hooks/useChangeContext2.js +20 -0
- package/es/components/form-render/src/hooks/useCommonInjection.d.ts +1 -0
- package/es/components/form-render/src/hooks/useCommonInjection.js +1 -23
- package/es/components/form-render/src/hooks/useCommonInjection2.js +32 -0
- package/es/components/form-render/src/hooks/useCommonLog.js +1 -10
- package/es/components/form-render/src/hooks/useCommonLog2.js +10 -0
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -243
- package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +243 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -67
- package/es/components/form-render/src/hooks/useFieldNormalize2.js +67 -0
- package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -38
- package/es/components/form-render/src/hooks/useFieldVisitor2.js +38 -0
- package/es/components/form-render/src/hooks/useFormContext.js +1 -66
- package/es/components/form-render/src/hooks/useFormContext2.js +66 -0
- package/es/components/form-render/src/hooks/useFormField.js +1 -13
- package/es/components/form-render/src/hooks/useFormField2.js +13 -0
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -34
- package/es/components/form-render/src/hooks/useFormItemDeps2.js +34 -0
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle.js +1 -10
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle2.js +10 -0
- package/es/components/form-render/src/hooks/useFormRequest.js +1 -12
- package/es/components/form-render/src/hooks/useFormRequest2.js +12 -0
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -67
- package/es/components/form-render/src/hooks/useFormValidator2.js +67 -0
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -25
- package/es/components/form-render/src/hooks/usePresetScope2.js +25 -0
- package/es/components/form-render/src/utils/business.js +1 -78
- package/es/components/form-render/src/utils/business2.js +78 -0
- package/es/components/form-render/src/utils/dom.js +1 -14
- package/es/components/form-render/src/utils/dom2.js +14 -0
- package/es/components/form-render/src/utils/index.js +3 -4
- package/es/components/form-render/src/utils/schema.d.ts +3 -0
- package/es/components/form-render/src/utils/schema.js +1 -86
- package/es/components/form-render/src/utils/schema2.js +93 -0
- package/es/components/form-table/index.d.ts +408 -654
- package/es/components/form-table/index.js +1 -10
- package/es/components/form-table/index2.js +10 -0
- package/es/components/form-table/src/FormTable.js +2 -2
- package/es/components/form-table/src/FormTable.vue.d.ts +408 -654
- package/es/components/form-table/src/components/index.d.ts +408 -654
- package/es/components/form-table/src/components/index.js +1 -40
- package/es/components/form-table/src/components/index2.js +40 -0
- package/es/components/form-table/src/components/table-age.js +1 -1
- package/es/components/form-table/src/components/table-age.vue.d.ts +61 -101
- package/es/components/form-table/src/components/table-date-picker.js +2 -2
- package/es/components/form-table/src/components/table-date-picker.vue.d.ts +26 -59
- package/es/components/form-table/src/components/table-digital.js +1 -1
- package/es/components/form-table/src/components/table-digital.vue.d.ts +4 -26
- package/es/components/form-table/src/components/table-input-password.js +1 -1
- package/es/components/form-table/src/components/table-input-password.vue.d.ts +8 -17
- package/es/components/form-table/src/components/table-input.js +1 -1
- package/es/components/form-table/src/components/table-input.vue.d.ts +8 -17
- package/es/components/form-table/src/components/table-month-picker.js +2 -2
- package/es/components/form-table/src/components/table-month-picker.vue.d.ts +26 -59
- package/es/components/form-table/src/components/table-search-more.vue.d.ts +22 -28
- package/es/components/form-table/src/components/table-search-more.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/components/form-table/src/components/table-search.vue.d.ts +79 -103
- package/es/components/form-table/src/components/table-search.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/components/form-table/src/components/table-select-multiple.js +1 -1
- package/es/components/form-table/src/components/table-select-multiple.vue.d.ts +57 -75
- package/es/components/form-table/src/components/table-select.js +1 -1
- package/es/components/form-table/src/components/table-select.vue.d.ts +57 -75
- package/es/components/form-table/src/components/table-textarea.js +1 -1
- package/es/components/form-table/src/components/table-textarea.vue.d.ts +8 -17
- package/es/components/form-table/src/components/table-time-picker.js +2 -2
- package/es/components/form-table/src/components/table-time-picker.vue.d.ts +19 -23
- package/es/components/form-table/src/components/table-tree-select.js +1 -1
- package/es/components/form-table/src/components/table-tree-select.vue.d.ts +31 -46
- package/es/components/form-table/src/components/text-over-tooltip.vue.d.ts +2 -8
- package/es/components/form-table/src/configs/index.js +1 -67
- package/es/components/form-table/src/configs/index2.js +67 -0
- package/es/components/form-table/src/hooks/index.js +5 -5
- package/es/components/form-table/src/hooks/useBoundDate.js +1 -414
- package/es/components/form-table/src/hooks/useBoundDate2.js +414 -0
- package/es/components/form-table/src/hooks/useDateType.js +1 -160
- package/es/components/form-table/src/hooks/useDateType2.js +160 -0
- package/es/components/form-table/src/hooks/useFormCommon.js +1 -101
- package/es/components/form-table/src/hooks/useFormCommon2.js +101 -0
- package/es/components/form-table/src/hooks/useFormEvent.js +1 -68
- package/es/components/form-table/src/hooks/useFormEvent2.js +68 -0
- package/es/components/form-table/src/hooks/useItemDefault.js +1 -218
- package/es/components/form-table/src/hooks/useItemDefault2.js +218 -0
- package/es/components/form-table/src/hooks/useNuiThemeOverrides.js +1 -18
- package/es/components/form-table/src/hooks/useNuiThemeOverrides2.js +18 -0
- package/es/components/form-table/src/hooks/useSearch.js +1 -1154
- package/es/components/form-table/src/hooks/useSearch2.js +1154 -0
- package/es/components/form-table/src/hooks/useValidate.js +1 -480
- package/es/components/form-table/src/hooks/useValidate2.js +480 -0
- package/es/components/grid/index.js +1 -13
- package/es/components/grid/index2.js +13 -0
- package/es/components/grid/src/Grid.js +1 -1
- package/es/components/grid/src/hooks.js +1 -165
- package/es/components/grid/src/hooks2.js +165 -0
- package/es/components/index.js +39 -96
- package/es/components/index2.js +79 -0
- package/es/components/info-header/index.d.ts +58 -233
- package/es/components/info-header/index.js +1 -10
- package/es/components/info-header/index2.js +10 -0
- package/es/components/info-header/src/HiddenContent.vue.d.ts +5 -12
- package/es/components/info-header/src/InfoEllipsis.vue.d.ts +5 -12
- package/es/components/info-header/src/InfoHeader.vue.d.ts +58 -233
- package/es/components/map/index.d.ts +28 -37
- package/es/components/map/index.js +1 -10
- package/es/components/map/index2.js +10 -0
- package/es/components/map/src/Map.vue.d.ts +28 -37
- package/es/components/scale-view/index.d.ts +60 -74
- package/es/components/scale-view/index.js +1 -35
- package/es/components/scale-view/index2.js +35 -0
- package/es/components/scale-view/src/ScaleView.js +8 -8
- package/es/components/scale-view/src/ScaleView.vue.d.ts +60 -74
- package/es/components/scale-view/src/components/EvaluateCountdown.js +1 -1
- package/es/components/scale-view/src/components/EvaluatePage.js +1 -1
- package/es/components/scale-view/src/components/EvaluatePage.vue.d.ts +22 -28
- package/es/components/scale-view/src/components/composables/choose-common.d.ts +1 -1
- package/es/components/scale-view/src/components/composables/choose-common.js +1 -83
- package/es/components/scale-view/src/components/composables/choose-common2.js +83 -0
- package/es/components/scale-view/src/components/formitem/address.js +1 -3993
- package/es/components/scale-view/src/components/formitem/address2.js +3993 -0
- package/es/components/scale-view/src/components/formitem/r-address.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +2 -8
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -309
- package/es/components/scale-view/src/hooks/scaleview-computed2.js +309 -0
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -437
- package/es/components/scale-view/src/hooks/scaleview-init2.js +437 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +1 -81
- package/es/components/scale-view/src/hooks/scaleview-props2.js +81 -0
- package/es/components/scale-view/src/hooks/scaleview-state.js +1 -38
- package/es/components/scale-view/src/hooks/scaleview-state2.js +38 -0
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -154
- package/es/components/scale-view/src/hooks/scaleview-submit2.js +154 -0
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -187
- package/es/components/scale-view/src/hooks/scaleview-validate2.js +187 -0
- package/es/components/scale-view/src/hooks/use-component.d.ts +177 -623
- package/es/components/scale-view/src/hooks/use-component.js +1 -82
- package/es/components/scale-view/src/hooks/use-component2.js +82 -0
- package/es/components/scale-view/src/hooks/use-evaluate.js +1 -150
- package/es/components/scale-view/src/hooks/use-evaluate2.js +150 -0
- package/es/components/scale-view/src/hooks/use-event.js +1 -129
- package/es/components/scale-view/src/hooks/use-event2.js +129 -0
- package/es/components/scale-view/src/hooks/use-noData.js +1 -41
- package/es/components/scale-view/src/hooks/use-noData2.js +41 -0
- package/es/components/scale-view/src/utils/judge-types.js +1 -36
- package/es/components/scale-view/src/utils/judge-types2.js +36 -0
- package/es/components/select-label/index.d.ts +253 -905
- package/es/components/select-label/index.js +1 -15
- package/es/components/select-label/index2.js +15 -0
- package/es/components/select-label/src/LabelFormContent.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.d.ts +98 -313
- package/es/components/select-label/src/SelectLabel.vue.d.ts +162 -607
- package/es/components/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue.d.ts +70 -246
- package/es/components/select-person/index.d.ts +111 -151
- package/es/components/select-person/index.js +1 -10
- package/es/components/select-person/index2.js +10 -0
- package/es/components/select-person/src/SearchTree.vue.d.ts +40 -55
- package/es/components/select-person/src/SelectPerson.vue.d.ts +117 -159
- package/es/components/select-person/src/SelectPerson.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/components/select-person/src/utils/index.js +1 -84
- package/es/components/select-person/src/utils/index2.js +84 -0
- package/es/components/shortcut-provider/index.js +3 -12
- package/es/components/shortcut-provider/index2.js +13 -0
- package/es/components/shortcut-provider/src/ShortcutProvider.js +3 -3
- package/es/components/shortcut-provider/src/constants/index.js +1 -8
- package/es/components/shortcut-provider/src/constants/index2.js +8 -0
- package/es/components/shortcut-provider/src/hooks/index.js +2 -2
- package/es/components/shortcut-provider/src/hooks/useShortcutSignature.js +1 -12
- package/es/components/shortcut-provider/src/hooks/useShortcutSignature2.js +12 -0
- package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -181
- package/es/components/shortcut-provider/src/hooks/useShortcuts2.js +181 -0
- package/es/components/shortcut-provider/src/utils/index.js +1 -59
- package/es/components/shortcut-provider/src/utils/index2.js +59 -0
- package/es/components/shortcut-setter/index.d.ts +31 -69
- package/es/components/shortcut-setter/index.js +1 -10
- package/es/components/shortcut-setter/index2.js +10 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.js +4 -4
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +31 -69
- package/es/components/shortcut-setter/src/ShortcutSetterItem.js +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +6 -9
- package/es/components/steps-wheel/index.d.ts +2 -8
- package/es/components/steps-wheel/index.js +1 -10
- package/es/components/steps-wheel/index2.js +10 -0
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +2 -8
- package/es/components/time-line/index.d.ts +30 -55
- package/es/components/time-line/index.js +1 -10
- package/es/components/time-line/index2.js +10 -0
- package/es/components/time-line/src/TimeLine.vue.d.ts +30 -55
- package/es/shared/components/SelectPage/SelectPage.vue.d.ts +22 -28
- package/es/shared/components/SelectPage/index.js +0 -1
- package/es/shared/components/SelectPage/index2.js +2 -0
- package/es/shared/components/SlotRender/index.js +0 -1
- package/es/shared/components/SlotRender/index2.js +2 -0
- package/es/shared/components/SvgIcon/index.js +0 -1
- package/es/shared/components/SvgIcon/index2.js +2 -0
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +2 -8
- package/es/shared/components/TextOverTooltip/index.js +0 -1
- package/es/shared/components/TextOverTooltip/index2.js +2 -0
- package/es/shared/global/variable.js +1 -4
- package/es/shared/global/variable2.js +4 -0
- package/es/shared/utils/anime.js +1 -129
- package/es/shared/utils/anime2.js +129 -0
- package/es/shared/utils/clickoutside.js +1 -48
- package/es/shared/utils/clickoutside2.js +48 -0
- package/es/shared/utils/colorLog.js +1 -44
- package/es/shared/utils/colorLog2.js +44 -0
- package/es/shared/utils/index.js +1 -25
- package/es/shared/utils/index2.js +25 -0
- package/es/shared/utils/loadViewer.js +1 -11
- package/es/shared/utils/loadViewer2.js +11 -0
- package/es/shared/utils/loadVxe.js +1 -12
- package/es/shared/utils/loadVxe2.js +12 -0
- package/es/shared/utils/state.js +1 -44
- package/es/shared/utils/state2.js +44 -0
- package/es/shared/utils/tapable/AsyncParallelBailHook.js +2 -17
- package/es/shared/utils/tapable/AsyncParallelHook.js +2 -17
- package/es/shared/utils/tapable/AsyncSeriesBailHook.js +2 -17
- package/es/shared/utils/tapable/AsyncSeriesHook.js +2 -17
- package/es/shared/utils/tapable/AsyncSeriesLoopHook.js +2 -17
- package/es/shared/utils/tapable/AsyncSeriesWaterfallHook.js +2 -19
- package/es/shared/utils/tapable/SyncBailHook.js +2 -23
- package/es/shared/utils/tapable/SyncHook.js +2 -23
- package/es/shared/utils/tapable/SyncLoopHook.js +2 -23
- package/es/{packages/shared → shared}/utils/tapable/index.d.ts +0 -0
- package/es/shared/utils/utilExpand.d.ts +1 -1
- package/es/shared/utils/utilExpand.js +47 -46
- package/es/shared/utils/vexutils.js +1 -22
- package/package.json +2 -2
- package/es/components/big-table/src/components/edit-form/edit-select-table.js +0 -149
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +0 -373
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +0 -131
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/index.js +0 -18
- package/es/components/bpmn-workflow/src/custom/customModeler/index.js +0 -12
- package/es/components/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +0 -47
- package/es/components/bpmn-workflow/src/custom/customRules/no-task.js +0 -1
- package/es/components/bpmn-workflow/src/custom/customRules/no-task2.js +0 -16
- package/es/components/bpmn-workflow/src/custom/customTranslate/customTranslate.js +0 -15
- package/es/components/bpmn-workflow/src/custom/customTranslate/zh.js +0 -227
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.js +0 -80
- package/es/shared/components/player-vod/index.js +0 -14
- package/es/shared/components/player-vod/video-list.js +0 -126
- package/es/shared/core/create.js +0 -8
- package/es/shared/utils/crypto.js +0 -25
- package/es/shared/utils/tapable/HookMap.js +0 -32
- package/es/shared/utils/tapable/MultiHook.js +0 -38
- package/es/shared/utils/tapable/index.js +0 -12
|
@@ -1,84 +1 @@
|
|
|
1
|
-
|
|
2
|
-
value = "",
|
|
3
|
-
data = [],
|
|
4
|
-
prop = "title",
|
|
5
|
-
filter = false,
|
|
6
|
-
filterXor = false,
|
|
7
|
-
children = "children",
|
|
8
|
-
visible = "visible",
|
|
9
|
-
filterChildren = true,
|
|
10
|
-
callback
|
|
11
|
-
}) => {
|
|
12
|
-
visible = visible || "visible";
|
|
13
|
-
children = children || "children";
|
|
14
|
-
prop = prop || "text";
|
|
15
|
-
const filterNodeMethod = function(value2, data2) {
|
|
16
|
-
if (!value2) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
let flag = (data2[prop] || "").indexOf(value2) !== -1;
|
|
20
|
-
return filterXor ? !flag : flag;
|
|
21
|
-
};
|
|
22
|
-
const setVisible = (tree, isVisible) => {
|
|
23
|
-
if (!(tree == null ? void 0 : tree.length))
|
|
24
|
-
return;
|
|
25
|
-
tree.forEach((item) => {
|
|
26
|
-
var _a;
|
|
27
|
-
item[visible] = isVisible;
|
|
28
|
-
((_a = item[children]) == null ? void 0 : _a.length) && setVisible(item[children], isVisible);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
const traverse = function(node) {
|
|
32
|
-
const childNodes = node[children] || [];
|
|
33
|
-
childNodes.forEach((child) => {
|
|
34
|
-
child[visible] = !node.root && !filterChildren && node[visible] || filterNodeMethod.call(child, value, child);
|
|
35
|
-
traverse(child);
|
|
36
|
-
callback && callback(child);
|
|
37
|
-
});
|
|
38
|
-
if (childNodes.length) {
|
|
39
|
-
let allHidden = true;
|
|
40
|
-
allHidden = !childNodes.some((child) => child[visible]);
|
|
41
|
-
if (!node[visible]) {
|
|
42
|
-
node[visible] = allHidden === false;
|
|
43
|
-
} else {
|
|
44
|
-
setVisible(childNodes, true);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
let totalData = {
|
|
49
|
-
root: true
|
|
50
|
-
};
|
|
51
|
-
totalData[children] = data;
|
|
52
|
-
traverse(totalData);
|
|
53
|
-
if (filter) {
|
|
54
|
-
let copyData = data.slice();
|
|
55
|
-
let filterHandle = (filterData) => {
|
|
56
|
-
return filterData.filter((item, index) => {
|
|
57
|
-
var _a;
|
|
58
|
-
if (item[visible]) {
|
|
59
|
-
if (item[children]) {
|
|
60
|
-
item[children] = filterHandle(item[children]);
|
|
61
|
-
}
|
|
62
|
-
if (!((_a = item[children]) == null ? void 0 : _a.length)) {
|
|
63
|
-
item[children] = void 0;
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
return false;
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
return filterHandle(copyData);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const deepTraversalFirst = (node, nodeList = []) => {
|
|
74
|
-
if (node !== null) {
|
|
75
|
-
nodeList.push(node);
|
|
76
|
-
if (node.children && node.children.length > 0) {
|
|
77
|
-
let children = node.children;
|
|
78
|
-
deepTraversalFirst(children[0], nodeList);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return nodeList;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export { deepTraversalFirst, filterTree };
|
|
1
|
+
export { deepTraversalFirst, filterTree } from './index2.js';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const filterTree = ({
|
|
2
|
+
value = "",
|
|
3
|
+
data = [],
|
|
4
|
+
prop = "title",
|
|
5
|
+
filter = false,
|
|
6
|
+
filterXor = false,
|
|
7
|
+
children = "children",
|
|
8
|
+
visible = "visible",
|
|
9
|
+
filterChildren = true,
|
|
10
|
+
callback
|
|
11
|
+
}) => {
|
|
12
|
+
visible = visible || "visible";
|
|
13
|
+
children = children || "children";
|
|
14
|
+
prop = prop || "text";
|
|
15
|
+
const filterNodeMethod = function(value2, data2) {
|
|
16
|
+
if (!value2) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
let flag = (data2[prop] || "").indexOf(value2) !== -1;
|
|
20
|
+
return filterXor ? !flag : flag;
|
|
21
|
+
};
|
|
22
|
+
const setVisible = (tree, isVisible) => {
|
|
23
|
+
if (!(tree == null ? void 0 : tree.length))
|
|
24
|
+
return;
|
|
25
|
+
tree.forEach((item) => {
|
|
26
|
+
var _a;
|
|
27
|
+
item[visible] = isVisible;
|
|
28
|
+
((_a = item[children]) == null ? void 0 : _a.length) && setVisible(item[children], isVisible);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const traverse = function(node) {
|
|
32
|
+
const childNodes = node[children] || [];
|
|
33
|
+
childNodes.forEach((child) => {
|
|
34
|
+
child[visible] = !node.root && !filterChildren && node[visible] || filterNodeMethod.call(child, value, child);
|
|
35
|
+
traverse(child);
|
|
36
|
+
callback && callback(child);
|
|
37
|
+
});
|
|
38
|
+
if (childNodes.length) {
|
|
39
|
+
let allHidden = true;
|
|
40
|
+
allHidden = !childNodes.some((child) => child[visible]);
|
|
41
|
+
if (!node[visible]) {
|
|
42
|
+
node[visible] = allHidden === false;
|
|
43
|
+
} else {
|
|
44
|
+
setVisible(childNodes, true);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
let totalData = {
|
|
49
|
+
root: true
|
|
50
|
+
};
|
|
51
|
+
totalData[children] = data;
|
|
52
|
+
traverse(totalData);
|
|
53
|
+
if (filter) {
|
|
54
|
+
let copyData = data.slice();
|
|
55
|
+
let filterHandle = (filterData) => {
|
|
56
|
+
return filterData.filter((item, index) => {
|
|
57
|
+
var _a;
|
|
58
|
+
if (item[visible]) {
|
|
59
|
+
if (item[children]) {
|
|
60
|
+
item[children] = filterHandle(item[children]);
|
|
61
|
+
}
|
|
62
|
+
if (!((_a = item[children]) == null ? void 0 : _a.length)) {
|
|
63
|
+
item[children] = void 0;
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return filterHandle(copyData);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const deepTraversalFirst = (node, nodeList = []) => {
|
|
74
|
+
if (node !== null) {
|
|
75
|
+
nodeList.push(node);
|
|
76
|
+
if (node.children && node.children.length > 0) {
|
|
77
|
+
let children = node.children;
|
|
78
|
+
deepTraversalFirst(children[0], nodeList);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return nodeList;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { deepTraversalFirst, filterTree };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './src/hooks/useShortcuts.js';
|
|
5
|
-
export { useShortcutSignature } from './src/hooks/useShortcutSignature.js';
|
|
6
|
-
|
|
7
|
-
const ShortcutProvider = script;
|
|
8
|
-
ShortcutProvider.install = function(app) {
|
|
9
|
-
safeComponentRegister(app, ShortcutProvider, COMPONENT_NAMESPACE + "ShortcutProvider");
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { ShortcutProvider as default };
|
|
1
|
+
export { default } from './index2.js';
|
|
2
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './src/hooks/useShortcuts2.js';
|
|
3
|
+
export { useShortcutSignature } from './src/hooks/useShortcutSignature2.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { COMPONENT_NAMESPACE } from '../../shared/global/variable2.js';
|
|
2
|
+
import { safeComponentRegister } from '../../shared/utils/index2.js';
|
|
3
|
+
import script from './src/ShortcutProvider.js';
|
|
4
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './src/hooks/useShortcuts2.js';
|
|
5
|
+
import 'vue';
|
|
6
|
+
import 'lodash-es';
|
|
7
|
+
|
|
8
|
+
const ShortcutProvider = script;
|
|
9
|
+
ShortcutProvider.install = function(app) {
|
|
10
|
+
safeComponentRegister(app, ShortcutProvider, COMPONENT_NAMESPACE + "ShortcutProvider");
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { ShortcutProvider as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, ref, provide, onBeforeUnmount, openBlock, createElementBlock, renderSlot } from 'vue';
|
|
2
|
-
import { InjectionShortcutManager } from './constants/
|
|
3
|
-
import '../
|
|
2
|
+
import { InjectionShortcutManager } from './constants/index2.js';
|
|
3
|
+
import '../index2.js';
|
|
4
4
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
5
|
-
import { ShortcutManager } from './hooks/
|
|
5
|
+
import { ShortcutManager } from './hooks/useShortcuts2.js';
|
|
6
6
|
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "ShortcutProvider",
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
ShortcutStatus2[ShortcutStatus2["INACTIVE"] = 0] = "INACTIVE";
|
|
3
|
-
ShortcutStatus2[ShortcutStatus2["ACTIVE"] = 1] = "ACTIVE";
|
|
4
|
-
return ShortcutStatus2;
|
|
5
|
-
})(ShortcutStatus || {});
|
|
6
|
-
const InjectionShortcutManager = Symbol("InjectionShortcutManager");
|
|
7
|
-
|
|
8
|
-
export { InjectionShortcutManager, ShortcutStatus };
|
|
1
|
+
export { InjectionShortcutManager, ShortcutStatus } from './index2.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ShortcutStatus = /* @__PURE__ */ ((ShortcutStatus2) => {
|
|
2
|
+
ShortcutStatus2[ShortcutStatus2["INACTIVE"] = 0] = "INACTIVE";
|
|
3
|
+
ShortcutStatus2[ShortcutStatus2["ACTIVE"] = 1] = "ACTIVE";
|
|
4
|
+
return ShortcutStatus2;
|
|
5
|
+
})(ShortcutStatus || {});
|
|
6
|
+
const InjectionShortcutManager = Symbol("InjectionShortcutManager");
|
|
7
|
+
|
|
8
|
+
export { InjectionShortcutManager, ShortcutStatus };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './
|
|
2
|
-
export { useShortcutSignature } from './
|
|
1
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './useShortcuts2.js';
|
|
2
|
+
export { useShortcutSignature } from './useShortcutSignature2.js';
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { transformKey2DisplaySignature } from '../utils/index.js';
|
|
3
|
-
|
|
4
|
-
function useShortcutSignature() {
|
|
5
|
-
const signatureRef = ref(() => "");
|
|
6
|
-
const shortcut = computed(() => {
|
|
7
|
-
return transformKey2DisplaySignature(signatureRef.value());
|
|
8
|
-
});
|
|
9
|
-
return { signatureRef, shortcut };
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { useShortcutSignature };
|
|
1
|
+
export { useShortcutSignature } from './useShortcutSignature2.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ref, computed } from 'vue';
|
|
2
|
+
import { transformKey2DisplaySignature } from '../utils/index2.js';
|
|
3
|
+
|
|
4
|
+
function useShortcutSignature() {
|
|
5
|
+
const signatureRef = ref(() => "");
|
|
6
|
+
const shortcut = computed(() => {
|
|
7
|
+
return transformKey2DisplaySignature(signatureRef.value());
|
|
8
|
+
});
|
|
9
|
+
return { signatureRef, shortcut };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { useShortcutSignature };
|
|
@@ -1,181 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { pick, omit, isFunction, isString } from 'lodash-es';
|
|
3
|
-
import { reactive, ref, unref, computed, getCurrentInstance, inject, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
4
|
-
import { ShortcutStatus, InjectionShortcutManager } from '../constants/index.js';
|
|
5
|
-
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, findAncestor, isShortcutProvider } from '../utils/index.js';
|
|
6
|
-
|
|
7
|
-
const GlobalShortcutProvider = Symbol("Glob");
|
|
8
|
-
const ShortcutManagerCacheMap = /* @__PURE__ */ new Map();
|
|
9
|
-
class ShortcutManager {
|
|
10
|
-
constructor(environmentEle, scope = GlobalShortcutProvider) {
|
|
11
|
-
this.shortcutCallbackMap = reactive(/* @__PURE__ */ new Map());
|
|
12
|
-
this.shortcutCache = ref({});
|
|
13
|
-
this.disabled = false;
|
|
14
|
-
this.environmentEle = environmentEle || window;
|
|
15
|
-
ShortcutManagerCacheMap.set(scope, this);
|
|
16
|
-
}
|
|
17
|
-
static log(message, dryRun = false) {
|
|
18
|
-
const _message = `[ShortcutManager] ${message}`;
|
|
19
|
-
!dryRun && console.warn(_message);
|
|
20
|
-
return _message;
|
|
21
|
-
}
|
|
22
|
-
get traverse() {
|
|
23
|
-
return [...Object.values(this.shortcutCache.value)].sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
24
|
-
}
|
|
25
|
-
query(key) {
|
|
26
|
-
return this.shortcutCache.value[key];
|
|
27
|
-
}
|
|
28
|
-
async update(key, info) {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
const oldKeySignature = (_a = this.query(key)) == null ? void 0 : _a.currentKeySignature;
|
|
31
|
-
info && checkSignature(this.shortcutCache, info);
|
|
32
|
-
const item = this.query(key);
|
|
33
|
-
if (!item)
|
|
34
|
-
return;
|
|
35
|
-
await ((_b = item.onUpdate) == null ? void 0 : _b.call(item, key, info ? normalizeSignatureInfo(info) : void 0));
|
|
36
|
-
checkSignature(this.shortcutCache, info);
|
|
37
|
-
item.currentKeySignature = getKeySignature(info);
|
|
38
|
-
item.shortcutSignature = normalizeSignatureInfo(info);
|
|
39
|
-
this.shortcutCallbackMap.set(item.currentKeySignature, this.shortcutCallbackMap.get(oldKeySignature));
|
|
40
|
-
this.shortcutCallbackMap.delete(oldKeySignature);
|
|
41
|
-
function checkSignature(shortcutCache, info2) {
|
|
42
|
-
if (oldKeySignature === getKeySignature(info2))
|
|
43
|
-
return;
|
|
44
|
-
if (Object.values(shortcutCache.value).some((v) => v.currentKeySignature === getKeySignature(info2))) {
|
|
45
|
-
throw `\u91CD\u590D\u7684\u5FEB\u6377\u952E=> ${getDisplaySignature(info2)}`;
|
|
46
|
-
}
|
|
47
|
-
if (isInvalidSignature(info2)) {
|
|
48
|
-
throw `\u975E\u6CD5\u7684\u5FEB\u6377\u952E=>${info2.key}`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
register(shortcutItem) {
|
|
53
|
-
const item = this.query(shortcutItem.key);
|
|
54
|
-
if (item) {
|
|
55
|
-
item.status = ShortcutStatus.ACTIVE;
|
|
56
|
-
this.shortcutCallbackMap.set(item.currentKeySignature, shortcutItem.callback);
|
|
57
|
-
Object.assign(item, pick(shortcutItem, ["debounce", "debounceOption", "label", "order", "key"]));
|
|
58
|
-
return createHandler(item);
|
|
59
|
-
}
|
|
60
|
-
this.shortcutCache.value[shortcutItem.key] = omit(shortcutItem, ["callback"]);
|
|
61
|
-
this.shortcutCallbackMap.set(shortcutItem.currentKeySignature, shortcutItem.callback);
|
|
62
|
-
return createHandler(this.shortcutCache.value[shortcutItem.key]);
|
|
63
|
-
function createHandler(shortcut) {
|
|
64
|
-
return {
|
|
65
|
-
stop: () => {
|
|
66
|
-
shortcut.status = ShortcutStatus.INACTIVE;
|
|
67
|
-
},
|
|
68
|
-
start: () => {
|
|
69
|
-
shortcut.status = ShortcutStatus.ACTIVE;
|
|
70
|
-
},
|
|
71
|
-
signature: () => shortcut.currentKeySignature
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
start() {
|
|
76
|
-
if (this.handle) {
|
|
77
|
-
ShortcutManager.log(`\u8BF7\u52FF\u91CD\u590D\u542F\u52A8=>${this}`);
|
|
78
|
-
return this;
|
|
79
|
-
}
|
|
80
|
-
this.handle = async (event) => {
|
|
81
|
-
if (!isKeyboardEvent(event) || this.disabled)
|
|
82
|
-
return;
|
|
83
|
-
const providerWrapper = findAncestor(event.target, isShortcutProvider);
|
|
84
|
-
if (providerWrapper && providerWrapper !== unref(this.environmentEle)) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const keySignature = getKeySignature(event);
|
|
88
|
-
const callback = this.shortcutCallbackMap.get(keySignature);
|
|
89
|
-
if (!callback)
|
|
90
|
-
return;
|
|
91
|
-
event.preventDefault();
|
|
92
|
-
const shortcutItem = Object.values(this.shortcutCache.value).find((item) => item.currentKeySignature === keySignature);
|
|
93
|
-
if (!shortcutItem || shortcutItem.status !== ShortcutStatus.ACTIVE || shortcutItem.disabled)
|
|
94
|
-
return;
|
|
95
|
-
callback();
|
|
96
|
-
};
|
|
97
|
-
useEventListener(this.environmentEle, "keyup", this.handle, { capture: true });
|
|
98
|
-
return this;
|
|
99
|
-
}
|
|
100
|
-
destroy() {
|
|
101
|
-
var _a;
|
|
102
|
-
this.handle && ((_a = unref(this.environmentEle)) == null ? void 0 : _a.removeEventListener("keyup", this.handle, { capture: true }));
|
|
103
|
-
this.handle = void 0;
|
|
104
|
-
this.clear();
|
|
105
|
-
}
|
|
106
|
-
clear() {
|
|
107
|
-
this.shortcutCallbackMap.clear();
|
|
108
|
-
this.shortcutCache.value = {};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const globManager = new ShortcutManager().start();
|
|
112
|
-
function useShortcuts(scope) {
|
|
113
|
-
function useManager() {
|
|
114
|
-
return computed(() => {
|
|
115
|
-
if (unref(scope)) {
|
|
116
|
-
const result = ShortcutManagerCacheMap.get(unref(scope));
|
|
117
|
-
if (!result)
|
|
118
|
-
ShortcutManager.log(`\u4E0D\u5B58\u5728\u7684scope=>${scope}, \u5C06\u4F7F\u7528\u5168\u5C40\u5FEB\u6377\u952E`);
|
|
119
|
-
return result || globManager;
|
|
120
|
-
} else if (getCurrentInstance()) {
|
|
121
|
-
return inject(InjectionShortcutManager, globManager);
|
|
122
|
-
} else {
|
|
123
|
-
ShortcutManager.log("\u975Esetup\u8BED\u5883\u4E0B\u7684shortcut\u5C06\u5F71\u54CD\u5168\u5C40");
|
|
124
|
-
return globManager;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
const manager = useManager();
|
|
129
|
-
function createShortcutItem(shortcut) {
|
|
130
|
-
return {
|
|
131
|
-
...shortcut,
|
|
132
|
-
shortcutSignature: normalizeSignatureInfo(shortcut.shortcutSignature),
|
|
133
|
-
currentKeySignature: getKeySignature(shortcut.shortcutSignature),
|
|
134
|
-
key: keyFor(shortcut),
|
|
135
|
-
status: ShortcutStatus.ACTIVE,
|
|
136
|
-
callback: callbackFor(shortcut)
|
|
137
|
-
};
|
|
138
|
-
function callbackFor(shortcut2) {
|
|
139
|
-
var _a, _b;
|
|
140
|
-
if (!isFunction(shortcut2.callback)) {
|
|
141
|
-
throw new Error(ShortcutManager.log(`\u975E\u6CD5\u7684callback\u7C7B\u578B=>${shortcut2.callback}`, true));
|
|
142
|
-
}
|
|
143
|
-
if (!shortcut2.debounce)
|
|
144
|
-
return shortcut2.callback;
|
|
145
|
-
return useDebounceFn(shortcut2.callback, (_b = (_a = shortcut2.debounceOption) == null ? void 0 : _a.duration) != null ? _b : 300);
|
|
146
|
-
}
|
|
147
|
-
function keyFor(shortcut2) {
|
|
148
|
-
const key = shortcut2.key || shortcut2.label;
|
|
149
|
-
if (!isString(key)) {
|
|
150
|
-
throw new Error(ShortcutManager.log(`\u975E\u6CD5\u7684key\u7C7B\u578B=>${key}`, true));
|
|
151
|
-
}
|
|
152
|
-
return key;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
function register(shortcut) {
|
|
156
|
-
const { stop, signature, start } = unref(manager).register(createShortcutItem(shortcut));
|
|
157
|
-
if (getCurrentInstance()) {
|
|
158
|
-
onBeforeUnmount(stop);
|
|
159
|
-
onDeactivated(stop);
|
|
160
|
-
onActivated(start);
|
|
161
|
-
} else {
|
|
162
|
-
ShortcutManager.log("\u5728\u975Esetup\u8BED\u5883\u4E0B\u4F7F\u7528register\u51FD\u6570,\u7EC4\u4EF6\u9500\u6BC1\u65F6\u53EF\u80FD\u9700\u8981\u624B\u52A8\u8C03\u7528stop\u51FD\u6570\u4F7F\u5FEB\u6377\u952E\u5931\u6D3B");
|
|
163
|
-
}
|
|
164
|
-
return { stop, signature };
|
|
165
|
-
}
|
|
166
|
-
function traverse() {
|
|
167
|
-
return unref(manager).traverse;
|
|
168
|
-
}
|
|
169
|
-
function update(key, info) {
|
|
170
|
-
return unref(manager).update(key, info);
|
|
171
|
-
}
|
|
172
|
-
function updateManagerDisabled(disabled) {
|
|
173
|
-
unref(manager).disabled = !!disabled;
|
|
174
|
-
}
|
|
175
|
-
function clear() {
|
|
176
|
-
unref(manager).clear();
|
|
177
|
-
}
|
|
178
|
-
return { register, traverse, clear, update, updateManagerDisabled };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export { GlobalShortcutProvider, ShortcutManager, useShortcuts };
|
|
1
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts } from './useShortcuts2.js';
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { useEventListener, useDebounceFn } from '@vueuse/core';
|
|
2
|
+
import { pick, omit, isFunction, isString } from 'lodash-es';
|
|
3
|
+
import { reactive, ref, unref, computed, getCurrentInstance, inject, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
4
|
+
import { ShortcutStatus, InjectionShortcutManager } from '../constants/index2.js';
|
|
5
|
+
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, findAncestor, isShortcutProvider } from '../utils/index2.js';
|
|
6
|
+
|
|
7
|
+
const GlobalShortcutProvider = Symbol("Glob");
|
|
8
|
+
const ShortcutManagerCacheMap = /* @__PURE__ */ new Map();
|
|
9
|
+
class ShortcutManager {
|
|
10
|
+
constructor(environmentEle, scope = GlobalShortcutProvider) {
|
|
11
|
+
this.shortcutCallbackMap = reactive(/* @__PURE__ */ new Map());
|
|
12
|
+
this.shortcutCache = ref({});
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
this.environmentEle = environmentEle || window;
|
|
15
|
+
ShortcutManagerCacheMap.set(scope, this);
|
|
16
|
+
}
|
|
17
|
+
static log(message, dryRun = false) {
|
|
18
|
+
const _message = `[ShortcutManager] ${message}`;
|
|
19
|
+
!dryRun && console.warn(_message);
|
|
20
|
+
return _message;
|
|
21
|
+
}
|
|
22
|
+
get traverse() {
|
|
23
|
+
return [...Object.values(this.shortcutCache.value)].sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
24
|
+
}
|
|
25
|
+
query(key) {
|
|
26
|
+
return this.shortcutCache.value[key];
|
|
27
|
+
}
|
|
28
|
+
async update(key, info) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const oldKeySignature = (_a = this.query(key)) == null ? void 0 : _a.currentKeySignature;
|
|
31
|
+
info && checkSignature(this.shortcutCache, info);
|
|
32
|
+
const item = this.query(key);
|
|
33
|
+
if (!item)
|
|
34
|
+
return;
|
|
35
|
+
await ((_b = item.onUpdate) == null ? void 0 : _b.call(item, key, info ? normalizeSignatureInfo(info) : void 0));
|
|
36
|
+
checkSignature(this.shortcutCache, info);
|
|
37
|
+
item.currentKeySignature = getKeySignature(info);
|
|
38
|
+
item.shortcutSignature = normalizeSignatureInfo(info);
|
|
39
|
+
this.shortcutCallbackMap.set(item.currentKeySignature, this.shortcutCallbackMap.get(oldKeySignature));
|
|
40
|
+
this.shortcutCallbackMap.delete(oldKeySignature);
|
|
41
|
+
function checkSignature(shortcutCache, info2) {
|
|
42
|
+
if (oldKeySignature === getKeySignature(info2))
|
|
43
|
+
return;
|
|
44
|
+
if (Object.values(shortcutCache.value).some((v) => v.currentKeySignature === getKeySignature(info2))) {
|
|
45
|
+
throw `\u91CD\u590D\u7684\u5FEB\u6377\u952E=> ${getDisplaySignature(info2)}`;
|
|
46
|
+
}
|
|
47
|
+
if (isInvalidSignature(info2)) {
|
|
48
|
+
throw `\u975E\u6CD5\u7684\u5FEB\u6377\u952E=>${info2.key}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
register(shortcutItem) {
|
|
53
|
+
const item = this.query(shortcutItem.key);
|
|
54
|
+
if (item) {
|
|
55
|
+
item.status = ShortcutStatus.ACTIVE;
|
|
56
|
+
this.shortcutCallbackMap.set(item.currentKeySignature, shortcutItem.callback);
|
|
57
|
+
Object.assign(item, pick(shortcutItem, ["debounce", "debounceOption", "label", "order", "key"]));
|
|
58
|
+
return createHandler(item);
|
|
59
|
+
}
|
|
60
|
+
this.shortcutCache.value[shortcutItem.key] = omit(shortcutItem, ["callback"]);
|
|
61
|
+
this.shortcutCallbackMap.set(shortcutItem.currentKeySignature, shortcutItem.callback);
|
|
62
|
+
return createHandler(this.shortcutCache.value[shortcutItem.key]);
|
|
63
|
+
function createHandler(shortcut) {
|
|
64
|
+
return {
|
|
65
|
+
stop: () => {
|
|
66
|
+
shortcut.status = ShortcutStatus.INACTIVE;
|
|
67
|
+
},
|
|
68
|
+
start: () => {
|
|
69
|
+
shortcut.status = ShortcutStatus.ACTIVE;
|
|
70
|
+
},
|
|
71
|
+
signature: () => shortcut.currentKeySignature
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
start() {
|
|
76
|
+
if (this.handle) {
|
|
77
|
+
ShortcutManager.log(`\u8BF7\u52FF\u91CD\u590D\u542F\u52A8=>${this}`);
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
this.handle = async (event) => {
|
|
81
|
+
if (!isKeyboardEvent(event) || this.disabled)
|
|
82
|
+
return;
|
|
83
|
+
const providerWrapper = findAncestor(event.target, isShortcutProvider);
|
|
84
|
+
if (providerWrapper && providerWrapper !== unref(this.environmentEle)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const keySignature = getKeySignature(event);
|
|
88
|
+
const callback = this.shortcutCallbackMap.get(keySignature);
|
|
89
|
+
if (!callback)
|
|
90
|
+
return;
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
const shortcutItem = Object.values(this.shortcutCache.value).find((item) => item.currentKeySignature === keySignature);
|
|
93
|
+
if (!shortcutItem || shortcutItem.status !== ShortcutStatus.ACTIVE || shortcutItem.disabled)
|
|
94
|
+
return;
|
|
95
|
+
callback();
|
|
96
|
+
};
|
|
97
|
+
useEventListener(this.environmentEle, "keyup", this.handle, { capture: true });
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
destroy() {
|
|
101
|
+
var _a;
|
|
102
|
+
this.handle && ((_a = unref(this.environmentEle)) == null ? void 0 : _a.removeEventListener("keyup", this.handle, { capture: true }));
|
|
103
|
+
this.handle = void 0;
|
|
104
|
+
this.clear();
|
|
105
|
+
}
|
|
106
|
+
clear() {
|
|
107
|
+
this.shortcutCallbackMap.clear();
|
|
108
|
+
this.shortcutCache.value = {};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const globManager = new ShortcutManager().start();
|
|
112
|
+
function useShortcuts(scope) {
|
|
113
|
+
function useManager() {
|
|
114
|
+
return computed(() => {
|
|
115
|
+
if (unref(scope)) {
|
|
116
|
+
const result = ShortcutManagerCacheMap.get(unref(scope));
|
|
117
|
+
if (!result)
|
|
118
|
+
ShortcutManager.log(`\u4E0D\u5B58\u5728\u7684scope=>${scope}, \u5C06\u4F7F\u7528\u5168\u5C40\u5FEB\u6377\u952E`);
|
|
119
|
+
return result || globManager;
|
|
120
|
+
} else if (getCurrentInstance()) {
|
|
121
|
+
return inject(InjectionShortcutManager, globManager);
|
|
122
|
+
} else {
|
|
123
|
+
ShortcutManager.log("\u975Esetup\u8BED\u5883\u4E0B\u7684shortcut\u5C06\u5F71\u54CD\u5168\u5C40");
|
|
124
|
+
return globManager;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const manager = useManager();
|
|
129
|
+
function createShortcutItem(shortcut) {
|
|
130
|
+
return {
|
|
131
|
+
...shortcut,
|
|
132
|
+
shortcutSignature: normalizeSignatureInfo(shortcut.shortcutSignature),
|
|
133
|
+
currentKeySignature: getKeySignature(shortcut.shortcutSignature),
|
|
134
|
+
key: keyFor(shortcut),
|
|
135
|
+
status: ShortcutStatus.ACTIVE,
|
|
136
|
+
callback: callbackFor(shortcut)
|
|
137
|
+
};
|
|
138
|
+
function callbackFor(shortcut2) {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
if (!isFunction(shortcut2.callback)) {
|
|
141
|
+
throw new Error(ShortcutManager.log(`\u975E\u6CD5\u7684callback\u7C7B\u578B=>${shortcut2.callback}`, true));
|
|
142
|
+
}
|
|
143
|
+
if (!shortcut2.debounce)
|
|
144
|
+
return shortcut2.callback;
|
|
145
|
+
return useDebounceFn(shortcut2.callback, (_b = (_a = shortcut2.debounceOption) == null ? void 0 : _a.duration) != null ? _b : 300);
|
|
146
|
+
}
|
|
147
|
+
function keyFor(shortcut2) {
|
|
148
|
+
const key = shortcut2.key || shortcut2.label;
|
|
149
|
+
if (!isString(key)) {
|
|
150
|
+
throw new Error(ShortcutManager.log(`\u975E\u6CD5\u7684key\u7C7B\u578B=>${key}`, true));
|
|
151
|
+
}
|
|
152
|
+
return key;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function register(shortcut) {
|
|
156
|
+
const { stop, signature, start } = unref(manager).register(createShortcutItem(shortcut));
|
|
157
|
+
if (getCurrentInstance()) {
|
|
158
|
+
onBeforeUnmount(stop);
|
|
159
|
+
onDeactivated(stop);
|
|
160
|
+
onActivated(start);
|
|
161
|
+
} else {
|
|
162
|
+
ShortcutManager.log("\u5728\u975Esetup\u8BED\u5883\u4E0B\u4F7F\u7528register\u51FD\u6570,\u7EC4\u4EF6\u9500\u6BC1\u65F6\u53EF\u80FD\u9700\u8981\u624B\u52A8\u8C03\u7528stop\u51FD\u6570\u4F7F\u5FEB\u6377\u952E\u5931\u6D3B");
|
|
163
|
+
}
|
|
164
|
+
return { stop, signature };
|
|
165
|
+
}
|
|
166
|
+
function traverse() {
|
|
167
|
+
return unref(manager).traverse;
|
|
168
|
+
}
|
|
169
|
+
function update(key, info) {
|
|
170
|
+
return unref(manager).update(key, info);
|
|
171
|
+
}
|
|
172
|
+
function updateManagerDisabled(disabled) {
|
|
173
|
+
unref(manager).disabled = !!disabled;
|
|
174
|
+
}
|
|
175
|
+
function clear() {
|
|
176
|
+
unref(manager).clear();
|
|
177
|
+
}
|
|
178
|
+
return { register, traverse, clear, update, updateManagerDisabled };
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { GlobalShortcutProvider, ShortcutManager, useShortcuts };
|