funda-ui 4.5.522 → 4.5.585

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.
@@ -8,9 +8,9 @@ import {
8
8
 
9
9
 
10
10
  export type MasonryLayoutProps = {
11
- columns?: number,
12
- gap?: number,
13
- breakPoints?: Record<number, number>
11
+ columns?: number;
12
+ gap?: number;
13
+ breakPoints?: Record<number, number>;
14
14
  /** -- */
15
15
  id?: string;
16
16
  tabIndex?: number;
@@ -75,8 +75,21 @@ const MasonryLayout = (props: MasonryLayoutProps) => {
75
75
  columnWrapper[`${itemWrapperKey}${i}`] = [];
76
76
  }
77
77
 
78
+
78
79
  // STEP 3:
79
80
  //=================
81
+ // Calculate the wrapper width based on the gap
82
+ let wrapperTotalGap: number = 0;
83
+ for (let i = 0; i < colCount; i++) {
84
+ if (i > 0) {
85
+ wrapperTotalGap += GAP;
86
+ }
87
+ }
88
+ if (rootRef.current) rootRef.current.style.width = `calc(100% - ${wrapperTotalGap}px)`;
89
+
90
+
91
+ // STEP 4:
92
+ //=================
80
93
  // Divide the children into columns
81
94
  let items: React.ReactNode[] = [];
82
95
 
@@ -94,21 +107,21 @@ const MasonryLayout = (props: MasonryLayoutProps) => {
94
107
 
95
108
  items.forEach((el: React.ReactNode, i: number) => {
96
109
  const columnIndex = i % colCount;
110
+
97
111
  columnWrapper[`${itemWrapperKey}${columnIndex}`].push(
98
112
  <div
99
113
  key={i}
100
- className="masonry-item"
101
114
  style={{
102
115
  marginBottom: `${GAP}px`
103
116
  }}
104
117
  >
105
- <div style={perBrickWidth > 0 ? {maxWidth: perBrickWidth + 'px'} : undefined}>{el}</div>
118
+ <div style={perBrickWidth > 0 ? {width: perBrickWidth + 'px'} : undefined}>{el}</div>
106
119
  </div>
107
120
  );
108
121
  });
109
122
 
110
123
 
111
- // STEP 4:
124
+ // STEP 5:
112
125
  //=================
113
126
  // Wrapping the items in each column with a div and pushing it into the result array
114
127
  for (let i = 0; i < colCount; i++) {
@@ -118,14 +131,14 @@ const MasonryLayout = (props: MasonryLayoutProps) => {
118
131
  className="masonry-item"
119
132
  style={{
120
133
  marginLeft: `${i > 0 ? GAP : 0}px`,
121
- flex: 1
134
+ flex: '0 1 auto'
122
135
  }}>
123
136
  {columnWrapper[`${itemWrapperKey}${i}`]}
124
137
  </div>
125
138
  );
126
139
  }
127
140
 
128
- // STEP 5:
141
+ // STEP 6:
129
142
  //=================
130
143
  setItems(result);
131
144
 
@@ -13,7 +13,6 @@ import {
13
13
  } from 'funda-utils/dist/cjs/bodyScrollLock';
14
14
 
15
15
 
16
-
17
16
  declare global {
18
17
  interface Window {
19
18
  curVideo?: any;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "UIUX Lab",
3
3
  "email": "uiuxlab@gmail.com",
4
4
  "name": "funda-ui",
5
- "version": "4.5.522",
5
+ "version": "4.5.585",
6
6
  "description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,6 +0,0 @@
1
- /* ======================================================
2
- <!-- Masonry Layout -->
3
- /* ====================================================== */
4
- .masonry__wrapper .masonry-item > * {
5
- width: 100%;
6
- }
@@ -1,6 +0,0 @@
1
- /* ======================================================
2
- <!-- Masonry Layout -->
3
- /* ====================================================== */
4
- .masonry__wrapper .masonry-item > * {
5
- width: 100%;
6
- }
@@ -1,13 +0,0 @@
1
- /* ======================================================
2
- <!-- Masonry Layout -->
3
- /* ====================================================== */
4
-
5
- .masonry__wrapper {
6
-
7
- .masonry-item {
8
- > * {
9
- width: 100%;
10
- }
11
- }
12
-
13
- }