@feedmepos/ui-library 1.2.14-rc.6 → 1.2.14-rc.7
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/CHANGELOG.md +6 -0
- package/dist/components/form/stepper-field/FmStepperField.vue.d.ts +1 -1
- package/dist/components/form/text-field/FmTextField.vue.d.ts +14 -1
- package/dist/components.d.ts +54 -23
- package/dist/federation/{FmGlobalSearch.vue_vue_type_script_setup_true_lang-CiMM8hl_.js → FmGlobalSearch.vue_vue_type_script_setup_true_lang-cvAxQIsC.js} +1 -1
- package/dist/federation/{FmPhoneNumber.vue_vue_type_script_setup_true_lang-Cof53HE4.js → FmPhoneNumber.vue_vue_type_script_setup_true_lang-DkotrI6H.js} +1 -1
- package/dist/federation/{FmSearch.vue_vue_type_script_setup_true_lang-SvYjsjff.js → FmSearch.vue_vue_type_script_setup_true_lang-ypsMTFJX.js} +1 -1
- package/dist/federation/{FmTableToolbar.vue_vue_type_script_setup_true_lang-C6Idp11n.js → FmTableToolbar.vue_vue_type_script_setup_true_lang-Dijbl4yz.js} +1 -1
- package/dist/federation/FmTextField-CTd05pur.css +1 -0
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-37B05hRS.js +1 -0
- package/dist/federation/{__federation_expose_FmGlobalSearch-Cq91p7X9.js → __federation_expose_FmGlobalSearch-C5QPFrAj.js} +1 -1
- package/dist/federation/{__federation_expose_FmPhoneNumber-CucldsRn.js → __federation_expose_FmPhoneNumber-6yl86MX9.js} +1 -1
- package/dist/federation/{__federation_expose_FmSearch-DEcgPnbi.js → __federation_expose_FmSearch-v8GPD4C9.js} +1 -1
- package/dist/federation/{__federation_expose_FmTableToolbar-n-J4UF-Q.js → __federation_expose_FmTableToolbar-BNL0KB_4.js} +1 -1
- package/dist/federation/{__federation_expose_FmTextField-P3xfRQdW.js → __federation_expose_FmTextField-Ih_fT_QS.js} +1 -1
- package/dist/federation/feedmepos-ui-components.js +1 -1
- package/dist/federation/{index-DmggHGyl.js → index-DEAT39Pq.js} +2 -2
- package/dist/feedmepos-ui-library.js +200 -197
- package/dist/feedmepos-ui-library.umd.cjs +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/federation/FmTextField-CcwZGaeF.css +0 -1
- package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-Umk5Y-rZ.js +0 -1
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 1.2.14-rc.7 - 2024-07-19
|
|
2
|
+
|
|
3
|
+
- `FmTextField`
|
|
4
|
+
- Add `formatter` prop to allow user to format the input value
|
|
5
|
+
- Add `decimal` prop to allow user to set the decimal places(treat it as the step attribute for number input)
|
|
6
|
+
|
|
1
7
|
## 1.2.14-rc.6 - 2024-07-18
|
|
2
8
|
|
|
3
9
|
### Features
|
|
@@ -86,9 +86,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
86
86
|
max: number;
|
|
87
87
|
placeholder: string;
|
|
88
88
|
inputmode: "numeric" | "decimal";
|
|
89
|
+
step: number;
|
|
89
90
|
prependText: string;
|
|
90
91
|
appendText: string;
|
|
91
|
-
step: number;
|
|
92
92
|
isCurrency: boolean;
|
|
93
93
|
showSteppers: boolean;
|
|
94
94
|
useGrouping: boolean;
|
|
@@ -5,6 +5,7 @@ export interface FmTextFieldProps extends FormChildProps {
|
|
|
5
5
|
maxLength?: number;
|
|
6
6
|
/** To display virtual keyboard */
|
|
7
7
|
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url' | 'password';
|
|
8
|
+
type?: 'text' | 'password' | 'email' | 'tel' | 'number';
|
|
8
9
|
readonly?: boolean;
|
|
9
10
|
labelMark?: 'required' | 'optional' | 'none';
|
|
10
11
|
prependIcon?: string;
|
|
@@ -14,7 +15,16 @@ export interface FmTextFieldProps extends FormChildProps {
|
|
|
14
15
|
showWordCount?: boolean;
|
|
15
16
|
invalid?: boolean;
|
|
16
17
|
autofocus?: boolean;
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @description
|
|
20
|
+
* Allow user to format the value before updating the model
|
|
21
|
+
*/
|
|
22
|
+
formatter?: (value: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Treat it as the step attribute for number input
|
|
26
|
+
*/
|
|
27
|
+
decimal?: number;
|
|
18
28
|
}
|
|
19
29
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FmTextFieldProps>, {
|
|
20
30
|
label: string;
|
|
@@ -33,6 +43,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
33
43
|
labelInfo: string;
|
|
34
44
|
helperState: string;
|
|
35
45
|
showWordCount: boolean;
|
|
46
|
+
formatter: (value: string) => string;
|
|
36
47
|
}>, {
|
|
37
48
|
focus: () => void;
|
|
38
49
|
inputEl: import("vue").Ref<HTMLInputElement | null>;
|
|
@@ -56,6 +67,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
56
67
|
labelInfo: string;
|
|
57
68
|
helperState: string;
|
|
58
69
|
showWordCount: boolean;
|
|
70
|
+
formatter: (value: string) => string;
|
|
59
71
|
}>>> & {
|
|
60
72
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
61
73
|
"onFocus-changed"?: ((value: boolean) => any) | undefined;
|
|
@@ -76,6 +88,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
76
88
|
inputmode: "text" | "none" | "search" | "email" | "password" | "tel" | "url" | "numeric" | "decimal";
|
|
77
89
|
readonly: boolean;
|
|
78
90
|
showWordCount: boolean;
|
|
91
|
+
formatter: (value: string) => string;
|
|
79
92
|
}, {}>, {
|
|
80
93
|
label?(_: {}): any;
|
|
81
94
|
prepend?(_: {}): any;
|
package/dist/components.d.ts
CHANGED
|
@@ -7531,6 +7531,10 @@ export declare const components: {
|
|
|
7531
7531
|
readonly: {
|
|
7532
7532
|
type: import("vue").PropType<boolean>;
|
|
7533
7533
|
};
|
|
7534
|
+
step: {
|
|
7535
|
+
type: import("vue").PropType<number>;
|
|
7536
|
+
default: number;
|
|
7537
|
+
};
|
|
7534
7538
|
prependText: {
|
|
7535
7539
|
type: import("vue").PropType<string>;
|
|
7536
7540
|
default: string;
|
|
@@ -7539,10 +7543,6 @@ export declare const components: {
|
|
|
7539
7543
|
type: import("vue").PropType<string>;
|
|
7540
7544
|
default: string;
|
|
7541
7545
|
};
|
|
7542
|
-
step: {
|
|
7543
|
-
type: import("vue").PropType<number>;
|
|
7544
|
-
default: number;
|
|
7545
|
-
};
|
|
7546
7546
|
isCurrency: {
|
|
7547
7547
|
type: import("vue").PropType<boolean>;
|
|
7548
7548
|
default: boolean;
|
|
@@ -7634,6 +7634,10 @@ export declare const components: {
|
|
|
7634
7634
|
readonly: {
|
|
7635
7635
|
type: import("vue").PropType<boolean>;
|
|
7636
7636
|
};
|
|
7637
|
+
step: {
|
|
7638
|
+
type: import("vue").PropType<number>;
|
|
7639
|
+
default: number;
|
|
7640
|
+
};
|
|
7637
7641
|
prependText: {
|
|
7638
7642
|
type: import("vue").PropType<string>;
|
|
7639
7643
|
default: string;
|
|
@@ -7642,10 +7646,6 @@ export declare const components: {
|
|
|
7642
7646
|
type: import("vue").PropType<string>;
|
|
7643
7647
|
default: string;
|
|
7644
7648
|
};
|
|
7645
|
-
step: {
|
|
7646
|
-
type: import("vue").PropType<number>;
|
|
7647
|
-
default: number;
|
|
7648
|
-
};
|
|
7649
7649
|
isCurrency: {
|
|
7650
7650
|
type: import("vue").PropType<boolean>;
|
|
7651
7651
|
default: boolean;
|
|
@@ -7683,9 +7683,9 @@ export declare const components: {
|
|
|
7683
7683
|
max: number;
|
|
7684
7684
|
placeholder: string;
|
|
7685
7685
|
inputmode: "numeric" | "decimal";
|
|
7686
|
+
step: number;
|
|
7686
7687
|
prependText: string;
|
|
7687
7688
|
appendText: string;
|
|
7688
|
-
step: number;
|
|
7689
7689
|
isCurrency: boolean;
|
|
7690
7690
|
showSteppers: boolean;
|
|
7691
7691
|
useGrouping: boolean;
|
|
@@ -7765,6 +7765,10 @@ export declare const components: {
|
|
|
7765
7765
|
readonly: {
|
|
7766
7766
|
type: import("vue").PropType<boolean>;
|
|
7767
7767
|
};
|
|
7768
|
+
step: {
|
|
7769
|
+
type: import("vue").PropType<number>;
|
|
7770
|
+
default: number;
|
|
7771
|
+
};
|
|
7768
7772
|
prependText: {
|
|
7769
7773
|
type: import("vue").PropType<string>;
|
|
7770
7774
|
default: string;
|
|
@@ -7773,10 +7777,6 @@ export declare const components: {
|
|
|
7773
7777
|
type: import("vue").PropType<string>;
|
|
7774
7778
|
default: string;
|
|
7775
7779
|
};
|
|
7776
|
-
step: {
|
|
7777
|
-
type: import("vue").PropType<number>;
|
|
7778
|
-
default: number;
|
|
7779
|
-
};
|
|
7780
7780
|
isCurrency: {
|
|
7781
7781
|
type: import("vue").PropType<boolean>;
|
|
7782
7782
|
default: boolean;
|
|
@@ -7814,9 +7814,9 @@ export declare const components: {
|
|
|
7814
7814
|
max: number;
|
|
7815
7815
|
placeholder: string;
|
|
7816
7816
|
inputmode: "numeric" | "decimal";
|
|
7817
|
+
step: number;
|
|
7817
7818
|
prependText: string;
|
|
7818
7819
|
appendText: string;
|
|
7819
|
-
step: number;
|
|
7820
7820
|
isCurrency: boolean;
|
|
7821
7821
|
showSteppers: boolean;
|
|
7822
7822
|
useGrouping: boolean;
|
|
@@ -7893,6 +7893,10 @@ export declare const components: {
|
|
|
7893
7893
|
readonly: {
|
|
7894
7894
|
type: import("vue").PropType<boolean>;
|
|
7895
7895
|
};
|
|
7896
|
+
step: {
|
|
7897
|
+
type: import("vue").PropType<number>;
|
|
7898
|
+
default: number;
|
|
7899
|
+
};
|
|
7896
7900
|
prependText: {
|
|
7897
7901
|
type: import("vue").PropType<string>;
|
|
7898
7902
|
default: string;
|
|
@@ -7901,10 +7905,6 @@ export declare const components: {
|
|
|
7901
7905
|
type: import("vue").PropType<string>;
|
|
7902
7906
|
default: string;
|
|
7903
7907
|
};
|
|
7904
|
-
step: {
|
|
7905
|
-
type: import("vue").PropType<number>;
|
|
7906
|
-
default: number;
|
|
7907
|
-
};
|
|
7908
7908
|
isCurrency: {
|
|
7909
7909
|
type: import("vue").PropType<boolean>;
|
|
7910
7910
|
default: boolean;
|
|
@@ -7944,9 +7944,9 @@ export declare const components: {
|
|
|
7944
7944
|
max: number;
|
|
7945
7945
|
placeholder: string;
|
|
7946
7946
|
inputmode: "numeric" | "decimal";
|
|
7947
|
+
step: number;
|
|
7947
7948
|
prependText: string;
|
|
7948
7949
|
appendText: string;
|
|
7949
|
-
step: number;
|
|
7950
7950
|
isCurrency: boolean;
|
|
7951
7951
|
showSteppers: boolean;
|
|
7952
7952
|
useGrouping: boolean;
|
|
@@ -8128,6 +8128,9 @@ export declare const components: {
|
|
|
8128
8128
|
});
|
|
8129
8129
|
FmTextField: {
|
|
8130
8130
|
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
8131
|
+
type: {
|
|
8132
|
+
type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel">;
|
|
8133
|
+
};
|
|
8131
8134
|
label: {
|
|
8132
8135
|
type: import("vue").PropType<string>;
|
|
8133
8136
|
default: string;
|
|
@@ -8185,7 +8188,7 @@ export declare const components: {
|
|
|
8185
8188
|
autofocus: {
|
|
8186
8189
|
type: import("vue").PropType<boolean>;
|
|
8187
8190
|
};
|
|
8188
|
-
|
|
8191
|
+
decimal: {
|
|
8189
8192
|
type: import("vue").PropType<number>;
|
|
8190
8193
|
};
|
|
8191
8194
|
minLength: {
|
|
@@ -8208,6 +8211,10 @@ export declare const components: {
|
|
|
8208
8211
|
type: import("vue").PropType<boolean>;
|
|
8209
8212
|
default: boolean;
|
|
8210
8213
|
};
|
|
8214
|
+
formatter: {
|
|
8215
|
+
type: import("vue").PropType<(value: string) => string>;
|
|
8216
|
+
default: (value: string) => string;
|
|
8217
|
+
};
|
|
8211
8218
|
}>> & {
|
|
8212
8219
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8213
8220
|
"onFocus-changed"?: ((value: boolean) => any) | undefined;
|
|
@@ -8218,6 +8225,9 @@ export declare const components: {
|
|
|
8218
8225
|
"update:modelValue": (value: string) => void;
|
|
8219
8226
|
"focus-changed": (value: boolean) => void;
|
|
8220
8227
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
8228
|
+
type: {
|
|
8229
|
+
type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel">;
|
|
8230
|
+
};
|
|
8221
8231
|
label: {
|
|
8222
8232
|
type: import("vue").PropType<string>;
|
|
8223
8233
|
default: string;
|
|
@@ -8275,7 +8285,7 @@ export declare const components: {
|
|
|
8275
8285
|
autofocus: {
|
|
8276
8286
|
type: import("vue").PropType<boolean>;
|
|
8277
8287
|
};
|
|
8278
|
-
|
|
8288
|
+
decimal: {
|
|
8279
8289
|
type: import("vue").PropType<number>;
|
|
8280
8290
|
};
|
|
8281
8291
|
minLength: {
|
|
@@ -8298,6 +8308,10 @@ export declare const components: {
|
|
|
8298
8308
|
type: import("vue").PropType<boolean>;
|
|
8299
8309
|
default: boolean;
|
|
8300
8310
|
};
|
|
8311
|
+
formatter: {
|
|
8312
|
+
type: import("vue").PropType<(value: string) => string>;
|
|
8313
|
+
default: (value: string) => string;
|
|
8314
|
+
};
|
|
8301
8315
|
}>> & {
|
|
8302
8316
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8303
8317
|
"onFocus-changed"?: ((value: boolean) => any) | undefined;
|
|
@@ -8318,6 +8332,7 @@ export declare const components: {
|
|
|
8318
8332
|
inputmode: "text" | "none" | "search" | "email" | "password" | "tel" | "url" | "numeric" | "decimal";
|
|
8319
8333
|
readonly: boolean;
|
|
8320
8334
|
showWordCount: boolean;
|
|
8335
|
+
formatter: (value: string) => string;
|
|
8321
8336
|
}, true, {}, {}, {
|
|
8322
8337
|
P: {};
|
|
8323
8338
|
B: {};
|
|
@@ -8326,6 +8341,9 @@ export declare const components: {
|
|
|
8326
8341
|
M: {};
|
|
8327
8342
|
Defaults: {};
|
|
8328
8343
|
}, Readonly<import("vue").ExtractPropTypes<{
|
|
8344
|
+
type: {
|
|
8345
|
+
type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel">;
|
|
8346
|
+
};
|
|
8329
8347
|
label: {
|
|
8330
8348
|
type: import("vue").PropType<string>;
|
|
8331
8349
|
default: string;
|
|
@@ -8383,7 +8401,7 @@ export declare const components: {
|
|
|
8383
8401
|
autofocus: {
|
|
8384
8402
|
type: import("vue").PropType<boolean>;
|
|
8385
8403
|
};
|
|
8386
|
-
|
|
8404
|
+
decimal: {
|
|
8387
8405
|
type: import("vue").PropType<number>;
|
|
8388
8406
|
};
|
|
8389
8407
|
minLength: {
|
|
@@ -8406,6 +8424,10 @@ export declare const components: {
|
|
|
8406
8424
|
type: import("vue").PropType<boolean>;
|
|
8407
8425
|
default: boolean;
|
|
8408
8426
|
};
|
|
8427
|
+
formatter: {
|
|
8428
|
+
type: import("vue").PropType<(value: string) => string>;
|
|
8429
|
+
default: (value: string) => string;
|
|
8430
|
+
};
|
|
8409
8431
|
}>> & {
|
|
8410
8432
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8411
8433
|
"onFocus-changed"?: ((value: boolean) => any) | undefined;
|
|
@@ -8429,11 +8451,15 @@ export declare const components: {
|
|
|
8429
8451
|
inputmode: "text" | "none" | "search" | "email" | "password" | "tel" | "url" | "numeric" | "decimal";
|
|
8430
8452
|
readonly: boolean;
|
|
8431
8453
|
showWordCount: boolean;
|
|
8454
|
+
formatter: (value: string) => string;
|
|
8432
8455
|
}>;
|
|
8433
8456
|
__isFragment?: undefined;
|
|
8434
8457
|
__isTeleport?: undefined;
|
|
8435
8458
|
__isSuspense?: undefined;
|
|
8436
8459
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
8460
|
+
type: {
|
|
8461
|
+
type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel">;
|
|
8462
|
+
};
|
|
8437
8463
|
label: {
|
|
8438
8464
|
type: import("vue").PropType<string>;
|
|
8439
8465
|
default: string;
|
|
@@ -8491,7 +8517,7 @@ export declare const components: {
|
|
|
8491
8517
|
autofocus: {
|
|
8492
8518
|
type: import("vue").PropType<boolean>;
|
|
8493
8519
|
};
|
|
8494
|
-
|
|
8520
|
+
decimal: {
|
|
8495
8521
|
type: import("vue").PropType<number>;
|
|
8496
8522
|
};
|
|
8497
8523
|
minLength: {
|
|
@@ -8514,6 +8540,10 @@ export declare const components: {
|
|
|
8514
8540
|
type: import("vue").PropType<boolean>;
|
|
8515
8541
|
default: boolean;
|
|
8516
8542
|
};
|
|
8543
|
+
formatter: {
|
|
8544
|
+
type: import("vue").PropType<(value: string) => string>;
|
|
8545
|
+
default: (value: string) => string;
|
|
8546
|
+
};
|
|
8517
8547
|
}>> & {
|
|
8518
8548
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8519
8549
|
"onFocus-changed"?: ((value: boolean) => any) | undefined;
|
|
@@ -8540,6 +8570,7 @@ export declare const components: {
|
|
|
8540
8570
|
inputmode: "text" | "none" | "search" | "email" | "password" | "tel" | "url" | "numeric" | "decimal";
|
|
8541
8571
|
readonly: boolean;
|
|
8542
8572
|
showWordCount: boolean;
|
|
8573
|
+
formatter: (value: string) => string;
|
|
8543
8574
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
8544
8575
|
$slots: {
|
|
8545
8576
|
label?(_: {}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{importShared as O,__tla as Ke}from"./__federation_fn_import-N00Fru_z.js";import Fe,{__tla as Le}from"./__federation_expose_FmTopSheet-8s89XgEU.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-N00Fru_z.js";import Fe,{__tla as Le}from"./__federation_expose_FmTopSheet-8s89XgEU.js";import{_ as Me,__tla as ze}from"./FmSearch.vue_vue_type_script_setup_true_lang-ypsMTFJX.js";import U,{__tla as Ne}from"./__federation_expose_FmButton-B89IqUqH.js";import{d as he}from"./index-geV2sl9x.js";import Pe,{__tla as $e}from"./__federation_expose_FmCircularProgress-DBm-LN_6.js";import{u as ye,__tla as Be}from"./useProxiedModel-iaHgr1SG.js";import ge,{__tla as Ae}from"./__federation_expose_FmIcon-CTtCgIlW.js";import{g as Ie}from"./_commonjsHelpers-Cpj98o6Y.js";import Re,{__tla as Ee}from"./__federation_expose_FmSpacer-D2XDCp5e.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};
|