@ui5/webcomponents-tools 0.0.0-fca1107e7 → 0.0.0-fd426fe8a
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 +1078 -1
- package/README.md +2 -5
- package/assets-meta.js +1 -8
- package/components-package/eslint.js +59 -31
- package/components-package/nps.js +50 -30
- package/components-package/vite.config.js +7 -11
- package/components-package/wdio.js +415 -405
- package/icons-collection/nps.js +2 -2
- package/lib/cem/custom-elements-manifest.config.mjs +74 -45
- package/lib/cem/event.mjs +69 -32
- package/lib/cem/schema-internal.json +65 -0
- package/lib/cem/types-internal.d.ts +14 -2
- package/lib/cem/utils.mjs +69 -30
- package/lib/cem/validate.js +37 -40
- package/lib/create-icons/index.js +13 -10
- package/lib/create-illustrations/index.js +19 -1
- package/lib/create-new-component/{tsFileContentTemplate.js → Component.js} +12 -9
- package/lib/create-new-component/ComponentTemplate.js +12 -0
- package/lib/create-new-component/index.js +14 -22
- package/lib/css-processors/css-processor-components.mjs +3 -2
- package/lib/css-processors/css-processor-themes.mjs +2 -7
- package/lib/css-processors/shared.mjs +4 -24
- package/lib/dev-server/{dev-server.js → dev-server.mjs} +4 -4
- package/lib/dev-server/virtual-index-html-plugin.js +24 -20
- package/lib/generate-json-imports/i18n.js +46 -62
- package/lib/generate-json-imports/themes.js +17 -36
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +12 -7
- package/lib/hbs2ui5/index.js +3 -3
- package/lib/i18n/defaults.js +3 -2
- package/lib/remove-dev-mode/remove-dev-mode.mjs +37 -0
- package/lib/scoping/get-all-tags.js +9 -2
- package/lib/scoping/lint-src.js +8 -7
- package/package.json +9 -8
- package/tsconfig.json +18 -0
- package/components-package/wdio.sync.js +0 -368
- package/lib/create-new-component/jsFileContentTemplate.js +0 -73
- package/lib/css-processors/css-processor-component-styles.mjs +0 -47
- package/lib/generate-custom-elements-manifest/index.js +0 -271
- package/lib/jsdoc/config.json +0 -29
- package/lib/jsdoc/configTypescript.json +0 -29
- package/lib/jsdoc/plugin.js +0 -2468
- package/lib/jsdoc/preprocess.js +0 -146
- package/lib/jsdoc/template/publish.js +0 -4120
package/icons-collection/nps.js
CHANGED
|
@@ -41,8 +41,8 @@ const copyIconAssetsCommand = (options) => {
|
|
|
41
41
|
const getScripts = (options) => {
|
|
42
42
|
const createJSImportsCmd = createIconImportsCommand(options);
|
|
43
43
|
const copyAssetsCmd = copyIconAssetsCommand(options);
|
|
44
|
-
const tsCommand = options.
|
|
45
|
-
const tsCrossEnv = options.
|
|
44
|
+
const tsCommand = !options.legacy ? "tsc --build" : "";
|
|
45
|
+
const tsCrossEnv = !options.legacy ? "cross-env UI5_TS=true" : "";
|
|
46
46
|
|
|
47
47
|
const scripts = {
|
|
48
48
|
clean: "rimraf dist && rimraf src/generated",
|
|
@@ -4,6 +4,7 @@ import path from "path";
|
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import {
|
|
6
6
|
getDeprecatedStatus,
|
|
7
|
+
getExperimentalStatus,
|
|
7
8
|
getSinceStatus,
|
|
8
9
|
getPrivacyStatus,
|
|
9
10
|
getReference,
|
|
@@ -26,6 +27,7 @@ import { generateCustomData } from "cem-plugin-vs-code-custom-data-generator";
|
|
|
26
27
|
import { customElementJetBrainsPlugin } from "custom-element-jet-brains-integration";
|
|
27
28
|
|
|
28
29
|
const packageJSON = JSON.parse(fs.readFileSync("./package.json"));
|
|
30
|
+
const devMode = process.env.UI5_CEM_MODE === "dev";
|
|
29
31
|
|
|
30
32
|
const extractClassNodeJSDoc = node => {
|
|
31
33
|
const fileContent = node.getFullText();
|
|
@@ -64,12 +66,23 @@ function processClass(ts, classNode, moduleDoc) {
|
|
|
64
66
|
currClass.customElement = !!customElementDecorator || className === "UI5Element" || undefined;
|
|
65
67
|
currClass.kind = "class";
|
|
66
68
|
currClass.deprecated = getDeprecatedStatus(classParsedJsDoc);
|
|
69
|
+
currClass._ui5experimental = getExperimentalStatus(classParsedJsDoc);
|
|
67
70
|
currClass._ui5since = getSinceStatus(classParsedJsDoc);
|
|
68
71
|
currClass._ui5privacy = getPrivacyStatus(classParsedJsDoc);
|
|
69
72
|
currClass._ui5abstract = hasTag(classParsedJsDoc, "abstract") ? true : undefined;
|
|
70
73
|
currClass.description = normalizeDescription(classParsedJsDoc.description || findTag(classParsedJsDoc, "class")?.description);
|
|
71
74
|
currClass._ui5implements = findAllTags(classParsedJsDoc, "implements")
|
|
72
|
-
.map(tag =>
|
|
75
|
+
.map(tag => {
|
|
76
|
+
const correctInterfaceDescription = classNode?.heritageClauses?.some(heritageClause => {
|
|
77
|
+
return heritageClause?.types?.some(type => type.expression?.text === normalizeTagType(tag.type));
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
if (!correctInterfaceDescription) {
|
|
81
|
+
logDocumentationError(moduleDoc.path, `@interface {${tag.type}} tag is used, but the class doesn't implement the corresponding interface`)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return getReference(ts, normalizeTagType(tag.type), classNode, moduleDoc.path)
|
|
85
|
+
})
|
|
73
86
|
.filter(Boolean);
|
|
74
87
|
|
|
75
88
|
|
|
@@ -77,6 +90,10 @@ function processClass(ts, classNode, moduleDoc) {
|
|
|
77
90
|
const superclassTag = findTag(classParsedJsDoc, "extends");
|
|
78
91
|
currClass.superclass = getReference(ts, superclassTag.name, classNode, moduleDoc.path);
|
|
79
92
|
|
|
93
|
+
if (classNode?.heritageClauses?.[0]?.types?.[0]?.expression?.text !== superclassTag.name) {
|
|
94
|
+
logDocumentationError(moduleDoc.path, `@extends ${superclassTag.name} is used, but the class doesn't extend the corresponding superclass`)
|
|
95
|
+
}
|
|
96
|
+
|
|
80
97
|
if (currClass.superclass?.name === "UI5Element") {
|
|
81
98
|
currClass.customElement = true;
|
|
82
99
|
}
|
|
@@ -111,9 +128,13 @@ function processClass(ts, classNode, moduleDoc) {
|
|
|
111
128
|
}
|
|
112
129
|
|
|
113
130
|
// Events
|
|
114
|
-
currClass.events = findAllDecorators(classNode, "event")
|
|
131
|
+
currClass.events = findAllDecorators(classNode, ["event", "eventStrict"])
|
|
115
132
|
?.map(event => processEvent(ts, event, classNode, moduleDoc));
|
|
116
133
|
|
|
134
|
+
const filename = classNode.getSourceFile().fileName;
|
|
135
|
+
const sourceFile = typeProgram.getSourceFile(filename);
|
|
136
|
+
const tsProgramClassNode = sourceFile.statements.find(statement => ts.isClassDeclaration(statement) && statement.name?.text === classNode.name?.text);
|
|
137
|
+
|
|
117
138
|
// Slots (with accessor), methods and fields
|
|
118
139
|
for (let i = 0; i < (currClass.members?.length || 0); i++) {
|
|
119
140
|
const member = currClass.members[i];
|
|
@@ -168,17 +189,21 @@ function processClass(ts, classNode, moduleDoc) {
|
|
|
168
189
|
const propertyDecorator = findDecorator(classNodeMember, "property");
|
|
169
190
|
|
|
170
191
|
if (propertyDecorator) {
|
|
171
|
-
member._ui5validator = propertyDecorator?.expression?.arguments[0]?.properties?.find(property => ["validator", "type"].includes(property.name.text))?.initializer?.text || "String";
|
|
172
192
|
member._ui5noAttribute = propertyDecorator?.expression?.arguments[0]?.properties?.find(property => property.name.text === "noAttribute")?.initializer?.kind === ts.SyntaxKind.TrueKeyword || undefined;
|
|
173
193
|
}
|
|
174
194
|
|
|
175
|
-
if (currClass.customElement && member.privacy === "public"
|
|
176
|
-
const filename = classNode.getSourceFile().fileName;
|
|
177
|
-
const sourceFile = typeProgram.getSourceFile(filename);
|
|
178
|
-
const tsProgramClassNode = sourceFile.statements.find(statement => ts.isClassDeclaration(statement) && statement.name?.text === classNode.name?.text);
|
|
195
|
+
if (currClass.customElement && member.privacy === "public") {
|
|
179
196
|
const tsProgramMember = tsProgramClassNode.members.find(m => ts.isPropertyDeclaration(m) && m.name?.text === member.name);
|
|
180
197
|
const attributeValue = typeChecker.typeToString(typeChecker.getTypeAtLocation(tsProgramMember), tsProgramMember);
|
|
181
198
|
|
|
199
|
+
if (attributeValue === "boolean" && member.default === "true") {
|
|
200
|
+
logDocumentationError(moduleDoc.path, `Boolean properties must be initialzed to false. [${member.name}] property of class [${className}] is intialized to \`true\``)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (!member.type) {
|
|
204
|
+
logDocumentationError(moduleDoc.path, `Public properties must have type. The type of [${member.name}] property is not determinated automatically. Please check it.`)
|
|
205
|
+
}
|
|
206
|
+
|
|
182
207
|
currClass.attributes.push({
|
|
183
208
|
description: member.description,
|
|
184
209
|
name: toKebabCase(member.name),
|
|
@@ -293,6 +318,7 @@ function processInterface(ts, interfaceNode, moduleDoc) {
|
|
|
293
318
|
kind: "interface",
|
|
294
319
|
name: interfaceName,
|
|
295
320
|
description: normalizeDescription(interfaceParsedJsDoc?.description),
|
|
321
|
+
_ui5experimental: getExperimentalStatus(interfaceParsedJsDoc),
|
|
296
322
|
_ui5privacy: getPrivacyStatus(interfaceParsedJsDoc),
|
|
297
323
|
_ui5since: getSinceStatus(interfaceParsedJsDoc),
|
|
298
324
|
deprecated: getDeprecatedStatus(interfaceParsedJsDoc),
|
|
@@ -313,6 +339,7 @@ function processEnum(ts, enumNode, moduleDoc) {
|
|
|
313
339
|
kind: "enum",
|
|
314
340
|
name: enumName,
|
|
315
341
|
description: normalizeDescription(enumJSdoc?.comment),
|
|
342
|
+
_ui5experimental: getExperimentalStatus(enumParsedJsDoc),
|
|
316
343
|
_ui5privacy: getPrivacyStatus(enumParsedJsDoc),
|
|
317
344
|
_ui5since: getSinceStatus(enumParsedJsDoc),
|
|
318
345
|
deprecated: getDeprecatedStatus(enumParsedJsDoc) || undefined,
|
|
@@ -425,14 +452,6 @@ export default {
|
|
|
425
452
|
}
|
|
426
453
|
},
|
|
427
454
|
moduleLinkPhase({ moduleDoc }) {
|
|
428
|
-
for (let i = 0; i < moduleDoc.declarations.length; i++) {
|
|
429
|
-
const shouldRemove = processPublicAPI(moduleDoc.declarations[i]) || ["function", "variable"].includes(moduleDoc.declarations[i].kind)
|
|
430
|
-
if (shouldRemove) {
|
|
431
|
-
moduleDoc.declarations.splice(i, 1);
|
|
432
|
-
i--;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
455
|
moduleDoc.path = moduleDoc.path?.replace(/^src/, "dist").replace(/\.ts$/, ".js");
|
|
437
456
|
|
|
438
457
|
moduleDoc.exports = moduleDoc.exports.
|
|
@@ -456,41 +475,51 @@ export default {
|
|
|
456
475
|
})
|
|
457
476
|
}
|
|
458
477
|
})
|
|
478
|
+
},
|
|
479
|
+
packageLinkPhase({ customElementsManifest }) {
|
|
480
|
+
customElementsManifest.modules.forEach(moduleDoc => {
|
|
481
|
+
for (let i = 0; i < moduleDoc.declarations.length; i++) {
|
|
482
|
+
const shouldRemove = processPublicAPI(moduleDoc.declarations[i]) || ["function", "variable"].includes(moduleDoc.declarations[i].kind)
|
|
483
|
+
if (shouldRemove) {
|
|
484
|
+
moduleDoc.declarations.splice(i, 1);
|
|
485
|
+
i--;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
459
488
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
489
|
+
const typeReferences = new Set();
|
|
490
|
+
const registerTypeReference = reference => typeReferences.add(JSON.stringify(reference))
|
|
491
|
+
|
|
492
|
+
moduleDoc.declarations.forEach(declaration => {
|
|
493
|
+
["events", "slots", "members"].forEach(memberType => {
|
|
494
|
+
declaration[memberType]?.forEach(member => {
|
|
495
|
+
if (member.type?.references) {
|
|
496
|
+
member.type.references.forEach(registerTypeReference)
|
|
497
|
+
} else if (member._ui5type?.references) {
|
|
498
|
+
member._ui5type.references.forEach(registerTypeReference)
|
|
499
|
+
} else if (member.kind === "method") {
|
|
500
|
+
member.return?.type?.references?.forEach(registerTypeReference)
|
|
501
|
+
|
|
502
|
+
member.parameters?.forEach(parameter => {
|
|
503
|
+
parameter.type?.references?.forEach(registerTypeReference)
|
|
504
|
+
})
|
|
505
|
+
}
|
|
506
|
+
})
|
|
477
507
|
})
|
|
478
|
-
})
|
|
479
|
-
});
|
|
508
|
+
});
|
|
480
509
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
510
|
+
typeReferences.forEach(reference => {
|
|
511
|
+
reference = JSON.parse(reference);
|
|
512
|
+
if (reference.package === packageJSON?.name && reference.module === moduleDoc.path) {
|
|
513
|
+
const hasExport = moduleDoc.exports.some(e => e.declaration?.name === reference.name && e.declaration?.module === reference.module)
|
|
485
514
|
|
|
486
|
-
|
|
487
|
-
|
|
515
|
+
if (!hasExport) {
|
|
516
|
+
logDocumentationError(moduleDoc.path?.replace(/^dist/, "src").replace(/\.js$/, ".ts"), `Type '${reference.name}' is used to describe a public API but is not exported.`,)
|
|
517
|
+
}
|
|
488
518
|
}
|
|
489
|
-
}
|
|
490
|
-
})
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
if (context.dev) {
|
|
519
|
+
})
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
if (devMode) {
|
|
494
523
|
displayDocumentationErrors();
|
|
495
524
|
}
|
|
496
525
|
}
|
package/lib/cem/event.mjs
CHANGED
|
@@ -16,19 +16,10 @@ import {
|
|
|
16
16
|
} from "./utils.mjs";
|
|
17
17
|
|
|
18
18
|
const jsDocRegExp = /\/\*\*(.|\n)+?\s+\*\//;
|
|
19
|
+
const ASTFalseKeywordCode = 94;
|
|
19
20
|
|
|
20
21
|
const getParams = (ts, eventDetails, commentParams, classNode, moduleDoc) => {
|
|
21
22
|
return commentParams?.map(commentParam => {
|
|
22
|
-
const decoratorParam = eventDetails?.find(prop => prop?.name?.text === commentParam?.name);
|
|
23
|
-
|
|
24
|
-
if (!decoratorParam || !decoratorParam?.jsDoc?.[0]) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const decoratorParamParsedComment = parse(decoratorParam?.jsDoc?.[0]?.getText?.(), { spacing: 'preserve' })[0];
|
|
29
|
-
|
|
30
|
-
validateJSDocComment("eventParam", decoratorParamParsedComment, decoratorParam.name?.text, moduleDoc);
|
|
31
|
-
|
|
32
23
|
const { typeName, name } = getType(normalizeTagType(commentParam?.type));
|
|
33
24
|
let type;
|
|
34
25
|
|
|
@@ -47,12 +38,10 @@ const getParams = (ts, eventDetails, commentParams, classNode, moduleDoc) => {
|
|
|
47
38
|
return {
|
|
48
39
|
type,
|
|
49
40
|
name: commentParam?.name,
|
|
50
|
-
_ui5privacy:
|
|
41
|
+
_ui5privacy: "public",
|
|
51
42
|
description: normalizeDescription(commentParam?.description),
|
|
52
|
-
_ui5since: getSinceStatus(decoratorParamParsedComment),
|
|
53
|
-
deprecated: getDeprecatedStatus(decoratorParamParsedComment),
|
|
54
43
|
};
|
|
55
|
-
})
|
|
44
|
+
});
|
|
56
45
|
};
|
|
57
46
|
|
|
58
47
|
function processEvent(ts, event, classNode, moduleDoc) {
|
|
@@ -77,30 +66,32 @@ function processEvent(ts, event, classNode, moduleDoc) {
|
|
|
77
66
|
const privacy = findTag(eventParsedComment, ["public", "private", "protected"])?.tag || "private";
|
|
78
67
|
const sinceTag = findTag(eventParsedComment, "since");
|
|
79
68
|
const commentParams = findAllTags(eventParsedComment, "param");
|
|
80
|
-
const allowPreventDefault = hasTag(eventParsedComment, "allowPreventDefault") || undefined;
|
|
81
69
|
const description = normalizeDescription(eventParsedComment?.description);
|
|
82
70
|
const native = hasTag(eventParsedComment, "native");
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
const eventArgs = event?.expression?.arguments;
|
|
72
|
+
let eventBubbles;
|
|
73
|
+
let eventCancelable;
|
|
74
|
+
let eventDetails;
|
|
75
|
+
|
|
76
|
+
eventArgs && eventArgs.forEach(arg => {
|
|
77
|
+
arg.properties?.forEach(prop => {
|
|
78
|
+
if (prop.name?.text === "bubbles") {
|
|
79
|
+
eventBubbles = prop.initializer.kind === ASTFalseKeywordCode ? false : true;
|
|
80
|
+
} else if (prop.name?.text === "cancelable") {
|
|
81
|
+
eventCancelable = prop.initializer.kind === ASTFalseKeywordCode ? false : true;
|
|
82
|
+
} else if (prop.name?.text === "detail") {
|
|
83
|
+
eventDetails = prop.initializer?.properties;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
88
87
|
|
|
89
88
|
result.description = description;
|
|
90
|
-
result.
|
|
89
|
+
result._ui5Cancelable = eventCancelable !== undefined ? eventCancelable : false;
|
|
90
|
+
result._ui5allowPreventDefault = result._ui5Cancelable;
|
|
91
|
+
result._ui5Bubbles = eventBubbles !== undefined ? eventBubbles : false;
|
|
91
92
|
|
|
92
93
|
if (native) {
|
|
93
94
|
result.type = { text: "Event" };
|
|
94
|
-
} else if (event?.expression?.typeArguments) {
|
|
95
|
-
const typesText = event?.expression?.typeArguments.map(type => type.typeName?.text).filter(Boolean).join(" | ");
|
|
96
|
-
const typeRefs = (getTypeRefs(ts, event.expression)
|
|
97
|
-
?.map(e => getReference(ts, e, event, moduleDoc.path)).filter(Boolean)) || [];
|
|
98
|
-
|
|
99
|
-
result.type = { text: `CustomEvent<${typesText}>` };
|
|
100
|
-
|
|
101
|
-
if (typeRefs.length) {
|
|
102
|
-
result.type.references = typeRefs;
|
|
103
|
-
}
|
|
104
95
|
}
|
|
105
96
|
|
|
106
97
|
if (privacy) {
|
|
@@ -121,7 +112,53 @@ function processEvent(ts, event, classNode, moduleDoc) {
|
|
|
121
112
|
: sinceTag.name;
|
|
122
113
|
}
|
|
123
114
|
|
|
124
|
-
|
|
115
|
+
const eventDetailType = classNode.members?.find(member => {
|
|
116
|
+
return ts.isPropertyDeclaration(member) && member.name.text === "eventDetails"
|
|
117
|
+
})?.type;
|
|
118
|
+
const eventDetailRef = eventDetailType?.members?.find(member => member.name.text === name) || eventDetailType?.types?.[eventDetailType?.types?.length - 1]?.members?.find(member => member.name.text === name);
|
|
119
|
+
const hasGeneric = !!event?.expression?.typeArguments
|
|
120
|
+
|
|
121
|
+
if (commentParams.length) {
|
|
122
|
+
if (eventDetailRef && hasGeneric) {
|
|
123
|
+
logDocumentationError(moduleDoc.path, `Event details for event '${name}' has to be defined either with generic or with eventDetails.`)
|
|
124
|
+
} else if (eventDetails) {
|
|
125
|
+
if (hasGeneric) {
|
|
126
|
+
const typesText = event?.expression?.typeArguments.map(type => type.typeName?.text).filter(Boolean).join(" | ");
|
|
127
|
+
const typeRefs = (getTypeRefs(ts, event.expression)
|
|
128
|
+
?.map(e => getReference(ts, e, event, moduleDoc.path)).filter(Boolean)) || [];
|
|
129
|
+
|
|
130
|
+
result.type = { text: `CustomEvent<${typesText}>` };
|
|
131
|
+
|
|
132
|
+
if (typeRefs.length) {
|
|
133
|
+
result.type.references = typeRefs;
|
|
134
|
+
}
|
|
135
|
+
} else if (eventDetailRef) {
|
|
136
|
+
const typesText = eventDetailRef?.type?.typeName?.text;
|
|
137
|
+
const typeRefs = (getTypeRefs(ts, eventDetailRef)
|
|
138
|
+
?.map(e => getReference(ts, e, event, moduleDoc.path)).filter(Boolean)) || [];
|
|
139
|
+
|
|
140
|
+
result.type = { text: `CustomEvent<${typesText}>` };
|
|
141
|
+
|
|
142
|
+
if (typeRefs.length) {
|
|
143
|
+
result.type.references = typeRefs;
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
logDocumentationError(moduleDoc.path, `Event details for event '${name}' must be described using generics. Add type via generics to the decorator: @event<TypeForDetails>("${name}", {details}).`)
|
|
147
|
+
}
|
|
148
|
+
} else if (eventDetailRef) {
|
|
149
|
+
const typesText = eventDetailRef?.type?.typeName?.text;
|
|
150
|
+
const typeRefs = (getTypeRefs(ts, eventDetailRef)
|
|
151
|
+
?.map(e => getReference(ts, e, event, moduleDoc.path)).filter(Boolean)) || [];
|
|
152
|
+
|
|
153
|
+
result.type = { text: `CustomEvent<${typesText}>` };
|
|
154
|
+
|
|
155
|
+
if (typeRefs.length) {
|
|
156
|
+
result.type.references = typeRefs;
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
logDocumentationError(moduleDoc.path, `Event details for event '${name}' must be described.`)
|
|
160
|
+
}
|
|
161
|
+
|
|
125
162
|
result._ui5parameters = getParams(ts, eventDetails, commentParams, classNode, moduleDoc);
|
|
126
163
|
}
|
|
127
164
|
|
|
@@ -46,6 +46,12 @@
|
|
|
46
46
|
"ClassDeclaration": {
|
|
47
47
|
"additionalProperties": false,
|
|
48
48
|
"properties": {
|
|
49
|
+
"_ui5experimental": {
|
|
50
|
+
"type": [
|
|
51
|
+
"string",
|
|
52
|
+
"boolean"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
49
55
|
"_ui5package": {
|
|
50
56
|
"type": "string"
|
|
51
57
|
},
|
|
@@ -123,6 +129,12 @@
|
|
|
123
129
|
"EnumDeclaration": {
|
|
124
130
|
"additionalProperties": false,
|
|
125
131
|
"properties": {
|
|
132
|
+
"_ui5experimental": {
|
|
133
|
+
"type": [
|
|
134
|
+
"string",
|
|
135
|
+
"boolean"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
126
138
|
"_ui5package": {
|
|
127
139
|
"type": "string"
|
|
128
140
|
},
|
|
@@ -187,6 +199,12 @@
|
|
|
187
199
|
"InterfaceDeclaration": {
|
|
188
200
|
"additionalProperties": false,
|
|
189
201
|
"properties": {
|
|
202
|
+
"_ui5experimental": {
|
|
203
|
+
"type": [
|
|
204
|
+
"string",
|
|
205
|
+
"boolean"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
190
208
|
"_ui5package": {
|
|
191
209
|
"type": "string"
|
|
192
210
|
},
|
|
@@ -389,6 +407,9 @@
|
|
|
389
407
|
"CssCustomProperty": {
|
|
390
408
|
"additionalProperties": false,
|
|
391
409
|
"properties": {
|
|
410
|
+
"inheritedFrom": {
|
|
411
|
+
"$ref": "#/definitions/Reference"
|
|
412
|
+
},
|
|
392
413
|
"default": {
|
|
393
414
|
"type": "string"
|
|
394
415
|
},
|
|
@@ -425,6 +446,9 @@
|
|
|
425
446
|
"additionalProperties": false,
|
|
426
447
|
"description": "The description of a CSS Part",
|
|
427
448
|
"properties": {
|
|
449
|
+
"inheritedFrom": {
|
|
450
|
+
"$ref": "#/definitions/Reference"
|
|
451
|
+
},
|
|
428
452
|
"deprecated": {
|
|
429
453
|
"description": "Whether the CSS shadow part is deprecated.\nIf the value is a string, it's the reason for the deprecation.",
|
|
430
454
|
"type": [
|
|
@@ -453,6 +477,12 @@
|
|
|
453
477
|
"additionalProperties": false,
|
|
454
478
|
"description": "A description of a custom element class.\n\nCustom elements are JavaScript classes, so this extends from\n`ClassDeclaration` and adds custom-element-specific features like\nattributes, events, and slots.\n\nNote that `tagName` in this interface is optional. Tag names are not\nneccessarily part of a custom element class, but belong to the definition\n(often called the \"registration\") or the `customElements.define()` call.\n\nBecause classes and tag names can only be registered once, there's a\none-to-one relationship between classes and tag names. For ease of use,\nwe allow the tag name here.\n\nSome packages define and register custom elements in separate modules. In\nthese cases one `Module` should contain the `CustomElement` without a\ntagName, and another `Module` should contain the\n`CustomElementExport`.",
|
|
455
479
|
"properties": {
|
|
480
|
+
"_ui5experimental": {
|
|
481
|
+
"type": [
|
|
482
|
+
"string",
|
|
483
|
+
"boolean"
|
|
484
|
+
]
|
|
485
|
+
},
|
|
456
486
|
"_ui5package": {
|
|
457
487
|
"type": "string"
|
|
458
488
|
},
|
|
@@ -618,6 +648,12 @@
|
|
|
618
648
|
"additionalProperties": false,
|
|
619
649
|
"description": "A class mixin that also adds custom element related properties.",
|
|
620
650
|
"properties": {
|
|
651
|
+
"_ui5experimental": {
|
|
652
|
+
"type": [
|
|
653
|
+
"string",
|
|
654
|
+
"boolean"
|
|
655
|
+
]
|
|
656
|
+
},
|
|
621
657
|
"_ui5package": {
|
|
622
658
|
"type": "string"
|
|
623
659
|
},
|
|
@@ -788,6 +824,14 @@
|
|
|
788
824
|
"description": "Whether the parameter is optional. Undefined implies non-optional.",
|
|
789
825
|
"type": "boolean"
|
|
790
826
|
},
|
|
827
|
+
"_ui5Cancelable": {
|
|
828
|
+
"description": "Whether the event is cancelable or not.",
|
|
829
|
+
"type": "boolean"
|
|
830
|
+
},
|
|
831
|
+
"_ui5Bubbles": {
|
|
832
|
+
"description": "Whether the event bubbles or not.",
|
|
833
|
+
"type": "boolean"
|
|
834
|
+
},
|
|
791
835
|
"_ui5since": {
|
|
792
836
|
"description": "Marks when the field was introduced",
|
|
793
837
|
"type": "string"
|
|
@@ -827,6 +871,12 @@
|
|
|
827
871
|
"FunctionDeclaration": {
|
|
828
872
|
"additionalProperties": false,
|
|
829
873
|
"properties": {
|
|
874
|
+
"_ui5experimental": {
|
|
875
|
+
"type": [
|
|
876
|
+
"string",
|
|
877
|
+
"boolean"
|
|
878
|
+
]
|
|
879
|
+
},
|
|
830
880
|
"_ui5package": {
|
|
831
881
|
"type": "string"
|
|
832
882
|
},
|
|
@@ -1007,6 +1057,12 @@
|
|
|
1007
1057
|
"additionalProperties": false,
|
|
1008
1058
|
"description": "A description of a class mixin.\n\nMixins are functions which generate a new subclass of a given superclass.\nThis interfaces describes the class and custom element features that\nare added by the mixin. As such, it extends the CustomElement interface and\nClassLike interface.\n\nSince mixins are functions, it also extends the FunctionLike interface. This\nmeans a mixin is callable, and has parameters and a return type.\n\nThe return type is often hard or impossible to accurately describe in type\nsystems like TypeScript. It requires generics and an `extends` operator\nthat TypeScript lacks. Therefore it's recommended that the return type is\nleft empty. The most common form of a mixin function takes a single\nargument, so consumers of this interface should assume that the return type\nis the single argument subclassed by this declaration.\n\nA mixin should not have a superclass. If a mixins composes other mixins,\nthey should be listed in the `mixins` field.\n\nSee [this article]{@link https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/}\nfor more information on the classmixin pattern in JavaScript.",
|
|
1009
1059
|
"properties": {
|
|
1060
|
+
"_ui5experimental": {
|
|
1061
|
+
"type": [
|
|
1062
|
+
"string",
|
|
1063
|
+
"boolean"
|
|
1064
|
+
]
|
|
1065
|
+
},
|
|
1010
1066
|
"_ui5package": {
|
|
1011
1067
|
"type": "string"
|
|
1012
1068
|
},
|
|
@@ -1172,6 +1228,9 @@
|
|
|
1172
1228
|
"Slot": {
|
|
1173
1229
|
"additionalProperties": false,
|
|
1174
1230
|
"properties": {
|
|
1231
|
+
"inheritedFrom": {
|
|
1232
|
+
"$ref": "#/definitions/Reference"
|
|
1233
|
+
},
|
|
1175
1234
|
"_ui5propertyName": {
|
|
1176
1235
|
"type": "string"
|
|
1177
1236
|
},
|
|
@@ -1275,6 +1334,12 @@
|
|
|
1275
1334
|
"VariableDeclaration": {
|
|
1276
1335
|
"additionalProperties": false,
|
|
1277
1336
|
"properties": {
|
|
1337
|
+
"_ui5experimental": {
|
|
1338
|
+
"type": [
|
|
1339
|
+
"string",
|
|
1340
|
+
"boolean"
|
|
1341
|
+
]
|
|
1342
|
+
},
|
|
1278
1343
|
"_ui5package": {
|
|
1279
1344
|
"type": "string"
|
|
1280
1345
|
},
|
|
@@ -319,9 +319,20 @@ export interface Event {
|
|
|
319
319
|
_ui5parameters?: Parameter[]
|
|
320
320
|
_ui5privacy?: Privacy
|
|
321
321
|
/**
|
|
322
|
-
* Whether the
|
|
322
|
+
* Whether the event is preventable.
|
|
323
|
+
*/
|
|
324
|
+
_ui5allowPreventDefault?: boolean;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Whether the event is cancelable.
|
|
323
328
|
*/
|
|
324
|
-
|
|
329
|
+
_ui5Cancelable?: boolean;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Whether the event is bubbles.
|
|
333
|
+
*/
|
|
334
|
+
_ui5Bubbles?: boolean;
|
|
335
|
+
|
|
325
336
|
/**
|
|
326
337
|
* Marks when the field was introduced
|
|
327
338
|
*/
|
|
@@ -484,6 +495,7 @@ export interface TypeReference extends Reference {
|
|
|
484
495
|
* The common interface of classes and mixins.
|
|
485
496
|
*/
|
|
486
497
|
export interface ClassLike {
|
|
498
|
+
_ui5experimental?: boolean | string
|
|
487
499
|
_ui5implements?: Reference[]
|
|
488
500
|
_ui5privacy?: Privacy
|
|
489
501
|
/**
|