@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,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="clsx(
|
|
4
|
+
color === 'gray' && $style.noticeGray,
|
|
5
|
+
color === 'primary' && $style.noticePrimary,
|
|
6
|
+
color === 'danger' && $style.noticeDanger,
|
|
7
|
+
color === 'info' && $style.noticeInfo,
|
|
8
|
+
color === 'success' && $style.noticeSuccess,
|
|
9
|
+
color === 'warning' && $style.noticeWarning,
|
|
10
|
+
isCenter && $style.isCenter,
|
|
11
|
+
isFluid && $style.isFluid
|
|
12
|
+
)"
|
|
13
|
+
role="alert">
|
|
14
|
+
<FluxSpinner
|
|
15
|
+
v-if="isLoading"
|
|
16
|
+
:class="$style.noticePrefix"/>
|
|
17
|
+
|
|
18
|
+
<FluxIcon
|
|
19
|
+
v-if="icon && !isLoading"
|
|
20
|
+
:class="$style.noticePrefix"
|
|
21
|
+
:name="icon"/>
|
|
22
|
+
|
|
23
|
+
<div :class="$style.noticeBody">
|
|
24
|
+
<p
|
|
25
|
+
v-if="title"
|
|
26
|
+
:class="$style.noticeTitle">
|
|
27
|
+
{{ title }}
|
|
28
|
+
</p>
|
|
29
|
+
<p
|
|
30
|
+
v-if="message"
|
|
31
|
+
:class="$style.noticeMessage">
|
|
32
|
+
{{ message }}
|
|
33
|
+
</p>
|
|
34
|
+
<slot/>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<slot name="end"/>
|
|
38
|
+
|
|
39
|
+
<button
|
|
40
|
+
v-if="isCloseable"
|
|
41
|
+
:class="$style.noticeClose"
|
|
42
|
+
type="button"
|
|
43
|
+
@click="emit('close')">
|
|
44
|
+
<FluxIcon name="xmark"/>
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script
|
|
50
|
+
lang="ts"
|
|
51
|
+
setup>
|
|
52
|
+
import type { FluxColor, FluxIconName } from '@flux-ui/types';
|
|
53
|
+
import { clsx } from 'clsx';
|
|
54
|
+
import FluxIcon from './FluxIcon.vue';
|
|
55
|
+
import FluxSpinner from './FluxSpinner.vue';
|
|
56
|
+
import $style from '$flux/css/component/Notice.module.scss';
|
|
57
|
+
|
|
58
|
+
const emit = defineEmits<{
|
|
59
|
+
close: [];
|
|
60
|
+
}>();
|
|
61
|
+
|
|
62
|
+
const {
|
|
63
|
+
color = 'gray'
|
|
64
|
+
} = defineProps<{
|
|
65
|
+
readonly color?: FluxColor;
|
|
66
|
+
readonly icon?: FluxIconName;
|
|
67
|
+
readonly isCenter?: boolean;
|
|
68
|
+
readonly isCloseable?: boolean;
|
|
69
|
+
readonly isFluid?: boolean;
|
|
70
|
+
readonly isLoading?: boolean;
|
|
71
|
+
readonly message?: string;
|
|
72
|
+
readonly title?: string;
|
|
73
|
+
}>();
|
|
74
|
+
|
|
75
|
+
defineSlots<{
|
|
76
|
+
default(): any;
|
|
77
|
+
end(): any;
|
|
78
|
+
}>();
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { FluxSize } from '@flux-ui/types';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { defineComponent, PropType } from 'vue';
|
|
5
|
+
import { FluxOverlayTransition } from '$flux/transition';
|
|
6
|
+
import { createDialogRenderer } from '$flux/util';
|
|
7
|
+
import $style from '$flux/css/component/Overlay.module.scss';
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
emits: ['close'],
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
props: {
|
|
13
|
+
isCloseable: {default: false, type: Boolean},
|
|
14
|
+
size: {default: 'small', type: String as PropType<FluxSize>}
|
|
15
|
+
},
|
|
16
|
+
setup(props, {attrs, emit, slots}) {
|
|
17
|
+
return createDialogRenderer(
|
|
18
|
+
attrs,
|
|
19
|
+
props,
|
|
20
|
+
emit,
|
|
21
|
+
slots,
|
|
22
|
+
clsx(
|
|
23
|
+
props.size === 'small' && $style.overlaySmall,
|
|
24
|
+
props.size === 'medium' && $style.overlayMedium,
|
|
25
|
+
props.size === 'large' && $style.overlayLarge
|
|
26
|
+
),
|
|
27
|
+
FluxOverlayTransition
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxButtonGroup
|
|
3
|
+
:class="$style.pagination"
|
|
4
|
+
role="navigation"
|
|
5
|
+
:aria-label="translate('flux.pagination')">
|
|
6
|
+
<FluxSecondaryButton
|
|
7
|
+
v-if="arrows || isCompact"
|
|
8
|
+
:disabled="isPreviousDisabled"
|
|
9
|
+
icon-leading="angle-left"
|
|
10
|
+
:aria-label="translate('flux.previous')"
|
|
11
|
+
@click="previous"/>
|
|
12
|
+
|
|
13
|
+
<template
|
|
14
|
+
v-if="!isCompact"
|
|
15
|
+
v-for="p of visiblePages">
|
|
16
|
+
<FluxSecondaryButton
|
|
17
|
+
v-if="p === 'dots'"
|
|
18
|
+
disabled
|
|
19
|
+
icon-leading="ellipsis-h"/>
|
|
20
|
+
|
|
21
|
+
<FluxPrimaryButton
|
|
22
|
+
v-else-if="p === page"
|
|
23
|
+
:label="`${p}`"
|
|
24
|
+
aria-current="page"/>
|
|
25
|
+
|
|
26
|
+
<FluxSecondaryButton
|
|
27
|
+
v-else
|
|
28
|
+
:label="`${p}`"
|
|
29
|
+
@click="navigate(p)"/>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<template v-else>
|
|
33
|
+
<FluxSecondaryButton
|
|
34
|
+
:class="$style.paginationCurrentZZ"
|
|
35
|
+
@click="prompt"
|
|
36
|
+
#before>
|
|
37
|
+
<strong>{{ page }}</strong>
|
|
38
|
+
<span>/</span>
|
|
39
|
+
<span>{{ pages }}</span>
|
|
40
|
+
</FluxSecondaryButton>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<FluxSecondaryButton
|
|
44
|
+
v-if="arrows || isCompact"
|
|
45
|
+
:disabled="isNextDisabled"
|
|
46
|
+
icon-leading="angle-right"
|
|
47
|
+
:aria-label="translate('flux.next')"
|
|
48
|
+
@click="next"/>
|
|
49
|
+
</FluxButtonGroup>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script
|
|
53
|
+
lang="ts"
|
|
54
|
+
setup>
|
|
55
|
+
import { computed, unref } from 'vue';
|
|
56
|
+
import { useTranslate } from '$flux/composable/private';
|
|
57
|
+
import { showPrompt } from '$flux/data';
|
|
58
|
+
import FluxButtonGroup from './FluxButtonGroup.vue';
|
|
59
|
+
import FluxPrimaryButton from './FluxPrimaryButton.vue';
|
|
60
|
+
import FluxSecondaryButton from './FluxSecondaryButton.vue';
|
|
61
|
+
import $style from '$flux/css/component/Pagination.module.scss';
|
|
62
|
+
|
|
63
|
+
const emit = defineEmits<{
|
|
64
|
+
navigate: [number];
|
|
65
|
+
}>();
|
|
66
|
+
|
|
67
|
+
const {
|
|
68
|
+
page,
|
|
69
|
+
perPage,
|
|
70
|
+
total
|
|
71
|
+
} = defineProps<{
|
|
72
|
+
readonly arrows?: boolean;
|
|
73
|
+
readonly isCompact?: boolean;
|
|
74
|
+
readonly page: number;
|
|
75
|
+
readonly perPage: number;
|
|
76
|
+
readonly total: number;
|
|
77
|
+
}>();
|
|
78
|
+
|
|
79
|
+
const translate = useTranslate();
|
|
80
|
+
|
|
81
|
+
const pages = computed(() => Math.ceil(total / perPage));
|
|
82
|
+
const isNextDisabled = computed(() => page >= unref(pages));
|
|
83
|
+
const isPreviousDisabled = computed(() => page <= 1);
|
|
84
|
+
|
|
85
|
+
const visiblePages = computed(() => {
|
|
86
|
+
if (unref(pages) === 0) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const sizes = {
|
|
91
|
+
end: 1,
|
|
92
|
+
middle: 1
|
|
93
|
+
} as const;
|
|
94
|
+
|
|
95
|
+
let dots = false;
|
|
96
|
+
let visible: (number | 'dots')[] = [];
|
|
97
|
+
|
|
98
|
+
if (unref(pages) === (sizes.end + sizes.middle + 2)) {
|
|
99
|
+
for (let n = 1; n <= unref(pages); ++n) {
|
|
100
|
+
visible.push(n);
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
for (let n = 1; n <= unref(pages); ++n) {
|
|
104
|
+
if (page === n) {
|
|
105
|
+
dots = true;
|
|
106
|
+
visible.push(n);
|
|
107
|
+
} else if (n <= sizes.end || (n >= page - sizes.middle && n <= page + sizes.middle) || n > unref(pages) - sizes.end) {
|
|
108
|
+
dots = true;
|
|
109
|
+
visible.push(n);
|
|
110
|
+
} else if (dots) {
|
|
111
|
+
dots = false;
|
|
112
|
+
visible.push('dots');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return visible;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
function navigate(page: number): void {
|
|
121
|
+
emit('navigate', page);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function next(): void {
|
|
125
|
+
navigate(page + 1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function previous(): void {
|
|
129
|
+
navigate(page - 1);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function prompt(): Promise<void> {
|
|
133
|
+
const pageStr = await showPrompt({
|
|
134
|
+
icon: 'ellipsis',
|
|
135
|
+
title: translate('flux.paginationNavigateTitle'),
|
|
136
|
+
message: translate('flux.paginationNavigateMessage'),
|
|
137
|
+
fieldLabel: translate('flux.paginationNavigatePage')
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const page = Number(pageStr);
|
|
141
|
+
|
|
142
|
+
if (isNaN(page) || page > unref(pages) || page <= 0) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
navigate(page);
|
|
147
|
+
}
|
|
148
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxStack :class="$style.paginationBar">
|
|
3
|
+
<FluxFormInputGroup>
|
|
4
|
+
<FluxFormInputAddition>
|
|
5
|
+
<span>{{ translate('flux.rowsPerPage') }}</span>
|
|
6
|
+
</FluxFormInputAddition>
|
|
7
|
+
|
|
8
|
+
<FluxFormSelect
|
|
9
|
+
v-model="limit"
|
|
10
|
+
:options="limitOptions"/>
|
|
11
|
+
</FluxFormInputGroup>
|
|
12
|
+
|
|
13
|
+
<FluxSpacer :class="$style.paginationBarSpacer"/>
|
|
14
|
+
|
|
15
|
+
<FluxFormInputGroup>
|
|
16
|
+
<FluxFormInputAddition>
|
|
17
|
+
<span>
|
|
18
|
+
{{
|
|
19
|
+
translate('flux.displayingOf', {
|
|
20
|
+
from: (page - 1) * perPage + 1,
|
|
21
|
+
to: Math.min(total, page * perPage),
|
|
22
|
+
total: total
|
|
23
|
+
})
|
|
24
|
+
}}
|
|
25
|
+
</span>
|
|
26
|
+
</FluxFormInputAddition>
|
|
27
|
+
|
|
28
|
+
<FluxPagination
|
|
29
|
+
v-if="total > perPage"
|
|
30
|
+
arrows
|
|
31
|
+
is-compact
|
|
32
|
+
:page="page"
|
|
33
|
+
:per-page="perPage"
|
|
34
|
+
:total="total"
|
|
35
|
+
@navigate="$emit('navigate', $event)"/>
|
|
36
|
+
</FluxFormInputGroup>
|
|
37
|
+
</FluxStack>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script
|
|
41
|
+
lang="ts"
|
|
42
|
+
setup>
|
|
43
|
+
import type { FluxFormSelectOption } from '@flux-ui/types';
|
|
44
|
+
import { computed, ref, watch } from 'vue';
|
|
45
|
+
import { useTranslate } from '$flux/composable/private';
|
|
46
|
+
import FluxFormInputAddition from './FluxFormInputAddition.vue';
|
|
47
|
+
import FluxFormInputGroup from './FluxFormInputGroup.vue';
|
|
48
|
+
import FluxFormSelect from './FluxFormSelect.vue';
|
|
49
|
+
import FluxPagination from './FluxPagination.vue';
|
|
50
|
+
import FluxSpacer from './FluxSpacer.vue';
|
|
51
|
+
import FluxStack from './FluxStack.vue';
|
|
52
|
+
import $style from '$flux/css/component/Pagination.module.scss';
|
|
53
|
+
|
|
54
|
+
const emit = defineEmits<{
|
|
55
|
+
limit: [number];
|
|
56
|
+
navigate: [number];
|
|
57
|
+
}>();
|
|
58
|
+
|
|
59
|
+
const {
|
|
60
|
+
limits = [5, 10, 25, 50, 100],
|
|
61
|
+
perPage
|
|
62
|
+
} = defineProps<{
|
|
63
|
+
readonly limits?: number[];
|
|
64
|
+
readonly page: number;
|
|
65
|
+
readonly perPage: number;
|
|
66
|
+
readonly total: number;
|
|
67
|
+
}>();
|
|
68
|
+
|
|
69
|
+
const translate = useTranslate();
|
|
70
|
+
|
|
71
|
+
const limit = ref(perPage);
|
|
72
|
+
|
|
73
|
+
const limitOptions = computed(() => limits.map<FluxFormSelectOption>(limit => ({
|
|
74
|
+
label: limit.toString(),
|
|
75
|
+
value: limit
|
|
76
|
+
})));
|
|
77
|
+
|
|
78
|
+
watch(limit, limit => emit('limit', limit));
|
|
79
|
+
|
|
80
|
+
watch(() => perPage, perPage => limit.value = perPage, {immediate: true});
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="CLASS_MAP[variant]">
|
|
3
|
+
<slot/>
|
|
4
|
+
|
|
5
|
+
<slot
|
|
6
|
+
v-if="isLoading"
|
|
7
|
+
name="loader">
|
|
8
|
+
<div :class="$style.paneLoader">
|
|
9
|
+
<FluxSpinner/>
|
|
10
|
+
</div>
|
|
11
|
+
</slot>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
v-if="tag"
|
|
15
|
+
:class="$style.paneTag">
|
|
16
|
+
{{ tag }}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script
|
|
22
|
+
lang="ts"
|
|
23
|
+
setup>
|
|
24
|
+
import FluxSpinner from './FluxSpinner.vue';
|
|
25
|
+
import $style from '$flux/css/component/Pane.module.scss';
|
|
26
|
+
|
|
27
|
+
const CLASS_MAP = {
|
|
28
|
+
default: $style.paneDefault,
|
|
29
|
+
flat: $style.paneFlat,
|
|
30
|
+
well: $style.paneWell
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
variant = 'default'
|
|
35
|
+
} = defineProps<{
|
|
36
|
+
readonly isLoading?: boolean;
|
|
37
|
+
readonly tag?: string;
|
|
38
|
+
readonly variant?: 'default' | 'flat' | 'well';
|
|
39
|
+
}>();
|
|
40
|
+
|
|
41
|
+
defineSlots<{
|
|
42
|
+
default(): any;
|
|
43
|
+
loader(): any;
|
|
44
|
+
}>();
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.paneDeck">
|
|
3
|
+
<FluxAutoGrid
|
|
4
|
+
:gap="0"
|
|
5
|
+
:min-column-width="minColumnWidth">
|
|
6
|
+
<slot/>
|
|
7
|
+
</FluxAutoGrid>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script
|
|
12
|
+
lang="ts"
|
|
13
|
+
setup>
|
|
14
|
+
import FluxAutoGrid from './FluxAutoGrid.vue';
|
|
15
|
+
import $style from '$flux/css/component/Pane.module.scss';
|
|
16
|
+
|
|
17
|
+
defineProps<{
|
|
18
|
+
readonly minColumnWidth: number;
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
defineSlots<{
|
|
22
|
+
default(): any;
|
|
23
|
+
}>();
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.paneHeader">
|
|
3
|
+
<slot name="before"/>
|
|
4
|
+
|
|
5
|
+
<FluxIcon
|
|
6
|
+
v-if="icon"
|
|
7
|
+
:class="$style.paneHeaderIcon"
|
|
8
|
+
:size="20"
|
|
9
|
+
:name="icon"/>
|
|
10
|
+
|
|
11
|
+
<div
|
|
12
|
+
v-if="title || subTitle"
|
|
13
|
+
:class="$style.paneHeaderCaption">
|
|
14
|
+
<strong v-if="title">
|
|
15
|
+
{{ title }}
|
|
16
|
+
</strong>
|
|
17
|
+
|
|
18
|
+
<span v-if="subTitle">
|
|
19
|
+
{{ subTitle }}
|
|
20
|
+
</span>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<slot name="after"/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script
|
|
28
|
+
lang="ts"
|
|
29
|
+
setup>
|
|
30
|
+
import type { FluxIconName } from '@flux-ui/types';
|
|
31
|
+
import FluxIcon from './FluxIcon.vue';
|
|
32
|
+
import $style from '$flux/css/component/Pane.module.scss';
|
|
33
|
+
|
|
34
|
+
defineProps<{
|
|
35
|
+
readonly icon?: FluxIconName;
|
|
36
|
+
readonly subTitle?: string;
|
|
37
|
+
readonly title?: string;
|
|
38
|
+
}>();
|
|
39
|
+
|
|
40
|
+
defineSlots<{
|
|
41
|
+
after(): any;
|
|
42
|
+
before(): any;
|
|
43
|
+
}>();
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="isMasked ? $style.paneIllustrationMasked : $style.paneIllustration"
|
|
4
|
+
:style="{
|
|
5
|
+
aspectRatio
|
|
6
|
+
}">
|
|
7
|
+
<div
|
|
8
|
+
:class="$style.paneIllustrationMagic"
|
|
9
|
+
:style="{
|
|
10
|
+
border: `1px solid ${borderColor}`
|
|
11
|
+
}">
|
|
12
|
+
<FluxGridPattern :stroke-dasharray="3"/>
|
|
13
|
+
|
|
14
|
+
<FluxAnimatedColors
|
|
15
|
+
:colors="animatedColors"
|
|
16
|
+
:opacity="animatedOpacity"
|
|
17
|
+
:seed="animatedSeed"/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
v-if="slots.controlled"
|
|
22
|
+
:class="$style.paneIllustrationContentControlled">
|
|
23
|
+
<slot name="controlled"/>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
v-if="slots.default"
|
|
28
|
+
:class="$style.paneIllustrationContent">
|
|
29
|
+
<slot/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script
|
|
35
|
+
lang="ts"
|
|
36
|
+
setup>
|
|
37
|
+
import { hexToRGB } from '@basmilius/utils';
|
|
38
|
+
import { computed } from 'vue';
|
|
39
|
+
import FluxAnimatedColors from './FluxAnimatedColors.vue';
|
|
40
|
+
import FluxGridPattern from './FluxGridPattern.vue';
|
|
41
|
+
import $style from '$flux/css/component/Pane.module.scss';
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
animatedColors,
|
|
45
|
+
aspectRatio = 16 / 9
|
|
46
|
+
} = defineProps<{
|
|
47
|
+
readonly animatedColors: string[];
|
|
48
|
+
readonly animatedOpacity?: number;
|
|
49
|
+
readonly animatedSeed?: number;
|
|
50
|
+
readonly aspectRatio?: number;
|
|
51
|
+
readonly isMasked?: boolean;
|
|
52
|
+
}>();
|
|
53
|
+
|
|
54
|
+
const slots = defineSlots<{
|
|
55
|
+
default?(): any;
|
|
56
|
+
controlled?(): any;
|
|
57
|
+
}>();
|
|
58
|
+
|
|
59
|
+
const borderColor = computed(() => {
|
|
60
|
+
if (!animatedColors || animatedColors.length === 0) {
|
|
61
|
+
return 'transparent';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const [r, g, b] = hexToRGB(animatedColors[0]);
|
|
65
|
+
|
|
66
|
+
return `rgb(${r} ${g} ${b} / .15)`;
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="isInset ? $style.paneMediaInset : $style.paneMedia">
|
|
3
|
+
<img
|
|
4
|
+
v-if="imageUrl"
|
|
5
|
+
:class="$style.paneMediaImage"
|
|
6
|
+
:style="{
|
|
7
|
+
objectPosition: `${focalPointX}% ${focalPointY}%`
|
|
8
|
+
}"
|
|
9
|
+
:src="imageUrl"
|
|
10
|
+
:alt="imageAlt">
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script
|
|
15
|
+
lang="ts"
|
|
16
|
+
setup>
|
|
17
|
+
import { computed } from 'vue';
|
|
18
|
+
import $style from '$flux/css/component/Pane.module.scss';
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
imageFocalPoint
|
|
22
|
+
} = defineProps<{
|
|
23
|
+
readonly imageAlt?: string;
|
|
24
|
+
readonly imageFocalPoint?: [number, number];
|
|
25
|
+
readonly imageUrl?: string;
|
|
26
|
+
readonly isInset?: boolean;
|
|
27
|
+
}>();
|
|
28
|
+
|
|
29
|
+
const focalPointX = computed(() => imageFocalPoint?.[0] ?? 50);
|
|
30
|
+
const focalPointY = computed(() => imageFocalPoint?.[1] ?? 50);
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.percentageBar">
|
|
3
|
+
<div :class="$style.percentageBarTrack">
|
|
4
|
+
<FluxTooltip v-for="item of items">
|
|
5
|
+
<template #content>
|
|
6
|
+
<div :class="$style.percentageBarTooltip">
|
|
7
|
+
<FluxIcon
|
|
8
|
+
v-if="item.icon"
|
|
9
|
+
:name="item.icon"
|
|
10
|
+
:size="16"/>
|
|
11
|
+
|
|
12
|
+
<span>{{ formatPercentage(item.value) }} {{ item.label }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
:class="$style.percentageBarSegment"
|
|
18
|
+
:style="{
|
|
19
|
+
backgroundColor: item.color,
|
|
20
|
+
flexGrow: item.value
|
|
21
|
+
}"/>
|
|
22
|
+
</FluxTooltip>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<FluxLegend
|
|
26
|
+
v-if="isLegendVisible"
|
|
27
|
+
:items="items"/>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script
|
|
32
|
+
lang="ts"
|
|
33
|
+
setup>
|
|
34
|
+
import { formatPercentage } from '@basmilius/utils';
|
|
35
|
+
import type { FluxPercentageBarItemObject } from '@flux-ui/types';
|
|
36
|
+
import FluxIcon from './FluxIcon.vue';
|
|
37
|
+
import FluxLegend from './FluxLegend.vue';
|
|
38
|
+
import FluxTooltip from './FluxTooltip.vue';
|
|
39
|
+
import $style from '$flux/css/component/PercentageBar.module.scss';
|
|
40
|
+
|
|
41
|
+
defineProps<{
|
|
42
|
+
readonly isLegendVisible?: boolean;
|
|
43
|
+
readonly items: FluxPercentageBarItemObject[];
|
|
44
|
+
}>();
|
|
45
|
+
</script>
|