vanilla-jui 1.5.12 → 1.5.13
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/README.md +24 -20
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/form.ts +6 -1
- package/src/css/content.css +9 -3
- package/src/css/form.css +17 -17
- package/src/css/tokens.css +5 -5
- package/src/validation/validator.ts +33 -9
package/README.md
CHANGED
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
# JUI Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vanilla-JUI is web UI infrastructure that decouples reactive UI, design tokens, and CSS engineering. It avoids framework lock-in and helps you quickly build high-quality interactive web pages.
|
|
4
4
|
|
|
5
5
|
[中文](README_zh.md)
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- Framework-agnostic: Does not depend on any frontend framework and can be mounted directly in any web page.
|
|
10
|
+
- Fine-grained reactivity: A signal-based fine-grained reactive system drives component state updates through data. Define state, derive computations, and render views.
|
|
11
|
+
- Composable components: Components can be freely composed, with data passed through state references to build complex interactions.
|
|
12
|
+
- 100% custom styling: Supports discarding the built-in styles and using the className mechanism with CSS tools such as Tailwind to fully customize styles.
|
|
13
|
+
- Multi-dimensional themes: A multi-dimensional theme CSS architecture based on design tokens and root-node state makes personalized theme modes easy to implement.
|
|
14
|
+
- Common utilities: Includes common utilities such as ID, Events, Timer, and DOM syntax sugar.
|
|
12
15
|
|
|
13
|
-
## Installation
|
|
16
|
+
## Installation And Usage
|
|
14
17
|
|
|
15
|
-
NPM
|
|
18
|
+
### NPM
|
|
16
19
|
|
|
17
20
|
```bash
|
|
18
21
|
npm install vanilla-jui
|
|
19
22
|
```
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```html
|
|
24
|
-
<script src="https://unpkg.com/vanilla-jui/dist/index.umd.js"></script>
|
|
24
|
+
```js
|
|
25
|
+
import { createModal } from 'vanilla-jui';
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
### CDN
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
UMD global variable: `jui`
|
|
30
31
|
|
|
31
|
-
```
|
|
32
|
-
|
|
32
|
+
```html
|
|
33
|
+
<script src="https://unpkg.com/vanilla-jui/dist/index.umd.js"></script>
|
|
34
|
+
<script>
|
|
35
|
+
const { createModal } = jui;
|
|
36
|
+
</script>
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
```html
|
|
40
|
+
<script type="module">
|
|
41
|
+
import { createModal } from 'https://unpkg.com/vanilla-jui/dist/index.js';
|
|
42
|
+
</script>
|
|
39
43
|
```
|
|
40
44
|
|
|
41
|
-
## Documentation
|
|
45
|
+
## Documentation And Preview
|
|
42
46
|
|
|
43
|
-
[
|
|
47
|
+
[Documentation And Preview](https://app.jealer.com/vanilla-jui/)
|
package/dist/index.d.ts
CHANGED
|
@@ -795,12 +795,18 @@ interface ValidatorProps extends Record<string, unknown> {
|
|
|
795
795
|
rules?: Record<string, ValidatorRule>;
|
|
796
796
|
messages?: ValidatorMessageMap;
|
|
797
797
|
vanilla?: boolean;
|
|
798
|
+
className?: ValidatorClassNameConfig;
|
|
798
799
|
onSubmit?: ((validator: ValidatorInstance) => void) | null;
|
|
799
800
|
}
|
|
801
|
+
interface ValidatorClassNames {
|
|
802
|
+
help: string;
|
|
803
|
+
}
|
|
804
|
+
type ValidatorClassNameConfig = Partial<ValidatorClassNames>;
|
|
800
805
|
interface ResolvedValidatorProps extends Record<string, unknown> {
|
|
801
806
|
rules: Record<string, ValidatorRule>;
|
|
802
807
|
messages: ValidatorMessageMap;
|
|
803
808
|
vanilla: boolean;
|
|
809
|
+
className: ValidatorClassNames;
|
|
804
810
|
onSubmit: ((validator: ValidatorInstance) => void) | null;
|
|
805
811
|
}
|
|
806
812
|
interface ValidatorRuntime {
|
|
@@ -1080,6 +1086,7 @@ interface FormValidatorConfig {
|
|
|
1080
1086
|
rules?: Record<string, Record<string, unknown>>;
|
|
1081
1087
|
messages?: Record<string, Record<string, string>>;
|
|
1082
1088
|
vanilla?: boolean;
|
|
1089
|
+
className?: ValidatorClassNameConfig;
|
|
1083
1090
|
onSubmit?: (() => void) | null;
|
|
1084
1091
|
[key: string]: unknown;
|
|
1085
1092
|
}
|
|
@@ -1771,4 +1778,4 @@ interface MenuState extends Record<string, unknown> {
|
|
|
1771
1778
|
type Menu = FunctionalComponent<ResolvedMenuProps, MenuState, HTMLElement>;
|
|
1772
1779
|
declare function createMenu(input?: MenuProps): Menu;
|
|
1773
1780
|
//#endregion
|
|
1774
|
-
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 };
|
|
1781
|
+
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, ValidatorClassNameConfig, ValidatorClassNames, 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 };
|