@angular/cdk-experimental 20.2.7 → 20.2.8
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/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/accordion2.mjs.map +1 -1
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/list-navigation.mjs.map +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/option.mjs.map +1 -1
- package/fesm2022/polyfill.mjs.map +1 -1
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/radio-group.mjs.map +1 -1
- package/fesm2022/radio-group2.mjs.map +1 -1
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/tabs2.mjs.map +1 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/toolbar2.mjs.map +1 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/radio-group/radio-group.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n signal,\n WritableSignal,\n OnDestroy,\n} from '@angular/core';\nimport {RadioButtonPattern, RadioGroupPattern} from '../ui-patterns';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {CdkToolbar} from '../toolbar';\n\n// TODO: Move mapSignal to it's own file so it can be reused across components.\n\n/**\n * Creates a new writable signal (signal V) whose value is connected to the given original\n * writable signal (signal T) such that updating signal V updates signal T and vice-versa.\n *\n * This function establishes a two-way synchronization between the source signal and the new mapped\n * signal. When the source signal changes, the mapped signal updates by applying the `transform`\n * function. When the mapped signal is explicitly set or updated, the change is propagated back to\n * the source signal by applying the `reverse` function.\n */\nexport function mapSignal<T, V>(\n originalSignal: WritableSignal<T>,\n operations: {\n transform: (value: T) => V;\n reverse: (value: V) => T;\n },\n) {\n const mappedSignal = linkedSignal(() => operations.transform(originalSignal()));\n const updateMappedSignal = mappedSignal.update;\n const setMappedSignal = mappedSignal.set;\n\n mappedSignal.set = (newValue: V) => {\n setMappedSignal(newValue);\n originalSignal.set(operations.reverse(newValue));\n };\n\n mappedSignal.update = (updateFn: (value: V) => V) => {\n updateMappedSignal(oldValue => updateFn(oldValue));\n originalSignal.update(oldValue => operations.reverse(updateFn(operations.transform(oldValue))));\n };\n\n return mappedSignal;\n}\n\n/**\n * A radio button group container.\n *\n * Radio groups are used to group multiple radio buttons or radio group labels so they function as\n * a single form control. The CdkRadioGroup is meant to be used in conjunction with CdkRadioButton\n * as follows:\n *\n * ```html\n * <div cdkRadioGroup>\n * <label cdkRadioButton value=\"1\">Option 1</label>\n * <label cdkRadioButton value=\"2\">Option 2</label>\n * <label cdkRadioButton value=\"3\">Option 3</label>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkRadioGroup]',\n exportAs: 'cdkRadioGroup',\n host: {\n 'role': 'radiogroup',\n 'class': 'cdk-radio-group',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-readonly]': 'pattern.readonly()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n})\nexport class CdkRadioGroup<V> {\n /** The CdkRadioButtons nested inside of the CdkRadioGroup. */\n private readonly _cdkRadioButtons = contentChildren(CdkRadioButton, {descendants: true});\n\n /** A signal wrapper for directionality. */\n protected textDirection = inject(Directionality).valueSignal;\n\n /** A signal wrapper for toolbar. */\n toolbar = inject(CdkToolbar, {optional: true});\n\n /** Toolbar pattern if applicable */\n private readonly _toolbarPattern = computed(() => this.toolbar?.pattern);\n\n /** The RadioButton UIPatterns of the child CdkRadioButtons. */\n protected items = computed(() => this._cdkRadioButtons().map(radio => radio.pattern));\n\n /** Whether the radio group is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether disabled items in the group should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the radio group. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether the radio group is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the radio group is readonly. */\n readonly = input(false, {transform: booleanAttribute});\n\n /** The value of the currently selected radio button. */\n value = model<V | null>(null);\n\n /** The internal selection state for the radio group. */\n private readonly _value = mapSignal<V | null, V[]>(this.value, {\n transform: value => (value !== null ? [value] : []),\n reverse: values => (values.length === 0 ? null : values[0]),\n });\n\n /** The RadioGroup UIPattern. */\n pattern: RadioGroupPattern<V> = new RadioGroupPattern<V>({\n ...this,\n items: this.items,\n value: this._value,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n toolbar: this._toolbarPattern,\n focusMode: this._toolbarPattern()?.inputs.focusMode ?? this.focusMode,\n skipDisabled: this._toolbarPattern()?.inputs.skipDisabled ?? this.skipDisabled,\n });\n\n /** Whether the radio group has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n afterRenderEffect(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this.pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n });\n\n afterRenderEffect(() => {\n if (!this._hasFocused() && !this.toolbar) {\n this.pattern.setDefaultState();\n }\n });\n\n // TODO: Refactor to be handled within list behavior\n afterRenderEffect(() => {\n if (this.toolbar) {\n const radioButtons = this._cdkRadioButtons();\n // If the group is disabled and the toolbar is set to skip disabled items,\n // the radio buttons should not be part of the toolbar's navigation.\n if (this.disabled() && this.toolbar.skipDisabled()) {\n radioButtons.forEach(radio => this.toolbar!.unregister(radio));\n } else {\n radioButtons.forEach(radio => this.toolbar!.register(radio));\n }\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n toolbarButtonUnregister(radio: CdkRadioButton<V>) {\n if (this.toolbar) {\n this.toolbar.unregister(radio);\n }\n }\n}\n\n/** A selectable radio button in a CdkRadioGroup. */\n@Directive({\n selector: '[cdkRadioButton]',\n exportAs: 'cdkRadioButton',\n host: {\n 'role': 'radio',\n 'class': 'cdk-radio-button',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-checked]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[id]': 'pattern.id()',\n },\n})\nexport class CdkRadioButton<V> implements OnDestroy {\n /** A reference to the radio button element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkRadioGroup. */\n private readonly _cdkRadioGroup = inject(CdkRadioGroup);\n\n /** A unique identifier for the radio button. */\n private readonly _generatedId = inject(_IdGenerator).getId('cdk-radio-button-');\n\n /** A unique identifier for the radio button. */\n protected id = computed(() => this._generatedId);\n\n /** The value associated with the radio button. */\n readonly value = input.required<V>();\n\n /** The parent RadioGroup UIPattern. */\n protected group = computed(() => this._cdkRadioGroup.pattern);\n\n /** A reference to the radio button element to be focused on navigation. */\n element = computed(() => this._elementRef.nativeElement);\n\n /** Whether the radio button is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The RadioButton UIPattern. */\n pattern = new RadioButtonPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n group: this.group,\n element: this.element,\n });\n\n ngOnDestroy() {\n if (this._cdkRadioGroup.toolbar) {\n this._cdkRadioGroup.toolbarButtonUnregister(this);\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AA4BA;AAEA;;;;;;;;AAQG;AACa,SAAA,SAAS,CACvB,cAAiC,EACjC,UAGC,EAAA;AAED,IAAA,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC;AAC/E,IAAA,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM;AAC9C,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG;AAExC,IAAA,YAAY,CAAC,GAAG,GAAG,CAAC,QAAW,KAAI;QACjC,eAAe,CAAC,QAAQ,CAAC;QACzB,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClD,KAAC;AAED,IAAA,YAAY,CAAC,MAAM,GAAG,CAAC,QAAyB,KAAI;QAClD,kBAAkB,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClD,cAAc,CAAC,MAAM,CAAC,QAAQ,IAAI,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjG,KAAC;AAED,IAAA,OAAO,YAAY;AACrB;AAEA;;;;;;;;;;;;;;AAcG;MAiBU,aAAa,CAAA;;AAEP,IAAA,gBAAgB,GAAG,eAAe,CAAC,cAAc,oDAAG,WAAW,EAAE,IAAI,EAAA,CAAA,GAAA,CAAlB,EAAC,WAAW,EAAE,IAAI,EAAC,GAAC;;AAG9E,IAAA,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW;;IAG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OAAO;AACf,wBAAA,OAAO,EAAE,kBAAkB;AAC3B,wBAAA,oBAAoB,EAAE,kBAAkB;AACxC,wBAAA,iBAAiB,EAAE,oBAAoB;AACvC,wBAAA,qBAAqB,EAAE,oBAAoB;AAC3C,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,MAAM,EAAE,cAAc;AACvB,qBAAA;AACF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"radio-group.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/radio-group/radio-group.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n signal,\n WritableSignal,\n OnDestroy,\n} from '@angular/core';\nimport {RadioButtonPattern, RadioGroupPattern} from '../ui-patterns';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {CdkToolbar} from '../toolbar';\n\n// TODO: Move mapSignal to it's own file so it can be reused across components.\n\n/**\n * Creates a new writable signal (signal V) whose value is connected to the given original\n * writable signal (signal T) such that updating signal V updates signal T and vice-versa.\n *\n * This function establishes a two-way synchronization between the source signal and the new mapped\n * signal. When the source signal changes, the mapped signal updates by applying the `transform`\n * function. When the mapped signal is explicitly set or updated, the change is propagated back to\n * the source signal by applying the `reverse` function.\n */\nexport function mapSignal<T, V>(\n originalSignal: WritableSignal<T>,\n operations: {\n transform: (value: T) => V;\n reverse: (value: V) => T;\n },\n) {\n const mappedSignal = linkedSignal(() => operations.transform(originalSignal()));\n const updateMappedSignal = mappedSignal.update;\n const setMappedSignal = mappedSignal.set;\n\n mappedSignal.set = (newValue: V) => {\n setMappedSignal(newValue);\n originalSignal.set(operations.reverse(newValue));\n };\n\n mappedSignal.update = (updateFn: (value: V) => V) => {\n updateMappedSignal(oldValue => updateFn(oldValue));\n originalSignal.update(oldValue => operations.reverse(updateFn(operations.transform(oldValue))));\n };\n\n return mappedSignal;\n}\n\n/**\n * A radio button group container.\n *\n * Radio groups are used to group multiple radio buttons or radio group labels so they function as\n * a single form control. The CdkRadioGroup is meant to be used in conjunction with CdkRadioButton\n * as follows:\n *\n * ```html\n * <div cdkRadioGroup>\n * <label cdkRadioButton value=\"1\">Option 1</label>\n * <label cdkRadioButton value=\"2\">Option 2</label>\n * <label cdkRadioButton value=\"3\">Option 3</label>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkRadioGroup]',\n exportAs: 'cdkRadioGroup',\n host: {\n 'role': 'radiogroup',\n 'class': 'cdk-radio-group',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-readonly]': 'pattern.readonly()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n '(focusin)': 'onFocus()',\n },\n})\nexport class CdkRadioGroup<V> {\n /** The CdkRadioButtons nested inside of the CdkRadioGroup. */\n private readonly _cdkRadioButtons = contentChildren(CdkRadioButton, {descendants: true});\n\n /** A signal wrapper for directionality. */\n protected textDirection = inject(Directionality).valueSignal;\n\n /** A signal wrapper for toolbar. */\n toolbar = inject(CdkToolbar, {optional: true});\n\n /** Toolbar pattern if applicable */\n private readonly _toolbarPattern = computed(() => this.toolbar?.pattern);\n\n /** The RadioButton UIPatterns of the child CdkRadioButtons. */\n protected items = computed(() => this._cdkRadioButtons().map(radio => radio.pattern));\n\n /** Whether the radio group is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether disabled items in the group should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the radio group. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether the radio group is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the radio group is readonly. */\n readonly = input(false, {transform: booleanAttribute});\n\n /** The value of the currently selected radio button. */\n value = model<V | null>(null);\n\n /** The internal selection state for the radio group. */\n private readonly _value = mapSignal<V | null, V[]>(this.value, {\n transform: value => (value !== null ? [value] : []),\n reverse: values => (values.length === 0 ? null : values[0]),\n });\n\n /** The RadioGroup UIPattern. */\n pattern: RadioGroupPattern<V> = new RadioGroupPattern<V>({\n ...this,\n items: this.items,\n value: this._value,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n toolbar: this._toolbarPattern,\n focusMode: this._toolbarPattern()?.inputs.focusMode ?? this.focusMode,\n skipDisabled: this._toolbarPattern()?.inputs.skipDisabled ?? this.skipDisabled,\n });\n\n /** Whether the radio group has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n afterRenderEffect(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this.pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n });\n\n afterRenderEffect(() => {\n if (!this._hasFocused() && !this.toolbar) {\n this.pattern.setDefaultState();\n }\n });\n\n // TODO: Refactor to be handled within list behavior\n afterRenderEffect(() => {\n if (this.toolbar) {\n const radioButtons = this._cdkRadioButtons();\n // If the group is disabled and the toolbar is set to skip disabled items,\n // the radio buttons should not be part of the toolbar's navigation.\n if (this.disabled() && this.toolbar.skipDisabled()) {\n radioButtons.forEach(radio => this.toolbar!.unregister(radio));\n } else {\n radioButtons.forEach(radio => this.toolbar!.register(radio));\n }\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n\n toolbarButtonUnregister(radio: CdkRadioButton<V>) {\n if (this.toolbar) {\n this.toolbar.unregister(radio);\n }\n }\n}\n\n/** A selectable radio button in a CdkRadioGroup. */\n@Directive({\n selector: '[cdkRadioButton]',\n exportAs: 'cdkRadioButton',\n host: {\n 'role': 'radio',\n 'class': 'cdk-radio-button',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-checked]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[id]': 'pattern.id()',\n },\n})\nexport class CdkRadioButton<V> implements OnDestroy {\n /** A reference to the radio button element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkRadioGroup. */\n private readonly _cdkRadioGroup = inject(CdkRadioGroup);\n\n /** A unique identifier for the radio button. */\n private readonly _generatedId = inject(_IdGenerator).getId('cdk-radio-button-');\n\n /** A unique identifier for the radio button. */\n protected id = computed(() => this._generatedId);\n\n /** The value associated with the radio button. */\n readonly value = input.required<V>();\n\n /** The parent RadioGroup UIPattern. */\n protected group = computed(() => this._cdkRadioGroup.pattern);\n\n /** A reference to the radio button element to be focused on navigation. */\n element = computed(() => this._elementRef.nativeElement);\n\n /** Whether the radio button is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The RadioButton UIPattern. */\n pattern = new RadioButtonPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n group: this.group,\n element: this.element,\n });\n\n ngOnDestroy() {\n if (this._cdkRadioGroup.toolbar) {\n this._cdkRadioGroup.toolbarButtonUnregister(this);\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AA4BA;AAEA;;;;;;;;AAQG;AACa,SAAA,SAAS,CACvB,cAAiC,EACjC,UAGC,EAAA;AAED,IAAA,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC;AAC/E,IAAA,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM;AAC9C,IAAA,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG;AAExC,IAAA,YAAY,CAAC,GAAG,GAAG,CAAC,QAAW,KAAI;QACjC,eAAe,CAAC,QAAQ,CAAC;QACzB,cAAc,CAAC,GAAG,CAAC,UAAU,CA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,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,IAAA,EAAA,cAAA,EAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;kGAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAb1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,OAAO;AACf,wBAAA,OAAO,EAAE,kBAAkB;AAC3B,wBAAA,oBAAoB,EAAE,kBAAkB;AACxC,wBAAA,iBAAiB,EAAE,oBAAoB;AACvC,wBAAA,qBAAqB,EAAE,oBAAoB;AAC3C,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,MAAM,EAAE,cAAc;AACvB,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group2.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/radio-group.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {List, ListInputs} from '../behaviors/list/list';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {RadioButtonPattern} from './radio-button';\n\n/** Represents the required inputs for a radio group. */\nexport type RadioGroupInputs<V> = Omit<\n ListInputs<RadioButtonPattern<V>, V>,\n 'multi' | 'selectionMode' | 'wrap' | 'typeaheadDelay'\n> & {\n /** Whether the radio group is disabled. */\n disabled: SignalLike<boolean>;\n\n /** Whether the radio group is readonly. */\n readonly: SignalLike<boolean>;\n /** Parent toolbar of radio group */\n toolbar: SignalLike<ToolbarLike<V> | undefined>;\n};\n\n/**\n * Represents the properties exposed by a toolbar widget that need to be accessed by a radio group.\n * This exists to avoid circular dependency errors between the toolbar and radio button.\n */\ntype ToolbarWidgetLike = {\n id: SignalLike<string>;\n index: SignalLike<number>;\n element: SignalLike<HTMLElement>;\n disabled: SignalLike<boolean>;\n searchTerm: SignalLike<any>;\n value: SignalLike<any>;\n};\n\n/**\n * Represents the properties exposed by a toolbar that need to be accessed by a radio group.\n * This exists to avoid circular dependency errors between the toolbar and radio button.\n */\nexport interface ToolbarLike<V> {\n listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;\n orientation: SignalLike<'vertical' | 'horizontal'>;\n disabled: SignalLike<boolean>;\n}\n\n/** Controls the state of a radio group. */\nexport class RadioGroupPattern<V> {\n /** The list behavior for the radio group. */\n readonly listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;\n\n /** Whether the radio group is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the radio group is disabled. */\n disabled = computed(() => this.inputs.disabled() || this.listBehavior.disabled());\n\n /** The currently selected radio button. */\n selectedItem = computed(() => this.listBehavior.selectionBehavior.selectedItems()[0]);\n\n /** Whether the radio group is readonly. */\n readonly = computed(() => this.selectedItem()?.disabled() || this.inputs.readonly());\n\n /** The tabindex of the radio group. */\n tabindex = computed(() => (this.inputs.toolbar() ? -1 : this.listBehavior.tabindex()));\n\n /** The id of the current active radio button (if using activedescendant). */\n activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** The key used to navigate to the previous radio button. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next radio button. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the radio group. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n // When within a toolbar relinquish keyboard control\n if (this.inputs.toolbar()) {\n return manager;\n }\n\n // Readonly mode allows navigation but not selection changes.\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.listBehavior.prev())\n .on(this.nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n }\n\n // Default behavior: navigate and select on arrow keys, home, end.\n // Space/Enter also select the focused item.\n return manager\n .on(this.prevKey, () => this.listBehavior.prev({selectOne: true}))\n .on(this.nextKey, () => this.listBehavior.next({selectOne: true}))\n .on('Home', () => this.listBehavior.first({selectOne: true}))\n .on('End', () => this.listBehavior.last({selectOne: true}))\n .on(' ', () => this.listBehavior.selectOne())\n .on('Enter', () => this.listBehavior.selectOne());\n });\n\n /** The pointerdown event manager for the radio group. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n // When within a toolbar relinquish pointer control\n if (this.inputs.toolbar()) {\n return manager;\n }\n\n if (this.readonly()) {\n // Navigate focus only in readonly mode.\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!));\n }\n\n // Default behavior: navigate and select on click.\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}));\n });\n\n constructor(readonly inputs: RadioGroupInputs<V>) {\n this.orientation =\n inputs.toolbar() !== undefined ? inputs.toolbar()!.orientation : inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n activeItem: inputs.toolbar()?.listBehavior.inputs.activeItem ?? inputs.activeItem,\n wrap: () => !!inputs.toolbar(),\n multi: () => false,\n selectionMode: () => (inputs.toolbar() ? 'explicit' : 'follow'),\n typeaheadDelay: () => 0, // Radio groups do not support typeahead.\n });\n }\n\n /** Handles keydown events for the radio group. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles pointerdown events for the radio group. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /**\n * Sets the radio group to its default initial state.\n *\n * Sets the active index to the selected radio button if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable radio button.\n */\n setDefaultState() {\n let firstItem: RadioButtonPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Validates the state of the radio group and returns a list of accessibility violations. */\n validate(): string[] {\n const violations: string[] = [];\n\n if (this.selectedItem()?.disabled() && this.inputs.skipDisabled()) {\n violations.push(\n \"Accessibility Violation: The selected radio button is disabled while 'skipDisabled' is true, making the selection unreachable via keyboard.\",\n );\n }\n\n return violations;\n }\n\n /** Finds the RadioButtonPattern associated with a pointer event target. */\n private _getItem(e: PointerEvent): RadioButtonPattern<V> | undefined {\n if (!(e.target instanceof HTMLElement)) {\n return undefined;\n }\n\n // Assumes the target or its ancestor has role=\"radio\"\n const element = e.target.closest('[role=\"radio\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":[],"mappings":";;;;AAmDA;MACa,iBAAiB,CAAA;AAqFP,IAAA,MAAA;;AAnFZ,IAAA,YAAY;;AAGrB,IAAA,WAAW;;IAGX,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,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../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/radio-group/radio-group.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {List, ListInputs} from '../behaviors/list/list';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {RadioButtonPattern} from './radio-button';\n\n/** Represents the required inputs for a radio group. */\nexport type RadioGroupInputs<V> = Omit<\n ListInputs<RadioButtonPattern<V>, V>,\n 'multi' | 'selectionMode' | 'wrap' | 'typeaheadDelay'\n> & {\n /** Whether the radio group is disabled. */\n disabled: SignalLike<boolean>;\n\n /** Whether the radio group is readonly. */\n readonly: SignalLike<boolean>;\n /** Parent toolbar of radio group */\n toolbar: SignalLike<ToolbarLike<V> | undefined>;\n};\n\n/**\n * Represents the properties exposed by a toolbar widget that need to be accessed by a radio group.\n * This exists to avoid circular dependency errors between the toolbar and radio button.\n */\ntype ToolbarWidgetLike = {\n id: SignalLike<string>;\n index: SignalLike<number>;\n element: SignalLike<HTMLElement>;\n disabled: SignalLike<boolean>;\n searchTerm: SignalLike<any>;\n value: SignalLike<any>;\n};\n\n/**\n * Represents the properties exposed by a toolbar that need to be accessed by a radio group.\n * This exists to avoid circular dependency errors between the toolbar and radio button.\n */\nexport interface ToolbarLike<V> {\n listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;\n orientation: SignalLike<'vertical' | 'horizontal'>;\n disabled: SignalLike<boolean>;\n}\n\n/** Controls the state of a radio group. */\nexport class RadioGroupPattern<V> {\n /** The list behavior for the radio group. */\n readonly listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;\n\n /** Whether the radio group is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the radio group is disabled. */\n disabled = computed(() => this.inputs.disabled() || this.listBehavior.disabled());\n\n /** The currently selected radio button. */\n selectedItem = computed(() => this.listBehavior.selectionBehavior.selectedItems()[0]);\n\n /** Whether the radio group is readonly. */\n readonly = computed(() => this.selectedItem()?.disabled() || this.inputs.readonly());\n\n /** The tabindex of the radio group. */\n tabindex = computed(() => (this.inputs.toolbar() ? -1 : this.listBehavior.tabindex()));\n\n /** The id of the current active radio button (if using activedescendant). */\n activedescendant = computed(() => this.listBehavior.activedescendant());\n\n /** The key used to navigate to the previous radio button. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next radio button. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the radio group. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n // When within a toolbar relinquish keyboard control\n if (this.inputs.toolbar()) {\n return manager;\n }\n\n // Readonly mode allows navigation but not selection changes.\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.listBehavior.prev())\n .on(this.nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n }\n\n // Default behavior: navigate and select on arrow keys, home, end.\n // Space/Enter also select the focused item.\n return manager\n .on(this.prevKey, () => this.listBehavior.prev({selectOne: true}))\n .on(this.nextKey, () => this.listBehavior.next({selectOne: true}))\n .on('Home', () => this.listBehavior.first({selectOne: true}))\n .on('End', () => this.listBehavior.last({selectOne: true}))\n .on(' ', () => this.listBehavior.selectOne())\n .on('Enter', () => this.listBehavior.selectOne());\n });\n\n /** The pointerdown event manager for the radio group. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n // When within a toolbar relinquish pointer control\n if (this.inputs.toolbar()) {\n return manager;\n }\n\n if (this.readonly()) {\n // Navigate focus only in readonly mode.\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!));\n }\n\n // Default behavior: navigate and select on click.\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}));\n });\n\n constructor(readonly inputs: RadioGroupInputs<V>) {\n this.orientation =\n inputs.toolbar() !== undefined ? inputs.toolbar()!.orientation : inputs.orientation;\n\n this.listBehavior = new List({\n ...inputs,\n activeItem: inputs.toolbar()?.listBehavior.inputs.activeItem ?? inputs.activeItem,\n wrap: () => !!inputs.toolbar(),\n multi: () => false,\n selectionMode: () => (inputs.toolbar() ? 'explicit' : 'follow'),\n typeaheadDelay: () => 0, // Radio groups do not support typeahead.\n });\n }\n\n /** Handles keydown events for the radio group. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles pointerdown events for the radio group. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /**\n * Sets the radio group to its default initial state.\n *\n * Sets the active index to the selected radio button if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable radio button.\n */\n setDefaultState() {\n let firstItem: RadioButtonPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Validates the state of the radio group and returns a list of accessibility violations. */\n validate(): string[] {\n const violations: string[] = [];\n\n if (this.selectedItem()?.disabled() && this.inputs.skipDisabled()) {\n violations.push(\n \"Accessibility Violation: The selected radio button is disabled while 'skipDisabled' is true, making the selection unreachable via keyboard.\",\n );\n }\n\n return violations;\n }\n\n /** Finds the RadioButtonPattern associated with a pointer event target. */\n private _getItem(e: PointerEvent): RadioButtonPattern<V> | undefined {\n if (!(e.target instanceof HTMLElement)) {\n return undefined;\n }\n\n // Assumes the target or its ancestor has role=\"radio\"\n const element = e.target.closest('[role=\"radio\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":[],"mappings":";;;;AAmDA;MACa,iBAAiB,CAAA;AAqFP,IAAA,MAAA;;AAnFZ,IAAA,YAAY;;AAGrB,IAAA,WAAW;;IAGX,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;;AAGjF,IAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;;IAGrF,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;;AAGpF,IAAA,QAAQ,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;;AAGtF,IAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC;;AAGvE,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,YAAA,OAAO,SAAS;;AAElB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAAW;AAC3E,KAAC,CAAC;;AAGF,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,YAAA,OAA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E,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE;AACtC,YAAA,OAAO,SAAS;;;QAIlB,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC;;AAEhE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrolling.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/scrolling/scrolling-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {ListRange} from '@angular/cdk/collections';\nimport {\n CdkVirtualScrollViewport,\n VIRTUAL_SCROLL_STRATEGY,\n VirtualScrollStrategy,\n} from '@angular/cdk/scrolling';\nimport {Directive, forwardRef, Input, OnChanges} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * A class that tracks the size of items that have been seen and uses it to estimate the average\n * item size.\n */\nexport class ItemSizeAverager {\n /** The total amount of weight behind the current average. */\n private _totalWeight = 0;\n\n /** The current average item size. */\n private _averageItemSize: number;\n\n /** The default size to use for items when no data is available. */\n private _defaultItemSize: number;\n\n /** @param defaultItemSize The default size to use for items when no data is available. */\n constructor(defaultItemSize = 50) {\n this._defaultItemSize = defaultItemSize;\n this._averageItemSize = defaultItemSize;\n }\n\n /** Returns the average item size. */\n getAverageItemSize(): number {\n return this._averageItemSize;\n }\n\n /**\n * Adds a measurement sample for the estimator to consider.\n * @param range The measured range.\n * @param size The measured size of the given range in pixels.\n */\n addSample(range: ListRange, size: number) {\n const newTotalWeight = this._totalWeight + range.end - range.start;\n if (newTotalWeight) {\n const newAverageItemSize =\n (size + this._averageItemSize * this._totalWeight) / newTotalWeight;\n if (newAverageItemSize) {\n this._averageItemSize = newAverageItemSize;\n this._totalWeight = newTotalWeight;\n }\n }\n }\n\n /** Resets the averager. */\n reset() {\n this._averageItemSize = this._defaultItemSize;\n this._totalWeight = 0;\n }\n}\n\n/** Virtual scrolling strategy for lists with items of unknown or dynamic size. */\nexport class AutoSizeVirtualScrollStrategy implements VirtualScrollStrategy {\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n scrolledIndexChange = new Observable<number>(() => {\n // TODO(mmalerba): Implement.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw Error(\n 'cdk-virtual-scroll: scrolledIndexChange is currently not supported for the' +\n ' autosize scroll strategy',\n );\n }\n });\n\n /** The attached viewport. */\n private _viewport: CdkVirtualScrollViewport | null = null;\n\n /** The minimum amount of buffer rendered beyond the viewport (in pixels). */\n private _minBufferPx: number;\n\n /** The number of buffer items to render beyond the edge of the viewport (in pixels). */\n private _maxBufferPx: number;\n\n /** The estimator used to estimate the size of unseen items. */\n private _averager: ItemSizeAverager;\n\n /** The last measured scroll offset of the viewport. */\n private _lastScrollOffset: number;\n\n /** The last measured size of the rendered content in the viewport. */\n private _lastRenderedContentSize: number;\n\n /** The last measured size of the rendered content in the viewport. */\n private _lastRenderedContentOffset: number;\n\n /**\n * The number of consecutive cycles where removing extra items has failed. Failure here means that\n * we estimated how many items we could safely remove, but our estimate turned out to be too much\n * and it wasn't safe to remove that many elements.\n */\n private _removalFailures = 0;\n\n /**\n * @param minBufferPx The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered.\n * @param maxBufferPx The number of pixels worth of buffer to shoot for when rendering new items.\n * If the actual amount turns out to be less it will not necessarily trigger an additional\n * rendering cycle (as long as the amount of buffer is still greater than `minBufferPx`).\n * @param averager The averager used to estimate the size of unseen items.\n */\n constructor(minBufferPx: number, maxBufferPx: number, averager = new ItemSizeAverager()) {\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._averager = averager;\n }\n\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport: CdkVirtualScrollViewport) {\n this._averager.reset();\n this._viewport = viewport;\n this._renderContentForCurrentOffset();\n }\n\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach() {\n this._viewport = null;\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentScrolled() {\n if (this._viewport) {\n this._updateRenderedContentAfterScroll();\n }\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onDataLengthChanged() {\n if (this._viewport) {\n this._renderContentForCurrentOffset();\n this._checkRenderedContentSize();\n }\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentRendered() {\n if (this._viewport) {\n this._checkRenderedContentSize();\n }\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onRenderedOffsetChanged() {\n if (this._viewport) {\n this._checkRenderedContentOffset();\n }\n }\n\n /** Scroll to the offset for the given index. */\n scrollToIndex(): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // TODO(mmalerba): Implement.\n throw Error(\n 'cdk-virtual-scroll: scrollToIndex is currently not supported for the autosize' +\n ' scroll strategy',\n );\n }\n }\n\n /**\n * Update the buffer parameters.\n * @param minBufferPx The minimum amount of buffer rendered beyond the viewport (in pixels).\n * @param maxBufferPx The number of buffer items to render beyond the edge of the viewport (in\n * pixels).\n */\n updateBufferSize(minBufferPx: number, maxBufferPx: number) {\n if (maxBufferPx < minBufferPx) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n\n /** Update the rendered content after the user scrolls. */\n private _updateRenderedContentAfterScroll() {\n const viewport = this._viewport!;\n\n // The current scroll offset.\n const scrollOffset = viewport.measureScrollOffset();\n // The delta between the current scroll offset and the previously recorded scroll offset.\n let scrollDelta = scrollOffset - this._lastScrollOffset;\n // The magnitude of the scroll delta.\n let scrollMagnitude = Math.abs(scrollDelta);\n\n // The currently rendered range.\n const renderedRange = viewport.getRenderedRange();\n\n // If we're scrolling toward the top, we need to account for the fact that the predicted amount\n // of content and the actual amount of scrollable space may differ. We address this by slowly\n // correcting the difference on each scroll event.\n let offsetCorrection = 0;\n if (scrollDelta < 0) {\n // The content offset we would expect based on the average item size.\n const predictedOffset = renderedRange.start * this._averager.getAverageItemSize();\n // The difference between the predicted size of the un-rendered content at the beginning and\n // the actual available space to scroll over. We need to reduce this to zero by the time the\n // user scrolls to the top.\n // - 0 indicates that the predicted size and available space are the same.\n // - A negative number that the predicted size is smaller than the available space.\n // - A positive number indicates the predicted size is larger than the available space\n const offsetDifference = predictedOffset - this._lastRenderedContentOffset;\n // The amount of difference to correct during this scroll event. We calculate this as a\n // percentage of the total difference based on the percentage of the distance toward the top\n // that the user scrolled.\n offsetCorrection = Math.round(\n offsetDifference *\n Math.max(0, Math.min(1, scrollMagnitude / (scrollOffset + scrollMagnitude))),\n );\n\n // Based on the offset correction above, we pretend that the scroll delta was bigger or\n // smaller than it actually was, this way we can start to eliminate the difference.\n scrollDelta = scrollDelta - offsetCorrection;\n scrollMagnitude = Math.abs(scrollDelta);\n }\n\n // The current amount of buffer past the start of the viewport.\n const startBuffer = this._lastScrollOffset - this._lastRenderedContentOffset;\n // The current amount of buffer past the end of the viewport.\n const endBuffer =\n this._lastRenderedContentOffset +\n this._lastRenderedContentSize -\n (this._lastScrollOffset + viewport.getViewportSize());\n // The amount of unfilled space that should be filled on the side the user is scrolling toward\n // in order to safely absorb the scroll delta.\n const underscan =\n scrollMagnitude + this._minBufferPx - (scrollDelta < 0 ? startBuffer : endBuffer);\n\n // Check if there's unfilled space that we need to render new elements to fill.\n if (underscan > 0) {\n // Check if the scroll magnitude was larger than the viewport size. In this case the user\n // won't notice a discontinuity if we just jump to the new estimated position in the list.\n // However, if the scroll magnitude is smaller than the viewport the user might notice some\n // jitteriness if we just jump to the estimated position. Instead we make sure to scroll by\n // the same number of pixels as the scroll magnitude.\n if (scrollMagnitude >= viewport.getViewportSize()) {\n this._renderContentForCurrentOffset();\n } else {\n // The number of new items to render on the side the user is scrolling towards. Rather than\n // just filling the underscan space, we actually fill enough to have a buffer size of\n // `maxBufferPx`. This gives us a little wiggle room in case our item size estimate is off.\n const addItems = Math.max(\n 0,\n Math.ceil(\n (underscan - this._minBufferPx + this._maxBufferPx) /\n this._averager.getAverageItemSize(),\n ),\n );\n // The amount of filled space beyond what is necessary on the side the user is scrolling\n // away from.\n const overscan =\n (scrollDelta < 0 ? endBuffer : startBuffer) - this._minBufferPx + scrollMagnitude;\n // The number of currently rendered items to remove on the side the user is scrolling away\n // from. If removal has failed in recent cycles we are less aggressive in how much we try to\n // remove.\n const unboundedRemoveItems = Math.floor(\n overscan / this._averager.getAverageItemSize() / (this._removalFailures + 1),\n );\n const removeItems = Math.min(\n renderedRange.end - renderedRange.start,\n Math.max(0, unboundedRemoveItems),\n );\n\n // The new range we will tell the viewport to render. We first expand it to include the new\n // items we want rendered, we then contract the opposite side to remove items we no longer\n // want rendered.\n const range = this._expandRange(\n renderedRange,\n scrollDelta < 0 ? addItems : 0,\n scrollDelta > 0 ? addItems : 0,\n );\n if (scrollDelta < 0) {\n range.end = Math.max(range.start + 1, range.end - removeItems);\n } else {\n range.start = Math.min(range.end - 1, range.start + removeItems);\n }\n\n // The new offset we want to set on the rendered content. To determine this we measure the\n // number of pixels we removed and then adjust the offset to the start of the rendered\n // content or to the end of the rendered content accordingly (whichever one doesn't require\n // that the newly added items to be rendered to calculate.)\n let contentOffset: number;\n let contentOffsetTo: 'to-start' | 'to-end';\n if (scrollDelta < 0) {\n let removedSize = viewport.measureRangeSize({\n start: range.end,\n end: renderedRange.end,\n });\n // Check that we're not removing too much.\n if (removedSize <= overscan) {\n contentOffset =\n this._lastRenderedContentOffset + this._lastRenderedContentSize - removedSize;\n this._removalFailures = 0;\n } else {\n // If the removal is more than the overscan can absorb just undo it and record the fact\n // that the removal failed so we can be less aggressive next time.\n range.end = renderedRange.end;\n contentOffset = this._lastRenderedContentOffset + this._lastRenderedContentSize;\n this._removalFailures++;\n }\n contentOffsetTo = 'to-end';\n } else {\n const removedSize = viewport.measureRangeSize({\n start: renderedRange.start,\n end: range.start,\n });\n // Check that we're not removing too much.\n if (removedSize <= overscan) {\n contentOffset = this._lastRenderedContentOffset + removedSize;\n this._removalFailures = 0;\n } else {\n // If the removal is more than the overscan can absorb just undo it and record the fact\n // that the removal failed so we can be less aggressive next time.\n range.start = renderedRange.start;\n contentOffset = this._lastRenderedContentOffset;\n this._removalFailures++;\n }\n contentOffsetTo = 'to-start';\n }\n\n // Set the range and offset we calculated above.\n viewport.setRenderedRange(range);\n viewport.setRenderedContentOffset(contentOffset + offsetCorrection, contentOffsetTo);\n }\n } else if (offsetCorrection) {\n // Even if the rendered range didn't change, we may still need to adjust the content offset to\n // simulate scrolling slightly slower or faster than the user actually scrolled.\n viewport.setRenderedContentOffset(this._lastRenderedContentOffset + offsetCorrection);\n }\n\n // Save the scroll offset to be compared to the new value on the next scroll event.\n this._lastScrollOffset = scrollOffset;\n }\n\n /**\n * Checks the size of the currently rendered content and uses it to update the estimated item size\n * and estimated total content size.\n */\n private _checkRenderedContentSize() {\n const viewport = this._viewport!;\n this._lastRenderedContentSize = viewport.measureRenderedContentSize();\n this._averager.addSample(viewport.getRenderedRange(), this._lastRenderedContentSize);\n this._updateTotalContentSize(this._lastRenderedContentSize);\n }\n\n /** Checks the currently rendered content offset and saves the value for later use. */\n private _checkRenderedContentOffset() {\n const viewport = this._viewport!;\n this._lastRenderedContentOffset = viewport.getOffsetToRenderedContentStart()!;\n }\n\n /**\n * Recalculates the rendered content based on our estimate of what should be shown at the current\n * scroll offset.\n */\n private _renderContentForCurrentOffset() {\n const viewport = this._viewport!;\n const scrollOffset = viewport.measureScrollOffset();\n this._lastScrollOffset = scrollOffset;\n this._removalFailures = 0;\n\n const itemSize = this._averager.getAverageItemSize();\n const firstVisibleIndex = Math.min(\n viewport.getDataLength() - 1,\n Math.floor(scrollOffset / itemSize),\n );\n const bufferSize = Math.ceil(this._maxBufferPx / itemSize);\n const range = this._expandRange(\n this._getVisibleRangeForIndex(firstVisibleIndex),\n bufferSize,\n bufferSize,\n );\n\n viewport.setRenderedRange(range);\n viewport.setRenderedContentOffset(itemSize * range.start);\n }\n\n // TODO: maybe move to base class, can probably share with fixed size strategy.\n /**\n * Gets the visible range of data for the given start index. If the start index is too close to\n * the end of the list it may be backed up to ensure the estimated size of the range is enough to\n * fill the viewport.\n * Note: must not be called if `this._viewport` is null\n * @param startIndex The index to start the range at\n * @return a range estimated to be large enough to fill the viewport when rendered.\n */\n private _getVisibleRangeForIndex(startIndex: number): ListRange {\n const viewport = this._viewport!;\n const range: ListRange = {\n start: startIndex,\n end: startIndex + Math.ceil(viewport.getViewportSize() / this._averager.getAverageItemSize()),\n };\n const extra = range.end - viewport.getDataLength();\n if (extra > 0) {\n range.start = Math.max(0, range.start - extra);\n }\n return range;\n }\n\n // TODO: maybe move to base class, can probably share with fixed size strategy.\n /**\n * Expand the given range by the given amount in either direction.\n * Note: must not be called if `this._viewport` is null\n * @param range The range to expand\n * @param expandStart The number of items to expand the start of the range by.\n * @param expandEnd The number of items to expand the end of the range by.\n * @return The expanded range.\n */\n private _expandRange(range: ListRange, expandStart: number, expandEnd: number): ListRange {\n const viewport = this._viewport!;\n const start = Math.max(0, range.start - expandStart);\n const end = Math.min(viewport.getDataLength(), range.end + expandEnd);\n return {start, end};\n }\n\n /** Update the viewport's total content size. */\n private _updateTotalContentSize(renderedContentSize: number) {\n const viewport = this._viewport!;\n const renderedRange = viewport.getRenderedRange();\n const totalSize =\n renderedContentSize +\n (viewport.getDataLength() - (renderedRange.end - renderedRange.start)) *\n this._averager.getAverageItemSize();\n viewport.setTotalContentSize(totalSize);\n }\n}\n\n/**\n * Provider factory for `AutoSizeVirtualScrollStrategy` that simply extracts the already created\n * `AutoSizeVirtualScrollStrategy` from the given directive.\n * @param autoSizeDir The instance of `CdkAutoSizeVirtualScroll` to extract the\n * `AutoSizeVirtualScrollStrategy` from.\n */\nexport function _autoSizeVirtualScrollStrategyFactory(autoSizeDir: CdkAutoSizeVirtualScroll) {\n return autoSizeDir._scrollStrategy;\n}\n\n/** A virtual scroll strategy that supports unknown or dynamic size items. */\n@Directive({\n selector: 'cdk-virtual-scroll-viewport[autosize]',\n providers: [\n {\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _autoSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkAutoSizeVirtualScroll)],\n },\n ],\n})\nexport class CdkAutoSizeVirtualScroll implements OnChanges {\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n @Input()\n get minBufferPx(): number {\n return this._minBufferPx;\n }\n set minBufferPx(value: NumberInput) {\n this._minBufferPx = coerceNumberProperty(value);\n }\n _minBufferPx = 100;\n\n /**\n * The number of pixels worth of buffer to shoot for when rendering new items.\n * If the actual amount turns out to be less it will not necessarily trigger an additional\n * rendering cycle (as long as the amount of buffer is still greater than `minBufferPx`).\n * Defaults to 200px.\n */\n @Input()\n get maxBufferPx(): number {\n return this._maxBufferPx;\n }\n set maxBufferPx(value: NumberInput) {\n this._maxBufferPx = coerceNumberProperty(value);\n }\n _maxBufferPx = 200;\n\n /** The scroll strategy used by this directive. */\n _scrollStrategy = new AutoSizeVirtualScrollStrategy(this.minBufferPx, this.maxBufferPx);\n\n ngOnChanges() {\n this._scrollStrategy.updateBufferSize(this.minBufferPx, this.maxBufferPx);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkAutoSizeVirtualScroll} from './auto-size-virtual-scroll';\n\n@NgModule({\n imports: [CdkAutoSizeVirtualScroll],\n exports: [CdkAutoSizeVirtualScroll],\n})\nexport class ScrollingModule {}\n"],"names":[],"mappings":";;;;;;AAkBA;;;AAGG;MACU,gBAAgB,CAAA;;IAEnB,YAAY,GAAG,CAAC;;AAGhB,IAAA,gBAAgB;;AAGhB,IAAA,gBAAgB;;IAGxB,WAAY,CAAA,eAAe,GAAG,EAAE,EAAA;AAC9B,QAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe;AACvC,QAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe;;;IAIzC,kBAAkB,GAAA;QAChB,OAAO,IAAI,CAAC,gBAAgB;;AAG9B;;;;AAIG;IACH,SAAS,CAAC,KAAgB,EAAE,IAAY,EAAA;AACtC,QAAA,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK;QAClE,IAAI,cAAc,EAAE;AAClB,YAAA,MAAM,kBAAkB,GACtB,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,YAAY,IAAI,cAAc;YACrE,IAAI,kBAAkB,EAAE;AACtB,gBAAA,IAAI,CAAC,gBAAgB,GAAG,kBAAkB;AAC1C,gBAAA,IAAI,CAAC,YAAY,GAAG,cAAc;;;;;IAMxC,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB;AAC7C,QAAA,IAAI,CAAC,YAAY,GAAG,CAAC;;AAExB;AAED;MACa,6BAA6B,CAAA;;AAExC,IAAA,mBAAmB,GAAG,IAAI,UAAU,CAAS,MAAK;;AAEhD,QAAA,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE;YACjD,MAAM,KAAK,CACT,4EAA4E;AAC1E,gBAAA,2BAA2B,CAC9B;;AAEL,KAAC,CAAC;;IAGM,SAAS,GAAoC,IA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AAA,EAAA,CACxB,wBAAwB,CAAA,EAAA,CAAA;+GAEvB,eAAe,EAAA,CAAA;;kGAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACpC,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"scrolling.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/scrolling/scrolling-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {ListRange} from '@angular/cdk/collections';\nimport {\n CdkVirtualScrollViewport,\n VIRTUAL_SCROLL_STRATEGY,\n VirtualScrollStrategy,\n} from '@angular/cdk/scrolling';\nimport {Directive, forwardRef, Input, OnChanges} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * A class that tracks the size of items that have been seen and uses it to estimate the average\n * item size.\n */\nexport class ItemSizeAverager {\n /** The total amount of weight behind the current average. */\n private _totalWeight = 0;\n\n /** The current average item size. */\n private _averageItemSize: number;\n\n /** The default size to use for items when no data is available. */\n private _defaultItemSize: number;\n\n /** @param defaultItemSize The default size to use for items when no data is available. */\n constructor(defaultItemSize = 50) {\n this._defaultItemSize = defaultItemSize;\n this._averageItemSize = defaultItemSize;\n }\n\n /** Returns the average item size. */\n getAverageItemSize(): number {\n return this._averageItemSize;\n }\n\n /**\n * Adds a measurement sample for the estimator to consider.\n * @param range The measured range.\n * @param size The measured size of the given range in pixels.\n */\n addSample(range: ListRange, size: number) {\n const newTotalWeight = this._totalWeight + range.end - range.start;\n if (newTotalWeight) {\n const newAverageItemSize =\n (size + this._averageItemSize * this._totalWeight) / newTotalWeight;\n if (newAverageItemSize) {\n this._averageItemSize = newAverageItemSize;\n this._totalWeight = newTotalWeight;\n }\n }\n }\n\n /** Resets the averager. */\n reset() {\n this._averageItemSize = this._defaultItemSize;\n this._totalWeight = 0;\n }\n}\n\n/** Virtual scrolling strategy for lists with items of unknown or dynamic size. */\nexport class AutoSizeVirtualScrollStrategy implements VirtualScrollStrategy {\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n scrolledIndexChange = new Observable<number>(() => {\n // TODO(mmalerba): Implement.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw Error(\n 'cdk-virtual-scroll: scrolledIndexChange is currently not supported for the' +\n ' autosize scroll strategy',\n );\n }\n });\n\n /** The attached viewport. */\n private _viewport: CdkVirtualScrollViewport | null = null;\n\n /** The minimum amount of buffer rendered beyond the viewport (in pixels). */\n private _minBufferPx: number;\n\n /** The number of buffer items to render beyond the edge of the viewport (in pixels). */\n private _maxBufferPx: number;\n\n /** The estimator used to estimate the size of unseen items. */\n private _averager: ItemSizeAverager;\n\n /** The last measured scroll offset of the viewport. */\n private _lastScrollOffset: number;\n\n /** The last measured size of the rendered content in the viewport. */\n private _lastRenderedContentSize: number;\n\n /** The last measured size of the rendered content in the viewport. */\n private _lastRenderedContentOffset: number;\n\n /**\n * The number of consecutive cycles where removing extra items has failed. Failure here means that\n * we estimated how many items we could safely remove, but our estimate turned out to be too much\n * and it wasn't safe to remove that many elements.\n */\n private _removalFailures = 0;\n\n /**\n * @param minBufferPx The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered.\n * @param maxBufferPx The number of pixels worth of buffer to shoot for when rendering new items.\n * If the actual amount turns out to be less it will not necessarily trigger an additional\n * rendering cycle (as long as the amount of buffer is still greater than `minBufferPx`).\n * @param averager The averager used to estimate the size of unseen items.\n */\n constructor(minBufferPx: number, maxBufferPx: number, averager = new ItemSizeAverager()) {\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._averager = averager;\n }\n\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport: CdkVirtualScrollViewport) {\n this._averager.reset();\n this._viewport = viewport;\n this._renderContentForCurrentOffset();\n }\n\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach() {\n this._viewport = null;\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentScrolled() {\n if (this._viewport) {\n this._updateRenderedContentAfterScroll();\n }\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onDataLengthChanged() {\n if (this._viewport) {\n this._renderContentForCurrentOffset();\n this._checkRenderedContentSize();\n }\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentRendered() {\n if (this._viewport) {\n this._checkRenderedContentSize();\n }\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onRenderedOffsetChanged() {\n if (this._viewport) {\n this._checkRenderedContentOffset();\n }\n }\n\n /** Scroll to the offset for the given index. */\n scrollToIndex(): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // TODO(mmalerba): Implement.\n throw Error(\n 'cdk-virtual-scroll: scrollToIndex is currently not supported for the autosize' +\n ' scroll strategy',\n );\n }\n }\n\n /**\n * Update the buffer parameters.\n * @param minBufferPx The minimum amount of buffer rendered beyond the viewport (in pixels).\n * @param maxBufferPx The number of buffer items to render beyond the edge of the viewport (in\n * pixels).\n */\n updateBufferSize(minBufferPx: number, maxBufferPx: number) {\n if (maxBufferPx < minBufferPx) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n\n /** Update the rendered content after the user scrolls. */\n private _updateRenderedContentAfterScroll() {\n const viewport = this._viewport!;\n\n // The current scroll offset.\n const scrollOffset = viewport.measureScrollOffset();\n // The delta between the current scroll offset and the previously recorded scroll offset.\n let scrollDelta = scrollOffset - this._lastScrollOffset;\n // The magnitude of the scroll delta.\n let scrollMagnitude = Math.abs(scrollDelta);\n\n // The currently rendered range.\n const renderedRange = viewport.getRenderedRange();\n\n // If we're scrolling toward the top, we need to account for the fact that the predicted amount\n // of content and the actual amount of scrollable space may differ. We address this by slowly\n // correcting the difference on each scroll event.\n let offsetCorrection = 0;\n if (scrollDelta < 0) {\n // The content offset we would expect based on the average item size.\n const predictedOffset = renderedRange.start * this._averager.getAverageItemSize();\n // The difference between the predicted size of the un-rendered content at the beginning and\n // the actual available space to scroll over. We need to reduce this to zero by the time the\n // user scrolls to the top.\n // - 0 indicates that the predicted size and available space are the same.\n // - A negative number that the predicted size is smaller than the available space.\n // - A positive number indicates the predicted size is larger than the available space\n const offsetDifference = predictedOffset - this._lastRenderedContentOffset;\n // The amount of difference to correct during this scroll event. We calculate this as a\n // percentage of the total difference based on the percentage of the distance toward the top\n // that the user scrolled.\n offsetCorrection = Math.round(\n offsetDifference *\n Math.max(0, Math.min(1, scrollMagnitude / (scrollOffset + scrollMagnitude))),\n );\n\n // Based on the offset correction above, we pretend that the scroll delta was bigger or\n // smaller than it actually was, this way we can start to eliminate the difference.\n scrollDelta = scrollDelta - offsetCorrection;\n scrollMagnitude = Math.abs(scrollDelta);\n }\n\n // The current amount of buffer past the start of the viewport.\n const startBuffer = this._lastScrollOffset - this._lastRenderedContentOffset;\n // The current amount of buffer past the end of the viewport.\n const endBuffer =\n this._lastRenderedContentOffset +\n this._lastRenderedContentSize -\n (this._lastScrollOffset + viewport.getViewportSize());\n // The amount of unfilled space that should be filled on the side the user is scrolling toward\n // in order to safely absorb the scroll delta.\n const underscan =\n scrollMagnitude + this._minBufferPx - (scrollDelta < 0 ? startBuffer : endBuffer);\n\n // Check if there's unfilled space that we need to render new elements to fill.\n if (underscan > 0) {\n // Check if the scroll magnitude was larger than the viewport size. In this case the user\n // won't notice a discontinuity if we just jump to the new estimated position in the list.\n // However, if the scroll magnitude is smaller than the viewport the user might notice some\n // jitteriness if we just jump to the estimated position. Instead we make sure to scroll by\n // the same number of pixels as the scroll magnitude.\n if (scrollMagnitude >= viewport.getViewportSize()) {\n this._renderContentForCurrentOffset();\n } else {\n // The number of new items to render on the side the user is scrolling towards. Rather than\n // just filling the underscan space, we actually fill enough to have a buffer size of\n // `maxBufferPx`. This gives us a little wiggle room in case our item size estimate is off.\n const addItems = Math.max(\n 0,\n Math.ceil(\n (underscan - this._minBufferPx + this._maxBufferPx) /\n this._averager.getAverageItemSize(),\n ),\n );\n // The amount of filled space beyond what is necessary on the side the user is scrolling\n // away from.\n const overscan =\n (scrollDelta < 0 ? endBuffer : startBuffer) - this._minBufferPx + scrollMagnitude;\n // The number of currently rendered items to remove on the side the user is scrolling away\n // from. If removal has failed in recent cycles we are less aggressive in how much we try to\n // remove.\n const unboundedRemoveItems = Math.floor(\n overscan / this._averager.getAverageItemSize() / (this._removalFailures + 1),\n );\n const removeItems = Math.min(\n renderedRange.end - renderedRange.start,\n Math.max(0, unboundedRemoveItems),\n );\n\n // The new range we will tell the viewport to render. We first expand it to include the new\n // items we want rendered, we then contract the opposite side to remove items we no longer\n // want rendered.\n const range = this._expandRange(\n renderedRange,\n scrollDelta < 0 ? addItems : 0,\n scrollDelta > 0 ? addItems : 0,\n );\n if (scrollDelta < 0) {\n range.end = Math.max(range.start + 1, range.end - removeItems);\n } else {\n range.start = Math.min(range.end - 1, range.start + removeItems);\n }\n\n // The new offset we want to set on the rendered content. To determine this we measure the\n // number of pixels we removed and then adjust the offset to the start of the rendered\n // content or to the end of the rendered content accordingly (whichever one doesn't require\n // that the newly added items to be rendered to calculate.)\n let contentOffset: number;\n let contentOffsetTo: 'to-start' | 'to-end';\n if (scrollDelta < 0) {\n let removedSize = viewport.measureRangeSize({\n start: range.end,\n end: renderedRange.end,\n });\n // Check that we're not removing too much.\n if (removedSize <= overscan) {\n contentOffset =\n this._lastRenderedContentOffset + this._lastRenderedContentSize - removedSize;\n this._removalFailures = 0;\n } else {\n // If the removal is more than the overscan can absorb just undo it and record the fact\n // that the removal failed so we can be less aggressive next time.\n range.end = renderedRange.end;\n contentOffset = this._lastRenderedContentOffset + this._lastRenderedContentSize;\n this._removalFailures++;\n }\n contentOffsetTo = 'to-end';\n } else {\n const removedSize = viewport.measureRangeSize({\n start: renderedRange.start,\n end: range.start,\n });\n // Check that we're not removing too much.\n if (removedSize <= overscan) {\n contentOffset = this._lastRenderedContentOffset + removedSize;\n this._removalFailures = 0;\n } else {\n // If the removal is more than the overscan can absorb just undo it and record the fact\n // that the removal failed so we can be less aggressive next time.\n range.start = renderedRange.start;\n contentOffset = this._lastRenderedContentOffset;\n this._removalFailures++;\n }\n contentOffsetTo = 'to-start';\n }\n\n // Set the range and offset we calculated above.\n viewport.setRenderedRange(range);\n viewport.setRenderedContentOffset(contentOffset + offsetCorrection, contentOffsetTo);\n }\n } else if (offsetCorrection) {\n // Even if the rendered range didn't change, we may still need to adjust the content offset to\n // simulate scrolling slightly slower or faster than the user actually scrolled.\n viewport.setRenderedContentOffset(this._lastRenderedContentOffset + offsetCorrection);\n }\n\n // Save the scroll offset to be compared to the new value on the next scroll event.\n this._lastScrollOffset = scrollOffset;\n }\n\n /**\n * Checks the size of the currently rendered content and uses it to update the estimated item size\n * and estimated total content size.\n */\n private _checkRenderedContentSize() {\n const viewport = this._viewport!;\n this._lastRenderedContentSize = viewport.measureRenderedContentSize();\n this._averager.addSample(viewport.getRenderedRange(), this._lastRenderedContentSize);\n this._updateTotalContentSize(this._lastRenderedContentSize);\n }\n\n /** Checks the currently rendered content offset and saves the value for later use. */\n private _checkRenderedContentOffset() {\n const viewport = this._viewport!;\n this._lastRenderedContentOffset = viewport.getOffsetToRenderedContentStart()!;\n }\n\n /**\n * Recalculates the rendered content based on our estimate of what should be shown at the current\n * scroll offset.\n */\n private _renderContentForCurrentOffset() {\n const viewport = this._viewport!;\n const scrollOffset = viewport.measureScrollOffset();\n this._lastScrollOffset = scrollOffset;\n this._removalFailures = 0;\n\n const itemSize = this._averager.getAverageItemSize();\n const firstVisibleIndex = Math.min(\n viewport.getDataLength() - 1,\n Math.floor(scrollOffset / itemSize),\n );\n const bufferSize = Math.ceil(this._maxBufferPx / itemSize);\n const range = this._expandRange(\n this._getVisibleRangeForIndex(firstVisibleIndex),\n bufferSize,\n bufferSize,\n );\n\n viewport.setRenderedRange(range);\n viewport.setRenderedContentOffset(itemSize * range.start);\n }\n\n // TODO: maybe move to base class, can probably share with fixed size strategy.\n /**\n * Gets the visible range of data for the given start index. If the start index is too close to\n * the end of the list it may be backed up to ensure the estimated size of the range is enough to\n * fill the viewport.\n * Note: must not be called if `this._viewport` is null\n * @param startIndex The index to start the range at\n * @return a range estimated to be large enough to fill the viewport when rendered.\n */\n private _getVisibleRangeForIndex(startIndex: number): ListRange {\n const viewport = this._viewport!;\n const range: ListRange = {\n start: startIndex,\n end: startIndex + Math.ceil(viewport.getViewportSize() / this._averager.getAverageItemSize()),\n };\n const extra = range.end - viewport.getDataLength();\n if (extra > 0) {\n range.start = Math.max(0, range.start - extra);\n }\n return range;\n }\n\n // TODO: maybe move to base class, can probably share with fixed size strategy.\n /**\n * Expand the given range by the given amount in either direction.\n * Note: must not be called if `this._viewport` is null\n * @param range The range to expand\n * @param expandStart The number of items to expand the start of the range by.\n * @param expandEnd The number of items to expand the end of the range by.\n * @return The expanded range.\n */\n private _expandRange(range: ListRange, expandStart: number, expandEnd: number): ListRange {\n const viewport = this._viewport!;\n const start = Math.max(0, range.start - expandStart);\n const end = Math.min(viewport.getDataLength(), range.end + expandEnd);\n return {start, end};\n }\n\n /** Update the viewport's total content size. */\n private _updateTotalContentSize(renderedContentSize: number) {\n const viewport = this._viewport!;\n const renderedRange = viewport.getRenderedRange();\n const totalSize =\n renderedContentSize +\n (viewport.getDataLength() - (renderedRange.end - renderedRange.start)) *\n this._averager.getAverageItemSize();\n viewport.setTotalContentSize(totalSize);\n }\n}\n\n/**\n * Provider factory for `AutoSizeVirtualScrollStrategy` that simply extracts the already created\n * `AutoSizeVirtualScrollStrategy` from the given directive.\n * @param autoSizeDir The instance of `CdkAutoSizeVirtualScroll` to extract the\n * `AutoSizeVirtualScrollStrategy` from.\n */\nexport function _autoSizeVirtualScrollStrategyFactory(autoSizeDir: CdkAutoSizeVirtualScroll) {\n return autoSizeDir._scrollStrategy;\n}\n\n/** A virtual scroll strategy that supports unknown or dynamic size items. */\n@Directive({\n selector: 'cdk-virtual-scroll-viewport[autosize]',\n providers: [\n {\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _autoSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkAutoSizeVirtualScroll)],\n },\n ],\n})\nexport class CdkAutoSizeVirtualScroll implements OnChanges {\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n @Input()\n get minBufferPx(): number {\n return this._minBufferPx;\n }\n set minBufferPx(value: NumberInput) {\n this._minBufferPx = coerceNumberProperty(value);\n }\n _minBufferPx = 100;\n\n /**\n * The number of pixels worth of buffer to shoot for when rendering new items.\n * If the actual amount turns out to be less it will not necessarily trigger an additional\n * rendering cycle (as long as the amount of buffer is still greater than `minBufferPx`).\n * Defaults to 200px.\n */\n @Input()\n get maxBufferPx(): number {\n return this._maxBufferPx;\n }\n set maxBufferPx(value: NumberInput) {\n this._maxBufferPx = coerceNumberProperty(value);\n }\n _maxBufferPx = 200;\n\n /** The scroll strategy used by this directive. */\n _scrollStrategy = new AutoSizeVirtualScrollStrategy(this.minBufferPx, this.maxBufferPx);\n\n ngOnChanges() {\n this._scrollStrategy.updateBufferSize(this.minBufferPx, this.maxBufferPx);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkAutoSizeVirtualScroll} from './auto-size-virtual-sc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CAAA;+GAEvB,eAAe,EAAA,CAAA;;kGAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACpC,iBAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-set.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/select-all.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-toggle.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-column.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/row-selection.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {TrackByFunction} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/**\n * Maintains a set of selected values. One or more values can be added to or removed from the\n * selection.\n */\ninterface TrackBySelection<T> {\n isSelected(value: SelectableWithIndex<T>): boolean;\n select(...values: SelectableWithIndex<T>[]): void;\n deselect(...values: SelectableWithIndex<T>[]): void;\n changed: Subject<SelectionChange<T>>;\n}\n\n/**\n * A selectable value with an optional index. The index is required when the selection is used with\n * `trackBy`.\n */\nexport interface SelectableWithIndex<T> {\n value: T;\n index?: number;\n}\n\n/**\n * Represents the change in the selection set.\n */\nexport interface SelectionChange<T> {\n before: SelectableWithIndex<T>[];\n after: SelectableWithIndex<T>[];\n}\n\n/**\n * Maintains a set of selected items. Support selecting and deselecting items, and checking if a\n * value is selected.\n * When constructed with a `trackByFn`, all the items will be identified by applying the `trackByFn`\n * on them. Because `trackByFn` requires the index of the item to be passed in, the `index` field is\n * expected to be set when calling `isSelected`, `select` and `deselect`.\n */\nexport class SelectionSet<T> implements TrackBySelection<T> {\n private _selectionMap = new Map<T | ReturnType<TrackByFunction<T>>, SelectableWithIndex<T>>();\n changed = new Subject<SelectionChange<T>>();\n\n constructor(\n private _multiple = false,\n private _trackByFn?: TrackByFunction<T>,\n ) {}\n\n isSelected(value: SelectableWithIndex<T>): boolean {\n return this._selectionMap.has(this._getTrackedByValue(value));\n }\n\n select(...selects: SelectableWithIndex<T>[]) {\n if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('SelectionSet: not multiple selection');\n }\n\n const before = this._getCurrentSelection();\n\n if (!this._multiple) {\n this._selectionMap.clear();\n }\n\n const toSelect: SelectableWithIndex<T>[] = [];\n for (const select of selects) {\n if (this.isSelected(select)) {\n continue;\n }\n\n toSelect.push(select);\n this._markSelected(this._getTrackedByValue(select), select);\n }\n\n const after = this._getCurrentSelection();\n\n this.changed.next({before, after});\n }\n\n deselect(...selects: SelectableWithIndex<T>[]) {\n if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('SelectionSet: not multiple selection');\n }\n\n const before = this._getCurrentSelection();\n const toDeselect: SelectableWithIndex<T>[] = [];\n\n for (const select of selects) {\n if (!this.isSelected(select)) {\n continue;\n }\n\n toDeselect.push(select);\n this._markDeselected(this._getTrackedByValue(select));\n }\n\n const after = this._getCurrentSelection();\n this.changed.next({before, after});\n }\n\n private _markSelected(key: T | ReturnType<TrackByFunction<T>>, toSelect: SelectableWithIndex<T>) {\n this._selectionMap.set(key, toSelect);\n }\n\n private _markDeselected(key: T | ReturnType<TrackByFunction<T>>) {\n this._selectionMap.delete(key);\n }\n\n private _getTrackedByValue(select: SelectableWithIndex<T>) {\n if (!this._trackByFn) {\n return select.value;\n }\n\n if (select.index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('SelectionSet: index required when trackByFn is used.');\n }\n\n return this._trackByFn(select.index!, select.value);\n }\n\n private _getCurrentSelection(): SelectableWithIndex<T>[] {\n return Array.from(this._selectionMap.values());\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {CollectionViewer, DataSource, isDataSource, ListRange} from '@angular/cdk/collections';\nimport {\n AfterContentChecked,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n TrackByFunction,\n} from '@angular/core';\nimport {Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {SelectableWithIndex, SelectionChange, SelectionSet} from './selection-set';\n\n/**\n * Manages the selection states of the items and provides methods to check and update the selection\n * states.\n * It must be applied to the parent element if `cdkSelectionToggle`, `cdkSelectAll`,\n * `cdkRowSelection` and `cdkSelectionColumn` are applied.\n */\n@Directive({\n selector: '[cdkSelection]',\n exportAs: 'cdkSelection',\n})\nexport class CdkSelection<T> implements OnInit, AfterContentChecked, CollectionViewer, OnDestroy {\n viewChange: Observable<ListRange>;\n\n @Input()\n get dataSource(): TableDataSource<T> {\n return this._dataSource;\n }\n set dataSource(dataSource: TableDataSource<T>) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: TableDataSource<T>;\n\n @Input('trackBy') trackByFn: TrackByFunction<T>;\n\n /** Whether to support multiple selection */\n @Input('cdkSelectionMultiple')\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(multiple: BooleanInput) {\n this._multiple = coerceBooleanProperty(multiple);\n }\n protected _multiple: boolean;\n\n /** Emits when selection changes. */\n @Output('cdkSelectionChange') readonly change = new EventEmitter<SelectionChange<T>>();\n\n /** Latest data provided by the data source. */\n private _data: T[] | readonly T[];\n\n /** Subscription that listens for the data provided by the data source. */\n private _renderChangeSubscription: Subscription | null;\n\n private _destroyed = new Subject<void>();\n\n private _selection: SelectionSet<T>;\n\n private _switchDataSource(dataSource: TableDataSource<T>) {\n this._data = [];\n\n // TODO: Move this logic to a shared function in `cdk/collections`.\n if (isDataSource(this._dataSource)) {\n this._dataSource.disconnect(this);\n }\n\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n\n this._dataSource = dataSource;\n }\n\n private _observeRenderChanges() {\n if (!this._dataSource) {\n return;\n }\n\n let dataStream: Observable<readonly T[]> | undefined;\n\n if (isDataSource(this._dataSource)) {\n dataStream = this._dataSource.connect(this);\n } else if (this._dataSource instanceof Observable) {\n dataStream = this._dataSource;\n } else if (Array.isArray(this._dataSource)) {\n dataStream = observableOf(this._dataSource);\n }\n\n if (dataStream == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Unknown data source');\n }\n\n this._renderChangeSubscription = dataStream!\n .pipe(takeUntil(this._destroyed))\n .subscribe(data => {\n this._data = data || [];\n });\n }\n\n ngOnInit() {\n this._selection = new SelectionSet<T>(this._multiple, this.trackByFn);\n this._selection.changed.pipe(takeUntil(this._destroyed)).subscribe(change => {\n this._updateSelectAllState();\n this.change.emit(change);\n });\n }\n\n ngAfterContentChecked() {\n if (this._dataSource && !this._renderChangeSubscription) {\n this._observeRenderChanges();\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n\n if (isDataSource(this._dataSource)) {\n this._dataSource.disconnect(this);\n }\n }\n\n /** Toggles selection for a given value. `index` is required if `trackBy` is used. */\n toggleSelection(value: T, index?: number) {\n if (!!this.trackByFn && index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelection: index required when trackBy is used');\n }\n\n if (this.isSelected(value, index)) {\n this._selection.deselect({value, index});\n } else {\n this._selection.select({value, index});\n }\n }\n\n /**\n * Toggles select-all. If no value is selected, select all values. If all values or some of the\n * values are selected, de-select all values.\n */\n toggleSelectAll() {\n if (!this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelection: multiple selection not enabled');\n }\n\n if (this.selectAllState === 'none') {\n this._selectAll();\n } else {\n this._clearAll();\n }\n }\n\n /** Checks whether a value is selected. `index` is required if `trackBy` is used. */\n isSelected(value: T, index?: number) {\n if (!!this.trackByFn && index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelection: index required when trackBy is used');\n }\n\n return this._selection.isSelected({value, index});\n }\n\n /** Checks whether all values are selected. */\n isAllSelected() {\n return this._data.every((value, index) => this._selection.isSelected({value, index}));\n }\n\n /** Checks whether partially selected. */\n isPartialSelected() {\n return (\n !this.isAllSelected() &&\n this._data.some((value, index) => this._selection.isSelected({value, index}))\n );\n }\n\n private _selectAll() {\n const toSelect: SelectableWithIndex<T>[] = [];\n this._data.forEach((value, index) => {\n toSelect.push({value, index});\n });\n\n this._selection.select(...toSelect);\n }\n\n private _clearAll() {\n const toDeselect: SelectableWithIndex<T>[] = [];\n this._data.forEach((value, index) => {\n toDeselect.push({value, index});\n });\n\n this._selection.deselect(...toDeselect);\n }\n\n private _updateSelectAllState() {\n if (this.isAllSelected()) {\n this.selectAllState = 'all';\n } else if (this.isPartialSelected()) {\n this.selectAllState = 'partial';\n } else {\n this.selectAllState = 'none';\n }\n }\n\n selectAllState: SelectAllState = 'none';\n}\n\ntype SelectAllState = 'all' | 'none' | 'partial';\ntype TableDataSource<T> = DataSource<T> | Observable<readonly T[]> | readonly T[];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, OnDestroy, OnInit, inject} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Observable, of as observableOf, Subject} from 'rxjs';\nimport {switchMap, takeUntil} from 'rxjs/operators';\n\nimport {CdkSelection} from './selection';\n\n/**\n * Makes the element a select-all toggle.\n *\n * Must be used within a parent `CdkSelection` directive. It toggles the selection states\n * of all the selection toggles connected with the `CdkSelection` directive.\n * If the element implements `ControlValueAccessor`, e.g. `MatCheckbox`, the directive\n * automatically connects it with the select-all state provided by the `CdkSelection` directive. If\n * not, use `checked$` to get the checked state, `indeterminate$` to get the indeterminate state,\n * and `toggle()` to change the selection state.\n */\n@Directive({\n selector: '[cdkSelectAll]',\n exportAs: 'cdkSelectAll',\n})\nexport class CdkSelectAll<T> implements OnDestroy, OnInit {\n private readonly _selection = inject<CdkSelection<T>>(CdkSelection, {optional: true})!;\n private readonly _controlValueAccessor = inject(NG_VALUE_ACCESSOR, {optional: true, self: true});\n\n /**\n * The checked state of the toggle.\n * Resolves to `true` if all the values are selected, `false` if no value is selected.\n */\n readonly checked: Observable<boolean>;\n\n /**\n * The indeterminate state of the toggle.\n * Resolves to `true` if part (not all) of the values are selected, `false` if all values or no\n * value at all are selected.\n */\n readonly indeterminate: Observable<boolean>;\n\n /**\n * Toggles the select-all state.\n * @param event The click event if the toggle is triggered by a (mouse or keyboard) click. If\n * using with a native `<input type=\"checkbox\">`, the parameter is required for the\n * indeterminate state to work properly.\n */\n toggle(event?: MouseEvent) {\n // This is needed when applying the directive on a native <input type=\"checkbox\">\n // checkbox. The default behavior needs to be prevented in order to support the indeterminate\n // state. The timeout is also needed so the checkbox can show the latest state.\n if (event) {\n event.preventDefault();\n }\n\n setTimeout(() => {\n this._selection.toggleSelectAll();\n });\n }\n\n private readonly _destroyed = new Subject<void>();\n\n constructor() {\n const _selection = this._selection;\n\n this.checked = _selection.change.pipe(\n switchMap(() => observableOf(_selection.isAllSelected())),\n );\n\n this.indeterminate = _selection.change.pipe(\n switchMap(() => observableOf(_selection.isPartialSelected())),\n );\n }\n\n ngOnInit() {\n this._assertValidParentSelection();\n this._configureControlValueAccessor();\n }\n\n private _configureControlValueAccessor() {\n if (this._controlValueAccessor && this._controlValueAccessor.length) {\n this._controlValueAccessor[0].registerOnChange((e: unknown) => {\n if (e === true || e === false) {\n this.toggle();\n }\n });\n this.checked.pipe(takeUntil(this._destroyed)).subscribe(state => {\n this._controlValueAccessor![0].writeValue(state);\n });\n }\n }\n\n private _assertValidParentSelection() {\n if (!this._selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectAll: missing CdkSelection in the parent');\n }\n\n if (!this._selection.multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectAll: CdkSelection must have cdkSelectionMultiple set to true');\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, Input, OnDestroy, OnInit, inject} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Observable, of as observableOf, Subject} from 'rxjs';\nimport {distinctUntilChanged, switchMap, takeUntil} from 'rxjs/operators';\n\nimport {CdkSelection} from './selection';\n\n/**\n * Makes the element a selection toggle.\n *\n * Must be used within a parent `CdkSelection` directive.\n * Must be provided with the value. If `trackBy` is used on `CdkSelection`, the index of the value\n * is required. If the element implements `ControlValueAccessor`, e.g. `MatCheckbox`, the directive\n * automatically connects it with the selection state provided by the `CdkSelection` directive. If\n * not, use `checked$` to get the checked state of the value, and `toggle()` to change the selection\n * state.\n */\n@Directive({\n selector: '[cdkSelectionToggle]',\n exportAs: 'cdkSelectionToggle',\n})\nexport class CdkSelectionToggle<T> implements OnDestroy, OnInit {\n private _selection = inject<CdkSelection<T>>(CdkSelection, {optional: true})!;\n private _controlValueAccessors = inject(NG_VALUE_ACCESSOR, {optional: true, self: true});\n\n /** The value that is associated with the toggle */\n @Input('cdkSelectionToggleValue') value: T;\n\n /** The index of the value in the list. Required when used with `trackBy` */\n @Input('cdkSelectionToggleIndex')\n get index(): number | undefined {\n return this._index;\n }\n set index(index: NumberInput) {\n this._index = coerceNumberProperty(index);\n }\n protected _index?: number;\n\n /** The checked state of the selection toggle */\n readonly checked: Observable<boolean>;\n\n /** Toggles the selection */\n toggle() {\n this._selection.toggleSelection(this.value, this.index);\n }\n\n private _destroyed = new Subject<void>();\n\n constructor() {\n const _selection = this._selection;\n\n this.checked = _selection.change.pipe(\n switchMap(() => observableOf(this._isSelected())),\n distinctUntilChanged(),\n );\n }\n\n ngOnInit() {\n this._assertValidParentSelection();\n this._configureControlValueAccessor();\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n private _assertValidParentSelection() {\n if (!this._selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectAll: missing CdkSelection in the parent');\n }\n }\n\n private _configureControlValueAccessor() {\n if (this._controlValueAccessors && this._controlValueAccessors.length) {\n this._controlValueAccessors[0].registerOnChange((e: unknown) => {\n if (typeof e === 'boolean') {\n this.toggle();\n }\n });\n\n this.checked.pipe(takeUntil(this._destroyed)).subscribe(state => {\n this._controlValueAccessors![0].writeValue(state);\n });\n }\n }\n\n private _isSelected(): boolean {\n return this._selection.isSelected(this.value, this.index);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {CdkCellDef, CdkColumnDef, CdkHeaderCellDef, CdkTable} from '@angular/cdk/table';\nimport {\n Component,\n Input,\n OnDestroy,\n OnInit,\n ViewChild,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\n\nimport {CdkSelection} from './selection';\nimport {AsyncPipe} from '@angular/common';\nimport {CdkSelectionToggle} from './selection-toggle';\nimport {CdkSelectAll} from './select-all';\n\n/**\n * Column that adds row selecting checkboxes and a select-all checkbox if `cdkSelectionMultiple` is\n * `true`.\n *\n * Must be used within a parent `CdkSelection` directive.\n */\n@Component({\n selector: 'cdk-selection-column',\n template: `\n <ng-container cdkColumnDef>\n <th cdkHeaderCell *cdkHeaderCellDef>\n @if (selection && selection.multiple) {\n <input type=\"checkbox\"\n cdkSelectAll\n #allToggler=\"cdkSelectAll\"\n [checked]=\"allToggler.checked | async\"\n [indeterminate]=\"allToggler.indeterminate | async\"\n (click)=\"allToggler.toggle($event)\">\n }\n </th>\n <td cdkCell *cdkCellDef=\"let row; let i = $index\">\n <input type=\"checkbox\"\n #toggler=\"cdkSelectionToggle\"\n cdkSelectionToggle\n [cdkSelectionToggleValue]=\"row\"\n [cdkSelectionToggleIndex]=\"i\"\n (click)=\"toggler.toggle()\"\n [checked]=\"toggler.checked | async\">\n </td>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CdkColumnDef,\n CdkHeaderCellDef,\n CdkSelectAll,\n CdkCellDef,\n CdkSelectionToggle,\n AsyncPipe,\n ],\n})\nexport class CdkSelectionColumn<T> implements OnInit, OnDestroy {\n private _table = inject<CdkTable<T>>(CdkTable, {optional: true});\n readonly selection = inject<CdkSelection<T>>(CdkSelection, {optional: true});\n\n /** Column name that should be used to reference this column. */\n @Input('cdkSelectionColumnName')\n get name(): string {\n return this._name;\n }\n set name(name: string) {\n this._name = name;\n\n this._syncColumnDefName();\n }\n private _name: string;\n\n @ViewChild(CdkColumnDef, {static: true}) private readonly _columnDef: CdkColumnDef;\n @ViewChild(CdkCellDef, {static: true}) private readonly _cell: CdkCellDef;\n @ViewChild(CdkHeaderCellDef, {static: true}) private readonly _headerCell: CdkHeaderCellDef;\n\n ngOnInit() {\n if (!this.selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectionColumn: missing CdkSelection in the parent');\n }\n\n this._syncColumnDefName();\n\n if (this._table) {\n this._columnDef.cell = this._cell;\n this._columnDef.headerCell = this._headerCell;\n this._table.addColumnDef(this._columnDef);\n } else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw Error('CdkSelectionColumn: missing parent table');\n }\n }\n\n ngOnDestroy() {\n if (this._table) {\n this._table.removeColumnDef(this._columnDef);\n }\n }\n\n private _syncColumnDefName() {\n if (this._columnDef) {\n this._columnDef.name = this._name;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, Input, inject} from '@angular/core';\n\nimport {CdkSelection} from './selection';\n\n/**\n * Applies `cdk-selected` class and `aria-selected` to an element.\n *\n * Must be used within a parent `CdkSelection` directive.\n * Must be provided with the value. The index is required if `trackBy` is used on the `CdkSelection`\n * directive.\n */\n@Directive({\n selector: '[cdkRowSelection]',\n host: {\n '[class.cdk-selected]': '_selection.isSelected(this.value, this.index)',\n '[attr.aria-selected]': '_selection.isSelected(this.value, this.index)',\n },\n})\nexport class CdkRowSelection<T> {\n readonly _selection = inject<CdkSelection<T>>(CdkSelection);\n\n // We need an initializer here to avoid a TS error.\n @Input('cdkRowSelectionValue') value: T = undefined!;\n\n @Input('cdkRowSelectionIndex')\n get index(): number | undefined {\n return this._index;\n }\n set index(index: NumberInput) {\n this._index = coerceNumberProperty(index);\n }\n protected _index?: number;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {CdkTableModule} from '@angular/cdk/table';\nimport {NgModule} from '@angular/core';\n\nimport {CdkRowSelection} from './row-selection';\nimport {CdkSelectAll} from './select-all';\nimport {CdkSelection} from './selection';\nimport {CdkSelectionColumn} from './selection-column';\nimport {CdkSelectionToggle} from './selection-toggle';\n\n@NgModule({\n imports: [\n CdkTableModule,\n CdkSelection,\n CdkSelectionToggle,\n CdkSelectAll,\n CdkSelectionColumn,\n CdkRowSelection,\n ],\n exports: [CdkSelection, CdkSelectionToggle, CdkSelectAll, CdkSelectionColumn, CdkRowSelection],\n})\nexport class CdkSelectionModule {}\n"],"names":["observableOf"],"mappings":";;;;;;;;;;AAuCA;;;;;;AAMG;MACU,YAAY,CAAA;AAKb,IAAA,SAAA;AACA,IAAA,UAAA;AALF,IAAA,aAAa,GAAG,IAAI,GAAG,EAA8D;AAC7F,IAAA,OAAO,GAAG,IAAI,OAAO,EAAsB;IAE3C,WACU,CAAA,SAAA,GAAY,KAAK,EACjB,UAA+B,EAAA;QAD/B,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAU,CAAA,UAAA,GAAV,UAAU;;AAGpB,IAAA,UAAU,CAAC,KAA6B,EAAA;AACtC,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;;IAG/D,MAAM,CAAC,GAAG,OAAiC,EAAA;QACzC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,KAAK,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAAE;AAC5F,YAAA,MAAM,KAAK,CAAC,sCAAsC,CAAC;;AAGrD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,EAAE;AAE1C,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;;AAI5B,QAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AAC5B,YAAA,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;gBAC3B;;AAIF,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;;A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B,qBAAA;oBACD,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,CAAC;AAC/F,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"selection.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-set.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/select-all.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-toggle.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-column.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/row-selection.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/selection/selection-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {TrackByFunction} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/**\n * Maintains a set of selected values. One or more values can be added to or removed from the\n * selection.\n */\ninterface TrackBySelection<T> {\n isSelected(value: SelectableWithIndex<T>): boolean;\n select(...values: SelectableWithIndex<T>[]): void;\n deselect(...values: SelectableWithIndex<T>[]): void;\n changed: Subject<SelectionChange<T>>;\n}\n\n/**\n * A selectable value with an optional index. The index is required when the selection is used with\n * `trackBy`.\n */\nexport interface SelectableWithIndex<T> {\n value: T;\n index?: number;\n}\n\n/**\n * Represents the change in the selection set.\n */\nexport interface SelectionChange<T> {\n before: SelectableWithIndex<T>[];\n after: SelectableWithIndex<T>[];\n}\n\n/**\n * Maintains a set of selected items. Support selecting and deselecting items, and checking if a\n * value is selected.\n * When constructed with a `trackByFn`, all the items will be identified by applying the `trackByFn`\n * on them. Because `trackByFn` requires the index of the item to be passed in, the `index` field is\n * expected to be set when calling `isSelected`, `select` and `deselect`.\n */\nexport class SelectionSet<T> implements TrackBySelection<T> {\n private _selectionMap = new Map<T | ReturnType<TrackByFunction<T>>, SelectableWithIndex<T>>();\n changed = new Subject<SelectionChange<T>>();\n\n constructor(\n private _multiple = false,\n private _trackByFn?: TrackByFunction<T>,\n ) {}\n\n isSelected(value: SelectableWithIndex<T>): boolean {\n return this._selectionMap.has(this._getTrackedByValue(value));\n }\n\n select(...selects: SelectableWithIndex<T>[]) {\n if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('SelectionSet: not multiple selection');\n }\n\n const before = this._getCurrentSelection();\n\n if (!this._multiple) {\n this._selectionMap.clear();\n }\n\n const toSelect: SelectableWithIndex<T>[] = [];\n for (const select of selects) {\n if (this.isSelected(select)) {\n continue;\n }\n\n toSelect.push(select);\n this._markSelected(this._getTrackedByValue(select), select);\n }\n\n const after = this._getCurrentSelection();\n\n this.changed.next({before, after});\n }\n\n deselect(...selects: SelectableWithIndex<T>[]) {\n if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('SelectionSet: not multiple selection');\n }\n\n const before = this._getCurrentSelection();\n const toDeselect: SelectableWithIndex<T>[] = [];\n\n for (const select of selects) {\n if (!this.isSelected(select)) {\n continue;\n }\n\n toDeselect.push(select);\n this._markDeselected(this._getTrackedByValue(select));\n }\n\n const after = this._getCurrentSelection();\n this.changed.next({before, after});\n }\n\n private _markSelected(key: T | ReturnType<TrackByFunction<T>>, toSelect: SelectableWithIndex<T>) {\n this._selectionMap.set(key, toSelect);\n }\n\n private _markDeselected(key: T | ReturnType<TrackByFunction<T>>) {\n this._selectionMap.delete(key);\n }\n\n private _getTrackedByValue(select: SelectableWithIndex<T>) {\n if (!this._trackByFn) {\n return select.value;\n }\n\n if (select.index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('SelectionSet: index required when trackByFn is used.');\n }\n\n return this._trackByFn(select.index!, select.value);\n }\n\n private _getCurrentSelection(): SelectableWithIndex<T>[] {\n return Array.from(this._selectionMap.values());\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {CollectionViewer, DataSource, isDataSource, ListRange} from '@angular/cdk/collections';\nimport {\n AfterContentChecked,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n TrackByFunction,\n} from '@angular/core';\nimport {Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {SelectableWithIndex, SelectionChange, SelectionSet} from './selection-set';\n\n/**\n * Manages the selection states of the items and provides methods to check and update the selection\n * states.\n * It must be applied to the parent element if `cdkSelectionToggle`, `cdkSelectAll`,\n * `cdkRowSelection` and `cdkSelectionColumn` are applied.\n */\n@Directive({\n selector: '[cdkSelection]',\n exportAs: 'cdkSelection',\n})\nexport class CdkSelection<T> implements OnInit, AfterContentChecked, CollectionViewer, OnDestroy {\n viewChange: Observable<ListRange>;\n\n @Input()\n get dataSource(): TableDataSource<T> {\n return this._dataSource;\n }\n set dataSource(dataSource: TableDataSource<T>) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: TableDataSource<T>;\n\n @Input('trackBy') trackByFn: TrackByFunction<T>;\n\n /** Whether to support multiple selection */\n @Input('cdkSelectionMultiple')\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(multiple: BooleanInput) {\n this._multiple = coerceBooleanProperty(multiple);\n }\n protected _multiple: boolean;\n\n /** Emits when selection changes. */\n @Output('cdkSelectionChange') readonly change = new EventEmitter<SelectionChange<T>>();\n\n /** Latest data provided by the data source. */\n private _data: T[] | readonly T[];\n\n /** Subscription that listens for the data provided by the data source. */\n private _renderChangeSubscription: Subscription | null;\n\n private _destroyed = new Subject<void>();\n\n private _selection: SelectionSet<T>;\n\n private _switchDataSource(dataSource: TableDataSource<T>) {\n this._data = [];\n\n // TODO: Move this logic to a shared function in `cdk/collections`.\n if (isDataSource(this._dataSource)) {\n this._dataSource.disconnect(this);\n }\n\n if (this._renderChangeSubscription) {\n this._renderChangeSubscription.unsubscribe();\n this._renderChangeSubscription = null;\n }\n\n this._dataSource = dataSource;\n }\n\n private _observeRenderChanges() {\n if (!this._dataSource) {\n return;\n }\n\n let dataStream: Observable<readonly T[]> | undefined;\n\n if (isDataSource(this._dataSource)) {\n dataStream = this._dataSource.connect(this);\n } else if (this._dataSource instanceof Observable) {\n dataStream = this._dataSource;\n } else if (Array.isArray(this._dataSource)) {\n dataStream = observableOf(this._dataSource);\n }\n\n if (dataStream == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Unknown data source');\n }\n\n this._renderChangeSubscription = dataStream!\n .pipe(takeUntil(this._destroyed))\n .subscribe(data => {\n this._data = data || [];\n });\n }\n\n ngOnInit() {\n this._selection = new SelectionSet<T>(this._multiple, this.trackByFn);\n this._selection.changed.pipe(takeUntil(this._destroyed)).subscribe(change => {\n this._updateSelectAllState();\n this.change.emit(change);\n });\n }\n\n ngAfterContentChecked() {\n if (this._dataSource && !this._renderChangeSubscription) {\n this._observeRenderChanges();\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n\n if (isDataSource(this._dataSource)) {\n this._dataSource.disconnect(this);\n }\n }\n\n /** Toggles selection for a given value. `index` is required if `trackBy` is used. */\n toggleSelection(value: T, index?: number) {\n if (!!this.trackByFn && index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelection: index required when trackBy is used');\n }\n\n if (this.isSelected(value, index)) {\n this._selection.deselect({value, index});\n } else {\n this._selection.select({value, index});\n }\n }\n\n /**\n * Toggles select-all. If no value is selected, select all values. If all values or some of the\n * values are selected, de-select all values.\n */\n toggleSelectAll() {\n if (!this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelection: multiple selection not enabled');\n }\n\n if (this.selectAllState === 'none') {\n this._selectAll();\n } else {\n this._clearAll();\n }\n }\n\n /** Checks whether a value is selected. `index` is required if `trackBy` is used. */\n isSelected(value: T, index?: number) {\n if (!!this.trackByFn && index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelection: index required when trackBy is used');\n }\n\n return this._selection.isSelected({value, index});\n }\n\n /** Checks whether all values are selected. */\n isAllSelected() {\n return this._data.every((value, index) => this._selection.isSelected({value, index}));\n }\n\n /** Checks whether partially selected. */\n isPartialSelected() {\n return (\n !this.isAllSelected() &&\n this._data.some((value, index) => this._selection.isSelected({value, index}))\n );\n }\n\n private _selectAll() {\n const toSelect: SelectableWithIndex<T>[] = [];\n this._data.forEach((value, index) => {\n toSelect.push({value, index});\n });\n\n this._selection.select(...toSelect);\n }\n\n private _clearAll() {\n const toDeselect: SelectableWithIndex<T>[] = [];\n this._data.forEach((value, index) => {\n toDeselect.push({value, index});\n });\n\n this._selection.deselect(...toDeselect);\n }\n\n private _updateSelectAllState() {\n if (this.isAllSelected()) {\n this.selectAllState = 'all';\n } else if (this.isPartialSelected()) {\n this.selectAllState = 'partial';\n } else {\n this.selectAllState = 'none';\n }\n }\n\n selectAllState: SelectAllState = 'none';\n}\n\ntype SelectAllState = 'all' | 'none' | 'partial';\ntype TableDataSource<T> = DataSource<T> | Observable<readonly T[]> | readonly T[];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, OnDestroy, OnInit, inject} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Observable, of as observableOf, Subject} from 'rxjs';\nimport {switchMap, takeUntil} from 'rxjs/operators';\n\nimport {CdkSelection} from './selection';\n\n/**\n * Makes the element a select-all toggle.\n *\n * Must be used within a parent `CdkSelection` directive. It toggles the selection states\n * of all the selection toggles connected with the `CdkSelection` directive.\n * If the element implements `ControlValueAccessor`, e.g. `MatCheckbox`, the directive\n * automatically connects it with the select-all state provided by the `CdkSelection` directive. If\n * not, use `checked$` to get the checked state, `indeterminate$` to get the indeterminate state,\n * and `toggle()` to change the selection state.\n */\n@Directive({\n selector: '[cdkSelectAll]',\n exportAs: 'cdkSelectAll',\n})\nexport class CdkSelectAll<T> implements OnDestroy, OnInit {\n private readonly _selection = inject<CdkSelection<T>>(CdkSelection, {optional: true})!;\n private readonly _controlValueAccessor = inject(NG_VALUE_ACCESSOR, {optional: true, self: true});\n\n /**\n * The checked state of the toggle.\n * Resolves to `true` if all the values are selected, `false` if no value is selected.\n */\n readonly checked: Observable<boolean>;\n\n /**\n * The indeterminate state of the toggle.\n * Resolves to `true` if part (not all) of the values are selected, `false` if all values or no\n * value at all are selected.\n */\n readonly indeterminate: Observable<boolean>;\n\n /**\n * Toggles the select-all state.\n * @param event The click event if the toggle is triggered by a (mouse or keyboard) click. If\n * using with a native `<input type=\"checkbox\">`, the parameter is required for the\n * indeterminate state to work properly.\n */\n toggle(event?: MouseEvent) {\n // This is needed when applying the directive on a native <input type=\"checkbox\">\n // checkbox. The default behavior needs to be prevented in order to support the indeterminate\n // state. The timeout is also needed so the checkbox can show the latest state.\n if (event) {\n event.preventDefault();\n }\n\n setTimeout(() => {\n this._selection.toggleSelectAll();\n });\n }\n\n private readonly _destroyed = new Subject<void>();\n\n constructor() {\n const _selection = this._selection;\n\n this.checked = _selection.change.pipe(\n switchMap(() => observableOf(_selection.isAllSelected())),\n );\n\n this.indeterminate = _selection.change.pipe(\n switchMap(() => observableOf(_selection.isPartialSelected())),\n );\n }\n\n ngOnInit() {\n this._assertValidParentSelection();\n this._configureControlValueAccessor();\n }\n\n private _configureControlValueAccessor() {\n if (this._controlValueAccessor && this._controlValueAccessor.length) {\n this._controlValueAccessor[0].registerOnChange((e: unknown) => {\n if (e === true || e === false) {\n this.toggle();\n }\n });\n this.checked.pipe(takeUntil(this._destroyed)).subscribe(state => {\n this._controlValueAccessor![0].writeValue(state);\n });\n }\n }\n\n private _assertValidParentSelection() {\n if (!this._selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectAll: missing CdkSelection in the parent');\n }\n\n if (!this._selection.multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectAll: CdkSelection must have cdkSelectionMultiple set to true');\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, Input, OnDestroy, OnInit, inject} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Observable, of as observableOf, Subject} from 'rxjs';\nimport {distinctUntilChanged, switchMap, takeUntil} from 'rxjs/operators';\n\nimport {CdkSelection} from './selection';\n\n/**\n * Makes the element a selection toggle.\n *\n * Must be used within a parent `CdkSelection` directive.\n * Must be provided with the value. If `trackBy` is used on `CdkSelection`, the index of the value\n * is required. If the element implements `ControlValueAccessor`, e.g. `MatCheckbox`, the directive\n * automatically connects it with the selection state provided by the `CdkSelection` directive. If\n * not, use `checked$` to get the checked state of the value, and `toggle()` to change the selection\n * state.\n */\n@Directive({\n selector: '[cdkSelectionToggle]',\n exportAs: 'cdkSelectionToggle',\n})\nexport class CdkSelectionToggle<T> implements OnDestroy, OnInit {\n private _selection = inject<CdkSelection<T>>(CdkSelection, {optional: true})!;\n private _controlValueAccessors = inject(NG_VALUE_ACCESSOR, {optional: true, self: true});\n\n /** The value that is associated with the toggle */\n @Input('cdkSelectionToggleValue') value: T;\n\n /** The index of the value in the list. Required when used with `trackBy` */\n @Input('cdkSelectionToggleIndex')\n get index(): number | undefined {\n return this._index;\n }\n set index(index: NumberInput) {\n this._index = coerceNumberProperty(index);\n }\n protected _index?: number;\n\n /** The checked state of the selection toggle */\n readonly checked: Observable<boolean>;\n\n /** Toggles the selection */\n toggle() {\n this._selection.toggleSelection(this.value, this.index);\n }\n\n private _destroyed = new Subject<void>();\n\n constructor() {\n const _selection = this._selection;\n\n this.checked = _selection.change.pipe(\n switchMap(() => observableOf(this._isSelected())),\n distinctUntilChanged(),\n );\n }\n\n ngOnInit() {\n this._assertValidParentSelection();\n this._configureControlValueAccessor();\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n private _assertValidParentSelection() {\n if (!this._selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectAll: missing CdkSelection in the parent');\n }\n }\n\n private _configureControlValueAccessor() {\n if (this._controlValueAccessors && this._controlValueAccessors.length) {\n this._controlValueAccessors[0].registerOnChange((e: unknown) => {\n if (typeof e === 'boolean') {\n this.toggle();\n }\n });\n\n this.checked.pipe(takeUntil(this._destroyed)).subscribe(state => {\n this._controlValueAccessors![0].writeValue(state);\n });\n }\n }\n\n private _isSelected(): boolean {\n return this._selection.isSelected(this.value, this.index);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {CdkCellDef, CdkColumnDef, CdkHeaderCellDef, CdkTable} from '@angular/cdk/table';\nimport {\n Component,\n Input,\n OnDestroy,\n OnInit,\n ViewChild,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\n\nimport {CdkSelection} from './selection';\nimport {AsyncPipe} from '@angular/common';\nimport {CdkSelectionToggle} from './selection-toggle';\nimport {CdkSelectAll} from './select-all';\n\n/**\n * Column that adds row selecting checkboxes and a select-all checkbox if `cdkSelectionMultiple` is\n * `true`.\n *\n * Must be used within a parent `CdkSelection` directive.\n */\n@Component({\n selector: 'cdk-selection-column',\n template: `\n <ng-container cdkColumnDef>\n <th cdkHeaderCell *cdkHeaderCellDef>\n @if (selection && selection.multiple) {\n <input type=\"checkbox\"\n cdkSelectAll\n #allToggler=\"cdkSelectAll\"\n [checked]=\"allToggler.checked | async\"\n [indeterminate]=\"allToggler.indeterminate | async\"\n (click)=\"allToggler.toggle($event)\">\n }\n </th>\n <td cdkCell *cdkCellDef=\"let row; let i = $index\">\n <input type=\"checkbox\"\n #toggler=\"cdkSelectionToggle\"\n cdkSelectionToggle\n [cdkSelectionToggleValue]=\"row\"\n [cdkSelectionToggleIndex]=\"i\"\n (click)=\"toggler.toggle()\"\n [checked]=\"toggler.checked | async\">\n </td>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n CdkColumnDef,\n CdkHeaderCellDef,\n CdkSelectAll,\n CdkCellDef,\n CdkSelectionToggle,\n AsyncPipe,\n ],\n})\nexport class CdkSelectionColumn<T> implements OnInit, OnDestroy {\n private _table = inject<CdkTable<T>>(CdkTable, {optional: true});\n readonly selection = inject<CdkSelection<T>>(CdkSelection, {optional: true});\n\n /** Column name that should be used to reference this column. */\n @Input('cdkSelectionColumnName')\n get name(): string {\n return this._name;\n }\n set name(name: string) {\n this._name = name;\n\n this._syncColumnDefName();\n }\n private _name: string;\n\n @ViewChild(CdkColumnDef, {static: true}) private readonly _columnDef: CdkColumnDef;\n @ViewChild(CdkCellDef, {static: true}) private readonly _cell: CdkCellDef;\n @ViewChild(CdkHeaderCellDef, {static: true}) private readonly _headerCell: CdkHeaderCellDef;\n\n ngOnInit() {\n if (!this.selection && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkSelectionColumn: missing CdkSelection in the parent');\n }\n\n this._syncColumnDefName();\n\n if (this._table) {\n this._columnDef.cell = this._cell;\n this._columnDef.headerCell = this._headerCell;\n this._table.addColumnDef(this._columnDef);\n } else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw Error('CdkSelectionColumn: missing parent table');\n }\n }\n\n ngOnDestroy() {\n if (this._table) {\n this._table.removeColumnDef(this._columnDef);\n }\n }\n\n private _syncColumnDefName() {\n if (this._columnDef) {\n this._columnDef.name = this._name;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, Input, inject} from '@angular/core';\n\nimport {CdkSelection} from './selection';\n\n/**\n * Applies `cdk-selected` class and `aria-selected` to an element.\n *\n * Must be used within a parent `CdkSelection` directive.\n * Must be provided with the value. The index is required if `trackBy` is used on the `CdkSelection`\n * directive.\n */\n@Directive({\n selector: '[cdkRowSelection]',\n host: {\n '[class.cdk-selected]': '_selection.isSelected(this.value, this.index)',\n '[attr.aria-selected]': '_selection.isSelected(this.value, this.index)',\n },\n})\nexport class CdkRowSelection<T> {\n readonly _selection = inject<CdkSelection<T>>(CdkSelection);\n\n // We need an initializer here to avoid a TS error.\n @Input('cdkRowSelectionValue') value: T = undefined!;\n\n @Input('cdkRowSelectionIndex')\n get index(): number | undefined {\n return this._index;\n }\n set index(index: NumberInput) {\n this._index = coerceNumberProperty(index);\n }\n protected _index?: number;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {CdkTableModule} from '@angular/cdk/table';\nimport {NgModule} from '@angular/core';\n\nimport {CdkRowSelection} from './row-selection';\nimport {CdkSelectAll} from './select-all';\nimport {CdkSelection} from './selection';\nimport {CdkSelectionColumn} from './selection-column';\nimport {CdkSelectionToggle} from './selection-toggle';\n\n@NgModule({\n imports: [\n CdkTableModule,\n CdkSelection,\n CdkSelectionToggle,\n CdkSelectAll,\n CdkSelectionColumn,\n CdkRowSelection,\n ],\n exports: [CdkSelection, CdkSelectionToggle, CdkSelectAll, CdkSelectionColumn, CdkRowSelection],\n})\nexport class CdkSelectionModule {}\n"],"names":["observableOf"],"mappings":";;;;;;;;;;AAuCA;;;;;;AAMG;MACU,YAAY,CAAA;AAKb,IAAA,SAAA;AACA,IAAA,UAAA;AALF,IAAA,aAAa,GAAG,IAAI,GAAG,EAA8D;AAC7F,IAAA,OAAO,GAAG,IAAI,OAAO,EAAsB;IAE3C,WACU,CAAA,SAAA,GAAY,KAAK,EACjB,UAA+B,EAAA;QAD/B,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAU,CAAA,UAAA,GAAV,UAAU;;AAGpB,IAAA,UAAU,CAAC,KAA6B,EAAA;AACtC,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;;IAG/D,MAAM,CAAC,GAAG,OAAiC,EAAA;QACzC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,KAAK,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAAE;AAC5F,YAAA,MAAM,KAAK,CAAC,sCAAsC,CAAC;;AAGrD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,EAAE;AAE1C,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;;AAI5B,QAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AAC5B,YAAA,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;gBAC3B;;AAIF,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;;AAG7D,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,EAAE;QAEzC,IAAI,CAAC,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AkB,EAAE,eAAe,CAAC;AAC/F,iBAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-scroll-container.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"table-scroll-container.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/table-scroll-container/table-scroll-container.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/table-scroll-container/table-scroll-container-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {CSP_NONCE, Directive, ElementRef, OnDestroy, OnInit, inject, DOCUMENT} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_getShadowRoot} from '@angular/cdk/platform';\nimport {\n STICKY_POSITIONING_LISTENER,\n StickyPositioningListener,\n StickySize,\n StickyUpdate,\n} from '@angular/cdk/table';\n\n/**\n * Applies styles to the host element that make its scrollbars match up with\n * the non-sticky scrollable portions of the CdkTable contained within.\n *\n * This visual effect only works in Webkit and Blink based browsers (eg Chrome,\n * Safari, Edge). Other browsers such as Firefox will gracefully degrade to\n * normal scrollbar appearance.\n * Further note: These styles have no effect when the browser is using OS-default\n * scrollbars. The easiest way to force them into custom mode is to specify width\n * and height for the scrollbar and thumb.\n */\n@Directive({\n selector: '[cdkTableScrollContainer]',\n host: {\n 'class': 'cdk-table-scroll-container',\n },\n providers: [{provide: STICKY_POSITIONING_LISTENER, useExisting: CdkTableScrollContainer}],\n})\nexport class CdkTableScrollContainer implements StickyPositioningListener, OnDestroy, OnInit {\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _document = inject<Document>(DOCUMENT);\n private readonly _directionality = inject(Directionality, {optional: true});\n private readonly _nonce = inject(CSP_NONCE, {optional: true});\n\n private readonly _uniqueClassName = inject(_IdGenerator).getId('cdk-table-scroll-container-');\n private _styleRoot!: Node;\n private _styleElement?: HTMLStyleElement;\n\n /** The most recent sticky column size values from the CdkTable. */\n private _startSizes: StickySize[] = [];\n private _endSizes: StickySize[] = [];\n private _headerSizes: StickySize[] = [];\n private _footerSizes: StickySize[] = [];\n\n ngOnInit() {\n this._elementRef.nativeElement.classList.add(this._uniqueClassName);\n this._styleRoot = _getShadowRoot(this._elementRef.nativeElement) ?? this._document.head;\n }\n\n ngOnDestroy(): void {\n this._styleElement?.remove();\n this._styleElement = undefined;\n }\n\n stickyColumnsUpdated({sizes}: StickyUpdate): void {\n this._startSizes = sizes;\n this._updateScrollbar();\n }\n\n stickyEndColumnsUpdated({sizes}: StickyUpdate): void {\n this._endSizes = sizes;\n this._updateScrollbar();\n }\n\n stickyHeaderRowsUpdated({sizes}: StickyUpdate): void {\n this._headerSizes = sizes;\n this._updateScrollbar();\n }\n\n stickyFooterRowsUpdated({sizes}: StickyUpdate): void {\n this._footerSizes = sizes;\n this._updateScrollbar();\n }\n\n /**\n * Set padding on the scrollbar track based on the sticky states from CdkTable.\n */\n private _updateScrollbar(): void {\n const topMargin = computeMargin(this._headerSizes);\n const bottomMargin = computeMargin(this._footerSizes);\n const startMargin = computeMargin(this._startSizes);\n const endMargin = computeMargin(this._endSizes);\n\n if (topMargin === 0 && bottomMargin === 0 && startMargin === 0 && endMargin === 0) {\n this._clearCss();\n return;\n }\n\n const direction = this._directionality ? this._directionality.value : 'ltr';\n const leftMargin = direction === 'rtl' ? endMargin : startMargin;\n const rightMargin = direction === 'rtl' ? startMargin : endMargin;\n\n this._applyCss(`${topMargin}px ${rightMargin}px ${bottomMargin}px ${leftMargin}px`);\n }\n\n /** Gets the stylesheet for the scrollbar styles and creates it if need be. */\n private _getStyleSheet(): CSSStyleSheet {\n if (!this._styleElement) {\n this._styleElement = this._document.createElement('style');\n\n if (this._nonce) {\n this._styleElement.setAttribute('nonce', this._nonce);\n }\n\n this._styleRoot.appendChild(this._styleElement);\n }\n\n return this._styleElement.sheet as CSSStyleSheet;\n }\n\n /** Updates the stylesheet with the specified scrollbar style. */\n private _applyCss(value: string) {\n this._clearCss();\n\n const selector = `.${this._uniqueClassName}::-webkit-scrollbar-track`;\n this._getStyleSheet().insertRule(`${selector} {margin: ${value}}`, 0);\n }\n\n private _clearCss() {\n const styleSheet = this._getStyleSheet();\n if (styleSheet.cssRules.length > 0) {\n styleSheet.deleteRule(0);\n }\n }\n}\n\nfunction computeMargin(sizes: (number | null | undefined)[]): number {\n let margin = 0;\n for (const size of sizes) {\n if (size == null) {\n break;\n }\n margin += size;\n }\n return margin;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkTableScrollContainer} from './table-scroll-container';\n\n@NgModule({\n imports: [CdkTableScrollContainer],\n exports: [CdkTableScrollContainer],\n})\nexport class CdkTableScrollContainerModule {}\n"],"names":[],"mappings":";;;;;;;AAoBA;;;;;;;;;;AAUG;MAQU,uBAAuB,CAAA;AACjB,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AACzD,IAAA,SAAS,GAAG,MAAM,CAAW,QAAQ,CAAC;IACtC,eAAe,GAAG,MAAM,CAAC,cAAc,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC1D,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAE5C,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;AACrF,IAAA,UAAU;AACV,IAAA,aAAa;;IAGb,WAAW,GAAiB,EAAE;IAC9B,SAAS,GAAiB,EAAE;IAC5B,YAAY,GAAiB,EAAE;IAC/B,YAAY,GAAiB,EAAE;IAEvC,QAAQ,GAAA;AACN,QAAA,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