diff --git a/api-generator/components/rating.js b/api-generator/components/rating.js index 794bc7e8f8..131abdf1d7 100644 --- a/api-generator/components/rating.js +++ b/api-generator/components/rating.js @@ -28,6 +28,24 @@ const RatingProps = [ type: 'boolean', default: 'true', description: 'When specified a cancel icon is displayed to allow clearing the value.' + }, + { + name: 'onIcon', + type: 'string', + default: 'pi pi-star', + description: 'Can be used to add different icon.' + }, + { + name: 'offIcon', + type: 'string', + default: 'pi pi-star-fill', + description: 'Can be used to add different icon.' + }, + { + name: 'cancelIcon', + type: 'string', + default: 'pi pi-ban', + description: 'Can be used to add different cancel icon.' } ]; diff --git a/public/demo/images/rating/cancel.png b/public/demo/images/rating/cancel.png new file mode 100644 index 0000000000..8482598af6 Binary files /dev/null and b/public/demo/images/rating/cancel.png differ diff --git a/public/demo/images/rating/custom-asset-2.png b/public/demo/images/rating/custom-asset-2.png new file mode 100644 index 0000000000..ca38b0d290 Binary files /dev/null and b/public/demo/images/rating/custom-asset-2.png differ diff --git a/public/demo/images/rating/custom-asset.png b/public/demo/images/rating/custom-asset.png new file mode 100644 index 0000000000..7047c28f4e Binary files /dev/null and b/public/demo/images/rating/custom-asset.png differ diff --git a/src/components/rating/Rating.d.ts b/src/components/rating/Rating.d.ts index 42b755aa42..a0ecad5e86 100755 --- a/src/components/rating/Rating.d.ts +++ b/src/components/rating/Rating.d.ts @@ -38,6 +38,21 @@ export interface RatingProps { * Default value is true. */ cancel?: boolean | undefined; + /** + * Can be used to add different icon. + * Default value is pi pi-star. + */ + onIcon?: string | undefined; + /** + * Can be used to add different icon. + * Default value is pi pi-star-fill. + */ + offIcon?: string | undefined; + /** + * Can be used to add different cancel icon. + * Default value is pi pi-ban. + */ + cancelIcon?: string | undefined; } export interface RatingSlots { diff --git a/src/components/rating/Rating.vue b/src/components/rating/Rating.vue index 9186d46b61..3f975051f5 100755 --- a/src/components/rating/Rating.vue +++ b/src/components/rating/Rating.vue @@ -1,12 +1,28 @@