{"version":3,"file":"index.mjs","sources":["../../../../../projects/components/widgets/input/rating/src/rating.props.ts","../../../../../projects/components/widgets/input/rating/src/rating.component.ts","../../../../../projects/components/widgets/input/rating/src/rating.component.html","../../../../../projects/components/widgets/input/rating/src/index.ts"],"sourcesContent":["import { PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, register, registerFormWidget } from '@wm/components/base';\nimport { FormWidgetType } from '@wm/core';\n\nexport const ratingProps = new Map(\n    [\n        ['caption', PROP_STRING],\n        ['class', PROP_STRING],\n        ['datafield', PROP_STRING],\n        ['dataset', PROP_ANY],\n        ['datavaluesource', PROP_ANY],\n        ['datavalue', PROP_STRING],\n        ['displayexpression', PROP_STRING],\n        ['displayfield', PROP_STRING],\n        ['iconcolor', PROP_STRING],\n        ['activeiconclass', {value: 'wi wi-star', ...PROP_STRING}],\n        ['inactiveiconclass', {value: 'wi wi-star-border', ...PROP_STRING}],\n        ['iconsize', PROP_STRING],\n        ['maxvalue', {value: 5, ...PROP_NUMBER}],\n        ['name', PROP_STRING],\n        ['orderby', PROP_STRING],\n        ['readonly', PROP_BOOLEAN],\n        ['show', {value: true, ...PROP_BOOLEAN}],\n        ['showcaptions', {value: true, ...PROP_BOOLEAN}],\n        ['tabindex', {value: 0, ...PROP_NUMBER}],\n        ['usekeys', PROP_BOOLEAN]\n    ]\n);\n\nexport const registerProps = () => {\n    register(\n        'wm-rating',\n        ratingProps\n    );\n    registerFormWidget(\n        FormWidgetType.RATING,\n        new Map(ratingProps)\n    );\n};\n","import { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport {Component, ElementRef, Inject, Injector, OnDestroy, Optional, ViewChild} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {generateGUId, noop} from '@wm/core';\nimport { getOrderedDataset, provideAs, provideAsWidgetRef, styler, TextContentDirective } from '@wm/components/base';\nimport { DatasetAwareFormComponent } from '@wm/components/input/dataset-aware-form';\n\nimport { registerProps } from './rating.props';\nimport {find, isEmpty, isUndefined, slice, toString} from \"lodash-es\";\n\nconst DEFAULT_CLS = 'app-ratings';\nconst WIDGET_CONFIG = {widgetType: 'wm-rating', hostClass: DEFAULT_CLS};\n\nconst MAX_RATING = 10;\nconst DEFAULT_RATING = 5;\n\n@Component({\n  standalone: true,\n  imports: [CommonModule, TextContentDirective, FormsModule],\n    selector: '[wmRating]',\n    templateUrl: './rating.component.html',\n    providers: [\n        provideAs(RatingComponent, NG_VALUE_ACCESSOR, true),\n        provideAsWidgetRef(RatingComponent)\n    ]\n})\nexport class RatingComponent extends DatasetAwareFormComponent implements OnDestroy {\n    static initializeProps = registerProps();\n\n    public caption: string;\n    public showcaptions: boolean;\n    public maxvalue;\n\n    private _selectedRatingValue;\n    public ratingsWidth;\n    public ratingItems;\n    private _id;\n    public starsArray;\n    public isDecimal=false;\n\n    public iconsize: string;\n    public iconcolor: string;\n    public onFocus: any;\n    private touchEnabled:boolean;\n    public activeiconclass: string = '';\n    public inactiveiconclass: string = '';\n    @ViewChild('ratingInput', /* TODO: add static flag */ { read: ElementRef }) ratingEl: ElementRef;\n\n    get selectedRatingValue() {\n        return this._selectedRatingValue;\n    }\n\n    set selectedRatingValue(val) {\n        this._selectedRatingValue = val;\n        this.calculateRatingsWidth();\n    }\n\n    constructor(inj: Injector, @Inject('EXPLICIT_CONTEXT') @Optional() explicitContext: any) {\n        super(inj, WIDGET_CONFIG, explicitContext);\n        this._id = generateGUId();\n        styler(this.nativeElement, this);\n\n        // prepare the rating options on dataset ready.\n        const datasetSubscription = this.dataset$.subscribe(() => {\n            this.prepareRatingDataset();\n        });\n        this.registerDestroyListener(() => datasetSubscription.unsubscribe());\n\n        // listen to changes in datavalue.\n        const datavalueSubscription = this.datavalue$.subscribe(() => this.onDatavalueChange(this.datavalue));\n        this.registerDestroyListener(() => datavalueSubscription.unsubscribe());\n    }\n\n    // Change event is registered from the template, Prevent the framework from registering one more event\n    protected handleEvent(node: HTMLElement, eventName: string, eventCallback: Function, locals: any) {\n        if (eventName !== 'change' && eventName !== 'blur') {\n            super.handleEvent(this.ratingEl.nativeElement, eventName, eventCallback, locals);\n        }\n    }\n\n    // This function returns the rating widget dataset containing the index, value and label\n    private prepareRatingDataset() {\n        if (!this.datasetItems.length) {\n            this.ratingItems = [];\n            this.caption = '';\n        }\n\n        let ratingItems = [];\n        let data = this.datasetItems;\n        const maxvalue = parseInt(this.maxvalue || this.datasetItems.length, 10);\n        const maxValue = (maxvalue > MAX_RATING ? MAX_RATING : maxvalue) || DEFAULT_RATING;\n\n        /**\n         * 1. If datasetItems.length is more than maxValue (i.e. 10 ratings) then just extract maxValue of items from datasetItems.\n         * 2. If datasetItems are not available then prepare ratings value depending on maxvalue. eg: 1,2,3 .. upto maxvalue\n         * 3. If maxvalue / i value is more than datasetItems length, prepare default rating items for i values more than datasetItems.length\n         */\n        if (data.length && data.length > maxValue) {\n            data = slice(data, 0, maxValue);\n        }\n\n        for (let i = maxValue; i > 0; i--) {\n            if (!data.length) {\n                ratingItems.push({key: i, value: i, index: i, label: i});\n            } else {\n                if (i > data.length) {\n                    ratingItems.push({key: i, value: i, index: i, label: i});\n                } else {\n                    data = getOrderedDataset(data, 'index:desc');\n                    ratingItems = ratingItems.concat(data);\n                    break;\n                }\n            }\n        }\n\n        this.ratingItems = ratingItems;\n        if (!data.length) { // constructs default datasetItems when there is no dataset binding.\n            this.datasetItems = ratingItems;\n        }\n        this.onDatavalueChange(this.datavalue);\n    }\n\n    onRatingClick($event, rate) {\n        this.modelByKey = rate.key;\n        this.selectedRatingValue = rate.index;\n\n        // support if the caption is binded in the old projects for backward compatibility\n        if (!this.showcaptions) {\n            this.caption = rate.label;\n        }\n\n        this.invokeOnTouched();\n        // invoke on datavalue change.\n        this.invokeOnChange(this.datavalue, $event || {}, true);\n    }\n\n    // Update the selected flag on datasetItems and assign the ratingValue.\n    /**\n     * On datavalue change, update the caption, selectedRatingValue.\n     * 1. if datasetItems contain the selected item (check the selected flag on item), find the index of selected item.\n     * 2. if not, just check if the datavalue is provided as the index on the item.\n     *\n     * @param dataVal datavalue\n     */\n    onDatavalueChange(dataVal) {\n        if (!isEmpty(this.datasetItems)) {\n            let selectedItem = find(this.datasetItems, {'selected': true});\n\n            if (!selectedItem && !isUndefined(dataVal)) {\n                selectedItem = find(this.datasetItems, function (item) {\n                    return toString(item.index) === dataVal;\n                });\n                if (selectedItem) {\n                    selectedItem.selected = true;\n                }\n            }\n\n            if (!selectedItem) {\n                // reset the  model if there is no item found.\n                this.modelByKey = undefined;\n                this.caption = '';\n            }\n\n            this.selectedRatingValue = selectedItem ? selectedItem.index : 0;\n            if (selectedItem) {\n                this.caption = selectedItem.label;\n            }\n        } else {\n            this.selectedRatingValue = 0;\n        }\n        if (this.readonly) {\n            // when dataset is not given but datavalue is provided which is integer\n            if (!this.selectedRatingValue && !isNaN(dataVal)) {\n                this.selectedRatingValue = (parseFloat(dataVal) <= this.maxvalue) ? dataVal : this.maxvalue;\n            }\n            this.ratingsWidth = this.calculateRatingsWidth(dataVal);\n        }\n        if(this.readonly && !isNaN(dataVal) && !Number.isInteger(parseFloat(dataVal))) {\n            this._modelByKey = dataVal;\n            this._modelByValue=dataVal\n            this.isDecimal=true;\n            this.ratingsWidth = this.calculateRatingsWidth(this.getPrevDataValue());\n            this.caption = this.selectedRatingValue\n        }\n    }\n\n    calculateRatingsWidth(dataVal?: any) {\n        const selectedRating = parseFloat(this.selectedRatingValue),\n            maxValue = parseInt(this.maxvalue || this.datasetItems.length, 10) || DEFAULT_RATING;\n\n        dataVal = dataVal || this.datavalue;\n        if ((dataVal === undefined || dataVal === '' || dataVal === null)||selectedRating <= 0) {\n            this.caption = '';\n            return '0%';\n        }\n        const safeRating = Math.min(selectedRating, maxValue);\n        return ( (safeRating / maxValue) * 100)+'%';\n    }\n\n    onPropertyChange(key: string, nv: any, ov?: any) {\n        if (key === 'readonly') {\n            this.isDecimal=false;\n            if (nv) {\n                this.ratingsWidth = this.calculateRatingsWidth();\n                this.onDatavalueChange(this.getPrevDataValue())\n            }\n        } else if (key === 'maxvalue') {\n            /** Storing the datavalue in temp variable and assiging back to datavalue\n             * after default datalist is prepared to trigger Dataset Aware class select cycle\n             * as the datavalue property change is triggering first rather than maxvalue\n             * in the rating widget is used inside a datatable\n             */\n            this.starsArray = Array(this.maxvalue);\n            let tempDataValue = this.datavalue;\n            this.prepareRatingDataset();\n            // reset all the items.\n            this.resetDatasetItems();\n            if (!isUndefined(tempDataValue)) {\n                this.datavalue = tempDataValue;\n            }\n        } else {\n            super.onPropertyChange(key, nv, ov);\n        }\n    }\n\n    /* Detect touch enabled devices & update hover styles*/\n    onTouchStart($event) {\n        this.touchEnabled = true;\n        this.onTouchStart = noop;\n    }\n    onMouseleave() {\n        this.caption = this.displayValue as string;\n    }\n\n    onMouseOver($event, rate) {\n        this.caption = rate.label;\n        !this.touchEnabled && !$event.target.classList.contains('rating-label-hover') && $event.target.classList.add('rating-label-hover');\n    }\n\n    ngOnDestroy() {\n        // MEMORY LEAK FIX: Clear ViewChild reference\n        this.ratingEl = null;\n\n        // MEMORY LEAK FIX: Clear rating items array\n        if (this.ratingItems) {\n            this.ratingItems = [];\n        }\n\n        // Call parent ngOnDestroy (DatasetAwareFormComponent has cleanup)\n        super.ngOnDestroy();\n    }\n}\n","<div (focus)=\"onFocus($event)\" [(ngModel)]=\"modelByKey\" [ngModelOptions]=\"{standalone: true}\"\n  class=\"ratings-wrapper\" ngDefaultControl>\n  <div [class.hidden]=\"readonly && isDecimal\" [class.disabled]=\"readonly\" class=\"rating-style\">\n    @for (rate of ratingItems; track rate) {\n      <label\n        [ngClass]=\"{active : rate.index <= selectedRatingValue}\"\n        [ngStyle]=\"{'font-size' :iconsize, color: rate.index <= selectedRatingValue && iconcolor}\"\n        [title]=\"rate.label || rate.index\"\n        (touchstart)=\"onTouchStart($event)\"\n        (mouseleave)=\"onMouseleave($event, rate)\"\n        (mouseover)=\"onMouseOver($event, rate)\"\n        [for]=\"_id + '-' + rate.index\">\n        <i class=\"app-icon {{rate.index <= selectedRatingValue ? activeiconclass : inactiveiconclass}}\" aria-hidden=\"true\"></i>\n        <input #ratingInput type=\"radio\" role=\"radio\" [attr.aria-label]=\"(rate.label || rate.index) + ' out of ' + ratingItems.length + ' ratings'\" [attr.aria-checked]=\"rate.label === datavalue ? 'true' : 'false'\"\n          [id]=\"_id + '-' + rate.index\" (click)=\"onRatingClick($event, rate)\" name=\"ratings-id\" [value]=\"rate.key || rate.index\"/>\n      </label>\n    }\n  </div>\n    <div class=\"ratings-container readonly\" [class.hidden]=\"!isDecimal\" [ngStyle]=\"{ 'font-size': iconsize }\">\n        <div class=\"ratings-base\">\n            <i class=\"app-icon {{inactiveiconclass}}\" *ngFor=\"let s of starsArray\"></i>\n        </div>\n        <div class=\"ratings active\" [ngStyle]=\"{ width: ratingsWidth, color: iconcolor }\">\n            <i class=\"app-icon {{activeiconclass}}\" *ngFor=\"let s of starsArray\"></i>\n        </div>\n    </div>\n    @if (showcaptions) {\n    <label class=\"caption\" [textContent]=\"caption\"></label>\n  }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;AAGO,MAAM,WAAW,GAAG,IAAI,GAAG,CAC9B;IACI,CAAC,SAAS,EAAE,WAAW,CAAC;IACxB,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,SAAS,EAAE,QAAQ,CAAC;IACrB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,mBAAmB,EAAE,WAAW,CAAC;IAClC,CAAC,cAAc,EAAE,WAAW,CAAC;IAC7B,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,iBAAiB,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,GAAG,WAAW,EAAC,CAAC;IAC1D,CAAC,mBAAmB,EAAE,EAAC,KAAK,EAA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