@dmitryvim/form-builder 0.4.0 → 0.5.0

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.
@@ -427,6 +427,20 @@ function ensureThemingHooks(doc) {
427
427
  min-height: var(--fb-slide-card-min-height);
428
428
  padding: var(--fb-slide-card-padding);
429
429
  }
430
+ /* Slides-mode outer grid. Responsive by design \u2014 column count derives from
431
+ container width and --fb-slide-min-width, not from a schema "columns" prop.
432
+ min(100%, ...) prevents the card from overflowing a narrow container.
433
+ Override per-form: set --fb-slide-min-width / --fb-slides-gap on any
434
+ ancestor (theme, host CSS, or the form root). */
435
+ .fb-container-slides {
436
+ display: grid;
437
+ gap: var(--fb-slides-gap, 14px);
438
+ align-items: stretch;
439
+ grid-template-columns: repeat(
440
+ auto-fit,
441
+ minmax(min(100%, var(--fb-slide-min-width, 280px)), 1fr)
442
+ );
443
+ }
430
444
  [data-fb-label-row] > label {
431
445
  font-size: var(--fb-label-section-font-size);
432
446
  letter-spacing: var(--fb-label-section-letter-spacing);
@@ -6896,10 +6910,7 @@ function renderSingleContainerElement(element, ctx, wrapper, pathKey) {
6896
6910
  containerWrap.appendChild(itemsWrap);
6897
6911
  wrapper.appendChild(containerWrap);
6898
6912
  }
6899
- function getChildWrapperClass(isSlides, columns) {
6900
- if (isSlides) {
6901
- return "fb-row";
6902
- }
6913
+ function getChildWrapperClass(columns) {
6903
6914
  const cols = columns || 1;
6904
6915
  return cols === 1 ? "fb-row" : `grid grid-cols-${cols} gap-2`;
6905
6916
  }
@@ -6945,9 +6956,6 @@ function renderMultipleContainerElement(element, ctx, wrapper, _pathKey) {
6945
6956
  const isSlides = element.displayMode === "slides";
6946
6957
  if (isSlides) {
6947
6958
  itemsWrap.className = "fb-container-slides";
6948
- const slideCols = element.columns;
6949
- const gridTemplateColumns = typeof slideCols === "number" && slideCols > 0 ? `repeat(${slideCols}, 1fr)` : "repeat(auto-fit, minmax(280px, 1fr))";
6950
- itemsWrap.style.cssText = `display:grid;grid-template-columns:${gridTemplateColumns};gap:var(--fb-slides-gap, 14px);align-items:start;`;
6951
6959
  } else {
6952
6960
  itemsWrap.className = "fb-row";
6953
6961
  }
@@ -6983,7 +6991,9 @@ function renderMultipleContainerElement(element, ctx, wrapper, _pathKey) {
6983
6991
  item.setAttribute("data-fb-slide-card", "");
6984
6992
  }
6985
6993
  const childWrapper = document.createElement("div");
6986
- childWrapper.className = getChildWrapperClass(isSlides, element.columns);
6994
+ childWrapper.className = getChildWrapperClass(
6995
+ isSlides ? void 0 : element.columns
6996
+ );
6987
6997
  element.elements.forEach((child) => {
6988
6998
  var _a2;
6989
6999
  if (child.type !== "markdown" && (child.hidden || child.type === "hidden")) {
@@ -7051,16 +7061,9 @@ function renderMultipleContainerElement(element, ctx, wrapper, _pathKey) {
7051
7061
  item.setAttribute("data-fb-slide-card", "");
7052
7062
  }
7053
7063
  const childWrapper = document.createElement("div");
7054
- if (isSlides) {
7055
- childWrapper.className = "fb-row";
7056
- } else {
7057
- const columns = element.columns || 1;
7058
- if (columns === 1) {
7059
- childWrapper.className = "fb-row";
7060
- } else {
7061
- childWrapper.className = `grid grid-cols-${columns} gap-2`;
7062
- }
7063
- }
7064
+ childWrapper.className = getChildWrapperClass(
7065
+ isSlides ? void 0 : element.columns
7066
+ );
7064
7067
  element.elements.forEach((child) => {
7065
7068
  var _a3, _b2;
7066
7069
  if (child.type !== "markdown" && (child.hidden || child.type === "hidden")) {
@@ -7099,16 +7102,9 @@ function renderMultipleContainerElement(element, ctx, wrapper, _pathKey) {
7099
7102
  item.setAttribute("data-fb-slide-card", "");
7100
7103
  }
7101
7104
  const childWrapper = document.createElement("div");
7102
- if (isSlides) {
7103
- childWrapper.className = "fb-row";
7104
- } else {
7105
- const columns = element.columns || 1;
7106
- if (columns === 1) {
7107
- childWrapper.className = "fb-row";
7108
- } else {
7109
- childWrapper.className = `grid grid-cols-${columns} gap-2`;
7110
- }
7111
- }
7105
+ childWrapper.className = getChildWrapperClass(
7106
+ isSlides ? void 0 : element.columns
7107
+ );
7112
7108
  element.elements.forEach((child) => {
7113
7109
  var _a2;
7114
7110
  if (child.type !== "markdown" && (child.hidden || child.type === "hidden")) {
@@ -7138,7 +7134,6 @@ function renderMultipleContainerElement(element, ctx, wrapper, _pathKey) {
7138
7134
  containerWrap.appendChild(itemsWrap);
7139
7135
  if (!containerIsReadonly) {
7140
7136
  if (isSlides) {
7141
- itemsWrap.style.alignItems = "stretch";
7142
7137
  const handle = createSlideAddTile(handleAddItem, {
7143
7138
  label: element.addLabel
7144
7139
  });