@synerise/ds-manageable-list 1.7.10 → 1.7.12
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/CHANGELOG.md +8 -0
- package/README.md +7 -6
- package/dist/AddBlankItem/AddBlankItem.d.ts +2 -2
- package/dist/AddBlankItem/AddBlankItem.js +19 -22
- package/dist/AddBlankItem/AddBlankItem.styles.d.ts +2 -2
- package/dist/AddBlankItem/AddBlankItem.styles.js +9 -5
- package/dist/AddBlankItem/AddBlankItem.types.d.ts +1 -1
- package/dist/AddBlankItem/AddBlankItem.types.js +1 -1
- package/dist/AddItem/AddItem.d.ts +3 -3
- package/dist/AddItem/AddItem.js +14 -18
- package/dist/AddItem/AddItem.styles.d.ts +1 -1
- package/dist/AddItem/AddItem.styles.js +6 -3
- package/dist/AddItem/AddItem.types.d.ts +1 -1
- package/dist/AddItem/AddItem.types.js +1 -1
- package/dist/AddItemWithName/AddItemWithName.d.ts +2 -2
- package/dist/AddItemWithName/AddItemWithName.js +30 -43
- package/dist/AddItemWithName/AddItemWithName.styles.d.ts +2 -2
- package/dist/AddItemWithName/AddItemWithName.styles.js +9 -5
- package/dist/AddItemWithName/AddItemWithName.types.d.ts +1 -1
- package/dist/AddItemWithName/AddItemWithName.types.js +1 -1
- package/dist/Item/BlankItem/BlankItem.d.ts +2 -2
- package/dist/Item/BlankItem/BlankItem.js +43 -61
- package/dist/Item/BlankItem/BlankItem.styles.d.ts +4 -4
- package/dist/Item/BlankItem/BlankItem.styles.js +26 -21
- package/dist/Item/BlankItem/BlankItem.types.d.ts +3 -3
- package/dist/Item/BlankItem/BlankItem.types.js +1 -1
- package/dist/Item/ContentItem/ContentItem.d.ts +43 -43
- package/dist/Item/ContentItem/ContentItem.js +58 -99
- package/dist/Item/ContentItem/ContentItem.styles.d.ts +45 -45
- package/dist/Item/ContentItem/ContentItem.styles.js +76 -85
- package/dist/Item/ContentItem/ContentItem.types.d.ts +4 -4
- package/dist/Item/ContentItem/ContentItem.types.js +1 -1
- package/dist/Item/ContentItem/ContentItemHeader.d.ts +2 -2
- package/dist/Item/ContentItem/ContentItemHeader.js +88 -134
- package/dist/Item/DraggableItem.d.ts +2 -2
- package/dist/Item/DraggableItem.js +26 -27
- package/dist/Item/FilterItem/FilterItem.d.ts +43 -43
- package/dist/Item/FilterItem/FilterItem.js +74 -140
- package/dist/Item/FilterItem/FilterItem.styles.d.ts +3 -3
- package/dist/Item/FilterItem/FilterItem.styles.js +17 -27
- package/dist/Item/FilterItem/FilterItem.types.d.ts +2 -2
- package/dist/Item/FilterItem/FilterItem.types.js +1 -1
- package/dist/Item/Item.d.ts +2 -2
- package/dist/Item/Item.js +39 -90
- package/dist/Item/Item.styles.d.ts +9 -9
- package/dist/Item/Item.styles.js +50 -48
- package/dist/Item/Item.types.d.ts +1 -1
- package/dist/Item/Item.types.js +1 -1
- package/dist/Item/ItemActions/ItemActions.d.ts +2 -2
- package/dist/Item/ItemActions/ItemActions.js +41 -43
- package/dist/Item/ItemActions/ItemActions.styles.d.ts +1 -1
- package/dist/Item/ItemActions/ItemActions.styles.js +9 -7
- package/dist/Item/ItemActions/ItemActions.types.d.ts +2 -2
- package/dist/Item/ItemActions/ItemActions.types.js +1 -1
- package/dist/Item/ItemMeta/ItemMeta.d.ts +2 -2
- package/dist/Item/ItemMeta/ItemMeta.js +27 -22
- package/dist/Item/ItemMeta/ItemMeta.styles.d.ts +2 -2
- package/dist/Item/ItemMeta/ItemMeta.styles.js +9 -7
- package/dist/Item/ItemMeta/ItemMeta.types.js +1 -1
- package/dist/Item/ItemName/ItemName.d.ts +2 -2
- package/dist/Item/ItemName/ItemName.js +36 -55
- package/dist/Item/ItemName/ItemName.types.d.ts +2 -2
- package/dist/Item/ItemName/ItemName.types.js +1 -1
- package/dist/Item/ItemNameLarge/ItemNameLarge.d.ts +2 -2
- package/dist/Item/ItemNameLarge/ItemNameLarge.js +17 -13
- package/dist/Item/ItemNameLarge/ItemNameLarge.types.d.ts +1 -1
- package/dist/Item/ItemNameLarge/ItemNameLarge.types.js +1 -1
- package/dist/Item/SimpleItem/SimpleItem.d.ts +7 -7
- package/dist/Item/SimpleItem/SimpleItem.js +34 -56
- package/dist/Item/SimpleItem/SimpleItem.types.d.ts +2 -2
- package/dist/Item/SimpleItem/SimpleItem.types.js +1 -1
- package/dist/ManageableList.d.ts +4 -4
- package/dist/ManageableList.js +106 -164
- package/dist/ManageableList.styles.d.ts +2 -2
- package/dist/ManageableList.styles.js +12 -11
- package/dist/ManageableList.types.d.ts +2 -2
- package/dist/ManageableList.types.js +18 -14
- package/dist/hooks/useTexts.d.ts +1 -1
- package/dist/hooks/useTexts.js +31 -89
- package/dist/index.js +12 -5
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +21 -21
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FilterItemProps } from './FilterItem.types';
|
|
3
3
|
declare const FilterItem: (({ item, selected, greyBackground, onDuplicate, onRemove, onUpdate, onSelect, texts, searchQuery, style, }: FilterItemProps) => React.JSX.Element) & {
|
|
4
|
-
AdditionalSuffix: import(
|
|
5
|
-
ContentWrapper: import(
|
|
4
|
+
AdditionalSuffix: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
5
|
+
ContentWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
6
6
|
withoutPadding: boolean;
|
|
7
7
|
}, never>;
|
|
8
|
-
DraggerWrapper: import(
|
|
8
|
+
DraggerWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
}, never>;
|
|
11
|
-
DropdownTrigger: import(
|
|
11
|
+
DropdownTrigger: import('styled-components').StyledComponent<React.ForwardRefExoticComponent<Omit<Partial<{
|
|
12
12
|
href: string;
|
|
13
13
|
target?: string;
|
|
14
14
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
15
|
-
} & import(
|
|
16
|
-
htmlType?: import(
|
|
15
|
+
} & import('antd/lib/button/button').BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
16
|
+
htmlType?: import('antd/lib/button/button').ButtonHTMLType;
|
|
17
17
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
18
18
|
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">>, "type" | "ghost"> & {
|
|
19
|
-
type?: import(
|
|
20
|
-
mode?: import(
|
|
21
|
-
color?: import(
|
|
22
|
-
groupVariant?: import(
|
|
19
|
+
type?: import('@synerise/ds-utils').LiteralStringUnion<import('@synerise/ds-button/dist/Button.types').ButtonType>;
|
|
20
|
+
mode?: import('@synerise/ds-utils').LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
21
|
+
color?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
22
|
+
groupVariant?: import('@synerise/ds-utils').LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
23
23
|
justifyContent?: string;
|
|
24
24
|
loading?: boolean | {
|
|
25
25
|
delay?: number;
|
|
26
26
|
};
|
|
27
|
-
onClick?: (event: import(
|
|
28
|
-
iconColor?: import(
|
|
27
|
+
onClick?: (event: import('react').MouseEvent<HTMLElement>) => void;
|
|
28
|
+
iconColor?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
29
29
|
error?: boolean;
|
|
30
30
|
readOnly?: boolean;
|
|
31
|
-
tagProps?: import(
|
|
32
|
-
tooltipProps?: import(
|
|
31
|
+
tagProps?: import('@synerise/ds-tag').TagProps;
|
|
32
|
+
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
33
33
|
} & React.RefAttributes<HTMLButtonElement>> & {
|
|
34
|
-
Creator: import(
|
|
35
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import(
|
|
36
|
-
Star: (props: import(
|
|
37
|
-
Checkbox: (props: import(
|
|
34
|
+
Creator: import('react').ForwardRefExoticComponent<Omit<import('@synerise/ds-button').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
Expander: ({ size, expanded, disabled, onClick, className, }: import('@synerise/ds-button').ExpanderProps) => import("react").JSX.Element;
|
|
36
|
+
Star: (props: import('@synerise/ds-button').StarButtonProps) => React.ReactElement;
|
|
37
|
+
Checkbox: (props: import('@synerise/ds-button').CheckboxButtonProps) => React.ReactElement;
|
|
38
38
|
}, any, {}, never>;
|
|
39
|
-
DropdownWrapper: import(
|
|
40
|
-
FilterDropdownTrigger: import(
|
|
39
|
+
DropdownWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
40
|
+
FilterDropdownTrigger: import('styled-components').StyledComponent<React.ForwardRefExoticComponent<Omit<Partial<{
|
|
41
41
|
href: string;
|
|
42
42
|
target?: string;
|
|
43
43
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
44
|
-
} & import(
|
|
45
|
-
htmlType?: import(
|
|
44
|
+
} & import('antd/lib/button/button').BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
|
|
45
|
+
htmlType?: import('antd/lib/button/button').ButtonHTMLType;
|
|
46
46
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
47
47
|
} & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">>, "type" | "ghost"> & {
|
|
48
|
-
type?: import(
|
|
49
|
-
mode?: import(
|
|
50
|
-
color?: import(
|
|
51
|
-
groupVariant?: import(
|
|
48
|
+
type?: import('@synerise/ds-utils').LiteralStringUnion<import('@synerise/ds-button/dist/Button.types').ButtonType>;
|
|
49
|
+
mode?: import('@synerise/ds-utils').LiteralStringUnion<"single-icon" | "split" | "two-icons" | "label-icon" | "icon-label">;
|
|
50
|
+
color?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
51
|
+
groupVariant?: import('@synerise/ds-utils').LiteralStringUnion<"left-rounded" | "squared" | "right-rounded">;
|
|
52
52
|
justifyContent?: string;
|
|
53
53
|
loading?: boolean | {
|
|
54
54
|
delay?: number;
|
|
55
55
|
};
|
|
56
|
-
onClick?: (event: import(
|
|
57
|
-
iconColor?: import(
|
|
56
|
+
onClick?: (event: import('react').MouseEvent<HTMLElement>) => void;
|
|
57
|
+
iconColor?: import('@synerise/ds-utils').LiteralStringUnion<"blue" | "grey" | "red" | "green" | "yellow" | "pink" | "mars" | "orange" | "fern" | "cyan" | "purple" | "violet">;
|
|
58
58
|
error?: boolean;
|
|
59
59
|
readOnly?: boolean;
|
|
60
|
-
tagProps?: import(
|
|
61
|
-
tooltipProps?: import(
|
|
60
|
+
tagProps?: import('@synerise/ds-tag').TagProps;
|
|
61
|
+
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
62
62
|
} & React.RefAttributes<HTMLButtonElement>> & {
|
|
63
|
-
Creator: import(
|
|
64
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import(
|
|
65
|
-
Star: (props: import(
|
|
66
|
-
Checkbox: (props: import(
|
|
63
|
+
Creator: import('react').ForwardRefExoticComponent<Omit<import('@synerise/ds-button').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
64
|
+
Expander: ({ size, expanded, disabled, onClick, className, }: import('@synerise/ds-button').ExpanderProps) => import("react").JSX.Element;
|
|
65
|
+
Star: (props: import('@synerise/ds-button').StarButtonProps) => React.ReactElement;
|
|
66
|
+
Checkbox: (props: import('@synerise/ds-button').CheckboxButtonProps) => React.ReactElement;
|
|
67
67
|
}, any, {}, never>;
|
|
68
|
-
IconWrapper: import(
|
|
69
|
-
ItemContainer: import(
|
|
68
|
+
IconWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
69
|
+
ItemContainer: import('styled-components').StyledComponent<"div", any, {
|
|
70
70
|
opened: boolean;
|
|
71
71
|
selected?: boolean;
|
|
72
72
|
greyBackground: boolean | undefined;
|
|
@@ -76,14 +76,14 @@ declare const FilterItem: (({ item, selected, greyBackground, onDuplicate, onRem
|
|
|
76
76
|
isDragOverlay?: boolean;
|
|
77
77
|
isDragPlaceholder?: boolean;
|
|
78
78
|
}, never>;
|
|
79
|
-
ItemHeader: import(
|
|
79
|
+
ItemHeader: import('styled-components').StyledComponent<"div", any, {
|
|
80
80
|
hasPrefix: boolean;
|
|
81
81
|
hasDescription: boolean;
|
|
82
82
|
size?: "default" | "large";
|
|
83
83
|
}, never>;
|
|
84
|
-
ItemHeaderPrefix: import(
|
|
85
|
-
ItemHeaderSuffix: import(
|
|
86
|
-
MoveItemButtons: import(
|
|
87
|
-
ToggleContentWrapper: import(
|
|
84
|
+
ItemHeaderPrefix: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
85
|
+
ItemHeaderSuffix: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
86
|
+
MoveItemButtons: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
87
|
+
ToggleContentWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
88
88
|
};
|
|
89
89
|
export default FilterItem;
|
|
@@ -1,174 +1,108 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var theme = useTheme();
|
|
31
|
-
var updateName = useCallback(function (updateParams) {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useMemo } from "react";
|
|
3
|
+
import Button from "@synerise/ds-button";
|
|
4
|
+
import { useTheme } from "@synerise/ds-core";
|
|
5
|
+
import { DropdownMenu } from "@synerise/ds-dropdown";
|
|
6
|
+
import Icon, { EditM, DuplicateM, TrashM, CheckS, CircleShapeM, WarningFillM, OptionHorizontalM } from "@synerise/ds-icon";
|
|
7
|
+
import ModalProxy from "@synerise/ds-modal";
|
|
8
|
+
import Popconfirm from "@synerise/ds-popconfirm";
|
|
9
|
+
import Result from "@synerise/ds-result";
|
|
10
|
+
import { ToggleContentWrapper, MoveItemButtons, ItemHeaderSuffix, ItemHeaderPrefix, ItemHeader, ItemContainer, IconWrapper, FilterDropdownTrigger, DropdownWrapper, DropdownTrigger, DraggerWrapper, ContentWrapper, AdditionalSuffix } from "../ContentItem/ContentItem.styles.js";
|
|
11
|
+
import { ItemMeta } from "../ItemMeta/ItemMeta.js";
|
|
12
|
+
import ItemName from "../ItemName/ItemName.js";
|
|
13
|
+
import { ItemHeader as ItemHeader$1, SelectFilterItem } from "./FilterItem.styles.js";
|
|
14
|
+
const FilterItemComponent = ({
|
|
15
|
+
item,
|
|
16
|
+
selected,
|
|
17
|
+
greyBackground,
|
|
18
|
+
onDuplicate,
|
|
19
|
+
onRemove,
|
|
20
|
+
onUpdate,
|
|
21
|
+
onSelect,
|
|
22
|
+
texts,
|
|
23
|
+
searchQuery,
|
|
24
|
+
style
|
|
25
|
+
}) => {
|
|
26
|
+
const [editMode, setEditMode] = useState(false);
|
|
27
|
+
const [confirmDeleteVisible, setConfirmDeleteVisible] = useState(false);
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
const updateName = useCallback((updateParams) => {
|
|
32
30
|
setEditMode(false);
|
|
33
31
|
onUpdate && onUpdate(updateParams);
|
|
34
32
|
}, [onUpdate]);
|
|
35
|
-
|
|
33
|
+
const enterEditMode = useCallback(() => {
|
|
36
34
|
setEditMode(true);
|
|
37
35
|
}, []);
|
|
38
|
-
|
|
36
|
+
const handleRemove = useCallback(() => {
|
|
39
37
|
return onRemove ? setConfirmDeleteVisible(true) : false;
|
|
40
38
|
}, [onRemove]);
|
|
41
|
-
|
|
39
|
+
const handleDuplicate = useCallback(() => {
|
|
42
40
|
return onDuplicate && onDuplicate({
|
|
43
41
|
id: item.id
|
|
44
42
|
});
|
|
45
43
|
}, [item.id, onDuplicate]);
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const dropdownMenuDataSource = useMemo(() => {
|
|
45
|
+
const menuItems = [];
|
|
48
46
|
if (item.canUpdate) {
|
|
49
47
|
menuItems.push({
|
|
50
48
|
onClick: enterEditMode,
|
|
51
|
-
prefixel:
|
|
52
|
-
component: /*#__PURE__*/React.createElement(EditM, null),
|
|
53
|
-
color: theme.palette['grey-600']
|
|
54
|
-
}),
|
|
49
|
+
prefixel: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(EditM, {}), color: theme.palette["grey-600"] }),
|
|
55
50
|
text: texts.itemActionRename
|
|
56
51
|
});
|
|
57
52
|
}
|
|
58
53
|
if (item.canDuplicate) {
|
|
59
54
|
menuItems.push({
|
|
60
55
|
onClick: handleDuplicate,
|
|
61
|
-
prefixel:
|
|
62
|
-
component: /*#__PURE__*/React.createElement(DuplicateM, null),
|
|
63
|
-
color: theme.palette['grey-600']
|
|
64
|
-
}),
|
|
56
|
+
prefixel: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(DuplicateM, {}), color: theme.palette["grey-600"] }),
|
|
65
57
|
text: texts.itemActionDuplicate
|
|
66
58
|
});
|
|
67
59
|
}
|
|
68
60
|
if (item.canDelete) {
|
|
69
61
|
menuItems.push({
|
|
70
|
-
type:
|
|
62
|
+
type: "danger",
|
|
71
63
|
onClick: handleRemove,
|
|
72
|
-
prefixel:
|
|
73
|
-
component: /*#__PURE__*/React.createElement(TrashM, null)
|
|
74
|
-
}),
|
|
64
|
+
prefixel: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(TrashM, {}) }),
|
|
75
65
|
text: texts.itemActionDelete
|
|
76
66
|
});
|
|
77
67
|
}
|
|
78
68
|
return menuItems;
|
|
79
69
|
}, [enterEditMode, handleDuplicate, handleRemove, item.canDelete, item.canDuplicate, item.canUpdate, texts.itemActionDelete, texts.itemActionDuplicate, texts.itemActionRename, theme.palette]);
|
|
80
|
-
return
|
|
81
|
-
opened: false,
|
|
82
|
-
|
|
83
|
-
key: item.id,
|
|
84
|
-
"data-testid": "filter-item",
|
|
85
|
-
style: style
|
|
86
|
-
}, /*#__PURE__*/React.createElement(ItemHeader, null, /*#__PURE__*/React.createElement(S.ItemHeaderPrefix, null, /*#__PURE__*/React.createElement(SelectFilterItem, {
|
|
87
|
-
"data-testid": selected && 'filter-item-selected'
|
|
88
|
-
}, selected ? /*#__PURE__*/React.createElement(Icon, {
|
|
89
|
-
className: "selected-item-icon",
|
|
90
|
-
component: /*#__PURE__*/React.createElement(CheckS, null),
|
|
91
|
-
color: theme.palette.white
|
|
92
|
-
}) : /*#__PURE__*/React.createElement(Popconfirm, {
|
|
93
|
-
okText: texts.activate,
|
|
94
|
-
cancelText: texts.cancel,
|
|
95
|
-
okType: "primary",
|
|
96
|
-
placement: "top",
|
|
97
|
-
onConfirm: function onConfirm() {
|
|
98
|
-
return onSelect == null ? void 0 : onSelect({
|
|
70
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(ItemContainer, { opened: false, greyBackground, "data-testid": "filter-item", style, children: /* @__PURE__ */ jsxs(ItemHeader$1, { children: [
|
|
72
|
+
/* @__PURE__ */ jsx(ItemHeaderPrefix, { children: /* @__PURE__ */ jsx(SelectFilterItem, { "data-testid": selected && "filter-item-selected", children: selected ? /* @__PURE__ */ jsx(Icon, { className: "selected-item-icon", component: /* @__PURE__ */ jsx(CheckS, {}), color: theme.palette.white }) : /* @__PURE__ */ jsx(Popconfirm, { okText: texts.activate, cancelText: texts.cancel, okType: "primary", placement: "top", onConfirm: () => onSelect?.({
|
|
99
73
|
id: item.id
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
})
|
|
116
|
-
user: item.user,
|
|
117
|
-
created: item.created
|
|
118
|
-
}), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
119
|
-
trigger: ['click'],
|
|
120
|
-
dataSource: dropdownMenuDataSource,
|
|
121
|
-
placement: "bottomRight",
|
|
122
|
-
popoverProps: {
|
|
123
|
-
testId: 'manageable-list-filter-item'
|
|
124
|
-
}
|
|
125
|
-
}, /*#__PURE__*/React.createElement(S.FilterDropdownTrigger, {
|
|
126
|
-
className: "ds-dropdown-trigger",
|
|
127
|
-
mode: "single-icon",
|
|
128
|
-
type: "ghost"
|
|
129
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
130
|
-
component: /*#__PURE__*/React.createElement(OptionHorizontalM, null),
|
|
131
|
-
color: theme.palette['grey-600']
|
|
132
|
-
})))))), /*#__PURE__*/React.createElement(ModalProxy, {
|
|
133
|
-
blank: true,
|
|
134
|
-
onCancel: function onCancel() {
|
|
135
|
-
return setConfirmDeleteVisible(false);
|
|
136
|
-
},
|
|
137
|
-
visible: confirmDeleteVisible,
|
|
138
|
-
size: "small",
|
|
139
|
-
footer: null
|
|
140
|
-
}, /*#__PURE__*/React.createElement(Result, {
|
|
141
|
-
type: "warning",
|
|
142
|
-
title: texts.deleteConfirmationTitle,
|
|
143
|
-
description: texts.deleteConfirmationDescription,
|
|
144
|
-
buttons: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
145
|
-
type: "default",
|
|
146
|
-
onClick: function onClick() {
|
|
147
|
-
return setConfirmDeleteVisible(false);
|
|
148
|
-
}
|
|
149
|
-
}, texts.deleteConfirmationNo), /*#__PURE__*/React.createElement(Button, {
|
|
150
|
-
type: "primary",
|
|
151
|
-
onClick: function onClick() {
|
|
152
|
-
return onRemove && onRemove({
|
|
153
|
-
id: item.id
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}, texts.deleteConfirmationYes))
|
|
157
|
-
})));
|
|
74
|
+
}), title: texts.activateItemTitle, icon: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(WarningFillM, {}), color: theme.palette["yellow-600"] }), children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CircleShapeM, {}), color: theme.palette["grey-300"] }) }) }) }),
|
|
75
|
+
/* @__PURE__ */ jsx(ItemName, { item, editMode, onUpdate: updateName, searchQuery }),
|
|
76
|
+
/* @__PURE__ */ jsxs(ItemHeaderSuffix, { children: [
|
|
77
|
+
(item.user || item.created) && /* @__PURE__ */ jsx(ItemMeta, { user: item.user, created: item.created }),
|
|
78
|
+
/* @__PURE__ */ jsx(DropdownMenu, { trigger: ["click"], dataSource: dropdownMenuDataSource, placement: "bottomRight", popoverProps: {
|
|
79
|
+
testId: "manageable-list-filter-item"
|
|
80
|
+
}, children: /* @__PURE__ */ jsx(FilterDropdownTrigger, { className: "ds-dropdown-trigger", mode: "single-icon", type: "ghost", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(OptionHorizontalM, {}), color: theme.palette["grey-600"] }) }) })
|
|
81
|
+
] })
|
|
82
|
+
] }) }, item.id),
|
|
83
|
+
/* @__PURE__ */ jsx(ModalProxy, { blank: true, onCancel: () => setConfirmDeleteVisible(false), visible: confirmDeleteVisible, size: "small", footer: null, children: /* @__PURE__ */ jsx(Result, { type: "warning", title: texts.deleteConfirmationTitle, description: texts.deleteConfirmationDescription, buttons: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
84
|
+
/* @__PURE__ */ jsx(Button, { type: "default", onClick: () => setConfirmDeleteVisible(false), children: texts.deleteConfirmationNo }),
|
|
85
|
+
/* @__PURE__ */ jsx(Button, { type: "primary", onClick: () => onRemove && onRemove({
|
|
86
|
+
id: item.id
|
|
87
|
+
}), children: texts.deleteConfirmationYes })
|
|
88
|
+
] }) }) })
|
|
89
|
+
] });
|
|
158
90
|
};
|
|
159
|
-
|
|
160
|
-
AdditionalSuffix
|
|
161
|
-
ContentWrapper
|
|
162
|
-
DraggerWrapper
|
|
163
|
-
DropdownTrigger
|
|
164
|
-
DropdownWrapper
|
|
165
|
-
FilterDropdownTrigger
|
|
166
|
-
IconWrapper
|
|
167
|
-
ItemContainer
|
|
168
|
-
ItemHeader
|
|
169
|
-
ItemHeaderPrefix
|
|
170
|
-
ItemHeaderSuffix
|
|
171
|
-
MoveItemButtons
|
|
172
|
-
ToggleContentWrapper
|
|
91
|
+
const FilterItem = Object.assign(FilterItemComponent, {
|
|
92
|
+
AdditionalSuffix,
|
|
93
|
+
ContentWrapper,
|
|
94
|
+
DraggerWrapper,
|
|
95
|
+
DropdownTrigger,
|
|
96
|
+
DropdownWrapper,
|
|
97
|
+
FilterDropdownTrigger,
|
|
98
|
+
IconWrapper,
|
|
99
|
+
ItemContainer,
|
|
100
|
+
ItemHeader,
|
|
101
|
+
ItemHeaderPrefix,
|
|
102
|
+
ItemHeaderSuffix,
|
|
103
|
+
MoveItemButtons,
|
|
104
|
+
ToggleContentWrapper
|
|
173
105
|
});
|
|
174
|
-
export
|
|
106
|
+
export {
|
|
107
|
+
FilterItem as default
|
|
108
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const SelectFilterItem: import(
|
|
2
|
-
export declare const MenuItem: import(
|
|
1
|
+
export declare const SelectFilterItem: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const MenuItem: import('styled-components').StyledComponent<"div", any, {
|
|
3
3
|
danger?: boolean;
|
|
4
4
|
}, never>;
|
|
5
|
-
export declare const ItemHeader: import(
|
|
5
|
+
export declare const ItemHeader: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { IconContainer } from
|
|
3
|
-
import { ItemLabel } from
|
|
4
|
-
import { ItemMeta } from
|
|
5
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
3
|
+
import { ItemLabel } from "../Item.styles.js";
|
|
4
|
+
import { ItemMeta } from "../ItemMeta/ItemMeta.styles.js";
|
|
5
|
+
const SelectFilterItem = /* @__PURE__ */ styled.div.withConfig({
|
|
6
6
|
displayName: "FilterItemstyles__SelectFilterItem",
|
|
7
7
|
componentId: "sc-omg0gg-0"
|
|
8
|
-
})(["margin-right:12px;cursor:pointer;.selected-item-icon{position:relative;svg{position:relative;}&::before{display:flex;content:'';border-radius:50%;background-color:", ";width:16px;height:16px;position:absolute;z-index:0;top:4px;left:4px;}}"],
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
export var MenuItem = styled.div.withConfig({
|
|
8
|
+
})(["margin-right:12px;cursor:pointer;.selected-item-icon{position:relative;svg{position:relative;}&::before{display:flex;content:'';border-radius:50%;background-color:", ";width:16px;height:16px;position:absolute;z-index:0;top:4px;left:4px;}}"], (props) => props.theme.palette["green-600"]);
|
|
9
|
+
const MenuItem = /* @__PURE__ */ styled.div.withConfig({
|
|
12
10
|
displayName: "FilterItemstyles__MenuItem",
|
|
13
11
|
componentId: "sc-omg0gg-1"
|
|
14
|
-
})(["&&{display:flex;align-items:center;justify-content:flex-start;border-radius:3px;height:32px;width:100%;font-size:13px;line-height:1.38;font-weight:500;cursor:pointer;padding:0 8px;background-color:", ";color:", ";&:hover{background-color:background-color:", ";;color:", ";}", "{margin-right:12px;svg{color:", ";fill:", ";}}}"],
|
|
15
|
-
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return props.danger ? props.theme.palette['red-600'] : props.theme.palette['grey-700'];
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.danger ? props.theme.palette['red-050'] : props.theme.palette.white;
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return props.danger ? props.theme.palette['red-600'] : props.theme.palette['grey-700'];
|
|
22
|
-
}, IconContainer, function (props) {
|
|
23
|
-
return props.danger ? props.theme.palette['red-600'] : props.theme.palette['grey-600'];
|
|
24
|
-
}, function (props) {
|
|
25
|
-
return props.danger ? props.theme.palette['red-600'] : props.theme.palette['grey-600'];
|
|
26
|
-
});
|
|
27
|
-
export var ItemHeader = styled.div.withConfig({
|
|
12
|
+
})(["&&{display:flex;align-items:center;justify-content:flex-start;border-radius:3px;height:32px;width:100%;font-size:13px;line-height:1.38;font-weight:500;cursor:pointer;padding:0 8px;background-color:", ";color:", ";&:hover{background-color:background-color:", ";;color:", ";}", "{margin-right:12px;svg{color:", ";fill:", ";}}}"], (props) => props.danger ? props.theme.palette["red-050"] : props.theme.palette.white, (props) => props.danger ? props.theme.palette["red-600"] : props.theme.palette["grey-700"], (props) => props.danger ? props.theme.palette["red-050"] : props.theme.palette.white, (props) => props.danger ? props.theme.palette["red-600"] : props.theme.palette["grey-700"], IconContainer, (props) => props.danger ? props.theme.palette["red-600"] : props.theme.palette["grey-600"], (props) => props.danger ? props.theme.palette["red-600"] : props.theme.palette["grey-600"]);
|
|
13
|
+
const ItemHeader = /* @__PURE__ */ styled.div.withConfig({
|
|
28
14
|
displayName: "FilterItemstyles__ItemHeader",
|
|
29
15
|
componentId: "sc-omg0gg-2"
|
|
30
|
-
})(["display:flex;flex-direction:row;align-items:center;justify-content:stretch;width:100%;padding:12px;max-height:48px;&:hover{", "{color:", ";}}", "{margin-right:12px;}"], ItemLabel,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:stretch;width:100%;padding:12px;max-height:48px;&:hover{", "{color:", ";}}", "{margin-right:12px;}"], ItemLabel, ({
|
|
17
|
+
theme
|
|
18
|
+
}) => theme.palette["grey-800"], ItemMeta);
|
|
19
|
+
export {
|
|
20
|
+
ItemHeader,
|
|
21
|
+
MenuItem,
|
|
22
|
+
SelectFilterItem
|
|
23
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemProps } from '../../ManageableList.types';
|
|
3
3
|
export type FilterItemProps = {
|
|
4
4
|
item: ItemProps;
|
|
5
5
|
greyBackground?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ManageableListItemProps } from '../ManageableList.types';
|
|
3
3
|
declare const Item: ({ item, onRemove, onSelect, onUpdate, listType, onDuplicate, greyBackground, draggable, changeOrderDisabled, selected, texts, searchQuery, hideExpander, expanded, onExpand, onMoveBottom, onMoveTop, isFirst, isLast, additionalActions, isDragPlaceholder, isDragOverlay, dragHandleProps, renderItem, }: ManageableListItemProps) => React.JSX.Element;
|
|
4
4
|
export default Item;
|
package/dist/Item/Item.js
CHANGED
|
@@ -1,98 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ListType } from
|
|
3
|
-
import BlankItem from
|
|
4
|
-
import ContentItem from
|
|
5
|
-
import FilterItem from
|
|
6
|
-
import SimpleItem from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ListType } from "../ManageableList.types.js";
|
|
3
|
+
import BlankItem from "./BlankItem/BlankItem.js";
|
|
4
|
+
import ContentItem from "./ContentItem/ContentItem.js";
|
|
5
|
+
import FilterItem from "./FilterItem/FilterItem.js";
|
|
6
|
+
import SimpleItem from "./SimpleItem/SimpleItem.js";
|
|
7
|
+
const Item = ({
|
|
8
|
+
item,
|
|
9
|
+
onRemove,
|
|
10
|
+
onSelect,
|
|
11
|
+
onUpdate,
|
|
12
|
+
listType,
|
|
13
|
+
onDuplicate,
|
|
14
|
+
greyBackground,
|
|
15
|
+
draggable,
|
|
16
|
+
changeOrderDisabled,
|
|
17
|
+
selected,
|
|
18
|
+
texts,
|
|
19
|
+
searchQuery,
|
|
20
|
+
hideExpander,
|
|
21
|
+
expanded,
|
|
22
|
+
onExpand,
|
|
23
|
+
onMoveBottom,
|
|
24
|
+
onMoveTop,
|
|
25
|
+
isFirst,
|
|
26
|
+
isLast,
|
|
27
|
+
additionalActions,
|
|
28
|
+
isDragPlaceholder,
|
|
29
|
+
isDragOverlay,
|
|
30
|
+
dragHandleProps,
|
|
31
|
+
renderItem
|
|
32
|
+
}) => {
|
|
32
33
|
switch (listType) {
|
|
33
34
|
case ListType.CONTENT:
|
|
34
35
|
case ListType.CONTENT_LARGE:
|
|
35
|
-
return
|
|
36
|
-
key: "item-" + item.id,
|
|
37
|
-
item: item,
|
|
38
|
-
size: listType === ListType.CONTENT ? 'default' : 'large',
|
|
39
|
-
onDuplicate: onDuplicate,
|
|
40
|
-
onUpdate: onUpdate,
|
|
41
|
-
onRemove: onRemove,
|
|
42
|
-
greyBackground: greyBackground,
|
|
43
|
-
changeOrderDisabled: changeOrderDisabled,
|
|
44
|
-
draggable: draggable,
|
|
45
|
-
hideExpander: hideExpander,
|
|
46
|
-
texts: texts,
|
|
47
|
-
expanded: expanded,
|
|
48
|
-
selected: selected,
|
|
49
|
-
onExpand: onExpand,
|
|
50
|
-
onSelect: onSelect,
|
|
51
|
-
onMoveTop: onMoveTop,
|
|
52
|
-
onMoveBottom: onMoveBottom,
|
|
53
|
-
isFirst: Boolean(isFirst),
|
|
54
|
-
isLast: Boolean(isLast),
|
|
55
|
-
isDragPlaceholder: isDragPlaceholder,
|
|
56
|
-
isDragOverlay: isDragOverlay,
|
|
57
|
-
dragHandleProps: dragHandleProps
|
|
58
|
-
});
|
|
36
|
+
return /* @__PURE__ */ jsx(ContentItem, { item, size: listType === ListType.CONTENT ? "default" : "large", onDuplicate, onUpdate, onRemove, greyBackground, changeOrderDisabled, draggable, hideExpander, texts, expanded, selected, onExpand, onSelect, onMoveTop, onMoveBottom, isFirst: Boolean(isFirst), isLast: Boolean(isLast), isDragPlaceholder, isDragOverlay, dragHandleProps }, `item-${item.id}`);
|
|
59
37
|
case ListType.BLANK:
|
|
60
|
-
return
|
|
61
|
-
key: "item-" + item.id,
|
|
62
|
-
item: item,
|
|
63
|
-
onDuplicate: onDuplicate,
|
|
64
|
-
onRemove: onRemove,
|
|
65
|
-
draggable: draggable,
|
|
66
|
-
texts: texts,
|
|
67
|
-
renderItem: renderItem,
|
|
68
|
-
isDragPlaceholder: isDragPlaceholder,
|
|
69
|
-
isDragOverlay: isDragOverlay,
|
|
70
|
-
dragHandleProps: dragHandleProps
|
|
71
|
-
});
|
|
38
|
+
return /* @__PURE__ */ jsx(BlankItem, { item, onDuplicate, onRemove, draggable, texts, renderItem, isDragPlaceholder, isDragOverlay, dragHandleProps }, `item-${item.id}`);
|
|
72
39
|
case ListType.FILTER:
|
|
73
|
-
return
|
|
74
|
-
key: "item-" + item.id,
|
|
75
|
-
item: item,
|
|
76
|
-
greyBackground: greyBackground,
|
|
77
|
-
onSelect: onSelect,
|
|
78
|
-
onDuplicate: onDuplicate,
|
|
79
|
-
onRemove: onRemove,
|
|
80
|
-
onUpdate: onUpdate,
|
|
81
|
-
selected: selected,
|
|
82
|
-
texts: texts,
|
|
83
|
-
searchQuery: searchQuery
|
|
84
|
-
});
|
|
40
|
+
return /* @__PURE__ */ jsx(FilterItem, { item, greyBackground, onSelect, onDuplicate, onRemove, onUpdate, selected, texts, searchQuery }, `item-${item.id}`);
|
|
85
41
|
default:
|
|
86
|
-
return
|
|
87
|
-
key: "item-" + item.id,
|
|
88
|
-
item: item,
|
|
89
|
-
onSelect: onSelect,
|
|
90
|
-
onUpdate: onUpdate,
|
|
91
|
-
onRemove: onRemove,
|
|
92
|
-
texts: texts,
|
|
93
|
-
selected: selected,
|
|
94
|
-
additionalActions: additionalActions
|
|
95
|
-
});
|
|
42
|
+
return /* @__PURE__ */ jsx(SimpleItem, { item, onSelect, onUpdate, onRemove, texts, selected, additionalActions }, `item-${item.id}`);
|
|
96
43
|
}
|
|
97
44
|
};
|
|
98
|
-
export
|
|
45
|
+
export {
|
|
46
|
+
Item as default
|
|
47
|
+
};
|