@vunk/plus 1.1.0 → 1.1.1
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { computed, ref, watch, inject, isVNode, Comment, Fragment, shallowRef, watchEffect, provide, onBeforeUnmount, onBeforeMount, toRef, defineComponent, h, createVNode, resolveComponent, openBlock, createBlock, withCtx, mergeProps, toHandlers } from 'vue';
|
|
2
2
|
import { _VkTabelsV1Ctx, VkTablesV1 } from '@vunk/plus/components/tables-v1';
|
|
3
3
|
import { VkCheckRecordLogicProvider, VkCheckRecordLogic } from '@vunk/core';
|
|
4
|
+
import { noop } from '@vunk/shared/function';
|
|
4
5
|
import { ElCheckbox } from 'element-plus';
|
|
5
6
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
6
7
|
|
|
@@ -3942,6 +3943,13 @@ const props = {
|
|
|
3942
3943
|
selectionHidden: {
|
|
3943
3944
|
type: Boolean,
|
|
3944
3945
|
default: false
|
|
3946
|
+
},
|
|
3947
|
+
/**
|
|
3948
|
+
* check触发方式
|
|
3949
|
+
*/
|
|
3950
|
+
checkTrigger: {
|
|
3951
|
+
type: String,
|
|
3952
|
+
default: "check"
|
|
3945
3953
|
}
|
|
3946
3954
|
};
|
|
3947
3955
|
const emits = {
|
|
@@ -3968,7 +3976,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3968
3976
|
emit
|
|
3969
3977
|
}) {
|
|
3970
3978
|
const coreProps = _VkTabelsV1Ctx.createBindProps(props2, ["columns"]);
|
|
3971
|
-
const coreEmits = _VkTabelsV1Ctx.createOnEmits(emit);
|
|
3979
|
+
const coreEmits = _VkTabelsV1Ctx.createOnEmits(emit, ["row-click"]);
|
|
3972
3980
|
const getCurrentPageCheckInfo = () => {
|
|
3973
3981
|
const oidField = props2.oidField;
|
|
3974
3982
|
const allCheckedId = props2.modelValue.map(d => d[oidField]);
|
|
@@ -4004,6 +4012,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4004
4012
|
}));
|
|
4005
4013
|
}
|
|
4006
4014
|
}
|
|
4015
|
+
const changeEvents = {};
|
|
4007
4016
|
const checkboxCol = {
|
|
4008
4017
|
prop: void 0,
|
|
4009
4018
|
label: "",
|
|
@@ -4020,14 +4029,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4020
4029
|
isActive
|
|
4021
4030
|
}) => {
|
|
4022
4031
|
const onChange = props2.multiple ? toggle : () => singleChange(e.row);
|
|
4032
|
+
if (!props2.disabled) {
|
|
4033
|
+
changeEvents[e.row[props2.oidField]] = onChange;
|
|
4034
|
+
}
|
|
4035
|
+
const handleCheck = props2.checkTrigger === "check" ? onChange : noop;
|
|
4023
4036
|
return props2.multiple ? createVNode(ElCheckbox, {
|
|
4024
4037
|
"disabled": props2.disabled,
|
|
4025
4038
|
"modelValue": isActive,
|
|
4026
|
-
"onChange":
|
|
4039
|
+
"onChange": handleCheck
|
|
4027
4040
|
}, null) : createVNode(NRadio, {
|
|
4028
4041
|
"disabled": props2.disabled,
|
|
4029
4042
|
"checked": isActive,
|
|
4030
|
-
"onUpdate:checked":
|
|
4043
|
+
"onUpdate:checked": handleCheck,
|
|
4031
4044
|
"theme-overrides": radioThemeOverrides
|
|
4032
4045
|
}, null);
|
|
4033
4046
|
}
|
|
@@ -4047,10 +4060,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4047
4060
|
}
|
|
4048
4061
|
}
|
|
4049
4062
|
};
|
|
4063
|
+
function handleRowClick(...e) {
|
|
4064
|
+
const [row] = e;
|
|
4065
|
+
if (props2.checkTrigger === "rowClick") {
|
|
4066
|
+
const id = row[props2.oidField];
|
|
4067
|
+
changeEvents[id]?.();
|
|
4068
|
+
}
|
|
4069
|
+
emit("row-click", ...e);
|
|
4070
|
+
}
|
|
4050
4071
|
return {
|
|
4051
4072
|
coreProps,
|
|
4052
4073
|
coreEmits,
|
|
4053
|
-
checkboxCol
|
|
4074
|
+
checkboxCol,
|
|
4075
|
+
handleRowClick
|
|
4054
4076
|
};
|
|
4055
4077
|
}
|
|
4056
4078
|
});
|
|
@@ -4072,8 +4094,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4072
4094
|
columns: [
|
|
4073
4095
|
_ctx.selectionHidden ? { hidden: true } : _ctx.checkboxCol,
|
|
4074
4096
|
..._ctx.columns
|
|
4075
|
-
]
|
|
4076
|
-
|
|
4097
|
+
],
|
|
4098
|
+
onRowClick: _ctx.handleRowClick
|
|
4099
|
+
}, toHandlers(_ctx.coreEmits)), null, 16, ["columns", "onRowClick"])
|
|
4077
4100
|
]),
|
|
4078
4101
|
_: 1
|
|
4079
4102
|
/* STABLE */
|
|
@@ -38,6 +38,13 @@ export declare const props: {
|
|
|
38
38
|
type: BooleanConstructor;
|
|
39
39
|
default: boolean;
|
|
40
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* check触发方式
|
|
43
|
+
*/
|
|
44
|
+
checkTrigger: {
|
|
45
|
+
type: PropType<"check" | "rowClick">;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
41
48
|
border: {
|
|
42
49
|
type: BooleanConstructor;
|
|
43
50
|
default: boolean;
|
|
@@ -20,6 +20,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
+
checkTrigger: {
|
|
24
|
+
type: import("vue").PropType<"check" | "rowClick">;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
23
27
|
border: {
|
|
24
28
|
type: BooleanConstructor;
|
|
25
29
|
default: boolean;
|
|
@@ -331,8 +335,35 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
331
335
|
modules: "pagination"[];
|
|
332
336
|
elRef: import("@vunk/core").AnyFunc;
|
|
333
337
|
}>;
|
|
334
|
-
coreEmits: {
|
|
338
|
+
coreEmits: {
|
|
339
|
+
change: (val: number) => void;
|
|
340
|
+
scroll: (val: number) => void;
|
|
341
|
+
select: (val: number) => void;
|
|
342
|
+
"select-all": (val: number) => void;
|
|
343
|
+
"expand-change": (val: number) => void;
|
|
344
|
+
"current-change": (val: number) => void;
|
|
345
|
+
"selection-change": (val: number) => void;
|
|
346
|
+
"cell-mouse-enter": (val: number) => void;
|
|
347
|
+
"cell-mouse-leave": (val: number) => void;
|
|
348
|
+
"cell-contextmenu": (val: number) => void;
|
|
349
|
+
"cell-click": (val: number) => void;
|
|
350
|
+
"cell-dblclick": (val: number) => void;
|
|
351
|
+
"row-contextmenu": (val: number) => void;
|
|
352
|
+
"row-dblclick": (val: number) => void;
|
|
353
|
+
"header-click": (val: number) => void;
|
|
354
|
+
"header-contextmenu": (val: number) => void;
|
|
355
|
+
"sort-change": (val: number) => void;
|
|
356
|
+
"filter-change": (val: number) => void;
|
|
357
|
+
"header-dragend": (val: number) => void;
|
|
358
|
+
"update:start": (val: number) => void;
|
|
359
|
+
"update:current-page": (val: number) => void;
|
|
360
|
+
"update:page-size": (val: number) => void;
|
|
361
|
+
"size-change": (val: number) => void;
|
|
362
|
+
"prev-click": (val: number) => void;
|
|
363
|
+
"next-click": (val: number) => void;
|
|
364
|
+
};
|
|
335
365
|
checkboxCol: __VkTablesV1.Column<any>;
|
|
366
|
+
handleRowClick: (...e: any[]) => void;
|
|
336
367
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
337
368
|
'update:modelValue': (val: any[]) => boolean;
|
|
338
369
|
'update:start': (val: number) => boolean;
|
|
@@ -382,6 +413,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
382
413
|
type: BooleanConstructor;
|
|
383
414
|
default: boolean;
|
|
384
415
|
};
|
|
416
|
+
checkTrigger: {
|
|
417
|
+
type: import("vue").PropType<"check" | "rowClick">;
|
|
418
|
+
default: string;
|
|
419
|
+
};
|
|
385
420
|
border: {
|
|
386
421
|
type: BooleanConstructor;
|
|
387
422
|
default: boolean;
|
|
@@ -663,6 +698,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
663
698
|
oidField: string;
|
|
664
699
|
multiple: boolean;
|
|
665
700
|
selectionHidden: boolean;
|
|
701
|
+
checkTrigger: "check" | "rowClick";
|
|
666
702
|
}, {}, {
|
|
667
703
|
VkCheckRecordLogicProvider: import("vue").DefineComponent<{
|
|
668
704
|
modelValue: {
|