@xleddyl/443-components-vue 0.16.94 → 0.16.95
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/CATALOG.md +173 -168
- package/README.md +46 -2
- package/dist/components/data/SortableList.vue +120 -0
- package/dist/components/data/SortableList.vue.d.ts +48 -0
- package/dist/components/data/Table.vue +43 -3
- package/dist/components/data/Table.vue.d.ts +8 -2
- package/dist/components/data/TileGrid.vue +274 -0
- package/dist/components/data/TileGrid.vue.d.ts +51 -0
- package/dist/components/data/index.d.ts +2 -0
- package/dist/components/data/index.mjs +2 -0
- package/dist/components/data/types.d.ts +30 -0
- package/dist/composables/useSortable.d.ts +1 -0
- package/dist/composables/useSortable.mjs +40 -11
- package/dist/icons/builtin.d.ts +1 -0
- package/dist/icons/builtin.mjs +1 -0
- package/dist/internal/data/sortable.d.ts +4 -1
- package/dist/internal/data/sortable.mjs +49 -0
- package/dist/locale/de.mjs +12 -0
- package/dist/locale/en.mjs +12 -0
- package/dist/locale/it.mjs +12 -0
- package/dist/locale/types.d.ts +12 -0
- package/dist/styles/data/sortable-list.css +185 -0
- package/dist/styles/data/table.css +12 -0
- package/dist/styles/data/tile-grid.css +144 -0
- package/dist/styles/data.css +2 -0
- package/dist/styles/forced-colors.css +30 -0
- package/dist/styles/shared.css +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { LayoutGap } from '../layout/types';
|
|
2
|
+
import type { RowKey, TileGridDrag, TileGridDragData, TileGridMove } from './types';
|
|
3
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<({
|
|
5
|
+
itemKey?: string | ((item: T, index: number) => RowKey);
|
|
6
|
+
itemLabel?: (item: T) => string;
|
|
7
|
+
label?: string;
|
|
8
|
+
minItemWidth?: string;
|
|
9
|
+
columns?: number;
|
|
10
|
+
gap?: LayoutGap;
|
|
11
|
+
selectable?: boolean;
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
handle?: string;
|
|
14
|
+
dragData?: (item: T, items: T[]) => TileGridDragData | null | undefined;
|
|
15
|
+
dragEffect?: DataTransfer["effectAllowed"];
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onActivate?: (item: T, index: number, event: MouseEvent | KeyboardEvent) => void;
|
|
18
|
+
} & {
|
|
19
|
+
items: T[];
|
|
20
|
+
selected?: RowKey[];
|
|
21
|
+
}) & {
|
|
22
|
+
onMove?: ((move: TileGridMove<T>) => any) | undefined;
|
|
23
|
+
"onUpdate:selected"?: ((value: RowKey[]) => any) | undefined;
|
|
24
|
+
onItemDragStart?: ((drag: TileGridDrag<T>) => any) | undefined;
|
|
25
|
+
onItemDragEnd?: ((drag: TileGridDrag<T>) => any) | undefined;
|
|
26
|
+
"onUpdate:items"?: ((value: T[]) => any) | undefined;
|
|
27
|
+
} & Partial<import("vue").HTMLAttributes & import("vue").ReservedProps>> & (typeof globalThis extends {
|
|
28
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
29
|
+
} ? P : {});
|
|
30
|
+
expose: (exposed: {}) => void;
|
|
31
|
+
attrs: any;
|
|
32
|
+
slots: {
|
|
33
|
+
tile?: (props: {
|
|
34
|
+
item: T;
|
|
35
|
+
index: number;
|
|
36
|
+
selected: boolean;
|
|
37
|
+
dragging: boolean;
|
|
38
|
+
}) => unknown;
|
|
39
|
+
add?: () => unknown;
|
|
40
|
+
};
|
|
41
|
+
emit: (((evt: "move", move: TileGridMove<T>) => void) & ((evt: "itemDragStart", drag: TileGridDrag<T>) => void) & ((evt: "itemDragEnd", drag: TileGridDrag<T>) => void)) & (((event: "update:selected", value: RowKey[]) => void) & ((event: "update:items", value: T[]) => void));
|
|
42
|
+
}>) => import("vue").VNode & {
|
|
43
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
44
|
+
};
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
export default _default;
|
|
47
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
48
|
+
[K in keyof T]: T[K];
|
|
49
|
+
} : {
|
|
50
|
+
[K in keyof T as K]: T[K];
|
|
51
|
+
}) & {};
|
|
@@ -6,12 +6,14 @@ export { default as FilterPill } from './FilterPill.vue';
|
|
|
6
6
|
export { default as FilterPills } from './FilterPills.vue';
|
|
7
7
|
export { default as Pagination } from './Pagination.vue';
|
|
8
8
|
export { default as SelectionBar } from './SelectionBar.vue';
|
|
9
|
+
export { default as SortableList } from './SortableList.vue';
|
|
9
10
|
export { default as Stat } from './Stat.vue';
|
|
10
11
|
export { default as Table } from './Table.vue';
|
|
11
12
|
export { default as Tag } from './Tag.vue';
|
|
12
13
|
export { default as TagList } from './TagList.vue';
|
|
13
14
|
export { default as RecordList } from './RecordList.vue';
|
|
14
15
|
export { default as Thumbnail } from './Thumbnail.vue';
|
|
16
|
+
export { default as TileGrid } from './TileGrid.vue';
|
|
15
17
|
export { default as Timeline } from './Timeline.vue';
|
|
16
18
|
export { default as Tree } from './Tree.vue';
|
|
17
19
|
export type * from './types';
|
|
@@ -6,12 +6,14 @@ export { default as FilterPill } from "./FilterPill.vue";
|
|
|
6
6
|
export { default as FilterPills } from "./FilterPills.vue";
|
|
7
7
|
export { default as Pagination } from "./Pagination.vue";
|
|
8
8
|
export { default as SelectionBar } from "./SelectionBar.vue";
|
|
9
|
+
export { default as SortableList } from "./SortableList.vue";
|
|
9
10
|
export { default as Stat } from "./Stat.vue";
|
|
10
11
|
export { default as Table } from "./Table.vue";
|
|
11
12
|
export { default as Tag } from "./Tag.vue";
|
|
12
13
|
export { default as TagList } from "./TagList.vue";
|
|
13
14
|
export { default as RecordList } from "./RecordList.vue";
|
|
14
15
|
export { default as Thumbnail } from "./Thumbnail.vue";
|
|
16
|
+
export { default as TileGrid } from "./TileGrid.vue";
|
|
15
17
|
export { default as Timeline } from "./Timeline.vue";
|
|
16
18
|
export { default as Tree } from "./Tree.vue";
|
|
17
19
|
export { applyTreeMove } from "../../internal/data/tree.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
1
2
|
import type { ColorValue, Tone } from '../core/types';
|
|
2
3
|
import type { IconName } from '../../composables/useIcons';
|
|
3
4
|
import type { MenuItems } from '../overlays/types';
|
|
@@ -24,6 +25,15 @@ export interface TableColumn<T = Record<string, unknown>> {
|
|
|
24
25
|
format?: (value: unknown, row: T) => string;
|
|
25
26
|
class?: string;
|
|
26
27
|
}
|
|
28
|
+
export type TableRowAttrs = HTMLAttributes & {
|
|
29
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
30
|
+
};
|
|
31
|
+
export type TableDragData = Record<string, string>;
|
|
32
|
+
export interface TableRowDrag<T> {
|
|
33
|
+
row: T;
|
|
34
|
+
rows: T[];
|
|
35
|
+
event: DragEvent;
|
|
36
|
+
}
|
|
27
37
|
export type PageSize = number | 'all';
|
|
28
38
|
export interface PaginationItem {
|
|
29
39
|
type: 'page' | 'ellipsis';
|
|
@@ -120,6 +130,26 @@ export interface TagListDrop {
|
|
|
120
130
|
dataTransfer: DataTransfer | null;
|
|
121
131
|
event: DragEvent;
|
|
122
132
|
}
|
|
133
|
+
export interface SortableListItem {
|
|
134
|
+
value: string | number;
|
|
135
|
+
label: string;
|
|
136
|
+
description?: string;
|
|
137
|
+
icon?: IconName;
|
|
138
|
+
disabled?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export type SortableListSize = 'sm' | 'md';
|
|
141
|
+
export type TileGridDragData = Record<string, string>;
|
|
142
|
+
export interface TileGridMove<T> {
|
|
143
|
+
item: T;
|
|
144
|
+
from: number;
|
|
145
|
+
to: number;
|
|
146
|
+
items: T[];
|
|
147
|
+
}
|
|
148
|
+
export interface TileGridDrag<T> {
|
|
149
|
+
item: T;
|
|
150
|
+
items: T[];
|
|
151
|
+
event: DragEvent;
|
|
152
|
+
}
|
|
123
153
|
export type TagListAccept = string | string[] | ((event: DragEvent) => boolean);
|
|
124
154
|
export interface RecordListItem {
|
|
125
155
|
id: string | number;
|
|
@@ -14,6 +14,7 @@ export interface UseSortableOptions<T> {
|
|
|
14
14
|
orientation?: MaybeRefOrGetter<SortableOrientation | undefined>;
|
|
15
15
|
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
16
16
|
handle?: string;
|
|
17
|
+
preview?: string;
|
|
17
18
|
canMove?: (item: T, index: number) => boolean;
|
|
18
19
|
label?: (item: T) => string;
|
|
19
20
|
movedText?: (move: SortableMove<T>) => string;
|
|
@@ -2,7 +2,15 @@ import { nextTick, onScopeDispose, readonly, ref, toValue } from "vue";
|
|
|
2
2
|
import { useLocale } from "./useLocale.mjs";
|
|
3
3
|
import { useLiveMessage } from "../internal/core/live.mjs";
|
|
4
4
|
import { isClient } from "../internal/core/env.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
SORTABLE_ATTR,
|
|
7
|
+
gridNeighbor,
|
|
8
|
+
gridSlot,
|
|
9
|
+
insertionIndex,
|
|
10
|
+
isRtl,
|
|
11
|
+
layoutRect,
|
|
12
|
+
sortableElements
|
|
13
|
+
} from "../internal/data/sortable.mjs";
|
|
6
14
|
const THRESHOLD = 4;
|
|
7
15
|
const INTERACTIVE = "button, a[href], input, textarea, select, [contenteditable]";
|
|
8
16
|
export function useSortable(container, options) {
|
|
@@ -54,6 +62,17 @@ export function useSortable(container, options) {
|
|
|
54
62
|
});
|
|
55
63
|
return true;
|
|
56
64
|
}
|
|
65
|
+
function rowTarget(index, step) {
|
|
66
|
+
const rects = sortableElements(toValue(container)).map(layoutRect);
|
|
67
|
+
return gridNeighbor(rects, index, step);
|
|
68
|
+
}
|
|
69
|
+
function keyTarget(event, index) {
|
|
70
|
+
if (axis() === "grid" && (event.key === "ArrowUp" || event.key === "ArrowDown"))
|
|
71
|
+
return rowTarget(index, event.key === "ArrowUp" ? -1 : 1);
|
|
72
|
+
const delta = keyDelta(event);
|
|
73
|
+
if (!delta) return null;
|
|
74
|
+
return delta === -Infinity ? 0 : delta === Infinity ? list().length - 1 : index + delta;
|
|
75
|
+
}
|
|
57
76
|
function keyDelta(event) {
|
|
58
77
|
const rtl = isRtl(event.currentTarget);
|
|
59
78
|
switch (event.key) {
|
|
@@ -75,11 +94,11 @@ export function useSortable(container, options) {
|
|
|
75
94
|
}
|
|
76
95
|
function onKeydown(event, index) {
|
|
77
96
|
if (!event.altKey || event.ctrlKey || event.metaKey) return;
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
if (!["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key))
|
|
98
|
+
return;
|
|
80
99
|
event.preventDefault();
|
|
81
|
-
const to =
|
|
82
|
-
move(index, to, { announce: true, source: "keyboard" });
|
|
100
|
+
const to = keyTarget(event, index);
|
|
101
|
+
if (to !== null) move(index, to, { announce: true, source: "keyboard" });
|
|
83
102
|
}
|
|
84
103
|
function preventSelection(event) {
|
|
85
104
|
event.preventDefault();
|
|
@@ -105,7 +124,7 @@ export function useSortable(container, options) {
|
|
|
105
124
|
}
|
|
106
125
|
function follow(event) {
|
|
107
126
|
if (!drag) return;
|
|
108
|
-
const element = drag.
|
|
127
|
+
const element = drag.preview;
|
|
109
128
|
const current = element.style.translate.split(" ").map((value) => parseFloat(value) || 0);
|
|
110
129
|
const rect = element.getBoundingClientRect();
|
|
111
130
|
const layoutX = rect.left - (current[0] ?? 0);
|
|
@@ -122,10 +141,12 @@ export function useSortable(container, options) {
|
|
|
122
141
|
if (!target.closest(options.handle)) return;
|
|
123
142
|
} else if (target !== element && target.closest(INTERACTIVE)) return;
|
|
124
143
|
if (!movable(index)) return;
|
|
125
|
-
const
|
|
144
|
+
const preview = options.preview && element.querySelector(options.preview) || element;
|
|
145
|
+
const rect = preview.getBoundingClientRect();
|
|
126
146
|
drag = {
|
|
127
147
|
pointerId: event.pointerId,
|
|
128
148
|
element,
|
|
149
|
+
preview,
|
|
129
150
|
origin: index,
|
|
130
151
|
index,
|
|
131
152
|
startX: event.clientX,
|
|
@@ -146,9 +167,7 @@ export function useSortable(container, options) {
|
|
|
146
167
|
window.getSelection()?.removeAllRanges();
|
|
147
168
|
}
|
|
148
169
|
event.preventDefault();
|
|
149
|
-
const
|
|
150
|
-
const others = sortableElements(root).filter((element) => element !== drag.element);
|
|
151
|
-
const target = insertionIndex(others, event.clientX, event.clientY, axis(), isRtl(root));
|
|
170
|
+
const target = pointerTarget(event);
|
|
152
171
|
if (target !== drag.index && move(drag.index, target, { source: "pointer" })) {
|
|
153
172
|
drag.index = target;
|
|
154
173
|
dragging.value = target;
|
|
@@ -156,12 +175,22 @@ export function useSortable(container, options) {
|
|
|
156
175
|
}
|
|
157
176
|
follow(event);
|
|
158
177
|
}
|
|
178
|
+
function pointerTarget(event) {
|
|
179
|
+
const root = toValue(container);
|
|
180
|
+
const elements = sortableElements(root);
|
|
181
|
+
if (axis() === "grid") {
|
|
182
|
+
const slot = gridSlot(elements.map(layoutRect), event.clientX, event.clientY);
|
|
183
|
+
return slot === -1 ? drag.index : slot;
|
|
184
|
+
}
|
|
185
|
+
const others = elements.filter((element) => element !== drag.element);
|
|
186
|
+
return insertionIndex(others, event.clientX, event.clientY, axis(), isRtl(root));
|
|
187
|
+
}
|
|
159
188
|
function finish(cancelled) {
|
|
160
189
|
const state = drag;
|
|
161
190
|
drag = null;
|
|
162
191
|
listen(false);
|
|
163
192
|
if (!state) return;
|
|
164
|
-
state.
|
|
193
|
+
state.preview.style.translate = "";
|
|
165
194
|
dragging.value = null;
|
|
166
195
|
if (!state.active) return;
|
|
167
196
|
window.addEventListener("click", suppressClick, { capture: true, once: true });
|
package/dist/icons/builtin.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare const builtinIcons: {
|
|
|
31
31
|
readonly 'arrow-up-tray': readonly ["M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"];
|
|
32
32
|
readonly document: readonly ["M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"];
|
|
33
33
|
readonly 'ellipsis-horizontal': readonly ["M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"];
|
|
34
|
+
readonly 'bars-2': readonly ["M3.75 9h16.5m-16.5 6.75h16.5"];
|
|
34
35
|
readonly 'bars-3': readonly ["M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"];
|
|
35
36
|
readonly sun: readonly ["M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"];
|
|
36
37
|
readonly moon: readonly ["M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"];
|
package/dist/icons/builtin.mjs
CHANGED
|
@@ -60,6 +60,7 @@ export const builtinIcons = {
|
|
|
60
60
|
"ellipsis-horizontal": [
|
|
61
61
|
"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"
|
|
62
62
|
],
|
|
63
|
+
"bars-2": ["M3.75 9h16.5m-16.5 6.75h16.5"],
|
|
63
64
|
"bars-3": ["M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"],
|
|
64
65
|
sun: [
|
|
65
66
|
"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export type SortableAxis = 'horizontal' | 'vertical';
|
|
1
|
+
export type SortableAxis = 'horizontal' | 'vertical' | 'grid';
|
|
2
2
|
export declare const SORTABLE_ATTR = "data-k-sortable";
|
|
3
3
|
export declare function sortableElements(container: HTMLElement | null | undefined): HTMLElement[];
|
|
4
4
|
export declare function isRtl(element: Element | null | undefined): boolean;
|
|
5
5
|
export declare function insertionIndex(elements: HTMLElement[], x: number, y: number, axis: SortableAxis, rtl: boolean): number;
|
|
6
|
+
export declare function layoutRect(element: HTMLElement): DOMRect;
|
|
7
|
+
export declare function gridSlot(rects: DOMRect[], x: number, y: number): number;
|
|
8
|
+
export declare function gridNeighbor(rects: DOMRect[], index: number, step: 1 | -1): null;
|
|
@@ -21,3 +21,52 @@ export function insertionIndex(elements, x, y, axis, rtl) {
|
|
|
21
21
|
if (isBefore(element.getBoundingClientRect(), x, y, axis, rtl)) index++;
|
|
22
22
|
return index;
|
|
23
23
|
}
|
|
24
|
+
export function layoutRect(element) {
|
|
25
|
+
const rect = element.getBoundingClientRect();
|
|
26
|
+
const [x = 0, y = 0] = element.style.translate.split(" ").map((value) => parseFloat(value) || 0);
|
|
27
|
+
return new DOMRect(rect.left - x, rect.top - y, rect.width, rect.height);
|
|
28
|
+
}
|
|
29
|
+
function distance(rect, x, y) {
|
|
30
|
+
const dx = Math.max(rect.left - x, 0, x - rect.right);
|
|
31
|
+
const dy = Math.max(rect.top - y, 0, y - rect.bottom);
|
|
32
|
+
return Math.hypot(dx, dy);
|
|
33
|
+
}
|
|
34
|
+
export function gridSlot(rects, x, y) {
|
|
35
|
+
let best = -1;
|
|
36
|
+
let bestDistance = Infinity;
|
|
37
|
+
rects.forEach((rect, index) => {
|
|
38
|
+
const value = distance(rect, x, y);
|
|
39
|
+
if (value < bestDistance) {
|
|
40
|
+
best = index;
|
|
41
|
+
bestDistance = value;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return best;
|
|
45
|
+
}
|
|
46
|
+
function sameRow(a, b) {
|
|
47
|
+
return a.top < b.bottom && b.top < a.bottom;
|
|
48
|
+
}
|
|
49
|
+
export function gridNeighbor(rects, index, step) {
|
|
50
|
+
const current = rects[index];
|
|
51
|
+
if (!current) return null;
|
|
52
|
+
const center = current.left + current.width / 2;
|
|
53
|
+
let row = null;
|
|
54
|
+
for (let position = index + step; position >= 0 && position < rects.length; position += step) {
|
|
55
|
+
const rect = rects[position];
|
|
56
|
+
if (sameRow(rect, current)) continue;
|
|
57
|
+
if (!row) row = rect;
|
|
58
|
+
else if (!sameRow(rect, row)) break;
|
|
59
|
+
}
|
|
60
|
+
if (!row) return null;
|
|
61
|
+
let best = null;
|
|
62
|
+
let bestDistance = Infinity;
|
|
63
|
+
rects.forEach((rect, position) => {
|
|
64
|
+
if (!sameRow(rect, row)) return;
|
|
65
|
+
const value = Math.abs(rect.left + rect.width / 2 - center);
|
|
66
|
+
if (value < bestDistance) {
|
|
67
|
+
best = position;
|
|
68
|
+
bestDistance = value;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return best;
|
|
72
|
+
}
|
package/dist/locale/de.mjs
CHANGED
|
@@ -315,6 +315,18 @@ export const de = {
|
|
|
315
315
|
sortable: {
|
|
316
316
|
moved: "{label} an Position {position} von {count} verschoben"
|
|
317
317
|
},
|
|
318
|
+
sortableList: {
|
|
319
|
+
label: "Elemente",
|
|
320
|
+
empty: "Keine Elemente",
|
|
321
|
+
handle: "{label} verschieben",
|
|
322
|
+
hint: "Mit den Pfeiltasten nach oben und unten verschieben"
|
|
323
|
+
},
|
|
324
|
+
tileGrid: {
|
|
325
|
+
label: "Elemente",
|
|
326
|
+
navigateHint: "Mit den Pfeiltasten zwischen den Kacheln wechseln",
|
|
327
|
+
selectHint: "Leertaste w\xE4hlt aus, Umschalt mit Leertaste oder ein Klick w\xE4hlt einen Bereich",
|
|
328
|
+
sortHint: "Alt mit einer Pfeiltaste verschiebt die Kachel"
|
|
329
|
+
},
|
|
318
330
|
tagList: {
|
|
319
331
|
label: "Elemente",
|
|
320
332
|
empty: "Keine Elemente",
|
package/dist/locale/en.mjs
CHANGED
|
@@ -315,6 +315,18 @@ export const en = {
|
|
|
315
315
|
sortable: {
|
|
316
316
|
moved: "{label} moved to position {position} of {count}"
|
|
317
317
|
},
|
|
318
|
+
sortableList: {
|
|
319
|
+
label: "Items",
|
|
320
|
+
empty: "No items",
|
|
321
|
+
handle: "Move {label}",
|
|
322
|
+
hint: "Press the up and down arrow keys to move the item"
|
|
323
|
+
},
|
|
324
|
+
tileGrid: {
|
|
325
|
+
label: "Items",
|
|
326
|
+
navigateHint: "Use the arrow keys to move between tiles",
|
|
327
|
+
selectHint: "Press Space to select, Shift with Space or a click selects a range",
|
|
328
|
+
sortHint: "Alt with an arrow key moves the tile"
|
|
329
|
+
},
|
|
318
330
|
tagList: {
|
|
319
331
|
label: "Items",
|
|
320
332
|
empty: "No items",
|
package/dist/locale/it.mjs
CHANGED
|
@@ -315,6 +315,18 @@ export const it = {
|
|
|
315
315
|
sortable: {
|
|
316
316
|
moved: "{label} spostato in posizione {position} di {count}"
|
|
317
317
|
},
|
|
318
|
+
sortableList: {
|
|
319
|
+
label: "Elementi",
|
|
320
|
+
empty: "Nessun elemento",
|
|
321
|
+
handle: "Sposta {label}",
|
|
322
|
+
hint: "Premi le frecce su e gi\xF9 per spostare l'elemento"
|
|
323
|
+
},
|
|
324
|
+
tileGrid: {
|
|
325
|
+
label: "Elementi",
|
|
326
|
+
navigateHint: "Usa le frecce per spostarti tra i riquadri",
|
|
327
|
+
selectHint: "Premi Spazio per selezionare, Maiusc con Spazio o un clic seleziona un intervallo",
|
|
328
|
+
sortHint: "Alt con una freccia sposta il riquadro"
|
|
329
|
+
},
|
|
318
330
|
tagList: {
|
|
319
331
|
label: "Elementi",
|
|
320
332
|
empty: "Nessun elemento",
|
package/dist/locale/types.d.ts
CHANGED
|
@@ -302,6 +302,18 @@ export interface KMessages {
|
|
|
302
302
|
sortable: {
|
|
303
303
|
moved: string;
|
|
304
304
|
};
|
|
305
|
+
sortableList: {
|
|
306
|
+
label: string;
|
|
307
|
+
empty: string;
|
|
308
|
+
handle: string;
|
|
309
|
+
hint: string;
|
|
310
|
+
};
|
|
311
|
+
tileGrid: {
|
|
312
|
+
label: string;
|
|
313
|
+
navigateHint: string;
|
|
314
|
+
selectHint: string;
|
|
315
|
+
sortHint: string;
|
|
316
|
+
};
|
|
305
317
|
tagList: {
|
|
306
318
|
label: string;
|
|
307
319
|
empty: string;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
.k-sortable-list {
|
|
2
|
+
--k-sortable-list-row: 2.5rem;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.k-sortable-list-sm {
|
|
7
|
+
--k-sortable-list-row: 2.125rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.k-sortable-list-items {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
list-style: none;
|
|
16
|
+
border: 1px solid var(--k-line);
|
|
17
|
+
border-radius: var(--k-radius-md);
|
|
18
|
+
background: var(--k-surface);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.k-sortable-list-item {
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.k-sortable-list-item + .k-sortable-list-item {
|
|
26
|
+
border-top: 1px solid var(--k-line);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.k-sortable-list-row {
|
|
30
|
+
--k-icon-size: 1rem;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 0.5rem;
|
|
34
|
+
min-height: var(--k-sortable-list-row);
|
|
35
|
+
padding: 0.25rem 0.75rem 0.25rem 0.375rem;
|
|
36
|
+
background: var(--k-surface);
|
|
37
|
+
transition:
|
|
38
|
+
background-color var(--k-duration) var(--k-ease),
|
|
39
|
+
box-shadow var(--k-duration) var(--k-ease),
|
|
40
|
+
scale var(--k-duration) var(--k-ease);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.k-sortable-list-item:first-child > .k-sortable-list-row {
|
|
44
|
+
border-start-start-radius: calc(var(--k-radius-md) - 1px);
|
|
45
|
+
border-start-end-radius: calc(var(--k-radius-md) - 1px);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.k-sortable-list-item:last-child > .k-sortable-list-row {
|
|
49
|
+
border-end-start-radius: calc(var(--k-radius-md) - 1px);
|
|
50
|
+
border-end-end-radius: calc(var(--k-radius-md) - 1px);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.k-sortable-list.is-sortable:not(.is-dragging)
|
|
54
|
+
.k-sortable-list-item:not(.is-locked):hover
|
|
55
|
+
> .k-sortable-list-row {
|
|
56
|
+
background: var(--k-subtle);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.k-sortable-list-handle {
|
|
60
|
+
position: relative;
|
|
61
|
+
display: grid;
|
|
62
|
+
place-items: center;
|
|
63
|
+
width: 1.5rem;
|
|
64
|
+
height: 1.5rem;
|
|
65
|
+
flex: none;
|
|
66
|
+
border-radius: var(--k-radius-sm);
|
|
67
|
+
color: var(--k-text-dimmed);
|
|
68
|
+
cursor: grab;
|
|
69
|
+
touch-action: none;
|
|
70
|
+
transition:
|
|
71
|
+
color var(--k-duration) var(--k-ease),
|
|
72
|
+
background-color var(--k-duration) var(--k-ease);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.k-sortable-list-handle:hover:not(:disabled) {
|
|
76
|
+
background: var(--k-hover);
|
|
77
|
+
color: var(--k-text);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.k-sortable-list-handle:disabled {
|
|
81
|
+
opacity: 0.4;
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.k-sortable-list.is-dragging,
|
|
86
|
+
.k-sortable-list.is-dragging .k-sortable-list-handle {
|
|
87
|
+
cursor: grabbing;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.k-sortable-list-content {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex: 1;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 0.5rem;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.k-sortable-list.is-sortable .k-sortable-list-item:not(.is-locked) .k-sortable-list-content {
|
|
99
|
+
cursor: grab;
|
|
100
|
+
user-select: none;
|
|
101
|
+
-webkit-user-select: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.k-sortable-list-icon {
|
|
105
|
+
flex: none;
|
|
106
|
+
color: var(--k-text-dimmed);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.k-sortable-list-text {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex: 1;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 0.0625rem;
|
|
114
|
+
min-width: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.k-sortable-list-label {
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
font-size: 0.8125rem;
|
|
120
|
+
font-weight: var(--k-font-weight-medium, 500);
|
|
121
|
+
color: var(--k-text);
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.k-sortable-list-description {
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
font-size: 0.75rem;
|
|
129
|
+
line-height: 1.4;
|
|
130
|
+
color: var(--k-text-muted);
|
|
131
|
+
text-overflow: ellipsis;
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.k-sortable-list-item.is-locked .k-sortable-list-label {
|
|
136
|
+
color: var(--k-text-muted);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.k-sortable-list-trailing {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex: none;
|
|
142
|
+
align-items: center;
|
|
143
|
+
gap: 0.25rem;
|
|
144
|
+
margin-inline-start: auto;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.k-sortable-list-item.is-moving {
|
|
148
|
+
z-index: 1;
|
|
149
|
+
background: var(--k-accent-soft);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.k-sortable-list-item.is-moving::after {
|
|
153
|
+
content: '';
|
|
154
|
+
position: absolute;
|
|
155
|
+
inset: 0.25rem;
|
|
156
|
+
border: 1px dashed var(--k-accent-line);
|
|
157
|
+
border-radius: var(--k-radius-sm);
|
|
158
|
+
pointer-events: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.k-sortable-list-item.is-moving > .k-sortable-list-row {
|
|
162
|
+
position: relative;
|
|
163
|
+
z-index: 1;
|
|
164
|
+
border-radius: var(--k-radius-md);
|
|
165
|
+
box-shadow: var(--k-shadow-raised), var(--k-shadow-sm);
|
|
166
|
+
scale: 1.01;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.k-sortable-list.is-disabled .k-sortable-list-items {
|
|
170
|
+
background: var(--k-subtle);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.k-sortable-list.is-disabled .k-sortable-list-row {
|
|
174
|
+
background: transparent;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.k-sortable-list-empty {
|
|
178
|
+
margin: 0;
|
|
179
|
+
padding: 0.75rem;
|
|
180
|
+
border: 1px dashed var(--k-line-strong);
|
|
181
|
+
border-radius: var(--k-radius-md);
|
|
182
|
+
font-size: 0.8125rem;
|
|
183
|
+
color: var(--k-text-muted);
|
|
184
|
+
text-align: center;
|
|
185
|
+
}
|
|
@@ -180,6 +180,18 @@
|
|
|
180
180
|
background: var(--k-accent-soft);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
.k-table-row[draggable='true'] {
|
|
184
|
+
cursor: grab;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.k-table-row[draggable='true'] :is(img, a) {
|
|
188
|
+
-webkit-user-drag: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.k-table-row.is-dragging {
|
|
192
|
+
opacity: 0.45;
|
|
193
|
+
}
|
|
194
|
+
|
|
183
195
|
.k-table-link {
|
|
184
196
|
border-radius: var(--k-radius-xs);
|
|
185
197
|
color: inherit;
|