@agorapulse/ui-components 22.7.0 → 22.7.1-beta.1
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.7.1-beta.1.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-i18n.mjs +7 -0
- package/fesm2022/agorapulse-ui-components-i18n.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs +65 -56
- package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs.map +1 -1
- package/package.json +1 -1
- package/types/agorapulse-ui-components-i18n.d.ts +7 -0
- package/types/agorapulse-ui-components-selection-dropdown.d.ts +44 -35
- package/agorapulse-ui-components-22.7.0.tgz +0 -0
|
Binary file
|
|
@@ -13,8 +13,15 @@ const DEFAULT_TEXTS = Object.freeze({
|
|
|
13
13
|
'ui-components.filters.update-existing-preset': 'Update existing preset',
|
|
14
14
|
'ui-components.filters.date-range-placeholder': 'Select date range',
|
|
15
15
|
'ui-components.search.placeholder': 'Search',
|
|
16
|
+
'ui-components.search.no-results': 'No results found',
|
|
17
|
+
'ui-components.search.results': '{{count}} results',
|
|
16
18
|
'ui-components.select.only': 'Only',
|
|
17
19
|
'ui-components.select.placeholder': 'Select an option',
|
|
20
|
+
'ui-components.selection.label': 'Selection',
|
|
21
|
+
'ui-components.selection.selected-section': 'Selected',
|
|
22
|
+
'ui-components.selection.options-section': 'Options',
|
|
23
|
+
'ui-components.selection.select-all': 'Select all',
|
|
24
|
+
'ui-components.selection.select-all-count': '({{selected}} of {{total}})',
|
|
18
25
|
});
|
|
19
26
|
/**
|
|
20
27
|
* Holds the fallback table read by `injectTranslate`; provide another table to override it, for instance in a test.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-i18n.mjs","sources":["../../../libs/ui-components/i18n/src/default-texts.ts","../../../libs/ui-components/i18n/src/key-guard.ts","../../../libs/ui-components/i18n/src/raw.pipe.ts","../../../libs/ui-components/i18n/src/translation.model.ts","../../../libs/ui-components/i18n/src/translation.provider.ts","../../../libs/ui-components/i18n/src/resolve-texts.ts","../../../libs/ui-components/i18n/src/agorapulse-ui-components-i18n.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_TEXTS = Object.freeze({\n 'ui-components.filters.trigger': 'Filters',\n 'ui-components.filters.aria-label': 'Filters',\n 'ui-components.filters.apply': 'Apply filters',\n 'ui-components.filters.clear': 'Clear filters',\n 'ui-components.filters.reset': 'Reset filters',\n 'ui-components.filters.save-preset': 'Save preset',\n 'ui-components.filters.save-new-presets': 'Save new presets',\n 'ui-components.filters.save-as-new-preset': 'Save as new preset',\n 'ui-components.filters.update-existing-preset': 'Update existing preset',\n 'ui-components.filters.date-range-placeholder': 'Select date range',\n 'ui-components.search.placeholder': 'Search',\n 'ui-components.select.only': 'Only',\n 'ui-components.select.placeholder': 'Select an option',\n} as const);\n\n/**\n * A key of the DS default texts, the only keys a component may fall back to.\n *\n * @example\n * const key: DefaultTextKey = 'ui-components.search.placeholder';\n */\nexport type DefaultTextKey = keyof typeof DEFAULT_TEXTS;\n\n/**\n * Holds the fallback table read by `injectTranslate`; provide another table to override it, for instance in a test.\n *\n * @example\n * TestBed.configureTestingModule({ providers: [{ provide: UI_COMPONENTS_DEFAULT_TEXTS, useValue: { 'ui-components.ok': 'OK' } }] });\n */\nexport const UI_COMPONENTS_DEFAULT_TEXTS = new InjectionToken<Readonly<Record<string, string>>>('UI_COMPONENTS_DEFAULT_TEXTS', {\n providedIn: 'root',\n factory: () => DEFAULT_TEXTS,\n});\n\nexport function fallbackText(\n key: string,\n params?: Record<string, unknown>,\n table: Readonly<Record<string, string>> = DEFAULT_TEXTS\n): string | undefined {\n if (!Object.prototype.hasOwnProperty.call(table, key)) return undefined;\n\n return table[key].replace(/\\{\\{\\s*([^{}\\s]+)\\s*\\}\\}/g, (placeholder, name: string) =>\n params?.[name] !== undefined && params[name] !== null && Object.prototype.hasOwnProperty.call(params, name)\n ? String(params[name])\n : placeholder\n );\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * The default `isKey`: dotted segments, so dotted data such as `example.com` passes too.\n *\n * @example\n * DEFAULT_IS_KEY('report.filter.apply'); // true\n * DEFAULT_IS_KEY('Black Friday 2026'); // false\n */\nexport const DEFAULT_IS_KEY = (text: string): boolean => /^[\\w-]+(\\.[\\w-]+)+$/.test(text);\n\nconst warnedValues = new Set<string>();\n\nexport function warnIfNotKey(text: string, isKey: (text: string) => boolean, devMode: boolean = isDevMode()): void {\n if (!devMode || isKey(text) || warnedValues.has(text)) return;\n\n warnedValues.add(text);\n console.warn(`[ui-components/i18n] \"${text}\" is not a translation key. Wrap displayed data with raw() (or | apRaw).`);\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { RawText } from './translation.model';\n\n/**\n * Turns a text into a {@link RawText} so a component displays it as is. `null` and `undefined` give an empty text.\n *\n * @example\n * <ap-button [i18n]=\"{ label: user.name | apRaw }\" />\n */\n@Pipe({ name: 'apRaw' })\nexport class RawPipe implements PipeTransform {\n transform(text: string | null | undefined): RawText {\n return { raw: text ?? '' };\n }\n}\n","/**\n * A translation key with optional interpolation parameters.\n *\n * @example\n * const request: TranslationKeyRequest = { key: 'inbox.unread', params: { count: 3 } };\n */\nexport type TranslationKeyRequest = { key: string; params?: Record<string, unknown> };\n\n/**\n * A text displayed as is, never looked up in a catalogue (user content, names, handles).\n *\n * @example\n * const text: RawText = { raw: 'jordan.amar' };\n */\nexport type RawText = { raw: string };\n\n/**\n * What a component accepts for a displayed text: a string is a translation key,\n * `{ key, params }` a key with parameters, `{ raw }` a text displayed as is.\n *\n * @example\n * const label: TranslationRequest = 'common.save';\n */\nexport type TranslationRequest = string | TranslationKeyRequest | RawText;\n\n/**\n * Declares the translatable inputs of a component: `Req` are required, `Opt` optional.\n *\n * @example\n * type ButtonI18n = I18nOf<'label', 'caption'>;\n * const i18n: ButtonI18n = { label: 'common.save' };\n */\nexport type I18nOf<Req extends string, Opt extends string = never> = Record<Req, TranslationRequest> &\n Partial<Record<Opt, TranslationRequest>>;\n\n/**\n * Marks a text to display as is: it never reaches the app's `translate`.\n *\n * @example\n * raw('jordan.amar'); // { raw: 'jordan.amar' }\n */\nexport function raw(text: string): RawText {\n return { raw: text };\n}\n\n/**\n * Checks the shape only: an object with a string `raw`, whatever other keys it carries.\n *\n * @example\n * isRawText({ raw: 'x' }); // true\n * isRawText('a.b'); // false\n */\nexport function isRawText(value: unknown): value is RawText {\n return typeof value === 'object' && value !== null && 'raw' in value && typeof value.raw === 'string';\n}\n\n/**\n * Checks the shape only: an object with a string `key`; `params` is not validated.\n *\n * @example\n * isKeyRequest({ key: 'a.b' }); // true\n * isKeyRequest({ label: 'x' }); // false\n */\nexport function isKeyRequest(value: unknown): value is TranslationKeyRequest {\n return typeof value === 'object' && value !== null && 'key' in value && typeof value.key === 'string';\n}\n","import { computed, inject, InjectionToken, isDevMode, Provider, Signal } from '@angular/core';\nimport { fallbackText, UI_COMPONENTS_DEFAULT_TEXTS } from './default-texts';\nimport { DEFAULT_IS_KEY, warnIfNotKey } from './key-guard';\nimport { isKeyRequest, isRawText, TranslationRequest } from './translation.model';\n\n/**\n * How the DS translates the texts it renders, provided by the consuming app.\n *\n * @example\n * const config: UiComponentsTranslation = { translate: (key, params) => catalogue.instant(key, params), language: currentLanguage };\n */\nexport interface UiComponentsTranslation {\n /** Turns a key and its simple params into the text to render. */\n translate: (key: string, params?: Record<string, unknown>) => string;\n /** The app's current language, such as `fr`; texts are recomputed when it changes. */\n language?: Signal<string>;\n /** Used by the dev guard only, never for rendering; defaults to `DEFAULT_IS_KEY`. */\n isKey?: (text: string) => boolean;\n}\n\n/**\n * Holds the app's translation; absent when the app provides none.\n *\n * @example\n * const translation = inject(UI_COMPONENTS_TRANSLATION, { optional: true });\n */\nexport const UI_COMPONENTS_TRANSLATION = new InjectionToken<UiComponentsTranslation>('UI_COMPONENTS_TRANSLATION');\n\n/**\n * Plugs the app's translation into the DS components.\n *\n * @param config the translation, or a factory run in an injection context when it needs `inject()`.\n *\n * @example\n * provideUiComponentsTranslation(() => {\n * const translateService = inject(TranslateService);\n * return { translate: (key, params) => translateService.instant(key, params) };\n * });\n */\nexport function provideUiComponentsTranslation(config: UiComponentsTranslation | (() => UiComponentsTranslation)): Provider {\n return typeof config === 'function'\n ? { provide: UI_COMPONENTS_TRANSLATION, useFactory: config }\n : { provide: UI_COMPONENTS_TRANSLATION, useValue: config };\n}\n\n/**\n * Call in an injection context; the returned function renders a {@link TranslationRequest} and, read inside a\n * `computed`, follows language changes. Resolution rules: `design-specs/patterns/translation.md`.\n *\n * @example\n * const t = injectTranslate();\n * const title = computed(() => t(this.i18n().title, { count: this.count() }));\n */\nexport function injectTranslate(): (request: TranslationRequest | null | undefined, params?: Record<string, unknown>) => string {\n const translation = inject(UI_COMPONENTS_TRANSLATION, { optional: true });\n const defaultTexts = inject(UI_COMPONENTS_DEFAULT_TEXTS);\n const isKey = translation?.isKey ?? DEFAULT_IS_KEY;\n\n function resolve(request: unknown, dsParams?: Record<string, unknown>): string {\n translation?.language?.();\n\n if (request === null || request === undefined || request === '') return '';\n if (typeof request === 'string') {\n warnIfNotKey(request, isKey);\n return translateKey(request, dsParams);\n }\n if (isRawText(request)) return request.raw;\n if (isKeyRequest(request)) {\n if (request.key === '') return '';\n return translateKey(request.key, request.params || dsParams ? { ...request.params, ...definedEntries(dsParams) } : undefined);\n }\n\n if (isDevMode()) {\n console.warn(\n '[ui-components/i18n] Unsupported translation request, expected a key string, { key, params } or { raw }:',\n request\n );\n }\n return '';\n }\n\n function translateKey(key: string, params: Record<string, unknown> | undefined): string {\n const resolvedParams = resolveParams(params);\n if (!translation) return fallbackText(key, resolvedParams, defaultTexts) ?? key;\n\n const translated = translation.translate(key, resolvedParams);\n return translated === key ? (fallbackText(key, resolvedParams, defaultTexts) ?? translated) : translated;\n }\n\n function definedEntries(params: Record<string, unknown> | undefined): Record<string, unknown> {\n return Object.fromEntries(Object.entries(params ?? {}).filter(([, value]) => value !== undefined));\n }\n\n function resolveParams(params: Record<string, unknown> | undefined): Record<string, unknown> | undefined {\n if (!params) return undefined;\n return Object.fromEntries(\n Object.entries(params).map(([name, value]) => [name, isRawText(value) || isKeyRequest(value) ? resolve(value) : value])\n );\n }\n\n return resolve;\n}\n\n/**\n * The app's current language, `undefined` when the app gives none.\n *\n * @example\n * const language = injectLanguage();\n * const locale = computed(() => language() ?? 'en');\n */\nexport function injectLanguage(): Signal<string | undefined> {\n const translation = inject(UI_COMPONENTS_TRANSLATION, { optional: true });\n\n return computed(() => translation?.language?.());\n}\n","import { DefaultTextKey } from './default-texts';\nimport { TranslationRequest } from './translation.model';\nimport { injectTranslate } from './translation.provider';\n\n/**\n * The text roles a component renders: per role, the DS default key, or `null` when the role has no default.\n *\n * @example\n * const ROLES = { title: null, placeholder: 'ui-components.select.placeholder' } as const satisfies TextRoles;\n */\nexport type TextRoles = Readonly<Record<string, DefaultTextKey | null>>;\n\n/**\n * The text roles a component renders from a model `i18n` type: any subset of its keys, each with a DS default key or `null`.\n * Checked with `satisfies`, a role the model does not declare fails compilation.\n *\n * @example\n * const ROLES = { caption: null, placeholder: 'ui-components.select.placeholder' } as const satisfies TextRolesOf<Group['i18n']>;\n */\nexport type TextRolesOf<I18n> = Readonly<Partial<Record<keyof I18n & string, DefaultTextKey | null>>>;\n\n/**\n * Resolves every role of `roles` from `i18n` in one call: an absent role (`null` or `undefined`) takes its default key,\n * or stays `undefined` without one; an explicit request wins even when it renders empty.\n * A model `i18n` carrying more roles than `roles` lists is accepted.\n */\nexport type ResolveTexts = <R extends TextRoles>(\n i18n: Readonly<Partial<Record<keyof NoInfer<R> & string, TranslationRequest | null | undefined>>> | null | undefined,\n roles: R\n) => ResolvedTexts<R>;\n\ntype ResolvedTexts<R extends TextRoles> = { [K in keyof R]: R[K] extends string ? string : string | undefined };\n\n/**\n * Call in an injection context; built on {@link injectTranslate}, so read inside a `computed` the texts follow language changes.\n * Resolution rules: `design-specs/patterns/translation.md`.\n *\n * @example\n * const ROLES = { title: null, placeholder: 'ui-components.select.placeholder' } as const satisfies TextRolesOf<Group['i18n']>;\n * const resolveTexts = injectResolveTexts();\n * const texts = computed(() => resolveTexts(this.i18n(), ROLES));\n */\nexport function injectResolveTexts(): ResolveTexts {\n const t = injectTranslate();\n\n return <R extends TextRoles>(\n i18n: Readonly<Partial<Record<keyof R & string, TranslationRequest | null | undefined>>> | null | undefined,\n roles: R\n ) => {\n const requests: Readonly<Partial<Record<string, TranslationRequest | null | undefined>>> = i18n ?? {};\n // A mapped type over a generic R cannot be built key by key; the keys are exactly those of `roles`.\n return Object.fromEntries(\n Object.entries(roles).map(([role, defaultKey]) => {\n const request = requests[role] ?? defaultKey;\n return [role, request === null ? undefined : t(request)];\n })\n ) as ResolvedTexts<R>;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;AACvC,IAAA,+BAA+B,EAAE,SAAS;AAC1C,IAAA,kCAAkC,EAAE,SAAS;AAC7C,IAAA,6BAA6B,EAAE,eAAe;AAC9C,IAAA,6BAA6B,EAAE,eAAe;AAC9C,IAAA,6BAA6B,EAAE,eAAe;AAC9C,IAAA,mCAAmC,EAAE,aAAa;AAClD,IAAA,wCAAwC,EAAE,kBAAkB;AAC5D,IAAA,0CAA0C,EAAE,oBAAoB;AAChE,IAAA,8CAA8C,EAAE,wBAAwB;AACxE,IAAA,8CAA8C,EAAE,mBAAmB;AACnE,IAAA,kCAAkC,EAAE,QAAQ;AAC5C,IAAA,2BAA2B,EAAE,MAAM;AACnC,IAAA,kCAAkC,EAAE,kBAAkB;AAChD,CAAA,CAAC;AAUX;;;;;AAKG;MACU,2BAA2B,GAAG,IAAI,cAAc,CAAmC,6BAA6B,EAAE;AAC3H,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,aAAa;AAC/B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AG,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC,CAAC,CACe;AACzB,IAAA,CAAC;AACL;;AC1DA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-i18n.mjs","sources":["../../../libs/ui-components/i18n/src/default-texts.ts","../../../libs/ui-components/i18n/src/key-guard.ts","../../../libs/ui-components/i18n/src/raw.pipe.ts","../../../libs/ui-components/i18n/src/translation.model.ts","../../../libs/ui-components/i18n/src/translation.provider.ts","../../../libs/ui-components/i18n/src/resolve-texts.ts","../../../libs/ui-components/i18n/src/agorapulse-ui-components-i18n.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_TEXTS = Object.freeze({\n 'ui-components.filters.trigger': 'Filters',\n 'ui-components.filters.aria-label': 'Filters',\n 'ui-components.filters.apply': 'Apply filters',\n 'ui-components.filters.clear': 'Clear filters',\n 'ui-components.filters.reset': 'Reset filters',\n 'ui-components.filters.save-preset': 'Save preset',\n 'ui-components.filters.save-new-presets': 'Save new presets',\n 'ui-components.filters.save-as-new-preset': 'Save as new preset',\n 'ui-components.filters.update-existing-preset': 'Update existing preset',\n 'ui-components.filters.date-range-placeholder': 'Select date range',\n 'ui-components.search.placeholder': 'Search',\n 'ui-components.search.no-results': 'No results found',\n 'ui-components.search.results': '{{count}} results',\n 'ui-components.select.only': 'Only',\n 'ui-components.select.placeholder': 'Select an option',\n 'ui-components.selection.label': 'Selection',\n 'ui-components.selection.selected-section': 'Selected',\n 'ui-components.selection.options-section': 'Options',\n 'ui-components.selection.select-all': 'Select all',\n 'ui-components.selection.select-all-count': '({{selected}} of {{total}})',\n} as const);\n\n/**\n * A key of the DS default texts, the only keys a component may fall back to.\n *\n * @example\n * const key: DefaultTextKey = 'ui-components.search.placeholder';\n */\nexport type DefaultTextKey = keyof typeof DEFAULT_TEXTS;\n\n/**\n * Holds the fallback table read by `injectTranslate`; provide another table to override it, for instance in a test.\n *\n * @example\n * TestBed.configureTestingModule({ providers: [{ provide: UI_COMPONENTS_DEFAULT_TEXTS, useValue: { 'ui-components.ok': 'OK' } }] });\n */\nexport const UI_COMPONENTS_DEFAULT_TEXTS = new InjectionToken<Readonly<Record<string, string>>>('UI_COMPONENTS_DEFAULT_TEXTS', {\n providedIn: 'root',\n factory: () => DEFAULT_TEXTS,\n});\n\nexport function fallbackText(\n key: string,\n params?: Record<string, unknown>,\n table: Readonly<Record<string, string>> = DEFAULT_TEXTS\n): string | undefined {\n if (!Object.prototype.hasOwnProperty.call(table, key)) return undefined;\n\n return table[key].replace(/\\{\\{\\s*([^{}\\s]+)\\s*\\}\\}/g, (placeholder, name: string) =>\n params?.[name] !== undefined && params[name] !== null && Object.prototype.hasOwnProperty.call(params, name)\n ? String(params[name])\n : placeholder\n );\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * The default `isKey`: dotted segments, so dotted data such as `example.com` passes too.\n *\n * @example\n * DEFAULT_IS_KEY('report.filter.apply'); // true\n * DEFAULT_IS_KEY('Black Friday 2026'); // false\n */\nexport const DEFAULT_IS_KEY = (text: string): boolean => /^[\\w-]+(\\.[\\w-]+)+$/.test(text);\n\nconst warnedValues = new Set<string>();\n\nexport function warnIfNotKey(text: string, isKey: (text: string) => boolean, devMode: boolean = isDevMode()): void {\n if (!devMode || isKey(text) || warnedValues.has(text)) return;\n\n warnedValues.add(text);\n console.warn(`[ui-components/i18n] \"${text}\" is not a translation key. Wrap displayed data with raw() (or | apRaw).`);\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { RawText } from './translation.model';\n\n/**\n * Turns a text into a {@link RawText} so a component displays it as is. `null` and `undefined` give an empty text.\n *\n * @example\n * <ap-button [i18n]=\"{ label: user.name | apRaw }\" />\n */\n@Pipe({ name: 'apRaw' })\nexport class RawPipe implements PipeTransform {\n transform(text: string | null | undefined): RawText {\n return { raw: text ?? '' };\n }\n}\n","/**\n * A translation key with optional interpolation parameters.\n *\n * @example\n * const request: TranslationKeyRequest = { key: 'inbox.unread', params: { count: 3 } };\n */\nexport type TranslationKeyRequest = { key: string; params?: Record<string, unknown> };\n\n/**\n * A text displayed as is, never looked up in a catalogue (user content, names, handles).\n *\n * @example\n * const text: RawText = { raw: 'jordan.amar' };\n */\nexport type RawText = { raw: string };\n\n/**\n * What a component accepts for a displayed text: a string is a translation key,\n * `{ key, params }` a key with parameters, `{ raw }` a text displayed as is.\n *\n * @example\n * const label: TranslationRequest = 'common.save';\n */\nexport type TranslationRequest = string | TranslationKeyRequest | RawText;\n\n/**\n * Declares the translatable inputs of a component: `Req` are required, `Opt` optional.\n *\n * @example\n * type ButtonI18n = I18nOf<'label', 'caption'>;\n * const i18n: ButtonI18n = { label: 'common.save' };\n */\nexport type I18nOf<Req extends string, Opt extends string = never> = Record<Req, TranslationRequest> &\n Partial<Record<Opt, TranslationRequest>>;\n\n/**\n * Marks a text to display as is: it never reaches the app's `translate`.\n *\n * @example\n * raw('jordan.amar'); // { raw: 'jordan.amar' }\n */\nexport function raw(text: string): RawText {\n return { raw: text };\n}\n\n/**\n * Checks the shape only: an object with a string `raw`, whatever other keys it carries.\n *\n * @example\n * isRawText({ raw: 'x' }); // true\n * isRawText('a.b'); // false\n */\nexport function isRawText(value: unknown): value is RawText {\n return typeof value === 'object' && value !== null && 'raw' in value && typeof value.raw === 'string';\n}\n\n/**\n * Checks the shape only: an object with a string `key`; `params` is not validated.\n *\n * @example\n * isKeyRequest({ key: 'a.b' }); // true\n * isKeyRequest({ label: 'x' }); // false\n */\nexport function isKeyRequest(value: unknown): value is TranslationKeyRequest {\n return typeof value === 'object' && value !== null && 'key' in value && typeof value.key === 'string';\n}\n","import { computed, inject, InjectionToken, isDevMode, Provider, Signal } from '@angular/core';\nimport { fallbackText, UI_COMPONENTS_DEFAULT_TEXTS } from './default-texts';\nimport { DEFAULT_IS_KEY, warnIfNotKey } from './key-guard';\nimport { isKeyRequest, isRawText, TranslationRequest } from './translation.model';\n\n/**\n * How the DS translates the texts it renders, provided by the consuming app.\n *\n * @example\n * const config: UiComponentsTranslation = { translate: (key, params) => catalogue.instant(key, params), language: currentLanguage };\n */\nexport interface UiComponentsTranslation {\n /** Turns a key and its simple params into the text to render. */\n translate: (key: string, params?: Record<string, unknown>) => string;\n /** The app's current language, such as `fr`; texts are recomputed when it changes. */\n language?: Signal<string>;\n /** Used by the dev guard only, never for rendering; defaults to `DEFAULT_IS_KEY`. */\n isKey?: (text: string) => boolean;\n}\n\n/**\n * Holds the app's translation; absent when the app provides none.\n *\n * @example\n * const translation = inject(UI_COMPONENTS_TRANSLATION, { optional: true });\n */\nexport const UI_COMPONENTS_TRANSLATION = new InjectionToken<UiComponentsTranslation>('UI_COMPONENTS_TRANSLATION');\n\n/**\n * Plugs the app's translation into the DS components.\n *\n * @param config the translation, or a factory run in an injection context when it needs `inject()`.\n *\n * @example\n * provideUiComponentsTranslation(() => {\n * const translateService = inject(TranslateService);\n * return { translate: (key, params) => translateService.instant(key, params) };\n * });\n */\nexport function provideUiComponentsTranslation(config: UiComponentsTranslation | (() => UiComponentsTranslation)): Provider {\n return typeof config === 'function'\n ? { provide: UI_COMPONENTS_TRANSLATION, useFactory: config }\n : { provide: UI_COMPONENTS_TRANSLATION, useValue: config };\n}\n\n/**\n * Call in an injection context; the returned function renders a {@link TranslationRequest} and, read inside a\n * `computed`, follows language changes. Resolution rules: `design-specs/patterns/translation.md`.\n *\n * @example\n * const t = injectTranslate();\n * const title = computed(() => t(this.i18n().title, { count: this.count() }));\n */\nexport function injectTranslate(): (request: TranslationRequest | null | undefined, params?: Record<string, unknown>) => string {\n const translation = inject(UI_COMPONENTS_TRANSLATION, { optional: true });\n const defaultTexts = inject(UI_COMPONENTS_DEFAULT_TEXTS);\n const isKey = translation?.isKey ?? DEFAULT_IS_KEY;\n\n function resolve(request: unknown, dsParams?: Record<string, unknown>): string {\n translation?.language?.();\n\n if (request === null || request === undefined || request === '') return '';\n if (typeof request === 'string') {\n warnIfNotKey(request, isKey);\n return translateKey(request, dsParams);\n }\n if (isRawText(request)) return request.raw;\n if (isKeyRequest(request)) {\n if (request.key === '') return '';\n return translateKey(request.key, request.params || dsParams ? { ...request.params, ...definedEntries(dsParams) } : undefined);\n }\n\n if (isDevMode()) {\n console.warn(\n '[ui-components/i18n] Unsupported translation request, expected a key string, { key, params } or { raw }:',\n request\n );\n }\n return '';\n }\n\n function translateKey(key: string, params: Record<string, unknown> | undefined): string {\n const resolvedParams = resolveParams(params);\n if (!translation) return fallbackText(key, resolvedParams, defaultTexts) ?? key;\n\n const translated = translation.translate(key, resolvedParams);\n return translated === key ? (fallbackText(key, resolvedParams, defaultTexts) ?? translated) : translated;\n }\n\n function definedEntries(params: Record<string, unknown> | undefined): Record<string, unknown> {\n return Object.fromEntries(Object.entries(params ?? {}).filter(([, value]) => value !== undefined));\n }\n\n function resolveParams(params: Record<string, unknown> | undefined): Record<string, unknown> | undefined {\n if (!params) return undefined;\n return Object.fromEntries(\n Object.entries(params).map(([name, value]) => [name, isRawText(value) || isKeyRequest(value) ? resolve(value) : value])\n );\n }\n\n return resolve;\n}\n\n/**\n * The app's current language, `undefined` when the app gives none.\n *\n * @example\n * const language = injectLanguage();\n * const locale = computed(() => language() ?? 'en');\n */\nexport function injectLanguage(): Signal<string | undefined> {\n const translation = inject(UI_COMPONENTS_TRANSLATION, { optional: true });\n\n return computed(() => translation?.language?.());\n}\n","import { DefaultTextKey } from './default-texts';\nimport { TranslationRequest } from './translation.model';\nimport { injectTranslate } from './translation.provider';\n\n/**\n * The text roles a component renders: per role, the DS default key, or `null` when the role has no default.\n *\n * @example\n * const ROLES = { title: null, placeholder: 'ui-components.select.placeholder' } as const satisfies TextRoles;\n */\nexport type TextRoles = Readonly<Record<string, DefaultTextKey | null>>;\n\n/**\n * The text roles a component renders from a model `i18n` type: any subset of its keys, each with a DS default key or `null`.\n * Checked with `satisfies`, a role the model does not declare fails compilation.\n *\n * @example\n * const ROLES = { caption: null, placeholder: 'ui-components.select.placeholder' } as const satisfies TextRolesOf<Group['i18n']>;\n */\nexport type TextRolesOf<I18n> = Readonly<Partial<Record<keyof I18n & string, DefaultTextKey | null>>>;\n\n/**\n * Resolves every role of `roles` from `i18n` in one call: an absent role (`null` or `undefined`) takes its default key,\n * or stays `undefined` without one; an explicit request wins even when it renders empty.\n * A model `i18n` carrying more roles than `roles` lists is accepted.\n */\nexport type ResolveTexts = <R extends TextRoles>(\n i18n: Readonly<Partial<Record<keyof NoInfer<R> & string, TranslationRequest | null | undefined>>> | null | undefined,\n roles: R\n) => ResolvedTexts<R>;\n\ntype ResolvedTexts<R extends TextRoles> = { [K in keyof R]: R[K] extends string ? string : string | undefined };\n\n/**\n * Call in an injection context; built on {@link injectTranslate}, so read inside a `computed` the texts follow language changes.\n * Resolution rules: `design-specs/patterns/translation.md`.\n *\n * @example\n * const ROLES = { title: null, placeholder: 'ui-components.select.placeholder' } as const satisfies TextRolesOf<Group['i18n']>;\n * const resolveTexts = injectResolveTexts();\n * const texts = computed(() => resolveTexts(this.i18n(), ROLES));\n */\nexport function injectResolveTexts(): ResolveTexts {\n const t = injectTranslate();\n\n return <R extends TextRoles>(\n i18n: Readonly<Partial<Record<keyof R & string, TranslationRequest | null | undefined>>> | null | undefined,\n roles: R\n ) => {\n const requests: Readonly<Partial<Record<string, TranslationRequest | null | undefined>>> = i18n ?? {};\n // A mapped type over a generic R cannot be built key by key; the keys are exactly those of `roles`.\n return Object.fromEntries(\n Object.entries(roles).map(([role, defaultKey]) => {\n const request = requests[role] ?? defaultKey;\n return [role, request === null ? undefined : t(request)];\n })\n ) as ResolvedTexts<R>;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;AACvC,IAAA,+BAA+B,EAAE,SAAS;AAC1C,IAAA,kCAAkC,EAAE,SAAS;AAC7C,IAAA,6BAA6B,EAAE,eAAe;AAC9C,IAAA,6BAA6B,EAAE,eAAe;AAC9C,IAAA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K,CAAC,CAAC,CAC1H;IACL;AAEA,IAAA,OAAO,OAAO;AAClB;AAEA;;;;;;AAMG;SACa,cAAc,GAAA;AAC1B,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAEzE,OAAO,QAAQ,CAAC,MAAM,WAAW,EAAE,QAAQ,IAAI,CAAC;AACpD;;ACjFA;;;;;;;;AAQG;SACa,kBAAkB,GAAA;AAC9B,IAAA,MAAM,CAAC,GAAG,eAAe,EAAE;AAE3B,IAAA,OAAO,CACH,IAA2G,EAC3G,KAAQ,KACR;AACA,QAAA,MAAM,QAAQ,GAA6E,IAAI,IAAI,EAAE;;QAErG,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,KAAI;YAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,UAAU;AAC5C,YAAA,OAAO,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC,CAAC,CACe;AACzB,IAAA,CAAC;AACL;;AC1DA;;AAEG;;;;"}
|
|
@@ -3,6 +3,7 @@ import { inject, ElementRef, input, HostListener, Directive, viewChild, viewChil
|
|
|
3
3
|
import { CheckboxComponent } from '@agorapulse/ui-components/checkbox';
|
|
4
4
|
import { DropdownOptionDirective } from '@agorapulse/ui-components/dropdown-base';
|
|
5
5
|
import { DropdownPanelComponent, DropdownContentDirective } from '@agorapulse/ui-components/dropdown-panel';
|
|
6
|
+
import { injectTranslate, injectResolveTexts } from '@agorapulse/ui-components/i18n';
|
|
6
7
|
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';
|
|
7
8
|
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
8
9
|
import { DropdownItemMultipleOneLineComponent, DropdownItemSingleOneLineComponent } from '@agorapulse/ui-components/select';
|
|
@@ -70,15 +71,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
70
71
|
|
|
71
72
|
/** The only keys a search field hands to the list: Home and End belong to the caret, not the options. */
|
|
72
73
|
const NAVIGATION_FROM_SEARCH = new Set(['ArrowUp', 'ArrowDown']);
|
|
74
|
+
const ITEM_ROLES = {
|
|
75
|
+
label: null,
|
|
76
|
+
disabledTooltip: null,
|
|
77
|
+
badge: null,
|
|
78
|
+
symbolTooltip: null,
|
|
79
|
+
group: null,
|
|
80
|
+
};
|
|
81
|
+
const ROLES = {
|
|
82
|
+
title: null,
|
|
83
|
+
ariaLabel: null,
|
|
84
|
+
headerButton: null,
|
|
85
|
+
footerButton: null,
|
|
86
|
+
searchPlaceholder: 'ui-components.search.placeholder',
|
|
87
|
+
noResults: 'ui-components.search.no-results',
|
|
88
|
+
selectedSection: 'ui-components.selection.selected-section',
|
|
89
|
+
optionsSection: 'ui-components.selection.options-section',
|
|
90
|
+
selectAll: 'ui-components.selection.select-all',
|
|
91
|
+
};
|
|
73
92
|
/**
|
|
74
93
|
* Rebuilds items into one ordered list: standalone items and groups appear in the order their first
|
|
75
94
|
* item is encountered; later items of an already-seen group join that existing group entry.
|
|
76
95
|
*/
|
|
77
|
-
function inEncounterOrder(items) {
|
|
96
|
+
function inEncounterOrder(items, groupOf) {
|
|
78
97
|
const entries = [];
|
|
79
98
|
const groupsByLabel = new Map();
|
|
80
99
|
for (const item of items) {
|
|
81
|
-
const label = item
|
|
100
|
+
const label = groupOf(item);
|
|
82
101
|
if (!label) {
|
|
83
102
|
entries.push({ kind: 'item', item });
|
|
84
103
|
continue;
|
|
@@ -109,16 +128,14 @@ class SelectionDropdownComponent {
|
|
|
109
128
|
activeIndex = signal(-1, /* @ts-ignore */
|
|
110
129
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
111
130
|
injector = inject(Injector);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
...(ngDevMode ? [{ debugName: "optionsSectionText" }] : /* istanbul ignore next */ []));
|
|
121
|
-
panelLabel = computed(() => this.ariaLabel() ?? this.title() ?? 'Selection', /* @ts-ignore */
|
|
131
|
+
t = injectTranslate();
|
|
132
|
+
resolveTexts = injectResolveTexts();
|
|
133
|
+
/** Texts of the dropdown, keys or `raw()` texts; see {@link SelectionDropdownI18n}. */
|
|
134
|
+
i18n = input({}, /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "i18n" }] : /* istanbul ignore next */ []));
|
|
136
|
+
texts = computed(() => this.resolveTexts(this.i18n(), ROLES), /* @ts-ignore */
|
|
137
|
+
...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
138
|
+
panelLabel = computed(() => this.texts().ariaLabel ?? this.texts().title ?? this.t('ui-components.selection.label'), /* @ts-ignore */
|
|
122
139
|
...(ngDevMode ? [{ debugName: "panelLabel" }] : /* istanbul ignore next */ []));
|
|
123
140
|
listboxId = `ap-selection-dropdown-list-${SelectionDropdownComponent.nextId++}`;
|
|
124
141
|
keyManager = null;
|
|
@@ -140,39 +157,15 @@ class SelectionDropdownComponent {
|
|
|
140
157
|
/** Shows the search field. Ignored in `multiple` mode, which always searches. */
|
|
141
158
|
searchEnabled = input(false, /* @ts-ignore */
|
|
142
159
|
...(ngDevMode ? [{ debugName: "searchEnabled" }] : /* istanbul ignore next */ []));
|
|
143
|
-
/** Title to display in the header */
|
|
144
|
-
title = input(/* @ts-ignore */
|
|
145
|
-
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
146
|
-
/** Text for the footer button */
|
|
147
|
-
footerButtonText = input(/* @ts-ignore */
|
|
148
|
-
...(ngDevMode ? [undefined, { debugName: "footerButtonText" }] : /* istanbul ignore next */ []));
|
|
149
160
|
/** Symbol ID for the footer button */
|
|
150
161
|
footerButtonSymbolId = input(/* @ts-ignore */
|
|
151
162
|
...(ngDevMode ? [undefined, { debugName: "footerButtonSymbolId" }] : /* istanbul ignore next */ []));
|
|
152
|
-
/** Text for the header button */
|
|
153
|
-
headerButtonText = input(/* @ts-ignore */
|
|
154
|
-
...(ngDevMode ? [undefined, { debugName: "headerButtonText" }] : /* istanbul ignore next */ []));
|
|
155
163
|
/** Symbol ID for the header button */
|
|
156
164
|
headerButtonSymbolId = input(/* @ts-ignore */
|
|
157
165
|
...(ngDevMode ? [undefined, { debugName: "headerButtonSymbolId" }] : /* istanbul ignore next */ []));
|
|
158
166
|
/** Adds a "Select all" row above the options, acting on every visible option across groups. Multiple mode only. */
|
|
159
167
|
selectAllEnabled = input(false, /* @ts-ignore */
|
|
160
168
|
...(ngDevMode ? [{ debugName: "selectAllEnabled" }] : /* istanbul ignore next */ []));
|
|
161
|
-
/** Label of the "Select all" row */
|
|
162
|
-
selectAllText = input('Select all', /* @ts-ignore */
|
|
163
|
-
...(ngDevMode ? [{ debugName: "selectAllText" }] : /* istanbul ignore next */ []));
|
|
164
|
-
/** Count after the "Select all" label. `{selected}` and `{total}` are replaced; empty hides it. */
|
|
165
|
-
selectAllCountText = input('({selected} of {total})', /* @ts-ignore */
|
|
166
|
-
...(ngDevMode ? [{ debugName: "selectAllCountText" }] : /* istanbul ignore next */ []));
|
|
167
|
-
/** Placeholder text for the search input */
|
|
168
|
-
searchPlaceholderText = input('Search', /* @ts-ignore */
|
|
169
|
-
...(ngDevMode ? [{ debugName: "searchPlaceholderText" }] : /* istanbul ignore next */ []));
|
|
170
|
-
/** Text to display when no search results are found */
|
|
171
|
-
noSearchResultsText = input('No results found', /* @ts-ignore */
|
|
172
|
-
...(ngDevMode ? [{ debugName: "noSearchResultsText" }] : /* istanbul ignore next */ []));
|
|
173
|
-
/** Announced once a search settles. `{count}` is replaced by how many options matched. */
|
|
174
|
-
searchResultsText = input('{count} results', /* @ts-ignore */
|
|
175
|
-
...(ngDevMode ? [{ debugName: "searchResultsText" }] : /* istanbul ignore next */ []));
|
|
176
169
|
/** Whether to show a backdrop that closes the dropdown when clicked */
|
|
177
170
|
showBackdrop = input(true, /* @ts-ignore */
|
|
178
171
|
...(ngDevMode ? [{ debugName: "showBackdrop" }] : /* istanbul ignore next */ []));
|
|
@@ -237,16 +230,29 @@ class SelectionDropdownComponent {
|
|
|
237
230
|
/** Always true in `multiple` mode, leaving that layout untouched; only `single` collapses the header. */
|
|
238
231
|
searchVisible = computed(() => !this.isSingleSelect() || this.searchEnabled(), /* @ts-ignore */
|
|
239
232
|
...(ngDevMode ? [{ debugName: "searchVisible" }] : /* istanbul ignore next */ []));
|
|
240
|
-
headerTopVisible = computed(() => !this.isSingleSelect() || !!this.
|
|
233
|
+
headerTopVisible = computed(() => !this.isSingleSelect() || !!this.texts().title || !!this.texts().headerButton, /* @ts-ignore */
|
|
241
234
|
...(ngDevMode ? [{ debugName: "headerTopVisible" }] : /* istanbul ignore next */ []));
|
|
242
235
|
headerVisible = computed(() => this.headerTopVisible() || this.searchVisible(), /* @ts-ignore */
|
|
243
236
|
...(ngDevMode ? [{ debugName: "headerVisible" }] : /* istanbul ignore next */ []));
|
|
244
237
|
internalItems = linkedSignal(() => this.items(), /* @ts-ignore */
|
|
245
238
|
...(ngDevMode ? [{ debugName: "internalItems" }] : /* istanbul ignore next */ []));
|
|
239
|
+
itemTexts = computed(() => new Map(this.internalItems().map(item => {
|
|
240
|
+
const texts = this.resolveTexts(item.i18n, ITEM_ROLES);
|
|
241
|
+
return [item.htmlId, { ...texts, label: texts.label ?? '' }];
|
|
242
|
+
})), /* @ts-ignore */
|
|
243
|
+
...(ngDevMode ? [{ debugName: "itemTexts" }] : /* istanbul ignore next */ []));
|
|
246
244
|
filteredItems = signal([], /* @ts-ignore */
|
|
247
245
|
...(ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []));
|
|
246
|
+
searchResultCount = signal(null, /* @ts-ignore */
|
|
247
|
+
...(ngDevMode ? [{ debugName: "searchResultCount" }] : /* istanbul ignore next */ []));
|
|
248
248
|
/** What the live region holds. Empty outside a search: the list is on screen, unchanged. */
|
|
249
|
-
resultsAnnouncement =
|
|
249
|
+
resultsAnnouncement = computed(() => {
|
|
250
|
+
const count = this.searchResultCount();
|
|
251
|
+
if (count === null) {
|
|
252
|
+
return '';
|
|
253
|
+
}
|
|
254
|
+
return count === 0 ? this.texts().noResults : this.t(this.i18n().results ?? 'ui-components.search.results', { count });
|
|
255
|
+
}, /* @ts-ignore */
|
|
250
256
|
...(ngDevMode ? [{ debugName: "resultsAnnouncement" }] : /* istanbul ignore next */ []));
|
|
251
257
|
initiallySelectedItems = signal([], /* @ts-ignore */
|
|
252
258
|
...(ngDevMode ? [{ debugName: "initiallySelectedItems" }] : /* istanbul ignore next */ []));
|
|
@@ -262,10 +268,10 @@ class SelectionDropdownComponent {
|
|
|
262
268
|
}, /* @ts-ignore */
|
|
263
269
|
...(ngDevMode ? [{ debugName: "unselectedItems" }] : /* istanbul ignore next */ []));
|
|
264
270
|
/** Multiple mode's unselected zone, grouped. */
|
|
265
|
-
displayEntries = computed(() => inEncounterOrder(this.unselectedItems()), /* @ts-ignore */
|
|
271
|
+
displayEntries = computed(() => inEncounterOrder(this.unselectedItems(), item => this.groupOf(item)), /* @ts-ignore */
|
|
266
272
|
...(ngDevMode ? [{ debugName: "displayEntries" }] : /* istanbul ignore next */ []));
|
|
267
273
|
/** Single mode has no selected zone: the picked option stays in its group. */
|
|
268
|
-
singleEntries = computed(() => inEncounterOrder(this.filteredItems()), /* @ts-ignore */
|
|
274
|
+
singleEntries = computed(() => inEncounterOrder(this.filteredItems(), item => this.groupOf(item)), /* @ts-ignore */
|
|
269
275
|
...(ngDevMode ? [{ debugName: "singleEntries" }] : /* istanbul ignore next */ []));
|
|
270
276
|
/**
|
|
271
277
|
* A listbox owns only options, so a group's checkbox cannot sit inside one: each group gets its own
|
|
@@ -297,7 +303,7 @@ class SelectionDropdownComponent {
|
|
|
297
303
|
continue;
|
|
298
304
|
}
|
|
299
305
|
const groupLabel = entry.label;
|
|
300
|
-
const groupItems = this.filteredItems().filter(item => item
|
|
306
|
+
const groupItems = this.filteredItems().filter(item => this.groupOf(item) === groupLabel);
|
|
301
307
|
// Selection is counted across all members: a disabled item can still be selected, and
|
|
302
308
|
// excluding it would wrongly drop the group to "unselected" despite a live selection.
|
|
303
309
|
const hasSelection = groupItems.some(item => item.selected);
|
|
@@ -324,10 +330,11 @@ class SelectionDropdownComponent {
|
|
|
324
330
|
...(ngDevMode ? [{ debugName: "selectAllVisible" }] : /* istanbul ignore next */ []));
|
|
325
331
|
selectAllLabel = computed(() => {
|
|
326
332
|
const targets = this.selectAllTargets();
|
|
327
|
-
const count = this.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
333
|
+
const count = this.t(this.i18n().selectAllCount ?? 'ui-components.selection.select-all-count', {
|
|
334
|
+
selected: targets.filter(item => item.selected).length,
|
|
335
|
+
total: targets.length,
|
|
336
|
+
});
|
|
337
|
+
return count ? `${this.texts().selectAll} ${count}` : this.texts().selectAll;
|
|
331
338
|
}, /* @ts-ignore */
|
|
332
339
|
...(ngDevMode ? [{ debugName: "selectAllLabel" }] : /* istanbul ignore next */ []));
|
|
333
340
|
selectAllState = computed(() => {
|
|
@@ -524,7 +531,7 @@ class SelectionDropdownComponent {
|
|
|
524
531
|
/** Handles group toggle events, selecting/deselecting all items within the group */
|
|
525
532
|
onGroupToggle(groupLabel, checked) {
|
|
526
533
|
const updatedItems = this.internalItems().map(item => {
|
|
527
|
-
if (item
|
|
534
|
+
if (this.groupOf(item) === groupLabel && !item.disabled && !item.isFeatureLocked) {
|
|
528
535
|
return { ...item, selected: checked, indeterminate: false };
|
|
529
536
|
}
|
|
530
537
|
return item;
|
|
@@ -543,6 +550,13 @@ class SelectionDropdownComponent {
|
|
|
543
550
|
this.filteredItems.update(items => items.map(resolve));
|
|
544
551
|
this.selectionChange.emit(updatedItems);
|
|
545
552
|
}
|
|
553
|
+
/** The item's texts resolved in the current language. */
|
|
554
|
+
textsOf(item) {
|
|
555
|
+
return this.itemTexts().get(item.htmlId) ?? { label: '' };
|
|
556
|
+
}
|
|
557
|
+
groupOf(item) {
|
|
558
|
+
return this.textsOf(item).group;
|
|
559
|
+
}
|
|
546
560
|
/** Stable track key for a render entry (item or group). */
|
|
547
561
|
entryKey(entry) {
|
|
548
562
|
return entry.kind === 'item' ? `item:${entry.item.htmlId}` : `group:${entry.label}`;
|
|
@@ -552,12 +566,7 @@ class SelectionDropdownComponent {
|
|
|
552
566
|
* so there is no new focus to read either. Announced after the debounce, once the count is final.
|
|
553
567
|
*/
|
|
554
568
|
announceResults(term) {
|
|
555
|
-
|
|
556
|
-
this.resultsAnnouncement.set('');
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
const count = this.filteredItems().length;
|
|
560
|
-
this.resultsAnnouncement.set(count === 0 ? this.noSearchResultsText() : this.searchResultsText().replace('{count}', String(count)));
|
|
569
|
+
this.searchResultCount.set(term ? this.filteredItems().length : null);
|
|
561
570
|
}
|
|
562
571
|
/** Updates the filtered items based on search term */
|
|
563
572
|
updateFilteredItems(searchTerm, items) {
|
|
@@ -565,11 +574,11 @@ class SelectionDropdownComponent {
|
|
|
565
574
|
this.filteredItems.set(items);
|
|
566
575
|
return;
|
|
567
576
|
}
|
|
568
|
-
const filtered = items.filter(item => item.
|
|
577
|
+
const filtered = items.filter(item => this.textsOf(item).label.toLowerCase().includes(searchTerm));
|
|
569
578
|
this.filteredItems.set(filtered);
|
|
570
579
|
}
|
|
571
580
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectionDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
572
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SelectionDropdownComponent, isStandalone: true, selector: "ap-selection-dropdown", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, selectedSectionText: { classPropertyName: "selectedSectionText", publicName: "selectedSectionText", isSignal: true, isRequired: false, transformFunction: null }, optionsSectionText: { classPropertyName: "optionsSectionText", publicName: "optionsSectionText", isSignal: true, isRequired: false, transformFunction: null }, headerButtonId: { classPropertyName: "headerButtonId", publicName: "headerButtonId", isSignal: true, isRequired: false, transformFunction: null }, footerButtonId: { classPropertyName: "footerButtonId", publicName: "footerButtonId", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, searchEnabled: { classPropertyName: "searchEnabled", publicName: "searchEnabled", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, footerButtonText: { classPropertyName: "footerButtonText", publicName: "footerButtonText", isSignal: true, isRequired: false, transformFunction: null }, footerButtonSymbolId: { classPropertyName: "footerButtonSymbolId", publicName: "footerButtonSymbolId", isSignal: true, isRequired: false, transformFunction: null }, headerButtonText: { classPropertyName: "headerButtonText", publicName: "headerButtonText", isSignal: true, isRequired: false, transformFunction: null }, headerButtonSymbolId: { classPropertyName: "headerButtonSymbolId", publicName: "headerButtonSymbolId", 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 }, searchPlaceholderText: { classPropertyName: "searchPlaceholderText", publicName: "searchPlaceholderText", isSignal: true, isRequired: false, transformFunction: null }, noSearchResultsText: { classPropertyName: "noSearchResultsText", publicName: "noSearchResultsText", isSignal: true, isRequired: false, transformFunction: null }, searchResultsText: { classPropertyName: "searchResultsText", publicName: "searchResultsText", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed", selectionChange: "selectionChange", footerButtonClick: "footerButtonClick", headerButtonClick: "headerButtonClick", searchInputChange: "searchInputChange", searchTerm: "searchTermChange" }, queries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: DropdownPanelComponent, descendants: true, isSignal: true }, { propertyName: "options", predicate: DropdownOptionDirective, descendants: true, isSignal: true }, { propertyName: "inputSearchComponent", first: true, predicate: ["inputSearchElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- `dialog`, not a combobox: a combobox must close when focus leaves it, and this panel holds a\n search field, a header, a footer and group checkboxes beside its lists \u2014 closing on Tab left\n every one of them unreachable. -->\n <div\n *apDropdownContent\n class=\"ap-selection-dropdown__content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-label]=\"panelLabel()\"\n (keydown)=\"onOptionsKeyDown($event)\"\n [class.ap-selection-dropdown__content--single]=\"isSingleSelect()\"\n [style.width]=\"panelWidth()\">\n <!-- Header -->\n @if (headerVisible()) {\n <div\n class=\"ap-selection-dropdown__header\"\n [class.ap-selection-dropdown__header--select-all]=\"selectAllVisible()\">\n @if (headerTopVisible()) {\n <div class=\"ap-selection-dropdown__header-top\">\n @if (title()) {\n <h3 class=\"ap-selection-dropdown__title\">\n {{ title() }}\n </h3>\n }\n @if (headerButtonText()) {\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"headerButtonId()\"\n (click)=\"onHeaderButtonClick()\">\n <ap-symbol [symbolId]=\"headerButtonSymbolId()\" />\n {{ headerButtonText() }}\n </button>\n }\n </div>\n }\n @if (searchVisible()) {\n <ap-input-search\n #inputSearchElement\n [placeholder]=\"searchPlaceholderText()\"\n [clearable]=\"true\"\n [ariaControls]=\"listboxId\"\n [ariaActiveDescendant]=\"activeDescendantId()\"\n [ngModel]=\"searchTerm()\"\n (blur)=\"onSearchBlur()\"\n (ngModelChange)=\"onSearchTermChange($event)\" />\n }\n @if (selectAllVisible()) {\n <div class=\"ap-selection-dropdown__select-all\">\n <ap-checkbox\n class=\"centered\"\n name=\"ap-selection-dropdown-select-all\"\n [checked]=\"selectAllState() === 'selected'\"\n [indeterminate]=\"selectAllState() === 'partial'\"\n (change)=\"onSelectAllToggle($event)\">\n {{ selectAllLabel() }}\n </ap-checkbox>\n </div>\n }\n </div>\n }\n\n <!-- Selection dropdown items -->\n <div\n class=\"ap-selection-dropdown__items\"\n [id]=\"listboxId\"\n [attr.role]=\"isSingleSelect() ? 'listbox' : null\"\n [attr.aria-label]=\"isSingleSelect() ? (title() ?? null) : null\">\n @if (filteredItems().length === 0 && searchTerm()) {\n <div class=\"ap-selection-dropdown__no-results\">\n {{ noSearchResultsText() }}\n </div>\n } @else if (isSingleSelect()) {\n <!-- One listbox: a group holds only options and its presentational header (WAI-ARIA APG grouped listbox). -->\n @for (entry of singleEntries(); track entry.kind === 'group' ? 'group:' + entry.label : entry.item.htmlId) {\n @if (entry.kind === 'group') {\n <div\n role=\"group\"\n class=\"ap-selection-dropdown__group\"\n [attr.aria-labelledby]=\"groupHeaderId($index)\">\n <div\n role=\"presentation\"\n class=\"ap-selection-dropdown__group-title\"\n [id]=\"groupHeaderId($index)\">\n {{ entry.label }}\n </div>\n @for (item of entry.items; track item.htmlId) {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: item }\" />\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: entry.item }\" />\n }\n }\n\n <ng-template\n #singleOption\n let-item>\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__option\"\n [id]=\"optionId(item)\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-disabled]=\"item.disabled || item.isFeatureLocked\"\n [attr.data-track]=\"item.dataTrack\"\n [apTooltip]=\"item.disabled ? (item.disabledTooltip ?? null) : null\"\n apTooltipPosition=\"right\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-single-one-line\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [standaloneModeEnabled]=\"true\" />\n </button>\n </ng-template>\n } @else {\n <!-- A listbox owns only options, so each section is its own, and a group's checkbox sits beside it. -->\n @if (selectedItems().length > 0) {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n class=\"ap-selection-dropdown__selected-section\"\n [attr.aria-label]=\"selectedSectionText()\">\n @for (item of selectedItems(); track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n }\n\n <!-- Unselected zone: items & groups in first-encounter order -->\n @for (run of displayRuns(); track runKey(run)) {\n @if (run.kind === 'items') {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"title() ?? optionsSectionText()\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n } @else {\n <div class=\"ap-selection-dropdown__group\">\n <!-- Group header with checkbox -->\n <div class=\"ap-selection-dropdown__group-header\">\n <div class=\"ap-selection-dropdown__group-label\">\n <ap-checkbox\n class=\"centered\"\n [name]=\"run.label\"\n [checked]=\"groupSelectionStates()[run.label] === 'selected'\"\n [indeterminate]=\"groupSelectionStates()[run.label] === 'partial'\"\n (change)=\"onGroupToggle(run.label, $event)\">\n {{ run.label }}\n </ap-checkbox>\n </div>\n </div>\n\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"run.label\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = true;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n </div>\n }\n }\n }\n </div>\n\n <div\n class=\"ap-selection-dropdown__status\"\n role=\"status\"\n aria-atomic=\"true\">\n {{ resultsAnnouncement() }}\n </div>\n\n <!-- Footer -->\n @if (footerButtonText()) {\n <div class=\"ap-selection-dropdown__footer\">\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"footerButtonId()\"\n (click)=\"onFooterButtonClick()\">\n <ap-symbol [symbolId]=\"footerButtonSymbolId()\" />\n {{ footerButtonText() }}\n </button>\n </div>\n }\n </div>\n</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-selection-dropdown__content{border-radius:inherit;overflow:hidden;z-index:1000;width:370px;display:flex;flex-direction:column;max-height:min(400px,var(--ap-floating-available-height, 100vh))}.ap-selection-dropdown__content--single{width:auto;min-width:160px}.ap-selection-dropdown__option{display:block;width:100%;padding:0;border:none;background:none;font:inherit;text-align:inherit}.ap-selection-dropdown__item-button{display:block;width:100%;padding:0;margin:0;border:none;background:transparent;text-align:left;cursor:pointer;outline:none}.ap-selection-dropdown__item-button:hover,.ap-selection-dropdown__item-button.ap-dropdown-option--active{background-color:var(--ref-color-electric-blue-10)}.ap-selection-dropdown__item-button:active{background-color:var(--ref-color-electric-blue-20)}.ap-selection-dropdown__item-button:focus{outline:none}.ap-selection-dropdown__item-button:focus-visible{outline:none}.ap-selection-dropdown__item-button.ap-selection-dropdown__item-button--disabled{pointer-events:none}.ap-selection-dropdown__item{display:flex;align-items:center;width:100%;min-height:40px;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);background:transparent;cursor:pointer;font-family:Averta}.ap-selection-dropdown__group-header{display:flex;align-items:center;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);background:var(--ref-color-grey-bg)}.ap-selection-dropdown__group-title{padding:var(--comp-select-group-padding-vertical) var(--ref-spacing-sm);border-top:1px solid var(--comp-select-group-border-top-color);background:var(--comp-select-group-background-color);font-family:var(--comp-select-group-text-font-family);font-size:var(--comp-select-group-text-size);font-weight:var(--comp-select-group-text-font-weight);line-height:var(--comp-select-group-text-line-height);color:var(--comp-select-group-text-color)}.ap-selection-dropdown__group-label{display:flex;align-items:center;flex:1;font-weight:700;color:var(--ref-color-grey-100)}.ap-selection-dropdown__group-label ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__header{border-bottom:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;flex-direction:column}.ap-selection-dropdown__header .ap-selection-dropdown__header-top{display:flex;align-items:center;justify-content:space-between;padding:var(--ref-spacing-xs) var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__title{margin:0;font-size:var(--ref-font-size-md);font-weight:var(--ref-font-weight-bold);color:var(--ref-color-grey-100);flex:1}.ap-selection-dropdown__header ap-input-search{width:100%;padding:0 var(--ref-spacing-xxs) var(--ref-spacing-xxs)}.ap-selection-dropdown__header.ap-selection-dropdown__header--select-all ap-input-search{padding-bottom:0}.ap-selection-dropdown__header .ap-selection-dropdown__select-all{display:flex;align-items:center;height:var(--comp-select-one-line-height);padding:0 var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__select-all ap-checkbox{--comp-forms-label-font-weight: var(--ref-font-weight-bold)}.ap-selection-dropdown__items{padding:var(--ref-spacing-xxs) 0;flex:1;overflow-y:auto;min-height:0}.ap-selection-dropdown__no-results{padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);color:var(--ref-color-grey-80);font-size:var(--ref-font-size-sm);font-style:italic}.ap-selection-dropdown__footer{height:40px;padding:var(--ref-spacing-xs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;align-items:center;justify-content:flex-start}.ap-selection-dropdown__selected-section{margin-bottom:var(--ref-spacing-xxs);border-bottom:1px solid var(--ref-color-grey-10);padding-bottom:var(--ref-spacing-xxs)}.ap-selection-dropdown__selected-section ::ng-deep ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\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"] }, { kind: "directive", type: DropdownContentDirective, selector: "ng-template[apDropdownContent]" }, { kind: "directive", type: DropdownOptionDirective, selector: "[apDropdownOption]", inputs: ["apDropdownOption", "apDropdownOptionDisabled"] }, { kind: "component", type: 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: DropdownItemSingleOneLineComponent, selector: "ap-dropdown-item-single-one-line", inputs: ["text", "selected", "disabled", "avatarUrl", "showAvatarInitials", "symbolId", "disabledTooltip", "badgeText", "dividerEnabled", "network", "roundedAvatar", "isFeatureLocked", "standaloneModeEnabled"], outputs: ["lockedFeatureClicked"] }, { kind: "component", type: DropdownPanelComponent, selector: "ap-dropdown-panel", inputs: ["placement", "showBackdrop", "panelClass", "canDismiss"], outputs: ["opened", "closed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputSearchComponent, selector: "ap-input-search", inputs: ["id", "placeholder", "clearable", "ariaControls", "ariaActiveDescendant"], outputs: ["focus", "blur", "keyup"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipArrow", "apTooltipAnchor", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
581
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SelectionDropdownComponent, isStandalone: true, selector: "ap-selection-dropdown", inputs: { i18n: { classPropertyName: "i18n", publicName: "i18n", isSignal: true, isRequired: false, transformFunction: null }, headerButtonId: { classPropertyName: "headerButtonId", publicName: "headerButtonId", isSignal: true, isRequired: false, transformFunction: null }, footerButtonId: { classPropertyName: "footerButtonId", publicName: "footerButtonId", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, searchEnabled: { classPropertyName: "searchEnabled", publicName: "searchEnabled", isSignal: true, isRequired: false, transformFunction: null }, footerButtonSymbolId: { classPropertyName: "footerButtonSymbolId", publicName: "footerButtonSymbolId", isSignal: true, isRequired: false, transformFunction: null }, headerButtonSymbolId: { classPropertyName: "headerButtonSymbolId", publicName: "headerButtonSymbolId", isSignal: true, isRequired: false, transformFunction: null }, selectAllEnabled: { classPropertyName: "selectAllEnabled", publicName: "selectAllEnabled", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed", selectionChange: "selectionChange", footerButtonClick: "footerButtonClick", headerButtonClick: "headerButtonClick", searchInputChange: "searchInputChange", searchTerm: "searchTermChange" }, queries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: DropdownPanelComponent, descendants: true, isSignal: true }, { propertyName: "options", predicate: DropdownOptionDirective, descendants: true, isSignal: true }, { propertyName: "inputSearchComponent", first: true, predicate: ["inputSearchElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- `dialog`, not a combobox: a combobox must close when focus leaves it, and this panel holds a\n search field, a header, a footer and group checkboxes beside its lists \u2014 closing on Tab left\n every one of them unreachable. -->\n <div\n *apDropdownContent\n class=\"ap-selection-dropdown__content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-label]=\"panelLabel()\"\n (keydown)=\"onOptionsKeyDown($event)\"\n [class.ap-selection-dropdown__content--single]=\"isSingleSelect()\"\n [style.width]=\"panelWidth()\">\n <!-- Header -->\n @if (headerVisible()) {\n <div\n class=\"ap-selection-dropdown__header\"\n [class.ap-selection-dropdown__header--select-all]=\"selectAllVisible()\">\n @if (headerTopVisible()) {\n <div class=\"ap-selection-dropdown__header-top\">\n @if (texts().title) {\n <h3 class=\"ap-selection-dropdown__title\">\n {{ texts().title }}\n </h3>\n }\n @if (texts().headerButton) {\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"headerButtonId()\"\n (click)=\"onHeaderButtonClick()\">\n <ap-symbol [symbolId]=\"headerButtonSymbolId()\" />\n {{ texts().headerButton }}\n </button>\n }\n </div>\n }\n @if (searchVisible()) {\n <ap-input-search\n #inputSearchElement\n [placeholder]=\"texts().searchPlaceholder\"\n [clearable]=\"true\"\n [ariaControls]=\"listboxId\"\n [ariaActiveDescendant]=\"activeDescendantId()\"\n [ngModel]=\"searchTerm()\"\n (blur)=\"onSearchBlur()\"\n (ngModelChange)=\"onSearchTermChange($event)\" />\n }\n @if (selectAllVisible()) {\n <div class=\"ap-selection-dropdown__select-all\">\n <ap-checkbox\n class=\"centered\"\n name=\"ap-selection-dropdown-select-all\"\n [checked]=\"selectAllState() === 'selected'\"\n [indeterminate]=\"selectAllState() === 'partial'\"\n (change)=\"onSelectAllToggle($event)\">\n {{ selectAllLabel() }}\n </ap-checkbox>\n </div>\n }\n </div>\n }\n\n <!-- Selection dropdown items -->\n <div\n class=\"ap-selection-dropdown__items\"\n [id]=\"listboxId\"\n [attr.role]=\"isSingleSelect() ? 'listbox' : null\"\n [attr.aria-label]=\"isSingleSelect() ? (texts().title ?? null) : null\">\n @if (filteredItems().length === 0 && searchTerm()) {\n <div class=\"ap-selection-dropdown__no-results\">\n {{ texts().noResults }}\n </div>\n } @else if (isSingleSelect()) {\n <!-- One listbox: a group holds only options and its presentational header (WAI-ARIA APG grouped listbox). -->\n @for (entry of singleEntries(); track entry.kind === 'group' ? 'group:' + entry.label : entry.item.htmlId) {\n @if (entry.kind === 'group') {\n <div\n role=\"group\"\n class=\"ap-selection-dropdown__group\"\n [attr.aria-labelledby]=\"groupHeaderId($index)\">\n <div\n role=\"presentation\"\n class=\"ap-selection-dropdown__group-title\"\n [id]=\"groupHeaderId($index)\">\n {{ entry.label }}\n </div>\n @for (item of entry.items; track item.htmlId) {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: item }\" />\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: entry.item }\" />\n }\n }\n\n <ng-template\n #singleOption\n let-item>\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__option\"\n [id]=\"optionId(item)\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-disabled]=\"item.disabled || item.isFeatureLocked\"\n [attr.data-track]=\"item.dataTrack\"\n [apTooltip]=\"item.disabled ? (textsOf(item).disabledTooltip ?? null) : null\"\n apTooltipPosition=\"right\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-single-one-line\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [standaloneModeEnabled]=\"true\" />\n </button>\n </ng-template>\n } @else {\n <!-- A listbox owns only options, so each section is its own, and a group's checkbox sits beside it. -->\n @if (selectedItems().length > 0) {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n class=\"ap-selection-dropdown__selected-section\"\n [attr.aria-label]=\"texts().selectedSection\">\n @for (item of selectedItems(); track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n }\n\n <!-- Unselected zone: items & groups in first-encounter order -->\n @for (run of displayRuns(); track runKey(run)) {\n @if (run.kind === 'items') {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"texts().title ?? texts().optionsSection\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n } @else {\n <div class=\"ap-selection-dropdown__group\">\n <!-- Group header with checkbox -->\n <div class=\"ap-selection-dropdown__group-header\">\n <div class=\"ap-selection-dropdown__group-label\">\n <ap-checkbox\n class=\"centered\"\n [name]=\"run.label\"\n [checked]=\"groupSelectionStates()[run.label] === 'selected'\"\n [indeterminate]=\"groupSelectionStates()[run.label] === 'partial'\"\n (change)=\"onGroupToggle(run.label, $event)\">\n {{ run.label }}\n </ap-checkbox>\n </div>\n </div>\n\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"run.label\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = true;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n </div>\n }\n }\n }\n </div>\n\n <div\n class=\"ap-selection-dropdown__status\"\n role=\"status\"\n aria-atomic=\"true\">\n {{ resultsAnnouncement() }}\n </div>\n\n <!-- Footer -->\n @if (texts().footerButton) {\n <div class=\"ap-selection-dropdown__footer\">\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"footerButtonId()\"\n (click)=\"onFooterButtonClick()\">\n <ap-symbol [symbolId]=\"footerButtonSymbolId()\" />\n {{ texts().footerButton }}\n </button>\n </div>\n }\n </div>\n</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-selection-dropdown__content{border-radius:inherit;overflow:hidden;z-index:1000;width:370px;display:flex;flex-direction:column;max-height:min(400px,var(--ap-floating-available-height, 100vh))}.ap-selection-dropdown__content--single{width:auto;min-width:160px}.ap-selection-dropdown__option{display:block;width:100%;padding:0;border:none;background:none;font:inherit;text-align:inherit}.ap-selection-dropdown__item-button{display:block;width:100%;padding:0;margin:0;border:none;background:transparent;text-align:left;cursor:pointer;outline:none}.ap-selection-dropdown__item-button:hover,.ap-selection-dropdown__item-button.ap-dropdown-option--active{background-color:var(--ref-color-electric-blue-10)}.ap-selection-dropdown__item-button:active{background-color:var(--ref-color-electric-blue-20)}.ap-selection-dropdown__item-button:focus{outline:none}.ap-selection-dropdown__item-button:focus-visible{outline:none}.ap-selection-dropdown__item-button.ap-selection-dropdown__item-button--disabled{pointer-events:none}.ap-selection-dropdown__item{display:flex;align-items:center;width:100%;min-height:40px;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);background:transparent;cursor:pointer;font-family:Averta}.ap-selection-dropdown__group-header{display:flex;align-items:center;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);background:var(--ref-color-grey-bg)}.ap-selection-dropdown__group-title{padding:var(--comp-select-group-padding-vertical) var(--ref-spacing-sm);border-top:1px solid var(--comp-select-group-border-top-color);background:var(--comp-select-group-background-color);font-family:var(--comp-select-group-text-font-family);font-size:var(--comp-select-group-text-size);font-weight:var(--comp-select-group-text-font-weight);line-height:var(--comp-select-group-text-line-height);color:var(--comp-select-group-text-color)}.ap-selection-dropdown__group-label{display:flex;align-items:center;flex:1;font-weight:700;color:var(--ref-color-grey-100)}.ap-selection-dropdown__group-label ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__header{border-bottom:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;flex-direction:column}.ap-selection-dropdown__header .ap-selection-dropdown__header-top{display:flex;align-items:center;justify-content:space-between;padding:var(--ref-spacing-xs) var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__title{margin:0;font-size:var(--ref-font-size-md);font-weight:var(--ref-font-weight-bold);color:var(--ref-color-grey-100);flex:1}.ap-selection-dropdown__header ap-input-search{width:100%;padding:0 var(--ref-spacing-xxs) var(--ref-spacing-xxs)}.ap-selection-dropdown__header.ap-selection-dropdown__header--select-all ap-input-search{padding-bottom:0}.ap-selection-dropdown__header .ap-selection-dropdown__select-all{display:flex;align-items:center;height:var(--comp-select-one-line-height);padding:0 var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__select-all ap-checkbox{--comp-forms-label-font-weight: var(--ref-font-weight-bold)}.ap-selection-dropdown__items{padding:var(--ref-spacing-xxs) 0;flex:1;overflow-y:auto;min-height:0}.ap-selection-dropdown__no-results{padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);color:var(--ref-color-grey-80);font-size:var(--ref-font-size-sm);font-style:italic}.ap-selection-dropdown__footer{height:40px;padding:var(--ref-spacing-xs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;align-items:center;justify-content:flex-start}.ap-selection-dropdown__selected-section{margin-bottom:var(--ref-spacing-xxs);border-bottom:1px solid var(--ref-color-grey-10);padding-bottom:var(--ref-spacing-xxs)}.ap-selection-dropdown__selected-section ::ng-deep ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\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"] }, { kind: "directive", type: DropdownContentDirective, selector: "ng-template[apDropdownContent]" }, { kind: "directive", type: DropdownOptionDirective, selector: "[apDropdownOption]", inputs: ["apDropdownOption", "apDropdownOptionDisabled"] }, { kind: "component", type: 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: DropdownItemSingleOneLineComponent, selector: "ap-dropdown-item-single-one-line", inputs: ["text", "selected", "disabled", "avatarUrl", "showAvatarInitials", "symbolId", "disabledTooltip", "badgeText", "dividerEnabled", "network", "roundedAvatar", "isFeatureLocked", "standaloneModeEnabled"], outputs: ["lockedFeatureClicked"] }, { kind: "component", type: DropdownPanelComponent, selector: "ap-dropdown-panel", inputs: ["placement", "showBackdrop", "panelClass", "canDismiss"], outputs: ["opened", "closed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputSearchComponent, selector: "ap-input-search", inputs: ["id", "placeholder", "clearable", "ariaControls", "ariaActiveDescendant"], outputs: ["focus", "blur", "keyup"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipArrow", "apTooltipAnchor", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
573
582
|
}
|
|
574
583
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectionDropdownComponent, decorators: [{
|
|
575
584
|
type: Component,
|
|
@@ -585,8 +594,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
585
594
|
InputSearchComponent,
|
|
586
595
|
SymbolComponent,
|
|
587
596
|
TooltipDirective,
|
|
588
|
-
], template: "<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- `dialog`, not a combobox: a combobox must close when focus leaves it, and this panel holds a\n search field, a header, a footer and group checkboxes beside its lists \u2014 closing on Tab left\n every one of them unreachable. -->\n <div\n *apDropdownContent\n class=\"ap-selection-dropdown__content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-label]=\"panelLabel()\"\n (keydown)=\"onOptionsKeyDown($event)\"\n [class.ap-selection-dropdown__content--single]=\"isSingleSelect()\"\n [style.width]=\"panelWidth()\">\n <!-- Header -->\n @if (headerVisible()) {\n <div\n class=\"ap-selection-dropdown__header\"\n [class.ap-selection-dropdown__header--select-all]=\"selectAllVisible()\">\n @if (headerTopVisible()) {\n <div class=\"ap-selection-dropdown__header-top\">\n @if (title()) {\n <h3 class=\"ap-selection-dropdown__title\">\n {{ title() }}\n </h3>\n }\n @if (headerButtonText()) {\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"headerButtonId()\"\n (click)=\"onHeaderButtonClick()\">\n <ap-symbol [symbolId]=\"headerButtonSymbolId()\" />\n {{ headerButtonText() }}\n </button>\n }\n </div>\n }\n @if (searchVisible()) {\n <ap-input-search\n #inputSearchElement\n [placeholder]=\"searchPlaceholderText()\"\n [clearable]=\"true\"\n [ariaControls]=\"listboxId\"\n [ariaActiveDescendant]=\"activeDescendantId()\"\n [ngModel]=\"searchTerm()\"\n (blur)=\"onSearchBlur()\"\n (ngModelChange)=\"onSearchTermChange($event)\" />\n }\n @if (selectAllVisible()) {\n <div class=\"ap-selection-dropdown__select-all\">\n <ap-checkbox\n class=\"centered\"\n name=\"ap-selection-dropdown-select-all\"\n [checked]=\"selectAllState() === 'selected'\"\n [indeterminate]=\"selectAllState() === 'partial'\"\n (change)=\"onSelectAllToggle($event)\">\n {{ selectAllLabel() }}\n </ap-checkbox>\n </div>\n }\n </div>\n }\n\n <!-- Selection dropdown items -->\n <div\n class=\"ap-selection-dropdown__items\"\n [id]=\"listboxId\"\n [attr.role]=\"isSingleSelect() ? 'listbox' : null\"\n [attr.aria-label]=\"isSingleSelect() ? (title() ?? null) : null\">\n @if (filteredItems().length === 0 && searchTerm()) {\n <div class=\"ap-selection-dropdown__no-results\">\n {{ noSearchResultsText() }}\n </div>\n } @else if (isSingleSelect()) {\n <!-- One listbox: a group holds only options and its presentational header (WAI-ARIA APG grouped listbox). -->\n @for (entry of singleEntries(); track entry.kind === 'group' ? 'group:' + entry.label : entry.item.htmlId) {\n @if (entry.kind === 'group') {\n <div\n role=\"group\"\n class=\"ap-selection-dropdown__group\"\n [attr.aria-labelledby]=\"groupHeaderId($index)\">\n <div\n role=\"presentation\"\n class=\"ap-selection-dropdown__group-title\"\n [id]=\"groupHeaderId($index)\">\n {{ entry.label }}\n </div>\n @for (item of entry.items; track item.htmlId) {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: item }\" />\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: entry.item }\" />\n }\n }\n\n <ng-template\n #singleOption\n let-item>\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__option\"\n [id]=\"optionId(item)\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-disabled]=\"item.disabled || item.isFeatureLocked\"\n [attr.data-track]=\"item.dataTrack\"\n [apTooltip]=\"item.disabled ? (item.disabledTooltip ?? null) : null\"\n apTooltipPosition=\"right\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-single-one-line\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [standaloneModeEnabled]=\"true\" />\n </button>\n </ng-template>\n } @else {\n <!-- A listbox owns only options, so each section is its own, and a group's checkbox sits beside it. -->\n @if (selectedItems().length > 0) {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n class=\"ap-selection-dropdown__selected-section\"\n [attr.aria-label]=\"selectedSectionText()\">\n @for (item of selectedItems(); track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n }\n\n <!-- Unselected zone: items & groups in first-encounter order -->\n @for (run of displayRuns(); track runKey(run)) {\n @if (run.kind === 'items') {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"title() ?? optionsSectionText()\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n } @else {\n <div class=\"ap-selection-dropdown__group\">\n <!-- Group header with checkbox -->\n <div class=\"ap-selection-dropdown__group-header\">\n <div class=\"ap-selection-dropdown__group-label\">\n <ap-checkbox\n class=\"centered\"\n [name]=\"run.label\"\n [checked]=\"groupSelectionStates()[run.label] === 'selected'\"\n [indeterminate]=\"groupSelectionStates()[run.label] === 'partial'\"\n (change)=\"onGroupToggle(run.label, $event)\">\n {{ run.label }}\n </ap-checkbox>\n </div>\n </div>\n\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"run.label\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = true;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n </div>\n }\n }\n }\n </div>\n\n <div\n class=\"ap-selection-dropdown__status\"\n role=\"status\"\n aria-atomic=\"true\">\n {{ resultsAnnouncement() }}\n </div>\n\n <!-- Footer -->\n @if (footerButtonText()) {\n <div class=\"ap-selection-dropdown__footer\">\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"footerButtonId()\"\n (click)=\"onFooterButtonClick()\">\n <ap-symbol [symbolId]=\"footerButtonSymbolId()\" />\n {{ footerButtonText() }}\n </button>\n </div>\n }\n </div>\n</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-selection-dropdown__content{border-radius:inherit;overflow:hidden;z-index:1000;width:370px;display:flex;flex-direction:column;max-height:min(400px,var(--ap-floating-available-height, 100vh))}.ap-selection-dropdown__content--single{width:auto;min-width:160px}.ap-selection-dropdown__option{display:block;width:100%;padding:0;border:none;background:none;font:inherit;text-align:inherit}.ap-selection-dropdown__item-button{display:block;width:100%;padding:0;margin:0;border:none;background:transparent;text-align:left;cursor:pointer;outline:none}.ap-selection-dropdown__item-button:hover,.ap-selection-dropdown__item-button.ap-dropdown-option--active{background-color:var(--ref-color-electric-blue-10)}.ap-selection-dropdown__item-button:active{background-color:var(--ref-color-electric-blue-20)}.ap-selection-dropdown__item-button:focus{outline:none}.ap-selection-dropdown__item-button:focus-visible{outline:none}.ap-selection-dropdown__item-button.ap-selection-dropdown__item-button--disabled{pointer-events:none}.ap-selection-dropdown__item{display:flex;align-items:center;width:100%;min-height:40px;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);background:transparent;cursor:pointer;font-family:Averta}.ap-selection-dropdown__group-header{display:flex;align-items:center;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);background:var(--ref-color-grey-bg)}.ap-selection-dropdown__group-title{padding:var(--comp-select-group-padding-vertical) var(--ref-spacing-sm);border-top:1px solid var(--comp-select-group-border-top-color);background:var(--comp-select-group-background-color);font-family:var(--comp-select-group-text-font-family);font-size:var(--comp-select-group-text-size);font-weight:var(--comp-select-group-text-font-weight);line-height:var(--comp-select-group-text-line-height);color:var(--comp-select-group-text-color)}.ap-selection-dropdown__group-label{display:flex;align-items:center;flex:1;font-weight:700;color:var(--ref-color-grey-100)}.ap-selection-dropdown__group-label ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__header{border-bottom:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;flex-direction:column}.ap-selection-dropdown__header .ap-selection-dropdown__header-top{display:flex;align-items:center;justify-content:space-between;padding:var(--ref-spacing-xs) var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__title{margin:0;font-size:var(--ref-font-size-md);font-weight:var(--ref-font-weight-bold);color:var(--ref-color-grey-100);flex:1}.ap-selection-dropdown__header ap-input-search{width:100%;padding:0 var(--ref-spacing-xxs) var(--ref-spacing-xxs)}.ap-selection-dropdown__header.ap-selection-dropdown__header--select-all ap-input-search{padding-bottom:0}.ap-selection-dropdown__header .ap-selection-dropdown__select-all{display:flex;align-items:center;height:var(--comp-select-one-line-height);padding:0 var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__select-all ap-checkbox{--comp-forms-label-font-weight: var(--ref-font-weight-bold)}.ap-selection-dropdown__items{padding:var(--ref-spacing-xxs) 0;flex:1;overflow-y:auto;min-height:0}.ap-selection-dropdown__no-results{padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);color:var(--ref-color-grey-80);font-size:var(--ref-font-size-sm);font-style:italic}.ap-selection-dropdown__footer{height:40px;padding:var(--ref-spacing-xs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;align-items:center;justify-content:flex-start}.ap-selection-dropdown__selected-section{margin-bottom:var(--ref-spacing-xxs);border-bottom:1px solid var(--ref-color-grey-10);padding-bottom:var(--ref-spacing-xxs)}.ap-selection-dropdown__selected-section ::ng-deep ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\n"] }]
|
|
589
|
-
}], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DropdownPanelComponent), { isSignal: true }] }], options: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => DropdownOptionDirective), { isSignal: true }] }],
|
|
597
|
+
], template: "<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- `dialog`, not a combobox: a combobox must close when focus leaves it, and this panel holds a\n search field, a header, a footer and group checkboxes beside its lists \u2014 closing on Tab left\n every one of them unreachable. -->\n <div\n *apDropdownContent\n class=\"ap-selection-dropdown__content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-label]=\"panelLabel()\"\n (keydown)=\"onOptionsKeyDown($event)\"\n [class.ap-selection-dropdown__content--single]=\"isSingleSelect()\"\n [style.width]=\"panelWidth()\">\n <!-- Header -->\n @if (headerVisible()) {\n <div\n class=\"ap-selection-dropdown__header\"\n [class.ap-selection-dropdown__header--select-all]=\"selectAllVisible()\">\n @if (headerTopVisible()) {\n <div class=\"ap-selection-dropdown__header-top\">\n @if (texts().title) {\n <h3 class=\"ap-selection-dropdown__title\">\n {{ texts().title }}\n </h3>\n }\n @if (texts().headerButton) {\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"headerButtonId()\"\n (click)=\"onHeaderButtonClick()\">\n <ap-symbol [symbolId]=\"headerButtonSymbolId()\" />\n {{ texts().headerButton }}\n </button>\n }\n </div>\n }\n @if (searchVisible()) {\n <ap-input-search\n #inputSearchElement\n [placeholder]=\"texts().searchPlaceholder\"\n [clearable]=\"true\"\n [ariaControls]=\"listboxId\"\n [ariaActiveDescendant]=\"activeDescendantId()\"\n [ngModel]=\"searchTerm()\"\n (blur)=\"onSearchBlur()\"\n (ngModelChange)=\"onSearchTermChange($event)\" />\n }\n @if (selectAllVisible()) {\n <div class=\"ap-selection-dropdown__select-all\">\n <ap-checkbox\n class=\"centered\"\n name=\"ap-selection-dropdown-select-all\"\n [checked]=\"selectAllState() === 'selected'\"\n [indeterminate]=\"selectAllState() === 'partial'\"\n (change)=\"onSelectAllToggle($event)\">\n {{ selectAllLabel() }}\n </ap-checkbox>\n </div>\n }\n </div>\n }\n\n <!-- Selection dropdown items -->\n <div\n class=\"ap-selection-dropdown__items\"\n [id]=\"listboxId\"\n [attr.role]=\"isSingleSelect() ? 'listbox' : null\"\n [attr.aria-label]=\"isSingleSelect() ? (texts().title ?? null) : null\">\n @if (filteredItems().length === 0 && searchTerm()) {\n <div class=\"ap-selection-dropdown__no-results\">\n {{ texts().noResults }}\n </div>\n } @else if (isSingleSelect()) {\n <!-- One listbox: a group holds only options and its presentational header (WAI-ARIA APG grouped listbox). -->\n @for (entry of singleEntries(); track entry.kind === 'group' ? 'group:' + entry.label : entry.item.htmlId) {\n @if (entry.kind === 'group') {\n <div\n role=\"group\"\n class=\"ap-selection-dropdown__group\"\n [attr.aria-labelledby]=\"groupHeaderId($index)\">\n <div\n role=\"presentation\"\n class=\"ap-selection-dropdown__group-title\"\n [id]=\"groupHeaderId($index)\">\n {{ entry.label }}\n </div>\n @for (item of entry.items; track item.htmlId) {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: item }\" />\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: entry.item }\" />\n }\n }\n\n <ng-template\n #singleOption\n let-item>\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__option\"\n [id]=\"optionId(item)\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-disabled]=\"item.disabled || item.isFeatureLocked\"\n [attr.data-track]=\"item.dataTrack\"\n [apTooltip]=\"item.disabled ? (textsOf(item).disabledTooltip ?? null) : null\"\n apTooltipPosition=\"right\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-single-one-line\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [standaloneModeEnabled]=\"true\" />\n </button>\n </ng-template>\n } @else {\n <!-- A listbox owns only options, so each section is its own, and a group's checkbox sits beside it. -->\n @if (selectedItems().length > 0) {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n class=\"ap-selection-dropdown__selected-section\"\n [attr.aria-label]=\"texts().selectedSection\">\n @for (item of selectedItems(); track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n }\n\n <!-- Unselected zone: items & groups in first-encounter order -->\n @for (run of displayRuns(); track runKey(run)) {\n @if (run.kind === 'items') {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"texts().title ?? texts().optionsSection\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n } @else {\n <div class=\"ap-selection-dropdown__group\">\n <!-- Group header with checkbox -->\n <div class=\"ap-selection-dropdown__group-header\">\n <div class=\"ap-selection-dropdown__group-label\">\n <ap-checkbox\n class=\"centered\"\n [name]=\"run.label\"\n [checked]=\"groupSelectionStates()[run.label] === 'selected'\"\n [indeterminate]=\"groupSelectionStates()[run.label] === 'partial'\"\n (change)=\"onGroupToggle(run.label, $event)\">\n {{ run.label }}\n </ap-checkbox>\n </div>\n </div>\n\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"run.label\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = true;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n </div>\n }\n }\n }\n </div>\n\n <div\n class=\"ap-selection-dropdown__status\"\n role=\"status\"\n aria-atomic=\"true\">\n {{ resultsAnnouncement() }}\n </div>\n\n <!-- Footer -->\n @if (texts().footerButton) {\n <div class=\"ap-selection-dropdown__footer\">\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"footerButtonId()\"\n (click)=\"onFooterButtonClick()\">\n <ap-symbol [symbolId]=\"footerButtonSymbolId()\" />\n {{ texts().footerButton }}\n </button>\n </div>\n }\n </div>\n</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-selection-dropdown__content{border-radius:inherit;overflow:hidden;z-index:1000;width:370px;display:flex;flex-direction:column;max-height:min(400px,var(--ap-floating-available-height, 100vh))}.ap-selection-dropdown__content--single{width:auto;min-width:160px}.ap-selection-dropdown__option{display:block;width:100%;padding:0;border:none;background:none;font:inherit;text-align:inherit}.ap-selection-dropdown__item-button{display:block;width:100%;padding:0;margin:0;border:none;background:transparent;text-align:left;cursor:pointer;outline:none}.ap-selection-dropdown__item-button:hover,.ap-selection-dropdown__item-button.ap-dropdown-option--active{background-color:var(--ref-color-electric-blue-10)}.ap-selection-dropdown__item-button:active{background-color:var(--ref-color-electric-blue-20)}.ap-selection-dropdown__item-button:focus{outline:none}.ap-selection-dropdown__item-button:focus-visible{outline:none}.ap-selection-dropdown__item-button.ap-selection-dropdown__item-button--disabled{pointer-events:none}.ap-selection-dropdown__item{display:flex;align-items:center;width:100%;min-height:40px;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);background:transparent;cursor:pointer;font-family:Averta}.ap-selection-dropdown__group-header{display:flex;align-items:center;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);background:var(--ref-color-grey-bg)}.ap-selection-dropdown__group-title{padding:var(--comp-select-group-padding-vertical) var(--ref-spacing-sm);border-top:1px solid var(--comp-select-group-border-top-color);background:var(--comp-select-group-background-color);font-family:var(--comp-select-group-text-font-family);font-size:var(--comp-select-group-text-size);font-weight:var(--comp-select-group-text-font-weight);line-height:var(--comp-select-group-text-line-height);color:var(--comp-select-group-text-color)}.ap-selection-dropdown__group-label{display:flex;align-items:center;flex:1;font-weight:700;color:var(--ref-color-grey-100)}.ap-selection-dropdown__group-label ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__header{border-bottom:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;flex-direction:column}.ap-selection-dropdown__header .ap-selection-dropdown__header-top{display:flex;align-items:center;justify-content:space-between;padding:var(--ref-spacing-xs) var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__title{margin:0;font-size:var(--ref-font-size-md);font-weight:var(--ref-font-weight-bold);color:var(--ref-color-grey-100);flex:1}.ap-selection-dropdown__header ap-input-search{width:100%;padding:0 var(--ref-spacing-xxs) var(--ref-spacing-xxs)}.ap-selection-dropdown__header.ap-selection-dropdown__header--select-all ap-input-search{padding-bottom:0}.ap-selection-dropdown__header .ap-selection-dropdown__select-all{display:flex;align-items:center;height:var(--comp-select-one-line-height);padding:0 var(--ref-spacing-sm)}.ap-selection-dropdown__header .ap-selection-dropdown__select-all ap-checkbox{--comp-forms-label-font-weight: var(--ref-font-weight-bold)}.ap-selection-dropdown__items{padding:var(--ref-spacing-xxs) 0;flex:1;overflow-y:auto;min-height:0}.ap-selection-dropdown__no-results{padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);color:var(--ref-color-grey-80);font-size:var(--ref-font-size-sm);font-style:italic}.ap-selection-dropdown__footer{height:40px;padding:var(--ref-spacing-xs) var(--ref-spacing-sm);border-top:1px solid var(--ref-color-grey-10);flex-shrink:0;display:flex;align-items:center;justify-content:flex-start}.ap-selection-dropdown__selected-section{margin-bottom:var(--ref-spacing-xxs);border-bottom:1px solid var(--ref-color-grey-10);padding-bottom:var(--ref-spacing-xxs)}.ap-selection-dropdown__selected-section ::ng-deep ap-checkbox{--comp-forms-label-font-weight: 700}.ap-selection-dropdown__status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\n"] }]
|
|
598
|
+
}], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DropdownPanelComponent), { isSignal: true }] }], options: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => DropdownOptionDirective), { isSignal: true }] }], i18n: [{ type: i0.Input, args: [{ isSignal: true, alias: "i18n", required: false }] }], trigger: [{ type: i0.ContentChild, args: ['trigger', { isSignal: true }] }], headerButtonId: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerButtonId", required: false }] }], footerButtonId: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtonId", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], searchEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchEnabled", required: false }] }], footerButtonSymbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtonSymbolId", required: false }] }], headerButtonSymbolId: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerButtonSymbolId", required: false }] }], selectAllEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllEnabled", required: false }] }], showBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBackdrop", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], footerButtonClick: [{ type: i0.Output, args: ["footerButtonClick"] }], headerButtonClick: [{ type: i0.Output, args: ["headerButtonClick"] }], searchInputChange: [{ type: i0.Output, args: ["searchInputChange"] }], searchTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchTerm", required: false }] }, { type: i0.Output, args: ["searchTermChange"] }], inputSearchComponent: [{ type: i0.ViewChild, args: ['inputSearchElement', { isSignal: true }] }] } });
|
|
590
599
|
|
|
591
600
|
/**
|
|
592
601
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-selection-dropdown.mjs","sources":["../../../libs/ui-components/selection-dropdown/src/selection-dropdown-trigger.directive.ts","../../../libs/ui-components/selection-dropdown/src/selection-dropdown.component.ts","../../../libs/ui-components/selection-dropdown/src/selection-dropdown.component.html","../../../libs/ui-components/selection-dropdown/src/agorapulse-ui-components-selection-dropdown.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, inject, input } from '@angular/core';\nimport { SelectionDropdownComponent } from './selection-dropdown.component';\n\n/**\n * Directive that turns any element into a trigger for a SelectionDropdown component.\n * Handles click and keyboard interactions to open/close the dropdown.\n */\n@Directive({\n selector: '[apSelectionDropdownTrigger]',\n})\nexport class SelectionDropdownTriggerDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Reference to the SelectionDropdown component that this trigger controls */\n apSelectionDropdownTrigger = input.required<SelectionDropdownComponent>();\n\n /** Prevents the trigger from opening/toggling the dropdown when true */\n apSelectionDropdownTriggerDisable = input(false);\n\n /** Handles click events to toggle the dropdown */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n if (this.apSelectionDropdownTriggerDisable()) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n this.apSelectionDropdownTrigger().toggle(this.elementRef.nativeElement);\n }\n\n /** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent): void {\n const dropdown = this.apSelectionDropdownTrigger();\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n if (this.apSelectionDropdownTriggerDisable()) return;\n event.preventDefault();\n dropdown.open(this.elementRef.nativeElement);\n break;\n\n case 'Escape':\n event.preventDefault();\n dropdown.close();\n break;\n }\n }\n}\n","import { CheckboxComponent } from '@agorapulse/ui-components/checkbox';\nimport { DropdownOptionDirective, DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';\nimport { DropdownContentDirective, DropdownPanelComponent } from '@agorapulse/ui-components/dropdown-panel';\nimport { FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { InputSearchComponent } from '@agorapulse/ui-components/input-search';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { DropdownItemMultipleOneLineComponent, DropdownItemSingleOneLineComponent } from '@agorapulse/ui-components/select';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apCheck, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ActiveDescendantKeyManager, FocusKeyManager, ListKeyManager } from '@angular/cdk/a11y';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n Injector,\n input,\n linkedSignal,\n model,\n OnDestroy,\n output,\n signal,\n TemplateRef,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { debounceTime, distinctUntilChanged, Subject, takeUntil } from 'rxjs';\n\n/** The only keys a search field hands to the list: Home and End belong to the caret, not the options. */\nconst NAVIGATION_FROM_SEARCH = new Set(['ArrowUp', 'ArrowDown']);\n\nexport interface SelectionDropdownItem {\n /** Unique HTML ID for the item */\n htmlId: string;\n /** Display text for the item */\n text: string;\n /** Whether the item is selected */\n selected: boolean;\n /** Whether the item is displayed in a mixed/indeterminate state. Takes visual precedence over `selected`. */\n indeterminate?: boolean;\n /** Whether the item is disabled and non-interactive */\n disabled?: boolean;\n /** Avatar URL to display */\n avatarUrl?: string;\n /** Symbol ID to display */\n symbolId?: string;\n /** Tooltip text displayed when item is disabled */\n disabledTooltip?: string;\n /** Text displayed in a badge next to the item */\n badgeText?: string;\n /** Whether the feature is locked */\n isFeatureLocked?: boolean;\n /** Whether avatar should be rounded */\n roundedAvatar?: boolean;\n /** Avatar network type */\n network?: any;\n /** Symbol color */\n symbolColor?: string;\n /** Symbol tooltip text */\n symbolTooltipText?: string;\n /** Group label - items with the same groupLabel will be grouped together */\n groupLabel?: string;\n dataTrack?: string;\n}\n\n/**\n * One rendered row in the unselected zone: either a standalone item or a group\n * holding the items that belong to it (in first-encounter order).\n */\ntype RenderEntry = { kind: 'item'; item: SelectionDropdownItem } | { kind: 'group'; label: string; items: SelectionDropdownItem[] };\n\n/** A run of consecutive ungrouped items, or a group. Each becomes one listbox of its own. */\ntype RenderRun = { kind: 'items'; items: SelectionDropdownItem[] } | Extract<RenderEntry, { kind: 'group' }>;\n\nexport type SelectionDropdownMode = 'multiple' | 'single';\n\n/**\n * Rebuilds items into one ordered list: standalone items and groups appear in the order their first\n * item is encountered; later items of an already-seen group join that existing group entry.\n */\nfunction inEncounterOrder(items: SelectionDropdownItem[]): RenderEntry[] {\n const entries: RenderEntry[] = [];\n const groupsByLabel = new Map<string, Extract<RenderEntry, { kind: 'group' }>>();\n\n for (const item of items) {\n const label = item.groupLabel;\n if (!label) {\n entries.push({ kind: 'item', item });\n continue;\n }\n\n const existing = groupsByLabel.get(label);\n if (existing) {\n // `existing` is the same object reference already pushed into `entries`,\n // so mutating its items array updates the rendered group in place.\n existing.items.push(item);\n } else {\n const group: Extract<RenderEntry, { kind: 'group' }> = { kind: 'group', label, items: [item] };\n groupsByLabel.set(label, group);\n entries.push(group);\n }\n }\n\n return entries;\n}\n\ntype SelectionState = 'selected' | 'partial' | 'unselected';\n\n/** A dropdown of options on any trigger. `multiple` = checkbox rows with search; `single` = rows, closes on pick. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-selection-dropdown',\n templateUrl: './selection-dropdown.component.html',\n styleUrls: ['./selection-dropdown.component.scss'],\n imports: [\n CheckboxComponent,\n DropdownContentDirective,\n DropdownOptionDirective,\n DropdownItemMultipleOneLineComponent,\n DropdownItemSingleOneLineComponent,\n DropdownPanelComponent,\n FormsModule,\n NgTemplateOutlet,\n InputSearchComponent,\n SymbolComponent,\n TooltipDirective,\n ],\n})\nexport class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {\n private static nextId = 0;\n\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly panel = viewChild(DropdownPanelComponent);\n private readonly options = viewChildren(DropdownOptionDirective);\n\n /** Mirrors the key manager's active index, so the roving tabindex can be bound. */\n protected readonly activeIndex = signal(-1);\n\n private readonly injector = inject(Injector);\n\n /** Names the dialog. Falls back to the visible title, then to a generic label rather than none. */\n readonly ariaLabel = input<string>();\n\n /** Names the listbox holding what is already selected. */\n readonly selectedSectionText = input('Selected');\n\n /** Names a listbox of ungrouped options when the dropdown has no title. */\n readonly optionsSectionText = input('Options');\n\n protected readonly panelLabel = computed(() => this.ariaLabel() ?? this.title() ?? 'Selection');\n\n protected readonly listboxId = `ap-selection-dropdown-list-${SelectionDropdownComponent.nextId++}`;\n\n private keyManager: ListKeyManager<DropdownOptionDirective> | null = null;\n private primed = false;\n\n trigger = contentChild<TemplateRef<unknown>>('trigger');\n\n /** ID for the header button */\n headerButtonId = input<string>();\n /** ID for the footer button */\n footerButtonId = input<string>();\n /** Array of items to display in the dropdown menu */\n items = input<SelectionDropdownItem[]>([]);\n /** Whether several options can be active at once, or exactly one. */\n selectionMode = input<SelectionDropdownMode>('multiple');\n /** Shows the search field. Ignored in `multiple` mode, which always searches. */\n searchEnabled = input(false);\n /** Title to display in the header */\n title = input<string>();\n /** Text for the footer button */\n footerButtonText = input<string>();\n /** Symbol ID for the footer button */\n footerButtonSymbolId = input<string>();\n /** Text for the header button */\n headerButtonText = input<string>();\n /** Symbol ID for the header button */\n headerButtonSymbolId = input<string>();\n /** Adds a \"Select all\" row above the options, acting on every visible option across groups. Multiple mode only. */\n selectAllEnabled = input(false);\n /** Label of the \"Select all\" row */\n selectAllText = input('Select all');\n /** Count after the \"Select all\" label. `{selected}` and `{total}` are replaced; empty hides it. */\n selectAllCountText = input('({selected} of {total})');\n /** Placeholder text for the search input */\n searchPlaceholderText = input('Search');\n /** Text to display when no search results are found */\n noSearchResultsText = input('No results found');\n\n /** Announced once a search settles. `{count}` is replaced by how many options matched. */\n searchResultsText = input('{count} results');\n\n /** Whether to show a backdrop that closes the dropdown when clicked */\n showBackdrop = input(true);\n /** Whether the dropdown is disabled and cannot be opened */\n disabled = input(false);\n /** Default position for the dropdown relative to the trigger element */\n /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n /** CSS width of the panel, e.g. `370px`. Unset, a single panel fits its content and a multiple one keeps its default width. */\n readonly panelWidth = input<string>();\n\n /** Emits when the dropdown menu is opened */\n opened = output<void>();\n /** Emits when the dropdown menu is closed */\n closed = output<void>();\n /** Emits when a dropdown item selection changes */\n selectionChange = output<SelectionDropdownItem[]>();\n /** Emits when the footer button is clicked */\n footerButtonClick = output<void>();\n /** Emits when the header button is clicked */\n headerButtonClick = output<void>();\n /** Emits when the search input is changed */\n searchInputChange = output<string>();\n\n /**\n * Two-way bindable, clearable search term. Consumers can read it and reset it (set to '')\n * to clear the search and restore the full item list — letting them drive the search\n * declaratively instead of reaching into the rendered `ap-input-search`.\n */\n readonly searchTerm = model<string>('');\n\n private readonly destroy$ = new Subject<void>();\n private readonly searchTermSubject = new Subject<string>();\n\n protected readonly inputSearchComponent = viewChild<InputSearchComponent>('inputSearchElement');\n\n readonly isOpen = computed(() => this.panel()?.isOpen() ?? false);\n\n focusInput = effect(() => {\n const inputSearch = this.inputSearchComponent();\n untracked(() => {\n if (this.isOpen() && inputSearch) {\n inputSearch.focusInput();\n }\n });\n });\n\n /** Single-select opens on its first option; multi does not, since marking one the user never chose announces a selection. */\n primeOptions = effect(() => {\n const open = this.isOpen();\n const options = this.options();\n untracked(() => {\n if (open && options.length > 0 && !this.primed && this.isSingleSelect()) {\n this.primed = true;\n this.activeManager().setFirstItemActive();\n }\n });\n });\n\n protected readonly isSingleSelect = computed(() => this.selectionMode() === 'single');\n\n /** Always true in `multiple` mode, leaving that layout untouched; only `single` collapses the header. */\n protected readonly searchVisible = computed(() => !this.isSingleSelect() || this.searchEnabled());\n protected readonly headerTopVisible = computed(() => !this.isSingleSelect() || !!this.title() || !!this.headerButtonText());\n protected readonly headerVisible = computed(() => this.headerTopVisible() || this.searchVisible());\n\n private readonly internalItems = linkedSignal(() => this.items());\n\n protected readonly filteredItems = signal<SelectionDropdownItem[]>([]);\n\n /** What the live region holds. Empty outside a search: the list is on screen, unchanged. */\n protected readonly resultsAnnouncement = signal('');\n protected readonly initiallySelectedItems = signal<SelectionDropdownItem[]>([]);\n\n // Computed properties for template usage\n protected readonly selectedItems = computed(() => {\n const initiallySelectedIds = this.initiallySelectedItems().map(item => item.htmlId);\n return this.filteredItems().filter(item => initiallySelectedIds.includes(item.htmlId));\n });\n\n protected readonly unselectedItems = computed(() => {\n const initiallySelectedIds = this.initiallySelectedItems().map(item => item.htmlId);\n return this.filteredItems().filter(item => !initiallySelectedIds.includes(item.htmlId));\n });\n\n /** Multiple mode's unselected zone, grouped. */\n protected readonly displayEntries = computed<RenderEntry[]>(() => inEncounterOrder(this.unselectedItems()));\n\n /** Single mode has no selected zone: the picked option stays in its group. */\n protected readonly singleEntries = computed<RenderEntry[]>(() => inEncounterOrder(this.filteredItems()));\n\n /**\n * A listbox owns only options, so a group's checkbox cannot sit inside one: each group gets its own\n * listbox, and the ungrouped items between two groups are collected into one rather than one each.\n */\n protected readonly displayRuns = computed<RenderRun[]>(() => {\n const runs: RenderRun[] = [];\n\n for (const entry of this.displayEntries()) {\n if (entry.kind === 'group') {\n runs.push(entry);\n continue;\n }\n\n const last = runs[runs.length - 1];\n if (last?.kind === 'items') {\n last.items.push(entry.item);\n } else {\n runs.push({ kind: 'items', items: [entry.item] });\n }\n }\n\n return runs;\n });\n\n // Computed maps for template usage\n protected readonly groupSelectionStates = computed(() => {\n const states: Record<string, SelectionState> = {};\n for (const entry of this.displayEntries()) {\n if (entry.kind !== 'group') {\n continue;\n }\n const groupLabel = entry.label;\n const groupItems = this.filteredItems().filter(item => item.groupLabel === groupLabel);\n // Selection is counted across all members: a disabled item can still be selected, and\n // excluding it would wrongly drop the group to \"unselected\" despite a live selection.\n const hasSelection = groupItems.some(item => item.selected);\n const hasIndeterminate = groupItems.some(item => item.indeterminate);\n // \"Fully selected\" ignores members that cannot be toggled on (a disabled, unselected\n // item), so a group whose every selectable member is selected still reads as selected.\n const hasPendingSelectable = groupItems.some(item => !item.selected && !item.disabled && !item.isFeatureLocked);\n\n if (!hasSelection && !hasIndeterminate) {\n states[groupLabel] = 'unselected';\n } else if (!hasPendingSelectable && !hasIndeterminate) {\n states[groupLabel] = 'selected';\n } else {\n states[groupLabel] = 'partial';\n }\n }\n return states;\n });\n\n private readonly selectAllTargets = computed(() => this.filteredItems().filter(item => !item.disabled && !item.isFeatureLocked));\n\n protected readonly selectAllVisible = computed(\n () => this.selectAllEnabled() && !this.isSingleSelect() && this.selectAllTargets().length > 0\n );\n\n protected readonly selectAllLabel = computed(() => {\n const targets = this.selectAllTargets();\n const count = this.selectAllCountText()\n .replace('{selected}', String(targets.filter(item => item.selected).length))\n .replace('{total}', String(targets.length));\n return count ? `${this.selectAllText()} ${count}` : this.selectAllText();\n });\n\n protected readonly selectAllState = computed<SelectionState>(() => {\n const targets = this.selectAllTargets();\n if (targets.some(item => item.indeterminate)) {\n return 'partial';\n }\n const selectedCount = targets.filter(item => item.selected).length;\n if (selectedCount === 0) {\n return 'unselected';\n }\n return selectedCount === targets.length ? 'selected' : 'partial';\n });\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n this.symbolRegistry.registerSymbols([apCheck]);\n\n // Set up debounced search\n this.searchTermSubject.pipe(debounceTime(100), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(term => {\n const items = this.internalItems();\n this.updateFilteredItems(term?.toLowerCase() ?? '', items);\n this.announceResults(term);\n });\n\n // Feed the debounced filter pipeline from the search term signal, so the list re-filters\n // both on user typing and on an external set (a consumer resetting searchTerm to '').\n effect(() => this.searchTermSubject.next(this.searchTerm() ?? ''));\n\n // Initialize filtered items when items change\n effect(() => {\n const items = this.internalItems();\n if (!this.searchTerm()) {\n this.filteredItems.set(items);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** Opens the dropdown menu at the specified trigger element */\n open(triggerElement?: HTMLElement): void {\n const panel = this.panel();\n if (this.disabled() || this.isOpen() || !panel) return;\n\n panel.open(triggerElement);\n\n // Capture initially selected items as a static snapshot\n const selectedItems = this.internalItems().filter(item => item.selected);\n this.initiallySelectedItems.set(selectedItems);\n\n this.opened.emit();\n }\n\n close(): void {\n this.panel()?.close();\n }\n\n protected onPanelClosed(): void {\n this.primed = false;\n this.activeIndex.set(-1);\n this.initiallySelectedItems.set([]);\n this.closed.emit();\n }\n\n /** Toggles the dropdown menu open or closed state */\n toggle(triggerElement?: HTMLElement): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open(triggerElement);\n }\n }\n\n /** Handles item toggle events, updating selection and emitting changes.\n * An indeterminate item resolves to selected; a definite item flips. Toggling always\n * clears the indeterminate flag, so the item becomes a definite selected/unselected. */\n onItemToggle(item: SelectionDropdownItem): void {\n if (item.disabled || item.isFeatureLocked) {\n return;\n }\n\n if (this.isSingleSelect()) {\n this.selectOnly(item);\n return;\n }\n\n const nextSelected = item.indeterminate ? true : !item.selected;\n const resolve = (i: SelectionDropdownItem): SelectionDropdownItem =>\n i.htmlId === item.htmlId ? { ...i, selected: nextSelected, indeterminate: false } : i;\n\n const updatedItems = this.internalItems().map(resolve);\n this.internalItems.set(updatedItems);\n this.selectionChange.emit(updatedItems);\n\n // Keep the filtered view in sync with the toggled item.\n this.filteredItems.update(items => items.map(resolve));\n }\n\n /** Single mode: the pick becomes the only selection, then the dropdown closes — even on a no-op pick. */\n private selectOnly(item: SelectionDropdownItem): void {\n const resolve = (i: SelectionDropdownItem): SelectionDropdownItem => ({\n ...i,\n selected: i.htmlId === item.htmlId,\n indeterminate: false,\n });\n\n const updatedItems = this.internalItems().map(resolve);\n this.internalItems.set(updatedItems);\n this.filteredItems.update(items => items.map(resolve));\n this.selectionChange.emit(updatedItems);\n this.close();\n }\n\n /** Handles footer button clicks */\n onFooterButtonClick(): void {\n this.footerButtonClick.emit();\n }\n\n /**\n * A search field keeps focus, so the list is marked rather than focused and the field says which\n * option through `aria-activedescendant`. Without a field, focus is the only affordance there is,\n * and the type-ahead is free — it is only a rival to a field that does the same job.\n */\n private activeManager(): ListKeyManager<DropdownOptionDirective> {\n if (!this.keyManager) {\n this.keyManager = this.searchVisible()\n ? new ActiveDescendantKeyManager(this.options, this.injector).withWrap()\n : new FocusKeyManager(this.options, this.injector).withWrap().withHomeAndEnd().withTypeAhead();\n this.keyManager.change.subscribe(index => this.activeIndex.set(index));\n // No close on `tabOut`: the rest of the dialog must stay reachable. The manager does not\n // preventDefault on Tab, so leaving it alone is enough.\n }\n return this.keyManager;\n }\n\n /** `@for` gives a per-loop index, and the options span several listboxes, so identity decides. */\n protected runKey(run: RenderRun): string {\n return run.kind === 'items' ? `items:${run.items[0]?.htmlId ?? ''}` : `group:${run.label}`;\n }\n\n /** With a search field the list is no tab stop at all: the field owns it and reaches it by arrow. */\n protected optionTabIndex(carriesIt: boolean): 0 | -1 {\n return carriesIt && !this.searchVisible() ? 0 : -1;\n }\n\n /**\n * Roving tabindex across every listbox at once: the options are a single tab stop. Before any\n * arrow key the first option carries it, or nothing in the list could be tabbed to.\n */\n protected tabbableOption(item: SelectionDropdownItem): boolean {\n const options = this.options();\n const active = this.activeIndex();\n const carrier = active >= 0 ? options[active] : options[0];\n\n return carrier?.id === this.optionId(item);\n }\n\n /** The option the search field names as active, or nothing until an arrow key marks one. */\n protected readonly activeDescendantId = computed(() => {\n const active = this.activeIndex();\n return active >= 0 ? (this.options()[active]?.id ?? null) : null;\n });\n\n protected groupHeaderId(index: number): string {\n return `${this.listboxId}-group-${index}`;\n }\n\n /** An option needs an id of its own: the consumer's htmlId is not unique across a page. */\n protected optionId(item: SelectionDropdownItem): string {\n return `${this.listboxId}-${item.htmlId}`;\n }\n\n /**\n * The manager owns the arrows and Home/End. An option is a button, so it activates itself.\n *\n * Keys from the search field arrive here by bubbling, so only navigation crosses over: anything\n * else is the text being typed, and the manager would answer it instead of the field.\n */\n onOptionsKeyDown(event: KeyboardEvent): void {\n if (this.searchVisible()) {\n // Only the field drives the list, because only the field says which option is active.\n // Driven from the clear button or a group checkbox, the arrows would move a marker no\n // key could then commit, and no screen reader would hear.\n if (!this.fromSearchField(event)) {\n return;\n }\n if (event.key === 'Enter') {\n // The marked option has no focus of its own to answer with.\n this.activeManager().activeItem?.activate();\n event.preventDefault();\n\n return;\n }\n if (!NAVIGATION_FROM_SEARCH.has(event.key)) {\n return;\n }\n }\n\n this.activeManager().onKeydown(event);\n }\n\n /** Leaving the field ends its hold on the list: a marker nothing can commit only misleads. */\n protected onSearchBlur(): void {\n this.activeManager().setActiveItem(-1);\n }\n\n private fromSearchField(event: KeyboardEvent): boolean {\n return event.target === this.inputSearchComponent()?.inputElement().nativeElement;\n }\n\n /** Handles header button clicks */\n onHeaderButtonClick(): void {\n this.headerButtonClick.emit();\n }\n\n /** Handles search input changes from the rendered field. Filtering is driven by the\n * `searchTerm` effect, so this only updates the term and notifies listeners. */\n onSearchTermChange(term: string): void {\n this.searchTerm.set(term ?? '');\n this.searchInputChange.emit(term ?? '');\n }\n\n /** Handles group toggle events, selecting/deselecting all items within the group */\n onGroupToggle(groupLabel: string, checked: boolean): void {\n const updatedItems = this.internalItems().map(item => {\n if (item.groupLabel === groupLabel && !item.disabled && !item.isFeatureLocked) {\n return { ...item, selected: checked, indeterminate: false };\n }\n return item;\n });\n this.internalItems.set(updatedItems);\n this.selectionChange.emit(updatedItems);\n }\n\n onSelectAllToggle(checked: boolean): void {\n if (typeof checked !== 'boolean') {\n return;\n }\n const targetIds = new Set(this.selectAllTargets().map(item => item.htmlId));\n const resolve = (item: SelectionDropdownItem): SelectionDropdownItem =>\n targetIds.has(item.htmlId) ? { ...item, selected: checked, indeterminate: false } : item;\n\n const updatedItems = this.internalItems().map(resolve);\n this.internalItems.set(updatedItems);\n this.filteredItems.update(items => items.map(resolve));\n this.selectionChange.emit(updatedItems);\n }\n\n /** Stable track key for a render entry (item or group). */\n protected entryKey(entry: RenderEntry): string {\n return entry.kind === 'item' ? `item:${entry.item.htmlId}` : `group:${entry.label}`;\n }\n\n /**\n * A filtered list changes under a screen reader with nothing said, and the field keeps the focus,\n * so there is no new focus to read either. Announced after the debounce, once the count is final.\n */\n private announceResults(term: string): void {\n if (!term) {\n this.resultsAnnouncement.set('');\n\n return;\n }\n\n const count = this.filteredItems().length;\n this.resultsAnnouncement.set(count === 0 ? this.noSearchResultsText() : this.searchResultsText().replace('{count}', String(count)));\n }\n\n /** Updates the filtered items based on search term */\n private updateFilteredItems(searchTerm: string, items: SelectionDropdownItem[]): void {\n if (!searchTerm) {\n this.filteredItems.set(items);\n return;\n }\n\n const filtered = items.filter(item => item.text.toLowerCase().includes(searchTerm));\n this.filteredItems.set(filtered);\n }\n}\n","<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- `dialog`, not a combobox: a combobox must close when focus leaves it, and this panel holds a\n search field, a header, a footer and group checkboxes beside its lists — closing on Tab left\n every one of them unreachable. -->\n <div\n *apDropdownContent\n class=\"ap-selection-dropdown__content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-label]=\"panelLabel()\"\n (keydown)=\"onOptionsKeyDown($event)\"\n [class.ap-selection-dropdown__content--single]=\"isSingleSelect()\"\n [style.width]=\"panelWidth()\">\n <!-- Header -->\n @if (headerVisible()) {\n <div\n class=\"ap-selection-dropdown__header\"\n [class.ap-selection-dropdown__header--select-all]=\"selectAllVisible()\">\n @if (headerTopVisible()) {\n <div class=\"ap-selection-dropdown__header-top\">\n @if (title()) {\n <h3 class=\"ap-selection-dropdown__title\">\n {{ title() }}\n </h3>\n }\n @if (headerButtonText()) {\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"headerButtonId()\"\n (click)=\"onHeaderButtonClick()\">\n <ap-symbol [symbolId]=\"headerButtonSymbolId()\" />\n {{ headerButtonText() }}\n </button>\n }\n </div>\n }\n @if (searchVisible()) {\n <ap-input-search\n #inputSearchElement\n [placeholder]=\"searchPlaceholderText()\"\n [clearable]=\"true\"\n [ariaControls]=\"listboxId\"\n [ariaActiveDescendant]=\"activeDescendantId()\"\n [ngModel]=\"searchTerm()\"\n (blur)=\"onSearchBlur()\"\n (ngModelChange)=\"onSearchTermChange($event)\" />\n }\n @if (selectAllVisible()) {\n <div class=\"ap-selection-dropdown__select-all\">\n <ap-checkbox\n class=\"centered\"\n name=\"ap-selection-dropdown-select-all\"\n [checked]=\"selectAllState() === 'selected'\"\n [indeterminate]=\"selectAllState() === 'partial'\"\n (change)=\"onSelectAllToggle($event)\">\n {{ selectAllLabel() }}\n </ap-checkbox>\n </div>\n }\n </div>\n }\n\n <!-- Selection dropdown items -->\n <div\n class=\"ap-selection-dropdown__items\"\n [id]=\"listboxId\"\n [attr.role]=\"isSingleSelect() ? 'listbox' : null\"\n [attr.aria-label]=\"isSingleSelect() ? (title() ?? null) : null\">\n @if (filteredItems().length === 0 && searchTerm()) {\n <div class=\"ap-selection-dropdown__no-results\">\n {{ noSearchResultsText() }}\n </div>\n } @else if (isSingleSelect()) {\n <!-- One listbox: a group holds only options and its presentational header (WAI-ARIA APG grouped listbox). -->\n @for (entry of singleEntries(); track entry.kind === 'group' ? 'group:' + entry.label : entry.item.htmlId) {\n @if (entry.kind === 'group') {\n <div\n role=\"group\"\n class=\"ap-selection-dropdown__group\"\n [attr.aria-labelledby]=\"groupHeaderId($index)\">\n <div\n role=\"presentation\"\n class=\"ap-selection-dropdown__group-title\"\n [id]=\"groupHeaderId($index)\">\n {{ entry.label }}\n </div>\n @for (item of entry.items; track item.htmlId) {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: item }\" />\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: entry.item }\" />\n }\n }\n\n <ng-template\n #singleOption\n let-item>\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__option\"\n [id]=\"optionId(item)\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-disabled]=\"item.disabled || item.isFeatureLocked\"\n [attr.data-track]=\"item.dataTrack\"\n [apTooltip]=\"item.disabled ? (item.disabledTooltip ?? null) : null\"\n apTooltipPosition=\"right\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-single-one-line\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [standaloneModeEnabled]=\"true\" />\n </button>\n </ng-template>\n } @else {\n <!-- A listbox owns only options, so each section is its own, and a group's checkbox sits beside it. -->\n @if (selectedItems().length > 0) {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n class=\"ap-selection-dropdown__selected-section\"\n [attr.aria-label]=\"selectedSectionText()\">\n @for (item of selectedItems(); track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n }\n\n <!-- Unselected zone: items & groups in first-encounter order -->\n @for (run of displayRuns(); track runKey(run)) {\n @if (run.kind === 'items') {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"title() ?? optionsSectionText()\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n } @else {\n <div class=\"ap-selection-dropdown__group\">\n <!-- Group header with checkbox -->\n <div class=\"ap-selection-dropdown__group-header\">\n <div class=\"ap-selection-dropdown__group-label\">\n <ap-checkbox\n class=\"centered\"\n [name]=\"run.label\"\n [checked]=\"groupSelectionStates()[run.label] === 'selected'\"\n [indeterminate]=\"groupSelectionStates()[run.label] === 'partial'\"\n (change)=\"onGroupToggle(run.label, $event)\">\n {{ run.label }}\n </ap-checkbox>\n </div>\n </div>\n\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"run.label\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = true;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"item.text\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"item.disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"item.text\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"item.badgeText\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"item.symbolTooltipText\" />\n </button>\n }\n </div>\n </div>\n }\n }\n }\n </div>\n\n <div\n class=\"ap-selection-dropdown__status\"\n role=\"status\"\n aria-atomic=\"true\">\n {{ resultsAnnouncement() }}\n </div>\n\n <!-- Footer -->\n @if (footerButtonText()) {\n <div class=\"ap-selection-dropdown__footer\">\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"footerButtonId()\"\n (click)=\"onFooterButtonClick()\">\n <ap-symbol [symbolId]=\"footerButtonSymbolId()\" />\n {{ footerButtonText() }}\n </button>\n </div>\n }\n </div>\n</ap-dropdown-panel>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA;;;AAGG;MAIU,iCAAiC,CAAA;AACzB,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;;IAG7D,0BAA0B,GAAG,KAAK,CAAC,QAAQ;mGAA8B;;IAGzE,iCAAiC,GAAG,KAAK,CAAC,KAAK;0GAAC;;AAIhD,IAAA,OAAO,CAAC,KAAiB,EAAA;QACrB,IAAI,IAAI,CAAC,iCAAiC,EAAE;YAAE;QAE9C,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,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AAA,EAAA,CAuBlB,SAAS,2sFAqEoB,oBAAoB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEtOlG;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-selection-dropdown.mjs","sources":["../../../libs/ui-components/selection-dropdown/src/selection-dropdown-trigger.directive.ts","../../../libs/ui-components/selection-dropdown/src/selection-dropdown.component.ts","../../../libs/ui-components/selection-dropdown/src/selection-dropdown.component.html","../../../libs/ui-components/selection-dropdown/src/agorapulse-ui-components-selection-dropdown.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, inject, input } from '@angular/core';\nimport { SelectionDropdownComponent } from './selection-dropdown.component';\n\n/**\n * Directive that turns any element into a trigger for a SelectionDropdown component.\n * Handles click and keyboard interactions to open/close the dropdown.\n */\n@Directive({\n selector: '[apSelectionDropdownTrigger]',\n})\nexport class SelectionDropdownTriggerDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Reference to the SelectionDropdown component that this trigger controls */\n apSelectionDropdownTrigger = input.required<SelectionDropdownComponent>();\n\n /** Prevents the trigger from opening/toggling the dropdown when true */\n apSelectionDropdownTriggerDisable = input(false);\n\n /** Handles click events to toggle the dropdown */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n if (this.apSelectionDropdownTriggerDisable()) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n this.apSelectionDropdownTrigger().toggle(this.elementRef.nativeElement);\n }\n\n /** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent): void {\n const dropdown = this.apSelectionDropdownTrigger();\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n if (this.apSelectionDropdownTriggerDisable()) return;\n event.preventDefault();\n dropdown.open(this.elementRef.nativeElement);\n break;\n\n case 'Escape':\n event.preventDefault();\n dropdown.close();\n break;\n }\n }\n}\n","import { CheckboxComponent } from '@agorapulse/ui-components/checkbox';\nimport { DropdownOptionDirective, DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';\nimport { DropdownContentDirective, DropdownPanelComponent } from '@agorapulse/ui-components/dropdown-panel';\nimport { FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { I18nOf, injectResolveTexts, injectTranslate, TextRolesOf } from '@agorapulse/ui-components/i18n';\nimport { InputSearchComponent } from '@agorapulse/ui-components/input-search';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { DropdownItemMultipleOneLineComponent, DropdownItemSingleOneLineComponent } from '@agorapulse/ui-components/select';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apCheck, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ActiveDescendantKeyManager, FocusKeyManager, ListKeyManager } from '@angular/cdk/a11y';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n Injector,\n input,\n linkedSignal,\n model,\n OnDestroy,\n output,\n signal,\n TemplateRef,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { debounceTime, distinctUntilChanged, Subject, takeUntil } from 'rxjs';\n\n/** The only keys a search field hands to the list: Home and End belong to the caret, not the options. */\nconst NAVIGATION_FROM_SEARCH = new Set(['ArrowUp', 'ArrowDown']);\n\nexport interface SelectionDropdownItem {\n /** Unique HTML ID for the item */\n htmlId: string;\n /** Whether the item is selected */\n selected: boolean;\n /** Whether the item is displayed in a mixed/indeterminate state. Takes visual precedence over `selected`. */\n indeterminate?: boolean;\n /** Whether the item is disabled and non-interactive */\n disabled?: boolean;\n /** Avatar URL to display */\n avatarUrl?: string;\n /** Symbol ID to display */\n symbolId?: string;\n /** Whether the feature is locked */\n isFeatureLocked?: boolean;\n /** Whether avatar should be rounded */\n roundedAvatar?: boolean;\n /** Avatar network type */\n network?: any;\n /** Symbol color */\n symbolColor?: string;\n dataTrack?: string;\n /**\n * Texts of the item: `label` is required; `disabledTooltip` shows on a disabled item, `badge` next to the label,\n * `symbolTooltip` on the symbol. Items whose `group` resolves to the same text are grouped together.\n */\n i18n: I18nOf<'label', 'disabledTooltip' | 'badge' | 'symbolTooltip' | 'group'>;\n}\n\n/**\n * Texts of `ap-selection-dropdown`, all optional. `results` receives `count`, `selectAllCount` receives `selected`\n * and `total`; an empty `selectAllCount` hides the count. The dialog is named by `ariaLabel`, else `title`.\n *\n * @example\n * const i18n: SelectionDropdownI18n = { title: 'inbox.labels.title', searchPlaceholder: 'inbox.labels.search' };\n */\nexport type SelectionDropdownI18n = I18nOf<\n never,\n | 'title'\n | 'ariaLabel'\n | 'headerButton'\n | 'footerButton'\n | 'searchPlaceholder'\n | 'noResults'\n | 'results'\n | 'selectedSection'\n | 'optionsSection'\n | 'selectAll'\n | 'selectAllCount'\n>;\n\nconst ITEM_ROLES = {\n label: null,\n disabledTooltip: null,\n badge: null,\n symbolTooltip: null,\n group: null,\n} as const satisfies TextRolesOf<SelectionDropdownItem['i18n']>;\n\nconst ROLES = {\n title: null,\n ariaLabel: null,\n headerButton: null,\n footerButton: null,\n searchPlaceholder: 'ui-components.search.placeholder',\n noResults: 'ui-components.search.no-results',\n selectedSection: 'ui-components.selection.selected-section',\n optionsSection: 'ui-components.selection.options-section',\n selectAll: 'ui-components.selection.select-all',\n} as const satisfies TextRolesOf<SelectionDropdownI18n>;\n\ntype ItemTexts = { label: string; disabledTooltip?: string; badge?: string; symbolTooltip?: string; group?: string };\n\n/**\n * One rendered row in the unselected zone: either a standalone item or a group\n * holding the items that belong to it (in first-encounter order).\n */\ntype RenderEntry = { kind: 'item'; item: SelectionDropdownItem } | { kind: 'group'; label: string; items: SelectionDropdownItem[] };\n\n/** A run of consecutive ungrouped items, or a group. Each becomes one listbox of its own. */\ntype RenderRun = { kind: 'items'; items: SelectionDropdownItem[] } | Extract<RenderEntry, { kind: 'group' }>;\n\nexport type SelectionDropdownMode = 'multiple' | 'single';\n\n/**\n * Rebuilds items into one ordered list: standalone items and groups appear in the order their first\n * item is encountered; later items of an already-seen group join that existing group entry.\n */\nfunction inEncounterOrder(items: SelectionDropdownItem[], groupOf: (item: SelectionDropdownItem) => string | undefined): RenderEntry[] {\n const entries: RenderEntry[] = [];\n const groupsByLabel = new Map<string, Extract<RenderEntry, { kind: 'group' }>>();\n\n for (const item of items) {\n const label = groupOf(item);\n if (!label) {\n entries.push({ kind: 'item', item });\n continue;\n }\n\n const existing = groupsByLabel.get(label);\n if (existing) {\n // `existing` is the same object reference already pushed into `entries`,\n // so mutating its items array updates the rendered group in place.\n existing.items.push(item);\n } else {\n const group: Extract<RenderEntry, { kind: 'group' }> = { kind: 'group', label, items: [item] };\n groupsByLabel.set(label, group);\n entries.push(group);\n }\n }\n\n return entries;\n}\n\ntype SelectionState = 'selected' | 'partial' | 'unselected';\n\n/** A dropdown of options on any trigger. `multiple` = checkbox rows with search; `single` = rows, closes on pick. */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-selection-dropdown',\n templateUrl: './selection-dropdown.component.html',\n styleUrls: ['./selection-dropdown.component.scss'],\n imports: [\n CheckboxComponent,\n DropdownContentDirective,\n DropdownOptionDirective,\n DropdownItemMultipleOneLineComponent,\n DropdownItemSingleOneLineComponent,\n DropdownPanelComponent,\n FormsModule,\n NgTemplateOutlet,\n InputSearchComponent,\n SymbolComponent,\n TooltipDirective,\n ],\n})\nexport class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {\n private static nextId = 0;\n\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly panel = viewChild(DropdownPanelComponent);\n private readonly options = viewChildren(DropdownOptionDirective);\n\n /** Mirrors the key manager's active index, so the roving tabindex can be bound. */\n protected readonly activeIndex = signal(-1);\n\n private readonly injector = inject(Injector);\n\n private readonly t = injectTranslate();\n private readonly resolveTexts = injectResolveTexts();\n\n /** Texts of the dropdown, keys or `raw()` texts; see {@link SelectionDropdownI18n}. */\n readonly i18n = input<SelectionDropdownI18n>({});\n\n protected readonly texts = computed(() => this.resolveTexts(this.i18n(), ROLES));\n\n protected readonly panelLabel = computed(() => this.texts().ariaLabel ?? this.texts().title ?? this.t('ui-components.selection.label'));\n\n protected readonly listboxId = `ap-selection-dropdown-list-${SelectionDropdownComponent.nextId++}`;\n\n private keyManager: ListKeyManager<DropdownOptionDirective> | null = null;\n private primed = false;\n\n trigger = contentChild<TemplateRef<unknown>>('trigger');\n\n /** ID for the header button */\n headerButtonId = input<string>();\n /** ID for the footer button */\n footerButtonId = input<string>();\n /** Array of items to display in the dropdown menu */\n items = input<SelectionDropdownItem[]>([]);\n /** Whether several options can be active at once, or exactly one. */\n selectionMode = input<SelectionDropdownMode>('multiple');\n /** Shows the search field. Ignored in `multiple` mode, which always searches. */\n searchEnabled = input(false);\n /** Symbol ID for the footer button */\n footerButtonSymbolId = input<string>();\n /** Symbol ID for the header button */\n headerButtonSymbolId = input<string>();\n /** Adds a \"Select all\" row above the options, acting on every visible option across groups. Multiple mode only. */\n selectAllEnabled = input(false);\n /** Whether to show a backdrop that closes the dropdown when clicked */\n showBackdrop = input(true);\n /** Whether the dropdown is disabled and cannot be opened */\n disabled = input(false);\n /** Default position for the dropdown relative to the trigger element */\n /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n /** CSS width of the panel, e.g. `370px`. Unset, a single panel fits its content and a multiple one keeps its default width. */\n readonly panelWidth = input<string>();\n\n /** Emits when the dropdown menu is opened */\n opened = output<void>();\n /** Emits when the dropdown menu is closed */\n closed = output<void>();\n /** Emits when a dropdown item selection changes */\n selectionChange = output<SelectionDropdownItem[]>();\n /** Emits when the footer button is clicked */\n footerButtonClick = output<void>();\n /** Emits when the header button is clicked */\n headerButtonClick = output<void>();\n /** Emits when the search input is changed */\n searchInputChange = output<string>();\n\n /**\n * Two-way bindable, clearable search term. Consumers can read it and reset it (set to '')\n * to clear the search and restore the full item list — letting them drive the search\n * declaratively instead of reaching into the rendered `ap-input-search`.\n */\n readonly searchTerm = model<string>('');\n\n private readonly destroy$ = new Subject<void>();\n private readonly searchTermSubject = new Subject<string>();\n\n protected readonly inputSearchComponent = viewChild<InputSearchComponent>('inputSearchElement');\n\n readonly isOpen = computed(() => this.panel()?.isOpen() ?? false);\n\n focusInput = effect(() => {\n const inputSearch = this.inputSearchComponent();\n untracked(() => {\n if (this.isOpen() && inputSearch) {\n inputSearch.focusInput();\n }\n });\n });\n\n /** Single-select opens on its first option; multi does not, since marking one the user never chose announces a selection. */\n primeOptions = effect(() => {\n const open = this.isOpen();\n const options = this.options();\n untracked(() => {\n if (open && options.length > 0 && !this.primed && this.isSingleSelect()) {\n this.primed = true;\n this.activeManager().setFirstItemActive();\n }\n });\n });\n\n protected readonly isSingleSelect = computed(() => this.selectionMode() === 'single');\n\n /** Always true in `multiple` mode, leaving that layout untouched; only `single` collapses the header. */\n protected readonly searchVisible = computed(() => !this.isSingleSelect() || this.searchEnabled());\n protected readonly headerTopVisible = computed(() => !this.isSingleSelect() || !!this.texts().title || !!this.texts().headerButton);\n protected readonly headerVisible = computed(() => this.headerTopVisible() || this.searchVisible());\n\n private readonly internalItems = linkedSignal(() => this.items());\n\n private readonly itemTexts = computed(\n () =>\n new Map<string, ItemTexts>(\n this.internalItems().map(item => {\n const texts = this.resolveTexts(item.i18n, ITEM_ROLES);\n return [item.htmlId, { ...texts, label: texts.label ?? '' }];\n })\n )\n );\n\n protected readonly filteredItems = signal<SelectionDropdownItem[]>([]);\n\n private readonly searchResultCount = signal<number | null>(null);\n\n /** What the live region holds. Empty outside a search: the list is on screen, unchanged. */\n protected readonly resultsAnnouncement = computed(() => {\n const count = this.searchResultCount();\n if (count === null) {\n return '';\n }\n return count === 0 ? this.texts().noResults : this.t(this.i18n().results ?? 'ui-components.search.results', { count });\n });\n\n protected readonly initiallySelectedItems = signal<SelectionDropdownItem[]>([]);\n\n // Computed properties for template usage\n protected readonly selectedItems = computed(() => {\n const initiallySelectedIds = this.initiallySelectedItems().map(item => item.htmlId);\n return this.filteredItems().filter(item => initiallySelectedIds.includes(item.htmlId));\n });\n\n protected readonly unselectedItems = computed(() => {\n const initiallySelectedIds = this.initiallySelectedItems().map(item => item.htmlId);\n return this.filteredItems().filter(item => !initiallySelectedIds.includes(item.htmlId));\n });\n\n /** Multiple mode's unselected zone, grouped. */\n protected readonly displayEntries = computed<RenderEntry[]>(() => inEncounterOrder(this.unselectedItems(), item => this.groupOf(item)));\n\n /** Single mode has no selected zone: the picked option stays in its group. */\n protected readonly singleEntries = computed<RenderEntry[]>(() => inEncounterOrder(this.filteredItems(), item => this.groupOf(item)));\n\n /**\n * A listbox owns only options, so a group's checkbox cannot sit inside one: each group gets its own\n * listbox, and the ungrouped items between two groups are collected into one rather than one each.\n */\n protected readonly displayRuns = computed<RenderRun[]>(() => {\n const runs: RenderRun[] = [];\n\n for (const entry of this.displayEntries()) {\n if (entry.kind === 'group') {\n runs.push(entry);\n continue;\n }\n\n const last = runs[runs.length - 1];\n if (last?.kind === 'items') {\n last.items.push(entry.item);\n } else {\n runs.push({ kind: 'items', items: [entry.item] });\n }\n }\n\n return runs;\n });\n\n // Computed maps for template usage\n protected readonly groupSelectionStates = computed(() => {\n const states: Record<string, SelectionState> = {};\n for (const entry of this.displayEntries()) {\n if (entry.kind !== 'group') {\n continue;\n }\n const groupLabel = entry.label;\n const groupItems = this.filteredItems().filter(item => this.groupOf(item) === groupLabel);\n // Selection is counted across all members: a disabled item can still be selected, and\n // excluding it would wrongly drop the group to \"unselected\" despite a live selection.\n const hasSelection = groupItems.some(item => item.selected);\n const hasIndeterminate = groupItems.some(item => item.indeterminate);\n // \"Fully selected\" ignores members that cannot be toggled on (a disabled, unselected\n // item), so a group whose every selectable member is selected still reads as selected.\n const hasPendingSelectable = groupItems.some(item => !item.selected && !item.disabled && !item.isFeatureLocked);\n\n if (!hasSelection && !hasIndeterminate) {\n states[groupLabel] = 'unselected';\n } else if (!hasPendingSelectable && !hasIndeterminate) {\n states[groupLabel] = 'selected';\n } else {\n states[groupLabel] = 'partial';\n }\n }\n return states;\n });\n\n private readonly selectAllTargets = computed(() => this.filteredItems().filter(item => !item.disabled && !item.isFeatureLocked));\n\n protected readonly selectAllVisible = computed(\n () => this.selectAllEnabled() && !this.isSingleSelect() && this.selectAllTargets().length > 0\n );\n\n protected readonly selectAllLabel = computed(() => {\n const targets = this.selectAllTargets();\n const count = this.t(this.i18n().selectAllCount ?? 'ui-components.selection.select-all-count', {\n selected: targets.filter(item => item.selected).length,\n total: targets.length,\n });\n return count ? `${this.texts().selectAll} ${count}` : this.texts().selectAll;\n });\n\n protected readonly selectAllState = computed<SelectionState>(() => {\n const targets = this.selectAllTargets();\n if (targets.some(item => item.indeterminate)) {\n return 'partial';\n }\n const selectedCount = targets.filter(item => item.selected).length;\n if (selectedCount === 0) {\n return 'unselected';\n }\n return selectedCount === targets.length ? 'selected' : 'partial';\n });\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n this.symbolRegistry.registerSymbols([apCheck]);\n\n // Set up debounced search\n this.searchTermSubject.pipe(debounceTime(100), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(term => {\n const items = this.internalItems();\n this.updateFilteredItems(term?.toLowerCase() ?? '', items);\n this.announceResults(term);\n });\n\n // Feed the debounced filter pipeline from the search term signal, so the list re-filters\n // both on user typing and on an external set (a consumer resetting searchTerm to '').\n effect(() => this.searchTermSubject.next(this.searchTerm() ?? ''));\n\n // Initialize filtered items when items change\n effect(() => {\n const items = this.internalItems();\n if (!this.searchTerm()) {\n this.filteredItems.set(items);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** Opens the dropdown menu at the specified trigger element */\n open(triggerElement?: HTMLElement): void {\n const panel = this.panel();\n if (this.disabled() || this.isOpen() || !panel) return;\n\n panel.open(triggerElement);\n\n // Capture initially selected items as a static snapshot\n const selectedItems = this.internalItems().filter(item => item.selected);\n this.initiallySelectedItems.set(selectedItems);\n\n this.opened.emit();\n }\n\n close(): void {\n this.panel()?.close();\n }\n\n protected onPanelClosed(): void {\n this.primed = false;\n this.activeIndex.set(-1);\n this.initiallySelectedItems.set([]);\n this.closed.emit();\n }\n\n /** Toggles the dropdown menu open or closed state */\n toggle(triggerElement?: HTMLElement): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open(triggerElement);\n }\n }\n\n /** Handles item toggle events, updating selection and emitting changes.\n * An indeterminate item resolves to selected; a definite item flips. Toggling always\n * clears the indeterminate flag, so the item becomes a definite selected/unselected. */\n onItemToggle(item: SelectionDropdownItem): void {\n if (item.disabled || item.isFeatureLocked) {\n return;\n }\n\n if (this.isSingleSelect()) {\n this.selectOnly(item);\n return;\n }\n\n const nextSelected = item.indeterminate ? true : !item.selected;\n const resolve = (i: SelectionDropdownItem): SelectionDropdownItem =>\n i.htmlId === item.htmlId ? { ...i, selected: nextSelected, indeterminate: false } : i;\n\n const updatedItems = this.internalItems().map(resolve);\n this.internalItems.set(updatedItems);\n this.selectionChange.emit(updatedItems);\n\n // Keep the filtered view in sync with the toggled item.\n this.filteredItems.update(items => items.map(resolve));\n }\n\n /** Single mode: the pick becomes the only selection, then the dropdown closes — even on a no-op pick. */\n private selectOnly(item: SelectionDropdownItem): void {\n const resolve = (i: SelectionDropdownItem): SelectionDropdownItem => ({\n ...i,\n selected: i.htmlId === item.htmlId,\n indeterminate: false,\n });\n\n const updatedItems = this.internalItems().map(resolve);\n this.internalItems.set(updatedItems);\n this.filteredItems.update(items => items.map(resolve));\n this.selectionChange.emit(updatedItems);\n this.close();\n }\n\n /** Handles footer button clicks */\n onFooterButtonClick(): void {\n this.footerButtonClick.emit();\n }\n\n /**\n * A search field keeps focus, so the list is marked rather than focused and the field says which\n * option through `aria-activedescendant`. Without a field, focus is the only affordance there is,\n * and the type-ahead is free — it is only a rival to a field that does the same job.\n */\n private activeManager(): ListKeyManager<DropdownOptionDirective> {\n if (!this.keyManager) {\n this.keyManager = this.searchVisible()\n ? new ActiveDescendantKeyManager(this.options, this.injector).withWrap()\n : new FocusKeyManager(this.options, this.injector).withWrap().withHomeAndEnd().withTypeAhead();\n this.keyManager.change.subscribe(index => this.activeIndex.set(index));\n // No close on `tabOut`: the rest of the dialog must stay reachable. The manager does not\n // preventDefault on Tab, so leaving it alone is enough.\n }\n return this.keyManager;\n }\n\n /** `@for` gives a per-loop index, and the options span several listboxes, so identity decides. */\n protected runKey(run: RenderRun): string {\n return run.kind === 'items' ? `items:${run.items[0]?.htmlId ?? ''}` : `group:${run.label}`;\n }\n\n /** With a search field the list is no tab stop at all: the field owns it and reaches it by arrow. */\n protected optionTabIndex(carriesIt: boolean): 0 | -1 {\n return carriesIt && !this.searchVisible() ? 0 : -1;\n }\n\n /**\n * Roving tabindex across every listbox at once: the options are a single tab stop. Before any\n * arrow key the first option carries it, or nothing in the list could be tabbed to.\n */\n protected tabbableOption(item: SelectionDropdownItem): boolean {\n const options = this.options();\n const active = this.activeIndex();\n const carrier = active >= 0 ? options[active] : options[0];\n\n return carrier?.id === this.optionId(item);\n }\n\n /** The option the search field names as active, or nothing until an arrow key marks one. */\n protected readonly activeDescendantId = computed(() => {\n const active = this.activeIndex();\n return active >= 0 ? (this.options()[active]?.id ?? null) : null;\n });\n\n protected groupHeaderId(index: number): string {\n return `${this.listboxId}-group-${index}`;\n }\n\n /** An option needs an id of its own: the consumer's htmlId is not unique across a page. */\n protected optionId(item: SelectionDropdownItem): string {\n return `${this.listboxId}-${item.htmlId}`;\n }\n\n /**\n * The manager owns the arrows and Home/End. An option is a button, so it activates itself.\n *\n * Keys from the search field arrive here by bubbling, so only navigation crosses over: anything\n * else is the text being typed, and the manager would answer it instead of the field.\n */\n onOptionsKeyDown(event: KeyboardEvent): void {\n if (this.searchVisible()) {\n // Only the field drives the list, because only the field says which option is active.\n // Driven from the clear button or a group checkbox, the arrows would move a marker no\n // key could then commit, and no screen reader would hear.\n if (!this.fromSearchField(event)) {\n return;\n }\n if (event.key === 'Enter') {\n // The marked option has no focus of its own to answer with.\n this.activeManager().activeItem?.activate();\n event.preventDefault();\n\n return;\n }\n if (!NAVIGATION_FROM_SEARCH.has(event.key)) {\n return;\n }\n }\n\n this.activeManager().onKeydown(event);\n }\n\n /** Leaving the field ends its hold on the list: a marker nothing can commit only misleads. */\n protected onSearchBlur(): void {\n this.activeManager().setActiveItem(-1);\n }\n\n private fromSearchField(event: KeyboardEvent): boolean {\n return event.target === this.inputSearchComponent()?.inputElement().nativeElement;\n }\n\n /** Handles header button clicks */\n onHeaderButtonClick(): void {\n this.headerButtonClick.emit();\n }\n\n /** Handles search input changes from the rendered field. Filtering is driven by the\n * `searchTerm` effect, so this only updates the term and notifies listeners. */\n onSearchTermChange(term: string): void {\n this.searchTerm.set(term ?? '');\n this.searchInputChange.emit(term ?? '');\n }\n\n /** Handles group toggle events, selecting/deselecting all items within the group */\n onGroupToggle(groupLabel: string, checked: boolean): void {\n const updatedItems = this.internalItems().map(item => {\n if (this.groupOf(item) === groupLabel && !item.disabled && !item.isFeatureLocked) {\n return { ...item, selected: checked, indeterminate: false };\n }\n return item;\n });\n this.internalItems.set(updatedItems);\n this.selectionChange.emit(updatedItems);\n }\n\n onSelectAllToggle(checked: boolean): void {\n if (typeof checked !== 'boolean') {\n return;\n }\n const targetIds = new Set(this.selectAllTargets().map(item => item.htmlId));\n const resolve = (item: SelectionDropdownItem): SelectionDropdownItem =>\n targetIds.has(item.htmlId) ? { ...item, selected: checked, indeterminate: false } : item;\n\n const updatedItems = this.internalItems().map(resolve);\n this.internalItems.set(updatedItems);\n this.filteredItems.update(items => items.map(resolve));\n this.selectionChange.emit(updatedItems);\n }\n\n /** The item's texts resolved in the current language. */\n protected textsOf(item: SelectionDropdownItem): ItemTexts {\n return this.itemTexts().get(item.htmlId) ?? { label: '' };\n }\n\n private groupOf(item: SelectionDropdownItem): string | undefined {\n return this.textsOf(item).group;\n }\n\n /** Stable track key for a render entry (item or group). */\n protected entryKey(entry: RenderEntry): string {\n return entry.kind === 'item' ? `item:${entry.item.htmlId}` : `group:${entry.label}`;\n }\n\n /**\n * A filtered list changes under a screen reader with nothing said, and the field keeps the focus,\n * so there is no new focus to read either. Announced after the debounce, once the count is final.\n */\n private announceResults(term: string): void {\n this.searchResultCount.set(term ? this.filteredItems().length : null);\n }\n\n /** Updates the filtered items based on search term */\n private updateFilteredItems(searchTerm: string, items: SelectionDropdownItem[]): void {\n if (!searchTerm) {\n this.filteredItems.set(items);\n return;\n }\n\n const filtered = items.filter(item => this.textsOf(item).label.toLowerCase().includes(searchTerm));\n this.filteredItems.set(filtered);\n }\n}\n","<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- `dialog`, not a combobox: a combobox must close when focus leaves it, and this panel holds a\n search field, a header, a footer and group checkboxes beside its lists — closing on Tab left\n every one of them unreachable. -->\n <div\n *apDropdownContent\n class=\"ap-selection-dropdown__content\"\n role=\"dialog\"\n tabindex=\"-1\"\n [attr.aria-label]=\"panelLabel()\"\n (keydown)=\"onOptionsKeyDown($event)\"\n [class.ap-selection-dropdown__content--single]=\"isSingleSelect()\"\n [style.width]=\"panelWidth()\">\n <!-- Header -->\n @if (headerVisible()) {\n <div\n class=\"ap-selection-dropdown__header\"\n [class.ap-selection-dropdown__header--select-all]=\"selectAllVisible()\">\n @if (headerTopVisible()) {\n <div class=\"ap-selection-dropdown__header-top\">\n @if (texts().title) {\n <h3 class=\"ap-selection-dropdown__title\">\n {{ texts().title }}\n </h3>\n }\n @if (texts().headerButton) {\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"headerButtonId()\"\n (click)=\"onHeaderButtonClick()\">\n <ap-symbol [symbolId]=\"headerButtonSymbolId()\" />\n {{ texts().headerButton }}\n </button>\n }\n </div>\n }\n @if (searchVisible()) {\n <ap-input-search\n #inputSearchElement\n [placeholder]=\"texts().searchPlaceholder\"\n [clearable]=\"true\"\n [ariaControls]=\"listboxId\"\n [ariaActiveDescendant]=\"activeDescendantId()\"\n [ngModel]=\"searchTerm()\"\n (blur)=\"onSearchBlur()\"\n (ngModelChange)=\"onSearchTermChange($event)\" />\n }\n @if (selectAllVisible()) {\n <div class=\"ap-selection-dropdown__select-all\">\n <ap-checkbox\n class=\"centered\"\n name=\"ap-selection-dropdown-select-all\"\n [checked]=\"selectAllState() === 'selected'\"\n [indeterminate]=\"selectAllState() === 'partial'\"\n (change)=\"onSelectAllToggle($event)\">\n {{ selectAllLabel() }}\n </ap-checkbox>\n </div>\n }\n </div>\n }\n\n <!-- Selection dropdown items -->\n <div\n class=\"ap-selection-dropdown__items\"\n [id]=\"listboxId\"\n [attr.role]=\"isSingleSelect() ? 'listbox' : null\"\n [attr.aria-label]=\"isSingleSelect() ? (texts().title ?? null) : null\">\n @if (filteredItems().length === 0 && searchTerm()) {\n <div class=\"ap-selection-dropdown__no-results\">\n {{ texts().noResults }}\n </div>\n } @else if (isSingleSelect()) {\n <!-- One listbox: a group holds only options and its presentational header (WAI-ARIA APG grouped listbox). -->\n @for (entry of singleEntries(); track entry.kind === 'group' ? 'group:' + entry.label : entry.item.htmlId) {\n @if (entry.kind === 'group') {\n <div\n role=\"group\"\n class=\"ap-selection-dropdown__group\"\n [attr.aria-labelledby]=\"groupHeaderId($index)\">\n <div\n role=\"presentation\"\n class=\"ap-selection-dropdown__group-title\"\n [id]=\"groupHeaderId($index)\">\n {{ entry.label }}\n </div>\n @for (item of entry.items; track item.htmlId) {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: item }\" />\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"singleOption; context: { $implicit: entry.item }\" />\n }\n }\n\n <ng-template\n #singleOption\n let-item>\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__option\"\n [id]=\"optionId(item)\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [attr.aria-selected]=\"item.selected\"\n [attr.aria-disabled]=\"item.disabled || item.isFeatureLocked\"\n [attr.data-track]=\"item.dataTrack\"\n [apTooltip]=\"item.disabled ? (textsOf(item).disabledTooltip ?? null) : null\"\n apTooltipPosition=\"right\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-single-one-line\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [standaloneModeEnabled]=\"true\" />\n </button>\n </ng-template>\n } @else {\n <!-- A listbox owns only options, so each section is its own, and a group's checkbox sits beside it. -->\n @if (selectedItems().length > 0) {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n class=\"ap-selection-dropdown__selected-section\"\n [attr.aria-label]=\"texts().selectedSection\">\n @for (item of selectedItems(); track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n }\n\n <!-- Unselected zone: items & groups in first-encounter order -->\n @for (run of displayRuns(); track runKey(run)) {\n @if (run.kind === 'items') {\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"texts().title ?? texts().optionsSection\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = false;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n } @else {\n <div class=\"ap-selection-dropdown__group\">\n <!-- Group header with checkbox -->\n <div class=\"ap-selection-dropdown__group-header\">\n <div class=\"ap-selection-dropdown__group-label\">\n <ap-checkbox\n class=\"centered\"\n [name]=\"run.label\"\n [checked]=\"groupSelectionStates()[run.label] === 'selected'\"\n [indeterminate]=\"groupSelectionStates()[run.label] === 'partial'\"\n (change)=\"onGroupToggle(run.label, $event)\">\n {{ run.label }}\n </ap-checkbox>\n </div>\n </div>\n\n <div\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [attr.aria-label]=\"run.label\">\n @for (item of run.items; track item.htmlId) {\n @let grouped = true;\n <button\n type=\"button\"\n role=\"option\"\n class=\"ap-selection-dropdown__item-button\"\n [id]=\"optionId(item)\"\n [tabindex]=\"optionTabIndex(tabbableOption(item))\"\n [apDropdownOption]=\"textsOf(item).label\"\n [apDropdownOptionDisabled]=\"!!(item.disabled || item.isFeatureLocked)\"\n [attr.aria-selected]=\"item.selected\"\n [class.ap-selection-dropdown__item-button--disabled]=\"item.disabled || item.isFeatureLocked\"\n [apTooltip]=\"textsOf(item).disabledTooltip\"\n (click)=\"onItemToggle(item)\">\n <ap-dropdown-item-multiple-one-line\n presentational\n class=\"ap-selection-dropdown__item\"\n [class.ap-selection-dropdown__item--grouped]=\"grouped\"\n [text]=\"textsOf(item).label\"\n [selected]=\"item.selected\"\n [indeterminate]=\"item.indeterminate ?? false\"\n [htmlId]=\"item.htmlId\"\n [disabled]=\"item.disabled || false\"\n [avatarUrl]=\"item.avatarUrl\"\n [symbolId]=\"item.symbolId\"\n [badgeText]=\"textsOf(item).badge\"\n [isFeatureLocked]=\"item.isFeatureLocked || false\"\n [roundedAvatar]=\"!!item.roundedAvatar\"\n [network]=\"item.network\"\n [symbolColor]=\"item.symbolColor\"\n [symbolTooltipText]=\"textsOf(item).symbolTooltip\" />\n </button>\n }\n </div>\n </div>\n }\n }\n }\n </div>\n\n <div\n class=\"ap-selection-dropdown__status\"\n role=\"status\"\n aria-atomic=\"true\">\n {{ resultsAnnouncement() }}\n </div>\n\n <!-- Footer -->\n @if (texts().footerButton) {\n <div class=\"ap-selection-dropdown__footer\">\n <button\n type=\"button\"\n class=\"ap-link standalone\"\n [id]=\"footerButtonId()\"\n (click)=\"onFooterButtonClick()\">\n <ap-symbol [symbolId]=\"footerButtonSymbolId()\" />\n {{ texts().footerButton }}\n </button>\n </div>\n }\n </div>\n</ap-dropdown-panel>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA;;;AAGG;MAIU,iCAAiC,CAAA;AACzB,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;;IAG7D,0BAA0B,GAAG,KAAK,CAAC,QAAQ;mGAA8B;;IAGzE,iCAAiC,GAAG,KAAK,CAAC,KAAK;0GAAC;;AAIhD,IAAA,OAAO,CAAC,KAAiB,EAAA;QACrB,IAAI,IAAI,CAAC,iCAAiC,EAAE;YAAE;QAE9C,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,eAAe,EAAE;AAEvB,QAAA,IAAI,CAAC,0BAA0B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAC3E;;AAIA,IAAA,SAAS,CAAC,KAAoB,EAAA;AAC1B,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,EAAE;AAElD,QAAA,QAAQ,KAAK,CAAC,GAAG;AACb,YAAA,KAAK,OAAO;AACZ,YAAA,KAAK,GAAG;AACR,YAAA,KAAK,WAAW;gBACZ,IAAI,IAAI,CAAC,iCAAiC,EAAE;oBAAE;gBAC9C,KAAK,CAAC,cAAc,EAAE;gBACtB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;gBAC5C;AAEJ,YAAA,KAAK,QAAQ;gBACT,KAAK,CA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EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAsBlB,SAAS,i1DAmDoB,oBAAoB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3PlG;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -13,8 +13,15 @@ declare const DEFAULT_TEXTS: Readonly<{
|
|
|
13
13
|
readonly 'ui-components.filters.update-existing-preset': "Update existing preset";
|
|
14
14
|
readonly 'ui-components.filters.date-range-placeholder': "Select date range";
|
|
15
15
|
readonly 'ui-components.search.placeholder': "Search";
|
|
16
|
+
readonly 'ui-components.search.no-results': "No results found";
|
|
17
|
+
readonly 'ui-components.search.results': "{{count}} results";
|
|
16
18
|
readonly 'ui-components.select.only': "Only";
|
|
17
19
|
readonly 'ui-components.select.placeholder': "Select an option";
|
|
20
|
+
readonly 'ui-components.selection.label': "Selection";
|
|
21
|
+
readonly 'ui-components.selection.selected-section': "Selected";
|
|
22
|
+
readonly 'ui-components.selection.options-section': "Options";
|
|
23
|
+
readonly 'ui-components.selection.select-all': "Select all";
|
|
24
|
+
readonly 'ui-components.selection.select-all-count': "({{selected}} of {{total}})";
|
|
18
25
|
}>;
|
|
19
26
|
/**
|
|
20
27
|
* A key of the DS default texts, the only keys a component may fall back to.
|
|
@@ -2,13 +2,12 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { OnDestroy, TemplateRef } from '@angular/core';
|
|
3
3
|
import * as _floating_ui_utils from '@floating-ui/utils';
|
|
4
4
|
import { DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';
|
|
5
|
+
import { I18nOf } from '@agorapulse/ui-components/i18n';
|
|
5
6
|
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';
|
|
6
7
|
|
|
7
8
|
interface SelectionDropdownItem {
|
|
8
9
|
/** Unique HTML ID for the item */
|
|
9
10
|
htmlId: string;
|
|
10
|
-
/** Display text for the item */
|
|
11
|
-
text: string;
|
|
12
11
|
/** Whether the item is selected */
|
|
13
12
|
selected: boolean;
|
|
14
13
|
/** Whether the item is displayed in a mixed/indeterminate state. Takes visual precedence over `selected`. */
|
|
@@ -19,10 +18,6 @@ interface SelectionDropdownItem {
|
|
|
19
18
|
avatarUrl?: string;
|
|
20
19
|
/** Symbol ID to display */
|
|
21
20
|
symbolId?: string;
|
|
22
|
-
/** Tooltip text displayed when item is disabled */
|
|
23
|
-
disabledTooltip?: string;
|
|
24
|
-
/** Text displayed in a badge next to the item */
|
|
25
|
-
badgeText?: string;
|
|
26
21
|
/** Whether the feature is locked */
|
|
27
22
|
isFeatureLocked?: boolean;
|
|
28
23
|
/** Whether avatar should be rounded */
|
|
@@ -31,12 +26,28 @@ interface SelectionDropdownItem {
|
|
|
31
26
|
network?: any;
|
|
32
27
|
/** Symbol color */
|
|
33
28
|
symbolColor?: string;
|
|
34
|
-
/** Symbol tooltip text */
|
|
35
|
-
symbolTooltipText?: string;
|
|
36
|
-
/** Group label - items with the same groupLabel will be grouped together */
|
|
37
|
-
groupLabel?: string;
|
|
38
29
|
dataTrack?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Texts of the item: `label` is required; `disabledTooltip` shows on a disabled item, `badge` next to the label,
|
|
32
|
+
* `symbolTooltip` on the symbol. Items whose `group` resolves to the same text are grouped together.
|
|
33
|
+
*/
|
|
34
|
+
i18n: I18nOf<'label', 'disabledTooltip' | 'badge' | 'symbolTooltip' | 'group'>;
|
|
39
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Texts of `ap-selection-dropdown`, all optional. `results` receives `count`, `selectAllCount` receives `selected`
|
|
38
|
+
* and `total`; an empty `selectAllCount` hides the count. The dialog is named by `ariaLabel`, else `title`.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const i18n: SelectionDropdownI18n = { title: 'inbox.labels.title', searchPlaceholder: 'inbox.labels.search' };
|
|
42
|
+
*/
|
|
43
|
+
type SelectionDropdownI18n = I18nOf<never, 'title' | 'ariaLabel' | 'headerButton' | 'footerButton' | 'searchPlaceholder' | 'noResults' | 'results' | 'selectedSection' | 'optionsSection' | 'selectAll' | 'selectAllCount'>;
|
|
44
|
+
type ItemTexts = {
|
|
45
|
+
label: string;
|
|
46
|
+
disabledTooltip?: string;
|
|
47
|
+
badge?: string;
|
|
48
|
+
symbolTooltip?: string;
|
|
49
|
+
group?: string;
|
|
50
|
+
};
|
|
40
51
|
/**
|
|
41
52
|
* One rendered row in the unselected zone: either a standalone item or a group
|
|
42
53
|
* holding the items that belong to it (in first-encounter order).
|
|
@@ -67,12 +78,21 @@ declare class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {
|
|
|
67
78
|
/** Mirrors the key manager's active index, so the roving tabindex can be bound. */
|
|
68
79
|
protected readonly activeIndex: _angular_core.WritableSignal<number>;
|
|
69
80
|
private readonly injector;
|
|
70
|
-
|
|
71
|
-
readonly
|
|
72
|
-
/**
|
|
73
|
-
readonly
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
private readonly t;
|
|
82
|
+
private readonly resolveTexts;
|
|
83
|
+
/** Texts of the dropdown, keys or `raw()` texts; see {@link SelectionDropdownI18n}. */
|
|
84
|
+
readonly i18n: _angular_core.InputSignal<SelectionDropdownI18n>;
|
|
85
|
+
protected readonly texts: _angular_core.Signal<{
|
|
86
|
+
readonly title: string | undefined;
|
|
87
|
+
readonly ariaLabel: string | undefined;
|
|
88
|
+
readonly headerButton: string | undefined;
|
|
89
|
+
readonly footerButton: string | undefined;
|
|
90
|
+
readonly searchPlaceholder: string;
|
|
91
|
+
readonly noResults: string;
|
|
92
|
+
readonly selectedSection: string;
|
|
93
|
+
readonly optionsSection: string;
|
|
94
|
+
readonly selectAll: string;
|
|
95
|
+
}>;
|
|
76
96
|
protected readonly panelLabel: _angular_core.Signal<string>;
|
|
77
97
|
protected readonly listboxId: string;
|
|
78
98
|
private keyManager;
|
|
@@ -88,28 +108,12 @@ declare class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {
|
|
|
88
108
|
selectionMode: _angular_core.InputSignal<SelectionDropdownMode>;
|
|
89
109
|
/** Shows the search field. Ignored in `multiple` mode, which always searches. */
|
|
90
110
|
searchEnabled: _angular_core.InputSignal<boolean>;
|
|
91
|
-
/** Title to display in the header */
|
|
92
|
-
title: _angular_core.InputSignal<string | undefined>;
|
|
93
|
-
/** Text for the footer button */
|
|
94
|
-
footerButtonText: _angular_core.InputSignal<string | undefined>;
|
|
95
111
|
/** Symbol ID for the footer button */
|
|
96
112
|
footerButtonSymbolId: _angular_core.InputSignal<string | undefined>;
|
|
97
|
-
/** Text for the header button */
|
|
98
|
-
headerButtonText: _angular_core.InputSignal<string | undefined>;
|
|
99
113
|
/** Symbol ID for the header button */
|
|
100
114
|
headerButtonSymbolId: _angular_core.InputSignal<string | undefined>;
|
|
101
115
|
/** Adds a "Select all" row above the options, acting on every visible option across groups. Multiple mode only. */
|
|
102
116
|
selectAllEnabled: _angular_core.InputSignal<boolean>;
|
|
103
|
-
/** Label of the "Select all" row */
|
|
104
|
-
selectAllText: _angular_core.InputSignal<string>;
|
|
105
|
-
/** Count after the "Select all" label. `{selected}` and `{total}` are replaced; empty hides it. */
|
|
106
|
-
selectAllCountText: _angular_core.InputSignal<string>;
|
|
107
|
-
/** Placeholder text for the search input */
|
|
108
|
-
searchPlaceholderText: _angular_core.InputSignal<string>;
|
|
109
|
-
/** Text to display when no search results are found */
|
|
110
|
-
noSearchResultsText: _angular_core.InputSignal<string>;
|
|
111
|
-
/** Announced once a search settles. `{count}` is replaced by how many options matched. */
|
|
112
|
-
searchResultsText: _angular_core.InputSignal<string>;
|
|
113
117
|
/** Whether to show a backdrop that closes the dropdown when clicked */
|
|
114
118
|
showBackdrop: _angular_core.InputSignal<boolean>;
|
|
115
119
|
/** Whether the dropdown is disabled and cannot be opened */
|
|
@@ -150,9 +154,11 @@ declare class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {
|
|
|
150
154
|
protected readonly headerTopVisible: _angular_core.Signal<boolean>;
|
|
151
155
|
protected readonly headerVisible: _angular_core.Signal<boolean>;
|
|
152
156
|
private readonly internalItems;
|
|
157
|
+
private readonly itemTexts;
|
|
153
158
|
protected readonly filteredItems: _angular_core.WritableSignal<SelectionDropdownItem[]>;
|
|
159
|
+
private readonly searchResultCount;
|
|
154
160
|
/** What the live region holds. Empty outside a search: the list is on screen, unchanged. */
|
|
155
|
-
protected readonly resultsAnnouncement: _angular_core.
|
|
161
|
+
protected readonly resultsAnnouncement: _angular_core.Signal<string>;
|
|
156
162
|
protected readonly initiallySelectedItems: _angular_core.WritableSignal<SelectionDropdownItem[]>;
|
|
157
163
|
protected readonly selectedItems: _angular_core.Signal<SelectionDropdownItem[]>;
|
|
158
164
|
protected readonly unselectedItems: _angular_core.Signal<SelectionDropdownItem[]>;
|
|
@@ -224,6 +230,9 @@ declare class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {
|
|
|
224
230
|
/** Handles group toggle events, selecting/deselecting all items within the group */
|
|
225
231
|
onGroupToggle(groupLabel: string, checked: boolean): void;
|
|
226
232
|
onSelectAllToggle(checked: boolean): void;
|
|
233
|
+
/** The item's texts resolved in the current language. */
|
|
234
|
+
protected textsOf(item: SelectionDropdownItem): ItemTexts;
|
|
235
|
+
private groupOf;
|
|
227
236
|
/** Stable track key for a render entry (item or group). */
|
|
228
237
|
protected entryKey(entry: RenderEntry): string;
|
|
229
238
|
/**
|
|
@@ -234,7 +243,7 @@ declare class SelectionDropdownComponent implements DropdownOverlay, OnDestroy {
|
|
|
234
243
|
/** Updates the filtered items based on search term */
|
|
235
244
|
private updateFilteredItems;
|
|
236
245
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectionDropdownComponent, never>;
|
|
237
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectionDropdownComponent, "ap-selection-dropdown", never, { "
|
|
246
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectionDropdownComponent, "ap-selection-dropdown", never, { "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "headerButtonId": { "alias": "headerButtonId"; "required": false; "isSignal": true; }; "footerButtonId": { "alias": "footerButtonId"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "searchEnabled": { "alias": "searchEnabled"; "required": false; "isSignal": true; }; "footerButtonSymbolId": { "alias": "footerButtonSymbolId"; "required": false; "isSignal": true; }; "headerButtonSymbolId": { "alias": "headerButtonSymbolId"; "required": false; "isSignal": true; }; "selectAllEnabled": { "alias": "selectAllEnabled"; "required": false; "isSignal": true; }; "showBackdrop": { "alias": "showBackdrop"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "searchTerm": { "alias": "searchTerm"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "selectionChange": "selectionChange"; "footerButtonClick": "footerButtonClick"; "headerButtonClick": "headerButtonClick"; "searchInputChange": "searchInputChange"; "searchTerm": "searchTermChange"; }, ["trigger"], never, true, never>;
|
|
238
247
|
}
|
|
239
248
|
|
|
240
249
|
/**
|
|
@@ -256,4 +265,4 @@ declare class SelectionDropdownTriggerDirective {
|
|
|
256
265
|
}
|
|
257
266
|
|
|
258
267
|
export { SelectionDropdownComponent, SelectionDropdownTriggerDirective };
|
|
259
|
-
export type { SelectionDropdownItem };
|
|
268
|
+
export type { SelectionDropdownI18n, SelectionDropdownItem };
|
|
Binary file
|