From c0076f770ca48bf12fb6f017318c540c0a5f5771 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 9 Apr 2024 09:05:44 +0300 Subject: [PATCH 1/6] Refactor #5548 - For Calendar --- components/lib/calendar/BaseCalendar.vue | 12 ++ components/lib/calendar/Calendar.d.ts | 24 ++- components/lib/calendar/Calendar.vue | 226 +++++++++++++---------- 3 files changed, 163 insertions(+), 99 deletions(-) diff --git a/components/lib/calendar/BaseCalendar.vue b/components/lib/calendar/BaseCalendar.vue index 80a5a72fd..bc5139dab 100644 --- a/components/lib/calendar/BaseCalendar.vue +++ b/components/lib/calendar/BaseCalendar.vue @@ -232,6 +232,18 @@ export default { return { severity: 'secondary', text: true, size: 'small' }; } }, + navigatorButtonProps: { + type: Object, + default() { + return { severity: 'secondary', text: true }; + } + }, + timepickerButtonProps: { + type: Object, + default() { + return { severity: 'secondary', text: true }; + } + }, ariaLabelledby: { type: String, default: null diff --git a/components/lib/calendar/Calendar.d.ts b/components/lib/calendar/Calendar.d.ts index 4bac218fd..6d5e6207e 100755 --- a/components/lib/calendar/Calendar.d.ts +++ b/components/lib/calendar/Calendar.d.ts @@ -161,8 +161,9 @@ export interface CalendarPassThroughOptions { header?: CalendarPassThroughOptionType; /** * Used to pass attributes to the previous button's DOM element. + * @see {@link ButtonPassThroughOptions} */ - previousButton?: CalendarPassThroughOptionType; + previousButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the title's DOM element. */ @@ -180,9 +181,10 @@ export interface CalendarPassThroughOptions { */ decadeTitle?: CalendarPassThroughOptionType; /** - * Used to pass attributes to the previous button's DOM element. + * Used to pass attributes to the next button's DOM element. + * @see {@link ButtonPassThroughOptions} */ - nextButton?: CalendarPassThroughOptionType; + nextButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the container's DOM element. */ @@ -766,15 +768,27 @@ export interface CalendarProps { /** * Used to pass all properties of the ButtonProps to the today button component. * @type {ButtonProps} - * @defaultValue { severity: 'secondary', text: true } + * @defaultValue { severity: 'secondary', text: true, size: 'small' } */ todayButtonProps?: object | undefined; /** * Used to pass all properties of the ButtonProps to the clear button component. * @type {ButtonProps} - * @defaultValue { severity: 'secondary', text: true } + * @defaultValue { severity: 'secondary', text: true, size: 'small' } */ clearButtonProps?: object | undefined; + /** + * Used to pass all properties of the ButtonProps to the navigator button component. + * @type {ButtonProps} + * @defaultValue { severity: 'secondary', text: true } + */ + navigatorButtonProps?: object | undefined; + /** + * Used to pass all properties of the ButtonProps to the timepicker button component. + * @type {ButtonProps} + * @defaultValue { severity: 'secondary', text: true } + */ + timepickerButtonProps?: object | undefined; /** * Establishes relationships between the component and label(s) where its value should be one or more element IDs. */ diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index f8ec80005..dc2152985 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -73,23 +73,25 @@
- + +
- + + {{ formattedCurrentHour }} - + +
{{ timeSeparator }}
- + + {{ formattedCurrentMinute }} - + +
{{ timeSeparator }}
- + + {{ formattedCurrentSecond }} - + +
{{ timeSeparator }}
- + + {{ pm ? $primevue.config.locale.pm : $primevue.config.locale.am }} - + +
-
@@ -491,6 +527,7 @@ diff --git a/pages/calendar/index.vue b/pages/calendar/index.vue index 1445255a2..c787de1b1 100755 --- a/pages/calendar/index.vue +++ b/pages/calendar/index.vue @@ -30,7 +30,6 @@ import MultipleDoc from '@/doc/calendar/MultipleDoc.vue'; import MultipleMonthsDoc from '@/doc/calendar/MultipleMonthsDoc.vue'; import RangeDoc from '@/doc/calendar/RangeDoc.vue'; import TimeDoc from '@/doc/calendar/TimeDoc.vue'; -import TouchUIDoc from '@/doc/calendar/TouchUIDoc.vue'; import YearPickerDoc from '@/doc/calendar/YearPickerDoc.vue'; import PTComponent from '@/doc/calendar/pt/index.vue'; import ThemingDoc from '@/doc/calendar/theming/index.vue'; @@ -109,11 +108,6 @@ export default { label: 'Date Template', component: DateTemplateDoc }, - { - id: 'touchui', - label: 'Touch UI', - component: TouchUIDoc - }, { id: 'inline', label: 'Inline', From 6a4ed8d57ac68c12722d27e981041b0c29a701a8 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 9 Apr 2024 09:41:29 +0300 Subject: [PATCH 4/6] Unstyled updates --- components/lib/autocomplete/AutoComplete.vue | 2 +- components/lib/chips/Chips.vue | 2 +- components/lib/multiselect/MultiSelect.vue | 2 +- components/lib/treeselect/TreeSelect.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/autocomplete/AutoComplete.vue b/components/lib/autocomplete/AutoComplete.vue index 1230dc880..cc90b53f9 100755 --- a/components/lib/autocomplete/AutoComplete.vue +++ b/components/lib/autocomplete/AutoComplete.vue @@ -56,7 +56,7 @@ v-bind="ptm('token')" > - + diff --git a/components/lib/chips/Chips.vue b/components/lib/chips/Chips.vue index 7a16d400d..5bd0d3acc 100755 --- a/components/lib/chips/Chips.vue +++ b/components/lib/chips/Chips.vue @@ -29,7 +29,7 @@ :data-p-focused="focusedIndex === i" > - + diff --git a/components/lib/multiselect/MultiSelect.vue b/components/lib/multiselect/MultiSelect.vue index 583c306c2..0d896a74b 100755 --- a/components/lib/multiselect/MultiSelect.vue +++ b/components/lib/multiselect/MultiSelect.vue @@ -32,7 +32,7 @@ From 6b6f212ef365eae18562bc12fce6b7f129893509 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 9 Apr 2024 10:55:04 +0300 Subject: [PATCH 5/6] Refactor #5553 - For Rating --- api-generator/components/rating.js | 16 ---------- components/lib/rating/BaseRating.vue | 8 ----- components/lib/rating/Rating.d.ts | 37 ---------------------- components/lib/rating/Rating.spec.js | 6 ---- components/lib/rating/Rating.vue | 24 +------------- components/lib/rating/style/RatingStyle.js | 7 ---- 6 files changed, 1 insertion(+), 97 deletions(-) diff --git a/api-generator/components/rating.js b/api-generator/components/rating.js index 454c194ed..92d845af9 100644 --- a/api-generator/components/rating.js +++ b/api-generator/components/rating.js @@ -23,12 +23,6 @@ const RatingProps = [ default: '5', description: 'Number of stars.' }, - { - name: 'cancel', - type: 'boolean', - default: 'true', - description: 'When specified a cancel icon is displayed to allow clearing the value.' - }, { name: 'onIcon', type: 'string', @@ -41,12 +35,6 @@ const RatingProps = [ default: 'null', description: 'Icon for the off state.' }, - { - name: 'cancelIcon', - type: 'string', - default: 'null', - description: 'Icon for the cancelable state.' - }, { name: 'pt', type: 'any', @@ -62,10 +50,6 @@ const RatingProps = [ ]; const RatingSlots = [ - { - name: 'cancelicon', - description: 'Custom cancel icon template.' - }, { name: 'onicon', description: 'Custom on icon template.' diff --git a/components/lib/rating/BaseRating.vue b/components/lib/rating/BaseRating.vue index 7710adf6e..9d3a2aa09 100644 --- a/components/lib/rating/BaseRating.vue +++ b/components/lib/rating/BaseRating.vue @@ -22,10 +22,6 @@ export default { type: Number, default: 5 }, - cancel: { - type: Boolean, - default: false - }, onIcon: { type: String, default: undefined @@ -33,10 +29,6 @@ export default { offIcon: { type: String, default: undefined - }, - cancelIcon: { - type: String, - default: undefined } }, style: RatingStyle, diff --git a/components/lib/rating/Rating.d.ts b/components/lib/rating/Rating.d.ts index 36e093013..11837be10 100755 --- a/components/lib/rating/Rating.d.ts +++ b/components/lib/rating/Rating.d.ts @@ -57,14 +57,6 @@ export interface RatingPassThroughOptions { * Used to pass attributes to the root's DOM element. */ root?: RatingPassThroughOptionType; - /** - * Used to pass attributes to the cancel item's DOM element. - */ - cancelItem?: RatingPassThroughOptionType; - /** - * Used to pass attributes to the cancel icon's DOM element. - */ - cancelIcon?: RatingPassThroughOptionType; /** * Used to pass attributes to the item's DOM element. */ @@ -77,14 +69,6 @@ export interface RatingPassThroughOptions { * Used to pass attributes to the off icon's DOM element. */ offIcon?: RatingPassThroughOptionType; - /** - * Used to pass attributes to the hidden cancel inputW wapper's DOM element. - */ - hiddenCancelInputWrapper?: RatingPassThroughOptionType; - /** - * Used to pass attributes to the hidden cancel input's DOM element. - */ - hiddenCancelInput?: RatingPassThroughOptionType; /** * Used to pass attributes to the hidden item input wrapper's DOM element. */ @@ -179,12 +163,6 @@ export interface RatingProps { * @defaultValue 5 */ stars?: number | undefined; - /** - * When specified a cancel icon is displayed to allow clearing the value. - * @deprecated since v4.0.0-beta.1 - * @defaultValue false - */ - cancel?: boolean | undefined; /** * Icon for the on state. * @deprecated since v3.27.0. Use 'onicon' slot. @@ -195,11 +173,6 @@ export interface RatingProps { * @deprecated since v3.27.0. Use 'officon' slot. */ offIcon?: string | undefined; - /** - * Icon for the cancelable state. - * @deprecated since v3.27.0. Use 'cancelicon' slot. - */ - cancelIcon?: string | undefined; /** * It generates scoped CSS variables using design tokens for the component. */ @@ -225,16 +198,6 @@ export interface RatingProps { * Defines valid slots in Rating component. */ export interface RatingSlots { - /** - * Custom cancel icon template. - * @param {Object} scope - cancelicon slot's params. - */ - cancelicon(scope: { - /** - * Style class of the icon. - */ - class: string; - }): VNode[]; /** * Custom on icon template. * @param {Object} scope - on icon slot's params. diff --git a/components/lib/rating/Rating.spec.js b/components/lib/rating/Rating.spec.js index 58b16df6d..fc0e45550 100644 --- a/components/lib/rating/Rating.spec.js +++ b/components/lib/rating/Rating.spec.js @@ -28,12 +28,6 @@ describe('Rating.vue', () => { expect(wrapper.emitted()['blur'][0]).toEqual([true]); }); - it('should not cancel', async () => { - await wrapper.setProps({ cancel: false }); - - expect(wrapper.find('.p-rating-cancel').exists()).toBe(false); - }); - it('When star is clicked, onOptionClick method should triggered', async () => { await wrapper.find('.p-rating-item').trigger('click'); diff --git a/components/lib/rating/Rating.vue b/components/lib/rating/Rating.vue index 1f9543726..291b51b08 100755 --- a/components/lib/rating/Rating.vue +++ b/components/lib/rating/Rating.vue @@ -1,25 +1,5 @@