UNPKG

@progress/kendo-vue-buttons

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