@ssv/ngx.command 2.3.2 → 3.0.0-dev.1-dev.10
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/eslint.config.js +43 -0
- package/jest.config.ts +21 -0
- package/ng-package.json +7 -0
- package/package.json +5 -29
- package/project.json +36 -0
- package/src/command-ref.directive.ts +57 -0
- package/src/command.directive.ts +191 -0
- package/src/command.directive.xspec.ts +105 -0
- package/src/command.model.ts +36 -0
- package/src/command.options.ts +45 -0
- package/src/command.spec.ts +215 -0
- package/src/command.ts +170 -0
- package/src/command.util.ts +50 -0
- package/{index.d.ts → src/index.ts} +1 -1
- package/src/module.ts +17 -0
- package/src/test-setup.ts +8 -0
- package/src/version.ts +1 -0
- package/tsconfig.json +28 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +16 -0
- package/LICENSE +0 -21
- package/command-ref.directive.d.ts +0 -29
- package/command.d.ts +0 -47
- package/command.directive.d.ts +0 -25
- package/command.model.d.ts +0 -28
- package/command.util.d.ts +0 -15
- package/config.d.ts +0 -18
- package/esm2020/command-ref.directive.mjs +0 -54
- package/esm2020/command.directive.mjs +0 -166
- package/esm2020/command.mjs +0 -127
- package/esm2020/command.model.mjs +0 -2
- package/esm2020/command.util.mjs +0 -29
- package/esm2020/config.mjs +0 -8
- package/esm2020/index.mjs +0 -8
- package/esm2020/module.mjs +0 -49
- package/esm2020/ssv-ngx.command.mjs +0 -5
- package/esm2020/version.mjs +0 -2
- package/fesm2015/ssv-ngx.command.mjs +0 -419
- package/fesm2015/ssv-ngx.command.mjs.map +0 -1
- package/fesm2020/ssv-ngx.command.mjs +0 -424
- package/fesm2020/ssv-ngx.command.mjs.map +0 -1
- package/module.d.ts +0 -15
- package/version.d.ts +0 -1
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject, Subject, Subscription, combineLatest, of, EMPTY } from 'rxjs';
|
|
2
|
-
import { map, tap, filter, switchMap, finalize, take, catchError, delay, startWith, distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, Directive, Inject, Input, HostListener, Optional, NgModule } from '@angular/core';
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
-
/**
|
|
8
|
-
* Command object used to encapsulate information which is needed to perform an action.
|
|
9
|
-
*/
|
|
10
|
-
class Command {
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of Command.
|
|
13
|
-
*
|
|
14
|
-
* @param execute Execute function to invoke - use `isAsync: true` when `Observable<any>`.
|
|
15
|
-
* @param canExecute Observable which determines whether it can execute or not.
|
|
16
|
-
* @param isAsync Indicates that the execute function is async e.g. Observable.
|
|
17
|
-
*/
|
|
18
|
-
constructor(execute, canExecute$, isAsync) {
|
|
19
|
-
/** Determines whether to auto destroy when having 0 subscribers. */
|
|
20
|
-
this.autoDestroy = true;
|
|
21
|
-
this._isExecuting$ = new BehaviorSubject(false);
|
|
22
|
-
this._isExecuting = false;
|
|
23
|
-
this._canExecute = true;
|
|
24
|
-
this.executionPipe$ = new Subject();
|
|
25
|
-
this.isExecuting$$ = Subscription.EMPTY;
|
|
26
|
-
this.canExecute$$ = Subscription.EMPTY;
|
|
27
|
-
this.executionPipe$$ = Subscription.EMPTY;
|
|
28
|
-
this.subscribersCount = 0;
|
|
29
|
-
if (canExecute$) {
|
|
30
|
-
this.canExecute$ = combineLatest([
|
|
31
|
-
this._isExecuting$,
|
|
32
|
-
canExecute$
|
|
33
|
-
]).pipe(map(([isExecuting, canExecuteResult]) => {
|
|
34
|
-
// console.log("[command::combineLatest$] update!", { isExecuting, canExecuteResult });
|
|
35
|
-
this._isExecuting = isExecuting;
|
|
36
|
-
this._canExecute = !isExecuting && !!canExecuteResult;
|
|
37
|
-
return this._canExecute;
|
|
38
|
-
}));
|
|
39
|
-
this.canExecute$$ = this.canExecute$.subscribe();
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.canExecute$ = this._isExecuting$.pipe(map(x => {
|
|
43
|
-
const canExecute = !x;
|
|
44
|
-
this._canExecute = canExecute;
|
|
45
|
-
return canExecute;
|
|
46
|
-
}));
|
|
47
|
-
this.isExecuting$$ = this._isExecuting$
|
|
48
|
-
.pipe(tap(x => this._isExecuting = x))
|
|
49
|
-
.subscribe();
|
|
50
|
-
}
|
|
51
|
-
this.executionPipe$$ = this.buildExecutionPipe(execute, isAsync).subscribe();
|
|
52
|
-
}
|
|
53
|
-
/** Determines whether the command is currently executing, as a snapshot value. */
|
|
54
|
-
get isExecuting() {
|
|
55
|
-
return this._isExecuting;
|
|
56
|
-
}
|
|
57
|
-
/** Determines whether the command can execute or not, as a snapshot value. */
|
|
58
|
-
get canExecute() {
|
|
59
|
-
return this._canExecute;
|
|
60
|
-
}
|
|
61
|
-
/** Determines whether the command is currently executing, as an observable. */
|
|
62
|
-
get isExecuting$() {
|
|
63
|
-
return this._isExecuting$.asObservable();
|
|
64
|
-
}
|
|
65
|
-
/** Execute function to invoke. */
|
|
66
|
-
execute(...args) {
|
|
67
|
-
// console.warn("[command::execute]", args);
|
|
68
|
-
this.executionPipe$.next(args);
|
|
69
|
-
}
|
|
70
|
-
/** Disposes all resources held by subscriptions. */
|
|
71
|
-
destroy() {
|
|
72
|
-
// console.warn("[command::destroy]");
|
|
73
|
-
this.executionPipe$$.unsubscribe();
|
|
74
|
-
this.canExecute$$.unsubscribe();
|
|
75
|
-
this.isExecuting$$.unsubscribe();
|
|
76
|
-
}
|
|
77
|
-
subscribe() {
|
|
78
|
-
this.subscribersCount++;
|
|
79
|
-
}
|
|
80
|
-
unsubscribe() {
|
|
81
|
-
this.subscribersCount--;
|
|
82
|
-
// console.log("[command::unsubscribe]", { autoDestroy: this.autoDestroy, subscribersCount: this.subscribersCount });
|
|
83
|
-
if (this.autoDestroy && this.subscribersCount <= 0) {
|
|
84
|
-
this.destroy();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
buildExecutionPipe(execute, isAsync) {
|
|
88
|
-
let pipe$ = this.executionPipe$.pipe(
|
|
89
|
-
// tap(x => console.warn(">>>> executionPipe", this._canExecute)),
|
|
90
|
-
filter(() => this._canExecute), tap(() => {
|
|
91
|
-
// console.log("[command::executionPipe$] do#1 - set execute", { args: x });
|
|
92
|
-
this._isExecuting$.next(true);
|
|
93
|
-
}));
|
|
94
|
-
const execFn = isAsync
|
|
95
|
-
? switchMap(args => {
|
|
96
|
-
if (args) {
|
|
97
|
-
return execute(...args);
|
|
98
|
-
}
|
|
99
|
-
return execute();
|
|
100
|
-
})
|
|
101
|
-
: tap((args) => {
|
|
102
|
-
if (args) {
|
|
103
|
-
execute(...args);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
execute();
|
|
107
|
-
});
|
|
108
|
-
pipe$ = pipe$.pipe(switchMap(args => of(args).pipe(execFn, finalize(() => {
|
|
109
|
-
// console.log("[command::executionPipe$] finalize inner#1 - set idle");
|
|
110
|
-
this._isExecuting$.next(false);
|
|
111
|
-
}), take(1), catchError(error => {
|
|
112
|
-
console.error("Unhandled execute error", error);
|
|
113
|
-
return EMPTY;
|
|
114
|
-
}))), tap(() => {
|
|
115
|
-
// console.log("[command::executionPipe$] tap#2 - set idle");
|
|
116
|
-
this._isExecuting$.next(false);
|
|
117
|
-
}));
|
|
118
|
-
return pipe$;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Async Command object used to encapsulate information which is needed to perform an action,
|
|
123
|
-
* which takes an execute function as Observable/Promise.
|
|
124
|
-
*/
|
|
125
|
-
class CommandAsync extends Command {
|
|
126
|
-
constructor(execute, canExecute$) {
|
|
127
|
-
super(execute, canExecute$, true);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const COMMAND_DEFAULT_CONFIG = Object.freeze({
|
|
132
|
-
executingCssClass: "executing",
|
|
133
|
-
handleDisabled: true,
|
|
134
|
-
hasDisabledDelay: false,
|
|
135
|
-
});
|
|
136
|
-
const COMMAND_CONFIG = new InjectionToken("command-config");
|
|
137
|
-
|
|
138
|
-
/** Determines whether the arg object is of type `Command`. */
|
|
139
|
-
function isCommand(arg) {
|
|
140
|
-
return arg instanceof Command;
|
|
141
|
-
}
|
|
142
|
-
/** Determines whether the arg object is of type `CommandCreator`. */
|
|
143
|
-
function isCommandCreator(arg) {
|
|
144
|
-
if (arg instanceof Command) {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
else if (isAssumedType(arg) && arg.execute && arg.host) {
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
/** Get form is valid as an observable. */
|
|
153
|
-
function canExecuteFromNgForm(form, options) {
|
|
154
|
-
const opts = { validity: true, dirty: true, ...options };
|
|
155
|
-
return form.statusChanges
|
|
156
|
-
? form.statusChanges.pipe(// todo: remove cast when working correctly
|
|
157
|
-
delay(0), startWith(form.valid), map(() => !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty)), distinctUntilChanged())
|
|
158
|
-
: of(true);
|
|
159
|
-
}
|
|
160
|
-
function isAssumedType(x) {
|
|
161
|
-
return x !== null && typeof x === "object";
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Controls the state of a component in sync with `Command`.
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
168
|
-
* ### Most common usage
|
|
169
|
-
* ```html
|
|
170
|
-
* <button [ssvCommand]="saveCmd">Save</button>
|
|
171
|
-
* ```
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* ### Usage with options
|
|
175
|
-
* ```html
|
|
176
|
-
* <button [ssvCommand]="saveCmd" [ssvCommandOptions]="{executingCssClass: 'in-progress'}">Save</button>
|
|
177
|
-
* ```
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* ### Usage with params
|
|
181
|
-
* This is useful for collections (loops) or using multiple actions with different args.
|
|
182
|
-
* *NOTE: This will share the `isExecuting` when used with multiple controls.*
|
|
183
|
-
*
|
|
184
|
-
* #### With single param
|
|
185
|
-
*
|
|
186
|
-
* ```html
|
|
187
|
-
* <button [ssvCommand]="saveCmd" [ssvCommandParams]="{id: 1}">Save</button>
|
|
188
|
-
* ```
|
|
189
|
-
* *NOTE: if you have only 1 argument as an array, it should be enclosed within an array e.g. `[['apple', 'banana']]`,
|
|
190
|
-
* else it will spread and you will `arg1: "apple", arg2: "banana"`*
|
|
191
|
-
*
|
|
192
|
-
* #### With multi params
|
|
193
|
-
* ```html
|
|
194
|
-
* <button [ssvCommand]="saveCmd" [ssvCommandParams]="[{id: 1}, 'hello', hero]">Save</button>
|
|
195
|
-
* ```
|
|
196
|
-
*
|
|
197
|
-
* ### Usage with Command Creator
|
|
198
|
-
* This is useful for collections (loops) or using multiple actions with different args, whilst not sharing `isExecuting`.
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* ```html
|
|
202
|
-
* <button [ssvCommand]="{host: this, execute: removeHero$, canExecute: isValid$, params: [hero, 1337, 'xx']}">Save</button>
|
|
203
|
-
* ```
|
|
204
|
-
*
|
|
205
|
-
*/
|
|
206
|
-
const NAME_CAMEL$1 = "ssvCommand";
|
|
207
|
-
// let nextUniqueId = 0;
|
|
208
|
-
class CommandDirective {
|
|
209
|
-
constructor(config, renderer, element, cdr) {
|
|
210
|
-
this.config = config;
|
|
211
|
-
this.renderer = renderer;
|
|
212
|
-
this.element = element;
|
|
213
|
-
this.cdr = cdr;
|
|
214
|
-
this._commandOptions = this.config;
|
|
215
|
-
this._destroy$ = new Subject();
|
|
216
|
-
}
|
|
217
|
-
get commandOptions() { return this._commandOptions; }
|
|
218
|
-
set commandOptions(value) {
|
|
219
|
-
if (value === this._commandOptions) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
this._commandOptions = {
|
|
223
|
-
...this.config,
|
|
224
|
-
...value,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
get command() { return this._command; }
|
|
228
|
-
ngOnInit() {
|
|
229
|
-
// console.log("[ssvCommand::init]", this.config);
|
|
230
|
-
if (!this.commandOrCreator) {
|
|
231
|
-
throw new Error(`${NAME_CAMEL$1}: [${NAME_CAMEL$1}] should be defined!`);
|
|
232
|
-
}
|
|
233
|
-
else if (isCommand(this.commandOrCreator)) {
|
|
234
|
-
this._command = this.commandOrCreator;
|
|
235
|
-
}
|
|
236
|
-
else if (isCommandCreator(this.commandOrCreator)) {
|
|
237
|
-
const isAsync = this.commandOrCreator.isAsync || this.commandOrCreator.isAsync === undefined;
|
|
238
|
-
// todo: find something like this for ivy (or angular10+)
|
|
239
|
-
// const hostComponent = (this.viewContainer as any)._view.component;
|
|
240
|
-
const execFn = this.commandOrCreator.execute.bind(this.commandOrCreator.host);
|
|
241
|
-
this.commandParams = this.commandParams || this.commandOrCreator.params;
|
|
242
|
-
const canExec = this.commandOrCreator.canExecute instanceof Function
|
|
243
|
-
? this.commandOrCreator.canExecute.bind(this.commandOrCreator.host, this.commandParams)()
|
|
244
|
-
: this.commandOrCreator.canExecute;
|
|
245
|
-
// console.log("[ssvCommand::init] command creator", {
|
|
246
|
-
// firstParam: this.commandParams ? this.commandParams[0] : null,
|
|
247
|
-
// params: this.commandParams
|
|
248
|
-
// });
|
|
249
|
-
this._command = new Command(execFn, canExec, isAsync);
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
throw new Error(`${NAME_CAMEL$1}: [${NAME_CAMEL$1}] is not defined properly!`);
|
|
253
|
-
}
|
|
254
|
-
this._command.subscribe();
|
|
255
|
-
this._command.canExecute$.pipe(this.commandOptions.hasDisabledDelay
|
|
256
|
-
? delay(1)
|
|
257
|
-
: tap(() => { }), tap(x => {
|
|
258
|
-
this.trySetDisabled(!x);
|
|
259
|
-
// console.log("[ssvCommand::canExecute$]", { canExecute: x });
|
|
260
|
-
this.cdr.markForCheck();
|
|
261
|
-
}), takeUntil(this._destroy$)).subscribe();
|
|
262
|
-
if (this._command.isExecuting$) {
|
|
263
|
-
this._command.isExecuting$.pipe(tap(x => {
|
|
264
|
-
// console.log("[ssvCommand::isExecuting$]", x, this.commandOptions);
|
|
265
|
-
if (x) {
|
|
266
|
-
this.renderer.addClass(this.element.nativeElement, this.commandOptions.executingCssClass);
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
this.renderer.removeClass(this.element.nativeElement, this.commandOptions.executingCssClass);
|
|
270
|
-
}
|
|
271
|
-
}), takeUntil(this._destroy$)).subscribe();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
onClick() {
|
|
275
|
-
// console.log("[ssvCommand::onClick]", this.commandParams);
|
|
276
|
-
if (Array.isArray(this.commandParams)) {
|
|
277
|
-
this._command.execute(...this.commandParams);
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
this._command.execute(this.commandParams);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
ngOnDestroy() {
|
|
284
|
-
// console.log("[ssvCommand::destroy]");
|
|
285
|
-
this._destroy$.next();
|
|
286
|
-
this._destroy$.complete();
|
|
287
|
-
if (this._command) {
|
|
288
|
-
this._command.unsubscribe();
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
trySetDisabled(disabled) {
|
|
292
|
-
if (this.commandOptions.handleDisabled) {
|
|
293
|
-
// console.warn(">>>> disabled", { id: this.id, disabled });
|
|
294
|
-
this.renderer.setProperty(this.element.nativeElement, "disabled", disabled);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
CommandDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CommandDirective, deps: [{ token: COMMAND_CONFIG }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
299
|
-
CommandDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: CommandDirective, selector: "[ssvCommand]", inputs: { commandOrCreator: ["ssvCommand", "commandOrCreator"], commandOptions: ["ssvCommandOptions", "commandOptions"], commandParams: ["ssvCommandParams", "commandParams"] }, host: { listeners: { "click": "onClick()" } }, exportAs: ["ssvCommand"], ngImport: i0 });
|
|
300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CommandDirective, decorators: [{
|
|
301
|
-
type: Directive,
|
|
302
|
-
args: [{
|
|
303
|
-
selector: `[${NAME_CAMEL$1}]`,
|
|
304
|
-
exportAs: NAME_CAMEL$1
|
|
305
|
-
}]
|
|
306
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
307
|
-
type: Inject,
|
|
308
|
-
args: [COMMAND_CONFIG]
|
|
309
|
-
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { commandOrCreator: [{
|
|
310
|
-
type: Input,
|
|
311
|
-
args: [NAME_CAMEL$1]
|
|
312
|
-
}], commandOptions: [{
|
|
313
|
-
type: Input,
|
|
314
|
-
args: [`${NAME_CAMEL$1}Options`]
|
|
315
|
-
}], commandParams: [{
|
|
316
|
-
type: Input,
|
|
317
|
-
args: [`${NAME_CAMEL$1}Params`]
|
|
318
|
-
}], onClick: [{
|
|
319
|
-
type: HostListener,
|
|
320
|
-
args: ["click"]
|
|
321
|
-
}] } });
|
|
322
|
-
|
|
323
|
-
const NAME_CAMEL = "ssvCommandRef";
|
|
324
|
-
/**
|
|
325
|
-
* Command creator ref, directive which allows creating Command in the template
|
|
326
|
-
* and associate it to a command (in order to share executions).
|
|
327
|
-
* @example
|
|
328
|
-
* ### Most common usage
|
|
329
|
-
* ```html
|
|
330
|
-
* <div #actionCmd="ssvCommandRef" [ssvCommandRef]="{host: this, execute: removeHero$, canExecute: isValid$}">
|
|
331
|
-
* <button [ssvCommand]="actionCmd.command" [ssvCommandParams]="hero">
|
|
332
|
-
* Remove
|
|
333
|
-
* </button>
|
|
334
|
-
* <button [ssvCommand]="actionCmd.command" [ssvCommandParams]="hero">
|
|
335
|
-
* Remove
|
|
336
|
-
* </button>
|
|
337
|
-
* </div>
|
|
338
|
-
* ```
|
|
339
|
-
*
|
|
340
|
-
*/
|
|
341
|
-
class CommandRefDirective {
|
|
342
|
-
get command() { return this._command; }
|
|
343
|
-
ngOnInit() {
|
|
344
|
-
if (isCommandCreator(this.commandCreator)) {
|
|
345
|
-
const isAsync = this.commandCreator.isAsync || this.commandCreator.isAsync === undefined;
|
|
346
|
-
const execFn = this.commandCreator.execute.bind(this.commandCreator.host);
|
|
347
|
-
this._command = new Command(execFn, this.commandCreator.canExecute, isAsync);
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
throw new Error(`${NAME_CAMEL}: [${NAME_CAMEL}] is not defined properly!`);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
ngOnDestroy() {
|
|
354
|
-
// console.log("[commandRef::destroy]");
|
|
355
|
-
if (this._command) {
|
|
356
|
-
this._command.destroy();
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
CommandRefDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CommandRefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
361
|
-
CommandRefDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: CommandRefDirective, selector: "[ssvCommandRef]", inputs: { commandCreator: ["ssvCommandRef", "commandCreator"] }, exportAs: ["ssvCommandRef"], ngImport: i0 });
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CommandRefDirective, decorators: [{
|
|
363
|
-
type: Directive,
|
|
364
|
-
args: [{
|
|
365
|
-
selector: `[${NAME_CAMEL}]`,
|
|
366
|
-
exportAs: NAME_CAMEL
|
|
367
|
-
}]
|
|
368
|
-
}], propDecorators: { commandCreator: [{
|
|
369
|
-
type: Input,
|
|
370
|
-
args: [NAME_CAMEL]
|
|
371
|
-
}] } });
|
|
372
|
-
|
|
373
|
-
/** @internal */
|
|
374
|
-
const MODULE_CONFIG_DATA = new InjectionToken("@ssv/ngx.command/configData");
|
|
375
|
-
const components = [
|
|
376
|
-
CommandDirective,
|
|
377
|
-
CommandRefDirective
|
|
378
|
-
];
|
|
379
|
-
class SsvCommandModule {
|
|
380
|
-
static forRoot(config) {
|
|
381
|
-
return {
|
|
382
|
-
ngModule: SsvCommandModule,
|
|
383
|
-
providers: [
|
|
384
|
-
{ provide: MODULE_CONFIG_DATA, useValue: config },
|
|
385
|
-
],
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
SsvCommandModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsvCommandModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
390
|
-
SsvCommandModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SsvCommandModule, declarations: [CommandDirective,
|
|
391
|
-
CommandRefDirective], exports: [CommandDirective,
|
|
392
|
-
CommandRefDirective] });
|
|
393
|
-
SsvCommandModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsvCommandModule, providers: [
|
|
394
|
-
{ provide: COMMAND_CONFIG, useFactory: _moduleConfigFactory, deps: [[MODULE_CONFIG_DATA, new Optional()]] },
|
|
395
|
-
] });
|
|
396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsvCommandModule, decorators: [{
|
|
397
|
-
type: NgModule,
|
|
398
|
-
args: [{
|
|
399
|
-
declarations: components,
|
|
400
|
-
providers: [
|
|
401
|
-
{ provide: COMMAND_CONFIG, useFactory: _moduleConfigFactory, deps: [[MODULE_CONFIG_DATA, new Optional()]] },
|
|
402
|
-
],
|
|
403
|
-
exports: [...components],
|
|
404
|
-
}]
|
|
405
|
-
}] });
|
|
406
|
-
/** @internal */
|
|
407
|
-
function _moduleConfigFactory(config) {
|
|
408
|
-
const cfg = typeof config === "function" ? config() : config;
|
|
409
|
-
return cfg
|
|
410
|
-
? {
|
|
411
|
-
...COMMAND_DEFAULT_CONFIG,
|
|
412
|
-
...cfg,
|
|
413
|
-
}
|
|
414
|
-
: COMMAND_DEFAULT_CONFIG;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
const VERSION = "2.3.2";
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Generated bundle index. Do not edit.
|
|
421
|
-
*/
|
|
422
|
-
|
|
423
|
-
export { COMMAND_CONFIG, COMMAND_DEFAULT_CONFIG, Command, CommandAsync, CommandDirective, CommandRefDirective, MODULE_CONFIG_DATA, SsvCommandModule, VERSION, _moduleConfigFactory, canExecuteFromNgForm, isCommand, isCommandCreator };
|
|
424
|
-
//# sourceMappingURL=ssv-ngx.command.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ssv-ngx.command.mjs","sources":["../../src/command.ts","../../src/config.ts","../../src/command.util.ts","../../src/command.directive.ts","../../src/command-ref.directive.ts","../../src/module.ts","../../src/version.ts","../../src/ssv-ngx.command.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Observable, combineLatest, Subscription, Subject, BehaviorSubject, of, EMPTY } from \"rxjs\";\nimport { tap, map, filter, switchMap, catchError, finalize, take } from \"rxjs/operators\";\nimport { ICommand } from \"./command.model\";\n\n/**\n * Command object used to encapsulate information which is needed to perform an action.\n */\nexport class Command implements ICommand {\n\n\t/** Determines whether the command is currently executing, as a snapshot value. */\n\tget isExecuting(): boolean {\n\t\treturn this._isExecuting;\n\t}\n\n\t/** Determines whether the command can execute or not, as a snapshot value. */\n\tget canExecute(): boolean {\n\t\treturn this._canExecute;\n\t}\n\n\t/** Determines whether the command is currently executing, as an observable. */\n\tget isExecuting$(): Observable<boolean> {\n\t\treturn this._isExecuting$.asObservable();\n\t}\n\n\t/** Determines whether to auto destroy when having 0 subscribers. */\n\tautoDestroy = true;\n\n\t/** Determines whether the command can execute or not, as an observable. */\n\treadonly canExecute$: Observable<boolean>;\n\n\tprivate _isExecuting$ = new BehaviorSubject<boolean>(false);\n\tprivate _isExecuting = false;\n\tprivate _canExecute = true;\n\tprivate executionPipe$ = new Subject<unknown[] | undefined>();\n\tprivate isExecuting$$ = Subscription.EMPTY;\n\tprivate canExecute$$ = Subscription.EMPTY;\n\tprivate executionPipe$$ = Subscription.EMPTY;\n\tprivate subscribersCount = 0;\n\n\t/**\n\t * Creates an instance of Command.\n\t *\n\t * @param execute Execute function to invoke - use `isAsync: true` when `Observable<any>`.\n\t * @param canExecute Observable which determines whether it can execute or not.\n\t * @param isAsync Indicates that the execute function is async e.g. Observable.\n\t */\n\tconstructor(\n\t\texecute: (...args: unknown[]) => unknown,\n\t\tcanExecute$?: Observable<boolean>,\n\t\tisAsync?: boolean,\n\t) {\n\t\tif (canExecute$) {\n\t\t\tthis.canExecute$ = combineLatest([\n\t\t\t\tthis._isExecuting$,\n\t\t\t\tcanExecute$\n\t\t\t]).pipe(\n\t\t\t\tmap(([isExecuting, canExecuteResult]) => {\n\t\t\t\t\t// console.log(\"[command::combineLatest$] update!\", { isExecuting, canExecuteResult });\n\t\t\t\t\tthis._isExecuting = isExecuting;\n\t\t\t\t\tthis._canExecute = !isExecuting && !!canExecuteResult;\n\t\t\t\t\treturn this._canExecute;\n\t\t\t\t}),\n\t\t\t);\n\t\t\tthis.canExecute$$ = this.canExecute$.subscribe();\n\t\t} else {\n\t\t\tthis.canExecute$ = this._isExecuting$.pipe(\n\t\t\t\tmap(x => {\n\t\t\t\t\tconst canExecute = !x;\n\t\t\t\t\tthis._canExecute = canExecute;\n\t\t\t\t\treturn canExecute;\n\t\t\t\t})\n\t\t\t);\n\t\t\tthis.isExecuting$$ = this._isExecuting$\n\t\t\t\t.pipe(tap(x => this._isExecuting = x))\n\t\t\t\t.subscribe();\n\t\t}\n\t\tthis.executionPipe$$ = this.buildExecutionPipe(execute, isAsync).subscribe();\n\t}\n\n\t/** Execute function to invoke. */\n\texecute(...args: unknown[]): void {\n\t\t// console.warn(\"[command::execute]\", args);\n\t\tthis.executionPipe$.next(args);\n\t}\n\n\t/** Disposes all resources held by subscriptions. */\n\tdestroy(): void {\n\t\t// console.warn(\"[command::destroy]\");\n\t\tthis.executionPipe$$.unsubscribe();\n\t\tthis.canExecute$$.unsubscribe();\n\t\tthis.isExecuting$$.unsubscribe();\n\t}\n\n\tsubscribe(): void {\n\t\tthis.subscribersCount++;\n\t}\n\n\tunsubscribe(): void {\n\t\tthis.subscribersCount--;\n\t\t// console.log(\"[command::unsubscribe]\", { autoDestroy: this.autoDestroy, subscribersCount: this.subscribersCount });\n\t\tif (this.autoDestroy && this.subscribersCount <= 0) {\n\t\t\tthis.destroy();\n\t\t}\n\t}\n\n\tprivate buildExecutionPipe(execute: (...args: unknown[]) => any, isAsync?: boolean): Observable<unknown> {\n\t\tlet pipe$ = this.executionPipe$.pipe(\n\t\t\t// tap(x => console.warn(\">>>> executionPipe\", this._canExecute)),\n\t\t\tfilter(() => this._canExecute),\n\t\t\ttap(() => {\n\t\t\t\t// console.log(\"[command::executionPipe$] do#1 - set execute\", { args: x });\n\t\t\t\tthis._isExecuting$.next(true);\n\t\t\t})\n\t\t);\n\n\t\tconst execFn = isAsync\n\t\t\t? switchMap<unknown[] | undefined, any[]>(args => {\n\t\t\t\tif (args) {\n\t\t\t\t\treturn execute(...args);\n\t\t\t\t}\n\t\t\t\treturn execute();\n\t\t\t})\n\t\t\t: tap((args: unknown[] | undefined) => {\n\t\t\t\tif (args) {\n\t\t\t\t\texecute(...args);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\texecute();\n\t\t\t});\n\n\t\tpipe$ = pipe$.pipe(\n\t\t\tswitchMap(args => of(args).pipe(\n\t\t\t\texecFn,\n\t\t\t\tfinalize(() => {\n\t\t\t\t\t// console.log(\"[command::executionPipe$] finalize inner#1 - set idle\");\n\t\t\t\t\tthis._isExecuting$.next(false);\n\t\t\t\t}),\n\t\t\t\ttake(1),\n\t\t\t\tcatchError(error => {\n\t\t\t\t\tconsole.error(\"Unhandled execute error\", error);\n\t\t\t\t\treturn EMPTY;\n\t\t\t\t}),\n\t\t\t)),\n\t\t\ttap(\n\t\t\t\t() => {\n\t\t\t\t\t// console.log(\"[command::executionPipe$] tap#2 - set idle\");\n\t\t\t\t\tthis._isExecuting$.next(false);\n\t\t\t\t},\n\t\t\t)\n\t\t);\n\t\treturn pipe$;\n\t}\n\n}\n\n/**\n * Async Command object used to encapsulate information which is needed to perform an action,\n * which takes an execute function as Observable/Promise.\n */\nexport class CommandAsync extends Command {\n\n\tconstructor(\n\t\texecute: (...args: any[]) => Observable<unknown> | Promise<unknown>,\n\t\tcanExecute$?: Observable<boolean>,\n\t) {\n\t\tsuper(execute, canExecute$, true);\n\t}\n\n}\n","import { InjectionToken } from \"@angular/core\";\n\nexport interface CommandOptions {\n\t/**\n\t * Css Class which gets added/removed on the Command element's host while Command `isExecuting$`.\n\t */\n\texecutingCssClass: string;\n\n\t/** Determines whether the disabled will be handled by the directive or not.\n\t * Disable handled by directive's doesn't always play nice when used with other component/pipe/directive and they also handle disabled.\n\t * This disables the handling manually and need to pass explicitly `[disabled]=\"!saveCmd.canExecute\"`.\n\t */\n\thandleDisabled: boolean;\n\n\t/** Determine whether to set a `delay(1)` when setting the disabled. Which might be needed when working with external\n\t * components/directives (such as material button)\n\t */\n\thasDisabledDelay: boolean;\n}\n\nexport const COMMAND_DEFAULT_CONFIG = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n\thasDisabledDelay: false,\n} as CommandOptions);\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective, FormControlStatus } from \"@angular/forms\";\nimport { Observable, of } from \"rxjs\";\nimport { map, distinctUntilChanged, startWith, delay } from \"rxjs/operators\";\n\nimport { CommandCreator, ICommand } from \"./command.model\";\nimport { Command } from \"./command\";\n\n/** Determines whether the arg object is of type `Command`. */\nexport function isCommand(arg: unknown): arg is ICommand {\n\treturn arg instanceof Command;\n}\n\n/** Determines whether the arg object is of type `CommandCreator`. */\nexport function isCommandCreator(arg: unknown): arg is CommandCreator {\n\tif (arg instanceof Command) {\n\t\treturn false;\n\t} else if (isAssumedType<CommandCreator>(arg) && arg.execute && arg.host) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport interface CanExecuteFormOptions {\n\t/** Determines whether to check for validity. (defaults: true) */\n\tvalidity?: boolean;\n\n\t/** Determines whether to check whether UI has been touched. (defaults: true) */\n\tdirty?: boolean;\n}\n\n/** Get form is valid as an observable. */\nexport function canExecuteFromNgForm(\n\tform: AbstractControl | AbstractControlDirective,\n\toptions?: CanExecuteFormOptions\n): Observable<boolean> {\n\tconst opts: CanExecuteFormOptions = { validity: true, dirty: true, ...options };\n\n\treturn form.statusChanges\n\t\t? (form.statusChanges as Observable<FormControlStatus>).pipe( // todo: remove cast when working correctly\n\t\t\tdelay(0),\n\t\t\tstartWith(form.valid),\n\t\t\tmap(() => !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t\t: of(true);\n}\n\nfunction isAssumedType<T = Record<string, unknown>>(x: unknown): x is Partial<T> {\n\treturn x !== null && typeof x === \"object\";\n}\n","import {\n\tDirective,\n\tOnInit,\n\tOnDestroy,\n\tInput,\n\tHostListener,\n\tElementRef,\n\tInject,\n\tRenderer2,\n\tChangeDetectorRef,\n} from \"@angular/core\";\nimport { Subject } from \"rxjs\";\nimport { tap, delay, takeUntil } from \"rxjs/operators\";\n\nimport { CommandOptions, COMMAND_CONFIG } from \"./config\";\nimport { Command } from \"./command\";\nimport { isCommand, isCommandCreator } from \"./command.util\";\nimport { CommandCreator, ICommand } from \"./command.model\";\n\n/**\n * Controls the state of a component in sync with `Command`.\n *\n * @example\n * ### Most common usage\n * ```html\n * <button [ssvCommand]=\"saveCmd\">Save</button>\n * ```\n *\n *\n * ### Usage with options\n * ```html\n * <button [ssvCommand]=\"saveCmd\" [ssvCommandOptions]=\"{executingCssClass: 'in-progress'}\">Save</button>\n * ```\n *\n *\n * ### Usage with params\n * This is useful for collections (loops) or using multiple actions with different args.\n * *NOTE: This will share the `isExecuting` when used with multiple controls.*\n *\n * #### With single param\n *\n * ```html\n * <button [ssvCommand]=\"saveCmd\" [ssvCommandParams]=\"{id: 1}\">Save</button>\n * ```\n * *NOTE: if you have only 1 argument as an array, it should be enclosed within an array e.g. `[['apple', 'banana']]`,\n * else it will spread and you will `arg1: \"apple\", arg2: \"banana\"`*\n *\n * #### With multi params\n * ```html\n * <button [ssvCommand]=\"saveCmd\" [ssvCommandParams]=\"[{id: 1}, 'hello', hero]\">Save</button>\n * ```\n *\n * ### Usage with Command Creator\n * This is useful for collections (loops) or using multiple actions with different args, whilst not sharing `isExecuting`.\n *\n *\n * ```html\n * <button [ssvCommand]=\"{host: this, execute: removeHero$, canExecute: isValid$, params: [hero, 1337, 'xx']}\">Save</button>\n * ```\n *\n */\n\nconst NAME_CAMEL = \"ssvCommand\";\n\n// let nextUniqueId = 0;\n\n@Directive({\n\tselector: `[${NAME_CAMEL}]`,\n\texportAs: NAME_CAMEL\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t// readonly id = `${NAME_CAMEL}-${nextUniqueId++}`;\n\n\t@Input(NAME_CAMEL) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${NAME_CAMEL}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: Partial<CommandOptions>) {\n\t\tif (value === this._commandOptions) {\n\t\t\treturn;\n\t\t}\n\t\tthis._commandOptions = {\n\t\t\t...this.config,\n\t\t\t...value,\n\t\t};\n\t}\n\n\t@Input(`${NAME_CAMEL}Params`) commandParams: unknown | unknown[];\n\n\tget command(): ICommand { return this._command; }\n\tprivate _command!: ICommand;\n\tprivate _commandOptions: CommandOptions = this.config;\n\tprivate _destroy$ = new Subject<void>();\n\n\tconstructor(\n\t\t@Inject(COMMAND_CONFIG) private config: CommandOptions,\n\t\tprivate renderer: Renderer2,\n\t\tprivate element: ElementRef,\n\t\tprivate cdr: ChangeDetectorRef,\n\t) { }\n\n\tngOnInit(): void {\n\t\t// console.log(\"[ssvCommand::init]\", this.config);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(`${NAME_CAMEL}: [${NAME_CAMEL}] should be defined!`);\n\t\t} else if (isCommand(this.commandOrCreator)) {\n\t\t\tthis._command = this.commandOrCreator;\n\t\t} else if (isCommandCreator(this.commandOrCreator)) {\n\t\t\tconst isAsync = this.commandOrCreator.isAsync || this.commandOrCreator.isAsync === undefined;\n\n\t\t\t// todo: find something like this for ivy (or angular10+)\n\t\t\t// const hostComponent = (this.viewContainer as any)._view.component;\n\n\t\t\tconst execFn = this.commandOrCreator.execute.bind(this.commandOrCreator.host);\n\t\t\tthis.commandParams = this.commandParams || this.commandOrCreator.params;\n\n\t\t\tconst canExec = this.commandOrCreator.canExecute instanceof Function\n\t\t\t\t? this.commandOrCreator.canExecute.bind(this.commandOrCreator.host, this.commandParams)()\n\t\t\t\t: this.commandOrCreator.canExecute;\n\n\t\t\t// console.log(\"[ssvCommand::init] command creator\", {\n\t\t\t// \tfirstParam: this.commandParams ? this.commandParams[0] : null,\n\t\t\t// \tparams: this.commandParams\n\t\t\t// });\n\t\t\tthis._command = new Command(execFn, canExec, isAsync);\n\t\t} else {\n\t\t\tthrow new Error(`${NAME_CAMEL}: [${NAME_CAMEL}] is not defined properly!`);\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tthis.commandOptions.hasDisabledDelay\n\t\t\t\t? delay(1)\n\t\t\t\t: tap(() => { /* stub */ }),\n\t\t\ttap(x => {\n\t\t\t\tthis.trySetDisabled(!x);\n\t\t\t\t// console.log(\"[ssvCommand::canExecute$]\", { canExecute: x });\n\t\t\t\tthis.cdr.markForCheck();\n\t\t\t}),\n\t\t\ttakeUntil(this._destroy$),\n\t\t).subscribe();\n\n\t\tif (this._command.isExecuting$) {\n\t\t\tthis._command.isExecuting$.pipe(\n\t\t\t\ttap(x => {\n\t\t\t\t\t// console.log(\"[ssvCommand::isExecuting$]\", x, this.commandOptions);\n\t\t\t\t\tif (x) {\n\t\t\t\t\t\tthis.renderer.addClass(\n\t\t\t\t\t\t\tthis.element.nativeElement,\n\t\t\t\t\t\t\tthis.commandOptions.executingCssClass\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.renderer.removeClass(\n\t\t\t\t\t\t\tthis.element.nativeElement,\n\t\t\t\t\t\t\tthis.commandOptions.executingCssClass\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this._destroy$),\n\t\t\t).subscribe();\n\t\t}\n\t}\n\n\t@HostListener(\"click\")\n\tonClick(): void {\n\t\t// console.log(\"[ssvCommand::onClick]\", this.commandParams);\n\t\tif (Array.isArray(this.commandParams)) {\n\t\t\tthis._command.execute(...this.commandParams);\n\t\t} else {\n\t\t\tthis._command.execute(this.commandParams);\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\t// console.log(\"[ssvCommand::destroy]\");\n\t\tthis._destroy$.next();\n\t\tthis._destroy$.complete();\n\t\tif (this._command) {\n\t\t\tthis._command.unsubscribe();\n\t\t}\n\t}\n\n\tprivate trySetDisabled(disabled: boolean) {\n\t\tif (this.commandOptions.handleDisabled) {\n\t\t\t// console.warn(\">>>> disabled\", { id: this.id, disabled });\n\t\t\tthis.renderer.setProperty(this.element.nativeElement, \"disabled\", disabled);\n\t\t}\n\t}\n\n}\n\n","import { Observable } from \"rxjs\";\nimport { Directive, OnInit, OnDestroy, Input } from \"@angular/core\";\n\nimport { ICommand, CommandCreator } from \"./command.model\";\nimport { isCommandCreator } from \"./command.util\";\nimport { Command } from \"./command\";\n\nconst NAME_CAMEL = \"ssvCommandRef\";\n\n/**\n * Command creator ref, directive which allows creating Command in the template\n * and associate it to a command (in order to share executions).\n * @example\n * ### Most common usage\n * ```html\n * <div #actionCmd=\"ssvCommandRef\" [ssvCommandRef]=\"{host: this, execute: removeHero$, canExecute: isValid$}\">\n * <button [ssvCommand]=\"actionCmd.command\" [ssvCommandParams]=\"hero\">\n * Remove\n * </button>\n * <button [ssvCommand]=\"actionCmd.command\" [ssvCommandParams]=\"hero\">\n * Remove\n * </button>\n * </div>\n * ```\n *\n */\n@Directive({\n\tselector: `[${NAME_CAMEL}]`,\n\texportAs: NAME_CAMEL\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(NAME_CAMEL) commandCreator: CommandCreator | undefined;\n\n\tget command(): ICommand { return this._command; }\n\tprivate _command!: ICommand;\n\n\tngOnInit(): void {\n\t\tif (isCommandCreator(this.commandCreator)) {\n\t\t\tconst isAsync = this.commandCreator.isAsync || this.commandCreator.isAsync === undefined;\n\n\t\t\tconst execFn = this.commandCreator.execute.bind(this.commandCreator.host);\n\t\t\tthis._command = new Command(execFn, this.commandCreator.canExecute as Observable<boolean> | undefined, isAsync);\n\t\t} else {\n\t\t\tthrow new Error(`${NAME_CAMEL}: [${NAME_CAMEL}] is not defined properly!`);\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\t// console.log(\"[commandRef::destroy]\");\n\t\tif (this._command) {\n\t\t\tthis._command.destroy();\n\t\t}\n\t}\n\n}\n","import { NgModule, ModuleWithProviders, InjectionToken, Optional } from \"@angular/core\";\n\nimport { CommandDirective } from \"./command.directive\";\nimport { CommandRefDirective } from \"./command-ref.directive\";\nimport { CommandOptions, COMMAND_DEFAULT_CONFIG, COMMAND_CONFIG } from \"./config\";\n\n/** @internal */\nexport const MODULE_CONFIG_DATA = new InjectionToken<CommandOptions>(\"@ssv/ngx.command/configData\");\n\nconst components = [\n\tCommandDirective,\n\tCommandRefDirective\n];\n\n@NgModule({\n\tdeclarations: components,\n\tproviders: [\n\t\t{ provide: COMMAND_CONFIG, useFactory: _moduleConfigFactory, deps: [[MODULE_CONFIG_DATA, new Optional()]] },\n\t],\n\texports: [...components],\n})\nexport class SsvCommandModule {\n\n\tstatic forRoot(config?: Partial<CommandOptions> | (() => Partial<CommandOptions>)): ModuleWithProviders<SsvCommandModule> {\n\t\treturn {\n\t\t\tngModule: SsvCommandModule,\n\t\t\tproviders: [\n\t\t\t\t{ provide: MODULE_CONFIG_DATA, useValue: config },\n\t\t\t],\n\t\t};\n\t}\n\n}\n\n/** @internal */\nexport function _moduleConfigFactory(config: CommandOptions | (() => CommandOptions)): CommandOptions {\n\tconst cfg = typeof config === \"function\" ? config() : config;\n\treturn cfg\n\t\t? {\n\t\t\t...COMMAND_DEFAULT_CONFIG,\n\t\t\t...cfg,\n\t\t}\n\t\t: COMMAND_DEFAULT_CONFIG;\n}\n","export const VERSION = \"2.3.2\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NAME_CAMEL"],"mappings":";;;;;AAAA;AAKA;;AAEG;MACU,OAAO,CAAA;AAgCnB;;;;;;AAMG;AACH,IAAA,WAAA,CACC,OAAwC,EACxC,WAAiC,EACjC,OAAiB,EAAA;;QAxBlB,IAAW,CAAA,WAAA,GAAG,IAAI,CAAC;AAKX,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;QACpD,IAAY,CAAA,YAAA,GAAG,KAAK,CAAC;QACrB,IAAW,CAAA,WAAA,GAAG,IAAI,CAAC;AACnB,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,OAAO,EAAyB,CAAC;AACtD,QAAA,IAAA,CAAA,aAAa,GAAG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U,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC,kBAAkB,EAAE,IAAI,QAAQ,EAAE,CAAC,CAAC,EAAE;AAC3G,KAAA,EAAA,CAAA,CAAA;2FAGW,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAP5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE,UAAU;AACxB,oBAAA,SAAS,EAAE;AACV,wBAAA,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC,kBAAkB,EAAE,IAAI,QAAQ,EAAE,CAAC,CAAC,EAAE;AAC3G,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACxB,iBAAA,CAAA;;AAcD;AACM,SAAU,oBAAoB,CAAC,MAA+C,EAAA;AACnF,IAAA,MAAM,GAAG,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AAC7D,IAAA,OAAO,GAAG;AACT,UAAE;AACD,YAAA,GAAG,sBAAsB;AACzB,YAAA,GAAG,GAAG;AACN,SAAA;UACC,sBAAsB,CAAC;AAC3B;;AC3CO,MAAM,OAAO,GAAG;;ACAvB;;AAEG;;;;"}
|
package/module.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders, InjectionToken } from "@angular/core";
|
|
2
|
-
import { CommandOptions } from "./config";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./command.directive";
|
|
5
|
-
import * as i2 from "./command-ref.directive";
|
|
6
|
-
/** @internal */
|
|
7
|
-
export declare const MODULE_CONFIG_DATA: InjectionToken<CommandOptions>;
|
|
8
|
-
export declare class SsvCommandModule {
|
|
9
|
-
static forRoot(config?: Partial<CommandOptions> | (() => Partial<CommandOptions>)): ModuleWithProviders<SsvCommandModule>;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SsvCommandModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SsvCommandModule, [typeof i1.CommandDirective, typeof i2.CommandRefDirective], never, [typeof i1.CommandDirective, typeof i2.CommandRefDirective]>;
|
|
12
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<SsvCommandModule>;
|
|
13
|
-
}
|
|
14
|
-
/** @internal */
|
|
15
|
-
export declare function _moduleConfigFactory(config: CommandOptions | (() => CommandOptions)): CommandOptions;
|
package/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const VERSION = "2.3.2";
|