@flux-ui/components 3.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/package.json +77 -0
- package/src/component/FluxAction.vue +27 -0
- package/src/component/FluxActionBar.vue +94 -0
- package/src/component/FluxActionPane.vue +40 -0
- package/src/component/FluxActions.vue +27 -0
- package/src/component/FluxAlert.vue +37 -0
- package/src/component/FluxAnimatedColors.vue +141 -0
- package/src/component/FluxAspectRatio.vue +21 -0
- package/src/component/FluxAutoGrid.vue +27 -0
- package/src/component/FluxAvatar.vue +119 -0
- package/src/component/FluxBadge.vue +84 -0
- package/src/component/FluxBadgeStack.vue +18 -0
- package/src/component/FluxBorderShine.vue +36 -0
- package/src/component/FluxBoxedIcon.vue +36 -0
- package/src/component/FluxButton.vue +110 -0
- package/src/component/FluxButtonGroup.vue +15 -0
- package/src/component/FluxButtonStack.vue +28 -0
- package/src/component/FluxCalendar.vue +254 -0
- package/src/component/FluxCalendarEvent.vue +41 -0
- package/src/component/FluxCheckbox.vue +60 -0
- package/src/component/FluxChip.vue +57 -0
- package/src/component/FluxClickablePane.vue +61 -0
- package/src/component/FluxColorPicker.vue +265 -0
- package/src/component/FluxColorSelect.vue +81 -0
- package/src/component/FluxComment.vue +71 -0
- package/src/component/FluxConfirm.vue +42 -0
- package/src/component/FluxContainer.vue +23 -0
- package/src/component/FluxDataTable.vue +96 -0
- package/src/component/FluxDatePicker.vue +353 -0
- package/src/component/FluxDestructiveButton.vue +28 -0
- package/src/component/FluxDisabled.vue +22 -0
- package/src/component/FluxDivider.vue +37 -0
- package/src/component/FluxDotPattern.vue +72 -0
- package/src/component/FluxDropZone.vue +202 -0
- package/src/component/FluxDynamicView.vue +16 -0
- package/src/component/FluxExpandable.vue +119 -0
- package/src/component/FluxExpandableGroup.vue +53 -0
- package/src/component/FluxFader.vue +64 -0
- package/src/component/FluxFaderItem.vue +15 -0
- package/src/component/FluxFilter.vue +133 -0
- package/src/component/FluxFilterDate.vue +58 -0
- package/src/component/FluxFilterDateRange.vue +59 -0
- package/src/component/FluxFilterOption.vue +49 -0
- package/src/component/FluxFilterOptionAsync.vue +103 -0
- package/src/component/FluxFilterOptions.vue +62 -0
- package/src/component/FluxFilterOptionsAsync.vue +113 -0
- package/src/component/FluxFilterRange.vue +91 -0
- package/src/component/FluxFlickeringGrid.vue +141 -0
- package/src/component/FluxFlyout.vue +205 -0
- package/src/component/FluxFocalPointEditor.vue +137 -0
- package/src/component/FluxFocalPointImage.vue +29 -0
- package/src/component/FluxForm.vue +35 -0
- package/src/component/FluxFormColumn.vue +15 -0
- package/src/component/FluxFormDateInput.vue +92 -0
- package/src/component/FluxFormDateRangeInput.vue +87 -0
- package/src/component/FluxFormDateTimeInput.vue +120 -0
- package/src/component/FluxFormField.vue +98 -0
- package/src/component/FluxFormFieldAddition.vue +37 -0
- package/src/component/FluxFormInput.vue +223 -0
- package/src/component/FluxFormInputAddition.vue +31 -0
- package/src/component/FluxFormInputGroup.vue +25 -0
- package/src/component/FluxFormPinInput.vue +135 -0
- package/src/component/FluxFormRangeSlider.vue +179 -0
- package/src/component/FluxFormRow.vue +15 -0
- package/src/component/FluxFormSection.vue +23 -0
- package/src/component/FluxFormSelect.vue +59 -0
- package/src/component/FluxFormSelectAsync.vue +118 -0
- package/src/component/FluxFormSlider.vue +123 -0
- package/src/component/FluxFormTextArea.vue +53 -0
- package/src/component/FluxFormTimeZonePicker.vue +713 -0
- package/src/component/FluxGallery.vue +99 -0
- package/src/component/FluxGalleryItem.vue +49 -0
- package/src/component/FluxGrid.vue +28 -0
- package/src/component/FluxGridColumn.vue +31 -0
- package/src/component/FluxGridPattern.vue +60 -0
- package/src/component/FluxIcon.vue +79 -0
- package/src/component/FluxInfo.vue +28 -0
- package/src/component/FluxInfoStack.vue +17 -0
- package/src/component/FluxLegend.vue +27 -0
- package/src/component/FluxLink.vue +35 -0
- package/src/component/FluxMenu.vue +31 -0
- package/src/component/FluxMenuGroup.vue +21 -0
- package/src/component/FluxMenuItem.vue +84 -0
- package/src/component/FluxMenuOptions.vue +38 -0
- package/src/component/FluxMenuSubHeader.vue +33 -0
- package/src/component/FluxMenuTitle.vue +17 -0
- package/src/component/FluxNotice.vue +79 -0
- package/src/component/FluxNoticeStack.vue +17 -0
- package/src/component/FluxOverlay.vue +31 -0
- package/src/component/FluxPagination.vue +148 -0
- package/src/component/FluxPaginationBar.vue +81 -0
- package/src/component/FluxPane.vue +45 -0
- package/src/component/FluxPaneBody.vue +15 -0
- package/src/component/FluxPaneDeck.vue +24 -0
- package/src/component/FluxPaneFooter.vue +15 -0
- package/src/component/FluxPaneGroup.vue +15 -0
- package/src/component/FluxPaneHeader.vue +44 -0
- package/src/component/FluxPaneIllustration.vue +68 -0
- package/src/component/FluxPaneMedia.vue +31 -0
- package/src/component/FluxPercentageBar.vue +45 -0
- package/src/component/FluxPersona.vue +48 -0
- package/src/component/FluxPlaceholder.vue +56 -0
- package/src/component/FluxPressable.vue +77 -0
- package/src/component/FluxPrimaryButton.vue +28 -0
- package/src/component/FluxProgressBar.vue +75 -0
- package/src/component/FluxPrompt.vue +77 -0
- package/src/component/FluxPublishButton.vue +59 -0
- package/src/component/FluxQuantitySelector.vue +109 -0
- package/src/component/FluxRemove.vue +34 -0
- package/src/component/FluxRoot.vue +60 -0
- package/src/component/FluxSecondaryButton.vue +28 -0
- package/src/component/FluxSegmentedControl.vue +77 -0
- package/src/component/FluxSegmentedView.vue +15 -0
- package/src/component/FluxSeparator.vue +19 -0
- package/src/component/FluxSlideOver.vue +25 -0
- package/src/component/FluxSnackbar.vue +154 -0
- package/src/component/FluxSnackbarProvider.vue +34 -0
- package/src/component/FluxSpacer.vue +9 -0
- package/src/component/FluxSpacing.vue +32 -0
- package/src/component/FluxSpinner.vue +48 -0
- package/src/component/FluxSplitButton.vue +61 -0
- package/src/component/FluxStack.vue +40 -0
- package/src/component/FluxStatistic.vue +68 -0
- package/src/component/FluxStepper.vue +69 -0
- package/src/component/FluxStepperStep.vue +15 -0
- package/src/component/FluxStepperSteps.vue +62 -0
- package/src/component/FluxTab.vue +23 -0
- package/src/component/FluxTabBar.vue +87 -0
- package/src/component/FluxTabBarItem.vue +104 -0
- package/src/component/FluxTable.vue +68 -0
- package/src/component/FluxTableActions.vue +16 -0
- package/src/component/FluxTableCell.vue +47 -0
- package/src/component/FluxTableHeader.vue +111 -0
- package/src/component/FluxTableRow.vue +15 -0
- package/src/component/FluxTabs.vue +91 -0
- package/src/component/FluxTag.vue +85 -0
- package/src/component/FluxTagStack.vue +18 -0
- package/src/component/FluxTicks.vue +44 -0
- package/src/component/FluxTimeline.vue +17 -0
- package/src/component/FluxTimelineItem.vue +73 -0
- package/src/component/FluxToggle.vue +64 -0
- package/src/component/FluxToolbar.vue +32 -0
- package/src/component/FluxToolbarGroup.vue +18 -0
- package/src/component/FluxTooltip.vue +56 -0
- package/src/component/FluxTooltipProvider.vue +176 -0
- package/src/component/FluxWindow.vue +47 -0
- package/src/component/index.ts +142 -0
- package/src/component/primitive/Anchor.vue +17 -0
- package/src/component/primitive/AnchorPopup.vue +194 -0
- package/src/component/primitive/CoordinatePicker.vue +155 -0
- package/src/component/primitive/CoordinatePickerThumb.vue +71 -0
- package/src/component/primitive/FilterItem.vue +44 -0
- package/src/component/primitive/FilterMenuRenderer.ts +233 -0
- package/src/component/primitive/FilterOptionBase.vue +67 -0
- package/src/component/primitive/SelectBase.vue +340 -0
- package/src/component/primitive/SliderBase.vue +89 -0
- package/src/component/primitive/SliderThumb.vue +64 -0
- package/src/component/primitive/SliderTrack.vue +22 -0
- package/src/component/primitive/VNodeRenderer.ts +11 -0
- package/src/component/primitive/index.ts +10 -0
- package/src/composable/index.ts +9 -0
- package/src/composable/private/index.ts +3 -0
- package/src/composable/private/useFormSelect.ts +66 -0
- package/src/composable/private/useLoaded.ts +21 -0
- package/src/composable/private/useTranslate.ts +35 -0
- package/src/composable/useBreakpoints.ts +54 -0
- package/src/composable/useDisabled.ts +9 -0
- package/src/composable/useDisabledInjection.ts +6 -0
- package/src/composable/useExpandableGroupInjection.ts +10 -0
- package/src/composable/useFilterInjection.ts +22 -0
- package/src/composable/useFlyoutInjection.ts +10 -0
- package/src/composable/useFormFieldInjection.ts +8 -0
- package/src/composable/useTableInjection.ts +11 -0
- package/src/css/base.scss +33 -0
- package/src/css/component/Action.module.scss +107 -0
- package/src/css/component/Avatar.module.scss +177 -0
- package/src/css/component/Badge.module.scss +189 -0
- package/src/css/component/Button.module.scss +293 -0
- package/src/css/component/Calendar.module.scss +171 -0
- package/src/css/component/Chip.module.scss +58 -0
- package/src/css/component/Color.module.scss +184 -0
- package/src/css/component/Comment.module.scss +123 -0
- package/src/css/component/DatePicker.module.scss +193 -0
- package/src/css/component/Divider.module.scss +79 -0
- package/src/css/component/DropZone.module.scss +99 -0
- package/src/css/component/Expandable.module.scss +112 -0
- package/src/css/component/Fader.module.scss +38 -0
- package/src/css/component/Filter.module.scss +80 -0
- package/src/css/component/Flyout.module.scss +63 -0
- package/src/css/component/FocalPoint.module.scss +84 -0
- package/src/css/component/Form.module.scss +812 -0
- package/src/css/component/Gallery.module.scss +64 -0
- package/src/css/component/Grid.module.scss +24 -0
- package/src/css/component/Icon.module.scss +104 -0
- package/src/css/component/Info.module.scss +15 -0
- package/src/css/component/Layout.module.scss +63 -0
- package/src/css/component/Legend.module.scss +32 -0
- package/src/css/component/Menu.module.scss +314 -0
- package/src/css/component/Notice.module.scss +279 -0
- package/src/css/component/Overlay.module.scss +149 -0
- package/src/css/component/Pagination.module.scss +59 -0
- package/src/css/component/Pane.module.scss +218 -0
- package/src/css/component/PercentageBar.module.scss +31 -0
- package/src/css/component/Placeholder.module.scss +72 -0
- package/src/css/component/Progress.module.scss +84 -0
- package/src/css/component/Remove.module.scss +29 -0
- package/src/css/component/Root.module.scss +8 -0
- package/src/css/component/SegmentedControl.module.scss +82 -0
- package/src/css/component/Snackbar.module.scss +227 -0
- package/src/css/component/Spinner.module.scss +36 -0
- package/src/css/component/Statistic.module.scss +118 -0
- package/src/css/component/Stepper.module.scss +103 -0
- package/src/css/component/Tab.module.scss +162 -0
- package/src/css/component/Table.module.scss +164 -0
- package/src/css/component/Timeline.module.scss +173 -0
- package/src/css/component/Toolbar.module.scss +82 -0
- package/src/css/component/Tooltip.module.scss +62 -0
- package/src/css/component/Transition.module.scss +142 -0
- package/src/css/component/Visual.module.scss +70 -0
- package/src/css/component/base/Button.module.scss +87 -0
- package/src/css/component/base/Effect.module.scss +139 -0
- package/src/css/component/base/Grid.module.scss +8 -0
- package/src/css/component/base/Pane.module.scss +54 -0
- package/src/css/component/primitive/CoordinatePicker.module.scss +24 -0
- package/src/css/component/primitive/Slider.module.scss +116 -0
- package/src/css/index.scss +5 -0
- package/src/css/layers.scss +1 -0
- package/src/css/mixin/breakpoints.scss +112 -0
- package/src/css/mixin/focus-ring.scss +56 -0
- package/src/css/mixin/hover.scss +7 -0
- package/src/css/mixin/index.scss +3 -0
- package/src/css/reset.scss +169 -0
- package/src/css/typography.scss +87 -0
- package/src/css/variables.scss +214 -0
- package/src/data/di.ts +42 -0
- package/src/data/filter.ts +9 -0
- package/src/data/helper.ts +9 -0
- package/src/data/i18n.ts +55 -0
- package/src/data/iconRegistry.ts +21 -0
- package/src/data/index.ts +8 -0
- package/src/data/inputMask.ts +34 -0
- package/src/data/store.ts +233 -0
- package/src/image/avatar-mask.svg +3 -0
- package/src/index.ts +25 -0
- package/src/transition/FluxAutoHeightTransition.vue +59 -0
- package/src/transition/FluxAutoWidthTransition.vue +59 -0
- package/src/transition/FluxBreakthroughTransition.vue +23 -0
- package/src/transition/FluxFadeTransition.vue +24 -0
- package/src/transition/FluxOverlayTransition.vue +22 -0
- package/src/transition/FluxRouteTransition.vue +23 -0
- package/src/transition/FluxSlideOverTransition.vue +22 -0
- package/src/transition/FluxTooltipTransition.vue +22 -0
- package/src/transition/FluxVerticalWindowTransition.vue +23 -0
- package/src/transition/FluxWindowTransition.vue +23 -0
- package/src/transition/index.ts +10 -0
- package/src/util/createDialogRenderer.ts +64 -0
- package/src/util/createLabelForDateRange.ts +61 -0
- package/src/util/index.ts +2 -0
- package/src/vite.d.ts +13 -0
- package/tsconfig.json +45 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxDropZone
|
|
3
|
+
accept="image/*"
|
|
4
|
+
:disabled="!isEditable"
|
|
5
|
+
:is-empty="items && items.length === 0"
|
|
6
|
+
is-multiple
|
|
7
|
+
placeholder-icon="image"
|
|
8
|
+
:placeholder-button="translate('flux.galleryPlaceholderButton')"
|
|
9
|
+
:placeholder-message="translate('flux.galleryPlaceholderMessage')"
|
|
10
|
+
:placeholder-title="translate('flux.galleryPlaceholderTitle')"
|
|
11
|
+
@select-multiple="onFilesSelected">
|
|
12
|
+
<template #default="{showPicker}">
|
|
13
|
+
<TransitionGroup
|
|
14
|
+
:class="$style.gallery"
|
|
15
|
+
:move-class="$style.galleryMove"
|
|
16
|
+
tag="div">
|
|
17
|
+
<template
|
|
18
|
+
v-if="items"
|
|
19
|
+
v-for="(item, index) of items">
|
|
20
|
+
<FluxGalleryItem
|
|
21
|
+
v-if="typeof item === 'string'"
|
|
22
|
+
:is-deletable="isEditable"
|
|
23
|
+
:key="item"
|
|
24
|
+
:url="item"
|
|
25
|
+
@delete="$emit('delete', index)"/>
|
|
26
|
+
|
|
27
|
+
<FluxGalleryItem
|
|
28
|
+
v-else
|
|
29
|
+
:is-deletable="isEditable"
|
|
30
|
+
:key="item.url"
|
|
31
|
+
:focal-point="item"
|
|
32
|
+
:url="item.url"
|
|
33
|
+
@delete="$emit('delete', index)"/>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<slot/>
|
|
37
|
+
|
|
38
|
+
<FluxGalleryItem
|
|
39
|
+
v-for="item of pendingItems"
|
|
40
|
+
is-pending
|
|
41
|
+
:key="item"
|
|
42
|
+
:url="item"/>
|
|
43
|
+
|
|
44
|
+
<button
|
|
45
|
+
v-if="isEditable"
|
|
46
|
+
key="gallery-add"
|
|
47
|
+
:class="$style.galleryAdd"
|
|
48
|
+
type="button"
|
|
49
|
+
@click="showPicker()">
|
|
50
|
+
<FluxIcon name="plus"/>
|
|
51
|
+
</button>
|
|
52
|
+
</TransitionGroup>
|
|
53
|
+
</template>
|
|
54
|
+
</FluxDropZone>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script
|
|
58
|
+
lang="ts"
|
|
59
|
+
setup>
|
|
60
|
+
import type { FluxFocalPointObject } from '@flux-ui/types';
|
|
61
|
+
import { useTranslate } from '$flux/composable/private';
|
|
62
|
+
import FluxDropZone from './FluxDropZone.vue';
|
|
63
|
+
import FluxGalleryItem from './FluxGalleryItem.vue';
|
|
64
|
+
import FluxIcon from './FluxIcon.vue';
|
|
65
|
+
import $style from '$flux/css/component/Gallery.module.scss';
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits<{
|
|
68
|
+
delete: [number];
|
|
69
|
+
upload: [File[]];
|
|
70
|
+
}>();
|
|
71
|
+
|
|
72
|
+
defineProps<{
|
|
73
|
+
readonly isEditable?: boolean;
|
|
74
|
+
readonly items?: (string | (FluxFocalPointObject & { readonly url: string; }))[];
|
|
75
|
+
readonly pendingItems?: string[];
|
|
76
|
+
}>();
|
|
77
|
+
|
|
78
|
+
defineSlots<{
|
|
79
|
+
default(): any;
|
|
80
|
+
}>();
|
|
81
|
+
|
|
82
|
+
const translate = useTranslate();
|
|
83
|
+
|
|
84
|
+
function onFilesSelected(files: FileList): void {
|
|
85
|
+
const images: File[] = [];
|
|
86
|
+
|
|
87
|
+
for (let i = 0; i < files.length; ++i) {
|
|
88
|
+
const file = files.item(i);
|
|
89
|
+
|
|
90
|
+
if (!file || !file.type.startsWith('image/')) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
images.push(file);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
emit('upload', images);
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="$style.galleryItem"
|
|
4
|
+
@mouseenter.capture="isDeleteVisible = true"
|
|
5
|
+
@mouseout.capture="isDeleteVisible = false">
|
|
6
|
+
<FluxFocalPointImage
|
|
7
|
+
:class="$style.galleryItemImage"
|
|
8
|
+
:focal-point="focalPoint"
|
|
9
|
+
:src="url"/>
|
|
10
|
+
|
|
11
|
+
<FluxRemove
|
|
12
|
+
v-if="isDeletable"
|
|
13
|
+
:is-hidden="!isDeleteVisible"
|
|
14
|
+
tabindex="-1"
|
|
15
|
+
@click="emit('delete')"/>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
v-if="isPending"
|
|
19
|
+
:class="$style.galleryItemLoader">
|
|
20
|
+
<FluxSpinner :size="24"/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script
|
|
26
|
+
lang="ts"
|
|
27
|
+
setup>
|
|
28
|
+
import type { FluxFocalPointObject } from '@flux-ui/types';
|
|
29
|
+
import { ref } from 'vue';
|
|
30
|
+
import FluxFocalPointImage from './FluxFocalPointImage.vue';
|
|
31
|
+
import FluxRemove from './FluxRemove.vue';
|
|
32
|
+
import FluxSpinner from './FluxSpinner.vue';
|
|
33
|
+
import $style from '$flux/css/component/Gallery.module.scss';
|
|
34
|
+
|
|
35
|
+
const emit = defineEmits<{
|
|
36
|
+
delete: [];
|
|
37
|
+
}>();
|
|
38
|
+
|
|
39
|
+
const {
|
|
40
|
+
focalPoint
|
|
41
|
+
} = defineProps<{
|
|
42
|
+
readonly focalPoint?: FluxFocalPointObject;
|
|
43
|
+
readonly isDeletable?: boolean;
|
|
44
|
+
readonly isPending?: boolean;
|
|
45
|
+
readonly url: string;
|
|
46
|
+
}>();
|
|
47
|
+
|
|
48
|
+
const isDeleteVisible = ref(false);
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="$style.grid"
|
|
4
|
+
:style="{
|
|
5
|
+
'--gap': `${gap}px`,
|
|
6
|
+
'--columns': columns
|
|
7
|
+
}">
|
|
8
|
+
<slot/>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script
|
|
13
|
+
lang="ts"
|
|
14
|
+
setup>
|
|
15
|
+
import $style from '$flux/css/component/Grid.module.scss';
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
columns = 12,
|
|
19
|
+
gap = 30
|
|
20
|
+
} = defineProps<{
|
|
21
|
+
readonly columns?: number;
|
|
22
|
+
readonly gap?: number;
|
|
23
|
+
}>();
|
|
24
|
+
|
|
25
|
+
defineSlots<{
|
|
26
|
+
default(): any;
|
|
27
|
+
}>();
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="$style.gridColumn"
|
|
4
|
+
:style="{
|
|
5
|
+
'--xs': xs ?? 12,
|
|
6
|
+
'--sm': sm ?? xs ?? 12,
|
|
7
|
+
'--md': md ?? sm ?? xs ?? 12,
|
|
8
|
+
'--lg': lg ?? md ?? sm ?? xs ?? 12,
|
|
9
|
+
'--xl': xl ?? lg ?? md ?? sm ?? xs ?? 12
|
|
10
|
+
}">
|
|
11
|
+
<slot/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script
|
|
16
|
+
lang="ts"
|
|
17
|
+
setup>
|
|
18
|
+
import $style from '$flux/css/component/Grid.module.scss';
|
|
19
|
+
|
|
20
|
+
defineProps<{
|
|
21
|
+
readonly xs?: number;
|
|
22
|
+
readonly sm?: number;
|
|
23
|
+
readonly md?: number;
|
|
24
|
+
readonly lg?: number;
|
|
25
|
+
readonly xl?: number;
|
|
26
|
+
}>();
|
|
27
|
+
|
|
28
|
+
defineSlots<{
|
|
29
|
+
default(): any;
|
|
30
|
+
}>();
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
ref="svg"
|
|
4
|
+
:class="$style.gridPattern">
|
|
5
|
+
<defs>
|
|
6
|
+
<pattern
|
|
7
|
+
:id="id"
|
|
8
|
+
:width="width"
|
|
9
|
+
:height="height"
|
|
10
|
+
patternUnits="userSpaceOnUse"
|
|
11
|
+
:x="-1"
|
|
12
|
+
:y="-1">
|
|
13
|
+
<path
|
|
14
|
+
:d="`M.5 ${height}V.5H${width}`"
|
|
15
|
+
fill="none"
|
|
16
|
+
:stroke-dasharray="strokeDasharray"/>
|
|
17
|
+
</pattern>
|
|
18
|
+
</defs>
|
|
19
|
+
|
|
20
|
+
<rect
|
|
21
|
+
width="100%"
|
|
22
|
+
height="100%"
|
|
23
|
+
stroke-width="0"
|
|
24
|
+
:fill="`url(#${id})`"/>
|
|
25
|
+
|
|
26
|
+
<svg
|
|
27
|
+
v-if="squares"
|
|
28
|
+
style="overflow: visible;">
|
|
29
|
+
<rect
|
|
30
|
+
v-for="[x, y] of squares"
|
|
31
|
+
:key="`${x}-${y}`"
|
|
32
|
+
:width="width - 1"
|
|
33
|
+
:height="height - 1"
|
|
34
|
+
:x="x * width"
|
|
35
|
+
:y="y * height"
|
|
36
|
+
stroke-width="0"/>
|
|
37
|
+
</svg>
|
|
38
|
+
</svg>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script
|
|
42
|
+
lang="ts"
|
|
43
|
+
setup>
|
|
44
|
+
import { useId } from 'vue';
|
|
45
|
+
import $style from '$flux/css/component/Visual.module.scss';
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
width = 42,
|
|
49
|
+
height = 42,
|
|
50
|
+
strokeDasharray = 0,
|
|
51
|
+
squares
|
|
52
|
+
} = defineProps<{
|
|
53
|
+
readonly width?: number;
|
|
54
|
+
readonly height?: number;
|
|
55
|
+
readonly strokeDasharray?: number | string;
|
|
56
|
+
readonly squares?: Array<[x: number, y: number]>;
|
|
57
|
+
}>();
|
|
58
|
+
|
|
59
|
+
const id = useId();
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
v-if="definition"
|
|
4
|
+
:viewBox="`0 0 ${definition.width} ${definition.height}`"
|
|
5
|
+
:class="$style.fontAwesomeIcon"
|
|
6
|
+
:style="{
|
|
7
|
+
fontSize: size && `${size}px`,
|
|
8
|
+
scale: definition.scale > 1 ? definition.scale : undefined
|
|
9
|
+
}"
|
|
10
|
+
focusable="false"
|
|
11
|
+
role="img"
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
@click="onClick">
|
|
14
|
+
<path
|
|
15
|
+
v-for="path in definition.paths"
|
|
16
|
+
:d="path"
|
|
17
|
+
fill="currentColor"/>
|
|
18
|
+
</svg>
|
|
19
|
+
|
|
20
|
+
<i
|
|
21
|
+
v-else-if="name"
|
|
22
|
+
:class="$style.materialSymbolIcon"
|
|
23
|
+
:style="{
|
|
24
|
+
fontSize: size && `${size}px`
|
|
25
|
+
}"
|
|
26
|
+
role="img"
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
@click="onClick">
|
|
29
|
+
{{ name }}
|
|
30
|
+
</i>
|
|
31
|
+
|
|
32
|
+
<i
|
|
33
|
+
v-else
|
|
34
|
+
:class="$style.icon"/>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script
|
|
38
|
+
lang="ts"
|
|
39
|
+
setup>
|
|
40
|
+
import { warn } from '@flux-ui/internals';
|
|
41
|
+
import type { FluxIconName } from '@flux-ui/types';
|
|
42
|
+
import { computed } from 'vue';
|
|
43
|
+
import { iconRegistry } from '$flux/data';
|
|
44
|
+
import $style from '$flux/css/component/Icon.module.scss';
|
|
45
|
+
|
|
46
|
+
const emit = defineEmits<{
|
|
47
|
+
click: [MouseEvent];
|
|
48
|
+
}>();
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
name
|
|
52
|
+
} = defineProps<{
|
|
53
|
+
readonly size?: number | string;
|
|
54
|
+
readonly name?: FluxIconName;
|
|
55
|
+
}>();
|
|
56
|
+
|
|
57
|
+
const definition = computed(() => {
|
|
58
|
+
if (!name) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const icon = iconRegistry[name];
|
|
63
|
+
|
|
64
|
+
if (!icon) {
|
|
65
|
+
warn(`Unknown icon: ${name}`);
|
|
66
|
+
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
width: icon[0],
|
|
72
|
+
height: icon[1],
|
|
73
|
+
paths: (Array.isArray(icon[4]) ? icon[4] : [icon[4]]) as string[],
|
|
74
|
+
scale: Math.max(1, icon[0] / 512)
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const onClick = (evt: MouseEvent) => emit('click', evt);
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.info">
|
|
3
|
+
<FluxIcon
|
|
4
|
+
v-if="icon"
|
|
5
|
+
:class="$style.infoIcon"
|
|
6
|
+
:name="icon"/>
|
|
7
|
+
|
|
8
|
+
<div :class="$style.infoBody">
|
|
9
|
+
<slot/>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script
|
|
15
|
+
setup
|
|
16
|
+
lang="ts">
|
|
17
|
+
import type { FluxIconName } from '@flux-ui/types';
|
|
18
|
+
import FluxIcon from './FluxIcon.vue';
|
|
19
|
+
import $style from '$flux/css/component/Info.module.scss';
|
|
20
|
+
|
|
21
|
+
defineProps<{
|
|
22
|
+
readonly icon?: FluxIconName;
|
|
23
|
+
}>();
|
|
24
|
+
|
|
25
|
+
defineSlots<{
|
|
26
|
+
default(): any;
|
|
27
|
+
}>();
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="direction === 'horizontal' ? $style.legendHorizontal : $style.legendVertical">
|
|
3
|
+
<template v-for="item of items">
|
|
4
|
+
<span
|
|
5
|
+
:class="$style.legendItem"
|
|
6
|
+
:style="{
|
|
7
|
+
'--color': item.color
|
|
8
|
+
}">
|
|
9
|
+
{{ item.label }}
|
|
10
|
+
</span>
|
|
11
|
+
</template>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script
|
|
16
|
+
lang="ts"
|
|
17
|
+
setup>
|
|
18
|
+
import type { FluxDirection, FluxLegendObject } from '@flux-ui/types';
|
|
19
|
+
import $style from '$flux/css/component/Legend.module.scss';
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
direction = 'horizontal'
|
|
23
|
+
} = defineProps<{
|
|
24
|
+
readonly direction?: FluxDirection;
|
|
25
|
+
readonly items: FluxLegendObject[];
|
|
26
|
+
}>();
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxButton
|
|
3
|
+
:="{type, disabled, iconLeading: icon, iconTrailing: 'arrow-right-long', isFilled, label, href, rel, target, to}"
|
|
4
|
+
:css-class="$style.linkButton"
|
|
5
|
+
:css-class-icon="$style.linkButtonIcon"
|
|
6
|
+
:css-class-label="$style.linkButtonLabel"
|
|
7
|
+
@click="emit('click', $event)"
|
|
8
|
+
@mouseenter="emit('mouseenter', $event)"
|
|
9
|
+
@mouseleave="emit('mouseleave', $event)">
|
|
10
|
+
<template
|
|
11
|
+
v-for="slot of SLOTS"
|
|
12
|
+
#[slot]>
|
|
13
|
+
<slot :name="slot"/>
|
|
14
|
+
</template>
|
|
15
|
+
</FluxButton>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script
|
|
19
|
+
lang="ts"
|
|
20
|
+
setup>
|
|
21
|
+
import type { FluxButtonEmits, FluxButtonProps, FluxButtonSlots, FluxIconName } from '@flux-ui/types';
|
|
22
|
+
import FluxButton, { SLOTS } from './FluxButton.vue';
|
|
23
|
+
import $style from '$flux/css/component/Button.module.scss';
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits<FluxButtonEmits>();
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
type = 'button'
|
|
29
|
+
} = defineProps<FluxButtonProps & {
|
|
30
|
+
readonly icon?: FluxIconName;
|
|
31
|
+
readonly label?: string;
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
defineSlots<FluxButtonSlots>();
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav
|
|
3
|
+
ref="element"
|
|
4
|
+
:class="isLarge ? $style.menuLarge : $style.menuNormal"
|
|
5
|
+
role="menu"
|
|
6
|
+
aria-orientation="vertical">
|
|
7
|
+
<slot/>
|
|
8
|
+
</nav>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script
|
|
12
|
+
lang="ts"
|
|
13
|
+
setup>
|
|
14
|
+
import { useFocusZone } from '@flux-ui/internals';
|
|
15
|
+
import { useTemplateRef } from 'vue';
|
|
16
|
+
import $style from '$flux/css/component/Menu.module.scss';
|
|
17
|
+
|
|
18
|
+
defineProps<{
|
|
19
|
+
readonly isLarge?: boolean;
|
|
20
|
+
}>();
|
|
21
|
+
|
|
22
|
+
defineSlots<{
|
|
23
|
+
default(): any;
|
|
24
|
+
}>();
|
|
25
|
+
|
|
26
|
+
const elementRef = useTemplateRef('element');
|
|
27
|
+
|
|
28
|
+
useFocusZone(elementRef, {
|
|
29
|
+
direction: 'vertical'
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="isHorizontal ? $style.menuGroupHorizontal : $style.menuGroupVertical"
|
|
4
|
+
role="group">
|
|
5
|
+
<slot/>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script
|
|
10
|
+
lang="ts"
|
|
11
|
+
setup>
|
|
12
|
+
import $style from '$flux/css/component/Menu.module.scss';
|
|
13
|
+
|
|
14
|
+
defineProps<{
|
|
15
|
+
readonly isHorizontal?: boolean;
|
|
16
|
+
}>();
|
|
17
|
+
|
|
18
|
+
defineSlots<{
|
|
19
|
+
default(): any;
|
|
20
|
+
}>();
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxButton
|
|
3
|
+
:="{type, disabled, iconLeading, iconTrailing, isLoading, label, href, rel, target, to}"
|
|
4
|
+
:css-class="$style.menuItem"
|
|
5
|
+
:css-class-icon="$style.menuItemIcon"
|
|
6
|
+
:css-class-label="$style.menuItemLabel"
|
|
7
|
+
is-filled
|
|
8
|
+
:role="isSelectable ? 'menuitemradio' : 'menuitem'"
|
|
9
|
+
:class="{
|
|
10
|
+
[$style.menuItemActive]: isActive,
|
|
11
|
+
[$style.menuItemDestructive]: isDestructive,
|
|
12
|
+
[$style.menuItemHighlighted]: isHighlighted,
|
|
13
|
+
[$style.menuItemIndented]: isIndented,
|
|
14
|
+
[$style.menuItemSelected]: isSelectable && isSelected
|
|
15
|
+
}"
|
|
16
|
+
:aria-checked="isSelectable ? isSelected : undefined"
|
|
17
|
+
@click="$emit('click', $event)">
|
|
18
|
+
<template
|
|
19
|
+
v-if="isSelectable && (!iconLeading || isSelected)"
|
|
20
|
+
#iconLeading>
|
|
21
|
+
<FluxIcon
|
|
22
|
+
:class="$style.menuItemSelectableIcon"
|
|
23
|
+
:name="isSelected ? 'circle-check' : undefined"/>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<template
|
|
27
|
+
v-else-if="imageSrc"
|
|
28
|
+
#iconLeading>
|
|
29
|
+
<img
|
|
30
|
+
:class="$style.menuItemImage"
|
|
31
|
+
:src="imageSrc"
|
|
32
|
+
alt=""/>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<template
|
|
36
|
+
v-if="command || commandIcon || commandLoading"
|
|
37
|
+
#after>
|
|
38
|
+
<FluxSpinner
|
|
39
|
+
v-if="commandLoading"
|
|
40
|
+
:class="$style.menuItemCommandIcon"
|
|
41
|
+
:size="16"/>
|
|
42
|
+
|
|
43
|
+
<template v-else>
|
|
44
|
+
<kbd
|
|
45
|
+
v-if="command"
|
|
46
|
+
:class="$style.menuItemCommand">
|
|
47
|
+
{{ command }}
|
|
48
|
+
</kbd>
|
|
49
|
+
|
|
50
|
+
<FluxIcon
|
|
51
|
+
v-if="commandIcon"
|
|
52
|
+
:class="$style.menuItemCommandIcon"
|
|
53
|
+
:name="commandIcon"/>
|
|
54
|
+
</template>
|
|
55
|
+
</template>
|
|
56
|
+
</FluxButton>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script
|
|
60
|
+
lang="ts"
|
|
61
|
+
setup>
|
|
62
|
+
import type { FluxButtonEmits, FluxButtonProps, FluxIconName } from '@flux-ui/types';
|
|
63
|
+
import FluxButton from './FluxButton.vue';
|
|
64
|
+
import FluxIcon from './FluxIcon.vue';
|
|
65
|
+
import FluxSpinner from './FluxSpinner.vue';
|
|
66
|
+
import $style from '$flux/css/component/Menu.module.scss';
|
|
67
|
+
|
|
68
|
+
defineEmits<FluxButtonEmits>();
|
|
69
|
+
|
|
70
|
+
const {
|
|
71
|
+
type = 'button'
|
|
72
|
+
} = defineProps<Omit<FluxButtonProps, 'isFilled' | 'isSubmit' | 'size'> & {
|
|
73
|
+
readonly command?: string;
|
|
74
|
+
readonly commandIcon?: FluxIconName;
|
|
75
|
+
readonly commandLoading?: boolean;
|
|
76
|
+
readonly imageSrc?: string;
|
|
77
|
+
readonly isActive?: boolean;
|
|
78
|
+
readonly isDestructive?: boolean;
|
|
79
|
+
readonly isHighlighted?: boolean;
|
|
80
|
+
readonly isIndented?: boolean;
|
|
81
|
+
readonly isSelectable?: boolean;
|
|
82
|
+
readonly isSelected?: boolean;
|
|
83
|
+
}>();
|
|
84
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxMenuGroup :is-horizontal="isHorizontal">
|
|
3
|
+
<template v-for="item in items">
|
|
4
|
+
<component :is="item"/>
|
|
5
|
+
</template>
|
|
6
|
+
</FluxMenuGroup>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script
|
|
10
|
+
lang="ts"
|
|
11
|
+
setup>
|
|
12
|
+
import { flattenVNodeTree } from '@flux-ui/internals';
|
|
13
|
+
import { cloneVNode, computed, unref, VNode } from 'vue';
|
|
14
|
+
import FluxMenuGroup from './FluxMenuGroup.vue';
|
|
15
|
+
|
|
16
|
+
const modelValue = defineModel<number>({
|
|
17
|
+
required: true
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
mode = 'highlight'
|
|
22
|
+
} = defineProps<{
|
|
23
|
+
readonly isHorizontal?: boolean;
|
|
24
|
+
readonly mode?: 'highlight' | 'select';
|
|
25
|
+
}>();
|
|
26
|
+
|
|
27
|
+
const slots = defineSlots<{
|
|
28
|
+
default(): any;
|
|
29
|
+
}>();
|
|
30
|
+
|
|
31
|
+
const items = computed(() => flattenVNodeTree(slots.default())
|
|
32
|
+
.map((item: VNode, index: number) => cloneVNode(item, {
|
|
33
|
+
isHighlighted: mode === 'highlight' && unref(modelValue) === index,
|
|
34
|
+
isSelectable: mode === 'select',
|
|
35
|
+
isSelected: mode === 'select' && unref(modelValue) === index,
|
|
36
|
+
onClick: () => modelValue.value = index
|
|
37
|
+
})));
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="$style.menuSubHeader"
|
|
4
|
+
role="presentation">
|
|
5
|
+
<FluxIcon
|
|
6
|
+
v-if="iconLeading"
|
|
7
|
+
:class="$style.menuSubHeaderIcon"
|
|
8
|
+
:name="iconLeading"/>
|
|
9
|
+
|
|
10
|
+
<span :class="$style.menuSubHeaderLabel">
|
|
11
|
+
{{ label }}
|
|
12
|
+
</span>
|
|
13
|
+
|
|
14
|
+
<FluxIcon
|
|
15
|
+
v-if="iconTrailing"
|
|
16
|
+
:class="$style.menuSubHeaderIcon"
|
|
17
|
+
:name="iconTrailing"/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script
|
|
22
|
+
lang="ts"
|
|
23
|
+
setup>
|
|
24
|
+
import type { FluxIconName } from '@flux-ui/types';
|
|
25
|
+
import FluxIcon from './FluxIcon.vue';
|
|
26
|
+
import $style from '$flux/css/component/Menu.module.scss';
|
|
27
|
+
|
|
28
|
+
defineProps<{
|
|
29
|
+
readonly iconLeading?: FluxIconName;
|
|
30
|
+
readonly iconTrailing?: FluxIconName;
|
|
31
|
+
readonly label: string;
|
|
32
|
+
}>();
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="$style.menuTitle"
|
|
4
|
+
role="presentation">
|
|
5
|
+
{{ title }}
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script
|
|
10
|
+
lang="ts"
|
|
11
|
+
setup>
|
|
12
|
+
import $style from '$flux/css/component/Menu.module.scss';
|
|
13
|
+
|
|
14
|
+
defineProps<{
|
|
15
|
+
readonly title: string;
|
|
16
|
+
}>();
|
|
17
|
+
</script>
|