Refactor #5292 - Renamed ButtonGroup

pull/5300/head
tugcekucukoglu 2024-02-16 14:06:57 +03:00
parent 9644394ab2
commit 6cfa1af9e4
12 changed files with 62 additions and 62 deletions

View File

@ -1,11 +1,11 @@
<script> <script>
import BaseComponent from 'primevue/basecomponent'; import BaseComponent from 'primevue/basecomponent';
import ButtonSetStyle from 'primevue/buttonset/style'; import ButtonGroupStyle from 'primevue/buttongroup/style';
export default { export default {
name: 'BaseButtonSet', name: 'BaseButtonGroup',
extends: BaseComponent, extends: BaseComponent,
style: ButtonSetStyle, style: ButtonGroupStyle,
provide() { provide() {
return { return {
$parentInstance: this $parentInstance: this

View File

@ -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/) * [Live Demo](https://www.primevue.org/button/)
* *
* @module buttonset * @module buttongroup
* *
*/ */
import { VNode } from 'vue'; import { VNode } from 'vue';
import { ComponentHooks } from '../basecomponent'; import { ComponentHooks } from '../basecomponent/BaseComponent';
import { PassThroughOptions } from '../passthrough'; import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; 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. * Custom passthrough(pt) option method.
*/ */
export interface ButtonSetPassThroughMethodOptions { export interface ButtonGroupPassThroughMethodOptions {
/** /**
* Defines instance. * Defines instance.
*/ */
@ -25,7 +25,7 @@ export interface ButtonSetPassThroughMethodOptions {
/** /**
* Defines valid properties. * Defines valid properties.
*/ */
props: ButtonSetProps; props: ButtonGroupProps;
/** /**
* Defines passthrough(pt) options in global config. * Defines passthrough(pt) options in global config.
*/ */
@ -34,13 +34,13 @@ export interface ButtonSetPassThroughMethodOptions {
/** /**
* Custom passthrough(pt) options. * 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. * Used to pass attributes to the root's DOM element.
*/ */
root?: ButtonSetPassThroughOptionType; root?: ButtonGroupPassThroughOptionType;
/** /**
* Used to manage all lifecycle hooks. * Used to manage all lifecycle hooks.
* @see {@link BaseComponent.ComponentHooks} * @see {@link BaseComponent.ComponentHooks}
@ -51,19 +51,19 @@ export interface ButtonSetPassThroughOptions {
/** /**
* Custom passthrough attributes for each DOM elements * Custom passthrough attributes for each DOM elements
*/ */
export interface ButtonSetPassThroughAttributes { export interface ButtonGroupPassThroughAttributes {
[key: string]: any; [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. * 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. * Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions} * @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. * 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/) * [Live Demo](https://www.primevue.org/button/)
* --- --- * --- ---
@ -102,12 +102,12 @@ export interface ButtonSetEmits {}
* *
* @group Component * @group Component
*/ */
declare class ButtonSet extends ClassComponent<ButtonSetProps, ButtonSetSlots, ButtonSetEmits> {} declare class ButtonGroup extends ClassComponent<ButtonGroupProps, ButtonGroupSlots, ButtonGroupEmits> {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
interface GlobalComponents { interface GlobalComponents {
ButtonSet: GlobalComponentConstructor<ButtonSet>; ButtonGroup: GlobalComponentConstructor<ButtonGroup>;
} }
} }
export default ButtonSet; export default ButtonGroup;

View File

@ -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>

View File

@ -0,0 +1,9 @@
{
"main": "./buttongroup.cjs.js",
"module": "./buttongroup.esm.js",
"unpkg": "./buttongroup.min.js",
"types": "./ButtonGroup.d.ts",
"browser": {
"./sfc": "./ButtonGroup.vue"
}
}

View File

@ -0,0 +1,3 @@
import { BaseStyle } from '../../base/style/BaseStyle';
export interface ButtonGroupStyle extends BaseStyle {}

View File

@ -1,10 +1,10 @@
import BaseStyle from 'primevue/base/style'; import BaseStyle from 'primevue/base/style';
const classes = { const classes = {
root: 'p-buttonset p-component' root: 'p-button-group p-component'
}; };
export default BaseStyle.extend({ export default BaseStyle.extend({
name: 'buttonset', name: 'buttongroup',
classes classes
}); });

View File

@ -0,0 +1,6 @@
{
"main": "./buttongroupstyle.cjs.js",
"module": "./buttongroupstyle.esm.js",
"unpkg": "./buttongroupstyle.min.js",
"types": "./ButtonGroupStyle.d.ts"
}

View File

@ -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>

View File

@ -1,9 +0,0 @@
{
"main": "./buttonset.cjs.js",
"module": "./buttonset.esm.js",
"unpkg": "./buttonset.min.js",
"types": "./ButtonSet.d.ts",
"browser": {
"./sfc": "./ButtonSet.vue"
}
}

View File

@ -1,3 +0,0 @@
import { BaseStyle } from '../../base/style';
export interface ButtonStyle extends BaseStyle {}

View File

@ -1,6 +0,0 @@
{
"main": "./buttonsetstyle.cjs.js",
"module": "./buttonsetstyle.esm.js",
"unpkg": "./buttonsetstyle.min.js",
"types": "./ButtonSetStyle.d.ts"
}

View File

@ -17,7 +17,7 @@ const STYLE_ALIAS = {
'primevue/blockui/style': path.resolve(__dirname, './components/lib/blockui/style/BlockUIStyle.js'), '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/breadcrumb/style': path.resolve(__dirname, './components/lib/breadcrumb/style/BreadcrumbStyle.js'),
'primevue/button/style': path.resolve(__dirname, './components/lib/button/style/ButtonStyle.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/calendar/style': path.resolve(__dirname, './components/lib/calendar/style/CalendarStyle.js'),
'primevue/card/style': path.resolve(__dirname, './components/lib/card/style/CardStyle.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'), 'primevue/carousel/style': path.resolve(__dirname, './components/lib/carousel/style/CarouselStyle.js'),