@flux-ui/components 3.0.0-next.35 → 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/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/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/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 +7 -2
- 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/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 +372 -331
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7116 -6286
- 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/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/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 +2 -1
- 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 +5 -1
- 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 +7 -2
- 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 +1 -1
- 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 +4 -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/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
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
:class="clsx(
|
|
6
6
|
$formStyle.formSelect,
|
|
7
7
|
disabled && $formStyle.isDisabled,
|
|
8
|
-
isPopupOpen && $formStyle.isFocused
|
|
8
|
+
isPopupOpen && $formStyle.isFocused,
|
|
9
|
+
isCondensed && $formStyle.isCondensed,
|
|
10
|
+
isSecondary && $formStyle.isSecondary,
|
|
11
|
+
error && $formStyle.isInvalid
|
|
9
12
|
)"
|
|
10
13
|
:id="id"
|
|
11
14
|
:aria-disabled="disabled ? true : undefined"
|
|
15
|
+
:aria-readonly="isReadonly ? true : undefined"
|
|
16
|
+
:aria-invalid="error ? true : undefined"
|
|
12
17
|
tabindex="0"
|
|
13
18
|
tag-name="div"
|
|
14
19
|
@click="toggle()"
|
|
@@ -83,45 +88,19 @@
|
|
|
83
88
|
@keydown.enter.prevent="onNodeClick(node)"
|
|
84
89
|
@keydown.space.prevent="onNodeClick(node)">
|
|
85
90
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<span
|
|
94
|
-
v-if="node.depth > 0"
|
|
95
|
-
:class="[$style.treeConnector, node.isLast && $style.isLast]"/>
|
|
96
|
-
|
|
97
|
-
<span
|
|
98
|
-
:class="$style.treeNodeExpand"
|
|
99
|
-
@click="onExpandClick(node, $event)">
|
|
91
|
+
<TreeNodeRenderer
|
|
92
|
+
:node="node"
|
|
93
|
+
:expanded="expandedIds.has(node.id)"
|
|
94
|
+
:level-colors="levelColors"
|
|
95
|
+
@expand-click="onExpandClick(node, $event)">
|
|
96
|
+
<template #trailing>
|
|
100
97
|
<FluxIcon
|
|
101
|
-
v-if="node.
|
|
102
|
-
:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<span
|
|
108
|
-
v-if="getLevelColor(node.depth, levelColors)"
|
|
109
|
-
:class="$style.treeNodeColorDot"
|
|
110
|
-
:style="{ background: getLevelColor(node.depth, levelColors) }"/>
|
|
111
|
-
|
|
112
|
-
<FluxIcon
|
|
113
|
-
v-if="node.icon"
|
|
114
|
-
:class="$style.treeNodeIcon"
|
|
115
|
-
:name="node.icon"
|
|
116
|
-
:size="16"/>
|
|
117
|
-
|
|
118
|
-
<span :class="$style.treeNodeLabel">{{ node.label }}</span>
|
|
119
|
-
|
|
120
|
-
<FluxIcon
|
|
121
|
-
v-if="selectedIds.has(node.id)"
|
|
122
|
-
:class="$style.treeNodeCheck"
|
|
123
|
-
name="check"
|
|
124
|
-
:size="14"/>
|
|
98
|
+
v-if="selectedIds.has(node.id)"
|
|
99
|
+
:class="$style.treeNodeCheck"
|
|
100
|
+
name="check"
|
|
101
|
+
:size="14"/>
|
|
102
|
+
</template>
|
|
103
|
+
</TreeNodeRenderer>
|
|
125
104
|
</div>
|
|
126
105
|
</template>
|
|
127
106
|
</div>
|
|
@@ -133,20 +112,20 @@
|
|
|
133
112
|
<script
|
|
134
113
|
lang="ts"
|
|
135
114
|
setup>
|
|
136
|
-
import { useClickOutside } from '@basmilius/common';
|
|
137
115
|
import { unrefTemplateElement } from '@flux-ui/internals';
|
|
138
|
-
import type { FluxColor, FluxFormTreeViewSelectOption, FluxFormTreeViewSelectValue } from '@flux-ui/types';
|
|
116
|
+
import type { FluxColor, FluxFormInputBaseProps, FluxFormTreeViewSelectOption, FluxFormTreeViewSelectValue } from '@flux-ui/types';
|
|
139
117
|
import { clsx } from 'clsx';
|
|
140
118
|
import { type ComponentPublicInstance, computed, nextTick, ref, toRef, unref, useTemplateRef, watch } from 'vue';
|
|
141
119
|
import { useDisabled, useFormFieldInjection } from '$flux/composable';
|
|
142
|
-
import { flattenAll, flattenVisible, getLevelColor, INITIAL_HIGHLIGHTED_INDEX, useTranslate, useTreeView } from '$flux/composable/private';
|
|
143
120
|
import type { TreeFlatNode } from '$flux/composable/private';
|
|
121
|
+
import { flattenAll, flattenVisible, INITIAL_HIGHLIGHTED_INDEX, useDropdownPopup, useTranslate, useTreeView } from '$flux/composable/private';
|
|
144
122
|
import { FluxFadeTransition } from '$flux/transition';
|
|
145
123
|
import FluxFormInput from '$flux/component/FluxFormInput.vue';
|
|
146
124
|
import FluxIcon from '$flux/component/FluxIcon.vue';
|
|
147
125
|
import FluxTag from '$flux/component/FluxTag.vue';
|
|
148
126
|
import Anchor from '$flux/component/primitive/Anchor.vue';
|
|
149
127
|
import AnchorPopup from '$flux/component/primitive/AnchorPopup.vue';
|
|
128
|
+
import TreeNodeRenderer from '$flux/component/primitive/TreeNodeRenderer.vue';
|
|
150
129
|
import $formStyle from '$flux/css/component/Form.module.scss';
|
|
151
130
|
import $style from '$flux/css/component/TreeViewSelect.module.scss';
|
|
152
131
|
|
|
@@ -156,22 +135,21 @@
|
|
|
156
135
|
inheritAttrs: false
|
|
157
136
|
});
|
|
158
137
|
|
|
159
|
-
const modelValue = defineModel<FluxFormTreeViewSelectValue>({
|
|
138
|
+
const modelValue = defineModel<FluxFormTreeViewSelectValue>({required: true});
|
|
160
139
|
|
|
161
140
|
const {
|
|
162
141
|
disabled: componentDisabled,
|
|
163
142
|
isMultiple,
|
|
143
|
+
isReadonly,
|
|
164
144
|
isSearchable,
|
|
165
145
|
levelColors,
|
|
166
146
|
options,
|
|
167
147
|
placeholder
|
|
168
|
-
} = defineProps<{
|
|
169
|
-
readonly disabled?: boolean;
|
|
148
|
+
} = defineProps<Pick<FluxFormInputBaseProps, 'autoFocus' | 'disabled' | 'error' | 'isCondensed' | 'isLoading' | 'isReadonly' | 'isSecondary' | 'name' | 'placeholder'> & {
|
|
170
149
|
readonly isMultiple?: boolean;
|
|
171
150
|
readonly isSearchable?: boolean;
|
|
172
151
|
readonly levelColors?: (FluxColor | string)[];
|
|
173
152
|
readonly options: FluxFormTreeViewSelectOption[];
|
|
174
|
-
readonly placeholder?: string;
|
|
175
153
|
}>();
|
|
176
154
|
|
|
177
155
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
@@ -179,16 +157,28 @@
|
|
|
179
157
|
const translate = useTranslate();
|
|
180
158
|
|
|
181
159
|
const anchorRef = useTemplateRef<ComponentPublicInstance>('anchor');
|
|
182
|
-
const anchorPopupRef = useTemplateRef('anchorPopup');
|
|
160
|
+
const anchorPopupRef = useTemplateRef<ComponentPublicInstance>('anchorPopup');
|
|
183
161
|
const nodeElementRefs = useTemplateRef<HTMLDivElement[]>('nodeElements');
|
|
184
162
|
const searchInputRef = useTemplateRef<ComponentPublicInstance<typeof FluxFormInput>>('searchInput');
|
|
185
163
|
|
|
186
164
|
const expandedIds = ref(new Set<string | number>());
|
|
187
|
-
const isPopupOpen = ref(false);
|
|
188
165
|
const searchQuery = ref('');
|
|
189
166
|
|
|
190
167
|
const focusElement = computed(() => unrefTemplateElement(searchInputRef) ?? unrefTemplateElement(anchorRef));
|
|
191
168
|
|
|
169
|
+
const {
|
|
170
|
+
isOpen: isPopupOpen,
|
|
171
|
+
toggle,
|
|
172
|
+
focusAnchor,
|
|
173
|
+
onKeyDownBase
|
|
174
|
+
} = useDropdownPopup({
|
|
175
|
+
anchorRef,
|
|
176
|
+
popupRef: anchorPopupRef,
|
|
177
|
+
focusElement,
|
|
178
|
+
disabled,
|
|
179
|
+
readonly: toRef(() => !!isReadonly)
|
|
180
|
+
});
|
|
181
|
+
|
|
192
182
|
const selectedIds = computed(() => {
|
|
193
183
|
const value = unref(modelValue);
|
|
194
184
|
if (Array.isArray(value)) {
|
|
@@ -218,19 +208,9 @@
|
|
|
218
208
|
const {highlightedIndex, toggleExpand, onExpandClick, onKeyNavigate} = useTreeView({
|
|
219
209
|
expandedIds,
|
|
220
210
|
nodeElementRefs,
|
|
221
|
-
visibleNodes
|
|
211
|
+
visibleNodes
|
|
222
212
|
});
|
|
223
213
|
|
|
224
|
-
useClickOutside([anchorRef, anchorPopupRef], isPopupOpen, () => isPopupOpen.value = false);
|
|
225
|
-
useClickOutside(anchorRef, isPopupOpen, () => unref(focusElement)?.focus());
|
|
226
|
-
|
|
227
|
-
function toggle(): void {
|
|
228
|
-
if (unref(disabled)) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
isPopupOpen.value = !unref(isPopupOpen);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
214
|
function select(nodeId: string | number): void {
|
|
235
215
|
if (unref(isMultiple)) {
|
|
236
216
|
const current = [...unref(selectedIds)];
|
|
@@ -250,7 +230,7 @@
|
|
|
250
230
|
if (Array.isArray(current)) {
|
|
251
231
|
modelValue.value = current.filter(v => v !== nodeId);
|
|
252
232
|
}
|
|
253
|
-
|
|
233
|
+
focusAnchor();
|
|
254
234
|
}
|
|
255
235
|
|
|
256
236
|
function onNodeClick(node: FlatNode): void {
|
|
@@ -273,26 +253,20 @@
|
|
|
273
253
|
return;
|
|
274
254
|
}
|
|
275
255
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if (!unref(isMultiple)) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
if (unref(searchQuery).length > 0 || unref(selectedIds).size === 0) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const selectedList = [...unref(selectedIds)];
|
|
285
|
-
deselect(selectedList[selectedList.length - 1]);
|
|
256
|
+
if (evt.key === 'Backspace') {
|
|
257
|
+
if (!unref(isMultiple)) {
|
|
286
258
|
return;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
isPopupOpen.value = false;
|
|
290
|
-
nextTick(() => unrefTemplateElement(anchorRef)?.focus());
|
|
259
|
+
}
|
|
260
|
+
if (unref(searchQuery).length > 0 || unref(selectedIds).size === 0) {
|
|
291
261
|
return;
|
|
262
|
+
}
|
|
263
|
+
const selectedList = [...unref(selectedIds)];
|
|
264
|
+
deselect(selectedList[selectedList.length - 1]);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
292
267
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
return;
|
|
268
|
+
if (onKeyDownBase(evt)) {
|
|
269
|
+
return;
|
|
296
270
|
}
|
|
297
271
|
|
|
298
272
|
// When searchable, don't intercept letter keys — let the search input handle them
|
|
@@ -320,8 +294,6 @@
|
|
|
320
294
|
highlightedIndex.value = firstSelectedIndex;
|
|
321
295
|
}
|
|
322
296
|
}
|
|
323
|
-
|
|
324
|
-
unref(focusElement)?.focus();
|
|
325
297
|
});
|
|
326
298
|
});
|
|
327
299
|
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
<script
|
|
58
58
|
lang="ts"
|
|
59
59
|
setup>
|
|
60
|
+
import type { VNode } from 'vue';
|
|
60
61
|
import type { FluxFocalPointObject } from '@flux-ui/types';
|
|
61
62
|
import { useTranslate } from '$flux/composable/private';
|
|
62
63
|
import FluxDropZone from './FluxDropZone.vue';
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
}>();
|
|
77
78
|
|
|
78
79
|
defineSlots<{
|
|
79
|
-
default():
|
|
80
|
+
default(): VNode[];
|
|
80
81
|
}>();
|
|
81
82
|
|
|
82
83
|
const translate = useTranslate();
|
|
@@ -12,17 +12,18 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
+
import type { VNode } from 'vue';
|
|
15
16
|
import $style from '$flux/css/component/Grid.module.scss';
|
|
16
17
|
|
|
17
18
|
const {
|
|
18
19
|
columns = 12,
|
|
19
|
-
gap =
|
|
20
|
+
gap = 18
|
|
20
21
|
} = defineProps<{
|
|
21
22
|
readonly columns?: number;
|
|
22
23
|
readonly gap?: number;
|
|
23
24
|
}>();
|
|
24
25
|
|
|
25
26
|
defineSlots<{
|
|
26
|
-
default():
|
|
27
|
+
default(): VNode[];
|
|
27
28
|
}>();
|
|
28
29
|
</script>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<script
|
|
16
16
|
lang="ts"
|
|
17
17
|
setup>
|
|
18
|
+
import type { VNode } from 'vue';
|
|
18
19
|
import $style from '$flux/css/component/Grid.module.scss';
|
|
19
20
|
|
|
20
21
|
defineProps<{
|
|
@@ -26,6 +27,6 @@
|
|
|
26
27
|
}>();
|
|
27
28
|
|
|
28
29
|
defineSlots<{
|
|
29
|
-
default():
|
|
30
|
+
default(): VNode[];
|
|
30
31
|
}>();
|
|
31
32
|
</script>
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
scale: definition.scale > 1 ? definition.scale : undefined
|
|
9
9
|
}"
|
|
10
10
|
focusable="false"
|
|
11
|
-
role="img"
|
|
12
|
-
aria-hidden="true"
|
|
11
|
+
:role="ariaLabel ? 'img' : undefined"
|
|
12
|
+
:aria-hidden="ariaLabel ? undefined : true"
|
|
13
|
+
:aria-label="ariaLabel"
|
|
13
14
|
@click="onClick">
|
|
14
15
|
<path
|
|
15
16
|
v-for="path in definition.paths"
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
const {
|
|
39
40
|
name
|
|
40
41
|
} = defineProps<{
|
|
42
|
+
readonly ariaLabel?: string;
|
|
41
43
|
readonly size?: number | string;
|
|
42
44
|
readonly name?: FluxIconName;
|
|
43
45
|
}>();
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<script
|
|
15
15
|
setup
|
|
16
16
|
lang="ts">
|
|
17
|
+
import type { VNode } from 'vue';
|
|
17
18
|
import type { FluxIconName } from '@flux-ui/types';
|
|
18
19
|
import FluxIcon from './FluxIcon.vue';
|
|
19
20
|
import $style from '$flux/css/component/Info.module.scss';
|
|
@@ -23,6 +24,6 @@
|
|
|
23
24
|
}>();
|
|
24
25
|
|
|
25
26
|
defineSlots<{
|
|
26
|
-
default():
|
|
27
|
+
default(): VNode[];
|
|
27
28
|
}>();
|
|
28
29
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FluxStack
|
|
3
3
|
direction="vertical"
|
|
4
|
-
:gap="
|
|
4
|
+
:gap="18">
|
|
5
5
|
<slot/>
|
|
6
6
|
</FluxStack>
|
|
7
7
|
</template>
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
<script
|
|
10
10
|
setup
|
|
11
11
|
lang="ts">
|
|
12
|
+
import type { VNode } from 'vue';
|
|
12
13
|
import FluxStack from './FluxStack.vue';
|
|
13
14
|
|
|
14
15
|
defineSlots<{
|
|
15
|
-
default():
|
|
16
|
+
default(): VNode[];
|
|
16
17
|
}>();
|
|
17
18
|
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.layerPane">
|
|
3
|
+
<slot/>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script
|
|
8
|
+
lang="ts"
|
|
9
|
+
setup>
|
|
10
|
+
import type { VNode } from 'vue';
|
|
11
|
+
import $style from '$flux/css/component/LayerPane.module.scss';
|
|
12
|
+
|
|
13
|
+
defineSlots<{
|
|
14
|
+
default(): VNode[];
|
|
15
|
+
}>();
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.layerPaneSecondary">
|
|
3
|
+
<slot/>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script
|
|
8
|
+
lang="ts"
|
|
9
|
+
setup>
|
|
10
|
+
import type { VNode } from 'vue';
|
|
11
|
+
import $style from '$flux/css/component/LayerPane.module.scss';
|
|
12
|
+
|
|
13
|
+
defineSlots<{
|
|
14
|
+
default(): VNode[];
|
|
15
|
+
}>();
|
|
16
|
+
</script>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="direction === 'horizontal' ? $style.legendHorizontal : $style.legendVertical">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</
|
|
3
|
+
<span
|
|
4
|
+
v-for="(item, index) of items"
|
|
5
|
+
:key="index"
|
|
6
|
+
:class="$style.legendItem"
|
|
7
|
+
:style="{
|
|
8
|
+
'--color': item.color
|
|
9
|
+
}">
|
|
10
|
+
{{ item.label }}
|
|
11
|
+
</span>
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
lang="ts"
|
|
13
13
|
setup>
|
|
14
14
|
import { useFocusZone } from '@flux-ui/internals';
|
|
15
|
-
import { useTemplateRef } from 'vue';
|
|
15
|
+
import { useTemplateRef, type VNode } from 'vue';
|
|
16
16
|
import $style from '$flux/css/component/Menu.module.scss';
|
|
17
17
|
|
|
18
18
|
defineProps<{
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}>();
|
|
21
21
|
|
|
22
22
|
defineSlots<{
|
|
23
|
-
default():
|
|
23
|
+
default(): VNode[];
|
|
24
24
|
}>();
|
|
25
25
|
|
|
26
26
|
const elementRef = useTemplateRef('element');
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="isOpen ? $style.menuCollapsibleOpened : $style.menuCollapsible">
|
|
3
|
+
<FluxMenuItem
|
|
4
|
+
:disabled="disabled"
|
|
5
|
+
:href="href"
|
|
6
|
+
:icon-leading="iconLeading"
|
|
7
|
+
:icon-trailing="isOpen ? 'angle-down' : 'angle-right'"
|
|
8
|
+
:label="label"
|
|
9
|
+
:rel="rel"
|
|
10
|
+
:target="target"
|
|
11
|
+
:to="to"
|
|
12
|
+
:aria-expanded="isOpen"
|
|
13
|
+
:aria-controls="bodyId"
|
|
14
|
+
@click="onHeaderClick">
|
|
15
|
+
<template
|
|
16
|
+
v-if="slots.before"
|
|
17
|
+
#before>
|
|
18
|
+
<slot name="before"/>
|
|
19
|
+
</template>
|
|
20
|
+
</FluxMenuItem>
|
|
21
|
+
|
|
22
|
+
<FluxAutoHeightTransition>
|
|
23
|
+
<div
|
|
24
|
+
v-if="isOpen"
|
|
25
|
+
:id="bodyId"
|
|
26
|
+
:class="$style.menuCollapsibleBody"
|
|
27
|
+
role="group">
|
|
28
|
+
<div :class="$style.menuCollapsibleContent">
|
|
29
|
+
<slot/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</FluxAutoHeightTransition>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script
|
|
37
|
+
lang="ts"
|
|
38
|
+
setup>
|
|
39
|
+
import type { FluxIconName, FluxTo } from '@flux-ui/types';
|
|
40
|
+
import { flattenVNodeTree } from '@flux-ui/internals';
|
|
41
|
+
import { computed, getCurrentInstance, ref, useId, type VNode, watch } from 'vue';
|
|
42
|
+
import { FluxAutoHeightTransition } from '$flux/transition';
|
|
43
|
+
import FluxMenuItem from './FluxMenuItem.vue';
|
|
44
|
+
import $style from '$flux/css/component/Menu.module.scss';
|
|
45
|
+
|
|
46
|
+
type RouteRecordLike = {
|
|
47
|
+
readonly name?: string | symbol | null | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type RouteLike = {
|
|
51
|
+
readonly path: string;
|
|
52
|
+
readonly matched: readonly RouteRecordLike[];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type RouteAwareInstance = {
|
|
56
|
+
readonly $route?: RouteLike;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const emit = defineEmits<{
|
|
60
|
+
toggle: [boolean];
|
|
61
|
+
'update:isOpened': [boolean];
|
|
62
|
+
}>();
|
|
63
|
+
|
|
64
|
+
const {
|
|
65
|
+
href,
|
|
66
|
+
isOpened,
|
|
67
|
+
to
|
|
68
|
+
} = defineProps<{
|
|
69
|
+
readonly disabled?: boolean;
|
|
70
|
+
readonly href?: string;
|
|
71
|
+
readonly iconLeading?: FluxIconName | null;
|
|
72
|
+
readonly isOpened?: boolean;
|
|
73
|
+
readonly label?: string;
|
|
74
|
+
readonly rel?: string;
|
|
75
|
+
readonly target?: string;
|
|
76
|
+
readonly to?: FluxTo;
|
|
77
|
+
}>();
|
|
78
|
+
|
|
79
|
+
const slots = defineSlots<{
|
|
80
|
+
default(): VNode[];
|
|
81
|
+
before(): VNode[];
|
|
82
|
+
}>();
|
|
83
|
+
|
|
84
|
+
const bodyId = useId();
|
|
85
|
+
const instance = getCurrentInstance();
|
|
86
|
+
const isOpen = ref(!!isOpened);
|
|
87
|
+
const route = computed<RouteLike | undefined>(() => (instance?.proxy as RouteAwareInstance | null)?.$route);
|
|
88
|
+
|
|
89
|
+
function open(): void {
|
|
90
|
+
if (isOpen.value) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
isOpen.value = true;
|
|
95
|
+
emit('toggle', true);
|
|
96
|
+
emit('update:isOpened', true);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function close(): void {
|
|
100
|
+
if (!isOpen.value) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
isOpen.value = false;
|
|
105
|
+
emit('toggle', false);
|
|
106
|
+
emit('update:isOpened', false);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function toggle(): void {
|
|
110
|
+
if (isOpen.value) {
|
|
111
|
+
close();
|
|
112
|
+
} else {
|
|
113
|
+
open();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function onHeaderClick(): void {
|
|
118
|
+
if (to || href) {
|
|
119
|
+
open();
|
|
120
|
+
} else {
|
|
121
|
+
toggle();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function matchesRoute(target: unknown, currentRoute: RouteLike | undefined): boolean {
|
|
126
|
+
if (!target || !currentRoute) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (typeof target === 'string') {
|
|
131
|
+
return currentRoute.path === target || currentRoute.path.startsWith(`${target}/`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (typeof target === 'object') {
|
|
135
|
+
const obj = target as Record<string, unknown>;
|
|
136
|
+
|
|
137
|
+
if (typeof obj.path === 'string') {
|
|
138
|
+
return currentRoute.path === obj.path || currentRoute.path.startsWith(`${obj.path}/`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (obj.name && Array.isArray(currentRoute.matched)) {
|
|
142
|
+
return currentRoute.matched.some(record => record.name === obj.name);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
watch(() => isOpened, value => {
|
|
150
|
+
if (value === undefined) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (value) {
|
|
155
|
+
open();
|
|
156
|
+
} else {
|
|
157
|
+
close();
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
watch(route, currentRoute => {
|
|
162
|
+
if (!currentRoute) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const vnodes = flattenVNodeTree(slots.default?.() ?? []);
|
|
167
|
+
|
|
168
|
+
for (const vnode of vnodes) {
|
|
169
|
+
const childTo = vnode.props?.to;
|
|
170
|
+
const childHref = vnode.props?.href;
|
|
171
|
+
|
|
172
|
+
if (matchesRoute(childTo, currentRoute) || matchesRoute(childHref, currentRoute)) {
|
|
173
|
+
open();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
immediate: true
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
defineExpose({
|
|
182
|
+
isOpen,
|
|
183
|
+
open,
|
|
184
|
+
close,
|
|
185
|
+
toggle
|
|
186
|
+
});
|
|
187
|
+
</script>
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
<script
|
|
10
10
|
lang="ts"
|
|
11
11
|
setup>
|
|
12
|
+
import type { VNode } from 'vue';
|
|
12
13
|
import $style from '$flux/css/component/Menu.module.scss';
|
|
13
14
|
|
|
14
15
|
defineProps<{
|
|
@@ -16,6 +17,6 @@
|
|
|
16
17
|
}>();
|
|
17
18
|
|
|
18
19
|
defineSlots<{
|
|
19
|
-
default():
|
|
20
|
+
default(): VNode[];
|
|
20
21
|
}>();
|
|
21
22
|
</script>
|
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
:alt="imageAlt ?? ''"/>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
+
<template
|
|
37
|
+
v-else-if="slots.before"
|
|
38
|
+
#iconLeading>
|
|
39
|
+
<slot name="before"/>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
36
42
|
<template
|
|
37
43
|
v-if="command || commandIcon || commandLoading || slots.after"
|
|
38
44
|
#after>
|
|
@@ -62,6 +68,7 @@
|
|
|
62
68
|
<script
|
|
63
69
|
lang="ts"
|
|
64
70
|
setup>
|
|
71
|
+
import type { VNode } from 'vue';
|
|
65
72
|
import type { FluxButtonEmits, FluxButtonProps, FluxIconName } from '@flux-ui/types';
|
|
66
73
|
import FluxButton from './FluxButton.vue';
|
|
67
74
|
import FluxIcon from './FluxIcon.vue';
|
|
@@ -71,7 +78,8 @@
|
|
|
71
78
|
defineEmits<FluxButtonEmits>();
|
|
72
79
|
|
|
73
80
|
const slots = defineSlots<{
|
|
74
|
-
after():
|
|
81
|
+
after(): VNode[];
|
|
82
|
+
before(): VNode[];
|
|
75
83
|
}>();
|
|
76
84
|
|
|
77
85
|
const {
|