igniteui-cli 13.1.2 → 13.1.4-beta.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/commands/upgrade.js +3 -5
- package/package.json +3 -3
- package/templates/react/Update.d.ts +1 -0
- package/templates/react/Update.js +108 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__github/workflows/node.js.yml +33 -0
- package/templates/react/igr-ts/projects/_base/files/src/app/style-utils.ts +12 -0
- package/templates/react/igr-ts/projects/_base/files/vite.config.ts +1 -0
- package/templates/react/igr-ts/projects/_base/index.d.ts +1 -0
- package/templates/react/igr-ts/projects/_base/index.js +4 -2
- package/templates/react/package-resolve.d.ts +35 -0
- package/templates/react/package-resolve.js +52 -0
- package/templates/webcomponents/igc-ts/button-group/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/button-group/default/files/src/app/__path__/__filePrefix__.ts +21 -0
- package/templates/webcomponents/igc-ts/button-group/default/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/button-group/default/index.js +19 -0
- package/templates/webcomponents/igc-ts/button-group/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/button-group/index.js +15 -0
- package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/__filePrefix__.ts +2 -2
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +8 -8
- package/templates/webcomponents/igc-ts/text-area/default/files/src/app/__path__/__filePrefix__.test.ts +9 -0
- package/templates/webcomponents/igc-ts/text-area/default/files/src/app/__path__/__filePrefix__.ts +19 -0
- package/templates/webcomponents/igc-ts/text-area/default/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/text-area/default/index.js +19 -0
- package/templates/webcomponents/igc-ts/text-area/index.d.ts +1 -0
- package/templates/webcomponents/igc-ts/text-area/index.js +18 -0
package/lib/commands/upgrade.js
CHANGED
|
@@ -42,11 +42,9 @@ command = {
|
|
|
42
42
|
case "jquery":
|
|
43
43
|
cli_core_1.Util.log("Upgrading packages for jQuery projects is currently not supported!");
|
|
44
44
|
return;
|
|
45
|
-
case "react":
|
|
46
|
-
cli_core_1.Util.log("Upgrading packages for React projects is currently not supported!");
|
|
47
|
-
return;
|
|
48
45
|
case "angular":
|
|
49
|
-
|
|
46
|
+
case "react":
|
|
47
|
+
if (projectType === "igx-ts" || projectType === "igr-ts") {
|
|
50
48
|
const projectLibrary = command.templateManager.getProjectLibrary(framework, projectType);
|
|
51
49
|
let project;
|
|
52
50
|
if (!config.project.projectTemplate || !projectLibrary.hasProject(config.project.projectTemplate)) {
|
|
@@ -69,7 +67,7 @@ command = {
|
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
|
-
else {
|
|
70
|
+
else if (framework.toLowerCase() === "angular") {
|
|
73
71
|
cli_core_1.Util.log("Upgrading packages for Angular Wrappers projects is currently not supported!");
|
|
74
72
|
return;
|
|
75
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-cli",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.4-beta.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": "~17.
|
|
76
|
-
"@igniteui/cli-core": "~13.1.
|
|
75
|
+
"@igniteui/angular-templates": "~17.0.1314-beta.0",
|
|
76
|
+
"@igniteui/cli-core": "~13.1.4-beta.0",
|
|
77
77
|
"chalk": "^2.3.2",
|
|
78
78
|
"fs-extra": "^3.0.1",
|
|
79
79
|
"glob": "^7.1.2",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updateWorkspace(rootPath: string): Promise<boolean>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.updateWorkspace = void 0;
|
|
13
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
14
|
+
const path = require("path");
|
|
15
|
+
const package_resolve_1 = require("./package-resolve");
|
|
16
|
+
function updateWorkspace(rootPath) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const fs = cli_core_1.App.container.get(cli_core_1.FS_TOKEN);
|
|
19
|
+
const upgradeable = (0, package_resolve_1.getUpgradeablePackages)();
|
|
20
|
+
if (!upgradeable.length) {
|
|
21
|
+
cli_core_1.Util.log("Your app is already using packages from the Infragistics registry. You are good to go.", "green");
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const packageJsonPath = path.join(rootPath, "package.json");
|
|
25
|
+
const fileString = fs.readFile(packageJsonPath);
|
|
26
|
+
// check for registry user in npm
|
|
27
|
+
const config = cli_core_1.ProjectConfig.getConfig();
|
|
28
|
+
if (!fileString) {
|
|
29
|
+
cli_core_1.Util.log("Package.json not found!");
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const pkgJSON = JSON.parse(fileString);
|
|
33
|
+
const errorMsg = "Something went wrong, " +
|
|
34
|
+
"please follow the steps in this guide: https://www.infragistics.com/products/ignite-ui-react/react/components/general-licensing";
|
|
35
|
+
if (!cli_core_1.PackageManager.ensureRegistryUser(config, errorMsg)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const workspace = path.join(rootPath, "src");
|
|
39
|
+
const logicFiles = [];
|
|
40
|
+
logicFiles.push(...fs.glob(workspace, "**/*.tsx"));
|
|
41
|
+
for (const packageDef of upgradeable) {
|
|
42
|
+
updatePackageJSON(packageDef.trial, packageDef.licensed, pkgJSON);
|
|
43
|
+
}
|
|
44
|
+
fs.writeFile(packageJsonPath, cli_core_1.Util.formatPackageJson(pkgJSON));
|
|
45
|
+
updateFileImports(logicFiles, upgradeable, fs);
|
|
46
|
+
createNpmrc(rootPath, fs);
|
|
47
|
+
updateWorkflows(fs);
|
|
48
|
+
return true;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.updateWorkspace = updateWorkspace;
|
|
52
|
+
function updateFileContent(fileContent, regexString, replaceWith) {
|
|
53
|
+
const match = fileContent.match(new RegExp(regexString));
|
|
54
|
+
if (match) {
|
|
55
|
+
fileContent = fileContent.replace(new RegExp(regexString, "g"), `$1${replaceWith}$2${match.length === 4 ? "$3" : ""}`);
|
|
56
|
+
}
|
|
57
|
+
return fileContent;
|
|
58
|
+
}
|
|
59
|
+
function updateFileImports(logicFiles, packageDefs, fs) {
|
|
60
|
+
for (const file of logicFiles) {
|
|
61
|
+
let fileContent = fs.readFile(file);
|
|
62
|
+
let fileChange = false;
|
|
63
|
+
for (const packageDef of packageDefs) {
|
|
64
|
+
if (fileContent.includes(packageDef.trial)) {
|
|
65
|
+
const regexFrom = String.raw `(from ["'])${packageDef.trial}(?<submodules>\/.*?)?(["'])`;
|
|
66
|
+
let newContent = updateFileContent(fileContent, regexFrom, packageDef.licensed);
|
|
67
|
+
const regexImport = String.raw `(import ["'])${packageDef.trial}(?<submodules>\/.*?)?(["'])`;
|
|
68
|
+
newContent = updateFileContent(newContent, regexImport, packageDef.licensed);
|
|
69
|
+
fileChange = fileContent !== newContent;
|
|
70
|
+
fileContent = newContent;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (fileChange) {
|
|
74
|
+
fs.writeFile(file, fileContent);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function updatePackageJSON(initName, replaceWith, pkgJSON) {
|
|
79
|
+
// update dependencies
|
|
80
|
+
if (!pkgJSON.dependencies.hasOwnProperty(initName)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
pkgJSON.dependencies[replaceWith] = pkgJSON.dependencies[initName];
|
|
84
|
+
delete pkgJSON.dependencies[initName];
|
|
85
|
+
// add "infragistics-login" script
|
|
86
|
+
const scripts = pkgJSON["scripts"];
|
|
87
|
+
scripts["infragistics-login"] = "echo \"IMPORTANT: When prompted for username enter in this format `name!!domain.com`\" && npm adduser --registry=https://packages.infragistics.com/npm/js-licensed/ --scope=@infragistics --always-auth";
|
|
88
|
+
}
|
|
89
|
+
function updateWorkflows(fs) {
|
|
90
|
+
const workflowPath = ".github/workflows/node.js.yml";
|
|
91
|
+
let workflow = fs.readFile(workflowPath);
|
|
92
|
+
if (workflow) {
|
|
93
|
+
const oldNmpInstall = "- run: npm i # replace with \'npm ci\' after committing lock file from first install";
|
|
94
|
+
const newNpmInstall = `- run: echo "@infragistics:registry=https://packages.infragistics.com/npm/js-licensed/" >> ~/.npmrc
|
|
95
|
+
- run: echo "//packages.infragistics.com/npm/js-licensed/:_auth=\${{ secrets.NPM_AUTH_TOKEN }}" >> ~/.npmrc
|
|
96
|
+
- run: echo "//packages.infragistics.com/npm/js-licensed/:always-auth=true" >> ~/.npmrc
|
|
97
|
+
- run: npm i # replace with \'npm ci\' after committing lock file from first install`;
|
|
98
|
+
workflow = workflow.replace(oldNmpInstall, newNpmInstall);
|
|
99
|
+
fs.writeFile(workflowPath, workflow);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function createNpmrc(rootPath, fs) {
|
|
103
|
+
const npmrcPath = path.join(rootPath, ".npmrc");
|
|
104
|
+
const fileContent = `@infragistics:registry=https://packages.infragistics.com/npm/js-licensed/
|
|
105
|
+
//packages.infragistics.com/npm/js-licensed/:always-auth=true
|
|
106
|
+
`;
|
|
107
|
+
fs.writeFile(npmrcPath, fileContent);
|
|
108
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Node.js CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ $(yamlDefaultBranch) ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ $(yamlDefaultBranch) ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [14.x, 16.x]
|
|
20
|
+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v2
|
|
24
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v2
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
# cache: 'npm' # enable after committing lock file from first install
|
|
29
|
+
- run: npm i # replace with 'npm ci' after committing lock file from first install
|
|
30
|
+
# - run: npm run lint
|
|
31
|
+
- run: npm run build
|
|
32
|
+
- run: npm run test
|
|
33
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a class transformer function that maps matches from a module object
|
|
3
|
+
* @param styles Object map of classes and their scoped name, normally from a CSS Module import
|
|
4
|
+
*/
|
|
5
|
+
export default function createClassTransformer(styles: any) {
|
|
6
|
+
return (classes: string) => {
|
|
7
|
+
return classes
|
|
8
|
+
.split(' ')
|
|
9
|
+
.map(className => styles[className] || className)
|
|
10
|
+
.join(' ');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BaseIgrTsProject = void 0;
|
|
13
13
|
const cli_core_1 = require("@igniteui/cli-core");
|
|
14
14
|
const path = require("path");
|
|
15
|
+
const Update_1 = require("../../../Update");
|
|
15
16
|
class BaseIgrTsProject {
|
|
16
17
|
constructor() {
|
|
17
18
|
this.id = "base";
|
|
@@ -33,7 +34,7 @@ class BaseIgrTsProject {
|
|
|
33
34
|
}
|
|
34
35
|
upgradeIgniteUIPackages(projectPath, packagePath) {
|
|
35
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
37
|
+
return (0, Update_1.updateWorkspace)(projectPath);
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
getExtraConfiguration() {
|
|
@@ -51,7 +52,8 @@ class BaseIgrTsProject {
|
|
|
51
52
|
"description": this.description,
|
|
52
53
|
"dot": ".",
|
|
53
54
|
"path": name,
|
|
54
|
-
"projectTemplate": this.id
|
|
55
|
+
"projectTemplate": this.id,
|
|
56
|
+
"yamlDefaultBranch": this.id === "base" ? "<%=yaml-default-branch%>" : "main"
|
|
55
57
|
};
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const NPM_REACT = "igniteui-react";
|
|
2
|
+
export declare const FEED_REACT = "@infragistics/igniteui-react";
|
|
3
|
+
export declare const NPM_REACT_CORE = "igniteui-react-core";
|
|
4
|
+
export declare const FEED_REACT_CORE = "@infragistics/igniteui-react-core";
|
|
5
|
+
export declare const NPM_REACT_CHARTS = "igniteui-react-charts";
|
|
6
|
+
export declare const FEED_REACT_CHARTS = "@infragistics/igniteui-react-charts";
|
|
7
|
+
export declare const NPM_REACT_GAUGES = "igniteui-react-gauges";
|
|
8
|
+
export declare const FEED_REACT_GAUGES = "@infragistics/igniteui-react-gauges";
|
|
9
|
+
export declare const NPM_REACT_GRIDS = "igniteui-react-grids";
|
|
10
|
+
export declare const FEED_REACT_GRIDS = "@infragistics/igniteui-react-grids";
|
|
11
|
+
export declare const NPM_REACT_INPUTS = "igniteui-react-inputs";
|
|
12
|
+
export declare const FEED_REACT_INPUTS = "@infragistics/igniteui-react-inputs";
|
|
13
|
+
export declare const NPM_REACT_LAYOUTS = "igniteui-react-layouts";
|
|
14
|
+
export declare const FEED_REACT_LAYOUTS = "@infragistics/igniteui-react-layouts";
|
|
15
|
+
export declare const NPM_REACT_MAPS = "igniteui-react-maps";
|
|
16
|
+
export declare const FEED_REACT_MAPS = "@infragistics/igniteui-react-maps";
|
|
17
|
+
export declare const NPM_DOCK_MANAGER = "igniteui-dockmanager";
|
|
18
|
+
export declare const FEED_DOCK_MANAGER = "@infragistics/igniteui-dockmanager";
|
|
19
|
+
export interface PackageDefinition {
|
|
20
|
+
trial: string;
|
|
21
|
+
licensed: string;
|
|
22
|
+
}
|
|
23
|
+
/** packages map of `trial: licensed` names */
|
|
24
|
+
export declare const UPGRADEABLE_PACKAGES: {
|
|
25
|
+
"igniteui-react": string;
|
|
26
|
+
"igniteui-react-core": string;
|
|
27
|
+
"igniteui-react-charts": string;
|
|
28
|
+
"igniteui-react-gauges": string;
|
|
29
|
+
"igniteui-react-grids": string;
|
|
30
|
+
"igniteui-react-inputs": string;
|
|
31
|
+
"igniteui-react-layouts": string;
|
|
32
|
+
"igniteui-react-maps": string;
|
|
33
|
+
"igniteui-dockmanager": string;
|
|
34
|
+
};
|
|
35
|
+
export declare function getUpgradeablePackages(): PackageDefinition[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUpgradeablePackages = exports.UPGRADEABLE_PACKAGES = exports.FEED_DOCK_MANAGER = exports.NPM_DOCK_MANAGER = exports.FEED_REACT_MAPS = exports.NPM_REACT_MAPS = exports.FEED_REACT_LAYOUTS = exports.NPM_REACT_LAYOUTS = exports.FEED_REACT_INPUTS = exports.NPM_REACT_INPUTS = exports.FEED_REACT_GRIDS = exports.NPM_REACT_GRIDS = exports.FEED_REACT_GAUGES = exports.NPM_REACT_GAUGES = exports.FEED_REACT_CHARTS = exports.NPM_REACT_CHARTS = exports.FEED_REACT_CORE = exports.NPM_REACT_CORE = exports.FEED_REACT = exports.NPM_REACT = void 0;
|
|
4
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
5
|
+
exports.NPM_REACT = "igniteui-react";
|
|
6
|
+
exports.FEED_REACT = "@infragistics/igniteui-react";
|
|
7
|
+
exports.NPM_REACT_CORE = "igniteui-react-core";
|
|
8
|
+
exports.FEED_REACT_CORE = "@infragistics/igniteui-react-core";
|
|
9
|
+
exports.NPM_REACT_CHARTS = "igniteui-react-charts";
|
|
10
|
+
exports.FEED_REACT_CHARTS = "@infragistics/igniteui-react-charts";
|
|
11
|
+
exports.NPM_REACT_GAUGES = "igniteui-react-gauges";
|
|
12
|
+
exports.FEED_REACT_GAUGES = "@infragistics/igniteui-react-gauges";
|
|
13
|
+
exports.NPM_REACT_GRIDS = "igniteui-react-grids";
|
|
14
|
+
exports.FEED_REACT_GRIDS = "@infragistics/igniteui-react-grids";
|
|
15
|
+
exports.NPM_REACT_INPUTS = "igniteui-react-inputs";
|
|
16
|
+
exports.FEED_REACT_INPUTS = "@infragistics/igniteui-react-inputs";
|
|
17
|
+
exports.NPM_REACT_LAYOUTS = "igniteui-react-layouts";
|
|
18
|
+
exports.FEED_REACT_LAYOUTS = "@infragistics/igniteui-react-layouts";
|
|
19
|
+
exports.NPM_REACT_MAPS = "igniteui-react-maps";
|
|
20
|
+
exports.FEED_REACT_MAPS = "@infragistics/igniteui-react-maps";
|
|
21
|
+
exports.NPM_DOCK_MANAGER = "igniteui-dockmanager";
|
|
22
|
+
exports.FEED_DOCK_MANAGER = "@infragistics/igniteui-dockmanager";
|
|
23
|
+
/** packages map of `trial: licensed` names */
|
|
24
|
+
exports.UPGRADEABLE_PACKAGES = {
|
|
25
|
+
[exports.NPM_REACT]: exports.FEED_REACT,
|
|
26
|
+
[exports.NPM_REACT_CORE]: exports.FEED_REACT_CORE,
|
|
27
|
+
[exports.NPM_REACT_CHARTS]: exports.FEED_REACT_CHARTS,
|
|
28
|
+
[exports.NPM_REACT_GAUGES]: exports.FEED_REACT_GAUGES,
|
|
29
|
+
[exports.NPM_REACT_GRIDS]: exports.FEED_REACT_GRIDS,
|
|
30
|
+
[exports.NPM_REACT_INPUTS]: exports.FEED_REACT_INPUTS,
|
|
31
|
+
[exports.NPM_REACT_LAYOUTS]: exports.FEED_REACT_LAYOUTS,
|
|
32
|
+
[exports.NPM_REACT_MAPS]: exports.FEED_REACT_MAPS,
|
|
33
|
+
[exports.NPM_DOCK_MANAGER]: exports.FEED_DOCK_MANAGER
|
|
34
|
+
};
|
|
35
|
+
function getUpgradeablePackages() {
|
|
36
|
+
const fs = cli_core_1.App.container.get(cli_core_1.FS_TOKEN);
|
|
37
|
+
const upgradeable = [];
|
|
38
|
+
if (fs.fileExists("./package.json")) {
|
|
39
|
+
const packageJson = JSON.parse(fs.readFile("./package.json"));
|
|
40
|
+
const dependencies = packageJson["dependencies"];
|
|
41
|
+
for (const packageEntry in exports.UPGRADEABLE_PACKAGES) {
|
|
42
|
+
if (dependencies[packageEntry]) {
|
|
43
|
+
upgradeable.push({
|
|
44
|
+
trial: packageEntry,
|
|
45
|
+
licensed: exports.UPGRADEABLE_PACKAGES[packageEntry]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return upgradeable;
|
|
51
|
+
}
|
|
52
|
+
exports.getUpgradeablePackages = getUpgradeablePackages;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import $(ClassName) from './$(path).js';
|
|
3
|
+
|
|
4
|
+
describe('IgcButtonGroupComponent', () => {
|
|
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/button-group/default/files/src/app/__path__/__filePrefix__.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import {
|
|
4
|
+
defineComponents,
|
|
5
|
+
IgcButtonGroupComponent,
|
|
6
|
+
} from 'igniteui-webcomponents';
|
|
7
|
+
|
|
8
|
+
defineComponents(IgcButtonGroupComponent);
|
|
9
|
+
|
|
10
|
+
@customElement('app-$(path)')
|
|
11
|
+
export default class $(ClassName) extends LitElement {
|
|
12
|
+
render() {
|
|
13
|
+
return html`
|
|
14
|
+
<igc-button-group>
|
|
15
|
+
<igc-toggle-button value="left">Left</igc-toggle-button>
|
|
16
|
+
<igc-toggle-button value="center">Center</igc-toggle-button>
|
|
17
|
+
<igc-toggle-button value="right">Right</igc-toggle-button>
|
|
18
|
+
</igc-button-group>
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -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 = ["ButtonGroup"];
|
|
8
|
+
this.controlGroup = "Data Entry & Display";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "button-group";
|
|
11
|
+
this.projectType = "igc-ts";
|
|
12
|
+
this.name = "Button group";
|
|
13
|
+
this.description = "basic IgcButtonGroup";
|
|
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 IgcButtonGroupComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Button group";
|
|
11
|
+
this.group = "Data Entry & Display";
|
|
12
|
+
this.description = `Basic button group component`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = new IgcButtonGroupComponent();
|
package/templates/webcomponents/igc-ts/grid/grid-editing/files/src/app/__path__/__filePrefix__.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { customElement } from 'lit/decorators.js';
|
|
|
3
3
|
import {
|
|
4
4
|
EditModeType,
|
|
5
5
|
GridActivationMode,
|
|
6
|
-
|
|
6
|
+
DataGridSelectionMode,
|
|
7
7
|
IgcDataGridComponent,
|
|
8
8
|
IgcDataGridModule,
|
|
9
9
|
IgcGridCellValueChangingEventArgs,
|
|
@@ -193,7 +193,7 @@ export default class $(ClassName) extends LitElement {
|
|
|
193
193
|
if (grid !== null) {
|
|
194
194
|
grid.dataSource = this.data;
|
|
195
195
|
grid.activationMode = GridActivationMode.Cell;
|
|
196
|
-
grid.selectionMode =
|
|
196
|
+
grid.selectionMode = DataGridSelectionMode.SingleCell;
|
|
197
197
|
grid.editMode = EditModeType.Cell;
|
|
198
198
|
grid.cellValueChanging = onCellValueChanging;
|
|
199
199
|
}
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@vaadin/router": "^1.7.4",
|
|
24
24
|
"@igniteui/material-icons-extended": "^2.11.0",
|
|
25
|
-
"igniteui-dockmanager": "~1.
|
|
26
|
-
"igniteui-webcomponents": "~4.
|
|
27
|
-
"igniteui-webcomponents-charts": "~4.
|
|
28
|
-
"igniteui-webcomponents-core": "~4.
|
|
29
|
-
"igniteui-webcomponents-gauges": "~4.
|
|
30
|
-
"igniteui-webcomponents-grids": "~4.
|
|
31
|
-
"igniteui-webcomponents-inputs": "~4.
|
|
32
|
-
"igniteui-webcomponents-layouts": "~4.
|
|
25
|
+
"igniteui-dockmanager": "~1.14.3",
|
|
26
|
+
"igniteui-webcomponents": "~4.7.0",
|
|
27
|
+
"igniteui-webcomponents-charts": "~4.7.0",
|
|
28
|
+
"igniteui-webcomponents-core": "~4.7.0",
|
|
29
|
+
"igniteui-webcomponents-gauges": "~4.7.0",
|
|
30
|
+
"igniteui-webcomponents-grids": "~4.7.0",
|
|
31
|
+
"igniteui-webcomponents-inputs": "~4.7.0",
|
|
32
|
+
"igniteui-webcomponents-layouts": "~4.7.0",
|
|
33
33
|
"lit": "^2.6.1",
|
|
34
34
|
"typescript": "^4.9.4"
|
|
35
35
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import $(ClassName) from './$(path).js';
|
|
3
|
+
|
|
4
|
+
describe('IgcTextareaComponent', () => {
|
|
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/text-area/default/files/src/app/__path__/__filePrefix__.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import {
|
|
4
|
+
defineComponents,
|
|
5
|
+
IgcTextareaComponent,
|
|
6
|
+
} from 'igniteui-webcomponents';
|
|
7
|
+
|
|
8
|
+
defineComponents(IgcTextareaComponent);
|
|
9
|
+
|
|
10
|
+
@customElement('app-$(path)')
|
|
11
|
+
export default class $(ClassName) extends LitElement {
|
|
12
|
+
render() {
|
|
13
|
+
return html`
|
|
14
|
+
<igc-textarea
|
|
15
|
+
label="Leave your comment">
|
|
16
|
+
</igc-textarea>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -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 IgcTextareaComponent extends IgniteUIForWebComponentsTemplate_1.IgniteUIForWebComponentsTemplate {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(__dirname);
|
|
7
|
+
this.components = ["Teaxtarea"];
|
|
8
|
+
this.controlGroup = "Data Entry & Display";
|
|
9
|
+
this.listInComponentTemplates = true;
|
|
10
|
+
this.id = "text-area";
|
|
11
|
+
this.projectType = "igc-ts";
|
|
12
|
+
this.name = "Text area";
|
|
13
|
+
this.description = "basic IgcTextarea";
|
|
14
|
+
}
|
|
15
|
+
addClassDeclaration(mainModule, projPath, name, modulePath) {
|
|
16
|
+
// not applicable with custom module
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
module.exports = new IgcTextareaComponent();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_core_1 = require("@igniteui/cli-core");
|
|
4
|
+
class IgcTextareaComponent extends cli_core_1.BaseComponent {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
super(__dirname);
|
|
10
|
+
this.name = "Text area";
|
|
11
|
+
this.group = "Data Entry & Display";
|
|
12
|
+
this.description = `Basic text area component`;
|
|
13
|
+
}
|
|
14
|
+
addClassDeclaration(mainModule, projPath, name, modulePath) {
|
|
15
|
+
// not applicable with custom module
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
module.exports = new IgcTextareaComponent();
|