@antelopejs/dms 0.19.3 → 0.19.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/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/table/Table.vue +11 -7
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPinning.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentScroll.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +7 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.19.4
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.19.3...v0.19.4)
|
|
6
|
+
|
|
7
|
+
### 🔥 Performance
|
|
8
|
+
|
|
9
|
+
- **table:** Stop re-rendering every row after the table mounts ([#860](https://github.com/AntelopeJS/dms/pull/860))
|
|
10
|
+
|
|
11
|
+
### 🩹 Fixes
|
|
12
|
+
|
|
13
|
+
- **release:** Regenerate the dms README table when interface-dms bumps ([#855](https://github.com/AntelopeJS/dms/pull/855))
|
|
14
|
+
|
|
15
|
+
### 📦 Build
|
|
16
|
+
|
|
17
|
+
- **deps:** Take tooling-configs 0.5.3 so checks orders typecheck before lint ([#856](https://github.com/AntelopeJS/dms/pull/856))
|
|
18
|
+
|
|
19
|
+
### ❤️ Contributors
|
|
20
|
+
|
|
21
|
+
- Antony Rizzitelli ([@Upd4ting](http://github.com/Upd4ting))
|
|
22
|
+
|
|
3
23
|
## v0.19.3
|
|
4
24
|
|
|
5
25
|
[compare changes](https://github.com/AntelopeJS/dms/compare/v0.19.2...v0.19.3)
|
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ export class SalesPage extends PageController("sales", {
|
|
|
86
86
|
| `@antelopejs/interface-data-api` | `>=0.6.0 <1.0.0` | `0.6.0` |
|
|
87
87
|
| `@antelopejs/interface-database` | `>=0.3.0 <1.0.0` | `0.3.1` |
|
|
88
88
|
| `@antelopejs/interface-database-decorators` | `>=0.3.1 <1.0.0` | `0.3.1` |
|
|
89
|
-
| `@antelopejs/interface-dms` | `>=0.13.0 <0.14.0` | `
|
|
89
|
+
| `@antelopejs/interface-dms` | `>=0.13.0 <0.14.0` | `workspace` |
|
|
90
90
|
| `@antelopejs/interface-dms-automation` | `>=0.6.0 <1.0.0` | `0.6.1` |
|
|
91
91
|
| `@antelopejs/interface-email` | `>=0.0.6 <1.0.0` | `0.0.6` |
|
|
92
92
|
| `@antelopejs/interface-file-storage` | `>=0.1.4 <1.0.0` | `0.1.4` |
|
|
@@ -23,7 +23,7 @@ import { useRowScrollAnchor } from "../../composables/table/useRowScrollAnchor";
|
|
|
23
23
|
import type { TableViewDisplayCapabilities } from "../../../composables/table-view/types";
|
|
24
24
|
import { useReorderHandles } from "../../composables/table-view/useReorderHandles";
|
|
25
25
|
import { FlexRender } from "@tanstack/vue-table";
|
|
26
|
-
import { computed, shallowRef, useId,
|
|
26
|
+
import { computed, h, shallowRef, useId, watchEffect, type Slots } from "vue";
|
|
27
27
|
import { provideLocal } from "@vueuse/core";
|
|
28
28
|
import { tv } from "tailwind-variants";
|
|
29
29
|
import TableActions from "./Actions.vue";
|
|
@@ -117,7 +117,7 @@ const allMatchingState = defineModel<boolean>("allMatching", {
|
|
|
117
117
|
default: false,
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
const slots =
|
|
120
|
+
const slots = defineSlots<Slots>();
|
|
121
121
|
|
|
122
122
|
const isExpandable = !!slots.expanded;
|
|
123
123
|
|
|
@@ -421,6 +421,14 @@ const bodyContext = computed<TableBodyContext<T>>(() => ({
|
|
|
421
421
|
emptyStates: props.emptyStates,
|
|
422
422
|
}));
|
|
423
423
|
|
|
424
|
+
/**
|
|
425
|
+
* The rows, rendered outside this component's own render: the header, the
|
|
426
|
+
* scroll fades and the measured widths re-render the table, and the rows
|
|
427
|
+
* follow only when their context changes.
|
|
428
|
+
*/
|
|
429
|
+
const TableBodyOutlet = () =>
|
|
430
|
+
h(TableBody<T>, { context: bodyContext.value }, slots);
|
|
431
|
+
|
|
424
432
|
defineShortcuts({
|
|
425
433
|
delete: createTableViewDeleteShortcut(
|
|
426
434
|
hoveredRowId,
|
|
@@ -633,11 +641,7 @@ defineShortcuts({
|
|
|
633
641
|
</tr>
|
|
634
642
|
</thead>
|
|
635
643
|
|
|
636
|
-
<
|
|
637
|
-
<template v-for="(_, name) in slots" #[name]="slotData">
|
|
638
|
-
<slot :name="name" v-bind="slotData" />
|
|
639
|
-
</template>
|
|
640
|
-
</TableBody>
|
|
644
|
+
<TableBodyOutlet />
|
|
641
645
|
</table>
|
|
642
646
|
</div>
|
|
643
647
|
</section>
|
|
@@ -17,6 +17,8 @@ export function useTableComponentPinning<T>(
|
|
|
17
17
|
const keepRight = left >= right && right <= budget;
|
|
18
18
|
return { left: keepLeft, right: keepRight };
|
|
19
19
|
});
|
|
20
|
+
const stickyLeft = computed(() => stickyPinnedSides.value.left);
|
|
21
|
+
const stickyRight = computed(() => stickyPinnedSides.value.right);
|
|
20
22
|
|
|
21
23
|
const scrollFadeInsets = computed(() => {
|
|
22
24
|
const sides = stickyPinnedSides.value;
|
|
@@ -30,8 +32,8 @@ export function useTableComponentPinning<T>(
|
|
|
30
32
|
|
|
31
33
|
const getStickyPin = (column: Pick<Column<T>, "getIsPinned">) => {
|
|
32
34
|
const pinned = column.getIsPinned();
|
|
33
|
-
if (pinned === "left" &&
|
|
34
|
-
if (pinned === "right" &&
|
|
35
|
+
if (pinned === "left" && stickyLeft.value) return "left";
|
|
36
|
+
if (pinned === "right" && stickyRight.value) return "right";
|
|
35
37
|
return undefined;
|
|
36
38
|
};
|
|
37
39
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, useTemplateRef, watch } from "vue";
|
|
1
|
+
import { computed, reactive, ref, useTemplateRef, watch } from "vue";
|
|
2
2
|
import { useElementSize } from "@vueuse/core";
|
|
3
3
|
import {
|
|
4
4
|
horizontalScrollEdges,
|
|
@@ -10,10 +10,10 @@ export function useTableComponentScroll<T extends Data>(props: TableProps<T>) {
|
|
|
10
10
|
const hasScrollArea = computed(() => !!props.maxHeight);
|
|
11
11
|
const isScrolled = ref(false);
|
|
12
12
|
|
|
13
|
-
const scrollEdges =
|
|
13
|
+
const scrollEdges = reactive<ScrollEdges>({ start: false, end: false });
|
|
14
14
|
const syncScrollEdges = () => {
|
|
15
15
|
const area = tableRootRef.value;
|
|
16
|
-
if (area) scrollEdges
|
|
16
|
+
if (area) Object.assign(scrollEdges, horizontalScrollEdges(area));
|
|
17
17
|
};
|
|
18
18
|
const onTableScroll = (event: Event) => {
|
|
19
19
|
syncScrollEdges();
|
|
@@ -28,8 +28,8 @@ export interface TablePreferences {
|
|
|
28
28
|
set: <T>(field: TableField, value: T, defaultValue: T) => void;
|
|
29
29
|
/**
|
|
30
30
|
* Sets `state` to the local field's stored value once the table is
|
|
31
|
-
* mounted, unless `isValid` refuses it
|
|
32
|
-
* client render the default, so no mismatch.
|
|
31
|
+
* mounted, unless `isValid` refuses it or `state` already holds it: the
|
|
32
|
+
* server and the hydrating client render the default, so no mismatch.
|
|
33
33
|
*/
|
|
34
34
|
restore: <T>(
|
|
35
35
|
field: LocalTableField,
|
|
@@ -140,7 +140,11 @@ export function useTablePreferences(
|
|
|
140
140
|
apply: (value) => {
|
|
141
141
|
// oxlint-disable-next-line anti-slop/require-safety-comment-for-type-assertion -- Storage returns arbitrary preference values, while restore accepts caller-selected T and an optional boolean validator. Neither owner proves T; adding mandatory validation would change restoration behavior.
|
|
142
142
|
const restored = value as typeof state.value;
|
|
143
|
-
|
|
143
|
+
const isUnchanged =
|
|
144
|
+
JSON.stringify(restored) === JSON.stringify(state.value);
|
|
145
|
+
if (!isUnchanged && (!isValid || isValid(restored))) {
|
|
146
|
+
state.value = restored;
|
|
147
|
+
}
|
|
144
148
|
},
|
|
145
149
|
});
|
|
146
150
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, 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",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@antelopejs/core": ">=1.21.0 <2",
|
|
98
|
-
"@antelopejs/tooling-configs": "^0.5.
|
|
98
|
+
"@antelopejs/tooling-configs": "^0.5.3",
|
|
99
99
|
"@types/archiver": "^6.0.4",
|
|
100
100
|
"@types/chai": "^4.3.20",
|
|
101
101
|
"@types/jsonwebtoken": "^9.0.10",
|