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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.49 */
|
|
2
2
|
import { unref, isRef, ref, inject, isReactive, watch, computed, shallowRef, provide, onMounted, nextTick, onBeforeUnmount, defineComponent, useAttrs, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, getCurrentInstance, resolveComponent, toRefs, useSlots, onUnmounted, resolveDirective, pushScopeId, popScopeId, onBeforeMount, getCurrentScope, onScopeDispose, toRef, mergeModels, useModel, vShow, createStaticVNode, hasInjectionContext, markRaw, effectScope, toRaw } from 'vue';
|
|
3
3
|
import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElTooltip, ElPopconfirm, ElLink, ElMessageBox, useFormDisabled, ElDatePicker, ClickOutside, ElTag, ElInput, ElAutocomplete, ElCascader, ElCheckboxGroup, ElCheckbox, ElColorPicker, ElInputNumber, 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, ElDescriptions, ElDescriptionsItem, ElDrawer, TableV2FixedDir, ElAutoResizer, ElTableV2, ElSteps, ElStep, ElBreadcrumb, ElBreadcrumbItem, ElMenuItem, ElSubMenu, ElMenu, ElScrollbar, ElHeader, ElContainer, ElMain, ElBacktop, ElUpload } from 'element-plus';
|
|
4
4
|
|
|
@@ -20,10 +20,8 @@ var freeSelf = typeof self == 'object' && self && self.Object === Object && self
|
|
|
20
20
|
/** Used as a reference to the global object. */
|
|
21
21
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
22
22
|
|
|
23
|
-
var root$1 = root;
|
|
24
|
-
|
|
25
23
|
/** Built-in value references. */
|
|
26
|
-
var Symbol$1 = root
|
|
24
|
+
var Symbol$1 = root.Symbol;
|
|
27
25
|
|
|
28
26
|
/** Used for built-in method references. */
|
|
29
27
|
var objectProto$f = Object.prototype;
|
|
@@ -418,7 +416,7 @@ function isFunction$1(value) {
|
|
|
418
416
|
}
|
|
419
417
|
|
|
420
418
|
/** Used to detect overreaching core-js shims. */
|
|
421
|
-
var coreJsData = root
|
|
419
|
+
var coreJsData = root['__core-js_shared__'];
|
|
422
420
|
|
|
423
421
|
/** Used to detect methods masquerading as native. */
|
|
424
422
|
var maskSrcKey = (function() {
|
|
@@ -529,7 +527,7 @@ function getNative(object, key) {
|
|
|
529
527
|
}
|
|
530
528
|
|
|
531
529
|
/* Built-in method references that are verified to be native. */
|
|
532
|
-
var WeakMap$1 = getNative(root
|
|
530
|
+
var WeakMap$1 = getNative(root, 'WeakMap');
|
|
533
531
|
|
|
534
532
|
/** Built-in value references. */
|
|
535
533
|
var objectCreate = Object.create;
|
|
@@ -1130,7 +1128,7 @@ var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !modu
|
|
|
1130
1128
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
1131
1129
|
|
|
1132
1130
|
/** Built-in value references. */
|
|
1133
|
-
var Buffer$1 = moduleExports$2 ? root
|
|
1131
|
+
var Buffer$1 = moduleExports$2 ? root.Buffer : undefined;
|
|
1134
1132
|
|
|
1135
1133
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1136
1134
|
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
|
|
@@ -1749,7 +1747,7 @@ ListCache.prototype.has = listCacheHas;
|
|
|
1749
1747
|
ListCache.prototype.set = listCacheSet;
|
|
1750
1748
|
|
|
1751
1749
|
/* Built-in method references that are verified to be native. */
|
|
1752
|
-
var Map$1 = getNative(root
|
|
1750
|
+
var Map$1 = getNative(root, 'Map');
|
|
1753
1751
|
|
|
1754
1752
|
/**
|
|
1755
1753
|
* Removes all key-value entries from the map.
|
|
@@ -2324,7 +2322,7 @@ var freeModule = freeExports && typeof module == 'object' && module && !module.n
|
|
|
2324
2322
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2325
2323
|
|
|
2326
2324
|
/** Built-in value references. */
|
|
2327
|
-
var Buffer = moduleExports ? root
|
|
2325
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
2328
2326
|
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
2329
2327
|
|
|
2330
2328
|
/**
|
|
@@ -2501,13 +2499,13 @@ function getAllKeysIn(object) {
|
|
|
2501
2499
|
}
|
|
2502
2500
|
|
|
2503
2501
|
/* Built-in method references that are verified to be native. */
|
|
2504
|
-
var DataView$1 = getNative(root
|
|
2502
|
+
var DataView$1 = getNative(root, 'DataView');
|
|
2505
2503
|
|
|
2506
2504
|
/* Built-in method references that are verified to be native. */
|
|
2507
|
-
var Promise$1 = getNative(root
|
|
2505
|
+
var Promise$1 = getNative(root, 'Promise');
|
|
2508
2506
|
|
|
2509
2507
|
/* Built-in method references that are verified to be native. */
|
|
2510
|
-
var Set$1 = getNative(root
|
|
2508
|
+
var Set$1 = getNative(root, 'Set');
|
|
2511
2509
|
|
|
2512
2510
|
/** `Object#toString` result references. */
|
|
2513
2511
|
var mapTag$4 = '[object Map]',
|
|
@@ -2586,7 +2584,7 @@ function initCloneArray(array) {
|
|
|
2586
2584
|
}
|
|
2587
2585
|
|
|
2588
2586
|
/** Built-in value references. */
|
|
2589
|
-
var Uint8Array$1 = root
|
|
2587
|
+
var Uint8Array$1 = root.Uint8Array;
|
|
2590
2588
|
|
|
2591
2589
|
/**
|
|
2592
2590
|
* Creates a clone of `arrayBuffer`.
|
|
@@ -3873,7 +3871,7 @@ var baseEach = createBaseEach(baseForOwn);
|
|
|
3873
3871
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
3874
3872
|
*/
|
|
3875
3873
|
var now = function() {
|
|
3876
|
-
return root
|
|
3874
|
+
return root.Date.now();
|
|
3877
3875
|
};
|
|
3878
3876
|
|
|
3879
3877
|
/** Error message constants. */
|
|
@@ -18336,7 +18334,7 @@ const _hoisted_7$6 = {
|
|
|
18336
18334
|
key: 0,
|
|
18337
18335
|
class: "plus-table-checkbox-handle"
|
|
18338
18336
|
};
|
|
18339
|
-
const _hoisted_8$
|
|
18337
|
+
const _hoisted_8$5 = { key: 1 };
|
|
18340
18338
|
const _hoisted_9$4 = { key: 1 };
|
|
18341
18339
|
var _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
18342
18340
|
...{
|
|
@@ -18719,7 +18717,7 @@ var _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
18719
18717
|
/* DYNAMIC */
|
|
18720
18718
|
}, 1032, ["content"])) : (openBlock(), createElementBlock(
|
|
18721
18719
|
"span",
|
|
18722
|
-
_hoisted_8$
|
|
18720
|
+
_hoisted_8$5,
|
|
18723
18721
|
toDisplayString(item.label ? getLabelValue(item.label) : ""),
|
|
18724
18722
|
1
|
|
18725
18723
|
/* TEXT */
|
|
@@ -22024,7 +22022,7 @@ const _hoisted_4$8 = /* @__PURE__ */ createElementVNode(
|
|
|
22024
22022
|
const _hoisted_5$8 = { class: "plus-header__right" };
|
|
22025
22023
|
const _hoisted_6$6 = { class: "plus-header__dropdown-area" };
|
|
22026
22024
|
const _hoisted_7$5 = ["src"];
|
|
22027
|
-
const _hoisted_8$
|
|
22025
|
+
const _hoisted_8$4 = { class: "plus-header__username" };
|
|
22028
22026
|
const _hoisted_9$3 = {
|
|
22029
22027
|
key: 0,
|
|
22030
22028
|
class: "plus-header-placeholder"
|
|
@@ -22179,7 +22177,7 @@ var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
22179
22177
|
createCommentVNode(" username "),
|
|
22180
22178
|
createElementVNode(
|
|
22181
22179
|
"p",
|
|
22182
|
-
_hoisted_8$
|
|
22180
|
+
_hoisted_8$4,
|
|
22183
22181
|
toDisplayString(_ctx.userInfo.username || "admin"),
|
|
22184
22182
|
1
|
|
22185
22183
|
/* TEXT */
|
|
@@ -32352,7 +32350,8 @@ function useHeaderFilter(options = {}) {
|
|
|
32352
32350
|
|
|
32353
32351
|
const _hoisted_1$9 = { class: "yc-header-filter-cell__label-text" };
|
|
32354
32352
|
const _hoisted_2$8 = { class: "yc-header-filter-cell__label-text" };
|
|
32355
|
-
const _hoisted_3$8 = {
|
|
32353
|
+
const _hoisted_3$8 = { style: { cursor: "pointer", display: "inline-flex", alignItems: "center" } };
|
|
32354
|
+
const _hoisted_4$6 = {
|
|
32356
32355
|
class: "yc-header-filter-cell__content",
|
|
32357
32356
|
style: {
|
|
32358
32357
|
display: "flex",
|
|
@@ -32362,10 +32361,10 @@ const _hoisted_3$8 = {
|
|
|
32362
32361
|
gap: "4px"
|
|
32363
32362
|
}
|
|
32364
32363
|
};
|
|
32365
|
-
const
|
|
32366
|
-
const
|
|
32367
|
-
const
|
|
32368
|
-
const
|
|
32364
|
+
const _hoisted_5$6 = { class: "yc-header-filter-cell__operators" };
|
|
32365
|
+
const _hoisted_6$5 = ["onClick"];
|
|
32366
|
+
const _hoisted_7$4 = { key: 0 };
|
|
32367
|
+
const _hoisted_8$3 = {
|
|
32369
32368
|
class: "yc-header-filter-cell__actions",
|
|
32370
32369
|
style: {
|
|
32371
32370
|
display: "flex",
|
|
@@ -32393,7 +32392,6 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32393
32392
|
const emit = __emit;
|
|
32394
32393
|
const { getCdnUrl } = useYcCdnUrl();
|
|
32395
32394
|
const filterIconUrl = computed(() => getCdnUrl("images", "table_filter_icon.svg"));
|
|
32396
|
-
const sortIconUrl = computed(() => getCdnUrl("images", "table_sort_icon.svg"));
|
|
32397
32395
|
const state = reactive({
|
|
32398
32396
|
selectedOp: "=",
|
|
32399
32397
|
inputVal: ""
|
|
@@ -32537,6 +32535,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32537
32535
|
modelValue: state.inputVal,
|
|
32538
32536
|
"onUpdate:modelValue": (v) => state.inputVal = v,
|
|
32539
32537
|
placeholder: "",
|
|
32538
|
+
maxlength: 50,
|
|
32540
32539
|
style: "margin-top: 4px; width: 100%"
|
|
32541
32540
|
});
|
|
32542
32541
|
};
|
|
@@ -32552,14 +32551,22 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32552
32551
|
alignItems: "center",
|
|
32553
32552
|
gap: "4px",
|
|
32554
32553
|
cursor: "default"
|
|
32555
|
-
}
|
|
32554
|
+
},
|
|
32555
|
+
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
32556
|
+
}, ["stop"])),
|
|
32557
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
32558
|
+
}, ["stop"]))
|
|
32556
32559
|
},
|
|
32557
32560
|
[
|
|
32561
|
+
createCommentVNode(" @mousedown.stop / @click.stop \u963B\u6B62 el-table <th> \u7684 handleHeaderClick \u548C\u5217 resize \u4E8B\u4EF6\u7A7F\u900F "),
|
|
32558
32562
|
createCommentVNode(" \u6807\u7B7E\u5185\u5BB9 "),
|
|
32559
32563
|
createElementVNode(
|
|
32560
32564
|
"span",
|
|
32561
32565
|
{
|
|
32562
|
-
class: normalizeClass(["yc-header-filter-cell__label", {
|
|
32566
|
+
class: normalizeClass(["yc-header-filter-cell__label", {
|
|
32567
|
+
"yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value,
|
|
32568
|
+
"yc-header-filter-cell__label--active": isAscActive.value || isDescActive.value || isActive.value
|
|
32569
|
+
}]),
|
|
32563
32570
|
style: {
|
|
32564
32571
|
userSelect: "none",
|
|
32565
32572
|
cursor: "pointer"
|
|
@@ -32658,19 +32665,35 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32658
32665
|
class: "yc-header-filter-cell__sort",
|
|
32659
32666
|
style: {
|
|
32660
32667
|
display: "inline-flex",
|
|
32668
|
+
flexDirection: "column",
|
|
32661
32669
|
alignItems: "center",
|
|
32662
|
-
cursor: "pointer"
|
|
32670
|
+
cursor: "pointer",
|
|
32671
|
+
lineHeight: 1
|
|
32663
32672
|
},
|
|
32664
32673
|
onClick: withModifiers(cycleSort, ["stop"])
|
|
32665
32674
|
}, [
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
size:
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32675
|
+
createCommentVNode(" \u5347\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
|
|
32676
|
+
createVNode(unref(ElIcon), {
|
|
32677
|
+
size: 10,
|
|
32678
|
+
style: normalizeStyle({ color: isAscActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)", marginBottom: "-4px" })
|
|
32679
|
+
}, {
|
|
32680
|
+
default: withCtx(() => [
|
|
32681
|
+
createVNode(unref(caret_top_default))
|
|
32682
|
+
]),
|
|
32683
|
+
_: 1
|
|
32684
|
+
/* STABLE */
|
|
32685
|
+
}, 8, ["style"]),
|
|
32686
|
+
createCommentVNode(" \u964D\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
|
|
32687
|
+
createVNode(unref(ElIcon), {
|
|
32688
|
+
size: 10,
|
|
32689
|
+
style: normalizeStyle({ color: isDescActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)" })
|
|
32690
|
+
}, {
|
|
32691
|
+
default: withCtx(() => [
|
|
32692
|
+
createVNode(unref(caret_bottom_default))
|
|
32693
|
+
]),
|
|
32694
|
+
_: 1
|
|
32695
|
+
/* STABLE */
|
|
32696
|
+
}, 8, ["style"])
|
|
32674
32697
|
]),
|
|
32675
32698
|
createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
|
|
32676
32699
|
!_ctx.disableFilter ? (openBlock(), createBlock(unref(ElPopover), {
|
|
@@ -32679,25 +32702,24 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32679
32702
|
placement: "bottom-start",
|
|
32680
32703
|
width: 220,
|
|
32681
32704
|
visible: popVisible.value,
|
|
32705
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => popVisible.value = $event),
|
|
32682
32706
|
"popper-class": "yc-header-filter-pop",
|
|
32683
32707
|
"popper-style": { zIndex: 4e3 }
|
|
32684
32708
|
}, {
|
|
32685
32709
|
reference: withCtx(() => [
|
|
32686
|
-
createElementVNode("span",
|
|
32687
|
-
style: { cursor: "pointer", display: "inline-flex", alignItems: "center" },
|
|
32688
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => popVisible.value = !popVisible.value, ["stop"]))
|
|
32689
|
-
}, [
|
|
32710
|
+
createElementVNode("span", _hoisted_3$8, [
|
|
32690
32711
|
createVNode(unref(YcSvgIcon), {
|
|
32691
32712
|
src: filterIconUrl.value,
|
|
32692
32713
|
size: 14,
|
|
32714
|
+
color: isActive.value ? "var(--el-color-primary)" : "currentColor",
|
|
32693
32715
|
class: normalizeClass({ "yc-header-filter-cell__filter-icon--active": isActive.value })
|
|
32694
|
-
}, null, 8, ["src", "class"])
|
|
32716
|
+
}, null, 8, ["src", "color", "class"])
|
|
32695
32717
|
])
|
|
32696
32718
|
]),
|
|
32697
32719
|
default: withCtx(() => [
|
|
32698
|
-
createElementVNode("div",
|
|
32720
|
+
createElementVNode("div", _hoisted_4$6, [
|
|
32699
32721
|
createCommentVNode(" \u64CD\u4F5C\u7B26\u5217\u8868 "),
|
|
32700
|
-
createElementVNode("div",
|
|
32722
|
+
createElementVNode("div", _hoisted_5$6, [
|
|
32701
32723
|
(openBlock(true), createElementBlock(
|
|
32702
32724
|
Fragment,
|
|
32703
32725
|
null,
|
|
@@ -32724,8 +32746,8 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32724
32746
|
1
|
|
32725
32747
|
/* TEXT */
|
|
32726
32748
|
),
|
|
32727
|
-
state.selectedOp === op.code ? (openBlock(), createElementBlock("span",
|
|
32728
|
-
], 12,
|
|
32749
|
+
state.selectedOp === op.code ? (openBlock(), createElementBlock("span", _hoisted_7$4, "\u2713")) : createCommentVNode("v-if", true)
|
|
32750
|
+
], 12, _hoisted_6$5);
|
|
32729
32751
|
}),
|
|
32730
32752
|
128
|
|
32731
32753
|
/* KEYED_FRAGMENT */
|
|
@@ -32734,7 +32756,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32734
32756
|
createCommentVNode(" \u503C\u8F93\u5165 "),
|
|
32735
32757
|
needValueInput.value ? (openBlock(), createBlock(resolveDynamicComponent(renderValueField), { key: 0 })) : createCommentVNode("v-if", true),
|
|
32736
32758
|
createCommentVNode(" \u64CD\u4F5C\u6309\u94AE "),
|
|
32737
|
-
createElementVNode("div",
|
|
32759
|
+
createElementVNode("div", _hoisted_8$3, [
|
|
32738
32760
|
createVNode(unref(ElButton), { onClick: handleReset }, {
|
|
32739
32761
|
default: withCtx(() => [
|
|
32740
32762
|
createTextVNode("\u91CD\u7F6E")
|
|
@@ -32759,14 +32781,14 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
32759
32781
|
/* STABLE */
|
|
32760
32782
|
}, 8, ["visible"])) : createCommentVNode("v-if", true)
|
|
32761
32783
|
],
|
|
32762
|
-
|
|
32763
|
-
/* NEED_PATCH */
|
|
32784
|
+
544
|
|
32785
|
+
/* NEED_HYDRATION, NEED_PATCH */
|
|
32764
32786
|
);
|
|
32765
32787
|
};
|
|
32766
32788
|
}
|
|
32767
32789
|
});
|
|
32768
32790
|
|
|
32769
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
32791
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-3330af37"], ["__file", "header-filter-cell.vue"]]);
|
|
32770
32792
|
|
|
32771
32793
|
const DEFAULT_PAGE_SIZE = 20;
|
|
32772
32794
|
const COLUMN_CACHE_PREFIX = "yc-column-settings:";
|
|
@@ -33270,6 +33292,153 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
33270
33292
|
|
|
33271
33293
|
var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-c7557953"], ["__file", "index.vue"]]);
|
|
33272
33294
|
|
|
33295
|
+
function compareValues(a, b) {
|
|
33296
|
+
if (a == null && b == null) return 0;
|
|
33297
|
+
if (a == null) return -1;
|
|
33298
|
+
if (b == null) return 1;
|
|
33299
|
+
const numA = Number(a);
|
|
33300
|
+
const numB = Number(b);
|
|
33301
|
+
if (!isNaN(numA) && !isNaN(numB)) return numA - numB;
|
|
33302
|
+
return String(a).localeCompare(String(b), "zh-CN");
|
|
33303
|
+
}
|
|
33304
|
+
function matchFilter(value, op, filterValue) {
|
|
33305
|
+
const strValue = String(value != null ? value : "").toLowerCase();
|
|
33306
|
+
const strFilter = String(filterValue != null ? filterValue : "").toLowerCase();
|
|
33307
|
+
switch (op) {
|
|
33308
|
+
case "=":
|
|
33309
|
+
return strValue === strFilter;
|
|
33310
|
+
case "!=":
|
|
33311
|
+
return strValue !== strFilter;
|
|
33312
|
+
case "like":
|
|
33313
|
+
return strValue.includes(strFilter);
|
|
33314
|
+
case "not like":
|
|
33315
|
+
return !strValue.includes(strFilter);
|
|
33316
|
+
case ">":
|
|
33317
|
+
return Number(value) > Number(filterValue);
|
|
33318
|
+
case ">=":
|
|
33319
|
+
return Number(value) >= Number(filterValue);
|
|
33320
|
+
case "<":
|
|
33321
|
+
return Number(value) < Number(filterValue);
|
|
33322
|
+
case "<=":
|
|
33323
|
+
return Number(value) <= Number(filterValue);
|
|
33324
|
+
case "is null":
|
|
33325
|
+
case "empty":
|
|
33326
|
+
return value == null || strValue === "";
|
|
33327
|
+
case "is not null":
|
|
33328
|
+
case "not_empty":
|
|
33329
|
+
return value != null && strValue !== "";
|
|
33330
|
+
case "in": {
|
|
33331
|
+
const set = strFilter.split(",").map((s) => s.trim().toLowerCase());
|
|
33332
|
+
return set.includes(strValue);
|
|
33333
|
+
}
|
|
33334
|
+
case "not in": {
|
|
33335
|
+
const set = strFilter.split(",").map((s) => s.trim().toLowerCase());
|
|
33336
|
+
return !set.includes(strValue);
|
|
33337
|
+
}
|
|
33338
|
+
case "between": {
|
|
33339
|
+
let parts = strFilter.split(",").map((s) => Number(s.trim()));
|
|
33340
|
+
if (parts.length < 2 || isNaN(parts[0]) || isNaN(parts[1])) {
|
|
33341
|
+
const hyphenMatch = strFilter.match(/^(-?\d+(?:\.\d+)?)-(-?\d+(?:\.\d+)?)$/);
|
|
33342
|
+
if (hyphenMatch) {
|
|
33343
|
+
parts = [Number(hyphenMatch[1]), Number(hyphenMatch[2])];
|
|
33344
|
+
}
|
|
33345
|
+
}
|
|
33346
|
+
const num = Number(value);
|
|
33347
|
+
return parts.length === 2 && !isNaN(num) && !isNaN(parts[0]) && !isNaN(parts[1]) && num >= parts[0] && num <= parts[1];
|
|
33348
|
+
}
|
|
33349
|
+
case "is true":
|
|
33350
|
+
return value === true || strValue === "true" || strValue === "1";
|
|
33351
|
+
case "is false":
|
|
33352
|
+
return value === false || strValue === "false" || strValue === "0";
|
|
33353
|
+
default:
|
|
33354
|
+
return true;
|
|
33355
|
+
}
|
|
33356
|
+
}
|
|
33357
|
+
function useLocalHeaderFilter(data, options) {
|
|
33358
|
+
const fieldCatalog = computed(() => {
|
|
33359
|
+
const cols = options == null ? void 0 : options.filterableColumns;
|
|
33360
|
+
if (!(cols == null ? void 0 : cols.length)) return {};
|
|
33361
|
+
const catalog = {};
|
|
33362
|
+
for (const col of cols) {
|
|
33363
|
+
catalog[col.prop] = {
|
|
33364
|
+
type: col.type || "string",
|
|
33365
|
+
filter: true,
|
|
33366
|
+
allowedField: col.prop
|
|
33367
|
+
};
|
|
33368
|
+
}
|
|
33369
|
+
return catalog;
|
|
33370
|
+
});
|
|
33371
|
+
const {
|
|
33372
|
+
headerFiltersState,
|
|
33373
|
+
orderByState,
|
|
33374
|
+
upsertHeaderFilter,
|
|
33375
|
+
removeHeaderFilter,
|
|
33376
|
+
setOrderBy,
|
|
33377
|
+
getOpsByProp,
|
|
33378
|
+
isEnabled: _isEnabled
|
|
33379
|
+
} = useHeaderFilter({
|
|
33380
|
+
headerFilterConfig: () => ({
|
|
33381
|
+
enabled: true,
|
|
33382
|
+
fieldCatalog: fieldCatalog.value
|
|
33383
|
+
}),
|
|
33384
|
+
hideHeaderFilter: () => false
|
|
33385
|
+
});
|
|
33386
|
+
const filteredData = computed(() => {
|
|
33387
|
+
let result = [...unref(data) || []];
|
|
33388
|
+
if (headerFiltersState.filters.length > 0) {
|
|
33389
|
+
result = result.filter((row) => {
|
|
33390
|
+
const record = row;
|
|
33391
|
+
return headerFiltersState.filters.every(
|
|
33392
|
+
(filter) => matchFilter(record[filter.field], filter.op, filter.value)
|
|
33393
|
+
);
|
|
33394
|
+
});
|
|
33395
|
+
}
|
|
33396
|
+
if (orderByState.length > 0) {
|
|
33397
|
+
result.sort((a, b) => {
|
|
33398
|
+
const recA = a;
|
|
33399
|
+
const recB = b;
|
|
33400
|
+
for (const order of orderByState) {
|
|
33401
|
+
const cmp = compareValues(recA[order.field], recB[order.field]);
|
|
33402
|
+
if (cmp !== 0) return order.direction === "asc" ? cmp : -cmp;
|
|
33403
|
+
}
|
|
33404
|
+
return 0;
|
|
33405
|
+
});
|
|
33406
|
+
}
|
|
33407
|
+
return result;
|
|
33408
|
+
});
|
|
33409
|
+
const handleFilterConfirm = (payload) => {
|
|
33410
|
+
var _a;
|
|
33411
|
+
const field = String(((_a = payload.column) == null ? void 0 : _a.prop) || "");
|
|
33412
|
+
upsertHeaderFilter(field, payload.op, payload.value);
|
|
33413
|
+
};
|
|
33414
|
+
const handleFilterReset = (payload) => {
|
|
33415
|
+
var _a;
|
|
33416
|
+
const field = String(((_a = payload.column) == null ? void 0 : _a.prop) || "");
|
|
33417
|
+
removeHeaderFilter(field);
|
|
33418
|
+
};
|
|
33419
|
+
const handleSortChange = (payload) => {
|
|
33420
|
+
setOrderBy(payload.field, payload.direction);
|
|
33421
|
+
};
|
|
33422
|
+
const resetAllFilters = () => {
|
|
33423
|
+
headerFiltersState.filters.splice(0);
|
|
33424
|
+
orderByState.splice(0);
|
|
33425
|
+
};
|
|
33426
|
+
const hasActiveFilters = computed(() => {
|
|
33427
|
+
return headerFiltersState.filters.length > 0 || orderByState.length > 0;
|
|
33428
|
+
});
|
|
33429
|
+
return {
|
|
33430
|
+
filteredData,
|
|
33431
|
+
headerFiltersState,
|
|
33432
|
+
orderByState,
|
|
33433
|
+
handleFilterConfirm,
|
|
33434
|
+
handleFilterReset,
|
|
33435
|
+
handleSortChange,
|
|
33436
|
+
getOpsByProp,
|
|
33437
|
+
resetAllFilters,
|
|
33438
|
+
hasActiveFilters
|
|
33439
|
+
};
|
|
33440
|
+
}
|
|
33441
|
+
|
|
33273
33442
|
const YcPlusPage = YcPlusPageComponent;
|
|
33274
33443
|
const YcTableHeaderFilterCell = YcTableHeaderFilterCellComponent;
|
|
33275
33444
|
const RePlusPage = YcPlusPageComponent;
|
|
@@ -63630,4 +63799,4 @@ const version = "0.0.13";
|
|
|
63630
63799
|
|
|
63631
63800
|
const install = installer.install;
|
|
63632
63801
|
|
|
63633
|
-
export { DEFAULT_CDN_CONFIG, DEFAULT_OPERATORS, DEFAULT_YC_CONFIG, DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, DictStoreInjectionKey, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusVirtualTable, YcAnimateSelector as ReAnimateSelector, YcAuth as ReAuth, YcBatchImportDialog as ReBatchImportDialog, YcCard as ReCard, YcCol as ReCol, YcConfigProvider as ReConfigProvider, ReDialog, YcDownloadDialog as ReDownloadDialog, ReDrawer, ReFormContainerHeader, YcLineTree as ReLineTree, ReMoreActions, YcCountTo as ReNormalCountTo, YcPerms as RePerms, RePlusPage, RePlusTree, YcSegmented as ReSegmented, YcSelectV2 as ReSelectV2, YcStatusDialog as ReStatusDialog, YcSvgIcon as ReSvgIcon, YcTabsWithFilter as ReTabsWithFilter, YcText as ReText, YcReboundCountTo as ReboundCountTo, SIZE_MAP, STATUS_CONFIG_MAP, TableColumnsEmptyTextInjectionKey, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, YC_CONFIG_KEY, YcAnimateSelector, YcAnimateSelectorWithInstall, YcAuth, YcAuthWithInstall, YcBatchImportDialog, YcBatchImportDialogWithInstall, YcCard, YcCardWithInstall, YcCol, YcConfigProvider, YcCountTo, YcDialog, YcDownloadDialog, YcDownloadDialogWithInstall, YcDrawer, YcFlicker, YcFormContainerHeader, YcLineTree, YcLineTreeWithInstall, YcMoreActions, YcPerms, YcPermsWithInstall, YcPlusPage, YcPlusTree, YcReboundCountTo, YcReboundCountToWithInstall, YcSegmented, YcSegmentedWithInstall, YcSelectV2, YcStatusDialog, YcSvgIcon, YcTableHeaderFilterCell, YcTabsWithFilter, YcTabsWithFilterWithInstall, YcText, YcTextWithInstall, addDrawer, animates, closeAllDrawer, closeDrawer, createDictStore, installer as default, drawerStore, findNodeById, findNodeByPath, findNodePosition, insertAsChild, insertAsSibling, insertNodeAtPosition, install, providePlusProConfig, removeNode, reorderNodeChildren, reorderSiblingNodes, selectValueTypeList, updateDrawer, useColumnAdapter, useDialogFormConfig, useDictInjection, useDrawerFormConfig, useGetOptions, useHeaderFilter, useLocale, usePlusFormReset, usePlusProConfig, useRenderFlicker, useRenderFlicker as useRenderReFlicker, useSelectWithMapping, useSelectWithPagination, useSortableDrag$1 as useSortableDrag, useTable, useVirtualScroll, useVirtualSelection, useYcAuth, useYcCdn, useYcCdnUrl, useYcComponentConfig, useYcConfig, useYcPerms, useYcShowPageSearch, useYcTranslate, version };
|
|
63802
|
+
export { DEFAULT_CDN_CONFIG, DEFAULT_OPERATORS, DEFAULT_YC_CONFIG, DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, DictStoreInjectionKey, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusVirtualTable, YcAnimateSelector as ReAnimateSelector, YcAuth as ReAuth, YcBatchImportDialog as ReBatchImportDialog, YcCard as ReCard, YcCol as ReCol, YcConfigProvider as ReConfigProvider, ReDialog, YcDownloadDialog as ReDownloadDialog, ReDrawer, ReFormContainerHeader, YcLineTree as ReLineTree, ReMoreActions, YcCountTo as ReNormalCountTo, YcPerms as RePerms, RePlusPage, RePlusTree, YcSegmented as ReSegmented, YcSelectV2 as ReSelectV2, YcStatusDialog as ReStatusDialog, YcSvgIcon as ReSvgIcon, YcTabsWithFilter as ReTabsWithFilter, YcText as ReText, YcReboundCountTo as ReboundCountTo, SIZE_MAP, STATUS_CONFIG_MAP, TableColumnsEmptyTextInjectionKey, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, YC_CONFIG_KEY, YcAnimateSelector, YcAnimateSelectorWithInstall, YcAuth, YcAuthWithInstall, YcBatchImportDialog, YcBatchImportDialogWithInstall, YcCard, YcCardWithInstall, YcCol, YcConfigProvider, YcCountTo, YcDialog, YcDownloadDialog, YcDownloadDialogWithInstall, YcDrawer, YcFlicker, YcFormContainerHeader, YcLineTree, YcLineTreeWithInstall, YcMoreActions, YcPerms, YcPermsWithInstall, YcPlusPage, YcPlusTree, YcReboundCountTo, YcReboundCountToWithInstall, YcSegmented, YcSegmentedWithInstall, YcSelectV2, YcStatusDialog, YcSvgIcon, YcTableHeaderFilterCell, YcTabsWithFilter, YcTabsWithFilterWithInstall, YcText, YcTextWithInstall, addDrawer, animates, closeAllDrawer, closeDrawer, createDictStore, installer as default, drawerStore, findNodeById, findNodeByPath, findNodePosition, insertAsChild, insertAsSibling, insertNodeAtPosition, install, providePlusProConfig, removeNode, reorderNodeChildren, reorderSiblingNodes, selectValueTypeList, updateDrawer, useColumnAdapter, useDialogFormConfig, useDictInjection, useDrawerFormConfig, useGetOptions, useHeaderFilter, useLocalHeaderFilter, useLocale, usePlusFormReset, usePlusProConfig, useRenderFlicker, useRenderFlicker as useRenderReFlicker, useSelectWithMapping, useSelectWithPagination, useSortableDrag$1 as useSortableDrag, useTable, useVirtualScroll, useVirtualSelection, useYcAuth, useYcCdn, useYcCdnUrl, useYcComponentConfig, useYcConfig, useYcPerms, useYcShowPageSearch, useYcTranslate, version };
|
package/lib/components/index.js
CHANGED
|
@@ -49,6 +49,7 @@ var useVirtualScroll = require('./virtual-table/src/use-virtual-scroll.js');
|
|
|
49
49
|
var type = require('./yc-config-provider/src/type.js');
|
|
50
50
|
var useYcConfig = require('./yc-config-provider/src/useYcConfig.js');
|
|
51
51
|
var useHeaderFilter = require('./yc-plus-page/src/use-header-filter.js');
|
|
52
|
+
var useLocalHeaderFilter = require('./yc-plus-page/src/use-local-header-filter.js');
|
|
52
53
|
var constants = require('./yc-plus-page/src/constants.js');
|
|
53
54
|
var index$p = require('./yc-select-v2/src/index.vue.js');
|
|
54
55
|
var treeDataUtils = require('./yc-plus-tree/src/treeDataUtils.js');
|
|
@@ -144,6 +145,7 @@ exports.useYcPerms = useYcConfig.useYcPerms;
|
|
|
144
145
|
exports.useYcShowPageSearch = useYcConfig.useYcShowPageSearch;
|
|
145
146
|
exports.useYcTranslate = useYcConfig.useYcTranslate;
|
|
146
147
|
exports.useHeaderFilter = useHeaderFilter.useHeaderFilter;
|
|
148
|
+
exports.useLocalHeaderFilter = useLocalHeaderFilter.useLocalHeaderFilter;
|
|
147
149
|
exports.DEFAULT_OPERATORS = constants.DEFAULT_OPERATORS;
|
|
148
150
|
exports.NO_VALUE_OPERATORS = constants.NO_VALUE_OPERATORS;
|
|
149
151
|
exports.OPERATOR_CATALOG = constants.OPERATOR_CATALOG;
|
|
@@ -4,6 +4,8 @@ import { DefineComponent } from 'vue';
|
|
|
4
4
|
export type { YcPlusPageProps, FieldCatalogItem, FieldCatalog, OperatorOption, HeaderFilterConfig, ColumnHeaderFilterConfig, HeaderFilterPayload, HeaderFilterResetPayload, FilterItem, HeaderFiltersState, OrderByItem, RequestResponse } from './src/type';
|
|
5
5
|
export { useHeaderFilter } from './src/use-header-filter';
|
|
6
6
|
export type { UseHeaderFilterOptions, UseHeaderFilterReturn } from './src/use-header-filter';
|
|
7
|
+
export { useLocalHeaderFilter } from './src/use-local-header-filter';
|
|
8
|
+
export type { LocalFilterColumnConfig, UseLocalHeaderFilterOptions, UseLocalHeaderFilterReturn } from './src/use-local-header-filter';
|
|
7
9
|
export { OPERATOR_CATALOG, OPERATOR_LABELS, NO_VALUE_OPERATORS, DEFAULT_OPERATORS } from './src/constants';
|
|
8
10
|
export type YcPlusPageInstance = InstanceType<typeof YcPlusPageComponent>;
|
|
9
11
|
export declare const YcPlusPage: DefineComponent;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var index = require('./src/index.vue.js');
|
|
4
4
|
var headerFilterCell = require('./src/header-filter-cell.vue.js');
|
|
5
5
|
var useHeaderFilter = require('./src/use-header-filter.js');
|
|
6
|
+
var useLocalHeaderFilter = require('./src/use-local-header-filter.js');
|
|
6
7
|
var constants = require('./src/constants.js');
|
|
7
8
|
|
|
8
9
|
const YcPlusPage = index.default;
|
|
@@ -10,6 +11,7 @@ const YcTableHeaderFilterCell = headerFilterCell.default;
|
|
|
10
11
|
const RePlusPage = index.default;
|
|
11
12
|
|
|
12
13
|
exports.useHeaderFilter = useHeaderFilter.useHeaderFilter;
|
|
14
|
+
exports.useLocalHeaderFilter = useLocalHeaderFilter.useLocalHeaderFilter;
|
|
13
15
|
exports.DEFAULT_OPERATORS = constants.DEFAULT_OPERATORS;
|
|
14
16
|
exports.NO_VALUE_OPERATORS = constants.NO_VALUE_OPERATORS;
|
|
15
17
|
exports.OPERATOR_CATALOG = constants.OPERATOR_CATALOG;
|
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var headerFilterCell_vue_vue_type_script_setup_true_lang = require('./header-filter-cell.vue2.js');
|
|
6
6
|
var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
|
|
7
7
|
|
|
8
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(headerFilterCell_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
8
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(headerFilterCell_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-3330af37"], ["__file", "header-filter-cell.vue"]]);
|
|
9
9
|
|
|
10
10
|
exports.default = YcTableHeaderFilterCellComponent;
|