@antelopejs/dms 0.21.1 → 0.21.2-next.995.gbe11414
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/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +4 -20
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPinning.ts +0 -11
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentScroll.ts +1 -15
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +4 -13
- package/package.json +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/scrollEdges.ts +0 -30
- package/frontend-vue/layers/dms-ui/app/entries/composables/table/utils/scrollEdges.ts +0 -1
|
@@ -135,7 +135,6 @@ const skeletonWidth = (rowIndex: number, columnIndex: number): string =>
|
|
|
135
135
|
const {
|
|
136
136
|
hasScrollArea,
|
|
137
137
|
isScrolled,
|
|
138
|
-
scrollEdges,
|
|
139
138
|
onTableScroll,
|
|
140
139
|
tableRootRef,
|
|
141
140
|
tableViewportWidth,
|
|
@@ -187,7 +186,6 @@ const reorderHandles = useReorderHandles({
|
|
|
187
186
|
});
|
|
188
187
|
|
|
189
188
|
const {
|
|
190
|
-
scrollFadeInsets,
|
|
191
189
|
getPinnedLeftOffset,
|
|
192
190
|
getPinnedRightOffset,
|
|
193
191
|
getPinnedVariant,
|
|
@@ -419,9 +417,9 @@ const bodyContext = computed<TableBodyContext<T>>(() => ({
|
|
|
419
417
|
}));
|
|
420
418
|
|
|
421
419
|
/**
|
|
422
|
-
* The rows, rendered outside this component's own render: the header
|
|
423
|
-
*
|
|
424
|
-
*
|
|
420
|
+
* The rows, rendered outside this component's own render: the header and the
|
|
421
|
+
* measured widths re-render the table, and the rows follow only when their
|
|
422
|
+
* context changes.
|
|
425
423
|
*/
|
|
426
424
|
const TableBodyOutlet = () =>
|
|
427
425
|
h(TableBody<T>, { context: bodyContext.value }, slots);
|
|
@@ -567,7 +565,7 @@ defineShortcuts({
|
|
|
567
565
|
<span :class="uiTable.loadingBarIndicator()" />
|
|
568
566
|
</div>
|
|
569
567
|
|
|
570
|
-
<div
|
|
568
|
+
<div :class="uiTable.tableBase()">
|
|
571
569
|
<table :class="uiTable.table()">
|
|
572
570
|
<caption v-if="caption" :class="uiTable.tableCaption()">
|
|
573
571
|
{{ caption }}
|
|
@@ -642,20 +640,6 @@ defineShortcuts({
|
|
|
642
640
|
</table>
|
|
643
641
|
</div>
|
|
644
642
|
</section>
|
|
645
|
-
<span
|
|
646
|
-
v-if="scrollEdges.start"
|
|
647
|
-
aria-hidden="true"
|
|
648
|
-
data-table-scroll-fade="start"
|
|
649
|
-
:class="uiTable.scrollFade({ side: 'start' })"
|
|
650
|
-
:style="{ insetInlineStart: `${scrollFadeInsets.start}px` }"
|
|
651
|
-
/>
|
|
652
|
-
<span
|
|
653
|
-
v-if="scrollEdges.end"
|
|
654
|
-
aria-hidden="true"
|
|
655
|
-
data-table-scroll-fade="end"
|
|
656
|
-
:class="uiTable.scrollFade({ side: 'end' })"
|
|
657
|
-
:style="{ insetInlineEnd: `${scrollFadeInsets.end}px` }"
|
|
658
|
-
/>
|
|
659
643
|
</div>
|
|
660
644
|
|
|
661
645
|
<TablePagination />
|
|
@@ -20,16 +20,6 @@ export function useTableComponentPinning<T>(
|
|
|
20
20
|
const stickyLeft = computed(() => stickyPinnedSides.value.left);
|
|
21
21
|
const stickyRight = computed(() => stickyPinnedSides.value.right);
|
|
22
22
|
|
|
23
|
-
const scrollFadeInsets = computed(() => {
|
|
24
|
-
const sides = stickyPinnedSides.value;
|
|
25
|
-
return {
|
|
26
|
-
start:
|
|
27
|
-
(sides.left ? getTable().getLeftTotalSize() : 0) +
|
|
28
|
-
(hasPresenceRail.value ? PRESENCE_RAIL_WIDTH : 0),
|
|
29
|
-
end: sides.right ? getTable().getRightTotalSize() : 0,
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
23
|
const getStickyPin = (column: Pick<Column<T>, "getIsPinned">) => {
|
|
34
24
|
const pinned = column.getIsPinned();
|
|
35
25
|
if (pinned === "left" && stickyLeft.value) return "left";
|
|
@@ -84,7 +74,6 @@ export function useTableComponentPinning<T>(
|
|
|
84
74
|
};
|
|
85
75
|
|
|
86
76
|
return {
|
|
87
|
-
scrollFadeInsets,
|
|
88
77
|
getPinnedLeftOffset,
|
|
89
78
|
getPinnedRightOffset,
|
|
90
79
|
getPinnedVariant,
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { computed,
|
|
1
|
+
import { computed, ref, useTemplateRef } from "vue";
|
|
2
2
|
import { useElementSize } from "@vueuse/core";
|
|
3
|
-
import {
|
|
4
|
-
horizontalScrollEdges,
|
|
5
|
-
type ScrollEdges,
|
|
6
|
-
} from "../../composables/table/utils/scrollEdges";
|
|
7
3
|
import type { Data, TableProps } from "./Table.types";
|
|
8
4
|
|
|
9
5
|
export function useTableComponentScroll<T extends Data>(props: TableProps<T>) {
|
|
10
6
|
const hasScrollArea = computed(() => !!props.maxHeight);
|
|
11
7
|
const isScrolled = ref(false);
|
|
12
8
|
|
|
13
|
-
const scrollEdges = reactive<ScrollEdges>({ start: false, end: false });
|
|
14
|
-
const syncScrollEdges = () => {
|
|
15
|
-
const area = tableRootRef.value;
|
|
16
|
-
if (area) Object.assign(scrollEdges, horizontalScrollEdges(area));
|
|
17
|
-
};
|
|
18
9
|
const onTableScroll = (event: Event) => {
|
|
19
|
-
syncScrollEdges();
|
|
20
10
|
if (!hasScrollArea.value) return;
|
|
21
11
|
const { target } = event;
|
|
22
12
|
isScrolled.value = target instanceof Element && target.scrollTop > 0;
|
|
@@ -24,9 +14,6 @@ export function useTableComponentScroll<T extends Data>(props: TableProps<T>) {
|
|
|
24
14
|
|
|
25
15
|
const tableRootRef = useTemplateRef<HTMLElement>("tableRoot");
|
|
26
16
|
const { width: tableViewportWidth } = useElementSize(tableRootRef);
|
|
27
|
-
const tableBaseRef = useTemplateRef<HTMLElement>("tableBase");
|
|
28
|
-
const { width: tableContentWidth } = useElementSize(tableBaseRef);
|
|
29
|
-
watch([tableViewportWidth, tableContentWidth], syncScrollEdges);
|
|
30
17
|
|
|
31
18
|
const tableHeadRef = useTemplateRef<HTMLElement>("tableHead");
|
|
32
19
|
const { height: tableHeadHeight } = useElementSize(tableHeadRef, undefined, {
|
|
@@ -57,7 +44,6 @@ export function useTableComponentScroll<T extends Data>(props: TableProps<T>) {
|
|
|
57
44
|
return {
|
|
58
45
|
hasScrollArea,
|
|
59
46
|
isScrolled,
|
|
60
|
-
scrollEdges,
|
|
61
47
|
onTableScroll,
|
|
62
48
|
tableRootRef,
|
|
63
49
|
tableViewportWidth,
|
|
@@ -43,7 +43,6 @@ const theme = tv({
|
|
|
43
43
|
|
|
44
44
|
scrollFrame: "relative",
|
|
45
45
|
|
|
46
|
-
scrollFade: "pointer-events-none absolute inset-y-0 z-30 w-3",
|
|
47
46
|
tableRoot: "relative overflow-x-auto whitespace-nowrap",
|
|
48
47
|
tableBase: "inline-block min-w-full align-middle",
|
|
49
48
|
table: "text-default w-full min-w-full table-fixed text-left text-[13px]/5",
|
|
@@ -125,12 +124,12 @@ const theme = tv({
|
|
|
125
124
|
},
|
|
126
125
|
pinned: {
|
|
127
126
|
left: {
|
|
128
|
-
headCell: `${HEADER_MATCH_BG} sticky z-10
|
|
129
|
-
rowCell: `${PANEL_MATCH_BG} ${ROW_SELECTED_CELL_BG} ${ROW_EXPANDED_CELL_BG} ${ROW_OPEN_CELL_BG} group-data-[presence=true]:bg-elevated sticky z-10
|
|
127
|
+
headCell: `${HEADER_MATCH_BG} sticky z-10`,
|
|
128
|
+
rowCell: `${PANEL_MATCH_BG} ${ROW_SELECTED_CELL_BG} ${ROW_EXPANDED_CELL_BG} ${ROW_OPEN_CELL_BG} group-data-[presence=true]:bg-elevated sticky z-10`,
|
|
130
129
|
},
|
|
131
130
|
right: {
|
|
132
|
-
headCell: `${HEADER_MATCH_BG} sticky z-10
|
|
133
|
-
rowCell: `${PANEL_MATCH_BG} ${ROW_SELECTED_CELL_BG} ${ROW_EXPANDED_CELL_BG} ${ROW_OPEN_CELL_BG} group-data-[presence=true]:bg-elevated sticky z-10
|
|
131
|
+
headCell: `${HEADER_MATCH_BG} sticky z-10`,
|
|
132
|
+
rowCell: `${PANEL_MATCH_BG} ${ROW_SELECTED_CELL_BG} ${ROW_EXPANDED_CELL_BG} ${ROW_OPEN_CELL_BG} group-data-[presence=true]:bg-elevated sticky z-10`,
|
|
134
133
|
},
|
|
135
134
|
},
|
|
136
135
|
|
|
@@ -153,14 +152,6 @@ const theme = tv({
|
|
|
153
152
|
scrolled: {
|
|
154
153
|
true: "",
|
|
155
154
|
},
|
|
156
|
-
side: {
|
|
157
|
-
start: {
|
|
158
|
-
scrollFade: "shadow-[inset_12px_0_10px_-10px_rgb(0_0_0/0.28)]",
|
|
159
|
-
},
|
|
160
|
-
end: {
|
|
161
|
-
scrollFade: "shadow-[inset_-12px_0_10px_-10px_rgb(0_0_0/0.28)]",
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
155
|
|
|
165
156
|
archived: {
|
|
166
157
|
true: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2-next.995.gbe11414",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"optional": true
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
|
-
"gitHead": "
|
|
212
|
+
"gitHead": "be1141445820725ac0c50e0565b152770def9851",
|
|
213
213
|
"scripts": {
|
|
214
214
|
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p bin/tsconfig.types.json",
|
|
215
215
|
"dev": "ajs project run --inspect -w -p playground",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** Which sides of a scroll area hide content the reader can scroll to. */
|
|
2
|
-
export interface ScrollEdges {
|
|
3
|
-
start: boolean;
|
|
4
|
-
end: boolean;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/** What {@link horizontalScrollEdges} reads off a scroll area. */
|
|
8
|
-
export interface HorizontalScroll {
|
|
9
|
-
scrollLeft: number;
|
|
10
|
-
scrollWidth: number;
|
|
11
|
-
clientWidth: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const EDGE_TOLERANCE_PX = 1;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The sides of a table wider than its card that still hide columns: a phone
|
|
18
|
-
* shows the first columns, and nothing else would tell that the rest are a
|
|
19
|
-
* swipe away. The scroll position is read as the reader sees it, so a
|
|
20
|
-
* right-to-left page (negative `scrollLeft`) reads the same.
|
|
21
|
-
*/
|
|
22
|
-
export function horizontalScrollEdges(area: HorizontalScroll): ScrollEdges {
|
|
23
|
-
const hidden = area.scrollWidth - area.clientWidth;
|
|
24
|
-
if (hidden <= EDGE_TOLERANCE_PX) return { start: false, end: false };
|
|
25
|
-
const scrolled = Math.abs(area.scrollLeft);
|
|
26
|
-
return {
|
|
27
|
-
start: scrolled > EDGE_TOLERANCE_PX,
|
|
28
|
-
end: scrolled < hidden - EDGE_TOLERANCE_PX,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../../build/composables/table/utils/scrollEdges";
|