@solidstarters/solid-core-ui 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/SolidForgotPassword.d.ts +3 -0
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -0
- package/dist/components/auth/SolidForgotPassword.js +108 -0
- package/dist/components/auth/SolidForgotPassword.js.map +1 -0
- package/dist/components/auth/SolidLogin.d.ts +3 -0
- package/dist/components/auth/SolidLogin.d.ts.map +1 -0
- package/dist/components/auth/SolidLogin.js +115 -0
- package/dist/components/auth/SolidLogin.js.map +1 -0
- package/dist/components/auth/SolidOTPVerify.d.ts +3 -0
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -0
- package/dist/components/auth/SolidOTPVerify.js +108 -0
- package/dist/components/auth/SolidOTPVerify.js.map +1 -0
- package/dist/components/auth/SolidRegister.d.ts +3 -0
- package/dist/components/auth/SolidRegister.d.ts.map +1 -0
- package/dist/components/auth/SolidRegister.js +166 -0
- package/dist/components/auth/SolidRegister.js.map +1 -0
- package/dist/components/auth/SolidResetPassword.d.ts +3 -0
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -0
- package/dist/components/auth/SolidResetPassword.js +119 -0
- package/dist/components/auth/SolidResetPassword.js.map +1 -0
- package/dist/components/core/common/FilterComponent.d.ts +33 -1
- package/dist/components/core/common/FilterComponent.d.ts.map +1 -1
- package/dist/components/core/common/FilterComponent.js +26 -25
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +3 -3
- package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +1 -1
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +14 -9
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidLayoutViews.d.ts +19 -0
- package/dist/components/core/common/SolidLayoutViews.d.ts.map +1 -0
- package/dist/components/core/common/SolidLayoutViews.js +14 -0
- package/dist/components/core/common/SolidLayoutViews.js.map +1 -0
- package/dist/components/core/common/SolidListViewOptions.d.ts +2 -0
- package/dist/components/core/common/SolidListViewOptions.d.ts.map +1 -0
- package/dist/components/core/common/SolidListViewOptions.js +11 -0
- package/dist/components/core/common/SolidListViewOptions.js.map +1 -0
- package/dist/components/core/filter/SolidManyToOneFilterElement.js +1 -1
- package/dist/components/core/filter/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/filter/columns/SolidBigintField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBigintField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBigintField.js +8 -0
- package/dist/components/core/filter/columns/SolidBigintField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js +27 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.js +22 -0
- package/dist/components/core/filter/columns/SolidComputedField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts +9 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.js +35 -0
- package/dist/components/core/filter/columns/SolidDateField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js +8 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.js +8 -0
- package/dist/components/core/filter/columns/SolidFloatField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.js +34 -0
- package/dist/components/core/filter/columns/SolidIntField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.js +12 -0
- package/dist/components/core/filter/columns/SolidRelationField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js +25 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js +26 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js +33 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidTimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.js +25 -0
- package/dist/components/core/filter/columns/SolidUuidField.js.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts +4 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js +54 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js.map +1 -0
- package/dist/components/core/kanban/KanbanBoard.d.ts +1 -1
- package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.js +11 -11
- package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +113 -202
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +312 -62
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidManyToOneFilterElement.js +2 -3
- package/dist/components/core/list/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +3 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +5 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js +3 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidUuidColumn.js +3 -1
- package/dist/components/core/list/columns/SolidUuidColumn.js.map +1 -1
- package/dist/components/layout/AppConfig.d.ts +4 -0
- package/dist/components/layout/AppConfig.d.ts.map +1 -0
- package/dist/components/layout/AppConfig.js +57 -0
- package/dist/components/layout/AppConfig.js.map +1 -0
- package/dist/components/layout/AppSidebar.d.ts +3 -0
- package/dist/components/layout/AppSidebar.d.ts.map +1 -0
- package/dist/components/layout/AppSidebar.js +75 -0
- package/dist/components/layout/AppSidebar.js.map +1 -0
- package/dist/components/layout/CustomPagination.d.ts +0 -6
- package/dist/components/layout/CustomPagination.d.ts.map +1 -1
- package/dist/components/layout/CustomPagination.js +48 -27
- package/dist/components/layout/CustomPagination.js.map +1 -1
- package/dist/components/layout/FilterMenu.d.ts.map +1 -1
- package/dist/components/layout/FilterMenu.js +1 -2
- package/dist/components/layout/FilterMenu.js.map +1 -1
- package/dist/components/layout/context/layoutcontext.d.ts +5 -0
- package/dist/components/layout/context/layoutcontext.d.ts.map +1 -0
- package/dist/components/layout/context/layoutcontext.js +56 -0
- package/dist/components/layout/context/layoutcontext.js.map +1 -0
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +5 -5
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +37 -5
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/components/modelsComponents/filterIcon.d.ts.map +1 -1
- package/dist/components/modelsComponents/filterIcon.js.map +1 -1
- package/dist/components/tables/ListViewTable.d.ts.map +1 -1
- package/dist/components/tables/ListViewTable.js +2 -1
- package/dist/components/tables/ListViewTable.js.map +1 -1
- package/dist/helpers/helpers.d.ts +1 -1
- package/dist/helpers/helpers.d.ts.map +1 -1
- package/dist/index.d.ts +19 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -32
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/auth/SolidForgotPassword.tsx +124 -0
- package/src/components/auth/SolidLogin.tsx +156 -0
- package/src/components/auth/SolidOTPVerify.tsx +127 -0
- package/src/components/auth/SolidRegister.tsx +221 -0
- package/src/components/auth/SolidResetPassword.tsx +160 -0
- package/src/components/core/common/FilterComponent.tsx +45 -40
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +11 -10
- package/src/components/core/common/SolidCreateButton.tsx +1 -1
- package/src/components/core/common/SolidGlobalSearchElement.tsx +33 -13
- package/src/components/core/common/SolidLayoutViews.tsx +87 -0
- package/src/components/core/common/SolidListViewOptions.tsx +31 -0
- package/src/components/core/filter/SolidManyToOneFilterElement.tsx +1 -1
- package/src/components/core/kanban/KanbanBoard.tsx +7 -4
- package/src/components/core/kanban/SolidKanbanView.tsx +110 -248
- package/src/components/core/list/SolidListView.tsx +421 -96
- package/src/components/core/list/SolidManyToOneFilterElement.tsx +3 -3
- package/src/components/core/list/columns/SolidBooleanColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidShortTextColumn.tsx +8 -3
- package/src/components/core/list/columns/SolidTimeColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidUuidColumn.tsx +1 -1
- package/src/components/layout/AppConfig.tsx +103 -0
- package/src/components/layout/AppSidebar.tsx +170 -0
- package/src/components/layout/CustomPagination.tsx +55 -55
- package/src/components/layout/FilterMenu.tsx +1 -2
- package/src/components/layout/context/layoutcontext.tsx +52 -0
- package/src/components/layout/navbar-two-menu.tsx +12 -9
- package/src/components/layout/user-profile-menu.tsx +74 -189
- package/src/components/modelsComponents/filterIcon.tsx +0 -1
- package/src/components/tables/ListViewTable.tsx +4 -3
- package/src/index.ts +157 -144
- package/src/types/index.d.ts +26 -0
- package/src/types/layout.d.ts +94 -0
- package/src/types/next-auth.d.ts +0 -0
- package/dist/components/core/kanban/SolidKanbanFilter.d.ts +0 -2
- package/dist/components/core/kanban/SolidKanbanFilter.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidKanbanViewSearchColumn.d.ts +0 -10
- package/dist/components/core/kanban/SolidKanbanViewSearchColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts +0 -2
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.d.ts +0 -2
- package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.d.ts +0 -2
- package/dist/components/core/kanban/SolidSelectionStaticFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/SolidVarInputsFilterElement.d.ts +0 -12
- package/dist/components/core/kanban/SolidVarInputsFilterElement.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidBigintColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidBigintColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidBooleanColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidBooleanColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidComputedColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidComputedColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidDateColumn.d.ts +0 -9
- package/dist/components/core/kanban/columns/SolidDateColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidDatetimeColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidDatetimeColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidDecimalColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidDecimalColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidExternalIdColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidExternalIdColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidFloatColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidFloatColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidIdColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidIdColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidIntColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidIntColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidLongTextColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidLongTextColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidMediaMultipleColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidMediaMultipleColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidMediaSingleColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidMediaSingleColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidRelationColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidRelationColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidRichTextColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidRichTextColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidSelectionDynamicColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidSelectionDynamicColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidSelectionStaticColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidSelectionStaticColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidShortTextColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidShortTextColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidTimeColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidTimeColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/SolidUuidColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/SolidUuidColumn.d.ts.map +0 -1
- package/dist/components/core/kanban/columns/relations/SolidRelationManyToOneColumn.d.ts +0 -4
- package/dist/components/core/kanban/columns/relations/SolidRelationManyToOneColumn.d.ts.map +0 -1
- package/src/components/common/FilterComponent.tsx +0 -428
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { useRouter } from "next/navigation";
|
|
7
|
-
import { FilterMatchMode } from "primereact/api";
|
|
8
|
-
import { Button } from "primereact/button";
|
|
9
|
-
import { Column } from "primereact/column";
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
|
|
5
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
10
6
|
import {
|
|
11
7
|
DataTable,
|
|
12
8
|
DataTableFilterMeta,
|
|
13
9
|
DataTableStateEvent,
|
|
14
10
|
} from "primereact/datatable";
|
|
15
|
-
import {
|
|
11
|
+
import { Column } from "primereact/column";
|
|
12
|
+
import { FilterMatchMode } from "primereact/api";
|
|
13
|
+
import Link from "next/link";
|
|
16
14
|
import qs from "qs";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
15
|
+
import { Button } from "primereact/button";
|
|
16
|
+
import { Dialog } from "primereact/dialog";
|
|
17
|
+
import { createSolidEntityApi } from "@/redux/api/solidEntityApi";
|
|
18
|
+
import { useGetSolidViewLayoutQuery } from "@/redux/api/solidViewApi";
|
|
19
|
+
import { SolidListViewColumn } from "./SolidListViewColumn";
|
|
20
|
+
// import { SolidListViewOptions } from "../common/SolidListviewOptions";
|
|
19
21
|
import { SolidCreateButton } from "../common/SolidCreateButton";
|
|
20
22
|
import { SolidGlobalSearchElement } from "../common/SolidGlobalSearchElement";
|
|
23
|
+
import { pascalCase } from "change-case";
|
|
24
|
+
import { useLazyCheckIfPermissionExistsQuery } from "@/redux/api/userApi";
|
|
25
|
+
import { createPermission, deletePermission, updatePermission } from "@/helpers/permissions";
|
|
26
|
+
import { useRouter } from "next/navigation";
|
|
21
27
|
import { ListViewRowActionPopup } from "./ListViewRowActionPopup";
|
|
22
|
-
import {
|
|
28
|
+
import FilterComponent, { FilterOperator, FilterRule, FilterRuleType } from "@/components/core/common/FilterComponent";
|
|
29
|
+
import { SolidLayoutViews } from '../common/SolidLayoutViews'
|
|
30
|
+
import { FilterIcon } from '../../modelsComponents/filterIcon';
|
|
31
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
32
|
+
const getRandomInt = (min: number, max: number) => {
|
|
33
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
34
|
+
}
|
|
23
35
|
|
|
24
36
|
type SolidListViewParams = {
|
|
25
37
|
moduleName: string;
|
|
@@ -31,11 +43,215 @@ type SolidListViewParams = {
|
|
|
31
43
|
customFilter?: any
|
|
32
44
|
};
|
|
33
45
|
|
|
46
|
+
// const transformRulesToFilters = (filterRules: any) => {
|
|
47
|
+
// if (!filterRules || !filterRules.children) return {};
|
|
48
|
+
|
|
49
|
+
// let operatorKey = filterRules.matchOperator === "and" ? "$and" : "$or";
|
|
50
|
+
|
|
51
|
+
// let filters = filterRules.children.map((child: any) => {
|
|
52
|
+
// if (child.type === "rule") {
|
|
53
|
+
// let filterValue ;
|
|
54
|
+
// if(child.value){
|
|
55
|
+
|
|
56
|
+
// if(child.value.length === 1){
|
|
57
|
+
// if (typeof child.value[0] === "object" && child.value[0] !== null) {
|
|
58
|
+
// filterValue = [child.value[0].value];
|
|
59
|
+
// }else{
|
|
60
|
+
// filterValue = child.value[0];
|
|
61
|
+
// }
|
|
62
|
+
// }else{
|
|
63
|
+
// if (typeof child.value[0] === "object" && child.value[0] !== null) {
|
|
64
|
+
// filterValue = child.value.map((i:any) => i.value);
|
|
65
|
+
// }else{
|
|
66
|
+
// filterValue = child.value;
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
|
|
71
|
+
// let ruleFilter = { [child.fieldName]: { [child.matchMode]: filterValue} };
|
|
72
|
+
// // If the rule has children, process them recursively
|
|
73
|
+
// if (child.children && child.children.length > 0) {
|
|
74
|
+
// let childFilters = transformRulesToFilters({ matchOperator: "and", children: child.children }).filters;
|
|
75
|
+
// return { [operatorKey]: [ruleFilter, childFilters] };
|
|
76
|
+
// }
|
|
77
|
+
|
|
78
|
+
// return ruleFilter;
|
|
79
|
+
// } else if (child.type === "rule_group") {
|
|
80
|
+
// return transformRulesToFilters(child).filters; // Recursively process rule groups
|
|
81
|
+
// }
|
|
82
|
+
// }).filter(Boolean);
|
|
83
|
+
|
|
84
|
+
// return { filters: { [operatorKey]: filters } };
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
// }
|
|
88
|
+
const transformRulesToFilters = (input: any) => {
|
|
89
|
+
|
|
90
|
+
// Helper function to process individual rules
|
|
91
|
+
const processRule = (rule) => {
|
|
92
|
+
if (rule.value.length > 0) {
|
|
93
|
+
|
|
94
|
+
// Ensure rule.value is always an array
|
|
95
|
+
let values = typeof rule.value[0] === "object" ? rule.value.map((i: any) => i.value) : rule.value;
|
|
96
|
+
if (rule.matchMode !== '$in' && rule.matchMode !== '$notIn' && rule.matchMode !== '$between') {
|
|
97
|
+
values = values[0];
|
|
98
|
+
}
|
|
99
|
+
// Rule transformation
|
|
100
|
+
let transformedRule = {
|
|
101
|
+
[rule.fieldName]: {
|
|
102
|
+
[rule.matchMode]: values // Assuming `value` is always an array with `value` and `label`
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// If the rule has children (which means it's a rule group), process them
|
|
107
|
+
let processedFields;
|
|
108
|
+
if (rule.children && rule.children.length > 0) {
|
|
109
|
+
processedFields = rule.children.map(child => processRuleGroup(child));
|
|
110
|
+
}
|
|
111
|
+
if (processedFields) {
|
|
112
|
+
return { ...transformedRule, processedFields }
|
|
113
|
+
}
|
|
114
|
+
return { ...transformedRule }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Helper function to process rule groups
|
|
120
|
+
const processRuleGroup = (ruleGroup) => {
|
|
121
|
+
const operator = ruleGroup.matchOperator === 'or' ? '$or' : '$and';
|
|
122
|
+
const children = ruleGroup.children.map(child => {
|
|
123
|
+
if (child.type === 'rule') {
|
|
124
|
+
// Process the rule
|
|
125
|
+
return processRule(child);
|
|
126
|
+
} else if (child.type === 'rule_group') {
|
|
127
|
+
// Process the rule group recursively
|
|
128
|
+
return processRuleGroup(child);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
[operator]: children
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Start processing the root rule group
|
|
138
|
+
const filterObject = processRuleGroup(input);
|
|
139
|
+
|
|
140
|
+
function liftProcessedFields(filters) {
|
|
141
|
+
if (!filters || typeof filters !== 'object') return filters;
|
|
142
|
+
|
|
143
|
+
function processArray(arr) {
|
|
144
|
+
let newArr = [];
|
|
145
|
+
for (let obj of arr) {
|
|
146
|
+
if (obj.processedFields) {
|
|
147
|
+
let processed = processArray(obj.processedFields); // Recursively process nested processedFields
|
|
148
|
+
delete obj.processedFields;
|
|
149
|
+
newArr.push(obj, ...processed);
|
|
150
|
+
} else {
|
|
151
|
+
newArr.push(obj);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
for (let key in obj) {
|
|
155
|
+
if (Array.isArray(obj[key])) {
|
|
156
|
+
obj[key] = processArray(obj[key]);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return newArr;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
for (let key in filters) {
|
|
164
|
+
if (Array.isArray(filters[key])) {
|
|
165
|
+
filters[key] = processArray(filters[key]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return filters;
|
|
170
|
+
} return {
|
|
171
|
+
filters: liftProcessedFields(filterObject)
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
34
176
|
export const SolidListView = (params: SolidListViewParams) => {
|
|
35
177
|
|
|
178
|
+
const initialState: FilterRule[] = [
|
|
179
|
+
{
|
|
180
|
+
"id": 1,
|
|
181
|
+
"type": "rule_group",
|
|
182
|
+
"matchOperator": "or",
|
|
183
|
+
"parentRule": null,
|
|
184
|
+
"children": [
|
|
185
|
+
{
|
|
186
|
+
"id": 1738397527814,
|
|
187
|
+
"type": "rule",
|
|
188
|
+
"fieldName": "module",
|
|
189
|
+
"matchMode": "$in",
|
|
190
|
+
"value": [
|
|
191
|
+
{
|
|
192
|
+
"label": "solid-core",
|
|
193
|
+
"value": 1
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
"parentRule": 1,
|
|
197
|
+
"children": [
|
|
198
|
+
{
|
|
199
|
+
"id": 1738397555900,
|
|
200
|
+
"type": "rule_group",
|
|
201
|
+
"matchOperator": "and",
|
|
202
|
+
"parentRule": 1738397527814,
|
|
203
|
+
"children": [
|
|
204
|
+
{
|
|
205
|
+
"id": 1738397556184,
|
|
206
|
+
"type": "rule",
|
|
207
|
+
"fieldName": "name",
|
|
208
|
+
"matchMode": "$startsWithi",
|
|
209
|
+
"value": [
|
|
210
|
+
"social"
|
|
211
|
+
],
|
|
212
|
+
"parentRule": 1738397555900,
|
|
213
|
+
"children": []
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"id": 1738397556147,
|
|
217
|
+
"type": "rule",
|
|
218
|
+
"fieldName": "displayName",
|
|
219
|
+
"matchMode": "$startsWithi",
|
|
220
|
+
"value": [
|
|
221
|
+
"social"
|
|
222
|
+
],
|
|
223
|
+
"parentRule": 1738397555900,
|
|
224
|
+
"children": []
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": 1738397547577,
|
|
232
|
+
"type": "rule",
|
|
233
|
+
"fieldName": "module",
|
|
234
|
+
"matchMode": "$in",
|
|
235
|
+
"value": [
|
|
236
|
+
{
|
|
237
|
+
"label": "srmd-tracker",
|
|
238
|
+
"value": 4
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"parentRule": 1,
|
|
242
|
+
"children": []
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
];
|
|
247
|
+
|
|
248
|
+
|
|
36
249
|
const router = useRouter()
|
|
37
250
|
// TODO: The initial filter state will be created based on the fields which are present on this list view.
|
|
38
251
|
const [filters, setFilters] = useState<DataTableFilterMeta>({});
|
|
252
|
+
const [customFilter, setCustomFilter] = useState<FilterRule[]>(initialState);
|
|
253
|
+
const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
|
|
254
|
+
|
|
39
255
|
const [toPopulate, setToPopulate] = useState<string[]>([]);
|
|
40
256
|
const [actionsAllowed, setActionsAllowed] = useState<string[]>([]);
|
|
41
257
|
|
|
@@ -156,6 +372,9 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
156
372
|
|
|
157
373
|
|
|
158
374
|
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
159
378
|
// All list view state.
|
|
160
379
|
const [listViewData, setListViewData] = useState<any[]>([]);
|
|
161
380
|
const [first, setFirst] = useState(0);
|
|
@@ -202,6 +421,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
202
421
|
}
|
|
203
422
|
}
|
|
204
423
|
}, [solidListViewMetaData])
|
|
424
|
+
const [deleteSolidSingleEntiry, { isSuccess: isDeleteSolidSingleEntitySuccess }] = useDeleteSolidEntityMutation()
|
|
205
425
|
|
|
206
426
|
// Delete mutation
|
|
207
427
|
const [
|
|
@@ -235,7 +455,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
235
455
|
triggerGetSolidEntities(queryString);
|
|
236
456
|
setSelectedRecords([]);
|
|
237
457
|
}
|
|
238
|
-
}, [isDeleteSolidEntitiesSucess, toPopulate]);
|
|
458
|
+
}, [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, toPopulate]);
|
|
239
459
|
|
|
240
460
|
// Handle pagination event.
|
|
241
461
|
const onPageChange = (event: any) => {
|
|
@@ -399,6 +619,31 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
399
619
|
triggerGetSolidEntities(queryString);
|
|
400
620
|
};
|
|
401
621
|
|
|
622
|
+
//apply custom filter code
|
|
623
|
+
const handleApplyCustomFilter = () => {
|
|
624
|
+
const transformedFilter = transformRulesToFilters(customFilter[0]);
|
|
625
|
+
console.log("transformedFilter", transformedFilter);
|
|
626
|
+
|
|
627
|
+
if (toPopulate) {
|
|
628
|
+
const queryData = {
|
|
629
|
+
offset: 0,
|
|
630
|
+
limit: 25,
|
|
631
|
+
populate: toPopulate,
|
|
632
|
+
sort: [`id:desc`],
|
|
633
|
+
filters: { ...transformedFilter.filters }
|
|
634
|
+
};
|
|
635
|
+
if (params.embeded) {
|
|
636
|
+
|
|
637
|
+
}
|
|
638
|
+
const queryString = qs.stringify(queryData, {
|
|
639
|
+
encodeValuesOnly: true
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
triggerGetSolidEntities(queryString);
|
|
643
|
+
// setShowGlobalSearchElement(false)
|
|
644
|
+
setSelectedRecords([]);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
402
647
|
// handle filter...
|
|
403
648
|
const onFilter = (e: any) => {
|
|
404
649
|
setFilters(e.filters);
|
|
@@ -418,20 +663,67 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
418
663
|
}
|
|
419
664
|
};
|
|
420
665
|
|
|
666
|
+
const op = useRef(null)
|
|
421
667
|
|
|
422
668
|
// clickable link allowing one to open the detail / form view.
|
|
423
669
|
const detailsBodyTemplate = (solidViewData: any) => {
|
|
424
|
-
|
|
425
670
|
return (
|
|
426
|
-
<
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
671
|
+
<div>
|
|
672
|
+
|
|
673
|
+
<Button
|
|
674
|
+
text
|
|
675
|
+
size="small"
|
|
676
|
+
className="p-0"
|
|
677
|
+
onClick={(e) =>
|
|
678
|
+
// @ts-ignore
|
|
679
|
+
op.current.toggle(e)}
|
|
680
|
+
>
|
|
681
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="3" height="10" viewBox="0 0 4 16" fill="none">
|
|
682
|
+
<path d="M4 14C4 14.55 3.80417 15.0208 3.4125 15.4125C3.02083 15.8042 2.55 16 2 16C1.45 16 0.979167 15.8042 0.5875 15.4125C0.195833 15.0208 0 14.55 0 14C0 13.45 0.195833 12.9792 0.5875 12.5875C0.979167 12.1958 1.45 12 2 12C2.55 12 3.02083 12.1958 3.4125 12.5875C3.80417 12.9792 4 13.45 4 14ZM4 8C4 8.55 3.80417 9.02083 3.4125 9.4125C3.02083 9.80417 2.55 10 2 10C1.45 10 0.979167 9.80417 0.5875 9.4125C0.195833 9.02083 0 8.55 0 8C0 7.45 0.195833 6.97917 0.5875 6.5875C0.979167 6.19583 1.45 6 2 6C2.55 6 3.02083 6.19583 3.4125 6.5875C3.80417 6.97917 4 7.45 4 8ZM4 2C4 2.55 3.80417 3.02083 3.4125 3.4125C3.02083 3.80417 2.55 4 2 4C1.45 4 0.979167 3.80417 0.5875 3.4125C0.195833 3.02083 0 2.55 0 2C0 1.45 0.195833 0.979166 0.5875 0.5875C0.979167 0.195833 1.45 0 2 0C2.55 0 3.02083 0.195833 3.4125 0.5875C3.80417 0.979166 4 1.45 4 2Z" fill="#666666" />
|
|
683
|
+
</svg>
|
|
684
|
+
</Button>
|
|
685
|
+
<OverlayPanel ref={op} className="solid-custom-overlay" style={{ top: 10 }}>
|
|
686
|
+
<div className="flex flex-column gap-1 p-1">
|
|
687
|
+
<Button
|
|
688
|
+
className="w-8rem"
|
|
689
|
+
label="Edit"
|
|
690
|
+
size="small"
|
|
691
|
+
iconPos="left"
|
|
692
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
693
|
+
<path d="M3.33333 12.6667H4.28333L10.8 6.15L9.85 5.2L3.33333 11.7167V12.6667ZM2 14V11.1667L10.8 2.38333C10.9333 2.26111 11.0806 2.16667 11.2417 2.1C11.4028 2.03333 11.5722 2 11.75 2C11.9278 2 12.1 2.03333 12.2667 2.1C12.4333 2.16667 12.5778 2.26667 12.7 2.4L13.6167 3.33333C13.75 3.45556 13.8472 3.6 13.9083 3.76667C13.9694 3.93333 14 4.1 14 4.26667C14 4.44444 13.9694 4.61389 13.9083 4.775C13.8472 4.93611 13.75 5.08333 13.6167 5.21667L4.83333 14H2ZM10.3167 5.68333L9.85 5.2L10.8 6.15L10.3167 5.68333Z" fill="#F9F0FF" />
|
|
694
|
+
</svg>}
|
|
695
|
+
onClick={() => {
|
|
696
|
+
if (params.embeded == true) {
|
|
697
|
+
params.handlePopUpOpen(solidViewData.id);
|
|
698
|
+
} else {
|
|
699
|
+
router.push(`${editButtonUrl}/${solidViewData.id}`)
|
|
700
|
+
}
|
|
701
|
+
}}
|
|
702
|
+
/>
|
|
703
|
+
<Button
|
|
704
|
+
text
|
|
705
|
+
className="w-8rem"
|
|
706
|
+
label="Delete"
|
|
707
|
+
size="small"
|
|
708
|
+
iconPos="left"
|
|
709
|
+
severity="secondary"
|
|
710
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
711
|
+
<path d="M4.66666 14C4.29999 14 3.9861 13.8694 3.72499 13.6083C3.46388 13.3472 3.33332 13.0333 3.33332 12.6667V4H2.66666V2.66667H5.99999V2H9.99999V2.66667H13.3333V4H12.6667V12.6667C12.6667 13.0333 12.5361 13.3472 12.275 13.6083C12.0139 13.8694 11.7 14 11.3333 14H4.66666ZM11.3333 4H4.66666V12.6667H11.3333V4ZM5.99999 11.3333H7.33332V5.33333H5.99999V11.3333ZM8.66666 11.3333H9.99999V5.33333H8.66666V11.3333Z" fill="#4B4D52" />
|
|
712
|
+
</svg>}
|
|
713
|
+
onClick={() => deleteSolidSingleEntiry(solidViewData.id)}
|
|
714
|
+
/>
|
|
715
|
+
</div>
|
|
716
|
+
</OverlayPanel>
|
|
717
|
+
</div>
|
|
718
|
+
// <a onClick={() => {
|
|
719
|
+
// if (params.embeded == true) {
|
|
720
|
+
// params.handlePopUpOpen(solidViewData.id);
|
|
721
|
+
// } else {
|
|
722
|
+
// router.push(`${editButtonUrl}/${solidViewData.id}`)
|
|
723
|
+
// }
|
|
724
|
+
// }} rel="noopener noreferrer" className="text-sm font-bold p-0" style={{ color: "#12415D" }}>
|
|
725
|
+
// <i className="pi pi-pencil" style={{ fontSize: "1rem" }}></i>
|
|
726
|
+
// </a>
|
|
435
727
|
);
|
|
436
728
|
};
|
|
437
729
|
|
|
@@ -485,21 +777,26 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
485
777
|
setListViewRowActionPopupState(false)
|
|
486
778
|
}
|
|
487
779
|
|
|
780
|
+
const sizeOptions = [
|
|
781
|
+
{ label: 'Compact', value: 'small', image: '/images/layout/images/compact.png' },
|
|
782
|
+
{ label: 'Cozy', value: 'normal', image: '/images/layout/images/cozy.png' },
|
|
783
|
+
{ label: 'Comfortable', value: 'large', image: '/images/layout/images/comfortable.png' }
|
|
784
|
+
]
|
|
785
|
+
|
|
786
|
+
const viewModes = [
|
|
787
|
+
{ label: 'List ', value: 'list', image: '/images/layout/images/cozy.png' },
|
|
788
|
+
{ label: 'Kanban', value: 'kanban', image: '/images/layout/images/kanban.png' },
|
|
789
|
+
]
|
|
790
|
+
|
|
791
|
+
const [size, setSize] = useState<string | any>(sizeOptions[1].value);
|
|
792
|
+
const [view, setView] = useState<string | any>(viewModes[0].value);
|
|
488
793
|
|
|
489
794
|
return (
|
|
490
795
|
<>
|
|
491
|
-
<div className="
|
|
492
|
-
<div className="flex gap-3
|
|
796
|
+
<div className="page-header">
|
|
797
|
+
<div className="flex gap-3 align-items-center">
|
|
798
|
+
|
|
493
799
|
|
|
494
|
-
{actionsAllowed.includes(`${createPermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.create !== false && params.embeded !== true &&
|
|
495
|
-
<SolidCreateButton url={createButtonUrl} />
|
|
496
|
-
}
|
|
497
|
-
{actionsAllowed.includes(`${createPermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.create !== false && params.embeded == true && params.inlineCreate == true &&
|
|
498
|
-
// < SolidCreateButton url={createButtonUrl} />
|
|
499
|
-
<Button type="button" icon="pi pi-plus" label="Add" size='small' className='small-button'
|
|
500
|
-
onClick={() => params.handlePopUpOpen(true)}
|
|
501
|
-
></Button>
|
|
502
|
-
}
|
|
503
800
|
{actionsAllowed.includes(`${deletePermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.delete !== false && selectedRecords.length > 0 && <Button
|
|
504
801
|
type="button"
|
|
505
802
|
label="Delete"
|
|
@@ -521,73 +818,101 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
521
818
|
}
|
|
522
819
|
|
|
523
820
|
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.enableGlobalSearch === true && params.embeded === false &&
|
|
524
|
-
<SolidGlobalSearchElement viewData={solidListViewMetaData} ></SolidGlobalSearchElement>
|
|
821
|
+
<SolidGlobalSearchElement viewData={solidListViewMetaData} showGlobalSearchElement={showGlobalSearchElement} setShowGlobalSearchElement={setShowGlobalSearchElement} customFilter={customFilter} setCustomFilter={setCustomFilter} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
|
|
525
822
|
}
|
|
526
823
|
</div>
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
824
|
+
<div className="flex align-items-center gap-3">
|
|
825
|
+
|
|
826
|
+
{actionsAllowed.includes(`${createPermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.create !== false && params.embeded !== true &&
|
|
827
|
+
<SolidCreateButton url={createButtonUrl} />
|
|
828
|
+
}
|
|
829
|
+
{actionsAllowed.includes(`${createPermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.create !== false && params.embeded == true && params.inlineCreate == true &&
|
|
830
|
+
// < SolidCreateButton url={createButtonUrl} />
|
|
831
|
+
<Button type="button" icon="pi pi-plus" label="Add" size='small' className='small-button'
|
|
832
|
+
onClick={() => params.handlePopUpOpen(true)}
|
|
833
|
+
></Button>
|
|
834
|
+
}
|
|
835
|
+
<SolidLayoutViews
|
|
836
|
+
sizeOptions={sizeOptions}
|
|
837
|
+
setSize={setSize}
|
|
838
|
+
size={size}
|
|
839
|
+
viewModes={viewModes}
|
|
840
|
+
setView={setView}
|
|
841
|
+
view={view}
|
|
842
|
+
/>
|
|
843
|
+
|
|
844
|
+
{/* {params.embeded === false &&
|
|
845
|
+
<SolidListViewOptions></SolidListViewOptions>
|
|
846
|
+
} */}
|
|
847
|
+
</div>
|
|
530
848
|
</div>
|
|
531
849
|
<style>{`.p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);}`}</style>
|
|
850
|
+
<div className="solid-datatable-wrapper">
|
|
851
|
+
<DataTable
|
|
852
|
+
value={listViewData}
|
|
853
|
+
showGridlines={false}
|
|
854
|
+
lazy
|
|
855
|
+
scrollable
|
|
856
|
+
scrollHeight="90vh"
|
|
857
|
+
size={size}
|
|
858
|
+
resizableColumns
|
|
859
|
+
paginator={true}
|
|
860
|
+
rows={rows}
|
|
861
|
+
rowsPerPageOptions={solidListViewMetaData?.data?.solidView?.layout?.attrs?.pageSizeOptions}
|
|
862
|
+
dataKey="id"
|
|
863
|
+
filters={filters}
|
|
864
|
+
emptyMessage="No Entities found."
|
|
865
|
+
onFilter={onFilter}
|
|
866
|
+
filterDisplay="menu"
|
|
867
|
+
totalRecords={totalRecords}
|
|
868
|
+
first={first}
|
|
869
|
+
onPage={onPageChange}
|
|
870
|
+
onSort={(e: DataTableStateEvent) => onSort(e)}
|
|
871
|
+
sortField={sortField}
|
|
872
|
+
sortOrder={sortOrder === 1 || sortOrder === -1 ? sortOrder : 0}
|
|
873
|
+
loading={loading || isLoading}
|
|
874
|
+
loadingIcon="pi pi-spinner"
|
|
875
|
+
selection={selectedRecords}
|
|
876
|
+
onSelectionChange={onSelectionChange}
|
|
877
|
+
selectionMode="multiple"
|
|
878
|
+
removableSort
|
|
879
|
+
filterIcon={<FilterIcon />}
|
|
880
|
+
tableClassName="solid-data-table"
|
|
881
|
+
paginatorClassName="solid-paginator"
|
|
882
|
+
>
|
|
532
883
|
|
|
533
|
-
|
|
534
|
-
value={listViewData}
|
|
535
|
-
showGridlines
|
|
536
|
-
lazy
|
|
537
|
-
size="small"
|
|
538
|
-
paginator={true}
|
|
539
|
-
rows={rows}
|
|
540
|
-
rowsPerPageOptions={solidListViewMetaData?.data?.solidView?.layout?.attrs?.pageSizeOptions}
|
|
541
|
-
dataKey="id"
|
|
542
|
-
filters={filters}
|
|
543
|
-
emptyMessage="No Entities found."
|
|
544
|
-
onFilter={onFilter}
|
|
545
|
-
filterDisplay="menu"
|
|
546
|
-
totalRecords={totalRecords}
|
|
547
|
-
first={first}
|
|
548
|
-
onPage={onPageChange}
|
|
549
|
-
onSort={(e: DataTableStateEvent) => onSort(e)}
|
|
550
|
-
sortField={sortField}
|
|
551
|
-
sortOrder={sortOrder === 1 || sortOrder === -1 ? sortOrder : 0}
|
|
552
|
-
loading={loading || isLoading}
|
|
553
|
-
loadingIcon="pi pi-spinner"
|
|
554
|
-
selection={selectedRecords}
|
|
555
|
-
onSelectionChange={onSelectionChange}
|
|
556
|
-
selectionMode="multiple"
|
|
557
|
-
removableSort
|
|
558
|
-
>
|
|
559
|
-
|
|
560
|
-
<Column selectionMode="multiple" headerStyle={{ width: "3em" }} />
|
|
884
|
+
<Column selectionMode="multiple" headerStyle={{ width: "3em" }} />
|
|
561
885
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
886
|
+
{renderColumnsDynamically(listViewMetaData)}
|
|
887
|
+
{actionsAllowed.includes(`${updatePermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.edit !== false &&
|
|
888
|
+
<Column body={detailsBodyTemplate}></Column>
|
|
889
|
+
}
|
|
890
|
+
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons &&
|
|
891
|
+
solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons.map((rowAction: any) => {
|
|
892
|
+
return (
|
|
893
|
+
<Column
|
|
894
|
+
key={rowAction}
|
|
895
|
+
body={(rowData) => (
|
|
896
|
+
<a onClick={() => {
|
|
897
|
+
setListRowActionData({
|
|
898
|
+
modelName: params.modelName,
|
|
899
|
+
moduleName: params.moduleName,
|
|
900
|
+
rowAction: rowAction,
|
|
901
|
+
rowData: rowData,
|
|
902
|
+
closeListViewRowActionPopup: closeListViewRowActionPopup
|
|
903
|
+
|
|
904
|
+
});
|
|
905
|
+
setListViewRowActionPopupState(true)
|
|
906
|
+
}
|
|
907
|
+
}>
|
|
908
|
+
<i className={rowAction?.attrs?.className ? rowAction?.attrs?.className : "pi pi-pencil"} /> {/* PrimeIcons pencil icon */}
|
|
909
|
+
</a>
|
|
910
|
+
)}
|
|
911
|
+
/>
|
|
912
|
+
);
|
|
913
|
+
})}
|
|
914
|
+
</DataTable>
|
|
915
|
+
</div>
|
|
591
916
|
<Dialog
|
|
592
917
|
visible={isDialogVisible}
|
|
593
918
|
header="Confirm Delete"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { createSolidEntityApi } from "@/redux/api/solidEntityApi";
|
|
2
|
+
import { InputTypes } from "./SolidVarInputsFilterElement"
|
|
3
3
|
import { AutoComplete, AutoCompleteCompleteEvent } from "primereact/autocomplete";
|
|
4
|
-
import qs from "qs";
|
|
5
4
|
import { useState } from "react";
|
|
5
|
+
import qs from "qs";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export const SolidManyToOneFilterElement = ({ value, updateInputs, index, fieldMetadata }: any) => {
|
|
@@ -20,7 +20,7 @@ export const SolidManyToOneFilterElement = ({ value, updateInputs, index, fieldM
|
|
|
20
20
|
limit: 10,
|
|
21
21
|
filters: {
|
|
22
22
|
[fieldMetadata.relationModel.userKeyField.name]: {
|
|
23
|
-
|
|
23
|
+
$containsi: event.query
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -45,7 +45,7 @@ const SolidBooleanColumn = ({ solidListViewMetaData, fieldMetadata, column }: So
|
|
|
45
45
|
header={header}
|
|
46
46
|
className="text-sm"
|
|
47
47
|
sortable={column.attrs.sortable}
|
|
48
|
-
filter={filterable}
|
|
48
|
+
// filter={filterable}
|
|
49
49
|
dataType={columnDataType}
|
|
50
50
|
showFilterOperator={showFilterOperator}
|
|
51
51
|
// filterMatchModeOptions={filterMatchModeOptions}
|
|
@@ -39,7 +39,7 @@ const SolidSelectionStaticColumn = ({ solidListViewMetaData, fieldMetadata, colu
|
|
|
39
39
|
header={header}
|
|
40
40
|
className="text-sm"
|
|
41
41
|
sortable={column.attrs.sortable}
|
|
42
|
-
filter={filterable}
|
|
42
|
+
// filter={filterable}
|
|
43
43
|
dataType={columnDataType}
|
|
44
44
|
showFilterOperator={showFilterOperator}
|
|
45
45
|
filterMatchModeOptions={filterMatchModeOptions}
|
|
@@ -5,7 +5,7 @@ import { FormEvent } from "primereact/ts-helpers";
|
|
|
5
5
|
import { getNumberOfInputs, SolidListViewColumnParams } from '../SolidListViewColumn';
|
|
6
6
|
import { InputTypes, SolidVarInputsFilterElement } from "../SolidVarInputsFilterElement";
|
|
7
7
|
|
|
8
|
-
const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidListViewColumnParams) => {
|
|
8
|
+
const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidListViewColumnParams) => {
|
|
9
9
|
const filterable = column.attrs.filterable;
|
|
10
10
|
const showFilterOperator = false;
|
|
11
11
|
const columnDataType = 'text';
|
|
@@ -43,9 +43,9 @@ const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column }:
|
|
|
43
43
|
key={fieldMetadata.name}
|
|
44
44
|
field={fieldMetadata.name}
|
|
45
45
|
header={header}
|
|
46
|
-
className="text-sm"
|
|
46
|
+
// className="text-sm"
|
|
47
47
|
sortable={column.attrs.sortable}
|
|
48
|
-
filter={filterable}
|
|
48
|
+
// filter={filterable}
|
|
49
49
|
dataType={columnDataType}
|
|
50
50
|
showFilterOperator={showFilterOperator}
|
|
51
51
|
filterMatchModeOptions={filterMatchModeOptions}
|
|
@@ -53,6 +53,11 @@ const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column }:
|
|
|
53
53
|
filterPlaceholder={`Search by ${fieldMetadata.displayName}`}
|
|
54
54
|
style={{ minWidth: "12rem" }}
|
|
55
55
|
headerClassName="table-header-fs"
|
|
56
|
+
// body={(data)=>{
|
|
57
|
+
// console.log("DAta", data);
|
|
58
|
+
|
|
59
|
+
// return <div className="solid-table-row">{data.name}</div>
|
|
60
|
+
// }}
|
|
56
61
|
></Column>
|
|
57
62
|
);
|
|
58
63
|
|