@hestia-earth/ui-components 0.42.22 → 0.42.23
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.
|
@@ -2773,14 +2773,18 @@ var StepStatus;
|
|
|
2773
2773
|
StepStatus[StepStatus["next"] = 2] = "next";
|
|
2774
2774
|
StepStatus[StepStatus["error"] = 3] = "error";
|
|
2775
2775
|
})(StepStatus || (StepStatus = {}));
|
|
2776
|
-
const getStepStatus = (index, statusIndex, success, processing
|
|
2776
|
+
const getStepStatus = (index, statusIndex, success, processing,
|
|
2777
|
+
// marks the current step as actively in progress (driven by the `inProgressStatus` input)
|
|
2778
|
+
inProgress = false) => index < statusIndex
|
|
2777
2779
|
? StepStatus.previous
|
|
2778
2780
|
: index === statusIndex
|
|
2779
|
-
?
|
|
2780
|
-
?
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2781
|
+
? inProgress
|
|
2782
|
+
? StepStatus.current
|
|
2783
|
+
: success
|
|
2784
|
+
? processing
|
|
2785
|
+
? StepStatus.current
|
|
2786
|
+
: StepStatus.next
|
|
2787
|
+
: StepStatus.error
|
|
2784
2788
|
: StepStatus.next;
|
|
2785
2789
|
const getStageStatus = (statuses) => statuses.every(status => status === StepStatus.previous)
|
|
2786
2790
|
? 'success'
|
|
@@ -3151,6 +3155,12 @@ class PipelineStagesProgressComponent {
|
|
|
3151
3155
|
* Is the current status in progress?
|
|
3152
3156
|
*/
|
|
3153
3157
|
this.processing = input(false, ...(ngDevMode ? [{ debugName: "processing" }] : []));
|
|
3158
|
+
/**
|
|
3159
|
+
* Optional status that is actively in progress. When set, that step is rendered as the current step
|
|
3160
|
+
* (spinner), the steps before it as completed and the steps after it as pending. This is opt-in and
|
|
3161
|
+
* takes precedence over `status`; leave it unset to keep the default `status`/`processing` behavior.
|
|
3162
|
+
*/
|
|
3163
|
+
this.inProgressStatus = input(...(ngDevMode ? [undefined, { debugName: "inProgressStatus" }] : []));
|
|
3154
3164
|
/**
|
|
3155
3165
|
* List of statuses, without the `Done` or `Error` suffix.
|
|
3156
3166
|
*/
|
|
@@ -3176,8 +3186,16 @@ class PipelineStagesProgressComponent {
|
|
|
3176
3186
|
this.successes = computed(() => this.statuses().map(status => `${status}Done`), ...(ngDevMode ? [{ debugName: "successes" }] : []));
|
|
3177
3187
|
this.errors = computed(() => this.statuses().map(status => `${status}Error`), ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
3178
3188
|
this.success = computed(() => this.successes().includes(this.status()), ...(ngDevMode ? [{ debugName: "success" }] : []));
|
|
3189
|
+
this.inProgressIndex = computed(() => {
|
|
3190
|
+
const status = this.inProgressStatus();
|
|
3191
|
+
return status ? this.statuses().indexOf(status) : -1;
|
|
3192
|
+
}, ...(ngDevMode ? [{ debugName: "inProgressIndex" }] : []));
|
|
3193
|
+
this.inProgress = computed(() => this.inProgressIndex() >= 0, ...(ngDevMode ? [{ debugName: "inProgress" }] : []));
|
|
3179
3194
|
this.statusGroups = computed(() => unique(Object.values(this.statusToGroupMap() ?? {})), ...(ngDevMode ? [{ debugName: "statusGroups" }] : []));
|
|
3180
3195
|
this.statusIndex = computed(() => {
|
|
3196
|
+
if (this.inProgress()) {
|
|
3197
|
+
return this.inProgressIndex();
|
|
3198
|
+
}
|
|
3181
3199
|
const indexSuccess = this.successes().indexOf(this.status());
|
|
3182
3200
|
const indexError = this.errors().indexOf(this.status());
|
|
3183
3201
|
return indexError >= 0 ? indexError : indexSuccess + (this.success() ? 1 : 0);
|
|
@@ -3185,7 +3203,7 @@ class PipelineStagesProgressComponent {
|
|
|
3185
3203
|
this.statusesWithStepStatus = computed(() => this.statuses().map((status, index) => ({
|
|
3186
3204
|
status,
|
|
3187
3205
|
group: this.statusToGroupMap()[status],
|
|
3188
|
-
stepStatus: getStepStatus(index, this.statusIndex(), this.success(), this.processing()),
|
|
3206
|
+
stepStatus: getStepStatus(index, this.statusIndex(), this.success(), this.processing(), this.inProgress()),
|
|
3189
3207
|
duration: this.statusDurationMap()?.[status]
|
|
3190
3208
|
})), ...(ngDevMode ? [{ debugName: "statusesWithStepStatus" }] : []));
|
|
3191
3209
|
this.groups = computed(() => {
|
|
@@ -3203,7 +3221,12 @@ class PipelineStagesProgressComponent {
|
|
|
3203
3221
|
}, ...(ngDevMode ? [{ debugName: "groups" }] : []));
|
|
3204
3222
|
effect(() => {
|
|
3205
3223
|
// open the status group or the first group
|
|
3206
|
-
|
|
3224
|
+
const inProgressStatus = this.inProgressStatus();
|
|
3225
|
+
if (inProgressStatus) {
|
|
3226
|
+
// an in-progress status already points at the current step: open its group
|
|
3227
|
+
this.openStatusGroup(inProgressStatus);
|
|
3228
|
+
}
|
|
3229
|
+
else if (this.status()) {
|
|
3207
3230
|
// when processing, we need to open the group of the next status
|
|
3208
3231
|
const statusIndex = this.statuses().indexOf(cleanStatus(this.status()));
|
|
3209
3232
|
const status = this.statuses()[this.processing() ? statusIndex + 1 : statusIndex];
|
|
@@ -3230,12 +3253,12 @@ class PipelineStagesProgressComponent {
|
|
|
3230
3253
|
this.openedStage.set(this.openedStage() === index ? null : index);
|
|
3231
3254
|
}
|
|
3232
3255
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: PipelineStagesProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3233
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: PipelineStagesProgressComponent, isStandalone: true, selector: "he-pipeline-stages-progress", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, processing: { classPropertyName: "processing", publicName: "processing", isSignal: true, isRequired: false, transformFunction: null }, statuses: { classPropertyName: "statuses", publicName: "statuses", isSignal: true, isRequired: true, transformFunction: null }, statusToGroupMap: { classPropertyName: "statusToGroupMap", publicName: "statusToGroupMap", isSignal: true, isRequired: true, transformFunction: null }, statusToLabelMap: { classPropertyName: "statusToLabelMap", publicName: "statusToLabelMap", isSignal: true, isRequired: true, transformFunction: null }, statusGroupColorFn: { classPropertyName: "statusGroupColorFn", publicName: "statusGroupColorFn", isSignal: true, isRequired: true, transformFunction: null }, statusDurationMap: { classPropertyName: "statusDurationMap", publicName: "statusDurationMap", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (group of groups(); track group.group; let index = $index, first = $first, last = $last) {\n <div class=\"pipeline-stage-container is-centered\" [ngStyle]=\"group.palette\">\n <div> </div>\n <he-pipeline-progress-stage (click)=\"toggleOpenedStage(index)\" [processing]=\"processing()\" [group]=\"group\" />\n <div> </div>\n <he-pipeline-progress-group\n [style.order]=\"slideDirection() === 'up' ? -99 : 99\"\n [direction]=\"slideDirection()\"\n [statuses]=\"group.statuses\"\n [statusToLabelMap]=\"statusToLabelMap()\"\n [isFirstStage]=\"first\"\n [isLastStage]=\"last\"\n [visible]=\"openedStage() === index\" />\n </div>\n}\n", styles: [":host{display:grid;grid-template-columns:1fr auto auto 1fr}:host .pipeline-stage-container{grid-column:span 4;position:relative;overflow:hidden;display:grid;grid-template-columns:subgrid}he-pipeline-progress-stage{grid-column:span 2}he-pipeline-progress-group{grid-column:span 4}\n"], dependencies: [{ kind: "component", type: PipelineProgressStageComponent, selector: "he-pipeline-progress-stage", inputs: ["group", "processing"] }, { kind: "component", type: PipelineProgressGroupComponent, selector: "he-pipeline-progress-group", inputs: ["visible", "isFirstStage", "isLastStage", "stepStatus", "statuses", "direction", "statusToLabelMap"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3256
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: PipelineStagesProgressComponent, isStandalone: true, selector: "he-pipeline-stages-progress", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, processing: { classPropertyName: "processing", publicName: "processing", isSignal: true, isRequired: false, transformFunction: null }, inProgressStatus: { classPropertyName: "inProgressStatus", publicName: "inProgressStatus", isSignal: true, isRequired: false, transformFunction: null }, statuses: { classPropertyName: "statuses", publicName: "statuses", isSignal: true, isRequired: true, transformFunction: null }, statusToGroupMap: { classPropertyName: "statusToGroupMap", publicName: "statusToGroupMap", isSignal: true, isRequired: true, transformFunction: null }, statusToLabelMap: { classPropertyName: "statusToLabelMap", publicName: "statusToLabelMap", isSignal: true, isRequired: true, transformFunction: null }, statusGroupColorFn: { classPropertyName: "statusGroupColorFn", publicName: "statusGroupColorFn", isSignal: true, isRequired: true, transformFunction: null }, statusDurationMap: { classPropertyName: "statusDurationMap", publicName: "statusDurationMap", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (group of groups(); track group.group; let index = $index, first = $first, last = $last) {\n <div class=\"pipeline-stage-container is-centered\" [ngStyle]=\"group.palette\">\n <div> </div>\n <he-pipeline-progress-stage (click)=\"toggleOpenedStage(index)\" [processing]=\"processing()\" [group]=\"group\" />\n <div> </div>\n <he-pipeline-progress-group\n [style.order]=\"slideDirection() === 'up' ? -99 : 99\"\n [direction]=\"slideDirection()\"\n [statuses]=\"group.statuses\"\n [statusToLabelMap]=\"statusToLabelMap()\"\n [isFirstStage]=\"first\"\n [isLastStage]=\"last\"\n [visible]=\"openedStage() === index\" />\n </div>\n}\n", styles: [":host{display:grid;grid-template-columns:1fr auto auto 1fr}:host .pipeline-stage-container{grid-column:span 4;position:relative;overflow:hidden;display:grid;grid-template-columns:subgrid}he-pipeline-progress-stage{grid-column:span 2}he-pipeline-progress-group{grid-column:span 4}\n"], dependencies: [{ kind: "component", type: PipelineProgressStageComponent, selector: "he-pipeline-progress-stage", inputs: ["group", "processing"] }, { kind: "component", type: PipelineProgressGroupComponent, selector: "he-pipeline-progress-group", inputs: ["visible", "isFirstStage", "isLastStage", "stepStatus", "statuses", "direction", "statusToLabelMap"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3234
3257
|
}
|
|
3235
3258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: PipelineStagesProgressComponent, decorators: [{
|
|
3236
3259
|
type: Component$1,
|
|
3237
3260
|
args: [{ selector: 'he-pipeline-stages-progress', changeDetection: ChangeDetectionStrategy.OnPush, imports: [PipelineProgressStageComponent, PipelineProgressGroupComponent, NgStyle], template: "@for (group of groups(); track group.group; let index = $index, first = $first, last = $last) {\n <div class=\"pipeline-stage-container is-centered\" [ngStyle]=\"group.palette\">\n <div> </div>\n <he-pipeline-progress-stage (click)=\"toggleOpenedStage(index)\" [processing]=\"processing()\" [group]=\"group\" />\n <div> </div>\n <he-pipeline-progress-group\n [style.order]=\"slideDirection() === 'up' ? -99 : 99\"\n [direction]=\"slideDirection()\"\n [statuses]=\"group.statuses\"\n [statusToLabelMap]=\"statusToLabelMap()\"\n [isFirstStage]=\"first\"\n [isLastStage]=\"last\"\n [visible]=\"openedStage() === index\" />\n </div>\n}\n", styles: [":host{display:grid;grid-template-columns:1fr auto auto 1fr}:host .pipeline-stage-container{grid-column:span 4;position:relative;overflow:hidden;display:grid;grid-template-columns:subgrid}he-pipeline-progress-stage{grid-column:span 2}he-pipeline-progress-group{grid-column:span 4}\n"] }]
|
|
3238
|
-
}], ctorParameters: () => [], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], processing: [{ type: i0.Input, args: [{ isSignal: true, alias: "processing", required: false }] }], statuses: [{ type: i0.Input, args: [{ isSignal: true, alias: "statuses", required: true }] }], statusToGroupMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusToGroupMap", required: true }] }], statusToLabelMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusToLabelMap", required: true }] }], statusGroupColorFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusGroupColorFn", required: true }] }], statusDurationMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusDurationMap", required: false }] }] } });
|
|
3261
|
+
}], ctorParameters: () => [], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], processing: [{ type: i0.Input, args: [{ isSignal: true, alias: "processing", required: false }] }], inProgressStatus: [{ type: i0.Input, args: [{ isSignal: true, alias: "inProgressStatus", required: false }] }], statuses: [{ type: i0.Input, args: [{ isSignal: true, alias: "statuses", required: true }] }], statusToGroupMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusToGroupMap", required: true }] }], statusToLabelMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusToLabelMap", required: true }] }], statusGroupColorFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusGroupColorFn", required: true }] }], statusDurationMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusDurationMap", required: false }] }] } });
|
|
3239
3262
|
|
|
3240
3263
|
class PopoverComponent {
|
|
3241
3264
|
constructor() {
|