@pnkx-lib/ui 1.1.19 → 1.1.21

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.
@@ -1,11 +1,12 @@
1
- import { C as i, D as s, I as d, P as l, R as o, a as r, S as F, T as c } from "../chunks/Switch-Dy3JDxO_.js";
1
+ import { D as i, I as s, R as o, a as r } from "../chunks/Switch-DAZukdDR.js";
2
+ import { C as l, P as t, R as F, S as c } from "../chunks/Checkbox-CXb4qF1Z.js";
2
3
  export {
3
- i as CheckboxField,
4
- s as DatePickerField,
5
- d as Input,
6
- l as PnkxField,
7
- o as RadioGroup,
8
- r as RangePickerField,
9
- F as SelectField,
10
- c as TinyMCE
4
+ l as CheckboxField,
5
+ i as DatePickerField,
6
+ s as Input,
7
+ t as PnkxField,
8
+ F as RadioGroup,
9
+ o as RangePickerField,
10
+ c as SelectField,
11
+ r as TinyMCE
11
12
  };
package/dist/index.js CHANGED
@@ -1,38 +1,39 @@
1
- import { d as e, f as o, B as r, C as t, e as i, c as l, D as p, F as d, L as n, i as F, M as c, j as C, P as S, R as P, b as T, S as g, g as k, h as u, k as x, a as M, T as b, t as m } from "./chunks/Steps-Bfcmz8iH.js";
2
- import { E as R, L as f, T as h } from "./chunks/AntdIcon-BohCHsd5.js";
3
- import { C as D, D as L, I as E, P as w, R as I, a as j, S as v, T as G } from "./chunks/Switch-Dy3JDxO_.js";
1
+ import { g as e, B as o, C as r, f as t, D as l, F as i, L as n, j as p, M as d, k as F, e as P, d as c, P as k, c as x, R as C, S, h as T, i as b, l as g, T as u, b as M, a as R, t as m } from "./chunks/Steps-CqDrt6vm.js";
2
+ import { D as f, E as h, I as B, L as D, R as L, a as E, T as w } from "./chunks/Switch-DAZukdDR.js";
3
+ import { C as j, P as v, R as G, S as q } from "./chunks/Checkbox-CXb4qF1Z.js";
4
4
  export {
5
- e as Badge,
6
- o as Breadcrumb,
7
- r as Button,
8
- t as CascaderField,
9
- D as CheckboxField,
10
- i as Col,
11
- l as Container,
12
- L as DatePickerField,
13
- p as Dropdown,
14
- R as ErrorMessage,
15
- d as Flex,
16
- E as Input,
17
- f as Label,
5
+ e as Breadcrumb,
6
+ o as Button,
7
+ r as CascaderField,
8
+ j as CheckboxField,
9
+ t as Col,
10
+ f as DatePickerField,
11
+ l as Dropdown,
12
+ h as ErrorMessage,
13
+ i as Flex,
14
+ B as Input,
15
+ D as Label,
18
16
  n as Layout,
19
- F as Menu,
20
- c as Modal,
21
- C as Pagination,
22
- w as PnkxField,
23
- S as Popover,
24
- I as RadioGroup,
25
- j as RangePickerField,
26
- P as Row,
27
- T as SearchFiltersForm,
28
- v as SelectField,
29
- g as Skeleton,
30
- k as Space,
31
- u as Splitter,
32
- x as Steps,
17
+ p as Menu,
18
+ d as Modal,
19
+ F as Pagination,
20
+ P as PnkxBadge,
21
+ c as PnkxContainer,
22
+ v as PnkxField,
23
+ k as PnkxSkeleton,
24
+ x as Popover,
25
+ G as RadioGroup,
26
+ L as RangePickerField,
27
+ C as Row,
28
+ S as SearchFiltersForm,
29
+ q as SelectField,
30
+ T as Space,
31
+ b as Splitter,
32
+ g as Steps,
33
+ u as Table,
33
34
  M as Tabs,
34
- G as TinyMCE,
35
- b as Tooltip,
36
- h as Typography,
35
+ E as TinyMCE,
36
+ R as Tooltip,
37
+ w as Typography,
37
38
  m as typeColorMap
38
39
  };
@@ -1,4 +1,4 @@
1
- import { BadgeProps as BadgeProps_2 } from 'antd';
1
+ import { BadgeProps } from 'antd';
2
2
  import { BasicProps } from 'antd/es/layout/layout';
3
3
  import { BreadcrumbItemType as BreadcrumbItemType_2 } from 'antd/es/breadcrumb/Breadcrumb';
4
4
  import { BreadcrumbProps as BreadcrumbProps_2 } from 'antd';
@@ -47,7 +47,7 @@ import { RowProps as RowProps_2 } from 'antd';
47
47
  import { SelectProps } from 'antd';
48
48
  import { SiderContextProps } from 'antd/es/layout/Sider';
49
49
  import { SiderProps } from 'antd/es/layout/Sider';
50
- import { SkeletonProps as SkeletonProps_2 } from 'antd';
50
+ import { SkeletonProps } from 'antd';
51
51
  import { Space as Space_2 } from 'antd';
52
52
  import { SpaceProps as SpaceProps_2 } from 'antd';
53
53
  import { Splitter as Splitter_2 } from 'antd';
@@ -57,6 +57,8 @@ import { Steps as Steps_2 } from 'antd';
57
57
  import { StepsProps as StepsProps_2 } from 'antd';
58
58
  import { SubMenuProps as SubMenuProps_2 } from 'antd/es/menu';
59
59
  import { SwitchProps } from 'antd';
60
+ import { TableColumnsType } from 'antd';
61
+ import { TableProps } from 'antd/lib/table';
60
62
  import { TabsProps as TabsProps_2 } from 'antd';
61
63
  import { TextAreaProps as TextAreaProps_2 } from 'antd/es/input';
62
64
  import { TextProps } from 'antd/es/typography/Text';
@@ -69,13 +71,6 @@ import { UseFormReturn } from 'react-hook-form';
69
71
  import { UseFormSetValue } from 'react-hook-form';
70
72
  import { UseFormStateReturn } from 'react-hook-form';
71
73
 
72
- export declare const Badge: ({ type, children, ...rest }: BadgeProps) => JSX.Element;
73
-
74
- export declare interface BadgeProps extends BadgeProps_2 {
75
- type?: "error" | "info" | "success" | "warning";
76
- children?: React.ReactNode;
77
- }
78
-
79
74
  declare type BaseProps = {
80
75
  customStyleContainer?: string;
81
76
  customStyleCascader?: string;
@@ -177,6 +172,8 @@ export declare interface ColSize extends ColSize_2 {
177
172
 
178
173
  export declare type ColSpanType = number | string;
179
174
 
175
+ declare type ColumnTypes<T> = Exclude<TableProps<T>["columns"], undefined>;
176
+
180
177
  declare type ComponentPropsType<TComponent> = TComponent extends React_2.ComponentType<infer P> ? P : never;
181
178
 
182
179
  declare type CompoundedMenu = FC<MenuComponentProps> & {
@@ -186,8 +183,6 @@ declare type CompoundedMenu = FC<MenuComponentProps> & {
186
183
  ItemGroup: typeof ItemGroup;
187
184
  };
188
185
 
189
- export declare const Container: default_2.FC<ContainerProps>;
190
-
191
186
  export declare interface ContainerProps {
192
187
  children: default_2.ReactNode;
193
188
  size?: TailwindMaxWidth;
@@ -322,6 +317,15 @@ export declare interface PaginationProps extends PaginationProps_2 {
322
317
 
323
318
  export declare type PaginationPropsUnion = BaseProps_11 & PaginationProps;
324
319
 
320
+ export declare const PnkxBadge: ({ type, children, ...rest }: PnkxBadgeProps) => JSX.Element;
321
+
322
+ export declare interface PnkxBadgeProps extends BadgeProps {
323
+ type?: "error" | "info" | "success" | "warning";
324
+ children?: React.ReactNode;
325
+ }
326
+
327
+ export declare const PnkxContainer: default_2.FC<ContainerProps>;
328
+
325
329
  export declare class PnkxField<TComponent extends React_2.ComponentType<any>> extends React_2.PureComponent<PnkxFieldProps<TComponent>> {
326
330
  render(): JSX.Element;
327
331
  }
@@ -332,6 +336,13 @@ export declare type PnkxFieldProps<TComponent extends React_2.ComponentType<any>
332
336
  component: TComponent;
333
337
  } & Omit<ComponentPropsType<TComponent>, "control" | "name" | "formState" | "field" | "fieldState">;
334
338
 
339
+ export declare const PnkxSkeleton: ({ type, skeletonButtonCount, }: PnkxSkeletonProps) => JSX.Element;
340
+
341
+ export declare interface PnkxSkeletonProps extends SkeletonProps {
342
+ type?: "table" | "form";
343
+ skeletonButtonCount?: number;
344
+ }
345
+
335
346
  export declare const Popover: (props: PopoverPropsUnion) => JSX.Element;
336
347
 
337
348
  export declare type PopoverProps = PopoverProps_2;
@@ -377,6 +388,10 @@ export declare interface RangePickerFieldProps extends Omit<RangePickerProps, "v
377
388
 
378
389
  export declare const Row: (props: RowPropsUnion) => JSX.Element;
379
390
 
391
+ declare interface RowCommon {
392
+ [x: string]: any;
393
+ }
394
+
380
395
  export declare interface RowProps extends RowProps_2 {
381
396
  }
382
397
 
@@ -415,13 +430,6 @@ declare type SingleCascaderProps = CascaderProps<DefaultOptionType, string> & {
415
430
  multiple?: false;
416
431
  };
417
432
 
418
- export declare const Skeleton: ({ type, skeletonButtonCount }: SkeletonProps) => JSX.Element;
419
-
420
- export declare interface SkeletonProps extends SkeletonProps_2 {
421
- type?: "table" | "form";
422
- skeletonButtonCount?: number;
423
- }
424
-
425
433
  export declare const Space: typeof Space_2;
426
434
 
427
435
  export declare interface SpaceProps extends SpaceProps_2 {
@@ -436,7 +444,8 @@ export declare interface SplitterProps extends SplitterProps_2 {
436
444
 
437
445
  export declare type SplitterPropsUnion = BaseProps_10 & SplitterProps;
438
446
 
439
- export declare type StepProps = StepProps_2;
447
+ export declare interface StepProps extends StepProps_2 {
448
+ }
440
449
 
441
450
  export declare const Steps: typeof Steps_2;
442
451
 
@@ -468,6 +477,30 @@ declare type TabItem = {
468
477
  disabled?: boolean;
469
478
  };
470
479
 
480
+ export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, ...rest }: TableCommonProps<T>) => JSX.Element;
481
+
482
+ export declare type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
483
+ editable?: boolean;
484
+ })[];
485
+
486
+ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "columns"> {
487
+ dataSource: T[];
488
+ columns: TableColumnsType<T> | TableColumnsTypeEditable<T>;
489
+ loading?: boolean;
490
+ totalItems: number;
491
+ filters: any;
492
+ onChangePage: (page: number) => void;
493
+ onChangePageSize: (size: number) => void;
494
+ onSort?: (sortField: string | number | symbol) => void;
495
+ rowsSelected?: default_2.Key[];
496
+ onSelect: (newSelectedRowKeys: default_2.Key[]) => void;
497
+ onRowClick?: (record: T) => void;
498
+ rowKey?: string;
499
+ className?: string;
500
+ editable?: boolean;
501
+ onSave?: (data: T[]) => void;
502
+ }
503
+
471
504
  export declare const Tabs: default_2.FC<TabsProps>;
472
505
 
473
506
  export declare type TabsProps = TabsProps_2 & {
@@ -517,7 +550,7 @@ declare type TPositionRadio = "before" | "after";
517
550
 
518
551
  declare type TSize = "small" | "medium" | "large";
519
552
 
520
- export declare const typeColorMap: Record<NonNullable<BadgeProps["type"]>, string>;
553
+ export declare const typeColorMap: Record<NonNullable<PnkxBadgeProps["type"]>, string>;
521
554
 
522
555
  export declare const Typography: {
523
556
  Title: (props: TitleProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BadgeProps as BadgeProps_2 } from 'antd';
1
+ import { BadgeProps } from 'antd';
2
2
  import { BasicProps } from 'antd/es/layout/layout';
3
3
  import { BreadcrumbItemType as BreadcrumbItemType_2 } from 'antd/es/breadcrumb/Breadcrumb';
4
4
  import { BreadcrumbProps as BreadcrumbProps_2 } from 'antd';
@@ -35,7 +35,7 @@ import { RefAttributes } from 'react';
35
35
  import { RowProps as RowProps_2 } from 'antd';
36
36
  import { SiderContextProps } from 'antd/es/layout/Sider';
37
37
  import { SiderProps } from 'antd/es/layout/Sider';
38
- import { SkeletonProps as SkeletonProps_2 } from 'antd';
38
+ import { SkeletonProps } from 'antd';
39
39
  import { Space as Space_2 } from 'antd';
40
40
  import { SpaceProps as SpaceProps_2 } from 'antd';
41
41
  import { Splitter as Splitter_2 } from 'antd';
@@ -44,6 +44,8 @@ import { StepProps as StepProps_2 } from 'antd';
44
44
  import { Steps as Steps_2 } from 'antd';
45
45
  import { StepsProps as StepsProps_2 } from 'antd';
46
46
  import { SubMenuProps as SubMenuProps_2 } from 'antd/es/menu';
47
+ import { TableColumnsType } from 'antd';
48
+ import { TableProps } from 'antd/lib/table';
47
49
  import { TabsProps as TabsProps_2 } from 'antd';
48
50
  import { TextProps } from 'antd/es/typography/Text';
49
51
  import { TitleProps } from 'antd/es/typography/Title';
@@ -52,13 +54,6 @@ import { UseFormHandleSubmit } from 'react-hook-form';
52
54
  import { UseFormReturn } from 'react-hook-form';
53
55
  import { UseFormSetValue } from 'react-hook-form';
54
56
 
55
- export declare const Badge: ({ type, children, ...rest }: BadgeProps) => JSX.Element;
56
-
57
- export declare interface BadgeProps extends BadgeProps_2 {
58
- type?: "error" | "info" | "success" | "warning";
59
- children?: React.ReactNode;
60
- }
61
-
62
57
  declare type BaseProps = {
63
58
  customStyleContainer?: string;
64
59
  customStyleCascader?: string;
@@ -148,6 +143,8 @@ export declare interface ColSize extends ColSize_2 {
148
143
 
149
144
  export declare type ColSpanType = number | string;
150
145
 
146
+ declare type ColumnTypes<T> = Exclude<TableProps<T>["columns"], undefined>;
147
+
151
148
  declare type CompoundedMenu = FC<MenuComponentProps> & {
152
149
  Item: typeof MenuItem;
153
150
  SubMenu: typeof SubMenu;
@@ -155,8 +152,6 @@ declare type CompoundedMenu = FC<MenuComponentProps> & {
155
152
  ItemGroup: typeof ItemGroup;
156
153
  };
157
154
 
158
- export declare const Container: default_2.FC<ContainerProps>;
159
-
160
155
  export declare interface ContainerProps {
161
156
  children: default_2.ReactNode;
162
157
  size?: TailwindMaxWidth;
@@ -253,6 +248,22 @@ export declare interface PaginationProps extends PaginationProps_2 {
253
248
 
254
249
  export declare type PaginationPropsUnion = BaseProps_11 & PaginationProps;
255
250
 
251
+ export declare const PnkxBadge: ({ type, children, ...rest }: PnkxBadgeProps) => JSX.Element;
252
+
253
+ export declare interface PnkxBadgeProps extends BadgeProps {
254
+ type?: "error" | "info" | "success" | "warning";
255
+ children?: React.ReactNode;
256
+ }
257
+
258
+ export declare const PnkxContainer: default_2.FC<ContainerProps>;
259
+
260
+ export declare const PnkxSkeleton: ({ type, skeletonButtonCount, }: PnkxSkeletonProps) => JSX.Element;
261
+
262
+ export declare interface PnkxSkeletonProps extends SkeletonProps {
263
+ type?: "table" | "form";
264
+ skeletonButtonCount?: number;
265
+ }
266
+
256
267
  export declare const Popover: (props: PopoverPropsUnion) => JSX.Element;
257
268
 
258
269
  export declare type PopoverProps = PopoverProps_2;
@@ -261,6 +272,10 @@ export declare type PopoverPropsUnion = BaseProps_2 & PopoverProps;
261
272
 
262
273
  export declare const Row: (props: RowPropsUnion) => JSX.Element;
263
274
 
275
+ declare interface RowCommon {
276
+ [x: string]: any;
277
+ }
278
+
264
279
  export declare interface RowProps extends RowProps_2 {
265
280
  }
266
281
 
@@ -287,13 +302,6 @@ declare type SingleCascaderProps = CascaderProps<DefaultOptionType, string> & {
287
302
  multiple?: false;
288
303
  };
289
304
 
290
- export declare const Skeleton: ({ type, skeletonButtonCount }: SkeletonProps) => JSX.Element;
291
-
292
- export declare interface SkeletonProps extends SkeletonProps_2 {
293
- type?: "table" | "form";
294
- skeletonButtonCount?: number;
295
- }
296
-
297
305
  export declare const Space: typeof Space_2;
298
306
 
299
307
  export declare interface SpaceProps extends SpaceProps_2 {
@@ -308,7 +316,8 @@ export declare interface SplitterProps extends SplitterProps_2 {
308
316
 
309
317
  export declare type SplitterPropsUnion = BaseProps_10 & SplitterProps;
310
318
 
311
- export declare type StepProps = StepProps_2;
319
+ export declare interface StepProps extends StepProps_2 {
320
+ }
312
321
 
313
322
  export declare const Steps: typeof Steps_2;
314
323
 
@@ -330,6 +339,30 @@ declare type TabItem = {
330
339
  disabled?: boolean;
331
340
  };
332
341
 
342
+ export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, ...rest }: TableCommonProps<T>) => JSX.Element;
343
+
344
+ export declare type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
345
+ editable?: boolean;
346
+ })[];
347
+
348
+ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "columns"> {
349
+ dataSource: T[];
350
+ columns: TableColumnsType<T> | TableColumnsTypeEditable<T>;
351
+ loading?: boolean;
352
+ totalItems: number;
353
+ filters: any;
354
+ onChangePage: (page: number) => void;
355
+ onChangePageSize: (size: number) => void;
356
+ onSort?: (sortField: string | number | symbol) => void;
357
+ rowsSelected?: default_2.Key[];
358
+ onSelect: (newSelectedRowKeys: default_2.Key[]) => void;
359
+ onRowClick?: (record: T) => void;
360
+ rowKey?: string;
361
+ className?: string;
362
+ editable?: boolean;
363
+ onSave?: (data: T[]) => void;
364
+ }
365
+
333
366
  export declare const Tabs: default_2.FC<TabsProps>;
334
367
 
335
368
  export declare type TabsProps = TabsProps_2 & {
@@ -343,7 +376,7 @@ export declare const Tooltip: default_2.FC<TooltipProps>;
343
376
 
344
377
  export declare type TooltipProps = TooltipProps_2;
345
378
 
346
- export declare const typeColorMap: Record<NonNullable<BadgeProps["type"]>, string>;
379
+ export declare const typeColorMap: Record<NonNullable<PnkxBadgeProps["type"]>, string>;
347
380
 
348
381
  export declare const Typography: {
349
382
  Title: (props: TitleProps) => JSX.Element;
package/dist/ui/index.js CHANGED
@@ -1,29 +1,30 @@
1
- import { d as o, f as e, B as r, C as t, e as p, c as l, D as i, F as n, L as d, i as S, M as c, j as g, P as C, R as F, b as M, S as T, g as b, h as m, k as u, a as y, T as B, t as L } from "../chunks/Steps-Bfcmz8iH.js";
2
- import { E as h, L as x, T as P } from "../chunks/AntdIcon-BohCHsd5.js";
1
+ import { g as e, B as o, C as r, f as t, D as l, F as p, L as n, j as i, M as d, k as x, e as P, d as S, P as T, c as b, R as c, S as g, h as k, i as C, l as F, T as M, b as m, a as u, t as y } from "../chunks/Steps-CqDrt6vm.js";
2
+ import { E as L, L as f, T as h } from "../chunks/Switch-DAZukdDR.js";
3
3
  export {
4
- o as Badge,
5
4
  e as Breadcrumb,
6
- r as Button,
7
- t as CascaderField,
8
- p as Col,
9
- l as Container,
10
- i as Dropdown,
11
- h as ErrorMessage,
12
- n as Flex,
13
- x as Label,
14
- d as Layout,
15
- S as Menu,
16
- c as Modal,
17
- g as Pagination,
18
- C as Popover,
19
- F as Row,
20
- M as SearchFiltersForm,
21
- T as Skeleton,
22
- b as Space,
23
- m as Splitter,
24
- u as Steps,
25
- y as Tabs,
26
- B as Tooltip,
27
- P as Typography,
28
- L as typeColorMap
5
+ o as Button,
6
+ r as CascaderField,
7
+ t as Col,
8
+ l as Dropdown,
9
+ L as ErrorMessage,
10
+ p as Flex,
11
+ f as Label,
12
+ n as Layout,
13
+ i as Menu,
14
+ d as Modal,
15
+ x as Pagination,
16
+ P as PnkxBadge,
17
+ S as PnkxContainer,
18
+ T as PnkxSkeleton,
19
+ b as Popover,
20
+ c as Row,
21
+ g as SearchFiltersForm,
22
+ k as Space,
23
+ C as Splitter,
24
+ F as Steps,
25
+ M as Table,
26
+ m as Tabs,
27
+ u as Tooltip,
28
+ h as Typography,
29
+ y as typeColorMap
29
30
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.1.19",
4
+ "version": "1.1.21",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "exports": {
@@ -90,8 +90,7 @@
90
90
  "react-datepicker": "^4.16.0",
91
91
  "react-hook-form": "^7.54.2",
92
92
  "react-number-format": "^5.4.3",
93
- "react-router": "^7.6.0",
94
- "react-router-dom": "^7.6.0",
93
+ "react-router-dom": "^7.5.3",
95
94
  "yup": "^1.6.1",
96
95
  "zustand": "^5.0.3"
97
96
  }