@molecule/app-progress-bar-angular 0.0.0-stage → 0.0.1-stage
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/LICENSE +202 -0
- package/README.md +566 -2
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/progress-bar.component.d.ts +147 -0
- package/dist/progress-bar.component.d.ts.map +1 -0
- package/dist/progress-bar.component.js +304 -0
- package/dist/progress-bar.component.js.map +1 -0
- package/dist/progress-card.component.d.ts +145 -0
- package/dist/progress-card.component.d.ts.map +1 -0
- package/dist/progress-card.component.js +324 -0
- package/dist/progress-card.component.js.map +1 -0
- package/dist/types.d.ts +56 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -4
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { Component, signal, ViewChild } from '@angular/core';
|
|
2
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
3
|
+
import { ProgressBar } from './progress-bar.component.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
const _c0 = ["descriptionEl"];
|
|
6
|
+
const _c1 = ["valueLabelEl"];
|
|
7
|
+
const _c2 = [[["", "slot", "icon"]], [["", "slot", "title"]], "*", [["", "slot", "description"]], [["", "slot", "valuelabel"]]];
|
|
8
|
+
const _c3 = ["[slot=icon]", "[slot=title]", "*", "[slot=description]", "[slot=valueLabel]"];
|
|
9
|
+
function ProgressCard_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
10
|
+
i0.ɵɵtext(0);
|
|
11
|
+
} if (rf & 2) {
|
|
12
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
13
|
+
i0.ɵɵtextInterpolate(ctx_r0.icon);
|
|
14
|
+
} }
|
|
15
|
+
function ProgressCard_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵtext(0);
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
19
|
+
i0.ɵɵtextInterpolate(ctx_r0.title);
|
|
20
|
+
} }
|
|
21
|
+
function ProgressCard_Conditional_9_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵtext(0);
|
|
23
|
+
} if (rf & 2) {
|
|
24
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
25
|
+
i0.ɵɵtextInterpolate(ctx_r0.description);
|
|
26
|
+
} }
|
|
27
|
+
function ProgressCard_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelementStart(0, "p", null, 0);
|
|
29
|
+
i0.ɵɵconditionalCreate(2, ProgressCard_Conditional_9_Conditional_2_Template, 1, 1);
|
|
30
|
+
i0.ɵɵprojection(3, 3);
|
|
31
|
+
i0.ɵɵelementEnd();
|
|
32
|
+
} if (rf & 2) {
|
|
33
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
34
|
+
i0.ɵɵclassMap(ctx_r0.descriptionClasses());
|
|
35
|
+
i0.ɵɵadvance(2);
|
|
36
|
+
i0.ɵɵconditional(ctx_r0.hasDescription ? 2 : -1);
|
|
37
|
+
} }
|
|
38
|
+
function ProgressCard_Conditional_10_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
39
|
+
i0.ɵɵtext(0);
|
|
40
|
+
} if (rf & 2) {
|
|
41
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
42
|
+
i0.ɵɵtextInterpolate(ctx_r0.valueLabel);
|
|
43
|
+
} }
|
|
44
|
+
function ProgressCard_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
45
|
+
i0.ɵɵelementStart(0, "span", null, 1);
|
|
46
|
+
i0.ɵɵconditionalCreate(2, ProgressCard_Conditional_10_Conditional_2_Template, 1, 1);
|
|
47
|
+
i0.ɵɵprojection(3, 4);
|
|
48
|
+
i0.ɵɵelementEnd();
|
|
49
|
+
} if (rf & 2) {
|
|
50
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
51
|
+
i0.ɵɵclassMap(ctx_r0.valueLabelClasses());
|
|
52
|
+
i0.ɵɵadvance(2);
|
|
53
|
+
i0.ɵɵconditional(ctx_r0.hasValueLabel ? 2 : -1);
|
|
54
|
+
} }
|
|
55
|
+
/**
|
|
56
|
+
* Whether a node is something a caller can see (an element, or a non-blank
|
|
57
|
+
* text node).
|
|
58
|
+
*
|
|
59
|
+
* @param node - The DOM node.
|
|
60
|
+
* @returns True when it renders anything.
|
|
61
|
+
*/
|
|
62
|
+
const hasRenderable = (node) => node.nodeType === Node.ELEMENT_NODE ||
|
|
63
|
+
(node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim().length > 0);
|
|
64
|
+
/**
|
|
65
|
+
* Whether a projected region landed: the region's own children after the
|
|
66
|
+
* text the component interpolated itself (React would not render the region
|
|
67
|
+
* at all without one).
|
|
68
|
+
*
|
|
69
|
+
* @param el - The element.
|
|
70
|
+
* @param ownText - Whether the element's first child is the component's own interpolated text.
|
|
71
|
+
* @returns True when the caller projected content into it.
|
|
72
|
+
*/
|
|
73
|
+
const hasProjection = (el, ownText) => Array.from(el.childNodes)
|
|
74
|
+
.slice(ownText ? 1 : 0)
|
|
75
|
+
.some(hasRenderable);
|
|
76
|
+
/**
|
|
77
|
+
* ProgressCard component.
|
|
78
|
+
*
|
|
79
|
+
* `<Card>`-wrapped progress display with title, optional icon and description,
|
|
80
|
+
* the progress bar itself, and an optional extras slot below. The host IS the
|
|
81
|
+
* Card `div` (`div[mol-progress-card]`), matching React's root exactly — same
|
|
82
|
+
* classes. Node props (`title`, `description`, `icon`, `valueLabel`,
|
|
83
|
+
* `children`) are projected content (`[slot=<name>]`, or the default
|
|
84
|
+
* projection) or plain string inputs.
|
|
85
|
+
*
|
|
86
|
+
* This is the Angular counterpart of `@molecule/app-progress-bar-react`: the
|
|
87
|
+
* same props (React names), the same ClassMap tokens, and the same DOM for the
|
|
88
|
+
* same input.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* Angular projection needs the `<ng-content>` capture points mounted, so the
|
|
92
|
+
* optional description and value-label regions render optimistically and
|
|
93
|
+
* {@link ProgressCard.ngAfterViewInit} withdraws the ones nothing was
|
|
94
|
+
* projected into (React would not render them at all).
|
|
95
|
+
*/
|
|
96
|
+
export class ProgressCard {
|
|
97
|
+
/** Card title — a string input, or `[slot=title]` projected content. */
|
|
98
|
+
title;
|
|
99
|
+
/** Optional supporting description below the title — a string input, or `[slot=description]` content. */
|
|
100
|
+
description;
|
|
101
|
+
/** Optional icon shown in the card header — `[slot=icon]` projected content (or a string input). */
|
|
102
|
+
icon;
|
|
103
|
+
/** Current value. */
|
|
104
|
+
value;
|
|
105
|
+
/** Maximum (defaults to `100` at read time). */
|
|
106
|
+
max;
|
|
107
|
+
/** Value display on the right of the header — a string input, or `[slot=valueLabel]` content. */
|
|
108
|
+
valueLabel;
|
|
109
|
+
/** ProgressBar color (defaults to `'primary'`). */
|
|
110
|
+
color;
|
|
111
|
+
/** Extra classes on the Card wrapper. */
|
|
112
|
+
className;
|
|
113
|
+
/** The optional description paragraph (projected content lands here; read once). */
|
|
114
|
+
descriptionEl;
|
|
115
|
+
/** The optional value-label span (projected content lands here; read once). */
|
|
116
|
+
valueLabelEl;
|
|
117
|
+
/** Whether a `[slot=description]` projection landed (true until the first view proves otherwise). */
|
|
118
|
+
descriptionProjected = signal(true, /* @ts-ignore */
|
|
119
|
+
...(ngDevMode ? [{ debugName: "descriptionProjected" }] : /* istanbul ignore next */ []));
|
|
120
|
+
/** Whether a `[slot=valueLabel]` projection landed (true until the first view proves otherwise). */
|
|
121
|
+
valueLabelProjected = signal(true, /* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "valueLabelProjected" }] : /* istanbul ignore next */ []));
|
|
123
|
+
/**
|
|
124
|
+
* Reads the optional regions' first render: when neither a text input nor
|
|
125
|
+
* projected content landed, React would not render the region at all, so the
|
|
126
|
+
* optimistic render is withdrawn.
|
|
127
|
+
*/
|
|
128
|
+
ngAfterViewInit() {
|
|
129
|
+
const description = this.descriptionEl?.nativeElement;
|
|
130
|
+
if (description)
|
|
131
|
+
this.descriptionProjected.set(hasProjection(description, this.hasDescription));
|
|
132
|
+
const valueLabel = this.valueLabelEl?.nativeElement;
|
|
133
|
+
if (valueLabel)
|
|
134
|
+
this.valueLabelProjected.set(hasProjection(valueLabel, this.hasValueLabel));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The current class map.
|
|
138
|
+
* @returns The UIClassMap.
|
|
139
|
+
*/
|
|
140
|
+
cm() {
|
|
141
|
+
return getClassMap();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Whether a text icon input renders (a projected icon is not).
|
|
145
|
+
* @returns True when the icon renders as text.
|
|
146
|
+
*/
|
|
147
|
+
get hasIcon() {
|
|
148
|
+
return this.icon !== undefined && this.icon !== null && this.icon !== false && this.icon !== '';
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Whether a text title input renders (a projected title is not).
|
|
152
|
+
* @returns True when the title renders as text.
|
|
153
|
+
*/
|
|
154
|
+
get hasTitle() {
|
|
155
|
+
return this.title !== undefined && this.title !== null;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether a text description input is present (React's `description && …`).
|
|
159
|
+
* @returns True when the description renders as text.
|
|
160
|
+
*/
|
|
161
|
+
get hasDescription() {
|
|
162
|
+
return (this.description !== undefined &&
|
|
163
|
+
this.description !== null &&
|
|
164
|
+
this.description !== false &&
|
|
165
|
+
this.description !== '');
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Whether a text value-label input is present (React's `valueLabel && …`).
|
|
169
|
+
* @returns True when the value label renders as text.
|
|
170
|
+
*/
|
|
171
|
+
get hasValueLabel() {
|
|
172
|
+
return (this.valueLabel !== undefined &&
|
|
173
|
+
this.valueLabel !== null &&
|
|
174
|
+
this.valueLabel !== false &&
|
|
175
|
+
this.valueLabel !== '');
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Whether the description paragraph renders.
|
|
179
|
+
* @returns True when the description shows.
|
|
180
|
+
*/
|
|
181
|
+
get showDescription() {
|
|
182
|
+
return this.hasDescription || this.descriptionProjected();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Whether the value-label span renders.
|
|
186
|
+
* @returns True when the value label shows.
|
|
187
|
+
*/
|
|
188
|
+
get showValueLabel() {
|
|
189
|
+
return this.hasValueLabel || this.valueLabelProjected();
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The maximum (React's default parameter: a later-bound write of `undefined`
|
|
193
|
+
* must not erase the `100` default).
|
|
194
|
+
* @returns The maximum.
|
|
195
|
+
*/
|
|
196
|
+
maxValue() {
|
|
197
|
+
return this.max ?? 100;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The color variant (React's `color = 'primary'`).
|
|
201
|
+
* @returns The color.
|
|
202
|
+
*/
|
|
203
|
+
colorValue() {
|
|
204
|
+
return this.color ?? 'primary';
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The host's class list (React's `<Card className>` classes).
|
|
208
|
+
* @returns The class string.
|
|
209
|
+
*/
|
|
210
|
+
classes() {
|
|
211
|
+
const cm = this.cm();
|
|
212
|
+
return cm.cn(cm.card({ variant: 'elevated' }), cm.cardPadding('md'), this.className);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The stack wrapper's class list (React's `cm.stack(3)`).
|
|
216
|
+
* @returns The class string.
|
|
217
|
+
*/
|
|
218
|
+
stackClasses() {
|
|
219
|
+
return this.cm().stack(3);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The header row's class list (React's `cm.flex({ justify: 'between', align: 'start', gap: 'sm' })`).
|
|
223
|
+
* @returns The class string.
|
|
224
|
+
*/
|
|
225
|
+
headerClasses() {
|
|
226
|
+
return this.cm().flex({ justify: 'between', align: 'start', gap: 'sm' });
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The left group's class list (React's `cm.flex({ align: 'center', gap: 'sm' })`).
|
|
230
|
+
* @returns The class string.
|
|
231
|
+
*/
|
|
232
|
+
leftClasses() {
|
|
233
|
+
return this.cm().flex({ align: 'center', gap: 'sm' });
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The title heading's class list (React's `cm.cn(cm.textSize('base'), cm.fontWeight('semibold'))`).
|
|
237
|
+
* @returns The class string.
|
|
238
|
+
*/
|
|
239
|
+
titleClasses() {
|
|
240
|
+
const cm = this.cm();
|
|
241
|
+
return cm.cn(cm.textSize('base'), cm.fontWeight('semibold'));
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The description paragraph's class list (React's `cm.textSize('sm')`).
|
|
245
|
+
* @returns The class string.
|
|
246
|
+
*/
|
|
247
|
+
descriptionClasses() {
|
|
248
|
+
return this.cm().textSize('sm');
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The value-label span's class list (React's `cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'))`).
|
|
252
|
+
* @returns The class string.
|
|
253
|
+
*/
|
|
254
|
+
valueLabelClasses() {
|
|
255
|
+
const cm = this.cm();
|
|
256
|
+
return cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'));
|
|
257
|
+
}
|
|
258
|
+
static ɵfac = function ProgressCard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ProgressCard)(); };
|
|
259
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ProgressCard, selectors: [["div", "mol-progress-card", ""]], viewQuery: function ProgressCard_Query(rf, ctx) { if (rf & 1) {
|
|
260
|
+
i0.ɵɵviewQuery(_c0, 5)(_c1, 5);
|
|
261
|
+
} if (rf & 2) {
|
|
262
|
+
let _t;
|
|
263
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.descriptionEl = _t.first);
|
|
264
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.valueLabelEl = _t.first);
|
|
265
|
+
} }, hostVars: 2, hostBindings: function ProgressCard_HostBindings(rf, ctx) { if (rf & 2) {
|
|
266
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
267
|
+
} }, inputs: { title: "title", description: "description", icon: "icon", value: "value", max: "max", valueLabel: "valueLabel", color: "color", className: "className" }, ngContentSelectors: _c3, decls: 13, vars: 15, consts: [["descriptionEl", ""], ["valueLabelEl", ""], [3, "class"], ["mol-progress-bar", "", 3, "value", "max", "color"]], template: function ProgressCard_Template(rf, ctx) { if (rf & 1) {
|
|
268
|
+
i0.ɵɵprojectionDef(_c2);
|
|
269
|
+
i0.ɵɵelementStart(0, "div")(1, "div")(2, "div");
|
|
270
|
+
i0.ɵɵconditionalCreate(3, ProgressCard_Conditional_3_Template, 1, 1);
|
|
271
|
+
i0.ɵɵprojection(4);
|
|
272
|
+
i0.ɵɵelementStart(5, "div")(6, "h3");
|
|
273
|
+
i0.ɵɵconditionalCreate(7, ProgressCard_Conditional_7_Template, 1, 1);
|
|
274
|
+
i0.ɵɵprojection(8, 1);
|
|
275
|
+
i0.ɵɵelementEnd();
|
|
276
|
+
i0.ɵɵconditionalCreate(9, ProgressCard_Conditional_9_Template, 4, 3, "p", 2);
|
|
277
|
+
i0.ɵɵelementEnd()();
|
|
278
|
+
i0.ɵɵconditionalCreate(10, ProgressCard_Conditional_10_Template, 4, 3, "span", 2);
|
|
279
|
+
i0.ɵɵelementEnd();
|
|
280
|
+
i0.ɵɵelement(11, "div", 3);
|
|
281
|
+
i0.ɵɵprojection(12, 2);
|
|
282
|
+
i0.ɵɵelementEnd();
|
|
283
|
+
} if (rf & 2) {
|
|
284
|
+
i0.ɵɵclassMap(ctx.stackClasses());
|
|
285
|
+
i0.ɵɵadvance();
|
|
286
|
+
i0.ɵɵclassMap(ctx.headerClasses());
|
|
287
|
+
i0.ɵɵadvance();
|
|
288
|
+
i0.ɵɵclassMap(ctx.leftClasses());
|
|
289
|
+
i0.ɵɵadvance();
|
|
290
|
+
i0.ɵɵconditional(ctx.hasIcon ? 3 : -1);
|
|
291
|
+
i0.ɵɵadvance(3);
|
|
292
|
+
i0.ɵɵclassMap(ctx.titleClasses());
|
|
293
|
+
i0.ɵɵadvance();
|
|
294
|
+
i0.ɵɵconditional(ctx.hasTitle ? 7 : -1);
|
|
295
|
+
i0.ɵɵadvance(2);
|
|
296
|
+
i0.ɵɵconditional(ctx.showDescription ? 9 : -1);
|
|
297
|
+
i0.ɵɵadvance();
|
|
298
|
+
i0.ɵɵconditional(ctx.showValueLabel ? 10 : -1);
|
|
299
|
+
i0.ɵɵadvance();
|
|
300
|
+
i0.ɵɵproperty("value", ctx.value)("max", ctx.maxValue())("color", ctx.colorValue());
|
|
301
|
+
} }, dependencies: [ProgressBar], encapsulation: 2 });
|
|
302
|
+
}
|
|
303
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ProgressCard, [{
|
|
304
|
+
type: Component,
|
|
305
|
+
args: [{
|
|
306
|
+
selector: 'div[mol-progress-card]',
|
|
307
|
+
standalone: true,
|
|
308
|
+
imports: [ProgressBar],
|
|
309
|
+
inputs: ['title', 'description', 'icon', 'value', 'max', 'valueLabel', 'color', 'className'],
|
|
310
|
+
host: {
|
|
311
|
+
'[class]': 'classes()',
|
|
312
|
+
},
|
|
313
|
+
// prettier-ignore
|
|
314
|
+
template: `<div [class]="stackClasses()"><div [class]="headerClasses()"><div [class]="leftClasses()">@if (hasIcon) {{{ icon }}}<ng-content select="[slot=icon]"></ng-content><div><h3 [class]="titleClasses()">@if (hasTitle) {{{ title }}}<ng-content select="[slot=title]"></ng-content></h3>@if (showDescription) {<p #descriptionEl [class]="descriptionClasses()">@if (hasDescription) {{{ description }}}<ng-content select="[slot=description]"></ng-content></p>}</div></div>@if (showValueLabel) {<span #valueLabelEl [class]="valueLabelClasses()">@if (hasValueLabel) {{{ valueLabel }}}<ng-content select="[slot=valueLabel]"></ng-content></span>}</div><div mol-progress-bar [value]="value" [max]="maxValue()" [color]="colorValue()"></div><ng-content></ng-content></div>`,
|
|
315
|
+
}]
|
|
316
|
+
}], null, { descriptionEl: [{
|
|
317
|
+
type: ViewChild,
|
|
318
|
+
args: ['descriptionEl']
|
|
319
|
+
}], valueLabelEl: [{
|
|
320
|
+
type: ViewChild,
|
|
321
|
+
args: ['valueLabelEl']
|
|
322
|
+
}] }); })();
|
|
323
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ProgressCard, { className: "ProgressCard", filePath: "progress-card.component.ts", lineNumber: 72 }); })();
|
|
324
|
+
//# sourceMappingURL=progress-card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-card.component.js","sourceRoot":"","sources":["../src/progress-card.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;;;;;;;IAyD6D,YAAU;;;IAAV,iCAAU;;;IAAiG,YAAW;;;IAAX,kCAAW;;;IAAmJ,YAAiB;;;IAAjB,wCAAiB;;;IAAxF,kCAAiD;IAAA,kFAAsB;IAAkB,qBAAqD;IAAA,iBAAI;;;IAAhI,0CAA8B;IAAC,eAAwC;IAAxC,gDAAwC;;;IAAmK,YAAgB;;;IAAhB,uCAAgB;;;IAAvF,qCAAkD;IAAA,mFAAqB;IAAiB,qBAAoD;IAAA,iBAAO;;;IAA/H,yCAA6B;IAAC,eAAsC;IAAtC,+CAAsC;;AAtDrkB;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,CAAC,IAAU,EAAW,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,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of `@molecule/app-progress-bar-angular` — the Angular counterpart of
|
|
3
|
+
* `@molecule/app-progress-bar-react`, same props and DOM.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Props accepted by {@link ProgressBar} — the same props
|
|
9
|
+
* `@molecule/app-progress-bar-react` accepts. Node props (`label`,
|
|
10
|
+
* `valueLabel`) are typed `unknown`: pass a plain string as the input, or
|
|
11
|
+
* project content as `[slot=<name>]` children of the host element.
|
|
12
|
+
*/
|
|
13
|
+
export interface ProgressBarProps {
|
|
14
|
+
/** Current numeric value. */
|
|
15
|
+
value: number;
|
|
16
|
+
/** Maximum (defaults to 100). */
|
|
17
|
+
max?: number;
|
|
18
|
+
/** Optional label rendered above the track — a string input, or `[slot=label]` content. */
|
|
19
|
+
label?: unknown;
|
|
20
|
+
/** Optional value display on the right of the label row — a string input, or `[slot=valueLabel]` content. */
|
|
21
|
+
valueLabel?: unknown;
|
|
22
|
+
/** Size preset — maps to ClassMap `progressHeight`. */
|
|
23
|
+
size?: 'sm' | 'md' | 'lg';
|
|
24
|
+
/** Color variant — maps to ClassMap `progressColor`. */
|
|
25
|
+
color?: 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
26
|
+
/** Extra classes on the outer wrapper. */
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Props accepted by {@link ProgressCard} — the same props
|
|
31
|
+
* `@molecule/app-progress-bar-react` accepts. Node props (`title`,
|
|
32
|
+
* `description`, `icon`, `valueLabel`, `children`) are typed `unknown`: pass a
|
|
33
|
+
* plain string as the input, or project content as `[slot=<name>]` children of
|
|
34
|
+
* the host element.
|
|
35
|
+
*/
|
|
36
|
+
export interface ProgressCardProps {
|
|
37
|
+
/** Card title — a string input, or `[slot=title]` projected content. */
|
|
38
|
+
title?: unknown;
|
|
39
|
+
/** Optional supporting description below the title — a string input, or `[slot=description]` content. */
|
|
40
|
+
description?: unknown;
|
|
41
|
+
/** Optional icon shown in the card header — `[slot=icon]` projected content (or a string input). */
|
|
42
|
+
icon?: unknown;
|
|
43
|
+
/** Current value. */
|
|
44
|
+
value: number;
|
|
45
|
+
/** Maximum (defaults to 100). */
|
|
46
|
+
max?: number;
|
|
47
|
+
/** Value display on the right of the header — a string input, or `[slot=valueLabel]` content. */
|
|
48
|
+
valueLabel?: unknown;
|
|
49
|
+
/** ProgressBar color. */
|
|
50
|
+
color?: 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
51
|
+
/** Extra classes on the Card wrapper. */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Additional content rendered below the bar, projected as the element's default content. */
|
|
54
|
+
children?: unknown;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,2FAA2F;IAC3F,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,6GAA6G;IAC7G,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzB,wDAAwD;IACxD,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC5D,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,yGAAyG;IACzG,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oGAAoG;IACpG,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,iGAAiG;IACjG,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,yBAAyB;IACzB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC5D,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-progress-bar-angular",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1-stage",
|
|
4
|
+
"description": "Angular labeled progress bar with card wrapper",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-progress-bar-angular",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "ngc",
|
|
21
|
+
"dev": "ngc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"progress-bar",
|
|
28
|
+
"angular"
|
|
29
|
+
],
|
|
30
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
35
|
+
"directory": "packages/app/features/progress-bar-angular"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
},
|
|
40
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@angular/common": "^22.0.0",
|
|
46
|
+
"@angular/core": "^22.0.0",
|
|
47
|
+
"@angular/platform-browser": "^22.0.0",
|
|
48
|
+
"@molecule/app-angular": "^3.5.0",
|
|
49
|
+
"@molecule/app-ui": "^1.0.1",
|
|
50
|
+
"@molecule/app-ui-angular": "^1.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@angular/common": "22.2.3",
|
|
54
|
+
"@angular/compiler": "22.2.3",
|
|
55
|
+
"@angular/compiler-cli": "22.2.3",
|
|
56
|
+
"@angular/core": "22.2.3",
|
|
57
|
+
"@angular/platform-browser": "22.2.3",
|
|
58
|
+
"@molecule/app-angular": "3.6.0",
|
|
59
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
60
|
+
"@molecule/app-i18n": "1.2.1",
|
|
61
|
+
"@molecule/app-icons": "1.0.4",
|
|
62
|
+
"@molecule/app-ui": "1.3.11",
|
|
63
|
+
"@molecule/app-ui-angular": "1.1.2",
|
|
64
|
+
"@types/node": "26.6.5",
|
|
65
|
+
"jsdom": "30.1.3",
|
|
66
|
+
"rxjs": "7.8.2",
|
|
67
|
+
"typescript": "6.0.3",
|
|
68
|
+
"vitest": "4.1.12",
|
|
69
|
+
"zone.js": "0.16.3"
|
|
70
|
+
}
|
|
71
|
+
}
|