@tekkare/auriga 0.2.50 → 0.2.52

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.50"
7
+ "version": "0.2.52"
8
8
  }
@@ -2,7 +2,15 @@
2
2
  <div>
3
3
  <!-- Simple select -->
4
4
  <div class="oip_select_display">
5
- <p class="oip_filter_label">{{ dropdown_label }}</p>
5
+ <p
6
+ class="oip_filter_label"
7
+ :class="labelInfo ? 'oip_row v-center gap-4' : ''"
8
+ >
9
+ {{ dropdown_label }}
10
+ <span v-if="labelInfo" @click="openInfo" class="open-info">
11
+ <arg-icon name="Info" size="14" color="var(--medium)"
12
+ /></span>
13
+ </p>
6
14
  <arg-simple-label
7
15
  :disabled="disabled"
8
16
  @click="changeDisplay()"
@@ -174,9 +182,10 @@ export default defineComponent({
174
182
  categories: { type: Array, default: null },
175
183
  fuzzySearch: { type: Boolean, default: false },
176
184
  fuzzyThreshold: { type: Number, default: 0.5 },
177
- filterSearch: { type: Boolean, default: true }
185
+ filterSearch: { type: Boolean, default: true },
186
+ labelInfo: { type: Boolean, default: false }
178
187
  },
179
- emits: ["changeElement", "update:Selection", "changeInputValue"],
188
+ emits: ["changeElement", "update:Selection", "changeInputValue", "openInfo"],
180
189
  setup(props, { emit }) {
181
190
  const isDisplay = ref(false);
182
191
  const searchName = ref("");
@@ -205,6 +214,9 @@ export default defineComponent({
205
214
  setLang();
206
215
  }
207
216
  );
217
+ function openInfo() {
218
+ emit("openInfo");
219
+ }
208
220
  onMounted(() => {
209
221
  table_values.value = props.element_table;
210
222
  selected_item.value = props.default_select !== null ? props.element_table[props.default_select] : null;
@@ -410,7 +422,8 @@ export default defineComponent({
410
422
  getLoaderText,
411
423
  getPlaceholder,
412
424
  getEmptyContentMsg,
413
- getSepPositions
425
+ getSepPositions,
426
+ openInfo
414
427
  };
415
428
  }
416
429
  });
@@ -107,6 +107,10 @@ declare const _default: import("vue").DefineComponent<{
107
107
  type: BooleanConstructor;
108
108
  default: boolean;
109
109
  };
110
+ labelInfo: {
111
+ type: BooleanConstructor;
112
+ default: boolean;
113
+ };
110
114
  }, {
111
115
  isDisplay: import("vue").Ref<boolean>;
112
116
  searchName: import("vue").Ref<string>;
@@ -126,7 +130,8 @@ declare const _default: import("vue").DefineComponent<{
126
130
  getPlaceholder: import("vue").ComputedRef<any>;
127
131
  getEmptyContentMsg: import("vue").ComputedRef<any>;
128
132
  getSepPositions: import("vue").Ref<any>;
129
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("changeElement" | "update:Selection" | "changeInputValue")[], "changeElement" | "update:Selection" | "changeInputValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
133
+ openInfo: () => void;
134
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("changeElement" | "update:Selection" | "openInfo" | "changeInputValue")[], "changeElement" | "update:Selection" | "openInfo" | "changeInputValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
130
135
  element_table: {
131
136
  type: {
132
137
  (arrayLength: number): string[];
@@ -235,9 +240,14 @@ declare const _default: import("vue").DefineComponent<{
235
240
  type: BooleanConstructor;
236
241
  default: boolean;
237
242
  };
243
+ labelInfo: {
244
+ type: BooleanConstructor;
245
+ default: boolean;
246
+ };
238
247
  }>> & {
239
248
  onChangeElement?: ((...args: any[]) => any) | undefined;
240
249
  "onUpdate:Selection"?: ((...args: any[]) => any) | undefined;
250
+ onOpenInfo?: ((...args: any[]) => any) | undefined;
241
251
  onChangeInputValue?: ((...args: any[]) => any) | undefined;
242
252
  }, {
243
253
  lang: string;
@@ -252,6 +262,7 @@ declare const _default: import("vue").DefineComponent<{
252
262
  empty_content_msg: string;
253
263
  fuzzySearch: boolean;
254
264
  filterSearch: boolean;
265
+ labelInfo: boolean;
255
266
  filter_placeholder: string;
256
267
  close_on_click: boolean;
257
268
  default_select: number;
@@ -15,14 +15,14 @@
15
15
  <arg-tags class="source_tag">
16
16
  <div class="oip_row v-center gap-4">
17
17
  <arg-flag
18
- :slug="getCountryName.toLowerCase()"
18
+ :slug="getCountryName(sourceContent?.country?.toLowerCase())"
19
19
  emoji
20
20
  height="10"
21
21
  />
22
- <p>{{ sourceCountry }}</p>
22
+ <p>{{ sourceContent?.country }}</p>
23
23
  </div>
24
24
  </arg-tags>
25
- <p class="source_title">{{ sourceTitle }}</p>
25
+ <p class="source_title">{{ sourceContent?.title }}</p>
26
26
  </div>
27
27
  </div>
28
28
  <div class="copy_action" @click.stop="copy()">
@@ -41,12 +41,34 @@
41
41
  <div class="oip_row v-start gap-16">
42
42
  <div class="tag_display">
43
43
  <p class="toolbar_tag_title">{{ langData?.sector }}</p>
44
- <arg-tags>{{ sourceSector }}</arg-tags>
44
+ <arg-tags>Public</arg-tags>
45
45
  </div>
46
46
  </div>
47
- <span class="oip_body">
48
- <slot />
49
- </span>
47
+ <div class="oip_body">
48
+ <div v-if="directusToken !== null" class="oip_list v-start gap-24">
49
+ <div
50
+ v-if="sourceContent?.providerDescr"
51
+ class="oip_list v-start gap-8"
52
+ >
53
+ <p class="bold">About the provider :</p>
54
+ <div class="oip_list v-start gap-4">
55
+ <div v-html="sourceContent?.providerDescr" />
56
+ <slot name="moreProvider" />
57
+ </div>
58
+ </div>
59
+ <div class="oip_list v-start gap-8">
60
+ <p class="bold">About the source :</p>
61
+ <div
62
+ v-if="sourceContent?.sourceDescr"
63
+ class="oip_list v-start gap-4"
64
+ >
65
+ <div v-html="sourceContent?.sourceDescr" />
66
+ <slot name="moreSource" />
67
+ </div>
68
+ </div>
69
+ </div>
70
+ <slot v-else />
71
+ </div>
50
72
  </div>
51
73
  </div>
52
74
  </template>
@@ -69,15 +91,15 @@ export default defineComponent({
69
91
  props: {
70
92
  sourceTitle: {
71
93
  type: String,
72
- required: true
94
+ default: null
73
95
  },
74
96
  sourceCountry: {
75
97
  type: String,
76
- default: "France"
98
+ default: "World"
77
99
  },
78
100
  sourceSector: {
79
101
  type: String,
80
- default: "Public"
102
+ default: null
81
103
  },
82
104
  defaultOpen: {
83
105
  type: Boolean,
@@ -89,12 +111,25 @@ export default defineComponent({
89
111
  validator: (value) => {
90
112
  return ["en", "fr", "es", "jp"].includes(value);
91
113
  }
114
+ },
115
+ directusToken: {
116
+ type: String,
117
+ default: null
118
+ },
119
+ providerId: {
120
+ type: String,
121
+ default: null
122
+ },
123
+ sourceId: {
124
+ type: String,
125
+ default: null
92
126
  }
93
127
  },
94
128
  emits: ["copyTitle"],
95
129
  setup(props, { emit }) {
96
130
  const sourceOpen = ref(false);
97
131
  const langData = ref(null);
132
+ const sourceData = ref(null);
98
133
  async function setLang() {
99
134
  const jsonFiles = import.meta.glob("./locales/*.json");
100
135
  for (const path in jsonFiles) {
@@ -104,8 +139,112 @@ export default defineComponent({
104
139
  }
105
140
  }
106
141
  }
142
+ async function fetchData() {
143
+ const graphqlQuery = `
144
+ query {
145
+ DataProvider(
146
+ filter: {
147
+ provider_uuid: { _eq: "${props.providerId}" },
148
+ }
149
+ ) {
150
+ provider_uuid
151
+ provider_country
152
+ sources {
153
+ source_uuid
154
+ translations {
155
+ source_name
156
+ source_description
157
+ languages_code {
158
+ code
159
+ name
160
+ }
161
+ }
162
+ datasets {
163
+ id
164
+ Dataset_id {
165
+ id
166
+ table_name
167
+ schema_name
168
+ status
169
+ }
170
+ }
171
+ }
172
+ translations {
173
+ provider_name
174
+ provider_description
175
+ languages_code {
176
+ code
177
+ name
178
+ }
179
+ }
180
+ }
181
+ }
182
+ `;
183
+ const headers = {
184
+ Authorization: `Bearer ${props.directusToken}`,
185
+ "Content-Type": "application/json"
186
+ };
187
+ const payload = {
188
+ query: graphqlQuery
189
+ };
190
+ try {
191
+ const response = await fetch(
192
+ "https://metadata.rcd.lensuscloud.com/graphql",
193
+ {
194
+ method: "POST",
195
+ headers,
196
+ body: JSON.stringify(payload)
197
+ }
198
+ );
199
+ if (response.ok) {
200
+ const responseData = await response.json();
201
+ sourceData.value = responseData;
202
+ } else {
203
+ const errorText = await response.text();
204
+ console.log(`Error: ${response.status}. ${errorText}`);
205
+ }
206
+ } catch (err) {
207
+ console.log(`Request failed: ${err.message}`);
208
+ }
209
+ }
210
+ function getCountryName(name) {
211
+ if (name === "united states") {
212
+ return "usa";
213
+ } else if (name === "united kingdom") {
214
+ return "uk";
215
+ } else if (name === "poland") {
216
+ return "republic-of-poland";
217
+ } else
218
+ return name;
219
+ }
220
+ const sourceContent = computed(() => {
221
+ if (sourceData.value !== null) {
222
+ const sourceObject = sourceData.value.data.DataProvider[0]?.sources.find((source) => source.source_uuid === props.sourceId).translations.find(
223
+ (a) => a.languages_code.code.includes(props.lang)
224
+ );
225
+ const providerObject = sourceData.value.data.DataProvider[0]?.translations.find(
226
+ (a) => a.languages_code.code.includes(props.lang)
227
+ );
228
+ return {
229
+ title: `${providerObject?.provider_name} - ${sourceObject?.source_name}`,
230
+ country: sourceData.value.data.DataProvider[0]?.provider_country,
231
+ providerDescr: providerObject?.provider_description,
232
+ sourceDescr: sourceObject?.source_description,
233
+ sector: "Public"
234
+ };
235
+ } else {
236
+ return {
237
+ title: props.sourceTitle,
238
+ country: props.sourceCountry,
239
+ sector: props.sourceSector
240
+ };
241
+ }
242
+ });
107
243
  onBeforeMount(async () => {
108
244
  setLang();
245
+ if (props.directusToken !== null) {
246
+ await fetchData();
247
+ }
109
248
  });
110
249
  watch(
111
250
  () => props.lang,
@@ -116,16 +255,6 @@ export default defineComponent({
116
255
  function closeSource() {
117
256
  sourceOpen.value = false;
118
257
  }
119
- const getCountryName = computed(() => {
120
- if (props.sourceCountry === "United States") {
121
- return "usa";
122
- } else if (props.sourceCountry === "United Kingdom") {
123
- return "uk";
124
- } else if (props.sourceCountry === "Poland") {
125
- return "republic-of-poland";
126
- } else
127
- return props.sourceCountry;
128
- });
129
258
  onMounted(() => {
130
259
  sourceOpen.value = props.defaultOpen;
131
260
  });
@@ -158,11 +287,18 @@ export default defineComponent({
158
287
  navigator.clipboard.writeText(props.sourceTitle);
159
288
  emit("copyTitle");
160
289
  }
161
- return { closeSource, sourceOpen, copy, getCountryName, langData };
290
+ return {
291
+ closeSource,
292
+ sourceOpen,
293
+ copy,
294
+ getCountryName,
295
+ langData,
296
+ sourceContent
297
+ };
162
298
  }
163
299
  });
164
300
  </script>
165
301
 
166
302
  <style scoped>
167
- .oip_source_card_collapse{align-self:stretch;border:1px solid var(--light,#dbdef0);border-radius:8px;cursor:pointer;display:flex;flex-direction:column;overflow:hidden;padding:8px 8px 8px 16px;transition:gap .3s linear,max-height .3s linear,background-color .3s linear,padding .3s linear}.oip_source_card_collapse:hover .header>svg{color:var(--primary)!important}.oip_source_card_collapse.close{background-color:var(--white,#fff);gap:0;max-height:110px}.oip_source_card_collapse.open{background-color:var(--demi-fond);gap:16px;max-height:800px;padding:8px 8px 16px 16px}.icon_open{transition:transform .3s}.icon_rotate{transform:rotateX(180deg)}.source_card_header{align-items:center;align-self:stretch;display:flex;flex-direction:row;gap:8px;justify-content:space-between}.source_title{font-family:Figtree;font-size:14px;font-style:normal;font-weight:700;line-height:160%}.source_content{display:flex;flex-direction:column;gap:16px;margin-right:-6px;padding-right:4px;transition:max-height .3s linear,opacity .3s linear}.hide_content{max-height:0;opacity:0}.show_content{max-height:100%;opacity:1;overflow-y:scroll}.show_content::-webkit-scrollbar{height:5px;width:5px}.show_content::-webkit-scrollbar-thumb{background:var(--medium);border-radius:12px!important}.show_content::-webkit-scrollbar-thumb:hover{background:var(--medium)!important}.source_tag{align-self:stretch;display:flex}.toolbar_source_update,.toolbar_tag_title{color:var(--dark);font-size:12px;font-style:normal;font-weight:400;line-height:normal}.tag_display{align-items:flex-start;display:flex;flex-direction:column;gap:var(--s,8px);justify-content:center}.copy_action{align-items:center;background:var(--white);border:1px solid var(--light);border-radius:6px;box-shadow:0 1px 2px 0 rgba(30,41,59,.1);color:var(--dark);cursor:pointer;display:flex;flex-direction:row;font-size:12px;font-style:normal;font-weight:500;gap:4px;line-height:normal;padding:4px 8px 4px 6px;white-space:nowrap}.copy_action:hover,.copy_action:hover svg{color:var(--primary)!important}.title_container{display:flex;flex-direction:column;gap:4px}
303
+ .oip_source_card_collapse{align-self:stretch;border:1px solid var(--light,#dbdef0);border-radius:8px;cursor:pointer;display:flex;flex-direction:column;overflow:hidden;padding:8px 8px 8px 16px;transition:gap .3s linear,max-height .3s linear,background-color .3s linear,padding .3s linear}.bold{font-weight:700}.oip_source_card_collapse:hover .header>svg{color:var(--primary)!important}.oip_source_card_collapse.close{background-color:var(--white,#fff);gap:0;max-height:110px}.oip_source_card_collapse.open{background-color:var(--demi-fond);gap:16px;max-height:800px;padding:8px 8px 16px 16px}.icon_open{transition:transform .3s}.icon_rotate{transform:rotateX(180deg)}.source_card_header{align-items:center;align-self:stretch;display:flex;flex-direction:row;gap:8px;justify-content:space-between}.source_title{font-family:Figtree;font-size:14px;font-style:normal;font-weight:700;line-height:160%}.source_content{display:flex;flex-direction:column;gap:16px;margin-right:-6px;padding-right:4px;transition:max-height .3s linear,opacity .3s linear}.hide_content{max-height:0;opacity:0}.show_content{max-height:100%;opacity:1;overflow-y:scroll}.show_content::-webkit-scrollbar{height:5px;width:5px}.show_content::-webkit-scrollbar-thumb{background:var(--medium);border-radius:12px!important}.show_content::-webkit-scrollbar-thumb:hover{background:var(--medium)!important}.source_tag{align-self:stretch;display:flex}.toolbar_source_update,.toolbar_tag_title{color:var(--dark);font-size:12px;font-style:normal;font-weight:400;line-height:normal}.tag_display{align-items:flex-start;display:flex;flex-direction:column;gap:var(--s,8px);justify-content:center}.copy_action{align-items:center;background:var(--white);border:1px solid var(--light);border-radius:6px;box-shadow:0 1px 2px 0 rgba(30,41,59,.1);color:var(--dark);cursor:pointer;display:flex;flex-direction:row;font-size:12px;font-style:normal;font-weight:500;gap:4px;line-height:normal;padding:4px 8px 4px 6px;white-space:nowrap}.copy_action:hover,.copy_action:hover svg{color:var(--primary)!important}.title_container{display:flex;flex-direction:column;gap:4px}
168
304
  </style>
@@ -1,7 +1,7 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  sourceTitle: {
3
3
  type: StringConstructor;
4
- required: true;
4
+ default: null;
5
5
  };
6
6
  sourceCountry: {
7
7
  type: StringConstructor;
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<{
9
9
  };
10
10
  sourceSector: {
11
11
  type: StringConstructor;
12
- default: string;
12
+ default: null;
13
13
  };
14
14
  defaultOpen: {
15
15
  type: BooleanConstructor;
@@ -20,16 +20,41 @@ declare const _default: import("vue").DefineComponent<{
20
20
  default: string;
21
21
  validator: (value: string) => boolean;
22
22
  };
23
+ directusToken: {
24
+ type: StringConstructor;
25
+ default: null;
26
+ };
27
+ providerId: {
28
+ type: StringConstructor;
29
+ default: null;
30
+ };
31
+ sourceId: {
32
+ type: StringConstructor;
33
+ default: null;
34
+ };
23
35
  }, {
24
36
  closeSource: () => void;
25
37
  sourceOpen: import("vue").Ref<boolean>;
26
38
  copy: () => void;
27
- getCountryName: import("vue").ComputedRef<string>;
39
+ getCountryName: (name: string) => string;
28
40
  langData: import("vue").Ref<any>;
41
+ sourceContent: import("vue").ComputedRef<{
42
+ title: string;
43
+ country: any;
44
+ providerDescr: any;
45
+ sourceDescr: any;
46
+ sector: string;
47
+ } | {
48
+ title: string;
49
+ country: string;
50
+ sector: string;
51
+ providerDescr?: undefined;
52
+ sourceDescr?: undefined;
53
+ }>;
29
54
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "copyTitle"[], "copyTitle", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
55
  sourceTitle: {
31
56
  type: StringConstructor;
32
- required: true;
57
+ default: null;
33
58
  };
34
59
  sourceCountry: {
35
60
  type: StringConstructor;
@@ -37,7 +62,7 @@ declare const _default: import("vue").DefineComponent<{
37
62
  };
38
63
  sourceSector: {
39
64
  type: StringConstructor;
40
- default: string;
65
+ default: null;
41
66
  };
42
67
  defaultOpen: {
43
68
  type: BooleanConstructor;
@@ -48,12 +73,28 @@ declare const _default: import("vue").DefineComponent<{
48
73
  default: string;
49
74
  validator: (value: string) => boolean;
50
75
  };
76
+ directusToken: {
77
+ type: StringConstructor;
78
+ default: null;
79
+ };
80
+ providerId: {
81
+ type: StringConstructor;
82
+ default: null;
83
+ };
84
+ sourceId: {
85
+ type: StringConstructor;
86
+ default: null;
87
+ };
51
88
  }>> & {
52
89
  onCopyTitle?: ((...args: any[]) => any) | undefined;
53
90
  }, {
54
91
  lang: string;
92
+ sourceTitle: string;
55
93
  sourceCountry: string;
56
94
  sourceSector: string;
57
95
  defaultOpen: boolean;
96
+ directusToken: string;
97
+ providerId: string;
98
+ sourceId: string;
58
99
  }, {}>;
59
100
  export default _default;
@@ -81,7 +81,9 @@
81
81
  },
82
82
  "sourceCollapse": {
83
83
  "copySource": "Copy",
84
- "sector": "Sector"
84
+ "sector": "Sector",
85
+ "aboutProvider": "About the provider :",
86
+ "aboutSource": "About the source :"
85
87
  },
86
88
 
87
89
  "backOIP": "Back to OIP",
@@ -81,7 +81,9 @@
81
81
  },
82
82
  "sourceCollapse": {
83
83
  "copySource": "Copiar",
84
- "sector": "Sector"
84
+ "sector": "Sector",
85
+ "aboutProvider": "Sobre el proveedor :",
86
+ "aboutSource": "Sobre la fuente :"
85
87
  },
86
88
  "backOIP": "Volver a OIP",
87
89
  "footer": {
@@ -81,7 +81,9 @@
81
81
  },
82
82
  "sourceCollapse": {
83
83
  "copySource": "Copier",
84
- "sector": "Secteur"
84
+ "sector": "Secteur",
85
+ "aboutProvider": "À propos du provider :",
86
+ "aboutSource": "À propos de la source :"
85
87
  },
86
88
  "backOIP": "Retour OIP",
87
89
  "footer": {
@@ -81,7 +81,9 @@
81
81
  },
82
82
  "sourceCollapse": {
83
83
  "copySource": "コピー",
84
- "sector": "セクター"
84
+ "sector": "セクター",
85
+ "aboutProvider": "Sプロバイダーについて :",
86
+ "aboutSource": "ソースについて :"
85
87
  },
86
88
  "backOIP": "OIPに戻る",
87
89
  "footer": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",