sti-antd-package 0.0.34 → 0.0.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.
@@ -1,4 +1,3 @@
1
- import { CardComponentProps } from "./types";
2
- import React from "react";
3
- declare const CardComponent: React.FC<CardComponentProps>;
1
+ import { CardComponentType } from "./types";
2
+ declare const CardComponent: CardComponentType;
4
3
  export default CardComponent;
@@ -1,4 +1,5 @@
1
1
  import { CardProps } from "antd";
2
+ import { CardMetaProps } from "antd/es/card";
2
3
  import { CardSize } from "antd/es/card/Card";
3
4
  export interface CardComponentProps {
4
5
  size?: CardSize;
@@ -6,7 +7,11 @@ export interface CardComponentProps {
6
7
  onClick?: React.MouseEventHandler<HTMLElement>;
7
8
  classNames?: string[];
8
9
  className?: CardProps['classNames'];
10
+ actions?: React.ReactNode[];
9
11
  style?: React.CSSProperties;
10
12
  styles?: CardProps['styles'];
11
13
  children?: React.ReactNode;
12
14
  }
15
+ export type CardComponentType = React.FC<CardComponentProps> & {
16
+ Meta: React.FC<CardMetaProps>;
17
+ };
@@ -62,11 +62,11 @@ export type TableButtonMiddleAsync = TableButtonMiddle & {
62
62
  export interface TableAsyncComponentRef {
63
63
  reload: () => void;
64
64
  getTableStates: () => {
65
- tableParams: TableParams | undefined;
65
+ tableParams: DefaultParams | YajraParams;
66
66
  tableSearch: string | undefined;
67
67
  selectedRowKeys: React.Key[] | undefined;
68
68
  };
69
- tableParams: () => TableParams | undefined;
69
+ tableParams: () => DefaultParams | YajraParams;
70
70
  filters: () => AnyObject | undefined;
71
71
  tableSearch: () => string | undefined;
72
72
  selectedRowKeys: () => React.Key[] | undefined;
@@ -1,4 +1,4 @@
1
- import { DefaultColumn, SelectOption, TableAsyncSearchItem, TableParams, YajraColumn } from "../../components";
1
+ import { DefaultColumn, DefaultParams, SelectOption, TableAsyncSearchItem, TableParams, YajraColumn, YajraParams } from "../../components";
2
2
  import { TablePaginationConfig } from "antd";
3
3
  import { AnyObject } from "antd/es/_util/type";
4
4
  import { SorterResult } from "antd/es/table/interface";
@@ -24,6 +24,7 @@ export interface TableAsyncSearchContextType {
24
24
  setSelectedRowKeys?: React.Dispatch<React.SetStateAction<React.Key[]>>;
25
25
  tableParamsFormatter?: (prevState?: TableParams, params?: TableParamsFormatter) => TableParams;
26
26
  pagination?: TablePaginationConfig;
27
+ params: () => DefaultParams | YajraParams;
27
28
  fetchData?: () => void;
28
29
  drawerOpen?: boolean;
29
30
  setDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { TooltipPlacement } from 'antd/es/tooltip';
4
4
  import React$1, { Ref, JSXElementConstructor } from 'react';
5
5
  import { CardProps, CheckboxChangeEvent, CheckboxOptionType, DatePickerProps as DatePickerProps$1, DatePicker, DropDownProps, RadioChangeEvent, SelectProps, ThemeConfig, TablePaginationConfig as TablePaginationConfig$1, FormInstance, TagProps } from 'antd';
6
6
  export { Form } from 'antd';
7
+ import { CardMetaProps } from 'antd/es/card';
7
8
  import { CardSize } from 'antd/es/card/Card';
8
9
  import { Variant } from 'antd/es/config-provider';
9
10
  import { ValidateStatus } from 'antd/es/form/FormItem';
@@ -153,12 +154,16 @@ interface CardComponentProps {
153
154
  onClick?: React.MouseEventHandler<HTMLElement>;
154
155
  classNames?: string[];
155
156
  className?: CardProps['classNames'];
157
+ actions?: React.ReactNode[];
156
158
  style?: React.CSSProperties;
157
159
  styles?: CardProps['styles'];
158
160
  children?: React.ReactNode;
159
161
  }
162
+ type CardComponentType = React.FC<CardComponentProps> & {
163
+ Meta: React.FC<CardMetaProps>;
164
+ };
160
165
 
161
- declare const CardComponent: React$1.FC<CardComponentProps>;
166
+ declare const CardComponent: CardComponentType;
162
167
 
163
168
  interface CascaderComponentRef<OptionType extends DefaultOptionType, ValueField extends keyof OptionType> {
164
169
  value: () => CascaderProps<OptionType, ValueField>['value'];
@@ -886,6 +891,7 @@ interface TableAsyncSearchContextType {
886
891
  setSelectedRowKeys?: React.Dispatch<React.SetStateAction<React.Key[]>>;
887
892
  tableParamsFormatter?: (prevState?: TableParams, params?: TableParamsFormatter) => TableParams;
888
893
  pagination?: TablePaginationConfig$1;
894
+ params: () => DefaultParams | YajraParams;
889
895
  fetchData?: () => void;
890
896
  drawerOpen?: boolean;
891
897
  setDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -994,11 +1000,11 @@ type TableButtonMiddleAsync = TableButtonMiddle & {
994
1000
  interface TableAsyncComponentRef {
995
1001
  reload: () => void;
996
1002
  getTableStates: () => {
997
- tableParams: TableParams | undefined;
1003
+ tableParams: DefaultParams | YajraParams;
998
1004
  tableSearch: string | undefined;
999
1005
  selectedRowKeys: React.Key[] | undefined;
1000
1006
  };
1001
- tableParams: () => TableParams | undefined;
1007
+ tableParams: () => DefaultParams | YajraParams;
1002
1008
  filters: () => AnyObject | undefined;
1003
1009
  tableSearch: () => string | undefined;
1004
1010
  selectedRowKeys: () => React.Key[] | undefined;
package/dist/index.esm.js CHANGED
@@ -3880,9 +3880,10 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
3880
3880
  };
3881
3881
  var Component$6 = React__default.memo(ButtonGroupEditComponent);
3882
3882
 
3883
- const CardComponent = ({ size, title, onClick, classNames, className, style, styles, children, }) => {
3884
- return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, styles: styles, children: children }));
3883
+ const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, }) => {
3884
+ return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, children: children }));
3885
3885
  };
3886
+ CardComponent.Meta = Card.Meta;
3886
3887
 
3887
3888
  const { Item: Item$1 } = Form$2;
3888
3889
  const FormItemComponent = ({ noItem, formColLayout, name, label, trigger, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, getValueFromEvent, validateStatus, help, shouldUpdate, children, }) => {
@@ -4323,6 +4324,7 @@ const TableAsyncSearchProvider = props => {
4323
4324
  tableParamsFormatter,
4324
4325
  pagination,
4325
4326
  fetchData,
4327
+ params,
4326
4328
  drawerOpen,
4327
4329
  setDrawerOpen,
4328
4330
  multiSelectedOptions,
@@ -4343,6 +4345,7 @@ const TableAsyncSearchProvider = props => {
4343
4345
  tableParamsFormatter,
4344
4346
  pagination,
4345
4347
  fetchData,
4348
+ params,
4346
4349
  drawerOpen,
4347
4350
  setDrawerOpen,
4348
4351
  multiSelectedOptions,
@@ -8572,7 +8575,7 @@ var TableAsyncSearchComponent$1 = React__default.memo(TableAsyncSearchComponent)
8572
8575
  const TableAsyncChildrenComponent = (_a) => {
8573
8576
  var _b, _c, _d;
8574
8577
  var { search, searchOnChange, rowSelect, noReload, filterFields, ref } = _a, props = __rest$5(_a, ["search", "searchOnChange", "rowSelect", "noReload", "filterFields", "ref"]);
8575
- const { loading, filters, tableData, tableParams, setTableParams, tableSearch, setTableSearch, selectedRowKeys, setSelectedRowKeys, tableParamsFormatter, pagination, fetchData, } = useTableAsyncSearch();
8578
+ const { loading, filters, tableData, tableParams, setTableParams, tableSearch, setTableSearch, selectedRowKeys, setSelectedRowKeys, tableParamsFormatter, pagination, params, fetchData, } = useTableAsyncSearch();
8576
8579
  const buttonMiddle = ((_b = props.buttonMiddle) === null || _b === void 0 ? void 0 : _b.map((item) => {
8577
8580
  const { component } = item;
8578
8581
  item.component = jsxRuntimeExports.jsx("div", {});
@@ -8642,8 +8645,8 @@ const TableAsyncChildrenComponent = (_a) => {
8642
8645
  } : undefined;
8643
8646
  useImperativeHandle(ref, () => ({
8644
8647
  reload: () => fetchData === null || fetchData === void 0 ? void 0 : fetchData(),
8645
- getTableStates: () => ({ tableParams, tableSearch, selectedRowKeys }),
8646
- tableParams: () => tableParams,
8648
+ getTableStates: () => ({ tableParams: params(), tableSearch, selectedRowKeys }),
8649
+ tableParams: params,
8647
8650
  filters: () => filters,
8648
8651
  tableSearch: () => tableSearch,
8649
8652
  selectedRowKeys: () => selectedRowKeys,
package/dist/index.js CHANGED
@@ -3899,9 +3899,10 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
3899
3899
  };
3900
3900
  var Component$6 = React.memo(ButtonGroupEditComponent);
3901
3901
 
3902
- const CardComponent = ({ size, title, onClick, classNames, className, style, styles, children, }) => {
3903
- return (jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, styles: styles, children: children }));
3902
+ const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, }) => {
3903
+ return (jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, children: children }));
3904
3904
  };
3905
+ CardComponent.Meta = antd.Card.Meta;
3905
3906
 
3906
3907
  const { Item: Item$1 } = antd.Form;
3907
3908
  const FormItemComponent = ({ noItem, formColLayout, name, label, trigger, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, getValueFromEvent, validateStatus, help, shouldUpdate, children, }) => {
@@ -4342,6 +4343,7 @@ const TableAsyncSearchProvider = props => {
4342
4343
  tableParamsFormatter,
4343
4344
  pagination,
4344
4345
  fetchData,
4346
+ params,
4345
4347
  drawerOpen,
4346
4348
  setDrawerOpen,
4347
4349
  multiSelectedOptions,
@@ -4362,6 +4364,7 @@ const TableAsyncSearchProvider = props => {
4362
4364
  tableParamsFormatter,
4363
4365
  pagination,
4364
4366
  fetchData,
4367
+ params,
4365
4368
  drawerOpen,
4366
4369
  setDrawerOpen,
4367
4370
  multiSelectedOptions,
@@ -8591,7 +8594,7 @@ var TableAsyncSearchComponent$1 = React.memo(TableAsyncSearchComponent);
8591
8594
  const TableAsyncChildrenComponent = (_a) => {
8592
8595
  var _b, _c, _d;
8593
8596
  var { search, searchOnChange, rowSelect, noReload, filterFields, ref } = _a, props = __rest$5(_a, ["search", "searchOnChange", "rowSelect", "noReload", "filterFields", "ref"]);
8594
- const { loading, filters, tableData, tableParams, setTableParams, tableSearch, setTableSearch, selectedRowKeys, setSelectedRowKeys, tableParamsFormatter, pagination, fetchData, } = useTableAsyncSearch();
8597
+ const { loading, filters, tableData, tableParams, setTableParams, tableSearch, setTableSearch, selectedRowKeys, setSelectedRowKeys, tableParamsFormatter, pagination, params, fetchData, } = useTableAsyncSearch();
8595
8598
  const buttonMiddle = ((_b = props.buttonMiddle) === null || _b === void 0 ? void 0 : _b.map((item) => {
8596
8599
  const { component } = item;
8597
8600
  item.component = jsxRuntimeExports.jsx("div", {});
@@ -8661,8 +8664,8 @@ const TableAsyncChildrenComponent = (_a) => {
8661
8664
  } : undefined;
8662
8665
  React.useImperativeHandle(ref, () => ({
8663
8666
  reload: () => fetchData === null || fetchData === void 0 ? void 0 : fetchData(),
8664
- getTableStates: () => ({ tableParams, tableSearch, selectedRowKeys }),
8665
- tableParams: () => tableParams,
8667
+ getTableStates: () => ({ tableParams: params(), tableSearch, selectedRowKeys }),
8668
+ tableParams: params,
8666
8669
  filters: () => filters,
8667
8670
  tableSearch: () => tableSearch,
8668
8671
  selectedRowKeys: () => selectedRowKeys,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sti-antd-package",
3
3
  "description": "STI ANT Design",
4
- "version": "0.0.34",
4
+ "version": "0.0.36",
5
5
  "type": "module",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",