@solidstarters/solid-core-ui 1.1.189 → 1.1.191
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/CodeEditor.d.ts.map +1 -1
- package/dist/components/common/CodeEditor.js +13 -1
- package/dist/components/common/CodeEditor.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +98 -20
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/SolidExport.js +60 -8
- package/dist/components/common/SolidExport.js.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.d.ts +2 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.d.ts.map +1 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.js +8 -0
- package/dist/components/common/SolidSettings/LlmSettings/AnthropicProviderComponent.js.map +1 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.d.ts +2 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.d.ts.map +1 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.js +8 -0
- package/dist/components/common/SolidSettings/LlmSettings/OpenAiProviderComponent.js.map +1 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +48 -1
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +40 -9
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +40 -9
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +16 -2
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +34 -14
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +34 -14
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts +1 -0
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +45 -2
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.d.ts +1 -0
- package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +59 -5
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +334 -191
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +38 -9
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +57 -8
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +11 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +17 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/solid-ai/SolidXAIInputBox.d.ts.map +1 -1
- package/dist/components/core/solid-ai/SolidXAIInputBox.js +6 -2
- package/dist/components/core/solid-ai/SolidXAIInputBox.js.map +1 -1
- package/dist/components/core/solid-ai/SolidXAIResponse.d.ts.map +1 -1
- package/dist/components/core/solid-ai/SolidXAIResponse.js +31 -3
- package/dist/components/core/solid-ai/SolidXAIResponse.js.map +1 -1
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +12 -3
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/constants/error-messages.d.ts +11 -0
- package/dist/constants/error-messages.d.ts.map +1 -0
- package/dist/constants/error-messages.js +15 -0
- package/dist/constants/error-messages.js.map +1 -0
- package/dist/helpers/registry.js +4 -2
- package/dist/helpers/registry.js.map +1 -1
- package/dist/redux/api/aiInteractionApi.d.ts +1 -0
- package/dist/redux/api/aiInteractionApi.d.ts.map +1 -1
- package/dist/redux/api/aiInteractionApi.js.map +1 -1
- package/dist/resources/themes/solid-dark-purple/theme.css +6 -1
- package/dist/resources/themes/solid-light-purple/theme.css +6 -1
- package/package.json +1 -1
- package/src/resources/themes/solid-dark-purple/theme.css +6 -1
- package/src/resources/themes/solid-light-purple/theme.css +6 -1
|
@@ -74,17 +74,18 @@ import { useLazyCheckIfPermissionExistsQuery } from "../../../redux/api/userApi"
|
|
|
74
74
|
import { createPermission, deleteManyPermission, deletePermission, findPermission, updatePermission } from "../../../helpers/permissions";
|
|
75
75
|
import { useRouter, useSearchParams } from "next/navigation";
|
|
76
76
|
import { ListViewRowActionPopup } from "./ListViewRowActionPopup";
|
|
77
|
-
import { FilterIcon } from
|
|
77
|
+
import { FilterIcon } from "../../modelsComponents/filterIcon";
|
|
78
78
|
import { OverlayPanel } from "primereact/overlaypanel";
|
|
79
79
|
import { Toast } from "primereact/toast";
|
|
80
80
|
import { Divider } from "primereact/divider";
|
|
81
|
-
import CompactImage from
|
|
82
|
-
import CozyImage from
|
|
83
|
-
import ComfortableImage from
|
|
81
|
+
import CompactImage from "../../../resources/images/layout/images/compact.png";
|
|
82
|
+
import CozyImage from "../../../resources/images/layout/images/cozy.png";
|
|
83
|
+
import ComfortableImage from "../../../resources/images/layout/images/comfortable.png";
|
|
84
84
|
import { capitalize } from "lodash";
|
|
85
85
|
import Lightbox from "yet-another-react-lightbox";
|
|
86
86
|
import Counter from "yet-another-react-lightbox/plugins/counter";
|
|
87
87
|
import Download from "yet-another-react-lightbox/plugins/download";
|
|
88
|
+
import Video from "yet-another-react-lightbox/plugins/video";
|
|
88
89
|
import "yet-another-react-lightbox/styles.css";
|
|
89
90
|
import "yet-another-react-lightbox/plugins/counter.css";
|
|
90
91
|
import { SolidListViewConfigure } from "./SolidListViewConfigure";
|
|
@@ -95,9 +96,10 @@ import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
|
95
96
|
import { SolidListViewHeaderButton } from "./SolidListViewHeaderButton";
|
|
96
97
|
import { SolidListViewRowButtonContextMenu } from "./SolidListViewRowButtonContextMenu";
|
|
97
98
|
import { useSelector } from "react-redux";
|
|
98
|
-
import styles from
|
|
99
|
+
import styles from "./SolidListViewWrapper.module.css";
|
|
99
100
|
import { SolidXAIModule } from "../solid-ai/SolidXAIModule";
|
|
100
101
|
import { SolidXAIIcon } from "../solid-ai/SolidXAIIcon";
|
|
102
|
+
// import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
101
103
|
var getRandomInt = function (min, max) {
|
|
102
104
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
103
105
|
};
|
|
@@ -114,7 +116,6 @@ export var queryStringToQueryObject = function () {
|
|
|
114
116
|
console.error("Error decoding or parsing query string from local storage:", error);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
|
-
;
|
|
118
119
|
};
|
|
119
120
|
export var queryObjectToQueryString = function (queryObject) {
|
|
120
121
|
if (queryObject) {
|
|
@@ -132,8 +133,8 @@ export var SolidListView = function (params) {
|
|
|
132
133
|
var solidGlobalSearchElementRef = useRef();
|
|
133
134
|
var router = useRouter();
|
|
134
135
|
var searchParams = useSearchParams(); // Converts the query params to a string
|
|
135
|
-
var localeName = searchParams.get(
|
|
136
|
-
// TODO: The initial filter state will be created based on the fields which are present on this list view.
|
|
136
|
+
var localeName = searchParams.get("locale");
|
|
137
|
+
// TODO: The initial filter state will be created based on the fields which are present on this list view.
|
|
137
138
|
var _18 = useState(params.customFilter || null), filters = _18[0], setFilters = _18[1];
|
|
138
139
|
// const [customFilter, setCustomFilter] = useState<FilterRule[]>(initialState);
|
|
139
140
|
// const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
|
|
@@ -146,10 +147,10 @@ export var SolidListView = function (params) {
|
|
|
146
147
|
var triggerCheckIfPermissionExists = useLazyCheckIfPermissionExistsQuery()[0];
|
|
147
148
|
var handleCustomButtonClick = useHandleListCustomButtonClick();
|
|
148
149
|
useEffect(function () {
|
|
149
|
-
var storedOpen = localStorage.getItem(
|
|
150
|
-
var storedWidth = localStorage.getItem(
|
|
150
|
+
var storedOpen = localStorage.getItem("l_solidxai_open");
|
|
151
|
+
var storedWidth = localStorage.getItem("l_solidxai_width");
|
|
151
152
|
if (storedOpen !== null) {
|
|
152
|
-
setIsOpenSolidXAiPanel(storedOpen ===
|
|
153
|
+
setIsOpenSolidXAiPanel(storedOpen === "true");
|
|
153
154
|
}
|
|
154
155
|
if (storedWidth !== null) {
|
|
155
156
|
var width = parseInt(storedWidth, 10);
|
|
@@ -164,21 +165,21 @@ export var SolidListView = function (params) {
|
|
|
164
165
|
var newWidth = window.innerWidth - e.clientX;
|
|
165
166
|
var clampedWidth = Math.max(280, Math.min(newWidth, 700));
|
|
166
167
|
setChatterWidth(clampedWidth);
|
|
167
|
-
localStorage.setItem(
|
|
168
|
+
localStorage.setItem("l_solidxai_width", clampedWidth.toString());
|
|
168
169
|
};
|
|
169
170
|
var handleMouseUp_1 = function () {
|
|
170
171
|
setIsResizing(false);
|
|
171
172
|
};
|
|
172
|
-
window.addEventListener(
|
|
173
|
-
window.addEventListener(
|
|
173
|
+
window.addEventListener("mousemove", handleMouseMove_1);
|
|
174
|
+
window.addEventListener("mouseup", handleMouseUp_1);
|
|
174
175
|
return function () {
|
|
175
|
-
window.removeEventListener(
|
|
176
|
-
window.removeEventListener(
|
|
176
|
+
window.removeEventListener("mousemove", handleMouseMove_1);
|
|
177
|
+
window.removeEventListener("mouseup", handleMouseUp_1);
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
180
|
}, [isResizing]);
|
|
180
181
|
useEffect(function () {
|
|
181
|
-
console.log(
|
|
182
|
+
console.log("useEffect: [params.modelName]");
|
|
182
183
|
var fetchPermissions = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
183
184
|
var permissionNames, queryData, queryString, response;
|
|
184
185
|
return __generator(this, function (_a) {
|
|
@@ -190,13 +191,13 @@ export var SolidListView = function (params) {
|
|
|
190
191
|
deletePermission(params.modelName),
|
|
191
192
|
updatePermission(params.modelName),
|
|
192
193
|
deleteManyPermission(params.modelName),
|
|
193
|
-
findPermission(params.modelName)
|
|
194
|
+
findPermission(params.modelName),
|
|
194
195
|
];
|
|
195
196
|
queryData = {
|
|
196
|
-
permissionNames: permissionNames
|
|
197
|
+
permissionNames: permissionNames,
|
|
197
198
|
};
|
|
198
199
|
queryString = qs.stringify(queryData, {
|
|
199
|
-
encodeValuesOnly: true
|
|
200
|
+
encodeValuesOnly: true,
|
|
200
201
|
});
|
|
201
202
|
return [4 /*yield*/, triggerCheckIfPermissionExists(queryString)];
|
|
202
203
|
case 1:
|
|
@@ -213,8 +214,12 @@ export var SolidListView = function (params) {
|
|
|
213
214
|
// Create the RTK slices for this entity
|
|
214
215
|
var entityApi = createSolidEntityApi(params.modelName);
|
|
215
216
|
var useCreateSolidEntityMutation = entityApi.useCreateSolidEntityMutation, useDeleteMultipleSolidEntitiesMutation = entityApi.useDeleteMultipleSolidEntitiesMutation, useDeleteSolidEntityMutation = entityApi.useDeleteSolidEntityMutation, useGetSolidEntitiesQuery = entityApi.useGetSolidEntitiesQuery, useGetSolidEntityByIdQuery = entityApi.useGetSolidEntityByIdQuery, useLazyGetSolidEntitiesQuery = entityApi.useLazyGetSolidEntitiesQuery, useLazyGetSolidEntityByIdQuery = entityApi.useLazyGetSolidEntityByIdQuery, usePrefetch = entityApi.usePrefetch, useUpdateSolidEntityMutation = entityApi.useUpdateSolidEntityMutation, useRecoverSolidEntityByIdQuery = entityApi.useRecoverSolidEntityByIdQuery, useLazyRecoverSolidEntityByIdQuery = entityApi.useLazyRecoverSolidEntityByIdQuery, useRecoverSolidEntityMutation = entityApi.useRecoverSolidEntityMutation;
|
|
216
|
-
// Get the list view layout & metadata first.
|
|
217
|
-
var listViewMetaDataQs = qs.stringify({
|
|
217
|
+
// Get the list view layout & metadata first.
|
|
218
|
+
var listViewMetaDataQs = qs.stringify({
|
|
219
|
+
modelName: params.modelName,
|
|
220
|
+
moduleName: params.moduleName,
|
|
221
|
+
viewType: "list",
|
|
222
|
+
}, {
|
|
218
223
|
encodeValuesOnly: true,
|
|
219
224
|
});
|
|
220
225
|
var _25 = useState({}), listViewMetaData = _25[0], setListViewMetaData = _25[1];
|
|
@@ -227,7 +232,9 @@ export var SolidListView = function (params) {
|
|
|
227
232
|
var initialFilters = {};
|
|
228
233
|
var toPopulate = [];
|
|
229
234
|
var toPopulateMedia = [];
|
|
230
|
-
var currentLayout = params.customLayout
|
|
235
|
+
var currentLayout = params.customLayout
|
|
236
|
+
? params.customLayout
|
|
237
|
+
: solidView === null || solidView === void 0 ? void 0 : solidView.layout;
|
|
231
238
|
for (var i = 0; i < (currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.children.length); i++) {
|
|
232
239
|
var column = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.children[i];
|
|
233
240
|
var fieldMetadata = solidFieldsMetadata === null || solidFieldsMetadata === void 0 ? void 0 : solidFieldsMetadata[column.attrs.name];
|
|
@@ -236,32 +243,48 @@ export var SolidListView = function (params) {
|
|
|
236
243
|
// return;
|
|
237
244
|
}
|
|
238
245
|
if (fieldMetadata) {
|
|
239
|
-
// Form the initial filters after iterating over the columns and field metadata.
|
|
240
|
-
if ([
|
|
246
|
+
// Form the initial filters after iterating over the columns and field metadata.
|
|
247
|
+
if (["int", "bigint", "float", "decimal"].includes(fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type)) {
|
|
241
248
|
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }
|
|
242
|
-
initialFilters[column.attrs.name] = {
|
|
249
|
+
initialFilters[column.attrs.name] = {
|
|
250
|
+
value: null,
|
|
251
|
+
matchMode: FilterMatchMode.EQUALS,
|
|
252
|
+
};
|
|
243
253
|
}
|
|
244
|
-
else if ([
|
|
254
|
+
else if (["date", "datetime", "time", "boolean"].includes(fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type)) {
|
|
245
255
|
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] }
|
|
246
|
-
initialFilters[column.attrs.name] = {
|
|
256
|
+
initialFilters[column.attrs.name] = {
|
|
257
|
+
value: null,
|
|
258
|
+
matchMode: FilterMatchMode.EQUALS,
|
|
259
|
+
};
|
|
247
260
|
}
|
|
248
|
-
else if ([
|
|
249
|
-
initialFilters[column.attrs.name] = {
|
|
261
|
+
else if (["relation", "selectionStatic", "selectionDynamic"].includes(fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.type)) {
|
|
262
|
+
initialFilters[column.attrs.name] = {
|
|
263
|
+
value: null,
|
|
264
|
+
matchMode: FilterMatchMode.IN,
|
|
265
|
+
};
|
|
250
266
|
}
|
|
251
267
|
else {
|
|
252
268
|
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.STARTS_WITH }] }
|
|
253
|
-
initialFilters[column.attrs.name] = {
|
|
269
|
+
initialFilters[column.attrs.name] = {
|
|
270
|
+
value: null,
|
|
271
|
+
matchMode: FilterMatchMode.STARTS_WITH,
|
|
272
|
+
};
|
|
254
273
|
}
|
|
255
|
-
if (column.attrs.name ===
|
|
256
|
-
initialFilters[column.attrs.name] = {
|
|
274
|
+
if (column.attrs.name === "id") {
|
|
275
|
+
initialFilters[column.attrs.name] = {
|
|
276
|
+
value: null,
|
|
277
|
+
matchMode: FilterMatchMode.IN,
|
|
278
|
+
};
|
|
257
279
|
}
|
|
258
|
-
// Form the "toPopulate" array.
|
|
259
|
-
if (fieldMetadata.type ===
|
|
280
|
+
// Form the "toPopulate" array.
|
|
281
|
+
if (fieldMetadata.type === "relation") {
|
|
260
282
|
if (!toPopulate.includes(fieldMetadata.name)) {
|
|
261
283
|
toPopulate.push(fieldMetadata.name);
|
|
262
284
|
}
|
|
263
285
|
}
|
|
264
|
-
if (fieldMetadata.type ===
|
|
286
|
+
if (fieldMetadata.type === "mediaSingle" ||
|
|
287
|
+
fieldMetadata.type === "mediaMultiple") {
|
|
265
288
|
if (!toPopulateMedia.includes(fieldMetadata.name)) {
|
|
266
289
|
toPopulateMedia.push(fieldMetadata.name);
|
|
267
290
|
}
|
|
@@ -275,13 +298,13 @@ export var SolidListView = function (params) {
|
|
|
275
298
|
setRows(rows);
|
|
276
299
|
setToPopulate(populate);
|
|
277
300
|
setToPopulateMedia(populateMedia);
|
|
278
|
-
setSortField(
|
|
301
|
+
setSortField("id");
|
|
279
302
|
setSortOrder(-1);
|
|
280
303
|
return { rows: rows, populate: populate, populateMedia: populateMedia };
|
|
281
304
|
};
|
|
282
305
|
// Set the initial filter state based on the metadata.
|
|
283
306
|
useEffect(function () {
|
|
284
|
-
console.log(
|
|
307
|
+
console.log("useEffect: [solidListViewMetaData] line no 227");
|
|
285
308
|
// refetch();
|
|
286
309
|
if (solidListViewMetaData) {
|
|
287
310
|
if (params.customLayout) {
|
|
@@ -297,11 +320,21 @@ export var SolidListView = function (params) {
|
|
|
297
320
|
// set layout and actions for create and edit buttons and view modes
|
|
298
321
|
useEffect(function () {
|
|
299
322
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
|
|
300
|
-
console.log(
|
|
323
|
+
console.log("useEffect: [solidListViewMetaData] line no 245");
|
|
301
324
|
if (solidListViewMetaData) {
|
|
302
|
-
var createActionUrl = ((_d = (_c = (_b = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.createAction) &&
|
|
303
|
-
|
|
304
|
-
|
|
325
|
+
var createActionUrl = ((_d = (_c = (_b = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.createAction) &&
|
|
326
|
+
((_j = (_h = (_g = (_f = (_e = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _e === void 0 ? void 0 : _e.solidView) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.attrs) === null || _h === void 0 ? void 0 : _h.createAction) === null || _j === void 0 ? void 0 : _j.type) === "custom"
|
|
327
|
+
? (_p = (_o = (_m = (_l = (_k = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _k === void 0 ? void 0 : _k.solidView) === null || _l === void 0 ? void 0 : _l.layout) === null || _m === void 0 ? void 0 : _m.attrs) === null || _o === void 0 ? void 0 : _o.createAction) === null || _p === void 0 ? void 0 : _p.customComponent
|
|
328
|
+
: "form/new";
|
|
329
|
+
var editActionUrl = ((_t = (_s = (_r = (_q = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _q === void 0 ? void 0 : _q.solidView) === null || _r === void 0 ? void 0 : _r.layout) === null || _s === void 0 ? void 0 : _s.attrs) === null || _t === void 0 ? void 0 : _t.editAction) &&
|
|
330
|
+
((_y = (_x = (_w = (_v = (_u = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _u === void 0 ? void 0 : _u.solidView) === null || _v === void 0 ? void 0 : _v.layout) === null || _w === void 0 ? void 0 : _w.attrs) === null || _x === void 0 ? void 0 : _x.editAction) === null || _y === void 0 ? void 0 : _y.type) === "custom"
|
|
331
|
+
? (_3 = (_2 = (_1 = (_0 = (_z = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _z === void 0 ? void 0 : _z.solidView) === null || _0 === void 0 ? void 0 : _0.layout) === null || _1 === void 0 ? void 0 : _1.attrs) === null || _2 === void 0 ? void 0 : _2.editAction) === null || _3 === void 0 ? void 0 : _3.customComponent
|
|
332
|
+
: "form";
|
|
333
|
+
var viewModes_1 = ((_7 = (_6 = (_5 = (_4 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _4 === void 0 ? void 0 : _4.solidView) === null || _5 === void 0 ? void 0 : _5.layout) === null || _6 === void 0 ? void 0 : _6.attrs) === null || _7 === void 0 ? void 0 : _7.allowedViews) &&
|
|
334
|
+
((_11 = (_10 = (_9 = (_8 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _8 === void 0 ? void 0 : _8.solidView) === null || _9 === void 0 ? void 0 : _9.layout) === null || _10 === void 0 ? void 0 : _10.attrs) === null || _11 === void 0 ? void 0 : _11.allowedViews.length) > 0 &&
|
|
335
|
+
((_15 = (_14 = (_13 = (_12 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _12 === void 0 ? void 0 : _12.solidView) === null || _13 === void 0 ? void 0 : _13.layout) === null || _14 === void 0 ? void 0 : _14.attrs) === null || _15 === void 0 ? void 0 : _15.allowedViews.map(function (view) {
|
|
336
|
+
return { label: capitalize(view), value: view };
|
|
337
|
+
}));
|
|
305
338
|
setViewModes(viewModes_1);
|
|
306
339
|
if (createActionUrl) {
|
|
307
340
|
setCreateButtonUrl(createActionUrl);
|
|
@@ -314,7 +347,9 @@ export var SolidListView = function (params) {
|
|
|
314
347
|
// All list view state.
|
|
315
348
|
var _28 = useState([]), listViewData = _28[0], setListViewData = _28[1];
|
|
316
349
|
var _29 = useState(0), first = _29[0], setFirst = _29[1];
|
|
317
|
-
var _30 = useState(((_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.defaultPageSize)
|
|
350
|
+
var _30 = useState(((_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.defaultPageSize)
|
|
351
|
+
? (_b = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _b === void 0 ? void 0 : _b.defaultPageSize
|
|
352
|
+
: 10), rows = _30[0], setRows = _30[1];
|
|
318
353
|
var _31 = useState(0), totalRecords = _31[0], setTotalRecords = _31[1];
|
|
319
354
|
var _32 = useState(""), sortField = _32[0], setSortField = _32[1];
|
|
320
355
|
var _33 = useState(0), sortOrder = _33[0], setSortOrder = _33[1];
|
|
@@ -330,9 +365,9 @@ export var SolidListView = function (params) {
|
|
|
330
365
|
var _43 = useState(null), customFilter = _43[0], setCustomFilter = _43[1];
|
|
331
366
|
var _44 = useState(false), showSaveFilterPopup = _44[0], setShowSaveFilterPopup = _44[1];
|
|
332
367
|
var sizeOptions = [
|
|
333
|
-
{ label:
|
|
334
|
-
{ label:
|
|
335
|
-
{ label:
|
|
368
|
+
{ label: "Compact", value: "small", image: CompactImage },
|
|
369
|
+
{ label: "Cozy", value: "normal", image: CozyImage },
|
|
370
|
+
{ label: "Comfortable", value: "large", image: ComfortableImage },
|
|
336
371
|
];
|
|
337
372
|
// const viewModes = [
|
|
338
373
|
// { label: 'List ', value: 'list', image: ListImage },
|
|
@@ -348,25 +383,25 @@ export var SolidListView = function (params) {
|
|
|
348
383
|
var _49 = useLazyGetSolidEntitiesQuery(), triggerGetSolidEntities = _49[0], _50 = _49[1], solidEntityListViewData = _50.data, isLoading = _50.isLoading, error = _50.error;
|
|
349
384
|
var _51 = useLazyRecoverSolidEntityByIdQuery(), triggerRecoverSolidEntitiesById = _51[0], _52 = _51[1], recoverByIdData = _52.data, recoverByIdIsLoading = _52.isLoading, recoverByIdError = _52.error, recoverByIdIsError = _52.isError, recoverByIdIsSuccess = _52.isSuccess;
|
|
350
385
|
var _53 = useRecoverSolidEntityMutation(), triggerRecoverSolidEntities = _53[0], _54 = _53[1], recoverByData = _54.data, recoverByIsLoading = _54.isLoading, recoverError = _54.error, recoverIsError = _54.isError, recoverByIsSuccess = _54.isSuccess;
|
|
351
|
-
// After data is fetched populate the list view state so as to be able to render the data.
|
|
386
|
+
// After data is fetched populate the list view state so as to be able to render the data.
|
|
352
387
|
useEffect(function () {
|
|
353
|
-
console.log(
|
|
388
|
+
console.log("useEffect: [solidListViewMetaData] line no 310");
|
|
354
389
|
if (solidEntityListViewData) {
|
|
355
390
|
var cleanedRecords = solidEntityListViewData.records.map(function (record) {
|
|
356
391
|
var newRecord = __assign({}, record);
|
|
357
392
|
Object.entries(newRecord).forEach(function (_a) {
|
|
358
393
|
var key = _a[0], value = _a[1];
|
|
359
|
-
if (typeof value ===
|
|
394
|
+
if (typeof value === "string") {
|
|
360
395
|
try {
|
|
361
396
|
var parsed = JSON.parse(value);
|
|
362
397
|
if (Array.isArray(parsed)) {
|
|
363
|
-
newRecord[key] = parsed.join(
|
|
398
|
+
newRecord[key] = parsed.join(", ");
|
|
364
399
|
}
|
|
365
400
|
}
|
|
366
401
|
catch (_b) {
|
|
367
402
|
// If not valid JSON array, optionally strip brackets/quotes
|
|
368
403
|
if (/^\[.*\]$/.test(value)) {
|
|
369
|
-
newRecord[key] = value.replace(/[\[\]"]+/g,
|
|
404
|
+
newRecord[key] = value.replace(/[\[\]"]+/g, "");
|
|
370
405
|
}
|
|
371
406
|
}
|
|
372
407
|
}
|
|
@@ -380,12 +415,12 @@ export var SolidListView = function (params) {
|
|
|
380
415
|
}
|
|
381
416
|
}, [solidEntityListViewData]);
|
|
382
417
|
var _55 = useDeleteSolidEntityMutation(), deleteSolidSingleEntiry = _55[0], isDeleteSolidSingleEntitySuccess = _55[1].isSuccess;
|
|
383
|
-
// Delete mutation
|
|
418
|
+
// Delete mutation
|
|
384
419
|
var _56 = useDeleteMultipleSolidEntitiesMutation(), deleteManySolidEntities = _56[0], _57 = _56[1], isSolidEntitiesDeleted = _57.isLoading, isDeleteSolidEntitiesSucess = _57.isSuccess, isSolidEntitiesDeleteError = _57.isError, SolidEntitiesDeleteError = _57.error, DeletedSolidEntities = _57.data;
|
|
385
420
|
// Fetch data after toPopulate has been populated...
|
|
386
421
|
useEffect(function () {
|
|
387
422
|
var _a, _b, _c;
|
|
388
|
-
console.log(
|
|
423
|
+
console.log("useEffect: [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, recoverByIdIsSuccess, recoverByIsSuccess, solidListViewMetaData]");
|
|
389
424
|
if (solidListViewMetaData) {
|
|
390
425
|
var queryObject = queryStringToQueryObject();
|
|
391
426
|
if (queryObject) {
|
|
@@ -394,14 +429,16 @@ export var SolidListView = function (params) {
|
|
|
394
429
|
limit: queryObject.limit || 25,
|
|
395
430
|
populate: queryObject.populate,
|
|
396
431
|
populateMedia: queryObject.populateMedia,
|
|
397
|
-
sort: queryObject.sort
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
432
|
+
sort: queryObject.sort
|
|
433
|
+
? (_a = queryObject.sort) === null || _a === void 0 ? void 0 : _a.map(function (sortItem) {
|
|
434
|
+
var _a = sortItem.split(":"), field = _a[0], order = _a[1];
|
|
435
|
+
return { field: field, order: order };
|
|
436
|
+
})
|
|
437
|
+
: ["id:desc"],
|
|
438
|
+
filters: queryObject.filters,
|
|
402
439
|
};
|
|
403
440
|
var filters_1 = {
|
|
404
|
-
$and: []
|
|
441
|
+
$and: [],
|
|
405
442
|
};
|
|
406
443
|
if (queryObject.s_filter) {
|
|
407
444
|
filters_1.$and.push(queryObject.s_filter);
|
|
@@ -425,13 +462,29 @@ export var SolidListView = function (params) {
|
|
|
425
462
|
setSelectedRecords([]);
|
|
426
463
|
setSelectedRecoverRecords([]);
|
|
427
464
|
}
|
|
428
|
-
}, [
|
|
465
|
+
}, [
|
|
466
|
+
isDeleteSolidEntitiesSucess,
|
|
467
|
+
isDeleteSolidSingleEntitySuccess,
|
|
468
|
+
recoverByIdIsSuccess,
|
|
469
|
+
recoverByIsSuccess,
|
|
470
|
+
solidListViewMetaData,
|
|
471
|
+
]);
|
|
429
472
|
useEffect(function () {
|
|
430
|
-
console.log(
|
|
473
|
+
console.log("useEffect: [first, rows, sortField, sortOrder, showArchived, toPopulate, toPopulateMedia, customFilter, queryDataLoaded]");
|
|
431
474
|
if (queryDataLoaded) {
|
|
432
475
|
setQueryString(first, rows, sortField, sortOrder, filters, showArchived);
|
|
433
476
|
}
|
|
434
|
-
}, [
|
|
477
|
+
}, [
|
|
478
|
+
first,
|
|
479
|
+
rows,
|
|
480
|
+
sortField,
|
|
481
|
+
sortOrder,
|
|
482
|
+
showArchived,
|
|
483
|
+
toPopulate,
|
|
484
|
+
toPopulateMedia,
|
|
485
|
+
customFilter,
|
|
486
|
+
queryDataLoaded,
|
|
487
|
+
]);
|
|
435
488
|
// Handle pagination event.
|
|
436
489
|
var onPageChange = function (event) {
|
|
437
490
|
setFirst(event.first);
|
|
@@ -463,11 +516,11 @@ export var SolidListView = function (params) {
|
|
|
463
516
|
};
|
|
464
517
|
var identifySolidOperatorAndValue = function (primeReactMatchMode, value) {
|
|
465
518
|
// @ts-ignore
|
|
466
|
-
if (primeReactMatchMode.label && primeReactMatchMode.label ===
|
|
519
|
+
if (primeReactMatchMode.label && primeReactMatchMode.label === "Not In") {
|
|
467
520
|
primeReactMatchMode = FilterMatchMode.NOT_IN;
|
|
468
521
|
}
|
|
469
|
-
// Default value, this might not be useful as the solid server might not support these match modes.
|
|
470
|
-
var solidOperator =
|
|
522
|
+
// Default value, this might not be useful as the solid server might not support these match modes.
|
|
523
|
+
var solidOperator = "";
|
|
471
524
|
var solidValue = value[0];
|
|
472
525
|
switch (primeReactMatchMode) {
|
|
473
526
|
case FilterMatchMode.STARTS_WITH:
|
|
@@ -517,8 +570,8 @@ export var SolidListView = function (params) {
|
|
|
517
570
|
}
|
|
518
571
|
return { operator: solidOperator, value: solidValue };
|
|
519
572
|
};
|
|
520
|
-
// Common utility function that gets called on filter, sort & pagination events.
|
|
521
|
-
// This function creates the query string as per the solid backend API specification
|
|
573
|
+
// Common utility function that gets called on filter, sort & pagination events.
|
|
574
|
+
// This function creates the query string as per the solid backend API specification
|
|
522
575
|
var setQueryString = function (offset, limit, sortField, sortOrder, filters, showArchived, locale) { return __awaiter(void 0, void 0, void 0, function () {
|
|
523
576
|
var solidFieldsMetadata, queryData, sortFieldMetadata, queryString, url, urlData;
|
|
524
577
|
var _a, _b, _c;
|
|
@@ -530,11 +583,12 @@ export var SolidListView = function (params) {
|
|
|
530
583
|
filters: filters !== null && filters !== void 0 ? filters : filters,
|
|
531
584
|
populate: toPopulate,
|
|
532
585
|
populateMedia: toPopulateMedia,
|
|
533
|
-
locale: localeName ? localeName :
|
|
586
|
+
locale: localeName ? localeName : "en",
|
|
534
587
|
};
|
|
535
588
|
if (sortField) {
|
|
536
589
|
sortFieldMetadata = solidFieldsMetadata[sortField];
|
|
537
|
-
if ((sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.type) ===
|
|
590
|
+
if ((sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.type) === "relation" &&
|
|
591
|
+
(sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.relationType) === "many-to-one") {
|
|
538
592
|
sortField = "".concat(sortField, ".").concat((_c = (_b = sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.relationModel) === null || _b === void 0 ? void 0 : _b.userKeyField) === null || _c === void 0 ? void 0 : _c.name);
|
|
539
593
|
}
|
|
540
594
|
queryData.sort = [
|
|
@@ -545,7 +599,7 @@ export var SolidListView = function (params) {
|
|
|
545
599
|
queryData.sort = ["id:desc"];
|
|
546
600
|
}
|
|
547
601
|
if (showArchived) {
|
|
548
|
-
queryData.showSoftDeleted =
|
|
602
|
+
queryData.showSoftDeleted = "inclusive";
|
|
549
603
|
}
|
|
550
604
|
queryString = qs.stringify(queryData, { encodeValuesOnly: true });
|
|
551
605
|
if (customFilter) {
|
|
@@ -563,7 +617,7 @@ export var SolidListView = function (params) {
|
|
|
563
617
|
// handle filter...
|
|
564
618
|
var handleApplyCustomFilter = function (transformedFilter) {
|
|
565
619
|
var queryfilter = {
|
|
566
|
-
$and: []
|
|
620
|
+
$and: [],
|
|
567
621
|
};
|
|
568
622
|
if (transformedFilter.s_filter) {
|
|
569
623
|
queryfilter.$and.push(transformedFilter.s_filter);
|
|
@@ -618,7 +672,7 @@ export var SolidListView = function (params) {
|
|
|
618
672
|
setRecoverDialogVisible(false);
|
|
619
673
|
};
|
|
620
674
|
useEffect(function () {
|
|
621
|
-
console.log(
|
|
675
|
+
console.log("useEffect: [recoverIsError, recoverByIdIsError]");
|
|
622
676
|
if (recoverIsError || recoverByIdIsError) {
|
|
623
677
|
showError(recoverByIdIsError ? recoverByIdError : recoverError);
|
|
624
678
|
}
|
|
@@ -659,11 +713,18 @@ export var SolidListView = function (params) {
|
|
|
659
713
|
}); };
|
|
660
714
|
// handle bulk deletion
|
|
661
715
|
var deleteBulk = function () {
|
|
716
|
+
var _a;
|
|
662
717
|
var deleteList = [];
|
|
663
718
|
selectedRecords.forEach(function (element) {
|
|
664
719
|
deleteList.push(element.id);
|
|
665
720
|
});
|
|
666
721
|
deleteManySolidEntities(deleteList);
|
|
722
|
+
(_a = toast.current) === null || _a === void 0 ? void 0 : _a.show({
|
|
723
|
+
severity: 'success',
|
|
724
|
+
summary: 'Deleted',
|
|
725
|
+
detail: 'Records deleted successfully',
|
|
726
|
+
life: 3000,
|
|
727
|
+
});
|
|
667
728
|
setDialogVisible(false);
|
|
668
729
|
};
|
|
669
730
|
// handle closing of the delete dialog...
|
|
@@ -688,7 +749,9 @@ export var SolidListView = function (params) {
|
|
|
688
749
|
if (!solidView || !solidFieldsMetadata) {
|
|
689
750
|
return;
|
|
690
751
|
}
|
|
691
|
-
var currentLayout = params.customLayout
|
|
752
|
+
var currentLayout = params.customLayout
|
|
753
|
+
? params.customLayout
|
|
754
|
+
: solidView.layout;
|
|
692
755
|
return (_a = currentLayout.children) === null || _a === void 0 ? void 0 : _a.map(function (column) {
|
|
693
756
|
var _a, _b;
|
|
694
757
|
var fieldMetadata = solidFieldsMetadata[column.attrs.name];
|
|
@@ -698,29 +761,45 @@ export var SolidListView = function (params) {
|
|
|
698
761
|
var visibleToRole = ((_a = column === null || column === void 0 ? void 0 : column.attrs) === null || _a === void 0 ? void 0 : _a.roles) || [];
|
|
699
762
|
if (visibleToRole.length > 0) {
|
|
700
763
|
if (hasAnyRole((_b = user === null || user === void 0 ? void 0 : user.user) === null || _b === void 0 ? void 0 : _b.roles, visibleToRole)) {
|
|
701
|
-
return SolidListViewColumn({
|
|
764
|
+
return SolidListViewColumn({
|
|
765
|
+
solidListViewMetaData: solidListViewMetaData,
|
|
766
|
+
fieldMetadata: fieldMetadata,
|
|
767
|
+
column: column,
|
|
768
|
+
setLightboxUrls: setLightboxUrls,
|
|
769
|
+
setOpenLightbox: setOpenLightbox,
|
|
770
|
+
});
|
|
702
771
|
}
|
|
703
772
|
else {
|
|
704
773
|
return null;
|
|
705
774
|
}
|
|
706
775
|
}
|
|
707
776
|
else {
|
|
708
|
-
return SolidListViewColumn({
|
|
777
|
+
return SolidListViewColumn({
|
|
778
|
+
solidListViewMetaData: solidListViewMetaData,
|
|
779
|
+
fieldMetadata: fieldMetadata,
|
|
780
|
+
column: column,
|
|
781
|
+
setLightboxUrls: setLightboxUrls,
|
|
782
|
+
setOpenLightbox: setOpenLightbox,
|
|
783
|
+
});
|
|
709
784
|
}
|
|
710
785
|
});
|
|
711
786
|
};
|
|
712
|
-
//Note - Custom Row Action Popup
|
|
787
|
+
//Note - Custom Row Action Popup
|
|
713
788
|
var closeListViewRowActionPopup = function () {
|
|
714
789
|
setListViewRowActionPopupState(false);
|
|
715
790
|
};
|
|
716
791
|
// if (loading || isLoading) {
|
|
717
792
|
// return <SolidListViewShimmerLoading />;
|
|
718
793
|
// }
|
|
719
|
-
var viewMode = searchParams.get(
|
|
720
|
-
if ((loading || isLoading) &&
|
|
794
|
+
var viewMode = searchParams.get("viewMode");
|
|
795
|
+
if ((loading || isLoading) &&
|
|
796
|
+
params.embeded == false &&
|
|
797
|
+
viewMode !== "view") {
|
|
721
798
|
return _jsx(SolidListViewShimmerLoading, {});
|
|
722
799
|
}
|
|
723
|
-
var isListViewEmptyWithoutFilters = !loading &&
|
|
800
|
+
var isListViewEmptyWithoutFilters = !loading &&
|
|
801
|
+
(!filters || Object.keys(filters).length === 0) &&
|
|
802
|
+
listViewData.length === 0;
|
|
724
803
|
// if (isListViewEmptyWithoutFilters) {
|
|
725
804
|
// return (
|
|
726
805
|
// <SolidEmptyListViewPlaceholder
|
|
@@ -736,11 +815,11 @@ export var SolidListView = function (params) {
|
|
|
736
815
|
};
|
|
737
816
|
var handleOpenSolidXAIPanel = function () {
|
|
738
817
|
setIsOpenSolidXAiPanel(true);
|
|
739
|
-
localStorage.setItem(
|
|
818
|
+
localStorage.setItem("l_solidxai_open", "true");
|
|
740
819
|
};
|
|
741
820
|
var handleCloseSolidXAIPanel = function () {
|
|
742
821
|
setIsOpenSolidXAiPanel(false);
|
|
743
|
-
localStorage.setItem(
|
|
822
|
+
localStorage.setItem("l_solidxai_open", "false");
|
|
744
823
|
};
|
|
745
824
|
var handleDeleteEntity = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
746
825
|
var response, error_1;
|
|
@@ -758,16 +837,16 @@ export var SolidListView = function (params) {
|
|
|
758
837
|
if (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.statusCode) === 200) {
|
|
759
838
|
setDeleteEntity(false);
|
|
760
839
|
(_b = toast.current) === null || _b === void 0 ? void 0 : _b.show({
|
|
761
|
-
severity:
|
|
762
|
-
summary:
|
|
763
|
-
detail:
|
|
840
|
+
severity: "success",
|
|
841
|
+
summary: "Deleted",
|
|
842
|
+
detail: "Entity deleted successfully",
|
|
764
843
|
life: 3000,
|
|
765
844
|
});
|
|
766
845
|
}
|
|
767
846
|
else {
|
|
768
847
|
(_c = toast.current) === null || _c === void 0 ? void 0 : _c.show({
|
|
769
|
-
severity:
|
|
770
|
-
summary:
|
|
848
|
+
severity: "error",
|
|
849
|
+
summary: "Delete Failed",
|
|
771
850
|
detail: (_e = (_d = response === null || response === void 0 ? void 0 : response.error) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error,
|
|
772
851
|
life: 3000,
|
|
773
852
|
});
|
|
@@ -776,8 +855,8 @@ export var SolidListView = function (params) {
|
|
|
776
855
|
case 2:
|
|
777
856
|
error_1 = _g.sent();
|
|
778
857
|
(_f = toast.current) === null || _f === void 0 ? void 0 : _f.show({
|
|
779
|
-
severity:
|
|
780
|
-
summary:
|
|
858
|
+
severity: "error",
|
|
859
|
+
summary: "Delete Failed",
|
|
781
860
|
detail: "Something Went Wrong",
|
|
782
861
|
life: 3000,
|
|
783
862
|
});
|
|
@@ -786,113 +865,177 @@ export var SolidListView = function (params) {
|
|
|
786
865
|
}
|
|
787
866
|
});
|
|
788
867
|
}); };
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
868
|
+
var isVideoOrAudio = function (url) {
|
|
869
|
+
var _a;
|
|
870
|
+
// Remove query params if present
|
|
871
|
+
var cleanUrl = url.split("?")[0];
|
|
872
|
+
var ext = (_a = cleanUrl.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
873
|
+
var mediaExt = ["mp4", "webm", "ogg", "mov", "mp3", "wav", "m4a", "aac"];
|
|
874
|
+
return ext ? mediaExt.includes(ext) : false;
|
|
875
|
+
};
|
|
876
|
+
var controlsList = ["nodownload", "nofullscreen", "noremoteplayback"];
|
|
877
|
+
var slides = Array.isArray(lightboxUrls)
|
|
878
|
+
? lightboxUrls.map(function (item) {
|
|
879
|
+
var url = (item === null || item === void 0 ? void 0 : item.src) || (item === null || item === void 0 ? void 0 : item.downloadUrl) || "";
|
|
880
|
+
if (isVideoOrAudio(url)) {
|
|
881
|
+
return {
|
|
882
|
+
type: "video",
|
|
883
|
+
sources: [{ src: url, type: "video/mp4" }],
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
return { src: url };
|
|
887
|
+
})
|
|
888
|
+
: [];
|
|
889
|
+
var hasMedia = slides.some(function (s) { return s.type === "video"; });
|
|
890
|
+
return (_jsxs("div", { className: "page-parent-wrapper flex", children: [_jsxs("div", { className: "h-full flex-grow-1 ".concat(styles.ListContentWrapper), children: [_jsxs("div", { className: "page-header", children: [_jsx(Toast, { ref: toast }), _jsxs("div", { className: "flex gap-3 align-items-center", children: [_jsx("p", { className: "m-0 view-title", children: (_d = (_c = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _c === void 0 ? void 0 : _c.solidView) === null || _d === void 0 ? void 0 : _d.displayName }), ((_e = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _e === void 0 ? void 0 : _e.enableGlobalSearch) === true &&
|
|
891
|
+
params.embeded === false && (_jsx(SolidGlobalSearchElement, { showSaveFilterPopup: showSaveFilterPopup, setShowSaveFilterPopup: setShowSaveFilterPopup, filters: filters, clearFilter: clearFilter, ref: solidGlobalSearchElementRef, viewData: solidListViewMetaData, handleApplyCustomFilter: handleApplyCustomFilter }))] }), _jsxs("div", { className: "flex align-items-center gap-3", children: [(_h = (_g = (_f = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _f === void 0 ? void 0 : _f.headerButtons) === null || _g === void 0 ? void 0 : _g.filter(function (rb) { return rb.attrs.actionInContextMenu != true; })) === null || _h === void 0 ? void 0 : _h.map(function (button, index) { return (_jsx(SolidListViewHeaderButton, { button: button, params: params, solidListViewMetaData: solidListViewMetaData, handleCustomButtonClick: handleCustomButtonClick, selectedRecords: selectedRecords, filters: filters }, index)); }), actionsAllowed.includes("".concat(createPermission(params.modelName))) &&
|
|
892
|
+
((_j = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _j === void 0 ? void 0 : _j.create) !== false &&
|
|
893
|
+
params.embeded !== true &&
|
|
894
|
+
((_m = (_l = (_k = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _k === void 0 ? void 0 : _k.solidView) === null || _l === void 0 ? void 0 : _l.layout) === null || _m === void 0 ? void 0 : _m.attrs.showDefaultAddButton) !== false && (_jsx(SolidCreateButton, { url: createButtonUrl, solidListViewLayout: solidListViewLayout })), actionsAllowed.includes("".concat(createPermission(params.modelName))) &&
|
|
895
|
+
((_o = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _o === void 0 ? void 0 : _o.create) !== false &&
|
|
896
|
+
params.embeded == true &&
|
|
897
|
+
params.inlineCreate == true &&
|
|
898
|
+
searchParams.get("viewMode") !== "view" && (
|
|
899
|
+
// < SolidCreateButton url={createButtonUrl} />
|
|
900
|
+
_jsx(Button, { type: "button", icon: ((_p = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _p === void 0 ? void 0 : _p.addButtonIcon)
|
|
901
|
+
? (_q = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _q === void 0 ? void 0 : _q.addButtonIcon
|
|
902
|
+
: "pi pi-plus", label: ((_r = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _r === void 0 ? void 0 : _r.addButtonTitle)
|
|
903
|
+
? (_s = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _s === void 0 ? void 0 : _s.addButtonTitle
|
|
904
|
+
: "Add", className: "".concat((_t = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _t === void 0 ? void 0 : _t.addButtonClassName), size: "small", onClick: function () { return params.handlePopUpOpen("new"); } })), params.embeded !== true && (_jsx(Button, { type: "button", size: "small", icon: "pi pi-refresh", severity: "secondary", outlined: true, onClick: function () {
|
|
905
|
+
setQueryString(first, rows, sortField, sortOrder, filters, showArchived);
|
|
906
|
+
} })), showArchived && (_jsx(Button, { type: "button", icon: "pi pi-refresh", label: "Recover", size: "small", severity: "secondary", onClick: function () { return setRecoverDialogVisible(true); } })), params.embeded === false &&
|
|
907
|
+
((_u = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _u === void 0 ? void 0 : _u.configureView) !== false && (_jsx(SolidListViewConfigure, { listViewMetaData: listViewMetaData, solidListViewLayout: solidListViewLayout, setShowArchived: setShowArchived, showArchived: showArchived, viewData: solidListViewMetaData, sizeOptions: sizeOptions, setSize: setSize, size: size, viewModes: viewModes, params: params, actionsAllowed: actionsAllowed, selectedRecords: selectedRecords, setDialogVisible: setDialogVisible, setShowSaveFilterPopup: setShowSaveFilterPopup, filters: filters, handleFetchUpdatedRecords: handleFetchUpdatedRecords }))] })] }), isListViewEmptyWithoutFilters ? (_jsx(SolidEmptyListViewPlaceholder, { createButtonUrl: createButtonUrl, actionsAllowed: actionsAllowed, params: params, solidListViewMetaData: solidListViewMetaData })) : (_jsx("div", { className: "solid-datatable-wrapper", children: _jsxs(DataTable, { value: listViewData, rowClassName: function (rowData) {
|
|
908
|
+
return rowData.deletedAt ? "greyed-out-row" : "";
|
|
909
|
+
}, showGridlines: false, lazy: true, scrollable: true,
|
|
910
|
+
// scrollHeight="90vh"
|
|
911
|
+
size: size, resizableColumns: true, paginator: true, rows: rows, rowsPerPageOptions: (_v = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _v === void 0 ? void 0 : _v.pageSizeOptions, dataKey: "id", emptyMessage: ((_y = (_x = (_w = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _w === void 0 ? void 0 : _w.solidView) === null || _x === void 0 ? void 0 : _x.model) === null || _y === void 0 ? void 0 : _y.description) ||
|
|
912
|
+
"No Entities found.", filterDisplay: "menu", totalRecords: totalRecords, first: first, onPage: onPageChange, onSort: function (e) { return onSort(e); }, sortField: sortField, sortOrder: sortOrder === 1 || sortOrder === -1 ? sortOrder : 0, loading: false,
|
|
913
|
+
// loading={loading || isLoading}
|
|
914
|
+
// loadingIcon="pi pi-spinner"
|
|
915
|
+
selection: params.embeded === true
|
|
916
|
+
? null
|
|
917
|
+
: __spreadArray(__spreadArray([], selectedRecords, true), selectedRecoverRecords, true), onSelectionChange: params.embeded === true ? undefined : onSelectionChange, selectionMode: params.embeded === true ? null : "checkbox", removableSort: true, filterIcon: _jsx(FilterIcon, {}), tableClassName: "solid-data-table", paginatorClassName: "solid-paginator", paginatorTemplate: "RowsPerPageDropdown CurrentPageReport PrevPageLink NextPageLink", currentPageReportTemplate: "{first} - {last} of {totalRecords}", onRowClick: function (e) {
|
|
918
|
+
var _a;
|
|
919
|
+
var rowData = e.data;
|
|
920
|
+
if ((solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs.disableRowClick) === true)
|
|
921
|
+
return;
|
|
922
|
+
var hasFindPermission = actionsAllowed.includes(findPermission(params.modelName));
|
|
923
|
+
var hasUpdatePermission = actionsAllowed.includes(updatePermission(params.modelName)) &&
|
|
924
|
+
((_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.edit) !== false;
|
|
925
|
+
if (!(hasFindPermission || hasUpdatePermission))
|
|
926
|
+
return;
|
|
927
|
+
if (params.embeded === true) {
|
|
928
|
+
params.handlePopUpOpen(rowData === null || rowData === void 0 ? void 0 : rowData.id);
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
if (typeof window !== "undefined") {
|
|
932
|
+
sessionStorage.setItem("fromView", "list");
|
|
933
|
+
}
|
|
934
|
+
router.push("".concat(editButtonUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=view"));
|
|
935
|
+
}
|
|
936
|
+
}, children: [params.embeded === true ? null : (_jsx(Column, { selectionMode: "multiple", headerStyle: { width: "3em" } })), renderColumnsDynamically(listViewMetaData), ((_z = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _z === void 0 ? void 0 : _z.rowButtons) &&
|
|
937
|
+
((_0 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _0 === void 0 ? void 0 : _0.rowButtons.filter(function (rb) {
|
|
938
|
+
var _a, _b;
|
|
939
|
+
var roles = ((_a = rb === null || rb === void 0 ? void 0 : rb.attrs) === null || _a === void 0 ? void 0 : _a.roles) || [];
|
|
940
|
+
var isInContextMenu = rb.attrs.actionInContextMenu === true;
|
|
941
|
+
// Only check hasAnyRole if roles are provided
|
|
942
|
+
var isAllowed = roles.length === 0 ||
|
|
943
|
+
hasAnyRole((_b = user === null || user === void 0 ? void 0 : user.user) === null || _b === void 0 ? void 0 : _b.roles, roles);
|
|
944
|
+
return !isInContextMenu && isAllowed;
|
|
945
|
+
}).map(function (button, index) {
|
|
946
|
+
// const hasRole = button.attrs.roles && button.attrs.roles.length > 0 ? useHasAnyRole(button.attrs.roles) : true;
|
|
947
|
+
// if (!hasRole) return null;
|
|
948
|
+
return (_jsx(Column, { header: button.attrs.label, body: function (rowData) {
|
|
949
|
+
var _a, _b, _c, _d;
|
|
950
|
+
return (_jsx(Button, { type: "button", icon: ((_a = button === null || button === void 0 ? void 0 : button.attrs) === null || _a === void 0 ? void 0 : _a.icon)
|
|
951
|
+
? (_b = button === null || button === void 0 ? void 0 : button.attrs) === null || _b === void 0 ? void 0 : _b.icon
|
|
952
|
+
: "pi pi-pencil", className: "w-full text-left gap-2 ".concat(((_c = button === null || button === void 0 ? void 0 : button.attrs) === null || _c === void 0 ? void 0 : _c.className)
|
|
953
|
+
? (_d = button === null || button === void 0 ? void 0 : button.attrs) === null || _d === void 0 ? void 0 : _d.className
|
|
954
|
+
: ""), label: button.attrs.showLabel !== false
|
|
955
|
+
? button.attrs.label
|
|
956
|
+
: "", size: "small", iconPos: "left", onClick: function () {
|
|
957
|
+
var event = {
|
|
958
|
+
params: params,
|
|
959
|
+
rowData: rowData,
|
|
960
|
+
solidListViewMetaData: solidListViewMetaData.data,
|
|
961
|
+
};
|
|
962
|
+
handleCustomButtonClick(button.attrs, event);
|
|
963
|
+
} }));
|
|
964
|
+
} }, index));
|
|
965
|
+
})), actionsAllowed.includes("".concat(updatePermission(params.modelName))) &&
|
|
966
|
+
((_1 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _1 === void 0 ? void 0 : _1.edit) !== false &&
|
|
967
|
+
((_2 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _2 === void 0 ? void 0 : _2.showRowEditInContextMenu) ===
|
|
968
|
+
false && (_jsx(Column, { header: "Edit", body: function (rowData) {
|
|
969
|
+
return (_jsx(Button, { text: true, type: "button", severity: "secondary", className: "", label: "", size: "small", iconPos: "left", icon: "pi pi-pencil", onClick: function () {
|
|
970
|
+
if (params.embeded == true) {
|
|
971
|
+
params.handlePopUpOpen(rowData === null || rowData === void 0 ? void 0 : rowData.id);
|
|
972
|
+
}
|
|
973
|
+
else {
|
|
974
|
+
router.push("".concat(editButtonUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=edit"));
|
|
975
|
+
}
|
|
976
|
+
} }));
|
|
977
|
+
} })), actionsAllowed.includes("".concat(deletePermission(params.modelName))) &&
|
|
978
|
+
((_3 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _3 === void 0 ? void 0 : _3.delete) !== false &&
|
|
979
|
+
((_4 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _4 === void 0 ? void 0 : _4.showRowDeleteInContextMenu) ===
|
|
980
|
+
false && (_jsx(Column, { header: "Delete", body: function (rowData) {
|
|
981
|
+
return (_jsx(Button, { text: true, type: "button", className: "", size: "small", iconPos: "left", severity: "danger", icon: "pi pi-trash", onClick: function () {
|
|
982
|
+
setSelectedSolidViewData(rowData);
|
|
983
|
+
setDeleteEntity(true);
|
|
984
|
+
} }));
|
|
985
|
+
} })), actionsAllowed.includes("".concat(updatePermission(params.modelName))) &&
|
|
986
|
+
((_5 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _5 === void 0 ? void 0 : _5.edit) !== false && (_jsx(Column, { frozen: true, alignFrozen: "right", body: function (rowData) {
|
|
987
|
+
var _a, _b, _c, _d;
|
|
988
|
+
return (rowData === null || rowData === void 0 ? void 0 : rowData.deletedAt) ? (_jsx("a", { onClick: function (event) {
|
|
989
|
+
event.stopPropagation();
|
|
990
|
+
recoverById(rowData.id);
|
|
991
|
+
}, className: "retrieve-button", children: _jsx("i", { className: "pi pi-refresh", style: { fontSize: "1rem" } }) })) : (_jsx(_Fragment, { children: ((_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.showRowContextMenu) !==
|
|
992
|
+
false && (_jsxs(_Fragment, { children: [detailsBodyTemplate(rowData), _jsx(OverlayPanel, { ref: op, className: "solid-custom-overlay", style: { top: 10, minWidth: 120 }, children: _jsxs("div", { className: "flex flex-column gap-1 p-1", children: [(solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs.showDefaultEditButton) !== false &&
|
|
993
|
+
(solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs.showRowEditInContextMenu) !== false && (_jsx(Button, { type: "button", className: "w-full text-left gap-1", label: "Edit", size: "small", iconPos: "left", icon: "pi pi-pencil", onClick: function () {
|
|
994
|
+
if (params.embeded == true) {
|
|
995
|
+
params.handlePopUpOpen(selectedSolidViewData === null || selectedSolidViewData === void 0 ? void 0 : selectedSolidViewData.id);
|
|
996
|
+
}
|
|
997
|
+
else {
|
|
998
|
+
router.push("".concat(editButtonUrl, "/").concat(selectedSolidViewData === null || selectedSolidViewData === void 0 ? void 0 : selectedSolidViewData.id, "?viewMode=edit"));
|
|
999
|
+
}
|
|
1000
|
+
} })), actionsAllowed.includes("".concat(deletePermission(params.modelName))) &&
|
|
1001
|
+
((_b = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _b === void 0 ? void 0 : _b.delete) !==
|
|
1002
|
+
false &&
|
|
1003
|
+
(solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs.showRowDeleteInContextMenu) !== false && (_jsx(Button, { text: true, type: "button", className: "w-full text-left gap-1", label: "Delete", size: "small", iconPos: "left", severity: "danger", icon: "pi pi-trash", onClick: function () { return setDeleteEntity(true); } })), (_d = (_c = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _c === void 0 ? void 0 : _c.rowButtons) === null || _d === void 0 ? void 0 : _d.filter(function (rb) {
|
|
1004
|
+
return rb.attrs.actionInContextMenu === true;
|
|
1005
|
+
}).map(function (button, index) { return (_jsx(SolidListViewRowButtonContextMenu, { button: button, params: params, selectedSolidViewData: selectedSolidViewData, solidListViewMetaData: solidListViewMetaData, handleCustomButtonClick: handleCustomButtonClick }, index)); })] }) })] })) }));
|
|
1006
|
+
} }))] }) }))] }), process.env.NEXT_PUBLIC_ENABLE_SOLIDX_AI === "true" &&
|
|
1007
|
+
params.embeded !== true && (_jsxs("div", { className: "chatter-section ".concat(isOpenSolidXAiPanel === false ? "collapsed" : ""), style: { width: chatterWidth }, children: [isOpenSolidXAiPanel && (_jsx("div", { style: {
|
|
881
1008
|
width: 5,
|
|
882
|
-
cursor:
|
|
883
|
-
position:
|
|
1009
|
+
cursor: "col-resize",
|
|
1010
|
+
position: "absolute",
|
|
884
1011
|
left: 0,
|
|
885
1012
|
top: 0,
|
|
886
1013
|
bottom: 0,
|
|
887
|
-
height:
|
|
1014
|
+
height: "100%",
|
|
888
1015
|
zIndex: 9,
|
|
889
|
-
}, onMouseDown: function () { return setIsResizing(true); } })), isOpenSolidXAiPanel &&
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1016
|
+
}, onMouseDown: function () { return setIsResizing(true); } })), isOpenSolidXAiPanel && (_jsx(Button, { icon: "pi pi-angle-double-right", size: "small", text: true, className: "chatter-collapse-btn", style: { width: 30, height: 30, aspectRatio: "1/1" }, onClick: handleCloseSolidXAIPanel })), isOpenSolidXAiPanel === false ? (_jsxs("div", { className: "flex flex-column gap-2 justify-content-center p-2", children: [_jsx("div", { className: "chatter-collapsed-content", onClick: handleOpenSolidXAIPanel, children: _jsxs("div", { className: "flex gap-2", children: [" ", _jsx(SolidXAIIcon, {}), " SolidX AI", " "] }) }), _jsx(Button, { icon: "pi pi-chevron-left", size: "small", className: "px-0", style: { width: 30 }, onClick: handleOpenSolidXAIPanel })] })) : (_jsx(SolidXAIModule, { showHeader: true, inListView: true }))] })), _jsxs(Dialog, { visible: isDialogVisible, header: "Confirm Delete", onHide: function () { return setDialogVisible(false); }, headerClassName: "py-2", contentClassName: "px-0 pb-0", style: { width: '20vw' }, children: [_jsx(Divider, { className: "m-0" }), _jsxs("div", { className: "p-4", children: [_jsx("p", { className: "m-0 solid-primary-title", style: { fontSize: 16 }, children: "Are you sure you want to delete the selected records?" }), _jsxs("div", { className: "flex align-items-center gap-2 mt-3", children: [_jsx(Button, { label: "Delete", severity: "danger", size: "small", onClick: handleDeleteEntity, autoFocus: true, onClick: deleteBulk }), _jsx(Button, { label: "Cancel", size: "small", onClick: onDeleteClose, outlined: true, className: 'bg-primary-reverse' })] })] })] }), _jsx(Dialog, { visible: isRecoverDialogVisible, header: "Confirm Recover", modal: true, footer: function () { return (_jsxs("div", { className: "flex justify-content-center", children: [_jsx(Button, { label: "Yes", icon: "pi pi-check", severity: "danger", autoFocus: true, onClick: recoverAll }), _jsx(Button, { label: "No", icon: "pi pi-times", onClick: function () { return setRecoverDialogVisible(false); } })] })); }, onHide: function () { return setRecoverDialogVisible(false); }, children: _jsx("p", { children: "Are you sure you want to recover all records?" }) }), listViewRowActionData && (_jsx(Dialog, { visible: listViewRowActionPopupState, modal: true, onHide: closeListViewRowActionPopup, children: _jsx(ListViewRowActionPopup, { context: listViewRowActionData }) })), _jsxs(Dialog, { header: "Delete ".concat(((_8 = (_7 = (_6 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _6 === void 0 ? void 0 : _6.solidView) === null || _7 === void 0 ? void 0 : _7.model) === null || _8 === void 0 ? void 0 : _8.displayName)
|
|
1017
|
+
? (_11 = (_10 = (_9 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _9 === void 0 ? void 0 : _9.solidView) === null || _10 === void 0 ? void 0 : _10.model) === null || _11 === void 0 ? void 0 : _11.displayName
|
|
1018
|
+
: params === null || params === void 0 ? void 0 : params.modelName), headerClassName: "py-2", contentClassName: "px-0 pb-0", visible: deleteEntity, style: { width: "20vw" }, onHide: function () {
|
|
1019
|
+
if (!deleteEntity)
|
|
1020
|
+
return;
|
|
1021
|
+
setDeleteEntity(false);
|
|
1022
|
+
}, children: [_jsx(Divider, { className: "m-0" }), _jsxs("div", { className: "p-4", children: [_jsx("p", { className: "m-0 solid-primary-title", style: { fontSize: 16 }, children: "Are you sure you want to delete this ".concat(((_14 = (_13 = (_12 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _12 === void 0 ? void 0 : _12.solidView) === null || _13 === void 0 ? void 0 : _13.model) === null || _14 === void 0 ? void 0 : _14.displayName)
|
|
1023
|
+
? (_17 = (_16 = (_15 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _15 === void 0 ? void 0 : _15.solidView) === null || _16 === void 0 ? void 0 : _16.model) === null || _17 === void 0 ? void 0 : _17.displayName
|
|
1024
|
+
: params === null || params === void 0 ? void 0 : params.modelName, "?") }), _jsxs("div", { className: "flex align-items-center gap-2 mt-3", children: [_jsx(Button, { label: "Delete", severity: "danger", size: "small", onClick: handleDeleteEntity }), _jsx(Button, { label: "Cancel", size: "small", onClick: function () { return setDeleteEntity(false); }, outlined: true, className: 'bg-primary-reverse' })] })] })] }), openLightbox && (_jsx(Lightbox, __assign({ open: openLightbox, plugins: hasMedia
|
|
1025
|
+
? [Counter, Download, Video] // add Video plugin if needed
|
|
1026
|
+
: [Counter, Download], close: function () { return setOpenLightbox(false); }, slides: __spreadArray([], slides, true) }, (hasMedia && {
|
|
1027
|
+
video: {
|
|
1028
|
+
controls: true,
|
|
1029
|
+
playsInline: true,
|
|
1030
|
+
autoPlay: false,
|
|
1031
|
+
loop: false,
|
|
1032
|
+
muted: false,
|
|
1033
|
+
disablePictureInPicture: false,
|
|
1034
|
+
disableRemotePlayback: false,
|
|
1035
|
+
controlsList: controlsList.join(" "),
|
|
1036
|
+
crossOrigin: "anonymous",
|
|
1037
|
+
preload: "auto",
|
|
1038
|
+
},
|
|
1039
|
+
}))))] }));
|
|
897
1040
|
};
|
|
898
1041
|
//# sourceMappingURL=SolidListView.js.map
|