@tekkare/auriga 0.2.146 → 0.2.148

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.
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.2.146"
7
+ "version": "0.2.148"
8
8
  }
@@ -194,7 +194,7 @@ export default defineComponent({
194
194
  }
195
195
  if (props.type === "line") {
196
196
  if (props.options["stroke"] === void 0) {
197
- if (allValues.length === 1) {
197
+ if (props.categories.length === 1 || allValues.length === 1) {
198
198
  props.options["stroke"] = { show: false };
199
199
  } else props.options["stroke"] = { width: 3, curve: "smooth" };
200
200
  }
@@ -139,6 +139,10 @@ export default defineComponent({
139
139
  type: String,
140
140
  default: null
141
141
  },
142
+ posthogProperties: {
143
+ type: Object,
144
+ default: null
145
+ },
142
146
  cut: {
143
147
  type: Boolean,
144
148
  default: false
@@ -155,13 +159,10 @@ export default defineComponent({
155
159
  }
156
160
  );
157
161
  await props.beforeExport();
158
- if (props.posthogHost !== null && props.posthogKey !== null) {
162
+ if (props.posthogHost !== null && props.posthogKey !== null && props.posthogProperties !== null) {
159
163
  const eventName = "downloadExcel";
160
- const eventProps = {
161
- title: `${props.exportName}-from_${currentDate}`
162
- };
163
164
  try {
164
- posthog.capture(eventName, eventProps);
165
+ posthog.capture(eventName, props.posthogProperties);
165
166
  } catch (error) {
166
167
  console.warn(
167
168
  "PostHog not initialized or event capture failed.",
@@ -16,6 +16,13 @@ interface Tab {
16
16
  schema: columnSchem[];
17
17
  }
18
18
  type Tabs = Tab[];
19
+ type exportPosthog = {
20
+ appName: string;
21
+ resourceName: string;
22
+ eventType: "download";
23
+ resourceCountries: string[];
24
+ global: boolean;
25
+ };
19
26
  interface Source {
20
27
  name: string;
21
28
  date: string | Date;
@@ -80,6 +87,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
80
87
  type: StringConstructor;
81
88
  default: null;
82
89
  };
90
+ posthogProperties: {
91
+ type: PropType<exportPosthog>;
92
+ default: null;
93
+ };
83
94
  cut: {
84
95
  type: BooleanConstructor;
85
96
  default: boolean;
@@ -147,6 +158,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
147
158
  type: StringConstructor;
148
159
  default: null;
149
160
  };
161
+ posthogProperties: {
162
+ type: PropType<exportPosthog>;
163
+ default: null;
164
+ };
150
165
  cut: {
151
166
  type: BooleanConstructor;
152
167
  default: boolean;
@@ -164,6 +179,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
164
179
  exportName: string;
165
180
  limit: number;
166
181
  actualAmount: number;
182
+ posthogProperties: exportPosthog;
167
183
  }, {}, {
168
184
  argBtn: any;
169
185
  }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -61,6 +61,7 @@
61
61
  :to="subLink.to"
62
62
  :icon="subLink.icon"
63
63
  :new-tab="subLink.newTab === undefined ? true : subLink.newTab"
64
+ @clickLink="sendPosthog"
64
65
  />
65
66
  </arg-sub-menu>
66
67
  <arg-line-break
@@ -75,6 +76,7 @@
75
76
  :to="item.linkUrl"
76
77
  :icon="item.linkIcon"
77
78
  :new-tab="item.newTab === undefined ? true : item.newTab"
79
+ @clickLink="sendPosthog"
78
80
  />
79
81
  </div>
80
82
  </div>
@@ -84,6 +86,7 @@
84
86
  </template>
85
87
 
86
88
  <script>
89
+ import posthog from "posthog-js";
87
90
  import {
88
91
  ref,
89
92
  watch,
@@ -116,6 +119,22 @@ export default defineComponent({
116
119
  extraDescription: {
117
120
  type: Boolean,
118
121
  default: false
122
+ },
123
+ posthogKey: {
124
+ type: String,
125
+ default: null
126
+ },
127
+ posthogHost: {
128
+ type: String,
129
+ default: null
130
+ },
131
+ posthogProperties: {
132
+ type: Object,
133
+ default: null
134
+ },
135
+ eventName: {
136
+ type: String,
137
+ default: null
119
138
  }
120
139
  },
121
140
  setup(props) {
@@ -129,6 +148,23 @@ export default defineComponent({
129
148
  }
130
149
  }
131
150
  }
151
+ const sendPosthog = (linkProp) => {
152
+ if (props.posthogHost !== null && props.posthogKey !== null && props.posthogProperties !== null && props.eventName !== null) {
153
+ const properties = {
154
+ appName: props.posthogProperties.appName,
155
+ resourceName: `${props.posthogProperties.resourceName} - ${linkProp.label}`,
156
+ eventType: "click"
157
+ };
158
+ try {
159
+ posthog.capture(props.eventName, properties);
160
+ } catch (error) {
161
+ console.warn(
162
+ "PostHog not initialized or event capture failed.",
163
+ error
164
+ );
165
+ }
166
+ }
167
+ };
132
168
  onBeforeMount(async () => {
133
169
  setLang();
134
170
  });
@@ -138,7 +174,7 @@ export default defineComponent({
138
174
  setLang();
139
175
  }
140
176
  );
141
- return { langData };
177
+ return { langData, sendPosthog };
142
178
  }
143
179
  });
144
180
  </script>
@@ -1,3 +1,8 @@
1
+ import type { PropType } from "vue";
2
+ type exportPosthog = {
3
+ appName: string;
4
+ resourceName: string;
5
+ };
1
6
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
7
  selected: {
3
8
  type: ObjectConstructor;
@@ -16,8 +21,25 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
21
  type: BooleanConstructor;
17
22
  default: boolean;
18
23
  };
24
+ posthogKey: {
25
+ type: StringConstructor;
26
+ default: null;
27
+ };
28
+ posthogHost: {
29
+ type: StringConstructor;
30
+ default: null;
31
+ };
32
+ posthogProperties: {
33
+ type: PropType<exportPosthog>;
34
+ default: null;
35
+ };
36
+ eventName: {
37
+ type: StringConstructor;
38
+ default: null;
39
+ };
19
40
  }>, {
20
41
  langData: import("vue").Ref<any, any>;
42
+ sendPosthog: (linkProp: any) => void;
21
43
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
44
  selected: {
23
45
  type: ObjectConstructor;
@@ -36,11 +58,31 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
36
58
  type: BooleanConstructor;
37
59
  default: boolean;
38
60
  };
61
+ posthogKey: {
62
+ type: StringConstructor;
63
+ default: null;
64
+ };
65
+ posthogHost: {
66
+ type: StringConstructor;
67
+ default: null;
68
+ };
69
+ posthogProperties: {
70
+ type: PropType<exportPosthog>;
71
+ default: null;
72
+ };
73
+ eventName: {
74
+ type: StringConstructor;
75
+ default: null;
76
+ };
39
77
  }>> & Readonly<{}>, {
40
78
  lang: string;
79
+ posthogKey: string;
80
+ posthogHost: string;
81
+ posthogProperties: exportPosthog;
41
82
  selected: Record<string, any>;
42
83
  lineBreak: boolean;
43
84
  extraDescription: boolean;
85
+ eventName: string;
44
86
  }, {}, {
45
87
  argIcon: any;
46
88
  argFlag: any;
@@ -5,6 +5,7 @@
5
5
  activeClass="is-active"
6
6
  :target="newTab ? '_blank' : '_self'"
7
7
  :class="loading ? 'loading' : ''"
8
+ @click="emitPosthog"
8
9
  >
9
10
  <span v-if="loading" class="loader" />
10
11
  <arg-tooltip
@@ -67,6 +68,15 @@ export default defineComponent({
67
68
  label: { type: String, required: true },
68
69
  newTab: { type: Boolean || void 0, default: false },
69
70
  loading: { type: Boolean, default: false }
71
+ },
72
+ emits: ["clickLink"],
73
+ setup(props, { emit }) {
74
+ const emitPosthog = () => {
75
+ emit("clickLink", { label: props.label, to: props.to });
76
+ };
77
+ return {
78
+ emitPosthog
79
+ };
70
80
  }
71
81
  });
72
82
  </script>
@@ -28,7 +28,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
31
+ }>, {
32
+ emitPosthog: () => void;
33
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "clickLink"[], "clickLink", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
34
  to: {
33
35
  type: StringConstructor;
34
36
  required: true;
@@ -58,7 +60,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
58
60
  type: BooleanConstructor;
59
61
  default: boolean;
60
62
  };
61
- }>> & Readonly<{}>, {
63
+ }>> & Readonly<{
64
+ onClickLink?: ((...args: any[]) => any) | undefined;
65
+ }>, {
62
66
  loading: boolean;
63
67
  newTab: boolean;
64
68
  }, {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.146",
3
+ "version": "0.2.148",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",