@dative-gpi/foundation-shared-components 1.0.79 → 1.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.
@@ -40,9 +40,10 @@
40
40
  </template>
41
41
 
42
42
  <script lang="ts">
43
- import { defineComponent } from "vue";
43
+ import { defineComponent, type PropType } from "vue";
44
44
 
45
45
  import { useTranslations } from "@dative-gpi/bones-ui";
46
+ import { Months } from '@dative-gpi/foundation-shared-domain/enums';
46
47
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
47
48
 
48
49
  import FSRow from "../FSRow.vue";
@@ -68,7 +69,7 @@ export default defineComponent({
68
69
  default: ColorEnum.Primary
69
70
  },
70
71
  month: {
71
- type: Number,
72
+ type: Number as PropType<Months>,
72
73
  required: true
73
74
  },
74
75
  year: {
@@ -82,30 +83,30 @@ export default defineComponent({
82
83
 
83
84
  const monthToString = (month: number) => {
84
85
  switch(month) {
85
- case 1:
86
- return $tr("ui.common.january", "January");
87
- case 2:
88
- return $tr("ui.common.february", "February");
89
- case 3:
90
- return $tr("ui.common.march", "March");
91
- case 4:
92
- return $tr("ui.common.april", "April");
93
- case 5:
94
- return $tr("ui.common.may", "May");
95
- case 6:
96
- return $tr("ui.common.june", "June");
97
- case 7:
98
- return $tr("ui.common.july", "July");
99
- case 8:
100
- return $tr("ui.common.august", "August");
101
- case 9:
102
- return $tr("ui.common.september", "September");
103
- case 10:
104
- return $tr("ui.common.october", "October");
105
- case 11:
106
- return $tr("ui.common.november", "November");
107
- case 12:
108
- return $tr("ui.common.december", "December");
86
+ case Months.January:
87
+ return $tr("ui.months.january", "January");
88
+ case Months.February:
89
+ return $tr("ui.months.february", "February");
90
+ case Months.March:
91
+ return $tr("ui.months.march", "March");
92
+ case Months.April:
93
+ return $tr("ui.months.april", "April");
94
+ case Months.May:
95
+ return $tr("ui.months.may", "May");
96
+ case Months.June:
97
+ return $tr("ui.months.june", "June");
98
+ case Months.July:
99
+ return $tr("ui.months.july", "July");
100
+ case Months.August:
101
+ return $tr("ui.months.august", "August");
102
+ case Months.September:
103
+ return $tr("ui.months.september", "September");
104
+ case Months.October:
105
+ return $tr("ui.months.october", "October");
106
+ case Months.November:
107
+ return $tr("ui.months.november", "November");
108
+ case Months.December:
109
+ return $tr("ui.months.december", "December");
109
110
  }
110
111
  }
111
112
 
@@ -15,6 +15,7 @@
15
15
  :modelValue="toShortTimeFormat"
16
16
  @click="onClick"
17
17
  @update:modelValue="onClear"
18
+ v-bind="$attrs"
18
19
  >
19
20
  <template
20
21
  #prepend-inner
@@ -68,6 +68,7 @@
68
68
  </template>
69
69
  <FSDateTimeRangeField
70
70
  v-else-if="innerDateSetting === DateSetting.Pick"
71
+ minWidth="180px"
71
72
  :rules="[DateRules.required()]"
72
73
  :editable="$props.editable"
73
74
  :hideHeader="true"
@@ -7,7 +7,7 @@
7
7
  >
8
8
  <FSRichTextField
9
9
  :editable="false"
10
- :label="$tr('ui.translateRichTextField.defaultValue', 'Default value')"
10
+ :label="$tr('ui.translate-rich-text-field.default-value', 'Default value')"
11
11
  :modelValue="$props.modelValue"
12
12
  v-bind="$attrs"
13
13
  />
@@ -30,7 +30,7 @@
30
30
  class="fs-translate-field-label"
31
31
  font="text-overline"
32
32
  >
33
- {{ $tr('ui.translateRichTextField.translateIn', 'Translate in {0}', language.label) }}
33
+ {{ $tr('ui.translate-rich-text-field.translate-in', 'Translate in {0}', language.label) }}
34
34
  </FSSpan>
35
35
  <FSIcon>{{ language.icon }}</FSIcon>
36
36
  </FSRow>
@@ -40,10 +40,9 @@
40
40
  <FSRow
41
41
  :wrap="false"
42
42
  >
43
- <FSButton
43
+ <FSButtonCancelLabel
44
44
  prependIcon="mdi-cancel"
45
45
  width="100%"
46
- :label="$tr('ui.translateRichTextField.cancelButton.label', 'Cancel')"
47
46
  @click="onCancelTranslations"
48
47
  />
49
48
  <FSButton
@@ -51,7 +50,7 @@
51
50
  prependIcon="mdi-check"
52
51
  color="primary"
53
52
  width="100%"
54
- :label="$tr('ui.translateRichTextField.validateButton.label', 'Validate translations')"
53
+ :label="$tr('ui.translate-rich-text-field.validate-button.label', 'Validate translations')"
55
54
  @click="onSubmitTranslations"
56
55
  />
57
56
  </FSRow>
@@ -70,7 +69,7 @@
70
69
  prependIcon="mdi-translate"
71
70
  color="primary"
72
71
  width="100%"
73
- :label="$tr('ui.translateRichTextField.translateButton.label', 'Manage translations')"
72
+ :label="$tr('ui.translate-rich-text-field.translate-button.label', 'Manage translations')"
74
73
  @click="() => $emit('update:translationsExpanded', true)"
75
74
  />
76
75
  </template>
@@ -84,6 +83,7 @@ import { useAppLanguages } from "@dative-gpi/foundation-shared-services/composab
84
83
 
85
84
  import { emptyLexicalState } from '../../utils';
86
85
 
86
+ import FSButtonCancelLabel from '../buttons/FSButtonCancelLabel.vue';
87
87
  import FSRichTextField from './FSRichTextField.vue';
88
88
  import FSButton from '../FSButton.vue';
89
89
  import FSIcon from '../FSIcon.vue';
@@ -94,6 +94,7 @@ import FSRow from '../FSRow.vue';
94
94
  export default defineComponent({
95
95
  name: 'FSTranslateRichTextField',
96
96
  components: {
97
+ FSButtonCancelLabel,
97
98
  FSRichTextField,
98
99
  FSButton,
99
100
  FSIcon,
@@ -832,7 +832,7 @@ export default defineComponent({
832
832
  mode: {
833
833
  type: String as PropType<"table" | "iterator">,
834
834
  required: false,
835
- default: "iterator"
835
+ default: "table"
836
836
  },
837
837
  disableTable: {
838
838
  type: Boolean,
@@ -894,7 +894,7 @@ export default defineComponent({
894
894
  const innerSearch: Ref<string | null> = ref(null);
895
895
  const innerRowsPerPage = ref(props.rowsPerPage);
896
896
  const innerSortBy = ref(props.sortBy);
897
- const innerMode = ref(props.mode);
897
+ const innerMode = ref(props.disableTable ? "iterator" : props.disableIterator ? "table" : props.mode);
898
898
  const innerPage = ref(props.page);
899
899
  const showFilters = ref(false);
900
900
  const resetable = ref(false);
@@ -11,86 +11,45 @@
11
11
  @update:modelValue="onSearch"
12
12
  />
13
13
  <FSFadeOut
14
+ v-if="$props.direction == 'column'"
14
15
  :maxHeight="$props.maxHeight"
15
16
  :maskHeight="0"
16
17
  >
17
- <component
18
- :is="$props.direction == 'row' ? FSRow : FSCol"
19
- >
20
- <template
21
- v-if="$props.loading"
22
- >
23
- <FSLoader
24
- v-for="i in 4"
25
- :key="i"
26
- :width="$props.direction == 'row' ? '220px' : '100%'"
27
- height="50px"
28
- />
29
- </template>
30
- <template
31
- v-else
32
- >
33
- <FSTile
34
- v-for="item in filteredItems"
35
- :key="item.id"
36
- v-bind="tileProps(item)"
37
- :width="$props.direction == 'row' ? 'fit-content' : '100%'"
38
- height="fit-content"
39
- :editable="false"
40
- >
41
- <slot
42
- name="item"
43
- :item="item"
44
- >
45
- <FSRow
46
- align="center-left"
47
- height="24px"
48
- :wrap="false"
49
- >
50
- <FSButtonDragIcon
51
- v-if="showDraggable"
52
- />
53
- <slot
54
- name="itemContent"
55
- :item="item"
56
- >
57
- <!-- TODO : add draggable option -->
58
- <FSImage
59
- v-if="item.imageId"
60
- :imageId="item.imageId"
61
- width="24px"
62
- height="24px"
63
- />
64
- <FSIcon
65
- size="24px"
66
- v-else-if="item.icon"
67
- :icon="item.icon"
68
- />
69
- <FSSpan
70
- font="text-overline"
71
- >
72
- {{ item[$props.itemLabel || 'label'] }}
73
- </FSSpan>
74
- </slot>
75
- <FSRow
76
- align="center-right"
77
- :wrap="false"
78
- >
79
- <FSButtonEditIcon
80
- v-if="showEdit"
81
- @click="$emit('click:edit', item.id)"
82
- />
83
- <FSButtonRemoveIcon
84
- v-if="showRemove"
85
- @click="$emit('click:remove', item.id)"
86
- />
87
- </FSRow>
88
- </FSRow>
89
- </slot>
90
- </FSTile>
91
- </template>
92
- </component>
18
+ <FSCol>
19
+ <FSSimpleListItem
20
+ loaderWidth="100%"
21
+ tileWidth="100%"
22
+ :filteredItems="filteredItems"
23
+ @click:edit="$emit('click:edit', $event)"
24
+ @click:remove="$emit('click:remove', $event)"
25
+ v-bind="$props"
26
+ />
27
+ </FSCol>
93
28
  </FSFadeOut>
29
+ <FSRow
30
+ v-else-if="$props.direction == 'row'"
31
+ >
32
+ <FSSimpleListItem
33
+ loaderWidth="220px"
34
+ tileWidth="fit-content"
35
+ :filteredItems="filteredItems"
36
+ @click:edit="$emit('click:edit', $event)"
37
+ @click:remove="$emit('click:remove', $event)"
38
+ v-bind="$props"
39
+ />
40
+ </FSRow>
41
+ <FSSlideGroup
42
+ v-else
43
+ >
44
+ <FSSimpleListItem
45
+ loaderWidth="220px"
46
+ tileWidth="fit-content"
47
+ :filteredItems="filteredItems"
48
+ @click:edit="$emit('click:edit', $event)"
49
+ @click:remove="$emit('click:remove', $event)"
50
+ v-bind="$props"
51
+ />
52
+ </FSSlideGroup>
94
53
  </FSCol>
95
54
  </template>
96
55
 
@@ -104,32 +63,20 @@ import { filterItems } from "../../utils";
104
63
 
105
64
  import FSRow from "../FSRow.vue";
106
65
  import FSCol from "../FSCol.vue";
107
- import FSIcon from "../FSIcon.vue";
108
- import FSSpan from "../FSSpan.vue";
109
- import FSImage from "../FSImage.vue";
110
- import FSLoader from "../FSLoader.vue";
111
- import FSTile from "../tiles/FSTile.vue";
112
66
  import FSFadeOut from "../FSFadeOut.vue";
67
+ import FSSlideGroup from "../FSSlideGroup.vue"
113
68
  import FSSearchField from "../fields/FSSearchField.vue";
114
- import FSButtonEditIcon from "../buttons/FSButtonEditIcon.vue";
115
- import FSButtonDragIcon from "../buttons/FSButtonDragIcon.vue";
116
- import FSButtonRemoveIcon from "../buttons/FSButtonRemoveIcon.vue";
69
+ import FSSimpleListItem from "./FSSimpleListItem.vue";
117
70
 
118
71
  export default defineComponent({
119
72
  name: "FSSimpleList",
120
73
  components: {
121
74
  FSRow,
122
75
  FSCol,
123
- FSTile,
124
- FSIcon,
125
- FSSpan,
126
- FSImage,
127
- FSLoader,
128
76
  FSFadeOut,
77
+ FSSlideGroup,
129
78
  FSSearchField,
130
- FSButtonEditIcon,
131
- FSButtonDragIcon,
132
- FSButtonRemoveIcon,
79
+ FSSimpleListItem
133
80
  },
134
81
  props: {
135
82
  items: {
@@ -177,7 +124,7 @@ export default defineComponent({
177
124
  default: undefined
178
125
  },
179
126
  direction: {
180
- type: String as PropType<"row" | "column">,
127
+ type: String as PropType<"row" | "column" | "slided">,
181
128
  required: false,
182
129
  default: "column"
183
130
  },
@@ -219,8 +166,6 @@ export default defineComponent({
219
166
  filteredItems,
220
167
  ColorEnum,
221
168
  onSearch,
222
- FSRow,
223
- FSCol,
224
169
  }
225
170
  }
226
171
  });
@@ -0,0 +1,161 @@
1
+ <template>
2
+ <template
3
+ v-if="$props.loading"
4
+ >
5
+ <FSLoader
6
+ v-for="i in 4"
7
+ :key="i"
8
+ :width="loaderWidth"
9
+ height="50px"
10
+ />
11
+ </template>
12
+ <template
13
+ v-else
14
+ >
15
+ <FSTile
16
+ v-for="item in filteredItems"
17
+ :key="item.id"
18
+ v-bind="tileProps(item)"
19
+ :width="tileWidth"
20
+ height="fit-content"
21
+ :editable="false"
22
+ >
23
+ <slot
24
+ name="item"
25
+ :item="item"
26
+ >
27
+ <FSRow
28
+ align="center-left"
29
+ height="24px"
30
+ :wrap="false"
31
+ >
32
+ <FSButtonDragIcon
33
+ v-if="showDraggable"
34
+ />
35
+ <slot
36
+ name="itemContent"
37
+ :item="item"
38
+ >
39
+ <!-- TODO : add draggable option -->
40
+ <FSImage
41
+ v-if="item.imageId"
42
+ :imageId="item.imageId"
43
+ width="24px"
44
+ height="24px"
45
+ />
46
+ <FSIcon
47
+ size="24px"
48
+ v-else-if="item.icon"
49
+ :icon="item.icon"
50
+ />
51
+ <FSSpan
52
+ font="text-overline"
53
+ >
54
+ {{ item[$props.itemLabel || 'label'] }}
55
+ </FSSpan>
56
+ </slot>
57
+ <FSRow
58
+ align="center-right"
59
+ :wrap="false"
60
+ >
61
+ <FSButtonEditIcon
62
+ v-if="showEdit"
63
+ @click="$emit('click:edit', item.id)"
64
+ />
65
+ <FSButtonRemoveIcon
66
+ v-if="showRemove"
67
+ @click="$emit('click:remove', item.id)"
68
+ />
69
+ </FSRow>
70
+ </FSRow>
71
+ </slot>
72
+ </FSTile>
73
+ </template>
74
+ </template>
75
+
76
+
77
+ <script lang="ts">
78
+ import { defineComponent, type PropType } from "vue";
79
+
80
+ import FSRow from "../FSRow.vue";
81
+ import FSIcon from "../FSIcon.vue";
82
+ import FSSpan from "../FSSpan.vue";
83
+ import FSImage from "../FSImage.vue";
84
+ import FSLoader from "../FSLoader.vue";
85
+ import FSTile from "../tiles/FSTile.vue";
86
+ import FSButtonEditIcon from "../buttons/FSButtonEditIcon.vue";
87
+ import FSButtonDragIcon from "../buttons/FSButtonDragIcon.vue";
88
+ import FSButtonRemoveIcon from "../buttons/FSButtonRemoveIcon.vue";
89
+
90
+ export default defineComponent({
91
+ name: "FSSimpleListItem",
92
+ components: {
93
+ FSRow,
94
+ FSTile,
95
+ FSIcon,
96
+ FSSpan,
97
+ FSImage,
98
+ FSLoader,
99
+ FSButtonEditIcon,
100
+ FSButtonDragIcon,
101
+ FSButtonRemoveIcon,
102
+ },
103
+ props: {
104
+ filteredItems: {
105
+ type: Array as PropType<{id: string, label?: string, icon?: string, imageId?: string, [index: string]: any}[]>,
106
+ required: true
107
+ },
108
+ tileProps: {
109
+ type: Function as PropType<(item: any) => Record<string, any>>,
110
+ required: false,
111
+ default: () => () => ({})
112
+ },
113
+ showEdit: {
114
+ type: Boolean,
115
+ required: false,
116
+ default: true
117
+ },
118
+ showRemove: {
119
+ type: Boolean,
120
+ required: false,
121
+ default: true
122
+ },
123
+ showDraggable: {
124
+ type: Boolean,
125
+ required: false,
126
+ default: false
127
+ },
128
+ search: {
129
+ type: String,
130
+ required: false,
131
+ default: ""
132
+ },
133
+ noFilter: {
134
+ type: Boolean,
135
+ required: false,
136
+ default: false
137
+ },
138
+ itemLabel: {
139
+ type: String,
140
+ required: false,
141
+ default: "label"
142
+ },
143
+ loaderWidth:{
144
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null | undefined>,
145
+ required: false,
146
+ default: undefined
147
+ },
148
+ tileWidth:{
149
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null | undefined>,
150
+ required: false,
151
+ default: undefined
152
+ },
153
+ loading: {
154
+ type: Boolean,
155
+ required: false,
156
+ default: false
157
+ }
158
+ },
159
+ emits: ["click:edit", "click:remove"]
160
+ });
161
+ </script>
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <FSClickable
3
3
  padding="16px"
4
- height="124px"
5
- width="275px"
4
+ :width="['275px','336px']"
5
+ :height="['124px','156px']"
6
6
  v-bind="$attrs"
7
7
  >
8
8
  <template
@@ -62,7 +62,7 @@
62
62
  <FSSpan
63
63
  font="text-overline"
64
64
  >
65
- {{ $tr("ui.group-tile.group(s)", "Group(s)") }}
65
+ {{ $tr("ui.group-tile.groups", "Group(s)") }}
66
66
  </FSSpan>
67
67
  </FSRow>
68
68
  <FSRow
@@ -87,7 +87,7 @@
87
87
  <FSSpan
88
88
  font="text-overline"
89
89
  >
90
- {{ $tr("ui.group-tile.device(s)", "Device(s)") }}
90
+ {{ $tr("ui.group-tile.devices", "Device(s)") }}
91
91
  </FSSpan>
92
92
  </FSRow>
93
93
  </FSCol>
package/models/tables.ts CHANGED
@@ -37,7 +37,7 @@ export interface FSDataTableOrder {
37
37
  export interface FSDataTable {
38
38
  headers: FSDataTableColumn[];
39
39
  sortBy: FSDataTableOrder | null;
40
- mode: "table" | "iterator";
40
+ mode: "table" | "iterator" | null;
41
41
  rowsPerPage: -1 | 10 | 30;
42
42
  filters: { [key: string]: FSDataTableFilter[] };
43
43
  page: number;
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.79",
4
+ "version": "1.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": "1.0.79",
14
- "@dative-gpi/foundation-shared-services": "1.0.79"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.81",
14
+ "@dative-gpi/foundation-shared-services": "1.0.81"
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": "2886eb5a54f6c71aab410a871de2fcbabd394e92"
38
+ "gitHead": "6cac3b3d9a0036419fad35a4745381ee28d0429c"
39
39
  }