@dosgato/dialog 1.1.9 → 1.1.11
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/Dialog.svelte +21 -13
- package/dist/FieldCombobox.svelte +0 -0
- package/dist/FieldCombobox.svelte.d.ts +23 -0
- package/dist/Tab.svelte +3 -1
- package/dist/chooser/Chooser.svelte +2 -17
- package/dist/tree/treestore.d.ts +3 -0
- package/dist/tree/treestore.js +16 -0
- package/package.json +1 -1
package/dist/Dialog.svelte
CHANGED
|
@@ -84,37 +84,45 @@ $: describedby = [title ? labelid : undefined, descid].filter(isNotBlank).join('
|
|
|
84
84
|
section.tiny {
|
|
85
85
|
width: 30vw;
|
|
86
86
|
min-width: 200px;
|
|
87
|
-
max-width:
|
|
87
|
+
max-width: 275px;
|
|
88
88
|
}
|
|
89
|
+
@media (max-width: 250px) { section.tiny button.expand { display: none; } }
|
|
90
|
+
@media (max-width: 800px) { section.tiny { width: 50vw; } }
|
|
91
|
+
@media (max-width: 430px) { section.tiny { width: 75vw; } }
|
|
92
|
+
|
|
89
93
|
section.small {
|
|
90
94
|
width: 50vw;
|
|
91
|
-
min-width:
|
|
92
|
-
max-width:
|
|
95
|
+
min-width: 250px;
|
|
96
|
+
max-width: 450px;
|
|
93
97
|
}
|
|
98
|
+
@media (max-width: 450px) { section.small button.expand { display: none; } }
|
|
99
|
+
@media (max-width: 800px) { section.small { width: 75vw; } }
|
|
100
|
+
@media (max-width: 430px) { section.small { width: 90vw; } }
|
|
94
101
|
section.normal {
|
|
95
102
|
width: 75vw;
|
|
96
|
-
min-width:
|
|
103
|
+
min-width: 300px;
|
|
97
104
|
max-width: 750px;
|
|
98
105
|
}
|
|
106
|
+
@media (max-width: 750px) { section.normal button.expand { display: none; } }
|
|
107
|
+
@media (max-width: 800px) { section.normal { width: 90vw; } }
|
|
108
|
+
@media (max-width: 430px) { section.normal { width: 95vw; } }
|
|
99
109
|
section.large {
|
|
100
110
|
width: 90vw;
|
|
101
111
|
min-width: 300px;
|
|
102
112
|
max-width: 1000px;
|
|
103
113
|
}
|
|
114
|
+
@media (max-width: 1000px) { section.large button.expand { display: none; } }
|
|
115
|
+
@media (max-width: 800px) { section.large { width: 95vw; } }
|
|
116
|
+
@media (max-width: 430px) { section.large { width: 97vw; } }
|
|
104
117
|
section.xl {
|
|
105
118
|
width: 95vw;
|
|
106
119
|
max-width: 2000px;
|
|
107
120
|
}
|
|
121
|
+
@media (max-width: 2000px) { section.xl button.expand { display: none; } }
|
|
122
|
+
@media (max-width: 800px) { section.xl { width: 97vw; } }
|
|
108
123
|
|
|
109
|
-
@media (max-width:
|
|
110
|
-
|
|
111
|
-
width: 95vw;
|
|
112
|
-
max-width: 2000px;
|
|
113
|
-
}
|
|
114
|
-
button.expand {
|
|
115
|
-
display: none;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
124
|
+
@media (max-width: 800px) { .dialog-content { padding: 1.2em; } }
|
|
125
|
+
@media (max-width: 430px) { .dialog-content { padding: 0.6em; } }
|
|
118
126
|
|
|
119
127
|
header {
|
|
120
128
|
display: flex;
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} FieldComboboxProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} FieldComboboxEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} FieldComboboxSlots */
|
|
4
|
+
export default class FieldCombobox extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> {
|
|
9
|
+
}
|
|
10
|
+
export type FieldComboboxProps = typeof __propDef.props;
|
|
11
|
+
export type FieldComboboxEvents = typeof __propDef.events;
|
|
12
|
+
export type FieldComboboxSlots = typeof __propDef.slots;
|
|
13
|
+
import { SvelteComponentTyped } from "svelte";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
[x: string]: never;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
package/dist/Tab.svelte
CHANGED
|
@@ -34,10 +34,12 @@ setContext(TAB_NAME_CONTEXT, tabNameStore);
|
|
|
34
34
|
<style>
|
|
35
35
|
.tabs-panel {
|
|
36
36
|
width: 100%;
|
|
37
|
-
min-height: 50vh;
|
|
38
37
|
border: var(--tabs-panel-border, var(--tabs-border, 0));
|
|
39
38
|
padding: var(--tabs-margin-top, 1.5em) var(--tabs-padding-hori, 0.7em) 0.5em var(--tabs-padding-hori, 0.7em);
|
|
40
39
|
}
|
|
40
|
+
:global(.dialog-content) .tabs-panel {
|
|
41
|
+
min-height: 50vh;
|
|
42
|
+
}
|
|
41
43
|
.tabs-panel.accordion {
|
|
42
44
|
border-left: 0;
|
|
43
45
|
border-right: 0;
|
|
@@ -3,7 +3,7 @@ import folderIcon from '@iconify-icons/ph/folder';
|
|
|
3
3
|
import folderNotchOpen from '@iconify-icons/ph/folder-notch-open';
|
|
4
4
|
import { createEventDispatcher, getContext, onMount, setContext, tick } from 'svelte';
|
|
5
5
|
import { isNotBlank, randomid } from 'txstate-utils';
|
|
6
|
-
import { Button, Dialog, iconForMime, Tabs, Tree, UploadUI } from '..';
|
|
6
|
+
import { Button, Dialog, iconForMime, Tabs, Tree, UploadUI, expandTreePath } from '..';
|
|
7
7
|
import { CHOOSER_API_CONTEXT } from './ChooserAPI';
|
|
8
8
|
import { CHOOSER_STORE_CONTEXT, ChooserStore } from './ChooserStore';
|
|
9
9
|
import Details from './Details.svelte';
|
|
@@ -45,26 +45,11 @@ function onUploadComplete() {
|
|
|
45
45
|
treeStore.openAndRefresh($selected).catch(console.error);
|
|
46
46
|
showuploader = false;
|
|
47
47
|
}
|
|
48
|
-
async function openRecursive(pathSplit, depth) {
|
|
49
|
-
let curr = $treeStore.rootItems?.find(itm => itm.name === pathSplit[0]);
|
|
50
|
-
for (let i = 0; i < depth; i++) {
|
|
51
|
-
curr = curr?.children?.find(c => c.name === pathSplit[i + 1]);
|
|
52
|
-
}
|
|
53
|
-
if (!curr) {
|
|
54
|
-
console.warn('tried to preload a path', '/' + pathSplit.join('/'), 'that does not exist ');
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
await treeStore.open(curr, false);
|
|
58
|
-
if (depth + 1 >= pathSplit.length)
|
|
59
|
-
return curr;
|
|
60
|
-
return await openRecursive(pathSplit, depth + 1);
|
|
61
|
-
}
|
|
62
48
|
async function selectPreview(preloadPath) {
|
|
63
49
|
if (!$store.initialized)
|
|
64
50
|
return;
|
|
65
51
|
if (preloadPath) {
|
|
66
|
-
const currentSelection = await
|
|
67
|
-
treeStore.trigger();
|
|
52
|
+
const currentSelection = await expandTreePath(treeStore, preloadPath.split('/').filter(isNotBlank));
|
|
68
53
|
if (!currentSelection)
|
|
69
54
|
return;
|
|
70
55
|
store.setPreview(currentSelection);
|
package/dist/tree/treestore.d.ts
CHANGED
|
@@ -137,3 +137,6 @@ export declare function getHashId(str: string): string;
|
|
|
137
137
|
export declare const lazyObserver: IntersectionObserver | undefined;
|
|
138
138
|
export type SearchableType<T> = keyof T | (keyof T)[] | ((item: T) => string | string[]) | undefined;
|
|
139
139
|
export declare function transformSearchable<T>(searchable: SearchableType<T>): undefined | ((itm: T) => string[]);
|
|
140
|
+
export declare function expandTreePath<T extends TreeItemFromDB & {
|
|
141
|
+
name: string;
|
|
142
|
+
}>(treeStore: TreeStore<T>, pathSplit: string[], depth?: number): Promise<TypedTreeItem<T> | undefined>;
|
package/dist/tree/treestore.js
CHANGED
|
@@ -404,3 +404,19 @@ export function transformSearchable(searchable) {
|
|
|
404
404
|
? (itm) => searchable.map(k => itm[k]).filter(isNotBlank)
|
|
405
405
|
: (itm) => isNotBlank(itm[searchable]) ? [itm[searchable]] : []));
|
|
406
406
|
}
|
|
407
|
+
export async function expandTreePath(treeStore, pathSplit, depth = 0) {
|
|
408
|
+
let curr = treeStore.value.rootItems?.find(itm => itm.name === pathSplit[0]);
|
|
409
|
+
for (let i = 0; i < depth; i++) {
|
|
410
|
+
curr = curr?.children?.find(c => c.name === pathSplit[i + 1]);
|
|
411
|
+
}
|
|
412
|
+
if (!curr) {
|
|
413
|
+
console.warn('tried to preload a path', '/' + pathSplit.join('/'), 'that does not exist ');
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
await treeStore.open(curr, false);
|
|
417
|
+
if (depth + 1 >= pathSplit.length) {
|
|
418
|
+
treeStore.focus(curr, false);
|
|
419
|
+
return curr;
|
|
420
|
+
}
|
|
421
|
+
return await expandTreePath(treeStore, pathSplit, depth + 1);
|
|
422
|
+
}
|
package/package.json
CHANGED