vanilla-jui 1.7.1 → 1.7.3

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
@@ -253,9 +253,6 @@ declare const restUrl: string;
253
253
  */
254
254
  declare function postJson<T = unknown>(url: string, body: unknown, options?: Omit<RequestInit, 'method' | 'body'>): Promise<T>;
255
255
  //#endregion
256
- //#region src/utilities/locale.d.ts
257
- declare function translate(key: string): string;
258
- //#endregion
259
256
  //#region src/utilities/object.d.ts
260
257
  declare function isPlainObject(value: unknown): boolean;
261
258
  //#endregion
@@ -267,7 +264,7 @@ declare const timer: {
267
264
  };
268
265
  //#endregion
269
266
  //#region src/utilities/types.d.ts
270
- type LooseRecord = Record<string, unknown>;
267
+ type LooseRecord$1 = Record<string, unknown>;
271
268
  type ValueTypeName = string;
272
269
  type TypeRule = ValueTypeName | readonly ValueTypeName[];
273
270
  declare function isNilValue(value: unknown): value is null | undefined;
@@ -281,13 +278,7 @@ type ValidateCondition = ((value: unknown) => boolean) | {
281
278
  test: (value: unknown) => boolean;
282
279
  message?: string;
283
280
  };
284
- interface NormalizeContext<TInput extends LooseRecord = LooseRecord> {
285
- key: string;
286
- input: TInput;
287
- options: LooseRecord;
288
- schema: ResolveSchema<TInput>;
289
- }
290
- interface ParamRule<TInput extends LooseRecord = LooseRecord> {
281
+ interface ParamRule<_TInput extends LooseRecord$1 = LooseRecord$1> {
291
282
  type?: TypeRule;
292
283
  types?: TypeRule;
293
284
  required?: boolean;
@@ -303,20 +294,48 @@ interface ParamRule<TInput extends LooseRecord = LooseRecord> {
303
294
  lessThan?: number;
304
295
  plain?: boolean;
305
296
  items?: ParamRuleInput;
306
- shape?: ResolveSchema;
297
+ shape?: ParamShapeSchema;
307
298
  conditions?: ValidateCondition | readonly ValidateCondition[];
308
299
  validate?: (value: unknown) => boolean;
309
300
  message?: string;
310
- normalize?: (value: unknown, context: NormalizeContext<TInput>) => unknown;
311
301
  default?: unknown;
312
- factory?: boolean;
313
302
  [key: string]: unknown;
314
303
  }
315
- type ParamRuleInput<TInput extends LooseRecord = LooseRecord> = TypeRule | ParamRule<TInput>;
316
- type ResolveSchema<TInput extends LooseRecord = LooseRecord> = Record<string, ParamRuleInput<TInput>>;
317
- type ResolvedProps<TSchema extends object> = LooseRecord & { [Key in keyof TSchema]: unknown; };
318
- declare function validateParam<TInput extends LooseRecord = LooseRecord>(name: string, value: unknown, rule?: ParamRuleInput<TInput>, namespace?: string): unknown;
319
- declare function resolveProps<TInput extends LooseRecord, TSchema extends ResolveSchema<TInput>>(input?: TInput | null | undefined, schema?: TSchema, namespace?: string): TInput & ResolvedProps<TSchema>;
304
+ type ParamRuleInput<TInput extends LooseRecord$1 = LooseRecord$1> = TypeRule | ParamRule<TInput>;
305
+ type ParamShapeSchema<TInput extends LooseRecord$1 = LooseRecord$1> = Record<string, ParamRuleInput<TInput>>;
306
+ declare function validateParam<TInput extends LooseRecord$1 = LooseRecord$1>(name: string, value: unknown, rule?: ParamRuleInput<TInput>, namespace?: string): unknown;
307
+ //#endregion
308
+ //#region src/utilities/merge.d.ts
309
+ type MergeStrategy = 'replace' | 'shallow' | 'deep' | ((defaultValue: unknown, inputValue: unknown, context: MergeContext) => unknown);
310
+ interface MergeContext {
311
+ key: string;
312
+ path: string;
313
+ }
314
+ declare function cloneConfigValue<T>(value: T): T;
315
+ declare function mergeShallowConfig(defaultValue: unknown, inputValue: unknown): unknown;
316
+ declare function mergeDeepConfig(defaultValue: unknown, inputValue: unknown): unknown;
317
+ declare function mergeConfigValue(defaultValue: unknown, inputValue: unknown, strategy: MergeStrategy | undefined, context: MergeContext): unknown;
318
+ //#endregion
319
+ //#region src/utilities/config.d.ts
320
+ type LooseRecord = Record<string, unknown>;
321
+ type ConfigTypeRule = string | readonly string[];
322
+ interface ConfigNormalizeContext<TInput extends LooseRecord = LooseRecord> {
323
+ key: string;
324
+ path: string;
325
+ input: TInput;
326
+ options: LooseRecord;
327
+ schema: ConfigSchema<TInput>;
328
+ }
329
+ interface ConfigRule<TInput extends LooseRecord = LooseRecord> extends Omit<ParamRule<TInput>, 'normalize' | 'shape'> {
330
+ defaultFactory?: () => unknown;
331
+ merge?: MergeStrategy;
332
+ schema?: ConfigSchema;
333
+ normalize?: (value: unknown, context: ConfigNormalizeContext<TInput>) => unknown;
334
+ }
335
+ type ConfigRuleInput<TInput extends LooseRecord = LooseRecord> = ConfigTypeRule | ConfigRule<TInput>;
336
+ type ConfigSchema<TInput extends LooseRecord = LooseRecord> = Record<string, ConfigRuleInput<TInput>>;
337
+ type ResolvedConfig<TSchema extends object> = LooseRecord & { [Key in keyof TSchema]: unknown; };
338
+ declare function resolveConfig<TInput extends LooseRecord, TSchema extends ConfigSchema<TInput>>(input?: TInput | null | undefined, schema?: TSchema, namespace?: string): ResolvedConfig<TSchema>;
320
339
  //#endregion
321
340
  //#region src/utilities/state.d.ts
322
341
  interface StateSyncOptions {
@@ -1854,4 +1873,4 @@ interface MenuState extends Record<string, unknown> {
1854
1873
  type Menu = FunctionalComponent<ResolvedMenuProps, MenuState, HTMLElement>;
1855
1874
  declare function createMenu(input?: MenuProps): Menu;
1856
1875
  //#endregion
1857
- export { ClassNameToken, CleanupFunction, CollapseMotionController, CollapseTransitionDefinition, ComponentCleanup, ComponentContext, ComponentController, ComponentDefinition, ComponentLifecycleEvent, ComponentListener, ComponentPlugin, ComponentPluginOptions, ComponentProps, ComponentRuntime, ComponentState, CompressOptions, 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, FormButtons, FormClassNameConfig, FormClassNames, FormDataRecord, FormDataValue, FormField, FormItem, FormItemNext, FormItemType, FormOption, FormProps, FormText, FormTextConfig, FormValidatorConfig, FunctionalComponent, IEventManager, IconAttributeValue, IconName, IconPathMap, IconProps, ImgCompressInstance, 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, ValidatorClassNameConfig, ValidatorClassNames, ValidatorInstance, addIcons, all, asRenderable, checkModernBrowser, copy, createAccordion, createCollapseTransition, createDrop, createElementRef, createEventManager, createFlow, createForm, createImgCompress, createKeyedElementRefs, createLoading, createMenu, createModal, createMotionGroup, createOffcanvas, createOwnedView, createPagination, createParabola, createPopup, createPresence, createScheduledTask, createStateSync, createSticky, createSwiper, createTabs, createTheme, createToc, createTooltip, createTransition, createValidator, defineComponent, flexPosition, getImgCompressInstance, getRegistedIconPath, getStoreVersion, getType, hashQueryParams, icon, iconHtml, iconMarkup, isDomElementValue, isDomNodeValue, isElement, isHtmlElementValue, isMobile, isModernBrowser, isNilValue, isNode, isPlainObject, isRenderableContent, isRenderablePrimitive, isRenderableValue, joinClasses, lazyRender, listen, postJson, q, randomId, removeComponentPlugin, requireContainer, resetImgCompressInstance, resolveContainer, resolveElement, resolveNode, resolveNodeList, resolveProps, restUrl, stateSnapshot, timer, trackStoreVersion, translate, useComponentPlugin, uuid, validateParam, waitForMotion };
1876
+ export { ClassNameToken, CleanupFunction, CollapseMotionController, CollapseTransitionDefinition, ComponentCleanup, ComponentContext, ComponentController, ComponentDefinition, ComponentLifecycleEvent, ComponentListener, ComponentPlugin, ComponentPluginOptions, ComponentProps, ComponentRuntime, ComponentState, CompressOptions, ConfigNormalizeContext, ConfigRule, ConfigRuleInput, ConfigSchema, 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, FormButtons, FormClassNameConfig, FormClassNames, FormDataRecord, FormDataValue, FormField, FormItem, FormItemNext, FormItemType, FormOption, FormProps, FormText, FormTextConfig, FormValidatorConfig, FunctionalComponent, IEventManager, IconAttributeValue, IconName, IconPathMap, IconProps, ImgCompressInstance, KeyedElementRefs, LazyRenderCallback, LazyRenderOptions, LazyRenderTarget, Menu, MenuClassNameConfig, MenuClassNames, MenuItem, MenuItemId, MenuItemRenderType, MenuProps, MenuType, MergeContext, MergeStrategy, Modal, ModalClassNameConfig, ModalClassNames, ModalProps, ModalText, MotionController, Offcanvas, OffcanvasAnimate, OffcanvasClassNameConfig, OffcanvasClassNames, OffcanvasContent, OffcanvasDirection, OffcanvasProps, OwnedView, OwnedViewOptions, Pagination, PaginationClassNameConfig, PaginationClassNames, PaginationCount, PaginationPage, PaginationProps, ParabolaInstance, ParamRule, ParamRuleInput, ParamShapeSchema, PopupProps, PresenceController, PresenceOptions, PresencePhase, PublicFlowStep, QueryContext, RenderableContent, RequireContainerResult, ResolveContainerResult, ResolvedConfig, 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, ValidatorClassNameConfig, ValidatorClassNames, ValidatorInstance, addIcons, all, asRenderable, checkModernBrowser, cloneConfigValue, copy, createAccordion, createCollapseTransition, createDrop, createElementRef, createEventManager, createFlow, createForm, createImgCompress, createKeyedElementRefs, createLoading, createMenu, createModal, createMotionGroup, createOffcanvas, createOwnedView, createPagination, createParabola, createPopup, createPresence, createScheduledTask, createStateSync, createSticky, createSwiper, createTabs, createTheme, createToc, createTooltip, createTransition, createValidator, defineComponent, flexPosition, getImgCompressInstance, getRegistedIconPath, getStoreVersion, getType, hashQueryParams, icon, iconHtml, iconMarkup, isDomElementValue, isDomNodeValue, isElement, isHtmlElementValue, isMobile, isModernBrowser, isNilValue, isNode, isPlainObject, isRenderableContent, isRenderablePrimitive, isRenderableValue, joinClasses, lazyRender, listen, mergeConfigValue, mergeDeepConfig, mergeShallowConfig, postJson, q, randomId, removeComponentPlugin, requireContainer, resetImgCompressInstance, resolveConfig, resolveContainer, resolveElement, resolveNode, resolveNodeList, restUrl, stateSnapshot, timer, trackStoreVersion, useComponentPlugin, uuid, validateParam, waitForMotion };