@delightui/components 0.1.133 → 0.1.135
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/components/molecules/Select/Select.presenter.d.ts +1 -0
- package/dist/cjs/components/molecules/Select/Select.types.d.ts +8 -0
- package/dist/cjs/components/molecules/Select/Select.utils.d.ts +3 -1
- package/dist/cjs/library.js +1 -1
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/molecules/Select/Select.presenter.d.ts +1 -0
- package/dist/esm/components/molecules/Select/Select.types.d.ts +8 -0
- package/dist/esm/components/molecules/Select/Select.utils.d.ts +3 -1
- package/dist/esm/library.js +1 -1
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/package.json +1 -1
|
@@ -20,6 +20,14 @@ export type SelectContextType = {
|
|
|
20
20
|
* Function to reset the selected value to its default state.
|
|
21
21
|
*/
|
|
22
22
|
resetSelectedValue: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Function to register a value-label pair from Option components.
|
|
25
|
+
*/
|
|
26
|
+
registerOption: (value: FieldValue, label: React.ReactNode) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Function to get the display label for a value.
|
|
29
|
+
*/
|
|
30
|
+
getDisplayLabel: (value: FieldValue) => React.ReactNode | undefined;
|
|
23
31
|
/**
|
|
24
32
|
* Indicates whether the field is in an invalid state.
|
|
25
33
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { FieldValue } from '../../organisms/Form/Form.types';
|
|
2
3
|
/**
|
|
3
4
|
* Utility function to check if a given value has content.
|
|
@@ -13,9 +14,10 @@ export declare const hasValue: (value: FieldValue) => boolean | FieldValue;
|
|
|
13
14
|
*
|
|
14
15
|
* @param selected - The selected value, which can be a string, number, or an array of strings or numbers.
|
|
15
16
|
* @param defaultValue - The default value to return if no selected value is provided. Default is an empty string.
|
|
17
|
+
* @param labelMap - Optional map of values to labels for displaying custom text.
|
|
16
18
|
* @returns The selected value if it exists, formatted as a string or number, or the default value.
|
|
17
19
|
*/
|
|
18
|
-
export declare const getSelectedValue: (selected: FieldValue, defaultValue?: string) => string |
|
|
20
|
+
export declare const getSelectedValue: (selected: FieldValue, defaultValue?: string, labelMap?: Map<string, React.ReactNode>) => string | React.ReactNode | undefined;
|
|
19
21
|
/**
|
|
20
22
|
* Utility function to handle changes to the selected value in a Select component.
|
|
21
23
|
* @param newValue The new value to be selected or deselected.
|