@dative-gpi/foundation-shared-components 1.0.56 → 1.0.57

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,60 +1,69 @@
1
1
  <template>
2
- <FSWindow
3
- width="100%"
4
- :modelValue="currentStep - 1"
2
+ <FSCol
3
+ gap="24px"
5
4
  >
6
- <FSForm
7
- v-for="(step, index) in $props.steps"
8
- :variant="$props.variant"
9
- :key="index"
10
- @submit="onSubmit"
11
- v-model="valid"
5
+ <FSPagination
6
+ width="calc(100% - 16px)"
7
+ :pages="$props.steps"
8
+ :modelValue="currentStep - 1"
9
+ />
10
+ <FSWindow
11
+ width="100%"
12
+ :modelValue="currentStep - 1"
12
13
  >
13
- <FSCol
14
- gap="24px"
14
+ <FSForm
15
+ v-for="(step, index) in $props.steps"
16
+ :variant="$props.variant"
17
+ :key="index"
18
+ @submit="onSubmit"
19
+ v-model="valid"
15
20
  >
16
- <FSFadeOut
17
- padding="0 8px 0 0"
18
- :maxHeight="maxHeight"
21
+ <FSCol
22
+ gap="24px"
19
23
  >
20
- <slot
21
- :name="`step-${step}`"
22
- />
23
- </FSFadeOut>
24
- <FSRow
25
- padding="0 16px 0 0"
26
- >
27
- <slot
28
- name="left-footer"
29
- />
30
- <FSRow
31
- class="fs-dialog-actions"
32
- align="top-right"
33
- :wrap="false"
24
+ <FSFadeOut
25
+ padding="0 8px 0 0"
26
+ :maxHeight="maxHeight"
34
27
  >
35
- <FSButton
36
- :prependIcon="$props.cancelButtonPrependIcon"
37
- :appendIcon="$props.cancelButtonAppendIcon"
38
- :variant="$props.cancelButtonVariant"
39
- :color="$props.cancelButtonColor"
40
- :label="previousButtonLabel"
41
- @click="onPrevious()"
28
+ <slot
29
+ :name="`step-${step}`"
42
30
  />
43
- <FSButton
44
- type="submit"
45
- :prependIcon="$props.submitButtonPrependIcon"
46
- :appendIcon="$props.submitButtonAppendIcon"
47
- :color="$props.submitButtonColor"
48
- :variant="nextButtonVariant"
49
- :editable="$props.editable"
50
- :label="nextButtonLabel"
51
- :load="$props.load"
31
+ </FSFadeOut>
32
+ <FSRow
33
+ padding="0 16px 0 0"
34
+ >
35
+ <slot
36
+ name="left-footer"
52
37
  />
38
+ <FSRow
39
+ class="fs-dialog-actions"
40
+ align="top-right"
41
+ :wrap="false"
42
+ >
43
+ <FSButton
44
+ :prependIcon="$props.cancelButtonPrependIcon"
45
+ :appendIcon="$props.cancelButtonAppendIcon"
46
+ :variant="$props.cancelButtonVariant"
47
+ :color="$props.cancelButtonColor"
48
+ :label="previousButtonLabel"
49
+ @click="onPrevious()"
50
+ />
51
+ <FSButton
52
+ type="submit"
53
+ :prependIcon="$props.submitButtonPrependIcon"
54
+ :appendIcon="$props.submitButtonAppendIcon"
55
+ :color="$props.submitButtonColor"
56
+ :variant="nextButtonVariant"
57
+ :editable="$props.editable"
58
+ :label="nextButtonLabel"
59
+ :load="$props.load"
60
+ />
61
+ </FSRow>
53
62
  </FSRow>
54
- </FSRow>
55
- </FSCol>
56
- </FSForm>
57
- </FSWindow>
63
+ </FSCol>
64
+ </FSForm>
65
+ </FSWindow>
66
+ </FSCol>
58
67
  </template>
59
68
 
60
69
  <script lang="ts">
@@ -64,17 +73,21 @@ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui
64
73
  import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
65
74
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
66
75
 
76
+ import FSPagination from "./FSPagination.vue";
67
77
  import FSFadeOut from "./FSFadeOut.vue";
68
78
  import FSButton from "./FSButton.vue";
69
79
  import FSForm from "./FSForm.vue";
80
+ import FSCol from "./FSCol.vue";
70
81
  import FSRow from "./FSRow.vue";
71
82
 
72
83
  export default defineComponent({
73
84
  name: "FSDialogMultiFormBody",
74
85
  components: {
86
+ FSPagination,
75
87
  FSFadeOut,
76
88
  FSButton,
77
89
  FSForm,
90
+ FSCol,
78
91
  FSRow
79
92
  },
80
93
  props: {
@@ -1,13 +1,14 @@
1
1
  <template>
2
2
  <FSCol
3
+ v-if="$props.start && $props.end"
3
4
  :height="$props.height"
4
5
  :width="$props.width"
5
6
  gap="24px"
6
7
  >
7
8
  <FSAgendaHeader
8
9
  :mode="$props.mode!"
9
- :start="start"
10
- :end="end"
10
+ :start="$props.start"
11
+ :end="$props.end"
11
12
  :now="now"
12
13
  @update:start="($event) => $emit('update:start', $event)"
13
14
  @update:end="($event) => $emit('update:end', $event)"
@@ -28,8 +29,8 @@
28
29
  :value="AgendaMode.Day"
29
30
  :events="$props.events"
30
31
  :firstColumnWidth="dayColumnWidth"
31
- :start="start"
32
- :end="end"
32
+ :start="$props.start"
33
+ :end="$props.end"
33
34
  :now="now"
34
35
  :nowIsInSelectedRange="nowIsInSelectedRange"
35
36
  :loading="$props.loading"
@@ -44,8 +45,8 @@
44
45
  :value="AgendaMode.Week"
45
46
  :events="$props.events"
46
47
  :firstColumnWidth="dayColumnWidth"
47
- :start="start"
48
- :end="end"
48
+ :start="$props.start"
49
+ :end="$props.end"
49
50
  :now="now"
50
51
  :nowIsInSelectedRange="nowIsInSelectedRange"
51
52
  :loading="$props.loading"
@@ -60,8 +61,8 @@
60
61
  :value="AgendaMode.Month"
61
62
  :events="$props.events"
62
63
  :firstColumnWidth="dayColumnWidth"
63
- :start="start"
64
- :end="end"
64
+ :start="$props.start"
65
+ :end="$props.end"
65
66
  :now="now"
66
67
  :nowIsInSelectedRange="nowIsInSelectedRange"
67
68
  :loading="$props.loading"
@@ -78,7 +79,7 @@
78
79
  </template>
79
80
 
80
81
  <script lang="ts">
81
- import { defineComponent, type PropType, computed, ref, onUnmounted, watch } from 'vue';
82
+ import { defineComponent, type PropType, computed, ref, onUnmounted, watch, onMounted } from 'vue';
82
83
 
83
84
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
84
85
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
@@ -150,41 +151,36 @@ export default defineComponent({
150
151
  const now = ref(todayToEpoch());
151
152
  const defaultMode = ref(props.mode);
152
153
 
153
- const start = computed<number>(() => {
154
- if (props.start) {
155
- return props.start;
156
- }
157
- if (props.mode === AgendaMode.Week) {
158
- return epochToLocalDayStart(now.value - (new Date(now.value).getDay() - 1) * 24 * 60 * 60 * 1000);
159
- }
160
- if (props.mode === AgendaMode.Month) {
161
- return epochToLocalDayStart(new Date(now.value).setDate(1));
154
+ const nowIsInSelectedRange = computed(() => {
155
+ if (!props.start || !props.end) {
156
+ return false;
162
157
  }
163
- return epochToLocalDayStart(now.value);
158
+ return now.value >= props.start && now.value <= props.end;
164
159
  });
165
160
 
166
- const end = computed<number>(() => {
167
- if (props.end) {
168
- return props.end;
161
+ const nowInterval = setInterval(() => {
162
+ now.value = todayToEpoch();
163
+ }, 10000);
164
+
165
+ onMounted(() => {
166
+ if(props.end && props.start) {
167
+ return;
169
168
  }
170
169
  if (props.mode === AgendaMode.Week) {
171
- return epochToLocalDayEnd(now.value + (7 - new Date(now.value).getDay()) * 24 * 60 * 60 * 1000);
170
+ emit("update:start", epochToLocalDayStart(now.value - (new Date(now.value).getDay() - 1) * 24 * 60 * 60 * 1000));
171
+ emit("update:end", epochToLocalDayEnd(now.value + (7 - new Date(now.value).getDay()) * 24 * 60 * 60 * 1000));
172
+ return;
172
173
  }
173
174
  if (props.mode === AgendaMode.Month) {
174
175
  const lastDayOfMonth = new Date(new Date(now.value).getFullYear(), new Date(now.value).getMonth() + 1, 0);
175
- return epochToLocalDayEnd(lastDayOfMonth.getTime());
176
+ emit("update:start", epochToLocalDayStart(new Date(now.value).setDate(1)));
177
+ emit("update:end", lastDayOfMonth.getTime());
178
+ return;
176
179
  }
177
- return epochToLocalDayEnd(now.value);
180
+ emit("update:start", epochToLocalDayStart(now.value));
181
+ emit("update:end", epochToLocalDayEnd(now.value));
178
182
  });
179
183
 
180
- const nowIsInSelectedRange = computed(() => {
181
- return now.value >= start.value && now.value <= end.value;
182
- });
183
-
184
- const nowInterval = setInterval(() => {
185
- now.value = todayToEpoch();
186
- }, 10000);
187
-
188
184
  onUnmounted(() => {
189
185
  clearInterval(nowInterval);
190
186
  });
@@ -195,13 +191,11 @@ export default defineComponent({
195
191
  } else if (!value && defaultMode.value !== AgendaMode.Day) {
196
192
  emit('update:mode', defaultMode.value);
197
193
  }
198
- }, {immediate: true});
194
+ });
199
195
 
200
196
  return {
201
197
  AgendaMode,
202
- start,
203
198
  dayColumnWidth,
204
- end,
205
199
  now,
206
200
  nowIsInSelectedRange
207
201
  };
@@ -3,12 +3,6 @@
3
3
  v-bind="$props"
4
4
  gap="12px"
5
5
  >
6
- <FSText
7
- v-if="$props.label"
8
- font="text-button"
9
- >
10
- {{ $props.label }}
11
- </FSText>
12
6
  <FSSearchField
13
7
  v-if="$props.searchable"
14
8
  padding="0 12px 0 0"
@@ -45,8 +39,6 @@
45
39
  :width="$props.direction == 'row' ? 'fit-content' : '100%'"
46
40
  height="fit-content"
47
41
  :editable="false"
48
- :singleSelect="$props.clickable"
49
- @update:modelValue="$emit('click:item', item.id)"
50
42
  >
51
43
  <slot
52
44
  name="item"
@@ -108,7 +100,6 @@ import { filterItems } from "../../utils";
108
100
 
109
101
  import FSRow from "../FSRow.vue";
110
102
  import FSCol from "../FSCol.vue";
111
- import FSText from "../FSText.vue";
112
103
  import FSIcon from "../FSIcon.vue";
113
104
  import FSSpan from "../FSSpan.vue";
114
105
  import FSImage from "../FSImage.vue";
@@ -125,7 +116,6 @@ export default defineComponent({
125
116
  components: {
126
117
  FSRow,
127
118
  FSCol,
128
- FSText,
129
119
  FSTile,
130
120
  FSIcon,
131
121
  FSSpan,
@@ -138,10 +128,6 @@ export default defineComponent({
138
128
  FSButtonRemoveIcon,
139
129
  },
140
130
  props: {
141
- label: {
142
- type: String,
143
- required: false
144
- },
145
131
  items: {
146
132
  type: Array as PropType<{id: string, label?: string, icon?: string, imageId?: string, [index: string]: any}[]>,
147
133
  required: true
@@ -166,11 +152,6 @@ export default defineComponent({
166
152
  required: false,
167
153
  default: false
168
154
  },
169
- clickable: {
170
- type: Boolean,
171
- required: false,
172
- default: false
173
- },
174
155
  searchable: {
175
156
  type: Boolean,
176
157
  required: false,
@@ -207,7 +188,7 @@ export default defineComponent({
207
188
  default: false
208
189
  }
209
190
  },
210
- emits: ["click:edit", "click:remove", "click:item", "update:search"],
191
+ emits: ["click:edit", "click:remove", "update:search"],
211
192
  setup(props, { emit }) {
212
193
  const actualSearch = ref<string | null>(props.search);
213
194
  const filteredItems = computed(() => {
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.56",
4
+ "version": "1.0.57",
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.56",
14
- "@dative-gpi/foundation-shared-services": "1.0.56"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.57",
14
+ "@dative-gpi/foundation-shared-services": "1.0.57"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "c77d95e9a7724fa4a39d94b0b2bd0fa9d4fbdefc"
38
+ "gitHead": "4445a164fed7501246674432eba3e8227c8bc827"
39
39
  }
@@ -1,6 +1,7 @@
1
1
  .fs-tabs {
2
2
  display: flex !important;
3
3
  width: 100% !important;
4
+ flex-shrink: 0;
4
5
 
5
6
  @include web {
6
7
  height: 48px !important;