@kuina-ui/vue 0.6.0 → 0.7.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/dist/blocks/pagination/Pagination.js +4 -0
- package/dist/blocks/pagination/Pagination.vue.d.ts +39 -0
- package/dist/blocks/pagination/Pagination.vue_vue_type_script_setup_true_lang.js +151 -0
- package/dist/blocks/pagination/index.d.ts +2 -0
- package/dist/blocks/pagination/pagination.theme.d.ts +12 -0
- package/dist/blocks/pagination/pagination.theme.js +12 -0
- package/dist/blocks/table/Table.js +4 -0
- package/dist/blocks/table/Table.vue.d.ts +149 -0
- package/dist/blocks/table/Table.vue_vue_type_script_setup_true_lang.js +933 -0
- package/dist/blocks/table/TableCellText.js +4 -0
- package/dist/blocks/table/TableCellText.vue.d.ts +8 -0
- package/dist/blocks/table/TableCellText.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/blocks/table/index.d.ts +2 -0
- package/dist/blocks/table/table.theme.d.ts +286 -0
- package/dist/blocks/table/table.theme.js +391 -0
- package/dist/blocks/table/useLoadMoreTrigger.d.ts +11 -0
- package/dist/blocks/table/useLoadMoreTrigger.js +31 -0
- package/dist/blocks/table/usePinnedColumnOffsets.d.ts +10 -0
- package/dist/blocks/table/usePinnedColumnOffsets.js +63 -0
- package/dist/blocks/table/useRowReorder.d.ts +18 -0
- package/dist/blocks/table/useRowReorder.js +92 -0
- package/dist/blocks/table/useRowVirtualizer.d.ts +17 -0
- package/dist/blocks/table/useRowVirtualizer.js +45 -0
- package/dist/blocks/table/useTableSections.d.ts +46 -0
- package/dist/blocks/table/useTableSections.js +86 -0
- package/dist/components/alert/Alert.js +4 -0
- package/dist/components/alert/Alert.vue.d.ts +2 -2
- package/dist/components/alert/Alert.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/alert/alert.theme.js +93 -0
- package/dist/components/avatar-group/AvatarGroup.js +4 -0
- package/dist/components/avatar-group/AvatarGroup.vue.d.ts +1 -1
- package/dist/components/avatar-group/AvatarGroup.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/avatar-group/avatar-group.theme.js +22 -0
- package/dist/components/date-picker/DateCalendar.js +4 -0
- package/dist/components/date-picker/DateCalendar.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/date-picker/DateCalendarMonth.js +4 -0
- package/dist/components/date-picker/DateCalendarMonth.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/date-picker/DateCalendarPopover.js +4 -0
- package/dist/components/date-picker/DateCalendarPopover.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/date-picker/DatePicker.js +4 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +6 -6
- package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js +224 -0
- package/dist/components/date-picker/DatePickerField.js +4 -0
- package/dist/components/date-picker/DatePickerField.vue.d.ts +6 -6
- package/dist/components/date-picker/DatePickerField.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/components/date-picker/DatePickerPanel.js +4 -0
- package/dist/components/date-picker/DatePickerPanel.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/date-picker/DateRangePicker.js +4 -0
- package/dist/components/date-picker/DateRangePicker.vue.d.ts +6 -6
- package/dist/components/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +212 -0
- package/dist/components/date-picker/DateRangePickerField.js +4 -0
- package/dist/components/date-picker/DateRangePickerField.vue.d.ts +7 -7
- package/dist/components/date-picker/DateRangePickerField.vue_vue_type_script_setup_true_lang.js +228 -0
- package/dist/components/date-picker/date-calendar.theme.js +46 -0
- package/dist/components/date-picker/date-picker.theme.js +16 -0
- package/dist/components/date-picker/useDatePickerControl.js +47 -0
- package/dist/components/date-picker/useDatePickerPopover.js +39 -0
- package/dist/components/date-picker/useDateRangeSelection.js +50 -0
- package/dist/components/date-picker/useDateRangeTyping.js +59 -0
- package/dist/components/date-picker/useDateTypingFocus.js +37 -0
- package/dist/components/date-picker/useSingleDateSelection.js +11 -0
- package/dist/components/date-picker/useSingleDateTyping.js +31 -0
- package/dist/components/date-picker/useTypedDateInput.js +39 -0
- package/dist/components/menu/Menu.js +4 -0
- package/dist/components/menu/Menu.vue.d.ts +3 -2
- package/dist/components/menu/Menu.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/components/menu/MenuItemRow.js +4 -0
- package/dist/components/menu/MenuItemRow.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/components/menu/MenuPanel.js +4 -0
- package/dist/components/menu/MenuPanel.vue.d.ts +2 -1
- package/dist/components/menu/MenuPanel.vue_vue_type_script_setup_true_lang.js +249 -0
- package/dist/components/menu/menu.theme.d.ts +5 -0
- package/dist/components/menu/menu.theme.js +174 -0
- package/dist/components/menu/menuContext.js +9 -0
- package/dist/components/menu/menuEntries.js +25 -0
- package/dist/components/select/Select.js +4 -0
- package/dist/components/select/Select.vue.d.ts +2 -2
- package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js +262 -0
- package/dist/components/select/SelectField.js +4 -0
- package/dist/components/select/SelectField.vue.d.ts +2 -2
- package/dist/components/select/SelectField.vue_vue_type_script_setup_true_lang.js +271 -0
- package/dist/components/select/SelectOptionRow.js +4 -0
- package/dist/components/select/SelectOptionRow.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/select/SelectPanel.js +4 -0
- package/dist/components/select/SelectPanel.vue_vue_type_script_setup_true_lang.js +169 -0
- package/dist/components/select/select-panel.theme.js +44 -0
- package/dist/components/select/selectOptions.d.ts +0 -2
- package/dist/components/select/selectOptions.js +66 -0
- package/dist/components/select/useSelectControl.d.ts +3 -3
- package/dist/components/select/useSelectControl.js +62 -0
- package/dist/components/select/useSelectListbox.js +169 -0
- package/dist/components/slider/RangeSlider.js +4 -0
- package/dist/components/slider/RangeSlider.vue_vue_type_script_setup_true_lang.js +214 -0
- package/dist/components/slider/Slider.js +4 -0
- package/dist/components/slider/Slider.vue_vue_type_script_setup_true_lang.js +151 -0
- package/dist/components/slider/SliderHeader.js +4 -0
- package/dist/components/slider/SliderHeader.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/components/slider/slider.theme.js +34 -0
- package/dist/components/text-field/TextField.js +4 -0
- package/dist/components/text-field/TextField.vue.d.ts +2 -2
- package/dist/components/text-field/TextField.vue_vue_type_script_setup_true_lang.js +122 -0
- package/dist/components/text-field/text-field.theme.js +379 -0
- package/dist/components/textarea/Textarea.js +4 -0
- package/dist/components/textarea/Textarea.vue.d.ts +1 -1
- package/dist/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/components/textarea/textarea.theme.js +222 -0
- package/dist/elements/avatar/Avatar.js +4 -0
- package/dist/elements/avatar/Avatar.vue.d.ts +3 -3
- package/dist/elements/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/elements/avatar/avatar.theme.js +141 -0
- package/dist/elements/badge/Badge.js +4 -0
- package/dist/elements/badge/Badge.vue.d.ts +2 -2
- package/dist/elements/badge/Badge.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/elements/badge/badge.theme.js +111 -0
- package/dist/elements/button/Button.js +4 -0
- package/dist/elements/button/Button.vue.d.ts +3 -3
- package/dist/elements/button/Button.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/elements/button/button.theme.js +424 -0
- package/dist/elements/checkbox/Checkbox.js +4 -0
- package/dist/elements/checkbox/Checkbox.vue.d.ts +3 -1
- package/dist/elements/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/elements/checkbox/checkbox.theme.d.ts +1 -0
- package/dist/elements/checkbox/checkbox.theme.js +22 -0
- package/dist/elements/circular-progress/CircularProgress.js +4 -0
- package/dist/elements/circular-progress/CircularProgress.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/elements/circular-progress/circular-progress.theme.js +8 -0
- package/dist/elements/input/Input.js +4 -0
- package/dist/elements/input/Input.vue.d.ts +62 -0
- package/dist/elements/input/Input.vue_vue_type_script_setup_true_lang.js +138 -0
- package/dist/elements/input/focusInputFromContainer.d.ts +2 -0
- package/dist/elements/input/focusInputFromContainer.js +28 -0
- package/dist/elements/input/index.d.ts +2 -0
- package/dist/elements/input/input.theme.d.ts +81 -0
- package/dist/elements/input/input.theme.js +391 -0
- package/dist/elements/loading-dots/LoadingDots.js +4 -0
- package/dist/elements/loading-dots/LoadingDots.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/elements/loading-dots/loading-dots.theme.js +4 -0
- package/dist/elements/loading-indicator/LoadingIndicator.js +4 -0
- package/dist/elements/loading-indicator/LoadingIndicator.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/elements/loading-indicator/loading-indicator.theme.js +4 -0
- package/dist/elements/popover/Popover.js +4 -0
- package/dist/elements/popover/Popover.vue.d.ts +60 -0
- package/dist/elements/popover/Popover.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/elements/popover/index.d.ts +2 -0
- package/dist/elements/popover/popover.theme.d.ts +20 -0
- package/dist/elements/popover/popover.theme.js +17 -0
- package/dist/elements/popover/popoverLayers.d.ts +5 -0
- package/dist/elements/popover/popoverLayers.js +22 -0
- package/dist/elements/radio-group/RadioGroup.js +4 -0
- package/dist/elements/radio-group/RadioGroup.vue.d.ts +1 -1
- package/dist/elements/radio-group/RadioGroup.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/elements/radio-group/radio-group.theme.js +126 -0
- package/dist/elements/segmented-control/SegmentedControl.js +4 -0
- package/dist/elements/segmented-control/SegmentedControl.vue.d.ts +1 -1
- package/dist/elements/segmented-control/SegmentedControl.vue_vue_type_script_setup_true_lang.js +98 -0
- package/dist/elements/segmented-control/segmented-control.theme.js +201 -0
- package/dist/elements/select-control/SelectControl.js +4 -0
- package/dist/elements/select-control/SelectControl.vue.d.ts +1 -1
- package/dist/elements/select-control/SelectControl.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/elements/select-control/select-control.theme.js +360 -0
- package/dist/elements/select-field-control/SelectFieldControl.js +4 -0
- package/dist/elements/select-field-control/SelectFieldControl.vue.d.ts +1 -1
- package/dist/elements/select-field-control/SelectFieldControl.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/elements/select-field-control/select-field-control.theme.js +299 -0
- package/dist/elements/slider-control/SliderControl.js +4 -0
- package/dist/elements/slider-control/SliderControl.vue_vue_type_script_setup_true_lang.js +228 -0
- package/dist/elements/slider-control/slider-control.theme.js +35 -0
- package/dist/elements/slider-control/useSliderMarksLayout.js +25 -0
- package/dist/elements/switch/Switch.js +4 -0
- package/dist/elements/switch/Switch.vue.d.ts +1 -1
- package/dist/elements/switch/Switch.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/elements/switch/switch.theme.js +37 -0
- package/dist/elements/text-link/TextLink.js +4 -0
- package/dist/elements/text-link/TextLink.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/elements/text-link/text-link.theme.js +25 -0
- package/dist/elements/tooltip/Tooltip.js +4 -0
- package/dist/elements/tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/elements/tooltip/tooltip.theme.js +46 -0
- package/dist/elements/tooltip/useTooltipOpenState.js +57 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +38 -1
- package/dist/nuxt.js +12 -13
- package/dist/shared/composables/useApplePlatform.js +10 -0
- package/dist/shared/composables/useCalendarLabels.js +13 -0
- package/dist/shared/composables/useCustomColor.js +10 -0
- package/dist/shared/composables/useDismissOnOutsidePointerDown.d.ts +1 -1
- package/dist/shared/composables/useDismissOnOutsidePointerDown.js +14 -0
- package/dist/shared/composables/useFieldDescription.js +16 -0
- package/dist/shared/composables/useFloatingPosition.d.ts +3 -2
- package/dist/shared/composables/useFloatingPosition.js +113 -0
- package/dist/shared/composables/useMask.js +32 -0
- package/dist/shared/composables/useMaskedFieldModel.d.ts +7 -0
- package/dist/shared/composables/useMaskedFieldModel.js +19 -0
- package/dist/shared/composables/useNumberFieldTyping.js +70 -0
- package/dist/shared/composables/usePointerGraceArea.js +40 -0
- package/dist/shared/composables/useRowSelection.d.ts +17 -0
- package/dist/shared/composables/useRowSelection.js +40 -0
- package/dist/shared/composables/useShortcuts.js +21 -0
- package/dist/shared/composables/useSlidingThumb.js +65 -0
- package/dist/shared/composables/useTableRows.d.ts +26 -0
- package/dist/shared/composables/useTableRows.js +41 -0
- package/dist/shared/types/floating-position.d.ts +9 -0
- package/dist/shared/types/table.d.ts +59 -0
- package/dist/shared/types/value-path.d.ts +6 -0
- package/dist/shared/utils/calendarMonth.js +23 -0
- package/dist/shared/utils/computeFloatingPosition.js +32 -0
- package/dist/shared/utils/createDateFormatters.js +31 -0
- package/dist/shared/utils/createDateInputMask.js +103 -0
- package/dist/shared/utils/createDebouncedCallback.js +17 -0
- package/dist/shared/utils/createMask.js +65 -0
- package/dist/shared/utils/createShortcutHandler.js +60 -0
- package/dist/shared/utils/createTypeaheadSearch.js +16 -0
- package/dist/shared/utils/editableFieldGuard.js +11 -0
- package/dist/shared/utils/findFirstRenderedVNode.js +14 -0
- package/dist/shared/utils/flipFloatingPosition.js +28 -0
- package/dist/shared/utils/floatingPanelTransition.js +25 -0
- package/dist/shared/utils/formatShortcut.js +86 -0
- package/dist/shared/utils/isApplePlatform.js +5 -0
- package/dist/shared/utils/isExternalUrl.js +5 -0
- package/dist/shared/utils/isoDate.js +50 -0
- package/dist/shared/utils/normalizeSearchText.d.ts +2 -0
- package/dist/shared/utils/normalizeSearchText.js +6 -0
- package/dist/shared/utils/parseShortcut.js +48 -0
- package/dist/shared/utils/pointerGraceArea.js +92 -0
- package/dist/shared/utils/readValueAtPath.d.ts +2 -0
- package/dist/shared/utils/readValueAtPath.js +7 -0
- package/dist/shared/utils/resolveFloatingAnchor.d.ts +4 -0
- package/dist/shared/utils/resolveFloatingAnchor.js +15 -0
- package/dist/shared/utils/resolvePressScale.js +5 -0
- package/dist/shared/utils/shiftFloatingPosition.js +21 -0
- package/dist/shared/utils/sliderPosition.js +27 -0
- package/dist/shared/utils/sliderThumbs.js +16 -0
- package/dist/shared/utils/steppedValue.js +21 -0
- package/dist/shared/utils/tableColumnTypes.d.ts +21 -0
- package/dist/shared/utils/tableColumnTypes.js +77 -0
- package/dist/shared/utils/tableColumns.d.ts +20 -0
- package/dist/shared/utils/tableColumns.js +77 -0
- package/dist/shared/utils/tableGroups.d.ts +10 -0
- package/dist/shared/utils/tableGroups.js +34 -0
- package/dist/shared/utils/tableRows.d.ts +25 -0
- package/dist/shared/utils/tableRows.js +80 -0
- package/dist/shared/utils/tableTree.d.ts +15 -0
- package/dist/shared/utils/tableTree.js +22 -0
- package/dist/shared/utils/toggleColumnSort.d.ts +5 -0
- package/dist/shared/utils/toggleColumnSort.js +27 -0
- package/dist/shared/utils/tv.js +1 -0
- package/dist/shared/utils/warnInDevelopment.d.ts +3 -0
- package/dist/shared/utils/warnInDevelopment.js +13 -0
- package/package.json +1 -1
- package/src/index.css +1 -0
- package/src/shared/styles/utilities/shake.css +21 -0
- package/dist/src-Rouj5r7z.js +0 -9111
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import e from "../../elements/avatar/Avatar.js";
|
|
2
|
+
import t from "../../elements/loading-indicator/LoadingIndicator.js";
|
|
3
|
+
import ee from "../../elements/select-field-control/SelectFieldControl.js";
|
|
4
|
+
import { useFieldDescription as n } from "../../shared/composables/useFieldDescription.js";
|
|
5
|
+
import te from "./SelectPanel.js";
|
|
6
|
+
import { useSelectControl as r } from "./useSelectControl.js";
|
|
7
|
+
import { Fragment as ne, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as re, createVNode as d, defineComponent as f, guardReactiveProps as p, isRef as m, mergeModels as h, mergeProps as g, normalizeClass as _, normalizeProps as v, openBlock as y, renderList as ie, renderSlot as b, toDisplayString as ae, unref as x, useModel as S, useSlots as C, useTemplateRef as w, withCtx as T } from "vue";
|
|
8
|
+
// src/components/select/SelectField.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var E = [
|
|
10
|
+
"disabled",
|
|
11
|
+
"value",
|
|
12
|
+
"placeholder"
|
|
13
|
+
], oe = ["name", "value"], D = /*@__PURE__*/ f({
|
|
14
|
+
__name: "SelectField",
|
|
15
|
+
props: /*@__PURE__*/ h({
|
|
16
|
+
label: {},
|
|
17
|
+
options: {},
|
|
18
|
+
id: {},
|
|
19
|
+
multiple: { type: Boolean },
|
|
20
|
+
valueKey: {},
|
|
21
|
+
labelKey: { default: "label" },
|
|
22
|
+
descriptionKey: { default: "description" },
|
|
23
|
+
avatarKey: { default: "avatar" },
|
|
24
|
+
placeholder: {},
|
|
25
|
+
searchable: { type: Boolean },
|
|
26
|
+
searchPlacement: { default: "list" },
|
|
27
|
+
searchPlaceholder: { default: "Search..." },
|
|
28
|
+
clearable: { type: Boolean },
|
|
29
|
+
clearLabel: { default: "Clear current value" },
|
|
30
|
+
loading: { type: Boolean },
|
|
31
|
+
loadingLabel: { default: "Loading..." },
|
|
32
|
+
noResultsLabel: {
|
|
33
|
+
type: Function,
|
|
34
|
+
default: (e) => `No results for “${e}”`
|
|
35
|
+
},
|
|
36
|
+
selectionLabel: {},
|
|
37
|
+
actions: { default: () => [] },
|
|
38
|
+
name: {},
|
|
39
|
+
hint: {},
|
|
40
|
+
errorMessage: {},
|
|
41
|
+
invalid: { type: Boolean },
|
|
42
|
+
disabled: { type: Boolean },
|
|
43
|
+
size: { default: "4xl" },
|
|
44
|
+
variant: { default: "outline" },
|
|
45
|
+
pill: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
},
|
|
49
|
+
floatLabel: { default: "auto" },
|
|
50
|
+
leadingIcon: {},
|
|
51
|
+
trailingIcon: {},
|
|
52
|
+
side: { default: "bottom" },
|
|
53
|
+
align: { default: "start" },
|
|
54
|
+
flip: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !0
|
|
57
|
+
},
|
|
58
|
+
strategy: { default: "absolute" },
|
|
59
|
+
ui: {},
|
|
60
|
+
class: { type: [
|
|
61
|
+
Array,
|
|
62
|
+
String,
|
|
63
|
+
null,
|
|
64
|
+
Number,
|
|
65
|
+
Boolean
|
|
66
|
+
] }
|
|
67
|
+
}, {
|
|
68
|
+
modelValue: {},
|
|
69
|
+
modelModifiers: {},
|
|
70
|
+
open: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !1
|
|
73
|
+
},
|
|
74
|
+
openModifiers: {}
|
|
75
|
+
}),
|
|
76
|
+
emits: ["update:modelValue", "update:open"],
|
|
77
|
+
setup(f) {
|
|
78
|
+
let h = f, D = C(), se = S(f, "modelValue"), O = S(f, "open"), ce = {
|
|
79
|
+
md: "3xs",
|
|
80
|
+
lg: "3xs",
|
|
81
|
+
xl: "2xs",
|
|
82
|
+
"2xl": "xs",
|
|
83
|
+
"3xl": "sm",
|
|
84
|
+
"4xl": "md"
|
|
85
|
+
}, k = w("selectFieldControl"), A = a(() => k.value?.containerElement ?? null), le = a(() => k.value?.triggerElement ?? null), j = w("selectFieldInput"), M = w("selectFieldLayer"), ue = a(() => h.searchable && h.searchPlacement === "field" ? j.value : le.value), { fieldId: N, hintId: P, errorMessageId: F, isInvalid: I, describingElementId: L } = n(h), R = a(() => `${N.value}-label`), { listboxId: z, searchQuery: B, highlightedItemId: V, visibleEntries: H, selectedValues: U, isOptionSelected: de, highlightItem: fe, toggleListbox: pe, selectOption: me, runSelectAction: he, handleTriggerKeydown: ge, handleSearchKeydown: _e, handleSearchTriggerKeydown: W, handleSearchTriggerPaste: G, searchesInTrigger: K, navigatesFromTrigger: ve, triggerSearchValue: ye, openTriggerSearchFromClick: be, searchFromTriggerInput: q, hasSelection: J, selectedSourceOptions: xe, selectedLabels: Se, selectionText: Y, announcesSelectedLabelsSeparately: Ce, selectedAvatar: X, resolvedTrailingIcon: we, showsTrailingIcon: Te, showsClearButton: Z, clearSelectionFromButton: Ee } = r(h, {
|
|
86
|
+
selectedValue: se,
|
|
87
|
+
isOpen: O,
|
|
88
|
+
rootElement: A,
|
|
89
|
+
triggerElement: ue,
|
|
90
|
+
layerElement: M,
|
|
91
|
+
hasSelectionSlot: () => !!D.selection
|
|
92
|
+
}), Q = a(() => X.value ? {
|
|
93
|
+
...X.value,
|
|
94
|
+
size: ce[h.size]
|
|
95
|
+
} : void 0), $ = a(() => ({
|
|
96
|
+
id: N.value,
|
|
97
|
+
role: "combobox",
|
|
98
|
+
"aria-labelledby": R.value,
|
|
99
|
+
"aria-haspopup": "listbox",
|
|
100
|
+
"aria-expanded": O.value,
|
|
101
|
+
"aria-controls": O.value ? z : void 0,
|
|
102
|
+
"aria-activedescendant": O.value && ve.value ? V.value : void 0,
|
|
103
|
+
"aria-describedby": L.value,
|
|
104
|
+
"aria-invalid": I.value || void 0,
|
|
105
|
+
"aria-busy": h.loading || void 0
|
|
106
|
+
})), De = a(() => J.value ? Y.value : h.placeholder ?? h.searchPlaceholder), Oe = a(() => K.value ? { onClick: (e) => be(e, j.value) } : {
|
|
107
|
+
...$.value,
|
|
108
|
+
tabindex: h.disabled ? -1 : 0,
|
|
109
|
+
"aria-disabled": h.disabled || void 0,
|
|
110
|
+
onClick: pe,
|
|
111
|
+
onKeydown: ge
|
|
112
|
+
});
|
|
113
|
+
return (n, r) => (y(), o(x(ee), {
|
|
114
|
+
ref_key: "selectFieldControl",
|
|
115
|
+
ref: k,
|
|
116
|
+
label: f.label,
|
|
117
|
+
"label-id": R.value,
|
|
118
|
+
"hint-id": x(P),
|
|
119
|
+
"error-message-id": x(F),
|
|
120
|
+
placeholder: f.placeholder,
|
|
121
|
+
hint: f.hint,
|
|
122
|
+
"error-message": f.errorMessage,
|
|
123
|
+
size: f.size,
|
|
124
|
+
variant: f.variant,
|
|
125
|
+
pill: f.pill,
|
|
126
|
+
"float-label": f.floatLabel,
|
|
127
|
+
open: O.value,
|
|
128
|
+
invalid: x(I),
|
|
129
|
+
disabled: f.disabled,
|
|
130
|
+
"has-value": x(J),
|
|
131
|
+
"leading-icon": f.leadingIcon,
|
|
132
|
+
"trailing-icon": x(Te) ? x(we) : null,
|
|
133
|
+
"shows-clear-button": x(Z),
|
|
134
|
+
"clear-label": f.clearLabel,
|
|
135
|
+
"spoken-value": x(Ce) ? x(Se) : void 0,
|
|
136
|
+
"trigger-attributes": Oe.value,
|
|
137
|
+
ui: f.ui,
|
|
138
|
+
class: _(h.class),
|
|
139
|
+
onClear: x(Ee)
|
|
140
|
+
}, u({
|
|
141
|
+
popup: T(() => [f.name ? (y(!0), c(ne, { key: 0 }, ie(x(U), (e, t) => (y(), c("input", {
|
|
142
|
+
key: t,
|
|
143
|
+
type: "hidden",
|
|
144
|
+
name: f.name,
|
|
145
|
+
value: String(e)
|
|
146
|
+
}, null, 8, oe))), 128)) : s("", !0), (y(), o(i, { to: "body" }, [O.value ? (y(), c("div", {
|
|
147
|
+
key: 0,
|
|
148
|
+
ref_key: "selectFieldLayer",
|
|
149
|
+
ref: M
|
|
150
|
+
}, [d(te, {
|
|
151
|
+
"search-query": x(B),
|
|
152
|
+
"onUpdate:searchQuery": r[3] ||= (e) => m(B) ? B.value = e : null,
|
|
153
|
+
"listbox-id": x(z),
|
|
154
|
+
label: f.label,
|
|
155
|
+
"visible-entries": x(H),
|
|
156
|
+
"is-option-selected": x(de),
|
|
157
|
+
"highlighted-item-id": x(V),
|
|
158
|
+
multiple: !!f.multiple,
|
|
159
|
+
"shows-search-input": f.searchable && !x(K),
|
|
160
|
+
"search-placeholder": f.searchPlaceholder,
|
|
161
|
+
"no-results-label": f.noResultsLabel,
|
|
162
|
+
actions: f.actions,
|
|
163
|
+
"anchor-element": A.value,
|
|
164
|
+
side: f.side,
|
|
165
|
+
align: f.align,
|
|
166
|
+
flip: f.flip,
|
|
167
|
+
strategy: f.strategy,
|
|
168
|
+
ui: f.ui,
|
|
169
|
+
onSelectOption: x(me),
|
|
170
|
+
onRunSelectAction: x(he),
|
|
171
|
+
onHighlightItem: x(fe),
|
|
172
|
+
onSearchKeydown: x(_e)
|
|
173
|
+
}, u({ _: 2 }, [D.option ? {
|
|
174
|
+
name: "option",
|
|
175
|
+
fn: T((e) => [b(n.$slots, "option", {
|
|
176
|
+
option: e.option,
|
|
177
|
+
selected: e.selected
|
|
178
|
+
})]),
|
|
179
|
+
key: "0"
|
|
180
|
+
} : void 0, D.search ? {
|
|
181
|
+
name: "search",
|
|
182
|
+
fn: T((e) => [b(n.$slots, "search", v(p(e)))]),
|
|
183
|
+
key: "1"
|
|
184
|
+
} : void 0]), 1032, [
|
|
185
|
+
"search-query",
|
|
186
|
+
"listbox-id",
|
|
187
|
+
"label",
|
|
188
|
+
"visible-entries",
|
|
189
|
+
"is-option-selected",
|
|
190
|
+
"highlighted-item-id",
|
|
191
|
+
"multiple",
|
|
192
|
+
"shows-search-input",
|
|
193
|
+
"search-placeholder",
|
|
194
|
+
"no-results-label",
|
|
195
|
+
"actions",
|
|
196
|
+
"anchor-element",
|
|
197
|
+
"side",
|
|
198
|
+
"align",
|
|
199
|
+
"flip",
|
|
200
|
+
"strategy",
|
|
201
|
+
"ui",
|
|
202
|
+
"onSelectOption",
|
|
203
|
+
"onRunSelectAction",
|
|
204
|
+
"onHighlightItem",
|
|
205
|
+
"onSearchKeydown"
|
|
206
|
+
])], 512)) : s("", !0)]))]),
|
|
207
|
+
default: T(() => [b(n.$slots, "selection", { selectedOptions: x(xe) }, () => [re(ae(x(Y)), 1)])]),
|
|
208
|
+
_: 2
|
|
209
|
+
}, [
|
|
210
|
+
Q.value ? {
|
|
211
|
+
name: "leading",
|
|
212
|
+
fn: T(() => [d(x(e), v(p(Q.value)), null, 16)]),
|
|
213
|
+
key: "0"
|
|
214
|
+
} : void 0,
|
|
215
|
+
x(K) ? {
|
|
216
|
+
name: "input",
|
|
217
|
+
fn: T(({ inputClass: e }) => [l("input", g({
|
|
218
|
+
ref_key: "selectFieldInput",
|
|
219
|
+
ref: j
|
|
220
|
+
}, $.value, {
|
|
221
|
+
type: "text",
|
|
222
|
+
"aria-autocomplete": "list",
|
|
223
|
+
autocomplete: "off",
|
|
224
|
+
spellcheck: !1,
|
|
225
|
+
disabled: f.disabled,
|
|
226
|
+
value: x(ye),
|
|
227
|
+
placeholder: De.value,
|
|
228
|
+
class: e,
|
|
229
|
+
onInput: r[0] ||= (...e) => x(q) && x(q)(...e),
|
|
230
|
+
onKeydown: r[1] ||= (...e) => x(W) && x(W)(...e),
|
|
231
|
+
onPaste: r[2] ||= (...e) => x(G) && x(G)(...e)
|
|
232
|
+
}), null, 16, E)]),
|
|
233
|
+
key: "1"
|
|
234
|
+
} : void 0,
|
|
235
|
+
f.loading ? {
|
|
236
|
+
name: "status",
|
|
237
|
+
fn: T(({ statusClass: e }) => [d(x(t), {
|
|
238
|
+
label: f.loadingLabel,
|
|
239
|
+
class: _(e)
|
|
240
|
+
}, null, 8, ["label", "class"])]),
|
|
241
|
+
key: "2"
|
|
242
|
+
} : void 0
|
|
243
|
+
]), 1032, [
|
|
244
|
+
"label",
|
|
245
|
+
"label-id",
|
|
246
|
+
"hint-id",
|
|
247
|
+
"error-message-id",
|
|
248
|
+
"placeholder",
|
|
249
|
+
"hint",
|
|
250
|
+
"error-message",
|
|
251
|
+
"size",
|
|
252
|
+
"variant",
|
|
253
|
+
"pill",
|
|
254
|
+
"float-label",
|
|
255
|
+
"open",
|
|
256
|
+
"invalid",
|
|
257
|
+
"disabled",
|
|
258
|
+
"has-value",
|
|
259
|
+
"leading-icon",
|
|
260
|
+
"trailing-icon",
|
|
261
|
+
"shows-clear-button",
|
|
262
|
+
"clear-label",
|
|
263
|
+
"spoken-value",
|
|
264
|
+
"trigger-attributes",
|
|
265
|
+
"ui",
|
|
266
|
+
"class",
|
|
267
|
+
"onClear"
|
|
268
|
+
]));
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
export { D as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import e from "../../elements/avatar/Avatar.js";
|
|
2
|
+
import { selectPanelTheme as t } from "./select-panel.theme.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeProps as l, normalizeClass as u, openBlock as d, renderSlot as f, toDisplayString as p, unref as m } from "vue";
|
|
4
|
+
import { Check as h } from "lucide-vue-next";
|
|
5
|
+
// src/components/select/SelectOptionRow.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var g = [
|
|
7
|
+
"id",
|
|
8
|
+
"aria-selected",
|
|
9
|
+
"aria-disabled"
|
|
10
|
+
], _ = /*@__PURE__*/ c({
|
|
11
|
+
__name: "SelectOptionRow",
|
|
12
|
+
props: {
|
|
13
|
+
resolvedOption: {},
|
|
14
|
+
selected: { type: Boolean },
|
|
15
|
+
highlighted: { type: Boolean },
|
|
16
|
+
ui: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["select", "highlight"],
|
|
19
|
+
setup(c, { emit: _ }) {
|
|
20
|
+
let v = c, y = _, b = n(() => v.resolvedOption.avatar ? v.resolvedOption.description ? "avatarWithDescription" : "avatar" : "text"), x = n(() => t({
|
|
21
|
+
optionSelected: v.selected,
|
|
22
|
+
optionDisabled: v.resolvedOption.disabled,
|
|
23
|
+
highlighted: v.highlighted,
|
|
24
|
+
optionLayout: b.value
|
|
25
|
+
})), S = n(() => v.resolvedOption.avatar?.initials ?? v.resolvedOption.label.charAt(0).toUpperCase());
|
|
26
|
+
function C() {
|
|
27
|
+
!v.resolvedOption.disabled && !v.highlighted && y("highlight");
|
|
28
|
+
}
|
|
29
|
+
return (t, n) => (d(), a("div", {
|
|
30
|
+
id: c.resolvedOption.optionId,
|
|
31
|
+
role: "option",
|
|
32
|
+
"aria-selected": c.selected,
|
|
33
|
+
"aria-disabled": c.resolvedOption.disabled || void 0,
|
|
34
|
+
class: u(x.value.option({ class: c.ui?.option })),
|
|
35
|
+
onPointermove: C,
|
|
36
|
+
onClick: n[0] ||= (e) => y("select")
|
|
37
|
+
}, [o("span", { class: u(x.value.optionIndicator({ class: c.ui?.optionIndicator })) }, [c.selected ? (d(), r(m(h), {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: u(x.value.optionCheckIcon({ class: c.ui?.optionCheckIcon }))
|
|
40
|
+
}, null, 8, ["class"])) : i("", !0)], 2), f(t.$slots, "default", {
|
|
41
|
+
option: c.resolvedOption.sourceOption,
|
|
42
|
+
selected: c.selected
|
|
43
|
+
}, () => [c.resolvedOption.avatar ? (d(), a("span", {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: u(x.value.optionAvatar({ class: c.ui?.optionAvatar }))
|
|
46
|
+
}, [s(m(e), l(c.resolvedOption.avatar, {
|
|
47
|
+
initials: S.value,
|
|
48
|
+
size: b.value === "avatarWithDescription" ? "md" : "2xs"
|
|
49
|
+
}), null, 16, ["initials", "size"])], 2)) : i("", !0), o("span", { class: u(x.value.optionText({ class: c.ui?.optionText })) }, [o("span", { class: u(x.value.optionLabel({ class: c.ui?.optionLabel })) }, p(c.resolvedOption.label), 3), c.resolvedOption.description ? (d(), a("span", {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: u(x.value.optionDescription({ class: c.ui?.optionDescription }))
|
|
52
|
+
}, p(c.resolvedOption.description), 3)) : i("", !0)], 2)])], 42, g));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export { _ as default };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { useFloatingPosition as e } from "../../shared/composables/useFloatingPosition.js";
|
|
2
|
+
import { flipFloatingPosition as t } from "../../shared/utils/flipFloatingPosition.js";
|
|
3
|
+
import { selectPanelTheme as n } from "./select-panel.theme.js";
|
|
4
|
+
import r from "./SelectOptionRow.js";
|
|
5
|
+
import { isResolvedSelectGroup as i } from "./selectOptions.js";
|
|
6
|
+
import { createSelectActionId as a } from "./useSelectListbox.js";
|
|
7
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, mergeProps as _, normalizeClass as v, normalizeStyle as y, openBlock as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useModel as E, useTemplateRef as D, watch as O, withCtx as k } from "vue";
|
|
8
|
+
import { Search as A } from "lucide-vue-next";
|
|
9
|
+
// src/components/select/SelectPanel.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var j = [
|
|
11
|
+
"id",
|
|
12
|
+
"aria-label",
|
|
13
|
+
"aria-multiselectable"
|
|
14
|
+
], M = ["aria-label"], N = [
|
|
15
|
+
"id",
|
|
16
|
+
"onPointermove",
|
|
17
|
+
"onClick"
|
|
18
|
+
], P = /*@__PURE__*/ h({
|
|
19
|
+
__name: "SelectPanel",
|
|
20
|
+
props: /*@__PURE__*/ g({
|
|
21
|
+
listboxId: {},
|
|
22
|
+
label: {},
|
|
23
|
+
visibleEntries: {},
|
|
24
|
+
isOptionSelected: { type: Function },
|
|
25
|
+
highlightedItemId: {},
|
|
26
|
+
multiple: { type: Boolean },
|
|
27
|
+
showsSearchInput: { type: Boolean },
|
|
28
|
+
searchPlaceholder: {},
|
|
29
|
+
noResultsLabel: { type: Function },
|
|
30
|
+
actions: {},
|
|
31
|
+
anchorElement: {},
|
|
32
|
+
side: {},
|
|
33
|
+
align: {},
|
|
34
|
+
flip: { type: Boolean },
|
|
35
|
+
strategy: {},
|
|
36
|
+
ui: {}
|
|
37
|
+
}, {
|
|
38
|
+
searchQuery: { required: !0 },
|
|
39
|
+
searchQueryModifiers: {}
|
|
40
|
+
}),
|
|
41
|
+
emits: /*@__PURE__*/ g([
|
|
42
|
+
"selectOption",
|
|
43
|
+
"runSelectAction",
|
|
44
|
+
"highlightItem",
|
|
45
|
+
"searchKeydown"
|
|
46
|
+
], ["update:searchQuery"]),
|
|
47
|
+
setup(h, { emit: g }) {
|
|
48
|
+
let P = h, F = g, I = E(h, "searchQuery"), L = D("selectPanel"), R = D("searchContainer"), z = s(() => P.flip ? [t()] : []), { floatingStyles: B, isPositioned: V } = e(() => P.anchorElement, L, {
|
|
49
|
+
open: !0,
|
|
50
|
+
side: () => P.side,
|
|
51
|
+
align: () => P.align,
|
|
52
|
+
sideOffset: 6,
|
|
53
|
+
strategy: () => P.strategy,
|
|
54
|
+
positionModifiers: z
|
|
55
|
+
}), H = s(() => n()), U = s(() => ({
|
|
56
|
+
type: "search",
|
|
57
|
+
value: I.value,
|
|
58
|
+
placeholder: P.searchPlaceholder,
|
|
59
|
+
"aria-label": P.searchPlaceholder,
|
|
60
|
+
"aria-controls": P.listboxId,
|
|
61
|
+
"aria-autocomplete": "list",
|
|
62
|
+
"aria-activedescendant": P.highlightedItemId,
|
|
63
|
+
autocomplete: "off",
|
|
64
|
+
spellcheck: !1,
|
|
65
|
+
onInput: (e) => {
|
|
66
|
+
e.target instanceof HTMLInputElement && (I.value = e.target.value);
|
|
67
|
+
},
|
|
68
|
+
onKeydown: (e) => F("searchKeydown", e)
|
|
69
|
+
}));
|
|
70
|
+
function W(e) {
|
|
71
|
+
return n({ highlighted: a(P.listboxId, e) === P.highlightedItemId });
|
|
72
|
+
}
|
|
73
|
+
function G(e) {
|
|
74
|
+
let t = a(P.listboxId, e);
|
|
75
|
+
t !== P.highlightedItemId && F("highlightItem", t);
|
|
76
|
+
}
|
|
77
|
+
function K(e) {
|
|
78
|
+
let t = e.target;
|
|
79
|
+
t instanceof Node && R.value?.contains(t) || e.preventDefault();
|
|
80
|
+
}
|
|
81
|
+
return O(V, (e) => {
|
|
82
|
+
e && P.showsSearchInput && R.value?.querySelector("input, textarea, [contenteditable=\"true\"]")?.focus();
|
|
83
|
+
}, { flush: "post" }), (e, t) => (b(), u("div", {
|
|
84
|
+
ref_key: "selectPanel",
|
|
85
|
+
ref: L,
|
|
86
|
+
style: y(T(B)),
|
|
87
|
+
class: v(H.value.panel({ class: h.ui?.panel })),
|
|
88
|
+
onPointerdown: K
|
|
89
|
+
}, [
|
|
90
|
+
h.showsSearchInput ? (b(), u("div", {
|
|
91
|
+
key: 0,
|
|
92
|
+
ref_key: "searchContainer",
|
|
93
|
+
ref: R,
|
|
94
|
+
class: v(H.value.search({ class: h.ui?.search }))
|
|
95
|
+
}, [S(e.$slots, "search", { searchAttributes: U.value }, () => [m(T(A), { class: v(H.value.searchIcon({ class: h.ui?.searchIcon })) }, null, 8, ["class"]), d("input", _(U.value, { class: H.value.searchInput({ class: h.ui?.searchInput }) }), null, 16)])], 2)) : l("", !0),
|
|
96
|
+
d("div", { class: v(H.value.optionList({ class: h.ui?.optionList })) }, [d("div", {
|
|
97
|
+
id: h.listboxId,
|
|
98
|
+
role: "listbox",
|
|
99
|
+
"aria-label": h.label,
|
|
100
|
+
"aria-multiselectable": h.multiple || void 0
|
|
101
|
+
}, [(b(!0), u(o, null, x(h.visibleEntries, (t, n) => (b(), u(o, { key: n }, [T(i)(t) ? (b(), u("div", {
|
|
102
|
+
key: 0,
|
|
103
|
+
role: "group",
|
|
104
|
+
"aria-label": t.groupLabel,
|
|
105
|
+
class: v(H.value.group({ class: h.ui?.group }))
|
|
106
|
+
}, [d("div", {
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
class: v(H.value.groupLabel({ class: h.ui?.groupLabel }))
|
|
109
|
+
}, w(t.groupLabel), 3), (b(!0), u(o, null, x(t.options, (t) => (b(), c(r, {
|
|
110
|
+
key: t.optionId,
|
|
111
|
+
"resolved-option": t,
|
|
112
|
+
selected: h.isOptionSelected(t),
|
|
113
|
+
highlighted: t.optionId === h.highlightedItemId,
|
|
114
|
+
ui: h.ui,
|
|
115
|
+
onSelect: (e) => F("selectOption", t),
|
|
116
|
+
onHighlight: (e) => F("highlightItem", t.optionId)
|
|
117
|
+
}, f({ _: 2 }, [e.$slots.option ? {
|
|
118
|
+
name: "default",
|
|
119
|
+
fn: k((t) => [S(e.$slots, "option", _({ ref_for: !0 }, t))]),
|
|
120
|
+
key: "0"
|
|
121
|
+
} : void 0]), 1032, [
|
|
122
|
+
"resolved-option",
|
|
123
|
+
"selected",
|
|
124
|
+
"highlighted",
|
|
125
|
+
"ui",
|
|
126
|
+
"onSelect",
|
|
127
|
+
"onHighlight"
|
|
128
|
+
]))), 128))], 10, M)) : (b(), c(r, {
|
|
129
|
+
key: 1,
|
|
130
|
+
"resolved-option": t,
|
|
131
|
+
selected: h.isOptionSelected(t),
|
|
132
|
+
highlighted: t.optionId === h.highlightedItemId,
|
|
133
|
+
ui: h.ui,
|
|
134
|
+
onSelect: (e) => F("selectOption", t),
|
|
135
|
+
onHighlight: (e) => F("highlightItem", t.optionId)
|
|
136
|
+
}, f({ _: 2 }, [e.$slots.option ? {
|
|
137
|
+
name: "default",
|
|
138
|
+
fn: k((t) => [S(e.$slots, "option", _({ ref_for: !0 }, t))]),
|
|
139
|
+
key: "0"
|
|
140
|
+
} : void 0]), 1032, [
|
|
141
|
+
"resolved-option",
|
|
142
|
+
"selected",
|
|
143
|
+
"highlighted",
|
|
144
|
+
"ui",
|
|
145
|
+
"onSelect",
|
|
146
|
+
"onHighlight"
|
|
147
|
+
]))], 64))), 128))], 8, j), I.value && !h.visibleEntries.length ? (b(), u("div", {
|
|
148
|
+
key: 0,
|
|
149
|
+
class: v(H.value.noResults({ class: h.ui?.noResults }))
|
|
150
|
+
}, w(h.noResultsLabel(I.value)), 3)) : l("", !0)], 2),
|
|
151
|
+
h.actions.length ? (b(), u("div", {
|
|
152
|
+
key: 1,
|
|
153
|
+
class: v(H.value.actions({ class: h.ui?.actions }))
|
|
154
|
+
}, [(b(!0), u(o, null, x(h.actions, (e, t) => (b(), u("button", {
|
|
155
|
+
id: T(a)(h.listboxId, t),
|
|
156
|
+
key: t,
|
|
157
|
+
type: "button",
|
|
158
|
+
tabindex: "-1",
|
|
159
|
+
class: v(W(t).action({ class: h.ui?.action })),
|
|
160
|
+
onPointermove: (e) => G(t),
|
|
161
|
+
onClick: (t) => F("runSelectAction", e, t)
|
|
162
|
+
}, [e.icon ? (b(), c(C(e.icon), {
|
|
163
|
+
key: 0,
|
|
164
|
+
class: v(H.value.actionIcon({ class: h.ui?.actionIcon }))
|
|
165
|
+
}, null, 8, ["class"])) : l("", !0), p(" " + w(e.label), 1)], 42, N))), 128))], 2)) : l("", !0)
|
|
166
|
+
], 38));
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
export { P as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { tv as e } from "../../shared/utils/tv.js";
|
|
2
|
+
// src/components/select/select-panel.theme.ts
|
|
3
|
+
var t = e({
|
|
4
|
+
slots: {
|
|
5
|
+
panel: "z-10 flex max-h-100 w-(--floating-anchor-width) min-w-64 flex-col rounded-xl border border-line bg-widget text-sm leading-5 shadow-lg",
|
|
6
|
+
search: "relative border-b border-line",
|
|
7
|
+
searchIcon: "pointer-events-none absolute top-1/2 left-3.5 size-4 -translate-y-1/2 text-muted",
|
|
8
|
+
searchInput: "h-10 w-full bg-transparent pr-3 pl-8.5 outline-hidden placeholder:text-muted",
|
|
9
|
+
optionList: "flex-1 overflow-auto p-1.5",
|
|
10
|
+
group: "not-first:mt-1.5",
|
|
11
|
+
groupLabel: "px-2 py-1.5 text-muted",
|
|
12
|
+
option: "flex gap-1 rounded-md px-2 py-1.5 wrap-anywhere",
|
|
13
|
+
optionIndicator: "flex h-5 w-4 shrink-0 items-center",
|
|
14
|
+
optionCheckIcon: "size-4",
|
|
15
|
+
optionAvatar: "mr-1 flex shrink-0",
|
|
16
|
+
optionText: "min-w-0",
|
|
17
|
+
optionLabel: "block",
|
|
18
|
+
optionDescription: "block font-normal text-muted",
|
|
19
|
+
noResults: "my-4 px-2 py-1.5 text-center text-muted",
|
|
20
|
+
actions: "border-t border-line p-1.5",
|
|
21
|
+
action: "flex w-full cursor-pointer items-center gap-1.5 rounded-md px-2 py-1.5 text-left outline-primary focus-visible:outline-2",
|
|
22
|
+
actionIcon: "size-4 shrink-0"
|
|
23
|
+
},
|
|
24
|
+
variants: {
|
|
25
|
+
optionSelected: { true: { option: "font-semibold" } },
|
|
26
|
+
optionDisabled: {
|
|
27
|
+
true: { option: "cursor-not-allowed opacity-50" },
|
|
28
|
+
false: { option: "cursor-pointer" }
|
|
29
|
+
},
|
|
30
|
+
highlighted: { true: {
|
|
31
|
+
option: "light:bg-stone-950/8 dark:bg-stone-200/10",
|
|
32
|
+
action: "light:bg-stone-950/8 dark:bg-stone-200/10"
|
|
33
|
+
} },
|
|
34
|
+
optionLayout: {
|
|
35
|
+
text: { option: "items-start" },
|
|
36
|
+
avatar: {
|
|
37
|
+
option: "items-center",
|
|
38
|
+
optionAvatar: "-my-0.5"
|
|
39
|
+
},
|
|
40
|
+
avatarWithDescription: { option: "items-center" }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export { t as selectPanelTheme };
|
|
@@ -34,8 +34,6 @@ export interface ResolvedSelectGroup<SourceOption = unknown> {
|
|
|
34
34
|
export type ResolvedSelectEntry<SourceOption = unknown> = ResolvedSelectOption<SourceOption> | ResolvedSelectGroup<SourceOption>;
|
|
35
35
|
export declare function isSelectOptionGroup<SourceOption>(optionEntry: SelectOptionEntry<SourceOption>): optionEntry is SelectOptionGroup<SourceOption>;
|
|
36
36
|
export declare function isResolvedSelectGroup<SourceOption>(resolvedEntry: ResolvedSelectEntry<SourceOption>): resolvedEntry is ResolvedSelectGroup<SourceOption>;
|
|
37
|
-
/** Read a field of an option, following dotted paths such as "profile.name". */
|
|
38
|
-
export declare function readOptionField(sourceOption: unknown, fieldPath: string): unknown;
|
|
39
37
|
/** Turn the options given to a select, raw API objects included, into options it can display. */
|
|
40
38
|
export declare function resolveSelectEntries<SourceOption>(optionEntries: SelectOptionEntry<SourceOption>[], fieldKeys: SelectOptionFieldKeys, optionIdPrefix: string): ResolvedSelectEntry<SourceOption>[];
|
|
41
39
|
/** Keep the options whose label contains the search query, and drop the groups left empty. */
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { normalizeSearchText as e } from "../../shared/utils/normalizeSearchText.js";
|
|
2
|
+
import { readValueAtPath as t } from "../../shared/utils/readValueAtPath.js";
|
|
3
|
+
// src/components/select/selectOptions.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
return typeof e == "object" && !!e && Array.isArray(Reflect.get(e, "options"));
|
|
6
|
+
}
|
|
7
|
+
function r(e) {
|
|
8
|
+
return "groupLabel" in e;
|
|
9
|
+
}
|
|
10
|
+
var i = [
|
|
11
|
+
"imageUrl",
|
|
12
|
+
"initials",
|
|
13
|
+
"icon",
|
|
14
|
+
"color",
|
|
15
|
+
"variant",
|
|
16
|
+
"pill"
|
|
17
|
+
];
|
|
18
|
+
function a(e) {
|
|
19
|
+
if (typeof e == "string") return { imageUrl: e };
|
|
20
|
+
if (typeof e != "object" || !e) return;
|
|
21
|
+
let t = i.filter((t) => Reflect.get(e, t) !== void 0).map((t) => [t, Reflect.get(e, t)]);
|
|
22
|
+
return Object.fromEntries(t);
|
|
23
|
+
}
|
|
24
|
+
function o(e, n, r) {
|
|
25
|
+
if (typeof e != "object" || !e) return {
|
|
26
|
+
optionId: r,
|
|
27
|
+
value: e,
|
|
28
|
+
label: String(e),
|
|
29
|
+
disabled: !1,
|
|
30
|
+
sourceOption: e
|
|
31
|
+
};
|
|
32
|
+
let i = t(e, n.descriptionKey);
|
|
33
|
+
return {
|
|
34
|
+
optionId: r,
|
|
35
|
+
value: t(e, n.valueKey),
|
|
36
|
+
label: String(t(e, n.labelKey) ?? ""),
|
|
37
|
+
description: i == null ? void 0 : String(i),
|
|
38
|
+
disabled: !!t(e, "disabled"),
|
|
39
|
+
avatar: a(t(e, n.avatarKey)),
|
|
40
|
+
sourceOption: e
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function s(e, t, r) {
|
|
44
|
+
let i = 0, a = () => `${r}-option-${i++}`;
|
|
45
|
+
return e.map((e) => n(e) ? {
|
|
46
|
+
groupLabel: e.label,
|
|
47
|
+
options: e.options.map((e) => o(e, t, a()))
|
|
48
|
+
} : o(e, t, a()));
|
|
49
|
+
}
|
|
50
|
+
function c(t, n) {
|
|
51
|
+
let i = e(n);
|
|
52
|
+
if (!i) return t;
|
|
53
|
+
let a = (t) => e(t.label).includes(i);
|
|
54
|
+
return t.flatMap((e) => {
|
|
55
|
+
if (!r(e)) return a(e) ? [e] : [];
|
|
56
|
+
let t = e.options.filter(a);
|
|
57
|
+
return t.length ? [{
|
|
58
|
+
...e,
|
|
59
|
+
options: t
|
|
60
|
+
}] : [];
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function l(e) {
|
|
64
|
+
return e.flatMap((e) => r(e) ? e.options : [e]);
|
|
65
|
+
}
|
|
66
|
+
export { l as collectSelectOptions, c as filterSelectEntries, r as isResolvedSelectGroup, n as isSelectOptionGroup, s as resolveSelectEntries };
|
|
@@ -40,10 +40,10 @@ export declare function useSelectControl<SourceOption>(controlProps: SelectContr
|
|
|
40
40
|
announcesSelectedLabelsSeparately: import("vue").ComputedRef<boolean>;
|
|
41
41
|
selectedAvatar: import("vue").ComputedRef<{
|
|
42
42
|
initials: string;
|
|
43
|
-
pill?: boolean | undefined;
|
|
44
|
-
variant?: "solid" | "soft" | undefined;
|
|
45
|
-
color?: "primary" | "secondary" | "gray" | "danger" | "success" | "info" | "discovery" | undefined;
|
|
46
43
|
icon?: Component | undefined;
|
|
44
|
+
variant?: "soft" | "solid" | undefined;
|
|
45
|
+
color?: "primary" | "secondary" | "gray" | "success" | "info" | "discovery" | "danger" | undefined;
|
|
46
|
+
pill?: boolean | undefined;
|
|
47
47
|
imageUrl?: string | undefined;
|
|
48
48
|
} | undefined>;
|
|
49
49
|
resolvedTrailingIcon: import("vue").ComputedRef<Component | import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}> | null>;
|