@solidstarters/solid-core-ui 1.1.205 → 1.1.206

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.
Files changed (148) hide show
  1. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  2. package/dist/components/auth/SolidLogin.js +1 -1
  3. package/dist/components/auth/SolidLogin.js.map +1 -1
  4. package/dist/components/common/GeneralSettings.d.ts.map +1 -1
  5. package/dist/components/common/GeneralSettings.js +3 -1
  6. package/dist/components/common/GeneralSettings.js.map +1 -1
  7. package/dist/components/core/chatter/SolidChatter.d.ts +2 -1
  8. package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -1
  9. package/dist/components/core/chatter/SolidChatter.js +11 -10
  10. package/dist/components/core/chatter/SolidChatter.js.map +1 -1
  11. package/dist/components/core/common/PDFViewer.d.ts +4 -0
  12. package/dist/components/core/common/PDFViewer.d.ts.map +1 -0
  13. package/dist/components/core/common/PDFViewer.js +99 -0
  14. package/dist/components/core/common/PDFViewer.js.map +1 -0
  15. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  16. package/dist/components/core/common/SolidGlobalSearchElement.js +34 -9
  17. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  18. package/dist/components/core/common/SolidViewLayoutManager.d.ts +152 -0
  19. package/dist/components/core/common/SolidViewLayoutManager.d.ts.map +1 -1
  20. package/dist/components/core/common/SolidViewLayoutManager.js +254 -7
  21. package/dist/components/core/common/SolidViewLayoutManager.js.map +1 -1
  22. package/dist/components/core/common/SolidXAiIframe.d.ts +7 -0
  23. package/dist/components/core/common/SolidXAiIframe.d.ts.map +1 -0
  24. package/dist/components/core/common/SolidXAiIframe.js +94 -0
  25. package/dist/components/core/common/SolidXAiIframe.js.map +1 -0
  26. package/dist/components/core/dashboard/SolidDashboard.d.ts.map +1 -1
  27. package/dist/components/core/dashboard/SolidDashboard.js +7 -4
  28. package/dist/components/core/dashboard/SolidDashboard.js.map +1 -1
  29. package/dist/components/core/dashboard/SolidDashboardFilterRequired.d.ts +2 -0
  30. package/dist/components/core/dashboard/SolidDashboardFilterRequired.d.ts.map +1 -0
  31. package/dist/components/core/dashboard/SolidDashboardFilterRequired.js +6 -0
  32. package/dist/components/core/dashboard/SolidDashboardFilterRequired.js.map +1 -0
  33. package/dist/components/core/dashboard/SolidDashboardLoading.d.ts +2 -0
  34. package/dist/components/core/dashboard/SolidDashboardLoading.d.ts.map +1 -0
  35. package/dist/components/core/dashboard/SolidDashboardLoading.js +7 -0
  36. package/dist/components/core/dashboard/SolidDashboardLoading.js.map +1 -0
  37. package/dist/components/core/dashboard/SolidDashboardRenderError.d.ts +2 -0
  38. package/dist/components/core/dashboard/SolidDashboardRenderError.d.ts.map +1 -0
  39. package/dist/components/core/dashboard/SolidDashboardRenderError.js +6 -0
  40. package/dist/components/core/dashboard/SolidDashboardRenderError.js.map +1 -0
  41. package/dist/components/core/dashboard/SolidDashboardVariable.js +3 -1
  42. package/dist/components/core/dashboard/SolidDashboardVariable.js.map +1 -1
  43. package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.d.ts +8 -0
  44. package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.d.ts.map +1 -0
  45. package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.js +7 -0
  46. package/dist/components/core/extension/solid-core/CustomIcon/StatusIcon.js.map +1 -0
  47. package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
  48. package/dist/components/core/form/SolidFormActionHeader.js +8 -5
  49. package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
  50. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  51. package/dist/components/core/form/SolidFormView.js +33 -28
  52. package/dist/components/core/form/SolidFormView.js.map +1 -1
  53. package/dist/components/core/form/fields/SolidDateField.d.ts +2 -1
  54. package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
  55. package/dist/components/core/form/fields/SolidDateField.js +7 -0
  56. package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
  57. package/dist/components/core/form/fields/SolidDecimalField.js +1 -1
  58. package/dist/components/core/form/fields/SolidEmailField.js +1 -1
  59. package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
  60. package/dist/components/core/form/fields/SolidIntegerField.js +7 -1
  61. package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
  62. package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
  63. package/dist/components/core/form/fields/SolidLongTextField.js +3 -3
  64. package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
  65. package/dist/components/core/form/fields/SolidPasswordField.js +1 -1
  66. package/dist/components/core/form/fields/SolidRichTextField.js +1 -1
  67. package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
  68. package/dist/components/core/form/fields/SolidShortTextField.js +87 -26
  69. package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
  70. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +10 -1
  71. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  72. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +374 -18
  73. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  74. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts +16 -2
  75. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
  76. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +131 -34
  77. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
  78. package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.d.ts +6 -0
  79. package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.d.ts.map +1 -0
  80. package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js +164 -0
  81. package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js.map +1 -0
  82. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  83. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  84. package/dist/components/core/list/SolidListView.js +177 -119
  85. package/dist/components/core/list/SolidListView.js.map +1 -1
  86. package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts +1 -0
  87. package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts.map +1 -1
  88. package/dist/components/core/locales/SolidChatterLocaleTabView.js +5 -5
  89. package/dist/components/core/locales/SolidChatterLocaleTabView.js.map +1 -1
  90. package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
  91. package/dist/components/core/locales/SolidLocale.js +9 -8
  92. package/dist/components/core/locales/SolidLocale.js.map +1 -1
  93. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  94. package/dist/components/core/model/FieldMetaDataForm.js +32 -31
  95. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  96. package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
  97. package/dist/components/core/model/ModelMetaData.js +12 -5
  98. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  99. package/dist/components/core/solid-ai/SolidAiMainWrapper.d.ts +2 -0
  100. package/dist/components/core/solid-ai/SolidAiMainWrapper.d.ts.map +1 -0
  101. package/dist/components/core/solid-ai/SolidAiMainWrapper.js +20 -0
  102. package/dist/components/core/solid-ai/SolidAiMainWrapper.js.map +1 -0
  103. package/dist/components/core/solid-ai/SolidXAIInputBox.d.ts +3 -1
  104. package/dist/components/core/solid-ai/SolidXAIInputBox.d.ts.map +1 -1
  105. package/dist/components/core/solid-ai/SolidXAIInputBox.js +31 -14
  106. package/dist/components/core/solid-ai/SolidXAIInputBox.js.map +1 -1
  107. package/dist/components/core/solid-ai/SolidXAIModule.d.ts +1 -1
  108. package/dist/components/core/solid-ai/SolidXAIModule.d.ts.map +1 -1
  109. package/dist/components/core/solid-ai/SolidXAIModule.js +24 -33
  110. package/dist/components/core/solid-ai/SolidXAIModule.js.map +1 -1
  111. package/dist/components/core/solid-ai/SolidXAIResponse.d.ts.map +1 -1
  112. package/dist/components/core/solid-ai/SolidXAIResponse.js +5 -4
  113. package/dist/components/core/solid-ai/SolidXAIResponse.js.map +1 -1
  114. package/dist/components/core/solid-ai/SolidXAIThreadWrapper.d.ts +1 -0
  115. package/dist/components/core/solid-ai/SolidXAIThreadWrapper.d.ts.map +1 -1
  116. package/dist/components/core/solid-ai/SolidXAIThreadWrapper.js +140 -40
  117. package/dist/components/core/solid-ai/SolidXAIThreadWrapper.js.map +1 -1
  118. package/dist/components/core/solid-ai/SolidXAiJsonDisplay.js +1 -1
  119. package/dist/components/core/solid-ai/SolidXAiJsonDisplay.js.map +1 -1
  120. package/dist/components/core/solid-ai/SolidXAiPlainTextDisplay.js +9 -10
  121. package/dist/components/core/solid-ai/SolidXAiPlainTextDisplay.js.map +1 -1
  122. package/dist/components/core/solid-ai/SolidXAiStatusErrorDisplay.d.ts +7 -0
  123. package/dist/components/core/solid-ai/SolidXAiStatusErrorDisplay.d.ts.map +1 -0
  124. package/dist/components/core/solid-ai/SolidXAiStatusErrorDisplay.js +7 -0
  125. package/dist/components/core/solid-ai/SolidXAiStatusErrorDisplay.js.map +1 -0
  126. package/dist/components/core/solid-ai/SolidXUserPrompt.js +1 -1
  127. package/dist/components/core/solid-ai/SolidXUserPrompt.js.map +1 -1
  128. package/dist/components/layout/AdminLayout.d.ts.map +1 -1
  129. package/dist/components/layout/AdminLayout.js +10 -57
  130. package/dist/components/layout/AdminLayout.js.map +1 -1
  131. package/dist/helpers/registry.d.ts.map +1 -1
  132. package/dist/helpers/registry.js +8 -3
  133. package/dist/helpers/registry.js.map +1 -1
  134. package/dist/redux/api/fieldApi.d.ts +2 -1
  135. package/dist/redux/api/fieldApi.d.ts.map +1 -1
  136. package/dist/redux/api/fieldApi.js +8 -1
  137. package/dist/redux/api/fieldApi.js.map +1 -1
  138. package/dist/redux/api/solidEntityApi.d.ts +2 -0
  139. package/dist/redux/api/solidEntityApi.d.ts.map +1 -1
  140. package/dist/redux/api/solidEntityApi.js +20 -0
  141. package/dist/redux/api/solidEntityApi.js.map +1 -1
  142. package/dist/redux/store/defaultStoreConfig.d.ts +1 -0
  143. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  144. package/dist/resources/globals.css +22 -2
  145. package/dist/types/solid-core.d.ts +30 -8
  146. package/package.json +4 -4
  147. package/src/resources/globals.css +22 -2
  148. package/src/types/solid-core.d.ts +30 -8
@@ -97,11 +97,11 @@ import { SolidListViewHeaderButton } from "./SolidListViewHeaderButton";
97
97
  import { SolidListViewRowButtonContextMenu } from "./SolidListViewRowButtonContextMenu";
98
98
  import { useSelector } from "react-redux";
99
99
  import styles from "./SolidListViewWrapper.module.css";
100
- import { SolidXAIModule } from "../solid-ai/SolidXAIModule";
101
100
  import { SolidXAIIcon } from "../solid-ai/SolidXAIIcon";
102
101
  import { getExtensionFunction } from "../../../helpers/registry";
103
102
  import { useSession } from "next-auth/react";
104
103
  import { ERROR_MESSAGES } from "../../../constants/error-messages";
104
+ import { SolidAiMainWrapper } from "../solid-ai/SolidAiMainWrapper";
105
105
  // import { ERROR_MESSAGES } from "../../../constants/error-messages";
106
106
  var getRandomInt = function (min, max) {
107
107
  return Math.floor(Math.random() * (max - min + 1)) + min;
@@ -138,7 +138,7 @@ export var SolidListView = function (params) {
138
138
  var searchParams = useSearchParams(); // Converts the query params to a string
139
139
  var localeName = searchParams.get("locale");
140
140
  // TODO: The initial filter state will be created based on the fields which are present on this list view.
141
- var _18 = useState(params.customFilter || null), filters = _18[0], setFilters = _18[1];
141
+ var _18 = useState(params.customFilter || { $and: [] }), filters = _18[0], setFilters = _18[1];
142
142
  // const [customFilter, setCustomFilter] = useState<FilterRule[]>(initialState);
143
143
  // const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
144
144
  var _19 = useState([]), toPopulate = _19[0], setToPopulate = _19[1];
@@ -182,7 +182,6 @@ export var SolidListView = function (params) {
182
182
  }
183
183
  }, [isResizing]);
184
184
  useEffect(function () {
185
- console.log("useEffect: [params.modelName]");
186
185
  var fetchPermissions = function () { return __awaiter(void 0, void 0, void 0, function () {
187
186
  var permissionNames, queryData, queryString, response;
188
187
  return __generator(this, function (_a) {
@@ -223,17 +222,26 @@ export var SolidListView = function (params) {
223
222
  // Create the RTK slices for this entity
224
223
  var entityApi = createSolidEntityApi(params.modelName);
225
224
  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;
225
+ var menuItemId = searchParams.get("menuItemId");
226
+ var menuItemName = searchParams.get("menuItemName");
227
+ var actionId = searchParams.get("actionId");
228
+ var actionName = searchParams.get("actionName");
226
229
  // Get the list view layout & metadata first.
227
230
  var listViewMetaDataQs = qs.stringify({
228
231
  modelName: params.modelName,
229
232
  moduleName: params.moduleName,
230
233
  viewType: "list",
234
+ menuItemId: menuItemId,
235
+ menuItemName: menuItemName,
236
+ actionId: actionId,
237
+ actionName: actionName,
231
238
  }, {
232
239
  encodeValuesOnly: true,
233
240
  });
234
- var _25 = useState({}), solidListViewMetaData = _25[0], setSolidListViewMetaData = _25[1];
235
- var _26 = useState({}), solidListViewLayout = _26[0], setSolidListViewLayout = _26[1];
236
- var _27 = useGetSolidViewLayoutQuery(listViewMetaDataQs), solidListViewInitialMetaData = _27.data, solidListViewMetaDataError = _27.error, solidListViewMetaDataIsLoading = _27.isLoading, solidListViewMetaDataIsError = _27.isError, refetch = _27.refetch;
241
+ var _25 = useState(null), solidListViewMetaData = _25[0], setSolidListViewMetaData = _25[1];
242
+ var _26 = useState(null), solidListViewLayout = _26[0], setSolidListViewLayout = _26[1];
243
+ var _27 = useState(false), isDraftPublishWorkflowEnabled = _27[0], setIsDraftPublishWorkflowEnabled = _27[1];
244
+ var _28 = useGetSolidViewLayoutQuery(listViewMetaDataQs), solidListViewInitialMetaData = _28.data, solidListViewMetaDataError = _28.error, solidListViewMetaDataIsLoading = _28.isLoading, solidListViewMetaDataIsError = _28.isError, refetch = _28.refetch;
237
245
  var initialFilterMethod = function () {
238
246
  var _a, _b, _c, _d;
239
247
  var solidView = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView;
@@ -313,7 +321,7 @@ export var SolidListView = function (params) {
313
321
  };
314
322
  // Set the initial filter state based on the metadata.
315
323
  useEffect(function () {
316
- console.log("useEffect: [solidListViewMetaData] line no 227");
324
+ var _a, _b, _c;
317
325
  // refetch();
318
326
  if (solidListViewInitialMetaData) {
319
327
  if (params.customLayout) {
@@ -323,13 +331,13 @@ export var SolidListView = function (params) {
323
331
  setSolidListViewLayout(solidListViewInitialMetaData === null || solidListViewInitialMetaData === void 0 ? void 0 : solidListViewInitialMetaData.data.solidView.layout);
324
332
  }
325
333
  setSolidListViewMetaData(solidListViewInitialMetaData);
334
+ setIsDraftPublishWorkflowEnabled(((_c = (_b = (_a = solidListViewInitialMetaData === null || solidListViewInitialMetaData === void 0 ? void 0 : solidListViewInitialMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.model) === null || _c === void 0 ? void 0 : _c.draftPublishWorkflow) === true);
326
335
  // initialFilterMethod()
327
336
  }
328
337
  }, [solidListViewInitialMetaData]);
329
338
  // set layout and actions for create and edit buttons and view modes
330
339
  useEffect(function () {
331
340
  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;
332
- console.log("useEffect: [solidListViewMetaData] line no 245");
333
341
  if (solidListViewMetaData) {
334
342
  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) &&
335
343
  ((_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"
@@ -354,25 +362,25 @@ export var SolidListView = function (params) {
354
362
  }
355
363
  }, [solidListViewMetaData]);
356
364
  // All list view state.
357
- var _28 = useState([]), listViewData = _28[0], setListViewData = _28[1];
358
- var _29 = useState(0), first = _29[0], setFirst = _29[1];
359
- var _30 = useState(((_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.defaultPageSize)
365
+ var _29 = useState([]), listViewData = _29[0], setListViewData = _29[1];
366
+ var _30 = useState(0), first = _30[0], setFirst = _30[1];
367
+ var _31 = useState(((_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.defaultPageSize)
360
368
  ? (_b = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _b === void 0 ? void 0 : _b.defaultPageSize
361
- : 10), rows = _30[0], setRows = _30[1];
362
- var _31 = useState(0), totalRecords = _31[0], setTotalRecords = _31[1];
363
- var _32 = useState(""), sortField = _32[0], setSortField = _32[1];
364
- var _33 = useState(0), sortOrder = _33[0], setSortOrder = _33[1];
365
- var _34 = useState([]), selectedRecords = _34[0], setSelectedRecords = _34[1];
366
- var _35 = useState([]), selectedRecoverRecords = _35[0], setSelectedRecoverRecords = _35[1];
367
- var _36 = useState(true), loading = _36[0], setLoading = _36[1];
368
- var _37 = useState(false), isDialogVisible = _37[0], setDialogVisible = _37[1];
369
- var _38 = useState(false), isRecoverDialogVisible = _38[0], setRecoverDialogVisible = _38[1];
370
- var _39 = useState(), createButtonUrl = _39[0], setCreateButtonUrl = _39[1];
371
- var _40 = useState(), editButtonUrl = _40[0], setEditButtonUrl = _40[1];
372
- var _41 = useState(false), showArchived = _41[0], setShowArchived = _41[1];
373
- var _42 = useState(false), queryDataLoaded = _42[0], setQueryDataLoaded = _42[1];
374
- var _43 = useState(null), customFilter = _43[0], setCustomFilter = _43[1];
375
- var _44 = useState(false), showSaveFilterPopup = _44[0], setShowSaveFilterPopup = _44[1];
369
+ : 10), rows = _31[0], setRows = _31[1];
370
+ var _32 = useState(0), totalRecords = _32[0], setTotalRecords = _32[1];
371
+ var _33 = useState(""), sortField = _33[0], setSortField = _33[1];
372
+ var _34 = useState(0), sortOrder = _34[0], setSortOrder = _34[1];
373
+ var _35 = useState([]), selectedRecords = _35[0], setSelectedRecords = _35[1];
374
+ var _36 = useState([]), selectedRecoverRecords = _36[0], setSelectedRecoverRecords = _36[1];
375
+ var _37 = useState(true), loading = _37[0], setLoading = _37[1];
376
+ var _38 = useState(false), isDialogVisible = _38[0], setDialogVisible = _38[1];
377
+ var _39 = useState(false), isRecoverDialogVisible = _39[0], setRecoverDialogVisible = _39[1];
378
+ var _40 = useState(), createButtonUrl = _40[0], setCreateButtonUrl = _40[1];
379
+ var _41 = useState(), editButtonUrl = _41[0], setEditButtonUrl = _41[1];
380
+ var _42 = useState(false), showArchived = _42[0], setShowArchived = _42[1];
381
+ var _43 = useState(false), queryDataLoaded = _43[0], setQueryDataLoaded = _43[1];
382
+ var _44 = useState(null), customFilter = _44[0], setCustomFilter = _44[1];
383
+ var _45 = useState(false), showSaveFilterPopup = _45[0], setShowSaveFilterPopup = _45[1];
376
384
  var sizeOptions = [
377
385
  { label: "Compact", value: "small", image: CompactImage },
378
386
  { label: "Cozy", value: "normal", image: CozyImage },
@@ -382,19 +390,18 @@ export var SolidListView = function (params) {
382
390
  // { label: 'List ', value: 'list', image: ListImage },
383
391
  // { label: 'Kanban', value: 'kanban', image: KanbanImage },
384
392
  // ]
385
- var _45 = useState(sizeOptions[1].value), size = _45[0], setSize = _45[1];
386
- var _46 = useState([]), viewModes = _46[0], setViewModes = _46[1];
393
+ var _46 = useState(sizeOptions[1].value), size = _46[0], setSize = _46[1];
394
+ var _47 = useState([]), viewModes = _47[0], setViewModes = _47[1];
387
395
  // Custom Row Action
388
- var _47 = useState(false), listViewRowActionPopupState = _47[0], setListViewRowActionPopupState = _47[1];
389
- var _48 = useState(), listViewRowActionData = _48[0], setListRowActionData = _48[1];
396
+ var _48 = useState(false), listViewRowActionPopupState = _48[0], setListViewRowActionPopupState = _48[1];
397
+ var _49 = useState(), listViewRowActionData = _49[0], setListRowActionData = _49[1];
390
398
  var toast = useRef(null);
391
399
  // Get the list view data.
392
- var _49 = useLazyGetSolidEntitiesQuery(), triggerGetSolidEntities = _49[0], _50 = _49[1], solidEntityListViewData = _50.data, isLoading = _50.isLoading, error = _50.error;
393
- var _51 = useLazyRecoverSolidEntityByIdQuery(), triggerRecoverSolidEntitiesById = _51[0], _52 = _51[1], recoverByIdData = _52.data, recoverByIdIsLoading = _52.isLoading, recoverByIdError = _52.error, recoverByIdIsError = _52.isError, recoverByIdIsSuccess = _52.isSuccess;
394
- var _53 = useRecoverSolidEntityMutation(), triggerRecoverSolidEntities = _53[0], _54 = _53[1], recoverByData = _54.data, recoverByIsLoading = _54.isLoading, recoverError = _54.error, recoverIsError = _54.isError, recoverByIsSuccess = _54.isSuccess;
400
+ var _50 = useLazyGetSolidEntitiesQuery(), triggerGetSolidEntities = _50[0], _51 = _50[1], solidEntityListViewData = _51.data, isLoading = _51.isLoading, error = _51.error;
401
+ var _52 = useLazyRecoverSolidEntityByIdQuery(), triggerRecoverSolidEntitiesById = _52[0], _53 = _52[1], recoverByIdData = _53.data, recoverByIdIsLoading = _53.isLoading, recoverByIdError = _53.error, recoverByIdIsError = _53.isError, recoverByIdIsSuccess = _53.isSuccess;
402
+ var _54 = useRecoverSolidEntityMutation(), triggerRecoverSolidEntities = _54[0], _55 = _54[1], recoverByData = _55.data, recoverByIsLoading = _55.isLoading, recoverError = _55.error, recoverIsError = _55.isError, recoverByIsSuccess = _55.isSuccess;
395
403
  // After data is fetched populate the list view state so as to be able to render the data.
396
404
  useEffect(function () {
397
- console.log("useEffect: [solidListViewMetaData] line no 310");
398
405
  if (solidEntityListViewData) {
399
406
  var cleanedRecords = solidEntityListViewData.records.map(function (record) {
400
407
  var newRecord = __assign({}, record);
@@ -423,14 +430,14 @@ export var SolidListView = function (params) {
423
430
  setLoading(false);
424
431
  }
425
432
  }, [solidEntityListViewData]);
426
- var _55 = useDeleteSolidEntityMutation(), deleteSolidSingleEntiry = _55[0], isDeleteSolidSingleEntitySuccess = _55[1].isSuccess;
433
+ var _56 = useDeleteSolidEntityMutation(), deleteSolidSingleEntiry = _56[0], isDeleteSolidSingleEntitySuccess = _56[1].isSuccess;
427
434
  // Delete mutation
428
- var _56 = useDeleteMultipleSolidEntitiesMutation(), deleteManySolidEntities = _56[0], _57 = _56[1], isSolidEntitiesDeleted = _57.isLoading, isDeleteSolidEntitiesSucess = _57.isSuccess, isSolidEntitiesDeleteError = _57.isError, SolidEntitiesDeleteError = _57.error, DeletedSolidEntities = _57.data;
435
+ var _57 = useDeleteMultipleSolidEntitiesMutation(), deleteManySolidEntities = _57[0], _58 = _57[1], isSolidEntitiesDeleted = _58.isLoading, isDeleteSolidEntitiesSucess = _58.isSuccess, isSolidEntitiesDeleteError = _58.isError, SolidEntitiesDeleteError = _58.error, DeletedSolidEntities = _58.data;
429
436
  // Fetch data after toPopulate has been populated...
430
437
  useEffect(function () {
431
438
  var _a, _b, _c;
432
439
  console.log("useEffect: [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, recoverByIdIsSuccess, recoverByIsSuccess, solidListViewMetaData]");
433
- if (solidListViewMetaData) {
440
+ if (solidListViewMetaData && solidListViewLayout) {
434
441
  var queryObject = queryStringToQueryObject();
435
442
  if (queryObject) {
436
443
  var queryData = {
@@ -477,28 +484,38 @@ export var SolidListView = function (params) {
477
484
  recoverByIdIsSuccess,
478
485
  recoverByIsSuccess,
479
486
  solidListViewMetaData,
487
+ solidListViewLayout
480
488
  ]);
481
489
  var session = useSession();
482
490
  var user = useSelector(function (state) { return state.auth; }).user;
483
491
  useEffect(function () {
484
- if ((solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) && !loading) {
492
+ if (solidListViewMetaData && (solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) && !loading) {
485
493
  var handleDynamicFunction = function () { return __awaiter(void 0, void 0, void 0, function () {
486
494
  var dynamicHeader, DynamicFunctionComponent, listViewRecords, listLayout, event, updatedListData;
487
- var _a, _b, _c, _d, _e;
488
- return __generator(this, function (_f) {
489
- switch (_f.label) {
495
+ var _a, _b, _c, _d, _e, _f, _g;
496
+ return __generator(this, function (_h) {
497
+ switch (_h.label) {
490
498
  case 0:
491
499
  dynamicHeader = (_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.onListLoad;
492
500
  DynamicFunctionComponent = null;
493
501
  listViewRecords = listViewData;
494
- listLayout = listViewData;
502
+ listLayout = (_e = (_d = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _d === void 0 ? void 0 : _d.solidView) === null || _e === void 0 ? void 0 : _e.layout;
503
+ if (params.customLayout) {
504
+ listLayout = params.customLayout;
505
+ }
495
506
  event = {
496
- fieldsMetadata: (_d = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _d === void 0 ? void 0 : _d.solidFieldsMetadata,
507
+ fieldsMetadata: (_f = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _f === void 0 ? void 0 : _f.solidFieldsMetadata,
497
508
  listData: listViewData,
498
509
  totalRecords: totalRecords,
499
510
  type: "onListLoad",
500
- viewMetadata: (_e = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _e === void 0 ? void 0 : _e.solidView,
501
- listViewLayout: solidListViewLayout,
511
+ viewMetadata: (_g = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _g === void 0 ? void 0 : _g.solidView,
512
+ listViewLayout: listLayout,
513
+ queryParams: {
514
+ menuItemId: menuItemId,
515
+ menuItemName: menuItemName,
516
+ actionId: actionId,
517
+ actionName: actionName,
518
+ },
502
519
  user: user,
503
520
  session: session
504
521
  };
@@ -507,14 +524,14 @@ export var SolidListView = function (params) {
507
524
  if (!DynamicFunctionComponent) return [3 /*break*/, 2];
508
525
  return [4 /*yield*/, DynamicFunctionComponent(event)];
509
526
  case 1:
510
- updatedListData = _f.sent();
527
+ updatedListData = _h.sent();
511
528
  if (updatedListData && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.dataChanged) && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.newListData)) {
512
529
  listViewRecords = updatedListData.newListData;
513
530
  }
514
531
  if (updatedListData && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.layoutChanged) && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.newLayout)) {
515
532
  listLayout = updatedListData.newLayout;
516
533
  }
517
- _f.label = 2;
534
+ _h.label = 2;
518
535
  case 2:
519
536
  if (listViewRecords) {
520
537
  setListViewData(listViewRecords);
@@ -522,14 +539,14 @@ export var SolidListView = function (params) {
522
539
  if (listLayout) {
523
540
  setSolidListViewLayout(listLayout);
524
541
  }
525
- _f.label = 3;
542
+ _h.label = 3;
526
543
  case 3: return [2 /*return*/];
527
544
  }
528
545
  });
529
546
  }); };
530
547
  handleDynamicFunction();
531
548
  }
532
- }, [solidListViewMetaData, listViewData]);
549
+ }, [solidListViewMetaData, loading]);
533
550
  useEffect(function () {
534
551
  console.log("useEffect: [first, rows, sortField, sortOrder, showArchived, toPopulate, toPopulateMedia, customFilter, queryDataLoaded]");
535
552
  if (queryDataLoaded) {
@@ -634,45 +651,76 @@ export var SolidListView = function (params) {
634
651
  // Common utility function that gets called on filter, sort & pagination events.
635
652
  // This function creates the query string as per the solid backend API specification
636
653
  var setQueryString = function (offset, limit, sortField, sortOrder, filters, showArchived, locale) { return __awaiter(void 0, void 0, void 0, function () {
637
- var solidFieldsMetadata, queryData, sortFieldMetadata, queryString, url, urlData;
638
- var _a, _b, _c;
639
- return __generator(this, function (_d) {
640
- solidFieldsMetadata = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidFieldsMetadata;
641
- queryData = {
642
- offset: offset !== null && offset !== void 0 ? offset : first,
643
- limit: limit !== null && limit !== void 0 ? limit : rows,
644
- filters: filters !== null && filters !== void 0 ? filters : filters,
645
- populate: toPopulate,
646
- populateMedia: toPopulateMedia,
647
- locale: localeName ? localeName : "en",
648
- };
649
- if (sortField && solidFieldsMetadata && solidFieldsMetadata[sortField]) {
650
- sortFieldMetadata = solidFieldsMetadata[sortField];
651
- if ((sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.type) === "relation" &&
652
- (sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.relationType) === "many-to-one") {
653
- 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);
654
- }
655
- queryData.sort = [
656
- "".concat(sortField, ":").concat(sortOrder == 0 ? null : sortOrder == 1 ? "asc" : "desc"),
657
- ];
658
- }
659
- else {
660
- queryData.sort = ["id:desc"];
661
- }
662
- if (showArchived) {
663
- queryData.showSoftDeleted = "inclusive";
664
- }
665
- queryString = qs.stringify(queryData, { encodeValuesOnly: true });
666
- if (customFilter) {
667
- url = void 0;
668
- urlData = queryData;
669
- delete urlData.filters;
670
- urlData.s_filter = customFilter.s_filter || {};
671
- urlData.c_filter = customFilter.c_filter || {};
672
- queryObjectToQueryString(urlData);
654
+ var solidFieldsMetadata, queryData, sortFieldMetadata, dynamicHeader, DynamicFunctionComponent, event, updatedListData, queryString, url, urlData;
655
+ var _a, _b, _c, _d, _e, _f, _g, _h;
656
+ return __generator(this, function (_j) {
657
+ switch (_j.label) {
658
+ case 0:
659
+ solidFieldsMetadata = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidFieldsMetadata;
660
+ queryData = {
661
+ offset: offset !== null && offset !== void 0 ? offset : first,
662
+ limit: limit !== null && limit !== void 0 ? limit : rows,
663
+ filters: filters !== null && filters !== void 0 ? filters : filters,
664
+ populate: toPopulate,
665
+ populateMedia: toPopulateMedia,
666
+ locale: localeName ? localeName : "en",
667
+ };
668
+ if (sortField && solidFieldsMetadata && solidFieldsMetadata[sortField]) {
669
+ sortFieldMetadata = solidFieldsMetadata[sortField];
670
+ if ((sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.type) === "relation" &&
671
+ (sortFieldMetadata === null || sortFieldMetadata === void 0 ? void 0 : sortFieldMetadata.relationType) === "many-to-one") {
672
+ 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);
673
+ }
674
+ queryData.sort = [
675
+ "".concat(sortField, ":").concat(sortOrder == 0 ? null : sortOrder == 1 ? "asc" : "desc"),
676
+ ];
677
+ }
678
+ else {
679
+ queryData.sort = ["id:desc"];
680
+ }
681
+ if (showArchived) {
682
+ queryData.showSoftDeleted = "inclusive";
683
+ }
684
+ dynamicHeader = (_f = (_e = (_d = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _d === void 0 ? void 0 : _d.solidView) === null || _e === void 0 ? void 0 : _e.layout) === null || _f === void 0 ? void 0 : _f.onBeforeListDataLoad;
685
+ DynamicFunctionComponent = null;
686
+ event = {
687
+ type: "onBeforeListDataLoad",
688
+ fieldsMetadata: (_g = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _g === void 0 ? void 0 : _g.solidFieldsMetadata,
689
+ viewMetadata: (_h = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _h === void 0 ? void 0 : _h.solidView,
690
+ listViewLayout: solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data.solidView.layout,
691
+ filter: structuredClone(queryData),
692
+ queryParams: {
693
+ menuItemId: menuItemId,
694
+ menuItemName: menuItemName,
695
+ actionId: actionId,
696
+ actionName: actionName,
697
+ },
698
+ user: user,
699
+ session: session
700
+ };
701
+ if (!dynamicHeader) return [3 /*break*/, 2];
702
+ DynamicFunctionComponent = getExtensionFunction(dynamicHeader);
703
+ if (!DynamicFunctionComponent) return [3 /*break*/, 2];
704
+ return [4 /*yield*/, DynamicFunctionComponent(event)];
705
+ case 1:
706
+ updatedListData = _j.sent();
707
+ if (updatedListData && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.filterApplied) && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.newFilter)) {
708
+ queryData = updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.newFilter;
709
+ }
710
+ _j.label = 2;
711
+ case 2:
712
+ queryString = qs.stringify(queryData, { encodeValuesOnly: true });
713
+ if (customFilter) {
714
+ url = void 0;
715
+ urlData = queryData;
716
+ delete urlData.filters;
717
+ urlData.s_filter = customFilter.s_filter || {};
718
+ urlData.c_filter = customFilter.c_filter || {};
719
+ queryObjectToQueryString(urlData);
720
+ }
721
+ triggerGetSolidEntities(queryString);
722
+ return [2 /*return*/];
673
723
  }
674
- triggerGetSolidEntities(queryString);
675
- return [2 /*return*/];
676
724
  });
677
725
  }); };
678
726
  // handle filter...
@@ -696,13 +744,15 @@ export var SolidListView = function (params) {
696
744
  if (solidListViewMetaData) {
697
745
  initialFilterMethod();
698
746
  }
699
- setFilters(null);
747
+ setFilters({
748
+ $and: []
749
+ });
700
750
  solidGlobalSearchElementRef.current.clearFilter();
701
751
  };
702
- var _58 = useState(), selectedSolidViewData = _58[0], setSelectedSolidViewData = _58[1];
752
+ var _59 = useState(), selectedSolidViewData = _59[0], setSelectedSolidViewData = _59[1];
703
753
  var selectedDataRef = useRef();
704
754
  var op = useRef(null);
705
- var _59 = useState(false), deleteEntity = _59[0], setDeleteEntity = _59[1];
755
+ var _60 = useState(false), deleteEntity = _60[0], setDeleteEntity = _60[1];
706
756
  // clickable link allowing one to open the detail / form view.
707
757
  var detailsBodyTemplate = function (solidViewData) {
708
758
  return (_jsx("div", { children: _jsx(Button, { type: "button", text: true, size: "small", className: "", onClick: function (e) {
@@ -796,10 +846,10 @@ export var SolidListView = function (params) {
796
846
  setSelectedRecords([]);
797
847
  setSelectedRecoverRecords([]);
798
848
  };
799
- var _60 = useState(false), openLightbox = _60[0], setOpenLightbox = _60[1];
800
- var _61 = useState({}), lightboxUrls = _61[0], setLightboxUrls = _61[1];
849
+ var _61 = useState(false), openLightbox = _61[0], setOpenLightbox = _61[1];
850
+ var _62 = useState({}), lightboxUrls = _62[0], setLightboxUrls = _62[1];
801
851
  // Render columns dynamically based on metadata
802
- var renderColumnsDynamically = function (solidListViewMetaData) {
852
+ var renderColumnsDynamically = function (solidListViewMetaData, solidListViewLayout) {
803
853
  var _a;
804
854
  if (!solidListViewMetaData) {
805
855
  return;
@@ -812,9 +862,7 @@ export var SolidListView = function (params) {
812
862
  if (!solidView || !solidFieldsMetadata) {
813
863
  return;
814
864
  }
815
- var currentLayout = params.customLayout
816
- ? params.customLayout
817
- : solidView.layout;
865
+ var currentLayout = solidListViewLayout;
818
866
  return (_a = currentLayout.children) === null || _a === void 0 ? void 0 : _a.map(function (column) {
819
867
  var _a, _b;
820
868
  var fieldMetadata = solidFieldsMetadata[column.attrs.name];
@@ -996,15 +1044,16 @@ export var SolidListView = function (params) {
996
1044
  }
997
1045
  router.push("".concat(editButtonUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=view"));
998
1046
  }
999
- }, children: [params.embeded === true ? null : (_jsx(Column, { selectionMode: "multiple", headerStyle: { width: "3em" } })), renderColumnsDynamically(solidListViewMetaData), ((_z = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _z === void 0 ? void 0 : _z.rowButtons) &&
1047
+ }, children: [params.embeded === true ? null : (_jsx(Column, { selectionMode: "multiple", headerStyle: { width: "3em" } })), solidListViewMetaData && solidListViewLayout && renderColumnsDynamically(solidListViewMetaData, solidListViewLayout), ((_z = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _z === void 0 ? void 0 : _z.rowButtons) &&
1000
1048
  ((_0 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _0 === void 0 ? void 0 : _0.rowButtons.filter(function (rb) {
1001
- var _a, _b;
1049
+ var _a, _b, _c;
1002
1050
  var roles = ((_a = rb === null || rb === void 0 ? void 0 : rb.attrs) === null || _a === void 0 ? void 0 : _a.roles) || [];
1003
1051
  var isInContextMenu = rb.attrs.actionInContextMenu === true;
1004
1052
  // Only check hasAnyRole if roles are provided
1005
1053
  var isAllowed = roles.length === 0 ||
1006
1054
  hasAnyRole((_b = user === null || user === void 0 ? void 0 : user.user) === null || _b === void 0 ? void 0 : _b.roles, roles);
1007
- return !isInContextMenu && isAllowed;
1055
+ var isVisible = ((_c = rb === null || rb === void 0 ? void 0 : rb.attrs) === null || _c === void 0 ? void 0 : _c.visible) !== false;
1056
+ return !isInContextMenu && isAllowed && isVisible;
1008
1057
  }).map(function (button, index) {
1009
1058
  // const hasRole = button.attrs.roles && button.attrs.roles.length > 0 ? useHasAnyRole(button.attrs.roles) : true;
1010
1059
  // if (!hasRole) return null;
@@ -1020,7 +1069,7 @@ export var SolidListView = function (params) {
1020
1069
  var event = {
1021
1070
  params: params,
1022
1071
  rowData: rowData,
1023
- solidListViewMetaData: solidListViewMetaData.data,
1072
+ solidListViewMetaData: solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data,
1024
1073
  };
1025
1074
  handleCustomButtonClick(button.attrs, event);
1026
1075
  } }));
@@ -1029,41 +1078,50 @@ export var SolidListView = function (params) {
1029
1078
  ((_1 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _1 === void 0 ? void 0 : _1.edit) !== false &&
1030
1079
  ((_2 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _2 === void 0 ? void 0 : _2.showRowEditInContextMenu) ===
1031
1080
  false && (_jsx(Column, { header: "Edit", body: function (rowData) {
1032
- return (_jsx(Button, { text: true, type: "button", severity: "secondary", className: "", label: "", size: "small", iconPos: "left", icon: "pi pi-pencil", onClick: function () {
1033
- if (params.embeded == true) {
1034
- params.handlePopUpOpen(rowData === null || rowData === void 0 ? void 0 : rowData.id);
1035
- }
1036
- else {
1037
- router.push("".concat(editButtonUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=edit"));
1038
- }
1039
- } }));
1081
+ var shouldHideEditOrDeleteButton = isDraftPublishWorkflowEnabled && (rowData === null || rowData === void 0 ? void 0 : rowData.publishedAt);
1082
+ return (_jsx(_Fragment, { children: !shouldHideEditOrDeleteButton && (_jsx(Button, { text: true, type: "button", severity: "secondary", className: "", label: "", size: "small", iconPos: "left", icon: "pi pi-pencil", onClick: function () {
1083
+ if (params.embeded == true) {
1084
+ params.handlePopUpOpen(rowData === null || rowData === void 0 ? void 0 : rowData.id);
1085
+ }
1086
+ else {
1087
+ router.push("".concat(editButtonUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=edit"));
1088
+ }
1089
+ } })) }));
1040
1090
  } })), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'delete'))) &&
1041
1091
  ((_3 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _3 === void 0 ? void 0 : _3.delete) !== false &&
1042
1092
  ((_4 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _4 === void 0 ? void 0 : _4.showRowDeleteInContextMenu) ===
1043
1093
  false && (_jsx(Column, { header: "Delete", body: function (rowData) {
1044
- return (_jsx(Button, { text: true, type: "button", className: "", size: "small", iconPos: "left", severity: "danger", icon: "pi pi-trash", onClick: function () {
1045
- setSelectedSolidViewData(rowData);
1046
- setDeleteEntity(true);
1047
- } }));
1094
+ var shouldHideEditOrDeleteButton = isDraftPublishWorkflowEnabled && (rowData === null || rowData === void 0 ? void 0 : rowData.publishedAt);
1095
+ return (_jsx(_Fragment, { children: !shouldHideEditOrDeleteButton && (_jsx(Button, { text: true, type: "button", className: "", size: "small", iconPos: "left", severity: "danger", icon: "pi pi-trash", onClick: function () {
1096
+ setSelectedSolidViewData(rowData);
1097
+ setDeleteEntity(true);
1098
+ } })) }));
1048
1099
  } })), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'update'))) &&
1049
1100
  ((_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) {
1050
- var _a, _b, _c, _d, _e, _f, _g;
1101
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1051
1102
  return (rowData === null || rowData === void 0 ? void 0 : rowData.deletedAt) ? (_jsx("a", { onClick: function (event) {
1052
1103
  event.stopPropagation();
1053
1104
  recoverById(rowData.id);
1054
1105
  }, 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) !==
1055
1106
  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: [((_b = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _b === void 0 ? void 0 : _b.showDefaultEditButton) !== false &&
1056
- ((_c = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _c === void 0 ? void 0 : _c.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 () {
1107
+ ((_c = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _c === void 0 ? void 0 : _c.showRowEditInContextMenu) !== false &&
1108
+ !(isDraftPublishWorkflowEnabled && ((_d = selectedDataRef.current) === null || _d === void 0 ? void 0 : _d.publishedAt)) && (_jsx(Button, { type: "button", className: "w-full text-left gap-1", label: "Edit", size: "small", iconPos: "left", icon: "pi pi-pencil", onClick: function () {
1109
+ var _a, _b;
1057
1110
  if (params.embeded == true) {
1058
- params.handlePopUpOpen(selectedSolidViewData === null || selectedSolidViewData === void 0 ? void 0 : selectedSolidViewData.id);
1111
+ params.handlePopUpOpen((_a = selectedDataRef.current) === null || _a === void 0 ? void 0 : _a.id);
1059
1112
  }
1060
1113
  else {
1061
- router.push("".concat(editButtonUrl, "/").concat(selectedSolidViewData === null || selectedSolidViewData === void 0 ? void 0 : selectedSolidViewData.id, "?viewMode=edit"));
1114
+ router.push("".concat(editButtonUrl, "/").concat((_b = selectedDataRef.current) === null || _b === void 0 ? void 0 : _b.id, "?viewMode=edit"));
1062
1115
  }
1063
1116
  } })), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'delete'))) &&
1064
- ((_d = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _d === void 0 ? void 0 : _d.delete) !==
1117
+ ((_e = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _e === void 0 ? void 0 : _e.delete) !==
1065
1118
  false &&
1066
- ((_e = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _e === void 0 ? void 0 : _e.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); } })), (_g = (_f = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _f === void 0 ? void 0 : _f.rowButtons) === null || _g === void 0 ? void 0 : _g.filter(function (rb) { var _a; return ((_a = rb === null || rb === void 0 ? void 0 : rb.attrs) === null || _a === void 0 ? void 0 : _a.actionInContextMenu) === true; }).map(function (button, index) {
1119
+ ((_f = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _f === void 0 ? void 0 : _f.showRowDeleteInContextMenu) !== false &&
1120
+ !(isDraftPublishWorkflowEnabled && ((_g = selectedDataRef.current) === null || _g === void 0 ? void 0 : _g.publishedAt)) && (_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); } })), (_j = (_h = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _h === void 0 ? void 0 : _h.rowButtons) === null || _j === void 0 ? void 0 : _j.filter(function (rb) {
1121
+ var _a, _b;
1122
+ return ((_a = rb === null || rb === void 0 ? void 0 : rb.attrs) === null || _a === void 0 ? void 0 : _a.actionInContextMenu) === true &&
1123
+ ((_b = rb === null || rb === void 0 ? void 0 : rb.attrs) === null || _b === void 0 ? void 0 : _b.visible) !== false;
1124
+ }).map(function (button, index) {
1067
1125
  var _a;
1068
1126
  return (_jsx(SolidListViewRowButtonContextMenu, { button: button, params: params, getSelectedSolidViewData: function () { return selectedDataRef.current; },
1069
1127
  // selectedSolidViewData={selectedSolidViewData}
@@ -1079,7 +1137,7 @@ export var SolidListView = function (params) {
1079
1137
  bottom: 0,
1080
1138
  height: "100%",
1081
1139
  zIndex: 9,
1082
- }, 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)
1140
+ }, 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(SolidAiMainWrapper, { 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)
1083
1141
  ? (_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
1084
1142
  : params === null || params === void 0 ? void 0 : params.modelName), headerClassName: "py-2", contentClassName: "px-0 pb-0", visible: deleteEntity, style: { width: "20vw" }, onHide: function () {
1085
1143
  if (!deleteEntity)