@flux-ui/components 3.0.0-next.35 → 3.0.0-next.39
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 +7105 -6275
- 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
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<template #opener="{open}">
|
|
11
11
|
<FluxFormInputGroup>
|
|
12
12
|
<FluxFormInput
|
|
13
|
-
:="{autoFocus,
|
|
13
|
+
:="{autoFocus, error, isCondensed, isLoading, isReadonly, isSecondary, name, placeholder}"
|
|
14
14
|
:class="$style.formDateInput"
|
|
15
15
|
:disabled="disabled"
|
|
16
16
|
:model-value="localValue"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
@show-picker="open"/>
|
|
20
20
|
|
|
21
21
|
<FluxSecondaryButton
|
|
22
|
-
:disabled="disabled"
|
|
22
|
+
:disabled="disabled || isReadonly"
|
|
23
23
|
icon-leading="calendar"
|
|
24
24
|
@click.prevent="open"/>
|
|
25
25
|
</FluxFormInputGroup>
|
|
@@ -33,8 +33,10 @@
|
|
|
33
33
|
</FluxFlyout>
|
|
34
34
|
|
|
35
35
|
<FluxFormInput
|
|
36
|
-
:="{
|
|
36
|
+
:="{error, isCondensed, isLoading, isReadonly, isSecondary, placeholder}"
|
|
37
37
|
:class="$style.formTimeInput"
|
|
38
|
+
:disabled="disabled"
|
|
39
|
+
:name="name ? `${name}-time` : undefined"
|
|
38
40
|
type="time"
|
|
39
41
|
:model-value="localValue"
|
|
40
42
|
@update:model-value="setTime"/>
|
|
@@ -44,10 +46,11 @@
|
|
|
44
46
|
<script
|
|
45
47
|
lang="ts"
|
|
46
48
|
setup>
|
|
47
|
-
import type { FluxAutoCompleteType } from '@flux-ui/types';
|
|
49
|
+
import type { FluxAutoCompleteType, FluxFormInputBaseProps } from '@flux-ui/types';
|
|
48
50
|
import { DateTime } from 'luxon';
|
|
49
|
-
import {
|
|
51
|
+
import { toRef, unref, useTemplateRef, watch } from 'vue';
|
|
50
52
|
import { useDisabled } from '$flux/composable';
|
|
53
|
+
import { useDateFlyout } from '$flux/composable/private';
|
|
51
54
|
import FluxDatePicker from './FluxDatePicker.vue';
|
|
52
55
|
import FluxFlyout from './FluxFlyout.vue';
|
|
53
56
|
import FluxFormInput from './FluxFormInput.vue';
|
|
@@ -63,21 +66,20 @@
|
|
|
63
66
|
const {
|
|
64
67
|
disabled: componentDisabled,
|
|
65
68
|
isHourOnly
|
|
66
|
-
} = defineProps<{
|
|
69
|
+
} = defineProps<FluxFormInputBaseProps & {
|
|
67
70
|
readonly autoComplete?: FluxAutoCompleteType;
|
|
68
|
-
readonly autoFocus?: boolean;
|
|
69
|
-
readonly disabled?: boolean;
|
|
70
71
|
readonly isHourOnly?: boolean;
|
|
71
|
-
readonly isReadonly?: boolean;
|
|
72
72
|
readonly max?: DateTime;
|
|
73
73
|
readonly min?: DateTime;
|
|
74
|
-
readonly placeholder?: string;
|
|
75
74
|
}>();
|
|
76
75
|
|
|
77
76
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
78
77
|
const flyoutRef = useTemplateRef<{ close(): void; }>('flyout');
|
|
79
78
|
|
|
80
|
-
const localValue =
|
|
79
|
+
const localValue = useDateFlyout(modelValue, flyoutRef, {
|
|
80
|
+
compareKey: value => value?.toISO(),
|
|
81
|
+
transformIn: value => isHourOnly ? value?.startOf('hour') ?? null : value
|
|
82
|
+
});
|
|
81
83
|
|
|
82
84
|
function setDate(dateTime: DateTime | object | string | number | null): void {
|
|
83
85
|
if (!DateTime.isDateTime(dateTime)) {
|
|
@@ -105,16 +107,11 @@
|
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
watch(() => isHourOnly, () =>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
watch(localValue, localValue => {
|
|
112
|
-
unref(flyoutRef)?.close();
|
|
113
|
-
|
|
114
|
-
if (modelValue.value?.toISO() === localValue?.toISO()) {
|
|
110
|
+
watch(() => isHourOnly, () => {
|
|
111
|
+
if (!isHourOnly) {
|
|
115
112
|
return;
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
|
|
119
|
-
});
|
|
115
|
+
localValue.value = unref(localValue)?.startOf('hour') ?? null;
|
|
116
|
+
}, {immediate: true});
|
|
120
117
|
</script>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<script
|
|
51
51
|
lang="ts"
|
|
52
52
|
setup>
|
|
53
|
-
import { provide, useId } from 'vue';
|
|
53
|
+
import { provide, useId, type VNode } from 'vue';
|
|
54
54
|
import { useTranslate } from '$flux/composable/private';
|
|
55
55
|
import { FluxFormFieldInjectionKey } from '$flux/data';
|
|
56
56
|
import FluxFormFieldAddition from './FluxFormFieldAddition.vue';
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
const slots = defineSlots<{
|
|
69
69
|
default(props: {
|
|
70
70
|
readonly id?: string;
|
|
71
|
-
}):
|
|
71
|
+
}): VNode[];
|
|
72
72
|
|
|
73
73
|
addition(props: {
|
|
74
74
|
readonly currentLength?: number;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
readonly isOptional?: boolean;
|
|
78
78
|
readonly label: string;
|
|
79
79
|
readonly maxLength?: number;
|
|
80
|
-
}):
|
|
80
|
+
}): VNode[];
|
|
81
81
|
|
|
82
82
|
value(props: {
|
|
83
83
|
readonly currentLength?: number;
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
readonly isOptional?: boolean;
|
|
87
87
|
readonly label: string;
|
|
88
88
|
readonly maxLength?: number;
|
|
89
|
-
}):
|
|
89
|
+
}): VNode[];
|
|
90
90
|
}>();
|
|
91
91
|
|
|
92
92
|
const id = useId();
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<script
|
|
12
12
|
lang="ts"
|
|
13
13
|
setup>
|
|
14
|
+
import type { VNode } from 'vue';
|
|
14
15
|
import $style from '$flux/css/component/Form.module.scss';
|
|
15
16
|
|
|
16
17
|
defineProps<{
|
|
@@ -18,6 +19,6 @@
|
|
|
18
19
|
}>();
|
|
19
20
|
|
|
20
21
|
defineSlots<{
|
|
21
|
-
default():
|
|
22
|
+
default(): VNode[];
|
|
22
23
|
}>();
|
|
23
24
|
</script>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
:class="clsx(
|
|
4
4
|
disabled ? $style.formInputDisabled : $style.formInputEnabled,
|
|
5
5
|
isCondensed && $style.isCondensed,
|
|
6
|
-
isSecondary && $style.isSecondary
|
|
6
|
+
isSecondary && $style.isSecondary,
|
|
7
|
+
error && $style.isInvalid
|
|
7
8
|
)"
|
|
8
9
|
:aria-disabled="disabled ? true : undefined">
|
|
9
10
|
<input
|
|
@@ -14,9 +15,11 @@
|
|
|
14
15
|
!!iconLeading && $style.formInputNativeHasIconLeading
|
|
15
16
|
)"
|
|
16
17
|
:id="id"
|
|
18
|
+
:name="name"
|
|
17
19
|
:autocomplete="autoComplete"
|
|
18
20
|
:autofocus="autoFocus"
|
|
19
21
|
:aria-disabled="disabled ? true : undefined"
|
|
22
|
+
:aria-invalid="error ? true : undefined"
|
|
20
23
|
:disabled="disabled"
|
|
21
24
|
:max="max"
|
|
22
25
|
:maxlength="maxLength"
|
|
@@ -61,7 +64,7 @@
|
|
|
61
64
|
lang="ts"
|
|
62
65
|
setup>
|
|
63
66
|
import { unrefTemplateElement } from '@flux-ui/internals';
|
|
64
|
-
import type { FluxAutoCompleteType, FluxIconName, FluxInputMask, FluxInputType } from '@flux-ui/types';
|
|
67
|
+
import type { FluxAutoCompleteType, FluxFormInputBaseProps, FluxIconName, FluxInputMask, FluxInputType } from '@flux-ui/types';
|
|
65
68
|
import { clsx } from 'clsx';
|
|
66
69
|
import { DateTime } from 'luxon';
|
|
67
70
|
import { ref, toRef, unref, useTemplateRef, watch } from 'vue';
|
|
@@ -84,23 +87,17 @@
|
|
|
84
87
|
const {
|
|
85
88
|
autoFocus = false,
|
|
86
89
|
disabled: componentDisabled,
|
|
90
|
+
isReadonly,
|
|
87
91
|
pattern,
|
|
88
92
|
type = 'text'
|
|
89
|
-
} = defineProps<{
|
|
93
|
+
} = defineProps<FluxFormInputBaseProps & {
|
|
90
94
|
readonly autoComplete?: FluxAutoCompleteType;
|
|
91
|
-
readonly autoFocus?: boolean;
|
|
92
95
|
readonly iconLeading?: FluxIconName;
|
|
93
96
|
readonly iconTrailing?: FluxIconName;
|
|
94
|
-
readonly disabled?: boolean;
|
|
95
|
-
readonly isCondensed?: boolean;
|
|
96
|
-
readonly isLoading?: boolean;
|
|
97
|
-
readonly isReadonly?: boolean;
|
|
98
|
-
readonly isSecondary?: boolean;
|
|
99
97
|
readonly max?: string | number;
|
|
100
98
|
readonly maxLength?: number;
|
|
101
99
|
readonly min?: string | number;
|
|
102
100
|
readonly pattern?: FluxInputMask;
|
|
103
|
-
readonly placeholder?: string;
|
|
104
101
|
readonly step?: number;
|
|
105
102
|
readonly type?: FluxInputType;
|
|
106
103
|
}>();
|
|
@@ -165,6 +162,10 @@
|
|
|
165
162
|
}
|
|
166
163
|
|
|
167
164
|
function onKeyDown(evt: KeyboardEvent): void {
|
|
165
|
+
if (isReadonly) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
168
169
|
if (!['date', 'datetime-local', 'month', 'week'].includes(type)) {
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
<script
|
|
17
17
|
lang="ts"
|
|
18
18
|
setup>
|
|
19
|
+
import type { VNode } from 'vue';
|
|
19
20
|
import type { FluxIconName } from '@flux-ui/types';
|
|
20
21
|
import FluxIcon from './FluxIcon.vue';
|
|
21
22
|
import $style from '$flux/css/component/Form.module.scss';
|
|
@@ -26,6 +27,6 @@
|
|
|
26
27
|
}>();
|
|
27
28
|
|
|
28
29
|
defineSlots<{
|
|
29
|
-
default():
|
|
30
|
+
default(): VNode[];
|
|
30
31
|
}>();
|
|
31
32
|
</script>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
isCondensed && $style.isCondensed,
|
|
6
6
|
isSecondary && $style.isSecondary
|
|
7
7
|
)"
|
|
8
|
-
role="
|
|
8
|
+
role="group">
|
|
9
9
|
<slot/>
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<script
|
|
14
14
|
lang="ts"
|
|
15
15
|
setup>
|
|
16
|
+
import type { VNode } from 'vue';
|
|
16
17
|
import { clsx } from 'clsx';
|
|
17
18
|
import $style from '$flux/css/component/Form.module.scss';
|
|
18
19
|
|
|
@@ -22,6 +23,6 @@
|
|
|
22
23
|
}>();
|
|
23
24
|
|
|
24
25
|
defineSlots<{
|
|
25
|
-
default():
|
|
26
|
+
default(): VNode[];
|
|
26
27
|
}>();
|
|
27
28
|
</script>
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<fieldset
|
|
3
|
-
:class="
|
|
3
|
+
:class="clsx(
|
|
4
|
+
disabled ? $style.pinInputDisabled : $style.pinInputEnabled,
|
|
5
|
+
error && $style.isInvalid
|
|
6
|
+
)"
|
|
4
7
|
:id="id"
|
|
8
|
+
:name="name"
|
|
5
9
|
:style="{
|
|
6
10
|
'--max-length': maxLength
|
|
7
11
|
}"
|
|
8
12
|
:autofocus="autoFocus"
|
|
9
|
-
:aria-disabled="disabled ? true : undefined"
|
|
13
|
+
:aria-disabled="disabled ? true : undefined"
|
|
14
|
+
:aria-invalid="error ? true : undefined">
|
|
10
15
|
<input
|
|
11
16
|
v-for="field of maxLength"
|
|
12
17
|
:key="field"
|
|
13
18
|
ref="fields"
|
|
14
19
|
:class="$style.pinInputField"
|
|
15
20
|
maxlength="1"
|
|
21
|
+
:aria-label="translate('flux.pinDigit', {index: field, total: maxLength})"
|
|
16
22
|
:autocomplete="field === 1 ? autoComplete : undefined"
|
|
17
23
|
:autofocus="field === 1 && autoFocus"
|
|
18
24
|
:disabled="disabled"
|
|
25
|
+
:readonly="isReadonly"
|
|
19
26
|
:tabindex="(field - 1) === modelValue?.length ? 0 : -1"
|
|
20
27
|
:type="isPrivate ? 'password' : 'text'"
|
|
21
28
|
:value="modelValue[field - 1]"
|
|
@@ -29,9 +36,11 @@
|
|
|
29
36
|
<script
|
|
30
37
|
lang="ts"
|
|
31
38
|
setup>
|
|
32
|
-
import type { FluxAutoCompleteType } from '@flux-ui/types';
|
|
39
|
+
import type { FluxAutoCompleteType, FluxFormInputBaseProps } from '@flux-ui/types';
|
|
40
|
+
import { clsx } from 'clsx';
|
|
33
41
|
import { toRef, unref, useTemplateRef } from 'vue';
|
|
34
42
|
import { useDisabled, useFormFieldInjection } from '$flux/composable';
|
|
43
|
+
import { useTranslate } from '$flux/composable/private';
|
|
35
44
|
import $style from '$flux/css/component/Form.module.scss';
|
|
36
45
|
|
|
37
46
|
const modelValue = defineModel<string>({
|
|
@@ -43,16 +52,15 @@
|
|
|
43
52
|
autoFocus = false,
|
|
44
53
|
disabled: componentDisabled,
|
|
45
54
|
maxLength = 6
|
|
46
|
-
} = defineProps<{
|
|
55
|
+
} = defineProps<Pick<FluxFormInputBaseProps, 'autoFocus' | 'disabled' | 'error' | 'isLoading' | 'isReadonly' | 'name'> & {
|
|
47
56
|
readonly autoComplete?: FluxAutoCompleteType;
|
|
48
|
-
readonly autoFocus?: boolean;
|
|
49
|
-
readonly disabled?: boolean;
|
|
50
57
|
readonly isPrivate?: boolean;
|
|
51
58
|
readonly maxLength?: number;
|
|
52
59
|
}>();
|
|
53
60
|
|
|
54
61
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
55
62
|
const {id} = useFormFieldInjection();
|
|
63
|
+
const translate = useTranslate();
|
|
56
64
|
|
|
57
65
|
const fieldRefs = useTemplateRef<HTMLInputElement[]>('fields');
|
|
58
66
|
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
:percentage-upper="percentageUpper">
|
|
14
14
|
<SliderThumb
|
|
15
15
|
ref="lowerThumb"
|
|
16
|
+
:aria-label="translate('flux.lowerBound')"
|
|
17
|
+
:aria-valuemax="max"
|
|
18
|
+
:aria-valuemin="min"
|
|
19
|
+
:aria-valuenow="modelValue[0]"
|
|
16
20
|
:disabled="disabled"
|
|
17
21
|
:is-dragging="isDraggingLower"
|
|
18
22
|
:position="percentageLower"
|
|
@@ -22,6 +26,10 @@
|
|
|
22
26
|
|
|
23
27
|
<SliderThumb
|
|
24
28
|
ref="upperThumb"
|
|
29
|
+
:aria-label="translate('flux.upperBound')"
|
|
30
|
+
:aria-valuemax="max"
|
|
31
|
+
:aria-valuemin="min"
|
|
32
|
+
:aria-valuenow="modelValue[1]"
|
|
25
33
|
:disabled="disabled"
|
|
26
34
|
:is-dragging="isDraggingUpper"
|
|
27
35
|
:position="percentageUpper"
|
|
@@ -36,8 +44,10 @@
|
|
|
36
44
|
lang="ts"
|
|
37
45
|
setup>
|
|
38
46
|
import { clampWithStepPrecision, countDecimals, formatNumber } from '@basmilius/utils';
|
|
47
|
+
import type { FluxFormInputBaseProps } from '@flux-ui/types';
|
|
39
48
|
import { computed, ref, toRef, unref, useTemplateRef, watch } from 'vue';
|
|
40
49
|
import { useDisabled } from '$flux/composable';
|
|
50
|
+
import { useTranslate } from '$flux/composable/private';
|
|
41
51
|
import { addTooltip, removeTooltip, updateTooltip } from '$flux/data';
|
|
42
52
|
import { SliderBase, SliderThumb, SliderTrack } from './primitive';
|
|
43
53
|
|
|
@@ -52,10 +62,9 @@
|
|
|
52
62
|
max = 100,
|
|
53
63
|
min = 0,
|
|
54
64
|
step = 1
|
|
55
|
-
} = defineProps<{
|
|
65
|
+
} = defineProps<Pick<FluxFormInputBaseProps, 'disabled' | 'error' | 'isLoading' | 'isReadonly' | 'name'> & {
|
|
56
66
|
formatter?(value: number, decimals?: number): string;
|
|
57
67
|
|
|
58
|
-
readonly disabled?: boolean;
|
|
59
68
|
readonly isTicksVisible?: boolean;
|
|
60
69
|
readonly isTooltipDisabled?: boolean;
|
|
61
70
|
readonly max?: number;
|
|
@@ -66,6 +75,7 @@
|
|
|
66
75
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
67
76
|
const lowerThumbRef = useTemplateRef('lowerThumb');
|
|
68
77
|
const upperThumbRef = useTemplateRef('upperThumb');
|
|
78
|
+
const translate = useTranslate();
|
|
69
79
|
|
|
70
80
|
const isDraggingLower = ref(false);
|
|
71
81
|
const isDraggingUpper = ref(false);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.formSection">
|
|
3
|
-
<
|
|
3
|
+
<h3 :class="$style.formSectionTitle">
|
|
4
4
|
{{ title }}
|
|
5
|
-
</
|
|
5
|
+
</h3>
|
|
6
6
|
|
|
7
7
|
<slot/>
|
|
8
8
|
</div>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<script
|
|
12
12
|
lang="ts"
|
|
13
13
|
setup>
|
|
14
|
+
import type { VNode } from 'vue';
|
|
14
15
|
import $style from '$flux/css/component/Form.module.scss';
|
|
15
16
|
|
|
16
17
|
defineProps<{
|
|
@@ -18,6 +19,6 @@
|
|
|
18
19
|
}>();
|
|
19
20
|
|
|
20
21
|
defineSlots<{
|
|
21
|
-
default():
|
|
22
|
+
default(): VNode[];
|
|
22
23
|
}>();
|
|
23
24
|
</script>
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<SelectBase
|
|
3
3
|
v-model:searchQuery="modelSearch"
|
|
4
|
+
:aria-invalid="error ? true : undefined"
|
|
5
|
+
:class="clsx(
|
|
6
|
+
isCondensed && $formStyle.isCondensed,
|
|
7
|
+
isSecondary && $formStyle.isSecondary,
|
|
8
|
+
error && $formStyle.isInvalid
|
|
9
|
+
)"
|
|
4
10
|
:disabled="disabled"
|
|
11
|
+
:is-loading="isLoading"
|
|
5
12
|
:is-multiple="isMultiple"
|
|
6
13
|
:is-searchable="isSearchable"
|
|
7
14
|
:options="groups"
|
|
@@ -14,11 +21,13 @@
|
|
|
14
21
|
<script
|
|
15
22
|
lang="ts"
|
|
16
23
|
setup>
|
|
17
|
-
import type { FluxFormSelectEntry, FluxFormSelectValue } from '@flux-ui/types';
|
|
24
|
+
import type { FluxFormInputBaseProps, FluxFormSelectEntry, FluxFormSelectValue } from '@flux-ui/types';
|
|
25
|
+
import { clsx } from 'clsx';
|
|
18
26
|
import { toRef, unref } from 'vue';
|
|
19
27
|
import { SelectBase } from '$flux/component/primitive';
|
|
20
28
|
import { useDisabled } from '$flux/composable';
|
|
21
29
|
import { useFormSelect } from '$flux/composable/private';
|
|
30
|
+
import $formStyle from '$flux/css/component/Form.module.scss';
|
|
22
31
|
|
|
23
32
|
const modelSearch = defineModel<string>('searchQuery', {
|
|
24
33
|
default: ''
|
|
@@ -32,10 +41,8 @@
|
|
|
32
41
|
disabled: componentDisabled,
|
|
33
42
|
isMultiple,
|
|
34
43
|
options
|
|
35
|
-
} = defineProps<{
|
|
36
|
-
readonly disabled?: boolean;
|
|
44
|
+
} = defineProps<Pick<FluxFormInputBaseProps, 'autoFocus' | 'disabled' | 'error' | 'isCondensed' | 'isLoading' | 'isReadonly' | 'isSecondary' | 'name' | 'placeholder'> & {
|
|
37
45
|
readonly isMultiple?: boolean;
|
|
38
|
-
readonly placeholder?: string;
|
|
39
46
|
readonly isSearchable?: boolean;
|
|
40
47
|
readonly options: FluxFormSelectEntry[];
|
|
41
48
|
}>();
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<SelectBase
|
|
3
3
|
v-model:search-query="modelSearch"
|
|
4
|
+
:aria-invalid="error ? true : undefined"
|
|
5
|
+
:class="clsx(
|
|
6
|
+
isCondensed && $formStyle.isCondensed,
|
|
7
|
+
isSecondary && $formStyle.isSecondary,
|
|
8
|
+
error && $formStyle.isInvalid
|
|
9
|
+
)"
|
|
4
10
|
:disabled="disabled"
|
|
5
|
-
:is-loading="isLoading"
|
|
11
|
+
:is-loading="isLoading || isFetchingLoading"
|
|
6
12
|
:is-multiple="isMultiple"
|
|
7
13
|
is-searchable
|
|
8
14
|
:options="groups"
|
|
@@ -17,12 +23,14 @@
|
|
|
17
23
|
lang="ts"
|
|
18
24
|
setup>
|
|
19
25
|
import { useDebouncedRef, useLoaded } from '@basmilius/common';
|
|
20
|
-
import type { FluxFormSelectEntry, FluxFormSelectValue, FluxFormSelectValueSingle } from '@flux-ui/types';
|
|
21
|
-
import {
|
|
26
|
+
import type { FluxFormInputBaseProps, FluxFormSelectEntry, FluxFormSelectValue, FluxFormSelectValueSingle } from '@flux-ui/types';
|
|
27
|
+
import { clsx } from 'clsx';
|
|
28
|
+
import { computed, type Ref, ref, toRef, unref, watch } from 'vue';
|
|
22
29
|
import { SelectBase } from '$flux/component/primitive';
|
|
23
30
|
import { useDisabled } from '$flux/composable';
|
|
24
31
|
import { useFormSelect } from '$flux/composable/private';
|
|
25
32
|
import { isFluxFormSelectOption } from '$flux/data';
|
|
33
|
+
import $formStyle from '$flux/css/component/Form.module.scss';
|
|
26
34
|
|
|
27
35
|
const modelSearch = defineModel<string>('searchQuery', {
|
|
28
36
|
default: ''
|
|
@@ -38,14 +46,12 @@
|
|
|
38
46
|
fetchSearch: fetchSearchProp,
|
|
39
47
|
disabled: componentDisabled,
|
|
40
48
|
isMultiple
|
|
41
|
-
} = defineProps<{
|
|
49
|
+
} = defineProps<Pick<FluxFormInputBaseProps, 'autoFocus' | 'disabled' | 'error' | 'isCondensed' | 'isLoading' | 'isReadonly' | 'isSecondary' | 'name' | 'placeholder'> & {
|
|
42
50
|
fetchOptions(ids: FluxFormSelectValueSingle[]): Promise<FluxFormSelectEntry[]>;
|
|
43
51
|
fetchRelevant(): Promise<FluxFormSelectEntry[]>;
|
|
44
52
|
fetchSearch(searchQuery: string): Promise<FluxFormSelectEntry[]>;
|
|
45
53
|
|
|
46
|
-
readonly disabled?: boolean;
|
|
47
54
|
readonly isMultiple?: boolean;
|
|
48
|
-
readonly placeholder?: string;
|
|
49
55
|
}>();
|
|
50
56
|
|
|
51
57
|
const disabled = useDisabled(toRef(() => componentDisabled));
|
|
@@ -76,8 +82,8 @@
|
|
|
76
82
|
});
|
|
77
83
|
|
|
78
84
|
const {groups, selected, values} = useFormSelect(modelValue, isMultiple, options);
|
|
79
|
-
const {isLoading, loaded} = useLoaded();
|
|
80
|
-
const debouncedModelSearch = useDebouncedRef(modelSearch, 300)
|
|
85
|
+
const {isLoading: isFetchingLoading, loaded} = useLoaded();
|
|
86
|
+
const debouncedModelSearch = useDebouncedRef(modelSearch, 300) as unknown as Ref<string>;
|
|
81
87
|
const fetchOptions = computed(() => loaded(fetchOptionsProp));
|
|
82
88
|
const fetchRelevant = computed(() => loaded(fetchRelevantProp));
|
|
83
89
|
const fetchSearch = computed(() => loaded(fetchSearchProp));
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
:percentage-upper="percentage">
|
|
14
14
|
<SliderThumb
|
|
15
15
|
ref="thumb"
|
|
16
|
+
:aria-label="ariaLabel"
|
|
17
|
+
:aria-valuemax="max"
|
|
18
|
+
:aria-valuemin="min"
|
|
19
|
+
:aria-valuenow="modelValue"
|
|
16
20
|
:disabled="disabled"
|
|
17
21
|
:is-dragging="isDragging"
|
|
18
22
|
:position="percentage"
|
|
@@ -26,6 +30,7 @@
|
|
|
26
30
|
lang="ts"
|
|
27
31
|
setup>
|
|
28
32
|
import { clampWithStepPrecision, countDecimals, formatNumber } from '@basmilius/utils';
|
|
33
|
+
import type { FluxFormInputBaseProps } from '@flux-ui/types';
|
|
29
34
|
import { computed, ref, toRef, unref, useTemplateRef, watch, watchEffect } from 'vue';
|
|
30
35
|
import { useDisabled } from '$flux/composable';
|
|
31
36
|
import { addTooltip, removeTooltip, updateTooltip } from '$flux/data';
|
|
@@ -36,16 +41,17 @@
|
|
|
36
41
|
});
|
|
37
42
|
|
|
38
43
|
const {
|
|
44
|
+
ariaLabel,
|
|
39
45
|
formatter = formatNumber,
|
|
40
46
|
disabled: componentDisabled = false,
|
|
41
47
|
isTooltipDisabled,
|
|
42
48
|
max = 100,
|
|
43
49
|
min = 0,
|
|
44
50
|
step = 1
|
|
45
|
-
} = defineProps<{
|
|
51
|
+
} = defineProps<Pick<FluxFormInputBaseProps, 'disabled' | 'error' | 'isLoading' | 'isReadonly' | 'name'> & {
|
|
46
52
|
formatter?(value: number, decimals?: number): string;
|
|
47
53
|
|
|
48
|
-
readonly
|
|
54
|
+
readonly ariaLabel?: string;
|
|
49
55
|
readonly isTicksVisible?: boolean;
|
|
50
56
|
readonly isTooltipDisabled?: boolean;
|
|
51
57
|
readonly max?: number;
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
<textarea
|
|
3
3
|
v-model="modelValue"
|
|
4
4
|
ref="input"
|
|
5
|
-
:class="
|
|
5
|
+
:class="clsx(
|
|
6
|
+
disabled ? $style.formTextAreaDisabled : $style.formTextAreaEnabled,
|
|
7
|
+
isCondensed && $style.isCondensed,
|
|
8
|
+
isSecondary && $style.isSecondary,
|
|
9
|
+
error && $style.isInvalid
|
|
10
|
+
)"
|
|
6
11
|
:id="id"
|
|
12
|
+
:name="name"
|
|
7
13
|
:autocomplete="autoComplete"
|
|
8
14
|
:autofocus="autoFocus"
|
|
9
15
|
:disabled="disabled"
|
|
@@ -14,6 +20,8 @@
|
|
|
14
20
|
'--rows': rows
|
|
15
21
|
}"
|
|
16
22
|
:aria-disabled="disabled ? true : undefined"
|
|
23
|
+
:aria-readonly="isReadonly || undefined"
|
|
24
|
+
:aria-invalid="error ? true : undefined"
|
|
17
25
|
@blur="emit('blur')"
|
|
18
26
|
@focus="emit('focus')"/>
|
|
19
27
|
</template>
|
|
@@ -21,7 +29,8 @@
|
|
|
21
29
|
<script
|
|
22
30
|
lang="ts"
|
|
23
31
|
setup>
|
|
24
|
-
import type { FluxAutoCompleteType } from '@flux-ui/types';
|
|
32
|
+
import type { FluxAutoCompleteType, FluxFormInputBaseProps } from '@flux-ui/types';
|
|
33
|
+
import { clsx } from 'clsx';
|
|
25
34
|
import { toRef } from 'vue';
|
|
26
35
|
import { useDisabled, useFormFieldInjection } from '$flux/composable';
|
|
27
36
|
import $style from '$flux/css/component/Form.module.scss';
|
|
@@ -39,13 +48,9 @@
|
|
|
39
48
|
autoFocus = false,
|
|
40
49
|
disabled: componentDisabled,
|
|
41
50
|
rows = 3
|
|
42
|
-
} = defineProps<{
|
|
51
|
+
} = defineProps<FluxFormInputBaseProps & {
|
|
43
52
|
readonly autoComplete?: FluxAutoCompleteType;
|
|
44
|
-
readonly autoFocus?: boolean;
|
|
45
|
-
readonly disabled?: boolean;
|
|
46
|
-
readonly isReadonly?: boolean;
|
|
47
53
|
readonly maxLength?: number;
|
|
48
|
-
readonly placeholder?: string;
|
|
49
54
|
readonly rows?: number;
|
|
50
55
|
}>();
|
|
51
56
|
|