@dative-gpi/foundation-shared-components 0.0.78 → 0.0.80
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/FSCalendarTwin.vue +3 -2
- package/components/FSClickable.vue +6 -0
- package/components/FSDialog.vue +1 -1
- package/components/FSDialogForm.vue +236 -0
- package/components/{FSRemoveDialog.vue → FSDialogRemove.vue} +14 -9
- package/components/{FSSubmitDialog.vue → FSDialogSubmit.vue} +78 -32
- package/components/FSForm.vue +1 -1
- package/components/fields/FSAutocompleteField.vue +26 -2
- package/components/fields/FSColorField.vue +52 -16
- package/components/fields/FSDateRangeField.vue +4 -4
- package/components/fields/FSDateTimeRangeField.vue +4 -4
- package/components/fields/FSSelectField.vue +25 -2
- package/components/fields/FSTagField.vue +3 -3
- package/components/fields/FSTextArea.vue +12 -2
- package/components/fields/FSTextField.vue +12 -1
- package/components/tiles/FSDashboardOrganisationTileUI.vue +29 -1
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +29 -1
- package/components/tiles/FSDashboardShallowTileUI.vue +29 -1
- package/components/tiles/FSFolderTileUI.vue +29 -1
- package/composables/useColors.ts +28 -3
- package/package.json +5 -5
- package/styles/components/fs_dialog.scss +2 -1
- package/styles/components/fs_fade_out.scss +2 -3
- package/styles/components/fs_slider.scss +2 -0
- package/styles/components/index.scss +0 -1
- package/styles/globals/overrides.scss +0 -1
- package/styles/components/fs_submit_dialog.scss +0 -9
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<v-menu
|
|
3
3
|
:closeOnContentClick="false"
|
|
4
4
|
:modelValue="menu && $props.editable"
|
|
5
5
|
@update:modelValue="(value) => menu = value"
|
|
6
|
-
>
|
|
7
|
-
<template
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
#activator="{ props }"
|
|
9
|
+
>
|
|
8
10
|
<FSCol>
|
|
9
11
|
<FSRow
|
|
10
12
|
height="fill"
|
|
@@ -20,8 +22,12 @@
|
|
|
20
22
|
:modelValue="innerColor"
|
|
21
23
|
v-bind="$attrs"
|
|
22
24
|
>
|
|
23
|
-
<template
|
|
24
|
-
|
|
25
|
+
<template
|
|
26
|
+
#prepend-inner
|
|
27
|
+
>
|
|
28
|
+
<slot
|
|
29
|
+
name="prepend-inner"
|
|
30
|
+
>
|
|
25
31
|
<FSIcon
|
|
26
32
|
:color="innerColor"
|
|
27
33
|
>
|
|
@@ -29,7 +35,9 @@
|
|
|
29
35
|
</FSIcon>
|
|
30
36
|
</slot>
|
|
31
37
|
</template>
|
|
32
|
-
<template
|
|
38
|
+
<template
|
|
39
|
+
#append
|
|
40
|
+
>
|
|
33
41
|
<FSButton
|
|
34
42
|
prependIcon="mdi-pencil"
|
|
35
43
|
variant="full"
|
|
@@ -39,7 +47,7 @@
|
|
|
39
47
|
</template>
|
|
40
48
|
</FSTextField>
|
|
41
49
|
<FSTextField
|
|
42
|
-
v-if="$props.allowOpacity"
|
|
50
|
+
v-if="$props.allowOpacity && !$props.onlyBaseColors"
|
|
43
51
|
class="fs-color-field-opacity"
|
|
44
52
|
:label="$tr('ui.color-field.opacity', 'Opacity')"
|
|
45
53
|
:hideHeader="$props.hideHeader"
|
|
@@ -47,10 +55,14 @@
|
|
|
47
55
|
:editable="$props.editable"
|
|
48
56
|
:clearable="false"
|
|
49
57
|
:readonly="true"
|
|
50
|
-
:modelValue="(Math.round(getPercentageFromHex(innerOpacity)*100)) + ' %'"
|
|
58
|
+
:modelValue="(Math.round(getPercentageFromHex(innerOpacity) * 100)) + ' %'"
|
|
51
59
|
>
|
|
52
|
-
<template
|
|
53
|
-
|
|
60
|
+
<template
|
|
61
|
+
#prepend-inner
|
|
62
|
+
>
|
|
63
|
+
<slot
|
|
64
|
+
name="prepend-inner"
|
|
65
|
+
>
|
|
54
66
|
<FSIcon
|
|
55
67
|
:color="ColorEnum.Dark"
|
|
56
68
|
:editable="$props.editable"
|
|
@@ -60,7 +72,9 @@
|
|
|
60
72
|
</FSIcon>
|
|
61
73
|
</slot>
|
|
62
74
|
</template>
|
|
63
|
-
<template
|
|
75
|
+
<template
|
|
76
|
+
#append
|
|
77
|
+
>
|
|
64
78
|
<FSButton
|
|
65
79
|
prependIcon="mdi-pencil"
|
|
66
80
|
variant="full"
|
|
@@ -70,7 +84,9 @@
|
|
|
70
84
|
</template>
|
|
71
85
|
</FSTextField>
|
|
72
86
|
</FSRow>
|
|
73
|
-
<slot
|
|
87
|
+
<slot
|
|
88
|
+
name="description"
|
|
89
|
+
>
|
|
74
90
|
<FSSpan
|
|
75
91
|
v-if="$props.description"
|
|
76
92
|
class="fs-color-field-description"
|
|
@@ -81,7 +97,7 @@
|
|
|
81
97
|
</FSSpan>
|
|
82
98
|
</slot>
|
|
83
99
|
</FSCol>
|
|
84
|
-
</template>
|
|
100
|
+
</template>
|
|
85
101
|
<FSCard
|
|
86
102
|
:elevation="true"
|
|
87
103
|
:border="false"
|
|
@@ -90,6 +106,7 @@
|
|
|
90
106
|
width="fill"
|
|
91
107
|
>
|
|
92
108
|
<v-color-picker
|
|
109
|
+
v-if="!$props.onlyBaseColors"
|
|
93
110
|
class="fs-color-field-picker"
|
|
94
111
|
mode="hexa"
|
|
95
112
|
:elevation="0"
|
|
@@ -97,11 +114,24 @@
|
|
|
97
114
|
:modelValue="fullColor"
|
|
98
115
|
@update:modelValue="onSubmit"
|
|
99
116
|
/>
|
|
117
|
+
<v-color-picker
|
|
118
|
+
v-else
|
|
119
|
+
class="fs-color-field-picker"
|
|
120
|
+
:elevation="0"
|
|
121
|
+
:modelValue="fullColor"
|
|
122
|
+
@update:modelValue="onSubmit"
|
|
123
|
+
swatches-max-height="400px"
|
|
124
|
+
show-swatches
|
|
125
|
+
hide-inputs
|
|
126
|
+
hide-canvas
|
|
127
|
+
hide-sliders
|
|
128
|
+
:swatches="getBasePaletteColors()"
|
|
129
|
+
/>
|
|
100
130
|
</FSCol>
|
|
101
131
|
</FSCard>
|
|
102
132
|
</v-menu>
|
|
103
133
|
</template>
|
|
104
|
-
|
|
134
|
+
|
|
105
135
|
<script lang="ts">
|
|
106
136
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
107
137
|
|
|
@@ -161,11 +191,16 @@ export default defineComponent({
|
|
|
161
191
|
type: Boolean,
|
|
162
192
|
required: false,
|
|
163
193
|
default: true
|
|
194
|
+
},
|
|
195
|
+
onlyBaseColors: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
required: false,
|
|
198
|
+
default: false
|
|
164
199
|
}
|
|
165
200
|
},
|
|
166
201
|
emits: ["update:modelValue", "update:opacity"],
|
|
167
202
|
setup(props, { emit }) {
|
|
168
|
-
const { getColors } = useColors();
|
|
203
|
+
const { getColors, getBasePaletteColors } = useColors();
|
|
169
204
|
const { slots } = useSlots();
|
|
170
205
|
|
|
171
206
|
delete slots.description;
|
|
@@ -178,7 +213,7 @@ export default defineComponent({
|
|
|
178
213
|
const innerOpacity = ref(getHexFromPercentage(props.opacityValue));
|
|
179
214
|
const fullColor = ref(innerColor.value + innerOpacity.value);
|
|
180
215
|
|
|
181
|
-
const style = computed((): { [key: string]
|
|
216
|
+
const style = computed((): { [key: string]: string | undefined } => {
|
|
182
217
|
if (!props.editable) {
|
|
183
218
|
return {
|
|
184
219
|
"--fs-color-field-color": lights.dark
|
|
@@ -200,6 +235,7 @@ export default defineComponent({
|
|
|
200
235
|
|
|
201
236
|
return {
|
|
202
237
|
getPercentageFromHex,
|
|
238
|
+
getBasePaletteColors,
|
|
203
239
|
innerOpacity,
|
|
204
240
|
innerColor,
|
|
205
241
|
fullColor,
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<slot :name="name" v-bind="slotData" />
|
|
32
32
|
</template>
|
|
33
33
|
</FSTextField>
|
|
34
|
-
<
|
|
34
|
+
<FSDialogSubmit
|
|
35
35
|
:title="$props.label"
|
|
36
36
|
:rightButtonColor="$props.color"
|
|
37
37
|
@click:rightButton="onSubmit"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
v-model="innerDateRange"
|
|
44
44
|
/>
|
|
45
45
|
</template>
|
|
46
|
-
</
|
|
46
|
+
</FSDialogSubmit>
|
|
47
47
|
</template>
|
|
48
48
|
|
|
49
49
|
<script lang="ts">
|
|
@@ -53,7 +53,7 @@ import { useColors, useRules } from "@dative-gpi/foundation-shared-components/co
|
|
|
53
53
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
54
54
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
55
55
|
|
|
56
|
-
import
|
|
56
|
+
import FSDialogSubmit from "../FSDialogSubmit.vue";
|
|
57
57
|
import FSCalendarTwin from "../FSCalendarTwin.vue";
|
|
58
58
|
import FSTextField from "./FSTextField.vue";
|
|
59
59
|
import FSButton from "../FSButton.vue";
|
|
@@ -61,7 +61,7 @@ import FSButton from "../FSButton.vue";
|
|
|
61
61
|
export default defineComponent({
|
|
62
62
|
name: "FSDateRangeField",
|
|
63
63
|
components: {
|
|
64
|
-
|
|
64
|
+
FSDialogSubmit,
|
|
65
65
|
FSCalendarTwin,
|
|
66
66
|
FSTextField,
|
|
67
67
|
FSButton
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<slot :name="name" v-bind="slotData" />
|
|
32
32
|
</template>
|
|
33
33
|
</FSTextField>
|
|
34
|
-
<
|
|
34
|
+
<FSDialogSubmit
|
|
35
35
|
:title="$props.label"
|
|
36
36
|
:rightButtonColor="$props.color"
|
|
37
37
|
@click:rightButton="onSubmit"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</FSRow>
|
|
68
68
|
</FSCol>
|
|
69
69
|
</template>
|
|
70
|
-
</
|
|
70
|
+
</FSDialogSubmit>
|
|
71
71
|
</template>
|
|
72
72
|
|
|
73
73
|
<script lang="ts">
|
|
@@ -77,7 +77,7 @@ import { useColors, useRules } from "@dative-gpi/foundation-shared-components/co
|
|
|
77
77
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
78
78
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
79
79
|
|
|
80
|
-
import
|
|
80
|
+
import FSDialogSubmit from "../FSDialogSubmit.vue";
|
|
81
81
|
import FSCalendarTwin from "../FSCalendarTwin.vue";
|
|
82
82
|
import FSTextField from "./FSTextField.vue";
|
|
83
83
|
import FSButton from "../FSButton.vue";
|
|
@@ -88,7 +88,7 @@ import FSRow from "../FSRow.vue";
|
|
|
88
88
|
export default defineComponent({
|
|
89
89
|
name: "FSDateTimeRangeField",
|
|
90
90
|
components: {
|
|
91
|
-
|
|
91
|
+
FSDialogSubmit,
|
|
92
92
|
FSCalendarTwin,
|
|
93
93
|
FSTextField,
|
|
94
94
|
FSButton,
|
|
@@ -35,9 +35,8 @@
|
|
|
35
35
|
</slot>
|
|
36
36
|
<v-select
|
|
37
37
|
class="fs-select-field"
|
|
38
|
-
menuIcon="mdi-chevron-down"
|
|
39
|
-
clearIcon="mdi-close"
|
|
40
38
|
variant="outlined"
|
|
39
|
+
:menuIcon="null"
|
|
41
40
|
:style="style"
|
|
42
41
|
:listProps="listStyle"
|
|
43
42
|
:hideDetails="true"
|
|
@@ -57,6 +56,27 @@
|
|
|
57
56
|
<template v-for="(_, name) in slots" v-slot:[name]="slotData">
|
|
58
57
|
<slot :name="name" v-bind="slotData" />
|
|
59
58
|
</template>
|
|
59
|
+
<template #clear>
|
|
60
|
+
<slot name="clear">
|
|
61
|
+
<FSButton
|
|
62
|
+
v-if="$props.editable && $props.modelValue"
|
|
63
|
+
icon="mdi-close"
|
|
64
|
+
variant="icon"
|
|
65
|
+
:color="ColorEnum.Dark"
|
|
66
|
+
@click="$emit('update:modelValue', null)"
|
|
67
|
+
/>
|
|
68
|
+
</slot>
|
|
69
|
+
</template>
|
|
70
|
+
<template #append-inner>
|
|
71
|
+
<slot name="append-inner">
|
|
72
|
+
<FSButton
|
|
73
|
+
icon="mdi-chevron-down"
|
|
74
|
+
variant="icon"
|
|
75
|
+
:editable="$props.editable"
|
|
76
|
+
:color="ColorEnum.Dark"
|
|
77
|
+
/>
|
|
78
|
+
</slot>
|
|
79
|
+
</template>
|
|
60
80
|
</v-select>
|
|
61
81
|
<slot name="description">
|
|
62
82
|
<FSSpan
|
|
@@ -77,6 +97,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
77
97
|
import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
78
98
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
79
99
|
|
|
100
|
+
import FSButton from "../FSButton.vue";
|
|
80
101
|
import FSSpan from "../FSSpan.vue";
|
|
81
102
|
import FSCol from "../FSCol.vue";
|
|
82
103
|
import FSRow from "../FSRow.vue";
|
|
@@ -84,6 +105,7 @@ import FSRow from "../FSRow.vue";
|
|
|
84
105
|
export default defineComponent({
|
|
85
106
|
name: "FSSelectField",
|
|
86
107
|
components: {
|
|
108
|
+
FSButton,
|
|
87
109
|
FSSpan,
|
|
88
110
|
FSCol,
|
|
89
111
|
FSRow
|
|
@@ -193,6 +215,7 @@ export default defineComponent({
|
|
|
193
215
|
|
|
194
216
|
return {
|
|
195
217
|
validateOn,
|
|
218
|
+
ColorEnum,
|
|
196
219
|
listStyle,
|
|
197
220
|
messages,
|
|
198
221
|
blurred,
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
v-model="innerValue"
|
|
16
16
|
v-bind="$attrs"
|
|
17
17
|
>
|
|
18
|
+
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
19
|
+
<slot :name="name" v-bind="slotData" />
|
|
20
|
+
</template>
|
|
18
21
|
<template #append-inner>
|
|
19
22
|
<slot name="append-inner">
|
|
20
23
|
<FSButton
|
|
@@ -26,9 +29,6 @@
|
|
|
26
29
|
/>
|
|
27
30
|
</slot>
|
|
28
31
|
</template>
|
|
29
|
-
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
30
|
-
<slot :name="name" v-bind="slotData" />
|
|
31
|
-
</template>
|
|
32
32
|
</FSTextField>
|
|
33
33
|
<FSTagGroup
|
|
34
34
|
:tags="$props.modelValue"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</FSRow>
|
|
35
35
|
</slot>
|
|
36
36
|
<v-textarea
|
|
37
|
-
|
|
37
|
+
class="fs-text-area"
|
|
38
38
|
variant="outlined"
|
|
39
39
|
:style="style"
|
|
40
40
|
:class="classes"
|
|
@@ -54,6 +54,15 @@
|
|
|
54
54
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
55
55
|
<slot :name="name" v-bind="slotData" />
|
|
56
56
|
</template>
|
|
57
|
+
<template #clear>
|
|
58
|
+
<FSButton
|
|
59
|
+
v-if="$props.editable && $props.modelValue"
|
|
60
|
+
icon="mdi-close"
|
|
61
|
+
variant="icon"
|
|
62
|
+
:color="ColorEnum.Dark"
|
|
63
|
+
@click="$emit('update:modelValue', null)"
|
|
64
|
+
/>
|
|
65
|
+
</template>
|
|
57
66
|
</v-textarea>
|
|
58
67
|
<slot name="description">
|
|
59
68
|
<FSSpan
|
|
@@ -200,10 +209,11 @@ export default defineComponent({
|
|
|
200
209
|
|
|
201
210
|
return {
|
|
202
211
|
validateOn,
|
|
212
|
+
ColorEnum,
|
|
203
213
|
messages,
|
|
204
214
|
blurred,
|
|
215
|
+
classes,
|
|
205
216
|
style,
|
|
206
|
-
classes
|
|
207
217
|
};
|
|
208
218
|
}
|
|
209
219
|
});
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
</slot>
|
|
36
36
|
<v-text-field
|
|
37
37
|
class="fs-text-field"
|
|
38
|
-
clearIcon="mdi-close"
|
|
39
38
|
variant="outlined"
|
|
40
39
|
:style="style"
|
|
41
40
|
:type="$props.type"
|
|
@@ -52,6 +51,15 @@
|
|
|
52
51
|
<template v-for="(_, name) in slots" v-slot:[name]="slotData">
|
|
53
52
|
<slot :name="name" v-bind="slotData" />
|
|
54
53
|
</template>
|
|
54
|
+
<template #clear>
|
|
55
|
+
<FSButton
|
|
56
|
+
v-if="$props.editable && $props.modelValue"
|
|
57
|
+
icon="mdi-close"
|
|
58
|
+
variant="icon"
|
|
59
|
+
:color="ColorEnum.Dark"
|
|
60
|
+
@click="$emit('update:modelValue', null)"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
55
63
|
</v-text-field>
|
|
56
64
|
<slot name="description">
|
|
57
65
|
<FSSpan
|
|
@@ -72,6 +80,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
72
80
|
import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
73
81
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
74
82
|
|
|
83
|
+
import FSButton from "../FSButton.vue";
|
|
75
84
|
import FSSpan from "../FSSpan.vue";
|
|
76
85
|
import FSCol from "../FSCol.vue";
|
|
77
86
|
import FSRow from "../FSRow.vue";
|
|
@@ -79,6 +88,7 @@ import FSRow from "../FSRow.vue";
|
|
|
79
88
|
export default defineComponent({
|
|
80
89
|
name: "FSTextField",
|
|
81
90
|
components: {
|
|
91
|
+
FSButton,
|
|
82
92
|
FSSpan,
|
|
83
93
|
FSCol,
|
|
84
94
|
FSRow
|
|
@@ -166,6 +176,7 @@ export default defineComponent({
|
|
|
166
176
|
|
|
167
177
|
return {
|
|
168
178
|
validateOn,
|
|
179
|
+
ColorEnum,
|
|
169
180
|
messages,
|
|
170
181
|
blurred,
|
|
171
182
|
slots,
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSSimpleIconTileUI
|
|
3
|
+
:bottomColor="color"
|
|
4
|
+
:icon="$props.icon"
|
|
3
5
|
v-bind="$attrs"
|
|
4
6
|
/>
|
|
5
7
|
</template>
|
|
6
8
|
|
|
7
9
|
<script lang="ts">
|
|
8
|
-
import { defineComponent } from "vue";
|
|
10
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
11
|
+
|
|
12
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
9
13
|
|
|
10
14
|
import FSSimpleIconTileUI from "./FSSimpleIconTileUI.vue";
|
|
11
15
|
|
|
12
16
|
export default defineComponent({
|
|
13
17
|
name: "FSDashboardOrganisationTileUI",
|
|
18
|
+
props: {
|
|
19
|
+
bottomColor: {
|
|
20
|
+
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
|
21
|
+
required: false,
|
|
22
|
+
default: ColorEnum.Primary
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
default: "mdi-view-dashboard"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
14
30
|
components: {
|
|
15
31
|
FSSimpleIconTileUI
|
|
32
|
+
},
|
|
33
|
+
setup(props){
|
|
34
|
+
const color = computed(() => {
|
|
35
|
+
if(Array.isArray(props.bottomColor) && !props.bottomColor.length) {
|
|
36
|
+
return ColorEnum.Primary;
|
|
37
|
+
}
|
|
38
|
+
return props.bottomColor;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
color
|
|
43
|
+
}
|
|
16
44
|
}
|
|
17
45
|
});
|
|
18
46
|
</script>
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSSimpleIconTileUI
|
|
3
|
+
:bottomColor="color"
|
|
4
|
+
:icon="$props.icon"
|
|
3
5
|
v-bind="$attrs"
|
|
4
6
|
/>
|
|
5
7
|
</template>
|
|
6
8
|
|
|
7
9
|
<script lang="ts">
|
|
8
|
-
import { defineComponent } from "vue";
|
|
10
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
11
|
+
|
|
12
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
9
13
|
|
|
10
14
|
import FSSimpleIconTileUI from "./FSSimpleIconTileUI.vue";
|
|
11
15
|
|
|
12
16
|
export default defineComponent({
|
|
13
17
|
name: "FSDashboardOrganisationTypeTileUI",
|
|
18
|
+
props: {
|
|
19
|
+
bottomColor: {
|
|
20
|
+
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
|
21
|
+
required: false,
|
|
22
|
+
default: ColorEnum.Primary
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
default: "mdi-view-dashboard"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
14
30
|
components: {
|
|
15
31
|
FSSimpleIconTileUI
|
|
32
|
+
},
|
|
33
|
+
setup(props){
|
|
34
|
+
const color = computed(() => {
|
|
35
|
+
if(Array.isArray(props.bottomColor) && !props.bottomColor.length) {
|
|
36
|
+
return ColorEnum.Primary;
|
|
37
|
+
}
|
|
38
|
+
return props.bottomColor;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
color
|
|
43
|
+
}
|
|
16
44
|
}
|
|
17
45
|
});
|
|
18
46
|
</script>
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSSimpleIconTileUI
|
|
3
|
+
:bottomColor="color"
|
|
4
|
+
:icon="$props.icon"
|
|
3
5
|
v-bind="$attrs"
|
|
4
6
|
/>
|
|
5
7
|
</template>
|
|
6
8
|
|
|
7
9
|
<script lang="ts">
|
|
8
|
-
import { defineComponent } from "vue";
|
|
10
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
11
|
+
|
|
12
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
9
13
|
|
|
10
14
|
import FSSimpleIconTileUI from "./FSSimpleIconTileUI.vue";
|
|
11
15
|
|
|
12
16
|
export default defineComponent({
|
|
13
17
|
name: "FSDashboardShallowTileUI",
|
|
18
|
+
props: {
|
|
19
|
+
bottomColor: {
|
|
20
|
+
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
|
21
|
+
required: false,
|
|
22
|
+
default: ColorEnum.Primary
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
default: "mdi-view-dashboard"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
14
30
|
components: {
|
|
15
31
|
FSSimpleIconTileUI
|
|
32
|
+
},
|
|
33
|
+
setup(props){
|
|
34
|
+
const color = computed(() => {
|
|
35
|
+
if(Array.isArray(props.bottomColor) && !props.bottomColor.length) {
|
|
36
|
+
return ColorEnum.Primary;
|
|
37
|
+
}
|
|
38
|
+
return props.bottomColor;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
color
|
|
43
|
+
}
|
|
16
44
|
}
|
|
17
45
|
});
|
|
18
46
|
</script>
|
|
@@ -1,19 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSSimpleIconTileUI
|
|
3
|
+
:bottomColor="color"
|
|
4
|
+
:icon="$props.icon"
|
|
3
5
|
:iconBackgroundColor="true"
|
|
4
6
|
v-bind="$attrs"
|
|
5
7
|
/>
|
|
6
8
|
</template>
|
|
7
9
|
|
|
8
10
|
<script lang="ts">
|
|
9
|
-
import { defineComponent } from "vue";
|
|
11
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
12
|
+
|
|
13
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
10
14
|
|
|
11
15
|
import FSSimpleIconTileUI from "./FSSimpleIconTileUI.vue";
|
|
12
16
|
|
|
13
17
|
export default defineComponent({
|
|
14
18
|
name: "FSFolderTileUI",
|
|
19
|
+
props: {
|
|
20
|
+
bottomColor: {
|
|
21
|
+
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
|
22
|
+
required: false,
|
|
23
|
+
default: [ColorEnum.Light, ColorEnum.Primary]
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: false,
|
|
28
|
+
default: "mdi-folder-outline"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
15
31
|
components: {
|
|
16
32
|
FSSimpleIconTileUI
|
|
33
|
+
},
|
|
34
|
+
setup(props){
|
|
35
|
+
const color = computed(() => {
|
|
36
|
+
if(Array.isArray(props.bottomColor) && !props.bottomColor.length) {
|
|
37
|
+
return [ColorEnum.Light, ColorEnum.Primary];
|
|
38
|
+
}
|
|
39
|
+
return props.bottomColor;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
color
|
|
44
|
+
}
|
|
17
45
|
}
|
|
18
46
|
});
|
|
19
47
|
</script>
|
package/composables/useColors.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { ColorBase, ColorEnum, ColorVariations } from "@dative-gpi/foundation-sh
|
|
|
6
6
|
|
|
7
7
|
export const useColors = () => {
|
|
8
8
|
const theme = useTheme().current.value;
|
|
9
|
+
const baseMinSaturation = 55;
|
|
10
|
+
const baseFixedBrightness = 90;
|
|
9
11
|
|
|
10
12
|
const isGrayScale = (color: Color): boolean => {
|
|
11
13
|
const maxDiff = Math.max(
|
|
@@ -35,7 +37,8 @@ export const useColors = () => {
|
|
|
35
37
|
if (isGrayScale(base)) {
|
|
36
38
|
return base.saturationv(1);
|
|
37
39
|
}
|
|
38
|
-
|
|
40
|
+
const saturation = base.saturationv() > baseMinSaturation ? base.saturationv() : baseMinSaturation;
|
|
41
|
+
return base.saturationv(saturation).value(baseFixedBrightness);
|
|
39
42
|
};
|
|
40
43
|
|
|
41
44
|
const getDark = (base: Color): Color => {
|
|
@@ -58,7 +61,7 @@ export const useColors = () => {
|
|
|
58
61
|
const themed = (Object as any).values(ColorEnum).includes(color);
|
|
59
62
|
|
|
60
63
|
const seed = themed ? new Color(theme.colors[color as ColorEnum]) : new Color(color);
|
|
61
|
-
|
|
64
|
+
|
|
62
65
|
const base = getBase(seed);
|
|
63
66
|
const light = getLight(base);
|
|
64
67
|
const soft = getSoft(base);
|
|
@@ -115,8 +118,30 @@ export const useColors = () => {
|
|
|
115
118
|
};
|
|
116
119
|
}
|
|
117
120
|
|
|
121
|
+
const getBasePaletteColors = (): string[][] => {
|
|
122
|
+
const columnCount = 5
|
|
123
|
+
const colors: string[][] = [];
|
|
124
|
+
for (let saturation = baseMinSaturation; saturation <= 100; saturation += (100 - baseMinSaturation) / (columnCount - 1)) {
|
|
125
|
+
let colorsRow = [];
|
|
126
|
+
for (let hue = 0; hue < 360; hue += 15) {
|
|
127
|
+
const color = new Color({ h: hue, s: saturation, v: baseFixedBrightness });
|
|
128
|
+
colorsRow.push(color.hex());
|
|
129
|
+
}
|
|
130
|
+
colors.push(colorsRow)
|
|
131
|
+
}
|
|
132
|
+
let i = 0;
|
|
133
|
+
for (let brightness = 5; brightness <= 95; brightness += (90 / (columnCount - 1))) {
|
|
134
|
+
const color = new Color({ h: 0, s: 1, v: 100 - brightness });
|
|
135
|
+
colors[i].unshift(color.hex());
|
|
136
|
+
i++;
|
|
137
|
+
}
|
|
138
|
+
return colors;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
118
142
|
return {
|
|
119
143
|
getColors,
|
|
120
|
-
getGradients
|
|
144
|
+
getGradients,
|
|
145
|
+
getBasePaletteColors
|
|
121
146
|
};
|
|
122
147
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.80",
|
|
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": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.80",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.80",
|
|
15
15
|
"@fontsource/montserrat": "^5.0.16",
|
|
16
16
|
"@lexical/clipboard": "^0.12.5",
|
|
17
17
|
"@lexical/history": "^0.12.5",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"blurhash": "^2.0.5",
|
|
26
26
|
"color": "^4.2.3",
|
|
27
27
|
"lexical": "^0.12.5",
|
|
28
|
-
"vue": "^3.
|
|
28
|
+
"vue": "^3.4.23"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/color": "^3.0.6",
|
|
32
32
|
"sass": "^1.69.5",
|
|
33
33
|
"sass-loader": "^13.3.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6418edb464dd47a1384ff22515e5215e43fe6edb"
|
|
36
36
|
}
|