json-renderers 1.18.8 → 1.19.1

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/docs/dist/min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const it = {
2
- version: "v18.0.0",
2
+ version: "v19.0.0",
3
3
  description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
4
  }, ct = (t) => {
5
5
  const a = t;
@@ -87,29 +87,29 @@ const it = {
87
87
  if (!a || typeof a != "object" || Array.isArray(a))
88
88
  throw new TypeError("Config must be an object");
89
89
  return mt(a), ht(a), ft(a), !0;
90
- }, yt = "table", Ct = "", wt = [], gt = [], $t = "", Nt = "replace", Tt = !1, g = {
90
+ }, yt = "table", Ct = "", wt = [], $t = [], gt = "", Nt = "replace", Tt = !1, $ = {
91
91
  type: yt,
92
92
  targetHtmlId: Ct,
93
93
  data: wt,
94
- columns: gt,
95
- classToApply: $t,
94
+ columns: $t,
95
+ classToApply: gt,
96
96
  appendPosition: Nt,
97
97
  showLog: Tt
98
98
  }, G = (t) => {
99
99
  const a = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
100
- return a && a in g ? g[a] : { ...g };
100
+ return a && a in $ ? $[a] : { ...$ };
101
101
  };
102
- Object.assign(G, g);
103
- const $ = (t) => {
102
+ Object.assign(G, $);
103
+ const g = (t) => {
104
104
  const a = (t == null ? void 0 : t.inConfig) ?? t;
105
105
  if (!a || typeof a != "object" || Array.isArray(a))
106
106
  throw new TypeError("Config must be an object");
107
107
  return P(a), q(a), !0;
108
108
  };
109
- $.getSpec = G;
110
- $.configSpec = g;
111
- $.guardSpec = P;
112
- $.guardMount = q;
109
+ g.getSpec = G;
110
+ g.configSpec = $;
111
+ g.guardSpec = P;
112
+ g.guardMount = q;
113
113
  const xt = {
114
114
  version: "1.22.0",
115
115
  name: "json-renderers-build"
@@ -584,7 +584,7 @@ const Rt = (t, a) => {
584
584
  templateKey: "buildBodyCell",
585
585
  func: "applyTemplate"
586
586
  }
587
- ], ge = [
587
+ ], $e = [
588
588
  {
589
589
  narration: "Prepend an empty cell into the table footer row if footer row is present.",
590
590
  destinationPath: {
@@ -605,7 +605,7 @@ const Rt = (t, a) => {
605
605
  templateKey: "emptyCell",
606
606
  func: "applyTemplate"
607
607
  }
608
- ], R = { applyTemplate: p }, $e = (t = {}, a = {}, e = !1, o = []) => {
608
+ ], R = { applyTemplate: p }, ge = (t = {}, a = {}, e = !1, o = []) => {
609
609
  let n = t, s = a;
610
610
  t && typeof t == "object" && "inTableSpec" in t && (n = t.inTableSpec, s = t.inSerial || a);
611
611
  const i = {
@@ -623,7 +623,7 @@ const Rt = (t, a) => {
623
623
  };
624
624
  f(we, i, R, b, e, o);
625
625
  const l = C(n, "table-footer-row");
626
- return l && Array.isArray(l.children) && l.children.length > 0 && f(ge, i, R, b, e, o), n;
626
+ return l && Array.isArray(l.children) && l.children.length > 0 && f($e, i, R, b, e, o), n;
627
627
  }, Ne = [
628
628
  {
629
629
  narration: "Append the options column width to the table colgroup.",
@@ -727,7 +727,7 @@ const Rt = (t, a) => {
727
727
  return l && Array.isArray(l.children) && l.children.length > 0 && f(Te, i, v, b, e, o), n;
728
728
  }, X = ({ inOptions: t = {}, inBase: a, showLog: e = !1, returnLog: o = [] }) => {
729
729
  const n = t, s = a;
730
- return (n.showSerial || n.serial) && $e(s, n.serial || {}, e, o), (n.showOptions || n.options) && xe(s, n.options || {}, e, o), s;
730
+ return (n.showSerial || n.serial) && ge(s, n.serial || {}, e, o), (n.showOptions || n.options) && xe(s, n.options || {}, e, o), s;
731
731
  }, E = { fromCollection: m, twoDimensional: N }, Pe = (t = {}, a = !1, e = []) => {
732
732
  const o = t, n = o.columns || [], s = o.data || [], r = o.options, i = structuredClone(Yt), l = {
733
733
  data: {
@@ -1135,7 +1135,7 @@ const Rt = (t, a) => {
1135
1135
  }, I = ({ inOptions: t = {}, options: a = {} } = {}) => {
1136
1136
  const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(wa), n = o.children[0], s = o.children[1];
1137
1137
  return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, s.attributes.id = e.id), e.placeholder && (s.attributes.placeholder = e.placeholder), e.class && (s.attributes.class = e.class), e.name && (s.attributes.name = e.name), e.type && (s.attributes.type = e.type), e.wrapperClass && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
1138
- }, ga = "div", $a = {
1138
+ }, $a = "div", ga = {
1139
1139
  class: "d-flex align-items-center gap-2"
1140
1140
  }, Na = [
1141
1141
  {
@@ -1165,8 +1165,8 @@ const Rt = (t, a) => {
1165
1165
  }
1166
1166
  }
1167
1167
  ], Ta = {
1168
- tagName: ga,
1169
- attributes: $a,
1168
+ tagName: $a,
1169
+ attributes: ga,
1170
1170
  children: Na
1171
1171
  }, j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1172
1172
  const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(Ta), n = o.children[0], s = o.children[1], r = o.children[2];
@@ -1679,16 +1679,16 @@ const k = ({ inOptions: t = {}, options: a = {} } = {}) => {
1679
1679
  buildInlineField: "buildInlineFieldWithButton",
1680
1680
  buildInlineRequiredField: "buildInlineRequiredFieldWithButton"
1681
1681
  }
1682
- }, go = {
1682
+ }, $o = {
1683
1683
  fieldTemplates: {},
1684
1684
  buttonFieldTemplates: {}
1685
- }, $o = {
1685
+ }, go = {
1686
1686
  fieldTemplates: {},
1687
1687
  buttonFieldTemplates: {}
1688
1688
  }, No = {
1689
1689
  inline: wo,
1690
- stacked: go,
1691
- threeColumns: $o
1690
+ stacked: $o,
1691
+ threeColumns: go
1692
1692
  }, To = {
1693
1693
  actions: []
1694
1694
  }, xo = {
@@ -1906,12 +1906,14 @@ const Ho = ({
1906
1906
  inColumns: t,
1907
1907
  inType: a = "table",
1908
1908
  inData: e,
1909
- inShowLog: o = !1
1909
+ inShowLog: o = !1,
1910
+ inOptions: n
1910
1911
  } = {}) => at({
1911
1912
  type: a,
1912
1913
  data: e ?? [],
1913
1914
  columns: t,
1914
- showLog: o
1915
+ showLog: o,
1916
+ options: n
1915
1917
  }), Mo = {
1916
1918
  version: "v10",
1917
1919
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
@@ -2028,15 +2030,18 @@ const en = ({
2028
2030
  const c = document.getElementById(s);
2029
2031
  return c ? (Array.isArray(l) || l instanceof NodeList || l instanceof HTMLCollection ? r === "prepend" ? c.prepend(...l) : c.append(...l) : r === "prepend" ? c.prepend(l) : (c.innerHTML = "", c.append(l)), i && console.log("renderToDom 2 (mounted):", c), c) : null;
2030
2032
  }, an = (t = {}) => {
2031
- $(t), (t == null ? void 0 : t.showLog) && console.log("first : ", t == null ? void 0 : t.columns, t == null ? void 0 : t.data, t == null ? void 0 : t.appendPosition);
2032
- const e = Ho({
2033
+ g(t);
2034
+ const a = t == null ? void 0 : t.showLog, e = t == null ? void 0 : t.options;
2035
+ a && console.log("first : ", t == null ? void 0 : t.options, t == null ? void 0 : t.columns, t == null ? void 0 : t.data, t == null ? void 0 : t.appendPosition);
2036
+ const o = Ho({
2033
2037
  inColumns: t.columns,
2034
2038
  inData: t.data,
2035
2039
  inType: t.type,
2036
- inShowLog: t.showLog
2040
+ inShowLog: t.showLog,
2041
+ inOptions: e
2037
2042
  });
2038
2043
  return en({
2039
- inSpec: e,
2044
+ inSpec: o,
2040
2045
  inTargetHtmlId: t.targetHtmlId,
2041
2046
  inAppendPosition: t.appendPosition,
2042
2047
  inShowLog: t.showLog