@progress/kendo-vue-dropdowns 3.9.3 → 3.9.4-dev.202304190945

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.
Files changed (59) hide show
  1. package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
  2. package/dist/es/DropDownTree/DropDownTree.d.ts +1 -0
  3. package/dist/es/DropDownTree/DropDownTree.js +639 -0
  4. package/dist/es/DropDownTree/DropDownTreeProps.d.ts +278 -0
  5. package/dist/es/DropDownTree/DropDownTreeProps.js +2 -0
  6. package/dist/es/DropDownTree/ListNoData.d.ts +42 -0
  7. package/dist/es/DropDownTree/ListNoData.js +32 -0
  8. package/dist/es/DropDownTree/useDropdownWidth.d.ts +4 -0
  9. package/dist/es/DropDownTree/useDropdownWidth.js +10 -0
  10. package/dist/es/MultiSelectTree/MultiSelectTree.d.ts +48 -0
  11. package/dist/es/MultiSelectTree/MultiSelectTree.js +880 -0
  12. package/dist/es/MultiSelectTree/MultiSelectTreeProps.d.ts +306 -0
  13. package/dist/es/MultiSelectTree/MultiSelectTreeProps.js +2 -0
  14. package/dist/es/MultiSelectTree/utils.d.ts +17 -0
  15. package/dist/es/MultiSelectTree/utils.js +109 -0
  16. package/dist/es/common/utils.d.ts +6 -1
  17. package/dist/es/common/utils.js +10 -1
  18. package/dist/es/main.d.ts +5 -1
  19. package/dist/es/main.js +5 -1
  20. package/dist/es/package-metadata.js +1 -1
  21. package/dist/esm/DropDownTree/DropDownTree.d.ts +1 -0
  22. package/dist/esm/DropDownTree/DropDownTree.js +639 -0
  23. package/dist/esm/DropDownTree/DropDownTreeProps.d.ts +278 -0
  24. package/dist/esm/DropDownTree/DropDownTreeProps.js +2 -0
  25. package/dist/esm/DropDownTree/ListNoData.d.ts +42 -0
  26. package/dist/esm/DropDownTree/ListNoData.js +32 -0
  27. package/dist/esm/DropDownTree/useDropdownWidth.d.ts +4 -0
  28. package/dist/esm/DropDownTree/useDropdownWidth.js +10 -0
  29. package/dist/esm/MultiSelectTree/MultiSelectTree.d.ts +48 -0
  30. package/dist/esm/MultiSelectTree/MultiSelectTree.js +880 -0
  31. package/dist/esm/MultiSelectTree/MultiSelectTreeProps.d.ts +306 -0
  32. package/dist/esm/MultiSelectTree/MultiSelectTreeProps.js +2 -0
  33. package/dist/esm/MultiSelectTree/utils.d.ts +17 -0
  34. package/dist/esm/MultiSelectTree/utils.js +109 -0
  35. package/dist/esm/common/utils.d.ts +6 -1
  36. package/dist/esm/common/utils.js +10 -1
  37. package/dist/esm/main.d.ts +5 -1
  38. package/dist/esm/main.js +5 -1
  39. package/dist/esm/package-metadata.js +1 -1
  40. package/dist/npm/DropDownTree/DropDownTree.d.ts +1 -0
  41. package/dist/npm/DropDownTree/DropDownTree.js +640 -0
  42. package/dist/npm/DropDownTree/DropDownTreeProps.d.ts +278 -0
  43. package/dist/npm/DropDownTree/DropDownTreeProps.js +3 -0
  44. package/dist/npm/DropDownTree/ListNoData.d.ts +42 -0
  45. package/dist/npm/DropDownTree/ListNoData.js +39 -0
  46. package/dist/npm/DropDownTree/useDropdownWidth.d.ts +4 -0
  47. package/dist/npm/DropDownTree/useDropdownWidth.js +17 -0
  48. package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +48 -0
  49. package/dist/npm/MultiSelectTree/MultiSelectTree.js +887 -0
  50. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +306 -0
  51. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.js +3 -0
  52. package/dist/npm/MultiSelectTree/utils.d.ts +17 -0
  53. package/dist/npm/MultiSelectTree/utils.js +114 -0
  54. package/dist/npm/common/utils.d.ts +6 -1
  55. package/dist/npm/common/utils.js +11 -1
  56. package/dist/npm/main.d.ts +5 -1
  57. package/dist/npm/main.js +20 -1
  58. package/dist/npm/package-metadata.js +1 -1
  59. package/package.json +12 -8
@@ -0,0 +1,639 @@
1
+ // // @ts-ignore
2
+ // import * as Vue from 'vue';
3
+ // const allVue = Vue as any;
4
+ // const gh = allVue.h;
5
+ // const isV3 = allVue.version && allVue.version[0] === '3';
6
+ // import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
7
+ // type DefaultData<V> = object | ((this: V) => {});
8
+ // type DefaultMethods<V> = { [key: string]: (this: V, ...args: any[]) => any };
9
+ // import {
10
+ // classNames,
11
+ // noop,
12
+ // useRtl,
13
+ // getTabIndex,
14
+ // Keys,
15
+ // mapTree,
16
+ // extendDataItem,
17
+ // guid,
18
+ // kendoThemeMaps,
19
+ // Icon
20
+ // } from '@progress/kendo-vue-common';
21
+ // import { Popup } from '@progress/kendo-vue-popup';
22
+ // import { provideLocalizationService } from '@progress/kendo-vue-intl';
23
+ // import { TreeView, TreeViewExpandChangeEvent, TreeViewItemClickEvent } from '@progress/kendo-vue-treeview';
24
+ // import { FilterDescriptor } from '@progress/kendo-data-query';
25
+ // import { validatePackage } from '@progress/kendo-vue-common';
26
+ // import { packageMetadata } from './../package-metadata';
27
+ // import {
28
+ // DropDownTreeProps, DropDownTreeHandle, DropDownTreeFilterChangeEvent,
29
+ // DropDownTreeFocusEvent, DropDownTreeBlurEvent,
30
+ // DropDownTreeChangeEvent, DropDownTreeOpenEvent, DropDownTreeCloseEvent, DropDownTreeExpandEvent,
31
+ // ValueHolderProps
32
+ // } from './DropDownTreeProps';
33
+ // import { getItemValue, areSame, isPresent } from '../common/utils';
34
+ // import { useDropdownWidth } from './useDropdownWidth';
35
+ // import { ListNoData } from './ListNoData';
36
+ // import { DropdownEvent } from '../common/events';
37
+ // import { messages, clear, nodata } from './../messages/main';
38
+ // import { FloatingLabel } from '@progress/kendo-vue-labels';
39
+ // import { ListFilter } from '../common/ListFilter';
40
+ // import { Button } from '@progress/kendo-vue-buttons';
41
+ // import { xIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';
42
+ // const { sizeMap, roundedMap } = kendoThemeMaps;
43
+ // const VALIDATION_MESSAGE: string = 'Please select a value from the list!';
44
+ // const ValueHolder: React.FunctionComponent<ValueHolderProps> = props =>
45
+ // <span className="k-input-value-text">{props.children}</span>;
46
+ // const toLevel = (hierarchicalIndex: string): number[] =>
47
+ // hierarchicalIndex.split('_').map(i => parseInt(i, 10));
48
+ // const getValidity = (parameters: { validationMessage?: string; valid?:
49
+ // boolean; required?: boolean }, hasValue: boolean) => {
50
+ // const {validationMessage, valid, required } = parameters;
51
+ // return ({
52
+ // customError: validationMessage !== undefined,
53
+ // valid: Boolean(valid !== undefined ? valid : (!required || hasValue)),
54
+ // valueMissing: !hasValue
55
+ // });
56
+ // };
57
+ // const defaultProps = {
58
+ // selectField: 'selected',
59
+ // subItemsField: 'items',
60
+ // popupSettings: {
61
+ // animate: true,
62
+ // width: '200px',
63
+ // height: '200px'
64
+ // },
65
+ // required: false,
66
+ // validityStyles: true,
67
+ // size: 'medium' as DropDownTreeProps['size'],
68
+ // rounded: 'medium' as DropDownTreeProps['rounded'],
69
+ // fillMode: 'solid' as DropDownTreeProps['fillMode']
70
+ // };
71
+ // /**
72
+ // * @hidden
73
+ // */
74
+ // export interface DropDownTreeState {
75
+ // calculatedId: string;
76
+ // }
77
+ // /**
78
+ // * @hidden
79
+ // */
80
+ // export interface DropDownTreeComputed {
81
+ // [key: string]: any;
82
+ // wrapperClass: object;
83
+ // }
84
+ // /**
85
+ // * @hidden
86
+ // */
87
+ // export interface DropDownTreeMethods {
88
+ // [key: string]: any;
89
+ // }
90
+ // /**
91
+ // * @hidden
92
+ // */
93
+ // export interface DropDownTreeData {
94
+ // }
95
+ // /**
96
+ // * @hidden
97
+ // */
98
+ // export interface DropDownTreeAll extends Vue2type, DropDownTreeMethods,
99
+ // DropDownTreeData, DropDownTreeComputed, DropDownTreeState {
100
+ // }
101
+ // /**
102
+ // * @hidden
103
+ // */
104
+ // let DropDownTreeVue2: ComponentOptions<DropDownTreeAll, DefaultData<DropDownTreeData>,
105
+ // DefaultMethods<DropDownTreeAll>, DropDownTreeComputed, RecordPropsDefinition<DropDownTreeProps>> = {
106
+ // name: 'KendoDropDownTree',
107
+ // props: {
108
+ // validatePackage(packageMetadata);
109
+ // const props: DropDownTreeProps = usePropsContext<DropDownTreeProps>(DropDownTreePropsContext, directProps);
110
+ // const calculatedId = React.useMemo(() => guid(), []);
111
+ // const id: string = props.id || calculatedId;
112
+ // const {
113
+ // data = [], dataItemKey, popupSettings = {}, style = {},
114
+ // opened, disabled, onOpen = noop, onClose = noop,
115
+ // placeholder, label, name, selectField = defaultProps.selectField,
116
+ // subItemsField = defaultProps.subItemsField,
117
+ // validationMessage, valid,
118
+ // required, validityStyles
119
+ // } = props;
120
+ // const tabIndex = getTabIndex(props.tabIndex, disabled);
121
+ // const target = React.useRef<DropDownTreeHandle>(null);
122
+ // const elementRef = React.useRef<HTMLSpanElement>(null);
123
+ // const inputRef = React.useRef<HTMLInputElement>(null);
124
+ // const selectRef = React.useRef<HTMLSelectElement>(null);
125
+ // const treeViewRef = React.useRef<TreeView>(null);
126
+ // const skipFocusRef = React.useRef<boolean>(false);
127
+ // const [ stateValue, setStateValue ] = React.useState<any>(undefined);
128
+ // const controlled = props.value !== undefined;
129
+ // const value = controlled ? props.value : (stateValue !== undefined ? stateValue : props.defaultValue);
130
+ // const hasValue = isPresent(value);
131
+ // const currentValueText = hasValue ? getItemValue(value, props.textField) : '';
132
+ // const validity = getValidity({ validationMessage, valid, required }, hasValue);
133
+ // const focus = React.useCallback(() => elementRef.current && elementRef.current.focus(), []);
134
+ // React.useImperativeHandle(
135
+ // target,
136
+ // () => ({
137
+ // props,
138
+ // element: elementRef.current,
139
+ // focus
140
+ // })
141
+ // );
142
+ // React.useImperativeHandle<DropDownTreeHandle | null, DropDownTreeHandle | null>(ref, () => target.current);
143
+ // const dir = useRtl(elementRef, props.dir);
144
+ // const initialStyleWidth = popupSettings.width !== undefined ?
145
+ // popupSettings.width : (style.width !== undefined ? style.width : defaultProps.popupSettings.width);
146
+ // const popupWidth = useDropdownWidth(elementRef, initialStyleWidth);
147
+ // const popupStyles: React.CSSProperties = {
148
+ // width: popupWidth,
149
+ // ...(dir !== undefined ? { direction: (dir as any) } : {})
150
+ // };
151
+ // const [open, setOpen] = React.useState(false);
152
+ // const isOpen = opened !== undefined ? opened : open;
153
+ // const [focused, setFocused] = React.useState(false);
154
+ // const [filter, setFilter] = React.useState('');
155
+ // const setValidity = React.useCallback(
156
+ // () => {
157
+ // if (selectRef.current && selectRef.current.setCustomValidity) {
158
+ // selectRef.current.setCustomValidity(
159
+ // validity.valid
160
+ // ? ''
161
+ // : validationMessage === undefined ? VALIDATION_MESSAGE : validationMessage
162
+ // );
163
+ // }
164
+ // },
165
+ // [validationMessage, validity]
166
+ // );
167
+ // React.useEffect(setValidity);
168
+ // const openPopup = React.useCallback(
169
+ // (event: DropdownEvent<DropDownTreeHandle>) => {
170
+ // if (!isOpen) {
171
+ // if (onOpen) {
172
+ // const openEvent: DropDownTreeOpenEvent = { ...event };
173
+ // onOpen.call(undefined, openEvent);
174
+ // }
175
+ // if (opened === undefined) {
176
+ // setOpen(true);
177
+ // }
178
+ // }
179
+ // },
180
+ // [isOpen, opened, onOpen]
181
+ // );
182
+ // const closePopup = React.useCallback(
183
+ // (event: DropdownEvent<DropDownTreeHandle>) => {
184
+ // if (isOpen) {
185
+ // if (onClose) {
186
+ // const closeEvent: DropDownTreeCloseEvent = { ...event };
187
+ // onClose.call(undefined, closeEvent);
188
+ // }
189
+ // if (opened === undefined) {
190
+ // setOpen(false);
191
+ // }
192
+ // }
193
+ // },
194
+ // [isOpen, opened, onClose]
195
+ // );
196
+ // const onWrapperClick = React.useCallback(
197
+ // (event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {
198
+ // if (!event.isDefaultPrevented() && target.current) {
199
+ // setFocused(true);
200
+ // const ev: DropdownEvent<DropDownTreeHandle> = {
201
+ // syntheticEvent: event,
202
+ // nativeEvent: event.nativeEvent,
203
+ // target: target.current
204
+ // };
205
+ // (isOpen ? closePopup : openPopup)(ev);
206
+ // }
207
+ // },
208
+ // [isOpen, opened, onOpen, onClose]
209
+ // );
210
+ // const switchFocus = React.useCallback(
211
+ // (focusFn: () => void) => {
212
+ // skipFocusRef.current = true;
213
+ // focusFn();
214
+ // window.setTimeout(() => skipFocusRef.current = false, 0);
215
+ // },
216
+ // []
217
+ // );
218
+ // const onWrapperKeyDown = React.useCallback(
219
+ // (event: React.KeyboardEvent<HTMLSpanElement>) => {
220
+ // const { keyCode, altKey } = event;
221
+ // const treeview = treeViewRef.current && treeViewRef.current.element;
222
+ // if (!target.current || (event.isDefaultPrevented() && inputRef.current === event.target)) {
223
+ // return;
224
+ // }
225
+ // const ev: DropdownEvent<DropDownTreeHandle> = {
226
+ // syntheticEvent: event,
227
+ // nativeEvent: event.nativeEvent,
228
+ // target: target.current
229
+ // };
230
+ // if (isOpen) {
231
+ // if (keyCode === Keys.esc || (altKey && keyCode === Keys.up)) {
232
+ // event.preventDefault();
233
+ // closePopup(ev);
234
+ // } else if (treeview && treeview.querySelector('.k-focus') &&
235
+ // (keyCode === Keys.up || keyCode === Keys.down ||
236
+ // keyCode === Keys.left || keyCode === Keys.right ||
237
+ // keyCode === Keys.home || keyCode === Keys.end)) {
238
+ // if (keyCode === Keys.up && inputRef.current) {
239
+ // const items =
240
+ // Array.from(treeview.querySelectorAll('.k-treeview-item'));
241
+ // const focusedItem =
242
+ // [...items].reverse().find(i => Boolean(i && i.querySelector('.k-focus')));
243
+ // if (focusedItem && items.indexOf(focusedItem) === 0) {
244
+ // return switchFocus(() => { focusElement(inputRef.current); });
245
+ // }
246
+ // }
247
+ // switchFocus(noop);
248
+ // } else if (keyCode === Keys.down) {
249
+ // switchFocus(() => { focusElement(inputRef.current || treeview); });
250
+ // }
251
+ // } else {
252
+ // if (altKey && keyCode === Keys.down) {
253
+ // event.preventDefault();
254
+ // openPopup(ev);
255
+ // }
256
+ // }
257
+ // },
258
+ // [isOpen, opened, onOpen, onClose]
259
+ // );
260
+ // const onInputKeyDown = React.useCallback(
261
+ // (event: React.KeyboardEvent<HTMLSpanElement>) => {
262
+ // const { keyCode, altKey } = event;
263
+ // if (altKey || (keyCode !== Keys.up && keyCode !== Keys.down)) {
264
+ // return;
265
+ // }
266
+ // event.preventDefault();
267
+ // switchFocus(
268
+ // keyCode === Keys.up ?
269
+ // () => { focusElement(elementRef.current); } :
270
+ // () => { focusElement(treeViewRef.current && treeViewRef.current.element); }
271
+ // );
272
+ // },
273
+ // []
274
+ // );
275
+ // const focusElement = React.useCallback(
276
+ // (element: HTMLElement | null) => {
277
+ // if (element) {
278
+ // switchFocus(() => element.focus());
279
+ // }
280
+ // },
281
+ // []
282
+ // );
283
+ // const onPopupOpened = React.useCallback(
284
+ // () => {
285
+ // if (!focused && isOpen && !opened) {
286
+ // closePopup({ target: target.current } as any);
287
+ // } else {
288
+ // if (props.filterable) {
289
+ // focusElement(inputRef.current);
290
+ // } else {
291
+ // focusElement(treeViewRef.current && treeViewRef.current.element);
292
+ // }
293
+ // }
294
+ // },
295
+ // [onClose, props.filterable, focused, opened, isOpen]
296
+ // );
297
+ // const onPopupClosed = React.useCallback(
298
+ // () => {
299
+ // if (focused) {
300
+ // // Move the focus from treeview to dropdown without triggering Focus or Blur events.
301
+ // focusElement(elementRef.current);
302
+ // }
303
+ // },
304
+ // [focused]
305
+ // );
306
+ // const onFocus = React.useCallback(
307
+ // (event: React.FocusEvent<HTMLSpanElement>) => {
308
+ // if (!focused && !skipFocusRef.current) {
309
+ // setFocused(true);
310
+ // if (props.onFocus && target.current) {
311
+ // const focusEvent: DropDownTreeFocusEvent = {
312
+ // syntheticEvent: event,
313
+ // nativeEvent: event.nativeEvent,
314
+ // target: target.current
315
+ // };
316
+ // props.onFocus.call(undefined, focusEvent);
317
+ // }
318
+ // }
319
+ // },
320
+ // [focused, props.onFocus]
321
+ // );
322
+ // const onBlur = React.useCallback(
323
+ // (event: React.FocusEvent<HTMLSpanElement>) => {
324
+ // if (focused && !skipFocusRef.current && target.current) {
325
+ // setFocused(false);
326
+ // const ev: DropdownEvent<DropDownTreeHandle> = {
327
+ // syntheticEvent: event,
328
+ // nativeEvent: event.nativeEvent,
329
+ // target: target.current
330
+ // };
331
+ // if (props.onBlur) {
332
+ // const focusEvent: DropDownTreeBlurEvent = { ...ev };
333
+ // props.onBlur.call(undefined, focusEvent);
334
+ // }
335
+ // closePopup(ev);
336
+ // }
337
+ // },
338
+ // [focused, props.onBlur, isOpen, opened, onClose]
339
+ // );
340
+ // const onWrapperMouseDown = React.useCallback(
341
+ // () => {
342
+ // if (focused) {
343
+ // // moving focus from treeview to dropdown triggers Focus and Blur events.
344
+ // switchFocus(noop);
345
+ // }
346
+ // },
347
+ // [focused]
348
+ // );
349
+ // const changeValue = React.useCallback(
350
+ // (event: DropdownEvent<DropDownTreeHandle>, newValue: any, hierarchicalIndex?: string) => {
351
+ // if (props.onChange) {
352
+ // const changeEvent: DropDownTreeChangeEvent = {
353
+ // value: newValue,
354
+ // level: hierarchicalIndex ? toLevel(hierarchicalIndex) : [],
355
+ // ...event
356
+ // };
357
+ // props.onChange.call(undefined, changeEvent);
358
+ // }
359
+ // if (!controlled) {
360
+ // setStateValue(newValue);
361
+ // }
362
+ // },
363
+ // [props.onChange, controlled]
364
+ // );
365
+ // const onChange = React.useCallback(
366
+ // (event: TreeViewItemClickEvent) => {
367
+ // if (areSame(event.item, value, dataItemKey) || !target.current) {
368
+ // return;
369
+ // }
370
+ // const { item, itemHierarchicalIndex, nativeEvent, syntheticEvent } = event;
371
+ // const ev: DropdownEvent<DropDownTreeHandle> = {
372
+ // syntheticEvent,
373
+ // nativeEvent: nativeEvent,
374
+ // target: target.current
375
+ // };
376
+ // changeValue(ev, item, itemHierarchicalIndex);
377
+ // closePopup(ev);
378
+ // },
379
+ // [controlled, value, props.onChange, dataItemKey, isOpen, opened, onClose]
380
+ // );
381
+ // const onClear = React.useCallback(
382
+ // (event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {
383
+ // if (!target.current) {
384
+ // return;
385
+ // }
386
+ // const ev: DropdownEvent<DropDownTreeHandle> = {
387
+ // syntheticEvent: event,
388
+ // nativeEvent: event.nativeEvent,
389
+ // target: target.current
390
+ // };
391
+ // changeValue(ev, null);
392
+ // closePopup(ev);
393
+ // event.preventDefault();
394
+ // },
395
+ // [controlled, props.onChange, isOpen, opened, onClose]
396
+ // );
397
+ // const onExpand = React.useCallback(
398
+ // (event: TreeViewExpandChangeEvent) => {
399
+ // event.syntheticEvent.stopPropagation();
400
+ // if (props.onExpandChange && target.current) {
401
+ // const { item, itemHierarchicalIndex, nativeEvent, syntheticEvent } = event;
402
+ // const expandEvent: DropDownTreeExpandEvent = {
403
+ // level: toLevel(itemHierarchicalIndex),
404
+ // item, nativeEvent, syntheticEvent, target: target.current
405
+ // };
406
+ // props.onExpandChange.call(undefined, expandEvent);
407
+ // }
408
+ // },
409
+ // [props.onExpandChange]
410
+ // );
411
+ // const onFilterChange = React.useCallback(
412
+ // (event: React.ChangeEvent<HTMLInputElement>) => {
413
+ // if (props.onFilterChange && target.current) {
414
+ // const filterDesc: FilterDescriptor
415
+ // = { field: props.textField, operator: 'contains', value: event.target.value };
416
+ // const ev: DropDownTreeFilterChangeEvent = {
417
+ // filter: filterDesc,
418
+ // syntheticEvent: event,
419
+ // nativeEvent: event.nativeEvent,
420
+ // target: target.current
421
+ // };
422
+ // props.onFilterChange.call(undefined, ev);
423
+ // if (props.filter === undefined) {
424
+ // setFilter(event.target.value);
425
+ // }
426
+ // }
427
+ // },
428
+ // [props.onFilterChange, props.filter, props.textField]
429
+ // );
430
+ // const treeViewData = React.useMemo(
431
+ // () => {
432
+ // return (controlled || !hasValue) ? data :
433
+ // mapTree(
434
+ // data,
435
+ // subItemsField,
436
+ // item => extendDataItem(
437
+ // item,
438
+ // subItemsField,
439
+ // { [selectField]: areSame(item, value, dataItemKey) }
440
+ // )
441
+ // );
442
+ // },
443
+ // [data, value, controlled, hasValue, selectField, subItemsField]
444
+ // );
445
+ // const NoData = props.listNoData || ListNoData;
446
+ // const ValueComponent = props.valueHolder || ValueHolder;
447
+ // const localization = useLocalization();
448
+ // const isValid = !validityStyles || validity.valid;
449
+ // const { size, rounded, fillMode } = props;
450
+ // const dropdowntree = (
451
+ // <span
452
+ // className={
453
+ // classNames('k-dropdowntree k-picker', props.className, {
454
+ // [`k-picker-${sizeMap[size!] || size}`]: size,
455
+ // [`k-rounded-${roundedMap[rounded!] || rounded}`]: rounded,
456
+ // [`k-picker-${fillMode}`]: fillMode,
457
+ // 'k-focus': focused,
458
+ // 'k-invalid': !isValid,
459
+ // 'k-loading': props.loading,
460
+ // 'k-required': required,
461
+ // 'k-disabled': props.disabled
462
+ // })}
463
+ // tabIndex={tabIndex}
464
+ // accessKey={props.accessKey}
465
+ // id={id}
466
+ // style={label ? { ...style, width: undefined } : style}
467
+ // dir={dir}
468
+ // ref={elementRef}
469
+ // onKeyDown={disabled ? undefined : onWrapperKeyDown}
470
+ // onMouseDown={onWrapperMouseDown}
471
+ // onClick={disabled ? undefined : onWrapperClick}
472
+ // onFocus={onFocus}
473
+ // onBlur={onBlur}
474
+ // role="combobox"
475
+ // aria-haspopup="tree"
476
+ // aria-expanded={isOpen}
477
+ // aria-disabled={disabled}
478
+ // aria-label={label}
479
+ // aria-labelledby={props.ariaLabelledBy}
480
+ // aria-describedby={props.ariaDescribedBy}
481
+ // aria-required={required}
482
+ // >
483
+ // <span className="k-input-inner">
484
+ // <ValueComponent item={value}>{currentValueText || placeholder}</ValueComponent>
485
+ // </span>
486
+ // {props.loading && <IconWrap className="k-input-loading-icon" name='loading' />}
487
+ // {hasValue && !disabled && (
488
+ // <span
489
+ // onClick={onClear}
490
+ // className="k-clear-value"
491
+ // title={localization.toLanguageString(clear, messages[clear])}
492
+ // role="button"
493
+ // tabIndex={-1}
494
+ // onMouseDown={(e: any) => e.preventDefault()}
495
+ // >
496
+ // <IconWrap name='x' icon={xIcon} />
497
+ // </span>
498
+ // )}
499
+ // <Button
500
+ // tabIndex={-1}
501
+ // type="button"
502
+ // aria-label="select"
503
+ // className="k-input-button"
504
+ // size={size}
505
+ // fillMode={fillMode}
506
+ // themeColor="base"
507
+ // rounded={null}
508
+ // icon="caret-alt-down"
509
+ // svgIcon={caretAltDownIcon}
510
+ // />
511
+ // {/* Dummy component to support forms */}
512
+ // <select
513
+ // name={name}
514
+ // ref={selectRef}
515
+ // tabIndex={-1}
516
+ // aria-hidden={true}
517
+ // title={label}
518
+ // style={{ opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' }}
519
+ // >
520
+ // <option value={props.valueMap ? props.valueMap.call(undefined, value) : value} />
521
+ // </select>
522
+ // <Popup
523
+ // className={classNames(popupSettings.className, { 'k-rtl': dir === 'rtl' })}
524
+ // popupClass={classNames(
525
+ // popupSettings.popupClass,
526
+ // 'k-list-container',
527
+ // 'k-dropdowntree-popup'
528
+ // )}
529
+ // style={popupStyles}
530
+ // animate={popupSettings.animate}
531
+ // anchor={elementRef.current}
532
+ // show={isOpen}
533
+ // onOpen={onPopupOpened}
534
+ // onClose={onPopupClosed}
535
+ // appendTo={popupSettings.appendTo}
536
+ // >
537
+ // {props.filterable && (
538
+ // <ListFilter
539
+ // value={props.filter === undefined ? filter : props.filter}
540
+ // inputRef={inputRef}
541
+ // onChange={onFilterChange}
542
+ // onKeyDown={onInputKeyDown}
543
+ // size={size}
544
+ // rounded={rounded}
545
+ // fillMode={fillMode}
546
+ // />
547
+ // )}
548
+ // {data.length > 0 ? (
549
+ // <TreeView
550
+ // ref={treeViewRef}
551
+ // tabIndex={tabIndex}
552
+ // data={treeViewData}
553
+ // focusIdField={dataItemKey}
554
+ // textField={props.textField}
555
+ // selectField={selectField}
556
+ // expandField={props.expandField}
557
+ // childrenField={subItemsField}
558
+ // expandIcons={true}
559
+ // onItemClick={onChange}
560
+ // onExpandChange={onExpand}
561
+ // size={size}
562
+ // item={props.item}
563
+ // />
564
+ // ) : (
565
+ // <NoData>
566
+ // {localization.toLanguageString(nodata, messages[nodata])}
567
+ // </NoData>
568
+ // )}
569
+ // </Popup>
570
+ // </span>
571
+ // );
572
+ // return label ? (
573
+ // <FloatingLabel
574
+ // label={label}
575
+ // editorValue={currentValueText}
576
+ // editorPlaceholder={placeholder}
577
+ // editorValid={isValid}
578
+ // editorDisabled={disabled}
579
+ // editorId={id}
580
+ // style={{ width: style ? style.width : undefined }}
581
+ // children={dropdowntree}
582
+ // dir={dir}
583
+ // />
584
+ // ) : dropdowntree;
585
+ // });
586
+ // const propTypes = {
587
+ // opened: PropTypes.bool,
588
+ // disabled: PropTypes.bool,
589
+ // dir: PropTypes.string,
590
+ // tabIndex: PropTypes.number,
591
+ // accessKey: PropTypes.string,
592
+ // data: PropTypes.array,
593
+ // value: PropTypes.any,
594
+ // valueMap: PropTypes.func,
595
+ // placeholder: PropTypes.string,
596
+ // dataItemKey: PropTypes.string.isRequired,
597
+ // textField: PropTypes.string.isRequired,
598
+ // selectField: PropTypes.string,
599
+ // expandField: PropTypes.string,
600
+ // subItemsField: PropTypes.string,
601
+ // className: PropTypes.string,
602
+ // style: PropTypes.object,
603
+ // label: PropTypes.string,
604
+ // validationMessage: PropTypes.string,
605
+ // validityStyles: PropTypes.bool,
606
+ // valid: PropTypes.bool,
607
+ // required: PropTypes.bool,
608
+ // name: PropTypes.string,
609
+ // id: PropTypes.string,
610
+ // ariaLabelledBy: PropTypes.string,
611
+ // ariaDescribedBy: PropTypes.string,
612
+ // filterable: PropTypes.bool,
613
+ // filter: PropTypes.string,
614
+ // loading: PropTypes.bool,
615
+ // popupSettings: PropTypes.shape({
616
+ // animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
617
+ // openDuration: PropTypes.number,
618
+ // closeDuration: PropTypes.number
619
+ // }) ]),
620
+ // popupClass: PropTypes.string,
621
+ // className: PropTypes.string,
622
+ // appendTo: PropTypes.any,
623
+ // width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
624
+ // height: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
625
+ // }),
626
+ // onOpen: PropTypes.func,
627
+ // onClose: PropTypes.func,
628
+ // onFocus: PropTypes.func,
629
+ // onBlur: PropTypes.func,
630
+ // onChange: PropTypes.func,
631
+ // onFilterChange: PropTypes.func,
632
+ // onExpandChange: PropTypes.func,
633
+ // item: PropTypes.func,
634
+ // valueHolder: PropTypes.func,
635
+ // listNoData: PropTypes.func
636
+ // };
637
+ // DropDownTree.displayName = 'KendoReactDropDownTree';
638
+ // DropDownTree.defaultProps = defaultProps;
639
+ // (DropDownTree as any).propTypes = propTypes;