@meta-1/design 0.0.192 → 0.0.194

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta-1/design",
3
- "version": "0.0.192",
3
+ "version": "0.0.194",
4
4
  "keywords": [
5
5
  "easykit",
6
6
  "design",
@@ -21,6 +21,7 @@ export interface FiltersProps extends PropsWithChildren {
21
21
  query?: any;
22
22
  loading?: boolean;
23
23
  load?: (params?: unknown) => Promise<unknown> | unknown;
24
+ reset?: () => void;
24
25
  searchText?: string;
25
26
  resetText?: string;
26
27
  }
@@ -51,9 +52,13 @@ const renderItem = (item: FilterItemProps, form: { control: Control }) => {
51
52
  };
52
53
 
53
54
  export const Filters: FC<FiltersProps> = (props) => {
54
- const { items = [], defaultValues = null, loading, load, query } = props;
55
+ const { items = [], defaultValues = null, loading, load, query, reset } = props;
55
56
  const fields = items.map((item) => item.field);
56
- const { reset, control, handleSubmit } = useForm({
57
+ const {
58
+ reset: resetForm,
59
+ control,
60
+ handleSubmit,
61
+ } = useForm({
57
62
  defaultValues: pick(query, fields),
58
63
  });
59
64
 
@@ -84,11 +89,13 @@ export const Filters: FC<FiltersProps> = (props) => {
84
89
  disabled={loading}
85
90
  onClick={() => {
86
91
  const filteredDefaultValues = pick(defaultValues, fields);
87
- load?.({
88
- ...filteredDefaultValues,
89
- page: 1,
90
- });
91
- reset(filteredDefaultValues);
92
+ reset
93
+ ? reset()
94
+ : load?.({
95
+ ...filteredDefaultValues,
96
+ page: 1,
97
+ });
98
+ resetForm(filteredDefaultValues);
92
99
  }}
93
100
  type="reset"
94
101
  variant="secondary"
@@ -82,7 +82,7 @@ export const Pagination: FC<PaginationProps> = (props) => {
82
82
  onChange,
83
83
  onSizeChange,
84
84
  simple = false,
85
- showTotal = true,
85
+ showTotal = false,
86
86
  showSizeChanger = true,
87
87
  showQuickJumper = true,
88
88
  } = props;
package/src/index.ts CHANGED
@@ -100,7 +100,7 @@ export type { ConfirmProps } from "./components/uix/alert-dialog";
100
100
  export { useAlert } from "./components/uix/alert-dialog";
101
101
  export type { AvatarProps } from "./components/uix/avatar";
102
102
  export { Avatar } from "./components/uix/avatar";
103
- export type { BadgeProps } from "./components/uix/badge";
103
+ export type { BadgeProps, BadgeVariant } from "./components/uix/badge";
104
104
  export { Badge } from "./components/uix/badge";
105
105
  export type { BreadcrumbsItemProps, BreadcrumbsProps } from "./components/uix/breadcrumbs";
106
106
  export { Breadcrumbs, BreadcrumbsItem } from "./components/uix/breadcrumbs";