@progress/kendo-react-treeview 13.3.0-develop.1 → 13.3.0-develop.3
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/dist/cdn/js/kendo-react-treeview.js +1 -1
- package/index.d.mts +23 -23
- package/index.d.ts +23 -23
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-animation")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-svg-icons","@progress/kendo-react-animation"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactTreeview={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoSvgIcons,e.KendoReactAnimation)}(this,(function(e,t,i,s,n,r){"use strict";function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var a=d(t);function o(e,t,i,n,r){switch(n){case s.Keys.left:return s.treeIdUtils.isIdZeroLevel(t)||r.expanded(e)&&s.isEnabledAndAllParentsEnabled(t,i,r)?t:s.treeIdUtils.getDirectParentId(t);case s.Keys.right:return s.isItemExpandedAndWithChildren(e,r)?s.treeIdUtils.getFirstChildId(t):t;case s.Keys.up:return function(){const e=Number(s.treeIdUtils.getShortId(t)),n=s.treeIdUtils.getDirectParentId(t);return e?c(s.treeIdUtils.createId(e-1,n),i,r):s.treeIdUtils.isIdZeroLevel(t)?t:n}();case s.Keys.down:return s.isItemExpandedAndWithChildren(e,r)?s.treeIdUtils.getFirstChildId(t):l(t,i,r)||t;case s.Keys.home:return s.treeIdUtils.ZERO_LEVEL_ZERO_NODE_ID;case s.Keys.end:return function(){let e,t=(i.length-1).toString(),n=i[i.length-1];for(;s.isItemExpandedAndWithChildren(n,r);)e=n[r.getChildrenField()],t=s.treeIdUtils.createId(e.length-1,t),n=e[e.length-1];return t}();default:return t}}function l(e,t,i){const n=s.treeIdUtils.getDirectParentId(e),r=n?s.treeIdUtils.getItemById(n,t,i.getChildrenField()):void 0,d=r?r[i.getChildrenField()]:t,a=Number(s.treeIdUtils.getShortId(e));return a<d.length-1?s.treeIdUtils.createId(a+1,n):r?l(n,t,i):void 0}function c(e,t,i){const n=s.treeIdUtils.getItemById(e,t,i.getChildrenField());return s.isItemExpandedAndWithChildren(n,i)?c(s.treeIdUtils.createId(n[i.getChildrenField()].length-1,e),t,i):e}const h=(e,t)=>{const i=((e,t)=>e===t.length-1)(e,t);return 0!==e||i?i?"bot":"mid":"top"},p="expanded",m="items",u="selected",I="checked",g="checkIndeterminate",f="_kendoItemId",b="_kendoTreeViewGuid",{sizeMap:v}=s.kendoThemeMaps,C=a.createContext((e=>e)),x=class extends a.Component{constructor(){super(...arguments),this.onCheckChange=e=>{this.props.onCheckChange(e,this.item,this.itemId)},this.onExpandChange=e=>{this.props.onExpandChange(e,this.item,this.itemId)},this.onItemClick=e=>{this.props.onItemClick(e,this.item,this.itemId)},this.onPress=e=>{this.props.onPress(e.event,this.item,this.itemId)},this.onDrag=e=>{this.props.onDrag(e.event,this.item,this.itemId)},this.onRelease=e=>{this.props.onRelease(e.event,this.item,this.itemId)},this.onContextMenu=e=>{this.props.onContextMenu(e,this.item,this.itemId)},this.assignDraggableMeta=e=>{e&&(e[f]=this.props.itemId,e[b]=this.props.treeGuid)}}render(){const e=this.renderItemInPart();return a.createElement("li",{className:s.classNames("k-treeview-item"),tabIndex:this.tabIndex,role:"treeitem","aria-expanded":this.ariaExpanded,"aria-selected":this.ariaSelected,"aria-checked":this.ariaChecked,"aria-disabled":!!this.disabled||void 0,ref:e=>{this.itemElement=e}},a.createElement("span",{className:`k-treeview-${this.props.position}`,ref:this.assignDraggableMeta},this.renderExpandIcon(),this.renderCheckbox(),this.props.draggable?a.createElement(s.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease},e):e),this.renderSubitemsWithAnimation())}componentDidMount(){const e=this.props.focusedItemId,t=this.itemId;e&&e===t&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement&&(this.checkboxElement.indeterminate=this.fieldsSvc.checkIndeterminate(this.item))}componentDidUpdate(e){const t=this.props.focusedItemId;if(t&&t!==e.focusedItemId&&t===this.itemId&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement){const e=this.fieldsSvc.checkIndeterminate(this.item);this.checkboxElement.indeterminate!==e&&(this.checkboxElement.indeterminate=e)}}renderCheckbox(){if(this.props.checkboxes){const e=this.props.size;return a.createElement("span",{className:s.classNames("k-checkbox-wrap")},a.createElement("input",{type:"checkbox",className:s.classNames("k-checkbox k-rounded-md",{[`k-checkbox-${v[e]||e}`]:e,"k-disabled":this.disabled}),"aria-label":this.item.text,checked:!!this.fieldsSvc.checked(this.item),id:this.props.id,tabIndex:-1,onChange:this.onCheckChange,ref:e=>{this.checkboxElement=e}}))}}renderExpandIcon(){return this.props.expandIcons&&(this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField()))&&a.createElement("span",{className:s.classNames("k-treeview-toggle",{"k-disabled":this.disabled}),onClick:this.onExpandChange},a.createElement(s.IconWrap,{...this.getIconProps()}))}renderSubitemsIfApplicable(){const e=this.fieldsSvc.children(this.item);return s.isItemExpandedAndWithChildren(this.item,this.fieldsSvc)?a.createElement("ul",{className:"k-treeview-group",role:"group"},e.map(((t,i)=>a.createElement(E,{item:t,position:h(i,e),itemId:s.treeIdUtils.createId(i,this.itemId),treeGuid:this.props.treeGuid,animate:this.props.animate,focusedItemId:this.props.focusedItemId,tabbableItemId:this.props.tabbableItemId,fieldsService:this.props.fieldsService,itemUI:this.props.itemUI,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.props.ariaMultiSelectable,onItemClick:this.props.onItemClick,onFocusDomElNeeded:this.props.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.props.onPress,onDrag:this.props.onDrag,onRelease:this.props.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.props.onExpandChange,onCheckChange:this.props.onCheckChange,onContextMenu:this.props.onContextMenu,key:i,size:this.props.size,disabled:this.disabled,isRtl:this.props.isRtl})))):void 0}renderSubitemsWithAnimation(){const e=this.renderSubitemsIfApplicable(),t=this.fieldsSvc.children(this.item).length>0;return this.props.animate&&t?a.createElement(r.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,style:{display:"block"}},e):e}renderItemInPart(){const e=this.props.iconField,t=e&&this.item[e];return a.createElement("span",{className:s.classNames("k-treeview-leaf",{"k-focus":this.props.focusedItemId===this.itemId,"k-selected":this.fieldsSvc.selected(this.item),"k-disabled":this.disabled,"k-touch-action-none":this.props.draggable}),onClick:this.onItemClick,onContextMenu:this.onContextMenu},t&&a.createElement(s.IconWrap,{name:t.name,icon:t}),a.createElement("span",{className:"k-treeview-leaf-text"},this.props.itemUI?a.createElement(this.props.itemUI,{item:this.item,itemHierarchicalIndex:this.itemId}):this.fieldsSvc.text(this.item)))}get fieldsSvc(){return this.props.fieldsService}get itemId(){return this.props.itemId}get item(){return this.props.item}get tabIndex(){return(this.props.focusedItemId||this.props.tabbableItemId)===this.itemId?0:-1}get ariaExpanded(){return this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?!!this.fieldsSvc.expanded(this.item):void 0}get disabled(){return this.props.disabled||this.fieldsSvc.disabled(this.item)}get ariaChecked(){if(this.props.checkboxes)return this.fieldsSvc.checked(this.item)?"true":this.fieldsSvc.checkIndeterminate(this.item)?"mixed":"false"}get ariaSelected(){return!!this.fieldsSvc.selected(this.item)||(this.props.ariaMultiSelectable?!!this.disabled&&void 0:void 0)}getIconProps(){const e=this.fieldsSvc.expanded(this.item);return e&&!s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?{name:"loading"}:e?{name:"caret-alt-down",icon:n.caretAltDownIcon}:{name:this.props.isRtl?"caret-alt-left":"caret-alt-right",icon:this.props.isRtl?n.caretAltLeftIcon:n.caretAltRightIcon}}};x.defaultProps={position:"top",iconField:"svgIcon"};let k=x;const E=s.withIdHOC(a.forwardRef(((e,t)=>{const i=a.useContext(C).call(void 0,e);return a.createElement(k,{ref:t,...i})})));E.displayName="TreeViewItem";const F=Object.freeze({name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"13.3.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),{sizeMap:y}=s.kendoThemeMaps,D=class extends a.Component{constructor(e){super(e),this.state={focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:s.treeIdUtils.ZERO_LEVEL_ZERO_NODE_ID},this.fieldsSvc=null,this.allowExplicitFocus=!1,this.showLicenseWatermark=!1,this._element=null,this.onFocusDomElNeeded=e=>{this.allowExplicitFocus&&this.focusDomItem(e)},this.onCheckChange=(e,t,i)=>{this.setFocus(i),this.dispatchCheckChange(e,t,i)},this.onExpandChange=(e,t,i)=>{this.setFocus(i),this.dispatchExpandChange(e,t,i)},this.onPress=(e,t,i)=>{this.props.onItemDragStart&&this.props.onItemDragStart.call(void 0,{target:this,item:t,itemHierarchicalIndex:i})},this.onDrag=(e,t,i)=>{const{pageX:s,pageY:n,clientX:r,clientY:d}=e;this.props.onItemDragOver&&this.props.onItemDragOver.call(void 0,{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:r,clientY:d})},this.onRelease=(e,t,i)=>{const{pageX:s,pageY:n,clientX:r,clientY:d}=e;this.props.onItemDragEnd&&this.props.onItemDragEnd.call(void 0,{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:r,clientY:d})},this.onItemClick=(e,t,i)=>{this.setFocus(i),this.dispatchItemClick(e,t,i)},this.onFocus=()=>{clearTimeout(this.blurRequest),void 0===this.state.focusedItemId&&this.data.length&&this.setFocus(this.state.tabbableItemId)},this.onBlur=()=>{clearTimeout(this.blurRequest),this.blurRequest=window.setTimeout((()=>this.setFocus(void 0)),0)},this.onKeyDown=e=>{const t=this.getFocusedItem();if(t&&this.fieldsSvc){const i=o(t,this.state.focusedItemId,this.data,e.keyCode,this.fieldsSvc);i!==this.state.focusedItemId&&(e.preventDefault(),this.allowExplicitFocus=!0,this.setFocus(i)),this.dispatchEventsOnKeyDown(e,t)}},this.onContextMenu=(e,t,i)=>{if(this.props.onContextMenu){const s={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,item:t,itemID:i};this.props.onContextMenu.call(void 0,s)}},this.showLicenseWatermark=!s.validatePackage(F,{component:"TreeView"}),this.licenseMessage=s.getLicenseMessage(F)}get treeGuid(){return this.props.id+"-accessibility-id"}get element(){return this._element}render(){this.fieldsSvc=new s.TreeFieldsService(this.props);const{size:e,className:t}=this.props;return a.createElement("div",{id:this.props.id,style:{position:"relative",...this.props.style},className:s.classNames("k-treeview",{[`k-treeview-${y[e]||e}`]:e,"k-user-select-none":this.props.draggable,"k-rtl":"rtl"===this.props.dir},t),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,role:"tree","aria-multiselectable":!!this.ariaMultiSelectable||void 0,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],ref:e=>{this._element=e},tabIndex:this.props.tabIndex},a.createElement("ul",{className:"k-treeview-lines k-treeview-group",role:"group"},this.data.map(((t,i)=>a.createElement(E,{id:this.props.id+"-item-"+i,item:t,position:h(i,this.data),itemId:i.toString(),treeGuid:this.treeGuid,animate:this.props.animate,focusedItemId:this.state.focusedItemId,tabbableItemId:this.state.tabbableItemId,fieldsService:this.fieldsSvc,itemUI:this.props.item,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.ariaMultiSelectable,onItemClick:this.onItemClick,onFocusDomElNeeded:this.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.onExpandChange,onCheckChange:this.onCheckChange,onContextMenu:this.onContextMenu,key:i,size:e,isRtl:"rtl"===this.props.dir})))),this.showLicenseWatermark&&a.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}componentDidUpdate(){this.allowExplicitFocus=!1,this.refocusDueToFocusIdField()}dispatchEventsOnKeyDown(e,t){if(null===this.fieldsSvc)return;const i=()=>this.fieldsSvc&&s.isEnabledAndAllParentsEnabled(this.state.focusedItemId,this.data,this.fieldsSvc);e.keyCode===s.Keys.left&&this.fieldsSvc.expanded(t)&&i()||e.keyCode===s.Keys.right&&!this.fieldsSvc.expanded(t)&&(this.fieldsSvc.hasChildren(t)||s.hasChildren(t,this.props.childrenField))&&i()?this.dispatchExpandChange(e,t,this.state.focusedItemId):e.keyCode===s.Keys.enter&&i()?this.dispatchItemClick(e,t,this.state.focusedItemId):e.keyCode===s.Keys.space&&i()&&(e.preventDefault(),this.dispatchCheckChange(e,t,this.state.focusedItemId))}setFocus(e){if(e&&this.fieldsSvc)if(this.fieldsSvc.focusIdField){const t=this.getItemById(e);this.setState({focusedItemId:e,focusedItemPublicId:this.fieldsSvc.focusId(t)})}else this.setState({focusedItemId:e});else this.setState((e=>({focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:e.focusedItemId})))}getFocusedItem(){return this.state.focusedItemId?this.getItemById(this.state.focusedItemId):void 0}getItemById(e){return s.treeIdUtils.getItemById(e,this.data,this.props.childrenField||m)}dispatchCheckChange(e,t,i){s.dispatchEvent(this.props.onCheckChange,e,this,{item:t,itemHierarchicalIndex:i})}dispatchExpandChange(e,t,i){s.dispatchEvent(this.props.onExpandChange,e,this,{item:t,itemHierarchicalIndex:i})}dispatchItemClick(e,t,i){s.dispatchEvent(this.props.onItemClick,e,this,{item:t,itemHierarchicalIndex:i})}refocusDueToFocusIdField(){if(this.fieldsSvc&&this.fieldsSvc.focusIdField){const e=this.state.focusedItemPublicId;if(e){const t=this.props.getFocusHierarchicalIndex?this.props.getFocusHierarchicalIndex(e):s.resolveItemId(e,this.fieldsSvc.focusIdField,this.data,this.props.childrenField);t!==this.state.focusedItemId&&(this.allowExplicitFocus=!0,this.setState({focusedItemId:t}))}}}get ariaMultiSelectable(){return!0===this.props["aria-multiselectable"]||"true"===this.props["aria-multiselectable"]}get data(){return this.props.data||[]}focusDomItem(e){e.focus()}get guid(){return this.treeGuid}};D.propTypes={data:i.arrayOf(i.any),animate:i.bool,tabIndex:i.number,focusIdField:i.string,getHierarchicalIndexById:i.func,onExpandChange:i.func,onItemClick:i.func,expandField:i.string,selectField:i.string,iconField:i.string,childrenField:i.string,hasChildrenField:i.string,textField:i.string,disableField:i.string,item:i.any,"aria-multiselectable":(e,t,i)=>void 0!==e[t]&&!0!==e[t]&&!1!==e[t]&&"true"!==e[t]&&"false"!==e[t]?new Error("Invalid prop `"+t+"` supplied to `"+i+"`. Validation failed."):null,"aria-label":i.string,"aria-labelledby":i.string,size:i.oneOf([null,"small","medium","large"]),dir:i.string},D.defaultProps={animate:!0,expandField:p,selectField:u,iconField:"svgIcon",hasChildrenField:"hasChildren",childrenField:m,textField:"text",disableField:"disabled",checkField:I,checkIndeterminateField:g,size:"medium"};let S=D;function w(e,t,i,n,r){if(i){const{ids:d,field:a}=N(i,t);return function(e,t,i,n,r){let d=e;return t.forEach((e=>{d=s.updateItem(d,e,(e=>P(i,e)),n,r)})),d}(e,!s.isArray(i)&&i.idField?s.resolveItemsIds(d,i.idField,e,r):d,a,n,r)}return e}function N(e,t){let i,n;return s.isArray(e)?(i=e,n=t):(i=e.ids||[],n=e.operationField||t),{ids:i,field:n}}function P(e,t){const i=(e||"").split(".");let s=t;for(let e=0;e<i.length;e++){const t=i[e];if(e===i.length-1)s[t]=!0;else{if(void 0===s[t])return;s[t]={...s[t]},s=s[t]}}}function U(e,t,i,n,r){let d=!1;for(let a=0;a<e.length;a++){const o=e[a];if(s.getNestedValue(n,o)){if(!d)for(let e=0;e<t.length;e++)P(r,t[e]);d=!0,o[i]&&U(o[i],[],i,n,r)}else o[i]&&U(o[i],d?[o]:t.concat([o]),i,n,r)}}const M=class extends a.PureComponent{constructor(){super(...arguments),this.state={visible:!1,top:0,left:0,text:"",operationClassName:"cancel"}}render(){const e={top:this.state.top+"px",left:this.state.left+"px"};return this.state.visible&&a.createElement("div",{className:"k-header k-drag-clue",style:{...this.props.style,...e}},a.createElement(s.IconWrap,{className:s.classNames("k-drag-status"),name:this.state.operationClassName&&s.toIconName(this.state.operationClassName),icon:"k-i-plus"===this.state.operationClassName?n.plusIcon:"k-i-insert-up"===this.state.operationClassName?n.insertTopIcon:"k-i-insert-down"===this.state.operationClassName?n.insertBottomIcon:"k-i-insert-middle"===this.state.operationClassName?n.insertMiddleIcon:n.cancelIcon}),this.state.text)}show(e,t,i,s){this.setState({visible:!0,top:e,left:t,text:i,operationClassName:s})}hide(){this.setState({visible:!1})}};M.defaultProps={style:{display:"block",position:"absolute",zIndex:2e4,padding:"4px 6px"}};let R=M;const O=s.withIdHOC(S);O.displayName="KendoReactTreeView",Object.defineProperty(e,"FieldsService",{enumerable:!0,get:function(){return s.TreeFieldsService}}),e.TreeView=O,e.TreeViewClassComponent=S,e.TreeViewDragAnalyzer=class{constructor(e){this.event=e,this.initialized=!1,this.destItemId="",this.destTreeViewGuid="",this.itemId=e.itemHierarchicalIndex,this.treeViewGuid=e.target.guid}init(){return this.initialized||(this.setDestimationMeta(document.elementFromPoint(this.event.clientX,this.event.clientY)),this.initialized=!0),this}get isDropAllowed(){return!!(this.initialized&&this.destItemId&&this.destTreeViewGuid)&&!`${this.destTreeViewGuid}_${this.destItemId}_`.startsWith(`${this.treeViewGuid}_${this.itemId}_`)}get destinationMeta(){return{itemHierarchicalIndex:this.destItemId,treeViewGuid:this.destTreeViewGuid}}getDropOperation(){if(this.initialized&&this.isDropAllowed){const{top:e,height:t}=this.destDomNodeWithMeta.getBoundingClientRect();return e+t-this.event.clientY<6?"after":this.event.clientY-e<6?"before":"child"}}setDestimationMeta(e){let t=e;for(;t&&!t[f];)t=t.parentNode;t&&t[f]&&(this.destDomNodeWithMeta=t,this.destItemId=t[f],this.destTreeViewGuid=t[b])}},e.TreeViewDragClue=R,e.TreeViewItemPropsContext=C,e.getItemIdUponKeyboardNavigation=o,e.handleTreeViewCheckChange=function(e,t,i,n={},r){if(!i||!i.length)return[];const{ids:d,idField:a}=function(e){let t,i;return s.isArray(e)?t=e:(t=e.ids||[],i=e.idField),{ids:t,idField:i}}(t),o=a?s.getNestedValue(a,e.item):e.itemHierarchicalIndex,l=d.indexOf(o),c=-1===l,h=r||m;let p;return n.singleMode?p=c?[o]:[]:(p=d.slice(),c?p.push(o):p.splice(l,1),n.checkChildren&&function(e,t,i,n,r,d){s.getAllDirectIndirectChildrenIds(e,t,r,n).forEach((e=>{i&&-1===d.indexOf(e)?d.push(e):!i&&d.indexOf(e)>-1&&d.splice(d.indexOf(e),1)}))}(e.item,e.itemHierarchicalIndex,c,a,h,p),n.checkParents&&function(e,t,i,n,r,d){const a=h();let o=a.next();function l(){for(;!o.done;){const{id:e,item:t}=o.value;if(-1!==r.indexOf(e)||!s.areAllDirectChildrenChecked(t,e,i,n,r))break;r.push(e),o=a.next()}}function c(){for(;!o.done;){const{id:e}=o.value,t=r.indexOf(e);if(!(t>-1))break;r.splice(t,1),o=a.next()}}function*h(){if(i){const r=s.getAllParents(e,n,d);for(let e=r.length-1;e>-1;e--)yield{id:s.getNestedValue(i,r[e]),item:t?r[e]:void 0}}else{let i=s.treeIdUtils.getDirectParentId(e);for(;i;)yield{id:i,item:t?s.treeIdUtils.getItemById(i,d,n):void 0},i=s.treeIdUtils.getDirectParentId(i)}}t?l():c()}(e.itemHierarchicalIndex,c,a,h,p,i)),s.isArray(t)?p:Object.assign({},t,{ids:p})},e.moveTreeViewItem=function(e,t,i,n,r,d){const a=d||m;if(!function(){if(!t||!t.length||!e||!n||r&&!r.length)return!1;const i=r&&r!==t?r:t;return!!s.treeIdUtils.getItemById(n,i,a)}())return l();const o=s.treeIdUtils.getItemById(e,t,a);if(!o)return l();if(!r||r===t){if(`${n}_`.startsWith(`${e}_`))return l();const d=s.removeItem(e,a,t),c=s.addItem(o,i,a,s.treeIdUtils.getDecrementedItemIdAfterRemoval(e,n),d);return r?{sourceData:c,targetData:c}:c}return{sourceData:s.removeItem(e,a,t),targetData:s.addItem(o,i,a,n,r)};function l(){return r?{sourceData:t,targetData:r}:t}},e.processTreeViewItems=function(e,t){if(!e||!e.length)return[];let i=e;const n=t.cloneField||"cloned",r=t.expandField||p,d=t.selectField||u,a=t.checkField||I,o=t.childrenField||m;return i=w(i,r,t.expand,n,o),i=w(i,d,t.select,n,o),i=w(i,a,t.check,n,o),function(e,t,i){if(i&&!s.isArray(i)&&i.applyCheckIndeterminate){const{field:n}=N(i,I),r=i.checkIndeterminateField||g;for(let i=0;i<e.length;i++){const d=e[i],a=d[t];a&&U(a,s.getNestedValue(n,d)?[]:[d],t,n,r)}}}(i,o,t.check),i}}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-animation")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-svg-icons","@progress/kendo-react-animation"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactTreeview={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoSvgIcons,e.KendoReactAnimation)}(this,(function(e,t,i,s,n,r){"use strict";function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var a=d(t);function o(e,t,i,n,r){switch(n){case s.Keys.left:return s.treeIdUtils.isIdZeroLevel(t)||r.expanded(e)&&s.isEnabledAndAllParentsEnabled(t,i,r)?t:s.treeIdUtils.getDirectParentId(t);case s.Keys.right:return s.isItemExpandedAndWithChildren(e,r)?s.treeIdUtils.getFirstChildId(t):t;case s.Keys.up:return function(){const e=Number(s.treeIdUtils.getShortId(t)),n=s.treeIdUtils.getDirectParentId(t);return e?c(s.treeIdUtils.createId(e-1,n),i,r):s.treeIdUtils.isIdZeroLevel(t)?t:n}();case s.Keys.down:return s.isItemExpandedAndWithChildren(e,r)?s.treeIdUtils.getFirstChildId(t):l(t,i,r)||t;case s.Keys.home:return s.treeIdUtils.ZERO_LEVEL_ZERO_NODE_ID;case s.Keys.end:return function(){let e,t=(i.length-1).toString(),n=i[i.length-1];for(;s.isItemExpandedAndWithChildren(n,r);)e=n[r.getChildrenField()],t=s.treeIdUtils.createId(e.length-1,t),n=e[e.length-1];return t}();default:return t}}function l(e,t,i){const n=s.treeIdUtils.getDirectParentId(e),r=n?s.treeIdUtils.getItemById(n,t,i.getChildrenField()):void 0,d=r?r[i.getChildrenField()]:t,a=Number(s.treeIdUtils.getShortId(e));return a<d.length-1?s.treeIdUtils.createId(a+1,n):r?l(n,t,i):void 0}function c(e,t,i){const n=s.treeIdUtils.getItemById(e,t,i.getChildrenField());return s.isItemExpandedAndWithChildren(n,i)?c(s.treeIdUtils.createId(n[i.getChildrenField()].length-1,e),t,i):e}const h=(e,t)=>{const i=((e,t)=>e===t.length-1)(e,t);return 0!==e||i?i?"bot":"mid":"top"},p="expanded",m="items",u="selected",I="checked",g="checkIndeterminate",f="_kendoItemId",b="_kendoTreeViewGuid",{sizeMap:v}=s.kendoThemeMaps,C=a.createContext((e=>e)),x=class extends a.Component{constructor(){super(...arguments),this.onCheckChange=e=>{this.props.onCheckChange(e,this.item,this.itemId)},this.onExpandChange=e=>{this.props.onExpandChange(e,this.item,this.itemId)},this.onItemClick=e=>{this.props.onItemClick(e,this.item,this.itemId)},this.onPress=e=>{this.props.onPress(e.event,this.item,this.itemId)},this.onDrag=e=>{this.props.onDrag(e.event,this.item,this.itemId)},this.onRelease=e=>{this.props.onRelease(e.event,this.item,this.itemId)},this.onContextMenu=e=>{this.props.onContextMenu(e,this.item,this.itemId)},this.assignDraggableMeta=e=>{e&&(e[f]=this.props.itemId,e[b]=this.props.treeGuid)}}render(){const e=this.renderItemInPart();return a.createElement("li",{className:s.classNames("k-treeview-item"),tabIndex:this.tabIndex,role:"treeitem","aria-expanded":this.ariaExpanded,"aria-selected":this.ariaSelected,"aria-checked":this.ariaChecked,"aria-disabled":!!this.disabled||void 0,ref:e=>{this.itemElement=e}},a.createElement("span",{className:`k-treeview-${this.props.position}`,ref:this.assignDraggableMeta},this.renderExpandIcon(),this.renderCheckbox(),this.props.draggable?a.createElement(s.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease},e):e),this.renderSubitemsWithAnimation())}componentDidMount(){const e=this.props.focusedItemId,t=this.itemId;e&&e===t&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement&&(this.checkboxElement.indeterminate=this.fieldsSvc.checkIndeterminate(this.item))}componentDidUpdate(e){const t=this.props.focusedItemId;if(t&&t!==e.focusedItemId&&t===this.itemId&&this.props.onFocusDomElNeeded(this.itemElement),this.checkboxElement){const e=this.fieldsSvc.checkIndeterminate(this.item);this.checkboxElement.indeterminate!==e&&(this.checkboxElement.indeterminate=e)}}renderCheckbox(){if(this.props.checkboxes){const e=this.props.size;return a.createElement("span",{className:s.classNames("k-checkbox-wrap")},a.createElement("input",{type:"checkbox",className:s.classNames("k-checkbox k-rounded-md",{[`k-checkbox-${v[e]||e}`]:e,"k-disabled":this.disabled}),"aria-label":this.item.text,checked:!!this.fieldsSvc.checked(this.item),id:this.props.id,tabIndex:-1,onChange:this.onCheckChange,ref:e=>{this.checkboxElement=e}}))}}renderExpandIcon(){return this.props.expandIcons&&(this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField()))&&a.createElement("span",{className:s.classNames("k-treeview-toggle",{"k-disabled":this.disabled}),onClick:this.onExpandChange},a.createElement(s.IconWrap,{...this.getIconProps()}))}renderSubitemsIfApplicable(){const e=this.fieldsSvc.children(this.item);return s.isItemExpandedAndWithChildren(this.item,this.fieldsSvc)?a.createElement("ul",{className:"k-treeview-group",role:"group"},e.map(((t,i)=>a.createElement(E,{item:t,position:h(i,e),itemId:s.treeIdUtils.createId(i,this.itemId),treeGuid:this.props.treeGuid,animate:this.props.animate,focusedItemId:this.props.focusedItemId,tabbableItemId:this.props.tabbableItemId,fieldsService:this.props.fieldsService,itemUI:this.props.itemUI,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.props.ariaMultiSelectable,onItemClick:this.props.onItemClick,onFocusDomElNeeded:this.props.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.props.onPress,onDrag:this.props.onDrag,onRelease:this.props.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.props.onExpandChange,onCheckChange:this.props.onCheckChange,onContextMenu:this.props.onContextMenu,key:i,size:this.props.size,disabled:this.disabled,isRtl:this.props.isRtl})))):void 0}renderSubitemsWithAnimation(){const e=this.renderSubitemsIfApplicable(),t=this.fieldsSvc.children(this.item).length>0;return this.props.animate&&t?a.createElement(r.Reveal,{transitionEnterDuration:200,transitionExitDuration:200,style:{display:"block"}},e):e}renderItemInPart(){const e=this.props.iconField,t=e&&this.item[e];return a.createElement("span",{className:s.classNames("k-treeview-leaf",{"k-focus":this.props.focusedItemId===this.itemId,"k-selected":this.fieldsSvc.selected(this.item),"k-disabled":this.disabled,"k-touch-action-none":this.props.draggable}),onClick:this.onItemClick,onContextMenu:this.onContextMenu},t&&a.createElement(s.IconWrap,{name:t.name,icon:t}),a.createElement("span",{className:"k-treeview-leaf-text"},this.props.itemUI?a.createElement(this.props.itemUI,{item:this.item,itemHierarchicalIndex:this.itemId}):this.fieldsSvc.text(this.item)))}get fieldsSvc(){return this.props.fieldsService}get itemId(){return this.props.itemId}get item(){return this.props.item}get tabIndex(){return(this.props.focusedItemId||this.props.tabbableItemId)===this.itemId?0:-1}get ariaExpanded(){return this.fieldsSvc.hasChildren(this.item)||s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?!!this.fieldsSvc.expanded(this.item):void 0}get disabled(){return this.props.disabled||this.fieldsSvc.disabled(this.item)}get ariaChecked(){if(this.props.checkboxes)return this.fieldsSvc.checked(this.item)?"true":this.fieldsSvc.checkIndeterminate(this.item)?"mixed":"false"}get ariaSelected(){return!!this.fieldsSvc.selected(this.item)||(this.props.ariaMultiSelectable?!!this.disabled&&void 0:void 0)}getIconProps(){const e=this.fieldsSvc.expanded(this.item);return e&&!s.hasChildren(this.item,this.fieldsSvc.getChildrenField())?{name:"loading"}:e?{name:"caret-alt-down",icon:n.caretAltDownIcon}:{name:this.props.isRtl?"caret-alt-left":"caret-alt-right",icon:this.props.isRtl?n.caretAltLeftIcon:n.caretAltRightIcon}}};x.defaultProps={position:"top",iconField:"svgIcon"};let k=x;const E=s.withIdHOC(a.forwardRef(((e,t)=>{const i=a.useContext(C).call(void 0,e);return a.createElement(k,{ref:t,...i})})));E.displayName="TreeViewItem";const F=Object.freeze({name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"13.3.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),{sizeMap:y}=s.kendoThemeMaps,D=class extends a.Component{constructor(e){super(e),this.state={focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:s.treeIdUtils.ZERO_LEVEL_ZERO_NODE_ID},this.fieldsSvc=null,this.allowExplicitFocus=!1,this.showLicenseWatermark=!1,this._element=null,this.onFocusDomElNeeded=e=>{this.allowExplicitFocus&&this.focusDomItem(e)},this.onCheckChange=(e,t,i)=>{this.setFocus(i),this.dispatchCheckChange(e,t,i)},this.onExpandChange=(e,t,i)=>{this.setFocus(i),this.dispatchExpandChange(e,t,i)},this.onPress=(e,t,i)=>{this.props.onItemDragStart&&this.props.onItemDragStart.call(void 0,{target:this,item:t,itemHierarchicalIndex:i})},this.onDrag=(e,t,i)=>{const{pageX:s,pageY:n,clientX:r,clientY:d}=e;this.props.onItemDragOver&&this.props.onItemDragOver.call(void 0,{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:r,clientY:d})},this.onRelease=(e,t,i)=>{const{pageX:s,pageY:n,clientX:r,clientY:d}=e;this.props.onItemDragEnd&&this.props.onItemDragEnd.call(void 0,{target:this,item:t,itemHierarchicalIndex:i,pageX:s,pageY:n,clientX:r,clientY:d})},this.onItemClick=(e,t,i)=>{this.setFocus(i),this.dispatchItemClick(e,t,i)},this.onFocus=()=>{clearTimeout(this.blurRequest),void 0===this.state.focusedItemId&&this.data.length&&this.setFocus(this.state.tabbableItemId)},this.onBlur=()=>{clearTimeout(this.blurRequest),this.blurRequest=window.setTimeout((()=>this.setFocus(void 0)),0)},this.onKeyDown=e=>{const t=this.getFocusedItem();if(t&&this.fieldsSvc){const i=o(t,this.state.focusedItemId,this.data,e.keyCode,this.fieldsSvc);i!==this.state.focusedItemId&&(e.preventDefault(),this.allowExplicitFocus=!0,this.setFocus(i)),this.dispatchEventsOnKeyDown(e,t)}},this.onContextMenu=(e,t,i)=>{if(this.props.onContextMenu){const s={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,item:t,itemID:i};this.props.onContextMenu.call(void 0,s)}},this.showLicenseWatermark=!s.validatePackage(F,{component:"TreeView"}),this.licenseMessage=s.getLicenseMessage(F)}get treeGuid(){return this.props.id+"-accessibility-id"}get element(){return this._element}render(){this.fieldsSvc=new s.TreeFieldsService(this.props);const{size:e,className:t}=this.props;return a.createElement("div",{id:this.props.id,style:{position:"relative",...this.props.style},className:s.classNames("k-treeview",{[`k-treeview-${y[e]||e}`]:e,"k-user-select-none":this.props.draggable,"k-rtl":"rtl"===this.props.dir},t),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,role:"tree","aria-multiselectable":!!this.ariaMultiSelectable||void 0,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],ref:e=>{this._element=e},tabIndex:this.props.tabIndex},a.createElement("ul",{className:"k-treeview-lines k-treeview-group",role:"group"},this.data.map(((t,i)=>a.createElement(E,{id:this.props.id+"-item-"+i,item:t,position:h(i,this.data),itemId:i.toString(),treeGuid:this.treeGuid,animate:this.props.animate,focusedItemId:this.state.focusedItemId,tabbableItemId:this.state.tabbableItemId,fieldsService:this.fieldsSvc,itemUI:this.props.item,checkboxes:this.props.checkboxes,ariaMultiSelectable:this.ariaMultiSelectable,onItemClick:this.onItemClick,onFocusDomElNeeded:this.onFocusDomElNeeded,draggable:this.props.draggable,onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,expandIcons:this.props.expandIcons,iconField:this.props.iconField,onExpandChange:this.onExpandChange,onCheckChange:this.onCheckChange,onContextMenu:this.onContextMenu,key:i,size:e,isRtl:"rtl"===this.props.dir})))),this.showLicenseWatermark&&a.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}componentDidUpdate(){this.allowExplicitFocus=!1,this.refocusDueToFocusIdField()}dispatchEventsOnKeyDown(e,t){if(null===this.fieldsSvc)return;const i=()=>this.fieldsSvc&&s.isEnabledAndAllParentsEnabled(this.state.focusedItemId,this.data,this.fieldsSvc);e.keyCode===s.Keys.left&&this.fieldsSvc.expanded(t)&&i()||e.keyCode===s.Keys.right&&!this.fieldsSvc.expanded(t)&&(this.fieldsSvc.hasChildren(t)||s.hasChildren(t,this.props.childrenField))&&i()?this.dispatchExpandChange(e,t,this.state.focusedItemId):e.keyCode===s.Keys.enter&&i()?this.dispatchItemClick(e,t,this.state.focusedItemId):e.keyCode===s.Keys.space&&i()&&(e.preventDefault(),this.dispatchCheckChange(e,t,this.state.focusedItemId))}setFocus(e){if(e&&this.fieldsSvc)if(this.fieldsSvc.focusIdField){const t=this.getItemById(e);this.setState({focusedItemId:e,focusedItemPublicId:this.fieldsSvc.focusId(t)})}else this.setState({focusedItemId:e});else this.setState((e=>({focusedItemId:void 0,focusedItemPublicId:void 0,tabbableItemId:e.focusedItemId})))}getFocusedItem(){return this.state.focusedItemId?this.getItemById(this.state.focusedItemId):void 0}getItemById(e){return s.treeIdUtils.getItemById(e,this.data,this.props.childrenField||m)}dispatchCheckChange(e,t,i){s.dispatchEvent(this.props.onCheckChange,e,this,{item:t,itemHierarchicalIndex:i})}dispatchExpandChange(e,t,i){s.dispatchEvent(this.props.onExpandChange,e,this,{item:t,itemHierarchicalIndex:i})}dispatchItemClick(e,t,i){s.dispatchEvent(this.props.onItemClick,e,this,{item:t,itemHierarchicalIndex:i})}refocusDueToFocusIdField(){if(this.fieldsSvc&&this.fieldsSvc.focusIdField){const e=this.state.focusedItemPublicId;if(e){const t=this.props.getFocusHierarchicalIndex?this.props.getFocusHierarchicalIndex(e):s.resolveItemId(e,this.fieldsSvc.focusIdField,this.data,this.props.childrenField);t!==this.state.focusedItemId&&(this.allowExplicitFocus=!0,this.setState({focusedItemId:t}))}}}get ariaMultiSelectable(){return!0===this.props["aria-multiselectable"]||"true"===this.props["aria-multiselectable"]}get data(){return this.props.data||[]}focusDomItem(e){e.focus()}get guid(){return this.treeGuid}};D.propTypes={data:i.arrayOf(i.any),animate:i.bool,tabIndex:i.number,focusIdField:i.string,getHierarchicalIndexById:i.func,onExpandChange:i.func,onItemClick:i.func,expandField:i.string,selectField:i.string,iconField:i.string,childrenField:i.string,hasChildrenField:i.string,textField:i.string,disableField:i.string,item:i.any,"aria-multiselectable":(e,t,i)=>void 0!==e[t]&&!0!==e[t]&&!1!==e[t]&&"true"!==e[t]&&"false"!==e[t]?new Error("Invalid prop `"+t+"` supplied to `"+i+"`. Validation failed."):null,"aria-label":i.string,"aria-labelledby":i.string,size:i.oneOf([null,"small","medium","large"]),dir:i.string},D.defaultProps={animate:!0,expandField:p,selectField:u,iconField:"svgIcon",hasChildrenField:"hasChildren",childrenField:m,textField:"text",disableField:"disabled",checkField:I,checkIndeterminateField:g,size:"medium"};let S=D;function w(e,t,i,n,r){if(i){const{ids:d,field:a}=N(i,t);return function(e,t,i,n,r){let d=e;return t.forEach((e=>{d=s.updateItem(d,e,(e=>P(i,e)),n,r)})),d}(e,!s.isArray(i)&&i.idField?s.resolveItemsIds(d,i.idField,e,r):d,a,n,r)}return e}function N(e,t){let i,n;return s.isArray(e)?(i=e,n=t):(i=e.ids||[],n=e.operationField||t),{ids:i,field:n}}function P(e,t){const i=(e||"").split(".");let s=t;for(let e=0;e<i.length;e++){const t=i[e];if(e===i.length-1)s[t]=!0;else{if(void 0===s[t])return;s[t]={...s[t]},s=s[t]}}}function U(e,t,i,n,r){let d=!1;for(let a=0;a<e.length;a++){const o=e[a];if(s.getNestedValue(n,o)){if(!d)for(let e=0;e<t.length;e++)P(r,t[e]);d=!0,o[i]&&U(o[i],[],i,n,r)}else o[i]&&U(o[i],d?[o]:t.concat([o]),i,n,r)}}const M=class extends a.PureComponent{constructor(){super(...arguments),this.state={visible:!1,top:0,left:0,text:"",operationClassName:"cancel"}}render(){const e={top:this.state.top+"px",left:this.state.left+"px"};return this.state.visible&&a.createElement("div",{className:"k-header k-drag-clue",style:{...this.props.style,...e}},a.createElement(s.IconWrap,{className:s.classNames("k-drag-status"),name:this.state.operationClassName&&s.toIconName(this.state.operationClassName),icon:"k-i-plus"===this.state.operationClassName?n.plusIcon:"k-i-insert-up"===this.state.operationClassName?n.insertTopIcon:"k-i-insert-down"===this.state.operationClassName?n.insertBottomIcon:"k-i-insert-middle"===this.state.operationClassName?n.insertMiddleIcon:n.cancelIcon}),this.state.text)}show(e,t,i,s){this.setState({visible:!0,top:e,left:t,text:i,operationClassName:s})}hide(){this.setState({visible:!1})}};M.defaultProps={style:{display:"block",position:"absolute",zIndex:2e4,padding:"4px 6px"}};let R=M;const O=s.withIdHOC(S);O.displayName="KendoReactTreeView",Object.defineProperty(e,"FieldsService",{enumerable:!0,get:function(){return s.TreeFieldsService}}),e.TreeView=O,e.TreeViewClassComponent=S,e.TreeViewDragAnalyzer=class{constructor(e){this.event=e,this.initialized=!1,this.destItemId="",this.destTreeViewGuid="",this.itemId=e.itemHierarchicalIndex,this.treeViewGuid=e.target.guid}init(){return this.initialized||(this.setDestimationMeta(document.elementFromPoint(this.event.clientX,this.event.clientY)),this.initialized=!0),this}get isDropAllowed(){return!!(this.initialized&&this.destItemId&&this.destTreeViewGuid)&&!`${this.destTreeViewGuid}_${this.destItemId}_`.startsWith(`${this.treeViewGuid}_${this.itemId}_`)}get destinationMeta(){return{itemHierarchicalIndex:this.destItemId,treeViewGuid:this.destTreeViewGuid}}getDropOperation(){if(this.initialized&&this.isDropAllowed){const{top:e,height:t}=this.destDomNodeWithMeta.getBoundingClientRect();return e+t-this.event.clientY<6?"after":this.event.clientY-e<6?"before":"child"}}setDestimationMeta(e){let t=e;for(;t&&!t[f];)t=t.parentNode;t&&t[f]&&(this.destDomNodeWithMeta=t,this.destItemId=t[f],this.destTreeViewGuid=t[b])}},e.TreeViewDragClue=R,e.TreeViewItemPropsContext=C,e.getItemIdUponKeyboardNavigation=o,e.handleTreeViewCheckChange=function(e,t,i,n={},r){if(!i||!i.length)return[];const{ids:d,idField:a}=function(e){let t,i;return s.isArray(e)?t=e:(t=e.ids||[],i=e.idField),{ids:t,idField:i}}(t),o=a?s.getNestedValue(a,e.item):e.itemHierarchicalIndex,l=d.indexOf(o),c=-1===l,h=r||m;let p;return n.singleMode?p=c?[o]:[]:(p=d.slice(),c?p.push(o):p.splice(l,1),n.checkChildren&&function(e,t,i,n,r,d){s.getAllDirectIndirectChildrenIds(e,t,r,n).forEach((e=>{i&&-1===d.indexOf(e)?d.push(e):!i&&d.indexOf(e)>-1&&d.splice(d.indexOf(e),1)}))}(e.item,e.itemHierarchicalIndex,c,a,h,p),n.checkParents&&function(e,t,i,n,r,d){const a=h();let o=a.next();function l(){for(;!o.done;){const{id:e,item:t}=o.value;if(-1!==r.indexOf(e)||!s.areAllDirectChildrenChecked(t,e,i,n,r))break;r.push(e),o=a.next()}}function c(){for(;!o.done;){const{id:e}=o.value,t=r.indexOf(e);if(!(t>-1))break;r.splice(t,1),o=a.next()}}function*h(){if(i){const r=s.getAllParents(e,n,d);for(let e=r.length-1;e>-1;e--)yield{id:s.getNestedValue(i,r[e]),item:t?r[e]:void 0}}else{let i=s.treeIdUtils.getDirectParentId(e);for(;i;)yield{id:i,item:t?s.treeIdUtils.getItemById(i,d,n):void 0},i=s.treeIdUtils.getDirectParentId(i)}}t?l():c()}(e.itemHierarchicalIndex,c,a,h,p,i)),s.isArray(t)?p:Object.assign({},t,{ids:p})},e.moveTreeViewItem=function(e,t,i,n,r,d){const a=d||m;if(!function(){if(!t||!t.length||!e||!n||r&&!r.length)return!1;const i=r&&r!==t?r:t;return!!s.treeIdUtils.getItemById(n,i,a)}())return l();const o=s.treeIdUtils.getItemById(e,t,a);if(!o)return l();if(!r||r===t){if(`${n}_`.startsWith(`${e}_`))return l();const d=s.removeItem(e,a,t),c=s.addItem(o,i,a,s.treeIdUtils.getDecrementedItemIdAfterRemoval(e,n),d);return r?{sourceData:c,targetData:c}:c}return{sourceData:s.removeItem(e,a,t),targetData:s.addItem(o,i,a,n,r)};function l(){return r?{sourceData:t,targetData:r}:t}},e.processTreeViewItems=function(e,t){if(!e||!e.length)return[];let i=e;const n=t.cloneField||"cloned",r=t.expandField||p,d=t.selectField||u,a=t.checkField||I,o=t.childrenField||m;return i=w(i,r,t.expand,n,o),i=w(i,d,t.select,n,o),i=w(i,a,t.check,n,o),function(e,t,i){if(i&&!s.isArray(i)&&i.applyCheckIndeterminate){const{field:n}=N(i,I),r=i.checkIndeterminateField||g;for(let i=0;i<e.length;i++){const d=e[i],a=d[t];a&&U(a,s.getNestedValue(n,d)?[]:[d],t,n,r)}}}(i,o,t.check),i}}));
|
package/index.d.mts
CHANGED
|
@@ -85,7 +85,7 @@ export declare function handleTreeViewCheckChange(event: TreeViewExpandChangeEve
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* The props of the ItemRender component ([see example](
|
|
88
|
+
* The props of the ItemRender component ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/custom-rendering)).
|
|
89
89
|
*/
|
|
90
90
|
export declare interface ItemRenderProps {
|
|
91
91
|
/**
|
|
@@ -205,9 +205,9 @@ export declare function moveTreeViewItem(sourceItemHierarchicalIndex: string, so
|
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* A helper function which applies the specified operation descriptors to the data.
|
|
208
|
-
* * [Expanding and collapsing items](
|
|
209
|
-
* * [Selecting and deselecting items](
|
|
210
|
-
* * [Checking and unchecking items](
|
|
208
|
+
* * [Expanding and collapsing items](https://www.telerik.com/kendo-react-ui/components/treeview/expansion/update-expanded-items#toc-using-a-helper-function)
|
|
209
|
+
* * [Selecting and deselecting items](https://www.telerik.com/kendo-react-ui/components/treeview/selection/update-selected-items#toc-using-a-helper-function)
|
|
210
|
+
* * [Checking and unchecking items](https://www.telerik.com/kendo-react-ui/components/treeview/checkboxes/helper-functions)
|
|
211
211
|
*
|
|
212
212
|
* @param data - The data that will be processed.
|
|
213
213
|
* @param operations - The operation descriptors that will be applied to the data.
|
|
@@ -258,7 +258,7 @@ export declare function processTreeViewItems(data: any[] | null | undefined, ope
|
|
|
258
258
|
export declare const TreeView: ForwardRefExoticComponent<TreeViewProps & RefAttributes<any>>;
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
|
-
* Represents the object of the `onCheckChange` event ([see example](
|
|
261
|
+
* Represents the object of the `onCheckChange` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/checkboxes/helper-functions)).
|
|
262
262
|
*/
|
|
263
263
|
export declare interface TreeViewCheckChangeEvent extends BaseEvent<TreeViewClassComponent> {
|
|
264
264
|
/**
|
|
@@ -306,7 +306,7 @@ export declare interface TreeViewCheckDescriptor extends TreeViewOperationDescri
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
|
-
* Represents the [KendoReact TreeView component](
|
|
309
|
+
* Represents the [KendoReact TreeView component](https://www.telerik.com/kendo-react-ui/components/treeview).
|
|
310
310
|
*
|
|
311
311
|
* @example
|
|
312
312
|
* ```jsx
|
|
@@ -421,7 +421,7 @@ export declare class TreeViewClassComponent extends React_2.Component<TreeViewPr
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
|
-
* Represents the object of the `onContextMenu` event ([see example](
|
|
424
|
+
* Represents the object of the `onContextMenu` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)).
|
|
425
425
|
*/
|
|
426
426
|
export declare interface TreeViewContextMenuEvent extends BaseEvent<TreeViewClassComponent> {
|
|
427
427
|
/**
|
|
@@ -714,7 +714,7 @@ declare interface TreeViewDragClueState {
|
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
/**
|
|
717
|
-
* Represents the object of the `onExpandChange` event ([see example](
|
|
717
|
+
* Represents the object of the `onExpandChange` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)).
|
|
718
718
|
*/
|
|
719
719
|
export declare interface TreeViewExpandChangeEvent extends BaseEvent<TreeViewClassComponent> {
|
|
720
720
|
/**
|
|
@@ -734,7 +734,7 @@ export declare interface TreeViewHandle extends Pick<TreeViewClassComponent, key
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
/**
|
|
737
|
-
* Represents the object of the `onItemClick` event ([see example](
|
|
737
|
+
* Represents the object of the `onItemClick` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)).
|
|
738
738
|
*/
|
|
739
739
|
export declare interface TreeViewItemClickEvent extends BaseEvent<TreeViewClassComponent> {
|
|
740
740
|
/**
|
|
@@ -749,7 +749,7 @@ export declare interface TreeViewItemClickEvent extends BaseEvent<TreeViewClassC
|
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
/**
|
|
752
|
-
* Represents the object of the `onItemDragEnd` event ([see example](
|
|
752
|
+
* Represents the object of the `onItemDragEnd` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
753
753
|
*/
|
|
754
754
|
export declare interface TreeViewItemDragEndEvent {
|
|
755
755
|
/**
|
|
@@ -788,7 +788,7 @@ export declare interface TreeViewItemDragEndEvent {
|
|
|
788
788
|
}
|
|
789
789
|
|
|
790
790
|
/**
|
|
791
|
-
* Represents the object of the `onItemDragOver` event ([see example](
|
|
791
|
+
* Represents the object of the `onItemDragOver` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
792
792
|
*/
|
|
793
793
|
export declare interface TreeViewItemDragOverEvent {
|
|
794
794
|
/**
|
|
@@ -974,7 +974,7 @@ export declare interface TreeViewOperationDescriptors {
|
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
/**
|
|
977
|
-
* Represents the props of the [KendoReact TreeView component](
|
|
977
|
+
* Represents the props of the [KendoReact TreeView component](https://www.telerik.com/kendo-react-ui/components/treeview).
|
|
978
978
|
*/
|
|
979
979
|
export declare interface TreeViewProps {
|
|
980
980
|
/**
|
|
@@ -1037,7 +1037,7 @@ export declare interface TreeViewProps {
|
|
|
1037
1037
|
* The TreeView has a built-in implementation of focusing and keyboard navigation. By default, the component uses
|
|
1038
1038
|
* hierarchical indices to uniquely match the focused item. You can use the `focusIdField` prop for specifying the
|
|
1039
1039
|
* name of the field which will uniquely describe an
|
|
1040
|
-
* item as an alternative to its hierarchical index ([see example](
|
|
1040
|
+
* item as an alternative to its hierarchical index ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/data-reload#toc-using-item-ids)).
|
|
1041
1041
|
*
|
|
1042
1042
|
* Example:
|
|
1043
1043
|
* ```jsx
|
|
@@ -1056,7 +1056,7 @@ export declare interface TreeViewProps {
|
|
|
1056
1056
|
*/
|
|
1057
1057
|
getFocusHierarchicalIndex?: (itemId: any) => string | undefined;
|
|
1058
1058
|
/**
|
|
1059
|
-
* Controls the rendering of the expand (collapse) icons. By default, the icons are not rendered ([see example](
|
|
1059
|
+
* Controls the rendering of the expand (collapse) icons. By default, the icons are not rendered ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/expansion/update-expanded-items)).
|
|
1060
1060
|
*
|
|
1061
1061
|
* Example:
|
|
1062
1062
|
* ```jsx
|
|
@@ -1074,7 +1074,7 @@ export declare interface TreeViewProps {
|
|
|
1074
1074
|
*/
|
|
1075
1075
|
onExpandChange?: (event: events.TreeViewExpandChangeEvent) => void;
|
|
1076
1076
|
/**
|
|
1077
|
-
* Fires when an item is clicked or when `Enter` is pressed on a focused item ([see example](
|
|
1077
|
+
* Fires when an item is clicked or when `Enter` is pressed on a focused item ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/selection/update-selected-items)).
|
|
1078
1078
|
*
|
|
1079
1079
|
* Example:
|
|
1080
1080
|
* ```jsx
|
|
@@ -1116,7 +1116,7 @@ export declare interface TreeViewProps {
|
|
|
1116
1116
|
*/
|
|
1117
1117
|
iconField?: string;
|
|
1118
1118
|
/**
|
|
1119
|
-
* Specifies the name of the field which indicates to the TreeView that an item has children even if the children are not initially passed. Used for implementing the load-on-demand feature ([see example](
|
|
1119
|
+
* Specifies the name of the field which indicates to the TreeView that an item has children even if the children are not initially passed. Used for implementing the load-on-demand feature ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/data-binding#toc-loading-data-on-demand)).
|
|
1120
1120
|
*
|
|
1121
1121
|
* @default "hasChildren"
|
|
1122
1122
|
*
|
|
@@ -1160,7 +1160,7 @@ export declare interface TreeViewProps {
|
|
|
1160
1160
|
*/
|
|
1161
1161
|
disableField?: string;
|
|
1162
1162
|
/**
|
|
1163
|
-
* Defines the component that will be used for rendering each of the TreeView items ([see example](
|
|
1163
|
+
* Defines the component that will be used for rendering each of the TreeView items ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/custom-rendering)).
|
|
1164
1164
|
*
|
|
1165
1165
|
* Example:
|
|
1166
1166
|
* ```jsx
|
|
@@ -1171,7 +1171,7 @@ export declare interface TreeViewProps {
|
|
|
1171
1171
|
/**
|
|
1172
1172
|
* Indicates that the user can select more than one TreeView items.
|
|
1173
1173
|
* If the TreeView is in a multiple selection mode, set the `aria-multiselectable`
|
|
1174
|
-
* prop to `true` ([more on accessibility by the TreeView](
|
|
1174
|
+
* prop to `true` ([more on accessibility by the TreeView](https://www.telerik.com/kendo-react-ui/components/treeview/accessibility/wai-aria-support)).
|
|
1175
1175
|
*
|
|
1176
1176
|
* Example:
|
|
1177
1177
|
* ```jsx
|
|
@@ -1180,7 +1180,7 @@ export declare interface TreeViewProps {
|
|
|
1180
1180
|
*/
|
|
1181
1181
|
'aria-multiselectable'?: boolean | 'false' | 'true';
|
|
1182
1182
|
/**
|
|
1183
|
-
* Defines a string value that labels the TreeView ([more on accessibility by the TreeView](
|
|
1183
|
+
* Defines a string value that labels the TreeView ([more on accessibility by the TreeView](https://www.telerik.com/kendo-react-ui/components/treeview/accessibility/wai-aria-support)).
|
|
1184
1184
|
*
|
|
1185
1185
|
* Example:
|
|
1186
1186
|
* ```jsx
|
|
@@ -1189,7 +1189,7 @@ export declare interface TreeViewProps {
|
|
|
1189
1189
|
*/
|
|
1190
1190
|
'aria-label'?: string;
|
|
1191
1191
|
/**
|
|
1192
|
-
* Identifies the element or elements which will label the TreeView ([more on accessibility by the TreeView](
|
|
1192
|
+
* Identifies the element or elements which will label the TreeView ([more on accessibility by the TreeView](https://www.telerik.com/kendo-react-ui/components/treeview/accessibility/wai-aria-support)).
|
|
1193
1193
|
*
|
|
1194
1194
|
* Example:
|
|
1195
1195
|
* ```jsx
|
|
@@ -1238,7 +1238,7 @@ export declare interface TreeViewProps {
|
|
|
1238
1238
|
*/
|
|
1239
1239
|
onCheckChange?: (event: events.TreeViewCheckChangeEvent) => void;
|
|
1240
1240
|
/**
|
|
1241
|
-
* Controls the dispatching of the `drag` events. By default, the `drag` events are not dispatched ([see example](
|
|
1241
|
+
* Controls the dispatching of the `drag` events. By default, the `drag` events are not dispatched ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
1242
1242
|
*/
|
|
1243
1243
|
draggable?: boolean;
|
|
1244
1244
|
/**
|
|
@@ -1251,7 +1251,7 @@ export declare interface TreeViewProps {
|
|
|
1251
1251
|
*/
|
|
1252
1252
|
onItemDragStart?: (event: events.TreeViewItemDragStartEvent) => void;
|
|
1253
1253
|
/**
|
|
1254
|
-
* Fires when a dragged item changes its position ([see example](
|
|
1254
|
+
* Fires when a dragged item changes its position ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
1255
1255
|
*
|
|
1256
1256
|
* Example:
|
|
1257
1257
|
* ```jsx
|
|
@@ -1260,7 +1260,7 @@ export declare interface TreeViewProps {
|
|
|
1260
1260
|
*/
|
|
1261
1261
|
onItemDragOver?: (event: events.TreeViewItemDragOverEvent) => void;
|
|
1262
1262
|
/**
|
|
1263
|
-
* Fires when a dragged item is dropped ([see example](
|
|
1263
|
+
* Fires when a dragged item is dropped ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
1264
1264
|
*
|
|
1265
1265
|
* Example:
|
|
1266
1266
|
* ```jsx
|
package/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export declare function handleTreeViewCheckChange(event: TreeViewExpandChangeEve
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* The props of the ItemRender component ([see example](
|
|
88
|
+
* The props of the ItemRender component ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/custom-rendering)).
|
|
89
89
|
*/
|
|
90
90
|
export declare interface ItemRenderProps {
|
|
91
91
|
/**
|
|
@@ -205,9 +205,9 @@ export declare function moveTreeViewItem(sourceItemHierarchicalIndex: string, so
|
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* A helper function which applies the specified operation descriptors to the data.
|
|
208
|
-
* * [Expanding and collapsing items](
|
|
209
|
-
* * [Selecting and deselecting items](
|
|
210
|
-
* * [Checking and unchecking items](
|
|
208
|
+
* * [Expanding and collapsing items](https://www.telerik.com/kendo-react-ui/components/treeview/expansion/update-expanded-items#toc-using-a-helper-function)
|
|
209
|
+
* * [Selecting and deselecting items](https://www.telerik.com/kendo-react-ui/components/treeview/selection/update-selected-items#toc-using-a-helper-function)
|
|
210
|
+
* * [Checking and unchecking items](https://www.telerik.com/kendo-react-ui/components/treeview/checkboxes/helper-functions)
|
|
211
211
|
*
|
|
212
212
|
* @param data - The data that will be processed.
|
|
213
213
|
* @param operations - The operation descriptors that will be applied to the data.
|
|
@@ -258,7 +258,7 @@ export declare function processTreeViewItems(data: any[] | null | undefined, ope
|
|
|
258
258
|
export declare const TreeView: ForwardRefExoticComponent<TreeViewProps & RefAttributes<any>>;
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
|
-
* Represents the object of the `onCheckChange` event ([see example](
|
|
261
|
+
* Represents the object of the `onCheckChange` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/checkboxes/helper-functions)).
|
|
262
262
|
*/
|
|
263
263
|
export declare interface TreeViewCheckChangeEvent extends BaseEvent<TreeViewClassComponent> {
|
|
264
264
|
/**
|
|
@@ -306,7 +306,7 @@ export declare interface TreeViewCheckDescriptor extends TreeViewOperationDescri
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
|
-
* Represents the [KendoReact TreeView component](
|
|
309
|
+
* Represents the [KendoReact TreeView component](https://www.telerik.com/kendo-react-ui/components/treeview).
|
|
310
310
|
*
|
|
311
311
|
* @example
|
|
312
312
|
* ```jsx
|
|
@@ -421,7 +421,7 @@ export declare class TreeViewClassComponent extends React_2.Component<TreeViewPr
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
|
-
* Represents the object of the `onContextMenu` event ([see example](
|
|
424
|
+
* Represents the object of the `onContextMenu` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)).
|
|
425
425
|
*/
|
|
426
426
|
export declare interface TreeViewContextMenuEvent extends BaseEvent<TreeViewClassComponent> {
|
|
427
427
|
/**
|
|
@@ -714,7 +714,7 @@ declare interface TreeViewDragClueState {
|
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
/**
|
|
717
|
-
* Represents the object of the `onExpandChange` event ([see example](
|
|
717
|
+
* Represents the object of the `onExpandChange` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)).
|
|
718
718
|
*/
|
|
719
719
|
export declare interface TreeViewExpandChangeEvent extends BaseEvent<TreeViewClassComponent> {
|
|
720
720
|
/**
|
|
@@ -734,7 +734,7 @@ export declare interface TreeViewHandle extends Pick<TreeViewClassComponent, key
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
/**
|
|
737
|
-
* Represents the object of the `onItemClick` event ([see example](
|
|
737
|
+
* Represents the object of the `onItemClick` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview)).
|
|
738
738
|
*/
|
|
739
739
|
export declare interface TreeViewItemClickEvent extends BaseEvent<TreeViewClassComponent> {
|
|
740
740
|
/**
|
|
@@ -749,7 +749,7 @@ export declare interface TreeViewItemClickEvent extends BaseEvent<TreeViewClassC
|
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
/**
|
|
752
|
-
* Represents the object of the `onItemDragEnd` event ([see example](
|
|
752
|
+
* Represents the object of the `onItemDragEnd` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
753
753
|
*/
|
|
754
754
|
export declare interface TreeViewItemDragEndEvent {
|
|
755
755
|
/**
|
|
@@ -788,7 +788,7 @@ export declare interface TreeViewItemDragEndEvent {
|
|
|
788
788
|
}
|
|
789
789
|
|
|
790
790
|
/**
|
|
791
|
-
* Represents the object of the `onItemDragOver` event ([see example](
|
|
791
|
+
* Represents the object of the `onItemDragOver` event ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
792
792
|
*/
|
|
793
793
|
export declare interface TreeViewItemDragOverEvent {
|
|
794
794
|
/**
|
|
@@ -974,7 +974,7 @@ export declare interface TreeViewOperationDescriptors {
|
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
/**
|
|
977
|
-
* Represents the props of the [KendoReact TreeView component](
|
|
977
|
+
* Represents the props of the [KendoReact TreeView component](https://www.telerik.com/kendo-react-ui/components/treeview).
|
|
978
978
|
*/
|
|
979
979
|
export declare interface TreeViewProps {
|
|
980
980
|
/**
|
|
@@ -1037,7 +1037,7 @@ export declare interface TreeViewProps {
|
|
|
1037
1037
|
* The TreeView has a built-in implementation of focusing and keyboard navigation. By default, the component uses
|
|
1038
1038
|
* hierarchical indices to uniquely match the focused item. You can use the `focusIdField` prop for specifying the
|
|
1039
1039
|
* name of the field which will uniquely describe an
|
|
1040
|
-
* item as an alternative to its hierarchical index ([see example](
|
|
1040
|
+
* item as an alternative to its hierarchical index ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/data-reload#toc-using-item-ids)).
|
|
1041
1041
|
*
|
|
1042
1042
|
* Example:
|
|
1043
1043
|
* ```jsx
|
|
@@ -1056,7 +1056,7 @@ export declare interface TreeViewProps {
|
|
|
1056
1056
|
*/
|
|
1057
1057
|
getFocusHierarchicalIndex?: (itemId: any) => string | undefined;
|
|
1058
1058
|
/**
|
|
1059
|
-
* Controls the rendering of the expand (collapse) icons. By default, the icons are not rendered ([see example](
|
|
1059
|
+
* Controls the rendering of the expand (collapse) icons. By default, the icons are not rendered ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/expansion/update-expanded-items)).
|
|
1060
1060
|
*
|
|
1061
1061
|
* Example:
|
|
1062
1062
|
* ```jsx
|
|
@@ -1074,7 +1074,7 @@ export declare interface TreeViewProps {
|
|
|
1074
1074
|
*/
|
|
1075
1075
|
onExpandChange?: (event: events.TreeViewExpandChangeEvent) => void;
|
|
1076
1076
|
/**
|
|
1077
|
-
* Fires when an item is clicked or when `Enter` is pressed on a focused item ([see example](
|
|
1077
|
+
* Fires when an item is clicked or when `Enter` is pressed on a focused item ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/selection/update-selected-items)).
|
|
1078
1078
|
*
|
|
1079
1079
|
* Example:
|
|
1080
1080
|
* ```jsx
|
|
@@ -1116,7 +1116,7 @@ export declare interface TreeViewProps {
|
|
|
1116
1116
|
*/
|
|
1117
1117
|
iconField?: string;
|
|
1118
1118
|
/**
|
|
1119
|
-
* Specifies the name of the field which indicates to the TreeView that an item has children even if the children are not initially passed. Used for implementing the load-on-demand feature ([see example](
|
|
1119
|
+
* Specifies the name of the field which indicates to the TreeView that an item has children even if the children are not initially passed. Used for implementing the load-on-demand feature ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/data-binding#toc-loading-data-on-demand)).
|
|
1120
1120
|
*
|
|
1121
1121
|
* @default "hasChildren"
|
|
1122
1122
|
*
|
|
@@ -1160,7 +1160,7 @@ export declare interface TreeViewProps {
|
|
|
1160
1160
|
*/
|
|
1161
1161
|
disableField?: string;
|
|
1162
1162
|
/**
|
|
1163
|
-
* Defines the component that will be used for rendering each of the TreeView items ([see example](
|
|
1163
|
+
* Defines the component that will be used for rendering each of the TreeView items ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/custom-rendering)).
|
|
1164
1164
|
*
|
|
1165
1165
|
* Example:
|
|
1166
1166
|
* ```jsx
|
|
@@ -1171,7 +1171,7 @@ export declare interface TreeViewProps {
|
|
|
1171
1171
|
/**
|
|
1172
1172
|
* Indicates that the user can select more than one TreeView items.
|
|
1173
1173
|
* If the TreeView is in a multiple selection mode, set the `aria-multiselectable`
|
|
1174
|
-
* prop to `true` ([more on accessibility by the TreeView](
|
|
1174
|
+
* prop to `true` ([more on accessibility by the TreeView](https://www.telerik.com/kendo-react-ui/components/treeview/accessibility/wai-aria-support)).
|
|
1175
1175
|
*
|
|
1176
1176
|
* Example:
|
|
1177
1177
|
* ```jsx
|
|
@@ -1180,7 +1180,7 @@ export declare interface TreeViewProps {
|
|
|
1180
1180
|
*/
|
|
1181
1181
|
'aria-multiselectable'?: boolean | 'false' | 'true';
|
|
1182
1182
|
/**
|
|
1183
|
-
* Defines a string value that labels the TreeView ([more on accessibility by the TreeView](
|
|
1183
|
+
* Defines a string value that labels the TreeView ([more on accessibility by the TreeView](https://www.telerik.com/kendo-react-ui/components/treeview/accessibility/wai-aria-support)).
|
|
1184
1184
|
*
|
|
1185
1185
|
* Example:
|
|
1186
1186
|
* ```jsx
|
|
@@ -1189,7 +1189,7 @@ export declare interface TreeViewProps {
|
|
|
1189
1189
|
*/
|
|
1190
1190
|
'aria-label'?: string;
|
|
1191
1191
|
/**
|
|
1192
|
-
* Identifies the element or elements which will label the TreeView ([more on accessibility by the TreeView](
|
|
1192
|
+
* Identifies the element or elements which will label the TreeView ([more on accessibility by the TreeView](https://www.telerik.com/kendo-react-ui/components/treeview/accessibility/wai-aria-support)).
|
|
1193
1193
|
*
|
|
1194
1194
|
* Example:
|
|
1195
1195
|
* ```jsx
|
|
@@ -1238,7 +1238,7 @@ export declare interface TreeViewProps {
|
|
|
1238
1238
|
*/
|
|
1239
1239
|
onCheckChange?: (event: events.TreeViewCheckChangeEvent) => void;
|
|
1240
1240
|
/**
|
|
1241
|
-
* Controls the dispatching of the `drag` events. By default, the `drag` events are not dispatched ([see example](
|
|
1241
|
+
* Controls the dispatching of the `drag` events. By default, the `drag` events are not dispatched ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
1242
1242
|
*/
|
|
1243
1243
|
draggable?: boolean;
|
|
1244
1244
|
/**
|
|
@@ -1251,7 +1251,7 @@ export declare interface TreeViewProps {
|
|
|
1251
1251
|
*/
|
|
1252
1252
|
onItemDragStart?: (event: events.TreeViewItemDragStartEvent) => void;
|
|
1253
1253
|
/**
|
|
1254
|
-
* Fires when a dragged item changes its position ([see example](
|
|
1254
|
+
* Fires when a dragged item changes its position ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
1255
1255
|
*
|
|
1256
1256
|
* Example:
|
|
1257
1257
|
* ```jsx
|
|
@@ -1260,7 +1260,7 @@ export declare interface TreeViewProps {
|
|
|
1260
1260
|
*/
|
|
1261
1261
|
onItemDragOver?: (event: events.TreeViewItemDragOverEvent) => void;
|
|
1262
1262
|
/**
|
|
1263
|
-
* Fires when a dragged item is dropped ([see example](
|
|
1263
|
+
* Fires when a dragged item is dropped ([see example](https://www.telerik.com/kendo-react-ui/components/treeview/drag-drop)).
|
|
1264
1264
|
*
|
|
1265
1265
|
* Example:
|
|
1266
1266
|
* ```jsx
|
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=Object.freeze({name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-treeview",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1768210100,version:"13.3.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = Object.freeze({
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "13.3.0-develop.
|
|
13
|
+
publishDate: 1768210100,
|
|
14
|
+
version: "13.3.0-develop.3",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
});
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-treeview",
|
|
3
|
-
"version": "13.3.0-develop.
|
|
3
|
+
"version": "13.3.0-develop.3",
|
|
4
4
|
"description": "React TreeView displays hierarchical data in a traditional tree structure, supports user interaction. KendoReact TreeView package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-react-animation": "13.3.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "13.3.0-develop.
|
|
29
|
+
"@progress/kendo-react-animation": "13.3.0-develop.3",
|
|
30
|
+
"@progress/kendo-react-common": "13.3.0-develop.3",
|
|
31
31
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"package": {
|
|
54
54
|
"productName": "KendoReact",
|
|
55
55
|
"productCode": "KENDOUIREACT",
|
|
56
|
-
"publishDate":
|
|
56
|
+
"publishDate": 1768210100,
|
|
57
57
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
58
58
|
}
|
|
59
59
|
},
|