@pushwoosh/dumb-components 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.d.ts +3 -3
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +44 -25
- package/DropdownMenu/components/DropdownMenu/index.d.ts +1 -1
- package/DropdownMenu/components/DropdownMenu/index.js +1 -1
- package/DropdownMenu/components/DropdownMenu/styles.d.ts +28 -0
- package/DropdownMenu/components/DropdownMenu/styles.js +13 -0
- package/DropdownMenu/components/DropdownMenu/types.d.ts +11 -21
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +25 -0
- package/DropdownMenu/components/DropdownMenuButton/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuButton/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuButton/types.d.ts +14 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.d.ts +3 -5
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +25 -37
- package/DropdownMenu/components/DropdownMenuItem/index.d.ts +0 -2
- package/DropdownMenu/components/DropdownMenuItem/index.js +1 -2
- package/DropdownMenu/components/DropdownMenuItem/styles.d.ts +3 -4
- package/DropdownMenu/components/DropdownMenuItem/styles.js +9 -70
- package/DropdownMenu/components/DropdownMenuItem/types.d.ts +7 -24
- package/DropdownMenu/context.d.ts +1 -0
- package/DropdownMenu/context.js +2 -0
- package/DropdownMenu/index.d.ts +3 -9
- package/DropdownMenu/index.js +3 -9
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +3 -3
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/assets/email.svg +5 -0
- package/Table/hooks/helpers.d.ts +3 -0
- package/Table/hooks/helpers.js +9 -0
- package/Table/hooks/index.d.ts +1 -1
- package/Table/hooks/index.js +1 -1
- package/Table/hooks/useDataTableGetParams.d.ts +11 -0
- package/Table/hooks/useDataTableGetParams.js +49 -0
- package/Table/index.d.ts +1 -1
- package/Table/index.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -1
- package/DropdownMenu/components/DropdownMenu/hooks.d.ts +0 -4
- package/DropdownMenu/components/DropdownMenu/hooks.js +0 -10
- package/DropdownMenu/components/DropdownMenuContainer/DropdownMenuContainer.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuContainer/DropdownMenuContainer.js +0 -79
- package/DropdownMenu/components/DropdownMenuContainer/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuContainer/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuContainer/maps.d.ts +0 -26
- package/DropdownMenu/components/DropdownMenuContainer/maps.js +0 -11
- package/DropdownMenu/components/DropdownMenuContainer/styles.d.ts +0 -35
- package/DropdownMenu/components/DropdownMenuContainer/styles.js +0 -109
- package/DropdownMenu/components/DropdownMenuContainer/types.d.ts +0 -19
- package/DropdownMenu/components/DropdownMenuGroup/DropdownMenuGroup.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuGroup/DropdownMenuGroup.js +0 -12
- package/DropdownMenu/components/DropdownMenuGroup/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuGroup/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuGroup/styles.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuGroup/styles.js +0 -7
- package/DropdownMenu/components/DropdownMenuGroup/types.d.ts +0 -5
- package/DropdownMenu/components/DropdownMenuGroup/types.js +0 -1
- package/DropdownMenu/components/DropdownMenuItemCheckbox/DropdownMenuItemCheckbox.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuItemCheckbox/DropdownMenuItemCheckbox.js +0 -9
- package/DropdownMenu/components/DropdownMenuItemCheckbox/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuItemCheckbox/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuItemCheckbox/styles.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuItemCheckbox/styles.js +0 -8
- package/DropdownMenu/components/DropdownMenuItemPick/DropdownMenuItemPick.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuItemPick/DropdownMenuItemPick.js +0 -16
- package/DropdownMenu/components/DropdownMenuItemPick/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuItemPick/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuItemPick/styles.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuItemPick/styles.js +0 -8
- package/DropdownMenu/components/DropdownMenuItemPick/types.d.ts +0 -2
- package/DropdownMenu/components/DropdownMenuItemPick/types.js +0 -1
- package/DropdownMenu/components/DropdownMenuItemRadio/DropdownMenuItemRadio.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuItemRadio/DropdownMenuItemRadio.js +0 -9
- package/DropdownMenu/components/DropdownMenuItemRadio/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuItemRadio/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuItemRadio/styles.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuItemRadio/styles.js +0 -8
- package/DropdownMenu/components/DropdownMenuNested/DropdownMenuNested.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuNested/DropdownMenuNested.js +0 -69
- package/DropdownMenu/components/DropdownMenuNested/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuNested/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuNested/styles.d.ts +0 -8
- package/DropdownMenu/components/DropdownMenuNested/styles.js +0 -35
- package/DropdownMenu/components/DropdownMenuNested/types.d.ts +0 -6
- package/DropdownMenu/components/DropdownMenuNested/types.js +0 -1
- package/DropdownMenu/components/DropdownMenuWindow/DropdownMenuWindow.d.ts +0 -3
- package/DropdownMenu/components/DropdownMenuWindow/DropdownMenuWindow.js +0 -12
- package/DropdownMenu/components/DropdownMenuWindow/index.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuWindow/index.js +0 -1
- package/DropdownMenu/components/DropdownMenuWindow/styles.d.ts +0 -1
- package/DropdownMenu/components/DropdownMenuWindow/styles.js +0 -7
- package/DropdownMenu/components/DropdownMenuWindow/types.d.ts +0 -5
- package/DropdownMenu/components/DropdownMenuWindow/types.js +0 -1
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/assets/PW_logo.svg +0 -1
- package/Table/hooks/useDataTableParams.d.ts +0 -10
- package/Table/hooks/useDataTableParams.js +0 -39
- /package/DropdownMenu/components/{DropdownMenuContainer → DropdownMenuButton}/types.js +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import Tippy from '@tippyjs/react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { Color, FontSize, FontWeight, LineHeight, Shadow, ShapeRadius, Spacing } from '@pushwoosh/kit-constants';
|
|
4
|
-
export const DropdownMenuNestedBox = styled.div.withConfig({
|
|
5
|
-
displayName: "DropdownMenuNestedBox",
|
|
6
|
-
componentId: "sc-kzlzhf-0"
|
|
7
|
-
})(["width:100%;"]);
|
|
8
|
-
export const DropdownMenuNestedButton = styled.div.withConfig({
|
|
9
|
-
displayName: "DropdownMenuNestedButton",
|
|
10
|
-
componentId: "sc-kzlzhf-1"
|
|
11
|
-
})(["display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;width:100%;padding:", " ", " ", " ", ";background:", ";font-size:", ";font-weight:", ";line-height:", ";white-space:nowrap;text-decoration:none;text-align:left;cursor:pointer;user-select:none;"], Spacing.S3, Spacing.S3, Spacing.S3, Spacing.S4, ({
|
|
12
|
-
$isActive
|
|
13
|
-
}) => $isActive ? Color.SOFT_LIGHT : 'transparent', FontSize.REGULAR, FontWeight.REGULAR, LineHeight.REGULAR);
|
|
14
|
-
export const DropdownMenuNestedTitle = styled.div.withConfig({
|
|
15
|
-
displayName: "DropdownMenuNestedTitle",
|
|
16
|
-
componentId: "sc-kzlzhf-2"
|
|
17
|
-
})(["flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);
|
|
18
|
-
export const DropdownMenuNestedIcon = styled.div.withConfig({
|
|
19
|
-
displayName: "DropdownMenuNestedIcon",
|
|
20
|
-
componentId: "sc-kzlzhf-3"
|
|
21
|
-
})(["flex:0 0 auto;padding:0 0 0 ", ";"], Spacing.S4);
|
|
22
|
-
export const DropdownMenuNestedPortal = styled(Tippy).withConfig({
|
|
23
|
-
displayName: "DropdownMenuNestedPortal",
|
|
24
|
-
componentId: "sc-kzlzhf-4"
|
|
25
|
-
})([".tippy-box{position:static;background-color:transparent;color:inherit;border-radius:0;font-size:inherit;line-height:inherit;outline:0;transition:none;}.tippy-content{position:static;padding:0;z-index:auto;}.tippy-arrow{display:none;}"]);
|
|
26
|
-
export const DropdownMenuNestedWindow = styled.div.withConfig({
|
|
27
|
-
displayName: "DropdownMenuNestedWindow",
|
|
28
|
-
componentId: "sc-kzlzhf-5"
|
|
29
|
-
})(["border:1px solid ", ";background:", ";box-shadow:", ";border-radius:", ";"], Color.FORM, Color.FROZEN, Shadow.REGULAR, ShapeRadius.CONTROL);
|
|
30
|
-
DropdownMenuNestedBox.displayName = 'DropdownMenuNestedBox';
|
|
31
|
-
DropdownMenuNestedButton.displayName = 'DropdownMenuNestedButton';
|
|
32
|
-
DropdownMenuNestedTitle.displayName = 'DropdownMenuNestedTitle';
|
|
33
|
-
DropdownMenuNestedIcon.displayName = 'DropdownMenuNestedIcon';
|
|
34
|
-
DropdownMenuNestedPortal.displayName = 'DropdownMenuNestedPortal';
|
|
35
|
-
DropdownMenuNestedWindow.displayName = 'DropdownMenuNestedWindow';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DropdownMenuWindowBox } from './styles';
|
|
3
|
-
export function DropdownMenuWindow(props) {
|
|
4
|
-
const {
|
|
5
|
-
boxRef,
|
|
6
|
-
...rest
|
|
7
|
-
} = props;
|
|
8
|
-
return React.createElement(DropdownMenuWindowBox, {
|
|
9
|
-
...rest,
|
|
10
|
-
ref: boxRef
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DropdownMenuWindow } from './DropdownMenuWindow';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DropdownMenuWindow } from './DropdownMenuWindow';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DropdownMenuWindowBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { Color, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
|
-
export const DropdownMenuWindowBox = styled.div.withConfig({
|
|
4
|
-
displayName: "DropdownMenuWindowBox",
|
|
5
|
-
componentId: "sc-aqah5e-0"
|
|
6
|
-
})(["max-height:316px;width:100%;background:", ";box-shadow:inset 0 0 0 1px ", ",", ";border-radius:", ";overflow-y:auto;"], Color.FROZEN, Color.FORM, Shadow.REGULAR, ShapeRadius.CONTROL);
|
|
7
|
-
DropdownMenuWindowBox.displayName = 'DropdownMenuWindowBox';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="41" fill="none"><path fill="#7694B8" fill-opacity=".2" fill-rule="evenodd" d="M10.81 7.488c-1.412 0-3.17.697-3.707 2.948-.604 2.524-1.273 5.425-1.76 7.538l-.168.727c-.192.832-.03 1.485.285 1.909.307.414.845.725 1.655.725h.874a.3.3 0 0 1 .293.365l-.19.853-.256 1.143a.3.3 0 0 0 .465.311l3.557-2.491.18-.127a.3.3 0 0 1 .173-.054h2.022a.31.31 0 0 0 .278-.179c1.092-2.284 3.455-3.431 5.27-3.431h4.28a.26.26 0 0 0 .254-.21c.123-.622.29-1.472.473-2.388.364-1.827.787-3.925 1.015-4.972.172-.793.01-1.452-.332-1.895-.332-.432-.92-.772-1.832-.772H10.81m2.67 15.847a.3.3 0 0 1 .292.368l-.347 1.478-.002.007a766 766 0 0 0-1.215 5.22c-.625 2.754 1.54 5.099 3.856 5.099h13.11c2.046 0 4.94-1.587 5.664-4.675l.68-2.907.001-.004v-.002c.422-1.806.85-3.633 1.19-5.074.322-1.362.094-2.653-.642-3.62a3.7 3.7 0 0 0-1.719-1.25.32.32 0 0 1-.209-.364l.474-2.129c.28-1.254-1.137-2.19-2.181-1.442l-5.067 3.629a.3.3 0 0 1-.174.056h-.563a.26.26 0 0 1-.255-.31c.108-.547.238-1.204.377-1.897.364-1.832.784-3.911 1.007-4.937.279-1.28.052-2.562-.7-3.54-.76-.989-1.97-1.553-3.418-1.553H10.81c-2.037 0-4.836 1.07-5.653 4.483-.605 2.533-1.276 5.441-1.763 7.554l-.168.726c-.3 1.303-.093 2.58.628 3.551.446.6 1.056 1.04 1.775 1.29a.317.317 0 0 1 .211.365l-.461 2.067C5.1 26.771 6.5 27.71 7.549 26.976l5.12-3.587a.3.3 0 0 1 .173-.054zm14.128-3.61H19.78c-1.33 0-3.27 1.05-3.753 3.117l-.66 2.816c-.444 1.885-.893 3.797-1.21 5.192-.335 1.48.849 2.657 1.906 2.657h13.11c1.248 0 3.234-1.07 3.717-3.131l.675-2.885.001-.006.003-.011c.422-1.81.851-3.644 1.193-5.09.207-.878.029-1.532-.288-1.95-.316-.415-.856-.71-1.608-.71h-.872a.3.3 0 0 1-.293-.365l.19-.852.258-1.161a.3.3 0 0 0-.468-.31l-3.491 2.502-.198.141a.243.243 0 0 1-.385-.197v-.757zm-8.084-9.947a2.6 2.6 0 0 0-1.126-.202H12.64a1.12 1.12 0 0 0-1.093.868L9.712 18.4v.001a1.12 1.12 0 0 0 .838 1.347h.002q.124.028.252.028v-.25.25a1.12 1.12 0 0 0 1.093-.868v-.001l.608-2.611h4.972c1.086 0 2-.534 2.635-1.287.633-.75 1.003-1.733 1.004-2.672a2.82 2.82 0 0 0-.648-1.884l-.006-.008a2.6 2.6 0 0 0-.937-.666m-1.098 1.856a.63.63 0 0 1 .483.163c.107.152.16.335.15.521v.014c0 .393-.156.88-.442 1.265-.284.383-.674.639-1.14.639h-4.7l.609-2.601h5.029zM31.22 23.92h-.073a1.166 1.166 0 0 0-1.163-1.314v.25l-.001-.25a1.17 1.17 0 0 0-1.057.677l-2.1 4.525-1.386-2.47v-.001a1.16 1.16 0 0 0-.825-.578 1.17 1.17 0 0 0-.967.278l-2.694 2.39.437-3.509a1.166 1.166 0 0 0-1.46-1.309 1.17 1.17 0 0 0-.854 1l-.848 6.615v.002a1.17 1.17 0 0 0 .624 1.179 1.19 1.19 0 0 0 1.316-.158l.002-.002 3.94-3.496 1.803 3.187a1.17 1.17 0 0 0 1.015.592h.045a1.16 1.16 0 0 0 1.02-.656l.001-.003 3.06-6.594z" clip-rule="evenodd" opacity=".5"/></svg>
|
|
@@ -1,10 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef } from 'react';
|
|
2
|
-
import { useHistory, 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 history = useHistory();
|
|
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
|
-
history.push({
|
|
35
|
-
search: new URLSearchParams(pickBy(params)).toString()
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
return [dataTableParams, changeDataTableParams];
|
|
39
|
-
}
|
|
File without changes
|