cnhis-design-vue 3.1.40-beta.11 → 3.1.40-beta.15
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/README.md +87 -87
- package/es/_virtual/plugin-vue_export-helper.js +1 -9
- package/es/components/annotation-edit/index.js +1 -10
- package/es/components/annotation-edit/src/AnnotationEdit.js +1 -164
- package/es/components/big-table/index.js +1 -15
- package/es/components/big-table/src/BigTable.vue.js +1 -6
- package/es/components/big-table/src/BigTable.vue2.js +1 -2498
- package/es/components/big-table/src/bigTableEmits.js +1 -53
- package/es/components/big-table/src/bigTableProps.js +1 -120
- package/es/components/big-table/src/bigTableState.js +1 -62
- package/es/components/big-table/src/components/NoData.vue.js +1 -74
- package/es/components/big-table/src/components/edit-form/edit-date.js +1 -214
- package/es/components/big-table/src/components/edit-form/edit-input.js +1 -95
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -139
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.js +1 -103
- package/es/components/big-table/src/components/edit-form/edit-time.js +1 -122
- package/es/components/big-table/src/components/edit-form/useCommon.js +1 -23
- package/es/components/big-table/src/components/input-button.vue.js +1 -39
- package/es/components/big-table/src/components/separate.vue.js +1 -30
- package/es/components/big-table/src/constants/index.js +1 -3
- package/es/components/big-table/src/hooks/index.js +1 -9
- package/es/components/big-table/src/hooks/useAnchor.js +1 -49
- package/es/components/big-table/src/hooks/useAnnotation.js +1 -21
- package/es/components/big-table/src/hooks/useBatchEditing.js +1 -301
- package/es/components/big-table/src/hooks/useEdit.js +1 -133
- package/es/components/big-table/src/hooks/useEvent.js +1 -95
- package/es/components/big-table/src/hooks/useFormat.js +1 -507
- package/es/components/big-table/src/hooks/useNestTable.js +1 -86
- package/es/components/big-table/src/hooks/useSeparateRow.js +1 -177
- package/es/components/big-table/src/hooks/useTableParse.js +1 -142
- package/es/components/big-table/src/utils.js +1 -618
- package/es/components/bpmn-workflow/index.js +1 -10
- package/es/components/bpmn-workflow/src/BpmnWorkflow.vue.js +1 -258
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +1 -1452
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPathMap.js +1 -99
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +1 -114
- package/es/components/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +1 -40
- package/es/components/bpmn-workflow/src/custom/customOtherModule/customViewerRenderer.js +1 -14
- package/es/components/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +1 -10
- package/es/components/button-print/index.js +1 -12
- package/es/components/button-print/src/ButtonPrint.vue.js +1 -6
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -528
- package/es/components/button-print/src/components/EditFormat.vue.js +1 -173
- package/es/components/button-print/src/components/IdentityVerification.vue.js +1 -182
- package/es/components/button-print/src/components/Preview.vue.js +1 -6
- package/es/components/button-print/src/components/Preview.vue2.js +1 -67
- package/es/components/button-print/src/utils/browserPrint.d.ts +2 -1
- package/es/components/button-print/src/utils/browserPrint.js +1 -43
- package/es/components/button-print/src/utils/dialog.js +1 -121
- package/es/components/button-print/src/utils/index.js +1 -2
- package/es/components/button-print/src/utils/print.d.ts +5 -1
- package/es/components/button-print/src/utils/print.js +1 -432
- package/es/components/editor/index.js +1 -10
- package/es/components/editor/src/Editor.js +1 -77
- package/es/components/fabric-chart/index.js +1 -10
- package/es/components/fabric-chart/src/FabricChart.vue.js +1 -71
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -118
- package/es/components/fabric-chart/src/components/PopupTip.vue.js +1 -34
- package/es/components/fabric-chart/src/components/useStyle.js +1 -36
- package/es/components/fabric-chart/src/hooks/constant.js +1 -78
- package/es/components/fabric-chart/src/hooks/index.js +1 -11
- package/es/components/fabric-chart/src/hooks/useBirthProcess.js +1 -642
- package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -153
- package/es/components/fabric-chart/src/hooks/useBottom.js +1 -91
- package/es/components/fabric-chart/src/hooks/useCenter.js +1 -734
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -32
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -79
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -182
- package/es/components/fabric-chart/src/hooks/useEvent.js +1 -146
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -54
- package/es/components/fabric-chart/src/hooks/useLeft.js +1 -331
- package/es/components/fabric-chart/src/hooks/useOther.js +1 -95
- package/es/components/fabric-chart/src/hooks/useRight.js +1 -22
- package/es/components/fabric-chart/src/hooks/useShadow.js +1 -132
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +1 -341
- package/es/components/fabric-chart/src/hooks/useTop.js +1 -154
- package/es/components/fabric-chart/src/utils/index.js +1 -15624
- package/es/components/fabric-chart/src/utils/utils.js +1 -32
- package/es/components/field-set/index.js +1 -10
- package/es/components/field-set/src/FieldSet.vue.js +1 -470
- package/es/components/form-config/index.d.ts +1 -1
- package/es/components/form-config/index.js +1 -10
- package/es/components/form-config/src/FormConfig.vue.d.ts +1 -1
- package/es/components/form-config/src/FormConfig.vue.js +1 -124
- package/es/components/form-config/src/components/FormConfigCreator.vue.js +1 -100
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -45
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.js +1 -97
- package/es/components/form-config/src/components/FormConfigMaterialItem.js +1 -28
- package/es/components/form-config/src/components/index.js +1 -6
- package/es/components/form-config/src/components/renderer/CloseButton.vue.js +1 -45
- package/es/components/form-config/src/components/renderer/ComplexNode.vue.js +1 -45
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -60
- package/es/components/form-config/src/components/renderer/index.js +1 -3
- package/es/components/form-config/src/constants/index.js +1 -61
- package/es/components/form-config/src/hooks/index.js +1 -3
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -90
- package/es/components/form-config/src/hooks/useDataNormalize.js +1 -35
- package/es/components/form-config/src/hooks/usePresetRenderer.js +1 -36
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -42
- package/es/components/form-config/src/utils/index.js +1 -26
- package/es/components/form-render/index.js +1 -30
- package/es/components/form-render/src/FormRender.vue.js +1 -239
- package/es/components/form-render/src/FormRenderWrapper.vue.js +1 -49
- package/es/components/form-render/src/components/renderer/combination.js +1 -114
- package/es/components/form-render/src/components/renderer/complex.js +1 -37
- package/es/components/form-render/src/components/renderer/date.js +1 -171
- package/es/components/form-render/src/components/renderer/formItem.js +1 -128
- package/es/components/form-render/src/components/renderer/index.js +1 -43
- package/es/components/form-render/src/components/renderer/input.js +1 -50
- package/es/components/form-render/src/components/renderer/inputGroup.js +1 -11
- package/es/components/form-render/src/components/renderer/inputNumber.js +1 -55
- package/es/components/form-render/src/components/renderer/jsonCombination/hooks/useDeepValidate.js +1 -35
- package/es/components/form-render/src/components/renderer/jsonCombination/index.js +1 -175
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -274
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +1 -71
- package/es/components/form-render/src/components/renderer/lineBar/index.js +1 -11
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -111
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -139
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -244
- package/es/components/form-render/src/components/renderer/select.js +1 -176
- package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -57
- package/es/components/form-render/src/components/renderer/slider.js +1 -38
- package/es/components/form-render/src/components/renderer/switch.js +1 -48
- package/es/components/form-render/src/components/renderer/textarea.js +1 -36
- package/es/components/form-render/src/components/tooltipMessage.vue.js +1 -37
- package/es/components/form-render/src/constants/index.js +1 -59
- package/es/components/form-render/src/hooks/index.js +1 -15
- package/es/components/form-render/src/hooks/useAnchor.js +1 -99
- package/es/components/form-render/src/hooks/useAsyncQueue.js +1 -153
- package/es/components/form-render/src/hooks/useAutoHidden.js +1 -43
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -119
- package/es/components/form-render/src/hooks/useChangeContext.js +1 -20
- package/es/components/form-render/src/hooks/useCommonInjection.js +1 -43
- package/es/components/form-render/src/hooks/useCommonLog.js +1 -12
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -225
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -290
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -65
- package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -46
- package/es/components/form-render/src/hooks/useFormContext.js +1 -70
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -140
- package/es/components/form-render/src/hooks/useFormField.js +1 -13
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -31
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle.js +1 -10
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -278
- package/es/components/form-render/src/hooks/useFormRequest.js +1 -42
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -83
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -85
- package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -18
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -22
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/types/fieldItem.js +1 -1
- package/es/components/form-render/src/types/index.js +1 -1
- package/es/components/form-render/src/utils/business.js +1 -114
- package/es/components/form-render/src/utils/dom.js +1 -38
- package/es/components/form-render/src/utils/index.js +1 -241
- package/es/components/form-render/src/utils/schema.js +1 -105
- package/es/components/grid/index.js +1 -11
- package/es/components/grid/src/Grid.js +1 -28
- package/es/components/grid/src/hooks.js +1 -168
- package/es/components/iho-table/index.js +1 -36
- package/es/components/iho-table/src/IhoTable.vue.js +1 -157
- package/es/components/iho-table/src/constants/index.js +1 -157
- package/es/components/iho-table/src/hooks/export.js +1 -2
- package/es/components/iho-table/src/hooks/index.js +1 -2
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -159
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.js +1 -67
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -26
- package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.js +1 -27
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -280
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.js +1 -26
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.js +1 -38
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -27
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -164
- package/es/components/iho-table/src/hooks/useTableContext.js +1 -17
- package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -20
- package/es/components/iho-table/src/plugins/anchorPlugin/index.js +1 -19
- package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.js +1 -51
- package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +1 -87
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -48
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +1 -230
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +1 -240
- package/es/components/iho-table/src/plugins/index.js +1 -47
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -30
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -127
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +1 -203
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -41
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -21
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -41
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -79
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -64
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -46
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -16
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.js +1 -108
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -163
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +1 -42
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +1 -50
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -30
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +1 -48
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -62
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -52
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +1 -92
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -59
- package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +1 -34
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.js +1 -30
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -53
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -100
- package/es/components/iho-table/src/types/index.js +1 -1
- package/es/components/iho-table/src/types/pluginType.js +1 -16
- package/es/components/iho-table/src/utils/index.js +1 -169
- package/es/components/index.js +1 -119
- package/es/components/info-header/index.js +1 -10
- package/es/components/info-header/src/HiddenContent.vue.js +1 -70
- package/es/components/info-header/src/InfoEllipsis.vue.js +1 -43
- package/es/components/info-header/src/InfoHeader.vue.js +1 -313
- package/es/components/insurance-sdk/index.js +1 -1
- package/es/components/insurance-sdk/src/constants/index.js +1 -160
- package/es/components/insurance-sdk/src/utils/index.js +1 -1
- package/es/components/insurance-sdk/src/utils/insurance.js +1 -268
- package/es/components/keyboard/index.d.ts +4 -21
- package/es/components/keyboard/index.js +1 -10
- package/es/components/keyboard/src/Keyboard.vue.d.ts +4 -21
- package/es/components/keyboard/src/Keyboard.vue.js +1 -164
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +2 -19
- package/es/components/keyboard/src/components/InputNumber.vue.js +1 -94
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +4 -21
- package/es/components/keyboard/src/components/NumberPanel.vue.js +1 -299
- package/es/components/keyboard/src/utils/index.js +1 -5
- package/es/components/map/index.js +1 -10
- package/es/components/map/src/Map.vue.js +1 -336
- package/es/components/recommend-search/index.js +1 -10
- package/es/components/recommend-search/src/RecommendSearch.vue.js +1 -63
- package/es/components/recommend-search/src/components/BaseSearch.vue.js +1 -157
- package/es/components/recommend-search/src/components/RecommendInput.vue.js +1 -125
- package/es/components/recommend-search/src/components/RecommendMenu.vue.js +1 -104
- package/es/components/recommend-search/src/components/RecommendSelect.vue.js +1 -146
- package/es/components/recommend-search/src/constant/index.js +1 -7
- package/es/components/scale-view/index.js +1 -35
- package/es/components/scale-view/src/ScaleView.vue.d.ts +0 -3
- package/es/components/scale-view/src/ScaleView.vue.js +1 -429
- package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -80
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -117
- package/es/components/scale-view/src/components/EvaluatePage.vue.js +1 -141
- package/es/components/scale-view/src/components/LoadingCom.vue.js +1 -19
- package/es/components/scale-view/src/components/NoData.vue.js +1 -74
- package/es/components/scale-view/src/components/ScaleScore.js +1 -63
- package/es/components/scale-view/src/components/composables/choose-common.js +1 -83
- package/es/components/scale-view/src/components/formitem/address.js +1 -3993
- package/es/components/scale-view/src/components/formitem/r-address.js +1 -226
- package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -133
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -281
- package/es/components/scale-view/src/components/formitem/r-collection.js +1 -111
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -212
- package/es/components/scale-view/src/components/formitem/r-input.js +1 -86
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -106
- package/es/components/scale-view/src/components/formitem/r-radio.js +1 -240
- package/es/components/scale-view/src/components/formitem/r-select.js +1 -202
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -177
- package/es/components/scale-view/src/components/formitem/r-upload.js +1 -215
- package/es/components/scale-view/src/components/formitem/sign-com.js +1 -307
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -129
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -354
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -437
- package/es/components/scale-view/src/hooks/scaleview-props.js +1 -81
- package/es/components/scale-view/src/hooks/scaleview-state.js +1 -38
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -154
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -187
- package/es/components/scale-view/src/hooks/use-component.js +1 -86
- package/es/components/scale-view/src/hooks/use-evaluate.js +1 -150
- package/es/components/scale-view/src/hooks/use-event.js +1 -129
- package/es/components/scale-view/src/hooks/use-noData.js +1 -41
- package/es/components/scale-view/src/utils/judge-types.js +1 -36
- package/es/components/search-cascader/index.js +1 -10
- package/es/components/search-cascader/src/SearchCascader.vue.js +1 -194
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -196
- package/es/components/search-cascader/src/components/index.js +1 -1
- package/es/components/search-cascader/src/constants/index.js +1 -11
- package/es/components/search-cascader/src/hooks/index.js +1 -1
- package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -7
- package/es/components/search-cascader/src/utils/index.js +1 -11
- package/es/components/select-label/index.js +1 -15
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -447
- package/es/components/select-label/src/SelectLabel.vue.js +1 -6
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -451
- package/es/components/select-label/src/components/label-classify.vue.js +1 -132
- package/es/components/select-person/index.js +1 -10
- package/es/components/select-person/src/SelectPerson.vue.js +1 -6
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -303
- package/es/components/select-person/src/utils/index.js +1 -58
- package/es/components/shortcut-provider/index.js +1 -12
- package/es/components/shortcut-provider/src/ShortcutProvider.vue.js +1 -42
- package/es/components/shortcut-provider/src/constants/index.js +1 -8
- package/es/components/shortcut-provider/src/hooks/index.js +1 -2
- package/es/components/shortcut-provider/src/hooks/useShortcutSignature.js +1 -12
- package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -188
- package/es/components/shortcut-provider/src/utils/index.js +1 -92
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/index.js +1 -10
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.js +1 -98
- package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.js +1 -76
- package/es/components/steps-wheel/index.js +1 -10
- package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -376
- package/es/components/table-filter/index.js +1 -21
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.d.ts +3 -0
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +1 -2272
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1 -1315
- package/es/components/table-filter/src/classification/search-class-name.vue.js +1 -195
- package/es/components/table-filter/src/classification/search-professional-model.vue.js +1 -594
- package/es/components/table-filter/src/components/age-com/index.vue.js +1 -185
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.js +1 -86
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.js +1 -30
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.js +1 -253
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.js +1 -114
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -14
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -87
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -147
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -304
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.js +1 -153
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +1 -310
- package/es/components/table-filter/src/components/range-age/index.vue.js +1 -137
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +1 -64
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -45
- package/es/components/table-filter/src/components/render-widget/components/index.js +1 -2
- package/es/components/table-filter/src/components/render-widget/enums.js +1 -27
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +1 -70
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -107
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -152
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.js +1 -1520
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.js +1 -171
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.js +1 -199
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.js +1 -241
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.js +1 -526
- package/es/components/table-filter/src/const/dataOptions.js +1 -107
- package/es/components/table-filter/src/const/index.js +1 -5
- package/es/components/table-filter/src/directive/flexibleResize.js +1 -157
- package/es/components/table-filter/src/directive/preventReClick.js +1 -14
- package/es/components/table-filter/src/directive/resize.js +1 -12
- package/es/components/table-filter/src/hooks/export.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -64
- package/es/components/table-filter/src/hooks/useMixins.js +1 -532
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -94
- package/es/components/table-filter/src/hooks/useTableSearchCon.js +1 -131
- package/es/components/table-filter/src/hooks/useWordBookutils.js +1 -91
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +4 -3
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +1 -2038
- package/es/components/table-filter/src/tool/generateDefOptions.js +1 -65
- package/es/components/table-filter/src/tool/getWidgetType.js +1 -27
- package/es/components/table-filter/src/tool/options.js +1 -200
- package/es/components/table-filter/src/tool/resizeSensor.js +1 -123
- package/es/components/table-filter/src/tool/time-domain.js +1 -100
- package/es/components/table-filter/src/tool/transformData.js +1 -169
- package/es/components/table-filter/src/tool/utils.js +1 -29
- package/es/components/table-filter/src/types/enums.js +1 -67
- package/es/components/time-line/index.js +1 -10
- package/es/components/time-line/src/TimeLine.vue.js +1 -70
- package/es/components/vod-chunk-upload/index.js +1 -14
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.js +1 -480
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -70
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +1 -96
- package/es/components/vod-chunk-upload/src/hooks/vod-computed.js +1 -79
- package/es/components/vod-chunk-upload/src/hooks/vod-data.js +1 -28
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/index.js +1 -2
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -332
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -94
- package/es/env.d.ts +24 -24
- package/es/shared/assets/img/failure.png.js +1 -3
- package/es/shared/assets/img/no-permission.png.js +1 -3
- package/es/shared/assets/img/nodata.png.js +1 -3
- package/es/shared/assets/img/notfound.png.js +1 -3
- package/es/shared/assets/img/qr.png.js +1 -3
- package/es/shared/assets/img/success.png.js +1 -3
- package/es/shared/assets/img/video.png.js +1 -3
- package/es/shared/assets/img/video_default_cover.png.js +1 -3
- package/es/shared/assets/img/xb_big.png.js +1 -3
- package/es/shared/assets/img/xb_small.png.js +1 -3
- package/es/shared/components/SelectPage/SelectPage.vue.js +1 -61
- package/es/shared/components/SelectPage/index.js +1 -2
- package/es/shared/components/SlotRender/SlotRender.js +1 -35
- package/es/shared/components/SlotRender/index.js +1 -2
- package/es/shared/components/SvgIcon/SvgIcon.vue.js +1 -36
- package/es/shared/components/SvgIcon/index.js +1 -2
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -77
- package/es/shared/components/TextOverTooltip/index.js +1 -2
- package/es/shared/components/VueDraggable/index.js +1 -2
- package/es/shared/components/VueDraggable/src/core/componentBuilderHelper.js +1 -35
- package/es/shared/components/VueDraggable/src/core/componentStructure.js +1 -54
- package/es/shared/components/VueDraggable/src/core/renderHelper.js +1 -47
- package/es/shared/components/VueDraggable/src/core/sortableEvents.js +1 -14
- package/es/shared/components/VueDraggable/src/util/console.js +1 -9
- package/es/shared/components/VueDraggable/src/util/htmlHelper.js +1 -11
- package/es/shared/components/VueDraggable/src/util/string.js +1 -11
- package/es/shared/components/VueDraggable/src/util/tags.js +1 -130
- package/es/shared/components/VueDraggable/src/vuedraggable.js +1 -265
- package/es/shared/components/no-data/NoData.vue.js +1 -74
- package/es/shared/components/no-data/index.js +1 -2
- package/es/shared/components/player-vod/player.js +1 -121
- package/es/shared/components/player-vod/video-modal.js +1 -91
- package/es/shared/global/variable.js +1 -3
- package/es/shared/utils/anime.js +1 -129
- package/es/shared/utils/colorLog.js +1 -53
- package/es/shared/utils/index.js +1 -167
- package/es/shared/utils/loadViewer.js +1 -11
- package/es/shared/utils/tapable/AsyncParallelBailHook.js +1 -63
- package/es/shared/utils/tapable/AsyncParallelHook.js +1 -27
- package/es/shared/utils/tapable/AsyncSeriesBailHook.js +1 -18
- package/es/shared/utils/tapable/AsyncSeriesHook.js +1 -27
- package/es/shared/utils/tapable/AsyncSeriesLoopHook.js +1 -12
- package/es/shared/utils/tapable/AsyncSeriesWaterfallHook.js +1 -22
- package/es/shared/utils/tapable/Hook.js +1 -140
- package/es/shared/utils/tapable/HookCodeFactory.js +1 -456
- package/es/shared/utils/tapable/SyncBailHook.js +1 -19
- package/es/shared/utils/tapable/SyncHook.js +1 -34
- package/es/shared/utils/tapable/SyncLoopHook.js +1 -13
- package/es/shared/utils/tapable/SyncWaterfallHook.js +1 -47
- package/es/shared/utils/utilExpand.js +1 -781
- package/es/shared/utils/vexutils.js +1 -59
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1,303 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { NGrid, NGi, NSpace, NInputGroup, NInput, NButton, NCheckbox, NTree, NIcon, NTooltip } from 'naive-ui';
|
|
3
|
-
import { CloseCircleSharp } from '@vicons/ionicons5';
|
|
4
|
-
import { filterTree, getExpandedKeys } from './utils/index.js';
|
|
5
|
-
import { cloneDeep } from 'lodash-es';
|
|
6
|
-
|
|
7
|
-
const _hoisted_1 = {
|
|
8
|
-
key: 0
|
|
9
|
-
};
|
|
10
|
-
const _hoisted_2 = {
|
|
11
|
-
class: "c-select-person__scroll",
|
|
12
|
-
style: {
|
|
13
|
-
"height": "342px"
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
-
__name: "SelectPerson",
|
|
18
|
-
props: {
|
|
19
|
-
defaultList: {
|
|
20
|
-
type: Array,
|
|
21
|
-
default: () => []
|
|
22
|
-
},
|
|
23
|
-
data: {
|
|
24
|
-
type: Array,
|
|
25
|
-
default: () => []
|
|
26
|
-
},
|
|
27
|
-
searchPlaceholder: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22"
|
|
30
|
-
},
|
|
31
|
-
searchButtonText: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "\u641C\u7D22"
|
|
34
|
-
},
|
|
35
|
-
wordbook: {
|
|
36
|
-
type: Object,
|
|
37
|
-
default: () => ({})
|
|
38
|
-
},
|
|
39
|
-
wordbookChild: {
|
|
40
|
-
type: Object,
|
|
41
|
-
default: () => ({})
|
|
42
|
-
},
|
|
43
|
-
showCount: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: true
|
|
46
|
-
},
|
|
47
|
-
showClear: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: true
|
|
50
|
-
},
|
|
51
|
-
multiple: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: true
|
|
54
|
-
},
|
|
55
|
-
queryLoadChildData: {
|
|
56
|
-
type: Function,
|
|
57
|
-
default: void 0
|
|
58
|
-
},
|
|
59
|
-
queryTreeSearch: {
|
|
60
|
-
type: Function,
|
|
61
|
-
default: () => Promise.resolve([])
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
emits: ["check"],
|
|
65
|
-
setup(__props, {
|
|
66
|
-
emit
|
|
67
|
-
}) {
|
|
68
|
-
const props = __props;
|
|
69
|
-
const keyword = ref("");
|
|
70
|
-
const checkedAll = ref(false);
|
|
71
|
-
const checkedKeys = ref([]);
|
|
72
|
-
const expandedKeys = ref([]);
|
|
73
|
-
const treeData = ref([]);
|
|
74
|
-
const tagData = ref([]);
|
|
75
|
-
const temp = cloneDeep(props.data);
|
|
76
|
-
let allCheckedKeys = [];
|
|
77
|
-
const isRemote = computed(() => props.queryLoadChildData ? true : false);
|
|
78
|
-
init();
|
|
79
|
-
function init() {
|
|
80
|
-
transformTree(temp);
|
|
81
|
-
treeData.value = temp;
|
|
82
|
-
if (props.defaultList.length > 0) {
|
|
83
|
-
if (isRemote.value) {
|
|
84
|
-
props.defaultList.forEach((key) => checkedKeys.value.push(key.key));
|
|
85
|
-
tagData.value = cloneDeep(props.defaultList);
|
|
86
|
-
} else {
|
|
87
|
-
props.defaultList.forEach((key) => checkedKeys.value.push(key));
|
|
88
|
-
setTagData(temp);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function transformTree(tree) {
|
|
92
|
-
var _a, _b;
|
|
93
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
94
|
-
const item = tree[i];
|
|
95
|
-
item.title = getLabelName(item);
|
|
96
|
-
if (!item.key)
|
|
97
|
-
item.key = item[props.wordbookChild.user_id_obj] || item[props.wordbook.parent_id_obj] || Date.now();
|
|
98
|
-
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
99
|
-
transformTree(item.children);
|
|
100
|
-
setDisabled(item);
|
|
101
|
-
} else if (((_b = item.children) == null ? void 0 : _b.length) === 0) {
|
|
102
|
-
Reflect.deleteProperty(item, "children");
|
|
103
|
-
}
|
|
104
|
-
if (!item.disabled && !item.children)
|
|
105
|
-
allCheckedKeys.push(item.key);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function setDisabled(data) {
|
|
110
|
-
var _a;
|
|
111
|
-
const isDisabled = (_a = data.children) == null ? void 0 : _a.every((item) => item.disabled);
|
|
112
|
-
if (isDisabled)
|
|
113
|
-
data.disabled = true;
|
|
114
|
-
}
|
|
115
|
-
function renderLabel({
|
|
116
|
-
option
|
|
117
|
-
}) {
|
|
118
|
-
var _a;
|
|
119
|
-
if (((_a = option.children) == null ? void 0 : _a.length) || isRemote.value && !(option == null ? void 0 : option.isLeaf)) {
|
|
120
|
-
const count = props.wordbook.user_count_obj ? option[props.wordbook.user_count_obj] || "" : "";
|
|
121
|
-
const countText = count ? `(${count})` : "";
|
|
122
|
-
return createVNode("span", null, [`${option.title}${countText}`]);
|
|
123
|
-
} else {
|
|
124
|
-
return createVNode(NTooltip, {
|
|
125
|
-
"trigger": "hover"
|
|
126
|
-
}, {
|
|
127
|
-
default: () => createVNode("span", null, [option.title]),
|
|
128
|
-
trigger: () => createVNode("span", null, [option.title])
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
function getLabelName(option) {
|
|
133
|
-
return option[props.wordbookChild.user_name_obj] || option[props.wordbook.parent_name_obj] || option["orgName"] || option["title"] || "";
|
|
134
|
-
}
|
|
135
|
-
function setAllCheckedKeys(tree) {
|
|
136
|
-
var _a;
|
|
137
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
138
|
-
const item = tree[i];
|
|
139
|
-
((_a = item.children) == null ? void 0 : _a.length) && setAllCheckedKeys(item.children);
|
|
140
|
-
if (!item.disabled && !item.children)
|
|
141
|
-
allCheckedKeys.push(item.key);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async function onSearch() {
|
|
145
|
-
if (!isRemote.value) {
|
|
146
|
-
treeData.value = filterTree(temp, keyword.value);
|
|
147
|
-
allCheckedKeys = [];
|
|
148
|
-
setAllCheckedKeys(treeData.value);
|
|
149
|
-
setCheckedAll();
|
|
150
|
-
} else {
|
|
151
|
-
treeData.value = await props.queryTreeSearch(keyword.value);
|
|
152
|
-
}
|
|
153
|
-
expandedKeys.value = treeData.value.length && keyword.value ? getExpandedKeys(treeData.value) : [];
|
|
154
|
-
}
|
|
155
|
-
function setTreeCheckd(tree, checked) {
|
|
156
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
157
|
-
const item = tree[i];
|
|
158
|
-
if (!item.disabled && (!item.children || item.isLeaf)) {
|
|
159
|
-
if (checked && !checkedKeys.value.includes(item.key)) {
|
|
160
|
-
checkedKeys.value.push(item.key);
|
|
161
|
-
}
|
|
162
|
-
if (!checked) {
|
|
163
|
-
const keyIndex = checkedKeys.value.findIndex((key) => key === item.key);
|
|
164
|
-
checkedKeys.value.splice(keyIndex, 1);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
item.children && setTreeCheckd(item.children, checked);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function checkedAllChange(checked) {
|
|
171
|
-
setTreeCheckd(treeData.value, checked);
|
|
172
|
-
}
|
|
173
|
-
function setTagData(tree) {
|
|
174
|
-
var _a;
|
|
175
|
-
for (let i = 0, len = tree.length; i < len; i++) {
|
|
176
|
-
const item = tree[i];
|
|
177
|
-
checkedKeys.value.includes(item.key) && tagData.value.push({
|
|
178
|
-
key: item.key,
|
|
179
|
-
name: item.title
|
|
180
|
-
});
|
|
181
|
-
((_a = item.children) == null ? void 0 : _a.length) && setTagData(item.children);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
function updateTreeChecked(keys) {
|
|
185
|
-
checkedKeys.value = keys;
|
|
186
|
-
}
|
|
187
|
-
function setCheckedAll() {
|
|
188
|
-
checkedAll.value = allCheckedKeys.every((key) => tagData.value.findIndex((tag) => tag.key === key) > -1);
|
|
189
|
-
}
|
|
190
|
-
function clearAll() {
|
|
191
|
-
checkedKeys.value = [];
|
|
192
|
-
}
|
|
193
|
-
function closeTag(tag) {
|
|
194
|
-
checkedKeys.value = checkedKeys.value.filter((key) => key !== tag.key);
|
|
195
|
-
}
|
|
196
|
-
watch(() => checkedKeys, (value) => {
|
|
197
|
-
tagData.value = [];
|
|
198
|
-
value.value.length && setTagData(isRemote.value ? treeData.value : temp);
|
|
199
|
-
setCheckedAll();
|
|
200
|
-
emit("check", value.value);
|
|
201
|
-
}, {
|
|
202
|
-
deep: true
|
|
203
|
-
});
|
|
204
|
-
return (_ctx, _cache) => {
|
|
205
|
-
return openBlock(), createBlock(unref(NGrid), {
|
|
206
|
-
cols: 2,
|
|
207
|
-
class: "c-select-person"
|
|
208
|
-
}, {
|
|
209
|
-
default: withCtx(() => [createVNode(unref(NGi), null, {
|
|
210
|
-
default: withCtx(() => [createVNode(unref(NSpace), {
|
|
211
|
-
vertical: "",
|
|
212
|
-
style: {
|
|
213
|
-
"padding-right": "12px",
|
|
214
|
-
"border-right": "1px solid #e8e8e8"
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
default: withCtx(() => [createVNode(unref(NInputGroup), {
|
|
218
|
-
style: {
|
|
219
|
-
"margin-bottom": "12px"
|
|
220
|
-
}
|
|
221
|
-
}, {
|
|
222
|
-
default: withCtx(() => [createVNode(unref(NInput), {
|
|
223
|
-
clearable: "",
|
|
224
|
-
value: keyword.value,
|
|
225
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => keyword.value = $event),
|
|
226
|
-
placeholder: __props.searchPlaceholder,
|
|
227
|
-
onKeyup: withKeys(onSearch, ["enter"])
|
|
228
|
-
}, null, 8, ["value", "placeholder", "onKeyup"]), createVNode(unref(NButton), {
|
|
229
|
-
type: "primary",
|
|
230
|
-
onClick: onSearch
|
|
231
|
-
}, {
|
|
232
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchButtonText), 1)]),
|
|
233
|
-
_: 1
|
|
234
|
-
})]),
|
|
235
|
-
_: 1
|
|
236
|
-
}), __props.multiple ? withDirectives((openBlock(), createBlock(unref(NCheckbox), {
|
|
237
|
-
key: 0,
|
|
238
|
-
checked: checkedAll.value,
|
|
239
|
-
"onUpdate:checked": [_cache[1] || (_cache[1] = ($event) => checkedAll.value = $event), checkedAllChange]
|
|
240
|
-
}, {
|
|
241
|
-
default: withCtx(() => [createTextVNode(" \u5168\u9009 ")]),
|
|
242
|
-
_: 1
|
|
243
|
-
}, 8, ["checked"])), [[vShow, unref(allCheckedKeys).length < 1e3]]) : createCommentVNode("v-if", true), createVNode(unref(NTree), {
|
|
244
|
-
"virtual-scroll": "",
|
|
245
|
-
class: "c-select-person__scroll",
|
|
246
|
-
"checked-keys": checkedKeys.value,
|
|
247
|
-
"expanded-keys": expandedKeys.value,
|
|
248
|
-
"onUpdate:expanded-keys": _cache[2] || (_cache[2] = ($event) => expandedKeys.value = $event),
|
|
249
|
-
checkable: __props.multiple,
|
|
250
|
-
cascade: "",
|
|
251
|
-
"allow-checking-not-loaded": "",
|
|
252
|
-
selectable: !__props.multiple,
|
|
253
|
-
"selected-keys": checkedKeys.value,
|
|
254
|
-
"onUpdate:selected-keys": _cache[3] || (_cache[3] = ($event) => checkedKeys.value = $event),
|
|
255
|
-
data: treeData.value,
|
|
256
|
-
"check-strategy": "child",
|
|
257
|
-
"render-label": renderLabel,
|
|
258
|
-
"onUpdate:checkedKeys": updateTreeChecked,
|
|
259
|
-
onLoad: __props.queryLoadChildData
|
|
260
|
-
}, null, 8, ["checked-keys", "expanded-keys", "checkable", "selectable", "selected-keys", "data", "onLoad"])]),
|
|
261
|
-
_: 1
|
|
262
|
-
})]),
|
|
263
|
-
_: 1
|
|
264
|
-
}), createVNode(unref(NGi), null, {
|
|
265
|
-
default: withCtx(() => [createVNode(unref(NSpace), {
|
|
266
|
-
vertical: "",
|
|
267
|
-
style: {
|
|
268
|
-
"padding-left": "12px"
|
|
269
|
-
}
|
|
270
|
-
}, {
|
|
271
|
-
default: withCtx(() => [createVNode(unref(NSpace), {
|
|
272
|
-
justify: "space-between",
|
|
273
|
-
style: {
|
|
274
|
-
"margin-bottom": "20px"
|
|
275
|
-
}
|
|
276
|
-
}, {
|
|
277
|
-
default: withCtx(() => [__props.showCount ? (openBlock(), createElementBlock("span", _hoisted_1, "\u5DF2\u9009\u62E9\uFF1A" + toDisplayString(tagData.value.length), 1)) : createCommentVNode("v-if", true), __props.showClear ? (openBlock(), createElementBlock("span", {
|
|
278
|
-
key: 1,
|
|
279
|
-
class: "c-select-person__clear-btn",
|
|
280
|
-
onClick: clearAll
|
|
281
|
-
}, "\u6E05\u7A7A")) : createCommentVNode("v-if", true)]),
|
|
282
|
-
_: 1
|
|
283
|
-
}), createElementVNode("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(tagData.value, (tag) => {
|
|
284
|
-
return openBlock(), createElementBlock("span", {
|
|
285
|
-
class: "c-select-person__tag-item",
|
|
286
|
-
key: tag.key
|
|
287
|
-
}, [createTextVNode(toDisplayString(tag.name) + " ", 1), createVNode(unref(NIcon), {
|
|
288
|
-
class: "tag-close",
|
|
289
|
-
component: unref(CloseCircleSharp),
|
|
290
|
-
onClick: ($event) => closeTag(tag)
|
|
291
|
-
}, null, 8, ["component", "onClick"])]);
|
|
292
|
-
}), 128))])]),
|
|
293
|
-
_: 1
|
|
294
|
-
})]),
|
|
295
|
-
_: 1
|
|
296
|
-
})]),
|
|
297
|
-
_: 1
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
export { _sfc_main as default };
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as a,openBlock as n,createBlock as o,unref as u,withCtx as d,createVNode as c,withKeys as r,createTextVNode as i,toDisplayString as s,withDirectives as v,vShow as h,createCommentVNode as p,createElementBlock as f,createElementVNode as y,Fragment as k,renderList as b}from"vue";import{NGrid as g,NGi as m,NSpace as _,NInputGroup as w,NInput as x,NButton as C,NCheckbox as L,NTree as j,NIcon as q,NTooltip as B}from"naive-ui";import{CloseCircleSharp as P}from"@vicons/ionicons5";import{filterTree as S,getExpandedKeys as U}from"./utils/index.js";import{cloneDeep as D}from"lodash-es";const T={key:0},K={class:"c-select-person__scroll",style:{height:"342px"}};var $=e({__name:"SelectPerson",props:{defaultList:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},searchPlaceholder:{type:String,default:"输入关键字搜索"},searchButtonText:{type:String,default:"搜索"},wordbook:{type:Object,default:()=>({})},wordbookChild:{type:Object,default:()=>({})},showCount:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0},queryLoadChildData:{type:Function,default:void 0},queryTreeSearch:{type:Function,default:()=>Promise.resolve([])}},emits:["check"],setup(e,{emit:$}){const A=e,E=l(""),F=l(!1),I=l([]),O=l([]),N=l([]),R=l([]),z=D(A.data);let G=[];const H=t((()=>!!A.queryLoadChildData));function J(e){var l;(null==(l=e.children)?void 0:l.every((e=>e.disabled)))&&(e.disabled=!0)}function M({option:e}){var l;if((null==(l=e.children)?void 0:l.length)||H.value&&!(null==e?void 0:e.isLeaf)){const l=A.wordbook.user_count_obj&&e[A.wordbook.user_count_obj]||"",t=l?`(${l})`:"";return c("span",null,[`${e.title}${t}`])}return c(B,{trigger:"hover"},{default:()=>c("span",null,[e.title]),trigger:()=>c("span",null,[e.title])})}function Q(e){return e[A.wordbookChild.user_name_obj]||e[A.wordbook.parent_name_obj]||e.orgName||e.title||""}function V(e){var l;for(let t=0,a=e.length;t<a;t++){const a=e[t];(null==(l=a.children)?void 0:l.length)&&V(a.children),a.disabled||a.children||G.push(a.key)}}async function W(){H.value?N.value=await A.queryTreeSearch(E.value):(N.value=S(z,E.value),G=[],V(N.value),le()),O.value=N.value.length&&E.value?U(N.value):[]}function X(e,l){for(let t=0,a=e.length;t<a;t++){const a=e[t];if(!a.disabled&&(!a.children||a.isLeaf)&&(l&&!I.value.includes(a.key)&&I.value.push(a.key),!l)){const e=I.value.findIndex((e=>e===a.key));I.value.splice(e,1)}a.children&&X(a.children,l)}}function Y(e){X(N.value,e)}function Z(e){var l;for(let t=0,a=e.length;t<a;t++){const a=e[t];I.value.includes(a.key)&&R.value.push({key:a.key,name:a.title}),(null==(l=a.children)?void 0:l.length)&&Z(a.children)}}function ee(e){I.value=e}function le(){F.value=G.every((e=>R.value.findIndex((l=>l.key===e))>-1))}function te(){I.value=[]}return function e(l){var t,a;for(let n=0,o=l.length;n<o;n++){const o=l[n];o.title=Q(o),o.key||(o.key=o[A.wordbookChild.user_id_obj]||o[A.wordbook.parent_id_obj]||Date.now()),(null==(t=o.children)?void 0:t.length)?(e(o.children),J(o)):0===(null==(a=o.children)?void 0:a.length)&&Reflect.deleteProperty(o,"children"),o.disabled||o.children||G.push(o.key)}}(z),N.value=z,A.defaultList.length>0&&(H.value?(A.defaultList.forEach((e=>I.value.push(e.key))),R.value=D(A.defaultList)):(A.defaultList.forEach((e=>I.value.push(e))),Z(z))),a((()=>I),(e=>{R.value=[],e.value.length&&Z(H.value?N.value:z),le(),$("check",e.value)}),{deep:!0}),(l,t)=>(n(),o(u(g),{cols:2,class:"c-select-person"},{default:d((()=>[c(u(m),null,{default:d((()=>[c(u(_),{vertical:"",style:{"padding-right":"12px","border-right":"1px solid #e8e8e8"}},{default:d((()=>[c(u(w),{style:{"margin-bottom":"12px"}},{default:d((()=>[c(u(x),{clearable:"",value:E.value,"onUpdate:value":t[0]||(t[0]=e=>E.value=e),placeholder:e.searchPlaceholder,onKeyup:r(W,["enter"])},null,8,["value","placeholder","onKeyup"]),c(u(C),{type:"primary",onClick:W},{default:d((()=>[i(s(e.searchButtonText),1)])),_:1})])),_:1}),e.multiple?v((n(),o(u(L),{key:0,checked:F.value,"onUpdate:checked":[t[1]||(t[1]=e=>F.value=e),Y]},{default:d((()=>[i(" 全选 ")])),_:1},8,["checked"])),[[h,u(G).length<1e3]]):p("v-if",!0),c(u(j),{"virtual-scroll":"",class:"c-select-person__scroll","checked-keys":I.value,"expanded-keys":O.value,"onUpdate:expanded-keys":t[2]||(t[2]=e=>O.value=e),checkable:e.multiple,cascade:"","allow-checking-not-loaded":"",selectable:!e.multiple,"selected-keys":I.value,"onUpdate:selected-keys":t[3]||(t[3]=e=>I.value=e),data:N.value,"check-strategy":"child","render-label":M,"onUpdate:checkedKeys":ee,onLoad:e.queryLoadChildData},null,8,["checked-keys","expanded-keys","checkable","selectable","selected-keys","data","onLoad"])])),_:1})])),_:1}),c(u(m),null,{default:d((()=>[c(u(_),{vertical:"",style:{"padding-left":"12px"}},{default:d((()=>[c(u(_),{justify:"space-between",style:{"margin-bottom":"20px"}},{default:d((()=>[e.showCount?(n(),f("span",T,"已选择:"+s(R.value.length),1)):p("v-if",!0),e.showClear?(n(),f("span",{key:1,class:"c-select-person__clear-btn",onClick:te},"清空")):p("v-if",!0)])),_:1}),y("div",K,[(n(!0),f(k,null,b(R.value,(e=>(n(),f("span",{class:"c-select-person__tag-item",key:e.key},[i(s(e.name)+" ",1),c(u(q),{class:"tag-close",component:u(P),onClick:l=>function(e){I.value=I.value.filter((l=>l!==e.key))}(e)},null,8,["component","onClick"])])))),128))])])),_:1})])),_:1})])),_:1}))}});export{$ as default};
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function filterTree(data, keyword) {
|
|
4
|
-
const newData = cloneDeep(data);
|
|
5
|
-
transform(newData, keyword);
|
|
6
|
-
return filterHandle(newData);
|
|
7
|
-
}
|
|
8
|
-
function transform(data, keyword) {
|
|
9
|
-
data.forEach((item) => {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
item.visible = (_a = item.title) == null ? void 0 : _a.includes(keyword);
|
|
12
|
-
if ((_b = item.children) == null ? void 0 : _b.length) {
|
|
13
|
-
transform(item.children, keyword);
|
|
14
|
-
if (item.visible) {
|
|
15
|
-
setVisible(item.children);
|
|
16
|
-
} else {
|
|
17
|
-
const isVisible = item.children.some((child) => child.visible);
|
|
18
|
-
if (isVisible)
|
|
19
|
-
item.visible = true;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function setVisible(data) {
|
|
25
|
-
data.forEach((item) => {
|
|
26
|
-
var _a;
|
|
27
|
-
item.visible = true;
|
|
28
|
-
((_a = item.children) == null ? void 0 : _a.length) && setVisible(item.children);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function filterHandle(data) {
|
|
32
|
-
return data.filter((item) => {
|
|
33
|
-
var _a;
|
|
34
|
-
if (item.visible) {
|
|
35
|
-
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
36
|
-
item.children = filterHandle(item.children);
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function getExpandedKeys(tree) {
|
|
44
|
-
const expandedKeys = [];
|
|
45
|
-
getExpandedKeys2(tree);
|
|
46
|
-
function getExpandedKeys2(tree2) {
|
|
47
|
-
for (let i = 0, len = tree2.length; i < len; i++) {
|
|
48
|
-
const item = tree2[i];
|
|
49
|
-
if (item.children) {
|
|
50
|
-
expandedKeys.push(item.key);
|
|
51
|
-
getExpandedKeys2(item.children);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return expandedKeys;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { filterTree, getExpandedKeys };
|
|
1
|
+
import{cloneDeep as i}from"lodash-es";function n(n,l){const c=i(n);return e(c,l),r(c)}function e(i,n){i.forEach((i=>{var r,c;if(i.visible=null==(r=i.title)?void 0:r.includes(n),null==(c=i.children)?void 0:c.length)if(e(i.children,n),i.visible)l(i.children);else{i.children.some((i=>i.visible))&&(i.visible=!0)}}))}function l(i){i.forEach((i=>{var n;i.visible=!0,(null==(n=i.children)?void 0:n.length)&&l(i.children)}))}function r(i){return i.filter((i=>{var n;return!!i.visible&&((null==(n=i.children)?void 0:n.length)&&(i.children=r(i.children)),!0)}))}function c(i){const n=[];return function i(e){for(let l=0,r=e.length;l<r;l++){const r=e[l];r.children&&(n.push(r.key),i(r.children))}}(i),n}export{n as filterTree,c as getExpandedKeys};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { safeComponentRegister } from '../../shared/utils/index.js';
|
|
3
|
-
import script from './src/ShortcutProvider.vue.js';
|
|
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
|
+
import{COMPONENT_NAMESPACE as r}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import t from"./src/ShortcutProvider.vue.js";export{GlobalShortcutProvider,ShortcutManager,useShortcuts}from"./src/hooks/useShortcuts.js";export{useShortcutSignature}from"./src/hooks/useShortcutSignature.js";const s=t;s.install=function(t){o(t,s,r+"ShortcutProvider")};export{s as default};
|
|
@@ -1,42 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { uuidGenerator } from '../../../shared/utils/index.js';
|
|
3
|
-
import { InjectionShortcutManager } from './constants/index.js';
|
|
4
|
-
import '../index.js';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
6
|
-
import { ShortcutManager } from './hooks/useShortcuts.js';
|
|
7
|
-
|
|
8
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "ShortcutProvider",
|
|
10
|
-
props: {
|
|
11
|
-
scope: { type: [String, Symbol] },
|
|
12
|
-
autoFocus: { type: Boolean, default: true }
|
|
13
|
-
},
|
|
14
|
-
setup(__props) {
|
|
15
|
-
const props = __props;
|
|
16
|
-
const shortcutWrapperRef = ref();
|
|
17
|
-
const manager = new ShortcutManager(shortcutWrapperRef, props.scope || uuidGenerator()).start();
|
|
18
|
-
provide(InjectionShortcutManager, manager);
|
|
19
|
-
onBeforeUnmount(() => {
|
|
20
|
-
manager.destroy();
|
|
21
|
-
});
|
|
22
|
-
onMounted(() => {
|
|
23
|
-
var _a;
|
|
24
|
-
return (_a = shortcutWrapperRef.value) == null ? void 0 : _a.focus();
|
|
25
|
-
});
|
|
26
|
-
return (_ctx, _cache) => {
|
|
27
|
-
return openBlock(), createElementBlock("section", {
|
|
28
|
-
ref_key: "shortcutWrapperRef",
|
|
29
|
-
ref: shortcutWrapperRef,
|
|
30
|
-
"is-shortcut-capture": "",
|
|
31
|
-
class: "shortcut-provider",
|
|
32
|
-
tabindex: -9999
|
|
33
|
-
}, [
|
|
34
|
-
createCommentVNode(" \u9700\u8981\u7ED1\u5B9A\u8BE5\u4F5C\u7528\u57DF\u5FEB\u6377\u952E\u7684\u5185\u5BB9 "),
|
|
35
|
-
renderSlot(_ctx.$slots, "default")
|
|
36
|
-
], 512);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
var script = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "ShortcutProvider.vue"]]);
|
|
41
|
-
|
|
42
|
-
export { script as default };
|
|
1
|
+
import{defineComponent as r,ref as t,provide as e,onBeforeUnmount as o,onMounted as s,openBlock as u,createElementBlock as i,createCommentVNode as p,renderSlot as a}from"vue";import{uuidGenerator as n}from"../../../shared/utils/index.js";import{InjectionShortcutManager as c}from"./constants/index.js";import"../index.js";import l from"../../../_virtual/plugin-vue_export-helper.js";import{ShortcutManager as d}from"./hooks/useShortcuts.js";var f=l(r({__name:"ShortcutProvider",props:{scope:{type:[String,Symbol]},autoFocus:{type:Boolean,default:!0}},setup(r){const l=r,f=t(),m=new d(f,l.scope||n()).start();return e(c,m),o((()=>{m.destroy()})),s((()=>{var r;return null==(r=f.value)?void 0:r.focus()})),(r,t)=>(u(),i("section",{ref_key:"shortcutWrapperRef",ref:f,"is-shortcut-capture":"",class:"shortcut-provider",tabindex:-9999},[p(" 需要绑定该作用域快捷键的内容 "),a(r.$slots,"default")],512))}}),[["__file","ShortcutProvider.vue"]]);export{f as default};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
var
|
|
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
|
+
var I=(I=>(I[I.INACTIVE=0]="INACTIVE",I[I.ACTIVE=1]="ACTIVE",I))(I||{});const o=Symbol("InjectionShortcutManager");export{o as InjectionShortcutManager,I as ShortcutStatus};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { useShortcutSignature } from './useShortcutSignature.js';
|
|
1
|
+
export{GlobalShortcutProvider,ShortcutManager,useShortcuts}from"./useShortcuts.js";export{useShortcutSignature}from"./useShortcutSignature.js";
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{ref as t,computed as r}from"vue";import{transformKey2DisplaySignature as o}from"../utils/index.js";function e(){const e=t((()=>"")),u=r((()=>o(e.value())));return{signatureRef:e,shortcut:u}}export{e as useShortcutSignature};
|
|
@@ -1,188 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEventListener, useDebounceFn } from '@vueuse/core';
|
|
3
|
-
import { once, pick, omit, isFunction, isString } from 'lodash-es';
|
|
4
|
-
import { reactive, ref, unref, computed, getCurrentInstance, inject, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
5
|
-
import { ShortcutStatus, InjectionShortcutManager } from '../constants/index.js';
|
|
6
|
-
import { normalizeSignatureInfo, getKeySignature, getDisplaySignature, isInvalidSignature, isKeyboardEvent, isShortcutProvider, isInvalidKeyboardEvent } from '../utils/index.js';
|
|
7
|
-
|
|
8
|
-
const GlobalShortcutProvider = Symbol("Glob");
|
|
9
|
-
const ShortcutManagerCacheMap = /* @__PURE__ */ new Map();
|
|
10
|
-
class ShortcutManager {
|
|
11
|
-
constructor(environmentEle, scope = GlobalShortcutProvider) {
|
|
12
|
-
this.shortcutCallbackMap = reactive(/* @__PURE__ */ new Map());
|
|
13
|
-
this.shortcutCache = ref({});
|
|
14
|
-
this.disabled = false;
|
|
15
|
-
this.environmentEle = environmentEle || window;
|
|
16
|
-
ShortcutManagerCacheMap.set(scope, this);
|
|
17
|
-
}
|
|
18
|
-
static log(message, dryRun = false) {
|
|
19
|
-
const _message = `[ShortcutManager] ${message}`;
|
|
20
|
-
!dryRun && console.warn(_message);
|
|
21
|
-
return _message;
|
|
22
|
-
}
|
|
23
|
-
get traverse() {
|
|
24
|
-
return [...Object.values(this.shortcutCache.value)].sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
25
|
-
}
|
|
26
|
-
query(key) {
|
|
27
|
-
return this.shortcutCache.value[key];
|
|
28
|
-
}
|
|
29
|
-
async update(key, info) {
|
|
30
|
-
var _a, _b;
|
|
31
|
-
const oldKeySignature = (_a = this.query(key)) == null ? void 0 : _a.currentKeySignature;
|
|
32
|
-
info && checkSignature(this.shortcutCache, info);
|
|
33
|
-
const item = this.query(key);
|
|
34
|
-
if (!item)
|
|
35
|
-
return;
|
|
36
|
-
await ((_b = item.onUpdate) == null ? void 0 : _b.call(item, key, info ? normalizeSignatureInfo(info) : void 0));
|
|
37
|
-
checkSignature(this.shortcutCache, info);
|
|
38
|
-
item.currentKeySignature = getKeySignature(info);
|
|
39
|
-
item.shortcutSignature = normalizeSignatureInfo(info);
|
|
40
|
-
this.shortcutCallbackMap.set(item.currentKeySignature, this.shortcutCallbackMap.get(oldKeySignature));
|
|
41
|
-
this.shortcutCallbackMap.delete(oldKeySignature);
|
|
42
|
-
function checkSignature(shortcutCache, info2) {
|
|
43
|
-
if (oldKeySignature === getKeySignature(info2))
|
|
44
|
-
return;
|
|
45
|
-
if (Object.values(shortcutCache.value).some((v) => v.currentKeySignature === getKeySignature(info2))) {
|
|
46
|
-
throw `\u91CD\u590D\u7684\u5FEB\u6377\u952E=> ${getDisplaySignature(info2)}`;
|
|
47
|
-
}
|
|
48
|
-
if (isInvalidSignature(info2)) {
|
|
49
|
-
throw `\u975E\u6CD5\u7684\u5FEB\u6377\u952E=>${info2.key}`;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
register(shortcutItem) {
|
|
54
|
-
const item = this.query(shortcutItem.key);
|
|
55
|
-
if (item) {
|
|
56
|
-
item.status = ShortcutStatus.ACTIVE;
|
|
57
|
-
this.shortcutCallbackMap.set(item.currentKeySignature, shortcutItem.callback);
|
|
58
|
-
Object.assign(item, pick(shortcutItem, ["debounce", "debounceOption", "label", "order", "key"]));
|
|
59
|
-
return createHandler(item);
|
|
60
|
-
}
|
|
61
|
-
this.shortcutCache.value[shortcutItem.key] = omit(shortcutItem, ["callback"]);
|
|
62
|
-
this.shortcutCallbackMap.set(shortcutItem.currentKeySignature, shortcutItem.callback);
|
|
63
|
-
return createHandler(this.shortcutCache.value[shortcutItem.key]);
|
|
64
|
-
function createHandler(shortcut) {
|
|
65
|
-
return {
|
|
66
|
-
stop: () => {
|
|
67
|
-
shortcut.status = ShortcutStatus.INACTIVE;
|
|
68
|
-
},
|
|
69
|
-
start: () => {
|
|
70
|
-
shortcut.status = ShortcutStatus.ACTIVE;
|
|
71
|
-
},
|
|
72
|
-
signature: () => shortcut.currentKeySignature
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
start() {
|
|
77
|
-
if (this.handle) {
|
|
78
|
-
ShortcutManager.log(`\u8BF7\u52FF\u91CD\u590D\u542F\u52A8=>${this}`);
|
|
79
|
-
return this;
|
|
80
|
-
}
|
|
81
|
-
this.handle = async (event) => {
|
|
82
|
-
if (!isKeyboardEvent(event) || this.disabled)
|
|
83
|
-
return;
|
|
84
|
-
const providerWrapper = findAncestor(event.target, isShortcutProvider);
|
|
85
|
-
if (providerWrapper && providerWrapper !== unref(this.environmentEle) || isInvalidKeyboardEvent(event)) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const keySignature = getKeySignature(event);
|
|
89
|
-
const callback = this.shortcutCallbackMap.get(keySignature);
|
|
90
|
-
if (!callback)
|
|
91
|
-
return;
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
const shortcutItem = Object.values(this.shortcutCache.value).find(
|
|
94
|
-
(item) => item.currentKeySignature === keySignature
|
|
95
|
-
);
|
|
96
|
-
if (!shortcutItem || shortcutItem.status !== ShortcutStatus.ACTIVE || shortcutItem.disabled)
|
|
97
|
-
return;
|
|
98
|
-
callback();
|
|
99
|
-
};
|
|
100
|
-
useEventListener(this.environmentEle, "keyup", this.handle, { capture: true });
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
destroy() {
|
|
104
|
-
var _a;
|
|
105
|
-
this.handle && ((_a = unref(this.environmentEle)) == null ? void 0 : _a.removeEventListener("keyup", this.handle, { capture: true }));
|
|
106
|
-
this.handle = void 0;
|
|
107
|
-
this.clear();
|
|
108
|
-
}
|
|
109
|
-
clear() {
|
|
110
|
-
this.shortcutCallbackMap.clear();
|
|
111
|
-
this.shortcutCache.value = {};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const globManager = new ShortcutManager().start();
|
|
115
|
-
const onceSetupWarn = once(() => ShortcutManager.log("\u975Esetup\u8BED\u5883\u4E0B\u7684shortcut\u5C06\u5F71\u54CD\u5168\u5C40"));
|
|
116
|
-
const onceRegisterWarn = once(
|
|
117
|
-
() => 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")
|
|
118
|
-
);
|
|
119
|
-
function useShortcuts(scope) {
|
|
120
|
-
function useManager() {
|
|
121
|
-
return computed(() => {
|
|
122
|
-
if (unref(scope)) {
|
|
123
|
-
const result = ShortcutManagerCacheMap.get(unref(scope));
|
|
124
|
-
if (!result)
|
|
125
|
-
ShortcutManager.log(`\u4E0D\u5B58\u5728\u7684scope=>${scope}, \u5C06\u4F7F\u7528\u5168\u5C40\u5FEB\u6377\u952E`);
|
|
126
|
-
return result || globManager;
|
|
127
|
-
} else if (getCurrentInstance()) {
|
|
128
|
-
return inject(InjectionShortcutManager, globManager);
|
|
129
|
-
} else {
|
|
130
|
-
onceSetupWarn();
|
|
131
|
-
return globManager;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
const manager = useManager();
|
|
136
|
-
function createShortcutItem(shortcut) {
|
|
137
|
-
return {
|
|
138
|
-
...shortcut,
|
|
139
|
-
shortcutSignature: normalizeSignatureInfo(shortcut.shortcutSignature),
|
|
140
|
-
currentKeySignature: getKeySignature(shortcut.shortcutSignature),
|
|
141
|
-
key: keyFor(shortcut),
|
|
142
|
-
status: ShortcutStatus.ACTIVE,
|
|
143
|
-
callback: callbackFor(shortcut)
|
|
144
|
-
};
|
|
145
|
-
function callbackFor(shortcut2) {
|
|
146
|
-
var _a, _b;
|
|
147
|
-
if (!isFunction(shortcut2.callback)) {
|
|
148
|
-
throw new Error(ShortcutManager.log(`\u975E\u6CD5\u7684callback\u7C7B\u578B=>${shortcut2.callback}`, true));
|
|
149
|
-
}
|
|
150
|
-
if (!shortcut2.debounce)
|
|
151
|
-
return shortcut2.callback;
|
|
152
|
-
return useDebounceFn(shortcut2.callback, (_b = (_a = shortcut2.debounceOption) == null ? void 0 : _a.duration) != null ? _b : 300);
|
|
153
|
-
}
|
|
154
|
-
function keyFor(shortcut2) {
|
|
155
|
-
const key = shortcut2.key || shortcut2.label;
|
|
156
|
-
if (!isString(key)) {
|
|
157
|
-
throw new Error(ShortcutManager.log(`\u975E\u6CD5\u7684key\u7C7B\u578B=>${key}`, true));
|
|
158
|
-
}
|
|
159
|
-
return key;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function register(shortcut) {
|
|
163
|
-
const { stop, signature, start } = unref(manager).register(createShortcutItem(shortcut));
|
|
164
|
-
if (getCurrentInstance()) {
|
|
165
|
-
onBeforeUnmount(stop);
|
|
166
|
-
onDeactivated(stop);
|
|
167
|
-
onActivated(start);
|
|
168
|
-
} else {
|
|
169
|
-
onceRegisterWarn();
|
|
170
|
-
}
|
|
171
|
-
return { stop, signature };
|
|
172
|
-
}
|
|
173
|
-
function traverse() {
|
|
174
|
-
return unref(manager).traverse;
|
|
175
|
-
}
|
|
176
|
-
function update(key, info) {
|
|
177
|
-
return unref(manager).update(key, info);
|
|
178
|
-
}
|
|
179
|
-
function updateManagerDisabled(disabled) {
|
|
180
|
-
unref(manager).disabled = !!disabled;
|
|
181
|
-
}
|
|
182
|
-
function clear() {
|
|
183
|
-
unref(manager).clear();
|
|
184
|
-
}
|
|
185
|
-
return { register, traverse, clear, update, updateManagerDisabled };
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export { GlobalShortcutProvider, ShortcutManager, useShortcuts };
|
|
1
|
+
import{findAncestor as t}from"../../../../shared/utils/index.js";import{useEventListener as e,useDebounceFn as r}from"@vueuse/core";import{once as s,pick as a,omit as n,isFunction as u,isString as c}from"lodash-es";import{reactive as o,ref as i,unref as l,computed as h,getCurrentInstance as d,inject as p,onBeforeUnmount as g,onDeactivated as b,onActivated as v}from"vue";import{ShortcutStatus as f,InjectionShortcutManager as k}from"../constants/index.js";import{normalizeSignatureInfo as y,getKeySignature as C,getDisplaySignature as m,isInvalidSignature as S,isKeyboardEvent as w,isShortcutProvider as E,isInvalidKeyboardEvent as M}from"../utils/index.js";const K=Symbol("Glob"),j=new Map;class ${constructor(t,e=K){this.shortcutCallbackMap=o(new Map),this.shortcutCache=i({}),this.disabled=!1,this.environmentEle=t||window,j.set(e,this)}static log(t,e=!1){const r=`[ShortcutManager] ${t}`;return!e&&console.warn(r),r}get traverse(){return[...Object.values(this.shortcutCache.value)].sort(((t,e)=>(t.order||0)-(e.order||0)))}query(t){return this.shortcutCache.value[t]}async update(t,e){var r,s;const a=null==(r=this.query(t))?void 0:r.currentKeySignature;e&&u(this.shortcutCache,e);const n=this.query(t);function u(t,e){if(a!==C(e)){if(Object.values(t.value).some((t=>t.currentKeySignature===C(e))))throw`重复的快捷键=> ${m(e)}`;if(S(e))throw`非法的快捷键=>${e.key}`}}n&&(await(null==(s=n.onUpdate)?void 0:s.call(n,t,e?y(e):void 0)),u(this.shortcutCache,e),n.currentKeySignature=C(e),n.shortcutSignature=y(e),this.shortcutCallbackMap.set(n.currentKeySignature,this.shortcutCallbackMap.get(a)),this.shortcutCallbackMap.delete(a))}register(t){const e=this.query(t.key);return e?(e.status=f.ACTIVE,this.shortcutCallbackMap.set(e.currentKeySignature,t.callback),Object.assign(e,a(t,["debounce","debounceOption","label","order","key"])),r(e)):(this.shortcutCache.value[t.key]=n(t,["callback"]),this.shortcutCallbackMap.set(t.currentKeySignature,t.callback),r(this.shortcutCache.value[t.key]));function r(t){return{stop:()=>{t.status=f.INACTIVE},start:()=>{t.status=f.ACTIVE},signature:()=>t.currentKeySignature}}}start(){return this.handle?($.log(`请勿重复启动=>${this}`),this):(this.handle=async e=>{if(!w(e)||this.disabled)return;const r=t(e.target,E);if(r&&r!==l(this.environmentEle)||M(e))return;const s=C(e),a=this.shortcutCallbackMap.get(s);if(!a)return;e.preventDefault();const n=Object.values(this.shortcutCache.value).find((t=>t.currentKeySignature===s));n&&n.status===f.ACTIVE&&!n.disabled&&a()},e(this.environmentEle,"keyup",this.handle,{capture:!0}),this)}destroy(){var t;this.handle&&(null==(t=l(this.environmentEle))||t.removeEventListener("keyup",this.handle,{capture:!0})),this.handle=void 0,this.clear()}clear(){this.shortcutCallbackMap.clear(),this.shortcutCache.value={}}}const I=(new $).start(),O=s((()=>$.log("非setup语境下的shortcut将影响全局"))),A=s((()=>$.log("在非setup语境下使用register函数,组件销毁时可能需要手动调用stop函数使快捷键失活")));function T(t){const e=h((()=>{if(l(t)){const e=j.get(l(t));return e||$.log(`不存在的scope=>${t}, 将使用全局快捷键`),e||I}return d()?p(k,I):(O(),I)}));return{register:function(t){const{stop:s,signature:a,start:n}=l(e).register(function(t){return{...t,shortcutSignature:y(t.shortcutSignature),currentKeySignature:C(t.shortcutSignature),key:function(t){const e=t.key||t.label;if(!c(e))throw new Error($.log(`非法的key类型=>${e}`,!0));return e}(t),status:f.ACTIVE,callback:function(t){var e,s;if(!u(t.callback))throw new Error($.log(`非法的callback类型=>${t.callback}`,!0));return t.debounce?r(t.callback,null!=(s=null==(e=t.debounceOption)?void 0:e.duration)?s:300):t.callback}(t)}}(t));return d()?(g(s),b(s),v(n)):A(),{stop:s,signature:a}},traverse:function(){return l(e).traverse},clear:function(){l(e).clear()},update:function(t,r){return l(e).update(t,r)},updateManagerDisabled:function(t){l(e).disabled=!!t}}}export{K as GlobalShortcutProvider,$ as ShortcutManager,T as useShortcuts};
|