@akanjs/ui 0.0.150 → 0.0.152
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/BottomSheet.d.ts +13 -0
- package/Button.d.ts +9 -0
- package/ClientSide.d.ts +6 -0
- package/Copy.d.ts +6 -0
- package/CsrImage.d.ts +11 -0
- package/Data/CardList.d.ts +36 -0
- package/Data/Dashboard.d.ts +15 -0
- package/Data/Insight.d.ts +8 -0
- package/Data/Item.d.ts +74 -0
- package/Data/ListContainer.d.ts +38 -0
- package/Data/Pagination.d.ts +6 -0
- package/Data/QueryMaker.d.ts +9 -0
- package/Data/TableList.d.ts +26 -0
- package/Data/index.d.ts +10 -0
- package/Data/index_.d.ts +8 -0
- package/DatePicker.d.ts +37 -0
- package/Dialog/Action.d.ts +5 -0
- package/Dialog/Close.d.ts +5 -0
- package/Dialog/Content.d.ts +6 -0
- package/Dialog/Modal.d.ts +8 -0
- package/Dialog/Provider.d.ts +7 -0
- package/Dialog/Title.d.ts +5 -0
- package/Dialog/Trigger.d.ts +5 -0
- package/Dialog/context.d.ts +10 -0
- package/Dialog/index.d.ts +9 -0
- package/DragAction.d.ts +24 -0
- package/DraggableList.d.ts +25 -0
- package/Dropdown.d.ts +10 -0
- package/Empty.d.ts +9 -0
- package/Field.d.ts +404 -0
- package/FontFace.d.ts +6 -0
- package/Image.d.ts +17 -0
- package/InfiniteScroll.d.ts +10 -0
- package/Input.d.ts +85 -0
- package/KeyboardAvoiding.d.ts +7 -0
- package/Layout/BottomAction.d.ts +5 -0
- package/Layout/BottomInset.d.ts +6 -0
- package/Layout/BottomTab.d.ts +14 -0
- package/Layout/Header.d.ts +7 -0
- package/Layout/LeftSider.d.ts +8 -0
- package/Layout/Navbar.d.ts +11 -0
- package/Layout/RightSider.d.ts +9 -0
- package/Layout/Sider.d.ts +6 -0
- package/Layout/Template.d.ts +5 -0
- package/Layout/TopLeftAction.d.ts +5 -0
- package/Layout/Unit.d.ts +6 -0
- package/Layout/View.d.ts +5 -0
- package/Layout/Zone.d.ts +5 -0
- package/Layout/index.d.ts +14 -0
- package/Link/Back.d.ts +6 -0
- package/Link/Close.d.ts +6 -0
- package/Link/CsrLink.d.ts +2 -0
- package/Link/NextLink.d.ts +2 -0
- package/Link/index.d.ts +8 -0
- package/Link/types.d.ts +22 -0
- package/Load/Edit.d.ts +4 -0
- package/Load/Edit_Client.d.ts +25 -0
- package/Load/Page.d.ts +10 -0
- package/Load/PageCSR.d.ts +11 -0
- package/Load/Pagination.d.ts +8 -0
- package/Load/Units.d.ts +34 -0
- package/Load/View.d.ts +17 -0
- package/Load/index.d.ts +8 -0
- package/Load/index_.d.ts +3 -0
- package/Loading/Area.d.ts +1 -0
- package/Loading/Button.d.ts +7 -0
- package/Loading/Input.d.ts +7 -0
- package/Loading/ProgressBar.d.ts +6 -0
- package/Loading/Skeleton.d.ts +7 -0
- package/Loading/Spin.d.ts +7 -0
- package/Loading/index.d.ts +8 -0
- package/Menu.d.ts +26 -0
- package/Modal.d.ts +23 -0
- package/Model/Edit.d.ts +15 -0
- package/Model/EditModal.d.ts +33 -0
- package/Model/EditWrapper.d.ts +11 -0
- package/Model/LoadInit.d.ts +10 -0
- package/Model/New.d.ts +15 -0
- package/Model/NewWrapper.d.ts +12 -0
- package/Model/NewWrapper_Client.d.ts +12 -0
- package/Model/Remove.d.ts +10 -0
- package/Model/RemoveWrapper.d.ts +11 -0
- package/Model/SureToRemove.d.ts +10 -0
- package/Model/View.d.ts +19 -0
- package/Model/ViewEditModal.d.ts +11 -0
- package/Model/ViewModal.d.ts +13 -0
- package/Model/ViewWrapper.d.ts +11 -0
- package/Model/index.d.ts +15 -0
- package/Model/index_.d.ts +13 -0
- package/More.d.ts +12 -0
- package/ObjectId.d.ts +5 -0
- package/Pagination.d.ts +14 -0
- package/Popconfirm.d.ts +18 -0
- package/Portal.d.ts +6 -0
- package/Radio.d.ts +19 -0
- package/RecentTime.d.ts +7 -0
- package/Refresh.d.ts +7 -0
- package/ScreenNavigator.d.ts +18 -0
- package/Select.d.ts +29 -0
- package/Signal/Arg.d.ts +75 -0
- package/Signal/Doc.d.ts +19 -0
- package/Signal/GraphQL.d.ts +31 -0
- package/Signal/Listener.d.ts +9 -0
- package/Signal/Message.d.ts +26 -0
- package/Signal/Object.d.ts +19 -0
- package/Signal/PubSub.d.ts +26 -0
- package/Signal/Request.d.ts +8 -0
- package/Signal/Response.d.ts +16 -0
- package/Signal/RestApi.d.ts +39 -0
- package/Signal/WebSocket.d.ts +9 -0
- package/Signal/index.d.ts +20 -0
- package/System/CSR.d.ts +31 -0
- package/System/Client.d.ts +48 -0
- package/System/Common.d.ts +66 -0
- package/System/DevModeToggle.d.ts +1 -0
- package/System/Gtag.d.ts +3 -0
- package/System/HealthCheck.d.ts +5 -0
- package/System/Messages.d.ts +1 -0
- package/System/Reconnect.d.ts +6 -0
- package/System/Root.d.ts +5 -0
- package/System/SSR.d.ts +26 -0
- package/System/SelectLanguage.d.ts +5 -0
- package/System/ThemeToggle.d.ts +1 -0
- package/System/index.d.ts +11 -0
- package/Tab/Menu.d.ts +11 -0
- package/Tab/Menus.d.ts +5 -0
- package/Tab/Panel.d.ts +7 -0
- package/Tab/Provider.d.ts +6 -0
- package/Tab/context.d.ts +9 -0
- package/Tab/index.d.ts +7 -0
- package/Table.d.ts +26 -0
- package/ToggleSelect.d.ts +31 -0
- package/Unauthorized.d.ts +9 -0
- package/cjs/BottomSheet.js +109 -0
- package/cjs/Button.js +71 -0
- package/cjs/ClientSide.js +27 -0
- package/cjs/Copy.js +38 -0
- package/cjs/CsrImage.js +51 -0
- package/cjs/Data/CardList.js +127 -0
- package/cjs/Data/Dashboard.js +64 -0
- package/cjs/Data/Insight.js +42 -0
- package/cjs/Data/Item.js +219 -0
- package/cjs/Data/ListContainer.js +285 -0
- package/cjs/Data/Pagination.js +65 -0
- package/cjs/Data/QueryMaker.js +326 -0
- package/cjs/Data/TableList.js +150 -0
- package/cjs/Data/index.js +33 -0
- package/cjs/Data/index_.js +49 -0
- package/cjs/DatePicker.js +178 -0
- package/cjs/Dialog/Action.js +32 -0
- package/cjs/Dialog/Close.js +39 -0
- package/cjs/Dialog/Content.js +28 -0
- package/cjs/Dialog/Modal.js +166 -0
- package/cjs/Dialog/Provider.js +47 -0
- package/cjs/Dialog/Title.js +32 -0
- package/cjs/Dialog/Trigger.js +39 -0
- package/cjs/Dialog/context.js +32 -0
- package/cjs/Dialog/index.js +37 -0
- package/cjs/DragAction.js +112 -0
- package/cjs/DraggableList.js +142 -0
- package/cjs/Dropdown.js +67 -0
- package/cjs/Empty.js +45 -0
- package/cjs/Field.js +1231 -0
- package/cjs/FontFace.js +77 -0
- package/cjs/Image.js +62 -0
- package/cjs/InfiniteScroll.js +70 -0
- package/cjs/Input.js +457 -0
- package/cjs/KeyboardAvoiding.js +66 -0
- package/cjs/Layout/BottomAction.js +27 -0
- package/cjs/Layout/BottomInset.js +54 -0
- package/cjs/Layout/BottomTab.js +62 -0
- package/cjs/Layout/Header.js +56 -0
- package/cjs/Layout/LeftSider.js +52 -0
- package/cjs/Layout/Navbar.js +45 -0
- package/cjs/Layout/RightSider.js +58 -0
- package/cjs/Layout/Sider.js +52 -0
- package/cjs/Layout/Template.js +27 -0
- package/cjs/Layout/TopLeftAction.js +40 -0
- package/cjs/Layout/Unit.js +28 -0
- package/cjs/Layout/View.js +27 -0
- package/cjs/Layout/Zone.js +27 -0
- package/cjs/Layout/index.js +48 -0
- package/cjs/Link/Back.js +28 -0
- package/cjs/Link/Close.js +37 -0
- package/cjs/Link/CsrLink.js +50 -0
- package/cjs/Link/NextLink.js +72 -0
- package/cjs/Link/index.js +48 -0
- package/cjs/{src/index.js → Link/types.js} +2 -10
- package/cjs/Load/Edit.js +43 -0
- package/cjs/Load/Edit_Client.js +94 -0
- package/cjs/Load/Page.js +35 -0
- package/cjs/Load/PageCSR.js +68 -0
- package/cjs/Load/Pagination.js +90 -0
- package/cjs/Load/Units.js +239 -0
- package/cjs/Load/View.js +89 -0
- package/cjs/Load/index.js +42 -0
- package/cjs/Load/index_.js +39 -0
- package/cjs/Loading/Area.js +29 -0
- package/cjs/Loading/Button.js +34 -0
- package/cjs/Loading/Input.js +34 -0
- package/cjs/Loading/ProgressBar.js +30 -0
- package/cjs/Loading/Skeleton.js +33 -0
- package/cjs/Loading/Spin.js +28 -0
- package/cjs/Loading/index.js +29 -0
- package/cjs/Menu.js +231 -0
- package/cjs/Modal.js +88 -0
- package/cjs/Model/Edit.js +67 -0
- package/cjs/Model/EditModal.js +253 -0
- package/cjs/Model/EditWrapper.js +49 -0
- package/cjs/Model/LoadInit.js +28 -0
- package/cjs/Model/New.js +67 -0
- package/cjs/Model/NewWrapper.js +29 -0
- package/cjs/Model/NewWrapper_Client.js +67 -0
- package/cjs/Model/Remove.js +92 -0
- package/cjs/Model/RemoveWrapper.js +49 -0
- package/cjs/Model/SureToRemove.js +125 -0
- package/cjs/Model/View.js +54 -0
- package/cjs/Model/ViewEditModal.js +129 -0
- package/cjs/Model/ViewModal.js +93 -0
- package/cjs/Model/ViewWrapper.js +49 -0
- package/cjs/Model/index.js +38 -0
- package/cjs/Model/index_.js +58 -0
- package/cjs/More.js +71 -0
- package/cjs/ObjectId.js +41 -0
- package/cjs/Pagination.js +115 -0
- package/cjs/Popconfirm.js +124 -0
- package/cjs/Portal.js +27 -0
- package/cjs/Radio.js +57 -0
- package/cjs/RecentTime.js +87 -0
- package/cjs/Refresh.js +46 -0
- package/cjs/ScreenNavigator.js +122 -0
- package/cjs/Select.js +283 -0
- package/cjs/Signal/Arg.js +277 -0
- package/cjs/Signal/Doc.js +258 -0
- package/cjs/Signal/GraphQL.js +261 -0
- package/cjs/Signal/Listener.js +66 -0
- package/cjs/Signal/Message.js +276 -0
- package/cjs/Signal/Object.js +131 -0
- package/cjs/Signal/PubSub.js +273 -0
- package/cjs/Signal/Request.js +45 -0
- package/cjs/Signal/Response.js +66 -0
- package/cjs/Signal/RestApi.js +357 -0
- package/cjs/Signal/WebSocket.js +69 -0
- package/cjs/Signal/index.js +42 -0
- package/cjs/System/CSR.js +395 -0
- package/cjs/System/Client.js +204 -0
- package/cjs/System/Common.js +68 -0
- package/cjs/System/DevModeToggle.js +42 -0
- package/cjs/System/Gtag.js +71 -0
- package/cjs/System/HealthCheck.js +61 -0
- package/cjs/System/Messages.js +173 -0
- package/cjs/System/Reconnect.js +86 -0
- package/cjs/System/Root.js +31 -0
- package/cjs/System/SSR.js +162 -0
- package/cjs/System/SelectLanguage.js +62 -0
- package/cjs/System/ThemeToggle.js +44 -0
- package/cjs/System/index.js +56 -0
- package/cjs/Tab/Menu.js +71 -0
- package/cjs/Tab/Menus.js +27 -0
- package/cjs/Tab/Panel.js +43 -0
- package/cjs/Tab/Provider.js +32 -0
- package/cjs/Tab/context.js +30 -0
- package/cjs/Tab/index.js +33 -0
- package/cjs/Table.js +84 -0
- package/cjs/ToggleSelect.js +123 -0
- package/cjs/Unauthorized.js +45 -0
- package/cjs/index.js +88 -2
- package/esm/BottomSheet.js +90 -0
- package/esm/Button.js +52 -0
- package/esm/ClientSide.js +8 -0
- package/esm/Copy.js +19 -0
- package/esm/CsrImage.js +32 -0
- package/esm/Data/CardList.js +98 -0
- package/esm/Data/Dashboard.js +45 -0
- package/esm/Data/Insight.js +23 -0
- package/esm/Data/Item.js +200 -0
- package/esm/Data/ListContainer.js +262 -0
- package/esm/Data/Pagination.js +46 -0
- package/esm/Data/QueryMaker.js +315 -0
- package/esm/Data/TableList.js +121 -0
- package/esm/Data/index.js +14 -0
- package/esm/Data/index_.js +20 -0
- package/esm/DatePicker.js +149 -0
- package/esm/Dialog/Action.js +13 -0
- package/esm/Dialog/Close.js +20 -0
- package/esm/Dialog/Content.js +9 -0
- package/esm/Dialog/Modal.js +137 -0
- package/esm/Dialog/Provider.js +18 -0
- package/esm/Dialog/Title.js +13 -0
- package/esm/Dialog/Trigger.js +20 -0
- package/esm/Dialog/context.js +13 -0
- package/esm/Dialog/index.js +18 -0
- package/esm/DragAction.js +93 -0
- package/esm/DraggableList.js +113 -0
- package/esm/Dropdown.js +48 -0
- package/esm/Empty.js +26 -0
- package/esm/Field.js +1212 -0
- package/esm/FontFace.js +58 -0
- package/esm/Image.js +33 -0
- package/esm/InfiniteScroll.js +51 -0
- package/esm/Input.js +442 -0
- package/esm/KeyboardAvoiding.js +47 -0
- package/esm/Layout/BottomAction.js +8 -0
- package/esm/Layout/BottomInset.js +35 -0
- package/esm/Layout/BottomTab.js +43 -0
- package/esm/Layout/Header.js +37 -0
- package/esm/Layout/LeftSider.js +33 -0
- package/esm/Layout/Navbar.js +26 -0
- package/esm/Layout/RightSider.js +39 -0
- package/esm/Layout/Sider.js +33 -0
- package/esm/Layout/Template.js +8 -0
- package/esm/Layout/TopLeftAction.js +21 -0
- package/esm/Layout/Unit.js +9 -0
- package/esm/Layout/View.js +8 -0
- package/esm/Layout/Zone.js +8 -0
- package/esm/Layout/index.js +29 -0
- package/esm/Link/Back.js +9 -0
- package/esm/Link/Close.js +18 -0
- package/esm/Link/CsrLink.js +31 -0
- package/esm/Link/NextLink.js +43 -0
- package/esm/Link/index.js +19 -0
- package/esm/Link/types.js +0 -0
- package/esm/Load/Edit.js +14 -0
- package/esm/Load/Edit_Client.js +75 -0
- package/esm/Load/Page.js +16 -0
- package/esm/Load/PageCSR.js +49 -0
- package/esm/Load/Pagination.js +71 -0
- package/esm/Load/Units.js +220 -0
- package/esm/Load/View.js +70 -0
- package/esm/Load/index.js +13 -0
- package/esm/Load/index_.js +10 -0
- package/esm/Loading/Area.js +10 -0
- package/esm/Loading/Button.js +15 -0
- package/esm/Loading/Input.js +15 -0
- package/esm/Loading/ProgressBar.js +11 -0
- package/esm/Loading/Skeleton.js +14 -0
- package/esm/Loading/Spin.js +9 -0
- package/esm/Loading/index.js +10 -0
- package/esm/Menu.js +212 -0
- package/esm/Modal.js +59 -0
- package/esm/Model/Edit.js +38 -0
- package/esm/Model/EditModal.js +234 -0
- package/esm/Model/EditWrapper.js +30 -0
- package/esm/Model/LoadInit.js +9 -0
- package/esm/Model/New.js +38 -0
- package/esm/Model/NewWrapper.js +10 -0
- package/esm/Model/NewWrapper_Client.js +48 -0
- package/esm/Model/Remove.js +73 -0
- package/esm/Model/RemoveWrapper.js +30 -0
- package/esm/Model/SureToRemove.js +106 -0
- package/esm/Model/View.js +35 -0
- package/esm/Model/ViewEditModal.js +100 -0
- package/esm/Model/ViewModal.js +64 -0
- package/esm/Model/ViewWrapper.js +30 -0
- package/esm/Model/index.js +33 -0
- package/esm/Model/index_.js +29 -0
- package/esm/More.js +42 -0
- package/esm/ObjectId.js +22 -0
- package/esm/Pagination.js +96 -0
- package/esm/Popconfirm.js +105 -0
- package/esm/Portal.js +8 -0
- package/esm/Radio.js +38 -0
- package/esm/RecentTime.js +58 -0
- package/esm/Refresh.js +17 -0
- package/esm/ScreenNavigator.js +103 -0
- package/esm/Select.js +264 -0
- package/esm/Signal/Arg.js +248 -0
- package/esm/Signal/Doc.js +229 -0
- package/esm/Signal/GraphQL.js +240 -0
- package/esm/Signal/Listener.js +47 -0
- package/esm/Signal/Message.js +247 -0
- package/esm/Signal/Object.js +112 -0
- package/esm/Signal/PubSub.js +244 -0
- package/esm/Signal/Request.js +26 -0
- package/esm/Signal/Response.js +47 -0
- package/esm/Signal/RestApi.js +336 -0
- package/esm/Signal/WebSocket.js +40 -0
- package/esm/Signal/index.js +13 -0
- package/esm/System/CSR.js +376 -0
- package/esm/System/Client.js +195 -0
- package/esm/System/Common.js +49 -0
- package/esm/System/DevModeToggle.js +23 -0
- package/esm/System/Gtag.js +52 -0
- package/esm/System/HealthCheck.js +42 -0
- package/esm/System/Messages.js +159 -0
- package/esm/System/Reconnect.js +67 -0
- package/esm/System/Root.js +12 -0
- package/esm/System/SSR.js +143 -0
- package/esm/System/SelectLanguage.js +43 -0
- package/esm/System/ThemeToggle.js +25 -0
- package/esm/System/index.js +27 -0
- package/esm/Tab/Menu.js +52 -0
- package/esm/Tab/Menus.js +8 -0
- package/esm/Tab/Panel.js +24 -0
- package/esm/Tab/Provider.js +13 -0
- package/esm/Tab/context.js +11 -0
- package/esm/Tab/index.js +14 -0
- package/esm/Table.js +65 -0
- package/esm/ToggleSelect.js +104 -0
- package/esm/Unauthorized.js +26 -0
- package/esm/index.js +84 -1
- package/index.d.ts +41 -1
- package/package.json +23 -2
- package/esm/src/index.js +0 -4
- package/src/index.d.ts +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var SelectLanguage_exports = {};
|
|
20
|
+
__export(SelectLanguage_exports, {
|
|
21
|
+
SelectLanguage: () => SelectLanguage
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(SelectLanguage_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_next = require("@akanjs/next");
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
const languageNames = {
|
|
29
|
+
en: "English",
|
|
30
|
+
ko: "\uD55C\uAD6D\uC5B4",
|
|
31
|
+
zhChs: "\u7B80\u4F53\u4E2D\u6587",
|
|
32
|
+
zhCht: "\u7E41\u9AD4\u4E2D\u6587"
|
|
33
|
+
};
|
|
34
|
+
const SelectLanguage = ({ className, languages = ["en", "ko"] }) => {
|
|
35
|
+
const { l, lang } = (0, import_next.usePage)();
|
|
36
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
id: "select-language",
|
|
42
|
+
onClick: () => {
|
|
43
|
+
setOpen(!open);
|
|
44
|
+
},
|
|
45
|
+
className: "mx-2 my-auto cursor-pointer rounded-3xl border bg-black/50 px-3 text-xs font-light text-white md:mx-4",
|
|
46
|
+
children: languageNames[lang]
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute top-6 -left-4 w-28 rounded-xl border bg-slate-900/90 py-2 text-center text-white", children: languages.filter((lang2) => !!languageNames[lang2]).map((lang2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
onClick: () => {
|
|
53
|
+
import_client.router.setLang(lang2);
|
|
54
|
+
setOpen(false);
|
|
55
|
+
},
|
|
56
|
+
className: "cursor-pointer py-1 hover:bg-white/20",
|
|
57
|
+
children: languageNames[lang2]
|
|
58
|
+
},
|
|
59
|
+
lang2
|
|
60
|
+
)) }) : null
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ThemeToggle_exports = {};
|
|
20
|
+
__export(ThemeToggle_exports, {
|
|
21
|
+
ThemeToggle: () => ThemeToggle
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ThemeToggle_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_common = require("@akanjs/common");
|
|
26
|
+
var import_next_themes = require("next-themes");
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
const ThemeToggle = () => {
|
|
29
|
+
const [mounted, setMounted] = (0, import_react.useState)(false);
|
|
30
|
+
const { theme, setTheme, themes } = (0, import_next_themes.useTheme)();
|
|
31
|
+
(0, import_react.useEffect)(() => {
|
|
32
|
+
setMounted(true);
|
|
33
|
+
}, []);
|
|
34
|
+
const handleTheme = (e) => {
|
|
35
|
+
setTheme(theme === "dark" ? "light" : "dark");
|
|
36
|
+
};
|
|
37
|
+
if (!mounted) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "label cursor-pointer", children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "label-text mr-2 text-sm whitespace-nowrap", children: (0, import_common.capitalize)(theme ?? "") }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", className: "toggle toggle-sm", checked: theme === "dark", onChange: handleTheme })
|
|
43
|
+
] }) });
|
|
44
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var System_exports = {};
|
|
29
|
+
__export(System_exports, {
|
|
30
|
+
Provider: () => Provider,
|
|
31
|
+
System: () => System
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(System_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_base = require("@akanjs/base");
|
|
36
|
+
var import_CSR = __toESM(require("./CSR"));
|
|
37
|
+
var import_DevModeToggle = require("./DevModeToggle");
|
|
38
|
+
var import_Reconnect = require("./Reconnect");
|
|
39
|
+
var import_Root = require("./Root");
|
|
40
|
+
var import_SelectLanguage = require("./SelectLanguage");
|
|
41
|
+
var import_SSR = __toESM(require("./SSR"));
|
|
42
|
+
var import_ThemeToggle = require("./ThemeToggle");
|
|
43
|
+
const Provider = (props) => {
|
|
44
|
+
if (import_base.baseClientEnv.renderMode === "csr")
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CSR.default, { ...props });
|
|
46
|
+
else
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SSR.default, { ...props });
|
|
48
|
+
};
|
|
49
|
+
const System = {
|
|
50
|
+
Provider,
|
|
51
|
+
ThemeToggle: import_ThemeToggle.ThemeToggle,
|
|
52
|
+
Root: import_Root.Root,
|
|
53
|
+
SelectLanguage: import_SelectLanguage.SelectLanguage,
|
|
54
|
+
Reconnect: import_Reconnect.Reconnect,
|
|
55
|
+
DevModeToggle: import_DevModeToggle.DevModeToggle
|
|
56
|
+
};
|
package/cjs/Tab/Menu.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Menu_exports = {};
|
|
20
|
+
__export(Menu_exports, {
|
|
21
|
+
Menu: () => Menu
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Menu_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_context = require("./context");
|
|
28
|
+
const Menu = ({
|
|
29
|
+
className,
|
|
30
|
+
activeClassName = "",
|
|
31
|
+
disabledClassName = "",
|
|
32
|
+
disabled = false,
|
|
33
|
+
menu,
|
|
34
|
+
children,
|
|
35
|
+
scrollToTop,
|
|
36
|
+
tooltip
|
|
37
|
+
}) => {
|
|
38
|
+
const { menu: currentMenu, setMenu, menuSet } = (0, import_react.useContext)(import_context.TabContext);
|
|
39
|
+
(0, import_react.useEffect)(() => {
|
|
40
|
+
if (!menuSet.current)
|
|
41
|
+
return;
|
|
42
|
+
menuSet.current.add(menu);
|
|
43
|
+
}, [menu]);
|
|
44
|
+
(0, import_react.useEffect)(() => {
|
|
45
|
+
if (!disabled || !menuSet.current)
|
|
46
|
+
return;
|
|
47
|
+
if (currentMenu === menu)
|
|
48
|
+
setMenu([...menuSet.current.values()].find((m) => m !== menu) ?? null);
|
|
49
|
+
}, [disabled]);
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-tip": tooltip,
|
|
54
|
+
className: (0, import_client.clsx)(className, {
|
|
55
|
+
"cursor-pointer": menu !== currentMenu && !disabled,
|
|
56
|
+
"cursor-not-allowed": disabled,
|
|
57
|
+
tooltip: !!tooltip,
|
|
58
|
+
[activeClassName]: menu === currentMenu,
|
|
59
|
+
[disabledClassName]: disabled
|
|
60
|
+
}),
|
|
61
|
+
onClick: () => {
|
|
62
|
+
if (disabled)
|
|
63
|
+
return;
|
|
64
|
+
setMenu(menu);
|
|
65
|
+
if (scrollToTop)
|
|
66
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
67
|
+
},
|
|
68
|
+
children
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
};
|
package/cjs/Tab/Menus.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Menus_exports = {};
|
|
20
|
+
__export(Menus_exports, {
|
|
21
|
+
Menus: () => Menus
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Menus_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
const Menus = ({ className, children }) => {
|
|
26
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children });
|
|
27
|
+
};
|
package/cjs/Tab/Panel.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Panel_exports = {};
|
|
20
|
+
__export(Panel_exports, {
|
|
21
|
+
Panel: () => Panel
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Panel_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_context = require("./context");
|
|
28
|
+
const Panel = ({ className, menu, children, loading = "eager" }) => {
|
|
29
|
+
const { menu: currentMenu } = (0, import_react.useContext)(import_context.TabContext);
|
|
30
|
+
const [loaded, setLoaded] = (0, import_react.useState)(menu === currentMenu);
|
|
31
|
+
(0, import_react.useEffect)(() => {
|
|
32
|
+
if (loading === "eager")
|
|
33
|
+
setLoaded(true);
|
|
34
|
+
else if (loading === "lazy" && !loaded && currentMenu === menu)
|
|
35
|
+
setLoaded(true);
|
|
36
|
+
else if (loading === "every")
|
|
37
|
+
setLoaded(currentMenu === menu);
|
|
38
|
+
}, [currentMenu]);
|
|
39
|
+
if (loading === "eager")
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)(className, { hidden: currentMenu !== menu }), children });
|
|
41
|
+
else
|
|
42
|
+
return loaded ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)(className, { hidden: currentMenu !== menu }), children }) : null;
|
|
43
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Provider_exports = {};
|
|
20
|
+
__export(Provider_exports, {
|
|
21
|
+
Provider: () => Provider
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Provider_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_context = require("./context");
|
|
28
|
+
const Provider = ({ className, defaultMenu = null, children }) => {
|
|
29
|
+
const menuSet = (0, import_react.useRef)(/* @__PURE__ */ new Set());
|
|
30
|
+
const [menu, setMenu] = (0, import_react.useState)(defaultMenu);
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.TabContext.Provider, { value: { defaultMenu, menu, setMenu, menuSet }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-menu": menu, className: (0, import_client.clsx)(className, "group/tab"), children }) });
|
|
32
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var context_exports = {};
|
|
20
|
+
__export(context_exports, {
|
|
21
|
+
TabContext: () => TabContext
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(context_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
const TabContext = (0, import_react.createContext)({
|
|
26
|
+
defaultMenu: null,
|
|
27
|
+
menu: null,
|
|
28
|
+
setMenu: (value) => null,
|
|
29
|
+
menuSet: null
|
|
30
|
+
});
|
package/cjs/Tab/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Tab_exports = {};
|
|
19
|
+
__export(Tab_exports, {
|
|
20
|
+
Tab: () => Tab
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(Tab_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_Menu = require("./Menu");
|
|
25
|
+
var import_Menus = require("./Menus");
|
|
26
|
+
var import_Panel = require("./Panel");
|
|
27
|
+
var import_Provider = require("./Provider");
|
|
28
|
+
const Tab = (props) => {
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Provider.Provider, { ...props });
|
|
30
|
+
};
|
|
31
|
+
Tab.Menu = import_Menu.Menu;
|
|
32
|
+
Tab.Menus = import_Menus.Menus;
|
|
33
|
+
Tab.Panel = import_Panel.Panel;
|
package/cjs/Table.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Table_exports = {};
|
|
20
|
+
__export(Table_exports, {
|
|
21
|
+
Table: () => Table
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Table_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_store = require("@akanjs/store");
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
var import_ai = require("react-icons/ai");
|
|
29
|
+
var import_Empty = require("./Empty");
|
|
30
|
+
var import_Pagination = require("./Pagination");
|
|
31
|
+
const Table = ({
|
|
32
|
+
columns,
|
|
33
|
+
dataSource,
|
|
34
|
+
loading,
|
|
35
|
+
size,
|
|
36
|
+
bordered,
|
|
37
|
+
pagination,
|
|
38
|
+
showHeader = true,
|
|
39
|
+
onRow,
|
|
40
|
+
rowClassName,
|
|
41
|
+
rowKey
|
|
42
|
+
}) => {
|
|
43
|
+
const sizeClassName = size === "small" ? "table-compact" : "";
|
|
44
|
+
const loadingClassName = loading ? "opacity-30" : "";
|
|
45
|
+
const borderedClassName = bordered ? "border border-gray-200 rounded-xl" : "";
|
|
46
|
+
const responsive = import_store.st.use.responsive();
|
|
47
|
+
const renderedColumns = (0, import_react.useMemo)(() => {
|
|
48
|
+
return columns.filter((c) => !c.responsive || c.responsive.includes(responsive)).map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { className: "whitespace-nowrap", children: column.title }, idx));
|
|
49
|
+
}, [columns, responsive]);
|
|
50
|
+
const renderedRows = (0, import_react.useMemo)(() => {
|
|
51
|
+
return dataSource.map((rowData, rowIndex) => {
|
|
52
|
+
const renderedCells = columns.filter((c) => !c.responsive || c.responsive.includes(responsive)).map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
"td",
|
|
54
|
+
{
|
|
55
|
+
className: (0, import_client.clsx)(
|
|
56
|
+
"whitespace-nowrap",
|
|
57
|
+
rowClassName ? typeof rowClassName === "string" ? rowClassName : rowClassName(rowData, rowIndex) : ""
|
|
58
|
+
),
|
|
59
|
+
...onRow?.(rowData, rowIndex),
|
|
60
|
+
children: column.render ? column.render(rowData[column.dataIndex], rowData, rowIndex) : column.dataIndex ? rowData[column.dataIndex] : null
|
|
61
|
+
},
|
|
62
|
+
idx
|
|
63
|
+
));
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: renderedCells }, rowIndex);
|
|
65
|
+
});
|
|
66
|
+
}, [columns, dataSource, responsive]);
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("relative w-full", loadingClassName, borderedClassName), children: [
|
|
68
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineLoading3Quarters, { className: "animate-spin text-3xl" }) }),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { className: (0, import_client.clsx)("table w-full", sizeClassName), children: [
|
|
70
|
+
showHeader === true || Array.isArray(showHeader) && showHeader.includes(responsive) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { className: "normal-case", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: renderedColumns }) }) : null,
|
|
71
|
+
!!dataSource.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: renderedRows })
|
|
72
|
+
] }),
|
|
73
|
+
!dataSource.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Empty.Empty, {}) }),
|
|
74
|
+
pagination && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
import_Pagination.Pagination,
|
|
76
|
+
{
|
|
77
|
+
currentPage: pagination.currentPage,
|
|
78
|
+
total: pagination.total,
|
|
79
|
+
onPageSelect: pagination.onPageSelect,
|
|
80
|
+
itemsPerPage: pagination.itemsPerPage
|
|
81
|
+
}
|
|
82
|
+
) })
|
|
83
|
+
] });
|
|
84
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var ToggleSelect_exports = {};
|
|
19
|
+
__export(ToggleSelect_exports, {
|
|
20
|
+
ToggleSelect: () => ToggleSelect
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(ToggleSelect_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_client = require("@akanjs/client");
|
|
25
|
+
var import_next = require("@akanjs/next");
|
|
26
|
+
const ToggleSelect = ({
|
|
27
|
+
className,
|
|
28
|
+
btnClassName,
|
|
29
|
+
items,
|
|
30
|
+
nullable,
|
|
31
|
+
validate,
|
|
32
|
+
value,
|
|
33
|
+
onChange,
|
|
34
|
+
disabled
|
|
35
|
+
}) => {
|
|
36
|
+
const { l } = (0, import_next.usePage)();
|
|
37
|
+
const validateResult = validate(value ?? "");
|
|
38
|
+
const invalidMessage = !value?.length || validateResult === true ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
|
|
39
|
+
const options = items.map(
|
|
40
|
+
(item) => typeof item === "string" ? { label: item, value: item } : item
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: (0, import_client.clsx)(
|
|
46
|
+
"border-base-content/20 relative flex w-full flex-wrap items-center gap-1 rounded-md border p-2",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
options.map((option, idx) => {
|
|
51
|
+
const isSelected = value === option.value;
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
disabled,
|
|
56
|
+
className: (0, import_client.clsx)(
|
|
57
|
+
"btn btn-sm",
|
|
58
|
+
{ "bg-success/70 text-success-content": isSelected },
|
|
59
|
+
// {
|
|
60
|
+
// "btn-error": status === "error",
|
|
61
|
+
// "btn-warning": status === "warning",
|
|
62
|
+
// },
|
|
63
|
+
btnClassName
|
|
64
|
+
),
|
|
65
|
+
onClick: () => {
|
|
66
|
+
onChange(option.value, idx);
|
|
67
|
+
},
|
|
68
|
+
children: option.label
|
|
69
|
+
},
|
|
70
|
+
idx
|
|
71
|
+
);
|
|
72
|
+
}),
|
|
73
|
+
invalidMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-error animate-fadeIn absolute -bottom-4 text-xs", children: invalidMessage }) : null
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
const Multi = ({ className, btnClassName, items, nullable, validate, value, onChange, disabled }) => {
|
|
79
|
+
const { l } = (0, import_next.usePage)();
|
|
80
|
+
const validateResult = validate(value);
|
|
81
|
+
const invalidMessage = !value.length || validateResult === true ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
|
|
82
|
+
const options = items.map(
|
|
83
|
+
(item) => typeof item === "string" ? { label: item, value: item } : item
|
|
84
|
+
);
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: (0, import_client.clsx)(
|
|
89
|
+
"border-base-content/20 relative flex w-full flex-wrap items-center gap-1 rounded-md border p-2",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
children: [
|
|
93
|
+
options.map((option, idx) => {
|
|
94
|
+
const isSelected = value.includes(option.value);
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
disabled,
|
|
99
|
+
className: (0, import_client.clsx)(
|
|
100
|
+
"btn btn-sm",
|
|
101
|
+
{
|
|
102
|
+
"bg-success/70 text-success-content": isSelected
|
|
103
|
+
},
|
|
104
|
+
btnClassName
|
|
105
|
+
),
|
|
106
|
+
onClick: () => {
|
|
107
|
+
onChange(
|
|
108
|
+
isSelected ? value.filter((i) => i !== option.value) : [...value, option.value].sort(
|
|
109
|
+
(a, b) => options.findIndex((o) => o.value === a) - items.findIndex((o) => o.value === b)
|
|
110
|
+
)
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
children: option.label
|
|
114
|
+
},
|
|
115
|
+
idx
|
|
116
|
+
);
|
|
117
|
+
}),
|
|
118
|
+
invalidMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-error animate-fadeIn absolute -bottom-4 text-xs", children: invalidMessage }) : null
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
ToggleSelect.Multi = Multi;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Unauthorized_exports = {};
|
|
19
|
+
__export(Unauthorized_exports, {
|
|
20
|
+
Unauthorized: () => Unauthorized
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(Unauthorized_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_client = require("@akanjs/client");
|
|
25
|
+
var import_next = require("@akanjs/next");
|
|
26
|
+
var import_ai = require("react-icons/ai");
|
|
27
|
+
const Unauthorized = ({ className = "", description, children, minHeight = 300 }) => {
|
|
28
|
+
const { l } = (0, import_next.usePage)();
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: (0, import_client.clsx)(
|
|
34
|
+
`min-h-[ w-full${minHeight}px] text-base-content/30 flex flex-col items-center justify-center gap-3 pt-6 pb-3`,
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineBlock, { className: "scale-150 text-4xl" }),
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: description ?? l("util.unauthorized") })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
children
|
|
44
|
+
] });
|
|
45
|
+
};
|