x-next 1.11.1 → 1.12.0
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/AI_USAGE/catalog.md +1 -1
- package/AI_USAGE/components/alert.md +1 -1
- package/AI_USAGE/components/bar-chart.md +1 -1
- package/AI_USAGE/components/button.md +1 -1
- package/AI_USAGE/components/checkbox.md +1 -1
- package/AI_USAGE/components/color-picker.md +1 -1
- package/AI_USAGE/components/config-provider.md +1 -1
- package/AI_USAGE/components/date-picker.md +1 -1
- package/AI_USAGE/components/dialog.md +1 -1
- package/AI_USAGE/components/dropdown.md +1 -1
- package/AI_USAGE/components/empty.md +1 -1
- package/AI_USAGE/components/input.md +1 -1
- package/AI_USAGE/components/line-chart.md +1 -1
- package/AI_USAGE/components/message-box.md +1 -1
- package/AI_USAGE/components/message.md +1 -1
- package/AI_USAGE/components/notification.md +1 -1
- package/AI_USAGE/components/pagination.md +1 -1
- package/AI_USAGE/components/pie-chart.md +1 -1
- package/AI_USAGE/components/popconfirm.md +1 -1
- package/AI_USAGE/components/popover.md +1 -1
- package/AI_USAGE/components/progress.md +1 -1
- package/AI_USAGE/components/radio.md +1 -1
- package/AI_USAGE/components/rate.md +1 -1
- package/AI_USAGE/components/select.md +1 -1
- package/AI_USAGE/components/slider.md +1 -1
- package/AI_USAGE/components/steps.md +1 -1
- package/AI_USAGE/components/switch.md +1 -1
- package/AI_USAGE/components/tabs.md +1 -1
- package/AI_USAGE/components/textarea.md +1 -1
- package/AI_USAGE/components/time-picker.md +1 -1
- package/AI_USAGE/components/upload.md +1 -1
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +1 -1
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +2 -2
- package/CHANGELOG.md +18 -0
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/table/Table.d.ts +11 -0
- package/dist/components/table/context.d.ts +5 -0
- package/dist/components/table/dom-listeners.d.ts +23 -0
- package/dist/components/table/hooks/use-column-resize.d.ts +2 -1
- package/dist/components/table/hooks/use-drag.d.ts +6 -3
- package/dist/components/table/hooks/use-keyboard-navigation.d.ts +27 -0
- package/dist/components/table/hooks/use-sorter.d.ts +3 -1
- package/dist/components/table/index.d.ts +15 -0
- package/dist/components/table/interface.d.ts +9 -2
- package/dist/components/table/locale.d.ts +8 -7
- package/dist/components/table/table-operation-td.d.ts +34 -0
- package/dist/components/table/table-td.d.ts +36 -2
- package/dist/components/table/table-th.d.ts +34 -0
- package/dist/components/table/table-tr.d.ts +34 -0
- package/dist/components/trend-chart/components/TrendChart.d.ts +1 -1
- package/dist/components/trend-chart/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +1 -1
- package/dist/components/upload/index.d.ts +3 -3
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/locale/zh-cn.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/advancedFormat.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/quarterOfYear.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekOfYear.js +1 -1
- package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekYear.js +1 -1
- package/dist/es/_container/resize-observer-v2.js +1 -1
- package/dist/es/_container/resize-observer.js +1 -1
- package/dist/es/_hooks/use-resize-observer.js +1 -1
- package/dist/es/_virtual/advancedFormat.js +1 -1
- package/dist/es/_virtual/customParseFormat.js +1 -1
- package/dist/es/_virtual/dayjs.min.js +1 -1
- package/dist/es/_virtual/isBetween.js +1 -1
- package/dist/es/_virtual/quarterOfYear.js +1 -1
- package/dist/es/_virtual/weekOfYear.js +1 -1
- package/dist/es/_virtual/weekYear.js +1 -1
- package/dist/es/_virtual/zh-cn.js +1 -1
- package/dist/es/components/draggable/useDraggable.js +1 -1
- package/dist/es/components/form/Form.vue2.js +1 -1
- package/dist/es/components/form/FormItem.vue2.js +1 -1
- package/dist/es/components/form-input-number/InputNumber.js +1 -1
- package/dist/es/components/form-slider/Slider.vue2.js +1 -1
- package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
- package/dist/es/components/form-slider/utils.js +1 -1
- package/dist/es/components/menu/MenuItem.js +1 -1
- package/dist/es/components/menu/overflow-wrap.js +1 -1
- package/dist/es/components/progress/circle.vue2.js +1 -1
- package/dist/es/components/progress/line.vue2.js +1 -1
- package/dist/es/components/progress/steps.vue2.js +1 -1
- package/dist/es/components/rate/Rate.js +1 -1
- package/dist/es/components/table/Table.js +947 -713
- package/dist/es/components/table/dom-listeners.js +23 -0
- package/dist/es/components/table/hooks/use-column-resize.js +27 -18
- package/dist/es/components/table/hooks/use-column-sorter.js +22 -29
- package/dist/es/components/table/hooks/use-drag.js +23 -20
- package/dist/es/components/table/hooks/use-filter.js +43 -43
- package/dist/es/components/table/hooks/use-keyboard-navigation.js +69 -0
- package/dist/es/components/table/hooks/use-row-selection.js +33 -29
- package/dist/es/components/table/hooks/use-sorter.js +86 -38
- package/dist/es/components/table/hooks/use-span.js +28 -35
- package/dist/es/components/table/locale.js +27 -10
- package/dist/es/components/table/table-col-group.vue2.js +9 -9
- package/dist/es/components/table/table-operation-td.js +72 -51
- package/dist/es/components/table/table-operation-th.js +41 -34
- package/dist/es/components/table/table-td.js +100 -77
- package/dist/es/components/table/table-th.js +221 -188
- package/dist/es/components/table/table-tr.js +11 -8
- package/dist/es/components/table/utils.js +104 -94
- package/dist/es/components/virtual-list-v2/hooks/use-size.js +47 -41
- package/dist/es/components/virtual-list-v2/virtual-list-item.js +29 -16
- package/dist/es/locale/en-US.js +7 -1
- package/dist/es/locale/index.js +3 -3
- package/dist/es/locale/zh-CN.js +7 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/locale/interface.d.ts +9 -0
- package/dist/style/table.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/is.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/locale/en-US.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/array.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/base.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/boolean.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/custom.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/number.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/object.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/string.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/type.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/util.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js +0 -0
- /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +0 -0
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Checkbox as
|
|
3
|
-
import { Radio as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Trigger as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useColumnSorter as
|
|
10
|
-
import { useColumnFilter as
|
|
11
|
-
import { getStyle as
|
|
12
|
-
import { isObject as
|
|
13
|
-
import
|
|
14
|
-
import { tableInjectionKey as
|
|
15
|
-
import
|
|
16
|
-
import { getClassNameMixin as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
function
|
|
20
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
1
|
+
import { defineComponent as ae, toRefs as re, useId as ue, ref as ce, computed as m, inject as me, watch as se, nextTick as de, createVNode as i, mergeProps as M, isVNode as fe } from "vue";
|
|
2
|
+
import { Checkbox as ve } from "../form-checkbox/index.js";
|
|
3
|
+
import { Radio as he } from "../form-radio/index.js";
|
|
4
|
+
import { Button as E } from "../button/index.js";
|
|
5
|
+
import { Trigger as ge } from "../trigger/index.js";
|
|
6
|
+
import ye from "../../icons/default/down.js";
|
|
7
|
+
import Ce from "../../icons/default/up.js";
|
|
8
|
+
import xe from "../../icons/default/filter.js";
|
|
9
|
+
import { useColumnSorter as Se } from "./hooks/use-column-sorter.js";
|
|
10
|
+
import { useColumnFilter as we } from "./hooks/use-column-filter.js";
|
|
11
|
+
import { getStyle as Fe, getFixedCls as Ie } from "./utils.js";
|
|
12
|
+
import { isObject as be, isBoolean as Te, isFunction as ke } from "../../_utils/is.js";
|
|
13
|
+
import De from "../_components/icon-hover/index.vue.js";
|
|
14
|
+
import { tableInjectionKey as Pe } from "./context.js";
|
|
15
|
+
import Ve from "../_components/auto-tooltip/auto-tooltip.js";
|
|
16
|
+
import { getClassNameMixin as ze } from "../../_utils/config.js";
|
|
17
|
+
import { useTableLocale as Ae } from "./locale.js";
|
|
18
|
+
import { tableDomListeners as Be, getTableDomListeners as Le } from "./dom-listeners.js";
|
|
19
|
+
function b(t) {
|
|
20
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !fe(t);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const Ye = /* @__PURE__ */ ae({
|
|
23
23
|
name: "Th",
|
|
24
|
+
inheritAttrs: !1,
|
|
24
25
|
props: {
|
|
26
|
+
...Be,
|
|
25
27
|
column: {
|
|
26
28
|
type: Object,
|
|
27
29
|
default: () => ({})
|
|
@@ -37,234 +39,265 @@ const Ge = /* @__PURE__ */ Y({
|
|
|
37
39
|
resizable: Boolean
|
|
38
40
|
},
|
|
39
41
|
setup(t, {
|
|
40
|
-
attrs:
|
|
41
|
-
slots:
|
|
42
|
+
attrs: R,
|
|
43
|
+
slots: v
|
|
42
44
|
}) {
|
|
43
45
|
const {
|
|
44
|
-
column:
|
|
45
|
-
} =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
currentColumnText: h("table.currentColumnText"),
|
|
51
|
-
filterLabelText: h("table.filterLabelText")
|
|
52
|
-
}, u = te(Ce, {}), z = a(() => {
|
|
46
|
+
column: T
|
|
47
|
+
} = re(t), o = ze("table"), h = `${ue()}-filter-popup`, k = ce();
|
|
48
|
+
let D = !1;
|
|
49
|
+
const d = Ae(), _ = m(() => d("resizeColumnText", {
|
|
50
|
+
column: typeof t.column.title == "string" ? t.column.title : t.column.dataIndex ?? d("currentColumnText")
|
|
51
|
+
})), r = me(Pe, {}), W = m(() => {
|
|
53
52
|
var e;
|
|
54
|
-
return ((e = t.column) == null ? void 0 : e.dataIndex) &&
|
|
55
|
-
}),
|
|
53
|
+
return ((e = t.column) == null ? void 0 : e.dataIndex) && r.resizingColumn === t.column.dataIndex;
|
|
54
|
+
}), $ = m(() => {
|
|
56
55
|
var e;
|
|
57
|
-
if (
|
|
56
|
+
if (be((e = t.column) == null ? void 0 : e.tooltip))
|
|
58
57
|
return t.column.tooltip;
|
|
59
|
-
}),
|
|
58
|
+
}), g = m(() => {
|
|
60
59
|
var e;
|
|
61
|
-
return (e = t.column) != null && e.filterable &&
|
|
60
|
+
return (e = t.column) != null && e.filterable && Te(t.column.filterable.alignLeft) ? t.column.filterable.alignLeft : r.filterIconAlignLeft;
|
|
62
61
|
}), {
|
|
63
|
-
sortOrder:
|
|
64
|
-
hasSorter:
|
|
65
|
-
hasAscendBtn:
|
|
66
|
-
hasDescendBtn:
|
|
67
|
-
nextSortOrder:
|
|
62
|
+
sortOrder: y,
|
|
63
|
+
hasSorter: f,
|
|
64
|
+
hasAscendBtn: G,
|
|
65
|
+
hasDescendBtn: q,
|
|
66
|
+
nextSortOrder: P,
|
|
68
67
|
handleClickSorter: V
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
tableCtx: u
|
|
68
|
+
} = Se({
|
|
69
|
+
column: T,
|
|
70
|
+
tableCtx: r
|
|
73
71
|
}), {
|
|
74
|
-
filterPopupVisible:
|
|
75
|
-
isFilterActive:
|
|
76
|
-
isMultipleFilter:
|
|
77
|
-
columnFilterValue:
|
|
78
|
-
handleFilterPopupVisibleChange:
|
|
79
|
-
setFilterValue:
|
|
80
|
-
handleCheckboxFilterChange:
|
|
81
|
-
handleRadioFilterChange:
|
|
72
|
+
filterPopupVisible: s,
|
|
73
|
+
isFilterActive: H,
|
|
74
|
+
isMultipleFilter: U,
|
|
75
|
+
columnFilterValue: C,
|
|
76
|
+
handleFilterPopupVisibleChange: z,
|
|
77
|
+
setFilterValue: I,
|
|
78
|
+
handleCheckboxFilterChange: p,
|
|
79
|
+
handleRadioFilterChange: J,
|
|
82
80
|
handleFilterConfirm: x,
|
|
83
|
-
handleFilterReset:
|
|
84
|
-
} =
|
|
85
|
-
column:
|
|
86
|
-
tableCtx:
|
|
87
|
-
}),
|
|
88
|
-
var
|
|
81
|
+
handleFilterReset: S
|
|
82
|
+
} = we({
|
|
83
|
+
column: T,
|
|
84
|
+
tableCtx: r
|
|
85
|
+
}), A = () => {
|
|
86
|
+
var e;
|
|
87
|
+
return (e = k.value) == null ? void 0 : e.$el;
|
|
88
|
+
};
|
|
89
|
+
se(s, async (e) => {
|
|
90
|
+
var c, u;
|
|
91
|
+
const n = A(), l = n == null ? void 0 : n.ownerDocument.getElementById(h);
|
|
92
|
+
!e && (l == null ? void 0 : l.contains((n == null ? void 0 : n.ownerDocument.activeElement) ?? null)) && (n == null || n.focus()), await de(), e && D && ((u = (c = n == null ? void 0 : n.ownerDocument.getElementById(h)) == null ? void 0 : c.querySelector('input:not(:disabled),button:not(:disabled),[tabindex="0"]')) == null || u.focus());
|
|
93
|
+
});
|
|
94
|
+
const B = (e) => {
|
|
95
|
+
var n;
|
|
96
|
+
e.stopPropagation(), e.key === "Escape" && s.value && (e.preventDefault(), z(!1), (n = A()) == null || n.focus());
|
|
97
|
+
}, Q = () => {
|
|
98
|
+
var a, c, u, K, O;
|
|
99
|
+
let e, n;
|
|
89
100
|
const {
|
|
90
|
-
filterable:
|
|
101
|
+
filterable: l
|
|
91
102
|
} = t.column;
|
|
92
|
-
return (
|
|
93
|
-
filterValue:
|
|
94
|
-
setFilterValue:
|
|
103
|
+
return (a = t.column.slots) != null && a["filter-content"] ? (c = t.column.slots) == null ? void 0 : c["filter-content"]({
|
|
104
|
+
filterValue: C.value,
|
|
105
|
+
setFilterValue: I,
|
|
95
106
|
handleFilterConfirm: x,
|
|
96
|
-
handleFilterReset:
|
|
97
|
-
}) :
|
|
98
|
-
filterValue:
|
|
99
|
-
setFilterValue:
|
|
107
|
+
handleFilterReset: S
|
|
108
|
+
}) : l != null && l.slotName ? (K = (u = r == null ? void 0 : r.slots) == null ? void 0 : u[l == null ? void 0 : l.slotName]) == null ? void 0 : K.call(u, {
|
|
109
|
+
filterValue: C.value,
|
|
110
|
+
setFilterValue: I,
|
|
100
111
|
handleFilterConfirm: x,
|
|
101
|
-
handleFilterReset:
|
|
102
|
-
}) :
|
|
103
|
-
filterValue:
|
|
104
|
-
setFilterValue:
|
|
112
|
+
handleFilterReset: S
|
|
113
|
+
}) : l != null && l.renderContent ? l.renderContent({
|
|
114
|
+
filterValue: C.value,
|
|
115
|
+
setFilterValue: I,
|
|
105
116
|
handleFilterConfirm: x,
|
|
106
|
-
handleFilterReset:
|
|
107
|
-
}) :
|
|
108
|
-
class:
|
|
109
|
-
}, [
|
|
110
|
-
class:
|
|
111
|
-
}, [(
|
|
112
|
-
class:
|
|
113
|
-
key:
|
|
114
|
-
}, [
|
|
115
|
-
value:
|
|
116
|
-
modelValue:
|
|
117
|
+
handleFilterReset: S
|
|
118
|
+
}) : i("div", {
|
|
119
|
+
class: o.element("filters--content")
|
|
120
|
+
}, [i("ul", {
|
|
121
|
+
class: o.element("filters--list")
|
|
122
|
+
}, [(O = l == null ? void 0 : l.filters) == null ? void 0 : O.map((w, ie) => i("li", {
|
|
123
|
+
class: o.element("filters--item"),
|
|
124
|
+
key: ie
|
|
125
|
+
}, [U.value ? i(ve, {
|
|
126
|
+
value: w.value,
|
|
127
|
+
modelValue: C.value,
|
|
117
128
|
uninjectGroupContext: !0,
|
|
118
|
-
onChange:
|
|
129
|
+
onChange: (F) => {
|
|
130
|
+
Array.isArray(F) && p(F.map(String));
|
|
131
|
+
}
|
|
119
132
|
}, {
|
|
120
|
-
default: () => [
|
|
121
|
-
}) :
|
|
122
|
-
|
|
123
|
-
|
|
133
|
+
default: () => [w.text]
|
|
134
|
+
}) : i(he, {
|
|
135
|
+
name: h,
|
|
136
|
+
value: w.value,
|
|
137
|
+
modelValue: C.value[0] ?? "",
|
|
124
138
|
uninjectGroupContext: !0,
|
|
125
|
-
onChange:
|
|
139
|
+
onChange: (F) => J(String(F))
|
|
126
140
|
}, {
|
|
127
|
-
default: () => [
|
|
128
|
-
})]))]),
|
|
129
|
-
class:
|
|
130
|
-
}, [
|
|
141
|
+
default: () => [w.text]
|
|
142
|
+
})]))]), i("div", {
|
|
143
|
+
class: o.element("filters--bottom")
|
|
144
|
+
}, [i(E, {
|
|
131
145
|
size: "mini",
|
|
132
|
-
onClick:
|
|
133
|
-
}, {
|
|
134
|
-
default: () => [
|
|
135
|
-
}),
|
|
146
|
+
onClick: S
|
|
147
|
+
}, b(e = d("resetText")) ? e : {
|
|
148
|
+
default: () => [e]
|
|
149
|
+
}), i(E, {
|
|
136
150
|
type: "primary",
|
|
137
151
|
size: "mini",
|
|
138
152
|
onClick: x
|
|
139
|
-
}, {
|
|
140
|
-
default: () => [
|
|
153
|
+
}, b(n = d("okText")) ? n : {
|
|
154
|
+
default: () => [n]
|
|
141
155
|
})])]);
|
|
142
|
-
},
|
|
143
|
-
const e = t.column.title,
|
|
144
|
-
return
|
|
145
|
-
column:
|
|
156
|
+
}, L = m(() => {
|
|
157
|
+
const e = t.column.title, n = String(typeof e == "string" || typeof e == "number" ? e : t.column.dataIndex ?? d("currentColumnText"));
|
|
158
|
+
return d("filterLabelText", {
|
|
159
|
+
column: n
|
|
146
160
|
});
|
|
147
|
-
}),
|
|
148
|
-
id:
|
|
161
|
+
}), X = () => i("div", {
|
|
162
|
+
id: h,
|
|
149
163
|
role: "dialog",
|
|
150
|
-
"aria-label":
|
|
151
|
-
|
|
164
|
+
"aria-label": L.value,
|
|
165
|
+
"aria-hidden": !s.value,
|
|
166
|
+
inert: !s.value || void 0,
|
|
167
|
+
onKeydown: B
|
|
168
|
+
}, [Q()]), N = () => {
|
|
152
169
|
const {
|
|
153
170
|
filterable: e
|
|
154
171
|
} = t.column;
|
|
155
|
-
return e ?
|
|
156
|
-
popupVisible:
|
|
172
|
+
return e ? i(ge, M({
|
|
173
|
+
popupVisible: s.value,
|
|
157
174
|
trigger: "click",
|
|
158
175
|
autoFitPosition: !0,
|
|
159
|
-
popupOffset:
|
|
160
|
-
onPopupVisibleChange:
|
|
176
|
+
popupOffset: g.value ? 4 : 0,
|
|
177
|
+
onPopupVisibleChange: z
|
|
161
178
|
}, e.triggerProps), {
|
|
162
|
-
default: () => [
|
|
179
|
+
default: () => [i(De, {
|
|
180
|
+
ref: k,
|
|
163
181
|
as: "button",
|
|
164
|
-
"aria-label":
|
|
182
|
+
"aria-label": L.value,
|
|
165
183
|
"aria-haspopup": "dialog",
|
|
166
|
-
"aria-expanded": String(
|
|
167
|
-
"aria-controls":
|
|
168
|
-
class: [
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
[
|
|
184
|
+
"aria-expanded": String(s.value),
|
|
185
|
+
"aria-controls": h,
|
|
186
|
+
class: [o.element("filters"), {
|
|
187
|
+
[o.element("filters-active")]: H.value,
|
|
188
|
+
[o.element("filters-open")]: s.value,
|
|
189
|
+
[o.element("filters-align-left")]: g.value
|
|
172
190
|
}],
|
|
173
|
-
onClick: (
|
|
174
|
-
|
|
191
|
+
onClick: (n) => {
|
|
192
|
+
D = n.detail === 0, n.stopPropagation();
|
|
193
|
+
},
|
|
194
|
+
onKeydown: B
|
|
175
195
|
}, {
|
|
176
196
|
default: () => {
|
|
177
|
-
var
|
|
178
|
-
return [((
|
|
197
|
+
var n, l, a;
|
|
198
|
+
return [((l = (n = t.column.slots) == null ? void 0 : n["filter-icon"]) == null ? void 0 : l.call(n)) ?? ((a = e.icon) == null ? void 0 : a.call(e)) ?? i(xe, null, null)];
|
|
179
199
|
}
|
|
180
200
|
})],
|
|
181
|
-
content:
|
|
201
|
+
content: X
|
|
182
202
|
}) : null;
|
|
183
|
-
},
|
|
184
|
-
var
|
|
185
|
-
const e = [
|
|
186
|
-
return
|
|
187
|
-
[
|
|
188
|
-
[
|
|
189
|
-
}),
|
|
190
|
-
}),
|
|
191
|
-
var e,
|
|
192
|
-
return
|
|
203
|
+
}, Y = m(() => {
|
|
204
|
+
var n;
|
|
205
|
+
const e = [o.element("cell"), o.element(`cell-align-${((n = t.column) == null ? void 0 : n.align) ?? (t.column.children ? "center" : "left")}`)];
|
|
206
|
+
return f.value && e.push(o.element("cell-with-sorter"), {
|
|
207
|
+
[o.element("cell-next-ascend")]: P.value === "ascend",
|
|
208
|
+
[o.element("cell-next-descend")]: P.value === "descend"
|
|
209
|
+
}), g.value && e.push(o.element("cell-with-filter")), e;
|
|
210
|
+
}), j = () => {
|
|
211
|
+
var e, n, l, a, c, u;
|
|
212
|
+
return v.default ? v.default() : (e = t.column) != null && e.titleSlotName && ((n = r.slots) != null && n[t.column.titleSlotName]) ? (a = (l = r.slots)[t.column.titleSlotName]) == null ? void 0 : a.call(l, {
|
|
193
213
|
column: t.column
|
|
194
|
-
}) : (
|
|
195
|
-
},
|
|
196
|
-
var
|
|
214
|
+
}) : (u = (c = t.column) == null ? void 0 : c.slots) != null && u.title ? t.column.slots.title() : ke(t.column.title) ? t.column.title() : t.column.title;
|
|
215
|
+
}, Z = () => {
|
|
216
|
+
var n, l, a;
|
|
197
217
|
let e;
|
|
198
|
-
return
|
|
199
|
-
class:
|
|
200
|
-
onClick:
|
|
201
|
-
}, [(
|
|
202
|
-
class:
|
|
203
|
-
tooltipProps:
|
|
204
|
-
},
|
|
218
|
+
return i("span", {
|
|
219
|
+
class: Y.value,
|
|
220
|
+
onClick: f.value ? V : void 0
|
|
221
|
+
}, [(n = t.column) != null && n.ellipsis && ((l = t.column) != null && l.tooltip) ? i(Ve, {
|
|
222
|
+
class: o.element("th--title"),
|
|
223
|
+
tooltipProps: $.value
|
|
224
|
+
}, b(e = j()) ? e : {
|
|
205
225
|
default: () => [e]
|
|
206
|
-
}) :
|
|
207
|
-
class: [
|
|
208
|
-
[
|
|
226
|
+
}) : i("span", {
|
|
227
|
+
class: [o.element("th--title"), {
|
|
228
|
+
[o.modifier("text-ellipsis")]: (a = t.column) == null ? void 0 : a.ellipsis
|
|
209
229
|
}]
|
|
210
|
-
}, [
|
|
211
|
-
class:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
230
|
+
}, [j()]), f.value && i("span", {
|
|
231
|
+
class: o.element("sorter"),
|
|
232
|
+
"aria-hidden": "true"
|
|
233
|
+
}, [G.value && i("div", {
|
|
234
|
+
class: [o.element("sorter--icon"), {
|
|
235
|
+
[o.element("sorter--icon-active")]: y.value === "ascend"
|
|
215
236
|
}]
|
|
216
|
-
}, [
|
|
217
|
-
class: [
|
|
218
|
-
[
|
|
237
|
+
}, [i(Ce, null, null)]), q.value && i("div", {
|
|
238
|
+
class: [o.element("sorter--icon"), {
|
|
239
|
+
[o.element("sorter--icon-active")]: y.value === "descend"
|
|
219
240
|
}]
|
|
220
|
-
}, [
|
|
221
|
-
},
|
|
222
|
-
if (
|
|
223
|
-
return
|
|
224
|
-
}),
|
|
225
|
-
|
|
226
|
-
},
|
|
227
|
-
var e,
|
|
241
|
+
}, [i(ye, null, null)])]), g.value && N()]);
|
|
242
|
+
}, ee = m(() => {
|
|
243
|
+
if (f.value)
|
|
244
|
+
return y.value === "ascend" ? "ascending" : y.value === "descend" ? "descending" : "none";
|
|
245
|
+
}), te = (e) => {
|
|
246
|
+
f.value && e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), V(e));
|
|
247
|
+
}, ne = m(() => {
|
|
248
|
+
var e, n;
|
|
228
249
|
return {
|
|
229
|
-
...
|
|
250
|
+
...Fe(t.column, {
|
|
230
251
|
dataColumns: t.dataColumns,
|
|
231
252
|
operations: t.operations
|
|
232
253
|
}),
|
|
233
254
|
...(e = t.column) == null ? void 0 : e.cellStyle,
|
|
234
|
-
...(
|
|
255
|
+
...(n = t.column) == null ? void 0 : n.headerCellStyle
|
|
235
256
|
};
|
|
236
|
-
}),
|
|
237
|
-
var e,
|
|
238
|
-
return [
|
|
239
|
-
[
|
|
240
|
-
[
|
|
241
|
-
}, ...
|
|
242
|
-
}),
|
|
243
|
-
var
|
|
244
|
-
(
|
|
257
|
+
}), le = m(() => {
|
|
258
|
+
var e, n;
|
|
259
|
+
return [o.element("th"), {
|
|
260
|
+
[o.element("col-sorted")]: !!y.value,
|
|
261
|
+
[o.element("th-resizing")]: W.value
|
|
262
|
+
}, ...Ie(o.block, t.column), (e = t.column) == null ? void 0 : e.cellClass, (n = t.column) == null ? void 0 : n.headerCellClass];
|
|
263
|
+
}), oe = (e) => {
|
|
264
|
+
var n, l, a;
|
|
265
|
+
(n = t.column) != null && n.dataIndex && ((a = r.onThMouseDown) == null || a.call(r, (l = t.column) == null ? void 0 : l.dataIndex, e));
|
|
245
266
|
};
|
|
246
267
|
return () => {
|
|
247
|
-
var
|
|
248
|
-
const e = t.column.colSpan ?? 1,
|
|
249
|
-
return
|
|
268
|
+
var l, a;
|
|
269
|
+
const e = t.column.colSpan ?? 1, n = t.column.rowSpan ?? 1;
|
|
270
|
+
return i(((l = v.th) == null ? void 0 : l.call(v, {
|
|
250
271
|
column: t.column
|
|
251
|
-
})[0]) ?? "th",
|
|
252
|
-
class:
|
|
253
|
-
style:
|
|
272
|
+
})[0]) ?? "th", M(R, Le(t), {
|
|
273
|
+
class: le.value,
|
|
274
|
+
style: ne.value,
|
|
254
275
|
colspan: e > 1 ? e : void 0,
|
|
255
|
-
rowspan:
|
|
256
|
-
tabindex:
|
|
257
|
-
"aria-sort":
|
|
258
|
-
|
|
276
|
+
rowspan: n > 1 ? n : void 0,
|
|
277
|
+
tabindex: f.value ? 0 : void 0,
|
|
278
|
+
"aria-sort": ee.value,
|
|
279
|
+
scope: (a = t.column.children) != null && a.length ? "colgroup" : "col",
|
|
280
|
+
onKeydown: te
|
|
259
281
|
}), {
|
|
260
|
-
default: () => [
|
|
261
|
-
class:
|
|
262
|
-
|
|
282
|
+
default: () => [Z(), !g.value && N(), t.resizable && i("span", {
|
|
283
|
+
class: o.element("column-handle"),
|
|
284
|
+
role: "separator",
|
|
285
|
+
tabindex: 0,
|
|
286
|
+
"aria-orientation": "vertical",
|
|
287
|
+
"aria-label": _.value,
|
|
288
|
+
"aria-valuemin": Math.max(40, t.column.minWidth ?? 40),
|
|
289
|
+
"aria-valuenow": t.column._resizeWidth ?? t.column.width,
|
|
290
|
+
onMousedown: oe,
|
|
291
|
+
onClick: (c) => c.stopPropagation(),
|
|
292
|
+
onKeydown: (c) => {
|
|
293
|
+
var u;
|
|
294
|
+
t.column.dataIndex && ((u = r.onThKeyDown) == null || u.call(r, t.column.dataIndex, c));
|
|
295
|
+
}
|
|
263
296
|
}, null)]
|
|
264
297
|
});
|
|
265
298
|
};
|
|
266
299
|
}
|
|
267
300
|
});
|
|
268
301
|
export {
|
|
269
|
-
|
|
302
|
+
Ye as default
|
|
270
303
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getClassNameMixin as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as d, computed as c, createVNode as l, mergeProps as i } from "vue";
|
|
2
|
+
import { getClassNameMixin as p } from "../../_utils/config.js";
|
|
3
|
+
import { tableDomListeners as u, getTableDomListeners as f } from "./dom-listeners.js";
|
|
4
|
+
const s = /* @__PURE__ */ d({
|
|
4
5
|
name: "Tr",
|
|
6
|
+
inheritAttrs: !1,
|
|
5
7
|
props: {
|
|
8
|
+
...u,
|
|
6
9
|
expand: {
|
|
7
10
|
type: Boolean
|
|
8
11
|
},
|
|
@@ -19,10 +22,10 @@ const y = /* @__PURE__ */ m({
|
|
|
19
22
|
}
|
|
20
23
|
},
|
|
21
24
|
setup(e, {
|
|
22
|
-
attrs:
|
|
25
|
+
attrs: m,
|
|
23
26
|
slots: t
|
|
24
27
|
}) {
|
|
25
|
-
const r =
|
|
28
|
+
const r = p("table"), o = c(() => [r.element("tr"), {
|
|
26
29
|
[r.element("tr-expand")]: e.expand,
|
|
27
30
|
[r.element("tr-empty")]: e.empty,
|
|
28
31
|
[r.element("tr-checked")]: e.checked
|
|
@@ -32,8 +35,8 @@ const y = /* @__PURE__ */ m({
|
|
|
32
35
|
return l(((a = t.tr) == null ? void 0 : a.call(t, {
|
|
33
36
|
rowIndex: e.rowIndex,
|
|
34
37
|
record: (n = e.record) == null ? void 0 : n.raw
|
|
35
|
-
})[0]) ?? "tr",
|
|
36
|
-
class:
|
|
38
|
+
})[0]) ?? "tr", i(m, f(e), {
|
|
39
|
+
class: o.value
|
|
37
40
|
}), {
|
|
38
41
|
default: t.default
|
|
39
42
|
});
|
|
@@ -41,5 +44,5 @@ const y = /* @__PURE__ */ m({
|
|
|
41
44
|
}
|
|
42
45
|
});
|
|
43
46
|
export {
|
|
44
|
-
|
|
47
|
+
s as default
|
|
45
48
|
};
|