ng-primitives 0.91.0 → 0.91.2

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.
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { computed, Directive, input, numberAttribute, signal } from '@angular/core';
3
3
  import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
4
+ import { injectElementRef } from 'ng-primitives/internal';
4
5
  import { uniqueId } from 'ng-primitives/utils';
5
6
 
6
7
  /**
@@ -60,6 +61,10 @@ class NgpProgressLabel {
60
61
  * Access the progress state.
61
62
  */
62
63
  this.state = injectProgressState();
64
+ /**
65
+ * Access the element ref.
66
+ */
67
+ this.elementRef = injectElementRef();
63
68
  /**
64
69
  * The unique identifier for the progress label.
65
70
  */
@@ -67,7 +72,7 @@ class NgpProgressLabel {
67
72
  this.state().label.set(this);
68
73
  }
69
74
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpProgressLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
70
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpProgressLabel, isStandalone: true, selector: "[ngpProgressLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-progressing": "state().progressing() ? \"\" : null", "attr.data-indeterminate": "state().indeterminate() ? \"\" : null", "attr.data-complete": "state().complete() ? \"\" : null" } }, exportAs: ["ngpProgressLabel"], ngImport: i0 }); }
75
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpProgressLabel, isStandalone: true, selector: "[ngpProgressLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.for": "elementRef.nativeElement.tagName === \"LABEL\" ? state().id() : null", "attr.data-progressing": "state().progressing() ? \"\" : null", "attr.data-indeterminate": "state().indeterminate() ? \"\" : null", "attr.data-complete": "state().complete() ? \"\" : null" } }, exportAs: ["ngpProgressLabel"], ngImport: i0 }); }
71
76
  }
72
77
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpProgressLabel, decorators: [{
73
78
  type: Directive,
@@ -75,6 +80,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
75
80
  selector: '[ngpProgressLabel]',
76
81
  exportAs: 'ngpProgressLabel',
77
82
  host: {
83
+ '[attr.id]': 'id()',
84
+ '[attr.for]': 'elementRef.nativeElement.tagName === "LABEL" ? state().id() : null',
78
85
  '[attr.data-progressing]': 'state().progressing() ? "" : null',
79
86
  '[attr.data-indeterminate]': 'state().indeterminate() ? "" : null',
80
87
  '[attr.data-complete]': 'state().complete() ? "" : null',
@@ -169,6 +176,10 @@ class NgpProgress {
169
176
  this.valueLabel = input((value, max) => `${Math.round((value / max) * 100)}%`, ...(ngDevMode ? [{ debugName: "valueLabel", alias: 'ngpProgressValueLabel' }] : [{
170
177
  alias: 'ngpProgressValueLabel',
171
178
  }]));
179
+ /**
180
+ * The unique identifier for the progress.
181
+ */
182
+ this.id = input(uniqueId('ngp-progress'), ...(ngDevMode ? [{ debugName: "id" }] : []));
172
183
  /**
173
184
  * Determine if the progress is indeterminate.
174
185
  * @internal
@@ -208,7 +219,7 @@ class NgpProgress {
208
219
  this.state = progressState(this);
209
220
  }
210
221
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpProgress, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
211
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpProgress, isStandalone: true, selector: "[ngpProgress]", inputs: { value: { classPropertyName: "value", publicName: "ngpProgressValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "ngpProgressMin", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "ngpProgressMax", isSignal: true, isRequired: false, transformFunction: null }, valueLabel: { classPropertyName: "valueLabel", publicName: "ngpProgressValueLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "attr.aria-valuemax": "state.max()", "attr.aria-valuemin": "0", "attr.aria-valuenow": "state.value()", "attr.aria-valuetext": "valueText()", "attr.aria-labelledby": "label() ? label()?.id : null", "attr.data-progressing": "progressing() ? \"\" : null", "attr.data-indeterminate": "indeterminate() ? \"\" : null", "attr.data-complete": "complete() ? \"\" : null" } }, providers: [provideProgressState()], ngImport: i0 }); }
222
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpProgress, isStandalone: true, selector: "[ngpProgress]", inputs: { value: { classPropertyName: "value", publicName: "ngpProgressValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "ngpProgressMin", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "ngpProgressMax", isSignal: true, isRequired: false, transformFunction: null }, valueLabel: { classPropertyName: "valueLabel", publicName: "ngpProgressValueLabel", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "attr.id": "id()", "attr.aria-valuemax": "state.max()", "attr.aria-valuemin": "0", "attr.aria-valuenow": "state.value()", "attr.aria-valuetext": "valueText()", "attr.aria-labelledby": "label() ? label()?.id() : null", "attr.data-progressing": "progressing() ? \"\" : null", "attr.data-indeterminate": "indeterminate() ? \"\" : null", "attr.data-complete": "complete() ? \"\" : null" } }, providers: [provideProgressState()], ngImport: i0 }); }
212
223
  }
213
224
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpProgress, decorators: [{
214
225
  type: Directive,
@@ -217,17 +228,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
217
228
  providers: [provideProgressState()],
218
229
  host: {
219
230
  role: 'progressbar',
231
+ '[attr.id]': 'id()',
220
232
  '[attr.aria-valuemax]': 'state.max()',
221
233
  '[attr.aria-valuemin]': '0',
222
234
  '[attr.aria-valuenow]': 'state.value()',
223
235
  '[attr.aria-valuetext]': 'valueText()',
224
- '[attr.aria-labelledby]': 'label() ? label()?.id : null',
236
+ '[attr.aria-labelledby]': 'label() ? label()?.id() : null',
225
237
  '[attr.data-progressing]': 'progressing() ? "" : null',
226
238
  '[attr.data-indeterminate]': 'indeterminate() ? "" : null',
227
239
  '[attr.data-complete]': 'complete() ? "" : null',
228
240
  },
229
241
  }]
230
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressValue", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressMin", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressMax", required: false }] }], valueLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressValueLabel", required: false }] }] } });
242
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressValue", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressMin", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressMax", required: false }] }], valueLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpProgressValueLabel", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
231
243
 
232
244
  /**
233
245
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-progress.mjs","sources":["../../../../packages/ng-primitives/progress/src/progress/progress-state.ts","../../../../packages/ng-primitives/progress/src/progress-indicator/progress-indicator.ts","../../../../packages/ng-primitives/progress/src/progress-label/progress-label.ts","../../../../packages/ng-primitives/progress/src/progress-track/progress-track.ts","../../../../packages/ng-primitives/progress/src/progress-value/progress-value.ts","../../../../packages/ng-primitives/progress/src/progress/progress.ts","../../../../packages/ng-primitives/progress/src/ng-primitives-progress.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpProgress } from './progress';\n\n/**\n * The state token for the Progress primitive.\n */\nexport const NgpProgressStateToken = createStateToken<NgpProgress>('Progress');\n\n/**\n * Provides the Progress state.\n */\nexport const provideProgressState = createStateProvider(NgpProgressStateToken);\n\n/**\n * Injects the Progress state.\n */\nexport const injectProgressState = createStateInjector<NgpProgress>(NgpProgressStateToken);\n\n/**\n * The Progress state registration function.\n */\nexport const progressState = createState(NgpProgressStateToken);\n","import { computed, Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n/**\n * Apply the `ngpProgressIndicator` directive to an element that represents the current progress.\n * The width of this element can be set to the percentage of the progress value.\n */\n@Directive({\n selector: '[ngpProgressIndicator]',\n host: {\n '[style.width.%]': 'percentage()',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressIndicator {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * Get the percentage of the progress value.\n */\n protected readonly percentage = computed(() =>\n this.state().value() === null\n ? null\n : ((this.state().value()! - this.state().min()) / (this.state().max() - this.state().min())) *\n 100,\n );\n}\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressLabel]',\n exportAs: 'ngpProgressLabel',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressLabel {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * The unique identifier for the progress label.\n */\n readonly id = input<string>(uniqueId('ngp-progress-label'));\n\n constructor() {\n this.state().label.set(this);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressTrack]',\n exportAs: 'ngpProgressTrack',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressTrack {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressValue]',\n exportAs: 'ngpProgressValue',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressValue {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, computed, input, numberAttribute, signal } from '@angular/core';\nimport { NgpProgressLabel } from '../progress-label/progress-label';\nimport { progressState, provideProgressState } from './progress-state';\n\n/**\n * Apply the `ngpProgress` directive to an element that represents the progress bar.\n */\n@Directive({\n selector: '[ngpProgress]',\n providers: [provideProgressState()],\n host: {\n role: 'progressbar',\n '[attr.aria-valuemax]': 'state.max()',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'state.value()',\n '[attr.aria-valuetext]': 'valueText()',\n '[attr.aria-labelledby]': 'label() ? label()?.id : null',\n '[attr.data-progressing]': 'progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'complete() ? \"\" : null',\n },\n})\nexport class NgpProgress {\n /**\n * Define the progress value.\n */\n readonly value = input<number | null, NumberInput>(0, {\n alias: 'ngpProgressValue',\n transform: v => (v == null ? null : numberAttribute(v)),\n });\n\n /**\n * Define the progress min value.\n * @default '0'\n */\n readonly min = input<number, NumberInput>(0, {\n alias: 'ngpProgressMin',\n transform: numberAttribute,\n });\n\n /**\n * Define the progress max value.\n * @default 100\n */\n readonly max = input<number, NumberInput>(100, {\n alias: 'ngpProgressMax',\n transform: numberAttribute,\n });\n\n /**\n * Define a function that returns the progress value label.\n * @param value The current value\n * @param max The maximum value\n * @returns The value label\n */\n readonly valueLabel = input<NgpProgressValueTextFn>(\n (value, max) => `${Math.round((value / max) * 100)}%`,\n {\n alias: 'ngpProgressValueLabel',\n },\n );\n\n /**\n * Determine if the progress is indeterminate.\n * @internal\n */\n readonly indeterminate = computed(() => this.state.value() === null);\n\n /**\n * Determine if the progress is in a progressing state.\n * @internal\n */\n readonly progressing = computed(\n () =>\n this.state.value() != null &&\n this.state.value()! > 0 &&\n this.state.value()! < this.state.max(),\n );\n\n /**\n * Determine if the progress is complete.\n * @internal\n */\n readonly complete = computed(() => this.state.value() === this.state.max());\n\n /**\n * Get the progress value text.\n */\n protected readonly valueText = computed(() => {\n const value = this.state.value();\n\n if (value == null) {\n return '';\n }\n\n return this.state.valueLabel()(value, this.state.max());\n });\n\n /**\n * The label associated with the progress bar.\n * @internal\n */\n readonly label = signal<NgpProgressLabel | null>(null);\n\n /**\n * The state of the progress bar.\n * @internal\n */\n protected readonly state = progressState<NgpProgress>(this);\n}\n\nexport type NgpProgressValueTextFn = (value: number, max: number) => string;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GA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A,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,aAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,aAAA,EAAA,oBAAA,EAAA,GAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,qBAAA,EAAA,aAAA,EAAA,sBAAA,EAAA,8BAAA,EAAA,uBAAA,EAAA,6BAAA,EAAA,yBAAA,EAAA,+BAAA,EAAA,oBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,SAAA,EAbX,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAaxB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAfvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,aAAa;AACnB,wBAAA,sBAAsB,EAAE,aAAa;AACrC,wBAAA,sBAAsB,EAAE,GAAG;AAC3B,wBAAA,sBAAsB,EAAE,eAAe;AACvC,wBAAA,uBAAuB,EAAE,aAAa;AACtC,wBAAA,wBAAwB,EAAE,8BAA8B;AACxD,wBAAA,yBAAyB,EAAE,2BAA2B;AACtD,wBAAA,2BAA2B,EAAE,6BAA6B;AAC1D,wBAAA,sBAAsB,EAAE,wBAAwB;AACjD,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-progress.mjs","sources":["../../../../packages/ng-primitives/progress/src/progress/progress-state.ts","../../../../packages/ng-primitives/progress/src/progress-indicator/progress-indicator.ts","../../../../packages/ng-primitives/progress/src/progress-label/progress-label.ts","../../../../packages/ng-primitives/progress/src/progress-track/progress-track.ts","../../../../packages/ng-primitives/progress/src/progress-value/progress-value.ts","../../../../packages/ng-primitives/progress/src/progress/progress.ts","../../../../packages/ng-primitives/progress/src/ng-primitives-progress.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpProgress } from './progress';\n\n/**\n * The state token for the Progress primitive.\n */\nexport const NgpProgressStateToken = createStateToken<NgpProgress>('Progress');\n\n/**\n * Provides the Progress state.\n */\nexport const provideProgressState = createStateProvider(NgpProgressStateToken);\n\n/**\n * Injects the Progress state.\n */\nexport const injectProgressState = createStateInjector<NgpProgress>(NgpProgressStateToken);\n\n/**\n * The Progress state registration function.\n */\nexport const progressState = createState(NgpProgressStateToken);\n","import { computed, Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n/**\n * Apply the `ngpProgressIndicator` directive to an element that represents the current progress.\n * The width of this element can be set to the percentage of the progress value.\n */\n@Directive({\n selector: '[ngpProgressIndicator]',\n host: {\n '[style.width.%]': 'percentage()',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressIndicator {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * Get the percentage of the progress value.\n */\n protected readonly percentage = computed(() =>\n this.state().value() === null\n ? null\n : ((this.state().value()! - this.state().min()) / (this.state().max() - this.state().min())) *\n 100,\n );\n}\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressLabel]',\n exportAs: 'ngpProgressLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'elementRef.nativeElement.tagName === \"LABEL\" ? state().id() : null',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressLabel {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n\n /**\n * Access the element ref.\n */\n protected readonly elementRef = injectElementRef();\n\n /**\n * The unique identifier for the progress label.\n */\n readonly id = input<string>(uniqueId('ngp-progress-label'));\n\n constructor() {\n this.state().label.set(this);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressTrack]',\n exportAs: 'ngpProgressTrack',\n host: {\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressTrack {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { Directive } from '@angular/core';\nimport { injectProgressState } from '../progress/progress-state';\n\n@Directive({\n selector: '[ngpProgressValue]',\n exportAs: 'ngpProgressValue',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-progressing]': 'state().progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'state().indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'state().complete() ? \"\" : null',\n },\n})\nexport class NgpProgressValue {\n /**\n * Access the progress state.\n */\n protected readonly state = injectProgressState();\n}\n","import { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, computed, input, numberAttribute, signal } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpProgressLabel } from '../progress-label/progress-label';\nimport { progressState, provideProgressState } from './progress-state';\n\n/**\n * Apply the `ngpProgress` directive to an element that represents the progress bar.\n */\n@Directive({\n selector: '[ngpProgress]',\n providers: [provideProgressState()],\n host: {\n role: 'progressbar',\n '[attr.id]': 'id()',\n '[attr.aria-valuemax]': 'state.max()',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'state.value()',\n '[attr.aria-valuetext]': 'valueText()',\n '[attr.aria-labelledby]': 'label() ? label()?.id() : null',\n '[attr.data-progressing]': 'progressing() ? \"\" : null',\n '[attr.data-indeterminate]': 'indeterminate() ? \"\" : null',\n '[attr.data-complete]': 'complete() ? \"\" : null',\n },\n})\nexport class NgpProgress {\n /**\n * Define the progress value.\n */\n readonly value = input<number | null, NumberInput>(0, {\n alias: 'ngpProgressValue',\n transform: v => (v == null ? null : numberAttribute(v)),\n });\n\n /**\n * Define the progress min value.\n * @default '0'\n */\n readonly min = input<number, NumberInput>(0, {\n alias: 'ngpProgressMin',\n transform: numberAttribute,\n });\n\n /**\n * Define the progress max value.\n * @default 100\n */\n readonly max = input<number, NumberInput>(100, {\n alias: 'ngpProgressMax',\n transform: numberAttribute,\n });\n\n /**\n * Define a function that returns the progress value label.\n * @param value The current value\n * @param max The maximum value\n * @returns The value label\n */\n readonly valueLabel = input<NgpProgressValueTextFn>(\n (value, max) => `${Math.round((value / max) * 100)}%`,\n {\n alias: 'ngpProgressValueLabel',\n },\n );\n\n /**\n * The unique identifier for the progress.\n */\n readonly id = input<string>(uniqueId('ngp-progress'));\n\n /**\n * Determine if the progress is indeterminate.\n * @internal\n */\n readonly indeterminate = computed(() => this.state.value() === null);\n\n /**\n * Determine if the progress is in a progressing state.\n * @internal\n */\n readonly progressing = computed(\n () =>\n this.state.value() != null &&\n this.state.value()! > 0 &&\n this.state.value()! < this.state.max(),\n );\n\n /**\n * Determine if the progress is complete.\n * @internal\n */\n readonly complete = computed(() => this.state.value() === this.state.max());\n\n /**\n * Get the progress value text.\n */\n protected readonly valueText = computed(() => {\n const value = this.state.value();\n\n if (value == null) {\n return '';\n }\n\n return this.state.valueLabel()(value, this.state.max());\n });\n\n /**\n * The label associated with the progress bar.\n * @internal\n */\n readonly label = signal<NgpProgressLabel | null>(null);\n\n /**\n * The state of the progress bar.\n * @internal\n */\n protected readonly state = progressState<NgpProgress>(this);\n}\n\nexport type NgpProgressValueTextFn = (value: number, max: number) => string;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;ACvB/D;;;AAGG;MAUU,oBAAoB,CAAA;AATjC,IAAA,WAAA,GAAA;AAUE;;AAEG;QACgB,IAAA,CAAA,KAAK,GAAG,mBAAmB,EAAE;AAEhD;;AAEG;AACgB,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MACvC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK;AACvB,cAAE;AACF,cAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC;AACzF,gBAAA,GAAG,sDACR;AACF,IAAA;8GAfY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,qCAAA,EAAA,yBAAA,EAAA,uCAAA,EAAA,oBAAA,EAAA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C,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAcxB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAhBvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,aAAa;AACnB,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,sBAAsB,EAAE,aAAa;AACrC,wBAAA,sBAAsB,EAAE,GAAG;AAC3B,wBAAA,sBAAsB,EAAE,eAAe;AACvC,wBAAA,uBAAuB,EAAE,aAAa;AACtC,wBAAA,wBAAwB,EAAE,gCAAgC;AAC1D,wBAAA,yBAAyB,EAAE,2BAA2B;AACtD,wBAAA,2BAA2B,EAAE,6BAA6B;AAC1D,wBAAA,sBAAsB,EAAE,wBAAwB;AACjD,qBAAA;AACF,iBAAA;;;ACxBD;;AAEG;;;;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.91.0",
5
+ "version": "0.91.2",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -25,6 +25,10 @@ declare class NgpProgressLabel {
25
25
  * Access the progress state.
26
26
  */
27
27
  protected readonly state: _angular_core.Signal<ng_primitives_state.State<ng_primitives_progress.NgpProgress>>;
28
+ /**
29
+ * Access the element ref.
30
+ */
31
+ protected readonly elementRef: _angular_core.ElementRef<HTMLElement>;
28
32
  /**
29
33
  * The unique identifier for the progress label.
30
34
  */
@@ -77,6 +81,10 @@ declare class NgpProgress {
77
81
  * @returns The value label
78
82
  */
79
83
  readonly valueLabel: _angular_core.InputSignal<NgpProgressValueTextFn>;
84
+ /**
85
+ * The unique identifier for the progress.
86
+ */
87
+ readonly id: _angular_core.InputSignal<string>;
80
88
  /**
81
89
  * Determine if the progress is indeterminate.
82
90
  * @internal
@@ -107,7 +115,7 @@ declare class NgpProgress {
107
115
  */
108
116
  protected readonly state: ng_primitives_state.CreatedState<NgpProgress>;
109
117
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpProgress, never>;
110
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpProgress, "[ngpProgress]", never, { "value": { "alias": "ngpProgressValue"; "required": false; "isSignal": true; }; "min": { "alias": "ngpProgressMin"; "required": false; "isSignal": true; }; "max": { "alias": "ngpProgressMax"; "required": false; "isSignal": true; }; "valueLabel": { "alias": "ngpProgressValueLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
118
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpProgress, "[ngpProgress]", never, { "value": { "alias": "ngpProgressValue"; "required": false; "isSignal": true; }; "min": { "alias": "ngpProgressMin"; "required": false; "isSignal": true; }; "max": { "alias": "ngpProgressMax"; "required": false; "isSignal": true; }; "valueLabel": { "alias": "ngpProgressValueLabel"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
111
119
  }
112
120
  type NgpProgressValueTextFn = (value: number, max: number) => string;
113
121
 
@@ -18,7 +18,7 @@ import {
18
18
  ],
19
19
  imports: [NgpProgressIndicator, NgpProgressTrack, NgpProgressLabel, NgpProgressValue],
20
20
  template: `
21
- <span ngpProgressLabel>{{ label() }}</span>
21
+ <label ngpProgressLabel>{{ label() }}</label>
22
22
  <span ngpProgressValue>{{ value() }}%</span>
23
23
 
24
24
  <div ngpProgressTrack>