@deot/vc 1.0.61 → 1.0.63
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/index.d.ts +24 -6
- package/dist/index.iife.js +94 -60
- package/dist/index.umd.cjs +94 -60
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -10179,7 +10179,11 @@ export declare const Components: {
|
|
|
10179
10179
|
default: () => {};
|
|
10180
10180
|
};
|
|
10181
10181
|
delay: NumberConstructor;
|
|
10182
|
-
|
|
10182
|
+
resizable: {
|
|
10183
|
+
type: BooleanConstructor;
|
|
10184
|
+
default: undefined;
|
|
10185
|
+
};
|
|
10186
|
+
}>, () => JSX_2.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick")[], "select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick", PublicProps, Readonly<ExtractPropTypes< {
|
|
10183
10187
|
data: {
|
|
10184
10188
|
type: ArrayConstructor;
|
|
10185
10189
|
default: () => never[];
|
|
@@ -10251,6 +10255,10 @@ export declare const Components: {
|
|
|
10251
10255
|
default: () => {};
|
|
10252
10256
|
};
|
|
10253
10257
|
delay: NumberConstructor;
|
|
10258
|
+
resizable: {
|
|
10259
|
+
type: BooleanConstructor;
|
|
10260
|
+
default: undefined;
|
|
10261
|
+
};
|
|
10254
10262
|
}>> & Readonly<{
|
|
10255
10263
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
10256
10264
|
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10263,12 +10271,12 @@ export declare const Components: {
|
|
|
10263
10271
|
"onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
10264
10272
|
"onUpdate:sort"?: ((...args: any[]) => any) | undefined;
|
|
10265
10273
|
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
10274
|
+
"onHeader-dragend"?: ((...args: any[]) => any) | undefined;
|
|
10266
10275
|
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
10267
10276
|
"onCell-dblclick"?: ((...args: any[]) => any) | undefined;
|
|
10268
10277
|
"onRow-click"?: ((...args: any[]) => any) | undefined;
|
|
10269
10278
|
"onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
10270
10279
|
"onRow-dblclick"?: ((...args: any[]) => any) | undefined;
|
|
10271
|
-
"onHeader-dragend "?: ((...args: any[]) => any) | undefined;
|
|
10272
10280
|
}>, {
|
|
10273
10281
|
sort: Record<string, any>;
|
|
10274
10282
|
data: unknown[];
|
|
@@ -10282,6 +10290,7 @@ export declare const Components: {
|
|
|
10282
10290
|
expandSelectable: boolean;
|
|
10283
10291
|
showHeader: boolean;
|
|
10284
10292
|
rows: number;
|
|
10293
|
+
resizable: boolean;
|
|
10285
10294
|
stripe: boolean;
|
|
10286
10295
|
divider: boolean;
|
|
10287
10296
|
showSummary: boolean;
|
|
@@ -10360,7 +10369,11 @@ export declare const Components: {
|
|
|
10360
10369
|
default: () => {};
|
|
10361
10370
|
};
|
|
10362
10371
|
delay: NumberConstructor;
|
|
10363
|
-
|
|
10372
|
+
resizable: {
|
|
10373
|
+
type: BooleanConstructor;
|
|
10374
|
+
default: undefined;
|
|
10375
|
+
};
|
|
10376
|
+
}>, () => JSX_2.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick")[], "select" | "select-all" | "selection-change" | "expand-change" | "current-change" | "cell-mouse-enter" | "cell-mouse-leave" | "header-click" | "header-contextmenu" | "update:sort" | "sort-change" | "header-dragend" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick", PublicProps, Readonly<ExtractPropTypes< {
|
|
10364
10377
|
data: {
|
|
10365
10378
|
type: ArrayConstructor;
|
|
10366
10379
|
default: () => never[];
|
|
@@ -10432,6 +10445,10 @@ export declare const Components: {
|
|
|
10432
10445
|
default: () => {};
|
|
10433
10446
|
};
|
|
10434
10447
|
delay: NumberConstructor;
|
|
10448
|
+
resizable: {
|
|
10449
|
+
type: BooleanConstructor;
|
|
10450
|
+
default: undefined;
|
|
10451
|
+
};
|
|
10435
10452
|
}>> & Readonly<{
|
|
10436
10453
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
10437
10454
|
"onSelect-all"?: ((...args: any[]) => any) | undefined;
|
|
@@ -10444,12 +10461,12 @@ export declare const Components: {
|
|
|
10444
10461
|
"onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
10445
10462
|
"onUpdate:sort"?: ((...args: any[]) => any) | undefined;
|
|
10446
10463
|
"onSort-change"?: ((...args: any[]) => any) | undefined;
|
|
10464
|
+
"onHeader-dragend"?: ((...args: any[]) => any) | undefined;
|
|
10447
10465
|
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
10448
10466
|
"onCell-dblclick"?: ((...args: any[]) => any) | undefined;
|
|
10449
10467
|
"onRow-click"?: ((...args: any[]) => any) | undefined;
|
|
10450
10468
|
"onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
10451
10469
|
"onRow-dblclick"?: ((...args: any[]) => any) | undefined;
|
|
10452
|
-
"onHeader-dragend "?: ((...args: any[]) => any) | undefined;
|
|
10453
10470
|
}>, {
|
|
10454
10471
|
sort: Record<string, any>;
|
|
10455
10472
|
data: unknown[];
|
|
@@ -10463,6 +10480,7 @@ export declare const Components: {
|
|
|
10463
10480
|
expandSelectable: boolean;
|
|
10464
10481
|
showHeader: boolean;
|
|
10465
10482
|
rows: number;
|
|
10483
|
+
resizable: boolean;
|
|
10466
10484
|
stripe: boolean;
|
|
10467
10485
|
divider: boolean;
|
|
10468
10486
|
showSummary: boolean;
|
|
@@ -10544,8 +10562,8 @@ export declare const Components: {
|
|
|
10544
10562
|
}>> & Readonly<{}>, {
|
|
10545
10563
|
type: string;
|
|
10546
10564
|
reserveSelection: boolean;
|
|
10547
|
-
sortable: boolean;
|
|
10548
10565
|
resizable: boolean;
|
|
10566
|
+
sortable: boolean;
|
|
10549
10567
|
filterMultiple: boolean;
|
|
10550
10568
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
10551
10569
|
MTableColumn: DefineComponent<ExtractPropTypes< {
|
|
@@ -10623,8 +10641,8 @@ export declare const Components: {
|
|
|
10623
10641
|
}>> & Readonly<{}>, {
|
|
10624
10642
|
type: string;
|
|
10625
10643
|
reserveSelection: boolean;
|
|
10626
|
-
sortable: boolean;
|
|
10627
10644
|
resizable: boolean;
|
|
10645
|
+
sortable: boolean;
|
|
10628
10646
|
filterMultiple: boolean;
|
|
10629
10647
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
10630
10648
|
Tabs: DefineComponent<ExtractPropTypes< {
|
package/dist/index.iife.js
CHANGED
|
@@ -12993,9 +12993,9 @@ var Vc = (function (exports, vue) {
|
|
|
12993
12993
|
chart.value.group = props2.group;
|
|
12994
12994
|
}
|
|
12995
12995
|
chart.value.setOption(manualOptions.value || props2.options || {}, true);
|
|
12996
|
-
EVENTS$1.forEach((
|
|
12997
|
-
chart.value.on(
|
|
12998
|
-
emit(
|
|
12996
|
+
EVENTS$1.forEach((event) => {
|
|
12997
|
+
chart.value.on(event, (params) => {
|
|
12998
|
+
emit(event, params);
|
|
12999
12999
|
});
|
|
13000
13000
|
});
|
|
13001
13001
|
if (props2.resize !== false) {
|
|
@@ -14067,6 +14067,7 @@ var Vc = (function (exports, vue) {
|
|
|
14067
14067
|
const minute = vue.ref("");
|
|
14068
14068
|
const second = vue.ref("");
|
|
14069
14069
|
const millisecond = vue.ref("");
|
|
14070
|
+
const isComplete = vue.ref(false);
|
|
14070
14071
|
const showResult = vue.computed(() => {
|
|
14071
14072
|
return !props2.render && !slots.default;
|
|
14072
14073
|
});
|
|
@@ -14132,15 +14133,18 @@ var Vc = (function (exports, vue) {
|
|
|
14132
14133
|
millisecond.value = String(Math.floor(timestamp % 1e3 / (1e3 / msDividend.value)));
|
|
14133
14134
|
if (timestamp <= 0) {
|
|
14134
14135
|
stop();
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14136
|
+
if (!isComplete.value) {
|
|
14137
|
+
isComplete.value = true;
|
|
14138
|
+
emit("change", {
|
|
14139
|
+
timestamp: 0,
|
|
14140
|
+
day: "00",
|
|
14141
|
+
hour: "00",
|
|
14142
|
+
minute: "00",
|
|
14143
|
+
second: "00",
|
|
14144
|
+
millisecond: "00"
|
|
14145
|
+
});
|
|
14146
|
+
emit("complete");
|
|
14147
|
+
}
|
|
14144
14148
|
} else {
|
|
14145
14149
|
emit("change", {
|
|
14146
14150
|
timestamp,
|
|
@@ -14155,6 +14159,8 @@ var Vc = (function (exports, vue) {
|
|
|
14155
14159
|
const start = () => {
|
|
14156
14160
|
if (targetTimestamp.value) {
|
|
14157
14161
|
timer && clearInterval(timer);
|
|
14162
|
+
isComplete.value = false;
|
|
14163
|
+
run();
|
|
14158
14164
|
timer = setInterval(run, T.value);
|
|
14159
14165
|
}
|
|
14160
14166
|
};
|
|
@@ -15823,8 +15829,8 @@ var Vc = (function (exports, vue) {
|
|
|
15823
15829
|
const offsetFromStart = row * 7 + column - offsetDay.value;
|
|
15824
15830
|
return nextDate(startDate.value, offsetFromStart);
|
|
15825
15831
|
};
|
|
15826
|
-
const getCell2 = (
|
|
15827
|
-
let target =
|
|
15832
|
+
const getCell2 = (event) => {
|
|
15833
|
+
let target = event.target;
|
|
15828
15834
|
if (target.tagName === "SPAN") {
|
|
15829
15835
|
target = target.parentNode.parentNode;
|
|
15830
15836
|
}
|
|
@@ -15858,23 +15864,23 @@ var Vc = (function (exports, vue) {
|
|
|
15858
15864
|
}
|
|
15859
15865
|
return classes.join(" ");
|
|
15860
15866
|
};
|
|
15861
|
-
const handleClick = (
|
|
15867
|
+
const handleClick = (event) => {
|
|
15862
15868
|
const {
|
|
15863
15869
|
cell,
|
|
15864
15870
|
row,
|
|
15865
15871
|
column
|
|
15866
|
-
} = getCell2(
|
|
15872
|
+
} = getCell2(event);
|
|
15867
15873
|
if (!cell) return;
|
|
15868
15874
|
if (cell.disabled || cell.type === "week") return;
|
|
15869
15875
|
const newDate = getDateOfCell(row, column);
|
|
15870
15876
|
emit("pick", newDate, cell);
|
|
15871
15877
|
};
|
|
15872
|
-
const handleMouseMove = (
|
|
15878
|
+
const handleMouseMove = (event) => {
|
|
15873
15879
|
const {
|
|
15874
15880
|
cell,
|
|
15875
15881
|
row,
|
|
15876
15882
|
column
|
|
15877
|
-
} = getCell2(
|
|
15883
|
+
} = getCell2(event);
|
|
15878
15884
|
if (!cell) return;
|
|
15879
15885
|
if (!props2.rangeState.selecting || cell.disabled) return;
|
|
15880
15886
|
const newDate = getDateOfCell(row, column);
|
|
@@ -15965,8 +15971,8 @@ var Vc = (function (exports, vue) {
|
|
|
15965
15971
|
}
|
|
15966
15972
|
return $rows;
|
|
15967
15973
|
});
|
|
15968
|
-
const getCell2 = (
|
|
15969
|
-
let target =
|
|
15974
|
+
const getCell2 = (event) => {
|
|
15975
|
+
let target = event.target;
|
|
15970
15976
|
if (target.tagName === "SPAN") {
|
|
15971
15977
|
target = target.parentNode.parentNode;
|
|
15972
15978
|
}
|
|
@@ -15998,18 +16004,18 @@ var Vc = (function (exports, vue) {
|
|
|
15998
16004
|
}
|
|
15999
16005
|
return classes.join(" ");
|
|
16000
16006
|
};
|
|
16001
|
-
const handleClick = (
|
|
16007
|
+
const handleClick = (event) => {
|
|
16002
16008
|
const {
|
|
16003
16009
|
cell
|
|
16004
|
-
} = getCell2(
|
|
16010
|
+
} = getCell2(event);
|
|
16005
16011
|
if (!cell) return;
|
|
16006
16012
|
if (cell.disabled) return;
|
|
16007
16013
|
emit("pick", cell.date);
|
|
16008
16014
|
};
|
|
16009
|
-
const handleMouseMove = (
|
|
16015
|
+
const handleMouseMove = (event) => {
|
|
16010
16016
|
const {
|
|
16011
16017
|
cell
|
|
16012
|
-
} = getCell2(
|
|
16018
|
+
} = getCell2(event);
|
|
16013
16019
|
if (!cell) return;
|
|
16014
16020
|
if (!props2.rangeState.selecting || cell.disabled) return;
|
|
16015
16021
|
emit("range-change", cell.date);
|
|
@@ -16126,8 +16132,8 @@ var Vc = (function (exports, vue) {
|
|
|
16126
16132
|
}
|
|
16127
16133
|
return classes.join(" ");
|
|
16128
16134
|
};
|
|
16129
|
-
const getCell2 = (
|
|
16130
|
-
let target =
|
|
16135
|
+
const getCell2 = (event) => {
|
|
16136
|
+
let target = event.target;
|
|
16131
16137
|
if (target.tagName === "SPAN") {
|
|
16132
16138
|
target = target.parentNode.parentNode;
|
|
16133
16139
|
}
|
|
@@ -16143,18 +16149,18 @@ var Vc = (function (exports, vue) {
|
|
|
16143
16149
|
column
|
|
16144
16150
|
};
|
|
16145
16151
|
};
|
|
16146
|
-
const handleClick = (
|
|
16152
|
+
const handleClick = (event) => {
|
|
16147
16153
|
const {
|
|
16148
16154
|
cell
|
|
16149
|
-
} = getCell2(
|
|
16155
|
+
} = getCell2(event);
|
|
16150
16156
|
if (!cell) return;
|
|
16151
16157
|
if (cell.disabled) return;
|
|
16152
16158
|
emit("pick", cell.dates);
|
|
16153
16159
|
};
|
|
16154
|
-
const handleMouseMove = (
|
|
16160
|
+
const handleMouseMove = (event) => {
|
|
16155
16161
|
const {
|
|
16156
16162
|
cell
|
|
16157
|
-
} = getCell2(
|
|
16163
|
+
} = getCell2(event);
|
|
16158
16164
|
if (!cell) return;
|
|
16159
16165
|
if (!props2.rangeState.selecting || cell.disabled) return;
|
|
16160
16166
|
emit("range-change", cell.dates);
|
|
@@ -18219,10 +18225,11 @@ var Vc = (function (exports, vue) {
|
|
|
18219
18225
|
"vc-scroller__wrapper"
|
|
18220
18226
|
];
|
|
18221
18227
|
});
|
|
18222
|
-
const refreshSize = () => {
|
|
18228
|
+
const refreshSize = async () => {
|
|
18223
18229
|
if (!wrapper.value) return;
|
|
18224
18230
|
wrapperW.value = wrapper.value.clientWidth;
|
|
18225
18231
|
wrapperH.value = wrapper.value.clientHeight;
|
|
18232
|
+
await vue.nextTick();
|
|
18226
18233
|
contentH.value = wrapper.value.scrollHeight;
|
|
18227
18234
|
contentW.value = wrapper.value.scrollWidth;
|
|
18228
18235
|
};
|
|
@@ -22820,11 +22827,10 @@ var Vc = (function (exports, vue) {
|
|
|
22820
22827
|
} = owner.exposed;
|
|
22821
22828
|
return !multiple.value ? true : current.value.slice(-1)[0] === props2.value;
|
|
22822
22829
|
});
|
|
22823
|
-
const searchRegex = vue.computed(() => {
|
|
22824
|
-
const v = owner.exposed.searchValue.value.trim().replace(/\s+/g, " ").split(/\s|,/);
|
|
22825
|
-
return new RegExp(`(${v.join("|")})`, "i");
|
|
22826
|
-
});
|
|
22827
22830
|
const isActive = vue.computed(() => {
|
|
22831
|
+
const {
|
|
22832
|
+
searchRegex
|
|
22833
|
+
} = owner.exposed;
|
|
22828
22834
|
return !!(searchRegex.value.test(formatterLabel.value) || !props2.filterable);
|
|
22829
22835
|
});
|
|
22830
22836
|
const customOptions = vue.computed(() => {
|
|
@@ -23025,6 +23031,10 @@ var Vc = (function (exports, vue) {
|
|
|
23025
23031
|
const v = currentValue.value.length - props2.maxTags;
|
|
23026
23032
|
return v < 0 ? 0 : v;
|
|
23027
23033
|
});
|
|
23034
|
+
const searchRegex = vue.computed(() => {
|
|
23035
|
+
const v = searchValue.value.trim().replace(/\s+/g, " ").split(/\s|,/);
|
|
23036
|
+
return new RegExp(escapeString(`(${v.join("|")})`), "i");
|
|
23037
|
+
});
|
|
23028
23038
|
const optionMap = vue.ref({});
|
|
23029
23039
|
const options = vue.computed(() => {
|
|
23030
23040
|
return Object.values(optionMap.value);
|
|
@@ -23111,7 +23121,7 @@ var Vc = (function (exports, vue) {
|
|
|
23111
23121
|
add,
|
|
23112
23122
|
remove,
|
|
23113
23123
|
close,
|
|
23114
|
-
|
|
23124
|
+
searchRegex,
|
|
23115
23125
|
multiple,
|
|
23116
23126
|
isActive,
|
|
23117
23127
|
current: currentValue,
|
|
@@ -27198,6 +27208,10 @@ var Vc = (function (exports, vue) {
|
|
|
27198
27208
|
sort: {
|
|
27199
27209
|
type: Object,
|
|
27200
27210
|
default: () => ({})
|
|
27211
|
+
},
|
|
27212
|
+
resizable: {
|
|
27213
|
+
type: Boolean,
|
|
27214
|
+
default: void 0
|
|
27201
27215
|
}
|
|
27202
27216
|
},
|
|
27203
27217
|
setup(props2) {
|
|
@@ -27206,6 +27220,13 @@ var Vc = (function (exports, vue) {
|
|
|
27206
27220
|
const draggingColumn = vue.ref(null);
|
|
27207
27221
|
const dragging = vue.ref(false);
|
|
27208
27222
|
const dragState = vue.ref({});
|
|
27223
|
+
const allowDrag = vue.computed(() => {
|
|
27224
|
+
return typeof props2.resizable === "boolean" ? props2.resizable : props2.border;
|
|
27225
|
+
});
|
|
27226
|
+
const dragLineClass = vue.computed(() => {
|
|
27227
|
+
if (props2.border || !props2.resizable) return;
|
|
27228
|
+
return "has-drag-line";
|
|
27229
|
+
});
|
|
27209
27230
|
const states = useStates({
|
|
27210
27231
|
columns: "columns",
|
|
27211
27232
|
isAllSelected: "isAllSelected",
|
|
@@ -27308,10 +27329,10 @@ var Vc = (function (exports, vue) {
|
|
|
27308
27329
|
const handleMouseDown = (e, column) => {
|
|
27309
27330
|
if (IS_SERVER$3) return;
|
|
27310
27331
|
if (column.children && column.children.length > 0) return;
|
|
27311
|
-
if (draggingColumn.value &&
|
|
27332
|
+
if (draggingColumn.value && allowDrag.value) {
|
|
27312
27333
|
dragging.value = true;
|
|
27313
27334
|
table.resizeProxyVisible.value = true;
|
|
27314
|
-
const tableEl = table.
|
|
27335
|
+
const tableEl = table.tableWrapper.value;
|
|
27315
27336
|
const tableLeft = tableEl.getBoundingClientRect().left;
|
|
27316
27337
|
const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
|
|
27317
27338
|
const columnRect = columnEl.getBoundingClientRect();
|
|
@@ -27340,15 +27361,14 @@ var Vc = (function (exports, vue) {
|
|
|
27340
27361
|
} = dragState.value;
|
|
27341
27362
|
const finalLeft = parseInt(resizeProxy.style.left, 10);
|
|
27342
27363
|
const columnWidth = finalLeft - startColumnLeft;
|
|
27343
|
-
column.width = columnWidth;
|
|
27344
|
-
column.
|
|
27345
|
-
table.$emit("header-dragend", column.width, startLeft - startColumnLeft, column, event);
|
|
27364
|
+
column.width = column.minWidth = column.realWidth = columnWidth;
|
|
27365
|
+
table.emit("header-dragend", column.width, startLeft - startColumnLeft, column);
|
|
27346
27366
|
table.store.scheduleLayout();
|
|
27347
27367
|
document.body.style.cursor = "";
|
|
27348
27368
|
dragging.value = false;
|
|
27349
27369
|
draggingColumn.value = null;
|
|
27350
27370
|
dragState.value = {};
|
|
27351
|
-
table.resizeProxyVisible = false;
|
|
27371
|
+
table.resizeProxyVisible.value = false;
|
|
27352
27372
|
}
|
|
27353
27373
|
document.removeEventListener("mousemove", handleMouseMove2);
|
|
27354
27374
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
@@ -27362,17 +27382,17 @@ var Vc = (function (exports, vue) {
|
|
|
27362
27382
|
document.addEventListener("mouseup", handleMouseUp);
|
|
27363
27383
|
}
|
|
27364
27384
|
};
|
|
27365
|
-
const handleMouseMove = (
|
|
27385
|
+
const handleMouseMove = (event, column) => {
|
|
27366
27386
|
if (column.children && column.children.length > 0) return;
|
|
27367
|
-
let target =
|
|
27387
|
+
let target = event.target;
|
|
27368
27388
|
while (target && !target.classList?.contains?.("vc-table__th")) {
|
|
27369
27389
|
target = target.parentNode;
|
|
27370
27390
|
}
|
|
27371
27391
|
if (!column || !column.resizable) return;
|
|
27372
|
-
if (!dragging.value &&
|
|
27392
|
+
if (!dragging.value && allowDrag.value) {
|
|
27373
27393
|
const rect = target.getBoundingClientRect();
|
|
27374
27394
|
const bodyStyle = document.body.style;
|
|
27375
|
-
if (rect.width > 12 && rect.right -
|
|
27395
|
+
if (rect.width > 12 && rect.right - event.pageX < 8) {
|
|
27376
27396
|
bodyStyle.cursor = "col-resize";
|
|
27377
27397
|
if (hasClass(target, "is-sortable")) {
|
|
27378
27398
|
target.style.cursor = "col-resize";
|
|
@@ -27439,7 +27459,7 @@ var Vc = (function (exports, vue) {
|
|
|
27439
27459
|
"style": [getHeaderCellStyle(rowIndex, columnIndex, columns, column), {
|
|
27440
27460
|
width: `${column.realWidth}px`
|
|
27441
27461
|
}],
|
|
27442
|
-
"class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), "vc-table__th"],
|
|
27462
|
+
"class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), column.resizable && dragLineClass.value, "vc-table__th"],
|
|
27443
27463
|
"key": column.id
|
|
27444
27464
|
}, [vue.createVNode("div", {
|
|
27445
27465
|
"class": [
|
|
@@ -27677,13 +27697,17 @@ var Vc = (function (exports, vue) {
|
|
|
27677
27697
|
default: () => ({})
|
|
27678
27698
|
},
|
|
27679
27699
|
// 用于延迟渲染,用于计算高度
|
|
27680
|
-
delay: Number
|
|
27700
|
+
delay: Number,
|
|
27701
|
+
resizable: {
|
|
27702
|
+
type: Boolean,
|
|
27703
|
+
default: void 0
|
|
27704
|
+
}
|
|
27681
27705
|
};
|
|
27682
27706
|
const COMPONENT_NAME$j = "vc-table";
|
|
27683
27707
|
const Table$1 = /* @__PURE__ */ vue.defineComponent({
|
|
27684
27708
|
name: COMPONENT_NAME$j,
|
|
27685
27709
|
props: props$d,
|
|
27686
|
-
emits: ["select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "current-change", "header-dragend
|
|
27710
|
+
emits: ["select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "current-change", "header-dragend", "expand-change", "sort-change", "update:sort"],
|
|
27687
27711
|
setup(props2, {
|
|
27688
27712
|
slots,
|
|
27689
27713
|
expose,
|
|
@@ -27702,6 +27726,7 @@ var Vc = (function (exports, vue) {
|
|
|
27702
27726
|
width: null,
|
|
27703
27727
|
height: null
|
|
27704
27728
|
});
|
|
27729
|
+
const tableWrapper = vue.ref(null);
|
|
27705
27730
|
const hiddenColumns = vue.ref(null);
|
|
27706
27731
|
const headerWrapper = vue.ref(null);
|
|
27707
27732
|
const tableHeader = vue.ref(null);
|
|
@@ -28039,6 +28064,7 @@ var Vc = (function (exports, vue) {
|
|
|
28039
28064
|
toggleRowExpansion,
|
|
28040
28065
|
clearSelection,
|
|
28041
28066
|
scroller,
|
|
28067
|
+
tableWrapper,
|
|
28042
28068
|
headerWrapper,
|
|
28043
28069
|
appendWrapper,
|
|
28044
28070
|
footerWrapper,
|
|
@@ -28049,12 +28075,15 @@ var Vc = (function (exports, vue) {
|
|
|
28049
28075
|
renderExpanded,
|
|
28050
28076
|
hiddenColumns,
|
|
28051
28077
|
props: props2,
|
|
28052
|
-
emit
|
|
28078
|
+
emit,
|
|
28079
|
+
resizeProxy,
|
|
28080
|
+
resizeProxyVisible
|
|
28053
28081
|
};
|
|
28054
28082
|
expose(exposed);
|
|
28055
28083
|
vue.provide("vc-table", exposed);
|
|
28056
28084
|
return () => {
|
|
28057
28085
|
return vue.createVNode("div", {
|
|
28086
|
+
"ref": tableWrapper,
|
|
28058
28087
|
"class": [classes.value, tableId, "vc-table"],
|
|
28059
28088
|
"onMouseleave": handleMouseLeave
|
|
28060
28089
|
}, [vue.createVNode("div", {
|
|
@@ -28066,6 +28095,7 @@ var Vc = (function (exports, vue) {
|
|
|
28066
28095
|
}, [vue.createVNode(TableHeader, {
|
|
28067
28096
|
"ref": tableHeader,
|
|
28068
28097
|
"border": props2.border,
|
|
28098
|
+
"resizable": props2.resizable,
|
|
28069
28099
|
"sort": props2.sort,
|
|
28070
28100
|
"style": bodyWidthStyle.value
|
|
28071
28101
|
}, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
|
|
@@ -28083,15 +28113,10 @@ var Vc = (function (exports, vue) {
|
|
|
28083
28113
|
"style": [bodyWidthStyle.value],
|
|
28084
28114
|
"height-style": [bodyHeightStyle.value],
|
|
28085
28115
|
"onScroll": handleScollY
|
|
28086
|
-
}, null), props2.data.length === 0 && vue.createVNode("div", {
|
|
28087
|
-
"
|
|
28088
|
-
"style": bodyWidthStyle.value
|
|
28089
|
-
|
|
28090
|
-
"is-absolute": !!props2.height
|
|
28091
|
-
}, "vc-table__empty-wrapper"]
|
|
28092
|
-
}, [vue.createVNode("span", {
|
|
28093
|
-
"class": "vc-table__empty-text"
|
|
28094
|
-
}, [slots.empty ? slots.empty() : props2.emptyText || "暂无数据"])]), slots.append && vue.createVNode("div", {
|
|
28116
|
+
}, null), props2.data.length === 0 && !props2.height && vue.createVNode("div", {
|
|
28117
|
+
"class": "vc-table__empty-placeholder",
|
|
28118
|
+
"style": [bodyWidthStyle.value]
|
|
28119
|
+
}, null), slots.append && vue.createVNode("div", {
|
|
28095
28120
|
"ref": appendWrapper,
|
|
28096
28121
|
"class": "vc-table__append-wrapper"
|
|
28097
28122
|
}, [slots.append()])]
|
|
@@ -28115,6 +28140,7 @@ var Vc = (function (exports, vue) {
|
|
|
28115
28140
|
}, [vue.createVNode(TableHeader, {
|
|
28116
28141
|
"ref": leftFixedTableHeader,
|
|
28117
28142
|
"border": props2.border,
|
|
28143
|
+
"resizable": props2.resizable,
|
|
28118
28144
|
"sort": props2.sort,
|
|
28119
28145
|
"style": bodyWidthStyle.value,
|
|
28120
28146
|
"fixed": "left"
|
|
@@ -28154,6 +28180,7 @@ var Vc = (function (exports, vue) {
|
|
|
28154
28180
|
}, [vue.createVNode(TableHeader, {
|
|
28155
28181
|
"ref": rightFixedTableHeader,
|
|
28156
28182
|
"border": props2.border,
|
|
28183
|
+
"resizable": props2.resizable,
|
|
28157
28184
|
"sort": props2.sort,
|
|
28158
28185
|
"style": bodyWidthStyle.value,
|
|
28159
28186
|
"fixed": "right"
|
|
@@ -28181,7 +28208,14 @@ var Vc = (function (exports, vue) {
|
|
|
28181
28208
|
"get-summary": props2.getSummary,
|
|
28182
28209
|
"style": bodyWidthStyle.value,
|
|
28183
28210
|
"fixed": "right"
|
|
28184
|
-
}, null)]), [[vue.vShow, props2.data && props2.data.length > 0]])]),
|
|
28211
|
+
}, null)]), [[vue.vShow, props2.data && props2.data.length > 0]])]), props2.data.length === 0 && vue.createVNode("div", {
|
|
28212
|
+
"ref": emptyBlock,
|
|
28213
|
+
"class": [{
|
|
28214
|
+
"has-height": !!props2.height
|
|
28215
|
+
}, "vc-table__empty-wrapper"]
|
|
28216
|
+
}, [slots.empty ? slots.empty() : vue.createVNode("span", {
|
|
28217
|
+
"class": "vc-table__empty-text"
|
|
28218
|
+
}, [props2.emptyText || "暂无数据"])]), vue.withDirectives(vue.createVNode("div", {
|
|
28185
28219
|
"ref": resizeProxy,
|
|
28186
28220
|
"class": "vc-table__column-resize-proxy"
|
|
28187
28221
|
}, null), [[vue.vShow, resizeProxyVisible.value]])]);
|
package/dist/index.umd.cjs
CHANGED
|
@@ -12996,9 +12996,9 @@
|
|
|
12996
12996
|
chart.value.group = props2.group;
|
|
12997
12997
|
}
|
|
12998
12998
|
chart.value.setOption(manualOptions.value || props2.options || {}, true);
|
|
12999
|
-
EVENTS$1.forEach((
|
|
13000
|
-
chart.value.on(
|
|
13001
|
-
emit(
|
|
12999
|
+
EVENTS$1.forEach((event) => {
|
|
13000
|
+
chart.value.on(event, (params) => {
|
|
13001
|
+
emit(event, params);
|
|
13002
13002
|
});
|
|
13003
13003
|
});
|
|
13004
13004
|
if (props2.resize !== false) {
|
|
@@ -14070,6 +14070,7 @@
|
|
|
14070
14070
|
const minute = vue.ref("");
|
|
14071
14071
|
const second = vue.ref("");
|
|
14072
14072
|
const millisecond = vue.ref("");
|
|
14073
|
+
const isComplete = vue.ref(false);
|
|
14073
14074
|
const showResult = vue.computed(() => {
|
|
14074
14075
|
return !props2.render && !slots.default;
|
|
14075
14076
|
});
|
|
@@ -14135,15 +14136,18 @@
|
|
|
14135
14136
|
millisecond.value = String(Math.floor(timestamp % 1e3 / (1e3 / msDividend.value)));
|
|
14136
14137
|
if (timestamp <= 0) {
|
|
14137
14138
|
stop();
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14139
|
+
if (!isComplete.value) {
|
|
14140
|
+
isComplete.value = true;
|
|
14141
|
+
emit("change", {
|
|
14142
|
+
timestamp: 0,
|
|
14143
|
+
day: "00",
|
|
14144
|
+
hour: "00",
|
|
14145
|
+
minute: "00",
|
|
14146
|
+
second: "00",
|
|
14147
|
+
millisecond: "00"
|
|
14148
|
+
});
|
|
14149
|
+
emit("complete");
|
|
14150
|
+
}
|
|
14147
14151
|
} else {
|
|
14148
14152
|
emit("change", {
|
|
14149
14153
|
timestamp,
|
|
@@ -14158,6 +14162,8 @@
|
|
|
14158
14162
|
const start = () => {
|
|
14159
14163
|
if (targetTimestamp.value) {
|
|
14160
14164
|
timer && clearInterval(timer);
|
|
14165
|
+
isComplete.value = false;
|
|
14166
|
+
run();
|
|
14161
14167
|
timer = setInterval(run, T.value);
|
|
14162
14168
|
}
|
|
14163
14169
|
};
|
|
@@ -15826,8 +15832,8 @@
|
|
|
15826
15832
|
const offsetFromStart = row * 7 + column - offsetDay.value;
|
|
15827
15833
|
return nextDate(startDate.value, offsetFromStart);
|
|
15828
15834
|
};
|
|
15829
|
-
const getCell2 = (
|
|
15830
|
-
let target =
|
|
15835
|
+
const getCell2 = (event) => {
|
|
15836
|
+
let target = event.target;
|
|
15831
15837
|
if (target.tagName === "SPAN") {
|
|
15832
15838
|
target = target.parentNode.parentNode;
|
|
15833
15839
|
}
|
|
@@ -15861,23 +15867,23 @@
|
|
|
15861
15867
|
}
|
|
15862
15868
|
return classes.join(" ");
|
|
15863
15869
|
};
|
|
15864
|
-
const handleClick = (
|
|
15870
|
+
const handleClick = (event) => {
|
|
15865
15871
|
const {
|
|
15866
15872
|
cell,
|
|
15867
15873
|
row,
|
|
15868
15874
|
column
|
|
15869
|
-
} = getCell2(
|
|
15875
|
+
} = getCell2(event);
|
|
15870
15876
|
if (!cell) return;
|
|
15871
15877
|
if (cell.disabled || cell.type === "week") return;
|
|
15872
15878
|
const newDate = getDateOfCell(row, column);
|
|
15873
15879
|
emit("pick", newDate, cell);
|
|
15874
15880
|
};
|
|
15875
|
-
const handleMouseMove = (
|
|
15881
|
+
const handleMouseMove = (event) => {
|
|
15876
15882
|
const {
|
|
15877
15883
|
cell,
|
|
15878
15884
|
row,
|
|
15879
15885
|
column
|
|
15880
|
-
} = getCell2(
|
|
15886
|
+
} = getCell2(event);
|
|
15881
15887
|
if (!cell) return;
|
|
15882
15888
|
if (!props2.rangeState.selecting || cell.disabled) return;
|
|
15883
15889
|
const newDate = getDateOfCell(row, column);
|
|
@@ -15968,8 +15974,8 @@
|
|
|
15968
15974
|
}
|
|
15969
15975
|
return $rows;
|
|
15970
15976
|
});
|
|
15971
|
-
const getCell2 = (
|
|
15972
|
-
let target =
|
|
15977
|
+
const getCell2 = (event) => {
|
|
15978
|
+
let target = event.target;
|
|
15973
15979
|
if (target.tagName === "SPAN") {
|
|
15974
15980
|
target = target.parentNode.parentNode;
|
|
15975
15981
|
}
|
|
@@ -16001,18 +16007,18 @@
|
|
|
16001
16007
|
}
|
|
16002
16008
|
return classes.join(" ");
|
|
16003
16009
|
};
|
|
16004
|
-
const handleClick = (
|
|
16010
|
+
const handleClick = (event) => {
|
|
16005
16011
|
const {
|
|
16006
16012
|
cell
|
|
16007
|
-
} = getCell2(
|
|
16013
|
+
} = getCell2(event);
|
|
16008
16014
|
if (!cell) return;
|
|
16009
16015
|
if (cell.disabled) return;
|
|
16010
16016
|
emit("pick", cell.date);
|
|
16011
16017
|
};
|
|
16012
|
-
const handleMouseMove = (
|
|
16018
|
+
const handleMouseMove = (event) => {
|
|
16013
16019
|
const {
|
|
16014
16020
|
cell
|
|
16015
|
-
} = getCell2(
|
|
16021
|
+
} = getCell2(event);
|
|
16016
16022
|
if (!cell) return;
|
|
16017
16023
|
if (!props2.rangeState.selecting || cell.disabled) return;
|
|
16018
16024
|
emit("range-change", cell.date);
|
|
@@ -16129,8 +16135,8 @@
|
|
|
16129
16135
|
}
|
|
16130
16136
|
return classes.join(" ");
|
|
16131
16137
|
};
|
|
16132
|
-
const getCell2 = (
|
|
16133
|
-
let target =
|
|
16138
|
+
const getCell2 = (event) => {
|
|
16139
|
+
let target = event.target;
|
|
16134
16140
|
if (target.tagName === "SPAN") {
|
|
16135
16141
|
target = target.parentNode.parentNode;
|
|
16136
16142
|
}
|
|
@@ -16146,18 +16152,18 @@
|
|
|
16146
16152
|
column
|
|
16147
16153
|
};
|
|
16148
16154
|
};
|
|
16149
|
-
const handleClick = (
|
|
16155
|
+
const handleClick = (event) => {
|
|
16150
16156
|
const {
|
|
16151
16157
|
cell
|
|
16152
|
-
} = getCell2(
|
|
16158
|
+
} = getCell2(event);
|
|
16153
16159
|
if (!cell) return;
|
|
16154
16160
|
if (cell.disabled) return;
|
|
16155
16161
|
emit("pick", cell.dates);
|
|
16156
16162
|
};
|
|
16157
|
-
const handleMouseMove = (
|
|
16163
|
+
const handleMouseMove = (event) => {
|
|
16158
16164
|
const {
|
|
16159
16165
|
cell
|
|
16160
|
-
} = getCell2(
|
|
16166
|
+
} = getCell2(event);
|
|
16161
16167
|
if (!cell) return;
|
|
16162
16168
|
if (!props2.rangeState.selecting || cell.disabled) return;
|
|
16163
16169
|
emit("range-change", cell.dates);
|
|
@@ -18222,10 +18228,11 @@
|
|
|
18222
18228
|
"vc-scroller__wrapper"
|
|
18223
18229
|
];
|
|
18224
18230
|
});
|
|
18225
|
-
const refreshSize = () => {
|
|
18231
|
+
const refreshSize = async () => {
|
|
18226
18232
|
if (!wrapper.value) return;
|
|
18227
18233
|
wrapperW.value = wrapper.value.clientWidth;
|
|
18228
18234
|
wrapperH.value = wrapper.value.clientHeight;
|
|
18235
|
+
await vue.nextTick();
|
|
18229
18236
|
contentH.value = wrapper.value.scrollHeight;
|
|
18230
18237
|
contentW.value = wrapper.value.scrollWidth;
|
|
18231
18238
|
};
|
|
@@ -22823,11 +22830,10 @@
|
|
|
22823
22830
|
} = owner.exposed;
|
|
22824
22831
|
return !multiple.value ? true : current.value.slice(-1)[0] === props2.value;
|
|
22825
22832
|
});
|
|
22826
|
-
const searchRegex = vue.computed(() => {
|
|
22827
|
-
const v = owner.exposed.searchValue.value.trim().replace(/\s+/g, " ").split(/\s|,/);
|
|
22828
|
-
return new RegExp(`(${v.join("|")})`, "i");
|
|
22829
|
-
});
|
|
22830
22833
|
const isActive = vue.computed(() => {
|
|
22834
|
+
const {
|
|
22835
|
+
searchRegex
|
|
22836
|
+
} = owner.exposed;
|
|
22831
22837
|
return !!(searchRegex.value.test(formatterLabel.value) || !props2.filterable);
|
|
22832
22838
|
});
|
|
22833
22839
|
const customOptions = vue.computed(() => {
|
|
@@ -23028,6 +23034,10 @@
|
|
|
23028
23034
|
const v = currentValue.value.length - props2.maxTags;
|
|
23029
23035
|
return v < 0 ? 0 : v;
|
|
23030
23036
|
});
|
|
23037
|
+
const searchRegex = vue.computed(() => {
|
|
23038
|
+
const v = searchValue.value.trim().replace(/\s+/g, " ").split(/\s|,/);
|
|
23039
|
+
return new RegExp(escapeString(`(${v.join("|")})`), "i");
|
|
23040
|
+
});
|
|
23031
23041
|
const optionMap = vue.ref({});
|
|
23032
23042
|
const options = vue.computed(() => {
|
|
23033
23043
|
return Object.values(optionMap.value);
|
|
@@ -23114,7 +23124,7 @@
|
|
|
23114
23124
|
add,
|
|
23115
23125
|
remove,
|
|
23116
23126
|
close,
|
|
23117
|
-
|
|
23127
|
+
searchRegex,
|
|
23118
23128
|
multiple,
|
|
23119
23129
|
isActive,
|
|
23120
23130
|
current: currentValue,
|
|
@@ -27201,6 +27211,10 @@
|
|
|
27201
27211
|
sort: {
|
|
27202
27212
|
type: Object,
|
|
27203
27213
|
default: () => ({})
|
|
27214
|
+
},
|
|
27215
|
+
resizable: {
|
|
27216
|
+
type: Boolean,
|
|
27217
|
+
default: void 0
|
|
27204
27218
|
}
|
|
27205
27219
|
},
|
|
27206
27220
|
setup(props2) {
|
|
@@ -27209,6 +27223,13 @@
|
|
|
27209
27223
|
const draggingColumn = vue.ref(null);
|
|
27210
27224
|
const dragging = vue.ref(false);
|
|
27211
27225
|
const dragState = vue.ref({});
|
|
27226
|
+
const allowDrag = vue.computed(() => {
|
|
27227
|
+
return typeof props2.resizable === "boolean" ? props2.resizable : props2.border;
|
|
27228
|
+
});
|
|
27229
|
+
const dragLineClass = vue.computed(() => {
|
|
27230
|
+
if (props2.border || !props2.resizable) return;
|
|
27231
|
+
return "has-drag-line";
|
|
27232
|
+
});
|
|
27212
27233
|
const states = useStates({
|
|
27213
27234
|
columns: "columns",
|
|
27214
27235
|
isAllSelected: "isAllSelected",
|
|
@@ -27311,10 +27332,10 @@
|
|
|
27311
27332
|
const handleMouseDown = (e, column) => {
|
|
27312
27333
|
if (IS_SERVER$3) return;
|
|
27313
27334
|
if (column.children && column.children.length > 0) return;
|
|
27314
|
-
if (draggingColumn.value &&
|
|
27335
|
+
if (draggingColumn.value && allowDrag.value) {
|
|
27315
27336
|
dragging.value = true;
|
|
27316
27337
|
table.resizeProxyVisible.value = true;
|
|
27317
|
-
const tableEl = table.
|
|
27338
|
+
const tableEl = table.tableWrapper.value;
|
|
27318
27339
|
const tableLeft = tableEl.getBoundingClientRect().left;
|
|
27319
27340
|
const columnEl = instance.vnode.el.querySelector(`.vc-table__th.${column.id}`);
|
|
27320
27341
|
const columnRect = columnEl.getBoundingClientRect();
|
|
@@ -27343,15 +27364,14 @@
|
|
|
27343
27364
|
} = dragState.value;
|
|
27344
27365
|
const finalLeft = parseInt(resizeProxy.style.left, 10);
|
|
27345
27366
|
const columnWidth = finalLeft - startColumnLeft;
|
|
27346
|
-
column.width = columnWidth;
|
|
27347
|
-
column.
|
|
27348
|
-
table.$emit("header-dragend", column.width, startLeft - startColumnLeft, column, event);
|
|
27367
|
+
column.width = column.minWidth = column.realWidth = columnWidth;
|
|
27368
|
+
table.emit("header-dragend", column.width, startLeft - startColumnLeft, column);
|
|
27349
27369
|
table.store.scheduleLayout();
|
|
27350
27370
|
document.body.style.cursor = "";
|
|
27351
27371
|
dragging.value = false;
|
|
27352
27372
|
draggingColumn.value = null;
|
|
27353
27373
|
dragState.value = {};
|
|
27354
|
-
table.resizeProxyVisible = false;
|
|
27374
|
+
table.resizeProxyVisible.value = false;
|
|
27355
27375
|
}
|
|
27356
27376
|
document.removeEventListener("mousemove", handleMouseMove2);
|
|
27357
27377
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
@@ -27365,17 +27385,17 @@
|
|
|
27365
27385
|
document.addEventListener("mouseup", handleMouseUp);
|
|
27366
27386
|
}
|
|
27367
27387
|
};
|
|
27368
|
-
const handleMouseMove = (
|
|
27388
|
+
const handleMouseMove = (event, column) => {
|
|
27369
27389
|
if (column.children && column.children.length > 0) return;
|
|
27370
|
-
let target =
|
|
27390
|
+
let target = event.target;
|
|
27371
27391
|
while (target && !target.classList?.contains?.("vc-table__th")) {
|
|
27372
27392
|
target = target.parentNode;
|
|
27373
27393
|
}
|
|
27374
27394
|
if (!column || !column.resizable) return;
|
|
27375
|
-
if (!dragging.value &&
|
|
27395
|
+
if (!dragging.value && allowDrag.value) {
|
|
27376
27396
|
const rect = target.getBoundingClientRect();
|
|
27377
27397
|
const bodyStyle = document.body.style;
|
|
27378
|
-
if (rect.width > 12 && rect.right -
|
|
27398
|
+
if (rect.width > 12 && rect.right - event.pageX < 8) {
|
|
27379
27399
|
bodyStyle.cursor = "col-resize";
|
|
27380
27400
|
if (hasClass(target, "is-sortable")) {
|
|
27381
27401
|
target.style.cursor = "col-resize";
|
|
@@ -27442,7 +27462,7 @@
|
|
|
27442
27462
|
"style": [getHeaderCellStyle(rowIndex, columnIndex, columns, column), {
|
|
27443
27463
|
width: `${column.realWidth}px`
|
|
27444
27464
|
}],
|
|
27445
|
-
"class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), "vc-table__th"],
|
|
27465
|
+
"class": [getHeaderCellClass(rowIndex, columnIndex, columns, column), column.resizable && dragLineClass.value, "vc-table__th"],
|
|
27446
27466
|
"key": column.id
|
|
27447
27467
|
}, [vue.createVNode("div", {
|
|
27448
27468
|
"class": [
|
|
@@ -27680,13 +27700,17 @@
|
|
|
27680
27700
|
default: () => ({})
|
|
27681
27701
|
},
|
|
27682
27702
|
// 用于延迟渲染,用于计算高度
|
|
27683
|
-
delay: Number
|
|
27703
|
+
delay: Number,
|
|
27704
|
+
resizable: {
|
|
27705
|
+
type: Boolean,
|
|
27706
|
+
default: void 0
|
|
27707
|
+
}
|
|
27684
27708
|
};
|
|
27685
27709
|
const COMPONENT_NAME$j = "vc-table";
|
|
27686
27710
|
const Table$1 = /* @__PURE__ */ vue.defineComponent({
|
|
27687
27711
|
name: COMPONENT_NAME$j,
|
|
27688
27712
|
props: props$d,
|
|
27689
|
-
emits: ["select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "current-change", "header-dragend
|
|
27713
|
+
emits: ["select", "select-all", "selection-change", "cell-mouse-enter", "cell-mouse-leave", "cell-click", "cell-dblclick", "row-click", "row-contextmenu", "row-dblclick", "header-click", "header-contextmenu", "current-change", "header-dragend", "expand-change", "sort-change", "update:sort"],
|
|
27690
27714
|
setup(props2, {
|
|
27691
27715
|
slots,
|
|
27692
27716
|
expose,
|
|
@@ -27705,6 +27729,7 @@
|
|
|
27705
27729
|
width: null,
|
|
27706
27730
|
height: null
|
|
27707
27731
|
});
|
|
27732
|
+
const tableWrapper = vue.ref(null);
|
|
27708
27733
|
const hiddenColumns = vue.ref(null);
|
|
27709
27734
|
const headerWrapper = vue.ref(null);
|
|
27710
27735
|
const tableHeader = vue.ref(null);
|
|
@@ -28042,6 +28067,7 @@
|
|
|
28042
28067
|
toggleRowExpansion,
|
|
28043
28068
|
clearSelection,
|
|
28044
28069
|
scroller,
|
|
28070
|
+
tableWrapper,
|
|
28045
28071
|
headerWrapper,
|
|
28046
28072
|
appendWrapper,
|
|
28047
28073
|
footerWrapper,
|
|
@@ -28052,12 +28078,15 @@
|
|
|
28052
28078
|
renderExpanded,
|
|
28053
28079
|
hiddenColumns,
|
|
28054
28080
|
props: props2,
|
|
28055
|
-
emit
|
|
28081
|
+
emit,
|
|
28082
|
+
resizeProxy,
|
|
28083
|
+
resizeProxyVisible
|
|
28056
28084
|
};
|
|
28057
28085
|
expose(exposed);
|
|
28058
28086
|
vue.provide("vc-table", exposed);
|
|
28059
28087
|
return () => {
|
|
28060
28088
|
return vue.createVNode("div", {
|
|
28089
|
+
"ref": tableWrapper,
|
|
28061
28090
|
"class": [classes.value, tableId, "vc-table"],
|
|
28062
28091
|
"onMouseleave": handleMouseLeave
|
|
28063
28092
|
}, [vue.createVNode("div", {
|
|
@@ -28069,6 +28098,7 @@
|
|
|
28069
28098
|
}, [vue.createVNode(TableHeader, {
|
|
28070
28099
|
"ref": tableHeader,
|
|
28071
28100
|
"border": props2.border,
|
|
28101
|
+
"resizable": props2.resizable,
|
|
28072
28102
|
"sort": props2.sort,
|
|
28073
28103
|
"style": bodyWidthStyle.value
|
|
28074
28104
|
}, null)]), states.columns.length > 0 && vue.createVNode(ScrollerWheel, {
|
|
@@ -28086,15 +28116,10 @@
|
|
|
28086
28116
|
"style": [bodyWidthStyle.value],
|
|
28087
28117
|
"height-style": [bodyHeightStyle.value],
|
|
28088
28118
|
"onScroll": handleScollY
|
|
28089
|
-
}, null), props2.data.length === 0 && vue.createVNode("div", {
|
|
28090
|
-
"
|
|
28091
|
-
"style": bodyWidthStyle.value
|
|
28092
|
-
|
|
28093
|
-
"is-absolute": !!props2.height
|
|
28094
|
-
}, "vc-table__empty-wrapper"]
|
|
28095
|
-
}, [vue.createVNode("span", {
|
|
28096
|
-
"class": "vc-table__empty-text"
|
|
28097
|
-
}, [slots.empty ? slots.empty() : props2.emptyText || "暂无数据"])]), slots.append && vue.createVNode("div", {
|
|
28119
|
+
}, null), props2.data.length === 0 && !props2.height && vue.createVNode("div", {
|
|
28120
|
+
"class": "vc-table__empty-placeholder",
|
|
28121
|
+
"style": [bodyWidthStyle.value]
|
|
28122
|
+
}, null), slots.append && vue.createVNode("div", {
|
|
28098
28123
|
"ref": appendWrapper,
|
|
28099
28124
|
"class": "vc-table__append-wrapper"
|
|
28100
28125
|
}, [slots.append()])]
|
|
@@ -28118,6 +28143,7 @@
|
|
|
28118
28143
|
}, [vue.createVNode(TableHeader, {
|
|
28119
28144
|
"ref": leftFixedTableHeader,
|
|
28120
28145
|
"border": props2.border,
|
|
28146
|
+
"resizable": props2.resizable,
|
|
28121
28147
|
"sort": props2.sort,
|
|
28122
28148
|
"style": bodyWidthStyle.value,
|
|
28123
28149
|
"fixed": "left"
|
|
@@ -28157,6 +28183,7 @@
|
|
|
28157
28183
|
}, [vue.createVNode(TableHeader, {
|
|
28158
28184
|
"ref": rightFixedTableHeader,
|
|
28159
28185
|
"border": props2.border,
|
|
28186
|
+
"resizable": props2.resizable,
|
|
28160
28187
|
"sort": props2.sort,
|
|
28161
28188
|
"style": bodyWidthStyle.value,
|
|
28162
28189
|
"fixed": "right"
|
|
@@ -28184,7 +28211,14 @@
|
|
|
28184
28211
|
"get-summary": props2.getSummary,
|
|
28185
28212
|
"style": bodyWidthStyle.value,
|
|
28186
28213
|
"fixed": "right"
|
|
28187
|
-
}, null)]), [[vue.vShow, props2.data && props2.data.length > 0]])]),
|
|
28214
|
+
}, null)]), [[vue.vShow, props2.data && props2.data.length > 0]])]), props2.data.length === 0 && vue.createVNode("div", {
|
|
28215
|
+
"ref": emptyBlock,
|
|
28216
|
+
"class": [{
|
|
28217
|
+
"has-height": !!props2.height
|
|
28218
|
+
}, "vc-table__empty-wrapper"]
|
|
28219
|
+
}, [slots.empty ? slots.empty() : vue.createVNode("span", {
|
|
28220
|
+
"class": "vc-table__empty-text"
|
|
28221
|
+
}, [props2.emptyText || "暂无数据"])]), vue.withDirectives(vue.createVNode("div", {
|
|
28188
28222
|
"ref": resizeProxy,
|
|
28189
28223
|
"class": "vc-table__column-resize-proxy"
|
|
28190
28224
|
}, null), [[vue.vShow, resizeProxyVisible.value]])]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deot/vc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@deot/vc-components": "^1.0.
|
|
23
|
-
"@deot/vc-hooks": "^1.0.
|
|
24
|
-
"@deot/vc-shared": "^1.0.
|
|
22
|
+
"@deot/vc-components": "^1.0.63",
|
|
23
|
+
"@deot/vc-hooks": "^1.0.63",
|
|
24
|
+
"@deot/vc-shared": "^1.0.63"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"vue": "*"
|