@progress/kendo-vue-data-tools 9.1.0-develop.1 → 9.1.0
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/NOTICE.txt +18 -40
- package/dist/cdn/js/kendo-vue-datatools.js +1 -1
- package/group-expansion/groupExpandReducer.js +1 -1
- package/group-expansion/groupExpandReducer.mjs +17 -17
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +2 -2
- package/navigation/utils.js +1 -1
- package/navigation/utils.mjs +47 -47
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- package/utils/data-operations.js +1 -1
- package/utils/data-operations.mjs +29 -26
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var U=(e=>(e.TOGGLE="GROUP-EXPAND_TOGGLE",e.EXPAND="GROUP-EXPAND_EXPAND",e.COLLAPSE="GROUP-EXPAND_COLLAPSE",e.RESET="GROUP-EXPAND_RESET",e))(U||{});const w=e=>{var r;return{enabled:typeof e=="boolean"?e:(r=e==null?void 0:e.enabled)!=null?r:!0,defaultExpand:typeof e=="object"?e==null?void 0:e.defaultExpand:!0}},i=(e=[],r=null)=>{const u=[];return e==null||e.forEach(d=>{var a;const l={value:d.value,field:d.field,parents:r?[r,...(a=r.parents)!=null?a:[]]:[]};d.expanded!==void 0&&(l.expanded=d.expanded),d.groups&&u.push(...i(d.groups,l)),u.push(l)}),u},x=e=>{var r,u,d,l;return`${(r=e.parents)!=null&&r.length?((l=(d=(u=e.parents)==null?void 0:u.slice())==null?void 0:d.reverse())==null?void 0:l.map(a=>x({field:a.field,value:a.value})).join("/"))+"/":""}${e.field}:${e.value}`},j=(e,r)=>{const u=i(e);return g(u,r)},F=(e,r)=>{var l;const u=i(e),d=g(u,r);return d?(l=d.expanded)!=null?l:!0:!1},v=e=>{var l;const r=new Map;r.set("root",{value:null,field:"",groups:new Set}),(a=>{a.forEach(s=>{var o,P,h,G,O;const c=x(s),n=(o=r.get(c))!=null?o:{value:s.value,field:s.field};s.expanded!==void 0&&(n.expanded=s.expanded),r.has(c)||r.set(c,n);let f=n;(P=s.parents)!=null&&P.length?(h=s.parents)==null||h.forEach((p,R)=>{var A,L,S,T,D,X,N;const E=x({value:p.value,field:p.field,parents:(L=s.parents)==null?void 0:L.slice(R+1,(A=s==null?void 0:s.parents)==null?void 0:A.length)}),t=(S=r.get(E))!=null?S:{value:p.value,field:p.field};p.expanded&&(t.expanded=p.expanded),r.has(E)||r.set(E,t),t.groups||(t.groups=new Set),t.groups.add(f),f=t,R===((D=(T=s.parents)==null?void 0:T.length)!=null?D:-1)-1&&((N=(X=r.get("root"))==null?void 0:X.groups)==null||N.add(t))}):(O=(G=r.get("root"))==null?void 0:G.groups)==null||O.add(f)})})(e);const d=a=>{a.groups&&(a.groups=Array.from(a.groups),a.groups.forEach(d))};return d(r.get("root")),((l=r.get("root"))==null?void 0:l.groups)||[]},_=(e,r)=>{var u;return!!((u=r.parents)!=null&&u.every((d,l)=>{var a;return(a=e.parents)==null?void 0:a.find(s=>d.value===s.value&&d.field===s.field)}))},g=(e,r)=>e.find(d=>d.value===r.value&&d.field===r.field&&_(d,r)),$=(e,r,u)=>{var a,s,c;const d=i(e!=null?e:[]),l=g(d,r.group);switch(r.type){case"GROUP-EXPAND_TOGGLE":return v(l?d==null?void 0:d.map(n=>{var f,o;return n===l?{...n,expanded:!((o=(f=n.expanded)!=null?f:u==null?void 0:u.defaultExpand)==null||o)}:n}):[...d,{...r.group,expanded:!((a=u==null?void 0:u.defaultExpand)==null||a)}]);case"GROUP-EXPAND_EXPAND":{let n;return l?n=d==null?void 0:d.map(f=>f===l?{...f,expanded:!0}:f):(s=u==null?void 0:u.defaultExpand)==null||s?n=d:n=[...d,{...r.group,expanded:!0}],v(n)}case"GROUP-EXPAND_COLLAPSE":{let n;return l?n=d==null?void 0:d.map(f=>f===l?{...f,expanded:!1}:f):(c=u==null?void 0:u.defaultExpand)==null||c?n=[...d,{...r.group,expanded:!1}]:n=d,v(n)}default:return e}};exports.GROUP_EXPAND_ACTION=U;exports.findGroupExpand=j;exports.flatToTree=v;exports.getGroupExpandableOptions=w;exports.groupExpandReducer=$;exports.isExpanded=F;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
var
|
|
9
|
-
const
|
|
8
|
+
var N = /* @__PURE__ */ ((e) => (e.TOGGLE = "GROUP-EXPAND_TOGGLE", e.EXPAND = "GROUP-EXPAND_EXPAND", e.COLLAPSE = "GROUP-EXPAND_COLLAPSE", e.RESET = "GROUP-EXPAND_RESET", e))(N || {});
|
|
9
|
+
const F = (e) => {
|
|
10
10
|
var r;
|
|
11
11
|
return {
|
|
12
12
|
enabled: typeof e == "boolean" ? e : (r = e == null ? void 0 : e.enabled) != null ? r : !0,
|
|
@@ -26,10 +26,10 @@ const U = (e) => {
|
|
|
26
26
|
}, h = (e) => {
|
|
27
27
|
var r, u, d, l;
|
|
28
28
|
return `${(r = e.parents) != null && r.length ? ((l = (d = (u = e.parents) == null ? void 0 : u.slice()) == null ? void 0 : d.reverse()) == null ? void 0 : l.map((s) => h({ field: s.field, value: s.value })).join("/")) + "/" : ""}${e.field}:${e.value}`;
|
|
29
|
-
},
|
|
29
|
+
}, $ = (e, r) => {
|
|
30
30
|
const u = E(e);
|
|
31
31
|
return x(u, r);
|
|
32
|
-
},
|
|
32
|
+
}, j = (e, r) => {
|
|
33
33
|
var l;
|
|
34
34
|
const u = E(e), d = x(u, r);
|
|
35
35
|
return d ? (l = d.expanded) != null ? l : !0 : !1;
|
|
@@ -38,38 +38,38 @@ const U = (e) => {
|
|
|
38
38
|
const r = /* @__PURE__ */ new Map();
|
|
39
39
|
r.set("root", { value: null, field: "", groups: /* @__PURE__ */ new Set() }), ((s) => {
|
|
40
40
|
s.forEach((f) => {
|
|
41
|
-
var p, P, g, G;
|
|
41
|
+
var p, P, g, G, L;
|
|
42
42
|
const c = h(f), a = (p = r.get(c)) != null ? p : {
|
|
43
43
|
value: f.value,
|
|
44
44
|
field: f.field
|
|
45
45
|
};
|
|
46
46
|
f.expanded !== void 0 && (a.expanded = f.expanded), r.has(c) || r.set(c, a);
|
|
47
47
|
let n = a;
|
|
48
|
-
(P = f.parents) != null && P.length ? f.parents.forEach((v,
|
|
49
|
-
var A, O, D,
|
|
48
|
+
(P = f.parents) != null && P.length ? (g = f.parents) == null || g.forEach((v, R) => {
|
|
49
|
+
var A, O, D, S, X, T, w;
|
|
50
50
|
const i = h({
|
|
51
51
|
value: v.value,
|
|
52
52
|
field: v.field,
|
|
53
|
-
parents: (O = f.parents) == null ? void 0 : O.slice(
|
|
53
|
+
parents: (O = f.parents) == null ? void 0 : O.slice(R + 1, (A = f == null ? void 0 : f.parents) == null ? void 0 : A.length)
|
|
54
54
|
}), t = (D = r.get(i)) != null ? D : {
|
|
55
55
|
value: v.value,
|
|
56
56
|
field: v.field
|
|
57
57
|
};
|
|
58
|
-
v.expanded && (t.expanded = v.expanded), r.has(i) || r.set(i, t), t
|
|
59
|
-
}) : (
|
|
58
|
+
v.expanded && (t.expanded = v.expanded), r.has(i) || r.set(i, t), t.groups || (t.groups = /* @__PURE__ */ new Set()), t.groups.add(n), n = t, R === ((X = (S = f.parents) == null ? void 0 : S.length) != null ? X : -1) - 1 && ((w = (T = r.get("root")) == null ? void 0 : T.groups) == null || w.add(t));
|
|
59
|
+
}) : (L = (G = r.get("root")) == null ? void 0 : G.groups) == null || L.add(n);
|
|
60
60
|
});
|
|
61
61
|
})(e);
|
|
62
62
|
const d = (s) => {
|
|
63
63
|
s.groups && (s.groups = Array.from(s.groups), s.groups.forEach(d));
|
|
64
64
|
};
|
|
65
65
|
return d(r.get("root")), ((l = r.get("root")) == null ? void 0 : l.groups) || [];
|
|
66
|
-
},
|
|
66
|
+
}, U = (e, r) => {
|
|
67
67
|
var u;
|
|
68
68
|
return !!((u = r.parents) != null && u.every((d, l) => {
|
|
69
69
|
var s;
|
|
70
70
|
return (s = e.parents) == null ? void 0 : s.find((f) => d.value === f.value && d.field === f.field);
|
|
71
71
|
}));
|
|
72
|
-
}, x = (e, r) => e.find((d) => d.value === r.value && d.field === r.field &&
|
|
72
|
+
}, x = (e, r) => e.find((d) => d.value === r.value && d.field === r.field && U(d, r)), z = (e, r, u) => {
|
|
73
73
|
var s, f, c;
|
|
74
74
|
const d = E(e != null ? e : []), l = x(d, r.group);
|
|
75
75
|
switch (r.type) {
|
|
@@ -98,10 +98,10 @@ const U = (e) => {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
N as GROUP_EXPAND_ACTION,
|
|
102
|
+
$ as findGroupExpand,
|
|
103
103
|
o as flatToTree,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
F as getGroupExpandableOptions,
|
|
105
|
+
z as groupExpandReducer,
|
|
106
|
+
j as isExpanded
|
|
107
107
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@progress/kendo-vue-common"),F=require("./constants.js"),t=require("./utils.js"),R=require("vue"),A=require("./NavigatableSettings.js"),M=R.defineComponent({name:"KendoTableKeyboardNavigationProvider",props:{navigatable:{type:Boolean,default:!1},id:String,columnVirtualization:{type:Boolean,default:!1},scrollable:String},data:function(){return{scope:void 0,kbContext:void 0,navigation:void 0}},provide:function(){return{getKeyboardNavigationAttributes:this.getKeyboardNavigationAttributes,onNavMount:this.onComponentDidMount,onNavBeforeUpdate:this.onGetSnapshotBeforeUpdate,onNavUpdate:this.onComponentDidUpdate,onNavFocus:this.onFocus,onNavKeyDown:this.onKeyDown,generateMatrix:this.generateMatrix,kbContext:this.kbContext,navigation:this.navigation}},created(){const{navigatable:e,id:i}=this.$props;e&&(this.kbContext={activeId:"",level:0},this.navigation={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:i||o.guid(),navigationMatrix:[],lastHeaderIndex:-1})},methods:{scrollElementIntoViewForVirtualization(e){if(!e||typeof e.scrollIntoView!="function")return;const{scrollable:i,columnVirtualization:n}=this.$props;(i==="virtual"||n)&&e.scrollIntoView({block:i==="virtual"?"center":void 0,inline:n?"center":void 0,behavior:"auto"})},getKeyboardNavigationAttributes(e){return!e||this.$props.navigatable===!1?{}:{tabIndex:this.kbContext.activeId&&this.kbContext.activeId===e?0:-1,[F.KEYBOARD_NAV_DATA_LEVEL]:this.kbContext.level,[F.KEYBOARD_NAV_DATA_ID]:e}},onComponentDidMount(e){const{scope:i=this.scope}=e;if(this.kbContext&&this.navigation&&i){this.scope=i,this.generateMatrix(e);const n=t.getFirstDataCell(this.navigation.navigationMatrix);if(n){const s=t.tableKeyboardNavigationTools.getActiveNavDataElement(i,n);s&&(this.kbContext.activeId=n,s.setAttribute("tabIndex","0"))}}},onGetSnapshotBeforeUpdate(e){if(this.kbContext&&this.navigation&&document){const i=document.activeElement,n=t.tableKeyboardNavigationTools.getNavigatableId(i);n&&n===this.kbContext.activeId&&(this.navigation.activeElementIsFocused=!0)}},conditionallyFocusElement(e,i,n){if(i){e();return}const s=document.activeElement;s&&s!==document.body&&n&&!n.contains(s)||e()},onComponentDidUpdate(e){var l,g;const{scope:i,focusFirst:n,newEditableRow:s,singleEditRow:d,lastActiveElement:b,navigatable:r,userInitiatedEdit:y}=e;if(n&&(this.onConstructor(e),this.onComponentDidMount(e),this.focusFirstDataElement(e)),(!r||r&&r.mode===A.NavigatableMode.inline)&&(s&&!d||s&&d&&!b)?this.conditionallyFocusElement(()=>this.focusFirstEditor(s),y,i):r&&r.mode===A.NavigatableMode.inline&&s&&d&&b&&this.conditionallyFocusElement(()=>b.focus(),y,i),this.generateMatrix(e),this.kbContext&&this.navigation&&i){const C=t.tableKeyboardNavigationTools.getActiveNavDataElement(i,this.kbContext.activeId);if(C)this.navigation.activeElementIsFocused&&((g=(l=this.navigation)==null?void 0:l.prevNavigationIndexes)==null?void 0:g.length)>0&&C!==document.activeElement&&C.focus();else{const x=i.className.indexOf("k-treelist")===-1?t.getFirstDataCell(this.navigation.navigationMatrix):this.navigation.navigationMatrix[0][0],K=t.tableKeyboardNavigationTools.getActiveNavDataElement(i,x);x&&K&&(this.kbContext.activeId=x,K.setAttribute("tabIndex","0"),this.navigation.activeElementIsFocused&&K.focus())}this.navigation.activeElementIsFocused=!1}},onFocus(e,i){const n=this.kbContext;if(e.defaultPrevented||!n)return;const s=e.target,d=t.tableKeyboardNavigationTools.getNavigatableId(s);if(d&&d!==n.activeId){const b=t.tableKeyboardNavigationTools.getClosestScope(s);if(!b)return;const r=t.tableKeyboardNavigationTools.getActiveNavDataElement(b,n.activeId);r&&!e.target.classList.contains("k-table-td")&&!e.target.classList.contains("k-detail-cell")&&r.setAttribute("tabIndex","-1"),s.setAttribute("tabIndex","0"),n.activeId=d}else if(s.closest(".k-filtercell")&&(i!=null&&i.navigatable)){const b=s.closest(".k-table-td");o.enableNavigatableContainer(b)}},async onKeyDown(e,i){var E,u,I,p;const{kbContext:n=this.kbContext,navigation:s=this.navigation,onNavigationAction:d,columns:b}=i;if(e.defaultPrevented||!n||!s)return;let r;if(e.keyCode===o.Keys.esc){const a=t.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target);t.tableKeyboardNavigationTools.focusElement({elementForFocus:a,event:e,kbContext:n}),e.target.closest(".k-filtercell")&&a&&i.navigatable&&o.disableNavigatableContainer(a);return}const y=e.target,l=y.className.indexOf("k-checkbox")===-1?y:t.tableKeyboardNavigationTools.getClosestNavigatableElement(y),g=t.tableKeyboardNavigationTools.getNavigatableId(l),C=g==null?void 0:g.endsWith("column"),x=g==null?void 0:g.endsWith("column_filter"),K=t.tableKeyboardNavigationTools.getNavigatableLevel(l),v=t.tableKeyboardNavigationTools.getClosestScope(l),m=s.navigationMatrix,h=e.metaKey||e.ctrlKey,f=t.getCurrentIdIndexes(s,m,g),D=l.closest(".k-table-td"),T=(E=l.closest(".k-table-td"))==null?void 0:E.classList.contains("k-grid-edit-cell");if(i.navigatable&&i.navigatable.mode===A.NavigatableMode.inline){if(e.keyCode===o.Keys.enter){const a=l.classList.contains("k-grid-remove-command"),c=l.classList.contains("k-grid-cancel-command"),N=t.tableKeyboardNavigationTools.getRowAriaRowIndex(l);if(a){setTimeout(()=>{const k=t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(N.current)||t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(N.prev);k&&k.focus()});return}else if(c&&l.parentElement){const k=(u=t.tableKeyboardNavigationTools.getClosestNavigatableElement(l))==null?void 0:u.getAttribute("data-keyboardnavid");setTimeout(()=>{k&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(k).focus()});return}}if(e.keyCode===o.Keys.esc){const a=t.tableKeyboardNavigationTools.getClosestCancelButton(l);a&&a.click();const c=await t.tableKeyboardNavigationTools.getClosestEditButton(l);c&&c.focus();return}}else if(i.navigatable&&i.navigatable.mode===A.NavigatableMode.incell){if(e.keyCode===o.Keys.esc){l.focus(),l.blur();const a=((I=y==null?void 0:y.parentElement)==null?void 0:I.closest(".k-grid-edit-row"))||null,c=t.tableKeyboardNavigationTools.getClosestCellNavId(l),N=await t.tableKeyboardNavigationTools.waitForElementToBeVisible(`[data-keyboardnavid='${c}']:not(.k-grid-edit-cell)`,a);N&&N.focus()}else if(e.keyCode===o.Keys.enter){let a;if(f){const[c,N]=f;a=t.findNextIdByRowIndex(c,N,g,m,!1)}if(!T)(p=t.tableKeyboardNavigationTools.getParentCell(l))==null||p.click();else if(T&&a){const c=(a==null?void 0:a[0])&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(a[0]);c==null||c.click()}}else if(e.keyCode===o.Keys.left||e.keyCode===o.Keys.right||e.keyCode===o.Keys.up||e.keyCode===o.Keys.down){if(T)return}else if(e.key==="Tab"&&T){if(e.shiftKey){const a=f&&b&&t.tableKeyboardNavigationTools.getPrevEditableCell(f,b,g,m);if(a!=null&&a.prevCell&&a.prevCell.click(),a&&a.elementToFocus!=="gridcell"){l.blur();const c=t.tableKeyboardNavigationTools.getClosestCellNavId(l);setTimeout(()=>{c&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(c).focus()})}e.preventDefault()}else{const a=f&&b&&t.tableKeyboardNavigationTools.getNextEditableCell(f,b,g,m);if(a!=null&&a.nextCell&&a.elementToFocus==="gridcell"&&a.nextCell.click(),a&&a.elementToFocus!=="gridcell"){l.blur();const c=t.tableKeyboardNavigationTools.getClosestCellNavId(l);c&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(c).focus();return}e.preventDefault()}e.preventDefault()}}if(l.closest(".k-filtercell")&&D&&i.navigatable){o.keepFocusInContainer(e,D,o.TABBABLE_ELEMENTS);return}if(K!==void 0&&v){if(e.keyCode===o.Keys.enter){const a=t.tableKeyboardNavigationTools.getNavigatableElement(l,{level:K+1});if(a){t.tableKeyboardNavigationTools.focusElement({elementForFocus:a,event:e,kbContext:n,prevElement:l});return}l.querySelector(".k-filtercell")&&i.navigatable&&o.enableNavigatableContainer(l),r=t.tableKeyboardNavigationTools.getFocusableElements(l)[0],t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n,prevElement:l})}if(e.keyCode===o.Keys.home&&f)if(h)t.focusFirstDataElement({scope:v,navigation:s,kbContext:n},e);else{const a=t.getFirstRowDataCell(s.navigationMatrix,f[0]);r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,a),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n})}if(e.keyCode===o.Keys.end&&f)if(h){const a=t.getLastDataCell(s.navigationMatrix);r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,a),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n})}else{const a=t.getLastRowDataCell(s.navigationMatrix,f[0]);r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,a),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n})}if(e.keyCode===o.Keys.up||e.keyCode===o.Keys.down||e.keyCode===o.Keys.left||e.keyCode===o.Keys.right){const a=e.keyCode===o.Keys.up||e.keyCode===o.Keys.left,c=e.keyCode===o.Keys.up||e.keyCode===o.Keys.down;if(f){const[N,k]=f,[w,B]=c?t.findNextIdByRowIndex(N,k,g,m,a):t.findNextIdByCellIndex(N,k,g,m,a);w&&(r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,w),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n,prevElement:l}),s.prevNavigationIndexes=B,this.scrollElementIntoViewForVirtualization(r))}}if(h&&e.keyCode===o.Keys.left&&C){d&&d({focusElement:l,event:e,action:"reorderToLeft"}),e.preventDefault();return}if(h&&e.keyCode===o.Keys.right&&C){d&&d({focusElement:l,event:e,action:"reorderToRight"}),e.preventDefault();return}if(e.keyCode===o.Keys.pageUp){d&&d({focusElement:r,event:e,action:"moveToNextPage"}),e.preventDefault();return}if(e.keyCode===o.Keys.pageDown){d&&d({focusElement:r,event:e,action:"moveToPrevPage"}),e.preventDefault();return}if(!C&&!x&&!T&&(e.keyCode===o.Keys.space||e.keyCode===o.Keys.enter||e.shiftKey&&(e.keyCode===o.Keys.up||e.keyCode===o.Keys.down||e.keyCode===o.Keys.left||e.keyCode===o.Keys.right))){d&&d({focusElement:r,event:e,action:"select"});return}d&&d({focusElement:r,event:e})}},generateMatrix(e){const{navigation:i=this.navigation,scope:n}=e;if(!i||!n)return;const s=[],d=t.getHeaderElement(n),b=t.getBodyElement(n),r=t.getTopPinnedElement(n),y=t.getBottomPinnedElement(n);if(!d||!b)return;const l=Array.from(d.children),g=r?Array.from(r.children):[],C=Array.from(b.children),x=y?Array.from(y.children):[],K=t.getNoRecordsElement(n)||{children:[]};[...l,...g,...C,...x,K].forEach((v,m)=>{Array.from(v.children).forEach(h=>{const f=t.getNavigatableId(h);if(!f)return;const D=h.rowSpan||1,T=h.colSpan||1;let E;for(let u=m,I=m+D;u<I;u++){if(s[u]||(s[u]=[]),E===void 0){const p=s[u].findIndex(a=>!a);E=p>-1?p:s[u].length}s[u][E]=f||""}for(let u=E+1,I=E+T;u<I;u++)s[m][u]=f||""})}),i.navigationMatrix=s.filter(v=>!!v),i.lastHeaderIndex=l.length-1}},render(){return o.getDefaultSlots(this)[0]}});exports.TableKeyboardNavigationProvider=M;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@progress/kendo-vue-common"),F=require("./constants.js"),t=require("./utils.js"),R=require("vue"),A=require("./NavigatableSettings.js"),M=R.defineComponent({name:"KendoTableKeyboardNavigationProvider",props:{navigatable:{type:Boolean,default:!1},id:String,columnVirtualization:{type:Boolean,default:!1},scrollable:String},data:function(){return{scope:void 0,kbContext:void 0,navigation:void 0}},provide:function(){return{getKeyboardNavigationAttributes:this.getKeyboardNavigationAttributes,onNavMount:this.onComponentDidMount,onNavBeforeUpdate:this.onGetSnapshotBeforeUpdate,onNavUpdate:this.onComponentDidUpdate,onNavFocus:this.onFocus,onNavKeyDown:this.onKeyDown,generateMatrix:this.generateMatrix,kbContext:this.kbContext,navigation:this.navigation}},created(){const{navigatable:e,id:i}=this.$props;e&&(this.kbContext={activeId:"",level:0},this.navigation={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:i||o.guid(),navigationMatrix:[],lastHeaderIndex:-1})},methods:{scrollElementIntoViewForVirtualization(e){if(!e||typeof e.scrollIntoView!="function")return;const{scrollable:i,columnVirtualization:n}=this.$props;(i==="virtual"||n)&&e.scrollIntoView({block:i==="virtual"?"center":void 0,inline:n?"center":void 0,behavior:"auto"})},getKeyboardNavigationAttributes(e){return!e||this.$props.navigatable===!1?{}:{tabIndex:this.kbContext.activeId&&this.kbContext.activeId===e?0:-1,[F.KEYBOARD_NAV_DATA_LEVEL]:this.kbContext.level,[F.KEYBOARD_NAV_DATA_ID]:e}},onComponentDidMount(e){const{scope:i=this.scope}=e;if(this.kbContext&&this.navigation&&i){this.scope=i,this.generateMatrix(e);const n=t.getFirstDataCell(this.navigation.navigationMatrix);if(n){const s=t.tableKeyboardNavigationTools.getActiveNavDataElement(i,n);s&&(this.kbContext.activeId=n,s.setAttribute("tabIndex","0"))}}},onGetSnapshotBeforeUpdate(e){if(this.kbContext&&this.navigation&&document){const i=document.activeElement,n=t.tableKeyboardNavigationTools.getNavigatableId(i);n&&n===this.kbContext.activeId&&(this.navigation.activeElementIsFocused=!0)}},conditionallyFocusElement(e,i,n){if(i){e();return}const s=document.activeElement;s&&s!==document.body&&n&&!n.contains(s)||e()},onComponentDidUpdate(e){var l,g;const{scope:i,focusFirst:n,newEditableRow:s,singleEditRow:d,lastActiveElement:b,navigatable:r,userInitiatedEdit:y}=e;if(n&&(this.onConstructor(e),this.onComponentDidMount(e),this.focusFirstDataElement(e)),(!r||r&&r.mode===A.NavigatableMode.inline)&&(s&&!d||s&&d&&!b)?this.conditionallyFocusElement(()=>this.focusFirstEditor(s),y,i):r&&r.mode===A.NavigatableMode.inline&&s&&d&&b&&this.conditionallyFocusElement(()=>b.focus(),y,i),this.generateMatrix(e),this.kbContext&&this.navigation&&i){const C=t.tableKeyboardNavigationTools.getActiveNavDataElement(i,this.kbContext.activeId);if(C)this.navigation.activeElementIsFocused&&((g=(l=this.navigation)==null?void 0:l.prevNavigationIndexes)==null?void 0:g.length)>0&&C!==document.activeElement&&C.focus();else{const x=i.className.indexOf("k-treelist")===-1?t.getFirstDataCell(this.navigation.navigationMatrix):this.navigation.navigationMatrix[0][0],K=t.tableKeyboardNavigationTools.getActiveNavDataElement(i,x);x&&K&&(this.kbContext.activeId=x,K.setAttribute("tabIndex","0"),this.navigation.activeElementIsFocused&&K.focus())}this.navigation.activeElementIsFocused=!1}},onFocus(e,i){const n=this.kbContext;if(e.defaultPrevented||!n)return;const s=e.target,d=t.tableKeyboardNavigationTools.getNavigatableId(s);if(d&&d!==n.activeId){const b=t.tableKeyboardNavigationTools.getClosestScope(s);if(!b)return;const r=t.tableKeyboardNavigationTools.getActiveNavDataElement(b,n.activeId);r&&!e.target.classList.contains("k-table-td")&&!e.target.classList.contains("k-detail-cell")&&r.setAttribute("tabIndex","-1"),s.setAttribute("tabIndex","0"),n.activeId=d}else if(s.closest(".k-filtercell")&&(i!=null&&i.navigatable)){const b=s.closest(".k-table-td");o.enableNavigatableContainer(b)}},async onKeyDown(e,i){var E,u,I,p;const{kbContext:n=this.kbContext,navigation:s=this.navigation,onNavigationAction:d,columns:b}=i;if(e.defaultPrevented||!n||!s)return;let r;if(e.keyCode===o.Keys.esc){const a=t.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target);t.tableKeyboardNavigationTools.focusElement({elementForFocus:a,event:e,kbContext:n}),e.target.closest(".k-filtercell")&&a&&i.navigatable&&o.disableNavigatableContainer(a);return}const y=e.target,l=y.className.indexOf("k-checkbox")===-1?y:t.tableKeyboardNavigationTools.getClosestNavigatableElement(y),g=t.tableKeyboardNavigationTools.getNavigatableId(l),C=g==null?void 0:g.endsWith("column"),x=g==null?void 0:g.endsWith("column_filter"),K=t.tableKeyboardNavigationTools.getNavigatableLevel(l),v=t.tableKeyboardNavigationTools.getClosestScope(l),m=s.navigationMatrix,h=e.metaKey||e.ctrlKey,f=t.getCurrentIdIndexes(s,m,g),D=l.closest(".k-table-td"),T=(E=l.closest(".k-table-td"))==null?void 0:E.classList.contains("k-grid-edit-cell");if(i.navigatable&&i.navigatable.mode===A.NavigatableMode.inline){if(e.keyCode===o.Keys.enter){const a=l.classList.contains("k-grid-remove-command"),c=l.classList.contains("k-grid-cancel-command"),N=t.tableKeyboardNavigationTools.getRowAriaRowIndex(l);if(a){setTimeout(()=>{const k=t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(N.current)||t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(N.prev);k&&k.focus()});return}else if(c&&l.parentElement){const k=(u=t.tableKeyboardNavigationTools.getClosestNavigatableElement(l))==null?void 0:u.getAttribute("data-keyboardnavid");setTimeout(()=>{k&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(k).focus()});return}}if(e.keyCode===o.Keys.esc){const a=t.tableKeyboardNavigationTools.getClosestCancelButton(l);a&&a.click();const c=await t.tableKeyboardNavigationTools.getClosestEditButton(l);c&&c.focus();return}}else if(i.navigatable&&i.navigatable.mode===A.NavigatableMode.incell){if(e.keyCode===o.Keys.esc){l.focus(),l.blur();const a=((I=y==null?void 0:y.parentElement)==null?void 0:I.closest(".k-grid-edit-row"))||null,c=t.tableKeyboardNavigationTools.getClosestCellNavId(l),N=await t.tableKeyboardNavigationTools.waitForElementToBeVisible(`[data-keyboardnavid='${c}']:not(.k-grid-edit-cell)`,a);N&&N.focus()}else if(e.keyCode===o.Keys.enter){let a;if(f){const[c,N]=f;a=t.findNextIdByRowIndex(c,N,g,m,!1)}if(!T)(p=t.tableKeyboardNavigationTools.getParentCell(l))==null||p.click();else if(T&&a){const c=(a==null?void 0:a[0])&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(a[0]);c==null||c.click()}}else if(e.keyCode===o.Keys.left||e.keyCode===o.Keys.right||e.keyCode===o.Keys.up||e.keyCode===o.Keys.down){if(T)return}else if(e.key==="Tab"&&T){if(e.shiftKey){const a=f&&b&&t.tableKeyboardNavigationTools.getPrevEditableCell(f,b,g,m);if(a!=null&&a.prevCell&&a.prevCell.click(),a&&a.elementToFocus!=="gridcell"){l.blur();const c=t.tableKeyboardNavigationTools.getClosestCellNavId(l);setTimeout(()=>{c&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(c).focus()})}e.preventDefault()}else{const a=f&&b&&t.tableKeyboardNavigationTools.getNextEditableCell(f,b,g,m);if(a!=null&&a.nextCell&&a.elementToFocus==="gridcell"&&a.nextCell.click(),a&&a.elementToFocus!=="gridcell"){l.blur();const c=t.tableKeyboardNavigationTools.getClosestCellNavId(l);c&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(c).focus();return}e.preventDefault()}e.preventDefault()}}if(l.closest(".k-filtercell")&&D&&i.navigatable){o.keepFocusInContainer(e,D,o.TABBABLE_ELEMENTS);return}if(K!==void 0&&v){if(e.keyCode===o.Keys.enter){const a=t.tableKeyboardNavigationTools.getNavigatableElement(l,{level:K+1});if(a){t.tableKeyboardNavigationTools.focusElement({elementForFocus:a,event:e,kbContext:n,prevElement:l});return}l.querySelector(".k-filtercell")&&i.navigatable&&o.enableNavigatableContainer(l),r=t.tableKeyboardNavigationTools.getFocusableElements(l)[0],t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n,prevElement:l})}if(e.keyCode===o.Keys.home&&f)if(h)t.focusFirstDataElement({scope:v,navigation:s,kbContext:n},e);else{const a=t.getFirstRowDataCell(s.navigationMatrix,f[0]);r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,a),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n})}if(e.keyCode===o.Keys.end&&f)if(h){const a=t.getLastDataCell(s.navigationMatrix);r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,a),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n})}else{const a=t.getLastRowDataCell(s.navigationMatrix,f[0]);r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,a),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n})}if(e.keyCode===o.Keys.up||e.keyCode===o.Keys.down||e.keyCode===o.Keys.left||e.keyCode===o.Keys.right){const a=e.keyCode===o.Keys.up||e.keyCode===o.Keys.left,c=e.keyCode===o.Keys.up||e.keyCode===o.Keys.down;if(f){const[N,k]=f,[w,B]=c?t.findNextIdByRowIndex(N,k,g,m,a):t.findNextIdByCellIndex(N,k,g,m,a);w&&(r=t.tableKeyboardNavigationTools.getActiveNavDataElement(v,w),t.tableKeyboardNavigationTools.focusElement({elementForFocus:r,event:e,kbContext:n,prevElement:l}),s.prevNavigationIndexes=B,this.scrollElementIntoViewForVirtualization(r))}}if(h&&e.keyCode===o.Keys.left&&C){d&&d({focusElement:l,event:e,action:"reorderToLeft"}),e.preventDefault();return}if(h&&e.keyCode===o.Keys.right&&C){d&&d({focusElement:l,event:e,action:"reorderToRight"}),e.preventDefault();return}if(e.keyCode===o.Keys.pageUp){d&&d({focusElement:r,event:e,action:"moveToNextPage"}),e.preventDefault();return}if(e.keyCode===o.Keys.pageDown){d&&d({focusElement:r,event:e,action:"moveToPrevPage"}),e.preventDefault();return}if(!C&&!x&&!T&&(e.keyCode===o.Keys.space||e.keyCode===o.Keys.enter||e.shiftKey&&(e.keyCode===o.Keys.up||e.keyCode===o.Keys.down||e.keyCode===o.Keys.left||e.keyCode===o.Keys.right))){d&&d({focusElement:r,event:e,action:"select"});return}d&&d({focusElement:r,event:e})}},generateMatrix(e){const{navigation:i=this.navigation,scope:n}=e;if(!i||!n)return;const s=[],d=t.getHeaderElement(n),b=t.getBodyElement(n),r=t.getTopPinnedElement(n),y=t.getBottomPinnedElement(n);if(!d||!b)return;const l=Array.from(d.children),g=r?Array.from(r.children):[],C=Array.from(b.children),x=y?Array.from(y.children):[],K=t.getNoRecordsElement(n)||{children:[]};[...l,...g,...C,...x,K].forEach((v,m)=>{Array.from(v.children).forEach(h=>{const f=t.getNavigatableId(h);if(!f)return;const D=h.rowSpan||1,T=h.colSpan||1;let E;for(let u=m,I=m+D;u<I;u++){if(s[u]||(s[u]=[]),E===void 0){const p=s[u].findIndex(a=>!a);E=p>-1?p:s[u].length}s[u][E]=f}for(let u=E+1,I=E+T;u<I;u++)s[m][u]=f})}),i.navigationMatrix=s.filter(v=>!!v),i.lastHeaderIndex=l.length-1}},render(){return o.getDefaultSlots(this)[0]}});exports.TableKeyboardNavigationProvider=M;
|
|
@@ -373,10 +373,10 @@ const le = /* @__PURE__ */ ee({
|
|
|
373
373
|
const A = l[m].findIndex((t) => !t);
|
|
374
374
|
x = A > -1 ? A : l[m].length;
|
|
375
375
|
}
|
|
376
|
-
l[m][x] = g
|
|
376
|
+
l[m][x] = g;
|
|
377
377
|
}
|
|
378
378
|
for (let m = x + 1, D = x + N; m < D; m++)
|
|
379
|
-
l[C][m] = g
|
|
379
|
+
l[C][m] = g;
|
|
380
380
|
});
|
|
381
381
|
}), o.navigationMatrix = l.filter((v) => !!v), o.lastHeaderIndex = n.length - 1;
|
|
382
382
|
}
|
package/navigation/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@progress/kendo-vue-common"),a=require("./constants.js"),S=(e,t,n="cell")=>`${t}_${e}_${n}`,x=e=>{if(e)return parseInt(e.getAttribute(a.KEYBOARD_NAV_DATA_LEVEL)||"",10)},N=e=>{if(!e)return;const t=e.getAttribute(a.KEYBOARD_NAV_DATA_ID);return t||void 0},A=e=>e?!!e.getAttribute(a.KEYBOARD_NAV_DATA_ID):!1,y=(e,t={level:0})=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`),b=e=>e.parentElement&&e.parentElement.closest(`[${a.KEYBOARD_NAV_DATA_LEVEL}]`),C=(e,t)=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_ID}='${t}']`),T=e=>e.parentElement&&e.parentElement.closest(`[${a.KEYBOARD_NAV_DATA_SCOPE}]`),k=e=>{var n;const t=((n=e==null?void 0:e.parentElement)==null?void 0:n.closest(".k-grid-edit-row"))||null;return t==null?void 0:t.querySelector("."+a.KEYBOARD_NAV_CANCEL_BUTTON_CLASS)},R=e=>document.querySelector(`[aria-rowindex="${e}"] .k-grid-remove-command`),i=e=>document.querySelector(`[data-keyboardnavid="${e}"]`),w=e=>{var l,r;const t=(l=e==null?void 0:e.parentElement)==null?void 0:l.closest(".k-table-row");let n;return(r=t==null?void 0:t.parentElement)==null||r.childNodes.forEach(o=>{if(t===o){const s=o.previousSibling;n={current:t.getAttribute("aria-rowindex"),prev:s==null?void 0:s.getAttribute("aria-rowindex")}}}),n};async function L(e,t,n=5e3){const l=Date.now();if(t)for(;Date.now()-l<n;){const r=t.querySelector(e);if(r)return r;await new Promise(o=>setTimeout(o,20))}return!1}const O=async e=>{var l;const t=((l=e==null?void 0:e.parentElement)==null?void 0:l.closest(".k-grid-edit-row"))||null;return await L("."+a.KEYBOARD_NAV_EDIT_BUTTON_CLASS,t)},p=e=>(e==null?void 0:e.closest(".k-table-td"))||null,F=e=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_HEADER}]`),V=e=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_BODY}]`),$=e=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_TOP_PINNED}]`),h=e=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_BOTTOM_PINNED}]`),ee=e=>e.querySelector(".k-grid-norecords"),K=(e,t)=>{const{scope:n,navigation:l,kbContext:r}=e;if(!l||!n)return;const o=H(l.navigationMatrix),s=C(n,o);D({elementForFocus:s,kbContext:r,event:t})},_=(e,t={focusable:!1})=>{const n=t.focusable?E.FOCUSABLE_ELEMENTS:E.TABBABLE_ELEMENTS;return Array.from(e.querySelectorAll(n.join(",")))},P=(e,t={level:0})=>{if(!e)return[];const n=E.FOCUSABLE_ELEMENTS.map(l=>l+`[${a.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`).join(",");return Array.from(e.querySelectorAll(n))},q=(e={level:0})=>{const t=E.FOCUSABLE_ELEMENTS.map(n=>n+`[${a.KEYBOARD_NAV_DATA_LEVEL}='${e.level}']`).join(",");return n=>n.matches(t)},D=e=>{const{elementForFocus:t,event:n,kbContext:l,prevElement:r}=e;if(l&&t&&t.focus){n==null||n.preventDefault();const o=t.querySelector(".k-checkbox-wrap .k-checkbox");o!=null&&o.focus?o.focus():t.focus(),A(t)&&(t.setAttribute("tabIndex","0"),l.activeId=N(t)),r&&A(r)&&r.setAttribute("tabIndex","-1")}},Y=e=>e?e.idPrefix:"",M=(e,t,n,l,r)=>{if(!n)return[];let o=e+(r?-1:1);for(;o>=0&&o<l.length;){const s=l[o][t];if(s!==n)return[s,[o,t]];o=o+(r?-1:1)}return[]},d=(e,t,n,l,r)=>{if(!n)return[];let o=t+(r?-1:1);for(;o>=0&&l[e]&&o<l[e].length;){const s=l[e][o];if(s!==n)return[s,[e,o]];o=o+(r?-1:1)}return[]},f=(e,t)=>{if(t){for(let n=0;n<e.length;n++)for(let l=0;l<e[n].length;l++)if(e[n][l]===t)return[n,l]}},B=(e,t,n)=>{let l;do if(e=e+1,l=t[n-e],l!=null&&l.editable)break;while(n-e>=0);return l},U=(e,t,n,l)=>{var m;let r;const[o,s]=e;let u;const c=0,g=t.length;return u=B(c,t,s),u?r=d(o,u.ariaColumnIndex,n,l,!0):(u=B(c,t,g),r=d(o-1,u==null?void 0:u.ariaColumnIndex,n,l,!0)),{prevCell:(r==null?void 0:r[0])&&i(r[0]),elementToFocus:(r==null?void 0:r[0])&&((m=i(r[0]))==null?void 0:m.getAttribute("role"))}},v=(e,t,n)=>{let l;do if(e=e+1,l=t[n+e],l!=null&&l.editable)break;while(n+e-1<t.length);return l},j=(e,t,n,l)=>{var o;let r;if(e){const[s,u]=e;let c,g=0;c=v(g,t,u),c?r=d(s,c.ariaColumnIndex,n,l,!0):(g=-1,c=v(g,t,0),r=d(s+1,c==null?void 0:c.ariaColumnIndex,n,l,!0))}return{nextCell:(r==null?void 0:r[0])&&i(r[0]),elementToFocus:(r==null?void 0:r[0])&&((o=i(r[0]))==null?void 0:o.getAttribute("role"))}},W=e=>{var t;return(t=e==null?void 0:e.navigationMatrix.length)!=null?t:0},H=e=>e.flat().find(t=>t.endsWith("cell")),te=e=>e.flat().reverse().find(t=>t.endsWith("cell")),ne=(e,t)=>e[t][0],le=(e,t)=>Array.from(e[t]).reverse()[0],X=e=>e?`${e}${a.KEYBOARD_NAV_FILTER_COL_SUFFIX}`:"",re=(e,t,n)=>{let l;if(e!=null&&e.prevNavigationIndexes){const[r,o]=e.prevNavigationIndexes,s=t[r];(s==null?void 0:s[o])===n?l=e.prevNavigationIndexes:l=f(t,n)}else l=f(t,n);return l},z=e=>{var t;return((t=b(e))==null?void 0:t.getAttribute("data-keyboardnavid"))||e.getAttribute("data-keyboardnavid")},G=e=>e.closest(".k-grid-stack-cell"),I=e=>_(e,{focusable:!0}),J=(e,t)=>{var o;const n=e.closest(".k-table-td");if(!n)return null;const l=Array.from(n.querySelectorAll(".k-grid-stack-cell")),r=l.indexOf(e);return r===-1?null:t==="next"?r<l.length-1?l[r+1]:l[0]:r>0?l[r-1]:(o=l.at(-1))!=null?o:null},Q=e=>e.closest(".k-table-td, td.k-table-td[tabindex]"),Z=(e,t=0)=>{const n=I(e);n.length>0?(n[t]||n[0]).focus():e.focus()},oe={generateNavigatableId:S,getNavigatableId:N,getNavigatableLevel:x,getNavigatableElement:y,getClosestNavigatableElement:b,getActiveNavDataElement:C,getClosestScope:T,getHeaderElement:F,getBodyElement:V,getTopPinnedElement:$,getBottomPinnedElement:h,getFocusableElements:_,getNavigatableElements:P,filterNavigatableElements:q,focusElement:D,getIdPrefix:Y,isNavigatable:A,findNextIdByRowIndex:M,findNextIdByCellIndex:d,findId:f,getNextNavigationIndex:W,getFilterColumnId:X,focusFirstDataElement:K,getClosestCancelButton:k,getClosestEditButton:O,getRowAriaRowIndex:w,getRemoveButtonByAriaRowIndex:R,getTableCellByKeyboardNavId:i,getParentCell:p,waitForElementToBeVisible:L,getNextEditableCell:j,getPrevEditableCell:U,getClosestCellNavId:z,getStackedCellWrapper:G,getStackedCellFocusableElements:I,getNextStackedCell:J,getStackedCellContainer:Q,focusStackedCellElement:Z};exports.filterNavigatableElements=q;exports.findId=f;exports.findNextIdByCellIndex=d;exports.findNextIdByRowIndex=M;exports.focusElement=D;exports.focusFirstDataElement=K;exports.focusStackedCellElement=Z;exports.generateNavigatableId=S;exports.getActiveNavDataElement=C;exports.getBodyElement=V;exports.getBottomPinnedElement=h;exports.getClosestCancelButton=k;exports.getClosestCellNavId=z;exports.getClosestEditButton=O;exports.getClosestNavigatableElement=b;exports.getClosestScope=T;exports.getCurrentIdIndexes=re;exports.getFilterColumnId=X;exports.getFirstDataCell=H;exports.getFirstRowDataCell=ne;exports.getFocusableElements=_;exports.getHeaderElement=F;exports.getIdPrefix=Y;exports.getLastDataCell=te;exports.getLastRowDataCell=le;exports.getNavigatableElement=y;exports.getNavigatableElements=P;exports.getNavigatableId=N;exports.getNavigatableLevel=x;exports.getNextEditableCell=j;exports.getNextNavigationIndex=W;exports.getNextStackedCell=J;exports.getNoRecordsElement=ee;exports.getParentCell=p;exports.getPrevEditableCell=U;exports.getRemoveButtonByAriaRowIndex=R;exports.getRowAriaRowIndex=w;exports.getStackedCellContainer=Q;exports.getStackedCellFocusableElements=I;exports.getStackedCellWrapper=G;exports.getTableCellByKeyboardNavId=i;exports.getTopPinnedElement=$;exports.isNavigatable=A;exports.tableKeyboardNavigationTools=oe;
|
package/navigation/utils.mjs
CHANGED
|
@@ -20,12 +20,12 @@ const F = (e, t, r = "cell") => `${t}_${e}_${r}`, q = (e) => {
|
|
|
20
20
|
const t = ((r = e == null ? void 0 : e.parentElement) == null ? void 0 : r.closest(".k-grid-edit-row")) || null;
|
|
21
21
|
return t == null ? void 0 : t.querySelector("." + T);
|
|
22
22
|
}, V = (e) => document.querySelector(`[aria-rowindex="${e}"] .k-grid-remove-command`), i = (e) => document.querySelector(`[data-keyboardnavid="${e}"]`), Y = (e) => {
|
|
23
|
-
var n,
|
|
23
|
+
var n, o;
|
|
24
24
|
const t = (n = e == null ? void 0 : e.parentElement) == null ? void 0 : n.closest(".k-table-row");
|
|
25
25
|
let r;
|
|
26
|
-
return (
|
|
27
|
-
if (t ===
|
|
28
|
-
const s =
|
|
26
|
+
return (o = t == null ? void 0 : t.parentElement) == null || o.childNodes.forEach((l) => {
|
|
27
|
+
if (t === l) {
|
|
28
|
+
const s = l.previousSibling;
|
|
29
29
|
r = {
|
|
30
30
|
current: t.getAttribute("aria-rowindex"),
|
|
31
31
|
prev: s == null ? void 0 : s.getAttribute("aria-rowindex")
|
|
@@ -37,10 +37,10 @@ async function y(e, t, r = 5e3) {
|
|
|
37
37
|
const n = Date.now();
|
|
38
38
|
if (t)
|
|
39
39
|
for (; Date.now() - n < r; ) {
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
await new Promise((
|
|
40
|
+
const o = t.querySelector(e);
|
|
41
|
+
if (o)
|
|
42
|
+
return o;
|
|
43
|
+
await new Promise((l) => setTimeout(l, 20));
|
|
44
44
|
}
|
|
45
45
|
return !1;
|
|
46
46
|
}
|
|
@@ -49,11 +49,11 @@ const U = async (e) => {
|
|
|
49
49
|
const t = ((n = e == null ? void 0 : e.parentElement) == null ? void 0 : n.closest(".k-grid-edit-row")) || null;
|
|
50
50
|
return await y("." + v, t);
|
|
51
51
|
}, j = (e) => (e == null ? void 0 : e.closest(".k-table-td")) || null, M = (e) => e.querySelector(`[${O}]`), W = (e) => e.querySelector(`[${h}]`), H = (e) => e.querySelector(`[${$}]`), X = (e) => e.querySelector(`[${w}]`), Ae = (e) => e.querySelector(".k-grid-norecords"), z = (e, t) => {
|
|
52
|
-
const { scope: r, navigation: n, kbContext:
|
|
52
|
+
const { scope: r, navigation: n, kbContext: o } = e;
|
|
53
53
|
if (!n || !r)
|
|
54
54
|
return;
|
|
55
|
-
const
|
|
56
|
-
S({ elementForFocus: s, kbContext:
|
|
55
|
+
const l = ne(n.navigationMatrix), s = C(r, l);
|
|
56
|
+
S({ elementForFocus: s, kbContext: o, event: t });
|
|
57
57
|
}, B = (e, t = { focusable: !1 }) => {
|
|
58
58
|
const r = t.focusable ? b : k;
|
|
59
59
|
return Array.from(e.querySelectorAll(r.join(",")));
|
|
@@ -66,32 +66,32 @@ const U = async (e) => {
|
|
|
66
66
|
const t = b.map((r) => r + `[${f}='${e.level}']`).join(",");
|
|
67
67
|
return (r) => r.matches(t);
|
|
68
68
|
}, S = (e) => {
|
|
69
|
-
const { elementForFocus: t, event: r, kbContext: n, prevElement:
|
|
69
|
+
const { elementForFocus: t, event: r, kbContext: n, prevElement: o } = e;
|
|
70
70
|
if (n && t && t.focus) {
|
|
71
71
|
r == null || r.preventDefault();
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const l = t.querySelector(".k-checkbox-wrap .k-checkbox");
|
|
73
|
+
l != null && l.focus ? l.focus() : t.focus(), A(t) && (t.setAttribute("tabIndex", "0"), n.activeId = m(t)), o && A(o) && o.setAttribute("tabIndex", "-1");
|
|
74
74
|
}
|
|
75
|
-
}, Q = (e) => e ? e.idPrefix : "", Z = (e, t, r, n,
|
|
75
|
+
}, Q = (e) => e ? e.idPrefix : "", Z = (e, t, r, n, o) => {
|
|
76
76
|
if (!r)
|
|
77
77
|
return [];
|
|
78
|
-
let
|
|
79
|
-
for (;
|
|
80
|
-
const s = n[
|
|
78
|
+
let l = e + (o ? -1 : 1);
|
|
79
|
+
for (; l >= 0 && l < n.length; ) {
|
|
80
|
+
const s = n[l][t];
|
|
81
81
|
if (s !== r)
|
|
82
|
-
return [s, [
|
|
83
|
-
|
|
82
|
+
return [s, [l, t]];
|
|
83
|
+
l = l + (o ? -1 : 1);
|
|
84
84
|
}
|
|
85
85
|
return [];
|
|
86
|
-
}, d = (e, t, r, n,
|
|
86
|
+
}, d = (e, t, r, n, o) => {
|
|
87
87
|
if (!r)
|
|
88
88
|
return [];
|
|
89
|
-
let
|
|
90
|
-
for (;
|
|
91
|
-
const s = n[e][
|
|
89
|
+
let l = t + (o ? -1 : 1);
|
|
90
|
+
for (; l >= 0 && n[e] && l < n[e].length; ) {
|
|
91
|
+
const s = n[e][l];
|
|
92
92
|
if (s !== r)
|
|
93
|
-
return [s, [e,
|
|
94
|
-
|
|
93
|
+
return [s, [e, l]];
|
|
94
|
+
l = l + (o ? -1 : 1);
|
|
95
95
|
}
|
|
96
96
|
return [];
|
|
97
97
|
}, E = (e, t) => {
|
|
@@ -110,13 +110,13 @@ const U = async (e) => {
|
|
|
110
110
|
return n;
|
|
111
111
|
}, ee = (e, t, r, n) => {
|
|
112
112
|
var N;
|
|
113
|
-
let
|
|
114
|
-
const [
|
|
113
|
+
let o;
|
|
114
|
+
const [l, s] = e;
|
|
115
115
|
let u;
|
|
116
116
|
const c = 0, a = t.length;
|
|
117
|
-
return u = _(c, t, s), u ?
|
|
118
|
-
prevCell: (
|
|
119
|
-
elementToFocus: (
|
|
117
|
+
return u = _(c, t, s), u ? o = d(l, u.ariaColumnIndex, r, n, !0) : (u = _(c, t, a), o = d(l - 1, u == null ? void 0 : u.ariaColumnIndex, r, n, !0)), {
|
|
118
|
+
prevCell: (o == null ? void 0 : o[0]) && i(o[0]),
|
|
119
|
+
elementToFocus: (o == null ? void 0 : o[0]) && ((N = i(o[0])) == null ? void 0 : N.getAttribute("role"))
|
|
120
120
|
};
|
|
121
121
|
}, I = (e, t, r) => {
|
|
122
122
|
let n;
|
|
@@ -126,38 +126,38 @@ const U = async (e) => {
|
|
|
126
126
|
while (r + e - 1 < t.length);
|
|
127
127
|
return n;
|
|
128
128
|
}, te = (e, t, r, n) => {
|
|
129
|
-
var
|
|
130
|
-
let
|
|
129
|
+
var l;
|
|
130
|
+
let o;
|
|
131
131
|
if (e) {
|
|
132
132
|
const [s, u] = e;
|
|
133
133
|
let c, a = 0;
|
|
134
|
-
c = I(a, t, u), c ?
|
|
134
|
+
c = I(a, t, u), c ? o = d(s, c.ariaColumnIndex, r, n, !0) : (a = -1, c = I(a, t, 0), o = d(s + 1, c == null ? void 0 : c.ariaColumnIndex, r, n, !0));
|
|
135
135
|
}
|
|
136
136
|
return {
|
|
137
|
-
nextCell: (
|
|
138
|
-
elementToFocus: (
|
|
137
|
+
nextCell: (o == null ? void 0 : o[0]) && i(o[0]),
|
|
138
|
+
elementToFocus: (o == null ? void 0 : o[0]) && ((l = i(o[0])) == null ? void 0 : l.getAttribute("role"))
|
|
139
139
|
};
|
|
140
140
|
}, re = (e) => {
|
|
141
141
|
var t;
|
|
142
142
|
return (t = e == null ? void 0 : e.navigationMatrix.length) != null ? t : 0;
|
|
143
|
-
}, ne = (e) => e.flat().find((t) => t.endsWith("cell")), Ee = (e) => e.flat().reverse().find((t) => t.endsWith("cell")), be = (e, t) => e[t][0], ge = (e, t) => Array.from(e[t]).reverse()[0],
|
|
143
|
+
}, ne = (e) => e.flat().find((t) => t.endsWith("cell")), Ee = (e) => e.flat().reverse().find((t) => t.endsWith("cell")), be = (e, t) => e[t][0], ge = (e, t) => Array.from(e[t]).reverse()[0], oe = (e) => e ? `${e}${p}` : "", Ne = (e, t, r) => {
|
|
144
144
|
let n;
|
|
145
145
|
if (e != null && e.prevNavigationIndexes) {
|
|
146
|
-
const [
|
|
147
|
-
(s == null ? void 0 : s[
|
|
146
|
+
const [o, l] = e.prevNavigationIndexes, s = t[o];
|
|
147
|
+
(s == null ? void 0 : s[l]) === r ? n = e.prevNavigationIndexes : n = E(t, r);
|
|
148
148
|
} else
|
|
149
149
|
n = E(t, r);
|
|
150
150
|
return n;
|
|
151
|
-
},
|
|
151
|
+
}, le = (e) => {
|
|
152
152
|
var t;
|
|
153
153
|
return ((t = D(e)) == null ? void 0 : t.getAttribute("data-keyboardnavid")) || e.getAttribute("data-keyboardnavid");
|
|
154
154
|
}, se = (e) => e.closest(".k-grid-stack-cell"), x = (e) => B(e, { focusable: !0 }), ce = (e, t) => {
|
|
155
|
-
var
|
|
155
|
+
var l;
|
|
156
156
|
const r = e.closest(".k-table-td");
|
|
157
157
|
if (!r)
|
|
158
158
|
return null;
|
|
159
|
-
const n = Array.from(r.querySelectorAll(".k-grid-stack-cell")),
|
|
160
|
-
return
|
|
159
|
+
const n = Array.from(r.querySelectorAll(".k-grid-stack-cell")), o = n.indexOf(e);
|
|
160
|
+
return o === -1 ? null : t === "next" ? o < n.length - 1 ? n[o + 1] : n[0] : o > 0 ? n[o - 1] : (l = n.at(-1)) != null ? l : null;
|
|
161
161
|
}, ue = (e) => e.closest(".k-table-td, td.k-table-td[tabindex]"), ae = (e, t = 0) => {
|
|
162
162
|
const r = x(e);
|
|
163
163
|
r.length > 0 ? (r[t] || r[0]).focus() : e.focus();
|
|
@@ -183,7 +183,7 @@ const U = async (e) => {
|
|
|
183
183
|
findNextIdByCellIndex: d,
|
|
184
184
|
findId: E,
|
|
185
185
|
getNextNavigationIndex: re,
|
|
186
|
-
getFilterColumnId:
|
|
186
|
+
getFilterColumnId: oe,
|
|
187
187
|
focusFirstDataElement: z,
|
|
188
188
|
getClosestCancelButton: P,
|
|
189
189
|
getClosestEditButton: U,
|
|
@@ -194,7 +194,7 @@ const U = async (e) => {
|
|
|
194
194
|
waitForElementToBeVisible: y,
|
|
195
195
|
getNextEditableCell: te,
|
|
196
196
|
getPrevEditableCell: ee,
|
|
197
|
-
getClosestCellNavId:
|
|
197
|
+
getClosestCellNavId: le,
|
|
198
198
|
getStackedCellWrapper: se,
|
|
199
199
|
getStackedCellFocusableElements: x,
|
|
200
200
|
getNextStackedCell: ce,
|
|
@@ -214,12 +214,12 @@ export {
|
|
|
214
214
|
W as getBodyElement,
|
|
215
215
|
X as getBottomPinnedElement,
|
|
216
216
|
P as getClosestCancelButton,
|
|
217
|
-
|
|
217
|
+
le as getClosestCellNavId,
|
|
218
218
|
U as getClosestEditButton,
|
|
219
219
|
D as getClosestNavigatableElement,
|
|
220
220
|
K as getClosestScope,
|
|
221
221
|
Ne as getCurrentIdIndexes,
|
|
222
|
-
|
|
222
|
+
oe as getFilterColumnId,
|
|
223
223
|
ne as getFirstDataCell,
|
|
224
224
|
be as getFirstRowDataCell,
|
|
225
225
|
B as getFocusableElements,
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-data-tools",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-data-tools",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1784546352,version:"9.1.0",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "9.1.0
|
|
13
|
+
publishDate: 1784546352,
|
|
14
|
+
version: "9.1.0",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-data-tools",
|
|
3
|
-
"version": "9.1.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@progress/kendo-data-query": "^1.7.0",
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-vue-animation": "9.1.0
|
|
30
|
-
"@progress/kendo-vue-buttons": "9.1.0
|
|
31
|
-
"@progress/kendo-vue-common": "9.1.0
|
|
32
|
-
"@progress/kendo-vue-dateinputs": "9.1.0
|
|
33
|
-
"@progress/kendo-vue-dropdowns": "9.1.0
|
|
34
|
-
"@progress/kendo-vue-inputs": "9.1.0
|
|
35
|
-
"@progress/kendo-vue-intl": "9.1.0
|
|
36
|
-
"@progress/kendo-vue-popup": "9.1.0
|
|
29
|
+
"@progress/kendo-vue-animation": "9.1.0",
|
|
30
|
+
"@progress/kendo-vue-buttons": "9.1.0",
|
|
31
|
+
"@progress/kendo-vue-common": "9.1.0",
|
|
32
|
+
"@progress/kendo-vue-dateinputs": "9.1.0",
|
|
33
|
+
"@progress/kendo-vue-dropdowns": "9.1.0",
|
|
34
|
+
"@progress/kendo-vue-inputs": "9.1.0",
|
|
35
|
+
"@progress/kendo-vue-intl": "9.1.0",
|
|
36
|
+
"@progress/kendo-vue-popup": "9.1.0",
|
|
37
37
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
38
38
|
"vue": "^3.0.2"
|
|
39
39
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"package": {
|
|
55
55
|
"productName": "Kendo UI for Vue",
|
|
56
56
|
"productCode": "KENDOUIVUE",
|
|
57
|
-
"publishDate":
|
|
57
|
+
"publishDate": 1784546352,
|
|
58
58
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
59
59
|
}
|
|
60
60
|
},
|
package/utils/data-operations.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@progress/kendo-data-query");function o(r,t
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@progress/kendo-data-query");function o(r,n,t){return t?{...r,[n]:t.length?[...t]:void 0}:r&&r[n]?[...r[n]]:[]}function u(r,n,t){if(r[t]){let e=o(r,t,g.orderBy(o(r,t),n)),i=o(e,t).map(l=>u(l,n,t));return{...e,[t]:i}}return r}function S(r,n,t){let e=g.orderBy(r,n);return e=e.map(i=>u(i,n,t)),e}function c(r,n,t){let e=o(r,t);if(e&&e.length){e=e.map(f=>c(f,n,t));const l={filters:[{filters:n,logic:"and"},{operator:f=>!!(f[t]||[]).length}],logic:"or"},y=g.filterBy(e,l);return o(r,t,y)}return r}function h(r,n,t){let e={[t]:[...r]};return e=c(e,n,t),e[t]||[]}const B=(r,n)=>({...r,filters:r.filters.map(t=>({...t,value:n}))}),p=r=>{var n;return(n=r==null?void 0:r.filters)!=null&&n.length&&r.filters[0].value||""},v=(r,n)=>{if(n&&!r)return n;if(r&&!n)return r;if(r&&n)return{logic:"and",filters:[r,n]}};exports.combineFilters=v;exports.filterBy=h;exports.getSearchFromString=B;exports.getStringFromSearch=p;exports.orderBy=S;
|
|
@@ -6,51 +6,54 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { orderBy as g, filterBy as B } from "@progress/kendo-data-query";
|
|
9
|
-
function l(r,
|
|
10
|
-
return
|
|
9
|
+
function l(r, n, t) {
|
|
10
|
+
return t ? { ...r, [n]: t.length ? [...t] : void 0 } : r && r[n] ? [...r[n]] : [];
|
|
11
11
|
}
|
|
12
|
-
function u(r,
|
|
13
|
-
if (r[
|
|
14
|
-
let o = l(r,
|
|
15
|
-
return { ...o, [
|
|
12
|
+
function u(r, n, t) {
|
|
13
|
+
if (r[t]) {
|
|
14
|
+
let o = l(r, t, g(l(r, t), n)), i = l(o, t).map((e) => u(e, n, t));
|
|
15
|
+
return { ...o, [t]: i };
|
|
16
16
|
}
|
|
17
17
|
return r;
|
|
18
18
|
}
|
|
19
|
-
function y(r,
|
|
20
|
-
let o = g(r,
|
|
21
|
-
return o = o.map((i) => u(i,
|
|
19
|
+
function y(r, n, t) {
|
|
20
|
+
let o = g(r, n);
|
|
21
|
+
return o = o.map((i) => u(i, n, t)), o;
|
|
22
22
|
}
|
|
23
|
-
function c(r,
|
|
24
|
-
let o = l(r,
|
|
23
|
+
function c(r, n, t) {
|
|
24
|
+
let o = l(r, t);
|
|
25
25
|
if (o && o.length) {
|
|
26
|
-
o = o.map((f) => c(f,
|
|
26
|
+
o = o.map((f) => c(f, n, t));
|
|
27
27
|
const h = B(o, {
|
|
28
28
|
filters: [
|
|
29
|
-
{ filters:
|
|
30
|
-
{ operator: (f) => !!(f[
|
|
29
|
+
{ filters: n, logic: "and" },
|
|
30
|
+
{ operator: (f) => !!(f[t] || []).length }
|
|
31
31
|
],
|
|
32
32
|
logic: "or"
|
|
33
33
|
});
|
|
34
|
-
return l(r,
|
|
34
|
+
return l(r, t, h);
|
|
35
35
|
}
|
|
36
36
|
return r;
|
|
37
37
|
}
|
|
38
|
-
function C(r,
|
|
39
|
-
let o = { [
|
|
40
|
-
return o = c(o,
|
|
38
|
+
function C(r, n, t) {
|
|
39
|
+
let o = { [t]: [...r] };
|
|
40
|
+
return o = c(o, n, t), o[t] || [];
|
|
41
41
|
}
|
|
42
|
-
const S = (r,
|
|
42
|
+
const S = (r, n) => ({
|
|
43
43
|
...r,
|
|
44
|
-
filters: r.filters.map((
|
|
45
|
-
}), v = (r) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
filters: r.filters.map((t) => ({ ...t, value: n }))
|
|
45
|
+
}), v = (r) => {
|
|
46
|
+
var n;
|
|
47
|
+
return (n = r == null ? void 0 : r.filters) != null && n.length && r.filters[0].value || "";
|
|
48
|
+
}, $ = (r, n) => {
|
|
49
|
+
if (n && !r)
|
|
50
|
+
return n;
|
|
51
|
+
if (r && !n)
|
|
49
52
|
return r;
|
|
50
|
-
if (r &&
|
|
53
|
+
if (r && n)
|
|
51
54
|
return {
|
|
52
55
|
logic: "and",
|
|
53
|
-
filters: [r,
|
|
56
|
+
filters: [r, n]
|
|
54
57
|
};
|
|
55
58
|
};
|
|
56
59
|
export {
|