@byyuurin/ui 0.5.0 → 0.5.2
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 +3 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -4
- package/dist/runtime/components/Accordion.vue +9 -9
- package/dist/runtime/components/Alert.vue +9 -9
- package/dist/runtime/components/Avatar.vue +4 -4
- package/dist/runtime/components/AvatarGroup.vue +3 -3
- package/dist/runtime/components/Badge.vue +5 -5
- package/dist/runtime/components/Breadcrumb.vue +9 -9
- package/dist/runtime/components/Button.vue +5 -5
- package/dist/runtime/components/Calendar.vue +11 -11
- package/dist/runtime/components/Card.vue +6 -6
- package/dist/runtime/components/Carousel.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +9 -9
- package/dist/runtime/components/CheckboxGroup.vue +4 -4
- package/dist/runtime/components/Chip.vue +2 -2
- package/dist/runtime/components/Collapsible.vue +2 -2
- package/dist/runtime/components/ContextMenuContent.vue +18 -18
- package/dist/runtime/components/Drawer.vue +9 -9
- package/dist/runtime/components/DropdownMenu.vue +2 -2
- package/dist/runtime/components/DropdownMenuContent.vue +19 -19
- package/dist/runtime/components/FieldGroup.vue +1 -1
- package/dist/runtime/components/FileUpload.vue +15 -15
- package/dist/runtime/components/Form.vue +1 -1
- package/dist/runtime/components/FormField.vue +9 -9
- package/dist/runtime/components/Input.vue +7 -7
- package/dist/runtime/components/InputNumber.vue +4 -4
- package/dist/runtime/components/InputTags.vue +12 -12
- package/dist/runtime/components/Kbd.vue +1 -1
- package/dist/runtime/components/Marquee.vue +2 -2
- package/dist/runtime/components/Modal.vue +9 -9
- package/dist/runtime/components/NavigationMenu.vue +40 -40
- package/dist/runtime/components/Pagination.vue +8 -8
- package/dist/runtime/components/PinInput.vue +2 -2
- package/dist/runtime/components/Popover.vue +2 -2
- package/dist/runtime/components/Progress.vue +6 -6
- package/dist/runtime/components/RadioGroup.vue +10 -10
- package/dist/runtime/components/ScrollArea.vue +7 -7
- package/dist/runtime/components/Select.vue +31 -31
- package/dist/runtime/components/Separator.vue +7 -7
- package/dist/runtime/components/Skeleton.vue +1 -1
- package/dist/runtime/components/Slider.vue +4 -4
- package/dist/runtime/components/Stepper.vue +12 -12
- package/dist/runtime/components/Switch.vue +10 -10
- package/dist/runtime/components/Table.vue +22 -22
- package/dist/runtime/components/Tabs.vue +9 -9
- package/dist/runtime/components/Textarea.vue +7 -7
- package/dist/runtime/components/Timeline.vue +9 -9
- package/dist/runtime/components/Toast.vue +10 -9
- package/dist/runtime/components/ToastProvider.vue +2 -2
- package/dist/runtime/components/Tooltip.vue +4 -4
- package/dist/runtime/components/Tree.vue +10 -10
- package/dist/runtime/composables/defineShortcuts.js +1 -1
- package/dist/runtime/composables/useOverlay.d.ts +3 -1
- package/dist/runtime/utils/style.d.ts +10 -10
- package/dist/runtime/vue/overrides/none/Link.vue +119 -0
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +79 -0
- package/dist/runtime/vue/{components → overrides/vue-router}/Link.vue +42 -42
- package/dist/runtime/vue/{components → overrides/vue-router}/Link.vue.d.ts +8 -8
- package/dist/runtime/vue/{stubs.d.ts → stubs/base.d.ts} +1 -2
- package/dist/runtime/vue/{stubs.js → stubs/base.js} +1 -2
- package/dist/runtime/vue/stubs/none.d.ts +56 -0
- package/dist/runtime/vue/stubs/none.js +48 -0
- package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
- package/dist/runtime/vue/stubs/vue-router.js +2 -0
- package/dist/setup.d.mts +1 -1
- package/dist/shared/{ui.Cakz_vv4.mjs → ui.B6u-xvto.mjs} +42 -44
- package/dist/shared/{ui.CGCKYv7g.d.mts → ui.Cec0yP1b.d.mts} +11 -2
- package/dist/shared/{ui.DYMXCXO6.mjs → ui.Dy7aH7sf.mjs} +12 -6
- package/dist/unocss.d.mts +20 -2
- package/dist/unocss.mjs +25 -2
- package/dist/unplugin.d.mts +1 -1
- package/dist/unplugin.mjs +68 -25
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +4 -3
- package/package.json +34 -33
|
@@ -302,16 +302,16 @@ defineExpose({
|
|
|
302
302
|
<tr
|
|
303
303
|
:role="props.onSelect ? 'button' : void 0"
|
|
304
304
|
:tabindex="props.onSelect ? 0 : void 0"
|
|
305
|
+
:data-selected="row.getIsSelected()"
|
|
306
|
+
:data-selectable="!!props.onSelect || !!props.onHover || !!props.onContextmenu"
|
|
307
|
+
:data-expanded="row.getIsExpanded()"
|
|
308
|
+
data-part="tr"
|
|
305
309
|
:class="ui.tr({
|
|
306
310
|
class: [
|
|
307
311
|
props.ui?.tr,
|
|
308
312
|
resolveValue(tableApi.options.meta?.class?.tr, row)
|
|
309
313
|
]
|
|
310
314
|
})"
|
|
311
|
-
:data-selected="row.getIsSelected()"
|
|
312
|
-
:data-selectable="!!props.onSelect || !!props.onHover || !!props.onContextmenu"
|
|
313
|
-
:data-expanded="row.getIsExpanded()"
|
|
314
|
-
data-part="tr"
|
|
315
315
|
:style="[resolveValue(tableApi.options.meta?.style?.tr, row), style]"
|
|
316
316
|
@click="onRowSelect($event, row)"
|
|
317
317
|
@pointerenter="onRowHover($event, row)"
|
|
@@ -323,6 +323,8 @@ defineExpose({
|
|
|
323
323
|
:key="cell.id"
|
|
324
324
|
:colspan="resolveValue(cell.column.columnDef.meta?.colspan?.td, cell)"
|
|
325
325
|
:rowspan="resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell)"
|
|
326
|
+
:data-pinned="cell.column.getIsPinned()"
|
|
327
|
+
data-part="td"
|
|
326
328
|
:class="ui.td({
|
|
327
329
|
class: [
|
|
328
330
|
props.ui?.td,
|
|
@@ -330,8 +332,6 @@ defineExpose({
|
|
|
330
332
|
],
|
|
331
333
|
pinned: !!cell.column.getIsPinned()
|
|
332
334
|
})"
|
|
333
|
-
:data-pinned="cell.column.getIsPinned()"
|
|
334
|
-
data-part="td"
|
|
335
335
|
:style="[
|
|
336
336
|
getColumnStyles(cell.column),
|
|
337
337
|
resolveValue(cell.column.columnDef.meta?.style?.td, cell)
|
|
@@ -343,23 +343,23 @@ defineExpose({
|
|
|
343
343
|
</td>
|
|
344
344
|
</tr>
|
|
345
345
|
|
|
346
|
-
<tr v-if="row.getIsExpanded()" :class="ui.tr({ class: props.ui?.tr })"
|
|
347
|
-
<td :colspan="row.getAllCells().length" :class="ui.td({ class: props.ui?.td })"
|
|
346
|
+
<tr v-if="row.getIsExpanded()" data-part="tr" :class="ui.tr({ class: props.ui?.tr })">
|
|
347
|
+
<td :colspan="row.getAllCells().length" data-part="td" :class="ui.td({ class: props.ui?.td })">
|
|
348
348
|
<slot name="expanded" :row="row"></slot>
|
|
349
349
|
</td>
|
|
350
350
|
</tr>
|
|
351
351
|
</DefineRowTemplate>
|
|
352
352
|
|
|
353
353
|
<DefineTableTemplate>
|
|
354
|
-
<table ref="tableRef" :class="ui.base({ class: props.ui?.base })"
|
|
355
|
-
<caption v-if="caption || !!slots.caption" :class="ui.caption({ class: [props.ui?.caption] })"
|
|
354
|
+
<table ref="tableRef" data-part="base" :class="ui.base({ class: props.ui?.base })">
|
|
355
|
+
<caption v-if="caption || !!slots.caption" data-part="caption" :class="ui.caption({ class: [props.ui?.caption] })">
|
|
356
356
|
<slot name="caption">
|
|
357
357
|
{{ caption }}
|
|
358
358
|
</slot>
|
|
359
359
|
</caption>
|
|
360
360
|
|
|
361
|
-
<thead :class="ui.thead({ class: [props.ui?.thead] })"
|
|
362
|
-
<tr v-for="headerGroup in tableApi.getHeaderGroups()" :key="headerGroup.id" :class="ui.tr({ class: [props.ui?.tr] })"
|
|
361
|
+
<thead data-part="thead" :class="ui.thead({ class: [props.ui?.thead] })">
|
|
362
|
+
<tr v-for="headerGroup in tableApi.getHeaderGroups()" :key="headerGroup.id" data-part="tr" :class="ui.tr({ class: [props.ui?.tr] })">
|
|
363
363
|
<th
|
|
364
364
|
v-for="header in headerGroup.headers"
|
|
365
365
|
:key="header.id"
|
|
@@ -367,6 +367,7 @@ defineExpose({
|
|
|
367
367
|
:scope="header.colSpan > 1 ? 'colgroup' : 'col'"
|
|
368
368
|
:colspan="header.colSpan > 1 ? header.colSpan : void 0"
|
|
369
369
|
:rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
|
|
370
|
+
data-part="th"
|
|
370
371
|
:class="ui.th({
|
|
371
372
|
class: [
|
|
372
373
|
props.ui?.th,
|
|
@@ -374,7 +375,6 @@ defineExpose({
|
|
|
374
375
|
],
|
|
375
376
|
pinned: !!header.column.getIsPinned()
|
|
376
377
|
})"
|
|
377
|
-
data-part="th"
|
|
378
378
|
:style="[
|
|
379
379
|
getColumnStyles(header.column),
|
|
380
380
|
resolveValue(header.column.columnDef.meta?.style?.th, header)
|
|
@@ -386,10 +386,10 @@ defineExpose({
|
|
|
386
386
|
</th>
|
|
387
387
|
</tr>
|
|
388
388
|
|
|
389
|
-
<tr :class="ui.separator({ class: [props.ui?.separator] })"
|
|
389
|
+
<tr data-part="separator" :class="ui.separator({ class: [props.ui?.separator] })"></tr>
|
|
390
390
|
</thead>
|
|
391
391
|
|
|
392
|
-
<tbody :class="ui.tbody({ class: [props.ui?.tbody] })"
|
|
392
|
+
<tbody data-part="tbody" :class="ui.tbody({ class: [props.ui?.tbody] })">
|
|
393
393
|
<slot name="body-top"></slot>
|
|
394
394
|
|
|
395
395
|
<template v-if="rows.length">
|
|
@@ -411,13 +411,13 @@ defineExpose({
|
|
|
411
411
|
</template>
|
|
412
412
|
|
|
413
413
|
<tr v-else-if="props.loading && !!slots.loading">
|
|
414
|
-
<td :colspan="tableApi.getAllLeafColumns().length" :class="ui.loading({ class: props.ui?.loading })"
|
|
414
|
+
<td :colspan="tableApi.getAllLeafColumns().length" data-part="loading" :class="ui.loading({ class: props.ui?.loading })">
|
|
415
415
|
<slot name="loading"></slot>
|
|
416
416
|
</td>
|
|
417
417
|
</tr>
|
|
418
418
|
|
|
419
419
|
<tr v-else>
|
|
420
|
-
<td :colspan="tableApi.getAllLeafColumns().length" :class="ui.empty({ class: props.ui?.empty })"
|
|
420
|
+
<td :colspan="tableApi.getAllLeafColumns().length" data-part="empty" :class="ui.empty({ class: props.ui?.empty })">
|
|
421
421
|
<slot name="empty">
|
|
422
422
|
{{ props.empty || t("table.noData") }}
|
|
423
423
|
</slot>
|
|
@@ -429,21 +429,22 @@ defineExpose({
|
|
|
429
429
|
|
|
430
430
|
<tfoot
|
|
431
431
|
v-if="hasFooter"
|
|
432
|
-
:class="ui.tfoot({ class: props.ui?.tfoot })"
|
|
433
432
|
data-part="tfoot"
|
|
433
|
+
:class="ui.tfoot({ class: props.ui?.tfoot })"
|
|
434
434
|
:style="virtualizer ? {
|
|
435
435
|
transform: `translateY(${virtualizer.getTotalSize() - virtualizer.getVirtualItems().length * virtualizerProps.estimateSize}px)`
|
|
436
436
|
} : void 0"
|
|
437
437
|
>
|
|
438
|
-
<tr :class="ui.separator({ class: props.ui?.separator })"
|
|
438
|
+
<tr data-part="separator" :class="ui.separator({ class: props.ui?.separator })"></tr>
|
|
439
439
|
|
|
440
|
-
<tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" :class="ui.tr({ class: props.ui?.tr })"
|
|
440
|
+
<tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" data-part="tr" :class="ui.tr({ class: props.ui?.tr })">
|
|
441
441
|
<th
|
|
442
442
|
v-for="header in footerGroup.headers"
|
|
443
443
|
:key="header.id"
|
|
444
444
|
:data-pinned="header.column.getIsPinned()"
|
|
445
445
|
:colspan="header.colSpan > 1 ? header.colSpan : void 0"
|
|
446
446
|
:rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
|
|
447
|
+
data-part="th"
|
|
447
448
|
:class="ui.th({
|
|
448
449
|
class: [
|
|
449
450
|
props.ui?.th,
|
|
@@ -451,7 +452,6 @@ defineExpose({
|
|
|
451
452
|
],
|
|
452
453
|
pinned: !!header.column.getIsPinned()
|
|
453
454
|
})"
|
|
454
|
-
data-part="th"
|
|
455
455
|
:style="[
|
|
456
456
|
getColumnStyles(header.column),
|
|
457
457
|
resolveValue(header.column.columnDef.meta?.style?.th, header)
|
|
@@ -466,7 +466,7 @@ defineExpose({
|
|
|
466
466
|
</table>
|
|
467
467
|
</DefineTableTemplate>
|
|
468
468
|
|
|
469
|
-
<Primitive ref="rootRef" :as="props.as" v-bind="$attrs" :class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
469
|
+
<Primitive ref="rootRef" :as="props.as" v-bind="$attrs" data-part="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
470
470
|
<div v-if="virtualizer" :style="{ height: `${virtualizer.getTotalSize()}px` }">
|
|
471
471
|
<ReuseTableTemplate />
|
|
472
472
|
</div>
|
|
@@ -49,11 +49,11 @@ defineExpose({
|
|
|
49
49
|
:default-value="props.defaultValue"
|
|
50
50
|
:orientation="props.orientation"
|
|
51
51
|
:activation-mode="props.activationMode"
|
|
52
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
53
52
|
data-part="root"
|
|
53
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
54
54
|
>
|
|
55
|
-
<TabsList :class="ui.list({ class: props.ui?.list })"
|
|
56
|
-
<TabsIndicator :class="ui.indicator({ class: props.ui?.indicator })"
|
|
55
|
+
<TabsList data-part="list" :class="ui.list({ class: props.ui?.list })">
|
|
56
|
+
<TabsIndicator data-part="indicator" :class="ui.indicator({ class: props.ui?.indicator })" />
|
|
57
57
|
|
|
58
58
|
<slot name="list-leading">
|
|
59
59
|
</slot>
|
|
@@ -64,26 +64,26 @@ defineExpose({
|
|
|
64
64
|
:key="index"
|
|
65
65
|
:value="item.value ?? String(index)"
|
|
66
66
|
:disabled="item.disabled"
|
|
67
|
-
:class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })"
|
|
68
67
|
data-part="trigger"
|
|
68
|
+
:class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })"
|
|
69
69
|
>
|
|
70
70
|
<slot name="leading" :item="item" :index="index" :ui="ui">
|
|
71
71
|
<Icon
|
|
72
72
|
v-if="item.icon"
|
|
73
73
|
:name="item.icon"
|
|
74
|
-
:class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })"
|
|
75
74
|
data-part="leadingIcon"
|
|
75
|
+
:class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })"
|
|
76
76
|
/>
|
|
77
77
|
<Avatar
|
|
78
78
|
v-else-if="item.avatar"
|
|
79
79
|
:size="item.ui?.leadingAvatarSize || props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
80
80
|
v-bind="item.avatar"
|
|
81
|
-
:class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })"
|
|
82
81
|
data-part="leadingAvatar"
|
|
82
|
+
:class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })"
|
|
83
83
|
/>
|
|
84
84
|
</slot>
|
|
85
85
|
|
|
86
|
-
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })"
|
|
86
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" data-part="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
87
87
|
<slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
|
|
88
88
|
</span>
|
|
89
89
|
|
|
@@ -94,8 +94,8 @@ defineExpose({
|
|
|
94
94
|
variant="outline"
|
|
95
95
|
:size="item.ui?.trailingBadgeSize || props.ui?.trailingBadgeSize || ui.trailingBadgeSize()"
|
|
96
96
|
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
97
|
-
:class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
|
|
98
97
|
data-part="trailingBadge"
|
|
98
|
+
:class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
|
|
99
99
|
/>
|
|
100
100
|
</slot>
|
|
101
101
|
</TabsTrigger>
|
|
@@ -108,8 +108,8 @@ defineExpose({
|
|
|
108
108
|
v-for="(item, index) of items"
|
|
109
109
|
:key="index"
|
|
110
110
|
:value="item.value ?? String(index)"
|
|
111
|
-
:class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
|
|
112
111
|
data-part="content"
|
|
112
|
+
:class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
|
|
113
113
|
>
|
|
114
114
|
<slot :name="item.slot || 'content'" :item="item" :index="index" :ui="ui">
|
|
115
115
|
{{ item.content }}
|
|
@@ -125,21 +125,21 @@ defineExpose({
|
|
|
125
125
|
</script>
|
|
126
126
|
|
|
127
127
|
<template>
|
|
128
|
-
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
129
|
-
<span v-if="isLeading || props.avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })"
|
|
128
|
+
<Primitive :as="props.as" data-part="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
129
|
+
<span v-if="isLeading || props.avatar || !!slots.leading" data-part="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
130
130
|
<slot name="leading" :ui="ui">
|
|
131
131
|
<Icon
|
|
132
132
|
v-if="isLeading && leadingIconName"
|
|
133
133
|
:name="leadingIconName"
|
|
134
|
-
:class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
|
|
135
134
|
data-part="leadingIcon"
|
|
135
|
+
:class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
|
|
136
136
|
/>
|
|
137
137
|
<Avatar
|
|
138
138
|
v-else-if="props.avatar"
|
|
139
139
|
:size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
|
|
140
140
|
v-bind="props.avatar"
|
|
141
|
-
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
142
141
|
data-part="leadingAvatar"
|
|
142
|
+
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
143
143
|
/>
|
|
144
144
|
</slot>
|
|
145
145
|
</span>
|
|
@@ -151,8 +151,8 @@ defineExpose({
|
|
|
151
151
|
:placeholder="props.placeholder"
|
|
152
152
|
:required="props.required"
|
|
153
153
|
v-bind="{ id, name, disabled, ...$attrs, ...ariaAttrs }"
|
|
154
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
155
154
|
data-part="base"
|
|
155
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
156
156
|
@input="onInput"
|
|
157
157
|
@blur="onBlur"
|
|
158
158
|
@change="onChange"
|
|
@@ -161,13 +161,13 @@ defineExpose({
|
|
|
161
161
|
|
|
162
162
|
<slot :ui="ui"></slot>
|
|
163
163
|
|
|
164
|
-
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })"
|
|
164
|
+
<span v-if="isTrailing || !!slots.trailing" data-part="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
165
165
|
<slot name="trailing" :ui="ui">
|
|
166
166
|
<Icon
|
|
167
167
|
v-if="trailingIconName"
|
|
168
168
|
:name="trailingIconName"
|
|
169
|
-
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
170
169
|
data-part="trailingIcon"
|
|
170
|
+
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
171
171
|
/>
|
|
172
172
|
</slot>
|
|
173
173
|
</span>
|
|
@@ -50,15 +50,15 @@ const ui = computed(() => {
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
|
-
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
53
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" data-part="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
54
54
|
<div
|
|
55
55
|
v-for="(item, index) in props.items"
|
|
56
56
|
:key="item.value ?? index"
|
|
57
|
-
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
58
57
|
data-part="item"
|
|
58
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
59
59
|
:data-state="getItemState(index)"
|
|
60
60
|
>
|
|
61
|
-
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })"
|
|
61
|
+
<div data-part="container" :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
62
62
|
<Avatar
|
|
63
63
|
:size="props.size"
|
|
64
64
|
:icon="item.icon"
|
|
@@ -67,8 +67,8 @@ const ui = computed(() => {
|
|
|
67
67
|
icon: ui.indicatorIcon({ class: props.ui?.indicatorIcon }),
|
|
68
68
|
fallback: ui.indicatorFallback({ class: props.ui?.indicatorFallback })
|
|
69
69
|
}"
|
|
70
|
-
:class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
|
|
71
70
|
data-part="indicator"
|
|
71
|
+
:class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
|
|
72
72
|
>
|
|
73
73
|
<slot :name="item.slot ? `${item.slot}-indicator` : 'indicator'" :item="item"></slot>
|
|
74
74
|
</Avatar>
|
|
@@ -76,24 +76,24 @@ const ui = computed(() => {
|
|
|
76
76
|
<Separator
|
|
77
77
|
v-if="index < items.length - 1"
|
|
78
78
|
:orientation="props.orientation"
|
|
79
|
-
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
80
79
|
data-part="separator"
|
|
80
|
+
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
81
81
|
/>
|
|
82
82
|
</div>
|
|
83
83
|
|
|
84
|
-
<div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })"
|
|
84
|
+
<div data-part="wrapper" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
85
85
|
<slot :name="item.slot ? `${item.slot}-wrapper` : 'wrapper'" :item="item">
|
|
86
|
-
<div v-if="item.date || !!slots[item.slot ? `${item.slot}-date` : 'date']" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })"
|
|
86
|
+
<div v-if="item.date || !!slots[item.slot ? `${item.slot}-date` : 'date']" data-part="date" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })">
|
|
87
87
|
<slot :name="item.slot ? `${item.slot}-date` : 'date'" :item="item">
|
|
88
88
|
{{ item.date }}
|
|
89
89
|
</slot>
|
|
90
90
|
</div>
|
|
91
|
-
<div v-if="item.title || !!slots[item.slot ? `${item.slot}-title` : 'title']" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })"
|
|
91
|
+
<div v-if="item.title || !!slots[item.slot ? `${item.slot}-title` : 'title']" data-part="title" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })">
|
|
92
92
|
<slot :name="item.slot ? `${item.slot}-title` : 'title'" :item="item">
|
|
93
93
|
{{ item.title }}
|
|
94
94
|
</slot>
|
|
95
95
|
</div>
|
|
96
|
-
<div v-if="item.description || !!slots[item.slot ? `${item.slot}-description` : 'description']" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })"
|
|
96
|
+
<div v-if="item.description || !!slots[item.slot ? `${item.slot}-description` : 'description']" data-part="description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
97
97
|
<slot :name="item.slot ? `${item.slot}-description` : 'description'" :item="item">
|
|
98
98
|
{{ item.description }}
|
|
99
99
|
</slot>
|
|
@@ -64,9 +64,9 @@ defineExpose({
|
|
|
64
64
|
ref="el"
|
|
65
65
|
v-slot="{ remaining, duration, open }"
|
|
66
66
|
v-bind="rootProps"
|
|
67
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
68
67
|
:data-orientation="props.orientation"
|
|
69
68
|
data-part="root"
|
|
69
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
70
70
|
:style="{ '--height': height }"
|
|
71
71
|
>
|
|
72
72
|
<slot name="leading" :ui="ui">
|
|
@@ -74,19 +74,19 @@ defineExpose({
|
|
|
74
74
|
v-if="props.avatar"
|
|
75
75
|
:size="props.ui?.avatarSize || ui.avatarSize()"
|
|
76
76
|
v-bind="props.avatar"
|
|
77
|
-
:class="ui.avatar({ class: props.ui?.avatar })"
|
|
78
77
|
data-part="avatar"
|
|
78
|
+
:class="ui.avatar({ class: props.ui?.avatar })"
|
|
79
79
|
/>
|
|
80
80
|
<Icon
|
|
81
81
|
v-else-if="props.icon"
|
|
82
82
|
:name="props.icon"
|
|
83
|
-
:class="ui.icon({ class: props.ui?.icon })"
|
|
84
83
|
data-part="icon"
|
|
84
|
+
:class="ui.icon({ class: props.ui?.icon })"
|
|
85
85
|
/>
|
|
86
86
|
</slot>
|
|
87
87
|
|
|
88
|
-
<div :class="ui.wrapper({ class: props.ui?.wrapper })"
|
|
89
|
-
<ToastTitle v-if="props.title || !!slots.title" :class="ui.title({ class: props.ui?.title })"
|
|
88
|
+
<div data-part="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
89
|
+
<ToastTitle v-if="props.title || !!slots.title" data-part="title" :class="ui.title({ class: props.ui?.title })">
|
|
90
90
|
<slot name="title">
|
|
91
91
|
<component :is="props.title()" v-if="typeof props.title === 'function'" />
|
|
92
92
|
<component :is="props.title" v-else-if="typeof props.title === 'object'" />
|
|
@@ -95,7 +95,7 @@ defineExpose({
|
|
|
95
95
|
</template>
|
|
96
96
|
</slot>
|
|
97
97
|
</ToastTitle>
|
|
98
|
-
<ToastDescription v-if="props.description || !!slots.description" :class="ui.description({ class: props.ui?.description })"
|
|
98
|
+
<ToastDescription v-if="props.description || !!slots.description" data-part="description" :class="ui.description({ class: props.ui?.description })">
|
|
99
99
|
<slot name="description">
|
|
100
100
|
<component :is="props.description()" v-if="typeof props.description === 'function'" />
|
|
101
101
|
<component :is="props.description" v-else-if="typeof props.description === 'object'" />
|
|
@@ -105,7 +105,7 @@ defineExpose({
|
|
|
105
105
|
</slot>
|
|
106
106
|
</ToastDescription>
|
|
107
107
|
|
|
108
|
-
<div v-if="props.orientation === 'vertical' && (props.actions?.length || slots.actions)" :class="ui.actions({ class: props.ui?.actions })"
|
|
108
|
+
<div v-if="props.orientation === 'vertical' && (props.actions?.length || slots.actions)" data-part="actions" :class="ui.actions({ class: props.ui?.actions })">
|
|
109
109
|
<slot name="actions">
|
|
110
110
|
<ToastAction v-for="(action, index) in props.actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
111
111
|
<Button size="xs" :color="props.color" v-bind="action" />
|
|
@@ -116,8 +116,8 @@ defineExpose({
|
|
|
116
116
|
|
|
117
117
|
<div
|
|
118
118
|
v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions) || props.close"
|
|
119
|
-
:class="ui.actions({ class: props.ui?.actions })"
|
|
120
119
|
data-part="actions"
|
|
120
|
+
:class="ui.actions({ class: props.ui?.actions })"
|
|
121
121
|
>
|
|
122
122
|
<template v-if="props.orientation === 'horizontal'">
|
|
123
123
|
<slot name="actions">
|
|
@@ -136,8 +136,8 @@ defineExpose({
|
|
|
136
136
|
variant="link"
|
|
137
137
|
:aria-label="t('toast.close')"
|
|
138
138
|
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
139
|
-
:class="ui.close({ class: props.ui?.close })"
|
|
140
139
|
data-part="close"
|
|
140
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
141
141
|
@click.stop
|
|
142
142
|
/>
|
|
143
143
|
</slot>
|
|
@@ -150,6 +150,7 @@ defineExpose({
|
|
|
150
150
|
:color="props.color"
|
|
151
151
|
v-bind="typeof props.progress === 'object' ? props.progress : {}"
|
|
152
152
|
size="sm"
|
|
153
|
+
data-part="progress"
|
|
153
154
|
:class="ui.progress({ class: props.ui?.progress })"
|
|
154
155
|
/>
|
|
155
156
|
</ToastRoot>
|
|
@@ -88,8 +88,8 @@ function getOffset(index) {
|
|
|
88
88
|
'--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
|
|
89
89
|
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
|
|
90
90
|
}"
|
|
91
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
92
91
|
data-part="base"
|
|
92
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
93
93
|
@update:open="onUpdateOpen($event, toast.id)"
|
|
94
94
|
@click="toast.onClick && toast.onClick(toast)"
|
|
95
95
|
/>
|
|
@@ -97,8 +97,8 @@ function getOffset(index) {
|
|
|
97
97
|
<ToastPortal v-bind="portalProps">
|
|
98
98
|
<ToastViewport
|
|
99
99
|
:data-expanded="expanded"
|
|
100
|
-
:class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
|
|
101
100
|
data-part="viewport"
|
|
101
|
+
:class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
|
|
102
102
|
:style="{
|
|
103
103
|
'--scale-factor': '0.05',
|
|
104
104
|
'--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
|
|
@@ -48,11 +48,11 @@ const ui = computed(() => {
|
|
|
48
48
|
</TooltipTrigger>
|
|
49
49
|
|
|
50
50
|
<TooltipPortal v-bind="portalProps">
|
|
51
|
-
<TooltipContent v-bind="contentProps" :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
|
|
51
|
+
<TooltipContent v-bind="contentProps" data-part="content" :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })">
|
|
52
52
|
<slot name="content" :ui="ui">
|
|
53
|
-
<span v-if="props.text" :class="ui.text({ class: props.ui?.text })"
|
|
53
|
+
<span v-if="props.text" data-part="text" :class="ui.text({ class: props.ui?.text })">{{ props.text }}</span>
|
|
54
54
|
|
|
55
|
-
<span v-if="props.kbds?.length" :class="ui.kbds({ class: props.ui?.kbds })"
|
|
55
|
+
<span v-if="props.kbds?.length" data-part="kbds" :class="ui.kbds({ class: props.ui?.kbds })">
|
|
56
56
|
<Kbd
|
|
57
57
|
v-for="(kbd, index) in props.kbds"
|
|
58
58
|
:key="index"
|
|
@@ -62,7 +62,7 @@ const ui = computed(() => {
|
|
|
62
62
|
</span>
|
|
63
63
|
</slot>
|
|
64
64
|
|
|
65
|
-
<TooltipArrow v-if="props.arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })"
|
|
65
|
+
<TooltipArrow v-if="props.arrow" v-bind="arrowProps" data-part="arrow" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
66
66
|
</TooltipContent>
|
|
67
67
|
</TooltipPortal>
|
|
68
68
|
</TooltipRoot>
|
|
@@ -110,8 +110,8 @@ function onUpdate(value) {
|
|
|
110
110
|
<DefineItemTemplate v-slot="{ item, index, level }">
|
|
111
111
|
<li
|
|
112
112
|
role="presentation"
|
|
113
|
-
:class="props.nested && level > 1 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, item.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, item.ui?.item] })"
|
|
114
113
|
:data-part="props.nested && level > 1 ? 'itemWithChildren' : 'item'"
|
|
114
|
+
:class="props.nested && level > 1 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, item.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, item.ui?.item] })"
|
|
115
115
|
>
|
|
116
116
|
<TreeItem
|
|
117
117
|
v-slot="{ isExpanded, isSelected, isIndeterminate, handleSelect, handleToggle }"
|
|
@@ -130,8 +130,8 @@ function onUpdate(value) {
|
|
|
130
130
|
:is="as.link"
|
|
131
131
|
:type="as.link === 'button' ? 'button' : void 0"
|
|
132
132
|
:disabled="item.disabled || props.disabled"
|
|
133
|
-
:class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || props.disabled })"
|
|
134
133
|
data-part="link"
|
|
134
|
+
:class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || props.disabled })"
|
|
135
135
|
:style="!props.nested && level > 1 ? { paddingLeft: flattenedPaddingFormula(level) } : void 0"
|
|
136
136
|
>
|
|
137
137
|
<slot
|
|
@@ -147,18 +147,18 @@ function onUpdate(value) {
|
|
|
147
147
|
<Icon
|
|
148
148
|
v-if="item.icon"
|
|
149
149
|
:name="item.icon"
|
|
150
|
-
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
151
150
|
data-part="linkLeadingIcon"
|
|
151
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
152
152
|
/>
|
|
153
153
|
<Icon
|
|
154
154
|
v-else-if="item.children?.length"
|
|
155
155
|
:name="isExpanded ? props.expandedIcon ?? appConfig.ui.icons.folderOpen : props.collapsedIcon ?? appConfig.ui.icons.folder"
|
|
156
|
-
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
157
156
|
data-part="linkLeadingIcon"
|
|
157
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
158
158
|
/>
|
|
159
159
|
</slot>
|
|
160
160
|
|
|
161
|
-
<span v-if="getItemLabel(item) || slots[`${item.slot || 'item'}-label`]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })"
|
|
161
|
+
<span v-if="getItemLabel(item) || slots[`${item.slot || 'item'}-label`]" data-part="linkLabel" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
|
|
162
162
|
<slot
|
|
163
163
|
:name="`${item.slot || 'item'}-label`"
|
|
164
164
|
v-bind="{ index, level, expanded: isExpanded, selected: isSelected, indeterminate: isIndeterminate, handleSelect, handleToggle, ui }"
|
|
@@ -170,8 +170,8 @@ function onUpdate(value) {
|
|
|
170
170
|
|
|
171
171
|
<span
|
|
172
172
|
v-if="item.trailingIcon || item.children?.length || slots[`${item.slot || 'item'}-trailing`]"
|
|
173
|
-
:class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
|
|
174
173
|
data-part="linkTrailing"
|
|
174
|
+
:class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
|
|
175
175
|
>
|
|
176
176
|
<slot
|
|
177
177
|
:name="`${item.slot || 'item'}-trailing`"
|
|
@@ -181,14 +181,14 @@ function onUpdate(value) {
|
|
|
181
181
|
<Icon
|
|
182
182
|
v-if="item.trailingIcon"
|
|
183
183
|
:name="item.trailingIcon"
|
|
184
|
-
:class="ui.linkTrailingIcon({ class: [props.trailingIcon, item.ui?.linkTrailingIcon] })"
|
|
185
184
|
data-part="linkTrailingIcon"
|
|
185
|
+
:class="ui.linkTrailingIcon({ class: [props.trailingIcon, item.ui?.linkTrailingIcon] })"
|
|
186
186
|
/>
|
|
187
187
|
<Icon
|
|
188
188
|
v-else-if="item.children?.length"
|
|
189
189
|
:name="props.trailingIcon ?? appConfig.ui.icons.chevronDown"
|
|
190
|
-
:class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })"
|
|
191
190
|
data-part="linkTrailingIcon"
|
|
191
|
+
:class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })"
|
|
192
192
|
/>
|
|
193
193
|
</slot>
|
|
194
194
|
</span>
|
|
@@ -199,8 +199,8 @@ function onUpdate(value) {
|
|
|
199
199
|
<ul
|
|
200
200
|
v-if="props.nested && item.children?.length && isExpanded"
|
|
201
201
|
role="group"
|
|
202
|
-
:class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })"
|
|
203
202
|
data-part="listWithChildren"
|
|
203
|
+
:class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })"
|
|
204
204
|
>
|
|
205
205
|
<ReuseTreeTemplate :items="item.children" :level="level + 1" />
|
|
206
206
|
</ul>
|
|
@@ -223,8 +223,8 @@ function onUpdate(value) {
|
|
|
223
223
|
:default-expanded="defaultExpanded"
|
|
224
224
|
:selection-behavior="props.selectionBehavior"
|
|
225
225
|
:multiple="props.multiple"
|
|
226
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
227
226
|
data-part="root"
|
|
227
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
228
228
|
@update:model-value="onUpdate"
|
|
229
229
|
>
|
|
230
230
|
<template v-if="!props.nested">
|
|
@@ -150,7 +150,7 @@ export function defineShortcuts(config, options = {}) {
|
|
|
150
150
|
continue;
|
|
151
151
|
if (e.ctrlKey !== shortcut.ctrlKey)
|
|
152
152
|
continue;
|
|
153
|
-
if ((alphabetKey || shiftableKey) && e.shiftKey !== shortcut.shiftKey)
|
|
153
|
+
if ((alphabetKey || shiftableKey || shortcut.shiftKey || e.shiftKey) && e.shiftKey !== shortcut.shiftKey)
|
|
154
154
|
continue;
|
|
155
155
|
if (shortcut.enabled) {
|
|
156
156
|
e.preventDefault();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
2
|
import type { ComponentEmit, ComponentProps } from 'vue-component-type-helpers';
|
|
3
|
+
type CloseEventArgTypeSimple<T> = T extends (event: 'close', arg_0: infer Arg, ...args: any[]) => void ? Arg : never;
|
|
3
4
|
/**
|
|
4
5
|
* This is a workaround for a design limitation in TypeScript.
|
|
5
6
|
*
|
|
@@ -9,7 +10,7 @@ import type { ComponentEmit, ComponentProps } from 'vue-component-type-helpers';
|
|
|
9
10
|
*
|
|
10
11
|
* @see https://github.com/microsoft/TypeScript/issues/32164
|
|
11
12
|
*/
|
|
12
|
-
type
|
|
13
|
+
type CloseEventArgTypeComplex<T> = T extends {
|
|
13
14
|
(event: 'close', arg_0: infer Arg, ...args: any[]): void;
|
|
14
15
|
(...args: any[]): void;
|
|
15
16
|
(...args: any[]): void;
|
|
@@ -28,6 +29,7 @@ type CloseEventArgType<T> = T extends {
|
|
|
28
29
|
(...args: any[]): void;
|
|
29
30
|
(...args: any[]): void;
|
|
30
31
|
} ? Arg : never;
|
|
32
|
+
type CloseEventArgType<T> = CloseEventArgTypeSimple<T> | CloseEventArgTypeComplex<T>;
|
|
31
33
|
export interface OverlayOptions<ComponentProps = Record<string, any>> {
|
|
32
34
|
defaultOpen?: boolean;
|
|
33
35
|
props?: ComponentProps;
|