) {\n props = this._beforeRender(props) || props;\n return h(this._getComponent(props) as ComponentType, this._getProps(props), this._getChildren(props));\n }\n}\n","import{options as r}from\"preact\";export{Fragment}from\"preact\";var _=0;function o(o,e,n,t,f,l){var s,u,a={};for(u in e)\"ref\"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:l};if(\"function\"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return r.vnode&&r.vnode(i),i}export{o as jsx,o as jsxDEV,o as jsxs};\n//# sourceMappingURL=jsxRuntime.module.js.map\n","import {Component, createRef} from 'preact';\nimport {$} from '../../cash';\nimport {HElement} from './h-element';\n\nimport type {HtmlContentProps} from '../types';\n\n/**\n * HTML content component.\n *\n * @example\n * // Render
Hello world
\n * Hello world\" />\n *\n * // Render and execute script\n * alert('Hello world')\" executeScript />\n */\nexport class HtmlContent extends Component {\n protected _ref = createRef();\n\n protected _runJS() {\n if (!this.props.executeScript) {\n return;\n }\n $(this._ref.current).runJS();\n }\n\n componentDidMount(): void {\n this._runJS();\n }\n\n componentDidUpdate(previousProps: Readonly): void {\n if (this.props.html !== previousProps.html) {\n this._runJS();\n }\n }\n\n render(props: HtmlContentProps) {\n const {executeScript, html, ...others} = props;\n return ;\n }\n}\n","import {h as _h, isValidElement, ComponentChildren, JSX, Attributes} from 'preact';\nimport {classes, ClassNameLike} from '../../helpers';\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResultItem = Partial<{\n html: string;\n __html: string;\n style: JSX.CSSProperties;\n className: ClassNameLike;\n children: ComponentChildren;\n attrs: JSX.HTMLAttributes;\n [prop: string]: unknown;\n}>;\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResultGenerator = unknown[], THIS = unknown> = (this: THIS, result: ComponentChildren[], ...args: T) => (ComponentChildren | CustomRenderResultItem)[] | undefined | void;\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResult = unknown[], THIS = unknown> = CustomRenderResultGenerator | CustomRenderResultItem | ComponentChildren;\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResultList = unknown[], THIS = unknown> = CustomRenderResult[];\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderProps = unknown[], THIS = unknown> = {\n tag?: string;\n className?: ClassNameLike;\n style?: JSX.CSSProperties;\n renders: CustomRenderResultList;\n generateArgs?: T;\n generators?: Record>;\n generatorThis?: THIS;\n onGenerate?: (this: THIS, generator: CustomRenderResultGenerator, result: ComponentChildren[], ...args: T) => (ComponentChildren | CustomRenderResultItem)[];\n onRenderItem?: (item: CustomRenderResultItem) => ComponentChildren;\n children?: ComponentChildren;\n};\n\n/**\n * @deprecated Use `renderCustomContent` instead.\n */\nexport function renderCustomResult(props: CustomRenderProps): [JSX.HTMLAttributes, ComponentChildren[]] {\n const {\n tag,\n className,\n style,\n renders,\n generateArgs = [],\n generatorThis,\n generators,\n onGenerate,\n onRenderItem,\n ...others\n } = props;\n const classList: ClassNameLike = [className];\n const rootStyle: JSX.CSSProperties = {...style};\n const result: ComponentChildren[] = [];\n const rawHtml: string[] = [];\n renders.forEach(render => {\n const items: (CustomRenderResultItem | ComponentChildren)[] = [];\n if (typeof render === 'string' && generators && generators[render]) {\n render = generators[render];\n }\n if (typeof render === 'function') {\n if (onGenerate) {\n items.push(...onGenerate.call(generatorThis, render as CustomRenderResultGenerator, result, ...generateArgs));\n } else {\n const renderResult = (render as CustomRenderResultGenerator).call(generatorThis, result, ...generateArgs);\n if (renderResult) {\n if (Array.isArray(renderResult)) {\n items.push(...renderResult);\n } else {\n items.push(renderResult);\n }\n }\n }\n } else {\n items.push(render);\n }\n items.forEach(item => {\n if (item === undefined || item === null) {\n return;\n }\n if (typeof item === 'object' && !isValidElement(item) && ('html' in item || '__html' in item || 'className' in item || 'style' in item || 'attrs' in item || 'children' in item)) {\n if (item.html) {\n result.push(\n
)}>
,\n );\n } else if (item.__html) {\n rawHtml.push(item.__html);\n } else {\n if (item.style) {\n Object.assign(rootStyle, item.style);\n }\n if (item.className) {\n classList.push(item.className);\n }\n if (item.children) {\n result.push(item.children);\n }\n if (item.attrs) {\n Object.assign(others, item.attrs);\n }\n }\n } else {\n result.push(item);\n }\n });\n });\n\n if (rawHtml.length) {\n Object.assign(others, {dangerouslySetInnerHTML: {__html: rawHtml}});\n }\n\n return [{\n className: classes(classList),\n style: rootStyle,\n ...others,\n }, result];\n}\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport function CustomRender({\n tag = 'div',\n ...props\n}: CustomRenderProps) {\n const [attrs, children] = renderCustomResult(props);\n return _h(tag, attrs as Attributes, ...children);\n}\n","import {isValidElement} from 'preact';\nimport {HtmlContent} from './html-content';\nimport {HElement} from './h-element';\n\nimport type {ComponentChildren, VNode} from 'preact';\nimport type {HtmlContentProps, HElementProps, CustomContentType, CustomContentGenerator, CustomContentProps} from '../types';\n\n/**\n * Render custom content.\n *\n * @param content The content to render.\n * @param generatorThis The `this` value to use when calling the generator.\n * @param generatorArgs The arguments to pass to the generator.\n * @returns The rendered content.\n */\nexport function renderCustomContent(\n content: CustomContentType | CustomContentType[],\n generatorThis?: unknown,\n generatorArgs?: unknown[],\n): ComponentChildren {\n if (typeof content === 'function') {\n return (content as CustomContentGenerator).call(generatorThis, ...(generatorArgs || []));\n }\n if (Array.isArray(content)) {\n return content.map((x) => renderCustomContent(x, generatorThis, generatorArgs));\n }\n if (isValidElement(content) || content === null) {\n return content;\n }\n if (typeof content === 'object') {\n if ((content as HtmlContentProps).html) {\n return ;\n }\n return ;\n }\n return content;\n}\n\n/**\n * Component for rendering custom content.\n *\n * @param props Custom content props.\n * @returns Custom content.\n */\nexport function CustomContent(props: CustomContentProps): VNode | null {\n const {content, generatorThis, generatorArgs} = props;\n const result = renderCustomContent(content, generatorThis, generatorArgs);\n if (result === undefined || result === null || typeof result === 'boolean') {\n return null;\n }\n if (isValidElement(result)) {\n return result;\n }\n return <>{result}>;\n}\n","import {isValidElement} from 'preact';\nimport {classes} from '../../helpers/classes';\n\nimport type {ClassNameLike} from '../../helpers/classes';\nimport type {IconProps} from '../types';\n\nconst createIconClass = (icon: string) => icon.startsWith('icon-') ? icon : `icon-${icon}`;\n\n/**\n * Component for rendering icons.\n *\n * @param props Icon properties.\n * @returns Icon element.\n */\nexport function Icon(props: IconProps) {\n const {icon, className, ...others} = props;\n if (!icon) {\n return null;\n }\n if (isValidElement(icon)) {\n return icon;\n }\n const classList: ClassNameLike[] = ['icon', className as string];\n if (typeof icon === 'string') {\n classList.push(createIconClass(icon));\n } else if (typeof icon === 'object') {\n const {className: iconClass, icon: finalIcon, ...iconOthers} = icon;\n classList.push(iconClass as string, finalIcon ? createIconClass(finalIcon as string) : '');\n Object.assign(others, iconOthers);\n }\n return ;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {createElement, render} from 'preact';\n\nimport type {VNode, RenderableProps, ContainerNode} from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(this: any, props: RenderableProps<{context: any}>) {\n this.getChildContext = () => props.context;\n return props.children;\n}\n\n/**\n * Portal component\n * @this {import('preact').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(this: any, props: any) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const container = props._container;\n\n that.componentWillUnmount = function () {\n render(null, that._temp);\n that._temp = null;\n that._container = null;\n };\n\n // When we change container we should clear our old container and\n // indicate a new mount.\n if (that._container && that._container !== container) {\n that.componentWillUnmount();\n }\n\n // When props.vnode is undefined/false/null we are dealing with some kind of\n // conditional vnode. This should not trigger a render.\n if (props._vnode) {\n if (!that._temp) {\n that._container = container;\n\n // Create a fake DOM parent node that manages a subset of `container`'s children:\n that._temp = {\n nodeType: 1,\n parentNode: container,\n childNodes: [],\n appendChild(child: VNode) {\n this.childNodes.push(child);\n that._container.appendChild(child);\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n insertBefore(child: VNode, _before: VNode) {\n this.childNodes.push(child);\n that._container.appendChild(child);\n },\n removeChild(child: VNode) {\n this.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n that._container.removeChild(child);\n },\n };\n }\n\n // Render our wrapping element into temp.\n render(\n createElement(ContextProvider as any, {context: that.context}, props._vnode),\n that._temp,\n );\n } else if (that._temp) {\n // When we come from a conditional render, on a mounted\n // portal we should clear the DOM.\n that.componentWillUnmount();\n }\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n *\n * @param {import('preact').VNode} vnode The vnode to render\n * @param {import('preact').PreactElement} container The DOM node to continue rendering in to.\n * @see https://github.com/developit/preact-portal/blob/master/src/preact-portal.js\n */\nexport function createPortal(vnode: VNode, container: ContainerNode): VNode {\n const el = createElement(Portal as any, {_vnode: vnode, _container: container}) as any;\n el.containerInfo = container;\n return el;\n}\n","import {i18n} from '../i18n';\nimport {$, Cash, Element, Selector} from '../cash';\nimport type {ComponentEventArgs, ComponentEventName, ComponentOptions, ComponentEvents, ComponentEventsDefnition} from './types';\n\n/**\n * The event callback for component.\n */\nexport type ComponentEventCallback> = (event: N extends keyof HTMLElementEventMap ? HTMLElementEventMap[N] : Event, args: [Component, ComponentEventArgs]) => void | false;\n\n/**\n * Check whether the element is detached from document.\n * @param element The element to check.\n * @returns Whether the element is detached from document.\n */\nfunction isElementDetached(element: Node): boolean {\n if (element.parentNode === document) {\n return false;\n }\n if (!element.parentNode) {\n return true;\n }\n return isElementDetached(element.parentNode);\n}\n\n/**\n * The component base class.\n */\nexport class Component {\n /**\n * The default options.\n */\n static DEFAULT = {};\n\n /**\n * The component name.\n * It usually equals to the class name.\n * The name must be provided in subclass.\n */\n static NAME: string;\n\n /**\n * Whether the component supports multiple instances.\n */\n static MULTI_INSTANCE = false;\n\n /**\n * ZUI name\n */\n static get ZUI() {\n return this.NAME.replace(/(^[A-Z]+)/, (match) => {\n return match.toLowerCase();\n });\n }\n\n /**\n * Component data key, like \"zui.menu\"\n */\n static get KEY(): `zui.${string}` {\n return `zui.${this.NAME}`;\n }\n\n /**\n * Component namespace, like \".zui.menu\"\n */\n static get NAMESPACE(): `.zui.${string}` {\n return `.zui.${this.ZUI}`;\n }\n\n static get DATA_KEY(): `data-zui-${string}` {\n return `data-zui-${this.NAME}`;\n }\n\n /**\n * Access to static properties via this.constructor.\n *\n * @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146\n */\n declare ['constructor']: typeof Component;\n\n /**\n * Store the component options.\n */\n private _options?: ComponentOptions;\n\n /**\n * Store the component element.\n */\n private _element?: U;\n\n /**\n * The component global ID.\n */\n private _gid: number;\n\n /**\n * The component key.\n */\n protected _key: string | number;\n\n /**\n * The component initialized flag.\n */\n private _inited = false;\n\n /**\n * Auto destroy flag.\n */\n private _autoDestory = 0;\n\n /**\n * Element removed observer.\n */\n private _mobs?: MutationObserver;\n\n /**\n * The component constructor.\n *\n * @param options The component initial options.\n */\n constructor(selector: Selector, options?: Partial>) {\n const {KEY, DATA_KEY, DEFAULT, MULTI_INSTANCE, NAME} = this.constructor;\n\n if (!NAME) {\n throw new Error('[ZUI] The component must have a \"NAME\" static property.');\n }\n\n const $element = $(selector);\n if ($element.data(KEY) && !MULTI_INSTANCE) {\n throw new Error('[ZUI] The component has been initialized on element.');\n }\n\n const element = $element[0] as U;\n const gid = $.guid++;\n this._gid = gid;\n this._element = element;\n\n const $parent = $element.parent();\n if ($parent.length) {\n this._mobs = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach(ele => {\n if (ele !== element) {\n return;\n }\n if (this._autoDestory) {\n clearTimeout(this._autoDestory);\n }\n this._autoDestory = window.setTimeout(() => {\n this._autoDestory = 0;\n if (isElementDetached(element)) {\n this.destroy();\n }\n }, 100);\n });\n });\n });\n this._mobs.observe($parent[0]!, {childList: true, subtree: false});\n }\n\n this._options = {...DEFAULT, ...$element.dataset()} as ComponentOptions;\n this.setOptions(options);\n this._key = this.options.key ?? `__${gid}`;\n\n $element.data(KEY, this).attr(DATA_KEY, `${gid}`);\n if (MULTI_INSTANCE) {\n const dataName = `${KEY}:ALL`;\n let instanceMap = $element.data(dataName);\n if (!instanceMap) {\n instanceMap = new Map();\n $element.data(dataName, instanceMap);\n }\n instanceMap.set(this._key, this);\n }\n\n this.init();\n requestAnimationFrame(async () => {\n this._inited = true;\n await this.afterInit();\n this.emit('inited', this.options);\n });\n }\n\n get inited() {\n return this._inited;\n }\n\n /**\n * Get the component element.\n */\n get element() {\n return this._element!;\n }\n\n get key() {\n return this._key;\n }\n\n /**\n * Get the component options.\n */\n get options() {\n return this._options!;\n }\n\n /**\n * Get the component global id.\n */\n get gid() {\n return this._gid;\n }\n\n /**\n * Get the component element as a jQuery like object.\n */\n get $element() {\n return $(this.element);\n }\n\n /**\n * Get the component event emitter.\n */\n get $emitter() {\n return this.$element;\n }\n\n /**\n * Initialize the component.\n */\n init() {}\n\n /**\n * Do something after the component initialized.\n */\n afterInit(): void | Promise {}\n\n /**\n * Render the component.\n *\n * @param options The component options to override before render.\n */\n render(options?: Partial>) {\n this.setOptions(options);\n }\n\n /**\n * Destroy the component.\n */\n destroy() {\n const {KEY, DATA_KEY, MULTI_INSTANCE} = this.constructor;\n const {$element} = this;\n\n (this.emit as ((event: string, ...args: unknown[]) => void))('destroyed');\n\n this._mobs?.disconnect();\n\n $element\n .off(this.namespace)\n .removeData(KEY)\n .attr(DATA_KEY, null);\n\n if (MULTI_INSTANCE) {\n const map = this.$element.data(`${KEY}:ALL`) as Map>;\n if (map) {\n map.delete(this._key);\n if (map.size === 0) {\n this.$element.removeData(`${KEY}:ALL`);\n } else {\n const nextInstance = map.values().next().value;\n $element.data(KEY, nextInstance).attr(DATA_KEY, nextInstance.gid);\n }\n }\n }\n }\n\n /**\n * Set the component options.\n *\n * @param options The component options to set.\n * @returns The component options.\n */\n setOptions(options?: Partial>) {\n if (options) {\n $.extend(this._options, options);\n }\n return this._options;\n }\n\n /**\n * Emit a component event.\n * @param event The event name.\n * @param args The event arguments.\n */\n emit>(event: N, ...args: ComponentEventArgs): Event {\n const eventObject = $.Event(event);\n (eventObject as unknown as {__src?: unknown}).__src = this;\n this.$emitter.trigger(eventObject, [this, ...args]);\n return eventObject as unknown as Event;\n }\n\n /**\n * Listen to a component event.\n *\n * @param event The event name.\n * @param callback The event callback.\n */\n on>(event: N | (string & {}), callback: ComponentEventCallback, options?: {once?: boolean}) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const component = this;\n this.$element[options?.once ? 'one' : 'on'](this._wrapEvent(event), function (this: Component, e: N extends keyof HTMLElementEventMap ? HTMLElementEventMap[N] : Event, info: [Component, ComponentEventArgs]) {\n if (!(e as {__src?: unknown}).__src || (e as {__src?: unknown}).__src === component) {\n callback.call(this, e, info);\n }\n });\n }\n\n /**\n * Listen to a component event.\n *\n * @param event The event name.\n * @param callback The event callback.\n */\n one>(event: N, callback: ComponentEventCallback) {\n this.on(event, callback, {once: true});\n }\n\n /**\n * Stop listening to a component event.\n * @param event The event name.\n * @param callback The event callback.\n */\n off>(event: N | (string & {})) {\n this.$element.off(this._wrapEvent(event));\n }\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param defaultValue The default value if the key is not found.\n */\n i18n(key: string, defaultValue?: string): string;\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param args The i18n arguments.\n * @param defaultValue The default value if the key is not found.\n */\n i18n(key: string, args?: (string | number)[] | Record, defaultValue?: string): string;\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param args The i18n arguments or the default value.\n * @param defaultValue The default value if the key is not found.\n * @returns The i18n text.\n */\n i18n(key: string, args?: string | (string | number)[] | Record, defaultValue?: string): string {\n return i18n(this.options.i18n, key, args, defaultValue, this.options.lang, this.constructor.NAME)\n ?? i18n(this.options.i18n, key, args, defaultValue, this.options.lang)\n ?? `{i18n:${key}}`;\n }\n\n /**\n * Get event namespace.\n * @returns Event namespace.\n */\n get namespace(): `.zui.${string}` {\n return `${this.constructor.NAMESPACE}.${this._key}`;\n }\n\n /**\n * Wrap event names with component namespace.\n *\n * @param names The event names.\n * @returns The wrapped event names.\n */\n protected _wrapEvent(names: string) {\n return names.split(' ').map(name => name.includes('.') ? name : `${name}${this.namespace}`).join(' ');\n }\n\n /**\n * Get the component instance of the given element.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @returns The component instance.\n */\n static get>(this: T, selector: Selector, key?: string | number): InstanceType | undefined {\n const $element = $(selector);\n if (this.MULTI_INSTANCE && key !== undefined) {\n const instanceMap = $element.data(`${this.KEY}:ALL`);\n if (instanceMap) {\n return instanceMap.get(key);\n }\n return;\n }\n return $element.data(this.KEY);\n }\n\n /**\n * Ensure the component instance of the given element.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @param options The component options.\n * @returns The component instance.\n */\n static ensure>(this: T, selector: Selector, options?: Partial>): InstanceType {\n const instance = this.get(selector, options?.key);\n if (instance) {\n if (options) {\n instance.setOptions(options);\n }\n return instance;\n }\n return new this(selector, options) as InstanceType;\n }\n\n /**\n * Get all component instances.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @returns All component instances.\n */\n static getAll>(this: T, selector?: Selector): InstanceType[] {\n const {MULTI_INSTANCE, DATA_KEY} = this;\n const list: InstanceType[] = [];\n $(selector || document)\n .find(`[${DATA_KEY}]`)\n .each((_, element) => {\n if (MULTI_INSTANCE) {\n const instanceMap = $(element).data(`${this.KEY}:ALL`);\n if (instanceMap) {\n list.push(...instanceMap.values());\n return;\n }\n }\n const instance = $(element).data(this.KEY);\n if (instance) {\n list.push(instance);\n }\n });\n return list;\n }\n\n /**\n * Query the component instance.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @returns The component instance.\n */\n static query>(this: T, selector?: Selector, key?: string | number): InstanceType | undefined {\n if (selector === undefined) {\n return this.getAll().sort((a, b) => a.gid - b.gid)[0];\n }\n return this.get($(selector).closest(`[${this.DATA_KEY}]`), key);\n }\n\n /**\n * Create cash fn.method for current component.\n *\n * @param name The method name.\n */\n static defineFn(name?: string) {\n let fnName = (name || this.ZUI) as keyof Cash;\n if ($.fn[fnName]) {\n fnName = `zui${this.NAME}` as keyof Cash;\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const ZUIComponent = this;\n $.fn.extend({\n [fnName](options: Partial> | string, ...args: unknown[]) {\n const initOptions = typeof options === 'object' ? options : undefined;\n const callMethod = typeof options === 'string' ? options : undefined;\n let callResult: unknown;\n this.each((_: number, element: Element) => {\n let instance = ZUIComponent.get(element);\n if (instance) {\n if (initOptions) {\n instance.render(initOptions);\n }\n } else {\n instance = new ZUIComponent(element, initOptions);\n }\n if (callMethod) {\n let method: ((...args: unknown[]) => void) = (instance as unknown as Record void>)[callMethod];\n let callThis: unknown = instance;\n if (method === undefined) {\n callThis = (instance as unknown as {$: Record void>}).$;\n method = (callThis as Record void>)[callMethod as string];\n }\n if (typeof method === 'function') {\n callResult = method.call(callThis, ...args);\n } else {\n callResult = method;\n }\n }\n });\n return callResult !== undefined ? callResult : this;\n },\n });\n }\n}\n","import {createRef, render, h, Attributes} from 'preact';\nimport type {Component as ComponentReact, ComponentClass} from 'preact';\nimport {Component as ComponentBase, ComponentEventsDefnition} from '../component';\n\nexport class ComponentFromReact = ComponentReact, E extends ComponentEventsDefnition = {}, U extends HTMLElement = HTMLElement> extends ComponentBase {\n /**\n * The React component class.\n */\n static Component: unknown;\n\n /**\n * Access to static properties via this.constructor.\n *\n * @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146\n */\n declare ['constructor']: typeof ComponentFromReact;\n\n /**\n * The React ref for component instance.\n */\n ref = createRef();\n\n /**\n * The React component instance.\n */\n get $(): C | null {\n return this.ref.current;\n }\n\n /**\n * Render after component init.\n */\n afterInit() {\n this.render();\n }\n\n /**\n * Destroy component.\n */\n destroy() {\n this.$?.componentWillUnmount?.();\n if (this.element) {\n this.element.innerHTML = '';\n }\n super.destroy();\n }\n\n /**\n * Render component.\n *\n * @param options new options.\n */\n render(options?: Partial) {\n render(\n h(this.constructor.Component as ComponentClass, {\n ref: this.ref,\n ...this.setOptions(options),\n } as Attributes),\n this.element,\n );\n }\n}\n","import {classes} from '@zui/core';\nimport {Attributes, ComponentType, h as _h} from 'preact';\nimport {ActionDividerProps} from '../types/action-divider-props';\n\nexport function ActionDivider({\n component = 'div',\n className,\n children,\n style,\n attrs,\n}: ActionDividerProps) {\n return _h(component as ComponentType, {\n className: classes(className),\n style,\n ...attrs,\n } as Attributes, children);\n}\n","import {Attributes, ComponentType, h as _h} from 'preact';\nimport {classes, CustomContent, Icon} from '@zui/core';\nimport {ActionItemProps} from '../types/action-item-props';\n\nexport function ActionItem({\n type,\n component = 'a',\n className,\n children,\n content,\n attrs,\n url,\n disabled,\n active,\n icon,\n text,\n target,\n trailingIcon,\n hint,\n checked,\n onClick,\n data,\n ...others\n}: ActionItemProps) {\n const finalChildren = [\n typeof checked === 'boolean' ? (\n
\n \n
\n ) : null,\n ,\n text ? {text} : null,\n ,\n children,\n ,\n ];\n return _h(component as ComponentType, {\n className: classes(className, {disabled, active}),\n title: hint,\n [component === 'a' ? 'href' : 'data-url']: disabled ? undefined : url,\n [component === 'a' ? 'target' : 'data-target']: disabled ? undefined : target,\n onClick,\n ...others,\n ...attrs,\n } as Attributes, ...finalChildren);\n}\n","import {CustomContent, classes} from '@zui/core';\nimport {Attributes, ComponentType, h as _h} from 'preact';\nimport {ActionHeadingProps} from '../types/action-heading-props';\n\nexport function ActionHeading({\n component = 'div',\n className,\n text,\n attrs,\n children,\n content,\n style,\n onClick,\n}: ActionHeadingProps) {\n return _h(component as ComponentType, {\n className: classes(className),\n style,\n onClick,\n ...attrs,\n } as Attributes, text, , children);\n}\n","import {classes} from '@zui/core';\nimport {Attributes, ComponentType, h as _h} from 'preact';\nimport {ActionSpaceProps} from '../types/action-space-props';\n\nexport function ActionSpace({\n component = 'div',\n className,\n style,\n space,\n flex,\n attrs,\n onClick,\n children,\n}: ActionSpaceProps) {\n return _h(component as ComponentType, {\n className: classes(className),\n style: {width: space, height: space, flex, ...style},\n onClick,\n ...attrs,\n } as Attributes, children);\n}\n","import {CustomRender} from '@zui/core';\nimport {ActionCustomProps} from '../types/action-custom-props';\n\nexport function ActionCustom({type, ...props}: ActionCustomProps) {\n return ;\n}\n","import {CustomContent, classes} from '@zui/core';\nimport {Attributes, ComponentType, h as _h} from 'preact';\nimport {ActionBasicProps} from '../types';\n\nexport function ActionBasic({\n component = 'div',\n className,\n children,\n content,\n style,\n attrs,\n}: ActionBasicProps) {\n return _h(component as ComponentType, {\n className: classes(className),\n style,\n ...attrs,\n } as Attributes, , children);\n}\n","import {Component, createRef, h as _h, isValidElement} from 'preact';\nimport type {JSX, ComponentType} from 'preact';\nimport {classes, ClassNameLike} from '@zui/core';\nimport '@zui/css-icons/src/icons/caret.css';\nimport '../style/index.css';\nimport {ActionDivider} from './action-divider';\nimport {ActionItem} from './action-item';\nimport {ActionHeading} from './action-heading';\nimport {ActionSpace} from './action-space';\nimport {ActionCustom} from './action-custom';\nimport {ActionBasic} from './action-basic';\nimport type {ActionMenuOptions} from '../types/action-menu-options';\nimport type {ActionBasicProps} from '../types/action-basic-props';\nimport type {ActionMenuItemOptions} from '../types/action-menu-item-options';\nimport {ActionItemProps} from '../types';\n\nexport class ActionMenu = ActionMenuOptions, S = {}> extends Component