@tmagic/form 1.1.5 → 1.1.6
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/style.css +4 -0
- package/dist/tmagic-form.mjs +29 -22
- package/dist/tmagic-form.mjs.map +1 -1
- package/dist/tmagic-form.umd.js +28 -21
- package/dist/tmagic-form.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/containers/GroupList.vue +3 -3
- package/src/containers/Table.vue +18 -22
- package/src/index.ts +1 -1
- package/src/schema.ts +11 -0
- package/src/theme/table.scss +5 -0
- package/types/containers/GroupList.vue.d.ts +1 -0
- package/types/containers/Table.vue.d.ts +9 -0
- package/types/schema.d.ts +11 -0
package/dist/tmagic-form.umd.js
CHANGED
|
@@ -851,6 +851,7 @@
|
|
|
851
851
|
}));
|
|
852
852
|
};
|
|
853
853
|
return {
|
|
854
|
+
Grid: iconsVue.Grid,
|
|
854
855
|
addable,
|
|
855
856
|
toggleMode,
|
|
856
857
|
removeHandler,
|
|
@@ -909,7 +910,7 @@
|
|
|
909
910
|
}, 8, ["onClick"])) : vue.createCommentVNode("", true),
|
|
910
911
|
_ctx.config.enableToggleMode ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
911
912
|
key: 4,
|
|
912
|
-
icon:
|
|
913
|
+
icon: _ctx.Grid,
|
|
913
914
|
size: "small",
|
|
914
915
|
onClick: _ctx.toggleMode
|
|
915
916
|
}, {
|
|
@@ -917,7 +918,7 @@
|
|
|
917
918
|
_hoisted_7$1
|
|
918
919
|
]),
|
|
919
920
|
_: 1
|
|
920
|
-
}, 8, ["onClick"])) : vue.createCommentVNode("", true)
|
|
921
|
+
}, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true)
|
|
921
922
|
]);
|
|
922
923
|
}
|
|
923
924
|
const GroupList = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$m]]);
|
|
@@ -1220,10 +1221,7 @@
|
|
|
1220
1221
|
}
|
|
1221
1222
|
const MStep = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$i]]);
|
|
1222
1223
|
|
|
1223
|
-
let loadedAMapJS = false;
|
|
1224
|
-
let firstLoadingAMapJS = true;
|
|
1225
1224
|
const _sfc_main$m = vue.defineComponent({
|
|
1226
|
-
name: "m-form-table",
|
|
1227
1225
|
props: {
|
|
1228
1226
|
name: {
|
|
1229
1227
|
type: String,
|
|
@@ -1260,9 +1258,14 @@
|
|
|
1260
1258
|
enableToggleMode: {
|
|
1261
1259
|
type: Boolean,
|
|
1262
1260
|
default: true
|
|
1261
|
+
},
|
|
1262
|
+
showIndex: {
|
|
1263
|
+
type: Boolean,
|
|
1264
|
+
default: true
|
|
1263
1265
|
}
|
|
1264
1266
|
},
|
|
1265
1267
|
emits: ["change", "select"],
|
|
1268
|
+
components: { Delete: iconsVue.Delete },
|
|
1266
1269
|
setup(props, { emit }) {
|
|
1267
1270
|
let timer = null;
|
|
1268
1271
|
const mForm = vue.inject("mForm");
|
|
@@ -1377,17 +1380,14 @@
|
|
|
1377
1380
|
props.model[modelName.value].push(inputs);
|
|
1378
1381
|
emit("change", props.model[modelName.value]);
|
|
1379
1382
|
};
|
|
1380
|
-
if (!
|
|
1381
|
-
|
|
1382
|
-
utils.asyncLoadJs("https://cdn.bootcdn.net/ajax/libs/xlsx/0.17.0/xlsx.full.min.js").then(() => {
|
|
1383
|
-
loadedAMapJS = true;
|
|
1384
|
-
}).catch(() => {
|
|
1385
|
-
firstLoadingAMapJS = true;
|
|
1386
|
-
});
|
|
1383
|
+
if (!globalThis.XLSX) {
|
|
1384
|
+
utils.asyncLoadJs("https://cdn.bootcdn.net/ajax/libs/xlsx/0.17.0/xlsx.full.min.js");
|
|
1387
1385
|
}
|
|
1388
1386
|
vue.onMounted(() => {
|
|
1389
1387
|
if (props.config.defautSort) {
|
|
1390
1388
|
sortChange(props.config.defautSort);
|
|
1389
|
+
} else if (props.config.defaultSort) {
|
|
1390
|
+
sortChange(props.config.defaultSort);
|
|
1391
1391
|
}
|
|
1392
1392
|
if (props.sort && props.sortKey) {
|
|
1393
1393
|
props.model[modelName.value].sort((a, b) => b[props.sortKey] - a[props.sortKey]);
|
|
@@ -1615,6 +1615,8 @@
|
|
|
1615
1615
|
};
|
|
1616
1616
|
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1617
1617
|
const _component_el_table_column = vue.resolveComponent("el-table-column");
|
|
1618
|
+
const _component_Delete = vue.resolveComponent("Delete");
|
|
1619
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
1618
1620
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
1619
1621
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
1620
1622
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
@@ -1665,16 +1667,20 @@
|
|
|
1665
1667
|
})) : vue.createCommentVNode("", true),
|
|
1666
1668
|
vue.createVNode(_component_el_table_column, {
|
|
1667
1669
|
label: "\u64CD\u4F5C",
|
|
1668
|
-
width: "
|
|
1670
|
+
width: "55",
|
|
1671
|
+
align: "center",
|
|
1669
1672
|
fixed: _ctx.config.fixed === false ? void 0 : "left"
|
|
1670
1673
|
}, {
|
|
1671
1674
|
default: vue.withCtx((scope) => [
|
|
1672
|
-
vue.withDirectives(vue.createVNode(
|
|
1673
|
-
|
|
1674
|
-
text: "",
|
|
1675
|
-
icon: _ctx.Delete,
|
|
1675
|
+
vue.withDirectives(vue.createVNode(_component_el_icon, {
|
|
1676
|
+
class: "m-table-delete-icon",
|
|
1676
1677
|
onClick: ($event) => _ctx.removeHandler(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)
|
|
1677
|
-
},
|
|
1678
|
+
}, {
|
|
1679
|
+
default: vue.withCtx(() => [
|
|
1680
|
+
vue.createVNode(_component_Delete)
|
|
1681
|
+
]),
|
|
1682
|
+
_: 2
|
|
1683
|
+
}, 1032, ["onClick"]), [
|
|
1678
1684
|
[vue.vShow, _ctx.showDelete(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize - 1)]
|
|
1679
1685
|
])
|
|
1680
1686
|
]),
|
|
@@ -1732,7 +1738,8 @@
|
|
|
1732
1738
|
type: "selection",
|
|
1733
1739
|
width: "45"
|
|
1734
1740
|
})) : vue.createCommentVNode("", true),
|
|
1735
|
-
vue.
|
|
1741
|
+
_ctx.showIndex && _ctx.config.showIndex ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
|
|
1742
|
+
key: 3,
|
|
1736
1743
|
width: "60",
|
|
1737
1744
|
label: "\u5E8F\u53F7"
|
|
1738
1745
|
}, {
|
|
@@ -1740,7 +1747,7 @@
|
|
|
1740
1747
|
vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + _ctx.pagecontext * _ctx.pagesize), 1)
|
|
1741
1748
|
]),
|
|
1742
1749
|
_: 1
|
|
1743
|
-
}),
|
|
1750
|
+
})) : vue.createCommentVNode("", true),
|
|
1744
1751
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.config.items, (column, index) => {
|
|
1745
1752
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1746
1753
|
column.type !== "hidden" && _ctx.display(column.display) ? (vue.openBlock(), vue.createBlock(_component_el_table_column, {
|
|
@@ -3907,7 +3914,7 @@
|
|
|
3907
3914
|
app.component(Panel.name, Panel);
|
|
3908
3915
|
app.component(Row.name, Row);
|
|
3909
3916
|
app.component(MStep.name, MStep);
|
|
3910
|
-
app.component(
|
|
3917
|
+
app.component("m-form-table", Table);
|
|
3911
3918
|
app.component(Tabs.name, Tabs);
|
|
3912
3919
|
app.component(Text.name, Text);
|
|
3913
3920
|
app.component(Number$1.name, Number$1);
|