@tekkare/auriga 0.1.175 → 0.1.177

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.
Files changed (37) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/argAdvancedSearchBar.vue +1 -1
  3. package/dist/runtime/components/argChart.vue +1 -1
  4. package/dist/runtime/components/argExportXLSX.vue +6 -3
  5. package/dist/runtime/components/argMapsEurope.vue +216 -0
  6. package/dist/runtime/components/argMapsEurope.vue.d.ts +57 -0
  7. package/dist/runtime/components/argMapsFrDepartements.vue +1 -1
  8. package/dist/runtime/components/argMapsFrDepartements.vue.d.ts +1 -1
  9. package/dist/runtime/components/argMapsFrRegions.vue +1 -1
  10. package/dist/runtime/components/argMapsFrRegions.vue.d.ts +1 -1
  11. package/dist/runtime/components/argMapsFrRegionsToDepartements.vue +1130 -0
  12. package/dist/runtime/components/argMapsFrRegionsToDepartements.vue.d.ts +95 -0
  13. package/dist/runtime/components/argMapsUs.vue +216 -0
  14. package/dist/runtime/components/argMapsUs.vue.d.ts +57 -0
  15. package/dist/runtime/components/argNumberInput.vue +1 -1
  16. package/dist/runtime/components/argSearchInput.vue +165 -19
  17. package/dist/runtime/components/argSearchInput.vue.d.ts +70 -0
  18. package/dist/runtime/components/argSimpleInput.vue +1 -1
  19. package/dist/runtime/components/maps/countryEuropPath.json +177 -0
  20. package/dist/runtime/components/maps/departementsPath.json +406 -0
  21. package/dist/runtime/components/{mapsFr → maps}/interfaces.d.ts +112 -0
  22. package/dist/runtime/components/{mapsFr → maps}/interfaces.mjs +114 -0
  23. package/dist/runtime/components/maps/regionsPath.json +164 -0
  24. package/dist/runtime/components/maps/usStatesPath.json +152 -0
  25. package/dist/runtime/components/oneCountryEurope.vue +62 -0
  26. package/dist/runtime/components/oneCountryEurope.vue.d.ts +54 -0
  27. package/dist/runtime/components/oneDepartementFr.vue +1 -1
  28. package/dist/runtime/components/oneDepartementFr.vue.d.ts +1 -1
  29. package/dist/runtime/components/oneRegionFr.vue +1 -1
  30. package/dist/runtime/components/oneRegionFr.vue.d.ts +1 -1
  31. package/dist/runtime/components/oneRegionToDepartements.vue +178 -0
  32. package/dist/runtime/components/oneRegionToDepartements.vue.d.ts +111 -0
  33. package/dist/runtime/components/oneStateUs.vue +62 -0
  34. package/dist/runtime/components/oneStateUs.vue.d.ts +54 -0
  35. package/package.json +1 -1
  36. package/dist/runtime/components/mapsFr/departementsPath.json +0 -407
  37. package/dist/runtime/components/mapsFr/regionsPath.json +0 -164
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <path
3
+ :id="`interactiveMap-${title}-${currentCountry}`"
4
+ :class="
5
+ hoveredCountry && hoveredCountry !== currentCountry && data.value
6
+ ? 'hovered'
7
+ : 'hover'
8
+ "
9
+ :d="countryEuropPath[currentCountry].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 countryEuropPath from "./maps/countryEuropPath.json";
20
+ import { defineComponent } from "vue";
21
+ export default defineComponent({
22
+ name: "oneCountryEurope",
23
+ props: {
24
+ data: {
25
+ type: Object,
26
+ default: () => {
27
+ }
28
+ },
29
+ hoveredCountry: {
30
+ type: [String, null],
31
+ required: true,
32
+ default: null
33
+ },
34
+ title: {
35
+ type: [String, null],
36
+ required: true
37
+ },
38
+ currentCountry: {
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
+ countryEuropPath,
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 { EuropeanCountries } 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<{
8
+ data: {
9
+ type: PropType<CurrentData>;
10
+ default: () => void;
11
+ };
12
+ hoveredCountry: {
13
+ type: PropType<EuropeanCountries | null>;
14
+ required: true;
15
+ default: null;
16
+ };
17
+ title: {
18
+ type: PropType<string | null>;
19
+ required: true;
20
+ };
21
+ currentCountry: {
22
+ type: PropType<EuropeanCountries>;
23
+ required: true;
24
+ };
25
+ }, {
26
+ countryEuropPath: any;
27
+ onMouseOver: () => void;
28
+ onMouseLeave: () => void;
29
+ }, unknown, {}, {}, 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
+ hoveredCountry: {
35
+ type: PropType<EuropeanCountries | null>;
36
+ required: true;
37
+ default: null;
38
+ };
39
+ title: {
40
+ type: PropType<string | null>;
41
+ required: true;
42
+ };
43
+ currentCountry: {
44
+ type: PropType<EuropeanCountries>;
45
+ required: true;
46
+ };
47
+ }>> & {
48
+ onMouseleave?: ((...args: any[]) => any) | undefined;
49
+ onHover?: ((...args: any[]) => any) | undefined;
50
+ }, {
51
+ data: CurrentData;
52
+ hoveredCountry: EuropeanCountries | null;
53
+ }, {}>;
54
+ export default _default;
@@ -18,7 +18,7 @@
18
18
  </template>
19
19
 
20
20
  <script>
21
- import departementsPath from "./mapsFr/departementsPath.json";
21
+ import departementsPath from "./maps/departementsPath.json";
22
22
  import { defineComponent } from "vue";
23
23
  export default defineComponent({
24
24
  name: "oneDepartementFr",
@@ -1,4 +1,4 @@
1
- import { Departements } from "./mapsFr/interfaces";
1
+ import { Departements } from "./maps/interfaces";
2
2
  import type { PropType } from "vue";
3
3
  type CurrentData = {
4
4
  color?: string;
@@ -16,7 +16,7 @@
16
16
  </template>
17
17
 
18
18
  <script>
19
- import regionsPath from "./mapsFr/regionsPath.json";
19
+ import regionsPath from "./maps/regionsPath.json";
20
20
  import { defineComponent } from "vue";
21
21
  export default defineComponent({
22
22
  name: "oneRegionFr",
@@ -1,4 +1,4 @@
1
- import { Regions } from "./mapsFr/interfaces";
1
+ import { Regions } from "./maps/interfaces";
2
2
  import type { PropType } from "vue";
3
3
  type CurrentData = {
4
4
  color?: string;
@@ -0,0 +1,178 @@
1
+ <template>
2
+ <path
3
+ v-if="clickedRegion !== currentRegion"
4
+ @click.stop
5
+ :class="
6
+ clickedRegion &&
7
+ clickedRegion !== currentRegion &&
8
+ hoveredRegion === currentRegion
9
+ ? ' hover region hovered_dark'
10
+ : clickedRegion && clickedRegion !== currentRegion
11
+ ? 'dark hover region'
12
+ : hoveredRegion && hoveredRegion !== currentRegion && data.value
13
+ ? 'hovered region'
14
+ : 'hover region'
15
+ "
16
+ :id="`interactiveMap-${title}-${currentRegion}`"
17
+ :d="regionsPath[currentRegion].path"
18
+ :fill="data.color"
19
+ :stroke="data.color"
20
+ stroke-width="1"
21
+ @click="onMouseClick"
22
+ @mouseover="onMouseOver"
23
+ @mouseleave="onMouseLeave"
24
+ />
25
+ <path
26
+ v-else
27
+ @click.stop
28
+ v-for="departement in departements"
29
+ :key="departement"
30
+ :class="
31
+ currentDepartement && currentDepartement !== departement && data.value
32
+ ? 'hoveredDpt dpt'
33
+ : 'hover dpt'
34
+ "
35
+ :id="`interactiveMap-${title}-${departement}`"
36
+ :d="departmentsPath[departement].path"
37
+ :fill="getColor(dptData.find((x) => x.name == departement)?.value)"
38
+ stroke="rgba(0, 0, 0, 0.2)"
39
+ stroke-width="1"
40
+ @click="onMouseClick"
41
+ @mouseover="onDptMouseOver(departement)"
42
+ @mouseleave="onDptMouseLeave(departement)"
43
+ />
44
+ </template>
45
+
46
+ <script>
47
+ import { ref, computed, nextTick } from "vue";
48
+ import regionsPath from "./maps/regionsPath.json";
49
+ import departmentsPath from "./maps/departementsPath.json";
50
+ import { defineComponent } from "vue";
51
+ export default defineComponent({
52
+ name: "oneRegionFr",
53
+ props: {
54
+ data: {
55
+ type: Object,
56
+ default: () => {
57
+ }
58
+ },
59
+ hoveredRegion: {
60
+ type: String,
61
+ required: false,
62
+ default: null
63
+ },
64
+ title: {
65
+ type: String,
66
+ required: true
67
+ },
68
+ currentRegion: {
69
+ type: String,
70
+ required: true
71
+ },
72
+ currentDepartement: {
73
+ type: [String, null],
74
+ required: true
75
+ },
76
+ clickedRegion: {
77
+ type: [String, null],
78
+ required: false,
79
+ default: null
80
+ },
81
+ dptData: {
82
+ type: Array,
83
+ required: true
84
+ },
85
+ scale: {
86
+ type: Array,
87
+ required: true
88
+ },
89
+ setTooltipPosition: {
90
+ type: Function,
91
+ required: true
92
+ }
93
+ },
94
+ emits: [
95
+ "hover",
96
+ "mouseleave",
97
+ "click",
98
+ "departementHover",
99
+ "mouseLeaveDepartement"
100
+ ],
101
+ setup(props, { emit }) {
102
+ const displayDepartements = ref(false);
103
+ const departements = computed(() => {
104
+ return regionsPath[props.currentRegion].departments;
105
+ });
106
+ function getColor(value) {
107
+ if (!value)
108
+ return "var(--lightest)";
109
+ if (value >= props.scale[9]) {
110
+ return "#3F1151";
111
+ } else if (value >= props.scale[8]) {
112
+ return "#432974";
113
+ } else if (value >= props.scale[7]) {
114
+ return "#404A85";
115
+ } else if (value >= props.scale[6]) {
116
+ return "#3F668A";
117
+ } else if (value >= props.scale[5]) {
118
+ return "#43808C";
119
+ } else if (value >= props.scale[4]) {
120
+ return "#4C9C8A";
121
+ } else if (value >= props.scale[3]) {
122
+ return "#5FB57E";
123
+ } else if (value >= props.scale[2]) {
124
+ return "#85CB68";
125
+ } else if (value >= props.scale[1]) {
126
+ return "#BDDD51";
127
+ } else if (value >= props.scale[0]) {
128
+ return "#F9E855";
129
+ }
130
+ }
131
+ async function onMouseOver(event) {
132
+ emit("hover");
133
+ if (props.clickedRegion !== null && props.clickedRegion !== props.currentRegion) {
134
+ await nextTick();
135
+ const containerPosition = document.getElementById(`container_map-${props.title}`)?.getBoundingClientRect();
136
+ const tooltipElement = document.getElementById(
137
+ `tooltip_map-${props.title}`
138
+ );
139
+ const tooltipHeight = tooltipElement ? tooltipElement.getBoundingClientRect().height : 60;
140
+ props.setTooltipPosition(
141
+ event.clientX - containerPosition?.x - 150,
142
+ event.clientY - containerPosition?.y - tooltipHeight - 40,
143
+ 300
144
+ );
145
+ }
146
+ }
147
+ function onDptMouseOver(departement) {
148
+ emit("departementHover", departement);
149
+ }
150
+ function onMouseLeave() {
151
+ emit("mouseleave");
152
+ }
153
+ function onDptMouseLeave(departement) {
154
+ emit("mouseLeaveDepartement");
155
+ }
156
+ function onMouseClick() {
157
+ displayDepartements.value = !displayDepartements.value;
158
+ emit("click");
159
+ }
160
+ return {
161
+ regionsPath,
162
+ onMouseOver,
163
+ onMouseLeave,
164
+ onDptMouseOver,
165
+ onDptMouseLeave,
166
+ onMouseClick,
167
+ getColor,
168
+ displayDepartements,
169
+ departements,
170
+ departmentsPath
171
+ };
172
+ }
173
+ });
174
+ </script>
175
+
176
+ <style scoped>
177
+ .dark,.hovered,.hoveredDpt{opacity:.3;transition:all .2s ease-in-out}.dark{filter:grayscale(1)}.hover{cursor:pointer}.dpt{transition:all .2s ease-in-out;z-index:20}.dpt:hover{filter:drop-shadow(0 0 10px rgba(53,53,53,.5))}.region{z-index:10}.hovered_dark,.region{transition:all .2s ease-in-out}.hovered_dark{filter:brightness(1);opacity:.6}
178
+ </style>
@@ -0,0 +1,111 @@
1
+ import { Departements, Regions } from "./maps/interfaces";
2
+ import type { PropType } from "vue";
3
+ type CurrentData = {
4
+ color: string;
5
+ value: number | null;
6
+ };
7
+ type Data = {
8
+ name: Departements;
9
+ value: number;
10
+ };
11
+ declare const _default: import("vue").DefineComponent<{
12
+ data: {
13
+ type: PropType<CurrentData>;
14
+ default: () => void;
15
+ };
16
+ hoveredRegion: {
17
+ type: PropType<Regions | null>;
18
+ required: false;
19
+ default: null;
20
+ };
21
+ title: {
22
+ type: StringConstructor;
23
+ required: true;
24
+ };
25
+ currentRegion: {
26
+ type: PropType<Regions>;
27
+ required: true;
28
+ };
29
+ currentDepartement: {
30
+ type: PropType<Departements | null>;
31
+ required: true;
32
+ };
33
+ clickedRegion: {
34
+ type: PropType<Regions | null>;
35
+ required: false;
36
+ default: null;
37
+ };
38
+ dptData: {
39
+ type: PropType<Data[]>;
40
+ required: true;
41
+ };
42
+ scale: {
43
+ type: PropType<number[]>;
44
+ required: true;
45
+ };
46
+ setTooltipPosition: {
47
+ type: FunctionConstructor;
48
+ required: true;
49
+ };
50
+ }, {
51
+ regionsPath: any;
52
+ onMouseOver: (event: any) => Promise<void>;
53
+ onMouseLeave: () => void;
54
+ onDptMouseOver: (departement?: string) => void;
55
+ onDptMouseLeave: (departement?: string) => void;
56
+ onMouseClick: () => void;
57
+ getColor: (value?: number) => "var(--lightest)" | "#3F1151" | "#432974" | "#404A85" | "#3F668A" | "#43808C" | "#4C9C8A" | "#5FB57E" | "#85CB68" | "#BDDD51" | "#F9E855" | undefined;
58
+ displayDepartements: import("vue").Ref<boolean>;
59
+ departements: import("vue").ComputedRef<any>;
60
+ departmentsPath: any;
61
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "mouseleave" | "hover" | "departementHover" | "mouseLeaveDepartement")[], "click" | "mouseleave" | "hover" | "departementHover" | "mouseLeaveDepartement", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
62
+ data: {
63
+ type: PropType<CurrentData>;
64
+ default: () => void;
65
+ };
66
+ hoveredRegion: {
67
+ type: PropType<Regions | null>;
68
+ required: false;
69
+ default: null;
70
+ };
71
+ title: {
72
+ type: StringConstructor;
73
+ required: true;
74
+ };
75
+ currentRegion: {
76
+ type: PropType<Regions>;
77
+ required: true;
78
+ };
79
+ currentDepartement: {
80
+ type: PropType<Departements | null>;
81
+ required: true;
82
+ };
83
+ clickedRegion: {
84
+ type: PropType<Regions | null>;
85
+ required: false;
86
+ default: null;
87
+ };
88
+ dptData: {
89
+ type: PropType<Data[]>;
90
+ required: true;
91
+ };
92
+ scale: {
93
+ type: PropType<number[]>;
94
+ required: true;
95
+ };
96
+ setTooltipPosition: {
97
+ type: FunctionConstructor;
98
+ required: true;
99
+ };
100
+ }>> & {
101
+ onClick?: ((...args: any[]) => any) | undefined;
102
+ onMouseleave?: ((...args: any[]) => any) | undefined;
103
+ onHover?: ((...args: any[]) => any) | undefined;
104
+ onDepartementHover?: ((...args: any[]) => any) | undefined;
105
+ onMouseLeaveDepartement?: ((...args: any[]) => any) | undefined;
106
+ }, {
107
+ data: CurrentData;
108
+ hoveredRegion: Regions | null;
109
+ clickedRegion: Regions | null;
110
+ }, {}>;
111
+ export default _default;
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <path
3
+ :id="`interactiveMap-${title}-${currentState}`"
4
+ :class="
5
+ hoveredState && hoveredState !== currentState && data.value
6
+ ? 'hovered'
7
+ : 'hover'
8
+ "
9
+ :d="usStatesPath[currentState].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 usStatesPath from "./maps/usStatesPath.json";
20
+ import { defineComponent } from "vue";
21
+ export default defineComponent({
22
+ name: "oneStateUs",
23
+ props: {
24
+ data: {
25
+ type: Object,
26
+ default: () => {
27
+ }
28
+ },
29
+ hoveredState: {
30
+ type: [String, null],
31
+ required: true,
32
+ default: null
33
+ },
34
+ title: {
35
+ type: [String, null],
36
+ required: true
37
+ },
38
+ currentState: {
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
+ usStatesPath,
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 { UsStates } 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<{
8
+ data: {
9
+ type: PropType<CurrentData>;
10
+ default: () => void;
11
+ };
12
+ hoveredState: {
13
+ type: PropType<UsStates | null>;
14
+ required: true;
15
+ default: null;
16
+ };
17
+ title: {
18
+ type: PropType<string | null>;
19
+ required: true;
20
+ };
21
+ currentState: {
22
+ type: PropType<UsStates>;
23
+ required: true;
24
+ };
25
+ }, {
26
+ usStatesPath: any;
27
+ onMouseOver: () => void;
28
+ onMouseLeave: () => void;
29
+ }, unknown, {}, {}, 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
+ hoveredState: {
35
+ type: PropType<UsStates | null>;
36
+ required: true;
37
+ default: null;
38
+ };
39
+ title: {
40
+ type: PropType<string | null>;
41
+ required: true;
42
+ };
43
+ currentState: {
44
+ type: PropType<UsStates>;
45
+ required: true;
46
+ };
47
+ }>> & {
48
+ onMouseleave?: ((...args: any[]) => any) | undefined;
49
+ onHover?: ((...args: any[]) => any) | undefined;
50
+ }, {
51
+ data: CurrentData;
52
+ hoveredState: UsStates | null;
53
+ }, {}>;
54
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.1.175",
3
+ "version": "0.1.177",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",