@vuu-ui/vuu-utils 0.13.40 → 0.13.42
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/cjs/node_modules/@preact/signals-core/dist/signals-core.js +2 -4
- package/cjs/node_modules/@preact/signals-core/dist/signals-core.js.map +1 -1
- package/cjs/packages/vuu-utils/src/index.js +3 -7
- package/cjs/packages/vuu-utils/src/index.js.map +1 -1
- package/cjs/packages/vuu-utils/src/moving-window.js +0 -8
- package/cjs/packages/vuu-utils/src/moving-window.js.map +1 -1
- package/cjs/packages/vuu-utils/src/protocol-message-utils.js +20 -0
- package/cjs/packages/vuu-utils/src/protocol-message-utils.js.map +1 -1
- package/cjs/packages/vuu-utils/src/row-utils.js +4 -6
- package/cjs/packages/vuu-utils/src/row-utils.js.map +1 -1
- package/cjs/packages/vuu-utils/src/selection-utils.js +21 -234
- package/cjs/packages/vuu-utils/src/selection-utils.js.map +1 -1
- package/esm/node_modules/@preact/signals-core/dist/signals-core.js +2 -2
- package/esm/node_modules/@preact/signals-core/dist/signals-core.js.map +1 -1
- package/esm/packages/vuu-utils/src/index.js +2 -2
- package/esm/packages/vuu-utils/src/moving-window.js +0 -8
- package/esm/packages/vuu-utils/src/moving-window.js.map +1 -1
- package/esm/packages/vuu-utils/src/protocol-message-utils.js +18 -1
- package/esm/packages/vuu-utils/src/protocol-message-utils.js.map +1 -1
- package/esm/packages/vuu-utils/src/row-utils.js +4 -6
- package/esm/packages/vuu-utils/src/row-utils.js.map +1 -1
- package/esm/packages/vuu-utils/src/selection-utils.js +22 -228
- package/esm/packages/vuu-utils/src/selection-utils.js.map +1 -1
- package/package.json +6 -6
- package/types/protocol-message-utils.d.ts +5 -1
- package/types/row-utils.d.ts +4 -4
- package/types/selection-utils.d.ts +3 -28
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const i=Symbol.for("preact-signals");function t(){if(r>1){r--;return}let i,t=!1;while(void 0!==s){let o=s;s=void 0;f++;while(void 0!==o){const n=o.o;o.o=void 0;o.f&=-3;if(!(8&o.f)&&v(o))try{o.c();}catch(o){if(!t){i=o;t=!0;}}o=n;}}f=0;r--;if(t)throw i}function o(i){if(r>0)return i();r++;try{return i()}finally{t();}}let n,s;function h(i){const t=n;n=void 0;try{return i()}finally{n=t;}}let r=0,f=0,e=0;function
|
|
3
|
+
const i=Symbol.for("preact-signals");function t(){if(r>1){r--;return}let i,t=!1;while(void 0!==s){let o=s;s=void 0;f++;while(void 0!==o){const n=o.o;o.o=void 0;o.f&=-3;if(!(8&o.f)&&v(o))try{o.c();}catch(o){if(!t){i=o;t=!0;}}o=n;}}f=0;r--;if(t)throw i}function o(i){if(r>0)return i();r++;try{return i()}finally{t();}}let n,s;function h(i){const t=n;n=void 0;try{return i()}finally{n=t;}}let r=0,f=0,e=0;function c(i){if(void 0===n)return;let t=i.n;if(void 0===t||t.t!==n){t={i:0,S:i,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:t};if(void 0!==n.s)n.s.n=t;n.s=t;i.n=t;if(32&n.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=n.s;t.n=void 0;n.s.n=t;n.s=t;}return t}}function u(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;}u.prototype.brand=i;u.prototype.h=function(){return !0};u.prototype.S=function(i){const t=this.t;if(t!==i&&void 0===i.e){i.x=t;this.t=i;if(void 0!==t)t.e=i;else h(()=>{var i;null==(i=this.W)||i.call(this);});}};u.prototype.U=function(i){if(void 0!==this.t){const t=i.e,o=i.x;if(void 0!==t){t.x=o;i.e=void 0;}if(void 0!==o){o.e=t;i.x=void 0;}if(i===this.t){this.t=o;if(void 0===o)h(()=>{var i;null==(i=this.Z)||i.call(this);});}}};u.prototype.subscribe=function(i){return E(()=>{const t=this.value,o=n;n=void 0;try{i(t);}finally{n=o;}})};u.prototype.valueOf=function(){return this.value};u.prototype.toString=function(){return this.value+""};u.prototype.toJSON=function(){return this.value};u.prototype.peek=function(){const i=n;n=void 0;try{return this.value}finally{n=i;}};Object.defineProperty(u.prototype,"value",{get(){const i=c(this);if(void 0!==i)i.i=this.i;return this.v},set(i){if(i!==this.v){if(f>100)throw new Error("Cycle detected");this.v=i;this.i++;e++;r++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N();}finally{t();}}}});function d(i,t){return new u(i,t)}function v(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return !0;return !1}function l(i){for(let t=i.s;void 0!==t;t=t.n){const o=t.S.n;if(void 0!==o)t.r=o;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function y(i){let t,o=i.s;while(void 0!==o){const i=o.p;if(-1===o.i){o.S.U(o);if(void 0!==i)i.n=o.n;if(void 0!==o.n)o.n.p=i;}else t=o;o.S.n=o.r;if(void 0!==o.r)o.r=void 0;o=i;}i.s=t;}function a(i,t){u.call(this,void 0);this.x=i;this.s=void 0;this.g=e-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;}a.prototype=new u;a.prototype.h=function(){this.f&=-3;if(1&this.f)return !1;if(32==(36&this.f))return !0;this.f&=-5;if(this.g===e)return !0;this.g=e;this.f|=1;if(this.i>0&&!v(this)){this.f&=-2;return !0}const i=n;try{l(this);n=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}n=i;y(this);this.f&=-2;return !0};a.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i);}u.prototype.S.call(this,i);};a.prototype.U=function(i){if(void 0!==this.t){u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i);}}};a.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N();}};Object.defineProperty(a.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const i=c(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i,t){return new a(i,t)}function _(i){const o=i.u;i.u=void 0;if("function"==typeof o){r++;const s=n;n=void 0;try{o();}catch(t){i.f&=-2;i.f|=8;b(i);throw t}finally{n=s;t();}}}function b(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;_(i);}function g(i){if(n!==this)throw new Error("Out-of-order effect");y(this);n=i;this.f&=-2;if(8&this.f)b(this);t();}function p(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}p.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};p.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;_(this);l(this);r++;const i=n;n=this;return g.bind(this,i)};p.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=s;s=this;}};p.prototype.d=function(){this.f|=8;if(!(1&this.f))b(this);};p.prototype.dispose=function(){this.d();};function E(i){const t=new p(i);try{t.c();}catch(i){t.d();throw i}const o=t.d.bind(t);o[Symbol.dispose]=o;return o}
|
|
4
4
|
|
|
5
|
-
exports.
|
|
6
|
-
exports.Effect = p;
|
|
7
|
-
exports.Signal = c;
|
|
5
|
+
exports.Signal = u;
|
|
8
6
|
exports.batch = o;
|
|
9
7
|
exports.computed = w;
|
|
10
8
|
exports.effect = E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signals-core.js","sources":["../../../../../../../node_modules/@preact/signals-core/dist/signals-core.mjs"],"sourcesContent":["const i=Symbol.for(\"preact-signals\");function t(){if(r>1){r--;return}let i,t=!1;while(void 0!==s){let o=s;s=void 0;f++;while(void 0!==o){const n=o.o;o.o=void 0;o.f&=-3;if(!(8&o.f)&&v(o))try{o.c()}catch(o){if(!t){i=o;t=!0}}o=n}}f=0;r--;if(t)throw i}function o(i){if(r>0)return i();r++;try{return i()}finally{t()}}let n,s;function h(i){const t=n;n=void 0;try{return i()}finally{n=t}}let r=0,f=0,e=0;function u(i){if(void 0===n)return;let t=i.n;if(void 0===t||t.t!==n){t={i:0,S:i,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:t};if(void 0!==n.s)n.s.n=t;n.s=t;i.n=t;if(32&n.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=n.s;t.n=void 0;n.s.n=t;n.s=t}return t}}function c(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}c.prototype.brand=i;c.prototype.h=function(){return!0};c.prototype.S=function(i){const t=this.t;if(t!==i&&void 0===i.e){i.x=t;this.t=i;if(void 0!==t)t.e=i;else h(()=>{var i;null==(i=this.W)||i.call(this)})}};c.prototype.U=function(i){if(void 0!==this.t){const t=i.e,o=i.x;if(void 0!==t){t.x=o;i.e=void 0}if(void 0!==o){o.e=t;i.x=void 0}if(i===this.t){this.t=o;if(void 0===o)h(()=>{var i;null==(i=this.Z)||i.call(this)})}}};c.prototype.subscribe=function(i){return E(()=>{const t=this.value,o=n;n=void 0;try{i(t)}finally{n=o}},{name:\"sub\"})};c.prototype.valueOf=function(){return this.value};c.prototype.toString=function(){return this.value+\"\"};c.prototype.toJSON=function(){return this.value};c.prototype.peek=function(){const i=n;n=void 0;try{return this.value}finally{n=i}};Object.defineProperty(c.prototype,\"value\",{get(){const i=u(this);if(void 0!==i)i.i=this.i;return this.v},set(i){if(i!==this.v){if(f>100)throw new Error(\"Cycle detected\");this.v=i;this.i++;e++;r++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N()}finally{t()}}}});function d(i,t){return new c(i,t)}function v(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function l(i){for(let t=i.s;void 0!==t;t=t.n){const o=t.S.n;if(void 0!==o)t.r=o;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function y(i){let t,o=i.s;while(void 0!==o){const i=o.p;if(-1===o.i){o.S.U(o);if(void 0!==i)i.n=o.n;if(void 0!==o.n)o.n.p=i}else t=o;o.S.n=o.r;if(void 0!==o.r)o.r=void 0;o=i}i.s=t}function a(i,t){c.call(this,void 0);this.x=i;this.s=void 0;this.g=e-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}a.prototype=new c;a.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===e)return!0;this.g=e;this.f|=1;if(this.i>0&&!v(this)){this.f&=-2;return!0}const i=n;try{l(this);n=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}n=i;y(this);this.f&=-2;return!0};a.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i)}c.prototype.S.call(this,i)};a.prototype.U=function(i){if(void 0!==this.t){c.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i)}}};a.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(a.prototype,\"value\",{get(){if(1&this.f)throw new Error(\"Cycle detected\");const i=u(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i,t){return new a(i,t)}function _(i){const o=i.u;i.u=void 0;if(\"function\"==typeof o){r++;const s=n;n=void 0;try{o()}catch(t){i.f&=-2;i.f|=8;b(i);throw t}finally{n=s;t()}}}function b(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;_(i)}function g(i){if(n!==this)throw new Error(\"Out-of-order effect\");y(this);n=i;this.f&=-2;if(8&this.f)b(this);t()}function p(i,t){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}p.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if(\"function\"==typeof t)this.u=t}finally{i()}};p.prototype.S=function(){if(1&this.f)throw new Error(\"Cycle detected\");this.f|=1;this.f&=-9;_(this);l(this);r++;const i=n;n=this;return g.bind(this,i)};p.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=s;s=this}};p.prototype.d=function(){this.f|=8;if(!(1&this.f))b(this)};p.prototype.dispose=function(){this.d()};function E(i,t){const o=new p(i,t);try{o.c()}catch(i){o.d();throw i}const n=o.d.bind(o);n[Symbol.dispose]=n;return n}export{a as Computed,p as Effect,c as Signal,o as batch,w as computed,E as effect,d as signal,h as untracked};//# sourceMappingURL=signals-core.mjs.map\n"],"names":[],"mappings":";;AAAA,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"signals-core.js","sources":["../../../../../../../node_modules/@preact/signals-core/dist/signals-core.mjs"],"sourcesContent":["const i=Symbol.for(\"preact-signals\");function t(){if(r>1){r--;return}let i,t=!1;while(void 0!==s){let o=s;s=void 0;f++;while(void 0!==o){const n=o.o;o.o=void 0;o.f&=-3;if(!(8&o.f)&&v(o))try{o.c()}catch(o){if(!t){i=o;t=!0}}o=n}}f=0;r--;if(t)throw i}function o(i){if(r>0)return i();r++;try{return i()}finally{t()}}let n,s;function h(i){const t=n;n=void 0;try{return i()}finally{n=t}}let r=0,f=0,e=0;function c(i){if(void 0===n)return;let t=i.n;if(void 0===t||t.t!==n){t={i:0,S:i,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:t};if(void 0!==n.s)n.s.n=t;n.s=t;i.n=t;if(32&n.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=n.s;t.n=void 0;n.s.n=t;n.s=t}return t}}function u(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched}u.prototype.brand=i;u.prototype.h=function(){return!0};u.prototype.S=function(i){const t=this.t;if(t!==i&&void 0===i.e){i.x=t;this.t=i;if(void 0!==t)t.e=i;else h(()=>{var i;null==(i=this.W)||i.call(this)})}};u.prototype.U=function(i){if(void 0!==this.t){const t=i.e,o=i.x;if(void 0!==t){t.x=o;i.e=void 0}if(void 0!==o){o.e=t;i.x=void 0}if(i===this.t){this.t=o;if(void 0===o)h(()=>{var i;null==(i=this.Z)||i.call(this)})}}};u.prototype.subscribe=function(i){return E(()=>{const t=this.value,o=n;n=void 0;try{i(t)}finally{n=o}})};u.prototype.valueOf=function(){return this.value};u.prototype.toString=function(){return this.value+\"\"};u.prototype.toJSON=function(){return this.value};u.prototype.peek=function(){const i=n;n=void 0;try{return this.value}finally{n=i}};Object.defineProperty(u.prototype,\"value\",{get(){const i=c(this);if(void 0!==i)i.i=this.i;return this.v},set(i){if(i!==this.v){if(f>100)throw new Error(\"Cycle detected\");this.v=i;this.i++;e++;r++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N()}finally{t()}}}});function d(i,t){return new u(i,t)}function v(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function l(i){for(let t=i.s;void 0!==t;t=t.n){const o=t.S.n;if(void 0!==o)t.r=o;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function y(i){let t,o=i.s;while(void 0!==o){const i=o.p;if(-1===o.i){o.S.U(o);if(void 0!==i)i.n=o.n;if(void 0!==o.n)o.n.p=i}else t=o;o.S.n=o.r;if(void 0!==o.r)o.r=void 0;o=i}i.s=t}function a(i,t){u.call(this,void 0);this.x=i;this.s=void 0;this.g=e-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched}a.prototype=new u;a.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===e)return!0;this.g=e;this.f|=1;if(this.i>0&&!v(this)){this.f&=-2;return!0}const i=n;try{l(this);n=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}n=i;y(this);this.f&=-2;return!0};a.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i)}u.prototype.S.call(this,i)};a.prototype.U=function(i){if(void 0!==this.t){u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i)}}};a.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(a.prototype,\"value\",{get(){if(1&this.f)throw new Error(\"Cycle detected\");const i=c(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i,t){return new a(i,t)}function _(i){const o=i.u;i.u=void 0;if(\"function\"==typeof o){r++;const s=n;n=void 0;try{o()}catch(t){i.f&=-2;i.f|=8;b(i);throw t}finally{n=s;t()}}}function b(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;_(i)}function g(i){if(n!==this)throw new Error(\"Out-of-order effect\");y(this);n=i;this.f&=-2;if(8&this.f)b(this);t()}function p(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}p.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if(\"function\"==typeof t)this.u=t}finally{i()}};p.prototype.S=function(){if(1&this.f)throw new Error(\"Cycle detected\");this.f|=1;this.f&=-9;_(this);l(this);r++;const i=n;n=this;return g.bind(this,i)};p.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=s;s=this}};p.prototype.d=function(){this.f|=8;if(!(1&this.f))b(this)};p.prototype.dispose=function(){this.d()};function E(i){const t=new p(i);try{t.c()}catch(i){t.d();throw i}const o=t.d.bind(t);o[Symbol.dispose]=o;return o}export{u as Signal,o as batch,w as computed,E as effect,d as signal,h as untracked};//# sourceMappingURL=signals-core.mjs.map\n"],"names":[],"mappings":";;AAAA,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAA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 exports.isOpenDialogAction = protocolMessageUtils.isOpenDialogAction;
|
|
|
360
360
|
exports.isOpenSessionTableDialogMessage = protocolMessageUtils.isOpenSessionTableDialogMessage;
|
|
361
361
|
exports.isRequestResponse = protocolMessageUtils.isRequestResponse;
|
|
362
362
|
exports.isRpcServiceRequest = protocolMessageUtils.isRpcServiceRequest;
|
|
363
|
+
exports.isSelectRequest = protocolMessageUtils.isSelectRequest;
|
|
364
|
+
exports.isSelectSuccessWithRowCount = protocolMessageUtils.isSelectSuccessWithRowCount;
|
|
363
365
|
exports.isSessionTable = protocolMessageUtils.isSessionTable;
|
|
364
366
|
exports.isSessionTableActionMessage = protocolMessageUtils.isSessionTableActionMessage;
|
|
365
367
|
exports.isTypeaheadRequest = protocolMessageUtils.isTypeaheadRequest;
|
|
366
368
|
exports.isVuuMenuRpcRequest = protocolMessageUtils.isVuuMenuRpcRequest;
|
|
367
369
|
exports.vuuAddRowRequest = protocolMessageUtils.vuuAddRowRequest;
|
|
368
370
|
exports.vuuDeleteRowRequest = protocolMessageUtils.vuuDeleteRowRequest;
|
|
371
|
+
exports.vuuEditCellRequest = protocolMessageUtils.vuuEditCellRequest;
|
|
369
372
|
exports.NULL_RANGE = rangeUtils.NULL_RANGE;
|
|
370
373
|
exports.Range = rangeUtils.Range;
|
|
371
374
|
exports.WindowRange = rangeUtils.WindowRange;
|
|
@@ -376,15 +379,8 @@ exports.actualRowPositioning = rowUtils.actualRowPositioning;
|
|
|
376
379
|
exports.asDataSourceRowObject = rowUtils.asDataSourceRowObject;
|
|
377
380
|
exports.virtualRowPositioning = rowUtils.virtualRowPositioning;
|
|
378
381
|
exports.vuuRowToDataSourceRow = rowUtils.vuuRowToDataSourceRow;
|
|
379
|
-
exports.RowSelected = selectionUtils.RowSelected;
|
|
380
382
|
exports.deselectItem = selectionUtils.deselectItem;
|
|
381
|
-
exports.expandSelection = selectionUtils.expandSelection;
|
|
382
|
-
exports.getSelectionStatus = selectionUtils.getSelectionStatus;
|
|
383
|
-
exports.isRowSelected = selectionUtils.isRowSelected;
|
|
384
|
-
exports.isRowSelectedLast = selectionUtils.isRowSelectedLast;
|
|
385
|
-
exports.isSelected = selectionUtils.isSelected;
|
|
386
383
|
exports.selectItem = selectionUtils.selectItem;
|
|
387
|
-
exports.selectionCount = selectionUtils.selectionCount;
|
|
388
384
|
exports.VuuShellLocation = shellLayoutTypes.VuuShellLocation;
|
|
389
385
|
exports.addSortColumn = sortUtils.addSortColumn;
|
|
390
386
|
exports.getSortStatus = sortUtils.getSortStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var columnUtils = require('./column-utils.js');
|
|
4
4
|
var rangeUtils = require('./range-utils.js');
|
|
5
|
-
var selectionUtils = require('./selection-utils.js');
|
|
6
5
|
|
|
7
6
|
var __defProp = Object.defineProperty;
|
|
8
7
|
var __typeError = (msg) => {
|
|
@@ -36,13 +35,6 @@ class MovingWindow {
|
|
|
36
35
|
if (this.isWithinRange(index)) {
|
|
37
36
|
const internalIndex = index - __privateGet(this, _range).from;
|
|
38
37
|
this.data[internalIndex] = data;
|
|
39
|
-
if (data[SELECTED]) {
|
|
40
|
-
const previousRow = this.data[internalIndex - 1];
|
|
41
|
-
if (selectionUtils.isRowSelectedLast(previousRow)) {
|
|
42
|
-
this.data[internalIndex - 1] = previousRow.slice();
|
|
43
|
-
this.data[internalIndex - 1][SELECTED] -= 4;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
38
|
}
|
|
47
39
|
}
|
|
48
40
|
getAtIndex(index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moving-window.js","sources":["../../../../../../packages/vuu-utils/src/moving-window.ts"],"sourcesContent":["import { DataSourceRow } from \"@vuu-ui/vuu-data-types\";\nimport { VuuRange } from \"@vuu-ui/vuu-protocol-types\";\nimport { metadataKeys } from \"./column-utils\";\nimport { WindowRange } from \"./range-utils\";\
|
|
1
|
+
{"version":3,"file":"moving-window.js","sources":["../../../../../../packages/vuu-utils/src/moving-window.ts"],"sourcesContent":["import { DataSourceRow } from \"@vuu-ui/vuu-data-types\";\nimport { VuuRange } from \"@vuu-ui/vuu-protocol-types\";\nimport { metadataKeys } from \"./column-utils\";\nimport { WindowRange } from \"./range-utils\";\n\nconst { SELECTED } = metadataKeys;\n\nexport class MovingWindow {\n public data: DataSourceRow[];\n public rowCount = 0;\n #range: WindowRange;\n\n constructor({ from, to }: VuuRange) {\n this.#range = new WindowRange(from, to);\n //internal data is always 0 based, we add range.from to determine an offset\n this.data = new Array(Math.max(0, to - from));\n this.rowCount = 0;\n }\n\n setRowCount = (rowCount: number) => {\n if (rowCount < this.data.length) {\n this.data.length = rowCount;\n }\n\n this.rowCount = rowCount;\n };\n\n add(data: DataSourceRow) {\n const [index] = data;\n if (this.isWithinRange(index)) {\n const internalIndex = index - this.#range.from;\n this.data[internalIndex] = data;\n }\n }\n\n getAtIndex(index: number) {\n return this.#range.isWithin(index) &&\n this.data[index - this.#range.from] != null\n ? this.data[index - this.#range.from]\n : undefined;\n }\n\n isWithinRange(index: number) {\n return this.#range.isWithin(index);\n }\n\n setRange({ from, to }: VuuRange) {\n if (from !== this.#range.from || to !== this.#range.to) {\n const [overlapFrom, overlapTo] = this.#range.overlap(from, to);\n const newData = new Array(Math.max(0, to - from));\n for (let i = overlapFrom; i < overlapTo; i++) {\n const data = this.getAtIndex(i);\n if (data) {\n const index = i - from;\n newData[index] = data;\n }\n }\n this.data = newData;\n this.#range.from = from;\n this.#range.to = to;\n }\n }\n\n getSelectedRows() {\n return this.data.filter((row) => row[SELECTED] !== 0);\n }\n\n get range() {\n return this.#range;\n }\n\n slice(): DataSourceRow[] {\n const data: DataSourceRow[] = [];\n const { from } = this.range;\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n data.push(this.data[i]);\n } else {\n data.push([from + i, from + i, true, false, 1, 0, \"\", 0, 0, false]);\n }\n }\n return data;\n }\n\n // TODO make this more performant, see implementation in\n // array-backed-moving-window - use same implementation\n get hasAllRowsWithinRange(): boolean {\n const { from, to } = this.#range;\n\n for (let i = from; i < to; i++) {\n if (this.getAtIndex(i) === undefined) {\n return false;\n }\n }\n return true;\n }\n}\n"],"names":["metadataKeys","WindowRange"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAA,MAAA;AAKA,MAAM,EAAE,UAAa,GAAAA,wBAAA;AAEd,MAAM,YAAa,CAAA;AAAA,EAKxB,WAAY,CAAA,EAAE,IAAM,EAAA,EAAA,EAAgB,EAAA;AAJpC,IAAO,aAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AACP,IAAA,aAAA,CAAA,IAAA,EAAO,UAAW,EAAA,CAAA,CAAA;AAClB,IAAA,YAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AASA,IAAA,aAAA,CAAA,IAAA,EAAA,aAAA,EAAc,CAAC,QAAqB,KAAA;AAClC,MAAI,IAAA,QAAA,GAAW,IAAK,CAAA,IAAA,C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,IAAK,CAAA,CAAC,CAAG,EAAA;AAChB,QAAA,IAAA,CAAK,IAAK,CAAA,IAAA,CAAK,IAAK,CAAA,CAAC,CAAC,CAAA;AAAA,OACjB,MAAA;AACL,QAAA,IAAA,CAAK,IAAK,CAAA,CAAC,IAAO,GAAA,CAAA,EAAG,OAAO,CAAG,EAAA,IAAA,EAAM,KAAO,EAAA,CAAA,EAAG,CAAG,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA,EAAG,KAAK,CAAC,CAAA;AAAA;AACpE;AAEF,IAAO,OAAA,IAAA;AAAA;AACT;AAAA;AAAA,EAIA,IAAI,qBAAiC,GAAA;AACnC,IAAA,MAAM,EAAE,IAAA,EAAM,EAAG,EAAA,GAAI,YAAK,CAAA,IAAA,EAAA,MAAA,CAAA;AAE1B,IAAA,KAAA,IAAS,CAAI,GAAA,IAAA,EAAM,CAAI,GAAA,EAAA,EAAI,CAAK,EAAA,EAAA;AAC9B,MAAA,IAAI,IAAK,CAAA,UAAA,CAAW,CAAC,CAAA,KAAM,KAAW,CAAA,EAAA;AACpC,QAAO,OAAA,KAAA;AAAA;AACT;AAEF,IAAO,OAAA,IAAA;AAAA;AAEX;AAtFE,MAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
|
|
@@ -14,6 +14,14 @@ const MENU_RPC_TYPES = [
|
|
|
14
14
|
"VP_EDIT_DELETE_ROW_RPC",
|
|
15
15
|
"VP_EDIT_SUBMIT_FORM_RPC"
|
|
16
16
|
];
|
|
17
|
+
const isSelectRequest = (message) => "type" in message && (message.type === "SELECT_ROW" || message.type === "DESELECT_ROW" || message.type === "SELECT_ROW_RANGE" || message.type === "SELECT_ALL" || message.type === "DESELECT_ALL");
|
|
18
|
+
const isSelectSuccessWithRowCount = (response) => [
|
|
19
|
+
"SELECT_ROW_SUCCESS",
|
|
20
|
+
"DESELECT_ROW_SUCCESS",
|
|
21
|
+
"SELECT_ROW_RANGE_SUCCESS",
|
|
22
|
+
"SELECT_ALL_SUCCESS",
|
|
23
|
+
"DESELECT_ALL_SUCCESS"
|
|
24
|
+
].includes(response.type ?? "") && typeof response.selectedRowCount === "number";
|
|
17
25
|
const isRpcServiceRequest = (message) => message.type === "RPC_REQUEST";
|
|
18
26
|
const hasViewPortContext = (message) => message.context.type === "VIEWPORT_CONTEXT";
|
|
19
27
|
const isVuuMenuRpcRequest = (message) => MENU_RPC_TYPES.includes(message["type"]);
|
|
@@ -27,6 +35,15 @@ const isTypeaheadRequest = (request) => {
|
|
|
27
35
|
function isEditCellRequest(request) {
|
|
28
36
|
return request.type === "VP_EDIT_CELL_RPC";
|
|
29
37
|
}
|
|
38
|
+
function vuuEditCellRequest(rowKey, field, value, vpId) {
|
|
39
|
+
return {
|
|
40
|
+
rowKey,
|
|
41
|
+
field,
|
|
42
|
+
value,
|
|
43
|
+
type: "VP_EDIT_CELL_RPC",
|
|
44
|
+
vpId
|
|
45
|
+
};
|
|
46
|
+
}
|
|
30
47
|
function vuuAddRowRequest(rowKey, data, vpId) {
|
|
31
48
|
return {
|
|
32
49
|
rowKey,
|
|
@@ -67,10 +84,13 @@ exports.isOpenDialogAction = isOpenDialogAction;
|
|
|
67
84
|
exports.isOpenSessionTableDialogMessage = isOpenSessionTableDialogMessage;
|
|
68
85
|
exports.isRequestResponse = isRequestResponse;
|
|
69
86
|
exports.isRpcServiceRequest = isRpcServiceRequest;
|
|
87
|
+
exports.isSelectRequest = isSelectRequest;
|
|
88
|
+
exports.isSelectSuccessWithRowCount = isSelectSuccessWithRowCount;
|
|
70
89
|
exports.isSessionTable = isSessionTable;
|
|
71
90
|
exports.isSessionTableActionMessage = isSessionTableActionMessage;
|
|
72
91
|
exports.isTypeaheadRequest = isTypeaheadRequest;
|
|
73
92
|
exports.isVuuMenuRpcRequest = isVuuMenuRpcRequest;
|
|
74
93
|
exports.vuuAddRowRequest = vuuAddRowRequest;
|
|
75
94
|
exports.vuuDeleteRowRequest = vuuDeleteRowRequest;
|
|
95
|
+
exports.vuuEditCellRequest = vuuEditCellRequest;
|
|
76
96
|
//# sourceMappingURL=protocol-message-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-message-utils.js","sources":["../../../../../../packages/vuu-utils/src/protocol-message-utils.ts"],"sourcesContent":["import type {\n MenuRpcAction,\n MenuRpcResponse,\n OpenDialogActionWithSchema,\n RpcResponse,\n TableSchema,\n VuuUiMessageInRequestResponse,\n} from \"@vuu-ui/vuu-data-types\";\nimport {\n VuuRpcMenuRequest,\n OpenDialogAction,\n VuuRpcEditCellRequest,\n VuuRpcRequest,\n VuuRpcEditAddRowRequest,\n VuuDataRowDto,\n VuuRpcEditDeleteRowRequest,\n VuuRpcResponse,\n VuuRpcMenuSuccess,\n VuuTable,\n VuuViewportRpcTypeaheadRequest,\n VuuRpcServiceRequest,\n ViewportRpcContext,\n OpenComponentInDialogAction,\n VuuLoginResponse,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { isView as componentInRegistry } from \"./component-registry\";\n\nconst MENU_RPC_TYPES = [\n \"VIEW_PORT_MENUS_SELECT_RPC\",\n \"VIEW_PORT_MENU_TABLE_RPC\",\n \"VIEW_PORT_MENU_ROW_RPC\",\n \"VIEW_PORT_MENU_CELL_RPC\",\n \"VP_EDIT_CELL_RPC\",\n \"VP_EDIT_ROW_RPC\",\n \"VP_EDIT_ADD_ROW_RPC\",\n \"VP_EDIT_DELETE_CELL_RPC\",\n \"VP_EDIT_DELETE_ROW_RPC\",\n \"VP_EDIT_SUBMIT_FORM_RPC\",\n];\n\nexport const isRpcServiceRequest = (message: {\n type: string;\n}): message is VuuRpcServiceRequest | Omit<VuuRpcServiceRequest, \"context\"> =>\n message.type === \"RPC_REQUEST\";\n\nexport const hasViewPortContext = (\n message: VuuRpcServiceRequest,\n): message is VuuRpcServiceRequest<ViewportRpcContext> =>\n message.context.type === \"VIEWPORT_CONTEXT\";\n\nexport const isVuuMenuRpcRequest = (\n message: VuuRpcRequest | Omit<VuuRpcRequest, \"vpId\">,\n): message is VuuRpcMenuRequest => MENU_RPC_TYPES.includes(message[\"type\"]);\n\nexport const isLoginResponse = (message: object): message is VuuLoginResponse =>\n \"type\" in message &&\n (message.type === \"LOGIN_SUCCESS\" || message.type === \"LOGIN_FAIL\");\n\nexport const isRequestResponse = (\n message: object,\n): message is VuuUiMessageInRequestResponse => \"requestId\" in message;\n\nexport const isOpenSessionTableDialogMessage = (\n rpcResponse: RpcResponse,\n): rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema> =>\n rpcResponse.type === \"VIEW_PORT_MENU_RESP\" &&\n isOpenDialogAction(rpcResponse.action) &&\n \"tableSchema\" in rpcResponse.action;\n\nexport const isOpenDialogAction = (\n action?: MenuRpcAction,\n): action is OpenDialogAction =>\n action !== undefined && action.type === \"OPEN_DIALOG_ACTION\";\n\nexport const isTypeaheadRequest = (\n request: Omit<VuuRpcRequest, \"vpId\">,\n): request is Omit<VuuViewportRpcTypeaheadRequest, \"vpId\"> => {\n return (\n isRpcServiceRequest(request) &&\n (request.rpcName === \"getUniqueFieldValues\" ||\n request.rpcName === \"getUniqueFieldValuesStartingWith\")\n );\n};\n\nexport function isEditCellRequest(\n request: VuuRpcRequest,\n): request is VuuRpcEditCellRequest;\nexport function isEditCellRequest(\n request: Omit<VuuRpcRequest, \"vpId\">,\n): request is Omit<VuuRpcEditCellRequest, \"vpId\">;\nexport function isEditCellRequest(\n request: VuuRpcRequest | Omit<VuuRpcRequest, \"vpId\">,\n): request is VuuRpcEditCellRequest | Omit<VuuRpcEditCellRequest, \"vpId\"> {\n return request.type === \"VP_EDIT_CELL_RPC\";\n}\n\nexport function vuuAddRowRequest(\n rowKey: string,\n data: VuuDataRowDto,\n vpId: string,\n): VuuRpcEditAddRowRequest;\nexport function vuuAddRowRequest(\n rowKey: string,\n data: VuuDataRowDto,\n): Omit<VuuRpcEditAddRowRequest, \"vpId\">;\nexport function vuuAddRowRequest(\n rowKey: string,\n data: VuuDataRowDto,\n vpId?: string,\n): VuuRpcEditAddRowRequest | Omit<VuuRpcEditAddRowRequest, \"vpId\"> {\n return {\n rowKey,\n data,\n type: \"VP_EDIT_ADD_ROW_RPC\",\n vpId,\n };\n}\n\nexport function vuuDeleteRowRequest(\n rowKey: string,\n vpId: string,\n): VuuRpcEditDeleteRowRequest;\nexport function vuuDeleteRowRequest(\n rowKey: string,\n): Omit<VuuRpcEditDeleteRowRequest, \"vpId\">;\nexport function vuuDeleteRowRequest(\n rowKey: string,\n vpId?: string,\n): VuuRpcEditDeleteRowRequest | Omit<VuuRpcEditDeleteRowRequest, \"vpId\"> {\n return {\n rowKey,\n type: \"VP_EDIT_DELETE_ROW_RPC\",\n vpId,\n };\n}\n\nexport const isSessionTable = (table?: unknown) => {\n if (\n table !== null &&\n typeof table === \"object\" &&\n \"table\" in table &&\n \"module\" in table\n ) {\n return (table as VuuTable).table.startsWith(\"session\");\n }\n return false;\n};\n\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess;\nexport function isActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<VuuRpcMenuSuccess, \"vpId\">;\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n) {\n return rpcResponse.type === \"VIEW_PORT_MENU_RESP\";\n}\n\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<\n VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n >,\n \"vpId\"\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n rpcResponse.action?.renderComponent === \"inline-form\"\n );\n}\n\nexport function isCustomComponentActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenComponentInDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n typeof rpcResponse.action.renderComponent === \"string\" &&\n componentInRegistry(rpcResponse.action.renderComponent)\n );\n}\n"],"names":["componentInRegistry"],"mappings":";;;;AA2BA,MAAM,cAAiB,GAAA;AAAA,EACrB,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA,yBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,qBAAA;AAAA,EACA,yBAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,CAAA;AAEO,MAAM,mBAAsB,GAAA,CAAC,OAGlC,KAAA,OAAA,CAAQ,IAAS,KAAA;AAEZ,MAAM,kBAAqB,GAAA,CAChC,OAEA,KAAA,OAAA,CAAQ,QAAQ,IAAS,KAAA;AAEpB,MAAM,sBAAsB,CACjC,OAAA,KACiC,eAAe,QAAS,CAAA,OAAA,CAAQ,MAAM,CAAC;AAE7D,MAAA,eAAA,GAAkB,CAAC,OAC9B,KAAA,MAAA,IAAU,YACT,OAAQ,CAAA,IAAA,KAAS,eAAmB,IAAA,OAAA,CAAQ,IAAS,KAAA,YAAA;AAE3C,MAAA,iBAAA,GAAoB,CAC/B,OAAA,KAC6C,WAAe,IAAA;AAEjD,MAAA,+BAAA,GAAkC,CAC7C,WAAA,KAEA,WAAY,CAAA,IAAA,KAAS,qBACrB,IAAA,kBAAA,CAAmB,WAAY,CAAA,MAAM,CACrC,IAAA,aAAA,IAAiB,WAAY,CAAA;AAExB,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W,CAC3B,IAAA,kBAAA,CAAmB,YAAY,MAAM,CAAA,IACrC,eAAe,WAAY,CAAA,MAAA,CAAO,KAAK,CACvC,IAAA,OAAO,YAAY,MAAO,CAAA,eAAA,KAAoB,YAC9CA,wBAAoB,CAAA,WAAA,CAAY,OAAO,eAAe,CAAA;AAE1D;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"protocol-message-utils.js","sources":["../../../../../../packages/vuu-utils/src/protocol-message-utils.ts"],"sourcesContent":["import type {\n MenuRpcAction,\n MenuRpcResponse,\n OpenDialogActionWithSchema,\n RpcResponse,\n TableSchema,\n VuuUiMessageInRequestResponse,\n} from \"@vuu-ui/vuu-data-types\";\nimport {\n VuuRpcMenuRequest,\n OpenDialogAction,\n VuuRpcEditCellRequest,\n VuuRpcRequest,\n VuuRpcEditAddRowRequest,\n VuuDataRowDto,\n VuuRpcEditDeleteRowRequest,\n VuuRpcResponse,\n VuuRpcMenuSuccess,\n VuuTable,\n VuuViewportRpcTypeaheadRequest,\n VuuRpcServiceRequest,\n ViewportRpcContext,\n OpenComponentInDialogAction,\n VuuLoginResponse,\n VuuRowDataItemType,\n SelectRequest,\n SelectResponse,\n SelectSuccessWithRowCount,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { isView as componentInRegistry } from \"./component-registry\";\n\nconst MENU_RPC_TYPES = [\n \"VIEW_PORT_MENUS_SELECT_RPC\",\n \"VIEW_PORT_MENU_TABLE_RPC\",\n \"VIEW_PORT_MENU_ROW_RPC\",\n \"VIEW_PORT_MENU_CELL_RPC\",\n \"VP_EDIT_CELL_RPC\",\n \"VP_EDIT_ROW_RPC\",\n \"VP_EDIT_ADD_ROW_RPC\",\n \"VP_EDIT_DELETE_CELL_RPC\",\n \"VP_EDIT_DELETE_ROW_RPC\",\n \"VP_EDIT_SUBMIT_FORM_RPC\",\n];\n\nexport const isSelectRequest = (message: object): message is SelectRequest =>\n \"type\" in message &&\n (message.type === \"SELECT_ROW\" ||\n message.type === \"DESELECT_ROW\" ||\n message.type === \"SELECT_ROW_RANGE\" ||\n message.type === \"SELECT_ALL\" ||\n message.type === \"DESELECT_ALL\");\n\nexport const isSelectSuccessWithRowCount = (\n response: SelectResponse | SelectSuccessWithRowCount,\n): response is SelectSuccessWithRowCount =>\n [\n \"SELECT_ROW_SUCCESS\",\n \"DESELECT_ROW_SUCCESS\",\n \"SELECT_ROW_RANGE_SUCCESS\",\n \"SELECT_ALL_SUCCESS\",\n \"DESELECT_ALL_SUCCESS\",\n ].includes(response.type ?? \"\") &&\n typeof (response as SelectSuccessWithRowCount).selectedRowCount === \"number\";\n\nexport const isRpcServiceRequest = (message: {\n type: string;\n}): message is VuuRpcServiceRequest | Omit<VuuRpcServiceRequest, \"context\"> =>\n message.type === \"RPC_REQUEST\";\n\nexport const hasViewPortContext = (\n message: VuuRpcServiceRequest,\n): message is VuuRpcServiceRequest<ViewportRpcContext> =>\n message.context.type === \"VIEWPORT_CONTEXT\";\n\nexport const isVuuMenuRpcRequest = (\n message: VuuRpcRequest | Omit<VuuRpcRequest, \"vpId\">,\n): message is VuuRpcMenuRequest => MENU_RPC_TYPES.includes(message[\"type\"]);\n\nexport const isLoginResponse = (message: object): message is VuuLoginResponse =>\n \"type\" in message &&\n (message.type === \"LOGIN_SUCCESS\" || message.type === \"LOGIN_FAIL\");\n\nexport const isRequestResponse = (\n message: object,\n): message is VuuUiMessageInRequestResponse => \"requestId\" in message;\n\nexport const isOpenSessionTableDialogMessage = (\n rpcResponse: RpcResponse,\n): rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema> =>\n rpcResponse.type === \"VIEW_PORT_MENU_RESP\" &&\n isOpenDialogAction(rpcResponse.action) &&\n \"tableSchema\" in rpcResponse.action;\n\nexport const isOpenDialogAction = (\n action?: MenuRpcAction,\n): action is OpenDialogAction =>\n action !== undefined && action.type === \"OPEN_DIALOG_ACTION\";\n\nexport const isTypeaheadRequest = (\n request: Omit<VuuRpcRequest, \"vpId\">,\n): request is Omit<VuuViewportRpcTypeaheadRequest, \"vpId\"> => {\n return (\n isRpcServiceRequest(request) &&\n (request.rpcName === \"getUniqueFieldValues\" ||\n request.rpcName === \"getUniqueFieldValuesStartingWith\")\n );\n};\n\nexport function isEditCellRequest(\n request: VuuRpcRequest,\n): request is VuuRpcEditCellRequest;\nexport function isEditCellRequest(\n request: Omit<VuuRpcRequest, \"vpId\">,\n): request is Omit<VuuRpcEditCellRequest, \"vpId\">;\nexport function isEditCellRequest(\n request: VuuRpcRequest | Omit<VuuRpcRequest, \"vpId\">,\n): request is VuuRpcEditCellRequest | Omit<VuuRpcEditCellRequest, \"vpId\"> {\n return request.type === \"VP_EDIT_CELL_RPC\";\n}\n\nexport function vuuEditCellRequest(\n rowKey: string,\n field: string,\n value: VuuRowDataItemType,\n vpId: string,\n): VuuRpcEditCellRequest;\nexport function vuuEditCellRequest(\n rowKey: string,\n field: string,\n value: VuuRowDataItemType,\n): Omit<VuuRpcEditCellRequest, \"vpId\">;\nexport function vuuEditCellRequest(\n rowKey: string,\n field: string,\n value: VuuRowDataItemType,\n vpId?: string,\n): VuuRpcEditCellRequest | Omit<VuuRpcEditCellRequest, \"vpId\"> {\n return {\n rowKey,\n field,\n value,\n type: \"VP_EDIT_CELL_RPC\",\n vpId,\n };\n}\nexport function vuuAddRowRequest(\n rowKey: string,\n data: VuuDataRowDto,\n vpId: string,\n): VuuRpcEditAddRowRequest;\nexport function vuuAddRowRequest(\n rowKey: string,\n data: VuuDataRowDto,\n): Omit<VuuRpcEditAddRowRequest, \"vpId\">;\nexport function vuuAddRowRequest(\n rowKey: string,\n data: VuuDataRowDto,\n vpId?: string,\n): VuuRpcEditAddRowRequest | Omit<VuuRpcEditAddRowRequest, \"vpId\"> {\n return {\n rowKey,\n data,\n type: \"VP_EDIT_ADD_ROW_RPC\",\n vpId,\n };\n}\n\nexport function vuuDeleteRowRequest(\n rowKey: string,\n vpId: string,\n): VuuRpcEditDeleteRowRequest;\nexport function vuuDeleteRowRequest(\n rowKey: string,\n): Omit<VuuRpcEditDeleteRowRequest, \"vpId\">;\nexport function vuuDeleteRowRequest(\n rowKey: string,\n vpId?: string,\n): VuuRpcEditDeleteRowRequest | Omit<VuuRpcEditDeleteRowRequest, \"vpId\"> {\n return {\n rowKey,\n type: \"VP_EDIT_DELETE_ROW_RPC\",\n vpId,\n };\n}\n\nexport const isSessionTable = (table?: unknown) => {\n if (\n table !== null &&\n typeof table === \"object\" &&\n \"table\" in table &&\n \"module\" in table\n ) {\n return (table as VuuTable).table.startsWith(\"session\");\n }\n return false;\n};\n\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess;\nexport function isActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<VuuRpcMenuSuccess, \"vpId\">;\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n) {\n return rpcResponse.type === \"VIEW_PORT_MENU_RESP\";\n}\n\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<\n VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n >,\n \"vpId\"\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n rpcResponse.action?.renderComponent === \"inline-form\"\n );\n}\n\nexport function isCustomComponentActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenComponentInDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n typeof rpcResponse.action.renderComponent === \"string\" &&\n componentInRegistry(rpcResponse.action.renderComponent)\n );\n}\n"],"names":["componentInRegistry"],"mappings":";;;;AA+BA,MAAM,cAAiB,GAAA;AAAA,EACrB,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA,yBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,qBAAA;AAAA,EACA,yBAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,CAAA;AAEO,MAAM,kBAAkB,CAAC,OAAA,KAC9B,UAAU,OACT,KAAA,OAAA,CAAQ,SAAS,YAChB,IAAA,OAAA,CAAQ,IAAS,KAAA,cAAA,IACjB,QAAQ,IAAS,KAAA,kBAAA,IACjB,QAAQ,IAAS,KAAA,YAAA,IACjB,QAAQ,IAAS,KAAA,cAAA;AAER,MAAA,2BAAA,GAA8B,CACzC,QAEA,KAAA;AAAA,EACE,oBAAA;AAAA,EACA,sBAAA;AAAA,EACA,0BAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA,CAAE,SAAS,QAAS,CAAA,IAAA,IAAQ,EAAE,CAC9B,IAAA,OAAQ,SAAuC,gBAAqB,KAAA;AAE/D,MAAM,mBAAsB,GAAA,CAAC,OAGlC,KAAA,OAAA,CAAQ,IAAS,KAAA;AAEZ,MAAM,kBAAqB,GAAA,CAChC,OAEA,KAAA,OAAA,CAAQ,QAAQ,IAAS,KAAA;AAEpB,MAAM,sBAAsB,CACjC,OAAA,KACiC,eAAe,QAAS,CAAA,OAAA,CAAQ,MAAM,CAAC;AAE7D,MAAA,eAAA,GAAkB,CAAC,OAC9B,KAAA,MAAA,IAAU,YACT,OAAQ,CAAA,IAAA,KAAS,eAAmB,IAAA,OAAA,CAAQ,I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B,KAAM,CAAA,UAAA,CAAW,SAAS,CAAA;AAAA;AAEvD,EAAO,OAAA,KAAA;AACT;AAQO,SAAS,gBACd,WACA,EAAA;AACA,EAAA,OAAO,YAAY,IAAS,KAAA,qBAAA;AAC9B;AAmBO,SAAS,4BACd,WAKA,EAAA;AACA,EAAA,OACE,eAAgB,CAAA,WAAW,CAC3B,IAAA,kBAAA,CAAmB,YAAY,MAAM,CAAA,IACrC,cAAe,CAAA,WAAA,CAAY,MAAO,CAAA,KAAK,CACvC,IAAA,WAAA,CAAY,QAAQ,eAAoB,KAAA,aAAA;AAE5C;AAEO,SAAS,+BACd,WAKA,EAAA;AACA,EACE,OAAA,eAAA,CAAgB,WAAW,CAC3B,IAAA,kBAAA,CAAmB,YAAY,MAAM,CAAA,IACrC,eAAe,WAAY,CAAA,MAAA,CAAO,KAAK,CACvC,IAAA,OAAO,YAAY,MAAO,CAAA,eAAA,KAAoB,YAC9CA,wBAAoB,CAAA,WAAA,CAAY,OAAO,eAAe,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var columnUtils = require('./column-utils.js');
|
|
4
|
-
var selectionUtils = require('./selection-utils.js');
|
|
5
4
|
|
|
6
|
-
const { IS_LEAF, KEY, IDX } = columnUtils.metadataKeys;
|
|
5
|
+
const { IS_LEAF, KEY, IDX, SELECTED } = columnUtils.metadataKeys;
|
|
7
6
|
const actualRowPositioning = (rowHeight) => [
|
|
8
7
|
(row) => row[IDX] * rowHeight,
|
|
9
8
|
(position) => Math.floor(position / rowHeight),
|
|
@@ -29,7 +28,7 @@ const asDataSourceRowObject = (row, columnMap) => {
|
|
|
29
28
|
key,
|
|
30
29
|
index,
|
|
31
30
|
isGroupRow: !isLeaf,
|
|
32
|
-
isSelected:
|
|
31
|
+
isSelected: row[SELECTED] !== 0,
|
|
33
32
|
data: {}
|
|
34
33
|
};
|
|
35
34
|
for (const [colName, colIdx] of Object.entries(columnMap)) {
|
|
@@ -37,8 +36,7 @@ const asDataSourceRowObject = (row, columnMap) => {
|
|
|
37
36
|
}
|
|
38
37
|
return rowObject;
|
|
39
38
|
};
|
|
40
|
-
const
|
|
41
|
-
const vuuRowToDataSourceRow = ({ rowIndex, rowKey, sel: isSelected, ts, data }, keys, selectedRows = NO_SELECTION) => {
|
|
39
|
+
const vuuRowToDataSourceRow = ({ rowIndex, rowKey, sel: isSelected = 0, ts, data }, keys) => {
|
|
42
40
|
return [
|
|
43
41
|
rowIndex,
|
|
44
42
|
keys.keyFor(rowIndex),
|
|
@@ -47,7 +45,7 @@ const vuuRowToDataSourceRow = ({ rowIndex, rowKey, sel: isSelected, ts, data },
|
|
|
47
45
|
0,
|
|
48
46
|
0,
|
|
49
47
|
rowKey,
|
|
50
|
-
isSelected
|
|
48
|
+
isSelected,
|
|
51
49
|
ts,
|
|
52
50
|
false
|
|
53
51
|
// IsNew
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-utils.js","sources":["../../../../../../packages/vuu-utils/src/row-utils.ts"],"sourcesContent":["//TODO this all probably belongs in vuu-table\nimport type {\n DataSourceRow,\n DataSourceRowObject,\n
|
|
1
|
+
{"version":3,"file":"row-utils.js","sources":["../../../../../../packages/vuu-utils/src/row-utils.ts"],"sourcesContent":["//TODO this all probably belongs in vuu-table\nimport type {\n DataSourceRow,\n DataSourceRowObject,\n} from \"@vuu-ui/vuu-data-types\";\nimport { ColumnMap, metadataKeys } from \"./column-utils\";\nimport { IKeySet } from \"./keyset\";\nimport { VuuRow } from \"@vuu-ui/vuu-protocol-types\";\nimport { RefObject } from \"react\";\n\nconst { IS_LEAF, KEY, IDX, SELECTED } = metadataKeys;\n\nexport type RowOffsetFunc = (\n row: DataSourceRow,\n pctScrollTop?: number,\n) => number;\nexport type RowAtPositionFunc = (position: number) => number;\n\n/**\n * RowOffset function, RowAtPosition function, isVirtualScroll\n */\nexport type RowPositioning = [RowOffsetFunc, RowAtPositionFunc, boolean];\n\nexport const actualRowPositioning = (rowHeight: number): RowPositioning => [\n (row) => row[IDX] * rowHeight,\n (position) => Math.floor(position / rowHeight),\n false,\n];\n\n/**\n * return functions for determining a) the pixel offset to apply to a row, given the\n * row index and b) the index of the row at a given scroll offset. This implementation\n * is used when we are forced to 'virtualise' scrolling - because the number of rows\n * is high enough that we cannot create a large enough HTML content container.\n *\n * @param rowHeight\n * @param virtualisedExtent\n * @param pctScrollTop\n * @returns\n */\nexport const virtualRowPositioning = (\n rowHeight: number,\n virtualisedExtent: number,\n pctScrollTop: RefObject<number>,\n): RowPositioning => [\n (row, offset = 0) => {\n const rowOffset = pctScrollTop.current * virtualisedExtent;\n return (row[IDX] - offset) * rowHeight - rowOffset;\n },\n /*\n Return index position of closest row \n */\n (position) => {\n const rowOffset = pctScrollTop.current * virtualisedExtent;\n return Math.round((position + rowOffset) / rowHeight);\n },\n true,\n];\n\nexport type RowToObjectMapper = (\n row: DataSourceRow,\n columnMap: ColumnMap,\n) => DataSourceRowObject;\n\nexport const asDataSourceRowObject: RowToObjectMapper = (\n row,\n columnMap,\n): DataSourceRowObject => {\n const { [IS_LEAF]: isLeaf, [KEY]: key, [IDX]: index } = row;\n\n const rowObject: DataSourceRowObject = {\n key,\n index,\n isGroupRow: !isLeaf,\n isSelected: row[SELECTED] !== 0,\n data: {},\n };\n\n for (const [colName, colIdx] of Object.entries(columnMap)) {\n rowObject.data[colName] = row[colIdx];\n }\n\n return rowObject;\n};\n\nexport const vuuRowToDataSourceRow = (\n { rowIndex, rowKey, sel: isSelected = 0, ts, data }: VuuRow,\n keys: IKeySet,\n) => {\n return [\n rowIndex,\n keys.keyFor(rowIndex),\n true,\n false,\n 0,\n 0,\n rowKey,\n isSelected,\n ts,\n false, // IsNew\n ].concat(data) as DataSourceRow;\n};\n"],"names":["metadataKeys"],"mappings":";;;;AAUA,MAAM,EAAE,OAAA,EAAS,GAAK,EAAA,GAAA,EAAK,UAAa,GAAAA,wB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CAAA;AAAA;AAGtC,EAAO,OAAA,SAAA;AACT;AAEa,MAAA,qBAAA,GAAwB,CACnC,EAAE,QAAU,EAAA,MAAA,EAAQ,GAAK,EAAA,UAAA,GAAa,CAAG,EAAA,EAAA,EAAI,IAAK,EAAA,EAClD,IACG,KAAA;AACH,EAAO,OAAA;AAAA,IACL,QAAA;AAAA,IACA,IAAA,CAAK,OAAO,QAAQ,CAAA;AAAA,IACpB,IAAA;AAAA,IACA,KAAA;AAAA,IACA,CAAA;AAAA,IACA,CAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,EAAA;AAAA,IACA;AAAA;AAAA,GACF,CAAE,OAAO,IAAI,CAAA;AACf;;;;;;;"}
|
|
@@ -1,246 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Last: 4
|
|
12
|
-
};
|
|
13
|
-
const isRowSelected = (row) => (row[SELECTED] & RowSelected.True) === RowSelected.True;
|
|
14
|
-
const isRowSelectedLast = (row) => row !== void 0 && (row[SELECTED] & RowSelected.Last) === RowSelected.Last;
|
|
15
|
-
const inAscendingOrder = (item1, item2) => {
|
|
16
|
-
const n1 = typeof item1 === "number" ? item1 : item1[0];
|
|
17
|
-
const n2 = typeof item2 === "number" ? item2 : item2[0];
|
|
18
|
-
return n1 - n2;
|
|
19
|
-
};
|
|
20
|
-
const deselectItem = (selectionModel, selected, itemIndex, rangeSelect, keepExistingSelection = false) => {
|
|
3
|
+
const deselectItem = (selectionModel, rowKey, rangeSelect, preserveExistingSelection = false) => {
|
|
4
|
+
return {
|
|
5
|
+
preserveExistingSelection,
|
|
6
|
+
rowKey,
|
|
7
|
+
type: "DESELECT_ROW"
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const selectItem = (selectionModel, rowKey, rangeSelect, preserveExistingSelection = false, activeRowKey) => {
|
|
21
11
|
const singleSelect = selectionModel === "single";
|
|
22
|
-
const
|
|
23
|
-
const actsLikeSingleSelect = singleSelect || multiSelect && !keepExistingSelection && !rangeSelect;
|
|
24
|
-
if (actsLikeSingleSelect || !rangeSelect && !keepExistingSelection) {
|
|
25
|
-
return NO_SELECTION;
|
|
26
|
-
} else if (!rangeSelect && keepExistingSelection) {
|
|
27
|
-
return removeSelectedItem(selected, itemIndex);
|
|
28
|
-
}
|
|
29
|
-
return NO_SELECTION;
|
|
30
|
-
};
|
|
31
|
-
const newSelectedFillsGapOrExtends = (selection, itemIndex) => {
|
|
32
|
-
for (let i = 0; i < selection.length; i++) {
|
|
33
|
-
const item = selection[i];
|
|
34
|
-
if (typeof item === "number") {
|
|
35
|
-
if (item === itemIndex - 1) {
|
|
36
|
-
return true;
|
|
37
|
-
} else if (item > itemIndex) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
} else if (item[0] === itemIndex + 1 || item[1] === itemIndex - 1) {
|
|
41
|
-
return true;
|
|
42
|
-
} else if (item[0] > itemIndex) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
};
|
|
48
|
-
const fillGapOrExtendSelection = (selection, itemIndex) => {
|
|
49
|
-
for (let i = 0; i < selection.length; i++) {
|
|
50
|
-
const item = selection[i];
|
|
51
|
-
if (typeof item === "number") {
|
|
52
|
-
if (item === itemIndex - 1) {
|
|
53
|
-
const nextSelectionItem = selection[i + 1];
|
|
54
|
-
if (nextSelectionItem === itemIndex + 1) {
|
|
55
|
-
const newRange = [item, nextSelectionItem];
|
|
56
|
-
return selection.slice(0, i).concat([newRange]).concat(selection.slice(i + 2));
|
|
57
|
-
} else {
|
|
58
|
-
const newRange = [item, itemIndex];
|
|
59
|
-
return selection.slice(0, i).concat([newRange]).concat(selection.slice(i + 1));
|
|
60
|
-
}
|
|
61
|
-
} else if (item > itemIndex) {
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
} else if (item[0] === itemIndex + 1) {
|
|
65
|
-
const newRange = [itemIndex, item[1]];
|
|
66
|
-
return selection.slice(0, i).concat([newRange]).concat(selection.slice(i + 1));
|
|
67
|
-
} else if (item[1] === itemIndex - 1) {
|
|
68
|
-
const nextItem = selection[i + 1];
|
|
69
|
-
if (Array.isArray(nextItem) && nextItem[0] === itemIndex + 1) {
|
|
70
|
-
const newRange = [item[0], nextItem[1]];
|
|
71
|
-
return selection.slice(0, i).concat([newRange]).concat(selection.slice(i + 2));
|
|
72
|
-
} else if (typeof nextItem === "number" && nextItem === itemIndex + 1) {
|
|
73
|
-
const newRange = [item[0], nextItem];
|
|
74
|
-
return selection.slice(0, i).concat([newRange]).concat(selection.slice(i + 2));
|
|
75
|
-
} else {
|
|
76
|
-
const newRange = [item[0], itemIndex];
|
|
77
|
-
return selection.slice(0, i).concat([newRange]).concat(selection.slice(i + 1));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return selection;
|
|
82
|
-
};
|
|
83
|
-
const selectItem = (selectionModel, selected, itemIndex, rangeSelect, keepExistingSelection = false, activeItemIndex = -1) => {
|
|
84
|
-
const singleSelect = selectionModel === "single";
|
|
85
|
-
const multiSelect = selectionModel === "extended" || selectionModel === "checkbox";
|
|
86
|
-
const actsLikeSingleSelect = singleSelect || multiSelect && !keepExistingSelection && !rangeSelect || rangeSelect && activeItemIndex === -1;
|
|
12
|
+
const actsLikeSingleSelect = singleSelect || activeRowKey === void 0;
|
|
87
13
|
if (selectionModel === "none") {
|
|
88
|
-
return
|
|
14
|
+
return;
|
|
89
15
|
} else if (actsLikeSingleSelect) {
|
|
90
|
-
return
|
|
16
|
+
return {
|
|
17
|
+
preserveExistingSelection,
|
|
18
|
+
rowKey,
|
|
19
|
+
type: "SELECT_ROW"
|
|
20
|
+
};
|
|
91
21
|
} else if (rangeSelect) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
} else if (!rangeSelect) {
|
|
99
|
-
if (newSelectedFillsGapOrExtends(selected, itemIndex)) {
|
|
100
|
-
return fillGapOrExtendSelection(selected, itemIndex);
|
|
101
|
-
} else {
|
|
102
|
-
return selected?.concat(itemIndex).sort(inAscendingOrder);
|
|
103
|
-
}
|
|
104
|
-
} else ;
|
|
105
|
-
return NO_SELECTION;
|
|
106
|
-
};
|
|
107
|
-
function removeSelectedItem(selected, itemIndex) {
|
|
108
|
-
if (selected.includes(itemIndex)) {
|
|
109
|
-
return selected.filter((selectedItem) => selectedItem !== itemIndex);
|
|
110
|
-
} else {
|
|
111
|
-
const newSelected = [];
|
|
112
|
-
for (const selectedItem of selected) {
|
|
113
|
-
if (Array.isArray(selectedItem)) {
|
|
114
|
-
if (rangeIncludes(selectedItem, itemIndex)) {
|
|
115
|
-
newSelected.push(...splitRange(selectedItem, itemIndex));
|
|
116
|
-
} else {
|
|
117
|
-
newSelected.push(selectedItem);
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
newSelected.push(selectedItem);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return newSelected;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function insertRange(selected, range) {
|
|
127
|
-
const [from, to] = range;
|
|
128
|
-
return selected.reduce((newSelected, selectedItem) => {
|
|
129
|
-
if (typeof selectedItem === "number") {
|
|
130
|
-
if (selectedItem < from || selectedItem > to) {
|
|
131
|
-
newSelected.push(selectedItem);
|
|
132
|
-
} else if (!includedInRange(newSelected.at(-1), selectedItem)) {
|
|
133
|
-
newSelected.push(range);
|
|
134
|
-
}
|
|
135
|
-
} else if (overlappingRange(selectedItem, range)) {
|
|
136
|
-
newSelected.push(mergeRanges(selectedItem, range));
|
|
137
|
-
} else {
|
|
138
|
-
if (range[1] < selectedItem[0]) {
|
|
139
|
-
newSelected.push(range);
|
|
140
|
-
}
|
|
141
|
-
newSelected.push(selectedItem);
|
|
142
|
-
}
|
|
143
|
-
return newSelected;
|
|
144
|
-
}, []);
|
|
145
|
-
}
|
|
146
|
-
const overlappingRange = (r1, r2) => r1[1] >= r2[0] && r1[1] <= r2[1] || r1[0] >= r2[0] && r1[0] <= r2[1];
|
|
147
|
-
const mergeRanges = (r1, r2) => [
|
|
148
|
-
Math.min(r1[0], r2[0]),
|
|
149
|
-
Math.max(r1[1], r2[1])
|
|
150
|
-
];
|
|
151
|
-
const includedInRange = (selectedItem, index) => {
|
|
152
|
-
if (typeof selectedItem === "undefined" || typeof selectedItem === "number") {
|
|
153
|
-
return false;
|
|
154
|
-
} else return rangeIncludes(selectedItem, index);
|
|
155
|
-
};
|
|
156
|
-
const rangeIncludes = (range, index) => index >= range[0] && index <= range[1];
|
|
157
|
-
const SINGLE_SELECTED_ROW = RowSelected.True + RowSelected.First + RowSelected.Last;
|
|
158
|
-
const FIRST_SELECTED_ROW_OF_BLOCK = RowSelected.True + RowSelected.First;
|
|
159
|
-
const LAST_SELECTED_ROW_OF_BLOCK = RowSelected.True + RowSelected.Last;
|
|
160
|
-
const getSelectionStatus = (selected, itemIndex) => {
|
|
161
|
-
for (const item of selected) {
|
|
162
|
-
if (typeof item === "number") {
|
|
163
|
-
if (item === itemIndex) {
|
|
164
|
-
return SINGLE_SELECTED_ROW;
|
|
165
|
-
}
|
|
166
|
-
} else if (rangeIncludes(item, itemIndex)) {
|
|
167
|
-
if (itemIndex === item[0]) {
|
|
168
|
-
return FIRST_SELECTED_ROW_OF_BLOCK;
|
|
169
|
-
} else if (itemIndex === item[1]) {
|
|
170
|
-
return LAST_SELECTED_ROW_OF_BLOCK;
|
|
171
|
-
} else {
|
|
172
|
-
return RowSelected.True;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return RowSelected.False;
|
|
177
|
-
};
|
|
178
|
-
const isSelected = (selected, itemIndex) => {
|
|
179
|
-
for (const item of selected) {
|
|
180
|
-
if (typeof item === "number") {
|
|
181
|
-
if (item === itemIndex) {
|
|
182
|
-
return true;
|
|
183
|
-
} else if (item > itemIndex) {
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
} else if (rangeIncludes(item, itemIndex)) {
|
|
187
|
-
return true;
|
|
188
|
-
} else if (item[0] > itemIndex) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return false;
|
|
193
|
-
};
|
|
194
|
-
const expandSelection = (selected) => {
|
|
195
|
-
if (selected.every((selectedItem) => typeof selectedItem === "number")) {
|
|
196
|
-
return selected;
|
|
197
|
-
}
|
|
198
|
-
const expandedSelected = [];
|
|
199
|
-
for (const selectedItem of selected) {
|
|
200
|
-
if (typeof selectedItem === "number") {
|
|
201
|
-
expandedSelected.push(selectedItem);
|
|
202
|
-
} else {
|
|
203
|
-
for (let i = selectedItem[0]; i <= selectedItem[1]; i++) {
|
|
204
|
-
expandedSelected.push(i);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return expandedSelected;
|
|
209
|
-
};
|
|
210
|
-
function splitRange([from, to], itemIndex) {
|
|
211
|
-
if (itemIndex === from) {
|
|
212
|
-
return [[from + 1, to]];
|
|
213
|
-
} else if (itemIndex === to) {
|
|
214
|
-
return [[from, to - 1]];
|
|
215
|
-
} else if (to - from === 2) {
|
|
216
|
-
return [from, to];
|
|
217
|
-
} else if (itemIndex === to - 1) {
|
|
218
|
-
return [[from, to - 2], to];
|
|
219
|
-
} else {
|
|
220
|
-
return [
|
|
221
|
-
[from, itemIndex - 1],
|
|
222
|
-
[itemIndex + 1, to]
|
|
223
|
-
];
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
const selectionCount = (selected = NO_SELECTION) => {
|
|
227
|
-
let count = selected.length;
|
|
228
|
-
for (const selectionItem of selected) {
|
|
229
|
-
if (Array.isArray(selectionItem)) {
|
|
230
|
-
const [from, to] = selectionItem;
|
|
231
|
-
count += to - from;
|
|
232
|
-
}
|
|
22
|
+
return {
|
|
23
|
+
preserveExistingSelection,
|
|
24
|
+
fromRowKey: rowKey,
|
|
25
|
+
toRowKey: activeRowKey,
|
|
26
|
+
type: "SELECT_ROW_RANGE"
|
|
27
|
+
};
|
|
233
28
|
}
|
|
234
|
-
return count;
|
|
235
29
|
};
|
|
236
30
|
|
|
237
|
-
exports.RowSelected = RowSelected;
|
|
238
31
|
exports.deselectItem = deselectItem;
|
|
239
|
-
exports.expandSelection = expandSelection;
|
|
240
|
-
exports.getSelectionStatus = getSelectionStatus;
|
|
241
|
-
exports.isRowSelected = isRowSelected;
|
|
242
|
-
exports.isRowSelectedLast = isRowSelectedLast;
|
|
243
|
-
exports.isSelected = isSelected;
|
|
244
32
|
exports.selectItem = selectItem;
|
|
245
|
-
exports.selectionCount = selectionCount;
|
|
246
33
|
//# sourceMappingURL=selection-utils.js.map
|