@o.z/zui 0.4.2 → 0.4.4

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.
@@ -1,12 +1,11 @@
1
1
  import { SafeHTML } from '../html';
2
+ import { UpdateMethods } from './types';
2
3
  export interface DefineElementOptions {
3
4
  tagName: string;
4
5
  html: string | SafeHTML;
5
6
  css?: string;
6
7
  options?: ElementDefinitionOptions;
7
8
  }
8
- export declare const defineElement: ({ tagName, html, css, options }: DefineElementOptions) => <T extends CustomElementConstructor>(originalClass: T, context: ClassDecoratorContext<T>) => T & {
9
- prototype: {
10
- zcolor: string;
11
- };
12
- };
9
+ export declare const defineElement: ({ tagName, html, css, options }: DefineElementOptions) => <T extends CustomElementConstructor>(originalClass: T & {
10
+ prototype: UpdateMethods<InstanceType<T>>;
11
+ }, context: ClassDecoratorContext<T>) => T;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const decorators_defineElement = require('./defineElement.cjs');
6
6
  const decorators_event = require('./event.cjs');
7
+ const decorators_mixin = require('./mixin.cjs');
7
8
  const decorators_property = require('./property.cjs');
8
9
  const decorators_refs = require('./refs.cjs');
9
10
  const decorators_state = require('./state.cjs');
@@ -13,6 +14,7 @@ const decorators_types = require('./types.cjs');
13
14
 
14
15
  exports.defineElement = decorators_defineElement.defineElement;
15
16
  exports.event = decorators_event.event;
17
+ exports.Zui = decorators_mixin.Zui;
16
18
  exports.property = decorators_property.property;
17
19
  exports.ref = decorators_refs.ref;
18
20
  exports.state = decorators_state.state;
@@ -1,5 +1,6 @@
1
1
  export * from './defineElement.ts';
2
2
  export * from './event.ts';
3
+ export * from './mixin.ts';
3
4
  export * from './property.ts';
4
5
  export * from './refs.ts';
5
6
  export * from './state.ts';
@@ -1,5 +1,6 @@
1
1
  export { defineElement } from './defineElement.js';
2
2
  export { event } from './event.js';
3
+ export { Zui } from './mixin.js';
3
4
  export { property } from './property.js';
4
5
  export { ref } from './refs.js';
5
6
  export { state } from './state.js';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ 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){var ZuiElement=/*#__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);return ZuiElement}
6
+
7
+ exports.Zui = Zui;
@@ -0,0 +1,357 @@
1
+ import { ZuiEventMap } from './types';
2
+ export declare function Zui<TBase extends new (...args: any[]) => HTMLElement>(Base: TBase): (abstract new (...args: any[]) => {
3
+ connected?(): void;
4
+ disconnected?(): void;
5
+ attributeChanged?(attributeName: string, oldValue: string, newValue: string): void;
6
+ addEventListener<K extends never>(type: K, listener: (ev: CustomEvent<ZuiEventMap</*elided*/ any>[K]>) => void, options?: boolean | AddEventListenerOptions): void;
7
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
8
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
9
+ accessKey: string;
10
+ readonly accessKeyLabel: string;
11
+ autocapitalize: string;
12
+ autocorrect: boolean;
13
+ dir: string;
14
+ draggable: boolean;
15
+ hidden: boolean;
16
+ inert: boolean;
17
+ innerText: string;
18
+ lang: string;
19
+ readonly offsetHeight: number;
20
+ readonly offsetLeft: number;
21
+ readonly offsetParent: Element | null;
22
+ readonly offsetTop: number;
23
+ readonly offsetWidth: number;
24
+ outerText: string;
25
+ popover: string | null;
26
+ spellcheck: boolean;
27
+ title: string;
28
+ translate: boolean;
29
+ writingSuggestions: string;
30
+ attachInternals(): ElementInternals;
31
+ click(): void;
32
+ hidePopover(): void;
33
+ showPopover(): void;
34
+ togglePopover(options?: boolean): boolean;
35
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
36
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
37
+ readonly attributes: NamedNodeMap;
38
+ get classList(): DOMTokenList;
39
+ set classList(value: string);
40
+ className: string;
41
+ readonly clientHeight: number;
42
+ readonly clientLeft: number;
43
+ readonly clientTop: number;
44
+ readonly clientWidth: number;
45
+ readonly currentCSSZoom: number;
46
+ id: string;
47
+ innerHTML: string;
48
+ readonly localName: string;
49
+ readonly namespaceURI: string | null;
50
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
51
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
52
+ outerHTML: string;
53
+ readonly ownerDocument: Document;
54
+ get part(): DOMTokenList;
55
+ set part(value: string);
56
+ readonly prefix: string | null;
57
+ readonly scrollHeight: number;
58
+ scrollLeft: number;
59
+ scrollTop: number;
60
+ readonly scrollWidth: number;
61
+ readonly shadowRoot: ShadowRoot | null;
62
+ slot: string;
63
+ readonly tagName: string;
64
+ attachShadow(init: ShadowRootInit): ShadowRoot;
65
+ checkVisibility(options?: CheckVisibilityOptions): boolean;
66
+ closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
67
+ closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
68
+ closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
69
+ closest<E extends Element = Element>(selectors: string): E | null;
70
+ computedStyleMap(): StylePropertyMapReadOnly;
71
+ getAttribute(qualifiedName: string): string | null;
72
+ getAttributeNS(namespace: string | null, localName: string): string | null;
73
+ getAttributeNames(): string[];
74
+ getAttributeNode(qualifiedName: string): Attr | null;
75
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
76
+ getBoundingClientRect(): DOMRect;
77
+ getClientRects(): DOMRectList;
78
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
79
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
80
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
81
+ getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
82
+ getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
83
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
84
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
85
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
86
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
87
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
88
+ getHTML(options?: GetHTMLOptions): string;
89
+ hasAttribute(qualifiedName: string): boolean;
90
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
91
+ hasAttributes(): boolean;
92
+ hasPointerCapture(pointerId: number): boolean;
93
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
94
+ insertAdjacentHTML(position: InsertPosition, string: string): void;
95
+ insertAdjacentText(where: InsertPosition, data: string): void;
96
+ matches(selectors: string): boolean;
97
+ releasePointerCapture(pointerId: number): void;
98
+ removeAttribute(qualifiedName: string): void;
99
+ removeAttributeNS(namespace: string | null, localName: string): void;
100
+ removeAttributeNode(attr: Attr): Attr;
101
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
102
+ requestPointerLock(options?: PointerLockOptions): Promise<void>;
103
+ scroll(options?: ScrollToOptions): void;
104
+ scroll(x: number, y: number): void;
105
+ scrollBy(options?: ScrollToOptions): void;
106
+ scrollBy(x: number, y: number): void;
107
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
108
+ scrollTo(options?: ScrollToOptions): void;
109
+ scrollTo(x: number, y: number): void;
110
+ setAttribute(qualifiedName: string, value: string): void;
111
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
112
+ setAttributeNode(attr: Attr): Attr | null;
113
+ setAttributeNodeNS(attr: Attr): Attr | null;
114
+ setHTMLUnsafe(html: string): void;
115
+ setPointerCapture(pointerId: number): void;
116
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
117
+ webkitMatchesSelector(selectors: string): boolean;
118
+ get textContent(): string;
119
+ set textContent(value: string | null);
120
+ readonly baseURI: string;
121
+ readonly childNodes: NodeListOf<ChildNode>;
122
+ readonly firstChild: ChildNode | null;
123
+ readonly isConnected: boolean;
124
+ readonly lastChild: ChildNode | null;
125
+ readonly nextSibling: ChildNode | null;
126
+ readonly nodeName: string;
127
+ readonly nodeType: number;
128
+ nodeValue: string | null;
129
+ readonly parentElement: HTMLElement | null;
130
+ readonly parentNode: ParentNode | null;
131
+ readonly previousSibling: ChildNode | null;
132
+ appendChild<T extends Node>(node: T): T;
133
+ cloneNode(subtree?: boolean): Node;
134
+ compareDocumentPosition(other: Node): number;
135
+ contains(other: Node | null): boolean;
136
+ getRootNode(options?: GetRootNodeOptions): Node;
137
+ hasChildNodes(): boolean;
138
+ insertBefore<T extends Node>(node: T, child: Node | null): T;
139
+ isDefaultNamespace(namespace: string | null): boolean;
140
+ isEqualNode(otherNode: Node | null): boolean;
141
+ isSameNode(otherNode: Node | null): boolean;
142
+ lookupNamespaceURI(prefix: string | null): string | null;
143
+ lookupPrefix(namespace: string | null): string | null;
144
+ normalize(): void;
145
+ removeChild<T extends Node>(child: T): T;
146
+ replaceChild<T extends Node>(node: Node, child: T): T;
147
+ readonly ELEMENT_NODE: 1;
148
+ readonly ATTRIBUTE_NODE: 2;
149
+ readonly TEXT_NODE: 3;
150
+ readonly CDATA_SECTION_NODE: 4;
151
+ readonly ENTITY_REFERENCE_NODE: 5;
152
+ readonly ENTITY_NODE: 6;
153
+ readonly PROCESSING_INSTRUCTION_NODE: 7;
154
+ readonly COMMENT_NODE: 8;
155
+ readonly DOCUMENT_NODE: 9;
156
+ readonly DOCUMENT_TYPE_NODE: 10;
157
+ readonly DOCUMENT_FRAGMENT_NODE: 11;
158
+ readonly NOTATION_NODE: 12;
159
+ readonly DOCUMENT_POSITION_DISCONNECTED: 1;
160
+ readonly DOCUMENT_POSITION_PRECEDING: 2;
161
+ readonly DOCUMENT_POSITION_FOLLOWING: 4;
162
+ readonly DOCUMENT_POSITION_CONTAINS: 8;
163
+ readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
164
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
165
+ dispatchEvent(event: Event): boolean;
166
+ ariaActiveDescendantElement: Element | null;
167
+ ariaAtomic: string | null;
168
+ ariaAutoComplete: string | null;
169
+ ariaBrailleLabel: string | null;
170
+ ariaBrailleRoleDescription: string | null;
171
+ ariaBusy: string | null;
172
+ ariaChecked: string | null;
173
+ ariaColCount: string | null;
174
+ ariaColIndex: string | null;
175
+ ariaColIndexText: string | null;
176
+ ariaColSpan: string | null;
177
+ ariaControlsElements: ReadonlyArray<Element> | null;
178
+ ariaCurrent: string | null;
179
+ ariaDescribedByElements: ReadonlyArray<Element> | null;
180
+ ariaDescription: string | null;
181
+ ariaDetailsElements: ReadonlyArray<Element> | null;
182
+ ariaDisabled: string | null;
183
+ ariaErrorMessageElements: ReadonlyArray<Element> | null;
184
+ ariaExpanded: string | null;
185
+ ariaFlowToElements: ReadonlyArray<Element> | null;
186
+ ariaHasPopup: string | null;
187
+ ariaHidden: string | null;
188
+ ariaInvalid: string | null;
189
+ ariaKeyShortcuts: string | null;
190
+ ariaLabel: string | null;
191
+ ariaLabelledByElements: ReadonlyArray<Element> | null;
192
+ ariaLevel: string | null;
193
+ ariaLive: string | null;
194
+ ariaModal: string | null;
195
+ ariaMultiLine: string | null;
196
+ ariaMultiSelectable: string | null;
197
+ ariaOrientation: string | null;
198
+ ariaOwnsElements: ReadonlyArray<Element> | null;
199
+ ariaPlaceholder: string | null;
200
+ ariaPosInSet: string | null;
201
+ ariaPressed: string | null;
202
+ ariaReadOnly: string | null;
203
+ ariaRelevant: string | null;
204
+ ariaRequired: string | null;
205
+ ariaRoleDescription: string | null;
206
+ ariaRowCount: string | null;
207
+ ariaRowIndex: string | null;
208
+ ariaRowIndexText: string | null;
209
+ ariaRowSpan: string | null;
210
+ ariaSelected: string | null;
211
+ ariaSetSize: string | null;
212
+ ariaSort: string | null;
213
+ ariaValueMax: string | null;
214
+ ariaValueMin: string | null;
215
+ ariaValueNow: string | null;
216
+ ariaValueText: string | null;
217
+ role: string | null;
218
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
219
+ getAnimations(options?: GetAnimationsOptions): Animation[];
220
+ after(...nodes: (Node | string)[]): void;
221
+ before(...nodes: (Node | string)[]): void;
222
+ remove(): void;
223
+ replaceWith(...nodes: (Node | string)[]): void;
224
+ readonly nextElementSibling: Element | null;
225
+ readonly previousElementSibling: Element | null;
226
+ readonly childElementCount: number;
227
+ readonly children: HTMLCollection;
228
+ readonly firstElementChild: Element | null;
229
+ readonly lastElementChild: Element | null;
230
+ append(...nodes: (Node | string)[]): void;
231
+ prepend(...nodes: (Node | string)[]): void;
232
+ querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
233
+ querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
234
+ querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
235
+ querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
236
+ querySelector<E extends Element = Element>(selectors: string): E | null;
237
+ querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
238
+ querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
239
+ querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
240
+ querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
241
+ querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
242
+ replaceChildren(...nodes: (Node | string)[]): void;
243
+ readonly assignedSlot: HTMLSlotElement | null;
244
+ readonly attributeStyleMap: StylePropertyMap;
245
+ get style(): CSSStyleDeclaration;
246
+ set style(cssText: string);
247
+ contentEditable: string;
248
+ enterKeyHint: string;
249
+ inputMode: string;
250
+ readonly isContentEditable: boolean;
251
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
252
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
253
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
254
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
255
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
256
+ onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
257
+ onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
258
+ onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
259
+ onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
260
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
261
+ oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
262
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
263
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
264
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
265
+ onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
267
+ oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
268
+ oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
269
+ oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
+ oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
271
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
+ oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
273
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
274
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
275
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
276
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
277
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
278
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
279
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
280
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
281
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
282
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
283
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
+ onerror: OnErrorEventHandler;
285
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
286
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
287
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
288
+ oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
289
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
290
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
291
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
292
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
293
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
294
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
298
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
299
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
300
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
301
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
302
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
303
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
304
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
305
+ onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
306
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
307
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
308
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
309
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
310
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
311
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
312
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
313
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
314
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
315
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
316
+ onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
317
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
318
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
319
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
320
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
321
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
322
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
323
+ onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
324
+ onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
325
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
326
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
327
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
328
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
329
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
330
+ onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
331
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
332
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
333
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
334
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
335
+ ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
336
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
337
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
338
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
339
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
340
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
341
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
342
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
343
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
344
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
345
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
346
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
347
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
348
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
349
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
350
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
351
+ autofocus: boolean;
352
+ readonly dataset: DOMStringMap;
353
+ nonce?: string;
354
+ tabIndex: number;
355
+ blur(): void;
356
+ focus(options?: FocusOptions): void;
357
+ }) & TBase;
@@ -0,0 +1,3 @@
1
+ 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){var ZuiElement=/*#__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);return ZuiElement}
2
+
3
+ export { Zui };
@@ -1,3 +1,7 @@
1
+ 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;
2
+ export type UpdateMethods<T> = {
3
+ [K in keyof T as `${string & K}Update`]?: K extends keyof T ? PropertyUpdateMethod<T[K]> : never;
4
+ };
1
5
  export interface ZuiComponent extends HTMLElement {
2
6
  connected?(): void;
3
7
  disconnected?(): void;
@@ -14,3 +18,8 @@ export declare class EventEmitter<T> {
14
18
  emit(value: T, options?: Omit<CustomEventInit, 'detail'>): void;
15
19
  }
16
20
  export type EventDetail<T> = T extends EventEmitter<infer U> ? U : never;
21
+ 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;
22
+ export type InferEventDetail<T> = T extends EventEmitter<infer U> ? CustomEventDetail<U> : never;
23
+ export type ZuiEventMap<T> = {
24
+ [K in keyof T as T[K] extends EventEmitter<any> ? KebabCase<string & K> : never]: InferEventDetail<T[K]>;
25
+ };
package/dist/index.cjs CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const utilities = require('./utilities.cjs');
6
6
  const decorators_defineElement = require('./decorators/defineElement.cjs');
7
7
  const decorators_event = require('./decorators/event.cjs');
8
+ const decorators_mixin = require('./decorators/mixin.cjs');
8
9
  const decorators_property = require('./decorators/property.cjs');
9
10
  const decorators_refs = require('./decorators/refs.cjs');
10
11
  const decorators_state = require('./decorators/state.cjs');
@@ -12,7 +13,7 @@ const decorators_types = require('./decorators/types.cjs');
12
13
  const dom = require('./dom.cjs');
13
14
  const html = require('./html.cjs');
14
15
 
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
+
16
17
 
17
18
  exports.delay = utilities.delay;
18
19
  exports.isBrowser = utilities.isBrowser;
@@ -20,6 +21,7 @@ exports.makeReactive = utilities.makeReactive;
20
21
  exports.toKebabCase = utilities.toKebabCase;
21
22
  exports.defineElement = decorators_defineElement.defineElement;
22
23
  exports.event = decorators_event.event;
24
+ exports.Zui = decorators_mixin.Zui;
23
25
  exports.property = decorators_property.property;
24
26
  exports.ref = decorators_refs.ref;
25
27
  exports.state = decorators_state.state;
@@ -28,4 +30,3 @@ exports.createElement = dom.createElement;
28
30
  exports.SafeHTML = html.SafeHTML;
29
31
  exports.html = html.html;
30
32
  exports.unsafeHTML = html.unsafeHTML;
31
- exports.Zui = Zui;
package/dist/index.d.ts CHANGED
@@ -1,365 +1,4 @@
1
- import { EventEmitter, CustomEventDetail } from './decorators';
2
1
  export * from './utilities';
3
2
  export * from './decorators';
4
3
  export * from './dom';
5
4
  export * from './html';
6
- type KebabCase<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${KebabCase<U>}` : `${Uncapitalize<T>}-${KebabCase<U>}` : S;
7
- export type InferEventDetail<T> = T extends EventEmitter<infer U> ? CustomEventDetail<U> : never;
8
- type ZuiEventMap<T> = {
9
- [K in keyof T as T[K] extends EventEmitter<any> ? KebabCase<string & K> : never]: InferEventDetail<T[K]>;
10
- };
11
- export declare function Zui<TBase extends new (...args: any[]) => HTMLElement>(Base: TBase): {
12
- new (...args: any[]): {
13
- addEventListener<K extends never>(type: K, listener: (ev: CustomEvent<ZuiEventMap</*elided*/ any>[K]>) => void, options?: boolean | AddEventListenerOptions): void;
14
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
15
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
16
- accessKey: string;
17
- readonly accessKeyLabel: string;
18
- autocapitalize: string;
19
- autocorrect: boolean;
20
- dir: string;
21
- draggable: boolean;
22
- hidden: boolean;
23
- inert: boolean;
24
- innerText: string;
25
- lang: string;
26
- readonly offsetHeight: number;
27
- readonly offsetLeft: number;
28
- readonly offsetParent: Element | null;
29
- readonly offsetTop: number;
30
- readonly offsetWidth: number;
31
- outerText: string;
32
- popover: string | null;
33
- spellcheck: boolean;
34
- title: string;
35
- translate: boolean;
36
- writingSuggestions: string;
37
- attachInternals(): ElementInternals;
38
- click(): void;
39
- hidePopover(): void;
40
- showPopover(): void;
41
- togglePopover(options?: boolean): boolean;
42
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
43
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
44
- readonly attributes: NamedNodeMap;
45
- get classList(): DOMTokenList;
46
- set classList(value: string);
47
- className: string;
48
- readonly clientHeight: number;
49
- readonly clientLeft: number;
50
- readonly clientTop: number;
51
- readonly clientWidth: number;
52
- readonly currentCSSZoom: number;
53
- id: string;
54
- innerHTML: string;
55
- readonly localName: string;
56
- readonly namespaceURI: string | null;
57
- onfullscreenchange: ((this: Element, ev: Event) => any) | null;
58
- onfullscreenerror: ((this: Element, ev: Event) => any) | null;
59
- outerHTML: string;
60
- readonly ownerDocument: Document;
61
- get part(): DOMTokenList;
62
- set part(value: string);
63
- readonly prefix: string | null;
64
- readonly scrollHeight: number;
65
- scrollLeft: number;
66
- scrollTop: number;
67
- readonly scrollWidth: number;
68
- readonly shadowRoot: ShadowRoot | null;
69
- slot: string;
70
- readonly tagName: string;
71
- attachShadow(init: ShadowRootInit): ShadowRoot;
72
- checkVisibility(options?: CheckVisibilityOptions): boolean;
73
- closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
74
- closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
75
- closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
76
- closest<E extends Element = Element>(selectors: string): E | null;
77
- computedStyleMap(): StylePropertyMapReadOnly;
78
- getAttribute(qualifiedName: string): string | null;
79
- getAttributeNS(namespace: string | null, localName: string): string | null;
80
- getAttributeNames(): string[];
81
- getAttributeNode(qualifiedName: string): Attr | null;
82
- getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
83
- getBoundingClientRect(): DOMRect;
84
- getClientRects(): DOMRectList;
85
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
86
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
87
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
88
- getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
89
- getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
90
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
91
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
92
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
93
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
94
- getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
95
- getHTML(options?: GetHTMLOptions): string;
96
- hasAttribute(qualifiedName: string): boolean;
97
- hasAttributeNS(namespace: string | null, localName: string): boolean;
98
- hasAttributes(): boolean;
99
- hasPointerCapture(pointerId: number): boolean;
100
- insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
101
- insertAdjacentHTML(position: InsertPosition, string: string): void;
102
- insertAdjacentText(where: InsertPosition, data: string): void;
103
- matches(selectors: string): boolean;
104
- releasePointerCapture(pointerId: number): void;
105
- removeAttribute(qualifiedName: string): void;
106
- removeAttributeNS(namespace: string | null, localName: string): void;
107
- removeAttributeNode(attr: Attr): Attr;
108
- requestFullscreen(options?: FullscreenOptions): Promise<void>;
109
- requestPointerLock(options?: PointerLockOptions): Promise<void>;
110
- scroll(options?: ScrollToOptions): void;
111
- scroll(x: number, y: number): void;
112
- scrollBy(options?: ScrollToOptions): void;
113
- scrollBy(x: number, y: number): void;
114
- scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
115
- scrollTo(options?: ScrollToOptions): void;
116
- scrollTo(x: number, y: number): void;
117
- setAttribute(qualifiedName: string, value: string): void;
118
- setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
119
- setAttributeNode(attr: Attr): Attr | null;
120
- setAttributeNodeNS(attr: Attr): Attr | null;
121
- setHTMLUnsafe(html: string): void;
122
- setPointerCapture(pointerId: number): void;
123
- toggleAttribute(qualifiedName: string, force?: boolean): boolean;
124
- webkitMatchesSelector(selectors: string): boolean;
125
- get textContent(): string;
126
- set textContent(value: string | null);
127
- readonly baseURI: string;
128
- readonly childNodes: NodeListOf<ChildNode>;
129
- readonly firstChild: ChildNode | null;
130
- readonly isConnected: boolean;
131
- readonly lastChild: ChildNode | null;
132
- readonly nextSibling: ChildNode | null;
133
- readonly nodeName: string;
134
- readonly nodeType: number;
135
- nodeValue: string | null;
136
- readonly parentElement: HTMLElement | null;
137
- readonly parentNode: ParentNode | null;
138
- readonly previousSibling: ChildNode | null;
139
- appendChild<T extends Node>(node: T): T;
140
- cloneNode(subtree?: boolean): Node;
141
- compareDocumentPosition(other: Node): number;
142
- contains(other: Node | null): boolean;
143
- getRootNode(options?: GetRootNodeOptions): Node;
144
- hasChildNodes(): boolean;
145
- insertBefore<T extends Node>(node: T, child: Node | null): T;
146
- isDefaultNamespace(namespace: string | null): boolean;
147
- isEqualNode(otherNode: Node | null): boolean;
148
- isSameNode(otherNode: Node | null): boolean;
149
- lookupNamespaceURI(prefix: string | null): string | null;
150
- lookupPrefix(namespace: string | null): string | null;
151
- normalize(): void;
152
- removeChild<T extends Node>(child: T): T;
153
- replaceChild<T extends Node>(node: Node, child: T): T;
154
- readonly ELEMENT_NODE: 1;
155
- readonly ATTRIBUTE_NODE: 2;
156
- readonly TEXT_NODE: 3;
157
- readonly CDATA_SECTION_NODE: 4;
158
- readonly ENTITY_REFERENCE_NODE: 5;
159
- readonly ENTITY_NODE: 6;
160
- readonly PROCESSING_INSTRUCTION_NODE: 7;
161
- readonly COMMENT_NODE: 8;
162
- readonly DOCUMENT_NODE: 9;
163
- readonly DOCUMENT_TYPE_NODE: 10;
164
- readonly DOCUMENT_FRAGMENT_NODE: 11;
165
- readonly NOTATION_NODE: 12;
166
- readonly DOCUMENT_POSITION_DISCONNECTED: 1;
167
- readonly DOCUMENT_POSITION_PRECEDING: 2;
168
- readonly DOCUMENT_POSITION_FOLLOWING: 4;
169
- readonly DOCUMENT_POSITION_CONTAINS: 8;
170
- readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
171
- readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
172
- dispatchEvent(event: Event): boolean;
173
- ariaActiveDescendantElement: Element | null;
174
- ariaAtomic: string | null;
175
- ariaAutoComplete: string | null;
176
- ariaBrailleLabel: string | null;
177
- ariaBrailleRoleDescription: string | null;
178
- ariaBusy: string | null;
179
- ariaChecked: string | null;
180
- ariaColCount: string | null;
181
- ariaColIndex: string | null;
182
- ariaColIndexText: string | null;
183
- ariaColSpan: string | null;
184
- ariaControlsElements: ReadonlyArray<Element> | null;
185
- ariaCurrent: string | null;
186
- ariaDescribedByElements: ReadonlyArray<Element> | null;
187
- ariaDescription: string | null;
188
- ariaDetailsElements: ReadonlyArray<Element> | null;
189
- ariaDisabled: string | null;
190
- ariaErrorMessageElements: ReadonlyArray<Element> | null;
191
- ariaExpanded: string | null;
192
- ariaFlowToElements: ReadonlyArray<Element> | null;
193
- ariaHasPopup: string | null;
194
- ariaHidden: string | null;
195
- ariaInvalid: string | null;
196
- ariaKeyShortcuts: string | null;
197
- ariaLabel: string | null;
198
- ariaLabelledByElements: ReadonlyArray<Element> | null;
199
- ariaLevel: string | null;
200
- ariaLive: string | null;
201
- ariaModal: string | null;
202
- ariaMultiLine: string | null;
203
- ariaMultiSelectable: string | null;
204
- ariaOrientation: string | null;
205
- ariaOwnsElements: ReadonlyArray<Element> | null;
206
- ariaPlaceholder: string | null;
207
- ariaPosInSet: string | null;
208
- ariaPressed: string | null;
209
- ariaReadOnly: string | null;
210
- ariaRelevant: string | null;
211
- ariaRequired: string | null;
212
- ariaRoleDescription: string | null;
213
- ariaRowCount: string | null;
214
- ariaRowIndex: string | null;
215
- ariaRowIndexText: string | null;
216
- ariaRowSpan: string | null;
217
- ariaSelected: string | null;
218
- ariaSetSize: string | null;
219
- ariaSort: string | null;
220
- ariaValueMax: string | null;
221
- ariaValueMin: string | null;
222
- ariaValueNow: string | null;
223
- ariaValueText: string | null;
224
- role: string | null;
225
- animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
226
- getAnimations(options?: GetAnimationsOptions): Animation[];
227
- after(...nodes: (Node | string)[]): void;
228
- before(...nodes: (Node | string)[]): void;
229
- remove(): void;
230
- replaceWith(...nodes: (Node | string)[]): void;
231
- readonly nextElementSibling: Element | null;
232
- readonly previousElementSibling: Element | null;
233
- readonly childElementCount: number;
234
- readonly children: HTMLCollection;
235
- readonly firstElementChild: Element | null;
236
- readonly lastElementChild: Element | null;
237
- append(...nodes: (Node | string)[]): void;
238
- prepend(...nodes: (Node | string)[]): void;
239
- querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
240
- querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
241
- querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
242
- querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
243
- querySelector<E extends Element = Element>(selectors: string): E | null;
244
- querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
245
- querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
246
- querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
247
- querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
248
- querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
249
- replaceChildren(...nodes: (Node | string)[]): void;
250
- readonly assignedSlot: HTMLSlotElement | null;
251
- readonly attributeStyleMap: StylePropertyMap;
252
- get style(): CSSStyleDeclaration;
253
- set style(cssText: string);
254
- contentEditable: string;
255
- enterKeyHint: string;
256
- inputMode: string;
257
- readonly isContentEditable: boolean;
258
- onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
259
- onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
260
- onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
261
- onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
262
- onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
263
- onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
264
- onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
265
- onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
266
- onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
267
- onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
268
- oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
269
- oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
- oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
- onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
- onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
273
- onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
- oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
- oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
276
- oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
- oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
278
- oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
- oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
280
- ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
281
- ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
282
- ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
283
- ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
284
- ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
285
- ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
286
- ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
287
- ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
288
- ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
289
- onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
290
- onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
291
- onerror: OnErrorEventHandler;
292
- onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
293
- onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
294
- ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
295
- oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
- oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
- onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
298
- onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
299
- onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
300
- onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
301
- onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
302
- onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
303
- onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
304
- onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
305
- onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
306
- onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
307
- onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
308
- onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
309
- onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
310
- onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
311
- onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
312
- onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
313
- onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
314
- onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
315
- onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
316
- onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
317
- onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
318
- onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
319
- onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
320
- onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
321
- onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
322
- onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
323
- onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
324
- onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
325
- onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
326
- onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
327
- onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
328
- onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
329
- onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
330
- onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
331
- onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
332
- onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
333
- onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
334
- onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
335
- onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
336
- onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
337
- onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
338
- onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
339
- onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
340
- onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
341
- ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
342
- ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
343
- ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
344
- ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
345
- ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
346
- ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
347
- ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
348
- ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
349
- ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
350
- ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
351
- onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
352
- onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
353
- onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
354
- onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
355
- onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
356
- onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
357
- onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
358
- autofocus: boolean;
359
- readonly dataset: DOMStringMap;
360
- nonce?: string;
361
- tabIndex: number;
362
- blur(): void;
363
- focus(options?: FocusOptions): void;
364
- };
365
- } & TBase;
package/dist/index.js CHANGED
@@ -1,13 +1,10 @@
1
1
  export { delay, isBrowser, makeReactive, toKebabCase } from './utilities.js';
2
2
  export { defineElement } from './decorators/defineElement.js';
3
3
  export { event } from './decorators/event.js';
4
+ export { Zui } from './decorators/mixin.js';
4
5
  export { property } from './decorators/property.js';
5
6
  export { ref } from './decorators/refs.js';
6
7
  export { state } from './decorators/state.js';
7
8
  export { EventEmitter } from './decorators/types.js';
8
9
  export { createElement } from './dom.js';
9
10
  export { SafeHTML, html, unsafeHTML } from './html.js';
10
-
11
- 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)}
12
-
13
- export { Zui };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o.z/zui",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Next-generation Web Component framework leveraging TypeScript Stage 3 standard decorators.",
5
5
  "homepage": "https://github.com/z-npm/zui#readme",
6
6
  "docs": "https://github.com/z-npm/zui#readme",
@@ -67,7 +67,7 @@
67
67
  "@vitest/ui": "^4.0.18",
68
68
  "@z-code/vite-plugin-swc": "^0.5.5",
69
69
  "glob": "^13.0.0",
70
- "globals": "^17.2.0",
70
+ "globals": "^17.3.0",
71
71
  "jsdom": "^27.4.0",
72
72
  "sass": "^1.97.3",
73
73
  "typescript": "^5.9.3",
@@ -120,6 +120,11 @@
120
120
  "import": "./dist/decorators/property.js",
121
121
  "require": "./dist/decorators/property.cjs"
122
122
  },
123
+ "./decorators/mixin": {
124
+ "types": "./dist/decorators/mixin.d.ts",
125
+ "import": "./dist/decorators/mixin.js",
126
+ "require": "./dist/decorators/mixin.cjs"
127
+ },
123
128
  "./decorators": {
124
129
  "types": "./dist/decorators/index.d.ts",
125
130
  "import": "./dist/decorators/index.js",