@progress/kendo-vue-buttons
Version:
9 lines (8 loc) • 1.88 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),u=require("@progress/kendo-vue-common"),c=require("./ButtonWrap.js"),g=require("./util.js"),f=require("./package-metadata.js"),o=g.default.styles,m=i.defineComponent({name:"KendoButtonGroup",props:{disabled:{type:Boolean,default:void 0},width:String,dir:{type:String,default:function(){}}},created(){u.validatePackage(f.packageMetadata)},render(){const t=u.getDefaultSlots(this),d=function(s,n,r,e){const a=u.classNames({[o["state-disabled"]]:this.$props.disabled,[o["group-start"]]:e?r:n===0,[o["group-end"]]:e?n===0:r});return i.h(c.ButtonWrap,{class:a,"aria-disabled":this.$props.disabled},function(){return[s]})},p=function(s){const n=s.length,r=this.$props.dir!==void 0?this.$props.dir==="rtl":this.$el&&getComputedStyle(this.$el).direction==="rtl"||!1;return s.map((e,a)=>this.isValidButton(e)?d.call(this,e,a,a===n-1,r):e)},l=u.classNames([o["button-group"]],{"k-disabled":this.$props.disabled,[o["button-group-stretched"]]:!!this.$props.width});return i.createVNode("div",{style:{width:this.width},dir:this.$props.dir,role:"group","aria-disabled":this.$props.disabled,class:l},[p.call(this,t)])},methods:{isValidButton(t){return t&&t.tag&&t.tag.toLowerCase().indexOf("button")!==-1||t.componentOptions&&t.componentOptions.tag&&t.componentOptions.tag.toLowerCase().indexOf("button")!==-1||t.type&&t.type.name&&t.type.name.toLowerCase().indexOf("kendobutton")!==-1}}});exports.ButtonGroup=m;