@spartan-ng/brain 0.0.1-alpha.498 → 0.0.1-alpha.500
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/alert-dialog/lib/brn-alert-dialog-trigger.d.ts +2 -1
- package/fesm2022/spartan-ng-brain-alert-dialog.mjs +3 -1
- package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-progress.mjs +17 -11
- package/fesm2022/spartan-ng-brain-progress.mjs.map +1 -1
- package/package.json +1 -1
- package/progress/lib/brn-progress-indicator.d.ts +1 -1
- package/progress/lib/brn-progress.d.ts +10 -1
|
@@ -3,7 +3,8 @@ import type { BrnAlertDialog } from './brn-alert-dialog';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class BrnAlertDialogTrigger extends BrnDialogTrigger {
|
|
5
5
|
readonly brnAlertDialogTriggerFor: import("@angular/core").InputSignal<BrnAlertDialog | undefined>;
|
|
6
|
+
readonly type: import("@angular/core").InputSignal<"button" | "submit" | "reset">;
|
|
6
7
|
constructor();
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrnAlertDialogTrigger, never>;
|
|
8
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAlertDialogTrigger, "button[brnAlertDialogTrigger],button[brnAlertDialogTriggerFor]", never, { "brnAlertDialogTriggerFor": { "alias": "brnAlertDialogTriggerFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAlertDialogTrigger, "button[brnAlertDialogTrigger],button[brnAlertDialogTriggerFor]", never, { "brnAlertDialogTriggerFor": { "alias": "brnAlertDialogTriggerFor"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
9
10
|
}
|
|
@@ -97,6 +97,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
97
97
|
|
|
98
98
|
class BrnAlertDialogTrigger extends BrnDialogTrigger {
|
|
99
99
|
brnAlertDialogTriggerFor = input();
|
|
100
|
+
type = input('button');
|
|
100
101
|
constructor() {
|
|
101
102
|
super();
|
|
102
103
|
effect(() => {
|
|
@@ -109,7 +110,7 @@ class BrnAlertDialogTrigger extends BrnDialogTrigger {
|
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
112
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAlertDialogTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
112
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnAlertDialogTrigger, isStandalone: true, selector: "button[brnAlertDialogTrigger],button[brnAlertDialogTriggerFor]", inputs: { brnAlertDialogTriggerFor: { classPropertyName: "brnAlertDialogTriggerFor", publicName: "brnAlertDialogTriggerFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "dialog" }, properties: { "id": "id()", "attr.aria-expanded": "state() === 'open' ? 'true': 'false'", "attr.data-state": "state()", "attr.aria-controls": "dialogId" } }, usesInheritance: true, ngImport: i0 });
|
|
113
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnAlertDialogTrigger, isStandalone: true, selector: "button[brnAlertDialogTrigger],button[brnAlertDialogTriggerFor]", inputs: { brnAlertDialogTriggerFor: { classPropertyName: "brnAlertDialogTriggerFor", publicName: "brnAlertDialogTriggerFor", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "dialog" }, properties: { "id": "id()", "attr.aria-expanded": "state() === 'open' ? 'true': 'false'", "attr.data-state": "state()", "attr.aria-controls": "dialogId", "type": "type()" } }, usesInheritance: true, ngImport: i0 });
|
|
113
114
|
}
|
|
114
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAlertDialogTrigger, decorators: [{
|
|
115
116
|
type: Directive,
|
|
@@ -121,6 +122,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
121
122
|
'[attr.aria-expanded]': "state() === 'open' ? 'true': 'false'",
|
|
122
123
|
'[attr.data-state]': 'state()',
|
|
123
124
|
'[attr.aria-controls]': 'dialogId',
|
|
125
|
+
'[type]': 'type()',
|
|
124
126
|
},
|
|
125
127
|
}]
|
|
126
128
|
}], ctorParameters: () => [] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-alert-dialog.mjs","sources":["../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-content.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-description.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-overlay.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-title.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-trigger.ts","../../../../libs/brain/alert-dialog/src/index.ts","../../../../libs/brain/alert-dialog/src/spartan-ng-brain-alert-dialog.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, ViewEncapsulation } from '@angular/core';\nimport { BrnDialog, BrnDialogDefaultOptions, provideBrnDialogDefaultOptions } from '@spartan-ng/brain/dialog';\n\nexport const BRN_ALERT_DIALOG_DEFAULT_OPTIONS: Partial<BrnDialogDefaultOptions> = {\n\tcloseOnBackdropClick: false,\n\tcloseOnOutsidePointerEvents: false,\n\trole: 'alertdialog',\n};\n\n@Component({\n\tselector: 'brn-alert-dialog',\n\ttemplate: `\n\t\t<ng-content />\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: BrnDialog,\n\t\t\tuseExisting: forwardRef(() => BrnAlertDialog),\n\t\t},\n\t\tprovideBrnDialogDefaultOptions(BRN_ALERT_DIALOG_DEFAULT_OPTIONS),\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n\texportAs: 'brnAlertDialog',\n})\nexport class BrnAlertDialog extends BrnDialog {}\n","import { Directive } from '@angular/core';\nimport { provideExposesStateProviderExisting } from '@spartan-ng/brain/core';\nimport { BrnDialogContent } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnAlertDialogContent]',\n\tproviders: [provideExposesStateProviderExisting(() => BrnAlertDialogContent)],\n})\nexport class BrnAlertDialogContent<T> extends BrnDialogContent<T> {}\n","import { Directive } from '@angular/core';\nimport { BrnDialogDescription } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnAlertDialogDescription]',\n\thost: {\n\t\t'[id]': '_id()',\n\t},\n})\nexport class BrnAlertDialogDescription extends BrnDialogDescription {}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { provideCustomClassSettableExisting } from '@spartan-ng/brain/core';\nimport { BrnDialogOverlay } from '@spartan-ng/brain/dialog';\n\n@Component({\n\tselector: 'brn-alert-dialog-overlay',\n\tproviders: [provideCustomClassSettableExisting(() => BrnAlertDialogOverlay)],\n\ttemplate: '',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class BrnAlertDialogOverlay extends BrnDialogOverlay {}\n","import { Directive } from '@angular/core';\nimport { BrnDialogTitle } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnAlertDialogTitle]',\n\thost: {\n\t\t'[id]': '_id()',\n\t},\n})\nexport class BrnAlertDialogTitle extends BrnDialogTitle {}\n","import { Directive, effect, input, untracked } from '@angular/core';\nimport { BrnDialogTrigger } from '@spartan-ng/brain/dialog';\nimport type { BrnAlertDialog } from './brn-alert-dialog';\n\n@Directive({\n\tselector: 'button[brnAlertDialogTrigger],button[brnAlertDialogTriggerFor]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'aria-haspopup': 'dialog',\n\t\t'[attr.aria-expanded]': \"state() === 'open' ? 'true': 'false'\",\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-controls]': 'dialogId',\n\t},\n})\nexport class BrnAlertDialogTrigger extends BrnDialogTrigger {\n\tpublic readonly brnAlertDialogTriggerFor = input<BrnAlertDialog | undefined>();\n\n\tconstructor() {\n\t\tsuper();\n\t\teffect(() => {\n\t\t\tconst brnDialog = this.brnAlertDialogTriggerFor();\n\t\t\tuntracked(() => {\n\t\t\t\tif (brnDialog) {\n\t\t\t\t\tthis.mutableBrnDialogTriggerFor().set(brnDialog);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnAlertDialog } from './lib/brn-alert-dialog';\nimport { BrnAlertDialogContent } from './lib/brn-alert-dialog-content';\nimport { BrnAlertDialogDescription } from './lib/brn-alert-dialog-description';\nimport { BrnAlertDialogOverlay } from './lib/brn-alert-dialog-overlay';\nimport { BrnAlertDialogTitle } from './lib/brn-alert-dialog-title';\nimport { BrnAlertDialogTrigger } from './lib/brn-alert-dialog-trigger';\n\nexport * from './lib/brn-alert-dialog';\nexport * from './lib/brn-alert-dialog-content';\nexport * from './lib/brn-alert-dialog-description';\nexport * from './lib/brn-alert-dialog-overlay';\nexport * from './lib/brn-alert-dialog-title';\nexport * from './lib/brn-alert-dialog-trigger';\n\nexport const BrnAlertDialogImports = [\n\tBrnAlertDialog,\n\tBrnAlertDialogOverlay,\n\tBrnAlertDialogTrigger,\n\tBrnAlertDialogContent,\n\tBrnAlertDialogTitle,\n\tBrnAlertDialogDescription,\n] as const;\n\n@NgModule({\n\timports: [...BrnAlertDialogImports],\n\texports: [...BrnAlertDialogImports],\n})\nexport class BrnAlert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BAAA,MAAM,EAAE,MAAM;AACd,wBAAA,eAAe,EAAE,QAAQ;AACzB,wBAAA,sBAAsB,EAAE,sCAAsC;AAC9D,wBAAA,mBAAmB,EAAE,SAAS;AAC9B,wBAAA,sBAAsB,EAAE,UAAU;AAClC,qBAAA;AACD,iBAAA;;;ACGM,MAAM,qBAAqB,GAAG;IACpC,cAAc;IACd,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,mBAAmB;IACnB,yBAAyB;;MAOb,oBAAoB,CAAA;0HAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAApB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAZhC,cAAc;YACd,qBAAqB;YACrB,qBAAqB;YACrB,qBAAqB;YACrB,mBAAmB;AACnB,YAAA,yBAAyB,aALzB,cAAc;YACd,qBAAqB;YACrB,qBAAqB;YACrB,qBAAqB;YACrB,mBAAmB;YACnB,yBAAyB,CAAA,EAAA,CAAA;2HAOb,oBAAoB,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,qBAAqB,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,qBAAqB,CAAC;AACnC,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-alert-dialog.mjs","sources":["../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-content.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-description.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-overlay.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-title.ts","../../../../libs/brain/alert-dialog/src/lib/brn-alert-dialog-trigger.ts","../../../../libs/brain/alert-dialog/src/index.ts","../../../../libs/brain/alert-dialog/src/spartan-ng-brain-alert-dialog.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, forwardRef, ViewEncapsulation } from '@angular/core';\nimport { BrnDialog, BrnDialogDefaultOptions, provideBrnDialogDefaultOptions } from '@spartan-ng/brain/dialog';\n\nexport const BRN_ALERT_DIALOG_DEFAULT_OPTIONS: Partial<BrnDialogDefaultOptions> = {\n\tcloseOnBackdropClick: false,\n\tcloseOnOutsidePointerEvents: false,\n\trole: 'alertdialog',\n};\n\n@Component({\n\tselector: 'brn-alert-dialog',\n\ttemplate: `\n\t\t<ng-content />\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: BrnDialog,\n\t\t\tuseExisting: forwardRef(() => BrnAlertDialog),\n\t\t},\n\t\tprovideBrnDialogDefaultOptions(BRN_ALERT_DIALOG_DEFAULT_OPTIONS),\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n\texportAs: 'brnAlertDialog',\n})\nexport class BrnAlertDialog extends BrnDialog {}\n","import { Directive } from '@angular/core';\nimport { provideExposesStateProviderExisting } from '@spartan-ng/brain/core';\nimport { BrnDialogContent } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnAlertDialogContent]',\n\tproviders: [provideExposesStateProviderExisting(() => BrnAlertDialogContent)],\n})\nexport class BrnAlertDialogContent<T> extends BrnDialogContent<T> {}\n","import { Directive } from '@angular/core';\nimport { BrnDialogDescription } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnAlertDialogDescription]',\n\thost: {\n\t\t'[id]': '_id()',\n\t},\n})\nexport class BrnAlertDialogDescription extends BrnDialogDescription {}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { provideCustomClassSettableExisting } from '@spartan-ng/brain/core';\nimport { BrnDialogOverlay } from '@spartan-ng/brain/dialog';\n\n@Component({\n\tselector: 'brn-alert-dialog-overlay',\n\tproviders: [provideCustomClassSettableExisting(() => BrnAlertDialogOverlay)],\n\ttemplate: '',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class BrnAlertDialogOverlay extends BrnDialogOverlay {}\n","import { Directive } from '@angular/core';\nimport { BrnDialogTitle } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnAlertDialogTitle]',\n\thost: {\n\t\t'[id]': '_id()',\n\t},\n})\nexport class BrnAlertDialogTitle extends BrnDialogTitle {}\n","import { Directive, effect, input, untracked } from '@angular/core';\nimport { BrnDialogTrigger } from '@spartan-ng/brain/dialog';\nimport type { BrnAlertDialog } from './brn-alert-dialog';\n\n@Directive({\n\tselector: 'button[brnAlertDialogTrigger],button[brnAlertDialogTriggerFor]',\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'aria-haspopup': 'dialog',\n\t\t'[attr.aria-expanded]': \"state() === 'open' ? 'true': 'false'\",\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-controls]': 'dialogId',\n\t\t'[type]': 'type()',\n\t},\n})\nexport class BrnAlertDialogTrigger extends BrnDialogTrigger {\n\tpublic readonly brnAlertDialogTriggerFor = input<BrnAlertDialog | undefined>();\n\tpublic readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n\tconstructor() {\n\t\tsuper();\n\t\teffect(() => {\n\t\t\tconst brnDialog = this.brnAlertDialogTriggerFor();\n\t\t\tuntracked(() => {\n\t\t\t\tif (brnDialog) {\n\t\t\t\t\tthis.mutableBrnDialogTriggerFor().set(brnDialog);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnAlertDialog } from './lib/brn-alert-dialog';\nimport { BrnAlertDialogContent } from './lib/brn-alert-dialog-content';\nimport { BrnAlertDialogDescription } from './lib/brn-alert-dialog-description';\nimport { BrnAlertDialogOverlay } from './lib/brn-alert-dialog-overlay';\nimport { BrnAlertDialogTitle } from './lib/brn-alert-dialog-title';\nimport { BrnAlertDialogTrigger } from './lib/brn-alert-dialog-trigger';\n\nexport * from './lib/brn-alert-dialog';\nexport * from './lib/brn-alert-dialog-content';\nexport * from './lib/brn-alert-dialog-description';\nexport * from './lib/brn-alert-dialog-overlay';\nexport * from './lib/brn-alert-dialog-title';\nexport * from './lib/brn-alert-dialog-trigger';\n\nexport const BrnAlertDialogImports = [\n\tBrnAlertDialog,\n\tBrnAlertDialogOverlay,\n\tBrnAlertDialogTrigger,\n\tBrnAlertDialogContent,\n\tBrnAlertDialogTitle,\n\tBrnAlertDialogDescription,\n] as const;\n\n@NgModule({\n\timports: [...BrnAlertDialogImports],\n\texports: [...BrnAlertDialogImports],\n})\nexport class BrnAlertDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGO,MAAM,gCAAgC,GAAqC;AACjF,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,2BAA2B,EAAE,KAAK;AAClC,IAAA,IAAI,EAAE,aAAa;;AAmBd,MAAO,cAAe,SAAQ,SAAS,CAAA;0HAAhC,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,SAAA,EAXf;AACV,YAAA;AACC,gBAAA,OAAO,EAAE,SAAS;AAClB,gBAAA,WAAW,EAAE,UAAU,EAAC,MAAM,cAAc,EAAC;AAC7C,aAAA;YAC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eAAA,CAAA,QAAA,EAAA,CAAA;AAApB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAZhC,cAAc;YACd,qBAAqB;YACrB,qBAAqB;YACrB,qBAAqB;YACrB,mBAAmB;AACnB,YAAA,yBAAyB,aALzB,cAAc;YACd,qBAAqB;YACrB,qBAAqB;YACrB,qBAAqB;YACrB,mBAAmB;YACnB,yBAAyB,CAAA,EAAA,CAAA;2HAOb,oBAAoB,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,qBAAqB,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,qBAAqB,CAAC;AACnC,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, input, numberAttribute, computed,
|
|
2
|
+
import { InjectionToken, inject, input, numberAttribute, computed, Directive, NgModule } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
const BrnProgressToken = new InjectionToken('BrnProgressComponent');
|
|
5
5
|
function provideBrnProgress(progress) {
|
|
@@ -10,10 +10,19 @@ function injectBrnProgress() {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class BrnProgress {
|
|
13
|
+
/**
|
|
14
|
+
* The current progress value.
|
|
15
|
+
*/
|
|
13
16
|
value = input(undefined, {
|
|
14
17
|
transform: (value) => (value === undefined || value === null ? undefined : Number(value)),
|
|
15
18
|
});
|
|
19
|
+
/**
|
|
20
|
+
* The maximum progress value.
|
|
21
|
+
*/
|
|
16
22
|
max = input(100, { transform: numberAttribute });
|
|
23
|
+
/**
|
|
24
|
+
* A function that returns the label for the current progress value.
|
|
25
|
+
*/
|
|
17
26
|
getValueLabel = input((value, max) => `${Math.round((value / max) * 100)}%`);
|
|
18
27
|
_label = computed(() => {
|
|
19
28
|
const value = this.value();
|
|
@@ -43,14 +52,13 @@ class BrnProgress {
|
|
|
43
52
|
throw Error('max must be greater than 0');
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnProgress, deps: [], target: i0.ɵɵFactoryTarget.
|
|
47
|
-
/** @nocollapse */ static
|
|
55
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnProgress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnProgress, isStandalone: true, selector: "brn-progress", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, getValueLabel: { classPropertyName: "getValueLabel", publicName: "getValueLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "attr.aria-valuemax": "max()", "attr.aria-valuemin": "0", "attr.aria-valuenow": "value()", "attr.aria-valuetext": "_label()", "attr.data-state": "state()", "attr.data-value": "value()", "attr.data-max": "max()" } }, providers: [provideBrnProgress(BrnProgress)], exportAs: ["brnProgress"], usesOnChanges: true, ngImport: i0 });
|
|
48
57
|
}
|
|
49
58
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnProgress, decorators: [{
|
|
50
|
-
type:
|
|
59
|
+
type: Directive,
|
|
51
60
|
args: [{
|
|
52
61
|
selector: 'brn-progress',
|
|
53
|
-
template: '<ng-content/>',
|
|
54
62
|
exportAs: 'brnProgress',
|
|
55
63
|
providers: [provideBrnProgress(BrnProgress)],
|
|
56
64
|
host: {
|
|
@@ -63,26 +71,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
63
71
|
'[attr.data-value]': 'value()',
|
|
64
72
|
'[attr.data-max]': 'max()',
|
|
65
73
|
},
|
|
66
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
67
74
|
}]
|
|
68
75
|
}] });
|
|
69
76
|
|
|
77
|
+
/* eslint-disable @angular-eslint/directive-selector */
|
|
70
78
|
class BrnProgressIndicator {
|
|
71
79
|
_progress = injectBrnProgress();
|
|
72
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnProgressIndicator, deps: [], target: i0.ɵɵFactoryTarget.
|
|
73
|
-
/** @nocollapse */ static
|
|
80
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnProgressIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
81
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BrnProgressIndicator, isStandalone: true, selector: "brn-progress-indicator", host: { properties: { "attr.data-state": "_progress.state()", "attr.data-value": "_progress.value()", "attr.data-max": "_progress.max()" } }, ngImport: i0 });
|
|
74
82
|
}
|
|
75
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnProgressIndicator, decorators: [{
|
|
76
|
-
type:
|
|
84
|
+
type: Directive,
|
|
77
85
|
args: [{
|
|
78
86
|
selector: 'brn-progress-indicator',
|
|
79
|
-
template: '',
|
|
80
87
|
host: {
|
|
81
88
|
'[attr.data-state]': '_progress.state()',
|
|
82
89
|
'[attr.data-value]': '_progress.value()',
|
|
83
90
|
'[attr.data-max]': '_progress.max()',
|
|
84
91
|
},
|
|
85
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
86
92
|
}]
|
|
87
93
|
}] });
|
|
88
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-progress.mjs","sources":["../../../../libs/brain/progress/src/lib/brn-progress.token.ts","../../../../libs/brain/progress/src/lib/brn-progress.ts","../../../../libs/brain/progress/src/lib/brn-progress-indicator.ts","../../../../libs/brain/progress/src/index.ts","../../../../libs/brain/progress/src/spartan-ng-brain-progress.ts"],"sourcesContent":["import { ExistingProvider, InjectionToken, Type, inject } from '@angular/core';\nimport type { BrnProgress } from './brn-progress';\n\nconst BrnProgressToken = new InjectionToken<BrnProgress>('BrnProgressComponent');\n\nexport function provideBrnProgress(progress: Type<BrnProgress>): ExistingProvider {\n\treturn { provide: BrnProgressToken, useExisting: progress };\n}\n\nexport function injectBrnProgress(): BrnProgress {\n\treturn inject(BrnProgressToken);\n}\n","
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-progress.mjs","sources":["../../../../libs/brain/progress/src/lib/brn-progress.token.ts","../../../../libs/brain/progress/src/lib/brn-progress.ts","../../../../libs/brain/progress/src/lib/brn-progress-indicator.ts","../../../../libs/brain/progress/src/index.ts","../../../../libs/brain/progress/src/spartan-ng-brain-progress.ts"],"sourcesContent":["import { ExistingProvider, InjectionToken, Type, inject } from '@angular/core';\nimport type { BrnProgress } from './brn-progress';\n\nconst BrnProgressToken = new InjectionToken<BrnProgress>('BrnProgressComponent');\n\nexport function provideBrnProgress(progress: Type<BrnProgress>): ExistingProvider {\n\treturn { provide: BrnProgressToken, useExisting: progress };\n}\n\nexport function injectBrnProgress(): BrnProgress {\n\treturn inject(BrnProgressToken);\n}\n","/* eslint-disable @angular-eslint/directive-selector */\nimport { type NumberInput } from '@angular/cdk/coercion';\nimport { Directive, OnChanges, SimpleChanges, computed, input, numberAttribute } from '@angular/core';\nimport { provideBrnProgress } from './brn-progress.token';\n\n@Directive({\n\tselector: 'brn-progress',\n\texportAs: 'brnProgress',\n\tproviders: [provideBrnProgress(BrnProgress)],\n\thost: {\n\t\trole: 'progressbar',\n\t\t'[attr.aria-valuemax]': 'max()',\n\t\t'[attr.aria-valuemin]': '0',\n\t\t'[attr.aria-valuenow]': 'value()',\n\t\t'[attr.aria-valuetext]': '_label()',\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-value]': 'value()',\n\t\t'[attr.data-max]': 'max()',\n\t},\n})\nexport class BrnProgress implements OnChanges {\n\t/**\n\t * The current progress value.\n\t */\n\tpublic readonly value = input<number | null | undefined, NumberInput>(undefined, {\n\t\ttransform: (value) => (value === undefined || value === null ? undefined : Number(value)),\n\t});\n\n\t/**\n\t * The maximum progress value.\n\t */\n\tpublic readonly max = input<number, NumberInput>(100, { transform: numberAttribute });\n\n\t/**\n\t * A function that returns the label for the current progress value.\n\t */\n\tpublic readonly getValueLabel = input<BrnProgressLabelFn>((value, max) => `${Math.round((value / max) * 100)}%`);\n\n\tprotected readonly _label = computed(() => {\n\t\tconst value = this.value();\n\t\treturn value === null || value === undefined ? undefined : this.getValueLabel()(value, this.max());\n\t});\n\n\tpublic readonly state = computed(() => {\n\t\tconst value = this.value();\n\t\tconst max = this.max();\n\n\t\treturn value === null || value === undefined ? 'indeterminate' : value === max ? 'complete' : 'loading';\n\t});\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif ('value' in changes || 'max' in changes) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tprivate validate(): void {\n\t\t// validate that the value is within the bounds of the max\n\t\tconst value = this.value();\n\t\tconst max = this.max();\n\n\t\tif (value === null || value === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value > max || value < 0) {\n\t\t\tthrow Error('Value must be 0 or greater and less or equal to max');\n\t\t}\n\n\t\tif (max < 0) {\n\t\t\tthrow Error('max must be greater than 0');\n\t\t}\n\t}\n}\n\nexport type BrnProgressLabelFn = (value: number, max: number) => string;\n","/* eslint-disable @angular-eslint/directive-selector */\nimport { Directive } from '@angular/core';\nimport { injectBrnProgress } from './brn-progress.token';\n\n@Directive({\n\tselector: 'brn-progress-indicator',\n\thost: {\n\t\t'[attr.data-state]': '_progress.state()',\n\t\t'[attr.data-value]': '_progress.value()',\n\t\t'[attr.data-max]': '_progress.max()',\n\t},\n})\nexport class BrnProgressIndicator {\n\tprotected readonly _progress = injectBrnProgress();\n}\n","import { NgModule } from '@angular/core';\n\nimport { BrnProgress } from './lib/brn-progress';\nimport { BrnProgressIndicator } from './lib/brn-progress-indicator';\nexport { injectBrnProgress } from './lib/brn-progress.token';\n\nexport * from './lib/brn-progress';\nexport * from './lib/brn-progress-indicator';\n\nexport const BrnProgressImports = [BrnProgress, BrnProgressIndicator] as const;\n\n@NgModule({\n\timports: [...BrnProgressImports],\n\texports: [...BrnProgressImports],\n})\nexport class BrnProgressModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAc,sBAAsB,CAAC;AAE1E,SAAU,kBAAkB,CAAC,QAA2B,EAAA;IAC7D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE;AAC5D;SAEgB,iBAAiB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC;AAChC;;MCSa,WAAW,CAAA;AACvB;;AAEG;AACa,IAAA,KAAK,GAAG,KAAK,CAAyC,SAAS,EAAE;QAChF,SAAS,EAAE,CAAC,KAAK,MAAM,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACzF,KAAA,CAAC;AAEF;;AAEG;IACa,GAAG,GAAG,KAAK,CAAsB,GAAG,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAErF;;AAEG;IACa,a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AAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,IAAI,EAAE;AACL,wBAAA,mBAAmB,EAAE,mBAAmB;AACxC,wBAAA,mBAAmB,EAAE,mBAAmB;AACxC,wBAAA,iBAAiB,EAAE,iBAAiB;AACpC,qBAAA;AACD,iBAAA;;;MCFY,kBAAkB,GAAG,CAAC,WAAW,EAAE,oBAAoB;MAMvD,iBAAiB,CAAA;0HAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAjB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YANK,WAAW,EAAE,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAAjC,WAAW,EAAE,oBAAoB,CAAA,EAAA,CAAA;2HAMvD,iBAAiB,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;AAChC,oBAAA,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;AAChC,iBAAA;;;ACdD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -2,5 +2,5 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
export declare class BrnProgressIndicator {
|
|
3
3
|
protected readonly _progress: import("@spartan-ng/brain/progress").BrnProgress;
|
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrnProgressIndicator, never>;
|
|
5
|
-
static
|
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnProgressIndicator, "brn-progress-indicator", never, {}, {}, never, never, true, never>;
|
|
6
6
|
}
|
|
@@ -2,14 +2,23 @@ import { type NumberInput } from '@angular/cdk/coercion';
|
|
|
2
2
|
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class BrnProgress implements OnChanges {
|
|
5
|
+
/**
|
|
6
|
+
* The current progress value.
|
|
7
|
+
*/
|
|
5
8
|
readonly value: import("@angular/core").InputSignalWithTransform<number | null | undefined, NumberInput>;
|
|
9
|
+
/**
|
|
10
|
+
* The maximum progress value.
|
|
11
|
+
*/
|
|
6
12
|
readonly max: import("@angular/core").InputSignalWithTransform<number, NumberInput>;
|
|
13
|
+
/**
|
|
14
|
+
* A function that returns the label for the current progress value.
|
|
15
|
+
*/
|
|
7
16
|
readonly getValueLabel: import("@angular/core").InputSignal<BrnProgressLabelFn>;
|
|
8
17
|
protected readonly _label: import("@angular/core").Signal<string | undefined>;
|
|
9
18
|
readonly state: import("@angular/core").Signal<"indeterminate" | "complete" | "loading">;
|
|
10
19
|
ngOnChanges(changes: SimpleChanges): void;
|
|
11
20
|
private validate;
|
|
12
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrnProgress, never>;
|
|
13
|
-
static
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnProgress, "brn-progress", ["brnProgress"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "getValueLabel": { "alias": "getValueLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
14
23
|
}
|
|
15
24
|
export type BrnProgressLabelFn = (value: number, max: number) => string;
|