@dative-gpi/foundation-shared-components 1.0.180-fix-utils-composable → 1.0.180-sandbox-widget-connectivity

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.
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <FSRow
3
+ align="bottom-left"
4
+ :wrap="false"
5
+ gap="16px"
6
+ >
7
+ <FSRow
8
+ align="bottom-center"
9
+ >
10
+ <FSNumberField
11
+ :label="$tr('entity.widget.width', 'Width')"
12
+ :modelValue="widgetWidth"
13
+ @update:modelValue="$emit('update:widgetWidth', $event)"
14
+ />
15
+ <FSNumberField
16
+ :label="$tr('entity.widget.height', 'Height')"
17
+ :modelValue="widgetHeight"
18
+ @update:modelValue="$emit('update:widgetHeight', $event)"
19
+ />
20
+ <FSRow
21
+ width="hug"
22
+ >
23
+ <FSSwitch
24
+ class="dialog-configure-widget-hide-borders"
25
+ :label="$tr('entity.widget.hide-borders', 'Hide borders')"
26
+ :modelValue="hideBorders"
27
+ @update:modelValue="$emit('update:hideBorders', $event)"
28
+ />
29
+ </FSRow>
30
+ </FSRow>
31
+ </FSRow>
32
+ </template>
33
+
34
+ <script lang="ts">
35
+ import { defineComponent } from "vue";
36
+
37
+ import FSRow from "./FSRow.vue";
38
+ import FSNumberField from "./fields/FSNumberField.vue";
39
+ import FSSwitch from "./FSSwitch.vue";
40
+
41
+ export default defineComponent({
42
+ name: "WidgetStandardOptions",
43
+ components: {
44
+ FSRow,
45
+ FSNumberField,
46
+ FSSwitch
47
+ },
48
+ props: {
49
+ widgetWidth: {
50
+ type: Number,
51
+ required: true
52
+ },
53
+ widgetHeight: {
54
+ type: Number,
55
+ required: true
56
+ },
57
+ hideBorders: {
58
+ type: Boolean,
59
+ required: true
60
+ }
61
+ },
62
+ emits: ["update:widgetWidth", "update:widgetHeight", "update:hideBorders"]
63
+ });
64
+ </script>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <FSCard
3
+ height="100px"
4
+ width="100%"
5
+ >
6
+ <FSCol
7
+ align="center-center"
8
+ >
9
+ <FSIcon
10
+ v-if="icon"
11
+ size="32px"
12
+ >
13
+ {{icon }}
14
+ </FSIcon>
15
+ <FSText
16
+ font="text-overline"
17
+ >
18
+ {{ label }}
19
+ </FSText>
20
+ </FSCol>
21
+ </FSCard>
22
+ </template>
23
+
24
+ <script lang="ts">
25
+ import { defineComponent } from "vue";
26
+
27
+ import FSCard from "./FSCard.vue";
28
+ import FSCol from "./FSCol.vue";
29
+ import FSIcon from "./FSIcon.vue";
30
+ import FSText from "./FSText.vue";
31
+
32
+ export default defineComponent({
33
+ name: "FSWidgetTemplateCard",
34
+ components: {
35
+ FSCard,
36
+ FSCol,
37
+ FSIcon,
38
+ FSText
39
+ },
40
+ props: {
41
+ icon: {
42
+ type: String,
43
+ required: false
44
+ },
45
+ label: {
46
+ type: String,
47
+ required: true
48
+ }
49
+ }
50
+ });
51
+ </script>
@@ -5,7 +5,7 @@ export * from "./useBreakpoints";
5
5
  export * from "./useColors";
6
6
  export * from "./useCountUp";
7
7
  export * from "./useDebounce";
8
- export * from "./useElementVisibility"
8
+ export * from "./useElementVisibility";
9
9
  export * from "./useMapLayers";
10
10
  export * from "./useRules";
11
11
  export * from "./useSlots";
@@ -1,19 +1,30 @@
1
- import { ref, onMounted } from 'vue';
1
+ import { ref, onMounted, onBeforeUnmount } from 'vue';
2
+
3
+ const PREFERS_REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
2
4
 
3
5
  export function useAccessibilityPreferences() {
4
6
  const prefersReducedMotion = ref(false);
7
+ let mediaQuery: MediaQueryList | null = null;
8
+
9
+ const handleChange = (e: MediaQueryListEvent) => {
10
+ prefersReducedMotion.value = e.matches;
11
+ };
5
12
 
6
13
  onMounted(() => {
7
- prefersReducedMotion.value = window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches || false;
14
+ prefersReducedMotion.value = window.matchMedia?.(PREFERS_REDUCED_MOTION_QUERY)?.matches || false;
8
15
 
9
- const mediaQuery = window.matchMedia?.("(prefers-reduced-motion: reduce)");
16
+ mediaQuery = window.matchMedia?.(PREFERS_REDUCED_MOTION_QUERY) || null;
10
17
  if (mediaQuery?.addEventListener) {
11
- mediaQuery.addEventListener('change', (e) => {
12
- prefersReducedMotion.value = e.matches;
13
- });
18
+ mediaQuery.addEventListener('change', handleChange);
14
19
  }
15
20
  });
16
-
21
+
22
+ onBeforeUnmount(() => {
23
+ if (mediaQuery?.removeEventListener) {
24
+ mediaQuery.removeEventListener('change', handleChange);
25
+ }
26
+ });
27
+
17
28
  return {
18
29
  prefersReducedMotion
19
30
  };
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.180-fix-utils-composable",
4
+ "version": "1.0.180-sandbox-widget-connectivity",
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.180-fix-utils-composable",
14
- "@dative-gpi/foundation-shared-services": "1.0.180-fix-utils-composable"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.180-sandbox-widget-connectivity",
14
+ "@dative-gpi/foundation-shared-services": "1.0.180-sandbox-widget-connectivity"
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": "b8bbf51892bfcd61e7fdd2d89b4378203ab5cf6d"
38
+ "gitHead": "42243848637629e96d56ea83c0bcddc411a61ade"
39
39
  }