@progress/kendo-vue-listbox 8.4.0-develop.4 → 9.0.0-develop.1
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.
|
@@ -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("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-vue-intl"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-vue-intl","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueListbox={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoVueIntl,e.KendoSVGIcons)}(this,function(e,t,o,s,n,r){"use strict";let a=function(e){return e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e}({});const i={name:"@progress/kendo-vue-listbox",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1672219056,version:"
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-vue-intl"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-vue-intl","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueListbox={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoVueIntl,e.KendoSVGIcons)}(this,function(e,t,o,s,n,r){"use strict";let a=function(e){return e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e}({});const i={name:"@progress/kendo-vue-listbox",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1672219056,version:"9.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"},l=t.defineComponent({name:"KendoListBox",emits:{dragstart:null,itemclick:null,drop:null,dragover:null,keydown:null,dragleave:null},props:{size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},toolbarPosition:{type:String,default:a.RIGHT,validator:function(e){return["none","top","bottom","left","right"].includes(e)}},textField:String,valueField:String,keyField:String,selectedField:String,item:[String,Object,Function],toolbar:[String,Object,Function],tabIndex:Number,dataItems:{type:Array,default:function(){return[]}},draggable:{type:Boolean,default:!1}},created(){o.validatePackage(i)},computed:{wrapperClass(){const e=this.$props.toolbarPosition===a.NONE||void 0===this.$props.toolbar;return{"k-listbox":!0,[`k-listbox-actions-${this.$props.toolbarPosition}`]:!e}}},render(){const e=o.templateRendering.call(this,this.$props.toolbar,o.getListeners.call(this)),s=o.getTemplate.call(this,{h:t.h,template:e});return t.createVNode("div",{class:this.wrapperClass,unselectable:"on"},["bottom"!==this.$props.toolbarPosition&&s,t.createVNode("div",{class:"k-list-scroller k-selectable","data-role":"selectable",onDragover:e=>e.preventDefault(),onDrop:this.handleContainerDrop,onDragleave:this.handleOnDragLeave},[t.createVNode("div",{class:o.classNames("k-list",{[`k-list-${o.kendoThemeMaps.sizeMap[this.$props.size]||this.$props.size}`]:this.$props.size})},[t.createVNode("div",{class:"k-list-content"},[t.createVNode("ul",{class:"k-list-ul",role:"listbox","aria-label":"listbox-container",tabindex:this.tabIndex,onKeydown:this.handleKeyDown},[this.$props.dataItems.map(function(e,s){let n=this.setSelected(e),r=o.guid();const a=t.createVNode("span",{class:"k-list-item-text"},[this.$props.textField?e[this.$props.textField]:e.toString()]),i=o.templateRendering.call(this,this.$props.item,o.getListeners.call(this)),l=o.getTemplate.call(this,{h:t.h,template:i,defaultRendering:a,additionalProps:{dataItem:e,index:s}});return t.createVNode("li",{class:o.classNames("k-list-item",{"k-selected":n},e.class),style:e.style,role:"option","aria-selected":n,key:this.$props.keyField?e[this.$props.keyField]:s,id:r+s,"data-uid":r+s,draggable:this.$props.draggable,onDragstart:t=>this.dispatchEvent("dragstart",t,e),onDragover:t=>{t.preventDefault(),this.dispatchEvent("dragover",t,e)},onDrop:t=>this.dispatchEvent("drop",t,e),onClick:t=>this.dispatchEvent("itemclick",t,e)},[l])},this)])])])]),"bottom"===this.$props.toolbarPosition&&s,t.createVNode("select",{style:{display:"none"},multiple:!0,"data-role":"listbox"},[this.$props.dataItems.map(function(e,o){let s=e[this.$props.valueField||this.$props.textField];return t.createVNode("option",{key:o,value:s},[s])},this)])])},methods:{dispatchEvent(e,t,o){this.$emit(e,{event:t,component:this,dataItem:o})},setSelected(e){if(this.$props.selectedField)return!!e[this.$props.selectedField]},handleKeyDown(e){this.$emit("keydown",{event:e,component:this})},handleContainerDrop(e){const t=e.target,o=t.closest(".k-list-scroller"),s=t.closest(".k-list-ul"),n=this.$props.dataItems;o&&!s&&this.$emit("drop",{event:e,component:this,dataItem:n.length>0?n[n.length-1]:null})},handleOnDragLeave(e){e.target.classList.contains("k-list-content")&&this.$emit("dragleave",{event:e,component:this})}}}),c="listbox.moveUp",d="listbox.moveDown",p="listbox.transferTo",h="listbox.transferFrom",u="listbox.transferAllTo",m="listbox.transferAllFrom",v="listbox.remove",g={[c]:"Move Up",[d]:"Move Down",[p]:"Transfer To",[h]:"Transfer From",[u]:"Transfer All To",[m]:"Transfer All From",[v]:"Delete"},f=[{name:"moveUp",iconName:"chevron-up",svgIcon:r.chevronUpIcon},{name:"moveDown",iconName:"chevron-down",svgIcon:r.chevronDownIcon},{name:"transferTo",iconName:"chevron-right",svgIcon:r.chevronRightIcon},{name:"transferFrom",iconName:"chevron-left",svgIcon:r.chevronLeftIcon},{name:"transferAllTo",iconName:"chevron-double-right",svgIcon:r.chevronDoubleRightIcon},{name:"transferAllFrom",iconName:"chevron-double-left",svgIcon:r.chevronDoubleLeftIcon},{name:"remove",iconName:"x",svgIcon:r.xIcon}],b=t.defineComponent({name:"KendoListBoxToolbar",props:{dataItems:Array,dataConnected:Array,tools:Array,selectedField:{type:String,default:"selected"}},inject:{kendoLocalizationService:{default:null}},data:()=>({currentRtl:!1}),mounted(){this.currentRtl=o.isRtl(this.$el)},render(){const e=n.provideLocalizationService(this);return t.createVNode("div",{class:"k-listbox-actions"},[this.$props.tools&&this.$props.tools.map(function(o,n){let r=f.findIndex(e=>e.name===o),a=f[r],i=this.isItemDisabled(a.name),l=`listbox.${a.name}`;const c=e.toLanguageString(l,g[l]);return t.createVNode(s.Button,{key:n,disabled:i,"data-command":a.name,title:c,"aria-label":c,icon:this.currentRtl?this.getRtlFontIcon(a.iconName):a.iconName,svgIcon:this.currentRtl?this.getRtlSvgIcon(a.svgIcon):a.svgIcon,onClick:e=>{e.preventDefault(),this.handleToolClick(e,a.name||null)}},null)},this)])},methods:{getRtlSvgIcon(e){switch(e.name){case"chevron-right":return r.chevronLeftIcon;case"chevron-left":return r.chevronRightIcon;case"chevron-double-right":return r.chevronDoubleLeftIcon;case"chevron-double-left":return r.chevronDoubleRightIcon}return e},getRtlFontIcon(e){switch(e){case"chevron-right":return"chevron-left";case"chevron-left":return"chevron-right";case"chevron-double-right":return"chevron-double-left";case"chevron-double-left":return"chevron-double-right"}return e},handleToolClick(e,t){this.$emit("toolclick",{event:e,component:this,toolName:t})},isItemDisabled(e){let t=!0,o=this.$props.selectedField||"selected",s=this.$props.dataItems.length,n=this.$props.dataConnected.length,r=this.$props.dataItems.findIndex(e=>!0===e[o])>=0,a=this.$props.dataConnected.findIndex(e=>!0===e[o])>=0;switch(e){case"moveUp":t=r?!(this.$props.dataItems.length>0)||this.$props.dataItems[0].selected:!a||(!(this.$props.dataConnected.length>0)||this.$props.dataConnected[0].selected);break;case"moveDown":t=r?!this.$props.dataItems[s-1]||this.$props.dataItems[s-1].selectedField:!a||(!(this.$props.dataConnected.length>0)||this.$props.dataConnected[n-1].selected);break;case"transferTo":t=!(this.$props.dataConnected&&r);break;case"transferFrom":t=!this.$props.dataConnected||!(this.$props.dataConnected&&a);break;case"transferAllTo":t=!(this.$props.dataConnected&&this.$props.dataItems.length>0);break;case"transferAllFrom":t=!(this.$props.dataConnected&&this.$props.dataConnected.length>0);break;case"remove":t=!(r||a)}return t}}}),x=(e,t,o)=>{let s=o.splice(e,1)[0];return o.splice(t,0,s),o};e.ListBox=l,e.ListBoxToolbar=b,e.moveItem=x,e.processListBoxData=(e=[],t=[],o,s)=>{let n=[],r=[],a=[],i={listBoxOneData:e,listBoxTwoData:t};switch(o){case"moveUp":n=[...e],n.forEach((e,t)=>{e[s]&&(n=x(t,t-1,n))}),a=[...t],a.forEach((e,t)=>{e[s]&&(a=x(t,t-1,a))}),i.listBoxOneData=n,i.listBoxTwoData=a;break;case"moveDown":n=e.reverse(),n.forEach((e,t)=>{e[s]&&(n=x(t,t-1,n))}),a=t.reverse(),a.forEach((e,t)=>{e[s]&&(a=x(t,t-1,a))}),i.listBoxOneData=[...n].reverse(),i.listBoxTwoData=[...a].reverse();break;case"transferTo":n=e.filter(e=>!e[s]),r=e.filter(e=>e[s]),a=t.concat(r),i.listBoxOneData=n,i.listBoxTwoData=a;break;case"transferFrom":a=t.filter(e=>!e[s]),r=t.filter(e=>e[s]),n=e.concat(r),i.listBoxOneData=n,i.listBoxTwoData=a;break;case"transferAllTo":i.listBoxOneData=[],i.listBoxTwoData=t.concat(e);break;case"transferAllFrom":i.listBoxOneData=t.concat(e),i.listBoxTwoData=[];break;case"remove":a=t.filter(e=>!e[s]),n=e.filter(e=>!e[s]),i.listBoxOneData=n,i.listBoxTwoData=a}return i},e.processListBoxDragAndDrop=(e=[],t=[],o,s,n)=>{let r=e.findIndex(e=>e[n]===o[n]),a=t.findIndex(e=>e[n]===o[n]),i=null!==s?e.findIndex(e=>e[n]===s[n]):-1,l=null!==s?t.findIndex(e=>e[n]===s[n]):-1,c=r>=0,d=a>=0,p=i>=0,h=l>=0,u=[...e],m=[...t];return c&&p?{listBoxOneData:x(r,i,e),listBoxTwoData:t}:d&&h?{listBoxOneData:e,listBoxTwoData:x(a,l,t)}:c&&(h||null===s)?(null===s?m.push(e[r]):m.splice(l+1,0,e[r]),u.splice(r,1),{listBoxOneData:u,listBoxTwoData:m}):d&&(p||null===s)?(null===s?u.push(t[a]):u.splice(i+1,0,t[a]),m.splice(a,1),{listBoxOneData:u,listBoxTwoData:m}):{listBoxOneData:e,listBoxTwoData:t}}});
|
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={name:"@progress/kendo-vue-listbox",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-listbox",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1779205225,version:"9.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "
|
|
13
|
+
publishDate: 1779205225,
|
|
14
|
+
version: "9.0.0-develop.1",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-listbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-develop.1",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@progress/kendo-licensing": "^1.7.2",
|
|
28
|
-
"@progress/kendo-vue-buttons": "
|
|
29
|
-
"@progress/kendo-vue-common": "
|
|
30
|
-
"@progress/kendo-vue-intl": "
|
|
28
|
+
"@progress/kendo-vue-buttons": "9.0.0-develop.1",
|
|
29
|
+
"@progress/kendo-vue-common": "9.0.0-develop.1",
|
|
30
|
+
"@progress/kendo-vue-intl": "9.0.0-develop.1",
|
|
31
31
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
32
32
|
"vue": "^3.0.2"
|
|
33
33
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"package": {
|
|
49
49
|
"productName": "Kendo UI for Vue",
|
|
50
50
|
"productCode": "KENDOUIVUE",
|
|
51
|
-
"publishDate":
|
|
51
|
+
"publishDate": 1779205225,
|
|
52
52
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
53
53
|
}
|
|
54
54
|
},
|