@dative-gpi/foundation-shared-components 0.0.206 → 0.0.208

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.
@@ -3,6 +3,7 @@
3
3
  :bottomColor="ColorEnum.Primary"
4
4
  :editable="$props.editable"
5
5
  :modelValue="$props.modelValue"
6
+ :width="$props.width"
6
7
  v-bind="$attrs"
7
8
  >
8
9
  <FSCol
@@ -17,10 +18,10 @@
17
18
  >
18
19
  <FSCol
19
20
  gap="12px"
21
+ :width="`calc(100% - ${imageSize}px - 24px)`"
20
22
  >
21
23
  <FSCol
22
24
  gap="6px"
23
- :width="infoWidth"
24
25
  >
25
26
  <FSText
26
27
  font="text-button"
@@ -141,7 +142,12 @@ export default defineComponent({
141
142
  type: Boolean,
142
143
  required: false,
143
144
  default: true
144
- }
145
+ },
146
+ width: {
147
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
148
+ required: false,
149
+ default: () => [352, 336]
150
+ },
145
151
  },
146
152
  setup(props) {
147
153
  const { isMobileSized } = useBreakpoints();
@@ -190,13 +196,6 @@ export default defineComponent({
190
196
  return isMobileSized.value ? 90 : 100;
191
197
  });
192
198
 
193
- const infoWidth = computed((): number => {
194
- let width = isMobileSized.value ? 288 : 304;
195
- if (props.imageId) {
196
- width -= imageSize.value;
197
- }
198
- return width;
199
- });
200
199
 
201
200
  return {
202
201
  carouselDeviceStatuses,
@@ -205,7 +204,6 @@ export default defineComponent({
205
204
  singleModelStatuses,
206
205
  ColorEnum,
207
206
  imageSize,
208
- infoWidth
209
207
  };
210
208
  }
211
209
  });
@@ -3,6 +3,7 @@
3
3
  :bottomColor="ColorEnum.Error"
4
4
  :editable="$props.editable"
5
5
  :modelValue="$props.modelValue"
6
+ :width="$props.width"
6
7
  v-bind="$attrs"
7
8
  >
8
9
  <FSCol
@@ -17,10 +18,10 @@
17
18
  >
18
19
  <FSCol
19
20
  gap="12px"
21
+ :width="`calc(100% - ${imageSize}px - 24px)`"
20
22
  >
21
23
  <FSCol
22
24
  gap="6px"
23
- :width="infoWidth"
24
25
  >
25
26
  <FSText
26
27
  font="text-button"
@@ -158,7 +159,12 @@ export default defineComponent({
158
159
  type: Boolean,
159
160
  required: false,
160
161
  default: true
161
- }
162
+ },
163
+ width: {
164
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
165
+ required: false,
166
+ default: () => [352, 336]
167
+ },
162
168
  },
163
169
  setup(props) {
164
170
  const { isMobileSized } = useBreakpoints();
@@ -175,20 +181,11 @@ export default defineComponent({
175
181
  return isMobileSized.value ? 90 : 100;
176
182
  });
177
183
 
178
- const infoWidth = computed((): number => {
179
- let width = isMobileSized.value ? 288 : 304;
180
- if (props.imageId) {
181
- width -= imageSize.value;
182
- }
183
- return width;
184
- });
185
-
186
184
  return {
187
185
  ColorEnum,
188
186
  groupsLabel,
189
187
  deviceOrganisationsLabel,
190
- imageSize,
191
- infoWidth
188
+ imageSize
192
189
  };
193
190
  }
194
191
  });
@@ -3,6 +3,7 @@
3
3
  :bottomColor="$props.bottomColor"
4
4
  :editable="$props.editable"
5
5
  :modelValue="$props.modelValue"
6
+ :width="$props.width"
6
7
  v-bind="$attrs"
7
8
  >
8
9
  <FSCol
@@ -17,6 +18,7 @@
17
18
  >
18
19
  <FSCol
19
20
  gap="6px"
21
+ :width="`calc(100% - ${imageSize}px - 24px)`"
20
22
  >
21
23
  <FSText
22
24
  font="text-button"
@@ -113,7 +115,12 @@ export default defineComponent({
113
115
  type: Boolean,
114
116
  required: false,
115
117
  default: true
116
- }
118
+ },
119
+ width: {
120
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
121
+ required: false,
122
+ default: () => [352, 336]
123
+ },
117
124
  },
118
125
  setup(props) {
119
126
  const { isMobileSized } = useBreakpoints();
@@ -126,19 +133,10 @@ export default defineComponent({
126
133
  return isMobileSized.value ? 90 : 100;
127
134
  });
128
135
 
129
- const infoWidth = computed((): number => {
130
- let width = isMobileSized.value ? 288 : 304;
131
- if (props.icon) {
132
- width -= imageSize.value;
133
- }
134
- return width;
135
- });
136
-
137
136
  return {
138
137
  iconBackgroundColor,
139
138
  ColorEnum,
140
- imageSize,
141
- infoWidth
139
+ imageSize
142
140
  };
143
141
  }
144
142
  });
@@ -5,7 +5,6 @@
5
5
  class="fs-tile"
6
6
  padding="12px"
7
7
  :height="height"
8
- :width="width"
9
8
  :style="style"
10
9
  :href="$props.href"
11
10
  :to="$props.to"
@@ -33,7 +32,6 @@
33
32
  class="fs-tile"
34
33
  padding="12px"
35
34
  :style="style"
36
- :width="width"
37
35
  :height="height"
38
36
  v-bind="$attrs"
39
37
  >
@@ -118,17 +116,12 @@ export default defineComponent({
118
116
  return {};
119
117
  });
120
118
 
121
- const width = computed(() => {
122
- return isMobileSized.value ? 336 : 352;
123
- });
124
-
125
119
  const height = computed(() => {
126
120
  return isMobileSized.value ? 156 : 170;
127
121
  });
128
122
 
129
123
  return {
130
124
  height,
131
- width,
132
125
  style
133
126
  };
134
127
  }
package/models/map.ts CHANGED
@@ -5,6 +5,7 @@ import { type Address } from "@dative-gpi/foundation-shared-domain/models";
5
5
  export interface MapLayer {
6
6
  name : string;
7
7
  label: string;
8
+ image: string;
8
9
  layer: Layer;
9
10
  }
10
11
 
@@ -13,4 +14,5 @@ export interface FSLocation {
13
14
  label: string;
14
15
  icon: string;
15
16
  address: Address;
17
+ color: string;
16
18
  }
@@ -0,0 +1,5 @@
1
+ export interface RichTextVariable {
2
+ code: string;
3
+ defaultValue: string;
4
+ typeName: string;
5
+ }
@@ -0,0 +1,105 @@
1
+ import { type LexicalNode, DecoratorNode, type SerializedLexicalNode, type Spread, type EditorConfig, type LexicalEditor } from "lexical";
2
+ import type { RichTextVariable } from "./richTextVariable";
3
+
4
+ export type SerializedVariableNode = Spread<
5
+ {
6
+ type: "variable";
7
+ code: string;
8
+ defaultValue: string;
9
+ typeName: string;
10
+ },
11
+ SerializedLexicalNode
12
+ >;
13
+
14
+ export class VariableNode extends DecoratorNode<Element> {
15
+ __code: string;
16
+ __defaultValue: string;
17
+ __typeName: string;
18
+ readonlyMode: boolean;
19
+
20
+ static getType() {
21
+ return "variable";
22
+ }
23
+
24
+ static clone(node: VariableNode) {
25
+ return new VariableNode(node.__code, node.__defaultValue, node.__typeName, node.__key);
26
+ }
27
+
28
+ constructor(code: string, defaultValue: string, typeName: string, key?: string) {
29
+ super(key);
30
+ this.__code = code;
31
+ this.__defaultValue = defaultValue;
32
+ this.__typeName = typeName;
33
+ this.readonlyMode = false;
34
+ }
35
+
36
+ getValue(editorElement: HTMLElement): any {
37
+ const variableValues = editorElement.dataset.variableValues;
38
+ if (!variableValues) { return this.__defaultValue; }
39
+ const values = JSON.parse(variableValues);
40
+ return values[this.__code] ?? this.__defaultValue;
41
+ }
42
+
43
+ createDOM(_config: EditorConfig, _editor: LexicalEditor) {
44
+ const readonlyMode = _editor._rootElement?.dataset.readonly === "true" || false;
45
+
46
+ const container = document.createElement("span");
47
+ container.classList.add("fs-richtextfield-node-variable");
48
+
49
+ const content = document.createElement("span");
50
+ if (readonlyMode) {
51
+ content.classList.add("fs-rich-text-field-node-variable-value");
52
+ if (_editor._rootElement) {
53
+ content.textContent = this.getValue(_editor._rootElement);
54
+ } else {
55
+ content.textContent = this.__defaultValue;
56
+ }
57
+ } else {
58
+ content.classList.add("fs-rich-text-field-node-variable-code");
59
+ content.textContent = `{${this.__code}}`
60
+ }
61
+ container.appendChild(content);
62
+ return container;
63
+ }
64
+
65
+ updateDOM(): boolean {
66
+ return false;
67
+ }
68
+
69
+ exportJSON(): SerializedVariableNode {
70
+ return {
71
+ type: "variable",
72
+ version: 1,
73
+ code: this.__code,
74
+ defaultValue: this.__defaultValue,
75
+ typeName: this.__typeName,
76
+ };
77
+ }
78
+
79
+ decorate(editor: LexicalEditor, config: EditorConfig): Element {
80
+ return this.createDOM(config, editor);
81
+ }
82
+
83
+ static importJSON(serializedNode: SerializedVariableNode): VariableNode {
84
+ return new VariableNode(
85
+ serializedNode.code,
86
+ serializedNode.defaultValue,
87
+ serializedNode.typeName
88
+ );
89
+ }
90
+ }
91
+
92
+ export function $createVariableNode(code: string, defaultValue: string, typeName: string): VariableNode {
93
+ return new VariableNode(code, defaultValue, typeName);
94
+ }
95
+
96
+ export function $modifyVariableNode(node: VariableNode, newValue: RichTextVariable): VariableNode {
97
+ node.__code = newValue.code;
98
+ node.__defaultValue = newValue.defaultValue;
99
+ node.__typeName = newValue.typeName;
100
+ return node;
101
+ }
102
+
103
+ export function $isVariableNode(node: LexicalNode | null | undefined): node is VariableNode {
104
+ return node instanceof VariableNode;
105
+ }
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.206",
4
+ "version": "0.0.208",
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.206",
14
- "@dative-gpi/foundation-shared-services": "0.0.206"
13
+ "@dative-gpi/foundation-shared-domain": "0.0.208",
14
+ "@dative-gpi/foundation-shared-services": "0.0.208"
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": "7ef1a1b0b6a291c09cb136bd597e4f1837415e71"
38
+ "gitHead": "0b82703929b6f4f0992f85ea0d6f1674e0ad0082"
39
39
  }
@@ -0,0 +1,18 @@
1
+ .fs-image-card {
2
+ > .fs-card {
3
+ background-image: var(--fs-image-card-background);
4
+ background-size: 100%;
5
+ background-position: center;
6
+ }
7
+
8
+ .fs-image-card-label {
9
+ background-color: #0000009d;
10
+ color: white;
11
+ }
12
+ }
13
+
14
+ .fs-image-card:hover {
15
+ > .fs-card {
16
+ background-size: 105%;
17
+ }
18
+ }
@@ -9,21 +9,12 @@
9
9
  filter: grayscale(var(--fs-map-container-grayscale));
10
10
  }
11
11
 
12
- .fs-map-overlay-layer-choice {
12
+ .fs-map-overlay-left {
13
13
  position: absolute;
14
14
  top: 0;
15
15
  left: 0;
16
16
  z-index: 950;
17
- margin: 8px;
18
-
19
- >* {
20
- opacity: 0.7;
21
- transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
22
- }
23
-
24
- >*:hover {
25
- opacity: 1;
26
- }
17
+ margin: 4px;
27
18
  }
28
19
 
29
20
  .fs-map-overlay-edit-button {
@@ -34,10 +25,17 @@
34
25
  margin: 8px;
35
26
  }
36
27
 
37
- .fs-map-overlay-container {
28
+ .fs-map-overlay-right-top {
29
+ position: absolute;
30
+ top: 0;
31
+ right: 0;
32
+ margin: 4px 8px;
33
+ }
34
+
35
+ .fs-map-overlay-right-bottom {
38
36
  position: absolute;
39
37
  bottom: 0;
40
- left: 0;
38
+ right: 0;
41
39
  z-index: 1000;
42
40
  margin: 4px 8px;
43
41
  width: calc(100% - 16px);
@@ -61,14 +59,11 @@
61
59
  border-top-right-radius: 0 !important;
62
60
 
63
61
  border-top: solid 1px var(--fs-card-border-color) !important;
64
-
65
-
66
62
  }
67
63
  }
68
64
  }
69
65
 
70
66
  .fs-map-mylocation {
71
- background-color: var(--fs-map-location-pin-color);
72
67
  border: 3px solid white;
73
68
  border-radius: 100%;
74
69
  animation: fs-map-shadow 1.4s linear infinite;
@@ -88,8 +83,9 @@
88
83
  }
89
84
  }
90
85
 
91
- .fs-map-location {
86
+ .fs-map-location > div {
92
87
  display: flex;
88
+ height: 100%;
93
89
  color: var(--fs-map-location-pin-color);
94
90
  border-radius: 50%;
95
91
  background-color: white;
@@ -97,19 +93,6 @@
97
93
  align-items: center;
98
94
  justify-content: center;
99
95
 
100
- &.fs-map-location-full {
101
- background-color: var(--fs-map-location-pin-color);
102
- color: white;
103
- }
104
-
105
- >* {
106
- transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
107
- }
108
-
109
- .mdi-loading {
110
- animation: spin 1s linear infinite;
111
- }
112
-
113
96
  &:hover {
114
97
  filter: brightness(0.92) drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.4));
115
98
 
@@ -118,32 +101,27 @@
118
101
  transform: scale(1.15);
119
102
  }
120
103
  }
104
+ }
105
+
106
+ .fs-map-location-full > div {
107
+ background-color: var(--fs-map-location-pin-color);
108
+ color: white;
109
+ }
121
110
 
122
- @keyframes spin {
111
+ .fs-map-location-selected > div {
112
+ animation: fs-map-shadow 1.4s linear infinite;
113
+
114
+ @keyframes fs-map-shadow {
123
115
  0% {
124
- transform: rotate(0deg);
116
+ box-shadow: 0 0 0px 0px var(--fs-map-mylocation-pin-color-alpha);
125
117
  }
126
118
 
127
- 100% {
128
- transform: rotate(360deg);
119
+ 50% {
120
+ box-shadow: 0 0 0px 7px var(--fs-map-mylocation-pin-color-alpha);
129
121
  }
130
- }
131
122
 
132
- &.fs-map-location-selected {
133
- animation: fs-map-shadow 1.4s linear infinite;
134
-
135
- @keyframes fs-map-shadow {
136
- 0% {
137
- box-shadow: 0 0 0px 0px var(--fs-map-mylocation-pin-color-alpha);
138
- }
139
-
140
- 50% {
141
- box-shadow: 0 0 0px 7px var(--fs-map-mylocation-pin-color-alpha);
142
- }
143
-
144
- 100% {
145
- box-shadow: 0 0 0px 20px transparent;
146
- }
123
+ 100% {
124
+ box-shadow: 0 0 0px 20px transparent;
147
125
  }
148
126
  }
149
127
  }
@@ -1,19 +1,31 @@
1
1
  .fs-rich-text-field {
2
2
  width: 100%;
3
3
  min-width: 120px;
4
- outline: none !important;
5
4
  border: 1px solid var(--fs-rich-text-field-border-color) !important;
6
5
  border-radius: 4px !important;
7
6
 
8
- min-height: var(--fs-rich-text-field-min-height);
9
- color: var(--fs-rich-text-field-color);
7
+
10
8
  margin: 2px 2px 2px 0 !important;
11
9
 
10
+ .fs-rich-text-field-content {
11
+ color: var(--fs-rich-text-field-color);
12
+ width: 100%;
13
+ min-height: var(--fs-rich-text-field-min-height);
14
+ outline: none !important;
15
+ }
16
+
17
+ .fs-richtextfield-node-variable {
18
+ .fs-rich-text-field-node-variable-code {
19
+ background-color: var(--fs-rich-text-field-variable-backgroundcolor);
20
+ color: var(--fs-rich-text-field-variable-color);
21
+ border-radius: 4px;
22
+ }
23
+ }
12
24
 
13
25
  &:focus-within {
14
26
  border-color: var(--fs-rich-text-field-active-border-color) !important;
15
27
  }
16
-
28
+
17
29
  @include web {
18
30
  padding: 10px 12px !important;
19
31
  }
@@ -31,6 +31,7 @@
31
31
  @import "fs_icon_field.scss";
32
32
  @import "fs_icon.scss";
33
33
  @import "fs_image.scss";
34
+ @import "fs_image_card.scss";
34
35
  @import "fs_label.scss";
35
36
  @import "fs_link.scss";
36
37
  @import "fs_load_data_table.scss";
package/utils/lexical.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type { ElementNode, LexicalNode, RangeSelection, TextNode } from "lexical";
2
2
  import { $isAtNodeEnd } from "@lexical/selection";
3
3
 
4
+ export const emptyLexicalState = "{\"root\":{\"children\":[{\"children\":[],\"direction\":null,\"format\":\"\",\"indent\":0,\"type\":\"paragraph\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}";
5
+
4
6
  export const getSelectedNode = (selection: RangeSelection): ElementNode | TextNode => {
5
7
  const anchor = selection.anchor;
6
8
  const focus = selection.focus;