tuain-ng-forms-lib 14.4.91 → 14.4.93
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/.browserslistrc +16 -0
- package/.yarn/cache/nanoid-npm-4.0.0-924f5c6312-7d5946df5c.zip +0 -0
- package/.yarn/cache/tslib-npm-2.4.1-36f0ed04db-19480d6e03.zip +0 -0
- package/.yarn/cache/yn-npm-5.0.0-b001dab23c-f0ec7710d3.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +11 -0
- package/package.json +6 -24
- package/src/lib/classes/forms/action.ts +56 -0
- package/src/lib/classes/forms/element.ts +29 -0
- package/src/lib/classes/forms/field.ts +500 -0
- package/src/lib/classes/forms/form.constants.ts +28 -0
- package/src/lib/classes/forms/form.ts +508 -0
- package/src/lib/classes/forms/piece-propagate.ts +46 -0
- package/src/lib/classes/forms/piece.ts +122 -0
- package/src/lib/classes/forms/section.ts +152 -0
- package/src/lib/classes/forms/subsection.ts +90 -0
- package/src/lib/classes/forms/table/action.ts +32 -0
- package/src/lib/classes/forms/table/column.ts +94 -0
- package/src/lib/classes/forms/table/row-data.ts +121 -0
- package/src/lib/classes/forms/table/table.ts +478 -0
- package/src/lib/components/elements/action.component.ts +59 -0
- package/src/lib/components/elements/field.component.ts +92 -0
- package/src/lib/components/elements/layout/element.component.ts +13 -0
- package/src/lib/components/elements/layout/form-error.component.ts +11 -0
- package/src/lib/components/elements/layout/form-header.component.ts +17 -0
- package/src/lib/components/elements/layout/piece.component.ts +34 -0
- package/src/lib/components/elements/layout/section.component.ts +31 -0
- package/src/lib/components/elements/layout/sub-section.component.ts +31 -0
- package/src/lib/components/elements/tables/table-record-action.component.ts +50 -0
- package/src/lib/components/elements/tables/table-record-field.component.ts +20 -0
- package/src/lib/components/elements/tables/table.component.ts +86 -0
- package/src/lib/components/forms/basic-form.ts +1588 -0
- package/src/lib/services/event-manager.service.ts +21 -0
- package/src/lib/services/file-manager.service.ts +6 -0
- package/src/lib/services/form-manager.service.ts +89 -0
- package/src/lib/services/icon-dictionary.service.ts +159 -0
- package/src/lib/tuain-ng-forms-lib.module.ts +40 -0
- package/{public-api.d.ts → src/public-api.ts} +5 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/lib/classes/forms/action.mjs +0 -35
- package/esm2020/lib/classes/forms/element.mjs +0 -26
- package/esm2020/lib/classes/forms/field.mjs +0 -444
- package/esm2020/lib/classes/forms/form.constants.mjs +0 -26
- package/esm2020/lib/classes/forms/form.mjs +0 -431
- package/esm2020/lib/classes/forms/piece-propagate.mjs +0 -30
- package/esm2020/lib/classes/forms/piece.mjs +0 -95
- package/esm2020/lib/classes/forms/section.mjs +0 -137
- package/esm2020/lib/classes/forms/subsection.mjs +0 -80
- package/esm2020/lib/classes/forms/table/action.mjs +0 -18
- package/esm2020/lib/classes/forms/table/column.mjs +0 -74
- package/esm2020/lib/classes/forms/table/row-data.mjs +0 -116
- package/esm2020/lib/classes/forms/table/table.mjs +0 -415
- package/esm2020/lib/components/elements/action.component.mjs +0 -71
- package/esm2020/lib/components/elements/field.component.mjs +0 -80
- package/esm2020/lib/components/elements/layout/element.component.mjs +0 -20
- package/esm2020/lib/components/elements/layout/form-error.component.mjs +0 -20
- package/esm2020/lib/components/elements/layout/form-header.component.mjs +0 -31
- package/esm2020/lib/components/elements/layout/piece.component.mjs +0 -22
- package/esm2020/lib/components/elements/layout/section.component.mjs +0 -37
- package/esm2020/lib/components/elements/layout/sub-section.component.mjs +0 -37
- package/esm2020/lib/components/elements/tables/table-record-action.component.mjs +0 -56
- package/esm2020/lib/components/elements/tables/table-record-field.component.mjs +0 -30
- package/esm2020/lib/components/elements/tables/table.component.mjs +0 -93
- package/esm2020/lib/components/forms/basic-form.mjs +0 -1514
- package/esm2020/lib/services/event-manager.service.mjs +0 -18
- package/esm2020/lib/services/file-manager.service.mjs +0 -6
- package/esm2020/lib/services/form-manager.service.mjs +0 -80
- package/esm2020/lib/tuain-ng-forms-lib.module.mjs +0 -71
- package/esm2020/public-api.mjs +0 -19
- package/esm2020/tuain-ng-forms-lib.mjs +0 -5
- package/fesm2015/tuain-ng-forms-lib.mjs +0 -4230
- package/fesm2015/tuain-ng-forms-lib.mjs.map +0 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +0 -4048
- package/fesm2020/tuain-ng-forms-lib.mjs.map +0 -1
- package/lib/classes/forms/action.d.ts +0 -22
- package/lib/classes/forms/element.d.ts +0 -17
- package/lib/classes/forms/field.d.ts +0 -205
- package/lib/classes/forms/form.constants.d.ts +0 -25
- package/lib/classes/forms/form.d.ts +0 -137
- package/lib/classes/forms/piece-propagate.d.ts +0 -11
- package/lib/classes/forms/piece.d.ts +0 -41
- package/lib/classes/forms/section.d.ts +0 -32
- package/lib/classes/forms/subsection.d.ts +0 -24
- package/lib/classes/forms/table/action.d.ts +0 -15
- package/lib/classes/forms/table/column.d.ts +0 -33
- package/lib/classes/forms/table/row-data.d.ts +0 -14
- package/lib/classes/forms/table/table.d.ts +0 -100
- package/lib/components/elements/action.component.d.ts +0 -17
- package/lib/components/elements/field.component.d.ts +0 -38
- package/lib/components/elements/layout/element.component.d.ts +0 -9
- package/lib/components/elements/layout/form-error.component.d.ts +0 -8
- package/lib/components/elements/layout/form-header.component.d.ts +0 -12
- package/lib/components/elements/layout/piece.component.d.ts +0 -10
- package/lib/components/elements/layout/section.component.d.ts +0 -11
- package/lib/components/elements/layout/sub-section.component.d.ts +0 -11
- package/lib/components/elements/tables/table-record-action.component.d.ts +0 -16
- package/lib/components/elements/tables/table-record-field.component.d.ts +0 -12
- package/lib/components/elements/tables/table.component.d.ts +0 -35
- package/lib/components/forms/basic-form.d.ts +0 -353
- package/lib/services/event-manager.service.d.ts +0 -9
- package/lib/services/file-manager.service.d.ts +0 -5
- package/lib/services/form-manager.service.d.ts +0 -28
- package/lib/tuain-ng-forms-lib.module.d.ts +0 -20
- package/tuain-ng-forms-lib.d.ts +0 -5
package/.browserslistrc
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
+
# For additional information regarding the format and rule options, please see:
|
|
3
|
+
# https://github.com/browserslist/browserslist#queries
|
|
4
|
+
|
|
5
|
+
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
+
# https://angular.io/guide/browser-support
|
|
7
|
+
|
|
8
|
+
# You can see what browsers were selected by your queries by running:
|
|
9
|
+
# npx browserslist
|
|
10
|
+
|
|
11
|
+
last 1 Chrome version
|
|
12
|
+
last 1 Firefox version
|
|
13
|
+
last 2 Edge major versions
|
|
14
|
+
# last 2 Safari major versions
|
|
15
|
+
last 2 iOS major versions
|
|
16
|
+
Firefox ESR
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/karma.conf.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: '',
|
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
+
plugins: [
|
|
9
|
+
require('karma-jasmine'),
|
|
10
|
+
require('karma-chrome-launcher'),
|
|
11
|
+
require('karma-jasmine-html-reporter'),
|
|
12
|
+
require('karma-coverage'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
jasmine: {
|
|
17
|
+
// you can add configuration options for Jasmine here
|
|
18
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
+
// for example, you can disable the random execution with `random: false`
|
|
20
|
+
// or set a specific seed with `seed: 4321`
|
|
21
|
+
},
|
|
22
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
+
},
|
|
24
|
+
jasmineHtmlReporter: {
|
|
25
|
+
suppressAll: true // removes the duplicated traces
|
|
26
|
+
},
|
|
27
|
+
coverageReporter: {
|
|
28
|
+
dir: require('path').join(__dirname, '../../coverage/tuain-ng-forms-lib'),
|
|
29
|
+
subdir: '.',
|
|
30
|
+
reporters: [
|
|
31
|
+
{ type: 'html' },
|
|
32
|
+
{ type: 'text-summary' }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
reporters: ['progress', 'kjhtml'],
|
|
36
|
+
port: 9876,
|
|
37
|
+
colors: true,
|
|
38
|
+
logLevel: config.LOG_INFO,
|
|
39
|
+
autoWatch: true,
|
|
40
|
+
browsers: ['Chrome'],
|
|
41
|
+
singleRun: false,
|
|
42
|
+
restartOnFileChange: true
|
|
43
|
+
});
|
|
44
|
+
};
|
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tuain-ng-forms-lib",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.93",
|
|
4
4
|
"description": "Componentes y Clases Angular para la gestión de formularios TUAIN",
|
|
5
5
|
"author": "Mauricio Méndez, Imix Consulting",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,31 +16,13 @@
|
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@angular/common": "^14.2.6",
|
|
19
|
-
"@angular/core": "^14.2.6"
|
|
19
|
+
"@angular/core": "^14.2.6",
|
|
20
|
+
"ts-node": "^10.9.1",
|
|
21
|
+
"ts-node-dev": "^2.0.0"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
22
24
|
"nanoid": "^4.0.0",
|
|
23
25
|
"tslib": "^2.4.0",
|
|
24
26
|
"yn": "^5.0.0"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
"es2020": "fesm2020/tuain-ng-forms-lib.mjs",
|
|
28
|
-
"esm2020": "esm2020/tuain-ng-forms-lib.mjs",
|
|
29
|
-
"fesm2020": "fesm2020/tuain-ng-forms-lib.mjs",
|
|
30
|
-
"fesm2015": "fesm2015/tuain-ng-forms-lib.mjs",
|
|
31
|
-
"typings": "tuain-ng-forms-lib.d.ts",
|
|
32
|
-
"exports": {
|
|
33
|
-
"./package.json": {
|
|
34
|
-
"default": "./package.json"
|
|
35
|
-
},
|
|
36
|
-
".": {
|
|
37
|
-
"types": "./tuain-ng-forms-lib.d.ts",
|
|
38
|
-
"esm2020": "./esm2020/tuain-ng-forms-lib.mjs",
|
|
39
|
-
"es2020": "./fesm2020/tuain-ng-forms-lib.mjs",
|
|
40
|
-
"es2015": "./fesm2015/tuain-ng-forms-lib.mjs",
|
|
41
|
-
"node": "./fesm2015/tuain-ng-forms-lib.mjs",
|
|
42
|
-
"default": "./fesm2020/tuain-ng-forms-lib.mjs"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"sideEffects": false
|
|
46
|
-
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import { elementTypes } from './form.constants';
|
|
3
|
+
import { FormElement } from './element';
|
|
4
|
+
|
|
5
|
+
const HEADER = 'HEADER';
|
|
6
|
+
|
|
7
|
+
export class FormAction extends FormElement {
|
|
8
|
+
private readonly _actionActivated = new Subject<string>();
|
|
9
|
+
|
|
10
|
+
inProgress = false;
|
|
11
|
+
newState: string;
|
|
12
|
+
backend: boolean;
|
|
13
|
+
|
|
14
|
+
actionCode: string;
|
|
15
|
+
actionName: string;
|
|
16
|
+
iconName: string;
|
|
17
|
+
|
|
18
|
+
restrictedOnField: string;
|
|
19
|
+
restrictedOnOperator: string;
|
|
20
|
+
restrictedOnValue: string;
|
|
21
|
+
customValidation: any;
|
|
22
|
+
|
|
23
|
+
constructor(actionDefinition, formConfig) {
|
|
24
|
+
super(actionDefinition, formConfig);
|
|
25
|
+
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.actions ?? [];
|
|
26
|
+
this.elementType = elementTypes.action;
|
|
27
|
+
this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
|
|
28
|
+
this.actionName = actionDefinition.actionTitle;
|
|
29
|
+
this.iconName = actionDefinition.iconName || this.actionCode;
|
|
30
|
+
this.setCustomAttribute('location', actionDefinition.position || HEADER);
|
|
31
|
+
this.backend = actionDefinition?.serverAction ?? false;
|
|
32
|
+
this.newState = actionDefinition?.newState;
|
|
33
|
+
|
|
34
|
+
this.restrictedOnField = actionDefinition.fieldRestrictedCode ? actionDefinition.fieldRestrictedCode.toString() : '';
|
|
35
|
+
this.restrictedOnOperator = actionDefinition.operatorRestricted || '';
|
|
36
|
+
this.restrictedOnValue = actionDefinition.valueRestricted ?? '';
|
|
37
|
+
this.customValidation = () => true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get actionActivated() { return this._actionActivated; }
|
|
41
|
+
|
|
42
|
+
start() { this.inProgress = true; }
|
|
43
|
+
stop() { this.inProgress = false; }
|
|
44
|
+
|
|
45
|
+
notifyActivation() { this._actionActivated.next(this.actionCode); }
|
|
46
|
+
|
|
47
|
+
updateFromServer(receivedAction) {
|
|
48
|
+
for (const propertyName in receivedAction) {
|
|
49
|
+
if (propertyName !== 'actionCode' && propertyName !== 'actionId') {
|
|
50
|
+
this[propertyName] = receivedAction[propertyName];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
setCustomValidation(callback) { this.customValidation = () => callback(); }
|
|
56
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FormPiecePropagate } from './piece-propagate';
|
|
2
|
+
import { elementTypes } from './form.constants';
|
|
3
|
+
export class FormElement extends FormPiecePropagate {
|
|
4
|
+
elementType: string | null = null;;
|
|
5
|
+
|
|
6
|
+
constructor(elementDefinition: any, formConfig: any) {
|
|
7
|
+
super(elementDefinition, formConfig);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
setAttr(attr: any, value: any) {
|
|
11
|
+
const { name: attrName, propagate: name } = attr;
|
|
12
|
+
this[attrName] = value;
|
|
13
|
+
name && this.propagateAttribute(name, value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
isField(): boolean { return this.elementType === elementTypes.field; }
|
|
17
|
+
isAction(): boolean { return this.elementType === elementTypes.action; }
|
|
18
|
+
isTable(): boolean { return this.elementType === elementTypes.table; }
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Utilizar viewOnState
|
|
22
|
+
*/
|
|
23
|
+
supportState(state: string): boolean { return this.viewOnState(state); }
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Utilizar viewOnState
|
|
27
|
+
*/
|
|
28
|
+
supportMode(state: string): boolean { return this.viewOnState(state); }
|
|
29
|
+
}
|