update
This commit is contained in:
26
readme.md
26
readme.md
@@ -39,10 +39,10 @@ export class MyButton extends DeesElement {
|
||||
`;
|
||||
|
||||
@property({ type: String })
|
||||
public label: string = 'Button';
|
||||
accessor label: string = 'Button';
|
||||
|
||||
@property({ type: String })
|
||||
public variant: 'primary' | 'secondary' = 'primary';
|
||||
accessor variant: 'primary' | 'secondary' = 'primary';
|
||||
|
||||
public static styles = [
|
||||
css`
|
||||
@@ -263,23 +263,23 @@ public static styles = [
|
||||
export class BestPracticeComponent extends DeesElement {
|
||||
// ✅ Static demo property
|
||||
public static demo = () => html`
|
||||
<best-practice-component
|
||||
<best-practice-component
|
||||
.complexProp=${{ key: 'value' }}
|
||||
simpleAttribute="test"
|
||||
></best-practice-component>
|
||||
`;
|
||||
|
||||
// ✅ Typed properties with defaults
|
||||
// ✅ Typed properties with defaults (TC39 decorator syntax with accessor)
|
||||
@property({ type: String })
|
||||
public title: string = 'Default Title';
|
||||
accessor title: string = 'Default Title';
|
||||
|
||||
// ✅ Complex property without attribute
|
||||
@property({ attribute: false })
|
||||
public complexProp: { key: string } = { key: 'default' };
|
||||
accessor complexProp: { key: string } = { key: 'default' };
|
||||
|
||||
// ✅ Enum with proper typing
|
||||
@property({ type: String })
|
||||
public variant: 'small' | 'medium' | 'large' = 'medium';
|
||||
accessor variant: 'small' | 'medium' | 'large' = 'medium';
|
||||
}
|
||||
```
|
||||
|
||||
@@ -391,19 +391,21 @@ Component for wrapping demos with post-render logic.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
||||
|
||||
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District court Bremen HRB 35230 HB, Germany
|
||||
Task Venture Capital GmbH
|
||||
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
|
||||
@@ -36,13 +36,13 @@ export class TestComplexTypes extends DeesElement {
|
||||
`;
|
||||
|
||||
@property({ type: Array })
|
||||
public stringArray: string[] = ['apple', 'banana', 'cherry'];
|
||||
accessor stringArray: string[] = ['apple', 'banana', 'cherry'];
|
||||
|
||||
@property({ type: Array })
|
||||
public numberArray: number[] = [1, 2, 3, 4, 5];
|
||||
accessor numberArray: number[] = [1, 2, 3, 4, 5];
|
||||
|
||||
@property({ attribute: false })
|
||||
public complexData: IComplexData = {
|
||||
accessor complexData: IComplexData = {
|
||||
name: 'Default Name',
|
||||
age: 0,
|
||||
tags: [],
|
||||
@@ -54,19 +54,19 @@ export class TestComplexTypes extends DeesElement {
|
||||
};
|
||||
|
||||
@property({ type: Object })
|
||||
public simpleObject = {
|
||||
accessor simpleObject = {
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
key3: 123
|
||||
};
|
||||
|
||||
@property({ attribute: false })
|
||||
public functionProperty = () => {
|
||||
accessor functionProperty = () => {
|
||||
console.log('This is a function property');
|
||||
};
|
||||
|
||||
@property({ type: Date })
|
||||
public dateProperty = new Date();
|
||||
accessor dateProperty = new Date();
|
||||
|
||||
public static styles = [
|
||||
css`
|
||||
|
||||
@@ -21,35 +21,35 @@ export class TestDemoelement extends DeesElement {
|
||||
public static demo = () => html`<test-demoelement>This is a slot text</test-demoelement>`;
|
||||
|
||||
@property()
|
||||
public notTyped = 'hello';
|
||||
accessor notTyped = 'hello';
|
||||
|
||||
@property({
|
||||
type: String,
|
||||
})
|
||||
public typedAndNotInitizalized: string;
|
||||
accessor typedAndNotInitizalized: string;
|
||||
|
||||
@property()
|
||||
public notTypedAndNotInitizalized: string;
|
||||
accessor notTypedAndNotInitizalized: string;
|
||||
|
||||
@property({
|
||||
type: Boolean,
|
||||
})
|
||||
public demoBoolean = false;
|
||||
accessor demoBoolean = false;
|
||||
|
||||
@property({
|
||||
type: String,
|
||||
})
|
||||
public demoString = 'default demo string';
|
||||
accessor demoString = 'default demo string';
|
||||
|
||||
@property({
|
||||
type: Number,
|
||||
})
|
||||
public demoNumber = 2;
|
||||
accessor demoNumber = 2;
|
||||
|
||||
@property({
|
||||
type: ETestEnum,
|
||||
})
|
||||
public demoENum: ETestEnum = ETestEnum.first;
|
||||
accessor demoENum: ETestEnum = ETestEnum.first;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@@ -13,60 +13,60 @@ export class TestEdgeCases extends DeesElement {
|
||||
|
||||
// Property with null value
|
||||
@property({ type: String })
|
||||
public nullableString: string | null = null;
|
||||
accessor nullableString: string | null = null;
|
||||
|
||||
// Property with undefined value
|
||||
@property({ type: Number })
|
||||
public undefinedNumber: number | undefined = undefined;
|
||||
accessor undefinedNumber: number | undefined = undefined;
|
||||
|
||||
// Very long string
|
||||
@property({ type: String })
|
||||
public longString: string = 'Lorem ipsum '.repeat(50);
|
||||
accessor longString: string = 'Lorem ipsum '.repeat(50);
|
||||
|
||||
// Property with special characters
|
||||
@property({ type: String })
|
||||
public specialChars: string = '!@#$%^&*()_+-=[]{}|;\':",./<>?`~';
|
||||
accessor specialChars: string = '!@#$%^&*()_+-=[]{}|;\':",./<>?`~';
|
||||
|
||||
// Property that could cause rendering issues
|
||||
@property({ type: String })
|
||||
public htmlString: string = '<script>alert("test")</script><b>Bold text</b>';
|
||||
accessor htmlString: string = '<script>alert("test")</script><b>Bold text</b>';
|
||||
|
||||
// Numeric edge cases
|
||||
@property({ type: Number })
|
||||
public infinityNumber: number = Infinity;
|
||||
accessor infinityNumber: number = Infinity;
|
||||
|
||||
@property({ type: Number })
|
||||
public nanNumber: number = NaN;
|
||||
accessor nanNumber: number = NaN;
|
||||
|
||||
@property({ type: Number })
|
||||
public veryLargeNumber: number = Number.MAX_SAFE_INTEGER;
|
||||
accessor veryLargeNumber: number = Number.MAX_SAFE_INTEGER;
|
||||
|
||||
@property({ type: Number })
|
||||
public verySmallNumber: number = Number.MIN_SAFE_INTEGER;
|
||||
accessor verySmallNumber: number = Number.MIN_SAFE_INTEGER;
|
||||
|
||||
@property({ type: Number })
|
||||
public floatNumber: number = 3.14159265359;
|
||||
accessor floatNumber: number = 3.14159265359;
|
||||
|
||||
// Boolean-like values
|
||||
@property({ type: String })
|
||||
public booleanString: string = 'false';
|
||||
accessor booleanString: string = 'false';
|
||||
|
||||
@property({ type: Number })
|
||||
public booleanNumber: number = 0;
|
||||
accessor booleanNumber: number = 0;
|
||||
|
||||
// Empty values
|
||||
@property({ type: String })
|
||||
public emptyString: string = '';
|
||||
accessor emptyString: string = '';
|
||||
|
||||
@property({ type: Array })
|
||||
public emptyArray: any[] = [];
|
||||
accessor emptyArray: any[] = [];
|
||||
|
||||
@property({ type: Object })
|
||||
public emptyObject: {} = {};
|
||||
accessor emptyObject: {} = {};
|
||||
|
||||
// Circular reference (should not break properties panel)
|
||||
@property({ attribute: false })
|
||||
public circularRef: any = (() => {
|
||||
accessor circularRef: any = (() => {
|
||||
const obj: any = { name: 'circular' };
|
||||
obj.self = obj;
|
||||
return obj;
|
||||
|
||||
@@ -23,13 +23,13 @@ class TestNestedWrapper extends DeesElement {
|
||||
@customElement('test-nested-target')
|
||||
class TestNestedTarget extends DeesElement {
|
||||
@property({ type: String })
|
||||
public message: string = 'I am deeply nested!';
|
||||
accessor message: string = 'I am deeply nested!';
|
||||
|
||||
@property({ type: Number })
|
||||
public depth: number = 0;
|
||||
accessor depth: number = 0;
|
||||
|
||||
@property({ type: Boolean })
|
||||
public found: boolean = false;
|
||||
accessor found: boolean = false;
|
||||
|
||||
public static styles = [
|
||||
css`
|
||||
@@ -67,7 +67,7 @@ export class TestNested extends DeesElement {
|
||||
`;
|
||||
|
||||
@property({ type: String })
|
||||
public testId: string = 'nested-test';
|
||||
accessor testId: string = 'nested-test';
|
||||
|
||||
public static styles = [
|
||||
css`
|
||||
|
||||
@@ -39,13 +39,13 @@ export class TestWithWrapper extends DeesElement {
|
||||
`;
|
||||
|
||||
@property({ type: String })
|
||||
public dynamicValue: string = 'Initial value';
|
||||
accessor dynamicValue: string = 'Initial value';
|
||||
|
||||
@property({ type: Number })
|
||||
public counter: number = 0;
|
||||
accessor counter: number = 0;
|
||||
|
||||
@property({ type: Boolean })
|
||||
public isActive: boolean = false;
|
||||
accessor isActive: boolean = false;
|
||||
|
||||
public static styles = [
|
||||
css`
|
||||
|
||||
Reference in New Issue
Block a user