@svgrid/enterprise 3.1.38 → 3.1.40

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 (107) hide show
  1. package/dist/cdn/smart.export.entry-BvRk9kiK.js +0 -0
  2. package/dist/cdn/svgrid-enterprise.svelte-external.js +385 -385
  3. package/dist/designer/assets/GridMenus-CDtNPHWk.js +1 -0
  4. package/dist/designer/assets/{SvChartMenu-CdTEogez.js → SvChartMenu-C0vyEINZ.js} +1 -1
  5. package/dist/designer/assets/{SvDateTimePicker-Bzaaz3Kp.js → SvDateTimePicker-BnjsZQZx.js} +1 -1
  6. package/dist/designer/assets/{SvGridCellEditor-DkBK-Cs_.js → SvGridCellEditor-BIyRn_Yg.js} +2 -2
  7. package/dist/designer/assets/{SvGridChart-BqMTsa_R.js → SvGridChart-BGMfcq66.js} +2 -2
  8. package/dist/designer/assets/{SvGridChartBuilder-BNcFOTeW.js → SvGridChartBuilder-5ICrrwzC.js} +1 -1
  9. package/dist/designer/assets/{SvGridChartPanel-wUSKfW0h.js → SvGridChartPanel-Dcu3NUge.js} +2 -2
  10. package/dist/designer/assets/{SvGridChartView-D_815ueY.js → SvGridChartView-T5tSN_S5.js} +1 -1
  11. package/dist/designer/assets/{SvTabs-DkOt7l9F.js → SvTabs-CmusmxDR.js} +1 -1
  12. package/dist/designer/assets/chart-D0Hi9Ajj.js +1 -0
  13. package/dist/designer/assets/{chart-panel-messages-D2esv6rR.js → chart-panel-messages-BeJhiEym.js} +1 -1
  14. package/dist/designer/assets/dismissable-BA8Sdkgf.js +1 -0
  15. package/dist/designer/assets/index-Bmck0uP2.css +1 -0
  16. package/dist/designer/assets/{index-CoX0NKFJ.js → index-HLPzqCOg.js} +462 -462
  17. package/dist/designer/assets/smart.export.entry-BvRk9kiK.js +0 -0
  18. package/dist/designer/assets/{src-DfTRqPD7.js → src-B7p4SvJd.js} +1 -1
  19. package/dist/designer/index.html +10 -10
  20. package/dist/export.js +1 -1
  21. package/dist/fields/BaseAutomations.svelte +8 -5
  22. package/dist/fields/BaseAutomations.svelte.d.ts +4 -0
  23. package/dist/fields/BaseDashboardView.svelte +58 -6
  24. package/dist/fields/BaseImport.svelte +2 -2
  25. package/dist/fields/BaseImport.svelte.d.ts +7 -0
  26. package/dist/fields/BaseTableView.svelte +5 -2
  27. package/dist/fields/BaseTableView.svelte.d.ts +6 -0
  28. package/dist/fields/BaseTabs.svelte +1 -1
  29. package/dist/fields/DashboardTileEditor.svelte +62 -5
  30. package/dist/fields/DashboardTileEditor.svelte.d.ts +2 -0
  31. package/dist/fields/RecordView.svelte +1 -1
  32. package/dist/fields/SvBase.svelte +10 -4
  33. package/dist/fields/SvBase.svelte.d.ts +52 -1
  34. package/dist/fields/SvBaseViewBar.svelte +6 -4
  35. package/dist/fields/SvBaseViewBar.svelte.d.ts +6 -0
  36. package/dist/fields/activity.svelte.d.ts +5 -0
  37. package/dist/fields/base-import.d.ts +6 -0
  38. package/dist/fields/base-permissions.d.ts +1 -1
  39. package/dist/fields/base-permissions.js +1 -1
  40. package/dist/fields/base-sync.d.ts +12 -2
  41. package/dist/fields/base-sync.js +1 -1
  42. package/dist/fields/dashboard.d.ts +84 -1
  43. package/dist/fields/dashboard.js +1 -1
  44. package/dist/fields/field-ops.js +1 -1
  45. package/dist/fields/filter-model.d.ts +1 -1
  46. package/dist/fields/filter-model.js +1 -1
  47. package/dist/fields/index.d.ts +1 -1
  48. package/dist/fields/messages/record.d.ts +1 -0
  49. package/dist/fields/messages/record.js +1 -1
  50. package/dist/fields/messages/viewbar.d.ts +33 -0
  51. package/dist/fields/messages/viewbar.js +1 -1
  52. package/dist/fields/messages.svelte.d.ts +34 -0
  53. package/dist/node/studio.js +2 -2
  54. package/dist/smart.export.entry.d.ts +3 -0
  55. package/dist/smart.export.entry.js +1 -0
  56. package/dist/smart.export.shim.d.ts +1 -0
  57. package/dist/smart.export.shim.js +1 -0
  58. package/dist/sources/rest.d.ts +5 -2
  59. package/dist/sources/rest.js +1 -1
  60. package/dist/studio/ui-components.generated.js +1 -1
  61. package/dist/sveltekit/sql-source.js +1 -1
  62. package/dist/version.d.ts +2 -2
  63. package/dist/version.js +1 -1
  64. package/dist/wc/{CardMenu-Bufk2vwa.js → CardMenu-CvAlOSac.js} +1 -1
  65. package/dist/wc/{GridMenus-BV3fRFIY.js → GridMenus-B762nokq.js} +2 -2
  66. package/dist/wc/{GridMenus-VSOeAZFV.js → GridMenus-DuhBs36k.js} +2 -2
  67. package/dist/wc/{SvChartMenu-NRen7QjH.js → SvChartMenu-COh9NMzD.js} +1 -1
  68. package/dist/wc/{SvChartMenu-DJqv1cuY.js → SvChartMenu-DblAgoRA.js} +1 -1
  69. package/dist/wc/{SvDateTimePicker-DrUJNzaQ.js → SvDateTimePicker-ggMYm4Pp.js} +1 -1
  70. package/dist/wc/{SvDateTimePicker-B5kJLiH0.js → SvDateTimePicker-rbFCHbRQ.js} +1 -1
  71. package/dist/wc/{SvGridCellEditor-ChV2GkV8.js → SvGridCellEditor-CODvFtka.js} +1 -1
  72. package/dist/wc/{SvGridCellEditor-BNPMZZF7.js → SvGridCellEditor-N-j2l14U.js} +1 -1
  73. package/dist/wc/{SvGridChart-DKSo4yAM.js → SvGridChart-7UgF0l4W.js} +2 -2
  74. package/dist/wc/{SvGridChart-D_AKt54D.js → SvGridChart-Cly6j21z.js} +2 -2
  75. package/dist/wc/{SvGridChartBuilder-DE8Lua1j.js → SvGridChartBuilder-CyVZ-lZQ.js} +1 -1
  76. package/dist/wc/{SvGridChartBuilder-BOSvwoMN.js → SvGridChartBuilder-D4BAUF_O.js} +1 -1
  77. package/dist/wc/{SvGridChartPanel-CTW5z6Vb.js → SvGridChartPanel-BeRUjgjM.js} +2 -2
  78. package/dist/wc/{SvGridChartPanel-D1Dn-DNm.js → SvGridChartPanel-CeaYS-Vh.js} +2 -2
  79. package/dist/wc/{SvGridChartView-DOOboBce.js → SvGridChartView-BG-qLHK8.js} +1 -1
  80. package/dist/wc/{SvGridChartView-CcIMqWgn.js → SvGridChartView-s0BqDKZ9.js} +1 -1
  81. package/dist/wc/{SvModal-Cf-6zzOA.js → SvModal-CN10qQ5E.js} +1 -1
  82. package/dist/wc/{SvModal-CT6ZMBaI.js → SvModal-y_CF6yXp.js} +1 -1
  83. package/dist/wc/{SvTabs-pQfMJw-6.js → SvTabs-DhRSxzwH.js} +1 -1
  84. package/dist/wc/{board-D39-qF4t.js → board-wkFIFCpH.js} +1 -1
  85. package/dist/wc/chart-0z2N0RUb.js +1 -0
  86. package/dist/wc/chart-Cbakc50a.js +1 -0
  87. package/dist/wc/{chart-panel-messages-Ce4fBC6l.js → chart-panel-messages-CvyfXnB0.js} +1 -1
  88. package/dist/wc/dismissable-CuL0k6PX.js +1 -0
  89. package/dist/wc/{export-CduUYesa.js → export-CCM-mATF.js} +1 -1
  90. package/dist/wc/{gallery-v54gmeKF.js → gallery-vM0PqrWd.js} +1 -1
  91. package/dist/wc/{gantt-CQ4bjQWL.js → gantt-BlvgFAt_.js} +1 -1
  92. package/dist/wc/{palette-ChsQ7Bm9.js → palette-BPzVof_y.js} +1 -1
  93. package/dist/wc/{scheduler-GWTte7aX.js → scheduler-D2ksQuvM.js} +1 -1
  94. package/dist/wc/smart.export.entry-BvRk9kiK.js +0 -0
  95. package/dist/wc/sv-base-element.js +85 -81
  96. package/dist/wc/sv-sheet-element.js +2 -2
  97. package/package.json +3 -3
  98. package/dist/cdn/smart.export-0xDkly3x.js +0 -250
  99. package/dist/designer/assets/GridMenus-Cu5uIXlg.js +0 -1
  100. package/dist/designer/assets/chart-SJcjQYZM.js +0 -1
  101. package/dist/designer/assets/dismissable-ChWRPkoa.js +0 -1
  102. package/dist/designer/assets/index-nV1iesTT.css +0 -1
  103. package/dist/designer/assets/smart.export-AxSFVWeW.js +0 -250
  104. package/dist/wc/chart-QqgKrWNe.js +0 -1
  105. package/dist/wc/chart-j-Izih1o.js +0 -1
  106. package/dist/wc/dismissable-CQ6XFXsk.js +0 -1
  107. package/dist/wc/smart.export-0xDkly3x.js +0 -250
@@ -0,0 +1,3 @@
1
+ import './smart.export.shim.js';
2
+ import './smart.export.js';
3
+ export {};
@@ -0,0 +1 @@
1
+ import"./smart.export.shim.js";import"./smart.export.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{installSmartShim as i}from"./smart-shim.js";typeof window<"u"&&i();
@@ -8,11 +8,14 @@
8
8
  * const source = createRestDataSource({ url: '/api/customers', schema })
9
9
  *
10
10
  * Default wire format:
11
- * read GET {url}?offset&limit&sort&search&<col>=<op>:<value>
11
+ * read GET {url}?offset&limit&sort&search&<col>=<op>:<value>&filter=<expression>
12
12
  * create POST {url} body: the new row
13
13
  * update PATCH {url}/{id} body: the patch
14
14
  * delete DELETE {url}/{id} a 404 is not an error: the row is gone
15
- * where `sort` is a comma list with `-` for descending (e.g. `-createdAt,name`).
15
+ * where `sort` is a comma list with `-` for descending (e.g. `-createdAt,name`),
16
+ * and `filter` is a view's advanced filter (`filterModel.expression`) as JSON.
17
+ * An endpoint that applied it in full answers `appliedExpression: true` in an
18
+ * object body; without it the grid knows the filter did not run there.
16
19
  */
17
20
  import type { RowData, ServerRequest, ServerResult } from '@svgrid/grid';
18
21
  import { type EntitySchema } from '../schema.js';
@@ -1 +1 @@
1
- import{resolveIdField as w}from"../schema.js";import{nudgeEnterpriseFor as y}from"../license.js";import{normalizeFilters as m}from"./filters.js";const $=t=>"values"in t?`${t.op}:${t.values.join(",")}`:"value"in t?t.op==="between"?`between:${t.value},${t.valueTo}`:`${t.op}:${t.value}`:t.op;function R(t){const n={offset:String(t.startRow),limit:String(t.endRow-t.startRow)};t.sortModel.length&&(n.sort=t.sortModel.map(e=>(e.desc?"-":"")+e.id).join(","));const{predicates:d,search:r,searchIn:u}=m(t.filterModel);r&&(n.search=r),r&&u&&(n.searchIn=u.join(","));for(const e of d)n[e.column]=$(e);const c=t.groupBy??[],s=t.groupKeys??[];if(s.length>c.length)throw new Error(`createRestDataSource: ${s.length} group keys for ${c.length} group levels`);for(let e=0;e<s.length;e+=1)n[c[e]]=s[e]===""?"isNull":`eq:${s[e]}`;if(s.length<c.length){n.groupBy=c[s.length];const e=t.aggregations??[];e.length&&(n.aggregate=e.map(o=>`${o.fn}:${o.col}`).join(","))}if(t.needsGrandTotal){n.grandTotal="1";const e=t.aggregations??[];e.length&&!n.aggregate&&(n.aggregate=e.map(o=>`${o.fn}:${o.col}`).join(","))}return t.pivotMode&&t.pivotBy?.length&&n.groupBy&&(n.pivot=t.pivotBy.join(",")),n}function f(t,n){const d=Math.max(1,n.endRow-n.startRow);return t.length<d?n.startRow+t.length:-1}function v(t,n,d){if(Array.isArray(t)){const a=n.headers.get("content-range"),i=a&&/\/(\d+)\s*$/.exec(a);return{rows:t,rowCount:i?Number(i[1]):f(t,d)}}const r=t??{},u="grandTotal"in r?{grandTotal:r.grandTotal??null}:{},c=r.rows??r.data??r.items??[],s=r.rowCount??r.total??r.count,e=s==null?f(c,d):Number(s),o=Array.isArray(r.pivotResultFields)?{pivotResultFields:r.pivotResultFields}:{};return{rows:c,rowCount:e,...u,...o}}export function createRestDataSource(t){y("studio","Studio");const n=t.fetch??globalThis.fetch,d=t.idField??(t.schema?w(t.schema):"id"),r=t.url.replace(/\/+$/,""),u=t.buildQuery??R,c=t.parse??v,s=o=>({...typeof t.headers=="function"?t.headers():t.headers??{},...o}),e=async(o,a)=>{const i=await n(o,a);if(!i.ok){const l=await i.json().then(p=>p?.error??p?.message,()=>{}),h=typeof l=="string"?l.trim().slice(0,200):"";throw Object.assign(new Error(`REST ${a?.method??"GET"} ${o} -> ${i.status} ${i.statusText}${typeof l=="string"&&l?`: ${l}`:""}`),{status:i.status,...h?{said:h}:{}})}return{body:i.status===204?void 0:await i.json().catch(()=>{}),res:i}};return{async getRows(o){const a=new URLSearchParams({...t.query,...u(o)}).toString(),i=a?`${r}?${a}`:r,{body:g,res:l}=await e(i,{headers:s()});return c(g,l,o)},async createRow(o){const{body:a}=await e(r,{method:"POST",headers:s({"content-type":"application/json"}),body:JSON.stringify(o)});return a??o},async updateRow(o,a){const{body:i}=await e(`${r}/${encodeURIComponent(o)}`,{method:"PATCH",headers:s({"content-type":"application/json"}),body:JSON.stringify(a)});return i??{...a,[d]:o}},async deleteRow(o){await e(`${r}/${encodeURIComponent(o)}`,{method:"DELETE",headers:s()}).catch(a=>{if(a?.status!==404)throw a})}}}
1
+ import{resolveIdField as y}from"../schema.js";import{nudgeEnterpriseFor as w}from"../license.js";import{normalizeFilters as m}from"./filters.js";const $=t=>"values"in t?`${t.op}:${t.values.join(",")}`:"value"in t?t.op==="between"?`between:${t.value},${t.valueTo}`:`${t.op}:${t.value}`:t.op;function R(t){const n={offset:String(t.startRow),limit:String(t.endRow-t.startRow)};t.sortModel.length&&(n.sort=t.sortModel.map(e=>(e.desc?"-":"")+e.id).join(","));const{predicates:d,search:r,searchIn:u}=m(t.filterModel);r&&(n.search=r),r&&u&&(n.searchIn=u.join(","));for(const e of d)n[e.column]=$(e);t.filterModel?.expression&&(n.filter=JSON.stringify(t.filterModel.expression));const l=t.groupBy??[],s=t.groupKeys??[];if(s.length>l.length)throw new Error(`createRestDataSource: ${s.length} group keys for ${l.length} group levels`);for(let e=0;e<s.length;e+=1)n[l[e]]=s[e]===""?"isNull":`eq:${s[e]}`;if(s.length<l.length){n.groupBy=l[s.length];const e=t.aggregations??[];e.length&&(n.aggregate=e.map(o=>`${o.fn}:${o.col}`).join(","))}if(t.needsGrandTotal){n.grandTotal="1";const e=t.aggregations??[];e.length&&!n.aggregate&&(n.aggregate=e.map(o=>`${o.fn}:${o.col}`).join(","))}return t.pivotMode&&t.pivotBy?.length&&n.groupBy&&(n.pivot=t.pivotBy.join(",")),n}function f(t,n){const d=Math.max(1,n.endRow-n.startRow);return t.length<d?n.startRow+t.length:-1}function v(t,n,d){if(Array.isArray(t)){const i=n.headers.get("content-range"),g=i&&/\/(\d+)\s*$/.exec(i);return{rows:t,rowCount:g?Number(g[1]):f(t,d)}}const r=t??{},u="grandTotal"in r?{grandTotal:r.grandTotal??null}:{},l=r.rows??r.data??r.items??[],s=r.rowCount??r.total??r.count,e=s==null?f(l,d):Number(s),o=Array.isArray(r.pivotResultFields)?{pivotResultFields:r.pivotResultFields}:{},a=r.appliedExpression===!0?{appliedExpression:!0}:{};return{rows:l,rowCount:e,...u,...o,...a}}export function createRestDataSource(t){w("studio","Studio");const n=t.fetch??globalThis.fetch,d=t.idField??(t.schema?y(t.schema):"id"),r=t.url.replace(/\/+$/,""),u=t.buildQuery??R,l=t.parse??v,s=o=>({...typeof t.headers=="function"?t.headers():t.headers??{},...o}),e=async(o,a)=>{const i=await n(o,a);if(!i.ok){const c=await i.json().then(p=>p?.error??p?.message,()=>{}),h=typeof c=="string"?c.trim().slice(0,200):"";throw Object.assign(new Error(`REST ${a?.method??"GET"} ${o} -> ${i.status} ${i.statusText}${typeof c=="string"&&c?`: ${c}`:""}`),{status:i.status,...h?{said:h}:{}})}return{body:i.status===204?void 0:await i.json().catch(()=>{}),res:i}};return{async getRows(o){const a=new URLSearchParams({...t.query,...u(o)}).toString(),i=a?`${r}?${a}`:r,{body:g,res:c}=await e(i,{headers:s()});return l(g,c,o)},async createRow(o){const{body:a}=await e(r,{method:"POST",headers:s({"content-type":"application/json"}),body:JSON.stringify(o)});return a??o},async updateRow(o,a){const{body:i}=await e(`${r}/${encodeURIComponent(o)}`,{method:"PATCH",headers:s({"content-type":"application/json"}),body:JSON.stringify(a)});return i??{...a,[d]:o}},async deleteRow(o){await e(`${r}/${encodeURIComponent(o)}`,{method:"DELETE",headers:s()}).catch(a=>{if(a?.status!==404)throw a})}}}