@flux-ui/components 3.0.0-next.34 → 3.0.0-next.38
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/component/FluxActionBar.vue.d.ts +17 -17
- package/dist/component/FluxActionPane.vue.d.ts +7 -7
- package/dist/component/{FluxActions.vue.d.ts → FluxActionStack.vue.d.ts} +11 -15
- package/dist/component/{FluxAutoGrid.vue.d.ts → FluxAdaptiveGroup.vue.d.ts} +6 -3
- package/dist/component/FluxAdaptiveSlot.vue.d.ts +35 -0
- package/dist/component/FluxAspectRatio.vue.d.ts +3 -3
- package/dist/component/FluxBadgeStack.vue.d.ts +3 -3
- package/dist/component/FluxButtonGroup.vue.d.ts +3 -3
- package/dist/component/FluxButtonStack.vue.d.ts +3 -3
- package/dist/component/FluxCalendar.vue.d.ts +3 -3
- package/dist/component/FluxCalendarEvent.vue.d.ts +3 -3
- package/dist/component/FluxCheckbox.vue.d.ts +2 -1
- package/dist/component/FluxClickablePane.vue.d.ts +5 -5
- package/dist/component/FluxColorSelect.vue.d.ts +1 -0
- package/dist/component/{FluxPaneDeck.vue.d.ts → FluxColumn.vue.d.ts} +5 -5
- package/dist/component/FluxCommandPalette.vue.d.ts +52 -0
- package/dist/component/FluxCommandPaletteGroup.vue.d.ts +8 -0
- package/dist/component/FluxCommandPaletteItem.vue.d.ts +18 -0
- package/dist/component/FluxComment.vue.d.ts +3 -3
- package/dist/component/FluxContainer.vue.d.ts +3 -3
- package/dist/component/FluxDivider.vue.d.ts +5 -3
- package/dist/component/FluxDropZone.vue.d.ts +8 -7
- package/dist/component/FluxExpandableGroup.vue.d.ts +3 -3
- package/dist/component/FluxFader.vue.d.ts +3 -3
- package/dist/component/FluxFaderItem.vue.d.ts +3 -3
- package/dist/component/FluxFilter.vue.d.ts +3 -3
- package/dist/component/FluxFilterBar.vue.d.ts +3 -3
- package/dist/component/FluxFilterBase.vue.d.ts +4 -4
- package/dist/component/FluxFilterWindow.vue.d.ts +13 -17
- package/dist/component/FluxFlyout.vue.d.ts +19 -21
- package/dist/component/FluxForm.vue.d.ts +3 -3
- package/dist/component/FluxFormColumn.vue.d.ts +3 -3
- package/dist/component/FluxFormDateInput.vue.d.ts +18 -24
- package/dist/component/FluxFormDateRangeInput.vue.d.ts +18 -21
- package/dist/component/FluxFormDateTimeInput.vue.d.ts +18 -24
- package/dist/component/FluxFormField.vue.d.ts +7 -7
- package/dist/component/FluxFormGrid.vue.d.ts +3 -3
- package/dist/component/FluxFormInput.vue.d.ts +2 -9
- package/dist/component/FluxFormInputAddition.vue.d.ts +3 -3
- package/dist/component/FluxFormInputGroup.vue.d.ts +3 -3
- package/dist/component/FluxFormPinInput.vue.d.ts +2 -4
- package/dist/component/FluxFormRangeSlider.vue.d.ts +18 -2
- package/dist/component/FluxFormRow.vue.d.ts +3 -3
- package/dist/component/FluxFormSection.vue.d.ts +3 -3
- package/dist/component/FluxFormSelect.vue.d.ts +2 -4
- package/dist/component/FluxFormSelectAsync.vue.d.ts +2 -4
- package/dist/component/FluxFormSlider.vue.d.ts +11 -2
- package/dist/component/FluxFormTextArea.vue.d.ts +2 -6
- package/dist/component/FluxFormTimeZonePicker.vue.d.ts +2 -4
- package/dist/component/FluxFormTreeViewSelect.vue.d.ts +15 -37
- package/dist/component/FluxGallery.vue.d.ts +3 -3
- package/dist/component/FluxGrid.vue.d.ts +3 -3
- package/dist/component/FluxGridColumn.vue.d.ts +3 -3
- package/dist/component/FluxIcon.vue.d.ts +1 -0
- package/dist/component/FluxInfo.vue.d.ts +3 -3
- package/dist/component/FluxInfoStack.vue.d.ts +3 -3
- package/dist/component/FluxLayerPane.vue.d.ts +20 -0
- package/dist/component/FluxLayerPaneSecondary.vue.d.ts +20 -0
- package/dist/component/FluxMenu.vue.d.ts +3 -3
- package/dist/component/FluxMenuCollapsible.vue.d.ts +47 -0
- package/dist/component/FluxMenuGroup.vue.d.ts +3 -3
- package/dist/component/FluxMenuItem.vue.d.ts +5 -3
- package/dist/component/FluxMenuOptions.vue.d.ts +3 -3
- package/dist/component/FluxNotice.vue.d.ts +5 -5
- package/dist/component/FluxNoticeStack.vue.d.ts +3 -3
- package/dist/component/FluxOverflowBar.vue.d.ts +4 -4
- package/dist/component/FluxPane.vue.d.ts +5 -5
- package/dist/component/FluxPaneBody.vue.d.ts +3 -3
- package/dist/component/FluxPaneFooter.vue.d.ts +3 -3
- package/dist/component/FluxPaneGroup.vue.d.ts +3 -3
- package/dist/component/FluxPaneHeader.vue.d.ts +6 -6
- package/dist/component/FluxPaneIllustration.vue.d.ts +5 -5
- package/dist/component/FluxPressable.vue.d.ts +3 -3
- package/dist/component/FluxPrompt.vue.d.ts +3 -17
- package/dist/component/FluxRoot.vue.d.ts +3 -3
- package/dist/component/FluxRow.vue.d.ts +23 -0
- package/dist/component/FluxSegmentedControl.vue.d.ts +3 -2
- package/dist/component/FluxSplitButton.vue.d.ts +5 -5
- package/dist/component/FluxStack.vue.d.ts +3 -3
- package/dist/component/FluxStepper.vue.d.ts +6 -6
- package/dist/component/FluxStepperStep.vue.d.ts +3 -3
- package/dist/component/FluxTab.vue.d.ts +3 -3
- package/dist/component/FluxTabBar.vue.d.ts +3 -3
- package/dist/component/FluxTabBarItem.vue.d.ts +5 -7
- package/dist/component/FluxTableActions.vue.d.ts +3 -3
- package/dist/component/FluxTableBar.vue.d.ts +3 -3
- package/dist/component/FluxTableCell.vue.d.ts +5 -5
- package/dist/component/FluxTableHeader.vue.d.ts +3 -3
- package/dist/component/FluxTableRow.vue.d.ts +3 -3
- package/dist/component/FluxTabs.vue.d.ts +6 -6
- package/dist/component/FluxTag.vue.d.ts +1 -0
- package/dist/component/FluxTagStack.vue.d.ts +3 -3
- package/dist/component/FluxTimeline.vue.d.ts +3 -3
- package/dist/component/FluxTimelineItem.vue.d.ts +3 -3
- package/dist/component/FluxToggle.vue.d.ts +2 -3
- package/dist/component/FluxToolbar.vue.d.ts +3 -3
- package/dist/component/FluxToolbarGroup.vue.d.ts +3 -3
- package/dist/component/FluxWindow.vue.d.ts +3 -3
- package/dist/component/index.d.ts +11 -3
- package/dist/component/primitive/Anchor.vue.d.ts +3 -3
- package/dist/component/primitive/AnchorPopup.vue.d.ts +3 -3
- package/dist/component/primitive/CoordinatePicker.vue.d.ts +1 -0
- package/dist/component/primitive/DialogLayout.vue.d.ts +28 -0
- package/dist/component/primitive/FilterOptionBase.vue.d.ts +2 -2
- package/dist/component/primitive/SelectBase.vue.d.ts +19 -37
- package/dist/component/primitive/SliderThumb.vue.d.ts +4 -0
- package/dist/component/primitive/TreeNodeRenderer.vue.d.ts +30 -0
- package/dist/component/primitive/index.d.ts +2 -0
- package/dist/composable/index.d.ts +1 -0
- package/dist/composable/private/index.d.ts +8 -0
- package/dist/composable/private/useAsyncFilterOptions.d.ts +14 -0
- package/dist/composable/private/useCommandPalette.d.ts +38 -0
- package/dist/composable/private/useDateFlyout.d.ts +10 -0
- package/dist/composable/private/useDropdownPopup.d.ts +27 -0
- package/dist/composable/private/useFilterOption.d.ts +12 -0
- package/dist/composable/useAdaptiveGroupInjection.d.ts +2 -0
- package/dist/data/di.d.ts +11 -0
- package/dist/data/filter.d.ts +4 -17
- package/dist/data/i18n.d.ts +17 -0
- package/dist/data/timeZones.d.ts +3 -0
- package/dist/index.css +710 -349
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6936 -5537
- package/dist/index.js.map +1 -1
- package/dist/transition/FluxAutoHeightTransition.vue.d.ts +5 -3
- package/dist/transition/FluxAutoWidthTransition.vue.d.ts +5 -3
- package/dist/transition/FluxBreakthroughTransition.vue.d.ts +5 -3
- package/dist/transition/FluxFadeTransition.vue.d.ts +5 -3
- package/dist/transition/FluxOverlayTransition.vue.d.ts +5 -3
- package/dist/transition/FluxRouteTransition.vue.d.ts +5 -3
- package/dist/transition/FluxSlideOverTransition.vue.d.ts +5 -3
- package/dist/transition/FluxTooltipTransition.vue.d.ts +5 -3
- package/dist/transition/FluxVerticalWindowTransition.vue.d.ts +5 -3
- package/dist/transition/FluxWindowTransition.vue.d.ts +5 -3
- package/package.json +19 -23
- package/src/component/FluxActionBar.vue +9 -8
- package/src/component/FluxActionPane.vue +4 -3
- package/src/component/{FluxActions.vue → FluxActionStack.vue} +2 -2
- package/src/component/FluxAdaptiveGroup.vue +112 -0
- package/src/component/FluxAdaptiveSlot.vue +159 -0
- package/src/component/FluxAlert.vue +8 -17
- package/src/component/FluxAnimatedColors.vue +1 -1
- package/src/component/FluxAspectRatio.vue +2 -1
- package/src/component/FluxBadge.vue +5 -1
- package/src/component/FluxBadgeStack.vue +2 -1
- package/src/component/FluxButtonGroup.vue +2 -1
- package/src/component/FluxButtonStack.vue +2 -1
- package/src/component/FluxCalendar.vue +8 -1
- package/src/component/FluxCalendarEvent.vue +2 -1
- package/src/component/FluxCheckbox.vue +33 -6
- package/src/component/FluxChip.vue +1 -0
- package/src/component/FluxClickablePane.vue +3 -2
- package/src/component/FluxColorPicker.vue +8 -1
- package/src/component/FluxColorSelect.vue +25 -4
- package/src/component/{FluxAutoGrid.vue → FluxColumn.vue} +5 -8
- package/src/component/FluxCommandPalette.vue +290 -0
- package/src/component/FluxCommandPaletteGroup.vue +23 -0
- package/src/component/FluxCommandPaletteItem.vue +60 -0
- package/src/component/FluxComment.vue +2 -2
- package/src/component/FluxConfirm.vue +8 -17
- package/src/component/FluxContainer.vue +3 -2
- package/src/component/FluxDataTable.vue +3 -1
- package/src/component/FluxDivider.vue +7 -3
- package/src/component/FluxDropZone.vue +22 -8
- package/src/component/FluxExpandable.vue +3 -2
- package/src/component/FluxExpandableGroup.vue +2 -2
- package/src/component/FluxFader.vue +2 -2
- package/src/component/FluxFaderItem.vue +2 -1
- package/src/component/FluxFilter.vue +2 -1
- package/src/component/FluxFilterBar.vue +3 -2
- package/src/component/FluxFilterBase.vue +17 -9
- package/src/component/FluxFilterOption.vue +3 -14
- package/src/component/FluxFilterOptionAsync.vue +17 -60
- package/src/component/FluxFilterOptions.vue +3 -25
- package/src/component/FluxFilterOptionsAsync.vue +9 -73
- package/src/component/FluxFilterWindow.vue +1 -1
- package/src/component/FluxFlyout.vue +13 -11
- package/src/component/FluxForm.vue +2 -1
- package/src/component/FluxFormColumn.vue +2 -1
- package/src/component/FluxFormDateInput.vue +9 -22
- package/src/component/FluxFormDateRangeInput.vue +20 -15
- package/src/component/FluxFormDateTimeInput.vue +17 -20
- package/src/component/FluxFormField.vue +4 -4
- package/src/component/FluxFormGrid.vue +2 -1
- package/src/component/FluxFormInput.vue +11 -10
- package/src/component/FluxFormInputAddition.vue +2 -1
- package/src/component/FluxFormInputGroup.vue +3 -2
- package/src/component/FluxFormPinInput.vue +14 -6
- package/src/component/FluxFormRangeSlider.vue +12 -2
- package/src/component/FluxFormRow.vue +2 -1
- package/src/component/FluxFormSection.vue +4 -3
- package/src/component/FluxFormSelect.vue +11 -4
- package/src/component/FluxFormSelectAsync.vue +14 -8
- package/src/component/FluxFormSlider.vue +8 -2
- package/src/component/FluxFormTextArea.vue +12 -7
- package/src/component/FluxFormTimeZonePicker.vue +13 -626
- package/src/component/FluxFormTreeViewSelect.vue +51 -79
- package/src/component/FluxGallery.vue +2 -1
- package/src/component/FluxGrid.vue +3 -2
- package/src/component/FluxGridColumn.vue +2 -1
- package/src/component/FluxIcon.vue +4 -2
- package/src/component/FluxInfo.vue +2 -1
- package/src/component/FluxInfoStack.vue +3 -2
- package/src/component/FluxLayerPane.vue +16 -0
- package/src/component/FluxLayerPaneSecondary.vue +16 -0
- package/src/component/FluxLegend.vue +9 -9
- package/src/component/FluxMenu.vue +2 -2
- package/src/component/FluxMenuCollapsible.vue +187 -0
- package/src/component/FluxMenuGroup.vue +2 -1
- package/src/component/FluxMenuItem.vue +9 -1
- package/src/component/FluxMenuOptions.vue +1 -1
- package/src/component/FluxNotice.vue +7 -2
- package/src/component/FluxNoticeStack.vue +2 -1
- package/src/component/FluxOverflowBar.vue +3 -3
- package/src/component/FluxPagination.vue +1 -0
- package/src/component/FluxPane.vue +3 -2
- package/src/component/FluxPaneBody.vue +2 -1
- package/src/component/FluxPaneFooter.vue +2 -1
- package/src/component/FluxPaneGroup.vue +2 -1
- package/src/component/FluxPaneHeader.vue +7 -6
- package/src/component/FluxPaneIllustration.vue +3 -3
- package/src/component/FluxPaneMedia.vue +1 -1
- package/src/component/FluxPercentageBar.vue +3 -1
- package/src/component/FluxPressable.vue +2 -1
- package/src/component/FluxProgressBar.vue +2 -1
- package/src/component/FluxPrompt.vue +16 -27
- package/src/component/FluxRemove.vue +4 -0
- package/src/component/FluxRoot.vue +2 -2
- package/src/component/FluxRow.vue +24 -0
- package/src/component/FluxSegmentedControl.vue +51 -4
- package/src/component/FluxSnackbar.vue +36 -12
- package/src/component/FluxSplitButton.vue +3 -2
- package/src/component/FluxStack.vue +4 -3
- package/src/component/FluxStepper.vue +3 -3
- package/src/component/FluxStepperStep.vue +2 -1
- package/src/component/FluxTab.vue +2 -1
- package/src/component/FluxTabBar.vue +3 -3
- package/src/component/FluxTableActions.vue +5 -4
- package/src/component/FluxTableBar.vue +2 -1
- package/src/component/FluxTableCell.vue +4 -3
- package/src/component/FluxTableHeader.vue +4 -2
- package/src/component/FluxTableRow.vue +2 -1
- package/src/component/FluxTabs.vue +15 -6
- package/src/component/FluxTag.vue +8 -2
- package/src/component/FluxTagStack.vue +2 -1
- package/src/component/FluxTimeline.vue +2 -1
- package/src/component/FluxTimelineItem.vue +2 -1
- package/src/component/FluxToggle.vue +20 -5
- package/src/component/FluxToolbar.vue +2 -1
- package/src/component/FluxToolbarGroup.vue +2 -1
- package/src/component/FluxTooltip.vue +1 -1
- package/src/component/FluxTreeView.vue +9 -35
- package/src/component/FluxWindow.vue +2 -2
- package/src/component/index.ts +11 -3
- package/src/component/primitive/Anchor.vue +3 -1
- package/src/component/primitive/AnchorPopup.vue +3 -3
- package/src/component/primitive/CoordinatePicker.vue +2 -1
- package/src/component/primitive/CoordinatePickerThumb.vue +2 -0
- package/src/component/primitive/DialogLayout.vue +44 -0
- package/src/component/primitive/SelectBase.vue +22 -28
- package/src/component/primitive/SliderBase.vue +0 -1
- package/src/component/primitive/SliderThumb.vue +9 -0
- package/src/component/primitive/TreeNodeRenderer.vue +77 -0
- package/src/component/primitive/index.ts +2 -0
- package/src/composable/index.ts +1 -0
- package/src/composable/private/index.ts +8 -0
- package/src/composable/private/useAsyncFilterOptions.ts +70 -0
- package/src/composable/private/useCommandPalette.ts +405 -0
- package/src/composable/private/useDateFlyout.ts +34 -0
- package/src/composable/private/useDropdownPopup.ts +99 -0
- package/src/composable/private/useFilterOption.ts +59 -0
- package/src/composable/useAdaptiveGroupInjection.ts +6 -0
- package/src/css/component/Action.module.scss +2 -2
- package/src/css/component/AdaptiveSlot.module.scss +25 -0
- package/src/css/component/Avatar.module.scss +10 -11
- package/src/css/component/Badge.module.scss +11 -4
- package/src/css/component/Button.module.scss +4 -16
- package/src/css/component/Calendar.module.scss +4 -4
- package/src/css/component/Chip.module.scss +6 -10
- package/src/css/component/Color.module.scss +1 -1
- package/src/css/component/CommandPalette.module.scss +332 -0
- package/src/css/component/DatePicker.module.scss +1 -1
- package/src/css/component/Expandable.module.scss +5 -5
- package/src/css/component/Fader.module.scss +2 -1
- package/src/css/component/Flyout.module.scss +1 -1
- package/src/css/component/FocalPoint.module.scss +1 -1
- package/src/css/component/Form.module.scss +56 -10
- package/src/css/component/Item.module.scss +4 -4
- package/src/css/component/LayerPane.module.scss +40 -0
- package/src/css/component/Layout.module.scss +11 -4
- package/src/css/component/Legend.module.scss +2 -2
- package/src/css/component/Menu.module.scss +59 -11
- package/src/css/component/Notice.module.scss +7 -7
- package/src/css/component/Overlay.module.scss +2 -2
- package/src/css/component/Pane.module.scss +10 -23
- package/src/css/component/PercentageBar.module.scss +1 -1
- package/src/css/component/Remove.module.scss +1 -1
- package/src/css/component/SegmentedControl.module.scss +1 -0
- package/src/css/component/Snackbar.module.scss +1 -1
- package/src/css/component/Statistic.module.scss +2 -2
- package/src/css/component/Stepper.module.scss +1 -1
- package/src/css/component/Tab.module.scss +11 -15
- package/src/css/component/Table.module.scss +13 -13
- package/src/css/component/Timeline.module.scss +2 -2
- package/src/css/component/Toolbar.module.scss +3 -3
- package/src/css/component/Tooltip.module.scss +3 -4
- package/src/css/component/Transition.module.scss +1 -1
- package/src/css/component/TreeView.module.scss +2 -15
- package/src/css/component/TreeViewSelect.module.scss +1 -15
- package/src/css/component/base/Button.module.scss +6 -7
- package/src/css/component/base/Effect.module.scss +2 -1
- package/src/css/component/primitive/Slider.module.scss +6 -7
- package/src/css/component/primitive/TreeNode.module.scss +19 -0
- package/src/css/mixin/button-active.scss +6 -0
- package/src/css/mixin/focus-ring.scss +1 -1
- package/src/css/mixin/index.scss +1 -0
- package/src/css/typography.scss +3 -2
- package/src/css/variables.scss +7 -2
- package/src/data/di.ts +13 -0
- package/src/data/filter.ts +24 -28
- package/src/data/i18n.ts +17 -0
- package/src/data/store.ts +46 -11
- package/src/data/timeZones.ts +619 -0
- package/src/index.ts +2 -0
- package/src/transition/FluxAutoHeightTransition.vue +5 -0
- package/src/transition/FluxAutoWidthTransition.vue +5 -0
- package/src/transition/FluxBreakthroughTransition.vue +5 -0
- package/src/transition/FluxFadeTransition.vue +5 -0
- package/src/transition/FluxOverlayTransition.vue +5 -0
- package/src/transition/FluxRouteTransition.vue +5 -0
- package/src/transition/FluxSlideOverTransition.vue +5 -0
- package/src/transition/FluxTooltipTransition.vue +5 -0
- package/src/transition/FluxVerticalWindowTransition.vue +5 -0
- package/src/transition/FluxWindowTransition.vue +5 -0
- package/dist/0db98648.svg +0 -3
- package/src/component/FluxPaneDeck.vue +0 -24
- package/src/css/component/base/Grid.module.scss +0 -8
- package/src/image/avatar-mask.svg +0 -3
- package/tsconfig.json +0 -7
|
@@ -75,8 +75,9 @@
|
|
|
75
75
|
<script
|
|
76
76
|
lang="ts"
|
|
77
77
|
setup>
|
|
78
|
+
import type { VNode } from 'vue';
|
|
79
|
+
import { computed, unref } from 'vue';
|
|
78
80
|
import type { FluxFilterState } from '@flux-ui/types';
|
|
79
|
-
import { computed, unref } from "vue";
|
|
80
81
|
import { FilterBadge, VNodeRenderer } from '$flux/component/primitive';
|
|
81
82
|
import FluxFilterBase from './FluxFilterBase.vue';
|
|
82
83
|
import FluxFilterWindow from './FluxFilterWindow.vue';
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
}>();
|
|
108
109
|
|
|
109
110
|
defineSlots<{
|
|
110
|
-
default?():
|
|
111
|
+
default?(): VNode[];
|
|
111
112
|
}>();
|
|
112
113
|
|
|
113
114
|
const isFiltered = computed(() => Object.entries(unref(modelValue)).filter(([, val]) => Boolean(val)).length > 0);
|
|
@@ -6,11 +6,19 @@
|
|
|
6
6
|
lang="ts"
|
|
7
7
|
setup>
|
|
8
8
|
import { flattenVNodeTree, getComponentName, getComponentProps } from '@flux-ui/internals';
|
|
9
|
-
import type { FluxFilterItem, FluxFilterOptionItem, FluxFilterState } from '@flux-ui/types';
|
|
9
|
+
import type { FluxFilterItem, FluxFilterOptionItem, FluxFilterSpecMap, FluxFilterState } from '@flux-ui/types';
|
|
10
10
|
import { computed, provide, unref, type VNode } from 'vue';
|
|
11
11
|
import { filterParsers, FluxFilterInjectionKey } from '$flux/data';
|
|
12
12
|
import { camelCase } from 'lodash-es';
|
|
13
13
|
|
|
14
|
+
type FluxFilterType = keyof FluxFilterSpecMap;
|
|
15
|
+
|
|
16
|
+
function applyParser<K extends FluxFilterType>(type: K, spec: FluxFilterSpecMap[K]): FluxFilterItem {
|
|
17
|
+
const parser = filterParsers[type] as (spec: FluxFilterSpecMap[K]) => FluxFilterItem;
|
|
18
|
+
|
|
19
|
+
return parser(spec);
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
const emit = defineEmits<{
|
|
15
23
|
back: [];
|
|
16
24
|
reset: [string]
|
|
@@ -29,9 +37,9 @@
|
|
|
29
37
|
readonly buttons: Record<string, FluxFilterItem>;
|
|
30
38
|
readonly filters: Record<string, VNode>;
|
|
31
39
|
readonly menuItems: (FluxFilterItem | VNode)[][];
|
|
32
|
-
}):
|
|
40
|
+
}): VNode[];
|
|
33
41
|
|
|
34
|
-
filters():
|
|
42
|
+
filters(): VNode[];
|
|
35
43
|
}>();
|
|
36
44
|
|
|
37
45
|
const buttons = computed(() => {
|
|
@@ -45,10 +53,10 @@
|
|
|
45
53
|
continue;
|
|
46
54
|
}
|
|
47
55
|
|
|
48
|
-
const
|
|
49
|
-
const
|
|
56
|
+
const type = camelCase(name.substring(10)) as FluxFilterType;
|
|
57
|
+
const props = getComponentProps<FluxFilterSpecMap[FluxFilterType]>(item);
|
|
50
58
|
|
|
51
|
-
buttons[props.name] =
|
|
59
|
+
buttons[props.name] = applyParser(type, props);
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
return buttons;
|
|
@@ -92,10 +100,10 @@
|
|
|
92
100
|
}
|
|
93
101
|
|
|
94
102
|
if (name.startsWith('FluxFilter')) {
|
|
95
|
-
const
|
|
96
|
-
const
|
|
103
|
+
const type = camelCase(name.substring(10)) as FluxFilterType;
|
|
104
|
+
const props = getComponentProps<FluxFilterSpecMap[FluxFilterType]>(item);
|
|
97
105
|
|
|
98
|
-
menuItems[menuItems.length - 1].push(
|
|
106
|
+
menuItems[menuItems.length - 1].push(applyParser(type, props));
|
|
99
107
|
continue;
|
|
100
108
|
}
|
|
101
109
|
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
<script
|
|
12
12
|
lang="ts"
|
|
13
13
|
setup>
|
|
14
|
-
import type { FluxFilterOptionRow,
|
|
14
|
+
import type { FluxFilterOptionRow, FluxIconName } from '@flux-ui/types';
|
|
15
15
|
import { computed, unref } from 'vue';
|
|
16
|
-
import {
|
|
16
|
+
import { useFilterOptionSingle } from '$flux/composable/private';
|
|
17
17
|
import { isFluxFilterOptionHeader } from '$flux/data';
|
|
18
18
|
import { FilterOptionBase } from './primitive';
|
|
19
19
|
|
|
@@ -31,19 +31,8 @@
|
|
|
31
31
|
readonly searchPlaceholder?: string;
|
|
32
32
|
}>();
|
|
33
33
|
|
|
34
|
-
const {
|
|
34
|
+
const {currentValue, onSelect} = useFilterOptionSingle(name);
|
|
35
35
|
|
|
36
|
-
const currentValue = computed(() => unref(state)[name] as FluxFilterValueSingle);
|
|
37
36
|
const filteredOptions = computed(() => options
|
|
38
37
|
.filter(o => isFluxFilterOptionHeader(o) || unref(modelSearch).length === 0 || o.label.toLowerCase().includes(unref(modelSearch).toLowerCase())));
|
|
39
|
-
|
|
40
|
-
function onSelect(value: FluxFilterValue): void {
|
|
41
|
-
if (unref(currentValue) === value) {
|
|
42
|
-
setValue(name, null);
|
|
43
|
-
} else {
|
|
44
|
-
setValue(name, value);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
back();
|
|
48
|
-
}
|
|
49
38
|
</script>
|
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { useFilterInjection } from '$flux/composable';
|
|
19
|
-
import { isFluxFilterOptionItem } from '$flux/data';
|
|
15
|
+
import type { FluxFilterOptionRow, FluxFilterValue, FluxIconName } from '@flux-ui/types';
|
|
16
|
+
import { computed, unref } from 'vue';
|
|
17
|
+
import { useAsyncFilterOptions, useFilterOptionSingle } from '$flux/composable/private';
|
|
20
18
|
import { FilterOptionBase } from './primitive';
|
|
21
19
|
|
|
22
20
|
const modelSearch = defineModel<string>('searchQuery', {
|
|
@@ -39,64 +37,23 @@
|
|
|
39
37
|
readonly searchPlaceholder?: string;
|
|
40
38
|
}>();
|
|
41
39
|
|
|
42
|
-
const {
|
|
43
|
-
const {isLoading, loaded} = useLoaded();
|
|
44
|
-
const debouncedModelSearch = useDebouncedRef(modelSearch, 150);
|
|
45
|
-
const fetchOptions = computed(() => loaded(fetchOptionsProp));
|
|
46
|
-
const fetchRelevant = computed(() => loaded(fetchRelevantProp));
|
|
47
|
-
const fetchSearch = computed(() => loaded(fetchSearchProp));
|
|
40
|
+
const {currentValue, onSelect} = useFilterOptionSingle(name);
|
|
48
41
|
|
|
49
|
-
const
|
|
50
|
-
|
|
42
|
+
const currentValueIds = computed<FluxFilterValue[]>(() => {
|
|
43
|
+
const value = unref(currentValue);
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const options = computed(() => {
|
|
55
|
-
const options: FluxFilterOptionRow[] = [];
|
|
56
|
-
const search = unref(modelSearch);
|
|
57
|
-
const selected = unref(selectedOptions);
|
|
58
|
-
const visible = unref(visibleOptions);
|
|
59
|
-
|
|
60
|
-
visible.forEach(vo => options.push(vo));
|
|
61
|
-
|
|
62
|
-
selected.forEach(so => {
|
|
63
|
-
if (isFluxFilterOptionItem(so) && visible.find(vo => isFluxFilterOptionItem(vo) && vo.value === so.value)) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (isFluxFilterOptionItem(so) && !so.label.toLowerCase().includes(search.toLowerCase())) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
options.push(so);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
return options;
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
function onSelect(value: FluxFilterValue): void {
|
|
78
|
-
if (unref(currentValue) === value) {
|
|
79
|
-
setValue(name, null);
|
|
80
|
-
} else {
|
|
81
|
-
setValue(name, value);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
back();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
watch(currentValue, async value => {
|
|
88
|
-
if (!value && value !== 0) {
|
|
89
|
-
return;
|
|
45
|
+
if (value === null || value === undefined) {
|
|
46
|
+
return [];
|
|
90
47
|
}
|
|
91
48
|
|
|
92
|
-
|
|
93
|
-
}
|
|
49
|
+
return [value];
|
|
50
|
+
});
|
|
94
51
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
52
|
+
const {isLoading, options} = useAsyncFilterOptions({
|
|
53
|
+
currentValueIds,
|
|
54
|
+
modelSearch,
|
|
55
|
+
fetchOptions: (ids: FluxFilterValue[]) => fetchOptionsProp(ids),
|
|
56
|
+
fetchRelevant: () => fetchRelevantProp(),
|
|
57
|
+
fetchSearch: (searchQuery: string) => fetchSearchProp(searchQuery)
|
|
58
|
+
});
|
|
102
59
|
</script>
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
<script
|
|
12
12
|
lang="ts"
|
|
13
13
|
setup>
|
|
14
|
-
import type { FluxFilterOptionRow,
|
|
14
|
+
import type { FluxFilterOptionRow, FluxIconName } from '@flux-ui/types';
|
|
15
15
|
import { computed, unref } from 'vue';
|
|
16
|
-
import {
|
|
16
|
+
import { useFilterOptionMulti } from '$flux/composable/private';
|
|
17
17
|
import { isFluxFilterOptionHeader } from '$flux/data';
|
|
18
18
|
import { FilterOptionBase } from './primitive';
|
|
19
19
|
|
|
@@ -33,30 +33,8 @@
|
|
|
33
33
|
readonly searchPlaceholder?: string;
|
|
34
34
|
}>();
|
|
35
35
|
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
const currentValue = computed(() => {
|
|
39
|
-
const value = unref(state)[name];
|
|
40
|
-
|
|
41
|
-
if (Array.isArray(value)) {
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return [];
|
|
46
|
-
});
|
|
36
|
+
const {currentValue, onSelect} = useFilterOptionMulti(name);
|
|
47
37
|
|
|
48
38
|
const filteredOptions = computed(() => options
|
|
49
39
|
.filter(o => isFluxFilterOptionHeader(o) || unref(modelSearch).length === 0 || o.label.toLowerCase().includes(unref(modelSearch).toLowerCase())));
|
|
50
|
-
|
|
51
|
-
function onSelect(value: FluxFilterValueSingle): void {
|
|
52
|
-
let values = Array.from(unref(currentValue));
|
|
53
|
-
|
|
54
|
-
if (values.includes(value)) {
|
|
55
|
-
values = values.filter(v => v !== value);
|
|
56
|
-
} else {
|
|
57
|
-
values.push(value);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
setValue(name, values);
|
|
61
|
-
}
|
|
62
40
|
</script>
|
|
@@ -12,11 +12,8 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import { computed, ref, unref, watch } from 'vue';
|
|
18
|
-
import { useFilterInjection } from '$flux/composable';
|
|
19
|
-
import { isFluxFilterOptionItem } from '$flux/data';
|
|
15
|
+
import type { FluxFilterOptionRow, FluxFilterValue, FluxIconName } from '@flux-ui/types';
|
|
16
|
+
import { useAsyncFilterOptions, useFilterOptionMulti } from '$flux/composable/private';
|
|
20
17
|
import { FilterOptionBase } from './primitive';
|
|
21
18
|
|
|
22
19
|
const modelSearch = defineModel<string>('searchQuery', {
|
|
@@ -39,74 +36,13 @@
|
|
|
39
36
|
readonly searchPlaceholder?: string;
|
|
40
37
|
}>();
|
|
41
38
|
|
|
42
|
-
const {
|
|
43
|
-
const {isLoading, loaded} = useLoaded();
|
|
44
|
-
const debouncedModelSearch = useDebouncedRef(modelSearch, 150);
|
|
45
|
-
const fetchOptions = computed(() => loaded(fetchOptionsProp));
|
|
46
|
-
const fetchRelevant = computed(() => loaded(fetchRelevantProp));
|
|
47
|
-
const fetchSearch = computed(() => loaded(fetchSearchProp));
|
|
39
|
+
const {currentValue, onSelect} = useFilterOptionMulti(name);
|
|
48
40
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (Array.isArray(value)) {
|
|
56
|
-
return value;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return [];
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const options = computed(() => {
|
|
63
|
-
const options: FluxFilterOptionRow[] = [];
|
|
64
|
-
const search = unref(modelSearch);
|
|
65
|
-
const selected = unref(selectedOptions);
|
|
66
|
-
const visible = unref(visibleOptions);
|
|
67
|
-
|
|
68
|
-
visible.forEach(vo => options.push(vo));
|
|
69
|
-
|
|
70
|
-
selected.forEach(so => {
|
|
71
|
-
if (isFluxFilterOptionItem(so) && visible.find(vo => isFluxFilterOptionItem(vo) && vo.value === so.value)) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (isFluxFilterOptionItem(so) && !so.label.toLowerCase().includes(search.toLowerCase())) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
options.push(so);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
return options;
|
|
41
|
+
const {isLoading, options} = useAsyncFilterOptions({
|
|
42
|
+
currentValueIds: currentValue,
|
|
43
|
+
modelSearch,
|
|
44
|
+
fetchOptions: (ids: FluxFilterValue[]) => fetchOptionsProp(ids),
|
|
45
|
+
fetchRelevant: () => fetchRelevantProp(),
|
|
46
|
+
fetchSearch: (searchQuery: string) => fetchSearchProp(searchQuery)
|
|
83
47
|
});
|
|
84
|
-
|
|
85
|
-
function onSelect(value: FluxFilterValueSingle): void {
|
|
86
|
-
let values = Array.from(unref(currentValue));
|
|
87
|
-
|
|
88
|
-
if (values.includes(value)) {
|
|
89
|
-
values = values.filter(v => v !== value);
|
|
90
|
-
} else {
|
|
91
|
-
values.push(value);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
setValue(name, values);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
watch(currentValue, async value => {
|
|
98
|
-
if (value.length === 0) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
selectedOptions.value = await unref(fetchOptions)(value);
|
|
103
|
-
}, {immediate: true});
|
|
104
|
-
|
|
105
|
-
watch(debouncedModelSearch, async searchQuery => {
|
|
106
|
-
if (searchQuery.length > 0) {
|
|
107
|
-
visibleOptions.value = await unref(fetchSearch)(searchQuery);
|
|
108
|
-
} else {
|
|
109
|
-
visibleOptions.value = await unref(fetchRelevant)();
|
|
110
|
-
}
|
|
111
|
-
}, {immediate: true});
|
|
112
48
|
</script>
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
'--opener-width': `${openerWidth}px`,
|
|
7
7
|
'--pane-mx': `${paneMarginX}px`,
|
|
8
8
|
'--pane-my': `${paneMarginY}px`,
|
|
9
|
-
'--pane-x': `${paneX -
|
|
10
|
-
'--pane-y': `${paneY -
|
|
9
|
+
'--pane-x': `${paneX - 30}px`,
|
|
10
|
+
'--pane-y': `${paneY - 30}px`
|
|
11
11
|
}">
|
|
12
12
|
<slot
|
|
13
13
|
name="opener"
|
|
14
|
-
v-bind="{close, open, toggle}"/>
|
|
14
|
+
v-bind="{close, open, toggle, isOpen: isOpen || isOpening || isClosing}"/>
|
|
15
15
|
|
|
16
16
|
<dialog
|
|
17
17
|
ref="dialog"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
import { isSSR, unrefTemplateElement, useEventListener, useFocusTrap } from '@flux-ui/internals';
|
|
43
43
|
import type { FluxDirection } from '@flux-ui/types';
|
|
44
44
|
import { clsx } from 'clsx';
|
|
45
|
-
import { provide, ref, unref, useTemplateRef, watch } from 'vue';
|
|
45
|
+
import { provide, ref, unref, useTemplateRef, type VNode, watch } from 'vue';
|
|
46
46
|
import { FluxFlyoutInjectionKey } from '$flux/data';
|
|
47
47
|
import FluxPane from './FluxPane.vue';
|
|
48
48
|
import $style from '$flux/css/component/Flyout.module.scss';
|
|
@@ -65,13 +65,15 @@
|
|
|
65
65
|
readonly paneY: number;
|
|
66
66
|
readonly openerWidth: number;
|
|
67
67
|
readonly openerHeight: number;
|
|
68
|
-
}):
|
|
68
|
+
}): VNode[];
|
|
69
69
|
|
|
70
70
|
opener(props: {
|
|
71
71
|
close(): void;
|
|
72
72
|
open(): void;
|
|
73
73
|
toggle(): void;
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
readonly isOpen: boolean;
|
|
76
|
+
}): VNode[];
|
|
75
77
|
}>();
|
|
76
78
|
|
|
77
79
|
const dialogRef = useTemplateRef('dialog');
|
|
@@ -133,14 +135,14 @@
|
|
|
133
135
|
const {top, left, width, height} = mount.children[0].getBoundingClientRect();
|
|
134
136
|
const {width: paneWidth, height: paneHeight} = pane.getBoundingClientRect();
|
|
135
137
|
|
|
136
|
-
let x, y, mx = 0, my = 0;
|
|
138
|
+
let x: number, y: number, mx = 0, my = 0;
|
|
137
139
|
|
|
138
140
|
if (direction === 'horizontal') {
|
|
139
141
|
x = left + width;
|
|
140
142
|
y = top + height / 2 - paneHeight / 2;
|
|
141
143
|
mx = margin;
|
|
142
144
|
|
|
143
|
-
if (x + paneWidth > innerWidth -
|
|
145
|
+
if (x + paneWidth > innerWidth - 12) {
|
|
144
146
|
x = left - paneWidth;
|
|
145
147
|
mx = -mx;
|
|
146
148
|
}
|
|
@@ -149,14 +151,14 @@
|
|
|
149
151
|
y = top + height;
|
|
150
152
|
my = margin;
|
|
151
153
|
|
|
152
|
-
if (y + paneHeight > innerHeight -
|
|
154
|
+
if (y + paneHeight > innerHeight - 12) {
|
|
153
155
|
y = top - paneHeight;
|
|
154
156
|
my = -my;
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
paneX.value = Math.max(
|
|
159
|
-
paneY.value = Math.max(
|
|
160
|
+
paneX.value = Math.max(12, Math.min(innerWidth - paneWidth - 12, x));
|
|
161
|
+
paneY.value = Math.max(12, Math.min(innerHeight - paneHeight - 12, y));
|
|
160
162
|
paneMarginX.value = mx;
|
|
161
163
|
paneMarginY.value = my;
|
|
162
164
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
+
import type { VNode } from 'vue';
|
|
15
16
|
import FluxDisabled from './FluxDisabled.vue';
|
|
16
17
|
import $style from '$flux/css/component/Form.module.scss';
|
|
17
18
|
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
}>();
|
|
27
28
|
|
|
28
29
|
defineSlots<{
|
|
29
|
-
default():
|
|
30
|
+
default(): VNode[];
|
|
30
31
|
}>();
|
|
31
32
|
|
|
32
33
|
function onSubmit(): void {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<template #opener="{open}">
|
|
6
6
|
<FluxFormInputGroup>
|
|
7
7
|
<FluxFormInput
|
|
8
|
-
:="{autoComplete, autoFocus,
|
|
8
|
+
:="{autoComplete, autoFocus, error, isCondensed, isLoading, isReadonly, isSecondary, name, placeholder}"
|
|
9
9
|
v-model="localValue"
|
|
10
10
|
:class="$style.formDateInput"
|
|
11
11
|
:disabled="disabled"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@show-picker="open"/>
|
|
18
18
|
|
|
19
19
|
<FluxSecondaryButton
|
|
20
|
-
:disabled="disabled"
|
|
20
|
+
:disabled="disabled || isReadonly"
|
|
21
21
|
icon-leading="calendar"
|
|
22
22
|
@click.prevent="open"/>
|
|
23
23
|
</FluxFormInputGroup>
|
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
<script
|
|
34
34
|
lang="ts"
|
|
35
35
|
setup>
|
|
36
|
-
import type { FluxAutoCompleteType } from '@flux-ui/types';
|
|
36
|
+
import type { FluxAutoCompleteType, FluxFormInputBaseProps } from '@flux-ui/types';
|
|
37
37
|
import type { DateTime } from 'luxon';
|
|
38
|
-
import {
|
|
38
|
+
import { toRef, useTemplateRef } from 'vue';
|
|
39
39
|
import { useDisabled } from '$flux/composable';
|
|
40
|
+
import { useDateFlyout } from '$flux/composable/private';
|
|
40
41
|
import FluxDatePicker from './FluxDatePicker.vue';
|
|
41
42
|
import FluxFlyout from './FluxFlyout.vue';
|
|
42
43
|
import FluxFormInput from './FluxFormInput.vue';
|
|
@@ -55,20 +56,18 @@
|
|
|
55
56
|
|
|
56
57
|
const {
|
|
57
58
|
disabled: componentDisabled
|
|
58
|
-
} = defineProps<{
|
|
59
|
+
} = defineProps<FluxFormInputBaseProps & {
|
|
59
60
|
readonly autoComplete?: FluxAutoCompleteType;
|
|
60
|
-
readonly autoFocus?: boolean;
|
|
61
|
-
readonly disabled?: boolean;
|
|
62
|
-
readonly isReadonly?: boolean;
|
|
63
61
|
readonly max?: DateTime;
|
|
64
62
|
readonly min?: DateTime;
|
|
65
|
-
readonly placeholder?: string;
|
|
66
63
|
}>();
|
|
67
64
|
|
|
68
65
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
69
66
|
const flyoutRef = useTemplateRef('flyout');
|
|
70
67
|
|
|
71
|
-
const localValue =
|
|
68
|
+
const localValue = useDateFlyout(modelValue, flyoutRef, {
|
|
69
|
+
compareKey: value => value?.toISODate()
|
|
70
|
+
});
|
|
72
71
|
|
|
73
72
|
function onBlur(): void {
|
|
74
73
|
emit('blur');
|
|
@@ -77,16 +76,4 @@
|
|
|
77
76
|
function onFocus(): void {
|
|
78
77
|
emit('focus');
|
|
79
78
|
}
|
|
80
|
-
|
|
81
|
-
watch(modelValue, modelValue => localValue.value = modelValue, {immediate: true});
|
|
82
|
-
|
|
83
|
-
watch(localValue, localValue => {
|
|
84
|
-
unref(flyoutRef)?.close();
|
|
85
|
-
|
|
86
|
-
if (modelValue.value?.toISODate() === localValue?.toISODate()) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
modelValue.value = localValue;
|
|
91
|
-
});
|
|
92
79
|
</script>
|
|
@@ -3,18 +3,29 @@
|
|
|
3
3
|
ref="flyout"
|
|
4
4
|
:width="300">
|
|
5
5
|
<template #opener="{open}">
|
|
6
|
-
<FluxFormInputGroup
|
|
6
|
+
<FluxFormInputGroup
|
|
7
|
+
:aria-disabled="disabled ? true : undefined"
|
|
8
|
+
:aria-readonly="isReadonly ? true : undefined"
|
|
9
|
+
:aria-invalid="error ? true : undefined">
|
|
7
10
|
<div
|
|
8
11
|
:class="clsx(
|
|
9
12
|
$style.formDateRangeInput,
|
|
10
|
-
disabled && $style.isDisabled
|
|
13
|
+
disabled && $style.isDisabled,
|
|
14
|
+
isCondensed && $style.isCondensed,
|
|
15
|
+
isSecondary && $style.isSecondary,
|
|
16
|
+
error && $style.isInvalid
|
|
11
17
|
)"
|
|
12
18
|
role="presentation">
|
|
13
|
-
<span>{{ label }}</span>
|
|
19
|
+
<span v-if="label">{{ label }}</span>
|
|
20
|
+
<span
|
|
21
|
+
v-else-if="placeholder"
|
|
22
|
+
:class="$style.formSelectPlaceholder">
|
|
23
|
+
{{ placeholder }}
|
|
24
|
+
</span>
|
|
14
25
|
</div>
|
|
15
26
|
|
|
16
27
|
<FluxSecondaryButton
|
|
17
|
-
:disabled="disabled"
|
|
28
|
+
:disabled="disabled || isReadonly"
|
|
18
29
|
icon-leading="calendar"
|
|
19
30
|
@click.prevent="open"/>
|
|
20
31
|
</FluxFormInputGroup>
|
|
@@ -31,10 +42,12 @@
|
|
|
31
42
|
<script
|
|
32
43
|
lang="ts"
|
|
33
44
|
setup>
|
|
45
|
+
import type { FluxFormInputBaseProps } from '@flux-ui/types';
|
|
34
46
|
import { clsx } from 'clsx';
|
|
35
47
|
import type { DateTime } from 'luxon';
|
|
36
|
-
import { computed,
|
|
48
|
+
import { computed, toRef, unref, useTemplateRef } from 'vue';
|
|
37
49
|
import { useDisabled } from '$flux/composable';
|
|
50
|
+
import { useDateFlyout } from '$flux/composable/private';
|
|
38
51
|
import { createLabelForDateRange } from '$flux/util';
|
|
39
52
|
import FluxDatePicker from './FluxDatePicker.vue';
|
|
40
53
|
import FluxFlyout from './FluxFlyout.vue';
|
|
@@ -49,8 +62,7 @@
|
|
|
49
62
|
const {
|
|
50
63
|
disabled: componentDisabled,
|
|
51
64
|
rangeMode = 'range'
|
|
52
|
-
} = defineProps<{
|
|
53
|
-
readonly disabled?: boolean;
|
|
65
|
+
} = defineProps<FluxFormInputBaseProps & {
|
|
54
66
|
readonly max?: DateTime;
|
|
55
67
|
readonly min?: DateTime;
|
|
56
68
|
readonly rangeMode?: 'range' | 'week' | 'month';
|
|
@@ -59,7 +71,7 @@
|
|
|
59
71
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
60
72
|
const flyoutRef = useTemplateRef('flyout');
|
|
61
73
|
|
|
62
|
-
const localValue =
|
|
74
|
+
const localValue = useDateFlyout(modelValue, flyoutRef);
|
|
63
75
|
|
|
64
76
|
const label = computed(() => {
|
|
65
77
|
const value = unref(localValue);
|
|
@@ -72,11 +84,4 @@
|
|
|
72
84
|
|
|
73
85
|
return createLabelForDateRange(start, end, true);
|
|
74
86
|
});
|
|
75
|
-
|
|
76
|
-
watch(localValue, localValue => {
|
|
77
|
-
unref(flyoutRef)?.close();
|
|
78
|
-
modelValue.value = localValue;
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
watch(modelValue, modelValue => localValue.value = modelValue, {immediate: true});
|
|
82
87
|
</script>
|