@ui5/create-webcomponents-package 0.0.0-b93c2a321 → 0.0.0-bf8366eb6
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/CHANGELOG.md +1100 -0
- package/README.md +33 -13
- package/create-package.js +214 -0
- package/package.json +4 -3
- package/template/.eslintignore +2 -0
- package/template/.eslintrc.js +5 -0
- package/template/bundle.esm.js +0 -2
- package/template/gitignore +3 -0
- package/template/npmrc +2 -0
- package/template/package-scripts.js +1 -1
- package/template/src/MyFirstComponent.hbs +6 -1
- package/template/src/MyFirstComponent.ts +60 -0
- package/template/src/i18n/messagebundle.properties +3 -2
- package/template/src/i18n/messagebundle_de.properties +1 -1
- package/template/src/i18n/messagebundle_en.properties +1 -1
- package/template/src/i18n/messagebundle_es.properties +1 -1
- package/template/src/i18n/messagebundle_fr.properties +1 -1
- package/template/src/themes/MyFirstComponent.css +16 -10
- package/template/src/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/template/src/themes/sap_horizon_dark/parameters-bundle.css +3 -0
- package/template/src/themes/sap_horizon_hcb/parameters-bundle.css +3 -0
- package/template/test/pages/css/index.css +36 -0
- package/template/test/pages/img/logo.png +0 -0
- package/template/test/pages/index.html +36 -33
- package/template/test/specs/Demo.spec.js +3 -2
- package/template/tsconfig.json +16 -0
- package/index.js +0 -168
- package/template/config/.eslintrc.js +0 -1
- package/template/config/postcss.components/postcss.config.js +0 -1
- package/template/config/postcss.themes/postcss.config.js +0 -1
- package/template/config/rollup.config.js +0 -1
- package/template/src/MyFirstComponent.js +0 -51
- package/template/src/themes/sap_belize_hcw/parameters-bundle.css +0 -3
- package/template/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
- package/template/src/themes/sap_fiori_3_hcb/parameters-bundle.css +0 -3
- package/template/src/themes/sap_fiori_3_hcw/parameters-bundle.css +0 -3
- /package/template/src/{Assets.js → Assets.ts} +0 -0
- /package/template/src/themes/{sap_belize → sap_horizon}/parameters-bundle.css +0 -0
- /package/template/src/themes/{sap_belize_hcb → sap_horizon_hcw}/parameters-bundle.css +0 -0
package/README.md
CHANGED
@@ -1,38 +1,58 @@
|
|
1
|
-

|
2
|
+
|
2
3
|
|
3
4
|
# UI5 Web Components - Create Package
|
4
5
|
|
5
|
-
[](https://travis-ci.org/SAP/ui5-webcomponents)
|
6
6
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
7
7
|
|
8
8
|
Provides an `npm init` script for creating new "UI5 Web Components" packages.
|
9
9
|
|
10
|
-
## Usage
|
10
|
+
## Usage with npm
|
11
|
+
|
12
|
+
```
|
13
|
+
Usage:
|
14
|
+
|
15
|
+
# npm 6.x
|
16
|
+
npm init @ui5/webcomponents-package [OPTIONS]
|
17
|
+
# npm 7+, an extra double-dash is needed:
|
18
|
+
npm init @ui5/webcomponents-package -- [OPTIONS]
|
11
19
|
|
12
|
-
|
20
|
+
Options:
|
21
|
+
--name <string> - defines the package name
|
22
|
+
--component-name <string> - defines the component class name that will be created in your new package
|
23
|
+
--tag <string> - defines the tag name of the sample web component that will be created in your new package. The tag will be derived from the component name if not provided.
|
24
|
+
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
25
|
+
```
|
13
26
|
|
14
|
-
|
15
|
-
|
27
|
+
The script creates a new directory, and fills it with a `package.json` file and all necessary source files, and resources for a new
|
28
|
+
components package.
|
16
29
|
|
17
|
-
|
30
|
+
## Usage with yarn
|
18
31
|
|
19
|
-
|
20
|
-
|
32
|
+
```
|
33
|
+
Usage:
|
34
|
+
yarn create @ui5/webcomponents-package [OPTIONS]
|
35
|
+
Options:
|
36
|
+
--name <string> - defines the package name
|
37
|
+
--component-name <string> - defines the component class name that will be created in your new package
|
38
|
+
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
39
|
+
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
40
|
+
```
|
21
41
|
|
22
42
|
The script creates a new directory, and fills it with a `package.json` file and all necessary source files, and resources for a new
|
23
43
|
components package.
|
24
44
|
|
25
45
|
## Resources
|
26
|
-
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/
|
46
|
+
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
27
47
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
28
48
|
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
|
29
49
|
|
30
50
|
## Support
|
31
|
-
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
51
|
+
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/).
|
32
52
|
|
33
53
|
## Contribute
|
34
|
-
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
54
|
+
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
35
55
|
|
36
56
|
## License
|
37
57
|
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
|
38
|
-
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/
|
58
|
+
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/main/LICENSE.txt) file.
|
@@ -0,0 +1,214 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
const fs = require("fs");
|
4
|
+
const path = require("path");
|
5
|
+
const mkdirp = require("mkdirp");
|
6
|
+
const prompts = require("prompts");
|
7
|
+
const parser = require("npm-config-user-agent-parser");
|
8
|
+
const yargs = require("yargs/yargs");
|
9
|
+
const { hideBin } = require("yargs/helpers");
|
10
|
+
|
11
|
+
const argv = yargs(hideBin(process.argv)).argv;
|
12
|
+
|
13
|
+
const version = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))).version;
|
14
|
+
|
15
|
+
// from where all the files will be copied
|
16
|
+
const TEMPLATE_DIR = path.join(`${__dirname}`, `template/`);
|
17
|
+
|
18
|
+
const isGitIgnore = sourcePath => {
|
19
|
+
return sourcePath.includes("gitignore");
|
20
|
+
};
|
21
|
+
const isLogo = sourcePath => {
|
22
|
+
return sourcePath.includes("logo");
|
23
|
+
};
|
24
|
+
const isNPMRC = sourcePath => {
|
25
|
+
return sourcePath.includes("npmrc");
|
26
|
+
};
|
27
|
+
|
28
|
+
// Validation of user input
|
29
|
+
const ComponentNamePattern = /^[A-Z][A-Za-z0-9]+$/;
|
30
|
+
const isPackageNameValid = name => typeof name === "string" && name.match(/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/);
|
31
|
+
const isComponentNameValid = name => typeof name === "string" && ComponentNamePattern.test(name);
|
32
|
+
const isTagValid = tag => typeof tag === "string" && tag.match(/^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/);
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Hyphanates the given PascalCase string, f.e.:
|
36
|
+
* Foo -> "my-foo" (adds preffix)
|
37
|
+
* FooBar -> "foo-bar"
|
38
|
+
*/
|
39
|
+
const hyphaneteComponentName = (componentName) => {
|
40
|
+
const result = componentName.replace(/([a-z])([A-Z])/g, '$1-$2' ).toLowerCase();
|
41
|
+
|
42
|
+
return result.includes("-") ? result : `my-${result}`;
|
43
|
+
};
|
44
|
+
|
45
|
+
// Utils for building the file structure
|
46
|
+
const replaceVarsInFileContent = (vars, content) => {
|
47
|
+
for (let key in vars) {
|
48
|
+
const re = new RegExp(key, "g");
|
49
|
+
content = content.replace(re, vars[key]);
|
50
|
+
}
|
51
|
+
return content;
|
52
|
+
};
|
53
|
+
|
54
|
+
const replaceVarsInFileName = (vars, fileName) => {
|
55
|
+
return fileName.replace(/MyFirstComponent/, vars.INIT_PACKAGE_VAR_CLASS_NAME);
|
56
|
+
};
|
57
|
+
|
58
|
+
const copyFile = (vars, sourcePath, destPath) => {
|
59
|
+
if (isLogo(sourcePath)) {
|
60
|
+
fs.copyFileSync(sourcePath, destPath);
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
|
64
|
+
let content = fs.readFileSync(sourcePath, { encoding: "UTF-8" });
|
65
|
+
content = replaceVarsInFileContent(vars, content);
|
66
|
+
destPath = replaceVarsInFileName(vars, destPath);
|
67
|
+
|
68
|
+
fs.writeFileSync(destPath, content);
|
69
|
+
|
70
|
+
// Rename "gitignore" to ".gitignore" (npm init won't include ".gitignore", so we add it as "gitignore" and rename it later)
|
71
|
+
if (isGitIgnore(sourcePath)) {
|
72
|
+
fs.renameSync(destPath, destPath.replace("gitignore", ".gitignore"))
|
73
|
+
}
|
74
|
+
|
75
|
+
// Rename "npmrc" to ".npmrc" (npm init won't include ".npmrc", so we add it as "npmrc" and rename it later)
|
76
|
+
if (isNPMRC(sourcePath)) {
|
77
|
+
fs.renameSync(destPath, destPath.replace("npmrc", ".npmrc"));
|
78
|
+
}
|
79
|
+
};
|
80
|
+
|
81
|
+
const copyFiles = (vars, sourcePath, destPath) => {
|
82
|
+
const isDir = fs.lstatSync(sourcePath).isDirectory();
|
83
|
+
if (isDir) {
|
84
|
+
if (destPath) {
|
85
|
+
mkdirp.sync(destPath);
|
86
|
+
}
|
87
|
+
fs.readdirSync(sourcePath).forEach(file => {
|
88
|
+
copyFiles(vars, path.join(sourcePath, file), path.join(destPath, file));
|
89
|
+
});
|
90
|
+
} else {
|
91
|
+
copyFile(vars, sourcePath, destPath);
|
92
|
+
}
|
93
|
+
};
|
94
|
+
|
95
|
+
const generateFilesContent = (packageName, componentName, skipSubfolder) => {
|
96
|
+
const tagName = argv.tag || hyphaneteComponentName(componentName);
|
97
|
+
|
98
|
+
// All variables that will be replaced in the content of the resources/
|
99
|
+
const vars = {
|
100
|
+
INIT_PACKAGE_VAR_NAME: packageName,
|
101
|
+
INIT_PACKAGE_VAR_TAG: tagName,
|
102
|
+
INIT_PACKAGE_VAR_CLASS_NAME: componentName,
|
103
|
+
};
|
104
|
+
|
105
|
+
const packageContent = {
|
106
|
+
name: packageName,
|
107
|
+
version: "0.0.1",
|
108
|
+
ui5: {
|
109
|
+
webComponentsPackage: true,
|
110
|
+
},
|
111
|
+
scripts: {
|
112
|
+
"clean": "wc-dev clean",
|
113
|
+
"lint": "wc-dev lint",
|
114
|
+
"start": "wc-dev start",
|
115
|
+
"watch": "wc-dev watch",
|
116
|
+
"build": "wc-dev build",
|
117
|
+
"test": "wc-dev test",
|
118
|
+
"create-ui5-element": "wc-create-ui5-element",
|
119
|
+
"prepublishOnly": "npm run build",
|
120
|
+
},
|
121
|
+
exports: {
|
122
|
+
"./src/*": "./src/*",
|
123
|
+
"./dist/*": "./dist/*",
|
124
|
+
"./package.json": "./package.json",
|
125
|
+
"./bundle.js": "./bundle.js",
|
126
|
+
"./*": "./dist/*",
|
127
|
+
},
|
128
|
+
"dependencies": {
|
129
|
+
"@ui5/webcomponents-base": version,
|
130
|
+
"@ui5/webcomponents-theming": version,
|
131
|
+
},
|
132
|
+
"devDependencies": {
|
133
|
+
"@ui5/webcomponents-tools": version,
|
134
|
+
"chromedriver": "*",
|
135
|
+
"typescript": "^5.2.2"
|
136
|
+
},
|
137
|
+
};
|
138
|
+
|
139
|
+
// Update package.json
|
140
|
+
let destDir = packageName.includes("@") ? packageName.slice(packageName.lastIndexOf("/") + 1) : packageName;
|
141
|
+
|
142
|
+
destDir = skipSubfolder ? path.join("./") : path.join("./", destDir);
|
143
|
+
mkdirp.sync(destDir);
|
144
|
+
fs.writeFileSync(path.join(destDir, "package.json"), JSON.stringify(packageContent, null, 2));
|
145
|
+
// Copy files
|
146
|
+
copyFiles(vars, TEMPLATE_DIR, destDir);
|
147
|
+
|
148
|
+
console.log("\nPackage successfully created!\nNext steps:\n");
|
149
|
+
console.log(`$ cd ${destDir}`);
|
150
|
+
|
151
|
+
let userAgentInfo;
|
152
|
+
try {
|
153
|
+
userAgentInfo = parser(process.env.npm_config_user_agent);
|
154
|
+
} catch (e) {}
|
155
|
+
|
156
|
+
if (userAgentInfo && userAgentInfo.yarn) {
|
157
|
+
console.log(`$ yarn`);
|
158
|
+
console.log(`$ yarn start`);
|
159
|
+
} else {
|
160
|
+
console.log(`$ npm i`);
|
161
|
+
console.log(`$ npm start`);
|
162
|
+
}
|
163
|
+
|
164
|
+
console.log("\n");
|
165
|
+
};
|
166
|
+
|
167
|
+
// Main function
|
168
|
+
const createWebcomponentsPackage = async () => {
|
169
|
+
let response;
|
170
|
+
if (argv.name && !isPackageNameValid(argv.name)) {
|
171
|
+
throw new Error("The package name should be a string, starting with letter and containing the following symbols [a-z, A-Z, 0-9].");
|
172
|
+
}
|
173
|
+
|
174
|
+
if (argv.componentName && !isComponentNameValid(argv.componentName)) {
|
175
|
+
throw new Error("The component name should be a string, starting with a capital letter [A-Z][a-z], for example: Button, MyButton, etc.");
|
176
|
+
}
|
177
|
+
|
178
|
+
if (argv.tag && !isTagValid(argv.tag) ) {
|
179
|
+
throw new Error("The tag should be in kebab-case (f.e my-component) and it can't be a single word.");
|
180
|
+
}
|
181
|
+
|
182
|
+
let packageName = argv.name || "my-package";
|
183
|
+
let componentName = argv.componentName || "MyComponent";
|
184
|
+
const skipSubfolder = !!argv.skipSubfolder;
|
185
|
+
|
186
|
+
if (argv.skip) {
|
187
|
+
return generateFilesContent(packageName, componentName, skipSubfolder);
|
188
|
+
}
|
189
|
+
|
190
|
+
if (!argv.name) {
|
191
|
+
response = await prompts({
|
192
|
+
type: "text",
|
193
|
+
name: "name",
|
194
|
+
message: "Package name:",
|
195
|
+
validate: (value) => isPackageNameValid(value) ? true : "Package name should be a string, starting with a letter and containing the following symbols [a-z, A-Z ,0-9, _, -].",
|
196
|
+
});
|
197
|
+
packageName = response.name;
|
198
|
+
}
|
199
|
+
|
200
|
+
if (!argv.componentName) {
|
201
|
+
response = await prompts({
|
202
|
+
type: "text",
|
203
|
+
name: "componentName",
|
204
|
+
message: "Component name:",
|
205
|
+
initial: "MyComponent",
|
206
|
+
validate: (value) => isComponentNameValid(value) ? true : "Component name should follow PascalCase naming convention (f.e. Button, MyButton, etc.).",
|
207
|
+
});
|
208
|
+
componentName = response.componentName;
|
209
|
+
}
|
210
|
+
|
211
|
+
return generateFilesContent(packageName, componentName, skipSubfolder);
|
212
|
+
};
|
213
|
+
|
214
|
+
createWebcomponentsPackage();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-bf8366eb6",
|
4
4
|
"description": "UI5 Web Components: create package",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"ui5"
|
12
12
|
],
|
13
13
|
"bin": {
|
14
|
-
"create-webcomponents-package": "
|
14
|
+
"create-webcomponents-package": "create-package.js"
|
15
15
|
},
|
16
16
|
"repository": {
|
17
17
|
"type": "git",
|
@@ -21,6 +21,7 @@
|
|
21
21
|
"dependencies": {
|
22
22
|
"mkdirp": "^1.0.4",
|
23
23
|
"npm-config-user-agent-parser": "^1.0.0",
|
24
|
-
"prompts": "^2.4.1"
|
24
|
+
"prompts": "^2.4.1",
|
25
|
+
"yargs": "^17.5.1"
|
25
26
|
}
|
26
27
|
}
|
package/template/.eslintignore
CHANGED
@@ -0,0 +1,5 @@
|
|
1
|
+
const config = require("@ui5/webcomponents-tools/components-package/eslint.js");
|
2
|
+
|
3
|
+
// This eslint config is defined @ui5/webcomponents-tools,
|
4
|
+
// Feel free to override part of the configuration or provide entirely new config to fit your dev requirements.
|
5
|
+
module.exports = config;
|
package/template/bundle.esm.js
CHANGED
@@ -6,7 +6,6 @@ import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
|
|
6
6
|
import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
|
7
7
|
import { getTheme, setTheme } from "@ui5/webcomponents-base/dist/config/Theme.js";
|
8
8
|
import { getNoConflict, setNoConflict } from "@ui5/webcomponents-base/dist/config/NoConflict.js";
|
9
|
-
import { getRTL } from "@ui5/webcomponents-base/dist/config/RTL.js";
|
10
9
|
import { getFirstDayOfWeek } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
|
11
10
|
|
12
11
|
// Enable additional themes and i18n texts
|
@@ -25,7 +24,6 @@ window["sap-ui-webcomponents-bundle"] = {
|
|
25
24
|
getNoConflict,
|
26
25
|
setNoConflict,
|
27
26
|
getCalendarType,
|
28
|
-
getRTL,
|
29
27
|
getFirstDayOfWeek,
|
30
28
|
},
|
31
29
|
};
|
package/template/npmrc
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
+
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
3
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
4
|
+
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
5
|
+
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
6
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
7
|
+
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
8
|
+
|
9
|
+
// Template
|
10
|
+
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
|
11
|
+
|
12
|
+
// Styles
|
13
|
+
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
14
|
+
|
15
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @class
|
19
|
+
*
|
20
|
+
* <h3 class="comment-api-title">Overview</h3>
|
21
|
+
*
|
22
|
+
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
23
|
+
*
|
24
|
+
* @constructor
|
25
|
+
* @extends UI5Element
|
26
|
+
* @public
|
27
|
+
*/
|
28
|
+
@customElement({
|
29
|
+
tag: "INIT_PACKAGE_VAR_TAG",
|
30
|
+
renderer: litRender,
|
31
|
+
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
32
|
+
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
33
|
+
})
|
34
|
+
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
35
|
+
static i18nBundle: I18nBundle;
|
36
|
+
|
37
|
+
static async onDefine() {
|
38
|
+
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Defines the component count.
|
43
|
+
* @default 0
|
44
|
+
* @public
|
45
|
+
*/
|
46
|
+
@property({ validator: Integer, defaultValue: 0 })
|
47
|
+
count!: number;
|
48
|
+
|
49
|
+
onClick() {
|
50
|
+
this.count++;
|
51
|
+
}
|
52
|
+
|
53
|
+
get counterText() {
|
54
|
+
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNT);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
59
|
+
|
60
|
+
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
@@ -1,2 +1,3 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# the "counter" text for the sample component
|
2
|
+
COUNT=Count
|
3
|
+
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Zählung
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Count
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Cuenta
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Comte
|
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
.root {
|
2
|
+
display: inline-flex;
|
3
|
+
align-items: center;
|
4
|
+
justify-content: center;
|
5
|
+
flex-direction: column;
|
6
|
+
padding: 0 2rem;
|
7
|
+
color: var(--sapAvatar_6_TextColor);
|
8
|
+
background-color: var(--sapAvatar_6_Background);
|
9
|
+
border: 2px solid var(--my-component-border-color);
|
10
|
+
border-radius: 0.5rem;
|
11
|
+
box-shadow: var(--sapContent_Shadow0);
|
12
|
+
text-align: center;
|
13
|
+
line-height: 3rem;
|
14
|
+
font-size: 1.25rem;
|
15
|
+
user-select: none;
|
16
|
+
cursor: pointer;
|
11
17
|
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
body {
|
2
|
+
color: var(--sapTextColor);
|
3
|
+
background-color: var(--sapBackgroundColor);
|
4
|
+
font-size: var(--sapFontSize);
|
5
|
+
font-family: var(--sapFontFamily);
|
6
|
+
}
|
7
|
+
|
8
|
+
h1 {
|
9
|
+
font-size: var(--sapFontHeader2Size);
|
10
|
+
margin-bottom: 0.5rem;
|
11
|
+
}
|
12
|
+
|
13
|
+
h2 {
|
14
|
+
font-size: var(--sapFontHeader3Size);
|
15
|
+
margin-bottom: 0.5rem;
|
16
|
+
}
|
17
|
+
|
18
|
+
.app, .app-settings, .app-docs, .app-first-component {
|
19
|
+
display: flex;
|
20
|
+
align-items: center;
|
21
|
+
justify-content: center;
|
22
|
+
flex-direction: column;
|
23
|
+
}
|
24
|
+
|
25
|
+
.app-first-component {
|
26
|
+
margin-bottom: 3rem;
|
27
|
+
}
|
28
|
+
|
29
|
+
.app-docs {
|
30
|
+
margin-top: 3rem;
|
31
|
+
}
|
32
|
+
|
33
|
+
a {
|
34
|
+
margin: 0.25rem;
|
35
|
+
color: var(--sapLinkColor);
|
36
|
+
}
|
Binary file
|
@@ -2,53 +2,56 @@
|
|
2
2
|
<html>
|
3
3
|
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
5
|
<meta charset="utf-8">
|
7
6
|
|
8
7
|
<title>INIT_PACKAGE_VAR_TAG</title>
|
9
8
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
10
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
11
9
|
<meta charset="utf-8">
|
12
10
|
|
13
11
|
<script data-ui5-config type="application/json">
|
14
12
|
{
|
13
|
+
"theme": "sap_horizon_dark",
|
15
14
|
"language": "EN"
|
16
15
|
}
|
17
16
|
</script>
|
18
17
|
|
19
|
-
<
|
20
|
-
|
21
|
-
<style>
|
22
|
-
code { color: blue; font-size: small; }
|
23
|
-
</style>
|
24
|
-
|
18
|
+
<link rel="stylesheet" type="text/css" href="./css/index.css">
|
19
|
+
<script src="../../bundle.esm.js" type="module"></script>
|
25
20
|
</head>
|
26
21
|
|
27
22
|
<body>
|
28
|
-
<
|
29
|
-
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
23
|
+
<div class="app">
|
24
|
+
<a href="https://sap.github.io/ui5-webcomponents/playground/?path=/docs/docs-getting-started-first-steps--docs" target="_blank"><img src="./img/logo.png" alt="logo"/></a>
|
25
|
+
|
26
|
+
<div class="app-first-component">
|
27
|
+
<h1>Hooray! It's Your First Web Component!</h1>
|
28
|
+
<div> <pre><INIT_PACKAGE_VAR_TAG></INIT_PACKAGE_VAR_TAG> </pre></div>
|
29
|
+
<INIT_PACKAGE_VAR_TAG id="myFirstComponent"></INIT_PACKAGE_VAR_TAG>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="app-settings">
|
33
|
+
|
34
|
+
<h2>Switch themes</h2>
|
35
|
+
<div style="display: flex; flex-direction: row;">
|
36
|
+
<a class="link" href="?sap-ui-theme=sap_horizon">Horizon</a>
|
37
|
+
<a class="link" href="?sap-ui-theme=sap_horizon_dark">Horizon Dark</a>
|
38
|
+
<a class="link" href="?sap-ui-theme=sap_horizon_hcb">Horizon High Contrast Black</a>
|
39
|
+
<a class="link" href="?sap-ui-theme=sap_horizon_hcw">Horizon High Contrast White</a>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<h2>Switch language</h2>
|
43
|
+
<div>
|
44
|
+
<a class="link" href="?sap-ui-language=en">English</a>
|
45
|
+
<a class="link" href="?sap-ui-language=de">German</a>
|
46
|
+
<a class="link" href="?sap-ui-language=es">Spanish</a>
|
47
|
+
<a class="link" href="?sap-ui-language=fr">French</a>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div class="app-docs">
|
52
|
+
<h2>Documentation</h2>
|
53
|
+
<a class="link" href="https://sap.github.io/ui5-webcomponents/playground/?path=/docs/docs-development-custom-ui5-web-components-packages--docs">Custom Component Development</a>
|
54
|
+
</div>
|
55
|
+
</div>
|
52
56
|
</body>
|
53
|
-
|
54
57
|
</html>
|
@@ -1,10 +1,11 @@
|
|
1
1
|
const assert = require("assert");
|
2
2
|
|
3
3
|
describe("INIT_PACKAGE_VAR_TAG rendering", async () => {
|
4
|
-
|
4
|
+
before(async () => {
|
5
|
+
await browser.url("test/pages/index.html");
|
6
|
+
});
|
5
7
|
|
6
8
|
it("tests if web component is correctly rendered", async () => {
|
7
|
-
|
8
9
|
const innerContent = await browser.$("#myFirstComponent").shadow$("div");
|
9
10
|
|
10
11
|
assert.ok(innerContent, "content rendered");
|