Skip to content

Commit

Permalink
Fixed #1824 - New calendar styple props for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 23, 2021
1 parent 32d77a0 commit e5a1f7f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
24 changes: 24 additions & 0 deletions api-generator/components/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,30 @@ const CalendarProps = [
type: "string",
default: "null",
description: 'Id of the element or "body" for document where the overlay should be appended to.'
},
{
name: "inputStyle",
type: "any",
default: "null",
description: "Inline style of the input field."
},
{
name: "inputClass",
type: "string",
default: "null",
description: "Style class of the input field."
},
{
name: "class",
type: "string",
default: "null",
description: "Style class of the component."
},
{
name: "style",
type: "any",
default: "null",
description: "Inline style of the component."
}
];

Expand Down
4 changes: 4 additions & 0 deletions src/components/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ declare class Calendar extends Vue {
locale?: LocaleSettings;
ariaLabelledBy?: string;
appendTo?: string;
inputStyle?: any;
inputClass?: string;
style?: any;
class?: string;
$emit(eventName: 'show'): this;
$emit(eventName: 'hide'): this;
$emit(eventName: 'month-change', e: { month: number, year: number }): this;
Expand Down
13 changes: 9 additions & 4 deletions src/components/calendar/Calendar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<span :class="containerClass">
<CalendarInputText ref="input" v-if="!inline" type="text" v-bind="$attrs" v-on="listeners" :value="inputFieldValue" :readonly="!manualInput" :aria-labelledby="ariaLabelledBy" inputmode="none" />
<span :class="containerClass" :style="styles">
<CalendarInputText ref="input" v-if="!inline" type="text" v-bind="$attrs" v-on="listeners" :value="inputFieldValue" :readonly="!manualInput" :aria-labelledby="ariaLabelledBy" inputmode="none"
:class="inputClass" :style="inputStyle" />
<CalendarButton v-if="showIcon" :icon="icon" tabindex="-1" class="p-datepicker-trigger" :disabled="$attrs.disabled" @click="onButtonClick" type="button" :aria-label="inputFieldValue"/>
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayEnterComplete" @leave="onOverlayLeave">
<div ref="overlay" :class="panelStyleClass" v-if="inline ? true : overlayVisible" :role="inline ? null : 'dialog'" :aria-labelledby="ariaLabelledBy">
Expand Down Expand Up @@ -299,7 +300,11 @@ export default {
appendTo: {
type: String,
default: null
}
},
inputClass: null,
inputStyle: null,
className: null,
styles: null
},
navigationState: null,
scrollHandler: null,
Expand Down Expand Up @@ -2205,7 +2210,7 @@ export default {
},
containerClass() {
return [
'p-calendar p-component p-inputwrapper',
'p-calendar p-component p-inputwrapper', this.className,
{
'p-calendar-w-btn': this.showIcon,
'p-calendar-timeonly': this.timeOnly,
Expand Down
24 changes: 24 additions & 0 deletions src/views/calendar/CalendarDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,30 @@ export default {
<td>null</td>
<td>Id of the element or "body" for document where the overlay should be appended to.</td>
</tr>
<tr>
<td>inputStyle</td>
<td>any</td>
<td>null</td>
<td>Inline style of the input field.</td>
</tr>
<tr>
<td>inputClass</td>
<td>string</td>
<td>null</td>
<td>Style class of the input field.</td>
</tr>
<tr>
<td>styles</td>
<td>any</td>
<td>null</td>
<td>Inline style of the component.</td>
</tr>
<tr>
<td>className</td>
<td>string</td>
<td>null</td>
<td>Style class of the component.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit e5a1f7f

Please sign in to comment.