@svgrid/enterprise 3.1.12 → 3.1.13

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.
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./preload-helper-HclGiUj8.js";var n=e({createRowDrag:()=>a}),r=null,i=0;function a(e){let n=++i,a=()=>e.props.rowDragManaged===!0,o=()=>e.props.rowDragGroup??null;function s(t){let n=e.allRows[t];return n?n.original:null}function c(){return!a()||!r?!1:r.gridId===n||r.group!=null&&r.group===o()}let l=null;function u(){l!==null&&(cancelAnimationFrame(l),l=null)}function d(){u(),e.rowDragActive=!1,e.rowDropIndex=null,e.rowDropSide=null}function f(t,r,i,a){e.props.onRowDragEnd?.({row:t,toIndex:r,sameGrid:i,fromGridId:a,toGridId:n})}function p(t,i){if(!a())return;let c=s(i);if(c!=null){r={group:o(),gridId:n,row:c,sourceProps:e.props,removeFromSource:()=>{e.internalData=e.internalData.filter(e=>e!==c)}},e.rowDragActive=!0;try{t.dataTransfer?.setData(`text/plain`,String(i)),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`);let e=t.currentTarget,n=e&&e.tagName!==`TR`?e.closest?.(`tr`):null;if(n&&t.dataTransfer?.setDragImage){let e=n.getBoundingClientRect();t.dataTransfer.setDragImage(n,t.clientX-e.left,t.clientY-e.top)}}catch{}}}function m(t,n){if(!c())return;t.preventDefault(),u(),t.dataTransfer&&(t.dataTransfer.dropEffect=`move`);let r=t.currentTarget.getBoundingClientRect();e.rowDropIndex=n,e.rowDropSide=h(n,r,t.clientY)}function h(t,n,r){let i=(r-n.top)/Math.max(n.height,1);return e.props.onRowDrop&&i>=.25&&i<=.75&&g(t)?`into`:i<.5?`before`:`after`}function g(t){let n=e.allRows[t];if(!n)return!1;let r=e.props.serverGroup;return r?!!r.isGroup(n.original):typeof n.getCanExpand==`function`&&n.getCanExpand()}function _(t){if(e.rowDropIndex===t){if(u(),typeof requestAnimationFrame!=`function`){e.rowDropIndex=null,e.rowDropSide=null;return}l=requestAnimationFrame(()=>{l=null,e.rowDropIndex===t&&(e.rowDropIndex=null,e.rowDropSide=null)})}}function v(t,i){if(!c()||!r)return;let a=r.row,o=s(t),l=r.gridId,u=l===n;if(d(),u&&e.props.onRowDrop){r=null,e.props.onRowDrop({row:a,target:o,targetIndex:t,side:i});return}i===`into`&&(i=`after`);let p=e.internalData.slice();if(u){let e=p.indexOf(a);if(e<0){r=null;return}p.splice(e,1)}let m=o==null?p.length:p.indexOf(o);m<0&&(m=p.length),i===`after`&&(m+=1),p.splice(m,0,a),e.internalData=p,u||r.removeFromSource(),f(a,m,u,l),r=null}function y(t,n){!c()||!r||(t.preventDefault(),t.stopPropagation(),v(n,e.rowDropSide??`before`))}function b(e){c()&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`))}function x(t){if(!c()||!r)return;t.preventDefault();let i=r.row,a=r.gridId,o=a===n;if(d(),o&&e.props.onRowDrop){r=null,e.props.onRowDrop({row:i,target:null,targetIndex:null,side:`after`});return}let s=e.internalData.slice();if(o){let e=s.indexOf(i);e>=0&&s.splice(e,1)}s.push(i),e.internalData=s,o||r.removeFromSource(),f(i,s.length-1,o,a),r=null}function S(){d(),r=null}let C=null,w=!1;function T(){return{ctx:e,managed:a,originalAt:s,commitDropOnRow:v,clearIndicators:d,cancelPendingLeave:u,openBus:t=>{r={group:o(),gridId:n,row:t,sourceProps:e.props,removeFromSource:()=>{e.internalData=e.internalData.filter(e=>e!==t)}}},closeBus:()=>{r=null}}}function E(e,n){if(!a()||e.pointerType!==`touch`)return;if(C){C.start(e,n);return}if(w)return;w=!0;let r=e.pointerId,i=e.clientX,o=e.clientY,s=performance.now(),c=!1;function l(){window.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d)}function u(e){e.pointerId===r&&Math.abs(e.clientY-o)+Math.abs(e.clientX-i)>10&&(c=!0,l())}function d(e){e.pointerId===r&&(c=!0,l())}window.addEventListener(`pointermove`,u,{passive:!0}),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d);let f={pointerId:e.pointerId,pointerType:e.pointerType,clientX:e.clientX,clientY:e.clientY,currentTarget:e.currentTarget,preventDefault:()=>{}};t(()=>import(`./row-drag-touch-BdknxBNL.js`).then(e=>{w=!1,l(),!(c||!a())&&(C=e.createTouchDrag(T()),C.start(f,n,s))}),[],import.meta.url)}return{onRowDragStart:p,onRowDragOver:m,onRowDragLeave:_,onRowDrop:y,onRowsContainerDragOver:b,onRowsContainerDrop:x,onRowDragEnd:S,onRowPointerDown:E,rowDragGridId:n,destroyRowDrag(){u(),C?.destroy(),C=null,r?.gridId===n&&(r=null)}}}export{n as t};
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>SvGrid Studio - Designer</title>
7
- <script type="module" crossorigin src="./assets/index-DUaUUFEm.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-CNbankAl.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-Dd_uD5pT.js">
9
9
  <link rel="modulepreload" crossorigin href="./assets/disclose-version-CIm4S9xS.js">
10
10
  <link rel="modulepreload" crossorigin href="./assets/cell-formatting-JoxA0t65.js">
@@ -45,7 +45,7 @@
45
45
  <link rel="stylesheet" crossorigin href="./assets/SvMenuList-DJ47ba1h.css">
46
46
  <link rel="stylesheet" crossorigin href="./assets/SvGridChart-BgLuPO7I.css">
47
47
  <link rel="stylesheet" crossorigin href="./assets/SvGridChartPanel-4Pc8y5yO.css">
48
- <link rel="stylesheet" crossorigin href="./assets/index-B2WZFQ5M.css">
48
+ <link rel="stylesheet" crossorigin href="./assets/index-Bw8EYP1d.css">
49
49
  </head>
50
50
  <body>
51
51
  <div id="app"></div>
@@ -11841,7 +11841,9 @@ var GRID_ICON_GROUP_RULES = [
11841
11841
  "tool-panel",
11842
11842
  "chart",
11843
11843
  "advanced-filter",
11844
- "column-group-caret"
11844
+ "column-group-caret",
11845
+ "no-rows",
11846
+ "no-rows-filtered"
11845
11847
  ].includes(n)
11846
11848
  },
11847
11849
  {
@@ -16455,7 +16457,7 @@ function hasFieldConditions(schema) {
16455
16457
  *
16456
16458
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
16457
16459
  */
16458
- var SVGRID_VERSION = "3.1.12";
16460
+ var SVGRID_VERSION = "3.1.13";
16459
16461
  /**
16460
16462
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16461
16463
  * on 3.1.x while the grid is on 3.0.x.
@@ -16468,7 +16470,7 @@ var SVGRID_VERSION = "3.1.12";
16468
16470
  *
16469
16471
  * `version.test.ts` asserts this matches packages/grid/package.json.
16470
16472
  */
16471
- var GRID_VERSION = "3.0.15";
16473
+ var GRID_VERSION = "3.0.16";
16472
16474
  //#endregion
16473
16475
  //#region src/studio/emit-project.ts
16474
16476
  var has = (blocks, kind) => blocks.some((b) => b.config.kind === kind);
@@ -670,7 +670,7 @@ const GRID_ICON_GROUP_RULES = [
670
670
  { label: 'Filter operators', match: (n) => n.startsWith('op-') },
671
671
  { label: 'Pinning', match: (n) => n === 'pin-left' || n === 'pin-right' || n === 'unpin' },
672
672
  { label: 'Rows + grouping', match: (n) => ['group', 'group-add', 'row-number', 'pinned-row-top', 'pinned-row-bottom', 'drag-handle', 'breadcrumb-separator'].includes(n) },
673
- { label: 'Toolbar + overlays', match: (n) => ['search', 'tool-panel', 'chart', 'advanced-filter', 'column-group-caret'].includes(n) },
673
+ { label: 'Toolbar + overlays', match: (n) => ['search', 'tool-panel', 'chart', 'advanced-filter', 'column-group-caret', 'no-rows', 'no-rows-filtered'].includes(n) },
674
674
  { label: 'Pager', match: (n) => n.startsWith('page-') },
675
675
  { label: 'Find + move', match: (n) => n.startsWith('find-') || n.startsWith('move-') },
676
676
  { label: 'Close + clear', match: (n) => ['x', 'close', 'clear', 'remove'].includes(n) },
package/dist/version.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
12
12
  */
13
- export declare const SVGRID_VERSION = "3.1.12";
13
+ export declare const SVGRID_VERSION = "3.1.13";
14
14
  /**
15
15
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16
16
  * on 3.1.x while the grid is on 3.0.x.
@@ -23,4 +23,4 @@ export declare const SVGRID_VERSION = "3.1.12";
23
23
  *
24
24
  * `version.test.ts` asserts this matches packages/grid/package.json.
25
25
  */
26
- export declare const GRID_VERSION = "3.0.15";
26
+ export declare const GRID_VERSION = "3.0.16";
package/dist/version.js CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
12
12
  */
13
- export const SVGRID_VERSION = '3.1.12';
13
+ export const SVGRID_VERSION = '3.1.13';
14
14
  /**
15
15
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16
16
  * on 3.1.x while the grid is on 3.0.x.
@@ -23,4 +23,4 @@ export const SVGRID_VERSION = '3.1.12';
23
23
  *
24
24
  * `version.test.ts` asserts this matches packages/grid/package.json.
25
25
  */
26
- export const GRID_VERSION = '3.0.15';
26
+ export const GRID_VERSION = '3.0.16';
@@ -0,0 +1,204 @@
1
+ //#region ../grid/dist/row-drag.js
2
+ var e = null, t = 0;
3
+ function n(n) {
4
+ let r = ++t, i = () => n.props.rowDragManaged === !0, a = () => n.props.rowDragGroup ?? null;
5
+ function o(e) {
6
+ let t = n.allRows[e];
7
+ return t ? t.original : null;
8
+ }
9
+ function s() {
10
+ return !i() || !e ? !1 : e.gridId === r || e.group != null && e.group === a();
11
+ }
12
+ let c = null;
13
+ function l() {
14
+ c !== null && (cancelAnimationFrame(c), c = null);
15
+ }
16
+ function u() {
17
+ l(), n.rowDragActive = !1, n.rowDropIndex = null, n.rowDropSide = null;
18
+ }
19
+ function d(e, t, i, a) {
20
+ n.props.onRowDragEnd?.({
21
+ row: e,
22
+ toIndex: t,
23
+ sameGrid: i,
24
+ fromGridId: a,
25
+ toGridId: r
26
+ });
27
+ }
28
+ function f(t, s) {
29
+ if (!i()) return;
30
+ let c = o(s);
31
+ if (c != null) {
32
+ e = {
33
+ group: a(),
34
+ gridId: r,
35
+ row: c,
36
+ sourceProps: n.props,
37
+ removeFromSource: () => {
38
+ n.internalData = n.internalData.filter((e) => e !== c);
39
+ }
40
+ }, n.rowDragActive = !0;
41
+ try {
42
+ t.dataTransfer?.setData("text/plain", String(s)), t.dataTransfer && (t.dataTransfer.effectAllowed = "move");
43
+ let e = t.currentTarget, n = e && e.tagName !== "TR" ? e.closest?.("tr") : null;
44
+ if (n && t.dataTransfer?.setDragImage) {
45
+ let e = n.getBoundingClientRect();
46
+ t.dataTransfer.setDragImage(n, t.clientX - e.left, t.clientY - e.top);
47
+ }
48
+ } catch {}
49
+ }
50
+ }
51
+ function p(e, t) {
52
+ if (!s()) return;
53
+ e.preventDefault(), l(), e.dataTransfer && (e.dataTransfer.dropEffect = "move");
54
+ let r = e.currentTarget.getBoundingClientRect();
55
+ n.rowDropIndex = t, n.rowDropSide = m(t, r, e.clientY);
56
+ }
57
+ function m(e, t, r) {
58
+ let i = (r - t.top) / Math.max(t.height, 1);
59
+ return n.props.onRowDrop && i >= .25 && i <= .75 && h(e) ? "into" : i < .5 ? "before" : "after";
60
+ }
61
+ function h(e) {
62
+ let t = n.allRows[e];
63
+ if (!t) return !1;
64
+ let r = n.props.serverGroup;
65
+ return r ? !!r.isGroup(t.original) : typeof t.getCanExpand == "function" && t.getCanExpand();
66
+ }
67
+ function g(e) {
68
+ if (n.rowDropIndex === e) {
69
+ if (l(), typeof requestAnimationFrame != "function") {
70
+ n.rowDropIndex = null, n.rowDropSide = null;
71
+ return;
72
+ }
73
+ c = requestAnimationFrame(() => {
74
+ c = null, n.rowDropIndex === e && (n.rowDropIndex = null, n.rowDropSide = null);
75
+ });
76
+ }
77
+ }
78
+ function _(t, i) {
79
+ if (!s() || !e) return;
80
+ let a = e.row, c = o(t), l = e.gridId, f = l === r;
81
+ if (u(), f && n.props.onRowDrop) {
82
+ e = null, n.props.onRowDrop({
83
+ row: a,
84
+ target: c,
85
+ targetIndex: t,
86
+ side: i
87
+ });
88
+ return;
89
+ }
90
+ i === "into" && (i = "after");
91
+ let p = n.internalData.slice();
92
+ if (f) {
93
+ let t = p.indexOf(a);
94
+ if (t < 0) {
95
+ e = null;
96
+ return;
97
+ }
98
+ p.splice(t, 1);
99
+ }
100
+ let m = c == null ? p.length : p.indexOf(c);
101
+ m < 0 && (m = p.length), i === "after" && (m += 1), p.splice(m, 0, a), n.internalData = p, f || e.removeFromSource(), d(a, m, f, l), e = null;
102
+ }
103
+ function v(t, r) {
104
+ !s() || !e || (t.preventDefault(), t.stopPropagation(), _(r, n.rowDropSide ?? "before"));
105
+ }
106
+ function y(e) {
107
+ s() && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
108
+ }
109
+ function b(t) {
110
+ if (!s() || !e) return;
111
+ t.preventDefault();
112
+ let i = e.row, a = e.gridId, o = a === r;
113
+ if (u(), o && n.props.onRowDrop) {
114
+ e = null, n.props.onRowDrop({
115
+ row: i,
116
+ target: null,
117
+ targetIndex: null,
118
+ side: "after"
119
+ });
120
+ return;
121
+ }
122
+ let c = n.internalData.slice();
123
+ if (o) {
124
+ let e = c.indexOf(i);
125
+ e >= 0 && c.splice(e, 1);
126
+ }
127
+ c.push(i), n.internalData = c, o || e.removeFromSource(), d(i, c.length - 1, o, a), e = null;
128
+ }
129
+ function x() {
130
+ u(), e = null;
131
+ }
132
+ let S = null, C = !1;
133
+ function w() {
134
+ return {
135
+ ctx: n,
136
+ managed: i,
137
+ originalAt: o,
138
+ commitDropOnRow: _,
139
+ clearIndicators: u,
140
+ cancelPendingLeave: l,
141
+ openBus: (t) => {
142
+ e = {
143
+ group: a(),
144
+ gridId: r,
145
+ row: t,
146
+ sourceProps: n.props,
147
+ removeFromSource: () => {
148
+ n.internalData = n.internalData.filter((e) => e !== t);
149
+ }
150
+ };
151
+ },
152
+ closeBus: () => {
153
+ e = null;
154
+ }
155
+ };
156
+ }
157
+ function T(e, t) {
158
+ if (!i() || e.pointerType !== "touch") return;
159
+ if (S) {
160
+ S.start(e, t);
161
+ return;
162
+ }
163
+ if (C) return;
164
+ C = !0;
165
+ let n = e.pointerId, r = e.clientX, a = e.clientY, o = performance.now(), s = !1;
166
+ function c() {
167
+ window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u), window.removeEventListener("pointercancel", u);
168
+ }
169
+ function l(e) {
170
+ e.pointerId === n && Math.abs(e.clientY - a) + Math.abs(e.clientX - r) > 10 && (s = !0, c());
171
+ }
172
+ function u(e) {
173
+ e.pointerId === n && (s = !0, c());
174
+ }
175
+ window.addEventListener("pointermove", l, { passive: !0 }), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", u);
176
+ let d = {
177
+ pointerId: e.pointerId,
178
+ pointerType: e.pointerType,
179
+ clientX: e.clientX,
180
+ clientY: e.clientY,
181
+ currentTarget: e.currentTarget,
182
+ preventDefault: () => {}
183
+ };
184
+ import("./row-drag-touch-CycRR65n.js").then((e) => {
185
+ C = !1, c(), !(s || !i()) && (S = e.createTouchDrag(w()), S.start(d, t, o));
186
+ });
187
+ }
188
+ return {
189
+ onRowDragStart: f,
190
+ onRowDragOver: p,
191
+ onRowDragLeave: g,
192
+ onRowDrop: v,
193
+ onRowsContainerDragOver: y,
194
+ onRowsContainerDrop: b,
195
+ onRowDragEnd: x,
196
+ onRowPointerDown: T,
197
+ rowDragGridId: r,
198
+ destroyRowDrag() {
199
+ l(), S?.destroy(), S = null, e?.gridId === r && (e = null);
200
+ }
201
+ };
202
+ }
203
+ //#endregion
204
+ export { n as createRowDrag };