@tekkare/auriga 0.2.140 → 0.2.141

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,62 @@
1
+ <template>
2
+ <path
3
+ :class="
4
+ hoveredRegion && hoveredRegion !== currentRegion && data.value
5
+ ? 'hovered'
6
+ : 'hover'
7
+ "
8
+ :id="`interactiveMap-${title}-${currentRegion}`"
9
+ :d="regionsPathNz[currentRegion]?.path"
10
+ :fill="data.color"
11
+ :stroke="data.color"
12
+ stroke-width="1"
13
+ @mouseover="onMouseOver"
14
+ @mouseleave="onMouseLeave"
15
+ />
16
+ </template>
17
+
18
+ <script>
19
+ import regionsPathNz from "./maps/regionsPathNz.json";
20
+ import { defineComponent } from "vue";
21
+ export default defineComponent({
22
+ name: "oneRegionNz",
23
+ props: {
24
+ data: {
25
+ type: Object,
26
+ default: () => {
27
+ }
28
+ },
29
+ hoveredRegion: {
30
+ type: [String, null],
31
+ required: false,
32
+ default: null
33
+ },
34
+ title: {
35
+ type: [String, null],
36
+ required: true
37
+ },
38
+ currentRegion: {
39
+ type: String,
40
+ required: true
41
+ }
42
+ },
43
+ emits: ["hover", "mouseleave"],
44
+ setup(props, { emit }) {
45
+ function onMouseOver() {
46
+ emit("hover");
47
+ }
48
+ function onMouseLeave() {
49
+ emit("mouseleave");
50
+ }
51
+ return {
52
+ regionsPathNz,
53
+ onMouseOver,
54
+ onMouseLeave
55
+ };
56
+ }
57
+ });
58
+ </script>
59
+
60
+ <style scoped>
61
+ .hovered{opacity:.5;transition:all .2s ease-in-out}.hover{cursor:pointer}
62
+ </style>
@@ -0,0 +1,54 @@
1
+ import { RegionsNz } from "./maps/interfaces";
2
+ import type { PropType } from "vue";
3
+ type CurrentData = {
4
+ color?: string;
5
+ value?: number;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ data: {
9
+ type: PropType<CurrentData>;
10
+ default: () => void;
11
+ };
12
+ hoveredRegion: {
13
+ type: PropType<RegionsNz | null>;
14
+ required: false;
15
+ default: null;
16
+ };
17
+ title: {
18
+ type: PropType<string | null>;
19
+ required: true;
20
+ };
21
+ currentRegion: {
22
+ type: PropType<RegionsNz>;
23
+ required: true;
24
+ };
25
+ }>, {
26
+ regionsPathNz: any;
27
+ onMouseOver: () => void;
28
+ onMouseLeave: () => void;
29
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mouseleave" | "hover")[], "mouseleave" | "hover", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ data: {
31
+ type: PropType<CurrentData>;
32
+ default: () => void;
33
+ };
34
+ hoveredRegion: {
35
+ type: PropType<RegionsNz | null>;
36
+ required: false;
37
+ default: null;
38
+ };
39
+ title: {
40
+ type: PropType<string | null>;
41
+ required: true;
42
+ };
43
+ currentRegion: {
44
+ type: PropType<RegionsNz>;
45
+ required: true;
46
+ };
47
+ }>> & Readonly<{
48
+ onMouseleave?: ((...args: any[]) => any) | undefined;
49
+ onHover?: ((...args: any[]) => any) | undefined;
50
+ }>, {
51
+ data: CurrentData;
52
+ hoveredRegion: RegionsNz | null;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
+ export default _default;
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <path
3
+ :class="
4
+ hoveredRegion && hoveredRegion !== currentRegion && data.value
5
+ ? 'hovered'
6
+ : 'hover'
7
+ "
8
+ :id="`interactiveMap-${title}-${currentRegion}`"
9
+ :d="regionsPathPl[currentRegion]?.path"
10
+ :fill="data.color"
11
+ :stroke="data.color"
12
+ stroke-width="1"
13
+ @mouseover="onMouseOver"
14
+ @mouseleave="onMouseLeave"
15
+ />
16
+ </template>
17
+
18
+ <script>
19
+ import regionsPathPl from "./maps/regionsPathPl.json";
20
+ import { defineComponent } from "vue";
21
+ export default defineComponent({
22
+ name: "oneRegionPl",
23
+ props: {
24
+ data: {
25
+ type: Object,
26
+ default: () => {
27
+ }
28
+ },
29
+ hoveredRegion: {
30
+ type: [String, null],
31
+ required: false,
32
+ default: null
33
+ },
34
+ title: {
35
+ type: [String, null],
36
+ required: true
37
+ },
38
+ currentRegion: {
39
+ type: String,
40
+ required: true
41
+ }
42
+ },
43
+ emits: ["hover", "mouseleave"],
44
+ setup(props, { emit }) {
45
+ function onMouseOver() {
46
+ emit("hover");
47
+ }
48
+ function onMouseLeave() {
49
+ emit("mouseleave");
50
+ }
51
+ return {
52
+ regionsPathPl,
53
+ onMouseOver,
54
+ onMouseLeave
55
+ };
56
+ }
57
+ });
58
+ </script>
59
+
60
+ <style scoped>
61
+ .hovered{opacity:.5;transition:all .2s ease-in-out}.hover{cursor:pointer}
62
+ </style>
@@ -0,0 +1,54 @@
1
+ import { RegionsPl } from "./maps/interfaces";
2
+ import type { PropType } from "vue";
3
+ type CurrentData = {
4
+ color?: string;
5
+ value?: number;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ data: {
9
+ type: PropType<CurrentData>;
10
+ default: () => void;
11
+ };
12
+ hoveredRegion: {
13
+ type: PropType<RegionsPl | null>;
14
+ required: false;
15
+ default: null;
16
+ };
17
+ title: {
18
+ type: PropType<string | null>;
19
+ required: true;
20
+ };
21
+ currentRegion: {
22
+ type: PropType<RegionsPl>;
23
+ required: true;
24
+ };
25
+ }>, {
26
+ regionsPathPl: any;
27
+ onMouseOver: () => void;
28
+ onMouseLeave: () => void;
29
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mouseleave" | "hover")[], "mouseleave" | "hover", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ data: {
31
+ type: PropType<CurrentData>;
32
+ default: () => void;
33
+ };
34
+ hoveredRegion: {
35
+ type: PropType<RegionsPl | null>;
36
+ required: false;
37
+ default: null;
38
+ };
39
+ title: {
40
+ type: PropType<string | null>;
41
+ required: true;
42
+ };
43
+ currentRegion: {
44
+ type: PropType<RegionsPl>;
45
+ required: true;
46
+ };
47
+ }>> & Readonly<{
48
+ onMouseleave?: ((...args: any[]) => any) | undefined;
49
+ onHover?: ((...args: any[]) => any) | undefined;
50
+ }>, {
51
+ data: CurrentData;
52
+ hoveredRegion: RegionsPl | null;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.140",
3
+ "version": "0.2.141",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",