@flux-ui/components 3.0.0-next.26 → 3.0.0-next.29
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/FluxAnimatedColors.vue.d.ts +1 -0
- package/dist/component/FluxBorderShine.vue.d.ts +1 -1
- package/dist/component/FluxFormInput.vue.d.ts +1 -0
- package/dist/component/FluxGallery.vue.d.ts +2 -2
- package/dist/component/FluxItemActions.vue.d.ts +4 -1
- package/dist/component/FluxItemContent.vue.d.ts +4 -1
- package/dist/component/FluxItemMedia.vue.d.ts +5 -1
- package/dist/component/FluxPrompt.vue.d.ts +2 -0
- package/dist/component/FluxTableCell.vue.d.ts +1 -0
- package/dist/component/primitive/FilterBadge.vue.d.ts +12 -0
- package/dist/component/primitive/SelectBase.vue.d.ts +5 -3
- package/dist/component/primitive/SliderBase.vue.d.ts +2 -2
- package/dist/component/primitive/index.d.ts +2 -0
- package/dist/composable/private/index.d.ts +0 -1
- package/dist/index.css +189 -131
- package/dist/index.js +4058 -864
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/component/FluxAnimatedColors.vue +6 -4
- package/src/component/FluxAutoGrid.vue +1 -1
- package/src/component/FluxContainer.vue +1 -1
- package/src/component/FluxExpandable.vue +1 -1
- package/src/component/FluxFader.vue +2 -1
- package/src/component/FluxFilterBar.vue +32 -8
- package/src/component/FluxFilterOptionAsync.vue +1 -2
- package/src/component/FluxFilterOptionsAsync.vue +1 -2
- package/src/component/FluxFormInput.vue +7 -0
- package/src/component/FluxFormSelectAsync.vue +2 -2
- package/src/component/FluxGrid.vue +1 -1
- package/src/component/FluxIcon.vue +0 -12
- package/src/component/FluxItemActions.vue +6 -2
- package/src/component/FluxItemContent.vue +5 -1
- package/src/component/FluxItemMedia.vue +10 -1
- package/src/component/FluxOverflowBar.vue +11 -1
- package/src/component/FluxPressable.vue +1 -1
- package/src/component/FluxStack.vue +1 -1
- package/src/component/FluxTabBar.vue +2 -1
- package/src/component/FluxTableCell.vue +3 -1
- package/src/component/primitive/AnchorPopup.vue +1 -1
- package/src/component/primitive/FilterBadge.vue +43 -0
- package/src/component/primitive/FilterItem.vue +1 -1
- package/src/component/primitive/SelectBase.vue +2 -1
- package/src/component/primitive/index.ts +2 -0
- package/src/composable/private/index.ts +0 -1
- package/src/css/component/Badge.module.scss +2 -1
- package/src/css/component/Filter.module.scss +31 -2
- package/src/css/component/Icon.module.scss +25 -40
- package/src/css/component/Item.module.scss +20 -5
- package/src/css/component/Menu.module.scss +3 -0
- package/src/css/component/Pane.module.scss +10 -1
- package/src/css/component/Tab.module.scss +7 -0
- package/src/css/component/Table.module.scss +1 -1
- package/src/css/component/Timeline.module.scss +6 -2
- package/src/css/component/base/Button.module.scss +10 -0
- package/src/css/typography.scss +8 -2
- package/src/css/variables.scss +1 -1
- package/src/util/createDialogRenderer.ts +3 -1
- package/dist/composable/private/useLoaded.d.ts +0 -5
- package/src/composable/private/useLoaded.ts +0 -21
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flux-ui/components",
|
|
3
3
|
"description": "A set of opiniated UI components.",
|
|
4
|
-
"version": "3.0.0-next.
|
|
4
|
+
"version": "3.0.0-next.29",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
@@ -51,28 +51,28 @@
|
|
|
51
51
|
"typings": "./dist/index.d.ts",
|
|
52
52
|
"sideEffects": false,
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@basmilius/
|
|
55
|
-
"@
|
|
56
|
-
"@flux-ui/
|
|
54
|
+
"@basmilius/common": "^3.11.0",
|
|
55
|
+
"@basmilius/utils": "^3.11.0",
|
|
56
|
+
"@flux-ui/internals": "3.0.0-next.29",
|
|
57
|
+
"@flux-ui/types": "3.0.0-next.29",
|
|
57
58
|
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
58
59
|
"clsx": "^2.1.1",
|
|
59
60
|
"imask": "^7.6.1",
|
|
60
61
|
"lodash-es": "^4.17.23",
|
|
61
62
|
"luxon": "^3.7.2",
|
|
62
|
-
"vue": "^3.6.0-beta.
|
|
63
|
+
"vue": "^3.6.0-beta.7"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@basmilius/vite-preset": "^
|
|
66
|
+
"@basmilius/vite-preset": "^3.11.0",
|
|
66
67
|
"@types/lodash-es": "^4.17.12",
|
|
67
68
|
"@types/luxon": "^3.7.1",
|
|
68
|
-
"@types/node": "^25.3.
|
|
69
|
+
"@types/node": "^25.3.3",
|
|
69
70
|
"@vitejs/plugin-vue": "^6.0.4",
|
|
70
|
-
"@vue/
|
|
71
|
-
"@vue/tsconfig": "^0.8.1",
|
|
71
|
+
"@vue/tsconfig": "^0.9.0",
|
|
72
72
|
"pinia": "^3.0.4",
|
|
73
73
|
"sass-embedded": "^1.97.3",
|
|
74
74
|
"typescript": "^5.9.3",
|
|
75
|
-
"vite": "^8.0.0-beta.
|
|
76
|
-
"vue-tsc": "^3.2.
|
|
75
|
+
"vite": "^8.0.0-beta.16",
|
|
76
|
+
"vue-tsc": "^3.2.5"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<script
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
|
+
import { useComponentId } from '@basmilius/common';
|
|
10
11
|
import { mulberry32 } from '@basmilius/utils';
|
|
11
|
-
import { useComponentId } from '@flux-ui/internals';
|
|
12
12
|
import { computed, onBeforeUnmount, onMounted, ref, unref, useTemplateRef, watch } from 'vue';
|
|
13
13
|
import $style from '$flux/css/component/Visual.module.scss';
|
|
14
14
|
|
|
@@ -19,12 +19,14 @@
|
|
|
19
19
|
colors,
|
|
20
20
|
incrementor = 1,
|
|
21
21
|
opacity = .5,
|
|
22
|
-
seed
|
|
22
|
+
seed,
|
|
23
|
+
static: isStatic
|
|
23
24
|
} = defineProps<{
|
|
24
25
|
readonly colors?: string[];
|
|
25
26
|
readonly incrementor?: number;
|
|
26
27
|
readonly opacity?: number;
|
|
27
28
|
readonly seed?: number;
|
|
29
|
+
readonly static?: boolean;
|
|
28
30
|
}>();
|
|
29
31
|
|
|
30
32
|
const canvasRef = useTemplateRef('canvas');
|
|
@@ -119,7 +121,7 @@
|
|
|
119
121
|
context.restore();
|
|
120
122
|
}
|
|
121
123
|
|
|
122
|
-
schedule();
|
|
124
|
+
!isStatic && schedule();
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
watch(canvasRef, canvas => {
|
|
@@ -136,6 +138,6 @@
|
|
|
136
138
|
|
|
137
139
|
watch(polygons, () => {
|
|
138
140
|
cancel();
|
|
139
|
-
schedule();
|
|
141
|
+
!isStatic && schedule();
|
|
140
142
|
});
|
|
141
143
|
</script>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<script
|
|
51
51
|
lang="ts"
|
|
52
52
|
setup>
|
|
53
|
-
import { useComponentId } from '@
|
|
53
|
+
import { useComponentId } from '@basmilius/common';
|
|
54
54
|
import type { FluxIconName } from '@flux-ui/types';
|
|
55
55
|
import { computed, getCurrentInstance, onBeforeMount, onUnmounted, ref, unref, useId, watch } from 'vue';
|
|
56
56
|
import { useExpandableGroupInjection } from '$flux/composable';
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
<script
|
|
10
10
|
lang="ts"
|
|
11
11
|
setup>
|
|
12
|
-
import {
|
|
12
|
+
import { useInterval } from '@basmilius/common';
|
|
13
|
+
import { unrefTemplateElement } from '@flux-ui/internals';
|
|
13
14
|
import { computed, ref, unref, useTemplateRef, watch } from 'vue';
|
|
14
15
|
import $style from '$flux/css/component/Fader.module.scss';
|
|
15
16
|
|
|
@@ -20,16 +20,35 @@
|
|
|
20
20
|
<template
|
|
21
21
|
v-for="button of buttons"
|
|
22
22
|
:key="button.name">
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
<FluxFlyout>
|
|
24
|
+
<template #opener="{open}">
|
|
25
|
+
<FluxSecondaryButton
|
|
26
|
+
v-if="modelValue[button.name]"
|
|
27
|
+
:class="$style.filterButton"
|
|
28
|
+
:icon-leading="button.icon"
|
|
29
|
+
:label="button.label"
|
|
30
|
+
@click="open()">
|
|
31
|
+
<template #after>
|
|
32
|
+
<FilterBadge
|
|
33
|
+
:item="button"
|
|
34
|
+
:value="modelValue[button.name]"/>
|
|
35
|
+
</template>
|
|
36
|
+
</FluxSecondaryButton>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<div :class="$style.filter">
|
|
40
|
+
<FluxMenu>
|
|
41
|
+
<VNodeRenderer :vnode="filters[button.name]"/>
|
|
42
|
+
</FluxMenu>
|
|
43
|
+
</div>
|
|
44
|
+
</FluxFlyout>
|
|
27
45
|
</template>
|
|
28
46
|
|
|
29
47
|
<template #overflow>
|
|
30
|
-
<
|
|
31
|
-
v-if="
|
|
32
|
-
|
|
48
|
+
<FluxSeparator
|
|
49
|
+
v-if="isFiltered"
|
|
50
|
+
direction="vertical"
|
|
51
|
+
style="margin-top: 9px; margin-bottom: 9px"/>
|
|
33
52
|
|
|
34
53
|
<FluxFlyout>
|
|
35
54
|
<template #opener="{open}">
|
|
@@ -56,14 +75,17 @@
|
|
|
56
75
|
lang="ts"
|
|
57
76
|
setup>
|
|
58
77
|
import type { FluxFilterState } from '@flux-ui/types';
|
|
78
|
+
import { computed, unref } from "vue";
|
|
79
|
+
import { FilterBadge, VNodeRenderer } from '$flux/component/primitive';
|
|
59
80
|
import FluxFilterBase from './FluxFilterBase.vue';
|
|
60
81
|
import FluxFilterWindow from './FluxFilterWindow.vue';
|
|
61
82
|
import FluxFlyout from './FluxFlyout.vue';
|
|
62
83
|
import FluxFormInput from './FluxFormInput.vue';
|
|
84
|
+
import FluxMenu from '$flux/component/FluxMenu.vue';
|
|
63
85
|
import FluxOverflowBar from './FluxOverflowBar.vue';
|
|
64
86
|
import FluxSecondaryButton from './FluxSecondaryButton.vue';
|
|
87
|
+
import FluxSeparator from '$flux/component/FluxSeparator.vue';
|
|
65
88
|
import $style from '$flux/css/component/Filter.module.scss';
|
|
66
|
-
import FluxSpacing from '$flux/component/FluxSpacing.vue';
|
|
67
89
|
|
|
68
90
|
const emit = defineEmits<{
|
|
69
91
|
reset: [string];
|
|
@@ -87,6 +109,8 @@
|
|
|
87
109
|
default?(): any;
|
|
88
110
|
}>();
|
|
89
111
|
|
|
112
|
+
const isFiltered = computed(() => Object.entries(unref(modelValue)).filter(([, val]) => Boolean(val)).length > 0);
|
|
113
|
+
|
|
90
114
|
function reset(name: string): void {
|
|
91
115
|
emit('reset', name);
|
|
92
116
|
}
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
-
import { useDebouncedRef } from '@
|
|
15
|
+
import { useDebouncedRef, useLoaded } from '@basmilius/common';
|
|
16
16
|
import type { FluxFilterOptionRow, FluxFilterValue, FluxFilterValueSingle, FluxIconName } from '@flux-ui/types';
|
|
17
17
|
import { computed, ref, unref, watch } from 'vue';
|
|
18
18
|
import { useFilterInjection } from '$flux/composable';
|
|
19
|
-
import { useLoaded } from '$flux/composable/private';
|
|
20
19
|
import { isFluxFilterOptionItem } from '$flux/data';
|
|
21
20
|
import { FilterOptionBase } from './primitive';
|
|
22
21
|
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
-
import { useDebouncedRef } from '@
|
|
15
|
+
import { useDebouncedRef, useLoaded } from '@basmilius/common';
|
|
16
16
|
import type { FluxFilterOptionRow, FluxFilterValue, FluxFilterValueSingle, FluxIconName } from '@flux-ui/types';
|
|
17
17
|
import { computed, ref, unref, watch } from 'vue';
|
|
18
18
|
import { useFilterInjection } from '$flux/composable';
|
|
19
|
-
import { useLoaded } from '$flux/composable/private';
|
|
20
19
|
import { isFluxFilterOptionItem } from '$flux/data';
|
|
21
20
|
import { FilterOptionBase } from './primitive';
|
|
22
21
|
|
|
@@ -49,6 +49,11 @@
|
|
|
49
49
|
:class="$style.formInputIconTrailing"
|
|
50
50
|
:name="iconTrailing"
|
|
51
51
|
:size="18"/>
|
|
52
|
+
|
|
53
|
+
<FluxSpinner
|
|
54
|
+
v-if="isLoading"
|
|
55
|
+
:class="$style.formInputIconTrailing"
|
|
56
|
+
:size="18"/>
|
|
52
57
|
</div>
|
|
53
58
|
</template>
|
|
54
59
|
|
|
@@ -63,6 +68,7 @@
|
|
|
63
68
|
import { useDisabled, useFormFieldInjection } from '$flux/composable';
|
|
64
69
|
import { inputMask } from '$flux/data';
|
|
65
70
|
import FluxIcon from './FluxIcon.vue';
|
|
71
|
+
import FluxSpinner from './FluxSpinner.vue';
|
|
66
72
|
import $style from '$flux/css/component/Form.module.scss';
|
|
67
73
|
|
|
68
74
|
const emit = defineEmits<{
|
|
@@ -87,6 +93,7 @@
|
|
|
87
93
|
readonly iconTrailing?: FluxIconName;
|
|
88
94
|
readonly disabled?: boolean;
|
|
89
95
|
readonly isCondensed?: boolean;
|
|
96
|
+
readonly isLoading?: boolean;
|
|
90
97
|
readonly isReadonly?: boolean;
|
|
91
98
|
readonly isSecondary?: boolean;
|
|
92
99
|
readonly max?: string | number;
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
<script
|
|
17
17
|
lang="ts"
|
|
18
18
|
setup>
|
|
19
|
-
import { useDebouncedRef } from '@
|
|
19
|
+
import { useDebouncedRef, useLoaded } from '@basmilius/common';
|
|
20
20
|
import type { FluxFormSelectEntry, FluxFormSelectValue, FluxFormSelectValueSingle } from '@flux-ui/types';
|
|
21
21
|
import { computed, ref, toRef, unref, watch } from 'vue';
|
|
22
22
|
import { SelectBase } from '$flux/component/primitive';
|
|
23
23
|
import { useDisabled } from '$flux/composable';
|
|
24
|
-
import { useFormSelect
|
|
24
|
+
import { useFormSelect } from '$flux/composable/private';
|
|
25
25
|
import { isFluxFormSelectOption } from '$flux/data';
|
|
26
26
|
|
|
27
27
|
const modelSearch = defineModel<string>('searchQuery', {
|
|
@@ -17,18 +17,6 @@
|
|
|
17
17
|
fill="currentColor"/>
|
|
18
18
|
</svg>
|
|
19
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
20
|
<i
|
|
33
21
|
v-else
|
|
34
22
|
:class="$style.icon"/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FluxActionBar
|
|
3
|
-
:class="$style.itemActions"
|
|
3
|
+
:class="[$style.itemActions, isCenter && $style.isCenter]"
|
|
4
4
|
#primary>
|
|
5
5
|
<slot/>
|
|
6
6
|
</FluxActionBar>
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
<script
|
|
10
10
|
lang="ts"
|
|
11
11
|
setup>
|
|
12
|
-
import FluxActionBar from './FluxActionBar.vue';
|
|
13
12
|
import $style from '$flux/css/component/Item.module.scss';
|
|
13
|
+
import FluxActionBar from './FluxActionBar.vue';
|
|
14
|
+
|
|
15
|
+
defineProps<{
|
|
16
|
+
readonly isCenter?: boolean;
|
|
17
|
+
}>();
|
|
14
18
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="$style.itemContent">
|
|
2
|
+
<div :class="[$style.itemContent, isCenter && $style.isCenter]">
|
|
3
3
|
<slot/>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -8,4 +8,8 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import $style from '$flux/css/component/Item.module.scss';
|
|
11
|
+
|
|
12
|
+
defineProps<{
|
|
13
|
+
readonly isCenter?: boolean;
|
|
14
|
+
}>();
|
|
11
15
|
</script>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:class="[$style.itemMedia, isCenter && $style.isCenter]"
|
|
4
|
+
:style="{
|
|
5
|
+
'--size': size && `${size}px`
|
|
6
|
+
}">
|
|
3
7
|
<slot/>
|
|
4
8
|
</div>
|
|
5
9
|
</template>
|
|
@@ -8,4 +12,9 @@
|
|
|
8
12
|
lang="ts"
|
|
9
13
|
setup>
|
|
10
14
|
import $style from '$flux/css/component/Item.module.scss';
|
|
15
|
+
|
|
16
|
+
defineProps<{
|
|
17
|
+
readonly isCenter?: boolean;
|
|
18
|
+
readonly size?: number;
|
|
19
|
+
}>();
|
|
11
20
|
</script>
|
|
@@ -76,7 +76,17 @@
|
|
|
76
76
|
availableSize.value = direction === 'horizontal' ? bar.offsetWidth : bar.offsetHeight;
|
|
77
77
|
itemSizes.value = Array.from(measurer.children)
|
|
78
78
|
.filter(item => item instanceof HTMLElement)
|
|
79
|
-
.map(item =>
|
|
79
|
+
.map(item => {
|
|
80
|
+
const {display} = getComputedStyle(item);
|
|
81
|
+
|
|
82
|
+
if (display === 'contents') {
|
|
83
|
+
item = item.children[0] as HTMLElement;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return direction === 'horizontal'
|
|
87
|
+
? item.offsetWidth
|
|
88
|
+
: item.offsetHeight;
|
|
89
|
+
});
|
|
80
90
|
|
|
81
91
|
let size = 0;
|
|
82
92
|
let visible = 0;
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
<script
|
|
41
41
|
lang="ts"
|
|
42
42
|
setup>
|
|
43
|
-
import {
|
|
43
|
+
import { useMutationObserver } from '@basmilius/common';
|
|
44
|
+
import { unrefTemplateElement, useEventListener } from '@flux-ui/internals';
|
|
44
45
|
import { clsx } from 'clsx';
|
|
45
46
|
import { onMounted, ref, useTemplateRef } from 'vue';
|
|
46
47
|
import { FluxFadeTransition } from '$flux/transition';
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
<div
|
|
13
13
|
:class="$style.tableCellContent"
|
|
14
14
|
:style="{
|
|
15
|
-
flexFlow: contentDirection
|
|
15
|
+
flexFlow: contentDirection,
|
|
16
|
+
gap: contentGap && `${contentGap}px`
|
|
16
17
|
}">
|
|
17
18
|
<slot/>
|
|
18
19
|
</div>
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
contentDirection = 'row'
|
|
32
33
|
} = defineProps<{
|
|
33
34
|
readonly contentDirection?: 'column' | 'row';
|
|
35
|
+
readonly contentGap?: number;
|
|
34
36
|
}>();
|
|
35
37
|
|
|
36
38
|
defineSlots<{
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<script
|
|
14
14
|
lang="ts"
|
|
15
15
|
setup>
|
|
16
|
+
import { useMutationObserver } from '@basmilius/common';
|
|
16
17
|
import { isHtmlElement } from '@basmilius/utils';
|
|
17
|
-
import { useMutationObserver } from '@flux-ui/internals';
|
|
18
18
|
import type { FluxDirection } from '@flux-ui/types';
|
|
19
19
|
import { type ComponentPublicInstance, onMounted, onUnmounted, reactive, ref, unref, useTemplateRef, watchEffect } from 'vue';
|
|
20
20
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FluxBadge
|
|
3
|
+
v-if="valueLabel"
|
|
4
|
+
:class="$style.filterBadge"
|
|
5
|
+
:is-loading="isLoading"
|
|
6
|
+
:label="valueLabel"
|
|
7
|
+
@click="onClick"/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script
|
|
11
|
+
lang="ts"
|
|
12
|
+
setup>
|
|
13
|
+
import { useLoaded } from '@basmilius/common';
|
|
14
|
+
import type { FluxFilterItem, FluxFilterValue } from '@flux-ui/types';
|
|
15
|
+
import { computed, ref, unref, watch } from 'vue';
|
|
16
|
+
import { FluxBadge } from '$flux/component';
|
|
17
|
+
import $style from '$flux/css/component/Filter.module.scss';
|
|
18
|
+
|
|
19
|
+
const emit = defineEmits<{
|
|
20
|
+
click: [MouseEvent];
|
|
21
|
+
}>();
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
item,
|
|
25
|
+
value
|
|
26
|
+
} = defineProps<{
|
|
27
|
+
readonly item: FluxFilterItem;
|
|
28
|
+
readonly value: FluxFilterValue;
|
|
29
|
+
}>();
|
|
30
|
+
|
|
31
|
+
const {isLoading, loaded} = useLoaded();
|
|
32
|
+
const getValueLabel = computed(() => loaded(item.getValueLabel));
|
|
33
|
+
|
|
34
|
+
const valueLabel = ref<string>();
|
|
35
|
+
|
|
36
|
+
function onClick(evt: MouseEvent): void {
|
|
37
|
+
emit('click', evt);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
watch([() => item, () => value], async () => {
|
|
41
|
+
valueLabel.value = await unref(getValueLabel)(value) ?? undefined;
|
|
42
|
+
}, {deep: true, immediate: true});
|
|
43
|
+
</script>
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
<script
|
|
13
13
|
lang="ts"
|
|
14
14
|
setup>
|
|
15
|
+
import { useLoaded } from '@basmilius/common';
|
|
15
16
|
import type { FluxFilterItem, FluxFilterValue } from '@flux-ui/types';
|
|
16
17
|
import { computed, ref, unref, watch } from 'vue';
|
|
17
|
-
import { useLoaded } from '$flux/composable/private';
|
|
18
18
|
import FluxMenuItem from '$flux/component/FluxMenuItem.vue';
|
|
19
19
|
|
|
20
20
|
const emit = defineEmits<{
|
|
@@ -133,7 +133,8 @@
|
|
|
133
133
|
<script
|
|
134
134
|
lang="ts"
|
|
135
135
|
setup>
|
|
136
|
-
import {
|
|
136
|
+
import { useClickOutside } from '@basmilius/common';
|
|
137
|
+
import { unrefTemplateElement } from '@flux-ui/internals';
|
|
137
138
|
import type { FluxFormSelectOption, FluxFormSelectOptions } from '@flux-ui/types';
|
|
138
139
|
import { clsx } from 'clsx';
|
|
139
140
|
import { type ComponentPublicInstance, computed, nextTick, ref, toRef, unref, useTemplateRef, watch } from 'vue';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as Anchor } from './Anchor.vue';
|
|
2
2
|
export { default as AnchorPopup } from './AnchorPopup.vue';
|
|
3
|
+
export { default as FilterBadge } from './FilterBadge.vue';
|
|
4
|
+
export { default as FilterItem } from './FilterItem.vue';
|
|
3
5
|
export { default as FilterOptionBase } from './FilterOptionBase.vue';
|
|
4
6
|
export { default as SelectBase } from './SelectBase.vue';
|
|
5
7
|
export { default as SliderBase } from './SliderBase.vue';
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
color: var(--foreground-prominent);
|
|
17
17
|
font-size: 13px;
|
|
18
18
|
font-weight: 500;
|
|
19
|
+
font-variant-numeric: tabular-nums;
|
|
19
20
|
|
|
20
21
|
&:is(a) {
|
|
21
22
|
color: var(--foreground-prominent);
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
.badgeGray {
|
|
92
93
|
composes: badge;
|
|
93
94
|
|
|
94
|
-
--color: var(--
|
|
95
|
+
--color: var(--foreground);
|
|
95
96
|
|
|
96
97
|
.badgeLabel {
|
|
97
98
|
color: var(--foreground-prominent);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
max-height: 50dvh;
|
|
3
3
|
max-width: 100%;
|
|
4
4
|
padding: 9px;
|
|
5
|
-
width:
|
|
5
|
+
width: 270px;
|
|
6
6
|
overflow: auto;
|
|
7
7
|
scrollbar-width: none;
|
|
8
8
|
transition: height 150ms var(--deceleration-curve);
|
|
@@ -40,6 +40,32 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
.filterBadge {
|
|
44
|
+
padding-left: 6px;
|
|
45
|
+
padding-right: 6px;
|
|
46
|
+
background: var(--primary-50);
|
|
47
|
+
border: 1px dashed var(--primary-300);
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
|
|
50
|
+
:local(.badgeLabel) {
|
|
51
|
+
color: var(--primary-900);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.filterButton {
|
|
56
|
+
border: 1px solid var(--surface-stroke);
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
|
|
59
|
+
:local(.badge) {
|
|
60
|
+
border-radius: var(--radius-half);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:local(.buttonIcon) {
|
|
64
|
+
color: var(--primary-700);
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
43
69
|
.filterHeader {
|
|
44
70
|
position: sticky;
|
|
45
71
|
margin: -9px -9px 3px;
|
|
@@ -70,13 +96,16 @@
|
|
|
70
96
|
|
|
71
97
|
.filterSearch {
|
|
72
98
|
position: sticky;
|
|
73
|
-
top: 52px;
|
|
74
99
|
margin: -9px -9px 0;
|
|
75
100
|
padding: 9px;
|
|
76
101
|
background: linear-gradient(to bottom, var(--surface) 75%, transparent);
|
|
77
102
|
z-index: 1;
|
|
78
103
|
}
|
|
79
104
|
|
|
105
|
+
.filterHeader + .menuGroup .filterSearch {
|
|
106
|
+
top: 52px;
|
|
107
|
+
}
|
|
108
|
+
|
|
80
109
|
.filterBar {
|
|
81
110
|
display: flex;
|
|
82
111
|
flex-flow: row nowrap;
|