@ui5/create-webcomponents-package 0.0.0-ee3bbe46b → 0.0.0-f42e7c18c
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 +1284 -0
- package/README.md +30 -12
- package/create-package.js +215 -0
- package/package.json +4 -3
- package/template/.eslintignore +2 -0
- package/template/.eslintrc.cjs +5 -0
- package/template/.npsrc.json +3 -0
- package/template/bundle.esm.js +0 -2
- package/template/gitignore +3 -0
- package/template/npmrc +2 -0
- package/template/{package-scripts.js → package-scripts.cjs} +1 -1
- package/template/src/MyFirstComponent.hbs +6 -1
- package/template/src/{MyFirstComponent.js → MyFirstComponent.ts} +25 -33
- 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 +41 -0
- package/template/test/pages/img/logo.png +0 -0
- package/template/test/pages/index.html +35 -30
- package/template/test/specs/Demo.spec.js +4 -3
- package/template/tsconfig.json +13 -0
- package/index.js +0 -169
- package/template/config/postcss.components/postcss.config.js +0 -1
- package/template/config/postcss.themes/postcss.config.js +0 -1
- 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/config/{wdio.conf.js → wdio.conf.cjs} +0 -0
- /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,22 +1,40 @@
|
|
1
|
-
UI5 Web Components - Create Package
|
4
2
|
|
5
3
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
6
4
|
|
7
5
|
Provides an `npm init` script for creating new "UI5 Web Components" packages.
|
8
6
|
|
9
|
-
## Usage
|
7
|
+
## Usage with npm
|
8
|
+
|
9
|
+
```
|
10
|
+
Usage:
|
11
|
+
|
12
|
+
# npm 6.x
|
13
|
+
npm init @ui5/webcomponents-package [OPTIONS]
|
14
|
+
# npm 7+, an extra double-dash is needed:
|
15
|
+
npm init @ui5/webcomponents-package -- [OPTIONS]
|
10
16
|
|
11
|
-
|
17
|
+
Options:
|
18
|
+
--name <string> - defines the package name
|
19
|
+
--component-name <string> - defines the component class name that will be created in your new package
|
20
|
+
--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.
|
21
|
+
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
22
|
+
```
|
12
23
|
|
13
|
-
|
14
|
-
|
24
|
+
The script creates a new directory, and fills it with a `package.json` file and all necessary source files, and resources for a new
|
25
|
+
components package.
|
15
26
|
|
16
|
-
|
27
|
+
## Usage with yarn
|
17
28
|
|
18
|
-
|
19
|
-
|
29
|
+
```
|
30
|
+
Usage:
|
31
|
+
yarn create @ui5/webcomponents-package [OPTIONS]
|
32
|
+
Options:
|
33
|
+
--name <string> - defines the package name
|
34
|
+
--component-name <string> - defines the component class name that will be created in your new package
|
35
|
+
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
36
|
+
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
37
|
+
```
|
20
38
|
|
21
39
|
The script creates a new directory, and fills it with a `package.json` file and all necessary source files, and resources for a new
|
22
40
|
components package.
|
@@ -24,10 +42,10 @@ components package.
|
|
24
42
|
## Resources
|
25
43
|
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
26
44
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
27
|
-
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/
|
45
|
+
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/play/)
|
28
46
|
|
29
47
|
## Support
|
30
|
-
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://
|
48
|
+
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/).
|
31
49
|
|
32
50
|
## Contribute
|
33
51
|
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
@@ -0,0 +1,215 @@
|
|
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
|
+
type: "module",
|
112
|
+
scripts: {
|
113
|
+
"clean": "wc-dev clean",
|
114
|
+
"lint": "wc-dev lint",
|
115
|
+
"start": "wc-dev start",
|
116
|
+
"watch": "wc-dev watch",
|
117
|
+
"build": "wc-dev build",
|
118
|
+
"test": "wc-dev test",
|
119
|
+
"create-ui5-element": "wc-create-ui5-element",
|
120
|
+
"prepublishOnly": "npm run build",
|
121
|
+
},
|
122
|
+
exports: {
|
123
|
+
"./src/*": "./src/*",
|
124
|
+
"./dist/*": "./dist/*",
|
125
|
+
"./package.json": "./package.json",
|
126
|
+
"./bundle.js": "./bundle.js",
|
127
|
+
"./*": "./dist/*",
|
128
|
+
},
|
129
|
+
"dependencies": {
|
130
|
+
"@ui5/webcomponents-base": version,
|
131
|
+
"@ui5/webcomponents-theming": version,
|
132
|
+
},
|
133
|
+
"devDependencies": {
|
134
|
+
"@ui5/webcomponents-tools": version,
|
135
|
+
"chromedriver": "*",
|
136
|
+
"typescript": "^5.6.2"
|
137
|
+
},
|
138
|
+
};
|
139
|
+
|
140
|
+
// Update package.json
|
141
|
+
let destDir = packageName.includes("@") ? packageName.slice(packageName.lastIndexOf("/") + 1) : packageName;
|
142
|
+
|
143
|
+
destDir = skipSubfolder ? path.join("./") : path.join("./", destDir);
|
144
|
+
mkdirp.sync(destDir);
|
145
|
+
fs.writeFileSync(path.join(destDir, "package.json"), JSON.stringify(packageContent, null, 2));
|
146
|
+
// Copy files
|
147
|
+
copyFiles(vars, TEMPLATE_DIR, destDir);
|
148
|
+
|
149
|
+
console.log("\nPackage successfully created!\nNext steps:\n");
|
150
|
+
console.log(`$ cd ${destDir}`);
|
151
|
+
|
152
|
+
let userAgentInfo;
|
153
|
+
try {
|
154
|
+
userAgentInfo = parser(process.env.npm_config_user_agent);
|
155
|
+
} catch (e) {}
|
156
|
+
|
157
|
+
if (userAgentInfo && userAgentInfo.yarn) {
|
158
|
+
console.log(`$ yarn`);
|
159
|
+
console.log(`$ yarn start`);
|
160
|
+
} else {
|
161
|
+
console.log(`$ npm i`);
|
162
|
+
console.log(`$ npm start`);
|
163
|
+
}
|
164
|
+
|
165
|
+
console.log("\n");
|
166
|
+
};
|
167
|
+
|
168
|
+
// Main function
|
169
|
+
const createWebcomponentsPackage = async () => {
|
170
|
+
let response;
|
171
|
+
if (argv.name && !isPackageNameValid(argv.name)) {
|
172
|
+
throw new Error("The package name should be a string, starting with letter and containing the following symbols [a-z, A-Z, 0-9].");
|
173
|
+
}
|
174
|
+
|
175
|
+
if (argv.componentName && !isComponentNameValid(argv.componentName)) {
|
176
|
+
throw new Error("The component name should be a string, starting with a capital letter [A-Z][a-z], for example: Button, MyButton, etc.");
|
177
|
+
}
|
178
|
+
|
179
|
+
if (argv.tag && !isTagValid(argv.tag) ) {
|
180
|
+
throw new Error("The tag should be in kebab-case (f.e my-component) and it can't be a single word.");
|
181
|
+
}
|
182
|
+
|
183
|
+
let packageName = argv.name || "my-package";
|
184
|
+
let componentName = argv.componentName || "MyComponent";
|
185
|
+
const skipSubfolder = !!argv.skipSubfolder;
|
186
|
+
|
187
|
+
if (argv.skip) {
|
188
|
+
return generateFilesContent(packageName, componentName, skipSubfolder);
|
189
|
+
}
|
190
|
+
|
191
|
+
if (!argv.name) {
|
192
|
+
response = await prompts({
|
193
|
+
type: "text",
|
194
|
+
name: "name",
|
195
|
+
message: "Package name:",
|
196
|
+
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, _, -].",
|
197
|
+
});
|
198
|
+
packageName = response.name;
|
199
|
+
}
|
200
|
+
|
201
|
+
if (!argv.componentName) {
|
202
|
+
response = await prompts({
|
203
|
+
type: "text",
|
204
|
+
name: "componentName",
|
205
|
+
message: "Component name:",
|
206
|
+
initial: "MyComponent",
|
207
|
+
validate: (value) => isComponentNameValid(value) ? true : "Component name should follow PascalCase naming convention (f.e. Button, MyButton, etc.).",
|
208
|
+
});
|
209
|
+
componentName = response.componentName;
|
210
|
+
}
|
211
|
+
|
212
|
+
return generateFilesContent(packageName, componentName, skipSubfolder);
|
213
|
+
};
|
214
|
+
|
215
|
+
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-f42e7c18c",
|
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
@@ -1,6 +1,9 @@
|
|
1
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";
|
2
4
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
3
5
|
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
6
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
4
7
|
|
5
8
|
// Template
|
6
9
|
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
|
@@ -8,20 +11,7 @@ import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACK
|
|
8
11
|
// Styles
|
9
12
|
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
10
13
|
|
11
|
-
import {
|
12
|
-
|
13
|
-
/**
|
14
|
-
* @public
|
15
|
-
*/
|
16
|
-
const metadata = {
|
17
|
-
tag: "INIT_PACKAGE_VAR_TAG",
|
18
|
-
properties: {
|
19
|
-
},
|
20
|
-
slots: {
|
21
|
-
},
|
22
|
-
events: {
|
23
|
-
},
|
24
|
-
};
|
14
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
25
15
|
|
26
16
|
/**
|
27
17
|
* @class
|
@@ -31,34 +21,36 @@ const metadata = {
|
|
31
21
|
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
32
22
|
*
|
33
23
|
* @constructor
|
34
|
-
* @
|
35
|
-
* @extends sap.ui.webc.base.UI5Element
|
36
|
-
* @tagname INIT_PACKAGE_VAR_TAG
|
24
|
+
* @extends UI5Element
|
37
25
|
* @public
|
38
26
|
*/
|
27
|
+
@customElement({
|
28
|
+
tag: "INIT_PACKAGE_VAR_TAG",
|
29
|
+
renderer: litRender,
|
30
|
+
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
31
|
+
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
32
|
+
})
|
39
33
|
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
40
|
-
static
|
41
|
-
return metadata;
|
42
|
-
}
|
34
|
+
static i18nBundle: I18nBundle;
|
43
35
|
|
44
|
-
static
|
45
|
-
|
36
|
+
static async onDefine() {
|
37
|
+
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
46
38
|
}
|
47
39
|
|
48
|
-
|
49
|
-
|
50
|
-
|
40
|
+
/**
|
41
|
+
* Defines the component count.
|
42
|
+
* @default 0
|
43
|
+
* @public
|
44
|
+
*/
|
45
|
+
@property({ type: Number })
|
46
|
+
count = 0;
|
51
47
|
|
52
|
-
|
53
|
-
|
54
|
-
}
|
55
|
-
|
56
|
-
static async onDefine() {
|
57
|
-
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
48
|
+
onClick() {
|
49
|
+
this.count++;
|
58
50
|
}
|
59
51
|
|
60
|
-
get
|
61
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(
|
52
|
+
get counterText() {
|
53
|
+
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNT);
|
62
54
|
}
|
63
55
|
}
|
64
56
|
|
@@ -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,41 @@
|
|
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-logo {
|
26
|
+
height: 230px;
|
27
|
+
width: 230px;
|
28
|
+
}
|
29
|
+
|
30
|
+
.app-first-component {
|
31
|
+
margin-bottom: 3rem;
|
32
|
+
}
|
33
|
+
|
34
|
+
.app-docs {
|
35
|
+
margin-top: 3rem;
|
36
|
+
}
|
37
|
+
|
38
|
+
a {
|
39
|
+
margin: 0.25rem;
|
40
|
+
color: var(--sapLinkColor);
|
41
|
+
}
|
Binary file
|
@@ -10,43 +10,48 @@
|
|
10
10
|
|
11
11
|
<script data-ui5-config type="application/json">
|
12
12
|
{
|
13
|
+
"theme": "sap_horizon_dark",
|
13
14
|
"language": "EN"
|
14
15
|
}
|
15
16
|
</script>
|
16
17
|
|
18
|
+
<link rel="stylesheet" type="text/css" href="./css/index.css">
|
17
19
|
<script src="../../bundle.esm.js" type="module"></script>
|
18
|
-
|
19
|
-
<style>
|
20
|
-
code { color: blue; font-size: small; }
|
21
|
-
</style>
|
22
|
-
|
23
20
|
</head>
|
24
21
|
|
25
22
|
<body>
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
<
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
23
|
+
<div class="app">
|
24
|
+
<a href="https://sap.github.io/ui5-webcomponents/docs/getting-started/first-steps/" target="_blank"><img src="./img/logo.png" class="app-logo" 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/docs/development/custom-UI5-Web-Components-Packages/">Custom Component Development</a>
|
54
|
+
</div>
|
55
|
+
</div>
|
50
56
|
</body>
|
51
|
-
|
52
57
|
</html>
|