@zuzjs/ui 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/comps/Box/index.d.ts +1 -2
- package/dist/cjs/comps/Box/index.js +14 -12
- package/dist/cjs/comps/Button/index.d.ts +1 -1
- package/dist/cjs/comps/Button/types.d.ts +1 -1
- package/dist/cjs/comps/ColorScheme/index.d.ts +3 -2
- package/dist/cjs/comps/ColorScheme/index.js +24 -9
- package/dist/cjs/comps/ColorScheme/types.d.ts +4 -0
- package/dist/cjs/comps/ColorScheme/types.js +1 -0
- package/dist/cjs/comps/ContextMenu/index.js +1 -2
- package/dist/cjs/comps/Crumb/index.d.ts +4 -0
- package/dist/cjs/comps/Crumb/index.js +13 -0
- package/dist/cjs/comps/Crumb/types.d.ts +11 -0
- package/dist/cjs/comps/Crumb/types.js +1 -0
- package/dist/cjs/comps/Drawer/index.js +16 -15
- package/dist/cjs/comps/Form/index.d.ts +3 -59
- package/dist/cjs/comps/Form/types.d.ts +43 -0
- package/dist/cjs/comps/Form/types.js +1 -0
- package/dist/cjs/comps/Icon/index.js +0 -1
- package/dist/cjs/comps/Image/index.js +0 -1
- package/dist/cjs/comps/KeyboardKeys/index.d.ts +8 -0
- package/dist/cjs/comps/KeyboardKeys/index.js +33 -0
- package/dist/cjs/comps/KeyboardKeys/types.d.ts +13 -0
- package/dist/cjs/comps/KeyboardKeys/types.js +51 -0
- package/dist/cjs/comps/Label/index.js +0 -1
- package/dist/cjs/comps/List/index.d.ts +3 -0
- package/dist/cjs/comps/List/index.js +4 -4
- package/dist/cjs/comps/List/item.js +5 -1
- package/dist/cjs/comps/List/types.d.ts +4 -1
- package/dist/cjs/comps/Network/index.js +3 -5
- package/dist/cjs/comps/Pagination/index.js +2 -2
- package/dist/cjs/comps/ScrollView/index.d.ts +5 -0
- package/dist/cjs/comps/ScrollView/index.js +13 -0
- package/dist/cjs/comps/ScrollView/types.d.ts +6 -0
- package/dist/cjs/comps/ScrollView/types.js +1 -0
- package/dist/cjs/comps/Search/index.d.ts +7 -10
- package/dist/cjs/comps/Search/index.js +10 -6
- package/dist/cjs/comps/Search/types.d.ts +12 -0
- package/dist/cjs/comps/Search/types.js +1 -0
- package/dist/cjs/comps/Segmented/index.d.ts +3 -2
- package/dist/cjs/comps/Segmented/index.js +6 -5
- package/dist/cjs/comps/Segmented/item.js +11 -2
- package/dist/cjs/comps/Segmented/types.d.ts +5 -1
- package/dist/cjs/comps/Select/index.d.ts +1 -1
- package/dist/cjs/comps/Select/types.d.ts +1 -1
- package/dist/cjs/comps/Sheet/index.js +8 -5
- package/dist/cjs/comps/Spinner/index.js +1 -2
- package/dist/cjs/comps/TabView/index.d.ts +1 -1
- package/dist/cjs/comps/TabView/types.d.ts +2 -2
- package/dist/cjs/comps/Table/index.js +12 -5
- package/dist/cjs/comps/Table/row.js +3 -2
- package/dist/cjs/comps/Table/types.d.ts +88 -1
- package/dist/cjs/comps/Text/index.d.ts +2 -0
- package/dist/cjs/comps/Text/index.js +4 -2
- package/dist/cjs/comps/TextArea/index.d.ts +2 -0
- package/dist/cjs/comps/TextArea/index.js +3 -4
- package/dist/cjs/comps/Treeview/index.js +3 -2
- package/dist/cjs/comps/Treeview/item.d.ts +1 -1
- package/dist/cjs/comps/Treeview/item.js +5 -4
- package/dist/cjs/comps/Treeview/types.d.ts +1 -1
- package/dist/cjs/comps/VideoPlayer/index.d.ts +2 -0
- package/dist/cjs/comps/VideoPlayer/index.js +7 -0
- package/dist/cjs/comps/index.d.ts +26 -18
- package/dist/cjs/comps/index.js +8 -0
- package/dist/cjs/funs/css.d.ts +3 -3
- package/dist/cjs/funs/css.js +20 -18
- package/dist/cjs/funs/index.d.ts +1 -0
- package/dist/cjs/funs/index.js +10 -0
- package/dist/cjs/funs/stylesheet.js +5 -0
- package/dist/cjs/hooks/index.d.ts +13 -6
- package/dist/cjs/hooks/index.js +14 -7
- package/dist/cjs/hooks/useAnchorPosition.d.ts +1 -2
- package/dist/cjs/hooks/useAnchorPosition.js +1 -0
- package/dist/cjs/hooks/useBase.js +27 -13
- package/dist/cjs/hooks/useCalendar.js +1 -0
- package/dist/cjs/hooks/useColorScheme.js +2 -2
- package/dist/cjs/hooks/useContextMenu.js +1 -0
- package/dist/cjs/hooks/useDB.js +1 -0
- package/dist/cjs/hooks/useDebounce.js +2 -1
- package/dist/cjs/hooks/useDelayed.js +2 -1
- package/dist/cjs/hooks/useDevice.js +1 -0
- package/dist/cjs/hooks/useDimensions.js +2 -1
- package/dist/cjs/hooks/useDom.d.ts +2 -0
- package/dist/cjs/hooks/useDom.js +3 -0
- package/dist/cjs/hooks/useDomMutation.d.ts +3 -0
- package/dist/cjs/hooks/useDomMutation.js +19 -0
- package/dist/cjs/hooks/useDrag.js +2 -1
- package/dist/cjs/hooks/useFileManager.d.ts +2 -0
- package/dist/cjs/hooks/useFileManager.js +3 -0
- package/dist/cjs/hooks/useImage.js +1 -0
- package/dist/cjs/hooks/useIntersectionObserver.js +2 -1
- package/dist/cjs/hooks/useMediaPlayer.d.ts +32 -0
- package/dist/cjs/hooks/useMediaPlayer.js +86 -0
- package/dist/cjs/hooks/useMergedRefs.d.ts +2 -0
- package/dist/cjs/hooks/useMergedRefs.js +14 -0
- package/dist/cjs/hooks/useMutationObserver.d.ts +3 -0
- package/dist/cjs/hooks/useMutationObserver.js +20 -0
- package/dist/cjs/hooks/useNetworkStatus.js +2 -1
- package/dist/cjs/hooks/usePlayer.d.ts +32 -0
- package/dist/cjs/hooks/usePlayer.js +85 -0
- package/dist/cjs/hooks/useResizeObserver.js +2 -1
- package/dist/cjs/hooks/useScrollbar.d.ts +16 -0
- package/dist/cjs/hooks/useScrollbar.js +160 -0
- package/dist/cjs/hooks/useSheet.js +1 -0
- package/dist/cjs/hooks/useShortcuts.d.ts +7 -0
- package/dist/cjs/hooks/useShortcuts.js +29 -0
- package/dist/cjs/hooks/useSlider.d.ts +7 -0
- package/dist/cjs/hooks/useSlider.js +23 -0
- package/dist/cjs/hooks/useTruncateText.d.ts +2 -0
- package/dist/cjs/hooks/useTruncateText.js +17 -0
- package/dist/cjs/hooks/useViewTransition.d.ts +2 -0
- package/dist/cjs/hooks/useViewTransition.js +13 -0
- package/dist/cjs/types/enums.d.ts +1 -0
- package/dist/cjs/types/enums.js +1 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/types/interfaces.d.ts +2 -0
- package/dist/css/styles.css +1 -1
- package/dist/esm/comps/Box/index.d.ts +1 -2
- package/dist/esm/comps/Box/index.js +14 -12
- package/dist/esm/comps/Button/index.d.ts +1 -1
- package/dist/esm/comps/Button/types.d.ts +1 -1
- package/dist/esm/comps/ColorScheme/index.d.ts +3 -2
- package/dist/esm/comps/ColorScheme/index.js +24 -9
- package/dist/esm/comps/ColorScheme/types.d.ts +4 -0
- package/dist/esm/comps/ColorScheme/types.js +1 -0
- package/dist/esm/comps/ContextMenu/index.js +1 -2
- package/dist/esm/comps/Crumb/index.d.ts +4 -0
- package/dist/esm/comps/Crumb/index.js +13 -0
- package/dist/esm/comps/Crumb/types.d.ts +11 -0
- package/dist/esm/comps/Crumb/types.js +1 -0
- package/dist/esm/comps/Drawer/index.js +16 -15
- package/dist/esm/comps/Form/index.d.ts +3 -59
- package/dist/esm/comps/Form/types.d.ts +43 -0
- package/dist/esm/comps/Form/types.js +1 -0
- package/dist/esm/comps/Icon/index.js +0 -1
- package/dist/esm/comps/Image/index.js +0 -1
- package/dist/esm/comps/KeyboardKeys/index.d.ts +8 -0
- package/dist/esm/comps/KeyboardKeys/index.js +33 -0
- package/dist/esm/comps/KeyboardKeys/types.d.ts +13 -0
- package/dist/esm/comps/KeyboardKeys/types.js +51 -0
- package/dist/esm/comps/Label/index.js +0 -1
- package/dist/esm/comps/List/index.d.ts +3 -0
- package/dist/esm/comps/List/index.js +4 -4
- package/dist/esm/comps/List/item.js +5 -1
- package/dist/esm/comps/List/types.d.ts +4 -1
- package/dist/esm/comps/Network/index.js +3 -5
- package/dist/esm/comps/Pagination/index.js +2 -2
- package/dist/esm/comps/ScrollView/index.d.ts +5 -0
- package/dist/esm/comps/ScrollView/index.js +13 -0
- package/dist/esm/comps/ScrollView/types.d.ts +6 -0
- package/dist/esm/comps/ScrollView/types.js +1 -0
- package/dist/esm/comps/Search/index.d.ts +7 -10
- package/dist/esm/comps/Search/index.js +10 -6
- package/dist/esm/comps/Search/types.d.ts +12 -0
- package/dist/esm/comps/Search/types.js +1 -0
- package/dist/esm/comps/Segmented/index.d.ts +3 -2
- package/dist/esm/comps/Segmented/index.js +6 -5
- package/dist/esm/comps/Segmented/item.js +11 -2
- package/dist/esm/comps/Segmented/types.d.ts +5 -1
- package/dist/esm/comps/Select/index.d.ts +1 -1
- package/dist/esm/comps/Select/types.d.ts +1 -1
- package/dist/esm/comps/Sheet/index.js +8 -5
- package/dist/esm/comps/Spinner/index.js +1 -2
- package/dist/esm/comps/TabView/index.d.ts +1 -1
- package/dist/esm/comps/TabView/types.d.ts +2 -2
- package/dist/esm/comps/Table/index.js +12 -5
- package/dist/esm/comps/Table/row.js +3 -2
- package/dist/esm/comps/Table/types.d.ts +88 -1
- package/dist/esm/comps/Text/index.d.ts +2 -0
- package/dist/esm/comps/Text/index.js +4 -2
- package/dist/esm/comps/TextArea/index.d.ts +2 -0
- package/dist/esm/comps/TextArea/index.js +3 -4
- package/dist/esm/comps/Treeview/index.js +3 -2
- package/dist/esm/comps/Treeview/item.d.ts +1 -1
- package/dist/esm/comps/Treeview/item.js +5 -4
- package/dist/esm/comps/Treeview/types.d.ts +1 -1
- package/dist/esm/comps/VideoPlayer/index.d.ts +2 -0
- package/dist/esm/comps/VideoPlayer/index.js +7 -0
- package/dist/esm/comps/index.d.ts +26 -18
- package/dist/esm/comps/index.js +8 -0
- package/dist/esm/funs/css.d.ts +3 -3
- package/dist/esm/funs/css.js +20 -18
- package/dist/esm/funs/index.d.ts +1 -0
- package/dist/esm/funs/index.js +10 -0
- package/dist/esm/funs/stylesheet.js +5 -0
- package/dist/esm/hooks/index.d.ts +13 -6
- package/dist/esm/hooks/index.js +14 -7
- package/dist/esm/hooks/useAnchorPosition.d.ts +1 -2
- package/dist/esm/hooks/useAnchorPosition.js +1 -0
- package/dist/esm/hooks/useBase.js +27 -13
- package/dist/esm/hooks/useCalendar.js +1 -0
- package/dist/esm/hooks/useColorScheme.js +2 -2
- package/dist/esm/hooks/useContextMenu.js +1 -0
- package/dist/esm/hooks/useDB.js +1 -0
- package/dist/esm/hooks/useDebounce.js +2 -1
- package/dist/esm/hooks/useDelayed.js +2 -1
- package/dist/esm/hooks/useDevice.js +1 -0
- package/dist/esm/hooks/useDimensions.js +2 -1
- package/dist/esm/hooks/useDom.d.ts +2 -0
- package/dist/esm/hooks/useDom.js +3 -0
- package/dist/esm/hooks/useDomMutation.d.ts +3 -0
- package/dist/esm/hooks/useDomMutation.js +19 -0
- package/dist/esm/hooks/useDrag.js +2 -1
- package/dist/esm/hooks/useFileManager.d.ts +2 -0
- package/dist/esm/hooks/useFileManager.js +3 -0
- package/dist/esm/hooks/useImage.js +1 -0
- package/dist/esm/hooks/useIntersectionObserver.js +2 -1
- package/dist/esm/hooks/useMediaPlayer.d.ts +32 -0
- package/dist/esm/hooks/useMediaPlayer.js +86 -0
- package/dist/esm/hooks/useMergedRefs.d.ts +2 -0
- package/dist/esm/hooks/useMergedRefs.js +14 -0
- package/dist/esm/hooks/useMutationObserver.d.ts +3 -0
- package/dist/esm/hooks/useMutationObserver.js +20 -0
- package/dist/esm/hooks/useNetworkStatus.js +2 -1
- package/dist/esm/hooks/usePlayer.d.ts +32 -0
- package/dist/esm/hooks/usePlayer.js +85 -0
- package/dist/esm/hooks/useResizeObserver.js +2 -1
- package/dist/esm/hooks/useScrollbar.d.ts +16 -0
- package/dist/esm/hooks/useScrollbar.js +160 -0
- package/dist/esm/hooks/useSheet.js +1 -0
- package/dist/esm/hooks/useShortcuts.d.ts +7 -0
- package/dist/esm/hooks/useShortcuts.js +29 -0
- package/dist/esm/hooks/useSlider.d.ts +7 -0
- package/dist/esm/hooks/useSlider.js +23 -0
- package/dist/esm/hooks/useTruncateText.d.ts +2 -0
- package/dist/esm/hooks/useTruncateText.js +17 -0
- package/dist/esm/hooks/useViewTransition.d.ts +2 -0
- package/dist/esm/hooks/useViewTransition.js +13 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/types/interfaces.d.ts +2 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -138,10 +138,13 @@ const Sheet = forwardRef((props, ref) => {
|
|
|
138
138
|
};
|
|
139
139
|
if (sheetType == SHEET.Dialog) {
|
|
140
140
|
if (transition) {
|
|
141
|
-
const { from, to } = animationTransition(transition);
|
|
141
|
+
const { from, to } = animationTransition(transition, 20, true);
|
|
142
142
|
return {
|
|
143
|
-
from: { ...from, x: `-50%`, y: `-50%` },
|
|
144
|
-
to: { ...to, x: `-50%`, y: `-50%` },
|
|
143
|
+
// from: { ...from, x: `-50%`, y: `-50%` },
|
|
144
|
+
// to: { ...to, x: `-50%`, y: `-50%` },
|
|
145
|
+
// from: { ...from, x: `-50%` },
|
|
146
|
+
// to: { ...to, x: `-50%` },
|
|
147
|
+
from, to,
|
|
145
148
|
curve: curve || TRANSITION_CURVES.EaseInOut,
|
|
146
149
|
...base
|
|
147
150
|
};
|
|
@@ -173,9 +176,9 @@ const Sheet = forwardRef((props, ref) => {
|
|
|
173
176
|
}
|
|
174
177
|
}, [visible]);
|
|
175
178
|
if (sheetType == SHEET.Dialog) {
|
|
176
|
-
return _jsxs(_Fragment, { children: [_jsx(Overlay, { when: visible }), _jsxs(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} fixed`.trim(), style: style,
|
|
179
|
+
return _jsxs(_Fragment, { children: [_jsx(Overlay, { when: visible }), _jsxs(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} fixed`.trim(), style: style, fx: buildAnimation, ...rest, ref: innerRef, children: [_jsx(Cover, { when: loading, spinner: spinner, message: loadingMessage }), _jsxs(Box, { className: `--head flex aic rel`, children: [_jsx(Box, { className: `--${title ? `title` : `dot`} flex aic rel`, children: title || `` }), _jsx(Button, { onClick: (e) => setVisible(false), className: `--closer abs`, children: "\u00D7" })] }), _jsx(Box, { className: `--body flex aic rel ${action ? `` : `--no-action`}`.trim(), children: render ? renderMessage : null }), action && _jsx(Box, { className: `--footer flex aic rel ${actionPosition ? actionPosition == SHEET_ACTION_POSITION.Center ? `jcc` : `` : `jce`}`.trim(), children: action.map((a, i) => _jsx(Button, { onClick: (e) => a.handler ? a.handler() : a.onClick ? a.onClick() : console.log(`onClick Handler missing`), className: `--action`, children: a.label }, `sheet-${sheetID}-action-${a.key}`)) })] })] });
|
|
177
180
|
}
|
|
178
|
-
return _jsx(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} abs`.trim(), style: style, ...rest,
|
|
181
|
+
return _jsx(Box, { className: `--sheet --sheet-${sheetType.toLowerCase()} ${className} abs`.trim(), style: style, ...rest, fx: buildAnimation, ref: innerRef, children: visible ? msg : null });
|
|
179
182
|
});
|
|
180
183
|
export const isSheetHandler = (src) => {
|
|
181
184
|
return typeof src === `object`
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
3
|
import { hexToRgba } from "../../funs";
|
|
@@ -50,5 +49,5 @@ const Spinner = forwardRef((props, ref) => {
|
|
|
50
49
|
...build()
|
|
51
50
|
}, ...rest, children: child() });
|
|
52
51
|
});
|
|
53
|
-
Spinner.displayName = `Spinner`;
|
|
52
|
+
Spinner.displayName = `ZuzUI.Spinner`;
|
|
54
53
|
export default Spinner;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tab, TabViewHandler } from "./types";
|
|
2
|
-
declare const TabView: import("react").ForwardRefExoticComponent<import("..").BoxProps & {
|
|
2
|
+
declare const TabView: import("react").ForwardRefExoticComponent<Omit<import("..").BoxProps, "onChange"> & {
|
|
3
3
|
onChange?: (tab: Tab, index: number) => void;
|
|
4
4
|
speed?: number;
|
|
5
5
|
variant?: "fixed" | "default";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BoxProps } from "../Box";
|
|
3
3
|
export interface Tab {
|
|
4
|
-
onSelect
|
|
4
|
+
onSelect?: (tab: Tab, index: number) => void;
|
|
5
5
|
tag?: string;
|
|
6
6
|
key?: string;
|
|
7
7
|
icon?: ReactNode | ReactNode[];
|
|
@@ -15,7 +15,7 @@ export type TabProps = {
|
|
|
15
15
|
activeTab: number;
|
|
16
16
|
onClick: (index: number) => void;
|
|
17
17
|
};
|
|
18
|
-
export type TabViewProps = BoxProps & {
|
|
18
|
+
export type TabViewProps = Omit<BoxProps, "onChange"> & {
|
|
19
19
|
onChange?: (tab: Tab, index: number) => void;
|
|
20
20
|
speed?: number;
|
|
21
21
|
variant?: "fixed" | "default";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useMemo, useRef, useState } from "react";
|
|
4
|
-
import { PubSub, uuid } from "../..";
|
|
3
|
+
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { PubSub, SPINNER, Spinner, Text, uuid } from "../..";
|
|
5
5
|
import { useBase } from "../../hooks";
|
|
6
6
|
import Box from "../Box";
|
|
7
7
|
import Pagination from "../Pagination";
|
|
@@ -9,7 +9,8 @@ import { PaginationStyle } from "../Pagination/types";
|
|
|
9
9
|
import TRow from "./row";
|
|
10
10
|
// const Table = forwardRef<HTMLDivElement, TableProps>((props, ref) => {
|
|
11
11
|
const Table = (props, ref) => {
|
|
12
|
-
const { schema, rows, rowCount, rowsPerPage, currentPage, pagination, paginationHash, showPaginationOnZeroPageCount, animateRows, header, rowClassName, selectableRows, hoverable, sortBy, onSort, onRowSelectToggle, onPageChange, onRowContextMenu, ...pops } = props;
|
|
12
|
+
const { schema, rows, rowCount, rowsPerPage, currentPage, pagination, paginationHash, showPaginationOnZeroPageCount, animateRows, header, rowClassName, selectableRows, hoverable, sortBy, loading, loadingRowCount, loadingMessage, spinner, onSort, onRowSelectToggle, onPageChange, onRowContextMenu, ...pops } = props;
|
|
13
|
+
const _pagination = useRef(null);
|
|
13
14
|
const _schemaParsed = useMemo(() => schema.reduce((prev, c) => {
|
|
14
15
|
prev[c.id] = {
|
|
15
16
|
flex: c.weight || 1,
|
|
@@ -28,13 +29,19 @@ const Table = (props, ref) => {
|
|
|
28
29
|
const { style, className, rest } = useBase(pops);
|
|
29
30
|
const _tableRef = useRef(null);
|
|
30
31
|
const pubsub = useMemo(() => new PubSub(), []);
|
|
31
|
-
const rowKeys =
|
|
32
|
+
const rowKeys = useRef(rows.map(() => uuid()));
|
|
32
33
|
const [_sortBy, setSortBy] = useState(sortBy || null);
|
|
34
|
+
// const placeholderRows = useMemo(() => {
|
|
35
|
+
// }, [loading, loadingRowCount])
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
rowKeys.current = rows.map(() => uuid()); // Update only when rows change
|
|
38
|
+
}, [rows]);
|
|
33
39
|
const handleSort = (col, dir) => {
|
|
34
40
|
setSortBy(col);
|
|
35
41
|
onSort?.(col, dir);
|
|
36
42
|
};
|
|
37
|
-
|
|
43
|
+
const _paginated = useMemo(() => _jsx(Pagination, { hash: paginationHash, ref: _pagination, renderOnZeroPageCount: showPaginationOnZeroPageCount, onPageChange: onPageChange, paginationStyle: PaginationStyle.Table, startPage: currentPage, itemCount: rowCount || (rows ? rows.length : 0), itemsPerPage: rowsPerPage || 10 }), []);
|
|
44
|
+
return _jsxs(Box, { as: `--table ${(hoverable ?? true) ? `--hoverable` : ``} flex cols rel ${className}`, ref: _tableRef, children: [_header == true && _jsx(TRow, { sortBy: _sortBy, onSort: handleSort, tableRef: _tableRef, pubsub: pubsub, selectable: selectableRows, index: -1, schema: schema, loading: true, styles: _schemaParsed }), loading && _jsxs(Box, { as: `abs center-x flex aic --table-spinner`, children: [_jsx(Spinner, { type: spinner || SPINNER.Simple }), loadingMessage && _jsx(Text, { as: `--table-loading-message`, children: loadingMessage })] }), loading && Array(loadingRowCount || 5).fill({}).map((row, index) => _jsx(TRow, { tableRef: _tableRef, index: index, pubsub: pubsub, schema: schema, styles: _schemaParsed, loading: true, animate: animateRows }, `--trow-loading-${index}-${schema[0].id}`)), !loading && rows && rows.map((row, index) => _jsx(TRow, { tableRef: _tableRef, pubsub: pubsub, loading: false, index: index, schema: schema, ids: _cols, styles: _schemaParsed, animate: animateRows, data: row, rowClassName: rowClassName, selectable: selectableRows, onSelect: onRowSelectToggle, onContextMenu: onRowContextMenu }, `--trow-${rowKeys.current[index] || index}-${schema[0].id}`)), pagination && _pagination.current != null && _jsx(Box, { as: `--row flex aic --row-footer`, children: _paginated })] });
|
|
38
45
|
};
|
|
39
46
|
Table.displayName = `Table`;
|
|
40
47
|
const ForwardedTable = forwardRef(Table);
|
|
@@ -4,9 +4,10 @@ import { useDelayed } from "../../hooks";
|
|
|
4
4
|
import { CHECKBOX, TRANSITION_CURVES, TRANSITIONS } from "../../types/enums";
|
|
5
5
|
import Box from "../Box";
|
|
6
6
|
import CheckBox from "../CheckBox";
|
|
7
|
+
import Text from "../Text";
|
|
7
8
|
import TColumn from "./col";
|
|
8
9
|
const TRow = (props) => {
|
|
9
|
-
const { index, pubsub, schema, data, ids, styles, animate, sortBy, selectable, tableRef, rowClassName, onSort, onSelect, onContextMenu } = props;
|
|
10
|
+
const { index, pubsub, schema, data, ids, styles, animate, sortBy, selectable, tableRef, loading, rowClassName, onSort, onSelect, onContextMenu } = props;
|
|
10
11
|
const mounted = useDelayed();
|
|
11
12
|
const _animation = useMemo(() => ({
|
|
12
13
|
transition: TRANSITIONS.SlideInBottom,
|
|
@@ -78,7 +79,7 @@ const TRow = (props) => {
|
|
|
78
79
|
return _jsxs(Fragment, { children: [selectable && i == 0 && Selector(-1, `--selector-${c.id}`, `all`), _jsx(TColumn, { idx: -1, onSort: onSort, sortBy: sortBy,
|
|
79
80
|
// value={renderWhenHeader && render ? render!(index == -1 ? c as dynamicObject : data as T, index) : value as string}
|
|
80
81
|
value: value, ...cc, pubsub: pubsub, style: styles[c.id] })] }, `--col-${c.id}`);
|
|
81
|
-
}), index > -1 && ids && data && schema.map((c, i) => {
|
|
82
|
+
}), loading && index > -1 && _jsx(Box, { as: `--col`, children: _jsx(Text, { as: `opacity:0`, children: "..." }) }), !loading && index > -1 && ids && data && schema.map((c, i) => {
|
|
82
83
|
return _jsxs(Fragment, { children: [selectable && i == 0 && Selector(i, `--selector-${c.id}`, c.id.toString()), ids.includes(String(c.id)) ? _jsx(TColumn, { pubsub: pubsub, idx: i, id: String(c.id), style: styles[String(c.id)], value: c.render ? c.render(data, index) : data[String(c.id).includes(`.`) ? String(c.id).split(`.`).reverse()[0] : c.id] }) : null] }, `--${String(c.id)}-val-${i}`);
|
|
83
84
|
})] });
|
|
84
85
|
};
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from "react";
|
|
2
|
-
import { PubSub } from "../..";
|
|
2
|
+
import { PubSub, SPINNER } from "../..";
|
|
3
3
|
import { dynamicObject } from "../../types";
|
|
4
4
|
import { BoxProps } from "../Box";
|
|
5
5
|
import { PaginationCallback } from "../Pagination/types";
|
|
6
|
+
/**
|
|
7
|
+
* Callback function for row selection.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of data for each row.
|
|
10
|
+
* @param {T} row - The row data.
|
|
11
|
+
* @param {boolean} selected - Whether the row is selected.
|
|
12
|
+
*/
|
|
6
13
|
export type RowSelectCallback<T> = (row: T, selected: boolean) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Callback function for table sorting.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} col - The column key to sort by.
|
|
18
|
+
* @param {number} dir - The direction of sorting (1 for ascending, -1 for descending).
|
|
19
|
+
*/
|
|
7
20
|
export type TableSortCallback = (col: string, dir: number) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Represents a row in the table.
|
|
23
|
+
*
|
|
24
|
+
* @template T - The type of data for each row.
|
|
25
|
+
*
|
|
26
|
+
* @property {number} index - The index of the row.
|
|
27
|
+
* @property {Column<T>[]} schema - The schema defining the columns of the row.
|
|
28
|
+
* @property {dynamicObject} styles - The styles to apply to the row.
|
|
29
|
+
* @property {string[]} [ids] - The IDs associated with the row.
|
|
30
|
+
* @property {boolean} [animate] - Whether to animate the row.
|
|
31
|
+
* @property {T} [data] - The data for the row.
|
|
32
|
+
* @property {string} [rowClassName] - The CSS class name to apply to the row.
|
|
33
|
+
* @property {boolean} [selectable] - Whether the row is selectable.
|
|
34
|
+
* @property {string | null} [sortBy] - The column key to sort by.
|
|
35
|
+
* @property {RowSelectCallback<T>} [onSelect] - Callback when the row's selection state changes.
|
|
36
|
+
* @property {TableSortCallback} [onSort] - Callback when the row is sorted.
|
|
37
|
+
* @property {PubSub} pubsub - The PubSub instance for event handling.
|
|
38
|
+
* @property {RefObject<HTMLDivElement | null>} [tableRef] - The reference to the table element.
|
|
39
|
+
* @property {(e: React.MouseEvent<HTMLDivElement, MouseEvent>, row: T) => void} [onContextMenu] - Callback for row context menu event.
|
|
40
|
+
*/
|
|
8
41
|
export type Row<T> = {
|
|
9
42
|
index: number;
|
|
10
43
|
schema: Column<T>[];
|
|
@@ -18,9 +51,31 @@ export type Row<T> = {
|
|
|
18
51
|
onSelect?: RowSelectCallback<T>;
|
|
19
52
|
onSort?: TableSortCallback;
|
|
20
53
|
pubsub: PubSub;
|
|
54
|
+
loading: boolean;
|
|
21
55
|
tableRef?: RefObject<HTMLDivElement | null>;
|
|
22
56
|
onContextMenu?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, row: T) => void;
|
|
23
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Represents a column in the table.
|
|
60
|
+
*
|
|
61
|
+
* @template T - The type of data for each row.
|
|
62
|
+
*
|
|
63
|
+
* @property {string | number} id - The unique identifier for the column.
|
|
64
|
+
* @property {string | ReactNode | dynamicObject} [value] - The value to display in the column.
|
|
65
|
+
* @property {number} [weight] - The weight of the column for layout purposes.
|
|
66
|
+
* @property {number | string} [w] - The width of the column.
|
|
67
|
+
* @property {number | string} [maxW] - The maximum width of the column.
|
|
68
|
+
* @property {number | string} [minW] - The minimum width of the column.
|
|
69
|
+
* @property {number | string} [h] - The height of the column.
|
|
70
|
+
* @property {number | string} [maxH] - The maximum height of the column.
|
|
71
|
+
* @property {number | string} [minH] - The minimum height of the column.
|
|
72
|
+
* @property {boolean} [resize] - Whether the column is resizable.
|
|
73
|
+
* @property {boolean} [sortable] - Whether the column is sortable.
|
|
74
|
+
* @property {TableSortCallback} [onSort] - Callback when the column is sorted.
|
|
75
|
+
* @property {string} [as] - The HTML tag to render the column as.
|
|
76
|
+
* @property {boolean} [renderWhenHeader] - Whether to render the column when it is a header.
|
|
77
|
+
* @property {(row: T, index: number) => ReactNode} [render] - Function to render the column content.
|
|
78
|
+
*/
|
|
24
79
|
export type Column<T> = {
|
|
25
80
|
id: string | number;
|
|
26
81
|
value?: string | ReactNode | dynamicObject;
|
|
@@ -38,6 +93,34 @@ export type Column<T> = {
|
|
|
38
93
|
renderWhenHeader?: boolean;
|
|
39
94
|
render?: (row: T, index: number) => ReactNode;
|
|
40
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Props for the Table component.
|
|
98
|
+
*
|
|
99
|
+
* @template T - The type of data for each row.
|
|
100
|
+
*
|
|
101
|
+
* @extends BoxProps
|
|
102
|
+
*
|
|
103
|
+
* @property {Column<T>[]} schema - The schema defining the columns of the table.
|
|
104
|
+
* @property {T[]} rows - The data rows to be displayed in the table.
|
|
105
|
+
* @property {number} [rowCount] - The total number of rows.
|
|
106
|
+
* @property {number} [rowsPerPage] - The number of rows to display per page.
|
|
107
|
+
* @property {string} [rowClassName] - The CSS class name to apply to each row.
|
|
108
|
+
* @property {number} [currentPage] - The current page number.
|
|
109
|
+
* @property {boolean} [pagination] - Whether to enable pagination.
|
|
110
|
+
* @property {number | null} [paginationHash] - A hash to force pagination update.
|
|
111
|
+
* @property {boolean} [showPaginationOnZeroPageCount] - Whether to show pagination controls when there are zero pages.
|
|
112
|
+
* @property {boolean} [animateRows] - Whether to animate rows on change.
|
|
113
|
+
* @property {boolean} [header] - Whether to show the table header.
|
|
114
|
+
* @property {string} [sortBy] - The column key to sort by.
|
|
115
|
+
* @property {boolean} [selectableRows] - Whether rows are selectable.
|
|
116
|
+
* @property {boolean} [hoverable] - Whether rows should have a hover effect.
|
|
117
|
+
* @property {boolean} [loading] - Renders placeholder rows when true
|
|
118
|
+
* @property {number} [loadingRowCount] - If greater than 0, shows loading number of empty rows with spinner.
|
|
119
|
+
* @property {RowSelectCallback<T>} [onRowSelectToggle] - Callback when a row's selection state changes.
|
|
120
|
+
* @property {(e: React.MouseEvent<HTMLDivElement, MouseEvent>, row: T) => void} [onRowContextMenu] - Callback for row context menu event.
|
|
121
|
+
* @property {PaginationCallback} [onPageChange] - Callback when the page changes.
|
|
122
|
+
* @property {TableSortCallback} [onSort] - Callback when the table is sorted.
|
|
123
|
+
*/
|
|
41
124
|
export type TableProps<T> = BoxProps & {
|
|
42
125
|
schema: Column<T>[];
|
|
43
126
|
rows: T[];
|
|
@@ -53,6 +136,10 @@ export type TableProps<T> = BoxProps & {
|
|
|
53
136
|
sortBy?: string;
|
|
54
137
|
selectableRows?: boolean;
|
|
55
138
|
hoverable?: boolean;
|
|
139
|
+
loading?: boolean;
|
|
140
|
+
loadingRowCount?: number;
|
|
141
|
+
loadingMessage?: string;
|
|
142
|
+
spinner?: SPINNER;
|
|
56
143
|
onRowSelectToggle?: RowSelectCallback<T>;
|
|
57
144
|
onRowContextMenu?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, row: T) => void;
|
|
58
145
|
onPageChange?: PaginationCallback;
|
|
@@ -3,9 +3,11 @@ import { Props } from '../../types';
|
|
|
3
3
|
export type TextProps = Props<`h1` | `h2` | `h3` | `h4` | `h5` | `h6`> & {
|
|
4
4
|
h?: number;
|
|
5
5
|
html?: ReactNode | string;
|
|
6
|
+
lines?: number;
|
|
6
7
|
};
|
|
7
8
|
declare const Text: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">, keyof import("../..").ZuzProps> & {
|
|
8
9
|
h?: number;
|
|
9
10
|
html?: ReactNode | string;
|
|
11
|
+
lines?: number;
|
|
10
12
|
} & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
11
13
|
export default Text;
|
|
@@ -3,10 +3,12 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import { useBase } from '../../hooks';
|
|
4
4
|
import Span from '../Span';
|
|
5
5
|
const Text = forwardRef((props, ref) => {
|
|
6
|
-
const { h, html, children, ...pops } = props;
|
|
6
|
+
const { h, html, children, lines, ...pops } = props;
|
|
7
7
|
const { style, className, rest } = useBase(pops);
|
|
8
|
+
// const textRef = useTruncateText(lines || 2)
|
|
9
|
+
// const mergedRef = useMergedRefs(ref, textRef)
|
|
8
10
|
const Tag = `h${props.h || 1}`;
|
|
9
11
|
return _jsx(Tag, { ref: ref, style: style, className: className, ...rest, children: html ? _jsx(Span, { dangerouslySetInnerHTML: { __html: html } }) : children });
|
|
10
12
|
});
|
|
11
|
-
Text.displayName = `Text`;
|
|
13
|
+
Text.displayName = `ZuzUI.Text`;
|
|
12
14
|
export default Text;
|
|
@@ -2,10 +2,12 @@ import { Props } from '../../types';
|
|
|
2
2
|
import { Variant } from '../../types/enums';
|
|
3
3
|
export type TextAreaProps = Props<`textarea`> & {
|
|
4
4
|
autoResize?: boolean;
|
|
5
|
+
resize?: `none` | `block` | `both` | `horizontal` | `vertical`;
|
|
5
6
|
variant?: Variant;
|
|
6
7
|
};
|
|
7
8
|
declare const TextArea: import("react").ForwardRefExoticComponent<import("../..").ZuzProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref">, keyof import("../..").ZuzProps> & {
|
|
8
9
|
autoResize?: boolean;
|
|
10
|
+
resize?: `none` | `block` | `both` | `horizontal` | `vertical`;
|
|
9
11
|
variant?: Variant;
|
|
10
12
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
11
13
|
export default TextArea;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { forwardRef } from 'react';
|
|
4
3
|
import { useBase } from '../../hooks';
|
|
5
4
|
import { Variant } from '../../types/enums';
|
|
6
5
|
const TextArea = forwardRef((props, ref) => {
|
|
7
|
-
const { autoResize, variant, ...pops } = props;
|
|
6
|
+
const { autoResize, variant, resize, ...pops } = props;
|
|
8
7
|
const { style, className, rest } = useBase(pops);
|
|
9
8
|
const handleInput = (event) => {
|
|
10
9
|
};
|
|
11
|
-
return _jsx("textarea", { className: `--input --textarea --${variant || Variant.Small} flex ${className}`.trim(), style: style, onInput: handleInput, ref: ref, ...rest });
|
|
10
|
+
return _jsx("textarea", { className: `--input --textarea --${variant || Variant.Small} flex ${className}`.trim(), style: { ...style, resize: resize || `none` }, onInput: handleInput, ref: ref, ...rest });
|
|
12
11
|
});
|
|
13
|
-
TextArea.displayName = `TextArea`;
|
|
12
|
+
TextArea.displayName = `ZuzUI.TextArea`;
|
|
14
13
|
export default TextArea;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef, useEffect, useImperativeHandle, useState } from "react";
|
|
3
4
|
import Box from "../Box";
|
|
@@ -19,7 +20,7 @@ const TreeView = forwardRef((props, ref) => {
|
|
|
19
20
|
}, [_selected]);
|
|
20
21
|
return _jsx(Box, { className: `--treeview flex cols`, children: nodes
|
|
21
22
|
.filter(node => roots.includes(node.tag))
|
|
22
|
-
.map(node => _jsx(TreeItem, { treeTag: treeViewTag ? `-${treeViewTag}` : ``, selected: selected, onSelect: e => handleSelect(e), icons: icons, meta: node,
|
|
23
|
+
.map(node => _jsx(TreeItem, { treeTag: treeViewTag ? `-${treeViewTag}` : ``, selected: selected, onSelect: e => handleSelect(e), icons: icons, meta: node, roots: roots, expanded: node.expanded || false, skeleton: rest.skeleton, nodes: nodes }, `--node-${node.tag}`)) });
|
|
23
24
|
});
|
|
24
|
-
TreeView.displayName = `TreeView`;
|
|
25
|
+
TreeView.displayName = `ZuzUI.TreeView`;
|
|
25
26
|
export default TreeView;
|
|
@@ -3,8 +3,8 @@ declare const TreeItem: import("react").ForwardRefExoticComponent<import("..").B
|
|
|
3
3
|
treeTag: string;
|
|
4
4
|
meta: import("./types").TreeNode;
|
|
5
5
|
nodes: import("./types").TreeNode[];
|
|
6
|
-
isRoot: boolean;
|
|
7
6
|
expanded: boolean;
|
|
7
|
+
roots: string[];
|
|
8
8
|
onSelect: (tag: string) => void;
|
|
9
9
|
selected?: String;
|
|
10
10
|
icons?: import("./types").TreeNodeIcons;
|
|
@@ -6,8 +6,9 @@ import Icon from "../Icon";
|
|
|
6
6
|
import Text from "../Text";
|
|
7
7
|
import SVGIcons from "../svgicons";
|
|
8
8
|
const TreeItem = forwardRef((props, ref) => {
|
|
9
|
-
const { as, meta, nodes, icons, onSelect, treeTag, selected,
|
|
9
|
+
const { as, meta, nodes, icons, onSelect, treeTag, selected, roots, expanded, ...rest } = props;
|
|
10
10
|
const { tag, label, icon, under, isHead } = meta;
|
|
11
|
+
const isRoot = useMemo(() => roots.includes(tag), [roots]);
|
|
11
12
|
const [isOpen, setIsOpen] = useState(expanded);
|
|
12
13
|
const toggle = () => {
|
|
13
14
|
localStorage.setItem(`--tn${treeTag}-${tag}`, isOpen ? `0` : `1`);
|
|
@@ -22,11 +23,11 @@ const TreeItem = forwardRef((props, ref) => {
|
|
|
22
23
|
setIsOpen(localStorage.getItem(`--tn${treeTag}-${tag}`) == `1`);
|
|
23
24
|
}, []);
|
|
24
25
|
const _nodes = useMemo(() => nodes.filter(x => x.under == tag), [nodes, tag]);
|
|
25
|
-
return _jsxs(Box, { className: `--treenode --treenode-${tag} flex cols`, children: [_jsxs(Box, { className: `--node --node-${tag} flex aic ${
|
|
26
|
+
return _jsxs(Box, { className: `--treenode ${isRoot ? `--is-root` : ``} --treenode-${tag} flex cols`, children: [_jsxs(Box, { className: `--node --node-${tag} flex aic ${selected == tag ? ` --selected` : ``}`, children: [_jsx(Button, { skeleton: rest.skeleton, onClick: toggle, className: `--node-aro-btn`, disabled: _nodes.length == 0, children: icons?.arrowClose && icons?.arrowOpen ? _jsx(Icon, { skeleton: rest.skeleton, className: `--node-aro-icon`, name: _nodes.length == 0 ? icons?.arrowDisabled || icons?.arrowClose : isOpen ? icons?.arrowOpen : icons?.arrowClose })
|
|
26
27
|
: _nodes.length == 0 ? SVGIcons.chevronBottom : isOpen ? SVGIcons.chevronBottom : SVGIcons.chevronRight }), _jsxs(Button, { className: `--node-meta flex aic`, onClick: (e) => onSelect(tag), children: [((icons?.nodeOpen && icons?.nodeClose) || (isRoot && icons?.rootOpen && icons?.rootClose)) &&
|
|
27
|
-
_jsx(Icon, { skeleton: rest.skeleton, className: `--node-icon`, name: icon || (isOpen ?
|
|
28
|
+
_jsx(Icon, { skeleton: rest.skeleton, className: `--node-icon ${isRoot ? `--icon-root` : ``}`, name: icon || (isOpen ?
|
|
28
29
|
isRoot ? icons?.rootOpen || icons.nodeOpen : icons.nodeOpen
|
|
29
|
-
: isRoot ? icons?.rootClose || icons?.nodeClose : icons?.nodeClose) }), _jsx(Text, { ...{ className: `--node-label` }, skeleton: rest.skeleton, children: label })] })] }), isOpen && _nodes.length > 0 && _jsx(Box, { className: `--sub-node tree-sub-node-${tag} flex cols`, children: _nodes.map(node => _jsx(TreeItem, { treeTag: treeTag, selected: selected, onSelect: onSelect, icons: icons,
|
|
30
|
+
: isRoot ? icons?.rootClose || icons?.nodeClose : icons?.nodeClose) }), _jsx(Text, { ...{ className: `--node-label` }, skeleton: rest.skeleton, children: label })] })] }), isOpen && _nodes.length > 0 && _jsx(Box, { className: `--sub-node tree-sub-node-${tag} flex cols`, children: _nodes.map(node => _jsx(TreeItem, { treeTag: treeTag, selected: selected, onSelect: onSelect, icons: icons, roots: roots, expanded: node.expanded || false, meta: node, nodes: nodes }, `--node-${node.tag}`)) })] });
|
|
30
31
|
});
|
|
31
32
|
TreeItem.displayName = `TreeItem`;
|
|
32
33
|
export default TreeItem;
|
|
@@ -9,7 +9,7 @@ export { default as AutoComplete } from './AutoComplete';
|
|
|
9
9
|
export * from './AutoComplete/types';
|
|
10
10
|
export { default as Avatar } from './Avatar';
|
|
11
11
|
export * from './Avatar/types';
|
|
12
|
-
export {
|
|
12
|
+
export { default as Box, type BoxProps } from './Box';
|
|
13
13
|
export { default as Button } from './Button';
|
|
14
14
|
export * from './Button/types';
|
|
15
15
|
export { default as CheckBox } from './CheckBox';
|
|
@@ -19,7 +19,9 @@ export { default as ContextMenu } from './ContextMenu';
|
|
|
19
19
|
export * from './ContextMenu/types';
|
|
20
20
|
export { default as CookiesConsent } from './CookiesConsent';
|
|
21
21
|
export * from './CookiesConsent/types';
|
|
22
|
-
export {
|
|
22
|
+
export { default as Cover, type CoverProps } from './Cover';
|
|
23
|
+
export { default as Crumb } from './Crumb';
|
|
24
|
+
export * from './Crumb/types';
|
|
23
25
|
export { default as Drawer } from './Drawer';
|
|
24
26
|
export * from './Drawer/types';
|
|
25
27
|
/**Editor */
|
|
@@ -29,43 +31,49 @@ export * from './Editor/types';
|
|
|
29
31
|
export { default as withEditor } from './Editor/withEditor';
|
|
30
32
|
export { default as Fab } from './Fab';
|
|
31
33
|
export * from './Fab/types';
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
34
|
+
export { default as Filters, type FilterProps } from './Filters';
|
|
35
|
+
export { default as Form } from './Form';
|
|
36
|
+
export * from './Form/types';
|
|
37
|
+
export { default as Icon, type IconProps } from './Icon';
|
|
38
|
+
export { default as Image, type ImageProps } from './Image';
|
|
39
|
+
export { default as Input, type InputProps } from './Input';
|
|
40
|
+
export { default as KeyboardKeys } from './KeyboardKeys';
|
|
41
|
+
export * from './KeyboardKeys/types';
|
|
42
|
+
export { default as Label, type LabelProps } from './Label';
|
|
38
43
|
export { default as List } from './List';
|
|
39
44
|
export * from './List/types';
|
|
40
45
|
export { default as NetworkStatus } from './Network';
|
|
41
46
|
export * from './Network/types';
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
47
|
+
export { default as Overlay, type OverlayProps } from './Overlay';
|
|
48
|
+
export { default as Password, type PasswordProps } from './Password';
|
|
49
|
+
export { default as PinInput, type PinInputProps } from './PinInput';
|
|
45
50
|
export { default as Pagination } from './Pagination';
|
|
46
51
|
export * from './Pagination/types';
|
|
47
52
|
export { default as ProgressBar } from './ProgressBar';
|
|
48
53
|
export * from './ProgressBar/types';
|
|
49
54
|
export { default as Radio } from './Radio';
|
|
50
55
|
export * from './Radio/types';
|
|
51
|
-
export {
|
|
56
|
+
export { default as ScrollView } from './ScrollView';
|
|
57
|
+
export * from './ScrollView/types';
|
|
58
|
+
export { default as Search } from './Search';
|
|
59
|
+
export * from './Search/types';
|
|
52
60
|
export { default as SelectTabs } from './Segmented';
|
|
53
61
|
export * from './Segmented/types';
|
|
54
62
|
export { default as Select } from './Select';
|
|
55
63
|
export * from './Select/types';
|
|
56
|
-
export {
|
|
64
|
+
export { default as Sheet, type SheetHandler, type SheetProps } from './Sheet';
|
|
57
65
|
export { default as SideBar } from './Sidebar';
|
|
58
66
|
export * from './Sidebar/types';
|
|
59
|
-
export {
|
|
60
|
-
export {
|
|
61
|
-
export {
|
|
67
|
+
export { default as Slider, type SliderProps } from './Slider';
|
|
68
|
+
export { default as Span, type SpanProps } from './Span';
|
|
69
|
+
export { default as Spinner, type SpinnerProps } from './Spinner';
|
|
62
70
|
export { default as Switch } from './Switch';
|
|
63
71
|
export { default as Table } from './Table';
|
|
64
72
|
export * from './Table/types';
|
|
65
73
|
export { default as TabView } from './TabView';
|
|
66
74
|
export * from './TabView/types';
|
|
67
|
-
export {
|
|
68
|
-
export {
|
|
75
|
+
export { default as Text, type TextProps } from './Text';
|
|
76
|
+
export { default as Textarea, type TextAreaProps } from './TextArea';
|
|
69
77
|
export { default as TextWheel } from './TextWheel';
|
|
70
78
|
export * from './TextWheel/types';
|
|
71
79
|
export { default as ToolTip } from './Tooltip';
|
package/dist/esm/comps/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export * from './ContextMenu/types';
|
|
|
20
20
|
export { default as CookiesConsent } from './CookiesConsent';
|
|
21
21
|
export * from './CookiesConsent/types';
|
|
22
22
|
export { default as Cover } from './Cover';
|
|
23
|
+
export { default as Crumb } from './Crumb';
|
|
24
|
+
export * from './Crumb/types';
|
|
23
25
|
export { default as Drawer } from './Drawer';
|
|
24
26
|
export * from './Drawer/types';
|
|
25
27
|
/**Editor */
|
|
@@ -31,9 +33,12 @@ export { default as Fab } from './Fab';
|
|
|
31
33
|
export * from './Fab/types';
|
|
32
34
|
export { default as Filters } from './Filters';
|
|
33
35
|
export { default as Form } from './Form';
|
|
36
|
+
export * from './Form/types';
|
|
34
37
|
export { default as Icon } from './Icon';
|
|
35
38
|
export { default as Image } from './Image';
|
|
36
39
|
export { default as Input } from './Input';
|
|
40
|
+
export { default as KeyboardKeys } from './KeyboardKeys';
|
|
41
|
+
export * from './KeyboardKeys/types';
|
|
37
42
|
export { default as Label } from './Label';
|
|
38
43
|
export { default as List } from './List';
|
|
39
44
|
export * from './List/types';
|
|
@@ -48,7 +53,10 @@ export { default as ProgressBar } from './ProgressBar';
|
|
|
48
53
|
export * from './ProgressBar/types';
|
|
49
54
|
export { default as Radio } from './Radio';
|
|
50
55
|
export * from './Radio/types';
|
|
56
|
+
export { default as ScrollView } from './ScrollView';
|
|
57
|
+
export * from './ScrollView/types';
|
|
51
58
|
export { default as Search } from './Search';
|
|
59
|
+
export * from './Search/types';
|
|
52
60
|
export { default as SelectTabs } from './Segmented';
|
|
53
61
|
export * from './Segmented/types';
|
|
54
62
|
export { default as Select } from './Select';
|
package/dist/esm/funs/css.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OptionValues } from "commander";
|
|
2
2
|
import Hashids from "hashids";
|
|
3
|
+
import { dynamicObject } from "../types";
|
|
3
4
|
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
4
|
-
import { OptionValues } from "commander";
|
|
5
5
|
declare class CSS {
|
|
6
6
|
cache: dynamicObject;
|
|
7
7
|
PROPS: dynamicObject;
|
|
@@ -52,7 +52,7 @@ declare class CSS {
|
|
|
52
52
|
export default CSS;
|
|
53
53
|
export declare const buildWithStyles: (source: dynamicObject) => dynamicObject;
|
|
54
54
|
export declare const getAnimationCurve: (curve?: string | TRANSITION_CURVES) => string;
|
|
55
|
-
export declare const animationTransition: (transition: TRANSITIONS) => {
|
|
55
|
+
export declare const animationTransition: (transition: TRANSITIONS, offset?: number, dialog?: boolean) => {
|
|
56
56
|
from: {};
|
|
57
57
|
to: {};
|
|
58
58
|
};
|
package/dist/esm/funs/css.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __SALT, FIELNAME_KEY, isColor, isHexColor, isNumber, LINE_KEY, setDeep } from "./index.js";
|
|
2
|
-
import { cssAnimationCurves, cssDirect, cssFilterKeys, cssProps, cssPropsWithColor, cssTransformKeys, cssWithKeys } from "./stylesheet.js";
|
|
3
1
|
import Hashids from "hashids";
|
|
4
|
-
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
5
2
|
import md5 from "md5";
|
|
6
3
|
import pc from "picocolors";
|
|
4
|
+
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
5
|
+
import { __SALT, FIELNAME_KEY, isColor, isHexColor, isNumber, LINE_KEY, setDeep } from "./index.js";
|
|
6
|
+
import { cssAnimationCurves, cssDirect, cssFilterKeys, cssProps, cssPropsWithColor, cssTransformKeys, cssWithKeys } from "./stylesheet.js";
|
|
7
7
|
class CSS {
|
|
8
8
|
cache;
|
|
9
9
|
PROPS;
|
|
@@ -935,39 +935,41 @@ export const getAnimationCurve = (curve) => {
|
|
|
935
935
|
switch (curve.toUpperCase()) {
|
|
936
936
|
case TRANSITION_CURVES.Bounce:
|
|
937
937
|
return `var(--bounce)`;
|
|
938
|
-
// return `linear( 0, 0.0039, 0.0157, 0.0352, 0.0625 9.09%,
|
|
939
|
-
// 0.1407, 0.25, 0.3908, 0.5625, 0.7654,
|
|
940
|
-
// 1, 0.8907, 0.8125 45.45%, 0.7852, 0.7657,
|
|
941
|
-
// 0.7539, 0.75, 0.7539, 0.7657, 0.7852,
|
|
942
|
-
// 0.8125 63.64%, 0.8905, 1 72.73%, 0.9727, 0.9532,
|
|
943
|
-
// 0.9414, 0.9375, 0.9414, 0.9531, 0.9726,
|
|
944
|
-
// 1, 0.9883, 0.9844, 0.9883, 1 )`
|
|
945
|
-
break;
|
|
946
938
|
case TRANSITION_CURVES.Spring:
|
|
947
939
|
// return `cubic-bezier(0.2, -0.36, 0, 1.46)`
|
|
948
940
|
return `var(--spring)`;
|
|
949
|
-
break;
|
|
950
941
|
case TRANSITION_CURVES.EaseInOut:
|
|
951
942
|
// return `cubic-bezier(0.42, 0, 0.58, 1)`
|
|
952
943
|
return `ease-in-out`;
|
|
953
|
-
break;
|
|
954
944
|
default:
|
|
955
945
|
return `linear`;
|
|
956
946
|
}
|
|
957
947
|
};
|
|
958
|
-
export const animationTransition = (transition) => {
|
|
948
|
+
export const animationTransition = (transition, offset = 0, dialog = false) => {
|
|
959
949
|
let _from = {};
|
|
960
950
|
let _to = {};
|
|
961
951
|
switch (transition) {
|
|
962
952
|
case TRANSITIONS.SlideInLeft:
|
|
963
953
|
case TRANSITIONS.SlideInRight:
|
|
964
|
-
_from = { x: transition == TRANSITIONS.SlideInLeft ?
|
|
965
|
-
|
|
954
|
+
_from = { x: transition == TRANSITIONS.SlideInLeft ?
|
|
955
|
+
dialog ? `-${50 + (offset || 10)}%` : -20 :
|
|
956
|
+
dialog ? `-${50 - (offset || 10)}%` : 20,
|
|
957
|
+
y: dialog ? `-50%` : 0,
|
|
958
|
+
opacity: 0 };
|
|
959
|
+
_to = { x: dialog ? `-50%` : 0, y: dialog ? `-50%` : 0, opacity: 1 };
|
|
966
960
|
break;
|
|
967
961
|
case TRANSITIONS.SlideInTop:
|
|
968
962
|
case TRANSITIONS.SlideInBottom:
|
|
969
|
-
_from = {
|
|
970
|
-
|
|
963
|
+
_from = {
|
|
964
|
+
y: transition == TRANSITIONS.SlideInTop ?
|
|
965
|
+
//Top
|
|
966
|
+
dialog ? `-${50 + (offset || 10)}%` : -20
|
|
967
|
+
//Bottom
|
|
968
|
+
: dialog ? `-${50 - (offset || 10)}%` : 20,
|
|
969
|
+
x: dialog ? `-50%` : 0,
|
|
970
|
+
opacity: 0
|
|
971
|
+
};
|
|
972
|
+
_to = { y: dialog ? `-50%` : 0, x: dialog ? `-50%` : 0, opacity: 1 };
|
|
971
973
|
break;
|
|
972
974
|
case TRANSITIONS.ScaleIn:
|
|
973
975
|
_from = { scale: 0, opacity: 0 };
|
package/dist/esm/funs/index.d.ts
CHANGED
|
@@ -74,3 +74,4 @@ export declare const getPositionAroundElement: (x: number, y: number, distance:
|
|
|
74
74
|
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
75
75
|
export declare function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): Ref<T>;
|
|
76
76
|
export declare const slugify: (text: string, separator?: string) => string;
|
|
77
|
+
export declare const truncate: (selector: string, lines?: number) => void;
|