@dative-gpi/foundation-shared-components 0.0.114 → 0.0.116

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.
@@ -14,7 +14,7 @@
14
14
  :class="classes"
15
15
  :rows="$props.rows"
16
16
  :hideDetails="true"
17
- :noResize="!$props.resize"
17
+ :noResize="true"
18
18
  :autoGrow="$props.autoGrow"
19
19
  :readonly="!$props.editable"
20
20
  :clearable="$props.clearable && $props.editable && !!$props.modelValue"
@@ -37,13 +37,17 @@
37
37
  <template
38
38
  #clear
39
39
  >
40
- <FSButton
41
- v-if="$props.clearable && $props.editable && !!$props.modelValue"
42
- icon="mdi-close"
43
- variant="icon"
44
- :color="ColorEnum.Dark"
45
- @click="$emit('update:modelValue', null)"
46
- />
40
+ <FSCol
41
+ align="center-center"
42
+ >
43
+ <FSButton
44
+ v-if="$props.clearable && $props.editable && !!$props.modelValue"
45
+ icon="mdi-close"
46
+ variant="icon"
47
+ :color="ColorEnum.Dark"
48
+ @click="$emit('update:modelValue', null)"
49
+ />
50
+ </FSCol>
47
51
  </template>
48
52
  </v-textarea>
49
53
  </FSBaseField>
@@ -56,11 +60,13 @@ import { useColors, useBreakpoints, useRules } from "@dative-gpi/foundation-shar
56
60
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
57
61
 
58
62
  import FSBaseField from "./FSBaseField.vue";
63
+ import FSCol from "../FSCol.vue";
59
64
 
60
65
  export default defineComponent({
61
66
  name: "FSTextArea",
62
67
  components: {
63
- FSBaseField
68
+ FSBaseField,
69
+ FSCol
64
70
  },
65
71
  props: {
66
72
  label: {
@@ -83,11 +89,6 @@ export default defineComponent({
83
89
  required: false,
84
90
  default: 1
85
91
  },
86
- resize: {
87
- type: Boolean,
88
- required: false,
89
- default: false
90
- },
91
92
  autoGrow: {
92
93
  type: Boolean,
93
94
  required: false,
@@ -136,17 +137,17 @@ export default defineComponent({
136
137
 
137
138
  const style = computed((): { [key: string] : string | null | undefined } => {
138
139
  let height: string | undefined = undefined;
139
- let minHeight: string | undefined = undefined;
140
+ let fieldHeight: string | undefined = undefined;
140
141
  if (!props.autoGrow) {
141
- const base = isMobileSized.value ? 30 : 34;
142
- const row = isMobileSized.value ? 16 : 20;
143
- minHeight = `${base}px`;
142
+ const base = isMobileSized.value ? 34 : 38;
143
+ const row = isMobileSized.value ? 14 : 16;
144
144
  if (props.rows > 1) {
145
145
  height = `${base + (props.rows - 1) * row}px`;
146
146
  }
147
147
  else {
148
148
  height = `${base}px`;
149
149
  }
150
+ fieldHeight = `${props.rows * row}px`;
150
151
  }
151
152
  if (!props.editable) {
152
153
  return {
@@ -154,8 +155,8 @@ export default defineComponent({
154
155
  "--fs-text-area-border-color" : lights.base,
155
156
  "--fs-text-area-color" : lights.dark,
156
157
  "--fs-text-area-active-border-color": lights.base,
157
- "--fs-text-area-min-height" : minHeight,
158
- "--fs-text-area-height" : height
158
+ "--fs-text-area-height" : height,
159
+ "--fs-text-area-field-height" : fieldHeight
159
160
  };
160
161
  }
161
162
  return {
@@ -164,8 +165,8 @@ export default defineComponent({
164
165
  "--fs-text-area-color" : darks.base,
165
166
  "--fs-text-area-active-border-color": darks.dark,
166
167
  "--fs-text-area-error-border-color" : errors.base,
167
- "--fs-text-area-min-height" : minHeight,
168
- "--fs-text-area-height" : height
168
+ "--fs-text-area-height" : height,
169
+ "--fs-text-area-field-height" : fieldHeight
169
170
  };
170
171
  });
171
172
 
@@ -185,7 +186,7 @@ export default defineComponent({
185
186
  messages,
186
187
  blurred,
187
188
  classes,
188
- style,
189
+ style
189
190
  };
190
191
  }
191
192
  });
@@ -645,7 +645,8 @@ import { useRouter } from "vue-router";
645
645
  import { ColorEnum, FSDataTableColumn, FSDataTableFilter, FSDataTableOrder, FSToggle } from "@dative-gpi/foundation-shared-components/models";
646
646
  import { useBreakpoints, useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
647
647
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
648
- import { sizeToVar } from "../../utils";
648
+
649
+ import { alphanumericSort, sizeToVar } from "../../utils";
649
650
 
650
651
  import FSDataIteratorItem from "./FSDataIteratorItem.vue";
651
652
  import FSSearchField from "../fields/FSSearchField.vue";
@@ -944,19 +945,7 @@ export default defineComponent({
944
945
  }
945
946
  return {
946
947
  ...c,
947
- sort: (a: any, b: any): number =>{
948
- if (a === undefined && b === undefined) {
949
- return 0;
950
- }
951
- if (a === undefined) {
952
- return -1;
953
- }
954
- if (b === undefined) {
955
- return 1;
956
- }
957
- return JSON.stringify(a)
958
- .localeCompare(JSON.stringify(b), undefined, { numeric: true })
959
- }
948
+ sort: alphanumericSort
960
949
  };
961
950
  })
962
951
  });
@@ -1001,9 +990,9 @@ export default defineComponent({
1001
990
  });
1002
991
 
1003
992
  const groups = computed((): { [key: string]: any[] } => {
1004
- if (props.groupBy) {
993
+ if (props.groupBy && props.groupBy.key) {
1005
994
  return innerItems.value.reduce((acc, item) => {
1006
- const key = item[props.groupBy.key];
995
+ const key = item[props.groupBy.key!];
1007
996
  if (!acc[key]) {
1008
997
  acc[key] = [];
1009
998
  }
@@ -23,7 +23,7 @@ export const useAutocomplete = <TInfos>(
23
23
  const init = ref(true);
24
24
 
25
25
  const toggleSet = computed((): boolean => {
26
- return allowToggleSet && entitiesLength.value <= breakpointToggleSet;
26
+ return allowToggleSet && entitiesLength.value > 0 && entitiesLength.value <= breakpointToggleSet;
27
27
  });
28
28
 
29
29
  const debouncedFetch = () => debounce(() => customFetch(search.value), debounceInterval);
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.114",
4
+ "version": "0.0.116",
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.114",
14
- "@dative-gpi/foundation-shared-services": "0.0.114",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.116",
14
+ "@dative-gpi/foundation-shared-services": "0.0.116",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "10b5d9cd947ab4de3f652d69bee6e2ec4f6a3d37"
35
+ "gitHead": "256a9873798401b1de30bb4c1ee289c037c30997"
36
36
  }
@@ -18,19 +18,21 @@
18
18
  mask-image: none !important;
19
19
  -webkit-mask-image: none !important;
20
20
 
21
- margin: 2px 2px 2px 0 !important;
21
+ min-height: var(--fs-text-area-field-height) !important;
22
+ max-height: var(--fs-text-area-field-height) !important;
22
23
  cursor: var(--fs-text-area-cursor) !important;
23
- min-height: var(--fs-text-area-min-height);
24
- height: var(--fs-text-area-height);
25
24
  color: var(--fs-text-area-color);
25
+ padding: 0;
26
+ }
27
+
28
+ height: var(--fs-text-area-height);
26
29
 
27
- @include web {
28
- padding: 12px 0 12px 16px !important;
29
- }
30
-
31
- @include mobile {
32
- padding: 7px 0 7px 16px !important;
33
- }
30
+ @include web {
31
+ padding: 11px 16px !important;
32
+ }
33
+
34
+ @include mobile {
35
+ padding: 10px 16px !important;
34
36
  }
35
37
  }
36
38
  }
@@ -56,19 +58,17 @@
56
58
  mask-image: none !important;
57
59
  -webkit-mask-image: none !important;
58
60
 
59
- padding-inline: 0 !important;
60
- margin: 2px 2px 2px 0 !important;
61
61
  cursor: var(--fs-text-area-cursor) !important;
62
- height: var(--fs-text-area-height);
63
62
  color: var(--fs-text-area-color);
63
+ padding: 0;
64
+ }
64
65
 
65
- @include web {
66
- padding: 12px 0 12px 16px !important;
67
- }
68
-
69
- @include mobile {
70
- padding: 7px 0 7px 16px !important;
71
- }
66
+ @include web {
67
+ padding: 11px 16px !important;
68
+ }
69
+
70
+ @include mobile {
71
+ padding: 10px 16px !important;
72
72
  }
73
73
  }
74
74
  }
package/utils/sort.ts CHANGED
@@ -1,9 +1,18 @@
1
1
  export const alphanumericSort = (a: any, b: any) => {
2
- if (typeof(a) !== 'string') {
3
- a = JSON.stringify(a);
4
- }
5
- if (typeof(b) !== 'string') {
6
- b = JSON.stringify(b);
7
- }
8
- return a.localeCompare(b, undefined, { numeric: true });
2
+ if (a == null && b == null) {
3
+ return 0;
4
+ }
5
+ if (a == null) {
6
+ return -1;
7
+ }
8
+ if (b == null) {
9
+ return 1;
10
+ }
11
+ if (typeof(a) !== 'string') {
12
+ a = JSON.stringify(a);
13
+ }
14
+ if (typeof(b) !== 'string') {
15
+ b = JSON.stringify(b);
16
+ }
17
+ return a.localeCompare(b, undefined, { numeric: true });
9
18
  }