@progress/kendo-react-dropdowns 8.2.0-develop.3 → 8.2.0-develop.31

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.
@@ -8,29 +8,28 @@
8
8
  "use client";
9
9
  import * as e from "react";
10
10
  import se from "prop-types";
11
- import { PopupPropsContext as ue } from "@progress/kendo-react-popup";
12
- import { MultiColumnList as ie } from "../common/MultiColumnList.mjs";
13
- import { createPropsContext as de, usePropsContext as ce, getScrollbarWidth as pe, getter as P, classNames as G, setScrollbarWidth as me } from "@progress/kendo-react-common";
14
- import { ComboBox as fe, ComboBoxWithoutContext as ge } from "../ComboBox/ComboBox.mjs";
15
- import { getItemValue as he } from "../common/utils.mjs";
16
- import T from "../common/withCustomComponent.mjs";
17
- const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W = e.forwardRef((u, h) => {
18
- const t = ce(ke, u), C = e.useRef(null), a = e.useRef(null), x = pe(), {
11
+ import { MultiColumnList as ue } from "../common/MultiColumnList.mjs";
12
+ import { createPropsContext as ie, usePropsContext as de, getScrollbarWidth as ce, getter as T, classNames as x, setScrollbarWidth as pe } from "@progress/kendo-react-common";
13
+ import { ComboBox as me, ComboBoxWithoutContext as fe } from "../ComboBox/ComboBox.mjs";
14
+ import { getItemValue as ge } from "../common/utils.mjs";
15
+ import W from "../common/withCustomComponent.mjs";
16
+ const he = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, Ce = ie(), P = e.forwardRef((u, h) => {
17
+ const t = de(Ce, u), C = e.useRef(null), a = e.useRef(null), y = ce(), {
19
18
  columns: n = s.columns,
20
19
  popupSettings: p = s.popupSettings,
21
20
  size: z = s.size,
22
21
  rounded: O = s.rounded,
23
- fillMode: $ = s.fillMode,
24
- className: L,
22
+ fillMode: L = s.fillMode,
23
+ className: $,
25
24
  prefix: j = void 0,
26
25
  suffix: V = void 0,
27
- onOpen: y,
28
- onClose: w,
29
- onFocus: E,
30
- onBlur: F,
31
- onChange: H,
32
- onFilterChange: N,
33
- onPageChange: S,
26
+ onOpen: w,
27
+ onClose: E,
28
+ onFocus: F,
29
+ onBlur: H,
30
+ onChange: N,
31
+ onFilterChange: S,
32
+ onPageChange: M,
34
33
  ...A
35
34
  } = t;
36
35
  e.useImperativeHandle(C, () => ({
@@ -49,10 +48,10 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
49
48
  const c = e.useMemo(
50
49
  () => {
51
50
  if (t.groupField !== void 0 && t.data)
52
- return he(t.data[0], t.groupField);
51
+ return ge(t.data[0], t.groupField);
53
52
  },
54
53
  [t.data, t.groupField]
55
- ), [k, m] = e.useState(c), [M, R] = e.useState(!0), [D] = j ? T(t.prefix || e.Fragment) : [], [J] = V ? T(t.suffix || e.Fragment) : [], Q = e.useMemo(
54
+ ), [k, m] = e.useState(c), [R, B] = e.useState(!0), [D] = j ? W(t.prefix || e.Fragment) : [], [J] = V ? W(t.suffix || e.Fragment) : [], Q = e.useMemo(
56
55
  () => {
57
56
  const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: n.length }, k);
58
57
  return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, n.map(
@@ -63,16 +62,16 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
63
62
  style: { width: o.width ? o.width : s.width }
64
63
  }
65
64
  )
66
- )), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, i) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : i }, o.header || " "))), k && M && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
65
+ )), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, i) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : i }, o.header || " "))), k && R && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
67
66
  },
68
- [t.header, n, k, M]
67
+ [t.header, n, k, R]
69
68
  ), U = e.useMemo(
70
69
  () => (
71
70
  // These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
72
- `calc(${n.map((r) => Ce(r.width, s.width)).filter(Boolean).join(" + ")} + ${x}px + 4px)`
71
+ `calc(${n.map((r) => he(r.width, s.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`
73
72
  ),
74
- [n, x]
75
- ), B = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
73
+ [n, y]
74
+ ), q = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
76
75
  (r, o) => {
77
76
  const i = n.map((d, le) => /* @__PURE__ */ e.createElement(
78
77
  "span",
@@ -81,14 +80,14 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
81
80
  style: t.itemRender ? void 0 : { width: d.width ? d.width : s.width },
82
81
  key: d.uniqueKey ? d.uniqueKey : le
83
82
  },
84
- d.field ? String(P(d.field)(o.dataItem)) : ""
83
+ d.field ? String(T(d.field)(o.dataItem)) : ""
85
84
  ));
86
- let f, g, b, v, q = t.data || [];
87
- const I = o.index - B;
88
- t.groupField !== void 0 && (v = P(t.groupField), g = v(q[I]), b = v(q[I - 1]), g && b && g !== b && (f = g)), f && t.groupMode === "classic" && i.push(/* @__PURE__ */ e.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ e.createElement("span", null, f)));
89
- const K = e.cloneElement(r, {
85
+ let f, g, b, v, I = t.data || [];
86
+ const K = o.index - q;
87
+ t.groupField !== void 0 && (v = T(t.groupField), g = v(I[K]), b = v(I[K - 1]), g && b && g !== b && (f = g)), f && t.groupMode === "classic" && i.push(/* @__PURE__ */ e.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ e.createElement("span", null, f)));
88
+ const G = e.cloneElement(r, {
90
89
  ...r.props,
91
- className: G("k-table-row", {
90
+ className: x("k-table-row", {
92
91
  "k-table-alt-row": o.index % 2 !== 0,
93
92
  "k-focus": o.focused,
94
93
  "k-selected": o.selected,
@@ -96,9 +95,9 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
96
95
  "k-disabled": o.dataItem.disabled
97
96
  })
98
97
  }, i);
99
- return t.itemRender ? t.itemRender.call(void 0, K, o) : K;
98
+ return t.itemRender ? t.itemRender.call(void 0, G, o) : G;
100
99
  },
101
- [n, t.groupField, t.itemRender, t.data, B]
100
+ [n, t.groupField, t.itemRender, t.data, q]
102
101
  ), l = e.useCallback(
103
102
  (r, o) => {
104
103
  r && r.call(void 0, {
@@ -107,69 +106,64 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
107
106
  });
108
107
  },
109
108
  []
110
- ), Y = e.useCallback((r) => (t.virtual || m(c), l(y, r)), [l, y, t.virtual, c]), Z = e.useCallback((r) => l(w, r), [w]), _ = e.useCallback((r) => l(E, r), [E]), ee = e.useCallback((r) => l(F, r), [F]), te = e.useCallback((r) => l(H, r), [H]), re = e.useCallback((r) => l(S, r), [S]), oe = e.useCallback((r) => (m(c), l(N, {
109
+ ), Y = e.useCallback((r) => (t.virtual || m(c), l(w, r)), [l, w, t.virtual, c]), Z = e.useCallback((r) => l(E, r), [E]), _ = e.useCallback((r) => l(F, r), [F]), ee = e.useCallback((r) => l(H, r), [H]), te = e.useCallback((r) => l(N, r), [N]), re = e.useCallback((r) => l(M, r), [M]), oe = e.useCallback((r) => (m(c), l(S, {
111
110
  ...r,
112
111
  mobileMode: r.target.mobileMode
113
- })), [N]), ae = e.useCallback(
112
+ })), [S]), ae = e.useCallback(
114
113
  (r) => {
115
114
  m(r.group);
116
115
  },
117
116
  []
118
117
  );
119
118
  e.useEffect(() => {
120
- me();
119
+ pe();
121
120
  }), e.useEffect(() => {
122
121
  const r = t.data;
123
- m(c), r && r.length !== 0 ? R(!0) : R(!1);
122
+ m(c), r && r.length !== 0 ? B(!0) : B(!1);
124
123
  }, [t.data]);
125
- const ne = e.useCallback((r) => /* @__PURE__ */ e.createElement(ie, { ...r }), []);
124
+ const ne = e.useCallback((r) => /* @__PURE__ */ e.createElement(ue, { ...r }), []);
126
125
  return /* @__PURE__ */ e.createElement(
127
- ue.Provider,
126
+ me,
128
127
  {
129
- value: (r) => ({ ...r, popupClass: `k-dropdowngrid-popup ${p.popupClass}` })
130
- },
131
- /* @__PURE__ */ e.createElement(
132
- fe,
133
- {
134
- ...A,
135
- list: ne,
136
- popupSettings: {
137
- ...p,
138
- width: p.width || U,
139
- className: p.className
140
- },
141
- ref: a,
142
- header: Q,
143
- itemRender: X,
144
- groupHeaderItemRender: t.groupHeaderItemRender,
145
- size: z,
146
- rounded: O,
147
- fillMode: $,
148
- groupMode: t.groupMode,
149
- groupField: t.groupField,
150
- isMultiColumn: !0,
151
- onOpen: Y,
152
- onClose: Z,
153
- onFocus: _,
154
- onBlur: ee,
155
- onChange: te,
156
- onFilterChange: oe,
157
- onPageChange: re,
158
- onGroupScroll: ae,
159
- className: G("k-dropdowngrid", L),
160
- required: t.required,
161
- adaptive: t.adaptive,
162
- adaptiveFilter: t.adaptiveFilter,
163
- adaptiveTitle: t.adaptiveTitle,
164
- footer: t.footer,
165
- footerClassName: "k-table-footer",
166
- prefix: D,
167
- suffix: J
168
- }
169
- )
128
+ ...A,
129
+ list: ne,
130
+ popupSettings: {
131
+ ...p,
132
+ popupClass: x("k-dropdowngrid-popup", p.popupClass),
133
+ width: p.width || U,
134
+ className: p.className
135
+ },
136
+ ref: a,
137
+ header: Q,
138
+ itemRender: X,
139
+ groupHeaderItemRender: t.groupHeaderItemRender,
140
+ size: z,
141
+ rounded: O,
142
+ fillMode: L,
143
+ groupMode: t.groupMode,
144
+ groupField: t.groupField,
145
+ isMultiColumn: !0,
146
+ onOpen: Y,
147
+ onClose: Z,
148
+ onFocus: _,
149
+ onBlur: ee,
150
+ onChange: te,
151
+ onFilterChange: oe,
152
+ onPageChange: re,
153
+ onGroupScroll: ae,
154
+ className: x("k-dropdowngrid", $),
155
+ required: t.required,
156
+ adaptive: t.adaptive,
157
+ adaptiveFilter: t.adaptiveFilter,
158
+ adaptiveTitle: t.adaptiveTitle,
159
+ footer: t.footer,
160
+ footerClassName: "k-table-footer",
161
+ prefix: D,
162
+ suffix: J
163
+ }
170
164
  );
171
- }), be = {
172
- ...ge.propTypes,
165
+ }), ke = {
166
+ ...fe.propTypes,
173
167
  columns: se.any.isRequired
174
168
  }, s = {
175
169
  columns: [],
@@ -179,9 +173,9 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
179
173
  rounded: "medium",
180
174
  fillMode: "solid"
181
175
  };
182
- W.displayName = "KendoMultiColumnComboBox";
183
- W.propTypes = be;
176
+ P.displayName = "KendoMultiColumnComboBox";
177
+ P.propTypes = ke;
184
178
  export {
185
- W as MultiColumnComboBox,
186
- ke as MultiColumnComboBoxPropsContext
179
+ P as MultiColumnComboBox,
180
+ Ce as MultiColumnComboBoxPropsContext
187
181
  };
@@ -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";const u=require("@progress/kendo-react-common"),h=require("react");function g(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const c=g(h);class b extends c.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:i,suggestedText:n,focused:a}=this.props,r=this.input,p=e!==i||n!==s,l=p&&e.startsWith(i)&&!(s&&n&&s.endsWith(n)),d=u.getActiveElement(document);a&&r&&d!==r&&r.focus(),n&&p&&!l&&r&&r.setSelectionRange(i.length-n.length,i.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:i}=this.props,n=c.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:a=>this._input=a,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":e||void 0,disabled:e||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":t,"aria-owns":this.props.owns,"aria-activedescendant":t?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-required":this.props.ariaRequired});return i?i.call(void 0,n):n}}module.exports=b;
8
+ "use client";"use strict";const u=require("@progress/kendo-react-common"),h=require("react");function b(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const c=b(h);class g extends c.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:n,suggestedText:i,focused:o}=this.props,r=this.input,p=e!==n||i!==s,l=p&&e.startsWith(n)&&!(s&&i&&s.endsWith(i)),d=u.getActiveElement(document);o&&r&&d!==r&&r.focus(),i&&p&&!l&&r&&r.setSelectionRange(n.length-i.length,n.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:n}=this.props,i=c.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:o=>this._input=o,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":e||void 0,disabled:e||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":t,"aria-owns":this.props.owns,"aria-activedescendant":t?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.ariaRequired});return n?n.call(void 0,i):i}}module.exports=g;
@@ -8,7 +8,7 @@
8
8
  "use client";
9
9
  import { getActiveElement as c } from "@progress/kendo-react-common";
10
10
  import * as p from "react";
11
- class g extends p.Component {
11
+ class b extends p.Component {
12
12
  constructor() {
13
13
  super(...arguments), this._input = null;
14
14
  }
@@ -19,8 +19,8 @@ class g extends p.Component {
19
19
  return this._input;
20
20
  }
21
21
  componentDidUpdate(t) {
22
- const i = t.value, a = t.suggestedText, { value: s, suggestedText: e, focused: n } = this.props, o = this.input, r = i !== s || e !== a, d = r && i.startsWith(s) && !(a && e && a.endsWith(e)), l = c(document);
23
- n && o && l !== o && o.focus(), e && r && !d && o && o.setSelectionRange(s.length - e.length, s.length);
22
+ const i = t.value, a = t.suggestedText, { value: s, suggestedText: e, focused: r } = this.props, o = this.input, n = i !== s || e !== a, l = n && i.startsWith(s) && !(a && e && a.endsWith(e)), d = c(document);
23
+ r && o && d !== o && o.focus(), e && n && !l && o && o.setSelectionRange(s.length - e.length, s.length);
24
24
  }
25
25
  render() {
26
26
  const { expanded: t = !1, disabled: i, role: a = "listbox", render: s } = this.props, e = /* @__PURE__ */ p.createElement(
@@ -39,7 +39,7 @@ class g extends p.Component {
39
39
  name: this.props.name,
40
40
  value: this.props.value,
41
41
  onChange: this.props.onChange,
42
- ref: (n) => this._input = n,
42
+ ref: (r) => this._input = r,
43
43
  onKeyDown: this.props.onKeyDown,
44
44
  onFocus: this.props.onFocus,
45
45
  onBlur: this.props.onBlur,
@@ -54,6 +54,7 @@ class g extends p.Component {
54
54
  "aria-activedescendant": t ? this.props.activedescendant : void 0,
55
55
  "aria-describedby": this.props.ariaDescribedBy,
56
56
  "aria-labelledby": this.props.ariaLabelledBy,
57
+ "aria-label": this.props.ariaLabel,
57
58
  "aria-required": this.props.ariaRequired
58
59
  }
59
60
  );
@@ -61,5 +62,5 @@ class g extends p.Component {
61
62
  }
62
63
  }
63
64
  export {
64
- g as default
65
+ b as default
65
66
  };