@canlooks/can-ui 0.0.122 → 0.0.123
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/cjs/utils/style.js
CHANGED
|
@@ -200,12 +200,14 @@ function useResponsiveValue(prop, disabled = false) {
|
|
|
200
200
|
const syncBreakpoints = (0, hooks_1.useSync)(breakpoints);
|
|
201
201
|
const fn = () => {
|
|
202
202
|
let maxBreakpoint = 'xs';
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
if (typeof window !== 'undefined') {
|
|
204
|
+
for (const k in syncBreakpoints.current) {
|
|
205
|
+
if (window.innerWidth < syncBreakpoints.current[k]) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
if (k in responsiveObj) {
|
|
209
|
+
maxBreakpoint = k;
|
|
210
|
+
}
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
return responsiveObj[maxBreakpoint];
|
package/dist/esm/utils/style.js
CHANGED
|
@@ -184,12 +184,14 @@ export function useResponsiveValue(prop, disabled = false) {
|
|
|
184
184
|
const syncBreakpoints = useSync(breakpoints);
|
|
185
185
|
const fn = () => {
|
|
186
186
|
let maxBreakpoint = 'xs';
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
if (typeof window !== 'undefined') {
|
|
188
|
+
for (const k in syncBreakpoints.current) {
|
|
189
|
+
if (window.innerWidth < syncBreakpoints.current[k]) {
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
if (k in responsiveObj) {
|
|
193
|
+
maxBreakpoint = k;
|
|
194
|
+
}
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
return responsiveObj[maxBreakpoint];
|