3h1-ui 3.0.0-next.45 → 3.0.0-next.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +34 -14
- package/lib/index.js +34 -14
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -37065,7 +37065,7 @@ function _isSlot$2(s) {
|
|
|
37065
37065
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
37066
37066
|
}
|
|
37067
37067
|
const ShyTableColumn = /* @__PURE__ */ defineComponent({
|
|
37068
|
-
emits: ["columns-change"],
|
|
37068
|
+
emits: ["columns-change", "columns-reset"],
|
|
37069
37069
|
setup(props2, {
|
|
37070
37070
|
emit
|
|
37071
37071
|
}) {
|
|
@@ -37192,8 +37192,12 @@ const ShyTableColumn = /* @__PURE__ */ defineComponent({
|
|
|
37192
37192
|
state.checkedList = [...state.defaultCheckList];
|
|
37193
37193
|
state.checkAll = true;
|
|
37194
37194
|
plainOptions.value = unref(cachePlainOptions);
|
|
37195
|
-
handleEmit(table2.getCacheColumns());
|
|
37196
37195
|
sortable.sort(sortableOrder);
|
|
37196
|
+
inset = true;
|
|
37197
|
+
emit("columns-reset");
|
|
37198
|
+
setTimeout(() => {
|
|
37199
|
+
inset = false;
|
|
37200
|
+
});
|
|
37197
37201
|
}
|
|
37198
37202
|
function handleVisibleChange() {
|
|
37199
37203
|
if (inited)
|
|
@@ -37437,7 +37441,7 @@ const ShyTableSetting = /* @__PURE__ */ defineComponent({
|
|
|
37437
37441
|
default: () => ({})
|
|
37438
37442
|
}
|
|
37439
37443
|
},
|
|
37440
|
-
emits: ["columns-change"],
|
|
37444
|
+
emits: ["columns-change", "columns-reset"],
|
|
37441
37445
|
setup(props2, {
|
|
37442
37446
|
emit
|
|
37443
37447
|
}) {
|
|
@@ -37460,6 +37464,9 @@ const ShyTableSetting = /* @__PURE__ */ defineComponent({
|
|
|
37460
37464
|
const handleColumnChange = (data) => {
|
|
37461
37465
|
emit("columns-change", data);
|
|
37462
37466
|
};
|
|
37467
|
+
const handleColumnsReset = () => {
|
|
37468
|
+
emit("columns-reset");
|
|
37469
|
+
};
|
|
37463
37470
|
const getTableContainer = () => {
|
|
37464
37471
|
return table2 ? unref(table2.wrapRef) : document.body;
|
|
37465
37472
|
};
|
|
@@ -37487,6 +37494,7 @@ const ShyTableSetting = /* @__PURE__ */ defineComponent({
|
|
|
37487
37494
|
const renderTableColumn = computed(() => {
|
|
37488
37495
|
return getSetting.value.setting ? createVNode(ShyTableColumn, {
|
|
37489
37496
|
"onColumnsChange": handleColumnChange,
|
|
37497
|
+
"onColumnsReset": handleColumnsReset,
|
|
37490
37498
|
"getPopupContainer": getTableContainer
|
|
37491
37499
|
}, null) : null;
|
|
37492
37500
|
});
|
|
@@ -37552,7 +37560,7 @@ const ShyTableHeader = /* @__PURE__ */ defineComponent({
|
|
|
37552
37560
|
type: Boolean
|
|
37553
37561
|
}
|
|
37554
37562
|
},
|
|
37555
|
-
emits: ["columns-change"],
|
|
37563
|
+
emits: ["columns-change", "columns-reset"],
|
|
37556
37564
|
setup(props2, {
|
|
37557
37565
|
emit,
|
|
37558
37566
|
slots
|
|
@@ -37560,10 +37568,17 @@ const ShyTableHeader = /* @__PURE__ */ defineComponent({
|
|
|
37560
37568
|
const {
|
|
37561
37569
|
prefixCls: prefixCls2
|
|
37562
37570
|
} = useDesign$1("table-header");
|
|
37571
|
+
const handleColumnChange = (data) => {
|
|
37572
|
+
emit("columns-change", data);
|
|
37573
|
+
};
|
|
37574
|
+
const handleColumnsReset = () => {
|
|
37575
|
+
emit("columns-reset");
|
|
37576
|
+
};
|
|
37563
37577
|
const isShowSetting = () => {
|
|
37564
37578
|
return props2.showTableSetting ? createVNode(ShyTableSetting, {
|
|
37565
37579
|
"setting": props2.tableSetting,
|
|
37566
|
-
"onColumnsChange": handleColumnChange
|
|
37580
|
+
"onColumnsChange": handleColumnChange,
|
|
37581
|
+
"onColumnsReset": handleColumnsReset
|
|
37567
37582
|
}, null) : null;
|
|
37568
37583
|
};
|
|
37569
37584
|
const isShowTitle = () => {
|
|
@@ -37576,9 +37591,6 @@ const ShyTableHeader = /* @__PURE__ */ defineComponent({
|
|
|
37576
37591
|
"class": `${prefixCls2}-placeholder`
|
|
37577
37592
|
}, null);
|
|
37578
37593
|
};
|
|
37579
|
-
const handleColumnChange = (data) => {
|
|
37580
|
-
emit("columns-change", data);
|
|
37581
|
-
};
|
|
37582
37594
|
const getAlignClass = computed(() => [`${prefixCls2}-align`, `${prefixCls2}-align-${props2.headerAlign}`]);
|
|
37583
37595
|
return () => {
|
|
37584
37596
|
var _a2;
|
|
@@ -37618,7 +37630,8 @@ const useTableHeader = (propsRef, slots, handlers2) => {
|
|
|
37618
37630
|
titleHelpMessage,
|
|
37619
37631
|
showTableSetting,
|
|
37620
37632
|
tableSetting,
|
|
37621
|
-
onColumnsChange: handlers2.onColumnsChange
|
|
37633
|
+
onColumnsChange: handlers2.onColumnsChange,
|
|
37634
|
+
onColumnsReset: handlers2.onColumnsReset
|
|
37622
37635
|
};
|
|
37623
37636
|
return {
|
|
37624
37637
|
title: hideTitle ? null : () => createVNode(ShyTableHeader, headerProps, {
|
|
@@ -37666,18 +37679,19 @@ function handleColumnResize(propsRef, columns, wrapRef) {
|
|
|
37666
37679
|
);
|
|
37667
37680
|
const length2 = columns.length;
|
|
37668
37681
|
columns.forEach((item) => {
|
|
37669
|
-
const
|
|
37670
|
-
const
|
|
37682
|
+
const minWidth = ((item == null ? void 0 : item.title) + "").length * 14 + 16;
|
|
37683
|
+
const colWidth = item.width || minWidth;
|
|
37684
|
+
const countWidth = tableWidth && length2 - sumLength ? (tableWidth - sumWidth - selectWidth) / (length2 - sumLength) : colWidth;
|
|
37671
37685
|
if (item.flag)
|
|
37672
37686
|
return;
|
|
37673
37687
|
if (propsRef.value.resizable) {
|
|
37674
37688
|
item.width = colWidth > countWidth ? colWidth : countWidth;
|
|
37675
|
-
item.minWidth =
|
|
37689
|
+
item.minWidth = minWidth;
|
|
37676
37690
|
item.resizable = item.resizable === void 0 ? true : item.resizable;
|
|
37677
37691
|
} else {
|
|
37678
37692
|
if (item.resizable) {
|
|
37679
37693
|
item.width = colWidth > countWidth ? colWidth : countWidth;
|
|
37680
|
-
item.minWidth =
|
|
37694
|
+
item.minWidth = minWidth;
|
|
37681
37695
|
}
|
|
37682
37696
|
}
|
|
37683
37697
|
});
|
|
@@ -38561,7 +38575,7 @@ function _isSlot$1(s) {
|
|
|
38561
38575
|
}
|
|
38562
38576
|
const ShyTable = /* @__PURE__ */ defineComponent({
|
|
38563
38577
|
name: "ShyTable",
|
|
38564
|
-
emits: ["fetch-success", "fetch-error", "selection-change", "register", "row-click", "row-dbClick", "row-contextmenu", "row-mouseenter", "row-mouseleave", "edit-end", "edit-cancel", "edit-row-end", "edit-change", "expanded-rows-change", "change", "columns-change"],
|
|
38578
|
+
emits: ["fetch-success", "fetch-error", "selection-change", "register", "row-click", "row-dbClick", "row-contextmenu", "row-mouseenter", "row-mouseleave", "edit-end", "edit-cancel", "edit-row-end", "edit-change", "expanded-rows-change", "change", "columns-change", "columns-reset"],
|
|
38565
38579
|
props: shyTableBasicProps,
|
|
38566
38580
|
setup(props2, {
|
|
38567
38581
|
attrs,
|
|
@@ -38791,6 +38805,12 @@ const ShyTable = /* @__PURE__ */ defineComponent({
|
|
|
38791
38805
|
var _a2, _b;
|
|
38792
38806
|
emit("columns-change", data);
|
|
38793
38807
|
(_b = (_a2 = unref(getProps)).onColumnsChange) == null ? void 0 : _b.call(_a2, data);
|
|
38808
|
+
},
|
|
38809
|
+
onColumnsReset: () => {
|
|
38810
|
+
var _a2, _b;
|
|
38811
|
+
setColumns(getCacheColumns());
|
|
38812
|
+
emit("columns-reset");
|
|
38813
|
+
(_b = (_a2 = unref(getProps)).onColumnsReset) == null ? void 0 : _b.call(_a2);
|
|
38794
38814
|
}
|
|
38795
38815
|
};
|
|
38796
38816
|
const {
|
package/lib/index.js
CHANGED
|
@@ -37089,7 +37089,7 @@ function _isSlot$2(s) {
|
|
|
37089
37089
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
37090
37090
|
}
|
|
37091
37091
|
const ShyTableColumn = /* @__PURE__ */ vue.defineComponent({
|
|
37092
|
-
emits: ["columns-change"],
|
|
37092
|
+
emits: ["columns-change", "columns-reset"],
|
|
37093
37093
|
setup(props2, {
|
|
37094
37094
|
emit
|
|
37095
37095
|
}) {
|
|
@@ -37216,8 +37216,12 @@ const ShyTableColumn = /* @__PURE__ */ vue.defineComponent({
|
|
|
37216
37216
|
state.checkedList = [...state.defaultCheckList];
|
|
37217
37217
|
state.checkAll = true;
|
|
37218
37218
|
plainOptions.value = vue.unref(cachePlainOptions);
|
|
37219
|
-
handleEmit(table2.getCacheColumns());
|
|
37220
37219
|
sortable.sort(sortableOrder);
|
|
37220
|
+
inset = true;
|
|
37221
|
+
emit("columns-reset");
|
|
37222
|
+
setTimeout(() => {
|
|
37223
|
+
inset = false;
|
|
37224
|
+
});
|
|
37221
37225
|
}
|
|
37222
37226
|
function handleVisibleChange() {
|
|
37223
37227
|
if (inited)
|
|
@@ -37461,7 +37465,7 @@ const ShyTableSetting = /* @__PURE__ */ vue.defineComponent({
|
|
|
37461
37465
|
default: () => ({})
|
|
37462
37466
|
}
|
|
37463
37467
|
},
|
|
37464
|
-
emits: ["columns-change"],
|
|
37468
|
+
emits: ["columns-change", "columns-reset"],
|
|
37465
37469
|
setup(props2, {
|
|
37466
37470
|
emit
|
|
37467
37471
|
}) {
|
|
@@ -37484,6 +37488,9 @@ const ShyTableSetting = /* @__PURE__ */ vue.defineComponent({
|
|
|
37484
37488
|
const handleColumnChange = (data) => {
|
|
37485
37489
|
emit("columns-change", data);
|
|
37486
37490
|
};
|
|
37491
|
+
const handleColumnsReset = () => {
|
|
37492
|
+
emit("columns-reset");
|
|
37493
|
+
};
|
|
37487
37494
|
const getTableContainer = () => {
|
|
37488
37495
|
return table2 ? vue.unref(table2.wrapRef) : document.body;
|
|
37489
37496
|
};
|
|
@@ -37511,6 +37518,7 @@ const ShyTableSetting = /* @__PURE__ */ vue.defineComponent({
|
|
|
37511
37518
|
const renderTableColumn = vue.computed(() => {
|
|
37512
37519
|
return getSetting.value.setting ? vue.createVNode(ShyTableColumn, {
|
|
37513
37520
|
"onColumnsChange": handleColumnChange,
|
|
37521
|
+
"onColumnsReset": handleColumnsReset,
|
|
37514
37522
|
"getPopupContainer": getTableContainer
|
|
37515
37523
|
}, null) : null;
|
|
37516
37524
|
});
|
|
@@ -37576,7 +37584,7 @@ const ShyTableHeader = /* @__PURE__ */ vue.defineComponent({
|
|
|
37576
37584
|
type: Boolean
|
|
37577
37585
|
}
|
|
37578
37586
|
},
|
|
37579
|
-
emits: ["columns-change"],
|
|
37587
|
+
emits: ["columns-change", "columns-reset"],
|
|
37580
37588
|
setup(props2, {
|
|
37581
37589
|
emit,
|
|
37582
37590
|
slots
|
|
@@ -37584,10 +37592,17 @@ const ShyTableHeader = /* @__PURE__ */ vue.defineComponent({
|
|
|
37584
37592
|
const {
|
|
37585
37593
|
prefixCls: prefixCls2
|
|
37586
37594
|
} = use.useDesign("table-header");
|
|
37595
|
+
const handleColumnChange = (data) => {
|
|
37596
|
+
emit("columns-change", data);
|
|
37597
|
+
};
|
|
37598
|
+
const handleColumnsReset = () => {
|
|
37599
|
+
emit("columns-reset");
|
|
37600
|
+
};
|
|
37587
37601
|
const isShowSetting = () => {
|
|
37588
37602
|
return props2.showTableSetting ? vue.createVNode(ShyTableSetting, {
|
|
37589
37603
|
"setting": props2.tableSetting,
|
|
37590
|
-
"onColumnsChange": handleColumnChange
|
|
37604
|
+
"onColumnsChange": handleColumnChange,
|
|
37605
|
+
"onColumnsReset": handleColumnsReset
|
|
37591
37606
|
}, null) : null;
|
|
37592
37607
|
};
|
|
37593
37608
|
const isShowTitle = () => {
|
|
@@ -37600,9 +37615,6 @@ const ShyTableHeader = /* @__PURE__ */ vue.defineComponent({
|
|
|
37600
37615
|
"class": `${prefixCls2}-placeholder`
|
|
37601
37616
|
}, null);
|
|
37602
37617
|
};
|
|
37603
|
-
const handleColumnChange = (data) => {
|
|
37604
|
-
emit("columns-change", data);
|
|
37605
|
-
};
|
|
37606
37618
|
const getAlignClass = vue.computed(() => [`${prefixCls2}-align`, `${prefixCls2}-align-${props2.headerAlign}`]);
|
|
37607
37619
|
return () => {
|
|
37608
37620
|
var _a2;
|
|
@@ -37642,7 +37654,8 @@ const useTableHeader = (propsRef, slots, handlers2) => {
|
|
|
37642
37654
|
titleHelpMessage,
|
|
37643
37655
|
showTableSetting,
|
|
37644
37656
|
tableSetting,
|
|
37645
|
-
onColumnsChange: handlers2.onColumnsChange
|
|
37657
|
+
onColumnsChange: handlers2.onColumnsChange,
|
|
37658
|
+
onColumnsReset: handlers2.onColumnsReset
|
|
37646
37659
|
};
|
|
37647
37660
|
return {
|
|
37648
37661
|
title: hideTitle ? null : () => vue.createVNode(ShyTableHeader, headerProps, {
|
|
@@ -37690,18 +37703,19 @@ function handleColumnResize(propsRef, columns, wrapRef) {
|
|
|
37690
37703
|
);
|
|
37691
37704
|
const length2 = columns.length;
|
|
37692
37705
|
columns.forEach((item) => {
|
|
37693
|
-
const
|
|
37694
|
-
const
|
|
37706
|
+
const minWidth = ((item == null ? void 0 : item.title) + "").length * 14 + 16;
|
|
37707
|
+
const colWidth = item.width || minWidth;
|
|
37708
|
+
const countWidth = tableWidth && length2 - sumLength ? (tableWidth - sumWidth - selectWidth) / (length2 - sumLength) : colWidth;
|
|
37695
37709
|
if (item.flag)
|
|
37696
37710
|
return;
|
|
37697
37711
|
if (propsRef.value.resizable) {
|
|
37698
37712
|
item.width = colWidth > countWidth ? colWidth : countWidth;
|
|
37699
|
-
item.minWidth =
|
|
37713
|
+
item.minWidth = minWidth;
|
|
37700
37714
|
item.resizable = item.resizable === void 0 ? true : item.resizable;
|
|
37701
37715
|
} else {
|
|
37702
37716
|
if (item.resizable) {
|
|
37703
37717
|
item.width = colWidth > countWidth ? colWidth : countWidth;
|
|
37704
|
-
item.minWidth =
|
|
37718
|
+
item.minWidth = minWidth;
|
|
37705
37719
|
}
|
|
37706
37720
|
}
|
|
37707
37721
|
});
|
|
@@ -38585,7 +38599,7 @@ function _isSlot$1(s) {
|
|
|
38585
38599
|
}
|
|
38586
38600
|
const ShyTable = /* @__PURE__ */ vue.defineComponent({
|
|
38587
38601
|
name: "ShyTable",
|
|
38588
|
-
emits: ["fetch-success", "fetch-error", "selection-change", "register", "row-click", "row-dbClick", "row-contextmenu", "row-mouseenter", "row-mouseleave", "edit-end", "edit-cancel", "edit-row-end", "edit-change", "expanded-rows-change", "change", "columns-change"],
|
|
38602
|
+
emits: ["fetch-success", "fetch-error", "selection-change", "register", "row-click", "row-dbClick", "row-contextmenu", "row-mouseenter", "row-mouseleave", "edit-end", "edit-cancel", "edit-row-end", "edit-change", "expanded-rows-change", "change", "columns-change", "columns-reset"],
|
|
38589
38603
|
props: shyTableBasicProps,
|
|
38590
38604
|
setup(props2, {
|
|
38591
38605
|
attrs,
|
|
@@ -38815,6 +38829,12 @@ const ShyTable = /* @__PURE__ */ vue.defineComponent({
|
|
|
38815
38829
|
var _a2, _b;
|
|
38816
38830
|
emit("columns-change", data);
|
|
38817
38831
|
(_b = (_a2 = vue.unref(getProps)).onColumnsChange) == null ? void 0 : _b.call(_a2, data);
|
|
38832
|
+
},
|
|
38833
|
+
onColumnsReset: () => {
|
|
38834
|
+
var _a2, _b;
|
|
38835
|
+
setColumns(getCacheColumns());
|
|
38836
|
+
emit("columns-reset");
|
|
38837
|
+
(_b = (_a2 = vue.unref(getProps)).onColumnsReset) == null ? void 0 : _b.call(_a2);
|
|
38818
38838
|
}
|
|
38819
38839
|
};
|
|
38820
38840
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "3h1-ui",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"vue-json-pretty": "^2.2.3",
|
|
30
30
|
"vxe-table": "^4.3.6",
|
|
31
31
|
"xe-utils": "^3.5.7",
|
|
32
|
-
"@shy-plugins/utils": "1.0.0-next.1",
|
|
33
32
|
"@shy-plugins/tinymce": "^1.0.6",
|
|
34
|
-
"@shy-plugins/use": "1.0.0-next.1"
|
|
33
|
+
"@shy-plugins/use": "1.0.0-next.1",
|
|
34
|
+
"@shy-plugins/utils": "1.0.0-next.1"
|
|
35
35
|
},
|
|
36
36
|
"types": "es/ui/index.d.ts",
|
|
37
37
|
"devDependencies": {
|