vanilla-jui 1.5.8 → 1.5.9

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Renderable } from "vanilla-signal";
1
+ import { MaybeAccessor, Renderable } from "vanilla-signal";
2
2
  //#region src/utilities/browser.d.ts
3
3
  declare global {
4
4
  interface Navigator {
@@ -566,18 +566,18 @@ interface TooltipProps extends Record<string, unknown> {
566
566
  declare function createTooltip(element: DOMReference, input?: TooltipProps): TooltipInstance;
567
567
  //#endregion
568
568
  //#region src/primitives/toast.d.ts
569
- type ToastType = 'info' | 'success' | 'warning' | 'error' | 'primary';
569
+ type ToastTheme = 'info' | 'success' | 'warning' | 'error' | 'primary';
570
570
  interface ToastClassNames {
571
571
  container: string;
572
572
  toast: string;
573
573
  icon: string;
574
574
  message: string;
575
575
  lite: string;
576
- action: string;
577
- actions: string;
576
+ confirm: string;
577
+ buttons: string;
578
578
  button: string;
579
579
  closeBtn: string;
580
- actionBtn: string;
580
+ confirmBtn: string;
581
581
  info: string;
582
582
  success: string;
583
583
  warning: string;
@@ -585,36 +585,47 @@ interface ToastClassNames {
585
585
  primary: string;
586
586
  }
587
587
  type ToastClassNameConfig = Partial<ToastClassNames>;
588
- interface ToastOptions {
588
+ interface ToastClassNameOptions {
589
589
  className?: ToastClassNameConfig;
590
590
  }
591
- interface ToastActionProps extends ToastOptions {
592
- type?: ToastType;
591
+ interface ToastThemeOptions extends ToastClassNameOptions {
592
+ theme?: ToastTheme;
593
+ }
594
+ interface ToastOptions extends ToastThemeOptions {
595
+ duration?: number;
596
+ loading?: MaybeAccessor<boolean>;
597
+ text?: {
598
+ loading?: string;
599
+ };
600
+ onClose?: () => void | Promise<void>;
601
+ onCancel?: () => void | Promise<void>;
602
+ }
603
+ interface ToastConfirmProps extends ToastThemeOptions {
593
604
  text?: {
594
605
  close?: string;
595
- action?: string;
606
+ confirm?: string;
596
607
  };
597
- onAction?: () => void | Promise<void>;
608
+ onConfirm?: () => void | Promise<void>;
598
609
  onClose?: () => void | Promise<void>;
599
610
  }
600
611
  declare function hide(toast: HTMLElement | null | undefined): void;
601
- declare function show(message?: string, duration?: number, type?: ToastType, options?: ToastOptions): HTMLElement;
602
- declare function lite(message?: string, duration?: number, options?: ToastOptions): HTMLElement;
603
- declare function action(message?: string, props?: ToastActionProps): HTMLElement;
612
+ declare function show(message?: string, options?: ToastOptions): HTMLElement;
613
+ declare function lite(message?: string, duration?: number, className?: ToastClassNameConfig): HTMLElement;
614
+ declare function confirm(message?: string, props?: ToastConfirmProps): HTMLElement;
604
615
  declare function clearAll(): void;
605
616
  declare const Toast: {
606
617
  timers: Set<string>;
607
618
  disposers: Map<HTMLElement, () => void>;
608
- configure(options?: ToastOptions): ToastOptions;
619
+ configure(options?: ToastClassNameOptions): ToastClassNameOptions;
609
620
  show: typeof show;
610
- success: (message?: string, duration?: number, options?: ToastOptions) => HTMLElement;
611
- info: (message?: string, duration?: number, options?: ToastOptions) => HTMLElement;
612
- primary: (message?: string, duration?: number, options?: ToastOptions) => HTMLElement;
613
- warning: (message?: string, duration?: number, options?: ToastOptions) => HTMLElement;
614
- error: (message?: string, duration?: number, options?: ToastOptions) => HTMLElement;
621
+ success: (message?: string, options?: ToastOptions) => HTMLElement;
622
+ info: (message?: string, options?: ToastOptions) => HTMLElement;
623
+ primary: (message?: string, options?: ToastOptions) => HTMLElement;
624
+ warning: (message?: string, options?: ToastOptions) => HTMLElement;
625
+ error: (message?: string, options?: ToastOptions) => HTMLElement;
615
626
  hide: typeof hide;
616
627
  lite: typeof lite;
617
- action: typeof action;
628
+ confirm: typeof confirm;
618
629
  clearAll: typeof clearAll;
619
630
  destroyAll: typeof clearAll;
620
631
  };
@@ -1710,6 +1721,7 @@ declare function createPagination(input?: PaginationProps): Pagination;
1710
1721
  //#region src/components/menu.d.ts
1711
1722
  type MenuType = string | undefined;
1712
1723
  type MenuItemId = string | number;
1724
+ type MenuItemRenderType = 0 | 1 | 2;
1713
1725
  interface MenuClassNames {
1714
1726
  root: string;
1715
1727
  list: string;
@@ -1726,6 +1738,7 @@ type MenuClassNameConfig = Partial<MenuClassNames>;
1726
1738
  interface MenuItem extends Record<string, unknown> {
1727
1739
  id?: MenuItemId;
1728
1740
  title: string | number;
1741
+ type?: MenuItemRenderType;
1729
1742
  url?: string;
1730
1743
  target?: string;
1731
1744
  classes?: string | string[];
@@ -1734,22 +1747,25 @@ interface MenuItem extends Record<string, unknown> {
1734
1747
  interface MenuProps extends Record<string, unknown> {
1735
1748
  type?: MenuType;
1736
1749
  id?: string | null;
1737
- data?: MenuItem[];
1750
+ user?: MaybeAccessor<number>;
1751
+ data?: MaybeAccessor<MenuItem[]>;
1738
1752
  backText?: string;
1739
1753
  className?: MenuClassNameConfig;
1740
1754
  }
1741
1755
  interface ResolvedMenuProps extends Record<string, unknown> {
1742
1756
  type?: MenuType;
1743
1757
  id: string;
1744
- data: MenuItem[];
1758
+ user: MaybeAccessor<number>;
1759
+ data: MaybeAccessor<MenuItem[]>;
1745
1760
  backText: string;
1746
1761
  className: MenuClassNames;
1747
1762
  }
1748
1763
  interface MenuState extends Record<string, unknown> {
1764
+ user: number;
1749
1765
  data: MenuItem[];
1750
1766
  activeKeys: string[];
1751
1767
  }
1752
1768
  type Menu = FunctionalComponent<ResolvedMenuProps, MenuState, HTMLElement>;
1753
1769
  declare function createMenu(input?: MenuProps): Menu;
1754
1770
  //#endregion
1755
- export { ButtonsPosition, CleanupFunction, CollapseMotionController, CollapseTransitionDefinition, ComponentCleanup, ComponentContext, ComponentController, ComponentDefinition, ComponentLifecycleEvent, ComponentListener, ComponentPlugin, ComponentPluginOptions, ComponentProps, ComponentRuntime, ComponentState, ContainerExpect, DOMReference, DropInstance, ElementRef, FieldOption, Flow, FlowAction, FlowBusyHook, FlowBusyStrategy, FlowChangeHook, FlowClassNameConfig, FlowClassNames, FlowCleanup, FlowContext, FlowData, FlowDirection, FlowErrorHook, FlowFinishHook, FlowGoToOptions, FlowGuardHook, FlowLifecycleHook, FlowMoveHook, FlowPayload, FlowProps, FlowRenderContext, FlowSlot, FlowSlotName, FlowSnapshot, FlowState, FlowStep, FlowStepResult, FlowSubscriber, FlowTarget, FlowText, Form, FormButton, FormClassNameConfig, FormClassNames, FormDataRecord, FormDataValue, FormField, FormItem, FormItemNext, FormItemType, FormOption, FormProps, FormValidatorConfig, FunctionalComponent, IEventManager, IconAttributeValue, IconName, IconPathMap, IconProps, KeyedElementRefs, LazyRenderCallback, LazyRenderOptions, LazyRenderTarget, Menu, MenuClassNameConfig, MenuClassNames, MenuItem, MenuItemId, MenuProps, MenuType, Modal, ModalClassNameConfig, ModalClassNames, ModalProps, ModalText, MotionController, NormalizeContext, Offcanvas, OffcanvasAnimate, OffcanvasClassNameConfig, OffcanvasClassNames, OffcanvasContent, OffcanvasDirection, OffcanvasProps, OwnedView, OwnedViewOptions, Pagination, PaginationClassNameConfig, PaginationClassNames, PaginationCount, PaginationPage, PaginationProps, ParabolaInstance, ParamRule, ParamRuleInput, PopupProps, PresenceController, PresenceOptions, PresencePhase, PublicFlowStep, QueryContext, RenderableContent, RequireContainerResult, ResolveContainerResult, ResolveSchema, ResolvedProps, StateSyncOptions, SupportES2022, Swiper, SwiperClassNameConfig, SwiperClassNames, SwiperDataItem, SwiperDataLoader, SwiperDataSource, SwiperProps, SwiperSlideContext, TabContent, TabItem, Tabs, TabsClassNameConfig, TabsClassNames, TabsDirection, TabsDisabled, TabsPanelContext, TabsProps, TabsValue, ThemeClassNameConfig, ThemeClassNames, ThemeConfigKey, ThemeInstance, ThemeOptions, ThemePanelGroup, ThemeResolvedOptions, Toast, ToastActionProps, ToastClassNameConfig, ToastClassNames, ToastOptions, ToastType, TocCurrent, TocItem, TooltipInstance, TransitionDefinition, TransitionTarget, ValidateCondition, ValidatorInstance, addIcons, all, asRenderable, checkModernBrowser, copy, createAccordion, createCollapseTransition, createDrop, createElementRef, createEventManager, createFlow, createForm, createKeyedElementRefs, createLoading, createMenu, createModal, createMotionGroup, createOffcanvas, createOwnedView, createPagination, createParabola, createPopup, createPresence, createScheduledTask, createStateSync, createSticky, createSwiper, createTabs, createTheme, createToc, createTooltip, createTransition, createValidator, defineComponent, flexPosition, getRegistedIconPath, getStoreVersion, getType, icon, iconHtml, iconMarkup, isDomElementValue, isDomNodeValue, isElement, isHtmlElementValue, isMobile, isModernBrowser, isNilValue, isNode, isPlainObject, isRenderableContent, isRenderablePrimitive, isRenderableValue, lazyRender, listen, postJson, q, randomId, removeComponentPlugin, requireContainer, resolveContainer, resolveElement, resolveNode, resolveNodeList, resolveProps, restUrl, stateSnapshot, timer, trackStoreVersion, useComponentPlugin, uuid, validateParam, waitForMotion };
1771
+ export { ButtonsPosition, CleanupFunction, CollapseMotionController, CollapseTransitionDefinition, ComponentCleanup, ComponentContext, ComponentController, ComponentDefinition, ComponentLifecycleEvent, ComponentListener, ComponentPlugin, ComponentPluginOptions, ComponentProps, ComponentRuntime, ComponentState, ContainerExpect, DOMReference, DropInstance, ElementRef, FieldOption, Flow, FlowAction, FlowBusyHook, FlowBusyStrategy, FlowChangeHook, FlowClassNameConfig, FlowClassNames, FlowCleanup, FlowContext, FlowData, FlowDirection, FlowErrorHook, FlowFinishHook, FlowGoToOptions, FlowGuardHook, FlowLifecycleHook, FlowMoveHook, FlowPayload, FlowProps, FlowRenderContext, FlowSlot, FlowSlotName, FlowSnapshot, FlowState, FlowStep, FlowStepResult, FlowSubscriber, FlowTarget, FlowText, Form, FormButton, FormClassNameConfig, FormClassNames, FormDataRecord, FormDataValue, FormField, FormItem, FormItemNext, FormItemType, FormOption, FormProps, FormValidatorConfig, FunctionalComponent, IEventManager, IconAttributeValue, IconName, IconPathMap, IconProps, KeyedElementRefs, LazyRenderCallback, LazyRenderOptions, LazyRenderTarget, Menu, MenuClassNameConfig, MenuClassNames, MenuItem, MenuItemId, MenuItemRenderType, MenuProps, MenuType, Modal, ModalClassNameConfig, ModalClassNames, ModalProps, ModalText, MotionController, NormalizeContext, Offcanvas, OffcanvasAnimate, OffcanvasClassNameConfig, OffcanvasClassNames, OffcanvasContent, OffcanvasDirection, OffcanvasProps, OwnedView, OwnedViewOptions, Pagination, PaginationClassNameConfig, PaginationClassNames, PaginationCount, PaginationPage, PaginationProps, ParabolaInstance, ParamRule, ParamRuleInput, PopupProps, PresenceController, PresenceOptions, PresencePhase, PublicFlowStep, QueryContext, RenderableContent, RequireContainerResult, ResolveContainerResult, ResolveSchema, ResolvedProps, StateSyncOptions, SupportES2022, Swiper, SwiperClassNameConfig, SwiperClassNames, SwiperDataItem, SwiperDataLoader, SwiperDataSource, SwiperProps, SwiperSlideContext, TabContent, TabItem, Tabs, TabsClassNameConfig, TabsClassNames, TabsDirection, TabsDisabled, TabsPanelContext, TabsProps, TabsValue, ThemeClassNameConfig, ThemeClassNames, ThemeConfigKey, ThemeInstance, ThemeOptions, ThemePanelGroup, ThemeResolvedOptions, Toast, ToastClassNameConfig, ToastClassNameOptions, ToastClassNames, ToastConfirmProps, ToastOptions, ToastTheme, ToastThemeOptions, TocCurrent, TocItem, TooltipInstance, TransitionDefinition, TransitionTarget, ValidateCondition, ValidatorInstance, addIcons, all, asRenderable, checkModernBrowser, copy, createAccordion, createCollapseTransition, createDrop, createElementRef, createEventManager, createFlow, createForm, createKeyedElementRefs, createLoading, createMenu, createModal, createMotionGroup, createOffcanvas, createOwnedView, createPagination, createParabola, createPopup, createPresence, createScheduledTask, createStateSync, createSticky, createSwiper, createTabs, createTheme, createToc, createTooltip, createTransition, createValidator, defineComponent, flexPosition, getRegistedIconPath, getStoreVersion, getType, icon, iconHtml, iconMarkup, isDomElementValue, isDomNodeValue, isElement, isHtmlElementValue, isMobile, isModernBrowser, isNilValue, isNode, isPlainObject, isRenderableContent, isRenderablePrimitive, isRenderableValue, lazyRender, listen, postJson, q, randomId, removeComponentPlugin, requireContainer, resolveContainer, resolveElement, resolveNode, resolveNodeList, resolveProps, restUrl, stateSnapshot, timer, trackStoreVersion, useComponentPlugin, uuid, validateParam, waitForMotion };