@dative-gpi/foundation-shared-components 0.0.72 → 0.0.74

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.
@@ -84,6 +84,11 @@ export default defineComponent({
84
84
  required: false,
85
85
  default: "4px"
86
86
  },
87
+ borderStyle: {
88
+ type: String as PropType<"solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "inset" | "outset" | "none">,
89
+ required: false,
90
+ default: "solid"
91
+ },
87
92
  elevation: {
88
93
  type: Boolean,
89
94
  required: false,
@@ -108,6 +113,7 @@ export default defineComponent({
108
113
  switch (props.variant) {
109
114
  case "standard": return {
110
115
  "--fs-card-border-size" : props.border ? "1px" : "0",
116
+ "--fs-card-border-style" : props.borderStyle,
111
117
  "--fs-card-border-radius" : sizeToVar(props.borderRadius),
112
118
  "--fs-card-padding" : sizeToVar(props.padding),
113
119
  "--fs-card-height" : sizeToVar(props.height),
@@ -118,6 +124,7 @@ export default defineComponent({
118
124
  }
119
125
  case "background": return {
120
126
  "--fs-card-border-size" : props.border ? "1px" : "0",
127
+ "--fs-card-border-style" : props.borderStyle,
121
128
  "--fs-card-border-radius" : sizeToVar(props.borderRadius),
122
129
  "--fs-card-padding" : sizeToVar(props.padding),
123
130
  "--fs-card-height" : sizeToVar(props.height),
@@ -128,6 +135,7 @@ export default defineComponent({
128
135
  }
129
136
  case "gradient": return {
130
137
  "--fs-card-border-size" : props.border ? "1px" : "0",
138
+ "--fs-card-border-style" : props.borderStyle,
131
139
  "--fs-card-border-radius" : sizeToVar(props.borderRadius),
132
140
  "--fs-card-padding" : sizeToVar(props.padding),
133
141
  "--fs-card-height" : sizeToVar(props.height),
@@ -8,7 +8,7 @@
8
8
  :rules="$props.rules"
9
9
  :validateOn="validateOn"
10
10
  :modelValue="$props.modelValue"
11
- @click.prevent
11
+ @click.prevent.stop="onToggle"
12
12
  @blur="blurred = true"
13
13
  v-bind="$attrs"
14
14
  >
@@ -17,7 +17,6 @@
17
17
  align="center-left"
18
18
  width="hug"
19
19
  :style="style"
20
- @click.stop="onToggle"
21
20
  >
22
21
  <FSIcon
23
22
  class="fs-checkbox"
@@ -136,7 +136,7 @@ export default defineComponent({
136
136
  type: {
137
137
  type: String as PropType<"button" | "submit">,
138
138
  required: false,
139
- default: "submit"
139
+ default: "button"
140
140
  },
141
141
  color: {
142
142
  type: String as PropType<ColorBase>,
@@ -153,6 +153,11 @@ export default defineComponent({
153
153
  required: false,
154
154
  default: "4px"
155
155
  },
156
+ borderStyle: {
157
+ type: String as PropType<"solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "inset" | "outset" | "none">,
158
+ required: false,
159
+ default: "solid"
160
+ },
156
161
  load: {
157
162
  type: Boolean,
158
163
  required: false,
@@ -180,6 +185,7 @@ export default defineComponent({
180
185
  if (!props.editable) {
181
186
  return {
182
187
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
188
+ "--fs-clickable-border-style" : props.borderStyle,
183
189
  "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
184
190
  "--fs-clickable-background-color": lights.light,
185
191
  "--fs-clickable-border-color" : lights.dark,
@@ -191,6 +197,7 @@ export default defineComponent({
191
197
  switch (props.variant) {
192
198
  case "standard": return {
193
199
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
200
+ "--fs-clickable-border-style" : props.borderStyle,
194
201
  "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
195
202
  "--fs-clickable-background-color" : colors.value.light,
196
203
  "--fs-clickable-border-color" : colors.value.lightContrast,
@@ -206,6 +213,7 @@ export default defineComponent({
206
213
  };
207
214
  case "background": return {
208
215
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
216
+ "--fs-clickable-border-style" : props.borderStyle,
209
217
  "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
210
218
  "--fs-clickable-background-color" : backgrounds.base,
211
219
  "--fs-clickable-border-color" : lights.dark,
@@ -221,6 +229,7 @@ export default defineComponent({
221
229
  };
222
230
  case "full": return {
223
231
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
232
+ "--fs-clickable-border-style" : props.borderStyle,
224
233
  "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
225
234
  "--fs-clickable-background-color" : colors.value.base,
226
235
  "--fs-clickable-border-color" : colors.value.base,
@@ -1,21 +1,16 @@
1
1
  <template>
2
2
  <FSRow
3
- width="fill"
4
3
  gap="24px"
5
4
  >
6
- <FSCard
5
+ <FSImage
7
6
  class="fs-edit-image"
8
- :borderRadius="$props.borderRadius"
9
- :padding="$props.padding"
10
- >
11
- <FSImage
12
- :borderRadius="$props.borderRadius"
13
- :aspectRatio="$props.aspectRatio"
14
- :height="$props.height"
15
- :imageB64="realSource"
16
- :width="$props.width"
17
- />
18
- </FSCard>
7
+ :aspectRatio="$props.aspectRatio"
8
+ :imageId="$props.imageId"
9
+ :height="$props.height"
10
+ :imageB64="realSource"
11
+ :width="$props.width"
12
+ :style="style"
13
+ />
19
14
  <FSCol
20
15
  height="fill"
21
16
  align="bottom-left"
@@ -43,14 +38,16 @@
43
38
  <script lang="ts">
44
39
  import { computed, defineComponent, PropType, ref } from "vue";
45
40
 
41
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
46
42
  import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
47
- import { FileImage } from "@dative-gpi/foundation-shared-components/models";
43
+ import { ColorEnum, FileImage } from "@dative-gpi/foundation-shared-components/models";
48
44
 
49
45
  import FSButtonRemoveIcon from "./buttons/FSButtonRemoveIcon.vue";
50
46
  import FSButtonFileIcon from "./buttons/FSButtonFileIcon.vue";
51
47
  import FSImage from "./FSImage.vue";
52
- import FSCard from "./FSCard.vue";
53
48
  import FSText from "./FSText.vue";
49
+ import FSCol from "./FSCol.vue";
50
+ import FSRow from "./FSRow.vue";
54
51
 
55
52
  export default defineComponent({
56
53
  name: "FSEditImage",
@@ -58,8 +55,9 @@ export default defineComponent({
58
55
  FSButtonRemoveIcon,
59
56
  FSButtonFileIcon,
60
57
  FSImage,
61
- FSCard,
62
- FSText
58
+ FSText,
59
+ FSCol,
60
+ FSRow
63
61
  },
64
62
  props: {
65
63
  height: {
@@ -72,12 +70,7 @@ export default defineComponent({
72
70
  required: false,
73
71
  default: null
74
72
  },
75
- padding: {
76
- type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
77
- required: false,
78
- default: "8px"
79
- },
80
- modelValue: {
73
+ imageId: {
81
74
  type: String as PropType<string | null>,
82
75
  required: false,
83
76
  default: null
@@ -87,18 +80,27 @@ export default defineComponent({
87
80
  required: false,
88
81
  default: null
89
82
  },
90
- borderRadius: {
91
- type: [String, Number],
83
+ modelValue: {
84
+ type: String as PropType<string | null>,
92
85
  required: false,
93
- default: "4px"
86
+ default: null
94
87
  }
95
88
  },
96
89
  emits: ["update:modelValue"],
97
90
  setup(props, { emit }) {
91
+ const { getColors } = useColors();
98
92
  const { readFile } = useFiles();
99
93
 
94
+ const lights = getColors(ColorEnum.Light);
95
+
100
96
  const fileSelected = ref<FileImage>({ fileName: "", fileContent: null });
101
97
 
98
+ const style = computed((): { [key: string] : string | undefined } => {
99
+ return {
100
+ "--fs-edit-image-border-color": lights.dark
101
+ };
102
+ });
103
+
102
104
  const realSource = computed(() => {
103
105
  if (fileSelected.value && fileSelected.value.fileName) {
104
106
  return fileSelected.value.fileContent as string;
@@ -122,6 +124,7 @@ export default defineComponent({
122
124
  return {
123
125
  fileSelected,
124
126
  realSource,
127
+ style,
125
128
  onUpload,
126
129
  onRemove
127
130
  };
@@ -145,14 +145,14 @@ export default defineComponent({
145
145
  });
146
146
 
147
147
  const source = computed((): string | undefined => {
148
- if (props.imageId) {
149
- return IMAGE_RAW_URL(props.imageId);
150
- }
151
- else if (props.imageB64) {
148
+ if (props.imageB64) {
152
149
  if (imageType.value && imageData.value) {
153
150
  return `${imageType.value},${imageData.value}`;
154
151
  }
155
152
  }
153
+ else if (props.imageId) {
154
+ return IMAGE_RAW_URL(props.imageId);
155
+ }
156
156
  });
157
157
 
158
158
  const imageData = computed((): string | null => {
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSClickable
3
3
  v-if="$props.href || $props.to || $attrs.onClick"
4
+ variant="background"
4
5
  class="fs-tile"
5
6
  padding="12px"
6
7
  :height="height"
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.72",
4
+ "version": "0.0.74",
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.72",
14
- "@dative-gpi/foundation-shared-services": "0.0.72",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.74",
14
+ "@dative-gpi/foundation-shared-services": "0.0.74",
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": "dbc4787e4b28439c3d9284f6e430daab222cd671"
35
+ "gitHead": "f52cb04f253d357a3cbb09881718d2cdea09917d"
36
36
  }
@@ -1,6 +1,7 @@
1
1
  .fs-card {
2
+ border: var(--fs-card-border-size) var(--fs-card-border-style);
3
+ transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
2
4
  border-radius: var(--fs-card-border-radius);
3
- border: var(--fs-card-border-size) solid;
4
5
  padding: var(--fs-card-padding);
5
6
  height: var(--fs-card-height);
6
7
  width: var(--fs-card-width);
@@ -1,6 +1,6 @@
1
1
  .fs-clickable {
2
+ border: var(--fs-clickable-border-size) var(--fs-clickable-border-style) !important;
2
3
  border-radius: var(--fs-clickable-border-radius) !important;
3
- border: var(--fs-clickable-border-size) solid !important;
4
4
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
5
5
  cursor: pointer;
6
6
 
@@ -8,6 +8,12 @@
8
8
  border-color: var(--fs-clickable-border-color) !important;
9
9
  color: var(--fs-clickable-color) !important;
10
10
 
11
+ & .fs-card {
12
+ background-color: var(--fs-clickable-background-color) !important;
13
+ border-color: var(--fs-clickable-border-color) !important;
14
+ color: var(--fs-clickable-color) !important;
15
+ }
16
+
11
17
  &.fs-clickable-disabled {
12
18
  cursor: default;
13
19
  }
@@ -16,12 +22,24 @@
16
22
  background-color: var(--fs-clickable-hover-background-color) !important;
17
23
  border-color: var(--fs-clickable-hover-border-color) !important;
18
24
  color: var(--fs-clickable-hover-color) !important;
25
+
26
+ & .fs-card {
27
+ background-color: var(--fs-clickable-hover-background-color) !important;
28
+ border-color: var(--fs-clickable-hover-border-color) !important;
29
+ color: var(--fs-clickable-hover-color) !important;
30
+ }
19
31
  }
20
32
 
21
33
  &:not(.fs-clickable-disabled):active {
22
34
  background-color: var(--fs-clickable-active-background-color) !important;
23
35
  border-color: var(--fs-clickable-active-border-color) !important;
24
36
  color: var(--fs-clickable-active-color) !important;
37
+
38
+ & .fs-card {
39
+ background-color: var(--fs-clickable-active-background-color) !important;
40
+ border-color: var(--fs-clickable-active-border-color) !important;
41
+ color: var(--fs-clickable-active-color) !important;
42
+ }
25
43
  }
26
44
  }
27
45
 
@@ -1,3 +1,3 @@
1
1
  .fs-edit-image {
2
- border-style: dashed;
2
+ border: 1px dashed var(--fs-edit-image-border-color);
3
3
  }