sti-antd-package 0.0.41 → 0.0.43
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/Component.d.ts +3 -1
- package/dist/components/Input/OTP/Component.d.ts +3 -0
- package/dist/components/Input/OTP/index.d.ts +2 -0
- package/dist/components/Input/OTP/types.d.ts +34 -0
- package/dist/components/Switch/types.d.ts +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +36 -3
- package/dist/index.esm.js +33 -13
- package/dist/index.js +33 -13
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { InputComponentProps } from "./types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare const _default: React.NamedExoticComponent<InputComponentProps
|
|
3
|
+
declare const _default: React.NamedExoticComponent<InputComponentProps> & {
|
|
4
|
+
OTP: React.FC<import("./OTP").OTPProps>;
|
|
5
|
+
};
|
|
4
6
|
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
2
|
+
import { formColLayout } from "../../../constants";
|
|
3
|
+
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
4
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
5
|
+
export interface OTPProps {
|
|
6
|
+
noItem?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: SizeType;
|
|
10
|
+
classNames?: string[];
|
|
11
|
+
variant?: "outlined" | "borderless" | "filled" | "underlined";
|
|
12
|
+
mask?: string | boolean;
|
|
13
|
+
separator?: React.ReactNode | ((index: number) => React.ReactNode);
|
|
14
|
+
length?: number;
|
|
15
|
+
value?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
removeError?: (name?: NamePath) => void;
|
|
18
|
+
onChange?: (value: string) => void;
|
|
19
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
20
|
+
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
21
|
+
onMouseLeave?: React.MouseEventHandler<HTMLInputElement>;
|
|
22
|
+
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
23
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
24
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
25
|
+
formColLayout?: typeof formColLayout;
|
|
26
|
+
name?: NamePath;
|
|
27
|
+
label?: React.ReactNode;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
rules?: Rule[];
|
|
30
|
+
ruleType?: RuleObject['type'];
|
|
31
|
+
ruleMessage?: string;
|
|
32
|
+
validateStatus?: ValidateStatus;
|
|
33
|
+
help?: React.ReactNode;
|
|
34
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
3
3
|
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
|
-
import { NamePath, Rule
|
|
4
|
+
import { NamePath, Rule } from "rc-field-form/lib/interface";
|
|
5
5
|
import React from "react";
|
|
6
6
|
export interface SwitchComponentProps {
|
|
7
7
|
noItem?: boolean;
|
|
@@ -10,6 +10,7 @@ export interface SwitchComponentProps {
|
|
|
10
10
|
unCheckedChildren?: React.ReactNode;
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
value?: boolean;
|
|
13
14
|
checked?: boolean;
|
|
14
15
|
defaultChecked?: boolean;
|
|
15
16
|
removeError?: (name?: NamePath) => void;
|
|
@@ -19,7 +20,6 @@ export interface SwitchComponentProps {
|
|
|
19
20
|
label?: React.ReactNode;
|
|
20
21
|
required?: boolean;
|
|
21
22
|
rules?: Rule[];
|
|
22
|
-
ruleType?: RuleObject['type'];
|
|
23
23
|
ruleMessage?: string;
|
|
24
24
|
validateStatus?: ValidateStatus;
|
|
25
25
|
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
@@ -27,6 +27,7 @@ export { default as IconCheckOrClose } from "./Icon/CheckOrClose";
|
|
|
27
27
|
export type { IconCheckOrCloseProps } from "./Icon/CheckOrClose";
|
|
28
28
|
export { default as InputComponent } from "./Input";
|
|
29
29
|
export type { InputComponentProps, InputComponentRef } from "./Input";
|
|
30
|
+
export type { OTPProps } from "./Input/OTP";
|
|
30
31
|
export { default as LinkComponent } from "./Link";
|
|
31
32
|
export type { LinkComponentProps } from "./Link";
|
|
32
33
|
export { default as NumberFormatComponent } from "./NumberFormat";
|
package/dist/index.d.ts
CHANGED
|
@@ -511,6 +511,37 @@ interface IconCheckOrCloseProps {
|
|
|
511
511
|
|
|
512
512
|
declare const IconCheckOrClose: React$1.FC<IconCheckOrCloseProps>;
|
|
513
513
|
|
|
514
|
+
interface OTPProps {
|
|
515
|
+
noItem?: boolean;
|
|
516
|
+
loading?: boolean;
|
|
517
|
+
disabled?: boolean;
|
|
518
|
+
size?: SizeType;
|
|
519
|
+
classNames?: string[];
|
|
520
|
+
variant?: "outlined" | "borderless" | "filled" | "underlined";
|
|
521
|
+
mask?: string | boolean;
|
|
522
|
+
separator?: React.ReactNode | ((index: number) => React.ReactNode);
|
|
523
|
+
length?: number;
|
|
524
|
+
value?: string;
|
|
525
|
+
defaultValue?: string;
|
|
526
|
+
removeError?: (name?: NamePath) => void;
|
|
527
|
+
onChange?: (value: string) => void;
|
|
528
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
529
|
+
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
530
|
+
onMouseLeave?: React.MouseEventHandler<HTMLInputElement>;
|
|
531
|
+
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
532
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
533
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
534
|
+
formColLayout?: typeof _default$i;
|
|
535
|
+
name?: NamePath;
|
|
536
|
+
label?: React.ReactNode;
|
|
537
|
+
required?: boolean;
|
|
538
|
+
rules?: Rule$1[];
|
|
539
|
+
ruleType?: RuleObject$1['type'];
|
|
540
|
+
ruleMessage?: string;
|
|
541
|
+
validateStatus?: ValidateStatus;
|
|
542
|
+
help?: React.ReactNode;
|
|
543
|
+
}
|
|
544
|
+
|
|
514
545
|
interface InputComponentRef {
|
|
515
546
|
value: () => valueType;
|
|
516
547
|
setValue: React.Dispatch<React.SetStateAction<valueType>>;
|
|
@@ -563,7 +594,9 @@ interface InputComponentProps {
|
|
|
563
594
|
ref?: Ref<InputComponentRef>;
|
|
564
595
|
}
|
|
565
596
|
|
|
566
|
-
declare const _default$9: React$1.NamedExoticComponent<InputComponentProps
|
|
597
|
+
declare const _default$9: React$1.NamedExoticComponent<InputComponentProps> & {
|
|
598
|
+
OTP: React$1.FC<OTPProps>;
|
|
599
|
+
};
|
|
567
600
|
|
|
568
601
|
interface LinkComponentProps {
|
|
569
602
|
href: string;
|
|
@@ -709,6 +742,7 @@ interface SwitchComponentProps {
|
|
|
709
742
|
unCheckedChildren?: React$1.ReactNode;
|
|
710
743
|
loading?: boolean;
|
|
711
744
|
disabled?: boolean;
|
|
745
|
+
value?: boolean;
|
|
712
746
|
checked?: boolean;
|
|
713
747
|
defaultChecked?: boolean;
|
|
714
748
|
removeError?: (name?: NamePath) => void;
|
|
@@ -718,7 +752,6 @@ interface SwitchComponentProps {
|
|
|
718
752
|
label?: React$1.ReactNode;
|
|
719
753
|
required?: boolean;
|
|
720
754
|
rules?: Rule$1[];
|
|
721
|
-
ruleType?: RuleObject$1['type'];
|
|
722
755
|
ruleMessage?: string;
|
|
723
756
|
validateStatus?: ValidateStatus;
|
|
724
757
|
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
@@ -1175,4 +1208,4 @@ declare const useRemoveError: (setInputErrors: React.Dispatch<React.SetStateActi
|
|
|
1175
1208
|
}>>) => (name?: string) => void;
|
|
1176
1209
|
|
|
1177
1210
|
export { BaseModel, _default$j as ButtonComponent, _default$h as ButtonGroupAddComponent, _default$g as ButtonGroupEditComponent, CardComponent, CascaderComponent, _default$e as CheckboxComponent, _default$d as CheckboxGroupComponent, ConfigProvider, _default$c as DataGridComponent, DateFormat, _default$b as DatePickerComponent, _default$a as DateRangePickerComponent, DropdownButtonComponent, FeedbackProvider, _default$f as FormItemComponent, IconCheckOrClose, _default$9 as InputComponent, LinkComponent, _default$8 as NumberFormatComponent, _default$7 as RadioComponent, _default$5 as SelectAsyncComponent, _default$6 as SelectComponent, _default$4 as SwitchComponent, _default$2 as TableAsyncComponent, _default$1 as TableCellEditableComponent, _default$3 as TableComponent, TableRowProvider, TabsComponent, TagComponent, _default as TextAreaComponent, TransformBoolean, TransformDayjs, TransformNumber, UploadDraggerComponent, colInline, colLayout, datePickerFormat, _default$i as formColLayout, getTableAsyncName, getTableFilterStorage, selectAsync, styleCSS, toCamel, useConfig, useDataGrid, useFeedback, useRemoveError, useTableAsyncSearch, useTableRow };
|
|
1178
|
-
export type { ButtonComponentProps, ButtonComponentRef, ButtonGroupAddComponentProps, ButtonGroupEditComponentProps, CardComponentProps, CascaderComponentProps, CascaderComponentRef, CheckboxComponentProps, CheckboxComponentRef, CheckboxGroupComponentProps, CheckboxGroupComponentRef, ConfigContextType, ConfigProviderProps, DataGridColumn, DataGridColumnType, DataGridComponentProps, DataGridComponentRef, DataGridContextType, DataGridFilter, DataGridFilterColumn, DataGridRow, DatePickerComponentProps, DatePickerComponentRef, DatePickerFormat, DatePickerFormatType, DateRangePickerComponentProps, DateRangePickerComponentRef, DefaultColumn, DefaultParams, DropdownButtonComponentProps, DropdownButtonMenuItem, FeedbackContextType, FormColLayout, FormColSizeSpan, FormItemComponentProps, IconCheckOrCloseProps, InputComponentProps, InputComponentRef, LinkComponentProps, LinkType, NumberFormatComponentProps, NumberFormatComponentRef, RadioComponentProps, SelectAsyncComponentProps, SelectAsyncComponentRef, SelectAsyncFormat, SelectAsyncProps, SelectComponentProps, SelectOption, SwitchComponentProps, TableAsyncComponentProps, TableAsyncComponentRef, TableAsyncSearchCheckbox, TableAsyncSearchContextType, TableAsyncSearchDate, TableAsyncSearchDateRange, TableAsyncSearchFetchSelectMultiple, TableAsyncSearchItem, TableAsyncSearchItemType, TableAsyncSearchLocalSelectMultiple, TableAsyncSearchProviderProps, TableAsyncSearchSelectFetch, TableAsyncSearchSelectLocal, TableAsyncSearchSelectMultiple, TableAsyncSearchSwitch, TableAsyncSearchText, TableAsyncType, TableButtonMiddle, TableButtonMiddleAsync, TableCellEditableProps, TableComponentProps, TableParams, TableParamsFormatter, TableRowContextType, TableRowProviderProps, TabsComponentProps, TagComponentProps, TextAreaComponentProps, TextAreaComponentRef, UploadDraggerComponentProps, YajraColumn, YajraColumnParams, YajraOrderParams, YajraParams, YajraSearchParams };
|
|
1211
|
+
export type { ButtonComponentProps, ButtonComponentRef, ButtonGroupAddComponentProps, ButtonGroupEditComponentProps, CardComponentProps, CascaderComponentProps, CascaderComponentRef, CheckboxComponentProps, CheckboxComponentRef, CheckboxGroupComponentProps, CheckboxGroupComponentRef, ConfigContextType, ConfigProviderProps, DataGridColumn, DataGridColumnType, DataGridComponentProps, DataGridComponentRef, DataGridContextType, DataGridFilter, DataGridFilterColumn, DataGridRow, DatePickerComponentProps, DatePickerComponentRef, DatePickerFormat, DatePickerFormatType, DateRangePickerComponentProps, DateRangePickerComponentRef, DefaultColumn, DefaultParams, DropdownButtonComponentProps, DropdownButtonMenuItem, FeedbackContextType, FormColLayout, FormColSizeSpan, FormItemComponentProps, IconCheckOrCloseProps, InputComponentProps, InputComponentRef, LinkComponentProps, LinkType, NumberFormatComponentProps, NumberFormatComponentRef, OTPProps, RadioComponentProps, SelectAsyncComponentProps, SelectAsyncComponentRef, SelectAsyncFormat, SelectAsyncProps, SelectComponentProps, SelectOption, SwitchComponentProps, TableAsyncComponentProps, TableAsyncComponentRef, TableAsyncSearchCheckbox, TableAsyncSearchContextType, TableAsyncSearchDate, TableAsyncSearchDateRange, TableAsyncSearchFetchSelectMultiple, TableAsyncSearchItem, TableAsyncSearchItemType, TableAsyncSearchLocalSelectMultiple, TableAsyncSearchProviderProps, TableAsyncSearchSelectFetch, TableAsyncSearchSelectLocal, TableAsyncSearchSelectMultiple, TableAsyncSearchSwitch, TableAsyncSearchText, TableAsyncType, TableButtonMiddle, TableButtonMiddleAsync, TableCellEditableProps, TableComponentProps, TableParams, TableParamsFormatter, TableRowContextType, TableRowProviderProps, TabsComponentProps, TagComponentProps, TextAreaComponentProps, TextAreaComponentRef, UploadDraggerComponentProps, YajraColumn, YajraColumnParams, YajraOrderParams, YajraParams, YajraSearchParams };
|
package/dist/index.esm.js
CHANGED
|
@@ -7539,15 +7539,14 @@ function useViewTransitionState(to, opts = {}) {
|
|
|
7539
7539
|
// lib/server-runtime/crypto.ts
|
|
7540
7540
|
new TextEncoder();
|
|
7541
7541
|
|
|
7542
|
-
const
|
|
7542
|
+
const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data, }) => {
|
|
7543
7543
|
const config = useConfig$1();
|
|
7544
7544
|
const isInertia = config.linkType === 'inertia';
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
};
|
|
7549
|
-
|
|
7550
|
-
const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data, }) => {
|
|
7545
|
+
const link = (href, children) => {
|
|
7546
|
+
if (isInertia)
|
|
7547
|
+
return (jsxRuntimeExports.jsx(Link$2, { href: href, children: children }));
|
|
7548
|
+
return (jsxRuntimeExports.jsx(Link$1, { to: href, children: children }));
|
|
7549
|
+
};
|
|
7551
7550
|
const items = menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(menu => {
|
|
7552
7551
|
const classMenuItem = [];
|
|
7553
7552
|
switch (menu.type) {
|
|
@@ -7564,7 +7563,7 @@ const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data
|
|
|
7564
7563
|
return {
|
|
7565
7564
|
key: menu.key,
|
|
7566
7565
|
icon: menu.icon,
|
|
7567
|
-
label: menu.href ? (
|
|
7566
|
+
label: menu.href ? link(menu.href, menu.label) : menu.label,
|
|
7568
7567
|
className: classMenuItem.join(' '),
|
|
7569
7568
|
onClick: () => { var _a; return (_a = menu.onClick) === null || _a === void 0 ? void 0 : _a.call(menu, data); },
|
|
7570
7569
|
};
|
|
@@ -7583,11 +7582,23 @@ const IconCheckOrClose = ({ check, classNames, style, }) => {
|
|
|
7583
7582
|
return (jsxRuntimeExports.jsx(Icon, { className: classIcon.join(' '), style: style }));
|
|
7584
7583
|
};
|
|
7585
7584
|
|
|
7585
|
+
const OTP = ({ noItem, loading, disabled, size, classNames, variant, mask, separator, length, value, defaultValue, removeError, onChange, onKeyDown, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
7586
|
+
const [valueInput, setValueInput] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
7587
|
+
const handleChange = (value) => {
|
|
7588
|
+
setValueInput(value);
|
|
7589
|
+
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
7590
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
7591
|
+
};
|
|
7592
|
+
const otp = !loading ? (jsxRuntimeExports.jsx(Input$2.OTP, { disabled: disabled, size: size, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), variant: variant, mask: mask, separator: separator, length: length, value: value !== null && value !== void 0 ? value : valueInput, onChange: handleChange, onKeyDown: onKeyDown, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onFocus: onFocus, onBlur: onBlur })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
7593
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, children: otp })))
|
|
7594
|
+
: otp }));
|
|
7595
|
+
};
|
|
7596
|
+
|
|
7586
7597
|
var css_248z$6 = ".style-module_uppercase__IomMt {\n text-transform: uppercase;\n}";
|
|
7587
7598
|
var styleInput = {"uppercase":"style-module_uppercase__IomMt"};
|
|
7588
7599
|
styleInject(css_248z$6);
|
|
7589
7600
|
|
|
7590
|
-
const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNames, variant, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
7601
|
+
const InputComponent = React__default.memo(({ noItem, password, autoFocus, allowClear, size, classNames, variant, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
7591
7602
|
const [valueInput, setValueInput] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
7592
7603
|
const handleChange = (event) => {
|
|
7593
7604
|
setValueInput(event.target.value);
|
|
@@ -7611,8 +7622,16 @@ const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNa
|
|
|
7611
7622
|
};
|
|
7612
7623
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, ruleType: ruleType, ruleMessage: ruleMessage, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: input })))
|
|
7613
7624
|
: input }));
|
|
7625
|
+
});
|
|
7626
|
+
var InputComponent$1 = Object.assign(InputComponent, { OTP });
|
|
7627
|
+
|
|
7628
|
+
const LinkComponent = ({ href, children, }) => {
|
|
7629
|
+
const config = useConfig$1();
|
|
7630
|
+
const isInertia = config.linkType === 'inertia';
|
|
7631
|
+
if (isInertia)
|
|
7632
|
+
return (jsxRuntimeExports.jsx(Link$2, { href: href, children: children }));
|
|
7633
|
+
return (jsxRuntimeExports.jsx(Link$1, { to: href, children: children }));
|
|
7614
7634
|
};
|
|
7615
|
-
var InputComponent$1 = React__default.memo(InputComponent);
|
|
7616
7635
|
|
|
7617
7636
|
const RadioComponent = ({ buttonStyle, options, optionType, onChange, noItem, loading, disabled, removeError, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
7618
7637
|
const radio = !loading ? (jsxRuntimeExports.jsx(Radio.Group, { block: true, buttonStyle: buttonStyle, disabled: disabled, options: options, optionType: optionType, onChange: event => {
|
|
@@ -8373,8 +8392,9 @@ const SelectAsyncComponent = (_a) => {
|
|
|
8373
8392
|
};
|
|
8374
8393
|
var SelectAsyncComponent$1 = React__default.memo(SelectAsyncComponent);
|
|
8375
8394
|
|
|
8376
|
-
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, checked, defaultChecked, removeError, onChange, formColLayout, name, label, required, rules,
|
|
8377
|
-
|
|
8395
|
+
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, value, checked, defaultChecked, removeError, onChange, formColLayout, name, label, required, rules, ruleMessage, validateStatus, help, shouldUpdate, }) => {
|
|
8396
|
+
var _a;
|
|
8397
|
+
const [checkedSwitch, setCheckedSwitch] = useState((_a = value !== null && value !== void 0 ? value : defaultChecked) !== null && _a !== void 0 ? _a : false);
|
|
8378
8398
|
const handleChange = (value, event) => {
|
|
8379
8399
|
setCheckedSwitch(value);
|
|
8380
8400
|
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
@@ -8388,7 +8408,7 @@ const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loa
|
|
|
8388
8408
|
unCheckedChildren,
|
|
8389
8409
|
};
|
|
8390
8410
|
const switchComponent = !loading ? (jsxRuntimeExports.jsx(Switch, Object.assign({}, checkChildren, { onChange: handleChange, disabled: disabled, checked: checked !== null && checked !== void 0 ? checked : checkedSwitch, defaultChecked: checked !== null && checked !== void 0 ? checked : checkedSwitch }))) : jsxRuntimeExports.jsx(Skeleton.Input, { active: true });
|
|
8391
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType:
|
|
8411
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: "boolean", ruleMessage: ruleMessage, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: switchComponent })))
|
|
8392
8412
|
: switchComponent }));
|
|
8393
8413
|
};
|
|
8394
8414
|
var SwitchComponent$1 = React__default.memo(SwitchComponent);
|
package/dist/index.js
CHANGED
|
@@ -7558,15 +7558,14 @@ function useViewTransitionState(to, opts = {}) {
|
|
|
7558
7558
|
// lib/server-runtime/crypto.ts
|
|
7559
7559
|
new TextEncoder();
|
|
7560
7560
|
|
|
7561
|
-
const
|
|
7561
|
+
const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data, }) => {
|
|
7562
7562
|
const config = useConfig$1();
|
|
7563
7563
|
const isInertia = config.linkType === 'inertia';
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
};
|
|
7568
|
-
|
|
7569
|
-
const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data, }) => {
|
|
7564
|
+
const link = (href, children) => {
|
|
7565
|
+
if (isInertia)
|
|
7566
|
+
return (jsxRuntimeExports.jsx(react.Link, { href: href, children: children }));
|
|
7567
|
+
return (jsxRuntimeExports.jsx(Link$1, { to: href, children: children }));
|
|
7568
|
+
};
|
|
7570
7569
|
const items = menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(menu => {
|
|
7571
7570
|
const classMenuItem = [];
|
|
7572
7571
|
switch (menu.type) {
|
|
@@ -7583,7 +7582,7 @@ const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data
|
|
|
7583
7582
|
return {
|
|
7584
7583
|
key: menu.key,
|
|
7585
7584
|
icon: menu.icon,
|
|
7586
|
-
label: menu.href ? (
|
|
7585
|
+
label: menu.href ? link(menu.href, menu.label) : menu.label,
|
|
7587
7586
|
className: classMenuItem.join(' '),
|
|
7588
7587
|
onClick: () => { var _a; return (_a = menu.onClick) === null || _a === void 0 ? void 0 : _a.call(menu, data); },
|
|
7589
7588
|
};
|
|
@@ -7602,11 +7601,23 @@ const IconCheckOrClose = ({ check, classNames, style, }) => {
|
|
|
7602
7601
|
return (jsxRuntimeExports.jsx(Icon, { className: classIcon.join(' '), style: style }));
|
|
7603
7602
|
};
|
|
7604
7603
|
|
|
7604
|
+
const OTP = ({ noItem, loading, disabled, size, classNames, variant, mask, separator, length, value, defaultValue, removeError, onChange, onKeyDown, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
7605
|
+
const [valueInput, setValueInput] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
7606
|
+
const handleChange = (value) => {
|
|
7607
|
+
setValueInput(value);
|
|
7608
|
+
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
7609
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
7610
|
+
};
|
|
7611
|
+
const otp = !loading ? (jsxRuntimeExports.jsx(antd.Input.OTP, { disabled: disabled, size: size, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), variant: variant, mask: mask, separator: separator, length: length, value: value !== null && value !== void 0 ? value : valueInput, onChange: handleChange, onKeyDown: onKeyDown, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onFocus: onFocus, onBlur: onBlur })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
7612
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, children: otp })))
|
|
7613
|
+
: otp }));
|
|
7614
|
+
};
|
|
7615
|
+
|
|
7605
7616
|
var css_248z$6 = ".style-module_uppercase__IomMt {\n text-transform: uppercase;\n}";
|
|
7606
7617
|
var styleInput = {"uppercase":"style-module_uppercase__IomMt"};
|
|
7607
7618
|
styleInject(css_248z$6);
|
|
7608
7619
|
|
|
7609
|
-
const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNames, variant, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
7620
|
+
const InputComponent = React.memo(({ noItem, password, autoFocus, allowClear, size, classNames, variant, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
7610
7621
|
const [valueInput, setValueInput] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
7611
7622
|
const handleChange = (event) => {
|
|
7612
7623
|
setValueInput(event.target.value);
|
|
@@ -7630,8 +7641,16 @@ const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNa
|
|
|
7630
7641
|
};
|
|
7631
7642
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, ruleType: ruleType, ruleMessage: ruleMessage, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: input })))
|
|
7632
7643
|
: input }));
|
|
7644
|
+
});
|
|
7645
|
+
var InputComponent$1 = Object.assign(InputComponent, { OTP });
|
|
7646
|
+
|
|
7647
|
+
const LinkComponent = ({ href, children, }) => {
|
|
7648
|
+
const config = useConfig$1();
|
|
7649
|
+
const isInertia = config.linkType === 'inertia';
|
|
7650
|
+
if (isInertia)
|
|
7651
|
+
return (jsxRuntimeExports.jsx(react.Link, { href: href, children: children }));
|
|
7652
|
+
return (jsxRuntimeExports.jsx(Link$1, { to: href, children: children }));
|
|
7633
7653
|
};
|
|
7634
|
-
var InputComponent$1 = React.memo(InputComponent);
|
|
7635
7654
|
|
|
7636
7655
|
const RadioComponent = ({ buttonStyle, options, optionType, onChange, noItem, loading, disabled, removeError, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
7637
7656
|
const radio = !loading ? (jsxRuntimeExports.jsx(antd.Radio.Group, { block: true, buttonStyle: buttonStyle, disabled: disabled, options: options, optionType: optionType, onChange: event => {
|
|
@@ -8392,8 +8411,9 @@ const SelectAsyncComponent = (_a) => {
|
|
|
8392
8411
|
};
|
|
8393
8412
|
var SelectAsyncComponent$1 = React.memo(SelectAsyncComponent);
|
|
8394
8413
|
|
|
8395
|
-
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, checked, defaultChecked, removeError, onChange, formColLayout, name, label, required, rules,
|
|
8396
|
-
|
|
8414
|
+
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, value, checked, defaultChecked, removeError, onChange, formColLayout, name, label, required, rules, ruleMessage, validateStatus, help, shouldUpdate, }) => {
|
|
8415
|
+
var _a;
|
|
8416
|
+
const [checkedSwitch, setCheckedSwitch] = React.useState((_a = value !== null && value !== void 0 ? value : defaultChecked) !== null && _a !== void 0 ? _a : false);
|
|
8397
8417
|
const handleChange = (value, event) => {
|
|
8398
8418
|
setCheckedSwitch(value);
|
|
8399
8419
|
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
@@ -8407,7 +8427,7 @@ const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loa
|
|
|
8407
8427
|
unCheckedChildren,
|
|
8408
8428
|
};
|
|
8409
8429
|
const switchComponent = !loading ? (jsxRuntimeExports.jsx(antd.Switch, Object.assign({}, checkChildren, { onChange: handleChange, disabled: disabled, checked: checked !== null && checked !== void 0 ? checked : checkedSwitch, defaultChecked: checked !== null && checked !== void 0 ? checked : checkedSwitch }))) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { active: true });
|
|
8410
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType:
|
|
8430
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent$1, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: "boolean", ruleMessage: ruleMessage, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: switchComponent })))
|
|
8411
8431
|
: switchComponent }));
|
|
8412
8432
|
};
|
|
8413
8433
|
var SwitchComponent$1 = React.memo(SwitchComponent);
|