@mw-kit/mw-ui 1.7.28 → 1.7.30
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/Input/components/Select/hooks/Select/interfaces.d.ts +1 -1
- package/dist/components/Input/components/Select/hooks/interfaces.d.ts +2 -2
- package/dist/components/Menu/interfaces.d.ts +2 -2
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +9 -7
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ export interface SelectProps extends CommonProps {
|
|
|
3
3
|
type: 'select';
|
|
4
4
|
name?: string;
|
|
5
5
|
setValue: (value: string, option: Option['data']) => void;
|
|
6
|
-
onClear
|
|
6
|
+
onClear?: (value: string) => void;
|
|
7
7
|
value: string;
|
|
8
8
|
}
|
|
9
9
|
export declare type ContextInterface = CommonContext<SelectProps>;
|
|
@@ -10,7 +10,7 @@ export declare type SelectOptionLabelProps<T extends GenericObject = GenericObje
|
|
|
10
10
|
mode?: 'placeholder';
|
|
11
11
|
};
|
|
12
12
|
export declare type SelectOptionLabelComponent<T extends GenericObject = GenericObject> = React.FunctionComponent<SelectOptionLabelProps<T>>;
|
|
13
|
-
export declare type Option<T extends GenericObject = GenericObject> = Pick<MenuOption
|
|
13
|
+
export declare type Option<T extends GenericObject = GenericObject> = Pick<MenuOption<T>, 'onClick' | 'rules' | 'data' | 'disabled'> & {
|
|
14
14
|
label: ReactNode | SelectOptionLabelComponent<T>;
|
|
15
15
|
value: string;
|
|
16
16
|
};
|
|
@@ -53,6 +53,6 @@ export interface useSelectReturn {
|
|
|
53
53
|
maxHeight: string;
|
|
54
54
|
};
|
|
55
55
|
getContext: (base: BaseContext, children: JSX.Element) => JSX.Element;
|
|
56
|
-
onClear
|
|
56
|
+
onClear?: () => void;
|
|
57
57
|
}
|
|
58
58
|
export {};
|
|
@@ -3,7 +3,7 @@ import { PopupProps } from 'semantic-ui-react';
|
|
|
3
3
|
import { Borders, ReactNode, GenericObject, SpacingOrZero, Spacings } from '../../interfaces';
|
|
4
4
|
import { AbsoluteContainerProps } from '../AbsoluteContainer/interfaces';
|
|
5
5
|
/** funcao que fara a validacao da regra, deve retornar true caso passe na validacao, e false ou o conteudo do popup caso contrario */
|
|
6
|
-
declare type Rule = (index: number, data:
|
|
6
|
+
declare type Rule<T extends GenericObject = GenericObject> = (index: number, data: T) => boolean | Omit<PopupProps, 'trigger'>;
|
|
7
7
|
export declare type MenuOptionLabelProps<T extends GenericObject = GenericObject> = {
|
|
8
8
|
delimiter?: boolean;
|
|
9
9
|
keepOpen?: boolean;
|
|
@@ -16,7 +16,7 @@ export declare type OptionLabelComponent<T extends GenericObject = GenericObject
|
|
|
16
16
|
export declare type Option<T extends GenericObject = GenericObject> = MenuOptionLabelProps<T> & {
|
|
17
17
|
label: ReactNode | OptionLabelComponent<T>;
|
|
18
18
|
onClick?: (index: number, option: Option, event: React.MouseEvent) => void;
|
|
19
|
-
rules?: Rule[];
|
|
19
|
+
rules?: Rule<T>[];
|
|
20
20
|
};
|
|
21
21
|
export interface CommonProps extends Omit<AbsoluteContainerProps, 'children'> {
|
|
22
22
|
bordered?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -14390,7 +14390,7 @@ var useSelect = function useSelect(props) {
|
|
|
14390
14390
|
|
|
14391
14391
|
var selectedOption = getSelected(props.value, options);
|
|
14392
14392
|
var inputContent = selectedOption ? getInputContent(props, selectedOption) : props.value;
|
|
14393
|
-
|
|
14393
|
+
var parsed = {
|
|
14394
14394
|
parsedOptions: parsedOptions,
|
|
14395
14395
|
options: [options, setOptions],
|
|
14396
14396
|
inputContent: inputContent,
|
|
@@ -14407,11 +14407,13 @@ var useSelect = function useSelect(props) {
|
|
|
14407
14407
|
options: options
|
|
14408
14408
|
})
|
|
14409
14409
|
}, children);
|
|
14410
|
-
},
|
|
14411
|
-
onClear: function onClear() {
|
|
14412
|
-
return props.onClear('');
|
|
14413
14410
|
}
|
|
14414
14411
|
};
|
|
14412
|
+
var onClear = props.onClear;
|
|
14413
|
+
if (onClear) parsed.onClear = function () {
|
|
14414
|
+
return onClear('');
|
|
14415
|
+
};
|
|
14416
|
+
return parsed;
|
|
14415
14417
|
};
|
|
14416
14418
|
|
|
14417
14419
|
var Provider$1 = React__default.createContext({});
|
|
@@ -14529,9 +14531,9 @@ var Label$2 = function Label(props) {
|
|
|
14529
14531
|
var _context$checked = context.checked,
|
|
14530
14532
|
checked = _context$checked[0],
|
|
14531
14533
|
setChecked = _context$checked[1];
|
|
14532
|
-
var _props$option
|
|
14533
|
-
disabled = _props$option
|
|
14534
|
-
value = _props$option
|
|
14534
|
+
var _props$option = props.option,
|
|
14535
|
+
disabled = _props$option.disabled,
|
|
14536
|
+
value = _props$option.value;
|
|
14535
14537
|
var LabelComponent = props.label;
|
|
14536
14538
|
return React__default.createElement(Checkbox, {
|
|
14537
14539
|
type: 'checkbox',
|