@tekkare/auriga 0.2.192 → 0.2.198

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.
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <div class="arg_resource_card">
3
+ <div v-if="!hideProvider && data.provider" class="arg_resource_card_provider">
4
+ <arg-icon :name="data.icon || 'FileText'" size="14" color="var(--primary)" />
5
+ <span>{{ data.provider }}</span>
6
+ </div>
7
+ <p class="arg_resource_card_title">{{ data.title || "Untitled" }}</p>
8
+ <div class="arg_resource_card_meta">
9
+ <span v-if="data.identification" class="arg_resource_card_id">
10
+ {{ data.identification }}
11
+ </span>
12
+ <span v-if="data.identification && data.publication_date" class="arg_resource_card_dot">
13
+ ·
14
+ </span>
15
+ <arg-date
16
+ v-if="data.publication_date"
17
+ :raw-date="data.publication_date"
18
+ lang="en"
19
+ compact
20
+ />
21
+ </div>
22
+ <div v-if="data.source" class="arg_resource_card_source">
23
+ <arg-tags :set-style="data.source.flag || 'blue'">
24
+ {{ data.source.label }}
25
+ </arg-tags>
26
+ </div>
27
+ <div class="arg_resource_card_actions">
28
+ <button
29
+ class="arg_resource_card_action_btn arg_resource_card_action_danger"
30
+ title="Remove"
31
+ @click="emit('onRemove', data)"
32
+ >
33
+ <arg-icon name="Trash" size="16" color="currentColor" />
34
+ </button>
35
+ <button
36
+ class="arg_resource_card_action_btn"
37
+ title="Annotate"
38
+ @click="emit('onAnnotate', data)"
39
+ >
40
+ <arg-icon name="PencilSimple" size="16" color="currentColor" />
41
+ <span v-if="data.countAnnotation" class="arg_resource_card_badge">
42
+ {{ data.countAnnotation }}
43
+ </span>
44
+ </button>
45
+ <button
46
+ class="arg_resource_card_action_btn arg_resource_card_action_primary"
47
+ title="Open"
48
+ @click="emit('onOpen', data)"
49
+ >
50
+ <arg-icon name="ArrowSquareOut" size="16" color="currentColor" />
51
+ </button>
52
+ </div>
53
+ </div>
54
+ </template>
55
+
56
+ <script setup lang="ts">
57
+ interface ResourceItem {
58
+ id: string;
59
+ title: string;
60
+ identification?: string;
61
+ publication_date?: string;
62
+ source?: { flag: string; label: string };
63
+ resourceType?: string;
64
+ card_link?: string;
65
+ resource_link?: string;
66
+ countAnnotation?: number;
67
+ countryName?: string;
68
+ price?: number;
69
+ priceVariation?: number;
70
+ currency?: string;
71
+ currencySymbol?: string;
72
+ atcCode?: string;
73
+ manufacturer?: string;
74
+ diagnosisLabel?: string;
75
+ diagnosisType?: string;
76
+ year?: string;
77
+ hospitalizations?: number | null;
78
+ cancerCode?: string;
79
+ cases?: number | null;
80
+ rate?: number | null;
81
+ metricType?: string;
82
+ geneName?: string;
83
+ linkedCount?: number;
84
+ linkedLabel?: string;
85
+ icd10Codes?: string[];
86
+ provider?: string;
87
+ icon?: string;
88
+ }
89
+
90
+ withDefaults(
91
+ defineProps<{
92
+ data: ResourceItem;
93
+ hideProvider?: boolean;
94
+ }>(),
95
+ {
96
+ hideProvider: false,
97
+ }
98
+ );
99
+
100
+ const emit = defineEmits<{
101
+ onRemove: [item: ResourceItem];
102
+ onAnnotate: [item: ResourceItem];
103
+ onOpen: [item: ResourceItem];
104
+ }>();
105
+ </script>
106
+
107
+ <style scoped>
108
+ .arg_resource_card{background:var(--base-white,#fff);border:1px solid var(--light,#ececf2);border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:16px;transition:box-shadow .15s ease,border-color .15s ease}.arg_resource_card:hover{border-color:var(--primary,#2176ff);box-shadow:0 2px 8px rgba(33,118,255,.08)}.arg_resource_card_provider{align-items:center;color:var(--primary,#2176ff);display:flex;font-size:12px;font-weight:600;gap:6px;letter-spacing:.5px;text-transform:uppercase}.arg_resource_card_title{color:var(--darkest,#1a1a2e);display:-webkit-box;font-size:14px;font-weight:600;line-height:1.4;margin:0;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.arg_resource_card_meta{align-items:center;color:var(--dark,#6c6c8a);display:flex;font-size:12px;gap:6px}.arg_resource_card_id{font-weight:500}.arg_resource_card_dot,.arg_resource_card_id{color:var(--medium,#9999b0)}.arg_resource_card_actions,.arg_resource_card_source{align-items:center;display:flex}.arg_resource_card_actions{border-top:1px solid var(--light,#ececf2);gap:4px;margin-top:4px;padding-top:8px}.arg_resource_card_action_btn{align-items:center;background:transparent;border:1px solid var(--light,#ececf2);border-radius:8px;color:var(--dark,#6c6c8a);cursor:pointer;display:flex;height:32px;justify-content:center;position:relative;transition:all .15s ease;width:32px}.arg_resource_card_action_btn:hover{background:var(--lightest,#f5f5fa);border-color:var(--medium,#9999b0)}.arg_resource_card_action_danger:hover{background:#fef2f2;border-color:#e74c3c;color:#e74c3c}.arg_resource_card_action_primary:hover{background:rgba(33,118,255,.05);border-color:var(--primary,#2176ff);color:var(--primary,#2176ff)}.arg_resource_card_badge{align-items:center;background:var(--primary,#2176ff);border-radius:8px;color:#fff;display:flex;font-size:10px;font-weight:700;height:16px;justify-content:center;min-width:16px;padding:0 4px;position:absolute;right:-4px;top:-4px}
109
+ </style>
@@ -0,0 +1,302 @@
1
+ <template>
2
+ <div class="arg_resource_table">
3
+ <arg-table
4
+ :heads="columnHeaders"
5
+ :contents="tableContents"
6
+ :column-type="columnTypes"
7
+ :column-style="columnStyle"
8
+ :full-table-scroll="true"
9
+ :max-height="maxHeight"
10
+ :sort="true"
11
+ >
12
+ <template #Source="{ value }">
13
+ <arg-tags v-if="value && value.label" :set-style="value.flag || 'blue'">
14
+ {{ value.label }}
15
+ </arg-tags>
16
+ <span v-else class="arg_resource_table_empty">—</span>
17
+ </template>
18
+
19
+ <template #Date="{ value }">
20
+ <arg-date v-if="value" :raw-date="value" lang="en" compact />
21
+ <span v-else class="arg_resource_table_empty">—</span>
22
+ </template>
23
+
24
+ <template #Price="{ value }">
25
+ <span v-if="value && value.amount != null" class="arg_resource_table_price">
26
+ {{ value.symbol || '' }}{{ formatNumber(value.amount) }}
27
+ <span v-if="value.variation != null" :class="value.variation >= 0 ? 'arg_resource_table_up' : 'arg_resource_table_down'">
28
+ {{ value.variation >= 0 ? '+' : '' }}{{ value.variation.toFixed(1) }}%
29
+ </span>
30
+ </span>
31
+ <span v-else class="arg_resource_table_empty">—</span>
32
+ </template>
33
+
34
+ <template #Number="{ value }">
35
+ <span v-if="value != null">{{ formatNumber(value) }}</span>
36
+ <span v-else class="arg_resource_table_empty">—</span>
37
+ </template>
38
+
39
+ <template #Tags="{ value }">
40
+ <div v-if="value && value.length" class="arg_resource_table_tags">
41
+ <arg-tags v-for="(tag, i) in value.slice(0, 3)" :key="i" set-style="gray">
42
+ {{ tag }}
43
+ </arg-tags>
44
+ <span v-if="value.length > 3" class="arg_resource_table_more">+{{ value.length - 3 }}</span>
45
+ </div>
46
+ <span v-else class="arg_resource_table_empty">—</span>
47
+ </template>
48
+
49
+ <template #Actions="{ value }">
50
+ <div class="arg_resource_table_actions">
51
+ <button
52
+ class="arg_resource_table_action_btn"
53
+ title="Remove"
54
+ @click="emit('onRemove', value)"
55
+ >
56
+ <arg-icon name="Trash" size="16" color="var(--dark)" />
57
+ </button>
58
+ <button
59
+ class="arg_resource_table_action_btn"
60
+ title="Annotate"
61
+ @click="emit('onAnnotate', value)"
62
+ >
63
+ <arg-icon name="PencilSimple" size="16" color="var(--dark)" />
64
+ <span v-if="value.countAnnotation" class="arg_resource_table_badge">
65
+ {{ value.countAnnotation }}
66
+ </span>
67
+ </button>
68
+ <button
69
+ class="arg_resource_table_action_btn"
70
+ title="Open"
71
+ @click="emit('onOpen', value)"
72
+ >
73
+ <arg-icon name="ArrowSquareOut" size="16" color="var(--primary)" />
74
+ </button>
75
+ </div>
76
+ </template>
77
+ </arg-table>
78
+ </div>
79
+ </template>
80
+
81
+ <script setup lang="ts">
82
+ import { computed } from "vue";
83
+
84
+ export interface ResourceItem {
85
+ id: string;
86
+ title: string;
87
+ identification?: string;
88
+ publication_date?: string;
89
+ source?: { flag: string; label: string };
90
+ resourceType?: string;
91
+ card_link?: string;
92
+ resource_link?: string;
93
+ countAnnotation?: number;
94
+ countryName?: string;
95
+ price?: number;
96
+ priceVariation?: number;
97
+ currency?: string;
98
+ currencySymbol?: string;
99
+ atcCode?: string;
100
+ manufacturer?: string;
101
+ diagnosisLabel?: string;
102
+ diagnosisType?: string;
103
+ year?: string;
104
+ hospitalizations?: number | null;
105
+ cancerCode?: string;
106
+ cases?: number | null;
107
+ rate?: number | null;
108
+ metricType?: string;
109
+ geneName?: string;
110
+ linkedCount?: number;
111
+ linkedLabel?: string;
112
+ icd10Codes?: string[];
113
+ provider?: string;
114
+ icon?: string;
115
+ }
116
+
117
+ type Variant =
118
+ | "default"
119
+ | "drugPrices"
120
+ | "approvals"
121
+ | "hospitalization"
122
+ | "incidence"
123
+ | "gene"
124
+ | "disease";
125
+
126
+ const props = withDefaults(
127
+ defineProps<{
128
+ data: ResourceItem[];
129
+ variant?: Variant;
130
+ showSourceTag?: boolean;
131
+ maxHeight?: number;
132
+ }>(),
133
+ {
134
+ variant: "default",
135
+ showSourceTag: false,
136
+ maxHeight: 200,
137
+ }
138
+ );
139
+
140
+ const emit = defineEmits<{
141
+ onRemove: [item: ResourceItem];
142
+ onAnnotate: [item: ResourceItem];
143
+ onOpen: [item: ResourceItem];
144
+ }>();
145
+
146
+ interface ColumnConfig {
147
+ header: string;
148
+ type: string;
149
+ size?: string;
150
+ align?: string;
151
+ getValue: (item: ResourceItem) => any;
152
+ }
153
+
154
+ const variantColumns = computed<ColumnConfig[]>(() => {
155
+ switch (props.variant) {
156
+ case "drugPrices":
157
+ return [
158
+ { header: "Title", type: "", size: "3", align: "", getValue: (i) => i.title || "—" },
159
+ { header: "Country", type: "", size: "1", align: "", getValue: (i) => i.countryName || "—" },
160
+ {
161
+ header: "Price",
162
+ type: "Price",
163
+ size: "1",
164
+ align: "",
165
+ getValue: (i) => ({
166
+ amount: i.price,
167
+ variation: i.priceVariation,
168
+ symbol: i.currencySymbol || i.currency || "",
169
+ }),
170
+ },
171
+ { header: "ATC Code", type: "", size: "1", align: "", getValue: (i) => i.atcCode || "—" },
172
+ { header: "Date", type: "Date", size: "1", align: "", getValue: (i) => i.publication_date },
173
+ { header: "Actions", type: "Actions", size: "1", align: "center", getValue: (i) => i },
174
+ ];
175
+
176
+ case "approvals":
177
+ return [
178
+ { header: "Title", type: "", size: "3", align: "", getValue: (i) => i.title || "—" },
179
+ { header: "ATC", type: "", size: "1", align: "", getValue: (i) => i.atcCode || "—" },
180
+ { header: "Manufacturer", type: "", size: "1", align: "", getValue: (i) => i.manufacturer || "—" },
181
+ { header: "Date", type: "Date", size: "1", align: "", getValue: (i) => i.publication_date },
182
+ {
183
+ header: "Source",
184
+ type: "Source",
185
+ size: "1",
186
+ align: "",
187
+ getValue: (i) => i.source,
188
+ },
189
+ { header: "Actions", type: "Actions", size: "1", align: "center", getValue: (i) => i },
190
+ ];
191
+
192
+ case "hospitalization":
193
+ return [
194
+ { header: "Country", type: "", size: "2", align: "", getValue: (i) => i.countryName || "—" },
195
+ { header: "Diagnosis", type: "", size: "2", align: "", getValue: (i) => i.diagnosisLabel || "—" },
196
+ { header: "Type", type: "", size: "1", align: "", getValue: (i) => i.diagnosisType || "—" },
197
+ { header: "Year", type: "", size: "1", align: "", getValue: (i) => i.year || "—" },
198
+ {
199
+ header: "Hospitalizations",
200
+ type: "Number",
201
+ size: "1",
202
+ align: "right",
203
+ getValue: (i) => i.hospitalizations,
204
+ },
205
+ { header: "Actions", type: "Actions", size: "1", align: "center", getValue: (i) => i },
206
+ ];
207
+
208
+ case "incidence":
209
+ return [
210
+ { header: "Country", type: "", size: "2", align: "", getValue: (i) => i.countryName || "—" },
211
+ { header: "Cancer", type: "", size: "2", align: "", getValue: (i) => i.cancerCode || i.title || "—" },
212
+ { header: "Type", type: "", size: "1", align: "", getValue: (i) => i.metricType || "—" },
213
+ { header: "Year", type: "", size: "1", align: "", getValue: (i) => i.year || "—" },
214
+ { header: "Cases", type: "Number", size: "1", align: "right", getValue: (i) => i.cases },
215
+ { header: "Actions", type: "Actions", size: "1", align: "center", getValue: (i) => i },
216
+ ];
217
+
218
+ case "gene":
219
+ return [
220
+ { header: "Symbol", type: "", size: "1", align: "", getValue: (i) => i.identification || i.id },
221
+ { header: "Name", type: "", size: "3", align: "", getValue: (i) => i.geneName || i.title || "—" },
222
+ {
223
+ header: "Linked Diseases",
224
+ type: "Number",
225
+ size: "1",
226
+ align: "right",
227
+ getValue: (i) => i.linkedCount,
228
+ },
229
+ { header: "Actions", type: "Actions", size: "1", align: "center", getValue: (i) => i },
230
+ ];
231
+
232
+ case "disease":
233
+ return [
234
+ { header: "Name", type: "", size: "3", align: "", getValue: (i) => i.title || "—" },
235
+ {
236
+ header: "ICD10",
237
+ type: "Tags",
238
+ size: "2",
239
+ align: "",
240
+ getValue: (i) => i.icd10Codes || [],
241
+ },
242
+ {
243
+ header: "Linked Genes",
244
+ type: "Number",
245
+ size: "1",
246
+ align: "right",
247
+ getValue: (i) => i.linkedCount,
248
+ },
249
+ { header: "Actions", type: "Actions", size: "1", align: "center", getValue: (i) => i },
250
+ ];
251
+
252
+ default: {
253
+ const cols: ColumnConfig[] = [
254
+ { header: "Title", type: "", size: "3", align: "", getValue: (i) => i.title || "—" },
255
+ { header: "ID", type: "", size: "1", align: "", getValue: (i) => i.identification || "—" },
256
+ { header: "Date", type: "Date", size: "1", align: "", getValue: (i) => i.publication_date },
257
+ ];
258
+ if (props.showSourceTag) {
259
+ cols.push({
260
+ header: "Source",
261
+ type: "Source",
262
+ size: "1",
263
+ align: "",
264
+ getValue: (i) => i.source,
265
+ });
266
+ }
267
+ cols.push({
268
+ header: "Actions",
269
+ type: "Actions",
270
+ size: "1",
271
+ align: "center",
272
+ getValue: (i) => i,
273
+ });
274
+ return cols;
275
+ }
276
+ }
277
+ });
278
+
279
+ const columnHeaders = computed(() => variantColumns.value.map((c) => c.header));
280
+
281
+ const columnTypes = computed(() => variantColumns.value.map((c) => c.type));
282
+
283
+ const columnStyle = computed(() => ({
284
+ size: variantColumns.value.map((c) => c.size || ""),
285
+ align: variantColumns.value.map((c) => c.align || ""),
286
+ }));
287
+
288
+ const tableContents = computed(() =>
289
+ props.data.map((item) => ({
290
+ values: variantColumns.value.map((col) => col.getValue(item)),
291
+ }))
292
+ );
293
+
294
+ function formatNumber(value: number | null | undefined): string {
295
+ if (value == null) return "—";
296
+ return value.toLocaleString();
297
+ }
298
+ </script>
299
+
300
+ <style scoped>
301
+ .arg_resource_table{width:100%}.arg_resource_table_empty{color:var(--medium,#9999b0)}.arg_resource_table_price{align-items:center;display:inline-flex;font-weight:500;gap:6px}.arg_resource_table_up{color:var(--system-success,#2ecc71);font-size:12px;font-weight:600}.arg_resource_table_down{color:#e74c3c;font-size:12px;font-weight:600}.arg_resource_table_tags{align-items:center;display:flex;flex-wrap:wrap;gap:4px}.arg_resource_table_more{color:var(--dark,#6c6c8a);font-size:12px;font-weight:600}.arg_resource_table_actions{align-items:center;display:flex;gap:4px;justify-content:center}.arg_resource_table_action_btn{align-items:center;background:transparent;border:none;border-radius:6px;cursor:pointer;display:flex;height:28px;justify-content:center;position:relative;transition:background .15s ease;width:28px}.arg_resource_table_action_btn:hover{background:var(--lightest,#f5f5fa)}.arg_resource_table_badge{align-items:center;background:var(--primary,#2176ff);border-radius:8px;color:#fff;display:flex;font-size:10px;font-weight:700;height:16px;justify-content:center;min-width:16px;padding:0 4px;position:absolute;right:-2px;top:-2px}
302
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.192",
3
+ "version": "0.2.198",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,6 +39,7 @@
39
39
  "@vueuse/integrations": "^10.11.1",
40
40
  "apexcharts": "^3.54.1",
41
41
  "fuse.js": "^6.6.2",
42
+ "muuri": "^0.9.5",
42
43
  "posthog-js": "^1.222.0",
43
44
  "save": "^2.9.0",
44
45
  "vue-apexcharts": "^1.7.0",