tnp-helpers 0.0.73 → 13.0.5
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/app.js +2 -1
- package/browser/README.md +24 -0
- package/browser/esm2020/lib/base-component.mjs +48 -0
- package/browser/esm2020/lib/base-formly-component.mjs +124 -0
- package/browser/esm2020/lib/condition-wait.mjs +54 -0
- package/browser/esm2020/lib/constants.mjs +2 -0
- package/browser/esm2020/lib/dual-component-ctrl.mjs +117 -0
- package/browser/esm2020/lib/helpers-array-obj.mjs +81 -0
- package/browser/esm2020/lib/helpers-environment.mjs +21 -0
- package/browser/esm2020/lib/helpers-strings-regexes.mjs +49 -0
- package/browser/esm2020/lib/helpers-strings.mjs +61 -0
- package/browser/esm2020/lib/helpers.mjs +106 -0
- package/browser/esm2020/lib/index.mjs +11 -0
- package/browser/esm2020/lib/long-press.directive.mjs +106 -0
- package/browser/esm2020/lib/project.mjs +90 -0
- package/browser/esm2020/lib/resize-service.mjs +20 -0
- package/browser/esm2020/public-api.mjs +2 -0
- package/browser/esm2020/tnp-helpers.mjs +5 -0
- package/browser/fesm2015/tnp-helpers.mjs +870 -0
- package/browser/fesm2015/tnp-helpers.mjs.map +1 -0
- package/browser/fesm2020/tnp-helpers.mjs +861 -0
- package/browser/fesm2020/tnp-helpers.mjs.map +1 -0
- package/browser/{base-component.d.ts → lib/base-component.d.ts} +3 -0
- package/browser/{base-formly-component.d.ts → lib/base-formly-component.d.ts} +4 -3
- package/browser/{condition-wait.d.ts → lib/condition-wait.d.ts} +0 -0
- package/browser/{constants.d.ts → lib/constants.d.ts} +0 -0
- package/browser/{dual-component-ctrl.d.ts → lib/dual-component-ctrl.d.ts} +1 -2
- package/{helpers-array-obj.d.ts → browser/lib/helpers-array-obj.d.ts} +1 -0
- package/browser/{helpers-environment.d.ts → lib/helpers-environment.d.ts} +0 -0
- package/browser/{helpers-strings-regexes.d.ts → lib/helpers-strings-regexes.d.ts} +0 -0
- package/browser/{helpers-strings.d.ts → lib/helpers-strings.d.ts} +0 -0
- package/browser/{helpers.d.ts → lib/helpers.d.ts} +2 -4
- package/{client → browser/lib}/index.d.ts +1 -1
- package/{client → browser/lib}/long-press.directive.d.ts +3 -0
- package/browser/{project.d.ts → lib/project.d.ts} +0 -0
- package/{client → browser/lib}/resize-service.d.ts +3 -0
- package/browser/package.json +31 -0
- package/browser/public-api.d.ts +1 -0
- package/browser/tnp-helpers.d.ts +5 -0
- package/client/README.md +24 -0
- package/client/esm2020/lib/base-component.mjs +48 -0
- package/client/esm2020/lib/base-formly-component.mjs +124 -0
- package/client/esm2020/lib/condition-wait.mjs +54 -0
- package/client/esm2020/lib/constants.mjs +2 -0
- package/client/esm2020/lib/dual-component-ctrl.mjs +117 -0
- package/client/esm2020/lib/helpers-array-obj.mjs +81 -0
- package/client/esm2020/lib/helpers-environment.mjs +21 -0
- package/client/esm2020/lib/helpers-strings-regexes.mjs +49 -0
- package/client/esm2020/lib/helpers-strings.mjs +61 -0
- package/client/esm2020/lib/helpers.mjs +106 -0
- package/client/esm2020/lib/index.mjs +11 -0
- package/client/esm2020/lib/long-press.directive.mjs +106 -0
- package/client/esm2020/lib/project.mjs +90 -0
- package/client/esm2020/lib/resize-service.mjs +20 -0
- package/client/esm2020/public-api.mjs +2 -0
- package/client/esm2020/tnp-helpers.mjs +5 -0
- package/client/fesm2015/tnp-helpers.mjs +870 -0
- package/client/fesm2015/tnp-helpers.mjs.map +1 -0
- package/client/fesm2020/tnp-helpers.mjs +861 -0
- package/client/fesm2020/tnp-helpers.mjs.map +1 -0
- package/client/{base-component.d.ts → lib/base-component.d.ts} +3 -0
- package/{base-formly-component.d.ts → client/lib/base-formly-component.d.ts} +4 -3
- package/client/{condition-wait.d.ts → lib/condition-wait.d.ts} +0 -0
- package/client/{constants.d.ts → lib/constants.d.ts} +0 -0
- package/client/{dual-component-ctrl.d.ts → lib/dual-component-ctrl.d.ts} +1 -2
- package/client/{helpers-array-obj.d.ts → lib/helpers-array-obj.d.ts} +1 -0
- package/client/{helpers-environment.d.ts → lib/helpers-environment.d.ts} +0 -0
- package/client/{helpers-strings-regexes.d.ts → lib/helpers-strings-regexes.d.ts} +0 -0
- package/client/{helpers-strings.d.ts → lib/helpers-strings.d.ts} +0 -0
- package/client/{helpers.d.ts → lib/helpers.d.ts} +2 -4
- package/{browser → client/lib}/index.d.ts +1 -1
- package/{browser → client/lib}/long-press.directive.d.ts +3 -0
- package/client/{project.d.ts → lib/project.d.ts} +0 -0
- package/{resize-service.d.ts → client/lib/resize-service.d.ts} +3 -0
- package/client/package.json +25 -19
- package/client/public-api.d.ts +1 -0
- package/client/tnp-helpers.d.ts +5 -0
- package/index.d.ts +1 -11
- package/index.js +3 -21
- package/index.js.map +1 -1
- package/{base-component.d.ts → lib/base-component.d.ts} +0 -0
- package/{base-component.js → lib/base-component.js} +8 -7
- package/lib/base-component.js.map +1 -0
- package/{client → lib}/base-formly-component.d.ts +1 -3
- package/{base-formly-component.js → lib/base-formly-component.js} +46 -47
- package/lib/base-formly-component.js.map +1 -0
- package/{condition-wait.d.ts → lib/condition-wait.d.ts} +0 -0
- package/{condition-wait.js → lib/condition-wait.js} +10 -9
- package/lib/condition-wait.js.map +1 -0
- package/{constants.d.ts → lib/constants.d.ts} +0 -0
- package/{constants.js → lib/constants.js} +2 -1
- package/lib/constants.js.map +1 -0
- package/{dual-component-ctrl.d.ts → lib/dual-component-ctrl.d.ts} +1 -2
- package/{dual-component-ctrl.js → lib/dual-component-ctrl.js} +3 -1
- package/lib/dual-component-ctrl.js.map +1 -0
- package/{git-project.d.ts → lib/git-project.d.ts} +4 -3
- package/{git-project.js → lib/git-project.js} +20 -11
- package/lib/git-project.js.map +1 -0
- package/{browser → lib}/helpers-array-obj.d.ts +1 -0
- package/{helpers-array-obj.js → lib/helpers-array-obj.js} +8 -1
- package/lib/helpers-array-obj.js.map +1 -0
- package/{helpers-cli-tool.backend.d.ts → lib/helpers-cli-tool.backend.d.ts} +0 -0
- package/{helpers-cli-tool.backend.js → lib/helpers-cli-tool.backend.js} +5 -4
- package/lib/helpers-cli-tool.backend.js.map +1 -0
- package/{helpers-dependencies.backend.d.ts → lib/helpers-dependencies.backend.d.ts} +0 -0
- package/{helpers-dependencies.backend.js → lib/helpers-dependencies.backend.js} +6 -5
- package/lib/helpers-dependencies.backend.js.map +1 -0
- package/{helpers-environment.d.ts → lib/helpers-environment.d.ts} +0 -0
- package/{helpers-environment.js → lib/helpers-environment.js} +2 -1
- package/lib/helpers-environment.js.map +1 -0
- package/{helpers-file-folders.backend.d.ts → lib/helpers-file-folders.backend.d.ts} +1 -0
- package/{helpers-file-folders.backend.js → lib/helpers-file-folders.backend.js} +66 -47
- package/lib/helpers-file-folders.backend.js.map +1 -0
- package/{helpers-git.backend.d.ts → lib/helpers-git.backend.d.ts} +3 -1
- package/{helpers-git.backend.js → lib/helpers-git.backend.js} +83 -55
- package/lib/helpers-git.backend.js.map +1 -0
- package/{helpers-json5.backend.d.ts → lib/helpers-json5.backend.d.ts} +0 -0
- package/{helpers-json5.backend.js → lib/helpers-json5.backend.js} +3 -2
- package/lib/helpers-json5.backend.js.map +1 -0
- package/{helpers-morphi-framework.backend.d.ts → lib/helpers-morphi-framework.backend.d.ts} +0 -0
- package/{helpers-morphi-framework.backend.js → lib/helpers-morphi-framework.backend.js} +4 -3
- package/lib/helpers-morphi-framework.backend.js.map +1 -0
- package/{helpers-network.backend.d.ts → lib/helpers-network.backend.d.ts} +0 -0
- package/{helpers-network.backend.js → lib/helpers-network.backend.js} +2 -1
- package/lib/helpers-network.backend.js.map +1 -0
- package/{helpers-npm.backend.d.ts → lib/helpers-npm.backend.d.ts} +0 -0
- package/{helpers-npm.backend.js → lib/helpers-npm.backend.js} +2 -1
- package/lib/helpers-npm.backend.js.map +1 -0
- package/{helpers-path.backend.d.ts → lib/helpers-path.backend.d.ts} +0 -0
- package/{helpers-path.backend.js → lib/helpers-path.backend.js} +4 -3
- package/lib/helpers-path.backend.js.map +1 -0
- package/{helpers-process.backend.d.ts → lib/helpers-process.backend.d.ts} +2 -2
- package/{helpers-process.backend.js → lib/helpers-process.backend.js} +54 -53
- package/lib/helpers-process.backend.js.map +1 -0
- package/{helpers-strings-regexes.d.ts → lib/helpers-strings-regexes.d.ts} +0 -0
- package/{helpers-strings-regexes.js → lib/helpers-strings-regexes.js} +2 -1
- package/lib/helpers-strings-regexes.js.map +1 -0
- package/{helpers-strings.d.ts → lib/helpers-strings.d.ts} +0 -0
- package/{helpers-strings.js → lib/helpers-strings.js} +2 -1
- package/lib/helpers-strings.js.map +1 -0
- package/{helpers-system-terminal.backend.d.ts → lib/helpers-system-terminal.backend.d.ts} +1 -1
- package/{helpers-system-terminal.backend.js → lib/helpers-system-terminal.backend.js} +9 -8
- package/lib/helpers-system-terminal.backend.js.map +1 -0
- package/{helpers.d.ts → lib/helpers.d.ts} +6 -6
- package/{helpers.js → lib/helpers.js} +34 -30
- package/lib/helpers.js.map +1 -0
- package/{client/index.js → lib/index.d.ts} +3 -3
- package/lib/index.js +25 -0
- package/lib/index.js.map +1 -0
- package/{long-press.directive.d.ts → lib/long-press.directive.d.ts} +0 -0
- package/{long-press.directive.js → lib/long-press.directive.js} +40 -39
- package/lib/long-press.directive.js.map +1 -0
- package/{merge-helpers.backend.d.ts → lib/merge-helpers.backend.d.ts} +0 -0
- package/{merge-helpers.backend.js → lib/merge-helpers.backend.js} +7 -6
- package/lib/merge-helpers.backend.js.map +1 -0
- package/{project.d.ts → lib/project.d.ts} +0 -0
- package/{project.js → lib/project.js} +23 -21
- package/lib/project.js.map +1 -0
- package/{browser → lib}/resize-service.d.ts +0 -0
- package/{resize-service.js → lib/resize-service.js} +5 -4
- package/lib/resize-service.js.map +1 -0
- package/{ts-code-modifier → lib/ts-code}/index.d.ts +0 -0
- package/{ts-code-modifier → lib/ts-code}/index.js +3 -2
- package/lib/ts-code/index.js.map +1 -0
- package/lib/ts-code/ts-code-extractor.d.ts +14 -0
- package/lib/ts-code/ts-code-extractor.js +47 -0
- package/lib/ts-code/ts-code-extractor.js.map +1 -0
- package/{ts-code-modifier → lib/ts-code}/ts-code-modifier.backend.d.ts +0 -0
- package/{ts-code-modifier → lib/ts-code}/ts-code-modifier.backend.js +3 -2
- package/lib/ts-code/ts-code-modifier.backend.js.map +1 -0
- package/package.json +10 -18
- package/package.json_devDependencies.json +40 -40
- package/{package.json_tnp.json → package.json_tnp.json5} +12 -8
- package/tmp-environment.json +85 -122
- package/base-component.js.map +0 -1
- package/base-formly-component.js.map +0 -1
- package/browser/base-component.js +0 -48
- package/browser/base-component.js.map +0 -1
- package/browser/base-formly-component.js +0 -149
- package/browser/base-formly-component.js.map +0 -1
- package/browser/condition-wait.js +0 -57
- package/browser/condition-wait.js.map +0 -1
- package/browser/constants.js +0 -2
- package/browser/constants.js.map +0 -1
- package/browser/dual-component-ctrl.js +0 -118
- package/browser/dual-component-ctrl.js.map +0 -1
- package/browser/es5/base-component.js +0 -89
- package/browser/es5/base-formly-component.js +0 -158
- package/browser/es5/condition-wait.js +0 -135
- package/browser/es5/constants.js +0 -7
- package/browser/es5/dual-component-ctrl.js +0 -164
- package/browser/es5/git-project.js +0 -18
- package/browser/es5/helpers-array-obj.js +0 -129
- package/browser/es5/helpers-environment.js +0 -46
- package/browser/es5/helpers-messages.js +0 -105
- package/browser/es5/helpers-strings-regexes.js +0 -74
- package/browser/es5/helpers-strings.js +0 -96
- package/browser/es5/helpers.js +0 -217
- package/browser/es5/index.js +0 -86
- package/browser/es5/long-press.directive.js +0 -133
- package/browser/es5/project.js +0 -146
- package/browser/es5/resize-service.js +0 -45
- package/browser/git-project.d.ts +0 -2
- package/browser/git-project.js +0 -6
- package/browser/git-project.js.map +0 -1
- package/browser/helpers-array-obj.js +0 -75
- package/browser/helpers-array-obj.js.map +0 -1
- package/browser/helpers-environment.js +0 -21
- package/browser/helpers-environment.js.map +0 -1
- package/browser/helpers-messages.d.ts +0 -7
- package/browser/helpers-messages.js +0 -68
- package/browser/helpers-messages.js.map +0 -1
- package/browser/helpers-strings-regexes.js +0 -49
- package/browser/helpers-strings-regexes.js.map +0 -1
- package/browser/helpers-strings.js +0 -61
- package/browser/helpers-strings.js.map +0 -1
- package/browser/helpers.js +0 -113
- package/browser/helpers.js.map +0 -1
- package/browser/index.js +0 -11
- package/browser/index.js.map +0 -1
- package/browser/long-press.directive.js +0 -125
- package/browser/long-press.directive.js.map +0 -1
- package/browser/project.js +0 -90
- package/browser/project.js.map +0 -1
- package/browser/resize-service.js +0 -20
- package/browser/resize-service.js.map +0 -1
- package/client/base-component.js +0 -48
- package/client/base-component.js.map +0 -1
- package/client/base-formly-component.js +0 -149
- package/client/base-formly-component.js.map +0 -1
- package/client/condition-wait.js +0 -57
- package/client/condition-wait.js.map +0 -1
- package/client/constants.js +0 -2
- package/client/constants.js.map +0 -1
- package/client/dual-component-ctrl.js +0 -118
- package/client/dual-component-ctrl.js.map +0 -1
- package/client/es5/base-component.js +0 -89
- package/client/es5/base-formly-component.js +0 -158
- package/client/es5/condition-wait.js +0 -135
- package/client/es5/constants.js +0 -7
- package/client/es5/dual-component-ctrl.js +0 -164
- package/client/es5/git-project.js +0 -18
- package/client/es5/helpers-array-obj.js +0 -129
- package/client/es5/helpers-environment.js +0 -46
- package/client/es5/helpers-messages.js +0 -105
- package/client/es5/helpers-strings-regexes.js +0 -74
- package/client/es5/helpers-strings.js +0 -96
- package/client/es5/helpers.js +0 -217
- package/client/es5/index.js +0 -86
- package/client/es5/long-press.directive.js +0 -133
- package/client/es5/project.js +0 -146
- package/client/es5/resize-service.js +0 -45
- package/client/git-project.d.ts +0 -2
- package/client/git-project.js +0 -6
- package/client/git-project.js.map +0 -1
- package/client/helpers-array-obj.js +0 -75
- package/client/helpers-array-obj.js.map +0 -1
- package/client/helpers-environment.js +0 -21
- package/client/helpers-environment.js.map +0 -1
- package/client/helpers-messages.d.ts +0 -7
- package/client/helpers-messages.js +0 -68
- package/client/helpers-messages.js.map +0 -1
- package/client/helpers-strings-regexes.js +0 -49
- package/client/helpers-strings-regexes.js.map +0 -1
- package/client/helpers-strings.js +0 -61
- package/client/helpers-strings.js.map +0 -1
- package/client/helpers.js +0 -113
- package/client/helpers.js.map +0 -1
- package/client/index.js.map +0 -1
- package/client/long-press.directive.js +0 -125
- package/client/long-press.directive.js.map +0 -1
- package/client/project.js +0 -90
- package/client/project.js.map +0 -1
- package/client/resize-service.js +0 -20
- package/client/resize-service.js.map +0 -1
- package/condition-wait.js.map +0 -1
- package/constants.js.map +0 -1
- package/dual-component-ctrl.js.map +0 -1
- package/git-project.js.map +0 -1
- package/helpers-array-obj.js.map +0 -1
- package/helpers-cli-tool.backend.js.map +0 -1
- package/helpers-dependencies.backend.js.map +0 -1
- package/helpers-environment.js.map +0 -1
- package/helpers-file-folders.backend.js.map +0 -1
- package/helpers-git.backend.js.map +0 -1
- package/helpers-json5.backend.js.map +0 -1
- package/helpers-messages.d.ts +0 -7
- package/helpers-messages.js +0 -237
- package/helpers-messages.js.map +0 -1
- package/helpers-morphi-framework.backend.js.map +0 -1
- package/helpers-network.backend.js.map +0 -1
- package/helpers-npm.backend.js.map +0 -1
- package/helpers-path.backend.js.map +0 -1
- package/helpers-process.backend.js.map +0 -1
- package/helpers-strings-regexes.js.map +0 -1
- package/helpers-strings.js.map +0 -1
- package/helpers-system-terminal.backend.js.map +0 -1
- package/helpers.js.map +0 -1
- package/long-press.directive.js.map +0 -1
- package/merge-helpers.backend.js.map +0 -1
- package/project.js.map +0 -1
- package/resize-service.js.map +0 -1
- package/ts-code-modifier/index.js.map +0 -1
- package/ts-code-modifier/ts-code-modifier.backend.js.map +0 -1
package/client/condition-wait.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { _ } from 'tnp-core/browser';
|
|
3
|
-
import { Helpers } from './index';
|
|
4
|
-
export function conditionWait(conditionAndTimeout) {
|
|
5
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
6
|
-
yield waitFor(conditionAndTimeout);
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
function waitFor(arr, messageToShow = void 0) {
|
|
10
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
11
|
-
if (arr.length === 0) {
|
|
12
|
-
resolve(void 0);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
// console.log(arr.length)
|
|
16
|
-
const check = arr.shift();
|
|
17
|
-
if (_.isUndefined(check.timeoutCheck)) {
|
|
18
|
-
check.timeoutCheck = 2000;
|
|
19
|
-
}
|
|
20
|
-
if (_.isUndefined(check.timeoutNext)) {
|
|
21
|
-
check.timeoutNext = 4000;
|
|
22
|
-
}
|
|
23
|
-
const { timeoutCheck, timeoutNext, name } = check;
|
|
24
|
-
// console.log(`timeoutCheck: ${timeoutCheck}`);
|
|
25
|
-
// console.log(`timeoutNext: ${timeoutNext}`);
|
|
26
|
-
// console.log(`Checking: ${name}`)
|
|
27
|
-
const resultTrue = yield Helpers.runSyncOrAsync(check.callback, check);
|
|
28
|
-
// console.log(`after: ${name}`)
|
|
29
|
-
if (resultTrue) {
|
|
30
|
-
// console.log(`timeout 1 is set to ${timeoutNext}`)
|
|
31
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
// console.log(`timeout 1 is over`)
|
|
33
|
-
yield waitFor(arr).then(() => {
|
|
34
|
-
resolve(void 0);
|
|
35
|
-
});
|
|
36
|
-
}), timeoutNext);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
arr.unshift(check);
|
|
40
|
-
if (!messageToShow || check.errorMessage !== messageToShow) {
|
|
41
|
-
Helpers.info(check.errorMessage);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// console.log(`dont show error message ${check.errorMessage}`)
|
|
45
|
-
}
|
|
46
|
-
// console.log(`timeout 2 is set to ${timeoutCheck}, arr.length is ${arr.length}`)
|
|
47
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
// console.log(`timeout 2 ${timeoutCheck} ovef`)
|
|
49
|
-
yield waitFor(arr, check.errorMessage).then(() => {
|
|
50
|
-
resolve(void 0);
|
|
51
|
-
});
|
|
52
|
-
}), timeoutCheck);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=condition-wait.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"condition-wait.js","sourceRoot":"","sources":["../../tmp-src-bundle/condition-wait.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAUlC,MAAM,UAAgB,aAAa,CAAC,mBAAgC;;QAClE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC,CAAC;CAAA;AAED,SAAS,OAAO,CAAC,GAAgB,EAAE,gBAAwB,KAAK,CAAC;IAC/D,OAAO,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;SAChB;aAAM;YACL,0BAA0B;YAC1B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC;YAC1B,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;gBACrC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;aAC3B;YACD,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;gBACpC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;aAC1B;YACD,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;YAClD,gDAAgD;YAChD,8CAA8C;YAC9C,mCAAmC;YACnC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACvE,gCAAgC;YAChC,IAAI,UAAU,EAAE;gBACd,oDAAoD;gBACpD,UAAU,CAAC,GAAS,EAAE;oBACpB,mCAAmC;oBACnC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC3B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;oBAClB,CAAC,CAAC,CAAC;gBACL,CAAC,CAAA,EAAE,WAAW,CAAC,CAAC;aACjB;iBAAM;gBAEL,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACnB,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC,YAAY,KAAK,aAAa,EAAE;oBAC1D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;iBAClC;qBAAM;oBACL,gEAAgE;iBACjE;gBACD,kFAAkF;gBAClF,UAAU,CAAC,GAAS,EAAE;oBACpB,gDAAgD;oBAChD,MAAM,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC/C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;oBAClB,CAAC,CAAC,CAAC;gBACL,CAAC,CAAA,EAAE,YAAY,CAAC,CAAC;aAClB;SACF;IACH,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC"}
|
package/client/constants.js
DELETED
package/client/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../tmp-src-bundle/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { _ } from 'tnp-core/browser';
|
|
2
|
-
import { CLASS } from 'typescript-class-helpers/browser';
|
|
3
|
-
import { Log } from 'ng2-logger/browser';
|
|
4
|
-
const log = Log.create(`DualComponentController`);
|
|
5
|
-
export class DualComponentController {
|
|
6
|
-
constructor(cmp, isFormlyMode = false) {
|
|
7
|
-
this.cmp = cmp;
|
|
8
|
-
this.isFormlyMode = isFormlyMode;
|
|
9
|
-
}
|
|
10
|
-
getValTemplateOptions(propertyName) {
|
|
11
|
-
var _a;
|
|
12
|
-
if (this.isFormlyMode) {
|
|
13
|
-
const res = (_a = this.cmp.field) === null || _a === void 0 ? void 0 : _a.templateOptions[propertyName];
|
|
14
|
-
if (res === void 0 && this.cmp[propertyName]) {
|
|
15
|
-
return this.cmp[propertyName];
|
|
16
|
-
}
|
|
17
|
-
return res;
|
|
18
|
-
}
|
|
19
|
-
return this.cmp[propertyName];
|
|
20
|
-
}
|
|
21
|
-
getValContext(propertyName) {
|
|
22
|
-
var _a;
|
|
23
|
-
if (this.isFormlyMode) {
|
|
24
|
-
const res = (_a = this.cmp) === null || _a === void 0 ? void 0 : _a.field[propertyName];
|
|
25
|
-
if (res === void 0 && this.cmp[propertyName]) {
|
|
26
|
-
return this.cmp[propertyName];
|
|
27
|
-
}
|
|
28
|
-
return res;
|
|
29
|
-
}
|
|
30
|
-
return this.cmp[propertyName];
|
|
31
|
-
}
|
|
32
|
-
get disabled() {
|
|
33
|
-
return this.getValTemplateOptions('disabled');
|
|
34
|
-
}
|
|
35
|
-
get required() {
|
|
36
|
-
return this.getValTemplateOptions('required');
|
|
37
|
-
}
|
|
38
|
-
get type() {
|
|
39
|
-
if (!this.isFormlyMode) {
|
|
40
|
-
return CLASS.getNameFromObject(this.cmp);
|
|
41
|
-
}
|
|
42
|
-
return this.getValContext('type');
|
|
43
|
-
}
|
|
44
|
-
get label() {
|
|
45
|
-
return this.getValTemplateOptions('label');
|
|
46
|
-
}
|
|
47
|
-
get placeholder() {
|
|
48
|
-
return this.getValTemplateOptions('placeholder');
|
|
49
|
-
}
|
|
50
|
-
get defaultValue() {
|
|
51
|
-
return this.getValContext('defaultValue');
|
|
52
|
-
}
|
|
53
|
-
get formControl() {
|
|
54
|
-
return this.getValContext('formControl');
|
|
55
|
-
}
|
|
56
|
-
get key() {
|
|
57
|
-
return this.getValContext('key');
|
|
58
|
-
}
|
|
59
|
-
get path() {
|
|
60
|
-
return this.getValContext('path');
|
|
61
|
-
}
|
|
62
|
-
get model() {
|
|
63
|
-
if (this.isFormlyMode) {
|
|
64
|
-
return this.getValContext('model');
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
return this.__model;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
set model(v) {
|
|
71
|
-
if (this.isFormlyMode) {
|
|
72
|
-
log.w(`[DualComponentController] You can't set model in formly component mode`);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this.__model = v;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
get mode() {
|
|
79
|
-
if (this.isFormlyMode) {
|
|
80
|
-
return this.getValContext('mode');
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return this.__mode;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
set mode(v) {
|
|
87
|
-
if (this.isFormlyMode) {
|
|
88
|
-
// this.cmp.field.mode =
|
|
89
|
-
// log.w(`[DualComponentController] You can't set mode in formly component mode`);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
this.__mode = v;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
get value() {
|
|
96
|
-
if (this.isFormlyMode) {
|
|
97
|
-
return this.cmp.field.formControl.value;
|
|
98
|
-
}
|
|
99
|
-
if (_.isString(this.path)) {
|
|
100
|
-
return _.get(this.cmp.model, this.path);
|
|
101
|
-
}
|
|
102
|
-
return this.cmp.model;
|
|
103
|
-
}
|
|
104
|
-
set value(v) {
|
|
105
|
-
if (this.isFormlyMode) {
|
|
106
|
-
this.cmp.field.formControl.setValue(v);
|
|
107
|
-
this.cmp.change.next(v);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (_.isString(this.path)) {
|
|
111
|
-
_.set(this.cmp.model, this.path, v);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.cmp.model = v;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=dual-component-ctrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dual-component-ctrl.js","sourceRoot":"","sources":["../../tmp-src-bundle/dual-component-ctrl.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseComponentForRouter = exports.BaseComponent = undefined;
|
|
7
|
-
|
|
8
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
9
|
-
|
|
10
|
-
var _tslib = require('tslib');
|
|
11
|
-
|
|
12
|
-
var _core = require('@angular/core');
|
|
13
|
-
|
|
14
|
-
var _router = require('@angular/router');
|
|
15
|
-
|
|
16
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
17
|
-
|
|
18
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
19
|
-
|
|
20
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
var BaseComponent = function () {
|
|
23
|
-
function BaseComponent() {
|
|
24
|
-
_classCallCheck(this, BaseComponent);
|
|
25
|
-
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
this.model = {};
|
|
28
|
-
this.handlers = [];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
_createClass(BaseComponent, [{
|
|
32
|
-
key: 'ngOnDestroy',
|
|
33
|
-
value: function ngOnDestroy() {
|
|
34
|
-
this.handlers.forEach(function (h) {
|
|
35
|
-
return h.unsubscribe();
|
|
36
|
-
});
|
|
37
|
-
this.handlers.length = 0;
|
|
38
|
-
}
|
|
39
|
-
}]);
|
|
40
|
-
|
|
41
|
-
return BaseComponent;
|
|
42
|
-
}();
|
|
43
|
-
(0, _tslib.__decorate)([(0, _core.Input)(), (0, _tslib.__metadata)("design:type", Object)], BaseComponent.prototype, "model", void 0);
|
|
44
|
-
exports.BaseComponent = BaseComponent = (0, _tslib.__decorate)([(0, _core.Component)({
|
|
45
|
-
selector: 'app-base-component-meta',
|
|
46
|
-
template: '<div></div>'
|
|
47
|
-
})], BaseComponent);
|
|
48
|
-
exports.BaseComponent = BaseComponent;
|
|
49
|
-
|
|
50
|
-
var _isCalledNgInitAfterInternalRefresh = Symbol();
|
|
51
|
-
|
|
52
|
-
var BaseComponentForRouter = exports.BaseComponentForRouter = function (_BaseComponent) {
|
|
53
|
-
_inherits(BaseComponentForRouter, _BaseComponent);
|
|
54
|
-
|
|
55
|
-
function BaseComponentForRouter(__router) {
|
|
56
|
-
_classCallCheck(this, BaseComponentForRouter);
|
|
57
|
-
|
|
58
|
-
var _this = _possibleConstructorReturn(this, (BaseComponentForRouter.__proto__ || Object.getPrototypeOf(BaseComponentForRouter)).call(this));
|
|
59
|
-
|
|
60
|
-
_this.__router = __router;
|
|
61
|
-
_this[_isCalledNgInitAfterInternalRefresh] = false;
|
|
62
|
-
return _this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
_createClass(BaseComponentForRouter, [{
|
|
66
|
-
key: 'isCalledNgInitAfterInternalRefresh',
|
|
67
|
-
value: function isCalledNgInitAfterInternalRefresh() {
|
|
68
|
-
return !!this[_isCalledNgInitAfterInternalRefresh];
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
key: 'reloadNgOninitOnUrlChange',
|
|
72
|
-
value: function reloadNgOninitOnUrlChange() {
|
|
73
|
-
var _this2 = this;
|
|
74
|
-
|
|
75
|
-
this.handlers.push(this.__router.events.subscribe(function (event) {
|
|
76
|
-
if (event instanceof _router.NavigationEnd && _this2['ngOnInit']) {
|
|
77
|
-
_this2[_isCalledNgInitAfterInternalRefresh] = true;
|
|
78
|
-
_this2['ngOnInit']();
|
|
79
|
-
if (_this2[_isCalledNgInitAfterInternalRefresh]) {
|
|
80
|
-
_this2[_isCalledNgInitAfterInternalRefresh] = false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
}]);
|
|
86
|
-
|
|
87
|
-
return BaseComponentForRouter;
|
|
88
|
-
}(BaseComponent);
|
|
89
|
-
//# sourceMappingURL=base-component.js.map
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseFormlyComponent = undefined;
|
|
7
|
-
|
|
8
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
9
|
-
|
|
10
|
-
var _tslib = require('tslib');
|
|
11
|
-
|
|
12
|
-
var _core = require('@ngx-formly/core');
|
|
13
|
-
|
|
14
|
-
var _core2 = require('@angular/core');
|
|
15
|
-
|
|
16
|
-
var _forms = require('@angular/forms');
|
|
17
|
-
|
|
18
|
-
var _browser = require('ng2-logger/browser');
|
|
19
|
-
|
|
20
|
-
var _dualComponentCtrl = require('./dual-component-ctrl');
|
|
21
|
-
|
|
22
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
-
|
|
24
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
25
|
-
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
27
|
-
|
|
28
|
-
var log = _browser.Log.create('base formly component', _browser.Level.__NOTHING);
|
|
29
|
-
var BaseFormlyComponent = function (_FieldType) {
|
|
30
|
-
_inherits(BaseFormlyComponent, _FieldType);
|
|
31
|
-
|
|
32
|
-
function BaseFormlyComponent() {
|
|
33
|
-
_classCallCheck(this, BaseFormlyComponent);
|
|
34
|
-
|
|
35
|
-
var _this = _possibleConstructorReturn(this, (BaseFormlyComponent.__proto__ || Object.getPrototypeOf(BaseFormlyComponent)).apply(this, arguments));
|
|
36
|
-
|
|
37
|
-
_this.DualComponentController = _dualComponentCtrl.DualComponentController;
|
|
38
|
-
_this.ctrl = {};
|
|
39
|
-
_this.change = new _core2.EventEmitter();
|
|
40
|
-
_this.handlers = [];
|
|
41
|
-
_this.__field = {
|
|
42
|
-
templateOptions: {}
|
|
43
|
-
};
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_createClass(BaseFormlyComponent, [{
|
|
50
|
-
key: 'ngOnDestroy',
|
|
51
|
-
value: function ngOnDestroy() {
|
|
52
|
-
this.handlers.forEach(function (h) {
|
|
53
|
-
return h.unsubscribe();
|
|
54
|
-
});
|
|
55
|
-
this.handlers.length = 0;
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: 'ngAfterViewInit',
|
|
59
|
-
value: function ngAfterViewInit() {}
|
|
60
|
-
// _model: any;
|
|
61
|
-
|
|
62
|
-
}, {
|
|
63
|
-
key: 'ngOnInit',
|
|
64
|
-
value: function ngOnInit() {
|
|
65
|
-
var _this2 = this;
|
|
66
|
-
|
|
67
|
-
// console.log('model', this.model)
|
|
68
|
-
// console.log('ket', this.key)
|
|
69
|
-
var isFormlyMode = !!this.field;
|
|
70
|
-
log.i('isFormlyMode: ' + isFormlyMode);
|
|
71
|
-
if (!isFormlyMode) {
|
|
72
|
-
var that = this;
|
|
73
|
-
Object.defineProperty(this, 'field', {
|
|
74
|
-
get: function get() {
|
|
75
|
-
return that.__field;
|
|
76
|
-
},
|
|
77
|
-
set: function set(v) {
|
|
78
|
-
that.__field = v;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
var existed = this.ctrl;
|
|
83
|
-
this.ctrl = new this.DualComponentController(this, isFormlyMode);
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
Object.keys(existed).forEach(function (key) {
|
|
86
|
-
_this2.ctrl[key] = existed[key];
|
|
87
|
-
});
|
|
88
|
-
// if (!this.formControl) {
|
|
89
|
-
// this.formControl = new FormControl({})
|
|
90
|
-
// Object.defineProperty(this, 'field', {
|
|
91
|
-
// get: () => {
|
|
92
|
-
// return {
|
|
93
|
-
// formControl: this.formControl
|
|
94
|
-
// } as FormlyFieldConfig
|
|
95
|
-
// }
|
|
96
|
-
// })
|
|
97
|
-
// // this.formControl = new FormControl({})
|
|
98
|
-
// }
|
|
99
|
-
this.change.next(this.ctrl.value);
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
key: 'mode',
|
|
103
|
-
get: function get() {
|
|
104
|
-
return this.ctrl.mode;
|
|
105
|
-
}
|
|
106
|
-
// @ts-ignore
|
|
107
|
-
,
|
|
108
|
-
set: function set(v) {
|
|
109
|
-
this.ctrl.mode = v;
|
|
110
|
-
}
|
|
111
|
-
// @ts-ignore
|
|
112
|
-
|
|
113
|
-
}, {
|
|
114
|
-
key: 'model',
|
|
115
|
-
set: function set(v) {
|
|
116
|
-
this.ctrl.model = v;
|
|
117
|
-
},
|
|
118
|
-
get: function get() {
|
|
119
|
-
return this.ctrl.model;
|
|
120
|
-
}
|
|
121
|
-
// @ts-ignore
|
|
122
|
-
|
|
123
|
-
}, {
|
|
124
|
-
key: 'key',
|
|
125
|
-
set: function set(value) {
|
|
126
|
-
if (this.ctrl && this.ctrl.isFormlyMode) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
this.path = value;
|
|
130
|
-
},
|
|
131
|
-
get: function get() {
|
|
132
|
-
if (this.ctrl && this.ctrl.isFormlyMode) {
|
|
133
|
-
return this.field.key;
|
|
134
|
-
}
|
|
135
|
-
return this.path;
|
|
136
|
-
}
|
|
137
|
-
}]);
|
|
138
|
-
|
|
139
|
-
return BaseFormlyComponent;
|
|
140
|
-
}(_core.FieldType);
|
|
141
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", Object)], BaseFormlyComponent.prototype, "pizda", void 0);
|
|
142
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", Object), (0, _tslib.__metadata)("design:paramtypes", [Object])], BaseFormlyComponent.prototype, "mode", null);
|
|
143
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", Boolean)], BaseFormlyComponent.prototype, "disabled", void 0);
|
|
144
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", Boolean)], BaseFormlyComponent.prototype, "required", void 0);
|
|
145
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", String)], BaseFormlyComponent.prototype, "label", void 0);
|
|
146
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", String)], BaseFormlyComponent.prototype, "placeholder", void 0);
|
|
147
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", Object)], BaseFormlyComponent.prototype, "defaultValue", void 0);
|
|
148
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", Object), (0, _tslib.__metadata)("design:paramtypes", [Object])], BaseFormlyComponent.prototype, "model", null);
|
|
149
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", String)], BaseFormlyComponent.prototype, "path", void 0);
|
|
150
|
-
(0, _tslib.__decorate)([(0, _core2.Output)(), (0, _tslib.__metadata)("design:type", Object)], BaseFormlyComponent.prototype, "change", void 0);
|
|
151
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", String), (0, _tslib.__metadata)("design:paramtypes", [String])], BaseFormlyComponent.prototype, "key", null);
|
|
152
|
-
(0, _tslib.__decorate)([(0, _core2.Input)(), (0, _tslib.__metadata)("design:type", _forms.FormControl)], BaseFormlyComponent.prototype, "formControl", void 0);
|
|
153
|
-
exports.BaseFormlyComponent = BaseFormlyComponent = (0, _tslib.__decorate)([(0, _core2.Component)({
|
|
154
|
-
selector: 'app-base-formly-component-meta',
|
|
155
|
-
template: '<div></div>'
|
|
156
|
-
})], BaseFormlyComponent);
|
|
157
|
-
exports.BaseFormlyComponent = BaseFormlyComponent;
|
|
158
|
-
//# sourceMappingURL=base-formly-component.js.map
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.conditionWait = conditionWait;
|
|
7
|
-
|
|
8
|
-
var _tslib = require('tslib');
|
|
9
|
-
|
|
10
|
-
var _browser = require('tnp-core/browser');
|
|
11
|
-
|
|
12
|
-
var _index = require('./index');
|
|
13
|
-
|
|
14
|
-
function conditionWait(conditionAndTimeout) {
|
|
15
|
-
return (0, _tslib.__awaiter)(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
16
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
17
|
-
while (1) {
|
|
18
|
-
switch (_context.prev = _context.next) {
|
|
19
|
-
case 0:
|
|
20
|
-
_context.next = 2;
|
|
21
|
-
return waitFor(conditionAndTimeout);
|
|
22
|
-
|
|
23
|
-
case 2:
|
|
24
|
-
case 'end':
|
|
25
|
-
return _context.stop();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}, _callee, this);
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
function waitFor(arr) {
|
|
32
|
-
var _this = this;
|
|
33
|
-
|
|
34
|
-
var messageToShow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;
|
|
35
|
-
|
|
36
|
-
return new Promise(function (resolve, reject) {
|
|
37
|
-
return (0, _tslib.__awaiter)(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
38
|
-
var _this2 = this;
|
|
39
|
-
|
|
40
|
-
var check, timeoutCheck, timeoutNext, name, resultTrue;
|
|
41
|
-
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
42
|
-
while (1) {
|
|
43
|
-
switch (_context4.prev = _context4.next) {
|
|
44
|
-
case 0:
|
|
45
|
-
if (!(arr.length === 0)) {
|
|
46
|
-
_context4.next = 4;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
resolve(void 0);
|
|
51
|
-
_context4.next = 12;
|
|
52
|
-
break;
|
|
53
|
-
|
|
54
|
-
case 4:
|
|
55
|
-
// console.log(arr.length)
|
|
56
|
-
check = arr.shift();
|
|
57
|
-
|
|
58
|
-
if (_browser._.isUndefined(check.timeoutCheck)) {
|
|
59
|
-
check.timeoutCheck = 2000;
|
|
60
|
-
}
|
|
61
|
-
if (_browser._.isUndefined(check.timeoutNext)) {
|
|
62
|
-
check.timeoutNext = 4000;
|
|
63
|
-
}
|
|
64
|
-
timeoutCheck = check.timeoutCheck, timeoutNext = check.timeoutNext, name = check.name;
|
|
65
|
-
// console.log(`timeoutCheck: ${timeoutCheck}`);
|
|
66
|
-
// console.log(`timeoutNext: ${timeoutNext}`);
|
|
67
|
-
// console.log(`Checking: ${name}`)
|
|
68
|
-
|
|
69
|
-
_context4.next = 10;
|
|
70
|
-
return _index.Helpers.runSyncOrAsync(check.callback, check);
|
|
71
|
-
|
|
72
|
-
case 10:
|
|
73
|
-
resultTrue = _context4.sent;
|
|
74
|
-
|
|
75
|
-
// console.log(`after: ${name}`)
|
|
76
|
-
if (resultTrue) {
|
|
77
|
-
// console.log(`timeout 1 is set to ${timeoutNext}`)
|
|
78
|
-
setTimeout(function () {
|
|
79
|
-
return (0, _tslib.__awaiter)(_this2, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
80
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
81
|
-
while (1) {
|
|
82
|
-
switch (_context2.prev = _context2.next) {
|
|
83
|
-
case 0:
|
|
84
|
-
_context2.next = 2;
|
|
85
|
-
return waitFor(arr).then(function () {
|
|
86
|
-
resolve(void 0);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
case 2:
|
|
90
|
-
case 'end':
|
|
91
|
-
return _context2.stop();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, _callee2, this);
|
|
95
|
-
}));
|
|
96
|
-
}, timeoutNext);
|
|
97
|
-
} else {
|
|
98
|
-
arr.unshift(check);
|
|
99
|
-
if (!messageToShow || check.errorMessage !== messageToShow) {
|
|
100
|
-
_index.Helpers.info(check.errorMessage);
|
|
101
|
-
} else {}
|
|
102
|
-
// console.log(`dont show error message ${check.errorMessage}`)
|
|
103
|
-
|
|
104
|
-
// console.log(`timeout 2 is set to ${timeoutCheck}, arr.length is ${arr.length}`)
|
|
105
|
-
setTimeout(function () {
|
|
106
|
-
return (0, _tslib.__awaiter)(_this2, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
107
|
-
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
108
|
-
while (1) {
|
|
109
|
-
switch (_context3.prev = _context3.next) {
|
|
110
|
-
case 0:
|
|
111
|
-
_context3.next = 2;
|
|
112
|
-
return waitFor(arr, check.errorMessage).then(function () {
|
|
113
|
-
resolve(void 0);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
case 2:
|
|
117
|
-
case 'end':
|
|
118
|
-
return _context3.stop();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}, _callee3, this);
|
|
122
|
-
}));
|
|
123
|
-
}, timeoutCheck);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
case 12:
|
|
127
|
-
case 'end':
|
|
128
|
-
return _context4.stop();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, _callee4, this);
|
|
132
|
-
}));
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=condition-wait.js.map
|