@veltra/desktop 1.2.30 → 1.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action/action-group.vue.d.ts +1 -1
- package/dist/components/action/action.vue.d.ts +1 -1
- package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
- package/dist/components/batch-edit/batch-edit-form.js +3 -1
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +4 -0
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.vue.d.ts +10 -2
- package/dist/components/batch-edit/use-handlers.js +9 -1
- package/dist/components/batch-edit/use-handlers.js.map +1 -1
- package/dist/components/cascade/cascade.vue.d.ts +3 -3
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
- package/dist/components/code-editor/lang-loaders.js +3 -1
- package/dist/components/code-editor/lang-loaders.js.map +1 -1
- package/dist/components/code-editor/langs/bash/index.js +11 -0
- package/dist/components/code-editor/langs/bash/index.js.map +1 -0
- package/dist/components/code-editor/langs/powershell/index.js +11 -0
- package/dist/components/code-editor/langs/powershell/index.js.map +1 -0
- package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
- package/dist/components/empty/empty.vue.d.ts +1 -1
- package/dist/components/input/input.vue.d.ts +6 -6
- package/dist/components/multi-select/multi-select.vue.d.ts +2 -2
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +3 -3
- package/dist/components/number-input/number-input.vue.d.ts +2 -2
- package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
- package/dist/components/password-input/password-input.vue.d.ts +1 -1
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/progress-nodes/progress-nodes.vue.d.ts +1 -1
- package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
- package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/steps/steps.vue.d.ts +1 -1
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +2 -2
- package/dist/components/tabs/tabs-vertical.vue.d.ts +2 -2
- package/dist/components/tabs/tabs.vue.d.ts +2 -2
- package/dist/components/textarea/textarea.vue.d.ts +2 -2
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/tree/tree.vue.d.ts +1 -1
- package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
- package/dist/node_modules/.bun/@codemirror_legacy-modes@6.5.3/node_modules/@codemirror/legacy-modes/mode/powershell.js +303 -0
- package/dist/node_modules/.bun/@codemirror_legacy-modes@6.5.3/node_modules/@codemirror/legacy-modes/mode/powershell.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_legacy-modes@6.5.3/node_modules/@codemirror/legacy-modes/mode/shell.js +225 -0
- package/dist/node_modules/.bun/@codemirror_legacy-modes@6.5.3/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -0
- package/dist/types/batch-edit.d.ts +16 -2
- package/dist/types/code-editor.d.ts +1 -1
- package/package.json +7 -6
- package/src/components/batch-edit/batch-edit-form.vue +5 -1
- package/src/components/batch-edit/use-handlers.ts +10 -1
- package/src/components/code-editor/lang-loaders.ts +3 -1
- package/src/components/code-editor/langs/bash/index.ts +7 -0
- package/src/components/code-editor/langs/powershell/index.ts +7 -0
- package/src/types/batch-edit.ts +17 -1
- package/src/types/code-editor.ts +1 -1
|
@@ -6,9 +6,9 @@ type __VLS_Slots = {
|
|
|
6
6
|
default?: () => VNode[];
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _ActionGroupExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionGroupProps> & Readonly<{}>, {
|
|
9
|
+
size: "small" | "default" | "large";
|
|
9
10
|
type: import("@veltra/utils").ColorType;
|
|
10
11
|
text: boolean;
|
|
11
|
-
size: "small" | "default" | "large";
|
|
12
12
|
max: number;
|
|
13
13
|
circle: boolean;
|
|
14
14
|
loading: boolean;
|
|
@@ -12,9 +12,9 @@ declare const __VLS_base: import("vue").DefineComponent<ActionProps, {}, {}, {},
|
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<ActionProps> & Readonly<{
|
|
13
13
|
onRun?: (() => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
+
size: import("@veltra/utils").ComponentSize;
|
|
15
16
|
type: ButtonType;
|
|
16
17
|
text: boolean;
|
|
17
|
-
size: import("@veltra/utils").ComponentSize;
|
|
18
18
|
circle: boolean;
|
|
19
19
|
loading: boolean;
|
|
20
20
|
inDropdown: boolean;
|
|
@@ -22,10 +22,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Auto
|
|
|
22
22
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
23
23
|
onSelect?: ((value: string) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
|
-
placeholder: string;
|
|
26
|
-
clearable: boolean;
|
|
27
25
|
disabled: boolean;
|
|
28
26
|
readonly: boolean;
|
|
27
|
+
placeholder: string;
|
|
28
|
+
clearable: boolean;
|
|
29
29
|
allowCustom: boolean;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
31
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -33,7 +33,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
33
33
|
});
|
|
34
34
|
const creatableChild = computed(() => {
|
|
35
35
|
if (state.formActionType !== "createChild") return false;
|
|
36
|
-
return staticFeatures.value.has("createChild") || dynamicFeatures.value.createChild?.(state.
|
|
36
|
+
return staticFeatures.value.has("createChild") || dynamicFeatures.value.createChild?.(state.parentRow);
|
|
37
37
|
});
|
|
38
38
|
const updatable = computed(() => {
|
|
39
39
|
if (state.formActionType !== "update") return false;
|
|
@@ -94,6 +94,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
94
94
|
}, {
|
|
95
95
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
|
|
96
96
|
row: unref(state).row,
|
|
97
|
+
parentRow: unref(state).parentRow,
|
|
98
|
+
formActionType: unref(state).formActionType,
|
|
97
99
|
depth: unref(state).depth,
|
|
98
100
|
indexes: unref(state).indexPath,
|
|
99
101
|
index: unref(state).row?.index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-edit-form.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit-form.vue"],"sourcesContent":["<template>\n <aside :class=\"cls.e('form')\" v-if=\"state.formVisible && !!props.model\">\n <header :class=\"cls.e('form-header')\">\n <span :class=\"[cls.e('form-icon'), bem.is(state.formActionType)]\">\n <u-icon>\n <component :is=\"headerInfo.icon\" />\n </u-icon>\n </span>\n <div :class=\"cls.e('form-title')\">\n <h3 :class=\"cls.e('form-title-text')\">{{ headerInfo.title }}</h3>\n </div>\n <u-button\n :class=\"cls.e('form-close')\"\n :icon=\"Close\"\n text\n circle\n size=\"small\"\n title=\"关闭\"\n @click=\"handleClose\"\n />\n </header>\n\n <u-scroll always :class=\"cls.e('form-body')\" :key=\"bodyKey\">\n <transition name=\"fade\" appear mode=\"out-in\">\n <u-form\n ref=\"formComponentRef\"\n :model=\"props.model\"\n :readonly=\"props.readonly\"\n :label-width=\"props.labelWidth\"\n @field:change=\"handleFieldChange\"\n >\n <slot\n v-bind=\"{\n row: state.row,\n depth: state.depth,\n indexes: state.indexPath,\n index: state.row?.index\n }\"\n />\n </u-form>\n </transition>\n </u-scroll>\n\n <footer :class=\"cls.e('form-footer')\">\n <span :class=\"cls.e('form-hint')\">\n <template v-if=\"props.readonly\"> 只读模式 </template>\n\n <span :class=\"{ [bem.is('concealed')]: !focused }\">\n <template v-if=\"!(state.formActionType === 'update' && props.quickEdit)\">\n <u-kbd>Ctrl + S</u-kbd> 保存 ·\n </template>\n <u-kbd>Esc</u-kbd> 关闭\n </span>\n </span>\n\n <div :class=\"cls.e('form-actions')\">\n <u-button size=\"small\" text :loading=\"state.loading\" @click=\"handleClose\"> 取消 </u-button>\n <u-button\n v-if=\"showSaveBtn\"\n type=\"primary\"\n size=\"small\"\n title=\"保存\"\n :icon=\"Save\"\n :loading=\"state.loading\"\n @click=\"handleSave\"\n />\n </div>\n </footer>\n </aside>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { Close, Save } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject, shallowRef, toRef } from 'vue'\n\nimport type { _FormExposed, FormExposed } from '../../types/form'\nimport { UButton } from '../button'\nimport { UForm } from '../form'\nimport { UIcon } from '../icon'\nimport { UKbd } from '../kbd'\nimport { UScroll } from '../scroll'\nimport { BatchEditDIKey } from './di'\nimport { FORM_ACTION_HEADER_MAP } from './form-action-header'\n\ndefineOptions({ name: 'UBatchEditForm' })\n\nconst batchEditCtx = inject(BatchEditDIKey)!\n\nconst { cls, props, state, handleClose, handleSave, staticFeatures, dynamicFeatures } = batchEditCtx\n\nconst focused = toRef(batchEditCtx, 'focused')\n\nconst formComponentRef = shallowRef<FormExposed>()\n\ndefineExpose<_FormExposed>({\n el: toRef(() => formComponentRef.value?.el),\n validate: () => formComponentRef.value?.validate() ?? Promise.resolve(true),\n clearValidate: () => formComponentRef.value?.clearValidate(),\n reset: () => formComponentRef.value?.reset()\n})\n\nfunction handleFieldChange(field: string, value: any) {\n if (state.row && props.quickEdit) {\n o(state.row.data).set(field, value)\n }\n}\n\nconst creatable = computed(() => {\n if (state.formActionType !== 'create') return false\n return staticFeatures.value.has('create') || dynamicFeatures.value.create?.(state.row)\n})\n\nconst creatableChild = computed(() => {\n if (state.formActionType !== 'createChild') return false\n return staticFeatures.value.has('createChild') || dynamicFeatures.value.createChild?.(state.
|
|
1
|
+
{"version":3,"file":"batch-edit-form.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit-form.vue"],"sourcesContent":["<template>\n <aside :class=\"cls.e('form')\" v-if=\"state.formVisible && !!props.model\">\n <header :class=\"cls.e('form-header')\">\n <span :class=\"[cls.e('form-icon'), bem.is(state.formActionType)]\">\n <u-icon>\n <component :is=\"headerInfo.icon\" />\n </u-icon>\n </span>\n <div :class=\"cls.e('form-title')\">\n <h3 :class=\"cls.e('form-title-text')\">{{ headerInfo.title }}</h3>\n </div>\n <u-button\n :class=\"cls.e('form-close')\"\n :icon=\"Close\"\n text\n circle\n size=\"small\"\n title=\"关闭\"\n @click=\"handleClose\"\n />\n </header>\n\n <u-scroll always :class=\"cls.e('form-body')\" :key=\"bodyKey\">\n <transition name=\"fade\" appear mode=\"out-in\">\n <u-form\n ref=\"formComponentRef\"\n :model=\"props.model\"\n :readonly=\"props.readonly\"\n :label-width=\"props.labelWidth\"\n @field:change=\"handleFieldChange\"\n >\n <slot\n v-bind=\"{\n row: state.row,\n parentRow: state.parentRow,\n formActionType: state.formActionType,\n depth: state.depth,\n indexes: state.indexPath,\n index: state.row?.index\n }\"\n />\n </u-form>\n </transition>\n </u-scroll>\n\n <footer :class=\"cls.e('form-footer')\">\n <span :class=\"cls.e('form-hint')\">\n <template v-if=\"props.readonly\"> 只读模式 </template>\n\n <span :class=\"{ [bem.is('concealed')]: !focused }\">\n <template v-if=\"!(state.formActionType === 'update' && props.quickEdit)\">\n <u-kbd>Ctrl + S</u-kbd> 保存 ·\n </template>\n <u-kbd>Esc</u-kbd> 关闭\n </span>\n </span>\n\n <div :class=\"cls.e('form-actions')\">\n <u-button size=\"small\" text :loading=\"state.loading\" @click=\"handleClose\"> 取消 </u-button>\n <u-button\n v-if=\"showSaveBtn\"\n type=\"primary\"\n size=\"small\"\n title=\"保存\"\n :icon=\"Save\"\n :loading=\"state.loading\"\n @click=\"handleSave\"\n />\n </div>\n </footer>\n </aside>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { Close, Save } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject, shallowRef, toRef } from 'vue'\n\nimport type { _FormExposed, FormExposed } from '../../types/form'\nimport { UButton } from '../button'\nimport { UForm } from '../form'\nimport { UIcon } from '../icon'\nimport { UKbd } from '../kbd'\nimport { UScroll } from '../scroll'\nimport { BatchEditDIKey } from './di'\nimport { FORM_ACTION_HEADER_MAP } from './form-action-header'\n\ndefineOptions({ name: 'UBatchEditForm' })\n\nconst batchEditCtx = inject(BatchEditDIKey)!\n\nconst { cls, props, state, handleClose, handleSave, staticFeatures, dynamicFeatures } = batchEditCtx\n\nconst focused = toRef(batchEditCtx, 'focused')\n\nconst formComponentRef = shallowRef<FormExposed>()\n\ndefineExpose<_FormExposed>({\n el: toRef(() => formComponentRef.value?.el),\n validate: () => formComponentRef.value?.validate() ?? Promise.resolve(true),\n clearValidate: () => formComponentRef.value?.clearValidate(),\n reset: () => formComponentRef.value?.reset()\n})\n\nfunction handleFieldChange(field: string, value: any) {\n if (state.row && props.quickEdit) {\n o(state.row.data).set(field, value)\n }\n}\n\nconst creatable = computed(() => {\n if (state.formActionType !== 'create') return false\n return staticFeatures.value.has('create') || dynamicFeatures.value.create?.(state.row)\n})\n\nconst creatableChild = computed(() => {\n if (state.formActionType !== 'createChild') return false\n return (\n staticFeatures.value.has('createChild') || dynamicFeatures.value.createChild?.(state.parentRow)\n )\n})\n\nconst updatable = computed(() => {\n if (state.formActionType !== 'update') return false\n return staticFeatures.value.has('update') || dynamicFeatures.value.update?.(state.row)\n})\n\nconst showSaveBtn = computed(() => {\n if (props.readonly) return false\n if (props.quickEdit && state.formActionType === 'update') return false\n return creatable.value || updatable.value || creatableChild.value\n})\n\nconst headerInfo = computed(() => FORM_ACTION_HEADER_MAP[state.formActionType])\n\n/** 通过 row 切换 / 类型切换驱动表单内容淡出淡入 */\nconst bodyKey = computed(() => {\n return `${state.formActionType}-${state.row?.uid ?? 'create'}-${state.parentRow?.uid ?? 'root'}`\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;EA0FA,MAAM,eAAe,OAAO,cAAc;EAE1C,MAAM,EAAE,KAAK,OAAO,OAAO,aAAa,YAAY,gBAAgB,oBAAoB;EAExF,MAAM,UAAU,MAAM,cAAc,SAAS;EAE7C,MAAM,mBAAmB,WAAwB;EAEjD,SAA2B;GACzB,IAAI,YAAY,iBAAiB,OAAO,EAAE;GAC1C,gBAAgB,iBAAiB,OAAO,SAAS,KAAK,QAAQ,QAAQ,IAAI;GAC1E,qBAAqB,iBAAiB,OAAO,cAAc;GAC3D,aAAa,iBAAiB,OAAO,MAAM;EAC7C,CAAC;EAED,SAAS,kBAAkB,OAAe,OAAY;GACpD,IAAI,MAAM,OAAO,MAAM,WACrB,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,IAAI,OAAO,KAAK;EAEtC;EAEA,MAAM,YAAY,eAAe;GAC/B,IAAI,MAAM,mBAAmB,UAAU,OAAO;GAC9C,OAAO,eAAe,MAAM,IAAI,QAAQ,KAAK,gBAAgB,MAAM,SAAS,MAAM,GAAG;EACvF,CAAC;EAED,MAAM,iBAAiB,eAAe;GACpC,IAAI,MAAM,mBAAmB,eAAe,OAAO;GACnD,OACE,eAAe,MAAM,IAAI,aAAa,KAAK,gBAAgB,MAAM,cAAc,MAAM,SAAS;EAElG,CAAC;EAED,MAAM,YAAY,eAAe;GAC/B,IAAI,MAAM,mBAAmB,UAAU,OAAO;GAC9C,OAAO,eAAe,MAAM,IAAI,QAAQ,KAAK,gBAAgB,MAAM,SAAS,MAAM,GAAG;EACvF,CAAC;EAED,MAAM,cAAc,eAAe;GACjC,IAAI,MAAM,UAAU,OAAO;GAC3B,IAAI,MAAM,aAAa,MAAM,mBAAmB,UAAU,OAAO;GACjE,OAAO,UAAU,SAAS,UAAU,SA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AAA,OAAA,KAAA,CAAA,gBAAR,YAAQ,EAAA,CAAA,EAAA,CAAA;;mDAAQ,UACzB,EAAA,EAAA,GAAA,EAAA,KAAA,mBAAA,QAAA,IAAA;KACA,YAAkB,MAAA,WAAA,GAAA,MAAA;6BAAR,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAH,OAAG,EAAA,CAAA,EAAA,CAAA;;;+CAAQ,QACpB,EAAA;gBAGF,mBAWM,OAAA,EAXA,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,cAAA,CAAA,EAAA,GAAA,CAChB,YAAyF,MAAA,WAAA,GAAA;KAA/E,MAAK;KAAQ,MAAA;KAAM,SAAS,MAAA,KAAA,CAAK,CAAC;KAAU,SAAO,MAAA,WAAA;;4BAAiB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAJ,QAAI,EAAA,CAAA,EAAA,CAAA;;mCAEtE,YAAA,SAAA,UAAA,GADR,YAQE,MAAA,WAAA,GAAA;;KANA,MAAK;KACL,MAAK;KACL,OAAM;KACL,MAAM,MAAA,IAAA;KACN,SAAS,MAAA,KAAA,CAAK,CAAC;KACf,SAAO,MAAA,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-edit.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit.vue"],"sourcesContent":["<template>\n <u-layout\n :class=\"cls.b\"\n :cols=\"cols\"\n rows=\"minmax(0, 1fr) \"\n gap=\"8px\"\n resizable\n tabindex=\"-1\"\n @focusin=\"handleFocusIn\"\n @focusout=\"handleFocusOut\"\n @keydown.capture=\"handleKeydown\"\n >\n <!-- 编辑列表 -->\n <BatchEditList :slots=\"slots\" />\n\n <!-- 编辑表单 -->\n <BatchEditForm ref=\"form\" v-slot=\"scoped\">\n <slot name=\"form\" v-bind=\"scoped\" />\n </BatchEditForm>\n </u-layout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { computed, provide, useTemplateRef } from 'vue'\n\nimport type { BatchEditEmits, BatchEditProps, BatchEditSlots, FormExposed } from '../../types'\nimport { ULayout } from '../layout'\nimport BatchEditForm from './batch-edit-form.vue'\nimport BatchEditList from './batch-edit-list.vue'\nimport { BatchEditDIKey } from './di'\nimport { useEditState } from './use-edit-state'\nimport { useFeatures } from './use-features'\nimport { useHandlers } from './use-handlers'\nimport { useShortcutKey } from './use-shortcut-key'\n\ndefineOptions({ name: 'UBatchEdit' })\n\nconst props = withDefaults(defineProps<BatchEditProps>(), { cols: () => ['1fr', '420px'] })\n\nconst emit = defineEmits<BatchEditEmits>()\n\nconst slots = defineSlots<BatchEditSlots>()\n\nconst cls = bem('batch-edit')\n\nconst formRef = useTemplateRef<FormExposed>('form')\n\nconst { state, resetState } = useEditState({ props, formRef })\n\nconst { staticFeatures, dynamicFeatures } = useFeatures({ props })\n\nconst handlers = useHandlers({ props, emit, state, resetState, formRef })\n\n// 快捷键处理\nconst { handleFocusIn, handleFocusOut, handleKeydown, focused } = useShortcutKey({\n props,\n onSave: handlers.handleSave,\n onClose: handlers.handleClose,\n state\n})\n\nconst cols = computed(() => {\n return state.formVisible ? props.cols : undefined\n})\n\nprovide(BatchEditDIKey, {\n cls,\n props,\n emit,\n state,\n staticFeatures,\n dynamicFeatures,\n focused,\n ...handlers\n})\n</script>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"batch-edit.js","names":[],"sources":["../../../src/components/batch-edit/batch-edit.vue"],"sourcesContent":["<template>\n <u-layout\n :class=\"cls.b\"\n :cols=\"cols\"\n rows=\"minmax(0, 1fr) \"\n gap=\"8px\"\n resizable\n tabindex=\"-1\"\n @focusin=\"handleFocusIn\"\n @focusout=\"handleFocusOut\"\n @keydown.capture=\"handleKeydown\"\n >\n <!-- 编辑列表 -->\n <BatchEditList :slots=\"slots\" />\n\n <!-- 编辑表单 -->\n <BatchEditForm ref=\"form\" v-slot=\"scoped\">\n <slot name=\"form\" v-bind=\"scoped\" />\n </BatchEditForm>\n </u-layout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { computed, provide, useTemplateRef } from 'vue'\n\nimport type { BatchEditEmits, BatchEditProps, BatchEditSlots, FormExposed } from '../../types'\nimport { ULayout } from '../layout'\nimport BatchEditForm from './batch-edit-form.vue'\nimport BatchEditList from './batch-edit-list.vue'\nimport { BatchEditDIKey } from './di'\nimport { useEditState } from './use-edit-state'\nimport { useFeatures } from './use-features'\nimport { useHandlers } from './use-handlers'\nimport { useShortcutKey } from './use-shortcut-key'\n\ndefineOptions({ name: 'UBatchEdit' })\n\nconst props = withDefaults(defineProps<BatchEditProps>(), { cols: () => ['1fr', '420px'] })\n\nconst emit = defineEmits<BatchEditEmits>()\n\nconst slots = defineSlots<BatchEditSlots>()\n\nconst cls = bem('batch-edit')\n\nconst formRef = useTemplateRef<FormExposed>('form')\n\nconst { state, resetState } = useEditState({ props, formRef })\n\nconst { staticFeatures, dynamicFeatures } = useFeatures({ props })\n\nconst handlers = useHandlers({ props, emit, state, resetState, formRef })\n\n// 快捷键处理\nconst { handleFocusIn, handleFocusOut, handleKeydown, focused } = useShortcutKey({\n props,\n onSave: handlers.handleSave,\n onClose: handlers.handleClose,\n state\n})\n\nconst cols = computed(() => {\n return state.formVisible ? props.cols : undefined\n})\n\nprovide(BatchEditDIKey, {\n cls,\n props,\n emit,\n state,\n staticFeatures,\n dynamicFeatures,\n focused,\n ...handlers\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,QAAQ,SAAA;EAEd,MAAM,MAAM,IAAI,YAAY;EAE5B,MAAM,UAAU,eAA4B,MAAM;EAElD,MAAM,EAAE,OAAO,eAAe,aAAa;GAAE;GAAO;EAAQ,CAAC;EAE7D,MAAM,EAAE,gBAAgB,oBAAoB,YAAY,EAAE,MAAM,CAAC;EAEjE,MAAM,WAAW,YAAY;GAAE;GAAO;GAAM;GAAO;GAAY;EAAQ,CAAC;EAGxE,MAAM,EAAE,eAAe,gBAAgB,eAAe,YAAY,eAAe;GAC/E;GACA,QAAQ,SAAS;GACjB,SAAS,SAAS;GAClB;EACF,CAAC;EAED,MAAM,OAAO,eAAe;GAC1B,OAAO,MAAM,cAAc,MAAM,OAAO,KAAA;EAC1C,CAAC;EAED,QAAQ,gBAAgB;GACtB;GACA;GACA;GACA;GACA;GACA;GACA;GACA,GAAG;EACL,CAAC;;uBA1EC,YAkBW,MAAA,WAAA,GAAA;IAjBR,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,CAAC;IACZ,MAAM,KAAA;IACP,MAAK;IACL,KAAI;IACJ,WAAA;IACA,UAAS;IACR,WAAS,MAAA,aAAA;IACT,YAAU,MAAA,cAAA;sBACO,MAAA,aAAA;;2BAEL;KAAb,mBAAA,QAAA;KACA,YAAgC,aAAA,EAAT,MAAK,CAAA;KAE5B,mBAAA,QAAA;KACA,YAEgB,aAAA,EAFD,KAAI,OAAM,GAAA;wBAAS,WAAM,CACtC,WAAoC,KAAA,QAAA,QAAA,eAAA,mBAAV,MAAM,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -6,20 +6,28 @@ declare const __VLS_base: import("vue").DefineComponent<BatchEditProps, {}, {},
|
|
|
6
6
|
"update:selected": (value: Record<string, any> | undefined) => any;
|
|
7
7
|
"update:checked": (value: Record<string, any>[]) => any;
|
|
8
8
|
"update:current": (row?: TableRow | undefined) => any;
|
|
9
|
-
"update:data": (value: Record<string, any>[]) => any;
|
|
10
9
|
"update:rows": (rows: TableRow[]) => any;
|
|
11
10
|
"update:forest": (rows?: import("@cat-kit/core").Forest<Record<string, unknown>, any> | undefined) => any;
|
|
12
11
|
"cell-click": (row: TableRow, column: TableColumn, ev: MouseEvent) => any;
|
|
13
12
|
"row-click": (row: TableRow, ev: MouseEvent) => any;
|
|
13
|
+
create: () => any;
|
|
14
|
+
"update:data": (value: Record<string, any>[]) => any;
|
|
15
|
+
"create-prev": (row: TableRow) => any;
|
|
16
|
+
"create-next": (row: TableRow) => any;
|
|
17
|
+
"create-child": (row: TableRow) => any;
|
|
14
18
|
}, string, import("vue").PublicProps, Readonly<BatchEditProps> & Readonly<{
|
|
15
19
|
"onUpdate:selected"?: ((value: Record<string, any> | undefined) => any) | undefined;
|
|
16
20
|
"onUpdate:checked"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
17
21
|
"onUpdate:current"?: ((row?: TableRow | undefined) => any) | undefined;
|
|
18
|
-
"onUpdate:data"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
19
22
|
"onUpdate:rows"?: ((rows: TableRow[]) => any) | undefined;
|
|
20
23
|
"onUpdate:forest"?: ((rows?: import("@cat-kit/core").Forest<Record<string, unknown>, any> | undefined) => any) | undefined;
|
|
21
24
|
"onCell-click"?: ((row: TableRow, column: TableColumn, ev: MouseEvent) => any) | undefined;
|
|
22
25
|
"onRow-click"?: ((row: TableRow, ev: MouseEvent) => any) | undefined;
|
|
26
|
+
onCreate?: (() => any) | undefined;
|
|
27
|
+
"onUpdate:data"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
28
|
+
"onCreate-prev"?: ((row: TableRow) => any) | undefined;
|
|
29
|
+
"onCreate-next"?: ((row: TableRow) => any) | undefined;
|
|
30
|
+
"onCreate-child"?: ((row: TableRow) => any) | undefined;
|
|
23
31
|
}>, {
|
|
24
32
|
cols: string | [string, string];
|
|
25
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -52,21 +52,26 @@ function useHandlers(options) {
|
|
|
52
52
|
state.formVisible = true;
|
|
53
53
|
state.depth = 1;
|
|
54
54
|
state.indexPath = [data?.length ?? 0];
|
|
55
|
+
emit("create");
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
function handleInsertToPrev(row) {
|
|
58
59
|
resetState();
|
|
59
60
|
state.formActionType = "create";
|
|
60
61
|
state.formVisible = true;
|
|
62
|
+
state.parentRow = row.parent;
|
|
61
63
|
state.depth = row.depth;
|
|
62
64
|
state.indexPath = [...row.indexes];
|
|
65
|
+
emit("create-prev", row);
|
|
63
66
|
}
|
|
64
67
|
function handleInsertToNext(row) {
|
|
65
68
|
resetState();
|
|
66
69
|
state.formActionType = "create";
|
|
67
70
|
state.formVisible = true;
|
|
71
|
+
state.parentRow = row.parent;
|
|
68
72
|
state.depth = row.depth;
|
|
69
73
|
state.indexPath = [...row.indexes.slice(0, -1), row.index + 1];
|
|
74
|
+
emit("create-next", row);
|
|
70
75
|
}
|
|
71
76
|
function handleInsertChild(row) {
|
|
72
77
|
resetState();
|
|
@@ -76,6 +81,7 @@ function useHandlers(options) {
|
|
|
76
81
|
state.depth = row.depth + 1;
|
|
77
82
|
row.expanded = true;
|
|
78
83
|
state.indexPath = [...row.indexes, row.children?.length ?? 0];
|
|
84
|
+
emit("create-child", row);
|
|
79
85
|
}
|
|
80
86
|
function runWithLoading(fn) {
|
|
81
87
|
return async (...args) => {
|
|
@@ -119,7 +125,9 @@ function useHandlers(options) {
|
|
|
119
125
|
});
|
|
120
126
|
const handleDelete = runWithLoading(async (row) => {
|
|
121
127
|
const { deleteMethod } = props;
|
|
122
|
-
if (deleteMethod)
|
|
128
|
+
if (deleteMethod) {
|
|
129
|
+
if (await deleteMethod([row.data]) === false) return;
|
|
130
|
+
}
|
|
123
131
|
const data = [...props.data ?? []];
|
|
124
132
|
const parent = visitDataByIndexPath(data, row.indexes.slice(0, -1), childrenKey.value);
|
|
125
133
|
if (parent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-handlers.js","names":[],"sources":["../../../src/components/batch-edit/use-handlers.ts"],"sourcesContent":["import { last, o } from '@cat-kit/core'\nimport { computed, nextTick, type ShallowRef } from 'vue'\n\nimport type {\n TableRow,\n BatchEditEmits,\n BatchEditProps,\n BatchEditStates,\n FormExposed\n} from '../../types'\n\n/** 按索引路径在原始数据树中定位节点(等价于历史 Forest.visit 路径访问) */\nfunction visitDataByIndexPath<T extends Record<string, unknown>>(\n roots: T[],\n indexPath: number[],\n childrenKey: string\n): T | undefined {\n if (!indexPath.length) return undefined\n let currentList: T[] | undefined = roots\n let node: T | undefined\n for (let i = 0; i < indexPath.length; i++) {\n const idx = indexPath[i]!\n if (!currentList) return undefined\n node = currentList[idx]\n if (node === undefined) return undefined\n if (i < indexPath.length - 1) {\n const next = node[childrenKey]\n currentList = Array.isArray(next) ? (next as T[]) : undefined\n }\n }\n return node\n}\n\ninterface Options {\n props: BatchEditProps\n emit: BatchEditEmits\n state: BatchEditStates\n formRef: ShallowRef<FormExposed | null>\n resetState: () => void\n}\n\nexport interface EditReturned {\n handleSave: () => Promise<void>\n handleClose: () => void\n handleCreate: () => void\n handleDelete: (row: TableRow) => Promise<void>\n handleInsertToNext: (row: TableRow) => void\n handleInsertToPrev: (row: TableRow) => void\n handleInsertChild: (row: TableRow) => void\n}\n\nexport function useHandlers(options: Options): EditReturned {\n const { props, emit, state, resetState, formRef } = options\n\n const childrenKey = computed(() => {\n return typeof props.tree === 'string' ? props.tree : 'children'\n })\n\n function getInsertData(): Record<string, any> {\n return o(props.model ?? {}).copy()\n }\n\n /**\n * 插入数据\n * @param item 数据\n */\n function insert(item: Record<string, any>) {\n const data = [...(props.data ?? [])]\n\n const parent = visitDataByIndexPath(data ?? [], state.indexPath.slice(0, -1), childrenKey.value)\n\n if (parent) {\n const children = parent[childrenKey.value]\n if (!children) {\n parent[childrenKey.value] = [item]\n } else {\n children.splice(last(state.indexPath), 0, item)\n }\n } else {\n data.splice(last(state.indexPath), 0, item)\n }\n\n emit('update:data', data)\n\n return item\n }\n\n /**\n * 点击新增按钮\n */\n function handleCreate() {\n const { data } = props\n\n resetState()\n\n nextTick(() => {\n state.formActionType = 'create'\n state.formVisible = true\n state.depth = 1\n state.indexPath = [data?.length ?? 0]\n })\n }\n\n function handleInsertToPrev(row: TableRow) {\n resetState()\n state.formActionType = 'create'\n state.formVisible = true\n state.depth = row.depth\n state.indexPath = [...row.indexes]\n }\n\n function handleInsertToNext(row: TableRow) {\n resetState()\n state.formActionType = 'create'\n state.formVisible = true\n state.depth = row.depth\n state.indexPath = [...row.indexes.slice(0, -1), row.index + 1]\n }\n\n function handleInsertChild(row: TableRow) {\n resetState()\n state.formActionType = 'createChild'\n state.formVisible = true\n state.parentRow = row\n state.depth = row.depth + 1\n row.expanded = true\n state.indexPath = [...row.indexes, row.children?.length ?? 0]\n }\n\n function runWithLoading<Arg extends any[]>(fn: (...args: Arg) => Promise<void> | void) {\n return async (...args: Arg) => {\n state.loading = true\n if (state.row) {\n state.row.operating = true\n }\n try {\n await fn.apply(null, args)\n } catch (error) {\n console.error(error)\n }\n state.loading = false\n if (state.row) {\n state.row.operating = false\n }\n }\n }\n\n /** 保存 */\n const handleSave = runWithLoading(async () => {\n const { model, saveMethod } = props\n const valid = await formRef.value?.validate()\n if (!model || !valid) return\n\n let item = getInsertData()\n\n // 新增\n if (state.formActionType === 'create' || state.formActionType === 'createChild') {\n await props.beforeCreate?.(item, state.parentRow?.data)\n if (saveMethod) {\n const result = await saveMethod(item, state.formActionType, state.parentRow?.data)\n if (result) {\n item = result\n }\n }\n insert(item)\n\n // 推进插入点,便于连续新增;并重置表单到初始默认值\n const next = last(state.indexPath) + 1\n state.indexPath = [...state.indexPath.slice(0, -1), next]\n formRef.value?.reset()\n return\n }\n\n // 普通模式下的编辑\n if (saveMethod) {\n const result = await saveMethod(item, state.formActionType, state.parentRow?.data)\n if (result) {\n item = result\n }\n }\n\n const { row } = state\n row &&\n Object.keys(item).forEach((key) => {\n o(row.data).set(key, o(item).get(key))\n })\n })\n\n const handleDelete = runWithLoading(async (row: TableRow) => {\n const { deleteMethod } = props\n\n if (deleteMethod) {\n await deleteMethod([row.data])\n }\n\n const data = [...(props.data ?? [])]\n\n const parent = visitDataByIndexPath(data, row.indexes.slice(0, -1), childrenKey.value)\n\n if (parent) {\n const children = parent[childrenKey.value]\n if (children) {\n children.splice(row.index, 1)\n } else {\n console.error('行路径不正确')\n }\n } else {\n data.splice(row.index, 1)\n }\n\n if (state.row === row) {\n resetState()\n }\n\n emit('update:data', data)\n })\n\n function handleClose() {\n resetState()\n }\n\n return {\n handleDelete,\n handleInsertChild,\n handleInsertToNext,\n handleInsertToPrev,\n handleCreate,\n handleClose,\n handleSave\n }\n}\n"],"mappings":";;;;AAYA,SAAS,qBACP,OACA,WACA,aACe;CACf,IAAI,CAAC,UAAU,QAAQ,OAAO,KAAA;CAC9B,IAAI,cAA+B;CACnC,IAAI;CACJ,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,MAAM,UAAU;EACtB,IAAI,CAAC,aAAa,OAAO,KAAA;EACzB,OAAO,YAAY;EACnB,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;EAC/B,IAAI,IAAI,UAAU,SAAS,GAAG;GAC5B,MAAM,OAAO,KAAK;GAClB,cAAc,MAAM,QAAQ,IAAI,IAAK,OAAe,KAAA;EACtD;CACF;CACA,OAAO;AACT;AAoBA,SAAgB,YAAY,SAAgC;CAC1D,MAAM,EAAE,OAAO,MAAM,OAAO,YAAY,YAAY;CAEpD,MAAM,cAAc,eAAe;EACjC,OAAO,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO;CACvD,CAAC;CAED,SAAS,gBAAqC;EAC5C,OAAO,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK;CACnC;;;;;CAMA,SAAS,OAAO,MAA2B;EACzC,MAAM,OAAO,CAAC,GAAI,MAAM,QAAQ,CAAC,CAAE;EAEnC,MAAM,SAAS,qBAAqB,QAAQ,CAAC,GAAG,MAAM,UAAU,MAAM,GAAG,EAAE,GAAG,YAAY,KAAK;EAE/F,IAAI,QAAQ;GACV,MAAM,WAAW,OAAO,YAAY;GACpC,IAAI,CAAC,UACH,OAAO,YAAY,SAAS,CAAC,IAAI;QAEjC,SAAS,OAAO,KAAK,MAAM,SAAS,GAAG,GAAG,IAAI;EAElD,OACE,KAAK,OAAO,KAAK,MAAM,SAAS,GAAG,GAAG,IAAI;EAG5C,KAAK,eAAe,IAAI;EAExB,OAAO;CACT;;;;CAKA,SAAS,eAAe;EACtB,MAAM,EAAE,SAAS;EAEjB,WAAW;EAEX,eAAe;GACb,MAAM,iBAAiB;GACvB,MAAM,cAAc;GACpB,MAAM,QAAQ;GACd,MAAM,YAAY,CAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"use-handlers.js","names":[],"sources":["../../../src/components/batch-edit/use-handlers.ts"],"sourcesContent":["import { last, o } from '@cat-kit/core'\nimport { computed, nextTick, type ShallowRef } from 'vue'\n\nimport type {\n TableRow,\n BatchEditEmits,\n BatchEditProps,\n BatchEditStates,\n FormExposed\n} from '../../types'\n\n/** 按索引路径在原始数据树中定位节点(等价于历史 Forest.visit 路径访问) */\nfunction visitDataByIndexPath<T extends Record<string, unknown>>(\n roots: T[],\n indexPath: number[],\n childrenKey: string\n): T | undefined {\n if (!indexPath.length) return undefined\n let currentList: T[] | undefined = roots\n let node: T | undefined\n for (let i = 0; i < indexPath.length; i++) {\n const idx = indexPath[i]!\n if (!currentList) return undefined\n node = currentList[idx]\n if (node === undefined) return undefined\n if (i < indexPath.length - 1) {\n const next = node[childrenKey]\n currentList = Array.isArray(next) ? (next as T[]) : undefined\n }\n }\n return node\n}\n\ninterface Options {\n props: BatchEditProps\n emit: BatchEditEmits\n state: BatchEditStates\n formRef: ShallowRef<FormExposed | null>\n resetState: () => void\n}\n\nexport interface EditReturned {\n handleSave: () => Promise<void>\n handleClose: () => void\n handleCreate: () => void\n handleDelete: (row: TableRow) => Promise<void>\n handleInsertToNext: (row: TableRow) => void\n handleInsertToPrev: (row: TableRow) => void\n handleInsertChild: (row: TableRow) => void\n}\n\nexport function useHandlers(options: Options): EditReturned {\n const { props, emit, state, resetState, formRef } = options\n\n const childrenKey = computed(() => {\n return typeof props.tree === 'string' ? props.tree : 'children'\n })\n\n function getInsertData(): Record<string, any> {\n return o(props.model ?? {}).copy()\n }\n\n /**\n * 插入数据\n * @param item 数据\n */\n function insert(item: Record<string, any>) {\n const data = [...(props.data ?? [])]\n\n const parent = visitDataByIndexPath(data ?? [], state.indexPath.slice(0, -1), childrenKey.value)\n\n if (parent) {\n const children = parent[childrenKey.value]\n if (!children) {\n parent[childrenKey.value] = [item]\n } else {\n children.splice(last(state.indexPath), 0, item)\n }\n } else {\n data.splice(last(state.indexPath), 0, item)\n }\n\n emit('update:data', data)\n\n return item\n }\n\n /**\n * 点击新增按钮\n */\n function handleCreate() {\n const { data } = props\n\n resetState()\n\n nextTick(() => {\n state.formActionType = 'create'\n state.formVisible = true\n state.depth = 1\n state.indexPath = [data?.length ?? 0]\n emit('create')\n })\n }\n\n function handleInsertToPrev(row: TableRow) {\n resetState()\n state.formActionType = 'create'\n state.formVisible = true\n state.parentRow = row.parent\n state.depth = row.depth\n state.indexPath = [...row.indexes]\n emit('create-prev', row)\n }\n\n function handleInsertToNext(row: TableRow) {\n resetState()\n state.formActionType = 'create'\n state.formVisible = true\n state.parentRow = row.parent\n state.depth = row.depth\n state.indexPath = [...row.indexes.slice(0, -1), row.index + 1]\n emit('create-next', row)\n }\n\n function handleInsertChild(row: TableRow) {\n resetState()\n state.formActionType = 'createChild'\n state.formVisible = true\n state.parentRow = row\n state.depth = row.depth + 1\n row.expanded = true\n state.indexPath = [...row.indexes, row.children?.length ?? 0]\n emit('create-child', row)\n }\n\n function runWithLoading<Arg extends any[]>(fn: (...args: Arg) => Promise<void> | void) {\n return async (...args: Arg) => {\n state.loading = true\n if (state.row) {\n state.row.operating = true\n }\n try {\n await fn.apply(null, args)\n } catch (error) {\n console.error(error)\n }\n state.loading = false\n if (state.row) {\n state.row.operating = false\n }\n }\n }\n\n /** 保存 */\n const handleSave = runWithLoading(async () => {\n const { model, saveMethod } = props\n const valid = await formRef.value?.validate()\n if (!model || !valid) return\n\n let item = getInsertData()\n\n // 新增\n if (state.formActionType === 'create' || state.formActionType === 'createChild') {\n await props.beforeCreate?.(item, state.parentRow?.data)\n if (saveMethod) {\n const result = await saveMethod(item, state.formActionType, state.parentRow?.data)\n if (result) {\n item = result\n }\n }\n insert(item)\n\n // 推进插入点,便于连续新增;并重置表单到初始默认值\n const next = last(state.indexPath) + 1\n state.indexPath = [...state.indexPath.slice(0, -1), next]\n formRef.value?.reset()\n return\n }\n\n // 普通模式下的编辑\n if (saveMethod) {\n const result = await saveMethod(item, state.formActionType, state.parentRow?.data)\n if (result) {\n item = result\n }\n }\n\n const { row } = state\n row &&\n Object.keys(item).forEach((key) => {\n o(row.data).set(key, o(item).get(key))\n })\n })\n\n const handleDelete = runWithLoading(async (row: TableRow) => {\n const { deleteMethod } = props\n\n if (deleteMethod) {\n const result = await deleteMethod([row.data])\n if (result === false) {\n return\n }\n }\n\n const data = [...(props.data ?? [])]\n\n const parent = visitDataByIndexPath(data, row.indexes.slice(0, -1), childrenKey.value)\n\n if (parent) {\n const children = parent[childrenKey.value]\n if (children) {\n children.splice(row.index, 1)\n } else {\n console.error('行路径不正确')\n }\n } else {\n data.splice(row.index, 1)\n }\n\n if (state.row === row) {\n resetState()\n }\n\n emit('update:data', data)\n })\n\n function handleClose() {\n resetState()\n }\n\n return {\n handleDelete,\n handleInsertChild,\n handleInsertToNext,\n handleInsertToPrev,\n handleCreate,\n handleClose,\n handleSave\n }\n}\n"],"mappings":";;;;AAYA,SAAS,qBACP,OACA,WACA,aACe;CACf,IAAI,CAAC,UAAU,QAAQ,OAAO,KAAA;CAC9B,IAAI,cAA+B;CACnC,IAAI;CACJ,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,MAAM,UAAU;EACtB,IAAI,CAAC,aAAa,OAAO,KAAA;EACzB,OAAO,YAAY;EACnB,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;EAC/B,IAAI,IAAI,UAAU,SAAS,GAAG;GAC5B,MAAM,OAAO,KAAK;GAClB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OAAO,MAAM;GACrB;EACF;EAGA,IAAI,YAAY;GACd,MAAM,SAAS,MAAM,WAAW,MAAM,MAAM,gBAAgB,MAAM,WAAW,IAAI;GACjF,IAAI,QACF,OAAO;EAEX;EAEA,MAAM,EAAE,QAAQ;EAChB,OACE,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,QAAQ;GACjC,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;EACvC,CAAC;CACL,CAAC;CAED,MAAM,eAAe,eAAe,OAAO,QAAkB;EAC3D,MAAM,EAAE,iBAAiB;EAEzB,IAAI;OAEE,MADiB,aAAa,CAAC,IAAI,IAAI,CAAC,MAC7B,OACb;EAAA;EAIJ,MAAM,OAAO,CAAC,GAAI,MAAM,QAAQ,CAAC,CAAE;EAEnC,MAAM,SAAS,qBAAqB,MAAM,IAAI,QAAQ,MAAM,GAAG,EAAE,GAAG,YAAY,KAAK;EAErF,IAAI,QAAQ;GACV,MAAM,WAAW,OAAO,YAAY;GACpC,IAAI,UACF,SAAS,OAAO,IAAI,OAAO,CAAC;QAE5B,QAAQ,MAAM,QAAQ;EAE1B,OACE,KAAK,OAAO,IAAI,OAAO,CAAC;EAG1B,IAAI,MAAM,QAAQ,KAChB,WAAW;EAGb,KAAK,eAAe,IAAI;CAC1B,CAAC;CAED,SAAS,cAAc;EACrB,WAAW;CACb;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -11,6 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
|
|
|
11
11
|
onChange?: ((...args: [item?: Record<string, any> | undefined] | [items: Record<string, any>[]]) => any) | undefined;
|
|
12
12
|
"onUpdate:label"?: ((label?: string | string[] | undefined) => any) | undefined;
|
|
13
13
|
}>, {
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
readonly: boolean;
|
|
14
16
|
labelKey: string;
|
|
15
17
|
valueKey: string;
|
|
16
18
|
childrenKey: string;
|
|
@@ -18,11 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
|
|
|
18
20
|
placeholder: string;
|
|
19
21
|
clearable: boolean;
|
|
20
22
|
filterable: boolean;
|
|
21
|
-
|
|
22
|
-
readonly: boolean;
|
|
23
|
+
visibilityLimit: number;
|
|
23
24
|
separator: string;
|
|
24
25
|
showFullPath: boolean;
|
|
25
|
-
visibilityLimit: number;
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
28
28
|
//#endregion
|
|
@@ -17,9 +17,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
17
17
|
"onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
|
|
18
18
|
onChange?: ((checked: boolean) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
|
-
type: import("@veltra/utils").ColorType;
|
|
21
20
|
disabled: boolean;
|
|
22
21
|
readonly: boolean;
|
|
22
|
+
type: import("@veltra/utils").ColorType;
|
|
23
23
|
round: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -12,10 +12,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
13
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
labelKey: string;
|
|
16
|
-
valueKey: string;
|
|
17
15
|
disabled: boolean;
|
|
18
16
|
readonly: boolean;
|
|
17
|
+
labelKey: string;
|
|
18
|
+
valueKey: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
//#endregion
|
|
@@ -5,7 +5,9 @@ const LANG_LOADERS = {
|
|
|
5
5
|
sql: () => import("../../node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js").then((m) => m.sql()),
|
|
6
6
|
java: () => import("../../node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js").then((m) => m.java()),
|
|
7
7
|
json: () => import("../../node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js").then((m) => m.json()),
|
|
8
|
-
spel: () => import("./langs/spel/index.js").then((m) => m.spel())
|
|
8
|
+
spel: () => import("./langs/spel/index.js").then((m) => m.spel()),
|
|
9
|
+
bash: () => import("./langs/bash/index.js").then((m) => m.bash()),
|
|
10
|
+
powershell: () => import("./langs/powershell/index.js").then((m) => m.powershell())
|
|
9
11
|
};
|
|
10
12
|
/** 按需加载语言扩展;模块缓存由运行时保证,重复切换同一语言不会重复下载 */
|
|
11
13
|
function loadLanguage(lang) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang-loaders.js","names":[],"sources":["../../../src/components/code-editor/lang-loaders.ts"],"sourcesContent":["import type { Extension } from '@codemirror/state'\n\nimport type { CodeEditorLang } from '../../types'\n\n/** 语言包动态加载器,新增语言只需在此注册一条 */\nconst LANG_LOADERS: Record<CodeEditorLang, () => Promise<Extension>> = {\n js: () => import('@codemirror/lang-javascript').then((m) => m.javascript({ typescript: true })),\n sql: () => import('@codemirror/lang-sql').then((m) => m.sql()),\n java: () => import('@codemirror/lang-java').then((m) => m.java()),\n json: () => import('@codemirror/lang-json').then((m) => m.json()),\n spel: () => import('./langs/spel').then((m) => m.spel())\n}\n\n/** 按需加载语言扩展;模块缓存由运行时保证,重复切换同一语言不会重复下载 */\nexport function loadLanguage(lang: CodeEditorLang): Promise<Extension> {\n return LANG_LOADERS[lang]()\n}\n"],"mappings":";;AAKA,MAAM,eAAiE;CACrE,UAAU,OAAO,mHAA8B,CAAC,MAAM,MAAM,EAAE,WAAW,EAAE,YAAY,KAAK,CAAC,CAAC;CAC9F,WAAW,OAAO,sGAAuB,CAAC,MAAM,MAAM,EAAE,IAAI,CAAC;CAC7D,YAAY,OAAO,uGAAwB,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;CAChE,YAAY,OAAO,uGAAwB,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;CAChE,YAAY,OAAO,wBAAe,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"lang-loaders.js","names":[],"sources":["../../../src/components/code-editor/lang-loaders.ts"],"sourcesContent":["import type { Extension } from '@codemirror/state'\n\nimport type { CodeEditorLang } from '../../types'\n\n/** 语言包动态加载器,新增语言只需在此注册一条 */\nconst LANG_LOADERS: Record<CodeEditorLang, () => Promise<Extension>> = {\n js: () => import('@codemirror/lang-javascript').then((m) => m.javascript({ typescript: true })),\n sql: () => import('@codemirror/lang-sql').then((m) => m.sql()),\n java: () => import('@codemirror/lang-java').then((m) => m.java()),\n json: () => import('@codemirror/lang-json').then((m) => m.json()),\n spel: () => import('./langs/spel').then((m) => m.spel()),\n bash: () => import('./langs/bash').then((m) => m.bash()),\n powershell: () => import('./langs/powershell').then((m) => m.powershell())\n}\n\n/** 按需加载语言扩展;模块缓存由运行时保证,重复切换同一语言不会重复下载 */\nexport function loadLanguage(lang: CodeEditorLang): Promise<Extension> {\n return LANG_LOADERS[lang]()\n}\n"],"mappings":";;AAKA,MAAM,eAAiE;CACrE,UAAU,OAAO,mHAA8B,CAAC,MAAM,MAAM,EAAE,WAAW,EAAE,YAAY,KAAK,CAAC,CAAC;CAC9F,WAAW,OAAO,sGAAuB,CAAC,MAAM,MAAM,EAAE,IAAI,CAAC;CAC7D,YAAY,OAAO,uGAAwB,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;CAChE,YAAY,OAAO,uGAAwB,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;CAChE,YAAY,OAAO,wBAAe,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;CACvD,YAAY,OAAO,wBAAe,CAAC,MAAM,MAAM,EAAE,KAAK,CAAC;CACvD,kBAAkB,OAAO,8BAAqB,CAAC,MAAM,MAAM,EAAE,WAAW,CAAC;AAC3E;;AAGA,SAAgB,aAAa,MAA0C;CACrE,OAAO,aAAa,KAAK,CAAC;AAC5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LanguageSupport, StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js";
|
|
2
|
+
import { shell } from "../../../../node_modules/.bun/@codemirror_legacy-modes@6.5.3/node_modules/@codemirror/legacy-modes/mode/shell.js";
|
|
3
|
+
//#region src/components/code-editor/langs/bash/index.ts
|
|
4
|
+
/** Bash / shell 脚本语言支持(基于 CodeMirror legacy shell mode) */
|
|
5
|
+
function bash() {
|
|
6
|
+
return new LanguageSupport(StreamLanguage.define(shell));
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { bash };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/code-editor/langs/bash/index.ts"],"sourcesContent":["import { LanguageSupport, StreamLanguage } from '@codemirror/language'\nimport { shell } from '@codemirror/legacy-modes/mode/shell'\n\n/** Bash / shell 脚本语言支持(基于 CodeMirror legacy shell mode) */\nexport function bash(): LanguageSupport {\n return new LanguageSupport(StreamLanguage.define(shell))\n}\n"],"mappings":";;;;AAIA,SAAgB,OAAwB;CACtC,OAAO,IAAI,gBAAgB,eAAe,OAAO,KAAK,CAAC;AACzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LanguageSupport, StreamLanguage } from "../../../../node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js";
|
|
2
|
+
import { powerShell } from "../../../../node_modules/.bun/@codemirror_legacy-modes@6.5.3/node_modules/@codemirror/legacy-modes/mode/powershell.js";
|
|
3
|
+
//#region src/components/code-editor/langs/powershell/index.ts
|
|
4
|
+
/** PowerShell 语言支持(基于 CodeMirror legacy powershell mode) */
|
|
5
|
+
function powershell() {
|
|
6
|
+
return new LanguageSupport(StreamLanguage.define(powerShell));
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { powershell };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/code-editor/langs/powershell/index.ts"],"sourcesContent":["import { LanguageSupport, StreamLanguage } from '@codemirror/language'\nimport { powerShell } from '@codemirror/legacy-modes/mode/powershell'\n\n/** PowerShell 语言支持(基于 CodeMirror legacy powershell mode) */\nexport function powershell(): LanguageSupport {\n return new LanguageSupport(StreamLanguage.define(powerShell))\n}\n"],"mappings":";;;;AAIA,SAAgB,aAA8B;CAC5C,OAAO,IAAI,gBAAgB,eAAe,OAAO,UAAU,CAAC;AAC9D"}
|
|
@@ -7,8 +7,8 @@ declare const __VLS_export: import("vue").DefineComponent<DatePanelProps, {}, {}
|
|
|
7
7
|
"onSelect:range-date"?: ((rangeDate?: [import("@cat-kit/core").Dater, import("@cat-kit/core").Dater] | undefined) => any) | undefined;
|
|
8
8
|
"onSelect:date"?: ((date: import("@cat-kit/core").Dater) => any) | undefined;
|
|
9
9
|
}>, {
|
|
10
|
-
type: "date" | "month" | "year";
|
|
11
10
|
size: import("@veltra/utils").ComponentSize;
|
|
11
|
+
type: "date" | "month" | "year";
|
|
12
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const _default: typeof __VLS_export;
|
|
14
14
|
//#endregion
|
|
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DatePickerProps, {}, {
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
|
|
6
6
|
"onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
|
|
7
7
|
}>, {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
readonly: boolean;
|
|
8
10
|
type: "date" | "month" | "year";
|
|
9
11
|
placeholder: string;
|
|
10
12
|
clearable: boolean;
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
readonly: boolean;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
//#endregion
|
|
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DateRangePickerProps,
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<DateRangePickerProps> & Readonly<{
|
|
6
6
|
"onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
|
|
7
7
|
}>, {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
readonly: boolean;
|
|
8
10
|
type: "date" | "month" | "year";
|
|
9
11
|
placeholder: [string, string];
|
|
10
12
|
clearable: boolean;
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
readonly: boolean;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EmptyProps } from "../../types/empty.js";
|
|
2
2
|
//#region src/components/empty/empty.vue.d.ts
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<EmptyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EmptyProps> & Readonly<{}>, {
|
|
4
|
-
text: string;
|
|
5
4
|
size: number;
|
|
5
|
+
text: string;
|
|
6
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
declare const _default: typeof __VLS_export;
|
|
8
8
|
//#endregion
|
|
@@ -17,25 +17,25 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Inpu
|
|
|
17
17
|
"update:modelValue": (value: string) => any;
|
|
18
18
|
clear: () => any;
|
|
19
19
|
change: (value: string) => any;
|
|
20
|
-
focus: (value?: string | undefined) => any;
|
|
21
|
-
blur: (value?: string | undefined) => any;
|
|
22
20
|
"suffix:click": (value?: string | undefined) => any;
|
|
23
21
|
"prefix:click": (value?: string | undefined) => any;
|
|
22
|
+
focus: (value?: string | undefined) => any;
|
|
23
|
+
blur: (value?: string | undefined) => any;
|
|
24
24
|
"native:input": (ev: Event) => any;
|
|
25
25
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
26
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
27
27
|
onClear?: (() => any) | undefined;
|
|
28
28
|
onChange?: ((value: string) => any) | undefined;
|
|
29
|
-
onFocus?: ((value?: string | undefined) => any) | undefined;
|
|
30
|
-
onBlur?: ((value?: string | undefined) => any) | undefined;
|
|
31
29
|
"onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
|
|
32
30
|
"onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
|
|
31
|
+
onFocus?: ((value?: string | undefined) => any) | undefined;
|
|
32
|
+
onBlur?: ((value?: string | undefined) => any) | undefined;
|
|
33
33
|
"onNative:input"?: ((ev: Event) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
-
placeholder: string;
|
|
36
|
-
clearable: boolean;
|
|
37
35
|
disabled: boolean;
|
|
38
36
|
readonly: boolean;
|
|
37
|
+
placeholder: string;
|
|
38
|
+
clearable: boolean;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,13 +26,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
26
26
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
27
27
|
onChange?: ((options: Record<string, any>[]) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
readonly: boolean;
|
|
29
31
|
labelKey: string;
|
|
30
32
|
valueKey: string;
|
|
31
33
|
placeholder: string;
|
|
32
34
|
clearable: boolean;
|
|
33
35
|
minWidth: string;
|
|
34
|
-
disabled: boolean;
|
|
35
|
-
readonly: boolean;
|
|
36
36
|
visibilityLimit: number;
|
|
37
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -21,15 +21,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
21
21
|
onClear?: (() => any) | undefined;
|
|
22
22
|
onChange?: ((checked: Record<string, any>[]) => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
readonly: boolean;
|
|
25
26
|
labelKey: string;
|
|
26
27
|
valueKey: string;
|
|
28
|
+
expandAll: boolean;
|
|
27
29
|
placeholder: string;
|
|
28
30
|
clearable: boolean;
|
|
29
31
|
filterable: boolean;
|
|
30
32
|
minWidth: string;
|
|
31
|
-
disabled: boolean;
|
|
32
|
-
readonly: boolean;
|
|
33
33
|
visibilityLimit: number;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -20,10 +20,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
20
20
|
onClear?: (() => any) | undefined;
|
|
21
21
|
onChange?: ((value?: number | undefined) => any) | undefined;
|
|
22
22
|
}>, {
|
|
23
|
-
placeholder: string;
|
|
24
|
-
clearable: boolean;
|
|
25
23
|
disabled: boolean;
|
|
26
24
|
readonly: boolean;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
clearable: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
29
|
declare const _default: typeof __VLS_export;
|
|
@@ -22,9 +22,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
22
22
|
"onUpdate:start"?: ((value: number | undefined) => any) | undefined;
|
|
23
23
|
"onUpdate:end"?: ((value: number | undefined) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
|
-
clearable: boolean;
|
|
26
25
|
disabled: boolean;
|
|
27
26
|
readonly: boolean;
|
|
27
|
+
clearable: boolean;
|
|
28
28
|
startPlaceholder: string;
|
|
29
29
|
endPlaceholder: string;
|
|
30
30
|
separator: string;
|
|
@@ -13,9 +13,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
13
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
14
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
clearable: boolean;
|
|
17
16
|
disabled: boolean;
|
|
18
17
|
readonly: boolean;
|
|
18
|
+
clearable: boolean;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_base: import("vue").DefineComponent<PopConfirmProps, {}, {},
|
|
|
12
12
|
onConfirm?: (() => any) | undefined;
|
|
13
13
|
onCancel?: (() => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
direction: TipDirection;
|
|
16
15
|
trigger: "hover" | "click";
|
|
16
|
+
direction: TipDirection;
|
|
17
17
|
icon: import("vue").Component;
|
|
18
18
|
iconColor: string;
|
|
19
19
|
confirmText: string;
|
|
@@ -19,9 +19,9 @@ declare const __VLS_base: import("vue").DefineComponent<ProgressNodesProps, {},
|
|
|
19
19
|
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
20
20
|
onClick?: ((node: Record<string, any>, index: number) => any) | undefined;
|
|
21
21
|
}>, {
|
|
22
|
+
colorType: import("@veltra/utils").ColorType;
|
|
22
23
|
labelKey: string;
|
|
23
24
|
valueKey: string;
|
|
24
|
-
colorType: import("@veltra/utils").ColorType;
|
|
25
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
@@ -14,10 +14,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
14
14
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
15
15
|
onChange?: ((item: Record<string, any>) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
labelKey: string;
|
|
18
|
-
valueKey: string;
|
|
19
17
|
disabled: boolean;
|
|
20
18
|
readonly: boolean;
|
|
19
|
+
labelKey: string;
|
|
20
|
+
valueKey: string;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
//#endregion
|
|
@@ -10,9 +10,9 @@ declare const __VLS_export: import("vue").DefineComponent<RichTextEditorProps &
|
|
|
10
10
|
}> & Readonly<{
|
|
11
11
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
-
placeholder: string;
|
|
14
13
|
disabled: boolean;
|
|
15
14
|
readonly: boolean;
|
|
15
|
+
placeholder: string;
|
|
16
16
|
format: RichTextFormat;
|
|
17
17
|
toolbar: ToolbarItem[];
|
|
18
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -24,12 +24,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
24
24
|
"onUpdate:text"?: ((value: any) => any) | undefined;
|
|
25
25
|
"onUpdate:label"?: ((label?: string | undefined) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
readonly: boolean;
|
|
27
29
|
labelKey: string;
|
|
28
30
|
valueKey: string;
|
|
29
31
|
placeholder: string;
|
|
30
32
|
clearable: boolean;
|
|
31
|
-
disabled: boolean;
|
|
32
|
-
readonly: boolean;
|
|
33
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
35
|
declare const _default: typeof __VLS_export;
|
|
@@ -12,8 +12,8 @@ declare const __VLS_base: import("vue").DefineComponent<StepsProps, {}, {}, {},
|
|
|
12
12
|
"onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
|
|
13
13
|
"onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
direction: "horizontal" | "vertical";
|
|
16
15
|
labelKey: string;
|
|
16
|
+
direction: "horizontal" | "vertical";
|
|
17
17
|
finishedStepType: import("@veltra/utils").ColorType;
|
|
18
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
19
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|