@pushwoosh/dumb-components 1.0.4 → 1.0.6
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/Drawer/components/Drawer/index.d.ts +1 -0
- package/Drawer/components/Drawer/index.js +1 -0
- package/Drawer/{styles.js → components/Drawer/styles.js} +4 -4
- package/Drawer/components/DrawerContent/index.d.ts +1 -0
- package/Drawer/components/DrawerContent/index.js +1 -0
- package/Drawer/components/DrawerContent/styles.d.ts +3 -0
- package/Drawer/components/DrawerContent/styles.js +14 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.d.ts +3 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.js +45 -0
- package/Drawer/components/DrawerDocs/hooks.d.ts +5 -0
- package/Drawer/components/DrawerDocs/hooks.js +15 -0
- package/Drawer/components/DrawerDocs/index.d.ts +2 -0
- package/Drawer/components/DrawerDocs/index.js +2 -0
- package/Drawer/components/DrawerDocs/styles.d.ts +5 -0
- package/Drawer/components/DrawerDocs/styles.js +16 -0
- package/Drawer/components/DrawerDocs/types.d.ts +5 -0
- package/Drawer/components/DrawerDocs/types.js +1 -0
- package/Drawer/index.d.ts +3 -1
- package/Drawer/index.js +3 -1
- package/DropdownMenu/components/DropdownMenuItem/index.d.ts +1 -0
- package/DropdownMenu/index.d.ts +1 -1
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +2 -2
- package/Select/Select.d.ts +6 -0
- package/Select/Select.js +39 -0
- package/Select/constants.d.ts +1 -0
- package/Select/constants.js +1 -0
- package/Select/index.d.ts +3 -0
- package/Select/index.js +2 -0
- package/Select/styles.d.ts +6 -0
- package/Select/styles.js +31 -0
- package/Select/types.d.ts +15 -0
- package/Select/types.js +1 -0
- package/Spinner/Spinner.js +3 -6
- package/Spinner/assets/spinner.medium.svg +1 -1
- package/Spinner/assets/spinner.small.svg +1 -1
- package/Table/assets/box.svg +1 -0
- package/Table/assets/error.svg +1 -0
- package/Table/assets/notfound.svg +1 -0
- package/Table/components/ClearableInput/ClearableInput.d.ts +3 -0
- package/Table/components/ClearableInput/ClearableInput.js +20 -0
- package/Table/components/ClearableInput/index.d.ts +1 -0
- package/Table/components/ClearableInput/index.js +1 -0
- package/Table/components/ClearableInput/styles.d.ts +14 -0
- package/Table/components/ClearableInput/styles.js +10 -0
- package/Table/components/ClearableInput/types.d.ts +5 -0
- package/Table/components/ClearableInput/types.js +1 -0
- package/Table/components/DataTable/DataTable.d.ts +4 -0
- package/Table/components/DataTable/DataTable.js +74 -0
- package/Table/components/DataTable/index.d.ts +1 -0
- package/Table/components/DataTable/index.js +1 -0
- package/Table/components/DataTable/types.d.ts +22 -0
- package/Table/components/DataTable/types.js +1 -0
- package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +4 -0
- package/Table/components/DataTableGetContext/DataTableGetContext.js +8 -0
- package/Table/components/DataTableGetContext/index.d.ts +1 -0
- package/Table/components/DataTableGetContext/index.js +1 -0
- package/Table/components/DataTableGetContext/types.d.ts +5 -0
- package/Table/components/DataTableGetContext/types.js +1 -0
- package/Table/components/DataTableList/DataTableList.d.ts +3 -0
- package/Table/components/DataTableList/DataTableList.js +77 -0
- package/Table/components/DataTableList/index.d.ts +1 -0
- package/Table/components/DataTableList/index.js +1 -0
- package/Table/components/DataTableList/types.d.ts +4 -0
- package/Table/components/DataTableList/types.js +1 -0
- package/Table/components/DataTablePagination/DataTablePagination.d.ts +3 -0
- package/Table/components/DataTablePagination/DataTablePagination.js +33 -0
- package/Table/components/DataTablePagination/index.d.ts +1 -0
- package/Table/components/DataTablePagination/index.js +1 -0
- package/Table/components/DataTablePagination/types.d.ts +4 -0
- package/Table/components/DataTablePagination/types.js +1 -0
- package/Table/components/DataTableSearchInput/DataTableSearchInput.d.ts +3 -0
- package/Table/components/DataTableSearchInput/DataTableSearchInput.js +31 -0
- package/Table/components/DataTableSearchInput/index.d.ts +1 -0
- package/Table/components/DataTableSearchInput/index.js +1 -0
- package/Table/components/DataTableSearchInput/types.d.ts +3 -0
- package/Table/components/DataTableSearchInput/types.js +1 -0
- package/Table/components/DataTableSortableCell/DataTableSortableCell.d.ts +3 -0
- package/Table/components/DataTableSortableCell/DataTableSortableCell.js +25 -0
- package/Table/components/DataTableSortableCell/index.d.ts +1 -0
- package/Table/components/DataTableSortableCell/index.js +1 -0
- package/Table/components/DataTableSortableCell/types.d.ts +4 -0
- package/Table/components/DataTableSortableCell/types.js +1 -0
- package/Table/components/Loading/Loading.d.ts +2 -0
- package/Table/components/Loading/Loading.js +20 -0
- package/Table/components/Loading/index.d.ts +1 -0
- package/Table/components/Loading/index.js +1 -0
- package/Table/components/Loading/styles.d.ts +1 -0
- package/Table/components/Loading/styles.js +6 -0
- package/Table/components/TableList/TableList.d.ts +3 -0
- package/Table/components/TableList/TableList.js +15 -0
- package/Table/components/TableList/index.d.ts +1 -0
- package/Table/components/TableList/index.js +1 -0
- package/Table/components/TableList/types.d.ts +9 -0
- package/Table/components/TableList/types.js +1 -0
- package/Table/components/TablePagination/TablePagination.d.ts +3 -0
- package/Table/components/TablePagination/TablePagination.js +38 -0
- package/Table/components/TablePagination/index.d.ts +1 -0
- package/Table/components/TablePagination/index.js +1 -0
- package/Table/components/TablePagination/types.d.ts +9 -0
- package/Table/components/TablePagination/types.js +1 -0
- package/Table/context.d.ts +2 -0
- package/Table/context.js +2 -0
- package/Table/hooks/index.d.ts +2 -0
- package/Table/hooks/index.js +2 -0
- package/Table/hooks/useDataTableContext.d.ts +11 -0
- package/Table/hooks/useDataTableContext.js +23 -0
- package/Table/hooks/useDataTableParams.d.ts +10 -0
- package/Table/hooks/useDataTableParams.js +39 -0
- package/Table/index.d.ts +13 -0
- package/Table/index.js +12 -0
- package/Table/styles.d.ts +73 -0
- package/Table/styles.js +60 -0
- package/Table/types.d.ts +20 -0
- package/Table/types.js +1 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/package.json +4 -2
- /package/Drawer/{Drawer.d.ts → components/Drawer/Drawer.d.ts} +0 -0
- /package/Drawer/{Drawer.js → components/Drawer/Drawer.js} +0 -0
- /package/Drawer/{maps.d.ts → components/Drawer/maps.d.ts} +0 -0
- /package/Drawer/{maps.js → components/Drawer/maps.js} +0 -0
- /package/Drawer/{styles.d.ts → components/Drawer/styles.d.ts} +0 -0
- /package/Drawer/{types.d.ts → components/Drawer/types.d.ts} +0 -0
- /package/Drawer/{types.js → components/Drawer/types.js} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useLayoutEffect, useMemo } from 'react';
|
|
2
|
+
import { useAsyncFn, usePersistentFunction } from '@pushwoosh/kit-helpers';
|
|
3
|
+
export function useDataTableContext({
|
|
4
|
+
getItems,
|
|
5
|
+
params,
|
|
6
|
+
onChangeParams
|
|
7
|
+
}) {
|
|
8
|
+
const getItemsPersistent = usePersistentFunction(getItems);
|
|
9
|
+
const [listAsync, reload] = useAsyncFn(() => getItemsPersistent(params), [params], {
|
|
10
|
+
loading: true
|
|
11
|
+
});
|
|
12
|
+
useLayoutEffect(() => {
|
|
13
|
+
reload({
|
|
14
|
+
reset: true
|
|
15
|
+
});
|
|
16
|
+
}, [reload]);
|
|
17
|
+
return useMemo(() => ({
|
|
18
|
+
data: listAsync,
|
|
19
|
+
reload,
|
|
20
|
+
params,
|
|
21
|
+
onChangeParams: onChangeParams
|
|
22
|
+
}), [reload, params, listAsync, onChangeParams]);
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataTableParams } from '../types';
|
|
2
|
+
type UseDataTableParamsParams<P extends DataTableParams> = {
|
|
3
|
+
defaultOrder: string;
|
|
4
|
+
defaultDirection?: 'asc' | 'desc';
|
|
5
|
+
defaultPerPage?: number;
|
|
6
|
+
extend?: (obj: Record<string, string>, params: DataTableParams) => P;
|
|
7
|
+
};
|
|
8
|
+
type UseDataTableParamsReturn<P> = readonly [P, (params: P) => void];
|
|
9
|
+
export declare function useDataTableParams<P extends DataTableParams>({ defaultOrder, defaultDirection, defaultPerPage, extend, }: UseDataTableParamsParams<P>): UseDataTableParamsReturn<P>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo, useRef } from 'react';
|
|
2
|
+
import { useNavigate, useLocation } from 'react-router-dom';
|
|
3
|
+
import { usePersistentFunction } from '@pushwoosh/kit-helpers';
|
|
4
|
+
function pickBy(obj) {
|
|
5
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => !!value));
|
|
6
|
+
}
|
|
7
|
+
export function useDataTableParams({
|
|
8
|
+
defaultOrder,
|
|
9
|
+
defaultDirection = 'asc',
|
|
10
|
+
defaultPerPage = 10,
|
|
11
|
+
extend
|
|
12
|
+
}) {
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const {
|
|
15
|
+
search: locationSearch
|
|
16
|
+
} = useLocation();
|
|
17
|
+
const extendRef = useRef(extend);
|
|
18
|
+
extendRef.current = extend;
|
|
19
|
+
const dataTableParams = useMemo(() => {
|
|
20
|
+
const searchParams = new URLSearchParams(locationSearch);
|
|
21
|
+
const obj = Object.fromEntries(searchParams);
|
|
22
|
+
// eslint-disable-next-line no-nested-ternary
|
|
23
|
+
const realOrderDirection = !obj.direction ? defaultDirection : obj.direction === 'asc' ? 'asc' : 'desc';
|
|
24
|
+
const params = {
|
|
25
|
+
search: obj.search ?? '',
|
|
26
|
+
order: obj.order || defaultOrder,
|
|
27
|
+
direction: realOrderDirection,
|
|
28
|
+
page: +obj.page || 1,
|
|
29
|
+
perPage: +obj.perPage || defaultPerPage
|
|
30
|
+
};
|
|
31
|
+
return extendRef.current ? extendRef.current(obj, params) : params;
|
|
32
|
+
}, [locationSearch, defaultDirection, defaultOrder, defaultPerPage]);
|
|
33
|
+
const changeDataTableParams = usePersistentFunction(params => {
|
|
34
|
+
navigate({
|
|
35
|
+
search: new URLSearchParams(pickBy(params)).toString()
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
return [dataTableParams, changeDataTableParams];
|
|
39
|
+
}
|
package/Table/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ClearableInput } from './components/ClearableInput';
|
|
2
|
+
export { DataTable } from './components/DataTable';
|
|
3
|
+
export { DataTableList } from './components/DataTableList';
|
|
4
|
+
export { DataTableGetContext } from './components/DataTableGetContext';
|
|
5
|
+
export { DataTablePagination } from './components/DataTablePagination';
|
|
6
|
+
export { DataTableSearchInput } from './components/DataTableSearchInput';
|
|
7
|
+
export { DataTableSortableCell } from './components/DataTableSortableCell';
|
|
8
|
+
export { Loading } from './components/Loading';
|
|
9
|
+
export { TableList } from './components/TableList';
|
|
10
|
+
export { TablePagination } from './components/TablePagination';
|
|
11
|
+
export { useDataTableContext, useDataTableParams } from './hooks';
|
|
12
|
+
export { Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, } from './styles';
|
|
13
|
+
export type { DataTableParams, DataTableData, DataTableContextType } from './types';
|
package/Table/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ClearableInput } from './components/ClearableInput';
|
|
2
|
+
export { DataTable } from './components/DataTable';
|
|
3
|
+
export { DataTableList } from './components/DataTableList';
|
|
4
|
+
export { DataTableGetContext } from './components/DataTableGetContext';
|
|
5
|
+
export { DataTablePagination } from './components/DataTablePagination';
|
|
6
|
+
export { DataTableSearchInput } from './components/DataTableSearchInput';
|
|
7
|
+
export { DataTableSortableCell } from './components/DataTableSortableCell';
|
|
8
|
+
export { Loading } from './components/Loading';
|
|
9
|
+
export { TableList } from './components/TableList';
|
|
10
|
+
export { TablePagination } from './components/TablePagination';
|
|
11
|
+
export { useDataTableContext, useDataTableParams } from './hooks';
|
|
12
|
+
export { Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './styles';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
2
|
+
export declare const Table: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
4
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
5
|
+
$gap?: string | number | undefined;
|
|
6
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
7
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
8
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
9
|
+
$margin?: string | number | undefined;
|
|
10
|
+
$padding?: string | number | undefined;
|
|
11
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
$gridAutoFlow: string;
|
|
14
|
+
} & {
|
|
15
|
+
columns: string;
|
|
16
|
+
width?: string | number;
|
|
17
|
+
}, "$gridAutoFlow">;
|
|
18
|
+
export declare const Td: import("styled-components").StyledComponent<"div", any, {
|
|
19
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
20
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
21
|
+
$gap?: string | number | undefined;
|
|
22
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
23
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
24
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
25
|
+
$margin?: string | number | undefined;
|
|
26
|
+
$padding?: string | number | undefined;
|
|
27
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
$padding: number;
|
|
30
|
+
} & {
|
|
31
|
+
$color?: string;
|
|
32
|
+
}, "$padding">;
|
|
33
|
+
export declare const ElementHover: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
34
|
+
export declare const Tr: import("styled-components").StyledComponent<"div", any, {
|
|
35
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
36
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
37
|
+
$gap?: string | number | undefined;
|
|
38
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
39
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
40
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
41
|
+
$margin?: string | number | undefined;
|
|
42
|
+
$padding?: string | number | undefined;
|
|
43
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
44
|
+
} & {
|
|
45
|
+
$gridAutoFlow: string;
|
|
46
|
+
} & {
|
|
47
|
+
$padding: string;
|
|
48
|
+
}, "$gridAutoFlow" | "$padding">;
|
|
49
|
+
export declare const Th: import("styled-components").StyledComponent<"div", any, {
|
|
50
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
51
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
52
|
+
$gap?: string | number | undefined;
|
|
53
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
54
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
55
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
56
|
+
$margin?: string | number | undefined;
|
|
57
|
+
$padding?: string | number | undefined;
|
|
58
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
59
|
+
} & {
|
|
60
|
+
$padding: number;
|
|
61
|
+
} & {
|
|
62
|
+
$color?: string;
|
|
63
|
+
}, "$padding">;
|
|
64
|
+
export declare const ItemDetailLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
65
|
+
export declare const ItemName: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
66
|
+
export declare const Description: import("styled-components").StyledComponent<"div", any, {
|
|
67
|
+
$maxLines?: number;
|
|
68
|
+
}, never>;
|
|
69
|
+
export declare const LockedText: import("styled-components").StyledComponent<"div", any, {
|
|
70
|
+
$fontSize?: FontSize;
|
|
71
|
+
$fontWeight?: FontWeight;
|
|
72
|
+
$maxWidth?: string;
|
|
73
|
+
}, never>;
|
package/Table/styles.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Color, FontSize, FontWeight, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { GridContainer, Horizontal, Vertical, toCssValue } from '@pushwoosh/kit-helpers';
|
|
4
|
+
export const Table = styled(Vertical).withConfig({
|
|
5
|
+
displayName: "Table",
|
|
6
|
+
componentId: "sc-1kwcslm-0"
|
|
7
|
+
})(["--table-columns:", ";border:1px solid ", ";border-radius:", ";background-color:", ";", " & > *:not(:last-child){border-bottom:1px solid ", ";}"], ({
|
|
8
|
+
columns
|
|
9
|
+
}) => columns, Color.DIVIDER, ShapeRadius.SECTION, Color.CLEAR, ({
|
|
10
|
+
width
|
|
11
|
+
}) => width ? `width: ${toCssValue(width)};` : '', Color.DIVIDER);
|
|
12
|
+
export const Td = styled(GridContainer).attrs({
|
|
13
|
+
$padding: 12
|
|
14
|
+
}).withConfig({
|
|
15
|
+
displayName: "Td",
|
|
16
|
+
componentId: "sc-1kwcslm-1"
|
|
17
|
+
})(["", ""], ({
|
|
18
|
+
$color
|
|
19
|
+
}) => $color ? `color: ${$color};` : '');
|
|
20
|
+
export const ElementHover = styled.div.withConfig({
|
|
21
|
+
displayName: "ElementHover",
|
|
22
|
+
componentId: "sc-1kwcslm-2"
|
|
23
|
+
})(["display:none;position:relative;& > *{position:absolute;right:0;transform:translateY(-50%);}"]);
|
|
24
|
+
export const Tr = styled(Horizontal).attrs({
|
|
25
|
+
$padding: '0 12px'
|
|
26
|
+
}).withConfig({
|
|
27
|
+
displayName: "Tr",
|
|
28
|
+
componentId: "sc-1kwcslm-3"
|
|
29
|
+
})(["grid-template-columns:var(--table-columns);&:hover{background-color:#89A4BF0D;}&:hover ", "{display:block;}"], ElementHover);
|
|
30
|
+
export const Th = styled(Td).withConfig({
|
|
31
|
+
displayName: "Th",
|
|
32
|
+
componentId: "sc-1kwcslm-4"
|
|
33
|
+
})(["padding:8px 12px;color:#969ca3;font-weight:", ";font-size:", ";line-height:1;text-transform:uppercase;"], FontWeight.MEDIUM, FontSize.SMALL);
|
|
34
|
+
export const ItemDetailLink = styled.a.withConfig({
|
|
35
|
+
displayName: "ItemDetailLink",
|
|
36
|
+
componentId: "sc-1kwcslm-5"
|
|
37
|
+
})(["display:flex;align-items:center;text-decoration:none;font-weight:", ";color:", ";width:100%;&:hover{text-decoration:none;color:", ";}"], FontWeight.MEDIUM, Color.MAIN, Color.PRIMARY_HOVER);
|
|
38
|
+
export const ItemName = styled.div.withConfig({
|
|
39
|
+
displayName: "ItemName",
|
|
40
|
+
componentId: "sc-1kwcslm-6"
|
|
41
|
+
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
42
|
+
const overflowStyles = css(["overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:", ";"], ({
|
|
43
|
+
$maxLines
|
|
44
|
+
}) => $maxLines);
|
|
45
|
+
export const Description = styled.div.withConfig({
|
|
46
|
+
displayName: "Description",
|
|
47
|
+
componentId: "sc-1kwcslm-7"
|
|
48
|
+
})(["color:", ";font-size:", ";font-style:normal;font-weight:", ";line-height:130%;", ""], Color.LOCKED, FontSize.SMALL, FontWeight.REGULAR, ({
|
|
49
|
+
$maxLines
|
|
50
|
+
}) => $maxLines ? overflowStyles : undefined);
|
|
51
|
+
export const LockedText = styled.div.withConfig({
|
|
52
|
+
displayName: "LockedText",
|
|
53
|
+
componentId: "sc-1kwcslm-8"
|
|
54
|
+
})(["color:", ";font-size:", ";font-weight:", ";max-width:", ";"], Color.LOCKED, ({
|
|
55
|
+
$fontSize
|
|
56
|
+
}) => $fontSize || FontSize.REGULAR, ({
|
|
57
|
+
$fontWeight
|
|
58
|
+
}) => $fontWeight || FontWeight.REGULAR, ({
|
|
59
|
+
$maxWidth
|
|
60
|
+
}) => $maxWidth || 'initial');
|
package/Table/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AsyncState } from '@pushwoosh/kit-helpers/hooks/useAsyncFn';
|
|
2
|
+
export type DataTableParams = {
|
|
3
|
+
readonly search: string;
|
|
4
|
+
readonly order: string;
|
|
5
|
+
readonly direction: 'asc' | 'desc';
|
|
6
|
+
readonly page: number;
|
|
7
|
+
readonly perPage: number;
|
|
8
|
+
};
|
|
9
|
+
export type DataTableData<T> = {
|
|
10
|
+
items: T[];
|
|
11
|
+
total?: number;
|
|
12
|
+
totalPages: number;
|
|
13
|
+
isFiltered?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type DataTableContextType<T, P extends DataTableParams> = {
|
|
16
|
+
data: AsyncState<DataTableData<T>>;
|
|
17
|
+
reload: () => void;
|
|
18
|
+
params: P;
|
|
19
|
+
onChangeParams: (params: P) => void;
|
|
20
|
+
};
|
package/Table/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { Banner, type BannerType } from './Banner';
|
|
|
4
4
|
export { Button, GhostButton } from './Button';
|
|
5
5
|
export { CardMetric } from './CardMetric';
|
|
6
6
|
export { Checkbox } from './Checkbox';
|
|
7
|
+
export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs, } from './Drawer';
|
|
7
8
|
export { DropdownMenu, DropdownMenuProvider, useDropdownMenuContext, DropdownMenuContainer, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemBox, DropdownMenuItemCheckbox, DropdownMenuItemPick, DropdownMenuItemRadio, DropdownMenuNested, DropdownMenuWindow, } from './DropdownMenu';
|
|
8
9
|
export { EditableField } from './EditableField';
|
|
9
10
|
export { InputFile } from './InputFile';
|
|
@@ -15,7 +16,9 @@ export { Radio } from './Radio';
|
|
|
15
16
|
export { ReCaptcha, useRecaptcha, asyncScriptLoad } from './ReCaptcha';
|
|
16
17
|
export { Spinner } from './Spinner';
|
|
17
18
|
export { SortButton } from './SortButton';
|
|
19
|
+
export { Select, SelectAsync, CreatableSelect, CLASS_NAME_PREFIX, type SelectBase, type MultiSelectOptions, } from './Select';
|
|
18
20
|
export { Switch } from './Switch';
|
|
21
|
+
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
19
22
|
export { Tooltip, type TooltipPosition } from './Tooltip';
|
|
20
23
|
export { Tab, TabBar, TabPanel, Tabs, type TabCode } from './Tabs';
|
|
21
24
|
export { Link } from './Link';
|
|
@@ -23,6 +26,7 @@ export { StatisticCard } from './StatisticCard';
|
|
|
23
26
|
export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
|
|
24
27
|
export { PushPreview } from './PushPreview';
|
|
25
28
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
29
|
+
export { ClearableInput, DataTable, DataTableList, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TableList, TablePagination, useDataTableContext, useDataTableParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, type DataTableParams, type DataTableData, type DataTableContextType, } from './Table';
|
|
26
30
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|
|
27
31
|
export { ExportResult } from './ExportResult';
|
|
28
32
|
export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { Banner } from './Banner';
|
|
|
4
4
|
export { Button, GhostButton } from './Button';
|
|
5
5
|
export { CardMetric } from './CardMetric';
|
|
6
6
|
export { Checkbox } from './Checkbox';
|
|
7
|
+
export { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs } from './Drawer';
|
|
7
8
|
export { DropdownMenu, DropdownMenuProvider, useDropdownMenuContext, DropdownMenuContainer, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemBox, DropdownMenuItemCheckbox, DropdownMenuItemPick, DropdownMenuItemRadio, DropdownMenuNested, DropdownMenuWindow } from './DropdownMenu';
|
|
8
9
|
export { EditableField } from './EditableField';
|
|
9
10
|
export { InputFile } from './InputFile';
|
|
@@ -15,7 +16,9 @@ export { Radio } from './Radio';
|
|
|
15
16
|
export { ReCaptcha, useRecaptcha, asyncScriptLoad } from './ReCaptcha';
|
|
16
17
|
export { Spinner } from './Spinner';
|
|
17
18
|
export { SortButton } from './SortButton';
|
|
19
|
+
export { Select, SelectAsync, CreatableSelect, CLASS_NAME_PREFIX } from './Select';
|
|
18
20
|
export { Switch } from './Switch';
|
|
21
|
+
export { TextSkeleton, RectangularSkeleton, CircularSkeleton } from './Skeleton';
|
|
19
22
|
export { Tooltip } from './Tooltip';
|
|
20
23
|
export { Tab, TabBar, TabPanel, Tabs } from './Tabs';
|
|
21
24
|
export { Link } from './Link';
|
|
@@ -23,6 +26,7 @@ export { StatisticCard } from './StatisticCard';
|
|
|
23
26
|
export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
|
|
24
27
|
export { PushPreview } from './PushPreview';
|
|
25
28
|
export { Toast, ToastProvider, useToast } from './Toast';
|
|
29
|
+
export { ClearableInput, DataTable, DataTableList, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TableList, TablePagination, useDataTableContext, useDataTableParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './Table';
|
|
26
30
|
export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
|
|
27
31
|
export { ExportResult } from './ExportResult';
|
|
28
32
|
export { NativeInput, NativeTextarea, NativeSelect } from './native';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/dumb-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "React components to build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"pre-commit": "check",
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@pushwoosh/frontend-builder-engine": "^1.0.
|
|
19
|
+
"@pushwoosh/frontend-builder-engine": "^1.0.15",
|
|
20
20
|
"@pushwoosh/kit-constants": "^1.6.7",
|
|
21
|
+
"@svgr/webpack": "^8.1.0",
|
|
21
22
|
"@types/lodash": "^4.17.13",
|
|
22
23
|
"@types/react": "^18.2.69",
|
|
23
24
|
"@types/react-dom": "^18.2.22",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"liquidjs": "^10.18.0",
|
|
47
48
|
"lodash": "^4.17.21",
|
|
48
49
|
"polished": "^4.3.1",
|
|
50
|
+
"react-select": "^5.10.0",
|
|
49
51
|
"react-transition-group": "^4.4.5"
|
|
50
52
|
}
|
|
51
53
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|