Refactor #5292 - Renamed ButtonGroup
parent
9644394ab2
commit
6cfa1af9e4
|
@ -1,11 +1,11 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
import ButtonSetStyle from 'primevue/buttonset/style';
|
||||
import ButtonGroupStyle from 'primevue/buttongroup/style';
|
||||
|
||||
export default {
|
||||
name: 'BaseButtonSet',
|
||||
name: 'BaseButtonGroup',
|
||||
extends: BaseComponent,
|
||||
style: ButtonSetStyle,
|
||||
style: ButtonGroupStyle,
|
||||
provide() {
|
||||
return {
|
||||
$parentInstance: this
|
|
@ -1,23 +1,23 @@
|
|||
/**
|
||||
*
|
||||
* A set of Buttons can be displayed together using the ButtonSet component.
|
||||
* A set of Buttons can be displayed together using the ButtonGroup component.
|
||||
*
|
||||
* [Live Demo](https://www.primevue.org/button/)
|
||||
*
|
||||
* @module buttonset
|
||||
* @module buttongroup
|
||||
*
|
||||
*/
|
||||
import { VNode } from 'vue';
|
||||
import { ComponentHooks } from '../basecomponent';
|
||||
import { ComponentHooks } from '../basecomponent/BaseComponent';
|
||||
import { PassThroughOptions } from '../passthrough';
|
||||
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||
|
||||
export declare type ButtonSetPassThroughOptionType = ButtonSetPassThroughAttributes | ((options: ButtonSetPassThroughMethodOptions) => ButtonSetPassThroughAttributes | string) | string | null | undefined;
|
||||
export declare type ButtonGroupPassThroughOptionType = ButtonGroupPassThroughAttributes | ((options: ButtonGroupPassThroughMethodOptions) => ButtonGroupPassThroughAttributes | string) | string | null | undefined;
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) option method.
|
||||
*/
|
||||
export interface ButtonSetPassThroughMethodOptions {
|
||||
export interface ButtonGroupPassThroughMethodOptions {
|
||||
/**
|
||||
* Defines instance.
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ export interface ButtonSetPassThroughMethodOptions {
|
|||
/**
|
||||
* Defines valid properties.
|
||||
*/
|
||||
props: ButtonSetProps;
|
||||
props: ButtonGroupProps;
|
||||
/**
|
||||
* Defines passthrough(pt) options in global config.
|
||||
*/
|
||||
|
@ -34,13 +34,13 @@ export interface ButtonSetPassThroughMethodOptions {
|
|||
|
||||
/**
|
||||
* Custom passthrough(pt) options.
|
||||
* @see {@link ButtonSetProps.pt}
|
||||
* @see {@link ButtonGroupProps.pt}
|
||||
*/
|
||||
export interface ButtonSetPassThroughOptions {
|
||||
export interface ButtonGroupPassThroughOptions {
|
||||
/**
|
||||
* Used to pass attributes to the root's DOM element.
|
||||
*/
|
||||
root?: ButtonSetPassThroughOptionType;
|
||||
root?: ButtonGroupPassThroughOptionType;
|
||||
/**
|
||||
* Used to manage all lifecycle hooks.
|
||||
* @see {@link BaseComponent.ComponentHooks}
|
||||
|
@ -51,19 +51,19 @@ export interface ButtonSetPassThroughOptions {
|
|||
/**
|
||||
* Custom passthrough attributes for each DOM elements
|
||||
*/
|
||||
export interface ButtonSetPassThroughAttributes {
|
||||
export interface ButtonGroupPassThroughAttributes {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines valid properties in ButtonSet component.
|
||||
* Defines valid properties in ButtonGroup component.
|
||||
*/
|
||||
export interface ButtonSetProps {
|
||||
export interface ButtonGroupProps {
|
||||
/**
|
||||
* Used to pass attributes to DOM elements inside the component.
|
||||
* @type {ButtonSetPassThroughOptions}
|
||||
* @type {ButtonGroupPassThroughOptions}
|
||||
*/
|
||||
pt?: PassThrough<ButtonSetPassThroughOptions>;
|
||||
pt?: PassThrough<ButtonGroupPassThroughOptions>;
|
||||
/**
|
||||
* Used to configure passthrough(pt) options of the component.
|
||||
* @type {PassThroughOptions}
|
||||
|
@ -77,9 +77,9 @@ export interface ButtonSetProps {
|
|||
}
|
||||
|
||||
/**
|
||||
* Defines valid slots in ButtonSet component.
|
||||
* Defines valid slots in ButtonGroup component.
|
||||
*/
|
||||
export interface ButtonSetSlots {
|
||||
export interface ButtonGroupSlots {
|
||||
/**
|
||||
* Default slot to detect Button components.
|
||||
*/
|
||||
|
@ -87,14 +87,14 @@ export interface ButtonSetSlots {
|
|||
}
|
||||
|
||||
/**
|
||||
* Defines valid emits in ButtonSet component.
|
||||
* Defines valid emits in ButtonGroup component.
|
||||
*/
|
||||
export interface ButtonSetEmits {}
|
||||
export interface ButtonGroupEmits {}
|
||||
|
||||
/**
|
||||
* **PrimeVue - ButtonSet**
|
||||
* **PrimeVue - ButtonGroup**
|
||||
*
|
||||
* _A set of Buttons can be displayed together using the ButtonSet component._
|
||||
* _A set of Buttons can be displayed together using the ButtonGroup component._
|
||||
*
|
||||
* [Live Demo](https://www.primevue.org/button/)
|
||||
* --- ---
|
||||
|
@ -102,12 +102,12 @@ export interface ButtonSetEmits {}
|
|||
*
|
||||
* @group Component
|
||||
*/
|
||||
declare class ButtonSet extends ClassComponent<ButtonSetProps, ButtonSetSlots, ButtonSetEmits> {}
|
||||
declare class ButtonGroup extends ClassComponent<ButtonGroupProps, ButtonGroupSlots, ButtonGroupEmits> {}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface GlobalComponents {
|
||||
ButtonSet: GlobalComponentConstructor<ButtonSet>;
|
||||
ButtonGroup: GlobalComponentConstructor<ButtonGroup>;
|
||||
}
|
||||
}
|
||||
|
||||
export default ButtonSet;
|
||||
export default ButtonGroup;
|
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<span :class="cx('root')" role="group" v-bind="ptmi('root')">
|
||||
<slot />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseButtonGroup from './BaseButtonGroup.vue';
|
||||
|
||||
export default {
|
||||
name: 'ButtonGroup',
|
||||
extends: BaseButtonGroup,
|
||||
inheritAttrs: false
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"main": "./buttongroup.cjs.js",
|
||||
"module": "./buttongroup.esm.js",
|
||||
"unpkg": "./buttongroup.min.js",
|
||||
"types": "./ButtonGroup.d.ts",
|
||||
"browser": {
|
||||
"./sfc": "./ButtonGroup.vue"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
import { BaseStyle } from '../../base/style/BaseStyle';
|
||||
|
||||
export interface ButtonGroupStyle extends BaseStyle {}
|
|
@ -1,10 +1,10 @@
|
|||
import BaseStyle from 'primevue/base/style';
|
||||
|
||||
const classes = {
|
||||
root: 'p-buttonset p-component'
|
||||
root: 'p-button-group p-component'
|
||||
};
|
||||
|
||||
export default BaseStyle.extend({
|
||||
name: 'buttonset',
|
||||
name: 'buttongroup',
|
||||
classes
|
||||
});
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"main": "./buttongroupstyle.cjs.js",
|
||||
"module": "./buttongroupstyle.esm.js",
|
||||
"unpkg": "./buttongroupstyle.min.js",
|
||||
"types": "./ButtonGroupStyle.d.ts"
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<template>
|
||||
<span :class="cx('root')" v-bind="ptmi('root')">
|
||||
<slot />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseButtonSet from './BaseButtonSet.vue';
|
||||
|
||||
export default {
|
||||
name: 'ButtonSet',
|
||||
extends: BaseButtonSet,
|
||||
inheritAttrs: false
|
||||
};
|
||||
</script>
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"main": "./buttonset.cjs.js",
|
||||
"module": "./buttonset.esm.js",
|
||||
"unpkg": "./buttonset.min.js",
|
||||
"types": "./ButtonSet.d.ts",
|
||||
"browser": {
|
||||
"./sfc": "./ButtonSet.vue"
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { BaseStyle } from '../../base/style';
|
||||
|
||||
export interface ButtonStyle extends BaseStyle {}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"main": "./buttonsetstyle.cjs.js",
|
||||
"module": "./buttonsetstyle.esm.js",
|
||||
"unpkg": "./buttonsetstyle.min.js",
|
||||
"types": "./ButtonSetStyle.d.ts"
|
||||
}
|
|
@ -17,7 +17,7 @@ const STYLE_ALIAS = {
|
|||
'primevue/blockui/style': path.resolve(__dirname, './components/lib/blockui/style/BlockUIStyle.js'),
|
||||
'primevue/breadcrumb/style': path.resolve(__dirname, './components/lib/breadcrumb/style/BreadcrumbStyle.js'),
|
||||
'primevue/button/style': path.resolve(__dirname, './components/lib/button/style/ButtonStyle.js'),
|
||||
'primevue/buttonset/style': path.resolve(__dirname, './components/lib/buttonset/style/ButtonSetStyle.js'),
|
||||
'primevue/buttongroup/style': path.resolve(__dirname, './components/lib/buttongroup/style/ButtonGroupStyle.js'),
|
||||
'primevue/calendar/style': path.resolve(__dirname, './components/lib/calendar/style/CalendarStyle.js'),
|
||||
'primevue/card/style': path.resolve(__dirname, './components/lib/card/style/CardStyle.js'),
|
||||
'primevue/carousel/style': path.resolve(__dirname, './components/lib/carousel/style/CarouselStyle.js'),
|
||||
|
|
Loading…
Reference in New Issue