@ramathibodi/nuxt-commons 4.0.21 → 4.0.22
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
|
@@ -65,14 +65,18 @@ const {
|
|
|
65
65
|
|
|
66
66
|
<template v-if="!$slots.item && props.meilisearch" #item="{ props: itemProps, item }">
|
|
67
67
|
<v-list-item v-bind="itemProps">
|
|
68
|
-
|
|
68
|
+
<!-- Vuetify's VAutocomplete #item slot passes the raw data object directly as `item`
|
|
69
|
+
(the old wrapped {raw, title, value, props} shape moved to a separate `internalItem`
|
|
70
|
+
param) -- `item.raw ?? item` handles both shapes, same defensive fallback
|
|
71
|
+
formatItemTitle already uses. -->
|
|
72
|
+
<template #title v-if="(item.raw ?? item)?._formatted?.itemValue">
|
|
69
73
|
<span v-html="formatItemTitle(item)" class="meilisearch-item"></span>
|
|
70
74
|
</template>
|
|
71
75
|
</v-list-item>
|
|
72
76
|
</template>
|
|
73
77
|
|
|
74
78
|
<template v-if="!$slots.selection && props.showCode" #selection="{ item }">
|
|
75
|
-
{{ formatItemTitle(item) }}
|
|
79
|
+
{{ formatItemTitle(item, { plain: true }) }}
|
|
76
80
|
</template>
|
|
77
81
|
</model-autocomplete>
|
|
78
82
|
</template>
|
|
@@ -65,14 +65,18 @@ const {
|
|
|
65
65
|
|
|
66
66
|
<template v-if="!$slots.item && props.meilisearch" #item="{ props: itemProps, item }">
|
|
67
67
|
<v-list-item v-bind="itemProps">
|
|
68
|
-
|
|
68
|
+
<!-- Vuetify's VCombobox #item slot passes the raw data object directly as `item`
|
|
69
|
+
(the old wrapped {raw, title, value, props} shape moved to a separate `internalItem`
|
|
70
|
+
param) -- `item.raw ?? item` handles both shapes, same defensive fallback
|
|
71
|
+
formatItemTitle already uses. -->
|
|
72
|
+
<template #title v-if="(item.raw ?? item)?._formatted?.itemValue">
|
|
69
73
|
<span v-html="formatItemTitle(item)" class="meilisearch-item"></span>
|
|
70
74
|
</template>
|
|
71
75
|
</v-list-item>
|
|
72
76
|
</template>
|
|
73
77
|
|
|
74
78
|
<template v-if="!$slots.selection && props.showCode" #selection="{ item }">
|
|
75
|
-
{{ formatItemTitle(item) }}
|
|
79
|
+
{{ formatItemTitle(item, { plain: true }) }}
|
|
76
80
|
</template>
|
|
77
81
|
</model-combobox>
|
|
78
82
|
</template>
|
|
@@ -30,5 +30,7 @@ export declare function useLookupListMaster(props: MasterLikeProps): {
|
|
|
30
30
|
itemTitleField: import("vue").ComputedRef<"itemValue" | "itemValueAlternative">;
|
|
31
31
|
computedNoDataText: import("vue").ComputedRef<string | undefined>;
|
|
32
32
|
computedSortBy: import("vue").ComputedRef<string[]>;
|
|
33
|
-
formatItemTitle: (item: any
|
|
33
|
+
formatItemTitle: (item: any, opts?: {
|
|
34
|
+
plain?: boolean;
|
|
35
|
+
}) => string;
|
|
34
36
|
};
|
|
@@ -30,10 +30,10 @@ export function useLookupListMaster(props) {
|
|
|
30
30
|
props.fields || []
|
|
31
31
|
);
|
|
32
32
|
});
|
|
33
|
-
const formatItemTitle = (item) => {
|
|
33
|
+
const formatItemTitle = (item, opts = {}) => {
|
|
34
34
|
const raw = item?.raw ?? item ?? {};
|
|
35
35
|
const resolvedTitle = item?.title || raw?.[itemTitleField.value] || raw?.itemValue || raw?.itemCode;
|
|
36
|
-
if (props.meilisearch) {
|
|
36
|
+
if (props.meilisearch && !opts.plain) {
|
|
37
37
|
const formatted = raw?._formatted ?? {};
|
|
38
38
|
const code = formatted?.itemCode ?? raw?.itemCode;
|
|
39
39
|
const title = formatted?.[itemTitleField.value] || formatted?.itemValue || formatted?.itemCode || resolvedTitle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ramathibodi/nuxt-commons",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.22",
|
|
4
4
|
"description": "Ramathibodi Nuxt modules for common components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"vue-codemirror": "^6.1.1",
|
|
115
115
|
"vue-json-pretty": "^2.6.0",
|
|
116
116
|
"vue-signature-pad": "^3.0.2",
|
|
117
|
-
"vuetify": "^4.
|
|
117
|
+
"vuetify": "^4.2.2",
|
|
118
118
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|