@mckit/schematics 0.0.12 → 0.0.14
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/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import { CommonModule } from '@angular/common';
|
|
|
2
2
|
import { Component, inject, OnInit, viewChild } from '@angular/core';
|
|
3
3
|
import { MCOdataPage } from '@mckit/odata';
|
|
4
4
|
import { MenuItem } from 'primeng/api';
|
|
5
|
-
import { Observable, of } from 'rxjs';
|
|
6
5
|
import { ButtonModule } from 'primeng/button';
|
|
7
6
|
import { MCActionsColumn, MCTdTemplateDirective, MCThTemplateDirective } from '@mckit/table';
|
|
8
7
|
|
package/src/add-table/index.js
CHANGED
|
@@ -22,26 +22,31 @@ function addTable(_options) {
|
|
|
22
22
|
let classNameCamel = nameComponent;
|
|
23
23
|
// Convertir nombre de la clase CamelCase a kebab-case
|
|
24
24
|
let classNameKebab = classNameCamel.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
|
|
25
|
+
// Verificar si el primer caracter de classNameKebab es un guion ( - )
|
|
26
|
+
if (classNameKebab.charAt(0) === '-') {
|
|
27
|
+
classNameKebab = classNameKebab.substring(1);
|
|
28
|
+
}
|
|
25
29
|
// Convertir nombre de la clase CamelCase a snake_case
|
|
26
30
|
//let classNameSnake = classNameCamel.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1_$2').toLowerCase();
|
|
27
31
|
// Get properties by class
|
|
28
32
|
let classProperty = (0, get_properties_by_class_1.getPropertiesByClass)(tree, _options.name);
|
|
29
33
|
// Create HTML file
|
|
30
|
-
(0, create_file_with_template_1.createFileWithTemplate)(tree, __dirname, `${path}/${classNameKebab}.component.html`, '__class__.component.html.template', {
|
|
34
|
+
(0, create_file_with_template_1.createFileWithTemplate)(tree, __dirname, `${path}/${classNameKebab}/${classNameKebab}.component.html`, '__class__.component.html.template', {
|
|
31
35
|
'className': classNameKebab
|
|
32
36
|
});
|
|
33
37
|
// Create SCSS file
|
|
34
|
-
(0, create_file_with_template_1.createFileWithTemplate)(tree, __dirname, `${path}/${classNameKebab}.component.scss`, '__class__.component.scss.template', {
|
|
38
|
+
(0, create_file_with_template_1.createFileWithTemplate)(tree, __dirname, `${path}/${classNameKebab}/${classNameKebab}.component.scss`, '__class__.component.scss.template', {
|
|
35
39
|
'className': classNameKebab
|
|
36
40
|
});
|
|
37
41
|
// Generate content for columns variable
|
|
38
42
|
let columns = '';
|
|
39
43
|
classProperty.properties.forEach((property) => {
|
|
40
|
-
columns += `{ field: '${property}', title: '${property}' }
|
|
44
|
+
columns += `{ field: '${property}', title: '${property}' },
|
|
45
|
+
`;
|
|
41
46
|
});
|
|
42
47
|
columns += "{ field: 'actions', title: 'Actions' }";
|
|
43
48
|
// Create TS file
|
|
44
|
-
(0, create_file_with_template_1.createFileWithTemplate)(tree, __dirname, `${path}/${classNameKebab}.component.ts`, '__class__.component.ts.template', {
|
|
49
|
+
(0, create_file_with_template_1.createFileWithTemplate)(tree, __dirname, `${path}/${classNameKebab}/${classNameKebab}.component.ts`, '__class__.component.ts.template', {
|
|
45
50
|
'className': classNameKebab,
|
|
46
51
|
'classNameCamel': classNameCamel,
|
|
47
52
|
'columns': columns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAUA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAUA,4BA4DC;AArED,qDAAiD;AACjD,iFAA2E;AAC3E,6EAAkF;AAOlF,SAAgB,QAAQ,CAAC,QAAuB;IAC9C,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAEhD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,SAAS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AAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC5C,OAAO,IAAI,aAAa,QAAQ,cAAc,QAAQ;SACnD,CAAC;QACN,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,wCAAwC,CAAC;QAEpD,iBAAiB;QACjB,IAAA,kDAAsB,EAAC,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,IAAI,cAAc,IAAI,cAAc,eAAe,EAAE,iCAAiC,EAAE;YACrI,WAAW,EAAE,cAAc;YAC3B,gBAAgB,EAAE,cAAc;YAChC,SAAS,EAAE,OAAO;SACnB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -6,19 +6,11 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"name": {
|
|
8
8
|
"type": "string",
|
|
9
|
-
"description": "
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
}
|
|
9
|
+
"description": "Ruta de la entidad"
|
|
14
10
|
},
|
|
15
11
|
"component": {
|
|
16
12
|
"type": "string",
|
|
17
|
-
"description": "Ruta donde se creara el component"
|
|
18
|
-
"$default": {
|
|
19
|
-
"$source": "argv",
|
|
20
|
-
"index": 1
|
|
21
|
-
}
|
|
13
|
+
"description": "Ruta donde se creara el component"
|
|
22
14
|
}
|
|
23
15
|
},
|
|
24
16
|
"required": ["name", "component"]
|