@feedmepos/ui-library 1.2.30 → 1.2.31
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/components/form/search/FmSearch.vue.d.ts +4 -0
- package/dist/components/form/textarea/FmTextarea.vue.d.ts +4 -0
- package/dist/components/table/FmTable.vue.d.ts +3 -0
- package/dist/components.d.ts +47 -0
- package/dist/composables/useAutoFocus.d.ts +2 -0
- package/dist/federation/{FmGlobalSearch.vue_vue_type_script_setup_true_lang-Eu3X-PGk.js → FmGlobalSearch.vue_vue_type_script_setup_true_lang-BASrRQMX.js} +1 -1
- package/dist/federation/{FmPhoneNumber.vue_vue_type_script_setup_true_lang-Bj9A0_qy.js → FmPhoneNumber.vue_vue_type_script_setup_true_lang-BLIJ32sc.js} +1 -1
- package/dist/federation/FmSearch.vue_vue_type_script_setup_true_lang-DMc1vDz2.js +1 -0
- package/dist/federation/{FmTable.vue_vue_type_script_setup_true_lang-D4GqtkAY.js → FmTable.vue_vue_type_script_setup_true_lang-B1SlKr8d.js} +1 -1
- package/dist/federation/{FmTableToolbar.vue_vue_type_script_setup_true_lang-Btesq81G.js → FmTableToolbar.vue_vue_type_script_setup_true_lang-pmCdCxcT.js} +1 -1
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-DvdNX7mX.js +1 -0
- package/dist/federation/{__federation_expose_FmGlobalSearch-CC_AzLGM.js → __federation_expose_FmGlobalSearch-nsuxEgld.js} +1 -1
- package/dist/federation/{__federation_expose_FmPhoneNumber-DUWHZ9wB.js → __federation_expose_FmPhoneNumber-2488aeBq.js} +1 -1
- package/dist/federation/{__federation_expose_FmSearch-_joJdfNB.js → __federation_expose_FmSearch-BJ6TtDLp.js} +1 -1
- package/dist/federation/{__federation_expose_FmTable-BjeUAAOB.js → __federation_expose_FmTable-D8wo7Rpm.js} +1 -1
- package/dist/federation/{__federation_expose_FmTableToolbar-Eu5qkLmM.js → __federation_expose_FmTableToolbar-CyNcXW8L.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextField-BvWtIEv-.js → __federation_expose_FmTextField-DQCMNrag.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextarea-AqSwF6g8.css → __federation_expose_FmTextarea-BFVTlegr.css} +1 -1
- package/dist/federation/__federation_expose_FmTextarea-DmiG4lPv.js +1 -0
- package/dist/federation/feedmepos-ui-components.js +1 -1
- package/dist/federation/{index-DJlSci5n.js → index-C28AdDkW.js} +2 -2
- package/dist/federation/useAutoFocus-DgRawOoa.js +1 -0
- package/dist/feedmepos-ui-library.js +4814 -4794
- package/dist/feedmepos-ui-library.umd.cjs +24 -24
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/federation/FmSearch.vue_vue_type_script_setup_true_lang-CvSCemCy.js +0 -1
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-D93so0Mw.js +0 -1
- package/dist/federation/__federation_expose_FmTextarea-CGzV_er4.js +0 -1
|
@@ -16,6 +16,7 @@ export interface FmSearchProps extends FormChildProps {
|
|
|
16
16
|
/** Collapse component into search icon instead when empty */
|
|
17
17
|
collapsible?: boolean;
|
|
18
18
|
maxWidth?: string | number;
|
|
19
|
+
autofocus?: boolean;
|
|
19
20
|
}
|
|
20
21
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FmSearchProps>, {
|
|
21
22
|
label: string;
|
|
@@ -39,6 +40,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
39
40
|
showWordCount: boolean;
|
|
40
41
|
collapsible: boolean;
|
|
41
42
|
maxWidth: undefined;
|
|
43
|
+
autofocus: boolean;
|
|
42
44
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FmSearchProps>, {
|
|
43
45
|
label: string;
|
|
44
46
|
disabled: undefined;
|
|
@@ -61,6 +63,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
61
63
|
showWordCount: boolean;
|
|
62
64
|
collapsible: boolean;
|
|
63
65
|
maxWidth: undefined;
|
|
66
|
+
autofocus: boolean;
|
|
64
67
|
}>>>, {
|
|
65
68
|
label: string;
|
|
66
69
|
disabled: boolean;
|
|
@@ -77,6 +80,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
77
80
|
inputmode: "text" | "none" | "search" | "email" | "tel" | "url" | "decimal" | "numeric";
|
|
78
81
|
readonly: boolean;
|
|
79
82
|
showWordCount: boolean;
|
|
83
|
+
autofocus: boolean;
|
|
80
84
|
showSuccess: boolean;
|
|
81
85
|
prependText: string;
|
|
82
86
|
appendText: string;
|
|
@@ -12,6 +12,7 @@ export interface FmTextareaProps extends FormChildProps {
|
|
|
12
12
|
helperText?: string;
|
|
13
13
|
helperState?: 'success' | 'warning' | 'error' | 'none';
|
|
14
14
|
showWordCount?: boolean;
|
|
15
|
+
autofocus?: boolean;
|
|
15
16
|
}
|
|
16
17
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FmTextareaProps>, {
|
|
17
18
|
label: string;
|
|
@@ -30,6 +31,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
30
31
|
showValidBorder: boolean;
|
|
31
32
|
labelInfo: string;
|
|
32
33
|
showWordCount: boolean;
|
|
34
|
+
autofocus: boolean;
|
|
33
35
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
36
|
"update:modelValue": (value: string) => void;
|
|
35
37
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FmTextareaProps>, {
|
|
@@ -49,6 +51,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
49
51
|
showValidBorder: boolean;
|
|
50
52
|
labelInfo: string;
|
|
51
53
|
showWordCount: boolean;
|
|
54
|
+
autofocus: boolean;
|
|
52
55
|
}>>> & {
|
|
53
56
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
54
57
|
}, {
|
|
@@ -67,6 +70,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
67
70
|
maxLength: number;
|
|
68
71
|
readonly: boolean;
|
|
69
72
|
showWordCount: boolean;
|
|
73
|
+
autofocus: boolean;
|
|
70
74
|
showSuccess: boolean;
|
|
71
75
|
}, {}>, {
|
|
72
76
|
label?(_: {}): any;
|
|
@@ -62,6 +62,8 @@ export interface FmTableProps {
|
|
|
62
62
|
wholeRowDraggable?: boolean;
|
|
63
63
|
/** expanded state */
|
|
64
64
|
expandedState?: ExpandedState;
|
|
65
|
+
/** custom function to decide if row can expand */
|
|
66
|
+
getRowCanExpand?: (row: Row<any>) => boolean;
|
|
65
67
|
/** Customize subRow attribute */
|
|
66
68
|
getSubRow?: (row: any) => undefined | any[];
|
|
67
69
|
onVuedraggableMove: (context: {
|
|
@@ -153,6 +155,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
153
155
|
pinHeaderRow: boolean;
|
|
154
156
|
onRowClick: (row: Row<any>) => void;
|
|
155
157
|
shrinkAt: number | false | Breakpoints;
|
|
158
|
+
getRowCanExpand: (row: Row<any>) => boolean;
|
|
156
159
|
getSubRow: (row: any) => any[] | undefined;
|
|
157
160
|
onVuedraggableMove: (context: {
|
|
158
161
|
draggedContext: {
|
package/dist/components.d.ts
CHANGED
|
@@ -6930,6 +6930,10 @@ export declare const components: {
|
|
|
6930
6930
|
type: import("vue").PropType<boolean>;
|
|
6931
6931
|
default: boolean;
|
|
6932
6932
|
};
|
|
6933
|
+
autofocus: {
|
|
6934
|
+
type: import("vue").PropType<boolean>;
|
|
6935
|
+
default: boolean;
|
|
6936
|
+
};
|
|
6933
6937
|
showSuccess: {
|
|
6934
6938
|
type: import("vue").PropType<boolean>;
|
|
6935
6939
|
default: boolean;
|
|
@@ -7014,6 +7018,10 @@ export declare const components: {
|
|
|
7014
7018
|
type: import("vue").PropType<boolean>;
|
|
7015
7019
|
default: boolean;
|
|
7016
7020
|
};
|
|
7021
|
+
autofocus: {
|
|
7022
|
+
type: import("vue").PropType<boolean>;
|
|
7023
|
+
default: boolean;
|
|
7024
|
+
};
|
|
7017
7025
|
showSuccess: {
|
|
7018
7026
|
type: import("vue").PropType<boolean>;
|
|
7019
7027
|
default: boolean;
|
|
@@ -7046,6 +7054,7 @@ export declare const components: {
|
|
|
7046
7054
|
inputmode: "text" | "none" | "search" | "email" | "tel" | "url" | "decimal" | "numeric";
|
|
7047
7055
|
readonly: boolean;
|
|
7048
7056
|
showWordCount: boolean;
|
|
7057
|
+
autofocus: boolean;
|
|
7049
7058
|
showSuccess: boolean;
|
|
7050
7059
|
prependText: string;
|
|
7051
7060
|
appendText: string;
|
|
@@ -9003,6 +9012,10 @@ export declare const components: {
|
|
|
9003
9012
|
type: import("vue").PropType<boolean>;
|
|
9004
9013
|
default: boolean;
|
|
9005
9014
|
};
|
|
9015
|
+
autofocus: {
|
|
9016
|
+
type: import("vue").PropType<boolean>;
|
|
9017
|
+
default: boolean;
|
|
9018
|
+
};
|
|
9006
9019
|
showSuccess: {
|
|
9007
9020
|
type: import("vue").PropType<boolean>;
|
|
9008
9021
|
default: boolean;
|
|
@@ -9073,6 +9086,10 @@ export declare const components: {
|
|
|
9073
9086
|
type: import("vue").PropType<boolean>;
|
|
9074
9087
|
default: boolean;
|
|
9075
9088
|
};
|
|
9089
|
+
autofocus: {
|
|
9090
|
+
type: import("vue").PropType<boolean>;
|
|
9091
|
+
default: boolean;
|
|
9092
|
+
};
|
|
9076
9093
|
showSuccess: {
|
|
9077
9094
|
type: import("vue").PropType<boolean>;
|
|
9078
9095
|
default: boolean;
|
|
@@ -9095,6 +9112,7 @@ export declare const components: {
|
|
|
9095
9112
|
maxLength: number;
|
|
9096
9113
|
readonly: boolean;
|
|
9097
9114
|
showWordCount: boolean;
|
|
9115
|
+
autofocus: boolean;
|
|
9098
9116
|
showSuccess: boolean;
|
|
9099
9117
|
}, true, {}, {}, {
|
|
9100
9118
|
P: {};
|
|
@@ -9165,6 +9183,10 @@ export declare const components: {
|
|
|
9165
9183
|
type: import("vue").PropType<boolean>;
|
|
9166
9184
|
default: boolean;
|
|
9167
9185
|
};
|
|
9186
|
+
autofocus: {
|
|
9187
|
+
type: import("vue").PropType<boolean>;
|
|
9188
|
+
default: boolean;
|
|
9189
|
+
};
|
|
9168
9190
|
showSuccess: {
|
|
9169
9191
|
type: import("vue").PropType<boolean>;
|
|
9170
9192
|
default: boolean;
|
|
@@ -9187,6 +9209,7 @@ export declare const components: {
|
|
|
9187
9209
|
maxLength: number;
|
|
9188
9210
|
readonly: boolean;
|
|
9189
9211
|
showWordCount: boolean;
|
|
9212
|
+
autofocus: boolean;
|
|
9190
9213
|
showSuccess: boolean;
|
|
9191
9214
|
}>;
|
|
9192
9215
|
__isFragment?: undefined;
|
|
@@ -9254,6 +9277,10 @@ export declare const components: {
|
|
|
9254
9277
|
type: import("vue").PropType<boolean>;
|
|
9255
9278
|
default: boolean;
|
|
9256
9279
|
};
|
|
9280
|
+
autofocus: {
|
|
9281
|
+
type: import("vue").PropType<boolean>;
|
|
9282
|
+
default: boolean;
|
|
9283
|
+
};
|
|
9257
9284
|
showSuccess: {
|
|
9258
9285
|
type: import("vue").PropType<boolean>;
|
|
9259
9286
|
default: boolean;
|
|
@@ -9278,6 +9305,7 @@ export declare const components: {
|
|
|
9278
9305
|
maxLength: number;
|
|
9279
9306
|
readonly: boolean;
|
|
9280
9307
|
showWordCount: boolean;
|
|
9308
|
+
autofocus: boolean;
|
|
9281
9309
|
showSuccess: boolean;
|
|
9282
9310
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
9283
9311
|
$slots: {
|
|
@@ -11669,6 +11697,10 @@ export declare const components: {
|
|
|
11669
11697
|
expandedState: {
|
|
11670
11698
|
type: import("vue").PropType<import("./components/table/FmTable.vue").ExpandedState>;
|
|
11671
11699
|
};
|
|
11700
|
+
getRowCanExpand: {
|
|
11701
|
+
type: import("vue").PropType<(row: import("./components/table/FmTable.vue").Row<any>) => boolean>;
|
|
11702
|
+
default: () => true;
|
|
11703
|
+
};
|
|
11672
11704
|
getSubRow: {
|
|
11673
11705
|
type: import("vue").PropType<(row: any) => any[] | undefined>;
|
|
11674
11706
|
default: (row: any) => any;
|
|
@@ -11880,6 +11912,10 @@ export declare const components: {
|
|
|
11880
11912
|
expandedState: {
|
|
11881
11913
|
type: import("vue").PropType<import("./components/table/FmTable.vue").ExpandedState>;
|
|
11882
11914
|
};
|
|
11915
|
+
getRowCanExpand: {
|
|
11916
|
+
type: import("vue").PropType<(row: import("./components/table/FmTable.vue").Row<any>) => boolean>;
|
|
11917
|
+
default: () => true;
|
|
11918
|
+
};
|
|
11883
11919
|
getSubRow: {
|
|
11884
11920
|
type: import("vue").PropType<(row: any) => any[] | undefined>;
|
|
11885
11921
|
default: (row: any) => any;
|
|
@@ -12017,6 +12053,7 @@ export declare const components: {
|
|
|
12017
12053
|
pinHeaderRow: boolean;
|
|
12018
12054
|
onRowClick: (row: import("./components/table/FmTable.vue").Row<any>) => void;
|
|
12019
12055
|
shrinkAt: number | false | import("./composables/useBreakpoints").Breakpoints;
|
|
12056
|
+
getRowCanExpand: (row: import("./components/table/FmTable.vue").Row<any>) => boolean;
|
|
12020
12057
|
getSubRow: (row: any) => any[] | undefined;
|
|
12021
12058
|
onVuedraggableMove: (context: {
|
|
12022
12059
|
draggedContext: {
|
|
@@ -12218,6 +12255,10 @@ export declare const components: {
|
|
|
12218
12255
|
expandedState: {
|
|
12219
12256
|
type: import("vue").PropType<import("./components/table/FmTable.vue").ExpandedState>;
|
|
12220
12257
|
};
|
|
12258
|
+
getRowCanExpand: {
|
|
12259
|
+
type: import("vue").PropType<(row: import("./components/table/FmTable.vue").Row<any>) => boolean>;
|
|
12260
|
+
default: () => true;
|
|
12261
|
+
};
|
|
12221
12262
|
getSubRow: {
|
|
12222
12263
|
type: import("vue").PropType<(row: any) => any[] | undefined>;
|
|
12223
12264
|
default: (row: any) => any;
|
|
@@ -12355,6 +12396,7 @@ export declare const components: {
|
|
|
12355
12396
|
pinHeaderRow: boolean;
|
|
12356
12397
|
onRowClick: (row: import("./components/table/FmTable.vue").Row<any>) => void;
|
|
12357
12398
|
shrinkAt: number | false | import("./composables/useBreakpoints").Breakpoints;
|
|
12399
|
+
getRowCanExpand: (row: import("./components/table/FmTable.vue").Row<any>) => boolean;
|
|
12358
12400
|
getSubRow: (row: any) => any[] | undefined;
|
|
12359
12401
|
onVuedraggableMove: (context: {
|
|
12360
12402
|
draggedContext: {
|
|
@@ -12553,6 +12595,10 @@ export declare const components: {
|
|
|
12553
12595
|
expandedState: {
|
|
12554
12596
|
type: import("vue").PropType<import("./components/table/FmTable.vue").ExpandedState>;
|
|
12555
12597
|
};
|
|
12598
|
+
getRowCanExpand: {
|
|
12599
|
+
type: import("vue").PropType<(row: import("./components/table/FmTable.vue").Row<any>) => boolean>;
|
|
12600
|
+
default: () => true;
|
|
12601
|
+
};
|
|
12556
12602
|
getSubRow: {
|
|
12557
12603
|
type: import("vue").PropType<(row: any) => any[] | undefined>;
|
|
12558
12604
|
default: (row: any) => any;
|
|
@@ -12695,6 +12741,7 @@ export declare const components: {
|
|
|
12695
12741
|
pinHeaderRow: boolean;
|
|
12696
12742
|
onRowClick: (row: import("./components/table/FmTable.vue").Row<any>) => void;
|
|
12697
12743
|
shrinkAt: number | false | import("./composables/useBreakpoints").Breakpoints;
|
|
12744
|
+
getRowCanExpand: (row: import("./components/table/FmTable.vue").Row<any>) => boolean;
|
|
12698
12745
|
getSubRow: (row: any) => any[] | undefined;
|
|
12699
12746
|
onVuedraggableMove: (context: {
|
|
12700
12747
|
draggedContext: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{importShared as O,__tla as Ke}from"./__federation_fn_import-CYKgoy9p.js";import Fe,{__tla as Le}from"./__federation_expose_FmTopSheet-DtYI5ulE.js";import{_ as Me,__tla as ze}from"./FmSearch.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{importShared as O,__tla as Ke}from"./__federation_fn_import-CYKgoy9p.js";import Fe,{__tla as Le}from"./__federation_expose_FmTopSheet-DtYI5ulE.js";import{_ as Me,__tla as ze}from"./FmSearch.vue_vue_type_script_setup_true_lang-DMc1vDz2.js";import U,{__tla as Ne}from"./__federation_expose_FmButton-Cty3oy3R.js";import{d as he}from"./index-CH5pnGY6.js";import Pe,{__tla as $e}from"./__federation_expose_FmCircularProgress-BPQ513nn.js";import{u as ye,__tla as Be}from"./useProxiedModel-DbArcH0F.js";import ge,{__tla as Ae}from"./__federation_expose_FmIcon-BbkanMuo.js";import{a as Ie}from"./_commonjsHelpers-C4iS2aBk.js";import Re,{__tla as Ee}from"./__federation_expose_FmSpacer-NyWv__n8.js";let _e,Je=Promise.all([(()=>{try{return Ke}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return $e}catch{}})(),(()=>{try{return Be}catch{}})(),(()=>{try{return Ae}catch{}})(),(()=>{try{return Ee}catch{}})()]).then(async()=>{var j={exports:{}};(function(L,w){(function(){var e={};L.exports=e,e.simpleFilter=function(o,a){return a.filter(function(r){return e.test(o,r)})},e.test=function(o,a){return e.match(o,a)!==null},e.match=function(o,a,r){r=r||{};var f=0,c=[],p=a.length,k=0,u=0,n=r.pre||"",K=r.post||"",B=r.caseSensitive&&a||a.toLowerCase(),C;o=r.caseSensitive&&o||o.toLowerCase();for(var _=0;_<p;_++)C=a[_],B[_]===o[f]?(C=n+C+K,f+=1,u+=1+u):u=0,k+=u,c[c.length]=C;return f===o.length?(k=B===o?1/0:k,{rendered:c.join(""),score:k}):null},e.filter=function(o,a,r){return!a||a.length===0?[]:typeof o!="string"?a:(r=r||{},a.reduce(function(f,c,p,k){var u=c;r.extract&&(u=r.extract(c));var n=e.match(o,u,r);return n!=null&&(f[f.length]={string:n.rendered,score:n.score,index:p,original:c}),f},[]).sort(function(f,c){var p=c.score-f.score;return p||f.index-c.index}))}})()})(j);var be=j.exports;const xe=Ie(be);function z(L,w){const[e]=xe.filter(L.toLocaleLowerCase(),[w],{pre:"|",post:"|",extract(a){return a.toLocaleLowerCase()}});if(!e)return{label:w,segments:[{segment:w,isMatch:!1}],matched:!1};const o=e.string.toString().replace(/\|\|/g,"").split("|").reduce((a,r,f)=>(a.push({segment:r,isMatch:f%2!==0}),a),new Array);return{label:w,segments:o,matched:!0}}let D,G,g,s,m,v,N,F,b,V,P,q,I,R,H,Q,T,W,X,Y,Z,ee,le,te,ae,re,oe,ne,se,ce,ue,ie,me,de,x,S,$,fe;({defineComponent:D}=await O("vue")),{unref:G,createVNode:g,createElementVNode:s,openBlock:m,createElementBlock:v,createCommentVNode:N,renderList:F,Fragment:b,toDisplayString:V,renderSlot:P,mergeProps:q,normalizeClass:I,createBlock:R,isRef:H,withCtx:Q}=await O("vue"),T={class:"flex flex-col gap-4"},W={class:"bg-white flex gap-4 px-24 py-8 sticky top-0"},X={class:"hidden sm:inline xs:inline"},Y={key:0},Z={key:0,class:"flex flex-col"},ee={class:"flex flex-col"},le={class:"flex items-center px-24 py-12"},te=s("div",{class:"fm-typo-en-body-md-400 text-fm-color-typo-secondary"}," Recent search ",-1),ae=s("div",{class:"py-4"},[s("hr",{class:"border-fm-color-neutral-gray-100"})],-1),re=["onClick"],oe={class:"fm-typo-en-body-lg-400 text-fm-color-typo-primary"},ne={class:"fm-typo-en-body-lg-400 px-24 py-12 text-center text-fm-color-primary"},se={class:"fm-typo-en-body-lg-400 px-24 py-12 text-center text-fm-color-typo-secondary"},ce={key:3,class:"flex flex-col"},ue=["onClick"],ie={class:"flex flex-col gap-4"},me={key:0,class:"text-fm-color-typo-secondary"},de={class:"px-16 py-4"},{computed:x,ref:S,watch:$}=await O("vue"),fe=5,_e=D({__name:"FmGlobalSearch",props:{show:{type:Boolean,default:!1},modelValue:{default:""},suggestions:{default:void 0},onSearch:{type:Function,default:void 0},placeholder:{default:""},hintPlaceholder:{default:""},notFoundPlaceholder:{default:""},recentSearchKey:{default:""}},emits:["dismiss","submit","update:show","update:modelValue"],setup(L,{emit:w}){const e=L,o=w;function a(){if(!e.recentSearchKey)return;const l=e.recentSearchKey;localStorage.removeItem(l),c.value=[]}function r(){if(!e.recentSearchKey)return;const l=e.recentSearchKey,t=localStorage.getItem(l);if(!t)return[];try{return JSON.parse(t)}catch{return new Array}}const f=he(function(l){if(!e.recentSearchKey)return;const t=e.recentSearchKey,d=l().trim();if(!t||!d)return;const h=r()??[],i=[...new Set([d,...h])].slice(0,fe),M=JSON.stringify(i);return localStorage.setItem(t,M),c.value=i,i},800),c=S(r()),p=ye(e,"show");$([()=>e.show],()=>{e.show?(n.value=null,e.suggestions&&ve()):o("dismiss")});const k=ye(e,"modelValue"),u=S(e.modelValue);$([()=>u.value],()=>{we()});const n=S(null),K=S(!0),B=x(()=>{var l;return K.value?(l=n.value)==null?void 0:l.slice(0,5):n.value});$([()=>n.value],([])=>{K.value=!0});const C=x(()=>n.value===null),_=S(!1),A=S(""),E=()=>u.value;async function ve(){if(!p.value)return;const l=E();if(!l)return;const t=Math.random().toString();if(A.value=t,e.suggestions){n.value=e.suggestions.map(d=>({label:z(l,d.label),sublabel:d.sublabel?z(l,d.sublabel):null})).filter(d=>{var h;return d.label.matched||((h=d.sublabel)==null?void 0:h.matched)}),f(E);return}if(e.onSearch)try{_.value=!0;const d=await e.onSearch(l);t===A.value&&(n.value=d.map(h=>({label:z(l,h.label),sublabel:h.sublabel?z(l,h.sublabel):null})))}catch{t===A.value&&(n.value=[])}finally{t===A.value&&(_.value=!1,f(E))}}function Se(l){p.value=!1,o("dismiss"),k.value=l}const we=he(ve),pe=x(()=>c.value&&c.value.length===0),ke=x(()=>(!u.value||C.value)&&!pe.value),Ce=x(()=>(!u.value||C.value)&&pe.value),Ve=x(()=>u.value&&n.value&&n.value.length===0);return(l,t)=>(m(),R(Fe,{"model-value":G(p),"onUpdate:modelValue":t[4]||(t[4]=d=>H(p)?p.value=d:null),"fullscreen-size":"sm","dismiss-away":""},{default:Q(()=>{var d,h;return[s("div",T,[s("div",W,[s("div",X,[g(U,{"prepend-icon":"arrow_back",variant:"tertiary",onClick:t[0]||(t[0]=i=>p.value=!1)})]),g(Me,{"model-value":u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),class:"flex-1",placeholder:l.placeholder},null,8,["model-value","placeholder"])]),_.value?(m(),v("div",Y,[g(Pe,{size:"xl"})])):(m(),v(b,{key:1},[ke.value?(m(),v(b,{key:0},[l.recentSearchKey&&((d=c.value)!=null&&d.length)?(m(),v("div",Z,[s("div",ee,[s("div",le,[te,g(Re),g(U,{label:"Clear history",variant:"plain",size:"md",onClick:t[2]||(t[2]=i=>a())})]),ae]),s("div",null,[(m(!0),v(b,null,F(c.value,(i,M)=>(m(),v("div",{key:M,class:"cursor-pointer flex gap-8 hover:bg-fm-color-neutral-gray-100 items-center px-24 py-12",onClick:y=>u.value=i},[g(ge,{size:"lg",name:"history"}),s("div",oe,V(i),1)],8,re))),128))])])):N("",!0)],64)):Ce.value?P(l.$slots,"hint-placeholder",{key:1},()=>[s("div",ne,V(l.hintPlaceholder),1)]):Ve.value?P(l.$slots,"not-found-placeholder",{key:2},()=>[s("div",se,V(l.notFoundPlaceholder||`No result found for \u201C${u.value}\u201D`),1)]):(m(),v("div",ce,[(m(!0),v(b,null,F(B.value,(i,M)=>P(l.$slots,"search-result-item",q({key:M,ref_for:!0},{result:i}),()=>[s("div",{class:"cursor-pointer flex gap-16 hover:bg-fm-color-neutral-gray-100 items-center px-24 py-12 w-full",onClick:y=>Se(i.label.label)},[g(ge,{size:"lg",name:"arrow_forward"}),s("div",ie,[s("div",null,[(m(!0),v(b,null,F(i.label.segments,(y,J)=>(m(),v("span",{key:J,class:I({"fm-typo-en-body-lg-400":!y.isMatch,"fm-typo-en-body-lg-600":y.isMatch})},V(y.segment),3))),128))]),i.sublabel?(m(),v("div",me,[(m(!0),v(b,null,F(i.sublabel.segments,(y,J)=>(m(),v("span",{key:J,class:I({"fm-typo-en-body-md-400":!y.isMatch,"fm-typo-en-body-md-600":y.isMatch})},V(y.segment),3))),128))])):N("",!0)])],8,ue)])),128)),s("div",de,[K.value&&(((h=n.value)==null?void 0:h.length)??0)>5?(m(),R(U,{key:0,label:`show ${n.value.length-5} more results`,variant:"plain",onClick:t[3]||(t[3]=i=>K.value=!1)},null,8,["label"])):N("",!0)])]))],64))])]}),_:3},8,["model-value"]))}})});export{_e as _,Je as __tla};
|