@eeacms/volto-tabs-block 1.2.12 → 1.3.0

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,9 +4,25 @@ 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
+ #### [1.3.0](https://github.com/eea/volto-tabs-block/compare/1.2.12...1.3.0)
8
+
9
+ - Refactor tabs block [`#18`](https://github.com/eea/volto-tabs-block/pull/18)
10
+ - Fix tests [`fdc74d9`](https://github.com/eea/volto-tabs-block/commit/fdc74d9f5f1c851de9ca3a9576cf2dbcd1495968)
11
+ - Bump version [`acfef41`](https://github.com/eea/volto-tabs-block/commit/acfef413eb9f923f7a7283d12417e23c81192633)
12
+ - Change z-index for slide-arrows [`97baed1`](https://github.com/eea/volto-tabs-block/commit/97baed1c11b90d043cb5f772c65dcaee24278ca3)
13
+ - update [`26bfd0e`](https://github.com/eea/volto-tabs-block/commit/26bfd0e00aded4bef827b57c7e0d9036540a7ee7)
14
+ - update [`542d0cd`](https://github.com/eea/volto-tabs-block/commit/542d0cd14e8164d20d8cb8dd7416d108fbaa88d5)
15
+ - Make horizontal-responsive work [`bb1d81e`](https://github.com/eea/volto-tabs-block/commit/bb1d81e858d01c409ce86f19974c60cbd764b717)
16
+ - Add horizontal responsive template [`c6e6cca`](https://github.com/eea/volto-tabs-block/commit/c6e6cca355c6164a26e7aec291e4a0223625ea91)
17
+ - Let theme addon to set default values for default template schema [`55f148d`](https://github.com/eea/volto-tabs-block/commit/55f148d1a95417f8a0b55681ce250acde8463c1c)
18
+ - Render pane as container if tabs-block has full-width class [`bbffb96`](https://github.com/eea/volto-tabs-block/commit/bbffb96b908476ddee447af3ce79bafb1a12f9a8)
19
+ - Refactor default template [`58eff52`](https://github.com/eea/volto-tabs-block/commit/58eff5281adb08a5f8fe6d21fd43330252012277)
20
+
7
21
  #### [1.2.12](https://github.com/eea/volto-tabs-block/compare/1.2.11...1.2.12)
8
22
 
9
- - Make sure metadata block works within Tabs block [`65a6bf4`](https://github.com/eea/volto-tabs-block/commit/65a6bf41ab81e308fd75c6525616a4735dbfe456)
23
+ > 21 January 2022
24
+
25
+ - Make sure metadata block works within Tabs block [`#17`](https://github.com/eea/volto-tabs-block/pull/17)
10
26
 
11
27
  #### [1.2.11](https://github.com/eea/volto-tabs-block/compare/1.2.10...1.2.11)
12
28
 
package/Jenkinsfile CHANGED
@@ -4,7 +4,7 @@ pipeline {
4
4
  environment {
5
5
  GIT_NAME = "volto-tabs-block"
6
6
  NAMESPACE = "@eeacms"
7
- SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater"
7
+ SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu"
8
8
  DEPENDENCIES = "@eeacms/volto-block-style"
9
9
  }
10
10
 
@@ -36,14 +36,13 @@ describe('Blocks Tests', () => {
36
36
  cy.get('.field-wrapper-menuAlign #field-menuAlign').click();
37
37
  cy.get('.react-select__menu').contains('Left').click();
38
38
  cy.get('.field-wrapper-menuPosition #field-menuPosition').first().click();
39
- cy.get('.react-select__menu').contains('Inline').click();
39
+ cy.get('.react-select__menu').contains('Top').click();
40
40
 
41
41
  cy.get('[contenteditable=true]').first().focus().click();
42
- cy.get('.tabs-block [contenteditable=true]').first().type("Hydrogen");
42
+ cy.get('.tabs-block [contenteditable=true]').first().type('Hydrogen');
43
43
  cy.get('.tabs-block .ui.left.menu .item').last().click();
44
44
  cy.get('.tabs-block').contains('Tab 2').click();
45
- cy.get('.tabs-block.edit [contenteditable=true]').first().type("Oxygen");
46
-
45
+ cy.get('.tabs-block.edit [contenteditable=true]').first().type('Oxygen');
47
46
 
48
47
  cy.get('[contenteditable=true]').first().type('{enter}');
49
48
  cy.get('.ui.basic.icon.button.block-add-button').first().click();
@@ -56,8 +55,8 @@ describe('Blocks Tests', () => {
56
55
  cy.get('.react-select__menu').contains('Bottom').click();
57
56
  cy.get('.field-wrapper-theme #field-theme').click();
58
57
  cy.get('.react-select__menu').contains('Dark').click();
59
- cy.get('.tabs-block .ui.left.menu .item').eq(1).click();
60
-
58
+ cy.get('.tabs-block .ui.menu .item').last().click();
59
+ cy.get('.tabs-block .ui.menu .item').eq(1).click();
61
60
 
62
61
  // Save
63
62
  cy.get('#toolbar-save').click();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tabs-block",
3
- "version": "1.2.12",
3
+ "version": "1.3.0",
4
4
  "description": "volto-tabs-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { without } from 'lodash';
3
+ import cx from 'classnames';
4
+ import config from '@plone/volto/registry';
3
5
  import { SidebarPortal, BlocksToolbar } from '@plone/volto/components';
4
6
  import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
5
7
  import { getBlocksLayoutFieldname } from '@plone/volto/helpers';
@@ -9,9 +11,9 @@ import { StyleWrapperView } from '@eeacms/volto-block-style/StyleWrapper';
9
11
  import { BlockStyleWrapperEdit } from '@eeacms/volto-block-style/BlockStyleWrapper';
10
12
  import { DefaultEdit } from './templates/default';
11
13
  import { schema } from './schema';
12
- import cx from 'classnames';
13
14
 
14
- import config from '@plone/volto/registry';
15
+ import '@eeacms/volto-tabs-block/less/edit.less';
16
+ import '@eeacms/volto-tabs-block/less/tabs.less';
15
17
 
16
18
  const Edit = (props) => {
17
19
  const { onChangeBlock, onChangeField } = props;
@@ -36,7 +38,12 @@ const Edit = (props) => {
36
38
  const templateSchema =
37
39
  config.blocks.blocksConfig[TABS_BLOCK].templates?.[template]?.schema || {};
38
40
 
39
- const schemaObject = schema(config, templateSchema(config));
41
+ const schemaObject = schema(
42
+ config,
43
+ typeof templateSchema === 'function'
44
+ ? templateSchema(config, props)
45
+ : templateSchema,
46
+ );
40
47
 
41
48
  React.useEffect(() => {
42
49
  if (!Object.keys(data.data || {}).length) {
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
+ import cx from 'classnames';
3
+ import { StyleWrapperView } from '@eeacms/volto-block-style/StyleWrapper';
2
4
  import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants';
3
5
  import { DefaultView } from './templates/default';
4
- import { StyleWrapperView } from '@eeacms/volto-block-style/StyleWrapper';
5
- import cx from 'classnames';
6
6
 
7
7
  import config from '@plone/volto/registry';
8
8
 
9
- import '@eeacms/volto-tabs-block/less/tabs-block.less';
9
+ import '@eeacms/volto-tabs-block/less/edit.less';
10
+ import '@eeacms/volto-tabs-block/less/tabs.less';
10
11
 
11
12
  const View = (props) => {
12
13
  const view = React.useRef(null);
@@ -7,4 +7,5 @@ export { TabsEdit, TabsView };
7
7
  export { layoutSchema };
8
8
 
9
9
  export * from './templates/default';
10
+ export * from './templates/horizontal-responsive';
10
11
  export * from './templates/carousel';
@@ -7,12 +7,12 @@ export const schema = (config, templateSchema = {}) => {
7
7
  templatesConfig[template].title || template,
8
8
  ]);
9
9
 
10
- const defaultFieldset = templateSchema.fieldsets.filter(
10
+ const defaultFieldset = templateSchema?.fieldsets?.filter(
11
11
  (fieldset) => fieldset.id === 'default',
12
12
  )[0];
13
13
 
14
14
  return {
15
- title: templateSchema.title || 'Tabs block',
15
+ title: templateSchema?.title || 'Tabs block',
16
16
  fieldsets: [
17
17
  {
18
18
  id: 'default',
@@ -22,10 +22,10 @@ export const schema = (config, templateSchema = {}) => {
22
22
  'title',
23
23
  'template',
24
24
  'verticalAlign',
25
- ...(defaultFieldset?.fields || {}),
25
+ ...(defaultFieldset?.fields || []),
26
26
  ],
27
27
  },
28
- ...(templateSchema.fieldsets.filter(
28
+ ...(templateSchema?.fieldsets?.filter(
29
29
  (fieldset) => fieldset.id !== 'default',
30
30
  ) || []),
31
31
  ],
@@ -53,8 +53,8 @@ export const schema = (config, templateSchema = {}) => {
53
53
  ],
54
54
  default: 'flex-start',
55
55
  },
56
- ...(templateSchema.properties || {}),
56
+ ...(templateSchema?.properties || {}),
57
57
  },
58
- required: [...(templateSchema.required || [])],
58
+ required: [...(templateSchema?.required || [])],
59
59
  };
60
60
  };
@@ -3,11 +3,13 @@ import { connect } from 'react-redux';
3
3
  import { compose } from 'redux';
4
4
  import { withRouter } from 'react-router';
5
5
  import loadable from '@loadable/component';
6
+ import cx from 'classnames';
6
7
  import { Icon, RenderBlocks } from '@plone/volto/components';
7
8
  import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
9
+
8
10
  import rightArrowSVG from '@eeacms/volto-tabs-block/icons/right-arrow.svg';
9
11
  import leftArrowSVG from '@eeacms/volto-tabs-block/icons/left-arrow.svg';
10
- import cx from 'classnames';
12
+
11
13
  import 'slick-carousel/slick/slick.css';
12
14
  import 'slick-carousel/slick/slick-theme.css';
13
15
  import '@eeacms/volto-tabs-block/less/carousel.less';
@@ -3,9 +3,9 @@ import { connect } from 'react-redux';
3
3
  import { compose } from 'redux';
4
4
  import { withRouter } from 'react-router';
5
5
  import loadable from '@loadable/component';
6
+ import cx from 'classnames';
6
7
  import { RenderBlocks } from '@plone/volto/components';
7
8
  import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
8
- import cx from 'classnames';
9
9
 
10
10
  import 'slick-carousel/slick/slick.css';
11
11
  import 'slick-carousel/slick/slick-theme.css';
@@ -1,12 +1,17 @@
1
1
  import React from 'react';
2
2
  import { isEmpty } from 'lodash';
3
3
  import { v4 as uuid } from 'uuid';
4
- import { Menu, Tab, Input } from 'semantic-ui-react';
4
+ import cx from 'classnames';
5
+ import { Menu, Tab, Input, Container } from 'semantic-ui-react';
6
+ import config from '@plone/volto/registry';
5
7
  import { BlocksForm } from '@plone/volto/components';
6
8
  import { emptyBlocksForm } from '@plone/volto/helpers';
9
+ import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants';
7
10
  import EditBlockWrapper from '@eeacms/volto-tabs-block/components/EditBlockWrapper';
8
- import { SimpleMarkdown } from '@eeacms/volto-tabs-block/utils';
9
- import cx from 'classnames';
11
+ import {
12
+ SimpleMarkdown,
13
+ getMenuPosition,
14
+ } from '@eeacms/volto-tabs-block/utils';
10
15
 
11
16
  import '@eeacms/volto-tabs-block/less/menu.less';
12
17
 
@@ -19,10 +24,12 @@ const MenuItem = (props) => {
19
24
  data = {},
20
25
  editingTab = null,
21
26
  selected = false,
22
- tabs = {},
23
27
  tabData = {},
28
+ tabs = {},
24
29
  tabsData = {},
30
+ tabsDescription,
25
31
  tabsList = [],
32
+ tabsTitle,
26
33
  emptyTab = () => {},
27
34
  setActiveBlock = () => {},
28
35
  setActiveTab = () => {},
@@ -63,6 +70,12 @@ const MenuItem = (props) => {
63
70
 
64
71
  return (
65
72
  <>
73
+ {index === 0 && (tabsTitle || tabsDescription) && (
74
+ <Menu.Item className="menu-title">
75
+ <SimpleMarkdown md={tabsTitle} className="title" defaultTag="##" />
76
+ <SimpleMarkdown md={tabsDescription} className="description" />
77
+ </Menu.Item>
78
+ )}
66
79
  <Menu.Item
67
80
  name={defaultTitle}
68
81
  active={tab === activeTab}
@@ -150,43 +163,47 @@ const Edit = (props) => {
150
163
  onSelectBlock = () => {},
151
164
  setEditingTab = () => {},
152
165
  } = props;
153
- const uiContainer = data.align === 'full' ? 'ui container' : false;
154
- const menuAlign = data.menuAlign || 'left';
155
- const menuPosition = data.menuPosition || 'inline';
166
+ const menuPosition = getMenuPosition(data);
167
+ const isContainer = data.align === 'full';
156
168
  const tabsTitle = data.title;
157
169
  const tabsDescription = data.description;
158
170
 
171
+ const schema = React.useMemo(
172
+ () =>
173
+ config.blocks.blocksConfig[TABS_BLOCK].templates?.['default']?.schema(
174
+ config,
175
+ props,
176
+ ) || {},
177
+ [props],
178
+ );
179
+
180
+ const getDataValue = React.useCallback(
181
+ (key) => {
182
+ return (
183
+ (schema.properties[key]?.value || data[key]) ??
184
+ schema.properties[key]?.defaultValue
185
+ );
186
+ },
187
+ [schema, data],
188
+ );
189
+
159
190
  const panes = tabsList.map((tab, index) => {
160
191
  return {
161
192
  id: tab,
162
- menuItem: () => {
163
- return (
164
- <React.Fragment key={`tab-${tab}`}>
165
- {index === 0 && (tabsTitle || tabsDescription) ? (
166
- <Menu.Item className="menu-title">
167
- <SimpleMarkdown
168
- md={tabsTitle}
169
- className="title"
170
- defaultTag="##"
171
- />
172
- <SimpleMarkdown md={tabsDescription} className="description" />
173
- </Menu.Item>
174
- ) : (
175
- ''
176
- )}
177
- <MenuItem
178
- {...props}
179
- editingTab={editingTab}
180
- index={index}
181
- setEditingTab={setEditingTab}
182
- tab={tab}
183
- />
184
- </React.Fragment>
185
- );
186
- },
193
+ menuItem: (
194
+ <MenuItem
195
+ {...props}
196
+ editingTab={editingTab}
197
+ index={index}
198
+ setEditingTab={setEditingTab}
199
+ tab={tab}
200
+ tabsTitle={tabsTitle}
201
+ tabsDescription={tabsDescription}
202
+ />
203
+ ),
187
204
  render: () => {
188
205
  return (
189
- <Tab.Pane>
206
+ <Tab.Pane as={isContainer ? Container : undefined}>
190
207
  <BlocksForm
191
208
  allowedBlocks={data?.allowedBlocks}
192
209
  description={data?.instrunctions?.data}
@@ -253,11 +270,26 @@ const Edit = (props) => {
253
270
  <>
254
271
  <Tab
255
272
  activeIndex={activeTabIndex}
256
- className={cx('default tabs', menuPosition, uiContainer)}
273
+ className="default tabs"
257
274
  menu={{
258
- className: cx(menuAlign),
275
+ attached: menuPosition.attached,
276
+ borderless: getDataValue('menuBorderless'),
277
+ color: getDataValue('menuColor'),
278
+ compact: getDataValue('menuCompact'),
279
+ fluid: getDataValue('menuFluid'),
280
+ inverted: getDataValue('menuInverted'),
281
+ pointing: getDataValue('menuPointing'),
282
+ secondary: getDataValue('menuSecondary'),
283
+ size: getDataValue('menuSize'),
284
+ stackable: getDataValue('menuStackable'),
285
+ tabular: getDataValue('menuTabular'),
286
+ text: getDataValue('menuText'),
287
+ vertical: menuPosition.vertical,
288
+ className: cx(data.menuAlign, { container: isContainer }),
259
289
  }}
290
+ menuPosition={menuPosition.direction}
260
291
  panes={panes}
292
+ grid={{ paneWidth: 9, tabWidth: 3 }}
261
293
  />
262
294
  </>
263
295
  );
@@ -2,17 +2,27 @@ import React from 'react';
2
2
  import { connect } from 'react-redux';
3
3
  import { compose } from 'redux';
4
4
  import { withRouter } from 'react-router';
5
- import { Menu, Tab } from 'semantic-ui-react';
5
+ import cx from 'classnames';
6
+ import { Menu, Tab, Container } from 'semantic-ui-react';
7
+ import config from '@plone/volto/registry';
6
8
  import { RenderBlocks } from '@plone/volto/components';
9
+ import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants';
7
10
  import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
8
- import { SimpleMarkdown } from '@eeacms/volto-tabs-block/utils';
9
-
10
- import cx from 'classnames';
11
+ import {
12
+ SimpleMarkdown,
13
+ getMenuPosition,
14
+ } from '@eeacms/volto-tabs-block/utils';
11
15
 
12
16
  import '@eeacms/volto-tabs-block/less/menu.less';
13
17
 
14
18
  const MenuItem = (props) => {
15
- const { activeTab = null, tabs = {}, setActiveTab = () => {} } = props;
19
+ const {
20
+ activeTab = null,
21
+ tabs = {},
22
+ setActiveTab = () => {},
23
+ tabsTitle,
24
+ tabsDescription,
25
+ } = props;
16
26
  const { tab, index } = props;
17
27
  const title = tabs[tab].title;
18
28
  const tabIndex = index + 1;
@@ -20,18 +30,26 @@ const MenuItem = (props) => {
20
30
  const defaultTitle = `Tab ${tabIndex}`;
21
31
 
22
32
  return (
23
- <Menu.Item
24
- name={defaultTitle}
25
- active={tab === activeTab}
26
- onClick={() => {
27
- if (activeTab !== tab) {
28
- setActiveTab(tab);
29
- }
30
- }}
31
- >
32
- <span className={'menu-item-count'}>{tabIndex}</span>
33
- <p className={'menu-item-text'}>{title || defaultTitle}</p>
34
- </Menu.Item>
33
+ <React.Fragment>
34
+ {index === 0 && (tabsTitle || tabsDescription) && (
35
+ <Menu.Item className="menu-title">
36
+ <SimpleMarkdown md={tabsTitle} defaultTag="##" className="title" />
37
+ <SimpleMarkdown md={tabsDescription} className="description" />
38
+ </Menu.Item>
39
+ )}
40
+ <Menu.Item
41
+ name={defaultTitle}
42
+ active={tab === activeTab}
43
+ onClick={() => {
44
+ if (activeTab !== tab) {
45
+ setActiveTab(tab);
46
+ }
47
+ }}
48
+ >
49
+ <span className={'menu-item-count'}>{tabIndex}</span>
50
+ <p className={'menu-item-text'}>{title || defaultTitle}</p>
51
+ </Menu.Item>
52
+ </React.Fragment>
35
53
  );
36
54
  };
37
55
 
@@ -46,12 +64,30 @@ const View = (props) => {
46
64
  hashlink = {},
47
65
  setActiveTab = () => {},
48
66
  } = props;
49
- const uiContainer = data.align === 'full' ? 'ui container' : '';
50
- const menuAlign = data.menuAlign || 'left';
51
- const menuPosition = data.menuPosition || 'inline';
67
+ const menuPosition = getMenuPosition(data);
68
+ const isContainer = data.align === 'full';
52
69
  const tabsTitle = data.title;
53
70
  const tabsDescription = data.description;
54
71
 
72
+ const schema = React.useMemo(
73
+ () =>
74
+ config.blocks.blocksConfig[TABS_BLOCK].templates?.['default']?.schema(
75
+ config,
76
+ props,
77
+ ) || {},
78
+ [props],
79
+ );
80
+
81
+ const getDataValue = React.useCallback(
82
+ (key) => {
83
+ return (
84
+ (schema.properties[key]?.value || data[key]) ??
85
+ schema.properties[key]?.defaultValue
86
+ );
87
+ },
88
+ [schema, data],
89
+ );
90
+
55
91
  React.useEffect(() => {
56
92
  const urlHash = props.location.hash.substring(1) || '';
57
93
  if (
@@ -82,29 +118,18 @@ const View = (props) => {
82
118
  const panes = tabsList.map((tab, index) => {
83
119
  return {
84
120
  id: tab,
85
- menuItem: () => {
86
- return (
87
- <React.Fragment key={`tab-${tab}`}>
88
- {index === 0 && (tabsTitle || tabsDescription) ? (
89
- <Menu.Item className="menu-title">
90
- <SimpleMarkdown
91
- md={tabsTitle}
92
- defaultTag="##"
93
- className="title"
94
- />
95
- <SimpleMarkdown md={tabsDescription} className="description" />
96
- </Menu.Item>
97
- ) : (
98
- ''
99
- )}
100
- <MenuItem {...props} tab={tab} index={index} />
101
- </React.Fragment>
102
- );
103
- },
121
+ menuItem: (
122
+ <MenuItem
123
+ {...props}
124
+ tab={tab}
125
+ index={index}
126
+ tabsTitle={tabsTitle}
127
+ tabsDescription={tabsDescription}
128
+ />
129
+ ),
104
130
  render: () => {
105
131
  return (
106
- <Tab.Pane className={uiContainer}>
107
- {' '}
132
+ <Tab.Pane as={isContainer ? Container : undefined}>
108
133
  <RenderBlocks {...props} metadata={metadata} content={tabs[tab]} />
109
134
  </Tab.Pane>
110
135
  );
@@ -116,11 +141,26 @@ const View = (props) => {
116
141
  <>
117
142
  <Tab
118
143
  activeIndex={activeTabIndex}
119
- className={cx('default tabs', menuPosition)}
144
+ className="default tabs"
120
145
  menu={{
121
- className: cx(menuAlign),
146
+ attached: menuPosition.attached,
147
+ borderless: getDataValue('menuBorderless'),
148
+ color: getDataValue('menuColor'),
149
+ compact: getDataValue('menuCompact'),
150
+ fluid: getDataValue('menuFluid'),
151
+ inverted: getDataValue('menuInverted'),
152
+ pointing: getDataValue('menuPointing'),
153
+ secondary: getDataValue('menuSecondary'),
154
+ size: getDataValue('menuSize'),
155
+ stackable: getDataValue('menuStackable'),
156
+ tabular: getDataValue('menuTabular'),
157
+ text: getDataValue('menuText'),
158
+ vertical: menuPosition.vertical,
159
+ className: cx(data.menuAlign, { container: isContainer }),
122
160
  }}
161
+ menuPosition={menuPosition.direction}
123
162
  panes={panes}
163
+ grid={{ paneWidth: 9, tabWidth: 3 }}
124
164
  />
125
165
  </>
126
166
  );
@@ -9,10 +9,36 @@ export default () => ({
9
9
  {
10
10
  id: 'menu',
11
11
  title: 'Menu',
12
- fields: ['menuAlign', 'menuPosition'],
12
+ fields: [
13
+ 'menuAlign',
14
+ 'menuPosition',
15
+ 'menuSize',
16
+ 'menuColor',
17
+ 'menuBorderless',
18
+ 'menuCompact',
19
+ 'menuFluid',
20
+ 'menuInverted',
21
+ 'menuPointing',
22
+ 'menuSecondary',
23
+ 'menuStackable',
24
+ 'menuTabular',
25
+ 'menuText',
26
+ ],
13
27
  },
14
28
  ],
15
29
  properties: {
30
+ description: {
31
+ title: 'Description',
32
+ },
33
+ menuPosition: {
34
+ title: 'Position',
35
+ choices: [
36
+ ['top', 'Top'],
37
+ ['bottom', 'Bottom'],
38
+ ['left side', 'Left side'],
39
+ ['right side', 'Right side'],
40
+ ],
41
+ },
16
42
  menuAlign: {
17
43
  title: 'Alignment',
18
44
  type: 'array',
@@ -22,20 +48,75 @@ export default () => ({
22
48
  ['right', 'Right'],
23
49
  ['space-between', 'Space between'],
24
50
  ],
25
- default: 'left',
26
51
  },
27
- menuPosition: {
28
- title: 'Position',
29
- type: 'array',
52
+ menuSize: {
53
+ title: 'Size',
30
54
  choices: [
31
- ['inline', 'Inline'],
32
- ['left side', 'Left side'],
33
- ['right side', 'Right side'],
55
+ ['mini', 'Mini'],
56
+ ['tiny', 'Tiny'],
57
+ ['small', 'Small'],
58
+ ['large', 'Large'],
59
+ ['huge', 'Huge'],
60
+ ['massive', 'Masive'],
34
61
  ],
35
- default: 'inline',
36
62
  },
37
- description: {
38
- title: 'Description',
63
+ menuColor: {
64
+ title: 'Color',
65
+ defaultValue: 'green',
66
+ choices: [
67
+ ['red', 'Red'],
68
+ ['orange', 'Orange'],
69
+ ['yellow', 'Yellow'],
70
+ ['olive', 'Olive'],
71
+ ['green', 'Green'],
72
+ ['teal', 'Teal'],
73
+ ['blue', 'Blue'],
74
+ ['violet', 'Violet'],
75
+ ['purple', 'Purple'],
76
+ ['pink', 'Pink'],
77
+ ['brown', 'Brown'],
78
+ ['grey', 'Grey'],
79
+ ['black', 'Black'],
80
+ ],
81
+ },
82
+ menuBorderless: {
83
+ title: 'Borderless',
84
+ type: 'boolean',
85
+ },
86
+ menuCompact: {
87
+ title: 'Compact',
88
+ type: 'boolean',
89
+ defaultValue: true,
90
+ },
91
+ menuFluid: {
92
+ title: 'Fluid',
93
+ type: 'boolean',
94
+ defaultValue: true,
95
+ },
96
+ menuInverted: {
97
+ title: 'Inverted',
98
+ type: 'boolean',
99
+ },
100
+ menuPointing: {
101
+ title: 'Pointing',
102
+ type: 'boolean',
103
+ },
104
+ menuSecondary: {
105
+ title: 'Secondary',
106
+ type: 'boolean',
107
+ },
108
+ menuStackable: {
109
+ title: 'Stackable',
110
+ type: 'boolean',
111
+ },
112
+ menuTabular: {
113
+ title: 'Tabular',
114
+ type: 'boolean',
115
+ },
116
+ menuText: {
117
+ title: 'Text',
118
+ type: 'boolean',
119
+ defaultValue: true,
39
120
  },
40
121
  },
41
122
  required: [],