fis-component 0.1.4 → 0.1.6
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/cjs/index.js +54 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Input/InputText/index.d.ts +2 -0
- package/dist/cjs/types/src/components/MenuSelect/types.d.ts +1 -0
- package/dist/cjs/types/src/utils/text.d.ts +19 -0
- package/dist/esm/index.js +54 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Input/InputText/index.d.ts +2 -0
- package/dist/esm/types/src/components/MenuSelect/types.d.ts +1 -0
- package/dist/esm/types/src/utils/text.d.ts +19 -0
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -12,6 +12,8 @@ export interface InputTextProps extends InputFieldProps, Partial<InputLabelProps
|
|
|
12
12
|
onEnter?: (value: string | null) => void;
|
|
13
13
|
/** Handle onKeyDown action */
|
|
14
14
|
onKeyDown?: (event: unknown) => void;
|
|
15
|
+
/** Trim whitespace from value on blur */
|
|
16
|
+
isTrimValue?: boolean;
|
|
15
17
|
}
|
|
16
18
|
declare const FISInputText: React.ForwardRefExoticComponent<InputTextProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
19
|
export default FISInputText;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a text value by:
|
|
3
|
+
* - Removing all diacritic marks (e.g. Vietnamese accents)
|
|
4
|
+
* - Converting the result to lowercase
|
|
5
|
+
* - Trimming leading and trailing whitespace
|
|
6
|
+
*
|
|
7
|
+
* This is useful for case-insensitive and accent-insensitive text comparisons
|
|
8
|
+
* or searches, especially for languages that use diacritics.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* normalizeText("Công nghệ thông tin"); // "cong nghe thong tin"
|
|
13
|
+
* normalizeText(""); // ""
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param value - The input text to normalize. If falsy, an empty string is returned.
|
|
17
|
+
* @returns The normalized, accent-stripped, lowercase, and trimmed string.
|
|
18
|
+
*/
|
|
19
|
+
export declare const normalizeText: (value: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3762,6 +3762,8 @@ interface InputTextProps extends InputFieldProps, Partial<InputLabelProps> {
|
|
|
3762
3762
|
onEnter?: (value: string | null) => void;
|
|
3763
3763
|
/** Handle onKeyDown action */
|
|
3764
3764
|
onKeyDown?: (event: unknown) => void;
|
|
3765
|
+
/** Trim whitespace from value on blur */
|
|
3766
|
+
isTrimValue?: boolean;
|
|
3765
3767
|
}
|
|
3766
3768
|
declare const FISInputText: React__default.ForwardRefExoticComponent<InputTextProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
3767
3769
|
|
|
@@ -3886,6 +3888,7 @@ interface MenuProps {
|
|
|
3886
3888
|
selectedGroupLabel?: string;
|
|
3887
3889
|
maxHeight?: string | number;
|
|
3888
3890
|
onPopupScroll?: (e: React.UIEvent<HTMLElement>) => void;
|
|
3891
|
+
normalizeTextSearch?: boolean;
|
|
3889
3892
|
}
|
|
3890
3893
|
|
|
3891
3894
|
declare const FISMenuSelect: React__default.FC<MenuProps>;
|