@ssv/ngx.command 2.0.0 → 2.1.0-dev228
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/CHANGELOG.md +6 -0
- package/bundles/ssv-ngx.command.umd.js +2 -2
- package/bundles/ssv-ngx.command.umd.js.map +1 -1
- package/bundles/ssv-ngx.command.umd.min.js +1 -1
- package/bundles/ssv-ngx.command.umd.min.js.map +1 -1
- package/esm2015/command.util.js +3 -3
- package/esm2015/version.js +2 -2
- package/fesm2015/ssv-ngx.command.js +3 -3
- package/fesm2015/ssv-ngx.command.js.map +1 -1
- package/package.json +1 -1
- package/ssv-ngx.command.metadata.json +1 -1
- package/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<!-- ## [vNext](https://github.com/sktch7/ngx.command/compare/2.0.0...3.0.0) (2020-x-x) -->
|
|
2
2
|
|
|
3
|
+
## [2.1.0](https://github.com/sketch7/ngx.command/compare/2.0.0...2.1.0) (2022-07-12)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **util:** `canExecuteFromNgForm` now have delay(0) which is fixing issue when observable `form.statusChanges` wasn't triggered after reset or make pristine form from the code.
|
|
8
|
+
|
|
3
9
|
## [2.0.0](https://github.com/sketch7/ngx.command/compare/1.6.0...2.0.0) (2021-08-25)
|
|
4
10
|
|
|
5
11
|
### Features
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
function canExecuteFromNgForm(form, options) {
|
|
476
476
|
var opts = Object.assign({ validity: true, dirty: true }, options);
|
|
477
477
|
return form.statusChanges
|
|
478
|
-
? form.statusChanges.pipe(operators.startWith(form.valid), operators.map(function () { return !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty); }), operators.distinctUntilChanged())
|
|
478
|
+
? form.statusChanges.pipe(operators.delay(0), operators.startWith(form.valid), operators.map(function () { return !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty); }), operators.distinctUntilChanged())
|
|
479
479
|
: rxjs.of(true);
|
|
480
480
|
}
|
|
481
481
|
function isAssumedType(x) {
|
|
@@ -728,7 +728,7 @@
|
|
|
728
728
|
? Object.assign(Object.assign({}, COMMAND_DEFAULT_CONFIG), cfg) : COMMAND_DEFAULT_CONFIG;
|
|
729
729
|
}
|
|
730
730
|
|
|
731
|
-
var VERSION = "2.
|
|
731
|
+
var VERSION = "2.1.0-dev228";
|
|
732
732
|
|
|
733
733
|
/**
|
|
734
734
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssv-ngx.command.umd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../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":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Observable, combineLatest, Subscription, Subject, BehaviorSubject, of, EMPTY } from \"rxjs\";\nimport { tap, map, filter, switchMap, catchError, finalize, first } 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\tfirst(),\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: unknown[]) => 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\nexport const COMMAND_DEFAULT_CONFIG: Readonly<CommandOptions> = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n});\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective } from \"@angular/forms\";\nimport { Observable, of } from \"rxjs\";\nimport { map, distinctUntilChanged, startWith } 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.pipe(\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 SELECTOR = \"ssvCommand\";\n\n@Directive({\n\tselector: `[${SELECTOR}]`,\n\texportAs: \"ssvCommand\"\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t@Input(SELECTOR) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${SELECTOR}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: 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(`${SELECTOR}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\tthis.trySetDisabled(true);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(\"ssvCommand: [ssvCommand] 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(\"ssvCommand: [ssvCommand] is not defined properly!\");\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tdelay(1),\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\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\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: \"[ssvCommandRef]\",\n\texportAs: \"ssvCommandRef\"\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(\"ssvCommandRef\") 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(\"ssvCommandRef: [ssvCommandRef] 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.0.0\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BehaviorSubject","Subject","Subscription","combineLatest","map","tap","filter","switchMap","of","finalize","first","catchError","EMPTY","InjectionToken","startWith","distinctUntilChanged","delay","takeUntil","Directive","Inject","Renderer2","ElementRef","ChangeDetectorRef","Input","HostListener","NgModule","Optional"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC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F;;QAEQ,wBAAO,GAAd,UAAe,MAAkE;YAChF,OAAO;gBACN,QAAQ,EAAE,gBAAgB;gBAC1B,SAAS,EAAE;oBACV,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE;iBACjD;aACD,CAAC;SACF;;;;gBAhBDY,aAAQ,SAAC;oBACT,YAAY,EAAE,UAAU;oBACxB,SAAS,EAAE;wBACV,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC,kBAAkB,EAAE,IAAIC,aAAQ,EAAE,CAAC,CAAC,EAAE;qBAC3G;oBACD,OAAO,WAAM,UAAU,CAAC;iBACxB;;IAcD;aACgB,oBAAoB,CAAC,MAA+C;QACnF,IAAM,GAAG,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAC7D,OAAO,GAAG;8CAEL,sBAAsB,GACtB,GAAG,IAEL,sBAAsB,CAAC;IAC3B;;QC3Ca,OAAO,GAAG;;ICAvB;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ssv-ngx.command.umd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../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":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Observable, combineLatest, Subscription, Subject, BehaviorSubject, of, EMPTY } from \"rxjs\";\nimport { tap, map, filter, switchMap, catchError, finalize, first } 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\tfirst(),\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: unknown[]) => 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\nexport const COMMAND_DEFAULT_CONFIG: Readonly<CommandOptions> = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n});\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective } 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.pipe(\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 SELECTOR = \"ssvCommand\";\n\n@Directive({\n\tselector: `[${SELECTOR}]`,\n\texportAs: \"ssvCommand\"\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t@Input(SELECTOR) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${SELECTOR}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: 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(`${SELECTOR}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\tthis.trySetDisabled(true);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(\"ssvCommand: [ssvCommand] 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(\"ssvCommand: [ssvCommand] is not defined properly!\");\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tdelay(1),\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\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\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: \"[ssvCommandRef]\",\n\texportAs: \"ssvCommandRef\"\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(\"ssvCommandRef\") 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(\"ssvCommandRef: [ssvCommandRef] 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.1.0-dev228\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BehaviorSubject","Subject","Subscription","combineLatest","map","tap","filter","switchMap","of","finalize","first","catchError","EMPTY","InjectionToken","delay","startWith","distinctUntilChanged","takeUntil","Directive","Inject","Renderer2","ElementRef","ChangeDetectorRef","Input","HostListener","NgModule","Optional"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,C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ECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};Object.create;function i(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}Object.create;var c=function(){function t(t,r,o){var s=this;this.autoDestroy=!0,this._isExecuting$=new e.BehaviorSubject(!1),this._isExecuting=!1,this._canExecute=!0,this.executionPipe$=new e.Subject,this.isExecuting$$=e.Subscription.EMPTY,this.canExecute$$=e.Subscription.EMPTY,this.executionPipe$$=e.Subscription.EMPTY,this.subscribersCount=0,r?(this.canExecute$=e.combineLatest([this._isExecuting$,r]).pipe(n.map((function(t){var e=i(t,2),n=e[0],r=e[1];return s._isExecuting=n,s._canExecute=!n&&!!r,s._canExecute}))),this.canExecute$$=this.canExecute$.subscribe()):(this.canExecute$=this._isExecuting$.pipe(n.map((function(t){var e=!t;return s._canExecute=e,e}))),this.isExecuting$$=this._isExecuting$.pipe(n.tap((function(t){return s._isExecuting=t}))).subscribe()),this.executionPipe$$=this.buildExecutionPipe(t,o).subscribe()}return Object.defineProperty(t.prototype,"isExecuting",{get:function(){return this._isExecuting},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canExecute",{get:function(){return this._canExecute},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isExecuting$",{get:function(){return this._isExecuting$.asObservable()},enumerable:!1,configurable:!0}),t.prototype.execute=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.executionPipe$.next(t)},t.prototype.destroy=function(){this.executionPipe$$.unsubscribe(),this.canExecute$$.unsubscribe(),this.isExecuting$$.unsubscribe()},t.prototype.subscribe=function(){this.subscribersCount++},t.prototype.unsubscribe=function(){this.subscribersCount--,this.autoDestroy&&this.subscribersCount<=0&&this.destroy()},t.prototype.buildExecutionPipe=function(t,r){var o=this,i=this.executionPipe$.pipe(n.filter((function(){return o._canExecute})),n.tap((function(){o._isExecuting$.next(!0)}))),c=r?n.switchMap((function(e){return e?t.apply(void 0,s(e)):t()})):n.tap((function(e){e?t.apply(void 0,s(e)):t()}));return i=i.pipe(n.switchMap((function(t){return e.of(t).pipe(c,n.finalize((function(){o._isExecuting$.next(!1)})),n.first(),n.catchError((function(t){return console.error("Unhandled execute error",t),e.EMPTY})))})),n.tap((function(){o._isExecuting$.next(!1)})))},t}(),a=function(t){function e(e,n){return t.call(this,e,n,!0)||this}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}(c),u=Object.freeze({executingCssClass:"executing",handleDisabled:!0}),m=new r.InjectionToken("command-config");function d(t){return t instanceof c}function p(t){return!(t instanceof c)&&!(null===(e=t)||"object"!=typeof e||!t.execute||!t.host);var e}var f="ssvCommand",h=function(){function t(t,n,r,o){this.config=t,this.renderer=n,this.element=r,this.cdr=o,this._commandOptions=this.config,this._destroy$=new e.Subject}return Object.defineProperty(t.prototype,"commandOptions",{get:function(){return this._commandOptions},set:function(t){t!==this._commandOptions&&(this._commandOptions=Object.assign(Object.assign({},this.config),t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"command",{get:function(){return this._command},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;if(this.trySetDisabled(!0),!this.commandOrCreator)throw new Error("ssvCommand: [ssvCommand] should be defined!");if(d(this.commandOrCreator))this._command=this.commandOrCreator;else{if(!p(this.commandOrCreator))throw new Error("ssvCommand: [ssvCommand] is not defined properly!");var e=this.commandOrCreator.isAsync||void 0===this.commandOrCreator.isAsync,r=this.commandOrCreator.execute.bind(this.commandOrCreator.host);this.commandParams=this.commandParams||this.commandOrCreator.params;var o=this.commandOrCreator.canExecute instanceof Function?this.commandOrCreator.canExecute.bind(this.commandOrCreator.host,this.commandParams)():this.commandOrCreator.canExecute;this._command=new c(r,o,e)}this._command.subscribe(),this._command.canExecute$.pipe(n.delay(1),n.tap((function(e){t.trySetDisabled(!e),t.cdr.markForCheck()})),n.takeUntil(this._destroy$)).subscribe(),this._command.isExecuting$&&this._command.isExecuting$.pipe(n.tap((function(e){e?t.renderer.addClass(t.element.nativeElement,t.commandOptions.executingCssClass):t.renderer.removeClass(t.element.nativeElement,t.commandOptions.executingCssClass)})),n.takeUntil(this._destroy$)).subscribe()},t.prototype.onClick=function(){var t;Array.isArray(this.commandParams)?(t=this._command).execute.apply(t,s(this.commandParams)):this._command.execute(this.commandParams)},t.prototype.ngOnDestroy=function(){this._destroy$.next(),this._destroy$.complete(),this._command&&this._command.unsubscribe()},t.prototype.trySetDisabled=function(t){this.commandOptions.handleDisabled&&this.renderer.setProperty(this.element.nativeElement,"disabled",t)},t}();h.decorators=[{type:r.Directive,args:[{selector:"[ssvCommand]",exportAs:"ssvCommand"}]}],h.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.Inject,args:[m]}]},{type:r.Renderer2},{type:r.ElementRef},{type:r.ChangeDetectorRef}]},h.propDecorators={commandOrCreator:[{type:r.Input,args:[f]}],commandOptions:[{type:r.Input,args:[f+"Options"]}],commandParams:[{type:r.Input,args:[f+"Params"]}],onClick:[{type:r.HostListener,args:["click"]}]};var l=function(){function t(){}return Object.defineProperty(t.prototype,"command",{get:function(){return this._command},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){if(!p(this.commandCreator))throw new Error("ssvCommandRef: [ssvCommandRef] is not defined properly!");var t=this.commandCreator.isAsync||void 0===this.commandCreator.isAsync,e=this.commandCreator.execute.bind(this.commandCreator.host);this._command=new c(e,this.commandCreator.canExecute,t)},t.prototype.ngOnDestroy=function(){this._command&&this._command.destroy()},t}();l.decorators=[{type:r.Directive,args:[{selector:"[ssvCommandRef]",exportAs:"ssvCommandRef"}]}],l.propDecorators={commandCreator:[{type:r.Input,args:["ssvCommandRef"]}]};var y=new r.InjectionToken("@ssv/ngx.command/configData"),b=[h,l],x=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:y,useValue:e}]}},t}();function g(t){var e="function"==typeof t?t():t;return e?Object.assign(Object.assign({},u),e):u}x.decorators=[{type:r.NgModule,args:[{declarations:b,providers:[{provide:m,useFactory:g,deps:[[y,new r.Optional]]}],exports:s(b)}]}];t.COMMAND_CONFIG=m,t.COMMAND_DEFAULT_CONFIG=u,t.Command=c,t.CommandAsync=a,t.CommandDirective=h,t.CommandRefDirective=l,t.MODULE_CONFIG_DATA=y,t.SsvCommandModule=x,t.VERSION="2.
|
|
15
|
+
***************************************************************************** */var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};Object.create;function i(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}Object.create;var c=function(){function t(t,r,o){var s=this;this.autoDestroy=!0,this._isExecuting$=new e.BehaviorSubject(!1),this._isExecuting=!1,this._canExecute=!0,this.executionPipe$=new e.Subject,this.isExecuting$$=e.Subscription.EMPTY,this.canExecute$$=e.Subscription.EMPTY,this.executionPipe$$=e.Subscription.EMPTY,this.subscribersCount=0,r?(this.canExecute$=e.combineLatest([this._isExecuting$,r]).pipe(n.map((function(t){var e=i(t,2),n=e[0],r=e[1];return s._isExecuting=n,s._canExecute=!n&&!!r,s._canExecute}))),this.canExecute$$=this.canExecute$.subscribe()):(this.canExecute$=this._isExecuting$.pipe(n.map((function(t){var e=!t;return s._canExecute=e,e}))),this.isExecuting$$=this._isExecuting$.pipe(n.tap((function(t){return s._isExecuting=t}))).subscribe()),this.executionPipe$$=this.buildExecutionPipe(t,o).subscribe()}return Object.defineProperty(t.prototype,"isExecuting",{get:function(){return this._isExecuting},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canExecute",{get:function(){return this._canExecute},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isExecuting$",{get:function(){return this._isExecuting$.asObservable()},enumerable:!1,configurable:!0}),t.prototype.execute=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.executionPipe$.next(t)},t.prototype.destroy=function(){this.executionPipe$$.unsubscribe(),this.canExecute$$.unsubscribe(),this.isExecuting$$.unsubscribe()},t.prototype.subscribe=function(){this.subscribersCount++},t.prototype.unsubscribe=function(){this.subscribersCount--,this.autoDestroy&&this.subscribersCount<=0&&this.destroy()},t.prototype.buildExecutionPipe=function(t,r){var o=this,i=this.executionPipe$.pipe(n.filter((function(){return o._canExecute})),n.tap((function(){o._isExecuting$.next(!0)}))),c=r?n.switchMap((function(e){return e?t.apply(void 0,s(e)):t()})):n.tap((function(e){e?t.apply(void 0,s(e)):t()}));return i=i.pipe(n.switchMap((function(t){return e.of(t).pipe(c,n.finalize((function(){o._isExecuting$.next(!1)})),n.first(),n.catchError((function(t){return console.error("Unhandled execute error",t),e.EMPTY})))})),n.tap((function(){o._isExecuting$.next(!1)})))},t}(),a=function(t){function e(e,n){return t.call(this,e,n,!0)||this}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}(c),u=Object.freeze({executingCssClass:"executing",handleDisabled:!0}),m=new r.InjectionToken("command-config");function d(t){return t instanceof c}function p(t){return!(t instanceof c)&&!(null===(e=t)||"object"!=typeof e||!t.execute||!t.host);var e}var f="ssvCommand",h=function(){function t(t,n,r,o){this.config=t,this.renderer=n,this.element=r,this.cdr=o,this._commandOptions=this.config,this._destroy$=new e.Subject}return Object.defineProperty(t.prototype,"commandOptions",{get:function(){return this._commandOptions},set:function(t){t!==this._commandOptions&&(this._commandOptions=Object.assign(Object.assign({},this.config),t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"command",{get:function(){return this._command},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;if(this.trySetDisabled(!0),!this.commandOrCreator)throw new Error("ssvCommand: [ssvCommand] should be defined!");if(d(this.commandOrCreator))this._command=this.commandOrCreator;else{if(!p(this.commandOrCreator))throw new Error("ssvCommand: [ssvCommand] is not defined properly!");var e=this.commandOrCreator.isAsync||void 0===this.commandOrCreator.isAsync,r=this.commandOrCreator.execute.bind(this.commandOrCreator.host);this.commandParams=this.commandParams||this.commandOrCreator.params;var o=this.commandOrCreator.canExecute instanceof Function?this.commandOrCreator.canExecute.bind(this.commandOrCreator.host,this.commandParams)():this.commandOrCreator.canExecute;this._command=new c(r,o,e)}this._command.subscribe(),this._command.canExecute$.pipe(n.delay(1),n.tap((function(e){t.trySetDisabled(!e),t.cdr.markForCheck()})),n.takeUntil(this._destroy$)).subscribe(),this._command.isExecuting$&&this._command.isExecuting$.pipe(n.tap((function(e){e?t.renderer.addClass(t.element.nativeElement,t.commandOptions.executingCssClass):t.renderer.removeClass(t.element.nativeElement,t.commandOptions.executingCssClass)})),n.takeUntil(this._destroy$)).subscribe()},t.prototype.onClick=function(){var t;Array.isArray(this.commandParams)?(t=this._command).execute.apply(t,s(this.commandParams)):this._command.execute(this.commandParams)},t.prototype.ngOnDestroy=function(){this._destroy$.next(),this._destroy$.complete(),this._command&&this._command.unsubscribe()},t.prototype.trySetDisabled=function(t){this.commandOptions.handleDisabled&&this.renderer.setProperty(this.element.nativeElement,"disabled",t)},t}();h.decorators=[{type:r.Directive,args:[{selector:"[ssvCommand]",exportAs:"ssvCommand"}]}],h.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.Inject,args:[m]}]},{type:r.Renderer2},{type:r.ElementRef},{type:r.ChangeDetectorRef}]},h.propDecorators={commandOrCreator:[{type:r.Input,args:[f]}],commandOptions:[{type:r.Input,args:[f+"Options"]}],commandParams:[{type:r.Input,args:[f+"Params"]}],onClick:[{type:r.HostListener,args:["click"]}]};var l=function(){function t(){}return Object.defineProperty(t.prototype,"command",{get:function(){return this._command},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){if(!p(this.commandCreator))throw new Error("ssvCommandRef: [ssvCommandRef] is not defined properly!");var t=this.commandCreator.isAsync||void 0===this.commandCreator.isAsync,e=this.commandCreator.execute.bind(this.commandCreator.host);this._command=new c(e,this.commandCreator.canExecute,t)},t.prototype.ngOnDestroy=function(){this._command&&this._command.destroy()},t}();l.decorators=[{type:r.Directive,args:[{selector:"[ssvCommandRef]",exportAs:"ssvCommandRef"}]}],l.propDecorators={commandCreator:[{type:r.Input,args:["ssvCommandRef"]}]};var y=new r.InjectionToken("@ssv/ngx.command/configData"),b=[h,l],x=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:y,useValue:e}]}},t}();function g(t){var e="function"==typeof t?t():t;return e?Object.assign(Object.assign({},u),e):u}x.decorators=[{type:r.NgModule,args:[{declarations:b,providers:[{provide:m,useFactory:g,deps:[[y,new r.Optional]]}],exports:s(b)}]}];t.COMMAND_CONFIG=m,t.COMMAND_DEFAULT_CONFIG=u,t.Command=c,t.CommandAsync=a,t.CommandDirective=h,t.CommandRefDirective=l,t.MODULE_CONFIG_DATA=y,t.SsvCommandModule=x,t.VERSION="2.1.0-dev228",t._moduleConfigFactory=g,t.canExecuteFromNgForm=function(t,r){var o=Object.assign({validity:!0,dirty:!0},r);return t.statusChanges?t.statusChanges.pipe(n.delay(0),n.startWith(t.valid),n.map((function(){return!(o.validity&&!t.valid||o.dirty&&!t.dirty)})),n.distinctUntilChanged()):e.of(!0)},t.isCommand=d,t.isCommandCreator=p,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=ssv-ngx.command.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../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"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","create","__read","o","n","m","Symbol","iterator","r","e","i","ar","next","done","push","value","error","__spread","arguments","length","concat","Command","execute","canExecute$","isAsync","_this","this","autoDestroy","_isExecuting$","BehaviorSubject","_isExecuting","_canExecute","executionPipe$","Subject","isExecuting$$","Subscription","EMPTY","canExecute$$","executionPipe$$","subscribersCount","combineLatest","pipe","map","_a","_b","isExecuting","canExecuteResult","subscribe","x","canExecute","tap","buildExecutionPipe","defineProperty","asObservable","args","_i","destroy","unsubscribe","pipe$","filter","execFn","switchMap","apply","of","finalize","first","catchError","console","CommandAsync","_super","__","constructor","__extends","COMMAND_DEFAULT_CONFIG","freeze","executingCssClass","handleDisabled","COMMAND_CONFIG","InjectionToken","isCommand","arg","isCommandCreator","host","SELECTOR","CommandDirective","config","renderer","element","cdr","_commandOptions","_destroy$","assign","_command","ngOnInit","trySetDisabled","commandOrCreator","Error","undefined","bind","commandParams","params","canExec","Function","delay","markForCheck","takeUntil","isExecuting$","addClass","nativeElement","commandOptions","removeClass","onClick","isArray","ngOnDestroy","complete","disabled","setProperty","Directive","selector","exportAs","Inject","Renderer2","ElementRef","ChangeDetectorRef","Input","HostListener","CommandRefDirective","commandCreator","MODULE_CONFIG_DATA","components","SsvCommandModule","forRoot","ngModule","providers","provide","useValue","_moduleConfigFactory","cfg","NgModule","declarations","useFactory","deps","Optional","exports","form","options","opts","validity","dirty","statusChanges","startWith","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L,EAAKE,QAASJ,EAAKI,UACrEI,EAAAA,wBAECzF,EAAAA,IAAG","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Observable, combineLatest, Subscription, Subject, BehaviorSubject, of, EMPTY } from \"rxjs\";\nimport { tap, map, filter, switchMap, catchError, finalize, first } 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\tfirst(),\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: unknown[]) => 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\nexport const COMMAND_DEFAULT_CONFIG: Readonly<CommandOptions> = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n});\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective } from \"@angular/forms\";\nimport { Observable, of } from \"rxjs\";\nimport { map, distinctUntilChanged, startWith } 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.pipe(\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 SELECTOR = \"ssvCommand\";\n\n@Directive({\n\tselector: `[${SELECTOR}]`,\n\texportAs: \"ssvCommand\"\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t@Input(SELECTOR) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${SELECTOR}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: 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(`${SELECTOR}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\tthis.trySetDisabled(true);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(\"ssvCommand: [ssvCommand] 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(\"ssvCommand: [ssvCommand] is not defined properly!\");\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tdelay(1),\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\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\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: \"[ssvCommandRef]\",\n\texportAs: \"ssvCommandRef\"\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(\"ssvCommandRef\") 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(\"ssvCommandRef: [ssvCommandRef] 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.0.0\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../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"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","create","__read","o","n","m","Symbol","iterator","r","e","i","ar","next","done","push","value","error","__spread","arguments","length","concat","Command","execute","canExecute$","isAsync","_this","this","autoDestroy","_isExecuting$","BehaviorSubject","_isExecuting","_canExecute","executionPipe$","Subject","isExecuting$$","Subscription","EMPTY","canExecute$$","executionPipe$$","subscribersCount","combineLatest","pipe","map","_a","_b","isExecuting","canExecuteResult","subscribe","x","canExecute","tap","buildExecutionPipe","defineProperty","asObservable","args","_i","destroy","unsubscribe","pipe$","filter","execFn","switchMap","apply","of","finalize","first","catchError","console","CommandAsync","_super","__","constructor","__extends","COMMAND_DEFAULT_CONFIG","freeze","executingCssClass","handleDisabled","COMMAND_CONFIG","InjectionToken","isCommand","arg","isCommandCreator","host","SELECTOR","CommandDirective","config","renderer","element","cdr","_commandOptions","_destroy$","assign","_command","ngOnInit","trySetDisabled","commandOrCreator","Error","undefined","bind","commandParams","params","canExec","Function","delay","markForCheck","takeUntil","isExecuting$","addClass","nativeElement","commandOptions","removeClass","onClick","isArray","ngOnDestroy","complete","disabled","setProperty","Directive","selector","exportAs","Inject","Renderer2","ElementRef","ChangeDetectorRef","Input","HostListener","CommandRefDirective","commandCreator","MODULE_CONFIG_DATA","components","SsvCommandModule","forRoot","ngModule","providers","provide","useValue","_moduleConfigFactory","cfg","NgModule","declarations","useFactory","deps","Optional","exports","form","options","opts","validity","dirty","statusChanges","startWith","valid","distinctUntilChanged"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,IAqFCC,OAAOQ,gBAwBpBC,EAAOC,EAAGC,GACtB,IAAIC,EAAsB,mBAAXC,QAAyBH,EAAEG,OAAOC,UACjD,IAAKF,EAAG,OAAOF,EACf,IAAmBK,EAAYC,EAA3BC,EAAIL,EAAEL,KAAKG,GAAOQ,EAAK,GAC3B,IACI,WAAc,IAANP,GAAgBA,KAAM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,EAAqB,IAAIlD,EAAAA,eAA+B,+BAE/DmD,EAAa,CAClB7C,EACA0C,gBAUD,SAAAI,YAEQA,EAAAC,QAAP,SAAe9C,GACd,MAAO,CACN+C,SAAUF,EACVG,UAAW,CACV,CAAEC,QAASN,EAAoBO,SAAUlD,oBAQ7BmD,EAAqBnD,GACpC,IAAMoD,EAAwB,mBAAXpD,EAAwBA,IAAWA,EACtD,OAAOoD,iCAEFhE,GACAgE,GAEFhE,sBA5BHiE,EAAAA,SAAQpF,KAAA,CAAC,CACTqF,aAAcV,EACdI,UAAW,CACV,CAAEC,QAASzD,EAAgB+D,WAAYJ,EAAsBK,KAAM,CAAC,CAACb,EAAoB,IAAIc,EAAAA,aAE9FC,QAAO9H,EAAMgH,qLCnBS,wEJgCtBe,EACAC,GAEA,IAAMC,EAAIzJ,OAAAkG,OAAA,CAA4BwD,UAAU,EAAMC,OAAO,GAASH,GAEtE,OAAOD,EAAKK,cACTL,EAAKK,cAAc5G,KACpB8D,EAAAA,MAAM,GACN+C,EAAAA,UAAUN,EAAKO,OACf7G,EAAAA,KAAI,WAAM,QAAIwG,EAAKC,WAAYH,EAAKO,OAAcL,EAAKE,QAASJ,EAAKI,UACrEI,EAAAA,wBAECzF,EAAAA,IAAG","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Observable, combineLatest, Subscription, Subject, BehaviorSubject, of, EMPTY } from \"rxjs\";\nimport { tap, map, filter, switchMap, catchError, finalize, first } 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\tfirst(),\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: unknown[]) => 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\nexport const COMMAND_DEFAULT_CONFIG: Readonly<CommandOptions> = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n});\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective } 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.pipe(\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 SELECTOR = \"ssvCommand\";\n\n@Directive({\n\tselector: `[${SELECTOR}]`,\n\texportAs: \"ssvCommand\"\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t@Input(SELECTOR) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${SELECTOR}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: 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(`${SELECTOR}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\tthis.trySetDisabled(true);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(\"ssvCommand: [ssvCommand] 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(\"ssvCommand: [ssvCommand] is not defined properly!\");\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tdelay(1),\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\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\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: \"[ssvCommandRef]\",\n\texportAs: \"ssvCommandRef\"\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(\"ssvCommandRef\") 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(\"ssvCommandRef: [ssvCommandRef] 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.1.0-dev228\";\n"]}
|
package/esm2015/command.util.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { of } from "rxjs";
|
|
2
|
-
import { map, distinctUntilChanged, startWith } from "rxjs/operators";
|
|
2
|
+
import { map, distinctUntilChanged, startWith, delay } from "rxjs/operators";
|
|
3
3
|
import { Command } from "./command";
|
|
4
4
|
/** Determines whether the arg object is of type `Command`. */
|
|
5
5
|
export function isCommand(arg) {
|
|
@@ -19,10 +19,10 @@ export function isCommandCreator(arg) {
|
|
|
19
19
|
export function canExecuteFromNgForm(form, options) {
|
|
20
20
|
const opts = Object.assign({ validity: true, dirty: true }, options);
|
|
21
21
|
return form.statusChanges
|
|
22
|
-
? form.statusChanges.pipe(startWith(form.valid), map(() => !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty)), distinctUntilChanged())
|
|
22
|
+
? form.statusChanges.pipe(delay(0), startWith(form.valid), map(() => !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty)), distinctUntilChanged())
|
|
23
23
|
: of(true);
|
|
24
24
|
}
|
|
25
25
|
function isAssumedType(x) {
|
|
26
26
|
return x !== null && typeof x === "object";
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZC51dGlsLmpzIiw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GVjdXRlRm9ybU9wdGlvbnNcbik6IE9ic2VydmFibGU8Ym9vbGVhbj4ge1xuXHRjb25zdCBvcHRzOiBDYW5FeGVjdXRlRm9ybU9wdGlvbnMgPSB7IHZhbGlkaXR5OiB0cnVlLCBkaXJ0eTogdHJ1ZSwgLi4ub3B0aW9ucyB9O1xuXG5cdHJldHVybiBmb3JtLnN0YXR1c0NoYW5nZXNcblx0XHQ/IGZvcm0uc3RhdHVzQ2hhbmdlcy5waXBlKFxuXHRcdFx0ZGVsYXkoMCksXG5cdFx0XHRzdGFydFdpdGgoZm9ybS52YWxpZCksXG5cdFx0XHRtYXAoKCkgPT4gISEoIW9wdHMudmFsaWRpdHkgfHwgZm9ybS52YWxpZCkgJiYgISEoIW9wdHMuZGlydHkgfHwgZm9ybS5kaXJ0eSkpLFxuXHRcdFx0ZGlzdGluY3RVbnRpbENoYW5nZWQoKSxcblx0XHQpXG5cdFx0OiBvZih0cnVlKTtcbn1cblxuZnVuY3Rpb24gaXNBc3N1bWVkVHlwZTxUID0gUmVjb3JkPHN0cmluZywgdW5rbm93bj4+KHg6IHVua25vd24pOiB4IGlzIFBhcnRpYWw8VD4ge1xuXHRyZXR1cm4geCAhPT0gbnVsbCAmJiB0eXBlb2YgeCA9PT0gXCJvYmplY3RcIjtcbn1cbiJdfQ==
|
package/esm2015/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "2.
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export const VERSION = "2.1.0-dev228";
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS9jaXJjbGVjaS9yZXBvL3NyYy8iLCJzb3VyY2VzIjpbInZlcnNpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBWRVJTSU9OID0gXCIyLjEuMC1kZXYyMjhcIjtcbiJdfQ==
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BehaviorSubject, Subject, Subscription, combineLatest, of, EMPTY } from 'rxjs';
|
|
2
|
-
import { map, tap, filter, switchMap, finalize, first, catchError, startWith, distinctUntilChanged,
|
|
2
|
+
import { map, tap, filter, switchMap, finalize, first, catchError, delay, startWith, distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
|
3
3
|
import { InjectionToken, Directive, Inject, Renderer2, ElementRef, ChangeDetectorRef, Input, HostListener, NgModule, Optional } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -151,7 +151,7 @@ function isCommandCreator(arg) {
|
|
|
151
151
|
function canExecuteFromNgForm(form, options) {
|
|
152
152
|
const opts = Object.assign({ validity: true, dirty: true }, options);
|
|
153
153
|
return form.statusChanges
|
|
154
|
-
? form.statusChanges.pipe(startWith(form.valid), map(() => !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty)), distinctUntilChanged())
|
|
154
|
+
? form.statusChanges.pipe(delay(0), startWith(form.valid), map(() => !!(!opts.validity || form.valid) && !!(!opts.dirty || form.dirty)), distinctUntilChanged())
|
|
155
155
|
: of(true);
|
|
156
156
|
}
|
|
157
157
|
function isAssumedType(x) {
|
|
@@ -383,7 +383,7 @@ function _moduleConfigFactory(config) {
|
|
|
383
383
|
? Object.assign(Object.assign({}, COMMAND_DEFAULT_CONFIG), cfg) : COMMAND_DEFAULT_CONFIG;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
const VERSION = "2.
|
|
386
|
+
const VERSION = "2.1.0-dev228";
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
389
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssv-ngx.command.js","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, first } 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\tfirst(),\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: unknown[]) => 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\nexport const COMMAND_DEFAULT_CONFIG: Readonly<CommandOptions> = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n});\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective } from \"@angular/forms\";\nimport { Observable, of } from \"rxjs\";\nimport { map, distinctUntilChanged, startWith } 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.pipe(\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 SELECTOR = \"ssvCommand\";\n\n@Directive({\n\tselector: `[${SELECTOR}]`,\n\texportAs: \"ssvCommand\"\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t@Input(SELECTOR) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${SELECTOR}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: 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(`${SELECTOR}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\tthis.trySetDisabled(true);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(\"ssvCommand: [ssvCommand] 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(\"ssvCommand: [ssvCommand] is not defined properly!\");\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tdelay(1),\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\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\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: \"[ssvCommandRef]\",\n\texportAs: \"ssvCommandRef\"\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(\"ssvCommandRef\") 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(\"ssvCommandRef: [ssvCommandRef] 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.0.0\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AAKA;;;MAGa,OAAO;;;;;;;;IAuCnB,YACC,OAAwC,EACxC,WAAiC,EACjC,OAAiB;;QAxBlB,gBAAW,GAAG,IAAI,CAAC;QAKX,kBAAa,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;QACpD,iBAAY,GAAG,KAAK,CAAC;QACrB,gBAAW,GAAG,IAAI,CAAC;QACnB,mBAAc,GAAG,IAAI,OAAO,EAAyB,CAAC;QACtD,kBAAa,GAAG,YAAY,CAAC,KAAK,CAAC;QACnC,iBAAY,GAAG,YAAY,CAAC,KAAK,CAAC;QAClC,oBAAe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SAAS,EAAE;gBACV,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE;aACjD;SACD,CAAC;KACF;;;YAhBD,QAAQ,SAAC;gBACT,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE;oBACV,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC,kBAAkB,EAAE,IAAI,QAAQ,EAAE,CAAC,CAAC,EAAE;iBAC3G;gBACD,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;aACxB;;AAcD;SACgB,oBAAoB,CAAC,MAA+C;IACnF,MAAM,GAAG,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IAC7D,OAAO,GAAG;0CAEL,sBAAsB,GACtB,GAAG,IAEL,sBAAsB,CAAC;AAC3B;;MC3Ca,OAAO,GAAG;;ACAvB;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ssv-ngx.command.js","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, first } 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\tfirst(),\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: unknown[]) => 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\nexport const COMMAND_DEFAULT_CONFIG: Readonly<CommandOptions> = Object.freeze({\n\texecutingCssClass: \"executing\",\n\thandleDisabled: true,\n});\n\nexport const COMMAND_CONFIG = new InjectionToken<CommandOptions>(\"command-config\");\n","import { AbstractControl, AbstractControlDirective } 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.pipe(\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 SELECTOR = \"ssvCommand\";\n\n@Directive({\n\tselector: `[${SELECTOR}]`,\n\texportAs: \"ssvCommand\"\n})\nexport class CommandDirective implements OnInit, OnDestroy {\n\n\t@Input(SELECTOR) commandOrCreator: ICommand | CommandCreator | undefined;\n\n\t@Input(`${SELECTOR}Options`)\n\tget commandOptions(): CommandOptions { return this._commandOptions; }\n\tset commandOptions(value: 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(`${SELECTOR}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\tthis.trySetDisabled(true);\n\t\tif (!this.commandOrCreator) {\n\t\t\tthrow new Error(\"ssvCommand: [ssvCommand] 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(\"ssvCommand: [ssvCommand] is not defined properly!\");\n\t\t}\n\n\t\tthis._command.subscribe();\n\t\tthis._command.canExecute$.pipe(\n\t\t\tdelay(1),\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\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\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: \"[ssvCommandRef]\",\n\texportAs: \"ssvCommandRef\"\n})\nexport class CommandRefDirective implements OnInit, OnDestroy {\n\n\t@Input(\"ssvCommandRef\") 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(\"ssvCommandRef: [ssvCommandRef] 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.1.0-dev228\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AAKA;;;MAGa,OAAO;;;;;;;;IAuCnB,YACC,OAAwC,EACxC,WAAiC,EACjC,OAAiB;;QAxBlB,gBAAW,GAAG,IAAI,CAAC;QAKX,kBAAa,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;QACpD,iBAAY,GAAG,KAAK,CAAC;QACrB,gBAAW,GAAG,IAAI,CAAC;QACnB,mBAAc,GAAG,IAAI,OAAO,EAAyB,CAAC;QACtD,kBAAa,GAAG,YAAY,CAAC,KAAK,CAAC;QACnC,iBAAY,GAAG,YAAY,CAAC,KAAK,CAAC;QAClC,oBAAe,GAAG,YAAY,CAAC,KAAK,CAAC;QACrC,qBAAgB,GAAG,CAAC,CAAC;QAc5B,IAAI,WAAW,EAAE;YAChB,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;gBAChC,IAAI,CAAC,aAAa;gBAClB,WAAW;aACX,CAAC,CAAC,IAAI,CACN,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC;;gBAEnC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;gBAChC,IAAI,CAAC,WAAW,GAAG,CAAC,WAAW,IAAI,CAAC,CAAC,gBAAgB,CAAC;gBACtD,OAAO,IAAI,CAAC,WAAW,CAAC;aACxB,CAAC,CACF,CAAC;YACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;SACjD;aAAM;YACN,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CACzC,GA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;;MC3Ca,OAAO,GAAG;;ACAvB;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"Command":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":48,"character":11,"module":"./command"},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"boolean"}]},{"__symbolic":"reference","name":"boolean"}]}],"execute":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"unsubscribe":[{"__symbolic":"method"}],"buildExecutionPipe":[{"__symbolic":"method"}]}},"CommandAsync":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Command"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":163,"character":11,"module":"./command"},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"boolean"}]}]}]}},"CommandDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":64,"character":1},"arguments":[{"selector":"[ssvCommand]","exportAs":"ssvCommand"}]}],"members":{"commandOrCreator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":2},"arguments":["ssvCommand"]}]}],"commandOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":2},"arguments":["ssvCommandOptions"]}]}],"commandParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":84,"character":2},"arguments":["ssvCommandParams"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":92,"character":3},"arguments":[{"__symbolic":"reference","name":"COMMAND_CONFIG"}]}],null,null,null],"parameters":[{"__symbolic":"reference","name":"CommandOptions"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":93,"character":20},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":94,"character":19},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":95,"character":15}]}],"ngOnInit":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":159,"character":2},"arguments":["click"]}]}],"ngOnDestroy":[{"__symbolic":"method"}],"trySetDisabled":[{"__symbolic":"method"}]}},"CommandRefDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":24,"character":1},"arguments":[{"selector":"[ssvCommandRef]","exportAs":"ssvCommandRef"}]}],"members":{"commandCreator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":2},"arguments":["ssvCommandRef"]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"isCommand":{"__symbolic":"function","parameters":["arg"],"value":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"arg"},"right":{"__symbolic":"reference","name":"Command"}}},"isCommandCreator":{"__symbolic":"function"},"CanExecuteFormOptions":{"__symbolic":"interface"},"canExecuteFromNgForm":{"__symbolic":"function"},"CommandCreator":{"__symbolic":"interface"},"ICommand":{"__symbolic":"interface"},"CommandOptions":{"__symbolic":"interface"},"COMMAND_DEFAULT_CONFIG":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"freeze"},"arguments":[{"executingCssClass":"executing","handleDisabled":true}]},"COMMAND_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":20,"character":34},"arguments":["command-config"]},"MODULE_CONFIG_DATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":7,"character":38},"arguments":["@ssv/ngx.command/configData"]},"SsvCommandModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":14,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CommandDirective"},{"__symbolic":"reference","name":"CommandRefDirective"}],"providers":[{"provide":{"__symbolic":"reference","name":"COMMAND_CONFIG"},"useFactory":{"__symbolic":"reference","name":"_moduleConfigFactory"},"deps":[[{"__symbolic":"reference","name":"MODULE_CONFIG_DATA"},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":17,"character":95}}]]}],"exports":[{"__symbolic":"reference","name":"CommandDirective"},{"__symbolic":"reference","name":"CommandRefDirective"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["config"],"value":{"ngModule":{"__symbolic":"reference","name":"SsvCommandModule"},"providers":[{"provide":{"__symbolic":"reference","name":"MODULE_CONFIG_DATA"},"useValue":{"__symbolic":"reference","name":"config"}}]}}}},"_moduleConfigFactory":{"__symbolic":"function"},"VERSION":"2.
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"Command":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":48,"character":11,"module":"./command"},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"boolean"}]},{"__symbolic":"reference","name":"boolean"}]}],"execute":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"unsubscribe":[{"__symbolic":"method"}],"buildExecutionPipe":[{"__symbolic":"method"}]}},"CommandAsync":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Command"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":163,"character":11,"module":"./command"},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"boolean"}]}]}]}},"CommandDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":64,"character":1},"arguments":[{"selector":"[ssvCommand]","exportAs":"ssvCommand"}]}],"members":{"commandOrCreator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":2},"arguments":["ssvCommand"]}]}],"commandOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":2},"arguments":["ssvCommandOptions"]}]}],"commandParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":84,"character":2},"arguments":["ssvCommandParams"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":92,"character":3},"arguments":[{"__symbolic":"reference","name":"COMMAND_CONFIG"}]}],null,null,null],"parameters":[{"__symbolic":"reference","name":"CommandOptions"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":93,"character":20},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":94,"character":19},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":95,"character":15}]}],"ngOnInit":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":159,"character":2},"arguments":["click"]}]}],"ngOnDestroy":[{"__symbolic":"method"}],"trySetDisabled":[{"__symbolic":"method"}]}},"CommandRefDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":24,"character":1},"arguments":[{"selector":"[ssvCommandRef]","exportAs":"ssvCommandRef"}]}],"members":{"commandCreator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":2},"arguments":["ssvCommandRef"]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}},"isCommand":{"__symbolic":"function","parameters":["arg"],"value":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"arg"},"right":{"__symbolic":"reference","name":"Command"}}},"isCommandCreator":{"__symbolic":"function"},"CanExecuteFormOptions":{"__symbolic":"interface"},"canExecuteFromNgForm":{"__symbolic":"function"},"CommandCreator":{"__symbolic":"interface"},"ICommand":{"__symbolic":"interface"},"CommandOptions":{"__symbolic":"interface"},"COMMAND_DEFAULT_CONFIG":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"freeze"},"arguments":[{"executingCssClass":"executing","handleDisabled":true}]},"COMMAND_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":20,"character":34},"arguments":["command-config"]},"MODULE_CONFIG_DATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":7,"character":38},"arguments":["@ssv/ngx.command/configData"]},"SsvCommandModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":14,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"CommandDirective"},{"__symbolic":"reference","name":"CommandRefDirective"}],"providers":[{"provide":{"__symbolic":"reference","name":"COMMAND_CONFIG"},"useFactory":{"__symbolic":"reference","name":"_moduleConfigFactory"},"deps":[[{"__symbolic":"reference","name":"MODULE_CONFIG_DATA"},{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":17,"character":95}}]]}],"exports":[{"__symbolic":"reference","name":"CommandDirective"},{"__symbolic":"reference","name":"CommandRefDirective"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["config"],"value":{"ngModule":{"__symbolic":"reference","name":"SsvCommandModule"},"providers":[{"provide":{"__symbolic":"reference","name":"MODULE_CONFIG_DATA"},"useValue":{"__symbolic":"reference","name":"config"}}]}}}},"_moduleConfigFactory":{"__symbolic":"function"},"VERSION":"2.1.0-dev228"},"origins":{"Command":"./command","CommandAsync":"./command","CommandDirective":"./command.directive","CommandRefDirective":"./command-ref.directive","isCommand":"./command.util","isCommandCreator":"./command.util","CanExecuteFormOptions":"./command.util","canExecuteFromNgForm":"./command.util","CommandCreator":"./command.model","ICommand":"./command.model","CommandOptions":"./config","COMMAND_DEFAULT_CONFIG":"./config","COMMAND_CONFIG":"./config","MODULE_CONFIG_DATA":"./module","SsvCommandModule":"./module","_moduleConfigFactory":"./module","VERSION":"./version"},"importAs":"@ssv/ngx.command"}
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.1.0-dev228";
|