@tekkare/auriga 0.2.71 → 0.2.73

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.71"
7
+ "version": "0.2.73"
8
8
  }
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
  </div>
31
31
  <div v-if="filterBlocks !== null" class="arg_home_all_blocks">
32
- <div class="oip_list v-start gap-8">
32
+ <div v-if="!noTitle" class="oip_list v-start gap-8">
33
33
  <h1 class="arg_home_blocks_title">{{ getTitle }}</h1>
34
34
  <p v-if="appSubtitle !== null" class="home_subtitle">
35
35
  {{ appSubtitle }}
@@ -43,7 +43,84 @@
43
43
  />
44
44
  <slot name="homeExtraContent" />
45
45
  <div
46
- v-if="filterBlocks.length > 0"
46
+ v-if="
47
+ filterBlocks.length > 0 &&
48
+ blockCategories !== null &&
49
+ blockCategories.value.length > 0
50
+ "
51
+ class="oip_list v-start gap-16"
52
+ >
53
+ <div
54
+ v-for="category in blockCategories.value"
55
+ :key="category"
56
+ class="oip_list v-start gap-8 category_container"
57
+ >
58
+ <p class="category_label">{{ category }}</p>
59
+ <div class="oip_row v-start gap-16 wrap full_stretch">
60
+ <div
61
+ v-for="(block, index) in filterCategoryBlocks(category)"
62
+ :key="index"
63
+ class="oip_card block_card action"
64
+ :class="
65
+ selectedBlock?.title === block.title ? 'block_selected' : ''
66
+ "
67
+ @click="selectBlock(block)"
68
+ >
69
+ <slot
70
+ v-if="customizeBlocks"
71
+ :name="seperateCustoms ? 'customOther' : 'custom'"
72
+ v-bind:block="block"
73
+ />
74
+ <div v-else class="block_content">
75
+ <div
76
+ class="oip_row v-center space-between full_stretch card_head"
77
+ >
78
+ <p class="block_title">
79
+ <span v-if="block.country"
80
+ ><arg-flag
81
+ v-if="block.iso"
82
+ :emoji="
83
+ block.iso === 'ww' ||
84
+ block.iso === 'eu' ||
85
+ block.emoji
86
+ "
87
+ :iso="block.iso"
88
+ height="14" />
89
+ <arg-flag
90
+ v-else
91
+ :slug="block.country.toLowerCase()"
92
+ :emoji="
93
+ block.country === 'world' ||
94
+ block.country === 'europe' ||
95
+ block.emoji
96
+ "
97
+ height="14" /></span
98
+ >{{ block.title }}
99
+ </p>
100
+ <div
101
+ v-if="block.population && block.population !== null"
102
+ class="oip_row v-center gap-8 population"
103
+ >
104
+ <arg-icon
105
+ name="UsersThree"
106
+ color="var(--medium)"
107
+ size="14"
108
+ />
109
+ <p>
110
+ {{
111
+ new Intl.NumberFormat("us-US").format(block.population)
112
+ }}
113
+ </p>
114
+ </div>
115
+ </div>
116
+ <p class="block_descr">{{ block.description }}</p>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <div
123
+ v-else-if="filterBlocks.length > 0"
47
124
  class="oip_row v-start gap-16 wrap full_stretch"
48
125
  >
49
126
  <div
@@ -123,6 +200,10 @@ export default defineComponent({
123
200
  type: String,
124
201
  default: null
125
202
  },
203
+ noTitle: {
204
+ type: Boolean,
205
+ default: false
206
+ },
126
207
  globalTitle: {
127
208
  type: String,
128
209
  default: null
@@ -185,6 +266,15 @@ export default defineComponent({
185
266
  }
186
267
  }
187
268
  }
269
+ const blockCategories = computed(() => {
270
+ const categories = ref(null);
271
+ if (props.appBlocks.length > 0) {
272
+ categories.value = [
273
+ ...new Set(props.appBlocks.map((a) => a.category))
274
+ ];
275
+ }
276
+ return categories;
277
+ });
188
278
  onBeforeMount(async () => {
189
279
  setLang();
190
280
  });
@@ -215,6 +305,9 @@ export default defineComponent({
215
305
  const filterBlocks = computed(() => {
216
306
  return props.appBlocks.length > 0 ? props.appBlocks.filter((a) => includesValue(a)) : null;
217
307
  });
308
+ const filterCategoryBlocks = (cat) => {
309
+ return props.appBlocks.length > 0 ? props.appBlocks.filter((a) => a.category === cat) : null;
310
+ };
218
311
  function includesValue(a) {
219
312
  const hasValue = ref(false);
220
313
  for (const [key] of Object.entries(a)) {
@@ -238,12 +331,14 @@ export default defineComponent({
238
331
  selectBlock,
239
332
  filterBlocks,
240
333
  getGlobalTitle,
241
- langData
334
+ langData,
335
+ blockCategories,
336
+ filterCategoryBlocks
242
337
  };
243
338
  }
244
339
  });
245
340
  </script>
246
341
 
247
342
  <style scoped>
248
- .arg_home_all_blocks{align-items:flex-start;align-self:stretch;display:flex;flex-direction:column;gap:24px}.block_card{align-self:stretch;cursor:pointer;flex:0 0 calc(50% - 59px);margin:0!important;padding:24px!important}.block_card:not(.block_selected):hover .block_title{color:var(--primary)!important}.block_descr{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:14px;font-style:normal;font-weight:400;line-height:160%;overflow:hidden}.block_content{align-items:flex-start;display:flex;flex-direction:column;gap:12px}.block_title{align-items:flex-end;display:flex;flex-direction:row;font-size:16px;font-style:normal;font-weight:700;gap:8px;line-height:normal}.block_selected{background:var(--primary)!important;border:1px solid var(--primary)!important;box-shadow:var(--large-shadow)!important;color:var(--white)!important}.full_stretch{align-self:stretch}.population p{color:var(--medium);font-size:12px;font-weight:400;line-height:14px}.block_selected>.block_content>.card_head>.population p,.block_selected>.block_content>.card_head>.population svg{color:var(--white)!important}.home_subtitle{color:var(--dark);font-size:14px;font-style:normal;font-weight:400;line-height:160%}
343
+ .arg_home_all_blocks{align-items:flex-start;align-self:stretch;display:flex;flex-direction:column;gap:24px}.block_card{align-self:stretch;cursor:pointer;flex:0 0 calc(50% - 59px);margin:0!important;padding:24px!important}.block_card:not(.block_selected):hover .block_title{color:var(--primary)!important}.block_descr{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:14px;font-style:normal;font-weight:400;line-height:160%;overflow:hidden}.block_content{align-items:flex-start;display:flex;flex-direction:column;gap:12px}.block_title{align-items:flex-end;display:flex;flex-direction:row;font-size:16px;font-style:normal;font-weight:700;gap:8px;line-height:normal}.block_selected{background:var(--primary)!important;border:1px solid var(--primary)!important;box-shadow:var(--large-shadow)!important;color:var(--white)!important}.full_stretch{align-self:stretch}.population p{color:var(--medium);font-size:12px;font-weight:400;line-height:14px}.block_selected>.block_content>.card_head>.population p,.block_selected>.block_content>.card_head>.population svg{color:var(--white)!important}.home_subtitle{color:var(--dark);font-size:14px;font-style:normal;font-weight:400;line-height:160%}.category_container{border-top:1.5px solid var(--light);padding:24px 0;position:relative}.category_label{align-items:center;background:var(--lightest);border-radius:4px;display:flex;gap:8px;left:24px;padding:4px 12px;position:absolute;top:-14px}p.category_label{color:var(--medium);font-size:14px;font-weight:500;text-transform:uppercase}
249
344
  </style>
@@ -3,6 +3,10 @@ declare const _default: import("vue").DefineComponent<{
3
3
  type: StringConstructor;
4
4
  default: null;
5
5
  };
6
+ noTitle: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
6
10
  globalTitle: {
7
11
  type: StringConstructor;
8
12
  default: null;
@@ -54,14 +58,20 @@ declare const _default: import("vue").DefineComponent<{
54
58
  getSearchPlaceholder: import("vue").ComputedRef<any>;
55
59
  selectedBlock: import("vue").Ref<any>;
56
60
  selectBlock: (block: any) => void;
57
- filterBlocks: import("vue").ComputedRef<unknown[] | null>;
61
+ filterBlocks: any;
58
62
  getGlobalTitle: import("vue").ComputedRef<any>;
59
63
  langData: import("vue").Ref<any>;
64
+ blockCategories: import("vue").ComputedRef<import("vue").Ref<any>>;
65
+ filterCategoryBlocks: any;
60
66
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onSelectBlock" | "update:Block")[], "onSelectBlock" | "update:Block", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
61
67
  title: {
62
68
  type: StringConstructor;
63
69
  default: null;
64
70
  };
71
+ noTitle: {
72
+ type: BooleanConstructor;
73
+ default: boolean;
74
+ };
65
75
  globalTitle: {
66
76
  type: StringConstructor;
67
77
  default: null;
@@ -113,6 +123,7 @@ declare const _default: import("vue").DefineComponent<{
113
123
  }, {
114
124
  lang: string;
115
125
  title: string;
126
+ noTitle: boolean;
116
127
  globalTitle: string;
117
128
  searchPlaceholder: string;
118
129
  globalSubtitle: string;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="arg_home_content">
3
- <div class="arg_home_blocks">
3
+ <div class="arg_home_blocks" :class="borderTop ? 'has_top_border' : ''">
4
4
  <slot name="blocks" />
5
5
  </div>
6
6
  <div class="arg_home_selected">
@@ -14,9 +14,15 @@ import {
14
14
  defineComponent
15
15
  } from "vue";
16
16
  export default defineComponent({
17
- name: "argHomeContent"
17
+ name: "argHomeContent",
18
+ props: {
19
+ borderTop: {
20
+ type: Boolean,
21
+ default: true
22
+ }
23
+ }
18
24
  });
19
25
  </script>
20
26
  <style scoped>
21
- .arg_home_content{align-items:flex-start;display:inline-flex;flex-direction:row;gap:32px;position:relative;width:100%}.arg_home_blocks{border-top:1px solid var(--light,#ececf2);padding-top:8px;width:66%}.arg_home_selected{align-self:stretch;display:flex;position:relative;width:33%}.height{height:350px}
27
+ .arg_home_content{align-items:flex-start;display:inline-flex;flex-direction:row;gap:32px;position:relative;width:100%}.arg_home_blocks{padding-top:8px;width:66%}.arg_home_blocks.has_top_border{border-top:1px solid var(--light,#ececf2)}.arg_home_selected{align-self:stretch;display:flex;position:relative;width:33%}.height{height:350px}
22
28
  </style>
@@ -1,2 +1,14 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{
2
+ borderTop: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
+ borderTop: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ }>>, {
12
+ borderTop: boolean;
13
+ }, {}>;
2
14
  export default _default;
@@ -21,9 +21,9 @@
21
21
  v-if="selected.iso"
22
22
  :iso="selected.iso"
23
23
  height="16"
24
- :emoji="selected.iso === 'ww' || selected.iso === 'eu'"
25
- ||
26
- selected.emoji
24
+ :emoji="
25
+ selected.iso === 'ww' || selected.iso === 'eu' || selected.emoji
26
+ "
27
27
  />
28
28
  <arg-flag
29
29
  v-else-if="selected.country"
@@ -54,7 +54,7 @@
54
54
  <p class="oip_filter_label"></p>
55
55
  <arg-tags set-style="gray">
56
56
  <span v-if="typeof criteria === 'object'"
57
- ><b>{{ criteria.type }}: </b>{{ criteria.value }}</span
57
+ ><b>{{ criteria?.type }}: </b>{{ criteria?.value }}</span
58
58
  >
59
59
  <span v-else>{{ criteria }} </span></arg-tags
60
60
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.71",
3
+ "version": "0.2.73",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",