@synerise/ds-manageable-list 1.7.11 → 1.7.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/CHANGELOG.md +8 -0
- 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,14 +1,14 @@
|
|
|
1
|
-
export declare const ItemLabel: import(
|
|
2
|
-
export declare const ItemTagList: import(
|
|
3
|
-
export declare const ItemLabelWrapper: import(
|
|
1
|
+
export declare const ItemLabel: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
2
|
+
export declare const ItemTagList: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const ItemLabelWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
4
4
|
largeSize?: boolean;
|
|
5
5
|
}, never>;
|
|
6
|
-
export declare const ItemContainer: import(
|
|
6
|
+
export declare const ItemContainer: import('styled-components').StyledComponent<"div", any, {
|
|
7
7
|
isSelected: boolean;
|
|
8
8
|
isDisabled: boolean;
|
|
9
9
|
}, never>;
|
|
10
|
-
export declare const DescriptionIcon: import(
|
|
11
|
-
export declare const ItemLabelWithIcon: import(
|
|
12
|
-
export declare const ItemDescription: import(
|
|
13
|
-
export declare const ItemUniqueKey: import(
|
|
14
|
-
export declare const ItemLabelTop: import(
|
|
10
|
+
export declare const DescriptionIcon: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<import('@synerise/ds-icon').BaseIconProps & Omit<import('react').HTMLAttributes<HTMLDivElement>, keyof import('@synerise/ds-icon').BaseIconProps> & import('@synerise/ds-utils').DataAttributes & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
11
|
+
export declare const ItemLabelWithIcon: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
12
|
+
export declare const ItemDescription: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const ItemUniqueKey: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const ItemLabelTop: import('styled-components').StyledComponent<"div", any, {}, never>;
|
package/dist/Item/Item.styles.js
CHANGED
|
@@ -1,71 +1,73 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import Icon from
|
|
3
|
-
import { macro } from
|
|
4
|
-
import { ItemActionsWrapper } from
|
|
5
|
-
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import Icon from "@synerise/ds-icon";
|
|
3
|
+
import { macro } from "@synerise/ds-typography";
|
|
4
|
+
import { ItemActionsWrapper } from "./ItemActions/ItemActions.styles.js";
|
|
5
|
+
const ItemLabel = /* @__PURE__ */ styled.span.withConfig({
|
|
6
6
|
displayName: "Itemstyles__ItemLabel",
|
|
7
7
|
componentId: "sc-1an9szf-0"
|
|
8
|
-
})(["", ";color:", ";height:24px;display:inline-block;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:24px;user-select:none;flex-shrink:0;max-width:100%;&.full-width{max-width:unset;}.search-highlight{font-weight:500;color:", ";}"], macro.h300,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return props.theme.palette['grey-800'];
|
|
13
|
-
});
|
|
14
|
-
export var ItemTagList = styled.div.withConfig({
|
|
8
|
+
})(["", ";color:", ";height:24px;display:inline-block;align-items:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:24px;user-select:none;flex-shrink:0;max-width:100%;&.full-width{max-width:unset;}.search-highlight{font-weight:500;color:", ";}"], macro.h300, ({
|
|
9
|
+
theme
|
|
10
|
+
}) => theme.palette["grey-600"], (props) => props.theme.palette["grey-800"]);
|
|
11
|
+
const ItemTagList = /* @__PURE__ */ styled.div.withConfig({
|
|
15
12
|
displayName: "Itemstyles__ItemTagList",
|
|
16
13
|
componentId: "sc-1an9szf-1"
|
|
17
14
|
})(["margin-left:8px;max-width:100%;overflow:hidden;position:relative;flex-grow:1;&:after{content:'';position:absolute;right:0;top:0;bottom:0;width:20px;background:linear-gradient( 90deg,rgba(0,0,0,0) 0%,rgba(255,255,255,1) 100% );}"]);
|
|
18
|
-
|
|
15
|
+
const ItemLabelWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
19
16
|
displayName: "Itemstyles__ItemLabelWrapper",
|
|
20
17
|
componentId: "sc-1an9szf-2"
|
|
21
|
-
})(["flex:1;display:flex;flex-grow:1;min-width:0;.ant-tooltip-inner{max-width:164px;padding:16px 16px 19px;}", ""],
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
export var ItemContainer = styled.div.withConfig({
|
|
18
|
+
})(["flex:1;display:flex;flex-grow:1;min-width:0;.ant-tooltip-inner{max-width:164px;padding:16px 16px 19px;}", ""], (props) => props.largeSize ? css(["flex-direction:column;gap:10px;overflow-y:visible;", "{margin-left:24px;}"], ItemTagList) : css(["flex-direction:row;align-items:center;overflow:hidden;height:24px;justify-content:flex-start;"]));
|
|
19
|
+
const ItemContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
25
20
|
displayName: "Itemstyles__ItemContainer",
|
|
26
21
|
componentId: "sc-1an9szf-3"
|
|
27
|
-
})(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:stretch;", " background-color:", ";li{width:100%;.title{color:", ";}& > div{height:24px;&:nth-child(2){overflow:hidden;}}}.ds-manageable-list-item-icon{svg{color:", ";fill:", ";}}&:hover{", "{display:flex;}.ds-manageable-list-item-icon{svg{color:", ";fill:", ";}}}"],
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var theme = _ref7.theme;
|
|
50
|
-
return theme.palette['blue-600'];
|
|
51
|
-
});
|
|
52
|
-
export var DescriptionIcon = styled(Icon).withConfig({
|
|
22
|
+
})(["width:100%;display:flex;flex-direction:row;align-items:center;justify-content:stretch;", " background-color:", ";li{width:100%;.title{color:", ";}& > div{height:24px;&:nth-child(2){overflow:hidden;}}}.ds-manageable-list-item-icon{svg{color:", ";fill:", ";}}&:hover{", "{display:flex;}.ds-manageable-list-item-icon{svg{color:", ";fill:", ";}}}"], (props) => props.isDisabled && `
|
|
23
|
+
opacity: 0.4;
|
|
24
|
+
cursor: default;
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
`, ({
|
|
27
|
+
theme,
|
|
28
|
+
isSelected
|
|
29
|
+
}) => isSelected ? theme.palette["blue-050"] : theme.palette.white, ({
|
|
30
|
+
theme,
|
|
31
|
+
isSelected
|
|
32
|
+
}) => isSelected ? theme.palette["blue-600"] : theme.palette["grey-600"], ({
|
|
33
|
+
theme,
|
|
34
|
+
isSelected
|
|
35
|
+
}) => isSelected ? theme.palette["blue-600"] : theme.palette["grey-600"], ({
|
|
36
|
+
theme,
|
|
37
|
+
isSelected
|
|
38
|
+
}) => isSelected ? theme.palette["blue-600"] : theme.palette["grey-600"], ItemActionsWrapper, ({
|
|
39
|
+
theme
|
|
40
|
+
}) => theme.palette["blue-600"], ({
|
|
41
|
+
theme
|
|
42
|
+
}) => theme.palette["blue-600"]);
|
|
43
|
+
const DescriptionIcon = /* @__PURE__ */ styled(Icon).withConfig({
|
|
53
44
|
displayName: "Itemstyles__DescriptionIcon",
|
|
54
45
|
componentId: "sc-1an9szf-4"
|
|
55
46
|
})(["margin-left:2px;"]);
|
|
56
|
-
|
|
47
|
+
const ItemLabelWithIcon = /* @__PURE__ */ styled.span.withConfig({
|
|
57
48
|
displayName: "Itemstyles__ItemLabelWithIcon",
|
|
58
49
|
componentId: "sc-1an9szf-5"
|
|
59
50
|
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-grow:1;"]);
|
|
60
|
-
|
|
51
|
+
const ItemDescription = /* @__PURE__ */ styled.div.withConfig({
|
|
61
52
|
displayName: "Itemstyles__ItemDescription",
|
|
62
53
|
componentId: "sc-1an9szf-6"
|
|
63
54
|
})(["overflow-wrap:break-word;min-width:0;"]);
|
|
64
|
-
|
|
55
|
+
const ItemUniqueKey = /* @__PURE__ */ styled.div.withConfig({
|
|
65
56
|
displayName: "Itemstyles__ItemUniqueKey",
|
|
66
57
|
componentId: "sc-1an9szf-7"
|
|
67
58
|
})([""]);
|
|
68
|
-
|
|
59
|
+
const ItemLabelTop = /* @__PURE__ */ styled.div.withConfig({
|
|
69
60
|
displayName: "Itemstyles__ItemLabelTop",
|
|
70
61
|
componentId: "sc-1an9szf-8"
|
|
71
|
-
})(["display:flex;line-height:12px;height:12px;align-items:center;gap:8px;"]);
|
|
62
|
+
})(["display:flex;line-height:12px;height:12px;align-items:center;gap:8px;"]);
|
|
63
|
+
export {
|
|
64
|
+
DescriptionIcon,
|
|
65
|
+
ItemContainer,
|
|
66
|
+
ItemDescription,
|
|
67
|
+
ItemLabel,
|
|
68
|
+
ItemLabelTop,
|
|
69
|
+
ItemLabelWithIcon,
|
|
70
|
+
ItemLabelWrapper,
|
|
71
|
+
ItemTagList,
|
|
72
|
+
ItemUniqueKey
|
|
73
|
+
};
|
package/dist/Item/Item.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemActionsProps } from './ItemActions.types';
|
|
3
3
|
declare const ItemActions: React.FC<ItemActionsProps>;
|
|
4
4
|
export default ItemActions;
|
|
@@ -1,57 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { theme } from "@synerise/ds-core";
|
|
4
|
+
import Icon, { EditS, DuplicateS, CloseS } from "@synerise/ds-icon";
|
|
5
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
6
|
+
import { ItemActionsWrapper } from "./ItemActions.styles.js";
|
|
7
|
+
const DEFAULT_COLOR = theme.palette["grey-500"];
|
|
8
|
+
const ItemActions = ({
|
|
9
|
+
item,
|
|
10
|
+
duplicateAction,
|
|
11
|
+
duplicateActionTooltip,
|
|
12
|
+
editAction,
|
|
13
|
+
editActionTooltip,
|
|
14
|
+
removeAction,
|
|
15
|
+
removeActionTooltip,
|
|
16
|
+
additionalActions
|
|
17
|
+
}) => {
|
|
18
|
+
const handleDuplicate = React.useCallback((event) => {
|
|
17
19
|
event.stopPropagation();
|
|
18
|
-
|
|
20
|
+
const {
|
|
21
|
+
id
|
|
22
|
+
} = item;
|
|
19
23
|
duplicateAction && duplicateAction({
|
|
20
|
-
id
|
|
24
|
+
id
|
|
21
25
|
});
|
|
22
26
|
}, [item, duplicateAction]);
|
|
23
|
-
|
|
27
|
+
const handleRemove = React.useCallback((event) => {
|
|
24
28
|
event.stopPropagation();
|
|
25
|
-
|
|
29
|
+
const {
|
|
30
|
+
id
|
|
31
|
+
} = item;
|
|
26
32
|
removeAction && removeAction({
|
|
27
|
-
id
|
|
33
|
+
id
|
|
28
34
|
});
|
|
29
35
|
}, [item, removeAction]);
|
|
30
|
-
|
|
36
|
+
const handleEdit = React.useCallback((event) => {
|
|
31
37
|
event.stopPropagation();
|
|
32
38
|
editAction && editAction();
|
|
33
39
|
}, [editAction]);
|
|
34
|
-
|
|
35
|
-
return condition &&
|
|
36
|
-
type: "default",
|
|
37
|
-
trigger: "hover",
|
|
38
|
-
title: tooltip
|
|
39
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
"data-testid": testId
|
|
41
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
42
|
-
component: icon,
|
|
43
|
-
size: 24,
|
|
44
|
-
color: color,
|
|
45
|
-
onClick: handleClick
|
|
46
|
-
})));
|
|
40
|
+
const renderIcon = React.useCallback((condition, icon, color, handleClick, testId, tooltip) => {
|
|
41
|
+
return condition && /* @__PURE__ */ jsx(Tooltip, { type: "default", trigger: "hover", title: tooltip, children: /* @__PURE__ */ jsx("div", { "data-testid": testId, children: /* @__PURE__ */ jsx(Icon, { component: icon, size: 24, color, onClick: handleClick }) }) });
|
|
47
42
|
}, []);
|
|
48
|
-
|
|
49
|
-
return additionalActions && additionalActions.map(
|
|
50
|
-
return renderIcon(true, action.icon, action.color || DEFAULT_COLOR, function () {
|
|
51
|
-
return action.onClick(item);
|
|
52
|
-
}, "additional-action-" + index, action.tooltip);
|
|
53
|
-
});
|
|
43
|
+
const renderAdditionalActions = React.useMemo(() => {
|
|
44
|
+
return additionalActions && additionalActions.map((action, index) => renderIcon(true, action.icon, action.color || DEFAULT_COLOR, () => action.onClick(item), `additional-action-${index}`, action.tooltip));
|
|
54
45
|
}, [additionalActions, item, renderIcon]);
|
|
55
|
-
return
|
|
46
|
+
return /* @__PURE__ */ jsxs(ItemActionsWrapper, { children: [
|
|
47
|
+
additionalActions && renderAdditionalActions,
|
|
48
|
+
renderIcon(Boolean(item.canUpdate), /* @__PURE__ */ jsx(EditS, {}), DEFAULT_COLOR, handleEdit, "list-item-edit", editActionTooltip),
|
|
49
|
+
renderIcon(Boolean(item.canDuplicate), /* @__PURE__ */ jsx(DuplicateS, {}), DEFAULT_COLOR, handleDuplicate, "list-item-duplicate", duplicateActionTooltip),
|
|
50
|
+
renderIcon(Boolean(item.canDelete), /* @__PURE__ */ jsx(CloseS, {}), theme.palette["red-600"], handleRemove, "list-item-remove", removeActionTooltip)
|
|
51
|
+
] });
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
ItemActions as default
|
|
56
55
|
};
|
|
57
|
-
export default ItemActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ItemActionsWrapper: import(
|
|
1
|
+
export declare const ItemActionsWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { IconContainer } from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
3
|
+
const ItemActionsWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "ItemActionsstyles__ItemActionsWrapper",
|
|
5
5
|
componentId: "sc-1n2bgbl-0"
|
|
6
|
-
})(["display:none;flex-direction:row;align-items:center;justify-content:flex-end;span{margin:0 0 0 8px;}", ":hover{svg{fill:", ";}}"], IconContainer,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
})(["display:none;flex-direction:row;align-items:center;justify-content:flex-end;span{margin:0 0 0 8px;}", ":hover{svg{fill:", ";}}"], IconContainer, ({
|
|
7
|
+
theme
|
|
8
|
+
}) => theme.palette["blue-600"]);
|
|
9
|
+
export {
|
|
10
|
+
ItemActionsWrapper
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdditionalAction, ItemProps } from '../../ManageableList.types';
|
|
3
3
|
export type ItemActionsProps = {
|
|
4
4
|
item: ItemProps;
|
|
5
5
|
removeAction?: (removeParams: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { UserAvatar } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import { UserAvatar } from "@synerise/ds-avatar";
|
|
4
|
+
import { ItemMeta as ItemMeta$1, ItemMetaCreated } from "./ItemMeta.styles.js";
|
|
5
|
+
const ItemMeta = ({
|
|
6
|
+
user,
|
|
7
|
+
created
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
firstname: firstName,
|
|
11
|
+
lastname: lastName,
|
|
12
|
+
avatar_url: avatar,
|
|
13
|
+
email
|
|
14
|
+
} = user || {};
|
|
15
|
+
const userData = {
|
|
16
|
+
firstName,
|
|
17
|
+
lastName,
|
|
18
|
+
avatar,
|
|
19
|
+
email
|
|
18
20
|
};
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
user: userData
|
|
22
|
-
})
|
|
21
|
+
return /* @__PURE__ */ jsxs(ItemMeta$1, { children: [
|
|
22
|
+
created && /* @__PURE__ */ jsx(ItemMetaCreated, { children: moment.utc(created).fromNow() }),
|
|
23
|
+
user && /* @__PURE__ */ jsx(UserAvatar, { size: "small", user: userData })
|
|
24
|
+
] });
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
ItemMeta,
|
|
28
|
+
ItemMeta as default
|
|
23
29
|
};
|
|
24
|
-
export default ItemMeta;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ItemMetaCreated: import(
|
|
2
|
-
export declare const ItemMeta: import(
|
|
1
|
+
export declare const ItemMetaCreated: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
2
|
+
export declare const ItemMeta: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const ItemMetaCreated = /* @__PURE__ */ styled.span.withConfig({
|
|
3
3
|
displayName: "ItemMetastyles__ItemMetaCreated",
|
|
4
4
|
componentId: "sc-1jx08et-0"
|
|
5
|
-
})(["color:", ";font-size:13px;line-height:18px;"],
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
export var ItemMeta = styled.div.withConfig({
|
|
5
|
+
})(["color:", ";font-size:13px;line-height:18px;"], (props) => props.theme.palette["grey-500"]);
|
|
6
|
+
const ItemMeta = /* @__PURE__ */ styled.div.withConfig({
|
|
9
7
|
displayName: "ItemMetastyles__ItemMeta",
|
|
10
8
|
componentId: "sc-1jx08et-1"
|
|
11
|
-
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-end;height:100%;padding-left:16px;.ds-avatar{margin-left:12px;}"]);
|
|
9
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-end;height:100%;padding-left:16px;.ds-avatar{margin-left:12px;}"]);
|
|
10
|
+
export {
|
|
11
|
+
ItemMeta,
|
|
12
|
+
ItemMetaCreated
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemLabelProps } from './ItemName.types';
|
|
3
3
|
declare const ItemName: ({ item, onUpdate, editMode, searchQuery, }: ItemLabelProps) => React.JSX.Element;
|
|
4
4
|
export default ItemName;
|
|
@@ -1,78 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var updateName = useCallback(function () {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
3
|
+
import { InfoFillS } from "@synerise/ds-icon";
|
|
4
|
+
import InlineEdit from "@synerise/ds-inline-edit/dist/InlineEdit";
|
|
5
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
6
|
+
import { escapeRegEx } from "@synerise/ds-utils";
|
|
7
|
+
import { ItemLabelWrapper, ItemLabelWithIcon, ItemLabel, DescriptionIcon, ItemTagList } from "../Item.styles.js";
|
|
8
|
+
const ItemName = ({
|
|
9
|
+
item,
|
|
10
|
+
onUpdate,
|
|
11
|
+
editMode,
|
|
12
|
+
searchQuery
|
|
13
|
+
}) => {
|
|
14
|
+
const [editedName, setEditedName] = useState(item.name);
|
|
15
|
+
const updateName = useCallback(() => {
|
|
17
16
|
onUpdate && onUpdate({
|
|
18
17
|
id: item.id,
|
|
19
18
|
name: editedName
|
|
20
19
|
});
|
|
21
20
|
}, [editedName, onUpdate, item.id]);
|
|
22
|
-
|
|
21
|
+
const editName = useCallback((event) => {
|
|
23
22
|
setEditedName(event.target.value);
|
|
24
23
|
}, []);
|
|
25
|
-
useEffect(
|
|
24
|
+
useEffect(() => {
|
|
26
25
|
if (item.name !== editedName) {
|
|
27
26
|
setEditedName(item.name);
|
|
28
27
|
}
|
|
29
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
28
|
}, [editMode]);
|
|
31
|
-
|
|
29
|
+
const inputProps = useMemo(() => {
|
|
32
30
|
return {
|
|
33
|
-
name:
|
|
31
|
+
name: "list-item-name-input",
|
|
34
32
|
value: editedName,
|
|
35
33
|
onBlur: updateName,
|
|
36
34
|
onChange: editName
|
|
37
35
|
};
|
|
38
36
|
}, [editedName, updateName, editName]);
|
|
39
|
-
|
|
37
|
+
const name = useMemo(() => {
|
|
40
38
|
if (searchQuery) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
key: item.id,
|
|
46
|
-
className: "search-highlight"
|
|
47
|
-
}, item.name.substring(startOfQuery, endOfQuery)), item.name.substring(endOfQuery, item.name.length)];
|
|
39
|
+
const escapedQuery = escapeRegEx(searchQuery);
|
|
40
|
+
const startOfQuery = item.name.toLowerCase().search(escapedQuery.toLowerCase());
|
|
41
|
+
const endOfQuery = startOfQuery + searchQuery.length;
|
|
42
|
+
const resultArray = [item.name.substring(0, startOfQuery), /* @__PURE__ */ jsx("span", { className: "search-highlight", children: item.name.substring(startOfQuery, endOfQuery) }, item.id), item.name.substring(endOfQuery, item.name.length)];
|
|
48
43
|
return resultArray;
|
|
49
44
|
}
|
|
50
45
|
return item.name;
|
|
51
46
|
}, [item.id, item.name, searchQuery]);
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
autoFocus: true
|
|
65
|
-
}) : /*#__PURE__*/React.createElement(S.ItemLabelWithIcon, null, /*#__PURE__*/React.createElement(S.ItemLabel, {
|
|
66
|
-
"data-testid": "list-item-name",
|
|
67
|
-
className: classes.join(' ')
|
|
68
|
-
}, name), item.description && /*#__PURE__*/React.createElement(Tooltip, {
|
|
69
|
-
description: item.description,
|
|
70
|
-
placement: "top",
|
|
71
|
-
trigger: "hover",
|
|
72
|
-
type: "largeSimple"
|
|
73
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(S.DescriptionIcon, {
|
|
74
|
-
component: /*#__PURE__*/React.createElement(InfoFillS, null),
|
|
75
|
-
color: "#b5bdc3"
|
|
76
|
-
}))), item.tags && /*#__PURE__*/React.createElement(S.ItemTagList, null, item.tags)));
|
|
47
|
+
const classes = item.nameWrapperClassNames?.length ? ["title", ...item.nameWrapperClassNames] : ["title"];
|
|
48
|
+
return /* @__PURE__ */ jsx(ItemLabelWrapper, { "data-testid": item.description && "item-description-icon", children: editMode ? /* @__PURE__ */ jsx(InlineEdit, { size: "small", hideIcon: true, style: {
|
|
49
|
+
maxWidth: "100%",
|
|
50
|
+
lineHeight: "24px"
|
|
51
|
+
}, input: inputProps, "data-testid": "list-item-name-input", autoFocus: true }) : /* @__PURE__ */ jsxs(ItemLabelWithIcon, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(ItemLabel, { "data-testid": "list-item-name", className: classes.join(" "), children: name }),
|
|
53
|
+
item.description && /* @__PURE__ */ jsx(Tooltip, { description: item.description, placement: "top", trigger: "hover", type: "largeSimple", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(DescriptionIcon, { component: /* @__PURE__ */ jsx(InfoFillS, {}), color: "#b5bdc3" }) }) }),
|
|
54
|
+
item.tags && /* @__PURE__ */ jsx(ItemTagList, { children: item.tags })
|
|
55
|
+
] }) });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
ItemName as default
|
|
77
59
|
};
|
|
78
|
-
export default ItemName;
|
|
@@ -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 ItemLabelProps = {
|
|
4
4
|
item: ItemProps;
|
|
5
5
|
onUpdate?: (updateParams: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemNameLargeProps } from './ItemNameLarge.types';
|
|
3
3
|
declare const ItemNameLarge: ({ item }: ItemNameLargeProps) => React.JSX.Element;
|
|
4
4
|
export default ItemNameLarge;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ItemLabelWrapper, ItemLabelTop, ItemLabel, ItemUniqueKey, ItemTagList, ItemDescription } from "../Item.styles.js";
|
|
3
|
+
const ItemNameLarge = ({
|
|
4
|
+
item
|
|
5
|
+
}) => {
|
|
6
|
+
const classes = item.nameWrapperClassNames?.length ? ["title", ...item.nameWrapperClassNames] : ["title"];
|
|
7
|
+
return /* @__PURE__ */ jsxs(ItemLabelWrapper, { largeSize: true, children: [
|
|
8
|
+
/* @__PURE__ */ jsxs(ItemLabelTop, { children: [
|
|
9
|
+
/* @__PURE__ */ jsx(ItemLabel, { "data-testid": "list-item-name", className: classes.join(" "), children: item.name }),
|
|
10
|
+
item.uniqueKey && /* @__PURE__ */ jsx(ItemUniqueKey, { children: item.uniqueKey }),
|
|
11
|
+
item.tags && /* @__PURE__ */ jsx(ItemTagList, { children: item.tags })
|
|
12
|
+
] }),
|
|
13
|
+
item.description && /* @__PURE__ */ jsx(ItemDescription, { children: item.description })
|
|
14
|
+
] });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
ItemNameLarge as default
|
|
13
18
|
};
|
|
14
|
-
export default ItemNameLarge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|