@zuzjs/ui 0.5.1 → 0.5.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/comps/base.d.ts +3 -1
- package/dist/comps/base.js +38 -4
- package/dist/comps/box.d.ts +2 -5
- package/dist/comps/checkbox.js +3 -3
- package/dist/comps/contextmenu.js +1 -1
- package/dist/comps/form.d.ts +1 -0
- package/dist/comps/form.js +12 -3
- package/dist/comps/heading.d.ts +2 -4
- package/dist/comps/heading.js +4 -2
- package/dist/comps/progressbar.d.ts +11 -0
- package/dist/comps/progressbar.js +14 -0
- package/dist/comps/select.js +4 -5
- package/dist/comps/sheet.d.ts +5 -2
- package/dist/comps/sheet.js +24 -8
- package/dist/comps/tabview.d.ts +6 -2
- package/dist/comps/tabview.js +14 -4
- package/dist/comps/treeview/index.d.ts +28 -0
- package/dist/comps/treeview/index.js +24 -0
- package/dist/comps/treeview/item.d.ts +15 -0
- package/dist/comps/treeview/item.js +23 -0
- package/dist/funs/css.js +2 -2
- package/dist/funs/index.d.ts +7 -1
- package/dist/funs/index.js +110 -0
- package/dist/funs/stylesheet.js +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +1 -1
- package/dist/types/enums.d.ts +17 -0
- package/dist/types/enums.js +21 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/interfaces.d.ts +10 -0
- package/package.json +1 -1
package/dist/comps/base.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType } from "react";
|
|
2
2
|
import { dynamicObject } from "../types";
|
|
3
3
|
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums";
|
|
4
|
+
import { Skeleton } from "../types/interfaces";
|
|
4
5
|
export interface animationProps {
|
|
5
6
|
transition?: TRANSITIONS;
|
|
6
7
|
from?: dynamicObject;
|
|
@@ -13,9 +14,10 @@ export interface animationProps {
|
|
|
13
14
|
interface BaseProps<T extends ElementType> {
|
|
14
15
|
tag?: T;
|
|
15
16
|
as?: string | string[];
|
|
17
|
+
animate?: animationProps;
|
|
16
18
|
className?: string;
|
|
17
19
|
propsToRemove?: string[];
|
|
18
|
-
|
|
20
|
+
skeleton?: Skeleton;
|
|
19
21
|
}
|
|
20
22
|
export type Props<T extends ElementType> = BaseProps<T> & ComponentPropsWithoutRef<T>;
|
|
21
23
|
declare const With: import("react").ForwardRefExoticComponent<Omit<Props<ElementType>, "ref"> & import("react").RefAttributes<Element>>;
|
package/dist/comps/base.js
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import { createElement, forwardRef } from "react";
|
|
2
2
|
import { css, cleanProps } from "../funs";
|
|
3
3
|
import { buildWithStyles, getAnimationCurve, getAnimationTransition } from "../funs/css";
|
|
4
|
-
const
|
|
4
|
+
const buildSkeletonStyle = (s) => {
|
|
5
|
+
const makeValue = (v, unit = `px`) => {
|
|
6
|
+
return v ?
|
|
7
|
+
`string` == typeof v ? v : `${v}${unit}`
|
|
8
|
+
: `inherit`;
|
|
9
|
+
};
|
|
10
|
+
const style = {};
|
|
11
|
+
if (s.radius) {
|
|
12
|
+
style.borderRadius = makeValue(s.radius);
|
|
13
|
+
}
|
|
14
|
+
if (s.size) {
|
|
15
|
+
style.width = style.minWidth = style.maxWidth = style.height = style.minHeight = style.maxHeight = makeValue(s.size);
|
|
16
|
+
}
|
|
17
|
+
else if (s.width || s.height) {
|
|
18
|
+
if (s.width) {
|
|
19
|
+
style.width = style.minWidth = style.maxWidth = makeValue(s.width);
|
|
20
|
+
}
|
|
21
|
+
if (s.height) {
|
|
22
|
+
style.height = style.minHeight = style.maxHeight = makeValue(s.height);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
style.minWidth = style.minHeight = `100%`;
|
|
27
|
+
}
|
|
28
|
+
return style;
|
|
29
|
+
};
|
|
30
|
+
const With = forwardRef(({ tag, as, animate, className, propsToRemove, style, skeleton, ...rest }, ref) => {
|
|
5
31
|
const Comp = tag || 'div';
|
|
6
32
|
let cx = [];
|
|
7
33
|
if (as) {
|
|
@@ -19,14 +45,22 @@ const With = forwardRef(({ tag, as, animate, className, propsToRemove, style, ..
|
|
|
19
45
|
else {
|
|
20
46
|
_style = transition ? getAnimationTransition(transition, false, true) : from || {};
|
|
21
47
|
}
|
|
48
|
+
const { children, ...restProps } = cleanProps(rest, propsToRemove ? [...propsToRemove, `skeleton`] : [`skeleton`]);
|
|
22
49
|
return createElement(Comp, {
|
|
23
50
|
style: {
|
|
24
51
|
...buildWithStyles(_style),
|
|
25
52
|
..._transition,
|
|
26
|
-
...style
|
|
53
|
+
...style,
|
|
54
|
+
...(skeleton?.enabled ? buildSkeletonStyle(skeleton) : {})
|
|
27
55
|
},
|
|
28
|
-
className: [
|
|
29
|
-
|
|
56
|
+
className: [
|
|
57
|
+
className,
|
|
58
|
+
...cx,
|
|
59
|
+
skeleton?.enabled ? `--skeleton` : ``
|
|
60
|
+
].join(' ').trim(),
|
|
61
|
+
children: skeleton?.enabled ? ` `.repeat(6)
|
|
62
|
+
: children,
|
|
63
|
+
...restProps,
|
|
30
64
|
ref
|
|
31
65
|
});
|
|
32
66
|
});
|
package/dist/comps/box.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Box: import("react").ForwardRefExoticComponent<
|
|
3
|
-
as?: string;
|
|
4
|
-
animate?: animationProps;
|
|
5
|
-
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import { BaseProps } from "../types/interfaces";
|
|
2
|
+
declare const Box: import("react").ForwardRefExoticComponent<BaseProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
3
|
export default Box;
|
package/dist/comps/checkbox.js
CHANGED
|
@@ -4,8 +4,8 @@ import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
|
4
4
|
import With from "./base";
|
|
5
5
|
import { CHECKBOX } from "../types/enums";
|
|
6
6
|
const CheckBox = forwardRef((props, ref) => {
|
|
7
|
-
const { as, name, required, type, value, onChange, ...rest } = props;
|
|
8
|
-
const [checked, _setChecked] = useState(
|
|
7
|
+
const { as, name, required, type, value, checked: defaultCheck, onChange, ...rest } = props;
|
|
8
|
+
const [checked, _setChecked] = useState(defaultCheck || false);
|
|
9
9
|
const bRef = useRef(null);
|
|
10
10
|
useImperativeHandle(ref, () => ({
|
|
11
11
|
setChecked(mod, triggerChange = true) {
|
|
@@ -24,7 +24,7 @@ const CheckBox = forwardRef((props, ref) => {
|
|
|
24
24
|
_setChecked(!checked);
|
|
25
25
|
}
|
|
26
26
|
}));
|
|
27
|
-
return _jsx(With, { tag: `label`, className: `${type == CHECKBOX.Default ? `checkbox icon-check` : `zuz-checkbox`} flex aic jcc ${checked ? `is-checked` : ``} rel`.trim(), as: as, ...rest, children: _jsx(With, { tag: `input`, ref: bRef, value: value || `cb`, type: `checkbox`, className: `abs`, name: name, required: required || false, onChange: (e) => {
|
|
27
|
+
return _jsx(With, { tag: `label`, className: `${type == CHECKBOX.Default ? `checkbox icon-check` : `zuz-checkbox`} flex aic jcc ${checked ? `is-checked` : ``} rel`.trim(), as: as, ...rest, children: _jsx(With, { tag: `input`, ref: bRef, defaultChecked: checked, value: value || `cb`, type: `checkbox`, className: `abs`, name: name, required: required || false, onChange: (e) => {
|
|
28
28
|
onChange && onChange(e.target.checked, value || `cb`);
|
|
29
29
|
_setChecked(e.target.checked);
|
|
30
30
|
} }) });
|
|
@@ -3,7 +3,7 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import With from "./base";
|
|
4
4
|
const ContextMenu = forwardRef((props, ref) => {
|
|
5
5
|
const { as, items, ...rest } = props;
|
|
6
|
-
return _jsx(With, { as: as, className: `
|
|
6
|
+
return _jsx(With, { as: as, className: `context-menu abs flex cols`, ...rest, ref: ref, children: items.map((item, index) => item.label == `-` ? _jsx(With, { as: `context-line` }, `${index}-line`) :
|
|
7
7
|
_jsxs(With, { onClick: item.onSelect, as: `button`, className: `context-menu-item flex aic ${item.className || ``}`.trim(), children: [_jsx(With, { as: `div`, className: `ico icon-${item.icon}`.trim(), style: item.iconColor ? { color: item.iconColor } : {} }), _jsx(With, { as: `h1`, className: `flex aic`, style: item.labelColor ? { color: item.labelColor } : {}, children: item.label })] }, `item-${item.label.replace(/\s/g, `-`)}-${index}`)) });
|
|
8
8
|
});
|
|
9
9
|
export default ContextMenu;
|
package/dist/comps/form.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface FormProps {
|
|
|
18
18
|
}
|
|
19
19
|
export interface FormHandler {
|
|
20
20
|
setLoading: (mode: boolean) => void;
|
|
21
|
+
hideError: () => void;
|
|
21
22
|
}
|
|
22
23
|
declare const Form: import("react").ForwardRefExoticComponent<FormProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<FormHandler>>;
|
|
23
24
|
export default Form;
|
package/dist/comps/form.js
CHANGED
|
@@ -19,6 +19,9 @@ const Form = forwardRef((props, ref) => {
|
|
|
19
19
|
if (el.type == `checkbox` && el.checked == false) {
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
|
+
if (el.classList.contains(`--select`) && el.dataset.value == `-1`) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
22
25
|
if (el.value == ``)
|
|
23
26
|
return false;
|
|
24
27
|
}
|
|
@@ -70,9 +73,9 @@ const Form = forwardRef((props, ref) => {
|
|
|
70
73
|
valid = _validate(el);
|
|
71
74
|
data[el.name] = {
|
|
72
75
|
valid: valid,
|
|
73
|
-
value: el.value
|
|
76
|
+
value: el.classList.contains(`--select`) ? el.dataset.value : el.value
|
|
74
77
|
};
|
|
75
|
-
payload[el.name] = el.value;
|
|
78
|
+
payload[el.name] = el.classList.contains(`--select`) ? el.dataset.value : el.value;
|
|
76
79
|
if (!valid) {
|
|
77
80
|
if (_error == null && errors) {
|
|
78
81
|
_error = el;
|
|
@@ -136,13 +139,19 @@ const Form = forwardRef((props, ref) => {
|
|
|
136
139
|
};
|
|
137
140
|
useImperativeHandle(ref, () => ({
|
|
138
141
|
setLoading(mod) {
|
|
142
|
+
if (mod) {
|
|
143
|
+
sheet.current.hide();
|
|
144
|
+
}
|
|
139
145
|
setLoading(mod);
|
|
140
146
|
},
|
|
141
147
|
showError(errorMsg) {
|
|
142
148
|
sheet.current.show(errorMsg, 4, SHEET.Error);
|
|
149
|
+
},
|
|
150
|
+
hideError() {
|
|
151
|
+
sheet.current.hide();
|
|
143
152
|
}
|
|
144
153
|
}));
|
|
145
154
|
useEffect(_init, []);
|
|
146
|
-
return _jsxs(With, { as: as, className: `rel`, ref: _ref, propsToRemove: [`withData`, `action`, `onSubmit`, `onSuccess`, `onError`], ...rest, children: [_jsx(Sheet, { ref: sheet }), loading && _jsx(Cover, { message: cover ? cover.message || undefined : `working`, ...{ spinner, color: cover ? `color` in cover ? cover.color : `#ffffff` : `#ffffff` } }), children] });
|
|
155
|
+
return _jsxs(With, { as: as, className: `rel`, ref: _ref, propsToRemove: [`withData`, `action`, `onSubmit`, `onSuccess`, `onError`], ...rest, children: [_jsx(Sheet, { ref: sheet, as: `toast-form` }), loading && _jsx(Cover, { message: cover ? cover.message || undefined : `working`, ...{ spinner, color: cover ? `color` in cover ? cover.color : `#ffffff` : `#ffffff` } }), children] });
|
|
147
156
|
});
|
|
148
157
|
export default Form;
|
package/dist/comps/heading.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { BaseProps } from "../types/interfaces";
|
|
3
3
|
declare const Heading: import("react").ForwardRefExoticComponent<{
|
|
4
|
-
as?: string;
|
|
5
4
|
h?: number | string;
|
|
6
5
|
html?: ReactNode | string;
|
|
7
|
-
|
|
8
|
-
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
} & BaseProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
7
|
export default Heading;
|
package/dist/comps/heading.js
CHANGED
|
@@ -2,7 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import With from "./base";
|
|
4
4
|
const Heading = forwardRef((props, ref) => {
|
|
5
|
-
const { as, h, html,
|
|
6
|
-
return _jsx(With, { tag: `h${h || 1}`, as: as, ref: ref, ...rest, children: props.
|
|
5
|
+
const { as, h, html, ...rest } = props;
|
|
6
|
+
return _jsx(With, { tag: `h${h || 1}`, as: as, ref: ref, ...rest, children: props.children ?
|
|
7
|
+
props.html ? _jsx("span", { ...({ dangerouslySetInnerHTML: { __html: html } }) }) : props.children
|
|
8
|
+
: null });
|
|
7
9
|
});
|
|
8
10
|
export default Heading;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseProps } from "../types/interfaces";
|
|
2
|
+
import { PROGRESS } from "../types/enums";
|
|
3
|
+
export interface ProgressBarProps {
|
|
4
|
+
progress: number;
|
|
5
|
+
type?: PROGRESS;
|
|
6
|
+
}
|
|
7
|
+
export interface ProgressHandler {
|
|
8
|
+
setWidth?: (w: number) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const ProgressBar: import("react").ForwardRefExoticComponent<ProgressBarProps & BaseProps & import("react").RefAttributes<ProgressHandler>>;
|
|
11
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
3
|
+
import With from "./base";
|
|
4
|
+
const ProgressBar = forwardRef((props, ref) => {
|
|
5
|
+
const { as } = props;
|
|
6
|
+
const bar = useRef(null);
|
|
7
|
+
useImperativeHandle(ref, () => ({
|
|
8
|
+
setWidth: (progress) => {
|
|
9
|
+
bar.current.style.width = `${progress * 100}%`;
|
|
10
|
+
}
|
|
11
|
+
}), []);
|
|
12
|
+
return _jsx(With, { className: `--progress flex rel`, as: as, children: _jsx(With, { ref: bar, className: `--bar rel` }) });
|
|
13
|
+
});
|
|
14
|
+
export default ProgressBar;
|
package/dist/comps/select.js
CHANGED
|
@@ -19,14 +19,13 @@ const Select = forwardRef((props, ref) => {
|
|
|
19
19
|
setChoosing(false);
|
|
20
20
|
});
|
|
21
21
|
}, []);
|
|
22
|
-
return _jsxs(With, { className: `zuz-select-wrap rel`, children: [_jsxs(With, {
|
|
22
|
+
return _jsxs(With, { className: `zuz-select-wrap rel`, children: [_jsxs(With, { "data-value": value ? `string` == typeof value ? value : value.value : value || `-1`, name: name, tag: `button`, as: as, className: `zuz-select rel flex aic --select`, ref: _ref, onClick: (e) => setChoosing(true), ...rest, children: [_jsx(With, { tag: `h2`, className: `zuz-selected`, children: value ? `string` == typeof value ? value : value.label : label || `Choose` }), chevronExpand()] }), _jsx(With, { id: _id, className: `zuz-select-options abs flex cols`, style: {
|
|
23
23
|
pointerEvents: choosing ? `auto` : `none`,
|
|
24
24
|
}, animate: {
|
|
25
|
-
from: {
|
|
26
|
-
to: {
|
|
25
|
+
from: { y: 5, opacity: 0 },
|
|
26
|
+
to: { y: 0, opacity: 1 },
|
|
27
27
|
when: choosing,
|
|
28
|
-
|
|
29
|
-
duration: .4
|
|
28
|
+
duration: .05
|
|
30
29
|
}, children: options.map((o) => _jsx(With, { onClick: (e) => updateValue(o), className: value && (`string` == typeof o ? o : o.value) == (`string` == typeof value ? value : value.value) ? `selected` : ``, tag: `button`, children: `string` == typeof o ? o : o.label }, `option-${(`string` == typeof o ? o : o.label).replace(/\s+/g, `-`)}-${`string` == typeof o ? o : o.value}`)) })] });
|
|
31
30
|
});
|
|
32
31
|
export default Select;
|
package/dist/comps/sheet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { SHEET, TRANSITION_CURVES, TRANSITIONS } from "../types/enums";
|
|
2
|
+
import { SHEET, SHEET_ACTION_POSITION, TRANSITION_CURVES, TRANSITIONS } from "../types/enums";
|
|
3
3
|
import { BaseProps } from "../types/interfaces";
|
|
4
4
|
export interface SheetProps {
|
|
5
5
|
title?: string;
|
|
@@ -8,10 +8,13 @@ export interface SheetProps {
|
|
|
8
8
|
curve?: TRANSITION_CURVES;
|
|
9
9
|
speed?: Number;
|
|
10
10
|
type?: SHEET;
|
|
11
|
+
actionPosition?: SHEET_ACTION_POSITION;
|
|
11
12
|
}
|
|
12
13
|
export interface SheetActionHandler {
|
|
14
|
+
key?: string;
|
|
13
15
|
label: string;
|
|
14
|
-
handler
|
|
16
|
+
handler?: () => void;
|
|
17
|
+
onClick?: () => void;
|
|
15
18
|
}
|
|
16
19
|
export interface SheetHandler {
|
|
17
20
|
showDialog: (title: string | ReactNode, message: string | ReactNode, action?: SheetActionHandler[], onShow?: () => void) => void;
|
package/dist/comps/sheet.js
CHANGED
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
4
|
import With from "./base";
|
|
5
|
-
import { SHEET, TRANSITION_CURVES, TRANSITIONS } from "../types/enums";
|
|
5
|
+
import { SHEET, SHEET_ACTION_POSITION, TRANSITION_CURVES, TRANSITIONS } from "../types/enums";
|
|
6
6
|
import Cover from "./cover";
|
|
7
7
|
import { animationTransition } from "../funs/css";
|
|
8
|
-
import useComponentEditor from "../hooks/useCompEditor";
|
|
9
8
|
import ComponentEditor from "./editor";
|
|
9
|
+
import { uuid } from "../funs";
|
|
10
10
|
let _sheetTimeout = null;
|
|
11
11
|
let _sheetWobbleTimeout = null;
|
|
12
12
|
const Sheet = forwardRef((props, ref) => {
|
|
13
|
-
const { as, transition, curve, speed, editor, type, ...rest } = props;
|
|
14
|
-
const
|
|
13
|
+
const { as, transition, curve, speed, editor, type, actionPosition, ...rest } = props;
|
|
14
|
+
const sheetID = useMemo(() => uuid(), []);
|
|
15
15
|
const [visible, setVisible] = useState(false);
|
|
16
16
|
const [title, setTitle] = useState(``);
|
|
17
17
|
const [msg, setMsg] = useState(``);
|
|
18
18
|
const [action, setAction] = useState(null);
|
|
19
19
|
const [_errorType, setErrorType] = useState(type || SHEET.Default);
|
|
20
20
|
const [loading, setLoading] = useState(false);
|
|
21
|
+
const [render, setRender] = useState(true);
|
|
22
|
+
const _render = useRef(null);
|
|
21
23
|
const divRef = useRef(null);
|
|
22
24
|
const lastTransform = useRef(null);
|
|
23
25
|
useImperativeHandle(ref, () => ({
|
|
@@ -41,7 +43,13 @@ const Sheet = forwardRef((props, ref) => {
|
|
|
41
43
|
setMsg(message);
|
|
42
44
|
setTitle(title);
|
|
43
45
|
if (action)
|
|
44
|
-
setAction(action)
|
|
46
|
+
setAction(action.reduce((ar, b) => {
|
|
47
|
+
ar.push({
|
|
48
|
+
...b,
|
|
49
|
+
key: b.key || uuid()
|
|
50
|
+
});
|
|
51
|
+
return ar;
|
|
52
|
+
}, []));
|
|
45
53
|
setVisible(true);
|
|
46
54
|
setTimeout(() => onShow ? onShow() : () => { }, 1000);
|
|
47
55
|
},
|
|
@@ -167,17 +175,25 @@ const Sheet = forwardRef((props, ref) => {
|
|
|
167
175
|
}
|
|
168
176
|
}), []);
|
|
169
177
|
useEffect(() => {
|
|
170
|
-
|
|
178
|
+
if (_render.current)
|
|
179
|
+
clearTimeout(_render.current);
|
|
180
|
+
if (!visible) {
|
|
181
|
+
_render.current = setTimeout(() => setRender(false), 1000);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
setRender(true);
|
|
185
|
+
}
|
|
186
|
+
}, [visible]);
|
|
171
187
|
if (_errorType == SHEET.Dialog) {
|
|
172
188
|
return _jsxs(_Fragment, { children: [_jsx(With, { "aria-hidden": !visible, className: `zuz-overlay fixed fill`, animate: {
|
|
173
189
|
transition: TRANSITIONS.FadeIn,
|
|
174
190
|
when: visible,
|
|
175
191
|
duration: 0.1,
|
|
176
|
-
} }), _jsxs(With, { animate: buildAnimation(), as: as, className: `zuz-sheet toast-${_errorType.toLowerCase()} fixed`.trim(), ...rest, ref: divRef, children: [_jsx(Cover, { ...({ when: loading }) }), _jsxs(With, { className: `sheet-head flex aic rel`, children: [_jsx(With, { className: `sheet-${title ? `title` : `dot`}`, children: title || `` }), _jsx(With, { tag: `button`, onClick: (e) => setVisible(false), className: `sheet-closer abs`, children: "\u00D7" })] }), _jsx(With, { className: `sheet-body flex aic rel
|
|
192
|
+
} }), _jsxs(With, { animate: buildAnimation(), as: as, className: `zuz-sheet toast-${_errorType.toLowerCase()} fixed`.trim(), ...rest, ref: divRef, children: [_jsx(Cover, { ...({ when: loading }) }), _jsxs(With, { className: `sheet-head flex aic rel`, children: [_jsx(With, { className: `sheet-${title ? `title` : `dot`}`, children: title || `` }), _jsx(With, { tag: `button`, onClick: (e) => setVisible(false), className: `sheet-closer abs`, children: "\u00D7" })] }), _jsx(With, { className: `sheet-body flex aic rel ${action ? `` : `--no-action`}`.trim(), children: render ? msg : null }), action && _jsx(With, { className: `sheet-footer flex aic rel ${actionPosition ? actionPosition == SHEET_ACTION_POSITION.Center ? `jcc` : `` : `jce`}`, children: action.map((a, i) => _jsx(With, { onClick: (e) => a.handler ? a.handler() : a.onClick ? a.onClick() : console.log(`onClick Handler missing`), tag: `button`, as: `sheet-action-btn`, children: a.label }, `sheet-${sheetID}-action-${a.key}`)) })] }), props.editor && visible && _jsx(ComponentEditor, { element: `.zuz-sheet`, title: `Sheet`, attrs: {
|
|
177
193
|
...sheetProps,
|
|
178
194
|
...(_errorType == SHEET.Dialog ? dialogProps : toastProps)
|
|
179
195
|
} })] });
|
|
180
196
|
}
|
|
181
|
-
return _jsx(With, { animate: buildAnimation(), as: as, className: `zuz-sheet toast-${_errorType.toLowerCase()}
|
|
197
|
+
return _jsx(With, { animate: buildAnimation(), as: as, className: `zuz-sheet toast-${_errorType.toLowerCase()} abs`.trim(), ...rest, ref: divRef, children: visible ? msg : null });
|
|
182
198
|
});
|
|
183
199
|
export default Sheet;
|
package/dist/comps/tabview.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BaseProps } from "../types/interfaces";
|
|
3
3
|
export interface Tab {
|
|
4
|
-
onSelect: (index: number) => void;
|
|
5
|
-
|
|
4
|
+
onSelect: (tab: Tab, index: number) => void;
|
|
5
|
+
tag?: string;
|
|
6
|
+
key?: string;
|
|
7
|
+
label: string | ReactNode | ReactNode[];
|
|
6
8
|
body: string | ReactNode | ReactNode[];
|
|
7
9
|
render?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export interface TabViewProps {
|
|
12
|
+
onChange?: (tab: Tab, index: number) => void;
|
|
10
13
|
speed?: number;
|
|
11
14
|
tabs: Tab[];
|
|
15
|
+
prerender?: boolean;
|
|
12
16
|
}
|
|
13
17
|
export interface TabViewHandler {
|
|
14
18
|
setTab: (index: number) => void;
|
package/dist/comps/tabview.js
CHANGED
|
@@ -5,27 +5,37 @@ import { uuid } from "../funs";
|
|
|
5
5
|
import { useResizeObserver } from "../hooks";
|
|
6
6
|
import ComponentEditor from "./editor";
|
|
7
7
|
const TabView = forwardRef((props, ref) => {
|
|
8
|
-
const { as, tabs, speed, ...rest } = props;
|
|
8
|
+
const { as, tabs: _tabs, speed, prerender, onChange, ...rest } = props;
|
|
9
|
+
const tabs = useMemo(() => _tabs.reduce((ts, t) => {
|
|
10
|
+
ts.push({
|
|
11
|
+
...t,
|
|
12
|
+
key: t.key || uuid()
|
|
13
|
+
});
|
|
14
|
+
return ts;
|
|
15
|
+
}, []), [_tabs]);
|
|
9
16
|
const tabview = useRef(null);
|
|
10
17
|
const tabViewID = useMemo(() => uuid(), []);
|
|
11
18
|
const [activeTab, setActiveTab] = useState(0);
|
|
12
19
|
const size = useResizeObserver(tabview);
|
|
20
|
+
const render = useMemo(() => prerender == undefined || prerender == true ? true : false, []);
|
|
13
21
|
const handleTabClick = (index) => {
|
|
14
22
|
setActiveTab(index);
|
|
15
23
|
};
|
|
16
24
|
useEffect(() => {
|
|
25
|
+
onChange && onChange(tabs[0], 0);
|
|
17
26
|
}, []);
|
|
18
27
|
return _jsxs(_Fragment, { children: [_jsxs(With, { ref: tabview, className: `tabview flex cols`, ...rest, children: [_jsx(With, { className: `tab-head flex aic`, children: tabs.map((tab, index) => _jsx(With, { tag: `button`, className: `tab-label rel ${index === activeTab ? 'active' : ''}`.trim(), onClick: () => {
|
|
19
28
|
handleTabClick(index);
|
|
20
|
-
tab.onSelect && tab.onSelect(index);
|
|
21
|
-
|
|
29
|
+
tab.onSelect && tab.onSelect(tab, index);
|
|
30
|
+
onChange && onChange(tab, index);
|
|
31
|
+
}, children: tab.label }, `tab-${tabViewID}-${tab.key}`)) }), _jsx(With, { className: `tab-content rel`, children: _jsx(With, { className: `tabs-track flex aic`, style: { transition: `all ${speed || 0.3}s ease-in-out 0s`, transform: `translate(-${activeTab * size.width}px, 0)` }, children: tabs.map((tab, index) => {
|
|
22
32
|
return _jsx(With, { className: `tab-body rel`, style: {
|
|
23
33
|
width: size.width,
|
|
24
34
|
minWidth: size.width,
|
|
25
35
|
maxWidth: size.width,
|
|
26
36
|
opacity: index === activeTab ? 1 : 0,
|
|
27
37
|
transition: 'opacity 0.5s ease',
|
|
28
|
-
}, children: tab.body }, `tab-body-${tabViewID}-${
|
|
38
|
+
}, children: (render || activeTab == index) && tab.body }, `tab-body-${tabViewID}-${tab.key}`);
|
|
29
39
|
}) }) })] }), props.editor && _jsx(ComponentEditor, { element: `.tabview`, title: `TabView`, attrs: {
|
|
30
40
|
"@group-Head": {
|
|
31
41
|
label: "Head",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseProps } from "../../types/interfaces";
|
|
3
|
+
export interface TreeNodeIcons {
|
|
4
|
+
dirOpen: ReactNode;
|
|
5
|
+
dirClose: ReactNode;
|
|
6
|
+
arrowOpen: ReactNode;
|
|
7
|
+
arrowClose: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface TreeViewProps {
|
|
10
|
+
tag?: string;
|
|
11
|
+
roots: string[];
|
|
12
|
+
nodes: TreeNode[];
|
|
13
|
+
onSelect: (tag: string) => void;
|
|
14
|
+
icons?: TreeNodeIcons;
|
|
15
|
+
selected?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TreeViewHandler {
|
|
18
|
+
getSelected?: () => String;
|
|
19
|
+
}
|
|
20
|
+
export interface TreeNode {
|
|
21
|
+
tag: string;
|
|
22
|
+
label: string;
|
|
23
|
+
under?: string;
|
|
24
|
+
selected?: string;
|
|
25
|
+
expanded?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const TreeView: import("react").ForwardRefExoticComponent<TreeViewProps & BaseProps & import("react").RefAttributes<TreeViewHandler>>;
|
|
28
|
+
export default TreeView;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useState } from "react";
|
|
3
|
+
import With from "../base";
|
|
4
|
+
import TreeItem from "./item";
|
|
5
|
+
const TreeView = forwardRef((props, ref) => {
|
|
6
|
+
const { as, nodes, onSelect, tag: treeViewTag, icons, roots, selected: _selected, ...rest } = props;
|
|
7
|
+
const [selected, setSelected] = useState(_selected);
|
|
8
|
+
useImperativeHandle(ref, () => ({
|
|
9
|
+
getSelected: () => selected
|
|
10
|
+
}), [onSelect]);
|
|
11
|
+
const handleSelect = (tag) => {
|
|
12
|
+
setSelected(tag);
|
|
13
|
+
onSelect && onSelect(tag);
|
|
14
|
+
};
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (selected != _selected) {
|
|
17
|
+
setSelected(_selected);
|
|
18
|
+
}
|
|
19
|
+
}, [_selected]);
|
|
20
|
+
return _jsx(With, { className: `treeview flex cols`, children: nodes
|
|
21
|
+
.filter(node => roots.includes(node.tag))
|
|
22
|
+
.map(node => _jsx(TreeItem, { treeTag: treeViewTag ? `-${treeViewTag}` : ``, selected: selected, onSelect: handleSelect, icons: icons, meta: node, nodes: nodes }, `tree-node-${node.tag}`)) });
|
|
23
|
+
});
|
|
24
|
+
export default TreeView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TreeNode, TreeNodeIcons } from ".";
|
|
2
|
+
import { BaseProps } from "../../types/interfaces";
|
|
3
|
+
export interface TreeItemProps {
|
|
4
|
+
treeTag: string;
|
|
5
|
+
meta: TreeNode;
|
|
6
|
+
nodes: TreeNode[];
|
|
7
|
+
onSelect: (tag: string) => void;
|
|
8
|
+
selected?: String;
|
|
9
|
+
icons?: TreeNodeIcons;
|
|
10
|
+
}
|
|
11
|
+
export interface TreeItemHandler {
|
|
12
|
+
onSelect?: (v: TreeNode) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const TreeItem: import("react").ForwardRefExoticComponent<TreeItemProps & BaseProps & import("react").RefAttributes<TreeItemHandler>>;
|
|
15
|
+
export default TreeItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useState } from "react";
|
|
3
|
+
import With from "../base";
|
|
4
|
+
const TreeItem = forwardRef((props, ref) => {
|
|
5
|
+
const { as, meta, nodes, icons, onSelect, treeTag, selected, ...rest } = props;
|
|
6
|
+
const { tag, label, under } = meta;
|
|
7
|
+
const [isOpen, setIsOpen] = useState(tag == `root`);
|
|
8
|
+
const toggle = () => {
|
|
9
|
+
localStorage.setItem(`--tn${treeTag}-${tag}`, isOpen ? `0` : `1`);
|
|
10
|
+
setIsOpen(!isOpen);
|
|
11
|
+
};
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (tag == `root` && !localStorage.getItem(`--tn${treeTag}-${tag}`)) {
|
|
14
|
+
localStorage.setItem(`--tn${treeTag}-${tag}`, `1`);
|
|
15
|
+
setIsOpen(true);
|
|
16
|
+
}
|
|
17
|
+
else
|
|
18
|
+
setIsOpen(localStorage.getItem(`--tn${treeTag}-${tag}`) == `1`);
|
|
19
|
+
}, []);
|
|
20
|
+
const _nodes = nodes.filter(x => x.under == tag);
|
|
21
|
+
return _jsxs(With, { as: `tree-node tree-node-${tag} flex cols`, children: [_jsxs(With, { as: `--node --node-${tag} flex aic${selected == tag ? ` --selected` : ``}`, children: [_jsx(With, { tag: `button`, onClick: toggle, className: `--node-aro-btn`, children: _jsx(With, { className: `--node-aro-icon icon-${isOpen ? icons?.arrowOpen : icons?.arrowClose}` }) }), _jsxs(With, { tag: `button`, className: `--node-meta flex aic`, onClick: (e) => onSelect(tag), children: [_jsx(With, { className: `--node-icon icon-${isOpen ? icons?.dirOpen : icons?.dirClose}` }), _jsx(With, { tag: `h1`, className: `--node-label`, children: label })] })] }), isOpen && _nodes.length > 0 && _jsx(With, { className: `--sub-node tree-sub-node-${tag} flex cols`, children: _nodes.map(node => _jsx(TreeItem, { treeTag: treeTag, selected: selected, onSelect: onSelect, icons: icons, meta: node, nodes: nodes }, `tree-node-${node.tag}`)) })] });
|
|
22
|
+
});
|
|
23
|
+
export default TreeItem;
|
package/dist/funs/css.js
CHANGED
|
@@ -55,7 +55,7 @@ class CSS {
|
|
|
55
55
|
"@before", "@after", "@active", "@checked", "@default", "@disabled", "@empty", "@enabled", "@first", "@firstChild", "@firstOfType", "@focus", "@hover", "@indeterminate", "@inRange", "@invalid", "@lastChild", "@lastOfType", "@link", "@not", "@nthChild", "@nthLastChild", "@nthLastOfType", "@nthOfType", "@onlyChild", "@onlyOfType", "@optional", "@outOfRange", "@readOnly", "@readWrite", "@required", "@root", "@scope", "@target", "@valid", "@visited"
|
|
56
56
|
];
|
|
57
57
|
this.IGNORE = [
|
|
58
|
-
`flex`, `opacity`, `z-index`, `zIndex`, `color`, `line-height`, `anim`, `scale`
|
|
58
|
+
`flex`, `opacity`, `z-index`, `zIndex`, `color`, `line-height`, `anim`, `scale`, `saturate`
|
|
59
59
|
];
|
|
60
60
|
this.keysWithoutCommaToSpace = [
|
|
61
61
|
`transform`, `translate`, `color`, `background`, `background-color`, `backgroundColor`,
|
|
@@ -546,7 +546,7 @@ class CSS {
|
|
|
546
546
|
_out = _out.replace(`;`, `${important};`);
|
|
547
547
|
}
|
|
548
548
|
else {
|
|
549
|
-
const __value = `${val}${key
|
|
549
|
+
const __value = `${val}${self.IGNORE.includes(key) ? `` : self.makeUnit(key, val)}`;
|
|
550
550
|
_out = self.DIRECT[key].includes(`__VALUE__`) ?
|
|
551
551
|
self.DIRECT[key].replace(/__VALUE__/g, __value).replace(`;`, `${important};`) : self.DIRECT[key];
|
|
552
552
|
}
|
package/dist/funs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import CSS from './css.js';
|
|
2
|
-
import { dynamicObject } from "../types/index.js";
|
|
2
|
+
import { dynamicObject, sortOptions } from "../types/index.js";
|
|
3
3
|
import { FormatNumberParams } from "../types/interfaces.js";
|
|
4
4
|
export declare const __SALT: string;
|
|
5
5
|
export declare const FIELNAME_KEY = "__FILENAME__";
|
|
@@ -9,6 +9,10 @@ export declare const fromHash: (n: string) => number;
|
|
|
9
9
|
export declare const css: () => CSS;
|
|
10
10
|
export declare const uuid: (len?: number) => string;
|
|
11
11
|
export declare const numberInRange: (min: number, max: number) => number;
|
|
12
|
+
export declare const toLowerCase: {
|
|
13
|
+
(locales?: string | string[]): string;
|
|
14
|
+
(locales?: Intl.LocalesArgument): string;
|
|
15
|
+
};
|
|
12
16
|
export declare const hexColorRegex: RegExp;
|
|
13
17
|
export declare const rgbaColorRegex: RegExp;
|
|
14
18
|
export declare const hslColorRegex: RegExp;
|
|
@@ -35,4 +39,6 @@ export declare const withTime: (fun: (...args: any[]) => any) => {
|
|
|
35
39
|
export declare const time: (stamp?: number, format?: string) => string;
|
|
36
40
|
export declare const arrayRand: (arr: any[]) => any;
|
|
37
41
|
export declare const formatNumber: ({ number, locale, style, decimal, currency }: FormatNumberParams) => string;
|
|
42
|
+
export declare const formatSize: (bytes: number | string) => string;
|
|
38
43
|
export declare const copyToClipboard: (text: string) => Promise<unknown>;
|
|
44
|
+
export declare const natsort: (options?: sortOptions) => (a: string | number, b: string | number) => number;
|
package/dist/funs/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import Hashids from "hashids";
|
|
|
6
6
|
import { nanoid } from "nanoid";
|
|
7
7
|
import Cookies from "js-cookie";
|
|
8
8
|
import moment from "moment";
|
|
9
|
+
import { SORT } from "../types/enums.js";
|
|
9
10
|
let __css;
|
|
10
11
|
export const __SALT = `zuzjs-ui`;
|
|
11
12
|
export const FIELNAME_KEY = `__FILENAME__`;
|
|
@@ -17,6 +18,7 @@ export const uuid = (len) => nanoid(len);
|
|
|
17
18
|
export const numberInRange = (min, max) => {
|
|
18
19
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
19
20
|
};
|
|
21
|
+
export const toLowerCase = String.prototype.toLocaleLowerCase || String.prototype.toLowerCase;
|
|
20
22
|
export const hexColorRegex = /^#([A-Fa-f0-9]{3}){1,2}$/;
|
|
21
23
|
export const rgbaColorRegex = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*((0|1|0?\.\d+)\s*))?\)$/;
|
|
22
24
|
export const hslColorRegex = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/;
|
|
@@ -59,6 +61,9 @@ export const cleanProps = (props, withProps = []) => {
|
|
|
59
61
|
delete _props[k];
|
|
60
62
|
}
|
|
61
63
|
});
|
|
64
|
+
if (`skeleton` in _extras && _extras.skeleton.enabled == true) {
|
|
65
|
+
delete _props[`children`];
|
|
66
|
+
}
|
|
62
67
|
_extras.map(x => x in _props && delete _props[x]);
|
|
63
68
|
return _props;
|
|
64
69
|
};
|
|
@@ -190,6 +195,16 @@ export const formatNumber = ({ number, locale = 'en-US', style = `decimal`, deci
|
|
|
190
195
|
maximumFractionDigits: +number % 1 > 0 ? 2 : 0
|
|
191
196
|
}).format(+number);
|
|
192
197
|
};
|
|
198
|
+
export const formatSize = (bytes) => {
|
|
199
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
200
|
+
const _bytes = `string` == typeof bytes ? parseFloat(bytes) : bytes;
|
|
201
|
+
if (_bytes == 0)
|
|
202
|
+
return '0 Byte';
|
|
203
|
+
const _i = Math.floor(Math.log(_bytes) / Math.log(1024));
|
|
204
|
+
const i = `string` == typeof _i ? parseInt(_i) : _i;
|
|
205
|
+
const nx = _bytes / Math.pow(1024, i);
|
|
206
|
+
return nx.toFixed(2) + ' ' + sizes[i];
|
|
207
|
+
};
|
|
193
208
|
export const copyToClipboard = (text) => {
|
|
194
209
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
195
210
|
return navigator.clipboard.writeText(text);
|
|
@@ -213,3 +228,98 @@ export const copyToClipboard = (text) => {
|
|
|
213
228
|
});
|
|
214
229
|
}
|
|
215
230
|
};
|
|
231
|
+
export const natsort = (options = {
|
|
232
|
+
direction: SORT.Asc,
|
|
233
|
+
caseSensitive: false,
|
|
234
|
+
}) => {
|
|
235
|
+
const ore = /^0/;
|
|
236
|
+
const sre = /\s+/g;
|
|
237
|
+
const tre = /^\s+|\s+$/g;
|
|
238
|
+
const ure = /[^\x00-\x80]/;
|
|
239
|
+
const hre = /^0x[0-9a-f]+$/i;
|
|
240
|
+
const nre = /(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g;
|
|
241
|
+
const dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/;
|
|
242
|
+
const GREATER = options.direction == SORT.Desc ? -1 : 1;
|
|
243
|
+
const SMALLER = -GREATER;
|
|
244
|
+
const _normalize = !options.caseSensitive
|
|
245
|
+
? (s) => toLowerCase.call(`${s}`).replace(tre, '')
|
|
246
|
+
: (s) => (`${s}`).replace(tre, '');
|
|
247
|
+
const _tokenize = (s) => {
|
|
248
|
+
return s.replace(nre, '\0$1\0')
|
|
249
|
+
.replace(/\0$/, '')
|
|
250
|
+
.replace(/^\0/, '')
|
|
251
|
+
.split('\0');
|
|
252
|
+
};
|
|
253
|
+
const _parse = (s, l) => {
|
|
254
|
+
return (!s.match(ore) || l === 1) &&
|
|
255
|
+
parseFloat(s)
|
|
256
|
+
|| s.replace(sre, ' ').replace(tre, '')
|
|
257
|
+
|| 0;
|
|
258
|
+
};
|
|
259
|
+
return function (a, b) {
|
|
260
|
+
const aa = _normalize(a);
|
|
261
|
+
const bb = _normalize(b);
|
|
262
|
+
if (!aa && !bb) {
|
|
263
|
+
return 0;
|
|
264
|
+
}
|
|
265
|
+
if (!aa && bb) {
|
|
266
|
+
return SMALLER;
|
|
267
|
+
}
|
|
268
|
+
if (aa && !bb) {
|
|
269
|
+
return GREATER;
|
|
270
|
+
}
|
|
271
|
+
const aArr = _tokenize(aa);
|
|
272
|
+
const bArr = _tokenize(bb);
|
|
273
|
+
const aHex = aa.match(hre);
|
|
274
|
+
const bHex = bb.match(hre);
|
|
275
|
+
const av = (aHex && bHex) ? parseInt(aHex[0], 16) : (aArr.length !== 1 && Date.parse(aa));
|
|
276
|
+
const bv = (aHex && bHex)
|
|
277
|
+
? parseInt(bHex[0], 16)
|
|
278
|
+
: av && bb.match(dre) && Date.parse(bb) || null;
|
|
279
|
+
if (bv) {
|
|
280
|
+
if (av === bv) {
|
|
281
|
+
return 0;
|
|
282
|
+
}
|
|
283
|
+
if (typeof av === 'number' && typeof bv === 'number' && av < bv) {
|
|
284
|
+
return SMALLER;
|
|
285
|
+
}
|
|
286
|
+
if (typeof av === 'number' && av > bv) {
|
|
287
|
+
return GREATER;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const al = aArr.length;
|
|
291
|
+
const bl = bArr.length;
|
|
292
|
+
for (let i = 0, l = Math.max(al, bl); i < l; i += 1) {
|
|
293
|
+
const af = _parse(aArr[i] || '', al);
|
|
294
|
+
const bf = _parse(bArr[i] || '', bl);
|
|
295
|
+
if (isNaN(af) !== isNaN(bf)) {
|
|
296
|
+
return isNaN(af) ? GREATER : SMALLER;
|
|
297
|
+
}
|
|
298
|
+
if (ure.test(af + bf) && af.localeCompare) {
|
|
299
|
+
const comp = af.localeCompare(bf);
|
|
300
|
+
if (comp > 0) {
|
|
301
|
+
return GREATER;
|
|
302
|
+
}
|
|
303
|
+
if (comp < 0) {
|
|
304
|
+
return SMALLER;
|
|
305
|
+
}
|
|
306
|
+
if (i === l - 1) {
|
|
307
|
+
return 0;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (af < bf) {
|
|
311
|
+
return SMALLER;
|
|
312
|
+
}
|
|
313
|
+
if (af > bf) {
|
|
314
|
+
return GREATER;
|
|
315
|
+
}
|
|
316
|
+
if (`${af}` < `${bf}`) {
|
|
317
|
+
return SMALLER;
|
|
318
|
+
}
|
|
319
|
+
if (`${af}` > `${bf}`) {
|
|
320
|
+
return GREATER;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return 0;
|
|
324
|
+
};
|
|
325
|
+
};
|
package/dist/funs/stylesheet.js
CHANGED
|
@@ -292,6 +292,7 @@ export const cssDirect = {
|
|
|
292
292
|
"block": "display: block;",
|
|
293
293
|
"inlineblock": "display: inline-block;",
|
|
294
294
|
"blur": "filter: blur(__VALUE__);",
|
|
295
|
+
"saturate": "filter: saturate(__VALUE__);",
|
|
295
296
|
"ratio": "aspect-ratio: __VALUE__;",
|
|
296
297
|
"center-h": "left: 50%;transform: translateX(-50%);",
|
|
297
298
|
"center-v": "top: 50%;transform: translateY(-50%);",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { withZuz as css } from './funs';
|
|
2
2
|
export * from "./funs";
|
|
3
3
|
export * from "./hooks";
|
|
4
|
+
export * from "./types/enums";
|
|
4
5
|
export { default as PubSub } from "./funs/events";
|
|
5
6
|
export { default as Box } from "./comps/box";
|
|
6
7
|
export { default as Button } from "./comps/button";
|
|
@@ -14,9 +15,10 @@ export { default as Text } from "./comps/heading";
|
|
|
14
15
|
export { default as Icon } from "./comps/icon";
|
|
15
16
|
export { default as Image } from "./comps/image";
|
|
16
17
|
export { default as Input } from "./comps/input";
|
|
18
|
+
export { default as ProgressBar } from "./comps/progressbar";
|
|
17
19
|
export { default as Select } from "./comps/select";
|
|
18
20
|
export { default as Sheet } from "./comps/sheet";
|
|
19
21
|
export { default as Spinner } from "./comps/spinner";
|
|
20
22
|
export { default as TabView } from "./comps/tabview";
|
|
21
23
|
export { default as TextWheel } from "./comps/textwheel";
|
|
22
|
-
export {
|
|
24
|
+
export { default as TreeView } from "./comps/treeview";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { withZuz as css } from './funs';
|
|
2
2
|
export * from "./funs";
|
|
3
3
|
export * from "./hooks";
|
|
4
|
+
export * from "./types/enums";
|
|
4
5
|
export { default as PubSub } from "./funs/events";
|
|
5
6
|
export { default as Box } from "./comps/box";
|
|
6
7
|
export { default as Button } from "./comps/button";
|
|
@@ -14,9 +15,10 @@ export { default as Text } from "./comps/heading";
|
|
|
14
15
|
export { default as Icon } from "./comps/icon";
|
|
15
16
|
export { default as Image } from "./comps/image";
|
|
16
17
|
export { default as Input } from "./comps/input";
|
|
18
|
+
export { default as ProgressBar } from "./comps/progressbar";
|
|
17
19
|
export { default as Select } from "./comps/select";
|
|
18
20
|
export { default as Sheet } from "./comps/sheet";
|
|
19
21
|
export { default as Spinner } from "./comps/spinner";
|
|
20
22
|
export { default as TabView } from "./comps/tabview";
|
|
21
23
|
export { default as TextWheel } from "./comps/textwheel";
|
|
22
|
-
export {
|
|
24
|
+
export { default as TreeView } from "./comps/treeview";
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,*::before,*::after{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}button{user-select:none;cursor:pointer}input{user-select:none}input:-webkit-autofill{background-color:rgba(0,0,0,0) !important;-webkit-box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset;box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset}[aria-hidden=true]{user-select:none;pointer-events:none;cursor:auto}[popover]{margin:0;padding:0;border:0}:root{--basic: ease;--back: linear( 0, -0.0077 5.2%, -0.0452 16.98%, -0.0493 22.35%, -0.0418 25.57%, -0.0258 28.57%, -0.0007 31.42%, 0.0335 34.15%, 0.1242 39.03%, 0.2505 43.65%, 0.3844 47.35%, 0.656 53.68%, 0.81 58.37%, 0.9282 63.52%, 0.9719 66.23%, 1.0055 69.04%, 1.0255 71.4%, 1.0396 73.87%, 1.0477 76.48%, 1.05 79.27%, 1.0419 84.36%, 1.0059 95.49%, 1 );--expo: linear( 0, 0.0053 17.18%, 0.0195 26.59%, 0.0326 30.31%, 0.0506 33.48%, 0.0744 36.25%, 0.1046 38.71%, 0.1798 42.62%, 0.2846 45.93%, 0.3991 48.37%, 0.6358 52.29%, 0.765 55.45%, 0.8622 59.3%, 0.8986 61.51%, 0.9279 63.97%, 0.9481 66.34%, 0.9641 69.01%, 0.9856 75.57%, 0.9957 84.37%, 1 );--sine: linear( 0, 0.007 5.35%, 0.0282 10.75%, 0.0638 16.26%, 0.1144 21.96%, 0.1833 28.16%, 0.2717 34.9%, 0.6868 62.19%, 0.775 68.54%, 0.8457 74.3%, 0.9141 81.07%, 0.9621 87.52%, 0.9905 93.8%, 1 );--power: linear( 0, 0.0012 14.95%, 0.0089 22.36%, 0.0297 28.43%, 0.0668 33.43%, 0.0979 36.08%, 0.1363 38.55%, 0.2373 43.07%, 0.3675 47.01%, 0.5984 52.15%, 0.7121 55.23%, 0.8192 59.21%, 0.898 63.62%, 0.9297 66.23%, 0.9546 69.06%, 0.9733 72.17%, 0.9864 75.67%, 0.9982 83.73%, 1 );--circ: linear( -0, 0.0033 5.75%, 0.0132 11.43%, 0.0296 16.95%, 0.0522 22.25%, 0.0808 27.25%, 0.1149 31.89%, 0.1542 36.11%, 0.1981 39.85%, 0.2779 44.79%, 0.3654 48.15%, 0.4422 49.66%, 0.5807 50.66%, 0.6769 53.24%, 0.7253 55.37%, 0.7714 58.01%, 0.8142 61.11%, 0.8536 64.65%, 0.9158 72.23%, 0.9619 80.87%, 0.9904 90.25%, 1 );--bounce: linear( 0, 0.0039, 0.0157, 0.0352, 0.0625 9.09%, 0.1407, 0.25, 0.3908, 0.5625, 0.7654, 1, 0.8907, 0.8125 45.45%, 0.7852, 0.7657, 0.7539, 0.75, 0.7539, 0.7657, 0.7852, 0.8125 63.64%, 0.8905, 1 72.73%, 0.9727, 0.9532, 0.9414, 0.9375, 0.9414, 0.9531, 0.9726, 1, 0.9883, 0.9844, 0.9883, 1 );--elastic: linear( 0, 0.0009 8.51%, -0.0047 19.22%, 0.0016 22.39%, 0.023 27.81%, 0.0237 30.08%, 0.0144 31.81%, -0.0051 33.48%, -0.1116 39.25%, -0.1181 40.59%, -0.1058 41.79%, -0.0455, 0.0701 45.34%, 0.9702 55.19%, 1.0696 56.97%, 1.0987 57.88%, 1.1146 58.82%, 1.1181 59.83%, 1.1092 60.95%, 1.0057 66.48%, 0.986 68.14%, 0.9765 69.84%, 0.9769 72.16%, 0.9984 77.61%, 1.0047 80.79%, 0.9991 91.48%, 1 );--ease: var(--back);--max-z-index: 2147483647;--text-wheel-speed: 2;--text-wheel-transition: translate calc(var(--text-wheel-speed) * 1s) var(--ease);--checkbox-check-color: #fff;--checkbox-check-size: 13px;--checkbox-size: 17px;--checkbox-radius: 6px;--checkbox-checked: rgb(46, 161, 42);--checkbox-unchecked: rgb(203, 203, 203);--checkbox-thumb: #fff;--checkbox-thumb-shadow: #000;--checkbox-thumb-shadow-size: 2px;--select: #fff;--select-options: #fff;--select-option-font-size: 16px;--select-hover: #eee;--select-selected: #ddd;--select-padding: 6px 8px;--select-radius: 5px;--cover-bg: rgba(255,255,255,0.8);--cover-label: #111;--zuz-overlay: rgba(0, 0, 0, 0.7);--zuz-overlay-blur: 0;--drawer-color: #fff;--drawer-handle-color: #ccc;--drawer-radius-v: 0px;--drawer-radius-h: 0px;--tab-head: #fff;--tab-head-padding: 3px 3px 0px 3px;--tab-head-radius: 6px 6px 0px 0px;--tab: #eee;--tab-active: #ccc;--tab-active-color: #111;--tab-hover: #ddd;--tab-color: #111;--tab-radius: 5px 5px 0px 0px;--tab-padding: 5px 20px;--tab-body: #fff;--tab-body-radius: 0px 5px 5px 5px;--tab-body-padding: 0px;--tab-border: 1px #ddd solid;--sheet-bg: #fff;--sheet-radius: 10px;--sheet-padding: 6px 12px;--sheet-head-padding: 10px;--sheet-body-padding: 10px;--sheet-footer: #ddd;--sheet-footer-padding: 10px;--sheet-action: #222;--sheet-action-color: #fff;--sheet-action-hover: #333;--sheet-action-radius: 7px;--sheet-action-padding: 7px 20px;--sheet-action-font-size: 16px;--sheet-action-font-weight: bold;--sheet-closer-color: #111;--sheet-closer-hover: rgba(255,255,255,0.2);--sheet-closer-opacity: 0.75;--sheet-closer-hover-opacity: 1;--sheet-font-size: 15px;--sheet-title-opacity: 0.75;--sheet-title-font-size: 16px;--sheet-closer-font-size: 36px;--sheet-error: #ff4747;--sheet-warn: #ffba00;--sheet-success: #23ac28}.flex{display:flex}.flex.cols{flex-direction:column}.flex.aic{align-items:center}.flex.jcc{justify-content:center}.abs{position:absolute}.fixed{position:fixed}.fill{top:0px;left:0px;bottom:0px;right:0px}.fillx{top:-10px;left:-10px;bottom:-10px;right:-10px}.grid{display:grid}.nope{pointer-events:none}.nous{user-select:none}.rel{position:relative}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-with-error{box-shadow:inset 0px 0px 0px 1px #ff8b8b}button.ico-btn{gap:5px}button .b-label{flex:1}.checkbox{height:var(--checkbox-size);width:var(--checkbox-size);cursor:pointer;border:1px var(--checkbox-unchecked) solid;border-radius:var(--checkbox-radius);overflow:hidden}.checkbox input[type=checkbox]{z-index:0;opacity:0}.checkbox:before{font-size:var(--checkbox-check-size);color:var(--checkbox-check-color);opacity:0}.checkbox.is-checked{background-color:var(--checkbox-checked);border:1px var(--checkbox-checked) solid}.checkbox.is-checked:before{opacity:1}.zuz-checkbox{height:25px;width:45px;cursor:pointer}.zuz-checkbox input[type=checkbox]{z-index:0;left:10px;top:10px;opacity:0}.zuz-checkbox:before{content:"";position:absolute;width:45px;height:25px;background:var(--checkbox-unchecked);border-radius:50px;z-index:1;transition:all .3s linear 0s}.zuz-checkbox:after{content:"";position:absolute;width:21px;height:21px;background:var(--checkbox-thumb);border-radius:50px;z-index:2;top:2px;left:2px;box-shadow:0px 0px --checkbox-thumb-shadow-size --checkbox-thumb-shadow;transition:all .2s linear 0s}.zuz-checkbox.is-checked:before{box-shadow:inset 0px 0px 0px 15px var(--checkbox-checked)}.zuz-checkbox.is-checked:after{transform:translateX(20px)}.zuz-spinner{animation:spin infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.zuz-cover{backdrop-filter:blur(4px);z-index:99999;gap:15px}.zuz-cover .label{font-size:14px;animation:breath 1s linear infinite}@keyframes breath{0%{opacity:.5}50%{opacity:1}100%{opacity:.5}}.zuz-toast,.zuz-sheet.toast-warn,.zuz-sheet.toast-success,.zuz-sheet.toast-error,.zuz-sheet.toast-default{border-radius:var(--sheet-radius);padding:var(--sheet-padding);font-size:var(--sheet-font-size);white-space:pre}.zuz-sheet{top:50%;left:50%;transform:translate(-50%, -50%);z-index:2147483645;transform-origin:top left;transition:all .5s cubic-bezier(0.2, -0.36, 0, 1.46) 0s}.zuz-sheet.wobble{transform-origin:inherit !important}.zuz-sheet.toast-default{background:#333;color:#fff;top:10px !important}.zuz-sheet.toast-error{background:var(--sheet-error);color:#fff;top:10px}.zuz-sheet.toast-success{background:var(--sheet-success);color:#fff;top:10px}.zuz-sheet.toast-warn{background:var(--sheet-warn);color:#111;top:10px}.zuz-sheet.toast-dialog{background:var(--sheet-bg);border-radius:var(--sheet-radius);overflow:hidden}.zuz-sheet .sheet-head{padding:var(--sheet-head-padding)}.zuz-sheet .sheet-head .sheet-title{flex:1;font-size:var(--sheet-title-font-size);opacity:var(--sheet-title-opacity);text-align:center;padding:0px 45px;display:flex;align-items:center;justify-content:center}.zuz-sheet .sheet-head .sheet-dot{flex:1}.zuz-sheet .sheet-head .sheet-closer{width:32px;height:32px;cursor:pointer;font-size:var(--sheet-closer-font-size);color:var(--sheet-closer-color);background:rgba(0,0,0,0);border:0px;line-height:0;padding:0px;font-weight:normal;border-radius:20px;opacity:var(--sheet-closer-opacity);top:15px;right:5px;transform:translateY(-50%);font-size:var(--sheet-closer-font-size)}.zuz-sheet .sheet-head .sheet-closer:hover{background:var(--sheet-closer-hover);opacity:var(--sheet-closer-hover-opacity)}.zuz-sheet .sheet-body{padding:var(--sheet-body-padding)}.zuz-sheet .sheet-footer{padding:var(--sheet-footer-padding);background:var(--sheet-footer)}.zuz-sheet .sheet-footer .sheet-action-btn{background:var(--sheet-action);color:var(--sheet-action-color);border-radius:var(--sheet-action-radius);padding:var(--sheet-action-padding);font-size:var(--sheet-action-font-size);font-weight:var(--sheet-action-font-weight);border:0px}.zuz-sheet .sheet-footer .sheet-action-btn:hover{background:var(--sheet-action-hover)}.zuz-sheet-overlay{background:rgba(0,0,0,.7);z-index:111;backdrop-filter:blur(10px)}.zuz-context-menu{z-index:99;background:var(--context-background);border-radius:var(--context-radius);padding:10px;box-shadow:var(--context-shadow)}.zuz-context-menu .context-line{height:1px;background:var(--context-seperator);margin:3px 6px}.zuz-context-menu .context-menu-item{width:220px;padding:6px 10px;gap:10px;cursor:pointer;font-size:var(--context-label-size);border-radius:var(--context-radius)}.zuz-context-menu .context-menu-item .ico{font-size:var(--context-icon-size)}.zuz-context-menu .context-menu-item:hover{background:var(--context-hover)}@position-try --zuz-select-bottom{top:anchor(bottom);bottom:unset;margin-block:calc(var(--zuz-select-height) + var(--zuz-select-gap)) 0}.zuz-selectk-wrap{width:100%}.zuz-select{width:100%;gap:5px;background:var(--select);border-radius:var(--select-radius);border:0px;padding:12px 15px;anchor-name:--zuz-select-anchor}.zuz-select:hover{background:var(--select-hover)}.zuz-select .zuz-selected{flex:1;text-align:left}.zuz-select-options{--zuz-select-height: 30px;--zuz-select-gap: 0px;position-anchor:--zuz-select-anchor;position-try:most-height --zuz-select-bottom;width:100%;max-height:400px;overflow-x:hidden;gap:2px;background:var(--select-options);border-radius:var(--select-radius);padding:4px 0px}.zuz-select-options button{background:rgba(0,0,0,0);border:0px;text-align:left;padding:var(--select-padding);border-radius:var(--select-radius);font-size:var(--select-option-font-size)}.zuz-select-options button:hover{background:var(--select-hover)}.zuz-select-options button.selected{background:var(--select-selected)}.zuz-overlay{background:var(--zuz-overlay);z-index:2147483645;backdrop-filter:blur(var(--zuz-overlay-blur))}.drawer-h,.zuz-drawer.drawer-right,.zuz-drawer.drawer-left{min-width:320px;max-width:90vw;top:0px;bottom:0px;border-radius:var(--drawer-radius-h)}.drawer-v,.zuz-drawer.drawer-bottom,.zuz-drawer.drawer-top{min-height:10vh;max-height:90vh;left:0px;right:0px;border-radius:var(--drawer-radius-v)}.zuz-drawer{background:var(--drawer-color);z-index:2147483646;overflow-x:hidden;overflow-y:auto}.zuz-drawer.drawer-left{left:0px}.zuz-drawer.drawer-right{right:0px}.zuz-drawer.drawer-top{top:0px}.zuz-drawer.drawer-bottom{bottom:0px}.zuz-drawer .drawer-handle{width:100px;height:6px;border-radius:10px;background:var(--drawer-handle-color);margin:12px auto 0px auto}.text-wheel{transform-style:flat}.text-wheel .wheel-char{font-variant:tabular-nums;overflow:hidden;height:1lh}.text-wheel .wheel-char .wheel-char-track{transition:var(--text-wheel-transition)}.text-wheel .wheel-char .wheel-char-track.wheel-track-down{translate:0 calc((10 - var(--v))*-1lh)}.text-wheel .wheel-char .wheel-char-track.wheel-track-up{translate:0 calc((var(--v) + 1)*-1lh)}.text-wheel .wheel-char .wheel-char-track span{height:1lh;transition:opacity .5s}.tabview .tab-head{gap:1px;background:var(--tab-head);padding:var(--tab-head-padding);border-radius:var(--tab-head-radius)}.tabview .tab-head .tab-label{flex:1;border:0px;background:var(--tab);border-radius:var(--tab-radius);padding:var(--tab-padding);color:var(--tab-color)}.tabview .tab-head .tab-label.active{color:var(--tab-active-color);background:var(--tab-active);transform:translateY(1px)}.tabview .tab-head .tab-label.active:hover{background:var(--tab-active)}.tabview .tab-head .tab-label:hover{background:var(--tab-hover)}.tabview .tab-content{border:var(--tab-border);overflow:hidden;border-radius:var(--tab-body-radius)}.tabview .tab-content .tabs-track{transform-style:flat}.tabview .tab-content .tab-body{width:100%;background:var(--tab-body);padding:var(--tab-body-padding)}.comp-editor{top:10px;left:10px;border-radius:10px;z-index:var(--max-z-index)}.comp-editor .pencil{width:40px;height:40px;background:#fff;border-radius:50%;border:0px}.comp-editor .pencil img{width:50%}.comp-editor .pencil span{font-size:36px;color:#111;line-height:.8}.comp-editor .editor-props{background:#fff;border-radius:10px;left:60px;top:10px;width:350px;overflow:hidden;box-shadow:0px 0px 0px 1px #ccc,0px 0px 0px 5px #eaeaea}.comp-editor .editor-props .editor-head{background:#ddd;padding:4px 12px;font-size:14px}.comp-editor .editor-props .editor-head .head-label{flex:1}.comp-editor .editor-props .editor-head .head-action{display:flex;flex:1;gap:5px;align-items:flex-end;justify-content:flex-end}.comp-editor .editor-props .editor-head .head-action button{background:#333;border:0px;font-size:12px;color:#fff;font-weight:bold;padding:2px 10px;border-radius:10px}.comp-editor .editor-props .editor-head .head-action button:hover{background:#222}.comp-editor .editor-props .editor-body{padding:12px;max-height:70vh;overflow-x:hidden;overflow-y:auto;gap:5px}.comp-editor .editor-props .editor-body textarea{flex:1 1;width:100%;border:0px;background:#ebebeb;padding:15px;min-height:290px;color:#111;border-radius:10px;resize:none}.comp-editor .editor-props .editor-body .copy{top:20px;right:20px;z-index:2;border-radius:10px;border:0px;padding:3px 10px;background:var(--primary)}.comp-editor .editor-props .editor-body .group{margin-top:10px}.comp-editor .editor-props .editor-body .group .gprops{gap:5px}.comp-editor .editor-props .editor-body .group .glabel{background:#333;align-self:flex-start;font-weight:bold;font-size:12px;border-radius:5px 5px 0px 0px;padding:2px 5px;transform:translateX(5px);color:#f1f1f1}.comp-editor .editor-props .editor-body .gprop,.comp-editor .editor-props .editor-body .prop{flex:1;padding:6px 0px;font-size:13px;background:#f7f7f7;padding:5px 10px;border-radius:5px}.comp-editor .editor-props .editor-body .gprop .pop,.comp-editor .editor-props .editor-body .prop .pop{flex:1;white-space:pre}.comp-editor .editor-props .editor-body .gprop .pop:nth-child(2),.comp-editor .editor-props .editor-body .prop .pop:nth-child(2){align-items:flex-end;justify-content:flex-end}.comp-editor .editor-props .editor-body .gprop .pop input,.comp-editor .editor-props .editor-body .prop .pop input{flex:1;width:70px;max-width:70px;min-width:70px;border:0px;background:#777;padding:4px;border-radius:4px;margin-left:5px}.comp-editor .editor-props .editor-body .gprop .pop input[type=color],.comp-editor .editor-props .editor-body .prop .pop input[type=color]{background:rgba(0,0,0,0);border-radius:5px;padding:0px;appearance:none}.comp-editor .editor-props .editor-body .gprop .pop .l-k,.comp-editor .editor-props .editor-body .prop .pop .l-k{font-size:10px;color:#777}
|
|
1
|
+
*,*::before,*::after{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}button{user-select:none;cursor:pointer}input{user-select:none}input:-webkit-autofill{background-color:rgba(0,0,0,0) !important;-webkit-box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset;box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset}[aria-hidden=true]{user-select:none;pointer-events:none;cursor:auto}[popover]{margin:0;padding:0;border:0}:root{--basic: ease;--back: linear( 0, -0.0077 5.2%, -0.0452 16.98%, -0.0493 22.35%, -0.0418 25.57%, -0.0258 28.57%, -0.0007 31.42%, 0.0335 34.15%, 0.1242 39.03%, 0.2505 43.65%, 0.3844 47.35%, 0.656 53.68%, 0.81 58.37%, 0.9282 63.52%, 0.9719 66.23%, 1.0055 69.04%, 1.0255 71.4%, 1.0396 73.87%, 1.0477 76.48%, 1.05 79.27%, 1.0419 84.36%, 1.0059 95.49%, 1 );--expo: linear( 0, 0.0053 17.18%, 0.0195 26.59%, 0.0326 30.31%, 0.0506 33.48%, 0.0744 36.25%, 0.1046 38.71%, 0.1798 42.62%, 0.2846 45.93%, 0.3991 48.37%, 0.6358 52.29%, 0.765 55.45%, 0.8622 59.3%, 0.8986 61.51%, 0.9279 63.97%, 0.9481 66.34%, 0.9641 69.01%, 0.9856 75.57%, 0.9957 84.37%, 1 );--sine: linear( 0, 0.007 5.35%, 0.0282 10.75%, 0.0638 16.26%, 0.1144 21.96%, 0.1833 28.16%, 0.2717 34.9%, 0.6868 62.19%, 0.775 68.54%, 0.8457 74.3%, 0.9141 81.07%, 0.9621 87.52%, 0.9905 93.8%, 1 );--power: linear( 0, 0.0012 14.95%, 0.0089 22.36%, 0.0297 28.43%, 0.0668 33.43%, 0.0979 36.08%, 0.1363 38.55%, 0.2373 43.07%, 0.3675 47.01%, 0.5984 52.15%, 0.7121 55.23%, 0.8192 59.21%, 0.898 63.62%, 0.9297 66.23%, 0.9546 69.06%, 0.9733 72.17%, 0.9864 75.67%, 0.9982 83.73%, 1 );--circ: linear( -0, 0.0033 5.75%, 0.0132 11.43%, 0.0296 16.95%, 0.0522 22.25%, 0.0808 27.25%, 0.1149 31.89%, 0.1542 36.11%, 0.1981 39.85%, 0.2779 44.79%, 0.3654 48.15%, 0.4422 49.66%, 0.5807 50.66%, 0.6769 53.24%, 0.7253 55.37%, 0.7714 58.01%, 0.8142 61.11%, 0.8536 64.65%, 0.9158 72.23%, 0.9619 80.87%, 0.9904 90.25%, 1 );--bounce: linear( 0, 0.0039, 0.0157, 0.0352, 0.0625 9.09%, 0.1407, 0.25, 0.3908, 0.5625, 0.7654, 1, 0.8907, 0.8125 45.45%, 0.7852, 0.7657, 0.7539, 0.75, 0.7539, 0.7657, 0.7852, 0.8125 63.64%, 0.8905, 1 72.73%, 0.9727, 0.9532, 0.9414, 0.9375, 0.9414, 0.9531, 0.9726, 1, 0.9883, 0.9844, 0.9883, 1 );--elastic: linear( 0, 0.0009 8.51%, -0.0047 19.22%, 0.0016 22.39%, 0.023 27.81%, 0.0237 30.08%, 0.0144 31.81%, -0.0051 33.48%, -0.1116 39.25%, -0.1181 40.59%, -0.1058 41.79%, -0.0455, 0.0701 45.34%, 0.9702 55.19%, 1.0696 56.97%, 1.0987 57.88%, 1.1146 58.82%, 1.1181 59.83%, 1.1092 60.95%, 1.0057 66.48%, 0.986 68.14%, 0.9765 69.84%, 0.9769 72.16%, 0.9984 77.61%, 1.0047 80.79%, 0.9991 91.48%, 1 );--ease: var(--back);--max-z-index: 2147483647;--text-wheel-speed: 2;--text-wheel-transition: translate calc(var(--text-wheel-speed) * 1s) var(--ease);--checkbox-height: 24px;--checkbox-width: 42px;--checkbox-knob-size: 20px;--checkbox-knob-left: 2px;--checkbox-knob-top: 2px;--checkbox-knob-left-on: 18px;--checkbox-check-color: #fff;--checkbox-check-size: 13px;--checkbox-size: 17px;--checkbox-radius: 6px;--checkbox-checked: rgb(46, 161, 42);--checkbox-unchecked: rgb(203, 203, 203);--checkbox-thumb: #fff;--checkbox-thumb-shadow: #000;--checkbox-thumb-shadow-size: 2px;--select-width: auto;--select: #eee;--select-font-size: 16px;--select-hover: #e6e6e6;--select-options: #eee;--select-options-top: 0.1rem;--select-options-padding: 4px;--select-option-color: #111;--select-option-hover: #ddd;--select-selected: #ccc;--select-padding: 6px 8px;--select-radius: 5px;--cover-bg: rgba(255,255,255,0.8);--cover-label: #111;--zuz-overlay: rgba(0, 0, 0, 0.7);--zuz-overlay-blur: 0;--drawer-color: #fff;--drawer-handle-color: #ccc;--drawer-radius-v: 0px;--drawer-radius-h: 0px;--tab-head: #fff;--tab-head-padding: 3px 3px 0px 3px;--tab-head-radius: 6px 6px 0px 0px;--tab: #eee;--tab-active: #ccc;--tab-active-color: #111;--tab-hover: #ddd;--tab-color: #111;--tab-radius: 5px 5px 0px 0px;--tab-padding: 5px 20px;--tab-body: #fff;--tab-body-radius: 0px 5px 5px 5px;--tab-body-padding: 0px;--tab-border: 1px #ddd solid;--sheet-bg: #fff;--sheet-body: #fff;--sheet-radius: 10px;--sheet-padding: 6px 12px;--sheet-head-padding: 10px;--sheet-body-padding: 10px;--sheet-footer: #ddd;--sheet-footer-padding: 10px;--sheet-action: #222;--sheet-action-color: #fff;--sheet-action-hover: #333;--sheet-action-radius: 7px;--sheet-action-padding: 7px 20px;--sheet-action-font-size: 16px;--sheet-action-font-weight: bold;--sheet-closer-color: #111;--sheet-closer-hover: rgba(255,255,255,0.2);--sheet-closer-opacity: 0.75;--sheet-closer-hover-opacity: 1;--sheet-font-size: 15px;--sheet-title-opacity: 0.75;--sheet-title-font-size: 16px;--sheet-closer-font-size: 36px;--sheet-error: #ff4747;--sheet-warn: #ffba00;--sheet-success: #23ac28;--context-z-index: 99;--context: #fff;--context-border: 0px;--context-radius: 10px;--context-padding: 10px;--context-shadow: 0px 0px 0px 1px #ddd, 0px 0px 0px 3px #eee;--context-seperator: #eee;--context-seperator-height: 1px;--context-seperator-margin: 3px 6px;--context-item-width: 220px;--context-item-padding: 6px 10px;--context-item-gap: 10px;--context-item-font-size: 15px;--context-item-radius: 5px;--context-item-icon-size: 18px;--context-item-hover: #eee;--treeview-gap: 6px;--treenode-gap: 2px;--treenode-arrow-btn-size: 20px;--treenode-arrow-icon-size: 12px;--treenode-arrow-icon-color: #111;--treenode-label-padding: 3px 6px;--treenode-label-radius: 3px 6px;--treenode-label-hover: #f1f1f1;--treenode-label-bg: transparent;--treenode-label-selected-bg: #eee;--treenode-label-selected-color: #111;--treenode-label-icon-color: #111;--treenode-label-icon-size: 15px;--treenode-label-color: #111;--treenode-label-size: 15px;--treenode-label-gap: 6px;--treenode-sub-margin: 20px;--progress-width: 100%;--progress-height: 6px;--progress-radius: 6px;--progress-track: #eee;--progress-bar: #111;--skeleton: #eee;--skeleton-radius: 7px;--shimmer: #ccc;--shimmer-width: 10%;--shimmer-angle: 120deg;--shimmer-speed: 2s;--shimmer-blur: 50px}.flex{display:flex}.flex.cols{flex-direction:column}.flex.aic{align-items:center}.flex.aie{align-items:flex-end}.flex.jcc{justify-content:center}.flex.jce{justify-content:flex-end}.flex.jcs{justify-content:flex-start}.abs{position:absolute}.fixed{position:fixed}.fill{top:0px;left:0px;bottom:0px;right:0px}.fillx{top:-10px;left:-10px;bottom:-10px;right:-10px}.grid{display:grid}.nope{pointer-events:none}.nous{user-select:none}.rel{position:relative}.text-wrap,.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-with-error{box-shadow:inset 0px 0px 0px 1px #ff8b8b}button.ico-btn{gap:5px}button .b-label{flex:1}.checkbox{height:var(--checkbox-size);width:var(--checkbox-size);cursor:pointer;border:1px var(--checkbox-unchecked) solid;border-radius:var(--checkbox-radius);overflow:hidden}.checkbox input[type=checkbox]{z-index:0;opacity:0}.checkbox:before{font-size:var(--checkbox-check-size);color:var(--checkbox-check-color);opacity:0}.checkbox.is-checked{background-color:var(--checkbox-checked);border:1px var(--checkbox-checked) solid}.checkbox.is-checked:before{opacity:1}.zuz-checkbox{height:var(--checkbox-height);width:var(--checkbox-width);cursor:pointer}.zuz-checkbox input[type=checkbox]{z-index:0;left:10px;top:10px;opacity:0}.zuz-checkbox:before{content:"";position:absolute;height:var(--checkbox-height);width:var(--checkbox-width);background:var(--checkbox-unchecked);border-radius:50px;z-index:1;transition:all .3s linear 0s}.zuz-checkbox:after{content:"";position:absolute;width:var(--checkbox-knob-size);height:var(--checkbox-knob-size);background:var(--checkbox-thumb);border-radius:50px;z-index:2;top:var(--checkbox-knob-top);left:var(--checkbox-knob-left);box-shadow:0px 0px --checkbox-thumb-shadow-size --checkbox-thumb-shadow;transition:all .75s var(--bounce) 0s}.zuz-checkbox.is-checked:before{box-shadow:inset 0px 0px 0px 15px var(--checkbox-checked)}.zuz-checkbox.is-checked:after{transform:translateX(var(--checkbox-knob-left-on))}@keyframes shimmering{0%{transform:translateX(-100%) rotate(var(--shimmer-angle))}20%{transform:translateX(100%) rotate(var(--shimmer-angle))}100%{transform:translateX(100%) rotate(var(--shimmer-angle))}}.--skeleton{overflow:hidden;border-radius:var(--skeleton-radius);height:1lh;background:var(--skeleton);position:relative}.--skeleton:after{content:"";position:absolute;top:0;left:0;right:0;height:100%;background-repeat:no-repeat;background-image:linear-gradient(90deg, var(--skeleton) 0%, var(--shimmer) 50%, var(--skeleton) 100%);transform:translateX(-100%) rotate(var(--shimmer-angle));animation-name:shimmering;animation-direction:var(--shimmer-direction);animation-duration:var(--shimmer-speed);animation-timing-function:ease-in-out;animation-iteration-count:infinite;filter:blur(var(--shimmer-blur))}.zuz-spinner{animation:spin infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.zuz-cover{backdrop-filter:blur(4px);z-index:99999;gap:15px}.zuz-cover .label{font-size:14px;animation:breath 1s linear infinite}@keyframes breath{0%{opacity:.5}50%{opacity:1}100%{opacity:.5}}.zuz-toast,.zuz-sheet.toast-warn,.zuz-sheet.toast-success,.zuz-sheet.toast-error,.zuz-sheet.toast-default{border-radius:var(--sheet-radius);padding:var(--sheet-padding);font-size:var(--sheet-font-size);white-space:pre}.zuz-sheet{top:50%;left:50%;transform:translate(-50%, -50%);z-index:2147483645;transform-origin:top left;transition:all .5s cubic-bezier(0.2, -0.36, 0, 1.46) 0s}.zuz-sheet.wobble{transform-origin:inherit !important}.zuz-sheet.toast-default{background:#333;color:#fff;top:10px !important}.zuz-sheet.toast-error{background:var(--sheet-error);color:#fff;top:10px}.zuz-sheet.toast-success{background:var(--sheet-success);color:#fff;top:10px}.zuz-sheet.toast-warn{background:var(--sheet-warn);color:#111;top:10px}.zuz-sheet.toast-form{position:absolute !important}.zuz-sheet.toast-dialog{background:var(--sheet-bg);border-radius:var(--sheet-radius)}.zuz-sheet .sheet-head{padding:var(--sheet-head-padding)}.zuz-sheet .sheet-head .sheet-title{flex:1;font-size:var(--sheet-title-font-size);opacity:var(--sheet-title-opacity);text-align:center;padding:0px 45px;display:flex;align-items:center;justify-content:center}.zuz-sheet .sheet-head .sheet-dot{flex:1}.zuz-sheet .sheet-head .sheet-closer{width:32px;height:32px;cursor:pointer;font-size:var(--sheet-closer-font-size);color:var(--sheet-closer-color);background:rgba(0,0,0,0);border:0px;line-height:0;padding:0px;font-weight:normal;border-radius:20px;opacity:var(--sheet-closer-opacity);top:15px;right:5px;transform:translateY(-50%);font-size:var(--sheet-closer-font-size)}.zuz-sheet .sheet-head .sheet-closer:hover{background:var(--sheet-closer-hover);opacity:var(--sheet-closer-hover-opacity)}.zuz-sheet .sheet-body{background:var(--sheet-body);padding:var(--sheet-body-padding)}.zuz-sheet .sheet-body.--no-action{border-radius:0px 0px var(--sheet-radius) var(--sheet-radius)}.zuz-sheet .sheet-footer{padding:var(--sheet-footer-padding);background:var(--sheet-footer);border-radius:0px 0px var(--sheet-radius) var(--sheet-radius)}.zuz-sheet .sheet-footer .sheet-action-btn{background:var(--sheet-action);color:var(--sheet-action-color);border-radius:var(--sheet-action-radius);padding:var(--sheet-action-padding);font-size:var(--sheet-action-font-size);font-weight:var(--sheet-action-font-weight);border:0px}.zuz-sheet .sheet-footer .sheet-action-btn:hover{background:var(--sheet-action-hover)}.zuz-sheet-overlay{background:rgba(0,0,0,.7);z-index:111;backdrop-filter:blur(10px)}.context-menu{z-index:var(--context-z-index);background:var(--context);border-radius:var(--context-radius);padding:var(--context-padding);box-shadow:var(--context-shadow)}.context-menu .context-line{height:var(--context-seperator-height);background:var(--context-seperator);margin:var(--context-seperator-margin)}.context-menu .context-menu-item{width:var(--context-item-width);padding:var(--context-item-padding);gap:var(--context-item-gap);cursor:pointer;font-size:var(--context-item-font-size);border-radius:var(--context-item-radius)}.context-menu .context-menu-item .ico{font-size:var(--context-item-icon-size)}.context-menu .context-menu-item:hover{background:var(--context-item-hover)}.zuz-select-wrap{width:var(--select-width);z-index:1}.zuz-select-wrap .zuz-select{width:100%;gap:5px;background:var(--select);border-radius:var(--select-radius);border:0px;padding:12px 15px;font-size:var(--select-font-size)}.zuz-select-wrap .zuz-select:hover{background:var(--select-hover)}.zuz-select-wrap .zuz-select .zuz-selected{flex:1;text-align:left}.zuz-select-wrap .zuz-select-options{backdrop-filter:blur(10px) saturate(0);left:0;top:calc(100% + var(--select-options-top));width:100%;max-height:400px;overflow-x:hidden;gap:2px;background:var(--select-options);border-radius:var(--select-radius);padding:var(--select-options-padding)}.zuz-select-wrap .zuz-select-options button{background:rgba(0,0,0,0);border:0px;text-align:left;color:var(--select-option-color);padding:var(--select-padding);border-radius:var(--select-radius);font-size:var(--select-font-size);white-space:pre}.zuz-select-wrap .zuz-select-options button:hover{background:var(--select-option-hover)}.zuz-select-wrap .zuz-select-options button.selected{background:var(--select-selected)}.zuz-overlay{background:var(--zuz-overlay);z-index:2147483645;backdrop-filter:blur(var(--zuz-overlay-blur))}.drawer-h,.zuz-drawer.drawer-right,.zuz-drawer.drawer-left{min-width:320px;max-width:90vw;top:0px;bottom:0px;border-radius:var(--drawer-radius-h)}.drawer-v,.zuz-drawer.drawer-bottom,.zuz-drawer.drawer-top{min-height:10vh;max-height:90vh;left:0px;right:0px;border-radius:var(--drawer-radius-v)}.zuz-drawer{background:var(--drawer-color);z-index:2147483646;overflow-x:hidden;overflow-y:auto}.zuz-drawer.drawer-left{left:0px}.zuz-drawer.drawer-right{right:0px}.zuz-drawer.drawer-top{top:0px}.zuz-drawer.drawer-bottom{bottom:0px}.zuz-drawer .drawer-handle{width:100px;height:6px;border-radius:10px;background:var(--drawer-handle-color);margin:12px auto 0px auto}.text-wheel{transform-style:flat}.text-wheel .wheel-char{font-variant:tabular-nums;overflow:hidden;height:1lh}.text-wheel .wheel-char .wheel-char-track{transition:var(--text-wheel-transition)}.text-wheel .wheel-char .wheel-char-track.wheel-track-down{translate:0 calc((10 - var(--v))*-1lh)}.text-wheel .wheel-char .wheel-char-track.wheel-track-up{translate:0 calc((var(--v) + 1)*-1lh)}.text-wheel .wheel-char .wheel-char-track span{height:1lh;transition:opacity .5s}.tabview .tab-head{gap:1px;background:var(--tab-head);padding:var(--tab-head-padding);border-radius:var(--tab-head-radius)}.tabview .tab-head .tab-label{flex:1;border:0px;background:var(--tab);border-radius:var(--tab-radius);padding:var(--tab-padding);color:var(--tab-color)}.tabview .tab-head .tab-label.active{color:var(--tab-active-color);background:var(--tab-active);transform:translateY(1px)}.tabview .tab-head .tab-label.active:hover{background:var(--tab-active)}.tabview .tab-head .tab-label:hover{background:var(--tab-hover)}.tabview .tab-content{border:var(--tab-border);overflow:hidden;border-radius:var(--tab-body-radius)}.tabview .tab-content .tabs-track{transform-style:flat}.tabview .tab-content .tab-body{width:100%;background:var(--tab-body);padding:var(--tab-body-padding);align-self:baseline}.treeview{gap:var(--treeview-gap)}.treeview .--node{gap:var(--treenode-gap);cursor:pointer}.treeview .--node .--node-aro-btn{width:var(--treenode-arrow-btn-size);height:var(--treenode-arrow-btn-size);border:0px;background:rgba(0,0,0,0);opacity:.6;transition:all .4s linear 0s}.treeview .--node .--node-aro-btn:hover{opacity:1}.treeview .--node .--node-aro-btn .--node-aro-icon{font-size:var(--treenode-arrow-icon-size);color:var(--treenode-arrow-icon-color)}.treeview .--node .--node-meta{background:rgba(0,0,0,0);gap:var(--treenode-label-gap);border:0px}.treeview .--node .--node-meta .--node-icon{font-size:var(--treenode-label-icon-size);color:var(--treenode-label-icon-color)}.treeview .--node .--node-meta .--node-label{background:var(--treenode-label-bg);color:var(--treenode-label-color);font-size:var(--treenode-label-size);padding:var(--treenode-label-padding);border-radius:var(--treenode-label-radius)}.treeview .--node .--node-meta:hover .--node-label{background:var(--treenode-label-hover)}.treeview .--node.--selected .--node-meta .--node-label{background:var(--treenode-label-selected-bg);color:var(--treenode-label-selected-color)}.treeview .--sub-node{margin-top:var(--treeview-gap);gap:var(--treeview-gap);padding-left:var(--treenode-sub-margin)}.--progress{background:var(--progress-track);width:var(--progress-width);height:var(--progress-height);border-radius:var(--progress-radius);overflow:hidden}.--progress .--bar{width:0%;height:var(--progress-heigt);border-radius:var(--progress-radius)}.comp-editor{top:10px;left:10px;border-radius:10px;z-index:var(--max-z-index)}.comp-editor .pencil{width:40px;height:40px;background:#fff;border-radius:50%;border:0px}.comp-editor .pencil img{width:50%}.comp-editor .pencil span{font-size:36px;color:#111;line-height:.8}.comp-editor .editor-props{background:#fff;border-radius:10px;left:60px;top:10px;width:350px;overflow:hidden;box-shadow:0px 0px 0px 1px #ccc,0px 0px 0px 5px #eaeaea}.comp-editor .editor-props .editor-head{background:#ddd;padding:4px 12px;font-size:14px}.comp-editor .editor-props .editor-head .head-label{flex:1}.comp-editor .editor-props .editor-head .head-action{display:flex;flex:1;gap:5px;align-items:flex-end;justify-content:flex-end}.comp-editor .editor-props .editor-head .head-action button{background:#333;border:0px;font-size:12px;color:#fff;font-weight:bold;padding:2px 10px;border-radius:10px}.comp-editor .editor-props .editor-head .head-action button:hover{background:#222}.comp-editor .editor-props .editor-body{padding:12px;max-height:70vh;overflow-x:hidden;overflow-y:auto;gap:5px}.comp-editor .editor-props .editor-body textarea{flex:1 1;width:100%;border:0px;background:#ebebeb;padding:15px;min-height:290px;color:#111;border-radius:10px;resize:none}.comp-editor .editor-props .editor-body .copy{top:20px;right:20px;z-index:2;border-radius:10px;border:0px;padding:3px 10px;background:var(--primary)}.comp-editor .editor-props .editor-body .group{margin-top:10px}.comp-editor .editor-props .editor-body .group .gprops{gap:5px}.comp-editor .editor-props .editor-body .group .glabel{background:#333;align-self:flex-start;font-weight:bold;font-size:12px;border-radius:5px 5px 0px 0px;padding:2px 5px;transform:translateX(5px);color:#f1f1f1}.comp-editor .editor-props .editor-body .gprop,.comp-editor .editor-props .editor-body .prop{flex:1;padding:6px 0px;font-size:13px;background:#f7f7f7;padding:5px 10px;border-radius:5px}.comp-editor .editor-props .editor-body .gprop .pop,.comp-editor .editor-props .editor-body .prop .pop{flex:1;white-space:pre}.comp-editor .editor-props .editor-body .gprop .pop:nth-child(2),.comp-editor .editor-props .editor-body .prop .pop:nth-child(2){align-items:flex-end;justify-content:flex-end}.comp-editor .editor-props .editor-body .gprop .pop input,.comp-editor .editor-props .editor-body .prop .pop input{flex:1;width:70px;max-width:70px;min-width:70px;border:0px;background:#777;padding:4px;border-radius:4px;margin-left:5px}.comp-editor .editor-props .editor-body .gprop .pop input[type=color],.comp-editor .editor-props .editor-body .prop .pop input[type=color]{background:rgba(0,0,0,0);border-radius:5px;padding:0px;appearance:none}.comp-editor .editor-props .editor-body .gprop .pop .l-k,.comp-editor .editor-props .editor-body .prop .pop .l-k{font-size:10px;color:#777}
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export declare enum SHEET {
|
|
|
18
18
|
Success = "SUCCESS",
|
|
19
19
|
Warn = "WARN"
|
|
20
20
|
}
|
|
21
|
+
export declare enum SHEET_ACTION_POSITION {
|
|
22
|
+
Left = "LEFT",
|
|
23
|
+
Right = "RIGHT",
|
|
24
|
+
Center = "CENTER"
|
|
25
|
+
}
|
|
21
26
|
export declare enum TRANSITION_CURVES {
|
|
22
27
|
Spring = "SPRING",
|
|
23
28
|
EaseInOut = "EASEINOUT"
|
|
@@ -55,3 +60,15 @@ export declare enum DATATYPE {
|
|
|
55
60
|
DateTime = "DATETIME",
|
|
56
61
|
File = "FILE"
|
|
57
62
|
}
|
|
63
|
+
export declare enum SORT {
|
|
64
|
+
Asc = "ASC",
|
|
65
|
+
Desc = "DESC"
|
|
66
|
+
}
|
|
67
|
+
export declare enum PROGRESS {
|
|
68
|
+
Bar = "BAR",
|
|
69
|
+
Ring = "RING"
|
|
70
|
+
}
|
|
71
|
+
export declare enum SKELETON {
|
|
72
|
+
Default = "DEFAULT",
|
|
73
|
+
Circle = "CIRCLE"
|
|
74
|
+
}
|
package/dist/types/enums.js
CHANGED
|
@@ -22,6 +22,12 @@ export var SHEET;
|
|
|
22
22
|
SHEET["Success"] = "SUCCESS";
|
|
23
23
|
SHEET["Warn"] = "WARN";
|
|
24
24
|
})(SHEET || (SHEET = {}));
|
|
25
|
+
export var SHEET_ACTION_POSITION;
|
|
26
|
+
(function (SHEET_ACTION_POSITION) {
|
|
27
|
+
SHEET_ACTION_POSITION["Left"] = "LEFT";
|
|
28
|
+
SHEET_ACTION_POSITION["Right"] = "RIGHT";
|
|
29
|
+
SHEET_ACTION_POSITION["Center"] = "CENTER";
|
|
30
|
+
})(SHEET_ACTION_POSITION || (SHEET_ACTION_POSITION = {}));
|
|
25
31
|
export var TRANSITION_CURVES;
|
|
26
32
|
(function (TRANSITION_CURVES) {
|
|
27
33
|
TRANSITION_CURVES["Spring"] = "SPRING";
|
|
@@ -65,3 +71,18 @@ export var DATATYPE;
|
|
|
65
71
|
DATATYPE["DateTime"] = "DATETIME";
|
|
66
72
|
DATATYPE["File"] = "FILE";
|
|
67
73
|
})(DATATYPE || (DATATYPE = {}));
|
|
74
|
+
export var SORT;
|
|
75
|
+
(function (SORT) {
|
|
76
|
+
SORT["Asc"] = "ASC";
|
|
77
|
+
SORT["Desc"] = "DESC";
|
|
78
|
+
})(SORT || (SORT = {}));
|
|
79
|
+
export var PROGRESS;
|
|
80
|
+
(function (PROGRESS) {
|
|
81
|
+
PROGRESS["Bar"] = "BAR";
|
|
82
|
+
PROGRESS["Ring"] = "RING";
|
|
83
|
+
})(PROGRESS || (PROGRESS = {}));
|
|
84
|
+
export var SKELETON;
|
|
85
|
+
(function (SKELETON) {
|
|
86
|
+
SKELETON["Default"] = "DEFAULT";
|
|
87
|
+
SKELETON["Circle"] = "CIRCLE";
|
|
88
|
+
})(SKELETON || (SKELETON = {}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SORT } from "./enums";
|
|
1
2
|
export type dynamicObject = {
|
|
2
3
|
[x: string]: any;
|
|
3
4
|
};
|
|
@@ -23,3 +24,7 @@ declare global {
|
|
|
23
24
|
export type FormSubmitHandler = (formData: FormData) => void;
|
|
24
25
|
export type FormInputs = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
25
26
|
export type zuzProps = `as` | `css` | `hover` | `before` | `after`;
|
|
27
|
+
export type sortOptions = {
|
|
28
|
+
direction?: SORT;
|
|
29
|
+
caseSensitive?: boolean;
|
|
30
|
+
};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { DetailedHTMLProps, HTMLAttributes } from "react";
|
|
2
2
|
import { animationProps } from "../comps/base";
|
|
3
|
+
import { SKELETON } from "./enums";
|
|
4
|
+
export interface Skeleton {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
type?: SKELETON;
|
|
7
|
+
size?: number | string;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
radius?: number | string;
|
|
11
|
+
}
|
|
3
12
|
export interface BaseProps {
|
|
4
13
|
as?: string;
|
|
5
14
|
animate?: animationProps;
|
|
6
15
|
editor?: boolean;
|
|
16
|
+
skeleton?: Skeleton;
|
|
7
17
|
}
|
|
8
18
|
export interface FormatNumberParams {
|
|
9
19
|
number: number | string;
|