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.
- package/EventCalendar/index.js +37 -7
- package/EventCalendarTimeline/index.js +61 -45
- package/MasonryLayout/index.js +19 -9
- package/lib/cjs/EventCalendar/index.js +37 -7
- package/lib/cjs/EventCalendarTimeline/index.js +61 -45
- package/lib/cjs/MasonryLayout/index.js +19 -9
- package/lib/esm/EventCalendar/index.tsx +35 -7
- package/lib/esm/EventCalendarTimeline/index.tsx +349 -341
- package/lib/esm/MasonryLayout/index.tsx +21 -8
- package/lib/esm/ModalDialog/index.tsx +0 -1
- package/package.json +1 -1
- package/MasonryLayout/index.css +0 -6
- package/lib/css/MasonryLayout/index.css +0 -6
- package/lib/esm/MasonryLayout/index.scss +0 -13
|
@@ -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 ? {
|
|
118
|
+
<div style={perBrickWidth > 0 ? {width: perBrickWidth + 'px'} : undefined}>{el}</div>
|
|
106
119
|
</div>
|
|
107
120
|
);
|
|
108
121
|
});
|
|
109
122
|
|
|
110
123
|
|
|
111
|
-
// STEP
|
|
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
|
|
141
|
+
// STEP 6:
|
|
129
142
|
//=================
|
|
130
143
|
setItems(result);
|
|
131
144
|
|
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.
|
|
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",
|
package/MasonryLayout/index.css
DELETED