@ui5/create-webcomponents-package 0.0.0-b93bc8b37 → 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.
Files changed (31) hide show
  1. package/CHANGELOG.md +843 -0
  2. package/README.md +5 -4
  3. package/create-package.js +24 -58
  4. package/package.json +1 -1
  5. package/template/.eslintignore +0 -1
  6. package/template/bundle.esm.js +0 -2
  7. package/template/gitignore +0 -1
  8. package/template/package-scripts.js +0 -1
  9. package/template/src/MyFirstComponent.hbs +6 -1
  10. package/template/src/MyFirstComponent.ts +18 -6
  11. package/template/src/i18n/messagebundle.properties +3 -2
  12. package/template/src/i18n/messagebundle_de.properties +1 -1
  13. package/template/src/i18n/messagebundle_en.properties +1 -1
  14. package/template/src/i18n/messagebundle_es.properties +1 -1
  15. package/template/src/i18n/messagebundle_fr.properties +1 -1
  16. package/template/src/themes/MyFirstComponent.css +16 -10
  17. package/template/src/themes/sap_fiori_3/parameters-bundle.css +1 -1
  18. package/template/src/themes/sap_horizon_dark/parameters-bundle.css +1 -1
  19. package/template/test/pages/css/index.css +36 -0
  20. package/template/test/pages/img/logo.png +0 -0
  21. package/template/test/pages/index.html +35 -31
  22. package/template/test/specs/Demo.spec.js +0 -1
  23. package/template/tsconfig.json +1 -0
  24. package/template/config/postcss.components/postcss.config.js +0 -1
  25. package/template/config/postcss.themes/postcss.config.js +0 -1
  26. package/template/global.d.ts +0 -12
  27. package/template/src/Assets.js +0 -5
  28. package/template/src/MyFirstComponent.js +0 -67
  29. package/template/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
  30. package/template/src/themes/sap_fiori_3_hcb/parameters-bundle.css +0 -3
  31. package/template/src/themes/sap_fiori_3_hcw/parameters-bundle.css +0 -3
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/main/docs/images/UI5_logo_wide.png)
2
2
 
3
+
3
4
  # UI5 Web Components - Create Package
4
5
 
5
6
  [![npm Package Version](https://badge.fury.io/js/%40ui5%2Fwebcomponents.svg)](https://www.npmjs.com/package/@ui5/webcomponents)
@@ -18,8 +19,8 @@ Usage:
18
19
 
19
20
  Options:
20
21
  --name <string> - defines the package name
21
- --tag <string> - defines the tag name of the sample web component that will be created in your new package
22
- --enable-typescript - enables TypeScript support for the package
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.
23
24
  --skip - skips configuration and generates package with a default value for each parameter that wasn't passed
24
25
  ```
25
26
 
@@ -33,8 +34,8 @@ Usage:
33
34
  yarn create @ui5/webcomponents-package [OPTIONS]
34
35
  Options:
35
36
  --name <string> - defines the package name
37
+ --component-name <string> - defines the component class name that will be created in your new package
36
38
  --tag <string> - defines the tag name of the sample web component that will be created in your new package
37
- --enable-typescript - enables TypeScript support for the package
38
39
  --skip - skips configuration and generates package with a default value for each parameter that wasn't passed
39
40
  ```
40
41
 
@@ -47,7 +48,7 @@ components package.
47
48
  - [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
48
49
 
49
50
  ## Support
50
- 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://join-ui5-slack.herokuapp.com/).
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/).
51
52
 
52
53
  ## Contribute
53
54
  Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
package/create-package.js CHANGED
@@ -15,30 +15,19 @@ const version = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))
15
15
  // from where all the files will be copied
16
16
  const TEMPLATE_DIR = path.join(`${__dirname}`, `template/`);
17
17
 
18
- // String utils
19
- const capitalizeFirst = str => str.substr(0,1).toUpperCase() + str.substr(1);
20
- const kebabToCamelCase = string => toCamelCase(string.split("-"));
21
- const toCamelCase = parts => {
22
- return parts.map((string, index) => {
23
- return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
24
- }).join("");
25
- };
26
- const isTSRelatedFile = sourcePath => {
27
- return ["Assets.ts", "MyFirstComponent.ts", "tsconfig.json", "global.d.ts"].some(fileName => sourcePath.includes(fileName));
28
- };
29
- const isJSRelatedFile = sourcePath => {
30
- return ["Assets.js", "MyFirstComponent.js"].some(fileName => sourcePath.includes(fileName));
31
- };
32
18
  const isGitIgnore = sourcePath => {
33
19
  return sourcePath.includes("gitignore");
34
20
  };
21
+ const isLogo = sourcePath => {
22
+ return sourcePath.includes("logo");
23
+ };
35
24
  const isNPMRC = sourcePath => {
36
25
  return sourcePath.includes("npmrc");
37
26
  };
38
27
 
39
28
  // Validation of user input
40
29
  const ComponentNamePattern = /^[A-Z][A-Za-z0-9]+$/;
41
- const isNameValid = name => typeof name === "string" && name.match(/^[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-._~]*$/);
42
31
  const isComponentNameValid = name => typeof name === "string" && ComponentNamePattern.test(name);
43
32
  const isTagValid = tag => typeof tag === "string" && tag.match(/^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/);
44
33
 
@@ -67,10 +56,8 @@ const replaceVarsInFileName = (vars, fileName) => {
67
56
  };
68
57
 
69
58
  const copyFile = (vars, sourcePath, destPath) => {
70
- const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && isJSRelatedFile(sourcePath);
71
- const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTSRelatedFile(sourcePath);
72
-
73
- if (ignoreJsRelated || ignoreTsRelated) {
59
+ if (isLogo(sourcePath)) {
60
+ fs.copyFileSync(sourcePath, destPath);
74
61
  return;
75
62
  }
76
63
 
@@ -105,17 +92,18 @@ const copyFiles = (vars, sourcePath, destPath) => {
105
92
  }
106
93
  };
107
94
 
108
- const generateFilesContent = (name, componentName, tagName, typescript, skipSubfolder) => {
95
+ const generateFilesContent = (packageName, componentName, skipSubfolder) => {
96
+ const tagName = argv.tag || hyphaneteComponentName(componentName);
97
+
109
98
  // All variables that will be replaced in the content of the resources/
110
99
  const vars = {
111
- INIT_PACKAGE_VAR_NAME: name,
100
+ INIT_PACKAGE_VAR_NAME: packageName,
112
101
  INIT_PACKAGE_VAR_TAG: tagName,
113
102
  INIT_PACKAGE_VAR_CLASS_NAME: componentName,
114
- INIT_PACKAGE_VAR_TYPESCRIPT: typescript,
115
103
  };
116
104
 
117
105
  const packageContent = {
118
- name,
106
+ name: packageName,
119
107
  version: "0.0.1",
120
108
  ui5: {
121
109
  webComponentsPackage: true,
@@ -144,22 +132,21 @@ const generateFilesContent = (name, componentName, tagName, typescript, skipSubf
144
132
  "devDependencies": {
145
133
  "@ui5/webcomponents-tools": version,
146
134
  "chromedriver": "*",
135
+ "typescript": "^5.2.2"
147
136
  },
148
137
  };
149
138
 
150
- if (typescript) {
151
- packageContent.devDependencies.typescript = "^4.9.4";
152
- }
153
-
154
139
  // Update package.json
155
- const destDir = skipSubfolder ? path.join("./") : path.join("./", name);
140
+ let destDir = packageName.includes("@") ? packageName.slice(packageName.lastIndexOf("/") + 1) : packageName;
141
+
142
+ destDir = skipSubfolder ? path.join("./") : path.join("./", destDir);
156
143
  mkdirp.sync(destDir);
157
144
  fs.writeFileSync(path.join(destDir, "package.json"), JSON.stringify(packageContent, null, 2));
158
145
  // Copy files
159
146
  copyFiles(vars, TEMPLATE_DIR, destDir);
160
147
 
161
148
  console.log("\nPackage successfully created!\nNext steps:\n");
162
- console.log(`$ cd ${name}`);
149
+ console.log(`$ cd ${destDir}`);
163
150
 
164
151
  let userAgentInfo;
165
152
  try {
@@ -180,8 +167,8 @@ const generateFilesContent = (name, componentName, tagName, typescript, skipSubf
180
167
  // Main function
181
168
  const createWebcomponentsPackage = async () => {
182
169
  let response;
183
- if (argv.name && !isNameValid(argv.name)) {
184
- throw new Error("The package name should be a string (a-z, A-Z, 0-9).");
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].");
185
172
  }
186
173
 
187
174
  if (argv.componentName && !isComponentNameValid(argv.componentName)) {
@@ -192,14 +179,12 @@ const createWebcomponentsPackage = async () => {
192
179
  throw new Error("The tag should be in kebab-case (f.e my-component) and it can't be a single word.");
193
180
  }
194
181
 
195
- let name = argv.name || "my-package";
182
+ let packageName = argv.name || "my-package";
196
183
  let componentName = argv.componentName || "MyComponent";
197
- let typescriptSupport = !!argv.enableTypescript;
198
- const tagName = argv.tag || hyphaneteComponentName(componentName);
199
184
  const skipSubfolder = !!argv.skipSubfolder;
200
185
 
201
186
  if (argv.skip) {
202
- return generateFilesContent(name, componentName, tagName, typescriptSupport, skipSubfolder);
187
+ return generateFilesContent(packageName, componentName, skipSubfolder);
203
188
  }
204
189
 
205
190
  if (!argv.name) {
@@ -207,28 +192,9 @@ const createWebcomponentsPackage = async () => {
207
192
  type: "text",
208
193
  name: "name",
209
194
  message: "Package name:",
210
- validate: isNameValid,
211
- });
212
- name = response.name;
213
- }
214
-
215
- if (!typescriptSupport) {
216
- response = await prompts({
217
- type: "select",
218
- name: "language",
219
- message: "Project type:",
220
- choices: [
221
- {
222
- title: "JavaScript",
223
- value: false,
224
- },
225
- {
226
- title: "TypeScript",
227
- value: true,
228
- },
229
- ],
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, _, -].",
230
196
  });
231
- typescriptSupport = response.language;
197
+ packageName = response.name;
232
198
  }
233
199
 
234
200
  if (!argv.componentName) {
@@ -237,12 +203,12 @@ const createWebcomponentsPackage = async () => {
237
203
  name: "componentName",
238
204
  message: "Component name:",
239
205
  initial: "MyComponent",
240
- validate: isComponentNameValid,
206
+ validate: (value) => isComponentNameValid(value) ? true : "Component name should follow PascalCase naming convention (f.e. Button, MyButton, etc.).",
241
207
  });
242
208
  componentName = response.componentName;
243
209
  }
244
210
 
245
- return generateFilesContent(name, componentName, tagName, typescriptSupport, skipSubfolder);
211
+ return generateFilesContent(packageName, componentName, skipSubfolder);
246
212
  };
247
213
 
248
214
  createWebcomponentsPackage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/create-webcomponents-package",
3
- "version": "0.0.0-b93bc8b37",
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",
@@ -2,5 +2,4 @@
2
2
  dist
3
3
  test
4
4
  src/generated
5
- jsdoc-dist
6
5
  .eslintrc.js
@@ -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
  };
@@ -1,4 +1,3 @@
1
1
  node_modules
2
2
  dist
3
- jsdoc-dist
4
3
  src/generated
@@ -2,7 +2,6 @@ const getScripts = require("@ui5/webcomponents-tools/components-package/nps.js")
2
2
 
3
3
  const options = {
4
4
  port: 8080,
5
- typescript: INIT_PACKAGE_VAR_TYPESCRIPT,
6
5
  };
7
6
 
8
7
  const scripts = getScripts(options);
@@ -1 +1,6 @@
1
- <div>This is: INIT_PACKAGE_VAR_TAG. {{pleaseWaitText}}</div>
1
+ <div
2
+ class="root"
3
+ @click="{{onClick}}"
4
+ >
5
+ {{counterText}} :: {{count}}
6
+ </div>
@@ -1,8 +1,10 @@
1
1
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
2
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
3
+ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
3
4
  import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
4
5
  import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
5
6
  import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
7
+ import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
6
8
 
7
9
  // Template
8
10
  import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
@@ -10,7 +12,7 @@ import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACK
10
12
  // Styles
11
13
  import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
12
14
 
13
- import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
15
+ import { COUNT } from "./generated/i18n/i18n-defaults.js";
14
16
 
15
17
  /**
16
18
  * @class
@@ -20,9 +22,7 @@ import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
20
22
  * The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
21
23
  *
22
24
  * @constructor
23
- * @alias demo.components.INIT_PACKAGE_VAR_CLASS_NAME
24
- * @extends sap.ui.webc.base.UI5Element
25
- * @tagname INIT_PACKAGE_VAR_TAG
25
+ * @extends UI5Element
26
26
  * @public
27
27
  */
28
28
  @customElement({
@@ -38,8 +38,20 @@ class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
38
38
  INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
39
39
  }
40
40
 
41
- get pleaseWaitText() {
42
- return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(PLEASE_WAIT);
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);
43
55
  }
44
56
  }
45
57
 
@@ -1,2 +1,3 @@
1
- #please wait text for the sample component
2
- PLEASE_WAIT=wait
1
+ # the "counter" text for the sample component
2
+ COUNT=Count
3
+
@@ -1 +1 @@
1
- PLEASE_WAIT=Bitte warten
1
+ COUNT=Zählung
@@ -1 +1 @@
1
- PLEASE_WAIT=Please wait
1
+ COUNT=Count
@@ -1 +1 @@
1
- PLEASE_WAIT=Espere
1
+ COUNT=Cuenta
@@ -1 +1 @@
1
- PLEASE_WAIT=Patientez.
1
+ COUNT=Comte
@@ -1,11 +1,17 @@
1
- :host {
2
- border: 2px solid var(--my-component-border-color);
3
- background-color: var(--sapBackgroundColor);
4
- color: var(--sapTextColor);
5
- display: block;
6
- width: 24rem;
7
- height: 3rem;
8
- text-align: center;
9
- vertical-align: middle;
10
- line-height: 3rem;
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
  }
@@ -1,3 +1,3 @@
1
1
  :root {
2
- --my-component-border-color: green;
2
+ --my-component-border-color: blue;
3
3
  }
@@ -1,3 +1,3 @@
1
1
  :root {
2
- --my-component-border-color: blue;
2
+ --my-component-border-color: darkblue;
3
3
  }
@@ -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
@@ -10,44 +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
- <ul>
27
- <li><a href="?sap-ui-theme=sap_fiori_3">Fiori 3</a></li>
28
- <li><a href="?sap-ui-theme=sap_fiori_3_dark">Fiori 3 Dark</a></li>
29
- <li><a href="?sap-ui-theme=sap_fiori_3_hcb">Fiori 3 High Contrast Black</a></li>
30
- <li><a href="?sap-ui-theme=sap_fiori_3_hcw">Fiori 3 High Contrast White</a></li>
31
- <li><a href="?sap-ui-theme=sap_horizon">Horizon</a></li>
32
- <li><a href="?sap-ui-theme=sap_horizon_dark">Horizon Dark</a></li>
33
- <li><a href="?sap-ui-theme=sap_horizon_hcb">Horizon High Contrast Black</a></li>
34
- <li><a href="?sap-ui-theme=sap_horizon_hcw">Horizon High Contrast White</a></li>
35
- </ul>
36
- <br>
37
- <span>or in the browser console, for example:</span>
38
- <code>window['sap-ui-webcomponents-bundle'].configuration.setTheme("sap_horizon_hcb")</code>
39
-
40
- <br><br>
41
-
42
- <a href="?sap-ui-language=en">English</a> |
43
- <a href="?sap-ui-language=de">German</a> |
44
- <a href="?sap-ui-language=es">Spanish</a> |
45
- <a href="?sap-ui-language=fr">French</a>
46
-
47
- <br><br>
48
-
49
- <h1>Test your web components here</h1>
50
- <INIT_PACKAGE_VAR_TAG id="myFirstComponent"></INIT_PACKAGE_VAR_TAG>
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>&lt;INIT_PACKAGE_VAR_TAG>&lt;/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>
51
56
  </body>
52
-
53
57
  </html>
@@ -6,7 +6,6 @@ describe("INIT_PACKAGE_VAR_TAG rendering", async () => {
6
6
  });
7
7
 
8
8
  it("tests if web component is correctly rendered", async () => {
9
-
10
9
  const innerContent = await browser.$("#myFirstComponent").shadow$("div");
11
10
 
12
11
  assert.ok(innerContent, "content rendered");
@@ -2,6 +2,7 @@
2
2
  "include": ["src/**/*", "global.d.ts"],
3
3
  "compilerOptions": {
4
4
  "target": "ES2021",
5
+ "lib": ["DOM", "DOM.Iterable", "ES2023"],
5
6
  // Generate d.ts files
6
7
  "declaration": true,
7
8
  "outDir": "dist",
@@ -1 +0,0 @@
1
- module.exports = require("@ui5/webcomponents-tools/components-package/postcss.components.js"); // eslint-disable-line
@@ -1 +0,0 @@
1
- module.exports = require("@ui5/webcomponents-tools/components-package/postcss.themes.js"); // eslint-disable-line
@@ -1,12 +0,0 @@
1
- // eslint-disable-next-line
2
- import "@ui5/webcomponents-base/dist/global";
3
- import { TemplateFunction } from "@ui5/webcomponents-base/dist/renderer/executeTemplate.js";
4
-
5
- export {};
6
-
7
- declare global {
8
- module "*.lit.js" {
9
- const content: TemplateFunction;
10
- export default content;
11
- }
12
- }
@@ -1,5 +0,0 @@
1
- import "@ui5/webcomponents-theming/dist/Assets.js"; // Theming
2
-
3
- // own INIT_PACKAGE_VAR_NAME package assets
4
- import "./generated/json-imports/Themes.js";
5
- import "./generated/json-imports/i18n.js";
@@ -1,67 +0,0 @@
1
- import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
- import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
3
- import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
4
-
5
- // Template
6
- import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
7
-
8
- // Styles
9
- import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
10
-
11
- import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
12
-
13
- /**
14
- * @public
15
- */
16
- const metadata = {
17
- tag: "INIT_PACKAGE_VAR_TAG",
18
- properties: {
19
- },
20
- slots: {
21
- },
22
- events: {
23
- },
24
- };
25
-
26
- /**
27
- * @class
28
- *
29
- * <h3 class="comment-api-title">Overview</h3>
30
- *
31
- * The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
32
- *
33
- * @constructor
34
- * @alias demo.components.INIT_PACKAGE_VAR_CLASS_NAME
35
- * @extends sap.ui.webc.base.UI5Element
36
- * @tagname INIT_PACKAGE_VAR_TAG
37
- * @public
38
- */
39
- class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
40
- static get metadata() {
41
- return metadata;
42
- }
43
-
44
- static get render() {
45
- return litRender;
46
- }
47
-
48
- static get template() {
49
- return INIT_PACKAGE_VAR_CLASS_NAMETemplate;
50
- }
51
-
52
- static get styles() {
53
- return INIT_PACKAGE_VAR_CLASS_NAMECss;
54
- }
55
-
56
- static async onDefine() {
57
- INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
58
- }
59
-
60
- get pleaseWaitText() {
61
- return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(PLEASE_WAIT);
62
- }
63
- }
64
-
65
- INIT_PACKAGE_VAR_CLASS_NAME.define();
66
-
67
- export default INIT_PACKAGE_VAR_CLASS_NAME;
@@ -1,3 +0,0 @@
1
- :root {
2
- --my-component-border-color: blue;
3
- }
@@ -1,3 +0,0 @@
1
- :root {
2
- --my-component-border-color: lightblue;
3
- }
@@ -1,3 +0,0 @@
1
- :root {
2
- --my-component-border-color: gray;
3
- }