@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,49 @@
|
|
|
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 EditWrapper_exports = {};
|
|
20
|
+
__export(EditWrapper_exports, {
|
|
21
|
+
default: () => EditWrapper
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(EditWrapper_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_common = require("@akanjs/common");
|
|
27
|
+
var import_store = require("@akanjs/store");
|
|
28
|
+
function EditWrapper({ children, sliceName, modelId, className, modal, resets }) {
|
|
29
|
+
const refName = import_store.st.slice[sliceName].refName;
|
|
30
|
+
const modelName = refName;
|
|
31
|
+
const names = {
|
|
32
|
+
editModel: `edit${(0, import_common.capitalize)(modelName)}`
|
|
33
|
+
};
|
|
34
|
+
const storeDo = import_store.st.do;
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: (0, import_client.clsx)("cursor-pointer", className),
|
|
39
|
+
onClick: (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
void storeDo[names.editModel](modelId, { modal });
|
|
42
|
+
resets?.forEach((reset) => {
|
|
43
|
+
void storeDo[`reset${(0, import_common.capitalize)(reset)}`]();
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 LoadInit_exports = {};
|
|
20
|
+
__export(LoadInit_exports, {
|
|
21
|
+
default: () => LoadInit
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LoadInit_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_Load = require("../Load");
|
|
26
|
+
function LoadInit({ init }) {
|
|
27
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Load.Load.Units, { init, renderList: () => null, loading: null, renderEmpty: null });
|
|
28
|
+
}
|
package/cjs/Model/New.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
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 New_exports = {};
|
|
29
|
+
__export(New_exports, {
|
|
30
|
+
default: () => New
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(New_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_client = require("@akanjs/client");
|
|
35
|
+
var import_next = require("@akanjs/next");
|
|
36
|
+
var import_ai = require("react-icons/ai");
|
|
37
|
+
var import_EditModal = __toESM(require("./EditModal"));
|
|
38
|
+
var import_NewWrapper = __toESM(require("./NewWrapper"));
|
|
39
|
+
function New({
|
|
40
|
+
className,
|
|
41
|
+
wrapperClassName,
|
|
42
|
+
type = "button",
|
|
43
|
+
children,
|
|
44
|
+
sliceName,
|
|
45
|
+
modal,
|
|
46
|
+
partial,
|
|
47
|
+
renderTitle
|
|
48
|
+
}) {
|
|
49
|
+
const { l } = (0, import_next.usePage)();
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("inline", wrapperClassName), children: [
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
52
|
+
import_NewWrapper.default,
|
|
53
|
+
{
|
|
54
|
+
className: (0, import_client.clsx)("flex w-full items-center justify-center gap-2", className),
|
|
55
|
+
sliceName,
|
|
56
|
+
modal,
|
|
57
|
+
partial,
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlinePlus, {}),
|
|
60
|
+
" ",
|
|
61
|
+
type === "button" ? l("shared.new") : null
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditModal.default, { renderTitle, sliceName, children })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 NewWrapper_exports = {};
|
|
19
|
+
__export(NewWrapper_exports, {
|
|
20
|
+
default: () => NewWrapper
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(NewWrapper_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_common = require("@akanjs/common");
|
|
25
|
+
var import_NewWrapper_Client = require("./NewWrapper_Client");
|
|
26
|
+
function NewWrapper({ partial = {}, ...props }) {
|
|
27
|
+
const serializedPartial = (0, import_common.deepObjectify)(typeof partial === "function" ? partial() : partial, { serializable: true });
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_NewWrapper_Client.NewWrapper_Client, { ...props, partial: serializedPartial });
|
|
29
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 NewWrapper_Client_exports = {};
|
|
20
|
+
__export(NewWrapper_Client_exports, {
|
|
21
|
+
NewWrapper_Client: () => NewWrapper_Client
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(NewWrapper_Client_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_common = require("@akanjs/common");
|
|
27
|
+
var import_signal = require("@akanjs/signal");
|
|
28
|
+
var import_store = require("@akanjs/store");
|
|
29
|
+
const NewWrapper_Client = ({
|
|
30
|
+
children,
|
|
31
|
+
sliceName,
|
|
32
|
+
partial,
|
|
33
|
+
setDefault,
|
|
34
|
+
className,
|
|
35
|
+
modal,
|
|
36
|
+
resets
|
|
37
|
+
}) => {
|
|
38
|
+
const refName = import_store.st.slice[sliceName].refName;
|
|
39
|
+
const modelName = refName;
|
|
40
|
+
const names = {
|
|
41
|
+
newModel: `new${(0, import_common.capitalize)(modelName)}`,
|
|
42
|
+
crystalizeModel: `crystalize${(0, import_common.capitalize)(modelName)}`,
|
|
43
|
+
modelModal: `${modelName}Modal`
|
|
44
|
+
};
|
|
45
|
+
const storeDo = import_store.st.do;
|
|
46
|
+
const storeUse = import_store.st.use;
|
|
47
|
+
const crystalizeModel = import_signal.fetch[names.crystalizeModel];
|
|
48
|
+
const modelModal = storeUse[names.modelModal]();
|
|
49
|
+
const disabled = modelModal === "edit";
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: (0, import_client.clsx)({ "cursor-pointer": !disabled, "pointer-events-none": disabled }, className),
|
|
54
|
+
onClick: (e) => {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
if (disabled)
|
|
57
|
+
return;
|
|
58
|
+
const crystal = crystalizeModel(partial);
|
|
59
|
+
void storeDo[names.newModel](crystal, { modal, setDefault, sliceName });
|
|
60
|
+
resets?.forEach((reset) => {
|
|
61
|
+
void storeDo[`reset${(0, import_common.capitalize)(reset)}`]();
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
children
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
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 Remove_exports = {};
|
|
20
|
+
__export(Remove_exports, {
|
|
21
|
+
default: () => Remove
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Remove_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_common = require("@akanjs/common");
|
|
27
|
+
var import_dictionary = require("@akanjs/dictionary");
|
|
28
|
+
var import_next = require("@akanjs/next");
|
|
29
|
+
var import_store = require("@akanjs/store");
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_ai = require("react-icons/ai");
|
|
32
|
+
var import_Button = require("../Button");
|
|
33
|
+
var import_Modal = require("../Modal");
|
|
34
|
+
function Remove({ className, name, modelId, sliceName, modal, redirect }) {
|
|
35
|
+
const { l } = (0, import_next.usePage)();
|
|
36
|
+
const [modalOpen, setModalOpen] = (0, import_react.useState)(false);
|
|
37
|
+
const storeDo = import_store.st.do;
|
|
38
|
+
const refName = import_store.st.slice[sliceName].refName;
|
|
39
|
+
const modelName = refName;
|
|
40
|
+
const names = (0, import_react.useMemo)(
|
|
41
|
+
() => ({
|
|
42
|
+
removeModel: `remove${(0, import_common.capitalize)(modelName)}`
|
|
43
|
+
}),
|
|
44
|
+
[]
|
|
45
|
+
);
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "inline size-full", children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
className: (0, import_client.clsx)("btn text-error btn-sm size-full flex-nowrap whitespace-nowrap", className),
|
|
51
|
+
onClick: (e) => {
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
setModalOpen(true);
|
|
54
|
+
},
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineDelete, {}),
|
|
57
|
+
" ",
|
|
58
|
+
l("shared.remove")
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
+
import_Modal.Modal,
|
|
64
|
+
{
|
|
65
|
+
open: modalOpen,
|
|
66
|
+
onCancel: () => {
|
|
67
|
+
setModalOpen(false);
|
|
68
|
+
},
|
|
69
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-error text-lg font-bold", children: l("shared.removeModel", { model: l(`${modelName}.modelName`) }) }),
|
|
70
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
import_Button.Button,
|
|
72
|
+
{
|
|
73
|
+
className: "btn btn-warning w-full",
|
|
74
|
+
onClick: async (e, { onError }) => {
|
|
75
|
+
await storeDo[names.removeModel](modelId, { onError, modal });
|
|
76
|
+
import_dictionary.msg.success("shared.removeSuccess", { data: { model: l(`${modelName}.modelName`) } });
|
|
77
|
+
setModalOpen(false);
|
|
78
|
+
if (!redirect)
|
|
79
|
+
return;
|
|
80
|
+
if (redirect === "back")
|
|
81
|
+
import_client.router.back();
|
|
82
|
+
else
|
|
83
|
+
import_client.router.push(redirect);
|
|
84
|
+
},
|
|
85
|
+
children: l("shared.yesRemove", { model: l(`${modelName}.modelName`) })
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex w-full items-center justify-center", children: l("shared.sureToRemove", { model: l(`${modelName}.modelName`), name: name ?? "" }) })
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 RemoveWrapper_exports = {};
|
|
20
|
+
__export(RemoveWrapper_exports, {
|
|
21
|
+
default: () => RemoveWrapper
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(RemoveWrapper_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_common = require("@akanjs/common");
|
|
27
|
+
var import_next = require("@akanjs/next");
|
|
28
|
+
var import_store = require("@akanjs/store");
|
|
29
|
+
var import_Popconfirm = require("../Popconfirm");
|
|
30
|
+
function RemoveWrapper({ children, sliceName, name, modelId, className, modal }) {
|
|
31
|
+
const { l } = (0, import_next.usePage)();
|
|
32
|
+
const refName = import_store.st.slice[sliceName].refName;
|
|
33
|
+
const modelName = refName;
|
|
34
|
+
const names = {
|
|
35
|
+
removeModel: `remove${(0, import_common.capitalize)(modelName)}`
|
|
36
|
+
};
|
|
37
|
+
const storeDo = import_store.st.do;
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
import_Popconfirm.Popconfirm,
|
|
40
|
+
{
|
|
41
|
+
title: l("shared.removeModel", { model: l(`${modelName}.modelName`) }),
|
|
42
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: l("shared.sureToRemove", { model: l(`${modelName}.modelName`), name }) }),
|
|
43
|
+
onConfirm: () => {
|
|
44
|
+
void storeDo[names.removeModel](modelId, { modal });
|
|
45
|
+
},
|
|
46
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)("cursor-pointer", className), children })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
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 SureToRemove_exports = {};
|
|
20
|
+
__export(SureToRemove_exports, {
|
|
21
|
+
default: () => SureToRemove
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(SureToRemove_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_client = require("@akanjs/client");
|
|
26
|
+
var import_common = require("@akanjs/common");
|
|
27
|
+
var import_dictionary = require("@akanjs/dictionary");
|
|
28
|
+
var import_next = require("@akanjs/next");
|
|
29
|
+
var import_store = require("@akanjs/store");
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_ai = require("react-icons/ai");
|
|
32
|
+
var import_Modal = require("../Modal");
|
|
33
|
+
function SureToRemove({
|
|
34
|
+
className,
|
|
35
|
+
modelId,
|
|
36
|
+
name,
|
|
37
|
+
sliceName,
|
|
38
|
+
redirect,
|
|
39
|
+
typeNameToRemove
|
|
40
|
+
}) {
|
|
41
|
+
const { l } = (0, import_next.usePage)();
|
|
42
|
+
const [repeatName, setRepeatName] = (0, import_react.useState)("");
|
|
43
|
+
const [modalOpen, setModalOpen] = (0, import_react.useState)(false);
|
|
44
|
+
const storeDo = import_store.st.do;
|
|
45
|
+
const refName = import_store.st.slice[sliceName].refName;
|
|
46
|
+
const modelName = refName;
|
|
47
|
+
const names = (0, import_react.useMemo)(
|
|
48
|
+
() => ({
|
|
49
|
+
removeModel: `remove${(0, import_common.capitalize)(modelName)}`
|
|
50
|
+
}),
|
|
51
|
+
[]
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "inline size-full", children: [
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: (0, import_client.clsx)(
|
|
58
|
+
"text-error flex size-full cursor-pointer flex-nowrap items-center justify-center gap-2 whitespace-nowrap",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
onClick: (e) => {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
setModalOpen(true);
|
|
64
|
+
},
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineDelete, {}),
|
|
67
|
+
" ",
|
|
68
|
+
l("shared.remove")
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
|
+
import_Modal.Modal,
|
|
74
|
+
{
|
|
75
|
+
open: modalOpen,
|
|
76
|
+
onCancel: () => {
|
|
77
|
+
setModalOpen(false);
|
|
78
|
+
},
|
|
79
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-error text-lg font-bold", children: l("shared.removeModel", { model: l(`${modelName}.modelName`) }) }),
|
|
80
|
+
bodyClassName: "border-error",
|
|
81
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
className: "btn btn-error w-full",
|
|
85
|
+
disabled: typeNameToRemove && repeatName !== name,
|
|
86
|
+
onClick: async () => {
|
|
87
|
+
await storeDo[names.removeModel](modelId);
|
|
88
|
+
import_dictionary.msg.success("shared.removeSuccess", { data: { model: l(`${modelName}.modelName`) } });
|
|
89
|
+
setModalOpen(false);
|
|
90
|
+
if (!redirect)
|
|
91
|
+
return;
|
|
92
|
+
if (redirect === "back")
|
|
93
|
+
import_client.router.back();
|
|
94
|
+
else
|
|
95
|
+
import_client.router.push(redirect);
|
|
96
|
+
},
|
|
97
|
+
children: l("shared.removeModel", { model: l(`${modelName}.modelName`) })
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-4", children: [
|
|
102
|
+
l("shared.sureToRemove", { model: l(`${modelName}.modelName`), name }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
|
104
|
+
l("shared.irreversibleOps"),
|
|
105
|
+
typeNameToRemove ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
|
107
|
+
l("shared.typeNameToRemove", { model: l(`${modelName}.modelName`), name })
|
|
108
|
+
] }) : null
|
|
109
|
+
] }),
|
|
110
|
+
typeNameToRemove ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
"input",
|
|
112
|
+
{
|
|
113
|
+
className: "input w-full text-center",
|
|
114
|
+
placeholder: `${l(`${modelName}.modelName`)} name`,
|
|
115
|
+
value: repeatName,
|
|
116
|
+
onChange: (e) => {
|
|
117
|
+
setRepeatName(e.target.value);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
) : null
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 View_exports = {};
|
|
20
|
+
__export(View_exports, {
|
|
21
|
+
default: () => View
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(View_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_ai = require("react-icons/ai");
|
|
27
|
+
function View({
|
|
28
|
+
className,
|
|
29
|
+
model,
|
|
30
|
+
modelLoading = true,
|
|
31
|
+
render,
|
|
32
|
+
loadingWrapper,
|
|
33
|
+
loading,
|
|
34
|
+
empty
|
|
35
|
+
}) {
|
|
36
|
+
const RenderLoadingWrapper = (0, import_react.useMemo)(
|
|
37
|
+
() => loadingWrapper === null ? ({ children, className: className2 }) => children : loadingWrapper ?? (({ children, className: className2 }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
38
|
+
children,
|
|
39
|
+
modelLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 animate-pulse" }) : null
|
|
40
|
+
] })),
|
|
41
|
+
[modelLoading]
|
|
42
|
+
);
|
|
43
|
+
const RenderModel = (0, import_react.useMemo)(
|
|
44
|
+
() => modelLoading ? loading === null ? () => null : loading ?? (() => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex size-full flex-col items-center justify-center gap-3 pt-6 pb-3", children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "loading loading-dots loading-lg" }),
|
|
46
|
+
"Loading"
|
|
47
|
+
] })) : model ? () => render(model) : empty === null ? () => null : empty ?? (() => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-full flex-col items-center justify-center gap-3 pt-6 pb-3", children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineMeh, { className: "scale-150 text-4xl" }),
|
|
49
|
+
" Empty"
|
|
50
|
+
] })),
|
|
51
|
+
[model, modelLoading]
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RenderLoadingWrapper, { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RenderModel, {}) });
|
|
54
|
+
}
|