@solidxai/core-ui 0.1.13 → 0.1.14-beta.0
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/dist/components/common/SolidPopupContainer.d.ts.map +1 -1
- package/dist/components/common/SolidPopupContainer.js +68 -5
- package/dist/components/common/SolidPopupContainer.js.map +1 -1
- package/dist/components/common/SolidPopupContainer.tsx +50 -4
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +3 -1
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.d.ts +2 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.js +4 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.ts +3 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.d.ts +8 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.js +9 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.js.map +1 -0
- package/dist/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.ts +17 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +52 -22
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +49 -9
- package/dist/components/core/kanban/SolidKanbanViewConfigure.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +3 -1
- package/dist/components/core/list/SolidCustomListViewColumn.d.ts +2 -1
- package/dist/components/core/list/SolidCustomListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidCustomListViewColumn.js +3 -2
- package/dist/components/core/list/SolidCustomListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidCustomListViewColumn.tsx +4 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +75 -71
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +25 -10
- package/dist/components/core/list/SolidListViewColumn.d.ts +3 -1
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +81 -42
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +93 -44
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +2 -2
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +4 -2
- package/dist/components/core/list/widgets/PillWidget.d.ts +3 -0
- package/dist/components/core/list/widgets/PillWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/PillWidget.js +95 -0
- package/dist/components/core/list/widgets/PillWidget.js.map +1 -0
- package/dist/components/core/list/widgets/PillWidget.tsx +127 -0
- package/dist/components/shad-cn-ui/SolidDialog.js +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDialog.tsx +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.d.ts +3 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.js +2 -2
- package/dist/components/shad-cn-ui/SolidDropdownMenu.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDropdownMenu.tsx +11 -5
- package/dist/components/shad-cn-ui/SolidIcon.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidIcon.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.js +2 -1
- package/dist/components/shad-cn-ui/SolidIcon.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidIcon.tsx +2 -0
- package/dist/components/workflow/WorkflowFlowCanvas.css +454 -0
- package/dist/components/workflow/WorkflowFlowCanvas.d.ts +40 -0
- package/dist/components/workflow/WorkflowFlowCanvas.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowFlowCanvas.js +861 -0
- package/dist/components/workflow/WorkflowFlowCanvas.js.map +1 -0
- package/dist/components/workflow/WorkflowFlowCanvas.tsx +1522 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.css +247 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.d.ts +22 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.js +97 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.js.map +1 -0
- package/dist/components/workflow/WorkflowNodeDocsPanel.tsx +363 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.css +802 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts +72 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.js +1107 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.js.map +1 -0
- package/dist/components/workflow/WorkflowNodeSchemaEditor.tsx +2347 -0
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +7 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +37 -0
- package/dist/redux/api/workflowDefinitionEditorApi.d.ts +17 -0
- package/dist/redux/api/workflowDefinitionEditorApi.d.ts.map +1 -0
- package/dist/redux/api/workflowDefinitionEditorApi.js +38 -0
- package/dist/redux/api/workflowDefinitionEditorApi.js.map +1 -0
- package/dist/redux/api/workflowDefinitionEditorApi.ts +40 -0
- package/dist/redux/api/workflowNodeApi.d.ts +6 -0
- package/dist/redux/api/workflowNodeApi.d.ts.map +1 -0
- package/dist/redux/api/workflowNodeApi.js +14 -0
- package/dist/redux/api/workflowNodeApi.js.map +1 -0
- package/dist/redux/api/workflowNodeApi.ts +18 -0
- package/dist/redux/features/popupSlice.d.ts +17 -2
- package/dist/redux/features/popupSlice.d.ts.map +1 -1
- package/dist/redux/features/popupSlice.js.map +1 -1
- package/dist/redux/features/popupSlice.ts +19 -3
- package/dist/redux/store/defaultStoreConfig.d.ts +13 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/defaultStoreConfig.js +4 -0
- package/dist/redux/store/defaultStoreConfig.js.map +1 -1
- package/dist/redux/store/defaultStoreConfig.ts +4 -0
- package/dist/redux/store/solidEntityApiPool.d.ts.map +1 -1
- package/dist/redux/store/solidEntityApiPool.js +1 -0
- package/dist/redux/store/solidEntityApiPool.js.map +1 -1
- package/dist/redux/store/solidEntityApiPool.ts +1 -0
- package/dist/resources/solid-custom.css +16 -0
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.css +3194 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js +3371 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.tsx +6215 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.css +217 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.js +268 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.js.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowDefinitionListPage.tsx +510 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.js +618 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.js.map +1 -0
- package/dist/routes/pages/admin/core/WorkflowExecutionDetailPage.tsx +1322 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +6 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +6 -0
- package/dist/types/extension-registry.d.ts +4 -0
- package/dist/types/extension-registry.d.ts.map +1 -1
- package/dist/types/extension-registry.js +5 -1
- package/dist/types/extension-registry.js.map +1 -1
- package/dist/types/extension-registry.ts +5 -1
- package/dist/types/solid-core.d.ts +32 -0
- package/dist/types/workflow-node.d.ts +142 -0
- package/dist/types/workflow-node.d.ts.map +1 -0
- package/dist/types/workflow-node.js +2 -0
- package/dist/types/workflow-node.js.map +1 -0
- package/dist/types/workflow-node.ts +179 -0
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPopupContainer.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidPopupContainer.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"SolidPopupContainer.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidPopupContainer.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,mBAAmB,sDAyExB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -9,13 +9,50 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
49
|
import { useSelector, useDispatch } from "react-redux";
|
|
14
50
|
import { closePopup } from "../../redux/features/popupSlice";
|
|
15
|
-
import { getExtensionComponent } from "../../helpers/registry";
|
|
16
|
-
import { SolidDialog } from "../shad-cn-ui";
|
|
51
|
+
import { getExtensionComponent, getExtensionFunction } from "../../helpers/registry";
|
|
52
|
+
import { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogFooter, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle } from "../shad-cn-ui";
|
|
17
53
|
var SolidPopupContainer = function () {
|
|
18
|
-
var _a
|
|
54
|
+
var _a, _b;
|
|
55
|
+
var _c = useSelector(function (state) { return state.popup; }), isOpen = _c.isOpen, event = _c.event;
|
|
19
56
|
var dispatch = useDispatch();
|
|
20
57
|
var handleClose = function () { return dispatch(closePopup()); };
|
|
21
58
|
var isClosable = Boolean(event === null || event === void 0 ? void 0 : event.closable);
|
|
@@ -23,10 +60,36 @@ var SolidPopupContainer = function () {
|
|
|
23
60
|
return null;
|
|
24
61
|
var DynamicComponent = getExtensionComponent(event === null || event === void 0 ? void 0 : event.action);
|
|
25
62
|
var popupWidth = (event === null || event === void 0 ? void 0 : event.popupWidth) ? event.popupWidth : "50vw";
|
|
63
|
+
var popupBody = (_a = event === null || event === void 0 ? void 0 : event.body) !== null && _a !== void 0 ? _a : event === null || event === void 0 ? void 0 : event.message;
|
|
64
|
+
var handleButtonClick = function (button) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
+
var actionFn;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
if (!(typeof button.action === "function")) return [3 /*break*/, 2];
|
|
70
|
+
return [4 /*yield*/, button.action(event, handleClose)];
|
|
71
|
+
case 1:
|
|
72
|
+
_a.sent();
|
|
73
|
+
return [3 /*break*/, 4];
|
|
74
|
+
case 2:
|
|
75
|
+
if (!(typeof button.action === "string")) return [3 /*break*/, 4];
|
|
76
|
+
actionFn = getExtensionFunction(button.action);
|
|
77
|
+
return [4 /*yield*/, (actionFn === null || actionFn === void 0 ? void 0 : actionFn(__assign(__assign({}, event), { button: button, closePopup: handleClose })))];
|
|
78
|
+
case 3:
|
|
79
|
+
_a.sent();
|
|
80
|
+
_a.label = 4;
|
|
81
|
+
case 4:
|
|
82
|
+
if (button.closeOnClick !== false) {
|
|
83
|
+
handleClose();
|
|
84
|
+
}
|
|
85
|
+
return [2 /*return*/];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}); };
|
|
26
89
|
return (_jsx(SolidDialog, { open: isOpen, onOpenChange: function (open) {
|
|
27
90
|
if (!open && isClosable)
|
|
28
91
|
handleClose();
|
|
29
|
-
}, dismissible: isClosable, showHeader: false, className: "solid-popup-dialog solid-common-dialog", overlayClassName: "solid-popup-backdrop", style: { width: popupWidth }, children: DynamicComponent
|
|
92
|
+
}, dismissible: isClosable, showHeader: false, className: "solid-popup-dialog solid-common-dialog", overlayClassName: "solid-popup-backdrop", style: { width: popupWidth }, children: DynamicComponent ? (_jsx(DynamicComponent, __assign({}, event))) : (_jsxs(_Fragment, { children: [(event === null || event === void 0 ? void 0 : event.title) ? (_jsxs(_Fragment, { children: [_jsxs(SolidDialogHeader, { children: [_jsx(SolidDialogTitle, { children: event.title }), isClosable ? _jsx(SolidDialogClose, {}) : null] }), _jsx(SolidDialogSeparator, {})] })) : null, popupBody ? _jsx(SolidDialogBody, { children: popupBody }) : null, ((_b = event === null || event === void 0 ? void 0 : event.buttons) === null || _b === void 0 ? void 0 : _b.length) ? (_jsx(SolidDialogFooter, { children: event.buttons.map(function (button, index) { return (_jsx(SolidButton, { type: "button", size: "sm", variant: button.variant, className: button.className, icon: button.icon, onClick: function () { return handleButtonClick(button); }, children: button.label }, "".concat(button.label, "-").concat(index))); }) })) : null] })) }));
|
|
30
93
|
};
|
|
31
94
|
export default SolidPopupContainer;
|
|
32
95
|
//# sourceMappingURL=SolidPopupContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPopupContainer.js","sourceRoot":"","sources":["../../../src/components/common/SolidPopupContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidPopupContainer.js","sourceRoot":"","sources":["../../../src/components/common/SolidPopupContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAe,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,E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AC,GAAG,CAAC,UAAC,MAAmB,EAAE,KAAa,IAAK,OAAA,CACzD,KAAC,WAAW,IAEV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,MAAM,CAAC,OAAc,EAC9B,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,OAAO,EAAE,cAAM,OAAA,iBAAiB,CAAC,MAAM,CAAC,EAAzB,CAAyB,YAEvC,MAAM,CAAC,KAAK,IARR,UAAG,MAAM,CAAC,KAAK,cAAI,KAAK,CAAE,CASnB,CACf,EAZ0D,CAY1D,CAAC,GACgB,CACrB,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,GACW,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useSelector, useDispatch } from \"react-redux\";\nimport { RootState } from \"../../types/solid-core\";\nimport { closePopup, PopupButton } from \"../../redux/features/popupSlice\";\nimport { getExtensionComponent, getExtensionFunction } from \"../../helpers/registry\";\nimport { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogFooter, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle } from \"../shad-cn-ui\";\n\nconst SolidPopupContainer = () => {\n const { isOpen, event } = useSelector((state: RootState) => state.popup);\n const dispatch = useDispatch();\n\n const handleClose = () => dispatch(closePopup());\n const isClosable = Boolean(event?.closable);\n\n if (!isOpen) return null;\n\n const DynamicComponent = getExtensionComponent(event?.action);\n const popupWidth = event?.popupWidth ? event.popupWidth : \"50vw\";\n const popupBody = event?.body ?? event?.message;\n\n const handleButtonClick = async (button: PopupButton) => {\n if (typeof button.action === \"function\") {\n await button.action(event, handleClose);\n } else if (typeof button.action === \"string\") {\n const actionFn = getExtensionFunction(button.action);\n await actionFn?.({ ...event, button, closePopup: handleClose });\n }\n\n if (button.closeOnClick !== false) {\n handleClose();\n }\n };\n\n return (\n <SolidDialog\n open={isOpen}\n onOpenChange={(open) => {\n if (!open && isClosable) handleClose();\n }}\n dismissible={isClosable}\n showHeader={false}\n className=\"solid-popup-dialog solid-common-dialog\"\n overlayClassName=\"solid-popup-backdrop\"\n style={{ width: popupWidth }}\n >\n {DynamicComponent ? (\n <DynamicComponent {...event} />\n ) : (\n <>\n {event?.title ? (\n <>\n <SolidDialogHeader>\n <SolidDialogTitle>{event.title}</SolidDialogTitle>\n {isClosable ? <SolidDialogClose /> : null}\n </SolidDialogHeader>\n <SolidDialogSeparator />\n </>\n ) : null}\n {popupBody ? <SolidDialogBody>{popupBody}</SolidDialogBody> : null}\n {event?.buttons?.length ? (\n <SolidDialogFooter>\n {event.buttons.map((button: PopupButton, index: number) => (\n <SolidButton\n key={`${button.label}-${index}`}\n type=\"button\"\n size=\"sm\"\n variant={button.variant as any}\n className={button.className}\n icon={button.icon}\n onClick={() => handleButtonClick(button)}\n >\n {button.label}\n </SolidButton>\n ))}\n </SolidDialogFooter>\n ) : null}\n </>\n )}\n </SolidDialog>\n );\n};\n\nexport default SolidPopupContainer;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useSelector, useDispatch } from "react-redux";
|
|
2
2
|
import { RootState } from "../../types/solid-core";
|
|
3
|
-
import { closePopup } from "../../redux/features/popupSlice";
|
|
4
|
-
import { getExtensionComponent } from "../../helpers/registry";
|
|
5
|
-
import { SolidDialog } from "../shad-cn-ui";
|
|
3
|
+
import { closePopup, PopupButton } from "../../redux/features/popupSlice";
|
|
4
|
+
import { getExtensionComponent, getExtensionFunction } from "../../helpers/registry";
|
|
5
|
+
import { SolidButton, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogFooter, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle } from "../shad-cn-ui";
|
|
6
6
|
|
|
7
7
|
const SolidPopupContainer = () => {
|
|
8
8
|
const { isOpen, event } = useSelector((state: RootState) => state.popup);
|
|
@@ -15,6 +15,20 @@ const SolidPopupContainer = () => {
|
|
|
15
15
|
|
|
16
16
|
const DynamicComponent = getExtensionComponent(event?.action);
|
|
17
17
|
const popupWidth = event?.popupWidth ? event.popupWidth : "50vw";
|
|
18
|
+
const popupBody = event?.body ?? event?.message;
|
|
19
|
+
|
|
20
|
+
const handleButtonClick = async (button: PopupButton) => {
|
|
21
|
+
if (typeof button.action === "function") {
|
|
22
|
+
await button.action(event, handleClose);
|
|
23
|
+
} else if (typeof button.action === "string") {
|
|
24
|
+
const actionFn = getExtensionFunction(button.action);
|
|
25
|
+
await actionFn?.({ ...event, button, closePopup: handleClose });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (button.closeOnClick !== false) {
|
|
29
|
+
handleClose();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
18
32
|
|
|
19
33
|
return (
|
|
20
34
|
<SolidDialog
|
|
@@ -28,7 +42,39 @@ const SolidPopupContainer = () => {
|
|
|
28
42
|
overlayClassName="solid-popup-backdrop"
|
|
29
43
|
style={{ width: popupWidth }}
|
|
30
44
|
>
|
|
31
|
-
{DynamicComponent
|
|
45
|
+
{DynamicComponent ? (
|
|
46
|
+
<DynamicComponent {...event} />
|
|
47
|
+
) : (
|
|
48
|
+
<>
|
|
49
|
+
{event?.title ? (
|
|
50
|
+
<>
|
|
51
|
+
<SolidDialogHeader>
|
|
52
|
+
<SolidDialogTitle>{event.title}</SolidDialogTitle>
|
|
53
|
+
{isClosable ? <SolidDialogClose /> : null}
|
|
54
|
+
</SolidDialogHeader>
|
|
55
|
+
<SolidDialogSeparator />
|
|
56
|
+
</>
|
|
57
|
+
) : null}
|
|
58
|
+
{popupBody ? <SolidDialogBody>{popupBody}</SolidDialogBody> : null}
|
|
59
|
+
{event?.buttons?.length ? (
|
|
60
|
+
<SolidDialogFooter>
|
|
61
|
+
{event.buttons.map((button: PopupButton, index: number) => (
|
|
62
|
+
<SolidButton
|
|
63
|
+
key={`${button.label}-${index}`}
|
|
64
|
+
type="button"
|
|
65
|
+
size="sm"
|
|
66
|
+
variant={button.variant as any}
|
|
67
|
+
className={button.className}
|
|
68
|
+
icon={button.icon}
|
|
69
|
+
onClick={() => handleButtonClick(button)}
|
|
70
|
+
>
|
|
71
|
+
{button.label}
|
|
72
|
+
</SolidButton>
|
|
73
|
+
))}
|
|
74
|
+
</SolidDialogFooter>
|
|
75
|
+
) : null}
|
|
76
|
+
</>
|
|
77
|
+
)}
|
|
32
78
|
</SolidDialog>
|
|
33
79
|
);
|
|
34
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidCardViewConfigure.d.ts","sourceRoot":"","sources":["../../../../src/components/core/card/SolidCardViewConfigure.tsx"],"names":[],"mappings":"AAuDA,eAAO,MAAM,sBAAsB,gLAWhC,GAAG,
|
|
1
|
+
{"version":3,"file":"SolidCardViewConfigure.d.ts","sourceRoot":"","sources":["../../../../src/components/core/card/SolidCardViewConfigure.tsx"],"names":[],"mappings":"AAuDA,eAAO,MAAM,sBAAsB,gLAWhC,GAAG,4CAyNL,CAAC"}
|
|
@@ -109,7 +109,7 @@ export var SolidCardViewConfigure = function (_a) {
|
|
|
109
109
|
}, children: [_jsx(SolidIcon, { name: "si-download", className: "solid-header-action-button-icon", "aria-hidden": true }), _jsx("span", { className: "solid-header-action-button-label", children: "Import" })] })), canExport && (_jsxs(SolidDropdownMenuItem, { className: "solid-header-dropdown-item", onSelect: function () {
|
|
110
110
|
setExportView(true);
|
|
111
111
|
setIsCogMenuOpen(false);
|
|
112
|
-
}, children: [_jsx(SolidIcon, { name: "si-upload", className: "solid-header-action-button-icon", "aria-hidden": true }), _jsx("span", { className: "solid-header-action-button-label", children: "Export" })] })), canShowArchivedRecords && (_jsx(SolidDropdownMenuCheckboxItem, { checked: showArchived, onCheckedChange: function () { return setShowArchived(!showArchived); }, children: "Show Archived
|
|
112
|
+
}, children: [_jsx(SolidIcon, { name: "si-upload", className: "solid-header-action-button-icon", "aria-hidden": true }), _jsx("span", { className: "solid-header-action-button-label", children: "Export" })] })), canShowArchivedRecords && (_jsx(SolidDropdownMenuCheckboxItem, { className: showArchived ? "solid-archive-toggle-item-active" : undefined, checked: showArchived, icon: _jsx(SolidIcon, { name: "si-archive", className: "solid-header-action-button-icon solid-archive-toggle-icon", "aria-hidden": true }), onCheckedChange: function () { return setShowArchived(!showArchived); }, children: "Show Archived Rows" })), (canCustomizeLayout || canSaveCustomFilter || canShowArchivedRecords) && _jsx(SolidDropdownMenuSeparator, {}), canCustomizeLayout && (_jsxs(SolidDropdownMenuSub, { children: [_jsxs(SolidDropdownMenuSubTrigger, { className: "solid-header-dropdown-item", children: [_jsx(SolidIcon, { name: "si-sliders-h", className: "solid-header-action-button-icon", "aria-hidden": true }), _jsx("span", { className: "solid-header-action-button-label", children: "Layout" })] }), _jsxs(SolidDropdownMenuSubContent, { className: "customize-layout-panel", children: [showSwitchType && (_jsxs(_Fragment, { children: [_jsx(SolidDropdownMenuLabel, { children: "Switch Type" }), _jsx(SolidDropdownMenuRadioGroup, { value: view, onValueChange: handleViewChange, children: visibleViewModes.map(function (option) { return (_jsx(SolidDropdownMenuRadioItem, { value: option.type, children: option.label }, option.type)); }) }), _jsx(SolidDropdownMenuSeparator, {})] })), _jsxs(SolidDropdownMenuItem, { onSelect: function () {
|
|
113
113
|
setLayoutDialogVisible(true);
|
|
114
114
|
setIsCogMenuOpen(false);
|
|
115
115
|
}, children: [_jsx(SolidIcon, { name: "si-code", className: "solid-header-action-button-icon", "aria-hidden": true }), _jsx("span", { className: "solid-header-action-button-label", children: "Layout Editor" })] })] })] })), canSaveCustomFilter && (_jsxs(SolidDropdownMenuItem, { className: "solid-header-dropdown-item", onSelect: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidCardViewConfigure.js","sourceRoot":"","sources":["../../../../src/components/core/card/SolidCardViewConfigure.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACxG,OAAO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EAAE,iBAAiB,GAC5C,CACH,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { canExportRecords, canImportRecords, permissionExpression } from \"../../../helpers/permissions\";\nimport { usePathname } from \"../../../hooks/usePathname\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { useSearchParams } from \"../../../hooks/useSearchParams\";\nimport { storeCurrentModelViewContext } from \"../../../helpers/modelViewPersistence\";\nimport { useEffect, useState } from \"react\";\nimport { SolidExport } from \"../../../components/common/SolidExport\";\nimport { SolidGenericImport } from \"../common/SolidGenericImport/SolidGenericImport\";\nimport {\n SolidDialog,\n SolidDialogBody,\n SolidDialogClose,\n SolidDialogDescription,\n SolidDialogHeader,\n SolidDialogSeparator,\n SolidDialogTitle,\n SolidDropdownMenu,\n SolidDropdownMenuCheckboxItem,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuLabel,\n SolidDropdownMenuRadioGroup,\n SolidDropdownMenuRadioItem,\n SolidDropdownMenuSeparator,\n SolidDropdownMenuSub,\n SolidDropdownMenuSubContent,\n SolidDropdownMenuSubTrigger,\n SolidDropdownMenuTrigger,\n SolidIcon,\n} from \"../../shad-cn-ui\";\n\nconst normalizeViewModes = (viewModes: any[] = []) => {\n return viewModes\n .map((option: any) => {\n if (!option) return null;\n\n if (typeof option === \"string\") {\n return {\n type: option,\n label: option.charAt(0).toUpperCase() + option.slice(1),\n };\n }\n\n const type = option.type || option.value;\n if (!type) return null;\n\n return {\n ...option,\n type,\n label: option.label || (type.charAt(0).toUpperCase() + type.slice(1)),\n };\n })\n .filter(Boolean);\n};\n\nexport const SolidCardViewConfigure = ({\n solidCardViewMetaData,\n modelName,\n actionsAllowed,\n viewModes,\n setShowArchived,\n showArchived,\n setLayoutDialogVisible,\n setShowSaveFilterPopup,\n filters,\n handleRefreshView,\n}: any) => {\n const pathname = usePathname();\n const router = useRouter();\n const searchParams = useSearchParams();\n const [view, setView] = useState<string>(\"\");\n const [isCogMenuOpen, setIsCogMenuOpen] = useState(false);\n const [openImportDialog, setOpenImportDialog] = useState(false);\n const [exportView, setExportView] = useState(false);\n\n const visibleViewModes = normalizeViewModes(Array.isArray(viewModes) ? viewModes : []);\n const showSwitchType = visibleViewModes.length > 1;\n\n useEffect(() => {\n if (typeof pathname === \"string\") {\n const pathSegments = pathname.split(\"/\").filter(Boolean);\n if (pathSegments.length > 0) {\n setView(pathSegments[pathSegments.length - 1]);\n }\n }\n }, [pathname]);\n\n const handleViewChange = (newViewType: string) => {\n if (view === newViewType) return;\n\n const nextView = visibleViewModes.find((option: any) => option.type === newViewType);\n const pathSegments = pathname.split(\"/\").filter(Boolean);\n pathSegments[pathSegments.length - 1] = newViewType;\n const nextSearchParams = new URLSearchParams(searchParams.toString());\n const currentQuery = {\n menuItemId: searchParams.get(\"menuItemId\"),\n menuItemName: searchParams.get(\"menuItemName\"),\n actionId: searchParams.get(\"actionId\"),\n actionName: searchParams.get(\"actionName\"),\n };\n\n const queryFields = {\n menuItemId: nextView?.menuItemId ?? currentQuery.menuItemId,\n menuItemName: nextView?.menuItemName ?? currentQuery.menuItemName,\n actionId: nextView?.actionId ?? currentQuery.actionId,\n actionName: nextView?.actionName ?? currentQuery.actionName,\n };\n\n Object.entries(queryFields).forEach(([key, value]) => {\n if (value) {\n nextSearchParams.set(key, value);\n } else {\n nextSearchParams.delete(key);\n }\n });\n\n const newPath = \"/\" + pathSegments.join(\"/\");\n const nextQueryString = nextSearchParams.toString();\n const nextUrl = nextQueryString ? `${newPath}?${nextQueryString}` : newPath;\n storeCurrentModelViewContext(nextUrl);\n router.push(nextUrl);\n };\n\n const clearLocalstorageCache = () => {\n const currentPageUrl = window.location.pathname;\n localStorage.removeItem(currentPageUrl);\n window.location.reload();\n };\n\n const canImport = canImportRecords(actionsAllowed, modelName);\n\n const canExport = canExportRecords(actionsAllowed, modelName);\n\n const canCustomizeLayout = actionsAllowed.includes(`${permissionExpression(\"userViewMetadata\", \"create\")}`);\n const canSaveCustomFilter = actionsAllowed.includes(`${permissionExpression(\"savedFilters\", \"create\")}`);\n const canShowArchivedRecords = Boolean(solidCardViewMetaData?.data?.solidView?.model?.enableSoftDelete);\n\n return (\n <div className=\"position-relative\">\n <SolidDropdownMenu open={isCogMenuOpen} onOpenChange={setIsCogMenuOpen}>\n <SolidDropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"solid-icon-button solid-header-cog-trigger\"\n aria-label=\"Open card options\"\n >\n <SolidIcon name=\"si-cog\" aria-hidden />\n </button>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent className=\"listview-cogwheel-panel\">\n {canImport && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setOpenImportDialog(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-download\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Import</span>\n </SolidDropdownMenuItem>\n )}\n\n {canExport && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setExportView(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-upload\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Export</span>\n </SolidDropdownMenuItem>\n )}\n\n {canShowArchivedRecords && (\n <SolidDropdownMenuCheckboxItem\n checked={showArchived}\n onCheckedChange={() => setShowArchived(!showArchived)}\n >\n Show Archived Records\n </SolidDropdownMenuCheckboxItem>\n )}\n\n {(canCustomizeLayout || canSaveCustomFilter || canShowArchivedRecords) && <SolidDropdownMenuSeparator />}\n\n {canCustomizeLayout && (\n <SolidDropdownMenuSub>\n <SolidDropdownMenuSubTrigger className=\"solid-header-dropdown-item\">\n <SolidIcon name=\"si-sliders-h\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Layout</span>\n </SolidDropdownMenuSubTrigger>\n <SolidDropdownMenuSubContent className=\"customize-layout-panel\">\n {showSwitchType && (\n <>\n <SolidDropdownMenuLabel>Switch Type</SolidDropdownMenuLabel>\n <SolidDropdownMenuRadioGroup value={view} onValueChange={handleViewChange}>\n {visibleViewModes.map((option: any) => (\n <SolidDropdownMenuRadioItem key={option.type} value={option.type}>\n {option.label}\n </SolidDropdownMenuRadioItem>\n ))}\n </SolidDropdownMenuRadioGroup>\n <SolidDropdownMenuSeparator />\n </>\n )}\n <SolidDropdownMenuItem\n onSelect={() => {\n setLayoutDialogVisible(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-code\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Layout Editor</span>\n </SolidDropdownMenuItem>\n </SolidDropdownMenuSubContent>\n </SolidDropdownMenuSub>\n )}\n\n {canSaveCustomFilter && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setShowSaveFilterPopup(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-save\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Save Custom Filter</span>\n </SolidDropdownMenuItem>\n )}\n\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n clearLocalstorageCache();\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-trash\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Clear cache</span>\n </SolidDropdownMenuItem>\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n\n <SolidDialog\n open={exportView}\n onOpenChange={setExportView}\n className=\"solid-kanban-export-dialog\"\n style={{ width: \"min(960px, calc(100vw - 32px))\" }}\n >\n <SolidDialogHeader className=\"solid-export-dialog-header\">\n <div>\n <SolidDialogTitle>Export</SolidDialogTitle>\n <SolidDialogDescription className=\"solid-filter-dialog-subtitle m-0\">\n Choose the file format, refine the field set, and save reusable export templates.\n </SolidDialogDescription>\n </div>\n <SolidDialogClose />\n </SolidDialogHeader>\n <SolidDialogSeparator />\n <SolidDialogBody className=\"solid-kanban-export-dialog-body\">\n <SolidExport\n listViewMetaData={solidCardViewMetaData}\n filters={filters}\n onExportComplete={() => setExportView(false)}\n />\n </SolidDialogBody>\n </SolidDialog>\n\n {openImportDialog && (\n <SolidGenericImport\n openImportDialog={openImportDialog}\n setOpenImportDialog={setOpenImportDialog}\n listViewMetaData={solidCardViewMetaData}\n handleFetchUpdatedRecords={handleRefreshView}\n />\n )}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SolidCardViewConfigure.js","sourceRoot":"","sources":["../../../../src/components/core/card/SolidCardViewConfigure.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAE1B,IAAM,k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ACC,IACT,EAEpB,MAAC,WAAW,IACV,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,aAAa,EAC3B,SAAS,EAAC,4BAA4B,EACtC,KAAK,EAAE,EAAE,KAAK,EAAE,gCAAgC,EAAE,aAElD,MAAC,iBAAiB,IAAC,SAAS,EAAC,4BAA4B,aACvD,0BACE,KAAC,gBAAgB,yBAA0B,EAC3C,KAAC,sBAAsB,IAAC,SAAS,EAAC,kCAAkC,kGAE3C,IACrB,EACN,KAAC,gBAAgB,KAAG,IACF,EACpB,KAAC,oBAAoB,KAAG,EACxB,KAAC,eAAe,IAAC,SAAS,EAAC,iCAAiC,YAC1D,KAAC,WAAW,IACV,gBAAgB,EAAE,qBAAqB,EACvC,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,cAAM,OAAA,aAAa,CAAC,KAAK,CAAC,EAApB,CAAoB,GAC5C,GACc,IACN,EAEb,gBAAgB,IAAI,CACnB,KAAC,kBAAkB,IACjB,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,qBAAqB,EACvC,yBAAyB,EAAE,iBAAiB,GAC5C,CACH,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { canExportRecords, canImportRecords, permissionExpression } from \"../../../helpers/permissions\";\nimport { usePathname } from \"../../../hooks/usePathname\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { useSearchParams } from \"../../../hooks/useSearchParams\";\nimport { storeCurrentModelViewContext } from \"../../../helpers/modelViewPersistence\";\nimport { useEffect, useState } from \"react\";\nimport { SolidExport } from \"../../../components/common/SolidExport\";\nimport { SolidGenericImport } from \"../common/SolidGenericImport/SolidGenericImport\";\nimport {\n SolidDialog,\n SolidDialogBody,\n SolidDialogClose,\n SolidDialogDescription,\n SolidDialogHeader,\n SolidDialogSeparator,\n SolidDialogTitle,\n SolidDropdownMenu,\n SolidDropdownMenuCheckboxItem,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuLabel,\n SolidDropdownMenuRadioGroup,\n SolidDropdownMenuRadioItem,\n SolidDropdownMenuSeparator,\n SolidDropdownMenuSub,\n SolidDropdownMenuSubContent,\n SolidDropdownMenuSubTrigger,\n SolidDropdownMenuTrigger,\n SolidIcon,\n} from \"../../shad-cn-ui\";\n\nconst normalizeViewModes = (viewModes: any[] = []) => {\n return viewModes\n .map((option: any) => {\n if (!option) return null;\n\n if (typeof option === \"string\") {\n return {\n type: option,\n label: option.charAt(0).toUpperCase() + option.slice(1),\n };\n }\n\n const type = option.type || option.value;\n if (!type) return null;\n\n return {\n ...option,\n type,\n label: option.label || (type.charAt(0).toUpperCase() + type.slice(1)),\n };\n })\n .filter(Boolean);\n};\n\nexport const SolidCardViewConfigure = ({\n solidCardViewMetaData,\n modelName,\n actionsAllowed,\n viewModes,\n setShowArchived,\n showArchived,\n setLayoutDialogVisible,\n setShowSaveFilterPopup,\n filters,\n handleRefreshView,\n}: any) => {\n const pathname = usePathname();\n const router = useRouter();\n const searchParams = useSearchParams();\n const [view, setView] = useState<string>(\"\");\n const [isCogMenuOpen, setIsCogMenuOpen] = useState(false);\n const [openImportDialog, setOpenImportDialog] = useState(false);\n const [exportView, setExportView] = useState(false);\n\n const visibleViewModes = normalizeViewModes(Array.isArray(viewModes) ? viewModes : []);\n const showSwitchType = visibleViewModes.length > 1;\n\n useEffect(() => {\n if (typeof pathname === \"string\") {\n const pathSegments = pathname.split(\"/\").filter(Boolean);\n if (pathSegments.length > 0) {\n setView(pathSegments[pathSegments.length - 1]);\n }\n }\n }, [pathname]);\n\n const handleViewChange = (newViewType: string) => {\n if (view === newViewType) return;\n\n const nextView = visibleViewModes.find((option: any) => option.type === newViewType);\n const pathSegments = pathname.split(\"/\").filter(Boolean);\n pathSegments[pathSegments.length - 1] = newViewType;\n const nextSearchParams = new URLSearchParams(searchParams.toString());\n const currentQuery = {\n menuItemId: searchParams.get(\"menuItemId\"),\n menuItemName: searchParams.get(\"menuItemName\"),\n actionId: searchParams.get(\"actionId\"),\n actionName: searchParams.get(\"actionName\"),\n };\n\n const queryFields = {\n menuItemId: nextView?.menuItemId ?? currentQuery.menuItemId,\n menuItemName: nextView?.menuItemName ?? currentQuery.menuItemName,\n actionId: nextView?.actionId ?? currentQuery.actionId,\n actionName: nextView?.actionName ?? currentQuery.actionName,\n };\n\n Object.entries(queryFields).forEach(([key, value]) => {\n if (value) {\n nextSearchParams.set(key, value);\n } else {\n nextSearchParams.delete(key);\n }\n });\n\n const newPath = \"/\" + pathSegments.join(\"/\");\n const nextQueryString = nextSearchParams.toString();\n const nextUrl = nextQueryString ? `${newPath}?${nextQueryString}` : newPath;\n storeCurrentModelViewContext(nextUrl);\n router.push(nextUrl);\n };\n\n const clearLocalstorageCache = () => {\n const currentPageUrl = window.location.pathname;\n localStorage.removeItem(currentPageUrl);\n window.location.reload();\n };\n\n const canImport = canImportRecords(actionsAllowed, modelName);\n\n const canExport = canExportRecords(actionsAllowed, modelName);\n\n const canCustomizeLayout = actionsAllowed.includes(`${permissionExpression(\"userViewMetadata\", \"create\")}`);\n const canSaveCustomFilter = actionsAllowed.includes(`${permissionExpression(\"savedFilters\", \"create\")}`);\n const canShowArchivedRecords = Boolean(solidCardViewMetaData?.data?.solidView?.model?.enableSoftDelete);\n\n return (\n <div className=\"position-relative\">\n <SolidDropdownMenu open={isCogMenuOpen} onOpenChange={setIsCogMenuOpen}>\n <SolidDropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"solid-icon-button solid-header-cog-trigger\"\n aria-label=\"Open card options\"\n >\n <SolidIcon name=\"si-cog\" aria-hidden />\n </button>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent className=\"listview-cogwheel-panel\">\n {canImport && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setOpenImportDialog(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-download\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Import</span>\n </SolidDropdownMenuItem>\n )}\n\n {canExport && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setExportView(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-upload\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Export</span>\n </SolidDropdownMenuItem>\n )}\n\n {canShowArchivedRecords && (\n <SolidDropdownMenuCheckboxItem\n className={showArchived ? \"solid-archive-toggle-item-active\" : undefined}\n checked={showArchived}\n icon={<SolidIcon name=\"si-archive\" className=\"solid-header-action-button-icon solid-archive-toggle-icon\" aria-hidden />}\n onCheckedChange={() => setShowArchived(!showArchived)}\n >\n Show Archived Rows\n </SolidDropdownMenuCheckboxItem>\n )}\n\n {(canCustomizeLayout || canSaveCustomFilter || canShowArchivedRecords) && <SolidDropdownMenuSeparator />}\n\n {canCustomizeLayout && (\n <SolidDropdownMenuSub>\n <SolidDropdownMenuSubTrigger className=\"solid-header-dropdown-item\">\n <SolidIcon name=\"si-sliders-h\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Layout</span>\n </SolidDropdownMenuSubTrigger>\n <SolidDropdownMenuSubContent className=\"customize-layout-panel\">\n {showSwitchType && (\n <>\n <SolidDropdownMenuLabel>Switch Type</SolidDropdownMenuLabel>\n <SolidDropdownMenuRadioGroup value={view} onValueChange={handleViewChange}>\n {visibleViewModes.map((option: any) => (\n <SolidDropdownMenuRadioItem key={option.type} value={option.type}>\n {option.label}\n </SolidDropdownMenuRadioItem>\n ))}\n </SolidDropdownMenuRadioGroup>\n <SolidDropdownMenuSeparator />\n </>\n )}\n <SolidDropdownMenuItem\n onSelect={() => {\n setLayoutDialogVisible(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-code\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Layout Editor</span>\n </SolidDropdownMenuItem>\n </SolidDropdownMenuSubContent>\n </SolidDropdownMenuSub>\n )}\n\n {canSaveCustomFilter && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setShowSaveFilterPopup(true);\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-save\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Save Custom Filter</span>\n </SolidDropdownMenuItem>\n )}\n\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n clearLocalstorageCache();\n setIsCogMenuOpen(false);\n }}\n >\n <SolidIcon name=\"si-trash\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Clear cache</span>\n </SolidDropdownMenuItem>\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n\n <SolidDialog\n open={exportView}\n onOpenChange={setExportView}\n className=\"solid-kanban-export-dialog\"\n style={{ width: \"min(960px, calc(100vw - 32px))\" }}\n >\n <SolidDialogHeader className=\"solid-export-dialog-header\">\n <div>\n <SolidDialogTitle>Export</SolidDialogTitle>\n <SolidDialogDescription className=\"solid-filter-dialog-subtitle m-0\">\n Choose the file format, refine the field set, and save reusable export templates.\n </SolidDialogDescription>\n </div>\n <SolidDialogClose />\n </SolidDialogHeader>\n <SolidDialogSeparator />\n <SolidDialogBody className=\"solid-kanban-export-dialog-body\">\n <SolidExport\n listViewMetaData={solidCardViewMetaData}\n filters={filters}\n onExportComplete={() => setExportView(false)}\n />\n </SolidDialogBody>\n </SolidDialog>\n\n {openImportDialog && (\n <SolidGenericImport\n openImportDialog={openImportDialog}\n setOpenImportDialog={setOpenImportDialog}\n listViewMetaData={solidCardViewMetaData}\n handleFetchUpdatedRecords={handleRefreshView}\n />\n )}\n </div>\n );\n};\n"]}
|
|
@@ -176,10 +176,12 @@ export const SolidCardViewConfigure = ({
|
|
|
176
176
|
|
|
177
177
|
{canShowArchivedRecords && (
|
|
178
178
|
<SolidDropdownMenuCheckboxItem
|
|
179
|
+
className={showArchived ? "solid-archive-toggle-item-active" : undefined}
|
|
179
180
|
checked={showArchived}
|
|
181
|
+
icon={<SolidIcon name="si-archive" className="solid-header-action-button-icon solid-archive-toggle-icon" aria-hidden />}
|
|
180
182
|
onCheckedChange={() => setShowArchived(!showArchived)}
|
|
181
183
|
>
|
|
182
|
-
Show Archived
|
|
184
|
+
Show Archived Rows
|
|
183
185
|
</SolidDropdownMenuCheckboxItem>
|
|
184
186
|
)}
|
|
185
187
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWorkflowDefinitionEditorHeaderAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,wCAAwC,SAE/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWorkflowDefinitionEditorHeaderAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorHeaderAction.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,wCAAwC;IAC9D,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,uDAAuD,CAAC;AACjF,CAAC","sourcesContent":["export default function openWorkflowDefinitionEditorHeaderAction() {\n window.location.href = `/admin/core/solid-core/workflow-definition/editor/new`;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type WorkflowDefinitionRowActionEvent = {
|
|
2
|
+
rowData?: {
|
|
3
|
+
id?: number | string;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export default function openWorkflowDefinitionEditorRowAction(event: WorkflowDefinitionRowActionEvent): void;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=openWorkflowDefinitionEditorRowAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWorkflowDefinitionEditorRowAction.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.ts"],"names":[],"mappings":"AAAA,KAAK,gCAAgC,GAAG;IACtC,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,qCAAqC,CAC3D,KAAK,EAAE,gCAAgC,QASxC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default function openWorkflowDefinitionEditorRowAction(event) {
|
|
2
|
+
var _a;
|
|
3
|
+
var recordId = (_a = event === null || event === void 0 ? void 0 : event.rowData) === null || _a === void 0 ? void 0 : _a.id;
|
|
4
|
+
if (recordId === null || recordId === undefined || recordId === "") {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
window.location.href = "/admin/core/solid-core/workflow-definition/editor/".concat(recordId);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=openWorkflowDefinitionEditorRowAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWorkflowDefinitionEditorRowAction.js","sourceRoot":"","sources":["../../../../../../../src/components/core/extension/solid-core/workflowDefinition/list/openWorkflowDefinitionEditorRowAction.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,qCAAqC,CAC3D,KAAuC;;IAEvC,IAAM,QAAQ,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,EAAE,CAAC;IAEpC,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE,EAAE;QAClE,OAAO;KACR;IAED,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,4DAAqD,QAAQ,CAAE,CAAC;AACzF,CAAC","sourcesContent":["type WorkflowDefinitionRowActionEvent = {\n rowData?: {\n id?: number | string;\n };\n};\n\nexport default function openWorkflowDefinitionEditorRowAction(\n event: WorkflowDefinitionRowActionEvent,\n) {\n const recordId = event?.rowData?.id;\n\n if (recordId === null || recordId === undefined || recordId === \"\") {\n return;\n }\n\n window.location.href = `/admin/core/solid-core/workflow-definition/editor/${recordId}`;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type WorkflowDefinitionRowActionEvent = {
|
|
2
|
+
rowData?: {
|
|
3
|
+
id?: number | string;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default function openWorkflowDefinitionEditorRowAction(
|
|
8
|
+
event: WorkflowDefinitionRowActionEvent,
|
|
9
|
+
) {
|
|
10
|
+
const recordId = event?.rowData?.id;
|
|
11
|
+
|
|
12
|
+
if (recordId === null || recordId === undefined || recordId === "") {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
window.location.href = `/admin/core/solid-core/workflow-definition/editor/${recordId}`;
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidFormView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/form/SolidFormView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidFormView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/form/SolidFormView.tsx"],"names":[],"mappings":"AA6DA,MAAM,MAAM,kBAAkB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,mBAAmB,CAAC,EAAE,GAAG,CAAA;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,CAAC;AA8HF,eAAO,MAAM,uBAAuB,WAAY,GAAG,EAAE,KAAG,GAQvD,CAAA;AACD,eAAO,MAAM,sBAAsB,QAAS,MAAM,uBAAuB,OAAO,MAAM,EAAE,GAAG,CAAC,QAa3F,CAAC;AA+WF,QAAA,MAAM,aAAa,WAAY,kBAAkB,4CA+9ChD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -89,6 +89,7 @@ import { getSettingsMap } from "../../../helpers/settingsPayload";
|
|
|
89
89
|
import { SolidFormFooter } from "./SolidFormFooter";
|
|
90
90
|
import { normalizeSolidFormActionPath } from "../../../helpers/routePaths";
|
|
91
91
|
import { showToast } from "../../../redux/features/toastSlice";
|
|
92
|
+
import { closePopup, openPopup } from "../../../redux/features/popupSlice";
|
|
92
93
|
import { useDispatch } from "react-redux";
|
|
93
94
|
import { SolidButton, SolidConfirmDialog } from "../../shad-cn-ui";
|
|
94
95
|
import { SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle } from "../../shad-cn-ui/SolidDialog";
|
|
@@ -275,6 +276,24 @@ var fieldFactory = function (type, fieldContext, setLightboxUrls, setOpenLightbo
|
|
|
275
276
|
}
|
|
276
277
|
return null;
|
|
277
278
|
};
|
|
279
|
+
var normalizeWorkflowFieldValueForFormData = function (value, fieldMetadata) {
|
|
280
|
+
if ((fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type) === "relation" && (fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationType) === "many-to-one") {
|
|
281
|
+
if (value && typeof value === "object" && "solidManyToOneValue" in value) {
|
|
282
|
+
return value;
|
|
283
|
+
}
|
|
284
|
+
if (value && typeof value === "object" && "id" in value) {
|
|
285
|
+
return { solidManyToOneValue: value.id };
|
|
286
|
+
}
|
|
287
|
+
return { solidManyToOneValue: value };
|
|
288
|
+
}
|
|
289
|
+
if ((fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type) === "selectionStatic" || (fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type) === "selectionDynamic") {
|
|
290
|
+
if (value && typeof value === "object" && "value" in value) {
|
|
291
|
+
return value;
|
|
292
|
+
}
|
|
293
|
+
return { label: String(value !== null && value !== void 0 ? value : ""), value: value };
|
|
294
|
+
}
|
|
295
|
+
return value;
|
|
296
|
+
};
|
|
278
297
|
// solidFieldsMetadata={solidFieldsMetadata} solidView={solidView}
|
|
279
298
|
var SolidField = function (_a) {
|
|
280
299
|
var formik = _a.formik, field = _a.field, fieldMetadata = _a.fieldMetadata, initialEntityData = _a.initialEntityData, solidFormViewMetaData = _a.solidFormViewMetaData, modelName = _a.modelName, readOnly = _a.readOnly, viewMode = _a.viewMode, onChange = _a.onChange, onBlur = _a.onBlur, parentFieldName = _a.parentFieldName, parentData = _a.parentData, setLightboxUrls = _a.setLightboxUrls, setOpenLightbox = _a.setOpenLightbox, onEmbeddedFormSave = _a.onEmbeddedFormSave;
|
|
@@ -820,18 +839,18 @@ var SolidFormView = function (params) {
|
|
|
820
839
|
});
|
|
821
840
|
};
|
|
822
841
|
var onFormikSubmit = function (values) { return __awaiter(void 0, void 0, void 0, function () {
|
|
823
|
-
var solidView, solidFieldsMetadata, layoutFieldsObj, formData_1, solidWorkflowField, result, baseFormPath, queryParams, result, err_1;
|
|
824
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
825
|
-
return __generator(this, function (
|
|
826
|
-
switch (
|
|
842
|
+
var solidView, solidFieldsMetadata, layoutFieldsObj, formData_1, solidWorkflowField, workflowFieldMetadata, workflowFieldContext, workflowSolidField, result, baseFormPath, queryParams, result, err_1;
|
|
843
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
844
|
+
return __generator(this, function (_m) {
|
|
845
|
+
switch (_m.label) {
|
|
827
846
|
case 0:
|
|
828
847
|
solidView = solidFormViewMetaData.data.solidView;
|
|
829
848
|
solidFieldsMetadata = solidFormViewMetaData.data.solidFieldsMetadata;
|
|
830
849
|
layoutFieldsObj = getLayoutFieldsAsObject([formViewLayout]);
|
|
831
850
|
setIsSubmitting(true);
|
|
832
|
-
|
|
851
|
+
_m.label = 1;
|
|
833
852
|
case 1:
|
|
834
|
-
|
|
853
|
+
_m.trys.push([1, 7, 8, 9]);
|
|
835
854
|
formData_1 = new FormData();
|
|
836
855
|
// Iterate through the keys in the values object
|
|
837
856
|
Object.entries(values).forEach(function (_a) {
|
|
@@ -854,18 +873,24 @@ var SolidFormView = function (params) {
|
|
|
854
873
|
formData_1.append(key, String(value));
|
|
855
874
|
}
|
|
856
875
|
});
|
|
857
|
-
solidWorkflowField = (
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
876
|
+
solidWorkflowField = (_b = (_a = solidView === null || solidView === void 0 ? void 0 : solidView.layout) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.workflowField;
|
|
877
|
+
workflowFieldMetadata = solidFieldsMetadata === null || solidFieldsMetadata === void 0 ? void 0 : solidFieldsMetadata[solidWorkflowField];
|
|
878
|
+
if (params.id !== "new" && solidWorkflowField && workflowFieldMetadata && ((_c = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _c === void 0 ? void 0 : _c.solidFormViewWorkflowData)) {
|
|
879
|
+
workflowFieldContext = {
|
|
880
|
+
fieldMetadata: workflowFieldMetadata,
|
|
881
|
+
field: (_d = layoutFieldsObj[solidWorkflowField]) !== null && _d !== void 0 ? _d : { attrs: { name: solidWorkflowField } },
|
|
882
|
+
data: initialEntityData,
|
|
883
|
+
solidFormViewMetaData: solidFormViewMetaData,
|
|
884
|
+
modelName: params.modelName
|
|
885
|
+
};
|
|
886
|
+
workflowSolidField = fieldFactory(workflowFieldMetadata === null || workflowFieldMetadata === void 0 ? void 0 : workflowFieldMetadata.type, workflowFieldContext);
|
|
887
|
+
if (workflowSolidField) {
|
|
888
|
+
formData_1.delete(solidWorkflowField);
|
|
889
|
+
formData_1.delete("".concat(solidWorkflowField, "Id"));
|
|
890
|
+
workflowSolidField.updateFormData(normalizeWorkflowFieldValueForFormData(solidWorkflowFieldValue, workflowFieldMetadata), formData_1);
|
|
866
891
|
}
|
|
867
892
|
}
|
|
868
|
-
if ((
|
|
893
|
+
if ((_g = (_f = (_e = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _e === void 0 ? void 0 : _e.solidView) === null || _f === void 0 ? void 0 : _f.model) === null || _g === void 0 ? void 0 : _g.internationalisation) {
|
|
869
894
|
if (selectedLocale && !formData_1.has('localeName')) {
|
|
870
895
|
formData_1.append('localeName', selectedLocale);
|
|
871
896
|
}
|
|
@@ -873,7 +898,7 @@ var SolidFormView = function (params) {
|
|
|
873
898
|
formData_1.append('defaultEntityLocaleId', defaultEntityLocaleId.toString());
|
|
874
899
|
}
|
|
875
900
|
}
|
|
876
|
-
if ((
|
|
901
|
+
if ((_k = (_j = (_h = solidFormViewMetaData === null || solidFormViewMetaData === void 0 ? void 0 : solidFormViewMetaData.data) === null || _h === void 0 ? void 0 : _h.solidView) === null || _j === void 0 ? void 0 : _j.model) === null || _k === void 0 ? void 0 : _k.draftPublishWorkflow) {
|
|
877
902
|
if (published) {
|
|
878
903
|
formData_1.append('publishedAt', published);
|
|
879
904
|
}
|
|
@@ -885,7 +910,7 @@ var SolidFormView = function (params) {
|
|
|
885
910
|
if (!(params.id === 'new')) return [3 /*break*/, 4];
|
|
886
911
|
return [4 /*yield*/, createEntity(formData_1).unwrap()];
|
|
887
912
|
case 3:
|
|
888
|
-
result =
|
|
913
|
+
result = _m.sent();
|
|
889
914
|
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.FORM_SAVED, detail: ERROR_MESSAGES.FORM_SAVED_SUCCESSFULLY }));
|
|
890
915
|
// if (!params.embeded && result?.data?.id) {
|
|
891
916
|
// const newPathname = pathname.replace(/new$/, result.data.id);
|
|
@@ -899,13 +924,13 @@ var SolidFormView = function (params) {
|
|
|
899
924
|
baseFormPath = normalizeSolidFormActionPath(pathname, "form");
|
|
900
925
|
queryParams = new URLSearchParams(searchParams.toString());
|
|
901
926
|
queryParams.set("viewMode", "view");
|
|
902
|
-
router.replace("".concat(baseFormPath, "/").concat((
|
|
927
|
+
router.replace("".concat(baseFormPath, "/").concat((_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.id, "?").concat(queryParams.toString()));
|
|
903
928
|
setViewMode("view");
|
|
904
929
|
}
|
|
905
930
|
return [2 /*return*/, result];
|
|
906
931
|
case 4: return [4 /*yield*/, updateEntity({ id: +params.id, data: formData_1 }).unwrap()];
|
|
907
932
|
case 5:
|
|
908
|
-
result =
|
|
933
|
+
result = _m.sent();
|
|
909
934
|
// const result = await updateEntity({ id: +params.id, data: formData }).unwrap();
|
|
910
935
|
if (!params.embeded) {
|
|
911
936
|
dispatch(showToast({ severity: "success", summary: ERROR_MESSAGES.FORM_UPDATE, detail: ERROR_MESSAGES.FORM_UPDATE_SUCCESSFULLY }));
|
|
@@ -916,7 +941,7 @@ var SolidFormView = function (params) {
|
|
|
916
941
|
return [2 /*return*/, result];
|
|
917
942
|
case 6: return [3 /*break*/, 9];
|
|
918
943
|
case 7:
|
|
919
|
-
err_1 =
|
|
944
|
+
err_1 = _m.sent();
|
|
920
945
|
console.error(ERROR_MESSAGES.ENTITY_FAILED, err_1);
|
|
921
946
|
return [3 /*break*/, 9];
|
|
922
947
|
case 8:
|
|
@@ -1306,7 +1331,7 @@ var SolidFormView = function (params) {
|
|
|
1306
1331
|
onSubmit: onFormikSubmit,
|
|
1307
1332
|
});
|
|
1308
1333
|
var formFieldOnXXX_1 = function (event, eventType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1309
|
-
var _a, fieldName, value, changeHandler, dynamicChangeHandler, event_1, updatedFormInfo;
|
|
1334
|
+
var _a, fieldName, value, changeHandler, dynamicChangeHandler, popupApi, event_1, updatedFormInfo;
|
|
1310
1335
|
return __generator(this, function (_b) {
|
|
1311
1336
|
switch (_b.label) {
|
|
1312
1337
|
case 0:
|
|
@@ -1327,6 +1352,10 @@ var SolidFormView = function (params) {
|
|
|
1327
1352
|
if (!changeHandler) return [3 /*break*/, 3];
|
|
1328
1353
|
dynamicChangeHandler = getExtensionFunction(changeHandler);
|
|
1329
1354
|
if (!dynamicChangeHandler) return [3 /*break*/, 2];
|
|
1355
|
+
popupApi = {
|
|
1356
|
+
open: function (popupEvent) { return dispatch(openPopup(__assign({ closable: true }, popupEvent))); },
|
|
1357
|
+
close: function () { return dispatch(closePopup()); },
|
|
1358
|
+
};
|
|
1330
1359
|
event_1 = {
|
|
1331
1360
|
fieldsMetadata: solidFieldsMetadata_1,
|
|
1332
1361
|
formData: formik.values,
|
|
@@ -1337,6 +1366,7 @@ var SolidFormView = function (params) {
|
|
|
1337
1366
|
type: eventType,
|
|
1338
1367
|
viewMetadata: solidView_1,
|
|
1339
1368
|
formViewLayout: formViewLayout,
|
|
1369
|
+
popup: popupApi,
|
|
1340
1370
|
queryParams: {
|
|
1341
1371
|
actionName: actionName,
|
|
1342
1372
|
actionContext: actionContext,
|