pgo-ui 1.0.92 → 1.0.93
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/Radio-B-juzQE1.js +4 -0
- package/dist/{index-zHSlMjns.js → index-CSkn0YIv.js} +6381 -6346
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +40 -40
- package/dist/pgo-ui.css +1 -1
- package/package.json +1 -1
- package/src/components/pgo/CardView.vue +50 -12
- package/src/components/pgo/DataTable.vue +1 -1
- package/src/pgo-components/pages/ListView.vue +18 -1
- package/dist/Radio-5lhcYqtr.js +0 -4
package/package.json
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<!-- PDF viewer (self-contained — driven from card buttons with action="viewPdf") -->
|
|
4
|
+
<DocumentViewer
|
|
5
|
+
v-model="showViewer"
|
|
6
|
+
:src="pdfMeta.src"
|
|
7
|
+
:title="pdfMeta.title"
|
|
8
|
+
:show-download="pdfMeta.showDownload"
|
|
9
|
+
:show-print="pdfMeta.showPrint"
|
|
10
|
+
z-index="z-[99999999]"
|
|
11
|
+
/>
|
|
12
|
+
|
|
3
13
|
<!-- Loading bar -->
|
|
4
14
|
<div v-if="loading" class="w-full h-1 bg-primary/20 overflow-hidden rounded">
|
|
5
15
|
<div class="h-full bg-primary animate-[indeterminate_1.5s_infinite_ease-in-out] w-1/3 rounded" />
|
|
@@ -155,11 +165,12 @@
|
|
|
155
165
|
</template>
|
|
156
166
|
|
|
157
167
|
<script setup>
|
|
158
|
-
import { computed, inject } from 'vue'
|
|
168
|
+
import { computed, inject, ref } from 'vue'
|
|
159
169
|
import Card from './Card.vue'
|
|
160
170
|
import Chip from './buttons/Chip.vue'
|
|
161
171
|
import Button from './Button.vue'
|
|
162
172
|
import Pagination from './Pagination.vue'
|
|
173
|
+
import DocumentViewer from './DocumentViewer.vue'
|
|
163
174
|
|
|
164
175
|
const { language } = inject('i18n')
|
|
165
176
|
|
|
@@ -204,6 +215,15 @@
|
|
|
204
215
|
|
|
205
216
|
const emit = defineEmits(['update:options', 'card-click', 'action-click'])
|
|
206
217
|
|
|
218
|
+
// --- PDF viewer state (driven by buttons with action="viewPdf") ---
|
|
219
|
+
const showViewer = ref(false)
|
|
220
|
+
const pdfMeta = ref({
|
|
221
|
+
src: '',
|
|
222
|
+
title: '',
|
|
223
|
+
showDownload: true,
|
|
224
|
+
showPrint: true,
|
|
225
|
+
})
|
|
226
|
+
|
|
207
227
|
// --- Computed ---
|
|
208
228
|
const stacks = computed(() => props.settings?.cardLayout?.stacks || [])
|
|
209
229
|
|
|
@@ -313,24 +333,42 @@
|
|
|
313
333
|
})
|
|
314
334
|
}
|
|
315
335
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
let url
|
|
336
|
+
/**
|
|
337
|
+
* @param {Record<string, any>} item
|
|
338
|
+
* @param {Record<string, any>} field
|
|
339
|
+
*/
|
|
340
|
+
const resolveButtonUrl = (item, field) => {
|
|
341
|
+
if (!field.linkKey) { return null }
|
|
323
342
|
const linkKey = String(field.linkKey)
|
|
324
343
|
if (linkKey.startsWith('/') || linkKey.startsWith('http')) {
|
|
325
344
|
// URL template — interpolate :param and {param} placeholders with item values
|
|
326
|
-
|
|
345
|
+
return field.linkKey
|
|
327
346
|
.replace(/:(\w+)/g, (_, key) => item[key] ?? key)
|
|
328
347
|
.replace(/\{(\w+)\}/g, (_, key) => item[key] ?? key)
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
348
|
+
}
|
|
349
|
+
// Data path — extract URL from item
|
|
350
|
+
return getNestedValue(item, field.linkKey)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const handleActionClick = (item, field) => {
|
|
354
|
+
const url = resolveButtonUrl(item, field)
|
|
355
|
+
|
|
356
|
+
// PDF viewer action — handled locally, does not bubble to ListView
|
|
357
|
+
if (field.action === 'viewPdf') {
|
|
358
|
+
if (!url) { return }
|
|
359
|
+
pdfMeta.value = {
|
|
360
|
+
src: url,
|
|
361
|
+
title: field.titleKey
|
|
362
|
+
? (getNestedValue(item, field.titleKey) ?? resolveLocalizedValue(field.label))
|
|
363
|
+
: resolveLocalizedValue(field.label),
|
|
364
|
+
showDownload: field.showDownload ?? true,
|
|
365
|
+
showPrint: field.showPrint ?? true,
|
|
366
|
+
}
|
|
367
|
+
showViewer.value = true
|
|
368
|
+
return
|
|
332
369
|
}
|
|
333
370
|
|
|
371
|
+
// Default: bubble up so ListView can router.push / window.open
|
|
334
372
|
emit('action-click', { item, field, url })
|
|
335
373
|
}
|
|
336
374
|
</script>
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
]"
|
|
213
213
|
>
|
|
214
214
|
<template v-if="getCustomColumnData(header, item)?.type === 'CopyTextBox'">
|
|
215
|
-
<div :class="['flex flex-wrap
|
|
215
|
+
<div :class="['flex flex-wrap gap-1 font-en', header.columnView ? 'flex-col' : 'flex-row items-center', ]">
|
|
216
216
|
<template
|
|
217
217
|
v-for="(chip, idx) in getCustomColumnData(header, item).CopyTextBox"
|
|
218
218
|
:key="idx"
|
|
@@ -654,7 +654,24 @@ const handleFormSubmit = (msg) => {
|
|
|
654
654
|
fetchData({ page: options.value.page, per_page: options.value.itemsPerPage })
|
|
655
655
|
}
|
|
656
656
|
const handleRefresh = (msg) => {
|
|
657
|
-
|
|
657
|
+
quickFilterValues.value = {}
|
|
658
|
+
filterSectionValues.value = {}
|
|
659
|
+
|
|
660
|
+
// Reset options to initial state
|
|
661
|
+
options.value = {
|
|
662
|
+
...options.value,
|
|
663
|
+
page: 1,
|
|
664
|
+
sortBy: [],
|
|
665
|
+
sortDesc: [],
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
const queryParams = {
|
|
669
|
+
page: 1,
|
|
670
|
+
per_page: options.value.itemsPerPage
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
fetchData(queryParams)
|
|
674
|
+
syncQueryParams(queryParams) // This removes filter/sort from URL since they're not in queryParams
|
|
658
675
|
}
|
|
659
676
|
// Handle quick search from searchbar
|
|
660
677
|
const handleQuickSearch = (filters) => {
|
package/dist/Radio-5lhcYqtr.js
DELETED