@dative-gpi/foundation-shared-components 1.1.23 → 1.1.24-unit-formatter
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/components/FSAccordionPanel.vue +0 -2
- package/components/FSButton.vue +87 -43
- package/components/FSCard.vue +100 -208
- package/components/FSCardPlaceholder.vue +25 -29
- package/components/FSChip.vue +127 -54
- package/components/FSChipGroup.vue +23 -141
- package/components/FSClickable.vue +326 -24
- package/components/FSColor.vue +3 -3
- package/components/FSColorIcon.vue +0 -1
- package/components/FSDialogContent.vue +28 -39
- package/components/FSDialogFormBody.vue +0 -2
- package/components/FSDialogMenu.vue +1 -8
- package/components/FSDialogMultiFormBody.vue +5 -6
- package/components/FSDivider.vue +1 -5
- package/components/FSEditImageUI.vue +30 -21
- package/components/FSGridMosaic.vue +0 -2
- package/components/FSIconCard.vue +1 -3
- package/components/FSIconCheck.vue +0 -8
- package/components/FSImageCard.vue +4 -4
- package/components/FSInstantPicker.vue +0 -2
- package/components/FSLink.vue +13 -1
- package/components/FSOptionItem.vue +4 -4
- package/components/FSOptionsMenu.vue +6 -6
- package/components/FSPlayButtons.vue +9 -11
- package/components/FSProgressBar.vue +28 -142
- package/components/FSRangePicker.vue +0 -2
- package/components/FSRouterLink.vue +14 -84
- package/components/FSSlideGroup.vue +1 -5
- package/components/FSWindow.vue +0 -2
- package/components/agenda/FSAgendaHorizontalEvent.vue +4 -4
- package/components/agenda/FSAgendaVerticalEvent.vue +4 -4
- package/components/deviceOrganisations/FSStatusRichCard.vue +7 -4
- package/components/fields/FSAutocompleteField.vue +0 -1
- package/components/fields/FSEntityFieldUI.vue +0 -12
- package/components/fields/FSRichTextField.vue +0 -2
- package/components/lists/FSDataIteratorItem.vue +0 -2
- package/components/lists/FSDataTableUI.vue +0 -12
- package/components/lists/FSFilterButton.vue +23 -34
- package/components/lists/FSHeaderButton.vue +3 -6
- package/components/lists/FSTileList.vue +6 -23
- package/components/map/FSMap.vue +1 -1
- package/components/map/FSMapMarker.vue +3 -4
- package/components/selects/FSSelectMapLayer.vue +0 -5
- package/components/tiles/FSChartTileUI.vue +0 -2
- package/components/tiles/FSFolderTileUI.vue +2 -2
- package/components/tiles/FSLocationTileUI.vue +0 -2
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -2
- package/components/tiles/FSTile.vue +64 -32
- package/components/tiles/FSUserOrganisationTileUI.vue +0 -2
- package/components/toggleSets/FSToggleSetPosition.vue +0 -5
- package/composables/useMapLayers.ts +0 -12
- package/models/index.ts +1 -2
- package/models/map.ts +1 -2
- package/models/tables.ts +0 -1
- package/package.json +4 -4
- package/styles/components/fs_button.scss +7 -1
- package/styles/components/fs_card.scss +4 -75
- package/styles/components/fs_chip.scss +29 -0
- package/styles/components/fs_clickable.scss +69 -0
- package/styles/components/fs_color_icon.scss +3 -0
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_map.scss +1 -7
- package/styles/components/fs_progress_bar.scss +6 -62
- package/styles/components/index.scss +2 -1
- package/styles/globals/overrides.scss +1 -1
- package/assets/images/map/open-street-map.png +0 -0
- package/components/FSGroupingChip.vue +0 -115
- package/components/FSSnackbar.vue +0 -146
- package/components/FSSubgroupingChip.vue +0 -138
- package/components/fields/FSDurationField.vue +0 -184
- package/components/tiles/FSPlaylistTileUI.vue +0 -149
- package/components/tiles/FSSubgroupingTileUI.vue +0 -97
- package/models/variants.ts +0 -33
- package/styles/components/fs_snackbar.scss +0 -7
|
@@ -135,25 +135,36 @@
|
|
|
135
135
|
/>
|
|
136
136
|
</FSRow>
|
|
137
137
|
</FSRow>
|
|
138
|
-
<
|
|
138
|
+
<FSClickable
|
|
139
139
|
v-else
|
|
140
|
+
borderStyle="dashed"
|
|
141
|
+
variant="background"
|
|
142
|
+
:height="$props.height"
|
|
143
|
+
:width="$props.width"
|
|
144
|
+
@click="() => invisibleButtonRef.input.click()"
|
|
140
145
|
>
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
<FSRow
|
|
147
|
+
align="center-center"
|
|
148
|
+
:wrap="false"
|
|
149
|
+
>
|
|
150
|
+
<FSIcon>
|
|
151
|
+
mdi-plus-box-outline
|
|
152
|
+
</FSIcon>
|
|
153
|
+
<FSText
|
|
154
|
+
font="text-body"
|
|
155
|
+
:lineClamp="2"
|
|
156
|
+
>
|
|
157
|
+
{{ $tr('edit-image.add-image', 'Add an image.') }}
|
|
158
|
+
</FSText>
|
|
159
|
+
<FSButtonFileMini
|
|
160
|
+
class="fs-edit-image-hidden-button"
|
|
161
|
+
ref="invisibleButtonRef"
|
|
162
|
+
accept=".jpg,.jpeg,.png"
|
|
163
|
+
:readFile="false"
|
|
164
|
+
@update:metadata="onUpload"
|
|
165
|
+
/>
|
|
166
|
+
</FSRow>
|
|
167
|
+
</FSClickable>
|
|
157
168
|
</FSCol>
|
|
158
169
|
</template>
|
|
159
170
|
|
|
@@ -166,11 +177,10 @@ import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
|
166
177
|
|
|
167
178
|
import FSButtonRemoveMini from "./buttons/FSButtonRemoveMini.vue";
|
|
168
179
|
import FSButtonFileMini from "./buttons/FSButtonFileMini.vue";
|
|
169
|
-
import
|
|
180
|
+
import FSClickable from "./FSClickable.vue";
|
|
170
181
|
import FSImageUI from "./FSImageUI.vue";
|
|
171
182
|
import FSCard from "./FSCard.vue";
|
|
172
183
|
import FSText from "./FSText.vue";
|
|
173
|
-
import FSSpan from "./FSSpan.vue";
|
|
174
184
|
import FSCol from "./FSCol.vue";
|
|
175
185
|
import FSRow from "./FSRow.vue";
|
|
176
186
|
|
|
@@ -178,12 +188,11 @@ export default defineComponent({
|
|
|
178
188
|
name: "FSEditImageUI",
|
|
179
189
|
components: {
|
|
180
190
|
FSButtonRemoveMini,
|
|
181
|
-
FSCardPlaceholder,
|
|
182
191
|
FSButtonFileMini,
|
|
192
|
+
FSClickable,
|
|
183
193
|
FSImageUI,
|
|
184
194
|
FSCard,
|
|
185
195
|
FSText,
|
|
186
|
-
FSSpan,
|
|
187
196
|
FSCol,
|
|
188
197
|
FSRow
|
|
189
198
|
},
|
|
@@ -40,7 +40,6 @@ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composa
|
|
|
40
40
|
import type { FSGridMosaic } from "@dative-gpi/foundation-shared-components/models";
|
|
41
41
|
|
|
42
42
|
import FSGrid from "./FSGrid.vue";
|
|
43
|
-
import FSText from "./FSText.vue";
|
|
44
43
|
import FSCol from "./FSCol.vue";
|
|
45
44
|
import FSRow from "./FSRow.vue";
|
|
46
45
|
|
|
@@ -48,7 +47,6 @@ export default defineComponent({
|
|
|
48
47
|
name: "FSGridMosaic",
|
|
49
48
|
components: {
|
|
50
49
|
FSGrid,
|
|
51
|
-
FSText,
|
|
52
50
|
FSCol,
|
|
53
51
|
FSRow
|
|
54
52
|
},
|
|
@@ -30,14 +30,12 @@ import { sizeToVar } from "../utils";
|
|
|
30
30
|
|
|
31
31
|
import FSCard from "./FSCard.vue";
|
|
32
32
|
import FSIcon from "./FSIcon.vue";
|
|
33
|
-
import FSRow from "./FSRow.vue";
|
|
34
33
|
|
|
35
34
|
export default defineComponent({
|
|
36
35
|
name: "FSIconCard",
|
|
37
36
|
components: {
|
|
38
37
|
FSCard,
|
|
39
|
-
FSIcon
|
|
40
|
-
FSRow
|
|
38
|
+
FSIcon
|
|
41
39
|
},
|
|
42
40
|
props: {
|
|
43
41
|
size: {
|
|
@@ -28,18 +28,10 @@ export default defineComponent({
|
|
|
28
28
|
type: Boolean,
|
|
29
29
|
required: false,
|
|
30
30
|
default: true
|
|
31
|
-
},
|
|
32
|
-
variant: {
|
|
33
|
-
type: String as () => "fill" | "outline",
|
|
34
|
-
required: false,
|
|
35
|
-
default: "outline"
|
|
36
31
|
}
|
|
37
32
|
},
|
|
38
33
|
setup(props) {
|
|
39
34
|
const icon = computed((): string => {
|
|
40
|
-
if (props.variant === "fill") {
|
|
41
|
-
return props.value ? "mdi-check-circle" : "mdi-close-circle";
|
|
42
|
-
}
|
|
43
35
|
return props.value ? "mdi-check-circle-outline" : "mdi-close-circle-outline";
|
|
44
36
|
});
|
|
45
37
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSClickable
|
|
3
3
|
class="fs-image-card"
|
|
4
4
|
:height="height"
|
|
5
5
|
:width="width"
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
</FSSpan>
|
|
23
23
|
</FSRow>
|
|
24
24
|
</FSRow>
|
|
25
|
-
</
|
|
25
|
+
</FSClickable>
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script lang="ts">
|
|
29
29
|
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
30
30
|
|
|
31
|
-
import
|
|
31
|
+
import FSClickable from "./FSClickable.vue";
|
|
32
32
|
import FSSpan from "./FSSpan.vue";
|
|
33
33
|
import FSRow from "./FSRow.vue";
|
|
34
34
|
|
|
35
35
|
export default defineComponent({
|
|
36
36
|
name: "FSImageCard",
|
|
37
37
|
components: {
|
|
38
|
-
|
|
38
|
+
FSClickable,
|
|
39
39
|
FSSpan,
|
|
40
40
|
FSRow
|
|
41
41
|
},
|
|
@@ -89,7 +89,6 @@ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
|
89
89
|
import { computeTicks, TimePrecision } from '@dative-gpi/foundation-shared-components/utils';
|
|
90
90
|
|
|
91
91
|
import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
|
|
92
|
-
import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
|
|
93
92
|
import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
|
|
94
93
|
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
95
94
|
import FSSlider from '@dative-gpi/foundation-shared-components/components/FSSlider.vue';
|
|
@@ -101,7 +100,6 @@ export default defineComponent({
|
|
|
101
100
|
name: "FSInstantPicker",
|
|
102
101
|
components: {
|
|
103
102
|
FSCol,
|
|
104
|
-
FSRow,
|
|
105
103
|
FSSpan,
|
|
106
104
|
FSText,
|
|
107
105
|
FSSlider,
|
package/components/FSLink.vue
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<a
|
|
3
|
+
v-if="$props.href"
|
|
4
|
+
:href="$props.href"
|
|
5
|
+
:class="classes"
|
|
6
|
+
:style="style"
|
|
7
|
+
>
|
|
8
|
+
<slot>
|
|
9
|
+
<FSSpan>
|
|
10
|
+
{{ $props.label }}
|
|
11
|
+
</FSSpan>
|
|
12
|
+
</slot>
|
|
13
|
+
</a>
|
|
2
14
|
<FSRouterLink
|
|
15
|
+
v-else-if="$props.to"
|
|
3
16
|
:to="$props.to"
|
|
4
|
-
:href="$props.href"
|
|
5
17
|
:class="classes"
|
|
6
18
|
:style="style"
|
|
7
19
|
v-bind="$attrs"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSClickable
|
|
3
3
|
:disabled="$props.disabled"
|
|
4
4
|
:height="['32px', '28px']"
|
|
5
5
|
:padding="$props.padding"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
</FSIcon>
|
|
48
48
|
</slot>
|
|
49
49
|
</FSRow>
|
|
50
|
-
</
|
|
50
|
+
</FSClickable>
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script lang="ts">
|
|
@@ -56,7 +56,7 @@ import { computed, defineComponent, type PropType } from "vue";
|
|
|
56
56
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
57
57
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
58
58
|
|
|
59
|
-
import
|
|
59
|
+
import FSClickable from "./FSClickable.vue";
|
|
60
60
|
import FSSpan from "./FSSpan.vue";
|
|
61
61
|
import FSIcon from "./FSIcon.vue";
|
|
62
62
|
import FSRow from "./FSRow.vue";
|
|
@@ -64,7 +64,7 @@ import FSRow from "./FSRow.vue";
|
|
|
64
64
|
export default defineComponent({
|
|
65
65
|
name: "FSOptionItem",
|
|
66
66
|
components: {
|
|
67
|
-
|
|
67
|
+
FSClickable,
|
|
68
68
|
FSSpan,
|
|
69
69
|
FSIcon,
|
|
70
70
|
FSRow
|
|
@@ -41,13 +41,12 @@
|
|
|
41
41
|
:scrollOutside="false"
|
|
42
42
|
maxHeight="80dvh"
|
|
43
43
|
>
|
|
44
|
-
<
|
|
44
|
+
<FSClickable
|
|
45
45
|
v-for="(item, index) in $props.items"
|
|
46
46
|
width="100%"
|
|
47
47
|
padding="8px"
|
|
48
48
|
height="40px"
|
|
49
49
|
:key="index"
|
|
50
|
-
:color="ColorEnum.Light"
|
|
51
50
|
:border="false"
|
|
52
51
|
@click="onClickItem(item)"
|
|
53
52
|
>
|
|
@@ -69,7 +68,7 @@
|
|
|
69
68
|
</FSText>
|
|
70
69
|
</FSRow>
|
|
71
70
|
</slot>
|
|
72
|
-
</
|
|
71
|
+
</FSClickable>
|
|
73
72
|
</FSFadeOut>
|
|
74
73
|
</FSCol>
|
|
75
74
|
</slot>
|
|
@@ -82,7 +81,7 @@ import { defineComponent, ref, type PropType } from "vue";
|
|
|
82
81
|
|
|
83
82
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
84
83
|
|
|
85
|
-
import {
|
|
84
|
+
import { ColorEnum, type ColorBase } from '@dative-gpi/foundation-shared-components/models';
|
|
86
85
|
|
|
87
86
|
import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
|
|
88
87
|
import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
|
|
@@ -91,6 +90,7 @@ import FSMenu from '@dative-gpi/foundation-shared-components/components/FSMenu.v
|
|
|
91
90
|
import FSCard from '@dative-gpi/foundation-shared-components/components/FSCard.vue';
|
|
92
91
|
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
93
92
|
import FSButton from '@dative-gpi/foundation-shared-components/components/FSButton.vue';
|
|
93
|
+
import FSClickable from '@dative-gpi/foundation-shared-components/components/FSClickable.vue';
|
|
94
94
|
|
|
95
95
|
export default defineComponent({
|
|
96
96
|
name: "FSInformationsMenu",
|
|
@@ -101,7 +101,8 @@ export default defineComponent({
|
|
|
101
101
|
FSText,
|
|
102
102
|
FSButton,
|
|
103
103
|
FSCol,
|
|
104
|
-
FSIcon
|
|
104
|
+
FSIcon,
|
|
105
|
+
FSClickable
|
|
105
106
|
},
|
|
106
107
|
props: {
|
|
107
108
|
items: {
|
|
@@ -157,7 +158,6 @@ export default defineComponent({
|
|
|
157
158
|
ColorEnum,
|
|
158
159
|
modelValue,
|
|
159
160
|
lightColors,
|
|
160
|
-
CardVariants,
|
|
161
161
|
onClickItem
|
|
162
162
|
};
|
|
163
163
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
width="hug"
|
|
4
4
|
gap="4px"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
6
|
+
<FSClickable
|
|
7
7
|
variant="full"
|
|
8
8
|
:color="ColorEnum.Light"
|
|
9
9
|
borderRadius="50%"
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
size="18px"
|
|
15
15
|
icon="mdi-skip-backward"
|
|
16
16
|
/>
|
|
17
|
-
</
|
|
18
|
-
<
|
|
17
|
+
</FSClickable>
|
|
18
|
+
<FSClickable
|
|
19
19
|
variant="full"
|
|
20
20
|
:color="ColorEnum.Light"
|
|
21
21
|
borderRadius="50%"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
size="18px"
|
|
27
27
|
:icon="$props.modelValue ? 'mdi-pause' : 'mdi-play'"
|
|
28
28
|
/>
|
|
29
|
-
</
|
|
30
|
-
<
|
|
29
|
+
</FSClickable>
|
|
30
|
+
<FSClickable
|
|
31
31
|
variant="full"
|
|
32
32
|
:color="ColorEnum.Light"
|
|
33
33
|
borderRadius="50%"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
size="18px"
|
|
39
39
|
icon="mdi-skip-forward"
|
|
40
40
|
/>
|
|
41
|
-
</
|
|
41
|
+
</FSClickable>
|
|
42
42
|
</FSRow>
|
|
43
43
|
</template>
|
|
44
44
|
|
|
@@ -48,15 +48,13 @@ import { defineComponent } from "vue";
|
|
|
48
48
|
import { ColorEnum } from '@dative-gpi/foundation-shared-components/models';
|
|
49
49
|
|
|
50
50
|
import FSIcon from '@dative-gpi/foundation-shared-components/components/FSIcon.vue';
|
|
51
|
-
import
|
|
52
|
-
import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
|
|
51
|
+
import FSClickable from '@dative-gpi/foundation-shared-components/components/FSClickable.vue';
|
|
53
52
|
|
|
54
53
|
export default defineComponent({
|
|
55
54
|
name: "FSPlayButtons",
|
|
56
55
|
components: {
|
|
57
|
-
|
|
58
|
-
FSIcon
|
|
59
|
-
FSRow
|
|
56
|
+
FSClickable,
|
|
57
|
+
FSIcon
|
|
60
58
|
},
|
|
61
59
|
props: {
|
|
62
60
|
modelValue: {
|
|
@@ -4,62 +4,21 @@
|
|
|
4
4
|
:style="style"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
|
-
class="fs-progress-bar-
|
|
7
|
+
class="fs-progress-bar-gradient"
|
|
8
8
|
>
|
|
9
|
-
<div
|
|
10
|
-
class="fs-progress-bar-track"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
v-if="$props.cursor && isValueInRange"
|
|
14
|
-
class="fs-progress-bar-cursor"
|
|
15
|
-
>
|
|
16
|
-
<FSText
|
|
17
|
-
v-if="$props.showValue"
|
|
18
|
-
class="fs-progress-bar-cursor-label"
|
|
19
|
-
font="text-overline"
|
|
20
|
-
:ellipsis="false"
|
|
21
|
-
>
|
|
22
|
-
{{ displayValue }}
|
|
23
|
-
</FSText>
|
|
24
|
-
</div>
|
|
25
|
-
<div
|
|
26
|
-
v-if="!$props.cursor"
|
|
27
|
-
class="fs-progress-bar-fill"
|
|
28
|
-
></div>
|
|
29
|
-
</div>
|
|
30
|
-
<div
|
|
31
|
-
v-if="positionedLabels.length"
|
|
32
|
-
class="fs-progress-bar-labels"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
v-for="label in positionedLabels"
|
|
36
|
-
:key="label.value"
|
|
37
|
-
class="fs-progress-bar-label"
|
|
38
|
-
:class="{
|
|
39
|
-
'fs-progress-bar-label--start': label.percent === 0,
|
|
40
|
-
'fs-progress-bar-label--end': label.percent === 100
|
|
41
|
-
}"
|
|
42
|
-
:style="{ left: `${label.percent}%` }"
|
|
43
|
-
>
|
|
44
|
-
<FSText
|
|
45
|
-
font="text-overline"
|
|
46
|
-
>
|
|
47
|
-
{{ label.display }}
|
|
48
|
-
</FSText>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
9
|
+
<div></div>
|
|
51
10
|
</div>
|
|
52
11
|
<FSText
|
|
53
|
-
v-if="$props.showValue
|
|
12
|
+
v-if="$props.showValue"
|
|
54
13
|
font="text-button"
|
|
55
14
|
>
|
|
56
|
-
{{
|
|
15
|
+
{{ fixedRate }}%
|
|
57
16
|
</FSText>
|
|
58
17
|
</FSRow>
|
|
59
18
|
</template>
|
|
60
19
|
|
|
61
20
|
<script lang="ts">
|
|
62
|
-
import { computed, defineComponent, type
|
|
21
|
+
import { computed, defineComponent, type StyleValue } from "vue";
|
|
63
22
|
|
|
64
23
|
import { useColors } from '@dative-gpi/foundation-shared-components/composables';
|
|
65
24
|
|
|
@@ -91,31 +50,6 @@ export default defineComponent({
|
|
|
91
50
|
type: Boolean,
|
|
92
51
|
required: false,
|
|
93
52
|
default: true
|
|
94
|
-
},
|
|
95
|
-
valueFormat: {
|
|
96
|
-
type: String as PropType<"percentage" | "raw">,
|
|
97
|
-
required: false,
|
|
98
|
-
default: "percentage"
|
|
99
|
-
},
|
|
100
|
-
min: {
|
|
101
|
-
type: Number,
|
|
102
|
-
required: false,
|
|
103
|
-
default: 0
|
|
104
|
-
},
|
|
105
|
-
max: {
|
|
106
|
-
type: Number,
|
|
107
|
-
required: false,
|
|
108
|
-
default: 1
|
|
109
|
-
},
|
|
110
|
-
labels: {
|
|
111
|
-
type: Array as PropType<Array<{ value: number; text?: string }>>,
|
|
112
|
-
required: false,
|
|
113
|
-
default: () => []
|
|
114
|
-
},
|
|
115
|
-
cursor: {
|
|
116
|
-
type: Boolean,
|
|
117
|
-
required: false,
|
|
118
|
-
default: false
|
|
119
53
|
}
|
|
120
54
|
},
|
|
121
55
|
setup(props) {
|
|
@@ -124,85 +58,37 @@ export default defineComponent({
|
|
|
124
58
|
const lightColors = getColors(ColorEnum.Light);
|
|
125
59
|
const successColors = getColors(ColorEnum.Success);
|
|
126
60
|
const errorColors = getColors(ColorEnum.Error);
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const range = computed(() => props.max - props.min);
|
|
131
|
-
|
|
132
|
-
const clampedValue = computed(() => {
|
|
133
|
-
if (!isValid.value) {
|
|
134
|
-
return props.min;
|
|
135
|
-
}
|
|
136
|
-
return Math.min(Math.max(props.modelValue, props.min), props.max);
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const valuePercent = computed(() => {
|
|
140
|
-
if (!isValid.value) {
|
|
141
|
-
return 0;
|
|
142
|
-
}
|
|
143
|
-
return ((clampedValue.value - props.min) / range.value) * 100;
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
const isValueInRange = computed(() => {
|
|
147
|
-
return props.modelValue >= props.min && props.modelValue <= props.max;
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
const zeroPercent = computed(() => {
|
|
151
|
-
if (!isValid.value) { return 0; }
|
|
152
|
-
const zero = Math.min(Math.max(0, props.min), props.max);
|
|
153
|
-
return ((zero - props.min) / range.value) * 100;
|
|
61
|
+
|
|
62
|
+
const fixedRate = computed(() => {
|
|
63
|
+
return (props.modelValue * 100).toFixed(0);
|
|
154
64
|
});
|
|
155
65
|
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
const fillWidth = computed(() => Math.abs(valuePercent.value - zeroPercent.value));
|
|
159
|
-
|
|
160
|
-
const gradientStartStop = computed(() => {
|
|
161
|
-
if (fillWidth.value === 0) { return "0%"; }
|
|
162
|
-
return `${-(fillLeft.value / fillWidth.value) * 100}%`;
|
|
66
|
+
const relativeWidth = computed(() => {
|
|
67
|
+
return props.modelValue ? 100 / props.modelValue : 0;
|
|
163
68
|
});
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
return `${((100 - fillLeft.value) / fillWidth.value) * 100}%`;
|
|
69
|
+
|
|
70
|
+
const startColor = computed(() => {
|
|
71
|
+
return props.startColor ?? errorColors.base;
|
|
168
72
|
});
|
|
169
73
|
|
|
170
|
-
const
|
|
171
|
-
return props.
|
|
172
|
-
const percent = isValid.value
|
|
173
|
-
? ((label.value - props.min) / range.value) * 100
|
|
174
|
-
: 0;
|
|
175
|
-
|
|
176
|
-
return {
|
|
177
|
-
value: label.value,
|
|
178
|
-
display: label.text ?? label.value,
|
|
179
|
-
percent: Math.min(Math.max(percent, 0), 100)
|
|
180
|
-
};
|
|
181
|
-
});
|
|
74
|
+
const endColor = computed(() => {
|
|
75
|
+
return props.endColor ?? successColors.base;
|
|
182
76
|
});
|
|
183
77
|
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
78
|
+
const style = computed((): StyleValue => {
|
|
79
|
+
return {
|
|
80
|
+
'--progress-bar-background-color': lightColors.dark,
|
|
81
|
+
'--progress-bar-gradient-start-color': startColor.value,
|
|
82
|
+
'--progress-bar-gradient-end-color': endColor.value,
|
|
83
|
+
'--progress-bar-gradient-width': `min(100%, ${fixedRate.value}%)`,
|
|
84
|
+
'--progress-bar-total-relative-width': `${relativeWidth.value}%`
|
|
85
|
+
};
|
|
187
86
|
});
|
|
188
87
|
|
|
189
|
-
const style = computed((): StyleValue => ({
|
|
190
|
-
"--progress-bar-background": lightColors.dark,
|
|
191
|
-
"--progress-bar-gradient-start": props.startColor ?? errorColors.base,
|
|
192
|
-
"--progress-bar-gradient-start-stop": gradientStartStop.value,
|
|
193
|
-
"--progress-bar-gradient-end": props.endColor ?? successColors.base,
|
|
194
|
-
"--progress-bar-gradient-end-stop": gradientEndStop.value,
|
|
195
|
-
"--progress-bar-fill-left": `${fillLeft.value}%`,
|
|
196
|
-
"--progress-bar-fill-width": `${fillWidth.value}%`,
|
|
197
|
-
"--progress-bar-cursor-position": `${valuePercent.value}%`
|
|
198
|
-
}));
|
|
199
|
-
|
|
200
88
|
return {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
};
|
|
206
|
-
}
|
|
89
|
+
style,
|
|
90
|
+
fixedRate
|
|
91
|
+
}
|
|
92
|
+
},
|
|
207
93
|
});
|
|
208
|
-
</script>
|
|
94
|
+
</script>
|
|
@@ -89,7 +89,6 @@ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
|
89
89
|
import { computeTicks, TimePrecision } from '@dative-gpi/foundation-shared-components/utils';
|
|
90
90
|
|
|
91
91
|
import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
|
|
92
|
-
import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
|
|
93
92
|
import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
|
|
94
93
|
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
95
94
|
import FSPlayButtons from '@dative-gpi/foundation-shared-components/components/FSPlayButtons.vue';
|
|
@@ -101,7 +100,6 @@ export default defineComponent({
|
|
|
101
100
|
name: "FSRangePicker",
|
|
102
101
|
components: {
|
|
103
102
|
FSCol,
|
|
104
|
-
FSRow,
|
|
105
103
|
FSSpan,
|
|
106
104
|
FSText,
|
|
107
105
|
FSTermField,
|