@dative-gpi/foundation-shared-components 0.0.28 → 0.0.30

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.
@@ -24,6 +24,11 @@ export default defineComponent({
24
24
  type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
25
25
  required: true
26
26
  },
27
+ width: {
28
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
29
+ required: false,
30
+ default: "100%"
31
+ },
27
32
  padding: {
28
33
  type: [String, Number],
29
34
  required: false,
@@ -46,6 +51,7 @@ export default defineComponent({
46
51
  const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
47
52
  return {
48
53
  "--fs-fade-out-height" : sizeToVar(props.height),
54
+ "--fs-fade-out-width" : sizeToVar(props.width),
49
55
  "--fs-fade-out-padding" : sizeToVar(props.padding),
50
56
  "--fs-fade-out-mask-color" : backgrounds.base,
51
57
  "--fs-fade-out-top-mask-height" : topMaskHeight.value,
@@ -9,7 +9,8 @@
9
9
  <script lang="ts">
10
10
  import { computed, defineComponent, PropType } from "vue";
11
11
 
12
- import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
12
+ import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
13
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
13
14
  import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
14
15
 
15
16
  export default defineComponent({
@@ -25,6 +26,11 @@ export default defineComponent({
25
26
  required: false,
26
27
  default: null
27
28
  },
29
+ padding: {
30
+ type: [String, Number],
31
+ required: false,
32
+ default: "0"
33
+ },
28
34
  borderRadius: {
29
35
  type: [String, Number],
30
36
  required: false,
@@ -38,29 +44,34 @@ export default defineComponent({
38
44
  },
39
45
  setup(props) {
40
46
  const { isMobileSized } = useBreakpoints();
47
+ const { getColors } = useColors();
48
+
49
+ const backgrounds = getColors(ColorEnum.Background);
41
50
 
42
51
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
43
52
  return {
44
- "--fs-loader-border-radius": ["chip"].includes(props.variant) ? "50px" : sizeToVar(props.borderRadius),
45
- "--fs-loader-height": sizeToVar(getHeight.value),
46
- "--fs-loader-width" : sizeToVar(getWidth.value)
53
+ "--fs-loader-background-color": backgrounds.base,
54
+ "--fs-loader-border-radius" : ["chip"].includes(props.variant) ? "50px" : sizeToVar(props.borderRadius),
55
+ "--fs-loader-padding" : sizeToVar(props.padding),
56
+ "--fs-loader-height" : sizeToVar(getHeight.value),
57
+ "--fs-loader-width" : sizeToVar(getWidth.value)
47
58
  };
48
59
  });
49
60
 
50
61
  const getHeight = computed((): string | number => {
51
62
  switch (props.variant) {
52
- case "standard": return sizeToVar(props.height);
53
- case "button":
54
- case "input":
55
- case "field": return isMobileSized.value ? "36px" : "40px";
56
- case "chip": return isMobileSized.value ? "20px" : "24px";
57
- case "text-h1": return isMobileSized.value ? "32px" : "40px";
58
- case "text-h2": return isMobileSized.value ? "24px" : "32px";
59
- case "text-h3": return isMobileSized.value ? "20px" : "24px";
60
- case "text-h4": return isMobileSized.value ? "16px" : "20px";
61
- case "text-body":
62
- case "text-button": return isMobileSized.value ? "14px" : "16px";
63
- case "text-overline":
63
+ case "standard" : return sizeToVar(props.height);
64
+ case "button" :
65
+ case "input" :
66
+ case "field" : return isMobileSized.value ? "36px" : "40px";
67
+ case "chip" : return isMobileSized.value ? "20px" : "24px";
68
+ case "text-h1" : return isMobileSized.value ? "32px" : "40px";
69
+ case "text-h2" : return isMobileSized.value ? "24px" : "32px";
70
+ case "text-h3" : return isMobileSized.value ? "20px" : "24px";
71
+ case "text-h4" : return isMobileSized.value ? "16px" : "20px";
72
+ case "text-body" :
73
+ case "text-button" : return isMobileSized.value ? "14px" : "16px";
74
+ case "text-overline" :
64
75
  case "text-underline": return "16px";
65
76
  }
66
77
  });
@@ -68,14 +79,14 @@ export default defineComponent({
68
79
  const getWidth = computed((): string | number => {
69
80
  switch (props.variant) {
70
81
  case "standard": return sizeToVar(props.width);
71
- case "button": return isMobileSized ? "36px" : "40px";
72
- case "input": return isMobileSized ? "calc(50% - 124px)" : "calc(50% - 132px)";
73
- case "field": return "100%";
74
- case "chip": return "8vw";
75
- case "text-h1": return "calc(50% - 32px)";
76
- case "text-h2": return "calc(60% - 32px)";
77
- case "text-h3": return "calc(65% - 32px)";
78
- default: return "calc(75% - 32px)";
82
+ case "button" : return isMobileSized ? "36px" : "40px";
83
+ case "input" : return isMobileSized ? "calc(50% - 124px)" : "calc(50% - 132px)";
84
+ case "field" : return "100%";
85
+ case "chip" : return "8vw";
86
+ case "text-h1" : return "calc(50% - 32px)";
87
+ case "text-h2" : return "calc(60% - 32px)";
88
+ case "text-h3" : return "calc(65% - 32px)";
89
+ default : return "calc(75% - 32px)";
79
90
  }
80
91
  });
81
92
 
@@ -43,7 +43,8 @@
43
43
  />
44
44
  <v-divider />
45
45
  <FSFadeOut
46
- class="fs-filter-button-fade"
46
+ padding="0 8px 0 0"
47
+ height="360px"
47
48
  >
48
49
  <FSCol>
49
50
  <FSChip
@@ -1,11 +1,13 @@
1
- import { computed, onMounted, onUnmounted, ref } from "vue";
1
+ import { computed, ref } from "vue";
2
2
 
3
3
  let initialized = false;
4
4
 
5
5
  export const useBreakpoints = () => {
6
+ const windowHeight = ref(window.innerHeight);
6
7
  const windowWidth = ref(window.innerWidth);
7
8
 
8
9
  const onSizeChange = (): void => {
10
+ windowHeight.value = window.innerHeight;
9
11
  windowWidth.value = window.innerWidth;
10
12
  };
11
13
 
@@ -29,6 +31,8 @@ export const useBreakpoints = () => {
29
31
  return {
30
32
  isTouchScreenEnabled,
31
33
  isMobileSized,
32
- isExtraSmall
34
+ isExtraSmall,
35
+ windowHeight,
36
+ windowWidth
33
37
  };
34
38
  }
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.28",
4
+ "version": "0.0.30",
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.28",
14
- "@dative-gpi/foundation-shared-services": "0.0.28",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.30",
14
+ "@dative-gpi/foundation-shared-services": "0.0.30",
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": "45b9e0404609c0003f918d847f47b5395152df2a"
35
+ "gitHead": "b308e8b5ecb53d5fbdd47048bf32f8f9eb59282e"
36
36
  }
@@ -1,8 +1,9 @@
1
1
  .fs-fade-out {
2
2
  @extend .fs-hide-y-scrollbar;
3
3
 
4
+ max-height: var(--fs-fade-out-height);
4
5
  padding: var(--fs-fade-out-padding);
5
- height: var(--fs-fade-out-height);
6
+ width: var(--fs-fade-out-width);
6
7
  flex-direction: column;
7
8
  position: relative;
8
9
  display: flex;
@@ -11,11 +11,6 @@
11
11
  width: calc(100% - 16px) !important;
12
12
  }
13
13
 
14
- .fs-filter-button-fade {
15
- padding-right: 8px;
16
- max-height: 360px;
17
- }
18
-
19
14
  .fs-filter-button-chip {
20
15
  width: 100%;
21
16
  }
@@ -1,4 +1,6 @@
1
1
  .fs-loader {
2
+ background-color: var(--fs-loader-background-color) !important;
3
+ padding: var(--fs-loader-padding);
2
4
  min-height: var(--fs-loader-height);
3
5
  height: var(--fs-loader-height);
4
6
  min-width: var(--fs-loader-width);