@v-c/table 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Body/MeasureRow.js
CHANGED
|
@@ -8,6 +8,21 @@ import isVisible from "@v-c/util/dist/Dom/isVisible";
|
|
|
8
8
|
function _isSlot(s) {
|
|
9
9
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
10
10
|
}
|
|
11
|
+
function cloneTitle(title) {
|
|
12
|
+
if (Array.isArray(title)) return title.map((node) => cloneTitle(node));
|
|
13
|
+
if (isVNode(title)) {
|
|
14
|
+
const cloned = cloneVNode(title, { ref: void 0 });
|
|
15
|
+
let children = cloned.children;
|
|
16
|
+
if (cloned.children?.default && typeof cloned.children.default === "function") {
|
|
17
|
+
children = filterEmpty(cloned.children?.default?.());
|
|
18
|
+
if (Array.isArray(children)) children = children.map((child) => cloneTitle(child));
|
|
19
|
+
else if (isVNode(children)) children = cloneTitle(children);
|
|
20
|
+
cloned.children.default = () => children;
|
|
21
|
+
} else if (Array.isArray(children)) cloned.children = children.map((child) => cloneTitle(child));
|
|
22
|
+
return cloned;
|
|
23
|
+
}
|
|
24
|
+
return title;
|
|
25
|
+
}
|
|
11
26
|
var MeasureRow = /* @__PURE__ */ defineComponent({
|
|
12
27
|
name: "TableMeasureRow",
|
|
13
28
|
props: [
|
|
@@ -21,21 +36,6 @@ var MeasureRow = /* @__PURE__ */ defineComponent({
|
|
|
21
36
|
const { measureRowRender } = useInjectTableContext();
|
|
22
37
|
return () => {
|
|
23
38
|
let _slot;
|
|
24
|
-
const cloneTitle = (title) => {
|
|
25
|
-
if (Array.isArray(title)) return title.map((node) => cloneTitle(node));
|
|
26
|
-
if (isVNode(title)) {
|
|
27
|
-
const cloned = cloneVNode(title, { ref: void 0 });
|
|
28
|
-
let children = cloned.children;
|
|
29
|
-
if (cloned.children?.default && typeof cloned.children.default === "function") {
|
|
30
|
-
children = filterEmpty(cloned.children?.default?.());
|
|
31
|
-
if (Array.isArray(children)) children = children.map((child) => cloneTitle(child));
|
|
32
|
-
else if (isVNode(children)) children = cloneTitle(children);
|
|
33
|
-
cloned.children.default = () => children;
|
|
34
|
-
} else if (Array.isArray(children)) cloned.children = children.map((child) => cloneTitle(child));
|
|
35
|
-
return cloned;
|
|
36
|
-
}
|
|
37
|
-
return title;
|
|
38
|
-
};
|
|
39
39
|
const measureRow = createVNode("tr", {
|
|
40
40
|
"aria-hidden": "true",
|
|
41
41
|
"class": `${props.prefixCls}-measure-row`,
|
package/dist/Cell/index.js
CHANGED
|
@@ -85,9 +85,9 @@ var Cell = /* @__PURE__ */ defineComponent({
|
|
|
85
85
|
return typeof props.fixEnd === "number" && !tableContext.allColumnsFixedLeft;
|
|
86
86
|
});
|
|
87
87
|
const shadowInfo = computed(() => {
|
|
88
|
+
if (!isFixStart.value && !isFixEnd.value) return [false, false];
|
|
88
89
|
const { fixedEndShadow, offsetFixedStartShadow, offsetFixedEndShadow, fixedStartShadow } = props;
|
|
89
90
|
const [absScroll = 0, scrollWidth = 0] = tableContext.scrollInfo || [];
|
|
90
|
-
if (!isFixStart.value && !isFixEnd.value) return [false, false];
|
|
91
91
|
return [isFixStart.value && fixedStartShadow ? absScroll - (offsetFixedStartShadow || 0) >= 1 : false, isFixEnd && fixedEndShadow ? scrollWidth - absScroll - (offsetFixedEndShadow || 0) > 1 : false];
|
|
92
92
|
});
|
|
93
93
|
return () => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { ColumnType, StickyOffsets } from '../interface';
|
|
3
|
-
export default function useFixedInfo<RecordType>(flattenColumns: Ref<readonly ColumnType<RecordType>[]> | readonly ColumnType<RecordType>[], stickyOffsets: Ref<StickyOffsets> | StickyOffsets):
|
|
3
|
+
export default function useFixedInfo<RecordType>(flattenColumns: Ref<readonly ColumnType<RecordType>[]> | readonly ColumnType<RecordType>[], stickyOffsets: Ref<StickyOffsets> | StickyOffsets): import('vue').Ref<import('../utils/fixUtil').FixedInfo[], import('../utils/fixUtil').FixedInfo[]>;
|
|
@@ -8,7 +8,7 @@ export default function useRowInfo<RecordType>(record: Ref<RecordType> | RecordT
|
|
|
8
8
|
rowSupportExpand: import('vue').ComputedRef<boolean>;
|
|
9
9
|
expandable: import('vue').ComputedRef<boolean>;
|
|
10
10
|
rowProps: import('vue').ComputedRef<{
|
|
11
|
-
className:
|
|
11
|
+
className: string;
|
|
12
12
|
onClick: (event: MouseEvent) => void;
|
|
13
13
|
innerHTML?: string | undefined | undefined;
|
|
14
14
|
class?: any;
|
package/dist/sugar/Column.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/table",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.4",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"vue": "^3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@v-c/resize-observer": "^1.1.0",
|
|
24
23
|
"@v-c/util": "^1.0.19",
|
|
25
|
-
"@v-c/
|
|
24
|
+
"@v-c/resize-observer": "^1.1.0",
|
|
25
|
+
"@v-c/virtual-list": "^1.0.8"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|