vanilla-jui 1.7.1 → 1.7.2
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 +39 -20
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/accordion.ts +6 -12
- package/src/components/flow.ts +17 -26
- package/src/components/form.ts +11 -28
- package/src/components/menu.ts +7 -13
- package/src/components/modal.ts +40 -26
- package/src/components/offcanvas.ts +6 -12
- package/src/components/pagination.ts +10 -24
- package/src/components/swiper.ts +7 -13
- package/src/components/tabs.ts +6 -12
- package/src/components/toc.ts +5 -8
- package/src/index.ts +4 -1
- package/src/primitives/drop.ts +5 -8
- package/src/primitives/parabola.ts +6 -12
- package/src/primitives/popup.ts +3 -3
- package/src/primitives/sticky.ts +3 -3
- package/src/primitives/theme.ts +29 -14
- package/src/primitives/toast.ts +17 -12
- package/src/primitives/tooltip.ts +5 -19
- package/src/utilities/config.ts +158 -0
- package/src/utilities/id.ts +109 -108
- package/src/utilities/merge.ts +97 -0
- package/src/utilities/types.ts +3 -82
- package/src/utilities/validator.ts +6 -17
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
|
|
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?:
|
|
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
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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,
|
|
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 };
|