@solidstarters/solid-core-ui 1.1.43 → 1.1.45

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 (79) hide show
  1. package/dist/components/common/SolidModuleHome.d.ts +1 -5
  2. package/dist/components/common/SolidModuleHome.d.ts.map +1 -1
  3. package/dist/components/common/SolidModuleHome.js +2 -8
  4. package/dist/components/common/SolidModuleHome.js.map +1 -1
  5. package/dist/components/common/SolidThemeProvider.d.ts +2 -0
  6. package/dist/components/common/SolidThemeProvider.d.ts.map +1 -0
  7. package/dist/components/common/SolidThemeProvider.js +38 -0
  8. package/dist/components/common/SolidThemeProvider.js.map +1 -0
  9. package/dist/components/core/form/fields/SolidEmailField.js +1 -1
  10. package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
  11. package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
  12. package/dist/components/core/kanban/KanbanBoard.js +11 -11
  13. package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
  14. package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
  15. package/dist/components/core/kanban/KanbanCard.js +33 -7
  16. package/dist/components/core/kanban/KanbanCard.js.map +1 -1
  17. package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
  18. package/dist/components/core/kanban/KanbanColumn.js +4 -3
  19. package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
  20. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  21. package/dist/components/core/kanban/SolidKanbanView.js +34 -33
  22. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  23. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.js +1 -1
  24. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.js.map +1 -1
  25. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.js +1 -1
  26. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.js.map +1 -1
  27. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.js +1 -1
  28. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.js.map +1 -1
  29. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.js +1 -1
  30. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.js.map +1 -1
  31. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.js +1 -1
  32. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.js.map +1 -1
  33. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.js +1 -1
  34. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.js.map +1 -1
  35. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +1 -1
  36. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +39 -15
  37. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +1 -1
  38. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +1 -1
  39. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +17 -7
  40. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +1 -1
  41. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.js +1 -1
  42. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.js.map +1 -1
  43. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.js +1 -1
  44. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.js.map +1 -1
  45. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
  46. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +8 -8
  47. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
  48. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.js +1 -1
  49. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.js.map +1 -1
  50. package/dist/components/core/list/SolidListViewConfigure.js +1 -1
  51. package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
  52. package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
  53. package/dist/components/core/list/columns/SolidMediaSingleColumn.js +20 -19
  54. package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
  55. package/dist/resources/globals.css +71 -22
  56. package/package.json +1 -1
  57. package/publish.js +3 -0
  58. package/src/components/common/SolidModuleHome.tsx +52 -59
  59. package/src/components/common/SolidThemeProvider.tsx +44 -0
  60. package/src/components/core/form/fields/SolidEmailField.tsx +1 -1
  61. package/src/components/core/kanban/KanbanBoard.tsx +36 -34
  62. package/src/components/core/kanban/KanbanCard.tsx +37 -24
  63. package/src/components/core/kanban/KanbanColumn.tsx +10 -5
  64. package/src/components/core/kanban/SolidKanbanView.tsx +30 -42
  65. package/src/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +1 -1
  66. package/src/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +1 -1
  67. package/src/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +1 -1
  68. package/src/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +1 -1
  69. package/src/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +1 -1
  70. package/src/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +1 -1
  71. package/src/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +106 -38
  72. package/src/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +61 -16
  73. package/src/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +1 -1
  74. package/src/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +1 -1
  75. package/src/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +14 -13
  76. package/src/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +1 -1
  77. package/src/components/core/list/SolidListViewConfigure.tsx +1 -1
  78. package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +43 -33
  79. package/src/resources/globals.css +71 -22
@@ -1,43 +1,57 @@
1
1
  'use client';
2
- import React from 'react';
3
- import { Column, ColumnFilterElementTemplateOptions } from "primereact/column";
4
- import { InputTypes, SolidVarInputsFilterElement } from "../SolidVarInputsFilterElement";
2
+ import React, { useState } from 'react';
3
+ import { Column } from "primereact/column";
5
4
  import { SolidListViewColumnParams } from '../SolidListViewColumn';
6
- import { FormEvent } from "primereact/ts-helpers";
7
- import { FilterMatchMode } from 'primereact/api';
8
- import { Button } from 'primereact/button';
5
+ import { classNames } from 'primereact/utils';
9
6
 
10
- const SolidMediaSingleColumn = ({ solidListViewMetaData, fieldMetadata, column, setLightboxUrls, setOpenLightbox }: SolidListViewColumnParams) => {
11
- // const filterable = column.attrs.filterable;
7
+ const isImageFile = (url: string) => {
8
+ return /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(url);
9
+ };
12
10
 
13
- const filterable = false;
14
- const showFilterOperator = false;
15
- const columnDataType = undefined;
16
- const header = column.attrs.label ?? fieldMetadata.displayName;
17
- const imageBodyTemplate = (product: any) => {
18
- if (!product?._media?.[fieldMetadata.name]) return null;
19
- const imageUrls = product._media[fieldMetadata.name].map((i: any) => i._full_url);
11
+ const MediaWithFallback = ({ src, alt, onClick }: { src: string; alt: string; onClick: (event: React.MouseEvent) => void }) => {
12
+ const [isBroken, setIsBroken] = useState(false);
20
13
 
21
- return (
22
- imageUrls.length > 0 ?
14
+ return (
15
+ <div style={{ width: 40, height: 40, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
16
+ {!isBroken && isImageFile(src) ? (
23
17
  <img
24
- src={imageUrls[0]}
25
- alt="product-image-single"
18
+ src={src}
19
+ alt={alt}
26
20
  className="shadow-2 border-round"
27
21
  width={40}
28
22
  height={40}
29
23
  style={{ objectFit: "cover" }}
24
+ onError={() => setIsBroken(true)} // Handle broken image
25
+ onClick={onClick}
26
+ />
27
+ ) : (
28
+ <i className={classNames(isImageFile(src) ? "pi pi-image" : "pi pi-file", "text-3xl text-gray-400")}></i> // Image or file icon
29
+ )}
30
+ </div>
31
+ );
32
+ };
33
+
34
+ const SolidMediaSingleColumn = ({ solidListViewMetaData, fieldMetadata, column, setLightboxUrls, setOpenLightbox }: SolidListViewColumnParams) => {
35
+ const header = column.attrs.label ?? fieldMetadata.displayName;
36
+
37
+ const mediaBodyTemplate = (product: any) => {
38
+ if (!product?._media?.[fieldMetadata.name]) return null;
39
+ const mediaUrls = product._media[fieldMetadata.name].map((i: any) => i._full_url);
40
+
41
+ return (
42
+ mediaUrls.length > 0 ? (
43
+ <MediaWithFallback
44
+ src={mediaUrls[0]}
45
+ alt="product-media"
30
46
  onClick={(event) => {
31
47
  event.stopPropagation();
32
- setLightboxUrls([{ src: imageUrls[0], downloadUrl: imageUrls[0] }]);
48
+ setLightboxUrls([{ src: mediaUrls[0], downloadUrl: mediaUrls[0] }]);
33
49
  setOpenLightbox(true);
34
50
  }}
35
51
  />
36
- :
37
- <div
38
- style={{ height: 40, width: 40 }}
39
- >
40
- </div>
52
+ ) : (
53
+ <i className="pi pi-image text-3xl text-gray-400"></i> // Default fallback icon
54
+ )
41
55
  );
42
56
  };
43
57
 
@@ -46,18 +60,14 @@ const SolidMediaSingleColumn = ({ solidListViewMetaData, fieldMetadata, column,
46
60
  key={fieldMetadata.name}
47
61
  field={fieldMetadata.name}
48
62
  header={header}
49
- body={imageBodyTemplate}
50
- // className="text-sm"
63
+ body={mediaBodyTemplate}
51
64
  sortable={column.attrs.sortable}
52
- // filter={filterable}
53
- dataType={columnDataType}
54
- showFilterOperator={showFilterOperator}
65
+ showFilterOperator={false}
55
66
  filterPlaceholder={`Search by ${fieldMetadata.displayName}`}
56
67
  style={{ minWidth: "12rem" }}
57
68
  headerClassName="table-header-fs"
58
- ></Column>
69
+ />
59
70
  );
60
-
61
71
  };
62
72
 
63
- export default SolidMediaSingleColumn;
73
+ export default SolidMediaSingleColumn;
@@ -1529,21 +1529,14 @@ li.header-li-px {
1529
1529
  font-size: 0.8rem;
1530
1530
  }
1531
1531
 
1532
- .kanban-options-panel .p-overlaypanel-content {
1533
- padding: 0 !important;
1534
- }
1535
-
1536
- .kanban-options-panel .p-overlaypanel-content span {
1537
- padding: 0 !important;
1538
- font-size: 1rem;
1539
- }
1540
-
1541
1532
  .kanban-column {
1542
1533
  flex: 1;
1543
- max-width: 350px;
1544
- background: #f0f0f5;
1534
+ min-width: 270px;
1535
+ width: 100%;
1536
+ max-width: 270px;
1537
+ /* background: #f0f0f5;
1545
1538
  border: 8px;
1546
- padding: 0.2rem;
1539
+ padding: 0.2rem; */
1547
1540
  }
1548
1541
 
1549
1542
  .kanban-card {
@@ -1565,19 +1558,15 @@ li.header-li-px {
1565
1558
  color: #4b4d52;
1566
1559
  }
1567
1560
 
1568
- .kanban-group-heading {
1569
- font-size: 1rem;
1570
- font-weight: 600;
1571
- letter-spacing: 2px;
1572
- }
1573
-
1574
1561
  .kanban-column-folded {
1575
1562
  flex-grow: 0;
1576
- background: #f0f0f5;
1563
+ background: #F4F4F4;
1577
1564
  border: 8px;
1578
1565
  padding: 5px;
1579
1566
  height: 100%;
1580
- font-size: 1rem;
1567
+ min-width:fit-content;
1568
+ width: 100%;
1569
+ max-width:fit-content;
1581
1570
  }
1582
1571
 
1583
1572
  .kaban-heading-area {
@@ -2902,6 +2891,66 @@ li.header-li-px {
2902
2891
  max-width: calc(20% - 10px);
2903
2892
  }
2904
2893
 
2905
- .image-preview{
2906
- max-width: 100px;
2894
+ .solid-kanban-card {
2895
+ box-shadow: none;
2896
+ border-radius: 0.5rem;
2897
+ border: 1px solid rgba(216, 226, 234, 0.60);
2898
+ background: #FFF;
2899
+ padding: 9px;
2900
+ }
2901
+
2902
+ .kanban-group-heading {
2903
+ font-weight: 600;
2904
+ display: flex;
2905
+ align-items: center;
2906
+ gap: 10px;
2907
+ }
2908
+
2909
+ .kanban-count-badge {
2910
+ display: flex;
2911
+ width: 1.5rem;
2912
+ height: 1.5rem;
2913
+ padding: 0.125rem;
2914
+ justify-content: center;
2915
+ align-items: center;
2916
+ flex-shrink: 0;
2917
+ border-radius: 6.25rem;
2918
+ background: #F6FAFF;
2919
+ font-size: 0.75rem;
2920
+ font-weight: 600;
2921
+ color: var(--primary-color);
2922
+ }
2923
+
2924
+ .kanban-image-preview {
2925
+ /* width: 100px; */
2926
+ /* width: 240px;
2927
+ height: 120px;
2928
+ flex-shrink: 0; */
2929
+ width: 100%;
2930
+ border-radius: 8px;
2931
+ max-height: 120px;
2932
+ }
2933
+
2934
+ .solid-kanban-board-wrapper {
2935
+ border-top: 1px solid #CED0D6;
2936
+ overflow: hidden;
2937
+ height: calc(100vh - 64px) !important;
2938
+ }
2939
+
2940
+ .solid-kanban-board-scroll-context {
2941
+ overflow: auto;
2942
+ height: 100%;
2943
+ }
2944
+
2945
+ .kanban-column-cogwheel.p-button.p-button-icon-only.p-button-rounded {
2946
+ height: 2rem;
2947
+ width: 2rem;
2948
+ }
2949
+
2950
+ .kanban-column-cogwheel.p-button.p-button-secondary.p-button-text:not(:disabled):active {
2951
+ background: transparent;
2952
+ }
2953
+
2954
+ .kanban-column-cogwheel.p-button.p-button-secondary.p-button-text:not(:disabled):hover {
2955
+ background: transparent;
2907
2956
  }