@progress/kendo-react-dropdowns 8.2.0-develop.39 → 8.2.0-develop.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +216 -218
- package/common/utils.js +1 -1
- package/common/utils.mjs +25 -21
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
package/common/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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=e=>e!=null,
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=e=>e!=null,d=(e,t)=>{for(let r=0;r<e.length;r++)if(e.charAt(r)!==t)return!1;return!0},I=(e,t,r)=>{let n=e;return r&&(n=[r].concat(n)),n.slice(t).concat(n.slice(0,t))},m=(e,t,r)=>{if(!f(e))return!1;let n=String(e);return r&&(n=n.toLowerCase()),n.indexOf(t)===0},D=(e,t,r,n,s)=>{const o=e.offsetHeight,h=t.children.item(r),i=h.offsetTop+(s?n-e.scrollTop:0),u=h.offsetHeight;if(s){let l=0;i+u>o?l=i+u-o:i<0&&(l=i),l!==0?e.scrollTop+=l:e.scrollTop===0&&n!==0&&(e.scrollTop=n)}else i+u>o+e.scrollTop?e.scrollTop=i+u-o:i<e.scrollTop&&(e.scrollTop-=e.scrollTop-i)},a=(e,t,r)=>{let n=-1;if(t){t=t.toLowerCase();for(let s=0;s<e.length;s++){const o=(c(e[s],r)||"")+"";if(o&&o.toLowerCase().startsWith(t)){n=s;break}}}return n},p=(e,t,r,n=!1)=>{const s=o=>n?o:o.toLowerCase();return e.findIndex(o=>r?s(c(o,r))===s(t):s(t)===s(o.toString()))},c=(e,t)=>{if(t&&f(e)){const r=t.split(".");let n=e;return r.forEach(s=>{n=n?n[s]:void 0}),n}return e},x=(e,t,r)=>{if(!e)return;const n=e.findIndex(s=>c(s,t)===r);return e[n]},T=(e=[],t=[],r)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!g(e[n],t[n],r))return!1;return!0},C=(e,t,r)=>{t.forEach(n=>{const s=e.findIndex(o=>g(o,n,r));s!==-1&&e.splice(s,1)})},g=(e,t,r)=>e===t||f(e)===f(t)&&c(e,r)===c(t,r),y=(e,t,r)=>{if(t){const n=p(e,t,r,!0);return n!==-1?e[n]:e[a(e,t,r)]}return e[0]},S=(e,t=[],r)=>{let n="";if(e){const s=t[a(t,e,r)];if(s){const o=c(s,r);e.toLowerCase()!==o.toLowerCase()&&(n=o.substring(e.length))}}return n},w=e=>{e.target.nodeName!=="INPUT"&&e.preventDefault()},L=(e,t,r)=>!!e!=!!t||e.text!==t.text?!1:e===t||T(e.data,t.data,r),P=e=>{const t=e.filter((r,n)=>e.some((s,o)=>s===r&&o!==n));return Array.from(new Set(t))},V=e=>{const{data:t=[],groupField:r}=e;return r?t.filter(n=>r&&n[r]!==void 0):t};exports.areSame=g;exports.findByFieldValue=x;exports.getFilteredData=V;exports.getFocusedItem=y;exports.getItemIndexByText=p;exports.getItemValue=c;exports.getPlainDataDuplicates=P;exports.isPresent=f;exports.itemIndexStartsWith=a;exports.matchDataCollections=T;exports.matchTags=L;exports.matchText=m;exports.preventDefaultNonInputs=w;exports.removeDataItems=C;exports.sameCharsOnly=d;exports.scrollToItem=D;exports.shuffleData=I;exports.suggestValue=S;
|
package/common/utils.mjs
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
const l = (e) => e != null,
|
|
9
|
+
const l = (e) => e != null, d = (e, t) => {
|
|
10
10
|
for (let r = 0; r < e.length; r++)
|
|
11
11
|
if (e.charAt(r) !== t)
|
|
12
12
|
return !1;
|
|
13
13
|
return !0;
|
|
14
|
-
},
|
|
14
|
+
}, I = (e, t, r) => {
|
|
15
15
|
let n = e;
|
|
16
16
|
return r && (n = [r].concat(n)), n.slice(t).concat(n.slice(0, t));
|
|
17
17
|
}, x = (e, t, r) => {
|
|
@@ -20,18 +20,18 @@ const l = (e) => e != null, a = (e, t) => {
|
|
|
20
20
|
let n = String(e);
|
|
21
21
|
return r && (n = n.toLowerCase()), n.indexOf(t) === 0;
|
|
22
22
|
}, C = (e, t, r, n, s) => {
|
|
23
|
-
const o = e.offsetHeight, g = t.children.item(r),
|
|
23
|
+
const o = e.offsetHeight, g = t.children.item(r), i = g.offsetTop + (s ? n - e.scrollTop : 0), c = g.offsetHeight;
|
|
24
24
|
if (s) {
|
|
25
25
|
let u = 0;
|
|
26
|
-
|
|
26
|
+
i + c > o ? u = i + c - o : i < 0 && (u = i), u !== 0 ? e.scrollTop += u : e.scrollTop === 0 && n !== 0 && (e.scrollTop = n);
|
|
27
27
|
} else
|
|
28
|
-
|
|
28
|
+
i + c > o + e.scrollTop ? e.scrollTop = i + c - o : i < e.scrollTop && (e.scrollTop -= e.scrollTop - i);
|
|
29
29
|
}, h = (e, t, r) => {
|
|
30
30
|
let n = -1;
|
|
31
31
|
if (t) {
|
|
32
32
|
t = t.toLowerCase();
|
|
33
33
|
for (let s = 0; s < e.length; s++) {
|
|
34
|
-
const o = (
|
|
34
|
+
const o = (f(e[s], r) || "") + "";
|
|
35
35
|
if (o && o.toLowerCase().startsWith(t)) {
|
|
36
36
|
n = s;
|
|
37
37
|
break;
|
|
@@ -41,8 +41,8 @@ const l = (e) => e != null, a = (e, t) => {
|
|
|
41
41
|
return n;
|
|
42
42
|
}, T = (e, t, r, n = !1) => {
|
|
43
43
|
const s = (o) => n ? o : o.toLowerCase();
|
|
44
|
-
return e.findIndex((o) => r ? s(
|
|
45
|
-
},
|
|
44
|
+
return e.findIndex((o) => r ? s(f(o, r)) === s(t) : s(t) === s(o.toString()));
|
|
45
|
+
}, f = (e, t) => {
|
|
46
46
|
if (t && l(e)) {
|
|
47
47
|
const r = t.split(".");
|
|
48
48
|
let n = e;
|
|
@@ -51,12 +51,12 @@ const l = (e) => e != null, a = (e, t) => {
|
|
|
51
51
|
}), n;
|
|
52
52
|
}
|
|
53
53
|
return e;
|
|
54
|
-
},
|
|
54
|
+
}, D = (e, t, r) => {
|
|
55
55
|
if (!e)
|
|
56
56
|
return;
|
|
57
|
-
const n = e.findIndex((s) =>
|
|
57
|
+
const n = e.findIndex((s) => f(s, t) === r);
|
|
58
58
|
return e[n];
|
|
59
|
-
},
|
|
59
|
+
}, a = (e = [], t = [], r) => {
|
|
60
60
|
if (e === t)
|
|
61
61
|
return !0;
|
|
62
62
|
if (e.length !== t.length)
|
|
@@ -65,12 +65,12 @@ const l = (e) => e != null, a = (e, t) => {
|
|
|
65
65
|
if (!p(e[n], t[n], r))
|
|
66
66
|
return !1;
|
|
67
67
|
return !0;
|
|
68
|
-
},
|
|
68
|
+
}, w = (e, t, r) => {
|
|
69
69
|
t.forEach((n) => {
|
|
70
70
|
const s = e.findIndex((o) => p(o, n, r));
|
|
71
71
|
s !== -1 && e.splice(s, 1);
|
|
72
72
|
});
|
|
73
|
-
}, p = (e, t, r) => e === t || l(e) === l(t) &&
|
|
73
|
+
}, p = (e, t, r) => e === t || l(e) === l(t) && f(e, r) === f(t, r), L = (e, t, r) => {
|
|
74
74
|
if (t) {
|
|
75
75
|
const n = T(e, t, r, !0);
|
|
76
76
|
return n !== -1 ? e[n] : e[h(e, t, r)];
|
|
@@ -81,33 +81,37 @@ const l = (e) => e != null, a = (e, t) => {
|
|
|
81
81
|
if (e) {
|
|
82
82
|
const s = t[h(t, e, r)];
|
|
83
83
|
if (s) {
|
|
84
|
-
const o =
|
|
84
|
+
const o = f(s, r);
|
|
85
85
|
e.toLowerCase() !== o.toLowerCase() && (n = o.substring(e.length));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return n;
|
|
89
89
|
}, S = (e) => {
|
|
90
90
|
e.target.nodeName !== "INPUT" && e.preventDefault();
|
|
91
|
-
}, y = (e, t, r) => !!e != !!t || e.text !== t.text ? !1 : e === t ||
|
|
91
|
+
}, y = (e, t, r) => !!e != !!t || e.text !== t.text ? !1 : e === t || a(e.data, t.data, r), N = (e) => {
|
|
92
92
|
const t = e.filter((r, n) => e.some((s, o) => s === r && o !== n));
|
|
93
93
|
return Array.from(new Set(t));
|
|
94
|
+
}, O = (e) => {
|
|
95
|
+
const { data: t = [], groupField: r } = e;
|
|
96
|
+
return r ? t.filter((n) => r && n[r] !== void 0) : t;
|
|
94
97
|
};
|
|
95
98
|
export {
|
|
96
99
|
p as areSame,
|
|
97
|
-
|
|
100
|
+
D as findByFieldValue,
|
|
101
|
+
O as getFilteredData,
|
|
98
102
|
L as getFocusedItem,
|
|
99
103
|
T as getItemIndexByText,
|
|
100
|
-
|
|
104
|
+
f as getItemValue,
|
|
101
105
|
N as getPlainDataDuplicates,
|
|
102
106
|
l as isPresent,
|
|
103
107
|
h as itemIndexStartsWith,
|
|
104
|
-
|
|
108
|
+
a as matchDataCollections,
|
|
105
109
|
y as matchTags,
|
|
106
110
|
x as matchText,
|
|
107
111
|
S as preventDefaultNonInputs,
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
w as removeDataItems,
|
|
113
|
+
d as sameCharsOnly,
|
|
110
114
|
C as scrollToItem,
|
|
111
|
-
|
|
115
|
+
I as shuffleData,
|
|
112
116
|
H as suggestValue
|
|
113
117
|
};
|