tabula-vue 1.0.1 → 1.0.3
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/component.mjs +2 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +1 -0
- package/es/components/page/index.d.ts +8861 -5128
- package/es/components/page/src/index.vue.d.ts +1470 -268
- package/es/components/page/src/index.vue2.mjs +13 -3
- package/es/components/table-lite/index.d.ts +1783 -0
- package/es/components/table-lite/index.mjs +6 -0
- package/es/components/table-lite/src/display-value.d.ts +26 -0
- package/es/components/table-lite/src/display-value.mjs +82 -0
- package/es/components/table-lite/src/index.vue.d.ts +672 -0
- package/es/components/table-lite/src/index.vue.mjs +6 -0
- package/es/components/table-lite/src/index.vue2.mjs +690 -0
- package/es/components/table-lite/src/type.d.ts +91 -0
- package/es/components/table-lite/src/type.mjs +1 -0
- package/es/components/table-lite/style/css.d.ts +16 -0
- package/es/components/table-lite/style/css.mjs +16 -0
- package/es/components/table-lite/style/index.d.ts +16 -0
- package/es/components/table-lite/style/index.mjs +16 -0
- package/es/index.mjs +1 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +1 -1
- package/index.js +845 -84
- package/index.min.js +7 -3
- package/index.min.mjs +7 -3
- package/index.mjs +845 -85
- package/lib/component.js +42 -40
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +43 -41
- package/lib/components/page/index.d.ts +8861 -5128
- package/lib/components/page/src/index.vue.d.ts +1470 -268
- package/lib/components/page/src/index.vue2.js +15 -5
- package/lib/components/table-lite/index.d.ts +1783 -0
- package/lib/components/table-lite/index.js +8 -0
- package/lib/components/table-lite/src/display-value.d.ts +26 -0
- package/lib/components/table-lite/src/display-value.js +86 -0
- package/lib/components/table-lite/src/index.vue.d.ts +672 -0
- package/lib/components/table-lite/src/index.vue.js +10 -0
- package/lib/components/table-lite/src/index.vue2.js +694 -0
- package/lib/components/table-lite/src/type.d.ts +91 -0
- package/lib/components/table-lite/src/type.js +2 -0
- package/lib/components/table-lite/style/css.d.ts +16 -0
- package/lib/components/table-lite/style/css.js +19 -0
- package/lib/components/table-lite/style/index.d.ts +16 -0
- package/lib/components/table-lite/style/index.js +19 -0
- package/lib/index.js +43 -41
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-hk.js +1 -1
- package/locale/zh-hk.min.js +1 -1
- package/locale/zh-hk.min.mjs +1 -1
- package/locale/zh-hk.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/plus-table-lite.css +1 -0
- package/theme-chalk/src/index.scss +1 -0
- package/theme-chalk/src/table-lite.scss +53 -0
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tabula-vue v1.0.
|
|
1
|
+
/*! tabula-vue v1.0.3 */
|
|
2
2
|
import { unref, isRef, ref, isReactive, watch, computed, inject, shallowRef, defineComponent, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, useAttrs, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, toRaw, provide, getCurrentInstance, resolveComponent, onMounted, onBeforeUnmount, toRefs, nextTick, useSlots } from 'vue';
|
|
3
3
|
import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElTooltip, ElPopconfirm, ElLink, ElMessageBox, ElTableColumn, useFormDisabled, ElDatePicker, ClickOutside, ElTag, ElInput, ElAutocomplete, ElCascader, ElCheckboxGroup, ElCheckbox, ElColorPicker, ElInputNumber, ElRadioButton, ElRate, ElSelect, ElOption, ElSlider, ElSwitch, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElSelectV2, ElText, ElDivider, ElFormItem, ElOptionGroup, ElRow, ElCol, ElForm, ElCard, ElMessage, ElImage, ElProgress, ElAvatar, ElPopover, ElTable, vLoading, TableV2FixedDir, ElAutoResizer, ElTableV2, ElEmpty, ElDescriptions, ElDescriptionsItem, ElDrawer, ElSteps, ElStep, ElBreadcrumb, ElBreadcrumbItem, ElMenuItem, ElSubMenu, ElMenu, ElScrollbar, ElHeader, ElContainer, ElMain, ElBacktop } from 'element-plus';
|
|
4
4
|
|
|
@@ -2244,7 +2244,7 @@ var DataView = getNative(root$1, 'DataView');
|
|
|
2244
2244
|
var Promise$1 = getNative(root$1, 'Promise');
|
|
2245
2245
|
|
|
2246
2246
|
/* Built-in method references that are verified to be native. */
|
|
2247
|
-
var Set = getNative(root$1, 'Set');
|
|
2247
|
+
var Set$1 = getNative(root$1, 'Set');
|
|
2248
2248
|
|
|
2249
2249
|
/** `Object#toString` result references. */
|
|
2250
2250
|
var mapTag$4 = '[object Map]',
|
|
@@ -2259,7 +2259,7 @@ var dataViewTag$3 = '[object DataView]';
|
|
|
2259
2259
|
var dataViewCtorString = toSource(DataView),
|
|
2260
2260
|
mapCtorString = toSource(Map$1),
|
|
2261
2261
|
promiseCtorString = toSource(Promise$1),
|
|
2262
|
-
setCtorString = toSource(Set),
|
|
2262
|
+
setCtorString = toSource(Set$1),
|
|
2263
2263
|
weakMapCtorString = toSource(WeakMap);
|
|
2264
2264
|
|
|
2265
2265
|
/**
|
|
@@ -2275,7 +2275,7 @@ var getTag = baseGetTag;
|
|
|
2275
2275
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$3) ||
|
|
2276
2276
|
(Map$1 && getTag(new Map$1) != mapTag$4) ||
|
|
2277
2277
|
(Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
|
|
2278
|
-
(Set && getTag(new Set) != setTag$4) ||
|
|
2278
|
+
(Set$1 && getTag(new Set$1) != setTag$4) ||
|
|
2279
2279
|
(WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
|
|
2280
2280
|
getTag = function(value) {
|
|
2281
2281
|
var result = baseGetTag(value),
|
|
@@ -4478,8 +4478,8 @@ function useTable(_pageInfo) {
|
|
|
4478
4478
|
};
|
|
4479
4479
|
}
|
|
4480
4480
|
|
|
4481
|
-
const _hoisted_1$
|
|
4482
|
-
var _sfc_main$
|
|
4481
|
+
const _hoisted_1$l = { class: "plus-dialog-body" };
|
|
4482
|
+
var _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
4483
4483
|
...{
|
|
4484
4484
|
name: "PlusDialog",
|
|
4485
4485
|
inheritAttrs: false
|
|
@@ -4529,7 +4529,7 @@ var _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
4529
4529
|
class: "plus-dialog"
|
|
4530
4530
|
}, _ctx.$attrs), createSlots({
|
|
4531
4531
|
default: withCtx(() => [
|
|
4532
|
-
createElementVNode("div", _hoisted_1$
|
|
4532
|
+
createElementVNode("div", _hoisted_1$l, [
|
|
4533
4533
|
renderSlot(_ctx.$slots, "default")
|
|
4534
4534
|
])
|
|
4535
4535
|
]),
|
|
@@ -4601,25 +4601,25 @@ var _export_sfc = (sfc, props) => {
|
|
|
4601
4601
|
return target;
|
|
4602
4602
|
};
|
|
4603
4603
|
|
|
4604
|
-
var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4604
|
+
var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__file", "index.vue"]]);
|
|
4605
4605
|
|
|
4606
4606
|
const PlusDialog = Dialog;
|
|
4607
4607
|
|
|
4608
|
-
const _hoisted_1$
|
|
4608
|
+
const _hoisted_1$k = /* @__PURE__ */ createElementVNode(
|
|
4609
4609
|
"span",
|
|
4610
4610
|
null,
|
|
4611
4611
|
null,
|
|
4612
4612
|
-1
|
|
4613
4613
|
/* HOISTED */
|
|
4614
4614
|
);
|
|
4615
|
-
const _hoisted_2$
|
|
4615
|
+
const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
|
|
4616
4616
|
"span",
|
|
4617
4617
|
null,
|
|
4618
4618
|
null,
|
|
4619
4619
|
-1
|
|
4620
4620
|
/* HOISTED */
|
|
4621
4621
|
);
|
|
4622
|
-
var _sfc_main$
|
|
4622
|
+
var _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
4623
4623
|
...{
|
|
4624
4624
|
name: "PlusPagination"
|
|
4625
4625
|
},
|
|
@@ -4661,7 +4661,7 @@ var _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
4661
4661
|
},
|
|
4662
4662
|
[
|
|
4663
4663
|
_ctx.align === "right" || _ctx.align === "center" ? renderSlot(_ctx.$slots, "pagination-left", { key: 0 }, () => [
|
|
4664
|
-
_hoisted_1$
|
|
4664
|
+
_hoisted_1$k
|
|
4665
4665
|
]) : createCommentVNode("v-if", true),
|
|
4666
4666
|
createVNode(unref(ElPagination), mergeProps({
|
|
4667
4667
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
@@ -4675,7 +4675,7 @@ var _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
4675
4675
|
onCurrentChange: handleCurrentChange
|
|
4676
4676
|
}), null, 16, ["current-page", "page-size", "total", "page-sizes"]),
|
|
4677
4677
|
_ctx.align === "left" || _ctx.align === "center" ? renderSlot(_ctx.$slots, "pagination-right", { key: 1 }, () => [
|
|
4678
|
-
_hoisted_2$
|
|
4678
|
+
_hoisted_2$a
|
|
4679
4679
|
]) : createCommentVNode("v-if", true)
|
|
4680
4680
|
],
|
|
4681
4681
|
2
|
|
@@ -4685,11 +4685,11 @@ var _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
4685
4685
|
}
|
|
4686
4686
|
});
|
|
4687
4687
|
|
|
4688
|
-
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4688
|
+
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "index.vue"]]);
|
|
4689
4689
|
|
|
4690
4690
|
const PlusPagination = Pagination;
|
|
4691
4691
|
|
|
4692
|
-
var _sfc_main$
|
|
4692
|
+
var _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
4693
4693
|
...{
|
|
4694
4694
|
name: "PlusRadio"
|
|
4695
4695
|
},
|
|
@@ -4874,7 +4874,7 @@ var _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
4874
4874
|
}
|
|
4875
4875
|
});
|
|
4876
4876
|
|
|
4877
|
-
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4877
|
+
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "index.vue"]]);
|
|
4878
4878
|
|
|
4879
4879
|
const PlusRadio = Radio;
|
|
4880
4880
|
|
|
@@ -5115,13 +5115,13 @@ var user_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
5115
5115
|
// src/components/user.vue
|
|
5116
5116
|
var user_default = user_vue_vue_type_script_setup_true_lang_default;
|
|
5117
5117
|
|
|
5118
|
-
const _hoisted_1$
|
|
5118
|
+
const _hoisted_1$j = {
|
|
5119
5119
|
key: 0,
|
|
5120
5120
|
class: "plus-table-action-bar__dropdown__link"
|
|
5121
5121
|
};
|
|
5122
|
-
const _hoisted_2$
|
|
5122
|
+
const _hoisted_2$9 = { class: "plus-table-action-bar__dropdown__link" };
|
|
5123
5123
|
const _hoisted_3$4 = { class: "plus-table-action-bar__more-text" };
|
|
5124
|
-
var _sfc_main$
|
|
5124
|
+
var _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
5125
5125
|
...{
|
|
5126
5126
|
name: "PlusTableActionBarContent"
|
|
5127
5127
|
},
|
|
@@ -5442,7 +5442,7 @@ var _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
5442
5442
|
)
|
|
5443
5443
|
]),
|
|
5444
5444
|
default: withCtx(() => [
|
|
5445
|
-
_ctx.moreType === "icon" ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
5445
|
+
_ctx.moreType === "icon" ? (openBlock(), createElementBlock("span", _hoisted_1$j, [
|
|
5446
5446
|
renderSlot(_ctx.$slots, "action-bar-more-icon", {}, () => [
|
|
5447
5447
|
createVNode(unref(ElIcon), null, {
|
|
5448
5448
|
default: withCtx(() => [
|
|
@@ -5457,7 +5457,7 @@ var _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
5457
5457
|
{ key: 1 },
|
|
5458
5458
|
[
|
|
5459
5459
|
createCommentVNode(" \u9ED8\u8BA4 "),
|
|
5460
|
-
createElementVNode("span", _hoisted_2$
|
|
5460
|
+
createElementVNode("span", _hoisted_2$9, [
|
|
5461
5461
|
createElementVNode(
|
|
5462
5462
|
"span",
|
|
5463
5463
|
_hoisted_3$4,
|
|
@@ -5499,9 +5499,9 @@ var _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
5499
5499
|
}
|
|
5500
5500
|
});
|
|
5501
5501
|
|
|
5502
|
-
var PlusTableActionBarContent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5502
|
+
var PlusTableActionBarContent = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "table-action-bar-content.vue"]]);
|
|
5503
5503
|
|
|
5504
|
-
var _sfc_main$
|
|
5504
|
+
var _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
5505
5505
|
...{
|
|
5506
5506
|
name: "PlusTableActionBar"
|
|
5507
5507
|
},
|
|
@@ -5566,9 +5566,9 @@ var _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
5566
5566
|
}
|
|
5567
5567
|
});
|
|
5568
5568
|
|
|
5569
|
-
var PlusTableActionBar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5569
|
+
var PlusTableActionBar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "table-action-bar.vue"]]);
|
|
5570
5570
|
|
|
5571
|
-
var _sfc_main$
|
|
5571
|
+
var _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
5572
5572
|
...{
|
|
5573
5573
|
name: "PlusRender"
|
|
5574
5574
|
},
|
|
@@ -5638,12 +5638,12 @@ var _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
5638
5638
|
}
|
|
5639
5639
|
});
|
|
5640
5640
|
|
|
5641
|
-
var Render = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5641
|
+
var Render = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "index.vue"]]);
|
|
5642
5642
|
|
|
5643
5643
|
const PlusRender = Render;
|
|
5644
5644
|
|
|
5645
|
-
const _hoisted_1$
|
|
5646
|
-
var _sfc_main$
|
|
5645
|
+
const _hoisted_1$i = { class: "plus-date-picker__middle" };
|
|
5646
|
+
var _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
5647
5647
|
...{
|
|
5648
5648
|
name: "PlusDatePicker"
|
|
5649
5649
|
},
|
|
@@ -5748,7 +5748,7 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5748
5748
|
}), null, 16, ["modelValue", "type", "value-format", "placeholder", "disabled"]),
|
|
5749
5749
|
createElementVNode(
|
|
5750
5750
|
"span",
|
|
5751
|
-
_hoisted_1$
|
|
5751
|
+
_hoisted_1$i,
|
|
5752
5752
|
toDisplayString(_ctx.rangeSeparator),
|
|
5753
5753
|
1
|
|
5754
5754
|
/* TEXT */
|
|
@@ -5779,11 +5779,11 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5779
5779
|
}
|
|
5780
5780
|
});
|
|
5781
5781
|
|
|
5782
|
-
var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5782
|
+
var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "index.vue"]]);
|
|
5783
5783
|
|
|
5784
5784
|
const PlusDatePicker = DatePicker;
|
|
5785
5785
|
|
|
5786
|
-
var _sfc_main$
|
|
5786
|
+
var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
5787
5787
|
...{
|
|
5788
5788
|
name: "PlusInputTag"
|
|
5789
5789
|
},
|
|
@@ -5920,7 +5920,7 @@ var _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
5920
5920
|
}
|
|
5921
5921
|
});
|
|
5922
5922
|
|
|
5923
|
-
var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5923
|
+
var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "index.vue"]]);
|
|
5924
5924
|
|
|
5925
5925
|
const PlusInputTag = InputTag;
|
|
5926
5926
|
|
|
@@ -6017,9 +6017,9 @@ const hasFieldComponent = (valueType) => Object.keys(FieldComponentMap).includes
|
|
|
6017
6017
|
);
|
|
6018
6018
|
const getFieldComponent = (valueType) => Reflect.get(FieldComponentMap, valueType) || {};
|
|
6019
6019
|
|
|
6020
|
-
const _hoisted_1$
|
|
6021
|
-
const _hoisted_2$
|
|
6022
|
-
var _sfc_main$
|
|
6020
|
+
const _hoisted_1$h = { class: "el-form-item__error" };
|
|
6021
|
+
const _hoisted_2$8 = { class: "plus-form-item__label" };
|
|
6022
|
+
var _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
6023
6023
|
...{
|
|
6024
6024
|
name: "PlusFormItem"
|
|
6025
6025
|
},
|
|
@@ -6574,7 +6574,7 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
6574
6574
|
unref(isFunction)(_ctx.renderErrorMessage) ? {
|
|
6575
6575
|
name: "error",
|
|
6576
6576
|
fn: withCtx(({ error }) => [
|
|
6577
|
-
createElementVNode("div", _hoisted_1$
|
|
6577
|
+
createElementVNode("div", _hoisted_1$h, [
|
|
6578
6578
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.renderErrorMessage), mergeProps(props, {
|
|
6579
6579
|
value: state.value,
|
|
6580
6580
|
error,
|
|
@@ -6587,7 +6587,7 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
6587
6587
|
_ctx.hasLabel ? {
|
|
6588
6588
|
name: "label",
|
|
6589
6589
|
fn: withCtx(({ label: currentLabel }) => [
|
|
6590
|
-
createElementVNode("span", _hoisted_2$
|
|
6590
|
+
createElementVNode("span", _hoisted_2$8, [
|
|
6591
6591
|
_ctx.renderLabel && unref(isFunction)(_ctx.renderLabel) ? (openBlock(), createElementBlock(
|
|
6592
6592
|
Fragment,
|
|
6593
6593
|
{ key: 0 },
|
|
@@ -6645,11 +6645,11 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
6645
6645
|
}
|
|
6646
6646
|
});
|
|
6647
6647
|
|
|
6648
|
-
var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6648
|
+
var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "index.vue"]]);
|
|
6649
6649
|
|
|
6650
6650
|
const PlusFormItem = FormItem;
|
|
6651
6651
|
|
|
6652
|
-
var _sfc_main$
|
|
6652
|
+
var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
6653
6653
|
...{
|
|
6654
6654
|
name: "PlusCollapseTransition"
|
|
6655
6655
|
},
|
|
@@ -6700,17 +6700,17 @@ var _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
6700
6700
|
}
|
|
6701
6701
|
});
|
|
6702
6702
|
|
|
6703
|
-
var PlusCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6703
|
+
var PlusCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "collapse-transition.vue"]]);
|
|
6704
6704
|
|
|
6705
|
-
const _hoisted_1$
|
|
6705
|
+
const _hoisted_1$g = {
|
|
6706
6706
|
key: 0,
|
|
6707
6707
|
class: "plus-form-item-previous"
|
|
6708
6708
|
};
|
|
6709
|
-
const _hoisted_2$
|
|
6709
|
+
const _hoisted_2$7 = {
|
|
6710
6710
|
key: 1,
|
|
6711
6711
|
class: "plus-form-item-extra"
|
|
6712
6712
|
};
|
|
6713
|
-
var _sfc_main$
|
|
6713
|
+
var _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
6714
6714
|
...{
|
|
6715
6715
|
name: "PlusFormContent"
|
|
6716
6716
|
},
|
|
@@ -6775,7 +6775,7 @@ var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6775
6775
|
{
|
|
6776
6776
|
default: withCtx(() => [
|
|
6777
6777
|
createCommentVNode(" el-form-item\u4E0A\u4E00\u884C\u7684\u5185\u5BB9 "),
|
|
6778
|
-
item.renderPrevious || _ctx.$slots[unref(getPreviousSlotName)(item.prop)] ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6778
|
+
item.renderPrevious || _ctx.$slots[unref(getPreviousSlotName)(item.prop)] ? (openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
6779
6779
|
unref(isFunction)(item.renderPrevious) ? (openBlock(), createBlock(
|
|
6780
6780
|
resolveDynamicComponent(item.renderPrevious),
|
|
6781
6781
|
normalizeProps(mergeProps({ key: 0 }, item)),
|
|
@@ -6817,7 +6817,7 @@ var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6817
6817
|
} : void 0
|
|
6818
6818
|
]), 1040, ["model-value", "clearable", "has-label", "onChange"]),
|
|
6819
6819
|
createCommentVNode(" el-form-item \u4E0B\u4E00\u884C\u989D\u5916\u7684\u5185\u5BB9 "),
|
|
6820
|
-
item.renderExtra || _ctx.$slots[unref(getExtraSlotName)(item.prop)] ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
6820
|
+
item.renderExtra || _ctx.$slots[unref(getExtraSlotName)(item.prop)] ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
|
|
6821
6821
|
item.renderExtra && unref(isFunction)(item.renderExtra) ? (openBlock(), createBlock(
|
|
6822
6822
|
resolveDynamicComponent(item.renderExtra),
|
|
6823
6823
|
normalizeProps(mergeProps({ key: 0 }, item)),
|
|
@@ -6854,10 +6854,10 @@ var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6854
6854
|
}
|
|
6855
6855
|
});
|
|
6856
6856
|
|
|
6857
|
-
var PlusFormContent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6857
|
+
var PlusFormContent = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "form-content.vue"]]);
|
|
6858
6858
|
|
|
6859
|
-
const _hoisted_1$
|
|
6860
|
-
var _sfc_main$
|
|
6859
|
+
const _hoisted_1$f = { class: "plus-form__group__item__icon" };
|
|
6860
|
+
var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
6861
6861
|
...{
|
|
6862
6862
|
name: "PlusForm",
|
|
6863
6863
|
inheritAttrs: false
|
|
@@ -7007,7 +7007,7 @@ var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
7007
7007
|
icon: groupItem.icon,
|
|
7008
7008
|
index
|
|
7009
7009
|
}, () => [
|
|
7010
|
-
createElementVNode("div", _hoisted_1$
|
|
7010
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
7011
7011
|
groupItem.icon ? (openBlock(), createBlock(
|
|
7012
7012
|
unref(ElIcon),
|
|
7013
7013
|
{ key: 0 },
|
|
@@ -7152,7 +7152,7 @@ var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
7152
7152
|
}
|
|
7153
7153
|
});
|
|
7154
7154
|
|
|
7155
|
-
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
7155
|
+
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "index.vue"]]);
|
|
7156
7156
|
|
|
7157
7157
|
const PlusForm = Form;
|
|
7158
7158
|
|
|
@@ -7195,8 +7195,8 @@ const DisplayComponentMap = {
|
|
|
7195
7195
|
const hasDisplayComponent = (valueType) => Object.keys(DisplayComponentMap).includes(valueType);
|
|
7196
7196
|
const getDisplayComponent = (valueType) => Reflect.get(DisplayComponentMap, valueType) || {};
|
|
7197
7197
|
|
|
7198
|
-
const _hoisted_1$
|
|
7199
|
-
const _hoisted_2$
|
|
7198
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
7199
|
+
const _hoisted_2$6 = { class: "plus-display-item" };
|
|
7200
7200
|
const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
|
|
7201
7201
|
"svg",
|
|
7202
7202
|
{
|
|
@@ -7216,7 +7216,7 @@ const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
|
|
|
7216
7216
|
-1
|
|
7217
7217
|
/* HOISTED */
|
|
7218
7218
|
);
|
|
7219
|
-
var _sfc_main$
|
|
7219
|
+
var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
7220
7220
|
...{
|
|
7221
7221
|
name: "PlusDisplayItem"
|
|
7222
7222
|
},
|
|
@@ -7587,7 +7587,7 @@ var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
7587
7587
|
createElementVNode("span", {
|
|
7588
7588
|
class: "plus-display-item",
|
|
7589
7589
|
innerHTML: _ctx.column.renderHTML(displayValue.value, renderParams.value)
|
|
7590
|
-
}, null, 8, _hoisted_1$
|
|
7590
|
+
}, null, 8, _hoisted_1$e)
|
|
7591
7591
|
],
|
|
7592
7592
|
2112
|
|
7593
7593
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -7716,7 +7716,7 @@ var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
7716
7716
|
{ key: 5 },
|
|
7717
7717
|
[
|
|
7718
7718
|
createCommentVNode(" \u590D\u5236 "),
|
|
7719
|
-
createElementVNode("span", _hoisted_2$
|
|
7719
|
+
createElementVNode("span", _hoisted_2$6, [
|
|
7720
7720
|
createTextVNode(
|
|
7721
7721
|
toDisplayString(formatterValue.value) + " ",
|
|
7722
7722
|
1
|
|
@@ -7854,12 +7854,12 @@ var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
7854
7854
|
}
|
|
7855
7855
|
});
|
|
7856
7856
|
|
|
7857
|
-
var DisplayItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
7857
|
+
var DisplayItem = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "index.vue"]]);
|
|
7858
7858
|
|
|
7859
7859
|
const PlusDisplayItem = DisplayItem;
|
|
7860
7860
|
|
|
7861
|
-
const _hoisted_1$
|
|
7862
|
-
var _sfc_main$
|
|
7861
|
+
const _hoisted_1$d = { class: "plus-table-column__header" };
|
|
7862
|
+
var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
7863
7863
|
...{
|
|
7864
7864
|
name: "PlusTableColumn"
|
|
7865
7865
|
},
|
|
@@ -7957,7 +7957,7 @@ var _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
7957
7957
|
"min-width": item.minWidth
|
|
7958
7958
|
}), {
|
|
7959
7959
|
header: withCtx((scoped) => [
|
|
7960
|
-
createElementVNode("span", _hoisted_1$
|
|
7960
|
+
createElementVNode("span", _hoisted_1$d, [
|
|
7961
7961
|
item.renderHeader && unref(isFunction)(item.renderHeader) ? (openBlock(), createBlock(unref(PlusRender), {
|
|
7962
7962
|
key: 0,
|
|
7963
7963
|
render: item.renderHeader,
|
|
@@ -8088,9 +8088,9 @@ var _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
8088
8088
|
}
|
|
8089
8089
|
});
|
|
8090
8090
|
|
|
8091
|
-
var PlusTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8091
|
+
var PlusTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "table-column.vue"]]);
|
|
8092
8092
|
|
|
8093
|
-
var _sfc_main$
|
|
8093
|
+
var _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
8094
8094
|
...{
|
|
8095
8095
|
name: "PlusTableTableColumnIndex"
|
|
8096
8096
|
},
|
|
@@ -8164,7 +8164,7 @@ var _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
8164
8164
|
}
|
|
8165
8165
|
});
|
|
8166
8166
|
|
|
8167
|
-
var PlusTableTableColumnIndex = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8167
|
+
var PlusTableTableColumnIndex = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "table-column-index.vue"]]);
|
|
8168
8168
|
|
|
8169
8169
|
/**!
|
|
8170
8170
|
* Sortable 1.15.0
|
|
@@ -11186,8 +11186,8 @@ _extends(Remove, {
|
|
|
11186
11186
|
Sortable.mount(new AutoScrollPlugin());
|
|
11187
11187
|
Sortable.mount(Remove, Revert);
|
|
11188
11188
|
|
|
11189
|
-
const _hoisted_1$
|
|
11190
|
-
var _sfc_main$
|
|
11189
|
+
const _hoisted_1$c = { class: "plus-table-column-drag-icon" };
|
|
11190
|
+
var _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
11191
11191
|
...{
|
|
11192
11192
|
name: "PlusTableColumnDragSort"
|
|
11193
11193
|
},
|
|
@@ -11238,7 +11238,7 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
11238
11238
|
"class-name": "plus-table-column-drag-sort"
|
|
11239
11239
|
}, _ctx.dragSortableTableColumnProps), {
|
|
11240
11240
|
default: withCtx(() => [
|
|
11241
|
-
createElementVNode("span", _hoisted_1$
|
|
11241
|
+
createElementVNode("span", _hoisted_1$c, [
|
|
11242
11242
|
renderSlot(_ctx.$slots, "drag-sort-icon", {}, () => [
|
|
11243
11243
|
createTextVNode("\u2637")
|
|
11244
11244
|
])
|
|
@@ -11251,13 +11251,13 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
11251
11251
|
}
|
|
11252
11252
|
});
|
|
11253
11253
|
|
|
11254
|
-
var PlusTableColumnDragSort = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11254
|
+
var PlusTableColumnDragSort = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "table-column-drag-sort.vue"]]);
|
|
11255
11255
|
|
|
11256
|
-
const _hoisted_1$
|
|
11256
|
+
const _hoisted_1$b = {
|
|
11257
11257
|
key: 0,
|
|
11258
11258
|
style: { "padding-top": "12px" }
|
|
11259
11259
|
};
|
|
11260
|
-
var _sfc_main$
|
|
11260
|
+
var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
11261
11261
|
...{
|
|
11262
11262
|
name: "PlusPopover"
|
|
11263
11263
|
},
|
|
@@ -11303,7 +11303,7 @@ var _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11303
11303
|
]),
|
|
11304
11304
|
default: withCtx(() => [
|
|
11305
11305
|
renderSlot(_ctx.$slots, "default"),
|
|
11306
|
-
_ctx.hasShowBottomButton ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
11306
|
+
_ctx.hasShowBottomButton ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
11307
11307
|
createVNode(unref(ElButton), {
|
|
11308
11308
|
size: "small",
|
|
11309
11309
|
plain: "",
|
|
@@ -11344,12 +11344,12 @@ var _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11344
11344
|
}
|
|
11345
11345
|
});
|
|
11346
11346
|
|
|
11347
|
-
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11347
|
+
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "index.vue"]]);
|
|
11348
11348
|
|
|
11349
11349
|
const PlusPopover = Popover;
|
|
11350
11350
|
|
|
11351
|
-
const _hoisted_1$
|
|
11352
|
-
const _hoisted_2$
|
|
11351
|
+
const _hoisted_1$a = { class: "plus-table-title-bar" };
|
|
11352
|
+
const _hoisted_2$5 = { class: "plus-table-title-bar__title" };
|
|
11353
11353
|
const _hoisted_3$2 = { class: "plus-table-title-bar__toolbar" };
|
|
11354
11354
|
const _hoisted_4$2 = { class: "plus-table-title-bar__toolbar__density" };
|
|
11355
11355
|
const _hoisted_5$2 = /* @__PURE__ */ createElementVNode(
|
|
@@ -11374,7 +11374,7 @@ const _hoisted_7$1 = {
|
|
|
11374
11374
|
};
|
|
11375
11375
|
const _hoisted_8$1 = { key: 1 };
|
|
11376
11376
|
const _hoisted_9$1 = { key: 1 };
|
|
11377
|
-
var _sfc_main$
|
|
11377
|
+
var _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
11378
11378
|
...{
|
|
11379
11379
|
name: "PlusTableToolbar"
|
|
11380
11380
|
},
|
|
@@ -11525,8 +11525,8 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11525
11525
|
});
|
|
11526
11526
|
return (_ctx, _cache) => {
|
|
11527
11527
|
var _a, _b, _c;
|
|
11528
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
11529
|
-
createElementVNode("div", _hoisted_2$
|
|
11528
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
11529
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
11530
11530
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
11531
11531
|
createTextVNode(
|
|
11532
11532
|
toDisplayString(titleBarConfig.value.title),
|
|
@@ -11827,7 +11827,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11827
11827
|
}
|
|
11828
11828
|
});
|
|
11829
11829
|
|
|
11830
|
-
var PlusTableTitleBar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11830
|
+
var PlusTableTitleBar = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "table-title-bar.vue"]]);
|
|
11831
11831
|
|
|
11832
11832
|
const useTableColumns = ({ columns, skipEqual = true }) => {
|
|
11833
11833
|
const filterColumns = shallowRef([]);
|
|
@@ -11865,8 +11865,8 @@ const useTableColumns = ({ columns, skipEqual = true }) => {
|
|
|
11865
11865
|
};
|
|
11866
11866
|
};
|
|
11867
11867
|
|
|
11868
|
-
const _hoisted_1$
|
|
11869
|
-
var _sfc_main$
|
|
11868
|
+
const _hoisted_1$9 = { class: "plus-table-expand-col" };
|
|
11869
|
+
var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
11870
11870
|
...{
|
|
11871
11871
|
name: "PlusTable",
|
|
11872
11872
|
inheritAttrs: false
|
|
@@ -12227,7 +12227,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
12227
12227
|
}, _ctx.expandTableColumnProps),
|
|
12228
12228
|
{
|
|
12229
12229
|
default: withCtx((scoped) => [
|
|
12230
|
-
createElementVNode("div", _hoisted_1$
|
|
12230
|
+
createElementVNode("div", _hoisted_1$9, [
|
|
12231
12231
|
renderSlot(_ctx.$slots, "expand", mergeProps({
|
|
12232
12232
|
index: scoped.$index
|
|
12233
12233
|
}, scoped))
|
|
@@ -12338,10 +12338,760 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
12338
12338
|
}
|
|
12339
12339
|
});
|
|
12340
12340
|
|
|
12341
|
-
var _Table = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
12341
|
+
var _Table = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "index.vue"]]);
|
|
12342
12342
|
|
|
12343
12343
|
const PlusTable = _Table;
|
|
12344
12344
|
|
|
12345
|
+
const SELECT_TYPES = /* @__PURE__ */ new Set(["select", "radio", "checkbox"]);
|
|
12346
|
+
const DATE_TYPES = /* @__PURE__ */ new Set(["date-picker"]);
|
|
12347
|
+
const MONEY_TYPES = /* @__PURE__ */ new Set(["money"]);
|
|
12348
|
+
const MULTIPLE_SEPARATOR = "\u3001";
|
|
12349
|
+
const resolveOptions = (options) => {
|
|
12350
|
+
if (!options) return [];
|
|
12351
|
+
if (isRef(options)) {
|
|
12352
|
+
return Array.isArray(options.value) ? options.value : [];
|
|
12353
|
+
}
|
|
12354
|
+
if (Array.isArray(options)) return options;
|
|
12355
|
+
if (isFunction(options)) {
|
|
12356
|
+
const result = options();
|
|
12357
|
+
return Array.isArray(result) ? result : [];
|
|
12358
|
+
}
|
|
12359
|
+
return [];
|
|
12360
|
+
};
|
|
12361
|
+
const resolveFieldProps = (column) => {
|
|
12362
|
+
const fieldProps = column.fieldProps;
|
|
12363
|
+
if (!fieldProps) return {};
|
|
12364
|
+
if (isRef(fieldProps)) return fieldProps.value || {};
|
|
12365
|
+
if (typeof fieldProps === "object") return fieldProps;
|
|
12366
|
+
return {};
|
|
12367
|
+
};
|
|
12368
|
+
const isEmpty = (value) => value === null || value === void 0 || value === "";
|
|
12369
|
+
const createValueTypeText = (column) => {
|
|
12370
|
+
const valueType = column.valueType;
|
|
12371
|
+
if (valueType && SELECT_TYPES.has(valueType)) {
|
|
12372
|
+
const list = resolveOptions(column.options);
|
|
12373
|
+
if (!list.length) return void 0;
|
|
12374
|
+
const labelMap = /* @__PURE__ */ new Map();
|
|
12375
|
+
list.forEach((item) => {
|
|
12376
|
+
if (!isEmpty(item.value)) labelMap.set(String(item.value), item);
|
|
12377
|
+
});
|
|
12378
|
+
const fieldProps = resolveFieldProps(column);
|
|
12379
|
+
const multiple = valueType === "checkbox" || fieldProps.multiple === true;
|
|
12380
|
+
return (value) => {
|
|
12381
|
+
var _a;
|
|
12382
|
+
if (isEmpty(value)) return "";
|
|
12383
|
+
if (multiple && Array.isArray(value)) {
|
|
12384
|
+
return value.map((item) => {
|
|
12385
|
+
var _a2, _b;
|
|
12386
|
+
return (_b = (_a2 = labelMap.get(String(item))) == null ? void 0 : _a2.label) != null ? _b : String(item);
|
|
12387
|
+
}).join(MULTIPLE_SEPARATOR);
|
|
12388
|
+
}
|
|
12389
|
+
const label = (_a = labelMap.get(String(value))) == null ? void 0 : _a.label;
|
|
12390
|
+
return label === void 0 || label === null ? String(value) : String(label);
|
|
12391
|
+
};
|
|
12392
|
+
}
|
|
12393
|
+
if (valueType && DATE_TYPES.has(valueType)) {
|
|
12394
|
+
const fieldProps = resolveFieldProps(column);
|
|
12395
|
+
const format = fieldProps.format || "YYYY-MM-DD";
|
|
12396
|
+
return (value) => isEmpty(value) ? "" : formatDate(value, format);
|
|
12397
|
+
}
|
|
12398
|
+
if (valueType && MONEY_TYPES.has(valueType)) {
|
|
12399
|
+
const fieldProps = resolveFieldProps(column);
|
|
12400
|
+
const prefix = fieldProps.format || "\uFFE5";
|
|
12401
|
+
return (value) => {
|
|
12402
|
+
if (isEmpty(value)) return "";
|
|
12403
|
+
const num = Number(value);
|
|
12404
|
+
return Number.isNaN(num) ? String(value) : `${prefix}${num.toFixed(2)}`;
|
|
12405
|
+
};
|
|
12406
|
+
}
|
|
12407
|
+
return void 0;
|
|
12408
|
+
};
|
|
12409
|
+
const createValueTypeCellRender = (column) => {
|
|
12410
|
+
if (column.valueType !== "tag") return void 0;
|
|
12411
|
+
const fieldProps = resolveFieldProps(column);
|
|
12412
|
+
const text = createValueTypeText(column);
|
|
12413
|
+
return (value) => {
|
|
12414
|
+
if (isEmpty(value)) return h("span");
|
|
12415
|
+
const label = text ? text(value) : String(value);
|
|
12416
|
+
return h(ElTag, { type: fieldProps.type }, () => label);
|
|
12417
|
+
};
|
|
12418
|
+
};
|
|
12419
|
+
|
|
12420
|
+
const _hoisted_1$8 = { class: "plus-table-lite__header" };
|
|
12421
|
+
const _hoisted_2$4 = ["innerHTML"];
|
|
12422
|
+
var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
12423
|
+
...{
|
|
12424
|
+
name: "PlusTableLite",
|
|
12425
|
+
inheritAttrs: false
|
|
12426
|
+
},
|
|
12427
|
+
__name: "index",
|
|
12428
|
+
props: {
|
|
12429
|
+
tableData: { default: void 0 },
|
|
12430
|
+
data: { default: void 0 },
|
|
12431
|
+
columns: { default: () => [] },
|
|
12432
|
+
defaultSize: { default: "default" },
|
|
12433
|
+
pagination: { type: [Boolean, Object], default: false },
|
|
12434
|
+
actionBar: { type: [Boolean, Object], default: false },
|
|
12435
|
+
hasIndexColumn: { type: Boolean, default: false },
|
|
12436
|
+
titleBar: { type: [Boolean, Object], default: true },
|
|
12437
|
+
isSelection: { type: Boolean, default: false },
|
|
12438
|
+
specialColumnsOrder: { default: void 0 },
|
|
12439
|
+
loadingStatus: { type: Boolean, default: false },
|
|
12440
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
12441
|
+
defaultSelectedKeys: { default: () => [] },
|
|
12442
|
+
selectionTableColumnProps: { default: () => ({ width: 40 }) },
|
|
12443
|
+
indexTableColumnProps: { default: () => ({}) },
|
|
12444
|
+
indexContentStyle: { type: [Object, Function], default: () => ({}) },
|
|
12445
|
+
headerCellStyle: { default: () => ({
|
|
12446
|
+
"background-color": "var(--el-fill-color-light)"
|
|
12447
|
+
}) },
|
|
12448
|
+
emptyValue: { default: void 0 },
|
|
12449
|
+
size: {},
|
|
12450
|
+
width: {},
|
|
12451
|
+
height: {},
|
|
12452
|
+
maxHeight: {},
|
|
12453
|
+
fit: { type: Boolean },
|
|
12454
|
+
stripe: { type: Boolean },
|
|
12455
|
+
border: { type: Boolean, default: true },
|
|
12456
|
+
context: {},
|
|
12457
|
+
showHeader: { type: Boolean },
|
|
12458
|
+
showSummary: { type: Boolean },
|
|
12459
|
+
sumText: {},
|
|
12460
|
+
summaryMethod: {},
|
|
12461
|
+
rowClassName: {},
|
|
12462
|
+
rowStyle: {},
|
|
12463
|
+
cellClassName: {},
|
|
12464
|
+
cellStyle: {},
|
|
12465
|
+
headerRowClassName: {},
|
|
12466
|
+
headerRowStyle: {},
|
|
12467
|
+
headerCellClassName: {},
|
|
12468
|
+
highlightCurrentRow: { type: Boolean },
|
|
12469
|
+
currentRowKey: {},
|
|
12470
|
+
emptyText: {},
|
|
12471
|
+
expandRowKeys: {},
|
|
12472
|
+
defaultExpandAll: { type: Boolean },
|
|
12473
|
+
defaultSort: {},
|
|
12474
|
+
tooltipEffect: {},
|
|
12475
|
+
tooltipOptions: {},
|
|
12476
|
+
spanMethod: {},
|
|
12477
|
+
selectOnIndeterminate: { type: Boolean },
|
|
12478
|
+
indent: {},
|
|
12479
|
+
treeProps: {},
|
|
12480
|
+
lazy: { type: Boolean },
|
|
12481
|
+
load: {},
|
|
12482
|
+
className: {},
|
|
12483
|
+
style: {},
|
|
12484
|
+
tableLayout: {},
|
|
12485
|
+
scrollbarAlwaysOn: { type: Boolean },
|
|
12486
|
+
flexible: { type: Boolean },
|
|
12487
|
+
showOverflowTooltip: { type: [Boolean, Object] }
|
|
12488
|
+
},
|
|
12489
|
+
emits: ["selection-change", "paginationChange", "clickAction", "clickActionConfirmCancel", "refresh", "filterTableHeader"],
|
|
12490
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
12491
|
+
var _a, _b;
|
|
12492
|
+
const props = __props;
|
|
12493
|
+
const emit = __emit;
|
|
12494
|
+
const { t } = useLocale();
|
|
12495
|
+
const tableInstance = shallowRef(null);
|
|
12496
|
+
const wrapperInstance = ref(null);
|
|
12497
|
+
const paginationInstance = ref(null);
|
|
12498
|
+
const state = reactive({
|
|
12499
|
+
size: props.defaultSize,
|
|
12500
|
+
subPageInfo: {
|
|
12501
|
+
...((_a = props.pagination) == null ? void 0 : _a.modelValue) || DefaultPageInfo
|
|
12502
|
+
}
|
|
12503
|
+
});
|
|
12504
|
+
const __tableData = computed(() => {
|
|
12505
|
+
var _a2, _b2;
|
|
12506
|
+
return (_b2 = (_a2 = props.tableData) != null ? _a2 : props.data) != null ? _b2 : [];
|
|
12507
|
+
});
|
|
12508
|
+
const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
|
|
12509
|
+
columns: () => props.columns || []
|
|
12510
|
+
});
|
|
12511
|
+
const resolveEmptyText = (column) => {
|
|
12512
|
+
var _a2, _b2;
|
|
12513
|
+
return (_b2 = (_a2 = column.emptyValue) != null ? _a2 : props.emptyValue) != null ? _b2 : "";
|
|
12514
|
+
};
|
|
12515
|
+
const toVNode = (result) => {
|
|
12516
|
+
if (result === null || result === void 0 || result === "") return createTextVNode("");
|
|
12517
|
+
if (isString(result) || typeof result === "number") return createTextVNode(String(result));
|
|
12518
|
+
if (isVNode(result)) return result;
|
|
12519
|
+
return h(result);
|
|
12520
|
+
};
|
|
12521
|
+
const getByPath = (target, path) => {
|
|
12522
|
+
const keys = path.replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
|
|
12523
|
+
let current = target;
|
|
12524
|
+
for (const key of keys) {
|
|
12525
|
+
if (current === null || current === void 0) return void 0;
|
|
12526
|
+
current = current[key];
|
|
12527
|
+
}
|
|
12528
|
+
return current;
|
|
12529
|
+
};
|
|
12530
|
+
const preparedColumns = computed(
|
|
12531
|
+
() => subColumns.value.map((column) => {
|
|
12532
|
+
const prop = column.prop;
|
|
12533
|
+
const label = getLabel(column.label);
|
|
12534
|
+
const isSimpleProp = !prop.includes(".") && !prop.includes("[");
|
|
12535
|
+
const readValue = isSimpleProp ? (row) => row == null ? void 0 : row[prop] : (row) => getByPath(row, prop);
|
|
12536
|
+
const valueTypeText = createValueTypeText(column);
|
|
12537
|
+
const valueTypeCellRender = createValueTypeCellRender(column);
|
|
12538
|
+
const cellText = (row, index) => {
|
|
12539
|
+
const value = readValue(row);
|
|
12540
|
+
if (isFunction(column.formatter)) {
|
|
12541
|
+
const formatted = column.formatter(value, { row, column, index });
|
|
12542
|
+
return String(
|
|
12543
|
+
formatted === null || formatted === void 0 ? resolveEmptyText(column) : formatted
|
|
12544
|
+
);
|
|
12545
|
+
}
|
|
12546
|
+
if (valueTypeText) {
|
|
12547
|
+
const text = valueTypeText(value);
|
|
12548
|
+
if (text !== "") return text;
|
|
12549
|
+
}
|
|
12550
|
+
return value === null || value === void 0 || value === "" ? String(resolveEmptyText(column)) : String(value);
|
|
12551
|
+
};
|
|
12552
|
+
const prepared = {
|
|
12553
|
+
key: getTableKey(column, true),
|
|
12554
|
+
prop,
|
|
12555
|
+
column,
|
|
12556
|
+
tableColumnProps: column.tableColumnProps || {},
|
|
12557
|
+
label,
|
|
12558
|
+
width: column.width,
|
|
12559
|
+
minWidth: column.minWidth,
|
|
12560
|
+
headerSlotName: getTableHeaderSlotName(prop),
|
|
12561
|
+
cellSlotName: getTableCellSlotName(prop),
|
|
12562
|
+
tooltip: !!column.tooltip,
|
|
12563
|
+
tooltipProps: getTooltip(column.tooltip),
|
|
12564
|
+
readValue,
|
|
12565
|
+
cellText
|
|
12566
|
+
};
|
|
12567
|
+
if (isFunction(column.renderHeader)) {
|
|
12568
|
+
prepared.headerRender = () => {
|
|
12569
|
+
var _a2;
|
|
12570
|
+
return toVNode((_a2 = column.renderHeader) == null ? void 0 : _a2.call(column, label, column));
|
|
12571
|
+
};
|
|
12572
|
+
}
|
|
12573
|
+
if (isFunction(column.render)) {
|
|
12574
|
+
prepared.cellRender = ({ row, index }) => {
|
|
12575
|
+
var _a2;
|
|
12576
|
+
return toVNode((_a2 = column.render) == null ? void 0 : _a2.call(column, readValue(row), { row, column, index }));
|
|
12577
|
+
};
|
|
12578
|
+
} else if (isFunction(column.renderHTML)) {
|
|
12579
|
+
prepared.cellHTML = (row, index) => {
|
|
12580
|
+
var _a2, _b2;
|
|
12581
|
+
return String((_b2 = (_a2 = column.renderHTML) == null ? void 0 : _a2.call(column, readValue(row), { row, column, index })) != null ? _b2 : "");
|
|
12582
|
+
};
|
|
12583
|
+
} else if (valueTypeCellRender) {
|
|
12584
|
+
prepared.cellRender = ({ row }) => valueTypeCellRender(readValue(row));
|
|
12585
|
+
}
|
|
12586
|
+
return prepared;
|
|
12587
|
+
})
|
|
12588
|
+
);
|
|
12589
|
+
const getRowKeyValue = (row) => {
|
|
12590
|
+
const { rowKey } = props;
|
|
12591
|
+
if (isFunction(rowKey)) return rowKey(row);
|
|
12592
|
+
return row == null ? void 0 : row[rowKey];
|
|
12593
|
+
};
|
|
12594
|
+
const selectedKeys = ref(new Set(props.defaultSelectedKeys));
|
|
12595
|
+
let selectedRowCache = /* @__PURE__ */ new Map();
|
|
12596
|
+
function isRowSelectable(row, index) {
|
|
12597
|
+
var _a2;
|
|
12598
|
+
const selectable = (_a2 = props.selectionTableColumnProps) == null ? void 0 : _a2.selectable;
|
|
12599
|
+
return isFunction(selectable) ? selectable(row, index) !== false : true;
|
|
12600
|
+
}
|
|
12601
|
+
const selectableRows = computed(
|
|
12602
|
+
() => __tableData.value.filter((row, index) => isRowSelectable(row, index))
|
|
12603
|
+
);
|
|
12604
|
+
const isRowSelected = (row) => {
|
|
12605
|
+
const key = getRowKeyValue(row);
|
|
12606
|
+
return key === void 0 ? false : selectedKeys.value.has(key);
|
|
12607
|
+
};
|
|
12608
|
+
const isAllSelected = computed(
|
|
12609
|
+
() => selectableRows.value.length > 0 && selectableRows.value.every((row) => selectedKeys.value.has(getRowKeyValue(row)))
|
|
12610
|
+
);
|
|
12611
|
+
const isIndeterminate = computed(
|
|
12612
|
+
() => !isAllSelected.value && selectableRows.value.some((row) => selectedKeys.value.has(getRowKeyValue(row)))
|
|
12613
|
+
);
|
|
12614
|
+
const getSelectedRows = () => {
|
|
12615
|
+
const rows = [];
|
|
12616
|
+
selectedRowCache.forEach((row, key) => {
|
|
12617
|
+
if (selectedKeys.value.has(key)) rows.push(row);
|
|
12618
|
+
});
|
|
12619
|
+
return rows;
|
|
12620
|
+
};
|
|
12621
|
+
const handleToggleRow = (row, checked) => {
|
|
12622
|
+
const key = getRowKeyValue(row);
|
|
12623
|
+
if (key === void 0) return;
|
|
12624
|
+
if (checked) {
|
|
12625
|
+
selectedKeys.value.add(key);
|
|
12626
|
+
selectedRowCache.set(key, row);
|
|
12627
|
+
} else {
|
|
12628
|
+
selectedKeys.value.delete(key);
|
|
12629
|
+
selectedRowCache.delete(key);
|
|
12630
|
+
}
|
|
12631
|
+
emit("selection-change", getSelectedRows());
|
|
12632
|
+
};
|
|
12633
|
+
const handleToggleAll = () => {
|
|
12634
|
+
const nextAllSelected = !isAllSelected.value;
|
|
12635
|
+
selectableRows.value.forEach((row) => {
|
|
12636
|
+
const key = getRowKeyValue(row);
|
|
12637
|
+
if (key === void 0) return;
|
|
12638
|
+
if (nextAllSelected) {
|
|
12639
|
+
selectedKeys.value.add(key);
|
|
12640
|
+
selectedRowCache.set(key, row);
|
|
12641
|
+
} else {
|
|
12642
|
+
selectedKeys.value.delete(key);
|
|
12643
|
+
selectedRowCache.delete(key);
|
|
12644
|
+
}
|
|
12645
|
+
});
|
|
12646
|
+
emit("selection-change", getSelectedRows());
|
|
12647
|
+
};
|
|
12648
|
+
const clearSelection = () => {
|
|
12649
|
+
selectedKeys.value = /* @__PURE__ */ new Set();
|
|
12650
|
+
selectedRowCache = /* @__PURE__ */ new Map();
|
|
12651
|
+
};
|
|
12652
|
+
const syncSelectedRowCache = (rows) => {
|
|
12653
|
+
if (!selectedKeys.value.size || !(rows == null ? void 0 : rows.length)) return;
|
|
12654
|
+
rows.forEach((row) => {
|
|
12655
|
+
const key = getRowKeyValue(row);
|
|
12656
|
+
if (key !== void 0 && selectedKeys.value.has(key)) {
|
|
12657
|
+
selectedRowCache.set(key, row);
|
|
12658
|
+
}
|
|
12659
|
+
});
|
|
12660
|
+
};
|
|
12661
|
+
watch(
|
|
12662
|
+
() => __tableData.value,
|
|
12663
|
+
(rows) => syncSelectedRowCache(rows || []),
|
|
12664
|
+
{ immediate: true }
|
|
12665
|
+
);
|
|
12666
|
+
watch(
|
|
12667
|
+
() => props.defaultSelectedKeys,
|
|
12668
|
+
(keys) => {
|
|
12669
|
+
if (!(keys == null ? void 0 : keys.length)) return;
|
|
12670
|
+
keys.forEach((key) => selectedKeys.value.add(key));
|
|
12671
|
+
syncSelectedRowCache(__tableData.value);
|
|
12672
|
+
}
|
|
12673
|
+
);
|
|
12674
|
+
const specialColumns = computed(() => {
|
|
12675
|
+
const active = [];
|
|
12676
|
+
if (props.isSelection) active.push("selection");
|
|
12677
|
+
if (props.hasIndexColumn) active.push("index");
|
|
12678
|
+
const defaultOrder = ["selection", "index"];
|
|
12679
|
+
const order = [...props.specialColumnsOrder || [], ...defaultOrder].filter(
|
|
12680
|
+
(item, index, array) => array.indexOf(item) === index
|
|
12681
|
+
);
|
|
12682
|
+
return order.filter((item) => active.includes(item));
|
|
12683
|
+
});
|
|
12684
|
+
const selectionProps = computed(() => props.selectionTableColumnProps || {});
|
|
12685
|
+
const selectionWidth = computed(() => selectionProps.value.width || 40);
|
|
12686
|
+
const selectionAlign = computed(() => selectionProps.value.align || "center");
|
|
12687
|
+
const selectionFixed = computed(
|
|
12688
|
+
() => {
|
|
12689
|
+
var _a2;
|
|
12690
|
+
return (_a2 = selectionProps.value.fixed) != null ? _a2 : "left";
|
|
12691
|
+
}
|
|
12692
|
+
);
|
|
12693
|
+
const indexProps = computed(() => props.indexTableColumnProps || {});
|
|
12694
|
+
const indexFixed = computed(
|
|
12695
|
+
() => indexProps.value.fixed || "left"
|
|
12696
|
+
);
|
|
12697
|
+
const getIndexValue = (index) => {
|
|
12698
|
+
const customIndex = indexProps.value.index;
|
|
12699
|
+
if (isFunction(customIndex)) return customIndex(index);
|
|
12700
|
+
if (typeof customIndex === "number") return customIndex;
|
|
12701
|
+
const { page, pageSize } = state.subPageInfo;
|
|
12702
|
+
return (page - 1) * pageSize + index + 1;
|
|
12703
|
+
};
|
|
12704
|
+
const getIndexStyle = (row, index) => {
|
|
12705
|
+
const style = props.indexContentStyle;
|
|
12706
|
+
if (isFunction(style)) return style(row, index);
|
|
12707
|
+
if (isPlainObject(style)) return style;
|
|
12708
|
+
return {};
|
|
12709
|
+
};
|
|
12710
|
+
const actionBarLabel = computed(
|
|
12711
|
+
() => props.actionBar ? unref(props.actionBar.label) || t("plus.table.action") : ""
|
|
12712
|
+
);
|
|
12713
|
+
const actionBarFixed = computed(
|
|
12714
|
+
() => (props.actionBar ? props.actionBar.fixed : void 0) || "right"
|
|
12715
|
+
);
|
|
12716
|
+
const handlePaginationChange = () => {
|
|
12717
|
+
emit("paginationChange", { ...state.subPageInfo });
|
|
12718
|
+
};
|
|
12719
|
+
const handleRefresh = () => emit("refresh");
|
|
12720
|
+
const handleClickDensity = (size) => {
|
|
12721
|
+
state.size = size;
|
|
12722
|
+
};
|
|
12723
|
+
const handleFilterTableConfirm = (list, eventType) => {
|
|
12724
|
+
setFilterColumns(list);
|
|
12725
|
+
emit("filterTableHeader", list, eventType);
|
|
12726
|
+
};
|
|
12727
|
+
const adaptiveHeight = ref();
|
|
12728
|
+
const resolvedHeight = computed(() => {
|
|
12729
|
+
const height = props.height;
|
|
12730
|
+
return height !== void 0 ? height : adaptiveHeight.value;
|
|
12731
|
+
});
|
|
12732
|
+
const hasAdaptive = computed(() => props.height === void 0 && !!props.adaptive);
|
|
12733
|
+
const calcAdaptiveHeight = () => {
|
|
12734
|
+
var _a2;
|
|
12735
|
+
if (!wrapperInstance.value) return;
|
|
12736
|
+
let offsetBottom = 20;
|
|
12737
|
+
if (isPlainObject(props.adaptive)) {
|
|
12738
|
+
offsetBottom = (_a2 = props.adaptive.offsetBottom) != null ? _a2 : offsetBottom;
|
|
12739
|
+
}
|
|
12740
|
+
const paginationHeight = paginationInstance.value && props.pagination ? paginationInstance.value.$el.offsetHeight : 0;
|
|
12741
|
+
const top = wrapperInstance.value.getBoundingClientRect().top;
|
|
12742
|
+
adaptiveHeight.value = Math.max(window.innerHeight - top - offsetBottom - paginationHeight, 100);
|
|
12743
|
+
};
|
|
12744
|
+
const debounceCalcAdaptiveHeight = debounce(
|
|
12745
|
+
calcAdaptiveHeight,
|
|
12746
|
+
isPlainObject(props.adaptive) ? (_b = props.adaptive.timeout) != null ? _b : 60 : 60
|
|
12747
|
+
);
|
|
12748
|
+
onMounted(() => {
|
|
12749
|
+
if (hasAdaptive.value) {
|
|
12750
|
+
calcAdaptiveHeight();
|
|
12751
|
+
window.addEventListener("resize", debounceCalcAdaptiveHeight);
|
|
12752
|
+
}
|
|
12753
|
+
});
|
|
12754
|
+
onBeforeUnmount(() => {
|
|
12755
|
+
window.removeEventListener("resize", debounceCalcAdaptiveHeight);
|
|
12756
|
+
});
|
|
12757
|
+
provide(TableFormRefInjectionKey, shallowRef({}));
|
|
12758
|
+
__expose({
|
|
12759
|
+
/** el-table 实例,可用于 doLayout 等 */
|
|
12760
|
+
tableInstance,
|
|
12761
|
+
/** 获取所有已选行(跨页累计) */
|
|
12762
|
+
getSelectedRows,
|
|
12763
|
+
/** 清空所有已选(跨页) */
|
|
12764
|
+
clearSelection,
|
|
12765
|
+
/** 当前已选 rowKey 列表 */
|
|
12766
|
+
getSelectedKeys: () => Array.from(selectedKeys.value)
|
|
12767
|
+
});
|
|
12768
|
+
return (_ctx, _cache) => {
|
|
12769
|
+
return openBlock(), createElementBlock(
|
|
12770
|
+
"div",
|
|
12771
|
+
{
|
|
12772
|
+
ref_key: "wrapperInstance",
|
|
12773
|
+
ref: wrapperInstance,
|
|
12774
|
+
class: "plus-table-lite"
|
|
12775
|
+
},
|
|
12776
|
+
[
|
|
12777
|
+
createCommentVNode(" \u6807\u9898\u680F\uFF1A\u5237\u65B0 / \u5BC6\u5EA6 / \u5217\u8BBE\u7F6E\uFF0C\u4E0E PlusTable \u5171\u7528\u540C\u4E00\u4EFD\u5B9E\u73B0 "),
|
|
12778
|
+
_ctx.titleBar ? (openBlock(), createBlock(unref(PlusTableTitleBar), {
|
|
12779
|
+
key: 0,
|
|
12780
|
+
"origin-columns": _ctx.columns || [],
|
|
12781
|
+
columns: unref(filterColumns),
|
|
12782
|
+
"default-size": state.size,
|
|
12783
|
+
"columns-is-change": unref(columnsIsChange),
|
|
12784
|
+
"title-bar": _ctx.titleBar,
|
|
12785
|
+
onClickDensity: handleClickDensity,
|
|
12786
|
+
onFilterTableHeader: handleFilterTableConfirm,
|
|
12787
|
+
onRefresh: handleRefresh
|
|
12788
|
+
}, createSlots({
|
|
12789
|
+
title: withCtx(() => [
|
|
12790
|
+
renderSlot(_ctx.$slots, "title")
|
|
12791
|
+
]),
|
|
12792
|
+
toolbar: withCtx(() => [
|
|
12793
|
+
renderSlot(_ctx.$slots, "toolbar")
|
|
12794
|
+
]),
|
|
12795
|
+
_: 2
|
|
12796
|
+
/* DYNAMIC */
|
|
12797
|
+
}, [
|
|
12798
|
+
_ctx.$slots["drag-sort-icon"] ? {
|
|
12799
|
+
name: "drag-sort-icon",
|
|
12800
|
+
fn: withCtx(() => [
|
|
12801
|
+
renderSlot(_ctx.$slots, "drag-sort-icon")
|
|
12802
|
+
]),
|
|
12803
|
+
key: "0"
|
|
12804
|
+
} : void 0,
|
|
12805
|
+
_ctx.$slots["column-settings-icon"] ? {
|
|
12806
|
+
name: "column-settings-icon",
|
|
12807
|
+
fn: withCtx(() => [
|
|
12808
|
+
renderSlot(_ctx.$slots, "column-settings-icon")
|
|
12809
|
+
]),
|
|
12810
|
+
key: "1"
|
|
12811
|
+
} : void 0,
|
|
12812
|
+
_ctx.$slots["density-icon"] ? {
|
|
12813
|
+
name: "density-icon",
|
|
12814
|
+
fn: withCtx(() => [
|
|
12815
|
+
renderSlot(_ctx.$slots, "density-icon")
|
|
12816
|
+
]),
|
|
12817
|
+
key: "2"
|
|
12818
|
+
} : void 0
|
|
12819
|
+
]), 1032, ["origin-columns", "columns", "default-size", "columns-is-change", "title-bar"])) : createCommentVNode("v-if", true),
|
|
12820
|
+
withDirectives((openBlock(), createBlock(unref(ElTable), mergeProps({
|
|
12821
|
+
ref_key: "tableInstance",
|
|
12822
|
+
ref: tableInstance,
|
|
12823
|
+
data: __tableData.value,
|
|
12824
|
+
border: _ctx.border,
|
|
12825
|
+
height: resolvedHeight.value,
|
|
12826
|
+
"header-cell-style": _ctx.headerCellStyle,
|
|
12827
|
+
size: state.size,
|
|
12828
|
+
"row-key": _ctx.rowKey
|
|
12829
|
+
}, _ctx.$attrs), {
|
|
12830
|
+
empty: withCtx(() => [
|
|
12831
|
+
renderSlot(_ctx.$slots, "empty")
|
|
12832
|
+
]),
|
|
12833
|
+
default: withCtx(() => [
|
|
12834
|
+
(openBlock(true), createElementBlock(
|
|
12835
|
+
Fragment,
|
|
12836
|
+
null,
|
|
12837
|
+
renderList(specialColumns.value, (type) => {
|
|
12838
|
+
return openBlock(), createElementBlock(
|
|
12839
|
+
Fragment,
|
|
12840
|
+
{ key: type },
|
|
12841
|
+
[
|
|
12842
|
+
createCommentVNode("\n \u591A\u9009\u5217\n \u52FE\u9009\u72B6\u6001\u7531\u7EC4\u4EF6\u81EA\u8EAB\u7684 selectedKeys \u7EF4\u62A4\uFF0C\u56E0\u6B64\u7FFB\u9875\u540E\u4F9D\u7136\u4FDD\u7559\uFF1B\n \u4E0D\u4F7F\u7528 el-table \u5185\u7F6E\u7684 reserve-selection\uFF08\u5176\u884C\u4E3A\u4F9D\u8D56 selection \u5185\u90E8\u72B6\u6001\uFF0C\u8DE8\u9875\u4E0D\u53EF\u9760\uFF09\u3002\n "),
|
|
12843
|
+
type === "selection" ? (openBlock(), createBlock(unref(ElTableColumn), {
|
|
12844
|
+
key: "selection",
|
|
12845
|
+
"class-name": "plus-table-lite-selection",
|
|
12846
|
+
width: selectionWidth.value,
|
|
12847
|
+
align: selectionAlign.value,
|
|
12848
|
+
fixed: selectionFixed.value
|
|
12849
|
+
}, {
|
|
12850
|
+
header: withCtx(() => [
|
|
12851
|
+
createVNode(unref(ElCheckbox), {
|
|
12852
|
+
"model-value": isAllSelected.value,
|
|
12853
|
+
indeterminate: isIndeterminate.value,
|
|
12854
|
+
onChange: handleToggleAll
|
|
12855
|
+
}, null, 8, ["model-value", "indeterminate"])
|
|
12856
|
+
]),
|
|
12857
|
+
default: withCtx(({ row, $index }) => [
|
|
12858
|
+
createVNode(unref(ElCheckbox), {
|
|
12859
|
+
"model-value": isRowSelected(row),
|
|
12860
|
+
disabled: !isRowSelectable(row, $index),
|
|
12861
|
+
onChange: (checked) => handleToggleRow(row, !!checked)
|
|
12862
|
+
}, null, 8, ["model-value", "disabled", "onChange"])
|
|
12863
|
+
]),
|
|
12864
|
+
_: 1
|
|
12865
|
+
/* STABLE */
|
|
12866
|
+
}, 8, ["width", "align", "fixed"])) : (openBlock(), createElementBlock(
|
|
12867
|
+
Fragment,
|
|
12868
|
+
{ key: 1 },
|
|
12869
|
+
[
|
|
12870
|
+
createCommentVNode(" \u5E8F\u53F7\u5217 "),
|
|
12871
|
+
createVNode(unref(ElTableColumn), {
|
|
12872
|
+
key: "index",
|
|
12873
|
+
type: "index",
|
|
12874
|
+
label: "#",
|
|
12875
|
+
"class-name": "plus-table-lite-index",
|
|
12876
|
+
width: indexProps.value.width || 60,
|
|
12877
|
+
fixed: indexFixed.value,
|
|
12878
|
+
align: "center",
|
|
12879
|
+
index: getIndexValue
|
|
12880
|
+
}, {
|
|
12881
|
+
default: withCtx(({ $index }) => [
|
|
12882
|
+
createElementVNode(
|
|
12883
|
+
"div",
|
|
12884
|
+
{
|
|
12885
|
+
class: "plus-table-lite-index__content",
|
|
12886
|
+
style: normalizeStyle(getIndexStyle(__tableData.value[$index], $index))
|
|
12887
|
+
},
|
|
12888
|
+
toDisplayString(getIndexValue($index)),
|
|
12889
|
+
5
|
|
12890
|
+
/* TEXT, STYLE */
|
|
12891
|
+
)
|
|
12892
|
+
]),
|
|
12893
|
+
_: 1
|
|
12894
|
+
/* STABLE */
|
|
12895
|
+
}, 8, ["width", "fixed"])
|
|
12896
|
+
],
|
|
12897
|
+
2112
|
|
12898
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
12899
|
+
))
|
|
12900
|
+
],
|
|
12901
|
+
64
|
|
12902
|
+
/* STABLE_FRAGMENT */
|
|
12903
|
+
);
|
|
12904
|
+
}),
|
|
12905
|
+
128
|
|
12906
|
+
/* KEYED_FRAGMENT */
|
|
12907
|
+
)),
|
|
12908
|
+
(openBlock(true), createElementBlock(
|
|
12909
|
+
Fragment,
|
|
12910
|
+
null,
|
|
12911
|
+
renderList(preparedColumns.value, (col) => {
|
|
12912
|
+
return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
12913
|
+
key: col.key
|
|
12914
|
+
}, col.tableColumnProps, {
|
|
12915
|
+
prop: col.prop,
|
|
12916
|
+
label: col.label,
|
|
12917
|
+
width: col.width,
|
|
12918
|
+
"min-width": col.minWidth
|
|
12919
|
+
}), {
|
|
12920
|
+
header: withCtx((scoped) => [
|
|
12921
|
+
createElementVNode("span", _hoisted_1$8, [
|
|
12922
|
+
renderSlot(_ctx.$slots, col.headerSlotName, mergeProps(scoped, {
|
|
12923
|
+
prop: col.prop,
|
|
12924
|
+
label: col.label,
|
|
12925
|
+
column: col.column
|
|
12926
|
+
}), () => [
|
|
12927
|
+
col.headerRender ? (openBlock(), createBlock(resolveDynamicComponent(col.headerRender), { key: 0 })) : (openBlock(), createElementBlock(
|
|
12928
|
+
Fragment,
|
|
12929
|
+
{ key: 1 },
|
|
12930
|
+
[
|
|
12931
|
+
createTextVNode(
|
|
12932
|
+
toDisplayString(col.label),
|
|
12933
|
+
1
|
|
12934
|
+
/* TEXT */
|
|
12935
|
+
)
|
|
12936
|
+
],
|
|
12937
|
+
64
|
|
12938
|
+
/* STABLE_FRAGMENT */
|
|
12939
|
+
))
|
|
12940
|
+
]),
|
|
12941
|
+
col.tooltip ? (openBlock(), createBlock(
|
|
12942
|
+
unref(ElTooltip),
|
|
12943
|
+
mergeProps({
|
|
12944
|
+
key: 0,
|
|
12945
|
+
placement: "top"
|
|
12946
|
+
}, col.tooltipProps),
|
|
12947
|
+
{
|
|
12948
|
+
default: withCtx(() => [
|
|
12949
|
+
renderSlot(_ctx.$slots, "tooltip-icon", {}, () => [
|
|
12950
|
+
createVNode(unref(ElIcon), {
|
|
12951
|
+
class: "plus-table-lite__header__icon",
|
|
12952
|
+
size: 16
|
|
12953
|
+
}, {
|
|
12954
|
+
default: withCtx(() => [
|
|
12955
|
+
createVNode(unref(question_filled_default))
|
|
12956
|
+
]),
|
|
12957
|
+
_: 1
|
|
12958
|
+
/* STABLE */
|
|
12959
|
+
})
|
|
12960
|
+
])
|
|
12961
|
+
]),
|
|
12962
|
+
_: 2
|
|
12963
|
+
/* DYNAMIC */
|
|
12964
|
+
},
|
|
12965
|
+
1040
|
|
12966
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
12967
|
+
)) : createCommentVNode("v-if", true)
|
|
12968
|
+
])
|
|
12969
|
+
]),
|
|
12970
|
+
default: withCtx(({ row, $index }) => [
|
|
12971
|
+
renderSlot(_ctx.$slots, col.cellSlotName, {
|
|
12972
|
+
row,
|
|
12973
|
+
index: $index,
|
|
12974
|
+
value: col.readValue(row),
|
|
12975
|
+
column: col.column
|
|
12976
|
+
}, () => [
|
|
12977
|
+
createCommentVNode(" \u81EA\u5B9A\u4E49 render\uFF1A\u552F\u4E00\u9700\u8981\u7EC4\u4EF6\u7684\u4F4D\u7F6E\uFF0C\u6309\u5217\u521B\u5EFA\u4E00\u6B21 "),
|
|
12978
|
+
col.cellRender ? (openBlock(), createBlock(resolveDynamicComponent(col.cellRender), {
|
|
12979
|
+
key: 0,
|
|
12980
|
+
row,
|
|
12981
|
+
index: $index
|
|
12982
|
+
}, null, 8, ["row", "index"])) : col.cellHTML ? (openBlock(), createElementBlock(
|
|
12983
|
+
Fragment,
|
|
12984
|
+
{ key: 1 },
|
|
12985
|
+
[
|
|
12986
|
+
createCommentVNode(" renderHTML "),
|
|
12987
|
+
createElementVNode("span", {
|
|
12988
|
+
innerHTML: col.cellHTML(row, $index)
|
|
12989
|
+
}, null, 8, _hoisted_2$4)
|
|
12990
|
+
],
|
|
12991
|
+
2112
|
|
12992
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
12993
|
+
)) : (openBlock(), createElementBlock(
|
|
12994
|
+
Fragment,
|
|
12995
|
+
{ key: 2 },
|
|
12996
|
+
[
|
|
12997
|
+
createCommentVNode(" \u7EAF\u6587\u672C\uFF1A\u96F6\u5B9E\u4F8B "),
|
|
12998
|
+
createTextVNode(
|
|
12999
|
+
toDisplayString(col.cellText(row, $index)),
|
|
13000
|
+
1
|
|
13001
|
+
/* TEXT */
|
|
13002
|
+
)
|
|
13003
|
+
],
|
|
13004
|
+
64
|
|
13005
|
+
/* STABLE_FRAGMENT */
|
|
13006
|
+
))
|
|
13007
|
+
])
|
|
13008
|
+
]),
|
|
13009
|
+
_: 2
|
|
13010
|
+
/* DYNAMIC */
|
|
13011
|
+
}, 1040, ["prop", "label", "width", "min-width"]);
|
|
13012
|
+
}),
|
|
13013
|
+
128
|
|
13014
|
+
/* KEYED_FRAGMENT */
|
|
13015
|
+
)),
|
|
13016
|
+
_ctx.actionBar ? (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
13017
|
+
key: 0,
|
|
13018
|
+
"class-name": "plus-table-action-bar",
|
|
13019
|
+
label: actionBarLabel.value,
|
|
13020
|
+
fixed: actionBarFixed.value,
|
|
13021
|
+
width: _ctx.actionBar.width || 200
|
|
13022
|
+
}, _ctx.actionBar.actionBarTableColumnProps), {
|
|
13023
|
+
default: withCtx(({ row, $index }) => [
|
|
13024
|
+
createVNode(unref(PlusTableActionBarContent), {
|
|
13025
|
+
row,
|
|
13026
|
+
index: $index,
|
|
13027
|
+
type: _ctx.actionBar.type,
|
|
13028
|
+
buttons: _ctx.actionBar.buttons,
|
|
13029
|
+
"show-number": _ctx.actionBar.showNumber,
|
|
13030
|
+
"show-limit-include-more": _ctx.actionBar.showLimitIncludeMore,
|
|
13031
|
+
"confirm-type": _ctx.actionBar.confirmType,
|
|
13032
|
+
"more-type": _ctx.actionBar.moreType,
|
|
13033
|
+
onClickAction: _cache[0] || (_cache[0] = (data) => emit("clickAction", data)),
|
|
13034
|
+
onClickActionConfirmCancel: _cache[1] || (_cache[1] = (data) => emit("clickActionConfirmCancel", data))
|
|
13035
|
+
}, createSlots({
|
|
13036
|
+
_: 2
|
|
13037
|
+
/* DYNAMIC */
|
|
13038
|
+
}, [
|
|
13039
|
+
_ctx.$slots["action-bar-more-icon"] ? {
|
|
13040
|
+
name: "action-bar-more-icon",
|
|
13041
|
+
fn: withCtx(() => [
|
|
13042
|
+
renderSlot(_ctx.$slots, "action-bar-more-icon")
|
|
13043
|
+
]),
|
|
13044
|
+
key: "0"
|
|
13045
|
+
} : void 0
|
|
13046
|
+
]), 1032, ["row", "index", "type", "buttons", "show-number", "show-limit-include-more", "confirm-type", "more-type"])
|
|
13047
|
+
]),
|
|
13048
|
+
_: 3
|
|
13049
|
+
/* FORWARDED */
|
|
13050
|
+
}, 16, ["label", "fixed", "width"])) : createCommentVNode("v-if", true)
|
|
13051
|
+
]),
|
|
13052
|
+
_: 3
|
|
13053
|
+
/* FORWARDED */
|
|
13054
|
+
}, 16, ["data", "border", "height", "header-cell-style", "size", "row-key"])), [
|
|
13055
|
+
[unref(vLoading), _ctx.loadingStatus]
|
|
13056
|
+
]),
|
|
13057
|
+
createCommentVNode(" \u5206\u9875 "),
|
|
13058
|
+
_ctx.pagination ? (openBlock(), createBlock(unref(PlusPagination), mergeProps({
|
|
13059
|
+
key: 1,
|
|
13060
|
+
ref_key: "paginationInstance",
|
|
13061
|
+
ref: paginationInstance,
|
|
13062
|
+
modelValue: state.subPageInfo,
|
|
13063
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.subPageInfo = $event)
|
|
13064
|
+
}, _ctx.pagination, { onChange: handlePaginationChange }), createSlots({
|
|
13065
|
+
_: 2
|
|
13066
|
+
/* DYNAMIC */
|
|
13067
|
+
}, [
|
|
13068
|
+
_ctx.$slots["pagination-left"] ? {
|
|
13069
|
+
name: "pagination-left",
|
|
13070
|
+
fn: withCtx(() => [
|
|
13071
|
+
renderSlot(_ctx.$slots, "pagination-left")
|
|
13072
|
+
]),
|
|
13073
|
+
key: "0"
|
|
13074
|
+
} : void 0,
|
|
13075
|
+
_ctx.$slots["pagination-right"] ? {
|
|
13076
|
+
name: "pagination-right",
|
|
13077
|
+
fn: withCtx(() => [
|
|
13078
|
+
renderSlot(_ctx.$slots, "pagination-right")
|
|
13079
|
+
]),
|
|
13080
|
+
key: "1"
|
|
13081
|
+
} : void 0
|
|
13082
|
+
]), 1040, ["modelValue"])) : createCommentVNode("v-if", true)
|
|
13083
|
+
],
|
|
13084
|
+
512
|
|
13085
|
+
/* NEED_PATCH */
|
|
13086
|
+
);
|
|
13087
|
+
};
|
|
13088
|
+
}
|
|
13089
|
+
});
|
|
13090
|
+
|
|
13091
|
+
var TableLite = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "index.vue"]]);
|
|
13092
|
+
|
|
13093
|
+
const PlusTableLite = TableLite;
|
|
13094
|
+
|
|
12345
13095
|
const _hoisted_1$7 = { class: "plus-table-v2-header" };
|
|
12346
13096
|
var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
12347
13097
|
...{
|
|
@@ -13965,6 +14715,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13965
14715
|
table: { default: () => ({}) },
|
|
13966
14716
|
tableType: { default: "table" },
|
|
13967
14717
|
tableV2: { default: void 0 },
|
|
14718
|
+
tableLite: { default: void 0 },
|
|
13968
14719
|
params: { default: () => ({}) },
|
|
13969
14720
|
postData: { type: Function, default: void 0 },
|
|
13970
14721
|
beforeSearchSubmit: { type: Function, default: void 0 },
|
|
@@ -13983,7 +14734,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13983
14734
|
searchSlot: { type: Boolean, default: false },
|
|
13984
14735
|
resetSearch: { type: Boolean, default: true }
|
|
13985
14736
|
},
|
|
13986
|
-
emits: ["update:searchValues", "search", "reset", "searchChange", "paginationChange", "requestError", "requestComplete"],
|
|
14737
|
+
emits: ["update:searchValues", "search", "reset", "searchChange", "paginationChange", "selectionChange", "requestError", "requestComplete"],
|
|
13987
14738
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
13988
14739
|
var _a, _b;
|
|
13989
14740
|
const props = __props;
|
|
@@ -14020,13 +14771,17 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
14020
14771
|
);
|
|
14021
14772
|
const tableComponentMap = /* @__PURE__ */ new Map([
|
|
14022
14773
|
["table", PlusTable],
|
|
14023
|
-
["table-v2", PlusTableV2]
|
|
14774
|
+
["table-v2", PlusTableV2],
|
|
14775
|
+
["table-lite", PlusTableLite]
|
|
14024
14776
|
]);
|
|
14025
14777
|
const tableComponent = computed(() => tableComponentMap.get(props.tableType) || PlusTable);
|
|
14026
14778
|
const tableProps = computed(() => {
|
|
14027
14779
|
if (props.tableType === "table-v2") {
|
|
14028
14780
|
return { ...props.table, ...props.tableV2 };
|
|
14029
14781
|
}
|
|
14782
|
+
if (props.tableType === "table-lite") {
|
|
14783
|
+
return { ...props.table, ...props.tableLite };
|
|
14784
|
+
}
|
|
14030
14785
|
return props.table;
|
|
14031
14786
|
});
|
|
14032
14787
|
const tablePagination = computed(() => {
|
|
@@ -14090,6 +14845,9 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
14090
14845
|
const handleTablePaginationChange = (data) => {
|
|
14091
14846
|
handlePaginationChange(data);
|
|
14092
14847
|
};
|
|
14848
|
+
const handleTableSelectionChange = (data) => {
|
|
14849
|
+
emit("selectionChange", data || []);
|
|
14850
|
+
};
|
|
14093
14851
|
const handleSearchChange = (val, column) => {
|
|
14094
14852
|
emit("update:searchValues", val);
|
|
14095
14853
|
emit("searchChange", val, column);
|
|
@@ -14214,7 +14972,8 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
14214
14972
|
columns: _ctx.columns,
|
|
14215
14973
|
pagination: tablePagination.value,
|
|
14216
14974
|
onPaginationChange: handleTablePaginationChange,
|
|
14217
|
-
onRefresh: handleRefresh
|
|
14975
|
+
onRefresh: handleRefresh,
|
|
14976
|
+
onSelectionChange: handleTableSelectionChange
|
|
14218
14977
|
}), createSlots({
|
|
14219
14978
|
_: 2
|
|
14220
14979
|
/* DYNAMIC */
|
|
@@ -15657,6 +16416,7 @@ const plugins = [
|
|
|
15657
16416
|
PlusDialog,
|
|
15658
16417
|
PlusPagination,
|
|
15659
16418
|
PlusTable,
|
|
16419
|
+
PlusTableLite,
|
|
15660
16420
|
PlusTableV2,
|
|
15661
16421
|
PlusRadio,
|
|
15662
16422
|
PlusDatePicker,
|
|
@@ -15681,8 +16441,8 @@ const plugins = [
|
|
|
15681
16441
|
|
|
15682
16442
|
var installer = makeInstaller([...plugins]);
|
|
15683
16443
|
|
|
15684
|
-
const version = "1.0.
|
|
16444
|
+
const version = "1.0.3";
|
|
15685
16445
|
|
|
15686
16446
|
const install = installer.install;
|
|
15687
16447
|
|
|
15688
|
-
export { DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusTableActionBarContent, PlusTableTitleBar, PlusTableV2, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, buildLocaleContext, buildTranslator, installer as default, getOptionsByOptionsMap, install, selectValueTypeList, translate, useGetOptions, useLocale, useTable, useTableColumns, useTableV2Columns, version };
|
|
16448
|
+
export { DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusTableActionBarContent, PlusTableLite, PlusTableTitleBar, PlusTableV2, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, buildLocaleContext, buildTranslator, installer as default, getOptionsByOptionsMap, install, selectValueTypeList, translate, useGetOptions, useLocale, useTable, useTableColumns, useTableV2Columns, version };
|