@dative-gpi/foundation-shared-components 1.0.129 → 1.0.130
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/FSChip.vue +2 -2
- package/components/FSIconCard.vue +26 -3
- package/components/FSInstantPicker.vue +266 -0
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/fields/FSDateField.vue +1 -0
- package/components/fields/FSSelectField.vue +5 -1
- package/components/fields/FSTermField.vue +28 -9
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +21 -11
- package/components/tiles/FSSimpleTileUI.vue +1 -1
- package/package.json +4 -4
- package/styles/components/fs_progress_bar.scss +14 -0
- package/styles/components/fs_select_field.scss +4 -0
- package/styles/components/index.scss +1 -0
package/components/FSChip.vue
CHANGED
|
@@ -103,9 +103,9 @@ export default defineComponent({
|
|
|
103
103
|
default: false
|
|
104
104
|
},
|
|
105
105
|
align: {
|
|
106
|
-
type: String as PropType<"center-
|
|
106
|
+
type: String as PropType<"center-center" | "center-left">,
|
|
107
107
|
required: false,
|
|
108
|
-
default: "center-
|
|
108
|
+
default: "center-center"
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
setup(props) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
>
|
|
12
12
|
<FSIcon
|
|
13
13
|
:variant="$props.iconVariant"
|
|
14
|
-
:color="
|
|
14
|
+
:color="contrastedIconColor"
|
|
15
15
|
:size="actualIconSize"
|
|
16
16
|
>
|
|
17
17
|
{{ $props.icon }}
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
<script lang="ts">
|
|
24
24
|
import { defineComponent, type PropType, computed } from "vue";
|
|
25
25
|
|
|
26
|
-
import { type ColorBase
|
|
26
|
+
import { ColorEnum, type ColorBase } from "@dative-gpi/foundation-shared-components/models";
|
|
27
27
|
|
|
28
28
|
import { sizeToVar } from "../utils";
|
|
29
|
+
import { useColors } from "../composables";
|
|
29
30
|
|
|
30
31
|
import FSCard from "./FSCard.vue";
|
|
31
32
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -60,7 +61,7 @@ export default defineComponent({
|
|
|
60
61
|
iconColor: {
|
|
61
62
|
type: String as PropType<ColorBase>,
|
|
62
63
|
required: false,
|
|
63
|
-
default: ColorEnum.
|
|
64
|
+
default: ColorEnum.Light
|
|
64
65
|
},
|
|
65
66
|
iconVariant: {
|
|
66
67
|
type: String as PropType<"base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
|
|
@@ -79,6 +80,14 @@ export default defineComponent({
|
|
|
79
80
|
}
|
|
80
81
|
},
|
|
81
82
|
setup(props){
|
|
83
|
+
const { getColors } = useColors();
|
|
84
|
+
|
|
85
|
+
const colors = computed(() => {
|
|
86
|
+
return Array.isArray(props.backgroundColor)
|
|
87
|
+
? getColors(props.backgroundColor[Math.floor(props.backgroundColor.length/2)])
|
|
88
|
+
: getColors(props.backgroundColor)
|
|
89
|
+
});
|
|
90
|
+
|
|
82
91
|
const actualIconSize = computed(() => {
|
|
83
92
|
if (props.iconSize){
|
|
84
93
|
return props.iconSize;
|
|
@@ -89,7 +98,21 @@ export default defineComponent({
|
|
|
89
98
|
return "42px";
|
|
90
99
|
});
|
|
91
100
|
|
|
101
|
+
const contrastedIconColor = computed(() => {
|
|
102
|
+
switch (props.backgroundVariant) {
|
|
103
|
+
case "standard":
|
|
104
|
+
switch (props.iconColor) {
|
|
105
|
+
case ColorEnum.Dark :
|
|
106
|
+
case ColorEnum.Light:
|
|
107
|
+
default: return colors.value.lightContrast!
|
|
108
|
+
};
|
|
109
|
+
case "background": return colors.value.base
|
|
110
|
+
default: return colors.value.baseContrast!
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
92
114
|
return {
|
|
115
|
+
contrastedIconColor,
|
|
93
116
|
actualIconSize
|
|
94
117
|
};
|
|
95
118
|
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseField
|
|
3
|
+
:description="$props.description"
|
|
4
|
+
:hideHeader="$props.hideHeader"
|
|
5
|
+
:required="$props.required"
|
|
6
|
+
:editable="$props.editable"
|
|
7
|
+
:label="$props.label"
|
|
8
|
+
>
|
|
9
|
+
<FSRow
|
|
10
|
+
align="bottom-center"
|
|
11
|
+
gap="32px"
|
|
12
|
+
>
|
|
13
|
+
<FSTermField
|
|
14
|
+
width="430px"
|
|
15
|
+
:label="$tr('ui.instant-picker.analyze-period', 'Analyze Period')"
|
|
16
|
+
:startDate="$props.startDate"
|
|
17
|
+
:endDate="$props.endDate"
|
|
18
|
+
@update:startDate="$emit('update:startDate', $event)"
|
|
19
|
+
@update:endDate="$emit('update:endDate', $event)"
|
|
20
|
+
/>
|
|
21
|
+
<FSRow
|
|
22
|
+
padding="0 0 2px 0"
|
|
23
|
+
align="center-center"
|
|
24
|
+
>
|
|
25
|
+
<FSCol
|
|
26
|
+
width="fill"
|
|
27
|
+
>
|
|
28
|
+
<FSSlider
|
|
29
|
+
minWidth='min(300px, 90vw)'
|
|
30
|
+
:color="ColorEnum.Light"
|
|
31
|
+
:thumbColor="ColorEnum.Primary"
|
|
32
|
+
:thumbSize="18"
|
|
33
|
+
:trackSize="8"
|
|
34
|
+
thumb-label="always"
|
|
35
|
+
:step="$props.stepTime"
|
|
36
|
+
:min="startTimestamp"
|
|
37
|
+
:max="endTimestamp"
|
|
38
|
+
:ticks="ticks"
|
|
39
|
+
showTicks="always"
|
|
40
|
+
:modelValue="$props.modelValue"
|
|
41
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
42
|
+
>
|
|
43
|
+
<template
|
|
44
|
+
#thumb-label="{ modelValue }"
|
|
45
|
+
>
|
|
46
|
+
<FSSpan
|
|
47
|
+
font="text-overline"
|
|
48
|
+
>
|
|
49
|
+
{{ epochToMonthShortTimeFormat(modelValue) }}
|
|
50
|
+
</FSSpan>
|
|
51
|
+
</template>
|
|
52
|
+
<template
|
|
53
|
+
#tick-label="{ tick, index }"
|
|
54
|
+
>
|
|
55
|
+
<FSRow
|
|
56
|
+
v-if="index % Math.trunc(ticks.length / maximumTickToShow) === 0 || ticks.length < maximumTickToShow"
|
|
57
|
+
>
|
|
58
|
+
<FSText
|
|
59
|
+
:color="lightColors.dark"
|
|
60
|
+
font="text-overline"
|
|
61
|
+
>
|
|
62
|
+
{{ intervalTime <= 3600000
|
|
63
|
+
?
|
|
64
|
+
epochToShortTimeOnlyFormat(tick.value)
|
|
65
|
+
:
|
|
66
|
+
epochToDayMonthShortOnly(tick.value)
|
|
67
|
+
}}
|
|
68
|
+
</FSText>
|
|
69
|
+
</FSRow>
|
|
70
|
+
</template>
|
|
71
|
+
</FSSlider>
|
|
72
|
+
</FSCol>
|
|
73
|
+
<FSPlayButtons
|
|
74
|
+
v-if="$props.playable"
|
|
75
|
+
:modelValue="playing"
|
|
76
|
+
@click:backward="onClickBackward"
|
|
77
|
+
@click:forward="onClickForward"
|
|
78
|
+
@update:modelValue="onPlayingChange"
|
|
79
|
+
/>
|
|
80
|
+
</FSRow>
|
|
81
|
+
</FSRow>
|
|
82
|
+
</FSBaseField>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script lang="ts">
|
|
86
|
+
import { computed, defineComponent, ref, watch } from "vue";
|
|
87
|
+
|
|
88
|
+
import { useDateFormat, useTermFieldDate } from "@dative-gpi/foundation-shared-services/composables";
|
|
89
|
+
|
|
90
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
91
|
+
import { useBreakpoints, useColors } from '@dative-gpi/foundation-shared-components/composables';
|
|
92
|
+
|
|
93
|
+
import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
|
|
94
|
+
import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
|
|
95
|
+
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
96
|
+
import FSSlider from '@dative-gpi/foundation-shared-components/components/FSSlider.vue';
|
|
97
|
+
import FSBaseField from '@dative-gpi/foundation-shared-components/components/fields/FSBaseField.vue';
|
|
98
|
+
import FSTermField from '@dative-gpi/foundation-shared-components/components/fields/FSTermField.vue';
|
|
99
|
+
import FSPlayButtons from '@dative-gpi/foundation-shared-components/components/FSPlayButtons.vue';
|
|
100
|
+
|
|
101
|
+
export default defineComponent({
|
|
102
|
+
name: "FSInstantPicker",
|
|
103
|
+
components: {
|
|
104
|
+
FSCol,
|
|
105
|
+
FSSpan,
|
|
106
|
+
FSText,
|
|
107
|
+
FSSlider,
|
|
108
|
+
FSTermField,
|
|
109
|
+
FSBaseField,
|
|
110
|
+
FSPlayButtons
|
|
111
|
+
},
|
|
112
|
+
props: {
|
|
113
|
+
label: {
|
|
114
|
+
type: String,
|
|
115
|
+
required: false,
|
|
116
|
+
},
|
|
117
|
+
modelValue: {
|
|
118
|
+
type: Number,
|
|
119
|
+
required: false,
|
|
120
|
+
default: 0,
|
|
121
|
+
},
|
|
122
|
+
startDate: {
|
|
123
|
+
type: String,
|
|
124
|
+
required: true
|
|
125
|
+
},
|
|
126
|
+
endDate: {
|
|
127
|
+
type: String,
|
|
128
|
+
required: true
|
|
129
|
+
},
|
|
130
|
+
description: {
|
|
131
|
+
type: String,
|
|
132
|
+
required: false,
|
|
133
|
+
default: null
|
|
134
|
+
},
|
|
135
|
+
hideHeader: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
required: false,
|
|
138
|
+
default: false
|
|
139
|
+
},
|
|
140
|
+
required: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
required: false,
|
|
143
|
+
default: false
|
|
144
|
+
},
|
|
145
|
+
editable: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
required: false,
|
|
148
|
+
default: true
|
|
149
|
+
},
|
|
150
|
+
playable: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
required: false,
|
|
153
|
+
default: true
|
|
154
|
+
},
|
|
155
|
+
stepTime: {
|
|
156
|
+
type: Number,
|
|
157
|
+
required: false,
|
|
158
|
+
default: 60000
|
|
159
|
+
},
|
|
160
|
+
playingStepDuration: {
|
|
161
|
+
type: Number,
|
|
162
|
+
required: false,
|
|
163
|
+
default: 50
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
emits: ['update:modelValue', 'update:startDate', 'update:endDate'],
|
|
167
|
+
setup(props, { emit }) {
|
|
168
|
+
const { epochToShortTimeOnlyFormat, epochToShortDateFormat, epochToDayMonthShortOnly, epochToISO, epochToMonthShortTimeFormat } = useDateFormat();
|
|
169
|
+
const { convert : convertTermToEpoch } = useTermFieldDate();
|
|
170
|
+
const { isMobileSized, isExtraSmall } = useBreakpoints();
|
|
171
|
+
const { getColors } = useColors();
|
|
172
|
+
|
|
173
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
174
|
+
const playing = ref(false);
|
|
175
|
+
const playingInterval = ref();
|
|
176
|
+
|
|
177
|
+
const startTimestamp = computed(() => convertTermToEpoch(props.startDate));
|
|
178
|
+
const endTimestamp = computed(() => convertTermToEpoch(props.endDate));
|
|
179
|
+
|
|
180
|
+
const intervalTime = computed(() => {
|
|
181
|
+
const possibleIntervals = [60000, 3600000, 86400000];
|
|
182
|
+
|
|
183
|
+
const interval = possibleIntervals.find(interval => {
|
|
184
|
+
return (endTimestamp.value - startTimestamp.value) / interval < 100;
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
if (interval) {
|
|
188
|
+
return interval;
|
|
189
|
+
}
|
|
190
|
+
return 86400000;
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const ticks = computed(() => {
|
|
194
|
+
const ticks: number[] = [];
|
|
195
|
+
|
|
196
|
+
const firstTick = Math.ceil(startTimestamp.value / intervalTime.value) * intervalTime.value;
|
|
197
|
+
for (let i = firstTick; i <= endTimestamp.value; i += intervalTime.value) {
|
|
198
|
+
ticks.push(i);
|
|
199
|
+
}
|
|
200
|
+
return ticks;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const maximumTickToShow = computed(() => {
|
|
204
|
+
if (isMobileSized.value) {
|
|
205
|
+
return 5;
|
|
206
|
+
}
|
|
207
|
+
if (isExtraSmall.value) {
|
|
208
|
+
return 4;
|
|
209
|
+
}
|
|
210
|
+
return 6;
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const onPlayingChange = (value: boolean) => {
|
|
214
|
+
playing.value = value;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const onClickBackward = () => {
|
|
218
|
+
emit('update:modelValue', startTimestamp.value);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const onClickForward = () => {
|
|
222
|
+
emit('update:modelValue', endTimestamp.value);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
watch(() => [props.startDate, props.endDate], () => {
|
|
226
|
+
if(props.modelValue < startTimestamp.value || props.modelValue > endTimestamp.value) {
|
|
227
|
+
emit('update:modelValue', endTimestamp.value);
|
|
228
|
+
}
|
|
229
|
+
}, { immediate: true });
|
|
230
|
+
|
|
231
|
+
watch(playing, (value) => {
|
|
232
|
+
if(!value && playingInterval.value) {
|
|
233
|
+
clearInterval(playingInterval.value);
|
|
234
|
+
} else {
|
|
235
|
+
playingInterval.value = setInterval(() => {
|
|
236
|
+
if(props.modelValue + props.stepTime <= endTimestamp.value) {
|
|
237
|
+
emit('update:modelValue', props.modelValue + props.stepTime);
|
|
238
|
+
} else {
|
|
239
|
+
emit('update:modelValue', endTimestamp.value);
|
|
240
|
+
playing.value = false;
|
|
241
|
+
}
|
|
242
|
+
}, props.playingStepDuration);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
ticks,
|
|
248
|
+
playing,
|
|
249
|
+
ColorEnum,
|
|
250
|
+
lightColors,
|
|
251
|
+
intervalTime,
|
|
252
|
+
endTimestamp,
|
|
253
|
+
startTimestamp,
|
|
254
|
+
maximumTickToShow,
|
|
255
|
+
epochToISO,
|
|
256
|
+
onPlayingChange,
|
|
257
|
+
onClickForward,
|
|
258
|
+
onClickBackward,
|
|
259
|
+
epochToShortDateFormat,
|
|
260
|
+
epochToShortTimeOnlyFormat,
|
|
261
|
+
epochToDayMonthShortOnly,
|
|
262
|
+
epochToMonthShortTimeFormat
|
|
263
|
+
};
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
</script>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
width="hug"
|
|
4
|
+
gap="4px"
|
|
5
|
+
>
|
|
6
|
+
<FSClickable
|
|
7
|
+
variant="full"
|
|
8
|
+
:color="ColorEnum.Light"
|
|
9
|
+
borderRadius="50%"
|
|
10
|
+
padding="2px"
|
|
11
|
+
@click="$emit('click:backward')"
|
|
12
|
+
>
|
|
13
|
+
<FSIcon
|
|
14
|
+
size="18px"
|
|
15
|
+
icon="mdi-skip-backward"
|
|
16
|
+
/>
|
|
17
|
+
</FSClickable>
|
|
18
|
+
<FSClickable
|
|
19
|
+
variant="full"
|
|
20
|
+
:color="ColorEnum.Light"
|
|
21
|
+
borderRadius="50%"
|
|
22
|
+
padding="2px"
|
|
23
|
+
@click="$emit('update:modelValue', !$props.modelValue)"
|
|
24
|
+
>
|
|
25
|
+
<FSIcon
|
|
26
|
+
size="18px"
|
|
27
|
+
:icon="$props.modelValue ? 'mdi-pause' : 'mdi-play'"
|
|
28
|
+
/>
|
|
29
|
+
</FSClickable>
|
|
30
|
+
<FSClickable
|
|
31
|
+
variant="full"
|
|
32
|
+
:color="ColorEnum.Light"
|
|
33
|
+
borderRadius="50%"
|
|
34
|
+
padding="2px"
|
|
35
|
+
@click="$emit('click:forward')"
|
|
36
|
+
>
|
|
37
|
+
<FSIcon
|
|
38
|
+
size="18px"
|
|
39
|
+
icon="mdi-skip-forward"
|
|
40
|
+
/>
|
|
41
|
+
</FSClickable>
|
|
42
|
+
</FSRow>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts">
|
|
46
|
+
import { defineComponent } from "vue";
|
|
47
|
+
|
|
48
|
+
import { ColorEnum } from '@dative-gpi/foundation-shared-components/models';
|
|
49
|
+
|
|
50
|
+
import FSIcon from '@dative-gpi/foundation-shared-components/components/FSIcon.vue';
|
|
51
|
+
import FSClickable from '@dative-gpi/foundation-shared-components/components/FSClickable.vue';
|
|
52
|
+
|
|
53
|
+
export default defineComponent({
|
|
54
|
+
name: "FSPlayButtons",
|
|
55
|
+
components: {
|
|
56
|
+
FSClickable,
|
|
57
|
+
FSIcon
|
|
58
|
+
},
|
|
59
|
+
props: {
|
|
60
|
+
modelValue: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
required: true,
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
emits: ['update:modelValue', 'click:backward', 'click:forward'],
|
|
66
|
+
setup() {
|
|
67
|
+
return {
|
|
68
|
+
ColorEnum
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
align="center-center"
|
|
4
|
+
:style="style"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
class="fs-progress-bar-gradient"
|
|
8
|
+
>
|
|
9
|
+
<div></div>
|
|
10
|
+
</div>
|
|
11
|
+
<FSText
|
|
12
|
+
v-if="$props.showValue"
|
|
13
|
+
font="text-button"
|
|
14
|
+
>
|
|
15
|
+
{{ fixedRate }}%
|
|
16
|
+
</FSText>
|
|
17
|
+
</FSRow>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { computed, defineComponent, type StyleValue } from "vue";
|
|
22
|
+
|
|
23
|
+
import { useColors } from '@dative-gpi/foundation-shared-components/composables';
|
|
24
|
+
|
|
25
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
26
|
+
|
|
27
|
+
import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
|
|
28
|
+
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
29
|
+
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: "FSProgressBar",
|
|
32
|
+
components: {
|
|
33
|
+
FSText,
|
|
34
|
+
FSRow
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: Number,
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
startColor: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
endColor: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
showValue: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
required: false,
|
|
52
|
+
default: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
setup(props) {
|
|
56
|
+
const { getColors } = useColors();
|
|
57
|
+
|
|
58
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
59
|
+
const successColors = getColors(ColorEnum.Success);
|
|
60
|
+
const errorColors = getColors(ColorEnum.Error);
|
|
61
|
+
|
|
62
|
+
const fixedRate = computed(() => {
|
|
63
|
+
return (props.modelValue * 100).toFixed(0);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const relativeWidth = computed(() => {
|
|
67
|
+
return props.modelValue ? 100 / props.modelValue : 0;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const startColor = computed(() => {
|
|
71
|
+
return props.startColor ?? errorColors.base;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const endColor = computed(() => {
|
|
75
|
+
return props.endColor ?? successColors.base;
|
|
76
|
+
});
|
|
77
|
+
|
|
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
|
+
};
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
style,
|
|
90
|
+
fixedRate
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
@@ -215,6 +215,7 @@
|
|
|
215
215
|
</FSCol>
|
|
216
216
|
<FSBaseField
|
|
217
217
|
v-else
|
|
218
|
+
:style="style"
|
|
218
219
|
:description="$props.description"
|
|
219
220
|
:hideHeader="$props.hideHeader"
|
|
220
221
|
:required="$props.required"
|
|
@@ -262,7 +263,6 @@
|
|
|
262
263
|
:rules="$props.rules"
|
|
263
264
|
:hideDetails="true"
|
|
264
265
|
:menuIcon="null"
|
|
265
|
-
:style="style"
|
|
266
266
|
:modelValue="$props.modelValue"
|
|
267
267
|
@update:modelValue="onSingleChange"
|
|
268
268
|
v-bind="$attrs"
|
|
@@ -401,6 +401,7 @@
|
|
|
401
401
|
</v-select>
|
|
402
402
|
<FSSlideGroup
|
|
403
403
|
v-if="$props.multiple && Array.isArray($props.modelValue)"
|
|
404
|
+
class="fs-select-field-multiple-slide-group"
|
|
404
405
|
>
|
|
405
406
|
<FSCard
|
|
406
407
|
v-for="(item, index) in $props.items.filter((item: any) => $props.modelValue.includes(item[$props.itemValue!]))"
|
|
@@ -428,6 +429,7 @@
|
|
|
428
429
|
<FSButton
|
|
429
430
|
icon="mdi-close"
|
|
430
431
|
variant="icon"
|
|
432
|
+
:editable="$props.editable"
|
|
431
433
|
:color="ColorEnum.Dark"
|
|
432
434
|
@click="() => onCheckboxChange(item[$props.itemValue!])"
|
|
433
435
|
/>
|
|
@@ -582,6 +584,7 @@ export default defineComponent({
|
|
|
582
584
|
"--fs-select-field-border-color" : lights.base,
|
|
583
585
|
"--fs-select-field-color" : lights.dark,
|
|
584
586
|
"--fs-select-field-active-border-color": lights.base,
|
|
587
|
+
"--fs-select-field-multiple-opacity" : "var(--v-disabled-opacity)",
|
|
585
588
|
"--fs-base-field-input-height" : isMobileSized.value ? "34px" : "38px",
|
|
586
589
|
...fontStyles.value
|
|
587
590
|
};
|
|
@@ -593,6 +596,7 @@ export default defineComponent({
|
|
|
593
596
|
"--fs-select-field-color" : darks.base,
|
|
594
597
|
"--fs-select-field-active-border-color": darks.dark,
|
|
595
598
|
"--fs-select-field-error-border-color" : errors.base,
|
|
599
|
+
"--fs-select-field-multiple-opacity" : "1",
|
|
596
600
|
"--fs-base-field-input-height" : isMobileSized.value ? "34px" : "38px",
|
|
597
601
|
...fontStyles.value
|
|
598
602
|
};
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</template>
|
|
85
85
|
|
|
86
86
|
<script lang="ts">
|
|
87
|
-
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
87
|
+
import { computed, defineComponent, onMounted, type PropType, ref, watch } from "vue";
|
|
88
88
|
import _ from "lodash";
|
|
89
89
|
|
|
90
90
|
import { DateRules, NumberRules, TextRules } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -189,8 +189,8 @@ export default defineComponent({
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
const actualValue = computed(() => {
|
|
192
|
-
const dates = [parseForPicker(innerStartDate.value), parseForPicker(innerEndDate.value)]
|
|
193
|
-
if(dates.some(d => d == null)) {
|
|
192
|
+
const dates = [parseForPicker(innerStartDate.value), parseForPicker(innerEndDate.value)];
|
|
193
|
+
if (dates.some(d => d == null)) {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
196
196
|
return dates as [number, number];
|
|
@@ -650,14 +650,33 @@ export default defineComponent({
|
|
|
650
650
|
innerDateValue.value = 1;
|
|
651
651
|
};
|
|
652
652
|
|
|
653
|
-
watch(
|
|
654
|
-
if (
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
653
|
+
watch(() => props.startDate, () => {
|
|
654
|
+
if (props.startDate && parseForPicker(props.startDate) != null) {
|
|
655
|
+
innerDateSetting.value = DateSetting.Pick;
|
|
656
|
+
if (props.startDate !== innerStartDate.value) {
|
|
657
|
+
innerStartDate.value = props.startDate;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
else if (props.endDate !== innerEndDate.value) {
|
|
658
661
|
reset();
|
|
659
662
|
}
|
|
660
|
-
}
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
watch(() => props.endDate, () => {
|
|
666
|
+
if (props.endDate && parseForPicker(props.endDate) != null) {
|
|
667
|
+
innerDateSetting.value = DateSetting.Pick;
|
|
668
|
+
if (props.endDate !== innerEndDate.value) {
|
|
669
|
+
innerEndDate.value = props.endDate;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
else if (props.startDate !== innerStartDate.value) {
|
|
673
|
+
reset();
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
onMounted((): void => {
|
|
678
|
+
reset();
|
|
679
|
+
});
|
|
661
680
|
|
|
662
681
|
return {
|
|
663
682
|
innerDateSetting,
|
|
@@ -17,10 +17,13 @@
|
|
|
17
17
|
{{ $tr("ui.common.every", "Every") }}
|
|
18
18
|
</FSSpan>
|
|
19
19
|
<FSSelectDays
|
|
20
|
+
width="200px"
|
|
21
|
+
:placeholder="$tr('ui.common.selected-days', '{0} selected day(s)', days.length)"
|
|
20
22
|
:editable="$props.editable"
|
|
23
|
+
:multiple="true"
|
|
21
24
|
:useAllDays="false"
|
|
22
25
|
:hideHeader="true"
|
|
23
|
-
:modelValue="
|
|
26
|
+
:modelValue="days"
|
|
24
27
|
@update:modelValue="onUpdateDay($event)"
|
|
25
28
|
/>
|
|
26
29
|
<FSSpan
|
|
@@ -80,11 +83,13 @@ export default defineComponent({
|
|
|
80
83
|
|
|
81
84
|
const selectedConfiguration = ref("custom");
|
|
82
85
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
+
const days = computed((): number[] => {
|
|
87
|
+
try {
|
|
88
|
+
return props.modelValue[4].split(",").map((day) => parseInt(day) - 1);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error("Error parsing days:", error);
|
|
91
|
+
return [];
|
|
86
92
|
}
|
|
87
|
-
return parseInt(props.modelValue[4]) - 1;
|
|
88
93
|
});
|
|
89
94
|
|
|
90
95
|
const time = computed((): number => {
|
|
@@ -94,16 +99,21 @@ export default defineComponent({
|
|
|
94
99
|
return ((parseInt(props.modelValue[0])) + (parseInt(props.modelValue[1]) * 60)) * 60 * 1000;
|
|
95
100
|
});
|
|
96
101
|
|
|
97
|
-
const onUpdateDay = (value: number): void => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
const onUpdateDay = (value: number[]): void => {
|
|
103
|
+
if(value.length === 0) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const hours = Math.floor(time.value / (60 * 60 * 1000));
|
|
107
|
+
const minutes = Math.floor(time.value / (60 * 1000) % 60);
|
|
108
|
+
const daysCron = value.map((day) => day + 1).join(",");
|
|
109
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*`, `*`, `${daysCron}`]);
|
|
101
110
|
};
|
|
102
111
|
|
|
103
112
|
const onUpdateHours = (value: number): void => {
|
|
104
113
|
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
105
114
|
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
106
|
-
|
|
115
|
+
const daysCron = days.value.map((day) => day + 1).join(",");
|
|
116
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*`, `*`, `${daysCron}`]);
|
|
107
117
|
};
|
|
108
118
|
|
|
109
119
|
return {
|
|
@@ -111,7 +121,7 @@ export default defineComponent({
|
|
|
111
121
|
selectedConfiguration,
|
|
112
122
|
ColorEnum,
|
|
113
123
|
time,
|
|
114
|
-
|
|
124
|
+
days,
|
|
115
125
|
onUpdateHours,
|
|
116
126
|
onUpdateDay
|
|
117
127
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.130",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.130",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.130"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "fc680c25f1b54df6a7c9195343556c0c93f1454d"
|
|
39
39
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.fs-progress-bar-gradient {
|
|
2
|
+
flex: 1;
|
|
3
|
+
background-color: var(--progress-bar-background-color);
|
|
4
|
+
height: 8px;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
|
|
7
|
+
div {
|
|
8
|
+
transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
9
|
+
height: 100%;
|
|
10
|
+
background: linear-gradient(to right, var(--progress-bar-gradient-start-color) 0%, var(--progress-bar-gradient-end-color) var(--progress-bar-total-relative-width));
|
|
11
|
+
width: var(--progress-bar-gradient-width);
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
}
|
|
14
|
+
}
|