@ui5/create-webcomponents-package 0.0.0-6298a142d → 0.0.0-6827fdc09
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 +1277 -0
- package/README.md +13 -14
- package/create-package.js +152 -211
- package/package.json +4 -1
- package/template/.eslintignore +3 -2
- package/template/.npsrc.json +3 -0
- package/template/cypress/component/DemoCounter.tsx +13 -0
- package/template/cypress/fixtures/example.json +5 -0
- package/template/cypress/support/commands.ts +37 -0
- package/template/cypress/support/component-index.html +12 -0
- package/template/cypress/support/component.ts +36 -0
- package/template/cypress/tsconfig.json +19 -0
- package/template/cypress.config.ts +10 -0
- package/template/gitignore +2 -2
- package/template/{package-scripts.js → package-scripts.cjs} +0 -1
- package/template/package.json +35 -0
- package/template/src/Assets.ts +1 -1
- package/template/src/DemoCounter.ts +56 -0
- package/template/src/DemoCounterTemplate.tsx +9 -0
- package/template/src/bundle.esm.ts +7 -0
- package/template/src/i18n/messagebundle.properties +1 -1
- 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 → DemoCounter.css} +6 -1
- package/template/test/pages/css/index.css +64 -13
- package/template/test/pages/img/logo.png +0 -0
- package/template/test/pages/index.html +35 -39
- package/template/tsconfig.json +13 -14
- package/template/vite.config.js +14 -0
- package/template/bundle.esm.js +0 -31
- package/template/config/postcss.components/postcss.config.js +0 -1
- package/template/config/postcss.themes/postcss.config.js +0 -1
- package/template/config/vite.config.js +0 -4
- package/template/config/wdio.conf.js +0 -1
- package/template/src/Assets.js +0 -5
- package/template/src/MyFirstComponent.hbs +0 -1
- package/template/src/MyFirstComponent.js +0 -80
- package/template/src/MyFirstComponent.ts +0 -62
- package/template/src/themes/sap_fiori_3/parameters-bundle.css +0 -3
- package/template/test/specs/Demo.spec.js +0 -13
- /package/template/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{INIT_PACKAGE_VAR_NAME}}",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"ui5": {
|
|
5
|
+
"webComponentsPackage": true
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"clean": "wc-dev clean",
|
|
10
|
+
"lint": "wc-dev lint",
|
|
11
|
+
"start": "wc-dev start",
|
|
12
|
+
"watch": "wc-dev watch",
|
|
13
|
+
"build": "wc-dev build",
|
|
14
|
+
{{INIT_PACKAGE_CYPRESS_TEST_COMMANDS}}
|
|
15
|
+
"create-ui5-element": "wc-create-ui5-element",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
"./src/*": "./src/*",
|
|
20
|
+
"./dist/*": "./dist/*",
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
"./bundle.js": "./bundle.js",
|
|
23
|
+
"./*": "./dist/*"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@ui5/webcomponents-base": "{{INIT_PACKAGE_VERSION}}",
|
|
27
|
+
"@ui5/webcomponents-theming": "{{INIT_PACKAGE_VERSION}}"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
{{INIT_PACKAGE_CYPRESS_DEV_DEPS}}
|
|
31
|
+
"@ui5/webcomponents-tools": "{{INIT_PACKAGE_VERSION}}",
|
|
32
|
+
"chromedriver": "*",
|
|
33
|
+
"typescript": "^5.6.2"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/template/src/Assets.ts
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
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 i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
5
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
6
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
7
|
+
|
|
8
|
+
// Template
|
|
9
|
+
import DemoCounterTemplate from "./DemoCounterTemplate.js";
|
|
10
|
+
|
|
11
|
+
// Styles
|
|
12
|
+
import DemoCounterCss from "./generated/themes/DemoCounter.css.js";
|
|
13
|
+
|
|
14
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @class
|
|
18
|
+
*
|
|
19
|
+
* <h3 class="comment-api-title">Overview</h3>
|
|
20
|
+
*
|
|
21
|
+
* The <code>demo-counter</code> component is a demo component that increases a number upon click.
|
|
22
|
+
*
|
|
23
|
+
* @constructor
|
|
24
|
+
* @extends UI5Element
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
@customElement({
|
|
28
|
+
tag: "demo-counter",
|
|
29
|
+
renderer: jsxRenderer,
|
|
30
|
+
styles: DemoCounterCss,
|
|
31
|
+
template: DemoCounterTemplate,
|
|
32
|
+
})
|
|
33
|
+
class DemoCounter extends UI5Element {
|
|
34
|
+
@i18n("{{INIT_PACKAGE_VAR_NAME}}")
|
|
35
|
+
static i18nBundle: I18nBundle;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Defines the component count.
|
|
39
|
+
* @default 0
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
@property({ type: Number })
|
|
43
|
+
count = 0;
|
|
44
|
+
|
|
45
|
+
onClick() {
|
|
46
|
+
this.count++;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get counterText() {
|
|
50
|
+
return DemoCounter.i18nBundle.getText(COUNT);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
DemoCounter.define();
|
|
55
|
+
|
|
56
|
+
export default DemoCounter;
|
|
@@ -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,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
.root {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
flex-direction: column;
|
|
2
6
|
padding: 0 2rem;
|
|
3
7
|
color: var(--sapAvatar_6_TextColor);
|
|
4
8
|
background-color: var(--sapAvatar_6_Background);
|
|
@@ -9,4 +13,5 @@
|
|
|
9
13
|
line-height: 3rem;
|
|
10
14
|
font-size: 1.25rem;
|
|
11
15
|
user-select: none;
|
|
16
|
+
cursor: pointer;
|
|
12
17
|
}
|
|
@@ -3,6 +3,7 @@ body {
|
|
|
3
3
|
background-color: var(--sapBackgroundColor);
|
|
4
4
|
font-size: var(--sapFontSize);
|
|
5
5
|
font-family: var(--sapFontFamily);
|
|
6
|
+
padding: 2rem;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
h1 {
|
|
@@ -11,26 +12,76 @@ h1 {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
h2 {
|
|
14
|
-
font-size: var(--
|
|
15
|
-
|
|
15
|
+
font-size: var(--sapFontHeader4Size);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
a {
|
|
19
|
+
margin: 0.25rem;
|
|
20
|
+
padding: 0.5rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
a.link {
|
|
24
|
+
color: var(--sapLinkColor);
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
.
|
|
27
|
+
a.theme-link {
|
|
28
|
+
color: var(--sapButton_Emphasized_TextColor);
|
|
29
|
+
background-color: var(--sapButton_Emphasized_Background);
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
a.lang-link {
|
|
34
|
+
color: var(--sapButton_Attention_TextColor);
|
|
35
|
+
background-color: var(--sapButton_Attention_Background);
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.app {
|
|
19
40
|
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
41
|
flex-direction: column;
|
|
42
|
+
align-items: center;
|
|
23
43
|
}
|
|
24
44
|
|
|
25
|
-
.app-
|
|
26
|
-
|
|
45
|
+
.app-nav {
|
|
46
|
+
display: flex;
|
|
47
|
+
width: 100%;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
justify-content: flex-end;
|
|
27
50
|
}
|
|
28
51
|
|
|
29
|
-
.app-
|
|
30
|
-
|
|
52
|
+
.app-logo {
|
|
53
|
+
height: 5rem;
|
|
54
|
+
width: 5rem;
|
|
31
55
|
}
|
|
32
56
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
.app-header {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.app-main {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
padding-top: 2rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.app-main-demo {
|
|
71
|
+
padding: 2rem;
|
|
72
|
+
border-radius: 0.5rem;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
background-color: var(--sapTile_Background);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.app-main-settings {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
padding: 0 2rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@media (max-width: 768px) {
|
|
84
|
+
.app-main {
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
Binary file
|
|
@@ -1,57 +1,53 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
2
|
+
<html lang="en">
|
|
3
3
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
|
-
|
|
7
|
-
<title>INIT_PACKAGE_VAR_TAG</title>
|
|
6
|
+
<title>UI5 Web Components</title>
|
|
8
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
8
|
<meta charset="utf-8">
|
|
10
|
-
|
|
11
|
-
<script data-ui5-config type="application/json">
|
|
12
|
-
{
|
|
13
|
-
"theme": "sap_horizon_dark",
|
|
14
|
-
"language": "EN"
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
9
|
<link rel="stylesheet" type="text/css" href="./css/index.css">
|
|
19
|
-
<script src="../../bundle.esm.js" type="module"></script>
|
|
10
|
+
<script src="../../dist/bundle.esm.js" type="module"></script>
|
|
20
11
|
</head>
|
|
21
12
|
|
|
22
13
|
<body>
|
|
23
14
|
<div class="app">
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
<INIT_PACKAGE_VAR_TAG id="myFirstComponent"></INIT_PACKAGE_VAR_TAG>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div class="app-settings">
|
|
15
|
+
<nav class="app-nav">
|
|
16
|
+
<a class="link" href="https://sap.github.io/ui5-webcomponents/">Website</a>
|
|
17
|
+
<a class="link" href="https://sap.github.io/ui5-webcomponents/components/">Components</a>
|
|
18
|
+
<a class="link" href="https://sap.github.io/ui5-webcomponents/docs/development/package/">Development</a>
|
|
19
|
+
</nav>
|
|
33
20
|
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
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>
|
|
21
|
+
<header class="app-header">
|
|
22
|
+
<a href="https://sap.github.io/ui5-webcomponents/" target="_blank"><img src="./img/logo.png" class="app-logo" alt="logo"/></a>
|
|
23
|
+
<h1>UI5 Web Components</h1>
|
|
24
|
+
</header>
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
<div>
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
<a class="link" href="?sap-ui-language=fr">French</a>
|
|
26
|
+
<main class="app-main">
|
|
27
|
+
<div class="app-main-demo">
|
|
28
|
+
<h2>Congrats! It's your First Web Component 🎉</h2>
|
|
29
|
+
<div> <pre><demo-counter></demo-counter> </pre></div>
|
|
30
|
+
<demo-counter id="myFirstComponent"></demo-counter>
|
|
48
31
|
</div>
|
|
49
|
-
</div>
|
|
50
32
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
<div class="app-main-settings">
|
|
34
|
+
<h3>Switch theme</h3>
|
|
35
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr;">
|
|
36
|
+
<a class="link theme-link" href="?sap-ui-theme=sap_horizon">Horizon Morning</a>
|
|
37
|
+
<a class="link theme-link" href="?sap-ui-theme=sap_horizon_dark">Horizon Evening</a>
|
|
38
|
+
<a class="link theme-link" href="?sap-ui-theme=sap_horizon_hcb">High Contrast Black</a>
|
|
39
|
+
<a class="link theme-link" href="?sap-ui-theme=sap_horizon_hcw">High Contrast White</a>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<h3>Switch language</h3>
|
|
43
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr;">
|
|
44
|
+
<a class="link lang-link" href="?sap-ui-language=en">English</a>
|
|
45
|
+
<a class="link lang-link" href="?sap-ui-language=de">German</a>
|
|
46
|
+
<a class="link lang-link" href="?sap-ui-language=es">Spanish</a>
|
|
47
|
+
<a class="link lang-link" href="?sap-ui-language=fr">French</a>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</main>
|
|
55
51
|
</div>
|
|
56
52
|
</body>
|
|
57
53
|
</html>
|
package/template/tsconfig.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
2
|
+
"extends": "@ui5/webcomponents-tools/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"src/**/*",
|
|
5
|
+
"global.d.ts"
|
|
6
|
+
],
|
|
7
|
+
"compilerOptions": {
|
|
8
|
+
{{INIT_PACKAGE_CYPRESS_ROOT_TSCONFIG}}
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"experimentalDecorators": true,
|
|
11
|
+
"module": "NodeNext",
|
|
12
|
+
"moduleResolution": "NodeNext"
|
|
13
|
+
},
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import viteConfig from "@ui5/webcomponents-tools/components-package/vite.config.js"; //eslint-disable-line
|
|
2
|
+
|
|
3
|
+
// Modifying the default Vite configuration provided by the @ui5/webcomponents-tools package.
|
|
4
|
+
// You can directly access and update the properties you need to change.
|
|
5
|
+
// Ensure that the property exists before modifying it to avoid unintended errors.
|
|
6
|
+
// For available configuration options, refer to: https://vite.dev/config/#configuring-vite
|
|
7
|
+
//
|
|
8
|
+
// Ensure the plugins array exists
|
|
9
|
+
// viteConfig.plugins = viteConfig.plugins || [];
|
|
10
|
+
//
|
|
11
|
+
// Push a new fake plugin
|
|
12
|
+
// viteConfig.plugins.push({ name: 'my-custom-plugin' });
|
|
13
|
+
|
|
14
|
+
export default viteConfig;
|
package/template/bundle.esm.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// used in test pages
|
|
2
|
-
import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
|
|
3
|
-
|
|
4
|
-
import { getAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js";
|
|
5
|
-
import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
|
|
6
|
-
import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
|
|
7
|
-
import { getTheme, setTheme } from "@ui5/webcomponents-base/dist/config/Theme.js";
|
|
8
|
-
import { getNoConflict, setNoConflict } from "@ui5/webcomponents-base/dist/config/NoConflict.js";
|
|
9
|
-
import { getRTL } from "@ui5/webcomponents-base/dist/config/RTL.js";
|
|
10
|
-
import { getFirstDayOfWeek } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
|
|
11
|
-
|
|
12
|
-
// Enable additional themes and i18n texts
|
|
13
|
-
import "./dist/Assets.js";
|
|
14
|
-
|
|
15
|
-
// Import your web components here from the dist/ directory
|
|
16
|
-
import "./dist/INIT_PACKAGE_VAR_CLASS_NAME.js";
|
|
17
|
-
|
|
18
|
-
window["sap-ui-webcomponents-bundle"] = {
|
|
19
|
-
renderFinished,
|
|
20
|
-
configuration: {
|
|
21
|
-
getAnimationMode,
|
|
22
|
-
getLanguage,
|
|
23
|
-
getTheme,
|
|
24
|
-
setTheme,
|
|
25
|
-
getNoConflict,
|
|
26
|
-
setNoConflict,
|
|
27
|
-
getCalendarType,
|
|
28
|
-
getRTL,
|
|
29
|
-
getFirstDayOfWeek,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/wdio.js"); // eslint-disable-line
|
package/template/src/Assets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div @click="{{onClick}}">{{counterText}} :: {{counter}}</div>
|
|
@@ -1,80 +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 { COUNTER } from "./generated/i18n/i18n-defaults.js";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
const metadata = {
|
|
17
|
-
tag: "INIT_PACKAGE_VAR_TAG",
|
|
18
|
-
properties: /** @lends INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME.prototype */ {
|
|
19
|
-
/**
|
|
20
|
-
* Defines the counter of the component.
|
|
21
|
-
* @type { number }
|
|
22
|
-
* @defaultvalue 0
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
counter: {
|
|
26
|
-
defaultValue: 0,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
slots: {
|
|
30
|
-
},
|
|
31
|
-
events: {
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @class
|
|
37
|
-
*
|
|
38
|
-
* <h3 class="comment-api-title">Overview</h3>
|
|
39
|
-
*
|
|
40
|
-
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
|
41
|
-
*
|
|
42
|
-
* @constructor
|
|
43
|
-
* @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
|
|
44
|
-
* @extends sap.ui.webc.base.UI5Element
|
|
45
|
-
* @tagname INIT_PACKAGE_VAR_TAG
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
49
|
-
static get metadata() {
|
|
50
|
-
return metadata;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
static get render() {
|
|
54
|
-
return litRender;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
static get template() {
|
|
58
|
-
return INIT_PACKAGE_VAR_CLASS_NAMETemplate;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
static get styles() {
|
|
62
|
-
return INIT_PACKAGE_VAR_CLASS_NAMECss;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
static async onDefine() {
|
|
66
|
-
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
onClick() {
|
|
70
|
-
this.counter++;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
get counterText() {
|
|
74
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNTER);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
|
79
|
-
|
|
80
|
-
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
// Template
|
|
9
|
-
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
|
|
10
|
-
|
|
11
|
-
// Styles
|
|
12
|
-
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
|
13
|
-
|
|
14
|
-
import { COUNTER } from "./generated/i18n/i18n-defaults.js";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @class
|
|
18
|
-
*
|
|
19
|
-
* <h3 class="comment-api-title">Overview</h3>
|
|
20
|
-
*
|
|
21
|
-
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
|
22
|
-
*
|
|
23
|
-
* @constructor
|
|
24
|
-
* @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
|
|
25
|
-
* @extends sap.ui.webc.base.UI5Element
|
|
26
|
-
* @tagname INIT_PACKAGE_VAR_TAG
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
@customElement({
|
|
30
|
-
tag: "INIT_PACKAGE_VAR_TAG",
|
|
31
|
-
renderer: litRender,
|
|
32
|
-
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
|
33
|
-
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
|
34
|
-
})
|
|
35
|
-
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
36
|
-
static i18nBundle: I18nBundle;
|
|
37
|
-
|
|
38
|
-
static async onDefine() {
|
|
39
|
-
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Defines the component counter.
|
|
44
|
-
* @name NIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME.prototype.counter
|
|
45
|
-
* @public
|
|
46
|
-
* @type { number }
|
|
47
|
-
*/
|
|
48
|
-
@property({ defaultValue: 0 })
|
|
49
|
-
counter!: number;
|
|
50
|
-
|
|
51
|
-
onClick() {
|
|
52
|
-
this.counter++;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
get counterText() {
|
|
56
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNTER);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
|
61
|
-
|
|
62
|
-
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const assert = require("assert");
|
|
2
|
-
|
|
3
|
-
describe("INIT_PACKAGE_VAR_TAG rendering", async () => {
|
|
4
|
-
before(async () => {
|
|
5
|
-
await browser.url("test/pages/index.html");
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
it("tests if web component is correctly rendered", async () => {
|
|
9
|
-
const innerContent = await browser.$("#myFirstComponent").shadow$("div");
|
|
10
|
-
|
|
11
|
-
assert.ok(innerContent, "content rendered");
|
|
12
|
-
});
|
|
13
|
-
});
|
|
File without changes
|