@agorapulse/ui-components 22.5.8-beta.1 → 22.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agorapulse-ui-components-22.6.0.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-input-search.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-input-search.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels-selector.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-labels-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-select.mjs +189 -4
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs +48 -4
- package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs.map +1 -1
- package/package.json +1 -1
- package/types/agorapulse-ui-components-select.d.ts +38 -2
- package/types/agorapulse-ui-components-selection-dropdown.d.ts +14 -2
- package/agorapulse-ui-components-22.5.8-beta.1.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-input-search.mjs","sources":["../../../libs/ui-components/input-search/src/input-search.component.ts","../../../libs/ui-components/input-search/src/input-search.component.html","../../../libs/ui-components/input-search/src/agorapulse-ui-components-input-search.ts"],"sourcesContent":["import { ClickDirective } from '@agorapulse/ui-components/directives';\nimport { InputDirective } from '@agorapulse/ui-components/input';\nimport { InputGroupComponent } from '@agorapulse/ui-components/input-group';\nimport { SymbolComponent, SymbolRegistry, apClose, apSearch } from '@agorapulse/ui-symbol';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nlet inputSearchId = 0;\n\n@Component({\n selector: 'ap-input-search',\n templateUrl: './input-search.component.html',\n styleUrls: ['./input-search.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [InputGroupComponent, InputDirective, FormsModule, SymbolComponent, ClickDirective],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputSearchComponent),\n multi: true,\n },\n ],\n})\nexport class InputSearchComponent implements ControlValueAccessor {\n id = input<string>('');\n placeholder = input<string>('');\n clearable = input(true);\n\n /** Id of the list this field drives, when it drives one. */\n ariaControls = input<string | null>(null);\n\n /** Id of the option this field marks in that list, so focus can stay in the field. */\n ariaActiveDescendant = input<string | null>(null);\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n focus = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n keyup = output<KeyboardEvent>();\n\n inputElement = viewChild.required<ElementRef>('input');\n\n value = signal<string | null>('');\n defaultInputId = `ap-input-search-${inputSearchId++}`;\n\n inputId = computed(() => this.id() ?? this.defaultInputId);\n\n disabled = signal(false);\n\n onTouched: () => void = () => {};\n\n onChanged: (value: any) => void = () => {};\n\n private symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.registerSymbols([apSearch, apClose]);\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChanged = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n onValueChange(value: string | null) {\n this.writeValue(value);\n this.onChanged(value);\n }\n\n focusInput(): void {\n this.inputElement().nativeElement.focus();\n }\n\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n onClear($event: Event): void {\n $event.stopImmediatePropagation();\n this.onValueChange(null);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focus.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.blur.emit($event);\n }\n\n onKeyup($event: KeyboardEvent): void {\n this.keyup.emit($event);\n }\n}\n","<ap-input-group>\n <ap-symbol symbolId=\"search\" />\n <input\n #input\n apInput\n [id]=\"inputId()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [attr.aria-controls]=\"ariaControls()\"\n [attr.aria-activedescendant]=\"ariaActiveDescendant()\"\n [ngModel]=\"value()\"\n (blur)=\"onBlurHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (keyup)=\"onKeyup($event)\"\n (ngModelChange)=\"onValueChange($event)\" />\n @if (clearable() && value()) {\n <div\n class=\"close\"\n aria-label=\"Clear search\"\n (apClick)=\"onClear($event)\">\n <ap-symbol\n symbolId=\"close\"\n size=\"xs\" />\n </div>\n }\n</ap-input-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAmBA,IAAI,aAAa,GAAG,CAAC;MAiBR,oBAAoB,CAAA;IAC7B,EAAE,GAAG,KAAK,CAAS,EAAE;2EAAC;IACtB,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;IAC/B,SAAS,GAAG,KAAK,CAAC,IAAI;kFAAC;;IAGvB,YAAY,GAAG,KAAK,CAAgB,IAAI;qFAAC;;IAGzC,oBAAoB,GAAG,KAAK,CAAgB,IAAI;6FAAC;;IAGjD,KAAK,GAAG,MAAM,EAAc;;IAE5B,IAAI,GAAG,MAAM,EAAc;;IAE3B,KAAK,GAAG,MAAM,EAAiB;AAE/B,IAAA,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAa,OAAO,CAAC;IAEtD,KAAK,GAAG,MAAM,CAAgB,EAAE;8EAAC;AACjC,IAAA,cAAc,GAAG,CAAA,gBAAA,EAAmB,aAAa,EAAE,EAAE;AAErD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,EAAE,IAAI,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A,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EARlB;AACP,YAAA;AACI,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,gBAAA,KAAK,EAAE,IAAI;AACd,aAAA;SACJ,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,cAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,OAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClCL,0zBA0BA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-input-search.mjs","sources":["../../../libs/ui-components/input-search/src/input-search.component.ts","../../../libs/ui-components/input-search/src/input-search.component.html","../../../libs/ui-components/input-search/src/agorapulse-ui-components-input-search.ts"],"sourcesContent":["import { ClickDirective } from '@agorapulse/ui-components/directives';\nimport { InputDirective } from '@agorapulse/ui-components/input';\nimport { InputGroupComponent } from '@agorapulse/ui-components/input-group';\nimport { SymbolComponent, SymbolRegistry, apClose, apSearch } from '@agorapulse/ui-symbol';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nlet inputSearchId = 0;\n\n@Component({\n selector: 'ap-input-search',\n templateUrl: './input-search.component.html',\n styleUrls: ['./input-search.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [InputGroupComponent, InputDirective, FormsModule, SymbolComponent, ClickDirective],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputSearchComponent),\n multi: true,\n },\n ],\n})\nexport class InputSearchComponent implements ControlValueAccessor {\n id = input<string>('');\n placeholder = input<string>('');\n clearable = input(true);\n\n /** Id of the list this field drives, when it drives one. */\n ariaControls = input<string | null>(null);\n\n /** Id of the option this field marks in that list, so focus can stay in the field. */\n ariaActiveDescendant = input<string | null>(null);\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n focus = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n keyup = output<KeyboardEvent>();\n\n inputElement = viewChild.required<ElementRef>('input');\n\n value = signal<string | null>('');\n defaultInputId = `ap-input-search-${inputSearchId++}`;\n\n inputId = computed(() => this.id() ?? this.defaultInputId);\n\n disabled = signal(false);\n\n onTouched: () => void = () => {};\n\n onChanged: (value: any) => void = () => {};\n\n private symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.registerSymbols([apSearch, apClose]);\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChanged = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n onValueChange(value: string | null) {\n this.writeValue(value);\n this.onChanged(value);\n }\n\n focusInput(): void {\n this.inputElement().nativeElement.focus();\n }\n\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n onClear($event: Event): void {\n $event.stopImmediatePropagation();\n this.onValueChange(null);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focus.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.blur.emit($event);\n }\n\n onKeyup($event: KeyboardEvent): void {\n this.keyup.emit($event);\n }\n}\n","<ap-input-group>\n <ap-symbol symbolId=\"search\" />\n <input\n #input\n apInput\n [id]=\"inputId()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [attr.aria-controls]=\"ariaControls()\"\n [attr.aria-activedescendant]=\"ariaActiveDescendant()\"\n [ngModel]=\"value()\"\n (blur)=\"onBlurHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (keyup)=\"onKeyup($event)\"\n (ngModelChange)=\"onValueChange($event)\" />\n @if (clearable() && value()) {\n <div\n class=\"close\"\n aria-label=\"Clear search\"\n (apClick)=\"onClear($event)\">\n <ap-symbol\n symbolId=\"close\"\n size=\"xs\" />\n </div>\n }\n</ap-input-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAmBA,IAAI,aAAa,GAAG,CAAC;MAiBR,oBAAoB,CAAA;IAC7B,EAAE,GAAG,KAAK,CAAS,EAAE;2EAAC;IACtB,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;IAC/B,SAAS,GAAG,KAAK,CAAC,IAAI;kFAAC;;IAGvB,YAAY,GAAG,KAAK,CAAgB,IAAI;qFAAC;;IAGzC,oBAAoB,GAAG,KAAK,CAAgB,IAAI;6FAAC;;IAGjD,KAAK,GAAG,MAAM,EAAc;;IAE5B,IAAI,GAAG,MAAM,EAAc;;IAE3B,KAAK,GAAG,MAAM,EAAiB;AAE/B,IAAA,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAa,OAAO,CAAC;IAEtD,KAAK,GAAG,MAAM,CAAgB,EAAE;8EAAC;AACjC,IAAA,cAAc,GAAG,CAAA,gBAAA,EAAmB,aAAa,EAAE,EAAE;AAErD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,cAAc;gFAAC;IAE1D,QAAQ,GAAG,MAAM,CAAC,KAAK;iFAAC;AAExB,IAAA,SAAS,GAAe,MAAK,EAAE,CAAC;AAEhC,IAAA,SAAS,GAAyB,MAAK,EAAE,CAAC;AAElC,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAE/C,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CA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EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FASlF,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;+BACI,iBAAiB,EAAA,eAAA,EAGV,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,CAAC,EAAA,SAAA,EACjF;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,0BAA0B,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACd,yBAAA;AACJ,qBAAA,EAAA,QAAA,EAAA,0zBAAA,EAAA,MAAA,EAAA,CAAA,6eAAA,CAAA,EAAA;2uBAoB6C,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEtDzD;;AAEG;;;;"}
|
|
@@ -82,7 +82,7 @@ class LabelsSelectorComponent {
|
|
|
82
82
|
}))));
|
|
83
83
|
}
|
|
84
84
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelsSelectorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LabelsSelectorComponent, isStandalone: true, selector: "ap-labels-selector", inputs: { addLabelEnabled: "addLabelEnabled", disabled: "disabled", initialLabels: "initialLabels", translation: "translation", loadingOnSearch: "loadingOnSearch", multipleEnabled: "multipleEnabled", searchLabelsFunction: "searchLabelsFunction" }, outputs: { createLabel: "createLabel", addLabel: "addLabel", deleteLabel: "deleteLabel", selectLabels: "selectLabels", searchErrorMessage: "searchErrorMessage" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- @JRA [multiple]=\"false\" break the component display and behavior, we use [maxSelectedItems]=\"1\" as efficient workaround -->\n<ng-select\n #select\n class=\"labels-select ap-select\"\n apSelectMultiple\n appendTo=\"body\"\n [clearable]=\"false\"\n [disabled]=\"disabled\"\n [items]=\"(labels$ | async) ?? []\"\n [loading]=\"labelsLoading\"\n [minTermLength]=\"0\"\n [multiple]=\"true\"\n [placeholder]=\"translation.placeholder\"\n [typeahead]=\"labelsInput$\"\n [(ngModel)]=\"labels\"\n (change)=\"onLabelsChange()\"\n (add)=\"onAddLabel($event)\"\n (remove)=\"onDeleteLabel($event)\"\n (open)=\"onOpen()\">\n <ng-template\n let-items=\"items\"\n let-clear=\"clear\"\n ng-multi-label-tmp>\n <ap-select-label-multiple\n displayType=\"label\"\n [selectedItems]=\"items\"\n (removeItem)=\"clear($event)\" />\n </ng-template>\n <ng-template\n let-item=\"item\"\n let-item$=\"item$\"\n ng-option-tmp>\n <ap-dropdown-item-multiple-one-line\n [text]=\"item\"\n [htmlId]=\"item$.htmlId\"\n [selected]=\"item$.selected\" />\n </ng-template>\n <ng-template ng-header-tmp>\n <ap-dropdown-search-form\n [searchPlaceholder]=\"translation.searchPlaceholder ?? translation.placeholder\"\n [select]=\"select\" />\n </ng-template>\n @if (addLabelEnabled) {\n <ng-template\n let-searchTerm=\"searchTerm\"\n ng-footer-tmp>\n <ap-dropdown-create-new\n [text]=\"translation.createLabel\"\n [searchTerm]=\"searchTerm\"\n (createNew)=\"onCreateLabel($event)\" />\n </ng-template>\n }\n <ng-template ng-notfound-tmp>\n <div class=\"option not-found\">\n <span>{{ select.notFoundText() || 'Not found text' }}</span>\n </div>\n </ng-template>\n <ng-template ng-loadingtext-tmp>\n <div class=\"loading-state\">\n <ap-loader diameter=\"30\" />\n <span>{{ select.loadingText() || 'Loading Items' }}</span>\n </div>\n </ng-template>\n</ng-select>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}:host{max-width:260px;display:flex}.labels-select{width:260px}.labels-select .labels-wrapper{margin-bottom:5px;max-width:221px}::ng-deep .labels-select.ng-select .ng-select-container .ng-value-container{overflow-y:auto;overflow-x:hidden;max-height:171px;padding-left:6px!important;gap:4px}::ng-deep .ng-option{color:#344563!important}::ng-deep .ng-option.ng-option-marked{color:#178dfe!important}.add-label{display:flex;align-items:center;color:#178dfe}.add-label .add-label-icon{padding-right:8px}.add-label-preview{text-overflow:ellipsis;display:block;white-space:nowrap;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: ApSelectModule }, { kind: "directive", type: i1.SelectMultipleDirective, selector: "ng-select[apSelectMultiple]", inputs: ["maxItemsTooltip", "pinnedItemsEnabled"] }, { kind: "component", type: i1.DropdownItemMultipleOneLineComponent, selector: "ap-dropdown-item-multiple-one-line", inputs: ["text", "selected", "indeterminate", "htmlId", "disabled", "avatarUrl", "symbolId", "disabledTooltip", "badgeText", "dividerEnabled", "presentational", "onlyEnabled", "onlyText", "isFeatureLocked", "roundedAvatar", "network", "symbolColor", "symbolTooltipText"], outputs: ["selectOnly", "lockedFeatureClicked"] }, { kind: "component", type: i1.SelectLabelMultipleComponent, selector: "ap-select-label-multiple", inputs: ["displayType", "tagColor", "selectedItems", "bindLabel", "bindValue", "bindAvatarUrl", "bindSymbolId", "roundedAvatar", "bindNetwork", "bindTagColor", "disabled"], outputs: ["removeItem"] }, { kind: "component", type: i1.DropdownSearchFormComponent, selector: "ap-dropdown-search-form", inputs: ["searchPlaceholder", "createNewEnabled", "createText", "select"], outputs: ["createNew"] }, { kind: "component", type: i1.DropdownCreateNewComponent, selector: "ap-dropdown-create-new", inputs: ["text", "searchTerm"], outputs: ["createNew"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "clearKeepsDisabledOptions", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "popover", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgMultiLabelTemplateDirective, selector: "[ng-multi-label-tmp]" }, { kind: "directive", type: i2.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }, { kind: "directive", type: i2.NgFooterTemplateDirective, selector: "[ng-footer-tmp]" }, { kind: "directive", type: i2.NgNotFoundTemplateDirective, selector: "[ng-notfound-tmp]" }, { kind: "directive", type: i2.NgLoadingTextTemplateDirective, selector: "[ng-loadingtext-tmp]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LoaderComponent, selector: "ap-loader", inputs: ["color", "diameter"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LabelsSelectorComponent, isStandalone: true, selector: "ap-labels-selector", inputs: { addLabelEnabled: "addLabelEnabled", disabled: "disabled", initialLabels: "initialLabels", translation: "translation", loadingOnSearch: "loadingOnSearch", multipleEnabled: "multipleEnabled", searchLabelsFunction: "searchLabelsFunction" }, outputs: { createLabel: "createLabel", addLabel: "addLabel", deleteLabel: "deleteLabel", selectLabels: "selectLabels", searchErrorMessage: "searchErrorMessage" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- @JRA [multiple]=\"false\" break the component display and behavior, we use [maxSelectedItems]=\"1\" as efficient workaround -->\n<ng-select\n #select\n class=\"labels-select ap-select\"\n apSelectMultiple\n appendTo=\"body\"\n [clearable]=\"false\"\n [disabled]=\"disabled\"\n [items]=\"(labels$ | async) ?? []\"\n [loading]=\"labelsLoading\"\n [minTermLength]=\"0\"\n [multiple]=\"true\"\n [placeholder]=\"translation.placeholder\"\n [typeahead]=\"labelsInput$\"\n [(ngModel)]=\"labels\"\n (change)=\"onLabelsChange()\"\n (add)=\"onAddLabel($event)\"\n (remove)=\"onDeleteLabel($event)\"\n (open)=\"onOpen()\">\n <ng-template\n let-items=\"items\"\n let-clear=\"clear\"\n ng-multi-label-tmp>\n <ap-select-label-multiple\n displayType=\"label\"\n [selectedItems]=\"items\"\n (removeItem)=\"clear($event)\" />\n </ng-template>\n <ng-template\n let-item=\"item\"\n let-item$=\"item$\"\n ng-option-tmp>\n <ap-dropdown-item-multiple-one-line\n [text]=\"item\"\n [htmlId]=\"item$.htmlId\"\n [selected]=\"item$.selected\" />\n </ng-template>\n <ng-template ng-header-tmp>\n <ap-dropdown-search-form\n [searchPlaceholder]=\"translation.searchPlaceholder ?? translation.placeholder\"\n [select]=\"select\" />\n </ng-template>\n @if (addLabelEnabled) {\n <ng-template\n let-searchTerm=\"searchTerm\"\n ng-footer-tmp>\n <ap-dropdown-create-new\n [text]=\"translation.createLabel\"\n [searchTerm]=\"searchTerm\"\n (createNew)=\"onCreateLabel($event)\" />\n </ng-template>\n }\n <ng-template ng-notfound-tmp>\n <div class=\"option not-found\">\n <span>{{ select.notFoundText() || 'Not found text' }}</span>\n </div>\n </ng-template>\n <ng-template ng-loadingtext-tmp>\n <div class=\"loading-state\">\n <ap-loader diameter=\"30\" />\n <span>{{ select.loadingText() || 'Loading Items' }}</span>\n </div>\n </ng-template>\n</ng-select>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}:host{max-width:260px;display:flex}.labels-select{width:260px}.labels-select .labels-wrapper{margin-bottom:5px;max-width:221px}::ng-deep .labels-select.ng-select .ng-select-container .ng-value-container{overflow-y:auto;overflow-x:hidden;max-height:171px;padding-left:6px!important;gap:4px}::ng-deep .ng-option{color:#344563!important}::ng-deep .ng-option.ng-option-marked{color:#178dfe!important}.add-label{display:flex;align-items:center;color:#178dfe}.add-label .add-label-icon{padding-right:8px}.add-label-preview{text-overflow:ellipsis;display:block;white-space:nowrap;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: ApSelectModule }, { kind: "directive", type: i1.SelectMultipleDirective, selector: "ng-select[apSelectMultiple]", inputs: ["maxItemsTooltip", "pinnedItemsEnabled", "selectAllEnabled", "selectAllText", "selectAllCountText"] }, { kind: "component", type: i1.DropdownItemMultipleOneLineComponent, selector: "ap-dropdown-item-multiple-one-line", inputs: ["text", "selected", "indeterminate", "htmlId", "disabled", "avatarUrl", "symbolId", "disabledTooltip", "badgeText", "dividerEnabled", "presentational", "onlyEnabled", "onlyText", "isFeatureLocked", "roundedAvatar", "network", "symbolColor", "symbolTooltipText"], outputs: ["selectOnly", "lockedFeatureClicked"] }, { kind: "component", type: i1.SelectLabelMultipleComponent, selector: "ap-select-label-multiple", inputs: ["displayType", "tagColor", "selectedItems", "bindLabel", "bindValue", "bindAvatarUrl", "bindSymbolId", "roundedAvatar", "bindNetwork", "bindTagColor", "disabled"], outputs: ["removeItem"] }, { kind: "component", type: i1.DropdownSearchFormComponent, selector: "ap-dropdown-search-form", inputs: ["searchPlaceholder", "createNewEnabled", "createText", "select"], outputs: ["createNew"] }, { kind: "component", type: i1.DropdownCreateNewComponent, selector: "ap-dropdown-create-new", inputs: ["text", "searchTerm"], outputs: ["createNew"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "clearKeepsDisabledOptions", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "popover", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgMultiLabelTemplateDirective, selector: "[ng-multi-label-tmp]" }, { kind: "directive", type: i2.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }, { kind: "directive", type: i2.NgFooterTemplateDirective, selector: "[ng-footer-tmp]" }, { kind: "directive", type: i2.NgNotFoundTemplateDirective, selector: "[ng-notfound-tmp]" }, { kind: "directive", type: i2.NgLoadingTextTemplateDirective, selector: "[ng-loadingtext-tmp]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LoaderComponent, selector: "ap-loader", inputs: ["color", "diameter"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
86
86
|
}
|
|
87
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelsSelectorComponent, decorators: [{
|
|
88
88
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-labels-selector.mjs","sources":["../../../libs/ui-components/labels-selector/src/labels-selector.component.ts","../../../libs/ui-components/labels-selector/src/labels-selector.component.html","../../../libs/ui-components/labels-selector/src/agorapulse-ui-components-labels-selector.ts"],"sourcesContent":["import { LoaderComponent } from '@agorapulse/ui-animations';\nimport { LabelComponent } from '@agorapulse/ui-components/labels';\nimport { ApSelectModule } from '@agorapulse/ui-components/select';\nimport { AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { NgSelectComponent } from '@ng-select/ng-select';\nimport { Observable, Subject } from 'rxjs';\nimport { catchError, debounceTime, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\n\nexport interface LabelsSelectorTranslation {\n placeholder: string;\n createLabel: string;\n searchPlaceholder?: string;\n}\n\n@Component({\n selector: 'ap-labels-selector',\n templateUrl: './labels-selector.component.html',\n styleUrls: ['./labels-selector.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ApSelectModule, LabelComponent, FormsModule, AsyncPipe, LoaderComponent],\n})\nexport class LabelsSelectorComponent implements OnInit, OnChanges {\n @Input() addLabelEnabled: boolean = true;\n @Input() disabled: boolean = false;\n @Input() initialLabels: string[] = [];\n @Input() translation!: LabelsSelectorTranslation;\n @Input() loadingOnSearch: boolean = true;\n @Input() multipleEnabled: boolean = true;\n @Input({\n required: true,\n })\n searchLabelsFunction!: (val: string) => Observable<string[]>;\n\n @Output() createLabel = new EventEmitter<string>();\n @Output() addLabel = new EventEmitter<string>();\n @Output() deleteLabel = new EventEmitter<string>();\n @Output() selectLabels = new EventEmitter<string[]>();\n @Output() searchErrorMessage = new EventEmitter<string>();\n\n @ViewChild('select') select!: NgSelectComponent;\n\n labels: string[] = [];\n labelsInput$: Subject<string> = new Subject<string>();\n labels$!: Observable<string[]>;\n labelsLoading = false;\n\n constructor(private changeDetectorRef: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.labels = this.initialLabels;\n this.setSearchFunction();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.initialLabels?.currentValue) {\n this.labels = this.initialLabels;\n }\n }\n\n onCreateLabel(label: string): void {\n if (label && this.initialLabels.indexOf(label) === -1) {\n const handleTag = (item: string) => this.select.itemsList.addItem(item);\n this.select.select(handleTag(label));\n }\n this.createLabel.emit(label);\n }\n\n onDeleteLabel(label: string) {\n this.deleteLabel.emit(label);\n }\n\n onAddLabel(label: string) {\n this.addLabel.emit(label);\n }\n\n onOpen(): void {\n this.labelsInput$.next('');\n }\n\n onLabelsChange(): void {\n if (!this.multipleEnabled && this.labels.length > 1) {\n this.labels = [this.labels[this.labels.length - 1]];\n }\n this.selectLabels.emit(this.labels);\n this.changeDetectorRef.markForCheck();\n }\n\n setSearchFunction(): void {\n this.labels$ = this.labelsInput$.pipe(\n debounceTime(this.loadingOnSearch ? 400 : 0),\n distinctUntilChanged(),\n tap(() => {\n this.labelsLoading = true;\n this.changeDetectorRef.markForCheck();\n }),\n switchMap((term: string) =>\n this.searchLabelsFunction(term).pipe(\n catchError(response => {\n this.searchErrorMessage.emit(response.error ? response.error.message : 'Error');\n return [];\n }),\n map(response => {\n this.labelsLoading = false;\n this.changeDetectorRef.markForCheck();\n if (!response || Object.keys(response).length == 0) {\n return [];\n }\n return response;\n })\n )\n )\n );\n }\n}\n","<!-- @JRA [multiple]=\"false\" break the component display and behavior, we use [maxSelectedItems]=\"1\" as efficient workaround -->\n<ng-select\n #select\n class=\"labels-select ap-select\"\n apSelectMultiple\n appendTo=\"body\"\n [clearable]=\"false\"\n [disabled]=\"disabled\"\n [items]=\"(labels$ | async) ?? []\"\n [loading]=\"labelsLoading\"\n [minTermLength]=\"0\"\n [multiple]=\"true\"\n [placeholder]=\"translation.placeholder\"\n [typeahead]=\"labelsInput$\"\n [(ngModel)]=\"labels\"\n (change)=\"onLabelsChange()\"\n (add)=\"onAddLabel($event)\"\n (remove)=\"onDeleteLabel($event)\"\n (open)=\"onOpen()\">\n <ng-template\n let-items=\"items\"\n let-clear=\"clear\"\n ng-multi-label-tmp>\n <ap-select-label-multiple\n displayType=\"label\"\n [selectedItems]=\"items\"\n (removeItem)=\"clear($event)\" />\n </ng-template>\n <ng-template\n let-item=\"item\"\n let-item$=\"item$\"\n ng-option-tmp>\n <ap-dropdown-item-multiple-one-line\n [text]=\"item\"\n [htmlId]=\"item$.htmlId\"\n [selected]=\"item$.selected\" />\n </ng-template>\n <ng-template ng-header-tmp>\n <ap-dropdown-search-form\n [searchPlaceholder]=\"translation.searchPlaceholder ?? translation.placeholder\"\n [select]=\"select\" />\n </ng-template>\n @if (addLabelEnabled) {\n <ng-template\n let-searchTerm=\"searchTerm\"\n ng-footer-tmp>\n <ap-dropdown-create-new\n [text]=\"translation.createLabel\"\n [searchTerm]=\"searchTerm\"\n (createNew)=\"onCreateLabel($event)\" />\n </ng-template>\n }\n <ng-template ng-notfound-tmp>\n <div class=\"option not-found\">\n <span>{{ select.notFoundText() || 'Not found text' }}</span>\n </div>\n </ng-template>\n <ng-template ng-loadingtext-tmp>\n <div class=\"loading-state\">\n <ap-loader diameter=\"30\" />\n <span>{{ select.loadingText() || 'Loading Items' }}</span>\n </div>\n </ng-template>\n</ng-select>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAkCa,uBAAuB,CAAA;AAyBZ,IAAA,iBAAA;IAxBX,eAAe,GAAY,IAAI;IAC/B,QAAQ,GAAY,KAAK;IACzB,aAAa,GAAa,EAAE;AAC5B,IAAA,WAAW;IACX,eAAe,GAAY,IAAI;IAC/B,eAAe,GAAY,IAAI;AAIxC,IAAA,oBAAoB;AAEV,IAAA,WAAW,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A,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAa,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAA1B,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEvD,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,eAAA,EAGb,uBAAuB,CAAC,MAAM,WACtC,CAAC,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,4qEAAA,EAAA,MAAA,EAAA,CAAA,+nMAAA,CAAA,EAAA;;sBAGjF;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;;sBAGA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA,SAAS;uBAAC,QAAQ;;;AEpDvB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-labels-selector.mjs","sources":["../../../libs/ui-components/labels-selector/src/labels-selector.component.ts","../../../libs/ui-components/labels-selector/src/labels-selector.component.html","../../../libs/ui-components/labels-selector/src/agorapulse-ui-components-labels-selector.ts"],"sourcesContent":["import { LoaderComponent } from '@agorapulse/ui-animations';\nimport { LabelComponent } from '@agorapulse/ui-components/labels';\nimport { ApSelectModule } from '@agorapulse/ui-components/select';\nimport { AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { NgSelectComponent } from '@ng-select/ng-select';\nimport { Observable, Subject } from 'rxjs';\nimport { catchError, debounceTime, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\n\nexport interface LabelsSelectorTranslation {\n placeholder: string;\n createLabel: string;\n searchPlaceholder?: string;\n}\n\n@Component({\n selector: 'ap-labels-selector',\n templateUrl: './labels-selector.component.html',\n styleUrls: ['./labels-selector.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ApSelectModule, LabelComponent, FormsModule, AsyncPipe, LoaderComponent],\n})\nexport class LabelsSelectorComponent implements OnInit, OnChanges {\n @Input() addLabelEnabled: boolean = true;\n @Input() disabled: boolean = false;\n @Input() initialLabels: string[] = [];\n @Input() translation!: LabelsSelectorTranslation;\n @Input() loadingOnSearch: boolean = true;\n @Input() multipleEnabled: boolean = true;\n @Input({\n required: true,\n })\n searchLabelsFunction!: (val: string) => Observable<string[]>;\n\n @Output() createLabel = new EventEmitter<string>();\n @Output() addLabel = new EventEmitter<string>();\n @Output() deleteLabel = new EventEmitter<string>();\n @Output() selectLabels = new EventEmitter<string[]>();\n @Output() searchErrorMessage = new EventEmitter<string>();\n\n @ViewChild('select') select!: NgSelectComponent;\n\n labels: string[] = [];\n labelsInput$: Subject<string> = new Subject<string>();\n labels$!: Observable<string[]>;\n labelsLoading = false;\n\n constructor(private changeDetectorRef: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n this.labels = this.initialLabels;\n this.setSearchFunction();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.initialLabels?.currentValue) {\n this.labels = this.initialLabels;\n }\n }\n\n onCreateLabel(label: string): void {\n if (label && this.initialLabels.indexOf(label) === -1) {\n const handleTag = (item: string) => this.select.itemsList.addItem(item);\n this.select.select(handleTag(label));\n }\n this.createLabel.emit(label);\n }\n\n onDeleteLabel(label: string) {\n this.deleteLabel.emit(label);\n }\n\n onAddLabel(label: string) {\n this.addLabel.emit(label);\n }\n\n onOpen(): void {\n this.labelsInput$.next('');\n }\n\n onLabelsChange(): void {\n if (!this.multipleEnabled && this.labels.length > 1) {\n this.labels = [this.labels[this.labels.length - 1]];\n }\n this.selectLabels.emit(this.labels);\n this.changeDetectorRef.markForCheck();\n }\n\n setSearchFunction(): void {\n this.labels$ = this.labelsInput$.pipe(\n debounceTime(this.loadingOnSearch ? 400 : 0),\n distinctUntilChanged(),\n tap(() => {\n this.labelsLoading = true;\n this.changeDetectorRef.markForCheck();\n }),\n switchMap((term: string) =>\n this.searchLabelsFunction(term).pipe(\n catchError(response => {\n this.searchErrorMessage.emit(response.error ? response.error.message : 'Error');\n return [];\n }),\n map(response => {\n this.labelsLoading = false;\n this.changeDetectorRef.markForCheck();\n if (!response || Object.keys(response).length == 0) {\n return [];\n }\n return response;\n })\n )\n )\n );\n }\n}\n","<!-- @JRA [multiple]=\"false\" break the component display and behavior, we use [maxSelectedItems]=\"1\" as efficient workaround -->\n<ng-select\n #select\n class=\"labels-select ap-select\"\n apSelectMultiple\n appendTo=\"body\"\n [clearable]=\"false\"\n [disabled]=\"disabled\"\n [items]=\"(labels$ | async) ?? []\"\n [loading]=\"labelsLoading\"\n [minTermLength]=\"0\"\n [multiple]=\"true\"\n [placeholder]=\"translation.placeholder\"\n [typeahead]=\"labelsInput$\"\n [(ngModel)]=\"labels\"\n (change)=\"onLabelsChange()\"\n (add)=\"onAddLabel($event)\"\n (remove)=\"onDeleteLabel($event)\"\n (open)=\"onOpen()\">\n <ng-template\n let-items=\"items\"\n let-clear=\"clear\"\n ng-multi-label-tmp>\n <ap-select-label-multiple\n displayType=\"label\"\n [selectedItems]=\"items\"\n (removeItem)=\"clear($event)\" />\n </ng-template>\n <ng-template\n let-item=\"item\"\n let-item$=\"item$\"\n ng-option-tmp>\n <ap-dropdown-item-multiple-one-line\n [text]=\"item\"\n [htmlId]=\"item$.htmlId\"\n [selected]=\"item$.selected\" />\n </ng-template>\n <ng-template ng-header-tmp>\n <ap-dropdown-search-form\n [searchPlaceholder]=\"translation.searchPlaceholder ?? translation.placeholder\"\n [select]=\"select\" />\n </ng-template>\n @if (addLabelEnabled) {\n <ng-template\n let-searchTerm=\"searchTerm\"\n ng-footer-tmp>\n <ap-dropdown-create-new\n [text]=\"translation.createLabel\"\n [searchTerm]=\"searchTerm\"\n (createNew)=\"onCreateLabel($event)\" />\n </ng-template>\n }\n <ng-template ng-notfound-tmp>\n <div class=\"option not-found\">\n <span>{{ select.notFoundText() || 'Not found text' }}</span>\n </div>\n </ng-template>\n <ng-template ng-loadingtext-tmp>\n <div class=\"loading-state\">\n <ap-loader diameter=\"30\" />\n <span>{{ select.loadingText() || 'Loading Items' }}</span>\n </div>\n </ng-template>\n</ng-select>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAkCa,uBAAuB,CAAA;AAyBZ,IAAA,iBAAA;IAxBX,eAAe,GAAY,IAAI;IAC/B,QAAQ,GAAY,KAAK;IACzB,aAAa,GAAa,EAAE;AAC5B,IAAA,WAAW;IACX,eAAe,GAAY,IAAI;IAC/B,eAAe,GAAY,IAAI;AAIxC,IAAA,oBAAoB;AAEV,IAAA,WAAW,GAAG,IAAI,YAAY,EAAU;AACxC,IAAA,QAAQ,GAAG,IAAI,YAAY,EAAU;AACrC,IAAA,WAAW,GAAG,IAAI,YAAY,EAAU;AACxC,IAAA,YAAY,GAAG,IAAI,YAAY,EAAY;AAC3C,IAAA,kBAAkB,GAAG,IAAI,YAAY,EAAU;AAEpC,IAAA,MAAM;IAE3B,MAAM,GAAa,EAAE;AACrB,IAAA,YAAY,GAAo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AAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAA1B,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEvD,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,eAAA,EAGb,uBAAuB,CAAC,MAAM,WACtC,CAAC,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,4qEAAA,EAAA,MAAA,EAAA,CAAA,+nMAAA,CAAA,EAAA;;sBAGjF;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;;sBAGA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA,SAAS;uBAAC,QAAQ;;;AEpDvB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, output, ViewEncapsulation, ChangeDetectionStrategy, Component, Input, ElementRef, Renderer2, ViewContainerRef, DestroyRef, effect, Directive, booleanAttribute, HostListener, ViewChild, EventEmitter, Output,
|
|
2
|
+
import { inject, input, output, ViewEncapsulation, ChangeDetectionStrategy, Component, Input, signal, computed, ElementRef, Renderer2, ViewContainerRef, DestroyRef, effect, Directive, Injector, untracked, booleanAttribute, HostListener, ViewChild, EventEmitter, Output, afterNextRender, NgModule } from '@angular/core';
|
|
3
3
|
import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select';
|
|
4
4
|
import { SymbolRegistry, apPlus, SymbolComponent, apCheck } from '@agorapulse/ui-symbol';
|
|
5
5
|
import { BadgeComponent } from '@agorapulse/ui-components/badge';
|
|
@@ -107,6 +107,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
107
107
|
type: Input
|
|
108
108
|
}] } });
|
|
109
109
|
|
|
110
|
+
/** "Select all" row added above the options by `SelectMultipleDirective` when `selectAllEnabled` is set. */
|
|
111
|
+
class DropdownSelectAllComponent {
|
|
112
|
+
select = input.required(/* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "select" }] : /* istanbul ignore next */ []));
|
|
114
|
+
text = input('Select all', /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/** Appended to `text`. `{selected}` and `{total}` are replaced by the counts of the options it acts on. */
|
|
117
|
+
countText = input('({selected} of {total})', /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "countText" }] : /* istanbul ignore next */ []));
|
|
119
|
+
marked = signal(false, /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "marked" }] : /* istanbul ignore next */ []));
|
|
121
|
+
/** Bumped by the owner on every selection or filter change, as `itemsList` is not reactive. */
|
|
122
|
+
version = signal(0, /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []));
|
|
124
|
+
targets = computed(() => {
|
|
125
|
+
this.version();
|
|
126
|
+
return this.select().itemsList.filteredItems.filter(item => !item.children && !item.disabled);
|
|
127
|
+
}, /* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [{ debugName: "targets" }] : /* istanbul ignore next */ []));
|
|
129
|
+
visible = computed(() => this.targets().length > 0, /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
131
|
+
checked = computed(() => this.visible() && this.targets().every(item => item.selected), /* @ts-ignore */
|
|
132
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
133
|
+
indeterminate = computed(() => !this.checked() && this.targets().some(item => item.selected), /* @ts-ignore */
|
|
134
|
+
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
135
|
+
label = computed(() => {
|
|
136
|
+
const targets = this.targets();
|
|
137
|
+
const count = this.countText()
|
|
138
|
+
.replace('{selected}', String(targets.filter(item => item.selected).length))
|
|
139
|
+
.replace('{total}', String(targets.length));
|
|
140
|
+
return count ? `${this.text()} ${count}` : this.text();
|
|
141
|
+
}, /* @ts-ignore */
|
|
142
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
143
|
+
ariaChecked = computed(() => (this.checked() ? 'true' : this.indeterminate() ? 'mixed' : 'false'), /* @ts-ignore */
|
|
144
|
+
...(ngDevMode ? [{ debugName: "ariaChecked" }] : /* istanbul ignore next */ []));
|
|
145
|
+
get rowId() {
|
|
146
|
+
return `${this.select().dropdownId}-select-all`;
|
|
147
|
+
}
|
|
148
|
+
refresh() {
|
|
149
|
+
this.version.update(version => version + 1);
|
|
150
|
+
}
|
|
151
|
+
/** Handles a key before ng-select does, and returns whether it did. */
|
|
152
|
+
handleKey(event) {
|
|
153
|
+
const select = this.select();
|
|
154
|
+
if (!this.visible() || !select.isOpen()) {
|
|
155
|
+
this.marked.set(false);
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
if (this.marked()) {
|
|
159
|
+
switch (event.key) {
|
|
160
|
+
case 'ArrowUp':
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
return true;
|
|
163
|
+
case 'Enter':
|
|
164
|
+
case ' ':
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
this.toggle();
|
|
167
|
+
return true;
|
|
168
|
+
default:
|
|
169
|
+
this.marked.set(false);
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (event.key === 'ArrowUp' && this.isAtFirstOption()) {
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
select.itemsList.unmarkItem();
|
|
176
|
+
this.marked.set(true);
|
|
177
|
+
select.detectChanges();
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
isAtFirstOption() {
|
|
183
|
+
const { markedIndex, filteredItems } = this.select().itemsList;
|
|
184
|
+
return markedIndex < 0 || filteredItems.slice(0, markedIndex).every(item => item.disabled);
|
|
185
|
+
}
|
|
186
|
+
toggle() {
|
|
187
|
+
const select = this.select();
|
|
188
|
+
// Snapshot first: selecting may clear the search (`clearSearchOnAdd`), which refilters the list.
|
|
189
|
+
const targets = this.targets();
|
|
190
|
+
const hasSelection = targets.some(item => item.selected);
|
|
191
|
+
const selectAll = select.maxSelectedItems() ? !hasSelection : !this.checked();
|
|
192
|
+
if (selectAll) {
|
|
193
|
+
for (const item of targets) {
|
|
194
|
+
select.select(item);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
for (const item of targets.filter(target => target.selected)) {
|
|
199
|
+
select.unselect(item);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
this.refresh();
|
|
203
|
+
select.detectChanges();
|
|
204
|
+
}
|
|
205
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownSelectAllComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
206
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: DropdownSelectAllComponent, isStandalone: true, selector: "ap-dropdown-select-all", inputs: { select: { classPropertyName: "select", publicName: "select", isSignal: true, isRequired: true, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, countText: { classPropertyName: "countText", publicName: "countText", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.hidden": "visible() ? null : \"\"" } }, ngImport: i0, template: "<button\n type=\"button\"\n role=\"checkbox\"\n class=\"select-all-row\"\n tabindex=\"-1\"\n [id]=\"rowId\"\n [class.marked]=\"marked()\"\n [attr.aria-checked]=\"ariaChecked()\"\n (click)=\"toggle()\">\n <ap-checkbox\n class=\"centered\"\n fullyControlled\n presentational\n [name]=\"'option-select-all-' + select().dropdownId\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\">\n <span class=\"select-all-text\">\n {{ label() }}\n </span>\n </ap-checkbox>\n</button>\n", styles: ["ap-dropdown-select-all{display:block;padding:0 var(--comp-select-search-bar-padding-horizontal);margin-bottom:var(--ref-spacing-xxs);border-bottom:1px solid var(--comp-select-search-bar-border-bottom-color)}ap-dropdown-select-all[hidden]{display:none}.ng-dropdown-header ap-dropdown-select-all{padding:0;margin:0;border:none}ap-dropdown-select-all .select-all-row{display:flex;align-items:center;width:100%;height:var(--comp-select-one-line-height);box-sizing:border-box;margin:0;padding:0 var(--comp-select-search-bar-padding-horizontal);border:none;background-color:var(--comp-select-one-line-background-color);cursor:pointer;text-align:left}ap-dropdown-select-all .select-all-row.marked{background-color:var(--ref-color-electric-blue-10)}ap-dropdown-select-all .select-all-row ap-checkbox{width:100%;pointer-events:none}ap-dropdown-select-all .select-all-row ap-checkbox .checkbox{width:100%}ap-dropdown-select-all .select-all-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-family:var(--comp-select-one-line-selected-text-font-family);font-size:var(--comp-select-one-line-selected-text-size);font-weight:var(--comp-select-one-line-selected-text-font-weight);line-height:var(--comp-select-one-line-selected-text-line-height);color:var(--comp-select-one-line-text-color)}.ng-dropdown-panel.ap-select .ng-dropdown-header:has(>ap-dropdown-select-all:not([hidden])){padding-bottom:0}\n"], dependencies: [{ kind: "component", type: CheckboxComponent, selector: "ap-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "disabled", "indeterminate", "checked", "fullyControlled", "presentational", "required", "name"], outputs: ["change"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
207
|
+
}
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownSelectAllComponent, decorators: [{
|
|
209
|
+
type: Component,
|
|
210
|
+
args: [{ selector: 'ap-dropdown-select-all', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CheckboxComponent], host: {
|
|
211
|
+
'[attr.hidden]': 'visible() ? null : ""',
|
|
212
|
+
}, template: "<button\n type=\"button\"\n role=\"checkbox\"\n class=\"select-all-row\"\n tabindex=\"-1\"\n [id]=\"rowId\"\n [class.marked]=\"marked()\"\n [attr.aria-checked]=\"ariaChecked()\"\n (click)=\"toggle()\">\n <ap-checkbox\n class=\"centered\"\n fullyControlled\n presentational\n [name]=\"'option-select-all-' + select().dropdownId\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\">\n <span class=\"select-all-text\">\n {{ label() }}\n </span>\n </ap-checkbox>\n</button>\n", styles: ["ap-dropdown-select-all{display:block;padding:0 var(--comp-select-search-bar-padding-horizontal);margin-bottom:var(--ref-spacing-xxs);border-bottom:1px solid var(--comp-select-search-bar-border-bottom-color)}ap-dropdown-select-all[hidden]{display:none}.ng-dropdown-header ap-dropdown-select-all{padding:0;margin:0;border:none}ap-dropdown-select-all .select-all-row{display:flex;align-items:center;width:100%;height:var(--comp-select-one-line-height);box-sizing:border-box;margin:0;padding:0 var(--comp-select-search-bar-padding-horizontal);border:none;background-color:var(--comp-select-one-line-background-color);cursor:pointer;text-align:left}ap-dropdown-select-all .select-all-row.marked{background-color:var(--ref-color-electric-blue-10)}ap-dropdown-select-all .select-all-row ap-checkbox{width:100%;pointer-events:none}ap-dropdown-select-all .select-all-row ap-checkbox .checkbox{width:100%}ap-dropdown-select-all .select-all-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-family:var(--comp-select-one-line-selected-text-font-family);font-size:var(--comp-select-one-line-selected-text-size);font-weight:var(--comp-select-one-line-selected-text-font-weight);line-height:var(--comp-select-one-line-selected-text-line-height);color:var(--comp-select-one-line-text-color)}.ng-dropdown-panel.ap-select .ng-dropdown-header:has(>ap-dropdown-select-all:not([hidden])){padding-bottom:0}\n"] }]
|
|
213
|
+
}], propDecorators: { select: [{ type: i0.Input, args: [{ isSignal: true, alias: "select", required: true }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], countText: [{ type: i0.Input, args: [{ isSignal: true, alias: "countText", required: false }] }] } });
|
|
214
|
+
|
|
110
215
|
class SelectBaseDirective {
|
|
111
216
|
inlineLabel = input(/* @ts-ignore */
|
|
112
217
|
...(ngDevMode ? [undefined, { debugName: "inlineLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -268,14 +373,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
268
373
|
class SelectMultipleDirective {
|
|
269
374
|
selectComponent = inject(NgSelectComponent);
|
|
270
375
|
elementRef = inject(ElementRef);
|
|
376
|
+
injector = inject(Injector);
|
|
271
377
|
originalDisabledState = new WeakMap();
|
|
272
378
|
maxItemsTooltip = input(/* @ts-ignore */
|
|
273
379
|
...(ngDevMode ? [undefined, { debugName: "maxItemsTooltip" }] : /* istanbul ignore next */ []));
|
|
274
380
|
/** Pins items selected at open time to the top of the dropdown. Ignored when `groupBy` is set. */
|
|
275
381
|
pinnedItemsEnabled = input(false, /* @ts-ignore */
|
|
276
382
|
...(ngDevMode ? [{ debugName: "pinnedItemsEnabled" }] : /* istanbul ignore next */ []));
|
|
383
|
+
/** Adds a "Select all" row above the options, acting on every visible option across groups. */
|
|
384
|
+
selectAllEnabled = input(false, /* @ts-ignore */
|
|
385
|
+
...(ngDevMode ? [{ debugName: "selectAllEnabled" }] : /* istanbul ignore next */ []));
|
|
386
|
+
/** Label of the "Select all" row. */
|
|
387
|
+
selectAllText = input('Select all', /* @ts-ignore */
|
|
388
|
+
...(ngDevMode ? [{ debugName: "selectAllText" }] : /* istanbul ignore next */ []));
|
|
389
|
+
/** Count after the "Select all" label. `{selected}` and `{total}` are replaced; empty hides it. */
|
|
390
|
+
selectAllCountText = input('({selected} of {total})', /* @ts-ignore */
|
|
391
|
+
...(ngDevMode ? [{ debugName: "selectAllCountText" }] : /* istanbul ignore next */ []));
|
|
277
392
|
valueContainer = null;
|
|
278
393
|
subs = new Subscription();
|
|
394
|
+
selectAllRow = null;
|
|
279
395
|
constructor() {
|
|
280
396
|
this.selectComponent.multiple.set(true);
|
|
281
397
|
this.selectComponent.closeOnSelect.set(false);
|
|
@@ -286,7 +402,9 @@ class SelectMultipleDirective {
|
|
|
286
402
|
this.subs.add(this.selectComponent.openEvent.subscribe(() => {
|
|
287
403
|
this.pinSelectedAtTop();
|
|
288
404
|
this.openAtTop();
|
|
405
|
+
this.mountSelectAll();
|
|
289
406
|
}));
|
|
407
|
+
this.subs.add(this.selectComponent.closeEvent.subscribe(() => this.unmountSelectAll()));
|
|
290
408
|
}
|
|
291
409
|
ngAfterViewInit() {
|
|
292
410
|
if (!this.selectComponent.multiLabelTemplate()) {
|
|
@@ -303,6 +421,7 @@ class SelectMultipleDirective {
|
|
|
303
421
|
if (this.valueContainer) {
|
|
304
422
|
this.valueContainer.removeEventListener('mousedown', this.onMousedown, true);
|
|
305
423
|
}
|
|
424
|
+
this.unmountSelectAll();
|
|
306
425
|
this.subs.unsubscribe();
|
|
307
426
|
}
|
|
308
427
|
onMousedown = (event) => {
|
|
@@ -343,6 +462,72 @@ class SelectMultipleDirective {
|
|
|
343
462
|
}
|
|
344
463
|
});
|
|
345
464
|
}
|
|
465
|
+
// `openEvent` fires before ng-select renders the panel, hence the microtask (cf. `pinSelectedAtTop`).
|
|
466
|
+
mountSelectAll() {
|
|
467
|
+
if (!this.selectAllEnabled())
|
|
468
|
+
return;
|
|
469
|
+
queueMicrotask(() => {
|
|
470
|
+
const panel = document.getElementById(this.selectComponent.dropdownId);
|
|
471
|
+
const items = panel?.querySelector('.ng-dropdown-panel-items');
|
|
472
|
+
if (!panel || !items || !this.selectComponent.isOpen())
|
|
473
|
+
return;
|
|
474
|
+
this.unmountSelectAll();
|
|
475
|
+
const ref = this.injector.get(ViewContainerRef).createComponent(DropdownSelectAllComponent);
|
|
476
|
+
ref.setInput('select', this.selectComponent);
|
|
477
|
+
ref.setInput('text', this.selectAllText());
|
|
478
|
+
ref.setInput('countText', this.selectAllCountText());
|
|
479
|
+
const host = ref.location.nativeElement;
|
|
480
|
+
// ng-select closes or blurs on a press it receives; the row handles its own clicks.
|
|
481
|
+
host.addEventListener('mousedown', event => event.preventDefault());
|
|
482
|
+
const header = panel.querySelector('.ng-dropdown-header');
|
|
483
|
+
if (header) {
|
|
484
|
+
header.append(host);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
items.before(host);
|
|
488
|
+
}
|
|
489
|
+
// Also reached by the keys the header search field forwards.
|
|
490
|
+
const originalHandleKeyCodeInput = this.selectComponent.handleKeyCodeInput.bind(this.selectComponent);
|
|
491
|
+
this.selectComponent.handleKeyCodeInput = (event) => {
|
|
492
|
+
const handled = ref.instance.handleKey(event);
|
|
493
|
+
if (!handled) {
|
|
494
|
+
originalHandleKeyCodeInput(event);
|
|
495
|
+
}
|
|
496
|
+
this.syncActiveDescendant(ref.instance);
|
|
497
|
+
};
|
|
498
|
+
const unmarkOnHover = () => ref.instance.marked.set(false);
|
|
499
|
+
items.addEventListener('mouseover', unmarkOnHover);
|
|
500
|
+
const refresh = () => ref.instance.refresh();
|
|
501
|
+
const subs = new Subscription(() => {
|
|
502
|
+
this.selectComponent.handleKeyCodeInput = originalHandleKeyCodeInput;
|
|
503
|
+
items.removeEventListener('mouseover', unmarkOnHover);
|
|
504
|
+
});
|
|
505
|
+
subs.add(this.selectComponent.addEvent.subscribe(refresh));
|
|
506
|
+
subs.add(this.selectComponent.removeEvent.subscribe(refresh));
|
|
507
|
+
subs.add(this.selectComponent.clearEvent.subscribe(refresh));
|
|
508
|
+
subs.add(this.selectComponent.searchEvent.subscribe(refresh));
|
|
509
|
+
// ng-select rebuilds its list after this effect runs.
|
|
510
|
+
const itemsEffect = effect(() => {
|
|
511
|
+
this.selectComponent.items();
|
|
512
|
+
untracked(() => queueMicrotask(refresh));
|
|
513
|
+
}, { ...(ngDevMode ? { debugName: "itemsEffect" } : /* istanbul ignore next */ {}), injector: this.injector });
|
|
514
|
+
this.selectAllRow = { ref, subs, itemsEffect };
|
|
515
|
+
ref.changeDetectorRef.detectChanges();
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
syncActiveDescendant(selectAll) {
|
|
519
|
+
if (!selectAll.marked())
|
|
520
|
+
return;
|
|
521
|
+
this.elementRef.nativeElement.querySelector('input[role="combobox"]')?.setAttribute('aria-activedescendant', selectAll.rowId);
|
|
522
|
+
}
|
|
523
|
+
unmountSelectAll() {
|
|
524
|
+
if (!this.selectAllRow)
|
|
525
|
+
return;
|
|
526
|
+
this.selectAllRow.subs.unsubscribe();
|
|
527
|
+
this.selectAllRow.itemsEffect.destroy();
|
|
528
|
+
this.selectAllRow.ref.destroy();
|
|
529
|
+
this.selectAllRow = null;
|
|
530
|
+
}
|
|
346
531
|
// On open, ng-select natively marks the last selected option, which ends up scrolling the panel to it.
|
|
347
532
|
// This method removes the mark so that the panel stays scrolled to the top.
|
|
348
533
|
openAtTop() {
|
|
@@ -371,7 +556,7 @@ class SelectMultipleDirective {
|
|
|
371
556
|
}
|
|
372
557
|
}
|
|
373
558
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectMultipleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
374
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: SelectMultipleDirective, isStandalone: true, selector: "ng-select[apSelectMultiple]", inputs: { maxItemsTooltip: { classPropertyName: "maxItemsTooltip", publicName: "maxItemsTooltip", isSignal: true, isRequired: false, transformFunction: null }, pinnedItemsEnabled: { classPropertyName: "pinnedItemsEnabled", publicName: "pinnedItemsEnabled", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: SelectBaseDirective, inputs: ["inlineLabel", "inlineLabel", "symbolId", "symbolId", "clearable", "clearable"] }], ngImport: i0 });
|
|
559
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: SelectMultipleDirective, isStandalone: true, selector: "ng-select[apSelectMultiple]", inputs: { maxItemsTooltip: { classPropertyName: "maxItemsTooltip", publicName: "maxItemsTooltip", isSignal: true, isRequired: false, transformFunction: null }, pinnedItemsEnabled: { classPropertyName: "pinnedItemsEnabled", publicName: "pinnedItemsEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectAllEnabled: { classPropertyName: "selectAllEnabled", publicName: "selectAllEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectAllText: { classPropertyName: "selectAllText", publicName: "selectAllText", isSignal: true, isRequired: false, transformFunction: null }, selectAllCountText: { classPropertyName: "selectAllCountText", publicName: "selectAllCountText", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: SelectBaseDirective, inputs: ["inlineLabel", "inlineLabel", "symbolId", "symbolId", "clearable", "clearable"] }], ngImport: i0 });
|
|
375
560
|
}
|
|
376
561
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectMultipleDirective, decorators: [{
|
|
377
562
|
type: Directive,
|
|
@@ -385,7 +570,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
385
570
|
},
|
|
386
571
|
],
|
|
387
572
|
}]
|
|
388
|
-
}], ctorParameters: () => [], propDecorators: { maxItemsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItemsTooltip", required: false }] }], pinnedItemsEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedItemsEnabled", required: false }] }] } });
|
|
573
|
+
}], ctorParameters: () => [], propDecorators: { maxItemsTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItemsTooltip", required: false }] }], pinnedItemsEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedItemsEnabled", required: false }] }], selectAllEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllEnabled", required: false }] }], selectAllText: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllText", required: false }] }], selectAllCountText: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllCountText", required: false }] }] } });
|
|
389
574
|
|
|
390
575
|
class DropdownItemMultipleOneLineComponent {
|
|
391
576
|
symbolRegistry = inject(SymbolRegistry);
|
|
@@ -934,5 +1119,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
934
1119
|
* Generated bundle index. Do not edit.
|
|
935
1120
|
*/
|
|
936
1121
|
|
|
937
|
-
export { ApSelectModule, DropdownCreateNewComponent, DropdownGroupItemComponent, DropdownItemMultipleOneLineComponent, DropdownItemMultipleTwoLinesComponent, DropdownItemSingleOneLineComponent, DropdownItemSingleTwoLinesComponent, DropdownSearchFormComponent, SelectBaseDirective, SelectLabelMultipleComponent, SelectLabelSingleComponent, SelectMultipleDirective, SelectSingleDirective };
|
|
1122
|
+
export { ApSelectModule, DropdownCreateNewComponent, DropdownGroupItemComponent, DropdownItemMultipleOneLineComponent, DropdownItemMultipleTwoLinesComponent, DropdownItemSingleOneLineComponent, DropdownItemSingleTwoLinesComponent, DropdownSearchFormComponent, DropdownSelectAllComponent, SelectBaseDirective, SelectLabelMultipleComponent, SelectLabelSingleComponent, SelectMultipleDirective, SelectSingleDirective };
|
|
938
1123
|
//# sourceMappingURL=agorapulse-ui-components-select.mjs.map
|