@ngx-formbar/core 1.0.0 → 2.0.0-next.0
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/README.md +2 -34
- package/fesm2022/ngx-formbar-core.mjs +221 -1615
- package/fesm2022/ngx-formbar-core.mjs.map +1 -1
- package/package.json +5 -12
- package/types/ngx-formbar-core.d.ts +522 -0
- package/LICENSE +0 -21
- package/index.d.ts +0 -5
- package/lib/components/form/ngxfb-form.component.d.ts +0 -28
- package/lib/composables/computed-value.d.ts +0 -8
- package/lib/composables/disabled.state.d.ts +0 -36
- package/lib/composables/dynamic-label.d.ts +0 -9
- package/lib/composables/dynamic-title.d.ts +0 -9
- package/lib/composables/hidden.state.d.ts +0 -68
- package/lib/composables/readonly.state.d.ts +0 -19
- package/lib/composables/testId.d.ts +0 -16
- package/lib/composables/update-strategy.d.ts +0 -20
- package/lib/composables/validators.d.ts +0 -22
- package/lib/config/config.d.ts +0 -7
- package/lib/config/provide-formbar.d.ts +0 -38
- package/lib/directives/ngxfb-abstract-control.directive.d.ts +0 -53
- package/lib/directives/ngxfb-block.directive.d.ts +0 -124
- package/lib/directives/ngxfb-control.directive.d.ts +0 -203
- package/lib/directives/ngxfb-group.directive.d.ts +0 -253
- package/lib/helper/control-container-view-providers.d.ts +0 -33
- package/lib/index.d.ts +0 -23
- package/lib/services/component-registration.service.d.ts +0 -8
- package/lib/services/configuration.service.d.ts +0 -8
- package/lib/services/expression.service.d.ts +0 -148
- package/lib/services/form.service.d.ts +0 -10
- package/lib/services/validator-registration.service.d.ts +0 -10
- package/lib/tokens/component-registrations.d.ts +0 -2
- package/lib/tokens/component-resolver.d.ts +0 -3
- package/lib/tokens/default-update-strategy.d.ts +0 -3
- package/lib/tokens/global-config.d.ts +0 -5
- package/lib/tokens/validator-registrations.d.ts +0 -8
- package/lib/tokens/validator-resolver.d.ts +0 -3
- package/lib/types/component-resolver.type.d.ts +0 -4
- package/lib/types/content.type.d.ts +0 -137
- package/lib/types/expression.type.d.ts +0 -2
- package/lib/types/form.type.d.ts +0 -4
- package/lib/types/functions.type.d.ts +0 -4
- package/lib/types/global-configuration.type.d.ts +0 -4
- package/lib/types/provide.type.d.ts +0 -42
- package/lib/types/registration.type.d.ts +0 -18
- package/lib/types/validation.type.d.ts +0 -59
- package/lib/types/validator-resolver.type.d.ts +0 -6
- package/public-api.d.ts +0 -1
- package/schematics/block/files/__componentName@dasherize__.component.html.template +0 -1
- package/schematics/block/files/__componentName@dasherize__.component.ts.template +0 -29
- package/schematics/block/files/__interfaceName@dasherize__.type.ts.template +0 -6
- package/schematics/block/index.d.ts +0 -3
- package/schematics/block/index.js +0 -11
- package/schematics/block/index.js.map +0 -1
- package/schematics/block/schema.json +0 -62
- package/schematics/collection.json +0 -31
- package/schematics/control/files/__componentName@dasherize__.component.html.template +0 -0
- package/schematics/control/files/__componentName@dasherize__.component.ts.template +0 -29
- package/schematics/control/files/__interfaceName@dasherize__.type.ts.template +0 -6
- package/schematics/control/index.d.ts +0 -3
- package/schematics/control/index.js +0 -11
- package/schematics/control/index.js.map +0 -1
- package/schematics/control/schema.json +0 -61
- package/schematics/group/files/__componentName@dasherize__.component.html.template +0 -5
- package/schematics/group/files/__componentName@dasherize__.component.ts.template +0 -29
- package/schematics/group/files/__interfaceName@dasherize__.type.ts.template +0 -5
- package/schematics/group/index.d.ts +0 -3
- package/schematics/group/index.js +0 -11
- package/schematics/group/index.js.map +0 -1
- package/schematics/group/schema.json +0 -62
- package/schematics/ng-add/files/config-registrations/async-validator-registrations.ts.template +0 -4
- package/schematics/ng-add/files/config-registrations/component-registrations.ts.template +0 -4
- package/schematics/ng-add/files/config-registrations/index.ts.template +0 -3
- package/schematics/ng-add/files/config-registrations/validator-registrations.ts.template +0 -4
- package/schematics/ng-add/files/helper/block.host-directive.ts.template +0 -6
- package/schematics/ng-add/files/helper/control.host-directive.ts.template +0 -6
- package/schematics/ng-add/files/helper/group.host-directive.ts.template +0 -6
- package/schematics/ng-add/files/helper/index.ts.template +0 -4
- package/schematics/ng-add/files/helper/view-provider.ts.template +0 -9
- package/schematics/ng-add/files/provider-config/config/__providerConfigFileName__.ts.template +0 -9
- package/schematics/ng-add/files/provider-config/inline/__providerConfigFileName__.ts.template +0 -8
- package/schematics/ng-add/files/provider-config/token/__providerConfigFileName__.ts.template +0 -4
- package/schematics/ng-add/files/schematics-config/__schematicConfigFileName__.json.template +0 -1
- package/schematics/ng-add/files/token-registrations/async-validator-registrations.ts.template +0 -8
- package/schematics/ng-add/files/token-registrations/component-registrations.ts.template +0 -8
- package/schematics/ng-add/files/token-registrations/index.ts.template +0 -3
- package/schematics/ng-add/files/token-registrations/validator-registrations.ts.template +0 -8
- package/schematics/ng-add/helper.d.ts +0 -11
- package/schematics/ng-add/helper.js +0 -198
- package/schematics/ng-add/helper.js.map +0 -1
- package/schematics/ng-add/index.d.ts +0 -3
- package/schematics/ng-add/index.js +0 -68
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/rules/create-config-registration-files.rule.d.ts +0 -3
- package/schematics/ng-add/rules/create-config-registration-files.rule.js +0 -32
- package/schematics/ng-add/rules/create-config-registration-files.rule.js.map +0 -1
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.d.ts +0 -3
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.js +0 -30
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.js.map +0 -1
- package/schematics/ng-add/rules/create-helper-files.rule.d.ts +0 -6
- package/schematics/ng-add/rules/create-helper-files.rule.js +0 -22
- package/schematics/ng-add/rules/create-helper-files.rule.js.map +0 -1
- package/schematics/ng-add/rules/create-schematics-config.rule.d.ts +0 -3
- package/schematics/ng-add/rules/create-schematics-config.rule.js +0 -42
- package/schematics/ng-add/rules/create-schematics-config.rule.js.map +0 -1
- package/schematics/ng-add/rules/create-token-registration-files.rule.d.ts +0 -3
- package/schematics/ng-add/rules/create-token-registration-files.rule.js +0 -32
- package/schematics/ng-add/rules/create-token-registration-files.rule.js.map +0 -1
- package/schematics/ng-add/rules/include-templates.rule.d.ts +0 -3
- package/schematics/ng-add/rules/include-templates.rule.js +0 -11
- package/schematics/ng-add/rules/include-templates.rule.js.map +0 -1
- package/schematics/ng-add/rules/install-dependencies.rule.d.ts +0 -2
- package/schematics/ng-add/rules/install-dependencies.rule.js +0 -12
- package/schematics/ng-add/rules/install-dependencies.rule.js.map +0 -1
- package/schematics/ng-add/rules/update-app-config.rule.d.ts +0 -3
- package/schematics/ng-add/rules/update-app-config.rule.js +0 -49
- package/schematics/ng-add/rules/update-app-config.rule.js.map +0 -1
- package/schematics/ng-add/rules/update-schematics-config.rule.d.ts +0 -6
- package/schematics/ng-add/rules/update-schematics-config.rule.js +0 -28
- package/schematics/ng-add/rules/update-schematics-config.rule.js.map +0 -1
- package/schematics/ng-add/schema.d.ts +0 -23
- package/schematics/ng-add/schema.js +0 -3
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/ng-add/schema.json +0 -81
- package/schematics/register/component-info.type.d.ts +0 -11
- package/schematics/register/component-info.type.js +0 -3
- package/schematics/register/component-info.type.js.map +0 -1
- package/schematics/register/discover-components.d.ts +0 -19
- package/schematics/register/discover-components.js +0 -267
- package/schematics/register/discover-components.js.map +0 -1
- package/schematics/register/index.d.ts +0 -3
- package/schematics/register/index.js +0 -49
- package/schematics/register/index.js.map +0 -1
- package/schematics/register/register-components.d.ts +0 -3
- package/schematics/register/register-components.js +0 -38
- package/schematics/register/register-components.js.map +0 -1
- package/schematics/register/schema.d.ts +0 -14
- package/schematics/register/schema.js +0 -3
- package/schematics/register/schema.js.map +0 -1
- package/schematics/register/schema.json +0 -44
- package/schematics/shared/ast/decorators.d.ts +0 -9
- package/schematics/shared/ast/decorators.js +0 -182
- package/schematics/shared/ast/decorators.js.map +0 -1
- package/schematics/shared/ast/imports.d.ts +0 -3
- package/schematics/shared/ast/imports.js +0 -93
- package/schematics/shared/ast/imports.js.map +0 -1
- package/schematics/shared/ast/parse.d.ts +0 -3
- package/schematics/shared/ast/parse.js +0 -17
- package/schematics/shared/ast/parse.js.map +0 -1
- package/schematics/shared/ast/registrations.d.ts +0 -22
- package/schematics/shared/ast/registrations.js +0 -654
- package/schematics/shared/ast/registrations.js.map +0 -1
- package/schematics/shared/ast/types.d.ts +0 -3
- package/schematics/shared/ast/types.js +0 -58
- package/schematics/shared/ast/types.js.map +0 -1
- package/schematics/shared/file.d.ts +0 -4
- package/schematics/shared/file.js +0 -60
- package/schematics/shared/file.js.map +0 -1
- package/schematics/shared/helper.d.ts +0 -2
- package/schematics/shared/helper.js +0 -29
- package/schematics/shared/helper.js.map +0 -1
- package/schematics/shared/rules/create-component.rule.d.ts +0 -3
- package/schematics/shared/rules/create-component.rule.js +0 -15
- package/schematics/shared/rules/create-component.rule.js.map +0 -1
- package/schematics/shared/rules/register-control.rule.d.ts +0 -3
- package/schematics/shared/rules/register-control.rule.js +0 -30
- package/schematics/shared/rules/register-control.rule.js.map +0 -1
- package/schematics/shared/rules/register-type-map.rule.d.ts +0 -3
- package/schematics/shared/rules/register-type-map.rule.js +0 -46
- package/schematics/shared/rules/register-type-map.rule.js.map +0 -1
- package/schematics/shared/rules/register-type-token.rule.d.ts +0 -3
- package/schematics/shared/rules/register-type-token.rule.js +0 -49
- package/schematics/shared/rules/register-type-token.rule.js.map +0 -1
- package/schematics/shared/rules/scaffold-and-register.rule.d.ts +0 -3
- package/schematics/shared/rules/scaffold-and-register.rule.js +0 -134
- package/schematics/shared/rules/scaffold-and-register.rule.js.map +0 -1
- package/schematics/shared/schema.d.ts +0 -32
- package/schematics/shared/schema.js +0 -3
- package/schematics/shared/schema.js.map +0 -1
- package/schematics/tests/generators.spec.d.ts +0 -1
- package/schematics/tests/generators.spec.js +0 -450
- package/schematics/tests/generators.spec.js.map +0 -1
- package/schematics/tests/helper.d.ts +0 -20
- package/schematics/tests/helper.js +0 -275
- package/schematics/tests/helper.js.map +0 -1
- package/schematics/tests/ng-add.spec.d.ts +0 -1
- package/schematics/tests/ng-add.spec.js +0 -380
- package/schematics/tests/ng-add.spec.js.map +0 -1
- package/schematics/tests/register.spec.d.ts +0 -1
- package/schematics/tests/register.spec.js +0 -340
- package/schematics/tests/register.spec.js.map +0 -1
- package/schematics/tests/workspace-setup.d.ts +0 -21
- package/schematics/tests/workspace-setup.js +0 -256
- package/schematics/tests/workspace-setup.js.map +0 -1
- package/shared/ast.d.ts +0 -10
- package/shared/ast.js +0 -93
- package/shared/ast.js.map +0 -1
- package/shared/constants.d.ts +0 -16
- package/shared/constants.js +0 -20
- package/shared/constants.js.map +0 -1
- package/shared/shared-config.type.d.ts +0 -20
- package/shared/shared-config.type.js +0 -3
- package/shared/shared-config.type.js.map +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSchematicsConfig = createSchematicsConfig;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const core_1 = require("@angular-devkit/core");
|
|
6
|
-
const constants_1 = require("../../../shared/constants");
|
|
7
|
-
function createSchematicsConfig(ruleContext) {
|
|
8
|
-
return (_, context) => {
|
|
9
|
-
const { useSchematicConfig, schematicsConfigPath, schematicConfigFileName, projectRoot, helperPath, useHelper, registrationsPath, registrationStyle, } = ruleContext;
|
|
10
|
-
if (!useSchematicConfig || !schematicsConfigPath) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
context.logger.info('Creating schematics config file');
|
|
14
|
-
const schematicConfig = {};
|
|
15
|
-
if (registrationStyle !== constants_1.DEFAULT_REGISTRATION_TYPE) {
|
|
16
|
-
schematicConfig.registrationType = registrationStyle;
|
|
17
|
-
}
|
|
18
|
-
if (registrationsPath !== constants_1.DEFAULT_REGISTRATIONS_PATH) {
|
|
19
|
-
schematicConfig.controlRegistrationsPath = registrationsPath;
|
|
20
|
-
}
|
|
21
|
-
if (useHelper) {
|
|
22
|
-
schematicConfig.viewProviderHelperPath = helperPath;
|
|
23
|
-
schematicConfig.control = {
|
|
24
|
-
hostDirectiveHelperPath: helperPath,
|
|
25
|
-
};
|
|
26
|
-
schematicConfig.group = {
|
|
27
|
-
hostDirectiveHelperPath: helperPath,
|
|
28
|
-
};
|
|
29
|
-
schematicConfig.block = {
|
|
30
|
-
hostDirectiveHelperPath: helperPath,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/schematics-config'), [
|
|
34
|
-
(0, schematics_1.applyTemplates)({
|
|
35
|
-
schematicConfigFileName,
|
|
36
|
-
schematicConfig: JSON.stringify(schematicConfig, null, 2),
|
|
37
|
-
}),
|
|
38
|
-
(0, schematics_1.move)((0, core_1.normalize)(`${projectRoot}/${schematicsConfigPath}`)),
|
|
39
|
-
]));
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=create-schematics-config.rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-schematics-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-schematics-config.rule.ts"],"names":[],"mappings":";;AAgBA,wDAoDC;AApED,2DAOoC;AACpC,+CAAiD;AAEjD,yDAGmC;AAGnC,SAAgB,sBAAsB,CAAC,WAAwB;IAC7D,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EACJ,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,EACX,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,GAAG,WAAW,CAAC;QAEhB,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACjD,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAA+B,EAAE,CAAC;QAEvD,IAAI,iBAAiB,KAAK,qCAAyB,EAAE,CAAC;YACpD,eAAe,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;QACvD,CAAC;QAED,IAAI,iBAAiB,KAAK,sCAA0B,EAAE,CAAC;YACrD,eAAe,CAAC,wBAAwB,GAAG,iBAAiB,CAAC;QAC/D,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,eAAe,CAAC,sBAAsB,GAAG,UAAU,CAAC;YACpD,eAAe,CAAC,OAAO,GAAG;gBACxB,uBAAuB,EAAE,UAAU;aACpC,CAAC;YACF,eAAe,CAAC,KAAK,GAAG;gBACtB,uBAAuB,EAAE,UAAU;aACpC,CAAC;YACF,eAAe,CAAC,KAAK,GAAG;gBACtB,uBAAuB,EAAE,UAAU;aACpC,CAAC;QACJ,CAAC;QAED,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,2BAA2B,CAAC,EAAE;YACtC,IAAA,2BAAc,EAAC;gBACb,uBAAuB;gBACvB,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;aAC1D,CAAC;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,GAAG,WAAW,IAAI,oBAAoB,EAAE,CAAC,CAAC;SAC1D,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTokenRegistrationFiles = createTokenRegistrationFiles;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const core_1 = require("@angular-devkit/core");
|
|
6
|
-
const include_templates_rule_1 = require("./include-templates.rule");
|
|
7
|
-
function createTokenRegistrationFiles(ruleContext) {
|
|
8
|
-
return (_, context) => {
|
|
9
|
-
const { includeAsyncValidators, includeSyncValidators, useTokens, registrationsPath, splitRegistrations, projectRoot, } = ruleContext;
|
|
10
|
-
if (!useTokens || !splitRegistrations || !registrationsPath) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
context.logger.info('Creating token registration files');
|
|
14
|
-
const templatesToInclude = [
|
|
15
|
-
(0, core_1.normalize)('/index.ts.template'),
|
|
16
|
-
(0, core_1.normalize)('/component-registrations.ts.template'),
|
|
17
|
-
];
|
|
18
|
-
if (includeSyncValidators) {
|
|
19
|
-
templatesToInclude.push((0, core_1.normalize)('/validator-registrations.ts.template'));
|
|
20
|
-
}
|
|
21
|
-
if (includeAsyncValidators) {
|
|
22
|
-
templatesToInclude.push((0, core_1.normalize)('/async-validator-registrations.ts.template'));
|
|
23
|
-
}
|
|
24
|
-
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/token-registrations'), [
|
|
25
|
-
(0, include_templates_rule_1.includeTemplates)(templatesToInclude),
|
|
26
|
-
(0, schematics_1.applyTemplates)(Object.assign({ includeSyncValidators,
|
|
27
|
-
includeAsyncValidators }, core_1.strings)),
|
|
28
|
-
(0, schematics_1.move)((0, core_1.normalize)(`${projectRoot}/${registrationsPath}`)),
|
|
29
|
-
]));
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=create-token-registration-files.rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-token-registration-files.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-token-registration-files.rule.ts"],"names":[],"mappings":";;AAYA,oEA8CC;AA1DD,2DAOoC;AAEpC,+CAA0D;AAC1D,qEAA4D;AAE5D,SAAgB,4BAA4B,CAAC,WAAwB;IACnE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EACJ,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,GACZ,GAAG,WAAW,CAAC;QAEhB,IAAI,CAAC,SAAS,IAAI,CAAC,kBAAkB,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5D,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAEzD,MAAM,kBAAkB,GAAG;YACzB,IAAA,gBAAS,EAAC,oBAAoB,CAAC;YAC/B,IAAA,gBAAS,EAAC,sCAAsC,CAAC;SAClD,CAAC;QAEF,IAAI,qBAAqB,EAAE,CAAC;YAC1B,kBAAkB,CAAC,IAAI,CACrB,IAAA,gBAAS,EAAC,sCAAsC,CAAC,CAClD,CAAC;QACJ,CAAC;QAED,IAAI,sBAAsB,EAAE,CAAC;YAC3B,kBAAkB,CAAC,IAAI,CACrB,IAAA,gBAAS,EAAC,4CAA4C,CAAC,CACxD,CAAC;QACJ,CAAC;QAED,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,6BAA6B,CAAC,EAAE;YACxC,IAAA,yCAAgB,EAAC,kBAAkB,CAAC;YACpC,IAAA,2BAAc,kBACZ,qBAAqB;gBACrB,sBAAsB,IACnB,cAAO,EACV;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,GAAG,WAAW,IAAI,iBAAiB,EAAE,CAAC,CAAC;SACvD,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.includeTemplates = includeTemplates;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const core_1 = require("@angular-devkit/core");
|
|
6
|
-
function includeTemplates(templateNames) {
|
|
7
|
-
return (0, schematics_1.filter)((path) => {
|
|
8
|
-
return templateNames.includes((0, core_1.normalize)(path));
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=include-templates.rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"include-templates.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/include-templates.rule.ts"],"names":[],"mappings":";;AAGA,4CAIC;AAPD,2DAA0D;AAC1D,+CAAuD;AAEvD,SAAgB,gBAAgB,CAAC,aAAqB;IACpD,OAAO,IAAA,mBAAM,EAAC,CAAC,IAAI,EAAE,EAAE;QACrB,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.installDependencies = installDependencies;
|
|
4
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
|
-
function installDependencies() {
|
|
6
|
-
return (tree, context) => {
|
|
7
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
8
|
-
context.logger.info('✅ ngx-formbar has been set up successfully!');
|
|
9
|
-
return tree;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=install-dependencies.rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-dependencies.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/install-dependencies.rule.ts"],"names":[],"mappings":";;AAGA,kDAMC;AARD,4DAA0E;AAE1E,SAAgB,mBAAmB;IACjC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateAppConfig = updateAppConfig;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const change_1 = require("@schematics/angular/utility/change");
|
|
6
|
-
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
7
|
-
const ast_1 = require("../../../shared/ast");
|
|
8
|
-
const typescript_1 = require("typescript");
|
|
9
|
-
const helper_1 = require("../helper");
|
|
10
|
-
const constants_1 = require("../../../shared/constants");
|
|
11
|
-
function updateAppConfig(ruleContext) {
|
|
12
|
-
return (tree, context) => {
|
|
13
|
-
var _a;
|
|
14
|
-
const { appConfigPath } = ruleContext;
|
|
15
|
-
context.logger.info('Updating app.config.ts');
|
|
16
|
-
const buffer = tree.read(appConfigPath);
|
|
17
|
-
if (!buffer) {
|
|
18
|
-
throw new schematics_1.SchematicsException(`Missing file or unreadable: ${appConfigPath}`);
|
|
19
|
-
}
|
|
20
|
-
const content = buffer.toString('utf-8');
|
|
21
|
-
const sourceFile = (0, typescript_1.createSourceFile)(appConfigPath, content, typescript_1.ScriptTarget.Latest, true);
|
|
22
|
-
const changes = [
|
|
23
|
-
(0, ast_utils_1.insertImport)(sourceFile, appConfigPath, 'provideFormbar', constants_1.PACKAGE_NAME, false),
|
|
24
|
-
];
|
|
25
|
-
const appConfig = (0, ast_1.findVariableWithObjectLiteral)(sourceFile, (variable) => (0, ast_1.isObjectLiteralWithProperty)(variable, 'providers'));
|
|
26
|
-
const providersProp = appConfig === null || appConfig === void 0 ? void 0 : appConfig.properties.find((prop) => (0, typescript_1.isPropertyAssignment)(prop) &&
|
|
27
|
-
(0, typescript_1.isIdentifier)(prop.name) &&
|
|
28
|
-
prop.name.text === 'providers');
|
|
29
|
-
const providersInit = providersProp === null || providersProp === void 0 ? void 0 : providersProp.initializer;
|
|
30
|
-
if (!providersInit) {
|
|
31
|
-
throw new schematics_1.SchematicsException(`'providers' array not found in appConfig`);
|
|
32
|
-
}
|
|
33
|
-
if (!(0, typescript_1.isArrayLiteralExpression)(providersInit)) {
|
|
34
|
-
throw new schematics_1.SchematicsException(`'providers' is not an array`);
|
|
35
|
-
}
|
|
36
|
-
context.logger.info(`providerConfigPath=${(_a = ruleContext.providerConfigPath) !== null && _a !== void 0 ? _a : ''}`);
|
|
37
|
-
const { updatedProvidersArray, extraChanges, didChange } = (0, helper_1.buildProvidersUpdate)(sourceFile, ruleContext, providersInit);
|
|
38
|
-
changes.push(...extraChanges);
|
|
39
|
-
if (didChange) {
|
|
40
|
-
changes.push(...(0, helper_1.replaceNodeWithPrinted)(sourceFile, appConfigPath, content, providersInit, updatedProvidersArray));
|
|
41
|
-
}
|
|
42
|
-
const recorder = tree.beginUpdate(appConfigPath);
|
|
43
|
-
(0, change_1.applyToUpdateRecorder)(recorder, changes);
|
|
44
|
-
tree.commitUpdate(recorder);
|
|
45
|
-
context.logger.info('app.config.ts updated');
|
|
46
|
-
return tree;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=update-app-config.rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-app-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/update-app-config.rule.ts"],"names":[],"mappings":";;AAwBA,0CA8EC;AArGD,2DAAuE;AAEvE,+DAG4C;AAC5C,qEAAqE;AACrE,6CAG6B;AAE7B,2CAOoB;AACpB,sCAAyE;AACzE,yDAAyD;AAEzD,SAAgB,eAAe,CAAC,WAAwB;IACtD,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;;QACvB,MAAM,EAAE,aAAa,EAAE,GAAG,WAAW,CAAC;QAEtC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE9C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,gCAAmB,CAC3B,+BAA+B,aAAa,EAAE,CAC/C,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,IAAA,6BAAgB,EACjC,aAAa,EACb,OAAO,EACP,yBAAY,CAAC,MAAM,EACnB,IAAI,CACL,CAAC;QAEF,MAAM,OAAO,GAAa;YACxB,IAAA,wBAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,wBAAY,EACZ,KAAK,CACN;SACF,CAAC;QAEF,MAAM,SAAS,GAAG,IAAA,mCAA6B,EAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CACvE,IAAA,iCAA2B,EAAC,QAAQ,EAAE,WAAW,CAAC,CACnD,CAAC;QAEF,MAAM,aAAa,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,CAAC,IAAI,CAC9C,CAAC,IAAI,EAAE,EAAE,CACP,IAAA,iCAAoB,EAAC,IAAI,CAAC;YAC1B,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CACC,CAAC;QAEpC,MAAM,aAAa,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,CAAC;QACjD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,gCAAmB,CAAC,0CAA0C,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,CAAC,IAAA,qCAAwB,EAAC,aAAa,CAAC,EAAE,CAAC;YAC7C,MAAM,IAAI,gCAAmB,CAAC,6BAA6B,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,sBAAsB,MAAA,WAAW,CAAC,kBAAkB,mCAAI,EAAE,EAAE,CAC7D,CAAC;QAEF,MAAM,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,GACtD,IAAA,6BAAoB,EAAC,UAAU,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;QAE/D,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;QAE9B,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CACV,GAAG,IAAA,+BAAsB,EACvB,UAAU,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,qBAAqB,CACtB,CACF,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACjD,IAAA,8BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateSchematicsConfig = updateSchematicsConfig;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const helper_1 = require("../helper");
|
|
6
|
-
/**
|
|
7
|
-
* Update angular.json for ngx-formbar schematics
|
|
8
|
-
*/
|
|
9
|
-
function updateSchematicsConfig(ruleContext) {
|
|
10
|
-
return (_, context) => {
|
|
11
|
-
const { useHelper, helperPath, projectName, useSchematicConfig } = ruleContext;
|
|
12
|
-
if (useSchematicConfig) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
context.logger.info('Updating schematics configuration');
|
|
16
|
-
const config = {};
|
|
17
|
-
if (useHelper && helperPath) {
|
|
18
|
-
config.hostDirectiveHelperPath = helperPath;
|
|
19
|
-
config.viewProviderHelperPath = helperPath;
|
|
20
|
-
}
|
|
21
|
-
return (0, schematics_1.chain)([
|
|
22
|
-
(0, helper_1.updateSchematicConfig)('control', config, projectName),
|
|
23
|
-
(0, helper_1.updateSchematicConfig)('group', config, projectName),
|
|
24
|
-
(0, helper_1.updateSchematicConfig)('block', config, projectName),
|
|
25
|
-
]);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=update-schematics-config.rule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-schematics-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/update-schematics-config.rule.ts"],"names":[],"mappings":";;AASA,wDAwBC;AAjCD,2DAAyD;AAIzD,sCAAkD;AAElD;;GAEG;AACH,SAAgB,sBAAsB,CAAC,WAAwB;IAC7D,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,GAC9D,WAAW,CAAC;QAEd,IAAI,kBAAkB,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAEzD,MAAM,MAAM,GAAoB,EAAE,CAAC;QAEnC,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;YAC5B,MAAM,CAAC,uBAAuB,GAAG,UAAU,CAAC;YAC5C,MAAM,CAAC,sBAAsB,GAAG,UAAU,CAAC;QAC7C,CAAC;QAED,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,8BAAqB,EAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;YACrD,IAAA,8BAAqB,EAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC;YACnD,IAAA,8BAAqB,EAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC;SACpD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { RegistrationType } from '../../shared/shared-config.type';
|
|
2
|
-
export interface Schema {
|
|
3
|
-
project?: string;
|
|
4
|
-
registrationStyle?: RegistrationType;
|
|
5
|
-
provideInline?: boolean;
|
|
6
|
-
providerConfigPath?: string;
|
|
7
|
-
providerConfigFileName?: string;
|
|
8
|
-
includeSyncValidators?: boolean;
|
|
9
|
-
includeAsyncValidators?: boolean;
|
|
10
|
-
useHelper?: boolean;
|
|
11
|
-
helperPath?: string;
|
|
12
|
-
splitRegistrations?: boolean;
|
|
13
|
-
registrationsPath?: string;
|
|
14
|
-
useSchematicConfig?: boolean;
|
|
15
|
-
schematicsConfigPath?: string;
|
|
16
|
-
schematicConfigFileName?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface RuleContext extends Schema {
|
|
19
|
-
projectRoot: string;
|
|
20
|
-
appConfigPath: string;
|
|
21
|
-
projectName: string;
|
|
22
|
-
useTokens: boolean;
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../projects/core/automation/schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "NgxFormbarNgAdd",
|
|
4
|
-
"title": "ngx-formbar Installation Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"description": "Adds ngx-formbar to the application",
|
|
7
|
-
"properties": {
|
|
8
|
-
"project": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "The name of the project to add ngx-formbar to.",
|
|
11
|
-
"$default": {
|
|
12
|
-
"$source": "projectName"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"registrationStyle": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "How components and validators will be registered. Possible values: token, config",
|
|
18
|
-
"default": "token"
|
|
19
|
-
},
|
|
20
|
-
"provideInline": {
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"description": "Put configuration of provideFormbar call directly in app.config.ts (defaults to false)",
|
|
23
|
-
"default": false
|
|
24
|
-
},
|
|
25
|
-
"providerConfigPath": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "Where the provider configuration file should be placed, relative to the project root. Defaults to 'app'",
|
|
28
|
-
"default": "app"
|
|
29
|
-
},
|
|
30
|
-
"providerConfigFileName": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"description": "Name of the provider configuration file. Defaults to 'formbar.config.ts'",
|
|
33
|
-
"default": "formbar.config.ts"
|
|
34
|
-
},
|
|
35
|
-
"includeSyncValidators": {
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"description": "Whether to include the setup for validators",
|
|
38
|
-
"default": true
|
|
39
|
-
},
|
|
40
|
-
"includeAsyncValidators": {
|
|
41
|
-
"type": "boolean",
|
|
42
|
-
"description": "Whether to include the setup for async validators",
|
|
43
|
-
"default": true
|
|
44
|
-
},
|
|
45
|
-
"useHelper": {
|
|
46
|
-
"type": "boolean",
|
|
47
|
-
"description": "Include helper files for view providers and host directives",
|
|
48
|
-
"default": true
|
|
49
|
-
},
|
|
50
|
-
"helperPath": {
|
|
51
|
-
"type": "string",
|
|
52
|
-
"description": "Where helper files should be placed, relative to the project root. Defaults to 'app/shared/helper'",
|
|
53
|
-
"default": "app/shared/helper"
|
|
54
|
-
},
|
|
55
|
-
"splitRegistrations": {
|
|
56
|
-
"type": "boolean",
|
|
57
|
-
"description": "Whether to split the registrations into a separate file",
|
|
58
|
-
"default": true
|
|
59
|
-
},
|
|
60
|
-
"registrationsPath": {
|
|
61
|
-
"type": "string",
|
|
62
|
-
"description": "Where registration files should be placed, relative to the project root. Defaults to 'app/registrations'",
|
|
63
|
-
"default": "app/registrations"
|
|
64
|
-
},
|
|
65
|
-
"useSchematicConfig": {
|
|
66
|
-
"type": "boolean",
|
|
67
|
-
"description": "Whether to include an extra file for schematics configuration. If set to false, all configuration for the schematics will be set up in angular.json",
|
|
68
|
-
"default": true
|
|
69
|
-
},
|
|
70
|
-
"schematicsConfigPath": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"description": "Where the schematics config should be placed, relative to the project root. Defaults to 'app'",
|
|
73
|
-
"default": "app"
|
|
74
|
-
},
|
|
75
|
-
"schematicConfigFileName": {
|
|
76
|
-
"type": "string",
|
|
77
|
-
"description": "Name of the schematic config file. Defaults to 'formbar.config.json'",
|
|
78
|
-
"default": "formbar.config.json"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents information about a discovered Formbar component
|
|
3
|
-
*/
|
|
4
|
-
export interface FormbarComponentInfo {
|
|
5
|
-
/** The path to the component file */
|
|
6
|
-
componentFilePath: string;
|
|
7
|
-
/** The name of the component class */
|
|
8
|
-
componentClassName: string;
|
|
9
|
-
/** The key under which to register the component (equals the dasherized class name minus Component suffix */
|
|
10
|
-
key: string;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-info.type.js","sourceRoot":"","sources":["../../../../projects/core/automation/schematics/register/component-info.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
-
import { RegisterContext } from './schema';
|
|
3
|
-
export declare function discoverComponents(tree: Tree, registerContext: RegisterContext, context: SchematicContext): RegisterContext;
|
|
4
|
-
/**
|
|
5
|
-
* Find files whose paths match any of the *glob* include patterns
|
|
6
|
-
* and none of the *glob* exclude patterns.
|
|
7
|
-
*
|
|
8
|
-
* Supported glob features:
|
|
9
|
-
* - ** : recursive across path segments
|
|
10
|
-
* - * : any sequence within a single path segment (excludes '/')
|
|
11
|
-
* - ? : any single char within a segment (excludes '/')
|
|
12
|
-
* - [] : character class / ranges (e.g., [a-zA-Z0-9_])
|
|
13
|
-
*
|
|
14
|
-
* Notes:
|
|
15
|
-
* - Matching is done against the full POSIX-like path from Tree (e.g., "/src/app/a.ts").
|
|
16
|
-
* - Patterns are compiled once to RegExp for speed.
|
|
17
|
-
* - No extra dependencies.
|
|
18
|
-
*/
|
|
19
|
-
export declare function findPotentialControlComponents(tree: Tree, include: readonly string[], exclude?: readonly string[]): string[];
|