@pnkx-lib/ui 1.9.292 → 1.9.293
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/es/ui/ErrorMessage.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
const ErrorMessage = React__default.memo(
|
|
5
|
-
({ errorMessage
|
|
5
|
+
({ errorMessage }) => {
|
|
6
6
|
if (!errorMessage) return null;
|
|
7
7
|
return /* @__PURE__ */ jsx("div", { className: "ml-2 text-red-600", children: errorMessage });
|
|
8
8
|
}
|
package/es/ui/Sidebar.js
CHANGED
|
@@ -155,7 +155,8 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
155
155
|
};
|
|
156
156
|
acc.push(group);
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
const path = `/${itemChildren.path}/${itemSub.path}`;
|
|
159
|
+
group.options.push(renderItem(itemSub.name, path));
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
);
|
|
@@ -258,7 +259,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
258
259
|
openSubCollapse && "absolute"
|
|
259
260
|
),
|
|
260
261
|
children: /* @__PURE__ */ jsx("nav", { className: twMerge("flex mt-2 flex-1 flex-col px-2"), children: /* @__PURE__ */ jsx("ul", { role: "list", className: twMerge("-mx-2 space-y-1 relative"), children: newMenu.flatMap((item) => {
|
|
261
|
-
const isActiveMainMenu = activeMainMenu === item.
|
|
262
|
+
const isActiveMainMenu = activeMainMenu === item.code;
|
|
262
263
|
const isActivePathUrl = pathUrl === item.path;
|
|
263
264
|
const isActive = isActiveMainMenu || isActivePathUrl;
|
|
264
265
|
return /* @__PURE__ */ jsx(
|
|
@@ -280,7 +281,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
280
281
|
{
|
|
281
282
|
onClick: () => {
|
|
282
283
|
setCollapse(false);
|
|
283
|
-
setActiveMainMenu(item
|
|
284
|
+
setActiveMainMenu(item?.code);
|
|
284
285
|
setOpenSubCollapse(true);
|
|
285
286
|
},
|
|
286
287
|
className: twMerge(
|
|
@@ -318,7 +319,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
318
319
|
"flex flex-1 transition-all duration-300 flex-col"
|
|
319
320
|
),
|
|
320
321
|
children: /* @__PURE__ */ jsx("ul", { role: "list", className: twMerge("cursor-pointer ml-[10px]"), children: newMenu?.map((sub) => {
|
|
321
|
-
const isActiveMainMenu = activeMainMenu === sub.
|
|
322
|
+
const isActiveMainMenu = activeMainMenu === sub.code;
|
|
322
323
|
if (!isActiveMainMenu) return null;
|
|
323
324
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
324
325
|
/* @__PURE__ */ jsx(
|
|
@@ -383,7 +384,7 @@ const Sidebar = ({ children, menu, userInfo }) => {
|
|
|
383
384
|
) })
|
|
384
385
|
] }, itemSubMenu.path);
|
|
385
386
|
}) })
|
|
386
|
-
] }, sub
|
|
387
|
+
] }, sub?.code);
|
|
387
388
|
}) })
|
|
388
389
|
}
|
|
389
390
|
)
|
package/es/ui/index.js
CHANGED
|
@@ -5425,7 +5425,7 @@ const Table = ({
|
|
|
5425
5425
|
return "default";
|
|
5426
5426
|
}
|
|
5427
5427
|
};
|
|
5428
|
-
const handleTableChange = (
|
|
5428
|
+
const handleTableChange = (_pagination, _filters, sorter) => {
|
|
5429
5429
|
if (sorter && onSort) {
|
|
5430
5430
|
onSort(sorter);
|
|
5431
5431
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { ControllerRenderProps, UseFormStateReturn } from 'react-hook-form';
|
|
3
2
|
import { TextAreaProps as TextAreaPropsAntd } from 'antd/es/input';
|
|
4
3
|
export interface TextAreaProps extends TextAreaPropsAntd {
|
|
@@ -9,4 +8,4 @@ export interface TextAreaProps extends TextAreaPropsAntd {
|
|
|
9
8
|
afterOnChange?: (value: string) => void;
|
|
10
9
|
required?: boolean;
|
|
11
10
|
}
|
|
12
|
-
export declare const Textarea:
|
|
11
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -4,4 +4,4 @@ export interface ErrorMessageProps {
|
|
|
4
4
|
isTouched?: boolean;
|
|
5
5
|
isSubmitted?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const ErrorMessage: React.MemoExoticComponent<({ errorMessage
|
|
7
|
+
export declare const ErrorMessage: React.MemoExoticComponent<({ errorMessage }: ErrorMessageProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -5,6 +5,7 @@ export type MenuType = {
|
|
|
5
5
|
isShow?: boolean;
|
|
6
6
|
isPrivateRoute?: boolean;
|
|
7
7
|
icon?: ReactNode;
|
|
8
|
+
code?: string;
|
|
8
9
|
isShowLabel?: boolean;
|
|
9
10
|
component?: React.LazyExoticComponent<React.MemoExoticComponent<any>> | React.ExoticComponent<any> | ReactNode | React.FC;
|
|
10
11
|
componentProps?: Record<string, any>;
|