@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.
@@ -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"
@@ -0,0 +1,236 @@
1
+ <template>
2
+ <FSDialog
3
+ :width="$props.width"
4
+ :modelValue="$props.modelValue"
5
+ @update:modelValue="$emit('update:modelValue', $event)"
6
+ v-bind="$attrs"
7
+ >
8
+ <template
9
+ #header
10
+ >
11
+ <slot
12
+ name="header"
13
+ >
14
+ <FSCol
15
+ v-if="$props.title"
16
+ padding="0 16px 0 0"
17
+ >
18
+ <FSSpan
19
+ font="text-h2"
20
+ >
21
+ {{ $props.title }}
22
+ </FSSpan>
23
+ <FSSpan
24
+ v-if="$props.subtitle"
25
+ >
26
+ {{ $props.subtitle }}
27
+ </FSSpan>
28
+ </FSCol>
29
+ </slot>
30
+ </template>
31
+ <template
32
+ #body
33
+ >
34
+ <FSForm
35
+ :variant="$props.variant"
36
+ v-model="valid"
37
+ >
38
+ <FSCol
39
+ gap="24px"
40
+ >
41
+ <FSFadeOut
42
+ :height="height"
43
+ padding="0 8px 0 0"
44
+ >
45
+ <slot
46
+ name="body"
47
+ />
48
+ </FSFadeOut>
49
+ <FSRow
50
+ padding="0 16px 0 0"
51
+ >
52
+ <slot
53
+ name="left-footer"
54
+ />
55
+ <FSRow
56
+ class="fs-dialog-actions"
57
+ align="top-right"
58
+ :wrap="false"
59
+ >
60
+ <FSButton
61
+ :prependIcon="$props.leftButtonPrependIcon"
62
+ :label="cancelButtonLabel"
63
+ :appendIcon="$props.leftButtonAppendIcon"
64
+ :variant="$props.leftButtonVariant"
65
+ :color="$props.leftButtonColor"
66
+ @click="() => $emit('update:modelValue', false)"
67
+ />
68
+ <FSButton
69
+ type="submit"
70
+ :prependIcon="$props.rightButtonPrependIcon"
71
+ :label="submitButtonLabel"
72
+ :appendIcon="$props.rightButtonAppendIcon"
73
+ :variant="$props.rightButtonVariant"
74
+ :color="$props.rightButtonColor"
75
+ :load="$props.load"
76
+ :editable="$props.editable"
77
+ @click="onSubmit"
78
+ />
79
+ </FSRow>
80
+ </FSRow>
81
+ </FSCol>
82
+ </FSForm>
83
+ </template>
84
+ </FSDialog>
85
+ </template>
86
+
87
+ <script lang="ts">
88
+ import { computed, defineComponent, PropType, ref } from "vue";
89
+
90
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
91
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
92
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
93
+
94
+ import FSFadeOut from "./FSFadeOut.vue";
95
+ import FSButton from "./FSButton.vue";
96
+ import FSDialog from "./FSDialog.vue";
97
+ import FSForm from "./FSForm.vue";
98
+ import FSRow from "./FSRow.vue";
99
+
100
+ export default defineComponent({
101
+ name: "FSDialogForm",
102
+ components: {
103
+ FSFadeOut,
104
+ FSButton,
105
+ FSDialog,
106
+ FSForm,
107
+ FSRow
108
+ },
109
+ props: {
110
+ title: {
111
+ type: String as PropType<string | null>,
112
+ required: false,
113
+ default: null
114
+ },
115
+ subtitle: {
116
+ type: String as PropType<string | null>,
117
+ required: false,
118
+ default: null
119
+ },
120
+ width: {
121
+ type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
122
+ required: false,
123
+ default: "auto"
124
+ },
125
+ variant: {
126
+ type: String as PropType<"standard" | "lazy" | "submit">,
127
+ required: false,
128
+ default: "submit"
129
+ },
130
+ modelValue: {
131
+ type: Boolean,
132
+ required: false,
133
+ default: false
134
+ },
135
+ leftButtonPrependIcon: {
136
+ type: String as PropType<string | null>,
137
+ required: false,
138
+ default: null
139
+ },
140
+ leftButtonLabel: {
141
+ type: String as PropType<string | null>,
142
+ required: false,
143
+ default: null
144
+ },
145
+ leftButtonAppendIcon: {
146
+ type: String as PropType<string | null>,
147
+ required: false,
148
+ default: null
149
+ },
150
+ leftButtonVariant: {
151
+ type: String as PropType<"standard" | "full" | "icon">,
152
+ required: false,
153
+ default: "standard"
154
+ },
155
+ rightButtonPrependIcon: {
156
+ type: String as PropType<string | null>,
157
+ required: false,
158
+ default: null
159
+ },
160
+ rightButtonLabel: {
161
+ type: String as PropType<string | null>,
162
+ required: false,
163
+ default: null
164
+ },
165
+ rightButtonAppendIcon: {
166
+ type: String as PropType<string | null>,
167
+ required: false,
168
+ default: null
169
+ },
170
+ rightButtonVariant: {
171
+ type: String as PropType<"standard" | "full" | "icon">,
172
+ required: false,
173
+ default: "full"
174
+ },
175
+ leftButtonColor: {
176
+ type: String as PropType<ColorBase>,
177
+ required: false,
178
+ default: ColorEnum.Light
179
+ },
180
+ rightButtonColor: {
181
+ type: String as PropType<ColorBase>,
182
+ required: false,
183
+ default: ColorEnum.Primary
184
+ },
185
+ load: {
186
+ type: Boolean,
187
+ required: false,
188
+ default: false
189
+ },
190
+ editable: {
191
+ type: Boolean,
192
+ required: false,
193
+ default: true
194
+ }
195
+ },
196
+ emits: ["update:modelValue", "click:rightButton"],
197
+ setup(props, { emit }) {
198
+ const { isMobileSized } = useBreakpoints();
199
+ const { $tr } = useTranslationsProvider();
200
+
201
+ const valid = ref(false);
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
+
212
+ const cancelButtonLabel = computed(() => {
213
+ return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
214
+ });
215
+
216
+ const submitButtonLabel = computed(() => {
217
+ return props.rightButtonLabel ?? $tr("ui.button.validate", "Validate");
218
+ });
219
+
220
+ const onSubmit = () => {
221
+ if (valid.value) {
222
+ emit("click:rightButton");
223
+ }
224
+ };
225
+
226
+ return {
227
+ cancelButtonLabel,
228
+ submitButtonLabel,
229
+ ColorEnum,
230
+ height,
231
+ valid,
232
+ onSubmit
233
+ };
234
+ }
235
+ });
236
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <FSSubmitDialog
2
+ <FSDialogSubmit
3
3
  :rightButtonLabel="$tr('ui.button.remove', 'Remove')"
4
4
  :rightButtonColor="ColorEnum.Error"
5
5
  :title="title"
@@ -7,7 +7,9 @@
7
7
  @update:modelValue="$emit('update:modelValue', $event)"
8
8
  v-bind="$attrs"
9
9
  >
10
- <template #body>
10
+ <template
11
+ #body
12
+ >
11
13
  <FSCol
12
14
  gap="16px"
13
15
  >
@@ -35,7 +37,10 @@
35
37
  </FSSpan>
36
38
  </FSCol>
37
39
  </template>
38
- <template #footer v-if="$props.removing">
40
+ <template
41
+ #footer
42
+ v-if="$props.removing"
43
+ >
39
44
  <FSRow
40
45
  align="center-right"
41
46
  :height="footerHeight"
@@ -49,7 +54,7 @@
49
54
  />
50
55
  </FSRow>
51
56
  </template>
52
- </FSSubmitDialog>
57
+ </FSDialogSubmit>
53
58
  </template>
54
59
 
55
60
  <script lang="ts">
@@ -59,16 +64,16 @@ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui
59
64
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
60
65
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
61
66
 
62
- import FSSubmitDialog from "./FSSubmitDialog.vue";
67
+ import FSDialogSubmit from "./FSDialogSubmit.vue";
63
68
  import FSIcon from "./FSIcon.vue";
64
69
  import FSSpan from "./FSSpan.vue";
65
70
  import FSCol from "./FSCol.vue";
66
71
  import FSRow from "./FSRow.vue";
67
72
 
68
73
  export default defineComponent({
69
- name: "FSRemoveDialog",
74
+ name: "FSDialogRemove",
70
75
  components: {
71
- FSSubmitDialog,
76
+ FSDialogSubmit,
72
77
  FSIcon,
73
78
  FSSpan,
74
79
  FSCol,
@@ -102,10 +107,10 @@ export default defineComponent({
102
107
 
103
108
  const title = computed((): string => {
104
109
  if (props.removeTotal > 1) {
105
- return $tr("ui.remove-dialog.remove-plural", "Remove {0} entities", props.removeTotal.toString());
110
+ return $tr("ui.dialog-remove.remove-plural", "Remove {0} entities", props.removeTotal.toString());
106
111
  }
107
112
  else {
108
- return $tr("ui.remove-dialog.remove-singular", "Remove an entity");
113
+ return $tr("ui.dialog-remove.remove-singular", "Remove an entity");
109
114
  }
110
115
  });
111
116
 
@@ -1,50 +1,79 @@
1
1
  <template>
2
2
  <FSDialog
3
- cardClasses="fs-submit-dialog"
4
3
  :width="$props.width"
5
4
  :modelValue="$props.modelValue"
6
5
  @update:modelValue="$emit('update:modelValue', $event)"
7
6
  v-bind="$attrs"
8
7
  >
9
- <template #header>
10
- <slot name="header">
11
- <FSCol v-if="$props.title">
12
- <FSSpan font="text-h2">
8
+ <template
9
+ #header
10
+ >
11
+ <slot
12
+ name="header"
13
+ >
14
+ <FSCol
15
+ v-if="$props.title"
16
+ padding="0 16px 0 0"
17
+ >
18
+ <FSSpan
19
+ font="text-h2"
20
+ >
13
21
  {{ $props.title }}
14
22
  </FSSpan>
15
- <FSSpan v-if="$props.subtitle">
23
+ <FSSpan
24
+ v-if="$props.subtitle"
25
+ >
16
26
  {{ $props.subtitle }}
17
27
  </FSSpan>
18
28
  </FSCol>
19
29
  </slot>
20
30
  </template>
21
- <template #body>
22
- <slot name="body" />
31
+ <template
32
+ #body
33
+ >
34
+ <FSFadeOut
35
+ :height="height"
36
+ padding="0 8px 0 0"
37
+ >
38
+ <slot
39
+ name="body"
40
+ />
41
+ </FSFadeOut>
23
42
  </template>
24
- <template #footer>
25
- <slot name="footer">
43
+ <template
44
+ #footer
45
+ >
46
+ <slot
47
+ name="footer"
48
+ >
26
49
  <FSRow
27
- class="fs-submit-dialog-actions"
28
- align="top-right"
29
- :wrap="false"
50
+ padding="0 16px 0 0"
30
51
  >
31
- <FSButton
32
- :prependIcon="$props.leftButtonPrependIcon"
33
- :label="cancelButtonLabel"
34
- :appendIcon="$props.leftButtonAppendIcon"
35
- :variant="$props.leftButtonVariant"
36
- :color="$props.leftButtonColor"
37
- @click="() => $emit('update:modelValue', false)"
38
- />
39
- <FSButton
40
- :prependIcon="$props.rightButtonPrependIcon"
41
- :label="submitButtonLabel"
42
- :appendIcon="$props.rightButtonAppendIcon"
43
- :variant="$props.rightButtonVariant"
44
- :color="$props.rightButtonColor"
45
- :editable="$props.editable"
46
- @click="() => $emit('click:rightButton')"
52
+ <slot
53
+ name="left-footer"
47
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>
48
77
  </FSRow>
49
78
  </slot>
50
79
  </template>
@@ -56,13 +85,18 @@ import { computed, defineComponent, PropType } from "vue";
56
85
 
57
86
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
58
87
  import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
88
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
59
89
 
90
+ import FSFadeOut from "./FSFadeOut.vue";
91
+ import FSButton from "./FSButton.vue";
60
92
  import FSDialog from "./FSDialog.vue";
61
93
  import FSRow from "./FSRow.vue";
62
94
 
63
95
  export default defineComponent({
64
- name: "FSSubmitDialog",
96
+ name: "FSDialogSubmit",
65
97
  components: {
98
+ FSFadeOut,
99
+ FSButton,
66
100
  FSDialog,
67
101
  FSRow
68
102
  },
@@ -145,8 +179,19 @@ export default defineComponent({
145
179
  },
146
180
  emits: ["update:modelValue", "click:rightButton"],
147
181
  setup(props) {
182
+ const { isMobileSized } = useBreakpoints();
148
183
  const { $tr } = useTranslationsProvider();
149
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
+
150
195
  const cancelButtonLabel = computed(() => {
151
196
  return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
152
197
  });
@@ -156,9 +201,10 @@ export default defineComponent({
156
201
  });
157
202
 
158
203
  return {
159
- ColorEnum,
160
204
  cancelButtonLabel,
161
- submitButtonLabel
205
+ submitButtonLabel,
206
+ ColorEnum,
207
+ height
162
208
  };
163
209
  }
164
210
  });
@@ -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"],
@@ -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,