@solidstarters/solid-core-ui 1.1.68 → 1.1.69

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 (39) hide show
  1. package/dist/components/auth/SolidRegister.d.ts.map +1 -1
  2. package/dist/components/auth/SolidRegister.js +7 -1
  3. package/dist/components/auth/SolidRegister.js.map +1 -1
  4. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  5. package/dist/components/core/common/SolidGlobalSearchElement.js +28 -31
  6. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  7. package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
  8. package/dist/components/core/kanban/KanbanCard.js +10 -3
  9. package/dist/components/core/kanban/KanbanCard.js.map +1 -1
  10. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  11. package/dist/components/core/kanban/SolidKanbanView.js +6 -5
  12. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  13. package/dist/components/core/kanban/SolidKanbanViewConfigure.d.ts +1 -1
  14. package/dist/components/core/kanban/SolidKanbanViewConfigure.d.ts.map +1 -1
  15. package/dist/components/core/kanban/SolidKanbanViewConfigure.js +2 -2
  16. package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
  17. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  18. package/dist/components/core/list/SolidListView.js +16 -15
  19. package/dist/components/core/list/SolidListView.js.map +1 -1
  20. package/dist/components/core/list/SolidListViewConfigure.d.ts +1 -1
  21. package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
  22. package/dist/components/core/list/SolidListViewConfigure.js +2 -2
  23. package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
  24. package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
  25. package/dist/components/core/model/ModelMetaData.js +18 -2
  26. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  27. package/dist/resources/globals.css +5 -0
  28. package/dist/resources/themes/solid-light-purple/theme.css +4 -0
  29. package/package.json +1 -1
  30. package/src/components/auth/SolidRegister.tsx +7 -1
  31. package/src/components/core/common/SolidGlobalSearchElement.tsx +8 -9
  32. package/src/components/core/kanban/KanbanCard.tsx +51 -5
  33. package/src/components/core/kanban/SolidKanbanView.tsx +3 -2
  34. package/src/components/core/kanban/SolidKanbanViewConfigure.tsx +2 -1
  35. package/src/components/core/list/SolidListView.tsx +4 -1
  36. package/src/components/core/list/SolidListViewConfigure.tsx +2 -1
  37. package/src/components/core/model/ModelMetaData.tsx +16 -2
  38. package/src/resources/globals.css +5 -0
  39. package/src/resources/themes/solid-light-purple/theme.css +4 -0
@@ -203,7 +203,7 @@ export const mergeSearchAndCustomFilters = (transformedFilter: any, newFilter: a
203
203
  const SavedFilterList = ({ savedfilter, activeSavedFilter, applySavedFilter, openSavedCustomFilter, setSavedFilterTobeDeleted, setIsDeleteSQDialogVisible }: any) => {
204
204
  return (
205
205
  <div className="flex align-items-center justify-content-between gap-2">
206
- <Button text size="small" className="text-base py-1 w-full" severity={Number(activeSavedFilter) == savedfilter.id ? "secondary" : "contrast" } onClick={() => applySavedFilter(savedfilter)}>{savedfilter.name}</Button>
206
+ <Button text size="small" className="text-base py-1 w-full" severity={Number(activeSavedFilter) == savedfilter.id ? "secondary" : "contrast"} onClick={() => applySavedFilter(savedfilter)}>{savedfilter.name}</Button>
207
207
  <div className="flex align-items-center gap-2">
208
208
  <Button
209
209
  icon="pi pi-pencil"
@@ -228,7 +228,7 @@ const SavedFilterList = ({ savedfilter, activeSavedFilter, applySavedFilter, ope
228
228
  )
229
229
  }
230
230
 
231
- export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCustomFilter, filters, clearFilter }: any, ref) => {
231
+ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCustomFilter, filters, clearFilter, showSaveFilterPopup, setShowSaveFilterPopup }: any, ref) => {
232
232
  const defaultState: FilterRule[] = [
233
233
  {
234
234
  id: 1,
@@ -276,7 +276,6 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
276
276
  const [searchFilter, setSearchFilter] = useState<any | null>(null);
277
277
  const [customFilter, setCustomFilter] = useState<any | null>(null);
278
278
  const [hasSearched, setHasSearched] = useState<boolean>(false);
279
- const [showSaveFilterPopup, setShowSaveFilterPopup] = useState<boolean>(false);
280
279
  const [currentSavedFilterData, setCurrentSavedFilterData] = useState<any>();
281
280
  const [savedFilterTobeDeleted, setSavedFilterTobeDeleted] = useState<any>();
282
281
  const [isDeleteSQDialogVisible, setIsDeleteSQDialogVisible] = useState<boolean>(false);
@@ -316,7 +315,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
316
315
  useEffect(() => {
317
316
 
318
317
  const filters = {
319
- $or:[
318
+ $or: [
320
319
  {
321
320
  $and: [
322
321
  { model: { $in: [viewData?.data?.solidView?.model?.id] } },
@@ -333,7 +332,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
333
332
  }
334
333
 
335
334
  ]
336
-
335
+
337
336
  }
338
337
 
339
338
  const queryData: any = {
@@ -690,7 +689,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
690
689
  <React.Fragment>
691
690
  <span key={index} className="custom-chip-value">{value}
692
691
  </span>
693
- {values.length > 1 &&
692
+ {index < values.length - 1 &&
694
693
  <span className="custom-chip-or">or</span>
695
694
  }
696
695
  </React.Fragment>
@@ -809,7 +808,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
809
808
  }
810
809
  </div>
811
810
  </Dialog>
812
- <Dialog header="Add Custom Filter" visible={showSaveFilterPopup} style={{ width: 500 }} onHide={() => { if (!showSaveFilterPopup) return; setShowSaveFilterPopup(false); }}>
811
+ <Dialog header="Save Custom Filter" visible={showSaveFilterPopup} style={{ width: 500 }} onHide={() => { if (!showSaveFilterPopup) return; setShowSaveFilterPopup(false); }}>
813
812
  <SolidSaveCustomFilterForm currentSavedFilterData={currentSavedFilterData} handleSaveFilter={handleSaveFilter} closeDialog={setShowSaveFilterPopup}></SolidSaveCustomFilterForm>
814
813
  </Dialog>
815
814
 
@@ -828,7 +827,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
828
827
  <p>Are you sure you want to delete the {currentSavedFilterData?.name} saved query?</p>
829
828
  </Dialog>
830
829
  </div>
831
- <div>
830
+ {/* <div>
832
831
  <Button
833
832
  icon="pi pi-save"
834
833
  style={{ fontSize: 10 }}
@@ -838,7 +837,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
838
837
  setShowSaveFilterPopup(true)
839
838
  }}
840
839
  />
841
- </div>
840
+ </div> */}
842
841
  </>
843
842
  )
844
843
  });
@@ -1,11 +1,10 @@
1
1
  // @ts-nocheck
2
2
  'use client';
3
-
4
- import { Draggable, DraggableProvided } from "@hello-pangea/dnd";
5
- import { Card } from "primereact/card";
6
- import React from "react";
3
+ import React, { useRef } from "react";
7
4
  import { SolidKanbanViewFields } from "./SolidKanbanViewFields";
8
5
  import { useRouter } from "next/navigation";
6
+ import { Button } from "primereact/button";
7
+ import { OverlayPanel } from "primereact/overlaypanel";
9
8
 
10
9
  // Define the types for the data and props
11
10
  interface Data {
@@ -162,6 +161,53 @@ const KanbanCard: React.FC<KanbanCardProps> = ({ data, solidKanbanViewMetaData,
162
161
  return dynamicForm;
163
162
  };
164
163
 
164
+ const kanbanActionRef = useRef(null);
165
+
166
+ const renderKanbanAction = (data, groupedView) => {
167
+ return (
168
+ <div className="solid-kanban-action" onClick={(e) => e.stopPropagation()}>
169
+ <Button
170
+ size="small"
171
+ text
172
+ className="text-sm p-0"
173
+ icon="pi pi-ellipsis-v"
174
+ onClick={(e) => kanbanActionRef.current.toggle(e)}
175
+ style={{ width: 25, height: 25 }}
176
+ />
177
+ <OverlayPanel ref={kanbanActionRef} className="solid-custom-overlay">
178
+ <div className="flex flex-column">
179
+ <Button
180
+ type="button"
181
+ className="w-8rem text-left gap-1"
182
+ label="Edit"
183
+ size="small"
184
+ iconPos="left"
185
+ text
186
+ icon={"pi pi-pencil"}
187
+ onClick={() => router.push(`${editButtonUrl}/${data?.id}`)}
188
+ />
189
+ {!groupedView &&
190
+ <a
191
+ href={data?.relativeUri}
192
+ download={data?.originalFileName}
193
+ target="_blank"
194
+ rel="noopener noreferrer"
195
+ >
196
+ <Button
197
+ type="button"
198
+ className="w-8rem text-left gap-1"
199
+ label="Download"
200
+ size="small"
201
+ iconPos="left"
202
+ icon={"pi pi-download"}
203
+ />
204
+ </a>
205
+ }
206
+ </div>
207
+ </OverlayPanel>
208
+ </div>
209
+ )
210
+ }
165
211
 
166
212
  return (
167
213
  <Draggable draggableId={String(data.id)} index={index} isDragDisabled={!groupedView}>
@@ -191,8 +237,8 @@ const KanbanCard: React.FC<KanbanCardProps> = ({ data, solidKanbanViewMetaData,
191
237
  router.push(`${editButtonUrl}/${data?.id}`)
192
238
  }}
193
239
  >
240
+ {renderKanbanAction(data, groupedView)}
194
241
  {renderFormDynamically(solidKanbanViewMetaData)}
195
-
196
242
  {/* {solidKanbanViewMetaData?.solidView?.layout?.layoutData &&
197
243
  Object.entries(solidKanbanViewMetaData?.solidView?.layout?.layoutData).map(([key, value]) => (
198
244
  <p className="kanban-card-heading" key={key}>{data[value]}</p>
@@ -236,7 +236,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
236
236
  const [columnsCount, setColumnsCount] = useState(5);
237
237
  const [swimLaneCurrentPageNumber, setSwimLaneCurrentPageNumber] = useState(1);
238
238
  const [queryDataLoaded, setQueryDataLoaded] = useState(false);
239
-
239
+ const [showSaveFilterPopup, setShowSaveFilterPopup] = useState<boolean>(false);
240
240
 
241
241
 
242
242
  const showToast = (severity: "success" | "error", summary: string, detail: string) => {
@@ -722,7 +722,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
722
722
  <p className="m-0 view-title">{kanbanViewTitle}</p>
723
723
  {solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.enableGlobalSearch === true &&
724
724
  // <SolidGlobalSearchElement viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
725
- <SolidGlobalSearchElement ref={solidGlobalSearchElementRef} viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
725
+ <SolidGlobalSearchElement showSaveFilterPopup={showSaveFilterPopup} setShowSaveFilterPopup={setShowSaveFilterPopup} ref={solidGlobalSearchElementRef} viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
726
726
 
727
727
  }
728
728
  </div>
@@ -754,6 +754,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
754
754
  actionsAllowed={actionsAllowed}
755
755
  viewModes={viewModes}
756
756
  setLayoutDialogVisible={setLayoutDialogVisible}
757
+ setShowSaveFilterPopup={setShowSaveFilterPopup}
757
758
  />
758
759
  {/* <SolidConfigureLayoutElement></SolidConfigureLayoutElement> */}
759
760
  </div>
@@ -7,7 +7,7 @@ import { OverlayPanel } from 'primereact/overlaypanel';
7
7
  import { RadioButton } from 'primereact/radiobutton';
8
8
  import React, { useEffect, useRef, useState } from 'react'
9
9
 
10
- export const SolidKanbanViewConfigure = ({ solidKanbanViewMetaData, actionsAllowed, setLayoutDialogVisible, viewModes }: any) => {
10
+ export const SolidKanbanViewConfigure = ({ solidKanbanViewMetaData, actionsAllowed, setLayoutDialogVisible, viewModes, setShowSaveFilterPopup }: any) => {
11
11
  const op = useRef(null);
12
12
  const customizeLayout = useRef<OverlayPanel | null>(null);
13
13
  const pathname = usePathname();
@@ -98,6 +98,7 @@ export const SolidKanbanViewConfigure = ({ solidKanbanViewMetaData, actionsAllow
98
98
  >
99
99
  <i className="pi pi-chevron-right text-sm"></i>
100
100
  </Button>
101
+ <Button text icon='pi pi-save' label="Save Custom Filter" size="small" severity="secondary" className="text-left gap-2 text-base" onClick={() => setShowSaveFilterPopup(true)} />
101
102
  <OverlayPanel ref={customizeLayout} className="customize-layout-panel" style={{ minWidth: 250 }}
102
103
  onShow={() => setIsOverlayOpen(true)}
103
104
  onHide={() => {
@@ -267,6 +267,8 @@ export const SolidListView = (params: SolidListViewParams) => {
267
267
  const [showArchived, setShowArchived] = useState(false);
268
268
  const [queryDataLoaded, setQueryDataLoaded] = useState(false);
269
269
  const [customFilter, setCustomFilter] = useState(null);
270
+ const [showSaveFilterPopup, setShowSaveFilterPopup] = useState<boolean>(false);
271
+
270
272
  const sizeOptions = [
271
273
  { label: 'Compact', value: 'small', image: CompactImage },
272
274
  { label: 'Cozy', value: 'normal', image: CozyImage },
@@ -713,7 +715,7 @@ export const SolidListView = (params: SolidListViewParams) => {
713
715
  <div className="flex gap-3 align-items-center">
714
716
  <p className="m-0 view-title">{solidListViewMetaData?.data?.solidView?.displayName}</p>
715
717
  {solidListViewMetaData?.data?.solidView?.layout?.attrs?.enableGlobalSearch === true && params.embeded === false &&
716
- <SolidGlobalSearchElement filters={filters} clearFilter={clearFilter} ref={solidGlobalSearchElementRef} viewData={solidListViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter}></SolidGlobalSearchElement>
718
+ <SolidGlobalSearchElement showSaveFilterPopup={showSaveFilterPopup} setShowSaveFilterPopup={setShowSaveFilterPopup} filters={filters} clearFilter={clearFilter} ref={solidGlobalSearchElementRef} viewData={solidListViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter}></SolidGlobalSearchElement>
717
719
  }
718
720
  </div>
719
721
  <div className="flex align-items-center gap-3">
@@ -758,6 +760,7 @@ export const SolidListView = (params: SolidListViewParams) => {
758
760
  actionsAllowed={actionsAllowed}
759
761
  selectedRecords={selectedRecords}
760
762
  setDialogVisible={setDialogVisible}
763
+ setShowSaveFilterPopup={setShowSaveFilterPopup}
761
764
  />
762
765
  }
763
766
 
@@ -11,7 +11,7 @@ import { RadioButton } from "primereact/radiobutton";
11
11
  import { useEffect, useRef, useState } from "react";
12
12
  import { SolidListColumnSelector } from "./SolidListColumnSelector";
13
13
 
14
- export const SolidListViewConfigure = ({ listViewMetaData, setShowArchived, showArchived, viewData, sizeOptions, setSize, size, viewModes, params, actionsAllowed, selectedRecords, setDialogVisible }: any) => {
14
+ export const SolidListViewConfigure = ({ listViewMetaData, setShowArchived, showArchived, viewData, sizeOptions, setSize, size, viewModes, params, actionsAllowed, selectedRecords, setDialogVisible, setShowSaveFilterPopup }: any) => {
15
15
  // const [visible, setVisible] = useState<boolean>(false);
16
16
  const op = useRef(null);
17
17
  const customizeLayout = useRef<OverlayPanel | null>(null);
@@ -120,6 +120,7 @@ export const SolidListViewConfigure = ({ listViewMetaData, setShowArchived, show
120
120
  >
121
121
  <i className="pi pi-chevron-right text-sm"></i>
122
122
  </Button>
123
+ <Button text icon='pi pi-save' label="Save Custom Filter" size="small" severity="secondary" className="text-left gap-2 text-base" onClick={() => setShowSaveFilterPopup(true)} />
123
124
  {/* <p className="mt-3 mb-1 font-medium" style={{ color: 'var(--gray-400)' }}>Saved Layouts</p> */}
124
125
  {/* <Button text severity="secondary" label="Diet Tracking" icon="pi pi-plus" size="small" /> */}
125
126
  <OverlayPanel ref={customizeLayout} className="customize-layout-panel" style={{ minWidth: 250 }}
@@ -104,8 +104,22 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
104
104
  enableAuditTracking: Yup.boolean(),
105
105
  internationalisation: Yup.boolean(),
106
106
  isChild: Yup.boolean(),
107
- parentModelId: Yup.number(),
108
- parentModel: Yup.object()
107
+ parentModelId: Yup.number().when("isChild", (isChild: any, schema) => {
108
+ console.log("relationCreateInverse", isChild);
109
+ if (isChild.length > 0 && isChild[0] == true) {
110
+ return schema.required("Parent Model Id is required")
111
+ } else {
112
+ return schema.notRequired().nullable();
113
+ }
114
+ }),
115
+ parentModel: Yup.object().when("isChild", (isChild: any, schema) => {
116
+ console.log("relationCreateInverse", isChild);
117
+ if (isChild.length > 0 && isChild[0] == true) {
118
+ return schema.required("Parent Model is required")
119
+ } else {
120
+ return schema.notRequired().nullable();
121
+ }
122
+ }),
109
123
 
110
124
  });
111
125
 
@@ -2938,6 +2938,11 @@ li.header-li-px {
2938
2938
  max-width: calc(20% - 20px);
2939
2939
  }
2940
2940
 
2941
+ .solid-kanban-action {
2942
+ position: absolute;
2943
+ right: 5px;
2944
+ }
2945
+
2941
2946
  .solid-kanban-card {
2942
2947
  box-shadow: none;
2943
2948
  border-radius: 0.5rem;
@@ -6205,6 +6205,10 @@
6205
6205
  background-color: #EFF1F4;
6206
6206
  }
6207
6207
 
6208
+ .solid-kanban-board-wrapper {
6209
+ border-top: 1px solid var(--primary-light-color);
6210
+ }
6211
+
6208
6212
  .solid-kanban-card,
6209
6213
  .solid-media-card {
6210
6214
  border: 1px solid var(--solid-kanban-wrapper);