igniteui-cli 10.0.4 → 10.1.0-alpha.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/lib/templates/IgniteUIForWebComponentsTemplate.js +14 -3
- package/package.json +3 -3
- package/templates/angular/ig-ts/projects/empty/files/package.json +12 -12
- package/templates/webcomponents/TypeScriptFileUpdate.d.ts +5 -4
- package/templates/webcomponents/TypeScriptFileUpdate.js +55 -17
- package/templates/webcomponents/igc-ts/accordion/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/accordion/default/files/src/app/__path__/__filePrefix__.ts +30 -0
- package/templates/webcomponents/igc-ts/accordion/default/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/accordion/default/index.js +19 -0
- package/templates/webcomponents/igc-ts/accordion/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/accordion/index.js +15 -0
- package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +1 -11
- package/templates/webcomponents/igc-ts/custom-templates/subscription-form/files/src/app/__path__/__filePrefix__.ts +6 -1
- package/templates/webcomponents/igc-ts/date-time-input/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/date-time-input/default/files/src/app/__path__/__filePrefix__.ts +38 -0
- package/templates/webcomponents/igc-ts/date-time-input/default/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/date-time-input/default/index.js +19 -0
- package/templates/webcomponents/igc-ts/date-time-input/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/date-time-input/index.js +15 -0
- package/templates/webcomponents/igc-ts/dropdown/default/files/src/app/__path__/__filePrefix__.ts +0 -4
- package/templates/webcomponents/igc-ts/expansion-panel/default/files/src/app/__path__/__filePrefix__.ts +1 -3
- package/templates/webcomponents/igc-ts/form/default/files/src/app/__path__/__filePrefix__.ts +4 -2
- package/templates/webcomponents/igc-ts/list/default/files/src/app/__path__/__filePrefix__.ts +0 -4
- package/templates/webcomponents/igc-ts/navbar/default/files/src/app/__path__/__filePrefix__.ts +4 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/index.html +1 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +9 -29
- package/templates/webcomponents/igc-ts/projects/_base/files/rollup.config.mjs +3 -3
- package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app-routing.ts +1 -5
- package/templates/webcomponents/igc-ts/projects/_base/files/src/app/app.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/_base/files/styles.css +2 -1
- package/templates/webcomponents/igc-ts/projects/_base/files/web-dev-server.config.mjs +16 -16
- package/templates/webcomponents/igc-ts/projects/_base/files/web-test-runner.config.mjs +36 -36
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/index.html +18 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +75 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/src/app/app-routing.ts +9 -0
- package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.test.ts +0 -0
- package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.ts +0 -0
- package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/assets/astronaut-components.svg +0 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/index.d.ts +8 -0
- package/templates/webcomponents/igc-ts/projects/_base_with_home/index.js +17 -0
- package/templates/webcomponents/igc-ts/projects/base/index.d.ts +14 -0
- package/templates/webcomponents/igc-ts/projects/base/index.js +21 -0
- package/templates/webcomponents/igc-ts/projects/empty/index.d.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/empty/index.js +2 -2
- package/templates/webcomponents/igc-ts/projects/side-nav/files/src/app/app.ts +0 -4
- package/templates/webcomponents/igc-ts/projects/side-nav/index.d.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/side-nav/index.js +2 -2
- package/templates/webcomponents/igc-ts/radio-group/default/files/src/app/__path__/__filePrefix__.ts +1 -2
- package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.test +9 -0
- package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.ts +56 -0
- package/templates/webcomponents/igc-ts/tabs/default/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/tabs/default/index.js +19 -0
- package/templates/webcomponents/igc-ts/tabs/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/tabs/index.js +15 -0
- package/templates/webcomponents/igc-ts/tree/default/files/src/app/__path__/__filePrefix__.ts +1 -2
|
@@ -28,10 +28,21 @@ class IgniteUIForWebComponentsTemplate {
|
|
|
28
28
|
return Object.assign({}, options["extraConfig"], this.getBaseVariables(name));
|
|
29
29
|
}
|
|
30
30
|
registerInProject(projectPath, fullName, options) {
|
|
31
|
+
cli_core_1.App.initialize(); // remove after POC
|
|
32
|
+
const routeModulePath = path.posix.join(`src/app`, `${options.routingModulePath}-routing.ts`);
|
|
33
|
+
let routingModule;
|
|
31
34
|
if (!(options && options.skipRoute) && cli_core_1.App.container.get(cli_core_1.FS_TOKEN)
|
|
32
|
-
.fileExists(
|
|
33
|
-
|
|
34
|
-
routingModule.addRoute(path.join(projectPath, `src/app/${this.folderName(fullName)}/${this.fileName(fullName)}.component.ts`), this.fileName(fullName), cli_core_1.Util.nameFromPath(fullName));
|
|
35
|
+
.fileExists(routeModulePath)) {
|
|
36
|
+
routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, routeModulePath));
|
|
37
|
+
routingModule.addRoute(path.join(projectPath, `src/app/${this.folderName(fullName)}/${this.fileName(fullName)}.component.ts`), this.fileName(fullName), cli_core_1.Util.nameFromPath(fullName), options);
|
|
38
|
+
}
|
|
39
|
+
if (options.routingModulePath !== "app") {
|
|
40
|
+
routingModule = new TypeScriptFileUpdate_1.TypeScriptFileUpdate(path.join(projectPath, "src/app/app-routing.ts"));
|
|
41
|
+
const routingModuleText = routingModule.targetSource.text;
|
|
42
|
+
const moduleName = options.routingModulePath.split("/")[1];
|
|
43
|
+
if (routingModuleText.indexOf(moduleName + "-routing") < 0) {
|
|
44
|
+
routingModule.addRoute(path.join(projectPath, `src/app/${options.routingModulePath}-routing.ts`), this.fileName(`${options.routingModulePath}-routing.ts`), cli_core_1.Util.nameFromPath(`${options.routingModulePath}-routing.ts`), options, options.parentName);
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
47
|
}
|
|
37
48
|
getExtraConfiguration() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-cli",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.1.0-alpha.0",
|
|
4
4
|
"description": "CLI tool for creating Ignite UI projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"all": true
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@igniteui/angular-templates": "~14.0
|
|
76
|
-
"@igniteui/cli-core": "~10.0.
|
|
75
|
+
"@igniteui/angular-templates": "~14.1.1010-alpha.0",
|
|
76
|
+
"@igniteui/cli-core": "~10.1.0-alpha.0",
|
|
77
77
|
"chalk": "^2.3.2",
|
|
78
78
|
"fs-extra": "^3.0.1",
|
|
79
79
|
"glob": "^7.1.2",
|
|
@@ -10,26 +10,26 @@
|
|
|
10
10
|
},
|
|
11
11
|
"private": true,
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@angular/animations": "~14.
|
|
14
|
-
"@angular/common": "~14.
|
|
15
|
-
"@angular/compiler": "~14.
|
|
16
|
-
"@angular/core": "~14.
|
|
17
|
-
"@angular/forms": "~14.
|
|
18
|
-
"@angular/platform-browser": "~14.
|
|
19
|
-
"@angular/platform-browser-dynamic": "~14.
|
|
20
|
-
"@angular/router": "~14.
|
|
13
|
+
"@angular/animations": "~14.1.0",
|
|
14
|
+
"@angular/common": "~14.1.0",
|
|
15
|
+
"@angular/compiler": "~14.1.0",
|
|
16
|
+
"@angular/core": "~14.1.0",
|
|
17
|
+
"@angular/forms": "~14.1.0",
|
|
18
|
+
"@angular/platform-browser": "~14.1.0",
|
|
19
|
+
"@angular/platform-browser-dynamic": "~14.1.0",
|
|
20
|
+
"@angular/router": "~14.1.0",
|
|
21
21
|
"jquery": ">=1.9.1",
|
|
22
22
|
"jquery-ui": ">=1.10.5",
|
|
23
|
-
"igniteui-angular-wrappers": "~14.
|
|
23
|
+
"igniteui-angular-wrappers": "~14.1.0",
|
|
24
24
|
"ignite-ui": "~21.2",
|
|
25
25
|
"rxjs": "~7.5.0",
|
|
26
26
|
"tslib": "^2.3.0",
|
|
27
27
|
"zone.js": "~0.11.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@angular-devkit/build-angular": "~14.
|
|
31
|
-
"@angular/cli": "~14.
|
|
32
|
-
"@angular/compiler-cli": "~14.
|
|
30
|
+
"@angular-devkit/build-angular": "~14.1.0",
|
|
31
|
+
"@angular/cli": "~14.1.0",
|
|
32
|
+
"@angular/compiler-cli": "~14.1.0",
|
|
33
33
|
"@types/jasmine": "~4.0.0",
|
|
34
34
|
"@types/node": "^12.11.1",
|
|
35
35
|
"igniteui-cli": "^$(cliVersion)",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AddTemplateArgs } from "@igniteui/cli-core";
|
|
1
2
|
import * as ts from "typescript";
|
|
2
3
|
/**
|
|
3
4
|
* Apply various updates to typescript files using AST
|
|
@@ -18,18 +19,18 @@ export declare class TypeScriptFileUpdate {
|
|
|
18
19
|
constructor(targetPath: string);
|
|
19
20
|
/** Applies accumulated transforms, saves and formats the file */
|
|
20
21
|
finalize(): void;
|
|
21
|
-
addRoute(filePath: string, linkPath: string, linkText: string, routesVariable?: string): void;
|
|
22
|
+
addRoute(filePath: string, linkPath: string, linkText: string, options: AddTemplateArgs, parentName: string, routesVariable?: string): void;
|
|
22
23
|
/** Initializes existing imports info, [re]sets import and `NgModule` edits */
|
|
23
24
|
protected initState(): void;
|
|
24
25
|
protected loadImportsMeta(): {
|
|
25
26
|
lastIndex: number;
|
|
26
27
|
modulePaths: any[];
|
|
27
28
|
};
|
|
28
|
-
protected addRouteModuleEntry(targetPath: string, filePath: string, linkText: string,
|
|
29
|
-
protected requestImport(modulePath: string): void;
|
|
29
|
+
protected addRouteModuleEntry(targetPath: string, filePath: string, linkText: string, routesVariable: string, options: any, parentName?: string): void;
|
|
30
|
+
protected requestImport(modulePath: string, parentName: string): void;
|
|
30
31
|
/** Add `import` statements not previously found in the file */
|
|
31
32
|
protected addNewFileImports(): void;
|
|
32
|
-
protected createIdentifierImport(importPath: string): ts.ImportDeclaration;
|
|
33
|
+
protected createIdentifierImport(importPath: string, as: string): ts.ImportDeclaration;
|
|
33
34
|
/** Transformation to apply edits to existing named import declarations */
|
|
34
35
|
protected importsTransformer: ts.TransformerFactory<ts.Node>;
|
|
35
36
|
/** Format a TS source file, very TBD */
|
|
@@ -46,8 +46,8 @@ class TypeScriptFileUpdate {
|
|
|
46
46
|
// reset state in case of further updates
|
|
47
47
|
this.initState();
|
|
48
48
|
}
|
|
49
|
-
addRoute(filePath, linkPath, linkText, routesVariable = DEFAULT_ROUTES_VARIABLE) {
|
|
50
|
-
this.addRouteModuleEntry(filePath, linkPath, linkText, routesVariable);
|
|
49
|
+
addRoute(filePath, linkPath, linkText, options, parentName, routesVariable = DEFAULT_ROUTES_VARIABLE) {
|
|
50
|
+
this.addRouteModuleEntry(filePath, linkPath, linkText, routesVariable, options, parentName);
|
|
51
51
|
}
|
|
52
52
|
//#region File state
|
|
53
53
|
/** Initializes existing imports info, [re]sets import and `NgModule` edits */
|
|
@@ -82,17 +82,26 @@ class TypeScriptFileUpdate {
|
|
|
82
82
|
return meta;
|
|
83
83
|
}
|
|
84
84
|
//#endregion File state
|
|
85
|
-
addRouteModuleEntry(targetPath, filePath, linkText,
|
|
85
|
+
addRouteModuleEntry(targetPath, filePath, linkText, routesVariable = DEFAULT_ROUTES_VARIABLE, options, parentName) {
|
|
86
|
+
const isRouting = filePath.indexOf("routing") >= 0;
|
|
87
|
+
if (isRouting && this.targetSource.text.indexOf(filePath.slice(0, -3)) > 0) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
86
90
|
let className;
|
|
87
|
-
const
|
|
91
|
+
const moduleName = filePath.substring(0, filePath.indexOf("-routing"));
|
|
92
|
+
const relativePath = isRouting ?
|
|
93
|
+
"./" + moduleName + "/" + filePath.slice(0, -3) : "./" + filePath + "/" + filePath;
|
|
94
|
+
const hasParent = parentName ? true : false;
|
|
95
|
+
const hasChildren = options.hasChildren ? true : false;
|
|
96
|
+
const hasNestedModule = (!hasParent && hasChildren) ? true : false;
|
|
88
97
|
className = "app-" + filePath;
|
|
89
|
-
this.requestImport(relativePath);
|
|
98
|
+
this.requestImport(relativePath, parentName);
|
|
90
99
|
// https://github.com/Microsoft/TypeScript/issues/14419#issuecomment-307256171
|
|
91
100
|
const transformer = (context) => (rootNode) => {
|
|
92
101
|
// the visitor that should be used when adding routes to the main route array
|
|
93
102
|
const conditionalVisitor = (node) => {
|
|
94
103
|
if (node.kind === ts.SyntaxKind.ArrayLiteralExpression) {
|
|
95
|
-
const newObject = this.createRouteEntry(filePath, className, linkText);
|
|
104
|
+
const newObject = this.createRouteEntry(filePath, className, linkText, hasNestedModule);
|
|
96
105
|
const array = node;
|
|
97
106
|
this.createdStringLiterals.push(filePath, linkText);
|
|
98
107
|
const notFoundWildCard = ".*";
|
|
@@ -118,11 +127,19 @@ class TypeScriptFileUpdate {
|
|
|
118
127
|
return ts.visitEachChild(node, conditionalVisitor, context);
|
|
119
128
|
}
|
|
120
129
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
node.
|
|
125
|
-
|
|
130
|
+
let visitCondition;
|
|
131
|
+
if (!isRouting) {
|
|
132
|
+
visitCondition = (node) => {
|
|
133
|
+
return node.kind === ts.SyntaxKind.VariableDeclaration &&
|
|
134
|
+
node.name.getText() === routesVariable &&
|
|
135
|
+
node.type.getText() === "Route[]";
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
visitCondition = (node) => {
|
|
140
|
+
return undefined;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
126
143
|
const visitor = this.createVisitor(conditionalVisitor, visitCondition, context);
|
|
127
144
|
context.enableSubstitution(ts.SyntaxKind.ClassDeclaration);
|
|
128
145
|
return ts.visitNode(rootNode, visitor);
|
|
@@ -132,11 +149,13 @@ class TypeScriptFileUpdate {
|
|
|
132
149
|
}).transformed[0];
|
|
133
150
|
this.finalize();
|
|
134
151
|
}
|
|
135
|
-
requestImport(modulePath) {
|
|
152
|
+
requestImport(modulePath, parentName) {
|
|
136
153
|
const existing = this.requestedImports.find(x => x.from === modulePath);
|
|
137
154
|
if (!existing) {
|
|
155
|
+
const exportedObject = parentName ? parentName : undefined;
|
|
138
156
|
// new imports, check if already exists in file
|
|
139
157
|
this.requestedImports.push({
|
|
158
|
+
as: exportedObject,
|
|
140
159
|
from: modulePath,
|
|
141
160
|
edit: this.importsMeta.modulePaths.indexOf(modulePath) !== -1
|
|
142
161
|
});
|
|
@@ -153,14 +172,27 @@ class TypeScriptFileUpdate {
|
|
|
153
172
|
}
|
|
154
173
|
const newStatements = ts.factory.createNodeArray([
|
|
155
174
|
...this.targetSource.statements.slice(0, this.importsMeta.lastIndex),
|
|
156
|
-
...newImports.map(x => this.createIdentifierImport(x.from)),
|
|
175
|
+
...newImports.map(x => this.createIdentifierImport(x.from, x.as)),
|
|
157
176
|
...this.targetSource.statements.slice(this.importsMeta.lastIndex)
|
|
158
177
|
]);
|
|
159
178
|
newImports.forEach(x => this.createdStringLiterals.push(x.from));
|
|
160
179
|
this.targetSource = ts.factory.updateSourceFile(this.targetSource, newStatements);
|
|
161
180
|
}
|
|
162
|
-
createIdentifierImport(importPath) {
|
|
163
|
-
|
|
181
|
+
createIdentifierImport(importPath, as) {
|
|
182
|
+
let exportedObject;
|
|
183
|
+
let exportedObjectName;
|
|
184
|
+
let importClause;
|
|
185
|
+
if (as) {
|
|
186
|
+
exportedObject = "routes";
|
|
187
|
+
exportedObjectName = as.replace(/\s/g, "");
|
|
188
|
+
importClause = ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([
|
|
189
|
+
ts.factory.createImportSpecifier(false, ts.factory.createIdentifier(exportedObject), ts.factory.createIdentifier(exportedObjectName))
|
|
190
|
+
]));
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
importClause = undefined;
|
|
194
|
+
}
|
|
195
|
+
const importDeclaration = ts.factory.createImportDeclaration(undefined, undefined, importClause, ts.factory.createStringLiteral(importPath));
|
|
164
196
|
return importDeclaration;
|
|
165
197
|
}
|
|
166
198
|
//#endregion ts.TransformerFactory
|
|
@@ -297,11 +329,17 @@ class TypeScriptFileUpdate {
|
|
|
297
329
|
return node;
|
|
298
330
|
};
|
|
299
331
|
}
|
|
300
|
-
createRouteEntry(filePath, className, linkText) {
|
|
332
|
+
createRouteEntry(filePath, className, linkText, hasNestedModule) {
|
|
301
333
|
const routePath = ts.factory.createPropertyAssignment("path", ts.factory.createStringLiteral(filePath));
|
|
302
334
|
const routeComponent = ts.factory.createPropertyAssignment("component", ts.factory.createStringLiteral(className));
|
|
303
335
|
const routeData = ts.factory.createPropertyAssignment("name", ts.factory.createStringLiteral(linkText));
|
|
304
|
-
|
|
336
|
+
const childrenData = ts.factory.createPropertyAssignment("children", ts.factory.createStringLiteral(linkText.replace(/\s/g, "")));
|
|
337
|
+
if (hasNestedModule) {
|
|
338
|
+
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData, childrenData]);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
return ts.factory.createObjectLiteralExpression([routePath, routeComponent, routeData]);
|
|
342
|
+
}
|
|
305
343
|
}
|
|
306
344
|
}
|
|
307
345
|
exports.TypeScriptFileUpdate = TypeScriptFileUpdate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import $(ClassName) from './$(path).js';
|
|
3
|
+
|
|
4
|
+
describe('IgcAccordionComponent', () => {
|
|
5
|
+
it('<app-$(path)> is an instance of $(ClassName)', async () => {
|
|
6
|
+
const element = document.createElement('app-$(path)');
|
|
7
|
+
expect(element).to.be.instanceOf($(ClassName));
|
|
8
|
+
});
|
|
9
|
+
});
|
package/templates/webcomponents/igc-ts/accordion/default/files/src/app/__path__/__filePrefix__.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import {
|
|
4
|
+
defineComponents,
|
|
5
|
+
IgcAccordionComponent,
|
|
6
|
+
} from 'igniteui-webcomponents';
|
|
7
|
+
|
|
8
|
+
defineComponents(IgcAccordionComponent);
|
|
9
|
+
|
|
10
|
+
@customElement('app-$(path)')
|
|
11
|
+
export default class $(ClassName) extends LitElement {
|
|
12
|
+
render() {
|
|
13
|
+
return html`
|
|
14
|
+
<igc-accordion singleExpand="false" alignment="justify">
|
|
15
|
+
<igc-expansion-panel>
|
|
16
|
+
<div slot="title">Ignite UI for Web Components</div>
|
|
17
|
+
<p>Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.</p>
|
|
18
|
+
</igc-expansion-panel>
|
|
19
|
+
<igc-expansion-panel>
|
|
20
|
+
<div slot="title">Ignite UI for Angular</div>
|
|
21
|
+
<p>Ignite UI for Angular is a complete set of Material-based UI Widgets, Components & Sketch, Adobe XD and Figma UI kits by Infragistics. Ignite UI for Angular is designed to enable developers to build enterprise-ready, high-performance HTML5 & JavaScript apps for modern desktop browsers.</p>
|
|
22
|
+
</igc-expansion-panel>
|
|
23
|
+
<igc-expansion-panel>
|
|
24
|
+
<div slot="title">Ignite UI for jQuery</div>
|
|
25
|
+
<p>Ignite UI for jQuery helps you build powerful, high-performance web-based applications. Inside Ignite UI for jQuery you'll find user experience controls and components for creating engaging line-of-business web applications which target the browsers for both mobile & desktop environments.</p>
|
|
26
|
+
</igc-expansion-panel>
|
|
27
|
+
</igc-accordion>
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const IgniteUIForWebComponentsTemplate_1 = require("../../../../../lib/templates/IgniteUIForWebComponentsTemplate");
|
|
4
|
+
class IgcAccordionTemplate extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.components = ["Accordion"];
|
|
8
|
+
this.controlGroup = "Layouts";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "accordion";
|
|
11
|
+
this.projectType = "igc-ts";
|
|
12
|
+
this.name = "Accordion";
|
|
13
|
+
this.description = "basic IgcAccordion";
|
|
14
|
+
}
|
|
15
|
+
addClassDeclaration(mainModule, projPath, name, modulePath) {
|
|
16
|
+
// not applicable with custom module
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
module.exports = new IgcAccordionTemplate();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgcAccordionComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Accordion";
|
|
11
|
+
this.group = "Layouts";
|
|
12
|
+
this.description = `Basic accordion component`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgcAccordionComponent();
|
package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -2,20 +2,10 @@ import { html, css, LitElement } from 'lit';
|
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import {
|
|
4
4
|
defineComponents,
|
|
5
|
-
IgcCardActionsComponent,
|
|
6
|
-
IgcCardContentComponent,
|
|
7
|
-
IgcCardHeaderComponent,
|
|
8
|
-
IgcCardMediaComponent,
|
|
9
5
|
IgcCardComponent,
|
|
10
6
|
} from 'igniteui-webcomponents';
|
|
11
7
|
|
|
12
|
-
defineComponents(
|
|
13
|
-
IgcCardComponent,
|
|
14
|
-
IgcCardActionsComponent,
|
|
15
|
-
IgcCardContentComponent,
|
|
16
|
-
IgcCardHeaderComponent,
|
|
17
|
-
IgcCardMediaComponent,
|
|
18
|
-
);
|
|
8
|
+
defineComponents(IgcCardComponent);
|
|
19
9
|
|
|
20
10
|
@customElement('app-$(path)')
|
|
21
11
|
export default class $(ClassName) extends LitElement {
|
|
@@ -8,7 +8,12 @@ import {
|
|
|
8
8
|
IgcButtonComponent,
|
|
9
9
|
} from 'igniteui-webcomponents';
|
|
10
10
|
|
|
11
|
-
defineComponents(
|
|
11
|
+
defineComponents(
|
|
12
|
+
IgcFormComponent,
|
|
13
|
+
IgcInputComponent,
|
|
14
|
+
IgcCheckboxComponent,
|
|
15
|
+
IgcButtonComponent,
|
|
16
|
+
);
|
|
12
17
|
|
|
13
18
|
@customElement('app-$(path)')
|
|
14
19
|
export default class $(ClassName) extends LitElement {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import $(ClassName) from './$(path).js';
|
|
3
|
+
|
|
4
|
+
describe('gcDateTimeInputComponent', () => {
|
|
5
|
+
it('<app-$(path)> is an instance of $(ClassName)', async () => {
|
|
6
|
+
const element = document.createElement('app-$(path)');
|
|
7
|
+
expect(element).to.be.instanceOf($(ClassName));
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { customElement, query } from 'lit/decorators.js';
|
|
3
|
+
import {
|
|
4
|
+
defineComponents,
|
|
5
|
+
IgcDateTimeInputComponent,
|
|
6
|
+
registerIconFromText
|
|
7
|
+
} from 'igniteui-webcomponents';
|
|
8
|
+
|
|
9
|
+
defineComponents(IgcDateTimeInputComponent);
|
|
10
|
+
const clearIcon =
|
|
11
|
+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>';
|
|
12
|
+
registerIconFromText('clear', clearIcon, 'material');
|
|
13
|
+
|
|
14
|
+
@customElement('app-$(path)')
|
|
15
|
+
export default class $(ClassName) extends LitElement {
|
|
16
|
+
@query('igc-date-time-input')
|
|
17
|
+
_input!: Element
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
return html`
|
|
21
|
+
<igc-date-time-input
|
|
22
|
+
label="Choose Date"
|
|
23
|
+
.value=${new Date(2022, 6, 12, 7, 30, 0)}
|
|
24
|
+
.inputFormat="dd/MM/yyyy"
|
|
25
|
+
.displayFormat="dd/MM/yyyy"
|
|
26
|
+
.minValue=${new Date(2022, 6, 2, 7, 30, 0)}
|
|
27
|
+
.maxValue=${new Date(2022, 6, 27, 7, 30, 0)}
|
|
28
|
+
.spinDelta={date: 2, year: 10,}>
|
|
29
|
+
<igc-icon name="clear" collection='material' size='large' slot="suffix" @click=${this.handleClear}></igc-icon>
|
|
30
|
+
<span slot="helper-text">This is some helper text</span>
|
|
31
|
+
</igc-date-time-input>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
handleClear() {
|
|
36
|
+
(this._input as IgcDateTimeInputComponent)!.clear();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const IgniteUIForWebComponentsTemplate_1 = require("../../../../../lib/templates/IgniteUIForWebComponentsTemplate");
|
|
4
|
+
class IgcDateTimeInputTemplate extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.components = ["DateTime Input"];
|
|
8
|
+
this.controlGroup = "Data Entry & Display";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "date-time-input";
|
|
11
|
+
this.projectType = "igc-ts";
|
|
12
|
+
this.name = "DateTime Input";
|
|
13
|
+
this.description = "basic IgcDateTimeInput";
|
|
14
|
+
}
|
|
15
|
+
addClassDeclaration(mainModule, projPath, name, modulePath) {
|
|
16
|
+
// not applicable with custom module
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
module.exports = new IgcDateTimeInputTemplate();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgcDateTimeInputComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "DateTimeInput";
|
|
11
|
+
this.group = "Data Entry & Display";
|
|
12
|
+
this.description = `Basic date time input component`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgcDateTimeInputComponent();
|
package/templates/webcomponents/igc-ts/dropdown/default/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -4,15 +4,11 @@ import {
|
|
|
4
4
|
defineComponents,
|
|
5
5
|
IgcButtonComponent,
|
|
6
6
|
IgcDropdownComponent,
|
|
7
|
-
IgcDropdownItemComponent,
|
|
8
|
-
IgcDropdownGroupComponent,
|
|
9
7
|
} from 'igniteui-webcomponents';
|
|
10
8
|
|
|
11
9
|
defineComponents(
|
|
12
10
|
IgcButtonComponent,
|
|
13
11
|
IgcDropdownComponent,
|
|
14
|
-
IgcDropdownItemComponent,
|
|
15
|
-
IgcDropdownGroupComponent,
|
|
16
12
|
);
|
|
17
13
|
|
|
18
14
|
@customElement('app-$(path)')
|
|
@@ -5,9 +5,7 @@ import {
|
|
|
5
5
|
IgcExpansionPanelComponent,
|
|
6
6
|
} from 'igniteui-webcomponents';
|
|
7
7
|
|
|
8
|
-
defineComponents(
|
|
9
|
-
IgcExpansionPanelComponent,
|
|
10
|
-
);
|
|
8
|
+
defineComponents(IgcExpansionPanelComponent);
|
|
11
9
|
|
|
12
10
|
@customElement('app-$(path)')
|
|
13
11
|
export default class $(ClassName) extends LitElement {
|
package/templates/webcomponents/igc-ts/form/default/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -3,11 +3,13 @@ import { customElement } from 'lit/decorators.js';
|
|
|
3
3
|
import {
|
|
4
4
|
defineComponents,
|
|
5
5
|
IgcFormComponent,
|
|
6
|
-
IgcRadioComponent,
|
|
7
6
|
IgcRadioGroupComponent,
|
|
8
7
|
} from 'igniteui-webcomponents';
|
|
9
8
|
|
|
10
|
-
defineComponents(
|
|
9
|
+
defineComponents(
|
|
10
|
+
IgcFormComponent,
|
|
11
|
+
IgcRadioGroupComponent,
|
|
12
|
+
);
|
|
11
13
|
|
|
12
14
|
@customElement('app-$(path)')
|
|
13
15
|
export default class $(ClassName) extends LitElement {
|
package/templates/webcomponents/igc-ts/list/default/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -5,16 +5,12 @@ import {
|
|
|
5
5
|
IgcAvatarComponent,
|
|
6
6
|
IgcButtonComponent,
|
|
7
7
|
IgcListComponent,
|
|
8
|
-
IgcListHeaderComponent,
|
|
9
|
-
IgcListItemComponent,
|
|
10
8
|
} from 'igniteui-webcomponents';
|
|
11
9
|
|
|
12
10
|
defineComponents(
|
|
13
11
|
IgcAvatarComponent,
|
|
14
12
|
IgcButtonComponent,
|
|
15
13
|
IgcListComponent,
|
|
16
|
-
IgcListHeaderComponent,
|
|
17
|
-
IgcListItemComponent,
|
|
18
14
|
);
|
|
19
15
|
|
|
20
16
|
@customElement('app-$(path)')
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<base href="/">
|
|
7
7
|
<title>Ignite UI for Web Components</title>
|
|
8
|
-
<link rel="stylesheet" href="./node_modules/igniteui-webcomponents/themes/light/bootstrap.css">
|
|
9
8
|
<link rel="stylesheet" href="./styles.css">
|
|
10
9
|
</head>
|
|
11
10
|
|
|
@@ -14,4 +13,5 @@
|
|
|
14
13
|
|
|
15
14
|
<script type="module" src="./dist/src/index.js"></script>
|
|
16
15
|
</body>
|
|
16
|
+
|
|
17
17
|
</html>
|
|
@@ -21,43 +21,34 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@vaadin/router": "^1.7.4",
|
|
24
|
-
"igniteui-webcomponents": "~3.2.0",
|
|
25
|
-
"igniteui-webcomponents-grids": "~3.2.1",
|
|
26
|
-
"igniteui-webcomponents-core": "~3.2.1",
|
|
27
|
-
"igniteui-webcomponents-layouts": "~3.2.1",
|
|
28
|
-
"igniteui-webcomponents-inputs": "~3.2.1",
|
|
29
|
-
"igniteui-webcomponents-charts": "~3.2.1",
|
|
30
|
-
"igniteui-webcomponents-gauges": "~3.2.1",
|
|
31
|
-
"igniteui-dockmanager": "~1.8.0",
|
|
32
|
-
"@igniteui/material-icons-extended": "^2.11.0",
|
|
33
24
|
"lit": "^2.0.2",
|
|
34
25
|
"typescript": "^4.5.2"
|
|
35
26
|
},
|
|
36
27
|
"devDependencies": {
|
|
37
28
|
"@babel/preset-env": "^7.16.4",
|
|
38
|
-
"@open-wc/testing": "^2.5.33",
|
|
39
29
|
"@open-wc/building-rollup": "^2.0.1",
|
|
30
|
+
"@open-wc/eslint-config": "^4.3.0",
|
|
31
|
+
"@open-wc/testing": "^2.5.33",
|
|
40
32
|
"@rollup/plugin-babel": "^5.3.0",
|
|
41
33
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
42
|
-
"rollup-plugin-copy-assets": "^2.0.3",
|
|
43
|
-
"@open-wc/eslint-config": "^4.3.0",
|
|
44
34
|
"@typescript-eslint/eslint-plugin": "^4.30.0",
|
|
45
35
|
"@typescript-eslint/parser": "^4.30.0",
|
|
46
36
|
"@web/dev-server": "^0.1.22",
|
|
47
37
|
"@web/rollup-plugin-html": "^1.10.1",
|
|
48
38
|
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
|
|
49
|
-
"babel-plugin-template-html-minifier": "^4.1.0",
|
|
50
39
|
"@web/test-runner": "next",
|
|
51
|
-
"
|
|
40
|
+
"babel-plugin-template-html-minifier": "^4.1.0",
|
|
52
41
|
"concurrently": "^6.3.0",
|
|
53
42
|
"deepmerge": "^4.2.2",
|
|
43
|
+
"eslint": "^7.32.0",
|
|
44
|
+
"igniteui-cli": "~10.0.3",
|
|
54
45
|
"rimraf": "^3.0.2",
|
|
55
46
|
"rollup": "^2.60.0",
|
|
47
|
+
"rollup-plugin-copy-assets": "^2.0.3",
|
|
56
48
|
"rollup-plugin-terser": "^7.0.2",
|
|
57
49
|
"rollup-plugin-workbox": "^6.2.0",
|
|
58
|
-
"
|
|
59
|
-
"tslib": "^2.3.1"
|
|
60
|
-
"source-map": "^0.7.3"
|
|
50
|
+
"source-map": "^0.7.3",
|
|
51
|
+
"tslib": "^2.3.1"
|
|
61
52
|
},
|
|
62
53
|
"eslintConfig": {
|
|
63
54
|
"parser": "@typescript-eslint/parser",
|
|
@@ -68,20 +59,9 @@
|
|
|
68
59
|
"@typescript-eslint"
|
|
69
60
|
],
|
|
70
61
|
"rules": {
|
|
71
|
-
"linebreak-style": "off",
|
|
72
62
|
"no-unused-vars": "off",
|
|
73
|
-
"@typescript-eslint/no-unused-vars": [
|
|
74
|
-
"error"
|
|
75
|
-
],
|
|
76
|
-
"import/no-extraneous-dependencies": "off",
|
|
77
63
|
"import/no-unresolved": "off",
|
|
78
|
-
"
|
|
79
|
-
"error",
|
|
80
|
-
"always",
|
|
81
|
-
{
|
|
82
|
-
"ignorePackages": true
|
|
83
|
-
}
|
|
84
|
-
]
|
|
64
|
+
"linebreak-style": "off"
|
|
85
65
|
}
|
|
86
66
|
}
|
|
87
67
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
2
1
|
import babel from '@rollup/plugin-babel';
|
|
3
|
-
import
|
|
2
|
+
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
4
3
|
import { rollupPluginHTML as html } from '@web/rollup-plugin-html';
|
|
5
4
|
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import copy from 'rollup-plugin-copy-assets';
|
|
6
7
|
import { terser } from 'rollup-plugin-terser';
|
|
7
8
|
import { generateSW } from 'rollup-plugin-workbox';
|
|
8
|
-
import path from 'path';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
input: 'index.html',
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Route
|
|
3
|
-
} from '@vaadin/router';
|
|
4
|
-
import './home/home.js';
|
|
1
|
+
import { Route } from '@vaadin/router';
|
|
5
2
|
import './not-found/not-found.js';
|
|
6
3
|
|
|
7
4
|
export const routes: Route[] = [
|
|
8
|
-
{ path: '/', component: 'app-home', name: 'Home' },
|
|
9
5
|
// The fallback route should always be after other alternatives.
|
|
10
6
|
{ path: '(.*)', component: 'app-not-found' },
|
|
11
7
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Router } from '@vaadin/router';
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
2
3
|
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { Router, } from '@vaadin/router';
|
|
4
4
|
import { routes } from './app-routing.js';
|
|
5
5
|
|
|
6
6
|
@customElement('app-root')
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
const hmr = process.argv.includes('--hmr');
|
|
5
5
|
|
|
6
6
|
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
open: '/',
|
|
8
|
+
/** Use regular watch mode if HMR is not enabled. */
|
|
9
|
+
watch: !hmr,
|
|
10
|
+
/** Resolve bare module imports */
|
|
11
|
+
nodeResolve: {
|
|
12
|
+
exportConditions: ['browser', 'development'],
|
|
13
|
+
},
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
+
// esbuildTarget: 'auto'
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/** Set appIndex to enable SPA routing */
|
|
19
|
+
appIndex: './index.html',
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
plugins: [
|
|
22
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
+
],
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
// See documentation for all available options
|
|
27
27
|
});
|
|
@@ -3,39 +3,39 @@
|
|
|
3
3
|
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
4
|
|
|
5
5
|
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
6
|
+
/** Test files to run */
|
|
7
|
+
files: 'dist/src/app/**/*.test.js',
|
|
8
|
+
|
|
9
|
+
/** Resolve bare module imports */
|
|
10
|
+
nodeResolve: {
|
|
11
|
+
exportConditions: ['browser', 'development'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/** Filter out lit dev mode logs */
|
|
15
|
+
filterBrowserLogs(log) {
|
|
16
|
+
for (const arg of log.args) {
|
|
17
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
+
// esbuildTarget: 'auto',
|
|
26
|
+
|
|
27
|
+
/** Amount of browsers to run concurrently */
|
|
28
|
+
// concurrentBrowsers: 2,
|
|
29
|
+
|
|
30
|
+
/** Amount of test files per browser to test concurrently */
|
|
31
|
+
// concurrency: 1,
|
|
32
|
+
|
|
33
|
+
/** Browsers to run tests on */
|
|
34
|
+
// browsers: [
|
|
35
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
+
// ],
|
|
39
|
+
|
|
40
|
+
// See documentation for all available options
|
|
41
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<base href="/">
|
|
7
|
+
<title>Ignite UI for Web Components</title>
|
|
8
|
+
<link rel="stylesheet" href="./node_modules/igniteui-webcomponents/themes/light/bootstrap.css">
|
|
9
|
+
<link rel="stylesheet" href="./styles.css">
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<app-root></app-root>
|
|
14
|
+
|
|
15
|
+
<script type="module" src="./dist/src/index.js"></script>
|
|
16
|
+
</body>
|
|
17
|
+
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "$(dashName)",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "WebComponents project for Ignite UI CLI",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Infragistics",
|
|
8
|
+
"main": "dist/src/index.js",
|
|
9
|
+
"module": "dist/src/index.js",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./dist/src/index.js",
|
|
13
|
+
"./$(dashName).js": "./dist/src/$(dashName).js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "tsc && concurrently -k -r \"tsc --watch\" \"wds\"",
|
|
17
|
+
"build": "rimraf dist && tsc && rollup -c rollup.config.mjs",
|
|
18
|
+
"start:build": "web-dev-server --root-dir dist --app-index index.html --open",
|
|
19
|
+
"lint": "eslint --ext .js,.ts,.html . --ignore-path .gitignore",
|
|
20
|
+
"test": "tsc && wtr"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@vaadin/router": "^1.7.4",
|
|
24
|
+
"@igniteui/material-icons-extended": "^2.11.0",
|
|
25
|
+
"igniteui-dockmanager": "~1.8.0",
|
|
26
|
+
"igniteui-webcomponents": "~3.4.0",
|
|
27
|
+
"igniteui-webcomponents-charts": "~3.2.1",
|
|
28
|
+
"igniteui-webcomponents-core": "~3.2.1",
|
|
29
|
+
"igniteui-webcomponents-gauges": "~3.2.1",
|
|
30
|
+
"igniteui-webcomponents-grids": "~3.2.1",
|
|
31
|
+
"igniteui-webcomponents-inputs": "~3.2.1",
|
|
32
|
+
"igniteui-webcomponents-layouts": "~3.2.1",
|
|
33
|
+
"lit": "^2.0.2",
|
|
34
|
+
"typescript": "^4.5.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@babel/preset-env": "^7.16.4",
|
|
38
|
+
"@open-wc/building-rollup": "^2.0.1",
|
|
39
|
+
"@open-wc/eslint-config": "^4.3.0",
|
|
40
|
+
"@open-wc/testing": "^2.5.33",
|
|
41
|
+
"@rollup/plugin-babel": "^5.3.0",
|
|
42
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^4.30.0",
|
|
44
|
+
"@typescript-eslint/parser": "^4.30.0",
|
|
45
|
+
"@web/dev-server": "^0.1.22",
|
|
46
|
+
"@web/rollup-plugin-html": "^1.10.1",
|
|
47
|
+
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
|
|
48
|
+
"@web/test-runner": "next",
|
|
49
|
+
"babel-plugin-template-html-minifier": "^4.1.0",
|
|
50
|
+
"concurrently": "^6.3.0",
|
|
51
|
+
"deepmerge": "^4.2.2",
|
|
52
|
+
"eslint": "^7.32.0",
|
|
53
|
+
"igniteui-cli": "~10.0.3",
|
|
54
|
+
"rimraf": "^3.0.2",
|
|
55
|
+
"rollup": "^2.60.0",
|
|
56
|
+
"rollup-plugin-copy-assets": "^2.0.3",
|
|
57
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
58
|
+
"rollup-plugin-workbox": "^6.2.0",
|
|
59
|
+
"source-map": "^0.7.3",
|
|
60
|
+
"tslib": "^2.3.1"
|
|
61
|
+
},
|
|
62
|
+
"eslintConfig": {
|
|
63
|
+
"parser": "@typescript-eslint/parser",
|
|
64
|
+
"extends": [
|
|
65
|
+
"@open-wc"
|
|
66
|
+
],
|
|
67
|
+
"plugins": [
|
|
68
|
+
"@typescript-eslint"
|
|
69
|
+
],
|
|
70
|
+
"rules": {
|
|
71
|
+
"no-unused-vars": "off",
|
|
72
|
+
"import/no-unresolved": "off"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Route } from '@vaadin/router';
|
|
2
|
+
import './home/home.js';
|
|
3
|
+
import './not-found/not-found.js';
|
|
4
|
+
|
|
5
|
+
export const routes: Route[] = [
|
|
6
|
+
{ path: '/', component: 'app-home', name: 'Home' },
|
|
7
|
+
// The fallback route should always be after other alternatives.
|
|
8
|
+
{ path: '(.*)', component: 'app-not-found' },
|
|
9
|
+
];
|
|
File without changes
|
package/templates/webcomponents/igc-ts/projects/{_base → _base_with_home}/files/src/app/home/home.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
+
import { BaseIgcProject } from "../_base";
|
|
3
|
+
export declare class BaseWithHomeIgcProject extends BaseIgcProject implements ProjectTemplate {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
get templatePaths(): string[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseWithHomeIgcProject = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const _base_1 = require("../_base");
|
|
6
|
+
class BaseWithHomeIgcProject extends _base_1.BaseIgcProject {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.id = "base with home";
|
|
10
|
+
this.name = "Base With Home";
|
|
11
|
+
this.description = "Empty project layout structure for Ignite UI for Web Components";
|
|
12
|
+
}
|
|
13
|
+
get templatePaths() {
|
|
14
|
+
return [...super.templatePaths, path.join(__dirname, "files")];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.BaseWithHomeIgcProject = BaseWithHomeIgcProject;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
+
import { BaseIgcProject } from "../_base";
|
|
3
|
+
export declare class BasePageTemplate extends BaseIgcProject implements ProjectTemplate {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
framework: string;
|
|
8
|
+
projectType: string;
|
|
9
|
+
dependencies: string[];
|
|
10
|
+
hasExtraConfiguration: boolean;
|
|
11
|
+
get templatePaths(): string[];
|
|
12
|
+
}
|
|
13
|
+
declare const _default: BasePageTemplate;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BasePageTemplate = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const _base_1 = require("../_base");
|
|
6
|
+
class BasePageTemplate extends _base_1.BaseIgcProject {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.id = "base";
|
|
10
|
+
this.name = "Base Project";
|
|
11
|
+
this.description = "Project structure with routing";
|
|
12
|
+
this.framework = "webcomponents";
|
|
13
|
+
this.projectType = "igc-ts";
|
|
14
|
+
this.hasExtraConfiguration = false;
|
|
15
|
+
}
|
|
16
|
+
get templatePaths() {
|
|
17
|
+
return [...super.templatePaths, path.join(__dirname, "files")];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.BasePageTemplate = BasePageTemplate;
|
|
21
|
+
exports.default = new BasePageTemplate();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
-
import {
|
|
3
|
-
export declare class EmptyPageTemplate extends
|
|
2
|
+
import { BaseWithHomeIgcProject } from "../_base_with_home";
|
|
3
|
+
export declare class EmptyPageTemplate extends BaseWithHomeIgcProject implements ProjectTemplate {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
description: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmptyPageTemplate = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const
|
|
6
|
-
class EmptyPageTemplate extends
|
|
5
|
+
const _base_with_home_1 = require("../_base_with_home");
|
|
6
|
+
class EmptyPageTemplate extends _base_with_home_1.BaseWithHomeIgcProject {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
9
|
this.id = "empty";
|
|
@@ -4,8 +4,6 @@ import { customElement } from 'lit/decorators.js';
|
|
|
4
4
|
import {
|
|
5
5
|
defineComponents,
|
|
6
6
|
IgcNavDrawerComponent,
|
|
7
|
-
IgcNavDrawerItemComponent,
|
|
8
|
-
IgcNavDrawerHeaderItemComponent,
|
|
9
7
|
IgcRippleComponent,
|
|
10
8
|
} from 'igniteui-webcomponents';
|
|
11
9
|
import { Router } from '@vaadin/router';
|
|
@@ -13,8 +11,6 @@ import { routes } from './app-routing.js';
|
|
|
13
11
|
|
|
14
12
|
defineComponents(
|
|
15
13
|
IgcNavDrawerComponent,
|
|
16
|
-
IgcNavDrawerItemComponent,
|
|
17
|
-
IgcNavDrawerHeaderItemComponent,
|
|
18
14
|
IgcRippleComponent,
|
|
19
15
|
);
|
|
20
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProjectTemplate } from "@igniteui/cli-core";
|
|
2
|
-
import {
|
|
3
|
-
export declare class SideNavProject extends
|
|
2
|
+
import { BaseWithHomeIgcProject } from "../_base_with_home";
|
|
3
|
+
export declare class SideNavProject extends BaseWithHomeIgcProject implements ProjectTemplate {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
description: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SideNavProject = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const
|
|
6
|
-
class SideNavProject extends
|
|
5
|
+
const _base_with_home_1 = require("../_base_with_home");
|
|
6
|
+
class SideNavProject extends _base_with_home_1.BaseWithHomeIgcProject {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
9
|
this.id = "side-nav";
|
package/templates/webcomponents/igc-ts/radio-group/default/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -2,11 +2,10 @@ import { html, LitElement } from 'lit';
|
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import {
|
|
4
4
|
defineComponents,
|
|
5
|
-
IgcRadioComponent,
|
|
6
5
|
IgcRadioGroupComponent,
|
|
7
6
|
} from 'igniteui-webcomponents';
|
|
8
7
|
|
|
9
|
-
defineComponents(
|
|
8
|
+
defineComponents(IgcRadioGroupComponent);
|
|
10
9
|
|
|
11
10
|
@customElement('app-$(path)')
|
|
12
11
|
export default class $(ClassName) extends LitElement {
|
package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.test
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import $(ClassName) from './$(path).js';
|
|
3
|
+
|
|
4
|
+
describe('IgcTabsComponent', () => {
|
|
5
|
+
it('<app-$(path)> is an instance of $(ClassName)', async () => {
|
|
6
|
+
const element = document.createElement('app-$(path)');
|
|
7
|
+
expect(element).to.be.instanceOf($(ClassName));
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import {
|
|
4
|
+
defineComponents,
|
|
5
|
+
IgcTabsComponent,
|
|
6
|
+
registerIconFromText
|
|
7
|
+
} from 'igniteui-webcomponents';
|
|
8
|
+
|
|
9
|
+
defineComponents(IgcTabsComponent);
|
|
10
|
+
|
|
11
|
+
const libraryIcon =
|
|
12
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v14"/><path d="M19 7.674v-.657a4 4 0 0 0-2.901-3.846l-2.824-.807A1 1 0 0 0 12 3.326V7l5.725 1.636A1 1 0 0 0 19 7.674Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M12 18a3 3 0 1 1-6 0c0-1.657 1.343-2 3-2s3 .343 3 2Z"/></g></svg>';
|
|
13
|
+
registerIconFromText('library', libraryIcon, 'material');
|
|
14
|
+
|
|
15
|
+
const favoriteIcon =
|
|
16
|
+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>';
|
|
17
|
+
registerIconFromText('favorite', favoriteIcon, 'material');
|
|
18
|
+
|
|
19
|
+
const infoIcon =
|
|
20
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="0.38em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 192 512"><path fill="currentColor" d="M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72s72-32.235 72-72S135.764 0 96 0z"/></svg>';
|
|
21
|
+
registerIconFromText('info', infoIcon, 'material');
|
|
22
|
+
|
|
23
|
+
@customElement('app-tabs')
|
|
24
|
+
export default class Tabs extends LitElement {
|
|
25
|
+
render() {
|
|
26
|
+
return html`
|
|
27
|
+
<igc-tabs alignment="start" >
|
|
28
|
+
<igc-tab panel="first">
|
|
29
|
+
<igc-icon name="library" collection='material' size='large'></igc-icon> Albums
|
|
30
|
+
</igc-tab>
|
|
31
|
+
<igc-tab panel="second">
|
|
32
|
+
<igc-icon name="favorite" collection='material' size='large'></igc-icon> Favourites
|
|
33
|
+
</igc-tab>
|
|
34
|
+
<igc-tab panel="third" disabled>
|
|
35
|
+
<igc-icon name="info" collection='material' size='large'></igc-icon> Info
|
|
36
|
+
</igc-tab>
|
|
37
|
+
<igc-tab-panel id="first">
|
|
38
|
+
<br /><br /><b>
|
|
39
|
+
Sgt. Peppers Lonely Hearts Club Band <br /><br />
|
|
40
|
+
The Dark Side of the Moon <br /><br />
|
|
41
|
+
My Beautiful Dark Twisted Fantasy <br /><br />
|
|
42
|
+
Led Zeppelin IV <br /><br />
|
|
43
|
+
It Takes a Nation of Millions to Hold Us Back <br /><br />
|
|
44
|
+
Thriller <br /><br /></b>
|
|
45
|
+
</igc-tab-panel>
|
|
46
|
+
<igc-tab-panel id="second">
|
|
47
|
+
<br /><br /><b>
|
|
48
|
+
The Dark Side of the Moon <br /><br />
|
|
49
|
+
Led Zeppelin IV <br /><br />
|
|
50
|
+
It Takes a Nation of Millions to Hold Us Back <br /><br />
|
|
51
|
+
Thriller <br /><br /></b>
|
|
52
|
+
</igc-tab-panel>
|
|
53
|
+
</igc-tabs>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const IgniteUIForWebComponentsTemplate_1 = require("../../../../../lib/templates/IgniteUIForWebComponentsTemplate");
|
|
4
|
+
class IgcTabsTemplate extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.components = ["Tabs"];
|
|
8
|
+
this.controlGroup = "Layouts";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "tabs";
|
|
11
|
+
this.projectType = "igc-ts";
|
|
12
|
+
this.name = "Tabs";
|
|
13
|
+
this.description = "basic IgcTabs";
|
|
14
|
+
}
|
|
15
|
+
addClassDeclaration(mainModule, projPath, name, modulePath) {
|
|
16
|
+
// not applicable with custom module
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
module.exports = new IgcTabsTemplate();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgcTabsComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Tabs";
|
|
11
|
+
this.group = "Layouts";
|
|
12
|
+
this.description = `Basic tabs component`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgcTabsComponent();
|
package/templates/webcomponents/igc-ts/tree/default/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -3,10 +3,9 @@ import { customElement } from 'lit/decorators.js';
|
|
|
3
3
|
import {
|
|
4
4
|
defineComponents,
|
|
5
5
|
IgcTreeComponent,
|
|
6
|
-
IgcTreeItemComponent,
|
|
7
6
|
} from 'igniteui-webcomponents';
|
|
8
7
|
|
|
9
|
-
defineComponents(IgcTreeComponent
|
|
8
|
+
defineComponents(IgcTreeComponent);
|
|
10
9
|
|
|
11
10
|
@customElement('app-$(path)')
|
|
12
11
|
export default class $(ClassName) extends LitElement {
|