@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,72 +8,30 @@ const checkbox = tv({ extend: tv(theme), ...appConfigCheckbox.b24ui?.checkbox ||
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed, useId } from "vue";
|
|
11
|
-
import { useForwardProps } from "reka-ui";
|
|
11
|
+
import { Primitive, CheckboxRoot, CheckboxIndicator, Label, useForwardProps } from "reka-ui";
|
|
12
12
|
import { reactivePick } from "@vueuse/core";
|
|
13
13
|
import { useFormField } from "../composables/useFormField";
|
|
14
|
+
import Minus20Icon from "@bitrix24/b24icons-vue/actions/Minus20Icon";
|
|
15
|
+
import CheckIcon from "@bitrix24/b24icons-vue/main/CheckIcon";
|
|
14
16
|
defineOptions({ inheritAttrs: false });
|
|
15
17
|
const props = defineProps({
|
|
16
|
-
as: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
type: null,
|
|
30
|
-
required: false
|
|
31
|
-
},
|
|
32
|
-
size: {
|
|
33
|
-
type: null,
|
|
34
|
-
required: false
|
|
35
|
-
},
|
|
36
|
-
class: {
|
|
37
|
-
type: null,
|
|
38
|
-
required: false
|
|
39
|
-
},
|
|
40
|
-
b24ui: {
|
|
41
|
-
type: Object,
|
|
42
|
-
required: false
|
|
43
|
-
},
|
|
44
|
-
disabled: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
required: false
|
|
47
|
-
},
|
|
48
|
-
required: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
required: false
|
|
51
|
-
},
|
|
52
|
-
name: {
|
|
53
|
-
type: String,
|
|
54
|
-
required: false
|
|
55
|
-
},
|
|
56
|
-
value: {
|
|
57
|
-
type: [String, Number, Object, null],
|
|
58
|
-
required: false
|
|
59
|
-
},
|
|
60
|
-
id: {
|
|
61
|
-
type: String,
|
|
62
|
-
required: false
|
|
63
|
-
},
|
|
64
|
-
defaultValue: {
|
|
65
|
-
type: [Boolean, String],
|
|
66
|
-
required: false
|
|
67
|
-
}
|
|
18
|
+
as: { type: null, required: false },
|
|
19
|
+
label: { type: String, required: false },
|
|
20
|
+
description: { type: String, required: false },
|
|
21
|
+
color: { type: null, required: false },
|
|
22
|
+
size: { type: null, required: false },
|
|
23
|
+
class: { type: null, required: false },
|
|
24
|
+
b24ui: { type: Object, required: false },
|
|
25
|
+
disabled: { type: Boolean, required: false },
|
|
26
|
+
required: { type: Boolean, required: false },
|
|
27
|
+
name: { type: String, required: false },
|
|
28
|
+
value: { type: [String, Number, Object, null], required: false },
|
|
29
|
+
id: { type: String, required: false },
|
|
30
|
+
defaultValue: { type: [Boolean, String], required: false }
|
|
68
31
|
});
|
|
69
32
|
const slots = defineSlots();
|
|
70
33
|
const emits = defineEmits(["change"]);
|
|
71
|
-
const modelValue = defineModel({
|
|
72
|
-
"type": [Boolean, String],
|
|
73
|
-
...{
|
|
74
|
-
default: void 0
|
|
75
|
-
}
|
|
76
|
-
});
|
|
34
|
+
const modelValue = defineModel({ type: [Boolean, String], ...{ default: void 0 } });
|
|
77
35
|
const rootProps = useForwardProps(reactivePick(props, "required", "value", "defaultValue"));
|
|
78
36
|
const { id: _id, emitFormChange, emitFormInput, size, color, name, disabled, ariaAttrs } = useFormField(props);
|
|
79
37
|
const id = _id.value ?? useId();
|
|
@@ -8,55 +8,22 @@ const chip = tv({ extend: tv(theme), ...appConfigChip.b24ui?.chip || {} });
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed } from "vue";
|
|
11
|
+
import { Primitive, Slot } from "reka-ui";
|
|
11
12
|
import { useAvatarGroup } from "../composables/useAvatarGroup";
|
|
12
13
|
defineOptions({ inheritAttrs: false });
|
|
13
14
|
const props = defineProps({
|
|
14
|
-
as: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
type: null,
|
|
24
|
-
required: false
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
type: null,
|
|
28
|
-
required: false
|
|
29
|
-
},
|
|
30
|
-
position: {
|
|
31
|
-
type: null,
|
|
32
|
-
required: false
|
|
33
|
-
},
|
|
34
|
-
inset: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
required: false,
|
|
37
|
-
default: false
|
|
38
|
-
},
|
|
39
|
-
standalone: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
required: false,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
class: {
|
|
45
|
-
type: null,
|
|
46
|
-
required: false
|
|
47
|
-
},
|
|
48
|
-
b24ui: {
|
|
49
|
-
type: Object,
|
|
50
|
-
required: false
|
|
51
|
-
}
|
|
15
|
+
as: { type: null, required: false },
|
|
16
|
+
text: { type: [String, Number], required: false },
|
|
17
|
+
color: { type: null, required: false },
|
|
18
|
+
size: { type: null, required: false },
|
|
19
|
+
position: { type: null, required: false },
|
|
20
|
+
inset: { type: Boolean, required: false, default: false },
|
|
21
|
+
standalone: { type: Boolean, required: false, default: false },
|
|
22
|
+
class: { type: null, required: false },
|
|
23
|
+
b24ui: { type: Object, required: false }
|
|
52
24
|
});
|
|
53
25
|
defineSlots();
|
|
54
|
-
const show = defineModel("show", {
|
|
55
|
-
"type": Boolean,
|
|
56
|
-
...{
|
|
57
|
-
default: true
|
|
58
|
-
}
|
|
59
|
-
});
|
|
26
|
+
const show = defineModel("show", { type: Boolean, ...{ default: true } });
|
|
60
27
|
const { size } = useAvatarGroup(props);
|
|
61
28
|
const b24ui = computed(() => chip({
|
|
62
29
|
color: props.color,
|
|
@@ -7,38 +7,16 @@ const collapsible = tv({ extend: tv(theme), ...appConfigCollapsible.b24ui?.colla
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
-
import { useForwardPropsEmits } from "reka-ui";
|
|
10
|
+
import { CollapsibleRoot, CollapsibleTrigger, CollapsibleContent, useForwardPropsEmits } from "reka-ui";
|
|
11
11
|
import { reactivePick } from "@vueuse/core";
|
|
12
12
|
const props = defineProps({
|
|
13
|
-
as: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
b24ui: {
|
|
22
|
-
type: Object,
|
|
23
|
-
required: false
|
|
24
|
-
},
|
|
25
|
-
defaultOpen: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
required: false
|
|
28
|
-
},
|
|
29
|
-
open: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
required: false
|
|
32
|
-
},
|
|
33
|
-
disabled: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
required: false
|
|
36
|
-
},
|
|
37
|
-
unmountOnHide: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
required: false,
|
|
40
|
-
default: true
|
|
41
|
-
}
|
|
13
|
+
as: { type: null, required: false },
|
|
14
|
+
class: { type: null, required: false },
|
|
15
|
+
b24ui: { type: Object, required: false },
|
|
16
|
+
defaultOpen: { type: Boolean, required: false },
|
|
17
|
+
open: { type: Boolean, required: false },
|
|
18
|
+
disabled: { type: Boolean, required: false },
|
|
19
|
+
unmountOnHide: { type: Boolean, required: false, default: true }
|
|
42
20
|
});
|
|
43
21
|
const emits = defineEmits(["update:open"]);
|
|
44
22
|
const slots = defineSlots();
|
|
@@ -7,15 +7,10 @@ const container = tv({ extend: tv(theme), ...appConfigContainer.b24ui?.container
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
|
+
import { Primitive } from "reka-ui";
|
|
10
11
|
const props = defineProps({
|
|
11
|
-
as: {
|
|
12
|
-
|
|
13
|
-
required: false
|
|
14
|
-
},
|
|
15
|
-
class: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
}
|
|
12
|
+
as: { type: null, required: false },
|
|
13
|
+
class: { type: null, required: false }
|
|
19
14
|
});
|
|
20
15
|
defineSlots();
|
|
21
16
|
</script>
|
|
@@ -9,72 +9,27 @@ const countdown = tv({ extend: tv(theme), ...appConfigCountdown.b24ui?.countdown
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { ref, computed, watch, onMounted, onBeforeUnmount } from "vue";
|
|
11
11
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
12
|
+
import { Primitive } from "reka-ui";
|
|
13
|
+
import B24Avatar from "./Avatar.vue";
|
|
12
14
|
const MILLISECONDS_SECOND = 1e3;
|
|
13
15
|
const MILLISECONDS_MINUTE = 60 * MILLISECONDS_SECOND;
|
|
14
16
|
const MILLISECONDS_HOUR = 60 * MILLISECONDS_MINUTE;
|
|
15
17
|
const MILLISECONDS_DAY = 24 * MILLISECONDS_HOUR;
|
|
16
18
|
defineOptions({ inheritAttrs: false });
|
|
17
19
|
const props = defineProps({
|
|
18
|
-
as: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
seconds: {
|
|
33
|
-
type: [Number, String],
|
|
34
|
-
required: false,
|
|
35
|
-
default: 0
|
|
36
|
-
},
|
|
37
|
-
showMinutes: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
required: false,
|
|
40
|
-
default: true
|
|
41
|
-
},
|
|
42
|
-
useCircle: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
required: false,
|
|
45
|
-
default: false
|
|
46
|
-
},
|
|
47
|
-
interval: {
|
|
48
|
-
type: Number,
|
|
49
|
-
required: false,
|
|
50
|
-
default: 1e3
|
|
51
|
-
},
|
|
52
|
-
needStartImmediately: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
required: false,
|
|
55
|
-
default: true
|
|
56
|
-
},
|
|
57
|
-
now: {
|
|
58
|
-
type: Function,
|
|
59
|
-
required: false,
|
|
60
|
-
default: () => Date.now()
|
|
61
|
-
},
|
|
62
|
-
class: {
|
|
63
|
-
type: null,
|
|
64
|
-
required: false
|
|
65
|
-
},
|
|
66
|
-
b24ui: {
|
|
67
|
-
type: Object,
|
|
68
|
-
required: false
|
|
69
|
-
},
|
|
70
|
-
icon: {
|
|
71
|
-
type: [Function, Object],
|
|
72
|
-
required: false
|
|
73
|
-
},
|
|
74
|
-
avatar: {
|
|
75
|
-
type: Object,
|
|
76
|
-
required: false
|
|
77
|
-
}
|
|
20
|
+
as: { type: null, required: false, default: "span" },
|
|
21
|
+
size: { type: null, required: false },
|
|
22
|
+
emitEvents: { type: Boolean, required: false, default: true },
|
|
23
|
+
seconds: { type: [Number, String], required: false, default: 0 },
|
|
24
|
+
showMinutes: { type: Boolean, required: false, default: true },
|
|
25
|
+
useCircle: { type: Boolean, required: false, default: false },
|
|
26
|
+
interval: { type: Number, required: false, default: 1e3 },
|
|
27
|
+
needStartImmediately: { type: Boolean, required: false, default: true },
|
|
28
|
+
now: { type: Function, required: false, default: () => Date.now() },
|
|
29
|
+
class: { type: null, required: false },
|
|
30
|
+
b24ui: { type: Object, required: false },
|
|
31
|
+
icon: { type: [Function, Object], required: false },
|
|
32
|
+
avatar: { type: Object, required: false }
|
|
78
33
|
});
|
|
79
34
|
const emits = defineEmits(["start", "end", "abort", "progress"]);
|
|
80
35
|
defineSlots();
|
|
@@ -9,41 +9,17 @@ const descriptionList = tv({ extend: tv(theme), ...appConfigDescriptionList.b24u
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed } from "vue";
|
|
11
11
|
import { get } from "../utils";
|
|
12
|
+
import B24Avatar from "./Avatar.vue";
|
|
13
|
+
import B24Button from "./Button.vue";
|
|
12
14
|
const props = defineProps({
|
|
13
|
-
legend: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
labelKey: {
|
|
22
|
-
type: String,
|
|
23
|
-
required: false,
|
|
24
|
-
default: "label"
|
|
25
|
-
},
|
|
26
|
-
descriptionKey: {
|
|
27
|
-
type: String,
|
|
28
|
-
required: false,
|
|
29
|
-
default: "description"
|
|
30
|
-
},
|
|
31
|
-
items: {
|
|
32
|
-
type: Array,
|
|
33
|
-
required: false
|
|
34
|
-
},
|
|
35
|
-
size: {
|
|
36
|
-
type: null,
|
|
37
|
-
required: false
|
|
38
|
-
},
|
|
39
|
-
class: {
|
|
40
|
-
type: null,
|
|
41
|
-
required: false
|
|
42
|
-
},
|
|
43
|
-
b24ui: {
|
|
44
|
-
type: Object,
|
|
45
|
-
required: false
|
|
46
|
-
}
|
|
15
|
+
legend: { type: String, required: false },
|
|
16
|
+
text: { type: String, required: false },
|
|
17
|
+
labelKey: { type: String, required: false, default: "label" },
|
|
18
|
+
descriptionKey: { type: String, required: false, default: "description" },
|
|
19
|
+
items: { type: Array, required: false },
|
|
20
|
+
size: { type: null, required: false },
|
|
21
|
+
class: { type: null, required: false },
|
|
22
|
+
b24ui: { type: Object, required: false }
|
|
47
23
|
});
|
|
48
24
|
const slots = defineSlots();
|
|
49
25
|
const b24ui = computed(() => descriptionList({
|
|
@@ -9,70 +9,25 @@ const dropdownMenu = tv({ extend: tv(theme), ...appConfigDropdownMenu.b24ui?.dro
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import { computed, toRef } from "vue";
|
|
11
11
|
import { defu } from "defu";
|
|
12
|
-
import { useForwardPropsEmits } from "reka-ui";
|
|
12
|
+
import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from "reka-ui";
|
|
13
13
|
import { reactivePick } from "@vueuse/core";
|
|
14
14
|
import { omit } from "../utils";
|
|
15
|
+
import B24DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
15
16
|
const props = defineProps({
|
|
16
|
-
size: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
required: false,
|
|
31
|
-
default: true
|
|
32
|
-
},
|
|
33
|
-
content: {
|
|
34
|
-
type: Object,
|
|
35
|
-
required: false
|
|
36
|
-
},
|
|
37
|
-
arrow: {
|
|
38
|
-
type: [Boolean, Object],
|
|
39
|
-
required: false
|
|
40
|
-
},
|
|
41
|
-
portal: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
required: false,
|
|
44
|
-
default: true
|
|
45
|
-
},
|
|
46
|
-
labelKey: {
|
|
47
|
-
type: null,
|
|
48
|
-
required: false,
|
|
49
|
-
default: "label"
|
|
50
|
-
},
|
|
51
|
-
disabled: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
required: false
|
|
54
|
-
},
|
|
55
|
-
class: {
|
|
56
|
-
type: null,
|
|
57
|
-
required: false
|
|
58
|
-
},
|
|
59
|
-
b24ui: {
|
|
60
|
-
type: null,
|
|
61
|
-
required: false
|
|
62
|
-
},
|
|
63
|
-
defaultOpen: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
required: false
|
|
66
|
-
},
|
|
67
|
-
open: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
required: false
|
|
70
|
-
},
|
|
71
|
-
modal: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
required: false,
|
|
74
|
-
default: true
|
|
75
|
-
}
|
|
17
|
+
size: { type: null, required: false },
|
|
18
|
+
items: { type: null, required: false },
|
|
19
|
+
checkedIcon: { type: [Function, Object], required: false },
|
|
20
|
+
externalIcon: { type: [Boolean, Function, Object], required: false, default: true },
|
|
21
|
+
content: { type: Object, required: false },
|
|
22
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
23
|
+
portal: { type: Boolean, required: false, default: true },
|
|
24
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
25
|
+
disabled: { type: Boolean, required: false },
|
|
26
|
+
class: { type: null, required: false },
|
|
27
|
+
b24ui: { type: null, required: false },
|
|
28
|
+
defaultOpen: { type: Boolean, required: false },
|
|
29
|
+
open: { type: Boolean, required: false },
|
|
30
|
+
modal: { type: Boolean, required: false, default: true }
|
|
76
31
|
});
|
|
77
32
|
const emits = defineEmits(["update:open"]);
|
|
78
33
|
const slots = defineSlots();
|
|
@@ -6,118 +6,53 @@ const _dropdownMenu = tv(theme)();
|
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
8
|
import { computed } from "vue";
|
|
9
|
+
import { DropdownMenu } from "reka-ui/namespaced";
|
|
9
10
|
import { useForwardPropsEmits } from "reka-ui";
|
|
10
11
|
import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
|
|
11
12
|
import { useLocale } from "../composables/useLocale";
|
|
12
|
-
import { omit, isArrayOfArray } from "../utils";
|
|
13
|
+
import { omit, get, isArrayOfArray } from "../utils";
|
|
14
|
+
import { pickLinkProps } from "../utils/link";
|
|
13
15
|
import icons from "../dictionary/icons";
|
|
16
|
+
import B24LinkBase from "./LinkBase.vue";
|
|
17
|
+
import B24Link from "./Link.vue";
|
|
18
|
+
import B24Avatar from "./Avatar.vue";
|
|
19
|
+
import B24Kbd from "./Kbd.vue";
|
|
20
|
+
import B24DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
14
21
|
const props = defineProps({
|
|
15
|
-
items: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
type: null,
|
|
41
|
-
required: false
|
|
42
|
-
},
|
|
43
|
-
b24ui: {
|
|
44
|
-
type: null,
|
|
45
|
-
required: true
|
|
46
|
-
},
|
|
47
|
-
b24uiOverride: {
|
|
48
|
-
type: null,
|
|
49
|
-
required: false
|
|
50
|
-
},
|
|
51
|
-
loop: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
required: false
|
|
54
|
-
},
|
|
55
|
-
side: {
|
|
56
|
-
type: null,
|
|
57
|
-
required: false
|
|
58
|
-
},
|
|
59
|
-
sideOffset: {
|
|
60
|
-
type: Number,
|
|
61
|
-
required: false
|
|
62
|
-
},
|
|
63
|
-
align: {
|
|
64
|
-
type: null,
|
|
65
|
-
required: false
|
|
66
|
-
},
|
|
67
|
-
alignOffset: {
|
|
68
|
-
type: Number,
|
|
69
|
-
required: false
|
|
70
|
-
},
|
|
71
|
-
avoidCollisions: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
required: false
|
|
74
|
-
},
|
|
75
|
-
collisionBoundary: {
|
|
76
|
-
type: null,
|
|
77
|
-
required: false
|
|
78
|
-
},
|
|
79
|
-
collisionPadding: {
|
|
80
|
-
type: [Number, Object],
|
|
81
|
-
required: false
|
|
82
|
-
},
|
|
83
|
-
arrowPadding: {
|
|
84
|
-
type: Number,
|
|
85
|
-
required: false
|
|
86
|
-
},
|
|
87
|
-
sticky: {
|
|
88
|
-
type: String,
|
|
89
|
-
required: false
|
|
90
|
-
},
|
|
91
|
-
hideWhenDetached: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
required: false
|
|
94
|
-
},
|
|
95
|
-
positionStrategy: {
|
|
96
|
-
type: String,
|
|
97
|
-
required: false
|
|
98
|
-
},
|
|
99
|
-
updatePositionStrategy: {
|
|
100
|
-
type: String,
|
|
101
|
-
required: false
|
|
102
|
-
},
|
|
103
|
-
disableUpdateOnLayoutShift: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
required: false
|
|
106
|
-
},
|
|
107
|
-
prioritizePosition: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
required: false
|
|
110
|
-
},
|
|
111
|
-
reference: {
|
|
112
|
-
type: null,
|
|
113
|
-
required: false
|
|
114
|
-
}
|
|
22
|
+
items: { type: null, required: false },
|
|
23
|
+
portal: { type: Boolean, required: false },
|
|
24
|
+
sub: { type: Boolean, required: false },
|
|
25
|
+
labelKey: { type: null, required: true },
|
|
26
|
+
checkedIcon: { type: [Function, Object], required: false },
|
|
27
|
+
externalIcon: { type: [Boolean, Function, Object], required: false },
|
|
28
|
+
class: { type: null, required: false },
|
|
29
|
+
b24ui: { type: null, required: true },
|
|
30
|
+
b24uiOverride: { type: null, required: false },
|
|
31
|
+
loop: { type: Boolean, required: false },
|
|
32
|
+
side: { type: null, required: false },
|
|
33
|
+
sideOffset: { type: Number, required: false },
|
|
34
|
+
align: { type: null, required: false },
|
|
35
|
+
alignOffset: { type: Number, required: false },
|
|
36
|
+
avoidCollisions: { type: Boolean, required: false },
|
|
37
|
+
collisionBoundary: { type: null, required: false },
|
|
38
|
+
collisionPadding: { type: [Number, Object], required: false },
|
|
39
|
+
arrowPadding: { type: Number, required: false },
|
|
40
|
+
sticky: { type: String, required: false },
|
|
41
|
+
hideWhenDetached: { type: Boolean, required: false },
|
|
42
|
+
positionStrategy: { type: String, required: false },
|
|
43
|
+
updatePositionStrategy: { type: String, required: false },
|
|
44
|
+
disableUpdateOnLayoutShift: { type: Boolean, required: false },
|
|
45
|
+
prioritizePosition: { type: Boolean, required: false },
|
|
46
|
+
reference: { type: null, required: false }
|
|
115
47
|
});
|
|
116
48
|
const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "closeAutoFocus"]);
|
|
117
49
|
const slots = defineSlots();
|
|
118
50
|
const { dir } = useLocale();
|
|
119
51
|
const contentProps = useForwardPropsEmits(reactiveOmit(props, "sub", "items", "portal", "labelKey", "checkedIcon", "externalIcon", "class", "b24ui", "b24uiOverride"), emits);
|
|
120
52
|
const proxySlots = omit(slots, ["default"]);
|
|
53
|
+
const getLabel = (item) => {
|
|
54
|
+
return get(item, props.labelKey);
|
|
55
|
+
};
|
|
121
56
|
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate();
|
|
122
57
|
const childrenIcon = computed(() => dir.value === "rtl" ? icons.chevronLeft : icons.chevronRight);
|
|
123
58
|
const groups = computed(
|
|
@@ -147,9 +82,9 @@ const groups = computed(
|
|
|
147
82
|
/>
|
|
148
83
|
</slot>
|
|
149
84
|
|
|
150
|
-
<span v-if="
|
|
85
|
+
<span v-if="getLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="b24ui.itemLabel({ class: b24uiOverride?.itemLabel, active })">
|
|
151
86
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
152
|
-
{{
|
|
87
|
+
{{ getLabel(item) }}
|
|
153
88
|
</slot>
|
|
154
89
|
<Component
|
|
155
90
|
:is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
|
|
@@ -193,7 +128,7 @@ const groups = computed(
|
|
|
193
128
|
as="button"
|
|
194
129
|
type="button"
|
|
195
130
|
:disabled="item.disabled"
|
|
196
|
-
:text-value="
|
|
131
|
+
:text-value="getLabel(item)"
|
|
197
132
|
:class="b24ui.item({ class: b24uiOverride?.item, color: item?.color })"
|
|
198
133
|
>
|
|
199
134
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
@@ -223,7 +158,7 @@ const groups = computed(
|
|
|
223
158
|
v-else-if="item.type === 'checkbox'"
|
|
224
159
|
:model-value="item.checked"
|
|
225
160
|
:disabled="item.disabled"
|
|
226
|
-
:text-value="
|
|
161
|
+
:text-value="getLabel(item)"
|
|
227
162
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color })"
|
|
228
163
|
@update:model-value="item.onUpdateChecked"
|
|
229
164
|
@select="item.onSelect"
|
|
@@ -234,7 +169,7 @@ const groups = computed(
|
|
|
234
169
|
v-else
|
|
235
170
|
as-child
|
|
236
171
|
:disabled="item.disabled"
|
|
237
|
-
:text-value="
|
|
172
|
+
:text-value="getLabel(item)"
|
|
238
173
|
@select="item.onSelect"
|
|
239
174
|
>
|
|
240
175
|
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|