@iris-ui-kit/vue 0.2.12 → 0.2.14
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/admin.cjs +324 -86
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +1 -1
- package/dist/behaviors.d.cts +1 -1
- package/dist/behaviors.d.ts +1 -1
- package/dist/{chunk-A4H4AEVB.js → chunk-KIEJL6C6.js} +326 -88
- package/dist/chunk-KIEJL6C6.js.map +1 -0
- package/dist/index.cjs +357 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
- package/dist/chunk-A4H4AEVB.js.map +0 -1
package/dist/admin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisNavMenu, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useTabsNav, visibleNav } from './chunk-
|
|
1
|
+
export { IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisNavMenu, createAdminPreferences, createTabsNav, filterNavByAccess, findNavNode, findNavPath, firstLeaf, flattenNav, isBranch, isClosable, localStorageAdminPreferencesStorage, nodeAllowsRoles, useAdminPreferences, useAdminShell, useTabsNav, visibleNav } from './chunk-KIEJL6C6.js';
|
|
2
2
|
import './chunk-3FJUCHCC.js';
|
|
3
3
|
import './chunk-TQB5LVOH.js';
|
|
4
4
|
import './chunk-F77KIPOH.js';
|
package/dist/behaviors.d.cts
CHANGED
|
@@ -388,8 +388,8 @@ declare const IrisSortable: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
388
388
|
}>, {
|
|
389
389
|
style: Record<string, string | number>;
|
|
390
390
|
orientation: "vertical" | "horizontal";
|
|
391
|
-
disabled: boolean;
|
|
392
391
|
class: string;
|
|
392
|
+
disabled: boolean;
|
|
393
393
|
onReorder: (next: unknown[]) => void;
|
|
394
394
|
getKey: (item: unknown, index: number) => string;
|
|
395
395
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
package/dist/behaviors.d.ts
CHANGED
|
@@ -388,8 +388,8 @@ declare const IrisSortable: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
388
388
|
}>, {
|
|
389
389
|
style: Record<string, string | number>;
|
|
390
390
|
orientation: "vertical" | "horizontal";
|
|
391
|
-
disabled: boolean;
|
|
392
391
|
class: string;
|
|
392
|
+
disabled: boolean;
|
|
393
393
|
onReorder: (next: unknown[]) => void;
|
|
394
394
|
getKey: (item: unknown, index: number) => string;
|
|
395
395
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
@@ -68,6 +68,253 @@ var IrisIcon = defineComponent({
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
// src/admin/styles.ts
|
|
72
|
+
var __NAV_MENU_STYLE_ID = "iris-nav-menu-styles";
|
|
73
|
+
var CSS = `
|
|
74
|
+
:where(.iris-nav-menu) {
|
|
75
|
+
--iris-nav-indent-step: 16px;
|
|
76
|
+
--iris-nav-item-padding-inline: 10px;
|
|
77
|
+
--iris-nav-item-padding-block: 8px;
|
|
78
|
+
--iris-nav-item-border-radius: var(--iris-radius-md, 6px);
|
|
79
|
+
--iris-nav-item-hover: var(--iris-surface-hover, var(--iris-surface));
|
|
80
|
+
--iris-nav-item-height: 34px;
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: stretch;
|
|
84
|
+
gap: 2px;
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:where(.iris-nav-menu--horizontal) {
|
|
89
|
+
flex-direction: row;
|
|
90
|
+
align-items: center;
|
|
91
|
+
width: auto;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:where(.iris-nav-menu-group) {
|
|
95
|
+
position: relative;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:where(.iris-nav-menu-item) {
|
|
99
|
+
appearance: none;
|
|
100
|
+
box-sizing: border-box;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex: 0 1 auto;
|
|
103
|
+
align-items: center;
|
|
104
|
+
width: 100%;
|
|
105
|
+
min-height: var(--iris-nav-item-height);
|
|
106
|
+
border: none;
|
|
107
|
+
border-radius: var(--iris-nav-item-border-radius);
|
|
108
|
+
background: transparent;
|
|
109
|
+
color: var(--iris-foreground, var(--iris-color-text, var(--iris-foreground)));
|
|
110
|
+
font: inherit;
|
|
111
|
+
font-size: 14px;
|
|
112
|
+
line-height: 1.2;
|
|
113
|
+
font-weight: 400;
|
|
114
|
+
text-align: start;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
opacity: 1;
|
|
117
|
+
margin: 0;
|
|
118
|
+
gap: 10px;
|
|
119
|
+
padding-block: var(--iris-nav-item-padding-block);
|
|
120
|
+
padding-inline: var(--iris-nav-item-padding-inline);
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:where(.iris-nav-menu--horizontal .iris-nav-menu-item) {
|
|
126
|
+
width: auto;
|
|
127
|
+
padding-inline-start: var(--iris-nav-item-padding-inline);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:where(.iris-nav-menu-item[data-depth='0']) {
|
|
131
|
+
--iris-nav-item-padding-inline-start: 10px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:where(.iris-nav-menu-item[data-depth='1']) {
|
|
135
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:where(.iris-nav-menu-item[data-depth='2']) {
|
|
139
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 2);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:where(.iris-nav-menu-item[data-depth='3']) {
|
|
143
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 3);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:where(.iris-nav-menu-item[data-depth='4']) {
|
|
147
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 4);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:where(.iris-nav-menu-item[data-depth='5']) {
|
|
151
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 5);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:where(.iris-nav-menu-item[data-depth='6']) {
|
|
155
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 6);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:where(.iris-nav-menu-item[data-depth='7']) {
|
|
159
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 7);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:where(.iris-nav-menu-item[data-depth='8']) {
|
|
163
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 8);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:where(.iris-nav-menu-item[data-depth='9']) {
|
|
167
|
+
--iris-nav-item-padding-inline-start: calc(12px + var(--iris-nav-indent-step) * 9);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:where(.iris-nav-menu--vertical .iris-nav-menu-item[data-depth]) {
|
|
171
|
+
padding-inline-start: var(--iris-nav-item-padding-inline-start);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:where(.iris-nav-menu-item:hover),
|
|
175
|
+
:where(.iris-nav-menu-item.is-hovered):not([disabled], .is-disabled) {
|
|
176
|
+
background: var(--iris-nav-item-hover);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:where(.iris-nav-menu-item[data-active='true']) {
|
|
180
|
+
background: var(--iris-primary);
|
|
181
|
+
color: var(--iris-primary-foreground, #fff);
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:where(.iris-nav-menu-item[data-active-trail='true']) {
|
|
186
|
+
color: var(--iris-primary);
|
|
187
|
+
font-weight: 600;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:where(.iris-nav-menu-item[disabled], .iris-nav-menu-item.is-disabled) {
|
|
191
|
+
cursor: not-allowed;
|
|
192
|
+
opacity: 0.5;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:where(.iris-nav-menu-item:focus-visible) {
|
|
196
|
+
outline: 2px solid var(--iris-ring, var(--iris-primary));
|
|
197
|
+
outline-offset: 1px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:where(.iris-nav-menu-label) {
|
|
201
|
+
flex: 0 1 auto;
|
|
202
|
+
min-width: 0;
|
|
203
|
+
overflow: hidden;
|
|
204
|
+
text-overflow: ellipsis;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
:where(.iris-nav-menu-badge) {
|
|
208
|
+
margin-inline-start: 6px;
|
|
209
|
+
font-size: 11px;
|
|
210
|
+
line-height: 1;
|
|
211
|
+
padding: 2px 6px;
|
|
212
|
+
border-radius: 999px;
|
|
213
|
+
background: var(--iris-danger, #e5484d);
|
|
214
|
+
color: #fff;
|
|
215
|
+
flex: 0 0 auto;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
:where(.iris-nav-menu-arrow) {
|
|
219
|
+
flex: 0 0 auto;
|
|
220
|
+
opacity: 0.6;
|
|
221
|
+
transform: rotate(0deg);
|
|
222
|
+
transform-origin: center;
|
|
223
|
+
transition: transform 160ms ease;
|
|
224
|
+
margin-inline-start: auto;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
:where(.iris-nav-menu-arrow[data-reversed='true']) {
|
|
228
|
+
transform: rotate(180deg);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:where(.iris-nav-menu-fallback-icon) {
|
|
232
|
+
display: inline-flex;
|
|
233
|
+
width: 20px;
|
|
234
|
+
height: 20px;
|
|
235
|
+
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
font-weight: 700;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:where(.iris-nav-menu-item.is-disabled) .iris-nav-menu-label {
|
|
241
|
+
opacity: 0.75;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:where(.iris-nav-menu-group--depth-0 > .iris-nav-menu-children) {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:where(.iris-nav-menu-group--depth-1 > .iris-nav-menu-children),
|
|
249
|
+
:where(.iris-nav-menu-group--depth-2 > .iris-nav-menu-children),
|
|
250
|
+
:where(.iris-nav-menu-group--depth-3 > .iris-nav-menu-children),
|
|
251
|
+
:where(.iris-nav-menu-group--depth-4 > .iris-nav-menu-children),
|
|
252
|
+
:where(.iris-nav-menu-group--depth-5 > .iris-nav-menu-children),
|
|
253
|
+
:where(.iris-nav-menu-group--depth-6 > .iris-nav-menu-children),
|
|
254
|
+
:where(.iris-nav-menu-group--depth-7 > .iris-nav-menu-children),
|
|
255
|
+
:where(.iris-nav-menu-group--depth-8 > .iris-nav-menu-children),
|
|
256
|
+
:where(.iris-nav-menu-group--depth-9 > .iris-nav-menu-children),
|
|
257
|
+
:where(.iris-nav-menu-group > .iris-nav-menu-children) {
|
|
258
|
+
display: none;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:where(.iris-nav-menu-group[data-open='true'] > .iris-nav-menu-children) {
|
|
262
|
+
display: block;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:where(.iris-nav-menu--horizontal .iris-nav-menu-group > .iris-nav-menu-children) {
|
|
266
|
+
position: absolute;
|
|
267
|
+
min-width: 220px;
|
|
268
|
+
padding: 6px;
|
|
269
|
+
border: 1px solid var(--iris-border);
|
|
270
|
+
border-radius: var(--iris-radius-md, 6px);
|
|
271
|
+
background: var(--iris-surface);
|
|
272
|
+
box-shadow: var(--iris-shadow-md);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
:where(.iris-nav-menu--horizontal .iris-nav-menu-group[data-depth='0'] > .iris-nav-menu-children) {
|
|
276
|
+
inset-block-start: 100%;
|
|
277
|
+
inset-inline-start: 0;
|
|
278
|
+
z-index: 60;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
:where(.iris-nav-menu--horizontal .iris-nav-menu-group[data-depth]:not([data-depth='0']) > .iris-nav-menu-children) {
|
|
282
|
+
inset-block-start: 0;
|
|
283
|
+
inset-inline-start: 100%;
|
|
284
|
+
z-index: 61;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
:where(.iris-nav-menu--collapsed .iris-nav-menu-item) {
|
|
288
|
+
justify-content: center;
|
|
289
|
+
padding-inline-start: var(--iris-nav-item-padding-inline);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
:where(.iris-nav-menu-item.is-collapsed) {
|
|
293
|
+
justify-content: center;
|
|
294
|
+
padding-inline: var(--iris-nav-item-padding-inline);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@media (prefers-reduced-motion: reduce) {
|
|
298
|
+
:where(.iris-nav-menu-arrow) {
|
|
299
|
+
transition: none;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
`.trim();
|
|
303
|
+
var installed = false;
|
|
304
|
+
function installNavMenuStyles() {
|
|
305
|
+
if (installed) return;
|
|
306
|
+
if (typeof document === "undefined") return;
|
|
307
|
+
if (document.getElementById(__NAV_MENU_STYLE_ID)) {
|
|
308
|
+
installed = true;
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const style = document.createElement("style");
|
|
312
|
+
style.id = __NAV_MENU_STYLE_ID;
|
|
313
|
+
style.textContent = CSS;
|
|
314
|
+
document.head.appendChild(style);
|
|
315
|
+
installed = true;
|
|
316
|
+
}
|
|
317
|
+
|
|
71
318
|
// src/admin/NavMenu.ts
|
|
72
319
|
var IrisNavMenu = defineComponent({
|
|
73
320
|
name: "IrisNavMenu",
|
|
@@ -94,6 +341,7 @@ var IrisNavMenu = defineComponent({
|
|
|
94
341
|
"update:expandedKeys": (_keys) => true
|
|
95
342
|
},
|
|
96
343
|
setup(props, { emit, attrs }) {
|
|
344
|
+
installNavMenuStyles();
|
|
97
345
|
const { t } = useI18n();
|
|
98
346
|
const tree = computed(() => visibleNav(props.items));
|
|
99
347
|
const activePath = computed(
|
|
@@ -159,49 +407,25 @@ var IrisNavMenu = defineComponent({
|
|
|
159
407
|
if (hoveredAtDepth) return hoveredAtDepth === key;
|
|
160
408
|
return interactionKeyAtDepth(focusedBranches.value, depth) === key;
|
|
161
409
|
};
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
font: "inherit",
|
|
175
|
-
fontSize: "14px",
|
|
176
|
-
fontWeight: opts.active || opts.trail ? "600" : "400",
|
|
177
|
-
textAlign: "start",
|
|
178
|
-
cursor: opts.disabled ? "not-allowed" : "pointer",
|
|
179
|
-
opacity: opts.disabled ? "0.5" : "1",
|
|
180
|
-
padding: props.collapsed ? "10px" : "8px 10px",
|
|
181
|
-
paddingInlineStart: props.collapsed || props.orientation === "horizontal" ? "10px" : `${12 + opts.depth * 16}px`,
|
|
182
|
-
justifyContent: props.collapsed ? "center" : "flex-start"
|
|
183
|
-
};
|
|
410
|
+
const itemClass = (opts) => {
|
|
411
|
+
const depth = Math.min(9, opts.depth);
|
|
412
|
+
return [
|
|
413
|
+
"iris-nav-menu-item",
|
|
414
|
+
`iris-nav-menu-item--depth-${depth}`,
|
|
415
|
+
`iris-nav-menu-item--${opts.branch ? "branch" : "leaf"}`,
|
|
416
|
+
opts.active ? "is-active" : void 0,
|
|
417
|
+
opts.trail ? "is-trail" : void 0,
|
|
418
|
+
opts.hovered ? "is-hovered" : void 0,
|
|
419
|
+
opts.open ? "is-open" : void 0,
|
|
420
|
+
opts.disabled ? "is-disabled" : void 0
|
|
421
|
+
].filter(Boolean);
|
|
184
422
|
};
|
|
185
|
-
const hoverHandlers = (key) => ({
|
|
186
|
-
onMouseenter: () => hovered.value = key,
|
|
187
|
-
onMouseleave: () => {
|
|
188
|
-
if (hovered.value === key) hovered.value = null;
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
423
|
const iconNode = (node, size = 18) => node.icon ? h(IrisIcon, { name: node.icon, size }) : null;
|
|
192
424
|
const badgeNode = (node) => node.badge !== void 0 && node.badge !== "" && !props.collapsed ? h(
|
|
193
425
|
"span",
|
|
194
426
|
{
|
|
195
|
-
"
|
|
196
|
-
|
|
197
|
-
marginInlineStart: "auto",
|
|
198
|
-
fontSize: "11px",
|
|
199
|
-
lineHeight: "1",
|
|
200
|
-
padding: "2px 6px",
|
|
201
|
-
borderRadius: "999px",
|
|
202
|
-
background: "var(--iris-danger, #e5484d)",
|
|
203
|
-
color: "#fff"
|
|
204
|
-
}
|
|
427
|
+
class: "iris-nav-menu-badge",
|
|
428
|
+
"data-iris-nav-badge": ""
|
|
205
429
|
},
|
|
206
430
|
String(node.badge)
|
|
207
431
|
) : null;
|
|
@@ -213,25 +437,38 @@ var IrisNavMenu = defineComponent({
|
|
|
213
437
|
{
|
|
214
438
|
key: node.key,
|
|
215
439
|
type: "button",
|
|
440
|
+
class: [
|
|
441
|
+
...itemClass({
|
|
442
|
+
depth: 0,
|
|
443
|
+
active,
|
|
444
|
+
trail: false,
|
|
445
|
+
hovered: hovered.value === node.key,
|
|
446
|
+
open: false,
|
|
447
|
+
disabled: !!node.disabled,
|
|
448
|
+
branch
|
|
449
|
+
}),
|
|
450
|
+
"is-collapsed"
|
|
451
|
+
],
|
|
216
452
|
"data-iris-nav-item": "",
|
|
217
453
|
"data-key": node.key,
|
|
218
454
|
"data-active": active ? "true" : void 0,
|
|
219
455
|
"data-branch": branch ? "true" : void 0,
|
|
456
|
+
"data-hovered": hovered.value === node.key ? "true" : void 0,
|
|
220
457
|
disabled: node.disabled,
|
|
221
458
|
title: node.title,
|
|
222
459
|
"aria-label": branch ? `${node.title} (section)` : node.title,
|
|
223
460
|
"aria-current": active && !branch ? "page" : void 0,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}),
|
|
231
|
-
...hoverHandlers(node.key),
|
|
461
|
+
onMouseenter: () => {
|
|
462
|
+
if (!node.disabled) hovered.value = node.key;
|
|
463
|
+
},
|
|
464
|
+
onMouseleave: () => {
|
|
465
|
+
if (hovered.value === node.key) hovered.value = null;
|
|
466
|
+
},
|
|
232
467
|
onClick: () => select(branch ? firstLeaf(node) : node)
|
|
233
468
|
},
|
|
234
|
-
[
|
|
469
|
+
[
|
|
470
|
+
iconNode(node, 20) ?? h("span", { class: "iris-nav-menu-fallback-icon" }, node.title.charAt(0))
|
|
471
|
+
]
|
|
235
472
|
);
|
|
236
473
|
});
|
|
237
474
|
const renderItem = (node, depth) => {
|
|
@@ -241,28 +478,38 @@ var IrisNavMenu = defineComponent({
|
|
|
241
478
|
const shown = horizontal ? horizontalBranchVisible(node.key, depth) : open;
|
|
242
479
|
const active = node.key === props.activeKey;
|
|
243
480
|
const trail = branch && !active && activePath.value.includes(node.key);
|
|
481
|
+
const arrowReversed = branch && !node.disabled && (active || trail || shown || hovered.value === node.key);
|
|
244
482
|
const row = h(
|
|
245
483
|
"button",
|
|
246
484
|
{
|
|
247
485
|
type: "button",
|
|
486
|
+
class: itemClass({
|
|
487
|
+
depth,
|
|
488
|
+
active,
|
|
489
|
+
trail,
|
|
490
|
+
hovered: hovered.value === node.key,
|
|
491
|
+
open: branch ? shown : false,
|
|
492
|
+
disabled: !!node.disabled,
|
|
493
|
+
branch
|
|
494
|
+
}),
|
|
248
495
|
"data-iris-nav-item": "",
|
|
249
496
|
"data-key": node.key,
|
|
250
497
|
"data-branch": branch ? "true" : void 0,
|
|
251
498
|
"data-active": active ? "true" : void 0,
|
|
252
499
|
"data-active-trail": trail ? "true" : void 0,
|
|
253
500
|
"data-open": branch && shown ? "true" : void 0,
|
|
501
|
+
"data-hovered": hovered.value === node.key ? "true" : void 0,
|
|
254
502
|
"data-depth": String(depth),
|
|
503
|
+
"data-orientation": props.orientation,
|
|
255
504
|
disabled: node.disabled,
|
|
256
505
|
"aria-expanded": branch ? shown ? "true" : "false" : void 0,
|
|
257
506
|
"aria-current": active ? "page" : void 0,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}),
|
|
265
|
-
...hoverHandlers(node.key),
|
|
507
|
+
onMouseenter: () => {
|
|
508
|
+
if (!node.disabled) hovered.value = node.key;
|
|
509
|
+
},
|
|
510
|
+
onMouseleave: () => {
|
|
511
|
+
if (hovered.value === node.key) hovered.value = null;
|
|
512
|
+
},
|
|
266
513
|
onClick: () => branch ? toggle(node.key) : select(node)
|
|
267
514
|
},
|
|
268
515
|
[
|
|
@@ -270,12 +517,7 @@ var IrisNavMenu = defineComponent({
|
|
|
270
517
|
h(
|
|
271
518
|
"span",
|
|
272
519
|
{
|
|
273
|
-
|
|
274
|
-
flex: branch ? "1" : "0 1 auto",
|
|
275
|
-
overflow: "hidden",
|
|
276
|
-
textOverflow: "ellipsis",
|
|
277
|
-
whiteSpace: "nowrap"
|
|
278
|
-
}
|
|
520
|
+
class: "iris-nav-menu-label"
|
|
279
521
|
},
|
|
280
522
|
node.title
|
|
281
523
|
),
|
|
@@ -283,15 +525,19 @@ var IrisNavMenu = defineComponent({
|
|
|
283
525
|
branch ? h(IrisIcon, {
|
|
284
526
|
name: horizontal && depth === 0 ? "chevron-down" : "chevron-right",
|
|
285
527
|
size: 16,
|
|
286
|
-
|
|
528
|
+
class: "iris-nav-menu-arrow",
|
|
529
|
+
"data-reversed": arrowReversed ? "true" : void 0
|
|
287
530
|
}) : null
|
|
288
531
|
]
|
|
289
532
|
);
|
|
290
|
-
const groupStyle = horizontal && branch ? { position: "relative" } : void 0;
|
|
291
533
|
if (!branch || !horizontal && !open)
|
|
292
534
|
return h(
|
|
293
535
|
"div",
|
|
294
|
-
{
|
|
536
|
+
{
|
|
537
|
+
key: node.key,
|
|
538
|
+
"data-iris-nav-group": branch ? "" : void 0,
|
|
539
|
+
class: ["iris-nav-menu-group", `iris-nav-menu-group--depth-${Math.min(9, depth)}`]
|
|
540
|
+
},
|
|
295
541
|
[row]
|
|
296
542
|
);
|
|
297
543
|
return h(
|
|
@@ -300,7 +546,11 @@ var IrisNavMenu = defineComponent({
|
|
|
300
546
|
key: node.key,
|
|
301
547
|
"data-iris-nav-group": "",
|
|
302
548
|
"data-open": shown ? "true" : void 0,
|
|
303
|
-
|
|
549
|
+
"data-depth": String(depth),
|
|
550
|
+
class: [
|
|
551
|
+
"iris-nav-menu-group",
|
|
552
|
+
`iris-nav-menu-group--depth-${Math.min(9, depth)}`
|
|
553
|
+
],
|
|
304
554
|
...horizontal ? {
|
|
305
555
|
onMouseenter: () => setBranchInteraction(hoveredBranches, node.key, true),
|
|
306
556
|
onMouseleave: () => setBranchInteraction(hoveredBranches, node.key, false),
|
|
@@ -319,22 +569,10 @@ var IrisNavMenu = defineComponent({
|
|
|
319
569
|
h(
|
|
320
570
|
"div",
|
|
321
571
|
{
|
|
572
|
+
class: "iris-nav-menu-children",
|
|
322
573
|
"data-iris-nav-children": "",
|
|
323
574
|
role: "group",
|
|
324
|
-
"aria-hidden": horizontal && !shown ? "true" : void 0
|
|
325
|
-
style: horizontal ? {
|
|
326
|
-
display: shown ? "block" : "none",
|
|
327
|
-
position: "absolute",
|
|
328
|
-
insetBlockStart: depth === 0 ? "100%" : "0",
|
|
329
|
-
insetInlineStart: depth === 0 ? "0" : "100%",
|
|
330
|
-
zIndex: depth === 0 ? "60" : "61",
|
|
331
|
-
minWidth: "220px",
|
|
332
|
-
padding: "6px",
|
|
333
|
-
border: "1px solid var(--iris-border)",
|
|
334
|
-
borderRadius: "var(--iris-radius-md, 6px)",
|
|
335
|
-
background: "var(--iris-surface)",
|
|
336
|
-
boxShadow: "var(--iris-shadow-md)"
|
|
337
|
-
} : void 0
|
|
575
|
+
"aria-hidden": horizontal && !shown ? "true" : void 0
|
|
338
576
|
},
|
|
339
577
|
(node.children ?? []).map((child) => renderItem(child, depth + 1))
|
|
340
578
|
)
|
|
@@ -388,22 +626,22 @@ var IrisNavMenu = defineComponent({
|
|
|
388
626
|
}
|
|
389
627
|
}
|
|
390
628
|
};
|
|
629
|
+
const menuClass = [
|
|
630
|
+
"iris-nav-menu",
|
|
631
|
+
`iris-nav-menu--${props.orientation}`,
|
|
632
|
+
props.collapsed ? "iris-nav-menu--collapsed" : "iris-nav-menu--expanded"
|
|
633
|
+
];
|
|
391
634
|
return () => h(
|
|
392
635
|
"nav",
|
|
393
636
|
{
|
|
394
637
|
...attrs,
|
|
638
|
+
class: [...menuClass, attrs.class],
|
|
395
639
|
"data-iris-nav-menu": "",
|
|
396
640
|
"data-collapsed": props.collapsed ? "true" : void 0,
|
|
397
641
|
"data-orientation": props.orientation,
|
|
398
642
|
"aria-label": props.ariaLabel ?? t("admin.nav"),
|
|
399
643
|
onKeydown,
|
|
400
|
-
style:
|
|
401
|
-
display: "flex",
|
|
402
|
-
flexDirection: props.orientation === "horizontal" ? "row" : "column",
|
|
403
|
-
alignItems: props.orientation === "horizontal" ? "center" : void 0,
|
|
404
|
-
gap: "2px",
|
|
405
|
-
...attrs.style ?? {}
|
|
406
|
-
}
|
|
644
|
+
style: attrs.style
|
|
407
645
|
},
|
|
408
646
|
props.collapsed ? renderCollapsed() : tree.value.map((node) => renderItem(node, 0))
|
|
409
647
|
);
|
|
@@ -1555,5 +1793,5 @@ function useAdminPreferences(preferences, hydrate = true) {
|
|
|
1555
1793
|
}
|
|
1556
1794
|
|
|
1557
1795
|
export { DropdownContextKey, IrisAdminBreadcrumb, IrisAdminLayout, IrisAdminTabs, IrisBreadcrumb, IrisBreadcrumbItem, IrisDropdown, IrisDropdownItem, IrisDropdownMenu, IrisDropdownSeparator, IrisDropdownTrigger, IrisIcon, IrisNavMenu, useAdminPreferences, useAdminShell, useTabsNav };
|
|
1558
|
-
//# sourceMappingURL=chunk-
|
|
1559
|
-
//# sourceMappingURL=chunk-
|
|
1796
|
+
//# sourceMappingURL=chunk-KIEJL6C6.js.map
|
|
1797
|
+
//# sourceMappingURL=chunk-KIEJL6C6.js.map
|