@stonecrop/desktop 0.34.0 → 0.36.0
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/README.md
CHANGED
|
@@ -160,7 +160,7 @@ Three things are adjustable, for the cases that genuinely differ between applica
|
|
|
160
160
|
|
|
161
161
|
`args` is an opaque JSON array: nothing validates it, so both ends of your own stack have to agree. A backend taking positional `[recordId, data]` supplies `buildArgs` to say so.
|
|
162
162
|
|
|
163
|
-
Resolving a record's identity and keying it into HST are deliberately **not** adjustable. That rule is declared on the doctype and re-derived server-side by the adapter, and every host that re-derived it client-side got it wrong. If you dispatch through `Stonecrop.dispatchAction` directly instead of using this composable, that method still files the
|
|
163
|
+
Resolving a record's identity and keying it into HST are deliberately **not** adjustable. That rule is declared on the doctype and re-derived server-side by the adapter, and every host that re-derived it client-side got it wrong. If you dispatch through `Stonecrop.dispatchAction` directly instead of using this composable, that method still files the result's `record` (the server's read of the record after the action) under the settled identity, so you cannot store it under the wrong key by accident. What you lose is the stale-key cleanup and the route-follow, which need the id you dispatched.
|
|
164
164
|
|
|
165
165
|
Do not copy form data into HST before dispatching. Desktop already hands you the current form snapshot in `payload.data`, and an unsaved record has no HST node to write to.
|
|
166
166
|
|
package/dist/assets/index.css
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
.command-palette {
|
|
24
24
|
width: 600px;
|
|
25
25
|
max-width: 90%;
|
|
26
|
-
background-color:
|
|
27
|
-
border-radius:
|
|
26
|
+
background-color: var(--sc-overlay-background);
|
|
27
|
+
border-radius: var(--sc-border-radius);
|
|
28
28
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
max-height: 80vh;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
.command-palette-header {
|
|
35
35
|
display: flex;
|
|
36
|
-
border-bottom: 1px solid
|
|
36
|
+
border-bottom: 1px solid var(--sc-gray-10);
|
|
37
37
|
padding: 12px;
|
|
38
38
|
}
|
|
39
39
|
.command-palette-input {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
border: none;
|
|
50
50
|
font-size: 24px;
|
|
51
51
|
cursor: pointer;
|
|
52
|
-
color:
|
|
52
|
+
color: var(--sc-input-label-color);
|
|
53
53
|
padding: 0 8px;
|
|
54
54
|
}
|
|
55
55
|
.command-palette-close:hover {
|
|
56
|
-
color:
|
|
56
|
+
color: var(--sc-gray-80);
|
|
57
57
|
}
|
|
58
58
|
.command-palette-results {
|
|
59
59
|
overflow-y: auto;
|
|
@@ -62,23 +62,23 @@
|
|
|
62
62
|
.command-palette-result {
|
|
63
63
|
padding: 12px 16px;
|
|
64
64
|
cursor: pointer;
|
|
65
|
-
border-bottom: 1px solid
|
|
65
|
+
border-bottom: 1px solid var(--sc-gray-10);
|
|
66
66
|
}
|
|
67
67
|
.command-palette-result:hover,
|
|
68
68
|
.command-palette-result.selected {
|
|
69
|
-
background-color:
|
|
69
|
+
background-color: var(--sc-row-hover-color);
|
|
70
70
|
}
|
|
71
71
|
.command-palette-result.selected {
|
|
72
|
-
background-color:
|
|
72
|
+
background-color: var(--sc-color-changed);
|
|
73
73
|
}
|
|
74
74
|
.result-title {
|
|
75
75
|
font-weight: 500;
|
|
76
76
|
margin-bottom: 4px;
|
|
77
|
-
color:
|
|
77
|
+
color: var(--sc-gray-80);
|
|
78
78
|
}
|
|
79
79
|
.result-content {
|
|
80
80
|
font-size: 14px;
|
|
81
|
-
color:
|
|
81
|
+
color: var(--sc-input-label-color);
|
|
82
82
|
white-space: nowrap;
|
|
83
83
|
overflow: hidden;
|
|
84
84
|
text-overflow: ellipsis;
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
.command-palette-no-results {
|
|
87
87
|
padding: 20px 16px;
|
|
88
88
|
text-align: center;
|
|
89
|
-
color:
|
|
89
|
+
color: var(--sc-input-label-color);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.action-set[data-v-40295597] {
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
|
|
288
288
|
/* Pinned to both edges: without `left`, a fixed box takes its container's offset and overflows the
|
|
289
289
|
viewport. Only the toolbar and the tabs take pointer events; the empty strip passes clicks through. */
|
|
290
|
-
footer[data-v-
|
|
290
|
+
footer[data-v-cdbbd2a0] {
|
|
291
291
|
position: fixed;
|
|
292
292
|
right: 0;
|
|
293
293
|
bottom: 0;
|
|
@@ -300,12 +300,12 @@ footer[data-v-7c905747] {
|
|
|
300
300
|
display: flex;
|
|
301
301
|
justify-content: flex-end;
|
|
302
302
|
align-items: flex-end;
|
|
303
|
-
padding: 0
|
|
303
|
+
padding: 0 1px 0 0;
|
|
304
304
|
box-sizing: border-box;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
/* When the toolbar and the tabs do not fit on one row, the toolbar wraps onto its own row above. */
|
|
308
|
-
.sheetnav-footer-cluster[data-v-
|
|
308
|
+
.sheetnav-footer-cluster[data-v-cdbbd2a0] {
|
|
309
309
|
display: flex;
|
|
310
310
|
flex-wrap: wrap;
|
|
311
311
|
justify-content: flex-end;
|
|
@@ -314,7 +314,7 @@ footer[data-v-7c905747] {
|
|
|
314
314
|
max-width: 100%;
|
|
315
315
|
min-width: 0;
|
|
316
316
|
}
|
|
317
|
-
.sheetnav-toolbar[data-v-
|
|
317
|
+
.sheetnav-toolbar[data-v-cdbbd2a0] {
|
|
318
318
|
pointer-events: auto;
|
|
319
319
|
min-width: 0;
|
|
320
320
|
min-height: 2.4rem;
|
|
@@ -323,7 +323,7 @@ footer[data-v-7c905747] {
|
|
|
323
323
|
justify-content: flex-end;
|
|
324
324
|
align-items: center;
|
|
325
325
|
}
|
|
326
|
-
.tabs[data-v-
|
|
326
|
+
.tabs[data-v-cdbbd2a0] {
|
|
327
327
|
pointer-events: auto;
|
|
328
328
|
flex: 0 0 auto;
|
|
329
329
|
display: flex;
|
|
@@ -334,16 +334,15 @@ footer[data-v-7c905747] {
|
|
|
334
334
|
padding: 0;
|
|
335
335
|
list-style: none;
|
|
336
336
|
}
|
|
337
|
-
.tabs li[data-v-
|
|
337
|
+
.tabs li[data-v-cdbbd2a0] {
|
|
338
338
|
display: flex;
|
|
339
339
|
align-items: stretch;
|
|
340
340
|
list-style-type: none;
|
|
341
341
|
position: relative;
|
|
342
342
|
margin-left: -1px;
|
|
343
343
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
.tabs a[data-v-7c905747] {
|
|
344
|
+
.tabs a[data-v-cdbbd2a0],
|
|
345
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0] {
|
|
347
346
|
height: 100%;
|
|
348
347
|
min-height: 2.4rem;
|
|
349
348
|
padding: 0 1rem;
|
|
@@ -354,37 +353,38 @@ footer[data-v-7c905747] {
|
|
|
354
353
|
text-decoration: none;
|
|
355
354
|
color: var(--sc-gray-60);
|
|
356
355
|
background: var(--sc-btn-color);
|
|
357
|
-
border: 1px solid var(--sc-
|
|
356
|
+
border: 1px solid var(--sc-form-border);
|
|
357
|
+
border-radius: var(--sc-border-radius);
|
|
358
358
|
font-size: 0.85rem;
|
|
359
359
|
font-family: var(--sc-font-family);
|
|
360
|
-
transition:
|
|
360
|
+
transition:
|
|
361
|
+
background 0.15s ease,
|
|
362
|
+
border-color 0.15s ease;
|
|
363
|
+
}
|
|
361
364
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
+
/* row-reverse: the last li is the left edge of the strip. */
|
|
366
|
+
.tabs li:last-child a[data-v-cdbbd2a0],
|
|
367
|
+
.tabs li:last-child .hidebreadcrumbs-btn[data-v-cdbbd2a0] {
|
|
368
|
+
border-left-width: 4px;
|
|
365
369
|
}
|
|
366
|
-
.tabs a[data-v-
|
|
370
|
+
.tabs a[data-v-cdbbd2a0]:hover,
|
|
371
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0]:hover {
|
|
367
372
|
background: var(--sc-btn-hover);
|
|
368
373
|
}
|
|
369
|
-
.tabs .router-link-active[data-v-
|
|
374
|
+
.tabs .router-link-exact-active[data-v-cdbbd2a0] {
|
|
370
375
|
z-index: 3;
|
|
371
|
-
background: var(--sc-
|
|
372
|
-
|
|
373
|
-
color: var(--sc-primary-text-color) !important;
|
|
376
|
+
background: var(--sc-gray-5);
|
|
377
|
+
color: var(--sc-gray-80);
|
|
374
378
|
}
|
|
375
|
-
|
|
376
|
-
/* Pseudo-elements removed - minimal ornamentation style */
|
|
377
|
-
|
|
378
|
-
/* Hide breadcrumbs tab */
|
|
379
|
-
.hidebreadcrumbs a[data-v-7c905747] {
|
|
379
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0] {
|
|
380
380
|
min-width: 2.4rem;
|
|
381
381
|
width: 2.4rem;
|
|
382
382
|
padding: 0.5rem;
|
|
383
|
-
|
|
384
|
-
.hidebreadcrumbs a div[data-v-7c905747] {
|
|
383
|
+
cursor: pointer;
|
|
385
384
|
font-size: 1.2rem;
|
|
385
|
+
line-height: 1;
|
|
386
386
|
}
|
|
387
|
-
.rotated[data-v-
|
|
387
|
+
.rotated[data-v-cdbbd2a0] {
|
|
388
388
|
transform: rotate(45deg);
|
|
389
389
|
-webkit-transform: rotate(45deg);
|
|
390
390
|
-moz-transform: rotate(45deg);
|
|
@@ -392,7 +392,7 @@ footer[data-v-7c905747] {
|
|
|
392
392
|
-o-transform: rotate(45deg);
|
|
393
393
|
transition: transform 250ms ease;
|
|
394
394
|
}
|
|
395
|
-
.unrotated[data-v-
|
|
395
|
+
.unrotated[data-v-cdbbd2a0] {
|
|
396
396
|
transform: rotate(0deg);
|
|
397
397
|
-webkit-transform: rotate(0deg);
|
|
398
398
|
-moz-transform: rotate(0deg);
|
|
@@ -400,90 +400,38 @@ footer[data-v-7c905747] {
|
|
|
400
400
|
-o-transform: rotate(0deg);
|
|
401
401
|
transition: transform 250ms ease;
|
|
402
402
|
}
|
|
403
|
-
li[data-v-
|
|
404
|
-
li[data-v-
|
|
405
|
-
li[data-v-
|
|
406
|
-
li > a[data-v-
|
|
407
|
-
li > a[data-v-
|
|
408
|
-
li > a[data-v-
|
|
403
|
+
li[data-v-cdbbd2a0]:active,
|
|
404
|
+
li[data-v-cdbbd2a0]:hover,
|
|
405
|
+
li[data-v-cdbbd2a0]:focus,
|
|
406
|
+
li > a[data-v-cdbbd2a0]:active,
|
|
407
|
+
li > a[data-v-cdbbd2a0]:hover,
|
|
408
|
+
li > a[data-v-cdbbd2a0]:focus,
|
|
409
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0]:hover,
|
|
410
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0]:focus {
|
|
409
411
|
z-index: 3;
|
|
410
412
|
}
|
|
411
|
-
a[data-v-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
a[data-v-cdbbd2a0]:focus,
|
|
414
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0]:focus {
|
|
415
|
+
outline: none;
|
|
416
|
+
}
|
|
417
|
+
a[data-v-cdbbd2a0]:focus-visible,
|
|
418
|
+
.hidebreadcrumbs-btn[data-v-cdbbd2a0]:focus-visible {
|
|
419
|
+
outline: 1px solid var(--sc-input-active-border-color);
|
|
420
|
+
outline-offset: -1px;
|
|
415
421
|
z-index: 3;
|
|
416
422
|
}
|
|
417
|
-
|
|
418
|
-
/* Home tab */
|
|
419
|
-
.hometab a[data-v-7c905747] {
|
|
423
|
+
.hometab a[data-v-cdbbd2a0] {
|
|
420
424
|
min-width: 2.4rem;
|
|
421
425
|
width: 2.4rem;
|
|
422
426
|
padding: 0.5rem;
|
|
423
427
|
}
|
|
424
|
-
|
|
425
|
-
/* SVG icon styling */
|
|
426
|
-
.icon[data-v-7c905747] {
|
|
428
|
+
.icon[data-v-cdbbd2a0] {
|
|
427
429
|
width: 1rem;
|
|
428
430
|
height: 1rem;
|
|
429
431
|
stroke: currentColor;
|
|
430
432
|
flex-shrink: 0;
|
|
431
433
|
}
|
|
432
434
|
|
|
433
|
-
/* Search tab with animation */
|
|
434
|
-
.searchtab[data-v-7c905747] {
|
|
435
|
-
overflow: hidden;
|
|
436
|
-
}
|
|
437
|
-
.searchtab a[data-v-7c905747] {
|
|
438
|
-
min-width: 2.4rem;
|
|
439
|
-
padding: 0.5rem;
|
|
440
|
-
overflow: hidden;
|
|
441
|
-
/* Animation for smooth expand/collapse */
|
|
442
|
-
max-width: 2.4rem;
|
|
443
|
-
transition:
|
|
444
|
-
max-width 0.35s ease-in-out,
|
|
445
|
-
padding 0.35s ease-in-out,
|
|
446
|
-
background 0.2s ease;
|
|
447
|
-
}
|
|
448
|
-
.searchtab .search-icon[data-v-7c905747] {
|
|
449
|
-
cursor: pointer;
|
|
450
|
-
}
|
|
451
|
-
.searchtab input[data-v-7c905747] {
|
|
452
|
-
outline: none;
|
|
453
|
-
border: 1px solid var(--sc-input-border-color);
|
|
454
|
-
border-radius: 0.25rem;
|
|
455
|
-
background-color: var(--sc-form-background);
|
|
456
|
-
color: var(--sc-gray-80);
|
|
457
|
-
text-align: left;
|
|
458
|
-
font-size: 0.875rem;
|
|
459
|
-
padding: 0.25rem 0.5rem;
|
|
460
|
-
width: 180px;
|
|
461
|
-
height: 1.5rem;
|
|
462
|
-
flex-shrink: 0;
|
|
463
|
-
opacity: 0;
|
|
464
|
-
transition: opacity 0.2s ease-in-out;
|
|
465
|
-
transition-delay: 0s;
|
|
466
|
-
}
|
|
467
|
-
.searchtab input[data-v-7c905747]:focus {
|
|
468
|
-
border-color: var(--sc-input-active-border-color);
|
|
469
|
-
outline: none;
|
|
470
|
-
}
|
|
471
|
-
.searchtab input[data-v-7c905747]::placeholder {
|
|
472
|
-
color: var(--sc-input-label-color);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/* Search active state - expanded with animation */
|
|
476
|
-
.searchtab.search-active a[data-v-7c905747] {
|
|
477
|
-
max-width: 200px;
|
|
478
|
-
min-width: auto;
|
|
479
|
-
width: auto;
|
|
480
|
-
padding: 0.5rem 0.75rem;
|
|
481
|
-
}
|
|
482
|
-
.searchtab.search-active input[data-v-7c905747] {
|
|
483
|
-
opacity: 1;
|
|
484
|
-
transition-delay: 0.15s;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
435
|
.desktop[data-v-378bae6b] {
|
|
488
436
|
position: relative;
|
|
489
437
|
height: 100%;
|
package/dist/desktop.js
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, markRaw, mergeProps, nextTick, normalizeClass, normalizeProps,
|
|
1
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, markRaw, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useId, useTemplateRef, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
2
2
|
import { DRAFT_RECORD_ID, isDraftRecordId, useStonecrop, useValidationStore } from "@stonecrop/stonecrop";
|
|
3
3
|
import { AForm, resolvedFieldsToColumns } from "@stonecrop/aform";
|
|
4
4
|
import './assets/index.css';//#region src/components/CommandPalette.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1$3 = { class: "command-palette-header" };
|
|
6
|
-
var _hoisted_2$3 = ["placeholder"];
|
|
6
|
+
var _hoisted_2$3 = ["placeholder", "aria-activedescendant"];
|
|
7
7
|
var _hoisted_3$3 = {
|
|
8
8
|
key: 0,
|
|
9
|
-
|
|
9
|
+
id: "command-palette-results",
|
|
10
|
+
class: "command-palette-results",
|
|
11
|
+
role: "listbox",
|
|
12
|
+
"aria-label": "Command results"
|
|
10
13
|
};
|
|
11
|
-
var _hoisted_4$3 = [
|
|
14
|
+
var _hoisted_4$3 = [
|
|
15
|
+
"id",
|
|
16
|
+
"aria-selected",
|
|
17
|
+
"onClick",
|
|
18
|
+
"onMouseover"
|
|
19
|
+
];
|
|
12
20
|
var _hoisted_5$3 = { class: "result-title" };
|
|
13
21
|
var _hoisted_6$2 = { class: "result-content" };
|
|
14
22
|
var _hoisted_7$1 = {
|
|
15
23
|
key: 1,
|
|
16
|
-
class: "command-palette-no-results"
|
|
24
|
+
class: "command-palette-no-results",
|
|
25
|
+
role: "status",
|
|
26
|
+
"aria-live": "polite"
|
|
17
27
|
};
|
|
18
28
|
//#endregion
|
|
19
29
|
//#region src/components/CommandPalette.vue
|
|
@@ -31,6 +41,7 @@ var CommandPalette_default = /* @__PURE__ */ defineComponent({
|
|
|
31
41
|
emits: ["select", "close"],
|
|
32
42
|
setup(__props, { emit: __emit }) {
|
|
33
43
|
const emit = __emit;
|
|
44
|
+
const listboxId = useId();
|
|
34
45
|
const query = ref("");
|
|
35
46
|
const selectedIndex = ref(0);
|
|
36
47
|
const inputRef = useTemplateRef("input");
|
|
@@ -80,6 +91,9 @@ var CommandPalette_default = /* @__PURE__ */ defineComponent({
|
|
|
80
91
|
onClick: closeModal
|
|
81
92
|
}, [createElementVNode("div", {
|
|
82
93
|
class: "command-palette",
|
|
94
|
+
role: "dialog",
|
|
95
|
+
"aria-modal": "true",
|
|
96
|
+
"aria-label": "Command palette",
|
|
83
97
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
|
|
84
98
|
}, [createElementVNode("div", _hoisted_1$3, [withDirectives(createElementVNode("input", {
|
|
85
99
|
ref: "input",
|
|
@@ -87,12 +101,18 @@ var CommandPalette_default = /* @__PURE__ */ defineComponent({
|
|
|
87
101
|
type: "text",
|
|
88
102
|
class: "command-palette-input",
|
|
89
103
|
placeholder: __props.placeholder,
|
|
104
|
+
"aria-label": "Search commands",
|
|
105
|
+
"aria-activedescendant": results.value.length && selectedIndex.value >= 0 ? `${unref(listboxId)}-opt-${selectedIndex.value}` : void 0,
|
|
106
|
+
"aria-controls": "command-palette-results",
|
|
90
107
|
autofocus: "",
|
|
91
108
|
onKeydown: handleKeydown
|
|
92
109
|
}, null, 40, _hoisted_2$3), [[vModelText, query.value]])]), results.value.length ? (openBlock(), createElementBlock("div", _hoisted_3$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(results.value, (result, index) => {
|
|
93
110
|
return openBlock(), createElementBlock("div", {
|
|
111
|
+
id: `${unref(listboxId)}-opt-${index}`,
|
|
94
112
|
key: index,
|
|
95
113
|
class: normalizeClass(["command-palette-result", { selected: index === selectedIndex.value }]),
|
|
114
|
+
role: "option",
|
|
115
|
+
"aria-selected": index === selectedIndex.value,
|
|
96
116
|
onClick: ($event) => selectResult(result),
|
|
97
117
|
onMouseover: ($event) => selectedIndex.value = index
|
|
98
118
|
}, [createElementVNode("div", _hoisted_5$3, [renderSlot(_ctx.$slots, "title", { result })]), createElementVNode("div", _hoisted_6$2, [renderSlot(_ctx.$slots, "content", { result })])], 42, _hoisted_4$3);
|
|
@@ -422,8 +442,8 @@ var SHEET_NAV_TOOLBAR_SELECTOR = `#${SHEET_NAV_TOOLBAR_ID}`;
|
|
|
422
442
|
var _hoisted_1$1 = { class: "sheetnav-footer-cluster" };
|
|
423
443
|
var _hoisted_2$1 = ["id"];
|
|
424
444
|
var _hoisted_3$1 = { class: "tabs" };
|
|
425
|
-
var _hoisted_4$1 = {
|
|
426
|
-
var _hoisted_5$1 =
|
|
445
|
+
var _hoisted_4$1 = { class: "hidebreadcrumbs" };
|
|
446
|
+
var _hoisted_5$1 = ["aria-label", "aria-expanded"];
|
|
427
447
|
//#endregion
|
|
428
448
|
//#region src/components/SheetNav.vue
|
|
429
449
|
var SheetNav_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -434,30 +454,12 @@ var SheetNav_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
434
454
|
if (document.querySelectorAll(SHEET_NAV_TOOLBAR_SELECTOR).length > 1) console.warn(`More than one SheetNav is mounted: content teleported to ${SHEET_NAV_TOOLBAR_SELECTOR} lands in the first one only.`);
|
|
435
455
|
});
|
|
436
456
|
const breadcrumbsVisibile = ref(true);
|
|
437
|
-
const searchVisible = ref(false);
|
|
438
|
-
const searchText = ref("");
|
|
439
|
-
const inputRef = useTemplateRef("searchinput");
|
|
440
457
|
const rotateHideTabIcon = computed(() => {
|
|
441
458
|
return breadcrumbsVisibile.value ? "unrotated" : "rotated";
|
|
442
459
|
});
|
|
443
460
|
const toggleBreadcrumbs = () => {
|
|
444
461
|
breadcrumbsVisibile.value = !breadcrumbsVisibile.value;
|
|
445
462
|
};
|
|
446
|
-
const toggleSearch = async () => {
|
|
447
|
-
searchVisible.value = !searchVisible.value;
|
|
448
|
-
await nextTick(() => {
|
|
449
|
-
inputRef.value?.focus();
|
|
450
|
-
});
|
|
451
|
-
};
|
|
452
|
-
const handleSearchInput = (event) => {
|
|
453
|
-
event.preventDefault();
|
|
454
|
-
event.stopPropagation();
|
|
455
|
-
};
|
|
456
|
-
const handleSearch = async (event) => {
|
|
457
|
-
event.preventDefault();
|
|
458
|
-
event.stopPropagation();
|
|
459
|
-
await toggleSearch();
|
|
460
|
-
};
|
|
461
463
|
const navigateHome = () => {};
|
|
462
464
|
return (_ctx, _cache) => {
|
|
463
465
|
const _component_router_link = resolveComponent("router-link");
|
|
@@ -465,21 +467,26 @@ var SheetNav_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
465
467
|
id: unref(SHEET_NAV_TOOLBAR_ID),
|
|
466
468
|
class: "sheetnav-toolbar"
|
|
467
469
|
}, [renderSlot(_ctx.$slots, "toolbar", {}, void 0, true)], 8, _hoisted_2$1), createElementVNode("ul", _hoisted_3$1, [
|
|
468
|
-
createElementVNode("li", {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
470
|
+
createElementVNode("li", _hoisted_4$1, [createElementVNode("button", {
|
|
471
|
+
type: "button",
|
|
472
|
+
class: "hidebreadcrumbs-btn",
|
|
473
|
+
"aria-label": breadcrumbsVisibile.value ? "Hide breadcrumbs" : "Show breadcrumbs",
|
|
474
|
+
"aria-expanded": breadcrumbsVisibile.value,
|
|
475
|
+
onClick: toggleBreadcrumbs
|
|
476
|
+
}, [createElementVNode("span", {
|
|
477
|
+
class: normalizeClass(rotateHideTabIcon.value),
|
|
478
|
+
"aria-hidden": "true"
|
|
479
|
+
}, "×", 2)], 8, _hoisted_5$1)]),
|
|
480
|
+
breadcrumbsVisibile.value ? (openBlock(), createElementBlock("li", {
|
|
481
|
+
key: 0,
|
|
474
482
|
class: "hometab",
|
|
475
|
-
style: normalizeStyle({ display: breadcrumbsVisibile.value ? "flex" : "none" }),
|
|
476
483
|
onClick: navigateHome,
|
|
477
484
|
onKeydown: withKeys(navigateHome, ["enter"])
|
|
478
485
|
}, [createVNode(_component_router_link, {
|
|
479
486
|
to: "/",
|
|
480
487
|
tabindex: "0"
|
|
481
488
|
}, {
|
|
482
|
-
default: withCtx(() => [..._cache[
|
|
489
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
|
|
483
490
|
class: "icon",
|
|
484
491
|
"aria-label": "Home",
|
|
485
492
|
viewBox: "0 0 24 24",
|
|
@@ -488,50 +495,20 @@ var SheetNav_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
488
495
|
"stroke-width": "2"
|
|
489
496
|
}, [createElementVNode("path", { d: "M3 12l9-9 9 9" }), createElementVNode("path", { d: "M9 21V12h6v9" })], -1)])]),
|
|
490
497
|
_: 1
|
|
491
|
-
})],
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
style: normalizeStyle({ display: breadcrumbsVisibile.value ? "flex" : "none" })
|
|
495
|
-
}, [createElementVNode("a", _hoisted_5$1, [withDirectives((openBlock(), createElementBlock("svg", {
|
|
496
|
-
class: "icon search-icon",
|
|
497
|
-
role: "button",
|
|
498
|
-
"aria-label": "Search",
|
|
499
|
-
viewBox: "0 0 24 24",
|
|
500
|
-
fill: "none",
|
|
501
|
-
stroke: "currentColor",
|
|
502
|
-
"stroke-width": "2",
|
|
503
|
-
onClick: toggleSearch,
|
|
504
|
-
onKeydown: withKeys(toggleSearch, ["enter"])
|
|
505
|
-
}, [..._cache[6] || (_cache[6] = [createElementVNode("circle", {
|
|
506
|
-
cx: "11",
|
|
507
|
-
cy: "11",
|
|
508
|
-
r: "7"
|
|
509
|
-
}, null, -1), createElementVNode("path", { d: "M21 21l-4.35-4.35" }, null, -1)])], 544)), [[vShow, !searchVisible.value]]), withDirectives(createElementVNode("input", {
|
|
510
|
-
ref: "searchinput",
|
|
511
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
|
|
512
|
-
type: "text",
|
|
513
|
-
placeholder: "Search...",
|
|
514
|
-
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
|
|
515
|
-
onInput: _cache[2] || (_cache[2] = ($event) => handleSearchInput($event)),
|
|
516
|
-
onBlur: _cache[3] || (_cache[3] = ($event) => handleSearch($event)),
|
|
517
|
-
onKeydown: [_cache[4] || (_cache[4] = withKeys(($event) => handleSearch($event), ["enter"])), withKeys(toggleSearch, ["escape"])]
|
|
518
|
-
}, null, 544), [[vShow, searchVisible.value], [vModelText, searchText.value]])])], 6),
|
|
519
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.breadcrumbs, (breadcrumb) => {
|
|
520
|
-
return openBlock(), createElementBlock("li", {
|
|
521
|
-
key: breadcrumb.title,
|
|
522
|
-
style: normalizeStyle({ display: breadcrumbsVisibile.value ? "flex" : "none" })
|
|
523
|
-
}, [createVNode(_component_router_link, {
|
|
498
|
+
})], 32)) : createCommentVNode("", true),
|
|
499
|
+
breadcrumbsVisibile.value ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.breadcrumbs, (breadcrumb) => {
|
|
500
|
+
return openBlock(), createElementBlock("li", { key: breadcrumb.title }, [createVNode(_component_router_link, {
|
|
524
501
|
tabindex: "0",
|
|
525
502
|
to: breadcrumb.to
|
|
526
503
|
}, {
|
|
527
504
|
default: withCtx(() => [createTextVNode(toDisplayString(breadcrumb.title), 1)]),
|
|
528
505
|
_: 2
|
|
529
|
-
}, 1032, ["to"])]
|
|
530
|
-
}), 128))
|
|
506
|
+
}, 1032, ["to"])]);
|
|
507
|
+
}), 128)) : createCommentVNode("", true)
|
|
531
508
|
])])]);
|
|
532
509
|
};
|
|
533
510
|
}
|
|
534
|
-
}), [["__scopeId", "data-v-
|
|
511
|
+
}), [["__scopeId", "data-v-cdbbd2a0"]]);
|
|
535
512
|
//#endregion
|
|
536
513
|
//#region src/composables/useActionSet.ts
|
|
537
514
|
var actionSetKey = Symbol("actionSet");
|