@dative-gpi/foundation-shared-components 0.0.79 → 0.0.81

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.
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <FSCol>
3
- <FSRow>
3
+ <FSRow
4
+ v-if="$props.label"
5
+ >
4
6
  <FSSpan
5
- v-if="$props.label"
6
7
  class="fs-calendar-label"
7
8
  font="text-overline"
8
9
  >
@@ -9,6 +9,8 @@
9
9
  @mouseup="active = false"
10
10
  >
11
11
  <FSCard
12
+ :borderRadius="$props.borderRadius"
13
+ :borderStyle="$props.borderStyle"
12
14
  :height="$props.height"
13
15
  :width="$props.width"
14
16
  :class="classes"
@@ -39,6 +41,8 @@
39
41
  @mouseup="active = false"
40
42
  >
41
43
  <FSCard
44
+ :borderRadius="$props.borderRadius"
45
+ :borderStyle="$props.borderStyle"
42
46
  :height="$props.height"
43
47
  :width="$props.width"
44
48
  :class="classes"
@@ -70,6 +74,8 @@
70
74
  @mouseup="active = false"
71
75
  >
72
76
  <FSCard
77
+ :borderRadius="$props.borderRadius"
78
+ :borderStyle="$props.borderStyle"
73
79
  :height="$props.height"
74
80
  :width="$props.width"
75
81
  :class="classes"
@@ -7,7 +7,7 @@
7
7
  v-bind="$attrs"
8
8
  >
9
9
  <FSCard
10
- padding="24px"
10
+ padding="24px 8px 24px 24px"
11
11
  width="100%"
12
12
  gap="24px"
13
13
  :border="!isExtraSmall"
@@ -13,6 +13,7 @@
13
13
  >
14
14
  <FSCol
15
15
  v-if="$props.title"
16
+ padding="0 16px 0 0"
16
17
  >
17
18
  <FSSpan
18
19
  font="text-h2"
@@ -31,37 +32,51 @@
31
32
  #body
32
33
  >
33
34
  <FSForm
35
+ :variant="$props.variant"
36
+ @submit="onSubmit"
34
37
  v-model="valid"
35
38
  >
36
39
  <FSCol
37
- gap="32px"
40
+ gap="24px"
38
41
  >
39
- <slot
40
- name="body"
41
- />
42
- <FSRow
43
- class="fs-dialog-actions"
44
- align="top-right"
45
- :wrap="false"
42
+ <FSFadeOut
43
+ :height="height"
44
+ padding="0 8px 0 0"
46
45
  >
47
- <FSButton
48
- :prependIcon="$props.leftButtonPrependIcon"
49
- :label="cancelButtonLabel"
50
- :appendIcon="$props.leftButtonAppendIcon"
51
- :variant="$props.leftButtonVariant"
52
- :color="$props.leftButtonColor"
53
- @click="() => $emit('update:modelValue', false)"
46
+ <slot
47
+ name="body"
54
48
  />
55
- <FSButton
56
- type="submit"
57
- :prependIcon="$props.rightButtonPrependIcon"
58
- :label="submitButtonLabel"
59
- :appendIcon="$props.rightButtonAppendIcon"
60
- :variant="$props.rightButtonVariant"
61
- :color="$props.rightButtonColor"
62
- :editable="$props.editable"
63
- @click="onSubmit"
49
+ </FSFadeOut>
50
+ <FSRow
51
+ padding="0 16px 0 0"
52
+ >
53
+ <slot
54
+ name="left-footer"
64
55
  />
56
+ <FSRow
57
+ class="fs-dialog-actions"
58
+ align="top-right"
59
+ :wrap="false"
60
+ >
61
+ <FSButton
62
+ :prependIcon="$props.leftButtonPrependIcon"
63
+ :label="cancelButtonLabel"
64
+ :appendIcon="$props.leftButtonAppendIcon"
65
+ :variant="$props.leftButtonVariant"
66
+ :color="$props.leftButtonColor"
67
+ @click="() => $emit('update:modelValue', false)"
68
+ />
69
+ <FSButton
70
+ type="submit"
71
+ :prependIcon="$props.rightButtonPrependIcon"
72
+ :label="submitButtonLabel"
73
+ :appendIcon="$props.rightButtonAppendIcon"
74
+ :variant="$props.rightButtonVariant"
75
+ :color="$props.rightButtonColor"
76
+ :load="$props.load"
77
+ :editable="$props.editable"
78
+ />
79
+ </FSRow>
65
80
  </FSRow>
66
81
  </FSCol>
67
82
  </FSForm>
@@ -74,7 +89,10 @@ import { computed, defineComponent, PropType, ref } from "vue";
74
89
 
75
90
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
76
91
  import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
92
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
77
93
 
94
+ import FSFadeOut from "./FSFadeOut.vue";
95
+ import FSButton from "./FSButton.vue";
78
96
  import FSDialog from "./FSDialog.vue";
79
97
  import FSForm from "./FSForm.vue";
80
98
  import FSRow from "./FSRow.vue";
@@ -82,6 +100,8 @@ import FSRow from "./FSRow.vue";
82
100
  export default defineComponent({
83
101
  name: "FSDialogForm",
84
102
  components: {
103
+ FSFadeOut,
104
+ FSButton,
85
105
  FSDialog,
86
106
  FSForm,
87
107
  FSRow
@@ -102,6 +122,11 @@ export default defineComponent({
102
122
  required: false,
103
123
  default: "auto"
104
124
  },
125
+ variant: {
126
+ type: String as PropType<"standard" | "lazy" | "submit">,
127
+ required: false,
128
+ default: "submit"
129
+ },
105
130
  modelValue: {
106
131
  type: Boolean,
107
132
  required: false,
@@ -157,6 +182,11 @@ export default defineComponent({
157
182
  required: false,
158
183
  default: ColorEnum.Primary
159
184
  },
185
+ load: {
186
+ type: Boolean,
187
+ required: false,
188
+ default: false
189
+ },
160
190
  editable: {
161
191
  type: Boolean,
162
192
  required: false,
@@ -165,10 +195,20 @@ export default defineComponent({
165
195
  },
166
196
  emits: ["update:modelValue", "click:rightButton"],
167
197
  setup(props, { emit }) {
198
+ const { isMobileSized } = useBreakpoints();
168
199
  const { $tr } = useTranslationsProvider();
169
200
 
170
201
  const valid = ref(false);
171
202
 
203
+ const height = computed(() => {
204
+ const other = 24 + 24 // Paddings
205
+ + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
206
+ + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
207
+ + (isMobileSized.value ? 36 : 40) // Footer
208
+ + 64; // Debug mask
209
+ return `calc(90vh - ${other}px)`;
210
+ });
211
+
172
212
  const cancelButtonLabel = computed(() => {
173
213
  return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
174
214
  });
@@ -187,6 +227,7 @@ export default defineComponent({
187
227
  cancelButtonLabel,
188
228
  submitButtonLabel,
189
229
  ColorEnum,
230
+ height,
190
231
  valid,
191
232
  onSubmit
192
233
  };
@@ -13,6 +13,7 @@
13
13
  >
14
14
  <FSCol
15
15
  v-if="$props.title"
16
+ padding="0 16px 0 0"
16
17
  >
17
18
  <FSSpan
18
19
  font="text-h2"
@@ -30,9 +31,14 @@
30
31
  <template
31
32
  #body
32
33
  >
33
- <slot
34
- name="body"
35
- />
34
+ <FSFadeOut
35
+ :height="height"
36
+ padding="0 8px 0 0"
37
+ >
38
+ <slot
39
+ name="body"
40
+ />
41
+ </FSFadeOut>
36
42
  </template>
37
43
  <template
38
44
  #footer
@@ -41,27 +47,33 @@
41
47
  name="footer"
42
48
  >
43
49
  <FSRow
44
- class="fs-dialog-actions"
45
- align="top-right"
46
- :wrap="false"
50
+ padding="0 16px 0 0"
47
51
  >
48
- <FSButton
49
- :prependIcon="$props.leftButtonPrependIcon"
50
- :label="cancelButtonLabel"
51
- :appendIcon="$props.leftButtonAppendIcon"
52
- :variant="$props.leftButtonVariant"
53
- :color="$props.leftButtonColor"
54
- @click="() => $emit('update:modelValue', false)"
55
- />
56
- <FSButton
57
- :prependIcon="$props.rightButtonPrependIcon"
58
- :label="submitButtonLabel"
59
- :appendIcon="$props.rightButtonAppendIcon"
60
- :variant="$props.rightButtonVariant"
61
- :color="$props.rightButtonColor"
62
- :editable="$props.editable"
63
- @click="() => $emit('click:rightButton')"
52
+ <slot
53
+ name="left-footer"
64
54
  />
55
+ <FSRow
56
+ align="top-right"
57
+ :wrap="false"
58
+ >
59
+ <FSButton
60
+ :prependIcon="$props.leftButtonPrependIcon"
61
+ :label="cancelButtonLabel"
62
+ :appendIcon="$props.leftButtonAppendIcon"
63
+ :variant="$props.leftButtonVariant"
64
+ :color="$props.leftButtonColor"
65
+ @click="() => $emit('update:modelValue', false)"
66
+ />
67
+ <FSButton
68
+ :prependIcon="$props.rightButtonPrependIcon"
69
+ :label="submitButtonLabel"
70
+ :appendIcon="$props.rightButtonAppendIcon"
71
+ :variant="$props.rightButtonVariant"
72
+ :color="$props.rightButtonColor"
73
+ :editable="$props.editable"
74
+ @click="() => $emit('click:rightButton')"
75
+ />
76
+ </FSRow>
65
77
  </FSRow>
66
78
  </slot>
67
79
  </template>
@@ -73,13 +85,18 @@ import { computed, defineComponent, PropType } from "vue";
73
85
 
74
86
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
75
87
  import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
88
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
76
89
 
90
+ import FSFadeOut from "./FSFadeOut.vue";
91
+ import FSButton from "./FSButton.vue";
77
92
  import FSDialog from "./FSDialog.vue";
78
93
  import FSRow from "./FSRow.vue";
79
94
 
80
95
  export default defineComponent({
81
96
  name: "FSDialogSubmit",
82
97
  components: {
98
+ FSFadeOut,
99
+ FSButton,
83
100
  FSDialog,
84
101
  FSRow
85
102
  },
@@ -162,8 +179,19 @@ export default defineComponent({
162
179
  },
163
180
  emits: ["update:modelValue", "click:rightButton"],
164
181
  setup(props) {
182
+ const { isMobileSized } = useBreakpoints();
165
183
  const { $tr } = useTranslationsProvider();
166
184
 
185
+ const height = computed(() => {
186
+ const other = 24 + 24 // Paddings
187
+ + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
188
+ + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
189
+ + (isMobileSized.value ? 36 : 40) // Footer
190
+ + 64; // Debug mask
191
+ console.log(document.documentElement.clientHeight, document.documentElement.clientHeight*0.9 - other);
192
+ return `calc(90vh - ${other}px)`;
193
+ });
194
+
167
195
  const cancelButtonLabel = computed(() => {
168
196
  return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
169
197
  });
@@ -175,7 +203,8 @@ export default defineComponent({
175
203
  return {
176
204
  cancelButtonLabel,
177
205
  submitButtonLabel,
178
- ColorEnum
206
+ ColorEnum,
207
+ height
179
208
  };
180
209
  }
181
210
  });
@@ -88,7 +88,7 @@ export default defineComponent({
88
88
  default: null
89
89
  }
90
90
  },
91
- emits: ["update:modelValue"],
91
+ emits: ["update:modelValue", "update:imageId"],
92
92
  setup(props, { emit }) {
93
93
  const { getColors } = useColors();
94
94
  const { readFile } = useFiles();
@@ -120,7 +120,12 @@ export default defineComponent({
120
120
  const onRemove = () => {
121
121
  fileSelected.value.fileName = "";
122
122
  fileSelected.value.fileContent = null;
123
- emit("update:modelValue", null);
123
+ if (props.modelValue) {
124
+ emit("update:modelValue", null);
125
+ }
126
+ else {
127
+ emit("update:imageId", null);
128
+ }
124
129
  };
125
130
 
126
131
  return {
@@ -24,7 +24,7 @@ export default defineComponent({
24
24
  variant: {
25
25
  type: String as PropType<"standard" | "lazy" | "submit">,
26
26
  required: false,
27
- default: "standard"
27
+ default: "submit"
28
28
  }
29
29
  },
30
30
  emits: ["update:modelValue", "submit"],
@@ -12,6 +12,7 @@
12
12
  >
13
13
  <template #placeholder>
14
14
  <FSLoader
15
+ v-if="$props.imageId"
15
16
  class="fs-image-load"
16
17
  height="100%"
17
18
  width="100%"
@@ -34,9 +34,9 @@
34
34
  </FSRow>
35
35
  </slot>
36
36
  <v-autocomplete
37
- menuIcon="mdi-chevron-down"
38
- clearIcon="mdi-close"
37
+ class="fs-autocomplete-field"
39
38
  variant="outlined"
39
+ :menuIcon="null"
40
40
  :style="style"
41
41
  :listProps="listStyle"
42
42
  :class="classes"
@@ -60,6 +60,27 @@
60
60
  <template v-for="(_, name) in slots" v-slot:[name]="slotData">
61
61
  <slot :name="name" v-bind="slotData" />
62
62
  </template>
63
+ <template #clear>
64
+ <slot name="clear">
65
+ <FSButton
66
+ v-if="$props.editable && $props.modelValue"
67
+ icon="mdi-close"
68
+ variant="icon"
69
+ :color="ColorEnum.Dark"
70
+ @click="$emit('update:modelValue', null)"
71
+ />
72
+ </slot>
73
+ </template>
74
+ <template #append-inner>
75
+ <slot name="append-inner">
76
+ <FSButton
77
+ icon="mdi-chevron-down"
78
+ variant="icon"
79
+ :editable="$props.editable"
80
+ :color="ColorEnum.Dark"
81
+ />
82
+ </slot>
83
+ </template>
63
84
  </v-autocomplete>
64
85
  <slot name="description">
65
86
  <FSSpan
@@ -80,6 +101,7 @@ import { computed, defineComponent, PropType, ref, watch } from "vue";
80
101
  import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
81
102
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
82
103
 
104
+ import FSButton from "../FSButton.vue";
83
105
  import FSSpan from "../FSSpan.vue";
84
106
  import FSCol from "../FSCol.vue";
85
107
  import FSRow from "../FSRow.vue";
@@ -87,6 +109,7 @@ import FSRow from "../FSRow.vue";
87
109
  export default defineComponent({
88
110
  name: "FSAutocompleteField",
89
111
  components: {
112
+ FSButton,
90
113
  FSSpan,
91
114
  FSCol,
92
115
  FSRow
@@ -221,6 +244,7 @@ export default defineComponent({
221
244
  return {
222
245
  innerSearch,
223
246
  validateOn,
247
+ ColorEnum,
224
248
  listStyle,
225
249
  messages,
226
250
  blurred,
@@ -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 #activator="{ props }">
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 #prepend-inner>
24
- <slot name="prepend-inner">
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 #append>
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 #prepend-inner>
53
- <slot name="prepend-inner">
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 #append>
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 name="description">
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] : string | undefined } => {
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,
@@ -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
- clearIcon="mdi-close"
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>
@@ -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
- return base.saturationv(((base.saturationv() * 30) / 100) + 70).value(90);
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.79",
4
+ "version": "0.0.81",
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.79",
14
- "@dative-gpi/foundation-shared-services": "0.0.79",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.81",
14
+ "@dative-gpi/foundation-shared-services": "0.0.81",
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.2.0"
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": "60788de9c98493c3bd2889c2cd92f1a7d0780543"
35
+ "gitHead": "72578083082db4065616325c62c03918f5a50166"
36
36
  }
@@ -15,7 +15,7 @@
15
15
  position: relative;
16
16
  min-width: 35vw !important;
17
17
  max-width: 90vw !important;
18
- max-height: 90vw !important;
18
+ max-height: 90vh !important;
19
19
 
20
20
  &.fs-dialog-mobile {
21
21
  border-top-left-radius: 4px;
@@ -28,10 +28,4 @@
28
28
  position: absolute;
29
29
  top: 6px;
30
30
  right: 6px;
31
- }
32
-
33
- .fs-dialog-actions {
34
- position: sticky;
35
- bottom: 8px;
36
- right: 8px;
37
31
  }
@@ -2,15 +2,14 @@
2
2
  @extend .fs-hide-y-scrollbar;
3
3
 
4
4
  max-height: var(--fs-fade-out-height);
5
+
5
6
  padding: var(--fs-fade-out-padding);
6
7
  width: var(--fs-fade-out-width);
7
- padding-bottom: 0 !important;
8
- padding-top: 0 !important;
9
8
  flex-direction: column;
10
9
  position: relative;
11
10
  display: flex;
12
11
  }
13
-
12
+ // TODO
14
13
  .fs-fade-out-top {
15
14
  pointer-events: none;
16
15
  position: sticky;
@@ -4,6 +4,8 @@
4
4
 
5
5
  & .v-slider__container {
6
6
  cursor: var(--fs-slider-cursor);
7
+ margin-left: 8px;
8
+ margin-right: 8px;
7
9
  opacity: 1 !important;
8
10
  }
9
11
 
@@ -70,7 +70,6 @@
70
70
 
71
71
  &:not(.fs-text-area) > .v-input__control > .v-field {
72
72
  padding: 0 16px !important;
73
- gap: 8px;
74
73
 
75
74
  & > .v-field__field > .v-field__input {
76
75
  @extend .text-body;