ssovee-os-web-ui 0.1.47 → 0.1.48

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/index.cjs CHANGED
@@ -3209,24 +3209,37 @@ var useGridClasses = (windowSize, gridRules) => {
3209
3209
  }, [windowSize.width]);
3210
3210
  const gridClasses = React22.useMemo(() => {
3211
3211
  const classes = {};
3212
- const resolveSpan = (spanRules) => {
3212
+ const resolveSpan = (classRules) => {
3213
+ const directRules = classRules["col-span"] ?? classRules.colSpan ?? classRules.span;
3214
+ const normalizedRules = directRules ?? classRules;
3213
3215
  const fallbackByDevice = {
3214
3216
  mobile: ["mobile", "tablet", "desktop"],
3215
3217
  tablet: ["tablet", "desktop", "mobile"],
3216
3218
  desktop: ["desktop", "tablet", "mobile"]
3217
3219
  };
3220
+ const aliasByDevice = {
3221
+ mobile: ["mobile", "sm"],
3222
+ tablet: ["tablet", "md"],
3223
+ desktop: ["desktop", "lg"]
3224
+ };
3218
3225
  const orderedDevices = fallbackByDevice[deviceType];
3219
3226
  for (const device of orderedDevices) {
3220
- const candidate = spanRules?.[device];
3221
- if (candidate) {
3222
- return candidate;
3227
+ const aliases = aliasByDevice[device];
3228
+ for (const alias of aliases) {
3229
+ const candidate = normalizedRules?.[alias];
3230
+ if (typeof candidate === "number") {
3231
+ return String(candidate);
3232
+ }
3233
+ if (typeof candidate === "string" && candidate.trim() !== "") {
3234
+ return candidate;
3235
+ }
3223
3236
  }
3224
3237
  }
3225
3238
  return "12";
3226
3239
  };
3227
3240
  for (const element in gridRules) {
3228
3241
  const classRules = gridRules[element];
3229
- const colSpan = resolveSpan(classRules["col-span"]);
3242
+ const colSpan = resolveSpan(classRules);
3230
3243
  classes[element] = `col-span-${deviceType}-${colSpan}`;
3231
3244
  }
3232
3245
  return classes;