@guildofgleks/ui 21.3.1 → 21.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1351 -0
- package/README.md +227 -57
- package/TOKENS.md +63 -0
- package/fesm2022/guildofgleks-ui.mjs +1246 -135
- package/fesm2022/guildofgleks-ui.mjs.map +1 -1
- package/package.json +12 -4
- package/src/styles/button.css +193 -0
- package/src/styles/index.css +2 -0
- package/src/styles/theme.css +26 -0
- package/styles/button.css +193 -0
- package/styles/fonts.css +16 -0
- package/styles/index.css +19 -0
- package/styles/presets/one-dark.css +48 -0
- package/styles/presets/one-light.css +47 -0
- package/styles/presets/slate.css +55 -0
- package/styles/theme.css +1687 -0
- package/styles/typography.css +15 -0
- package/styles/utilities.css +170 -0
- package/types/guildofgleks-ui.d.ts +901 -64
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, input, ChangeDetectionStrategy, Component, output, computed, DestroyRef,
|
|
2
|
+
import { InjectionToken, inject, input, ChangeDetectionStrategy, Component, output, computed, DestroyRef, booleanAttribute, Directive, isDevMode, TemplateRef, model, contentChild, ElementRef, signal, effect, untracked, PLATFORM_ID, ApplicationRef, viewChild, afterNextRender, Renderer2, viewChildren, contentChildren, forwardRef, Injectable, Injector, afterRenderEffect, ViewContainerRef, linkedSignal } from '@angular/core';
|
|
3
3
|
import { Subject, timer } from 'rxjs';
|
|
4
4
|
import { throttle } from 'rxjs/operators';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -118,7 +118,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
118
118
|
|
|
119
119
|
const DEFAULT_DEBOUNCE = 300;
|
|
120
120
|
/** Built-in default, used when neither the instance input nor `GOG_CONFIG` supplies one. */
|
|
121
|
-
const DEFAULT_SIZE$
|
|
121
|
+
const DEFAULT_SIZE$a = 'md';
|
|
122
122
|
class ButtonComponent {
|
|
123
123
|
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
124
124
|
/** Unset, falls back to `GOG_CONFIG.control.size`, then to `'md'`. */
|
|
@@ -157,7 +157,7 @@ class ButtonComponent {
|
|
|
157
157
|
};
|
|
158
158
|
globalConfig = inject(GOG_CONFIG);
|
|
159
159
|
/** Instance input → `GOG_CONFIG` → the component's own default. See `resolveConfigured`. */
|
|
160
|
-
resolvedSize = computed(() => resolveConfigured(this.size(), this.globalConfig.control?.size, DEFAULT_SIZE$
|
|
160
|
+
resolvedSize = computed(() => resolveConfigured(this.size(), this.globalConfig.control?.size, DEFAULT_SIZE$a), ...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
161
161
|
spinnerSize = computed(() => ButtonComponent.SPINNER_SIZE_BY_BUTTON_SIZE[this.resolvedSize()], ...(ngDevMode ? [{ debugName: "spinnerSize" }] : /* istanbul ignore next */ []));
|
|
162
162
|
resolvedDebounce = computed(() => resolveConfigured(this.debounce(), this.globalConfig.button?.debounce, DEFAULT_DEBOUNCE), ...(ngDevMode ? [{ debugName: "resolvedDebounce" }] : /* istanbul ignore next */ []));
|
|
163
163
|
/**
|
|
@@ -178,7 +178,7 @@ class ButtonComponent {
|
|
|
178
178
|
this.click$.next(event);
|
|
179
179
|
}
|
|
180
180
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ButtonComponent, isStandalone: true, selector: "gog-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gogClick: "gogClick" }, host: { properties: { "class.gog-host--full-width": "fullWidth()" } }, ngImport: i0, template: "<button\r\n (click)=\"onClick($event)\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [attr.aria-disabled]=\"isDisabled() && !isNativeDisabled() ? 'true' : null\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.disabled]=\"isNativeDisabled() ? true : null\"\r\n [class.gog-btn--ghost]=\"variant() === 'ghost'\"\r\n [class.gog-btn--loading]=\"loading()\"\r\n [class.gog-btn--outline]=\"variant() === 'outline'\"\r\n [class.gog-btn--primary]=\"variant() === 'primary'\"\r\n [class.gog-btn--secondary]=\"variant() === 'secondary'\"\r\n [class.gog-cursor-not-allowed]=\"isDisabled()\"\r\n [class.gog-cursor-pointer]=\"!isDisabled()\"\r\n [class.gog-cursor-wait]=\"loading()\"\r\n [type]=\"type()\"\r\n class=\"gog-btn gog-inline-center gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n>\r\n @if (loading()) {\r\n <gog-spinner [size]=\"spinnerSize()\" aria-hidden=\"true\" class=\"gog-btn__spinner\" />\r\n }\r\n\r\n <span [class.gog-btn__content--hidden]=\"loading()\" class=\"gog-btn__content\">\r\n <ng-content></ng-content>\r\n </span>\r\n</button>\r\n", styles: ["
|
|
181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ButtonComponent, isStandalone: true, selector: "gog-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { gogClick: "gogClick" }, host: { properties: { "class.gog-host--full-width": "fullWidth()" } }, ngImport: i0, template: "<button\r\n (click)=\"onClick($event)\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [attr.aria-disabled]=\"isDisabled() && !isNativeDisabled() ? 'true' : null\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.disabled]=\"isNativeDisabled() ? true : null\"\r\n [class.gog-btn--ghost]=\"variant() === 'ghost'\"\r\n [class.gog-btn--loading]=\"loading()\"\r\n [class.gog-btn--outline]=\"variant() === 'outline'\"\r\n [class.gog-btn--primary]=\"variant() === 'primary'\"\r\n [class.gog-btn--secondary]=\"variant() === 'secondary'\"\r\n [class.gog-cursor-not-allowed]=\"isDisabled()\"\r\n [class.gog-cursor-pointer]=\"!isDisabled()\"\r\n [class.gog-cursor-wait]=\"loading()\"\r\n [type]=\"type()\"\r\n class=\"gog-btn gog-inline-center gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n>\r\n @if (loading()) {\r\n <gog-spinner [size]=\"spinnerSize()\" aria-hidden=\"true\" class=\"gog-btn__spinner\" />\r\n }\r\n\r\n <span [class.gog-btn__content--hidden]=\"loading()\" class=\"gog-btn__content\">\r\n <ng-content></ng-content>\r\n </span>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host(.gog-host--full-width){display:flex}:host(.gog-host--full-width) .gog-btn{width:100%}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "gog-spinner", inputs: ["size", "overlay", "ariaLabel", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
182
182
|
}
|
|
183
183
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
184
184
|
type: Component,
|
|
@@ -186,9 +186,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
186
186
|
// Drives the :host(.gog-host--full-width) rules in the stylesheet — without this
|
|
187
187
|
// binding the `fullWidth` input has no visible effect.
|
|
188
188
|
'[class.gog-host--full-width]': 'fullWidth()',
|
|
189
|
-
}, template: "<button\r\n (click)=\"onClick($event)\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [attr.aria-disabled]=\"isDisabled() && !isNativeDisabled() ? 'true' : null\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.disabled]=\"isNativeDisabled() ? true : null\"\r\n [class.gog-btn--ghost]=\"variant() === 'ghost'\"\r\n [class.gog-btn--loading]=\"loading()\"\r\n [class.gog-btn--outline]=\"variant() === 'outline'\"\r\n [class.gog-btn--primary]=\"variant() === 'primary'\"\r\n [class.gog-btn--secondary]=\"variant() === 'secondary'\"\r\n [class.gog-cursor-not-allowed]=\"isDisabled()\"\r\n [class.gog-cursor-pointer]=\"!isDisabled()\"\r\n [class.gog-cursor-wait]=\"loading()\"\r\n [type]=\"type()\"\r\n class=\"gog-btn gog-inline-center gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n>\r\n @if (loading()) {\r\n <gog-spinner [size]=\"spinnerSize()\" aria-hidden=\"true\" class=\"gog-btn__spinner\" />\r\n }\r\n\r\n <span [class.gog-btn__content--hidden]=\"loading()\" class=\"gog-btn__content\">\r\n <ng-content></ng-content>\r\n </span>\r\n</button>\r\n", styles: ["
|
|
189
|
+
}, template: "<button\r\n (click)=\"onClick($event)\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [attr.aria-disabled]=\"isDisabled() && !isNativeDisabled() ? 'true' : null\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n [attr.disabled]=\"isNativeDisabled() ? true : null\"\r\n [class.gog-btn--ghost]=\"variant() === 'ghost'\"\r\n [class.gog-btn--loading]=\"loading()\"\r\n [class.gog-btn--outline]=\"variant() === 'outline'\"\r\n [class.gog-btn--primary]=\"variant() === 'primary'\"\r\n [class.gog-btn--secondary]=\"variant() === 'secondary'\"\r\n [class.gog-cursor-not-allowed]=\"isDisabled()\"\r\n [class.gog-cursor-pointer]=\"!isDisabled()\"\r\n [class.gog-cursor-wait]=\"loading()\"\r\n [type]=\"type()\"\r\n class=\"gog-btn gog-inline-center gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n>\r\n @if (loading()) {\r\n <gog-spinner [size]=\"spinnerSize()\" aria-hidden=\"true\" class=\"gog-btn__spinner\" />\r\n }\r\n\r\n <span [class.gog-btn__content--hidden]=\"loading()\" class=\"gog-btn__content\">\r\n <ng-content></ng-content>\r\n </span>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host(.gog-host--full-width){display:flex}:host(.gog-host--full-width) .gog-btn{width:100%}\n"] }]
|
|
190
190
|
}], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], gogClick: [{ type: i0.Output, args: ["gogClick"] }] } });
|
|
191
191
|
|
|
192
|
+
/** Built-in default, used when neither the instance input nor `GOG_CONFIG` supplies one. */
|
|
193
|
+
const DEFAULT_SIZE$9 = 'md';
|
|
194
|
+
/**
|
|
195
|
+
* Makes a consumer's own `<a>` or `<button>` look like a `gog-button`.
|
|
196
|
+
*
|
|
197
|
+
* ```html
|
|
198
|
+
* <a gogButton routerLink="/pricing">See pricing</a>
|
|
199
|
+
* <a gogButton variant="ghost" href="https://example.com" target="_blank" rel="noreferrer">Docs</a>
|
|
200
|
+
* <button gogButton variant="outline" size="sm" type="submit">Save</button>
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* ## Why this exists next to `gog-button`
|
|
204
|
+
*
|
|
205
|
+
* `gog-button` renders its own `<button>`, so it can never *be* a link — and making it one would
|
|
206
|
+
* mean brokering the router's entire input surface (`routerLink`, `routerLinkActive`,
|
|
207
|
+
* `queryParams`, `fragment`, `state`, …) through a component that would then have to depend on
|
|
208
|
+
* `@angular/router`. This package has four peer dependencies and no router, and a navigation
|
|
209
|
+
* button is not worth a fifth.
|
|
210
|
+
*
|
|
211
|
+
* Inverting it costs nothing: the consumer keeps their own element, so `routerLink`, `href`,
|
|
212
|
+
* `target`, `download`, `type="submit"`, `disabled` and every future directive keep working
|
|
213
|
+
* because they were never taken away. This is the "headless primitive" axis of
|
|
214
|
+
* `api-design.instructions.md` — expose the behaviour, not another input.
|
|
215
|
+
*
|
|
216
|
+
* ## Which to use
|
|
217
|
+
*
|
|
218
|
+
* Use `gog-button` for a button that *does* something in the page — it adds `loading` with a
|
|
219
|
+
* centred spinner, `debounce` click throttling and the `gogClick` output, none of which a bare
|
|
220
|
+
* element can provide. Use `[gogButton]` when the element must be a link, or when you need to
|
|
221
|
+
* keep directives of your own on it.
|
|
222
|
+
*
|
|
223
|
+
* ## Accessibility
|
|
224
|
+
*
|
|
225
|
+
* The element stays yours, so its semantics stay correct by construction: a link is a link and a
|
|
226
|
+
* button is a button. Two things this deliberately does **not** do:
|
|
227
|
+
*
|
|
228
|
+
* - It does not add `disabled` handling to an `<a>`. There is no such thing — a disabled link is
|
|
229
|
+
* just a link. Remove the `href` or render a real `<button>`.
|
|
230
|
+
* - It does not fake a loading state. `gog-button`'s spinner is a projected child; a directive
|
|
231
|
+
* cannot add one without taking over the element's content.
|
|
232
|
+
*/
|
|
233
|
+
class GogButtonDirective {
|
|
234
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
235
|
+
/** Unset, falls back to `GOG_CONFIG.control.size`, then to `'md'` — as on `gog-button`. */
|
|
236
|
+
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
237
|
+
/**
|
|
238
|
+
* Stretches the element to its container's width. A bare attribute is enough:
|
|
239
|
+
* `<a gogButton fullWidth>`.
|
|
240
|
+
*/
|
|
241
|
+
fullWidth = input(false, { ...(ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
242
|
+
globalConfig = inject(GOG_CONFIG);
|
|
243
|
+
resolvedSize = computed(() => resolveConfigured(this.size(), this.globalConfig.control?.size, DEFAULT_SIZE$9), ...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
244
|
+
variantClass = computed(() => `gog-btn--${this.variant()}`, ...(ngDevMode ? [{ debugName: "variantClass" }] : /* istanbul ignore next */ []));
|
|
245
|
+
/**
|
|
246
|
+
* Unlike `gog-button`, this emits a class for `'md'` too. The component can leave the default
|
|
247
|
+
* size unclassed because its own stylesheet bottoms out at `--gog-btn-md-*`; here the class is
|
|
248
|
+
* also what a consumer reads in devtools to see which size is applied, and a silently absent
|
|
249
|
+
* one reads as "no size resolved".
|
|
250
|
+
*/
|
|
251
|
+
sizeClass = computed(() => `gog-btn--${this.resolvedSize()}`, ...(ngDevMode ? [{ debugName: "sizeClass" }] : /* istanbul ignore next */ []));
|
|
252
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: GogButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
253
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: GogButtonDirective, isStandalone: true, selector: "a[gogButton], button[gogButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "variantClass() + \" \" + sizeClass()", "class.gog-btn--full-width": "fullWidth()" }, classAttribute: "gog-btn gog-inline-center gog-contained-layout" }, ngImport: i0 });
|
|
254
|
+
}
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: GogButtonDirective, decorators: [{
|
|
256
|
+
type: Directive,
|
|
257
|
+
args: [{
|
|
258
|
+
// Restricted to `a` and `button` rather than a bare `[gogButton]`: on a `<div>` or `<span>` the
|
|
259
|
+
// result looks like a button and is invisible to the keyboard and to assistive tech, and that
|
|
260
|
+
// is exactly the mistake this directive would otherwise make easy.
|
|
261
|
+
selector: 'a[gogButton], button[gogButton]',
|
|
262
|
+
host: {
|
|
263
|
+
class: 'gog-btn gog-inline-center gog-contained-layout',
|
|
264
|
+
'[class]': 'variantClass() + " " + sizeClass()',
|
|
265
|
+
'[class.gog-btn--full-width]': 'fullWidth()',
|
|
266
|
+
},
|
|
267
|
+
}]
|
|
268
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }] } });
|
|
269
|
+
|
|
192
270
|
const VERTICAL_ARROWS = ['ArrowDown', 'ArrowUp'];
|
|
193
271
|
const HORIZONTAL_ARROWS = ['ArrowRight', 'ArrowLeft'];
|
|
194
272
|
const EDGE_KEYS = ['Home', 'End'];
|
|
@@ -273,6 +351,31 @@ function handleRovingFocusKeydown(event, items, options = {}) {
|
|
|
273
351
|
return true;
|
|
274
352
|
}
|
|
275
353
|
|
|
354
|
+
/*
|
|
355
|
+
* The glyphs are from **Lucide** (https://lucide.dev), ISC licensed:
|
|
356
|
+
*
|
|
357
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather
|
|
358
|
+
* (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
359
|
+
*
|
|
360
|
+
* Permission to use, copy, modify, and/or distribute this software for any purpose with or
|
|
361
|
+
* without fee is hereby granted, provided that the above copyright notice and this permission
|
|
362
|
+
* notice appear in all copies.
|
|
363
|
+
*
|
|
364
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
|
365
|
+
* THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
|
|
366
|
+
* SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR
|
|
367
|
+
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
|
368
|
+
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
|
369
|
+
* OR PERFORMANCE OF THIS SOFTWARE.
|
|
370
|
+
*
|
|
371
|
+
* They are inlined rather than pulled from `lucide` so the package keeps zero runtime
|
|
372
|
+
* dependencies. Anything added here must be a Lucide glyph too: a 24×24 grid, `stroke-width`
|
|
373
|
+
* 2, round caps and joins. Mixing in a set drawn for a different weight (Heroicons is drawn for
|
|
374
|
+
* 1.5) shows up immediately as uneven visual mass in a row of icons.
|
|
375
|
+
*
|
|
376
|
+
* An app that wants a different set does not need a fork — `provideGogIcons` overrides any of
|
|
377
|
+
* these by name.
|
|
378
|
+
*/
|
|
276
379
|
const ICON_DEFS = {
|
|
277
380
|
check: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check-icon lucide-check"><path d="M20 6 9 17l-5-5"/></svg>`,
|
|
278
381
|
close: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x-icon lucide-x"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`,
|
|
@@ -294,38 +397,150 @@ const ICON_DEFS = {
|
|
|
294
397
|
eye: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye-icon lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></svg>`,
|
|
295
398
|
'eye-off': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye-off-icon lucide-eye-off"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/></svg>`,
|
|
296
399
|
copy: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy-icon lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,
|
|
400
|
+
/* ── Actions ─────────────────────────────────────────────────────────────── */
|
|
401
|
+
search: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`,
|
|
402
|
+
plus: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,
|
|
403
|
+
minus: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-minus"><path d="M5 12h14"/></svg>`,
|
|
404
|
+
trash: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash-2"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></svg>`,
|
|
405
|
+
pencil: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pencil"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/></svg>`,
|
|
406
|
+
download: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,
|
|
407
|
+
upload: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-upload"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" x2="12" y1="3" y2="15"/></svg>`,
|
|
408
|
+
refresh: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>`,
|
|
409
|
+
filter: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-filter"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/></svg>`,
|
|
410
|
+
'external-link': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-external-link"><path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/></svg>`,
|
|
411
|
+
/* ── Navigation & chrome ─────────────────────────────────────────────────── */
|
|
412
|
+
menu: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-menu"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>`,
|
|
413
|
+
'more-horizontal': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>`,
|
|
414
|
+
'more-vertical': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis-vertical"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>`,
|
|
415
|
+
'arrow-left': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left"><path d="m12 19-7-7 7-7"/><path d="M19 12H5"/></svg>`,
|
|
416
|
+
'arrow-right': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>`,
|
|
417
|
+
/* ── Objects & state ─────────────────────────────────────────────────────── */
|
|
418
|
+
user: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>`,
|
|
419
|
+
settings: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>`,
|
|
420
|
+
lock: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lock"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>`,
|
|
421
|
+
mail: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/></svg>`,
|
|
422
|
+
star: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>`,
|
|
423
|
+
'star-filled': `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor"/></svg>`,
|
|
297
424
|
};
|
|
298
425
|
|
|
426
|
+
/**
|
|
427
|
+
* Icons an app has registered, keyed by the name `gog-icon` will be asked for. Resolves to `{}`
|
|
428
|
+
* — only the built-ins are available — until a `provideGogIcons(...)` call fills it in.
|
|
429
|
+
*
|
|
430
|
+
* Values are raw `<svg>` markup, injected with `bypassSecurityTrustHtml` exactly like the
|
|
431
|
+
* built-ins. See `provideGogIcons` for what that means for you.
|
|
432
|
+
*/
|
|
433
|
+
const GOG_ICONS = new InjectionToken('GOG_ICONS', {
|
|
434
|
+
providedIn: 'root',
|
|
435
|
+
factory: () => ({}),
|
|
436
|
+
});
|
|
437
|
+
/**
|
|
438
|
+
* Registers icons by name, so `<gog-icon name="cart" />` works for glyphs the library does not
|
|
439
|
+
* ship. This is the supported way to use your own icon set: the alternative — a `TemplateRef`
|
|
440
|
+
* per instance through the `template` input — costs a `<ng-template>` at every use site and is
|
|
441
|
+
* meant for one-offs, not for an icon set.
|
|
442
|
+
*
|
|
443
|
+
* ```ts
|
|
444
|
+
* // app.config.ts
|
|
445
|
+
* providers: [
|
|
446
|
+
* provideGogIcons({
|
|
447
|
+
* cart: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">…</svg>',
|
|
448
|
+
* user: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">…</svg>',
|
|
449
|
+
* }),
|
|
450
|
+
* ]
|
|
451
|
+
* ```
|
|
452
|
+
*
|
|
453
|
+
* **A registered name overrides a built-in of the same name**, which is how you swap the
|
|
454
|
+
* library's checkmark or chevron for your own without touching every component that renders one.
|
|
455
|
+
*
|
|
456
|
+
* **Providing this again further down the injector tree layers onto the parent's set** rather
|
|
457
|
+
* than replacing it, matching `provideGogConfig`: a lazy feature can register the three icons
|
|
458
|
+
* only it uses, and the app-wide set stays available inside it.
|
|
459
|
+
*
|
|
460
|
+
* ## What to put in the SVG
|
|
461
|
+
*
|
|
462
|
+
* Use `stroke="currentColor"` (or `fill="currentColor"`) and a `viewBox`, and leave the sizing
|
|
463
|
+
* alone — `gog-icon`'s stylesheet drives width, height and stroke width from the
|
|
464
|
+
* `--gog-icon-*` tokens, so an icon inherits size and colour from wherever it is used, the same
|
|
465
|
+
* as a built-in.
|
|
466
|
+
*
|
|
467
|
+
* ## Security
|
|
468
|
+
*
|
|
469
|
+
* The markup is inserted with `DomSanitizer.bypassSecurityTrustHtml`, because Angular's HTML
|
|
470
|
+
* sanitizer strips SVG and would leave you with nothing. That is safe for what this is for —
|
|
471
|
+
* static icon markup you wrote or imported at build time — and unsafe for anything derived from
|
|
472
|
+
* user input or fetched at runtime. **Never build a registered icon string from data you did
|
|
473
|
+
* not author.** If you need remote icons, fetch them yourself, sanitize them with a real SVG
|
|
474
|
+
* sanitizer, and register the result.
|
|
475
|
+
*/
|
|
476
|
+
function provideGogIcons(icons) {
|
|
477
|
+
return {
|
|
478
|
+
provide: GOG_ICONS,
|
|
479
|
+
// skipSelf so this reads the *parent* injector's set rather than recursing into the provider
|
|
480
|
+
// being defined here; optional because at the root there is no parent providing it.
|
|
481
|
+
useFactory: () => ({
|
|
482
|
+
...(inject(GOG_ICONS, { skipSelf: true, optional: true }) ?? {}),
|
|
483
|
+
...icons,
|
|
484
|
+
}),
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Names already warned about, so a missing icon rendered in a `@for` logs once rather than once
|
|
490
|
+
* per row. Module-level because the point is one message per name per page, not per component.
|
|
491
|
+
*/
|
|
492
|
+
const warnedNames = new Set();
|
|
299
493
|
class IconComponent {
|
|
300
494
|
sanitizer = inject(DomSanitizer);
|
|
495
|
+
/** App-registered icons; overrides a built-in of the same name. See `provideGogIcons`. */
|
|
496
|
+
registered = inject(GOG_ICONS);
|
|
497
|
+
/** A built-in name, or one registered through `provideGogIcons(...)`. */
|
|
301
498
|
name = input('close', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
302
499
|
template = input(null, ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
|
|
303
500
|
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
304
501
|
ariaHidden = input(true, ...(ngDevMode ? [{ debugName: "ariaHidden" }] : /* istanbul ignore next */ []));
|
|
305
502
|
ariaLabel = computed(() => this.ariaHidden() ? null : this.title() || this.name(), ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
306
|
-
|
|
503
|
+
/**
|
|
504
|
+
* The markup to render, or `null` when the name resolves to nothing.
|
|
505
|
+
*
|
|
506
|
+
* An unknown name renders **nothing** and warns in dev mode — it never throws. An icon is
|
|
507
|
+
* decoration: taking an app down mid-render over a typo in a glyph name would be a far worse
|
|
508
|
+
* failure than the missing glyph, and the warning is what gets the typo fixed.
|
|
509
|
+
*/
|
|
510
|
+
iconSvg = computed(() => {
|
|
511
|
+
const name = this.name();
|
|
512
|
+
const markup = this.registered[name] ?? ICON_DEFS[name];
|
|
513
|
+
if (!markup) {
|
|
514
|
+
if (isDevMode() && !warnedNames.has(name)) {
|
|
515
|
+
warnedNames.add(name);
|
|
516
|
+
console.warn(`[gog-icon] No icon named "${name}". Register it with provideGogIcons({ '${name}': '<svg…>' }), or use one of the built-ins.`);
|
|
517
|
+
}
|
|
518
|
+
return null;
|
|
519
|
+
}
|
|
520
|
+
return this.sanitizer.bypassSecurityTrustHtml(markup);
|
|
521
|
+
}, ...(ngDevMode ? [{ debugName: "iconSvg" }] : /* istanbul ignore next */ []));
|
|
307
522
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
308
523
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: IconComponent, isStandalone: true, selector: "gog-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "ariaHidden", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-hidden": "ariaHidden() ? \"true\" : null", "attr.aria-label": "ariaHidden() ? null : ariaLabel()" }, classAttribute: "gog-icon" }, ngImport: i0, template: `
|
|
309
524
|
@if (template(); as iconTpl) {
|
|
310
525
|
<ng-container *ngTemplateOutlet="iconTpl" />
|
|
311
|
-
} @else {
|
|
312
|
-
<span [innerHTML]="
|
|
526
|
+
} @else if (iconSvg(); as svg) {
|
|
527
|
+
<span [innerHTML]="svg"></span>
|
|
313
528
|
}
|
|
314
|
-
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}:host ::ng-deep svg{width:var(--gog-icon-size, var(--gog-icon-fallback-size));height:var(--gog-icon-size, var(--gog-icon-fallback-size));display:block;color:currentColor}:host ::ng-deep svg path,:host ::ng-deep svg circle,:host ::ng-deep svg rect{stroke-width:var(--gog-icon-stroke-width)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
529
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}:host ::ng-deep svg{width:var(--gog-icon-size, var(--gog-icon-fallback-size));height:var(--gog-icon-size, var(--gog-icon-fallback-size));display:block;color:currentColor}:host ::ng-deep svg path,:host ::ng-deep svg circle,:host ::ng-deep svg rect,:host ::ng-deep svg ellipse,:host ::ng-deep svg line,:host ::ng-deep svg polyline,:host ::ng-deep svg polygon{stroke-width:var(--gog-icon-stroke-width)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
315
530
|
}
|
|
316
531
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: IconComponent, decorators: [{
|
|
317
532
|
type: Component,
|
|
318
533
|
args: [{ selector: 'gog-icon', imports: [NgTemplateOutlet], template: `
|
|
319
534
|
@if (template(); as iconTpl) {
|
|
320
535
|
<ng-container *ngTemplateOutlet="iconTpl" />
|
|
321
|
-
} @else {
|
|
322
|
-
<span [innerHTML]="
|
|
536
|
+
} @else if (iconSvg(); as svg) {
|
|
537
|
+
<span [innerHTML]="svg"></span>
|
|
323
538
|
}
|
|
324
539
|
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
325
540
|
class: 'gog-icon',
|
|
326
541
|
'[attr.aria-hidden]': 'ariaHidden() ? "true" : null',
|
|
327
542
|
'[attr.aria-label]': 'ariaHidden() ? null : ariaLabel()',
|
|
328
|
-
}, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}:host ::ng-deep svg{width:var(--gog-icon-size, var(--gog-icon-fallback-size));height:var(--gog-icon-size, var(--gog-icon-fallback-size));display:block;color:currentColor}:host ::ng-deep svg path,:host ::ng-deep svg circle,:host ::ng-deep svg rect{stroke-width:var(--gog-icon-stroke-width)}\n"] }]
|
|
543
|
+
}, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0}:host ::ng-deep svg{width:var(--gog-icon-size, var(--gog-icon-fallback-size));height:var(--gog-icon-size, var(--gog-icon-fallback-size));display:block;color:currentColor}:host ::ng-deep svg path,:host ::ng-deep svg circle,:host ::ng-deep svg rect,:host ::ng-deep svg ellipse,:host ::ng-deep svg line,:host ::ng-deep svg polyline,:host ::ng-deep svg polygon{stroke-width:var(--gog-icon-stroke-width)}\n"] }]
|
|
329
544
|
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaHidden", required: false }] }] } });
|
|
330
545
|
|
|
331
546
|
class SkeletonComponent {
|
|
@@ -755,23 +970,25 @@ function resolveCssLengthPx(value, viewportHeight) {
|
|
|
755
970
|
class GogClearableState {
|
|
756
971
|
clearableInput;
|
|
757
972
|
hasValue;
|
|
758
|
-
|
|
973
|
+
isNotEditable;
|
|
759
974
|
config;
|
|
760
975
|
fallback;
|
|
761
976
|
/**
|
|
762
977
|
* @param clearableInput the control's own `clearable` input (`undefined` when unset)
|
|
763
978
|
* @param hasValue whether there is anything to clear
|
|
764
|
-
* @param
|
|
979
|
+
* @param isNotEditable whether the control currently refuses edits — disabled, or (for the
|
|
980
|
+
* text controls) read-only. Either way it offers no clear button: the affordance would
|
|
981
|
+
* promise a change the control won't accept.
|
|
765
982
|
* @param config the injected `GOG_CONFIG`
|
|
766
983
|
* @param fallback the control's own default, read lazily — `GogDropdownBase` constructs this
|
|
767
984
|
* in a field initializer, before its subclass has assigned `clearableByDefault`. `false`
|
|
768
985
|
* everywhere except `gog-multiselect`, which shipped a clear button before this input
|
|
769
986
|
* existed and keeps it.
|
|
770
987
|
*/
|
|
771
|
-
constructor(clearableInput, hasValue,
|
|
988
|
+
constructor(clearableInput, hasValue, isNotEditable, config, fallback) {
|
|
772
989
|
this.clearableInput = clearableInput;
|
|
773
990
|
this.hasValue = hasValue;
|
|
774
|
-
this.
|
|
991
|
+
this.isNotEditable = isNotEditable;
|
|
775
992
|
this.config = config;
|
|
776
993
|
this.fallback = fallback;
|
|
777
994
|
}
|
|
@@ -782,7 +999,7 @@ class GogClearableState {
|
|
|
782
999
|
* shows nothing to clear until there is something to clear, so the affordance appears with the
|
|
783
1000
|
* content rather than sitting there permanently as dead chrome.
|
|
784
1001
|
*/
|
|
785
|
-
isVisible = computed(() => this.enabled() && this.hasValue() && !this.
|
|
1002
|
+
isVisible = computed(() => this.enabled() && this.hasValue() && !this.isNotEditable(), ...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
|
|
786
1003
|
}
|
|
787
1004
|
|
|
788
1005
|
/**
|
|
@@ -982,6 +1199,7 @@ const DEFAULT_APPEND_TO_BODY$1 = false;
|
|
|
982
1199
|
const DEFAULT_DROPDOWN_DIRECTION = 'auto';
|
|
983
1200
|
const DEFAULT_FILTER = false;
|
|
984
1201
|
const DEFAULT_FILTER_POSITION = 'top';
|
|
1202
|
+
const DEFAULT_CLEAR_SELECTION_LABEL = 'Clear selection';
|
|
985
1203
|
/**
|
|
986
1204
|
* Shared behaviour for the listbox-style controls: open/close, placement, the
|
|
987
1205
|
* append-to-body overlay, click-outside, keyboard navigation and `ControlValueAccessor`
|
|
@@ -1017,8 +1235,13 @@ class GogDropdownBase {
|
|
|
1017
1235
|
* `GOG_CONFIG.control.clearable`, then to the control's own default.
|
|
1018
1236
|
*/
|
|
1019
1237
|
clearable = input(undefined, ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
1020
|
-
/**
|
|
1021
|
-
|
|
1238
|
+
/**
|
|
1239
|
+
* Accessible name for the clear button. Unset, falls back to
|
|
1240
|
+
* `GOG_CONFIG.labels.clearSelection`, then to `'Clear selection'`.
|
|
1241
|
+
*/
|
|
1242
|
+
clearAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1243
|
+
/** Instance input → `GOG_CONFIG.labels` → the built-in English default. */
|
|
1244
|
+
resolvedClearLabel = computed(() => resolveConfigured(this.clearAriaLabel(), this.globalConfig.labels?.clearSelection, DEFAULT_CLEAR_SELECTION_LABEL), ...(ngDevMode ? [{ debugName: "resolvedClearLabel" }] : /* istanbul ignore next */ []));
|
|
1022
1245
|
/**
|
|
1023
1246
|
* Smallest width the trigger may shrink to, as any CSS length. Only meaningful with
|
|
1024
1247
|
* `[fullWidth]="false"`, where the trigger otherwise sizes to whatever is currently selected
|
|
@@ -1137,7 +1360,13 @@ class GogDropdownBase {
|
|
|
1137
1360
|
panelMaxHeightToken = '--gog-dropdown-panel-max-height';
|
|
1138
1361
|
/** Estimated row height fed into the placement math; not a real layout property. */
|
|
1139
1362
|
optionHeightToken = '--gog-dropdown-option-height';
|
|
1140
|
-
/**
|
|
1363
|
+
/**
|
|
1364
|
+
* Unique per-instance suffix, so several dropdowns on a page can't collide on DOM ids.
|
|
1365
|
+
*
|
|
1366
|
+
* Deliberately a bare number rather than `nextGogControlId()` (which the single-element
|
|
1367
|
+
* controls use): each subclass derives *several* ids from this one instance — trigger,
|
|
1368
|
+
* listbox, label, error — so what it needs is the instance number, not one finished id.
|
|
1369
|
+
*/
|
|
1141
1370
|
uid = ++GogDropdownBase.nextUid;
|
|
1142
1371
|
elRef = inject((ElementRef));
|
|
1143
1372
|
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
@@ -1145,6 +1374,7 @@ class GogDropdownBase {
|
|
|
1145
1374
|
appRef = inject(ApplicationRef);
|
|
1146
1375
|
destroyRef = inject(DestroyRef);
|
|
1147
1376
|
ngControl = inject(NgControl, { optional: true, self: true });
|
|
1377
|
+
/** `protected` so subclasses can resolve their own inputs against the same config object. */
|
|
1148
1378
|
globalConfig = inject(GOG_CONFIG);
|
|
1149
1379
|
overlay = new GogDropdownOverlay(this.appRef, this.document);
|
|
1150
1380
|
/** Set from `(focus)`/`(blur)` on the trigger — see `onFocusIn`/`onFocusOut`. */
|
|
@@ -2223,14 +2453,14 @@ class AutocompleteComponent extends GogDropdownBase {
|
|
|
2223
2453
|
}
|
|
2224
2454
|
}
|
|
2225
2455
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2226
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: AutocompleteComponent, isStandalone: true, selector: "gog-autocomplete", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, filterLocal: { classPropertyName: "filterLocal", publicName: "filterLocal", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, openOnFocus: { classPropertyName: "openOnFocus", publicName: "openOnFocus", isSignal: true, isRequired: false, transformFunction: null }, searchDebounce: { classPropertyName: "searchDebounce", publicName: "searchDebounce", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, forceSelection: { classPropertyName: "forceSelection", publicName: "forceSelection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", gogSearch: "gogSearch", gogLoadMore: "gogLoadMore" }, host: { properties: { "style.--gog-autocomplete-min-width": "minWidth()" } }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-autocomplete\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-autocomplete--clearable]=\"showClear()\"\r\n [class.gog-autocomplete--disabled]=\"isDisabled()\"\r\n [class.gog-autocomplete--open]=\"isOpen()\"\r\n [class.gog-autocomplete--loading]=\"loading()\"\r\n [class.gog-autocomplete--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-autocomplete--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-autocomplete--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-autocomplete--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-autocomplete__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-autocomplete__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-autocomplete__label gog-autocomplete__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <!--\r\n The input *is* the combobox \u2014 role, aria-autocomplete and aria-activedescendant all sit\r\n here, and DOM focus never leaves it. That is the difference from gog-select, where the\r\n trigger is a button and focus moves onto the option itself.\r\n -->\r\n <input\r\n type=\"text\"\r\n class=\"gog-autocomplete__control\"\r\n autocomplete=\"off\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [value]=\"query()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || null\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (focus)=\"onInputFocus()\"\r\n (blur)=\"onInputBlur()\"\r\n />\r\n\r\n <span class=\"gog-autocomplete__actions\">\r\n @if (loading()) {\r\n <gog-spinner class=\"gog-autocomplete__spinner\" size=\"xsm\" ariaLabel=\"Loading\" />\r\n }\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-autocomplete__clear gog-inline-center\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-autocomplete__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes \u2014 inline, or stamped into <body> by the overlay when\r\n `appendToBody` is set, which is why the portal modifier and the resolved coordinates are\r\n applied conditionally.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation; the keyboard contract lives on the combobox input, which keeps focus and drives this list via aria-activedescendant -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-autocomplete__dropdown\"\r\n [class.gog-autocomplete__dropdown--up]=\"\r\n !resolvedAppendToBody() && dropdownDirectionState() === 'up'\r\n \"\r\n [class.gog-autocomplete__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-label]=\"label() || ariaLabel() || null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-autocomplete__scroll\"\r\n (gogReachEnd)=\"gogLoadMore.emit()\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-autocomplete__empty\">{{ emptyMessage() }}</p>\r\n }\r\n\r\n @for (option of visibleOptions(); track valueOf(option); let i = $index) {\r\n <!--\r\n A div, not a button: focus stays in the input, so these rows are never focused and a\r\n button would only add tab stops and a second Enter handler. The highlight is pointed\r\n at with aria-activedescendant instead.\r\n\r\n mousedown is prevented so clicking a row doesn't blur the input first \u2014 that blur\r\n would close the panel and, under forceSelection, wipe the text before the click lands.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- this is the ARIA combobox pattern: the option is deliberately neither focusable nor a keyboard target, because focus stays in the input and the whole keyboard contract (arrows, Enter, Escape) is handled there and communicated through aria-activedescendant. Making these rows focusable would break the pattern rather than improve it. -->\r\n <div\r\n class=\"gog-autocomplete__option\"\r\n role=\"option\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-autocomplete__option--active]=\"i === activeIndex()\"\r\n [class.gog-autocomplete__option--selected]=\"isSelected(option)\"\r\n [class.gog-autocomplete__option--disabled]=\"isOptionDisabled(option)\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"onOptionClick(option, $event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"slot.templateRef\"\r\n [ngTemplateOutletContext]=\"optionContext(option, isSelected(option))\"\r\n />\r\n } @else {\r\n <span class=\"gog-autocomplete__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </div>\r\n }\r\n </gog-scroll>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-autocomplete{display:flex;flex-direction:column;gap:var(--gog-autocomplete-gap);width:100%}.gog-autocomplete__label{color:var(--gog-autocomplete-label-color);font-family:var(--gog-autocomplete-label-font-family);font-size:var(--gog-autocomplete-label-font-size);font-weight:var(--gog-autocomplete-label-font-weight);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-autocomplete-min-width)}.gog-autocomplete__control{box-sizing:border-box;width:100%;min-width:var(--gog-autocomplete-min-width);padding:var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-actions-reserve) var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-autocomplete-border-width) var(--gog-autocomplete-border-style) var(--gog-autocomplete-border-color);border-radius:var(--gog-autocomplete-radius);background-color:var(--gog-autocomplete-bg, var(--gog-autocomplete-field-bg));color:var(--gog-autocomplete-color, var(--gog-autocomplete-text-color));font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-autocomplete-line-height);transition:border-color var(--gog-autocomplete-transition-duration) var(--gog-easing),box-shadow var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete__control::placeholder{color:var(--gog-autocomplete-placeholder-color)}.gog-autocomplete__control:hover:not(:disabled){border-color:var(--gog-autocomplete-hover-border-color)}.gog-autocomplete__control:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__control:disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete--error .gog-autocomplete__control,.gog-autocomplete__control[aria-invalid=true]{border-color:var(--gog-autocomplete-error-border-color)}.gog-autocomplete__actions{position:absolute;inset-inline-end:var(--gog-autocomplete-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-autocomplete-actions-gap);pointer-events:none}.gog-autocomplete__actions>*{pointer-events:auto}.gog-autocomplete__clear{padding:0;border:0;background:none;color:var(--gog-autocomplete-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-autocomplete-clear-icon-ratio));cursor:pointer}.gog-autocomplete__clear:hover{color:var(--gog-autocomplete-clear-hover-color)}.gog-autocomplete__clear:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__spinner{font-size:var(--gog-autocomplete-spinner-size)}.gog-autocomplete__error{color:var(--gog-autocomplete-error-color);font-family:var(--gog-autocomplete-error-font-family);font-size:var(--gog-autocomplete-error-font-size)}.gog-autocomplete__dropdown{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-autocomplete-panel-gap));z-index:var(--gog-dropdown-z);box-sizing:border-box;display:flex;flex-direction:column;width:max-content;min-width:100%;max-width:var(--gog-autocomplete-panel-max-width);max-height:var(--gog-autocomplete-panel-max-height);padding:var(--gog-autocomplete-options-padding);border:var(--gog-autocomplete-panel-border-width) var(--gog-autocomplete-panel-border-style) var(--gog-autocomplete-panel-border-color);border-radius:var(--gog-autocomplete-panel-radius);background-color:var(--gog-autocomplete-panel-bg);box-shadow:var(--gog-autocomplete-panel-shadow);overflow:hidden}.gog-autocomplete__dropdown--up{top:auto;bottom:calc(100% + var(--gog-autocomplete-panel-gap))}.gog-autocomplete__dropdown--portal{position:fixed;top:0;inset-inline-start:0;min-width:0}.gog-autocomplete__scroll{flex:1;min-height:0}.gog-autocomplete__option{display:flex;align-items:center;gap:var(--gog-autocomplete-option-gap);padding:var(--gog-autocomplete-option-padding);border-radius:var(--gog-autocomplete-option-radius);color:var(--gog-autocomplete-option-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));cursor:pointer}.gog-autocomplete__option:hover:not([aria-disabled=true]),.gog-autocomplete__option--active{background-color:var(--gog-autocomplete-option-hover-bg);color:var(--gog-autocomplete-option-hover-color)}.gog-autocomplete__option--selected{background-color:var(--gog-autocomplete-option-selected-bg);color:var(--gog-autocomplete-option-selected-color)}.gog-autocomplete__option--disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete__option-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gog-autocomplete__empty{margin:0;padding:var(--gog-autocomplete-option-padding);color:var(--gog-autocomplete-empty-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-empty-font-size)}.gog-autocomplete--xsm{--gog-autocomplete-size-padding-y: var(--gog-field-xsm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-xsm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-xsm-font-size)}.gog-autocomplete--sm{--gog-autocomplete-size-padding-y: var(--gog-field-sm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-sm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-sm-font-size)}.gog-autocomplete--lg{--gog-autocomplete-size-padding-y: var(--gog-field-lg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-lg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-lg-font-size)}.gog-autocomplete--slg{--gog-autocomplete-size-padding-y: var(--gog-field-slg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-slg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-autocomplete,:host(.gog-host--auto-width) .gog-autocomplete__field,:host(.gog-host--auto-width) .gog-autocomplete__control{width:auto}.gog-autocomplete__label--float{position:absolute;left:var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-autocomplete-placeholder-color);font-size:var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-autocomplete-transition-duration) var(--gog-easing),font-size var(--gog-autocomplete-transition-duration) var(--gog-easing),color var(--gog-autocomplete-transition-duration) var(--gog-easing),top var(--gog-autocomplete-transition-duration) var(--gog-easing),background-color var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete--float-in,.gog-autocomplete--float-on{--gog-autocomplete-float-top-padding: calc(var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-autocomplete-float-label-reserve))}.gog-autocomplete--float-in .gog-autocomplete__control,.gog-autocomplete--float-on .gog-autocomplete__control{padding-top:var(--gog-autocomplete-float-top-padding)}.gog-autocomplete--float-in .gog-autocomplete__label--float,.gog-autocomplete--float-on .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-top-padding);transform:none}.gog-autocomplete--float-in.gog-autocomplete--floated .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-label-in-top);transform:translateY(0);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-on.gog-autocomplete--floated .gog-autocomplete__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing);background-color:var(--gog-autocomplete-float-label-on-bg, var(--gog-autocomplete-field-bg));padding:0 4px;left:calc(var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-autocomplete--float-over.gog-autocomplete--floated .gog-autocomplete__label--float{top:calc(-1 * var(--gog-autocomplete-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-over .gog-autocomplete__field{margin-top:var(--gog-autocomplete-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-autocomplete__control{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }, { kind: "component", type: SpinnerComponent, selector: "gog-spinner", inputs: ["size", "overlay", "ariaLabel", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2456
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: AutocompleteComponent, isStandalone: true, selector: "gog-autocomplete", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, filterLocal: { classPropertyName: "filterLocal", publicName: "filterLocal", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, openOnFocus: { classPropertyName: "openOnFocus", publicName: "openOnFocus", isSignal: true, isRequired: false, transformFunction: null }, searchDebounce: { classPropertyName: "searchDebounce", publicName: "searchDebounce", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, forceSelection: { classPropertyName: "forceSelection", publicName: "forceSelection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", gogSearch: "gogSearch", gogLoadMore: "gogLoadMore" }, host: { properties: { "style.--gog-autocomplete-min-width": "minWidth()" } }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-autocomplete\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-autocomplete--clearable]=\"showClear()\"\r\n [class.gog-autocomplete--disabled]=\"isDisabled()\"\r\n [class.gog-autocomplete--open]=\"isOpen()\"\r\n [class.gog-autocomplete--loading]=\"loading()\"\r\n [class.gog-autocomplete--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-autocomplete--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-autocomplete--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-autocomplete--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-autocomplete__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-autocomplete__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-autocomplete__label gog-autocomplete__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <!--\r\n The input *is* the combobox \u2014 role, aria-autocomplete and aria-activedescendant all sit\r\n here, and DOM focus never leaves it. That is the difference from gog-select, where the\r\n trigger is a button and focus moves onto the option itself.\r\n -->\r\n <input\r\n type=\"text\"\r\n class=\"gog-autocomplete__control\"\r\n autocomplete=\"off\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [value]=\"query()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || null\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (focus)=\"onInputFocus()\"\r\n (blur)=\"onInputBlur()\"\r\n />\r\n\r\n <span class=\"gog-autocomplete__actions\">\r\n @if (loading()) {\r\n <gog-spinner class=\"gog-autocomplete__spinner\" size=\"xsm\" ariaLabel=\"Loading\" />\r\n }\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-autocomplete__clear gog-inline-center\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-autocomplete__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes \u2014 inline, or stamped into <body> by the overlay when\r\n `appendToBody` is set, which is why the portal modifier and the resolved coordinates are\r\n applied conditionally.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation; the keyboard contract lives on the combobox input, which keeps focus and drives this list via aria-activedescendant -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-autocomplete__dropdown\"\r\n [class.gog-autocomplete__dropdown--up]=\"\r\n !resolvedAppendToBody() && dropdownDirectionState() === 'up'\r\n \"\r\n [class.gog-autocomplete__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-label]=\"label() || ariaLabel() || null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-autocomplete__scroll\"\r\n (gogReachEnd)=\"gogLoadMore.emit()\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-autocomplete__empty\">{{ emptyMessage() }}</p>\r\n }\r\n\r\n @for (option of visibleOptions(); track valueOf(option); let i = $index) {\r\n <!--\r\n A div, not a button: focus stays in the input, so these rows are never focused and a\r\n button would only add tab stops and a second Enter handler. The highlight is pointed\r\n at with aria-activedescendant instead.\r\n\r\n mousedown is prevented so clicking a row doesn't blur the input first \u2014 that blur\r\n would close the panel and, under forceSelection, wipe the text before the click lands.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- this is the ARIA combobox pattern: the option is deliberately neither focusable nor a keyboard target, because focus stays in the input and the whole keyboard contract (arrows, Enter, Escape) is handled there and communicated through aria-activedescendant. Making these rows focusable would break the pattern rather than improve it. -->\r\n <div\r\n class=\"gog-autocomplete__option\"\r\n role=\"option\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-autocomplete__option--active]=\"i === activeIndex()\"\r\n [class.gog-autocomplete__option--selected]=\"isSelected(option)\"\r\n [class.gog-autocomplete__option--disabled]=\"isOptionDisabled(option)\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"onOptionClick(option, $event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"slot.templateRef\"\r\n [ngTemplateOutletContext]=\"optionContext(option, isSelected(option))\"\r\n />\r\n } @else {\r\n <span class=\"gog-autocomplete__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </div>\r\n }\r\n </gog-scroll>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-autocomplete{display:flex;flex-direction:column;gap:var(--gog-autocomplete-gap);width:100%}.gog-autocomplete__label{color:var(--gog-autocomplete-label-color);font-family:var(--gog-autocomplete-label-font-family);font-size:var(--gog-autocomplete-label-font-size);font-weight:var(--gog-autocomplete-label-font-weight);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-autocomplete-min-width)}.gog-autocomplete__control{box-sizing:border-box;width:100%;min-width:var(--gog-autocomplete-min-width);padding:var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-actions-reserve) var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-autocomplete-border-width) var(--gog-autocomplete-border-style) var(--gog-autocomplete-border-color);border-radius:var(--gog-autocomplete-radius);background-color:var(--gog-autocomplete-bg, var(--gog-autocomplete-field-bg));color:var(--gog-autocomplete-color, var(--gog-autocomplete-text-color));font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-autocomplete-line-height);transition:border-color var(--gog-autocomplete-transition-duration) var(--gog-easing),box-shadow var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete__control::placeholder{color:var(--gog-autocomplete-placeholder-color)}.gog-autocomplete__control:hover:not(:disabled){border-color:var(--gog-autocomplete-hover-border-color)}.gog-autocomplete__control:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__control:disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete--error .gog-autocomplete__control,.gog-autocomplete__control[aria-invalid=true]{border-color:var(--gog-autocomplete-error-border-color)}.gog-autocomplete__actions{position:absolute;inset-inline-end:var(--gog-autocomplete-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-autocomplete-actions-gap);pointer-events:none}.gog-autocomplete__actions>*{pointer-events:auto}.gog-autocomplete__clear{padding:0;border:0;background:none;color:var(--gog-autocomplete-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-autocomplete-clear-icon-ratio));cursor:pointer}.gog-autocomplete__clear:hover{color:var(--gog-autocomplete-clear-hover-color)}.gog-autocomplete__clear:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__spinner{font-size:var(--gog-autocomplete-spinner-size)}.gog-autocomplete__error{color:var(--gog-autocomplete-error-color);font-family:var(--gog-autocomplete-error-font-family);font-size:var(--gog-autocomplete-error-font-size)}.gog-autocomplete__dropdown{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-autocomplete-panel-gap));z-index:var(--gog-dropdown-z);box-sizing:border-box;display:flex;flex-direction:column;width:max-content;min-width:100%;max-width:var(--gog-autocomplete-panel-max-width);max-height:var(--gog-autocomplete-panel-max-height);padding:var(--gog-autocomplete-options-padding);border:var(--gog-autocomplete-panel-border-width) var(--gog-autocomplete-panel-border-style) var(--gog-autocomplete-panel-border-color);border-radius:var(--gog-autocomplete-panel-radius);background-color:var(--gog-autocomplete-panel-bg);box-shadow:var(--gog-autocomplete-panel-shadow);overflow:hidden}.gog-autocomplete__dropdown--up{top:auto;bottom:calc(100% + var(--gog-autocomplete-panel-gap))}.gog-autocomplete__dropdown--portal{position:fixed;top:0;inset-inline-start:0;min-width:0}.gog-autocomplete__scroll{flex:1;min-height:0}.gog-autocomplete__option{display:flex;align-items:center;gap:var(--gog-autocomplete-option-gap);padding:var(--gog-autocomplete-option-padding);border-radius:var(--gog-autocomplete-option-radius);color:var(--gog-autocomplete-option-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));cursor:pointer}.gog-autocomplete__option:hover:not([aria-disabled=true]),.gog-autocomplete__option--active{background-color:var(--gog-autocomplete-option-hover-bg);color:var(--gog-autocomplete-option-hover-color)}.gog-autocomplete__option--selected{background-color:var(--gog-autocomplete-option-selected-bg);color:var(--gog-autocomplete-option-selected-color)}.gog-autocomplete__option--disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete__option-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gog-autocomplete__empty{margin:0;padding:var(--gog-autocomplete-option-padding);color:var(--gog-autocomplete-empty-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-empty-font-size)}.gog-autocomplete--xsm{--gog-autocomplete-size-padding-y: var(--gog-field-xsm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-xsm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-xsm-font-size)}.gog-autocomplete--sm{--gog-autocomplete-size-padding-y: var(--gog-field-sm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-sm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-sm-font-size)}.gog-autocomplete--lg{--gog-autocomplete-size-padding-y: var(--gog-field-lg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-lg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-lg-font-size)}.gog-autocomplete--slg{--gog-autocomplete-size-padding-y: var(--gog-field-slg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-slg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-autocomplete,:host(.gog-host--auto-width) .gog-autocomplete__field,:host(.gog-host--auto-width) .gog-autocomplete__control{width:auto}.gog-autocomplete__label--float{position:absolute;left:var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-autocomplete-placeholder-color);font-size:var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-autocomplete-transition-duration) var(--gog-easing),font-size var(--gog-autocomplete-transition-duration) var(--gog-easing),color var(--gog-autocomplete-transition-duration) var(--gog-easing),top var(--gog-autocomplete-transition-duration) var(--gog-easing),background-color var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete--float-in,.gog-autocomplete--float-on{--gog-autocomplete-float-top-padding: calc(var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-autocomplete-float-label-reserve))}.gog-autocomplete--float-in .gog-autocomplete__control,.gog-autocomplete--float-on .gog-autocomplete__control{padding-top:var(--gog-autocomplete-float-top-padding)}.gog-autocomplete--float-in .gog-autocomplete__label--float,.gog-autocomplete--float-on .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-top-padding);transform:none}.gog-autocomplete--float-in.gog-autocomplete--floated .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-label-in-top);transform:translateY(0);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-on.gog-autocomplete--floated .gog-autocomplete__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing);background-color:var(--gog-autocomplete-float-label-on-bg, var(--gog-autocomplete-field-bg));padding:0 4px;left:calc(var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-autocomplete--float-over.gog-autocomplete--floated .gog-autocomplete__label--float{top:calc(-1 * var(--gog-autocomplete-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-over .gog-autocomplete__field{margin-top:var(--gog-autocomplete-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-autocomplete__control{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }, { kind: "component", type: SpinnerComponent, selector: "gog-spinner", inputs: ["size", "overlay", "ariaLabel", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2227
2457
|
}
|
|
2228
2458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
2229
2459
|
type: Component,
|
|
2230
2460
|
args: [{ selector: 'gog-autocomplete', imports: [IconComponent, NgTemplateOutlet, ScrollComponent, SpinnerComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2231
2461
|
// Only bites when the control has opted out of full width; otherwise the container decides.
|
|
2232
2462
|
'[style.--gog-autocomplete-min-width]': 'minWidth()',
|
|
2233
|
-
}, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-autocomplete\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-autocomplete--clearable]=\"showClear()\"\r\n [class.gog-autocomplete--disabled]=\"isDisabled()\"\r\n [class.gog-autocomplete--open]=\"isOpen()\"\r\n [class.gog-autocomplete--loading]=\"loading()\"\r\n [class.gog-autocomplete--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-autocomplete--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-autocomplete--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-autocomplete--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-autocomplete__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-autocomplete__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-autocomplete__label gog-autocomplete__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <!--\r\n The input *is* the combobox \u2014 role, aria-autocomplete and aria-activedescendant all sit\r\n here, and DOM focus never leaves it. That is the difference from gog-select, where the\r\n trigger is a button and focus moves onto the option itself.\r\n -->\r\n <input\r\n type=\"text\"\r\n class=\"gog-autocomplete__control\"\r\n autocomplete=\"off\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [value]=\"query()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || null\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (focus)=\"onInputFocus()\"\r\n (blur)=\"onInputBlur()\"\r\n />\r\n\r\n <span class=\"gog-autocomplete__actions\">\r\n @if (loading()) {\r\n <gog-spinner class=\"gog-autocomplete__spinner\" size=\"xsm\" ariaLabel=\"Loading\" />\r\n }\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-autocomplete__clear gog-inline-center\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-autocomplete__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes \u2014 inline, or stamped into <body> by the overlay when\r\n `appendToBody` is set, which is why the portal modifier and the resolved coordinates are\r\n applied conditionally.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation; the keyboard contract lives on the combobox input, which keeps focus and drives this list via aria-activedescendant -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-autocomplete__dropdown\"\r\n [class.gog-autocomplete__dropdown--up]=\"\r\n !resolvedAppendToBody() && dropdownDirectionState() === 'up'\r\n \"\r\n [class.gog-autocomplete__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-label]=\"label() || ariaLabel() || null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-autocomplete__scroll\"\r\n (gogReachEnd)=\"gogLoadMore.emit()\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-autocomplete__empty\">{{ emptyMessage() }}</p>\r\n }\r\n\r\n @for (option of visibleOptions(); track valueOf(option); let i = $index) {\r\n <!--\r\n A div, not a button: focus stays in the input, so these rows are never focused and a\r\n button would only add tab stops and a second Enter handler. The highlight is pointed\r\n at with aria-activedescendant instead.\r\n\r\n mousedown is prevented so clicking a row doesn't blur the input first \u2014 that blur\r\n would close the panel and, under forceSelection, wipe the text before the click lands.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- this is the ARIA combobox pattern: the option is deliberately neither focusable nor a keyboard target, because focus stays in the input and the whole keyboard contract (arrows, Enter, Escape) is handled there and communicated through aria-activedescendant. Making these rows focusable would break the pattern rather than improve it. -->\r\n <div\r\n class=\"gog-autocomplete__option\"\r\n role=\"option\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-autocomplete__option--active]=\"i === activeIndex()\"\r\n [class.gog-autocomplete__option--selected]=\"isSelected(option)\"\r\n [class.gog-autocomplete__option--disabled]=\"isOptionDisabled(option)\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"onOptionClick(option, $event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"slot.templateRef\"\r\n [ngTemplateOutletContext]=\"optionContext(option, isSelected(option))\"\r\n />\r\n } @else {\r\n <span class=\"gog-autocomplete__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </div>\r\n }\r\n </gog-scroll>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-autocomplete{display:flex;flex-direction:column;gap:var(--gog-autocomplete-gap);width:100%}.gog-autocomplete__label{color:var(--gog-autocomplete-label-color);font-family:var(--gog-autocomplete-label-font-family);font-size:var(--gog-autocomplete-label-font-size);font-weight:var(--gog-autocomplete-label-font-weight);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-autocomplete-min-width)}.gog-autocomplete__control{box-sizing:border-box;width:100%;min-width:var(--gog-autocomplete-min-width);padding:var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-actions-reserve) var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-autocomplete-border-width) var(--gog-autocomplete-border-style) var(--gog-autocomplete-border-color);border-radius:var(--gog-autocomplete-radius);background-color:var(--gog-autocomplete-bg, var(--gog-autocomplete-field-bg));color:var(--gog-autocomplete-color, var(--gog-autocomplete-text-color));font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-autocomplete-line-height);transition:border-color var(--gog-autocomplete-transition-duration) var(--gog-easing),box-shadow var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete__control::placeholder{color:var(--gog-autocomplete-placeholder-color)}.gog-autocomplete__control:hover:not(:disabled){border-color:var(--gog-autocomplete-hover-border-color)}.gog-autocomplete__control:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__control:disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete--error .gog-autocomplete__control,.gog-autocomplete__control[aria-invalid=true]{border-color:var(--gog-autocomplete-error-border-color)}.gog-autocomplete__actions{position:absolute;inset-inline-end:var(--gog-autocomplete-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-autocomplete-actions-gap);pointer-events:none}.gog-autocomplete__actions>*{pointer-events:auto}.gog-autocomplete__clear{padding:0;border:0;background:none;color:var(--gog-autocomplete-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-autocomplete-clear-icon-ratio));cursor:pointer}.gog-autocomplete__clear:hover{color:var(--gog-autocomplete-clear-hover-color)}.gog-autocomplete__clear:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__spinner{font-size:var(--gog-autocomplete-spinner-size)}.gog-autocomplete__error{color:var(--gog-autocomplete-error-color);font-family:var(--gog-autocomplete-error-font-family);font-size:var(--gog-autocomplete-error-font-size)}.gog-autocomplete__dropdown{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-autocomplete-panel-gap));z-index:var(--gog-dropdown-z);box-sizing:border-box;display:flex;flex-direction:column;width:max-content;min-width:100%;max-width:var(--gog-autocomplete-panel-max-width);max-height:var(--gog-autocomplete-panel-max-height);padding:var(--gog-autocomplete-options-padding);border:var(--gog-autocomplete-panel-border-width) var(--gog-autocomplete-panel-border-style) var(--gog-autocomplete-panel-border-color);border-radius:var(--gog-autocomplete-panel-radius);background-color:var(--gog-autocomplete-panel-bg);box-shadow:var(--gog-autocomplete-panel-shadow);overflow:hidden}.gog-autocomplete__dropdown--up{top:auto;bottom:calc(100% + var(--gog-autocomplete-panel-gap))}.gog-autocomplete__dropdown--portal{position:fixed;top:0;inset-inline-start:0;min-width:0}.gog-autocomplete__scroll{flex:1;min-height:0}.gog-autocomplete__option{display:flex;align-items:center;gap:var(--gog-autocomplete-option-gap);padding:var(--gog-autocomplete-option-padding);border-radius:var(--gog-autocomplete-option-radius);color:var(--gog-autocomplete-option-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));cursor:pointer}.gog-autocomplete__option:hover:not([aria-disabled=true]),.gog-autocomplete__option--active{background-color:var(--gog-autocomplete-option-hover-bg);color:var(--gog-autocomplete-option-hover-color)}.gog-autocomplete__option--selected{background-color:var(--gog-autocomplete-option-selected-bg);color:var(--gog-autocomplete-option-selected-color)}.gog-autocomplete__option--disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete__option-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gog-autocomplete__empty{margin:0;padding:var(--gog-autocomplete-option-padding);color:var(--gog-autocomplete-empty-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-empty-font-size)}.gog-autocomplete--xsm{--gog-autocomplete-size-padding-y: var(--gog-field-xsm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-xsm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-xsm-font-size)}.gog-autocomplete--sm{--gog-autocomplete-size-padding-y: var(--gog-field-sm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-sm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-sm-font-size)}.gog-autocomplete--lg{--gog-autocomplete-size-padding-y: var(--gog-field-lg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-lg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-lg-font-size)}.gog-autocomplete--slg{--gog-autocomplete-size-padding-y: var(--gog-field-slg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-slg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-autocomplete,:host(.gog-host--auto-width) .gog-autocomplete__field,:host(.gog-host--auto-width) .gog-autocomplete__control{width:auto}.gog-autocomplete__label--float{position:absolute;left:var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-autocomplete-placeholder-color);font-size:var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-autocomplete-transition-duration) var(--gog-easing),font-size var(--gog-autocomplete-transition-duration) var(--gog-easing),color var(--gog-autocomplete-transition-duration) var(--gog-easing),top var(--gog-autocomplete-transition-duration) var(--gog-easing),background-color var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete--float-in,.gog-autocomplete--float-on{--gog-autocomplete-float-top-padding: calc(var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-autocomplete-float-label-reserve))}.gog-autocomplete--float-in .gog-autocomplete__control,.gog-autocomplete--float-on .gog-autocomplete__control{padding-top:var(--gog-autocomplete-float-top-padding)}.gog-autocomplete--float-in .gog-autocomplete__label--float,.gog-autocomplete--float-on .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-top-padding);transform:none}.gog-autocomplete--float-in.gog-autocomplete--floated .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-label-in-top);transform:translateY(0);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-on.gog-autocomplete--floated .gog-autocomplete__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing);background-color:var(--gog-autocomplete-float-label-on-bg, var(--gog-autocomplete-field-bg));padding:0 4px;left:calc(var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-autocomplete--float-over.gog-autocomplete--floated .gog-autocomplete__label--float{top:calc(-1 * var(--gog-autocomplete-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-over .gog-autocomplete__field{margin-top:var(--gog-autocomplete-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-autocomplete__control{transition:none}}\n"] }]
|
|
2463
|
+
}, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-autocomplete\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-autocomplete--clearable]=\"showClear()\"\r\n [class.gog-autocomplete--disabled]=\"isDisabled()\"\r\n [class.gog-autocomplete--open]=\"isOpen()\"\r\n [class.gog-autocomplete--loading]=\"loading()\"\r\n [class.gog-autocomplete--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-autocomplete--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-autocomplete--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-autocomplete--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-autocomplete__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-autocomplete__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-autocomplete__label gog-autocomplete__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <!--\r\n The input *is* the combobox \u2014 role, aria-autocomplete and aria-activedescendant all sit\r\n here, and DOM focus never leaves it. That is the difference from gog-select, where the\r\n trigger is a button and focus moves onto the option itself.\r\n -->\r\n <input\r\n type=\"text\"\r\n class=\"gog-autocomplete__control\"\r\n autocomplete=\"off\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [value]=\"query()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || null\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (focus)=\"onInputFocus()\"\r\n (blur)=\"onInputBlur()\"\r\n />\r\n\r\n <span class=\"gog-autocomplete__actions\">\r\n @if (loading()) {\r\n <gog-spinner class=\"gog-autocomplete__spinner\" size=\"xsm\" ariaLabel=\"Loading\" />\r\n }\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-autocomplete__clear gog-inline-center\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-autocomplete__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes \u2014 inline, or stamped into <body> by the overlay when\r\n `appendToBody` is set, which is why the portal modifier and the resolved coordinates are\r\n applied conditionally.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation; the keyboard contract lives on the combobox input, which keeps focus and drives this list via aria-activedescendant -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-autocomplete__dropdown\"\r\n [class.gog-autocomplete__dropdown--up]=\"\r\n !resolvedAppendToBody() && dropdownDirectionState() === 'up'\r\n \"\r\n [class.gog-autocomplete__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-label]=\"label() || ariaLabel() || null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-autocomplete__scroll\"\r\n (gogReachEnd)=\"gogLoadMore.emit()\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-autocomplete__empty\">{{ emptyMessage() }}</p>\r\n }\r\n\r\n @for (option of visibleOptions(); track valueOf(option); let i = $index) {\r\n <!--\r\n A div, not a button: focus stays in the input, so these rows are never focused and a\r\n button would only add tab stops and a second Enter handler. The highlight is pointed\r\n at with aria-activedescendant instead.\r\n\r\n mousedown is prevented so clicking a row doesn't blur the input first \u2014 that blur\r\n would close the panel and, under forceSelection, wipe the text before the click lands.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- this is the ARIA combobox pattern: the option is deliberately neither focusable nor a keyboard target, because focus stays in the input and the whole keyboard contract (arrows, Enter, Escape) is handled there and communicated through aria-activedescendant. Making these rows focusable would break the pattern rather than improve it. -->\r\n <div\r\n class=\"gog-autocomplete__option\"\r\n role=\"option\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-autocomplete__option--active]=\"i === activeIndex()\"\r\n [class.gog-autocomplete__option--selected]=\"isSelected(option)\"\r\n [class.gog-autocomplete__option--disabled]=\"isOptionDisabled(option)\"\r\n (mousedown)=\"onOptionMousedown($event)\"\r\n (click)=\"onOptionClick(option, $event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"slot.templateRef\"\r\n [ngTemplateOutletContext]=\"optionContext(option, isSelected(option))\"\r\n />\r\n } @else {\r\n <span class=\"gog-autocomplete__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </div>\r\n }\r\n </gog-scroll>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-autocomplete{display:flex;flex-direction:column;gap:var(--gog-autocomplete-gap);width:100%}.gog-autocomplete__label{color:var(--gog-autocomplete-label-color);font-family:var(--gog-autocomplete-label-font-family);font-size:var(--gog-autocomplete-label-font-size);font-weight:var(--gog-autocomplete-label-font-weight);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-autocomplete-min-width)}.gog-autocomplete__control{box-sizing:border-box;width:100%;min-width:var(--gog-autocomplete-min-width);padding:var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-actions-reserve) var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-autocomplete-border-width) var(--gog-autocomplete-border-style) var(--gog-autocomplete-border-color);border-radius:var(--gog-autocomplete-radius);background-color:var(--gog-autocomplete-bg, var(--gog-autocomplete-field-bg));color:var(--gog-autocomplete-color, var(--gog-autocomplete-text-color));font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-autocomplete-line-height);transition:border-color var(--gog-autocomplete-transition-duration) var(--gog-easing),box-shadow var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete__control::placeholder{color:var(--gog-autocomplete-placeholder-color)}.gog-autocomplete__control:hover:not(:disabled){border-color:var(--gog-autocomplete-hover-border-color)}.gog-autocomplete__control:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__control:disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete--error .gog-autocomplete__control,.gog-autocomplete__control[aria-invalid=true]{border-color:var(--gog-autocomplete-error-border-color)}.gog-autocomplete__actions{position:absolute;inset-inline-end:var(--gog-autocomplete-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-autocomplete-actions-gap);pointer-events:none}.gog-autocomplete__actions>*{pointer-events:auto}.gog-autocomplete__clear{padding:0;border:0;background:none;color:var(--gog-autocomplete-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-autocomplete-clear-icon-ratio));cursor:pointer}.gog-autocomplete__clear:hover{color:var(--gog-autocomplete-clear-hover-color)}.gog-autocomplete__clear:focus-visible{outline:var(--gog-autocomplete-focus-ring-width) solid var(--gog-autocomplete-focus-ring-color);outline-offset:var(--gog-autocomplete-focus-ring-offset)}.gog-autocomplete__spinner{font-size:var(--gog-autocomplete-spinner-size)}.gog-autocomplete__error{color:var(--gog-autocomplete-error-color);font-family:var(--gog-autocomplete-error-font-family);font-size:var(--gog-autocomplete-error-font-size)}.gog-autocomplete__dropdown{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-autocomplete-panel-gap));z-index:var(--gog-dropdown-z);box-sizing:border-box;display:flex;flex-direction:column;width:max-content;min-width:100%;max-width:var(--gog-autocomplete-panel-max-width);max-height:var(--gog-autocomplete-panel-max-height);padding:var(--gog-autocomplete-options-padding);border:var(--gog-autocomplete-panel-border-width) var(--gog-autocomplete-panel-border-style) var(--gog-autocomplete-panel-border-color);border-radius:var(--gog-autocomplete-panel-radius);background-color:var(--gog-autocomplete-panel-bg);box-shadow:var(--gog-autocomplete-panel-shadow);overflow:hidden}.gog-autocomplete__dropdown--up{top:auto;bottom:calc(100% + var(--gog-autocomplete-panel-gap))}.gog-autocomplete__dropdown--portal{position:fixed;top:0;inset-inline-start:0;min-width:0}.gog-autocomplete__scroll{flex:1;min-height:0}.gog-autocomplete__option{display:flex;align-items:center;gap:var(--gog-autocomplete-option-gap);padding:var(--gog-autocomplete-option-padding);border-radius:var(--gog-autocomplete-option-radius);color:var(--gog-autocomplete-option-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-font-size, var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size)));cursor:pointer}.gog-autocomplete__option:hover:not([aria-disabled=true]),.gog-autocomplete__option--active{background-color:var(--gog-autocomplete-option-hover-bg);color:var(--gog-autocomplete-option-hover-color)}.gog-autocomplete__option--selected{background-color:var(--gog-autocomplete-option-selected-bg);color:var(--gog-autocomplete-option-selected-color)}.gog-autocomplete__option--disabled{opacity:var(--gog-autocomplete-disabled-opacity);cursor:not-allowed}.gog-autocomplete__option-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gog-autocomplete__empty{margin:0;padding:var(--gog-autocomplete-option-padding);color:var(--gog-autocomplete-empty-color);font-family:var(--gog-autocomplete-font-family);font-size:var(--gog-autocomplete-empty-font-size)}.gog-autocomplete--xsm{--gog-autocomplete-size-padding-y: var(--gog-field-xsm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-xsm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-xsm-font-size)}.gog-autocomplete--sm{--gog-autocomplete-size-padding-y: var(--gog-field-sm-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-sm-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-sm-font-size)}.gog-autocomplete--lg{--gog-autocomplete-size-padding-y: var(--gog-field-lg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-lg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-lg-font-size)}.gog-autocomplete--slg{--gog-autocomplete-size-padding-y: var(--gog-field-slg-padding-y);--gog-autocomplete-size-padding-x: var(--gog-field-slg-padding-x);--gog-autocomplete-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-autocomplete,:host(.gog-host--auto-width) .gog-autocomplete__field,:host(.gog-host--auto-width) .gog-autocomplete__control{width:auto}.gog-autocomplete__label--float{position:absolute;left:var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-autocomplete-placeholder-color);font-size:var(--gog-autocomplete-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-autocomplete-transition-duration) var(--gog-easing),font-size var(--gog-autocomplete-transition-duration) var(--gog-easing),color var(--gog-autocomplete-transition-duration) var(--gog-easing),top var(--gog-autocomplete-transition-duration) var(--gog-easing),background-color var(--gog-autocomplete-transition-duration) var(--gog-easing)}.gog-autocomplete--float-in,.gog-autocomplete--float-on{--gog-autocomplete-float-top-padding: calc(var(--gog-autocomplete-padding-y, var(--gog-autocomplete-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-autocomplete-float-label-reserve))}.gog-autocomplete--float-in .gog-autocomplete__control,.gog-autocomplete--float-on .gog-autocomplete__control{padding-top:var(--gog-autocomplete-float-top-padding)}.gog-autocomplete--float-in .gog-autocomplete__label--float,.gog-autocomplete--float-on .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-top-padding);transform:none}.gog-autocomplete--float-in.gog-autocomplete--floated .gog-autocomplete__label--float{top:var(--gog-autocomplete-float-label-in-top);transform:translateY(0);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-on.gog-autocomplete--floated .gog-autocomplete__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing);background-color:var(--gog-autocomplete-float-label-on-bg, var(--gog-autocomplete-field-bg));padding:0 4px;left:calc(var(--gog-autocomplete-padding-x, var(--gog-autocomplete-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-autocomplete--float-over.gog-autocomplete--floated .gog-autocomplete__label--float{top:calc(-1 * var(--gog-autocomplete-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-autocomplete-label-font-size);color:var(--gog-autocomplete-label-color);text-transform:var(--gog-autocomplete-label-text-transform);letter-spacing:var(--gog-autocomplete-label-letter-spacing)}.gog-autocomplete--float-over .gog-autocomplete__field{margin-top:var(--gog-autocomplete-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-autocomplete__control{transition:none}}\n"] }]
|
|
2234
2464
|
}], ctorParameters: () => [], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], filterLocal: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterLocal", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], openOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnFocus", required: false }] }], searchDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchDebounce", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], forceSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceSelection", required: false }] }], gogSearch: [{ type: i0.Output, args: ["gogSearch"] }], gogLoadMore: [{ type: i0.Output, args: ["gogLoadMore"] }], panelTemplate: [{ type: i0.ViewChild, args: ['panelTpl', { isSignal: true }] }] } });
|
|
2235
2465
|
|
|
2236
2466
|
/** Beyond this count the badge renders `N+` rather than growing without limit. */
|
|
@@ -3224,6 +3454,22 @@ function parseDate(text, pattern) {
|
|
|
3224
3454
|
}
|
|
3225
3455
|
|
|
3226
3456
|
const DEFAULT_LOCALE$1 = 'en-US';
|
|
3457
|
+
/**
|
|
3458
|
+
* Built-in defaults for every fixed string the grid renders, used when neither the matching
|
|
3459
|
+
* input nor `GOG_CONFIG.labels` supplies one. Kept as one object so `resolvedLabels` stays a
|
|
3460
|
+
* single `computed` instead of nine, and so the set is obvious at a glance.
|
|
3461
|
+
*/
|
|
3462
|
+
const DEFAULT_LABELS$3 = {
|
|
3463
|
+
today: 'Today',
|
|
3464
|
+
thisMonth: 'This month',
|
|
3465
|
+
previousMonth: 'Previous month',
|
|
3466
|
+
nextMonth: 'Next month',
|
|
3467
|
+
previousYear: 'Previous year',
|
|
3468
|
+
nextYear: 'Next year',
|
|
3469
|
+
hours: 'Hours',
|
|
3470
|
+
minutes: 'Minutes',
|
|
3471
|
+
seconds: 'Seconds',
|
|
3472
|
+
};
|
|
3227
3473
|
/**
|
|
3228
3474
|
* The month grid behind `gog-datepicker`, usable on its own for an always-visible calendar.
|
|
3229
3475
|
*
|
|
@@ -3247,10 +3493,16 @@ class CalendarComponent {
|
|
|
3247
3493
|
* or "public holidays" without the consumer materialising every date in range first.
|
|
3248
3494
|
*/
|
|
3249
3495
|
disabledDates = input(null, ...(ngDevMode ? [{ debugName: "disabledDates" }] : /* istanbul ignore next */ []));
|
|
3250
|
-
/**
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3496
|
+
/**
|
|
3497
|
+
* BCP-47 tag driving the month and weekday names. Unset, falls back to
|
|
3498
|
+
* `GOG_CONFIG.datepicker.locale`, then to `'en-US'`.
|
|
3499
|
+
*/
|
|
3500
|
+
locale = input(undefined, ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
3501
|
+
/**
|
|
3502
|
+
* 0 = Sunday … 6 = Saturday. Unset, falls back to `GOG_CONFIG.datepicker.firstDayOfWeek`,
|
|
3503
|
+
* then to the locale's own first day.
|
|
3504
|
+
*/
|
|
3505
|
+
firstDayOfWeek = input(undefined, ...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
3254
3506
|
/** Which month to open on when there is no selection yet. */
|
|
3255
3507
|
defaultMonth = input(null, ...(ngDevMode ? [{ debugName: "defaultMonth" }] : /* istanbul ignore next */ []));
|
|
3256
3508
|
/** How many months to show side by side. Two is what makes a range picker usable. */
|
|
@@ -3275,15 +3527,43 @@ class CalendarComponent {
|
|
|
3275
3527
|
*/
|
|
3276
3528
|
showThisMonthButton = input(false, ...(ngDevMode ? [{ debugName: "showThisMonthButton" }] : /* istanbul ignore next */ []));
|
|
3277
3529
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3530
|
+
/**
|
|
3531
|
+
* Navigation, shortcut and time-section labels. Each falls back to the matching
|
|
3532
|
+
* `GOG_CONFIG.labels` field when unset, then to the built-in English default — an app
|
|
3533
|
+
* translating the calendar sets them once rather than on every field.
|
|
3534
|
+
*/
|
|
3535
|
+
todayLabel = input(undefined, ...(ngDevMode ? [{ debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
3536
|
+
thisMonthLabel = input(undefined, ...(ngDevMode ? [{ debugName: "thisMonthLabel" }] : /* istanbul ignore next */ []));
|
|
3537
|
+
previousMonthLabel = input(undefined, ...(ngDevMode ? [{ debugName: "previousMonthLabel" }] : /* istanbul ignore next */ []));
|
|
3538
|
+
nextMonthLabel = input(undefined, ...(ngDevMode ? [{ debugName: "nextMonthLabel" }] : /* istanbul ignore next */ []));
|
|
3539
|
+
previousYearLabel = input(undefined, ...(ngDevMode ? [{ debugName: "previousYearLabel" }] : /* istanbul ignore next */ []));
|
|
3540
|
+
nextYearLabel = input(undefined, ...(ngDevMode ? [{ debugName: "nextYearLabel" }] : /* istanbul ignore next */ []));
|
|
3541
|
+
hoursLabel = input(undefined, ...(ngDevMode ? [{ debugName: "hoursLabel" }] : /* istanbul ignore next */ []));
|
|
3542
|
+
minutesLabel = input(undefined, ...(ngDevMode ? [{ debugName: "minutesLabel" }] : /* istanbul ignore next */ []));
|
|
3543
|
+
secondsLabel = input(undefined, ...(ngDevMode ? [{ debugName: "secondsLabel" }] : /* istanbul ignore next */ []));
|
|
3284
3544
|
/** Emitted when a selection is *complete* — a day in single mode, both ends of a range. */
|
|
3285
3545
|
gogDateSelect = output();
|
|
3286
3546
|
elRef = inject(ElementRef);
|
|
3547
|
+
globalConfig = inject(GOG_CONFIG);
|
|
3548
|
+
/**
|
|
3549
|
+
* Every rendered string, resolved instance input → `GOG_CONFIG.labels` → built-in default.
|
|
3550
|
+
* `gog-datepicker` forwards its own `todayLabel`/`thisMonthLabel` as `undefined` when unset
|
|
3551
|
+
* precisely so this resolution happens here, once, rather than being pre-empted upstream.
|
|
3552
|
+
*/
|
|
3553
|
+
resolvedLabels = computed(() => {
|
|
3554
|
+
const configured = this.globalConfig.labels ?? {};
|
|
3555
|
+
return {
|
|
3556
|
+
today: resolveConfigured(this.todayLabel(), configured.today, DEFAULT_LABELS$3.today),
|
|
3557
|
+
thisMonth: resolveConfigured(this.thisMonthLabel(), configured.thisMonth, DEFAULT_LABELS$3.thisMonth),
|
|
3558
|
+
previousMonth: resolveConfigured(this.previousMonthLabel(), configured.previousMonth, DEFAULT_LABELS$3.previousMonth),
|
|
3559
|
+
nextMonth: resolveConfigured(this.nextMonthLabel(), configured.nextMonth, DEFAULT_LABELS$3.nextMonth),
|
|
3560
|
+
previousYear: resolveConfigured(this.previousYearLabel(), configured.previousYear, DEFAULT_LABELS$3.previousYear),
|
|
3561
|
+
nextYear: resolveConfigured(this.nextYearLabel(), configured.nextYear, DEFAULT_LABELS$3.nextYear),
|
|
3562
|
+
hours: resolveConfigured(this.hoursLabel(), configured.hours, DEFAULT_LABELS$3.hours),
|
|
3563
|
+
minutes: resolveConfigured(this.minutesLabel(), configured.minutes, DEFAULT_LABELS$3.minutes),
|
|
3564
|
+
seconds: resolveConfigured(this.secondsLabel(), configured.seconds, DEFAULT_LABELS$3.seconds),
|
|
3565
|
+
};
|
|
3566
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
|
|
3287
3567
|
/** First of the leftmost visible month. */
|
|
3288
3568
|
viewMonth = signal(startOfDay(new Date()), ...(ngDevMode ? [{ debugName: "viewMonth" }] : /* istanbul ignore next */ []));
|
|
3289
3569
|
/** The cell the keyboard is on, and the only one carrying `tabindex="0"`. */
|
|
@@ -3292,9 +3572,21 @@ class CalendarComponent {
|
|
|
3292
3572
|
hoverDate = signal(null, ...(ngDevMode ? [{ debugName: "hoverDate" }] : /* istanbul ignore next */ []));
|
|
3293
3573
|
/** Whether a focus move should also pull the DOM focus over — only after a keypress. */
|
|
3294
3574
|
pendingFocus = false;
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3575
|
+
/**
|
|
3576
|
+
* Instance input → `GOG_CONFIG.datepicker` → the built-in default.
|
|
3577
|
+
*
|
|
3578
|
+
* `gog-calendar` resolves these itself rather than relying on `gog-datepicker` to pass them
|
|
3579
|
+
* down: it is exported and usable standalone, and `GOG_CONFIG.datepicker` has always been
|
|
3580
|
+
* documented as applying to both. When it *is* rendered by `gog-datepicker`, that component
|
|
3581
|
+
* passes its own already-resolved values, which win here — and resolve to the same thing,
|
|
3582
|
+
* since both read the same config.
|
|
3583
|
+
*/
|
|
3584
|
+
resolvedLocale = computed(() => resolveConfigured(this.locale(), this.globalConfig.datepicker?.locale, DEFAULT_LOCALE$1), ...(ngDevMode ? [{ debugName: "resolvedLocale" }] : /* istanbul ignore next */ []));
|
|
3585
|
+
resolvedFirstDayOfWeek = computed(() => this.firstDayOfWeek() ??
|
|
3586
|
+
this.globalConfig.datepicker?.firstDayOfWeek ??
|
|
3587
|
+
localeFirstDayOfWeek(this.resolvedLocale()), ...(ngDevMode ? [{ debugName: "resolvedFirstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
3588
|
+
weekdays = computed(() => weekdayNames(this.resolvedLocale(), this.resolvedFirstDayOfWeek()), ...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
|
|
3589
|
+
months = computed(() => monthNames(this.resolvedLocale()), ...(ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []));
|
|
3298
3590
|
range = computed(() => {
|
|
3299
3591
|
const current = this.value();
|
|
3300
3592
|
if (this.selectionMode() !== 'range' || current === null || current instanceof Date) {
|
|
@@ -3571,14 +3863,14 @@ class CalendarComponent {
|
|
|
3571
3863
|
return isSameDay(date, this.focusedDate());
|
|
3572
3864
|
}
|
|
3573
3865
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3574
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: CalendarComponent, isStandalone: true, selector: "gog-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, defaultMonth: { classPropertyName: "defaultMonth", publicName: "defaultMonth", isSignal: true, isRequired: false, transformFunction: null }, numberOfMonths: { classPropertyName: "numberOfMonths", publicName: "numberOfMonths", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, showTodayButton: { classPropertyName: "showTodayButton", publicName: "showTodayButton", isSignal: true, isRequired: false, transformFunction: null }, showThisMonthButton: { classPropertyName: "showThisMonthButton", publicName: "showThisMonthButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, thisMonthLabel: { classPropertyName: "thisMonthLabel", publicName: "thisMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, previousMonthLabel: { classPropertyName: "previousMonthLabel", publicName: "previousMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, nextMonthLabel: { classPropertyName: "nextMonthLabel", publicName: "nextMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, previousYearLabel: { classPropertyName: "previousYearLabel", publicName: "previousYearLabel", isSignal: true, isRequired: false, transformFunction: null }, nextYearLabel: { classPropertyName: "nextYearLabel", publicName: "nextYearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", gogDateSelect: "gogDateSelect" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<div class=\"gog-calendar__header\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"previousYearLabel()\"\r\n (click)=\"shiftViewYears(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"previousMonthLabel()\"\r\n (click)=\"shiftView(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n\r\n <div class=\"gog-calendar__titles\">\r\n @for (month of monthViews(); track $index) {\r\n <span class=\"gog-calendar__title\">{{ month.label }}</span>\r\n }\r\n </div>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"nextMonthLabel()\"\r\n (click)=\"shiftView(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"nextYearLabel()\"\r\n (click)=\"shiftViewYears(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n</div>\r\n\r\n<div class=\"gog-calendar__months\" (mouseleave)=\"onGridLeave()\">\r\n @for (month of monthViews(); track $index) {\r\n <!--\r\n role=\"grid\" rather than a list of buttons: a month is two-dimensional, and the arrow\r\n keys have to mean \"next day\" and \"next week\" \u2014 which is what the grid role tells\r\n assistive tech to expect. One keydown handler on the grid serves all 42 cells.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the keydown handler is delegated here so 42 cells don't each carry one; the real keyboard targets are the day buttons inside, which are focusable and carry the roving tabindex. The grid itself must not be a tab stop. -->\r\n <table\r\n class=\"gog-calendar__grid\"\r\n role=\"grid\"\r\n [attr.aria-label]=\"month.label\"\r\n (keydown)=\"onGridKeydown($event)\"\r\n >\r\n <thead>\r\n <tr class=\"gog-calendar__weekdays\">\r\n @for (weekday of weekdays(); track $index) {\r\n <th class=\"gog-calendar__weekday\" scope=\"col\" [attr.abbr]=\"weekday\">{{ weekday }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (week of month.weeks; track $index) {\r\n <tr class=\"gog-calendar__week\">\r\n @for (day of week; track day.date.getTime()) {\r\n <td class=\"gog-calendar__cell\" role=\"gridcell\" [attr.aria-selected]=\"day.selected\">\r\n <!--\r\n A roving tabindex across 42 cells: exactly one is tabbable, and the arrows\r\n move it. Tabbing through every day of the month instead would put 42 stops\r\n between the field and whatever follows it.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__day\"\r\n [class.gog-calendar__day--outside]=\"day.outside\"\r\n [class.gog-calendar__day--today]=\"day.today\"\r\n [class.gog-calendar__day--selected]=\"day.selected\"\r\n [class.gog-calendar__day--range-start]=\"day.rangeStart\"\r\n [class.gog-calendar__day--range-end]=\"day.rangeEnd\"\r\n [class.gog-calendar__day--in-range]=\"day.inRange\"\r\n [disabled]=\"day.disabled\"\r\n [attr.aria-disabled]=\"day.disabled\"\r\n [attr.aria-current]=\"day.today ? 'date' : null\"\r\n [tabindex]=\"isFocusedDay(day.date) ? 0 : -1\"\r\n (click)=\"onDayClick(day)\"\r\n (mouseenter)=\"onDayHover(day)\"\r\n >\r\n {{ day.label }}\r\n </button>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n }\r\n</div>\r\n\r\n@if (showTime()) {\r\n <div class=\"gog-calendar__time\">\r\n <gog-icon class=\"gog-calendar__time-icon\" name=\"clock\" [ariaHidden]=\"true\" />\r\n\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n [min]=\"minHour()\"\r\n [max]=\"maxHour()\"\r\n [value]=\"hours()\"\r\n aria-label=\"Hours\"\r\n (input)=\"onHourInput($event)\"\r\n />\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [step]=\"minuteStep()\"\r\n [value]=\"minutes()\"\r\n aria-label=\"Minutes\"\r\n (input)=\"onMinuteInput($event)\"\r\n />\r\n\r\n @if (showSeconds()) {\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [value]=\"seconds()\"\r\n aria-label=\"Seconds\"\r\n (input)=\"onSecondInput($event)\"\r\n />\r\n }\r\n\r\n @if (hourFormat() === '12') {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__meridiem\"\r\n [attr.aria-pressed]=\"isPm()\"\r\n (click)=\"toggleMeridiem()\"\r\n >\r\n {{ isPm() ? 'PM' : 'AM' }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n\r\n@if (showTodayButton() || showThisMonthButton()) {\r\n <!--\r\n Two distinct actions, never one: \"Today\" picks a date, \"This month\" only moves the view.\r\n Collapsing them into a single button is what made the control ambiguous \u2014 after paging\r\n away, the same label reads as \"take me back\" to one person and \"set it to today\" to another.\r\n -->\r\n <div class=\"gog-calendar__footer\">\r\n @if (showThisMonthButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__action--this-month\"\r\n (click)=\"goToThisMonth()\"\r\n >\r\n {{ thisMonthLabel() }}\r\n </button>\r\n }\r\n\r\n @if (showTodayButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__today\"\r\n [disabled]=\"!isTodaySelectable()\"\r\n (click)=\"selectToday()\"\r\n >\r\n {{ todayLabel() }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block;box-sizing:border-box;padding:var(--gog-calendar-padding);color:var(--gog-calendar-color);font-family:var(--gog-calendar-font-family);font-size:var(--gog-calendar-size-font-size, var(--gog-calendar-md-font-size));contain:layout style}.gog-calendar__header{display:flex;align-items:center;gap:var(--gog-calendar-header-gap);margin-block-end:var(--gog-calendar-header-margin)}.gog-calendar__titles{display:flex;flex:1 1 auto;justify-content:space-around;gap:var(--gog-calendar-header-gap)}.gog-calendar__title{flex:1 1 0;color:var(--gog-calendar-title-color);font-weight:var(--gog-calendar-title-font-weight);text-align:center}.gog-calendar__nav{flex:0 0 auto;width:var(--gog-calendar-nav-size);height:var(--gog-calendar-nav-size);padding:0;border:0;border-radius:var(--gog-calendar-nav-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font-size:var(--gog-calendar-nav-icon-size);letter-spacing:var(--gog-calendar-nav-icon-overlap);cursor:pointer}.gog-calendar__nav:hover{background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__nav:focus-visible,.gog-calendar__day:focus-visible,.gog-calendar__action:focus-visible,.gog-calendar__meridiem:focus-visible,.gog-calendar__time-input:focus-visible{outline:var(--gog-calendar-focus-ring-width) solid var(--gog-calendar-focus-ring-color);outline-offset:var(--gog-calendar-focus-ring-offset)}.gog-calendar__months{display:flex;gap:var(--gog-calendar-months-gap)}.gog-calendar__grid{border-collapse:collapse;table-layout:fixed}.gog-calendar__weekday{padding:var(--gog-calendar-weekday-padding);color:var(--gog-calendar-weekday-color);font-size:var(--gog-calendar-weekday-font-size);font-weight:var(--gog-calendar-weekday-font-weight);text-align:center;text-transform:var(--gog-calendar-weekday-text-transform)}.gog-calendar__cell{padding:0}.gog-calendar__day{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));height:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) transparent;border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-day-bg, var(--gog-calendar-day-rest-bg));color:var(--gog-calendar-day-color, var(--gog-calendar-day-rest-color));font:inherit;cursor:pointer;transition:background-color var(--gog-calendar-transition-duration) var(--gog-easing),color var(--gog-calendar-transition-duration) var(--gog-easing)}.gog-calendar__day:hover:not(:disabled){background-color:var(--gog-calendar-day-hover-bg)}.gog-calendar__day--outside{color:var(--gog-calendar-day-outside-color)}.gog-calendar__day--today{border-color:var(--gog-calendar-today-border-color);font-weight:var(--gog-calendar-today-font-weight)}.gog-calendar__day--in-range{border-radius:0;background-color:var(--gog-calendar-range-bg);color:var(--gog-calendar-range-color)}.gog-calendar__day--range-start{border-start-end-radius:0;border-end-end-radius:0}.gog-calendar__day--range-end{border-start-start-radius:0;border-end-start-radius:0}.gog-calendar__day--selected{background-color:var(--gog-calendar-selected-bg);color:var(--gog-calendar-selected-color);font-weight:var(--gog-calendar-selected-font-weight)}.gog-calendar__day:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}.gog-calendar__time{display:flex;align-items:center;justify-content:center;gap:var(--gog-calendar-time-gap);margin-block-start:var(--gog-calendar-time-margin);padding-block-start:var(--gog-calendar-time-margin);border-block-start:var(--gog-calendar-divider-width) var(--gog-calendar-divider-style) var(--gog-calendar-divider-color)}.gog-calendar__time-icon{color:var(--gog-calendar-weekday-color)}.gog-calendar__time-input{box-sizing:border-box;width:var(--gog-calendar-time-input-width);padding:var(--gog-calendar-time-input-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-time-input-bg);color:var(--gog-calendar-color);font:inherit;text-align:center}.gog-calendar__time-sep{color:var(--gog-calendar-weekday-color)}.gog-calendar__meridiem,.gog-calendar__action{padding:var(--gog-calendar-action-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font:inherit;cursor:pointer}.gog-calendar__meridiem:hover:not(:disabled),.gog-calendar__action:hover:not(:disabled){background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__footer{display:flex;justify-content:center;gap:var(--gog-calendar-footer-gap);margin-block-start:var(--gog-calendar-time-margin)}.gog-calendar__action:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}:host(.gog-calendar--xsm){--gog-calendar-size-font-size: var(--gog-calendar-xsm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-xsm-day-size)}:host(.gog-calendar--sm){--gog-calendar-size-font-size: var(--gog-calendar-sm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-sm-day-size)}:host(.gog-calendar--lg){--gog-calendar-size-font-size: var(--gog-calendar-lg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-lg-day-size)}:host(.gog-calendar--slg){--gog-calendar-size-font-size: var(--gog-calendar-slg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-slg-day-size)}@media(prefers-reduced-motion:reduce){.gog-calendar__day{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3866
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: CalendarComponent, isStandalone: true, selector: "gog-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, defaultMonth: { classPropertyName: "defaultMonth", publicName: "defaultMonth", isSignal: true, isRequired: false, transformFunction: null }, numberOfMonths: { classPropertyName: "numberOfMonths", publicName: "numberOfMonths", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, showTodayButton: { classPropertyName: "showTodayButton", publicName: "showTodayButton", isSignal: true, isRequired: false, transformFunction: null }, showThisMonthButton: { classPropertyName: "showThisMonthButton", publicName: "showThisMonthButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, thisMonthLabel: { classPropertyName: "thisMonthLabel", publicName: "thisMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, previousMonthLabel: { classPropertyName: "previousMonthLabel", publicName: "previousMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, nextMonthLabel: { classPropertyName: "nextMonthLabel", publicName: "nextMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, previousYearLabel: { classPropertyName: "previousYearLabel", publicName: "previousYearLabel", isSignal: true, isRequired: false, transformFunction: null }, nextYearLabel: { classPropertyName: "nextYearLabel", publicName: "nextYearLabel", isSignal: true, isRequired: false, transformFunction: null }, hoursLabel: { classPropertyName: "hoursLabel", publicName: "hoursLabel", isSignal: true, isRequired: false, transformFunction: null }, minutesLabel: { classPropertyName: "minutesLabel", publicName: "minutesLabel", isSignal: true, isRequired: false, transformFunction: null }, secondsLabel: { classPropertyName: "secondsLabel", publicName: "secondsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", gogDateSelect: "gogDateSelect" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<div class=\"gog-calendar__header\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().previousYear\"\r\n (click)=\"shiftViewYears(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().previousMonth\"\r\n (click)=\"shiftView(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n\r\n <div class=\"gog-calendar__titles\">\r\n @for (month of monthViews(); track $index) {\r\n <span class=\"gog-calendar__title\">{{ month.label }}</span>\r\n }\r\n </div>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().nextMonth\"\r\n (click)=\"shiftView(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().nextYear\"\r\n (click)=\"shiftViewYears(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n</div>\r\n\r\n<div class=\"gog-calendar__months\" (mouseleave)=\"onGridLeave()\">\r\n @for (month of monthViews(); track $index) {\r\n <!--\r\n role=\"grid\" rather than a list of buttons: a month is two-dimensional, and the arrow\r\n keys have to mean \"next day\" and \"next week\" \u2014 which is what the grid role tells\r\n assistive tech to expect. One keydown handler on the grid serves all 42 cells.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the keydown handler is delegated here so 42 cells don't each carry one; the real keyboard targets are the day buttons inside, which are focusable and carry the roving tabindex. The grid itself must not be a tab stop. -->\r\n <table\r\n class=\"gog-calendar__grid\"\r\n role=\"grid\"\r\n [attr.aria-label]=\"month.label\"\r\n (keydown)=\"onGridKeydown($event)\"\r\n >\r\n <thead>\r\n <tr class=\"gog-calendar__weekdays\">\r\n @for (weekday of weekdays(); track $index) {\r\n <th class=\"gog-calendar__weekday\" scope=\"col\" [attr.abbr]=\"weekday\">{{ weekday }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (week of month.weeks; track $index) {\r\n <tr class=\"gog-calendar__week\">\r\n @for (day of week; track day.date.getTime()) {\r\n <td class=\"gog-calendar__cell\" role=\"gridcell\" [attr.aria-selected]=\"day.selected\">\r\n <!--\r\n A roving tabindex across 42 cells: exactly one is tabbable, and the arrows\r\n move it. Tabbing through every day of the month instead would put 42 stops\r\n between the field and whatever follows it.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__day\"\r\n [class.gog-calendar__day--outside]=\"day.outside\"\r\n [class.gog-calendar__day--today]=\"day.today\"\r\n [class.gog-calendar__day--selected]=\"day.selected\"\r\n [class.gog-calendar__day--range-start]=\"day.rangeStart\"\r\n [class.gog-calendar__day--range-end]=\"day.rangeEnd\"\r\n [class.gog-calendar__day--in-range]=\"day.inRange\"\r\n [disabled]=\"day.disabled\"\r\n [attr.aria-disabled]=\"day.disabled\"\r\n [attr.aria-current]=\"day.today ? 'date' : null\"\r\n [tabindex]=\"isFocusedDay(day.date) ? 0 : -1\"\r\n (click)=\"onDayClick(day)\"\r\n (mouseenter)=\"onDayHover(day)\"\r\n >\r\n {{ day.label }}\r\n </button>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n }\r\n</div>\r\n\r\n@if (showTime()) {\r\n <div class=\"gog-calendar__time\">\r\n <gog-icon class=\"gog-calendar__time-icon\" name=\"clock\" [ariaHidden]=\"true\" />\r\n\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n [min]=\"minHour()\"\r\n [max]=\"maxHour()\"\r\n [value]=\"hours()\"\r\n [attr.aria-label]=\"resolvedLabels().hours\"\r\n (input)=\"onHourInput($event)\"\r\n />\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [step]=\"minuteStep()\"\r\n [value]=\"minutes()\"\r\n [attr.aria-label]=\"resolvedLabels().minutes\"\r\n (input)=\"onMinuteInput($event)\"\r\n />\r\n\r\n @if (showSeconds()) {\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [value]=\"seconds()\"\r\n [attr.aria-label]=\"resolvedLabels().seconds\"\r\n (input)=\"onSecondInput($event)\"\r\n />\r\n }\r\n\r\n @if (hourFormat() === '12') {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__meridiem\"\r\n [attr.aria-pressed]=\"isPm()\"\r\n (click)=\"toggleMeridiem()\"\r\n >\r\n {{ isPm() ? 'PM' : 'AM' }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n\r\n@if (showTodayButton() || showThisMonthButton()) {\r\n <!--\r\n Two distinct actions, never one: \"Today\" picks a date, \"This month\" only moves the view.\r\n Collapsing them into a single button is what made the control ambiguous \u2014 after paging\r\n away, the same label reads as \"take me back\" to one person and \"set it to today\" to another.\r\n -->\r\n <div class=\"gog-calendar__footer\">\r\n @if (showThisMonthButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__action--this-month\"\r\n (click)=\"goToThisMonth()\"\r\n >\r\n {{ resolvedLabels().thisMonth }}\r\n </button>\r\n }\r\n\r\n @if (showTodayButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__today\"\r\n [disabled]=\"!isTodaySelectable()\"\r\n (click)=\"selectToday()\"\r\n >\r\n {{ resolvedLabels().today }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block;box-sizing:border-box;padding:var(--gog-calendar-padding);color:var(--gog-calendar-color);font-family:var(--gog-calendar-font-family);font-size:var(--gog-calendar-size-font-size, var(--gog-calendar-md-font-size));contain:layout style}.gog-calendar__header{display:flex;align-items:center;gap:var(--gog-calendar-header-gap);margin-block-end:var(--gog-calendar-header-margin)}.gog-calendar__titles{display:flex;flex:1 1 auto;justify-content:space-around;gap:var(--gog-calendar-header-gap)}.gog-calendar__title{flex:1 1 0;color:var(--gog-calendar-title-color);font-weight:var(--gog-calendar-title-font-weight);text-align:center}.gog-calendar__nav{flex:0 0 auto;width:var(--gog-calendar-nav-size);height:var(--gog-calendar-nav-size);padding:0;border:0;border-radius:var(--gog-calendar-nav-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font-size:var(--gog-calendar-nav-icon-size);letter-spacing:var(--gog-calendar-nav-icon-overlap);cursor:pointer}.gog-calendar__nav:hover{background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__nav:focus-visible,.gog-calendar__day:focus-visible,.gog-calendar__action:focus-visible,.gog-calendar__meridiem:focus-visible,.gog-calendar__time-input:focus-visible{outline:var(--gog-calendar-focus-ring-width) solid var(--gog-calendar-focus-ring-color);outline-offset:var(--gog-calendar-focus-ring-offset)}.gog-calendar__months{display:flex;gap:var(--gog-calendar-months-gap)}.gog-calendar__grid{border-collapse:collapse;table-layout:fixed}.gog-calendar__weekday{padding:var(--gog-calendar-weekday-padding);color:var(--gog-calendar-weekday-color);font-size:var(--gog-calendar-weekday-font-size);font-weight:var(--gog-calendar-weekday-font-weight);text-align:center;text-transform:var(--gog-calendar-weekday-text-transform)}.gog-calendar__cell{padding:0}.gog-calendar__day{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));height:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) transparent;border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-day-bg, var(--gog-calendar-day-rest-bg));color:var(--gog-calendar-day-color, var(--gog-calendar-day-rest-color));font:inherit;cursor:pointer;transition:background-color var(--gog-calendar-transition-duration) var(--gog-easing),color var(--gog-calendar-transition-duration) var(--gog-easing)}.gog-calendar__day:hover:not(:disabled){background-color:var(--gog-calendar-day-hover-bg)}.gog-calendar__day--outside{color:var(--gog-calendar-day-outside-color)}.gog-calendar__day--today{border-color:var(--gog-calendar-today-border-color);font-weight:var(--gog-calendar-today-font-weight)}.gog-calendar__day--in-range{border-radius:0;background-color:var(--gog-calendar-range-bg);color:var(--gog-calendar-range-color)}.gog-calendar__day--range-start{border-start-end-radius:0;border-end-end-radius:0}.gog-calendar__day--range-end{border-start-start-radius:0;border-end-start-radius:0}.gog-calendar__day--selected{background-color:var(--gog-calendar-selected-bg);color:var(--gog-calendar-selected-color);font-weight:var(--gog-calendar-selected-font-weight)}.gog-calendar__day:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}.gog-calendar__time{display:flex;align-items:center;justify-content:center;gap:var(--gog-calendar-time-gap);margin-block-start:var(--gog-calendar-time-margin);padding-block-start:var(--gog-calendar-time-margin);border-block-start:var(--gog-calendar-divider-width) var(--gog-calendar-divider-style) var(--gog-calendar-divider-color)}.gog-calendar__time-icon{color:var(--gog-calendar-weekday-color)}.gog-calendar__time-input{box-sizing:border-box;width:var(--gog-calendar-time-input-width);padding:var(--gog-calendar-time-input-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-time-input-bg);color:var(--gog-calendar-color);font:inherit;text-align:center}.gog-calendar__time-sep{color:var(--gog-calendar-weekday-color)}.gog-calendar__meridiem,.gog-calendar__action{padding:var(--gog-calendar-action-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font:inherit;cursor:pointer}.gog-calendar__meridiem:hover:not(:disabled),.gog-calendar__action:hover:not(:disabled){background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__footer{display:flex;justify-content:center;gap:var(--gog-calendar-footer-gap);margin-block-start:var(--gog-calendar-time-margin)}.gog-calendar__action:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}:host(.gog-calendar--xsm){--gog-calendar-size-font-size: var(--gog-calendar-xsm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-xsm-day-size)}:host(.gog-calendar--sm){--gog-calendar-size-font-size: var(--gog-calendar-sm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-sm-day-size)}:host(.gog-calendar--lg){--gog-calendar-size-font-size: var(--gog-calendar-lg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-lg-day-size)}:host(.gog-calendar--slg){--gog-calendar-size-font-size: var(--gog-calendar-slg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-slg-day-size)}@media(prefers-reduced-motion:reduce){.gog-calendar__day{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3575
3867
|
}
|
|
3576
3868
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
3577
3869
|
type: Component,
|
|
3578
3870
|
args: [{ selector: 'gog-calendar', imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
3579
3871
|
'[class]': 'hostClasses()',
|
|
3580
|
-
}, template: "<div class=\"gog-calendar__header\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"previousYearLabel()\"\r\n (click)=\"shiftViewYears(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"previousMonthLabel()\"\r\n (click)=\"shiftView(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n\r\n <div class=\"gog-calendar__titles\">\r\n @for (month of monthViews(); track $index) {\r\n <span class=\"gog-calendar__title\">{{ month.label }}</span>\r\n }\r\n </div>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"nextMonthLabel()\"\r\n (click)=\"shiftView(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"nextYearLabel()\"\r\n (click)=\"shiftViewYears(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n</div>\r\n\r\n<div class=\"gog-calendar__months\" (mouseleave)=\"onGridLeave()\">\r\n @for (month of monthViews(); track $index) {\r\n <!--\r\n role=\"grid\" rather than a list of buttons: a month is two-dimensional, and the arrow\r\n keys have to mean \"next day\" and \"next week\" \u2014 which is what the grid role tells\r\n assistive tech to expect. One keydown handler on the grid serves all 42 cells.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the keydown handler is delegated here so 42 cells don't each carry one; the real keyboard targets are the day buttons inside, which are focusable and carry the roving tabindex. The grid itself must not be a tab stop. -->\r\n <table\r\n class=\"gog-calendar__grid\"\r\n role=\"grid\"\r\n [attr.aria-label]=\"month.label\"\r\n (keydown)=\"onGridKeydown($event)\"\r\n >\r\n <thead>\r\n <tr class=\"gog-calendar__weekdays\">\r\n @for (weekday of weekdays(); track $index) {\r\n <th class=\"gog-calendar__weekday\" scope=\"col\" [attr.abbr]=\"weekday\">{{ weekday }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (week of month.weeks; track $index) {\r\n <tr class=\"gog-calendar__week\">\r\n @for (day of week; track day.date.getTime()) {\r\n <td class=\"gog-calendar__cell\" role=\"gridcell\" [attr.aria-selected]=\"day.selected\">\r\n <!--\r\n A roving tabindex across 42 cells: exactly one is tabbable, and the arrows\r\n move it. Tabbing through every day of the month instead would put 42 stops\r\n between the field and whatever follows it.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__day\"\r\n [class.gog-calendar__day--outside]=\"day.outside\"\r\n [class.gog-calendar__day--today]=\"day.today\"\r\n [class.gog-calendar__day--selected]=\"day.selected\"\r\n [class.gog-calendar__day--range-start]=\"day.rangeStart\"\r\n [class.gog-calendar__day--range-end]=\"day.rangeEnd\"\r\n [class.gog-calendar__day--in-range]=\"day.inRange\"\r\n [disabled]=\"day.disabled\"\r\n [attr.aria-disabled]=\"day.disabled\"\r\n [attr.aria-current]=\"day.today ? 'date' : null\"\r\n [tabindex]=\"isFocusedDay(day.date) ? 0 : -1\"\r\n (click)=\"onDayClick(day)\"\r\n (mouseenter)=\"onDayHover(day)\"\r\n >\r\n {{ day.label }}\r\n </button>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n }\r\n</div>\r\n\r\n@if (showTime()) {\r\n <div class=\"gog-calendar__time\">\r\n <gog-icon class=\"gog-calendar__time-icon\" name=\"clock\" [ariaHidden]=\"true\" />\r\n\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n [min]=\"minHour()\"\r\n [max]=\"maxHour()\"\r\n [value]=\"hours()\"\r\n aria-label=\"Hours\"\r\n (input)=\"onHourInput($event)\"\r\n />\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [step]=\"minuteStep()\"\r\n [value]=\"minutes()\"\r\n aria-label=\"Minutes\"\r\n (input)=\"onMinuteInput($event)\"\r\n />\r\n\r\n @if (showSeconds()) {\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [value]=\"seconds()\"\r\n aria-label=\"Seconds\"\r\n (input)=\"onSecondInput($event)\"\r\n />\r\n }\r\n\r\n @if (hourFormat() === '12') {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__meridiem\"\r\n [attr.aria-pressed]=\"isPm()\"\r\n (click)=\"toggleMeridiem()\"\r\n >\r\n {{ isPm() ? 'PM' : 'AM' }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n\r\n@if (showTodayButton() || showThisMonthButton()) {\r\n <!--\r\n Two distinct actions, never one: \"Today\" picks a date, \"This month\" only moves the view.\r\n Collapsing them into a single button is what made the control ambiguous \u2014 after paging\r\n away, the same label reads as \"take me back\" to one person and \"set it to today\" to another.\r\n -->\r\n <div class=\"gog-calendar__footer\">\r\n @if (showThisMonthButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__action--this-month\"\r\n (click)=\"goToThisMonth()\"\r\n >\r\n {{ thisMonthLabel() }}\r\n </button>\r\n }\r\n\r\n @if (showTodayButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__today\"\r\n [disabled]=\"!isTodaySelectable()\"\r\n (click)=\"selectToday()\"\r\n >\r\n {{ todayLabel() }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block;box-sizing:border-box;padding:var(--gog-calendar-padding);color:var(--gog-calendar-color);font-family:var(--gog-calendar-font-family);font-size:var(--gog-calendar-size-font-size, var(--gog-calendar-md-font-size));contain:layout style}.gog-calendar__header{display:flex;align-items:center;gap:var(--gog-calendar-header-gap);margin-block-end:var(--gog-calendar-header-margin)}.gog-calendar__titles{display:flex;flex:1 1 auto;justify-content:space-around;gap:var(--gog-calendar-header-gap)}.gog-calendar__title{flex:1 1 0;color:var(--gog-calendar-title-color);font-weight:var(--gog-calendar-title-font-weight);text-align:center}.gog-calendar__nav{flex:0 0 auto;width:var(--gog-calendar-nav-size);height:var(--gog-calendar-nav-size);padding:0;border:0;border-radius:var(--gog-calendar-nav-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font-size:var(--gog-calendar-nav-icon-size);letter-spacing:var(--gog-calendar-nav-icon-overlap);cursor:pointer}.gog-calendar__nav:hover{background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__nav:focus-visible,.gog-calendar__day:focus-visible,.gog-calendar__action:focus-visible,.gog-calendar__meridiem:focus-visible,.gog-calendar__time-input:focus-visible{outline:var(--gog-calendar-focus-ring-width) solid var(--gog-calendar-focus-ring-color);outline-offset:var(--gog-calendar-focus-ring-offset)}.gog-calendar__months{display:flex;gap:var(--gog-calendar-months-gap)}.gog-calendar__grid{border-collapse:collapse;table-layout:fixed}.gog-calendar__weekday{padding:var(--gog-calendar-weekday-padding);color:var(--gog-calendar-weekday-color);font-size:var(--gog-calendar-weekday-font-size);font-weight:var(--gog-calendar-weekday-font-weight);text-align:center;text-transform:var(--gog-calendar-weekday-text-transform)}.gog-calendar__cell{padding:0}.gog-calendar__day{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));height:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) transparent;border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-day-bg, var(--gog-calendar-day-rest-bg));color:var(--gog-calendar-day-color, var(--gog-calendar-day-rest-color));font:inherit;cursor:pointer;transition:background-color var(--gog-calendar-transition-duration) var(--gog-easing),color var(--gog-calendar-transition-duration) var(--gog-easing)}.gog-calendar__day:hover:not(:disabled){background-color:var(--gog-calendar-day-hover-bg)}.gog-calendar__day--outside{color:var(--gog-calendar-day-outside-color)}.gog-calendar__day--today{border-color:var(--gog-calendar-today-border-color);font-weight:var(--gog-calendar-today-font-weight)}.gog-calendar__day--in-range{border-radius:0;background-color:var(--gog-calendar-range-bg);color:var(--gog-calendar-range-color)}.gog-calendar__day--range-start{border-start-end-radius:0;border-end-end-radius:0}.gog-calendar__day--range-end{border-start-start-radius:0;border-end-start-radius:0}.gog-calendar__day--selected{background-color:var(--gog-calendar-selected-bg);color:var(--gog-calendar-selected-color);font-weight:var(--gog-calendar-selected-font-weight)}.gog-calendar__day:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}.gog-calendar__time{display:flex;align-items:center;justify-content:center;gap:var(--gog-calendar-time-gap);margin-block-start:var(--gog-calendar-time-margin);padding-block-start:var(--gog-calendar-time-margin);border-block-start:var(--gog-calendar-divider-width) var(--gog-calendar-divider-style) var(--gog-calendar-divider-color)}.gog-calendar__time-icon{color:var(--gog-calendar-weekday-color)}.gog-calendar__time-input{box-sizing:border-box;width:var(--gog-calendar-time-input-width);padding:var(--gog-calendar-time-input-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-time-input-bg);color:var(--gog-calendar-color);font:inherit;text-align:center}.gog-calendar__time-sep{color:var(--gog-calendar-weekday-color)}.gog-calendar__meridiem,.gog-calendar__action{padding:var(--gog-calendar-action-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font:inherit;cursor:pointer}.gog-calendar__meridiem:hover:not(:disabled),.gog-calendar__action:hover:not(:disabled){background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__footer{display:flex;justify-content:center;gap:var(--gog-calendar-footer-gap);margin-block-start:var(--gog-calendar-time-margin)}.gog-calendar__action:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}:host(.gog-calendar--xsm){--gog-calendar-size-font-size: var(--gog-calendar-xsm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-xsm-day-size)}:host(.gog-calendar--sm){--gog-calendar-size-font-size: var(--gog-calendar-sm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-sm-day-size)}:host(.gog-calendar--lg){--gog-calendar-size-font-size: var(--gog-calendar-lg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-lg-day-size)}:host(.gog-calendar--slg){--gog-calendar-size-font-size: var(--gog-calendar-slg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-slg-day-size)}@media(prefers-reduced-motion:reduce){.gog-calendar__day{transition:none}}\n"] }]
|
|
3581
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], defaultMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultMonth", required: false }] }], numberOfMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberOfMonths", required: false }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], showTodayButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTodayButton", required: false }] }], showThisMonthButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThisMonthButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], thisMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "thisMonthLabel", required: false }] }], previousMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousMonthLabel", required: false }] }], nextMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextMonthLabel", required: false }] }], previousYearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousYearLabel", required: false }] }], nextYearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextYearLabel", required: false }] }], gogDateSelect: [{ type: i0.Output, args: ["gogDateSelect"] }] } });
|
|
3872
|
+
}, template: "<div class=\"gog-calendar__header\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().previousYear\"\r\n (click)=\"shiftViewYears(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().previousMonth\"\r\n (click)=\"shiftView(-1)\"\r\n >\r\n <gog-icon name=\"chevron-left\" />\r\n </button>\r\n\r\n <div class=\"gog-calendar__titles\">\r\n @for (month of monthViews(); track $index) {\r\n <span class=\"gog-calendar__title\">{{ month.label }}</span>\r\n }\r\n </div>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().nextMonth\"\r\n (click)=\"shiftView(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__nav gog-inline-center\"\r\n [attr.aria-label]=\"resolvedLabels().nextYear\"\r\n (click)=\"shiftViewYears(1)\"\r\n >\r\n <gog-icon name=\"chevron-right\" />\r\n <gog-icon name=\"chevron-right\" />\r\n </button>\r\n</div>\r\n\r\n<div class=\"gog-calendar__months\" (mouseleave)=\"onGridLeave()\">\r\n @for (month of monthViews(); track $index) {\r\n <!--\r\n role=\"grid\" rather than a list of buttons: a month is two-dimensional, and the arrow\r\n keys have to mean \"next day\" and \"next week\" \u2014 which is what the grid role tells\r\n assistive tech to expect. One keydown handler on the grid serves all 42 cells.\r\n -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the keydown handler is delegated here so 42 cells don't each carry one; the real keyboard targets are the day buttons inside, which are focusable and carry the roving tabindex. The grid itself must not be a tab stop. -->\r\n <table\r\n class=\"gog-calendar__grid\"\r\n role=\"grid\"\r\n [attr.aria-label]=\"month.label\"\r\n (keydown)=\"onGridKeydown($event)\"\r\n >\r\n <thead>\r\n <tr class=\"gog-calendar__weekdays\">\r\n @for (weekday of weekdays(); track $index) {\r\n <th class=\"gog-calendar__weekday\" scope=\"col\" [attr.abbr]=\"weekday\">{{ weekday }}</th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (week of month.weeks; track $index) {\r\n <tr class=\"gog-calendar__week\">\r\n @for (day of week; track day.date.getTime()) {\r\n <td class=\"gog-calendar__cell\" role=\"gridcell\" [attr.aria-selected]=\"day.selected\">\r\n <!--\r\n A roving tabindex across 42 cells: exactly one is tabbable, and the arrows\r\n move it. Tabbing through every day of the month instead would put 42 stops\r\n between the field and whatever follows it.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__day\"\r\n [class.gog-calendar__day--outside]=\"day.outside\"\r\n [class.gog-calendar__day--today]=\"day.today\"\r\n [class.gog-calendar__day--selected]=\"day.selected\"\r\n [class.gog-calendar__day--range-start]=\"day.rangeStart\"\r\n [class.gog-calendar__day--range-end]=\"day.rangeEnd\"\r\n [class.gog-calendar__day--in-range]=\"day.inRange\"\r\n [disabled]=\"day.disabled\"\r\n [attr.aria-disabled]=\"day.disabled\"\r\n [attr.aria-current]=\"day.today ? 'date' : null\"\r\n [tabindex]=\"isFocusedDay(day.date) ? 0 : -1\"\r\n (click)=\"onDayClick(day)\"\r\n (mouseenter)=\"onDayHover(day)\"\r\n >\r\n {{ day.label }}\r\n </button>\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n }\r\n</div>\r\n\r\n@if (showTime()) {\r\n <div class=\"gog-calendar__time\">\r\n <gog-icon class=\"gog-calendar__time-icon\" name=\"clock\" [ariaHidden]=\"true\" />\r\n\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n [min]=\"minHour()\"\r\n [max]=\"maxHour()\"\r\n [value]=\"hours()\"\r\n [attr.aria-label]=\"resolvedLabels().hours\"\r\n (input)=\"onHourInput($event)\"\r\n />\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [step]=\"minuteStep()\"\r\n [value]=\"minutes()\"\r\n [attr.aria-label]=\"resolvedLabels().minutes\"\r\n (input)=\"onMinuteInput($event)\"\r\n />\r\n\r\n @if (showSeconds()) {\r\n <span class=\"gog-calendar__time-sep\" aria-hidden=\"true\">:</span>\r\n <input\r\n type=\"number\"\r\n class=\"gog-calendar__time-input\"\r\n min=\"0\"\r\n max=\"59\"\r\n [value]=\"seconds()\"\r\n [attr.aria-label]=\"resolvedLabels().seconds\"\r\n (input)=\"onSecondInput($event)\"\r\n />\r\n }\r\n\r\n @if (hourFormat() === '12') {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__meridiem\"\r\n [attr.aria-pressed]=\"isPm()\"\r\n (click)=\"toggleMeridiem()\"\r\n >\r\n {{ isPm() ? 'PM' : 'AM' }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n\r\n@if (showTodayButton() || showThisMonthButton()) {\r\n <!--\r\n Two distinct actions, never one: \"Today\" picks a date, \"This month\" only moves the view.\r\n Collapsing them into a single button is what made the control ambiguous \u2014 after paging\r\n away, the same label reads as \"take me back\" to one person and \"set it to today\" to another.\r\n -->\r\n <div class=\"gog-calendar__footer\">\r\n @if (showThisMonthButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__action--this-month\"\r\n (click)=\"goToThisMonth()\"\r\n >\r\n {{ resolvedLabels().thisMonth }}\r\n </button>\r\n }\r\n\r\n @if (showTodayButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-calendar__action gog-calendar__today\"\r\n [disabled]=\"!isTodaySelectable()\"\r\n (click)=\"selectToday()\"\r\n >\r\n {{ resolvedLabels().today }}\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block;box-sizing:border-box;padding:var(--gog-calendar-padding);color:var(--gog-calendar-color);font-family:var(--gog-calendar-font-family);font-size:var(--gog-calendar-size-font-size, var(--gog-calendar-md-font-size));contain:layout style}.gog-calendar__header{display:flex;align-items:center;gap:var(--gog-calendar-header-gap);margin-block-end:var(--gog-calendar-header-margin)}.gog-calendar__titles{display:flex;flex:1 1 auto;justify-content:space-around;gap:var(--gog-calendar-header-gap)}.gog-calendar__title{flex:1 1 0;color:var(--gog-calendar-title-color);font-weight:var(--gog-calendar-title-font-weight);text-align:center}.gog-calendar__nav{flex:0 0 auto;width:var(--gog-calendar-nav-size);height:var(--gog-calendar-nav-size);padding:0;border:0;border-radius:var(--gog-calendar-nav-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font-size:var(--gog-calendar-nav-icon-size);letter-spacing:var(--gog-calendar-nav-icon-overlap);cursor:pointer}.gog-calendar__nav:hover{background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__nav:focus-visible,.gog-calendar__day:focus-visible,.gog-calendar__action:focus-visible,.gog-calendar__meridiem:focus-visible,.gog-calendar__time-input:focus-visible{outline:var(--gog-calendar-focus-ring-width) solid var(--gog-calendar-focus-ring-color);outline-offset:var(--gog-calendar-focus-ring-offset)}.gog-calendar__months{display:flex;gap:var(--gog-calendar-months-gap)}.gog-calendar__grid{border-collapse:collapse;table-layout:fixed}.gog-calendar__weekday{padding:var(--gog-calendar-weekday-padding);color:var(--gog-calendar-weekday-color);font-size:var(--gog-calendar-weekday-font-size);font-weight:var(--gog-calendar-weekday-font-weight);text-align:center;text-transform:var(--gog-calendar-weekday-text-transform)}.gog-calendar__cell{padding:0}.gog-calendar__day{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));height:var(--gog-calendar-day-size, var(--gog-calendar-size-day-size, var(--gog-calendar-md-day-size)));border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) transparent;border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-day-bg, var(--gog-calendar-day-rest-bg));color:var(--gog-calendar-day-color, var(--gog-calendar-day-rest-color));font:inherit;cursor:pointer;transition:background-color var(--gog-calendar-transition-duration) var(--gog-easing),color var(--gog-calendar-transition-duration) var(--gog-easing)}.gog-calendar__day:hover:not(:disabled){background-color:var(--gog-calendar-day-hover-bg)}.gog-calendar__day--outside{color:var(--gog-calendar-day-outside-color)}.gog-calendar__day--today{border-color:var(--gog-calendar-today-border-color);font-weight:var(--gog-calendar-today-font-weight)}.gog-calendar__day--in-range{border-radius:0;background-color:var(--gog-calendar-range-bg);color:var(--gog-calendar-range-color)}.gog-calendar__day--range-start{border-start-end-radius:0;border-end-end-radius:0}.gog-calendar__day--range-end{border-start-start-radius:0;border-end-start-radius:0}.gog-calendar__day--selected{background-color:var(--gog-calendar-selected-bg);color:var(--gog-calendar-selected-color);font-weight:var(--gog-calendar-selected-font-weight)}.gog-calendar__day:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}.gog-calendar__time{display:flex;align-items:center;justify-content:center;gap:var(--gog-calendar-time-gap);margin-block-start:var(--gog-calendar-time-margin);padding-block-start:var(--gog-calendar-time-margin);border-block-start:var(--gog-calendar-divider-width) var(--gog-calendar-divider-style) var(--gog-calendar-divider-color)}.gog-calendar__time-icon{color:var(--gog-calendar-weekday-color)}.gog-calendar__time-input{box-sizing:border-box;width:var(--gog-calendar-time-input-width);padding:var(--gog-calendar-time-input-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-time-input-bg);color:var(--gog-calendar-color);font:inherit;text-align:center}.gog-calendar__time-sep{color:var(--gog-calendar-weekday-color)}.gog-calendar__meridiem,.gog-calendar__action{padding:var(--gog-calendar-action-padding);border:var(--gog-calendar-day-border-width) var(--gog-calendar-day-border-style) var(--gog-calendar-divider-color);border-radius:var(--gog-calendar-day-radius);background-color:var(--gog-calendar-nav-bg);color:var(--gog-calendar-nav-color);font:inherit;cursor:pointer}.gog-calendar__meridiem:hover:not(:disabled),.gog-calendar__action:hover:not(:disabled){background-color:var(--gog-calendar-nav-hover-bg);color:var(--gog-calendar-nav-hover-color)}.gog-calendar__footer{display:flex;justify-content:center;gap:var(--gog-calendar-footer-gap);margin-block-start:var(--gog-calendar-time-margin)}.gog-calendar__action:disabled{opacity:var(--gog-calendar-disabled-opacity);cursor:not-allowed}:host(.gog-calendar--xsm){--gog-calendar-size-font-size: var(--gog-calendar-xsm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-xsm-day-size)}:host(.gog-calendar--sm){--gog-calendar-size-font-size: var(--gog-calendar-sm-font-size);--gog-calendar-size-day-size: var(--gog-calendar-sm-day-size)}:host(.gog-calendar--lg){--gog-calendar-size-font-size: var(--gog-calendar-lg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-lg-day-size)}:host(.gog-calendar--slg){--gog-calendar-size-font-size: var(--gog-calendar-slg-font-size);--gog-calendar-size-day-size: var(--gog-calendar-slg-day-size)}@media(prefers-reduced-motion:reduce){.gog-calendar__day{transition:none}}\n"] }]
|
|
3873
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], defaultMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultMonth", required: false }] }], numberOfMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberOfMonths", required: false }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], showTodayButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTodayButton", required: false }] }], showThisMonthButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThisMonthButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], thisMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "thisMonthLabel", required: false }] }], previousMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousMonthLabel", required: false }] }], nextMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextMonthLabel", required: false }] }], previousYearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousYearLabel", required: false }] }], nextYearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextYearLabel", required: false }] }], hoursLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoursLabel", required: false }] }], minutesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "minutesLabel", required: false }] }], secondsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondsLabel", required: false }] }], gogDateSelect: [{ type: i0.Output, args: ["gogDateSelect"] }] } });
|
|
3582
3874
|
/** How far into the week `date` sits, given which weekday the week starts on. */
|
|
3583
3875
|
function weekdayOffset(date, firstDayOfWeek) {
|
|
3584
3876
|
return (date.getDay() - firstDayOfWeek + 7) % 7;
|
|
@@ -3605,6 +3897,8 @@ const DEFAULT_DIRECTION = 'auto';
|
|
|
3605
3897
|
const DEFAULT_LOCALE = 'en-US';
|
|
3606
3898
|
const DEFAULT_DATE_FORMAT = 'dd.MM.yyyy';
|
|
3607
3899
|
const DEFAULT_TIME_FORMAT = 'HH:mm';
|
|
3900
|
+
const DEFAULT_CLEAR_DATE_LABEL = 'Clear date';
|
|
3901
|
+
const DEFAULT_OPEN_CALENDAR_LABEL = 'Open calendar';
|
|
3608
3902
|
/** Rough panel height fed into the up/down placement math before it is on screen. */
|
|
3609
3903
|
const ESTIMATED_PANEL_HEIGHT = 330;
|
|
3610
3904
|
/**
|
|
@@ -3649,8 +3943,13 @@ class DatepickerComponent {
|
|
|
3649
3943
|
* selection alone. Off by default; see `gog-calendar` for why the two are separate controls.
|
|
3650
3944
|
*/
|
|
3651
3945
|
showThisMonthButton = input(false, ...(ngDevMode ? [{ debugName: "showThisMonthButton" }] : /* istanbul ignore next */ []));
|
|
3652
|
-
|
|
3653
|
-
|
|
3946
|
+
/**
|
|
3947
|
+
* Forwarded to `gog-calendar`. Left unset they stay `undefined` all the way down, so the
|
|
3948
|
+
* calendar resolves them against `GOG_CONFIG.labels` itself rather than receiving an English
|
|
3949
|
+
* default from here that would shadow the app's own.
|
|
3950
|
+
*/
|
|
3951
|
+
todayLabel = input(undefined, ...(ngDevMode ? [{ debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
3952
|
+
thisMonthLabel = input(undefined, ...(ngDevMode ? [{ debugName: "thisMonthLabel" }] : /* istanbul ignore next */ []));
|
|
3654
3953
|
/**
|
|
3655
3954
|
* Display and parse pattern (`dd.MM.yyyy`, `yyyy-MM-dd`, …). Left unset it is derived from
|
|
3656
3955
|
* `showTime`, so switching the time section on does not also require restating the format.
|
|
@@ -3671,7 +3970,8 @@ class DatepickerComponent {
|
|
|
3671
3970
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3672
3971
|
fullWidth = input(true, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
3673
3972
|
clearable = input(undefined, ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
3674
|
-
|
|
3973
|
+
/** Unset, falls back to `GOG_CONFIG.labels.clearDate`, then to `'Clear date'`. */
|
|
3974
|
+
clearAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
|
|
3675
3975
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
3676
3976
|
errorDisplay = input(undefined, ...(ngDevMode ? [{ debugName: "errorDisplay" }] : /* istanbul ignore next */ []));
|
|
3677
3977
|
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -3680,7 +3980,8 @@ class DatepickerComponent {
|
|
|
3680
3980
|
appendToBody = input(undefined, ...(ngDevMode ? [{ debugName: "appendToBody" }] : /* istanbul ignore next */ []));
|
|
3681
3981
|
dropdownDirection = input(undefined, ...(ngDevMode ? [{ debugName: "dropdownDirection" }] : /* istanbul ignore next */ []));
|
|
3682
3982
|
dropdownZIndex = input(null, ...(ngDevMode ? [{ debugName: "dropdownZIndex" }] : /* istanbul ignore next */ []));
|
|
3683
|
-
|
|
3983
|
+
/** Unset, falls back to `GOG_CONFIG.labels.openCalendar`, then to `'Open calendar'`. */
|
|
3984
|
+
openCalendarLabel = input(undefined, ...(ngDevMode ? [{ debugName: "openCalendarLabel" }] : /* istanbul ignore next */ []));
|
|
3684
3985
|
/** Two-way bindable value: a `Date` in `'single'` mode, a `GogDateRange` in `'range'`. */
|
|
3685
3986
|
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3686
3987
|
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
@@ -3707,6 +4008,9 @@ class DatepickerComponent {
|
|
|
3707
4008
|
*/
|
|
3708
4009
|
isEditing = signal(false, ...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
3709
4010
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
4011
|
+
/** Instance input → `GOG_CONFIG.labels` → the built-in English default. */
|
|
4012
|
+
resolvedClearLabel = computed(() => resolveConfigured(this.clearAriaLabel(), this.globalConfig.labels?.clearDate, DEFAULT_CLEAR_DATE_LABEL), ...(ngDevMode ? [{ debugName: "resolvedClearLabel" }] : /* istanbul ignore next */ []));
|
|
4013
|
+
resolvedOpenCalendarLabel = computed(() => resolveConfigured(this.openCalendarLabel(), this.globalConfig.labels?.openCalendar, DEFAULT_OPEN_CALENDAR_LABEL), ...(ngDevMode ? [{ debugName: "resolvedOpenCalendarLabel" }] : /* istanbul ignore next */ []));
|
|
3710
4014
|
resolvedSize = computed(() => resolveConfigured(this.size(), this.globalConfig.control?.size, DEFAULT_SIZE$4), ...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
3711
4015
|
resolvedErrorDisplay = computed(() => resolveConfigured(this.errorDisplay(), this.globalConfig.control?.errorDisplay, DEFAULT_ERROR_DISPLAY$4), ...(ngDevMode ? [{ debugName: "resolvedErrorDisplay" }] : /* istanbul ignore next */ []));
|
|
3712
4016
|
resolvedAppendToBody = computed(() => resolveConfigured(this.appendToBody(), this.globalConfig.dropdown?.appendToBody, DEFAULT_APPEND_TO_BODY), ...(ngDevMode ? [{ debugName: "resolvedAppendToBody" }] : /* istanbul ignore next */ []));
|
|
@@ -3946,13 +4250,13 @@ class DatepickerComponent {
|
|
|
3946
4250
|
this.directionState.set(placement.direction);
|
|
3947
4251
|
}
|
|
3948
4252
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3949
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DatepickerComponent, isStandalone: true, selector: "gog-datepicker", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, defaultMonth: { classPropertyName: "defaultMonth", publicName: "defaultMonth", isSignal: true, isRequired: false, transformFunction: null }, numberOfMonths: { classPropertyName: "numberOfMonths", publicName: "numberOfMonths", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, showTodayButton: { classPropertyName: "showTodayButton", publicName: "showTodayButton", isSignal: true, isRequired: false, transformFunction: null }, showThisMonthButton: { classPropertyName: "showThisMonthButton", publicName: "showThisMonthButton", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, thisMonthLabel: { classPropertyName: "thisMonthLabel", publicName: "thisMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, allowTextInput: { classPropertyName: "allowTextInput", publicName: "allowTextInput", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelShowPlaceholder: { classPropertyName: "floatLabelShowPlaceholder", publicName: "floatLabelShowPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, appendToBody: { classPropertyName: "appendToBody", publicName: "appendToBody", isSignal: true, isRequired: false, transformFunction: null }, dropdownDirection: { classPropertyName: "dropdownDirection", publicName: "dropdownDirection", isSignal: true, isRequired: false, transformFunction: null }, dropdownZIndex: { classPropertyName: "dropdownZIndex", publicName: "dropdownZIndex", isSignal: true, isRequired: false, transformFunction: null }, openCalendarLabel: { classPropertyName: "openCalendarLabel", publicName: "openCalendarLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.gog-host--auto-width": "!fullWidth()" } }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (inline()) {\r\n <!--\r\n Inline mode is literally `gog-calendar` with no field and no panel around it \u2014 which is why\r\n the calendar is its own component rather than markup buried in this one.\r\n -->\r\n <gog-calendar\r\n class=\"gog-datepicker__inline\"\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n} @else {\r\n <!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it.\r\n -->\r\n <div\r\n class=\"gog-datepicker\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-datepicker--clearable]=\"showClear()\"\r\n [class.gog-datepicker--disabled]=\"isDisabled()\"\r\n [class.gog-datepicker--open]=\"isOpen()\"\r\n [class.gog-datepicker--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-datepicker--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-datepicker--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-datepicker--floated]=\"isFloatLabelFloated()\"\r\n >\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-datepicker__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-datepicker__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-datepicker__label gog-datepicker__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <input\r\n type=\"text\"\r\n class=\"gog-datepicker__control\"\r\n autocomplete=\"off\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"!allowTextInput() || selectionMode() === 'range'\"\r\n [value]=\"text()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\r\n [attr.aria-haspopup]=\"'dialog'\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onTextInput($event)\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n\r\n <span class=\"gog-datepicker__actions\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__toggle gog-inline-center\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-label]=\"openCalendarLabel()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n (click)=\"toggle()\"\r\n >\r\n <gog-icon name=\"calendar\" />\r\n </button>\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__clear gog-inline-center\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-datepicker__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n One template for both render modes \u2014 inline under the field, or stamped into <body> by the\r\n overlay when `appendToBody` is set, which also copies any scoped `data-theme` across.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- (click) here is housekeeping stopPropagation, not an interactive handler; the focusable, keyboard-operable elements are the calendar's own grid and buttons -->\r\n <div\r\n [id]=\"panelId()\"\r\n class=\"gog-datepicker__panel\"\r\n role=\"dialog\"\r\n [attr.aria-label]=\"label() || ariaLabel() || openCalendarLabel()\"\r\n [class.gog-datepicker__panel--up]=\"!resolvedAppendToBody() && directionState() === 'up'\"\r\n [class.gog-datepicker__panel--portal]=\"resolvedAppendToBody()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.z-index]=\"dropdownZIndex()\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-calendar\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-datepicker{display:flex;flex-direction:column;gap:var(--gog-datepicker-gap);width:100%}.gog-datepicker__label{color:var(--gog-datepicker-label-color);font-family:var(--gog-datepicker-label-font-family);font-size:var(--gog-datepicker-label-font-size);letter-spacing:var(--gog-datepicker-label-letter-spacing);text-transform:var(--gog-datepicker-label-text-transform)}.gog-datepicker__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-datepicker-min-width)}.gog-datepicker__control{box-sizing:border-box;width:100%;padding:var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-actions-reserve) var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-datepicker-border-width) var(--gog-datepicker-border-style) var(--gog-datepicker-border-color);border-radius:var(--gog-datepicker-radius);background-color:var(--gog-datepicker-bg, var(--gog-datepicker-field-bg));color:var(--gog-datepicker-color, var(--gog-datepicker-text-color));font-family:var(--gog-datepicker-font-family);font-size:var(--gog-datepicker-font-size, var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-datepicker-line-height);transition:border-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker__control::placeholder{color:var(--gog-datepicker-placeholder-color)}.gog-datepicker__control:hover:not(:disabled){border-color:var(--gog-datepicker-hover-border-color)}.gog-datepicker__control:focus-visible,.gog-datepicker__toggle:focus-visible,.gog-datepicker__clear:focus-visible{outline:var(--gog-datepicker-focus-ring-width) solid var(--gog-datepicker-focus-ring-color);outline-offset:var(--gog-datepicker-focus-ring-offset)}.gog-datepicker__control:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__control[aria-invalid=true]{border-color:var(--gog-datepicker-error-border-color)}.gog-datepicker__actions{position:absolute;inset-inline-end:var(--gog-datepicker-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-datepicker-actions-gap)}.gog-datepicker__toggle,.gog-datepicker__clear{padding:0;border:0;background:none;color:var(--gog-datepicker-icon-color);cursor:pointer}.gog-datepicker__toggle{font-size:var(--gog-datepicker-toggle-icon-size)}.gog-datepicker__clear{color:var(--gog-datepicker-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-datepicker-clear-icon-ratio))}.gog-datepicker__toggle:hover,.gog-datepicker__clear:hover{color:var(--gog-datepicker-icon-hover-color)}.gog-datepicker__toggle:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__error{color:var(--gog-datepicker-error-color);font-family:var(--gog-datepicker-error-font-family);font-size:var(--gog-datepicker-error-font-size)}.gog-datepicker__panel{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-datepicker-panel-gap));z-index:var(--gog-dropdown-z);width:max-content;border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg);box-shadow:var(--gog-datepicker-panel-shadow)}.gog-datepicker__panel--up{top:auto;bottom:calc(100% + var(--gog-datepicker-panel-gap))}.gog-datepicker__panel--portal{position:fixed;top:0;inset-inline-start:0}.gog-datepicker__inline{border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg)}.gog-datepicker--xsm{--gog-datepicker-size-padding-y: var(--gog-field-xsm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-xsm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-xsm-font-size)}.gog-datepicker--sm{--gog-datepicker-size-padding-y: var(--gog-field-sm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-sm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-sm-font-size)}.gog-datepicker--lg{--gog-datepicker-size-padding-y: var(--gog-field-lg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-lg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-lg-font-size)}.gog-datepicker--slg{--gog-datepicker-size-padding-y: var(--gog-field-slg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-slg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-datepicker,:host(.gog-host--auto-width) .gog-datepicker__field,:host(.gog-host--auto-width) .gog-datepicker__control{width:auto}.gog-datepicker__label--float{position:absolute;left:var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-datepicker-placeholder-color);font-size:var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-datepicker-transition-duration) var(--gog-easing),font-size var(--gog-datepicker-transition-duration) var(--gog-easing),color var(--gog-datepicker-transition-duration) var(--gog-easing),top var(--gog-datepicker-transition-duration) var(--gog-easing),background-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker--float-in,.gog-datepicker--float-on{--gog-datepicker-float-top-padding: calc(var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-datepicker-float-label-reserve))}.gog-datepicker--float-in .gog-datepicker__control,.gog-datepicker--float-on .gog-datepicker__control{padding-top:var(--gog-datepicker-float-top-padding)}.gog-datepicker--float-in .gog-datepicker__label--float,.gog-datepicker--float-on .gog-datepicker__label--float{top:var(--gog-datepicker-float-top-padding);transform:none}.gog-datepicker--float-in.gog-datepicker--floated .gog-datepicker__label--float{top:var(--gog-datepicker-float-label-in-top);transform:translateY(0);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-on.gog-datepicker--floated .gog-datepicker__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing);background-color:var(--gog-datepicker-float-label-on-bg, var(--gog-datepicker-field-bg));padding:0 4px;left:calc(var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-datepicker--float-over.gog-datepicker--floated .gog-datepicker__label--float{top:calc(-1 * var(--gog-datepicker-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-over .gog-datepicker__field{margin-top:var(--gog-datepicker-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-datepicker__control{transition:none}}\n"], dependencies: [{ kind: "component", type: CalendarComponent, selector: "gog-calendar", inputs: ["value", "selectionMode", "min", "max", "disabledDates", "locale", "firstDayOfWeek", "defaultMonth", "numberOfMonths", "showTime", "hourFormat", "minuteStep", "showSeconds", "showTodayButton", "showThisMonthButton", "size", "todayLabel", "thisMonthLabel", "previousMonthLabel", "nextMonthLabel", "previousYearLabel", "nextYearLabel"], outputs: ["valueChange", "gogDateSelect"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4253
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DatepickerComponent, isStandalone: true, selector: "gog-datepicker", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, defaultMonth: { classPropertyName: "defaultMonth", publicName: "defaultMonth", isSignal: true, isRequired: false, transformFunction: null }, numberOfMonths: { classPropertyName: "numberOfMonths", publicName: "numberOfMonths", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, showTodayButton: { classPropertyName: "showTodayButton", publicName: "showTodayButton", isSignal: true, isRequired: false, transformFunction: null }, showThisMonthButton: { classPropertyName: "showThisMonthButton", publicName: "showThisMonthButton", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, thisMonthLabel: { classPropertyName: "thisMonthLabel", publicName: "thisMonthLabel", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, allowTextInput: { classPropertyName: "allowTextInput", publicName: "allowTextInput", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelShowPlaceholder: { classPropertyName: "floatLabelShowPlaceholder", publicName: "floatLabelShowPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, appendToBody: { classPropertyName: "appendToBody", publicName: "appendToBody", isSignal: true, isRequired: false, transformFunction: null }, dropdownDirection: { classPropertyName: "dropdownDirection", publicName: "dropdownDirection", isSignal: true, isRequired: false, transformFunction: null }, dropdownZIndex: { classPropertyName: "dropdownZIndex", publicName: "dropdownZIndex", isSignal: true, isRequired: false, transformFunction: null }, openCalendarLabel: { classPropertyName: "openCalendarLabel", publicName: "openCalendarLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.gog-host--auto-width": "!fullWidth()" } }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (inline()) {\r\n <!--\r\n Inline mode is literally `gog-calendar` with no field and no panel around it \u2014 which is why\r\n the calendar is its own component rather than markup buried in this one.\r\n -->\r\n <gog-calendar\r\n class=\"gog-datepicker__inline\"\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n} @else {\r\n <!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it.\r\n -->\r\n <div\r\n class=\"gog-datepicker\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-datepicker--clearable]=\"showClear()\"\r\n [class.gog-datepicker--disabled]=\"isDisabled()\"\r\n [class.gog-datepicker--open]=\"isOpen()\"\r\n [class.gog-datepicker--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-datepicker--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-datepicker--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-datepicker--floated]=\"isFloatLabelFloated()\"\r\n >\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-datepicker__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-datepicker__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-datepicker__label gog-datepicker__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <input\r\n type=\"text\"\r\n class=\"gog-datepicker__control\"\r\n autocomplete=\"off\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"!allowTextInput() || selectionMode() === 'range'\"\r\n [value]=\"text()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\r\n [attr.aria-haspopup]=\"'dialog'\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onTextInput($event)\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n\r\n <span class=\"gog-datepicker__actions\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__toggle gog-inline-center\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-label]=\"resolvedOpenCalendarLabel()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n (click)=\"toggle()\"\r\n >\r\n <gog-icon name=\"calendar\" />\r\n </button>\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__clear gog-inline-center\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-datepicker__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n One template for both render modes \u2014 inline under the field, or stamped into <body> by the\r\n overlay when `appendToBody` is set, which also copies any scoped `data-theme` across.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- (click) here is housekeeping stopPropagation, not an interactive handler; the focusable, keyboard-operable elements are the calendar's own grid and buttons -->\r\n <div\r\n [id]=\"panelId()\"\r\n class=\"gog-datepicker__panel\"\r\n role=\"dialog\"\r\n [attr.aria-label]=\"label() || ariaLabel() || resolvedOpenCalendarLabel()\"\r\n [class.gog-datepicker__panel--up]=\"!resolvedAppendToBody() && directionState() === 'up'\"\r\n [class.gog-datepicker__panel--portal]=\"resolvedAppendToBody()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.z-index]=\"dropdownZIndex()\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-calendar\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-datepicker{display:flex;flex-direction:column;gap:var(--gog-datepicker-gap);width:100%}.gog-datepicker__label{color:var(--gog-datepicker-label-color);font-family:var(--gog-datepicker-label-font-family);font-size:var(--gog-datepicker-label-font-size);letter-spacing:var(--gog-datepicker-label-letter-spacing);text-transform:var(--gog-datepicker-label-text-transform)}.gog-datepicker__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-datepicker-min-width)}.gog-datepicker__control{box-sizing:border-box;width:100%;padding:var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-actions-reserve) var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-datepicker-border-width) var(--gog-datepicker-border-style) var(--gog-datepicker-border-color);border-radius:var(--gog-datepicker-radius);background-color:var(--gog-datepicker-bg, var(--gog-datepicker-field-bg));color:var(--gog-datepicker-color, var(--gog-datepicker-text-color));font-family:var(--gog-datepicker-font-family);font-size:var(--gog-datepicker-font-size, var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-datepicker-line-height);transition:border-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker__control::placeholder{color:var(--gog-datepicker-placeholder-color)}.gog-datepicker__control:hover:not(:disabled){border-color:var(--gog-datepicker-hover-border-color)}.gog-datepicker__control:focus-visible,.gog-datepicker__toggle:focus-visible,.gog-datepicker__clear:focus-visible{outline:var(--gog-datepicker-focus-ring-width) solid var(--gog-datepicker-focus-ring-color);outline-offset:var(--gog-datepicker-focus-ring-offset)}.gog-datepicker__control:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__control[aria-invalid=true]{border-color:var(--gog-datepicker-error-border-color)}.gog-datepicker__actions{position:absolute;inset-inline-end:var(--gog-datepicker-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-datepicker-actions-gap)}.gog-datepicker__toggle,.gog-datepicker__clear{padding:0;border:0;background:none;color:var(--gog-datepicker-icon-color);cursor:pointer}.gog-datepicker__toggle{font-size:var(--gog-datepicker-toggle-icon-size)}.gog-datepicker__clear{color:var(--gog-datepicker-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-datepicker-clear-icon-ratio))}.gog-datepicker__toggle:hover,.gog-datepicker__clear:hover{color:var(--gog-datepicker-icon-hover-color)}.gog-datepicker__toggle:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__error{color:var(--gog-datepicker-error-color);font-family:var(--gog-datepicker-error-font-family);font-size:var(--gog-datepicker-error-font-size)}.gog-datepicker__panel{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-datepicker-panel-gap));z-index:var(--gog-dropdown-z);width:max-content;border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg);box-shadow:var(--gog-datepicker-panel-shadow)}.gog-datepicker__panel--up{top:auto;bottom:calc(100% + var(--gog-datepicker-panel-gap))}.gog-datepicker__panel--portal{position:fixed;top:0;inset-inline-start:0}.gog-datepicker__inline{border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg)}.gog-datepicker--xsm{--gog-datepicker-size-padding-y: var(--gog-field-xsm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-xsm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-xsm-font-size)}.gog-datepicker--sm{--gog-datepicker-size-padding-y: var(--gog-field-sm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-sm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-sm-font-size)}.gog-datepicker--lg{--gog-datepicker-size-padding-y: var(--gog-field-lg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-lg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-lg-font-size)}.gog-datepicker--slg{--gog-datepicker-size-padding-y: var(--gog-field-slg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-slg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-datepicker,:host(.gog-host--auto-width) .gog-datepicker__field,:host(.gog-host--auto-width) .gog-datepicker__control{width:auto}.gog-datepicker__label--float{position:absolute;left:var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-datepicker-placeholder-color);font-size:var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-datepicker-transition-duration) var(--gog-easing),font-size var(--gog-datepicker-transition-duration) var(--gog-easing),color var(--gog-datepicker-transition-duration) var(--gog-easing),top var(--gog-datepicker-transition-duration) var(--gog-easing),background-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker--float-in,.gog-datepicker--float-on{--gog-datepicker-float-top-padding: calc(var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-datepicker-float-label-reserve))}.gog-datepicker--float-in .gog-datepicker__control,.gog-datepicker--float-on .gog-datepicker__control{padding-top:var(--gog-datepicker-float-top-padding)}.gog-datepicker--float-in .gog-datepicker__label--float,.gog-datepicker--float-on .gog-datepicker__label--float{top:var(--gog-datepicker-float-top-padding);transform:none}.gog-datepicker--float-in.gog-datepicker--floated .gog-datepicker__label--float{top:var(--gog-datepicker-float-label-in-top);transform:translateY(0);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-on.gog-datepicker--floated .gog-datepicker__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing);background-color:var(--gog-datepicker-float-label-on-bg, var(--gog-datepicker-field-bg));padding:0 4px;left:calc(var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-datepicker--float-over.gog-datepicker--floated .gog-datepicker__label--float{top:calc(-1 * var(--gog-datepicker-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-over .gog-datepicker__field{margin-top:var(--gog-datepicker-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-datepicker__control{transition:none}}\n"], dependencies: [{ kind: "component", type: CalendarComponent, selector: "gog-calendar", inputs: ["value", "selectionMode", "min", "max", "disabledDates", "locale", "firstDayOfWeek", "defaultMonth", "numberOfMonths", "showTime", "hourFormat", "minuteStep", "showSeconds", "showTodayButton", "showThisMonthButton", "size", "todayLabel", "thisMonthLabel", "previousMonthLabel", "nextMonthLabel", "previousYearLabel", "nextYearLabel", "hoursLabel", "minutesLabel", "secondsLabel"], outputs: ["valueChange", "gogDateSelect"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3950
4254
|
}
|
|
3951
4255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
3952
4256
|
type: Component,
|
|
3953
4257
|
args: [{ selector: 'gog-datepicker', imports: [CalendarComponent, IconComponent, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
3954
4258
|
'[class.gog-host--auto-width]': '!fullWidth()',
|
|
3955
|
-
}, template: "@if (inline()) {\r\n <!--\r\n Inline mode is literally `gog-calendar` with no field and no panel around it \u2014 which is why\r\n the calendar is its own component rather than markup buried in this one.\r\n -->\r\n <gog-calendar\r\n class=\"gog-datepicker__inline\"\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n} @else {\r\n <!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it.\r\n -->\r\n <div\r\n class=\"gog-datepicker\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-datepicker--clearable]=\"showClear()\"\r\n [class.gog-datepicker--disabled]=\"isDisabled()\"\r\n [class.gog-datepicker--open]=\"isOpen()\"\r\n [class.gog-datepicker--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-datepicker--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-datepicker--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-datepicker--floated]=\"isFloatLabelFloated()\"\r\n >\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-datepicker__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-datepicker__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-datepicker__label gog-datepicker__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <input\r\n type=\"text\"\r\n class=\"gog-datepicker__control\"\r\n autocomplete=\"off\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"!allowTextInput() || selectionMode() === 'range'\"\r\n [value]=\"text()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\r\n [attr.aria-haspopup]=\"'dialog'\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onTextInput($event)\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n\r\n <span class=\"gog-datepicker__actions\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__toggle gog-inline-center\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-label]=\"openCalendarLabel()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n (click)=\"toggle()\"\r\n >\r\n <gog-icon name=\"calendar\" />\r\n </button>\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__clear gog-inline-center\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-datepicker__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n One template for both render modes \u2014 inline under the field, or stamped into <body> by the\r\n overlay when `appendToBody` is set, which also copies any scoped `data-theme` across.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- (click) here is housekeeping stopPropagation, not an interactive handler; the focusable, keyboard-operable elements are the calendar's own grid and buttons -->\r\n <div\r\n [id]=\"panelId()\"\r\n class=\"gog-datepicker__panel\"\r\n role=\"dialog\"\r\n [attr.aria-label]=\"label() || ariaLabel() || openCalendarLabel()\"\r\n [class.gog-datepicker__panel--up]=\"!resolvedAppendToBody() && directionState() === 'up'\"\r\n [class.gog-datepicker__panel--portal]=\"resolvedAppendToBody()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.z-index]=\"dropdownZIndex()\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-calendar\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-datepicker{display:flex;flex-direction:column;gap:var(--gog-datepicker-gap);width:100%}.gog-datepicker__label{color:var(--gog-datepicker-label-color);font-family:var(--gog-datepicker-label-font-family);font-size:var(--gog-datepicker-label-font-size);letter-spacing:var(--gog-datepicker-label-letter-spacing);text-transform:var(--gog-datepicker-label-text-transform)}.gog-datepicker__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-datepicker-min-width)}.gog-datepicker__control{box-sizing:border-box;width:100%;padding:var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-actions-reserve) var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-datepicker-border-width) var(--gog-datepicker-border-style) var(--gog-datepicker-border-color);border-radius:var(--gog-datepicker-radius);background-color:var(--gog-datepicker-bg, var(--gog-datepicker-field-bg));color:var(--gog-datepicker-color, var(--gog-datepicker-text-color));font-family:var(--gog-datepicker-font-family);font-size:var(--gog-datepicker-font-size, var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-datepicker-line-height);transition:border-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker__control::placeholder{color:var(--gog-datepicker-placeholder-color)}.gog-datepicker__control:hover:not(:disabled){border-color:var(--gog-datepicker-hover-border-color)}.gog-datepicker__control:focus-visible,.gog-datepicker__toggle:focus-visible,.gog-datepicker__clear:focus-visible{outline:var(--gog-datepicker-focus-ring-width) solid var(--gog-datepicker-focus-ring-color);outline-offset:var(--gog-datepicker-focus-ring-offset)}.gog-datepicker__control:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__control[aria-invalid=true]{border-color:var(--gog-datepicker-error-border-color)}.gog-datepicker__actions{position:absolute;inset-inline-end:var(--gog-datepicker-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-datepicker-actions-gap)}.gog-datepicker__toggle,.gog-datepicker__clear{padding:0;border:0;background:none;color:var(--gog-datepicker-icon-color);cursor:pointer}.gog-datepicker__toggle{font-size:var(--gog-datepicker-toggle-icon-size)}.gog-datepicker__clear{color:var(--gog-datepicker-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-datepicker-clear-icon-ratio))}.gog-datepicker__toggle:hover,.gog-datepicker__clear:hover{color:var(--gog-datepicker-icon-hover-color)}.gog-datepicker__toggle:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__error{color:var(--gog-datepicker-error-color);font-family:var(--gog-datepicker-error-font-family);font-size:var(--gog-datepicker-error-font-size)}.gog-datepicker__panel{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-datepicker-panel-gap));z-index:var(--gog-dropdown-z);width:max-content;border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg);box-shadow:var(--gog-datepicker-panel-shadow)}.gog-datepicker__panel--up{top:auto;bottom:calc(100% + var(--gog-datepicker-panel-gap))}.gog-datepicker__panel--portal{position:fixed;top:0;inset-inline-start:0}.gog-datepicker__inline{border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg)}.gog-datepicker--xsm{--gog-datepicker-size-padding-y: var(--gog-field-xsm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-xsm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-xsm-font-size)}.gog-datepicker--sm{--gog-datepicker-size-padding-y: var(--gog-field-sm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-sm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-sm-font-size)}.gog-datepicker--lg{--gog-datepicker-size-padding-y: var(--gog-field-lg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-lg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-lg-font-size)}.gog-datepicker--slg{--gog-datepicker-size-padding-y: var(--gog-field-slg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-slg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-datepicker,:host(.gog-host--auto-width) .gog-datepicker__field,:host(.gog-host--auto-width) .gog-datepicker__control{width:auto}.gog-datepicker__label--float{position:absolute;left:var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-datepicker-placeholder-color);font-size:var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-datepicker-transition-duration) var(--gog-easing),font-size var(--gog-datepicker-transition-duration) var(--gog-easing),color var(--gog-datepicker-transition-duration) var(--gog-easing),top var(--gog-datepicker-transition-duration) var(--gog-easing),background-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker--float-in,.gog-datepicker--float-on{--gog-datepicker-float-top-padding: calc(var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-datepicker-float-label-reserve))}.gog-datepicker--float-in .gog-datepicker__control,.gog-datepicker--float-on .gog-datepicker__control{padding-top:var(--gog-datepicker-float-top-padding)}.gog-datepicker--float-in .gog-datepicker__label--float,.gog-datepicker--float-on .gog-datepicker__label--float{top:var(--gog-datepicker-float-top-padding);transform:none}.gog-datepicker--float-in.gog-datepicker--floated .gog-datepicker__label--float{top:var(--gog-datepicker-float-label-in-top);transform:translateY(0);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-on.gog-datepicker--floated .gog-datepicker__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing);background-color:var(--gog-datepicker-float-label-on-bg, var(--gog-datepicker-field-bg));padding:0 4px;left:calc(var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-datepicker--float-over.gog-datepicker--floated .gog-datepicker__label--float{top:calc(-1 * var(--gog-datepicker-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-over .gog-datepicker__field{margin-top:var(--gog-datepicker-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-datepicker__control{transition:none}}\n"] }]
|
|
4259
|
+
}, template: "@if (inline()) {\r\n <!--\r\n Inline mode is literally `gog-calendar` with no field and no panel around it \u2014 which is why\r\n the calendar is its own component rather than markup buried in this one.\r\n -->\r\n <gog-calendar\r\n class=\"gog-datepicker__inline\"\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n} @else {\r\n <!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it.\r\n -->\r\n <div\r\n class=\"gog-datepicker\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-datepicker--clearable]=\"showClear()\"\r\n [class.gog-datepicker--disabled]=\"isDisabled()\"\r\n [class.gog-datepicker--open]=\"isOpen()\"\r\n [class.gog-datepicker--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-datepicker--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-datepicker--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-datepicker--floated]=\"isFloatLabelFloated()\"\r\n >\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-datepicker__label\" [for]=\"triggerId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-datepicker__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-datepicker__label gog-datepicker__label--float\" [for]=\"triggerId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n\r\n <input\r\n type=\"text\"\r\n class=\"gog-datepicker__control\"\r\n autocomplete=\"off\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"!allowTextInput() || selectionMode() === 'range'\"\r\n [value]=\"text()\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\r\n [attr.aria-haspopup]=\"'dialog'\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onTextInput($event)\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n\r\n <span class=\"gog-datepicker__actions\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__toggle gog-inline-center\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-label]=\"resolvedOpenCalendarLabel()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"panelId()\"\r\n (click)=\"toggle()\"\r\n >\r\n <gog-icon name=\"calendar\" />\r\n </button>\r\n\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-datepicker__clear gog-inline-center\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-datepicker__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n </div>\r\n}\r\n\r\n<!--\r\n One template for both render modes \u2014 inline under the field, or stamped into <body> by the\r\n overlay when `appendToBody` is set, which also copies any scoped `data-theme` across.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- (click) here is housekeeping stopPropagation, not an interactive handler; the focusable, keyboard-operable elements are the calendar's own grid and buttons -->\r\n <div\r\n [id]=\"panelId()\"\r\n class=\"gog-datepicker__panel\"\r\n role=\"dialog\"\r\n [attr.aria-label]=\"label() || ariaLabel() || resolvedOpenCalendarLabel()\"\r\n [class.gog-datepicker__panel--up]=\"!resolvedAppendToBody() && directionState() === 'up'\"\r\n [class.gog-datepicker__panel--portal]=\"resolvedAppendToBody()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.z-index]=\"dropdownZIndex()\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <gog-calendar\r\n [value]=\"value()\"\r\n [selectionMode]=\"selectionMode()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabledDates]=\"disabledDates()\"\r\n [locale]=\"resolvedLocale()\"\r\n [firstDayOfWeek]=\"resolvedFirstDayOfWeek()\"\r\n [defaultMonth]=\"defaultMonth()\"\r\n [numberOfMonths]=\"numberOfMonths()\"\r\n [showTime]=\"showTime()\"\r\n [hourFormat]=\"hourFormat()\"\r\n [minuteStep]=\"minuteStep()\"\r\n [showSeconds]=\"showSeconds()\"\r\n [showTodayButton]=\"showTodayButton()\"\r\n [showThisMonthButton]=\"showThisMonthButton()\"\r\n [todayLabel]=\"todayLabel()\"\r\n [thisMonthLabel]=\"thisMonthLabel()\"\r\n [size]=\"resolvedSize()\"\r\n (valueChange)=\"onCalendarValue($event)\"\r\n (gogDateSelect)=\"onCalendarSelect($event)\"\r\n />\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-datepicker{display:flex;flex-direction:column;gap:var(--gog-datepicker-gap);width:100%}.gog-datepicker__label{color:var(--gog-datepicker-label-color);font-family:var(--gog-datepicker-label-font-family);font-size:var(--gog-datepicker-label-font-size);letter-spacing:var(--gog-datepicker-label-letter-spacing);text-transform:var(--gog-datepicker-label-text-transform)}.gog-datepicker__field{position:relative;display:flex;align-items:center;width:100%;min-width:var(--gog-datepicker-min-width)}.gog-datepicker__control{box-sizing:border-box;width:100%;padding:var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-actions-reserve) var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));border:var(--gog-datepicker-border-width) var(--gog-datepicker-border-style) var(--gog-datepicker-border-color);border-radius:var(--gog-datepicker-radius);background-color:var(--gog-datepicker-bg, var(--gog-datepicker-field-bg));color:var(--gog-datepicker-color, var(--gog-datepicker-text-color));font-family:var(--gog-datepicker-font-family);font-size:var(--gog-datepicker-font-size, var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size)));line-height:var(--gog-datepicker-line-height);transition:border-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker__control::placeholder{color:var(--gog-datepicker-placeholder-color)}.gog-datepicker__control:hover:not(:disabled){border-color:var(--gog-datepicker-hover-border-color)}.gog-datepicker__control:focus-visible,.gog-datepicker__toggle:focus-visible,.gog-datepicker__clear:focus-visible{outline:var(--gog-datepicker-focus-ring-width) solid var(--gog-datepicker-focus-ring-color);outline-offset:var(--gog-datepicker-focus-ring-offset)}.gog-datepicker__control:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__control[aria-invalid=true]{border-color:var(--gog-datepicker-error-border-color)}.gog-datepicker__actions{position:absolute;inset-inline-end:var(--gog-datepicker-actions-inset);display:inline-flex;align-items:center;flex-direction:row-reverse;gap:var(--gog-datepicker-actions-gap)}.gog-datepicker__toggle,.gog-datepicker__clear{padding:0;border:0;background:none;color:var(--gog-datepicker-icon-color);cursor:pointer}.gog-datepicker__toggle{font-size:var(--gog-datepicker-toggle-icon-size)}.gog-datepicker__clear{color:var(--gog-datepicker-clear-color);font-size:calc(var(--gog-icon-size) * var(--gog-datepicker-clear-icon-ratio))}.gog-datepicker__toggle:hover,.gog-datepicker__clear:hover{color:var(--gog-datepicker-icon-hover-color)}.gog-datepicker__toggle:disabled{opacity:var(--gog-datepicker-disabled-opacity);cursor:not-allowed}.gog-datepicker__error{color:var(--gog-datepicker-error-color);font-family:var(--gog-datepicker-error-font-family);font-size:var(--gog-datepicker-error-font-size)}.gog-datepicker__panel{position:absolute;inset-inline-start:0;top:calc(100% + var(--gog-datepicker-panel-gap));z-index:var(--gog-dropdown-z);width:max-content;border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg);box-shadow:var(--gog-datepicker-panel-shadow)}.gog-datepicker__panel--up{top:auto;bottom:calc(100% + var(--gog-datepicker-panel-gap))}.gog-datepicker__panel--portal{position:fixed;top:0;inset-inline-start:0}.gog-datepicker__inline{border:var(--gog-datepicker-panel-border-width) var(--gog-datepicker-panel-border-style) var(--gog-datepicker-panel-border-color);border-radius:var(--gog-datepicker-panel-radius);background-color:var(--gog-datepicker-panel-bg)}.gog-datepicker--xsm{--gog-datepicker-size-padding-y: var(--gog-field-xsm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-xsm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-xsm-font-size)}.gog-datepicker--sm{--gog-datepicker-size-padding-y: var(--gog-field-sm-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-sm-padding-x);--gog-datepicker-size-font-size: var(--gog-field-sm-font-size)}.gog-datepicker--lg{--gog-datepicker-size-padding-y: var(--gog-field-lg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-lg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-lg-font-size)}.gog-datepicker--slg{--gog-datepicker-size-padding-y: var(--gog-field-slg-padding-y);--gog-datepicker-size-padding-x: var(--gog-field-slg-padding-x);--gog-datepicker-size-font-size: var(--gog-field-slg-font-size)}:host(.gog-host--auto-width) .gog-datepicker,:host(.gog-host--auto-width) .gog-datepicker__field,:host(.gog-host--auto-width) .gog-datepicker__control{width:auto}.gog-datepicker__label--float{position:absolute;left:var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-datepicker-placeholder-color);font-size:var(--gog-datepicker-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-datepicker-transition-duration) var(--gog-easing),font-size var(--gog-datepicker-transition-duration) var(--gog-easing),color var(--gog-datepicker-transition-duration) var(--gog-easing),top var(--gog-datepicker-transition-duration) var(--gog-easing),background-color var(--gog-datepicker-transition-duration) var(--gog-easing)}.gog-datepicker--float-in,.gog-datepicker--float-on{--gog-datepicker-float-top-padding: calc(var(--gog-datepicker-padding-y, var(--gog-datepicker-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-datepicker-float-label-reserve))}.gog-datepicker--float-in .gog-datepicker__control,.gog-datepicker--float-on .gog-datepicker__control{padding-top:var(--gog-datepicker-float-top-padding)}.gog-datepicker--float-in .gog-datepicker__label--float,.gog-datepicker--float-on .gog-datepicker__label--float{top:var(--gog-datepicker-float-top-padding);transform:none}.gog-datepicker--float-in.gog-datepicker--floated .gog-datepicker__label--float{top:var(--gog-datepicker-float-label-in-top);transform:translateY(0);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-on.gog-datepicker--floated .gog-datepicker__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing);background-color:var(--gog-datepicker-float-label-on-bg, var(--gog-datepicker-field-bg));padding:0 4px;left:calc(var(--gog-datepicker-padding-x, var(--gog-datepicker-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-datepicker--float-over.gog-datepicker--floated .gog-datepicker__label--float{top:calc(-1 * var(--gog-datepicker-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-datepicker-label-font-size);color:var(--gog-datepicker-label-color);text-transform:var(--gog-datepicker-label-text-transform);letter-spacing:var(--gog-datepicker-label-letter-spacing)}.gog-datepicker--float-over .gog-datepicker__field{margin-top:var(--gog-datepicker-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-datepicker__control{transition:none}}\n"] }]
|
|
3956
4260
|
}], ctorParameters: () => [], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], defaultMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultMonth", required: false }] }], numberOfMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberOfMonths", required: false }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], showTodayButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTodayButton", required: false }] }], showThisMonthButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThisMonthButton", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], thisMonthLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "thisMonthLabel", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], allowTextInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowTextInput", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], floatLabelShowPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelShowPlaceholder", required: false }] }], appendToBody: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendToBody", required: false }] }], dropdownDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownDirection", required: false }] }], dropdownZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownZIndex", required: false }] }], openCalendarLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openCalendarLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], panelTemplate: [{ type: i0.ViewChild, args: ['panelTpl', { isSignal: true }] }] } });
|
|
3957
4261
|
|
|
3958
4262
|
/**
|
|
@@ -4165,12 +4469,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4165
4469
|
}, template: "<label [class.gog-toggle--disabled]=\"isDisabled()\" class=\"gog-toggle gog-contained-layout\">\n <!--\n A real checkbox with role=\"switch\": the role changes only how it is announced, so the\n space key, form registration and the :checked selector all keep working natively.\n -->\n <input\n (blur)=\"onBlur()\"\n (change)=\"onInputChange($event)\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n class=\"gog-toggle__input\"\n role=\"switch\"\n type=\"checkbox\"\n />\n\n <span [class.gog-toggle__track--on]=\"checked()\" class=\"gog-toggle__track\">\n @if (hasTrackLabels()) {\n <!--\n Both labels are always in the DOM so the track's width is the wider of the two and\n cannot jump as the switch flips; the inactive one is faded out, not removed.\n -->\n <span\n [class.gog-toggle__state--active]=\"checked()\"\n class=\"gog-toggle__state gog-toggle__state--on\"\n aria-hidden=\"true\"\n >\n {{ onLabel() }}\n </span>\n <span\n [class.gog-toggle__state--active]=\"!checked()\"\n class=\"gog-toggle__state gog-toggle__state--off\"\n aria-hidden=\"true\"\n >\n {{ offLabel() }}\n </span>\n }\n\n <span class=\"gog-toggle__thumb\" aria-hidden=\"true\"></span>\n </span>\n\n @if (label()) {\n <span class=\"gog-toggle__label\">{{ label() }}</span>\n }\n</label>\n", styles: ["@charset \"UTF-8\";.gog-toggle{display:inline-flex;align-items:center;position:relative;gap:var(--gog-toggle-gap);padding:var(--gog-toggle-padding, var(--gog-control-checkbox-padding));cursor:pointer;-webkit-user-select:none;user-select:none}.gog-toggle--disabled{opacity:var(--gog-toggle-disabled-opacity);cursor:not-allowed}.gog-toggle__input{position:absolute;inset-inline-start:var(--gog-toggle-padding, var(--gog-control-checkbox-padding));top:var(--gog-toggle-padding, var(--gog-control-checkbox-padding));width:var(--gog-toggle-size-track-width, var(--gog-toggle-md-track-width));height:var(--gog-toggle-size-track-height, var(--gog-toggle-md-track-height));margin:0;opacity:0;cursor:inherit}.gog-toggle__track{position:relative;display:grid;align-items:center;box-sizing:border-box;flex:0 0 auto;min-width:var(--gog-toggle-size-track-width, var(--gog-toggle-md-track-width));height:var(--gog-toggle-size-track-height, var(--gog-toggle-md-track-height));border:var(--gog-toggle-border-width) var(--gog-toggle-border-style) var(--gog-toggle-border-color);border-radius:var(--gog-toggle-radius);background-color:var(--gog-toggle-track-bg, var(--gog-toggle-track-off-bg));transition:background-color var(--gog-toggle-transition-duration) var(--gog-easing),border-color var(--gog-toggle-transition-duration) var(--gog-easing)}.gog-toggle__track--on{border-color:var(--gog-toggle-on-border-color);background-color:var(--gog-toggle-track-bg, var(--gog-toggle-track-on-bg))}.gog-toggle__thumb{position:absolute;top:50%;inset-inline-start:var(--gog-toggle-thumb-inset);width:var(--gog-toggle-size-thumb-size, var(--gog-toggle-md-thumb-size));height:var(--gog-toggle-size-thumb-size, var(--gog-toggle-md-thumb-size));border-radius:50%;background-color:var(--gog-toggle-thumb-bg, var(--gog-toggle-thumb-off-bg));box-shadow:var(--gog-toggle-thumb-shadow);transform:translateY(-50%);transition:inset-inline-start var(--gog-toggle-transition-duration) var(--gog-easing),background-color var(--gog-toggle-transition-duration) var(--gog-easing)}.gog-toggle__track--on .gog-toggle__thumb{inset-inline-start:calc(100% - var(--gog-toggle-size-thumb-size, var(--gog-toggle-md-thumb-size)) - var(--gog-toggle-thumb-inset));background-color:var(--gog-toggle-thumb-bg, var(--gog-toggle-thumb-on-bg))}.gog-toggle__state{grid-area:1/1;padding-inline:var(--gog-toggle-state-padding-inline);color:var(--gog-toggle-state-color);font-family:var(--gog-toggle-font-family);font-size:var(--gog-toggle-size-state-font-size, var(--gog-toggle-md-state-font-size));font-weight:var(--gog-toggle-state-font-weight);letter-spacing:var(--gog-toggle-state-letter-spacing);line-height:1;opacity:0;pointer-events:none;white-space:nowrap;transition:opacity var(--gog-toggle-transition-duration) var(--gog-easing)}.gog-toggle__state--on{justify-self:start;padding-inline-start:var(--gog-toggle-state-offset)}.gog-toggle__state--off{justify-self:end;padding-inline-end:var(--gog-toggle-state-offset)}.gog-toggle__state--active{opacity:1}:host(.gog-toggle-host--track-labels) .gog-toggle__state--on{padding-inline-end:calc(var(--gog-toggle-size-thumb-size, var(--gog-toggle-md-thumb-size)) + var(--gog-toggle-state-thumb-gap))}:host(.gog-toggle-host--track-labels) .gog-toggle__state--off{padding-inline-start:calc(var(--gog-toggle-size-thumb-size, var(--gog-toggle-md-thumb-size)) + var(--gog-toggle-state-thumb-gap))}.gog-toggle__label{color:var(--gog-toggle-label-color);font-family:var(--gog-toggle-font-family);font-size:var(--gog-toggle-size-label-size, var(--gog-toggle-md-label-size));line-height:var(--gog-toggle-label-line-height)}.gog-toggle__input:focus-visible+.gog-toggle__track{outline:var(--gog-toggle-focus-ring-width) solid var(--gog-toggle-focus-ring-color);outline-offset:var(--gog-toggle-focus-ring-offset)}:host(.gog-toggle-host--label-start) .gog-toggle{flex-direction:row-reverse}:host(.gog-toggle-host--xsm){--gog-toggle-size-track-width: var(--gog-toggle-xsm-track-width);--gog-toggle-size-track-height: var(--gog-toggle-xsm-track-height);--gog-toggle-size-thumb-size: var(--gog-toggle-xsm-thumb-size);--gog-toggle-size-label-size: var(--gog-toggle-xsm-label-size);--gog-toggle-size-state-font-size: var(--gog-toggle-xsm-state-font-size)}:host(.gog-toggle-host--sm){--gog-toggle-size-track-width: var(--gog-toggle-sm-track-width);--gog-toggle-size-track-height: var(--gog-toggle-sm-track-height);--gog-toggle-size-thumb-size: var(--gog-toggle-sm-thumb-size);--gog-toggle-size-label-size: var(--gog-toggle-sm-label-size);--gog-toggle-size-state-font-size: var(--gog-toggle-sm-state-font-size)}:host(.gog-toggle-host--md){--gog-toggle-size-track-width: var(--gog-toggle-md-track-width);--gog-toggle-size-track-height: var(--gog-toggle-md-track-height);--gog-toggle-size-thumb-size: var(--gog-toggle-md-thumb-size);--gog-toggle-size-label-size: var(--gog-toggle-md-label-size);--gog-toggle-size-state-font-size: var(--gog-toggle-md-state-font-size)}:host(.gog-toggle-host--lg){--gog-toggle-size-track-width: var(--gog-toggle-lg-track-width);--gog-toggle-size-track-height: var(--gog-toggle-lg-track-height);--gog-toggle-size-thumb-size: var(--gog-toggle-lg-thumb-size);--gog-toggle-size-label-size: var(--gog-toggle-lg-label-size);--gog-toggle-size-state-font-size: var(--gog-toggle-lg-state-font-size)}:host(.gog-toggle-host--slg){--gog-toggle-size-track-width: var(--gog-toggle-slg-track-width);--gog-toggle-size-track-height: var(--gog-toggle-slg-track-height);--gog-toggle-size-thumb-size: var(--gog-toggle-slg-thumb-size);--gog-toggle-size-label-size: var(--gog-toggle-slg-label-size);--gog-toggle-size-state-font-size: var(--gog-toggle-slg-state-font-size)}:host(.gog-host--full-width){display:block;width:100%}:host(.gog-host--full-width) .gog-toggle{display:flex;width:100%;justify-content:space-between}@media(prefers-reduced-motion:reduce){.gog-toggle__track,.gog-toggle__thumb,.gog-toggle__state{transition:none}}\n"] }]
|
|
4166
4470
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], onLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onLabel", required: false }] }], offLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offLabel", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
|
|
4167
4471
|
|
|
4472
|
+
/**
|
|
4473
|
+
* Per-prefix counter behind every auto-generated DOM id in the library.
|
|
4474
|
+
*
|
|
4475
|
+
* A form control needs a real `id` whether or not the consumer supplied one: without it a
|
|
4476
|
+
* `<label for>` cannot point at the field (so clicking the label does not focus it, and
|
|
4477
|
+
* assistive tech gets no accessible name), and `aria-describedby` cannot point at the error
|
|
4478
|
+
* message. Making the consumer pass `inputId` for that is a trap — the field looks fine and is
|
|
4479
|
+
* quietly inaccessible.
|
|
4480
|
+
*
|
|
4481
|
+
* Counters are keyed by prefix rather than shared, so ids stay stable per component type
|
|
4482
|
+
* (`gog-input-1`, `gog-slider-1`) instead of depending on how many *other* controls happened to
|
|
4483
|
+
* be constructed first. That also keeps them predictable in tests and diffs.
|
|
4484
|
+
*
|
|
4485
|
+
* SSR/hydration-safe by construction: the server and the client walk the same component tree in
|
|
4486
|
+
* the same order, so both arrive at the same ids. Do not seed this with randomness for that
|
|
4487
|
+
* reason.
|
|
4488
|
+
*/
|
|
4489
|
+
const counters = new Map();
|
|
4490
|
+
/** Returns the next id for `prefix`, e.g. `nextGogControlId('gog-input')` → `'gog-input-3'`. */
|
|
4491
|
+
function nextGogControlId(prefix) {
|
|
4492
|
+
const next = (counters.get(prefix) ?? 0) + 1;
|
|
4493
|
+
counters.set(prefix, next);
|
|
4494
|
+
return `${prefix}-${next}`;
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4168
4497
|
/** Built-in defaults, used when neither the instance input nor `GOG_CONFIG` supplies one. */
|
|
4169
4498
|
const DEFAULT_SIZE$2 = 'md';
|
|
4170
4499
|
const DEFAULT_ERROR_DISPLAY$3 = 'manual';
|
|
4171
4500
|
class RadioGroupComponent {
|
|
4172
|
-
|
|
4173
|
-
uid = `gog-radio-group-${++RadioGroupComponent.nextUid}`;
|
|
4501
|
+
uid = nextGogControlId('gog-radio-group');
|
|
4174
4502
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
4175
4503
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4176
4504
|
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -4372,8 +4700,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4372
4700
|
args: [{ providedIn: 'root' }]
|
|
4373
4701
|
}] });
|
|
4374
4702
|
|
|
4703
|
+
/** Built-in default, used when neither `DialogConfig` nor `GOG_CONFIG.labels` supplies one. */
|
|
4704
|
+
const DEFAULT_CLOSE_LABEL$1 = 'Close dialog';
|
|
4375
4705
|
class DialogComponent {
|
|
4376
4706
|
dialogService = inject(DialogService);
|
|
4707
|
+
globalConfig = inject(GOG_CONFIG);
|
|
4377
4708
|
parentInjector = inject(Injector);
|
|
4378
4709
|
host = inject((ElementRef));
|
|
4379
4710
|
injectorCache = new WeakMap();
|
|
@@ -4418,6 +4749,10 @@ class DialogComponent {
|
|
|
4418
4749
|
}
|
|
4419
4750
|
return this.injectorCache.get(dialog);
|
|
4420
4751
|
}
|
|
4752
|
+
/** Per-dialog config → `GOG_CONFIG.labels` → the built-in English default. */
|
|
4753
|
+
closeLabel(dialog) {
|
|
4754
|
+
return resolveConfigured(dialog.config.closeAriaLabel, this.globalConfig.labels?.closeDialog, DEFAULT_CLOSE_LABEL$1);
|
|
4755
|
+
}
|
|
4421
4756
|
getTitleId(dialog) {
|
|
4422
4757
|
return `gog-dialog-title-${dialog.id}`;
|
|
4423
4758
|
}
|
|
@@ -4527,13 +4862,15 @@ class DialogComponent {
|
|
|
4527
4862
|
return rect.width > 0 && rect.height > 0;
|
|
4528
4863
|
}
|
|
4529
4864
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4530
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DialogComponent, isStandalone: true, selector: "gog-dialog", ngImport: i0, template: "@for (dialog of dialogService.dialogs(); track trackDialog($index, dialog)) {\r\n <div\r\n class=\"gog-dialog__backdrop\"\r\n [class.gog-dialog__backdrop--modal]=\"dialog.config.modal !== false\"\r\n [style.z-index]=\"panelZ(dialog)\"\r\n (pointerdown)=\"onBackdropPointerDown($event, dialog)\"\r\n (pointerup)=\"onBackdropPointerUp($event, dialog)\"\r\n (pointercancel)=\"onBackdropPointerUp($event, dialog)\"\r\n >\r\n <div\r\n #panel\r\n class=\"gog-dialog__panel\"\r\n [attr.data-dialog-id]=\"dialog.id\"\r\n [style.--gog-dropdown-z]=\"panelZ(dialog) + 10\"\r\n [style.--gog-tooltip-z]=\"panelZ(dialog) + 20\"\r\n [style.--gog-dialog-offset-x]=\"dialog.offsetX + 'px'\"\r\n [style.--gog-dialog-offset-y]=\"dialog.offsetY + 'px'\"\r\n [style.width]=\"dialog.config.width ?? 'auto'\"\r\n [style.max-width]=\"dialog.config.maxWidth ?? '90vw'\"\r\n [attr.role]=\"dialog.config.role ?? 'dialog'\"\r\n [attr.aria-modal]=\"dialog.config.modal === false ? null : 'true'\"\r\n tabindex=\"-1\"\r\n [attr.aria-labelledby]=\"dialog.config.title ? getTitleId(dialog) : null\"\r\n (keydown)=\"onPanelKeydown($event, dialog, panel)\"\r\n >\r\n @if (dialog.config.title || dialog.config.closable !== false) {\r\n <div\r\n class=\"gog-dialog__header\"\r\n [class.gog-dialog__header--draggable]=\"isDraggable(dialog)\"\r\n (pointerdown)=\"startDrag($event, dialog)\"\r\n >\r\n @if (dialog.config.title) {\r\n <h2 [id]=\"getTitleId(dialog)\" class=\"gog-dialog__title\">\r\n {{ dialog.config.title }}\r\n </h2>\r\n }\r\n @if (dialog.config.closable !== false) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-dialog__close gog-inline-center\"\r\n aria-label=\"
|
|
4865
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DialogComponent, isStandalone: true, selector: "gog-dialog", ngImport: i0, template: "@for (dialog of dialogService.dialogs(); track trackDialog($index, dialog)) {\r\n <div\r\n class=\"gog-dialog__backdrop\"\r\n [class.gog-dialog__backdrop--modal]=\"dialog.config.modal !== false\"\r\n [style.z-index]=\"panelZ(dialog)\"\r\n (pointerdown)=\"onBackdropPointerDown($event, dialog)\"\r\n (pointerup)=\"onBackdropPointerUp($event, dialog)\"\r\n (pointercancel)=\"onBackdropPointerUp($event, dialog)\"\r\n >\r\n <div\r\n #panel\r\n class=\"gog-dialog__panel\"\r\n [attr.data-dialog-id]=\"dialog.id\"\r\n [style.--gog-dropdown-z]=\"panelZ(dialog) + 10\"\r\n [style.--gog-tooltip-z]=\"panelZ(dialog) + 20\"\r\n [style.--gog-dialog-offset-x]=\"dialog.offsetX + 'px'\"\r\n [style.--gog-dialog-offset-y]=\"dialog.offsetY + 'px'\"\r\n [style.width]=\"dialog.config.width ?? 'auto'\"\r\n [style.max-width]=\"dialog.config.maxWidth ?? '90vw'\"\r\n [attr.role]=\"dialog.config.role ?? 'dialog'\"\r\n [attr.aria-modal]=\"dialog.config.modal === false ? null : 'true'\"\r\n tabindex=\"-1\"\r\n [attr.aria-labelledby]=\"dialog.config.title ? getTitleId(dialog) : null\"\r\n (keydown)=\"onPanelKeydown($event, dialog, panel)\"\r\n >\r\n @if (dialog.config.title || dialog.config.closable !== false) {\r\n <div\r\n class=\"gog-dialog__header\"\r\n [class.gog-dialog__header--draggable]=\"isDraggable(dialog)\"\r\n (pointerdown)=\"startDrag($event, dialog)\"\r\n >\r\n @if (dialog.config.title) {\r\n <h2 [id]=\"getTitleId(dialog)\" class=\"gog-dialog__title\">\r\n {{ dialog.config.title }}\r\n </h2>\r\n }\r\n @if (dialog.config.closable !== false) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-dialog__close gog-inline-center\"\r\n [attr.aria-label]=\"closeLabel(dialog)\"\r\n (click)=\"close(dialog)\"\r\n >\r\n <gog-icon\r\n [template]=\"dialog.config.closeIconTemplate ?? null\"\r\n [name]=\"dialog.config.closeIconName ?? 'close'\"\r\n />\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"gog-dialog__body\">\r\n <!--\r\n Not a tab stop: the panel runs its own focus trap over the projected content\r\n (onPanelKeydown), keyed to a fixed focusable-element selector. Leaving this\r\n focusable would insert an extra stop ahead of that content and change which\r\n element the trap treats as \"first\".\r\n -->\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-dialog__scroll\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"dialog.config.component; injector: getInjector(dialog)\"\r\n />\r\n </gog-scroll>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.gog-dialog__backdrop{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--gog-dialog-backdrop-padding);animation:gog-fade-in var(--gog-dialog-backdrop-fade-duration) var(--gog-easing)}.gog-dialog__backdrop--modal{background:var(--gog-dialog-backdrop-bg);-webkit-backdrop-filter:blur(var(--gog-dialog-backdrop-blur));backdrop-filter:blur(var(--gog-dialog-backdrop-blur))}.gog-dialog__panel{display:flex;flex-direction:column;background:var(--gog-dialog-bg);color:var(--gog-dialog-color);border:var(--gog-dialog-border-width) var(--gog-dialog-border-style) var(--gog-dialog-border);box-shadow:var(--gog-dialog-shadow);overflow:visible;max-height:var(--gog-dialog-max-height);animation:gog-slide-in var(--gog-dialog-enter-duration) var(--gog-easing);min-width:var(--gog-dialog-min-width);border-radius:var(--gog-dialog-radius);transform:translate3d(var(--gog-dialog-offset-x, 0px),var(--gog-dialog-offset-y, 0px),0)}.gog-dialog__header{display:flex;align-items:center;justify-content:space-between;padding:var(--gog-dialog-header-padding);border-bottom:var(--gog-dialog-border-width) var(--gog-dialog-border-style) var(--gog-dialog-header-border-color);gap:var(--gog-dialog-header-gap);flex-shrink:0}.gog-dialog__header--draggable{cursor:move;touch-action:none;-webkit-user-select:none;user-select:none}.gog-dialog__title{margin:0;color:var(--gog-dialog-color);font-family:var(--gog-dialog-font-family)}.gog-dialog__close{justify-content:center;width:var(--gog-dialog-close-size);height:var(--gog-dialog-close-size);border:var(--gog-dialog-border-width) var(--gog-dialog-border-style) transparent;background:transparent;color:var(--gog-dialog-close-color);cursor:pointer;flex-shrink:0;padding:0;line-height:1;font-size:var(--gog-dialog-close-font-size)}.gog-dialog__close gog-icon{font-size:var(--gog-dialog-close-font-size)}.gog-dialog__close:hover{color:var(--gog-dialog-close-hover-color);border-color:var(--gog-dialog-close-hover-border);background:var(--gog-dialog-close-hover-bg)}.gog-dialog__close:focus-visible{outline:var(--gog-dialog-close-focus-ring-width) solid var(--gog-dialog-close-focus-ring);outline-offset:var(--gog-dialog-close-focus-ring-offset)}.gog-dialog__body{padding:var(--gog-dialog-body-padding);display:flex;flex-direction:column;flex:1;min-height:0;max-height:var(--gog-dialog-body-max-height);overflow:hidden}.gog-dialog__scroll{flex:1 1 auto;min-height:0}@keyframes gog-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gog-slide-in{0%{transform:translateY(var(--gog-dialog-enter-distance));opacity:0}to{transform:translateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.gog-dialog__backdrop,.gog-dialog__panel,.gog-dialog__close{animation:none;transition:none}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4531
4866
|
}
|
|
4532
4867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DialogComponent, decorators: [{
|
|
4533
4868
|
type: Component,
|
|
4534
|
-
args: [{ selector: 'gog-dialog', imports: [NgComponentOutlet, IconComponent, ScrollComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (dialog of dialogService.dialogs(); track trackDialog($index, dialog)) {\r\n <div\r\n class=\"gog-dialog__backdrop\"\r\n [class.gog-dialog__backdrop--modal]=\"dialog.config.modal !== false\"\r\n [style.z-index]=\"panelZ(dialog)\"\r\n (pointerdown)=\"onBackdropPointerDown($event, dialog)\"\r\n (pointerup)=\"onBackdropPointerUp($event, dialog)\"\r\n (pointercancel)=\"onBackdropPointerUp($event, dialog)\"\r\n >\r\n <div\r\n #panel\r\n class=\"gog-dialog__panel\"\r\n [attr.data-dialog-id]=\"dialog.id\"\r\n [style.--gog-dropdown-z]=\"panelZ(dialog) + 10\"\r\n [style.--gog-tooltip-z]=\"panelZ(dialog) + 20\"\r\n [style.--gog-dialog-offset-x]=\"dialog.offsetX + 'px'\"\r\n [style.--gog-dialog-offset-y]=\"dialog.offsetY + 'px'\"\r\n [style.width]=\"dialog.config.width ?? 'auto'\"\r\n [style.max-width]=\"dialog.config.maxWidth ?? '90vw'\"\r\n [attr.role]=\"dialog.config.role ?? 'dialog'\"\r\n [attr.aria-modal]=\"dialog.config.modal === false ? null : 'true'\"\r\n tabindex=\"-1\"\r\n [attr.aria-labelledby]=\"dialog.config.title ? getTitleId(dialog) : null\"\r\n (keydown)=\"onPanelKeydown($event, dialog, panel)\"\r\n >\r\n @if (dialog.config.title || dialog.config.closable !== false) {\r\n <div\r\n class=\"gog-dialog__header\"\r\n [class.gog-dialog__header--draggable]=\"isDraggable(dialog)\"\r\n (pointerdown)=\"startDrag($event, dialog)\"\r\n >\r\n @if (dialog.config.title) {\r\n <h2 [id]=\"getTitleId(dialog)\" class=\"gog-dialog__title\">\r\n {{ dialog.config.title }}\r\n </h2>\r\n }\r\n @if (dialog.config.closable !== false) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-dialog__close gog-inline-center\"\r\n aria-label=\"
|
|
4869
|
+
args: [{ selector: 'gog-dialog', imports: [NgComponentOutlet, IconComponent, ScrollComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (dialog of dialogService.dialogs(); track trackDialog($index, dialog)) {\r\n <div\r\n class=\"gog-dialog__backdrop\"\r\n [class.gog-dialog__backdrop--modal]=\"dialog.config.modal !== false\"\r\n [style.z-index]=\"panelZ(dialog)\"\r\n (pointerdown)=\"onBackdropPointerDown($event, dialog)\"\r\n (pointerup)=\"onBackdropPointerUp($event, dialog)\"\r\n (pointercancel)=\"onBackdropPointerUp($event, dialog)\"\r\n >\r\n <div\r\n #panel\r\n class=\"gog-dialog__panel\"\r\n [attr.data-dialog-id]=\"dialog.id\"\r\n [style.--gog-dropdown-z]=\"panelZ(dialog) + 10\"\r\n [style.--gog-tooltip-z]=\"panelZ(dialog) + 20\"\r\n [style.--gog-dialog-offset-x]=\"dialog.offsetX + 'px'\"\r\n [style.--gog-dialog-offset-y]=\"dialog.offsetY + 'px'\"\r\n [style.width]=\"dialog.config.width ?? 'auto'\"\r\n [style.max-width]=\"dialog.config.maxWidth ?? '90vw'\"\r\n [attr.role]=\"dialog.config.role ?? 'dialog'\"\r\n [attr.aria-modal]=\"dialog.config.modal === false ? null : 'true'\"\r\n tabindex=\"-1\"\r\n [attr.aria-labelledby]=\"dialog.config.title ? getTitleId(dialog) : null\"\r\n (keydown)=\"onPanelKeydown($event, dialog, panel)\"\r\n >\r\n @if (dialog.config.title || dialog.config.closable !== false) {\r\n <div\r\n class=\"gog-dialog__header\"\r\n [class.gog-dialog__header--draggable]=\"isDraggable(dialog)\"\r\n (pointerdown)=\"startDrag($event, dialog)\"\r\n >\r\n @if (dialog.config.title) {\r\n <h2 [id]=\"getTitleId(dialog)\" class=\"gog-dialog__title\">\r\n {{ dialog.config.title }}\r\n </h2>\r\n }\r\n @if (dialog.config.closable !== false) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-dialog__close gog-inline-center\"\r\n [attr.aria-label]=\"closeLabel(dialog)\"\r\n (click)=\"close(dialog)\"\r\n >\r\n <gog-icon\r\n [template]=\"dialog.config.closeIconTemplate ?? null\"\r\n [name]=\"dialog.config.closeIconName ?? 'close'\"\r\n />\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"gog-dialog__body\">\r\n <!--\r\n Not a tab stop: the panel runs its own focus trap over the projected content\r\n (onPanelKeydown), keyed to a fixed focusable-element selector. Leaving this\r\n focusable would insert an extra stop ahead of that content and change which\r\n element the trap treats as \"first\".\r\n -->\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-dialog__scroll\"\r\n >\r\n <ng-container\r\n *ngComponentOutlet=\"dialog.config.component; injector: getInjector(dialog)\"\r\n />\r\n </gog-scroll>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:contents}.gog-dialog__backdrop{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--gog-dialog-backdrop-padding);animation:gog-fade-in var(--gog-dialog-backdrop-fade-duration) var(--gog-easing)}.gog-dialog__backdrop--modal{background:var(--gog-dialog-backdrop-bg);-webkit-backdrop-filter:blur(var(--gog-dialog-backdrop-blur));backdrop-filter:blur(var(--gog-dialog-backdrop-blur))}.gog-dialog__panel{display:flex;flex-direction:column;background:var(--gog-dialog-bg);color:var(--gog-dialog-color);border:var(--gog-dialog-border-width) var(--gog-dialog-border-style) var(--gog-dialog-border);box-shadow:var(--gog-dialog-shadow);overflow:visible;max-height:var(--gog-dialog-max-height);animation:gog-slide-in var(--gog-dialog-enter-duration) var(--gog-easing);min-width:var(--gog-dialog-min-width);border-radius:var(--gog-dialog-radius);transform:translate3d(var(--gog-dialog-offset-x, 0px),var(--gog-dialog-offset-y, 0px),0)}.gog-dialog__header{display:flex;align-items:center;justify-content:space-between;padding:var(--gog-dialog-header-padding);border-bottom:var(--gog-dialog-border-width) var(--gog-dialog-border-style) var(--gog-dialog-header-border-color);gap:var(--gog-dialog-header-gap);flex-shrink:0}.gog-dialog__header--draggable{cursor:move;touch-action:none;-webkit-user-select:none;user-select:none}.gog-dialog__title{margin:0;color:var(--gog-dialog-color);font-family:var(--gog-dialog-font-family)}.gog-dialog__close{justify-content:center;width:var(--gog-dialog-close-size);height:var(--gog-dialog-close-size);border:var(--gog-dialog-border-width) var(--gog-dialog-border-style) transparent;background:transparent;color:var(--gog-dialog-close-color);cursor:pointer;flex-shrink:0;padding:0;line-height:1;font-size:var(--gog-dialog-close-font-size)}.gog-dialog__close gog-icon{font-size:var(--gog-dialog-close-font-size)}.gog-dialog__close:hover{color:var(--gog-dialog-close-hover-color);border-color:var(--gog-dialog-close-hover-border);background:var(--gog-dialog-close-hover-bg)}.gog-dialog__close:focus-visible{outline:var(--gog-dialog-close-focus-ring-width) solid var(--gog-dialog-close-focus-ring);outline-offset:var(--gog-dialog-close-focus-ring-offset)}.gog-dialog__body{padding:var(--gog-dialog-body-padding);display:flex;flex-direction:column;flex:1;min-height:0;max-height:var(--gog-dialog-body-max-height);overflow:hidden}.gog-dialog__scroll{flex:1 1 auto;min-height:0}@keyframes gog-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gog-slide-in{0%{transform:translateY(var(--gog-dialog-enter-distance));opacity:0}to{transform:translateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.gog-dialog__backdrop,.gog-dialog__panel,.gog-dialog__close{animation:none;transition:none}}\n"] }]
|
|
4535
4870
|
}], ctorParameters: () => [] });
|
|
4536
4871
|
|
|
4872
|
+
/** Built-in default, used when `GOG_CONFIG.labels.closeToast` is unset. */
|
|
4873
|
+
const DEFAULT_CLOSE_LABEL = 'Close toast';
|
|
4537
4874
|
class ToastComponent {
|
|
4538
4875
|
toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : /* istanbul ignore next */ []));
|
|
4539
4876
|
/** Whether this toast is the active, front-of-queue toast — only the front toast counts down. */
|
|
@@ -4546,9 +4883,13 @@ class ToastComponent {
|
|
|
4546
4883
|
remainingMs = 0;
|
|
4547
4884
|
isClosing = signal(false, ...(ngDevMode ? [{ debugName: "isClosing" }] : /* istanbul ignore next */ []));
|
|
4548
4885
|
progressEl = viewChild('progress', ...(ngDevMode ? [{ debugName: "progressEl" }] : /* istanbul ignore next */ []));
|
|
4886
|
+
globalConfig = inject(GOG_CONFIG);
|
|
4887
|
+
/**
|
|
4888
|
+
* `GOG_CONFIG.labels` → the built-in English default. No per-instance input: a toast is
|
|
4889
|
+
* created through `ToastService`, and its close button says the same thing every time.
|
|
4890
|
+
*/
|
|
4891
|
+
closeLabel = resolveConfigured(undefined, this.globalConfig.labels?.closeToast, DEFAULT_CLOSE_LABEL);
|
|
4549
4892
|
hasActions = computed(() => this.toast().actions.length > 0, ...(ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []));
|
|
4550
|
-
ariaRole = computed(() => ['error', 'warning'].includes(this.toast().type) ? 'alert' : 'status', ...(ngDevMode ? [{ debugName: "ariaRole" }] : /* istanbul ignore next */ []));
|
|
4551
|
-
ariaLive = computed(() => ['error', 'warning'].includes(this.toast().type) ? 'assertive' : 'polite', ...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
|
|
4552
4893
|
constructor() {
|
|
4553
4894
|
afterNextRender(() => this.visible.set(true));
|
|
4554
4895
|
effect((onCleanup) => {
|
|
@@ -4649,15 +4990,11 @@ class ToastComponent {
|
|
|
4649
4990
|
return (typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
4650
4991
|
}
|
|
4651
4992
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4652
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ToastComponent, isStandalone: true, selector: "gog-toast", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null }, isFront: { classPropertyName: "isFront", publicName: "isFront", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" },
|
|
4993
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ToastComponent, isStandalone: true, selector: "gog-toast", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null }, isFront: { classPropertyName: "isFront", publicName: "isFront", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" }, viewQueries: [{ propertyName: "progressEl", first: true, predicate: ["progress"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"gog-toast\"\r\n [class.gog-toast--paused]=\"isPaused()\"\r\n [class.gog-toast--queued]=\"!isFront()\"\r\n [class.gog-toast--success]=\"toast().type === 'success'\"\r\n [class.gog-toast--error]=\"toast().type === 'error'\"\r\n [class.gog-toast--warning]=\"toast().type === 'warning'\"\r\n [class.gog-toast--info]=\"toast().type === 'info'\"\r\n [class.gog-toast--visible]=\"visible()\"\r\n [style.--toast-duration]=\"toast().duration + 'ms'\"\r\n (mouseenter)=\"pauseAutoDismiss()\"\r\n (mouseleave)=\"resumeAutoDismiss()\"\r\n (transitionend)=\"onTransitionEnd($event)\"\r\n>\r\n <div class=\"gog-toast__content\">\r\n <span class=\"gog-toast__icon\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"toast().iconTemplate ?? null\" [name]=\"toast().iconName\" />\r\n </span>\r\n <div class=\"gog-toast__main\">\r\n <span class=\"gog-toast__message\">{{ toast().message }}</span>\r\n @if (hasActions()) {\r\n <div class=\"gog-toast__actions\">\r\n @for (action of toast().actions; track action.label) {\r\n <gog-button\r\n class=\"gog-toast__action\"\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n type=\"button\"\r\n (gogClick)=\"runAction(action)\"\r\n >\r\n @if (action.iconName || action.iconTemplate) {\r\n <gog-icon\r\n [template]=\"action.iconTemplate ?? null\"\r\n [name]=\"action.iconName ?? 'check'\"\r\n />\r\n }\r\n {{ action.label }}\r\n </gog-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n <gog-button\r\n class=\"gog-toast__close\"\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n type=\"button\"\r\n [ariaLabel]=\"closeLabel\"\r\n (gogClick)=\"close()\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </gog-button>\r\n </div>\r\n @if (!toast().isSticky) {\r\n <span #progress class=\"gog-toast__progress\" aria-hidden=\"true\"></span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-toast{--toast-border: var(--gog-toast-type-color, var(--gog-toast-border));--toast-icon-color: var(--gog-toast-type-color, var(--gog-toast-icon-color));--toast-enter-x: var(--gog-toast-enter-distance);--toast-progress-color: var(--toast-border);--toast-stack-depth: min(var(--toast-stack-index, 0), var(--gog-toast-stack-max-depth));--toast-stack-collapsed-y: calc( var(--toast-stack-depth) * var(--gog-toast-stack-peek) * var(--toast-stack-direction, 1) );--toast-stack-expanded-y: calc( var(--toast-stack-depth) * var(--gog-toast-stack-expanded-gap) * var(--toast-stack-direction, 1) );--toast-stack-y: calc( var(--toast-stack-collapsed-y) + (var(--toast-stack-expanded-y) - var(--toast-stack-collapsed-y)) * var(--toast-stack-expanded, 0) );--toast-stack-collapsed-scale: calc( 1 - (var(--toast-stack-depth) * var(--gog-toast-stack-scale-step)) );--toast-stack-scale: calc( var(--toast-stack-collapsed-scale) + (1 - var(--toast-stack-collapsed-scale)) * var(--toast-stack-expanded, 0) );--toast-stack-collapsed-opacity: max( var(--gog-toast-stack-min-opacity), calc(1 - (var(--toast-stack-depth) * var(--gog-toast-stack-opacity-step))) );--toast-stack-opacity: calc( var(--toast-stack-collapsed-opacity) + (1 - var(--toast-stack-collapsed-opacity)) * var(--toast-stack-expanded, 0) );position:relative;z-index:calc(var(--gog-toast-base-z) - var(--toast-stack-index, 0));display:block;padding:var(--gog-toast-padding);background:var(--gog-toast-bg);border-left:var(--gog-toast-accent-width) solid var(--toast-border);border-radius:var(--gog-toast-radius);color:var(--gog-toast-color);font-family:var(--gog-toast-font-family);box-shadow:var(--gog-toast-shadow);min-width:var(--gog-toast-min-width);max-width:var(--gog-toast-max-width);pointer-events:all;opacity:0;overflow:hidden;transform:translate3d(var(--toast-enter-x),var(--toast-stack-y),0) scale(var(--toast-stack-scale));transition:opacity var(--gog-toast-transition-duration) var(--gog-easing),transform var(--gog-toast-transition-duration) var(--gog-easing)}.gog-toast--visible{opacity:var(--toast-stack-opacity);transform:translate3d(0,var(--toast-stack-y),0) scale(var(--toast-stack-scale))}:host(.slide-left) .gog-toast{--toast-enter-x: calc(var(--gog-toast-enter-distance) * -1)}.gog-toast--success{--gog-toast-type-color: var(--gog-toast-success-color)}.gog-toast--error{--gog-toast-type-color: var(--gog-toast-error-color)}.gog-toast--warning{--gog-toast-type-color: var(--gog-toast-warning-color)}.gog-toast--info{--gog-toast-type-color: var(--gog-toast-info-color)}.gog-toast__icon{color:var(--toast-icon-color);font-size:var(--gog-toast-icon-size);line-height:var(--gog-toast-icon-line-height);flex-shrink:0}.gog-toast__icon gog-icon{font-size:var(--gog-toast-icon-size)}.gog-toast__content{display:flex;align-items:flex-start;gap:var(--gog-toast-content-gap)}.gog-toast__main{display:flex;flex:1;flex-direction:column;gap:var(--gog-toast-main-gap);min-width:0}.gog-toast__message{flex:1;font-size:var(--gog-toast-message-font-size);line-height:var(--gog-toast-message-line-height)}.gog-toast__actions{display:flex;flex-wrap:wrap;gap:var(--gog-toast-actions-gap)}.gog-toast__action{--gog-btn-padding: var(--gog-toast-action-padding);--gog-btn-font-size: var(--gog-toast-action-font-size)}.gog-toast__action gog-icon{font-size:var(--gog-toast-action-font-size)}.gog-toast__close{align-self:flex-start;flex-shrink:0;--gog-btn-padding: var(--gog-toast-close-padding);--gog-btn-font-size: var(--gog-toast-close-font-size)}.gog-toast__close gog-icon{font-size:var(--gog-toast-close-font-size)}.gog-toast__progress{position:absolute;right:0;bottom:0;left:0;height:var(--gog-toast-progress-height);background:color-mix(in srgb,var(--toast-progress-color) var(--gog-toast-progress-opacity),transparent);transform-origin:left center;animation:gog-toast-progress var(--toast-duration) linear forwards}.gog-toast--paused .gog-toast__progress,.gog-toast--queued .gog-toast__progress{animation-play-state:paused}@keyframes gog-toast-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@media(prefers-reduced-motion:reduce){.gog-toast,.gog-toast__progress{transition:none;animation:none}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "gog-button", inputs: ["variant", "size", "disabled", "fullWidth", "type", "loading", "debounce", "ariaLabel"], outputs: ["gogClick"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4653
4994
|
}
|
|
4654
4995
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ToastComponent, decorators: [{
|
|
4655
4996
|
type: Component,
|
|
4656
|
-
args: [{ selector: 'gog-toast', imports: [ButtonComponent, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
4657
|
-
'[attr.role]': 'ariaRole()',
|
|
4658
|
-
'[attr.aria-live]': 'ariaLive()',
|
|
4659
|
-
'[attr.aria-atomic]': 'true',
|
|
4660
|
-
}, template: "<div\r\n class=\"gog-toast\"\r\n [class.gog-toast--paused]=\"isPaused()\"\r\n [class.gog-toast--queued]=\"!isFront()\"\r\n [class.gog-toast--success]=\"toast().type === 'success'\"\r\n [class.gog-toast--error]=\"toast().type === 'error'\"\r\n [class.gog-toast--warning]=\"toast().type === 'warning'\"\r\n [class.gog-toast--info]=\"toast().type === 'info'\"\r\n [class.gog-toast--visible]=\"visible()\"\r\n [style.--toast-duration]=\"toast().duration + 'ms'\"\r\n (mouseenter)=\"pauseAutoDismiss()\"\r\n (mouseleave)=\"resumeAutoDismiss()\"\r\n (transitionend)=\"onTransitionEnd($event)\"\r\n>\r\n <div class=\"gog-toast__content\">\r\n <span class=\"gog-toast__icon\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"toast().iconTemplate ?? null\" [name]=\"toast().iconName\" />\r\n </span>\r\n <div class=\"gog-toast__main\">\r\n <span class=\"gog-toast__message\">{{ toast().message }}</span>\r\n @if (hasActions()) {\r\n <div class=\"gog-toast__actions\">\r\n @for (action of toast().actions; track action.label) {\r\n <gog-button\r\n class=\"gog-toast__action\"\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n type=\"button\"\r\n (gogClick)=\"runAction(action)\"\r\n >\r\n @if (action.iconName || action.iconTemplate) {\r\n <gog-icon\r\n [template]=\"action.iconTemplate ?? null\"\r\n [name]=\"action.iconName ?? 'check'\"\r\n />\r\n }\r\n {{ action.label }}\r\n </gog-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n <gog-button\r\n class=\"gog-toast__close\"\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n type=\"button\"\r\n aria-label=\"Close toast\"\r\n (gogClick)=\"close()\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </gog-button>\r\n </div>\r\n @if (!toast().isSticky) {\r\n <span #progress class=\"gog-toast__progress\" aria-hidden=\"true\"></span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-toast{--toast-border: var(--gog-toast-type-color, var(--gog-toast-border));--toast-icon-color: var(--gog-toast-type-color, var(--gog-toast-icon-color));--toast-enter-x: var(--gog-toast-enter-distance);--toast-progress-color: var(--toast-border);--toast-stack-depth: min(var(--toast-stack-index, 0), var(--gog-toast-stack-max-depth));--toast-stack-collapsed-y: calc( var(--toast-stack-depth) * var(--gog-toast-stack-peek) * var(--toast-stack-direction, 1) );--toast-stack-expanded-y: calc( var(--toast-stack-depth) * var(--gog-toast-stack-expanded-gap) * var(--toast-stack-direction, 1) );--toast-stack-y: calc( var(--toast-stack-collapsed-y) + (var(--toast-stack-expanded-y) - var(--toast-stack-collapsed-y)) * var(--toast-stack-expanded, 0) );--toast-stack-collapsed-scale: calc( 1 - (var(--toast-stack-depth) * var(--gog-toast-stack-scale-step)) );--toast-stack-scale: calc( var(--toast-stack-collapsed-scale) + (1 - var(--toast-stack-collapsed-scale)) * var(--toast-stack-expanded, 0) );--toast-stack-collapsed-opacity: max( var(--gog-toast-stack-min-opacity), calc(1 - (var(--toast-stack-depth) * var(--gog-toast-stack-opacity-step))) );--toast-stack-opacity: calc( var(--toast-stack-collapsed-opacity) + (1 - var(--toast-stack-collapsed-opacity)) * var(--toast-stack-expanded, 0) );position:relative;z-index:calc(var(--gog-toast-base-z) - var(--toast-stack-index, 0));display:block;padding:var(--gog-toast-padding);background:var(--gog-toast-bg);border-left:var(--gog-toast-accent-width) solid var(--toast-border);border-radius:var(--gog-toast-radius);color:var(--gog-toast-color);font-family:var(--gog-toast-font-family);box-shadow:var(--gog-toast-shadow);min-width:var(--gog-toast-min-width);max-width:var(--gog-toast-max-width);pointer-events:all;opacity:0;overflow:hidden;transform:translate3d(var(--toast-enter-x),var(--toast-stack-y),0) scale(var(--toast-stack-scale));transition:opacity var(--gog-toast-transition-duration) var(--gog-easing),transform var(--gog-toast-transition-duration) var(--gog-easing)}.gog-toast--visible{opacity:var(--toast-stack-opacity);transform:translate3d(0,var(--toast-stack-y),0) scale(var(--toast-stack-scale))}:host(.slide-left) .gog-toast{--toast-enter-x: calc(var(--gog-toast-enter-distance) * -1)}.gog-toast--success{--gog-toast-type-color: var(--gog-toast-success-color)}.gog-toast--error{--gog-toast-type-color: var(--gog-toast-error-color)}.gog-toast--warning{--gog-toast-type-color: var(--gog-toast-warning-color)}.gog-toast--info{--gog-toast-type-color: var(--gog-toast-info-color)}.gog-toast__icon{color:var(--toast-icon-color);font-size:var(--gog-toast-icon-size);line-height:var(--gog-toast-icon-line-height);flex-shrink:0}.gog-toast__icon gog-icon{font-size:var(--gog-toast-icon-size)}.gog-toast__content{display:flex;align-items:flex-start;gap:var(--gog-toast-content-gap)}.gog-toast__main{display:flex;flex:1;flex-direction:column;gap:var(--gog-toast-main-gap);min-width:0}.gog-toast__message{flex:1;font-size:var(--gog-toast-message-font-size);line-height:var(--gog-toast-message-line-height)}.gog-toast__actions{display:flex;flex-wrap:wrap;gap:var(--gog-toast-actions-gap)}.gog-toast__action{--gog-btn-padding: var(--gog-toast-action-padding);--gog-btn-font-size: var(--gog-toast-action-font-size)}.gog-toast__action gog-icon{font-size:var(--gog-toast-action-font-size)}.gog-toast__close{align-self:flex-start;flex-shrink:0;--gog-btn-padding: var(--gog-toast-close-padding);--gog-btn-font-size: var(--gog-toast-close-font-size)}.gog-toast__close gog-icon{font-size:var(--gog-toast-close-font-size)}.gog-toast__progress{position:absolute;right:0;bottom:0;left:0;height:var(--gog-toast-progress-height);background:color-mix(in srgb,var(--toast-progress-color) var(--gog-toast-progress-opacity),transparent);transform-origin:left center;animation:gog-toast-progress var(--toast-duration) linear forwards}.gog-toast--paused .gog-toast__progress,.gog-toast--queued .gog-toast__progress{animation-play-state:paused}@keyframes gog-toast-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@media(prefers-reduced-motion:reduce){.gog-toast,.gog-toast__progress{transition:none;animation:none}}\n"] }]
|
|
4997
|
+
args: [{ selector: 'gog-toast', imports: [ButtonComponent, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"gog-toast\"\r\n [class.gog-toast--paused]=\"isPaused()\"\r\n [class.gog-toast--queued]=\"!isFront()\"\r\n [class.gog-toast--success]=\"toast().type === 'success'\"\r\n [class.gog-toast--error]=\"toast().type === 'error'\"\r\n [class.gog-toast--warning]=\"toast().type === 'warning'\"\r\n [class.gog-toast--info]=\"toast().type === 'info'\"\r\n [class.gog-toast--visible]=\"visible()\"\r\n [style.--toast-duration]=\"toast().duration + 'ms'\"\r\n (mouseenter)=\"pauseAutoDismiss()\"\r\n (mouseleave)=\"resumeAutoDismiss()\"\r\n (transitionend)=\"onTransitionEnd($event)\"\r\n>\r\n <div class=\"gog-toast__content\">\r\n <span class=\"gog-toast__icon\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"toast().iconTemplate ?? null\" [name]=\"toast().iconName\" />\r\n </span>\r\n <div class=\"gog-toast__main\">\r\n <span class=\"gog-toast__message\">{{ toast().message }}</span>\r\n @if (hasActions()) {\r\n <div class=\"gog-toast__actions\">\r\n @for (action of toast().actions; track action.label) {\r\n <gog-button\r\n class=\"gog-toast__action\"\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n type=\"button\"\r\n (gogClick)=\"runAction(action)\"\r\n >\r\n @if (action.iconName || action.iconTemplate) {\r\n <gog-icon\r\n [template]=\"action.iconTemplate ?? null\"\r\n [name]=\"action.iconName ?? 'check'\"\r\n />\r\n }\r\n {{ action.label }}\r\n </gog-button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n <gog-button\r\n class=\"gog-toast__close\"\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n type=\"button\"\r\n [ariaLabel]=\"closeLabel\"\r\n (gogClick)=\"close()\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </gog-button>\r\n </div>\r\n @if (!toast().isSticky) {\r\n <span #progress class=\"gog-toast__progress\" aria-hidden=\"true\"></span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.gog-toast{--toast-border: var(--gog-toast-type-color, var(--gog-toast-border));--toast-icon-color: var(--gog-toast-type-color, var(--gog-toast-icon-color));--toast-enter-x: var(--gog-toast-enter-distance);--toast-progress-color: var(--toast-border);--toast-stack-depth: min(var(--toast-stack-index, 0), var(--gog-toast-stack-max-depth));--toast-stack-collapsed-y: calc( var(--toast-stack-depth) * var(--gog-toast-stack-peek) * var(--toast-stack-direction, 1) );--toast-stack-expanded-y: calc( var(--toast-stack-depth) * var(--gog-toast-stack-expanded-gap) * var(--toast-stack-direction, 1) );--toast-stack-y: calc( var(--toast-stack-collapsed-y) + (var(--toast-stack-expanded-y) - var(--toast-stack-collapsed-y)) * var(--toast-stack-expanded, 0) );--toast-stack-collapsed-scale: calc( 1 - (var(--toast-stack-depth) * var(--gog-toast-stack-scale-step)) );--toast-stack-scale: calc( var(--toast-stack-collapsed-scale) + (1 - var(--toast-stack-collapsed-scale)) * var(--toast-stack-expanded, 0) );--toast-stack-collapsed-opacity: max( var(--gog-toast-stack-min-opacity), calc(1 - (var(--toast-stack-depth) * var(--gog-toast-stack-opacity-step))) );--toast-stack-opacity: calc( var(--toast-stack-collapsed-opacity) + (1 - var(--toast-stack-collapsed-opacity)) * var(--toast-stack-expanded, 0) );position:relative;z-index:calc(var(--gog-toast-base-z) - var(--toast-stack-index, 0));display:block;padding:var(--gog-toast-padding);background:var(--gog-toast-bg);border-left:var(--gog-toast-accent-width) solid var(--toast-border);border-radius:var(--gog-toast-radius);color:var(--gog-toast-color);font-family:var(--gog-toast-font-family);box-shadow:var(--gog-toast-shadow);min-width:var(--gog-toast-min-width);max-width:var(--gog-toast-max-width);pointer-events:all;opacity:0;overflow:hidden;transform:translate3d(var(--toast-enter-x),var(--toast-stack-y),0) scale(var(--toast-stack-scale));transition:opacity var(--gog-toast-transition-duration) var(--gog-easing),transform var(--gog-toast-transition-duration) var(--gog-easing)}.gog-toast--visible{opacity:var(--toast-stack-opacity);transform:translate3d(0,var(--toast-stack-y),0) scale(var(--toast-stack-scale))}:host(.slide-left) .gog-toast{--toast-enter-x: calc(var(--gog-toast-enter-distance) * -1)}.gog-toast--success{--gog-toast-type-color: var(--gog-toast-success-color)}.gog-toast--error{--gog-toast-type-color: var(--gog-toast-error-color)}.gog-toast--warning{--gog-toast-type-color: var(--gog-toast-warning-color)}.gog-toast--info{--gog-toast-type-color: var(--gog-toast-info-color)}.gog-toast__icon{color:var(--toast-icon-color);font-size:var(--gog-toast-icon-size);line-height:var(--gog-toast-icon-line-height);flex-shrink:0}.gog-toast__icon gog-icon{font-size:var(--gog-toast-icon-size)}.gog-toast__content{display:flex;align-items:flex-start;gap:var(--gog-toast-content-gap)}.gog-toast__main{display:flex;flex:1;flex-direction:column;gap:var(--gog-toast-main-gap);min-width:0}.gog-toast__message{flex:1;font-size:var(--gog-toast-message-font-size);line-height:var(--gog-toast-message-line-height)}.gog-toast__actions{display:flex;flex-wrap:wrap;gap:var(--gog-toast-actions-gap)}.gog-toast__action{--gog-btn-padding: var(--gog-toast-action-padding);--gog-btn-font-size: var(--gog-toast-action-font-size)}.gog-toast__action gog-icon{font-size:var(--gog-toast-action-font-size)}.gog-toast__close{align-self:flex-start;flex-shrink:0;--gog-btn-padding: var(--gog-toast-close-padding);--gog-btn-font-size: var(--gog-toast-close-font-size)}.gog-toast__close gog-icon{font-size:var(--gog-toast-close-font-size)}.gog-toast__progress{position:absolute;right:0;bottom:0;left:0;height:var(--gog-toast-progress-height);background:color-mix(in srgb,var(--toast-progress-color) var(--gog-toast-progress-opacity),transparent);transform-origin:left center;animation:gog-toast-progress var(--toast-duration) linear forwards}.gog-toast--paused .gog-toast__progress,.gog-toast--queued .gog-toast__progress{animation-play-state:paused}@keyframes gog-toast-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@media(prefers-reduced-motion:reduce){.gog-toast,.gog-toast__progress{transition:none;animation:none}}\n"] }]
|
|
4661
4998
|
}], ctorParameters: () => [], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], isFront: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFront", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }], progressEl: [{ type: i0.ViewChild, args: ['progress', { isSignal: true }] }] } });
|
|
4662
4999
|
|
|
4663
5000
|
const DEFAULT_DURATION = 4000;
|
|
@@ -4773,6 +5110,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4773
5110
|
}] });
|
|
4774
5111
|
|
|
4775
5112
|
const POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
|
|
5113
|
+
/** The two types urgent enough to interrupt whatever the screen reader is currently saying. */
|
|
5114
|
+
const ASSERTIVE_TYPES = ['error', 'warning'];
|
|
4776
5115
|
class ToastContainerComponent {
|
|
4777
5116
|
toastService = inject(ToastService);
|
|
4778
5117
|
maxVisiblePerPosition = input(5, ...(ngDevMode ? [{ debugName: "maxVisiblePerPosition" }] : /* istanbul ignore next */ []));
|
|
@@ -4785,6 +5124,25 @@ class ToastContainerComponent {
|
|
|
4785
5124
|
.filter((toast) => toast.position === position)
|
|
4786
5125
|
.slice(0, Math.max(0, this.maxVisiblePerPosition())),
|
|
4787
5126
|
})).filter((group) => group.toasts.length > 0), ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
5127
|
+
/**
|
|
5128
|
+
* What the two permanently-mounted live regions in the template say right now, split by
|
|
5129
|
+
* urgency. The regions themselves are always in the DOM — that is the whole point of putting
|
|
5130
|
+
* them here rather than on `gog-toast`, whose host element only exists from the moment its
|
|
5131
|
+
* text does, which is exactly the case screen readers miss.
|
|
5132
|
+
*
|
|
5133
|
+
* Derived from `groups()` rather than from the raw service state so that what is announced
|
|
5134
|
+
* matches what is on screen: a toast queued beyond `maxVisiblePerPosition` is not visible yet
|
|
5135
|
+
* and must not be read out yet either.
|
|
5136
|
+
*/
|
|
5137
|
+
announcements = computed(() => {
|
|
5138
|
+
const visible = this.groups().flatMap((group) => group.toasts);
|
|
5139
|
+
return {
|
|
5140
|
+
polite: visible.filter((toast) => !ASSERTIVE_TYPES.includes(toast.type)).map(toAnnouncement),
|
|
5141
|
+
assertive: visible
|
|
5142
|
+
.filter((toast) => ASSERTIVE_TYPES.includes(toast.type))
|
|
5143
|
+
.map(toAnnouncement),
|
|
5144
|
+
};
|
|
5145
|
+
}, ...(ngDevMode ? [{ debugName: "announcements" }] : /* istanbul ignore next */ []));
|
|
4788
5146
|
trackGroup(_, group) {
|
|
4789
5147
|
return group.position;
|
|
4790
5148
|
}
|
|
@@ -4794,21 +5152,34 @@ class ToastContainerComponent {
|
|
|
4794
5152
|
trackToast(_, toast) {
|
|
4795
5153
|
return toast.id;
|
|
4796
5154
|
}
|
|
5155
|
+
trackAnnouncement(_, announcement) {
|
|
5156
|
+
return announcement.key;
|
|
5157
|
+
}
|
|
4797
5158
|
dismiss(id) {
|
|
4798
5159
|
this.toastService.dismiss(id);
|
|
4799
5160
|
}
|
|
4800
5161
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4801
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ToastContainerComponent, isStandalone: true, selector: "gog-toast-container", inputs: { maxVisiblePerPosition: { classPropertyName: "maxVisiblePerPosition", publicName: "maxVisiblePerPosition", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (group of groups(); track trackGroup($index, group)) {\r\n <div class=\"gog-toast-container gog-toast-container--{{ group.position }}\">\r\n @for (toast of group.toasts; track trackToast($index, toast); let toastIndex = $index) {\r\n <gog-toast\r\n [toast]=\"toast\"\r\n [isFront]=\"toastIndex === 0\"\r\n [class.slide-left]=\"isLeft(group.position)\"\r\n [style.--toast-stack-index]=\"toastIndex\"\r\n (dismissed)=\"dismiss($event)\"\r\n />\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:contents}.gog-toast-container{position:fixed;z-index:var(--gog-toast-z-index);display:grid;padding:var(--gog-toast-stack-padding);pointer-events:none;max-width:var(--gog-toast-max-width)}.gog-toast-container>gog-toast{grid-column:1;grid-row:1}.gog-toast-container--top-right{top:0;right:0;justify-items:end}.gog-toast-container--top-left{top:0;left:0;justify-items:start}.gog-toast-container--bottom-right{bottom:0;right:0;justify-items:end}.gog-toast-container--bottom-left{bottom:0;left:0;justify-items:start}.gog-toast-container--top-left,.gog-toast-container--top-right{align-items:start;--toast-stack-direction: 1}.gog-toast-container--bottom-left,.gog-toast-container--bottom-right{align-items:end;--toast-stack-direction: -1}.gog-toast-container:hover{--toast-stack-expanded: 1}\n"], dependencies: [{ kind: "component", type: ToastComponent, selector: "gog-toast", inputs: ["toast", "isFront"], outputs: ["dismissed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: ToastContainerComponent, isStandalone: true, selector: "gog-toast-container", inputs: { maxVisiblePerPosition: { classPropertyName: "maxVisiblePerPosition", publicName: "maxVisiblePerPosition", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!--\r\n Both regions stay mounted for the lifetime of the container, empty or not, so a screen reader\r\n has already picked them up by the time a message lands inside one. `aria-atomic=\"false\"` so\r\n only the newly added line is read, not the whole open stack again on every arrival.\r\n-->\r\n<div class=\"gog-visually-hidden\" aria-live=\"polite\" aria-atomic=\"false\">\r\n @for (announcement of announcements().polite; track trackAnnouncement($index, announcement)) {\r\n <p>{{ announcement.message }}</p>\r\n }\r\n</div>\r\n<div class=\"gog-visually-hidden\" aria-live=\"assertive\" aria-atomic=\"false\">\r\n @for (announcement of announcements().assertive; track trackAnnouncement($index, announcement)) {\r\n <p>{{ announcement.message }}</p>\r\n }\r\n</div>\r\n\r\n@for (group of groups(); track trackGroup($index, group)) {\r\n <div class=\"gog-toast-container gog-toast-container--{{ group.position }}\">\r\n @for (toast of group.toasts; track trackToast($index, toast); let toastIndex = $index) {\r\n <gog-toast\r\n [toast]=\"toast\"\r\n [isFront]=\"toastIndex === 0\"\r\n [class.slide-left]=\"isLeft(group.position)\"\r\n [style.--toast-stack-index]=\"toastIndex\"\r\n (dismissed)=\"dismiss($event)\"\r\n />\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:contents}.gog-toast-container{position:fixed;z-index:var(--gog-toast-z-index);display:grid;padding:var(--gog-toast-stack-padding);pointer-events:none;max-width:var(--gog-toast-max-width)}.gog-toast-container>gog-toast{grid-column:1;grid-row:1}.gog-toast-container--top-right{top:0;right:0;justify-items:end}.gog-toast-container--top-left{top:0;left:0;justify-items:start}.gog-toast-container--bottom-right{bottom:0;right:0;justify-items:end}.gog-toast-container--bottom-left{bottom:0;left:0;justify-items:start}.gog-toast-container--top-left,.gog-toast-container--top-right{align-items:start;--toast-stack-direction: 1}.gog-toast-container--bottom-left,.gog-toast-container--bottom-right{align-items:end;--toast-stack-direction: -1}.gog-toast-container:hover{--toast-stack-expanded: 1}\n"], dependencies: [{ kind: "component", type: ToastComponent, selector: "gog-toast", inputs: ["toast", "isFront"], outputs: ["dismissed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4802
5163
|
}
|
|
4803
5164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ToastContainerComponent, decorators: [{
|
|
4804
5165
|
type: Component,
|
|
4805
|
-
args: [{ selector: 'gog-toast-container', imports: [ToastComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (group of groups(); track trackGroup($index, group)) {\r\n <div class=\"gog-toast-container gog-toast-container--{{ group.position }}\">\r\n @for (toast of group.toasts; track trackToast($index, toast); let toastIndex = $index) {\r\n <gog-toast\r\n [toast]=\"toast\"\r\n [isFront]=\"toastIndex === 0\"\r\n [class.slide-left]=\"isLeft(group.position)\"\r\n [style.--toast-stack-index]=\"toastIndex\"\r\n (dismissed)=\"dismiss($event)\"\r\n />\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:contents}.gog-toast-container{position:fixed;z-index:var(--gog-toast-z-index);display:grid;padding:var(--gog-toast-stack-padding);pointer-events:none;max-width:var(--gog-toast-max-width)}.gog-toast-container>gog-toast{grid-column:1;grid-row:1}.gog-toast-container--top-right{top:0;right:0;justify-items:end}.gog-toast-container--top-left{top:0;left:0;justify-items:start}.gog-toast-container--bottom-right{bottom:0;right:0;justify-items:end}.gog-toast-container--bottom-left{bottom:0;left:0;justify-items:start}.gog-toast-container--top-left,.gog-toast-container--top-right{align-items:start;--toast-stack-direction: 1}.gog-toast-container--bottom-left,.gog-toast-container--bottom-right{align-items:end;--toast-stack-direction: -1}.gog-toast-container:hover{--toast-stack-expanded: 1}\n"] }]
|
|
5166
|
+
args: [{ selector: 'gog-toast-container', imports: [ToastComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\r\n Both regions stay mounted for the lifetime of the container, empty or not, so a screen reader\r\n has already picked them up by the time a message lands inside one. `aria-atomic=\"false\"` so\r\n only the newly added line is read, not the whole open stack again on every arrival.\r\n-->\r\n<div class=\"gog-visually-hidden\" aria-live=\"polite\" aria-atomic=\"false\">\r\n @for (announcement of announcements().polite; track trackAnnouncement($index, announcement)) {\r\n <p>{{ announcement.message }}</p>\r\n }\r\n</div>\r\n<div class=\"gog-visually-hidden\" aria-live=\"assertive\" aria-atomic=\"false\">\r\n @for (announcement of announcements().assertive; track trackAnnouncement($index, announcement)) {\r\n <p>{{ announcement.message }}</p>\r\n }\r\n</div>\r\n\r\n@for (group of groups(); track trackGroup($index, group)) {\r\n <div class=\"gog-toast-container gog-toast-container--{{ group.position }}\">\r\n @for (toast of group.toasts; track trackToast($index, toast); let toastIndex = $index) {\r\n <gog-toast\r\n [toast]=\"toast\"\r\n [isFront]=\"toastIndex === 0\"\r\n [class.slide-left]=\"isLeft(group.position)\"\r\n [style.--toast-stack-index]=\"toastIndex\"\r\n (dismissed)=\"dismiss($event)\"\r\n />\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:contents}.gog-toast-container{position:fixed;z-index:var(--gog-toast-z-index);display:grid;padding:var(--gog-toast-stack-padding);pointer-events:none;max-width:var(--gog-toast-max-width)}.gog-toast-container>gog-toast{grid-column:1;grid-row:1}.gog-toast-container--top-right{top:0;right:0;justify-items:end}.gog-toast-container--top-left{top:0;left:0;justify-items:start}.gog-toast-container--bottom-right{bottom:0;right:0;justify-items:end}.gog-toast-container--bottom-left{bottom:0;left:0;justify-items:start}.gog-toast-container--top-left,.gog-toast-container--top-right{align-items:start;--toast-stack-direction: 1}.gog-toast-container--bottom-left,.gog-toast-container--bottom-right{align-items:end;--toast-stack-direction: -1}.gog-toast-container:hover{--toast-stack-expanded: 1}\n"] }]
|
|
4806
5167
|
}], propDecorators: { maxVisiblePerPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisiblePerPosition", required: false }] }] } });
|
|
5168
|
+
function toAnnouncement(toast) {
|
|
5169
|
+
return { key: `${toast.id}:${toast.revision}`, message: toast.message };
|
|
5170
|
+
}
|
|
4807
5171
|
|
|
4808
5172
|
/** Built-in defaults, used when neither the instance input nor `GOG_CONFIG` supplies one. */
|
|
4809
5173
|
const DEFAULT_SIZE$1 = 'md';
|
|
4810
5174
|
const DEFAULT_ERROR_DISPLAY$2 = 'manual';
|
|
4811
5175
|
const DEFAULT_SHOW_SPIN_BUTTONS = true;
|
|
5176
|
+
const DEFAULT_LABELS$2 = {
|
|
5177
|
+
clear: 'Clear',
|
|
5178
|
+
increment: 'Increment',
|
|
5179
|
+
decrement: 'Decrement',
|
|
5180
|
+
showPassword: 'Show password',
|
|
5181
|
+
hidePassword: 'Hide password',
|
|
5182
|
+
};
|
|
4812
5183
|
/** Native `stepUp()`/`stepDown()` default when `step` is left unset. */
|
|
4813
5184
|
const DEFAULT_STEP = 1;
|
|
4814
5185
|
/** Rounds to `step`'s own decimal precision, so e.g. repeated `0.1` steps don't drift to
|
|
@@ -4862,9 +5233,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4862
5233
|
class InputfieldComponent {
|
|
4863
5234
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4864
5235
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
5236
|
+
/** See `GogInputType` for why this is a subset of the native `type` list. */
|
|
4865
5237
|
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
4866
5238
|
/** Defaults to 'current-password' for password fields, 'off' otherwise */
|
|
4867
5239
|
autocomplete = input('', ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
5240
|
+
/**
|
|
5241
|
+
* Native `readonly`: the value is still selectable, focusable and submitted with the form, but
|
|
5242
|
+
* cannot be edited. Distinct from `disabled`, which also takes the field out of the tab order,
|
|
5243
|
+
* greys it out and drops it from form submission.
|
|
5244
|
+
*
|
|
5245
|
+
* Suppresses the clear button and the number field's spin buttons for as long as it is on —
|
|
5246
|
+
* both promise an edit the field would refuse.
|
|
5247
|
+
*/
|
|
5248
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
5249
|
+
/** Native `maxlength`. Unset (`null`), no limit is applied. */
|
|
5250
|
+
maxlength = input(null, ...(ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []));
|
|
5251
|
+
/** Native `minlength`. Unset (`null`), no minimum is applied. */
|
|
5252
|
+
minlength = input(null, ...(ngDevMode ? [{ debugName: "minlength" }] : /* istanbul ignore next */ []));
|
|
5253
|
+
/** Native `pattern`, as a regular-expression source string. Unset (`''`), nothing is applied. */
|
|
5254
|
+
pattern = input('', ...(ngDevMode ? [{ debugName: "pattern" }] : /* istanbul ignore next */ []));
|
|
5255
|
+
/**
|
|
5256
|
+
* Native `inputmode` — see `GogInputMode`. Unset, the browser infers a keyboard from `type`.
|
|
5257
|
+
*/
|
|
5258
|
+
inputMode = input(null, ...(ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []));
|
|
5259
|
+
/**
|
|
5260
|
+
* Native `spellcheck`. Unset (`null`), the browser's own default applies; set `false` on
|
|
5261
|
+
* fields holding names, codes or identifiers, where the red underline is noise.
|
|
5262
|
+
*/
|
|
5263
|
+
spellcheck = input(null, ...(ngDevMode ? [{ debugName: "spellcheck" }] : /* istanbul ignore next */ []));
|
|
4868
5264
|
/** Only applied when `type="number"`. */
|
|
4869
5265
|
min = input(null, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
4870
5266
|
/** Only applied when `type="number"`. */
|
|
@@ -4881,10 +5277,10 @@ class InputfieldComponent {
|
|
|
4881
5277
|
* then to `true`.
|
|
4882
5278
|
*/
|
|
4883
5279
|
showSpinButtons = input(undefined, ...(ngDevMode ? [{ debugName: "showSpinButtons" }] : /* istanbul ignore next */ []));
|
|
4884
|
-
/** aria-label for the number field's increment button. */
|
|
4885
|
-
incrementLabel = input(
|
|
4886
|
-
/** aria-label for the number field's decrement button. */
|
|
4887
|
-
decrementLabel = input(
|
|
5280
|
+
/** aria-label for the number field's increment button. Unset, falls back to `GOG_CONFIG.labels.increment`. */
|
|
5281
|
+
incrementLabel = input(undefined, ...(ngDevMode ? [{ debugName: "incrementLabel" }] : /* istanbul ignore next */ []));
|
|
5282
|
+
/** aria-label for the number field's decrement button. Unset, falls back to `GOG_CONFIG.labels.decrement`. */
|
|
5283
|
+
decrementLabel = input(undefined, ...(ngDevMode ? [{ debugName: "decrementLabel" }] : /* istanbul ignore next */ []));
|
|
4888
5284
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
4889
5285
|
/**
|
|
4890
5286
|
* See `GogErrorDisplay`. Unset, falls back to `GOG_CONFIG.control.errorDisplay`, then to
|
|
@@ -4892,6 +5288,12 @@ class InputfieldComponent {
|
|
|
4892
5288
|
*/
|
|
4893
5289
|
errorDisplay = input(undefined, ...(ngDevMode ? [{ debugName: "errorDisplay" }] : /* istanbul ignore next */ []));
|
|
4894
5290
|
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
5291
|
+
/**
|
|
5292
|
+
* The `<input>`'s `id`. Left unset, the field generates one — the label's `for` and the error
|
|
5293
|
+
* message's `aria-describedby` both need a real id, and a field that is silently unlabelled
|
|
5294
|
+
* without one is the wrong default. Set this only when something outside the component has to
|
|
5295
|
+
* reference the input by a known id.
|
|
5296
|
+
*/
|
|
4895
5297
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
4896
5298
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4897
5299
|
/** Unset, falls back to `GOG_CONFIG.control.size`, then to `'md'`. */
|
|
@@ -4931,17 +5333,17 @@ class InputfieldComponent {
|
|
|
4931
5333
|
* @deprecated since 21.3.0 (2026-08-07) — project a `<button gogInputAddonEnd>` element instead. Removed in 21.5.0. Put `aria-label` on that button.
|
|
4932
5334
|
*/
|
|
4933
5335
|
iconEndLabel = input('', ...(ngDevMode ? [{ debugName: "iconEndLabel" }] : /* istanbul ignore next */ []));
|
|
4934
|
-
/** aria-label for the reveal-password button, shown when `type` is `'password'` */
|
|
4935
|
-
showPasswordLabel = input(
|
|
4936
|
-
/** aria-label for the hide-password button, shown once the password is revealed */
|
|
4937
|
-
hidePasswordLabel = input(
|
|
5336
|
+
/** aria-label for the reveal-password button, shown when `type` is `'password'`. Unset, falls back to `GOG_CONFIG.labels.showPassword`. */
|
|
5337
|
+
showPasswordLabel = input(undefined, ...(ngDevMode ? [{ debugName: "showPasswordLabel" }] : /* istanbul ignore next */ []));
|
|
5338
|
+
/** aria-label for the hide-password button, shown once the password is revealed. Unset, falls back to `GOG_CONFIG.labels.hidePassword`. */
|
|
5339
|
+
hidePasswordLabel = input(undefined, ...(ngDevMode ? [{ debugName: "hidePasswordLabel" }] : /* istanbul ignore next */ []));
|
|
4938
5340
|
/**
|
|
4939
5341
|
* Whether to offer a clear button once the field has text. Unset, falls back to
|
|
4940
5342
|
* `GOG_CONFIG.control.clearable`, then to `false`.
|
|
4941
5343
|
*/
|
|
4942
5344
|
clearable = input(undefined, ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
4943
|
-
/** Accessible name for the clear button. */
|
|
4944
|
-
clearAriaLabel = input(
|
|
5345
|
+
/** Accessible name for the clear button. Unset, falls back to `GOG_CONFIG.labels.clear`. */
|
|
5346
|
+
clearAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
|
|
4945
5347
|
/** Unset, falls back to `GOG_CONFIG.floatLabel.variant`, then to `'none'` (off). */
|
|
4946
5348
|
floatLabel = input(undefined, ...(ngDevMode ? [{ debugName: "floatLabel" }] : /* istanbul ignore next */ []));
|
|
4947
5349
|
/** Unset, falls back to `GOG_CONFIG.floatLabel.showPlaceholder`, then to `false`. */
|
|
@@ -4968,13 +5370,19 @@ class InputfieldComponent {
|
|
|
4968
5370
|
* Empty for `'md'`: that is this component's default size and has no modifier rule of its own — every `gog-input-wrapper--*` chain bottoms out at it.
|
|
4969
5371
|
*/
|
|
4970
5372
|
sizeClass = computed(() => this.resolvedSize() === 'md' ? '' : `gog-input-wrapper--${this.resolvedSize()}`, ...(ngDevMode ? [{ debugName: "sizeClass" }] : /* istanbul ignore next */ []));
|
|
5373
|
+
/** Instance input → `GOG_CONFIG.labels` → the built-in English default. */
|
|
5374
|
+
resolvedClearLabel = computed(() => resolveConfigured(this.clearAriaLabel(), this.globalConfig.labels?.clear, DEFAULT_LABELS$2.clear), ...(ngDevMode ? [{ debugName: "resolvedClearLabel" }] : /* istanbul ignore next */ []));
|
|
5375
|
+
resolvedIncrementLabel = computed(() => resolveConfigured(this.incrementLabel(), this.globalConfig.labels?.increment, DEFAULT_LABELS$2.increment), ...(ngDevMode ? [{ debugName: "resolvedIncrementLabel" }] : /* istanbul ignore next */ []));
|
|
5376
|
+
resolvedDecrementLabel = computed(() => resolveConfigured(this.decrementLabel(), this.globalConfig.labels?.decrement, DEFAULT_LABELS$2.decrement), ...(ngDevMode ? [{ debugName: "resolvedDecrementLabel" }] : /* istanbul ignore next */ []));
|
|
4971
5377
|
resolvedShowSpinButtons = computed(() => resolveConfigured(this.showSpinButtons(), this.globalConfig.inputfield?.showSpinButtons, DEFAULT_SHOW_SPIN_BUTTONS), ...(ngDevMode ? [{ debugName: "resolvedShowSpinButtons" }] : /* istanbul ignore next */ []));
|
|
4972
5378
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
5379
|
+
/** Disabled and read-only both refuse edits; the affordances that offer one key off this. */
|
|
5380
|
+
isNotEditable = computed(() => this.isDisabled() || this.readonly(), ...(ngDevMode ? [{ debugName: "isNotEditable" }] : /* istanbul ignore next */ []));
|
|
4973
5381
|
isPasswordField = computed(() => this.type() === 'password', ...(ngDevMode ? [{ debugName: "isPasswordField" }] : /* istanbul ignore next */ []));
|
|
4974
5382
|
isNumberField = computed(() => this.type() === 'number', ...(ngDevMode ? [{ debugName: "isNumberField" }] : /* istanbul ignore next */ []));
|
|
4975
|
-
hasSpinButtons = computed(() => this.isNumberField() && this.resolvedShowSpinButtons(), ...(ngDevMode ? [{ debugName: "hasSpinButtons" }] : /* istanbul ignore next */ []));
|
|
5383
|
+
hasSpinButtons = computed(() => this.isNumberField() && this.resolvedShowSpinButtons() && !this.readonly(), ...(ngDevMode ? [{ debugName: "hasSpinButtons" }] : /* istanbul ignore next */ []));
|
|
4976
5384
|
/** Current field value as a number, or `null` while empty. */
|
|
4977
|
-
numericValue = computed(() =>
|
|
5385
|
+
numericValue = computed(() => this.value() === '' ? null : Number(this.value()), ...(ngDevMode ? [{ debugName: "numericValue" }] : /* istanbul ignore next */ []));
|
|
4978
5386
|
isAtMin = computed(() => {
|
|
4979
5387
|
const min = this.min();
|
|
4980
5388
|
const current = this.numericValue();
|
|
@@ -4989,12 +5397,28 @@ class InputfieldComponent {
|
|
|
4989
5397
|
effectiveAutocomplete = computed(() => this.autocomplete() || (this.type() === 'password' ? 'current-password' : 'off'), ...(ngDevMode ? [{ debugName: "effectiveAutocomplete" }] : /* istanbul ignore next */ []));
|
|
4990
5398
|
hasError = this.errorState.hasError;
|
|
4991
5399
|
visibleError = this.errorState.visibleError;
|
|
5400
|
+
/** Fallback id, generated once per instance — see `resolvedInputId`. */
|
|
5401
|
+
autoId = nextGogControlId('gog-input');
|
|
5402
|
+
/** The consumer's `inputId` when given, otherwise the generated one. Never empty. */
|
|
5403
|
+
resolvedInputId = computed(() => this.inputId() || this.autoId, ...(ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []));
|
|
5404
|
+
/**
|
|
5405
|
+
* Only non-null while the error element is actually rendered — the template renders it on
|
|
5406
|
+
* `visibleError()`, and an `aria-describedby` pointing at an id that isn't in the DOM is worse
|
|
5407
|
+
* than none at all.
|
|
5408
|
+
*/
|
|
5409
|
+
errorId = computed(() => this.visibleError() ? `${this.resolvedInputId()}-error` : null, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
4992
5410
|
floatLabelState = new GogFloatLabelState(this.floatLabel, this.floatLabelShowPlaceholder, this.placeholder, this.isFocused,
|
|
4993
5411
|
// "Has content" for a text field is simply a non-empty value.
|
|
4994
5412
|
computed(() => this.value() !== ''), this.globalConfig);
|
|
4995
|
-
clearableState = new GogClearableState(this.clearable, computed(() => this.value() !== ''), this.
|
|
5413
|
+
clearableState = new GogClearableState(this.clearable, computed(() => this.value() !== ''), this.isNotEditable, this.globalConfig, () => false);
|
|
4996
5414
|
/** Whether to render the clear button right now — see `GogClearableState`. */
|
|
4997
5415
|
showClear = this.clearableState.isVisible;
|
|
5416
|
+
/**
|
|
5417
|
+
* Both the stepper and the clear button are on screen — only possible on a `clearable`
|
|
5418
|
+
* number field with a value. Drives `.gog-input-wrapper--spin-clear`, which widens the end
|
|
5419
|
+
* gutter and shifts the clear button clear of the stepper; without it the two overlap.
|
|
5420
|
+
*/
|
|
5421
|
+
hasSpinAndClear = computed(() => this.hasSpinButtons() && this.showClear() && !this.isPasswordField(), ...(ngDevMode ? [{ debugName: "hasSpinAndClear" }] : /* istanbul ignore next */ []));
|
|
4998
5422
|
resolvedFloatLabel = this.floatLabelState.variant;
|
|
4999
5423
|
isFloatLabelActive = this.floatLabelState.isActive;
|
|
5000
5424
|
isFloatLabelFloated = this.floatLabelState.isFloated;
|
|
@@ -5011,11 +5435,13 @@ class InputfieldComponent {
|
|
|
5011
5435
|
hasIconStartAction = computed(() => !!this.iconStartFn(), ...(ngDevMode ? [{ debugName: "hasIconStartAction" }] : /* istanbul ignore next */ []));
|
|
5012
5436
|
/** For password fields the trailing icon is always the built-in show/hide toggle. */
|
|
5013
5437
|
effectiveIconEnd = computed(() => this.isPasswordField() ? (this.passwordVisible() ? 'eye-off' : 'eye') : this.iconEnd(), ...(ngDevMode ? [{ debugName: "effectiveIconEnd" }] : /* istanbul ignore next */ []));
|
|
5014
|
-
effectiveIconEndLabel = computed(() =>
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5438
|
+
effectiveIconEndLabel = computed(() => {
|
|
5439
|
+
if (!this.isPasswordField())
|
|
5440
|
+
return this.iconEndLabel();
|
|
5441
|
+
return this.passwordVisible()
|
|
5442
|
+
? resolveConfigured(this.hidePasswordLabel(), this.globalConfig.labels?.hidePassword, DEFAULT_LABELS$2.hidePassword)
|
|
5443
|
+
: resolveConfigured(this.showPasswordLabel(), this.globalConfig.labels?.showPassword, DEFAULT_LABELS$2.showPassword);
|
|
5444
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveIconEndLabel" }] : /* istanbul ignore next */ []));
|
|
5019
5445
|
hasIconEnd = computed(() => this.showClear() ||
|
|
5020
5446
|
!!this.addonEnd() ||
|
|
5021
5447
|
!!this.iconEndTemplate() ||
|
|
@@ -5068,7 +5494,7 @@ class InputfieldComponent {
|
|
|
5068
5494
|
}
|
|
5069
5495
|
/** Increments (`direction: 1`) or decrements (`direction: -1`) by `step`, clamped to min/max. */
|
|
5070
5496
|
stepValue(direction) {
|
|
5071
|
-
if (this.
|
|
5497
|
+
if (this.isNotEditable())
|
|
5072
5498
|
return;
|
|
5073
5499
|
const step = this.step() ?? DEFAULT_STEP;
|
|
5074
5500
|
const current = this.numericValue() ?? this.min() ?? 0;
|
|
@@ -5082,12 +5508,19 @@ class InputfieldComponent {
|
|
|
5082
5508
|
this.value.set(String(next));
|
|
5083
5509
|
this._onChange(next);
|
|
5084
5510
|
}
|
|
5085
|
-
/**
|
|
5511
|
+
/**
|
|
5512
|
+
* Clears the field and notifies any attached form.
|
|
5513
|
+
*
|
|
5514
|
+
* The value written to the form control has to match what `onInput` writes when the user
|
|
5515
|
+
* empties the field by hand — `null` for a number field, `''` otherwise. Emitting `''` for a
|
|
5516
|
+
* number field put a string into a control typed `number | null`, which then failed
|
|
5517
|
+
* `Validators.min`-style checks and round-tripped the wrong type to the server.
|
|
5518
|
+
*/
|
|
5086
5519
|
clearValue(event) {
|
|
5087
5520
|
event.preventDefault();
|
|
5088
5521
|
event.stopPropagation();
|
|
5089
5522
|
this.value.set('');
|
|
5090
|
-
this._onChange('');
|
|
5523
|
+
this._onChange(this.isNumberField() ? null : '');
|
|
5091
5524
|
this._onTouched();
|
|
5092
5525
|
}
|
|
5093
5526
|
onFocus() {
|
|
@@ -5098,7 +5531,7 @@ class InputfieldComponent {
|
|
|
5098
5531
|
this._onTouched();
|
|
5099
5532
|
}
|
|
5100
5533
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: InputfieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5101
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: InputfieldComponent, isStandalone: true, selector: "gog-inputfield", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, showSpinButtons: { classPropertyName: "showSpinButtons", publicName: "showSpinButtons", isSignal: true, isRequired: false, transformFunction: null }, incrementLabel: { classPropertyName: "incrementLabel", publicName: "incrementLabel", isSignal: true, isRequired: false, transformFunction: null }, decrementLabel: { classPropertyName: "decrementLabel", publicName: "decrementLabel", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, iconStart: { classPropertyName: "iconStart", publicName: "iconStart", isSignal: true, isRequired: false, transformFunction: null }, iconEnd: { classPropertyName: "iconEnd", publicName: "iconEnd", isSignal: true, isRequired: false, transformFunction: null }, iconStartTemplate: { classPropertyName: "iconStartTemplate", publicName: "iconStartTemplate", isSignal: true, isRequired: false, transformFunction: null }, iconEndTemplate: { classPropertyName: "iconEndTemplate", publicName: "iconEndTemplate", isSignal: true, isRequired: false, transformFunction: null }, iconStartFn: { classPropertyName: "iconStartFn", publicName: "iconStartFn", isSignal: true, isRequired: false, transformFunction: null }, iconEndFn: { classPropertyName: "iconEndFn", publicName: "iconEndFn", isSignal: true, isRequired: false, transformFunction: null }, iconStartLabel: { classPropertyName: "iconStartLabel", publicName: "iconStartLabel", isSignal: true, isRequired: false, transformFunction: null }, iconEndLabel: { classPropertyName: "iconEndLabel", publicName: "iconEndLabel", isSignal: true, isRequired: false, transformFunction: null }, showPasswordLabel: { classPropertyName: "showPasswordLabel", publicName: "showPasswordLabel", isSignal: true, isRequired: false, transformFunction: null }, hidePasswordLabel: { classPropertyName: "hidePasswordLabel", publicName: "hidePasswordLabel", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelShowPlaceholder: { classPropertyName: "floatLabelShowPlaceholder", publicName: "floatLabelShowPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.gog-host--auto-width": "!fullWidth()" } }, queries: [{ propertyName: "addonStart", first: true, predicate: GogInputAddonStartDirective, descendants: true, isSignal: true }, { propertyName: "addonEnd", first: true, predicate: GogInputAddonEndDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--icon-start]=\"hasIconStart()\"\r\n [class.gog-input-wrapper--icon-end]=\"hasIconEnd() || hasSpinButtons()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"inputId() || null\">{{ label() }}</label>\r\n }\r\n <div class=\"gog-input__field-container\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"inputId() || null\">{{\r\n label()\r\n }}</label>\r\n }\r\n @if (addonStart()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonStart]\" />\r\n </span>\r\n } @else if (hasIconStart()) {\r\n @if (hasIconStartAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__icon--action\"\r\n [attr.aria-label]=\"iconStartLabel() || null\"\r\n (click)=\"onIconStartClick()\"\r\n >\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n <input\r\n class=\"gog-input__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-input__field--spin-hidden]=\"isNumberField()\"\r\n [attr.id]=\"inputId() || null\"\r\n [type]=\"effectiveType()\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [autocomplete]=\"effectiveAutocomplete()\"\r\n [attr.min]=\"min()\"\r\n [attr.max]=\"max()\"\r\n [attr.step]=\"step()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"hasError() && inputId() ? inputId() + '-error' : null\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <!--\r\n A password field's built-in show/hide toggle owns the end slot: it is the only control\r\n that reveals the value, so a projected addon must not be able to displace it.\r\n -->\r\n @if (hasSpinButtons()) {\r\n <span class=\"gog-input__spin\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--up\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"incrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMax()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(1)\"\r\n >\r\n <gog-icon name=\"chevron-up\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--down\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"decrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMin()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(-1)\"\r\n >\r\n <gog-icon name=\"chevron-down\" />\r\n </button>\r\n </span>\r\n } @else if (showClear() && !isPasswordField()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action gog-input__clear\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n } @else if (addonEnd() && !isPasswordField()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonEnd]\" />\r\n </span>\r\n } @else if (hasIconEnd()) {\r\n @if (hasIconEndAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action\"\r\n [attr.aria-label]=\"effectiveIconEndLabel() || null\"\r\n (click)=\"onIconEndClick()\"\r\n >\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span\r\n class=\"gog-input__error\"\r\n [attr.id]=\"inputId() ? inputId() + '-error' : null\"\r\n role=\"alert\"\r\n >{{ visibleError() }}</span\r\n >\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field-container{position:relative;display:flex;align-items:center}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size);--gog-input-size-icon-offset: var(--gog-field-xsm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-xsm-icon-inset)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size);--gog-input-size-icon-offset: var(--gog-field-sm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-sm-icon-inset)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size);--gog-input-size-icon-offset: var(--gog-field-lg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-lg-icon-inset)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size);--gog-input-size-icon-offset: var(--gog-field-slg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-slg-icon-inset)}.gog-input-wrapper--icon-start .gog-input__field-container{--gog-input-pl: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input-wrapper--icon-end .gog-input__field-container{--gog-input-pr: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__icon{position:absolute;color:var(--gog-input-icon-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));pointer-events:none;line-height:1}.gog-input__addon{pointer-events:auto}.gog-input__icon--action{padding:0;background:none;border:none;cursor:pointer;pointer-events:auto;border-radius:var(--gog-input-icon-action-radius);color:var(--gog-input-icon-color);transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__icon--action:hover{color:var(--gog-input-icon-hover-color)}.gog-input__icon--action:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__icon--start{left:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__icon--end{right:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__field--spin-hidden::-webkit-inner-spin-button,.gog-input__field--spin-hidden::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;appearance:none}.gog-input__field--spin-hidden{appearance:textfield;-moz-appearance:textfield}.gog-input__spin{position:absolute;top:0;bottom:0;right:0;display:flex;flex-direction:column;pointer-events:auto;border-inline-start:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn{display:flex;flex:1 1 0;align-items:center;justify-content:center;width:calc(var(--gog-input-size-font-size, var(--gog-field-md-font-size)) * 1.35);padding:0;border:none;background:none;color:var(--gog-input-icon-color);line-height:0;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__spin-btn--up{border-start-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width));border-block-end:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn--down{border-end-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width))}.gog-input__spin-btn gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * .7)}.gog-input__spin-btn:hover:not(:disabled){color:var(--gog-input-icon-hover-color);background-color:var(--gog-input-spin-hover-bg)}.gog-input__spin-btn:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:calc(-1 * var(--gog-input-icon-focus-ring-width))}.gog-input__spin-btn:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__label--float{position:absolute;left:var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding);transform:none}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);transform:translateY(0);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5534
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: InputfieldComponent, isStandalone: true, selector: "gog-inputfield", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "inputMode", isSignal: true, isRequired: false, transformFunction: null }, spellcheck: { classPropertyName: "spellcheck", publicName: "spellcheck", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, showSpinButtons: { classPropertyName: "showSpinButtons", publicName: "showSpinButtons", isSignal: true, isRequired: false, transformFunction: null }, incrementLabel: { classPropertyName: "incrementLabel", publicName: "incrementLabel", isSignal: true, isRequired: false, transformFunction: null }, decrementLabel: { classPropertyName: "decrementLabel", publicName: "decrementLabel", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, iconStart: { classPropertyName: "iconStart", publicName: "iconStart", isSignal: true, isRequired: false, transformFunction: null }, iconEnd: { classPropertyName: "iconEnd", publicName: "iconEnd", isSignal: true, isRequired: false, transformFunction: null }, iconStartTemplate: { classPropertyName: "iconStartTemplate", publicName: "iconStartTemplate", isSignal: true, isRequired: false, transformFunction: null }, iconEndTemplate: { classPropertyName: "iconEndTemplate", publicName: "iconEndTemplate", isSignal: true, isRequired: false, transformFunction: null }, iconStartFn: { classPropertyName: "iconStartFn", publicName: "iconStartFn", isSignal: true, isRequired: false, transformFunction: null }, iconEndFn: { classPropertyName: "iconEndFn", publicName: "iconEndFn", isSignal: true, isRequired: false, transformFunction: null }, iconStartLabel: { classPropertyName: "iconStartLabel", publicName: "iconStartLabel", isSignal: true, isRequired: false, transformFunction: null }, iconEndLabel: { classPropertyName: "iconEndLabel", publicName: "iconEndLabel", isSignal: true, isRequired: false, transformFunction: null }, showPasswordLabel: { classPropertyName: "showPasswordLabel", publicName: "showPasswordLabel", isSignal: true, isRequired: false, transformFunction: null }, hidePasswordLabel: { classPropertyName: "hidePasswordLabel", publicName: "hidePasswordLabel", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelShowPlaceholder: { classPropertyName: "floatLabelShowPlaceholder", publicName: "floatLabelShowPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.gog-host--auto-width": "!fullWidth()" } }, queries: [{ propertyName: "addonStart", first: true, predicate: GogInputAddonStartDirective, descendants: true, isSignal: true }, { propertyName: "addonEnd", first: true, predicate: GogInputAddonEndDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--icon-start]=\"hasIconStart()\"\r\n [class.gog-input-wrapper--icon-end]=\"hasIconEnd() || hasSpinButtons()\"\r\n [class.gog-input-wrapper--spin-clear]=\"hasSpinAndClear()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"resolvedInputId()\">{{ label() }}</label>\r\n }\r\n <div class=\"gog-input__field-container\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"resolvedInputId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n @if (addonStart()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonStart]\" />\r\n </span>\r\n } @else if (hasIconStart()) {\r\n @if (hasIconStartAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__icon--action\"\r\n [attr.aria-label]=\"iconStartLabel() || null\"\r\n (click)=\"onIconStartClick()\"\r\n >\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n <input\r\n class=\"gog-input__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-input__field--spin-hidden]=\"isNumberField()\"\r\n [attr.id]=\"resolvedInputId()\"\r\n [type]=\"effectiveType()\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n [autocomplete]=\"effectiveAutocomplete()\"\r\n [attr.min]=\"min()\"\r\n [attr.max]=\"max()\"\r\n [attr.step]=\"step()\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.pattern]=\"pattern() || null\"\r\n [attr.inputmode]=\"inputMode()\"\r\n [attr.spellcheck]=\"spellcheck()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <!--\r\n A password field's built-in show/hide toggle owns the end slot: it is the only control\r\n that reveals the value, so a projected addon must not be able to displace it.\r\n -->\r\n @if (hasSpinButtons()) {\r\n <span class=\"gog-input__spin\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--up\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"resolvedIncrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMax()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(1)\"\r\n >\r\n <gog-icon name=\"chevron-up\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--down\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"resolvedDecrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMin()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(-1)\"\r\n >\r\n <gog-icon name=\"chevron-down\" />\r\n </button>\r\n </span>\r\n }\r\n <!--\r\n The clear button sits outside the stepper's `@if` rather than in an `@else` branch: on a\r\n number field the two have to coexist, and the stepper owns the field's right edge while\r\n the clear button shifts left of it (`--spin-clear` on the wrapper widens the gutter). It\r\n still outranks a projected addon or a decorative end icon \u2014 those share one slot with it\r\n and only get it when there is nothing to clear.\r\n -->\r\n @if (showClear() && !isPasswordField()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action gog-input__clear\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n } @else if (!hasSpinButtons()) {\r\n @if (addonEnd() && !isPasswordField()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonEnd]\" />\r\n </span>\r\n } @else if (hasIconEnd()) {\r\n @if (hasIconEndAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action\"\r\n [attr.aria-label]=\"effectiveIconEndLabel() || null\"\r\n (click)=\"onIconEndClick()\"\r\n >\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span class=\"gog-input__error\" [attr.id]=\"errorId()\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field-container{position:relative;display:flex;align-items:center}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size);--gog-input-size-icon-offset: var(--gog-field-xsm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-xsm-icon-inset)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size);--gog-input-size-icon-offset: var(--gog-field-sm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-sm-icon-inset)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size);--gog-input-size-icon-offset: var(--gog-field-lg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-lg-icon-inset)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size);--gog-input-size-icon-offset: var(--gog-field-slg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-slg-icon-inset)}.gog-input-wrapper--icon-start .gog-input__field-container{--gog-input-pl: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input-wrapper--icon-end .gog-input__field-container{--gog-input-pr: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input-wrapper--spin-clear .gog-input__field-container{--gog-input-pr: calc( var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset)) + var(--gog-input-spin-width) )}.gog-input-wrapper--spin-clear .gog-input__clear{right:calc(var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset)) + var(--gog-input-spin-width))}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__icon{position:absolute;color:var(--gog-input-icon-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));pointer-events:none;line-height:1}.gog-input__addon{pointer-events:auto}.gog-input__icon--action{padding:0;background:none;border:none;cursor:pointer;pointer-events:auto;border-radius:var(--gog-input-icon-action-radius);color:var(--gog-input-icon-color);transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__icon--action:hover{color:var(--gog-input-icon-hover-color)}.gog-input__icon--action:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__icon--start{left:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__icon--end{right:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__field--spin-hidden::-webkit-inner-spin-button,.gog-input__field--spin-hidden::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;appearance:none}.gog-input__field--spin-hidden{appearance:textfield;-moz-appearance:textfield}.gog-input__spin{position:absolute;top:0;bottom:0;right:0;display:flex;flex-direction:column;pointer-events:auto;border-inline-start:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn{display:flex;flex:1 1 0;align-items:center;justify-content:center;width:var(--gog-input-spin-width);padding:0;border:none;background:none;color:var(--gog-input-icon-color);line-height:0;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__spin-btn--up{border-start-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width));border-block-end:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn--down{border-end-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width))}.gog-input__spin-btn gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * .7)}.gog-input__spin-btn:hover:not(:disabled){color:var(--gog-input-icon-hover-color);background-color:var(--gog-input-spin-hover-bg)}.gog-input__spin-btn:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:calc(-1 * var(--gog-input-icon-focus-ring-width))}.gog-input__spin-btn:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__label--float{position:absolute;left:var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding);transform:none}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);transform:translateY(0);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5102
5535
|
}
|
|
5103
5536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: InputfieldComponent, decorators: [{
|
|
5104
5537
|
type: Component,
|
|
@@ -5108,14 +5541,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
5108
5541
|
// full-width class: this field is full width by default, so the class only appears
|
|
5109
5542
|
// once a consumer opts *out* of that.
|
|
5110
5543
|
'[class.gog-host--auto-width]': '!fullWidth()',
|
|
5111
|
-
}, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--icon-start]=\"hasIconStart()\"\r\n [class.gog-input-wrapper--icon-end]=\"hasIconEnd() || hasSpinButtons()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"inputId() || null\">{{ label() }}</label>\r\n }\r\n <div class=\"gog-input__field-container\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"inputId() || null\">{{\r\n label()\r\n }}</label>\r\n }\r\n @if (addonStart()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonStart]\" />\r\n </span>\r\n } @else if (hasIconStart()) {\r\n @if (hasIconStartAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__icon--action\"\r\n [attr.aria-label]=\"iconStartLabel() || null\"\r\n (click)=\"onIconStartClick()\"\r\n >\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n <input\r\n class=\"gog-input__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-input__field--spin-hidden]=\"isNumberField()\"\r\n [attr.id]=\"inputId() || null\"\r\n [type]=\"effectiveType()\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [autocomplete]=\"effectiveAutocomplete()\"\r\n [attr.min]=\"min()\"\r\n [attr.max]=\"max()\"\r\n [attr.step]=\"step()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"hasError() && inputId() ? inputId() + '-error' : null\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <!--\r\n A password field's built-in show/hide toggle owns the end slot: it is the only control\r\n that reveals the value, so a projected addon must not be able to displace it.\r\n -->\r\n @if (hasSpinButtons()) {\r\n <span class=\"gog-input__spin\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--up\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"incrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMax()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(1)\"\r\n >\r\n <gog-icon name=\"chevron-up\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--down\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"decrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMin()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(-1)\"\r\n >\r\n <gog-icon name=\"chevron-down\" />\r\n </button>\r\n </span>\r\n } @else if (showClear() && !isPasswordField()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action gog-input__clear\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n } @else if (addonEnd() && !isPasswordField()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonEnd]\" />\r\n </span>\r\n } @else if (hasIconEnd()) {\r\n @if (hasIconEndAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action\"\r\n [attr.aria-label]=\"effectiveIconEndLabel() || null\"\r\n (click)=\"onIconEndClick()\"\r\n >\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span\r\n class=\"gog-input__error\"\r\n [attr.id]=\"inputId() ? inputId() + '-error' : null\"\r\n role=\"alert\"\r\n >{{ visibleError() }}</span\r\n >\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field-container{position:relative;display:flex;align-items:center}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size);--gog-input-size-icon-offset: var(--gog-field-xsm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-xsm-icon-inset)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size);--gog-input-size-icon-offset: var(--gog-field-sm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-sm-icon-inset)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size);--gog-input-size-icon-offset: var(--gog-field-lg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-lg-icon-inset)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size);--gog-input-size-icon-offset: var(--gog-field-slg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-slg-icon-inset)}.gog-input-wrapper--icon-start .gog-input__field-container{--gog-input-pl: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input-wrapper--icon-end .gog-input__field-container{--gog-input-pr: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__icon{position:absolute;color:var(--gog-input-icon-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));pointer-events:none;line-height:1}.gog-input__addon{pointer-events:auto}.gog-input__icon--action{padding:0;background:none;border:none;cursor:pointer;pointer-events:auto;border-radius:var(--gog-input-icon-action-radius);color:var(--gog-input-icon-color);transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__icon--action:hover{color:var(--gog-input-icon-hover-color)}.gog-input__icon--action:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__icon--start{left:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__icon--end{right:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__field--spin-hidden::-webkit-inner-spin-button,.gog-input__field--spin-hidden::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;appearance:none}.gog-input__field--spin-hidden{appearance:textfield;-moz-appearance:textfield}.gog-input__spin{position:absolute;top:0;bottom:0;right:0;display:flex;flex-direction:column;pointer-events:auto;border-inline-start:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn{display:flex;flex:1 1 0;align-items:center;justify-content:center;width:calc(var(--gog-input-size-font-size, var(--gog-field-md-font-size)) * 1.35);padding:0;border:none;background:none;color:var(--gog-input-icon-color);line-height:0;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__spin-btn--up{border-start-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width));border-block-end:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn--down{border-end-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width))}.gog-input__spin-btn gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * .7)}.gog-input__spin-btn:hover:not(:disabled){color:var(--gog-input-icon-hover-color);background-color:var(--gog-input-spin-hover-bg)}.gog-input__spin-btn:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:calc(-1 * var(--gog-input-icon-focus-ring-width))}.gog-input__spin-btn:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__label--float{position:absolute;left:var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding);transform:none}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);transform:translateY(0);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}\n"] }]
|
|
5112
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showSpinButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSpinButtons", required: false }] }], incrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementLabel", required: false }] }], decrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementLabel", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], iconStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStart", required: false }] }], iconEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEnd", required: false }] }], iconStartTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStartTemplate", required: false }] }], iconEndTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEndTemplate", required: false }] }], iconStartFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStartFn", required: false }] }], iconEndFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEndFn", required: false }] }], iconStartLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStartLabel", required: false }] }], iconEndLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEndLabel", required: false }] }], showPasswordLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPasswordLabel", required: false }] }], hidePasswordLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidePasswordLabel", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], floatLabelShowPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelShowPlaceholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], addonStart: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GogInputAddonStartDirective), { isSignal: true }] }], addonEnd: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GogInputAddonEndDirective), { isSignal: true }] }] } });
|
|
5544
|
+
}, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--icon-start]=\"hasIconStart()\"\r\n [class.gog-input-wrapper--icon-end]=\"hasIconEnd() || hasSpinButtons()\"\r\n [class.gog-input-wrapper--spin-clear]=\"hasSpinAndClear()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"resolvedInputId()\">{{ label() }}</label>\r\n }\r\n <div class=\"gog-input__field-container\">\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"resolvedInputId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n @if (addonStart()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonStart]\" />\r\n </span>\r\n } @else if (hasIconStart()) {\r\n @if (hasIconStartAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--start gog-input__icon--action\"\r\n [attr.aria-label]=\"iconStartLabel() || null\"\r\n (click)=\"onIconStartClick()\"\r\n >\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--start\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconStartTemplate()\" [name]=\"iconStart() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n <input\r\n class=\"gog-input__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-input__field--spin-hidden]=\"isNumberField()\"\r\n [attr.id]=\"resolvedInputId()\"\r\n [type]=\"effectiveType()\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n [autocomplete]=\"effectiveAutocomplete()\"\r\n [attr.min]=\"min()\"\r\n [attr.max]=\"max()\"\r\n [attr.step]=\"step()\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.pattern]=\"pattern() || null\"\r\n [attr.inputmode]=\"inputMode()\"\r\n [attr.spellcheck]=\"spellcheck()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <!--\r\n A password field's built-in show/hide toggle owns the end slot: it is the only control\r\n that reveals the value, so a projected addon must not be able to displace it.\r\n -->\r\n @if (hasSpinButtons()) {\r\n <span class=\"gog-input__spin\">\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--up\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"resolvedIncrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMax()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(1)\"\r\n >\r\n <gog-icon name=\"chevron-up\" />\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__spin-btn gog-input__spin-btn--down\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"resolvedDecrementLabel()\"\r\n [disabled]=\"isDisabled() || isAtMin()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"stepValue(-1)\"\r\n >\r\n <gog-icon name=\"chevron-down\" />\r\n </button>\r\n </span>\r\n }\r\n <!--\r\n The clear button sits outside the stepper's `@if` rather than in an `@else` branch: on a\r\n number field the two have to coexist, and the stepper owns the field's right edge while\r\n the clear button shifts left of it (`--spin-clear` on the wrapper widens the gutter). It\r\n still outranks a projected addon or a decorative end icon \u2014 those share one slot with it\r\n and only get it when there is nothing to clear.\r\n -->\r\n @if (showClear() && !isPasswordField()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action gog-input__clear\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n } @else if (!hasSpinButtons()) {\r\n @if (addonEnd() && !isPasswordField()) {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__addon\">\r\n <ng-content select=\"[gogInputAddonEnd]\" />\r\n </span>\r\n } @else if (hasIconEnd()) {\r\n @if (hasIconEndAction()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__icon gog-inline-center gog-input__icon--end gog-input__icon--action\"\r\n [attr.aria-label]=\"effectiveIconEndLabel() || null\"\r\n (click)=\"onIconEndClick()\"\r\n >\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </button>\r\n } @else {\r\n <span class=\"gog-input__icon gog-inline-center gog-input__icon--end\" aria-hidden=\"true\">\r\n <gog-icon [template]=\"iconEndTemplate()\" [name]=\"effectiveIconEnd() || 'check'\" />\r\n </span>\r\n }\r\n }\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span class=\"gog-input__error\" [attr.id]=\"errorId()\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field-container{position:relative;display:flex;align-items:center}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size);--gog-input-size-icon-offset: var(--gog-field-xsm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-xsm-icon-inset)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size);--gog-input-size-icon-offset: var(--gog-field-sm-icon-offset);--gog-input-size-icon-inset: var(--gog-field-sm-icon-inset)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size);--gog-input-size-icon-offset: var(--gog-field-lg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-lg-icon-inset)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size);--gog-input-size-icon-offset: var(--gog-field-slg-icon-offset);--gog-input-size-icon-inset: var(--gog-field-slg-icon-inset)}.gog-input-wrapper--icon-start .gog-input__field-container{--gog-input-pl: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input-wrapper--icon-end .gog-input__field-container{--gog-input-pr: var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset))}.gog-input-wrapper--spin-clear .gog-input__field-container{--gog-input-pr: calc( var(--gog-input-size-icon-inset, var(--gog-field-md-icon-inset)) + var(--gog-input-spin-width) )}.gog-input-wrapper--spin-clear .gog-input__clear{right:calc(var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset)) + var(--gog-input-spin-width))}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__icon{position:absolute;color:var(--gog-input-icon-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));pointer-events:none;line-height:1}.gog-input__addon{pointer-events:auto}.gog-input__icon--action{padding:0;background:none;border:none;cursor:pointer;pointer-events:auto;border-radius:var(--gog-input-icon-action-radius);color:var(--gog-input-icon-color);transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__icon--action:hover{color:var(--gog-input-icon-hover-color)}.gog-input__icon--action:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__icon--start{left:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__icon--end{right:var(--gog-input-size-icon-offset, var(--gog-field-md-icon-offset))}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__field--spin-hidden::-webkit-inner-spin-button,.gog-input__field--spin-hidden::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;appearance:none}.gog-input__field--spin-hidden{appearance:textfield;-moz-appearance:textfield}.gog-input__spin{position:absolute;top:0;bottom:0;right:0;display:flex;flex-direction:column;pointer-events:auto;border-inline-start:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn{display:flex;flex:1 1 0;align-items:center;justify-content:center;width:var(--gog-input-spin-width);padding:0;border:none;background:none;color:var(--gog-input-icon-color);line-height:0;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input__spin-btn--up{border-start-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width));border-block-end:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border)}.gog-input__spin-btn--down{border-end-end-radius:calc(var(--gog-input-radius) - var(--gog-input-field-border-width))}.gog-input__spin-btn gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * .7)}.gog-input__spin-btn:hover:not(:disabled){color:var(--gog-input-icon-hover-color);background-color:var(--gog-input-spin-hover-bg)}.gog-input__spin-btn:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:calc(-1 * var(--gog-input-icon-focus-ring-width))}.gog-input__spin-btn:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed}.gog-input__label--float{position:absolute;left:var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - var(--gog-input-pr, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding);transform:none}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);transform:translateY(0);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-pl, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}\n"] }]
|
|
5545
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], minlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minlength", required: false }] }], pattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "pattern", required: false }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputMode", required: false }] }], spellcheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "spellcheck", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showSpinButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSpinButtons", required: false }] }], incrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementLabel", required: false }] }], decrementLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementLabel", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], iconStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStart", required: false }] }], iconEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEnd", required: false }] }], iconStartTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStartTemplate", required: false }] }], iconEndTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEndTemplate", required: false }] }], iconStartFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStartFn", required: false }] }], iconEndFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEndFn", required: false }] }], iconStartLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconStartLabel", required: false }] }], iconEndLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconEndLabel", required: false }] }], showPasswordLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPasswordLabel", required: false }] }], hidePasswordLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidePasswordLabel", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], floatLabelShowPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelShowPlaceholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], addonStart: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GogInputAddonStartDirective), { isSignal: true }] }], addonEnd: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GogInputAddonEndDirective), { isSignal: true }] }] } });
|
|
5113
5546
|
|
|
5114
5547
|
/** Built-in defaults, used when neither the instance input nor `GOG_CONFIG` supplies one. */
|
|
5115
5548
|
const DEFAULT_SIZE = 'md';
|
|
5116
5549
|
const DEFAULT_ERROR_DISPLAY$1 = 'manual';
|
|
5117
5550
|
/** Matches the native `<textarea>`'s own out-of-the-box behaviour. */
|
|
5118
5551
|
const DEFAULT_RESIZE = 'vertical';
|
|
5552
|
+
const DEFAULT_CLEAR_LABEL = 'Clear';
|
|
5119
5553
|
class TextareaComponent {
|
|
5120
5554
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
5121
5555
|
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
@@ -5126,12 +5560,27 @@ class TextareaComponent {
|
|
|
5126
5560
|
*/
|
|
5127
5561
|
errorDisplay = input(undefined, ...(ngDevMode ? [{ debugName: "errorDisplay" }] : /* istanbul ignore next */ []));
|
|
5128
5562
|
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
5563
|
+
/**
|
|
5564
|
+
* The `<textarea>`'s `id`. Left unset, the field generates one — see
|
|
5565
|
+
* `gog-inputfield`'s own `inputId` for why that is the default rather than an opt-in.
|
|
5566
|
+
*/
|
|
5129
5567
|
inputId = input('', ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
5130
5568
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
5569
|
+
/**
|
|
5570
|
+
* Native `readonly` — see `gog-inputfield`'s own `readonly` for how it differs from
|
|
5571
|
+
* `disabled`. Suppresses the clear button while on.
|
|
5572
|
+
*/
|
|
5573
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
5131
5574
|
/** Unset, falls back to `GOG_CONFIG.control.size`, then to `'md'`. */
|
|
5132
5575
|
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
5133
5576
|
/** Native `rows` attribute, controlling the field's initial height. */
|
|
5134
5577
|
rows = input(4, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
5578
|
+
/** Native `maxlength`. Unset (`null`), no limit is applied. */
|
|
5579
|
+
maxlength = input(null, ...(ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []));
|
|
5580
|
+
/** Native `minlength`. Unset (`null`), no minimum is applied. */
|
|
5581
|
+
minlength = input(null, ...(ngDevMode ? [{ debugName: "minlength" }] : /* istanbul ignore next */ []));
|
|
5582
|
+
/** Native `spellcheck`. Unset (`null`), the browser's own default applies. */
|
|
5583
|
+
spellcheck = input(null, ...(ngDevMode ? [{ debugName: "spellcheck" }] : /* istanbul ignore next */ []));
|
|
5135
5584
|
/**
|
|
5136
5585
|
* Which direction(s) the field's own drag handle resizes it in — matches the native CSS
|
|
5137
5586
|
* `resize` value space (`'vertical'`, `'horizontal'`, `'both'`, `'none'`). Unset, falls back
|
|
@@ -5150,8 +5599,8 @@ class TextareaComponent {
|
|
|
5150
5599
|
* `GOG_CONFIG.control.clearable`, then to `false`.
|
|
5151
5600
|
*/
|
|
5152
5601
|
clearable = input(undefined, ...(ngDevMode ? [{ debugName: "clearable" }] : /* istanbul ignore next */ []));
|
|
5153
|
-
/** Accessible name for the clear button. */
|
|
5154
|
-
clearAriaLabel = input(
|
|
5602
|
+
/** Accessible name for the clear button. Unset, falls back to `GOG_CONFIG.labels.clear`. */
|
|
5603
|
+
clearAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
|
|
5155
5604
|
/** Unset, falls back to `GOG_CONFIG.floatLabel.variant`, then to `'none'` (off). */
|
|
5156
5605
|
floatLabel = input(undefined, ...(ngDevMode ? [{ debugName: "floatLabel" }] : /* istanbul ignore next */ []));
|
|
5157
5606
|
/** Unset, falls back to `GOG_CONFIG.floatLabel.showPlaceholder`, then to `false`. */
|
|
@@ -5194,12 +5643,22 @@ class TextareaComponent {
|
|
|
5194
5643
|
*/
|
|
5195
5644
|
sizeClass = computed(() => this.resolvedSize() === 'md' ? '' : `gog-input-wrapper--${this.resolvedSize()}`, ...(ngDevMode ? [{ debugName: "sizeClass" }] : /* istanbul ignore next */ []));
|
|
5196
5645
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
5646
|
+
/** Disabled and read-only both refuse edits — see `gog-inputfield`. */
|
|
5647
|
+
isNotEditable = computed(() => this.isDisabled() || this.readonly(), ...(ngDevMode ? [{ debugName: "isNotEditable" }] : /* istanbul ignore next */ []));
|
|
5648
|
+
/** Instance input → `GOG_CONFIG.labels` → the built-in English default. */
|
|
5649
|
+
resolvedClearLabel = computed(() => resolveConfigured(this.clearAriaLabel(), this.globalConfig.labels?.clear, DEFAULT_CLEAR_LABEL), ...(ngDevMode ? [{ debugName: "resolvedClearLabel" }] : /* istanbul ignore next */ []));
|
|
5197
5650
|
hasError = this.errorState.hasError;
|
|
5198
5651
|
visibleError = this.errorState.visibleError;
|
|
5652
|
+
/** Fallback id, generated once per instance — see `resolvedInputId`. */
|
|
5653
|
+
autoId = nextGogControlId('gog-textarea');
|
|
5654
|
+
/** The consumer's `inputId` when given, otherwise the generated one. Never empty. */
|
|
5655
|
+
resolvedInputId = computed(() => this.inputId() || this.autoId, ...(ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []));
|
|
5656
|
+
/** Non-null only while the error element is actually rendered — see `gog-inputfield`. */
|
|
5657
|
+
errorId = computed(() => this.visibleError() ? `${this.resolvedInputId()}-error` : null, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
5199
5658
|
floatLabelState = new GogFloatLabelState(this.floatLabel, this.floatLabelShowPlaceholder, this.placeholder, this.isFocused,
|
|
5200
5659
|
// "Has content" for a textarea is simply a non-empty value.
|
|
5201
5660
|
computed(() => this.value() !== ''), this.globalConfig);
|
|
5202
|
-
clearableState = new GogClearableState(this.clearable, computed(() => this.value() !== ''), this.
|
|
5661
|
+
clearableState = new GogClearableState(this.clearable, computed(() => this.value() !== ''), this.isNotEditable, this.globalConfig, () => false);
|
|
5203
5662
|
/** Whether to render the clear button right now — see `GogClearableState`. */
|
|
5204
5663
|
showClear = this.clearableState.isVisible;
|
|
5205
5664
|
resolvedFloatLabel = this.floatLabelState.variant;
|
|
@@ -5279,7 +5738,7 @@ class TextareaComponent {
|
|
|
5279
5738
|
this._onTouched();
|
|
5280
5739
|
}
|
|
5281
5740
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5282
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TextareaComponent, isStandalone: true, selector: "gog-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelShowPlaceholder: { classPropertyName: "floatLabelShowPlaceholder", publicName: "floatLabelShowPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.gog-host--auto-width": "!fullWidth()" } }, viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"inputId() || null\">{{ label() }}</label>\r\n }\r\n <div\r\n class=\"gog-input__field-container\"\r\n [class.gog-input__field-container--resizable]=\"resolvedResize() !== 'none' && !isDisabled()\"\r\n [style.--gog-textarea-resize-inset-right.px]=\"resizeInsetRight()\"\r\n [style.--gog-textarea-resize-inset-bottom.px]=\"resizeInsetBottom()\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"inputId() || null\">{{\r\n label()\r\n }}</label>\r\n }\r\n <textarea\r\n #field\r\n class=\"gog-input__field gog-textarea__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-textarea__field--resize-vertical]=\"resolvedResize() === 'vertical'\"\r\n [class.gog-textarea__field--resize-horizontal]=\"resolvedResize() === 'horizontal'\"\r\n [class.gog-textarea__field--resize-both]=\"resolvedResize() === 'both'\"\r\n [class.gog-textarea__field--resize-none]=\"resolvedResize() === 'none'\"\r\n [attr.id]=\"inputId() || null\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [rows]=\"rows()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"hasError() && inputId() ? inputId() + '-error' : null\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n ></textarea>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__clear gog-textarea__clear gog-inline-center\"\r\n [style.--gog-textarea-scrollbar-width.px]=\"scrollbarWidth()\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span\r\n class=\"gog-input__error\"\r\n [attr.id]=\"inputId() ? inputId() + '-error' : null\"\r\n role=\"alert\"\r\n >{{ visibleError() }}</span\r\n >\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__field{display:block;min-height:2.5em;line-height:1.5}.gog-textarea__field::-webkit-resizer{background:transparent}.gog-textarea__field--resize-vertical{resize:vertical}.gog-textarea__field--resize-horizontal{resize:horizontal}.gog-textarea__field--resize-both{resize:both}.gog-textarea__field--resize-none{resize:none}.gog-input__field-container{position:relative}.gog-input__field-container--resizable:after{content:\"\";position:absolute;right:calc(3px + var(--gog-textarea-resize-inset-right, 0px));bottom:calc(3px + var(--gog-textarea-resize-inset-bottom, 0px));width:var(--gog-textarea-resize-grip-size);height:var(--gog-textarea-resize-grip-size);clip-path:polygon(100% 0,100% 100%,0 100%);background-image:repeating-linear-gradient(135deg,transparent 0 var(--gog-textarea-resize-grip-stripe-gap),var(--gog-textarea-resize-grip-color) var(--gog-textarea-resize-grip-stripe-gap) calc(var(--gog-textarea-resize-grip-stripe-gap) + var(--gog-textarea-resize-grip-stripe-width)));opacity:var(--gog-textarea-resize-grip-opacity);pointer-events:none}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size)}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed;resize:none}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__label--float{position:absolute;left:var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y)));max-width:calc(100% - 2 * var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}.gog-textarea__clear{position:absolute;top:var(--gog-input-clear-inset);right:calc(var(--gog-input-clear-inset) + var(--gog-textarea-scrollbar-width, 0px));width:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-input-clear-radius);background:transparent;color:var(--gog-input-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__clear:hover{color:var(--gog-input-icon-hover-color)}.gog-textarea__clear:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-textarea__clear gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * var(--gog-textarea-clear-icon-ratio))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5741
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TextareaComponent, isStandalone: true, selector: "gog-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, spellcheck: { classPropertyName: "spellcheck", publicName: "spellcheck", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, floatLabelShowPlaceholder: { classPropertyName: "floatLabelShowPlaceholder", publicName: "floatLabelShowPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.gog-host--auto-width": "!fullWidth()" } }, viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"resolvedInputId()\">{{ label() }}</label>\r\n }\r\n <div\r\n class=\"gog-input__field-container\"\r\n [class.gog-input__field-container--resizable]=\"resolvedResize() !== 'none' && !isDisabled()\"\r\n [style.--gog-textarea-resize-inset-right.px]=\"resizeInsetRight()\"\r\n [style.--gog-textarea-resize-inset-bottom.px]=\"resizeInsetBottom()\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"resolvedInputId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <textarea\r\n #field\r\n class=\"gog-input__field gog-textarea__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-textarea__field--resize-vertical]=\"resolvedResize() === 'vertical'\"\r\n [class.gog-textarea__field--resize-horizontal]=\"resolvedResize() === 'horizontal'\"\r\n [class.gog-textarea__field--resize-both]=\"resolvedResize() === 'both'\"\r\n [class.gog-textarea__field--resize-none]=\"resolvedResize() === 'none'\"\r\n [attr.id]=\"resolvedInputId()\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [rows]=\"rows()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.spellcheck]=\"spellcheck()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n ></textarea>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__clear gog-textarea__clear gog-inline-center\"\r\n [style.--gog-textarea-scrollbar-width.px]=\"scrollbarWidth()\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span class=\"gog-input__error\" [attr.id]=\"errorId()\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__field{display:block;min-height:2.5em;line-height:1.5}.gog-textarea__field::-webkit-resizer{background:transparent}.gog-textarea__field--resize-vertical{resize:vertical}.gog-textarea__field--resize-horizontal{resize:horizontal}.gog-textarea__field--resize-both{resize:both}.gog-textarea__field--resize-none{resize:none}.gog-input__field-container{position:relative}.gog-input__field-container--resizable:after{content:\"\";position:absolute;right:calc(var(--gog-textarea-resize-grip-offset) + var(--gog-textarea-resize-inset-right));bottom:calc(var(--gog-textarea-resize-grip-offset) + var(--gog-textarea-resize-inset-bottom));width:var(--gog-textarea-resize-grip-size);height:var(--gog-textarea-resize-grip-size);clip-path:polygon(100% 0,100% 100%,0 100%);background-image:repeating-linear-gradient(135deg,transparent 0 var(--gog-textarea-resize-grip-stripe-gap),var(--gog-textarea-resize-grip-color) var(--gog-textarea-resize-grip-stripe-gap) calc(var(--gog-textarea-resize-grip-stripe-gap) + var(--gog-textarea-resize-grip-stripe-width)));opacity:var(--gog-textarea-resize-grip-opacity);pointer-events:none}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size)}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed;resize:none}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__label--float{position:absolute;left:var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y)));max-width:calc(100% - 2 * var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}.gog-textarea__clear{position:absolute;top:var(--gog-input-clear-inset);right:calc(var(--gog-input-clear-inset) + var(--gog-textarea-scrollbar-width, 0px));width:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-input-clear-radius);background:transparent;color:var(--gog-input-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__clear:hover{color:var(--gog-input-icon-hover-color)}.gog-textarea__clear:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-textarea__clear gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * var(--gog-textarea-clear-icon-ratio))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5283
5742
|
}
|
|
5284
5743
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
5285
5744
|
type: Component,
|
|
@@ -5289,8 +5748,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
5289
5748
|
// full-width class: this field is full width by default, so the class only appears
|
|
5290
5749
|
// once a consumer opts *out* of that.
|
|
5291
5750
|
'[class.gog-host--auto-width]': '!fullWidth()',
|
|
5292
|
-
}, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"inputId() || null\">{{ label() }}</label>\r\n }\r\n <div\r\n class=\"gog-input__field-container\"\r\n [class.gog-input__field-container--resizable]=\"resolvedResize() !== 'none' && !isDisabled()\"\r\n [style.--gog-textarea-resize-inset-right.px]=\"resizeInsetRight()\"\r\n [style.--gog-textarea-resize-inset-bottom.px]=\"resizeInsetBottom()\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"inputId() || null\">{{\r\n label()\r\n }}</label>\r\n }\r\n <textarea\r\n #field\r\n class=\"gog-input__field gog-textarea__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-textarea__field--resize-vertical]=\"resolvedResize() === 'vertical'\"\r\n [class.gog-textarea__field--resize-horizontal]=\"resolvedResize() === 'horizontal'\"\r\n [class.gog-textarea__field--resize-both]=\"resolvedResize() === 'both'\"\r\n [class.gog-textarea__field--resize-none]=\"resolvedResize() === 'none'\"\r\n [attr.id]=\"inputId() || null\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [rows]=\"rows()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"hasError() && inputId() ? inputId() + '-error' : null\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n ></textarea>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__clear gog-textarea__clear gog-inline-center\"\r\n [style.--gog-textarea-scrollbar-width.px]=\"scrollbarWidth()\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span\r\n class=\"gog-input__error\"\r\n [attr.id]=\"inputId() ? inputId() + '-error' : null\"\r\n role=\"alert\"\r\n >{{ visibleError() }}</span\r\n >\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__field{display:block;min-height:2.5em;line-height:1.5}.gog-textarea__field::-webkit-resizer{background:transparent}.gog-textarea__field--resize-vertical{resize:vertical}.gog-textarea__field--resize-horizontal{resize:horizontal}.gog-textarea__field--resize-both{resize:both}.gog-textarea__field--resize-none{resize:none}.gog-input__field-container{position:relative}.gog-input__field-container--resizable:after{content:\"\";position:absolute;right:calc(3px + var(--gog-textarea-resize-inset-right, 0px));bottom:calc(3px + var(--gog-textarea-resize-inset-bottom, 0px));width:var(--gog-textarea-resize-grip-size);height:var(--gog-textarea-resize-grip-size);clip-path:polygon(100% 0,100% 100%,0 100%);background-image:repeating-linear-gradient(135deg,transparent 0 var(--gog-textarea-resize-grip-stripe-gap),var(--gog-textarea-resize-grip-color) var(--gog-textarea-resize-grip-stripe-gap) calc(var(--gog-textarea-resize-grip-stripe-gap) + var(--gog-textarea-resize-grip-stripe-width)));opacity:var(--gog-textarea-resize-grip-opacity);pointer-events:none}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size)}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed;resize:none}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__label--float{position:absolute;left:var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y)));max-width:calc(100% - 2 * var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}.gog-textarea__clear{position:absolute;top:var(--gog-input-clear-inset);right:calc(var(--gog-input-clear-inset) + var(--gog-textarea-scrollbar-width, 0px));width:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-input-clear-radius);background:transparent;color:var(--gog-input-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__clear:hover{color:var(--gog-input-icon-hover-color)}.gog-textarea__clear:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-textarea__clear gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * var(--gog-textarea-clear-icon-ratio))}\n"] }]
|
|
5293
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], floatLabelShowPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelShowPlaceholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], fieldRef: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|
|
5751
|
+
}, template: "<div\r\n class=\"gog-input-wrapper gog-contained-layout\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-input-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-input-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-input-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-input-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <label class=\"gog-input__label\" [attr.for]=\"resolvedInputId()\">{{ label() }}</label>\r\n }\r\n <div\r\n class=\"gog-input__field-container\"\r\n [class.gog-input__field-container--resizable]=\"resolvedResize() !== 'none' && !isDisabled()\"\r\n [style.--gog-textarea-resize-inset-right.px]=\"resizeInsetRight()\"\r\n [style.--gog-textarea-resize-inset-bottom.px]=\"resizeInsetBottom()\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <label class=\"gog-input__label gog-input__label--float\" [attr.for]=\"resolvedInputId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <textarea\r\n #field\r\n class=\"gog-input__field gog-textarea__field\"\r\n [class.gog-input__field--error]=\"hasError()\"\r\n [class.gog-textarea__field--resize-vertical]=\"resolvedResize() === 'vertical'\"\r\n [class.gog-textarea__field--resize-horizontal]=\"resolvedResize() === 'horizontal'\"\r\n [class.gog-textarea__field--resize-both]=\"resolvedResize() === 'both'\"\r\n [class.gog-textarea__field--resize-none]=\"resolvedResize() === 'none'\"\r\n [attr.id]=\"resolvedInputId()\"\r\n [attr.name]=\"name() || null\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [rows]=\"rows()\"\r\n [value]=\"value()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"readonly()\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.spellcheck]=\"spellcheck()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n ></textarea>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-input__clear gog-textarea__clear gog-inline-center\"\r\n [style.--gog-textarea-scrollbar-width.px]=\"scrollbarWidth()\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n </div>\r\n @if (visibleError()) {\r\n <span class=\"gog-input__error\" [attr.id]=\"errorId()\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-input-wrapper{display:flex;flex-direction:column;gap:var(--gog-input-gap);width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-input-wrapper{width:fit-content}.gog-input__label{font-family:var(--gog-input-label-font-family);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input__field{width:100%;padding:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));font-family:var(--gog-input-font-family);font-size:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-input-field-color);background-color:var(--gog-input-field-bg);border:var(--gog-input-field-border-width) var(--gog-input-field-border-style) var(--gog-input-field-border);border-radius:var(--gog-input-radius);outline:none;transition:border-color var(--gog-input-transition-duration) var(--gog-easing),box-shadow var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__field{display:block;min-height:2.5em;line-height:1.5}.gog-textarea__field::-webkit-resizer{background:transparent}.gog-textarea__field--resize-vertical{resize:vertical}.gog-textarea__field--resize-horizontal{resize:horizontal}.gog-textarea__field--resize-both{resize:both}.gog-textarea__field--resize-none{resize:none}.gog-input__field-container{position:relative}.gog-input__field-container--resizable:after{content:\"\";position:absolute;right:calc(var(--gog-textarea-resize-grip-offset) + var(--gog-textarea-resize-inset-right));bottom:calc(var(--gog-textarea-resize-grip-offset) + var(--gog-textarea-resize-inset-bottom));width:var(--gog-textarea-resize-grip-size);height:var(--gog-textarea-resize-grip-size);clip-path:polygon(100% 0,100% 100%,0 100%);background-image:repeating-linear-gradient(135deg,transparent 0 var(--gog-textarea-resize-grip-stripe-gap),var(--gog-textarea-resize-grip-color) var(--gog-textarea-resize-grip-stripe-gap) calc(var(--gog-textarea-resize-grip-stripe-gap) + var(--gog-textarea-resize-grip-stripe-width)));opacity:var(--gog-textarea-resize-grip-opacity);pointer-events:none}.gog-input-wrapper--xsm{--gog-input-size-padding-y: var(--gog-field-xsm-padding-y);--gog-input-size-padding-x: var(--gog-field-xsm-padding-x);--gog-input-size-font-size: var(--gog-field-xsm-font-size)}.gog-input-wrapper--sm{--gog-input-size-padding-y: var(--gog-field-sm-padding-y);--gog-input-size-padding-x: var(--gog-field-sm-padding-x);--gog-input-size-font-size: var(--gog-field-sm-font-size)}.gog-input-wrapper--lg{--gog-input-size-padding-y: var(--gog-field-lg-padding-y);--gog-input-size-padding-x: var(--gog-field-lg-padding-x);--gog-input-size-font-size: var(--gog-field-lg-font-size)}.gog-input-wrapper--slg{--gog-input-size-padding-y: var(--gog-field-slg-padding-y);--gog-input-size-padding-x: var(--gog-field-slg-padding-x);--gog-input-size-font-size: var(--gog-field-slg-font-size)}.gog-input__field::placeholder{color:var(--gog-input-placeholder-color)}.gog-input__field:focus{border-color:var(--gog-input-focus-border);box-shadow:var(--gog-input-focus-glow)}.gog-input__field:focus-visible{outline:var(--gog-input-focus-ring-width) solid var(--gog-input-focus-border);outline-offset:var(--gog-input-focus-ring-offset)}.gog-input__field:disabled{opacity:var(--gog-input-disabled-opacity);cursor:not-allowed;resize:none}.gog-input__field--error{border-color:var(--gog-input-error-color)}.gog-input__error{font-family:var(--gog-input-font-family);font-size:var(--gog-input-error-font-size);color:var(--gog-input-error-color);margin-top:var(--gog-input-error-offset)}.gog-input__label--float{position:absolute;left:var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x)));top:var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y)));max-width:calc(100% - 2 * var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--gog-input-placeholder-color);font-size:var(--gog-input-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-input-transition-duration) var(--gog-easing),font-size var(--gog-input-transition-duration) var(--gog-easing),color var(--gog-input-transition-duration) var(--gog-easing),top var(--gog-input-transition-duration) var(--gog-easing),background-color var(--gog-input-transition-duration) var(--gog-easing)}.gog-input-wrapper--float-in,.gog-input-wrapper--float-on{--gog-input-float-top-padding: calc(var(--gog-input-padding-y, var(--gog-input-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-input-float-label-reserve))}.gog-input-wrapper--float-in .gog-input__field,.gog-input-wrapper--float-on .gog-input__field{padding-top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in .gog-input__label--float,.gog-input-wrapper--float-on .gog-input__label--float{top:var(--gog-input-float-top-padding)}.gog-input-wrapper--float-in.gog-input-wrapper--floated .gog-input__label--float{top:var(--gog-input-float-label-in-top);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-on.gog-input-wrapper--floated .gog-input__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing);background-color:var(--gog-input-float-label-on-bg, var(--gog-input-field-bg));padding:0 4px;left:calc(var(--gog-input-padding-x, var(--gog-input-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-input-wrapper--float-over.gog-input-wrapper--floated .gog-input__label--float{top:calc(-1 * var(--gog-input-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-input-label-font-size);color:var(--gog-input-label-color);text-transform:var(--gog-input-label-text-transform);letter-spacing:var(--gog-input-label-letter-spacing)}.gog-input-wrapper--float-over .gog-input__field-container{margin-top:var(--gog-input-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-input__field,.gog-input__label--float{transition:none}}.gog-textarea__clear{position:absolute;top:var(--gog-input-clear-inset);right:calc(var(--gog-input-clear-inset) + var(--gog-textarea-scrollbar-width, 0px));width:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-input-clear-radius);background:transparent;color:var(--gog-input-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-input-transition-duration) var(--gog-easing)}.gog-textarea__clear:hover{color:var(--gog-input-icon-hover-color)}.gog-textarea__clear:focus-visible{outline:var(--gog-input-icon-focus-ring-width) solid var(--gog-input-icon-hover-color);outline-offset:var(--gog-input-focus-ring-offset)}.gog-textarea__clear gog-icon{font-size:calc(var(--gog-input-font, var(--gog-input-size-font-size, var(--gog-field-md-font-size))) * var(--gog-textarea-clear-icon-ratio))}\n"] }]
|
|
5752
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], minlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minlength", required: false }] }], spellcheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "spellcheck", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], floatLabelShowPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelShowPlaceholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], fieldRef: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|
|
5294
5753
|
|
|
5295
5754
|
class ChipComponent {
|
|
5296
5755
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -5440,14 +5899,14 @@ class SelectComponent extends GogDropdownBase {
|
|
|
5440
5899
|
this.close();
|
|
5441
5900
|
}
|
|
5442
5901
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5443
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SelectComponent, isStandalone: true, selector: "gog-select", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "style.--gog-select-min-width": "minWidth()" } }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-select\"\r\n [class.gog-select--clearable]=\"showClear()\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-select--disabled]=\"isDisabled()\"\r\n [class.gog-select--open]=\"isOpen()\"\r\n [class.gog-select--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-select--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-select--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-select--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a <button>, which is\r\n not a labelable element, so `for` pointing at it is silently ignored by browsers and\r\n assistive tech alike.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-select__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label gog-select__label--float\" [id]=\"labelId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__control\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"'listbox'\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n <span class=\"gog-select__value\" [class.gog-select__value--placeholder]=\"!selectedOption()\">\r\n {{ selectedLabel() || effectivePlaceholder() }}\r\n </span>\r\n\r\n <span class=\"gog-select__chevron\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n name=\"chevron-down\"\r\n />\r\n </span>\r\n </button>\r\n\r\n <!--\r\n A sibling of the trigger, not a child: `.gog-select__control` is a <button>, and nesting\r\n one button inside another is invalid HTML. It is positioned over the trigger's right edge\r\n by the stylesheet, which also reserves room for it so it never covers the value text.\r\n -->\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__clear gog-inline-center\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-select__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-select--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-select__dropdown\"\r\n [class.gog-select__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-select__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-select__filter gog-select__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-select__scroll\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-select__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern expects:\r\n focus is moved between options with the arrow keys, not by tabbing through every\r\n one of them. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-select__option--selected]=\"isSelected(option)\"\r\n [class.gog-select__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"selectOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-select__option-mark\" aria-hidden=\"true\">\r\n @if (isSelected(option)) {\r\n <gog-icon name=\"check\" />\r\n }\r\n </span>\r\n <span class=\"gog-select__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </button>\r\n }\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-select__filter gog-select__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:fit-content}.gog-select{display:flex;flex-direction:column;gap:var(--gog-select-gap);width:100%}.gog-select--xsm,.gog-select__dropdown--xsm{--gog-select-size-padding-y: var(--gog-field-xsm-padding-y);--gog-select-size-padding-x: var(--gog-field-xsm-padding-x);--gog-select-size-font-size: var(--gog-field-xsm-font-size)}.gog-select--sm,.gog-select__dropdown--sm{--gog-select-size-padding-y: var(--gog-field-sm-padding-y);--gog-select-size-padding-x: var(--gog-field-sm-padding-x);--gog-select-size-font-size: var(--gog-field-sm-font-size)}.gog-select--lg,.gog-select__dropdown--lg{--gog-select-size-padding-y: var(--gog-field-lg-padding-y);--gog-select-size-padding-x: var(--gog-field-lg-padding-x);--gog-select-size-font-size: var(--gog-field-lg-font-size)}.gog-select--slg,.gog-select__dropdown--slg{--gog-select-size-padding-y: var(--gog-field-slg-padding-y);--gog-select-size-padding-x: var(--gog-field-slg-padding-x);--gog-select-size-font-size: var(--gog-field-slg-font-size)}.gog-select--disabled{opacity:var(--gog-select-disabled-opacity)}.gog-select--disabled .gog-select__label,.gog-select--disabled .gog-select__field{cursor:not-allowed}.gog-select__label{font-family:var(--gog-select-label-font-family);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);cursor:pointer}.gog-select__field{position:relative;cursor:pointer}.gog-select__control{width:100%;padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-chevron-inset) var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));display:flex;align-items:center;justify-content:space-between;gap:var(--gog-select-control-gap);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-field-color);background-color:var(--gog-select-field-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);outline:none;cursor:pointer;transition:border-color var(--gog-select-transition-duration) var(--gog-easing),box-shadow var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__control:focus{border-color:var(--gog-select-focus-border);box-shadow:var(--gog-select-focus-glow)}.gog-select__control:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__control:disabled{cursor:not-allowed}.gog-select--open .gog-select__control{border-color:var(--gog-select-focus-border)}.gog-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.gog-select__value--placeholder{color:var(--gog-select-placeholder-color)}.gog-select__chevron{width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));display:flex;align-items:center;justify-content:center;color:var(--gog-select-chevron-color);pointer-events:none;flex-shrink:0}.gog-select__chevron gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-chevron-icon-ratio))}.gog-select__dropdown{position:absolute;top:calc(100% + var(--gog-select-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-select-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-select-panel-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);max-height:var(--gog-select-panel-max-height);overflow:hidden;box-shadow:var(--gog-select-panel-shadow)}.gog-select__scroll{flex:1;min-height:0}.gog-select__dropdown--up{top:auto;bottom:calc(100% + var(--gog-select-panel-offset))}.gog-select__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-select__option{width:100%;display:flex;align-items:center;gap:var(--gog-select-option-gap);padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-option-color);cursor:pointer;transition:background-color var(--gog-select-option-transition-duration) var(--gog-easing)}.gog-select__option:hover{background-color:var(--gog-select-option-hover-bg)}.gog-select__option--selected{color:var(--gog-select-option-selected-color)}.gog-select__option--disabled{opacity:var(--gog-select-option-disabled-opacity);cursor:not-allowed}.gog-select__option:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:calc(var(--gog-select-focus-ring-width) * -1)}.gog-select__option-mark{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));height:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));flex-shrink:0}.gog-select__option-mark gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-icon-ratio))}.gog-select__error{font-family:var(--gog-select-font-family);font-size:var(--gog-select-error-font-size);color:var(--gog-select-error-color)}.gog-select__label--float{position:absolute;left:var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-select-placeholder-color);font-size:var(--gog-select-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-select-transition-duration) var(--gog-easing),font-size var(--gog-select-transition-duration) var(--gog-easing),color var(--gog-select-transition-duration) var(--gog-easing),top var(--gog-select-transition-duration) var(--gog-easing),background-color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select--float-in,.gog-select--float-on{--gog-select-float-top-padding: calc(var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-select-float-label-reserve))}.gog-select--float-in .gog-select__control,.gog-select--float-on .gog-select__control{padding-top:var(--gog-select-float-top-padding)}.gog-select--float-in .gog-select__label--float,.gog-select--float-on .gog-select__label--float{top:var(--gog-select-float-top-padding);transform:none}.gog-select--float-in.gog-select--floated .gog-select__label--float{top:var(--gog-select-float-label-in-top);transform:translateY(0);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-on.gog-select--floated .gog-select__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);background-color:var(--gog-select-float-label-on-bg, var(--gog-select-field-bg));padding:0 4px;left:calc(var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-select--float-over.gog-select--floated .gog-select__label--float{top:calc(-1 * var(--gog-select-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-over .gog-select__field{margin-top:var(--gog-select-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-select__control,.gog-select__option,.gog-select__label--float{transition:none}}.gog-select__clear{position:absolute;top:50%;right:var(--gog-select-chevron-inset);transform:translateY(-50%);width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-select-clear-radius);background:transparent;color:var(--gog-select-clear-color);line-height:1;cursor:pointer;transition:color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__clear:hover{color:var(--gog-select-clear-hover-color)}.gog-select__clear:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__clear gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-clear-icon-ratio))}.gog-select--clearable .gog-select__control{padding-right:calc(var(--gog-select-chevron-inset) + var(--gog-select-clear-gap) + var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))))}.gog-select__filter{position:sticky;top:0;z-index:1;padding:var(--gog-select-filter-padding);background:var(--gog-select-panel-bg)}.gog-select__filter-input{width:100%;padding:var(--gog-select-filter-input-padding-y) var(--gog-select-filter-input-padding-x);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-input-color);background:var(--gog-select-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-select-filter-input-border);border-radius:var(--gog-select-filter-input-radius);outline:none}.gog-select__filter-input:focus{border-color:var(--gog-select-focus-border)}.gog-select__empty{margin:0;padding:var(--gog-select-filter-empty-padding);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-empty-color);text-align:center}.gog-select__filter--top{border-bottom:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}.gog-select__filter--bottom{top:auto;bottom:0;border-top:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-select__control{min-width:var(--gog-select-min-width)}.gog-select__dropdown--portal{max-width:var(--gog-select-panel-max-width)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5902
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SelectComponent, isStandalone: true, selector: "gog-select", inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "style.--gog-select-min-width": "minWidth()" } }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-select\"\r\n [class.gog-select--clearable]=\"showClear()\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-select--disabled]=\"isDisabled()\"\r\n [class.gog-select--open]=\"isOpen()\"\r\n [class.gog-select--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-select--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-select--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-select--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a <button>, which is\r\n not a labelable element, so `for` pointing at it is silently ignored by browsers and\r\n assistive tech alike.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-select__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label gog-select__label--float\" [id]=\"labelId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__control\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"'listbox'\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n <span class=\"gog-select__value\" [class.gog-select__value--placeholder]=\"!selectedOption()\">\r\n {{ selectedLabel() || effectivePlaceholder() }}\r\n </span>\r\n\r\n <span class=\"gog-select__chevron\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n name=\"chevron-down\"\r\n />\r\n </span>\r\n </button>\r\n\r\n <!--\r\n A sibling of the trigger, not a child: `.gog-select__control` is a <button>, and nesting\r\n one button inside another is invalid HTML. It is positioned over the trigger's right edge\r\n by the stylesheet, which also reserves room for it so it never covers the value text.\r\n -->\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__clear gog-inline-center\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-select__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-select--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-select__dropdown\"\r\n [class.gog-select__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-select__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-select__filter gog-select__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-select__scroll\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-select__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern expects:\r\n focus is moved between options with the arrow keys, not by tabbing through every\r\n one of them. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-select__option--selected]=\"isSelected(option)\"\r\n [class.gog-select__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"selectOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-select__option-mark\" aria-hidden=\"true\">\r\n @if (isSelected(option)) {\r\n <gog-icon name=\"check\" />\r\n }\r\n </span>\r\n <span class=\"gog-select__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </button>\r\n }\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-select__filter gog-select__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:fit-content}.gog-select{display:flex;flex-direction:column;gap:var(--gog-select-gap);width:100%}.gog-select--xsm,.gog-select__dropdown--xsm{--gog-select-size-padding-y: var(--gog-field-xsm-padding-y);--gog-select-size-padding-x: var(--gog-field-xsm-padding-x);--gog-select-size-font-size: var(--gog-field-xsm-font-size)}.gog-select--sm,.gog-select__dropdown--sm{--gog-select-size-padding-y: var(--gog-field-sm-padding-y);--gog-select-size-padding-x: var(--gog-field-sm-padding-x);--gog-select-size-font-size: var(--gog-field-sm-font-size)}.gog-select--lg,.gog-select__dropdown--lg{--gog-select-size-padding-y: var(--gog-field-lg-padding-y);--gog-select-size-padding-x: var(--gog-field-lg-padding-x);--gog-select-size-font-size: var(--gog-field-lg-font-size)}.gog-select--slg,.gog-select__dropdown--slg{--gog-select-size-padding-y: var(--gog-field-slg-padding-y);--gog-select-size-padding-x: var(--gog-field-slg-padding-x);--gog-select-size-font-size: var(--gog-field-slg-font-size)}.gog-select--disabled{opacity:var(--gog-select-disabled-opacity)}.gog-select--disabled .gog-select__label,.gog-select--disabled .gog-select__field{cursor:not-allowed}.gog-select__label{font-family:var(--gog-select-label-font-family);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);cursor:pointer}.gog-select__field{position:relative;cursor:pointer}.gog-select__control{width:100%;padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-chevron-inset) var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));display:flex;align-items:center;justify-content:space-between;gap:var(--gog-select-control-gap);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-field-color);background-color:var(--gog-select-field-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);outline:none;cursor:pointer;transition:border-color var(--gog-select-transition-duration) var(--gog-easing),box-shadow var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__control:focus{border-color:var(--gog-select-focus-border);box-shadow:var(--gog-select-focus-glow)}.gog-select__control:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__control:disabled{cursor:not-allowed}.gog-select--open .gog-select__control{border-color:var(--gog-select-focus-border)}.gog-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.gog-select__value--placeholder{color:var(--gog-select-placeholder-color)}.gog-select__chevron{width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));display:flex;align-items:center;justify-content:center;color:var(--gog-select-chevron-color);pointer-events:none;flex-shrink:0}.gog-select__chevron gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-chevron-icon-ratio))}.gog-select__dropdown{position:absolute;top:calc(100% + var(--gog-select-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-select-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-select-panel-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);max-height:var(--gog-select-panel-max-height);overflow:hidden;box-shadow:var(--gog-select-panel-shadow)}.gog-select__scroll{flex:1;min-height:0}.gog-select__dropdown--up{top:auto;bottom:calc(100% + var(--gog-select-panel-offset))}.gog-select__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-select__option{width:100%;display:flex;align-items:center;gap:var(--gog-select-option-gap);padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-option-color);cursor:pointer;transition:background-color var(--gog-select-option-transition-duration) var(--gog-easing)}.gog-select__option:hover{background-color:var(--gog-select-option-hover-bg)}.gog-select__option--selected{color:var(--gog-select-option-selected-color)}.gog-select__option--disabled{opacity:var(--gog-select-option-disabled-opacity);cursor:not-allowed}.gog-select__option:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:calc(var(--gog-select-focus-ring-width) * -1)}.gog-select__option-mark{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));height:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));flex-shrink:0}.gog-select__option-mark gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-icon-ratio))}.gog-select__error{font-family:var(--gog-select-font-family);font-size:var(--gog-select-error-font-size);color:var(--gog-select-error-color)}.gog-select__label--float{position:absolute;left:var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-select-placeholder-color);font-size:var(--gog-select-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-select-transition-duration) var(--gog-easing),font-size var(--gog-select-transition-duration) var(--gog-easing),color var(--gog-select-transition-duration) var(--gog-easing),top var(--gog-select-transition-duration) var(--gog-easing),background-color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select--float-in,.gog-select--float-on{--gog-select-float-top-padding: calc(var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-select-float-label-reserve))}.gog-select--float-in .gog-select__control,.gog-select--float-on .gog-select__control{padding-top:var(--gog-select-float-top-padding)}.gog-select--float-in .gog-select__label--float,.gog-select--float-on .gog-select__label--float{top:var(--gog-select-float-top-padding);transform:none}.gog-select--float-in.gog-select--floated .gog-select__label--float{top:var(--gog-select-float-label-in-top);transform:translateY(0);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-on.gog-select--floated .gog-select__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);background-color:var(--gog-select-float-label-on-bg, var(--gog-select-field-bg));padding:0 4px;left:calc(var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-select--float-over.gog-select--floated .gog-select__label--float{top:calc(-1 * var(--gog-select-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-over .gog-select__field{margin-top:var(--gog-select-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-select__control,.gog-select__option,.gog-select__label--float{transition:none}}.gog-select__clear{position:absolute;top:50%;right:var(--gog-select-chevron-inset);transform:translateY(-50%);width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-select-clear-radius);background:transparent;color:var(--gog-select-clear-color);line-height:1;cursor:pointer;transition:color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__clear:hover{color:var(--gog-select-clear-hover-color)}.gog-select__clear:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__clear gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-clear-icon-ratio))}.gog-select--clearable .gog-select__control{padding-right:calc(var(--gog-select-chevron-inset) + var(--gog-select-clear-gap) + var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))))}.gog-select__filter{position:sticky;top:0;z-index:1;padding:var(--gog-select-filter-padding);background:var(--gog-select-panel-bg)}.gog-select__filter-input{width:100%;padding:var(--gog-select-filter-input-padding-y) var(--gog-select-filter-input-padding-x);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-input-color);background:var(--gog-select-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-select-filter-input-border);border-radius:var(--gog-select-filter-input-radius);outline:none}.gog-select__filter-input:focus{border-color:var(--gog-select-focus-border)}.gog-select__empty{margin:0;padding:var(--gog-select-filter-empty-padding);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-empty-color);text-align:center}.gog-select__filter--top{border-bottom:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}.gog-select__filter--bottom{top:auto;bottom:0;border-top:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-select__control{min-width:var(--gog-select-min-width)}.gog-select__dropdown--portal{max-width:var(--gog-select-panel-max-width)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5444
5903
|
}
|
|
5445
5904
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SelectComponent, decorators: [{
|
|
5446
5905
|
type: Component,
|
|
5447
5906
|
args: [{ selector: 'gog-select', imports: [IconComponent, NgTemplateOutlet, ScrollComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5448
5907
|
// Only bites when the control has opted out of full width; otherwise the container decides.
|
|
5449
5908
|
'[style.--gog-select-min-width]': 'minWidth()',
|
|
5450
|
-
}, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-select\"\r\n [class.gog-select--clearable]=\"showClear()\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-select--disabled]=\"isDisabled()\"\r\n [class.gog-select--open]=\"isOpen()\"\r\n [class.gog-select--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-select--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-select--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-select--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a <button>, which is\r\n not a labelable element, so `for` pointing at it is silently ignored by browsers and\r\n assistive tech alike.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-select__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label gog-select__label--float\" [id]=\"labelId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__control\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"'listbox'\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n <span class=\"gog-select__value\" [class.gog-select__value--placeholder]=\"!selectedOption()\">\r\n {{ selectedLabel() || effectivePlaceholder() }}\r\n </span>\r\n\r\n <span class=\"gog-select__chevron\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n name=\"chevron-down\"\r\n />\r\n </span>\r\n </button>\r\n\r\n <!--\r\n A sibling of the trigger, not a child: `.gog-select__control` is a <button>, and nesting\r\n one button inside another is invalid HTML. It is positioned over the trigger's right edge\r\n by the stylesheet, which also reserves room for it so it never covers the value text.\r\n -->\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__clear gog-inline-center\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-select__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-select--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-select__dropdown\"\r\n [class.gog-select__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-select__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-select__filter gog-select__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-select__scroll\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-select__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern expects:\r\n focus is moved between options with the arrow keys, not by tabbing through every\r\n one of them. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-select__option--selected]=\"isSelected(option)\"\r\n [class.gog-select__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"selectOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-select__option-mark\" aria-hidden=\"true\">\r\n @if (isSelected(option)) {\r\n <gog-icon name=\"check\" />\r\n }\r\n </span>\r\n <span class=\"gog-select__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </button>\r\n }\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-select__filter gog-select__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:fit-content}.gog-select{display:flex;flex-direction:column;gap:var(--gog-select-gap);width:100%}.gog-select--xsm,.gog-select__dropdown--xsm{--gog-select-size-padding-y: var(--gog-field-xsm-padding-y);--gog-select-size-padding-x: var(--gog-field-xsm-padding-x);--gog-select-size-font-size: var(--gog-field-xsm-font-size)}.gog-select--sm,.gog-select__dropdown--sm{--gog-select-size-padding-y: var(--gog-field-sm-padding-y);--gog-select-size-padding-x: var(--gog-field-sm-padding-x);--gog-select-size-font-size: var(--gog-field-sm-font-size)}.gog-select--lg,.gog-select__dropdown--lg{--gog-select-size-padding-y: var(--gog-field-lg-padding-y);--gog-select-size-padding-x: var(--gog-field-lg-padding-x);--gog-select-size-font-size: var(--gog-field-lg-font-size)}.gog-select--slg,.gog-select__dropdown--slg{--gog-select-size-padding-y: var(--gog-field-slg-padding-y);--gog-select-size-padding-x: var(--gog-field-slg-padding-x);--gog-select-size-font-size: var(--gog-field-slg-font-size)}.gog-select--disabled{opacity:var(--gog-select-disabled-opacity)}.gog-select--disabled .gog-select__label,.gog-select--disabled .gog-select__field{cursor:not-allowed}.gog-select__label{font-family:var(--gog-select-label-font-family);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);cursor:pointer}.gog-select__field{position:relative;cursor:pointer}.gog-select__control{width:100%;padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-chevron-inset) var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));display:flex;align-items:center;justify-content:space-between;gap:var(--gog-select-control-gap);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-field-color);background-color:var(--gog-select-field-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);outline:none;cursor:pointer;transition:border-color var(--gog-select-transition-duration) var(--gog-easing),box-shadow var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__control:focus{border-color:var(--gog-select-focus-border);box-shadow:var(--gog-select-focus-glow)}.gog-select__control:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__control:disabled{cursor:not-allowed}.gog-select--open .gog-select__control{border-color:var(--gog-select-focus-border)}.gog-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.gog-select__value--placeholder{color:var(--gog-select-placeholder-color)}.gog-select__chevron{width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));display:flex;align-items:center;justify-content:center;color:var(--gog-select-chevron-color);pointer-events:none;flex-shrink:0}.gog-select__chevron gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-chevron-icon-ratio))}.gog-select__dropdown{position:absolute;top:calc(100% + var(--gog-select-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-select-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-select-panel-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);max-height:var(--gog-select-panel-max-height);overflow:hidden;box-shadow:var(--gog-select-panel-shadow)}.gog-select__scroll{flex:1;min-height:0}.gog-select__dropdown--up{top:auto;bottom:calc(100% + var(--gog-select-panel-offset))}.gog-select__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-select__option{width:100%;display:flex;align-items:center;gap:var(--gog-select-option-gap);padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-option-color);cursor:pointer;transition:background-color var(--gog-select-option-transition-duration) var(--gog-easing)}.gog-select__option:hover{background-color:var(--gog-select-option-hover-bg)}.gog-select__option--selected{color:var(--gog-select-option-selected-color)}.gog-select__option--disabled{opacity:var(--gog-select-option-disabled-opacity);cursor:not-allowed}.gog-select__option:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:calc(var(--gog-select-focus-ring-width) * -1)}.gog-select__option-mark{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));height:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));flex-shrink:0}.gog-select__option-mark gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-icon-ratio))}.gog-select__error{font-family:var(--gog-select-font-family);font-size:var(--gog-select-error-font-size);color:var(--gog-select-error-color)}.gog-select__label--float{position:absolute;left:var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-select-placeholder-color);font-size:var(--gog-select-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-select-transition-duration) var(--gog-easing),font-size var(--gog-select-transition-duration) var(--gog-easing),color var(--gog-select-transition-duration) var(--gog-easing),top var(--gog-select-transition-duration) var(--gog-easing),background-color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select--float-in,.gog-select--float-on{--gog-select-float-top-padding: calc(var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-select-float-label-reserve))}.gog-select--float-in .gog-select__control,.gog-select--float-on .gog-select__control{padding-top:var(--gog-select-float-top-padding)}.gog-select--float-in .gog-select__label--float,.gog-select--float-on .gog-select__label--float{top:var(--gog-select-float-top-padding);transform:none}.gog-select--float-in.gog-select--floated .gog-select__label--float{top:var(--gog-select-float-label-in-top);transform:translateY(0);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-on.gog-select--floated .gog-select__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);background-color:var(--gog-select-float-label-on-bg, var(--gog-select-field-bg));padding:0 4px;left:calc(var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-select--float-over.gog-select--floated .gog-select__label--float{top:calc(-1 * var(--gog-select-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-over .gog-select__field{margin-top:var(--gog-select-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-select__control,.gog-select__option,.gog-select__label--float{transition:none}}.gog-select__clear{position:absolute;top:50%;right:var(--gog-select-chevron-inset);transform:translateY(-50%);width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-select-clear-radius);background:transparent;color:var(--gog-select-clear-color);line-height:1;cursor:pointer;transition:color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__clear:hover{color:var(--gog-select-clear-hover-color)}.gog-select__clear:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__clear gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-clear-icon-ratio))}.gog-select--clearable .gog-select__control{padding-right:calc(var(--gog-select-chevron-inset) + var(--gog-select-clear-gap) + var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))))}.gog-select__filter{position:sticky;top:0;z-index:1;padding:var(--gog-select-filter-padding);background:var(--gog-select-panel-bg)}.gog-select__filter-input{width:100%;padding:var(--gog-select-filter-input-padding-y) var(--gog-select-filter-input-padding-x);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-input-color);background:var(--gog-select-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-select-filter-input-border);border-radius:var(--gog-select-filter-input-radius);outline:none}.gog-select__filter-input:focus{border-color:var(--gog-select-focus-border)}.gog-select__empty{margin:0;padding:var(--gog-select-filter-empty-padding);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-empty-color);text-align:center}.gog-select__filter--top{border-bottom:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}.gog-select__filter--bottom{top:auto;bottom:0;border-top:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-select__control{min-width:var(--gog-select-min-width)}.gog-select__dropdown--portal{max-width:var(--gog-select-panel-max-width)}\n"] }]
|
|
5909
|
+
}, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-select\"\r\n [class.gog-select--clearable]=\"showClear()\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-select--disabled]=\"isDisabled()\"\r\n [class.gog-select--open]=\"isOpen()\"\r\n [class.gog-select--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-select--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-select--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-select--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a <button>, which is\r\n not a labelable element, so `for` pointing at it is silently ignored by browsers and\r\n assistive tech alike.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div class=\"gog-select__field\">\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-select__label gog-select__label--float\" [id]=\"labelId()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__control\"\r\n [id]=\"triggerId()\"\r\n [disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-haspopup]=\"'listbox'\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n <span class=\"gog-select__value\" [class.gog-select__value--placeholder]=\"!selectedOption()\">\r\n {{ selectedLabel() || effectivePlaceholder() }}\r\n </span>\r\n\r\n <span class=\"gog-select__chevron\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n name=\"chevron-down\"\r\n />\r\n </span>\r\n </button>\r\n\r\n <!--\r\n A sibling of the trigger, not a child: `.gog-select__control` is a <button>, and nesting\r\n one button inside another is invalid HTML. It is positioned over the trigger's right edge\r\n by the stylesheet, which also reserves room for it so it never covers the value text.\r\n -->\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__clear gog-inline-center\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n (click)=\"clearValue($event)\"\r\n >\r\n <gog-icon name=\"close\" />\r\n </button>\r\n }\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-select__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-select--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-select__dropdown\"\r\n [class.gog-select__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-select__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-select__filter gog-select__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll\r\n size=\"thin\"\r\n [focusable]=\"false\"\r\n overscrollBehavior=\"contain\"\r\n class=\"gog-select__scroll\"\r\n >\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-select__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern expects:\r\n focus is moved between options with the arrow keys, not by tabbing through every\r\n one of them. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-select__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-select__option--selected]=\"isSelected(option)\"\r\n [class.gog-select__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"selectOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-select__option-mark\" aria-hidden=\"true\">\r\n @if (isSelected(option)) {\r\n <gog-icon name=\"check\" />\r\n }\r\n </span>\r\n <span class=\"gog-select__option-label\">{{ labelOf(option) }}</span>\r\n }\r\n </button>\r\n }\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-select__filter gog-select__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-select__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:fit-content}.gog-select{display:flex;flex-direction:column;gap:var(--gog-select-gap);width:100%}.gog-select--xsm,.gog-select__dropdown--xsm{--gog-select-size-padding-y: var(--gog-field-xsm-padding-y);--gog-select-size-padding-x: var(--gog-field-xsm-padding-x);--gog-select-size-font-size: var(--gog-field-xsm-font-size)}.gog-select--sm,.gog-select__dropdown--sm{--gog-select-size-padding-y: var(--gog-field-sm-padding-y);--gog-select-size-padding-x: var(--gog-field-sm-padding-x);--gog-select-size-font-size: var(--gog-field-sm-font-size)}.gog-select--lg,.gog-select__dropdown--lg{--gog-select-size-padding-y: var(--gog-field-lg-padding-y);--gog-select-size-padding-x: var(--gog-field-lg-padding-x);--gog-select-size-font-size: var(--gog-field-lg-font-size)}.gog-select--slg,.gog-select__dropdown--slg{--gog-select-size-padding-y: var(--gog-field-slg-padding-y);--gog-select-size-padding-x: var(--gog-field-slg-padding-x);--gog-select-size-font-size: var(--gog-field-slg-font-size)}.gog-select--disabled{opacity:var(--gog-select-disabled-opacity)}.gog-select--disabled .gog-select__label,.gog-select--disabled .gog-select__field{cursor:not-allowed}.gog-select__label{font-family:var(--gog-select-label-font-family);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);cursor:pointer}.gog-select__field{position:relative;cursor:pointer}.gog-select__control{width:100%;padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-chevron-inset) var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));display:flex;align-items:center;justify-content:space-between;gap:var(--gog-select-control-gap);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-field-color);background-color:var(--gog-select-field-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);outline:none;cursor:pointer;transition:border-color var(--gog-select-transition-duration) var(--gog-easing),box-shadow var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__control:focus{border-color:var(--gog-select-focus-border);box-shadow:var(--gog-select-focus-glow)}.gog-select__control:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__control:disabled{cursor:not-allowed}.gog-select--open .gog-select__control{border-color:var(--gog-select-focus-border)}.gog-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.gog-select__value--placeholder{color:var(--gog-select-placeholder-color)}.gog-select__chevron{width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));display:flex;align-items:center;justify-content:center;color:var(--gog-select-chevron-color);pointer-events:none;flex-shrink:0}.gog-select__chevron gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-chevron-icon-ratio))}.gog-select__dropdown{position:absolute;top:calc(100% + var(--gog-select-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-select-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-select-panel-bg);border:var(--gog-select-field-border-width) var(--gog-select-field-border-style) var(--gog-select-field-border);border-radius:var(--gog-select-radius);max-height:var(--gog-select-panel-max-height);overflow:hidden;box-shadow:var(--gog-select-panel-shadow)}.gog-select__scroll{flex:1;min-height:0}.gog-select__dropdown--up{top:auto;bottom:calc(100% + var(--gog-select-panel-offset))}.gog-select__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-select__option{width:100%;display:flex;align-items:center;gap:var(--gog-select-option-gap);padding:var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-option-color);cursor:pointer;transition:background-color var(--gog-select-option-transition-duration) var(--gog-easing)}.gog-select__option:hover{background-color:var(--gog-select-option-hover-bg)}.gog-select__option--selected{color:var(--gog-select-option-selected-color)}.gog-select__option--disabled{opacity:var(--gog-select-option-disabled-opacity);cursor:not-allowed}.gog-select__option:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:calc(var(--gog-select-focus-ring-width) * -1)}.gog-select__option-mark{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));height:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-size-ratio));flex-shrink:0}.gog-select__option-mark gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-mark-icon-ratio))}.gog-select__error{font-family:var(--gog-select-font-family);font-size:var(--gog-select-error-font-size);color:var(--gog-select-error-color)}.gog-select__label--float{position:absolute;left:var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-select-placeholder-color);font-size:var(--gog-select-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-select-transition-duration) var(--gog-easing),font-size var(--gog-select-transition-duration) var(--gog-easing),color var(--gog-select-transition-duration) var(--gog-easing),top var(--gog-select-transition-duration) var(--gog-easing),background-color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select--float-in,.gog-select--float-on{--gog-select-float-top-padding: calc(var(--gog-select-control-padding-y, var(--gog-select-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-select-float-label-reserve))}.gog-select--float-in .gog-select__control,.gog-select--float-on .gog-select__control{padding-top:var(--gog-select-float-top-padding)}.gog-select--float-in .gog-select__label--float,.gog-select--float-on .gog-select__label--float{top:var(--gog-select-float-top-padding);transform:none}.gog-select--float-in.gog-select--floated .gog-select__label--float{top:var(--gog-select-float-label-in-top);transform:translateY(0);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-on.gog-select--floated .gog-select__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing);background-color:var(--gog-select-float-label-on-bg, var(--gog-select-field-bg));padding:0 4px;left:calc(var(--gog-select-control-padding-x, var(--gog-select-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-select--float-over.gog-select--floated .gog-select__label--float{top:calc(-1 * var(--gog-select-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-select-label-font-size);color:var(--gog-select-label-color);text-transform:var(--gog-select-label-text-transform);letter-spacing:var(--gog-select-label-letter-spacing)}.gog-select--float-over .gog-select__field{margin-top:var(--gog-select-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-select__control,.gog-select__option,.gog-select__label--float{transition:none}}.gog-select__clear{position:absolute;top:50%;right:var(--gog-select-chevron-inset);transform:translateY(-50%);width:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-select-clear-radius);background:transparent;color:var(--gog-select-clear-color);line-height:1;cursor:pointer;transition:color var(--gog-select-transition-duration) var(--gog-easing)}.gog-select__clear:hover{color:var(--gog-select-clear-hover-color)}.gog-select__clear:focus-visible{outline:var(--gog-select-focus-ring-width) solid var(--gog-select-focus-border);outline-offset:var(--gog-select-focus-ring-offset)}.gog-select__clear gog-icon{font-size:calc(var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))) * var(--gog-select-clear-icon-ratio))}.gog-select--clearable .gog-select__control{padding-right:calc(var(--gog-select-chevron-inset) + var(--gog-select-clear-gap) + var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size))))}.gog-select__filter{position:sticky;top:0;z-index:1;padding:var(--gog-select-filter-padding);background:var(--gog-select-panel-bg)}.gog-select__filter-input{width:100%;padding:var(--gog-select-filter-input-padding-y) var(--gog-select-filter-input-padding-x);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-input-color);background:var(--gog-select-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-select-filter-input-border);border-radius:var(--gog-select-filter-input-radius);outline:none}.gog-select__filter-input:focus{border-color:var(--gog-select-focus-border)}.gog-select__empty{margin:0;padding:var(--gog-select-filter-empty-padding);font-family:var(--gog-select-font-family);font-size:var(--gog-select-control-font, var(--gog-select-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-select-filter-empty-color);text-align:center}.gog-select__filter--top{border-bottom:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}.gog-select__filter--bottom{top:auto;bottom:0;border-top:var(--gog-select-filter-border-width) var(--gog-select-filter-border-style) var(--gog-select-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-select__control{min-width:var(--gog-select-min-width)}.gog-select__dropdown--portal{max-width:var(--gog-select-panel-max-width)}\n"] }]
|
|
5451
5910
|
}], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], panelTemplate: [{ type: i0.ViewChild, args: ['panelTpl', { isSignal: true }] }] } });
|
|
5452
5911
|
|
|
5453
5912
|
/**
|
|
@@ -5877,6 +6336,9 @@ function readPxToken(el, token, fallback) {
|
|
|
5877
6336
|
|
|
5878
6337
|
/** Height of the select-all/clear row, included in the panel height estimate. */
|
|
5879
6338
|
const CONTROLS_ROW_HEIGHT = 38;
|
|
6339
|
+
/** Built-in defaults, used when neither the instance input nor `GOG_CONFIG.labels` supplies one. */
|
|
6340
|
+
const DEFAULT_SELECT_ALL_LABEL = 'Select all';
|
|
6341
|
+
const DEFAULT_CLEAR_ALL_LABEL = 'Clear';
|
|
5880
6342
|
/**
|
|
5881
6343
|
* Custom markup for the multiselect's clear button:
|
|
5882
6344
|
*
|
|
@@ -5897,12 +6359,26 @@ class MultiselectComponent extends GogDropdownBase {
|
|
|
5897
6359
|
showControls = input(false, ...(ngDevMode ? [{ debugName: "showControls" }] : /* istanbul ignore next */ []));
|
|
5898
6360
|
/** Where the "select all"/"clear" row sits relative to the option list. Sticky either way. */
|
|
5899
6361
|
controlsPosition = input('top', ...(ngDevMode ? [{ debugName: "controlsPosition" }] : /* istanbul ignore next */ []));
|
|
6362
|
+
/**
|
|
6363
|
+
* Visible text of the select-all button. Unset, falls back to `GOG_CONFIG.labels.selectAll`,
|
|
6364
|
+
* then to `'Select all'`.
|
|
6365
|
+
*/
|
|
6366
|
+
selectAllLabel = input(undefined, ...(ngDevMode ? [{ debugName: "selectAllLabel" }] : /* istanbul ignore next */ []));
|
|
6367
|
+
/**
|
|
6368
|
+
* Visible text of the clear-all button — the one inside the panel, next to select-all. The
|
|
6369
|
+
* trigger's own clear icon is `clearAriaLabel`. Unset, falls back to
|
|
6370
|
+
* `GOG_CONFIG.labels.clearAll`, then to `'Clear'`.
|
|
6371
|
+
*/
|
|
6372
|
+
clearAllLabel = input(undefined, ...(ngDevMode ? [{ debugName: "clearAllLabel" }] : /* istanbul ignore next */ []));
|
|
5900
6373
|
/**
|
|
5901
6374
|
* @deprecated since 21.3.0 (2026-08-07) — project an `<ng-template gogMultiselectClearIcon>` into the component instead. Removed in 21.5.0.
|
|
5902
6375
|
*/
|
|
5903
6376
|
clearIconTemplate = input(null, ...(ngDevMode ? [{ debugName: "clearIconTemplate" }] : /* istanbul ignore next */ []));
|
|
5904
6377
|
/** Projected `gogMultiselectClearIcon` template; wins over the deprecated `clearIconTemplate` input. */
|
|
5905
6378
|
clearIconSlot = contentChild(GogMultiselectClearIconDirective, ...(ngDevMode ? [{ debugName: "clearIconSlot" }] : /* istanbul ignore next */ []));
|
|
6379
|
+
/** Instance input → `GOG_CONFIG.labels` → the built-in English default. */
|
|
6380
|
+
resolvedSelectAllLabel = computed(() => resolveConfigured(this.selectAllLabel(), this.globalConfig.labels?.selectAll, DEFAULT_SELECT_ALL_LABEL), ...(ngDevMode ? [{ debugName: "resolvedSelectAllLabel" }] : /* istanbul ignore next */ []));
|
|
6381
|
+
resolvedClearAllLabel = computed(() => resolveConfigured(this.clearAllLabel(), this.globalConfig.labels?.clearAll, DEFAULT_CLEAR_ALL_LABEL), ...(ngDevMode ? [{ debugName: "resolvedClearAllLabel" }] : /* istanbul ignore next */ []));
|
|
5906
6382
|
/**
|
|
5907
6383
|
* Two-way bindable selection: `[(value)]="signal"`.
|
|
5908
6384
|
*
|
|
@@ -6023,15 +6499,15 @@ class MultiselectComponent extends GogDropdownBase {
|
|
|
6023
6499
|
return this.showControls() ? CONTROLS_ROW_HEIGHT : 0;
|
|
6024
6500
|
}
|
|
6025
6501
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MultiselectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6026
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: MultiselectComponent, isStandalone: true, selector: "gog-multiselect", inputs: { showControls: { classPropertyName: "showControls", publicName: "showControls", isSignal: true, isRequired: false, transformFunction: null }, controlsPosition: { classPropertyName: "controlsPosition", publicName: "controlsPosition", isSignal: true, isRequired: false, transformFunction: null }, clearIconTemplate: { classPropertyName: "clearIconTemplate", publicName: "clearIconTemplate", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "style.--gog-multiselect-min-width": "minWidth()" } }, queries: [{ propertyName: "clearIconSlot", first: true, predicate: GogMultiselectClearIconDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }, { propertyName: "valueRef", first: true, predicate: ["valueEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-ms-wrapper\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-ms-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-ms-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-ms-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-ms-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a div with\r\n role=\"combobox\", not a labelable element. Without this the trigger had no accessible\r\n name at all whenever `label` was set, because that also suppresses the aria-label.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div\r\n [gogTooltip]=\"summary().hidden > 0 ? selectedListTpl : null\"\r\n class=\"gog-ms\"\r\n role=\"combobox\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [class.gog-ms--open]=\"isOpen()\"\r\n [class.gog-ms--disabled]=\"isDisabled()\"\r\n [class.gog-ms--error]=\"hasError()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label gog-ms__label--float\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n <span #valueEl class=\"gog-ms__value\" [class.gog-ms__value--placeholder]=\"!selectedNames()\">\r\n {{ summary().text || effectivePlaceholder() }}\r\n </span>\r\n <!--\r\n Only what fits is shown; the rest is collapsed into a count. The tooltip is the way to read\r\n the whole selection back, so it is bound only while something is actually hidden.\r\n -->\r\n @if (summary().hidden > 0) {\r\n <span class=\"gog-ms__overflow\" aria-hidden=\"true\">+{{ summary().hidden }}</span>\r\n }\r\n\r\n <span class=\"gog-ms__actions\">\r\n <span class=\"gog-ms__arrow\" [class.gog-ms__arrow--up]=\"isOpen()\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n [name]=\"isOpen() ? 'chevron-up' : 'chevron-down'\"\r\n />\r\n </span>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__clear gog-inline-center\"\r\n (click)=\"clearValue($event)\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n >\r\n <gog-icon [template]=\"clearIconSlot()?.templateRef ?? clearIconTemplate()\" name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n\r\n @if (visibleError()) {\r\n <span class=\"gog-ms__error\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-ms-wrapper--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-ms__dropdown\"\r\n [class.gog-ms__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-ms__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n @if (showControls() && controlsPosition() === 'top') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-ms__filter gog-ms__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll size=\"thin\" [focusable]=\"false\" overscrollBehavior=\"contain\" class=\"gog-ms__scroll\">\r\n <div class=\"gog-ms__options\">\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-ms__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern\r\n expects: focus moves between options with the arrow keys, not by tabbing\r\n through every one. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-ms__option--selected]=\"isSelected(option)\"\r\n [class.gog-ms__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"toggleOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-ms__option-mark\" aria-hidden=\"true\">\r\n <gog-icon [name]=\"isSelected(option) ? 'checkbox-checked' : 'checkbox'\" />\r\n </span>\r\n {{ labelOf(option) }}\r\n }\r\n </button>\r\n }\r\n </div>\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-ms__filter gog-ms__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n @if (showControls() && controlsPosition() === 'bottom') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #controlsRowTpl>\r\n <div class=\"gog-ms__controls\" [class.gog-ms__controls--bottom]=\"controlsPosition() === 'bottom'\">\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"selectAll($event)\">Select all</gog-button>\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"clearAll($event)\">Clear</gog-button>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Full selection, shown as a tooltip when the trigger can only fit part of it. -->\r\n<ng-template #selectedListTpl>\r\n <ul class=\"gog-ms__tooltip-list\">\r\n @for (label of selectedLabels(); track label) {\r\n <li>{{ label }}</li>\r\n }\r\n </ul>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.gog-ms-wrapper{display:flex;flex-direction:column;gap:var(--gog-multiselect-gap);position:relative;width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-ms-wrapper{width:fit-content}.gog-ms-wrapper--xsm,.gog-ms__dropdown--xsm{--gog-multiselect-size-padding-y: var(--gog-field-xsm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-xsm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-xsm-font-size)}.gog-ms-wrapper--sm,.gog-ms__dropdown--sm{--gog-multiselect-size-padding-y: var(--gog-field-sm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-sm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-sm-font-size)}.gog-ms-wrapper--lg,.gog-ms__dropdown--lg{--gog-multiselect-size-padding-y: var(--gog-field-lg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-lg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-lg-font-size)}.gog-ms-wrapper--slg,.gog-ms__dropdown--slg{--gog-multiselect-size-padding-y: var(--gog-field-slg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-slg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-slg-font-size)}.gog-ms__label{font-family:var(--gog-multiselect-label-font-family);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);cursor:pointer}.gog-ms{position:relative;display:flex;align-items:center;justify-content:space-between;padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));background-color:var(--gog-multiselect-field-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border);border-radius:var(--gog-multiselect-radius);color:var(--gog-multiselect-field-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--gog-multiselect-transition-duration) var(--gog-easing),box-shadow var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms:hover:not(.gog-ms--disabled){border-color:var(--gog-multiselect-focus-border)}.gog-ms:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms--open{border-color:var(--gog-multiselect-border-color);box-shadow:var(--gog-multiselect-focus-glow)}.gog-ms--disabled{opacity:var(--gog-multiselect-disabled-opacity);cursor:not-allowed}.gog-ms--disabled .gog-ms__label{cursor:not-allowed}.gog-ms--error{border-color:var(--gog-multiselect-error-color)}.gog-ms__value{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gog-multiselect-value-color)}.gog-ms__value--placeholder{color:var(--gog-multiselect-placeholder-color)}.gog-ms{padding-right:var(--gog-multiselect-actions-inset)}.gog-ms__actions{display:flex;align-items:center;gap:var(--gog-multiselect-actions-gap);flex-shrink:0}.gog-ms__clear{width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-multiselect-clear-radius);background:transparent;color:var(--gog-multiselect-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms__clear gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-clear-icon-ratio))}.gog-ms__clear:hover{color:var(--gog-multiselect-field-color)}.gog-ms__clear:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms__arrow{color:var(--gog-multiselect-border-color);transition:transform var(--gog-multiselect-arrow-transition-duration) var(--gog-easing);display:inline-flex;align-items:center;justify-content:center;width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)))}.gog-ms__arrow gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-arrow-icon-ratio))}.gog-ms__arrow--up{transform:rotate(180deg)}.gog-ms__dropdown{position:absolute;top:calc(100% + var(--gog-multiselect-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-multiselect-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-multiselect-panel-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-panel-border);border-radius:var(--gog-multiselect-radius);max-height:var(--gog-multiselect-panel-max-height);overflow:hidden;box-shadow:var(--gog-multiselect-panel-shadow)}.gog-ms__scroll{flex:1;min-height:0}.gog-ms__dropdown--up{top:auto;bottom:calc(100% + var(--gog-multiselect-panel-offset))}.gog-ms__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-ms__controls{flex-shrink:0;display:flex;gap:var(--gog-multiselect-controls-gap);padding:var(--gog-multiselect-controls-padding);background-color:var(--gog-multiselect-panel-bg);border-bottom:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__controls--bottom{border-bottom:0;border-top:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__options{display:flex;flex-direction:column;padding:var(--gog-multiselect-options-padding);gap:var(--gog-multiselect-option-gap)}.gog-ms__option{width:100%;display:flex;align-items:center;gap:var(--gog-multiselect-option-gap-inline);padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));cursor:pointer;border-radius:var(--gog-multiselect-option-radius);transition:background-color var(--gog-multiselect-option-transition-duration) var(--gog-easing);color:var(--gog-multiselect-option-color)}.gog-ms__option--disabled{opacity:var(--gog-multiselect-option-disabled-opacity);cursor:not-allowed}.gog-ms__option:hover{background-color:var(--gog-multiselect-option-hover-bg)}.gog-ms__option--selected{color:var(--gog-multiselect-border-color)}.gog-ms__option:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:calc(var(--gog-multiselect-focus-ring-width) * -1)}.gog-ms__option-mark{display:flex;align-items:center;justify-content:center;width:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));height:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));flex-shrink:0;font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-icon-ratio));color:var(--gog-multiselect-checkbox-border)}.gog-ms__option--selected .gog-ms__option-mark{color:var(--gog-multiselect-checkbox-checked-bg)}.gog-ms__error{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-error-font-size);color:var(--gog-multiselect-error-color);margin-top:var(--gog-multiselect-error-offset)}.gog-ms__label--float{position:absolute;left:var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-multiselect-placeholder-color);font-size:var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-multiselect-transition-duration) var(--gog-easing),font-size var(--gog-multiselect-transition-duration) var(--gog-easing),color var(--gog-multiselect-transition-duration) var(--gog-easing),top var(--gog-multiselect-transition-duration) var(--gog-easing),background-color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms-wrapper--float-in,.gog-ms-wrapper--float-on{--gog-multiselect-float-top-padding: calc(var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-multiselect-float-label-reserve))}.gog-ms-wrapper--float-in .gog-ms,.gog-ms-wrapper--float-on .gog-ms{padding-top:var(--gog-multiselect-float-top-padding)}.gog-ms-wrapper--float-in .gog-ms__label--float,.gog-ms-wrapper--float-on .gog-ms__label--float{top:var(--gog-multiselect-float-top-padding);transform:none}.gog-ms-wrapper--float-in.gog-ms-wrapper--floated .gog-ms__label--float{top:var(--gog-multiselect-float-label-in-top);transform:translateY(0);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-on.gog-ms-wrapper--floated .gog-ms__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);background-color:var(--gog-multiselect-float-label-on-bg, var(--gog-multiselect-field-bg));padding:0 4px;left:calc(var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-ms-wrapper--float-over.gog-ms-wrapper--floated .gog-ms__label--float{top:calc(-1 * var(--gog-multiselect-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-over .gog-ms{margin-top:var(--gog-multiselect-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-ms,.gog-ms__clear,.gog-ms__arrow,.gog-ms__option,.gog-ms__option-mark,.gog-ms__label--float{transition:none}}.gog-ms__filter{position:sticky;top:0;z-index:1;padding:var(--gog-multiselect-filter-padding);background:var(--gog-multiselect-panel-bg)}.gog-ms__filter-input{width:100%;padding:var(--gog-multiselect-filter-input-padding-y) var(--gog-multiselect-filter-input-padding-x);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-input-color);background:var(--gog-multiselect-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-multiselect-filter-input-border);border-radius:var(--gog-multiselect-filter-input-radius);outline:none}.gog-ms__filter-input:focus{border-color:var(--gog-multiselect-focus-border)}.gog-ms__empty{margin:0;padding:var(--gog-multiselect-filter-empty-padding);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-empty-color);text-align:center}.gog-ms__filter--top{border-bottom:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}.gog-ms__filter--bottom{top:auto;bottom:0;border-top:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-ms{min-width:var(--gog-multiselect-min-width)}.gog-ms__dropdown--portal{max-width:var(--gog-multiselect-panel-max-width)}.gog-ms__overflow{flex-shrink:0;margin-left:var(--gog-multiselect-overflow-gap);font-size:var(--gog-multiselect-overflow-font-size);color:var(--gog-multiselect-overflow-color)}.gog-ms__tooltip-list{margin:0;padding-left:1.1em;text-align:left}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "gog-button", inputs: ["variant", "size", "disabled", "fullWidth", "type", "loading", "debounce", "ariaLabel"], outputs: ["gogClick"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }, { kind: "directive", type: GogTooltipDirective, selector: "[gogTooltip]", inputs: ["gogTooltip", "gogTooltipPosition", "gogTooltipShowDelay", "gogTooltipHideDelay", "gogTooltipDisabled", "gogTooltipClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6502
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: MultiselectComponent, isStandalone: true, selector: "gog-multiselect", inputs: { showControls: { classPropertyName: "showControls", publicName: "showControls", isSignal: true, isRequired: false, transformFunction: null }, controlsPosition: { classPropertyName: "controlsPosition", publicName: "controlsPosition", isSignal: true, isRequired: false, transformFunction: null }, selectAllLabel: { classPropertyName: "selectAllLabel", publicName: "selectAllLabel", isSignal: true, isRequired: false, transformFunction: null }, clearAllLabel: { classPropertyName: "clearAllLabel", publicName: "clearAllLabel", isSignal: true, isRequired: false, transformFunction: null }, clearIconTemplate: { classPropertyName: "clearIconTemplate", publicName: "clearIconTemplate", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "style.--gog-multiselect-min-width": "minWidth()" } }, queries: [{ propertyName: "clearIconSlot", first: true, predicate: GogMultiselectClearIconDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panelTpl"], descendants: true, isSignal: true }, { propertyName: "valueRef", first: true, predicate: ["valueEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-ms-wrapper\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-ms-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-ms-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-ms-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-ms-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a div with\r\n role=\"combobox\", not a labelable element. Without this the trigger had no accessible\r\n name at all whenever `label` was set, because that also suppresses the aria-label.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div\r\n [gogTooltip]=\"summary().hidden > 0 ? selectedListTpl : null\"\r\n class=\"gog-ms\"\r\n role=\"combobox\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [class.gog-ms--open]=\"isOpen()\"\r\n [class.gog-ms--disabled]=\"isDisabled()\"\r\n [class.gog-ms--error]=\"hasError()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label gog-ms__label--float\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n <span #valueEl class=\"gog-ms__value\" [class.gog-ms__value--placeholder]=\"!selectedNames()\">\r\n {{ summary().text || effectivePlaceholder() }}\r\n </span>\r\n <!--\r\n Only what fits is shown; the rest is collapsed into a count. The tooltip is the way to read\r\n the whole selection back, so it is bound only while something is actually hidden.\r\n -->\r\n @if (summary().hidden > 0) {\r\n <span class=\"gog-ms__overflow\" aria-hidden=\"true\">+{{ summary().hidden }}</span>\r\n }\r\n\r\n <span class=\"gog-ms__actions\">\r\n <span class=\"gog-ms__arrow\" [class.gog-ms__arrow--up]=\"isOpen()\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n [name]=\"isOpen() ? 'chevron-up' : 'chevron-down'\"\r\n />\r\n </span>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__clear gog-inline-center\"\r\n (click)=\"clearValue($event)\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n >\r\n <gog-icon [template]=\"clearIconSlot()?.templateRef ?? clearIconTemplate()\" name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n\r\n @if (visibleError()) {\r\n <span class=\"gog-ms__error\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-ms-wrapper--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-ms__dropdown\"\r\n [class.gog-ms__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-ms__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n @if (showControls() && controlsPosition() === 'top') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-ms__filter gog-ms__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll size=\"thin\" [focusable]=\"false\" overscrollBehavior=\"contain\" class=\"gog-ms__scroll\">\r\n <div class=\"gog-ms__options\">\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-ms__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern\r\n expects: focus moves between options with the arrow keys, not by tabbing\r\n through every one. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-ms__option--selected]=\"isSelected(option)\"\r\n [class.gog-ms__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"toggleOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-ms__option-mark\" aria-hidden=\"true\">\r\n <gog-icon [name]=\"isSelected(option) ? 'checkbox-checked' : 'checkbox'\" />\r\n </span>\r\n {{ labelOf(option) }}\r\n }\r\n </button>\r\n }\r\n </div>\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-ms__filter gog-ms__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n @if (showControls() && controlsPosition() === 'bottom') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #controlsRowTpl>\r\n <div class=\"gog-ms__controls\" [class.gog-ms__controls--bottom]=\"controlsPosition() === 'bottom'\">\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"selectAll($event)\">{{\r\n resolvedSelectAllLabel()\r\n }}</gog-button>\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"clearAll($event)\">{{\r\n resolvedClearAllLabel()\r\n }}</gog-button>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Full selection, shown as a tooltip when the trigger can only fit part of it. -->\r\n<ng-template #selectedListTpl>\r\n <ul class=\"gog-ms__tooltip-list\">\r\n @for (label of selectedLabels(); track label) {\r\n <li>{{ label }}</li>\r\n }\r\n </ul>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.gog-ms-wrapper{display:flex;flex-direction:column;gap:var(--gog-multiselect-gap);position:relative;width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-ms-wrapper{width:fit-content}.gog-ms-wrapper--xsm,.gog-ms__dropdown--xsm{--gog-multiselect-size-padding-y: var(--gog-field-xsm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-xsm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-xsm-font-size)}.gog-ms-wrapper--sm,.gog-ms__dropdown--sm{--gog-multiselect-size-padding-y: var(--gog-field-sm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-sm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-sm-font-size)}.gog-ms-wrapper--lg,.gog-ms__dropdown--lg{--gog-multiselect-size-padding-y: var(--gog-field-lg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-lg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-lg-font-size)}.gog-ms-wrapper--slg,.gog-ms__dropdown--slg{--gog-multiselect-size-padding-y: var(--gog-field-slg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-slg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-slg-font-size)}.gog-ms__label{font-family:var(--gog-multiselect-label-font-family);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);cursor:pointer}.gog-ms{position:relative;display:flex;align-items:center;justify-content:space-between;padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));background-color:var(--gog-multiselect-field-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border);border-radius:var(--gog-multiselect-radius);color:var(--gog-multiselect-field-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--gog-multiselect-transition-duration) var(--gog-easing),box-shadow var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms:hover:not(.gog-ms--disabled){border-color:var(--gog-multiselect-focus-border)}.gog-ms:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms--open{border-color:var(--gog-multiselect-border-color);box-shadow:var(--gog-multiselect-focus-glow)}.gog-ms--disabled{opacity:var(--gog-multiselect-disabled-opacity);cursor:not-allowed}.gog-ms--disabled .gog-ms__label{cursor:not-allowed}.gog-ms--error{border-color:var(--gog-multiselect-error-color)}.gog-ms__value{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gog-multiselect-value-color)}.gog-ms__value--placeholder{color:var(--gog-multiselect-placeholder-color)}.gog-ms{padding-right:var(--gog-multiselect-actions-inset)}.gog-ms__actions{display:flex;align-items:center;gap:var(--gog-multiselect-actions-gap);flex-shrink:0}.gog-ms__clear{width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-multiselect-clear-radius);background:transparent;color:var(--gog-multiselect-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms__clear gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-clear-icon-ratio))}.gog-ms__clear:hover{color:var(--gog-multiselect-field-color)}.gog-ms__clear:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms__arrow{color:var(--gog-multiselect-border-color);transition:transform var(--gog-multiselect-arrow-transition-duration) var(--gog-easing);display:inline-flex;align-items:center;justify-content:center;width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)))}.gog-ms__arrow gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-arrow-icon-ratio))}.gog-ms__arrow--up{transform:rotate(180deg)}.gog-ms__dropdown{position:absolute;top:calc(100% + var(--gog-multiselect-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-multiselect-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-multiselect-panel-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-panel-border);border-radius:var(--gog-multiselect-radius);max-height:var(--gog-multiselect-panel-max-height);overflow:hidden;box-shadow:var(--gog-multiselect-panel-shadow)}.gog-ms__scroll{flex:1;min-height:0}.gog-ms__dropdown--up{top:auto;bottom:calc(100% + var(--gog-multiselect-panel-offset))}.gog-ms__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-ms__controls{flex-shrink:0;display:flex;gap:var(--gog-multiselect-controls-gap);padding:var(--gog-multiselect-controls-padding);background-color:var(--gog-multiselect-panel-bg);border-bottom:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__controls--bottom{border-bottom:0;border-top:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__options{display:flex;flex-direction:column;padding:var(--gog-multiselect-options-padding);gap:var(--gog-multiselect-option-gap)}.gog-ms__option{width:100%;display:flex;align-items:center;gap:var(--gog-multiselect-option-gap-inline);padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));cursor:pointer;border-radius:var(--gog-multiselect-option-radius);transition:background-color var(--gog-multiselect-option-transition-duration) var(--gog-easing);color:var(--gog-multiselect-option-color)}.gog-ms__option--disabled{opacity:var(--gog-multiselect-option-disabled-opacity);cursor:not-allowed}.gog-ms__option:hover{background-color:var(--gog-multiselect-option-hover-bg)}.gog-ms__option--selected{color:var(--gog-multiselect-border-color)}.gog-ms__option:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:calc(var(--gog-multiselect-focus-ring-width) * -1)}.gog-ms__option-mark{display:flex;align-items:center;justify-content:center;width:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));height:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));flex-shrink:0;font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-icon-ratio));color:var(--gog-multiselect-checkbox-border)}.gog-ms__option--selected .gog-ms__option-mark{color:var(--gog-multiselect-checkbox-checked-bg)}.gog-ms__error{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-error-font-size);color:var(--gog-multiselect-error-color);margin-top:var(--gog-multiselect-error-offset)}.gog-ms__label--float{position:absolute;left:var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-multiselect-placeholder-color);font-size:var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-multiselect-transition-duration) var(--gog-easing),font-size var(--gog-multiselect-transition-duration) var(--gog-easing),color var(--gog-multiselect-transition-duration) var(--gog-easing),top var(--gog-multiselect-transition-duration) var(--gog-easing),background-color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms-wrapper--float-in,.gog-ms-wrapper--float-on{--gog-multiselect-float-top-padding: calc(var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-multiselect-float-label-reserve))}.gog-ms-wrapper--float-in .gog-ms,.gog-ms-wrapper--float-on .gog-ms{padding-top:var(--gog-multiselect-float-top-padding)}.gog-ms-wrapper--float-in .gog-ms__label--float,.gog-ms-wrapper--float-on .gog-ms__label--float{top:var(--gog-multiselect-float-top-padding);transform:none}.gog-ms-wrapper--float-in.gog-ms-wrapper--floated .gog-ms__label--float{top:var(--gog-multiselect-float-label-in-top);transform:translateY(0);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-on.gog-ms-wrapper--floated .gog-ms__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);background-color:var(--gog-multiselect-float-label-on-bg, var(--gog-multiselect-field-bg));padding:0 4px;left:calc(var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-ms-wrapper--float-over.gog-ms-wrapper--floated .gog-ms__label--float{top:calc(-1 * var(--gog-multiselect-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-over .gog-ms{margin-top:var(--gog-multiselect-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-ms,.gog-ms__clear,.gog-ms__arrow,.gog-ms__option,.gog-ms__option-mark,.gog-ms__label--float{transition:none}}.gog-ms__filter{position:sticky;top:0;z-index:1;padding:var(--gog-multiselect-filter-padding);background:var(--gog-multiselect-panel-bg)}.gog-ms__filter-input{width:100%;padding:var(--gog-multiselect-filter-input-padding-y) var(--gog-multiselect-filter-input-padding-x);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-input-color);background:var(--gog-multiselect-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-multiselect-filter-input-border);border-radius:var(--gog-multiselect-filter-input-radius);outline:none}.gog-ms__filter-input:focus{border-color:var(--gog-multiselect-focus-border)}.gog-ms__empty{margin:0;padding:var(--gog-multiselect-filter-empty-padding);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-empty-color);text-align:center}.gog-ms__filter--top{border-bottom:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}.gog-ms__filter--bottom{top:auto;bottom:0;border-top:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-ms{min-width:var(--gog-multiselect-min-width)}.gog-ms__dropdown--portal{max-width:var(--gog-multiselect-panel-max-width)}.gog-ms__overflow{flex-shrink:0;margin-left:var(--gog-multiselect-overflow-gap);font-size:var(--gog-multiselect-overflow-font-size);color:var(--gog-multiselect-overflow-color)}.gog-ms__tooltip-list{margin:0;padding-left:1.1em;text-align:left}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "gog-button", inputs: ["variant", "size", "disabled", "fullWidth", "type", "loading", "debounce", "ariaLabel"], outputs: ["gogClick"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }, { kind: "directive", type: GogTooltipDirective, selector: "[gogTooltip]", inputs: ["gogTooltip", "gogTooltipPosition", "gogTooltipShowDelay", "gogTooltipHideDelay", "gogTooltipDisabled", "gogTooltipClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6027
6503
|
}
|
|
6028
6504
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MultiselectComponent, decorators: [{
|
|
6029
6505
|
type: Component,
|
|
6030
6506
|
args: [{ selector: 'gog-multiselect', imports: [ButtonComponent, IconComponent, NgTemplateOutlet, ScrollComponent, GogTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
6031
6507
|
// Only bites when the control has opted out of full width; otherwise the container decides.
|
|
6032
6508
|
'[style.--gog-multiselect-min-width]': 'minWidth()',
|
|
6033
|
-
}, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-ms-wrapper\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-ms-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-ms-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-ms-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-ms-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a div with\r\n role=\"combobox\", not a labelable element. Without this the trigger had no accessible\r\n name at all whenever `label` was set, because that also suppresses the aria-label.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div\r\n [gogTooltip]=\"summary().hidden > 0 ? selectedListTpl : null\"\r\n class=\"gog-ms\"\r\n role=\"combobox\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [class.gog-ms--open]=\"isOpen()\"\r\n [class.gog-ms--disabled]=\"isDisabled()\"\r\n [class.gog-ms--error]=\"hasError()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label gog-ms__label--float\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n <span #valueEl class=\"gog-ms__value\" [class.gog-ms__value--placeholder]=\"!selectedNames()\">\r\n {{ summary().text || effectivePlaceholder() }}\r\n </span>\r\n <!--\r\n Only what fits is shown; the rest is collapsed into a count. The tooltip is the way to read\r\n the whole selection back, so it is bound only while something is actually hidden.\r\n -->\r\n @if (summary().hidden > 0) {\r\n <span class=\"gog-ms__overflow\" aria-hidden=\"true\">+{{ summary().hidden }}</span>\r\n }\r\n\r\n <span class=\"gog-ms__actions\">\r\n <span class=\"gog-ms__arrow\" [class.gog-ms__arrow--up]=\"isOpen()\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n [name]=\"isOpen() ? 'chevron-up' : 'chevron-down'\"\r\n />\r\n </span>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__clear gog-inline-center\"\r\n (click)=\"clearValue($event)\"\r\n [attr.aria-label]=\"clearAriaLabel()\"\r\n >\r\n <gog-icon [template]=\"clearIconSlot()?.templateRef ?? clearIconTemplate()\" name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n\r\n @if (visibleError()) {\r\n <span class=\"gog-ms__error\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-ms-wrapper--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-ms__dropdown\"\r\n [class.gog-ms__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-ms__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n @if (showControls() && controlsPosition() === 'top') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-ms__filter gog-ms__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll size=\"thin\" [focusable]=\"false\" overscrollBehavior=\"contain\" class=\"gog-ms__scroll\">\r\n <div class=\"gog-ms__options\">\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-ms__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern\r\n expects: focus moves between options with the arrow keys, not by tabbing\r\n through every one. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-ms__option--selected]=\"isSelected(option)\"\r\n [class.gog-ms__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"toggleOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-ms__option-mark\" aria-hidden=\"true\">\r\n <gog-icon [name]=\"isSelected(option) ? 'checkbox-checked' : 'checkbox'\" />\r\n </span>\r\n {{ labelOf(option) }}\r\n }\r\n </button>\r\n }\r\n </div>\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-ms__filter gog-ms__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n @if (showControls() && controlsPosition() === 'bottom') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #controlsRowTpl>\r\n <div class=\"gog-ms__controls\" [class.gog-ms__controls--bottom]=\"controlsPosition() === 'bottom'\">\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"selectAll($event)\">Select all</gog-button>\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"clearAll($event)\">Clear</gog-button>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Full selection, shown as a tooltip when the trigger can only fit part of it. -->\r\n<ng-template #selectedListTpl>\r\n <ul class=\"gog-ms__tooltip-list\">\r\n @for (label of selectedLabels(); track label) {\r\n <li>{{ label }}</li>\r\n }\r\n </ul>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.gog-ms-wrapper{display:flex;flex-direction:column;gap:var(--gog-multiselect-gap);position:relative;width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-ms-wrapper{width:fit-content}.gog-ms-wrapper--xsm,.gog-ms__dropdown--xsm{--gog-multiselect-size-padding-y: var(--gog-field-xsm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-xsm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-xsm-font-size)}.gog-ms-wrapper--sm,.gog-ms__dropdown--sm{--gog-multiselect-size-padding-y: var(--gog-field-sm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-sm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-sm-font-size)}.gog-ms-wrapper--lg,.gog-ms__dropdown--lg{--gog-multiselect-size-padding-y: var(--gog-field-lg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-lg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-lg-font-size)}.gog-ms-wrapper--slg,.gog-ms__dropdown--slg{--gog-multiselect-size-padding-y: var(--gog-field-slg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-slg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-slg-font-size)}.gog-ms__label{font-family:var(--gog-multiselect-label-font-family);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);cursor:pointer}.gog-ms{position:relative;display:flex;align-items:center;justify-content:space-between;padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));background-color:var(--gog-multiselect-field-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border);border-radius:var(--gog-multiselect-radius);color:var(--gog-multiselect-field-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--gog-multiselect-transition-duration) var(--gog-easing),box-shadow var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms:hover:not(.gog-ms--disabled){border-color:var(--gog-multiselect-focus-border)}.gog-ms:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms--open{border-color:var(--gog-multiselect-border-color);box-shadow:var(--gog-multiselect-focus-glow)}.gog-ms--disabled{opacity:var(--gog-multiselect-disabled-opacity);cursor:not-allowed}.gog-ms--disabled .gog-ms__label{cursor:not-allowed}.gog-ms--error{border-color:var(--gog-multiselect-error-color)}.gog-ms__value{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gog-multiselect-value-color)}.gog-ms__value--placeholder{color:var(--gog-multiselect-placeholder-color)}.gog-ms{padding-right:var(--gog-multiselect-actions-inset)}.gog-ms__actions{display:flex;align-items:center;gap:var(--gog-multiselect-actions-gap);flex-shrink:0}.gog-ms__clear{width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-multiselect-clear-radius);background:transparent;color:var(--gog-multiselect-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms__clear gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-clear-icon-ratio))}.gog-ms__clear:hover{color:var(--gog-multiselect-field-color)}.gog-ms__clear:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms__arrow{color:var(--gog-multiselect-border-color);transition:transform var(--gog-multiselect-arrow-transition-duration) var(--gog-easing);display:inline-flex;align-items:center;justify-content:center;width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)))}.gog-ms__arrow gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-arrow-icon-ratio))}.gog-ms__arrow--up{transform:rotate(180deg)}.gog-ms__dropdown{position:absolute;top:calc(100% + var(--gog-multiselect-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-multiselect-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-multiselect-panel-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-panel-border);border-radius:var(--gog-multiselect-radius);max-height:var(--gog-multiselect-panel-max-height);overflow:hidden;box-shadow:var(--gog-multiselect-panel-shadow)}.gog-ms__scroll{flex:1;min-height:0}.gog-ms__dropdown--up{top:auto;bottom:calc(100% + var(--gog-multiselect-panel-offset))}.gog-ms__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-ms__controls{flex-shrink:0;display:flex;gap:var(--gog-multiselect-controls-gap);padding:var(--gog-multiselect-controls-padding);background-color:var(--gog-multiselect-panel-bg);border-bottom:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__controls--bottom{border-bottom:0;border-top:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__options{display:flex;flex-direction:column;padding:var(--gog-multiselect-options-padding);gap:var(--gog-multiselect-option-gap)}.gog-ms__option{width:100%;display:flex;align-items:center;gap:var(--gog-multiselect-option-gap-inline);padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));cursor:pointer;border-radius:var(--gog-multiselect-option-radius);transition:background-color var(--gog-multiselect-option-transition-duration) var(--gog-easing);color:var(--gog-multiselect-option-color)}.gog-ms__option--disabled{opacity:var(--gog-multiselect-option-disabled-opacity);cursor:not-allowed}.gog-ms__option:hover{background-color:var(--gog-multiselect-option-hover-bg)}.gog-ms__option--selected{color:var(--gog-multiselect-border-color)}.gog-ms__option:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:calc(var(--gog-multiselect-focus-ring-width) * -1)}.gog-ms__option-mark{display:flex;align-items:center;justify-content:center;width:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));height:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));flex-shrink:0;font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-icon-ratio));color:var(--gog-multiselect-checkbox-border)}.gog-ms__option--selected .gog-ms__option-mark{color:var(--gog-multiselect-checkbox-checked-bg)}.gog-ms__error{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-error-font-size);color:var(--gog-multiselect-error-color);margin-top:var(--gog-multiselect-error-offset)}.gog-ms__label--float{position:absolute;left:var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-multiselect-placeholder-color);font-size:var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-multiselect-transition-duration) var(--gog-easing),font-size var(--gog-multiselect-transition-duration) var(--gog-easing),color var(--gog-multiselect-transition-duration) var(--gog-easing),top var(--gog-multiselect-transition-duration) var(--gog-easing),background-color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms-wrapper--float-in,.gog-ms-wrapper--float-on{--gog-multiselect-float-top-padding: calc(var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-multiselect-float-label-reserve))}.gog-ms-wrapper--float-in .gog-ms,.gog-ms-wrapper--float-on .gog-ms{padding-top:var(--gog-multiselect-float-top-padding)}.gog-ms-wrapper--float-in .gog-ms__label--float,.gog-ms-wrapper--float-on .gog-ms__label--float{top:var(--gog-multiselect-float-top-padding);transform:none}.gog-ms-wrapper--float-in.gog-ms-wrapper--floated .gog-ms__label--float{top:var(--gog-multiselect-float-label-in-top);transform:translateY(0);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-on.gog-ms-wrapper--floated .gog-ms__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);background-color:var(--gog-multiselect-float-label-on-bg, var(--gog-multiselect-field-bg));padding:0 4px;left:calc(var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-ms-wrapper--float-over.gog-ms-wrapper--floated .gog-ms__label--float{top:calc(-1 * var(--gog-multiselect-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-over .gog-ms{margin-top:var(--gog-multiselect-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-ms,.gog-ms__clear,.gog-ms__arrow,.gog-ms__option,.gog-ms__option-mark,.gog-ms__label--float{transition:none}}.gog-ms__filter{position:sticky;top:0;z-index:1;padding:var(--gog-multiselect-filter-padding);background:var(--gog-multiselect-panel-bg)}.gog-ms__filter-input{width:100%;padding:var(--gog-multiselect-filter-input-padding-y) var(--gog-multiselect-filter-input-padding-x);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-input-color);background:var(--gog-multiselect-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-multiselect-filter-input-border);border-radius:var(--gog-multiselect-filter-input-radius);outline:none}.gog-ms__filter-input:focus{border-color:var(--gog-multiselect-focus-border)}.gog-ms__empty{margin:0;padding:var(--gog-multiselect-filter-empty-padding);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-empty-color);text-align:center}.gog-ms__filter--top{border-bottom:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}.gog-ms__filter--bottom{top:auto;bottom:0;border-top:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-ms{min-width:var(--gog-multiselect-min-width)}.gog-ms__dropdown--portal{max-width:var(--gog-multiselect-panel-max-width)}.gog-ms__overflow{flex-shrink:0;margin-left:var(--gog-multiselect-overflow-gap);font-size:var(--gog-multiselect-overflow-font-size);color:var(--gog-multiselect-overflow-color)}.gog-ms__tooltip-list{margin:0;padding-left:1.1em;text-align:left}\n"] }]
|
|
6034
|
-
}], ctorParameters: () => [], propDecorators: { showControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "showControls", required: false }] }], controlsPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlsPosition", required: false }] }], clearIconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearIconTemplate", required: false }] }], clearIconSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GogMultiselectClearIconDirective), { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], panelTemplate: [{ type: i0.ViewChild, args: ['panelTpl', { isSignal: true }] }], valueRef: [{ type: i0.ViewChild, args: ['valueEl', { isSignal: true }] }] } });
|
|
6509
|
+
}, template: "<!--\r\n Deliberately not `gog-contained-layout`: `contain: layout` makes this element a stacking\r\n context, which traps the panel's z-index inside it and lets whatever follows on the page\r\n paint over the open dropdown.\r\n-->\r\n<div\r\n class=\"gog-ms-wrapper\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-ms-wrapper--float-in]=\"resolvedFloatLabel() === 'in'\"\r\n [class.gog-ms-wrapper--float-on]=\"resolvedFloatLabel() === 'on'\"\r\n [class.gog-ms-wrapper--float-over]=\"resolvedFloatLabel() === 'over'\"\r\n [class.gog-ms-wrapper--floated]=\"isFloatLabelFloated()\"\r\n>\r\n <!--\r\n Associated with aria-labelledby rather than `for`: the trigger is a div with\r\n role=\"combobox\", not a labelable element. Without this the trigger had no accessible\r\n name at all whenever `label` was set, because that also suppresses the aria-label.\r\n -->\r\n @if (label() && resolvedFloatLabel() === 'none') {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n\r\n <div\r\n [gogTooltip]=\"summary().hidden > 0 ? selectedListTpl : null\"\r\n class=\"gog-ms\"\r\n role=\"combobox\"\r\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [attr.aria-disabled]=\"isDisabled()\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || placeholder() || 'Select'\"\r\n [class.gog-ms--open]=\"isOpen()\"\r\n [class.gog-ms--disabled]=\"isDisabled()\"\r\n [class.gog-ms--error]=\"hasError()\"\r\n (click)=\"toggle()\"\r\n (focus)=\"onFocusIn()\"\r\n (blur)=\"onFocusOut()\"\r\n (keydown.enter)=\"toggle(); $event.preventDefault()\"\r\n (keydown.space)=\"toggle(); $event.preventDefault()\"\r\n (keydown.escape)=\"close()\"\r\n (keydown.arrowdown)=\"onTriggerArrowKeydown($event)\"\r\n (keydown.arrowup)=\"onTriggerArrowKeydown($event)\"\r\n >\r\n @if (label() && isFloatLabelActive()) {\r\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -- associated via aria-labelledby above instead, see comment -->\r\n <label class=\"gog-ms__label gog-ms__label--float\" [id]=\"labelId()\">{{ label() }}</label>\r\n }\r\n <span #valueEl class=\"gog-ms__value\" [class.gog-ms__value--placeholder]=\"!selectedNames()\">\r\n {{ summary().text || effectivePlaceholder() }}\r\n </span>\r\n <!--\r\n Only what fits is shown; the rest is collapsed into a count. The tooltip is the way to read\r\n the whole selection back, so it is bound only while something is actually hidden.\r\n -->\r\n @if (summary().hidden > 0) {\r\n <span class=\"gog-ms__overflow\" aria-hidden=\"true\">+{{ summary().hidden }}</span>\r\n }\r\n\r\n <span class=\"gog-ms__actions\">\r\n <span class=\"gog-ms__arrow\" [class.gog-ms__arrow--up]=\"isOpen()\" aria-hidden=\"true\">\r\n <gog-icon\r\n [template]=\"chevronSlot()?.templateRef ?? chevronTemplate()\"\r\n [name]=\"isOpen() ? 'chevron-up' : 'chevron-down'\"\r\n />\r\n </span>\r\n @if (showClear()) {\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__clear gog-inline-center\"\r\n (click)=\"clearValue($event)\"\r\n [attr.aria-label]=\"resolvedClearLabel()\"\r\n >\r\n <gog-icon [template]=\"clearIconSlot()?.templateRef ?? clearIconTemplate()\" name=\"close\" />\r\n </button>\r\n }\r\n </span>\r\n </div>\r\n\r\n @if (isOpen() && !resolvedAppendToBody()) {\r\n <ng-container [ngTemplateOutlet]=\"panelTpl\" />\r\n }\r\n\r\n @if (visibleError()) {\r\n <span class=\"gog-ms__error\" role=\"alert\">{{ visibleError() }}</span>\r\n }\r\n</div>\r\n\r\n<!--\r\n One template for both render modes. When `appendToBody` is set it is stamped into\r\n <body> by the overlay, which is why the portal-only modifier and the resolved\r\n coordinates are applied conditionally: outside the component's subtree the panel can\r\n no longer inherit the size tokens from the `.gog-ms-wrapper--sm/--lg` wrapper.\r\n-->\r\n<ng-template #panelTpl>\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- (click) below is housekeeping stopPropagation, not an interactive handler; the focusable/keyboard-operable elements are the options inside -->\r\n <div\r\n [id]=\"listboxId()\"\r\n class=\"gog-ms__dropdown\"\r\n [class.gog-ms__dropdown--up]=\"!resolvedAppendToBody() && dropdownDirectionState() === 'up'\"\r\n [class.gog-ms__dropdown--portal]=\"resolvedAppendToBody()\"\r\n [class]=\"panelSizeClass()\"\r\n [style.top.px]=\"resolvedAppendToBody() ? panelPlacement()?.top : null\"\r\n [style.left.px]=\"resolvedAppendToBody() ? panelPlacement()?.left : null\"\r\n [style.width]=\"resolvedAppendToBody() ? resolvedPanelWidth() : null\"\r\n [style.min-width]=\"resolvedAppendToBody() ? resolvedPanelMinWidth() : null\"\r\n [style.max-height]=\"resolvedAppendToBody() ? resolvedPanelMaxHeight() : null\"\r\n [style.z-index]=\"dropdownZIndex() ?? panelZIndex()\"\r\n role=\"listbox\"\r\n aria-multiselectable=\"true\"\r\n [attr.aria-labelledby]=\"label() ? labelId() : null\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n @if (showControls() && controlsPosition() === 'top') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n <!--\r\n Not a tab stop of its own: the listbox pattern's only stop is the trigger, with\r\n focus moved between options via the arrow keys (roving-focus.ts), which already\r\n scrolls the focused option into view natively \u2014 no separate keyboard-scroll target\r\n needed here.\r\n -->\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'top') {\r\n <div class=\"gog-ms__filter gog-ms__filter--top\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n <gog-scroll size=\"thin\" [focusable]=\"false\" overscrollBehavior=\"contain\" class=\"gog-ms__scroll\">\r\n <div class=\"gog-ms__options\">\r\n @if (visibleOptions().length === 0) {\r\n <p class=\"gog-ms__empty\">{{ filterEmptyMessage() }}</p>\r\n }\r\n @for (option of visibleOptions(); track valueOf(option)) {\r\n <!--\r\n tabindex=\"-1\" keeps the list to a single tab stop, as the listbox pattern\r\n expects: focus moves between options with the arrow keys, not by tabbing\r\n through every one. Programmatic .focus() still works on a negative tabindex.\r\n -->\r\n <button\r\n type=\"button\"\r\n class=\"gog-ms__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\r\n [class.gog-ms__option--selected]=\"isSelected(option)\"\r\n [class.gog-ms__option--disabled]=\"isOptionDisabled(option)\"\r\n (click)=\"toggleOption(option, $event)\"\r\n (keydown)=\"onOptionKeydown($event)\"\r\n >\r\n @if (optionSlot(); as slot) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n slot.templateRef;\r\n context: optionContext(option, isSelected(option))\r\n \"\r\n />\r\n } @else {\r\n <span class=\"gog-ms__option-mark\" aria-hidden=\"true\">\r\n <gog-icon [name]=\"isSelected(option) ? 'checkbox-checked' : 'checkbox'\" />\r\n </span>\r\n {{ labelOf(option) }}\r\n }\r\n </button>\r\n }\r\n </div>\r\n </gog-scroll>\r\n @if (resolvedFilter() && resolvedFilterPosition() === 'bottom') {\r\n <div class=\"gog-ms__filter gog-ms__filter--bottom\">\r\n <input\r\n type=\"text\"\r\n class=\"gog-ms__filter-input\"\r\n [placeholder]=\"filterPlaceholder()\"\r\n [value]=\"filterQuery()\"\r\n (input)=\"onFilterInput($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (keydown.escape)=\"close(); focusTrigger()\"\r\n />\r\n </div>\r\n }\r\n @if (showControls() && controlsPosition() === 'bottom') {\r\n <ng-container [ngTemplateOutlet]=\"controlsRowTpl\" />\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #controlsRowTpl>\r\n <div class=\"gog-ms__controls\" [class.gog-ms__controls--bottom]=\"controlsPosition() === 'bottom'\">\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"selectAll($event)\">{{\r\n resolvedSelectAllLabel()\r\n }}</gog-button>\r\n <gog-button variant=\"ghost\" size=\"sm\" (click)=\"clearAll($event)\">{{\r\n resolvedClearAllLabel()\r\n }}</gog-button>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Full selection, shown as a tooltip when the trigger can only fit part of it. -->\r\n<ng-template #selectedListTpl>\r\n <ul class=\"gog-ms__tooltip-list\">\r\n @for (label of selectedLabels(); track label) {\r\n <li>{{ label }}</li>\r\n }\r\n </ul>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.gog-ms-wrapper{display:flex;flex-direction:column;gap:var(--gog-multiselect-gap);position:relative;width:100%}:host(.gog-host--auto-width){width:fit-content}:host(.gog-host--auto-width) .gog-ms-wrapper{width:fit-content}.gog-ms-wrapper--xsm,.gog-ms__dropdown--xsm{--gog-multiselect-size-padding-y: var(--gog-field-xsm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-xsm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-xsm-font-size)}.gog-ms-wrapper--sm,.gog-ms__dropdown--sm{--gog-multiselect-size-padding-y: var(--gog-field-sm-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-sm-padding-x);--gog-multiselect-size-font-size: var(--gog-field-sm-font-size)}.gog-ms-wrapper--lg,.gog-ms__dropdown--lg{--gog-multiselect-size-padding-y: var(--gog-field-lg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-lg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-lg-font-size)}.gog-ms-wrapper--slg,.gog-ms__dropdown--slg{--gog-multiselect-size-padding-y: var(--gog-field-slg-padding-y);--gog-multiselect-size-padding-x: var(--gog-field-slg-padding-x);--gog-multiselect-size-font-size: var(--gog-field-slg-font-size)}.gog-ms__label{font-family:var(--gog-multiselect-label-font-family);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);cursor:pointer}.gog-ms{position:relative;display:flex;align-items:center;justify-content:space-between;padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));background-color:var(--gog-multiselect-field-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border);border-radius:var(--gog-multiselect-radius);color:var(--gog-multiselect-field-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--gog-multiselect-transition-duration) var(--gog-easing),box-shadow var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms:hover:not(.gog-ms--disabled){border-color:var(--gog-multiselect-focus-border)}.gog-ms:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms--open{border-color:var(--gog-multiselect-border-color);box-shadow:var(--gog-multiselect-focus-glow)}.gog-ms--disabled{opacity:var(--gog-multiselect-disabled-opacity);cursor:not-allowed}.gog-ms--disabled .gog-ms__label{cursor:not-allowed}.gog-ms--error{border-color:var(--gog-multiselect-error-color)}.gog-ms__value{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gog-multiselect-value-color)}.gog-ms__value--placeholder{color:var(--gog-multiselect-placeholder-color)}.gog-ms{padding-right:var(--gog-multiselect-actions-inset)}.gog-ms__actions{display:flex;align-items:center;gap:var(--gog-multiselect-actions-gap);flex-shrink:0}.gog-ms__clear{width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));padding:0;border:0;border-radius:var(--gog-multiselect-clear-radius);background:transparent;color:var(--gog-multiselect-placeholder-color);line-height:1;cursor:pointer;transition:color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms__clear gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-clear-icon-ratio))}.gog-ms__clear:hover{color:var(--gog-multiselect-field-color)}.gog-ms__clear:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:var(--gog-multiselect-focus-ring-offset)}.gog-ms__arrow{color:var(--gog-multiselect-border-color);transition:transform var(--gog-multiselect-arrow-transition-duration) var(--gog-easing);display:inline-flex;align-items:center;justify-content:center;width:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));height:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)))}.gog-ms__arrow gog-icon{font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-arrow-icon-ratio))}.gog-ms__arrow--up{transform:rotate(180deg)}.gog-ms__dropdown{position:absolute;top:calc(100% + var(--gog-multiselect-panel-offset));left:0;right:auto;min-width:100%;width:max-content;max-width:var(--gog-multiselect-panel-max-width);z-index:var(--gog-dropdown-z);display:flex;flex-direction:column;background-color:var(--gog-multiselect-panel-bg);border:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-panel-border);border-radius:var(--gog-multiselect-radius);max-height:var(--gog-multiselect-panel-max-height);overflow:hidden;box-shadow:var(--gog-multiselect-panel-shadow)}.gog-ms__scroll{flex:1;min-height:0}.gog-ms__dropdown--up{top:auto;bottom:calc(100% + var(--gog-multiselect-panel-offset))}.gog-ms__dropdown--portal{position:fixed;top:unset;bottom:unset;left:unset;right:unset}.gog-ms__controls{flex-shrink:0;display:flex;gap:var(--gog-multiselect-controls-gap);padding:var(--gog-multiselect-controls-padding);background-color:var(--gog-multiselect-panel-bg);border-bottom:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__controls--bottom{border-bottom:0;border-top:var(--gog-multiselect-field-border-width) var(--gog-multiselect-field-border-style) var(--gog-multiselect-field-border)}.gog-ms__options{display:flex;flex-direction:column;padding:var(--gog-multiselect-options-padding);gap:var(--gog-multiselect-option-gap)}.gog-ms__option{width:100%;display:flex;align-items:center;gap:var(--gog-multiselect-option-gap-inline);padding:var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));border:0;background:transparent;text-align:left;font:inherit;font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));cursor:pointer;border-radius:var(--gog-multiselect-option-radius);transition:background-color var(--gog-multiselect-option-transition-duration) var(--gog-easing);color:var(--gog-multiselect-option-color)}.gog-ms__option--disabled{opacity:var(--gog-multiselect-option-disabled-opacity);cursor:not-allowed}.gog-ms__option:hover{background-color:var(--gog-multiselect-option-hover-bg)}.gog-ms__option--selected{color:var(--gog-multiselect-border-color)}.gog-ms__option:focus-visible{outline:var(--gog-multiselect-focus-ring-width) solid var(--gog-multiselect-focus-ring);outline-offset:calc(var(--gog-multiselect-focus-ring-width) * -1)}.gog-ms__option-mark{display:flex;align-items:center;justify-content:center;width:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));height:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-size-ratio));flex-shrink:0;font-size:calc(var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size))) * var(--gog-multiselect-mark-icon-ratio));color:var(--gog-multiselect-checkbox-border)}.gog-ms__option--selected .gog-ms__option-mark{color:var(--gog-multiselect-checkbox-checked-bg)}.gog-ms__error{font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-error-font-size);color:var(--gog-multiselect-error-color);margin-top:var(--gog-multiselect-error-offset)}.gog-ms__label--float{position:absolute;left:var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x)));top:50%;transform:translateY(-50%);max-width:calc(100% - 2 * var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;cursor:default;color:var(--gog-multiselect-placeholder-color);font-size:var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size));text-transform:none;letter-spacing:normal;transition:transform var(--gog-multiselect-transition-duration) var(--gog-easing),font-size var(--gog-multiselect-transition-duration) var(--gog-easing),color var(--gog-multiselect-transition-duration) var(--gog-easing),top var(--gog-multiselect-transition-duration) var(--gog-easing),background-color var(--gog-multiselect-transition-duration) var(--gog-easing)}.gog-ms-wrapper--float-in,.gog-ms-wrapper--float-on{--gog-multiselect-float-top-padding: calc(var(--gog-multiselect-padding-y, var(--gog-multiselect-size-padding-y, var(--gog-field-md-padding-y))) + var(--gog-multiselect-float-label-reserve))}.gog-ms-wrapper--float-in .gog-ms,.gog-ms-wrapper--float-on .gog-ms{padding-top:var(--gog-multiselect-float-top-padding)}.gog-ms-wrapper--float-in .gog-ms__label--float,.gog-ms-wrapper--float-on .gog-ms__label--float{top:var(--gog-multiselect-float-top-padding);transform:none}.gog-ms-wrapper--float-in.gog-ms-wrapper--floated .gog-ms__label--float{top:var(--gog-multiselect-float-label-in-top);transform:translateY(0);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-on.gog-ms-wrapper--floated .gog-ms__label--float{top:0;transform:translateY(-50%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing);background-color:var(--gog-multiselect-float-label-on-bg, var(--gog-multiselect-field-bg));padding:0 4px;left:calc(var(--gog-multiselect-padding-x, var(--gog-multiselect-size-padding-x, var(--gog-field-md-padding-x))) - 4px)}.gog-ms-wrapper--float-over.gog-ms-wrapper--floated .gog-ms__label--float{top:calc(-1 * var(--gog-multiselect-float-label-over-gap));transform:translateY(-100%);font-size:var(--gog-multiselect-label-font-size);color:var(--gog-multiselect-label-color);text-transform:var(--gog-multiselect-label-text-transform);letter-spacing:var(--gog-multiselect-label-letter-spacing)}.gog-ms-wrapper--float-over .gog-ms{margin-top:var(--gog-multiselect-float-label-over-reserve)}@media(prefers-reduced-motion:reduce){.gog-ms,.gog-ms__clear,.gog-ms__arrow,.gog-ms__option,.gog-ms__option-mark,.gog-ms__label--float{transition:none}}.gog-ms__filter{position:sticky;top:0;z-index:1;padding:var(--gog-multiselect-filter-padding);background:var(--gog-multiselect-panel-bg)}.gog-ms__filter-input{width:100%;padding:var(--gog-multiselect-filter-input-padding-y) var(--gog-multiselect-filter-input-padding-x);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-input-color);background:var(--gog-multiselect-filter-input-bg);border:var(--gog-control-border-width) var(--gog-control-border-style) var(--gog-multiselect-filter-input-border);border-radius:var(--gog-multiselect-filter-input-radius);outline:none}.gog-ms__filter-input:focus{border-color:var(--gog-multiselect-focus-border)}.gog-ms__empty{margin:0;padding:var(--gog-multiselect-filter-empty-padding);font-family:var(--gog-multiselect-font-family);font-size:var(--gog-multiselect-font-size, var(--gog-multiselect-size-font-size, var(--gog-field-md-font-size)));color:var(--gog-multiselect-filter-empty-color);text-align:center}.gog-ms__filter--top{border-bottom:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}.gog-ms__filter--bottom{top:auto;bottom:0;border-top:var(--gog-multiselect-filter-border-width) var(--gog-multiselect-filter-border-style) var(--gog-multiselect-filter-border-color)}:host(.gog-host--auto-width),:host(.gog-host--auto-width) .gog-ms{min-width:var(--gog-multiselect-min-width)}.gog-ms__dropdown--portal{max-width:var(--gog-multiselect-panel-max-width)}.gog-ms__overflow{flex-shrink:0;margin-left:var(--gog-multiselect-overflow-gap);font-size:var(--gog-multiselect-overflow-font-size);color:var(--gog-multiselect-overflow-color)}.gog-ms__tooltip-list{margin:0;padding-left:1.1em;text-align:left}\n"] }]
|
|
6510
|
+
}], ctorParameters: () => [], propDecorators: { showControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "showControls", required: false }] }], controlsPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlsPosition", required: false }] }], selectAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectAllLabel", required: false }] }], clearAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAllLabel", required: false }] }], clearIconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearIconTemplate", required: false }] }], clearIconSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => GogMultiselectClearIconDirective), { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], panelTemplate: [{ type: i0.ViewChild, args: ['panelTpl', { isSignal: true }] }], valueRef: [{ type: i0.ViewChild, args: ['valueEl', { isSignal: true }] }] } });
|
|
6035
6511
|
/** One shared 2D context; creating a canvas per measurement is what makes this approach slow. */
|
|
6036
6512
|
let measureContext = null;
|
|
6037
6513
|
function measureWith(font) {
|
|
@@ -6045,9 +6521,26 @@ function measureWith(font) {
|
|
|
6045
6521
|
|
|
6046
6522
|
/** Built-in default, used when neither the instance input nor `GOG_CONFIG` supplies one. */
|
|
6047
6523
|
const DEFAULT_ERROR_DISPLAY = 'manual';
|
|
6524
|
+
/** How many digits after the decimal point `step` prints, e.g. `0.25` → `2`, `5` → `0`. */
|
|
6525
|
+
function decimalPlaces(step) {
|
|
6526
|
+
const str = String(step);
|
|
6527
|
+
const dot = str.indexOf('.');
|
|
6528
|
+
return dot === -1 ? 0 : str.length - dot - 1;
|
|
6529
|
+
}
|
|
6530
|
+
/**
|
|
6531
|
+
* Character count of `value` formatted with `decimals` fraction digits — the widest a
|
|
6532
|
+
* number in `[min, max]` at this `step` can ever print, since digit count only grows moving
|
|
6533
|
+
* away from zero (see `valueDisplayChars` below for why `min`/`max` alone are enough to
|
|
6534
|
+
* bound every value in between).
|
|
6535
|
+
*/
|
|
6536
|
+
function digitLength(value, decimals) {
|
|
6537
|
+
const sign = value < 0 ? 1 : 0;
|
|
6538
|
+
const intLen = String(Math.trunc(Math.abs(value))).length;
|
|
6539
|
+
const fraction = decimals > 0 ? decimals + 1 : 0; // +1 for the decimal point itself
|
|
6540
|
+
return sign + intLen + fraction;
|
|
6541
|
+
}
|
|
6048
6542
|
class SliderComponent {
|
|
6049
|
-
|
|
6050
|
-
inputId = `gog-slider-${++SliderComponent.nextId}`;
|
|
6543
|
+
inputId = nextGogControlId('gog-slider');
|
|
6051
6544
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
6052
6545
|
min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
6053
6546
|
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
@@ -6080,30 +6573,125 @@ class SliderComponent {
|
|
|
6080
6573
|
* as they do horizontally.
|
|
6081
6574
|
*/
|
|
6082
6575
|
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
6083
|
-
/**
|
|
6576
|
+
/**
|
|
6577
|
+
* Switches the slider to two-thumb mode for picking a *range* of values instead of a
|
|
6578
|
+
* single one. When on, use `[(rangeValue)]` instead of `[(value)]` — the two are mutually
|
|
6579
|
+
* exclusive; `value`/`writeValue` are ignored while this is `true`, and vice versa.
|
|
6580
|
+
*/
|
|
6581
|
+
range = input(false, ...(ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []));
|
|
6582
|
+
/**
|
|
6583
|
+
* Accessible name for the start (lower) thumb in `range` mode. Falls back to `'Minimum'`,
|
|
6584
|
+
* prefixed with `label()` when one is set (e.g. `'Price Minimum'`) — a shared `<label>`
|
|
6585
|
+
* can't be associated with two inputs via `for`, so each thumb needs its own name.
|
|
6586
|
+
*/
|
|
6587
|
+
startAriaLabel = input('', ...(ngDevMode ? [{ debugName: "startAriaLabel" }] : /* istanbul ignore next */ []));
|
|
6588
|
+
/** Accessible name for the end (upper) thumb in `range` mode. Falls back to `'Maximum'`. */
|
|
6589
|
+
endAriaLabel = input('', ...(ngDevMode ? [{ debugName: "endAriaLabel" }] : /* istanbul ignore next */ []));
|
|
6590
|
+
/**
|
|
6591
|
+
* Disables only the start (lower) thumb in `range` mode — e.g. to pin a range's floor
|
|
6592
|
+
* while letting the consumer still raise or lower its ceiling. ORed with `disabled`
|
|
6593
|
+
* (either one disables it), never overrides it: `disabled` still means "both thumbs off".
|
|
6594
|
+
* Ignored outside `range` mode, where there's only one thumb and `disabled` already covers
|
|
6595
|
+
* it. Unlike `disabled`, this never applies the whole-control `.gog-slider--disabled`
|
|
6596
|
+
* dimming/`pointer-events: none` — only the one thumb goes inert, both visually (its own
|
|
6597
|
+
* dot dims) and functionally (the native input's own `disabled` attribute takes it out of
|
|
6598
|
+
* the tab order), so the other thumb stays fully usable.
|
|
6599
|
+
*/
|
|
6600
|
+
startDisabled = input(false, ...(ngDevMode ? [{ debugName: "startDisabled" }] : /* istanbul ignore next */ []));
|
|
6601
|
+
/** Disables only the end (upper) thumb in `range` mode. Mirrors `startDisabled`. */
|
|
6602
|
+
endDisabled = input(false, ...(ngDevMode ? [{ debugName: "endDisabled" }] : /* istanbul ignore next */ []));
|
|
6603
|
+
/** Two-way bindable value: `[(value)]="signal"`. Ignored when `range` is `true`. */
|
|
6084
6604
|
value = model(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
6605
|
+
/** Two-way bindable `{ start, end }` pair: `[(rangeValue)]="signal"`. Used only when `range` is `true`. */
|
|
6606
|
+
rangeValue = model({ start: 0, end: 100 }, ...(ngDevMode ? [{ debugName: "rangeValue" }] : /* istanbul ignore next */ []));
|
|
6085
6607
|
ngControl = inject(NgControl, { optional: true, self: true });
|
|
6086
6608
|
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
6087
6609
|
globalConfig = inject(GOG_CONFIG);
|
|
6088
6610
|
resolvedErrorDisplay = computed(() => resolveConfigured(this.errorDisplay(), this.globalConfig.control?.errorDisplay, DEFAULT_ERROR_DISPLAY), ...(ngDevMode ? [{ debugName: "resolvedErrorDisplay" }] : /* istanbul ignore next */ []));
|
|
6089
6611
|
errorState = new GogErrorState(this.errorMessage, this.resolvedErrorDisplay, this.ngControl);
|
|
6090
6612
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
6613
|
+
/**
|
|
6614
|
+
* `isDisabled()` also covers `cvaDisabled()` — a `[formControl]`'s own `.disable()`, which
|
|
6615
|
+
* (being one FormControl backing one `rangeValue`) always speaks for both thumbs at once
|
|
6616
|
+
* and has no way to target just one. `startDisabled`/`endDisabled` are the only route to a
|
|
6617
|
+
* one-sided disable, and only make sense in `range` mode.
|
|
6618
|
+
*/
|
|
6619
|
+
isStartDisabled = computed(() => this.isDisabled() || this.startDisabled(), ...(ngDevMode ? [{ debugName: "isStartDisabled" }] : /* istanbul ignore next */ []));
|
|
6620
|
+
isEndDisabled = computed(() => this.isDisabled() || this.endDisabled(), ...(ngDevMode ? [{ debugName: "isEndDisabled" }] : /* istanbul ignore next */ []));
|
|
6621
|
+
/**
|
|
6622
|
+
* Drives the whole-control `.gog-slider--disabled` class (dimming + `pointer-events: none`
|
|
6623
|
+
* over the whole track). Applying that class off a one-sided `isStartDisabled()`/
|
|
6624
|
+
* `isEndDisabled()` would also block pointer/touch input to the *other*, still-enabled
|
|
6625
|
+
* thumb — `pointer-events: none` on an ancestor cuts off every descendant, not just the
|
|
6626
|
+
* disabled one — so in `range` mode this only fires once *both* sides are disabled. A
|
|
6627
|
+
* still-disabled single thumb stays inert on its own regardless (its native `disabled`
|
|
6628
|
+
* attribute already takes it out of the tab order and stops it from firing events).
|
|
6629
|
+
*/
|
|
6630
|
+
isFullyDisabled = computed(() => this.range() ? this.isStartDisabled() && this.isEndDisabled() : this.isDisabled(), ...(ngDevMode ? [{ debugName: "isFullyDisabled" }] : /* istanbul ignore next */ []));
|
|
6091
6631
|
clampedValue = computed(() => {
|
|
6092
6632
|
const value = this.value();
|
|
6093
6633
|
return Math.min(this.max(), Math.max(this.min(), value));
|
|
6094
6634
|
}, ...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6635
|
+
/**
|
|
6636
|
+
* `rangeValue()` clamped to `[min, max]`, swapping the pair back in order if a consumer
|
|
6637
|
+
* writes `start > end` directly (e.g. via `writeValue`/a FormControl) — dragging or
|
|
6638
|
+
* keyboard-nudging a thumb past the other can never produce that, since
|
|
6639
|
+
* onRangeStartInput/onRangeEndInput already clamp against each other there.
|
|
6640
|
+
*/
|
|
6641
|
+
clampedRange = computed(() => this.clampRange(this.rangeValue()), ...(ngDevMode ? [{ debugName: "clampedRange" }] : /* istanbul ignore next */ []));
|
|
6642
|
+
percentFor(value) {
|
|
6643
|
+
const span = this.max() - this.min();
|
|
6644
|
+
if (span === 0)
|
|
6098
6645
|
return 0;
|
|
6099
|
-
return ((
|
|
6100
|
-
}
|
|
6646
|
+
return ((value - this.min()) / span) * 100;
|
|
6647
|
+
}
|
|
6648
|
+
clampRange(value) {
|
|
6649
|
+
const lo = this.min();
|
|
6650
|
+
const hi = this.max();
|
|
6651
|
+
const start = Math.min(hi, Math.max(lo, value.start));
|
|
6652
|
+
const end = Math.min(hi, Math.max(lo, value.end));
|
|
6653
|
+
return start <= end ? { start, end } : { start: end, end: start };
|
|
6654
|
+
}
|
|
6655
|
+
fillPercent = computed(() => this.percentFor(this.clampedValue()), ...(ngDevMode ? [{ debugName: "fillPercent" }] : /* istanbul ignore next */ []));
|
|
6656
|
+
rangeStartPercent = computed(() => this.percentFor(this.clampedRange().start), ...(ngDevMode ? [{ debugName: "rangeStartPercent" }] : /* istanbul ignore next */ []));
|
|
6657
|
+
rangeEndPercent = computed(() => this.percentFor(this.clampedRange().end), ...(ngDevMode ? [{ debugName: "rangeEndPercent" }] : /* istanbul ignore next */ []));
|
|
6101
6658
|
thumbPos = computed(() => `${this.fillPercent()}%`, ...(ngDevMode ? [{ debugName: "thumbPos" }] : /* istanbul ignore next */ []));
|
|
6102
6659
|
fillScale = computed(() => this.fillPercent() / 100, ...(ngDevMode ? [{ debugName: "fillScale" }] : /* istanbul ignore next */ []));
|
|
6660
|
+
rangeStartPos = computed(() => `${this.rangeStartPercent()}%`, ...(ngDevMode ? [{ debugName: "rangeStartPos" }] : /* istanbul ignore next */ []));
|
|
6661
|
+
rangeEndPos = computed(() => `${this.rangeEndPercent()}%`, ...(ngDevMode ? [{ debugName: "rangeEndPos" }] : /* istanbul ignore next */ []));
|
|
6662
|
+
rangeDisplayValue = computed(() => {
|
|
6663
|
+
const { start, end } = this.clampedRange();
|
|
6664
|
+
return `${start} – ${end}`;
|
|
6665
|
+
}, ...(ngDevMode ? [{ debugName: "rangeDisplayValue" }] : /* istanbul ignore next */ []));
|
|
6666
|
+
/**
|
|
6667
|
+
* Reserved width for `.gog-slider__value`, in `ch`. Without this the span sizes to
|
|
6668
|
+
* whatever the *current* value happens to print as, so it visibly resizes on every drag —
|
|
6669
|
+
* harmless when `fullWidth` absorbs the wiggle (the default for horizontal), but a vertical
|
|
6670
|
+
* slider is only ever as wide as its content (see the `fit-content` comment in the
|
|
6671
|
+
* stylesheet), so there the whole control jitters in width as you drag, and the header row
|
|
6672
|
+
* being what's regrowing/shrinking tugs the min/max labels below along with it even though
|
|
6673
|
+
* their own text never changes. Sized from `min()`/`max()` rather than the live value:
|
|
6674
|
+
* digit count only grows moving away from zero, so whichever endpoint prints the most
|
|
6675
|
+
* characters is already the worst case for every value in between.
|
|
6676
|
+
*/
|
|
6677
|
+
valueDisplayChars = computed(() => {
|
|
6678
|
+
const decimals = decimalPlaces(this.step());
|
|
6679
|
+
const chars = Math.max(digitLength(this.min(), decimals), digitLength(this.max(), decimals));
|
|
6680
|
+
return this.range() ? chars * 2 + 3 : chars; // +3 for the " – " separator
|
|
6681
|
+
}, ...(ngDevMode ? [{ debugName: "valueDisplayChars" }] : /* istanbul ignore next */ []));
|
|
6682
|
+
startInputAriaLabel = computed(() => {
|
|
6683
|
+
const base = this.startAriaLabel() || 'Minimum';
|
|
6684
|
+
return this.label() ? `${this.label()} ${base}` : base;
|
|
6685
|
+
}, ...(ngDevMode ? [{ debugName: "startInputAriaLabel" }] : /* istanbul ignore next */ []));
|
|
6686
|
+
endInputAriaLabel = computed(() => {
|
|
6687
|
+
const base = this.endAriaLabel() || 'Maximum';
|
|
6688
|
+
return this.label() ? `${this.label()} ${base}` : base;
|
|
6689
|
+
}, ...(ngDevMode ? [{ debugName: "endInputAriaLabel" }] : /* istanbul ignore next */ []));
|
|
6103
6690
|
isVertical = computed(() => this.orientation() === 'vertical', ...(ngDevMode ? [{ debugName: "isVertical" }] : /* istanbul ignore next */ []));
|
|
6104
6691
|
hasError = this.errorState.hasError;
|
|
6105
6692
|
visibleError = this.errorState.visibleError;
|
|
6106
6693
|
errorId = computed(() => (this.hasError() ? `${this.inputId}-error` : null), ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
6694
|
+
/** Fires with a plain `number` normally, or a `GogSliderRange` while `range()` is `true`. */
|
|
6107
6695
|
onChange = () => { };
|
|
6108
6696
|
onTouched = () => { };
|
|
6109
6697
|
constructor() {
|
|
@@ -6118,8 +6706,14 @@ class SliderComponent {
|
|
|
6118
6706
|
this.errorState.check();
|
|
6119
6707
|
}
|
|
6120
6708
|
writeValue(val) {
|
|
6121
|
-
|
|
6122
|
-
|
|
6709
|
+
if (this.range()) {
|
|
6710
|
+
const next = val ?? { start: this.min(), end: this.max() };
|
|
6711
|
+
this.rangeValue.set(this.clampRange(next));
|
|
6712
|
+
}
|
|
6713
|
+
else {
|
|
6714
|
+
const next = val ?? this.min();
|
|
6715
|
+
this.value.set(Math.min(this.max(), Math.max(this.min(), next)));
|
|
6716
|
+
}
|
|
6123
6717
|
}
|
|
6124
6718
|
registerOnChange(fn) {
|
|
6125
6719
|
this.onChange = fn;
|
|
@@ -6140,22 +6734,69 @@ class SliderComponent {
|
|
|
6140
6734
|
onBlur() {
|
|
6141
6735
|
this.onTouched();
|
|
6142
6736
|
}
|
|
6737
|
+
/**
|
|
6738
|
+
* Start (lower) thumb in `range` mode. Both native inputs keep the slider's global
|
|
6739
|
+
* `min()`/`max()` (see the template's comment on why), so crossing prevention happens
|
|
6740
|
+
* entirely here via `Math.min(current.end, ...)` rather than through a narrowed native
|
|
6741
|
+
* `max` attribute — which also means the browser will happily keep dragging this input's
|
|
6742
|
+
* own raw `.value` past `current.end` even once we've clamped the logical value. Writing
|
|
6743
|
+
* the clamped result back to `input.value` directly (rather than trusting the `[value]`
|
|
6744
|
+
* binding to do it) matters because that binding no-ops once the *next* clamped result
|
|
6745
|
+
* matches what Angular itself last wrote — it has no way to know the raw DOM value has
|
|
6746
|
+
* since drifted out from under it via native dragging.
|
|
6747
|
+
*/
|
|
6748
|
+
onRangeStartInput(event) {
|
|
6749
|
+
const input = event.target;
|
|
6750
|
+
const raw = Number(input.value);
|
|
6751
|
+
const current = this.clampedRange();
|
|
6752
|
+
const start = Math.min(current.end, Math.max(this.min(), raw));
|
|
6753
|
+
const next = { start, end: current.end };
|
|
6754
|
+
input.value = String(start);
|
|
6755
|
+
this.rangeValue.set(next);
|
|
6756
|
+
this.onChange(next);
|
|
6757
|
+
}
|
|
6758
|
+
/** End (upper) thumb in `range` mode. Mirrors `onRangeStartInput`. */
|
|
6759
|
+
onRangeEndInput(event) {
|
|
6760
|
+
const input = event.target;
|
|
6761
|
+
const raw = Number(input.value);
|
|
6762
|
+
const current = this.clampedRange();
|
|
6763
|
+
const end = Math.max(current.start, Math.min(this.max(), raw));
|
|
6764
|
+
const next = { start: current.start, end };
|
|
6765
|
+
input.value = String(end);
|
|
6766
|
+
this.rangeValue.set(next);
|
|
6767
|
+
this.onChange(next);
|
|
6768
|
+
}
|
|
6143
6769
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6144
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SliderComponent, isStandalone: true, selector: "gog-slider", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, showThumb: { classPropertyName: "showThumb", publicName: "showThumb", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "style.--thumb-pos": "thumbPos()", "style.--fill-scale": "fillScale()", "class.gog-host--auto-width": "!fullWidth()" } }, ngImport: i0, template: "<div\r\n class=\"gog-slider gog-contained-layout\"\r\n [class.gog-slider--disabled]=\"isDisabled()\"\r\n [class.gog-slider--thumb-hidden]=\"!showThumb()\"\r\n [class.gog-slider--vertical]=\"isVertical()\"\r\n>\r\n <div class=\"gog-slider__header\">\r\n @if (label()) {\r\n <label [attr.for]=\"inputId\" class=\"gog-slider__label\">{{ label() }}</label>\r\n }\r\n\r\n @if (showValue()) {\r\n <span class=\"gog-slider__value\">{{ clampedValue() }}</span>\r\n }\r\n </div>\r\n\r\n <div class=\"gog-slider__track-container\">\r\n <div class=\"gog-slider__track\">\r\n <div class=\"gog-slider__fill\"></div>\r\n </div>\r\n\r\n @if (showThumb()) {\r\n <div class=\"gog-slider__thumb\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n <input\r\n [id]=\"inputId\"\r\n class=\"gog-slider__input\"\r\n type=\"range\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || 'Slider'\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"clampedValue()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedValue()\"\r\n [disabled]=\"isDisabled()\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n </div>\r\n\r\n <div class=\"gog-slider__range-labels\">\r\n <span>{{ min() }}</span>\r\n <span>{{ max() }}</span>\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-slider__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:var(--gog-slider-auto-width)}.gog-slider{display:flex;flex-direction:column;gap:var(--gog-slider-gap);width:100%}.gog-slider--disabled{opacity:var(--gog-slider-disabled-opacity);pointer-events:none}.gog-slider--thumb-hidden .gog-slider__thumb{display:none}.gog-slider__header{display:flex;align-items:center;justify-content:space-between}.gog-slider__label{font-family:var(--gog-slider-label-font-family);font-size:var(--gog-slider-label-font-size);color:var(--gog-slider-label-color);text-transform:var(--gog-slider-label-text-transform);letter-spacing:var(--gog-slider-label-letter-spacing)}.gog-slider__value{min-width:var(--gog-slider-value-min-width);font-family:var(--gog-slider-value-font-family);font-size:var(--gog-slider-value-font-size);color:var(--gog-slider-value-color);text-align:right}.gog-slider__track-container{position:relative;display:flex;align-items:center;height:var(--gog-slider-track-area-height)}.gog-slider__track{position:absolute;inset-inline:0;height:var(--gog-slider-track-height);border:var(--gog-slider-track-border-width) var(--gog-slider-track-border-style) var(--gog-slider-track-border-color);border-radius:var(--gog-slider-track-radius);overflow:hidden;background-color:var(--gog-slider-track-bg);pointer-events:none;box-sizing:border-box}.gog-slider__fill{width:100%;height:100%;background:var(--gog-slider-fill-bg);transform:scaleX(var(--fill-scale, 0));transform-origin:left center;will-change:transform}.gog-slider__thumb{position:absolute;top:50%;left:var(--thumb-pos, 0%);width:var(--gog-slider-thumb-size);height:var(--gog-slider-thumb-size);border:var(--gog-slider-thumb-border-width) solid var(--gog-slider-thumb-border);border-radius:var(--gog-slider-thumb-radius);background-color:var(--gog-slider-thumb-bg);pointer-events:none;translate:-50% -50%;will-change:translate;box-shadow:0 0 var(--gog-slider-thumb-glow-size) var(--gog-slider-thumb-shadow)}.gog-slider__track-container:focus-within .gog-slider__thumb{box-shadow:0 0 0 var(--gog-slider-focus-ring-width) var(--gog-slider-focus-ring),0 0 var(--gog-slider-thumb-glow-size) var(--gog-slider-thumb-shadow)}.gog-slider__input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;outline:none}.gog-slider__range-labels{display:flex;justify-content:space-between;font-family:var(--gog-slider-value-font-family);font-size:var(--gog-slider-range-font-size);color:var(--gog-slider-range-color)}.gog-slider__error{font-family:var(--gog-slider-error-font-family);font-size:var(--gog-slider-error-font-size);color:var(--gog-slider-error-color)}@media(prefers-reduced-motion:reduce){.gog-slider__fill,.gog-slider__thumb{will-change:auto}}.gog-slider--vertical{width:fit-content}.gog-slider--vertical .gog-slider__track-container{height:var(--gog-slider-vertical-length);width:var(--gog-slider-track-area-height)}.gog-slider--vertical .gog-slider__track{inset-inline:auto;inset-block:0;left:50%;translate:-50% 0;width:var(--gog-slider-track-height);height:100%}.gog-slider--vertical .gog-slider__fill{transform:scaleY(var(--fill-scale, 0));transform-origin:bottom center}.gog-slider--vertical .gog-slider__thumb{top:calc(100% - var(--thumb-pos, 0%));left:50%}.gog-slider--vertical .gog-slider__input{writing-mode:vertical-lr;direction:rtl}.gog-slider--vertical .gog-slider__range-labels{flex-direction:column-reverse;align-items:center;gap:2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6770
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SliderComponent, isStandalone: true, selector: "gog-slider", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, showThumb: { classPropertyName: "showThumb", publicName: "showThumb", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorDisplay: { classPropertyName: "errorDisplay", publicName: "errorDisplay", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, startAriaLabel: { classPropertyName: "startAriaLabel", publicName: "startAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, endAriaLabel: { classPropertyName: "endAriaLabel", publicName: "endAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, startDisabled: { classPropertyName: "startDisabled", publicName: "startDisabled", isSignal: true, isRequired: false, transformFunction: null }, endDisabled: { classPropertyName: "endDisabled", publicName: "endDisabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, rangeValue: { classPropertyName: "rangeValue", publicName: "rangeValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", rangeValue: "rangeValueChange" }, host: { properties: { "style.--thumb-pos": "thumbPos()", "style.--fill-scale": "fillScale()", "style.--range-start-pos": "rangeStartPos()", "style.--range-end-pos": "rangeEndPos()", "style.--value-chars": "valueDisplayChars()", "class.gog-host--auto-width": "!fullWidth()" } }, ngImport: i0, template: "<div\r\n class=\"gog-slider gog-contained-layout\"\r\n [class.gog-slider--disabled]=\"isFullyDisabled()\"\r\n [class.gog-slider--thumb-hidden]=\"!showThumb()\"\r\n [class.gog-slider--vertical]=\"isVertical()\"\r\n [class.gog-slider--range]=\"range()\"\r\n>\r\n <div class=\"gog-slider__header\">\r\n @if (label()) {\r\n <label [attr.for]=\"range() ? null : inputId\" class=\"gog-slider__label\">{{ label() }}</label>\r\n }\r\n\r\n @if (showValue()) {\r\n <span class=\"gog-slider__value\">{{ range() ? rangeDisplayValue() : clampedValue() }}</span>\r\n }\r\n </div>\r\n\r\n <div class=\"gog-slider__track-container\">\r\n <div class=\"gog-slider__track\">\r\n <div class=\"gog-slider__fill\"></div>\r\n </div>\r\n\r\n @if (showThumb()) {\r\n @if (range()) {\r\n <div\r\n class=\"gog-slider__thumb gog-slider__thumb--start\"\r\n [class.gog-slider__thumb--disabled]=\"isStartDisabled()\"\r\n aria-hidden=\"true\"\r\n ></div>\r\n <div\r\n class=\"gog-slider__thumb gog-slider__thumb--end\"\r\n [class.gog-slider__thumb--disabled]=\"isEndDisabled()\"\r\n aria-hidden=\"true\"\r\n ></div>\r\n } @else {\r\n <div class=\"gog-slider__thumb\" aria-hidden=\"true\"></div>\r\n }\r\n }\r\n\r\n @if (range()) {\r\n <!--\r\n Both inputs' `min`/`max` stay pinned to the slider's own global min()/max(), even\r\n though each thumb can't actually reach past the other one (enforced in\r\n onRangeStart/EndInput instead). Narrowing a native input's own `min`/`max` attribute\r\n to the other thumb's value would seem like free crossing-prevention, but it also\r\n shifts where the browser positions that input's own (invisible) native thumb inside\r\n its box \u2014 off of the box's own start()/end() percentage that --range-start-pos /\r\n --range-end-pos and this file's custom thumb divs use, so the two would drift apart\r\n and the real, clickable native thumb would stop lining up with what's drawn on\r\n screen. `aria-valuemin`/`aria-valuemax` below are fine to narrow dynamically \u2014\r\n they're just announced text, not something the browser positions anything from.\r\n -->\r\n <input\r\n [id]=\"inputId\"\r\n class=\"gog-slider__input gog-slider__input--start\"\r\n type=\"range\"\r\n [attr.aria-label]=\"startInputAriaLabel()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"clampedRange().end\"\r\n [attr.aria-valuenow]=\"clampedRange().start\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedRange().start\"\r\n [disabled]=\"isStartDisabled()\"\r\n (input)=\"onRangeStartInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <input\r\n class=\"gog-slider__input gog-slider__input--end\"\r\n type=\"range\"\r\n [attr.aria-label]=\"endInputAriaLabel()\"\r\n [attr.aria-valuemin]=\"clampedRange().start\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"clampedRange().end\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedRange().end\"\r\n [disabled]=\"isEndDisabled()\"\r\n (input)=\"onRangeEndInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n } @else {\r\n <input\r\n [id]=\"inputId\"\r\n class=\"gog-slider__input\"\r\n type=\"range\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || 'Slider'\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"clampedValue()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedValue()\"\r\n [disabled]=\"isDisabled()\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n }\r\n </div>\r\n\r\n <div class=\"gog-slider__range-labels\">\r\n <span>{{ min() }}</span>\r\n <span>{{ max() }}</span>\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-slider__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:var(--gog-slider-auto-width)}.gog-slider{display:flex;flex-direction:column;gap:var(--gog-slider-gap);width:100%}.gog-slider--disabled{opacity:var(--gog-slider-disabled-opacity);pointer-events:none}.gog-slider--thumb-hidden .gog-slider__thumb{display:none}.gog-slider__header{display:flex;align-items:center;justify-content:space-between}.gog-slider__label{font-family:var(--gog-slider-label-font-family);font-size:var(--gog-slider-label-font-size);color:var(--gog-slider-label-color);text-transform:var(--gog-slider-label-text-transform);letter-spacing:var(--gog-slider-label-letter-spacing)}.gog-slider__value{min-width:max(var(--gog-slider-value-min-width),var(--value-chars, 0) * 1ch);font-family:var(--gog-slider-value-font-family);font-size:var(--gog-slider-value-font-size);font-variant-numeric:tabular-nums;color:var(--gog-slider-value-color);text-align:right}.gog-slider__track-container{position:relative;display:flex;align-items:center;height:var(--gog-slider-track-area-height)}.gog-slider__track{position:absolute;inset-inline:0;height:var(--gog-slider-track-height);border:var(--gog-slider-track-border-width) var(--gog-slider-track-border-style) var(--gog-slider-track-border-color);border-radius:var(--gog-slider-track-radius);overflow:hidden;background-color:var(--gog-slider-track-bg);pointer-events:none;box-sizing:border-box}.gog-slider__fill{width:100%;height:100%;background:var(--gog-slider-fill-bg);transform:scaleX(var(--fill-scale, 0));transform-origin:left center;will-change:transform}.gog-slider__thumb{position:absolute;top:50%;left:var(--thumb-pos, 0%);width:var(--gog-slider-thumb-size);height:var(--gog-slider-thumb-size);border:var(--gog-slider-thumb-border-width) solid var(--gog-slider-thumb-border);border-radius:var(--gog-slider-thumb-radius);background-color:var(--gog-slider-thumb-bg);pointer-events:none;translate:-50% -50%;will-change:translate;box-shadow:0 0 var(--gog-slider-thumb-glow-size) var(--gog-slider-thumb-shadow)}.gog-slider__track-container:focus-within .gog-slider__thumb{box-shadow:0 0 0 var(--gog-slider-focus-ring-width) var(--gog-slider-focus-ring),0 0 var(--gog-slider-thumb-glow-size) var(--gog-slider-thumb-shadow)}.gog-slider__input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;outline:none}.gog-slider__input:disabled{cursor:not-allowed}.gog-slider--range .gog-slider__input{pointer-events:none}.gog-slider--range .gog-slider__input::-webkit-slider-thumb{pointer-events:auto}.gog-slider--range .gog-slider__input::-moz-range-thumb{pointer-events:auto}.gog-slider--range .gog-slider__fill{position:absolute;inset:0;width:auto;height:auto;transform:none}.gog-slider--range:not(.gog-slider--vertical) .gog-slider__fill{left:var(--range-start-pos, 0%);right:calc(100% - var(--range-end-pos, 100%))}.gog-slider--range .gog-slider__thumb--start{left:var(--range-start-pos, 0%)}.gog-slider--range .gog-slider__thumb--end{left:var(--range-end-pos, 100%)}.gog-slider__thumb--disabled{opacity:var(--gog-slider-disabled-opacity)}.gog-slider__range-labels{display:flex;justify-content:space-between;font-family:var(--gog-slider-value-font-family);font-size:var(--gog-slider-range-font-size);color:var(--gog-slider-range-color)}.gog-slider__error{font-family:var(--gog-slider-error-font-family);font-size:var(--gog-slider-error-font-size);color:var(--gog-slider-error-color)}@media(prefers-reduced-motion:reduce){.gog-slider__fill,.gog-slider__thumb{will-change:auto}}.gog-slider--vertical{width:fit-content}.gog-slider--vertical .gog-slider__track-container{height:var(--gog-slider-vertical-length);width:var(--gog-slider-track-area-height)}.gog-slider--vertical .gog-slider__track{inset-inline:auto;inset-block:0;left:50%;translate:-50% 0;width:var(--gog-slider-track-height);height:100%}.gog-slider--vertical .gog-slider__fill{transform:scaleY(var(--fill-scale, 0));transform-origin:bottom center}.gog-slider--vertical .gog-slider__thumb{top:calc(100% - var(--thumb-pos, 0%));left:50%}.gog-slider--vertical.gog-slider--range .gog-slider__fill{transform:none;top:calc(100% - var(--range-end-pos, 100%));bottom:var(--range-start-pos, 0%);left:0;right:0}.gog-slider--vertical.gog-slider--range .gog-slider__thumb--start{top:calc(100% - var(--range-start-pos, 0%));left:50%}.gog-slider--vertical.gog-slider--range .gog-slider__thumb--end{top:calc(100% - var(--range-end-pos, 100%));left:50%}.gog-slider--vertical .gog-slider__input{writing-mode:vertical-lr;direction:rtl}.gog-slider--vertical .gog-slider__range-labels{flex-direction:column-reverse;align-items:center;gap:2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6145
6771
|
}
|
|
6146
6772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SliderComponent, decorators: [{
|
|
6147
6773
|
type: Component,
|
|
6148
6774
|
args: [{ selector: 'gog-slider', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
6149
6775
|
'[style.--thumb-pos]': 'thumbPos()',
|
|
6150
6776
|
'[style.--fill-scale]': 'fillScale()',
|
|
6777
|
+
'[style.--range-start-pos]': 'rangeStartPos()',
|
|
6778
|
+
'[style.--range-end-pos]': 'rangeEndPos()',
|
|
6779
|
+
'[style.--value-chars]': 'valueDisplayChars()',
|
|
6151
6780
|
// Drives the :host(.gog-host--auto-width) rule in the stylesheet — without this
|
|
6152
6781
|
// binding the `fullWidth` input has no visible effect. Inverted from gog-button's
|
|
6153
6782
|
// full-width class: this control is full width by default, so the class only
|
|
6154
6783
|
// appears once a consumer opts *out* of that.
|
|
6155
6784
|
'[class.gog-host--auto-width]': '!fullWidth()',
|
|
6156
|
-
}, template: "<div\r\n class=\"gog-slider gog-contained-layout\"\r\n [class.gog-slider--disabled]=\"
|
|
6157
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], showThumb: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumb", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
6785
|
+
}, template: "<div\r\n class=\"gog-slider gog-contained-layout\"\r\n [class.gog-slider--disabled]=\"isFullyDisabled()\"\r\n [class.gog-slider--thumb-hidden]=\"!showThumb()\"\r\n [class.gog-slider--vertical]=\"isVertical()\"\r\n [class.gog-slider--range]=\"range()\"\r\n>\r\n <div class=\"gog-slider__header\">\r\n @if (label()) {\r\n <label [attr.for]=\"range() ? null : inputId\" class=\"gog-slider__label\">{{ label() }}</label>\r\n }\r\n\r\n @if (showValue()) {\r\n <span class=\"gog-slider__value\">{{ range() ? rangeDisplayValue() : clampedValue() }}</span>\r\n }\r\n </div>\r\n\r\n <div class=\"gog-slider__track-container\">\r\n <div class=\"gog-slider__track\">\r\n <div class=\"gog-slider__fill\"></div>\r\n </div>\r\n\r\n @if (showThumb()) {\r\n @if (range()) {\r\n <div\r\n class=\"gog-slider__thumb gog-slider__thumb--start\"\r\n [class.gog-slider__thumb--disabled]=\"isStartDisabled()\"\r\n aria-hidden=\"true\"\r\n ></div>\r\n <div\r\n class=\"gog-slider__thumb gog-slider__thumb--end\"\r\n [class.gog-slider__thumb--disabled]=\"isEndDisabled()\"\r\n aria-hidden=\"true\"\r\n ></div>\r\n } @else {\r\n <div class=\"gog-slider__thumb\" aria-hidden=\"true\"></div>\r\n }\r\n }\r\n\r\n @if (range()) {\r\n <!--\r\n Both inputs' `min`/`max` stay pinned to the slider's own global min()/max(), even\r\n though each thumb can't actually reach past the other one (enforced in\r\n onRangeStart/EndInput instead). Narrowing a native input's own `min`/`max` attribute\r\n to the other thumb's value would seem like free crossing-prevention, but it also\r\n shifts where the browser positions that input's own (invisible) native thumb inside\r\n its box \u2014 off of the box's own start()/end() percentage that --range-start-pos /\r\n --range-end-pos and this file's custom thumb divs use, so the two would drift apart\r\n and the real, clickable native thumb would stop lining up with what's drawn on\r\n screen. `aria-valuemin`/`aria-valuemax` below are fine to narrow dynamically \u2014\r\n they're just announced text, not something the browser positions anything from.\r\n -->\r\n <input\r\n [id]=\"inputId\"\r\n class=\"gog-slider__input gog-slider__input--start\"\r\n type=\"range\"\r\n [attr.aria-label]=\"startInputAriaLabel()\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"clampedRange().end\"\r\n [attr.aria-valuenow]=\"clampedRange().start\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedRange().start\"\r\n [disabled]=\"isStartDisabled()\"\r\n (input)=\"onRangeStartInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <input\r\n class=\"gog-slider__input gog-slider__input--end\"\r\n type=\"range\"\r\n [attr.aria-label]=\"endInputAriaLabel()\"\r\n [attr.aria-valuemin]=\"clampedRange().start\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"clampedRange().end\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedRange().end\"\r\n [disabled]=\"isEndDisabled()\"\r\n (input)=\"onRangeEndInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n } @else {\r\n <input\r\n [id]=\"inputId\"\r\n class=\"gog-slider__input\"\r\n type=\"range\"\r\n [attr.aria-label]=\"label() ? null : ariaLabel() || 'Slider'\"\r\n [attr.aria-valuemin]=\"min()\"\r\n [attr.aria-valuemax]=\"max()\"\r\n [attr.aria-valuenow]=\"clampedValue()\"\r\n [attr.aria-invalid]=\"hasError()\"\r\n [attr.aria-describedby]=\"errorId()\"\r\n [attr.aria-orientation]=\"isVertical() ? 'vertical' : null\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"clampedValue()\"\r\n [disabled]=\"isDisabled()\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n }\r\n </div>\r\n\r\n <div class=\"gog-slider__range-labels\">\r\n <span>{{ min() }}</span>\r\n <span>{{ max() }}</span>\r\n </div>\r\n\r\n @if (hasError()) {\r\n <span class=\"gog-slider__error\" [attr.id]=\"errorId()\" role=\"alert\">\r\n {{ visibleError() }}\r\n </span>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:block}:host(.gog-host--auto-width){width:var(--gog-slider-auto-width)}.gog-slider{display:flex;flex-direction:column;gap:var(--gog-slider-gap);width:100%}.gog-slider--disabled{opacity:var(--gog-slider-disabled-opacity);pointer-events:none}.gog-slider--thumb-hidden .gog-slider__thumb{display:none}.gog-slider__header{display:flex;align-items:center;justify-content:space-between}.gog-slider__label{font-family:var(--gog-slider-label-font-family);font-size:var(--gog-slider-label-font-size);color:var(--gog-slider-label-color);text-transform:var(--gog-slider-label-text-transform);letter-spacing:var(--gog-slider-label-letter-spacing)}.gog-slider__value{min-width:max(var(--gog-slider-value-min-width),var(--value-chars, 0) * 1ch);font-family:var(--gog-slider-value-font-family);font-size:var(--gog-slider-value-font-size);font-variant-numeric:tabular-nums;color:var(--gog-slider-value-color);text-align:right}.gog-slider__track-container{position:relative;display:flex;align-items:center;height:var(--gog-slider-track-area-height)}.gog-slider__track{position:absolute;inset-inline:0;height:var(--gog-slider-track-height);border:var(--gog-slider-track-border-width) var(--gog-slider-track-border-style) var(--gog-slider-track-border-color);border-radius:var(--gog-slider-track-radius);overflow:hidden;background-color:var(--gog-slider-track-bg);pointer-events:none;box-sizing:border-box}.gog-slider__fill{width:100%;height:100%;background:var(--gog-slider-fill-bg);transform:scaleX(var(--fill-scale, 0));transform-origin:left center;will-change:transform}.gog-slider__thumb{position:absolute;top:50%;left:var(--thumb-pos, 0%);width:var(--gog-slider-thumb-size);height:var(--gog-slider-thumb-size);border:var(--gog-slider-thumb-border-width) solid var(--gog-slider-thumb-border);border-radius:var(--gog-slider-thumb-radius);background-color:var(--gog-slider-thumb-bg);pointer-events:none;translate:-50% -50%;will-change:translate;box-shadow:0 0 var(--gog-slider-thumb-glow-size) var(--gog-slider-thumb-shadow)}.gog-slider__track-container:focus-within .gog-slider__thumb{box-shadow:0 0 0 var(--gog-slider-focus-ring-width) var(--gog-slider-focus-ring),0 0 var(--gog-slider-thumb-glow-size) var(--gog-slider-thumb-shadow)}.gog-slider__input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;outline:none}.gog-slider__input:disabled{cursor:not-allowed}.gog-slider--range .gog-slider__input{pointer-events:none}.gog-slider--range .gog-slider__input::-webkit-slider-thumb{pointer-events:auto}.gog-slider--range .gog-slider__input::-moz-range-thumb{pointer-events:auto}.gog-slider--range .gog-slider__fill{position:absolute;inset:0;width:auto;height:auto;transform:none}.gog-slider--range:not(.gog-slider--vertical) .gog-slider__fill{left:var(--range-start-pos, 0%);right:calc(100% - var(--range-end-pos, 100%))}.gog-slider--range .gog-slider__thumb--start{left:var(--range-start-pos, 0%)}.gog-slider--range .gog-slider__thumb--end{left:var(--range-end-pos, 100%)}.gog-slider__thumb--disabled{opacity:var(--gog-slider-disabled-opacity)}.gog-slider__range-labels{display:flex;justify-content:space-between;font-family:var(--gog-slider-value-font-family);font-size:var(--gog-slider-range-font-size);color:var(--gog-slider-range-color)}.gog-slider__error{font-family:var(--gog-slider-error-font-family);font-size:var(--gog-slider-error-font-size);color:var(--gog-slider-error-color)}@media(prefers-reduced-motion:reduce){.gog-slider__fill,.gog-slider__thumb{will-change:auto}}.gog-slider--vertical{width:fit-content}.gog-slider--vertical .gog-slider__track-container{height:var(--gog-slider-vertical-length);width:var(--gog-slider-track-area-height)}.gog-slider--vertical .gog-slider__track{inset-inline:auto;inset-block:0;left:50%;translate:-50% 0;width:var(--gog-slider-track-height);height:100%}.gog-slider--vertical .gog-slider__fill{transform:scaleY(var(--fill-scale, 0));transform-origin:bottom center}.gog-slider--vertical .gog-slider__thumb{top:calc(100% - var(--thumb-pos, 0%));left:50%}.gog-slider--vertical.gog-slider--range .gog-slider__fill{transform:none;top:calc(100% - var(--range-end-pos, 100%));bottom:var(--range-start-pos, 0%);left:0;right:0}.gog-slider--vertical.gog-slider--range .gog-slider__thumb--start{top:calc(100% - var(--range-start-pos, 0%));left:50%}.gog-slider--vertical.gog-slider--range .gog-slider__thumb--end{top:calc(100% - var(--range-end-pos, 100%));left:50%}.gog-slider--vertical .gog-slider__input{writing-mode:vertical-lr;direction:rtl}.gog-slider--vertical .gog-slider__range-labels{flex-direction:column-reverse;align-items:center;gap:2px}\n"] }]
|
|
6786
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], showThumb: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumb", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDisplay", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], startAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAriaLabel", required: false }] }], endAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "endAriaLabel", required: false }] }], startDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "startDisabled", required: false }] }], endDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "endDisabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], rangeValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeValue", required: false }] }, { type: i0.Output, args: ["rangeValueChange"] }] } });
|
|
6158
6787
|
|
|
6788
|
+
/** Built-in defaults, used when neither the instance input nor `GOG_CONFIG.labels` supplies one. */
|
|
6789
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
6790
|
+
const DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 30, 40, 50];
|
|
6791
|
+
/** Off by default: a paginator that silently grew a control would change every existing layout. */
|
|
6792
|
+
const DEFAULT_SHOW_PAGE_SIZE_SELECT = false;
|
|
6793
|
+
const DEFAULT_LABELS$1 = {
|
|
6794
|
+
pagination: 'Pagination',
|
|
6795
|
+
previousPage: 'Previous page',
|
|
6796
|
+
nextPage: 'Next page',
|
|
6797
|
+
rowsPerPage: 'Rows per page',
|
|
6798
|
+
page: (page, isCurrent) => isCurrent ? `Page ${page}, current page` : `Go to page ${page}`,
|
|
6799
|
+
};
|
|
6159
6800
|
class PaginatorComponent {
|
|
6160
6801
|
/** 1-based current page. Two-way bindable: `[(page)]="myPageSignal"`. */
|
|
6161
6802
|
page = model(1, ...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
@@ -6164,7 +6805,35 @@ class PaginatorComponent {
|
|
|
6164
6805
|
* buttons instead.
|
|
6165
6806
|
*/
|
|
6166
6807
|
fullWidth = input(true, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
6808
|
+
/**
|
|
6809
|
+
* How many pages there are. Ignored when `totalRecords` is given — see there.
|
|
6810
|
+
*/
|
|
6167
6811
|
totalPages = input(1, ...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
6812
|
+
/**
|
|
6813
|
+
* How many rows exist in total. Given this, the paginator computes the page count itself from
|
|
6814
|
+
* `pageSize`, which is what removes the `computed(() => Math.ceil(total / size))` a consumer
|
|
6815
|
+
* would otherwise have to write and keep in sync with the select below.
|
|
6816
|
+
*
|
|
6817
|
+
* `null` (the default) keeps the old contract: you tell it `totalPages` directly.
|
|
6818
|
+
*/
|
|
6819
|
+
totalRecords = input(null, ...(ngDevMode ? [{ debugName: "totalRecords" }] : /* istanbul ignore next */ []));
|
|
6820
|
+
/**
|
|
6821
|
+
* Rows per page. Two-way bindable — `[(pageSize)]="size"` — which is the whole point once
|
|
6822
|
+
* `showPageSizeSelect` is on: the select writes back through this, and nothing has to be
|
|
6823
|
+
* ferried between components by hand. `gog-table` binds its own `pageSize` model straight to
|
|
6824
|
+
* this one.
|
|
6825
|
+
*/
|
|
6826
|
+
pageSize = model(DEFAULT_PAGE_SIZE, ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
6827
|
+
/**
|
|
6828
|
+
* Whether to offer the rows-per-page select. Unset, falls back to
|
|
6829
|
+
* `GOG_CONFIG.paginator.showPageSizeSelect`, then to `false`.
|
|
6830
|
+
*/
|
|
6831
|
+
showPageSizeSelect = input(undefined, ...(ngDevMode ? [{ debugName: "showPageSizeSelect" }] : /* istanbul ignore next */ []));
|
|
6832
|
+
/**
|
|
6833
|
+
* The choices the select offers. Unset, falls back to
|
|
6834
|
+
* `GOG_CONFIG.paginator.pageSizeOptions`, then to `[10, 20, 30, 40, 50]`.
|
|
6835
|
+
*/
|
|
6836
|
+
pageSizeOptions = input(undefined, ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
6168
6837
|
/**
|
|
6169
6838
|
* `window` (default): a fixed number of page buttons (`visiblePages`) that slides to keep
|
|
6170
6839
|
* the current page centered, clamped at the edges — no ellipsis, no pinned boundaries
|
|
@@ -6184,20 +6853,65 @@ class PaginatorComponent {
|
|
|
6184
6853
|
siblingCount = input(2, ...(ngDevMode ? [{ debugName: "siblingCount" }] : /* istanbul ignore next */ []));
|
|
6185
6854
|
size = input('sm', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
6186
6855
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
6187
|
-
|
|
6856
|
+
/**
|
|
6857
|
+
* Accessible name of the `<nav>`. Unset, falls back to `GOG_CONFIG.labels.pagination`, then
|
|
6858
|
+
* to `'Pagination'`.
|
|
6859
|
+
*/
|
|
6860
|
+
ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
6861
|
+
globalConfig = inject(GOG_CONFIG);
|
|
6862
|
+
/** Instance input → `GOG_CONFIG.labels` → the built-in English default. */
|
|
6863
|
+
resolvedAriaLabel = computed(() => resolveConfigured(this.ariaLabel(), this.globalConfig.labels?.pagination, DEFAULT_LABELS$1.pagination), ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
6864
|
+
/**
|
|
6865
|
+
* The two step buttons. Config-only: unlike the `<nav>` name, these say the same thing on
|
|
6866
|
+
* every paginator in an app, so a per-instance input would be dead weight.
|
|
6867
|
+
*/
|
|
6868
|
+
resolvedPreviousLabel = computed(() => resolveConfigured(undefined, this.globalConfig.labels?.previousPage, DEFAULT_LABELS$1.previousPage), ...(ngDevMode ? [{ debugName: "resolvedPreviousLabel" }] : /* istanbul ignore next */ []));
|
|
6869
|
+
resolvedNextLabel = computed(() => resolveConfigured(undefined, this.globalConfig.labels?.nextPage, DEFAULT_LABELS$1.nextPage), ...(ngDevMode ? [{ debugName: "resolvedNextLabel" }] : /* istanbul ignore next */ []));
|
|
6870
|
+
/**
|
|
6871
|
+
* Names one page button. A method rather than a `computed`, since it takes the page number —
|
|
6872
|
+
* the formatter itself is resolved once and only re-read when the config object changes.
|
|
6873
|
+
*/
|
|
6874
|
+
pageLabel(page) {
|
|
6875
|
+
const format = this.globalConfig.labels?.page ?? DEFAULT_LABELS$1.page;
|
|
6876
|
+
return format(page, page === this.page());
|
|
6877
|
+
}
|
|
6878
|
+
resolvedShowPageSizeSelect = computed(() => resolveConfigured(this.showPageSizeSelect(), this.globalConfig.paginator?.showPageSizeSelect, DEFAULT_SHOW_PAGE_SIZE_SELECT), ...(ngDevMode ? [{ debugName: "resolvedShowPageSizeSelect" }] : /* istanbul ignore next */ []));
|
|
6879
|
+
resolvedRowsPerPageLabel = computed(() => resolveConfigured(undefined, this.globalConfig.labels?.rowsPerPage, DEFAULT_LABELS$1.rowsPerPage), ...(ngDevMode ? [{ debugName: "resolvedRowsPerPageLabel" }] : /* istanbul ignore next */ []));
|
|
6880
|
+
/**
|
|
6881
|
+
* The select takes `{ id, name }` objects because that is `GogDropdownOption`'s default shape —
|
|
6882
|
+
* `optionLabel`/`optionValue` accessors for a list of plain numbers would be more API than the
|
|
6883
|
+
* mapping saves. The current `pageSize` is included even when it is not one of the offered
|
|
6884
|
+
* options, so a programmatic `[pageSize]="15"` shows 15 rather than an empty trigger.
|
|
6885
|
+
*/
|
|
6886
|
+
resolvedPageSizeOptions = computed(() => {
|
|
6887
|
+
const options = resolveConfigured(this.pageSizeOptions(), this.globalConfig.paginator?.pageSizeOptions, DEFAULT_PAGE_SIZE_OPTIONS);
|
|
6888
|
+
const current = this.pageSize();
|
|
6889
|
+
const all = options.includes(current) ? options : [...options, current].sort((a, b) => a - b);
|
|
6890
|
+
return all.map((size) => ({ id: size, name: String(size) }));
|
|
6891
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedPageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
6892
|
+
/**
|
|
6893
|
+
* `totalRecords` when supplied, `totalPages` otherwise — every internal read goes through this
|
|
6894
|
+
* so the two inputs cannot disagree anywhere.
|
|
6895
|
+
*/
|
|
6896
|
+
resolvedTotalPages = computed(() => {
|
|
6897
|
+
const records = this.totalRecords();
|
|
6898
|
+
if (records === null)
|
|
6899
|
+
return Math.max(1, this.totalPages());
|
|
6900
|
+
return Math.max(1, Math.ceil(Math.max(0, records) / Math.max(1, this.pageSize())));
|
|
6901
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedTotalPages" }] : /* istanbul ignore next */ []));
|
|
6188
6902
|
pageNumbers = computed(() => {
|
|
6189
|
-
const total =
|
|
6903
|
+
const total = this.resolvedTotalPages();
|
|
6190
6904
|
const current = this.page();
|
|
6191
6905
|
return this.rangeMode() === 'ellipsis'
|
|
6192
6906
|
? this.ellipsisRange(total, current)
|
|
6193
6907
|
: this.windowRange(total, current);
|
|
6194
6908
|
}, ...(ngDevMode ? [{ debugName: "pageNumbers" }] : /* istanbul ignore next */ []));
|
|
6195
6909
|
constructor() {
|
|
6196
|
-
// Self-clamps whenever
|
|
6910
|
+
// Self-clamps whenever the page count shrinks below the current page (or a consumer
|
|
6197
6911
|
// passes an out-of-range value directly), so every consumer gets correct bounds for
|
|
6198
6912
|
// free instead of reimplementing this per usage.
|
|
6199
6913
|
effect(() => {
|
|
6200
|
-
const total =
|
|
6914
|
+
const total = this.resolvedTotalPages();
|
|
6201
6915
|
const current = this.page();
|
|
6202
6916
|
if (current > total) {
|
|
6203
6917
|
this.page.set(total);
|
|
@@ -6206,6 +6920,26 @@ class PaginatorComponent {
|
|
|
6206
6920
|
this.page.set(1);
|
|
6207
6921
|
}
|
|
6208
6922
|
});
|
|
6923
|
+
/*
|
|
6924
|
+
* A new page size invalidates the current page: "page 5" of 10-row pages is not "page 5" of
|
|
6925
|
+
* 50-row ones, and clamping alone would leave the user somewhere they did not ask to be.
|
|
6926
|
+
* Back to page 1, which is the only position that means the same thing at every size.
|
|
6927
|
+
* `untracked` so this reacts to the size and not to its own write.
|
|
6928
|
+
*/
|
|
6929
|
+
let previousSize = null;
|
|
6930
|
+
effect(() => {
|
|
6931
|
+
const size = this.pageSize();
|
|
6932
|
+
// Guarded on an actual change, not on the effect running: the first run must leave an
|
|
6933
|
+
// initial `[page]="3"` alone, and re-running for an unrelated dependency must not snap the
|
|
6934
|
+
// user back to page 1.
|
|
6935
|
+
if (previousSize !== null && previousSize !== size) {
|
|
6936
|
+
untracked(() => {
|
|
6937
|
+
if (this.page() !== 1)
|
|
6938
|
+
this.page.set(1);
|
|
6939
|
+
});
|
|
6940
|
+
}
|
|
6941
|
+
previousSize = size;
|
|
6942
|
+
});
|
|
6209
6943
|
}
|
|
6210
6944
|
windowRange(total, current) {
|
|
6211
6945
|
const windowSize = Math.min(Math.max(1, this.visiblePages()), total);
|
|
@@ -6243,7 +6977,7 @@ class PaginatorComponent {
|
|
|
6243
6977
|
return typeof value === 'number';
|
|
6244
6978
|
}
|
|
6245
6979
|
goTo(target) {
|
|
6246
|
-
if (this.disabled() || target < 1 || target > this.
|
|
6980
|
+
if (this.disabled() || target < 1 || target > this.resolvedTotalPages())
|
|
6247
6981
|
return;
|
|
6248
6982
|
this.page.set(target);
|
|
6249
6983
|
}
|
|
@@ -6253,22 +6987,26 @@ class PaginatorComponent {
|
|
|
6253
6987
|
next() {
|
|
6254
6988
|
this.goTo(this.page() + 1);
|
|
6255
6989
|
}
|
|
6990
|
+
onPageSizeChange(size) {
|
|
6991
|
+
if (size !== null)
|
|
6992
|
+
this.pageSize.set(size);
|
|
6993
|
+
}
|
|
6256
6994
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6257
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: PaginatorComponent, isStandalone: true, selector: "gog-paginator", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: false, transformFunction: null }, rangeMode: { classPropertyName: "rangeMode", publicName: "rangeMode", isSignal: true, isRequired: false, transformFunction: null }, visiblePages: { classPropertyName: "visiblePages", publicName: "visiblePages", isSignal: true, isRequired: false, transformFunction: null }, showFirstPage: { classPropertyName: "showFirstPage", publicName: "showFirstPage", isSignal: true, isRequired: false, transformFunction: null }, showLastPage: { classPropertyName: "showLastPage", publicName: "showLastPage", isSignal: true, isRequired: false, transformFunction: null }, siblingCount: { classPropertyName: "siblingCount", publicName: "siblingCount", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange" }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "
|
|
6995
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: PaginatorComponent, isStandalone: true, selector: "gog-paginator", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelect: { classPropertyName: "showPageSizeSelect", publicName: "showPageSizeSelect", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, rangeMode: { classPropertyName: "rangeMode", publicName: "rangeMode", isSignal: true, isRequired: false, transformFunction: null }, visiblePages: { classPropertyName: "visiblePages", publicName: "visiblePages", isSignal: true, isRequired: false, transformFunction: null }, showFirstPage: { classPropertyName: "showFirstPage", publicName: "showFirstPage", isSignal: true, isRequired: false, transformFunction: null }, showLastPage: { classPropertyName: "showLastPage", publicName: "showLastPage", isSignal: true, isRequired: false, transformFunction: null }, siblingCount: { classPropertyName: "siblingCount", publicName: "siblingCount", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", pageSize: "pageSizeChange" }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "resolvedAriaLabel()", "class.gog-host--auto-width": "!fullWidth()" }, classAttribute: "gog-paginator" }, ngImport: i0, template: "<gog-button\r\n variant=\"ghost\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || page() === 1\"\r\n [ariaLabel]=\"resolvedPreviousLabel()\"\r\n (gogClick)=\"prev()\"\r\n >\u2039</gog-button\r\n>\r\n\r\n@for (item of pageNumbers(); track $index) {\r\n @if (isNumber(item)) {\r\n <gog-button\r\n [size]=\"size()\"\r\n [variant]=\"item === page() ? 'primary' : 'ghost'\"\r\n [disabled]=\"disabled()\"\r\n [ariaLabel]=\"pageLabel(item)\"\r\n (gogClick)=\"goTo(item)\"\r\n >{{ item }}</gog-button\r\n >\r\n } @else {\r\n <span class=\"gog-paginator__ellipsis\">\u2026</span>\r\n }\r\n}\r\n\r\n<gog-button\r\n variant=\"ghost\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || page() === resolvedTotalPages()\"\r\n [ariaLabel]=\"resolvedNextLabel()\"\r\n (gogClick)=\"next()\"\r\n >\u203A</gog-button\r\n>\r\n\r\n@if (resolvedShowPageSizeSelect()) {\r\n <!--\r\n Bound with `[(pageSize)]`'s writable half, so choosing a size writes straight back through the\r\n model the consumer bound \u2014 there is no intermediate state to keep in sync. `fullWidth` off so\r\n the select sizes to its content instead of stretching the paginator row.\r\n\r\n A plain `@if`, not `@defer`, and that was measured rather than assumed: `@defer` does move\r\n `SelectComponent` out of this component's static `dependencies` and into\r\n `deferBlockDependencies`, but ng-packagr flattens the whole library into one FESM, so the\r\n deferred reference compiles to `Promise.resolve().then(() => select_component)` \u2014 a binding in\r\n the *same module*, not a dynamic `import()`. With no import boundary there is nothing for a\r\n bundler to split on and nothing it may drop, so the consumer ships exactly the same bytes,\r\n minus a placeholder and an SSR pop-in. Making this genuinely lazy needs secondary entry\r\n points (`@guildofgleks/ui/select`), which is a packaging decision, not a template one.\r\n -->\r\n <gog-select\r\n class=\"gog-paginator__page-size\"\r\n [options]=\"resolvedPageSizeOptions()\"\r\n [value]=\"pageSize()\"\r\n [disabled]=\"disabled()\"\r\n [fullWidth]=\"false\"\r\n [size]=\"size()\"\r\n [ariaLabel]=\"resolvedRowsPerPageLabel()\"\r\n (valueChange)=\"onPageSizeChange($event)\"\r\n />\r\n}\r\n", styles: [":host{display:flex;align-items:center;gap:var(--gog-paginator-gap);flex-wrap:wrap}:host(.gog-host--auto-width){width:fit-content}.gog-paginator__ellipsis{display:inline-flex;align-items:center;justify-content:center;min-width:var(--gog-paginator-ellipsis-min-width);color:var(--gog-paginator-ellipsis-color);font-family:var(--gog-paginator-ellipsis-font-family);font-size:var(--gog-paginator-ellipsis-font-size);-webkit-user-select:none;user-select:none}.gog-paginator__page-size{margin-inline-start:auto;min-width:var(--gog-paginator-page-size-min-width)}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "gog-button", inputs: ["variant", "size", "disabled", "fullWidth", "type", "loading", "debounce", "ariaLabel"], outputs: ["gogClick"] }, { kind: "component", type: SelectComponent, selector: "gog-select", inputs: ["inputId", "value"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6258
6996
|
}
|
|
6259
6997
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
6260
6998
|
type: Component,
|
|
6261
|
-
args: [{ selector: 'gog-paginator', imports: [ButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
6999
|
+
args: [{ selector: 'gog-paginator', imports: [ButtonComponent, SelectComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
6262
7000
|
class: 'gog-paginator',
|
|
6263
7001
|
role: 'navigation',
|
|
6264
|
-
'[attr.aria-label]': '
|
|
7002
|
+
'[attr.aria-label]': 'resolvedAriaLabel()',
|
|
6265
7003
|
// Drives the :host(.gog-host--auto-width) rule in the stylesheet — without this
|
|
6266
7004
|
// binding the `fullWidth` input has no visible effect. Inverted from gog-button's
|
|
6267
7005
|
// full-width class: this control is full width by default, so the class only
|
|
6268
7006
|
// appears once a consumer opts *out* of that.
|
|
6269
7007
|
'[class.gog-host--auto-width]': '!fullWidth()',
|
|
6270
|
-
}, template: "<gog-button\r\n variant=\"ghost\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || page() === 1\"\r\n ariaLabel=\"
|
|
6271
|
-
}], ctorParameters: () => [], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: false }] }], rangeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeMode", required: false }] }], visiblePages: [{ type: i0.Input, args: [{ isSignal: true, alias: "visiblePages", required: false }] }], showFirstPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstPage", required: false }] }], showLastPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLastPage", required: false }] }], siblingCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblingCount", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
7008
|
+
}, template: "<gog-button\r\n variant=\"ghost\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || page() === 1\"\r\n [ariaLabel]=\"resolvedPreviousLabel()\"\r\n (gogClick)=\"prev()\"\r\n >\u2039</gog-button\r\n>\r\n\r\n@for (item of pageNumbers(); track $index) {\r\n @if (isNumber(item)) {\r\n <gog-button\r\n [size]=\"size()\"\r\n [variant]=\"item === page() ? 'primary' : 'ghost'\"\r\n [disabled]=\"disabled()\"\r\n [ariaLabel]=\"pageLabel(item)\"\r\n (gogClick)=\"goTo(item)\"\r\n >{{ item }}</gog-button\r\n >\r\n } @else {\r\n <span class=\"gog-paginator__ellipsis\">\u2026</span>\r\n }\r\n}\r\n\r\n<gog-button\r\n variant=\"ghost\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || page() === resolvedTotalPages()\"\r\n [ariaLabel]=\"resolvedNextLabel()\"\r\n (gogClick)=\"next()\"\r\n >\u203A</gog-button\r\n>\r\n\r\n@if (resolvedShowPageSizeSelect()) {\r\n <!--\r\n Bound with `[(pageSize)]`'s writable half, so choosing a size writes straight back through the\r\n model the consumer bound \u2014 there is no intermediate state to keep in sync. `fullWidth` off so\r\n the select sizes to its content instead of stretching the paginator row.\r\n\r\n A plain `@if`, not `@defer`, and that was measured rather than assumed: `@defer` does move\r\n `SelectComponent` out of this component's static `dependencies` and into\r\n `deferBlockDependencies`, but ng-packagr flattens the whole library into one FESM, so the\r\n deferred reference compiles to `Promise.resolve().then(() => select_component)` \u2014 a binding in\r\n the *same module*, not a dynamic `import()`. With no import boundary there is nothing for a\r\n bundler to split on and nothing it may drop, so the consumer ships exactly the same bytes,\r\n minus a placeholder and an SSR pop-in. Making this genuinely lazy needs secondary entry\r\n points (`@guildofgleks/ui/select`), which is a packaging decision, not a template one.\r\n -->\r\n <gog-select\r\n class=\"gog-paginator__page-size\"\r\n [options]=\"resolvedPageSizeOptions()\"\r\n [value]=\"pageSize()\"\r\n [disabled]=\"disabled()\"\r\n [fullWidth]=\"false\"\r\n [size]=\"size()\"\r\n [ariaLabel]=\"resolvedRowsPerPageLabel()\"\r\n (valueChange)=\"onPageSizeChange($event)\"\r\n />\r\n}\r\n", styles: [":host{display:flex;align-items:center;gap:var(--gog-paginator-gap);flex-wrap:wrap}:host(.gog-host--auto-width){width:fit-content}.gog-paginator__ellipsis{display:inline-flex;align-items:center;justify-content:center;min-width:var(--gog-paginator-ellipsis-min-width);color:var(--gog-paginator-ellipsis-color);font-family:var(--gog-paginator-ellipsis-font-family);font-size:var(--gog-paginator-ellipsis-font-size);-webkit-user-select:none;user-select:none}.gog-paginator__page-size{margin-inline-start:auto;min-width:var(--gog-paginator-page-size-min-width)}\n"] }]
|
|
7009
|
+
}], ctorParameters: () => [], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], showPageSizeSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSizeSelect", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], rangeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeMode", required: false }] }], visiblePages: [{ type: i0.Input, args: [{ isSignal: true, alias: "visiblePages", required: false }] }], showFirstPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstPage", required: false }] }], showLastPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLastPage", required: false }] }], siblingCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblingCount", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
6272
7010
|
|
|
6273
7011
|
class SpinnerOverlayComponent {
|
|
6274
7012
|
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
@@ -6422,6 +7160,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6422
7160
|
}]
|
|
6423
7161
|
}], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
6424
7162
|
|
|
7163
|
+
/** Built-in defaults, used when `GOG_CONFIG.labels` doesn't supply one. */
|
|
7164
|
+
const DEFAULT_LABELS = {
|
|
7165
|
+
total: 'Total',
|
|
7166
|
+
pagination: 'Table pagination',
|
|
7167
|
+
selectRow: 'Select row',
|
|
7168
|
+
selectAllRows: 'Select all rows on this page',
|
|
7169
|
+
};
|
|
6425
7170
|
class TableComponent {
|
|
6426
7171
|
/**
|
|
6427
7172
|
* The single size modifier, replacing one `[class.gog-table--<size>]` binding per size.
|
|
@@ -6434,8 +7179,96 @@ class TableComponent {
|
|
|
6434
7179
|
* its columns' content instead.
|
|
6435
7180
|
*/
|
|
6436
7181
|
fullWidth = input(true, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
6437
|
-
/**
|
|
6438
|
-
|
|
7182
|
+
/**
|
|
7183
|
+
* Rows per page; `0` (the default) means no pagination at all.
|
|
7184
|
+
*
|
|
7185
|
+
* A **`model`**, not an input, so `[pageSize]="20"` still works exactly as before *and*
|
|
7186
|
+
* `[(pageSize)]="size"` becomes possible. That is what lets `showPageSizeSelect` work without
|
|
7187
|
+
* any wiring: the table binds this model straight to its own paginator's `pageSize`, the
|
|
7188
|
+
* select writes back through it, and a consumer who wants to observe or persist the choice
|
|
7189
|
+
* binds two-way. Nothing is ferried between the two components by hand.
|
|
7190
|
+
*
|
|
7191
|
+
* In `lazy` mode a change here is a refetch signal, same as `gogPageChange` — bind
|
|
7192
|
+
* `[(pageSize)]` and reload from it. Changing the size always returns to page 1.
|
|
7193
|
+
*/
|
|
7194
|
+
pageSize = model(0, ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
7195
|
+
/**
|
|
7196
|
+
* Whether the paginator offers a rows-per-page select. Forwarded straight to `gog-paginator`;
|
|
7197
|
+
* unset, it falls back to `GOG_CONFIG.paginator.showPageSizeSelect`, then to `false`.
|
|
7198
|
+
*/
|
|
7199
|
+
showPageSizeSelect = input(undefined, ...(ngDevMode ? [{ debugName: "showPageSizeSelect" }] : /* istanbul ignore next */ []));
|
|
7200
|
+
/**
|
|
7201
|
+
* The sizes that select offers. Forwarded to `gog-paginator`; unset, falls back to
|
|
7202
|
+
* `GOG_CONFIG.paginator.pageSizeOptions`, then to `[10, 20, 30, 40, 50]`.
|
|
7203
|
+
*/
|
|
7204
|
+
pageSizeOptions = input(undefined, ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
7205
|
+
/**
|
|
7206
|
+
* Hands sorting and paging to the server.
|
|
7207
|
+
*
|
|
7208
|
+
* Off (the default), the table owns the whole data set: it sorts and slices `value` itself, and
|
|
7209
|
+
* `totalPages` comes from `value.length`. On, `value` is **the current page, already sorted** —
|
|
7210
|
+
* the table renders it as given and never re-orders or re-slices it. Supply `totalRecords` so
|
|
7211
|
+
* the paginator knows how many pages exist, and refetch in response to `gogSortChange` /
|
|
7212
|
+
* `gogPageChange`.
|
|
7213
|
+
*
|
|
7214
|
+
* ```html
|
|
7215
|
+
* <gog-table
|
|
7216
|
+
* [value]="page()"
|
|
7217
|
+
* [lazy]="true"
|
|
7218
|
+
* [totalRecords]="total()"
|
|
7219
|
+
* [pageSize]="20"
|
|
7220
|
+
* [loading]="loading()"
|
|
7221
|
+
* (gogSortChange)="sort.set($event); reload()"
|
|
7222
|
+
* (gogPageChange)="page$.set($event); reload()"
|
|
7223
|
+
* />
|
|
7224
|
+
* ```
|
|
7225
|
+
*/
|
|
7226
|
+
lazy = input(false, ...(ngDevMode ? [{ debugName: "lazy" }] : /* istanbul ignore next */ []));
|
|
7227
|
+
/**
|
|
7228
|
+
* How many rows exist on the server, across all pages. `lazy` only — without it the table
|
|
7229
|
+
* cannot know how many pages to offer, and pagination is disabled. Ignored when `lazy` is off,
|
|
7230
|
+
* where `value.length` is the truth.
|
|
7231
|
+
*/
|
|
7232
|
+
totalRecords = input(null, ...(ngDevMode ? [{ debugName: "totalRecords" }] : /* istanbul ignore next */ []));
|
|
7233
|
+
/**
|
|
7234
|
+
* Makes rows focusable and styles them as clickable, for a table whose rows navigate or open
|
|
7235
|
+
* something. `gogRowClick` fires on a plain click regardless; this is what makes that
|
|
7236
|
+
* affordance **discoverable and reachable by keyboard** (Enter and Space activate the focused
|
|
7237
|
+
* row), which a bare `(gogRowClick)` on a `<tr>` is not.
|
|
7238
|
+
*
|
|
7239
|
+
* If the row's action is better expressed as a control — a link to a detail page, a delete
|
|
7240
|
+
* button — put that in a cell instead. This is for the whole-row-is-the-target case.
|
|
7241
|
+
*/
|
|
7242
|
+
interactiveRows = input(false, ...(ngDevMode ? [{ debugName: "interactiveRows" }] : /* istanbul ignore next */ []));
|
|
7243
|
+
/**
|
|
7244
|
+
* Turns on row selection. `'single'` keeps at most one row selected, `'multiple'` any number.
|
|
7245
|
+
*
|
|
7246
|
+
* The selection itself is always a `T[]` (`[(selection)]`), including in `'single'` mode where
|
|
7247
|
+
* it holds zero or one row — one shape rather than a `T | T[] | null` union the consumer has to
|
|
7248
|
+
* narrow on every read.
|
|
7249
|
+
*/
|
|
7250
|
+
selectionMode = input('none', ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
|
|
7251
|
+
/**
|
|
7252
|
+
* Two-way bindable selected rows: `[(selection)]="selected"`.
|
|
7253
|
+
*
|
|
7254
|
+
* Rows are matched by `dataKey` when one is set, and by object identity otherwise — so with no
|
|
7255
|
+
* `dataKey`, a refetch that produces new objects drops the selection. In `lazy` mode that is
|
|
7256
|
+
* almost always the wrong behaviour: set `dataKey`.
|
|
7257
|
+
*/
|
|
7258
|
+
selection = model([], ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
7259
|
+
/**
|
|
7260
|
+
* Field name (or dot-path) uniquely identifying a row — `'id'` in most data sets.
|
|
7261
|
+
*
|
|
7262
|
+
* Used for selection identity and, when set, as the `@for` track key, which is what lets the
|
|
7263
|
+
* DOM survive a re-fetch of the same page instead of being torn down and rebuilt.
|
|
7264
|
+
*/
|
|
7265
|
+
dataKey = input('', ...(ngDevMode ? [{ debugName: "dataKey" }] : /* istanbul ignore next */ []));
|
|
7266
|
+
/**
|
|
7267
|
+
* Whether the checkbox column renders. On by default once `selectionMode` is set; turn it off
|
|
7268
|
+
* for a table that selects by clicking the row itself, and pair it with `interactiveRows` so
|
|
7269
|
+
* that stays reachable by keyboard.
|
|
7270
|
+
*/
|
|
7271
|
+
showSelectionColumn = input(true, ...(ngDevMode ? [{ debugName: "showSelectionColumn" }] : /* istanbul ignore next */ []));
|
|
6439
7272
|
showRowNumbers = input(true, ...(ngDevMode ? [{ debugName: "showRowNumbers" }] : /* istanbul ignore next */ []));
|
|
6440
7273
|
showTotal = input(false, ...(ngDevMode ? [{ debugName: "showTotal" }] : /* istanbul ignore next */ []));
|
|
6441
7274
|
emptyPlaceholder = input('-', ...(ngDevMode ? [{ debugName: "emptyPlaceholder" }] : /* istanbul ignore next */ []));
|
|
@@ -6451,10 +7284,30 @@ class TableComponent {
|
|
|
6451
7284
|
stickyHeader = input(false, ...(ngDevMode ? [{ debugName: "stickyHeader" }] : /* istanbul ignore next */ []));
|
|
6452
7285
|
/** Row density: lg (default) / md (compact) / sm (dense) */
|
|
6453
7286
|
size = input('lg', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
7287
|
+
/**
|
|
7288
|
+
* Fires when a header cell changes the sort — including the third click that clears it, which
|
|
7289
|
+
* emits `{ field: '', direction: null }`. In `lazy` mode this is the refetch signal; the table
|
|
7290
|
+
* has already reset to page 1 by the time it fires.
|
|
7291
|
+
*/
|
|
7292
|
+
gogSortChange = output();
|
|
7293
|
+
/**
|
|
7294
|
+
* Fires when the page changes, with the new 1-based page. Only ever fires for a *user* action
|
|
7295
|
+
* or a clamp — not for the initial render.
|
|
7296
|
+
*/
|
|
7297
|
+
gogPageChange = output();
|
|
7298
|
+
/** Fires when a row is clicked, or activated with Enter/Space when `interactiveRows` is on. */
|
|
7299
|
+
gogRowClick = output();
|
|
6454
7300
|
columns = contentChildren(GogColumn, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
6455
7301
|
templates = contentChildren(TemplateDirective, ...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
6456
7302
|
sortState = signal({ field: '', direction: null }, ...(ngDevMode ? [{ debugName: "sortState" }] : /* istanbul ignore next */ []));
|
|
7303
|
+
/**
|
|
7304
|
+
* In `lazy` mode `value` is the server's answer — already sorted, already the right page — so
|
|
7305
|
+
* both this and `visibleRows` become pass-throughs. Re-sorting it locally would reorder one
|
|
7306
|
+
* page against a global ordering, which looks like corruption rather than a bug.
|
|
7307
|
+
*/
|
|
6457
7308
|
sortedData = computed(() => {
|
|
7309
|
+
if (this.lazy())
|
|
7310
|
+
return this.value();
|
|
6458
7311
|
const { field, direction } = this.sortState();
|
|
6459
7312
|
const rows = [...this.value()];
|
|
6460
7313
|
if (!field || !direction)
|
|
@@ -6475,11 +7328,16 @@ class TableComponent {
|
|
|
6475
7328
|
return direction === 'asc' ? cmp : -cmp;
|
|
6476
7329
|
});
|
|
6477
7330
|
}, ...(ngDevMode ? [{ debugName: "sortedData" }] : /* istanbul ignore next */ []));
|
|
7331
|
+
/**
|
|
7332
|
+
* How many rows the paginator is dividing. `value.length` normally; `totalRecords` in `lazy`
|
|
7333
|
+
* mode, where `value` is only the current page. Also what `showTotal` reports.
|
|
7334
|
+
*/
|
|
7335
|
+
rowCount = computed(() => this.lazy() ? Math.max(0, this.totalRecords() ?? 0) : this.value().length, ...(ngDevMode ? [{ debugName: "rowCount" }] : /* istanbul ignore next */ []));
|
|
6478
7336
|
totalPages = computed(() => {
|
|
6479
7337
|
const size = this.pageSize();
|
|
6480
7338
|
if (!size)
|
|
6481
7339
|
return 1;
|
|
6482
|
-
return Math.max(1, Math.ceil(this.
|
|
7340
|
+
return Math.max(1, Math.ceil(this.rowCount() / size));
|
|
6483
7341
|
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
6484
7342
|
/**
|
|
6485
7343
|
* Resets to page 1 whenever the sort changes (a new sort re-orders the whole data set,
|
|
@@ -6488,22 +7346,128 @@ class TableComponent {
|
|
|
6488
7346
|
* wherever the paginator navigated to. `gog-paginator`'s own `page` model additionally
|
|
6489
7347
|
* self-clamps against `totalPages` on its own, so this only has to handle the reset case.
|
|
6490
7348
|
*/
|
|
6491
|
-
currentPage = linkedSignal({ ...(ngDevMode ? { debugName: "currentPage" } : /* istanbul ignore next */ {}), source: () => ({
|
|
7349
|
+
currentPage = linkedSignal({ ...(ngDevMode ? { debugName: "currentPage" } : /* istanbul ignore next */ {}), source: () => ({
|
|
7350
|
+
total: this.totalPages(),
|
|
7351
|
+
sortState: this.sortState(),
|
|
7352
|
+
pageSize: this.pageSize(),
|
|
7353
|
+
}),
|
|
6492
7354
|
computation: (src, previous) => {
|
|
6493
|
-
if (!previous
|
|
7355
|
+
if (!previous)
|
|
7356
|
+
return 1;
|
|
7357
|
+
// A new sort re-orders everything, and a new page size redraws the boundaries — in both
|
|
7358
|
+
// cases the page the user was on no longer denotes the same rows.
|
|
7359
|
+
if (previous.source.sortState !== src.sortState)
|
|
7360
|
+
return 1;
|
|
7361
|
+
if (previous.source.pageSize !== src.pageSize)
|
|
6494
7362
|
return 1;
|
|
6495
7363
|
return Math.min(Math.max(1, previous.value), src.total);
|
|
6496
7364
|
} });
|
|
7365
|
+
/** In `lazy` mode the server already sliced the page — see `sortedData`. */
|
|
6497
7366
|
visibleRows = computed(() => {
|
|
6498
7367
|
const size = this.pageSize();
|
|
6499
|
-
if (!size)
|
|
7368
|
+
if (this.lazy() || !size)
|
|
6500
7369
|
return this.sortedData();
|
|
6501
7370
|
const page = this.currentPage();
|
|
6502
7371
|
const start = (page - 1) * size;
|
|
6503
7372
|
return this.sortedData().slice(start, start + size);
|
|
6504
7373
|
}, ...(ngDevMode ? [{ debugName: "visibleRows" }] : /* istanbul ignore next */ []));
|
|
6505
|
-
|
|
6506
|
-
|
|
7374
|
+
/**
|
|
7375
|
+
* Resolved the same way `gog-paginator` resolves it, because the footer's own visibility
|
|
7376
|
+
* depends on it — see `hasPagination`.
|
|
7377
|
+
*/
|
|
7378
|
+
showsPageSizeSelect = computed(() => resolveConfigured(this.showPageSizeSelect(), this.globalConfig.paginator?.showPageSizeSelect, false), ...(ngDevMode ? [{ debugName: "showsPageSizeSelect" }] : /* istanbul ignore next */ []));
|
|
7379
|
+
/**
|
|
7380
|
+
* Normally the paginator only earns its space once there is more than one page — but the
|
|
7381
|
+
* rows-per-page select lives inside it, and hiding the whole thing at one page would strand the
|
|
7382
|
+
* user on whatever size produced that single page with no way back to a smaller one.
|
|
7383
|
+
*/
|
|
7384
|
+
hasPagination = computed(() => !this.loading() &&
|
|
7385
|
+
this.pageSize() > 0 &&
|
|
7386
|
+
(this.totalPages() > 1 || this.showsPageSizeSelect()), ...(ngDevMode ? [{ debugName: "hasPagination" }] : /* istanbul ignore next */ []));
|
|
7387
|
+
globalConfig = inject(GOG_CONFIG);
|
|
7388
|
+
/** `GOG_CONFIG.labels` → the built-in English defaults. No per-instance inputs: these name
|
|
7389
|
+
* table chrome, and an app that relabels them does so once. */
|
|
7390
|
+
resolvedLabels = computed(() => {
|
|
7391
|
+
const configured = this.globalConfig.labels ?? {};
|
|
7392
|
+
return {
|
|
7393
|
+
total: resolveConfigured(undefined, configured.total, DEFAULT_LABELS.total),
|
|
7394
|
+
pagination: resolveConfigured(undefined, configured.tablePagination, DEFAULT_LABELS.pagination),
|
|
7395
|
+
selectRow: resolveConfigured(undefined, configured.selectRow, DEFAULT_LABELS.selectRow),
|
|
7396
|
+
selectAllRows: resolveConfigured(undefined, configured.selectAllRows, DEFAULT_LABELS.selectAllRows),
|
|
7397
|
+
};
|
|
7398
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
|
|
7399
|
+
hasSelection = computed(() => this.selectionMode() !== 'none', ...(ngDevMode ? [{ debugName: "hasSelection" }] : /* istanbul ignore next */ []));
|
|
7400
|
+
hasSelectionColumn = computed(() => this.hasSelection() && this.showSelectionColumn(), ...(ngDevMode ? [{ debugName: "hasSelectionColumn" }] : /* istanbul ignore next */ []));
|
|
7401
|
+
emptyColspan = computed(() => this.columns().length + (this.showRowNumbers() ? 1 : 0) + (this.hasSelectionColumn() ? 1 : 0), ...(ngDevMode ? [{ debugName: "emptyColspan" }] : /* istanbul ignore next */ []));
|
|
7402
|
+
/**
|
|
7403
|
+
* Identity for selection and `@for` tracking. `dataKey`'s value when set, the row object
|
|
7404
|
+
* otherwise — the object works for a static data set and breaks the moment rows are re-fetched,
|
|
7405
|
+
* which is exactly what `dataKey` is for.
|
|
7406
|
+
*/
|
|
7407
|
+
rowKey(row) {
|
|
7408
|
+
const key = this.dataKey();
|
|
7409
|
+
return key ? getByPath(row, key) : row;
|
|
7410
|
+
}
|
|
7411
|
+
isSelected(row) {
|
|
7412
|
+
const key = this.rowKey(row);
|
|
7413
|
+
return this.selection().some((selected) => this.rowKey(selected) === key);
|
|
7414
|
+
}
|
|
7415
|
+
/** All rows on the current page are selected — drives the header checkbox. */
|
|
7416
|
+
allPageRowsSelected = computed(() => {
|
|
7417
|
+
const rows = this.visibleRows();
|
|
7418
|
+
return rows.length > 0 && rows.every((row) => this.isSelected(row));
|
|
7419
|
+
}, ...(ngDevMode ? [{ debugName: "allPageRowsSelected" }] : /* istanbul ignore next */ []));
|
|
7420
|
+
/** Some but not all — the header checkbox's indeterminate state. */
|
|
7421
|
+
somePageRowsSelected = computed(() => {
|
|
7422
|
+
const rows = this.visibleRows();
|
|
7423
|
+
return rows.some((row) => this.isSelected(row)) && !this.allPageRowsSelected();
|
|
7424
|
+
}, ...(ngDevMode ? [{ debugName: "somePageRowsSelected" }] : /* istanbul ignore next */ []));
|
|
7425
|
+
toggleRowSelection(row, selected) {
|
|
7426
|
+
if (this.selectionMode() === 'single') {
|
|
7427
|
+
this.selection.set(selected ? [row] : []);
|
|
7428
|
+
return;
|
|
7429
|
+
}
|
|
7430
|
+
const key = this.rowKey(row);
|
|
7431
|
+
const without = this.selection().filter((entry) => this.rowKey(entry) !== key);
|
|
7432
|
+
this.selection.set(selected ? [...without, row] : without);
|
|
7433
|
+
}
|
|
7434
|
+
/**
|
|
7435
|
+
* Header checkbox: selects or clears **the current page**, not the whole data set. Anything
|
|
7436
|
+
* else would be a lie in `lazy` mode, where the table has never seen the other pages — and
|
|
7437
|
+
* inconsistent between the two modes, which is worse than either behaviour alone.
|
|
7438
|
+
*/
|
|
7439
|
+
toggleAllOnPage(selected) {
|
|
7440
|
+
const rows = this.visibleRows();
|
|
7441
|
+
const pageKeys = new Set(rows.map((row) => this.rowKey(row)));
|
|
7442
|
+
const offPage = this.selection().filter((entry) => !pageKeys.has(this.rowKey(entry)));
|
|
7443
|
+
this.selection.set(selected ? [...offPage, ...rows] : offPage);
|
|
7444
|
+
}
|
|
7445
|
+
constructor() {
|
|
7446
|
+
/*
|
|
7447
|
+
* `gogPageChange` for user navigation and clamps, but *not* for the reset that follows a new
|
|
7448
|
+
* sort: `currentPage` snapping back to 1 there is part of the sort, and a lazy consumer
|
|
7449
|
+
* refetching from both events would fire two requests for one user action. Detected by the
|
|
7450
|
+
* sort having changed in the same computation, and skipped.
|
|
7451
|
+
*/
|
|
7452
|
+
let previous = null;
|
|
7453
|
+
effect(() => {
|
|
7454
|
+
const page = this.currentPage();
|
|
7455
|
+
const sort = this.sortState();
|
|
7456
|
+
const size = this.pageSize();
|
|
7457
|
+
const causedByOther = previous && (previous.sort !== sort || previous.size !== size);
|
|
7458
|
+
if (previous && previous.page !== page && !causedByOther) {
|
|
7459
|
+
this.gogPageChange.emit(page);
|
|
7460
|
+
}
|
|
7461
|
+
previous = { page, sort, size };
|
|
7462
|
+
});
|
|
7463
|
+
effect(() => {
|
|
7464
|
+
if (!isDevMode() || !this.lazy() || this.pageSize() <= 0)
|
|
7465
|
+
return;
|
|
7466
|
+
if (this.totalRecords() === null) {
|
|
7467
|
+
console.warn("[gog-table] `lazy` with a `pageSize` but no `totalRecords`: the table cannot know how many pages exist, so pagination stays hidden. Pass the server's total row count.");
|
|
7468
|
+
}
|
|
7469
|
+
});
|
|
7470
|
+
}
|
|
6507
7471
|
/**
|
|
6508
7472
|
* A `gogColumnBody` template declared inside the column wins; the string-keyed
|
|
6509
7473
|
* `<ng-template template="field" type="body">` is the deprecated fallback.
|
|
@@ -6526,6 +7490,10 @@ class TableComponent {
|
|
|
6526
7490
|
headerContext(col) {
|
|
6527
7491
|
return { $implicit: col.header(), field: col.field() };
|
|
6528
7492
|
}
|
|
7493
|
+
/**
|
|
7494
|
+
* Cycles the clicked column asc → desc → unsorted, and emits the result. The emit is last, so
|
|
7495
|
+
* a `lazy` consumer refetching from it already sees `currentPage` reset to 1.
|
|
7496
|
+
*/
|
|
6529
7497
|
toggleSort(col) {
|
|
6530
7498
|
if (!col.sortable())
|
|
6531
7499
|
return;
|
|
@@ -6540,6 +7508,20 @@ class TableComponent {
|
|
|
6540
7508
|
else {
|
|
6541
7509
|
this.sortState.set({ field: '', direction: null });
|
|
6542
7510
|
}
|
|
7511
|
+
this.gogSortChange.emit(this.sortState());
|
|
7512
|
+
}
|
|
7513
|
+
/** Click, or Enter/Space on a focused row when `interactiveRows` is on. */
|
|
7514
|
+
emitRowClick(row, index, originalEvent) {
|
|
7515
|
+
this.gogRowClick.emit({ row, index, originalEvent });
|
|
7516
|
+
}
|
|
7517
|
+
/** Enter and Space activate the focused row; Space must not also scroll the page. */
|
|
7518
|
+
onRowKeydown(row, index, event) {
|
|
7519
|
+
if (!this.interactiveRows())
|
|
7520
|
+
return;
|
|
7521
|
+
if (event.key !== 'Enter' && event.key !== ' ')
|
|
7522
|
+
return;
|
|
7523
|
+
event.preventDefault();
|
|
7524
|
+
this.emitRowClick(row, index, event);
|
|
6543
7525
|
}
|
|
6544
7526
|
getSortDirection(field) {
|
|
6545
7527
|
const s = this.sortState();
|
|
@@ -6597,33 +7579,146 @@ class TableComponent {
|
|
|
6597
7579
|
return map;
|
|
6598
7580
|
}, ...(ngDevMode ? [{ debugName: "headerTemplateMap" }] : /* istanbul ignore next */ []));
|
|
6599
7581
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6600
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TableComponent, isStandalone: true, selector: "gog-table", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, showRowNumbers: { classPropertyName: "showRowNumbers", publicName: "showRowNumbers", isSignal: true, isRequired: false, transformFunction: null }, showTotal: { classPropertyName: "showTotal", publicName: "showTotal", isSignal: true, isRequired: false, transformFunction: null }, emptyPlaceholder: { classPropertyName: "emptyPlaceholder", publicName: "emptyPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, totalPosition: { classPropertyName: "totalPosition", publicName: "totalPosition", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showColumnBorders: { classPropertyName: "showColumnBorders", publicName: "showColumnBorders", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "\"block\"", "style.width": "fullWidth() ? \"100%\" : \"fit-content\"" }, classAttribute: "gog-table-host" }, queries: [{ propertyName: "columns", predicate: GogColumn, isSignal: true }, { propertyName: "templates", predicate: TemplateDirective, isSignal: true }], ngImport: i0, template: "<div class=\"gog-table-wrapper gog-contained-layout\">\r\n <gog-scroll axis=\"horizontal\" class=\"gog-table-scroll\">\r\n <table\r\n class=\"gog-table\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-table--col-borders]=\"showColumnBorders()\"\r\n [class.gog-table--loading]=\"loading()\"\r\n [class.gog-table--sticky-header]=\"stickyHeader()\"\r\n [style.width]=\"fullWidth() ? '100%' : 'fit-content'\"\r\n >\r\n <colgroup>\r\n @if (showRowNumbers()) {\r\n <col class=\"gog-table__col--num\" />\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <col\r\n [style.width]=\"col.width() || null\"\r\n [style.min-width]=\"col.minWidth() || null\"\r\n [style.max-width]=\"col.maxWidth() || null\"\r\n />\r\n }\r\n </colgroup>\r\n <thead>\r\n <tr>\r\n @if (showRowNumbers()) {\r\n <th class=\"gog-table__th gog-table__th--num\" scope=\"col\">#</th>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <th\r\n class=\"gog-table__th\"\r\n scope=\"col\"\r\n [class.gog-table__th--sortable]=\"col.sortable() && !loading()\"\r\n [class.gog-table__th--sorted]=\"getSortDirection(col.field())\"\r\n [attr.aria-sort]=\"getAriaSort(col.field())\"\r\n [attr.tabindex]=\"col.sortable() && !loading() ? 0 : null\"\r\n (click)=\"handleSortClick(col)\"\r\n (keydown.enter)=\"handleSortClick(col)\"\r\n (keydown.space)=\"handleSortClick(col); $event.preventDefault()\"\r\n >\r\n @if (getHeaderTemplate(col); as headerTpl) {\r\n <ng-container *ngTemplateOutlet=\"headerTpl; context: headerContext(col)\" />\r\n } @else {\r\n <span class=\"gog-table__th-inner\">\r\n {{ col.header() || col.field() }}\r\n @if (col.sortable() && !loading()) {\r\n <span class=\"gog-table__sort-icon\" aria-hidden=\"true\">\r\n @if (getSortDirection(col.field()) === 'asc') {\r\n <gog-icon name=\"sort-up\" />\r\n } @else if (getSortDirection(col.field()) === 'desc') {\r\n <gog-icon name=\"sort-down\" />\r\n } @else {\r\n <gog-icon name=\"sort\" />\r\n }\r\n </span>\r\n }\r\n </span>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (loading()) {\r\n <tr>\r\n <td class=\"gog-table__loading-cell\" [attr.colspan]=\"emptyColspan()\">\r\n <gog-spinner size=\"md\" />\r\n </td>\r\n </tr>\r\n } @else if (visibleRows().length === 0) {\r\n <tr>\r\n <td class=\"gog-table__empty\" [attr.colspan]=\"emptyColspan()\">\u2014</td>\r\n </tr>\r\n } @else {\r\n @for (row of visibleRows(); track $index; let i = $index) {\r\n <tr class=\"gog-table__row\">\r\n @if (showRowNumbers()) {\r\n <td class=\"gog-table__td gog-table__td--num\">{{ globalRowIndex(i) }}</td>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <td class=\"gog-table__td\">\r\n @if (getBodyTemplate(col); as bodyTpl) {\r\n <ng-container *ngTemplateOutlet=\"bodyTpl; context: bodyContext(row, col, i)\" />\r\n } @else {\r\n {{ formatCellValue(row, col.field()) }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </gog-scroll>\r\n\r\n @if (hasPagination() || showTotal()) {\r\n <div class=\"gog-table__footer\">\r\n @if (showTotal()) {\r\n <span class=\"gog-table__total\" [style.grid-area]=\"totalGridArea()\">\r\n Total: {{ value().length }}\r\n </span>\r\n }\r\n\r\n @if (hasPagination()) {\r\n <gog-paginator\r\n class=\"gog-table__pagination\"\r\n [style.grid-area]=\"paginatorGridArea()\"\r\n [(page)]=\"currentPage\"\r\n [totalPages]=\"totalPages()\"\r\n rangeMode=\"ellipsis\"\r\n size=\"sm\"\r\n ariaLabel=\"Table pagination\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".gog-table-wrapper{display:flex;flex-direction:column;gap:var(--gog-table-gap);width:100%;overflow-anchor:none}.gog-table-scroll{width:100%}.gog-table{width:100%;border-collapse:collapse;border:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);background-color:var(--gog-table-surface);color:var(--gog-table-text-color);font-family:var(--gog-table-font-family);table-layout:fixed}.gog-table--slg{--gog-table-size-th-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-td-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-th-font-size: var(--gog-table-slg-th-font-size);--gog-table-size-td-font-size: var(--gog-table-slg-td-font-size)}.gog-table--md{--gog-table-size-th-padding-v: var(--gog-table-md-padding-v);--gog-table-size-td-padding-v: var(--gog-table-md-padding-v);--gog-table-size-th-font-size: var(--gog-table-md-th-font-size);--gog-table-size-td-font-size: var(--gog-table-md-td-font-size)}.gog-table--sm{--gog-table-size-th-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-th-font-size: var(--gog-table-sm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-sm-td-font-size)}.gog-table--xsm{--gog-table-size-th-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-th-font-size: var(--gog-table-xsm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-xsm-td-font-size)}.gog-table__col--num{width:var(--gog-table-num-col-width)}.gog-table__th{padding:var(--gog-table-th-padding-v, var(--gog-table-size-th-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);text-align:left;font-family:var(--gog-table-header-font-family);font-size:var(--gog-table-th-font-size, var(--gog-table-size-th-font-size, var(--gog-table-lg-th-font-size)));text-transform:var(--gog-table-header-text-transform);letter-spacing:var(--gog-table-header-letter-spacing);color:var(--gog-table-accent-color);background-color:var(--gog-table-surface);border-bottom:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);white-space:normal;overflow:hidden}.gog-table--sticky-header .gog-table__th{position:sticky;top:0;z-index:1}.gog-table__th--num{width:var(--gog-table-num-col-width);text-align:center;color:var(--gog-table-muted-color)}.gog-table__th--sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.gog-table__th--sortable:focus-visible{outline:var(--gog-table-focus-ring-width) solid var(--gog-table-focus-ring);outline-offset:calc(var(--gog-table-focus-ring-width) * -1)}.gog-table__th--sortable:hover,.gog-table__th--sorted{color:var(--gog-table-accent-bright)}.gog-table__th-inner{display:inline-flex;align-items:center;gap:var(--gog-table-th-inner-gap);width:100%}.gog-table__sort-icon{display:inline-block;width:var(--gog-table-sort-icon-width);text-align:center;font-size:var(--gog-table-sort-icon-size);opacity:var(--gog-table-sort-icon-opacity);flex-shrink:0}.gog-table__th--sorted .gog-table__sort-icon{opacity:1}.gog-table__td{padding:var(--gog-table-td-padding-v, var(--gog-table-size-td-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);font-size:var(--gog-table-td-font-size, var(--gog-table-size-td-font-size, var(--gog-table-lg-td-font-size)));border-bottom:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color);vertical-align:middle;overflow-wrap:break-word;word-break:break-word;overflow:hidden}.gog-table__td--num{text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-num-font-size);font-family:var(--gog-table-numeric-font-family);width:var(--gog-table-num-col-width)}.gog-table__row:last-child .gog-table__td{border-bottom:none}.gog-table__row{transition:background-color var(--gog-table-row-transition-duration) var(--gog-easing)}.gog-table__row:hover{background-color:var(--gog-table-hover-bg)}.gog-table__empty{padding:var(--gog-table-empty-padding);text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-empty-font-size)}.gog-table--loading thead{opacity:var(--gog-table-loading-opacity);pointer-events:none}.gog-table__loading-cell{padding:var(--gog-table-loading-padding);text-align:center}.gog-table--col-borders .gog-table__th:not(:last-child),.gog-table--col-borders .gog-table__td:not(:last-child){border-right:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color)}.gog-table__footer{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:\"left center right\";align-items:center;min-height:var(--gog-table-footer-min-height);gap:var(--gog-table-footer-gap)}.gog-table__total{font-size:var(--gog-table-total-font-size);color:var(--gog-table-muted-color);font-family:var(--gog-table-numeric-font-family);text-transform:var(--gog-table-total-text-transform);letter-spacing:var(--gog-table-total-letter-spacing)}.gog-table__total[style*=\"grid-area: right\"]{text-align:right}.gog-table__pagination[style*=\"grid-area: left\"]{justify-content:flex-start}.gog-table__pagination[style*=\"grid-area: center\"]{justify-content:center}.gog-table__pagination[style*=\"grid-area: right\"]{justify-content:flex-end}@media(prefers-reduced-motion:reduce){.gog-table__row{transition:none}}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "gog-spinner", inputs: ["size", "overlay", "ariaLabel", "variant"] }, { kind: "component", type: PaginatorComponent, selector: "gog-paginator", inputs: ["page", "fullWidth", "totalPages", "rangeMode", "visiblePages", "showFirstPage", "showLastPage", "siblingCount", "size", "disabled", "ariaLabel"], outputs: ["pageChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7582
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TableComponent, isStandalone: true, selector: "gog-table", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelect: { classPropertyName: "showPageSizeSelect", publicName: "showPageSizeSelect", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, interactiveRows: { classPropertyName: "interactiveRows", publicName: "interactiveRows", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, showSelectionColumn: { classPropertyName: "showSelectionColumn", publicName: "showSelectionColumn", isSignal: true, isRequired: false, transformFunction: null }, showRowNumbers: { classPropertyName: "showRowNumbers", publicName: "showRowNumbers", isSignal: true, isRequired: false, transformFunction: null }, showTotal: { classPropertyName: "showTotal", publicName: "showTotal", isSignal: true, isRequired: false, transformFunction: null }, emptyPlaceholder: { classPropertyName: "emptyPlaceholder", publicName: "emptyPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, totalPosition: { classPropertyName: "totalPosition", publicName: "totalPosition", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showColumnBorders: { classPropertyName: "showColumnBorders", publicName: "showColumnBorders", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", selection: "selectionChange", gogSortChange: "gogSortChange", gogPageChange: "gogPageChange", gogRowClick: "gogRowClick" }, host: { properties: { "style.display": "\"block\"", "style.width": "fullWidth() ? \"100%\" : \"fit-content\"" }, classAttribute: "gog-table-host" }, queries: [{ propertyName: "columns", predicate: GogColumn, isSignal: true }, { propertyName: "templates", predicate: TemplateDirective, isSignal: true }], ngImport: i0, template: "<div class=\"gog-table-wrapper gog-contained-layout\">\r\n <gog-scroll axis=\"horizontal\" class=\"gog-table-scroll\">\r\n <table\r\n class=\"gog-table\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-table--col-borders]=\"showColumnBorders()\"\r\n [class.gog-table--loading]=\"loading()\"\r\n [class.gog-table--sticky-header]=\"stickyHeader()\"\r\n [style.width]=\"fullWidth() ? '100%' : 'fit-content'\"\r\n >\r\n <colgroup>\r\n @if (hasSelectionColumn()) {\r\n <col class=\"gog-table__col--select\" />\r\n }\r\n @if (showRowNumbers()) {\r\n <col class=\"gog-table__col--num\" />\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <col\r\n [style.width]=\"col.width() || null\"\r\n [style.min-width]=\"col.minWidth() || null\"\r\n [style.max-width]=\"col.maxWidth() || null\"\r\n />\r\n }\r\n </colgroup>\r\n <thead>\r\n <tr>\r\n @if (hasSelectionColumn()) {\r\n <th class=\"gog-table__th gog-table__th--select\" scope=\"col\">\r\n <!--\r\n Only `multiple` gets a select-all: in `single` mode there is nothing to select\r\n all of, and a checkbox that can only ever check one row is a lie.\r\n -->\r\n @if (selectionMode() === 'multiple') {\r\n <gog-checkbox\r\n [checked]=\"allPageRowsSelected()\"\r\n [indeterminate]=\"somePageRowsSelected()\"\r\n [disabled]=\"loading() || visibleRows().length === 0\"\r\n [ariaLabel]=\"resolvedLabels().selectAllRows\"\r\n (checkedChange)=\"toggleAllOnPage($event)\"\r\n />\r\n }\r\n </th>\r\n }\r\n @if (showRowNumbers()) {\r\n <th class=\"gog-table__th gog-table__th--num\" scope=\"col\">#</th>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <th\r\n class=\"gog-table__th\"\r\n scope=\"col\"\r\n [class.gog-table__th--sortable]=\"col.sortable() && !loading()\"\r\n [class.gog-table__th--sorted]=\"getSortDirection(col.field())\"\r\n [attr.aria-sort]=\"getAriaSort(col.field())\"\r\n [attr.tabindex]=\"col.sortable() && !loading() ? 0 : null\"\r\n (click)=\"handleSortClick(col)\"\r\n (keydown.enter)=\"handleSortClick(col)\"\r\n (keydown.space)=\"handleSortClick(col); $event.preventDefault()\"\r\n >\r\n @if (getHeaderTemplate(col); as headerTpl) {\r\n <ng-container *ngTemplateOutlet=\"headerTpl; context: headerContext(col)\" />\r\n } @else {\r\n <span class=\"gog-table__th-inner\">\r\n {{ col.header() || col.field() }}\r\n @if (col.sortable() && !loading()) {\r\n <span class=\"gog-table__sort-icon\" aria-hidden=\"true\">\r\n @if (getSortDirection(col.field()) === 'asc') {\r\n <gog-icon name=\"sort-up\" />\r\n } @else if (getSortDirection(col.field()) === 'desc') {\r\n <gog-icon name=\"sort-down\" />\r\n } @else {\r\n <gog-icon name=\"sort\" />\r\n }\r\n </span>\r\n }\r\n </span>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (loading()) {\r\n <tr>\r\n <td class=\"gog-table__loading-cell\" [attr.colspan]=\"emptyColspan()\">\r\n <gog-spinner size=\"md\" />\r\n </td>\r\n </tr>\r\n } @else if (visibleRows().length === 0) {\r\n <tr>\r\n <td class=\"gog-table__empty\" [attr.colspan]=\"emptyColspan()\">\u2014</td>\r\n </tr>\r\n } @else {\r\n @for (row of visibleRows(); track rowKey(row); let i = $index) {\r\n <tr\r\n class=\"gog-table__row\"\r\n [class.gog-table__row--interactive]=\"interactiveRows()\"\r\n [class.gog-table__row--selected]=\"isSelected(row)\"\r\n [attr.tabindex]=\"interactiveRows() ? 0 : null\"\r\n [attr.aria-selected]=\"hasSelection() ? isSelected(row) : null\"\r\n (click)=\"emitRowClick(row, i, $event)\"\r\n (keydown)=\"onRowKeydown(row, i, $event)\"\r\n >\r\n @if (hasSelectionColumn()) {\r\n <td class=\"gog-table__td gog-table__td--select\">\r\n <!--\r\n `$event.stopPropagation()` so ticking the box does not also count as a row\r\n click: with `interactiveRows` those are two different intents, and firing both\r\n from one gesture is how a \"select\" ends up navigating away.\r\n -->\r\n <gog-checkbox\r\n [checked]=\"isSelected(row)\"\r\n [ariaLabel]=\"resolvedLabels().selectRow\"\r\n (click)=\"$event.stopPropagation()\"\r\n (checkedChange)=\"toggleRowSelection(row, $event)\"\r\n />\r\n </td>\r\n }\r\n @if (showRowNumbers()) {\r\n <td class=\"gog-table__td gog-table__td--num\">{{ globalRowIndex(i) }}</td>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <td class=\"gog-table__td\">\r\n @if (getBodyTemplate(col); as bodyTpl) {\r\n <ng-container *ngTemplateOutlet=\"bodyTpl; context: bodyContext(row, col, i)\" />\r\n } @else {\r\n {{ formatCellValue(row, col.field()) }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </gog-scroll>\r\n\r\n @if (hasPagination() || showTotal()) {\r\n <div class=\"gog-table__footer\">\r\n @if (showTotal()) {\r\n <span class=\"gog-table__total\" [style.grid-area]=\"totalGridArea()\">\r\n {{ resolvedLabels().total }}: {{ rowCount() }}\r\n </span>\r\n }\r\n\r\n @if (hasPagination()) {\r\n <!--\r\n `[(pageSize)]` straight through to the table's own model: the rows-per-page select\r\n writes back here, and a consumer binding `[(pageSize)]` on the table sees it. No\r\n intermediate signal, in either direction.\r\n -->\r\n <gog-paginator\r\n class=\"gog-table__pagination\"\r\n [style.grid-area]=\"paginatorGridArea()\"\r\n [(page)]=\"currentPage\"\r\n [(pageSize)]=\"pageSize\"\r\n [totalPages]=\"totalPages()\"\r\n [showPageSizeSelect]=\"showPageSizeSelect()\"\r\n [pageSizeOptions]=\"pageSizeOptions()\"\r\n rangeMode=\"ellipsis\"\r\n size=\"sm\"\r\n [ariaLabel]=\"resolvedLabels().pagination\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-table-wrapper{display:flex;flex-direction:column;gap:var(--gog-table-gap);width:100%;overflow-anchor:none}.gog-table-scroll{width:100%}.gog-table{width:100%;border-collapse:collapse;border:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);background-color:var(--gog-table-surface);color:var(--gog-table-text-color);font-family:var(--gog-table-font-family);table-layout:fixed}.gog-table--slg{--gog-table-size-th-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-td-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-th-font-size: var(--gog-table-slg-th-font-size);--gog-table-size-td-font-size: var(--gog-table-slg-td-font-size)}.gog-table--md{--gog-table-size-th-padding-v: var(--gog-table-md-padding-v);--gog-table-size-td-padding-v: var(--gog-table-md-padding-v);--gog-table-size-th-font-size: var(--gog-table-md-th-font-size);--gog-table-size-td-font-size: var(--gog-table-md-td-font-size)}.gog-table--sm{--gog-table-size-th-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-th-font-size: var(--gog-table-sm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-sm-td-font-size)}.gog-table--xsm{--gog-table-size-th-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-th-font-size: var(--gog-table-xsm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-xsm-td-font-size)}.gog-table__col--num{width:var(--gog-table-num-col-width)}.gog-table__th{padding:var(--gog-table-th-padding-v, var(--gog-table-size-th-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);text-align:left;font-family:var(--gog-table-header-font-family);font-size:var(--gog-table-th-font-size, var(--gog-table-size-th-font-size, var(--gog-table-lg-th-font-size)));text-transform:var(--gog-table-header-text-transform);letter-spacing:var(--gog-table-header-letter-spacing);color:var(--gog-table-accent-color);background-color:var(--gog-table-surface);border-bottom:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);white-space:normal;overflow:hidden}.gog-table--sticky-header .gog-table__th{position:sticky;top:0;z-index:1}.gog-table__th--num{width:var(--gog-table-num-col-width);text-align:center;color:var(--gog-table-muted-color)}.gog-table__th--select,.gog-table__td--select{width:var(--gog-table-select-col-width);text-align:center}.gog-table__th--sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.gog-table__th--sortable:focus-visible{outline:var(--gog-table-focus-ring-width) solid var(--gog-table-focus-ring);outline-offset:calc(var(--gog-table-focus-ring-width) * -1)}.gog-table__th--sortable:hover,.gog-table__th--sorted{color:var(--gog-table-accent-bright)}.gog-table__th-inner{display:inline-flex;align-items:center;gap:var(--gog-table-th-inner-gap);width:100%}.gog-table__sort-icon{display:inline-block;width:var(--gog-table-sort-icon-width);text-align:center;font-size:var(--gog-table-sort-icon-size);opacity:var(--gog-table-sort-icon-opacity);flex-shrink:0}.gog-table__th--sorted .gog-table__sort-icon{opacity:1}.gog-table__td{padding:var(--gog-table-td-padding-v, var(--gog-table-size-td-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);font-size:var(--gog-table-td-font-size, var(--gog-table-size-td-font-size, var(--gog-table-lg-td-font-size)));border-bottom:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color);vertical-align:middle;overflow-wrap:break-word;word-break:break-word;overflow:hidden}.gog-table__td--num{text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-num-font-size);font-family:var(--gog-table-numeric-font-family);width:var(--gog-table-num-col-width)}.gog-table__row:last-child .gog-table__td{border-bottom:none}.gog-table__row{transition:background-color var(--gog-table-row-transition-duration) var(--gog-easing)}.gog-table__row--interactive{cursor:pointer}.gog-table__row--interactive:focus-visible{outline:var(--gog-table-focus-ring-width) solid var(--gog-table-focus-ring);outline-offset:calc(var(--gog-table-focus-ring-width) * -1)}.gog-table__row:hover{background-color:var(--gog-table-hover-bg)}.gog-table__row--selected,.gog-table__row--selected:hover{background-color:var(--gog-table-selected-bg)}.gog-table__empty{padding:var(--gog-table-empty-padding);text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-empty-font-size)}.gog-table--loading thead{opacity:var(--gog-table-loading-opacity);pointer-events:none}.gog-table__loading-cell{padding:var(--gog-table-loading-padding);text-align:center}.gog-table--col-borders .gog-table__th:not(:last-child),.gog-table--col-borders .gog-table__td:not(:last-child){border-right:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color)}.gog-table__footer{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:\"left center right\";align-items:center;min-height:var(--gog-table-footer-min-height);gap:var(--gog-table-footer-gap)}.gog-table__total{font-size:var(--gog-table-total-font-size);color:var(--gog-table-muted-color);font-family:var(--gog-table-numeric-font-family);text-transform:var(--gog-table-total-text-transform);letter-spacing:var(--gog-table-total-letter-spacing)}.gog-table__total[style*=\"grid-area: right\"]{text-align:right}.gog-table__pagination[style*=\"grid-area: left\"]{justify-content:flex-start}.gog-table__pagination[style*=\"grid-area: center\"]{justify-content:center}.gog-table__pagination[style*=\"grid-area: right\"]{justify-content:flex-end}@media(prefers-reduced-motion:reduce){.gog-table__row{transition:none}}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "gog-spinner", inputs: ["size", "overlay", "ariaLabel", "variant"] }, { kind: "component", type: PaginatorComponent, selector: "gog-paginator", inputs: ["page", "fullWidth", "totalPages", "totalRecords", "pageSize", "showPageSizeSelect", "pageSizeOptions", "rangeMode", "visiblePages", "showFirstPage", "showLastPage", "siblingCount", "size", "disabled", "ariaLabel"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "gog-icon", inputs: ["name", "template", "title", "ariaHidden"] }, { kind: "component", type: ScrollComponent, selector: "gog-scroll", inputs: ["axis", "size", "autoHide", "hideDelay", "reachThreshold", "focusable", "ariaLabel", "overscrollBehavior", "showTrack"], outputs: ["gogScroll", "gogReachStart", "gogReachEnd"] }, { kind: "component", type: CheckboxComponent, selector: "gog-checkbox", inputs: ["label", "ariaLabel", "size", "indeterminate", "disabled", "fullWidth", "checkIconTemplate", "checked"], outputs: ["checkedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6601
7583
|
}
|
|
6602
7584
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TableComponent, decorators: [{
|
|
6603
7585
|
type: Component,
|
|
6604
|
-
args: [{ selector: 'gog-table', imports: [
|
|
7586
|
+
args: [{ selector: 'gog-table', imports: [
|
|
7587
|
+
SpinnerComponent,
|
|
7588
|
+
PaginatorComponent,
|
|
7589
|
+
NgTemplateOutlet,
|
|
7590
|
+
IconComponent,
|
|
7591
|
+
ScrollComponent,
|
|
7592
|
+
CheckboxComponent,
|
|
7593
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
6605
7594
|
class: 'gog-table-host',
|
|
6606
7595
|
'[style.display]': '"block"',
|
|
6607
7596
|
'[style.width]': 'fullWidth() ? "100%" : "fit-content"',
|
|
6608
|
-
}, template: "<div class=\"gog-table-wrapper gog-contained-layout\">\r\n <gog-scroll axis=\"horizontal\" class=\"gog-table-scroll\">\r\n <table\r\n class=\"gog-table\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-table--col-borders]=\"showColumnBorders()\"\r\n [class.gog-table--loading]=\"loading()\"\r\n [class.gog-table--sticky-header]=\"stickyHeader()\"\r\n [style.width]=\"fullWidth() ? '100%' : 'fit-content'\"\r\n >\r\n <colgroup>\r\n @if (showRowNumbers()) {\r\n <col class=\"gog-table__col--num\" />\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <col\r\n [style.width]=\"col.width() || null\"\r\n [style.min-width]=\"col.minWidth() || null\"\r\n [style.max-width]=\"col.maxWidth() || null\"\r\n />\r\n }\r\n </colgroup>\r\n <thead>\r\n <tr>\r\n @if (showRowNumbers()) {\r\n <th class=\"gog-table__th gog-table__th--num\" scope=\"col\">#</th>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <th\r\n class=\"gog-table__th\"\r\n scope=\"col\"\r\n [class.gog-table__th--sortable]=\"col.sortable() && !loading()\"\r\n [class.gog-table__th--sorted]=\"getSortDirection(col.field())\"\r\n [attr.aria-sort]=\"getAriaSort(col.field())\"\r\n [attr.tabindex]=\"col.sortable() && !loading() ? 0 : null\"\r\n (click)=\"handleSortClick(col)\"\r\n (keydown.enter)=\"handleSortClick(col)\"\r\n (keydown.space)=\"handleSortClick(col); $event.preventDefault()\"\r\n >\r\n @if (getHeaderTemplate(col); as headerTpl) {\r\n <ng-container *ngTemplateOutlet=\"headerTpl; context: headerContext(col)\" />\r\n } @else {\r\n <span class=\"gog-table__th-inner\">\r\n {{ col.header() || col.field() }}\r\n @if (col.sortable() && !loading()) {\r\n <span class=\"gog-table__sort-icon\" aria-hidden=\"true\">\r\n @if (getSortDirection(col.field()) === 'asc') {\r\n <gog-icon name=\"sort-up\" />\r\n } @else if (getSortDirection(col.field()) === 'desc') {\r\n <gog-icon name=\"sort-down\" />\r\n } @else {\r\n <gog-icon name=\"sort\" />\r\n }\r\n </span>\r\n }\r\n </span>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (loading()) {\r\n <tr>\r\n <td class=\"gog-table__loading-cell\" [attr.colspan]=\"emptyColspan()\">\r\n <gog-spinner size=\"md\" />\r\n </td>\r\n </tr>\r\n } @else if (visibleRows().length === 0) {\r\n <tr>\r\n <td class=\"gog-table__empty\" [attr.colspan]=\"emptyColspan()\">\u2014</td>\r\n </tr>\r\n } @else {\r\n @for (row of visibleRows(); track $index; let i = $index) {\r\n <tr class=\"gog-table__row\">\r\n @if (showRowNumbers()) {\r\n <td class=\"gog-table__td gog-table__td--num\">{{ globalRowIndex(i) }}</td>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <td class=\"gog-table__td\">\r\n @if (getBodyTemplate(col); as bodyTpl) {\r\n <ng-container *ngTemplateOutlet=\"bodyTpl; context: bodyContext(row, col, i)\" />\r\n } @else {\r\n {{ formatCellValue(row, col.field()) }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </gog-scroll>\r\n\r\n @if (hasPagination() || showTotal()) {\r\n <div class=\"gog-table__footer\">\r\n @if (showTotal()) {\r\n <span class=\"gog-table__total\" [style.grid-area]=\"totalGridArea()\">\r\n Total: {{ value().length }}\r\n </span>\r\n }\r\n\r\n @if (hasPagination()) {\r\n <gog-paginator\r\n class=\"gog-table__pagination\"\r\n [style.grid-area]=\"paginatorGridArea()\"\r\n [(page)]=\"currentPage\"\r\n [totalPages]=\"totalPages()\"\r\n rangeMode=\"ellipsis\"\r\n size=\"sm\"\r\n ariaLabel=\"Table pagination\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".gog-table-wrapper{display:flex;flex-direction:column;gap:var(--gog-table-gap);width:100%;overflow-anchor:none}.gog-table-scroll{width:100%}.gog-table{width:100%;border-collapse:collapse;border:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);background-color:var(--gog-table-surface);color:var(--gog-table-text-color);font-family:var(--gog-table-font-family);table-layout:fixed}.gog-table--slg{--gog-table-size-th-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-td-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-th-font-size: var(--gog-table-slg-th-font-size);--gog-table-size-td-font-size: var(--gog-table-slg-td-font-size)}.gog-table--md{--gog-table-size-th-padding-v: var(--gog-table-md-padding-v);--gog-table-size-td-padding-v: var(--gog-table-md-padding-v);--gog-table-size-th-font-size: var(--gog-table-md-th-font-size);--gog-table-size-td-font-size: var(--gog-table-md-td-font-size)}.gog-table--sm{--gog-table-size-th-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-th-font-size: var(--gog-table-sm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-sm-td-font-size)}.gog-table--xsm{--gog-table-size-th-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-th-font-size: var(--gog-table-xsm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-xsm-td-font-size)}.gog-table__col--num{width:var(--gog-table-num-col-width)}.gog-table__th{padding:var(--gog-table-th-padding-v, var(--gog-table-size-th-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);text-align:left;font-family:var(--gog-table-header-font-family);font-size:var(--gog-table-th-font-size, var(--gog-table-size-th-font-size, var(--gog-table-lg-th-font-size)));text-transform:var(--gog-table-header-text-transform);letter-spacing:var(--gog-table-header-letter-spacing);color:var(--gog-table-accent-color);background-color:var(--gog-table-surface);border-bottom:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);white-space:normal;overflow:hidden}.gog-table--sticky-header .gog-table__th{position:sticky;top:0;z-index:1}.gog-table__th--num{width:var(--gog-table-num-col-width);text-align:center;color:var(--gog-table-muted-color)}.gog-table__th--sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.gog-table__th--sortable:focus-visible{outline:var(--gog-table-focus-ring-width) solid var(--gog-table-focus-ring);outline-offset:calc(var(--gog-table-focus-ring-width) * -1)}.gog-table__th--sortable:hover,.gog-table__th--sorted{color:var(--gog-table-accent-bright)}.gog-table__th-inner{display:inline-flex;align-items:center;gap:var(--gog-table-th-inner-gap);width:100%}.gog-table__sort-icon{display:inline-block;width:var(--gog-table-sort-icon-width);text-align:center;font-size:var(--gog-table-sort-icon-size);opacity:var(--gog-table-sort-icon-opacity);flex-shrink:0}.gog-table__th--sorted .gog-table__sort-icon{opacity:1}.gog-table__td{padding:var(--gog-table-td-padding-v, var(--gog-table-size-td-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);font-size:var(--gog-table-td-font-size, var(--gog-table-size-td-font-size, var(--gog-table-lg-td-font-size)));border-bottom:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color);vertical-align:middle;overflow-wrap:break-word;word-break:break-word;overflow:hidden}.gog-table__td--num{text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-num-font-size);font-family:var(--gog-table-numeric-font-family);width:var(--gog-table-num-col-width)}.gog-table__row:last-child .gog-table__td{border-bottom:none}.gog-table__row{transition:background-color var(--gog-table-row-transition-duration) var(--gog-easing)}.gog-table__row:hover{background-color:var(--gog-table-hover-bg)}.gog-table__empty{padding:var(--gog-table-empty-padding);text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-empty-font-size)}.gog-table--loading thead{opacity:var(--gog-table-loading-opacity);pointer-events:none}.gog-table__loading-cell{padding:var(--gog-table-loading-padding);text-align:center}.gog-table--col-borders .gog-table__th:not(:last-child),.gog-table--col-borders .gog-table__td:not(:last-child){border-right:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color)}.gog-table__footer{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:\"left center right\";align-items:center;min-height:var(--gog-table-footer-min-height);gap:var(--gog-table-footer-gap)}.gog-table__total{font-size:var(--gog-table-total-font-size);color:var(--gog-table-muted-color);font-family:var(--gog-table-numeric-font-family);text-transform:var(--gog-table-total-text-transform);letter-spacing:var(--gog-table-total-letter-spacing)}.gog-table__total[style*=\"grid-area: right\"]{text-align:right}.gog-table__pagination[style*=\"grid-area: left\"]{justify-content:flex-start}.gog-table__pagination[style*=\"grid-area: center\"]{justify-content:center}.gog-table__pagination[style*=\"grid-area: right\"]{justify-content:flex-end}@media(prefers-reduced-motion:reduce){.gog-table__row{transition:none}}\n"] }]
|
|
6609
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], showRowNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowNumbers", required: false }] }], showTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTotal", required: false }] }], emptyPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyPlaceholder", required: false }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", required: false }] }], totalPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPosition", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showColumnBorders: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnBorders", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], columns: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => GogColumn), { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TemplateDirective), { isSignal: true }] }] } });
|
|
7597
|
+
}, template: "<div class=\"gog-table-wrapper gog-contained-layout\">\r\n <gog-scroll axis=\"horizontal\" class=\"gog-table-scroll\">\r\n <table\r\n class=\"gog-table\"\r\n [class]=\"sizeClass()\"\r\n [class.gog-table--col-borders]=\"showColumnBorders()\"\r\n [class.gog-table--loading]=\"loading()\"\r\n [class.gog-table--sticky-header]=\"stickyHeader()\"\r\n [style.width]=\"fullWidth() ? '100%' : 'fit-content'\"\r\n >\r\n <colgroup>\r\n @if (hasSelectionColumn()) {\r\n <col class=\"gog-table__col--select\" />\r\n }\r\n @if (showRowNumbers()) {\r\n <col class=\"gog-table__col--num\" />\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <col\r\n [style.width]=\"col.width() || null\"\r\n [style.min-width]=\"col.minWidth() || null\"\r\n [style.max-width]=\"col.maxWidth() || null\"\r\n />\r\n }\r\n </colgroup>\r\n <thead>\r\n <tr>\r\n @if (hasSelectionColumn()) {\r\n <th class=\"gog-table__th gog-table__th--select\" scope=\"col\">\r\n <!--\r\n Only `multiple` gets a select-all: in `single` mode there is nothing to select\r\n all of, and a checkbox that can only ever check one row is a lie.\r\n -->\r\n @if (selectionMode() === 'multiple') {\r\n <gog-checkbox\r\n [checked]=\"allPageRowsSelected()\"\r\n [indeterminate]=\"somePageRowsSelected()\"\r\n [disabled]=\"loading() || visibleRows().length === 0\"\r\n [ariaLabel]=\"resolvedLabels().selectAllRows\"\r\n (checkedChange)=\"toggleAllOnPage($event)\"\r\n />\r\n }\r\n </th>\r\n }\r\n @if (showRowNumbers()) {\r\n <th class=\"gog-table__th gog-table__th--num\" scope=\"col\">#</th>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <th\r\n class=\"gog-table__th\"\r\n scope=\"col\"\r\n [class.gog-table__th--sortable]=\"col.sortable() && !loading()\"\r\n [class.gog-table__th--sorted]=\"getSortDirection(col.field())\"\r\n [attr.aria-sort]=\"getAriaSort(col.field())\"\r\n [attr.tabindex]=\"col.sortable() && !loading() ? 0 : null\"\r\n (click)=\"handleSortClick(col)\"\r\n (keydown.enter)=\"handleSortClick(col)\"\r\n (keydown.space)=\"handleSortClick(col); $event.preventDefault()\"\r\n >\r\n @if (getHeaderTemplate(col); as headerTpl) {\r\n <ng-container *ngTemplateOutlet=\"headerTpl; context: headerContext(col)\" />\r\n } @else {\r\n <span class=\"gog-table__th-inner\">\r\n {{ col.header() || col.field() }}\r\n @if (col.sortable() && !loading()) {\r\n <span class=\"gog-table__sort-icon\" aria-hidden=\"true\">\r\n @if (getSortDirection(col.field()) === 'asc') {\r\n <gog-icon name=\"sort-up\" />\r\n } @else if (getSortDirection(col.field()) === 'desc') {\r\n <gog-icon name=\"sort-down\" />\r\n } @else {\r\n <gog-icon name=\"sort\" />\r\n }\r\n </span>\r\n }\r\n </span>\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (loading()) {\r\n <tr>\r\n <td class=\"gog-table__loading-cell\" [attr.colspan]=\"emptyColspan()\">\r\n <gog-spinner size=\"md\" />\r\n </td>\r\n </tr>\r\n } @else if (visibleRows().length === 0) {\r\n <tr>\r\n <td class=\"gog-table__empty\" [attr.colspan]=\"emptyColspan()\">\u2014</td>\r\n </tr>\r\n } @else {\r\n @for (row of visibleRows(); track rowKey(row); let i = $index) {\r\n <tr\r\n class=\"gog-table__row\"\r\n [class.gog-table__row--interactive]=\"interactiveRows()\"\r\n [class.gog-table__row--selected]=\"isSelected(row)\"\r\n [attr.tabindex]=\"interactiveRows() ? 0 : null\"\r\n [attr.aria-selected]=\"hasSelection() ? isSelected(row) : null\"\r\n (click)=\"emitRowClick(row, i, $event)\"\r\n (keydown)=\"onRowKeydown(row, i, $event)\"\r\n >\r\n @if (hasSelectionColumn()) {\r\n <td class=\"gog-table__td gog-table__td--select\">\r\n <!--\r\n `$event.stopPropagation()` so ticking the box does not also count as a row\r\n click: with `interactiveRows` those are two different intents, and firing both\r\n from one gesture is how a \"select\" ends up navigating away.\r\n -->\r\n <gog-checkbox\r\n [checked]=\"isSelected(row)\"\r\n [ariaLabel]=\"resolvedLabels().selectRow\"\r\n (click)=\"$event.stopPropagation()\"\r\n (checkedChange)=\"toggleRowSelection(row, $event)\"\r\n />\r\n </td>\r\n }\r\n @if (showRowNumbers()) {\r\n <td class=\"gog-table__td gog-table__td--num\">{{ globalRowIndex(i) }}</td>\r\n }\r\n @for (col of columns(); track col.field()) {\r\n <td class=\"gog-table__td\">\r\n @if (getBodyTemplate(col); as bodyTpl) {\r\n <ng-container *ngTemplateOutlet=\"bodyTpl; context: bodyContext(row, col, i)\" />\r\n } @else {\r\n {{ formatCellValue(row, col.field()) }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </gog-scroll>\r\n\r\n @if (hasPagination() || showTotal()) {\r\n <div class=\"gog-table__footer\">\r\n @if (showTotal()) {\r\n <span class=\"gog-table__total\" [style.grid-area]=\"totalGridArea()\">\r\n {{ resolvedLabels().total }}: {{ rowCount() }}\r\n </span>\r\n }\r\n\r\n @if (hasPagination()) {\r\n <!--\r\n `[(pageSize)]` straight through to the table's own model: the rows-per-page select\r\n writes back here, and a consumer binding `[(pageSize)]` on the table sees it. No\r\n intermediate signal, in either direction.\r\n -->\r\n <gog-paginator\r\n class=\"gog-table__pagination\"\r\n [style.grid-area]=\"paginatorGridArea()\"\r\n [(page)]=\"currentPage\"\r\n [(pageSize)]=\"pageSize\"\r\n [totalPages]=\"totalPages()\"\r\n [showPageSizeSelect]=\"showPageSizeSelect()\"\r\n [pageSizeOptions]=\"pageSizeOptions()\"\r\n rangeMode=\"ellipsis\"\r\n size=\"sm\"\r\n [ariaLabel]=\"resolvedLabels().pagination\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.gog-table-wrapper{display:flex;flex-direction:column;gap:var(--gog-table-gap);width:100%;overflow-anchor:none}.gog-table-scroll{width:100%}.gog-table{width:100%;border-collapse:collapse;border:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);background-color:var(--gog-table-surface);color:var(--gog-table-text-color);font-family:var(--gog-table-font-family);table-layout:fixed}.gog-table--slg{--gog-table-size-th-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-td-padding-v: var(--gog-table-slg-padding-v);--gog-table-size-th-font-size: var(--gog-table-slg-th-font-size);--gog-table-size-td-font-size: var(--gog-table-slg-td-font-size)}.gog-table--md{--gog-table-size-th-padding-v: var(--gog-table-md-padding-v);--gog-table-size-td-padding-v: var(--gog-table-md-padding-v);--gog-table-size-th-font-size: var(--gog-table-md-th-font-size);--gog-table-size-td-font-size: var(--gog-table-md-td-font-size)}.gog-table--sm{--gog-table-size-th-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-sm-padding-v);--gog-table-size-th-font-size: var(--gog-table-sm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-sm-td-font-size)}.gog-table--xsm{--gog-table-size-th-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-td-padding-v: var(--gog-table-xsm-padding-v);--gog-table-size-th-font-size: var(--gog-table-xsm-th-font-size);--gog-table-size-td-font-size: var(--gog-table-xsm-td-font-size)}.gog-table__col--num{width:var(--gog-table-num-col-width)}.gog-table__th{padding:var(--gog-table-th-padding-v, var(--gog-table-size-th-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);text-align:left;font-family:var(--gog-table-header-font-family);font-size:var(--gog-table-th-font-size, var(--gog-table-size-th-font-size, var(--gog-table-lg-th-font-size)));text-transform:var(--gog-table-header-text-transform);letter-spacing:var(--gog-table-header-letter-spacing);color:var(--gog-table-accent-color);background-color:var(--gog-table-surface);border-bottom:var(--gog-table-border-width) var(--gog-table-border-style) var(--gog-table-border-color);white-space:normal;overflow:hidden}.gog-table--sticky-header .gog-table__th{position:sticky;top:0;z-index:1}.gog-table__th--num{width:var(--gog-table-num-col-width);text-align:center;color:var(--gog-table-muted-color)}.gog-table__th--select,.gog-table__td--select{width:var(--gog-table-select-col-width);text-align:center}.gog-table__th--sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.gog-table__th--sortable:focus-visible{outline:var(--gog-table-focus-ring-width) solid var(--gog-table-focus-ring);outline-offset:calc(var(--gog-table-focus-ring-width) * -1)}.gog-table__th--sortable:hover,.gog-table__th--sorted{color:var(--gog-table-accent-bright)}.gog-table__th-inner{display:inline-flex;align-items:center;gap:var(--gog-table-th-inner-gap);width:100%}.gog-table__sort-icon{display:inline-block;width:var(--gog-table-sort-icon-width);text-align:center;font-size:var(--gog-table-sort-icon-size);opacity:var(--gog-table-sort-icon-opacity);flex-shrink:0}.gog-table__th--sorted .gog-table__sort-icon{opacity:1}.gog-table__td{padding:var(--gog-table-td-padding-v, var(--gog-table-size-td-padding-v, var(--gog-table-lg-padding-v))) var(--gog-table-padding-h);font-size:var(--gog-table-td-font-size, var(--gog-table-size-td-font-size, var(--gog-table-lg-td-font-size)));border-bottom:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color);vertical-align:middle;overflow-wrap:break-word;word-break:break-word;overflow:hidden}.gog-table__td--num{text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-num-font-size);font-family:var(--gog-table-numeric-font-family);width:var(--gog-table-num-col-width)}.gog-table__row:last-child .gog-table__td{border-bottom:none}.gog-table__row{transition:background-color var(--gog-table-row-transition-duration) var(--gog-easing)}.gog-table__row--interactive{cursor:pointer}.gog-table__row--interactive:focus-visible{outline:var(--gog-table-focus-ring-width) solid var(--gog-table-focus-ring);outline-offset:calc(var(--gog-table-focus-ring-width) * -1)}.gog-table__row:hover{background-color:var(--gog-table-hover-bg)}.gog-table__row--selected,.gog-table__row--selected:hover{background-color:var(--gog-table-selected-bg)}.gog-table__empty{padding:var(--gog-table-empty-padding);text-align:center;color:var(--gog-table-muted-color);font-size:var(--gog-table-empty-font-size)}.gog-table--loading thead{opacity:var(--gog-table-loading-opacity);pointer-events:none}.gog-table__loading-cell{padding:var(--gog-table-loading-padding);text-align:center}.gog-table--col-borders .gog-table__th:not(:last-child),.gog-table--col-borders .gog-table__td:not(:last-child){border-right:var(--gog-table-row-border-width) var(--gog-table-border-style) var(--gog-table-border-color)}.gog-table__footer{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:\"left center right\";align-items:center;min-height:var(--gog-table-footer-min-height);gap:var(--gog-table-footer-gap)}.gog-table__total{font-size:var(--gog-table-total-font-size);color:var(--gog-table-muted-color);font-family:var(--gog-table-numeric-font-family);text-transform:var(--gog-table-total-text-transform);letter-spacing:var(--gog-table-total-letter-spacing)}.gog-table__total[style*=\"grid-area: right\"]{text-align:right}.gog-table__pagination[style*=\"grid-area: left\"]{justify-content:flex-start}.gog-table__pagination[style*=\"grid-area: center\"]{justify-content:center}.gog-table__pagination[style*=\"grid-area: right\"]{justify-content:flex-end}@media(prefers-reduced-motion:reduce){.gog-table__row{transition:none}}\n"] }]
|
|
7598
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], showPageSizeSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSizeSelect", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], interactiveRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactiveRows", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], showSelectionColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectionColumn", required: false }] }], showRowNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowNumbers", required: false }] }], showTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTotal", required: false }] }], emptyPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyPlaceholder", required: false }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", required: false }] }], totalPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPosition", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showColumnBorders: [{ type: i0.Input, args: [{ isSignal: true, alias: "showColumnBorders", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], gogSortChange: [{ type: i0.Output, args: ["gogSortChange"] }], gogPageChange: [{ type: i0.Output, args: ["gogPageChange"] }], gogRowClick: [{ type: i0.Output, args: ["gogRowClick"] }], columns: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => GogColumn), { isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TemplateDirective), { isSignal: true }] }] } });
|
|
6610
7599
|
|
|
7600
|
+
/** Built-in defaults, used when `GOG_CONFIG.theme` doesn't supply one. */
|
|
7601
|
+
const DEFAULT_THEME = 'light';
|
|
7602
|
+
const DEFAULT_LIGHT_THEME = 'light';
|
|
7603
|
+
const DEFAULT_DARK_THEME = 'dark';
|
|
7604
|
+
/**
|
|
7605
|
+
* Owns the `data-theme` attribute on `<html>`, which is what every `--gog-*` palette block in
|
|
7606
|
+
* `theme.css` keys off.
|
|
7607
|
+
*
|
|
7608
|
+
* Zero-config behaviour is unchanged from 21.3.1: it adopts whatever `data-theme` is already on
|
|
7609
|
+
* the document, or `'light'` if there is none. Persistence and following the OS setting are
|
|
7610
|
+
* both **opt-in** through `GOG_CONFIG.theme`, so an app that never configures anything cannot
|
|
7611
|
+
* have its theme changed out from under it by an upgrade.
|
|
7612
|
+
*/
|
|
6611
7613
|
class ThemeService {
|
|
6612
7614
|
document = inject(DOCUMENT);
|
|
6613
7615
|
root = this.document.documentElement;
|
|
6614
|
-
|
|
7616
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
7617
|
+
destroyRef = inject(DestroyRef);
|
|
7618
|
+
config = inject(GOG_CONFIG).theme ?? {};
|
|
7619
|
+
state = signal(DEFAULT_THEME, ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
7620
|
+
/**
|
|
7621
|
+
* The active theme name. Read-only on purpose: writing it directly would move the signal
|
|
7622
|
+
* without touching the DOM attribute the styles actually read, leaving the two silently out
|
|
7623
|
+
* of sync. Go through `setTheme`/`toggleTheme`.
|
|
7624
|
+
*/
|
|
7625
|
+
theme = this.state.asReadonly();
|
|
7626
|
+
/**
|
|
7627
|
+
* Set once the app (or the user) has chosen a theme explicitly, which stops
|
|
7628
|
+
* `followSystem` from overriding that choice on the next OS-level change.
|
|
7629
|
+
*/
|
|
7630
|
+
hasExplicitChoice = false;
|
|
6615
7631
|
constructor() {
|
|
6616
|
-
this.
|
|
7632
|
+
this.state.set(this.resolveInitialTheme());
|
|
7633
|
+
this.applyTheme(this.state());
|
|
7634
|
+
this.watchSystemPreference();
|
|
6617
7635
|
}
|
|
6618
7636
|
setTheme(theme) {
|
|
6619
|
-
this.
|
|
7637
|
+
this.hasExplicitChoice = true;
|
|
7638
|
+
this.state.set(theme);
|
|
6620
7639
|
this.applyTheme(theme);
|
|
7640
|
+
this.persist(theme);
|
|
6621
7641
|
}
|
|
7642
|
+
/**
|
|
7643
|
+
* Flips between the configured light and dark theme names (`'light'`/`'dark'` by default).
|
|
7644
|
+
* From a third, custom theme this lands on the dark one, since that is the only reading of
|
|
7645
|
+
* "toggle" that terminates.
|
|
7646
|
+
*/
|
|
6622
7647
|
toggleTheme() {
|
|
6623
|
-
this.
|
|
7648
|
+
const light = this.config.lightTheme ?? DEFAULT_LIGHT_THEME;
|
|
7649
|
+
const dark = this.config.darkTheme ?? DEFAULT_DARK_THEME;
|
|
7650
|
+
this.setTheme(this.state() === dark ? light : dark);
|
|
7651
|
+
}
|
|
7652
|
+
/**
|
|
7653
|
+
* In precedence order:
|
|
7654
|
+
*
|
|
7655
|
+
* 1. a `data-theme` already on `<html>` — server-rendered or set by an inline script before
|
|
7656
|
+
* Angular booted, and either way a decision that has already been painted;
|
|
7657
|
+
* 2. the persisted choice, when `storageKey` is configured;
|
|
7658
|
+
* 3. the OS setting, when `followSystem` is on;
|
|
7659
|
+
* 4. `defaultTheme`, then `'light'`.
|
|
7660
|
+
*/
|
|
7661
|
+
resolveInitialTheme() {
|
|
7662
|
+
const fromDocument = this.root.getAttribute('data-theme');
|
|
7663
|
+
if (fromDocument)
|
|
7664
|
+
return fromDocument;
|
|
7665
|
+
const stored = this.readStored();
|
|
7666
|
+
if (stored)
|
|
7667
|
+
return stored;
|
|
7668
|
+
if (this.config.followSystem && this.prefersDark()) {
|
|
7669
|
+
return this.config.darkTheme ?? DEFAULT_DARK_THEME;
|
|
7670
|
+
}
|
|
7671
|
+
return this.config.defaultTheme ?? DEFAULT_THEME;
|
|
7672
|
+
}
|
|
7673
|
+
/**
|
|
7674
|
+
* Keeps the theme in step with the OS while the app has no explicit choice of its own. Only
|
|
7675
|
+
* wired up when `followSystem` is on, so the default configuration adds no listener at all.
|
|
7676
|
+
*/
|
|
7677
|
+
watchSystemPreference() {
|
|
7678
|
+
if (!this.isBrowser || !this.config.followSystem)
|
|
7679
|
+
return;
|
|
7680
|
+
const query = window.matchMedia('(prefers-color-scheme: dark)');
|
|
7681
|
+
const onChange = (event) => {
|
|
7682
|
+
if (this.hasExplicitChoice)
|
|
7683
|
+
return;
|
|
7684
|
+
const next = event.matches
|
|
7685
|
+
? (this.config.darkTheme ?? DEFAULT_DARK_THEME)
|
|
7686
|
+
: (this.config.lightTheme ?? DEFAULT_LIGHT_THEME);
|
|
7687
|
+
this.state.set(next);
|
|
7688
|
+
this.applyTheme(next);
|
|
7689
|
+
};
|
|
7690
|
+
query.addEventListener('change', onChange);
|
|
7691
|
+
this.destroyRef.onDestroy(() => query.removeEventListener('change', onChange));
|
|
6624
7692
|
}
|
|
6625
|
-
|
|
6626
|
-
return this.
|
|
7693
|
+
prefersDark() {
|
|
7694
|
+
return this.isBrowser && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
7695
|
+
}
|
|
7696
|
+
/**
|
|
7697
|
+
* Storage access is wrapped because it throws rather than degrades in two ordinary cases:
|
|
7698
|
+
* Safari's private mode, and a browser configured to block site data. A theme preference is
|
|
7699
|
+
* not worth taking the app down for.
|
|
7700
|
+
*/
|
|
7701
|
+
readStored() {
|
|
7702
|
+
const key = this.config.storageKey;
|
|
7703
|
+
if (!key || !this.isBrowser)
|
|
7704
|
+
return null;
|
|
7705
|
+
try {
|
|
7706
|
+
return window.localStorage.getItem(key);
|
|
7707
|
+
}
|
|
7708
|
+
catch {
|
|
7709
|
+
return null;
|
|
7710
|
+
}
|
|
7711
|
+
}
|
|
7712
|
+
persist(theme) {
|
|
7713
|
+
const key = this.config.storageKey;
|
|
7714
|
+
if (!key || !this.isBrowser)
|
|
7715
|
+
return;
|
|
7716
|
+
try {
|
|
7717
|
+
window.localStorage.setItem(key, theme);
|
|
7718
|
+
}
|
|
7719
|
+
catch {
|
|
7720
|
+
// See readStored.
|
|
7721
|
+
}
|
|
6627
7722
|
}
|
|
6628
7723
|
applyTheme(theme) {
|
|
6629
7724
|
this.root.setAttribute('data-theme', theme);
|
|
@@ -7030,6 +8125,7 @@ const GOG_TOKEN_GROUPS = [
|
|
|
7030
8125
|
'--gog-calendar-focus-ring-offset',
|
|
7031
8126
|
'--gog-calendar-focus-ring-width',
|
|
7032
8127
|
'--gog-calendar-font-family',
|
|
8128
|
+
'--gog-calendar-footer-gap',
|
|
7033
8129
|
'--gog-calendar-header-gap',
|
|
7034
8130
|
'--gog-calendar-header-margin',
|
|
7035
8131
|
'--gog-calendar-lg-day-size',
|
|
@@ -7440,8 +8536,18 @@ const GOG_TOKEN_GROUPS = [
|
|
|
7440
8536
|
'--gog-input-label-text-transform',
|
|
7441
8537
|
'--gog-input-placeholder-color',
|
|
7442
8538
|
'--gog-input-radius',
|
|
8539
|
+
'--gog-input-spin-hover-bg',
|
|
8540
|
+
'--gog-input-spin-width',
|
|
7443
8541
|
'--gog-input-transition-duration',
|
|
7444
8542
|
'--gog-textarea-clear-icon-ratio',
|
|
8543
|
+
'--gog-textarea-resize-grip-color',
|
|
8544
|
+
'--gog-textarea-resize-grip-offset',
|
|
8545
|
+
'--gog-textarea-resize-grip-opacity',
|
|
8546
|
+
'--gog-textarea-resize-grip-size',
|
|
8547
|
+
'--gog-textarea-resize-grip-stripe-gap',
|
|
8548
|
+
'--gog-textarea-resize-grip-stripe-width',
|
|
8549
|
+
'--gog-textarea-resize-inset-bottom',
|
|
8550
|
+
'--gog-textarea-resize-inset-right',
|
|
7445
8551
|
],
|
|
7446
8552
|
},
|
|
7447
8553
|
{
|
|
@@ -7609,6 +8715,7 @@ const GOG_TOKEN_GROUPS = [
|
|
|
7609
8715
|
'--gog-paginator-ellipsis-font-size',
|
|
7610
8716
|
'--gog-paginator-ellipsis-min-width',
|
|
7611
8717
|
'--gog-paginator-gap',
|
|
8718
|
+
'--gog-paginator-page-size-min-width',
|
|
7612
8719
|
],
|
|
7613
8720
|
},
|
|
7614
8721
|
{
|
|
@@ -7652,8 +8759,10 @@ const GOG_TOKEN_GROUPS = [
|
|
|
7652
8759
|
'--gog-scroll-fade-duration',
|
|
7653
8760
|
'--gog-scroll-focus-ring',
|
|
7654
8761
|
'--gog-scroll-focus-ring-width',
|
|
8762
|
+
'--gog-scroll-normal-thumb-hit-padding',
|
|
7655
8763
|
'--gog-scroll-normal-thumb-min-size',
|
|
7656
8764
|
'--gog-scroll-normal-track-width',
|
|
8765
|
+
'--gog-scroll-thin-thumb-hit-padding',
|
|
7657
8766
|
'--gog-scroll-thin-thumb-min-size',
|
|
7658
8767
|
'--gog-scroll-thin-track-width',
|
|
7659
8768
|
'--gog-scroll-thumb-active-bg',
|
|
@@ -7877,6 +8986,8 @@ const GOG_TOKEN_GROUPS = [
|
|
|
7877
8986
|
'--gog-table-padding-h',
|
|
7878
8987
|
'--gog-table-row-border-width',
|
|
7879
8988
|
'--gog-table-row-transition-duration',
|
|
8989
|
+
'--gog-table-select-col-width',
|
|
8990
|
+
'--gog-table-selected-bg',
|
|
7880
8991
|
'--gog-table-slg-padding-v',
|
|
7881
8992
|
'--gog-table-slg-td-font-size',
|
|
7882
8993
|
'--gog-table-slg-th-font-size',
|
|
@@ -8216,5 +9327,5 @@ const GOG_TOKEN_GROUPS = [
|
|
|
8216
9327
|
* Generated bundle index. Do not edit.
|
|
8217
9328
|
*/
|
|
8218
9329
|
|
|
8219
|
-
export { AccordionComponent, AutocompleteComponent, ButtonComponent, ButtonToggleGroupComponent, CalendarComponent, CheckboxComponent, ChipComponent, CollapsibleComponent, Column, ConfirmationDialogComponent, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DialogComponent, DialogService, DividerComponent, GOG_CONFIG, GOG_TABS_STATE, GOG_TOKEN_GROUPS, GogAccordionChevronDirective, GogAccordionContentDirective, GogAccordionHeaderDirective, GogBadgeDirective, GogButtonToggleOptionDirective, GogCheckboxIconDirective, GogCollapsibleContentDirective, GogCollapsibleTriggerDirective, GogColumn, GogColumnBodyDirective, GogColumnHeaderDirective, GogDropdownBase, GogDropdownChevronDirective, GogDropdownOptionDirective, GogFloatLabelState, GogInputAddonEndDirective, GogInputAddonStartDirective, GogMultiselectClearIconDirective, GogTabContentDirective, GogTabHeaderDirective, GogTagIconDirective, GogTooltipDirective, ICON_DEFS, IconComponent, InputfieldComponent, MultiselectComponent, PaginatorComponent, ProgressbarComponent, RadioGroupComponent, ScrollComponent, SelectComponent, SkeletonComponent, SliderComponent, SpinnerComponent, SpinnerOverlayComponent, TabComponent, TableComponent, TabsComponent, TagComponent, TemplateDirective, TextareaComponent, ThemeService, ToastComponent, ToastContainerComponent, ToastService, ToggleComponent, addDays, addMonths, addYears, buildMonthGrid, clampDate, copyTimeOnto, daysInMonth, defaultCompare, formatDate, getByPath, isAfterDay, isBeforeDay, isInRange, isSameDay, isSameMonth, isSameOptionValue, isWithinBounds, localeFirstDayOfWeek, monthNames, parseDate, provideGogConfig, readOption, resolveConfigured, startOfDay, weekdayNames, withTime };
|
|
9330
|
+
export { AccordionComponent, AutocompleteComponent, ButtonComponent, ButtonToggleGroupComponent, CalendarComponent, CheckboxComponent, ChipComponent, CollapsibleComponent, Column, ConfirmationDialogComponent, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DialogComponent, DialogService, DividerComponent, GOG_CONFIG, GOG_ICONS, GOG_TABS_STATE, GOG_TOKEN_GROUPS, GogAccordionChevronDirective, GogAccordionContentDirective, GogAccordionHeaderDirective, GogBadgeDirective, GogButtonDirective, GogButtonToggleOptionDirective, GogCheckboxIconDirective, GogCollapsibleContentDirective, GogCollapsibleTriggerDirective, GogColumn, GogColumnBodyDirective, GogColumnHeaderDirective, GogDropdownBase, GogDropdownChevronDirective, GogDropdownOptionDirective, GogFloatLabelState, GogInputAddonEndDirective, GogInputAddonStartDirective, GogMultiselectClearIconDirective, GogTabContentDirective, GogTabHeaderDirective, GogTagIconDirective, GogTooltipDirective, ICON_DEFS, IconComponent, InputfieldComponent, MultiselectComponent, PaginatorComponent, ProgressbarComponent, RadioGroupComponent, ScrollComponent, SelectComponent, SkeletonComponent, SliderComponent, SpinnerComponent, SpinnerOverlayComponent, TabComponent, TableComponent, TabsComponent, TagComponent, TemplateDirective, TextareaComponent, ThemeService, ToastComponent, ToastContainerComponent, ToastService, ToggleComponent, addDays, addMonths, addYears, buildMonthGrid, clampDate, copyTimeOnto, daysInMonth, defaultCompare, formatDate, getByPath, isAfterDay, isBeforeDay, isInRange, isSameDay, isSameMonth, isSameOptionValue, isWithinBounds, localeFirstDayOfWeek, monthNames, parseDate, provideGogConfig, provideGogIcons, readOption, resolveConfigured, startOfDay, weekdayNames, withTime };
|
|
8220
9331
|
//# sourceMappingURL=guildofgleks-ui.mjs.map
|