@daffodil/design 0.68.1 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atoms/progress-indicator/progress-indicator.component.d.ts +2 -1
- package/esm2022/atoms/progress-indicator/progress-indicator.component.mjs +3 -2
- package/esm2022/progress-bar/animation/progress-bar-animation.mjs +9 -0
- package/esm2022/progress-bar/daffodil-design-progress-bar.mjs +5 -0
- package/esm2022/progress-bar/examples/daffodil-design-progress-bar-examples.mjs +5 -0
- package/esm2022/progress-bar/examples/index.mjs +2 -0
- package/esm2022/progress-bar/examples/progress-bar-default/progress-bar-default.component.mjs +12 -0
- package/esm2022/progress-bar/examples/progress-bar-default/progress-bar-default.module.mjs +24 -0
- package/esm2022/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.component.mjs +12 -0
- package/esm2022/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.module.mjs +24 -0
- package/esm2022/progress-bar/examples/progress-bar-themes/progress-bar-themes.component.mjs +18 -0
- package/esm2022/progress-bar/examples/progress-bar-themes/progress-bar-themes.module.mjs +28 -0
- package/esm2022/progress-bar/examples/public_api.mjs +12 -0
- package/esm2022/progress-bar/progress-bar.component.mjs +142 -0
- package/esm2022/progress-bar/progress-bar.module.mjs +24 -0
- package/esm2022/progress-bar/public_api.mjs +3 -0
- package/esm2022/public_api.mjs +1 -2
- package/esm2022/sidebar/public_api.mjs +2 -1
- package/esm2022/sidebar/sidebar-viewport/sidebar-viewport.component.mjs +12 -4
- package/esm2022/sidebar/sidebar-viewport-backdrop/animation/backdrop-animation-state.mjs +2 -0
- package/esm2022/sidebar/sidebar-viewport-backdrop/animation/backdrop-animation.mjs +20 -0
- package/esm2022/sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.mjs +91 -0
- package/esm2022/sidebar/sidebar.module.mjs +10 -9
- package/esm2022/tree/examples/basic-tree/basic-tree.component.mjs +1 -1
- package/esm2022/tree/interfaces/tree-render-mode.mjs +2 -0
- package/esm2022/tree/public_api.mjs +2 -1
- package/esm2022/tree/tree/tree.component.mjs +43 -36
- package/esm2022/tree/utils/flatten-tree.mjs +26 -14
- package/esm2022/tree/utils/transform.mjs +25 -0
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +113 -0
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-progress-bar.mjs +178 -0
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -0
- package/fesm2022/daffodil-design-sidebar.mjs +131 -14
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +1 -1
- package/fesm2022/daffodil-design-tree-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +92 -48
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +3 -126
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/package.json +1 -1
- package/progress-bar/README.md +27 -0
- package/progress-bar/animation/progress-bar-animation.d.ts +4 -0
- package/progress-bar/examples/index.d.ts +1 -0
- package/progress-bar/examples/progress-bar-default/progress-bar-default.component.d.ts +5 -0
- package/progress-bar/examples/progress-bar-default/progress-bar-default.module.d.ts +8 -0
- package/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.component.d.ts +5 -0
- package/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.module.d.ts +8 -0
- package/progress-bar/examples/progress-bar-themes/progress-bar-themes.component.d.ts +9 -0
- package/progress-bar/examples/progress-bar-themes/progress-bar-themes.module.d.ts +9 -0
- package/progress-bar/examples/public_api.d.ts +2 -0
- package/progress-bar/index.d.ts +5 -0
- package/progress-bar/progress-bar.component.d.ts +76 -0
- package/progress-bar/progress-bar.module.d.ts +8 -0
- package/progress-bar/public_api.d.ts +2 -0
- package/progress-bar/src/progress-bar-theme.scss +68 -0
- package/public_api.d.ts +0 -1
- package/scss/theme.scss +2 -0
- package/sidebar/public_api.d.ts +1 -0
- package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +3 -2
- package/sidebar/sidebar-viewport-backdrop/animation/backdrop-animation-state.d.ts +2 -0
- package/{molecules/backdrop → sidebar/sidebar-viewport-backdrop}/animation/backdrop-animation.d.ts +1 -1
- package/{molecules/backdrop/backdrop/backdrop.component.d.ts → sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.d.ts} +5 -5
- package/sidebar/sidebar.module.d.ts +4 -4
- package/tree/README.md +1 -3
- package/tree/interfaces/tree-render-mode.d.ts +6 -0
- package/tree/public_api.d.ts +2 -0
- package/tree/tree/tree.component.d.ts +33 -11
- package/tree/utils/flatten-tree.d.ts +2 -1
- package/tree/utils/transform.d.ts +13 -0
- package/esm2022/molecules/backdrop/animation/backdrop-animation-state.mjs +0 -2
- package/esm2022/molecules/backdrop/animation/backdrop-animation.mjs +0 -20
- package/esm2022/molecules/backdrop/backdrop/backdrop.component.mjs +0 -87
- package/esm2022/molecules/backdrop/backdrop.module.mjs +0 -24
- package/esm2022/molecules/backdrop/public_api.mjs +0 -3
- package/molecules/backdrop/animation/backdrop-animation-state.d.ts +0 -2
- package/molecules/backdrop/backdrop.module.d.ts +0 -8
- package/molecules/backdrop/public_api.d.ts +0 -2
@@ -2,14 +2,15 @@
|
|
2
2
|
* Flatten a DaffTreeUi<unknown> into an array, removing elements from the array
|
3
3
|
* below nodes in the tree that are not open.
|
4
4
|
*/
|
5
|
-
export const flattenTree = (daffUiTree) => {
|
5
|
+
export const flattenTree = (daffUiTree, removeNodes = false) => {
|
6
6
|
const tree = [];
|
7
|
+
if (!daffUiTree) {
|
8
|
+
return [];
|
9
|
+
}
|
7
10
|
let items = [
|
8
11
|
{
|
9
12
|
...daffUiTree,
|
10
|
-
title: 'Root',
|
11
13
|
level: 0,
|
12
|
-
url: '/',
|
13
14
|
data: undefined,
|
14
15
|
open: true,
|
15
16
|
_treeRef: daffUiTree,
|
@@ -20,22 +21,33 @@ export const flattenTree = (daffUiTree) => {
|
|
20
21
|
if (!el) {
|
21
22
|
break;
|
22
23
|
}
|
23
|
-
|
24
|
-
items
|
25
|
-
|
26
|
-
...
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
items = [
|
25
|
+
...items,
|
26
|
+
...el.items.map((i) => ({
|
27
|
+
...i,
|
28
|
+
level: el.level + 1,
|
29
|
+
_treeRef: i,
|
30
|
+
})).reverse(),
|
31
|
+
];
|
32
|
+
if (!removeNodes && el._treeRef.parent) {
|
33
|
+
tree.push({
|
34
|
+
id: el.id,
|
35
|
+
title: el.title,
|
36
|
+
level: el.level,
|
37
|
+
url: el.url,
|
38
|
+
visible: el._treeRef.parent?.open,
|
39
|
+
hasChildren: el.items.length > 0,
|
40
|
+
data: undefined,
|
41
|
+
_treeRef: el._treeRef,
|
42
|
+
});
|
32
43
|
}
|
33
|
-
if (el._treeRef.parent?.open) {
|
44
|
+
else if (removeNodes && el._treeRef.parent?.open) {
|
34
45
|
tree.push({
|
35
46
|
id: el.id,
|
36
47
|
title: el.title,
|
37
48
|
level: el.level,
|
38
49
|
url: el.url,
|
50
|
+
visible: el._treeRef.parent?.open,
|
39
51
|
hasChildren: el.items.length > 0,
|
40
52
|
data: undefined,
|
41
53
|
_treeRef: el._treeRef,
|
@@ -44,4 +56,4 @@ export const flattenTree = (daffUiTree) => {
|
|
44
56
|
}
|
45
57
|
return tree;
|
46
58
|
};
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxhdHRlbi10cmVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9kZXNpZ24vdHJlZS9zcmMvdXRpbHMvZmxhdHRlbi10cmVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlCQTs7O0dBR0c7QUFDSC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VSZWYsXG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gdHJlZTtcbn07XG4iXX0=
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Transform a tree-like structure into a {@link DaffTreeData}.
|
3
|
+
*
|
4
|
+
* @param tree - The data structure representing tree-like data.
|
5
|
+
* @param transformFn - A user-supplied function that will transform the user
|
6
|
+
* type into a {@link DaffTreeData}
|
7
|
+
* @param key - The property of the your tree that indicates which
|
8
|
+
* key contains the "children" of your tree structure.
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
export const daffTransformTree = (tree, transformFn, key) => {
|
12
|
+
const transformedTree = transformFn(tree);
|
13
|
+
const queue = [{ node: tree, parent: transformedTree }];
|
14
|
+
while (queue.length > 0) {
|
15
|
+
const { node, parent } = queue.shift();
|
16
|
+
const childItems = node[key];
|
17
|
+
for (const child of childItems) {
|
18
|
+
const transformedChild = transformFn(child);
|
19
|
+
parent.items.push(transformedChild);
|
20
|
+
queue.push({ node: child, parent: transformedChild });
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return transformedTree;
|
24
|
+
};
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9kZXNpZ24vdHJlZS9zcmMvdXRpbHMvdHJhbnNmb3JtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBOzs7Ozs7Ozs7R0FTRztBQUNILE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLENBSy9CLElBQU8sRUFDUCxXQUF5QyxFQUN6QyxHQUE4QixFQUNiLEVBQUU7SUFFbkIsTUFBTSxlQUFlLEdBQW9CLFdBQVcsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUUzRCxNQUFNLEtBQUssR0FBMkMsQ0FBQyxFQUFFLElBQ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29uc3QgdHJhbnNmb3JtZWRDaGlsZDogRGFmZlRyZWVEYXRhPFY+ID0gdHJhbnNmb3JtRm4oY2hpbGQpO1xuICAgICAgcGFyZW50Lml0ZW1zLnB1c2godHJhbnNmb3JtZWRDaGlsZCk7XG4gICAgICBxdWV1ZS5wdXNoKHsgbm9kZTogY2hpbGQsIHBhcmVudDogdHJhbnNmb3JtZWRDaGlsZCB9KTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gdHJhbnNmb3JtZWRUcmVlO1xufTtcbiJdfQ==
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
3
|
+
import * as i1 from '@daffodil/design/progress-bar';
|
4
|
+
import { DaffProgressBarModule } from '@daffodil/design/progress-bar';
|
5
|
+
import * as i2 from '@angular/forms';
|
6
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
7
|
+
|
8
|
+
class ProgressBarDefaultComponent {
|
9
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarDefaultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
10
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: ProgressBarDefaultComponent, selector: "progress-bar-default", ngImport: i0, template: "<daff-progress-bar percentage=\"25\">\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>\n", styles: [":host{display:flex;flex-direction:column;gap:8px}\n"], dependencies: [{ kind: "component", type: i1.DaffProgressBarComponent, selector: "daff-progress-bar", inputs: ["color", "percentage", "indeterminate"], outputs: ["finished"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
11
|
+
}
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarDefaultComponent, decorators: [{
|
13
|
+
type: Component,
|
14
|
+
args: [{ selector: 'progress-bar-default', changeDetection: ChangeDetectionStrategy.OnPush, template: "<daff-progress-bar percentage=\"25\">\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>\n", styles: [":host{display:flex;flex-direction:column;gap:8px}\n"] }]
|
15
|
+
}] });
|
16
|
+
|
17
|
+
class ProgressBarDefaultComponentModule {
|
18
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarDefaultComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
19
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarDefaultComponentModule, declarations: [ProgressBarDefaultComponent], imports: [DaffProgressBarModule], exports: [ProgressBarDefaultComponent] }); }
|
20
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarDefaultComponentModule, imports: [DaffProgressBarModule] }); }
|
21
|
+
}
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarDefaultComponentModule, decorators: [{
|
23
|
+
type: NgModule,
|
24
|
+
args: [{
|
25
|
+
declarations: [
|
26
|
+
ProgressBarDefaultComponent,
|
27
|
+
],
|
28
|
+
exports: [
|
29
|
+
ProgressBarDefaultComponent,
|
30
|
+
],
|
31
|
+
imports: [
|
32
|
+
DaffProgressBarModule,
|
33
|
+
],
|
34
|
+
}]
|
35
|
+
}] });
|
36
|
+
|
37
|
+
class ProgressBarIndeterminateComponent {
|
38
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarIndeterminateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
39
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: ProgressBarIndeterminateComponent, selector: "progress-bar-indeterminate", ngImport: i0, template: "<daff-progress-bar indeterminate>\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>", styles: [":host{display:flex;flex-direction:column;gap:8px}\n"], dependencies: [{ kind: "component", type: i1.DaffProgressBarComponent, selector: "daff-progress-bar", inputs: ["color", "percentage", "indeterminate"], outputs: ["finished"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
40
|
+
}
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarIndeterminateComponent, decorators: [{
|
42
|
+
type: Component,
|
43
|
+
args: [{ selector: 'progress-bar-indeterminate', changeDetection: ChangeDetectionStrategy.OnPush, template: "<daff-progress-bar indeterminate>\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>", styles: [":host{display:flex;flex-direction:column;gap:8px}\n"] }]
|
44
|
+
}] });
|
45
|
+
|
46
|
+
class ProgressBarIndeterminateComponentModule {
|
47
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarIndeterminateComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
48
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarIndeterminateComponentModule, declarations: [ProgressBarIndeterminateComponent], imports: [DaffProgressBarModule], exports: [ProgressBarIndeterminateComponent] }); }
|
49
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarIndeterminateComponentModule, imports: [DaffProgressBarModule] }); }
|
50
|
+
}
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarIndeterminateComponentModule, decorators: [{
|
52
|
+
type: NgModule,
|
53
|
+
args: [{
|
54
|
+
declarations: [
|
55
|
+
ProgressBarIndeterminateComponent,
|
56
|
+
],
|
57
|
+
exports: [
|
58
|
+
ProgressBarIndeterminateComponent,
|
59
|
+
],
|
60
|
+
imports: [
|
61
|
+
DaffProgressBarModule,
|
62
|
+
],
|
63
|
+
}]
|
64
|
+
}] });
|
65
|
+
|
66
|
+
class ProgressBarThemesComponent {
|
67
|
+
constructor() {
|
68
|
+
this.color = 'primary';
|
69
|
+
this.colorControl = new FormControl('');
|
70
|
+
}
|
71
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarThemesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
72
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: ProgressBarThemesComponent, selector: "progress-bar-themes", ngImport: i0, template: "<daff-progress-bar percentage=\"25\" [color]=\"colorControl.value\">\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>\n\n<select [formControl]=\"colorControl\">\n\t<option value=\"\">Default</option>\n\t<option value=\"primary\">Primary</option>\n\t<option value=\"secondary\">Secondary</option>\n\t<option value=\"tertiary\">Tertiary</option>\n\t<option value=\"theme\">Theme</option>\n\t<option value=\"theme-contrast\">Theme Contrast</option>\n\t<option value=\"white\">White</option>\n\t<option value=\"black\">Black</option>\n</select>", styles: [":host{display:flex;flex-direction:column;align-items:flex-start;gap:16px}\n"], dependencies: [{ kind: "component", type: i1.DaffProgressBarComponent, selector: "daff-progress-bar", inputs: ["color", "percentage", "indeterminate"], outputs: ["finished"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
73
|
+
}
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarThemesComponent, decorators: [{
|
75
|
+
type: Component,
|
76
|
+
args: [{ selector: 'progress-bar-themes', changeDetection: ChangeDetectionStrategy.OnPush, template: "<daff-progress-bar percentage=\"25\" [color]=\"colorControl.value\">\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>\n\n<select [formControl]=\"colorControl\">\n\t<option value=\"\">Default</option>\n\t<option value=\"primary\">Primary</option>\n\t<option value=\"secondary\">Secondary</option>\n\t<option value=\"tertiary\">Tertiary</option>\n\t<option value=\"theme\">Theme</option>\n\t<option value=\"theme-contrast\">Theme Contrast</option>\n\t<option value=\"white\">White</option>\n\t<option value=\"black\">Black</option>\n</select>", styles: [":host{display:flex;flex-direction:column;align-items:flex-start;gap:16px}\n"] }]
|
77
|
+
}] });
|
78
|
+
|
79
|
+
class ProgressBarThemesComponentModule {
|
80
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarThemesComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
81
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarThemesComponentModule, declarations: [ProgressBarThemesComponent], imports: [DaffProgressBarModule,
|
82
|
+
ReactiveFormsModule], exports: [ProgressBarThemesComponent] }); }
|
83
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarThemesComponentModule, imports: [DaffProgressBarModule,
|
84
|
+
ReactiveFormsModule] }); }
|
85
|
+
}
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: ProgressBarThemesComponentModule, decorators: [{
|
87
|
+
type: NgModule,
|
88
|
+
args: [{
|
89
|
+
declarations: [
|
90
|
+
ProgressBarThemesComponent,
|
91
|
+
],
|
92
|
+
exports: [
|
93
|
+
ProgressBarThemesComponent,
|
94
|
+
],
|
95
|
+
imports: [
|
96
|
+
DaffProgressBarModule,
|
97
|
+
ReactiveFormsModule,
|
98
|
+
],
|
99
|
+
}]
|
100
|
+
}] });
|
101
|
+
|
102
|
+
const PROGRESS_BAR_EXAMPLES = [
|
103
|
+
{ component: ProgressBarThemesComponent, module: ProgressBarThemesComponentModule },
|
104
|
+
{ component: ProgressBarIndeterminateComponent, module: ProgressBarIndeterminateComponentModule },
|
105
|
+
{ component: ProgressBarDefaultComponent, module: ProgressBarDefaultComponentModule },
|
106
|
+
];
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Generated bundle index. Do not edit.
|
110
|
+
*/
|
111
|
+
|
112
|
+
export { PROGRESS_BAR_EXAMPLES };
|
113
|
+
//# sourceMappingURL=daffodil-design-progress-bar-examples.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"daffodil-design-progress-bar-examples.mjs","sources":["../../../libs/design/progress-bar/examples/src/progress-bar-default/progress-bar-default.component.ts","../../../libs/design/progress-bar/examples/src/progress-bar-default/progress-bar-default.component.html","../../../libs/design/progress-bar/examples/src/progress-bar-default/progress-bar-default.module.ts","../../../libs/design/progress-bar/examples/src/progress-bar-indeterminate/progress-bar-indeterminate.component.ts","../../../libs/design/progress-bar/examples/src/progress-bar-indeterminate/progress-bar-indeterminate.component.html","../../../libs/design/progress-bar/examples/src/progress-bar-indeterminate/progress-bar-indeterminate.module.ts","../../../libs/design/progress-bar/examples/src/progress-bar-themes/progress-bar-themes.component.ts","../../../libs/design/progress-bar/examples/src/progress-bar-themes/progress-bar-themes.component.html","../../../libs/design/progress-bar/examples/src/progress-bar-themes/progress-bar-themes.module.ts","../../../libs/design/progress-bar/examples/src/public_api.ts","../../../libs/design/progress-bar/examples/src/daffodil-design-progress-bar-examples.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'progress-bar-default',\n templateUrl: './progress-bar-default.component.html',\n styles: [`\n :host {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ProgressBarDefaultComponent {}\n","<daff-progress-bar percentage=\"25\">\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>\n","import { NgModule } from '@angular/core';\n\nimport { DaffProgressBarModule } from '@daffodil/design/progress-bar';\n\nimport { ProgressBarDefaultComponent } from './progress-bar-default.component';\n\n@NgModule({\n declarations: [\n ProgressBarDefaultComponent,\n ],\n exports: [\n ProgressBarDefaultComponent,\n ],\n imports: [\n DaffProgressBarModule,\n ],\n})\nexport class ProgressBarDefaultComponentModule { }\n","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'progress-bar-indeterminate',\n templateUrl: './progress-bar-indeterminate.component.html',\n styles: [`\n :host {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ProgressBarIndeterminateComponent {}\n","<daff-progress-bar indeterminate>\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>","import { NgModule } from '@angular/core';\n\nimport { DaffProgressBarModule } from '@daffodil/design/progress-bar';\n\nimport { ProgressBarIndeterminateComponent } from './progress-bar-indeterminate.component';\n\n@NgModule({\n declarations: [\n ProgressBarIndeterminateComponent,\n ],\n exports: [\n ProgressBarIndeterminateComponent,\n ],\n imports: [\n DaffProgressBarModule,\n ],\n})\nexport class ProgressBarIndeterminateComponentModule { }\n","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\n\nimport { DaffPalette } from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'progress-bar-themes',\n templateUrl: './progress-bar-themes.component.html',\n styles: [`\n :host {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 16px;\n }`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ProgressBarThemesComponent {\n color: DaffPalette = 'primary';\n\n colorControl: FormControl = new FormControl('');\n}\n","<daff-progress-bar percentage=\"25\" [color]=\"colorControl.value\">\n\t<label daffProgressBarLabel>Progress bar label</label>\n</daff-progress-bar>\n\n<select [formControl]=\"colorControl\">\n\t<option value=\"\">Default</option>\n\t<option value=\"primary\">Primary</option>\n\t<option value=\"secondary\">Secondary</option>\n\t<option value=\"tertiary\">Tertiary</option>\n\t<option value=\"theme\">Theme</option>\n\t<option value=\"theme-contrast\">Theme Contrast</option>\n\t<option value=\"white\">White</option>\n\t<option value=\"black\">Black</option>\n</select>","import { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { DaffProgressBarModule } from '@daffodil/design/progress-bar';\n\nimport { ProgressBarThemesComponent } from './progress-bar-themes.component';\n\n@NgModule({\n declarations: [\n ProgressBarThemesComponent,\n ],\n exports: [\n ProgressBarThemesComponent,\n ],\n imports: [\n DaffProgressBarModule,\n ReactiveFormsModule,\n ],\n})\nexport class ProgressBarThemesComponentModule { }\n","import { ComponentExample } from '@daffodil/design';\n\nimport { ProgressBarDefaultComponent } from './progress-bar-default/progress-bar-default.component';\nimport { ProgressBarDefaultComponentModule } from './progress-bar-default/progress-bar-default.module';\nimport { ProgressBarIndeterminateComponent } from './progress-bar-indeterminate/progress-bar-indeterminate.component';\nimport { ProgressBarIndeterminateComponentModule } from './progress-bar-indeterminate/progress-bar-indeterminate.module';\nimport { ProgressBarThemesComponent } from './progress-bar-themes/progress-bar-themes.component';\nimport { ProgressBarThemesComponentModule } from './progress-bar-themes/progress-bar-themes.module';\n\nexport const PROGRESS_BAR_EXAMPLES: ComponentExample[] = [\n { component: ProgressBarThemesComponent, module: ProgressBarThemesComponentModule },\n { component: ProgressBarIndeterminateComponent, module: ProgressBarIndeterminateComponentModule },\n { component: ProgressBarDefaultComponent, module: ProgressBarDefaultComponentModule },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAiBa,2BAA2B,CAAA;iIAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA3B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,2BAA2B,4DCjBxC,yHAGA,EAAA,MAAA,EAAA,CAAA,qDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,YAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FDca,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,SAAS;+BA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qBAAqB;YACrB,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGV,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAZ5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,0BAA0B;AAC3B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,0BAA0B;AAC3B,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,qBAAqB;wBACrB,mBAAmB;AACpB,qBAAA;AACF,iBAAA,CAAA;;;ACTY,MAAA,qBAAqB,GAAuB;AACvD,IAAA,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,EAAE,gCAAgC,EAAE;AACnF,IAAA,EAAE,SAAS,EAAE,iCAAiC,EAAE,MAAM,EAAE,uCAAuC,EAAE;AACjG,IAAA,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,EAAE,iCAAiC,EAAE;;;ACZvF;;AAEG;;;;"}
|
@@ -0,0 +1,178 @@
|
|
1
|
+
import * as i1 from '@angular/common';
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, HostBinding, Input, Output, NgModule } from '@angular/core';
|
5
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
6
|
+
import { daffColorMixin } from '@daffodil/design';
|
7
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
8
|
+
|
9
|
+
const daffProgressBarAnimation = {
|
10
|
+
fill: trigger('fill', [
|
11
|
+
state('*', style({ transform: 'scaleX(calc({{ percentage }}/100))' }), { params: { percentage: 0 } }),
|
12
|
+
transition('void <=> *', animate(0)),
|
13
|
+
transition('* <=> *', animate(1000)),
|
14
|
+
]),
|
15
|
+
};
|
16
|
+
|
17
|
+
/**
|
18
|
+
* An _elementRef and an instance of renderer2 are needed for the Colorable mixin
|
19
|
+
*/
|
20
|
+
class DaffProgressBarBase {
|
21
|
+
constructor(_elementRef, _renderer) {
|
22
|
+
this._elementRef = _elementRef;
|
23
|
+
this._renderer = _renderer;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
const _daffProgressBarBase = daffColorMixin(DaffProgressBarBase, 'primary');
|
27
|
+
const clamp = (number, min, max) => Math.min(Math.max(number, min), max);
|
28
|
+
/**
|
29
|
+
* @inheritdoc
|
30
|
+
*/
|
31
|
+
class DaffProgressBarComponent extends _daffProgressBarBase {
|
32
|
+
/**
|
33
|
+
* @docs-private
|
34
|
+
*/
|
35
|
+
get indeterminateClass() {
|
36
|
+
return this._indeterminate;
|
37
|
+
}
|
38
|
+
get role() {
|
39
|
+
return 'progressbar';
|
40
|
+
}
|
41
|
+
get ariaLabel() {
|
42
|
+
return this._indeterminate ? 'loading' : null;
|
43
|
+
}
|
44
|
+
get ariaValueNow() {
|
45
|
+
return this.percentage;
|
46
|
+
}
|
47
|
+
constructor(_changeDetectorRef, elementRef, renderer) {
|
48
|
+
super(elementRef, renderer);
|
49
|
+
this._changeDetectorRef = _changeDetectorRef;
|
50
|
+
this.elementRef = elementRef;
|
51
|
+
this.renderer = renderer;
|
52
|
+
/**
|
53
|
+
* @docs-private
|
54
|
+
*/
|
55
|
+
this.class = true;
|
56
|
+
this.ariaValueMin = '0';
|
57
|
+
this.ariaValueMax = '100';
|
58
|
+
this._percentage = 0;
|
59
|
+
this._indeterminate = false;
|
60
|
+
/**
|
61
|
+
* An event that emits each time the progression reaches 100%
|
62
|
+
* and the animation is finished
|
63
|
+
*/
|
64
|
+
this.finished = new EventEmitter();
|
65
|
+
}
|
66
|
+
/**
|
67
|
+
* Sets the percentage completion of the progression,
|
68
|
+
* expressed as a whole number between 0 and 100.
|
69
|
+
*
|
70
|
+
*/
|
71
|
+
get percentage() {
|
72
|
+
return this._percentage;
|
73
|
+
}
|
74
|
+
;
|
75
|
+
set percentage(val) {
|
76
|
+
this._percentage = clamp(val, 0, 100);
|
77
|
+
this._changeDetectorRef.markForCheck();
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* Property to set the animation of a progress bar to
|
81
|
+
* run for an indefinite amount of time.
|
82
|
+
*
|
83
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
|
84
|
+
**/
|
85
|
+
get indeterminate() {
|
86
|
+
return this._indeterminate;
|
87
|
+
}
|
88
|
+
set indeterminate(value) {
|
89
|
+
this._indeterminate = coerceBooleanProperty(value);
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* Calculates when the progress animation is fully completed
|
93
|
+
*
|
94
|
+
* @param event: AnimationEvent
|
95
|
+
*/
|
96
|
+
onAnimationComplete(event) {
|
97
|
+
// @ts-expect-error: @angular/animations typing error on event.toState as string
|
98
|
+
// See: https://github.com/angular/angular/issues/26507
|
99
|
+
if (event.toState === '100' || event.toState === 100) {
|
100
|
+
this.finished.emit();
|
101
|
+
}
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* @docs-private
|
105
|
+
*/
|
106
|
+
get fillState() {
|
107
|
+
return {
|
108
|
+
value: this.percentage,
|
109
|
+
params: {
|
110
|
+
percentage: this.percentage,
|
111
|
+
},
|
112
|
+
};
|
113
|
+
}
|
114
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffProgressBarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
115
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: DaffProgressBarComponent, selector: "daff-progress-bar", inputs: { color: "color", percentage: "percentage", indeterminate: "indeterminate" }, outputs: { finished: "finished" }, host: { properties: { "class.daff-progress-bar": "this.class", "class.indeterminate": "this.indeterminateClass", "role": "this.role", "attr.aria-label": "this.ariaLabel", "attr.aria-valuemin": "this.ariaValueMin", "attr.aria-valuemax": "this.ariaValueMax", "attr.aria-valuenow": "this.ariaValueNow" } }, usesInheritance: true, ngImport: i0, template: "<ng-content select=\"label[daffProgressBarLabel]\"></ng-content>\n<div class=\"daff-progress-bar__track\">\n\t<div *ngIf=\"!indeterminate\" class=\"daff-progress-bar__fill\" [@fill]=\"fillState\" (@fill.done)=\"onAnimationComplete($event)\"></div>\n\t<div *ngIf=\"indeterminate\" class=\"daff-progress-bar__fill indeterminate-bar\"></div>\n</div>", styles: [":host(.daff-progress-bar){display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}:host(.daff-progress-bar) ::ng-deep .daff-progress-bar__label{font-size:.875rem;line-height:1rem}:host(.daff-progress-bar) .daff-progress-bar__track{height:4px;position:relative;width:100%}:host(.daff-progress-bar) .daff-progress-bar__fill{height:4px;width:100%;transform:scaleX(0);transform-origin:0 center}:host(.daff-progress-bar).indeterminate{overflow:hidden}:host(.daff-progress-bar).indeterminate .indeterminate-bar{height:100%;width:100%;animation:indeterminate-animation 1.5s infinite linear;transform-origin:0% 50%}@keyframes indeterminate-animation{0%{transform:translate(0) scaleX(0)}20%{transform:translate(0) scaleX(25%)}to{transform:translate(100%) scaleX(25%)}}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
116
|
+
daffProgressBarAnimation.fill,
|
117
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
118
|
+
}
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffProgressBarComponent, decorators: [{
|
120
|
+
type: Component,
|
121
|
+
args: [{ selector: 'daff-progress-bar', changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['color'], animations: [
|
122
|
+
daffProgressBarAnimation.fill,
|
123
|
+
], template: "<ng-content select=\"label[daffProgressBarLabel]\"></ng-content>\n<div class=\"daff-progress-bar__track\">\n\t<div *ngIf=\"!indeterminate\" class=\"daff-progress-bar__fill\" [@fill]=\"fillState\" (@fill.done)=\"onAnimationComplete($event)\"></div>\n\t<div *ngIf=\"indeterminate\" class=\"daff-progress-bar__fill indeterminate-bar\"></div>\n</div>", styles: [":host(.daff-progress-bar){display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}:host(.daff-progress-bar) ::ng-deep .daff-progress-bar__label{font-size:.875rem;line-height:1rem}:host(.daff-progress-bar) .daff-progress-bar__track{height:4px;position:relative;width:100%}:host(.daff-progress-bar) .daff-progress-bar__fill{height:4px;width:100%;transform:scaleX(0);transform-origin:0 center}:host(.daff-progress-bar).indeterminate{overflow:hidden}:host(.daff-progress-bar).indeterminate .indeterminate-bar{height:100%;width:100%;animation:indeterminate-animation 1.5s infinite linear;transform-origin:0% 50%}@keyframes indeterminate-animation{0%{transform:translate(0) scaleX(0)}20%{transform:translate(0) scaleX(25%)}to{transform:translate(100%) scaleX(25%)}}\n"] }]
|
124
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { class: [{
|
125
|
+
type: HostBinding,
|
126
|
+
args: ['class.daff-progress-bar']
|
127
|
+
}], indeterminateClass: [{
|
128
|
+
type: HostBinding,
|
129
|
+
args: ['class.indeterminate']
|
130
|
+
}], role: [{
|
131
|
+
type: HostBinding,
|
132
|
+
args: ['role']
|
133
|
+
}], ariaLabel: [{
|
134
|
+
type: HostBinding,
|
135
|
+
args: ['attr.aria-label']
|
136
|
+
}], ariaValueMin: [{
|
137
|
+
type: HostBinding,
|
138
|
+
args: ['attr.aria-valuemin']
|
139
|
+
}], ariaValueMax: [{
|
140
|
+
type: HostBinding,
|
141
|
+
args: ['attr.aria-valuemax']
|
142
|
+
}], ariaValueNow: [{
|
143
|
+
type: HostBinding,
|
144
|
+
args: ['attr.aria-valuenow']
|
145
|
+
}], percentage: [{
|
146
|
+
type: Input
|
147
|
+
}], indeterminate: [{
|
148
|
+
type: Input
|
149
|
+
}], finished: [{
|
150
|
+
type: Output
|
151
|
+
}] } });
|
152
|
+
|
153
|
+
class DaffProgressBarModule {
|
154
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
155
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.1", ngImport: i0, type: DaffProgressBarModule, declarations: [DaffProgressBarComponent], imports: [CommonModule], exports: [DaffProgressBarComponent] }); }
|
156
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffProgressBarModule, imports: [CommonModule] }); }
|
157
|
+
}
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffProgressBarModule, decorators: [{
|
159
|
+
type: NgModule,
|
160
|
+
args: [{
|
161
|
+
imports: [
|
162
|
+
CommonModule,
|
163
|
+
],
|
164
|
+
declarations: [
|
165
|
+
DaffProgressBarComponent,
|
166
|
+
],
|
167
|
+
exports: [
|
168
|
+
DaffProgressBarComponent,
|
169
|
+
],
|
170
|
+
}]
|
171
|
+
}] });
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Generated bundle index. Do not edit.
|
175
|
+
*/
|
176
|
+
|
177
|
+
export { DaffProgressBarComponent, DaffProgressBarModule, clamp };
|
178
|
+
//# sourceMappingURL=daffodil-design-progress-bar.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"daffodil-design-progress-bar.mjs","sources":["../../../libs/design/progress-bar/src/animation/progress-bar-animation.ts","../../../libs/design/progress-bar/src/progress-bar.component.ts","../../../libs/design/progress-bar/src/progress-bar.component.html","../../../libs/design/progress-bar/src/progress-bar.module.ts","../../../libs/design/progress-bar/src/daffodil-design-progress-bar.ts"],"sourcesContent":["import {\n animate,\n state,\n style,\n transition,\n trigger,\n AnimationTriggerMetadata,\n} from '@angular/animations';\n\nexport const daffProgressBarAnimation: {\n readonly fill: AnimationTriggerMetadata;\n} = {\n fill: trigger('fill', [\n state('*', style({ transform: 'scaleX(calc({{ percentage }}/100))' }), { params: { percentage: 0 }}),\n transition('void <=> *', animate(0)),\n transition('* <=> *', animate(1000)),\n ]),\n};\n","import { AnimationEvent } from '@angular/animations';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n Input,\n ChangeDetectionStrategy,\n ElementRef,\n Output,\n EventEmitter,\n Renderer2,\n HostBinding,\n ChangeDetectorRef,\n} from '@angular/core';\n\nimport {\n daffColorMixin,\n DaffColorable,\n} from '@daffodil/design';\n\nimport { daffProgressBarAnimation } from './animation/progress-bar-animation';\n\n/**\n * An _elementRef and an instance of renderer2 are needed for the Colorable mixin\n */\nclass DaffProgressBarBase{\n constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {}\n}\n\nconst _daffProgressBarBase = daffColorMixin(DaffProgressBarBase, 'primary');\n\nexport const clamp = (number: number, min: number, max: number) => Math.min(Math.max(number, min), max);\n\n/**\n * @inheritdoc\n */\n@Component({\n selector: 'daff-progress-bar',\n templateUrl: './progress-bar.component.html',\n styleUrls: ['./progress-bar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n //todo(damienwebdev): remove once decorators hit stage 3 - https://github.com/microsoft/TypeScript/issues/7342\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: ['color'],\n animations: [\n daffProgressBarAnimation.fill,\n ],\n})\nexport class DaffProgressBarComponent extends _daffProgressBarBase implements DaffColorable {\n\n /**\n * @docs-private\n */\n @HostBinding('class.daff-progress-bar') class = true;\n\n /**\n * @docs-private\n */\n @HostBinding('class.indeterminate') get indeterminateClass() {\n return this._indeterminate;\n }\n\n @HostBinding('role') get role() {\n return 'progressbar';\n }\n\n @HostBinding('attr.aria-label') get ariaLabel() {\n return this._indeterminate ? 'loading' : null;\n }\n\n @HostBinding('attr.aria-valuemin') ariaValueMin = '0';\n @HostBinding('attr.aria-valuemax') ariaValueMax = '100';\n @HostBinding('attr.aria-valuenow') get ariaValueNow() {\n return this.percentage;\n }\n\n constructor(\n private _changeDetectorRef: ChangeDetectorRef,\n private elementRef: ElementRef,\n private renderer: Renderer2,\n ) {\n super(elementRef, renderer);\n }\n\n private _percentage = 0;\n private _indeterminate = false;\n\n /**\n * Sets the percentage completion of the progression,\n * expressed as a whole number between 0 and 100.\n *\n */\n @Input() get percentage(): number {\n return this._percentage;\n };\n set percentage(val: number) {\n this._percentage = clamp(val, 0, 100);\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Property to set the animation of a progress bar to\n * run for an indefinite amount of time.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress\n **/\n @Input() get indeterminate() {\n return this._indeterminate;\n }\n set indeterminate(value: any) {\n\t this._indeterminate = coerceBooleanProperty(value);\n }\n\n /**\n * An event that emits each time the progression reaches 100%\n * and the animation is finished\n */\n @Output() finished: EventEmitter<void> = new EventEmitter();\n\n /**\n * Calculates when the progress animation is fully completed\n *\n * @param event: AnimationEvent\n */\n onAnimationComplete(event: AnimationEvent): void {\n // @ts-expect-error: @angular/animations typing error on event.toState as string\n // See: https://github.com/angular/angular/issues/26507\n if(event.toState === '100' || event.toState === 100) {\n this.finished.emit();\n }\n }\n\n /**\n * @docs-private\n */\n get fillState(): any {\n return {\n value: this.percentage,\n params: {\n percentage: this.percentage,\n },\n };\n }\n}\n","<ng-content select=\"label[daffProgressBarLabel]\"></ng-content>\n<div class=\"daff-progress-bar__track\">\n\t<div *ngIf=\"!indeterminate\" class=\"daff-progress-bar__fill\" [@fill]=\"fillState\" (@fill.done)=\"onAnimationComplete($event)\"></div>\n\t<div *ngIf=\"indeterminate\" class=\"daff-progress-bar__fill indeterminate-bar\"></div>\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffProgressBarComponent } from './progress-bar.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n declarations: [\n DaffProgressBarComponent,\n ],\n exports: [\n DaffProgressBarComponent,\n ],\n})\nexport class DaffProgressBarModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AASO,MAAM,wBAAwB,GAEjC;AACF,IAAA,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE;QACpB,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,oCAAoC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,EAAC,CAAC;AACpG,QAAA,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACpC,QAAA,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;KACrC,CAAC;CACH;;ACID;;AAEG;AACH,MAAM,mBAAmB,CAAA;IACvB,WAAmB,CAAA,WAAuB,EAAS,SAAoB,EAAA;QAApD,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;QAAS,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;KAAI;AAC5E,CAAA;AAED,MAAM,oBAAoB,GAAG,cAAc,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAErE,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE;AAExG;;AAEG;AAaG,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAOhE;;AAEG;AACH,IAAA,IAAwC,kBAAkB,GAAA;QACxD,OAAO,IAAI,CAAC,cAAc,CAAC;KAC5B;AAED,IAAA,IAAyB,IAAI,GAAA;AAC3B,QAAA,OAAO,aAAa,CAAC;KACtB;AAED,IAAA,IAAoC,SAAS,GAAA;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