@o.z/zui 0.4.3 → 0.4.6
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/README.md +1 -24
- package/dist/_constants-CnGtrSkM.cjs +7 -0
- package/dist/_constants-DXNZF5so.js +3 -0
- package/dist/decorators/defineElement.cjs +4 -4
- package/dist/decorators/defineElement.d.ts +48 -0
- package/dist/decorators/defineElement.js +4 -4
- package/dist/decorators/event.cjs +3 -2
- package/dist/decorators/event.d.ts +48 -0
- package/dist/decorators/event.js +3 -2
- package/dist/decorators/index.cjs +2 -0
- package/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +1 -0
- package/dist/decorators/mixin.cjs +7 -0
- package/dist/decorators/mixin.d.ts +418 -0
- package/dist/decorators/mixin.js +3 -0
- package/dist/decorators/property.cjs +4 -4
- package/dist/decorators/property.d.ts +60 -0
- package/dist/decorators/property.js +4 -4
- package/dist/decorators/refs.cjs +2 -2
- package/dist/decorators/refs.d.ts +44 -0
- package/dist/decorators/refs.js +2 -2
- package/dist/decorators/state.cjs +2 -2
- package/dist/decorators/state.d.ts +54 -3
- package/dist/decorators/state.js +1 -1
- package/dist/decorators/types.d.ts +108 -0
- package/dist/dom.d.ts +40 -4
- package/dist/html.d.ts +93 -5
- package/dist/index.cjs +11 -7
- package/dist/index.d.ts +18 -361
- package/dist/index.js +5 -5
- package/dist/utilities/delay.cjs +7 -0
- package/dist/utilities/delay.d.ts +18 -0
- package/dist/utilities/delay.js +3 -0
- package/dist/utilities/index.cjs +15 -0
- package/dist/utilities/index.d.ts +10 -0
- package/dist/utilities/index.js +4 -0
- package/dist/utilities/isBrowser.cjs +7 -0
- package/dist/utilities/isBrowser.d.ts +22 -0
- package/dist/utilities/isBrowser.js +3 -0
- package/dist/utilities/makeReactive.cjs +7 -0
- package/dist/utilities/makeReactive.d.ts +41 -0
- package/dist/utilities/makeReactive.js +3 -0
- package/dist/utilities/toKebabCase.cjs +7 -0
- package/dist/utilities/toKebabCase.d.ts +26 -0
- package/dist/utilities/toKebabCase.js +3 -0
- package/package.json +40 -11
- package/dist/_constants-D8uytuQc.cjs +0 -6
- package/dist/_constants-DLywjTCf.js +0 -3
- package/dist/utilities.cjs +0 -10
- package/dist/utilities.d.ts +0 -4
- package/dist/utilities.js +0 -3
- /package/dist/{_helper-B0T4FTYh.js → index-B0T4FTYh.js} +0 -0
- /package/dist/{_helper-YcE1MU2f.cjs → index-YcE1MU2f.cjs} +0 -0
|
@@ -1,10 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview State decorator for reactive internal state management in ZUI components.
|
|
3
|
+
* Provides reactive state that triggers updates without reflecting to DOM attributes.
|
|
4
|
+
*
|
|
5
|
+
* @module state
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Configuration options for the @state decorator.
|
|
9
|
+
*
|
|
10
|
+
* @interface StateOptions
|
|
11
|
+
* @property {string} [callbackName] - Custom update callback method name
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* @state({ callbackName: 'onHistoryChange' })
|
|
15
|
+
* accessor history: number[] = [];
|
|
16
|
+
*/
|
|
1
17
|
export interface StateOptions {
|
|
2
18
|
callbackName?: string;
|
|
3
19
|
}
|
|
4
20
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
21
|
+
* Accessor decorator for internal reactive state that doesn't reflect to DOM attributes.
|
|
22
|
+
*
|
|
23
|
+
* Features:
|
|
24
|
+
* - Reactive state for objects and arrays
|
|
25
|
+
* - Automatic update callbacks on state changes
|
|
26
|
+
* - Deep reactivity with Proxy
|
|
27
|
+
* - No attribute reflection (unlike @property)
|
|
28
|
+
*
|
|
29
|
+
* @template T - Element type extending HTMLElement
|
|
30
|
+
* @template V - State value type
|
|
31
|
+
* @param {StateOptions} [options={}] - State configuration options
|
|
32
|
+
* @returns {ClassAccessorDecorator} An accessor decorator function
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // Reactive array state
|
|
37
|
+
* @state()
|
|
38
|
+
* accessor items: string[] = [];
|
|
39
|
+
* // Calls itemsUpdate() on array mutations
|
|
40
|
+
*
|
|
41
|
+
* // Reactive object state
|
|
42
|
+
* @state()
|
|
43
|
+
* accessor user = { name: '', age: 0 };
|
|
44
|
+
* // Calls userUpdate() on property changes
|
|
45
|
+
*
|
|
46
|
+
* // With custom callback
|
|
47
|
+
* @state({ callbackName: 'onDataChange' })
|
|
48
|
+
* accessor data = {};
|
|
49
|
+
* // Calls onDataChange() instead of dataUpdate()
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* - Best for complex objects, arrays, or private data
|
|
54
|
+
* - Uses Proxy for deep reactivity
|
|
55
|
+
* - Update callbacks receive (oldValue, newValue)
|
|
56
|
+
* - Changes are batched with queueMicrotask
|
|
57
|
+
*
|
|
58
|
+
* @see {@link makeReactive}
|
|
8
59
|
*/
|
|
9
60
|
export declare const state: ({ callbackName }?: StateOptions) => <T extends HTMLElement, V>(accessor: {
|
|
10
61
|
get: (this: T) => V;
|
package/dist/decorators/state.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeReactive } from '../utilities.js';
|
|
1
|
+
import { makeReactive } from '../utilities/makeReactive.js';
|
|
2
2
|
|
|
3
3
|
function _type_of(obj){"@swc/helpers - typeof";return obj&&typeof Symbol!=="undefined"&&obj.constructor===Symbol?"symbol":typeof obj}var state=function(){var callbackName=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).callbackName;return function(accessor,context){var propName=context.name.toString();var updateMethodName=callbackName!==null&&callbackName!==void 0?callbackName:"".concat(propName,"Update");return {init:function init(initialValue){var zuiThis=this;var triggerUpdate=function(){queueMicrotask(function(){if(typeof zuiThis[updateMethodName]==="function"){zuiThis[updateMethodName](initialValue,initialValue);}});};var finalValue=initialValue;if(initialValue&&(typeof initialValue==="undefined"?"undefined":_type_of(initialValue))==="object"){finalValue=makeReactive(initialValue,triggerUpdate);}triggerUpdate();return finalValue},get:function get(){return accessor.get.call(this)},set:function set(newValue){var zuiThis=this;var triggerUpdate=function(){queueMicrotask(function(){if(typeof zuiThis[updateMethodName]==="function"){zuiThis[updateMethodName](newValue,newValue);}});};var finalValue=newValue;if(newValue&&(typeof newValue==="undefined"?"undefined":_type_of(newValue))==="object"){finalValue=makeReactive(newValue,triggerUpdate);}accessor.set.call(this,finalValue);triggerUpdate();}}}};
|
|
4
4
|
|
|
@@ -1,20 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Core TypeScript types and interfaces for ZUI framework.
|
|
3
|
+
* Defines type-safe event systems, update methods, and component interfaces.
|
|
4
|
+
*
|
|
5
|
+
* @module types
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Type guard for property update methods based on property type.
|
|
9
|
+
*
|
|
10
|
+
* @template T - Property type
|
|
11
|
+
* @example
|
|
12
|
+
* // For number properties:
|
|
13
|
+
* countUpdate(oldValue: number, newValue: number): void
|
|
14
|
+
*
|
|
15
|
+
* // For string properties:
|
|
16
|
+
* nameUpdate(oldValue: string, newValue: string): void
|
|
17
|
+
*/
|
|
1
18
|
export type PropertyUpdateMethod<T> = T extends number ? (oldValue: number, newValue: number) => void : T extends string ? (oldValue: string, newValue: string) => void : T extends boolean ? (oldValue: boolean, newValue: boolean) => void : (oldValue: T, newValue: T) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Mapped type that generates update method names from property names.
|
|
21
|
+
* Automatically appends 'Update' suffix to property names.
|
|
22
|
+
*
|
|
23
|
+
* @template T - Component instance type
|
|
24
|
+
* @example
|
|
25
|
+
* // If component has properties: count, name
|
|
26
|
+
* // UpdateMethods will include: countUpdate?, nameUpdate?
|
|
27
|
+
*/
|
|
2
28
|
export type UpdateMethods<T> = {
|
|
3
29
|
[K in keyof T as `${string & K}Update`]?: K extends keyof T ? PropertyUpdateMethod<T[K]> : never;
|
|
4
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Base interface for all ZUI components.
|
|
33
|
+
* Extends HTMLElement with optional lifecycle methods.
|
|
34
|
+
*
|
|
35
|
+
* @interface ZuiComponent
|
|
36
|
+
* @extends HTMLElement
|
|
37
|
+
*/
|
|
5
38
|
export interface ZuiComponent extends HTMLElement {
|
|
39
|
+
/** Called when element connects to DOM */
|
|
6
40
|
connected?(): void;
|
|
41
|
+
/** Called when element disconnects from DOM */
|
|
7
42
|
disconnected?(): void;
|
|
43
|
+
/** Called when observed attribute changes */
|
|
8
44
|
attributeChanged?(attributeName: string, oldValue: string, newValue: string): void;
|
|
45
|
+
/** Index signature for dynamic properties */
|
|
9
46
|
[key: string]: any;
|
|
10
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Wrapper for custom event detail.
|
|
50
|
+
*
|
|
51
|
+
* @template T - Detail type
|
|
52
|
+
* @interface CustomEventDetail
|
|
53
|
+
* @property {T} value - The event payload
|
|
54
|
+
*/
|
|
11
55
|
export interface CustomEventDetail<T> {
|
|
12
56
|
value: T;
|
|
13
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Type-safe event emitter for dispatching custom events.
|
|
60
|
+
*
|
|
61
|
+
* @template T - Event detail type
|
|
62
|
+
* @class EventEmitter
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const emitter = new EventEmitter<number>(element, 'count-changed');
|
|
67
|
+
* emitter.emit(42);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
14
70
|
export declare class EventEmitter<T> {
|
|
15
71
|
private target;
|
|
16
72
|
private eventName;
|
|
73
|
+
/**
|
|
74
|
+
* Creates an event emitter.
|
|
75
|
+
* @param target - The element that will dispatch events
|
|
76
|
+
* @param eventName - Name of the custom event (converted to kebab-case)
|
|
77
|
+
*/
|
|
17
78
|
constructor(target: HTMLElement, eventName: string);
|
|
79
|
+
/**
|
|
80
|
+
* Dispatches a custom event.
|
|
81
|
+
*
|
|
82
|
+
* @param {T} value - Event payload
|
|
83
|
+
* @param {Omit<CustomEventInit, 'detail'>} [options] - Additional event options
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* this.counterClick.emit({ count: 1 }, { bubbles: false });
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* - Events bubble and composed are true by default
|
|
92
|
+
* - Detail is wrapped in { value: payload } structure
|
|
93
|
+
*/
|
|
18
94
|
emit(value: T, options?: Omit<CustomEventInit, 'detail'>): void;
|
|
19
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Extracts the event detail type from an EventEmitter.
|
|
98
|
+
*
|
|
99
|
+
* @template T - EventEmitter type
|
|
100
|
+
*/
|
|
20
101
|
export type EventDetail<T> = T extends EventEmitter<infer U> ? U : never;
|
|
102
|
+
/**
|
|
103
|
+
* Converts camelCase strings to kebab-case.
|
|
104
|
+
* Used for automatic event name generation.
|
|
105
|
+
*
|
|
106
|
+
* @template S - Input string type
|
|
107
|
+
*/
|
|
108
|
+
export type KebabCase<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${KebabCase<U>}` : `${Uncapitalize<T>}-${KebabCase<U>}` : S;
|
|
109
|
+
/**
|
|
110
|
+
* Infers the CustomEvent detail type from an EventEmitter.
|
|
111
|
+
*
|
|
112
|
+
* @template T - EventEmitter type
|
|
113
|
+
*/
|
|
114
|
+
export type InferEventDetail<T> = T extends EventEmitter<infer U> ? CustomEventDetail<U> : never;
|
|
115
|
+
/**
|
|
116
|
+
* Maps component event properties to their corresponding event types.
|
|
117
|
+
*
|
|
118
|
+
* @template T - Component type
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* // If component has: counterClick!: EventEmitter<{ count: number }>;
|
|
123
|
+
* // Then ZuiEventMap<Component> includes: 'counter-click': { value: { count: number } }
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export type ZuiEventMap<T> = {
|
|
127
|
+
[K in keyof T as T[K] extends EventEmitter<any> ? KebabCase<string & K> : never]: InferEventDetail<T[K]>;
|
|
128
|
+
};
|
package/dist/dom.d.ts
CHANGED
|
@@ -2,9 +2,45 @@ import { Properties } from 'csstype';
|
|
|
2
2
|
/**
|
|
3
3
|
* Creates an HTML element with type-safe styles and children.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
5
|
+
* This utility provides a functional alternative to template literals or JSX,
|
|
6
|
+
* with full TypeScript support for CSS properties and element types.
|
|
7
|
+
*
|
|
8
|
+
* @template K - HTML tag name key from HTMLElementTagNameMap
|
|
9
|
+
* @param {K} tagName - The HTML tag name (e.g., 'div', 'span', 'a', 'button')
|
|
10
|
+
* @param {Properties<string | number>} [styles={}] - CSS styles in camelCase format
|
|
11
|
+
* @param {number | boolean | string | Node | (number | boolean | string | Node)[]} [children] - Child nodes or text content
|
|
12
|
+
* @returns {HTMLElementTagNameMap[K]} The created HTML element with proper type
|
|
13
|
+
*
|
|
14
|
+
* @throws {TypeError} If tagName is not a valid HTML element
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Create a styled div with text
|
|
19
|
+
* const div = createElement('div',
|
|
20
|
+
* { backgroundColor: 'red', padding: '10px' },
|
|
21
|
+
* 'Hello World'
|
|
22
|
+
* );
|
|
23
|
+
*
|
|
24
|
+
* // Create nested elements
|
|
25
|
+
* const container = createElement('div', { display: 'flex' }, [
|
|
26
|
+
* createElement('span', { color: 'blue' }, 'Item 1'),
|
|
27
|
+
* createElement('span', { color: 'green' }, 'Item 2')
|
|
28
|
+
* ]);
|
|
29
|
+
*
|
|
30
|
+
* // Create form elements
|
|
31
|
+
* const input = createElement('input', {
|
|
32
|
+
* type: 'text',
|
|
33
|
+
* placeholder: 'Enter text...'
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* - Styles use the `csstype` package for full CSS property type checking
|
|
39
|
+
* - Children can be strings, numbers, booleans, Nodes, or arrays of these
|
|
40
|
+
* - Boolean and number children are converted to strings
|
|
41
|
+
* - Style properties with undefined/null values are ignored
|
|
42
|
+
*
|
|
43
|
+
* @see {@link https://www.npmjs.com/package/csstype} for CSS property types
|
|
44
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement}
|
|
9
45
|
*/
|
|
10
46
|
export declare const createElement: <K extends keyof HTMLElementTagNameMap>(tagName: K, styles?: Properties<string | number>, children?: number | boolean | string | Node | (number | boolean | string | Node)[]) => HTMLElementTagNameMap[K];
|
package/dist/html.d.ts
CHANGED
|
@@ -1,20 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview HTML template literal utilities for safe HTML string generation.
|
|
3
|
+
* Provides XSS protection through automatic escaping and type-safe HTML composition.
|
|
4
|
+
*
|
|
5
|
+
* @module html
|
|
6
|
+
*/
|
|
1
7
|
/**
|
|
2
8
|
* A wrapper class to mark strings as "safe" (already sanitized or trusted).
|
|
9
|
+
*
|
|
10
|
+
* @class SafeHTML
|
|
11
|
+
* @property {string} value - The safe HTML string
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const safe = new SafeHTML('<div>Trusted content</div>');
|
|
16
|
+
* console.log(safe.value); // '<div>Trusted content</div>'
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* - Used internally by the `html` template tag
|
|
21
|
+
* - Signals that content doesn't need escaping
|
|
22
|
+
* - Should only be created from trusted sources
|
|
3
23
|
*/
|
|
4
24
|
export declare class SafeHTML {
|
|
5
25
|
readonly value: string;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a SafeHTML instance.
|
|
28
|
+
* @param {string} value - HTML string that is already sanitized or trusted
|
|
29
|
+
*/
|
|
6
30
|
constructor(value: string);
|
|
31
|
+
/**
|
|
32
|
+
* Returns the safe HTML string.
|
|
33
|
+
* @returns {string} The HTML string
|
|
34
|
+
*/
|
|
7
35
|
toString(): string;
|
|
8
36
|
}
|
|
9
37
|
/**
|
|
10
38
|
* A tagged template literal for safely generating HTML strings.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
39
|
+
*
|
|
40
|
+
* Automatically escapes interpolated values to prevent XSS attacks,
|
|
41
|
+
* unless they are wrapped in `SafeHTML` or `unsafeHTML()`.
|
|
42
|
+
*
|
|
43
|
+
* @template T - Type of interpolated values
|
|
44
|
+
* @param {TemplateStringsArray} strings - Template string parts
|
|
45
|
+
* @param {...any[]} values - Interpolated values to insert
|
|
46
|
+
* @returns {SafeHTML} SafeHTML instance containing the generated HTML
|
|
47
|
+
*
|
|
48
|
+
* @throws {TypeError} If values cannot be converted to strings
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* // Basic usage with escaping
|
|
53
|
+
* const userInput = '<script>alert("xss")</script>';
|
|
54
|
+
* const safeHtml = html`<div>${userInput}</div>`;
|
|
55
|
+
* // Result: '<div><script>alert("xss")</script></div>'
|
|
56
|
+
*
|
|
57
|
+
* // With SafeHTML (no escaping)
|
|
58
|
+
* const trusted = unsafeHTML('<em>italic</em>');
|
|
59
|
+
* const html = html`<div>${trusted}</div>`;
|
|
60
|
+
* // Result: '<div><em>italic</em></div>'
|
|
61
|
+
*
|
|
62
|
+
* // With arrays
|
|
63
|
+
* const items = ['apple', 'banana', 'cherry'];
|
|
64
|
+
* const list = html`<ul>${items.map(item => html`<li>${item}</li>`)}</ul>`;
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* - Always escapes strings unless they're SafeHTML instances
|
|
69
|
+
* - Handles arrays by recursively processing each item
|
|
70
|
+
* - Returns SafeHTML object for type safety
|
|
71
|
+
* - Follows the same pattern as lit-html or hyperHTML
|
|
72
|
+
*
|
|
73
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates}
|
|
74
|
+
* @see {@link unsafeHTML} for escape hatch
|
|
14
75
|
*/
|
|
15
76
|
export declare const html: (strings: TemplateStringsArray, ...values: any[]) => SafeHTML;
|
|
16
77
|
/**
|
|
17
|
-
* An escape hatch to treat a string as safe HTML.
|
|
18
|
-
*
|
|
78
|
+
* An escape hatch to treat a string as safe HTML without escaping.
|
|
79
|
+
*
|
|
80
|
+
* ⚠️ **WARNING**: Only use this with content you completely trust.
|
|
81
|
+
* Never use with user input, database content, or external data.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} str - Trusted HTML string that doesn't need escaping
|
|
84
|
+
* @returns {SafeHTML} SafeHTML wrapper marking the string as safe
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* // ✅ Safe usage - hardcoded content
|
|
89
|
+
* const icon = unsafeHTML('<svg>...</svg>');
|
|
90
|
+
*
|
|
91
|
+
* // ❌ DANGEROUS - user input
|
|
92
|
+
* const userContent = getUserInput();
|
|
93
|
+
* const dangerous = unsafeHTML(userContent); // XSS vulnerability!
|
|
94
|
+
*
|
|
95
|
+
* // ✅ Safe pattern with sanitization
|
|
96
|
+
* const sanitized = sanitizeHTML(userInput);
|
|
97
|
+
* const safe = unsafeHTML(sanitized);
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
* - Consider using a proper HTML sanitizer like DOMPurify
|
|
102
|
+
* - Review usage of this function during security audits
|
|
103
|
+
* - Prefer `html` template tag for automatic escaping
|
|
104
|
+
*
|
|
105
|
+
* @see {@link https://github.com/cure53/DOMPurify} for HTML sanitization
|
|
106
|
+
* @see {@link html} for safe template literals
|
|
19
107
|
*/
|
|
20
108
|
export declare const unsafeHTML: (str: string) => SafeHTML;
|
package/dist/index.cjs
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const utilities_delay = require('./utilities/delay.cjs');
|
|
6
|
+
const utilities_isBrowser = require('./utilities/isBrowser.cjs');
|
|
7
|
+
const utilities_makeReactive = require('./utilities/makeReactive.cjs');
|
|
8
|
+
const utilities_toKebabCase = require('./utilities/toKebabCase.cjs');
|
|
6
9
|
const decorators_defineElement = require('./decorators/defineElement.cjs');
|
|
7
10
|
const decorators_event = require('./decorators/event.cjs');
|
|
11
|
+
const decorators_mixin = require('./decorators/mixin.cjs');
|
|
8
12
|
const decorators_property = require('./decorators/property.cjs');
|
|
9
13
|
const decorators_refs = require('./decorators/refs.cjs');
|
|
10
14
|
const decorators_state = require('./decorators/state.cjs');
|
|
@@ -12,14 +16,15 @@ const decorators_types = require('./decorators/types.cjs');
|
|
|
12
16
|
const dom = require('./dom.cjs');
|
|
13
17
|
const html = require('./html.cjs');
|
|
14
18
|
|
|
15
|
-
function _assert_this_initialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}function _call_super(_this,derived,args){derived=_get_prototype_of(derived);return _possible_constructor_return(_this,_is_native_reflect_construct()?Reflect.construct(derived,args||[],_get_prototype_of(_this).constructor):derived.apply(_this,args))}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _create_class(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);return Constructor}function _get(target,property,receiver){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get;}else {_get=function get(target,property,receiver){var base=_super_prop_base(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(receiver||target)}return desc.value};}return _get(target,property,receiver||target)}function _get_prototype_of(o){_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _get_prototype_of(o)}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_set_prototype_of(subClass,superClass);}function _possible_constructor_return(self,call){if(call&&(_type_of(call)==="object"||typeof call==="function")){return call}return _assert_this_initialized(self)}function _set_prototype_of(o,p){_set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(o,p){o.__proto__=p;return o};return _set_prototype_of(o,p)}function _super_prop_base(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_get_prototype_of(object);if(object===null)break}return object}function _type_of(obj){"@swc/helpers - typeof";return obj&&typeof Symbol!=="undefined"&&obj.constructor===Symbol?"symbol":typeof obj}function _is_native_reflect_construct(){try{var result=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(_){}return (_is_native_reflect_construct=function(){return !!result})()}function Zui(Base){return /*#__PURE__*/function(Base){_inherits(ZuiElement,Base);function ZuiElement(){_class_call_check(this,ZuiElement);return _call_super(this,ZuiElement,arguments)}_create_class(ZuiElement,[{key:"addEventListener",value:function addEventListener(type,listener,options){_get(_get_prototype_of(ZuiElement.prototype),"addEventListener",this).call(this,type,listener,options);}}]);return ZuiElement}(Base)}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
20
|
+
|
|
21
|
+
exports.delay = utilities_delay.delay;
|
|
22
|
+
exports.isBrowser = utilities_isBrowser.isBrowser;
|
|
23
|
+
exports.makeReactive = utilities_makeReactive.makeReactive;
|
|
24
|
+
exports.toKebabCase = utilities_toKebabCase.toKebabCase;
|
|
21
25
|
exports.defineElement = decorators_defineElement.defineElement;
|
|
22
26
|
exports.event = decorators_event.event;
|
|
27
|
+
exports.Zui = decorators_mixin.Zui;
|
|
23
28
|
exports.property = decorators_property.property;
|
|
24
29
|
exports.ref = decorators_refs.ref;
|
|
25
30
|
exports.state = decorators_state.state;
|
|
@@ -28,4 +33,3 @@ exports.createElement = dom.createElement;
|
|
|
28
33
|
exports.SafeHTML = html.SafeHTML;
|
|
29
34
|
exports.html = html.html;
|
|
30
35
|
exports.unsafeHTML = html.unsafeHTML;
|
|
31
|
-
exports.Zui = Zui;
|