tuain-ng-forms-lib 14.0.2 → 14.0.4

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.
Files changed (99) hide show
  1. package/esm2020/lib/classes/forms/action.mjs +35 -0
  2. package/esm2020/lib/classes/forms/element.mjs +76 -0
  3. package/esm2020/lib/classes/forms/field.mjs +321 -0
  4. package/esm2020/lib/classes/forms/form.constants.mjs +26 -0
  5. package/esm2020/lib/classes/forms/form.mjs +434 -0
  6. package/esm2020/lib/classes/forms/section.mjs +132 -0
  7. package/esm2020/lib/classes/forms/subsection.mjs +70 -0
  8. package/esm2020/lib/classes/forms/table/action.mjs +22 -0
  9. package/esm2020/lib/classes/forms/table/column.mjs +61 -0
  10. package/esm2020/lib/classes/forms/table/row-data.mjs +111 -0
  11. package/esm2020/lib/classes/forms/table/table.mjs +372 -0
  12. package/esm2020/lib/components/elements/action.component.mjs +58 -0
  13. package/esm2020/lib/components/elements/field.component.mjs +90 -0
  14. package/esm2020/lib/components/elements/layout/element.component.mjs +31 -0
  15. package/esm2020/lib/components/elements/layout/form-error.component.mjs +20 -0
  16. package/esm2020/lib/components/elements/layout/form-header.component.mjs +30 -0
  17. package/esm2020/lib/components/elements/layout/section.component.mjs +22 -0
  18. package/esm2020/lib/components/elements/layout/sub-section.component.mjs +24 -0
  19. package/esm2020/lib/components/elements/tables/table-record-action.component.mjs +40 -0
  20. package/esm2020/lib/components/elements/tables/table-record-field.component.mjs +25 -0
  21. package/esm2020/lib/components/elements/tables/table.component.mjs +95 -0
  22. package/esm2020/lib/components/forms/basic-form.mjs +1425 -0
  23. package/esm2020/lib/services/event-manager.service.mjs +18 -0
  24. package/esm2020/lib/services/file-manager.service.mjs +6 -0
  25. package/esm2020/lib/services/form-manager.service.mjs +80 -0
  26. package/esm2020/lib/tuain-ng-forms-lib.module.mjs +71 -0
  27. package/esm2020/public-api.mjs +19 -0
  28. package/esm2020/tuain-ng-forms-lib.mjs +5 -0
  29. package/fesm2015/tuain-ng-forms-lib.mjs +3816 -0
  30. package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -0
  31. package/fesm2020/tuain-ng-forms-lib.mjs +3646 -0
  32. package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -0
  33. package/lib/classes/forms/action.d.ts +22 -0
  34. package/lib/classes/forms/element.d.ts +41 -0
  35. package/lib/classes/forms/field.d.ts +109 -0
  36. package/lib/classes/forms/form.constants.d.ts +25 -0
  37. package/lib/classes/forms/form.d.ts +134 -0
  38. package/lib/classes/forms/section.d.ts +39 -0
  39. package/lib/classes/forms/subsection.d.ts +26 -0
  40. package/lib/classes/forms/table/action.d.ts +20 -0
  41. package/lib/classes/forms/table/column.d.ts +33 -0
  42. package/lib/classes/forms/table/row-data.d.ts +14 -0
  43. package/lib/classes/forms/table/table.d.ts +100 -0
  44. package/lib/components/elements/action.component.d.ts +21 -0
  45. package/lib/components/elements/field.component.d.ts +43 -0
  46. package/lib/components/elements/layout/element.component.d.ts +14 -0
  47. package/lib/components/elements/layout/form-error.component.d.ts +8 -0
  48. package/lib/components/elements/layout/form-header.component.d.ts +12 -0
  49. package/lib/components/elements/layout/section.component.d.ts +10 -0
  50. package/lib/components/elements/layout/sub-section.component.d.ts +11 -0
  51. package/lib/components/elements/tables/table-record-action.component.d.ts +15 -0
  52. package/lib/components/elements/tables/table-record-field.component.d.ts +11 -0
  53. package/lib/components/elements/tables/table.component.d.ts +47 -0
  54. package/lib/components/forms/basic-form.d.ts +307 -0
  55. package/lib/services/event-manager.service.d.ts +9 -0
  56. package/lib/services/file-manager.service.d.ts +5 -0
  57. package/lib/services/form-manager.service.d.ts +28 -0
  58. package/lib/tuain-ng-forms-lib.module.d.ts +20 -0
  59. package/package.json +22 -2
  60. package/{src/public-api.ts → public-api.d.ts} +0 -5
  61. package/tuain-ng-forms-lib.d.ts +5 -0
  62. package/.browserslistrc +0 -16
  63. package/.yarn/cache/nanoid-npm-4.0.0-924f5c6312-7d5946df5c.zip +0 -0
  64. package/.yarn/cache/tslib-npm-2.4.0-9cb6dc5030-8c4aa6a3c5.zip +0 -0
  65. package/.yarn/cache/yn-npm-5.0.0-b001dab23c-f0ec7710d3.zip +0 -0
  66. package/.yarn/install-state.gz +0 -0
  67. package/karma.conf.js +0 -44
  68. package/ng-package.json +0 -11
  69. package/src/lib/classes/forms/action.ts +0 -55
  70. package/src/lib/classes/forms/element.ts +0 -98
  71. package/src/lib/classes/forms/field.ts +0 -408
  72. package/src/lib/classes/forms/form.constants.ts +0 -28
  73. package/src/lib/classes/forms/form.ts +0 -495
  74. package/src/lib/classes/forms/section.ts +0 -154
  75. package/src/lib/classes/forms/subsection.ts +0 -91
  76. package/src/lib/classes/forms/table/action.ts +0 -41
  77. package/src/lib/classes/forms/table/column.ts +0 -91
  78. package/src/lib/classes/forms/table/row-data.ts +0 -118
  79. package/src/lib/classes/forms/table/table.ts +0 -438
  80. package/src/lib/components/elements/action.component.ts +0 -53
  81. package/src/lib/components/elements/field.component.ts +0 -118
  82. package/src/lib/components/elements/layout/element.component.ts +0 -28
  83. package/src/lib/components/elements/layout/form-error.component.ts +0 -11
  84. package/src/lib/components/elements/layout/form-header.component.ts +0 -17
  85. package/src/lib/components/elements/layout/section.component.ts +0 -16
  86. package/src/lib/components/elements/layout/sub-section.component.ts +0 -17
  87. package/src/lib/components/elements/tables/table-record-action.component.ts +0 -37
  88. package/src/lib/components/elements/tables/table-record-field.component.ts +0 -19
  89. package/src/lib/components/elements/tables/table.component.ts +0 -102
  90. package/src/lib/components/forms/basic-form.ts +0 -1496
  91. package/src/lib/services/event-manager.service.ts +0 -21
  92. package/src/lib/services/file-manager.service.ts +0 -6
  93. package/src/lib/services/form-manager.service.ts +0 -89
  94. package/src/lib/services/icon-dictionary.service.ts +0 -159
  95. package/src/lib/tuain-ng-forms-lib.module.ts +0 -40
  96. package/src/test.ts +0 -27
  97. package/tsconfig.lib.json +0 -15
  98. package/tsconfig.lib.prod.json +0 -10
  99. package/tsconfig.spec.json +0 -17
@@ -1,37 +0,0 @@
1
- import { Component, Input, Output, OnInit, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
2
- import { TableEvent, TableActionEvent } from '../../../classes/forms/table/table';
3
-
4
- const INLINE_ACTION = 'INLINE';
5
-
6
- @Component({
7
- selector: 'lib-table-record-action',
8
- template: `<ng-content></ng-content>`,
9
- changeDetection: ChangeDetectionStrategy.OnPush
10
- })
11
-
12
- export class LibTableRecordActionComponent implements OnInit {
13
- @Input() recordId: any;
14
- @Input() recordData: any;
15
- @Input() action: any;
16
-
17
- @Output() actionSelected: EventEmitter<object> = new EventEmitter<object>();
18
-
19
- constructor() { }
20
-
21
- ngOnInit() {
22
- this.start();
23
- }
24
-
25
- start() { }
26
-
27
- onActivate() {
28
- const tableEvent: TableActionEvent = {
29
- actionCode: this.action.actionCode,
30
- recordId: this.recordId,
31
- recordData: this.recordData,
32
- };
33
- this.actionSelected.emit(tableEvent);
34
- }
35
-
36
- class() { }
37
- }
@@ -1,19 +0,0 @@
1
- import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-table-record-field',
5
- template: `<ng-content></ng-content>`,
6
- changeDetection: ChangeDetectionStrategy.OnPush
7
- })
8
-
9
- export class LibTableRecordFieldComponent implements OnInit {
10
- @Input() fieldCode: any;
11
- @Input() fieldType: any;
12
- @Input() fieldValue: any;
13
-
14
- ngOnInit() {
15
- this.start();
16
- }
17
-
18
- start() { }
19
- }
@@ -1,102 +0,0 @@
1
- import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
2
- import { TableRecordData } from '../../../classes/forms/table/row-data';
3
- import { TableActionEvent } from '../../../classes/forms/table/table';
4
- import { RecordTable, TableEvent } from '../../../classes/forms/table/table';
5
-
6
- const changeViewAttributes = ['visibleRecords', 'currentPage', 'recordsPerPage'];
7
-
8
- @Component({
9
- selector: 'lib-table',
10
- template: `<ng-content></ng-content>`,
11
- changeDetection: ChangeDetectionStrategy.OnPush
12
- })
13
-
14
- export class LibTableComponent implements OnInit {
15
- formConfig: any;
16
- globalFilterString: string = '';
17
-
18
- // Atributos sincronizados del objeto
19
- code: any;
20
- columns: any;
21
- currentPage: number = 1;
22
- globalSearch: boolean = false;
23
- visibleRecords: any[];
24
- selectedRecords: any[] = [];
25
- recordsPerPage: any;
26
- totalRecordsNumber: number = 0;
27
- allSelected: boolean = false;
28
- layout: string;
29
-
30
- tableFieldStyles: any;
31
- loaded = false;
32
- selectable = false;
33
- hasActions = false;
34
- inlineActions: any;
35
- globalActions: any;
36
- selectionActions: any;
37
-
38
- @Input() table: RecordTable;
39
- @Input() tableRecords: TableRecordData[];
40
- @Input() disabled: boolean = false;
41
- @Input() state: string;
42
- @Input() waiting: boolean;
43
-
44
- ngOnInit() {
45
- if (this.table) {
46
- this.formConfig = this.table?._formConfig;
47
- this.tableFieldStyles = this.formConfig.tableFieldStyles;
48
- this.selectable = this.table.selectable;
49
- this.hasActions = this.table.hasActions();
50
- this.inlineActions = this.table.getActions(this.formConfig.tableActions.inline);
51
- this.globalActions = this.table.getActions(this.formConfig.tableActions.global);
52
- this.selectionActions = this.table.getActions(this.formConfig.tableActions.selection);
53
- // Inicialización de campos mapeados del objeto
54
- const mapping = Object.entries(this.formConfig.componentTableAttrMap);
55
- for (let index = 0; index < mapping.length; index++) {
56
- const [tableAttrRaw, compAttrRaw] = mapping[index];
57
- const tableAttr = tableAttrRaw.toString();
58
- const compAttr = compAttrRaw.toString();
59
- this.syncAttribute(compAttr, this.table[tableAttr]);
60
- }
61
- // Subscripción a cambios en atributos
62
- this.table.attributeChange.subscribe(event => {
63
- const { name: tableAttr, value } = event;
64
- const compAttr = this.formConfig.componentTableAttrMap[tableAttr];
65
- this.syncAttribute(compAttr, value);
66
- });
67
- }
68
- this.start();
69
- }
70
-
71
- start() { }
72
- updateTableData() { }
73
- tableGlobalAction(actionCode: string) { this.table.notifyGlobalAction(actionCode); }
74
- tableSelectionAction(actionCode: string) { this.table.notifySelectionAction(actionCode); }
75
- tableActionSelected(actionEvent: TableActionEvent) { this.table.notifyInlineAction(actionEvent); }
76
- tableSelectionToggle(recordId: any) { this.table.notifyRecordSelection(recordId); }
77
- toggleSelectAll() { return (this.allSelected) ? this.table.unSelectAll() : this.table.selectAll(); }
78
- globalFilterCompleted() { this.changePage(1); }
79
- changePage(requestedPage: number) { this.table.changePage(requestedPage); }
80
- tableColumnSort(columnName: string, direction = null) { this.table.sort(columnName, direction ?? 'ascend'); }
81
- globalFilterChanged() { this.table.setGlobalFilterString(this.globalFilterString?.trim() ?? ''); }
82
-
83
- syncAttribute(name: string, value: any) {
84
- try {
85
- if (name === 'visibleRecords') {
86
- this.updateTableData();
87
- }
88
- this[name] = value;
89
- return true;
90
- } catch {
91
- return false;
92
- }
93
- }
94
-
95
- filterHasChanged(column, values) {
96
- if (!values || values.length === 0) {
97
- this.table.removeColumnFilter(column.fieldCode);
98
- } else {
99
- this.table.addColumnFilter(column.fieldCode, values);
100
- }
101
- }
102
- }