@eeacms/volto-tabs-block 7.0.2 → 7.0.3
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
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [7.0.3](https://github.com/eea/volto-tabs-block/compare/7.0.2...7.0.3) - 29 November 2023
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: delete styles on tab - refs #260427 [dobri1408 - [`6925c95`](https://github.com/eea/volto-tabs-block/commit/6925c958780e9446949c9023053970f042052ecf)]
|
|
12
|
+
|
|
7
13
|
### [7.0.2](https://github.com/eea/volto-tabs-block/compare/7.0.1...7.0.2) - 24 November 2023
|
|
8
14
|
|
|
9
15
|
#### :bug: Bug Fixes
|
package/package.json
CHANGED
|
@@ -51,7 +51,8 @@ const Edit = (props) => {
|
|
|
51
51
|
const accordionConfig = config.blocks.blocksConfig[
|
|
52
52
|
TABS_BLOCK
|
|
53
53
|
].variations.filter((v, _i) => v.id === data.variation);
|
|
54
|
-
const { icons, semanticIcon, transformWidth = 800 } =
|
|
54
|
+
const { icons, semanticIcon, transformWidth = 800 } =
|
|
55
|
+
accordionConfig?.[0] || {};
|
|
55
56
|
|
|
56
57
|
const tabsContainer = React.useRef();
|
|
57
58
|
const [mounted, setMounted] = React.useState(false);
|
|
@@ -42,7 +42,8 @@ const View = (props) => {
|
|
|
42
42
|
const accordionConfig = config.blocks.blocksConfig[
|
|
43
43
|
TABS_BLOCK
|
|
44
44
|
].variations.filter((v, _i) => v.id === data.variation);
|
|
45
|
-
const { icons, semanticIcon, transformWidth = 800 } =
|
|
45
|
+
const { icons, semanticIcon, transformWidth = 800 } =
|
|
46
|
+
accordionConfig?.[0] || {};
|
|
46
47
|
|
|
47
48
|
const tabsContainer = React.useRef();
|
|
48
49
|
const [mounted, setMounted] = React.useState(false);
|
package/src/index.js
CHANGED
|
@@ -107,7 +107,7 @@ const applyConfig = (config) => {
|
|
|
107
107
|
},
|
|
108
108
|
],
|
|
109
109
|
getBlocks: (data) => {
|
|
110
|
-
const { blocks = {}, blocks_layout = {} } = data?.data;
|
|
110
|
+
const { blocks = {}, blocks_layout = {} } = data?.data || {};
|
|
111
111
|
if (blocks_layout?.items?.length) {
|
|
112
112
|
return {
|
|
113
113
|
blocks: blocks_layout.items.map((block, index) => ({
|
|
@@ -101,7 +101,7 @@ const TabsWidget = (props) => {
|
|
|
101
101
|
},
|
|
102
102
|
blocks_layout: {
|
|
103
103
|
...value.blocks_layout,
|
|
104
|
-
items: [...value.blocks_layout?.items, newId],
|
|
104
|
+
items: [...(value.blocks_layout?.items || []), newId],
|
|
105
105
|
},
|
|
106
106
|
});
|
|
107
107
|
}}
|
|
@@ -170,7 +170,7 @@ const TabsWidget = (props) => {
|
|
|
170
170
|
blocks_layout: {
|
|
171
171
|
...value.blocks_layout,
|
|
172
172
|
items: without(
|
|
173
|
-
[...value.blocks_layout?.items],
|
|
173
|
+
[...(value.blocks_layout?.items || [])],
|
|
174
174
|
childId,
|
|
175
175
|
),
|
|
176
176
|
},
|
|
@@ -227,6 +227,7 @@ const TabsWidget = (props) => {
|
|
|
227
227
|
<StyleWrapperEdit
|
|
228
228
|
{...props}
|
|
229
229
|
selected={activeTabId}
|
|
230
|
+
blockData={activeTabData}
|
|
230
231
|
isVisible={blockStyleVisible}
|
|
231
232
|
setIsVisible={(value) => {
|
|
232
233
|
setActiveTabId(null);
|
|
@@ -238,6 +239,17 @@ const TabsWidget = (props) => {
|
|
|
238
239
|
...(activeTabData.size ? { size: activeTabData.size } : {}),
|
|
239
240
|
}}
|
|
240
241
|
choices={[]}
|
|
242
|
+
onChangeBlock={(block, newData) => {
|
|
243
|
+
onChange(id, {
|
|
244
|
+
...value,
|
|
245
|
+
blocks: {
|
|
246
|
+
...value.blocks,
|
|
247
|
+
[activeTabId]: {
|
|
248
|
+
...newData,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
}}
|
|
241
253
|
onChangeValue={(styleId, styleValue) =>
|
|
242
254
|
onChange(id, {
|
|
243
255
|
...value,
|