@pnkx-lib/ui 1.6.5 → 1.6.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/es/chunks/{ConfirmModal-Bt_bPSWr.js → ConfirmModal-BB38ZWjg.js} +2 -2
- package/es/fields/index.js +2 -17
- package/es/hooks/index.js +2 -12
- package/es/index.js +5 -75
- package/es/ui/index.js +2 -61
- package/package.json +1 -1
- package/types/fields.d.ts +10 -9
- package/types/hooks.d.ts +5 -5
- package/types/index.d.ts +43 -42
- package/types/ui.d.ts +26 -26
- package/es/chunks/Checkbox-D7JJEnsk.js +0 -156
- package/es/chunks/ConfirmModal-B7zTPvH9.js +0 -12649
- package/es/chunks/Switch-03DUOS9f.js +0 -39396
- package/es/chunks/cloneDeep-DWe9CKmh.js +0 -2424
- package/es/chunks/common-D_yedQmH.js +0 -1283
- package/es/chunks/useMessage-DtM7Izkl.js +0 -97
package/types/ui.d.ts
CHANGED
@@ -16,8 +16,8 @@ import { ColorPickerProps } from 'antd';
|
|
16
16
|
import { ColProps as ColProps_2 } from 'antd';
|
17
17
|
import { ColSize as ColSize_2 } from 'antd/es/grid';
|
18
18
|
import { Control } from 'react-hook-form';
|
19
|
-
import { default as default_2 } from '
|
20
|
-
import { default as default_3 } from '
|
19
|
+
import { default as default_2 } from 'antd/es/anchor/AnchorLink';
|
20
|
+
import { default as default_3 } from 'react';
|
21
21
|
import { DefaultOptionType } from 'antd/es/cascader';
|
22
22
|
import { DefaultValues } from 'react-hook-form';
|
23
23
|
import { DividerProps as DividerProps_2 } from 'antd';
|
@@ -32,7 +32,7 @@ import { FlexProps as FlexProps_2 } from 'antd';
|
|
32
32
|
import { FormEventHandler } from 'react';
|
33
33
|
import { ForwardRefExoticComponent } from 'react';
|
34
34
|
import { ImageProps } from 'antd';
|
35
|
-
import { JSX } from 'react';
|
35
|
+
import { JSX } from 'react/jsx-runtime';
|
36
36
|
import { MenuDividerProps } from 'antd/es/menu';
|
37
37
|
import { MenuItemGroupProps } from 'rc-menu/lib/MenuItemGroup';
|
38
38
|
import { MenuItemProps as MenuItemProps_2 } from 'antd/es/menu';
|
@@ -84,7 +84,7 @@ export declare const Alert: React.FC<AlertProps>;
|
|
84
84
|
export declare type AlertProps = AlertProps_2;
|
85
85
|
|
86
86
|
export declare const Anchor: typeof Anchor_2 & {
|
87
|
-
Link: typeof
|
87
|
+
Link: typeof default_2;
|
88
88
|
};
|
89
89
|
|
90
90
|
export declare interface AnchorProps extends AnchorProps_2 {
|
@@ -92,10 +92,10 @@ export declare interface AnchorProps extends AnchorProps_2 {
|
|
92
92
|
|
93
93
|
export declare type AnchorPropsUnion = BaseProps_13 & AnchorProps;
|
94
94
|
|
95
|
-
export declare const Appfix: ({ children, ...rest }: AppfixProps) =>
|
95
|
+
export declare const Appfix: ({ children, ...rest }: AppfixProps) => JSX.Element;
|
96
96
|
|
97
97
|
export declare interface AppfixProps extends AffixProps {
|
98
|
-
children:
|
98
|
+
children: default_3.ReactNode;
|
99
99
|
}
|
100
100
|
|
101
101
|
export declare const AutoComplete: React.FC<AutoCompleteProps>;
|
@@ -184,7 +184,7 @@ export declare type BreadcrumbPropsUnion = BaseProps_6 & BreadcrumbProps;
|
|
184
184
|
|
185
185
|
export declare type BreadcrumbSeparatorType = BreadcrumbSeparatorType_2;
|
186
186
|
|
187
|
-
export declare const BulkAction: ({ quantity, handleRefresh, handleSend, handleSlash, handleProhibit, handleCheck, handleClose, handleDelete, handleUnLock, handleLock, }: BulkActionProps) =>
|
187
|
+
export declare const BulkAction: ({ quantity, handleRefresh, handleSend, handleSlash, handleProhibit, handleCheck, handleClose, handleDelete, handleUnLock, handleLock, }: BulkActionProps) => JSX.Element;
|
188
188
|
|
189
189
|
export declare interface BulkActionProps {
|
190
190
|
quantity: number;
|
@@ -199,7 +199,7 @@ export declare interface BulkActionProps {
|
|
199
199
|
handleLock?: () => void;
|
200
200
|
}
|
201
201
|
|
202
|
-
export declare const Button:
|
202
|
+
export declare const Button: default_3.FC<ButtonProps>;
|
203
203
|
|
204
204
|
export declare type ButtonProps = ButtonProps_2;
|
205
205
|
|
@@ -240,10 +240,10 @@ export declare interface ConfirmModalProps extends ModalProps {
|
|
240
240
|
handleSubmit?: () => void;
|
241
241
|
}
|
242
242
|
|
243
|
-
export declare const Container:
|
243
|
+
export declare const Container: default_3.FC<ContainerProps>;
|
244
244
|
|
245
245
|
export declare interface ContainerProps {
|
246
|
-
children:
|
246
|
+
children: default_3.ReactNode;
|
247
247
|
size?: TailwindMaxWidth;
|
248
248
|
className?: string;
|
249
249
|
}
|
@@ -277,7 +277,7 @@ export declare const Empty: React.FC<EmptyProps>;
|
|
277
277
|
|
278
278
|
export declare type EmptyProps = EmptyProps_2;
|
279
279
|
|
280
|
-
export declare const ErrorMessage:
|
280
|
+
export declare const ErrorMessage: default_3.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX.Element | null>;
|
281
281
|
|
282
282
|
export declare interface ErrorMessageProps {
|
283
283
|
errorMessage?: string;
|
@@ -322,12 +322,12 @@ export declare interface LabelProps {
|
|
322
322
|
required?: boolean;
|
323
323
|
}
|
324
324
|
|
325
|
-
export declare const Layout:
|
326
|
-
Header:
|
327
|
-
Footer:
|
328
|
-
Content:
|
329
|
-
Sider:
|
330
|
-
_InternalSiderContext:
|
325
|
+
export declare const Layout: default_3.FC<LayoutProps> & {
|
326
|
+
Header: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
|
327
|
+
Footer: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
|
328
|
+
Content: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
|
329
|
+
Sider: default_3.ForwardRefExoticComponent<SiderProps & default_3.RefAttributes<HTMLDivElement>>;
|
330
|
+
_InternalSiderContext: default_3.Context<SiderContextProps>;
|
331
331
|
};
|
332
332
|
|
333
333
|
export declare type LayoutProps = BaseProps_8 & BasicProps;
|
@@ -413,7 +413,7 @@ export declare interface RowProps extends RowProps_2 {
|
|
413
413
|
|
414
414
|
export declare type RowPropsUnion = BaseProps_4 & RowProps;
|
415
415
|
|
416
|
-
export declare const SearchFiltersForm: <T extends FieldValues = FieldValues>({ initialValues, renderFilterFields, onSubmit, onReset, classNamesContainer, classNameWrapperForm, hideDefaultSubmit, hideResetButton, }: SearchFiltersFormProps<T> & Partial<UseFormReturn<T>>) =>
|
416
|
+
export declare const SearchFiltersForm: <T extends FieldValues = FieldValues>({ initialValues, renderFilterFields, onSubmit, onReset, classNamesContainer, classNameWrapperForm, hideDefaultSubmit, hideResetButton, }: SearchFiltersFormProps<T> & Partial<UseFormReturn<T>>) => JSX.Element;
|
417
417
|
|
418
418
|
export declare interface SearchFiltersFormProps<T extends FieldValues> {
|
419
419
|
renderFilterFields?: (options: {
|
@@ -421,7 +421,7 @@ export declare interface SearchFiltersFormProps<T extends FieldValues> {
|
|
421
421
|
setValue?: UseFormSetValue<T>;
|
422
422
|
handleSubmit?: FormEventHandler<any>;
|
423
423
|
reset?: UseFormReset<T>;
|
424
|
-
}) =>
|
424
|
+
}) => default_3.ReactNode;
|
425
425
|
onReset?: () => void;
|
426
426
|
classNamesContainer?: string;
|
427
427
|
classNameWrapperForm?: string;
|
@@ -501,12 +501,12 @@ export declare interface SubMenuProps extends SubMenuProps_2 {
|
|
501
501
|
|
502
502
|
declare type TabItem = {
|
503
503
|
key: string;
|
504
|
-
label:
|
505
|
-
children:
|
504
|
+
label: default_3.ReactNode;
|
505
|
+
children: default_3.ReactNode;
|
506
506
|
disabled?: boolean;
|
507
507
|
};
|
508
508
|
|
509
|
-
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, ...rest }: TableCommonProps<T>) =>
|
509
|
+
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, ...rest }: TableCommonProps<T>) => JSX.Element;
|
510
510
|
|
511
511
|
export declare type TableColumnsType<T> = TableColumnsType_2<T>;
|
512
512
|
|
@@ -523,8 +523,8 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
|
|
523
523
|
onChangePage: (page: number) => void;
|
524
524
|
onChangePageSize: (size: number) => void;
|
525
525
|
onSort?: (sortField: string | number | symbol) => void;
|
526
|
-
rowsSelected?:
|
527
|
-
onSelect: (newSelectedRowKeys:
|
526
|
+
rowsSelected?: default_3.Key[];
|
527
|
+
onSelect: (newSelectedRowKeys: default_3.Key[]) => void;
|
528
528
|
onRowClick?: (record: T) => void;
|
529
529
|
rowKey?: string | ((record: T) => string);
|
530
530
|
className?: string;
|
@@ -532,7 +532,7 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
|
|
532
532
|
onSave?: (data: T) => void;
|
533
533
|
}
|
534
534
|
|
535
|
-
export declare const Tabs:
|
535
|
+
export declare const Tabs: default_3.FC<TabsProps>;
|
536
536
|
|
537
537
|
export declare type TabsProps = TabsProps_2 & {
|
538
538
|
items: TabItem[];
|
@@ -551,7 +551,7 @@ export declare const Timeline: React.FC<TimelineProps>;
|
|
551
551
|
|
552
552
|
export declare type TimelineProps = TimelineProps_2;
|
553
553
|
|
554
|
-
export declare const Tooltip:
|
554
|
+
export declare const Tooltip: default_3.FC<TooltipProps>;
|
555
555
|
|
556
556
|
export declare type TooltipProps = TooltipProps_2;
|
557
557
|
|
@@ -1,156 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const Switch = require('./Switch-03DUOS9f.js');
|
4
|
-
const antd = require('antd');
|
5
|
-
|
6
|
-
const Select = (props) => {
|
7
|
-
//! State
|
8
|
-
const {
|
9
|
-
field,
|
10
|
-
formState,
|
11
|
-
label,
|
12
|
-
required,
|
13
|
-
afterOnChange,
|
14
|
-
customStyleContainer,
|
15
|
-
...restProps
|
16
|
-
} = props;
|
17
|
-
const { name, value, onChange, onBlur } = field || {};
|
18
|
-
const { touchedFields, errors, isSubmitted } = formState || {};
|
19
|
-
const isTouched = Switch.get(touchedFields, name);
|
20
|
-
const errorMessage = Switch.get(errors, name)?.message;
|
21
|
-
//! Function
|
22
|
-
const handleChange = (val) => {
|
23
|
-
onChange?.(val);
|
24
|
-
afterOnChange?.(val);
|
25
|
-
};
|
26
|
-
const renderErrorMessage = () => {
|
27
|
-
if (!errorMessage) return null;
|
28
|
-
return /* @__PURE__ */ Switch.jsxRuntimeExports.jsx(
|
29
|
-
Switch.ErrorMessage,
|
30
|
-
{
|
31
|
-
errorMessage,
|
32
|
-
isTouched,
|
33
|
-
isSubmitted
|
34
|
-
}
|
35
|
-
);
|
36
|
-
};
|
37
|
-
//! Render
|
38
|
-
return /* @__PURE__ */ Switch.jsxRuntimeExports.jsxs("div", { className: customStyleContainer, children: [
|
39
|
-
label && /* @__PURE__ */ Switch.jsxRuntimeExports.jsx(Switch.Label, { label, required }),
|
40
|
-
/* @__PURE__ */ Switch.jsxRuntimeExports.jsx(
|
41
|
-
antd.Select,
|
42
|
-
{
|
43
|
-
onChange: handleChange,
|
44
|
-
onBlur,
|
45
|
-
value,
|
46
|
-
style: { width: "100%" },
|
47
|
-
optionLabelProp: "label",
|
48
|
-
status: (isTouched || isSubmitted) && Boolean(errorMessage) ? "error" : void 0,
|
49
|
-
...restProps
|
50
|
-
}
|
51
|
-
),
|
52
|
-
renderErrorMessage()
|
53
|
-
] });
|
54
|
-
};
|
55
|
-
|
56
|
-
const RadioGroup = (props) => {
|
57
|
-
//! State
|
58
|
-
const {
|
59
|
-
field,
|
60
|
-
formState,
|
61
|
-
customStyleRadio,
|
62
|
-
customStyleWrap = "",
|
63
|
-
afterOnChange,
|
64
|
-
options,
|
65
|
-
...restProps
|
66
|
-
} = props;
|
67
|
-
const { name, value, onChange } = field || {};
|
68
|
-
const { touchedFields, errors, isSubmitted } = formState || {};
|
69
|
-
const isTouched = Switch.get(touchedFields, name);
|
70
|
-
const errorMessage = Switch.get(errors, name)?.message;
|
71
|
-
//! Function
|
72
|
-
const handleChange = (e) => {
|
73
|
-
onChange?.(e);
|
74
|
-
afterOnChange?.(e?.target?.value);
|
75
|
-
};
|
76
|
-
const renderErrorMessage = () => {
|
77
|
-
if (!errorMessage) return null;
|
78
|
-
return /* @__PURE__ */ Switch.jsxRuntimeExports.jsx(
|
79
|
-
Switch.ErrorMessage,
|
80
|
-
{
|
81
|
-
errorMessage,
|
82
|
-
isTouched,
|
83
|
-
isSubmitted
|
84
|
-
}
|
85
|
-
);
|
86
|
-
};
|
87
|
-
//! Render
|
88
|
-
return /* @__PURE__ */ Switch.jsxRuntimeExports.jsxs("div", { className: customStyleWrap, children: [
|
89
|
-
/* @__PURE__ */ Switch.jsxRuntimeExports.jsx(antd.Radio.Group, { onChange: handleChange, value, ...restProps, children: options.map((item) => /* @__PURE__ */ Switch.jsxRuntimeExports.jsx(
|
90
|
-
antd.Radio,
|
91
|
-
{
|
92
|
-
value: item.value,
|
93
|
-
className: customStyleRadio,
|
94
|
-
children: /* @__PURE__ */ Switch.jsxRuntimeExports.jsxs(Switch.Typography.Text, { children: [
|
95
|
-
" ",
|
96
|
-
item.label
|
97
|
-
] })
|
98
|
-
},
|
99
|
-
`${name}-${item.value}`
|
100
|
-
)) }),
|
101
|
-
renderErrorMessage()
|
102
|
-
] });
|
103
|
-
};
|
104
|
-
|
105
|
-
const CheckboxField = (props) => {
|
106
|
-
//! State
|
107
|
-
const {
|
108
|
-
field,
|
109
|
-
formState,
|
110
|
-
label,
|
111
|
-
afterOnChange,
|
112
|
-
customStyleContainer,
|
113
|
-
customStyleCheckbox,
|
114
|
-
...restProps
|
115
|
-
} = props;
|
116
|
-
const { name, value, onChange, onBlur } = field || {};
|
117
|
-
const { touchedFields, errors, isSubmitted } = formState || {};
|
118
|
-
const isTouched = Switch.get(touchedFields, name);
|
119
|
-
const errorMessage = Switch.get(errors, name)?.message;
|
120
|
-
//! Function
|
121
|
-
const handleChange = (e) => {
|
122
|
-
const checked = e.target.checked;
|
123
|
-
onChange?.(checked);
|
124
|
-
afterOnChange?.(checked);
|
125
|
-
};
|
126
|
-
const renderErrorMessage = () => {
|
127
|
-
if (!errorMessage) return null;
|
128
|
-
return /* @__PURE__ */ Switch.jsxRuntimeExports.jsx(
|
129
|
-
Switch.ErrorMessage,
|
130
|
-
{
|
131
|
-
errorMessage,
|
132
|
-
isTouched,
|
133
|
-
isSubmitted
|
134
|
-
}
|
135
|
-
);
|
136
|
-
};
|
137
|
-
//! Render
|
138
|
-
return /* @__PURE__ */ Switch.jsxRuntimeExports.jsxs("div", { className: customStyleContainer, children: [
|
139
|
-
/* @__PURE__ */ Switch.jsxRuntimeExports.jsx(
|
140
|
-
antd.Checkbox,
|
141
|
-
{
|
142
|
-
onBlur,
|
143
|
-
checked: !!value,
|
144
|
-
onChange: handleChange,
|
145
|
-
className: customStyleCheckbox,
|
146
|
-
...restProps,
|
147
|
-
children: /* @__PURE__ */ Switch.jsxRuntimeExports.jsx(Switch.Typography.Text, { children: label })
|
148
|
-
}
|
149
|
-
),
|
150
|
-
renderErrorMessage()
|
151
|
-
] });
|
152
|
-
};
|
153
|
-
|
154
|
-
exports.CheckboxField = CheckboxField;
|
155
|
-
exports.RadioGroup = RadioGroup;
|
156
|
-
exports.Select = Select;
|