Skip to content

Commit 54a5ca5

Browse files
Merge branch 'main' into v14/feature/umb-property-editor-ui-textarea-readonly-mode
2 parents ce46250 + f8ec6b7 commit 54a5ca5

File tree

1,345 files changed

+4505
-4184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,345 files changed

+4505
-4184
lines changed

.storybook/preview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import { UmbIconRegistry } from '../src/packages/core/icon-registry/icon.registr
2020
import { UmbLitElement } from '../src/packages/core/lit-element';
2121
import { umbLocalizationRegistry } from '../src/packages/core/localization';
2222
import customElementManifests from '../dist-cms/custom-elements.json';
23-
import icons from '../src/packages/core/icon-registry/icons/icons';
23+
import icons from '../src/packages/core/icon-registry/icons';
2424

2525
import '../src/libs/context-api/provide/context-provider.element';
2626
import '../src/packages/core/components';
2727

28-
import { manifests as documentManifests } from '../src/packages/documents';
28+
import { manifests as documentManifests } from '../src/packages/documents/manifests';
2929
import { manifests as localizationManifests } from '../src/packages/core/localization/manifests';
3030
import { UmbNotificationContext } from '../src/packages/core/notification';
3131

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default class MyElement extends UmbElementMixin(LitElement) {
126126
this._notificationContext?.peek('positive', { data: { message: '#h5yr' } });
127127
}
128128

129-
render() {
129+
override render() {
130130
return html`
131131
<uui-box headline="Welcome">
132132
<p>A TypeScript Lit Dashboard</p>

devops/icons/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const collectDictionaryIcons = async () => {
4646
legacy: iconDef.legacy,
4747
fileName: iconFileName,
4848
svg,
49-
output: `${iconsOutputDirectory}/${iconFileName}.js`,
49+
output: `${iconsOutputDirectory}/${iconFileName}.ts`,
5050
};
5151

5252
icons.push(icon);
@@ -77,7 +77,7 @@ const collectDictionaryIcons = async () => {
7777
legacy: iconDef.legacy,
7878
fileName: iconFileName,
7979
svg,
80-
output: `${iconsOutputDirectory}/${iconFileName}.js`,
80+
output: `${iconsOutputDirectory}/${iconFileName}.ts`,
8181
};
8282

8383
icons.push(icon);
@@ -102,7 +102,7 @@ const collectDictionaryIcons = async () => {
102102
legacy: iconDef.legacy,
103103
fileName: iconFileName,
104104
svg,
105-
output: `${iconsOutputDirectory}/${iconFileName}.js`,
105+
output: `${iconsOutputDirectory}/${iconFileName}.ts`,
106106
};
107107

108108
icons.push(icon);
@@ -141,7 +141,7 @@ const collectDiskIcons = async (icons) => {
141141
legacy: true,
142142
fileName: iconFileName,
143143
svg,
144-
output: `${iconsOutputDirectory}/${iconFileName}.js`,
144+
output: `${iconsOutputDirectory}/${iconFileName}.ts`,
145145
};
146146

147147
icons.push(icon);
@@ -168,13 +168,13 @@ const writeIconsToDisk = (icons) => {
168168
};
169169

170170
const generateJS = (icons) => {
171-
const JSPath = `${iconsOutputDirectory}/icons.ts`;
171+
const JSPath = `${moduleDirectory}/icons.ts`;
172172

173173
const iconDescriptors = icons.map((icon) => {
174174
return `{
175175
name: "${icon.name}",
176176
${icon.legacy ? 'legacy: true,' : ''}
177-
path: "./icons/${icon.fileName}.js",
177+
path: () => import("./icons/${icon.fileName}.js"),
178178
}`.replace(/\t/g, ''); // Regex removes white space [NL]
179179
});
180180

devops/tsc-override/index.js

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Notice: This script is not perfect and may not work in all cases. ex. it places the override term wrong for async and setter/getter methods. But its a help any way. [NL]
2+
3+
import ts from 'typescript';
4+
import path from 'node:path';
5+
import fs from 'node:fs/promises';
6+
7+
const tsconfigPath = './tsconfig.json';
8+
9+
const cwd = process.cwd();
10+
11+
async function fixOverride() {
12+
const configFile = path.isAbsolute(tsconfigPath)
13+
? tsconfigPath
14+
: ts.findConfigFile(cwd, ts.sys.fileExists, tsconfigPath);
15+
16+
if (!configFile) {
17+
console.error('No tsconfig file found for path:', tsconfigPath);
18+
process.exit(1);
19+
}
20+
21+
const config = ts.readConfigFile(configFile, ts.sys.readFile);
22+
23+
const { options, fileNames } = ts.parseJsonConfigFileContent(
24+
config.config,
25+
ts.sys,
26+
27+
// Resolve to the folder where the tsconfig file located
28+
path.dirname(tsconfigPath),
29+
);
30+
31+
const program = ts.createProgram({
32+
rootNames: fileNames,
33+
options,
34+
});
35+
36+
if (fileNames.length === 0) {
37+
console.error('No files in the project.', {
38+
fileNames,
39+
options,
40+
});
41+
42+
process.exit(1);
43+
}
44+
let emitResult = program.emit();
45+
46+
const overrideErrors = ts
47+
.getPreEmitDiagnostics(program)
48+
.concat(emitResult.diagnostics)
49+
.filter((diagnostic) =>
50+
[
51+
// This member must have an 'override' modifier because it overrides a member in the base class '{0}'.
52+
4114,
53+
// This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'
54+
4115,
55+
// This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'.
56+
4116,
57+
].includes(diagnostic.code),
58+
);
59+
60+
const sortedErrors = sortErrors(overrideErrors);
61+
62+
for (const diagnostic of sortedErrors) {
63+
await addOverride(diagnostic);
64+
}
65+
}
66+
67+
/**
68+
*
69+
* @param {ts.Diagnostic} diagnostic
70+
* @returns {Promise<void>}
71+
*/
72+
async function addOverride(diagnostic) {
73+
const fileContent = (await fs.readFile(diagnostic.file.fileName, 'utf-8')).toString();
74+
let startIndex = diagnostic.start;
75+
76+
if (fileContent.slice(0, startIndex).endsWith(' get ')) {
77+
startIndex -= 'get '.length;
78+
}
79+
if (fileContent.slice(0, startIndex).endsWith(' async ')) {
80+
startIndex -= 'async '.length;
81+
}
82+
if (fileContent.slice(0, startIndex).endsWith(' readonly ')) {
83+
startIndex -= 'readonly '.length;
84+
}
85+
86+
const newFileContent = [fileContent.slice(0, startIndex), 'override ', fileContent.slice(startIndex)].join('');
87+
await fs.writeFile(diagnostic.file.fileName, newFileContent);
88+
}
89+
90+
/**
91+
*
92+
* @param {ts.Diagnostic[]} errors
93+
* @returns {ts.Diagnostic[]}
94+
*/
95+
function sortErrors(errors) {
96+
// Sort by file path and start position from end to start
97+
// so we can insert override keyword without changing the start position of other errors in the same file that happen before
98+
return errors.slice(0).sort((a, b) => {
99+
if (a.file && b.file) {
100+
if (a.file.fileName === b.file.fileName) {
101+
return b.start - a.start;
102+
}
103+
104+
return a.file.fileName.localeCompare(b.file.fileName);
105+
}
106+
107+
return 0;
108+
});
109+
}
110+
111+
fixOverride();

devops/tsconfig/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const tsConfigBase = {
2828
baseUrl: '.',
2929
incremental: true,
3030
skipLibCheck: true,
31+
noImplicitOverride: true,
3132
/* Bundler mode */
3233
moduleResolution: 'bundler',
3334
allowImportingTsExtensions: true,

examples/dashboard-with-property-dataset/dataset-dashboard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class ExampleDatasetDashboard extends UmbElementMixin(LitElement) {
1818
this.requestUpdate('data', oldValue);
1919
}
2020

21-
render() {
21+
override render() {
2222
return html`
2323
<uui-box class="uui-text">
2424
<h1 class="uui-h2" style="margin-top: var(--uui-size-layout-1);">Dataset Example</h1>
@@ -39,7 +39,7 @@ export class ExampleDatasetDashboard extends UmbElementMixin(LitElement) {
3939
},
4040
{
4141
alias: 'items',
42-
value: [ 'First Option' , 'Second Option', 'Third Option' ],
42+
value: ['First Option', 'Second Option', 'Third Option'],
4343
},
4444
]}
4545
property-editor-ui-alias="Umb.PropertyEditorUi.Dropdown"></umb-property>
@@ -51,7 +51,7 @@ export class ExampleDatasetDashboard extends UmbElementMixin(LitElement) {
5151
`;
5252
}
5353

54-
static styles = [
54+
static override styles = [
5555
UmbTextStyles,
5656
css`
5757
:host {

examples/manifest-picker/manifest-picker-dashboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ExampleManifestPickerDashboard extends UmbLitElement {
3838
this._selectedManifest = selectedManifest?.value ?? '';
3939
}
4040

41-
render() {
41+
override render() {
4242
return html`
4343
<uui-box>
4444
<umb-property-layout label="Select a extension type...">
@@ -77,7 +77,7 @@ export class ExampleManifestPickerDashboard extends UmbLitElement {
7777
`;
7878
}
7979

80-
static styles = [
80+
static override styles = [
8181
UmbTextStyles,
8282
css`
8383
:host {

examples/sorter-with-nested-containers/sorter-dashboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class ExampleSorterDashboard extends UmbElementMixin(LitElement) {
5353
},
5454
];
5555

56-
render() {
56+
override render() {
5757
return html`
5858
<uui-box class="uui-text">
5959
<div class="outer-wrapper">
@@ -72,7 +72,7 @@ export class ExampleSorterDashboard extends UmbElementMixin(LitElement) {
7272
`;
7373
}
7474

75-
static styles = [
75+
static override styles = [
7676
UmbTextStyles,
7777
css`
7878
:host {

examples/sorter-with-nested-containers/sorter-group.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ExampleSorterGroup extends UmbElementMixin(LitElement) {
5050
this.value = this.value.filter((r) => r.name !== item.name);
5151
};
5252

53-
render() {
53+
override render() {
5454
return html`
5555
<div class="sorter-container">
5656
${repeat(
@@ -71,7 +71,7 @@ export class ExampleSorterGroup extends UmbElementMixin(LitElement) {
7171
`;
7272
}
7373

74-
static styles = [
74+
static override styles = [
7575
UmbTextStyles,
7676
css`
7777
:host {

examples/sorter-with-nested-containers/sorter-item.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class ExampleSorterItem extends UmbElementMixin(LitElement) {
1212
@property({ type: Boolean, reflect: true, attribute: 'drag-placeholder' })
1313
umbDragPlaceholder = false;
1414

15-
render() {
15+
override render() {
1616
return html`
1717
<div>
1818
${this.name}
@@ -23,7 +23,7 @@ export class ExampleSorterItem extends UmbElementMixin(LitElement) {
2323
`;
2424
}
2525

26-
static styles = [
26+
static override styles = [
2727
UmbTextStyles,
2828
css`
2929
:host {

0 commit comments

Comments
 (0)