@saasquatch/mint-components 2.4.2-1 → 2.4.2-2

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.
Files changed (51) hide show
  1. package/dist/cjs/{GenericTableView-2a5a39c8.js → GenericTableView-4c48c630.js} +12 -7
  2. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +8 -3
  3. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +8 -3
  4. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +8 -3
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
  6. package/dist/cjs/{useReferralTable-6e9de0d5.js → useReferralTable-06887d9a.js} +10 -0
  7. package/dist/collection/components/sqm-invoice-table/sqm-invoice-table.js +7 -1
  8. package/dist/collection/components/sqm-referral-table/sqm-referral-table.js +7 -1
  9. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +7 -1
  10. package/dist/collection/tables/GenericTableView.js +12 -7
  11. package/dist/collection/tables/plopTargets.js +8 -0
  12. package/dist/esm/{GenericTableView-2555736c.js → GenericTableView-471a9386.js} +12 -7
  13. package/dist/esm/sqm-banking-info-form_10.entry.js +8 -3
  14. package/dist/esm/sqm-referral-table_11.entry.js +8 -3
  15. package/dist/esm/sqm-rewards-table_9.entry.js +8 -3
  16. package/dist/esm/sqm-stencilbook.entry.js +1 -1
  17. package/dist/esm/{useReferralTable-03d32c6f.js → useReferralTable-3aa4b527.js} +10 -1
  18. package/dist/esm-es5/GenericTableView-471a9386.js +1 -0
  19. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  20. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  21. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  22. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  23. package/dist/esm-es5/useReferralTable-3aa4b527.js +1 -0
  24. package/dist/mint-components/mint-components.esm.js +1 -1
  25. package/dist/mint-components/p-1f48ffa2.system.entry.js +1 -0
  26. package/dist/mint-components/p-2972e950.system.entry.js +1 -0
  27. package/dist/mint-components/p-381af581.js +1 -0
  28. package/dist/mint-components/p-700d8950.system.js +1 -0
  29. package/dist/mint-components/p-83571aad.system.entry.js +1 -0
  30. package/dist/mint-components/{p-d9d9ae3c.entry.js → p-8bdabf61.entry.js} +1 -1
  31. package/dist/mint-components/{p-bb0b5e4b.js → p-9944b514.js} +4 -4
  32. package/dist/mint-components/{p-672070dc.entry.js → p-9d671586.entry.js} +8 -8
  33. package/dist/mint-components/p-b69dbed8.system.js +1 -0
  34. package/dist/mint-components/p-bfb00685.system.js +1 -1
  35. package/dist/mint-components/p-cb3fbaff.entry.js +1 -0
  36. package/dist/mint-components/p-da357714.entry.js +148 -0
  37. package/dist/mint-components/{p-1fb6c81b.system.entry.js → p-ee6700a3.system.entry.js} +1 -1
  38. package/dist/types/tables/GenericTableView.d.ts +2 -0
  39. package/dist/types/tables/plopTargets.d.ts +3 -0
  40. package/docs/docs.docx +0 -0
  41. package/package.json +1 -1
  42. package/dist/esm-es5/GenericTableView-2555736c.js +0 -1
  43. package/dist/esm-es5/useReferralTable-03d32c6f.js +0 -1
  44. package/dist/mint-components/p-0b177618.system.entry.js +0 -1
  45. package/dist/mint-components/p-32192739.entry.js +0 -1
  46. package/dist/mint-components/p-471b9c1d.js +0 -1
  47. package/dist/mint-components/p-515262c7.system.entry.js +0 -1
  48. package/dist/mint-components/p-b9648151.system.entry.js +0 -1
  49. package/dist/mint-components/p-d284ae70.system.js +0 -1
  50. package/dist/mint-components/p-e8793c49.system.js +0 -1
  51. package/dist/mint-components/p-fa0146e5.entry.js +0 -148
@@ -9,8 +9,10 @@ function GenericTableView(props) {
9
9
  const { columns, rows } = elements;
10
10
  const { show } = states;
11
11
  const hiddenCols = data.hiddenColumns && data.hiddenColumns.split(",").map(Number);
12
- // Non-string columns are the editor's raisins plop targets, so the header has to stay rendered for them
13
- const hasDropZones = !!(columns === null || columns === void 0 ? void 0 : columns.some((column) => typeof column !== "string"));
12
+ // Only the producer knows which columns are plop targets; a column can render a
13
+ // VNode label and still be real data (e.g. the invoice download column).
14
+ const dropZones = new Set(elements.dropZoneColumns);
15
+ const hasDropZones = dropZones.size > 0;
14
16
  const showLabels = data.textOverrides.showLabels;
15
17
  const mobile = "@media (max-width: " + data.mdBreakpoint + "px)";
16
18
  const tablet = `@media (min-width: ${Boolean(rows.length < 2) ? data.mdBreakpoint : data.smBreakpoint}px) and (max-width: ${data.mdBreakpoint}px)`;
@@ -132,10 +134,10 @@ function GenericTableView(props) {
132
134
  index.h("style", { type: "text/css" }, styleString),
133
135
  index.h("table", { class: sheet.classes.Table },
134
136
  (showLabels || hasDropZones) && (index.h("thead", null,
135
- index.h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => {
136
- if (typeof column === "string")
137
- return (index.h("th", { class: showLabels ? "label" : "collapsed" }, column));
138
- return index.h("th", { class: "drop-zone" }, column);
137
+ index.h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column, i) => {
138
+ if (dropZones.has(i))
139
+ return index.h("th", { class: "drop-zone" }, column);
140
+ return (index.h("th", { class: showLabels ? "label" : "collapsed" }, column));
139
141
  })))),
140
142
  index.h("tbody", null,
141
143
  show === "loading" && elements.loadingElement,
@@ -143,10 +145,13 @@ function GenericTableView(props) {
143
145
  return (index.h("tr", { style: {
144
146
  borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
145
147
  }, part: "table-row" }, row.map((cell, j) => {
148
+ if (dropZones.has(j))
149
+ return index.h("td", { class: "drop-zone" }, cell);
150
+ // Only string labels can be echoed into the mobile card's :before
146
151
  return typeof columns[j] === "string" ? (index.h("td", { class: (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.includes(j)) ? "hidden" : "", "data-label": columns[j] + ":", style: {
147
152
  gridTemplateColumns: (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.includes(j)) ? "1fr"
148
153
  : "0.5fr 0.5fr",
149
- } }, cell)) : (index.h("td", { class: "drop-zone" }, cell));
154
+ } }, cell)) : (index.h("td", null, cell));
150
155
  })));
151
156
  })))),
152
157
  index.h("div", { class: sheet.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
@@ -13,11 +13,11 @@ const JSS = require('./JSS-8503a151.js');
13
13
  require('./mixins-4761d472.js');
14
14
  require('./AsYouType-d15caac8.js');
15
15
  const subregions = require('./subregions-3d27e279.js');
16
- const GenericTableView = require('./GenericTableView-2a5a39c8.js');
16
+ const GenericTableView = require('./GenericTableView-4c48c630.js');
17
17
  const reRender = require('./re-render-72a0ef45.js');
18
+ const useReferralTable = require('./useReferralTable-06887d9a.js');
18
19
  const useChildElements = require('./useChildElements-041127d7.js');
19
20
  const luxon = require('./luxon-c1ad356a.js');
20
- const useReferralTable = require('./useReferralTable-6e9de0d5.js');
21
21
  const sqmUserInfoFormView = require('./sqm-user-info-form-view-c5f9b79b.js');
22
22
  const data = require('./data-89ac73dd.js');
23
23
  const keys = require('./keys-5a2c9ed2.js');
@@ -3436,7 +3436,12 @@ function useInvoiceTableDemo(props, emptyElement, loadingElement) {
3436
3436
  setContent({ rows });
3437
3437
  const columns = columnsPromise && (await Promise.all(columnsPromise));
3438
3438
  // Set the content to render and finish loading components
3439
- setContent({ columns, loading: false, page: 0 });
3439
+ setContent({
3440
+ columns,
3441
+ dropZoneColumns: useReferralTable.dropZoneColumnIndexes(columnComponents),
3442
+ loading: false,
3443
+ page: 0,
3444
+ });
3440
3445
  }
3441
3446
  domContextHooks_module.useEffect(() => {
3442
3447
  setContent({ loading: true });
@@ -11,12 +11,12 @@ const utils = require('./utils-6847bc06.js');
11
11
  const JSS = require('./JSS-8503a151.js');
12
12
  require('./mixins-4761d472.js');
13
13
  const sqmTextSpanView = require('./sqm-text-span-view-b9e10f5d.js');
14
- const GenericTableView = require('./GenericTableView-2a5a39c8.js');
14
+ const GenericTableView = require('./GenericTableView-4c48c630.js');
15
15
  const reRender = require('./re-render-72a0ef45.js');
16
+ const useReferralTable = require('./useReferralTable-06887d9a.js');
16
17
  const useChildElements = require('./useChildElements-041127d7.js');
17
18
  const luxon = require('./luxon-c1ad356a.js');
18
19
  const mockRewardData = require('./mockRewardData-ed603fca.js');
19
- const useReferralTable = require('./useReferralTable-6e9de0d5.js');
20
20
 
21
21
  const mockReferralData = (count = 4) => {
22
22
  const data = [...Array(count)].map(() => getMockData());
@@ -290,7 +290,12 @@ function useReferralTableDemo(props, emptyElement, loadingElement) {
290
290
  setContent({ rows });
291
291
  const columns = columnsPromise && (await Promise.all(columnsPromise));
292
292
  // Set the content to render and finish loading components
293
- setContent({ columns, loading: false, page: 0 });
293
+ setContent({
294
+ columns,
295
+ dropZoneColumns: useReferralTable.dropZoneColumnIndexes(columnComponents),
296
+ loading: false,
297
+ page: 0,
298
+ });
294
299
  }
295
300
  domContextHooks_module.useEffect(() => {
296
301
  setContent({ loading: true });
@@ -10,12 +10,12 @@ const cjs = require('./cjs-1066ec21.js');
10
10
  const utils = require('./utils-6847bc06.js');
11
11
  const JSS = require('./JSS-8503a151.js');
12
12
  require('./mixins-4761d472.js');
13
- const GenericTableView = require('./GenericTableView-2a5a39c8.js');
13
+ const GenericTableView = require('./GenericTableView-4c48c630.js');
14
14
  const reRender = require('./re-render-72a0ef45.js');
15
+ const useReferralTable = require('./useReferralTable-06887d9a.js');
15
16
  const useChildElements = require('./useChildElements-041127d7.js');
16
17
  const luxon = require('./luxon-c1ad356a.js');
17
18
  const mockRewardData = require('./mockRewardData-ed603fca.js');
18
- const useReferralTable = require('./useReferralTable-6e9de0d5.js');
19
19
 
20
20
  const debug = domContextHooks_module.browser("sq:useRewardsTable");
21
21
  const CSS_NAMESPACE = "sqm-rewards-table";
@@ -394,7 +394,12 @@ function useRewardsTableDemo(props, emptyElement, loadingElement) {
394
394
  setContent({ rows });
395
395
  const columns = columnsPromise && (await Promise.all(columnsPromise));
396
396
  // Set the content to render and finish loading components
397
- setContent({ columns, loading: false, page: 0 });
397
+ setContent({
398
+ columns,
399
+ dropZoneColumns: useReferralTable.dropZoneColumnIndexes(columnComponents),
400
+ loading: false,
401
+ page: 0,
402
+ });
398
403
  }
399
404
  domContextHooks_module.useEffect(() => {
400
405
  setContent({ loading: true });
@@ -17,7 +17,7 @@ const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-717d063
17
17
  require('./AsYouType-d15caac8.js');
18
18
  const subregions = require('./subregions-3d27e279.js');
19
19
  const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-a45f7a52.js');
20
- const GenericTableView = require('./GenericTableView-2a5a39c8.js');
20
+ const GenericTableView = require('./GenericTableView-4c48c630.js');
21
21
  require('./useChildElements-041127d7.js');
22
22
  const luxon = require('./luxon-c1ad356a.js');
23
23
  const sqmCloseButtonView = require('./sqm-close-button-view-e9f2a454.js');
@@ -6,6 +6,15 @@ const index_module = require('./index.module-f8c8495f.js');
6
6
  const reRender = require('./re-render-72a0ef45.js');
7
7
  const useChildElements = require('./useChildElements-041127d7.js');
8
8
 
9
+ const PLOP_TARGET_TAG = "RAISINS-PLOP-TARGET";
10
+ function isPlopTarget(element) {
11
+ return element.tagName === PLOP_TARGET_TAG;
12
+ }
13
+ /** Indexes of the column components the widget editor injected as drop zones. */
14
+ function dropZoneColumnIndexes(columnComponents) {
15
+ return columnComponents.reduce((indexes, component, idx) => isPlopTarget(component) ? [...indexes, idx] : indexes, []);
16
+ }
17
+
9
18
  const debug = domContextHooks_module.browser("sq:useReferralTable");
10
19
  const CSS_NAMESPACE = "sqm-referral-table";
11
20
  const GET_REFERRER_DATA = index_module.dist.gql `
@@ -427,6 +436,7 @@ async function tryMethod(c, callback) {
427
436
  }
428
437
  }
429
438
 
439
+ exports.dropZoneColumnIndexes = dropZoneColumnIndexes;
430
440
  exports.generateUserError = generateUserError;
431
441
  exports.tryMethod = tryMethod;
432
442
  exports.useReferralTable = useReferralTable;
@@ -5,6 +5,7 @@ import { Component, h, Prop } from "@stencil/core";
5
5
  import deepmerge from "deepmerge";
6
6
  import { GenericTableView, } from "../../tables/GenericTableView";
7
7
  import { useRequestRerender, useRerenderListener, } from "../../tables/re-render";
8
+ import { dropZoneColumnIndexes } from "../../tables/plopTargets";
8
9
  import { useChildElements } from "../../tables/useChildElements";
9
10
  import mockInvoiceData from "./mockInvoiceData";
10
11
  import { InvoiceTableView } from "./sqm-invoice-table-view";
@@ -422,7 +423,12 @@ function useInvoiceTableDemo(props, emptyElement, loadingElement) {
422
423
  setContent({ rows });
423
424
  const columns = columnsPromise && (await Promise.all(columnsPromise));
424
425
  // Set the content to render and finish loading components
425
- setContent({ columns, loading: false, page: 0 });
426
+ setContent({
427
+ columns,
428
+ dropZoneColumns: dropZoneColumnIndexes(columnComponents),
429
+ loading: false,
430
+ page: 0,
431
+ });
426
432
  }
427
433
  useEffect(() => {
428
434
  setContent({ loading: true });
@@ -5,6 +5,7 @@ import { Component, h, Prop } from "@stencil/core";
5
5
  import deepmerge from "deepmerge";
6
6
  import { GenericTableView, } from "../../tables/GenericTableView";
7
7
  import { useRequestRerender, useRerenderListener, } from "../../tables/re-render";
8
+ import { dropZoneColumnIndexes } from "../../tables/plopTargets";
8
9
  import { useChildElements } from "../../tables/useChildElements";
9
10
  import mockReferralData from "./mockReferralData";
10
11
  import { tryMethod, useReferralTable } from "./useReferralTable";
@@ -380,7 +381,12 @@ function useReferralTableDemo(props, emptyElement, loadingElement) {
380
381
  setContent({ rows });
381
382
  const columns = columnsPromise && (await Promise.all(columnsPromise));
382
383
  // Set the content to render and finish loading components
383
- setContent({ columns, loading: false, page: 0 });
384
+ setContent({
385
+ columns,
386
+ dropZoneColumns: dropZoneColumnIndexes(columnComponents),
387
+ loading: false,
388
+ page: 0,
389
+ });
384
390
  }
385
391
  useEffect(() => {
386
392
  setContent({ loading: true });
@@ -5,6 +5,7 @@ import { Component, h, Prop } from "@stencil/core";
5
5
  import deepmerge from "deepmerge";
6
6
  import { GenericTableView, } from "../../tables/GenericTableView";
7
7
  import { useRequestRerender, useRerenderListener, } from "../../tables/re-render";
8
+ import { dropZoneColumnIndexes } from "../../tables/plopTargets";
8
9
  import { useChildElements } from "../../tables/useChildElements";
9
10
  import mockRewardData from "./mockRewardData";
10
11
  import { tryMethod, useRewardsTable } from "./useRewardsTable";
@@ -325,7 +326,12 @@ function useRewardsTableDemo(props, emptyElement, loadingElement) {
325
326
  setContent({ rows });
326
327
  const columns = columnsPromise && (await Promise.all(columnsPromise));
327
328
  // Set the content to render and finish loading components
328
- setContent({ columns, loading: false, page: 0 });
329
+ setContent({
330
+ columns,
331
+ dropZoneColumns: dropZoneColumnIndexes(columnComponents),
332
+ loading: false,
333
+ page: 0,
334
+ });
329
335
  }
330
336
  useEffect(() => {
331
337
  setContent({ loading: true });
@@ -6,8 +6,10 @@ export function GenericTableView(props) {
6
6
  const { columns, rows } = elements;
7
7
  const { show } = states;
8
8
  const hiddenCols = data.hiddenColumns && data.hiddenColumns.split(",").map(Number);
9
- // Non-string columns are the editor's raisins plop targets, so the header has to stay rendered for them
10
- const hasDropZones = !!(columns === null || columns === void 0 ? void 0 : columns.some((column) => typeof column !== "string"));
9
+ // Only the producer knows which columns are plop targets; a column can render a
10
+ // VNode label and still be real data (e.g. the invoice download column).
11
+ const dropZones = new Set(elements.dropZoneColumns);
12
+ const hasDropZones = dropZones.size > 0;
11
13
  const showLabels = data.textOverrides.showLabels;
12
14
  const mobile = "@media (max-width: " + data.mdBreakpoint + "px)";
13
15
  const tablet = `@media (min-width: ${Boolean(rows.length < 2) ? data.mdBreakpoint : data.smBreakpoint}px) and (max-width: ${data.mdBreakpoint}px)`;
@@ -129,10 +131,10 @@ export function GenericTableView(props) {
129
131
  h("style", { type: "text/css" }, styleString),
130
132
  h("table", { class: sheet.classes.Table },
131
133
  (showLabels || hasDropZones) && (h("thead", null,
132
- h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => {
133
- if (typeof column === "string")
134
- return (h("th", { class: showLabels ? "label" : "collapsed" }, column));
135
- return h("th", { class: "drop-zone" }, column);
134
+ h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column, i) => {
135
+ if (dropZones.has(i))
136
+ return h("th", { class: "drop-zone" }, column);
137
+ return (h("th", { class: showLabels ? "label" : "collapsed" }, column));
136
138
  })))),
137
139
  h("tbody", null,
138
140
  show === "loading" && elements.loadingElement,
@@ -140,10 +142,13 @@ export function GenericTableView(props) {
140
142
  return (h("tr", { style: {
141
143
  borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
142
144
  }, part: "table-row" }, row.map((cell, j) => {
145
+ if (dropZones.has(j))
146
+ return h("td", { class: "drop-zone" }, cell);
147
+ // Only string labels can be echoed into the mobile card's :before
143
148
  return typeof columns[j] === "string" ? (h("td", { class: (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.includes(j)) ? "hidden" : "", "data-label": columns[j] + ":", style: {
144
149
  gridTemplateColumns: (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.includes(j)) ? "1fr"
145
150
  : "0.5fr 0.5fr",
146
- } }, cell)) : (h("td", { class: "drop-zone" }, cell));
151
+ } }, cell)) : (h("td", null, cell));
147
152
  })));
148
153
  })))),
149
154
  h("div", { class: sheet.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
@@ -0,0 +1,8 @@
1
+ const PLOP_TARGET_TAG = "RAISINS-PLOP-TARGET";
2
+ export function isPlopTarget(element) {
3
+ return element.tagName === PLOP_TARGET_TAG;
4
+ }
5
+ /** Indexes of the column components the widget editor injected as drop zones. */
6
+ export function dropZoneColumnIndexes(columnComponents) {
7
+ return columnComponents.reduce((indexes, component, idx) => isPlopTarget(component) ? [...indexes, idx] : indexes, []);
8
+ }
@@ -7,8 +7,10 @@ function GenericTableView(props) {
7
7
  const { columns, rows } = elements;
8
8
  const { show } = states;
9
9
  const hiddenCols = data.hiddenColumns && data.hiddenColumns.split(",").map(Number);
10
- // Non-string columns are the editor's raisins plop targets, so the header has to stay rendered for them
11
- const hasDropZones = !!(columns === null || columns === void 0 ? void 0 : columns.some((column) => typeof column !== "string"));
10
+ // Only the producer knows which columns are plop targets; a column can render a
11
+ // VNode label and still be real data (e.g. the invoice download column).
12
+ const dropZones = new Set(elements.dropZoneColumns);
13
+ const hasDropZones = dropZones.size > 0;
12
14
  const showLabels = data.textOverrides.showLabels;
13
15
  const mobile = "@media (max-width: " + data.mdBreakpoint + "px)";
14
16
  const tablet = `@media (min-width: ${Boolean(rows.length < 2) ? data.mdBreakpoint : data.smBreakpoint}px) and (max-width: ${data.mdBreakpoint}px)`;
@@ -130,10 +132,10 @@ function GenericTableView(props) {
130
132
  h("style", { type: "text/css" }, styleString),
131
133
  h("table", { class: sheet.classes.Table },
132
134
  (showLabels || hasDropZones) && (h("thead", null,
133
- h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column) => {
134
- if (typeof column === "string")
135
- return (h("th", { class: showLabels ? "label" : "collapsed" }, column));
136
- return h("th", { class: "drop-zone" }, column);
135
+ h("tr", null, columns === null || columns === void 0 ? void 0 : columns.map((column, i) => {
136
+ if (dropZones.has(i))
137
+ return h("th", { class: "drop-zone" }, column);
138
+ return (h("th", { class: showLabels ? "label" : "collapsed" }, column));
137
139
  })))),
138
140
  h("tbody", null,
139
141
  show === "loading" && elements.loadingElement,
@@ -141,10 +143,13 @@ function GenericTableView(props) {
141
143
  return (h("tr", { style: {
142
144
  borderTop: `${!data.textOverrides.showLabels && i === 0 ? "none" : ""}`,
143
145
  }, part: "table-row" }, row.map((cell, j) => {
146
+ if (dropZones.has(j))
147
+ return h("td", { class: "drop-zone" }, cell);
148
+ // Only string labels can be echoed into the mobile card's :before
144
149
  return typeof columns[j] === "string" ? (h("td", { class: (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.includes(j)) ? "hidden" : "", "data-label": columns[j] + ":", style: {
145
150
  gridTemplateColumns: (hiddenCols === null || hiddenCols === void 0 ? void 0 : hiddenCols.includes(j)) ? "1fr"
146
151
  : "0.5fr 0.5fr",
147
- } }, cell)) : (h("td", { class: "drop-zone" }, cell));
152
+ } }, cell)) : (h("td", null, cell));
148
153
  })));
149
154
  })))),
150
155
  h("div", { class: sheet.classes.ButtonContainer, part: states.namespace + "-button-wrapper" },
@@ -9,11 +9,11 @@ import { c as createStyleSheet } from './JSS-67b5cff8.js';
9
9
  import './mixins-f750863a.js';
10
10
  import './AsYouType-2d56519e.js';
11
11
  import { t as taxTypeToName, b as validTaxDocument, I as INDIRECT_TAX_SPAIN_REGIONS, a as INDIRECT_TAX_PROVINCES, o as objectIsFull, c as toDomesticNumber, A as ADDRESS_REGIONS } from './subregions-810a5c2d.js';
12
- import { G as GenericTableView } from './GenericTableView-2555736c.js';
12
+ import { G as GenericTableView } from './GenericTableView-471a9386.js';
13
13
  import { u as useRerenderListener, a as useRequestRerender } from './re-render-bf46ba54.js';
14
+ import { g as generateUserError, d as dropZoneColumnIndexes } from './useReferralTable-3aa4b527.js';
14
15
  import { u as useChildElements } from './useChildElements-06937df7.js';
15
16
  import { l as luxon } from './luxon-1be92a8e.js';
16
- import { g as generateUserError } from './useReferralTable-03d32c6f.js';
17
17
  import { O as OtherRegionSlotView, I as InvoiceTableView, v as vatLabels, T as TaxAndCashDashboardView, U as UserInfoFormView } from './sqm-user-info-form-view-ceb3917a.js';
18
18
  import { F as FORM_STEPS, a as TAX_FORM_CONTEXT_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, f as FINANCE_NETWORK_SETTINGS_NAMESPACE, c as USER_QUERY_NAMESPACE, T as TAX_CONTEXT_NAMESPACE, C as CURRENCIES_NAMESPACE, U as USER_FORM_CONTEXT_NAMESPACE } from './data-8698cbc6.js';
19
19
  import { c as VERIFICATION_EVENT_KEY } from './keys-1054056a.js';
@@ -3432,7 +3432,12 @@ function useInvoiceTableDemo(props, emptyElement, loadingElement) {
3432
3432
  setContent({ rows });
3433
3433
  const columns = columnsPromise && (await Promise.all(columnsPromise));
3434
3434
  // Set the content to render and finish loading components
3435
- setContent({ columns, loading: false, page: 0 });
3435
+ setContent({
3436
+ columns,
3437
+ dropZoneColumns: dropZoneColumnIndexes(columnComponents),
3438
+ loading: false,
3439
+ page: 0,
3440
+ });
3436
3441
  }
3437
3442
  useEffect(() => {
3438
3443
  setContent({ loading: true });
@@ -7,12 +7,12 @@ import { l as luxonLocale } from './utils-334c1e34.js';
7
7
  import { c as createStyleSheet } from './JSS-67b5cff8.js';
8
8
  import './mixins-f750863a.js';
9
9
  import { T as TextSpanView } from './sqm-text-span-view-72f43dff.js';
10
- import { G as GenericTableView } from './GenericTableView-2555736c.js';
10
+ import { G as GenericTableView } from './GenericTableView-471a9386.js';
11
11
  import { a as useRequestRerender, u as useRerenderListener } from './re-render-bf46ba54.js';
12
+ import { u as useReferralTable, t as tryMethod, d as dropZoneColumnIndexes } from './useReferralTable-3aa4b527.js';
12
13
  import { u as useChildElements } from './useChildElements-06937df7.js';
13
14
  import { l as luxon } from './luxon-1be92a8e.js';
14
15
  import { g as getPaypalMeta } from './mockRewardData-9b27d6f1.js';
15
- import { u as useReferralTable, t as tryMethod } from './useReferralTable-03d32c6f.js';
16
16
 
17
17
  const mockReferralData = (count = 4) => {
18
18
  const data = [...Array(count)].map(() => getMockData());
@@ -286,7 +286,12 @@ function useReferralTableDemo(props, emptyElement, loadingElement) {
286
286
  setContent({ rows });
287
287
  const columns = columnsPromise && (await Promise.all(columnsPromise));
288
288
  // Set the content to render and finish loading components
289
- setContent({ columns, loading: false, page: 0 });
289
+ setContent({
290
+ columns,
291
+ dropZoneColumns: dropZoneColumnIndexes(columnComponents),
292
+ loading: false,
293
+ page: 0,
294
+ });
290
295
  }
291
296
  useEffect(() => {
292
297
  setContent({ loading: true });
@@ -6,12 +6,12 @@ import { c as cjs } from './cjs-bdfb4486.js';
6
6
  import { l as luxonLocale } from './utils-334c1e34.js';
7
7
  import { c as createStyleSheet } from './JSS-67b5cff8.js';
8
8
  import './mixins-f750863a.js';
9
- import { G as GenericTableView } from './GenericTableView-2555736c.js';
9
+ import { G as GenericTableView } from './GenericTableView-471a9386.js';
10
10
  import { u as useRerenderListener, a as useRequestRerender } from './re-render-bf46ba54.js';
11
+ import { g as generateUserError, d as dropZoneColumnIndexes } from './useReferralTable-3aa4b527.js';
11
12
  import { u as useChildElements } from './useChildElements-06937df7.js';
12
13
  import { l as luxon } from './luxon-1be92a8e.js';
13
14
  import { m as mockRewardData } from './mockRewardData-9b27d6f1.js';
14
- import { g as generateUserError } from './useReferralTable-03d32c6f.js';
15
15
 
16
16
  const debug = browser("sq:useRewardsTable");
17
17
  const CSS_NAMESPACE = "sqm-rewards-table";
@@ -390,7 +390,12 @@ function useRewardsTableDemo(props, emptyElement, loadingElement) {
390
390
  setContent({ rows });
391
391
  const columns = columnsPromise && (await Promise.all(columnsPromise));
392
392
  // Set the content to render and finish loading components
393
- setContent({ columns, loading: false, page: 0 });
393
+ setContent({
394
+ columns,
395
+ dropZoneColumns: dropZoneColumnIndexes(columnComponents),
396
+ loading: false,
397
+ page: 0,
398
+ });
394
399
  }
395
400
  useEffect(() => {
396
401
  setContent({ loading: true });
@@ -13,7 +13,7 @@ import { b as PortalRegisterView, P as PortalForgotPasswordView, a as PortalLogi
13
13
  import './AsYouType-2d56519e.js';
14
14
  import { t as taxTypeToName, L as LoadingView, I as INDIRECT_TAX_SPAIN_REGIONS, a as INDIRECT_TAX_PROVINCES } from './subregions-810a5c2d.js';
15
15
  import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-79265df5.js';
16
- import { G as GenericTableView } from './GenericTableView-2555736c.js';
16
+ import { G as GenericTableView } from './GenericTableView-471a9386.js';
17
17
  import './useChildElements-06937df7.js';
18
18
  import { l as luxon } from './luxon-1be92a8e.js';
19
19
  import { C as CloseButtonView } from './sqm-close-button-view-fd9012e7.js';
@@ -4,6 +4,15 @@ import { d as dist, J, H, L, w as wn, R as Rn } from './index.module-02cb914c.js
4
4
  import { u as useRerenderListener } from './re-render-bf46ba54.js';
5
5
  import { u as useChildElements } from './useChildElements-06937df7.js';
6
6
 
7
+ const PLOP_TARGET_TAG = "RAISINS-PLOP-TARGET";
8
+ function isPlopTarget(element) {
9
+ return element.tagName === PLOP_TARGET_TAG;
10
+ }
11
+ /** Indexes of the column components the widget editor injected as drop zones. */
12
+ function dropZoneColumnIndexes(columnComponents) {
13
+ return columnComponents.reduce((indexes, component, idx) => isPlopTarget(component) ? [...indexes, idx] : indexes, []);
14
+ }
15
+
7
16
  const debug = browser("sq:useReferralTable");
8
17
  const CSS_NAMESPACE = "sqm-referral-table";
9
18
  const GET_REFERRER_DATA = dist.gql `
@@ -425,4 +434,4 @@ async function tryMethod(c, callback) {
425
434
  }
426
435
  }
427
436
 
428
- export { generateUserError as g, tryMethod as t, useReferralTable as u };
437
+ export { dropZoneColumnIndexes as d, generateUserError as g, tryMethod as t, useReferralTable as u };
@@ -0,0 +1 @@
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++){a=arguments[t];for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s))e[s]=a[s]}return e};return __assign.apply(this,arguments)};import{h}from"./index-38ad4957.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{g as gap}from"./mixins-f750863a.js";function GenericTableView(e){var a;var t=e.states,r=e.data,s=e.callbacks,o=e.elements;var l=o.columns,i=o.rows;var n=t.show;var d=r.hiddenColumns&&r.hiddenColumns.split(",").map(Number);var p=new Set(o.dropZoneColumns);var c=p.size>0;var m=r.textOverrides.showLabels;var b="@media (max-width: "+r.mdBreakpoint+"px)";var g="@media (min-width: "+(Boolean(i.length<2)?r.mdBreakpoint:r.smBreakpoint)+"px) and (max-width: "+r.mdBreakpoint+"px)";var v={Table:(a={borderCollapse:"collapse",tableLayout:"fixed",width:"100%","& tbody tr":{borderBottom:"var(--sqm-border-thickness, 1px) solid var(--sqm-border-color)","&:first-child":{borderTop:"var(--sqm-border-thickness, 1px) solid var(--sqm-border-color)"}},"& th":{paddingBottom:"var(--sl-spacing-small)",textAlign:"left",fontWeight:"var(--sl-font-weight-semibold)",overflowWrap:"anywhere"},"& th.collapsed":{fontSize:"0",padding:"14px 0"},"& th.drop-zone":{width:"30px"},"& td":{padding:"var(--sl-spacing-small)",paddingLeft:"0",overflow:"hidden",textOverflow:"ellipsis"}},a[b]={"& thead":{display:c?"block":"none"},"& thead tr":{display:"flex",flexDirection:"column"},"& thead th.label":{padding:"0",lineHeight:"20px",fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"},"& thead th.drop-zone":{width:"auto",padding:"14px 0",lineHeight:"0",position:"relative"},"& thead th.drop-zone slot::slotted(raisins-plop-target)":{width:"100%"},"& tbody td.drop-zone":{display:"none"},"& tbody tr":{display:"block",background:"inherit",border:"var(--sqm-border-thickness, 1px) solid var(--sqm-border-color)",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)",borderRadius:"var(--sl-border-radius-large)",padding:"var(--sl-spacing-medium)",fontSize:"var(--sl-font-size-small)",marginBottom:"var(--sl-spacing-large)"},"& td":{display:"grid",borderTop:"none",padding:"0",marginBottom:"var(--sl-spacing-medium)","&:first-child":{textAlign:"left"},"&:before":{content:"attr(data-label)",whiteSpace:"nowrap"},"&:last-child":{marginBottom:"0"},"&.hidden:before":{content:"none"}}},a[g]={"& tbody":{display:"grid",gridTemplateColumns:"0.5fr 0.5fr",gap:"25px"}},a),ButtonContainer:__assign({display:"flex","justify-content":"flex-end","margin-top":"var(--sl-spacing-small)"},gap({direction:"row",size:"var(--sl-spacing-small)"})),ButtonDisabled:{"&::part(base)":{opacity:"0.25"}}};var u=createStyleSheet(v);var f=u.toString();if(n==="empty")return o.emptyElement;return h("div",null,h("style",{type:"text/css"},f),h("table",{class:u.classes.Table},(m||c)&&h("thead",null,h("tr",null,l===null||l===void 0?void 0:l.map((function(e,a){if(p.has(a))return h("th",{class:"drop-zone"},e);return h("th",{class:m?"label":"collapsed"},e)})))),h("tbody",null,n==="loading"&&o.loadingElement,n==="rows"&&(i===null||i===void 0?void 0:i.map((function(e,a){return h("tr",{style:{borderTop:""+(!r.textOverrides.showLabels&&a===0?"none":"")},part:"table-row"},e.map((function(e,a){if(p.has(a))return h("td",{class:"drop-zone"},e);return typeof l[a]==="string"?h("td",{class:(d===null||d===void 0?void 0:d.includes(a))?"hidden":"","data-label":l[a]+":",style:{gridTemplateColumns:(d===null||d===void 0?void 0:d.includes(a))?"1fr":"0.5fr 0.5fr"}},e):h("td",null,e)})))}))))),h("div",{class:u.classes.ButtonContainer,part:t.namespace+"-button-wrapper"},h("sl-button",{size:"small",disabled:!t.hasPrev,loading:n==="loading",onClick:s.prevPage,exportparts:"base: secondarybutton-base",class:!t.hasPrev?u.classes.ButtonDisabled:""},r.textOverrides.prevLabel),h("sl-button",{size:"small",loading:n==="loading",disabled:!t.hasNext,onClick:s.nextPage,exportparts:"base: secondarybutton-base",class:!t.hasNext?u.classes.ButtonDisabled:""},r.textOverrides.moreLabel)))}export{GenericTableView as G};