Comparing version 1.2.11 to 1.2.12
@@ -20,5 +20,2 @@ /// <reference types="node" /> | ||
skip: (ctx: Ctx) => void | boolean | string | Promise<boolean>; | ||
enabled: boolean; | ||
prompt: boolean; | ||
bottomBar: boolean; | ||
subtasks: ListrTaskObject<Ctx>[]; | ||
@@ -28,2 +25,4 @@ state: string; | ||
run: (ctx: Ctx, wrapper: ListrTaskWrapper<Ctx>) => Promise<void>; | ||
showSubtasks?: boolean; | ||
collapse?: boolean; | ||
hasSubtasks(): boolean; | ||
@@ -62,4 +61,4 @@ isPending(): boolean; | ||
showSubtasks?: boolean; | ||
collapse?: boolean; | ||
bottomBarItems?: number; | ||
collapse?: boolean; | ||
ctx?: Ctx; | ||
@@ -66,0 +65,0 @@ } |
@@ -14,6 +14,8 @@ import { Subject } from 'rxjs'; | ||
state: ListrTaskObject<Ctx>['state']; | ||
enabled: ListrTaskObject<Ctx>['enabled']; | ||
bottomBar: ListrTaskObject<Ctx>['bottomBar']; | ||
enabledFn: ListrTask['enabled']; | ||
prompt: ListrTaskObject<Ctx>['prompt']; | ||
prompt: boolean; | ||
collapse: boolean; | ||
showSubtasks: boolean; | ||
private enabled; | ||
private bottomBar; | ||
private enabledFn; | ||
constructor(listr: Listr<Ctx>, tasks: ListrTask, options: ListrOptions); | ||
@@ -20,0 +22,0 @@ set state$(state: StateConstants); |
@@ -26,2 +26,4 @@ "use strict"; | ||
this.task = this.tasks.task; | ||
this.collapse = this.options.collapse; | ||
this.showSubtasks = this.options.showSubtasks; | ||
this.skip = ((_b = this.tasks) === null || _b === void 0 ? void 0 : _b.skip) || (() => false); | ||
@@ -28,0 +30,0 @@ this.bottomBar = (_c = this.tasks) === null || _c === void 0 ? void 0 : _c.bottomBar; |
@@ -7,2 +7,3 @@ import { ListrContext, ListrOptions, ListrTask } from './interfaces/listr.interface'; | ||
constructor(options?: ListrOptions<InjectCtx>); | ||
set ctx(ctx: InjectCtx); | ||
add<Ctx = InjectCtx>(tasks: ListrTask<Ctx>[], options?: ListrOptions<Ctx>): void; | ||
@@ -9,0 +10,0 @@ runAll<Ctx = InjectCtx>(options?: ListrOptions<Ctx>): Promise<Ctx>; |
@@ -9,2 +9,5 @@ "use strict"; | ||
} | ||
set ctx(ctx) { | ||
this.options.ctx = ctx; | ||
} | ||
add(tasks, options) { | ||
@@ -11,0 +14,0 @@ this.tasks = [...this.tasks, this.indent(tasks, options)]; |
@@ -22,6 +22,6 @@ "use strict"; | ||
render() { | ||
cli_cursor_1.default.hide(); | ||
if (this.id) { | ||
return; | ||
} | ||
cli_cursor_1.default.hide(); | ||
this.id = setInterval(() => { | ||
@@ -64,4 +64,4 @@ log_update_1.default(this.multiLineRenderer(this.tasks), this.renderBottomBar(), this.renderPrompt()); | ||
|| (task.isCompleted() && !task.hasTitle()) | ||
|| (task.isCompleted() && this.options.collapse === false)) | ||
&& this.options.showSubtasks !== false && task.hasSubtasks()) { | ||
|| (task.isCompleted() && task.collapse === false)) | ||
&& task.showSubtasks !== false && task.hasSubtasks()) { | ||
const subtaskLevel = !task.hasTitle() ? level : level + 1; | ||
@@ -68,0 +68,0 @@ const subtaskRender = this.multiLineRenderer(task.subtasks, subtaskLevel); |
@@ -17,3 +17,3 @@ "use strict"; | ||
task.subscribe((event) => { | ||
if (task.enabled) { | ||
if (task.isEnabled()) { | ||
if (event.type === 'SUBTASK' && task.hasSubtasks()) { | ||
@@ -20,0 +20,0 @@ this.verboseRenderer(task.subtasks); |
{ | ||
"name": "listr2", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"description": "Terminal task list reborn!", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73552
1100