yc-pro-components 0.0.47 → 0.0.49
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/components/index.mjs +1 -0
- package/es/components/yc-plus-page/index.d.ts +2 -0
- package/es/components/yc-plus-page/index.mjs +1 -0
- package/es/components/yc-plus-page/src/header-filter-cell.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/header-filter-cell.vue2.mjs +55 -31
- package/es/components/yc-plus-page/src/use-local-header-filter.d.ts +93 -0
- package/es/components/yc-plus-page/src/use-local-header-filter.mjs +151 -0
- package/es/index.css +10 -10
- package/es/index.mjs +1 -0
- package/index.css +13 -7
- package/index.js +218 -48
- package/index.min.css +1 -1
- package/index.min.js +11 -11
- package/index.min.mjs +11 -11
- package/index.mjs +218 -49
- package/lib/components/index.js +2 -0
- package/lib/components/yc-plus-page/index.d.ts +2 -0
- package/lib/components/yc-plus-page/index.js +2 -0
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.js +1 -1
- package/lib/components/yc-plus-page/src/header-filter-cell.vue2.js +53 -29
- package/lib/components/yc-plus-page/src/use-local-header-filter.d.ts +93 -0
- package/lib/components/yc-plus-page/src/use-local-header-filter.js +153 -0
- package/lib/index.css +11 -11
- package/lib/index.js +2 -0
- 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-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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.49 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
|
|
@@ -23,10 +23,8 @@
|
|
|
23
23
|
/** Used as a reference to the global object. */
|
|
24
24
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
25
25
|
|
|
26
|
-
var root$1 = root;
|
|
27
|
-
|
|
28
26
|
/** Built-in value references. */
|
|
29
|
-
var Symbol$1 = root
|
|
27
|
+
var Symbol$1 = root.Symbol;
|
|
30
28
|
|
|
31
29
|
/** Used for built-in method references. */
|
|
32
30
|
var objectProto$f = Object.prototype;
|
|
@@ -421,7 +419,7 @@
|
|
|
421
419
|
}
|
|
422
420
|
|
|
423
421
|
/** Used to detect overreaching core-js shims. */
|
|
424
|
-
var coreJsData = root
|
|
422
|
+
var coreJsData = root['__core-js_shared__'];
|
|
425
423
|
|
|
426
424
|
/** Used to detect methods masquerading as native. */
|
|
427
425
|
var maskSrcKey = (function() {
|
|
@@ -532,7 +530,7 @@
|
|
|
532
530
|
}
|
|
533
531
|
|
|
534
532
|
/* Built-in method references that are verified to be native. */
|
|
535
|
-
var WeakMap$1 = getNative(root
|
|
533
|
+
var WeakMap$1 = getNative(root, 'WeakMap');
|
|
536
534
|
|
|
537
535
|
/** Built-in value references. */
|
|
538
536
|
var objectCreate = Object.create;
|
|
@@ -1133,7 +1131,7 @@
|
|
|
1133
1131
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
1134
1132
|
|
|
1135
1133
|
/** Built-in value references. */
|
|
1136
|
-
var Buffer$1 = moduleExports$2 ? root
|
|
1134
|
+
var Buffer$1 = moduleExports$2 ? root.Buffer : undefined;
|
|
1137
1135
|
|
|
1138
1136
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1139
1137
|
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
|
|
@@ -1752,7 +1750,7 @@
|
|
|
1752
1750
|
ListCache.prototype.set = listCacheSet;
|
|
1753
1751
|
|
|
1754
1752
|
/* Built-in method references that are verified to be native. */
|
|
1755
|
-
var Map$1 = getNative(root
|
|
1753
|
+
var Map$1 = getNative(root, 'Map');
|
|
1756
1754
|
|
|
1757
1755
|
/**
|
|
1758
1756
|
* Removes all key-value entries from the map.
|
|
@@ -2327,7 +2325,7 @@
|
|
|
2327
2325
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2328
2326
|
|
|
2329
2327
|
/** Built-in value references. */
|
|
2330
|
-
var Buffer = moduleExports ? root
|
|
2328
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
2331
2329
|
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
2332
2330
|
|
|
2333
2331
|
/**
|
|
@@ -2504,13 +2502,13 @@
|
|
|
2504
2502
|
}
|
|
2505
2503
|
|
|
2506
2504
|
/* Built-in method references that are verified to be native. */
|
|
2507
|
-
var DataView$1 = getNative(root
|
|
2505
|
+
var DataView$1 = getNative(root, 'DataView');
|
|
2508
2506
|
|
|
2509
2507
|
/* Built-in method references that are verified to be native. */
|
|
2510
|
-
var Promise$1 = getNative(root
|
|
2508
|
+
var Promise$1 = getNative(root, 'Promise');
|
|
2511
2509
|
|
|
2512
2510
|
/* Built-in method references that are verified to be native. */
|
|
2513
|
-
var Set$1 = getNative(root
|
|
2511
|
+
var Set$1 = getNative(root, 'Set');
|
|
2514
2512
|
|
|
2515
2513
|
/** `Object#toString` result references. */
|
|
2516
2514
|
var mapTag$4 = '[object Map]',
|
|
@@ -2589,7 +2587,7 @@
|
|
|
2589
2587
|
}
|
|
2590
2588
|
|
|
2591
2589
|
/** Built-in value references. */
|
|
2592
|
-
var Uint8Array$1 = root
|
|
2590
|
+
var Uint8Array$1 = root.Uint8Array;
|
|
2593
2591
|
|
|
2594
2592
|
/**
|
|
2595
2593
|
* Creates a clone of `arrayBuffer`.
|
|
@@ -3876,7 +3874,7 @@
|
|
|
3876
3874
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
3877
3875
|
*/
|
|
3878
3876
|
var now = function() {
|
|
3879
|
-
return root
|
|
3877
|
+
return root.Date.now();
|
|
3880
3878
|
};
|
|
3881
3879
|
|
|
3882
3880
|
/** Error message constants. */
|
|
@@ -18339,7 +18337,7 @@
|
|
|
18339
18337
|
key: 0,
|
|
18340
18338
|
class: "plus-table-checkbox-handle"
|
|
18341
18339
|
};
|
|
18342
|
-
const _hoisted_8$
|
|
18340
|
+
const _hoisted_8$5 = { key: 1 };
|
|
18343
18341
|
const _hoisted_9$4 = { key: 1 };
|
|
18344
18342
|
var _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
18345
18343
|
...{
|
|
@@ -18722,7 +18720,7 @@
|
|
|
18722
18720
|
/* DYNAMIC */
|
|
18723
18721
|
}, 1032, ["content"])) : (vue.openBlock(), vue.createElementBlock(
|
|
18724
18722
|
"span",
|
|
18725
|
-
_hoisted_8$
|
|
18723
|
+
_hoisted_8$5,
|
|
18726
18724
|
vue.toDisplayString(item.label ? getLabelValue(item.label) : ""),
|
|
18727
18725
|
1
|
|
18728
18726
|
/* TEXT */
|
|
@@ -22027,7 +22025,7 @@
|
|
|
22027
22025
|
const _hoisted_5$8 = { class: "plus-header__right" };
|
|
22028
22026
|
const _hoisted_6$6 = { class: "plus-header__dropdown-area" };
|
|
22029
22027
|
const _hoisted_7$5 = ["src"];
|
|
22030
|
-
const _hoisted_8$
|
|
22028
|
+
const _hoisted_8$4 = { class: "plus-header__username" };
|
|
22031
22029
|
const _hoisted_9$3 = {
|
|
22032
22030
|
key: 0,
|
|
22033
22031
|
class: "plus-header-placeholder"
|
|
@@ -22182,7 +22180,7 @@
|
|
|
22182
22180
|
vue.createCommentVNode(" username "),
|
|
22183
22181
|
vue.createElementVNode(
|
|
22184
22182
|
"p",
|
|
22185
|
-
_hoisted_8$
|
|
22183
|
+
_hoisted_8$4,
|
|
22186
22184
|
vue.toDisplayString(_ctx.userInfo.username || "admin"),
|
|
22187
22185
|
1
|
|
22188
22186
|
/* TEXT */
|
|
@@ -32355,7 +32353,8 @@
|
|
|
32355
32353
|
|
|
32356
32354
|
const _hoisted_1$9 = { class: "yc-header-filter-cell__label-text" };
|
|
32357
32355
|
const _hoisted_2$8 = { class: "yc-header-filter-cell__label-text" };
|
|
32358
|
-
const _hoisted_3$8 = {
|
|
32356
|
+
const _hoisted_3$8 = { style: { cursor: "pointer", display: "inline-flex", alignItems: "center" } };
|
|
32357
|
+
const _hoisted_4$6 = {
|
|
32359
32358
|
class: "yc-header-filter-cell__content",
|
|
32360
32359
|
style: {
|
|
32361
32360
|
display: "flex",
|
|
@@ -32365,10 +32364,10 @@
|
|
|
32365
32364
|
gap: "4px"
|
|
32366
32365
|
}
|
|
32367
32366
|
};
|
|
32368
|
-
const
|
|
32369
|
-
const
|
|
32370
|
-
const
|
|
32371
|
-
const
|
|
32367
|
+
const _hoisted_5$6 = { class: "yc-header-filter-cell__operators" };
|
|
32368
|
+
const _hoisted_6$5 = ["onClick"];
|
|
32369
|
+
const _hoisted_7$4 = { key: 0 };
|
|
32370
|
+
const _hoisted_8$3 = {
|
|
32372
32371
|
class: "yc-header-filter-cell__actions",
|
|
32373
32372
|
style: {
|
|
32374
32373
|
display: "flex",
|
|
@@ -32396,7 +32395,6 @@
|
|
|
32396
32395
|
const emit = __emit;
|
|
32397
32396
|
const { getCdnUrl } = useYcCdnUrl();
|
|
32398
32397
|
const filterIconUrl = vue.computed(() => getCdnUrl("images", "table_filter_icon.svg"));
|
|
32399
|
-
const sortIconUrl = vue.computed(() => getCdnUrl("images", "table_sort_icon.svg"));
|
|
32400
32398
|
const state = vue.reactive({
|
|
32401
32399
|
selectedOp: "=",
|
|
32402
32400
|
inputVal: ""
|
|
@@ -32540,6 +32538,7 @@
|
|
|
32540
32538
|
modelValue: state.inputVal,
|
|
32541
32539
|
"onUpdate:modelValue": (v) => state.inputVal = v,
|
|
32542
32540
|
placeholder: "",
|
|
32541
|
+
maxlength: 50,
|
|
32543
32542
|
style: "margin-top: 4px; width: 100%"
|
|
32544
32543
|
});
|
|
32545
32544
|
};
|
|
@@ -32555,14 +32554,22 @@
|
|
|
32555
32554
|
alignItems: "center",
|
|
32556
32555
|
gap: "4px",
|
|
32557
32556
|
cursor: "default"
|
|
32558
|
-
}
|
|
32557
|
+
},
|
|
32558
|
+
onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
32559
|
+
}, ["stop"])),
|
|
32560
|
+
onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => {
|
|
32561
|
+
}, ["stop"]))
|
|
32559
32562
|
},
|
|
32560
32563
|
[
|
|
32564
|
+
vue.createCommentVNode(" @mousedown.stop / @click.stop \u963B\u6B62 el-table <th> \u7684 handleHeaderClick \u548C\u5217 resize \u4E8B\u4EF6\u7A7F\u900F "),
|
|
32561
32565
|
vue.createCommentVNode(" \u6807\u7B7E\u5185\u5BB9 "),
|
|
32562
32566
|
vue.createElementVNode(
|
|
32563
32567
|
"span",
|
|
32564
32568
|
{
|
|
32565
|
-
class: vue.normalizeClass(["yc-header-filter-cell__label", {
|
|
32569
|
+
class: vue.normalizeClass(["yc-header-filter-cell__label", {
|
|
32570
|
+
"yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value,
|
|
32571
|
+
"yc-header-filter-cell__label--active": isAscActive.value || isDescActive.value || isActive.value
|
|
32572
|
+
}]),
|
|
32566
32573
|
style: {
|
|
32567
32574
|
userSelect: "none",
|
|
32568
32575
|
cursor: "pointer"
|
|
@@ -32661,19 +32668,35 @@
|
|
|
32661
32668
|
class: "yc-header-filter-cell__sort",
|
|
32662
32669
|
style: {
|
|
32663
32670
|
display: "inline-flex",
|
|
32671
|
+
flexDirection: "column",
|
|
32664
32672
|
alignItems: "center",
|
|
32665
|
-
cursor: "pointer"
|
|
32673
|
+
cursor: "pointer",
|
|
32674
|
+
lineHeight: 1
|
|
32666
32675
|
},
|
|
32667
32676
|
onClick: vue.withModifiers(cycleSort, ["stop"])
|
|
32668
32677
|
}, [
|
|
32669
|
-
vue.
|
|
32670
|
-
|
|
32671
|
-
size:
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
|
|
32676
|
-
|
|
32678
|
+
vue.createCommentVNode(" \u5347\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
|
|
32679
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
32680
|
+
size: 10,
|
|
32681
|
+
style: vue.normalizeStyle({ color: isAscActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)", marginBottom: "-4px" })
|
|
32682
|
+
}, {
|
|
32683
|
+
default: vue.withCtx(() => [
|
|
32684
|
+
vue.createVNode(vue.unref(caret_top_default))
|
|
32685
|
+
]),
|
|
32686
|
+
_: 1
|
|
32687
|
+
/* STABLE */
|
|
32688
|
+
}, 8, ["style"]),
|
|
32689
|
+
vue.createCommentVNode(" \u964D\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
|
|
32690
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
32691
|
+
size: 10,
|
|
32692
|
+
style: vue.normalizeStyle({ color: isDescActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)" })
|
|
32693
|
+
}, {
|
|
32694
|
+
default: vue.withCtx(() => [
|
|
32695
|
+
vue.createVNode(vue.unref(caret_bottom_default))
|
|
32696
|
+
]),
|
|
32697
|
+
_: 1
|
|
32698
|
+
/* STABLE */
|
|
32699
|
+
}, 8, ["style"])
|
|
32677
32700
|
]),
|
|
32678
32701
|
vue.createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
|
|
32679
32702
|
!_ctx.disableFilter ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElPopover), {
|
|
@@ -32682,25 +32705,24 @@
|
|
|
32682
32705
|
placement: "bottom-start",
|
|
32683
32706
|
width: 220,
|
|
32684
32707
|
visible: popVisible.value,
|
|
32708
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => popVisible.value = $event),
|
|
32685
32709
|
"popper-class": "yc-header-filter-pop",
|
|
32686
32710
|
"popper-style": { zIndex: 4e3 }
|
|
32687
32711
|
}, {
|
|
32688
32712
|
reference: vue.withCtx(() => [
|
|
32689
|
-
vue.createElementVNode("span",
|
|
32690
|
-
style: { cursor: "pointer", display: "inline-flex", alignItems: "center" },
|
|
32691
|
-
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => popVisible.value = !popVisible.value, ["stop"]))
|
|
32692
|
-
}, [
|
|
32713
|
+
vue.createElementVNode("span", _hoisted_3$8, [
|
|
32693
32714
|
vue.createVNode(vue.unref(YcSvgIcon), {
|
|
32694
32715
|
src: filterIconUrl.value,
|
|
32695
32716
|
size: 14,
|
|
32717
|
+
color: isActive.value ? "var(--el-color-primary)" : "currentColor",
|
|
32696
32718
|
class: vue.normalizeClass({ "yc-header-filter-cell__filter-icon--active": isActive.value })
|
|
32697
|
-
}, null, 8, ["src", "class"])
|
|
32719
|
+
}, null, 8, ["src", "color", "class"])
|
|
32698
32720
|
])
|
|
32699
32721
|
]),
|
|
32700
32722
|
default: vue.withCtx(() => [
|
|
32701
|
-
vue.createElementVNode("div",
|
|
32723
|
+
vue.createElementVNode("div", _hoisted_4$6, [
|
|
32702
32724
|
vue.createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868 "),
|
|
32703
|
-
vue.createElementVNode("div",
|
|
32725
|
+
vue.createElementVNode("div", _hoisted_5$6, [
|
|
32704
32726
|
(vue.openBlock(true), vue.createElementBlock(
|
|
32705
32727
|
vue.Fragment,
|
|
32706
32728
|
null,
|
|
@@ -32727,8 +32749,8 @@
|
|
|
32727
32749
|
1
|
|
32728
32750
|
/* TEXT */
|
|
32729
32751
|
),
|
|
32730
|
-
state.selectedOp === op.code ? (vue.openBlock(), vue.createElementBlock("span",
|
|
32731
|
-
], 12,
|
|
32752
|
+
state.selectedOp === op.code ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$4, "\u2713")) : vue.createCommentVNode("v-if", true)
|
|
32753
|
+
], 12, _hoisted_6$5);
|
|
32732
32754
|
}),
|
|
32733
32755
|
128
|
|
32734
32756
|
/* KEYED_FRAGMENT */
|
|
@@ -32737,7 +32759,7 @@
|
|
|
32737
32759
|
vue.createCommentVNode(" \u503C\u8F93\u5165 "),
|
|
32738
32760
|
needValueInput.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderValueField), { key: 0 })) : vue.createCommentVNode("v-if", true),
|
|
32739
32761
|
vue.createCommentVNode(" \u64CD\u4F5C\u6309\u94AE "),
|
|
32740
|
-
vue.createElementVNode("div",
|
|
32762
|
+
vue.createElementVNode("div", _hoisted_8$3, [
|
|
32741
32763
|
vue.createVNode(vue.unref(elementPlus.ElButton), { onClick: handleReset }, {
|
|
32742
32764
|
default: vue.withCtx(() => [
|
|
32743
32765
|
vue.createTextVNode("\u91CD\u7F6E")
|
|
@@ -32762,14 +32784,14 @@
|
|
|
32762
32784
|
/* STABLE */
|
|
32763
32785
|
}, 8, ["visible"])) : vue.createCommentVNode("v-if", true)
|
|
32764
32786
|
],
|
|
32765
|
-
|
|
32766
|
-
/* NEED_PATCH */
|
|
32787
|
+
544
|
|
32788
|
+
/* NEED_HYDRATION, NEED_PATCH */
|
|
32767
32789
|
);
|
|
32768
32790
|
};
|
|
32769
32791
|
}
|
|
32770
32792
|
});
|
|
32771
32793
|
|
|
32772
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
32794
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-3330af37"], ["__file", "header-filter-cell.vue"]]);
|
|
32773
32795
|
|
|
32774
32796
|
const DEFAULT_PAGE_SIZE = 20;
|
|
32775
32797
|
const COLUMN_CACHE_PREFIX = "yc-column-settings:";
|
|
@@ -33273,6 +33295,153 @@
|
|
|
33273
33295
|
|
|
33274
33296
|
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-c7557953"], ["__file", "index.vue"]]);
|
|
33275
33297
|
|
|
33298
|
+
function compareValues(a, b) {
|
|
33299
|
+
if (a == null && b == null) return 0;
|
|
33300
|
+
if (a == null) return -1;
|
|
33301
|
+
if (b == null) return 1;
|
|
33302
|
+
const numA = Number(a);
|
|
33303
|
+
const numB = Number(b);
|
|
33304
|
+
if (!isNaN(numA) && !isNaN(numB)) return numA - numB;
|
|
33305
|
+
return String(a).localeCompare(String(b), "zh-CN");
|
|
33306
|
+
}
|
|
33307
|
+
function matchFilter(value, op, filterValue) {
|
|
33308
|
+
const strValue = String(value != null ? value : "").toLowerCase();
|
|
33309
|
+
const strFilter = String(filterValue != null ? filterValue : "").toLowerCase();
|
|
33310
|
+
switch (op) {
|
|
33311
|
+
case "=":
|
|
33312
|
+
return strValue === strFilter;
|
|
33313
|
+
case "!=":
|
|
33314
|
+
return strValue !== strFilter;
|
|
33315
|
+
case "like":
|
|
33316
|
+
return strValue.includes(strFilter);
|
|
33317
|
+
case "not like":
|
|
33318
|
+
return !strValue.includes(strFilter);
|
|
33319
|
+
case ">":
|
|
33320
|
+
return Number(value) > Number(filterValue);
|
|
33321
|
+
case ">=":
|
|
33322
|
+
return Number(value) >= Number(filterValue);
|
|
33323
|
+
case "<":
|
|
33324
|
+
return Number(value) < Number(filterValue);
|
|
33325
|
+
case "<=":
|
|
33326
|
+
return Number(value) <= Number(filterValue);
|
|
33327
|
+
case "is null":
|
|
33328
|
+
case "empty":
|
|
33329
|
+
return value == null || strValue === "";
|
|
33330
|
+
case "is not null":
|
|
33331
|
+
case "not_empty":
|
|
33332
|
+
return value != null && strValue !== "";
|
|
33333
|
+
case "in": {
|
|
33334
|
+
const set = strFilter.split(",").map((s) => s.trim().toLowerCase());
|
|
33335
|
+
return set.includes(strValue);
|
|
33336
|
+
}
|
|
33337
|
+
case "not in": {
|
|
33338
|
+
const set = strFilter.split(",").map((s) => s.trim().toLowerCase());
|
|
33339
|
+
return !set.includes(strValue);
|
|
33340
|
+
}
|
|
33341
|
+
case "between": {
|
|
33342
|
+
let parts = strFilter.split(",").map((s) => Number(s.trim()));
|
|
33343
|
+
if (parts.length < 2 || isNaN(parts[0]) || isNaN(parts[1])) {
|
|
33344
|
+
const hyphenMatch = strFilter.match(/^(-?\d+(?:\.\d+)?)-(-?\d+(?:\.\d+)?)$/);
|
|
33345
|
+
if (hyphenMatch) {
|
|
33346
|
+
parts = [Number(hyphenMatch[1]), Number(hyphenMatch[2])];
|
|
33347
|
+
}
|
|
33348
|
+
}
|
|
33349
|
+
const num = Number(value);
|
|
33350
|
+
return parts.length === 2 && !isNaN(num) && !isNaN(parts[0]) && !isNaN(parts[1]) && num >= parts[0] && num <= parts[1];
|
|
33351
|
+
}
|
|
33352
|
+
case "is true":
|
|
33353
|
+
return value === true || strValue === "true" || strValue === "1";
|
|
33354
|
+
case "is false":
|
|
33355
|
+
return value === false || strValue === "false" || strValue === "0";
|
|
33356
|
+
default:
|
|
33357
|
+
return true;
|
|
33358
|
+
}
|
|
33359
|
+
}
|
|
33360
|
+
function useLocalHeaderFilter(data, options) {
|
|
33361
|
+
const fieldCatalog = vue.computed(() => {
|
|
33362
|
+
const cols = options == null ? void 0 : options.filterableColumns;
|
|
33363
|
+
if (!(cols == null ? void 0 : cols.length)) return {};
|
|
33364
|
+
const catalog = {};
|
|
33365
|
+
for (const col of cols) {
|
|
33366
|
+
catalog[col.prop] = {
|
|
33367
|
+
type: col.type || "string",
|
|
33368
|
+
filter: true,
|
|
33369
|
+
allowedField: col.prop
|
|
33370
|
+
};
|
|
33371
|
+
}
|
|
33372
|
+
return catalog;
|
|
33373
|
+
});
|
|
33374
|
+
const {
|
|
33375
|
+
headerFiltersState,
|
|
33376
|
+
orderByState,
|
|
33377
|
+
upsertHeaderFilter,
|
|
33378
|
+
removeHeaderFilter,
|
|
33379
|
+
setOrderBy,
|
|
33380
|
+
getOpsByProp,
|
|
33381
|
+
isEnabled: _isEnabled
|
|
33382
|
+
} = useHeaderFilter({
|
|
33383
|
+
headerFilterConfig: () => ({
|
|
33384
|
+
enabled: true,
|
|
33385
|
+
fieldCatalog: fieldCatalog.value
|
|
33386
|
+
}),
|
|
33387
|
+
hideHeaderFilter: () => false
|
|
33388
|
+
});
|
|
33389
|
+
const filteredData = vue.computed(() => {
|
|
33390
|
+
let result = [...vue.unref(data) || []];
|
|
33391
|
+
if (headerFiltersState.filters.length > 0) {
|
|
33392
|
+
result = result.filter((row) => {
|
|
33393
|
+
const record = row;
|
|
33394
|
+
return headerFiltersState.filters.every(
|
|
33395
|
+
(filter) => matchFilter(record[filter.field], filter.op, filter.value)
|
|
33396
|
+
);
|
|
33397
|
+
});
|
|
33398
|
+
}
|
|
33399
|
+
if (orderByState.length > 0) {
|
|
33400
|
+
result.sort((a, b) => {
|
|
33401
|
+
const recA = a;
|
|
33402
|
+
const recB = b;
|
|
33403
|
+
for (const order of orderByState) {
|
|
33404
|
+
const cmp = compareValues(recA[order.field], recB[order.field]);
|
|
33405
|
+
if (cmp !== 0) return order.direction === "asc" ? cmp : -cmp;
|
|
33406
|
+
}
|
|
33407
|
+
return 0;
|
|
33408
|
+
});
|
|
33409
|
+
}
|
|
33410
|
+
return result;
|
|
33411
|
+
});
|
|
33412
|
+
const handleFilterConfirm = (payload) => {
|
|
33413
|
+
var _a;
|
|
33414
|
+
const field = String(((_a = payload.column) == null ? void 0 : _a.prop) || "");
|
|
33415
|
+
upsertHeaderFilter(field, payload.op, payload.value);
|
|
33416
|
+
};
|
|
33417
|
+
const handleFilterReset = (payload) => {
|
|
33418
|
+
var _a;
|
|
33419
|
+
const field = String(((_a = payload.column) == null ? void 0 : _a.prop) || "");
|
|
33420
|
+
removeHeaderFilter(field);
|
|
33421
|
+
};
|
|
33422
|
+
const handleSortChange = (payload) => {
|
|
33423
|
+
setOrderBy(payload.field, payload.direction);
|
|
33424
|
+
};
|
|
33425
|
+
const resetAllFilters = () => {
|
|
33426
|
+
headerFiltersState.filters.splice(0);
|
|
33427
|
+
orderByState.splice(0);
|
|
33428
|
+
};
|
|
33429
|
+
const hasActiveFilters = vue.computed(() => {
|
|
33430
|
+
return headerFiltersState.filters.length > 0 || orderByState.length > 0;
|
|
33431
|
+
});
|
|
33432
|
+
return {
|
|
33433
|
+
filteredData,
|
|
33434
|
+
headerFiltersState,
|
|
33435
|
+
orderByState,
|
|
33436
|
+
handleFilterConfirm,
|
|
33437
|
+
handleFilterReset,
|
|
33438
|
+
handleSortChange,
|
|
33439
|
+
getOpsByProp,
|
|
33440
|
+
resetAllFilters,
|
|
33441
|
+
hasActiveFilters
|
|
33442
|
+
};
|
|
33443
|
+
}
|
|
33444
|
+
|
|
33276
33445
|
const YcPlusPage = YcPlusPageComponent;
|
|
33277
33446
|
const YcTableHeaderFilterCell = YcTableHeaderFilterCellComponent;
|
|
33278
33447
|
const RePlusPage = YcPlusPageComponent;
|
|
@@ -63762,6 +63931,7 @@
|
|
|
63762
63931
|
exports.useDrawerFormConfig = useDrawerFormConfig;
|
|
63763
63932
|
exports.useGetOptions = useGetOptions;
|
|
63764
63933
|
exports.useHeaderFilter = useHeaderFilter;
|
|
63934
|
+
exports.useLocalHeaderFilter = useLocalHeaderFilter;
|
|
63765
63935
|
exports.useLocale = useLocale;
|
|
63766
63936
|
exports.usePlusFormReset = usePlusFormReset;
|
|
63767
63937
|
exports.usePlusProConfig = usePlusProConfig;
|
package/index.min.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.plus-virtual-table{display:flex;flex-direction:column;height:100%;min-height:0;width:100%}.plus-virtual-table__title-bar{justify-content:space-between;padding:12px 0}.plus-virtual-table__title-bar,.plus-virtual-table__title-bar__left{align-items:center;display:flex}.plus-virtual-table__title-bar__right{align-items:center;display:flex;gap:8px}.plus-virtual-table__title-bar__text{font-size:16px;font-weight:500}.plus-virtual-table__title-bar__refresh{color:#606266;cursor:pointer;transition:color .2s}.plus-virtual-table__title-bar__refresh:hover{color:var(--el-color-primary)}.plus-virtual-table__body{flex:1;max-height:calc(100vh - 280px);min-height:0;overflow:hidden}.plus-virtual-table__header,.plus-virtual-table__header .el-table-v2__header-cell{background-color:var(--el-fill-color-light)!important}.plus-virtual-table__pagination{padding:12px 0}.plus-virtual-table-action-bar{align-items:center;display:flex;gap:4px;justify-content:center}.plus-table-column-status{align-items:center;display:inline-flex;gap:6px}.plus-table-column-status__dot{border-radius:50%;display:inline-block;height:8px;width:8px}.plus-table-column-empty{color:#c0c4cc}.plus-virtual-table--striped .plus-virtual-table__row--striped .el-table-v2__row-cell{background-color:var(--el-fill-color-lighter,#fafafa)}.plus-virtual-table--border .plus-virtual-table__body{border:1px solid var(--el-border-color-lighter,#ebeef5)}.plus-virtual-table--border .el-table-v2__header-cell,.plus-virtual-table--border .el-table-v2__row-cell{border-right:1px solid var(--el-border-color-lighter,#ebeef5)}.plus-virtual-table--border .el-table-v2__header-cell:last-child,.plus-virtual-table--border .el-table-v2__row-cell:last-child{border-right:none}.plus-virtual-table--border .el-table-v2__header-row,.plus-virtual-table--border .el-table-v2__row{border-bottom:1px solid var(--el-border-color-lighter,#ebeef5)}
|
|
2
2
|
.yc-svg-icon[data-v-34e1f2f7]{display:inline-block;-webkit-mask-size:contain;mask-size:contain;vertical-align:middle}.yc-svg-icon--original[data-v-34e1f2f7]{-o-object-fit:contain;object-fit:contain}
|
|
3
|
-
.yc-header-filter-cell[data-v-
|
|
3
|
+
.yc-header-filter-cell[data-v-3330af37]{width:100%}.yc-header-filter-cell__label--ellipsis[data-v-3330af37]{flex:1 1 0;min-width:0;overflow:hidden}.yc-header-filter-cell__label--ellipsis[data-v-3330af37] .yc-header-filter-cell__label-text[data-v-3330af37]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.yc-header-filter-cell__label--active[data-v-3330af37]{color:var(--el-color-primary)}[data-v-3330af37] .yc-header-filter-cell__sort-icon--asc,[data-v-3330af37] .yc-header-filter-cell__sort-icon--desc{background-color:var(--el-color-primary)!important}[data-v-3330af37] .yc-header-filter-cell__filter-icon--active{background-color:var(--el-color-primary)!important}
|
|
4
4
|
.yc-plus-page[data-v-c7557953]{height:100%}.yc-plus-page[data-v-c7557953] [data-v-c7557953] .plus-page>.el-card{border-radius:8px}[data-v-c7557953] .yc-search-card-body{padding-right:0}[data-v-c7557953] .plus-table-title-bar__toolbar__icon{font-size:16px!important;position:relative;top:-2px}.column-settings-wrapper[data-v-c7557953]{align-items:center;cursor:pointer;display:flex;gap:4px;margin-left:8px}.column-settings-text[data-v-c7557953]{font-size:14px}
|
|
5
5
|
.yc-select-v2-loading.el-select-dropdown__item{color:#909399;cursor:default;font-size:13px;pointer-events:none;text-align:center}.yc-select-v2-loading.el-select-dropdown__item.is-disabled{color:#909399;cursor:default}
|
|
6
6
|
.el-tree .el-tree-node__content{position:relative}.yc-tree-node-label-wrapper{align-items:center;display:flex;flex:1;min-width:0}.yc-tree-node-label{font-size:12px}.yc-tree-node-line-ver{border-left:1px dashed var(--el-border-color-light,#dcdfe6);display:block;height:100%;left:0;position:absolute;top:0}.yc-tree-node-line-ver.last-node-line{border-left:1px dashed transparent}.yc-tree-node-line-ver.last-node-isLeaf-line{height:50%}.yc-tree-node-line-hor{border-bottom:1px dashed var(--el-border-color-light,#dcdfe6);display:block;height:0;left:0;position:absolute;top:50%}
|