@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
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.7.12](https://github.com/Synerise/synerise-design/compare/@synerise/ds-manageable-list@1.7.11...@synerise/ds-manageable-list@1.7.12) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-manageable-list
|
|
9
|
+
|
|
10
|
+
## [1.7.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-manageable-list@1.7.10...@synerise/ds-manageable-list@1.7.11) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-manageable-list
|
|
13
|
+
|
|
6
14
|
## [1.7.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-manageable-list@1.7.9...@synerise/ds-manageable-list@1.7.10) (2026-03-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-manageable-list
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ ManageableList UI Component
|
|
|
22
22
|
onChangeOrder=(action('onChangeOrder'))
|
|
23
23
|
items={[]}
|
|
24
24
|
loading={false}
|
|
25
|
-
|
|
25
|
+
type={ListType.DEFAULT}
|
|
26
26
|
/>
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -34,7 +34,8 @@ ManageableList UI Component
|
|
|
34
34
|
|
|
35
35
|
| Property | Description | Type | Default |
|
|
36
36
|
| ------------------------ | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------- |
|
|
37
|
-
|
|
|
37
|
+
| visibleItemsLimit | Show N first items; rest are hidden under `show more` button | number | - |
|
|
38
|
+
| maxToShowItems | **@deprecated** — use `visibleItemsLimit` instead | number | - |
|
|
38
39
|
| onItemAdd | Callback triggered when user hits `enter` key in the new item input field. | ({ name: string }) => void | - |
|
|
39
40
|
| onItemRemove | Callback triggered when user clicks on the remove item button. | ({ id: string }) => void | - |
|
|
40
41
|
| onItemEdit | Callback triggered then user hits `enter` key in the edit item name input field. | ({ id: string; name: string }) => void | - |
|
|
@@ -43,7 +44,7 @@ ManageableList UI Component
|
|
|
43
44
|
| changeOrderByButtons | Allows to change order of items by dedicated buttons in item suffix, requires onChangeOrder property | boolean | - |
|
|
44
45
|
| items | Array of list items | Item[] | - |
|
|
45
46
|
| loading | Loading state | boolean | - |
|
|
46
|
-
| type | Type of list | `default` / `content` / `filter`
|
|
47
|
+
| type | Type of list | `default` / `blank` / `content` / `content-large` / `filter` | `default` |
|
|
47
48
|
| addButtonDisabled | Disable add item button | boolean | `false` |
|
|
48
49
|
| changeOrderDisabled | Disable change of order | boolean | `false` |
|
|
49
50
|
| greyBackground | Change background color of list and list items | boolean | `false` |
|
|
@@ -51,7 +52,7 @@ ManageableList UI Component
|
|
|
51
52
|
| searchQuery | Search query used to highlight list item name | string | - |
|
|
52
53
|
| additionalActions | Additional actions for single list item | AdditionalAction[] | - |
|
|
53
54
|
| renderCustomToggleButton | Customise the show more / show less button | (props: {onClick: () => void; total: number, limit: number, allItemsVisible: boolean}) => ReactNode | - |
|
|
54
|
-
|
|
|
55
|
+
| style | Additional styles for ManageableList wrapper | React.CSSProperties | - |
|
|
55
56
|
| expandedIds (deprecated) | Array of item ids that should be rendered open | React.Key[] | - |
|
|
56
57
|
|
|
57
58
|
### Texts
|
|
@@ -63,11 +64,11 @@ ManageableList UI Component
|
|
|
63
64
|
| showLessLabel | Label of show less items button | string / React.ReactNode | - |
|
|
64
65
|
| more | Translation of 'more' | string / React.ReactNode | - |
|
|
65
66
|
| less | Translation of 'less' | string / React.ReactNode | - |
|
|
66
|
-
|
|
|
67
|
+
| activateItemTitle | Activate item confirm title | string / React.ReactNode | - |
|
|
67
68
|
| activate | Label of confirm activation button | string / React.ReactNode | - |
|
|
68
69
|
| cancel | Label of cancel button | string / React.ReactNode | - |
|
|
69
70
|
| deleteConfirmationTitle | Title of delete item confirmation popup | string / React.ReactNode | - |
|
|
70
|
-
|
|
|
71
|
+
| deleteConfirmationDescription | Description of delete item confirmation popup | string / React.ReactNode | - |
|
|
71
72
|
| deleteConfirmationYes | Label of delete confirmation button | string / React.ReactNode | - |
|
|
72
73
|
| deleteConfirmationNo | Label of delete cancellation button | string / React.ReactNode | - |
|
|
73
74
|
| itemActionRename | Label of rename item action | string / React.ReactNode | - |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AddBlankItemProps } from './AddBlankItem.types';
|
|
3
3
|
declare const AddBlankItem: ({ disabled, onItemAdd, addItemLabel, }: AddBlankItemProps) => React.JSX.Element;
|
|
4
4
|
export default AddBlankItem;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Button from
|
|
3
|
-
import Icon, { Add3S } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
component: /*#__PURE__*/React.createElement(Add3S, null)
|
|
21
|
-
}), addItemLabel));
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import Icon, { Add3S } from "@synerise/ds-icon";
|
|
4
|
+
import { AddContentButtonWrapper, StyledDivider } from "./AddBlankItem.styles.js";
|
|
5
|
+
const AddBlankItem = ({
|
|
6
|
+
disabled,
|
|
7
|
+
onItemAdd,
|
|
8
|
+
addItemLabel
|
|
9
|
+
}) => {
|
|
10
|
+
return /* @__PURE__ */ jsxs(AddContentButtonWrapper, { "data-testid": "add-item-button", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(StyledDivider, { dashed: true, marginTop: 8 }),
|
|
12
|
+
/* @__PURE__ */ jsxs(Button, { type: "ghost-primary", mode: "icon-label", onClick: onItemAdd, disabled, children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3S, {}) }),
|
|
14
|
+
addItemLabel
|
|
15
|
+
] })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
AddBlankItem as default
|
|
22
20
|
};
|
|
23
|
-
export default AddBlankItem;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AddContentButtonWrapper: import(
|
|
2
|
-
export declare const StyledDivider: import(
|
|
1
|
+
export declare const AddContentButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const StyledDivider: import('styled-components').StyledComponent<(props: import('@synerise/ds-divider').DividerProps) => React.JSX.Element, any, {}, never>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import Divider from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import Divider from "@synerise/ds-divider";
|
|
3
|
+
const AddContentButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "AddBlankItemstyles__AddContentButtonWrapper",
|
|
5
5
|
componentId: "sc-1cqa1jm-0"
|
|
6
6
|
})(["display:flex;flex-direction:column;gap:16px;align-items:flex-start;"]);
|
|
7
|
-
|
|
7
|
+
const StyledDivider = /* @__PURE__ */ styled(Divider).withConfig({
|
|
8
8
|
displayName: "AddBlankItemstyles__StyledDivider",
|
|
9
9
|
componentId: "sc-1cqa1jm-1"
|
|
10
|
-
})(["width:100%;"]);
|
|
10
|
+
})(["width:100%;"]);
|
|
11
|
+
export {
|
|
12
|
+
AddContentButtonWrapper,
|
|
13
|
+
StyledDivider
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AddItemProps } from './AddItem.types';
|
|
3
3
|
declare const AddItem: (({ disabled, onItemAdd, addItemLabel, }: AddItemProps) => React.JSX.Element) & {
|
|
4
|
-
AddContentButtonWrapper: import(
|
|
4
|
+
AddContentButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
5
5
|
};
|
|
6
6
|
export default AddItem;
|
package/dist/AddItem/AddItem.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Button from
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, /*#__PURE__*/React.createElement(Button.Creator, {
|
|
11
|
-
onClick: onItemAdd,
|
|
12
|
-
block: true,
|
|
13
|
-
label: addItemLabel,
|
|
14
|
-
disabled: disabled
|
|
15
|
-
}));
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import { AddContentButtonWrapper } from "./AddItem.styles.js";
|
|
4
|
+
const AddItemComponent = ({
|
|
5
|
+
disabled,
|
|
6
|
+
onItemAdd,
|
|
7
|
+
addItemLabel
|
|
8
|
+
}) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(AddContentButtonWrapper, { "data-testid": "add-item-button", children: /* @__PURE__ */ jsx(Button.Creator, { onClick: onItemAdd, block: true, label: addItemLabel, disabled }) });
|
|
16
10
|
};
|
|
17
|
-
|
|
18
|
-
AddContentButtonWrapper
|
|
11
|
+
const AddItem = Object.assign(AddItemComponent, {
|
|
12
|
+
AddContentButtonWrapper
|
|
19
13
|
});
|
|
20
|
-
export
|
|
14
|
+
export {
|
|
15
|
+
AddItem as default
|
|
16
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AddContentButtonWrapper: import(
|
|
1
|
+
export declare const AddContentButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const AddContentButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "AddItemstyles__AddContentButtonWrapper",
|
|
4
4
|
componentId: "sc-5vjj4u-0"
|
|
5
|
-
})(["display:flex;width:100%;"]);
|
|
5
|
+
})(["display:flex;width:100%;"]);
|
|
6
|
+
export {
|
|
7
|
+
AddContentButtonWrapper
|
|
8
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Props } from './AddItemWithName.types';
|
|
3
3
|
declare const AddItemWithName: ({ onItemAdd, addItemLabel, disabled, placeholder, }: Props) => React.JSX.Element;
|
|
4
4
|
export default AddItemWithName;
|
|
@@ -1,56 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
setName = _useState2[1];
|
|
18
|
-
var handleClickOutside = useCallback(function () {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback } from "react";
|
|
3
|
+
import Button from "@synerise/ds-button";
|
|
4
|
+
import Icon, { Add3M } from "@synerise/ds-icon";
|
|
5
|
+
import { Input } from "@synerise/ds-input";
|
|
6
|
+
import { AddItemLayout } from "./AddItemWithName.styles.js";
|
|
7
|
+
const DEFAULT_NAME = "";
|
|
8
|
+
const AddItemWithName = ({
|
|
9
|
+
onItemAdd,
|
|
10
|
+
addItemLabel,
|
|
11
|
+
disabled,
|
|
12
|
+
placeholder
|
|
13
|
+
}) => {
|
|
14
|
+
const [active, setActive] = useState(false);
|
|
15
|
+
const [name, setName] = useState(DEFAULT_NAME);
|
|
16
|
+
const handleClickOutside = useCallback(() => {
|
|
19
17
|
setActive(false);
|
|
20
18
|
setName(DEFAULT_NAME);
|
|
21
19
|
}, []);
|
|
22
|
-
|
|
20
|
+
const handleNameChange = useCallback((event) => {
|
|
23
21
|
setName(event.target.value);
|
|
24
22
|
}, []);
|
|
25
|
-
|
|
23
|
+
const toggleInput = useCallback(() => {
|
|
26
24
|
setActive(!active);
|
|
27
25
|
setName(DEFAULT_NAME);
|
|
28
26
|
}, [active]);
|
|
29
|
-
|
|
27
|
+
const createItem = useCallback(() => {
|
|
30
28
|
onItemAdd && onItemAdd({
|
|
31
|
-
name
|
|
29
|
+
name
|
|
32
30
|
});
|
|
33
31
|
toggleInput();
|
|
34
32
|
}, [name, onItemAdd, toggleInput]);
|
|
35
|
-
return
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}), addItemLabel), active && /*#__PURE__*/React.createElement(Input, {
|
|
46
|
-
resetMargin: true,
|
|
47
|
-
autoFocus: true,
|
|
48
|
-
value: name,
|
|
49
|
-
onBlur: handleClickOutside,
|
|
50
|
-
onChange: handleNameChange,
|
|
51
|
-
onPressEnter: createItem,
|
|
52
|
-
"data-testid": "add-item-input",
|
|
53
|
-
placeholder: placeholder
|
|
54
|
-
}));
|
|
33
|
+
return /* @__PURE__ */ jsxs(AddItemLayout, { "data-testid": "add-item-with-name-button", children: [
|
|
34
|
+
/* @__PURE__ */ jsxs(Button, { type: "ghost-primary", mode: "icon-label", onClick: toggleInput, disabled, children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3M, {}), size: 24 }),
|
|
36
|
+
addItemLabel
|
|
37
|
+
] }),
|
|
38
|
+
active && /* @__PURE__ */ jsx(Input, { resetMargin: true, autoFocus: true, value: name, onBlur: handleClickOutside, onChange: handleNameChange, onPressEnter: createItem, "data-testid": "add-item-input", placeholder })
|
|
39
|
+
] });
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
AddItemWithName as default
|
|
55
43
|
};
|
|
56
|
-
export default AddItemWithName;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AddItemLayout: import(
|
|
2
|
-
export declare const AddItemLabel: import(
|
|
1
|
+
export declare const AddItemLayout: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const AddItemLabel: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { InputWrapper } from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { InputWrapper } from "@synerise/ds-input/dist/Input.styles";
|
|
3
|
+
const AddItemLayout = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "AddItemWithNamestyles__AddItemLayout",
|
|
5
5
|
componentId: "sc-8u2fy8-0"
|
|
6
6
|
})(["display:inline;flex-direction:column;align-items:stretch;justify-content:center;width:100%;padding:4px 12px;margin-bottom:8px;", "{margin-top:8px;}"], InputWrapper);
|
|
7
|
-
|
|
7
|
+
const AddItemLabel = /* @__PURE__ */ styled.span.withConfig({
|
|
8
8
|
displayName: "AddItemWithNamestyles__AddItemLabel",
|
|
9
9
|
componentId: "sc-8u2fy8-1"
|
|
10
|
-
})(["margin-left:12px;"]);
|
|
10
|
+
})(["margin-left:12px;"]);
|
|
11
|
+
export {
|
|
12
|
+
AddItemLabel,
|
|
13
|
+
AddItemLayout
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BlankItemProps } from './BlankItem.types';
|
|
3
3
|
declare const BlankItem: <T extends object>({ onRemove, onDuplicate, draggable, renderItem, item, texts, rowGap, isDragPlaceholder, isDragOverlay, dragHandleProps, ...rest }: BlankItemProps<T>) => React.JSX.Element;
|
|
4
4
|
export default BlankItem;
|
|
@@ -1,70 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var allTexts = useTexts(texts);
|
|
25
|
-
var handleRemove = useCallback(function (event) {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useTheme } from "@synerise/ds-core";
|
|
4
|
+
import Icon, { DragHandleM, DuplicateS, CloseS } from "@synerise/ds-icon";
|
|
5
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
6
|
+
import { useTexts } from "../../hooks/useTexts.js";
|
|
7
|
+
import { BlankItemWrapper, DragHandle, BlankItemContent, BlankItemActions } from "./BlankItem.styles.js";
|
|
8
|
+
const BlankItem = ({
|
|
9
|
+
onRemove,
|
|
10
|
+
onDuplicate,
|
|
11
|
+
draggable,
|
|
12
|
+
renderItem,
|
|
13
|
+
item,
|
|
14
|
+
texts,
|
|
15
|
+
rowGap = 16,
|
|
16
|
+
isDragPlaceholder,
|
|
17
|
+
isDragOverlay,
|
|
18
|
+
dragHandleProps,
|
|
19
|
+
...rest
|
|
20
|
+
}) => {
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const allTexts = useTexts(texts);
|
|
23
|
+
const handleRemove = useCallback((event) => {
|
|
26
24
|
event.stopPropagation();
|
|
27
|
-
|
|
25
|
+
const {
|
|
26
|
+
id
|
|
27
|
+
} = item;
|
|
28
28
|
onRemove && onRemove({
|
|
29
|
-
id
|
|
29
|
+
id
|
|
30
30
|
});
|
|
31
31
|
}, [item, onRemove]);
|
|
32
|
-
|
|
32
|
+
const handleDuplicate = useCallback((event) => {
|
|
33
33
|
event.stopPropagation();
|
|
34
|
-
|
|
34
|
+
const {
|
|
35
|
+
id
|
|
36
|
+
} = item;
|
|
35
37
|
onDuplicate && onDuplicate({
|
|
36
|
-
id
|
|
38
|
+
id
|
|
37
39
|
});
|
|
38
40
|
}, [item, onDuplicate]);
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})), /*#__PURE__*/React.createElement(S.BlankItemContent, null, renderItem(item)), (onRemove || onDuplicate) && /*#__PURE__*/React.createElement(S.BlankItemActions, null, onDuplicate && /*#__PURE__*/React.createElement(Tooltip, {
|
|
51
|
-
type: "default",
|
|
52
|
-
trigger: "hover",
|
|
53
|
-
title: allTexts.itemActionDuplicateTooltip
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
55
|
-
component: /*#__PURE__*/React.createElement(DuplicateS, null),
|
|
56
|
-
color: theme.palette['grey-600'],
|
|
57
|
-
size: 24,
|
|
58
|
-
onClick: handleDuplicate
|
|
59
|
-
})), onRemove && /*#__PURE__*/React.createElement(Tooltip, {
|
|
60
|
-
type: "default",
|
|
61
|
-
trigger: "hover",
|
|
62
|
-
title: allTexts.itemActionDeleteTooltip
|
|
63
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
-
component: /*#__PURE__*/React.createElement(CloseS, null),
|
|
65
|
-
size: 24,
|
|
66
|
-
color: theme.palette['red-600'],
|
|
67
|
-
onClick: handleRemove
|
|
68
|
-
}))));
|
|
41
|
+
return /* @__PURE__ */ jsxs(BlankItemWrapper, { isDragPlaceholder, isDragOverlay, "data-testid": "manageable-list-blank-item", rowGap, ...rest, children: [
|
|
42
|
+
(draggable || isDragOverlay) && /* @__PURE__ */ jsx(DragHandle, { ...dragHandleProps, children: /* @__PURE__ */ jsx(Icon, { size: 24, component: /* @__PURE__ */ jsx(DragHandleM, { color: "currentColor" }) }) }),
|
|
43
|
+
/* @__PURE__ */ jsx(BlankItemContent, { children: renderItem(item) }),
|
|
44
|
+
(onRemove || onDuplicate) && /* @__PURE__ */ jsxs(BlankItemActions, { children: [
|
|
45
|
+
onDuplicate && /* @__PURE__ */ jsx(Tooltip, { type: "default", trigger: "hover", title: allTexts.itemActionDuplicateTooltip, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(DuplicateS, {}), color: theme.palette["grey-600"], size: 24, onClick: handleDuplicate }) }),
|
|
46
|
+
onRemove && /* @__PURE__ */ jsx(Tooltip, { type: "default", trigger: "hover", title: allTexts.itemActionDeleteTooltip, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseS, {}), size: 24, color: theme.palette["red-600"], onClick: handleRemove }) })
|
|
47
|
+
] })
|
|
48
|
+
] }, item.id);
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
BlankItem as default
|
|
69
52
|
};
|
|
70
|
-
export default BlankItem;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const BlankItemActions: import(
|
|
2
|
-
export declare const DragHandle: import(
|
|
3
|
-
export declare const BlankItemWrapper: import(
|
|
1
|
+
export declare const BlankItemActions: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const DragHandle: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const BlankItemWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
4
4
|
rowGap: number;
|
|
5
5
|
isDragPlaceholder?: boolean;
|
|
6
6
|
isDragOverlay?: boolean;
|
|
7
7
|
}, never>;
|
|
8
|
-
export declare const BlankItemContent: import(
|
|
8
|
+
export declare const BlankItemContent: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const BlankItemActions = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "BlankItemstyles__BlankItemActions",
|
|
4
4
|
componentId: "sc-19vgbbk-0"
|
|
5
|
-
})(["opacity:0;flex:0 1 auto;transition:opacity 0.2s;svg:hover{fill:", ";}"],
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
export var DragHandle = styled.div.withConfig({
|
|
5
|
+
})(["opacity:0;flex:0 1 auto;transition:opacity 0.2s;svg:hover{fill:", ";}"], (props) => props.theme.palette["blue-600"]);
|
|
6
|
+
const DragHandle = /* @__PURE__ */ styled.div.withConfig({
|
|
9
7
|
displayName: "BlankItemstyles__DragHandle",
|
|
10
8
|
componentId: "sc-19vgbbk-1"
|
|
11
|
-
})(["flex:0 1 auto;cursor:grab;svg{fill:", ";}&:hover{svg{fill:", ";}}"],
|
|
12
|
-
|
|
13
|
-
}, function (props) {
|
|
14
|
-
return props.theme.palette['grey-600'];
|
|
15
|
-
});
|
|
16
|
-
export var BlankItemWrapper = styled.div.withConfig({
|
|
9
|
+
})(["flex:0 1 auto;cursor:grab;svg{fill:", ";}&:hover{svg{fill:", ";}}"], (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-600"]);
|
|
10
|
+
const BlankItemWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
17
11
|
displayName: "BlankItemstyles__BlankItemWrapper",
|
|
18
12
|
componentId: "sc-19vgbbk-2"
|
|
19
|
-
})(["", " ", " display:flex;align-items:center;justify-content:space-between;margin-bottom:", "px;&:hover{", "{opacity:1;}}"],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
})(["", " ", " display:flex;align-items:center;justify-content:space-between;margin-bottom:", "px;&:hover{", "{opacity:1;}}"], (props) => props.isDragPlaceholder && `
|
|
14
|
+
background: ${props.theme.palette["blue-050"]};
|
|
15
|
+
border: 1px dashed ${props.theme.palette["blue-300"]};
|
|
16
|
+
border-radius: 3px;
|
|
17
|
+
${BlankItemContent}, ${BlankItemActions}, ${DragHandle} {
|
|
18
|
+
visibility: hidden;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
`, (props) => props.isDragOverlay && `
|
|
22
|
+
box-shadow: 0px 16px 32px 0px ${props.theme.palette["grey-200"]};
|
|
23
|
+
background: ${props.theme.palette.white};
|
|
24
|
+
`, (props) => props.rowGap, BlankItemActions);
|
|
25
|
+
const BlankItemContent = /* @__PURE__ */ styled.div.withConfig({
|
|
27
26
|
displayName: "BlankItemstyles__BlankItemContent",
|
|
28
27
|
componentId: "sc-19vgbbk-3"
|
|
29
|
-
})(["flex:1 1 auto;"]);
|
|
28
|
+
})(["flex:1 1 auto;"]);
|
|
29
|
+
export {
|
|
30
|
+
BlankItemActions,
|
|
31
|
+
BlankItemContent,
|
|
32
|
+
BlankItemWrapper,
|
|
33
|
+
DragHandle
|
|
34
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
|
+
import { ItemProps, Texts } from '../../ManageableList.types';
|
|
4
4
|
export type BlankItemBaseProps<T extends object> = Pick<ItemProps<T>, 'id' | 'name'>;
|
|
5
5
|
export type BaseBlankItemProps<T extends object> = {
|
|
6
6
|
texts?: Partial<Texts>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|