@pnkx-lib/ui 1.9.35 → 1.9.37

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,2 +1,2 @@
1
- export { C as CheckboxField, D as DatePickerField, I as Input, P as PnkxField, R as RangePickerField, b as TinyMCE } from '../chunks/Switch-Ck9WdQgt.js';
2
- export { R as RadioGroup, S as Select } from '../chunks/Radio-5j1KNRlx.js';
1
+ export { C as CheckboxField, D as DatePickerField, I as Input, P as PnkxField, R as RangePickerField, S as Select, b as TinyMCE } from '../chunks/Switch-5fY0eC69.js';
2
+ export { R as RadioGroup } from '../chunks/Radio-Cy7MuC6V.js';
package/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/index-DqaASOI_.js';
2
- export { C as CheckboxField, D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, a as TINY_API, b as TinyMCE, T as Typography } from './chunks/Switch-Ck9WdQgt.js';
1
+ export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/index-BnBtGpK2.js';
2
+ export { C as CheckboxField, D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, S as Select, a as TINY_API, b as TinyMCE, T as Typography } from './chunks/Switch-5fY0eC69.js';
3
3
  import 'react-router';
4
4
  export { P as PAGE_INDEX, b as PAGE_SIZE, c as SORT_BY, d as SORT_DESC, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable, u as useToast } from './chunks/table-B28OPA57.js';
5
- export { R as RadioGroup, S as Select } from './chunks/Radio-5j1KNRlx.js';
5
+ export { R as RadioGroup } from './chunks/Radio-Cy7MuC6V.js';
6
6
  export { u as useFiltersHandler, a as useMessage, b as useToggle } from './chunks/useToggle-C5Y4aFUQ.js';
package/es/ui/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/index-DqaASOI_.js';
2
- export { E as ErrorMessage, L as Label, a as TINY_API, T as Typography } from '../chunks/Switch-Ck9WdQgt.js';
1
+ export { Z as ActionRowTable, A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, Y as CategoryStatus, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/index-BnBtGpK2.js';
2
+ export { E as ErrorMessage, L as Label, a as TINY_API, T as Typography } from '../chunks/Switch-5fY0eC69.js';
3
3
  import 'react-router';
4
4
  export { P as PAGE_INDEX, b as PAGE_SIZE, c as SORT_BY, d as SORT_DESC, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable } from '../chunks/table-B28OPA57.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.35",
4
+ "version": "1.9.37",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
package/types/index.d.ts CHANGED
@@ -41,6 +41,7 @@ import { FormEventHandler } from 'react';
41
41
  import { ForwardRefExoticComponent } from 'react';
42
42
  import { IAllProps } from '@tinymce/tinymce-react';
43
43
  import { ImageProps } from 'antd';
44
+ import { InitialFiltersSearch as InitialFiltersSearch_2 } from '../../../../../../../../../../../src/components/hooks';
44
45
  import { InputProps as InputProps_2 } from 'antd';
45
46
  import { JSX } from 'react/jsx-runtime';
46
47
  import { JSX as JSX_2 } from 'react';
@@ -386,6 +387,12 @@ export declare type FlexProps = FlexProps_2;
386
387
 
387
388
  export declare type FlexPropsUnion = BaseProps_7 & FlexProps;
388
389
 
390
+ declare interface GroupHeadingButtonItem {
391
+ label: string;
392
+ value: number;
393
+ keyActive: number;
394
+ }
395
+
389
396
  export declare const Heading: (props: HeadingProps) => JSX.Element;
390
397
 
391
398
  export declare interface HeadingProps {
@@ -424,6 +431,13 @@ declare const ItemGroup: ForwardRefExoticComponent<Omit<MenuItemGroupProps, "ref
424
431
 
425
432
  export declare type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
426
433
 
434
+ declare type IValueSearch = {
435
+ keyword: string | undefined;
436
+ attributeType: string | null | undefined;
437
+ PageIndex: number;
438
+ PageSize: number;
439
+ };
440
+
427
441
  export declare const Label: ({ label, required }: LabelProps) => JSX.Element;
428
442
 
429
443
  export declare interface LabelProps {
@@ -695,7 +709,7 @@ declare type TabItem = {
695
709
  disabled?: boolean;
696
710
  };
697
711
 
698
- 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;
712
+ 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, resetToInitialFilters, handleSearch, groupHeadingButtonItems, tagSearchItems, setTagSearchItems, setKeyActive, keyActive, ...rest }: TableCommonProps<T>) => JSX.Element;
699
713
 
700
714
  export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
701
715
 
@@ -722,6 +736,13 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
722
736
  titleSettingTableModal?: string;
723
737
  showSetting?: boolean;
724
738
  setColumns?: (newColumns: TableColumnsType<T>) => void;
739
+ resetToInitialFilters: () => void;
740
+ handleSearch: (nextFilters: InitialFiltersSearch_2<IValueSearch>) => void;
741
+ groupHeadingButtonItems: GroupHeadingButtonItem[];
742
+ tagSearchItems?: string[];
743
+ setTagSearchItems?: (value: string[]) => void;
744
+ setKeyActive: (value: string | number) => void;
745
+ keyActive: string | number;
725
746
  }
726
747
 
727
748
  export declare const Tabs: default_2.FC<TabsProps>;
package/types/ui.d.ts CHANGED
@@ -34,6 +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 { InitialFiltersSearch } from '../../../../../../../../../../../src/components/hooks';
37
38
  import { JSX } from 'react/jsx-runtime';
38
39
  import { MenuDividerProps } from 'antd/es/menu';
39
40
  import { MenuItemGroupProps } from 'rc-menu/lib/MenuItemGroup';
@@ -332,6 +333,12 @@ export declare type FlexProps = FlexProps_2;
332
333
 
333
334
  export declare type FlexPropsUnion = BaseProps_7 & FlexProps;
334
335
 
336
+ declare interface GroupHeadingButtonItem {
337
+ label: string;
338
+ value: number;
339
+ keyActive: number;
340
+ }
341
+
335
342
  export declare const Heading: (props: HeadingProps) => JSX.Element;
336
343
 
337
344
  export declare interface HeadingProps {
@@ -351,6 +358,13 @@ declare const ItemGroup: ForwardRefExoticComponent<Omit<MenuItemGroupProps, "ref
351
358
 
352
359
  export declare type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
353
360
 
361
+ declare type IValueSearch = {
362
+ keyword: string | undefined;
363
+ attributeType: string | null | undefined;
364
+ PageIndex: number;
365
+ PageSize: number;
366
+ };
367
+
354
368
  export declare const Label: ({ label, required }: LabelProps) => JSX.Element;
355
369
 
356
370
  export declare interface LabelProps {
@@ -539,7 +553,7 @@ declare type TabItem = {
539
553
  disabled?: boolean;
540
554
  };
541
555
 
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;
556
+ 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, resetToInitialFilters, handleSearch, groupHeadingButtonItems, tagSearchItems, setTagSearchItems, setKeyActive, keyActive, ...rest }: TableCommonProps<T>) => JSX.Element;
543
557
 
544
558
  export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
545
559
 
@@ -566,6 +580,13 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
566
580
  titleSettingTableModal?: string;
567
581
  showSetting?: boolean;
568
582
  setColumns?: (newColumns: TableColumnsType<T>) => void;
583
+ resetToInitialFilters: () => void;
584
+ handleSearch: (nextFilters: InitialFiltersSearch<IValueSearch>) => void;
585
+ groupHeadingButtonItems: GroupHeadingButtonItem[];
586
+ tagSearchItems?: string[];
587
+ setTagSearchItems?: (value: string[]) => void;
588
+ setKeyActive: (value: string | number) => void;
589
+ keyActive: string | number;
569
590
  }
570
591
 
571
592
  export declare const Tabs: default_2.FC<TabsProps>;
@@ -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 };