@bitrix24/b24ui-nuxt 0.5.10 → 0.6.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/.nuxt/b24ui/input-menu.ts +2 -2
- package/.nuxt/b24ui/select-menu.ts +4 -4
- package/.nuxt/b24ui/select.ts +2 -2
- package/dist/meta.d.mts +148 -1
- package/dist/meta.mjs +148 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Advice.vue +10 -30
- package/dist/runtime/components/Alert.vue +17 -53
- package/dist/runtime/components/App.vue +9 -22
- package/dist/runtime/components/Avatar.vue +12 -38
- package/dist/runtime/components/AvatarGroup.vue +7 -20
- package/dist/runtime/components/Badge.vue +18 -61
- package/dist/runtime/components/Button.vue +55 -177
- package/dist/runtime/components/ButtonGroup.vue +6 -22
- package/dist/runtime/components/Calendar.vue +38 -151
- package/dist/runtime/components/Checkbox.vue +17 -59
- package/dist/runtime/components/Chip.vue +11 -44
- package/dist/runtime/components/Collapsible.vue +8 -30
- package/dist/runtime/components/Container.vue +3 -8
- package/dist/runtime/components/Countdown.vue +15 -60
- package/dist/runtime/components/DescriptionList.vue +10 -34
- package/dist/runtime/components/DropdownMenu.vue +16 -61
- package/dist/runtime/components/DropdownMenuContent.vue +41 -106
- package/dist/runtime/components/Form.vue +12 -45
- package/dist/runtime/components/FormField.vue +16 -56
- package/dist/runtime/components/Input.vue +29 -110
- package/dist/runtime/components/InputMenu.vue +76 -192
- package/dist/runtime/components/InputMenu.vue.d.ts +25 -6
- package/dist/runtime/components/InputNumber.vue +35 -136
- package/dist/runtime/components/Kbd.vue +6 -21
- package/dist/runtime/components/Link.vue +28 -115
- package/dist/runtime/components/LinkBase.vue +11 -42
- package/dist/runtime/components/Modal.vue +20 -77
- package/dist/runtime/components/ModalDialogClose.vue +1 -0
- package/dist/runtime/components/Navbar.vue +4 -13
- package/dist/runtime/components/NavbarDivider.vue +4 -13
- package/dist/runtime/components/NavbarSection.vue +4 -13
- package/dist/runtime/components/NavbarSpacer.vue +4 -13
- package/dist/runtime/components/NavigationMenu.vue +39 -107
- package/dist/runtime/components/OverlayProvider.vue +1 -1
- package/dist/runtime/components/Popover.vue +12 -53
- package/dist/runtime/components/Progress.vue +13 -52
- package/dist/runtime/components/RadioGroup.vue +20 -81
- package/dist/runtime/components/Range.vue +16 -64
- package/dist/runtime/components/Select.vue +39 -141
- package/dist/runtime/components/Select.vue.d.ts +1 -0
- package/dist/runtime/components/SelectMenu.vue +79 -172
- package/dist/runtime/components/SelectMenu.vue.d.ts +1 -1
- package/dist/runtime/components/Separator.vue +13 -46
- package/dist/runtime/components/Sidebar.vue +4 -13
- package/dist/runtime/components/SidebarBody.vue +5 -18
- package/dist/runtime/components/SidebarFooter.vue +4 -13
- package/dist/runtime/components/SidebarHeader.vue +4 -13
- package/dist/runtime/components/SidebarHeading.vue +4 -13
- package/dist/runtime/components/SidebarLayout.vue +12 -18
- package/dist/runtime/components/SidebarSection.vue +4 -13
- package/dist/runtime/components/SidebarSpacer.vue +4 -13
- package/dist/runtime/components/Skeleton.vue +3 -8
- package/dist/runtime/components/Slideover.vue +20 -78
- package/dist/runtime/components/StackedLayout.vue +12 -18
- package/dist/runtime/components/Switch.vue +21 -75
- package/dist/runtime/components/Tabs.vue +22 -64
- package/dist/runtime/components/Textarea.vue +30 -115
- package/dist/runtime/components/Toast.vue +20 -67
- package/dist/runtime/components/Toaster.vue +15 -38
- package/dist/runtime/components/Tooltip.vue +16 -58
- package/dist/runtime/components/content/TableWrapper.vue +12 -46
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useOverlay.d.ts +14 -7
- package/dist/runtime/composables/useOverlay.js +14 -6
- package/dist/runtime/prose/A.vue +2 -8
- package/dist/runtime/prose/Blockquote.vue +2 -8
- package/dist/runtime/prose/Code.vue +3 -12
- package/dist/runtime/prose/Em.vue +2 -8
- package/dist/runtime/prose/H1.vue +2 -8
- package/dist/runtime/prose/H2.vue +2 -8
- package/dist/runtime/prose/H3.vue +2 -8
- package/dist/runtime/prose/H4.vue +2 -8
- package/dist/runtime/prose/H5.vue +2 -8
- package/dist/runtime/prose/H6.vue +2 -8
- package/dist/runtime/prose/Hr.vue +2 -8
- package/dist/runtime/prose/Img.vue +2 -8
- package/dist/runtime/prose/Li.vue +2 -8
- package/dist/runtime/prose/Ol.vue +2 -8
- package/dist/runtime/prose/P.vue +2 -8
- package/dist/runtime/prose/Pre.vue +5 -17
- package/dist/runtime/prose/Strong.vue +2 -8
- package/dist/runtime/prose/Table.vue +8 -33
- package/dist/runtime/prose/Tbody.vue +2 -8
- package/dist/runtime/prose/Td.vue +2 -8
- package/dist/runtime/prose/Th.vue +2 -8
- package/dist/runtime/prose/Thead.vue +2 -8
- package/dist/runtime/prose/Tr.vue +2 -8
- package/dist/runtime/prose/Ul.vue +2 -8
- package/dist/runtime/utils/link.d.ts +3 -3
- package/dist/runtime/vue/components/Link.vue +29 -115
- package/dist/shared/{b24ui-nuxt.CS9Lf0os.mjs → b24ui-nuxt.BA6Y2FnC.mjs} +6 -6
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +11 -7
|
@@ -8,7 +8,7 @@ const select = tv({ extend: tv(theme), ...appConfigSelect.b24ui?.select || {} })
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed, toRef } from "vue";
|
|
11
|
-
import { useForwardPropsEmits } from "reka-ui";
|
|
11
|
+
import { Primitive, SelectRoot, SelectArrow, SelectTrigger, SelectPortal, SelectContent, SelectViewport, SelectScrollUpButton, SelectScrollDownButton, SelectLabel, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectSeparator, useForwardPropsEmits } from "reka-ui";
|
|
12
12
|
import { defu } from "defu";
|
|
13
13
|
import { reactivePick } from "@vueuse/core";
|
|
14
14
|
import { useButtonGroup } from "../composables/useButtonGroup";
|
|
@@ -16,147 +16,44 @@ import { useComponentIcons } from "../composables/useComponentIcons";
|
|
|
16
16
|
import { useFormField } from "../composables/useFormField";
|
|
17
17
|
import { compare, get, isArrayOfArray } from "../utils";
|
|
18
18
|
import icons from "../dictionary/icons";
|
|
19
|
+
import B24Avatar from "./Avatar.vue";
|
|
20
|
+
import B24Chip from "./Chip.vue";
|
|
19
21
|
defineOptions({ inheritAttrs: false });
|
|
20
22
|
const props = defineProps({
|
|
21
|
-
id: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
required: false
|
|
56
|
-
},
|
|
57
|
-
tagColor: {
|
|
58
|
-
type: null,
|
|
59
|
-
required: false
|
|
60
|
-
},
|
|
61
|
-
trailingIcon: {
|
|
62
|
-
type: [Function, Object],
|
|
63
|
-
required: false
|
|
64
|
-
},
|
|
65
|
-
selectedIcon: {
|
|
66
|
-
type: [Function, Object],
|
|
67
|
-
required: false
|
|
68
|
-
},
|
|
69
|
-
content: {
|
|
70
|
-
type: Object,
|
|
71
|
-
required: false
|
|
72
|
-
},
|
|
73
|
-
arrow: {
|
|
74
|
-
type: [Boolean, Object],
|
|
75
|
-
required: false
|
|
76
|
-
},
|
|
77
|
-
portal: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
required: false,
|
|
80
|
-
default: true
|
|
81
|
-
},
|
|
82
|
-
valueKey: {
|
|
83
|
-
type: null,
|
|
84
|
-
required: false,
|
|
85
|
-
default: "value"
|
|
86
|
-
},
|
|
87
|
-
labelKey: {
|
|
88
|
-
type: null,
|
|
89
|
-
required: false,
|
|
90
|
-
default: "label"
|
|
91
|
-
},
|
|
92
|
-
items: {
|
|
93
|
-
type: null,
|
|
94
|
-
required: false
|
|
95
|
-
},
|
|
96
|
-
defaultValue: {
|
|
97
|
-
type: null,
|
|
98
|
-
required: false
|
|
99
|
-
},
|
|
100
|
-
modelValue: {
|
|
101
|
-
type: null,
|
|
102
|
-
required: false
|
|
103
|
-
},
|
|
104
|
-
multiple: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
required: false
|
|
107
|
-
},
|
|
108
|
-
highlight: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
required: false
|
|
111
|
-
},
|
|
112
|
-
class: {
|
|
113
|
-
type: null,
|
|
114
|
-
required: false
|
|
115
|
-
},
|
|
116
|
-
b24ui: {
|
|
117
|
-
type: null,
|
|
118
|
-
required: false
|
|
119
|
-
},
|
|
120
|
-
open: {
|
|
121
|
-
type: Boolean,
|
|
122
|
-
required: false
|
|
123
|
-
},
|
|
124
|
-
defaultOpen: {
|
|
125
|
-
type: Boolean,
|
|
126
|
-
required: false
|
|
127
|
-
},
|
|
128
|
-
autocomplete: {
|
|
129
|
-
type: String,
|
|
130
|
-
required: false
|
|
131
|
-
},
|
|
132
|
-
disabled: {
|
|
133
|
-
type: Boolean,
|
|
134
|
-
required: false
|
|
135
|
-
},
|
|
136
|
-
name: {
|
|
137
|
-
type: String,
|
|
138
|
-
required: false
|
|
139
|
-
},
|
|
140
|
-
required: {
|
|
141
|
-
type: Boolean,
|
|
142
|
-
required: false
|
|
143
|
-
},
|
|
144
|
-
icon: {
|
|
145
|
-
type: [Function, Object],
|
|
146
|
-
required: false
|
|
147
|
-
},
|
|
148
|
-
avatar: {
|
|
149
|
-
type: Object,
|
|
150
|
-
required: false
|
|
151
|
-
},
|
|
152
|
-
loading: {
|
|
153
|
-
type: Boolean,
|
|
154
|
-
required: false
|
|
155
|
-
},
|
|
156
|
-
trailing: {
|
|
157
|
-
type: Boolean,
|
|
158
|
-
required: false
|
|
159
|
-
}
|
|
23
|
+
id: { type: String, required: false },
|
|
24
|
+
placeholder: { type: String, required: false },
|
|
25
|
+
color: { type: null, required: false },
|
|
26
|
+
size: { type: null, required: false },
|
|
27
|
+
noPadding: { type: Boolean, required: false },
|
|
28
|
+
noBorder: { type: Boolean, required: false },
|
|
29
|
+
underline: { type: Boolean, required: false },
|
|
30
|
+
rounded: { type: Boolean, required: false },
|
|
31
|
+
tag: { type: String, required: false },
|
|
32
|
+
tagColor: { type: null, required: false },
|
|
33
|
+
trailingIcon: { type: [Function, Object], required: false },
|
|
34
|
+
selectedIcon: { type: [Function, Object], required: false },
|
|
35
|
+
content: { type: Object, required: false },
|
|
36
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
37
|
+
portal: { type: Boolean, required: false, default: true },
|
|
38
|
+
valueKey: { type: null, required: false, default: "value" },
|
|
39
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
40
|
+
items: { type: null, required: false },
|
|
41
|
+
defaultValue: { type: null, required: false },
|
|
42
|
+
modelValue: { type: null, required: false },
|
|
43
|
+
multiple: { type: Boolean, required: false },
|
|
44
|
+
highlight: { type: Boolean, required: false },
|
|
45
|
+
class: { type: null, required: false },
|
|
46
|
+
b24ui: { type: null, required: false },
|
|
47
|
+
open: { type: Boolean, required: false },
|
|
48
|
+
defaultOpen: { type: Boolean, required: false },
|
|
49
|
+
autocomplete: { type: String, required: false },
|
|
50
|
+
disabled: { type: Boolean, required: false },
|
|
51
|
+
name: { type: String, required: false },
|
|
52
|
+
required: { type: Boolean, required: false },
|
|
53
|
+
icon: { type: [Function, Object], required: false },
|
|
54
|
+
avatar: { type: Object, required: false },
|
|
55
|
+
loading: { type: Boolean, required: false },
|
|
56
|
+
trailing: { type: Boolean, required: false }
|
|
160
57
|
});
|
|
161
58
|
const emits = defineEmits(["update:open", "change", "blur", "focus", "update:modelValue"]);
|
|
162
59
|
const slots = defineSlots();
|
|
@@ -255,7 +152,7 @@ function isSelectItem(item) {
|
|
|
255
152
|
{{ displayedModelValue }}
|
|
256
153
|
</span>
|
|
257
154
|
<span v-else :class="b24ui.placeholder({ class: props.b24ui?.placeholder })">
|
|
258
|
-
{{ placeholder ??
|
|
155
|
+
{{ placeholder ?? '\xA0' }}
|
|
259
156
|
</span>
|
|
260
157
|
</template>
|
|
261
158
|
</slot>
|
|
@@ -293,6 +190,7 @@ function isSelectItem(item) {
|
|
|
293
190
|
:class="b24ui.item({ class: props.b24ui?.item, colorItem: isSelectItem(item) ? item?.color : void 0 })"
|
|
294
191
|
:disabled="isSelectItem(item) && item.disabled"
|
|
295
192
|
:value="isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
193
|
+
@select="isSelectItem(item) && item.onSelect?.($event)"
|
|
296
194
|
>
|
|
297
195
|
<slot name="item" :item="item" :index="index">
|
|
298
196
|
<slot name="item-leading" :item="item" :index="index">
|
|
@@ -1057,6 +1057,7 @@ interface SelectItemBase {
|
|
|
1057
1057
|
type?: 'label' | 'separator' | 'item';
|
|
1058
1058
|
value?: string | number;
|
|
1059
1059
|
disabled?: boolean;
|
|
1060
|
+
onSelect?(e?: Event): void;
|
|
1060
1061
|
[key: string]: any;
|
|
1061
1062
|
}
|
|
1062
1063
|
export type SelectItem = SelectItemBase | AcceptableValue | boolean;
|
|
@@ -9,8 +9,24 @@ const selectMenu = tv({ extend: tv(theme), ...appConfigSelectMenu.b24ui?.selectM
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed, toRef, toRaw } from "vue";
|
|
11
11
|
import {
|
|
12
|
+
ComboboxRoot,
|
|
13
|
+
ComboboxArrow,
|
|
14
|
+
ComboboxAnchor,
|
|
15
|
+
ComboboxInput,
|
|
16
|
+
ComboboxTrigger,
|
|
17
|
+
ComboboxPortal,
|
|
18
|
+
ComboboxContent,
|
|
19
|
+
ComboboxViewport,
|
|
20
|
+
ComboboxEmpty,
|
|
21
|
+
ComboboxGroup,
|
|
22
|
+
ComboboxLabel,
|
|
23
|
+
ComboboxSeparator,
|
|
24
|
+
ComboboxItem,
|
|
25
|
+
ComboboxItemIndicator,
|
|
26
|
+
FocusScope,
|
|
12
27
|
useForwardPropsEmits,
|
|
13
|
-
useFilter
|
|
28
|
+
useFilter,
|
|
29
|
+
Primitive
|
|
14
30
|
} from "reka-ui";
|
|
15
31
|
import { defu } from "defu";
|
|
16
32
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
@@ -20,180 +36,58 @@ import { useFormField } from "../composables/useFormField";
|
|
|
20
36
|
import { useLocale } from "../composables/useLocale";
|
|
21
37
|
import { compare, get, isArrayOfArray } from "../utils";
|
|
22
38
|
import icons from "../dictionary/icons";
|
|
39
|
+
import B24Avatar from "./Avatar.vue";
|
|
40
|
+
import B24Chip from "./Chip.vue";
|
|
41
|
+
import B24Input from "./Input.vue";
|
|
23
42
|
defineOptions({ inheritAttrs: false });
|
|
24
43
|
const props = defineProps({
|
|
25
|
-
id: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
tagColor: {
|
|
67
|
-
type: null,
|
|
68
|
-
required: false
|
|
69
|
-
},
|
|
70
|
-
required: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
required: false
|
|
73
|
-
},
|
|
74
|
-
trailingIcon: {
|
|
75
|
-
type: [Function, Object],
|
|
76
|
-
required: false
|
|
77
|
-
},
|
|
78
|
-
selectedIcon: {
|
|
79
|
-
type: [Function, Object],
|
|
80
|
-
required: false
|
|
81
|
-
},
|
|
82
|
-
content: {
|
|
83
|
-
type: Object,
|
|
84
|
-
required: false
|
|
85
|
-
},
|
|
86
|
-
arrow: {
|
|
87
|
-
type: [Boolean, Object],
|
|
88
|
-
required: false
|
|
89
|
-
},
|
|
90
|
-
portal: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
required: false,
|
|
93
|
-
default: true
|
|
94
|
-
},
|
|
95
|
-
valueKey: {
|
|
96
|
-
type: null,
|
|
97
|
-
required: false
|
|
98
|
-
},
|
|
99
|
-
labelKey: {
|
|
100
|
-
type: null,
|
|
101
|
-
required: false,
|
|
102
|
-
default: "label"
|
|
103
|
-
},
|
|
104
|
-
items: {
|
|
105
|
-
type: null,
|
|
106
|
-
required: false
|
|
107
|
-
},
|
|
108
|
-
defaultValue: {
|
|
109
|
-
type: null,
|
|
110
|
-
required: false
|
|
111
|
-
},
|
|
112
|
-
modelValue: {
|
|
113
|
-
type: null,
|
|
114
|
-
required: false
|
|
115
|
-
},
|
|
116
|
-
multiple: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
required: false
|
|
119
|
-
},
|
|
120
|
-
highlight: {
|
|
121
|
-
type: Boolean,
|
|
122
|
-
required: false
|
|
123
|
-
},
|
|
124
|
-
createItem: {
|
|
125
|
-
type: [Boolean, String, Object],
|
|
126
|
-
required: false
|
|
127
|
-
},
|
|
128
|
-
filterFields: {
|
|
129
|
-
type: Array,
|
|
130
|
-
required: false
|
|
131
|
-
},
|
|
132
|
-
ignoreFilter: {
|
|
133
|
-
type: Boolean,
|
|
134
|
-
required: false
|
|
135
|
-
},
|
|
136
|
-
class: {
|
|
137
|
-
type: null,
|
|
138
|
-
required: false
|
|
139
|
-
},
|
|
140
|
-
b24ui: {
|
|
141
|
-
type: null,
|
|
142
|
-
required: false
|
|
143
|
-
},
|
|
144
|
-
open: {
|
|
145
|
-
type: Boolean,
|
|
146
|
-
required: false
|
|
147
|
-
},
|
|
148
|
-
defaultOpen: {
|
|
149
|
-
type: Boolean,
|
|
150
|
-
required: false
|
|
151
|
-
},
|
|
152
|
-
disabled: {
|
|
153
|
-
type: Boolean,
|
|
154
|
-
required: false
|
|
155
|
-
},
|
|
156
|
-
name: {
|
|
157
|
-
type: String,
|
|
158
|
-
required: false
|
|
159
|
-
},
|
|
160
|
-
resetSearchTermOnBlur: {
|
|
161
|
-
type: Boolean,
|
|
162
|
-
required: false,
|
|
163
|
-
default: true
|
|
164
|
-
},
|
|
165
|
-
highlightOnHover: {
|
|
166
|
-
type: Boolean,
|
|
167
|
-
required: false
|
|
168
|
-
},
|
|
169
|
-
icon: {
|
|
170
|
-
type: [Function, Object],
|
|
171
|
-
required: false
|
|
172
|
-
},
|
|
173
|
-
avatar: {
|
|
174
|
-
type: Object,
|
|
175
|
-
required: false
|
|
176
|
-
},
|
|
177
|
-
loading: {
|
|
178
|
-
type: Boolean,
|
|
179
|
-
required: false
|
|
180
|
-
},
|
|
181
|
-
trailing: {
|
|
182
|
-
type: Boolean,
|
|
183
|
-
required: false
|
|
184
|
-
}
|
|
44
|
+
id: { type: String, required: false },
|
|
45
|
+
placeholder: { type: String, required: false },
|
|
46
|
+
searchInput: { type: [Boolean, Object], required: false, default: true },
|
|
47
|
+
color: { type: null, required: false },
|
|
48
|
+
size: { type: null, required: false },
|
|
49
|
+
noPadding: { type: Boolean, required: false },
|
|
50
|
+
noBorder: { type: Boolean, required: false },
|
|
51
|
+
underline: { type: Boolean, required: false },
|
|
52
|
+
rounded: { type: Boolean, required: false },
|
|
53
|
+
tag: { type: String, required: false },
|
|
54
|
+
tagColor: { type: null, required: false },
|
|
55
|
+
required: { type: Boolean, required: false },
|
|
56
|
+
trailingIcon: { type: [Function, Object], required: false },
|
|
57
|
+
selectedIcon: { type: [Function, Object], required: false },
|
|
58
|
+
content: { type: Object, required: false },
|
|
59
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
60
|
+
portal: { type: Boolean, required: false, default: true },
|
|
61
|
+
valueKey: { type: null, required: false },
|
|
62
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
63
|
+
items: { type: null, required: false },
|
|
64
|
+
defaultValue: { type: null, required: false },
|
|
65
|
+
modelValue: { type: null, required: false },
|
|
66
|
+
multiple: { type: Boolean, required: false },
|
|
67
|
+
highlight: { type: Boolean, required: false },
|
|
68
|
+
createItem: { type: [Boolean, String, Object], required: false },
|
|
69
|
+
filterFields: { type: Array, required: false },
|
|
70
|
+
ignoreFilter: { type: Boolean, required: false },
|
|
71
|
+
class: { type: null, required: false },
|
|
72
|
+
b24ui: { type: null, required: false },
|
|
73
|
+
open: { type: Boolean, required: false },
|
|
74
|
+
defaultOpen: { type: Boolean, required: false },
|
|
75
|
+
disabled: { type: Boolean, required: false },
|
|
76
|
+
name: { type: String, required: false },
|
|
77
|
+
resetSearchTermOnBlur: { type: Boolean, required: false, default: true },
|
|
78
|
+
resetSearchTermOnSelect: { type: Boolean, required: false, default: true },
|
|
79
|
+
highlightOnHover: { type: Boolean, required: false },
|
|
80
|
+
icon: { type: [Function, Object], required: false },
|
|
81
|
+
avatar: { type: Object, required: false },
|
|
82
|
+
loading: { type: Boolean, required: false },
|
|
83
|
+
trailing: { type: Boolean, required: false }
|
|
185
84
|
});
|
|
186
85
|
const emits = defineEmits(["update:open", "change", "blur", "focus", "create", "highlight", "update:modelValue"]);
|
|
187
86
|
const slots = defineSlots();
|
|
188
|
-
const searchTerm = defineModel("searchTerm", {
|
|
189
|
-
"type": String,
|
|
190
|
-
...{
|
|
191
|
-
default: ""
|
|
192
|
-
}
|
|
193
|
-
});
|
|
87
|
+
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
194
88
|
const { t } = useLocale();
|
|
195
89
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
196
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "modelValue", "defaultValue", "open", "defaultOpen", "required", "multiple", "resetSearchTermOnBlur", "highlightOnHover"), emits);
|
|
90
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "modelValue", "defaultValue", "open", "defaultOpen", "required", "multiple", "resetSearchTermOnBlur", "resetSearchTermOnSelect", "highlightOnHover"), emits);
|
|
197
91
|
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8, position: "popper" }));
|
|
198
92
|
const arrowProps = toRef(() => props.arrow);
|
|
199
93
|
const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: t("selectMenu.search"), type: "search" }));
|
|
@@ -273,6 +167,9 @@ function onUpdate(value) {
|
|
|
273
167
|
emits("change", event);
|
|
274
168
|
emitFormChange();
|
|
275
169
|
emitFormInput();
|
|
170
|
+
if (props.resetSearchTermOnSelect) {
|
|
171
|
+
searchTerm.value = "";
|
|
172
|
+
}
|
|
276
173
|
}
|
|
277
174
|
function onUpdateOpen(value) {
|
|
278
175
|
let timeoutId;
|
|
@@ -295,6 +192,16 @@ function onUpdateOpen(value) {
|
|
|
295
192
|
}
|
|
296
193
|
}
|
|
297
194
|
}
|
|
195
|
+
function onSelect(e, item) {
|
|
196
|
+
if (!isSelectItem(item)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (item.disabled) {
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
item.onSelect?.(e);
|
|
204
|
+
}
|
|
298
205
|
function isSelectItem(item) {
|
|
299
206
|
return typeof item === "object" && item !== null;
|
|
300
207
|
}
|
|
@@ -315,7 +222,7 @@ function isSelectItem(item) {
|
|
|
315
222
|
:is="icons.plus"
|
|
316
223
|
:class="b24ui.itemLeadingIcon({ addNew: true, class: props.b24ui?.itemLeadingIcon })"
|
|
317
224
|
/>
|
|
318
|
-
{{ t(
|
|
225
|
+
{{ t('selectMenu.create', { label: searchTerm }) }}
|
|
319
226
|
</slot>
|
|
320
227
|
</span>
|
|
321
228
|
</ComboboxItem>
|
|
@@ -355,7 +262,7 @@ function isSelectItem(item) {
|
|
|
355
262
|
{{ displayedModelValue }}
|
|
356
263
|
</span>
|
|
357
264
|
<span v-else :class="b24ui.placeholder({ class: props.b24ui?.placeholder })">
|
|
358
|
-
{{ placeholder ??
|
|
265
|
+
{{ placeholder ?? '\xA0' }}
|
|
359
266
|
</span>
|
|
360
267
|
</template>
|
|
361
268
|
</slot>
|
|
@@ -381,7 +288,7 @@ function isSelectItem(item) {
|
|
|
381
288
|
|
|
382
289
|
<ComboboxEmpty :class="b24ui.empty({ class: props.b24ui?.empty })">
|
|
383
290
|
<slot name="empty" :search-term="searchTerm">
|
|
384
|
-
{{ searchTerm ? t(
|
|
291
|
+
{{ searchTerm ? t('selectMenu.noMatch', { searchTerm }) : t('selectMenu.noData') }}
|
|
385
292
|
</slot>
|
|
386
293
|
</ComboboxEmpty>
|
|
387
294
|
|
|
@@ -401,7 +308,7 @@ function isSelectItem(item) {
|
|
|
401
308
|
:class="b24ui.item({ class: props.b24ui?.item, colorItem: isSelectItem(item) ? item?.color : void 0 })"
|
|
402
309
|
:disabled="isSelectItem(item) && item.disabled"
|
|
403
310
|
:value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
404
|
-
@select="
|
|
311
|
+
@select="onSelect($event, item)"
|
|
405
312
|
>
|
|
406
313
|
<slot name="item" :item="item" :index="index">
|
|
407
314
|
<slot name="item-leading" :item="item" :index="index">
|
|
@@ -1110,7 +1110,7 @@ interface _SelectMenuItem {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
export type SelectMenuItem = _SelectMenuItem | AcceptableValue | boolean;
|
|
1112
1112
|
type SelectMenuVariants = VariantProps<typeof selectMenu>;
|
|
1113
|
-
export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'highlightOnHover'>, UseComponentIconsProps {
|
|
1113
|
+
export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'resetSearchTermOnSelect' | 'highlightOnHover'>, UseComponentIconsProps {
|
|
1114
1114
|
id?: string;
|
|
1115
1115
|
/** The placeholder text when the select is empty. */
|
|
1116
1116
|
placeholder?: string;
|
|
@@ -8,54 +8,21 @@ const separator = tv({ extend: tv(theme), ...appConfigSeparator.b24ui?.separator
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed } from "vue";
|
|
11
|
-
import { useForwardProps } from "reka-ui";
|
|
11
|
+
import { Separator, useForwardProps } from "reka-ui";
|
|
12
12
|
import { reactivePick } from "@vueuse/core";
|
|
13
|
+
import B24Avatar from "./Avatar.vue";
|
|
13
14
|
const props = defineProps({
|
|
14
|
-
as: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
avatar: {
|
|
27
|
-
type: Object,
|
|
28
|
-
required: false
|
|
29
|
-
},
|
|
30
|
-
color: {
|
|
31
|
-
type: null,
|
|
32
|
-
required: false
|
|
33
|
-
},
|
|
34
|
-
size: {
|
|
35
|
-
type: null,
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
type: {
|
|
39
|
-
type: null,
|
|
40
|
-
required: false
|
|
41
|
-
},
|
|
42
|
-
orientation: {
|
|
43
|
-
type: null,
|
|
44
|
-
required: false,
|
|
45
|
-
default: "horizontal"
|
|
46
|
-
},
|
|
47
|
-
class: {
|
|
48
|
-
type: null,
|
|
49
|
-
required: false
|
|
50
|
-
},
|
|
51
|
-
b24ui: {
|
|
52
|
-
type: Object,
|
|
53
|
-
required: false
|
|
54
|
-
},
|
|
55
|
-
decorative: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
required: false
|
|
58
|
-
}
|
|
15
|
+
as: { type: null, required: false },
|
|
16
|
+
label: { type: String, required: false },
|
|
17
|
+
icon: { type: [Function, Object], required: false },
|
|
18
|
+
avatar: { type: Object, required: false },
|
|
19
|
+
color: { type: null, required: false },
|
|
20
|
+
size: { type: null, required: false },
|
|
21
|
+
type: { type: null, required: false },
|
|
22
|
+
orientation: { type: null, required: false, default: "horizontal" },
|
|
23
|
+
class: { type: null, required: false },
|
|
24
|
+
b24ui: { type: Object, required: false },
|
|
25
|
+
decorative: { type: Boolean, required: false }
|
|
59
26
|
});
|
|
60
27
|
const slots = defineSlots();
|
|
61
28
|
const rootProps = useForwardProps(reactivePick(props, "as", "decorative", "orientation"));
|
|
@@ -7,20 +7,11 @@ const sidebar = tv({ extend: tv(theme), ...appConfigSidebar.b24ui?.sidebar || {}
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
+
import { Primitive } from "reka-ui";
|
|
10
11
|
const props = defineProps({
|
|
11
|
-
as: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
default: "div"
|
|
15
|
-
},
|
|
16
|
-
class: {
|
|
17
|
-
type: null,
|
|
18
|
-
required: false
|
|
19
|
-
},
|
|
20
|
-
b24ui: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: false
|
|
23
|
-
}
|
|
12
|
+
as: { type: null, required: false, default: "div" },
|
|
13
|
+
class: { type: null, required: false },
|
|
14
|
+
b24ui: { type: Object, required: false }
|
|
24
15
|
});
|
|
25
16
|
defineSlots();
|
|
26
17
|
const b24ui = sidebar();
|
|
@@ -8,25 +8,12 @@ const sidebarBody = tv({ extend: tv(theme), ...appConfigSidebarBody.b24ui?.sideb
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed } from "vue";
|
|
11
|
+
import { Primitive } from "reka-ui";
|
|
11
12
|
const props = defineProps({
|
|
12
|
-
as: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
scrollbarThin: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
required: false,
|
|
20
|
-
default: true
|
|
21
|
-
},
|
|
22
|
-
class: {
|
|
23
|
-
type: null,
|
|
24
|
-
required: false
|
|
25
|
-
},
|
|
26
|
-
b24ui: {
|
|
27
|
-
type: Object,
|
|
28
|
-
required: false
|
|
29
|
-
}
|
|
13
|
+
as: { type: null, required: false, default: "div" },
|
|
14
|
+
scrollbarThin: { type: Boolean, required: false, default: true },
|
|
15
|
+
class: { type: null, required: false },
|
|
16
|
+
b24ui: { type: Object, required: false }
|
|
30
17
|
});
|
|
31
18
|
defineSlots();
|
|
32
19
|
const b24ui = computed(() => sidebarBody({
|
|
@@ -7,20 +7,11 @@ const sidebarFooter = tv({ extend: tv(theme), ...appConfigSidebarFooter.b24ui?.s
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
+
import { Primitive } from "reka-ui";
|
|
10
11
|
const props = defineProps({
|
|
11
|
-
as: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
default: "div"
|
|
15
|
-
},
|
|
16
|
-
class: {
|
|
17
|
-
type: null,
|
|
18
|
-
required: false
|
|
19
|
-
},
|
|
20
|
-
b24ui: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: false
|
|
23
|
-
}
|
|
12
|
+
as: { type: null, required: false, default: "div" },
|
|
13
|
+
class: { type: null, required: false },
|
|
14
|
+
b24ui: { type: Object, required: false }
|
|
24
15
|
});
|
|
25
16
|
defineSlots();
|
|
26
17
|
const b24ui = sidebarFooter();
|