@ui5/create-webcomponents-package 0.0.0-6298a142d → 0.0.0-69dbc5a15
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 +1146 -0
- package/README.md +6 -9
- package/create-package.js +10 -58
- package/package.json +1 -1
- package/template/.eslintignore +1 -2
- package/template/.npsrc.json +3 -0
- package/template/bundle.esm.js +0 -2
- package/template/gitignore +0 -1
- package/template/{package-scripts.js → package-scripts.cjs} +0 -1
- package/template/src/MyFirstComponent.ts +11 -14
- package/template/src/MyFirstComponentTemplate.tsx +9 -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 +6 -1
- package/template/test/pages/css/index.css +7 -2
- package/template/test/pages/img/logo.png +0 -0
- package/template/test/pages/index.html +5 -5
- package/template/test/specs/Demo.spec.js +1 -1
- package/template/tsconfig.json +12 -14
- 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/src/Assets.js +0 -5
- package/template/src/MyFirstComponent.hbs +0 -1
- package/template/src/MyFirstComponent.js +0 -80
- /package/template/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/template/config/{wdio.conf.js → wdio.conf.cjs} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
UI5 Web Components - Create Package
|
|
4
2
|
|
|
5
3
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
|
6
4
|
|
|
@@ -18,9 +16,8 @@ Usage:
|
|
|
18
16
|
|
|
19
17
|
Options:
|
|
20
18
|
--name <string> - defines the package name
|
|
21
|
-
--
|
|
22
|
-
--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
|
-
--enable-typescript - enables TypeScript support for the package
|
|
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.
|
|
24
21
|
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
|
25
22
|
```
|
|
26
23
|
|
|
@@ -34,8 +31,8 @@ Usage:
|
|
|
34
31
|
yarn create @ui5/webcomponents-package [OPTIONS]
|
|
35
32
|
Options:
|
|
36
33
|
--name <string> - defines the package name
|
|
34
|
+
--component-name <string> - defines the component class name that will be created in your new package
|
|
37
35
|
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
|
38
|
-
--enable-typescript - enables TypeScript support for the package
|
|
39
36
|
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
|
40
37
|
```
|
|
41
38
|
|
|
@@ -45,10 +42,10 @@ components package.
|
|
|
45
42
|
## Resources
|
|
46
43
|
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
|
47
44
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
|
48
|
-
- [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/)
|
|
49
46
|
|
|
50
47
|
## Support
|
|
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://
|
|
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/).
|
|
52
49
|
|
|
53
50
|
## Contribute
|
|
54
51
|
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,26 +15,20 @@ 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 isTSRelatedFile = sourcePath => {
|
|
20
|
-
return ["Assets.ts", "MyFirstComponent.ts", "tsconfig.json", "global.d.ts"].some(fileName => sourcePath.includes(fileName));
|
|
21
|
-
};
|
|
22
|
-
const isJSRelatedFile = sourcePath => {
|
|
23
|
-
return ["Assets.js", "MyFirstComponent.js"].some(fileName => sourcePath.includes(fileName));
|
|
24
|
-
};
|
|
25
18
|
const isGitIgnore = sourcePath => {
|
|
26
19
|
return sourcePath.includes("gitignore");
|
|
27
20
|
};
|
|
21
|
+
const isLogo = sourcePath => {
|
|
22
|
+
return sourcePath.includes("logo");
|
|
23
|
+
};
|
|
28
24
|
const isNPMRC = sourcePath => {
|
|
29
25
|
return sourcePath.includes("npmrc");
|
|
30
26
|
};
|
|
31
27
|
|
|
32
28
|
// Validation of user input
|
|
33
29
|
const ComponentNamePattern = /^[A-Z][A-Za-z0-9]+$/;
|
|
34
|
-
const NamespacePattern = /^[a-z][a-z0-9\.\-]+$/;
|
|
35
30
|
const isPackageNameValid = name => typeof name === "string" && name.match(/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/);
|
|
36
31
|
const isComponentNameValid = name => typeof name === "string" && ComponentNamePattern.test(name);
|
|
37
|
-
const isNamespaceValid = name => typeof name === "string" && NamespacePattern.test(name);
|
|
38
32
|
const isTagValid = tag => typeof tag === "string" && tag.match(/^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/);
|
|
39
33
|
|
|
40
34
|
/**
|
|
@@ -62,10 +56,8 @@ const replaceVarsInFileName = (vars, fileName) => {
|
|
|
62
56
|
};
|
|
63
57
|
|
|
64
58
|
const copyFile = (vars, sourcePath, destPath) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (ignoreJsRelated || ignoreTsRelated) {
|
|
59
|
+
if (isLogo(sourcePath)) {
|
|
60
|
+
fs.copyFileSync(sourcePath, destPath);
|
|
69
61
|
return;
|
|
70
62
|
}
|
|
71
63
|
|
|
@@ -100,16 +92,14 @@ const copyFiles = (vars, sourcePath, destPath) => {
|
|
|
100
92
|
}
|
|
101
93
|
};
|
|
102
94
|
|
|
103
|
-
const generateFilesContent = (packageName, componentName,
|
|
95
|
+
const generateFilesContent = (packageName, componentName, skipSubfolder) => {
|
|
104
96
|
const tagName = argv.tag || hyphaneteComponentName(componentName);
|
|
105
97
|
|
|
106
98
|
// All variables that will be replaced in the content of the resources/
|
|
107
99
|
const vars = {
|
|
108
|
-
INIT_PACKAGE_VAR_NAMESPACE: namespace, // namespace must be replaced before name
|
|
109
100
|
INIT_PACKAGE_VAR_NAME: packageName,
|
|
110
101
|
INIT_PACKAGE_VAR_TAG: tagName,
|
|
111
102
|
INIT_PACKAGE_VAR_CLASS_NAME: componentName,
|
|
112
|
-
INIT_PACKAGE_VAR_TYPESCRIPT: typescript,
|
|
113
103
|
};
|
|
114
104
|
|
|
115
105
|
const packageContent = {
|
|
@@ -118,6 +108,7 @@ const generateFilesContent = (packageName, componentName, namespace, typescript,
|
|
|
118
108
|
ui5: {
|
|
119
109
|
webComponentsPackage: true,
|
|
120
110
|
},
|
|
111
|
+
type: "module",
|
|
121
112
|
scripts: {
|
|
122
113
|
"clean": "wc-dev clean",
|
|
123
114
|
"lint": "wc-dev lint",
|
|
@@ -142,13 +133,10 @@ const generateFilesContent = (packageName, componentName, namespace, typescript,
|
|
|
142
133
|
"devDependencies": {
|
|
143
134
|
"@ui5/webcomponents-tools": version,
|
|
144
135
|
"chromedriver": "*",
|
|
136
|
+
"typescript": "^5.6.2"
|
|
145
137
|
},
|
|
146
138
|
};
|
|
147
139
|
|
|
148
|
-
if (typescript) {
|
|
149
|
-
packageContent.devDependencies.typescript = "^4.9.4";
|
|
150
|
-
}
|
|
151
|
-
|
|
152
140
|
// Update package.json
|
|
153
141
|
let destDir = packageName.includes("@") ? packageName.slice(packageName.lastIndexOf("/") + 1) : packageName;
|
|
154
142
|
|
|
@@ -188,22 +176,16 @@ const createWebcomponentsPackage = async () => {
|
|
|
188
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.");
|
|
189
177
|
}
|
|
190
178
|
|
|
191
|
-
if (argv.namespace && !isNamespaceValid(argv.namespace)) {
|
|
192
|
-
throw new Error("The JSDoc namespace must start with a letter and can only contain small-case letters, numbers, dots and dashes.");
|
|
193
|
-
}
|
|
194
|
-
|
|
195
179
|
if (argv.tag && !isTagValid(argv.tag) ) {
|
|
196
180
|
throw new Error("The tag should be in kebab-case (f.e my-component) and it can't be a single word.");
|
|
197
181
|
}
|
|
198
182
|
|
|
199
183
|
let packageName = argv.name || "my-package";
|
|
200
184
|
let componentName = argv.componentName || "MyComponent";
|
|
201
|
-
let namespace = argv.namespace || "demo.components";
|
|
202
|
-
let typescriptSupport = !!argv.enableTypescript;
|
|
203
185
|
const skipSubfolder = !!argv.skipSubfolder;
|
|
204
186
|
|
|
205
187
|
if (argv.skip) {
|
|
206
|
-
return generateFilesContent(packageName, componentName,
|
|
188
|
+
return generateFilesContent(packageName, componentName, skipSubfolder);
|
|
207
189
|
}
|
|
208
190
|
|
|
209
191
|
if (!argv.name) {
|
|
@@ -216,25 +198,6 @@ const createWebcomponentsPackage = async () => {
|
|
|
216
198
|
packageName = response.name;
|
|
217
199
|
}
|
|
218
200
|
|
|
219
|
-
if (!typescriptSupport) {
|
|
220
|
-
response = await prompts({
|
|
221
|
-
type: "select",
|
|
222
|
-
name: "language",
|
|
223
|
-
message: "Project type:",
|
|
224
|
-
choices: [
|
|
225
|
-
{
|
|
226
|
-
title: "JavaScript",
|
|
227
|
-
value: false,
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
title: "TypeScript",
|
|
231
|
-
value: true,
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
});
|
|
235
|
-
typescriptSupport = response.language;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
201
|
if (!argv.componentName) {
|
|
239
202
|
response = await prompts({
|
|
240
203
|
type: "text",
|
|
@@ -246,18 +209,7 @@ const createWebcomponentsPackage = async () => {
|
|
|
246
209
|
componentName = response.componentName;
|
|
247
210
|
}
|
|
248
211
|
|
|
249
|
-
|
|
250
|
-
response = await prompts({
|
|
251
|
-
type: "text",
|
|
252
|
-
name: "namespace",
|
|
253
|
-
message: "JSDoc namespace:",
|
|
254
|
-
initial: "demo.components",
|
|
255
|
-
validate: (value) => isNamespaceValid(value) ? true : "The JSDoc namespace must start with a letter and can only contain small-case letters, numbers, dots and dashes.",
|
|
256
|
-
});
|
|
257
|
-
namespace = response.namespace;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return generateFilesContent(packageName, componentName, namespace, typescriptSupport, skipSubfolder);
|
|
212
|
+
return generateFilesContent(packageName, componentName, skipSubfolder);
|
|
261
213
|
};
|
|
262
214
|
|
|
263
215
|
createWebcomponentsPackage();
|
package/package.json
CHANGED
package/template/.eslintignore
CHANGED
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/gitignore
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
3
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
|
-
import
|
|
4
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
5
5
|
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
6
6
|
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
7
7
|
|
|
8
8
|
// Template
|
|
9
|
-
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./
|
|
9
|
+
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./INIT_PACKAGE_VAR_CLASS_NAMETemplate.js";
|
|
10
10
|
|
|
11
11
|
// Styles
|
|
12
12
|
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @class
|
|
@@ -21,14 +21,12 @@ import { COUNTER } from "./generated/i18n/i18n-defaults.js";
|
|
|
21
21
|
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
|
22
22
|
*
|
|
23
23
|
* @constructor
|
|
24
|
-
* @
|
|
25
|
-
* @extends sap.ui.webc.base.UI5Element
|
|
26
|
-
* @tagname INIT_PACKAGE_VAR_TAG
|
|
24
|
+
* @extends UI5Element
|
|
27
25
|
* @public
|
|
28
26
|
*/
|
|
29
27
|
@customElement({
|
|
30
28
|
tag: "INIT_PACKAGE_VAR_TAG",
|
|
31
|
-
renderer:
|
|
29
|
+
renderer: jsxRenderer,
|
|
32
30
|
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
|
33
31
|
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
|
34
32
|
})
|
|
@@ -40,20 +38,19 @@ class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
/**
|
|
43
|
-
* Defines the component
|
|
44
|
-
* @
|
|
41
|
+
* Defines the component count.
|
|
42
|
+
* @default 0
|
|
45
43
|
* @public
|
|
46
|
-
* @type { number }
|
|
47
44
|
*/
|
|
48
|
-
@property({
|
|
49
|
-
|
|
45
|
+
@property({ type: Number })
|
|
46
|
+
count = 0;
|
|
50
47
|
|
|
51
48
|
onClick() {
|
|
52
|
-
this.
|
|
49
|
+
this.count++;
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
get counterText() {
|
|
56
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(
|
|
53
|
+
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNT);
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
56
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type INIT_PACKAGE_VAR_CLASS_NAME from "./INIT_PACKAGE_VAR_CLASS_NAME.js";
|
|
2
|
+
|
|
3
|
+
export default function INIT_PACKAGE_VAR_CLASS_NAMETemplate(this: INIT_PACKAGE_VAR_CLASS_NAME) {
|
|
4
|
+
return (
|
|
5
|
+
<div class="root" onClick={this.onClick}>
|
|
6
|
+
{this.counterText} :: {this.count}
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -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
|
}
|
|
@@ -15,13 +15,18 @@ h2 {
|
|
|
15
15
|
margin-bottom: 0.5rem;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.app, .app-
|
|
18
|
+
.app, .app-settings, .app-docs, .app-first-component {
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: center;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
.app-logo {
|
|
26
|
+
height: 230px;
|
|
27
|
+
width: 230px;
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
.app-first-component {
|
|
26
31
|
margin-bottom: 3rem;
|
|
27
32
|
}
|
|
@@ -33,4 +38,4 @@ h2 {
|
|
|
33
38
|
a {
|
|
34
39
|
margin: 0.25rem;
|
|
35
40
|
color: var(--sapLinkColor);
|
|
36
|
-
}
|
|
41
|
+
}
|
|
Binary file
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
"language": "EN"
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
<link rel="stylesheet" type="text/css" href="./css/index.css">
|
|
19
19
|
<script src="../../bundle.esm.js" type="module"></script>
|
|
20
20
|
</head>
|
|
21
21
|
|
|
22
22
|
<body>
|
|
23
23
|
<div class="app">
|
|
24
|
-
<a href="https://sap.github.io/ui5-webcomponents/
|
|
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
25
|
|
|
26
26
|
<div class="app-first-component">
|
|
27
27
|
<h1>Hooray! It's Your First Web Component!</h1>
|
|
28
28
|
<div> <pre><INIT_PACKAGE_VAR_TAG></INIT_PACKAGE_VAR_TAG> </pre></div>
|
|
29
29
|
<INIT_PACKAGE_VAR_TAG id="myFirstComponent"></INIT_PACKAGE_VAR_TAG>
|
|
30
30
|
</div>
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
<div class="app-settings">
|
|
33
33
|
|
|
34
34
|
<h2>Switch themes</h2>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<a class="link" href="?sap-ui-theme=sap_horizon_hcb">Horizon High Contrast Black</a>
|
|
39
39
|
<a class="link" href="?sap-ui-theme=sap_horizon_hcw">Horizon High Contrast White</a>
|
|
40
40
|
</div>
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
<h2>Switch language</h2>
|
|
43
43
|
<div>
|
|
44
44
|
<a class="link" href="?sap-ui-language=en">English</a>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
<div class="app-docs">
|
|
52
52
|
<h2>Documentation</h2>
|
|
53
|
-
<a class="link" href="https://sap.github.io/ui5-webcomponents/
|
|
53
|
+
<a class="link" href="https://sap.github.io/ui5-webcomponents/docs/development/custom-UI5-Web-Components-Packages/">Custom Component Development</a>
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
</body>
|
package/template/tsconfig.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
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
|
+
"outDir": "dist",
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"module": "NodeNext",
|
|
11
|
+
"moduleResolution": "NodeNext",
|
|
12
|
+
},
|
|
13
|
+
}
|
|
@@ -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
|
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;
|
|
File without changes
|
|
File without changes
|