@tekkare/auriga 0.2.145 → 0.2.147

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.145"
7
+ "version": "0.2.147"
8
8
  }
@@ -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) {
159
- const eventName = "Download Excel";
160
- const eventProps = {
161
- title: `${props.exportName}-from_${currentDate}`
162
- };
162
+ if (props.posthogHost !== null && props.posthogKey !== null && props.posthogProperties !== null) {
163
+ const eventName = "downloadExcel";
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>;
@@ -80,6 +80,8 @@ export default defineComponent({
80
80
  setup(props, { emit }) {
81
81
  const filtersOpen = ref(null);
82
82
  const scrollPosition = ref(0);
83
+ const lastScrollY = ref(0);
84
+ const isUserScrolling = ref(false);
83
85
  const langData = ref(null);
84
86
  async function setLang() {
85
87
  const jsonFiles = import.meta.glob("./locales/*.json");
@@ -92,6 +94,9 @@ export default defineComponent({
92
94
  }
93
95
  onBeforeMount(async () => {
94
96
  setLang();
97
+ if (window.scrollY === 0) {
98
+ filtersOpen.value = true;
99
+ }
95
100
  });
96
101
  watch(
97
102
  () => props.lang,
@@ -100,15 +105,20 @@ export default defineComponent({
100
105
  }
101
106
  );
102
107
  function openFromScroll() {
103
- if (window.scrollY === 0) {
104
- filtersOpen.value = true;
105
- scrollPosition.value = scrollY;
108
+ const currentScrollY = window.scrollY;
109
+ if (currentScrollY === 0) {
110
+ if (!isUserScrolling.value) {
111
+ return;
112
+ } else {
113
+ filtersOpen.value = true;
114
+ lastScrollY.value = currentScrollY;
115
+ }
106
116
  } else {
107
117
  const filters = document.getElementById("arg_filters_section");
108
118
  if (filters) {
109
- if (window.scrollY > scrollPosition.value + filters.offsetHeight) {
119
+ if (window.scrollY > lastScrollY.value + filters.offsetHeight) {
110
120
  filtersOpen.value = false;
111
- scrollPosition.value = window.scrollY;
121
+ lastScrollY.value = currentScrollY;
112
122
  }
113
123
  }
114
124
  }
@@ -144,6 +154,7 @@ export default defineComponent({
144
154
  const config = { attributes: true, childList: true };
145
155
  const callback = function() {
146
156
  adjustFilterPosition();
157
+ isUserScrolling.value = false;
147
158
  };
148
159
  const observer = new MutationObserver(callback);
149
160
  if (fixedHeader !== null) {
@@ -166,6 +177,13 @@ export default defineComponent({
166
177
  function save() {
167
178
  emit("saveScope");
168
179
  }
180
+ onMounted(() => {
181
+ window.addEventListener("scroll", () => {
182
+ if (window.scrollY !== lastScrollY.value) {
183
+ isUserScrolling.value = true;
184
+ }
185
+ });
186
+ });
169
187
  return {
170
188
  filtersOpen,
171
189
  clear,
@@ -176,7 +194,6 @@ export default defineComponent({
176
194
  }
177
195
  });
178
196
  </script>
179
-
180
197
  <style scoped>
181
198
  .oip_filter_card{align-items:flex-start;align-self:stretch;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--light);border-radius:8px;display:flex;flex-direction:column;max-width:1032px;position:sticky;position:-webkit-sticky;top:0;transition:gap .3s linear,max-height .4s ease,background-color .3s linear,padding .3s linear,top .3s linear;z-index:91}.filter_card{background-color:var(--white);gap:16px;max-height:1000px;overflow:visible;padding:24px}.filter_card_collapse{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background-color:rgba(245,245,249,.8);gap:0;max-height:32px;overflow:hidden;padding:16px 24px}.full-width{width:100%}.filter-icon{transition:transform .3s}.icon-rotate{transform:rotate(180deg)}.filters_title{font-size:20px;font-weight:900}.filters_amount,.filters_title{font-style:normal;line-height:normal}.filters_amount{align-items:center;border:1px solid var(--light,#ececf2);border-radius:16px;display:flex;flex-direction:column;font-size:12px;font-weight:700;gap:8px;justify-content:center;padding:2px 8px}.filters_clear,.filters_save{cursor:pointer;font-size:14px;font-style:normal;font-weight:500;line-height:normal;text-decoration-line:underline}.filters_clear{color:var(--system-alert,#ef4444)}.filters_save{color:var(--primary-primary,#2176ff)}.filters_collapse{font-size:14px;font-style:normal;font-weight:400;line-height:160%}.filters_section{align-items:flex-start;align-self:stretch;display:flex;flex-direction:column;gap:16px;transition:max-height .3s linear,opacity .3s linear,visibility .3s linear}.filters_section.open{max-height:100%;opacity:1;overflow:visible}.filters_section.closed{max-height:0;opacity:0;overflow:hidden}.toggle_filter_card{align-items:center;background:transparent;border-radius:4px;cursor:pointer;display:flex;gap:6px;padding:6px}.toggle_filter_card:hover{background:var(--light)!important}
182
199
  </style>
@@ -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.145",
3
+ "version": "0.2.147",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",