mood-ui 0.10.0 → 0.12.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/components/data-display/Chart.cjs +6 -0
- package/dist/components/data-display/Chart.cjs.map +1 -0
- package/dist/components/data-display/Chart.mjs +7 -0
- package/dist/components/data-display/Chart.mjs.map +1 -0
- package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.cjs +48 -0
- package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.mjs +47 -0
- package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/data-display/Stat.cjs.map +1 -1
- package/dist/components/data-display/Stat.mjs.map +1 -1
- package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.cjs +88 -75
- package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.mjs +90 -77
- package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.cjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.mjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs +4 -1
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +4 -1
- package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.cjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.mjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs +7 -4
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -4
- package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.cjs +1 -1
- package/dist/components/data-display/calendar/MonthView.cjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.mjs +1 -1
- package/dist/components/data-display/calendar/MonthView.mjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs +8 -12
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +8 -12
- package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.cjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.mjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs +7 -4
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -4
- package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.cjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.mjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs +7 -4
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -4
- package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/chart/Cartesian.cjs +6 -0
- package/dist/components/data-display/chart/Cartesian.cjs.map +1 -0
- package/dist/components/data-display/chart/Cartesian.mjs +7 -0
- package/dist/components/data-display/chart/Cartesian.mjs.map +1 -0
- package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.cjs +573 -0
- package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.mjs +572 -0
- package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/data-display/chart/Heatmap.cjs +6 -0
- package/dist/components/data-display/chart/Heatmap.cjs.map +1 -0
- package/dist/components/data-display/chart/Heatmap.mjs +7 -0
- package/dist/components/data-display/chart/Heatmap.mjs.map +1 -0
- package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.cjs +332 -0
- package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.mjs +331 -0
- package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/data-display/chart/Polar.cjs +6 -0
- package/dist/components/data-display/chart/Polar.cjs.map +1 -0
- package/dist/components/data-display/chart/Polar.mjs +7 -0
- package/dist/components/data-display/chart/Polar.mjs.map +1 -0
- package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.cjs +361 -0
- package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.mjs +360 -0
- package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/data-display/chart/Radar.cjs +6 -0
- package/dist/components/data-display/chart/Radar.cjs.map +1 -0
- package/dist/components/data-display/chart/Radar.mjs +7 -0
- package/dist/components/data-display/chart/Radar.mjs.map +1 -0
- package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.cjs +347 -0
- package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.mjs +346 -0
- package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/data-display/chart/Sparkline.cjs +6 -0
- package/dist/components/data-display/chart/Sparkline.cjs.map +1 -0
- package/dist/components/data-display/chart/Sparkline.mjs +7 -0
- package/dist/components/data-display/chart/Sparkline.mjs.map +1 -0
- package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.cjs +293 -0
- package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.mjs +292 -0
- package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/data-display/chart/useChart.cjs +189 -0
- package/dist/components/data-display/chart/useChart.cjs.map +1 -0
- package/dist/components/data-display/chart/useChart.mjs +182 -0
- package/dist/components/data-display/chart/useChart.mjs.map +1 -0
- package/dist/components/data-display/date-picker/DateRangePicker.cjs.map +1 -1
- package/dist/components/data-display/date-picker/DateRangePicker.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.cjs +1 -7
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +1 -7
- package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.cjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.mjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/feedback/Drawer.cjs.map +1 -1
- package/dist/components/feedback/Drawer.mjs.map +1 -1
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +4 -9
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +4 -9
- package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Modal.cjs.map +1 -1
- package/dist/components/feedback/Modal.mjs.map +1 -1
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +4 -9
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +4 -9
- package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/feedback/Tooltip.cjs.map +1 -1
- package/dist/components/feedback/Tooltip.mjs.map +1 -1
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs +64 -20
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs +64 -20
- package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Button.cjs +1 -1
- package/dist/components/forms/Button.cjs.map +1 -1
- package/dist/components/forms/Button.mjs +1 -1
- package/dist/components/forms/Button.mjs.map +1 -1
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs +76 -63
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs +77 -64
- package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/ButtonGroup.cjs +1 -1
- package/dist/components/forms/ButtonGroup.cjs.map +1 -1
- package/dist/components/forms/ButtonGroup.mjs +1 -1
- package/dist/components/forms/ButtonGroup.mjs.map +1 -1
- package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Checkbox.cjs +1 -1
- package/dist/components/forms/Checkbox.cjs.map +1 -1
- package/dist/components/forms/Checkbox.mjs +1 -1
- package/dist/components/forms/Checkbox.mjs.map +1 -1
- package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.cjs +7 -7
- package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.mjs +7 -7
- package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/ColorPicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/ColorPicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/Combobox.cjs.map +1 -1
- package/dist/components/forms/Combobox.mjs.map +1 -1
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs +4 -4
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/DateField.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/DateField.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/DateRangeField.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/DateRangeField.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/DateTimeField.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/DateTimeField.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/FormField.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/FormField.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/Input.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/Input.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/MenuButton.cjs +6 -0
- package/dist/components/forms/MenuButton.cjs.map +1 -0
- package/dist/components/forms/MenuButton.mjs +7 -0
- package/dist/components/forms/MenuButton.mjs.map +1 -0
- package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.cjs +270 -0
- package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.mjs +269 -0
- package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/NumberInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/NumberInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/OTPInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/OTPInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/PasswordInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/PasswordInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/forms/PhoneInput.cjs.map +1 -1
- package/dist/components/forms/PhoneInput.mjs.map +1 -1
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs +8 -3
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs +8 -3
- package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Radio.cjs +1 -1
- package/dist/components/forms/Radio.cjs.map +1 -1
- package/dist/components/forms/Radio.mjs +1 -1
- package/dist/components/forms/Radio.mjs.map +1 -1
- package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.cjs +6 -6
- package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.mjs +6 -6
- package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/RangeSlider.cjs.map +1 -1
- package/dist/components/forms/RangeSlider.mjs.map +1 -1
- package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.cjs +6 -6
- package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.mjs +6 -6
- package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/SearchInput.cjs.map +1 -1
- package/dist/components/forms/SearchInput.mjs.map +1 -1
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs +230 -23
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs +232 -25
- package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Segmented.cjs +1 -1
- package/dist/components/forms/Segmented.cjs.map +1 -1
- package/dist/components/forms/Segmented.mjs +1 -1
- package/dist/components/forms/Segmented.mjs.map +1 -1
- package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.cjs +4 -12
- package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.mjs +4 -12
- package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Select.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/forms/Select.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/forms/Slider.cjs.map +1 -1
- package/dist/components/forms/Slider.mjs.map +1 -1
- package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.cjs +6 -6
- package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.mjs +6 -6
- package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Switch.cjs +1 -1
- package/dist/components/forms/Switch.cjs.map +1 -1
- package/dist/components/forms/Switch.mjs +1 -1
- package/dist/components/forms/Switch.mjs.map +1 -1
- package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.cjs +7 -7
- package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.mjs +7 -7
- package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/components/layout/AppShell.cjs.map +1 -1
- package/dist/components/layout/AppShell.mjs.map +1 -1
- package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.cjs +8 -8
- package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.mjs +8 -8
- package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/PopoverPanel.cjs +1 -1
- package/dist/components/layout/PopoverPanel.cjs.map +1 -1
- package/dist/components/layout/PopoverPanel.mjs +1 -1
- package/dist/components/layout/PopoverPanel.mjs.map +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/Sidebar.cjs.map +1 -1
- package/dist/components/layout/Sidebar.mjs.map +1 -1
- package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.cjs +36 -21
- package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.mjs +36 -21
- package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/layout/Topbar.cjs.map +1 -1
- package/dist/components/layout/Topbar.mjs.map +1 -1
- package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/navigation/Switcher.cjs.map +1 -1
- package/dist/components/navigation/Switcher.mjs.map +1 -1
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +42 -44
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +42 -44
- package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/components/navigation/Tabs.cjs +1 -1
- package/dist/components/navigation/Tabs.cjs.map +1 -1
- package/dist/components/navigation/Tabs.mjs +1 -1
- package/dist/components/navigation/Tabs.mjs.map +1 -1
- package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.cjs +1 -9
- package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.mjs +1 -9
- package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/dist/composables/eventColors.cjs +51 -27
- package/dist/composables/eventColors.cjs.map +1 -1
- package/dist/composables/eventColors.mjs +51 -27
- package/dist/composables/eventColors.mjs.map +1 -1
- package/dist/composables/useBodyScrollLock.cjs +44 -0
- package/dist/composables/useBodyScrollLock.cjs.map +1 -0
- package/dist/composables/useBodyScrollLock.mjs +43 -0
- package/dist/composables/useBodyScrollLock.mjs.map +1 -0
- package/dist/composables/useCalendarTheme.cjs +29 -8
- package/dist/composables/useCalendarTheme.cjs.map +1 -1
- package/dist/composables/useCalendarTheme.mjs +29 -8
- package/dist/composables/useCalendarTheme.mjs.map +1 -1
- package/dist/composables/useField.cjs +21 -23
- package/dist/composables/useField.cjs.map +1 -1
- package/dist/composables/useField.mjs +21 -24
- package/dist/composables/useField.mjs.map +1 -1
- package/dist/composables/usePopover.cjs +49 -13
- package/dist/composables/usePopover.cjs.map +1 -1
- package/dist/composables/usePopover.mjs +49 -13
- package/dist/composables/usePopover.mjs.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.mjs +4 -2
- package/dist/mood-ui.css +116 -482
- package/dist/types/components/data-display/Chart.vue.d.ts +8 -0
- package/dist/types/components/data-display/Stat.vue.d.ts +12 -2
- package/dist/types/components/data-display/chart/Cartesian.vue.d.ts +17 -0
- package/dist/types/components/data-display/chart/Heatmap.vue.d.ts +10 -0
- package/dist/types/components/data-display/chart/Polar.vue.d.ts +9 -0
- package/dist/types/components/data-display/chart/Radar.vue.d.ts +10 -0
- package/dist/types/components/data-display/chart/Sparkline.vue.d.ts +13 -0
- package/dist/types/components/data-display/chart/useChart.d.ts +49 -0
- package/dist/types/components/feedback/Drawer.vue.d.ts +2 -2
- package/dist/types/components/feedback/Modal.vue.d.ts +2 -2
- package/dist/types/components/feedback/Tooltip.vue.d.ts +1 -1
- package/dist/types/components/forms/Button.vue.d.ts +3 -2
- package/dist/types/components/forms/Combobox.vue.d.ts +3 -3
- package/dist/types/components/forms/DateField.vue.d.ts +3 -3
- package/dist/types/components/forms/DateRangeField.vue.d.ts +3 -3
- package/dist/types/components/forms/DateTimeField.vue.d.ts +3 -3
- package/dist/types/components/forms/MenuButton.vue.d.ts +23 -0
- package/dist/types/components/forms/MultiSelect.vue.d.ts +3 -3
- package/dist/types/components/forms/SearchInput.vue.d.ts +33 -2
- package/dist/types/components/forms/Select.vue.d.ts +2 -2
- package/dist/types/components/layout/AppShell.vue.d.ts +1 -1
- package/dist/types/components/layout/PageHeader.vue.d.ts +1 -1
- package/dist/types/components/layout/Sidebar.vue.d.ts +4 -4
- package/dist/types/components/layout/Stack.vue.d.ts +1 -1
- package/dist/types/components/layout/Topbar.vue.d.ts +1 -1
- package/dist/types/components/navigation/Breadcrumbs.vue.d.ts +1 -1
- package/dist/types/components/navigation/Switcher.vue.d.ts +3 -3
- package/dist/types/composables/eventColors.d.ts +2 -2
- package/dist/types/composables/useBodyScrollLock.d.ts +19 -0
- package/dist/types/composables/useCalendarTheme.d.ts +2 -0
- package/dist/types/composables/useField.d.ts +10 -0
- package/dist/types/composables/usePopover.d.ts +7 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interfaces/data-display/Chart.interface.d.ts +97 -0
- package/dist/types/interfaces/data-display/Stat.interface.d.ts +17 -6
- package/dist/types/interfaces/data-display/calendar/AgendaView.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/DayView.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/MonthView.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/Scheduler.interface.d.ts +5 -0
- package/dist/types/interfaces/data-display/calendar/WeekView.interface.d.ts +5 -0
- package/dist/types/interfaces/feedback/Tooltip.interface.d.ts +11 -0
- package/dist/types/interfaces/forms/MenuButton.interface.d.ts +38 -0
- package/dist/types/interfaces/forms/SearchInput.interface.d.ts +36 -0
- package/dist/types/utils/cssLength.d.ts +5 -0
- package/dist/types/utils/tooltipArrow.d.ts +34 -0
- package/dist/utils/cssLength.cjs +13 -0
- package/dist/utils/cssLength.cjs.map +1 -0
- package/dist/utils/cssLength.mjs +13 -0
- package/dist/utils/cssLength.mjs.map +1 -0
- package/dist/utils/tooltipArrow.cjs +37 -0
- package/dist/utils/tooltipArrow.cjs.map +1 -0
- package/dist/utils/tooltipArrow.mjs +36 -0
- package/dist/utils/tooltipArrow.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { useModoLocale, useResolvedSize, useSizeTokens } from "../../composables/useModoConfig.mjs";
|
|
1
|
+
import { useModoLocale, useResolvedRadius, useResolvedSize, useSizeTokens } from "../../composables/useModoConfig.mjs";
|
|
2
|
+
import { usePopover } from "../../composables/usePopover.mjs";
|
|
3
|
+
import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
|
|
2
4
|
import Loader_default from "../feedback/Loader.mjs";
|
|
3
5
|
import Button_default from "./Button.mjs";
|
|
6
|
+
import PopoverPanel_default from "../layout/PopoverPanel.mjs";
|
|
4
7
|
import Typography_default from "../data-display/Typography.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, toDisplayString, unref, withCtx } from "vue";
|
|
8
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useSlots, watch, withCtx, withModifiers } from "vue";
|
|
7
9
|
import { MagnifyingGlassIcon, XMarkIcon } from "@heroicons/vue/24/outline";
|
|
8
10
|
//#region src/components/forms/SearchInput.vue?vue&type=script&setup=true&lang.ts
|
|
9
11
|
var _hoisted_1 = ["for"];
|
|
@@ -25,7 +27,10 @@ var _hoisted_3 = [
|
|
|
25
27
|
"aria-label",
|
|
26
28
|
"aria-invalid",
|
|
27
29
|
"aria-describedby",
|
|
28
|
-
"aria-required"
|
|
30
|
+
"aria-required",
|
|
31
|
+
"aria-expanded",
|
|
32
|
+
"aria-controls",
|
|
33
|
+
"aria-activedescendant"
|
|
29
34
|
];
|
|
30
35
|
var _hoisted_4 = {
|
|
31
36
|
key: 2,
|
|
@@ -37,18 +42,52 @@ var _hoisted_4 = {
|
|
|
37
42
|
])
|
|
38
43
|
};
|
|
39
44
|
var _hoisted_5 = {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "px-3 py-6 flex items-center justify-center"
|
|
47
|
+
};
|
|
48
|
+
var _hoisted_6 = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "px-3 py-6 text-center text-muted-foreground text-body"
|
|
51
|
+
};
|
|
52
|
+
var _hoisted_7 = ["id", "aria-busy"];
|
|
53
|
+
var _hoisted_8 = {
|
|
54
|
+
key: 0,
|
|
55
|
+
role: "presentation",
|
|
56
|
+
class: "px-3 pt-2 pb-1 text-caption font-medium text-muted-foreground select-none"
|
|
57
|
+
};
|
|
58
|
+
var _hoisted_9 = [
|
|
59
|
+
"id",
|
|
60
|
+
"aria-selected",
|
|
61
|
+
"aria-disabled"
|
|
62
|
+
];
|
|
63
|
+
var _hoisted_10 = { class: "flex flex-col min-w-0 flex-1" };
|
|
64
|
+
var _hoisted_11 = { class: "truncate" };
|
|
65
|
+
var _hoisted_12 = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "text-caption text-muted-foreground truncate"
|
|
68
|
+
};
|
|
69
|
+
var _hoisted_13 = {
|
|
40
70
|
key: 1,
|
|
71
|
+
class: "ml-2 text-caption text-muted-foreground tabular-nums shrink-0",
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
};
|
|
74
|
+
var _hoisted_14 = {
|
|
75
|
+
key: 2,
|
|
41
76
|
class: "flex items-start justify-between gap-2"
|
|
42
77
|
};
|
|
43
|
-
var
|
|
78
|
+
var _hoisted_15 = {
|
|
44
79
|
key: 2,
|
|
45
80
|
class: "flex-1"
|
|
46
81
|
};
|
|
47
|
-
var
|
|
82
|
+
var _hoisted_16 = ["id"];
|
|
48
83
|
var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
49
84
|
__name: "SearchInput",
|
|
50
85
|
props: {
|
|
51
86
|
modelValue: {},
|
|
87
|
+
items: {},
|
|
88
|
+
open: { type: Boolean },
|
|
89
|
+
emptyText: {},
|
|
90
|
+
resultsPlacement: { default: "bottom-start" },
|
|
52
91
|
label: {},
|
|
53
92
|
placeholder: { default: "Search…" },
|
|
54
93
|
helperText: {},
|
|
@@ -99,17 +138,20 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
99
138
|
"focus",
|
|
100
139
|
"blur",
|
|
101
140
|
"clear",
|
|
102
|
-
"search"
|
|
141
|
+
"search",
|
|
142
|
+
"select",
|
|
143
|
+
"update:open"
|
|
103
144
|
],
|
|
104
145
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
105
146
|
const loc = useModoLocale();
|
|
147
|
+
const slots = useSlots();
|
|
106
148
|
const emit = __emit;
|
|
107
149
|
const props = __props;
|
|
108
150
|
useResolvedSize(() => props.size);
|
|
109
151
|
const sz = useSizeTokens(() => props.size);
|
|
110
152
|
const inputRef = ref(null);
|
|
111
153
|
const focused = ref(false);
|
|
112
|
-
const { fieldId, radius, stateColor, hasError, hasValue,
|
|
154
|
+
const { fieldId, radius, stateColor, hasError, hasValue, currentLength, showCounterEffective, counterOverflow, errorId, helperId, counterId, describedBy } = useFieldState(props, {
|
|
113
155
|
componentName: "SearchInput",
|
|
114
156
|
idPrefix: "modo-search"
|
|
115
157
|
});
|
|
@@ -120,8 +162,76 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
120
162
|
radius,
|
|
121
163
|
halo: () => props.halo
|
|
122
164
|
});
|
|
165
|
+
const isDisabled = computed(() => !!props.disabled);
|
|
123
166
|
const affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? "text-muted-foreground");
|
|
124
167
|
const affordanceActionClass = computed(() => FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ?? "text-muted-foreground hover:text-foreground");
|
|
168
|
+
const resolvedRadius = useResolvedRadius(() => props.radius);
|
|
169
|
+
const hasDropdown = computed(() => props.items !== void 0 || !!slots.results);
|
|
170
|
+
const resultItems = computed(() => props.items ?? []);
|
|
171
|
+
const highlightedIdx = ref(-1);
|
|
172
|
+
const { triggerRef: popoverTrigger, panelRef, isOpen, panelStyle, open: openPopover, close: closePopover } = usePopover({
|
|
173
|
+
placement: () => props.resultsPlacement,
|
|
174
|
+
matchTriggerWidth: true,
|
|
175
|
+
closeOnEscape: false,
|
|
176
|
+
closeOnScroll: false,
|
|
177
|
+
onOpen: () => emit("update:open", true),
|
|
178
|
+
onClose: () => {
|
|
179
|
+
emit("update:open", false);
|
|
180
|
+
highlightedIdx.value = -1;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const wrapperEl = ref(null);
|
|
184
|
+
watch(wrapperEl, (el) => {
|
|
185
|
+
popoverTrigger.value = el;
|
|
186
|
+
});
|
|
187
|
+
const renderRows = computed(() => {
|
|
188
|
+
const rows = [];
|
|
189
|
+
let prevGroup;
|
|
190
|
+
resultItems.value.forEach((item, index) => {
|
|
191
|
+
if (item.group && item.group !== prevGroup) {
|
|
192
|
+
rows.push({
|
|
193
|
+
kind: "header",
|
|
194
|
+
label: item.group,
|
|
195
|
+
key: `h-${index}`
|
|
196
|
+
});
|
|
197
|
+
prevGroup = item.group;
|
|
198
|
+
}
|
|
199
|
+
rows.push({
|
|
200
|
+
kind: "option",
|
|
201
|
+
item,
|
|
202
|
+
index,
|
|
203
|
+
key: `o-${item.id ?? index}`
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
return rows;
|
|
207
|
+
});
|
|
208
|
+
const enabledIndices = computed(() => resultItems.value.map((it, i) => it.disabled ? -1 : i).filter((i) => i !== -1));
|
|
209
|
+
const shouldShowResults = computed(() => hasDropdown.value && focused.value && (resultItems.value.length > 0 || props.loading || !!props.emptyText || !!slots.empty));
|
|
210
|
+
function syncOpen() {
|
|
211
|
+
if (shouldShowResults.value) {
|
|
212
|
+
if (!isOpen.value) openPopover();
|
|
213
|
+
} else if (isOpen.value) closePopover();
|
|
214
|
+
}
|
|
215
|
+
watch(shouldShowResults, syncOpen);
|
|
216
|
+
watch(() => resultItems.value.length, () => {
|
|
217
|
+
if (isOpen.value || shouldShowResults.value) nextTick(syncOpen);
|
|
218
|
+
});
|
|
219
|
+
watch(() => props.open, (v) => {
|
|
220
|
+
if (v === void 0) return;
|
|
221
|
+
if (v && shouldShowResults.value) openPopover();
|
|
222
|
+
else if (!v) closePopover();
|
|
223
|
+
});
|
|
224
|
+
function moveHighlight(delta) {
|
|
225
|
+
const order = enabledIndices.value;
|
|
226
|
+
if (!order.length) return;
|
|
227
|
+
const cur = order.indexOf(highlightedIdx.value);
|
|
228
|
+
highlightedIdx.value = cur === -1 ? delta > 0 ? order[0] : order[order.length - 1] : order[(cur + delta + order.length) % order.length];
|
|
229
|
+
}
|
|
230
|
+
function selectResult(item) {
|
|
231
|
+
if (item.disabled) return;
|
|
232
|
+
emit("select", item);
|
|
233
|
+
closePopover();
|
|
234
|
+
}
|
|
125
235
|
let debounceTimer = null;
|
|
126
236
|
function scheduleSearch(value) {
|
|
127
237
|
if (!props.debounce || props.debounce <= 0) return;
|
|
@@ -143,18 +253,42 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
143
253
|
scheduleSearch(target.value);
|
|
144
254
|
}
|
|
145
255
|
function onKeydown(e) {
|
|
256
|
+
if (hasDropdown.value && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
257
|
+
e.preventDefault();
|
|
258
|
+
if (!isOpen.value && shouldShowResults.value) openPopover();
|
|
259
|
+
moveHighlight(e.key === "ArrowDown" ? 1 : -1);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
146
262
|
if (e.key === "Enter") {
|
|
263
|
+
if (isOpen.value && highlightedIdx.value >= 0) {
|
|
264
|
+
const item = resultItems.value[highlightedIdx.value];
|
|
265
|
+
if (item && !item.disabled) {
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
selectResult(item);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
147
271
|
e.preventDefault();
|
|
148
272
|
cancelDebounce();
|
|
149
273
|
emit("search", String(props.modelValue ?? ""));
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (e.key === "Escape") {
|
|
277
|
+
if (isOpen.value) {
|
|
278
|
+
e.preventDefault();
|
|
279
|
+
closePopover();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (hasValue.value) {
|
|
283
|
+
e.preventDefault();
|
|
284
|
+
onClear();
|
|
285
|
+
}
|
|
153
286
|
}
|
|
154
287
|
}
|
|
155
288
|
function onFocus(e) {
|
|
156
289
|
focused.value = true;
|
|
157
290
|
emit("focus", e);
|
|
291
|
+
if (hasDropdown.value) nextTick(syncOpen);
|
|
158
292
|
}
|
|
159
293
|
function onBlur(e) {
|
|
160
294
|
focused.value = false;
|
|
@@ -237,14 +371,18 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
237
371
|
for: unref(fieldId),
|
|
238
372
|
class: "text-caption font-medium text-foreground"
|
|
239
373
|
}, [createTextVNode(toDisplayString(__props.label) + " ", 1), __props.required ? (openBlock(), createElementBlock("span", _hoisted_2, "*")) : createCommentVNode("", true)], 8, _hoisted_1)) : createCommentVNode("", true),
|
|
240
|
-
createElementVNode("div", {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
374
|
+
createElementVNode("div", {
|
|
375
|
+
ref_key: "wrapperEl",
|
|
376
|
+
ref: wrapperEl,
|
|
377
|
+
class: normalizeClass([
|
|
378
|
+
"modo-field-wrapper flex items-center gap-2",
|
|
379
|
+
unref(wrapperVariantClasses),
|
|
380
|
+
wrapperSizeClasses.value,
|
|
381
|
+
unref(radiusClasses),
|
|
382
|
+
__props.fullWidth ? "w-full" : "",
|
|
383
|
+
isDisabled.value ? "opacity-60 cursor-not-allowed" : ""
|
|
384
|
+
])
|
|
385
|
+
}, [
|
|
248
386
|
createVNode(unref(MagnifyingGlassIcon), {
|
|
249
387
|
"aria-hidden": "true",
|
|
250
388
|
class: normalizeClass([
|
|
@@ -260,7 +398,7 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
260
398
|
type: "search",
|
|
261
399
|
value: __props.modelValue ?? "",
|
|
262
400
|
placeholder: __props.placeholder,
|
|
263
|
-
disabled:
|
|
401
|
+
disabled: isDisabled.value,
|
|
264
402
|
readonly: __props.readonly,
|
|
265
403
|
required: __props.required,
|
|
266
404
|
name: __props.name,
|
|
@@ -273,6 +411,9 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
273
411
|
"aria-invalid": unref(hasError) || void 0,
|
|
274
412
|
"aria-describedby": unref(describedBy),
|
|
275
413
|
"aria-required": __props.required || void 0,
|
|
414
|
+
"aria-expanded": hasDropdown.value ? unref(isOpen) : void 0,
|
|
415
|
+
"aria-controls": hasDropdown.value && unref(isOpen) ? `${unref(fieldId)}-results` : void 0,
|
|
416
|
+
"aria-activedescendant": unref(isOpen) && highlightedIdx.value >= 0 ? `${unref(fieldId)}-opt-${highlightedIdx.value}` : void 0,
|
|
276
417
|
class: normalizeClass([
|
|
277
418
|
"modo-field-native flex-1 min-w-0 bg-transparent p-0",
|
|
278
419
|
"text-foreground placeholder:text-muted-foreground",
|
|
@@ -288,7 +429,7 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
288
429
|
key: 0,
|
|
289
430
|
size: __props.size === "large" ? "medium" : "small",
|
|
290
431
|
class: normalizeClass(["shrink-0", affordanceIconClass.value])
|
|
291
|
-
}, null, 8, ["size", "class"])) : unref(hasValue) && !
|
|
432
|
+
}, null, 8, ["size", "class"])) : unref(hasValue) && !isDisabled.value && !__props.readonly ? (openBlock(), createBlock(Button_default, {
|
|
292
433
|
key: 1,
|
|
293
434
|
variant: "text",
|
|
294
435
|
size: "xs",
|
|
@@ -302,9 +443,75 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
302
443
|
"icon",
|
|
303
444
|
"ariaLabel",
|
|
304
445
|
"class"
|
|
305
|
-
])) : __props.shortcut
|
|
446
|
+
])) : __props.shortcut ? (openBlock(), createElementBlock("kbd", _hoisted_4, toDisplayString(shortcutLabel.value), 1)) : createCommentVNode("", true)
|
|
306
447
|
], 2),
|
|
307
|
-
|
|
448
|
+
hasDropdown.value ? (openBlock(), createBlock(PopoverPanel_default, {
|
|
449
|
+
key: 1,
|
|
450
|
+
open: unref(isOpen),
|
|
451
|
+
style: normalizeStyle(unref(panelStyle)),
|
|
452
|
+
radius: unref(resolvedRadius),
|
|
453
|
+
role: "presentation",
|
|
454
|
+
"onUpdate:panelRef": _cache[1] || (_cache[1] = ($event) => panelRef.value = $event)
|
|
455
|
+
}, {
|
|
456
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
457
|
+
class: "modo-search-results",
|
|
458
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
|
|
459
|
+
}, [renderSlot(_ctx.$slots, "results", {
|
|
460
|
+
items: resultItems.value,
|
|
461
|
+
query: String(__props.modelValue ?? ""),
|
|
462
|
+
highlighted: highlightedIdx.value,
|
|
463
|
+
select: selectResult,
|
|
464
|
+
close: unref(closePopover)
|
|
465
|
+
}, () => [__props.loading && !resultItems.value.length ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "loading", {}, () => [createVNode(Loader_default, { size: "small" })])])) : !resultItems.value.length ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText), 1)])])) : (openBlock(), createElementBlock("ul", {
|
|
466
|
+
key: 2,
|
|
467
|
+
id: `${unref(fieldId)}-results`,
|
|
468
|
+
role: "listbox",
|
|
469
|
+
"aria-busy": __props.loading || void 0,
|
|
470
|
+
class: "flex flex-col"
|
|
471
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(renderRows.value, (row) => {
|
|
472
|
+
return openBlock(), createElementBlock(Fragment, { key: row.key }, [row.kind === "header" ? (openBlock(), createElementBlock("li", _hoisted_8, toDisplayString(row.label), 1)) : (openBlock(), createElementBlock("li", {
|
|
473
|
+
key: 1,
|
|
474
|
+
id: `${unref(fieldId)}-opt-${row.index}`,
|
|
475
|
+
role: "option",
|
|
476
|
+
"aria-selected": row.index === highlightedIdx.value,
|
|
477
|
+
"aria-disabled": row.item.disabled || void 0
|
|
478
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(row.item.href && !row.item.disabled ? "a" : "div"), {
|
|
479
|
+
href: row.item.href && !row.item.disabled ? row.item.href : void 0,
|
|
480
|
+
target: row.item.external ? "_blank" : void 0,
|
|
481
|
+
rel: row.item.external ? "noopener noreferrer" : void 0,
|
|
482
|
+
class: normalizeClass(["flex items-center gap-2.5 px-3 py-2 text-body transition-colors duration-fast ease-standard", [row.item.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", row.index === highlightedIdx.value && !row.item.disabled ? "bg-accent" : ""]]),
|
|
483
|
+
onMouseenter: ($event) => row.item.disabled ? null : highlightedIdx.value = row.index,
|
|
484
|
+
onClick: ($event) => selectResult(row.item)
|
|
485
|
+
}, {
|
|
486
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "item", {
|
|
487
|
+
item: row.item,
|
|
488
|
+
active: row.index === highlightedIdx.value
|
|
489
|
+
}, () => [
|
|
490
|
+
row.item.icon ? (openBlock(), createBlock(resolveDynamicComponent(row.item.icon), {
|
|
491
|
+
key: 0,
|
|
492
|
+
class: "size-4 shrink-0 text-muted-foreground",
|
|
493
|
+
"aria-hidden": "true"
|
|
494
|
+
})) : createCommentVNode("", true),
|
|
495
|
+
createElementVNode("span", _hoisted_10, [createElementVNode("span", _hoisted_11, toDisplayString(row.item.label), 1), row.item.description ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(row.item.description), 1)) : createCommentVNode("", true)]),
|
|
496
|
+
row.item.shortcut ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(row.item.shortcut), 1)) : createCommentVNode("", true)
|
|
497
|
+
])]),
|
|
498
|
+
_: 2
|
|
499
|
+
}, 1064, [
|
|
500
|
+
"href",
|
|
501
|
+
"target",
|
|
502
|
+
"rel",
|
|
503
|
+
"class",
|
|
504
|
+
"onMouseenter",
|
|
505
|
+
"onClick"
|
|
506
|
+
]))], 8, _hoisted_9))], 64);
|
|
507
|
+
}), 128))], 8, _hoisted_7))])], 32)]),
|
|
508
|
+
_: 3
|
|
509
|
+
}, 8, [
|
|
510
|
+
"open",
|
|
511
|
+
"style",
|
|
512
|
+
"radius"
|
|
513
|
+
])) : createCommentVNode("", true),
|
|
514
|
+
__props.errorText || __props.helperText || unref(showCounterEffective) ? (openBlock(), createElementBlock("div", _hoisted_14, [__props.errorText ? (openBlock(), createBlock(Typography_default, {
|
|
308
515
|
key: 0,
|
|
309
516
|
id: unref(errorId),
|
|
310
517
|
variant: "caption",
|
|
@@ -324,11 +531,11 @@ var SearchInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
324
531
|
}, {
|
|
325
532
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.helperText), 1)]),
|
|
326
533
|
_: 1
|
|
327
|
-
}, 8, ["id"])) : (openBlock(), createElementBlock("span",
|
|
534
|
+
}, 8, ["id"])) : (openBlock(), createElementBlock("span", _hoisted_15)), unref(showCounterEffective) ? (openBlock(), createElementBlock("span", {
|
|
328
535
|
key: 3,
|
|
329
536
|
id: unref(counterId),
|
|
330
537
|
class: normalizeClass(["text-caption shrink-0 tabular-nums", unref(counterOverflow) ? "text-destructive" : "text-muted-foreground"])
|
|
331
|
-
}, toDisplayString(unref(currentLength)) + "/" + toDisplayString(__props.maxLength), 11,
|
|
538
|
+
}, toDisplayString(unref(currentLength)) + "/" + toDisplayString(__props.maxLength), 11, _hoisted_16)) : createCommentVNode("", true)])) : createCommentVNode("", true)
|
|
332
539
|
], 2);
|
|
333
540
|
};
|
|
334
541
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/SearchInput.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div \n :class=\"[ \n 'modo-field-wrapper flex items-center gap-2', \n wrapperVariantClasses, \n wrapperSizeClasses, \n radiusClasses, \n fullWidth ? 'w-full' : '', \n isDisabled ? 'opacity-60 cursor-not-allowed' : '', \n ]\" \n > \n <MagnifyingGlassIcon \n aria-hidden=\"true\" \n :class=\"['shrink-0', affordanceIconClass, iconSizeClasses]\" \n /> \n \n <input \n :id=\"fieldId\" \n ref=\"inputRef\" \n type=\"search\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :maxlength=\"maxLength\" \n :autofocus=\"autofocus\" \n autocomplete=\"off\" \n spellcheck=\"false\" \n role=\"searchbox\" \n :aria-label=\"!label ? ariaLabel : undefined\" \n :aria-invalid=\"hasError || undefined\" \n :aria-describedby=\"describedBy\" \n :aria-required=\"required || undefined\" \n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n inputTextClasses, \n ]\" \n @input=\"onInput\" \n @keydown=\"onKeydown\" \n @focus=\"onFocus\" \n @blur=\"onBlur\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n :class=\"['shrink-0', affordanceIconClass]\" \n /> \n \n <Button \n v-else-if=\"hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.searchInput.clear\" \n tabindex=\"-1\" \n :class=\"['shrink-0', affordanceActionClass]\" \n @click=\"onClear\" \n /> \n \n <kbd \n v-else-if=\"shortcut && !focused\" \n aria-hidden=\"true\" \n :class=\"[ \n 'shrink-0 select-none rounded-md px-1.5 py-0.5', \n 'text-[11px] leading-none font-sans font-medium tabular-nums', \n 'bg-muted text-muted-foreground border border-border', \n ]\" \n > \n {{ shortcutLabel }} \n </kbd> \n </div> \n \n <div \n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, onBeforeUnmount, onMounted, ref } from 'vue'; \nimport type { SearchInput } from '../../interfaces/forms/SearchInput.interface'; \nimport {\n useFieldState,\n useFieldClasses,\n FIELD_AFFORDANCE_ACTION_BY_COLOR,\n FIELD_AFFORDANCE_ICON_BY_COLOR,\n} from '../../composables/useField'; \nimport Loader from '../feedback/Loader.vue'; \nimport Button from './Button.vue'; \nimport { MagnifyingGlassIcon, XMarkIcon } from '@heroicons/vue/24/outline'; \nimport Typography from '../data-display/Typography.vue'; \nimport { useModoLocale, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n \nconst loc = useModoLocale(); \n \nconst emit = defineEmits<{ \n 'update:modelValue': [value: string]; \n change: [value: string]; \n focus: [event: FocusEvent]; \n blur: [event: FocusEvent]; \n clear: []; \n /** Se emite al presionar Enter o tras el debounce. */ \n search: [value: string]; \n}>(); \n \nconst props = withDefaults(defineProps<SearchInput>(), { \n variant: 'outline', \n color: 'default', \n disabled: false, \n readonly: false, \n required: false, \n loading: false, \n fullWidth: false, \n showCounter: false, \n autofocus: false, \n debounce: 0, \n placeholder: 'Search…', \n}); \n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst inputRef = ref<HTMLInputElement | null>(null); \nconst focused = ref(false); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n isDisabled, \n currentLength, \n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'SearchInput', idPrefix: 'modo-search' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n halo: () => props.halo, \n}); \n\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground');\nconst affordanceActionClass = computed(() => FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ?? 'text-muted-foreground hover:text-foreground');\n \n/* ---------- Debounce ---------- */ \nlet debounceTimer: number | null = null; \nfunction scheduleSearch(value: string) { \n if (!props.debounce || props.debounce <= 0) return; \n if (debounceTimer !== null) clearTimeout(debounceTimer); \n debounceTimer = window.setTimeout(() => { \n emit('search', value); \n debounceTimer = null; \n }, props.debounce); \n} \nfunction cancelDebounce() { \n if (debounceTimer !== null) { \n clearTimeout(debounceTimer); \n debounceTimer = null; \n } \n} \n \n/* ---------- Events ---------- */ \nfunction onInput(e: Event) { \n const target = e.target as HTMLInputElement; \n emit('update:modelValue', target.value); \n scheduleSearch(target.value); \n} \n \nfunction onKeydown(e: KeyboardEvent) { \n if (e.key === 'Enter') { \n e.preventDefault(); \n cancelDebounce(); \n emit('search', String(props.modelValue ?? '')); \n } else if (e.key === 'Escape' && hasValue.value) { \n e.preventDefault(); \n onClear(); \n } \n} \n \nfunction onFocus(e: FocusEvent) { \n focused.value = true; \n emit('focus', e); \n} \n \nfunction onBlur(e: FocusEvent) { \n focused.value = false; \n emit('blur', e); \n} \n \nfunction onClear() { \n cancelDebounce(); \n emit('update:modelValue', ''); \n emit('clear'); \n emit('search', ''); \n inputRef.value?.focus(); \n} \n \n/* ---------- Shortcut ---------- */\n// Stays `false` on SSR and on the first client paint to keep them\n// identical, then flips to the real platform value in onMounted. Without\n// this guard the server would render `Ctrl+K` and the client would\n// immediately replace it with `⌘K`, triggering a hydration warning.\nconst isMac = ref(false);\nonMounted(() => {\n isMac.value = /Mac|iPod|iPhone|iPad/.test(navigator.platform);\n});\n \ninterface ParsedShortcut { \n key: string; \n ctrl: boolean; \n meta: boolean; \n shift: boolean; \n alt: boolean; \n} \n \nconst parsedShortcut = computed<ParsedShortcut | null>(() => { \n if (!props.shortcut) return null; \n const parts = props.shortcut.toLowerCase().split('+').map((p) => p.trim()); \n const result: ParsedShortcut = { key: '', ctrl: false, meta: false, shift: false, alt: false }; \n for (const part of parts) { \n if (part === 'cmd' || part === 'meta' || part === 'command') { \n if (isMac.value) result.meta = true; \n else result.ctrl = true; \n } else if (part === 'ctrl' || part === 'control') { \n result.ctrl = true; \n } else if (part === 'shift') { \n result.shift = true; \n } else if (part === 'alt' || part === 'option') { \n result.alt = true; \n } else { \n result.key = part; \n } \n } \n return result.key ? result : null; \n}); \n \nconst shortcutLabel = computed(() => { \n const s = parsedShortcut.value; \n if (!s) return ''; \n const segs: string[] = []; \n if (s.meta) segs.push(isMac.value ? '⌘' : 'Ctrl');\n else if (s.ctrl) segs.push(isMac.value ? '⌃' : 'Ctrl');\n if (s.alt) segs.push(isMac.value ? '⌥' : 'Alt');\n if (s.shift) segs.push(isMac.value ? '⇧' : 'Shift');\n segs.push(s.key.length === 1 ? s.key.toUpperCase() : s.key); \n return segs.join(isMac.value ? '' : '+'); \n}); \n \nfunction onGlobalKeydown(e: KeyboardEvent) { \n const s = parsedShortcut.value; \n if (!s) return; \n \n // No robar atajos mientras el usuario escribe en otro campo (a menos que sea una combinación con modificador). \n const target = e.target as HTMLElement | null; \n const typingElsewhere = !!target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable); \n const hasModifier = s.meta || s.ctrl || s.alt; \n if (typingElsewhere && !hasModifier && target !== inputRef.value) return; \n \n if ( \n e.key.toLowerCase() === s.key && \n e.metaKey === s.meta && \n e.ctrlKey === s.ctrl && \n e.shiftKey === s.shift && \n e.altKey === s.alt \n ) { \n e.preventDefault(); \n inputRef.value?.focus(); \n inputRef.value?.select(); \n } \n} \n \nonMounted(() => { \n if (parsedShortcut.value) { \n window.addEventListener('keydown', onGlobalKeydown); \n } \n}); \n \nonBeforeUnmount(() => { \n cancelDebounce(); \n window.removeEventListener('keydown', onGlobalKeydown); \n}); \n \n/* ---------- Classes ---------- */ \n \nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\n\nconst inputTextClasses = computed(() => sz.value.text);\n\nconst iconSizeClasses = computed(() => sz.value.icon); \n \ndefineExpose({ \n focus: () => inputRef.value?.focus(), \n blur: () => inputRef.value?.blur(), \n select: () => inputRef.value?.select(), \n clear: onClear, \n inputRef, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+IA,MAAM,MAAM,eAAe;EAE3B,MAAM,OAAO;EAUb,MAAM,QAAQ;EAcO,sBAAsB,MAAM,KAAK;EACtD,MAAM,KAAK,oBAAoB,MAAM,KAAK;EAE1C,MAAM,WAAW,IAA6B,KAAK;EACnD,MAAM,UAAU,IAAI,MAAM;EAE1B,MAAM,EACF,SACA,QACA,YACA,UACA,UACA,YACA,eACA,sBACA,iBACA,SACA,UACA,WACA,gBACA,cAAc,OAAO;GAAE,eAAe;GAAe,UAAU;GAAe,CAAC;EAEnF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ADV,YASa,oBAAA;;KAPR,IAAI,MAAA,QAAO;KACZ,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;4BAEY,CAAA,gBAAA,gBAAZ,QAAA,UAAS,EAAA,EAAA,CAAA,CAAA;;qBAGD,QAAA,cAAA,WAAA,EADf,YASa,oBAAA;;KAPR,IAAI,MAAA,SAAQ;KACb,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;;4BAEa,CAAA,gBAAA,gBAAb,QAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;mCAEjB,mBAA8B,QAA9B,WAA8B,GAGpB,MAAA,qBAAoB,IAAA,WAAA,EAD9B,mBASO,QAAA;;KAPF,IAAI,MAAA,UAAS;KACb,OAAK,eAAA,CAAA,sCAAoF,MAAA,gBAAe,GAAA,qBAAA,wBAAA,CAAA;uBAKtG,MAAA,cAAa,CAAA,GAAG,MAAC,gBAAG,QAAA,UAAS,EAAA,IAAA,WAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"SearchInput.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/SearchInput.vue"],"sourcesContent":["<template> \n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\"> \n <label \n v-if=\"label\" \n :for=\"fieldId\" \n class=\"text-caption font-medium text-foreground\" \n > \n {{ label }} \n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\">*</span> \n </label> \n \n <div\n ref=\"wrapperEl\"\n :class=\"[\n 'modo-field-wrapper flex items-center gap-2',\n wrapperVariantClasses,\n wrapperSizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n >\n <MagnifyingGlassIcon \n aria-hidden=\"true\" \n :class=\"['shrink-0', affordanceIconClass, iconSizeClasses]\" \n /> \n \n <input \n :id=\"fieldId\" \n ref=\"inputRef\" \n type=\"search\" \n :value=\"modelValue ?? ''\" \n :placeholder=\"placeholder\" \n :disabled=\"isDisabled\" \n :readonly=\"readonly\" \n :required=\"required\" \n :name=\"name\" \n :maxlength=\"maxLength\" \n :autofocus=\"autofocus\" \n autocomplete=\"off\" \n spellcheck=\"false\" \n role=\"searchbox\"\n :aria-label=\"!label ? ariaLabel : undefined\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :aria-required=\"required || undefined\"\n :aria-expanded=\"hasDropdown ? isOpen : undefined\"\n :aria-controls=\"hasDropdown && isOpen ? `${fieldId}-results` : undefined\"\n :aria-activedescendant=\"isOpen && highlightedIdx >= 0 ? `${fieldId}-opt-${highlightedIdx}` : undefined\"\n :class=\"[ \n 'modo-field-native flex-1 min-w-0 bg-transparent p-0', \n 'text-foreground placeholder:text-muted-foreground', \n 'disabled:cursor-not-allowed', \n inputTextClasses, \n ]\" \n @input=\"onInput\" \n @keydown=\"onKeydown\" \n @focus=\"onFocus\" \n @blur=\"onBlur\" \n /> \n \n <Loader \n v-if=\"loading\" \n :size=\"size === 'large' ? 'medium' : 'small'\" \n :class=\"['shrink-0', affordanceIconClass]\" \n /> \n \n <Button \n v-else-if=\"hasValue && !isDisabled && !readonly\" \n variant=\"text\" \n size=\"xs\" \n radius=\"full\" \n :icon=\"XMarkIcon\" \n :ariaLabel=\"loc.searchInput.clear\" \n tabindex=\"-1\" \n :class=\"['shrink-0', affordanceActionClass]\" \n @click=\"onClear\" \n /> \n \n <!-- The shortcut hint stays while the field is empty (focused or not)\n so focusing never removes it and reflows the width. It yields to\n the clear button as soon as there is a value. -->\n <kbd\n v-else-if=\"shortcut\"\n aria-hidden=\"true\"\n :class=\"[ \n 'shrink-0 select-none rounded-md px-1.5 py-0.5', \n 'text-[11px] leading-none font-sans font-medium tabular-nums', \n 'bg-muted text-muted-foreground border border-border', \n ]\" \n > \n {{ shortcutLabel }}\n </kbd>\n </div>\n\n <!-- RESULTS DROPDOWN -->\n <PopoverPanel\n v-if=\"hasDropdown\"\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"resolvedRadius\"\n role=\"presentation\"\n @update:panelRef=\"panelRef = $event\"\n >\n <!-- mousedown.prevent keeps focus in the input while clicking a row -->\n <div class=\"modo-search-results\" @mousedown.prevent>\n <slot\n name=\"results\"\n :items=\"resultItems\"\n :query=\"String(modelValue ?? '')\"\n :highlighted=\"highlightedIdx\"\n :select=\"selectResult\"\n :close=\"closePopover\"\n >\n <!--\n The panel loader only takes over when there is nothing\n to show yet. Swapping a populated list for a spinner on\n every keystroke makes the dropdown collapse and reopen\n as the user types; the affordance spinner in the field\n already signals the in-flight request.\n -->\n <div v-if=\"loading && !resultItems.length\" class=\"px-3 py-6 flex items-center justify-center\">\n <slot name=\"loading\"><Loader size=\"small\" /></slot>\n </div>\n <div\n v-else-if=\"!resultItems.length\"\n class=\"px-3 py-6 text-center text-muted-foreground text-body\"\n >\n <slot name=\"empty\">{{ emptyText }}</slot>\n </div>\n <ul\n v-else\n :id=\"`${fieldId}-results`\"\n role=\"listbox\"\n :aria-busy=\"loading || undefined\"\n class=\"flex flex-col\"\n >\n <template v-for=\"row in renderRows\" :key=\"row.key\">\n <li\n v-if=\"row.kind === 'header'\"\n role=\"presentation\"\n class=\"px-3 pt-2 pb-1 text-caption font-medium text-muted-foreground select-none\"\n >\n {{ row.label }}\n </li>\n <li\n v-else\n :id=\"`${fieldId}-opt-${row.index}`\"\n role=\"option\"\n :aria-selected=\"row.index === highlightedIdx\"\n :aria-disabled=\"row.item.disabled || undefined\"\n >\n <component\n :is=\"row.item.href && !row.item.disabled ? 'a' : 'div'\"\n :href=\"row.item.href && !row.item.disabled ? row.item.href : undefined\"\n :target=\"row.item.external ? '_blank' : undefined\"\n :rel=\"row.item.external ? 'noopener noreferrer' : undefined\"\n class=\"flex items-center gap-2.5 px-3 py-2 text-body transition-colors duration-fast ease-standard\"\n :class=\"[\n row.item.disabled\n ? 'opacity-50 cursor-not-allowed'\n : 'cursor-pointer',\n row.index === highlightedIdx && !row.item.disabled ? 'bg-accent' : '',\n ]\"\n @mouseenter=\"row.item.disabled ? null : (highlightedIdx = row.index)\"\n @click=\"selectResult(row.item)\"\n >\n <slot name=\"item\" :item=\"row.item\" :active=\"row.index === highlightedIdx\">\n <component\n :is=\"row.item.icon\"\n v-if=\"row.item.icon\"\n class=\"size-4 shrink-0 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"truncate\">{{ row.item.label }}</span>\n <span\n v-if=\"row.item.description\"\n class=\"text-caption text-muted-foreground truncate\"\n >{{ row.item.description }}</span>\n </span>\n <span\n v-if=\"row.item.shortcut\"\n class=\"ml-2 text-caption text-muted-foreground tabular-nums shrink-0\"\n aria-hidden=\"true\"\n >{{ row.item.shortcut }}</span>\n </slot>\n </component>\n </li>\n </template>\n </ul>\n </slot>\n </div>\n </PopoverPanel>\n\n <div\n v-if=\"errorText || helperText || showCounterEffective\" \n class=\"flex items-start justify-between gap-2\" \n > \n <Typography \n v-if=\"errorText\" \n :id=\"errorId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"danger\" \n as=\"p\" \n > \n {{ errorText }} \n </Typography> \n <Typography \n v-else-if=\"helperText\" \n :id=\"helperId\" \n variant=\"caption\" \n size=\"medium\" \n color=\"muted\" \n as=\"p\" \n > \n {{ helperText }} \n </Typography> \n <span v-else class=\"flex-1\" /> \n \n <span \n v-if=\"showCounterEffective\" \n :id=\"counterId\" \n :class=\"[ \n 'text-caption shrink-0 tabular-nums', \n counterOverflow ? 'text-destructive' : 'text-muted-foreground', \n ]\" \n > \n {{ currentLength }}/{{ maxLength }} \n </span> \n </div> \n </div> \n</template> \n \n<script setup lang=\"ts\"> \nimport { computed, onBeforeUnmount, onMounted, ref, useSlots, watch, nextTick } from 'vue';\nimport type { SearchInput, SearchResultItem } from '../../interfaces/forms/SearchInput.interface';\nimport {\n useFieldState,\n useFieldClasses,\n FIELD_AFFORDANCE_ACTION_BY_COLOR,\n FIELD_AFFORDANCE_ICON_BY_COLOR,\n} from '../../composables/useField';\nimport Loader from '../feedback/Loader.vue';\nimport Button from './Button.vue';\nimport PopoverPanel from '../layout/PopoverPanel.vue';\nimport { usePopover } from '../../composables/usePopover';\nimport { MagnifyingGlassIcon, XMarkIcon } from '@heroicons/vue/24/outline';\nimport Typography from '../data-display/Typography.vue';\nimport { useModoLocale, useResolvedRadius, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n\nconst loc = useModoLocale();\nconst slots = useSlots();\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string];\n change: [value: string];\n focus: [event: FocusEvent];\n blur: [event: FocusEvent];\n clear: [];\n /** Se emite al presionar Enter o tras el debounce. */\n search: [value: string];\n /** A result row was chosen (click / Enter on the highlighted row). */\n select: [item: SearchResultItem];\n /** Results popover open state (for `v-model:open`). */\n 'update:open': [value: boolean];\n}>();\n\nconst props = withDefaults(defineProps<SearchInput>(), {\n variant: 'outline',\n color: 'default',\n disabled: false,\n readonly: false,\n required: false,\n loading: false,\n fullWidth: false,\n showCounter: false,\n autofocus: false,\n debounce: 0,\n placeholder: 'Search…',\n resultsPlacement: 'bottom-start',\n});\n \nconst resolvedSize = useResolvedSize(() => props.size);\nconst sz = useSizeTokens(() => props.size);\n\nconst inputRef = ref<HTMLInputElement | null>(null); \nconst focused = ref(false); \n \nconst { \n fieldId, \n radius, \n stateColor, \n hasError, \n hasValue, \n currentLength,\n showCounterEffective, \n counterOverflow, \n errorId, \n helperId, \n counterId, \n describedBy, \n} = useFieldState(props, { componentName: 'SearchInput', idPrefix: 'modo-search' }); \n \nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({ \n variant: () => props.variant, \n stateColor, \n hasError, \n radius, \n halo: () => props.halo, \n}); \n\n// Deliberately NOT `useFieldState`'s `isDisabled`, which also reports true\n// while `loading`. That is right for a field being submitted, but fatal for a\n// search box: the results are what load, not the input. Disabling it mid-query\n// makes the browser blur the element the user is typing in — focus is lost, the\n// results popover closes, and the next keystroke is dropped. For SearchInput,\n// only an explicit `disabled` disables.\nconst isDisabled = computed(() => !!props.disabled);\n\nconst affordanceIconClass = computed(() => FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? 'text-muted-foreground');\nconst affordanceActionClass = computed(() => FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ?? 'text-muted-foreground hover:text-foreground');\n\n/* ---------- Results dropdown ---------- */\nconst resolvedRadius = useResolvedRadius(() => props.radius);\n\n// The dropdown is active when the host passes `items` (even empty) or a custom\n// `#results` slot. Filtering/async stays with the host — this only renders.\nconst hasDropdown = computed(() => props.items !== undefined || !!slots.results);\nconst resultItems = computed<SearchResultItem[]>(() => props.items ?? []);\n\nconst highlightedIdx = ref(-1);\nconst {\n triggerRef: popoverTrigger,\n panelRef,\n isOpen,\n panelStyle,\n open: openPopover,\n close: closePopover,\n} = usePopover({\n placement: () => props.resultsPlacement,\n matchTriggerWidth: true,\n closeOnEscape: false, // handled on the input so focus stays in the field\n closeOnScroll: false, // reposition on scroll; focusing the input can auto-scroll it into view\n onOpen: () => emit('update:open', true),\n onClose: () => { emit('update:open', false); highlightedIdx.value = -1; },\n});\n\nconst wrapperEl = ref<HTMLElement | null>(null);\nwatch(wrapperEl, (el) => { popoverTrigger.value = el; });\n\n// Flat render list with a group header inserted whenever `group` changes.\ntype RenderRow =\n | { kind: 'header'; label: string; key: string }\n | { kind: 'option'; item: SearchResultItem; index: number; key: string };\nconst renderRows = computed<RenderRow[]>(() => {\n const rows: RenderRow[] = [];\n let prevGroup: string | undefined;\n resultItems.value.forEach((item, index) => {\n if (item.group && item.group !== prevGroup) {\n rows.push({ kind: 'header', label: item.group, key: `h-${index}` });\n prevGroup = item.group;\n }\n rows.push({ kind: 'option', item, index, key: `o-${item.id ?? index}` });\n });\n return rows;\n});\n\nconst enabledIndices = computed(() =>\n resultItems.value.map((it, i) => (it.disabled ? -1 : i)).filter((i) => i !== -1),\n);\n\n// Show the popover only while focused and there is something to render.\nconst shouldShowResults = computed(() =>\n hasDropdown.value && focused.value &&\n (resultItems.value.length > 0 || props.loading || !!props.emptyText || !!slots.empty),\n);\n\nfunction syncOpen() {\n if (shouldShowResults.value) { if (!isOpen.value) openPopover(); }\n else if (isOpen.value) closePopover();\n}\nwatch(shouldShowResults, syncOpen);\nwatch(() => resultItems.value.length, () => { if (isOpen.value || shouldShowResults.value) nextTick(syncOpen); });\n\n// Optional external control via `v-model:open`.\nwatch(() => props.open, (v) => {\n if (v === undefined) return;\n if (v && shouldShowResults.value) openPopover();\n else if (!v) closePopover();\n});\n\nfunction moveHighlight(delta: 1 | -1) {\n const order = enabledIndices.value;\n if (!order.length) return;\n const cur = order.indexOf(highlightedIdx.value);\n highlightedIdx.value = cur === -1\n ? (delta > 0 ? order[0] : order[order.length - 1])\n : order[(cur + delta + order.length) % order.length];\n}\n\nfunction selectResult(item: SearchResultItem) {\n if (item.disabled) return;\n emit('select', item);\n closePopover();\n}\n\n/* ---------- Debounce ---------- */\nlet debounceTimer: number | null = null; \nfunction scheduleSearch(value: string) { \n if (!props.debounce || props.debounce <= 0) return; \n if (debounceTimer !== null) clearTimeout(debounceTimer); \n debounceTimer = window.setTimeout(() => { \n emit('search', value); \n debounceTimer = null; \n }, props.debounce); \n} \nfunction cancelDebounce() { \n if (debounceTimer !== null) { \n clearTimeout(debounceTimer); \n debounceTimer = null; \n } \n} \n \n/* ---------- Events ---------- */ \nfunction onInput(e: Event) { \n const target = e.target as HTMLInputElement; \n emit('update:modelValue', target.value); \n scheduleSearch(target.value); \n} \n \nfunction onKeydown(e: KeyboardEvent) {\n // Arrow keys drive the results dropdown when it is available.\n if (hasDropdown.value && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {\n e.preventDefault();\n if (!isOpen.value && shouldShowResults.value) openPopover();\n moveHighlight(e.key === 'ArrowDown' ? 1 : -1);\n return;\n }\n if (e.key === 'Enter') {\n // Enter picks the highlighted result if the dropdown is open; otherwise\n // it keeps the existing \"submit search\" behaviour.\n if (isOpen.value && highlightedIdx.value >= 0) {\n const item = resultItems.value[highlightedIdx.value];\n if (item && !item.disabled) {\n e.preventDefault();\n selectResult(item);\n return;\n }\n }\n e.preventDefault();\n cancelDebounce();\n emit('search', String(props.modelValue ?? ''));\n return;\n }\n if (e.key === 'Escape') {\n // First Escape closes the dropdown; a second (or when closed) clears.\n if (isOpen.value) {\n e.preventDefault();\n closePopover();\n return;\n }\n if (hasValue.value) {\n e.preventDefault();\n onClear();\n }\n }\n}\n \nfunction onFocus(e: FocusEvent) {\n focused.value = true;\n emit('focus', e);\n // Open the results popover on focus if there is anything to show. Done\n // explicitly (not only via the watcher) so it fires on the very first focus.\n if (hasDropdown.value) nextTick(syncOpen);\n}\n \nfunction onBlur(e: FocusEvent) {\n focused.value = false;\n emit('blur', e);\n}\n \nfunction onClear() { \n cancelDebounce(); \n emit('update:modelValue', ''); \n emit('clear'); \n emit('search', ''); \n inputRef.value?.focus(); \n} \n \n/* ---------- Shortcut ---------- */\n// Stays `false` on SSR and on the first client paint to keep them\n// identical, then flips to the real platform value in onMounted. Without\n// this guard the server would render `Ctrl+K` and the client would\n// immediately replace it with `⌘K`, triggering a hydration warning.\nconst isMac = ref(false);\nonMounted(() => {\n isMac.value = /Mac|iPod|iPhone|iPad/.test(navigator.platform);\n});\n \ninterface ParsedShortcut { \n key: string; \n ctrl: boolean; \n meta: boolean; \n shift: boolean; \n alt: boolean; \n} \n \nconst parsedShortcut = computed<ParsedShortcut | null>(() => { \n if (!props.shortcut) return null; \n const parts = props.shortcut.toLowerCase().split('+').map((p) => p.trim()); \n const result: ParsedShortcut = { key: '', ctrl: false, meta: false, shift: false, alt: false }; \n for (const part of parts) { \n if (part === 'cmd' || part === 'meta' || part === 'command') { \n if (isMac.value) result.meta = true; \n else result.ctrl = true; \n } else if (part === 'ctrl' || part === 'control') { \n result.ctrl = true; \n } else if (part === 'shift') { \n result.shift = true; \n } else if (part === 'alt' || part === 'option') { \n result.alt = true; \n } else { \n result.key = part; \n } \n } \n return result.key ? result : null; \n}); \n \nconst shortcutLabel = computed(() => { \n const s = parsedShortcut.value; \n if (!s) return ''; \n const segs: string[] = []; \n if (s.meta) segs.push(isMac.value ? '⌘' : 'Ctrl');\n else if (s.ctrl) segs.push(isMac.value ? '⌃' : 'Ctrl');\n if (s.alt) segs.push(isMac.value ? '⌥' : 'Alt');\n if (s.shift) segs.push(isMac.value ? '⇧' : 'Shift');\n segs.push(s.key.length === 1 ? s.key.toUpperCase() : s.key); \n return segs.join(isMac.value ? '' : '+'); \n}); \n \nfunction onGlobalKeydown(e: KeyboardEvent) { \n const s = parsedShortcut.value; \n if (!s) return; \n \n // No robar atajos mientras el usuario escribe en otro campo (a menos que sea una combinación con modificador). \n const target = e.target as HTMLElement | null; \n const typingElsewhere = !!target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable); \n const hasModifier = s.meta || s.ctrl || s.alt; \n if (typingElsewhere && !hasModifier && target !== inputRef.value) return; \n \n if ( \n e.key.toLowerCase() === s.key && \n e.metaKey === s.meta && \n e.ctrlKey === s.ctrl && \n e.shiftKey === s.shift && \n e.altKey === s.alt \n ) { \n e.preventDefault(); \n inputRef.value?.focus(); \n inputRef.value?.select(); \n } \n} \n \nonMounted(() => { \n if (parsedShortcut.value) { \n window.addEventListener('keydown', onGlobalKeydown); \n } \n}); \n \nonBeforeUnmount(() => { \n cancelDebounce(); \n window.removeEventListener('keydown', onGlobalKeydown); \n}); \n \n/* ---------- Classes ---------- */ \n \nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\n\nconst inputTextClasses = computed(() => sz.value.text);\n\nconst iconSizeClasses = computed(() => sz.value.icon); \n \ndefineExpose({ \n focus: () => inputRef.value?.focus(), \n blur: () => inputRef.value?.blur(), \n select: () => inputRef.value?.select(), \n clear: onClear, \n inputRef, \n}); \n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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_lang = require("./Segmented.vue_vue_type_script_setup_true_lang.cjs");
|
|
3
3
|
;/* empty css */
|
|
4
4
|
//#region src/components/forms/Segmented.vue
|
|
5
|
-
var Segmented_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_Segmented_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
5
|
+
var Segmented_default = /* @__PURE__ */ require__plugin_vue_export_helper.default(require_Segmented_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-1a5790fe"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
exports.default = Segmented_default;
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Segmented.cjs","names":[],"sources":["../../../src/components/forms/Segmented.vue"],"sourcesContent":["<template>\n <div\n ref=\"trackEl\"\n role=\"radiogroup\"\n :aria-label=\"ariaLabel\"\n :aria-disabled=\"disabled || undefined\"\n :class=\"[\n 'relative inline-flex items-center p-1 bg-muted gap-0.5',\n radiusClasses,\n fullWidth ? 'w-full' : '',\n disabled ? 'opacity-60 pointer-events-none' : '',\n ]\"\n >\n <!-- Sliding indicator — same technique as Tabs -->\n <span\n ref=\"indicatorEl\"\n class=\"segmented-indicator absolute pointer-events-none\"\n :class=\"[innerRadiusClasses, 'bg-card shadow-sm']\"\n :style=\"indicatorStyle\"\n aria-hidden=\"true\"\n />\n\n <button\n v-for=\"(item, idx) in items\"\n :key=\"item.value\"\n :ref=\"(el: any) => setItemRef(el, idx)\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"isActive(item) ? 'true' : 'false'\"\n :aria-label=\"item.ariaLabel ?? item.label\"\n :aria-disabled=\"item.disabled || undefined\"\n :disabled=\"item.disabled || disabled\"\n :tabindex=\"isActive(item) ? 0 : -1\"\n :class=\"[\n 'relative z-10 inline-flex items-center justify-center gap-1.5 font-medium select-none whitespace-nowrap',\n 'transition-colors duration-150 ease-out',\n 'focus:outline-none focus-visible:ring-2 focus-visible:ring-
|
|
1
|
+
{"version":3,"file":"Segmented.cjs","names":[],"sources":["../../../src/components/forms/Segmented.vue"],"sourcesContent":["<template>\n <div\n ref=\"trackEl\"\n role=\"radiogroup\"\n :aria-label=\"ariaLabel\"\n :aria-disabled=\"disabled || undefined\"\n :class=\"[\n 'relative inline-flex items-center p-1 bg-muted gap-0.5',\n trackSizeClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n disabled ? 'opacity-60 pointer-events-none' : '',\n ]\"\n >\n <!-- Sliding indicator — same technique as Tabs -->\n <span\n ref=\"indicatorEl\"\n class=\"segmented-indicator absolute pointer-events-none\"\n :class=\"[innerRadiusClasses, 'bg-card shadow-sm']\"\n :style=\"indicatorStyle\"\n aria-hidden=\"true\"\n />\n\n <button\n v-for=\"(item, idx) in items\"\n :key=\"item.value\"\n :ref=\"(el: any) => setItemRef(el, idx)\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"isActive(item) ? 'true' : 'false'\"\n :aria-label=\"item.ariaLabel ?? item.label\"\n :aria-disabled=\"item.disabled || undefined\"\n :disabled=\"item.disabled || disabled\"\n :tabindex=\"isActive(item) ? 0 : -1\"\n :class=\"[\n 'relative z-10 inline-flex items-center justify-center gap-1.5 font-medium select-none whitespace-nowrap',\n 'transition-colors duration-150 ease-out',\n 'focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/60',\n sizeClasses,\n innerRadiusClasses,\n fullWidth ? 'flex-1' : '',\n item.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',\n isActive(item) ? activeTextClass : 'text-muted-foreground hover:text-foreground',\n ]\"\n @click=\"onSelect(item)\"\n @keydown=\"onKeydown($event, item)\"\n >\n <component :is=\"item.icon\" v-if=\"item.icon\" :class=\"iconSizeClasses\" aria-hidden=\"true\" />\n <span v-if=\"item.label\">{{ item.label }}</span>\n </button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport type { Segmented, SegmentedItem } from '../../interfaces/forms/Segmented.interface';\nimport { useResolvedColor, useResolvedRadius, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n\nconst props = withDefaults(defineProps<Segmented>(), {\n color: 'primary',\n fullWidth: false,\n disabled: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number];\n 'change': [value: string | number];\n}>();\n\nconst resolvedSize = useResolvedSize(() => props.size);\nconst resolvedRadius = useResolvedRadius(() => props.radius);\nconst resolvedColor = useResolvedColor(() => props.color);\nconst sz = useSizeTokens(() => props.size);\n\n// ── DOM refs ──────────────────────────────────────────────────────────────\nconst trackEl = ref<HTMLElement | null>(null);\nconst indicatorEl = ref<HTMLElement | null>(null);\nconst itemRefs = ref<(HTMLElement | null)[]>([]);\nfunction setItemRef(el: HTMLElement | null, idx: number) {\n itemRefs.value[idx] = el;\n}\n\n// ── Sliding indicator ─────────────────────────────────────────────────────\nconst indicatorStyle = ref<Record<string, string>>({\n transform: 'translate3d(0,0,0)',\n width: '0px',\n height: '0px',\n opacity: '0',\n});\nlet _firstMeasureDone = false;\n\nfunction measureIndicator(animated = true) {\n const idx = props.items.findIndex((i) => i.value === props.modelValue);\n const el = itemRefs.value[idx];\n if (!el) return;\n const w = el.offsetWidth;\n const h = el.offsetHeight;\n if (w === 0 && h === 0) return;\n\n const node = indicatorEl.value;\n if (!animated && node) {\n node.classList.add('segmented-indicator--no-anim');\n requestAnimationFrame(() => {\n requestAnimationFrame(() => node.classList.remove('segmented-indicator--no-anim'));\n });\n }\n\n indicatorStyle.value = {\n transform: `translate3d(${el.offsetLeft}px, ${el.offsetTop}px, 0)`,\n width: `${w}px`,\n height: `${h}px`,\n top: '0',\n opacity: '1',\n };\n _firstMeasureDone = true;\n}\n\nlet _ro: ResizeObserver | null = null;\nonMounted(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => measureIndicator(false));\n });\n if (typeof ResizeObserver !== 'undefined' && trackEl.value) {\n _ro = new ResizeObserver(() => measureIndicator(_firstMeasureDone));\n _ro.observe(trackEl.value);\n }\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', onWindowResize);\n }\n});\nonBeforeUnmount(() => {\n _ro?.disconnect();\n _ro = null;\n if (typeof window !== 'undefined') {\n window.removeEventListener('resize', onWindowResize);\n }\n});\nfunction onWindowResize() {\n measureIndicator(false);\n}\n\nwatch(\n () => [props.modelValue, resolvedSize.value, resolvedRadius.value, resolvedColor.value, props.fullWidth, props.items.length],\n () => nextTick(() => measureIndicator(_firstMeasureDone)),\n);\n\n// ── Selection & keyboard ──────────────────────────────────────────────────\nfunction isActive(item: SegmentedItem): boolean {\n return props.modelValue === item.value;\n}\n\nfunction onSelect(item: SegmentedItem) {\n if (item.disabled || props.disabled) return;\n if (isActive(item)) return;\n emit('update:modelValue', item.value);\n emit('change', item.value);\n}\n\nfunction onKeydown(e: KeyboardEvent, item: SegmentedItem) {\n if (props.disabled) return;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n e.preventDefault();\n moveFocus(item, 1);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n e.preventDefault();\n moveFocus(item, -1);\n } else if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n onSelect(item);\n }\n}\n\nfunction moveFocus(current: SegmentedItem, dir: 1 | -1) {\n const enabled = props.items.filter((i) => !i.disabled);\n if (enabled.length === 0) return;\n const idx = enabled.findIndex((i) => i.value === current.value);\n const next = enabled[(idx + dir + enabled.length) % enabled.length];\n if (next) {\n onSelect(next);\n nextTick(() => {\n const i = props.items.findIndex((it) => it.value === next.value);\n itemRefs.value[i]?.focus();\n });\n }\n}\n\n// ── Class maps ────────────────────────────────────────────────────────────\n// The OUTER track owns the control height; the segments fill the padded area\n// (`h-full`). This keeps a Segmented the exact same box height as a Button /\n// Input at the same size (previously it ran +8px taller because of the track\n// padding), so it lines up in a toolbar with no height override.\nconst trackSizeClass = computed(() => sz.value.control);\nconst sizeClasses = computed(() => `h-full ${sz.value.padX} ${sz.value.text}`);\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n\nconst radiusClasses = computed(() => {\n switch (resolvedRadius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded';\n case 'large': return 'rounded-xl';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-lg';\n }\n});\n\nconst innerRadiusClasses = computed(() => {\n switch (resolvedRadius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded-[3px]';\n case 'large': return 'rounded-lg';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-md';\n }\n});\n\n// Text color for active item — background comes from the indicator\nconst activeTextClass = computed(() => {\n switch (resolvedColor.value) {\n case 'primary': return 'text-primary font-medium';\n case 'danger': return 'text-destructive font-medium';\n case 'success': return 'text-success font-medium';\n case 'warning': return 'text-warning font-medium';\n case 'default':\n default: return 'text-foreground font-medium';\n }\n});\n\n</script>\n\n<style scoped>\n.segmented-indicator {\n top: 0;\n left: 0;\n will-change: transform, width;\n transition-property: transform, width, height, opacity;\n transition-duration: 280ms;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.segmented-indicator--no-anim {\n transition: none !important;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .segmented-indicator {\n transition: opacity 120ms linear !important;\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import Segmented_vue_vue_type_script_setup_true_lang_default from "./Segmented.vue_vue_type_script_setup_true_lang.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/forms/Segmented.vue
|
|
5
|
-
var Segmented_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Segmented_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var Segmented_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Segmented_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-1a5790fe"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Segmented_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Segmented.mjs","names":[],"sources":["../../../src/components/forms/Segmented.vue"],"sourcesContent":["<template>\n <div\n ref=\"trackEl\"\n role=\"radiogroup\"\n :aria-label=\"ariaLabel\"\n :aria-disabled=\"disabled || undefined\"\n :class=\"[\n 'relative inline-flex items-center p-1 bg-muted gap-0.5',\n radiusClasses,\n fullWidth ? 'w-full' : '',\n disabled ? 'opacity-60 pointer-events-none' : '',\n ]\"\n >\n <!-- Sliding indicator — same technique as Tabs -->\n <span\n ref=\"indicatorEl\"\n class=\"segmented-indicator absolute pointer-events-none\"\n :class=\"[innerRadiusClasses, 'bg-card shadow-sm']\"\n :style=\"indicatorStyle\"\n aria-hidden=\"true\"\n />\n\n <button\n v-for=\"(item, idx) in items\"\n :key=\"item.value\"\n :ref=\"(el: any) => setItemRef(el, idx)\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"isActive(item) ? 'true' : 'false'\"\n :aria-label=\"item.ariaLabel ?? item.label\"\n :aria-disabled=\"item.disabled || undefined\"\n :disabled=\"item.disabled || disabled\"\n :tabindex=\"isActive(item) ? 0 : -1\"\n :class=\"[\n 'relative z-10 inline-flex items-center justify-center gap-1.5 font-medium select-none whitespace-nowrap',\n 'transition-colors duration-150 ease-out',\n 'focus:outline-none focus-visible:ring-2 focus-visible:ring-
|
|
1
|
+
{"version":3,"file":"Segmented.mjs","names":[],"sources":["../../../src/components/forms/Segmented.vue"],"sourcesContent":["<template>\n <div\n ref=\"trackEl\"\n role=\"radiogroup\"\n :aria-label=\"ariaLabel\"\n :aria-disabled=\"disabled || undefined\"\n :class=\"[\n 'relative inline-flex items-center p-1 bg-muted gap-0.5',\n trackSizeClass,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n disabled ? 'opacity-60 pointer-events-none' : '',\n ]\"\n >\n <!-- Sliding indicator — same technique as Tabs -->\n <span\n ref=\"indicatorEl\"\n class=\"segmented-indicator absolute pointer-events-none\"\n :class=\"[innerRadiusClasses, 'bg-card shadow-sm']\"\n :style=\"indicatorStyle\"\n aria-hidden=\"true\"\n />\n\n <button\n v-for=\"(item, idx) in items\"\n :key=\"item.value\"\n :ref=\"(el: any) => setItemRef(el, idx)\"\n type=\"button\"\n role=\"radio\"\n :aria-checked=\"isActive(item) ? 'true' : 'false'\"\n :aria-label=\"item.ariaLabel ?? item.label\"\n :aria-disabled=\"item.disabled || undefined\"\n :disabled=\"item.disabled || disabled\"\n :tabindex=\"isActive(item) ? 0 : -1\"\n :class=\"[\n 'relative z-10 inline-flex items-center justify-center gap-1.5 font-medium select-none whitespace-nowrap',\n 'transition-colors duration-150 ease-out',\n 'focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/60',\n sizeClasses,\n innerRadiusClasses,\n fullWidth ? 'flex-1' : '',\n item.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',\n isActive(item) ? activeTextClass : 'text-muted-foreground hover:text-foreground',\n ]\"\n @click=\"onSelect(item)\"\n @keydown=\"onKeydown($event, item)\"\n >\n <component :is=\"item.icon\" v-if=\"item.icon\" :class=\"iconSizeClasses\" aria-hidden=\"true\" />\n <span v-if=\"item.label\">{{ item.label }}</span>\n </button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport type { Segmented, SegmentedItem } from '../../interfaces/forms/Segmented.interface';\nimport { useResolvedColor, useResolvedRadius, useResolvedSize, useSizeTokens } from '../../composables/useModoConfig';\n\nconst props = withDefaults(defineProps<Segmented>(), {\n color: 'primary',\n fullWidth: false,\n disabled: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number];\n 'change': [value: string | number];\n}>();\n\nconst resolvedSize = useResolvedSize(() => props.size);\nconst resolvedRadius = useResolvedRadius(() => props.radius);\nconst resolvedColor = useResolvedColor(() => props.color);\nconst sz = useSizeTokens(() => props.size);\n\n// ── DOM refs ──────────────────────────────────────────────────────────────\nconst trackEl = ref<HTMLElement | null>(null);\nconst indicatorEl = ref<HTMLElement | null>(null);\nconst itemRefs = ref<(HTMLElement | null)[]>([]);\nfunction setItemRef(el: HTMLElement | null, idx: number) {\n itemRefs.value[idx] = el;\n}\n\n// ── Sliding indicator ─────────────────────────────────────────────────────\nconst indicatorStyle = ref<Record<string, string>>({\n transform: 'translate3d(0,0,0)',\n width: '0px',\n height: '0px',\n opacity: '0',\n});\nlet _firstMeasureDone = false;\n\nfunction measureIndicator(animated = true) {\n const idx = props.items.findIndex((i) => i.value === props.modelValue);\n const el = itemRefs.value[idx];\n if (!el) return;\n const w = el.offsetWidth;\n const h = el.offsetHeight;\n if (w === 0 && h === 0) return;\n\n const node = indicatorEl.value;\n if (!animated && node) {\n node.classList.add('segmented-indicator--no-anim');\n requestAnimationFrame(() => {\n requestAnimationFrame(() => node.classList.remove('segmented-indicator--no-anim'));\n });\n }\n\n indicatorStyle.value = {\n transform: `translate3d(${el.offsetLeft}px, ${el.offsetTop}px, 0)`,\n width: `${w}px`,\n height: `${h}px`,\n top: '0',\n opacity: '1',\n };\n _firstMeasureDone = true;\n}\n\nlet _ro: ResizeObserver | null = null;\nonMounted(() => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => measureIndicator(false));\n });\n if (typeof ResizeObserver !== 'undefined' && trackEl.value) {\n _ro = new ResizeObserver(() => measureIndicator(_firstMeasureDone));\n _ro.observe(trackEl.value);\n }\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', onWindowResize);\n }\n});\nonBeforeUnmount(() => {\n _ro?.disconnect();\n _ro = null;\n if (typeof window !== 'undefined') {\n window.removeEventListener('resize', onWindowResize);\n }\n});\nfunction onWindowResize() {\n measureIndicator(false);\n}\n\nwatch(\n () => [props.modelValue, resolvedSize.value, resolvedRadius.value, resolvedColor.value, props.fullWidth, props.items.length],\n () => nextTick(() => measureIndicator(_firstMeasureDone)),\n);\n\n// ── Selection & keyboard ──────────────────────────────────────────────────\nfunction isActive(item: SegmentedItem): boolean {\n return props.modelValue === item.value;\n}\n\nfunction onSelect(item: SegmentedItem) {\n if (item.disabled || props.disabled) return;\n if (isActive(item)) return;\n emit('update:modelValue', item.value);\n emit('change', item.value);\n}\n\nfunction onKeydown(e: KeyboardEvent, item: SegmentedItem) {\n if (props.disabled) return;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n e.preventDefault();\n moveFocus(item, 1);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n e.preventDefault();\n moveFocus(item, -1);\n } else if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n onSelect(item);\n }\n}\n\nfunction moveFocus(current: SegmentedItem, dir: 1 | -1) {\n const enabled = props.items.filter((i) => !i.disabled);\n if (enabled.length === 0) return;\n const idx = enabled.findIndex((i) => i.value === current.value);\n const next = enabled[(idx + dir + enabled.length) % enabled.length];\n if (next) {\n onSelect(next);\n nextTick(() => {\n const i = props.items.findIndex((it) => it.value === next.value);\n itemRefs.value[i]?.focus();\n });\n }\n}\n\n// ── Class maps ────────────────────────────────────────────────────────────\n// The OUTER track owns the control height; the segments fill the padded area\n// (`h-full`). This keeps a Segmented the exact same box height as a Button /\n// Input at the same size (previously it ran +8px taller because of the track\n// padding), so it lines up in a toolbar with no height override.\nconst trackSizeClass = computed(() => sz.value.control);\nconst sizeClasses = computed(() => `h-full ${sz.value.padX} ${sz.value.text}`);\n\nconst iconSizeClasses = computed(() => sz.value.icon);\n\nconst radiusClasses = computed(() => {\n switch (resolvedRadius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded';\n case 'large': return 'rounded-xl';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-lg';\n }\n});\n\nconst innerRadiusClasses = computed(() => {\n switch (resolvedRadius.value) {\n case 'none': return 'rounded-none';\n case 'small': return 'rounded-[3px]';\n case 'large': return 'rounded-lg';\n case 'full': return 'rounded-full';\n case 'medium':\n default: return 'rounded-md';\n }\n});\n\n// Text color for active item — background comes from the indicator\nconst activeTextClass = computed(() => {\n switch (resolvedColor.value) {\n case 'primary': return 'text-primary font-medium';\n case 'danger': return 'text-destructive font-medium';\n case 'success': return 'text-success font-medium';\n case 'warning': return 'text-warning font-medium';\n case 'default':\n default: return 'text-foreground font-medium';\n }\n});\n\n</script>\n\n<style scoped>\n.segmented-indicator {\n top: 0;\n left: 0;\n will-change: transform, width;\n transition-property: transform, width, height, opacity;\n transition-duration: 280ms;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.segmented-indicator--no-anim {\n transition: none !important;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .segmented-indicator {\n transition: opacity 120ms linear !important;\n }\n}\n</style>\n"],"mappings":""}
|