@progress/kendo-react-dropdowns 9.0.0-develop.2 → 9.0.0-develop.20

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/common/List.mjs CHANGED
@@ -7,87 +7,79 @@
7
7
  */
8
8
  "use client";
9
9
  import * as t from "react";
10
- import Q from "./ListItem.mjs";
11
- import T from "./ListGroupItem.mjs";
12
- import { areSame as R, getItemValue as b } from "./utils.mjs";
13
- import { useLocalization as W } from "@progress/kendo-react-intl";
14
- import { nodata as k, messages as X } from "../messages/index.mjs";
15
- import { useUnstyled as Y, classNames as g, uDropDownsBase as p } from "@progress/kendo-react-common";
10
+ import T from "./ListItem.mjs";
11
+ import W from "./ListGroupItem.mjs";
12
+ import { areSame as b, getItemValue as k } from "./utils.mjs";
13
+ import { useLocalization as X } from "@progress/kendo-react-intl";
14
+ import { nodata as B, messages as Y } from "../messages/index.mjs";
15
+ import { useUnstyled as Z, classNames as v, uDropDownsBase as y } from "@progress/kendo-react-common";
16
16
  const le = (e) => {
17
- const B = W(), y = Y(), c = y && y.uDropDownsBase, {
18
- id: L,
19
- show: z,
20
- wrapperCssClass: M,
21
- wrapperStyle: $,
22
- listStyle: x,
23
- listRef: A,
24
- wrapperRef: F,
25
- listClassName: G,
26
- ariaSetSize: V
27
- } = e, D = (() => {
17
+ const L = X(), D = Z(), d = D && D.uDropDownsBase, { id: M, show: z, wrapperCssClass: $, wrapperStyle: x, listStyle: A, listRef: F, wrapperRef: G, listClassName: V, ariaSetSize: H } = e, I = (() => {
28
18
  const {
29
- textField: n,
30
- valueField: l,
31
- groupField: u,
32
- groupMode: s,
33
- isMultiColumn: U,
34
- optionsGuid: I,
35
- skip: S = 0,
36
- virtual: h,
37
- focusedIndex: C,
38
- hasDuplicates: j,
39
- highlightSelected: q = !0,
40
- value: i,
41
- data: E,
42
- itemRender: J,
43
- groupHeaderItemRender: K
44
- } = e, w = Array.isArray(i);
45
- let N = 0;
46
- return E.map((o, r) => {
47
- const m = S + r, f = S + r + N, O = j ? i ? C === r : !1 : o.disabled ? !1 : q && (!w && R(o, i, l) || w && i.findIndex((P) => R(P, o, l)) !== -1);
48
- let a, d, v;
49
- return r > 0 && u !== void 0 && (d = b(o, u), v = b(E[r - 1], u), d && v && d !== v && (a = d)), a !== void 0 && s === "modern" && (N += 1), [
50
- a !== void 0 && s === "modern" && /* @__PURE__ */ t.createElement(
51
- T,
19
+ textField: s,
20
+ valueField: a,
21
+ groupField: c,
22
+ groupMode: S,
23
+ isMultiColumn: j,
24
+ optionsGuid: h,
25
+ skip: C = 0,
26
+ virtual: E,
27
+ focusedIndex: w,
28
+ hasDuplicates: q,
29
+ highlightSelected: J = !0,
30
+ value: l,
31
+ data: N,
32
+ itemRender: K,
33
+ groupHeaderItemRender: O
34
+ } = e, R = Array.isArray(l);
35
+ let u = 0;
36
+ return N.map((r, o) => {
37
+ const m = C + o, f = C + o + u, P = q ? l ? w === o : !1 : r.disabled ? !1 : J && (!R && b(r, l, a) || R && l.findIndex((Q) => b(Q, r, a)) !== -1);
38
+ let n, i, g;
39
+ o > 0 && c !== void 0 && (i = k(r, c), g = k(N[o - 1], c), i && g && i !== g && (n = i));
40
+ const p = n !== void 0 && S === "modern";
41
+ return p ? u += 1 : u = 0, [
42
+ p && /* @__PURE__ */ t.createElement(
43
+ W,
52
44
  {
53
- id: `option-${I}-${f}`,
54
- virtual: h,
45
+ id: `option-${h}-${f}`,
46
+ virtual: E,
55
47
  key: m + "-group-item",
56
- group: a,
57
- isMultiColumn: U,
58
- render: K
48
+ group: n,
49
+ isMultiColumn: j,
50
+ render: O
59
51
  }
60
52
  ),
61
53
  /* @__PURE__ */ t.createElement(
62
- Q,
54
+ T,
63
55
  {
64
- id: `option-${I}-${a !== void 0 && s === "modern" ? f + 1 : f}`,
65
- virtual: h,
66
- dataItem: o,
67
- groupMode: s,
68
- selected: O,
69
- focused: C === r,
56
+ id: `option-${h}-${p ? f + 1 : f}`,
57
+ virtual: E,
58
+ dataItem: r,
59
+ groupMode: S,
60
+ selected: P,
61
+ focused: w === o,
70
62
  index: m,
71
63
  key: m,
72
64
  onClick: e.onClick,
73
- textField: n,
74
- group: a,
75
- render: J,
76
- disabled: o.disabled
65
+ textField: s,
66
+ group: n,
67
+ render: K,
68
+ disabled: r.disabled
77
69
  }
78
70
  )
79
71
  ];
80
72
  });
81
- })(), H = () => {
82
- const n = e.noDataRender, l = /* @__PURE__ */ t.createElement("div", { className: g(p.noData({ c })) }, /* @__PURE__ */ t.createElement("div", null, B.toLanguageString(k, X[k])));
83
- return n ? n.call(void 0, l) : l;
73
+ })(), U = () => {
74
+ const s = e.noDataRender, a = /* @__PURE__ */ t.createElement("div", { className: v(y.noData({ c: d })) }, /* @__PURE__ */ t.createElement("div", null, L.toLanguageString(B, Y[B])));
75
+ return s ? s.call(void 0, a) : a;
84
76
  };
85
- return D.length ? /* @__PURE__ */ t.createElement(
77
+ return I.length ? /* @__PURE__ */ t.createElement(
86
78
  "div",
87
79
  {
88
- className: M,
89
- style: $,
90
- ref: F,
80
+ className: $,
81
+ style: x,
82
+ ref: G,
91
83
  onMouseDown: e.onMouseDown,
92
84
  onBlur: e.onBlur,
93
85
  onScroll: e.onScroll,
@@ -96,18 +88,18 @@ const le = (e) => {
96
88
  /* @__PURE__ */ t.createElement(
97
89
  "ul",
98
90
  {
99
- id: L,
91
+ id: M,
100
92
  role: "listbox",
101
93
  "aria-hidden": z ? void 0 : !0,
102
- "aria-setsize": V,
103
- className: G || g(p.ul({ c })),
104
- ref: A,
105
- style: x
94
+ "aria-setsize": H,
95
+ className: V || v(y.ul({ c: d })),
96
+ ref: F,
97
+ style: A
106
98
  },
107
- D
99
+ I
108
100
  ),
109
- e.scroller && /* @__PURE__ */ t.createElement("div", { className: g(p.heightContainer({ c })) }, e.scroller)
110
- ) : H();
101
+ e.scroller && /* @__PURE__ */ t.createElement("div", { className: v(y.heightContainer({ c: d })) }, e.scroller)
102
+ ) : U();
111
103
  };
112
104
  export {
113
105
  le as default
@@ -9,13 +9,7 @@
9
9
  import * as s from "react";
10
10
  import { Popup as c } from "@progress/kendo-react-popup";
11
11
  const a = (e) => {
12
- const {
13
- children: n,
14
- width: o,
15
- dir: i,
16
- itemsCount: t,
17
- popupSettings: r
18
- } = e;
12
+ const { children: n, width: o, dir: i, itemsCount: t, popupSettings: r } = e;
19
13
  return /* @__PURE__ */ s.createElement(
20
14
  c,
21
15
  {
@@ -10,11 +10,7 @@ import * as a from "react";
10
10
  import { useUnstyled as c, classNames as u, uDropDownsBase as r } from "@progress/kendo-react-common";
11
11
  import { getItemValue as i } from "./utils.mjs";
12
12
  const m = (e) => e.preventDefault(), p = (e) => {
13
- const {
14
- selected: s,
15
- defaultItem: o,
16
- textField: n
17
- } = e, t = c(), l = t && t.uDropDownsBase;
13
+ const { selected: s, defaultItem: o, textField: n } = e, t = c(), l = t && t.uDropDownsBase;
18
14
  return /* @__PURE__ */ a.createElement(
19
15
  "div",
20
16
  {
@@ -13,11 +13,15 @@ import { searchIcon as g } from "@progress/kendo-svg-icons";
13
13
  import { useUnstyled as h, classNames as l, uDropDownsBase as a, IconWrap as D } from "@progress/kendo-react-common";
14
14
  const u = n.forwardRef((r, c) => {
15
15
  const o = n.useRef(null), { renderListFilterWrapper: m = !1, renderPrefixSeparator: d = !1, ...f } = r, s = h(), t = s && s.uDropDownsBase;
16
- n.useImperativeHandle(
17
- c,
18
- () => o.current
19
- );
20
- const p = () => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(b, null, /* @__PURE__ */ n.createElement(D, { name: "search", icon: g, className: l(a.inputIcon({ c: t })) })), d && /* @__PURE__ */ n.createElement(I, null)), i = /* @__PURE__ */ n.createElement(
16
+ n.useImperativeHandle(c, () => o.current);
17
+ const p = () => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(b, null, /* @__PURE__ */ n.createElement(
18
+ D,
19
+ {
20
+ name: "search",
21
+ icon: g,
22
+ className: l(a.inputIcon({ c: t }))
23
+ }
24
+ )), d && /* @__PURE__ */ n.createElement(I, null)), i = /* @__PURE__ */ n.createElement(
21
25
  y,
22
26
  {
23
27
  ...f,
@@ -9,13 +9,7 @@
9
9
  import { useUnstyled as d, classNames as i, uDropDownsBase as l } from "@progress/kendo-react-common";
10
10
  import * as n from "react";
11
11
  const g = (t) => {
12
- const {
13
- group: u,
14
- virtual: c,
15
- render: e,
16
- isMultiColumn: s = !1,
17
- id: m
18
- } = t, o = d(), r = o && o.uDropDownsBase, a = /* @__PURE__ */ n.createElement(
12
+ const { group: u, virtual: c, render: e, isMultiColumn: s = !1, id: m } = t, o = d(), r = o && o.uDropDownsBase, a = /* @__PURE__ */ n.createElement(
19
13
  "li",
20
14
  {
21
15
  id: m,
@@ -23,7 +17,13 @@ const g = (t) => {
23
17
  className: i(l.groupLi({ c: r, isMultiColumn: s })),
24
18
  style: s ? { boxSizing: "inherit" } : { position: c ? "relative" : "unset" }
25
19
  },
26
- /* @__PURE__ */ n.createElement("span", { className: e ? void 0 : i(l.groupItemText({ c: r, isMultiColumn: s })) }, u)
20
+ /* @__PURE__ */ n.createElement(
21
+ "span",
22
+ {
23
+ className: e ? void 0 : i(l.groupItemText({ c: r, isMultiColumn: s }))
24
+ },
25
+ u
26
+ )
27
27
  );
28
28
  return e !== void 0 ? e.call(void 0, a, t) : a;
29
29
  };
@@ -10,30 +10,22 @@ import * as a from "react";
10
10
  import { useUnstyled as B, classNames as l, uDropDownsBase as i } from "@progress/kendo-react-common";
11
11
  import { getItemValue as C } from "./utils.mjs";
12
12
  const b = (e) => {
13
- const {
14
- selected: o,
15
- group: t,
16
- dataItem: u,
17
- virtual: v,
18
- groupMode: c,
19
- disabled: n,
20
- id: f,
21
- focused: g,
22
- render: r
23
- } = e, d = B(), s = d && d.uDropDownsBase, p = (x) => e.onClick(e.index, x), m = /* @__PURE__ */ a.createElement(
13
+ const { selected: o, group: t, dataItem: u, virtual: v, groupMode: c, disabled: n, id: f, focused: g, render: r } = e, d = B(), s = d && d.uDropDownsBase, p = (x) => e.onClick(e.index, x), m = /* @__PURE__ */ a.createElement(
24
14
  "li",
25
15
  {
26
16
  id: f,
27
17
  role: "option",
28
18
  "aria-selected": o,
29
19
  "aria-disabled": n ? !0 : void 0,
30
- className: l(i.li({
31
- c: s,
32
- selected: o,
33
- focused: g,
34
- first: !!t && c === "classic",
35
- disabled: n
36
- })),
20
+ className: l(
21
+ i.li({
22
+ c: s,
23
+ selected: o,
24
+ focused: g,
25
+ first: !!t && c === "classic",
26
+ disabled: n
27
+ })
28
+ ),
37
29
  onClick: p,
38
30
  style: { position: v ? "relative" : "unset" }
39
31
  },
@@ -14,12 +14,9 @@ const r = (t) => /* @__PURE__ */ l.createElement(
14
14
  {
15
15
  ...t,
16
16
  wrapperCssClass: "k-table-body k-table-scroller",
17
- listClassName: s(
18
- "k-table k-table-list",
19
- {
20
- "k-virtual-table": t.virtual !== void 0
21
- }
22
- ),
17
+ listClassName: s("k-table k-table-list", {
18
+ "k-virtual-table": t.virtual !== void 0
19
+ }),
23
20
  listStyle: { ...t.listStyle }
24
21
  }
25
22
  );
@@ -12,9 +12,19 @@ class o {
12
12
  navigate(e) {
13
13
  const t = e.keyCode;
14
14
  if (t === n.up || t === n.left)
15
- return this.next({ current: e.current, min: e.min, max: e.max, step: e.skipItems ? e.skipItems : -1 });
15
+ return this.next({
16
+ current: e.current,
17
+ min: e.min,
18
+ max: e.max,
19
+ step: e.skipItems ? e.skipItems : -1
20
+ });
16
21
  if (t === n.down || t === n.right)
17
- return this.next({ current: e.current, min: e.min, max: e.max, step: e.skipItems ? e.skipItems : 1 });
22
+ return this.next({
23
+ current: e.current,
24
+ min: e.min,
25
+ max: e.max,
26
+ step: e.skipItems ? e.skipItems : 1
27
+ });
18
28
  if (t === n.home)
19
29
  return 0;
20
30
  if (t === n.end)
package/common/utils.mjs CHANGED
@@ -89,7 +89,9 @@ const l = (e) => e != null, d = (e, t) => {
89
89
  }, S = (e) => {
90
90
  e.target.nodeName !== "INPUT" && e.preventDefault();
91
91
  }, y = (e, t, r) => !!e != !!t || e.text !== t.text ? !1 : e === t || a(e.data, t.data, r), N = (e) => {
92
- const t = e.filter((r, n) => e.some((s, o) => s === r && o !== n));
92
+ const t = e.filter(
93
+ (r, n) => e.some((s, o) => s === r && o !== n)
94
+ );
93
95
  return Array.from(new Set(t));
94
96
  }, O = (e) => {
95
97
  const { data: t = [], groupField: r } = e;