Skip to content

Commit

Permalink
Refactor - Misc section
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Apr 30, 2024
1 parent ab67783 commit 1b88a2f
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion components/lib/message/style/MessageStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BaseStyle from 'primevue/base/style';

const classes = {
root: ({ props }) => 'p-message p-component p-message-' + props.severity,
wrapper: 'p-message-content',
content: 'p-message-content',
icon: 'p-message-icon',
text: 'p-message-text',
closeButton: 'p-message-close-button',
Expand Down
26 changes: 15 additions & 11 deletions components/lib/metergroup/MeterGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,33 @@ export interface MeterGroupPassThroughOptions {
*/
root?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the label list's DOM element.
* Used to pass attributes to the meter container's DOM element.
*/
labellist?: MeterGroupPassThroughOptionType;
meters?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the label list item's DOM element.
* Used to pass attributes to the meter's DOM element.
*/
labellistitem?: MeterGroupPassThroughOptionType;
meter?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the label list type's DOM element.
* Used to pass attributes to the label list's DOM element.
*/
labellisttype?: MeterGroupPassThroughOptionType;
labelList?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the label's DOM element.
* Used to pass attributes to the label list item's DOM element.
*/
label?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the meter container's DOM element.
* Used to pass attributes to the label icon type's DOM element.
*/
metercontainer?: MeterGroupPassThroughOptionType;
labelIcon?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the meter's DOM element.
* Used to pass attributes to the label list type's DOM element.
*/
meter?: MeterGroupPassThroughOptionType;
labelMarker?: MeterGroupPassThroughOptionType;
/**
* Used to pass attributes to the label's DOM element.
*/
labelText?: MeterGroupPassThroughOptionType;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion components/lib/metergroup/MeterGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<MeterGroupLabel :value="value" :labelPosition="labelPosition" :labelOrientation="labelOrientation" :unstyled="unstyled" :pt="pt" />
</slot>
<slot name="start" :value="value" :totalPercent="totalPercent" :percentages="percentages" />
<div :class="cx('metercontainer')" v-bind="ptm('metercontainer')">
<div :class="cx('meters')" v-bind="ptm('meters')">
<template v-for="(val, index) in value" :key="index">
<slot name="meter" :value="val" :index="index" :class="cx('meter')" :orientation="orientation" :size="percentValue(val.value)" :totalPercent="totalPercent">
<span v-if="percent(val.value)" :class="cx('meter')" :style="meterCalculatedStyles(val)" v-bind="getPTOptions('meter', val, index)" />
Expand Down
12 changes: 6 additions & 6 deletions components/lib/metergroup/MeterGroupLabel.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<ol :class="cx('labellist')" v-bind="ptm('labellist')">
<li v-for="(val, index) in value" :key="index + '_label'" :class="cx('labellistitem')" v-bind="ptm('labellistitem')">
<slot name="icon" :value="val" :class="cx('labelicon')">
<i v-if="val.icon" :class="[val.icon, cx('labelicon')]" :style="{ color: val.color }" v-bind="ptm('labelicon')" />
<span v-else :class="cx('labellisttype')" :style="{ backgroundColor: val.color }" v-bind="ptm('labellisttype')" />
<ol :class="cx('labelList')" v-bind="ptm('labelList')">
<li v-for="(val, index) in value" :key="index + '_label'" :class="cx('label')" v-bind="ptm('label')">
<slot name="icon" :value="val" :class="cx('labelIcon')">
<i v-if="val.icon" :class="[val.icon, cx('labelIcon')]" :style="{ color: val.color }" v-bind="ptm('labelIcon')" />
<span v-else :class="cx('labelMarker')" :style="{ backgroundColor: val.color }" v-bind="ptm('labelMarker')" />
</slot>
<span :class="cx('label')" v-bind="ptm('label')">{{ val.label }} ({{ $parentInstance.percentValue(val.value) }})</span>
<span :class="cx('labelText')" v-bind="ptm('labelText')">{{ val.label }} ({{ $parentInstance.percentValue(val.value) }})</span>
</li>
</ol>
</template>
Expand Down
12 changes: 6 additions & 6 deletions components/lib/metergroup/style/MeterGroupStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ const classes = {
'p-metergroup-vertical': props.orientation === 'vertical'
}
],
metercontainer: 'p-metergroup-meters',
meters: 'p-metergroup-meters',
meter: 'p-metergroup-meter',
labellist: ({ props }) => [
labelList: ({ props }) => [
'p-metergroup-label-list',
{
'p-metergroup-label-list-vertical': props.labelOrientation === 'vertical',
'p-metergroup-label-list-horizontal': props.labelOrientation === 'horizontal'
}
],
labellistitem: 'p-metergroup-label',
labelicon: 'p-metergroup-label-icon',
labellisttype: 'p-metergroup-label-marker',
label: 'p-metergroup-label-text'
label: 'p-metergroup-label',
labelIcon: 'p-metergroup-label-icon',
labelMarker: 'p-metergroup-label-marker',
labelText: 'p-metergroup-label-text'
};

export default BaseStyle.extend({
Expand Down
4 changes: 4 additions & 0 deletions components/lib/progressbar/ProgressBar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export interface ProgressBarPassThroughOptions<T = any> {
* Used to pass attributes to the root's DOM element.
*/
root?: ProgressBarPassThroughOptionType<T>;
/**
* Used to pass attributes to the indeterminate container's DOM element.
*/
indeterminateContainer?: ProgressBarPassThroughOptionType<T>;
/**
* Used to pass attributes to the value's DOM element.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/progressbar/ProgressBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<slot>{{ value + '%' }}</slot>
</div>
</div>
<div v-if="indeterminate" :class="cx('container')" v-bind="ptm('container')">
<div v-if="indeterminate" :class="cx('indeterminateContainer')" v-bind="ptm('indeterminateContainer')">
<div :class="cx('value')" v-bind="ptm('value')"></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/lib/progressbar/style/ProgressBarStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const classes = {
'p-progressbar-indeterminate': instance.indeterminate
}
],
container: 'p-progressbar-indeterminate-container',
indeterminateContainer: 'p-progressbar-indeterminate-container',
value: 'p-progressbar-value',
label: 'p-progressbar-label'
};
Expand Down
2 changes: 1 addition & 1 deletion components/lib/progressspinner/ProgressSpinner.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div :class="cx('root')" role="progressbar" v-bind="ptmi('root')">
<svg :class="cx('spinner')" viewBox="25 25 50 50" :style="svgStyle" v-bind="ptm('spinner')">
<svg :class="cx('spin')" viewBox="25 25 50 50" :style="svgStyle" v-bind="ptm('spin')">
<circle :class="cx('circle')" cx="50" cy="50" r="20" :fill="fill" :stroke-width="strokeWidth" strokeMiterlimit="10" v-bind="ptm('circle')" />
</svg>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BaseStyle from 'primevue/base/style';

const classes = {
root: 'p-progressspinner',
spinner: 'p-progressspinner-spin',
spin: 'p-progressspinner-spin',
circle: 'p-progressspinner-circle'
};

Expand Down
4 changes: 2 additions & 2 deletions components/lib/tag/Tag.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export interface TagPassThroughOptions {
*/
icon?: TagPassThroughOptionType;
/**
* Used to pass attributes to the value's DOM element.
* Used to pass attributes to the label's DOM element.
*/
value?: TagPassThroughOptionType;
label?: TagPassThroughOptionType;
/**
* Used to manage all lifecycle hooks.
* @see {@link BaseComponent.ComponentHooks}
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tag/Tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<component v-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" v-bind="ptm('icon')" />
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></span>
<slot v-if="value || $slots.default">
<span :class="cx('value')" v-bind="ptm('value')">{{ value }}</span>
<span :class="cx('label')" v-bind="ptm('label')">{{ value }}</span>
</slot>
</span>
</template>
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tag/style/TagStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const classes = {
}
],
icon: 'p-tag-icon',
value: 'p-tag-label'
label: 'p-tag-label'
};

export default BaseStyle.extend({
Expand Down

0 comments on commit 1b88a2f

Please sign in to comment.