@pnkx-lib/ui 1.9.35 → 1.9.36

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/types/ui.d.ts CHANGED
@@ -17,8 +17,8 @@ import { ColProps as ColProps_2 } from 'antd';
17
17
  import { ColSize } from 'antd/es/grid';
18
18
  import { Component } from 'react';
19
19
  import { Control } from 'react-hook-form';
20
- import { default as default_2 } from 'react';
21
- import { default as default_3 } from 'antd/es/anchor/AnchorLink';
20
+ import { default as default_2 } from 'antd/es/anchor/AnchorLink';
21
+ import { default as default_3 } from 'react';
22
22
  import { DefaultOptionType } from 'antd/es/cascader';
23
23
  import { DefaultValues } from 'react-hook-form';
24
24
  import { DividerProps as DividerProps_2 } from 'antd';
@@ -34,7 +34,7 @@ import { FlexProps as FlexProps_2 } from 'antd';
34
34
  import { FormEventHandler } from 'react';
35
35
  import { ForwardRefExoticComponent } from 'react';
36
36
  import { ImageProps } from 'antd';
37
- import { JSX } from 'react/jsx-runtime';
37
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
38
38
  import { MenuDividerProps } from 'antd/es/menu';
39
39
  import { MenuItemGroupProps } from 'rc-menu/lib/MenuItemGroup';
40
40
  import { MenuItemProps as MenuItemProps_2 } from 'antd/es/menu';
@@ -76,43 +76,32 @@ import { TitleProps } from 'antd/es/typography/Title';
76
76
  import { TooltipProps as TooltipProps_2 } from 'antd';
77
77
  import { TourProps as TourProps_2 } from 'antd';
78
78
  import { TreeProps as TreeProps_2 } from 'antd';
79
- import { TypeActionRowTable as TypeActionRowTable_2 } from '../../../../../../../../../../../../src/constants/table';
80
79
  import { UseFormReset } from 'react-hook-form';
81
80
  import { UseFormReturn } from 'react-hook-form';
82
81
  import { UseFormSetValue } from 'react-hook-form';
83
82
  import { WatermarkProps } from 'antd';
84
83
 
85
- export declare const ActionRowTable: ({ type, contentTooltip, handleClick, }: ActionRowTableProps) => JSX.Element;
86
-
87
- export declare interface ActionRowTableProps {
88
- type: TypeActionRowTable_2;
89
- handleClick?: () => void;
90
- contentTooltip?: default_2.ReactNode;
91
- content?: default_2.ReactNode;
92
- diabled?: boolean;
93
- }
94
-
95
84
  export declare const Alert: React.FC<AlertProps>;
96
85
 
97
86
  export declare type AlertProps = AlertProps_2;
98
87
 
99
88
  export declare const Anchor: typeof Anchor_2 & {
100
- Link: typeof default_3;
89
+ Link: typeof default_2;
101
90
  };
102
91
 
103
92
  export declare type AnchorPropsUnion = BaseProps_13 & AnchorProps;
104
93
 
105
- export declare const Appfix: ({ children, ...rest }: AppfixProps) => JSX.Element;
94
+ export declare const Appfix: ({ children, ...rest }: AppfixProps) => JSX_2.Element;
106
95
 
107
96
  export declare interface AppfixProps extends AffixProps {
108
- children: default_2.ReactNode;
97
+ children: default_3.ReactNode;
109
98
  }
110
99
 
111
100
  export declare const AutoComplete: React.FC<AutoCompleteProps>;
112
101
 
113
102
  export declare type AutoCompleteProps = AutoCompleteProps_2;
114
103
 
115
- export declare const Badge: ({ type, children, customColor, ...rest }: BadgeProps) => JSX.Element;
104
+ export declare const Badge: ({ type, children, customColor, ...rest }: BadgeProps) => JSX_2.Element;
116
105
 
117
106
  export declare interface BadgeProps extends BadgeProps_2 {
118
107
  type?: "error" | "info" | "success" | "warning";
@@ -182,7 +171,7 @@ declare type BaseProps_9 = {
182
171
  spaceClassName?: string;
183
172
  };
184
173
 
185
- export declare const Breadcrumb: (props: BreadcrumbPropsUnion) => JSX.Element;
174
+ export declare const Breadcrumb: (props: BreadcrumbPropsUnion) => JSX_2.Element;
186
175
 
187
176
  export declare interface BreadcrumbItemType extends BreadcrumbItemType_2 {
188
177
  children?: Omit<BreadcrumbItemType, "children">[];
@@ -194,7 +183,7 @@ export declare type BreadcrumbPropsUnion = BaseProps_6 & BreadcrumbProps;
194
183
 
195
184
  export declare type BreadcrumbSeparatorType = BreadcrumbSeparatorType_2;
196
185
 
197
- export declare const BulkAction: ({ quantity, handleRestore, handleSendApproval, handleCancelSendApproval, handleRefuseApproval, handleApproval, handleCancelApproval, handleDelete, handleActivate, handleInActivate, status, }: BulkActionProps) => JSX.Element;
186
+ export declare const BulkAction: ({ quantity, handleRestore, handleSendApproval, handleCancelSendApproval, handleRefuseApproval, handleApproval, handleCancelApproval, handleDelete, handleActivate, handleInActivate, status, }: BulkActionProps) => JSX_2.Element;
198
187
 
199
188
  export declare interface BulkActionProps {
200
189
  quantity: number;
@@ -210,21 +199,15 @@ export declare interface BulkActionProps {
210
199
  status?: number;
211
200
  }
212
201
 
213
- export declare const Button: default_2.FC<ButtonProps>;
202
+ export declare const Button: default_3.FC<ButtonProps>;
214
203
 
215
204
  export declare type ButtonProps = ButtonProps_2;
216
205
 
217
- export declare const CascaderField: (props: CascaderFieldProps) => JSX.Element;
206
+ export declare const CascaderField: (props: CascaderFieldProps) => JSX_2.Element;
218
207
 
219
208
  export declare type CascaderFieldProps = BaseProps & (SingleCascaderProps | MultipleCascaderProps);
220
209
 
221
- export declare const CategoryStatus: ({ status }: CategoryStatusProps) => JSX.Element;
222
-
223
- export declare interface CategoryStatusProps {
224
- status: number;
225
- }
226
-
227
- export declare const Col: (props: ColPropsUnion) => JSX.Element;
210
+ export declare const Col: (props: ColPropsUnion) => JSX_2.Element;
228
211
 
229
212
  export declare interface ColProps extends ColProps_2, Partial<Record<Breakpoint, ColSpanType | ColSize>> {
230
213
  }
@@ -242,7 +225,7 @@ declare type CompoundedMenu = FC<MenuComponentProps> & {
242
225
  ItemGroup: typeof ItemGroup;
243
226
  };
244
227
 
245
- export declare const ConfirmModal: ({ title, content, typeIcon, titleCancelBtn, titleSubmitBtn, handleCancel, handleSubmit, ...restProps }: ConfirmModalProps) => JSX.Element;
228
+ export declare const ConfirmModal: ({ title, content, typeIcon, titleCancelBtn, titleSubmitBtn, handleCancel, handleSubmit, ...restProps }: ConfirmModalProps) => JSX_2.Element;
246
229
 
247
230
  export declare interface ConfirmModalProps extends ModalProps {
248
231
  title: string;
@@ -256,15 +239,15 @@ export declare interface ConfirmModalProps extends ModalProps {
256
239
 
257
240
  export declare type ConfirmModalType = "success" | "error" | "warning" | "info";
258
241
 
259
- export declare const Container: default_2.FC<ContainerProps>;
242
+ export declare const Container: default_3.FC<ContainerProps>;
260
243
 
261
244
  export declare interface ContainerProps {
262
- children: default_2.ReactNode;
245
+ children: default_3.ReactNode;
263
246
  size?: TailwindMaxWidth;
264
247
  className?: string;
265
248
  }
266
249
 
267
- export declare const Divider: ({ children, ...rest }: DividerProps) => JSX.Element;
250
+ export declare const Divider: ({ children, ...rest }: DividerProps) => JSX_2.Element;
268
251
 
269
252
  declare const Divider_2: FC<MenuDividerProps>;
270
253
 
@@ -272,14 +255,14 @@ export declare interface DividerProps extends DividerProps_2 {
272
255
  children?: ReactNode | string;
273
256
  }
274
257
 
275
- export declare const Drawer: ({ onSubmit, children, ...rest }: DrawerProps) => JSX.Element;
258
+ export declare const Drawer: ({ onSubmit, children, ...rest }: DrawerProps) => JSX_2.Element;
276
259
 
277
260
  export declare interface DrawerProps extends DrawerProps_2 {
278
261
  children?: ReactNode;
279
262
  onSubmit?: (values: any) => void;
280
263
  }
281
264
 
282
- export declare const Dropdown: (props: DropdownPropsUnion) => JSX.Element;
265
+ export declare const Dropdown: (props: DropdownPropsUnion) => JSX_2.Element;
283
266
 
284
267
  export declare type DropdownButtonProps = DropdownButtonProps_2;
285
268
 
@@ -300,7 +283,7 @@ declare class ErrorBoundaryClass extends Component<ErrorBoundaryProps, ErrorBoun
300
283
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
301
284
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
302
285
  handleReload: () => void;
303
- render(): default_2.ReactNode;
286
+ render(): default_3.ReactNode;
304
287
  }
305
288
 
306
289
  export declare interface ErrorBoundaryProps {
@@ -313,7 +296,7 @@ export declare interface ErrorBoundaryState {
313
296
  errorInfo: ErrorInfo | null;
314
297
  }
315
298
 
316
- export declare const ErrorMessage: default_2.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX.Element | null>;
299
+ export declare const ErrorMessage: default_3.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX_2.Element | null>;
317
300
 
318
301
  export declare interface ErrorMessageProps {
319
302
  errorMessage?: string;
@@ -326,13 +309,13 @@ declare type ExtraProps = {
326
309
  menuClassName?: string;
327
310
  };
328
311
 
329
- export declare const Flex: (props: FlexPropsUnion) => JSX.Element;
312
+ export declare const Flex: (props: FlexPropsUnion) => JSX_2.Element;
330
313
 
331
314
  export declare type FlexProps = FlexProps_2;
332
315
 
333
316
  export declare type FlexPropsUnion = BaseProps_7 & FlexProps;
334
317
 
335
- export declare const Heading: (props: HeadingProps) => JSX.Element;
318
+ export declare const Heading: (props: HeadingProps) => JSX_2.Element;
336
319
 
337
320
  export declare interface HeadingProps {
338
321
  rightContent?: ReactNode;
@@ -351,19 +334,19 @@ declare const ItemGroup: ForwardRefExoticComponent<Omit<MenuItemGroupProps, "ref
351
334
 
352
335
  export declare type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
353
336
 
354
- export declare const Label: ({ label, required }: LabelProps) => JSX.Element;
337
+ export declare const Label: ({ label, required }: LabelProps) => JSX_2.Element;
355
338
 
356
339
  export declare interface LabelProps {
357
340
  label: string;
358
341
  required?: boolean;
359
342
  }
360
343
 
361
- export declare const Layout: default_2.FC<LayoutProps> & {
362
- Header: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
363
- Footer: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
364
- Content: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
365
- Sider: default_2.ForwardRefExoticComponent<SiderProps & default_2.RefAttributes<HTMLDivElement>>;
366
- _InternalSiderContext: default_2.Context<SiderContextProps>;
344
+ export declare const Layout: default_3.FC<LayoutProps> & {
345
+ Header: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
346
+ Footer: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
347
+ Content: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
348
+ Sider: default_3.ForwardRefExoticComponent<SiderProps & default_3.RefAttributes<HTMLDivElement>>;
349
+ _InternalSiderContext: default_3.Context<SiderContextProps>;
367
350
  };
368
351
 
369
352
  export declare type LayoutProps = BaseProps_8 & BasicProps;
@@ -378,20 +361,17 @@ export declare type MenuItemProps = MenuItemProps_2;
378
361
 
379
362
  export declare type MenuProps = MenuProps_2;
380
363
 
381
- export declare const Modal: ({ children, ...rest }: ModalProps) => JSX.Element;
364
+ export declare const Modal: ({ children, onOk, onSubmit, ...rest }: ModalProps) => JSX_2.Element;
382
365
 
383
366
  export declare interface ModalProps extends ModalProps_2 {
384
367
  children?: ReactNode;
368
+ onSubmit?: () => void;
385
369
  }
386
370
 
387
371
  declare type MultipleCascaderProps = CascaderProps<DefaultOptionType, string, true> & {
388
372
  multiple: true;
389
373
  };
390
374
 
391
- export declare const PAGE_INDEX = "PageIndex";
392
-
393
- export declare const PAGE_SIZE = "PageSize";
394
-
395
375
  export declare const Pagination: typeof Pagination_2;
396
376
 
397
377
  export declare type PaginationConfig = Omit<PaginationProps, "rootClassName"> & {
@@ -414,13 +394,13 @@ export declare interface PnkxSpinProps extends SpinProps {
414
394
  children?: ReactNode;
415
395
  }
416
396
 
417
- export declare const Popconfirm: ({ children, ...rest }: PopconfirmProps) => JSX.Element;
397
+ export declare const Popconfirm: ({ children, ...rest }: PopconfirmProps) => JSX_2.Element;
418
398
 
419
399
  export declare interface PopconfirmProps extends PopconfirmProps_2 {
420
400
  children?: ReactNode;
421
401
  }
422
402
 
423
- export declare const Popover: (props: PopoverPropsUnion) => JSX.Element;
403
+ export declare const Popover: (props: PopoverPropsUnion) => JSX_2.Element;
424
404
 
425
405
  export declare type PopoverProps = PopoverProps_2;
426
406
 
@@ -432,13 +412,13 @@ export declare type QRCodeProps = QRCodeProps_2;
432
412
 
433
413
  export declare const Rate: React.FC<RateProps>;
434
414
 
435
- export declare const Result: ({ children, ...rest }: ResultProps) => JSX.Element;
415
+ export declare const Result: ({ children, ...rest }: ResultProps) => JSX_2.Element;
436
416
 
437
417
  export declare interface ResultProps extends ResultProps_2 {
438
418
  children?: ReactNode | string;
439
419
  }
440
420
 
441
- export declare const Row: (props: RowPropsUnion) => JSX.Element;
421
+ export declare const Row: (props: RowPropsUnion) => JSX_2.Element;
442
422
 
443
423
  declare interface RowCommon {
444
424
  [x: string]: any;
@@ -446,7 +426,7 @@ declare interface RowCommon {
446
426
 
447
427
  export declare type RowPropsUnion = BaseProps_4 & RowProps;
448
428
 
449
- export declare const SearchFiltersForm: <T extends FieldValues = FieldValues>({ initialValues, renderFilterFields, onSubmit, onReset, classNamesContainer, classNameWrapperForm, hideDefaultSubmit, hideResetButton, }: SearchFiltersFormProps<T> & Partial<UseFormReturn<T>>) => JSX.Element;
429
+ export declare const SearchFiltersForm: <T extends FieldValues = FieldValues>({ initialValues, renderFilterFields, onSubmit, onReset, classNamesContainer, classNameWrapperForm, hideDefaultSubmit, hideResetButton, }: SearchFiltersFormProps<T> & Partial<UseFormReturn<T>>) => JSX_2.Element;
450
430
 
451
431
  export declare interface SearchFiltersFormProps<T extends FieldValues> {
452
432
  renderFilterFields?: (options: {
@@ -454,7 +434,7 @@ export declare interface SearchFiltersFormProps<T extends FieldValues> {
454
434
  setValue?: UseFormSetValue<T>;
455
435
  handleSubmit?: FormEventHandler<any>;
456
436
  reset?: UseFormReset<T>;
457
- }) => default_2.ReactNode;
437
+ }) => default_3.ReactNode;
458
438
  onReset?: () => void;
459
439
  classNamesContainer?: string;
460
440
  classNameWrapperForm?: string;
@@ -468,7 +448,7 @@ export declare const Segmented: React.FC<SegmentedProps>;
468
448
 
469
449
  export declare type SegmentedProps = SegmentedProps_2;
470
450
 
471
- export declare const Sidebar: ({ children, menu }: SidebarProps) => JSX.Element;
451
+ export declare const Sidebar: ({ children, menu }: SidebarProps) => JSX_2.Element;
472
452
 
473
453
  export declare interface SidebarProps {
474
454
  children?: React.ReactNode;
@@ -489,31 +469,23 @@ declare type SingleCascaderProps = CascaderProps<DefaultOptionType, string> & {
489
469
  multiple?: false;
490
470
  };
491
471
 
492
- export declare const Skeleton: ({ type, skeletonButtonCount }: SkeletonProps) => JSX.Element;
472
+ export declare const Skeleton: ({ type, skeletonButtonCount }: SkeletonProps) => JSX_2.Element;
493
473
 
494
474
  export declare interface SkeletonProps extends SkeletonProps_2 {
495
475
  type?: "table" | "form";
496
476
  skeletonButtonCount?: number;
497
477
  }
498
478
 
499
- export declare const SORT_BY = "SortBy";
500
-
501
- export declare const SORT_DESC = "SortDesc";
502
-
503
479
  export declare const Space: typeof Space_2;
504
480
 
505
481
  export declare type SpacePropsUnion = BaseProps_9 & SpaceProps;
506
482
 
507
- export declare const Spin: ({ children, ...rest }: PnkxSpinProps) => JSX.Element;
483
+ export declare const Spin: ({ children, ...rest }: PnkxSpinProps) => JSX_2.Element;
508
484
 
509
485
  export declare const Splitter: typeof Splitter_2;
510
486
 
511
487
  export declare type SplitterPropsUnion = BaseProps_10 & SplitterProps;
512
488
 
513
- export declare const START_PAGE = 1;
514
-
515
- export declare const START_PAGE_SIZE = 10;
516
-
517
489
  export declare const Statistic: React.FC<StatisticProps>;
518
490
 
519
491
  export declare type StatisticProps = StatisticProps_2;
@@ -534,12 +506,12 @@ export declare type SubMenuProps = SubMenuProps_2;
534
506
 
535
507
  declare type TabItem = {
536
508
  key: string;
537
- label: default_2.ReactNode;
538
- children: default_2.ReactNode;
509
+ label: default_3.ReactNode;
510
+ children: default_3.ReactNode;
539
511
  disabled?: boolean;
540
512
  };
541
513
 
542
- export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, titleSettingTableModal, showSetting, setColumns, ...rest }: TableCommonProps<T>) => JSX.Element;
514
+ export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, titleSettingTableModal, showSetting, setColumns, ...rest }: TableCommonProps<T>) => JSX_2.Element;
543
515
 
544
516
  export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
545
517
 
@@ -556,8 +528,8 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
556
528
  onChangePage: (page: number) => void;
557
529
  onChangePageSize: (size: number) => void;
558
530
  onSort?: (sortField: string | number | symbol) => void;
559
- rowsSelected?: default_2.Key[];
560
- onSelect: (newSelectedRowKeys: default_2.Key[]) => void;
531
+ rowsSelected?: default_3.Key[];
532
+ onSelect: (newSelectedRowKeys: default_3.Key[]) => void;
561
533
  onRowClick?: (record: T) => void;
562
534
  rowKey?: string | ((record: T) => string);
563
535
  className?: string;
@@ -568,7 +540,7 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
568
540
  setColumns?: (newColumns: TableColumnsType<T>) => void;
569
541
  }
570
542
 
571
- export declare const Tabs: default_2.FC<TabsProps>;
543
+ export declare const Tabs: default_3.FC<TabsProps>;
572
544
 
573
545
  export declare type TabsProps = TabsProps_2 & {
574
546
  items: TabItem[];
@@ -587,9 +559,7 @@ export declare const Timeline: React.FC<TimelineProps>;
587
559
 
588
560
  export declare type TimelineProps = TimelineProps_2;
589
561
 
590
- export declare const TINY_API = "miai0qn3c79adm555yoxd9kz6j6a323ek760nf7qd81nv1p5";
591
-
592
- export declare const Tooltip: default_2.FC<TooltipProps>;
562
+ export declare const Tooltip: default_3.FC<TooltipProps>;
593
563
 
594
564
  export declare type TooltipProps = TooltipProps_2;
595
565
 
@@ -601,28 +571,14 @@ export declare const Tree: React.FC<TreeProps>;
601
571
 
602
572
  export declare type TreeProps = TreeProps_2;
603
573
 
604
- export declare enum TypeActionRowTable {
605
- DELETE = "DELETE",
606
- EDIT = "EDIT",
607
- UNDO = "UNDO",
608
- CANCELUNDO = "CANCELUNDO",
609
- CHECKIN = "CHECKIN",
610
- PRINT = "PRINT",
611
- PAYMENT = "PAYMENT",
612
- PLAY = "PLAY",
613
- PAUSE = "PAUSE",
614
- DOWNLOAD = "DOWNLOAD",
615
- VIEW = "VIEW"
616
- }
617
-
618
574
  export declare const typeColorMap: Record<NonNullable<BadgeProps["type"]>, string>;
619
575
 
620
576
  export declare const Typography: {
621
- Title: (props: TitleProps) => JSX.Element;
622
- Paragraph: (props: ParagraphProps) => JSX.Element;
623
- Text: (props: TextProps) => JSX.Element;
577
+ Title: (props: TitleProps) => JSX_2.Element;
578
+ Paragraph: (props: ParagraphProps) => JSX_2.Element;
579
+ Text: (props: TextProps) => JSX_2.Element;
624
580
  };
625
581
 
626
- export declare const Watermark: ({ ...rest }: WatermarkProps) => JSX.Element;
582
+ export declare const Watermark: ({ ...rest }: WatermarkProps) => JSX_2.Element;
627
583
 
628
584
  export { }
@@ -1,103 +0,0 @@
1
- import { g as get, j as jsxRuntimeExports, L as Label, E as ErrorMessage, T as Typography } from './Switch-Ck9WdQgt.js';
2
- import { Select as Select$1, Radio } from 'antd';
3
-
4
- const Select = (props) => {
5
- //! State
6
- const {
7
- field,
8
- formState,
9
- label,
10
- required,
11
- afterOnChange,
12
- customStyleContainer,
13
- ...restProps
14
- } = props;
15
- const { name, value, onChange, onBlur } = field || {};
16
- const { touchedFields, errors, isSubmitted } = formState || {};
17
- const isTouched = get(touchedFields, name);
18
- const errorMessage = get(errors, name)?.message;
19
- //! Function
20
- const handleChange = (val) => {
21
- onChange?.(val);
22
- afterOnChange?.(val);
23
- };
24
- const renderErrorMessage = () => {
25
- if (!errorMessage) return null;
26
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
27
- ErrorMessage,
28
- {
29
- errorMessage,
30
- isTouched,
31
- isSubmitted
32
- }
33
- );
34
- };
35
- //! Render
36
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: customStyleContainer, children: [
37
- label && /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { label, required }),
38
- /* @__PURE__ */ jsxRuntimeExports.jsx(
39
- Select$1,
40
- {
41
- onChange: handleChange,
42
- onBlur,
43
- value,
44
- style: { width: "100%" },
45
- optionLabelProp: "label",
46
- status: (isTouched || isSubmitted) && Boolean(errorMessage) ? "error" : void 0,
47
- ...restProps
48
- }
49
- ),
50
- renderErrorMessage()
51
- ] });
52
- };
53
-
54
- const RadioGroup = (props) => {
55
- //! State
56
- const {
57
- field,
58
- formState,
59
- customStyleRadio,
60
- customStyleWrap = "",
61
- afterOnChange,
62
- options,
63
- ...restProps
64
- } = props;
65
- const { name, value, onChange } = field || {};
66
- const { touchedFields, errors, isSubmitted } = formState || {};
67
- const isTouched = get(touchedFields, name);
68
- const errorMessage = get(errors, name)?.message;
69
- //! Function
70
- const handleChange = (e) => {
71
- onChange?.(e);
72
- afterOnChange?.(e?.target?.value);
73
- };
74
- const renderErrorMessage = () => {
75
- if (!errorMessage) return null;
76
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
77
- ErrorMessage,
78
- {
79
- errorMessage,
80
- isTouched,
81
- isSubmitted
82
- }
83
- );
84
- };
85
- //! Render
86
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: customStyleWrap, children: [
87
- /* @__PURE__ */ jsxRuntimeExports.jsx(Radio.Group, { onChange: handleChange, value, ...restProps, children: options.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(
88
- Radio,
89
- {
90
- value: item.value,
91
- className: customStyleRadio,
92
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { children: [
93
- " ",
94
- item.label
95
- ] })
96
- },
97
- `${name}-${item.value}`
98
- )) }),
99
- renderErrorMessage()
100
- ] });
101
- };
102
-
103
- export { RadioGroup as R, Select as S };