mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Fixed #4530 - Export styles of all components
This commit is contained in:
parent
7b6d458067
commit
dc2913e887
463 changed files with 10696 additions and 9670 deletions
|
@ -1,38 +1,6 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
|
||||
const classes = {
|
||||
root: ({ instance, props }) => [
|
||||
'p-button p-component',
|
||||
{
|
||||
'p-button-icon-only': instance.hasIcon && !props.label && !props.badge,
|
||||
'p-button-vertical': (props.iconPos === 'top' || props.iconPos === 'bottom') && props.label,
|
||||
'p-disabled': instance.$attrs.disabled || instance.$attrs.disabled === '' || props.loading,
|
||||
'p-button-loading': props.loading,
|
||||
'p-button-loading-label-only': props.loading && !instance.hasIcon && props.label,
|
||||
'p-button-link': props.link,
|
||||
[`p-button-${props.severity}`]: props.severity,
|
||||
'p-button-raised': props.raised,
|
||||
'p-button-rounded': props.rounded,
|
||||
'p-button-text': props.text,
|
||||
'p-button-outlined': props.outlined,
|
||||
'p-button-sm': props.size === 'small',
|
||||
'p-button-lg': props.size === 'large',
|
||||
'p-button-plain': props.plain
|
||||
}
|
||||
],
|
||||
loadingIcon: 'p-button-loading-icon pi-spin',
|
||||
icon: ({ props }) => [
|
||||
'p-button-icon',
|
||||
{
|
||||
'p-button-icon-left': props.iconPos === 'left' && props.label,
|
||||
'p-button-icon-right': props.iconPos === 'right' && props.label,
|
||||
'p-button-icon-top': props.iconPos === 'top' && props.label,
|
||||
'p-button-icon-bottom': props.iconPos === 'bottom' && props.label
|
||||
}
|
||||
],
|
||||
label: 'p-button-label'
|
||||
};
|
||||
import ButtonStyle from 'primevue/button/style';
|
||||
|
||||
export default {
|
||||
name: 'BaseButton',
|
||||
|
@ -103,9 +71,7 @@ export default {
|
|||
default: false
|
||||
}
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
},
|
||||
style: ButtonStyle,
|
||||
provide() {
|
||||
return {
|
||||
$parentInstance: this
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"main": "./button.cjs.js",
|
||||
"module": "./button.esm.js",
|
||||
"unpkg": "./button.min.js",
|
||||
"types": "./Button.d.ts",
|
||||
"browser": {
|
||||
"./sfc": "./Button.vue"
|
||||
}
|
||||
}
|
||||
"main": "./button.cjs.js",
|
||||
"module": "./button.esm.js",
|
||||
"unpkg": "./button.min.js",
|
||||
"types": "./Button.d.ts",
|
||||
"browser": {
|
||||
"./sfc": "./Button.vue"
|
||||
}
|
||||
}
|
||||
|
|
40
components/lib/button/style/ButtonStyle.js
Normal file
40
components/lib/button/style/ButtonStyle.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import BaseStyle from 'primevue/base/style';
|
||||
|
||||
const classes = {
|
||||
root: ({ instance, props }) => [
|
||||
'p-button p-component',
|
||||
{
|
||||
'p-button-icon-only': instance.hasIcon && !props.label && !props.badge,
|
||||
'p-button-vertical': (props.iconPos === 'top' || props.iconPos === 'bottom') && props.label,
|
||||
'p-disabled': instance.$attrs.disabled || instance.$attrs.disabled === '' || props.loading,
|
||||
'p-button-loading': props.loading,
|
||||
'p-button-loading-label-only': props.loading && !instance.hasIcon && props.label,
|
||||
'p-button-link': props.link,
|
||||
[`p-button-${props.severity}`]: props.severity,
|
||||
'p-button-raised': props.raised,
|
||||
'p-button-rounded': props.rounded,
|
||||
'p-button-text': props.text,
|
||||
'p-button-outlined': props.outlined,
|
||||
'p-button-sm': props.size === 'small',
|
||||
'p-button-lg': props.size === 'large',
|
||||
'p-button-plain': props.plain
|
||||
}
|
||||
],
|
||||
loadingIcon: 'p-button-loading-icon pi-spin',
|
||||
icon: ({ props }) => [
|
||||
'p-button-icon',
|
||||
{
|
||||
'p-button-icon-left': props.iconPos === 'left' && props.label,
|
||||
'p-button-icon-right': props.iconPos === 'right' && props.label,
|
||||
'p-button-icon-top': props.iconPos === 'top' && props.label,
|
||||
'p-button-icon-bottom': props.iconPos === 'bottom' && props.label
|
||||
}
|
||||
],
|
||||
label: 'p-button-label'
|
||||
};
|
||||
|
||||
export default BaseStyle.extend({
|
||||
name: 'button',
|
||||
classes,
|
||||
loadStyle: () => {}
|
||||
});
|
5
components/lib/button/style/package.json
Normal file
5
components/lib/button/style/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"main": "./buttonstyle.cjs.js",
|
||||
"module": "./buttonstyle.esm.js",
|
||||
"unpkg": "./buttonstyle.min.js"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue