@elliemae/ds-group-box 2.2.0-alpha.4 → 3.0.0-next.2
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/cjs/ActionItem.js +23 -54
- package/cjs/Actions.js +36 -63
- package/cjs/DSGroupBox.js +133 -99
- package/cjs/GroupBoxLabel.js +36 -79
- package/cjs/LabelElement.js +23 -51
- package/cjs/components/GroupHeader.js +44 -60
- package/cjs/components/blocks.js +54 -56
- package/cjs/constants.js +9 -37
- package/cjs/index.js +14 -37
- package/esm/ActionItem.js +16 -25
- package/esm/Actions.js +26 -34
- package/esm/DSGroupBox.js +115 -64
- package/esm/GroupBoxLabel.js +29 -50
- package/esm/LabelElement.js +16 -22
- package/esm/components/GroupHeader.js +35 -31
- package/esm/components/blocks.js +50 -29
- package/esm/constants.js +4 -8
- package/esm/index.js +2 -8
- package/package.json +5 -8
- package/cjs/ActionItem.js.map +0 -7
- package/cjs/Actions.js.map +0 -7
- package/cjs/DSGroupBox.js.map +0 -7
- package/cjs/GroupBoxLabel.js.map +0 -7
- package/cjs/LabelElement.js.map +0 -7
- package/cjs/components/GroupHeader.js.map +0 -7
- package/cjs/components/blocks.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/esm/ActionItem.js.map +0 -7
- package/esm/Actions.js.map +0 -7
- package/esm/DSGroupBox.js.map +0 -7
- package/esm/GroupBoxLabel.js.map +0 -7
- package/esm/LabelElement.js.map +0 -7
- package/esm/components/GroupHeader.js.map +0 -7
- package/esm/components/blocks.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/index.js.map +0 -7
|
@@ -1,69 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var GroupHeader_exports = {};
|
|
29
|
-
__export(GroupHeader_exports, {
|
|
30
|
-
DSGroupBoxHeader: () => DSGroupBoxHeader
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
|
|
35
|
-
var import_constants = require("../constants");
|
|
36
|
-
var import_Actions = __toESM(require("../Actions"));
|
|
37
|
-
var import_LabelElement = __toESM(require("../LabelElement"));
|
|
38
|
-
var import_GroupBoxLabel = __toESM(require("../GroupBoxLabel"));
|
|
39
|
-
const DSGroupBoxHeader = ({
|
|
40
|
-
labelProps = {
|
|
41
|
-
labelText: "",
|
|
42
|
-
borderBottom: false,
|
|
43
|
-
id: "ds-group-box__header"
|
|
44
|
-
},
|
|
45
|
-
rightActions = [],
|
|
46
|
-
centerActions = [],
|
|
47
|
-
type = import_constants.BOX_TYPES.CATEGORY,
|
|
48
|
-
noBorder,
|
|
49
|
-
isMain
|
|
50
|
-
}) => {
|
|
51
|
-
const { labelText, borderBottom, id } = labelProps;
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement(import_GroupBoxLabel.default, {
|
|
53
|
-
borderBottom,
|
|
54
|
-
isMain,
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('react');
|
|
7
|
+
var DSTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
8
|
+
var constants = require('../constants.js');
|
|
9
|
+
var Actions = require('../Actions.js');
|
|
10
|
+
var LabelElement = require('../LabelElement.js');
|
|
11
|
+
var GroupBoxLabel = require('../GroupBoxLabel.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
+
var DSTruncatedTooltipText__default = /*#__PURE__*/_interopDefaultLegacy(DSTruncatedTooltipText);
|
|
17
|
+
|
|
18
|
+
const DSGroupBoxHeader = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
labelProps = {
|
|
21
|
+
labelText: '',
|
|
22
|
+
borderBottom: false,
|
|
23
|
+
id: 'ds-group-box__header'
|
|
24
|
+
},
|
|
25
|
+
rightActions = [],
|
|
26
|
+
centerActions = [],
|
|
27
|
+
type = constants.BOX_TYPES.CATEGORY,
|
|
55
28
|
noBorder,
|
|
56
|
-
|
|
29
|
+
isMain
|
|
30
|
+
} = _ref;
|
|
31
|
+
const {
|
|
32
|
+
labelText,
|
|
33
|
+
borderBottom,
|
|
57
34
|
id
|
|
58
|
-
}
|
|
35
|
+
} = labelProps;
|
|
36
|
+
return /*#__PURE__*/_jsx__default["default"](GroupBoxLabel, {
|
|
37
|
+
borderBottom: borderBottom,
|
|
38
|
+
isMain: isMain,
|
|
39
|
+
noBorder: noBorder,
|
|
40
|
+
type: type,
|
|
41
|
+
id: id
|
|
42
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](LabelElement, {}, void 0, /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText__default["default"], {
|
|
59
43
|
value: labelText
|
|
60
|
-
})),
|
|
44
|
+
})), /*#__PURE__*/_jsx__default["default"](Actions.Actions, {
|
|
61
45
|
actions: centerActions,
|
|
62
46
|
centerActions: centerActions.length > 0
|
|
63
|
-
}),
|
|
47
|
+
}), /*#__PURE__*/_jsx__default["default"](Actions.Actions, {
|
|
64
48
|
actions: rightActions,
|
|
65
49
|
rightActions: rightActions.length > 0
|
|
66
50
|
}));
|
|
67
51
|
};
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
|
|
53
|
+
exports.DSGroupBoxHeader = DSGroupBoxHeader;
|
package/cjs/components/blocks.js
CHANGED
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
6
|
+
|
|
7
|
+
const blockName = 'group-box';
|
|
8
|
+
const GroupBoxWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'wrapper', _ref => {
|
|
9
|
+
let {
|
|
10
|
+
onlyHeader,
|
|
11
|
+
noBorder,
|
|
12
|
+
type,
|
|
13
|
+
isMain
|
|
14
|
+
} = _ref;
|
|
15
|
+
return {
|
|
16
|
+
'only-header': onlyHeader,
|
|
17
|
+
'no-border': noBorder,
|
|
18
|
+
[type]: type,
|
|
19
|
+
'main-box': isMain,
|
|
20
|
+
'nested-box': !isMain
|
|
26
21
|
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var blocks_exports = {};
|
|
29
|
-
__export(blocks_exports, {
|
|
30
|
-
GroupBoxContent: () => GroupBoxContent,
|
|
31
|
-
GroupBoxWrapper: () => GroupBoxWrapper,
|
|
32
|
-
Label: () => Label
|
|
33
22
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
})
|
|
52
|
-
const Label =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
23
|
+
const GroupBoxContent = dsClassnames.aggregatedClasses('div')(blockName, 'content', _ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
type,
|
|
26
|
+
asRow,
|
|
27
|
+
onlyHeader,
|
|
28
|
+
noPadding,
|
|
29
|
+
noBorder,
|
|
30
|
+
noBorderTop
|
|
31
|
+
} = _ref2;
|
|
32
|
+
return {
|
|
33
|
+
[type]: type,
|
|
34
|
+
'as-row': asRow,
|
|
35
|
+
'only-header': onlyHeader,
|
|
36
|
+
'no-padding': noPadding,
|
|
37
|
+
'no-border': noBorder,
|
|
38
|
+
'no-border-top': noBorderTop
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
const Label = dsClassnames.aggregatedClasses('div')(blockName, 'label', _ref3 => {
|
|
42
|
+
let {
|
|
43
|
+
borderBottom,
|
|
44
|
+
type,
|
|
45
|
+
noBorder
|
|
46
|
+
} = _ref3;
|
|
47
|
+
return {
|
|
48
|
+
'border-bottom': borderBottom,
|
|
49
|
+
[type]: type,
|
|
50
|
+
'no-border': noBorder
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
exports.GroupBoxContent = GroupBoxContent;
|
|
55
|
+
exports.GroupBoxWrapper = GroupBoxWrapper;
|
|
56
|
+
exports.Label = Label;
|
package/cjs/constants.js
CHANGED
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var constants_exports = {};
|
|
29
|
-
__export(constants_exports, {
|
|
30
|
-
BOX_TYPES: () => BOX_TYPES,
|
|
31
|
-
BOX_TYPES_ARRAY: () => BOX_TYPES_ARRAY
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
34
5
|
const BOX_TYPES = {
|
|
35
|
-
CATEGORY:
|
|
36
|
-
GROUP:
|
|
6
|
+
CATEGORY: 'category-box',
|
|
7
|
+
GROUP: 'group-box'
|
|
37
8
|
};
|
|
38
9
|
const BOX_TYPES_ARRAY = [BOX_TYPES.CATEGORY, BOX_TYPES.GROUP];
|
|
39
|
-
|
|
40
|
-
|
|
10
|
+
|
|
11
|
+
exports.BOX_TYPES = BOX_TYPES;
|
|
12
|
+
exports.BOX_TYPES_ARRAY = BOX_TYPES_ARRAY;
|
package/cjs/index.js
CHANGED
|
@@ -1,37 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
default: () => import_DSGroupBox.default
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
__reExport(src_exports, require("./DSGroupBox"));
|
|
34
|
-
__reExport(src_exports, require("./constants"));
|
|
35
|
-
var import_DSGroupBox = require("./DSGroupBox");
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSGroupBox = require('./DSGroupBox.js');
|
|
6
|
+
var constants = require('./constants.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DSGroupBox = DSGroupBox.DSGroupBox;
|
|
11
|
+
exports.DSGroupBoxWithSchema = DSGroupBox.DSGroupBoxWithSchema;
|
|
12
|
+
exports["default"] = DSGroupBox.DSGroupBox;
|
|
13
|
+
exports.BOX_TYPES = constants.BOX_TYPES;
|
|
14
|
+
exports.BOX_TYPES_ARRAY = constants.BOX_TYPES_ARRAY;
|
package/esm/ActionItem.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import styled from
|
|
4
|
-
import { __UNSAFE_SPACE_TO_DIMSUM } from
|
|
5
|
-
|
|
6
|
-
const ActionItemNode = styled.div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
function ActionItem({ children }) {
|
|
17
|
-
return /* @__PURE__ */ React2.createElement(ActionItemNode, null, children);
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';
|
|
5
|
+
|
|
6
|
+
const ActionItemNode = /*#__PURE__*/styled.div.withConfig({
|
|
7
|
+
componentId: "sc-1ysc0gb-0"
|
|
8
|
+
})(["padding-right:", ";font-weight:300;overflow:hidden;align-items:center;display:flex;&:last-child{padding-right:0;}"], props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs));
|
|
9
|
+
|
|
10
|
+
function ActionItem(_ref) {
|
|
11
|
+
let {
|
|
12
|
+
children
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/_jsx(ActionItemNode, {}, void 0, children);
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
var ActionItem_default = ActionItem;
|
|
23
|
-
export {
|
|
24
|
-
ActionItem_default as default
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=ActionItem.js.map
|
|
16
|
+
|
|
17
|
+
export { ActionItem as default };
|
package/esm/Actions.js
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { space } from '@xstyled/styled-components';
|
|
7
|
+
import { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';
|
|
8
|
+
import ActionItem from './ActionItem.js';
|
|
9
|
+
|
|
10
|
+
const ActionsNode = /*#__PURE__*/styled.div.withConfig({
|
|
11
|
+
componentId: "sc-1umfb8g-0"
|
|
12
|
+
})(["display:flex;flex-direction:row;padding-left:", ";overflow:hidden;", ""], props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.m), space);
|
|
13
|
+
|
|
14
|
+
function Actions(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
actions = [],
|
|
17
|
+
centerActions,
|
|
18
|
+
rightActions
|
|
19
|
+
} = _ref;
|
|
20
|
+
if (actions.length < 1) return null;
|
|
21
|
+
return /*#__PURE__*/_jsx(ActionsNode, {
|
|
22
|
+
marginLeft: !!rightActions && 'auto',
|
|
23
|
+
marginRight: !!centerActions && 'auto'
|
|
24
|
+
}, void 0, actions.map((action, key) => /*#__PURE__*/_jsx(ActionItem, {}, key, action)));
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
centerActions: PropTypes.bool,
|
|
28
|
-
rightActions: PropTypes.bool
|
|
29
|
-
};
|
|
30
|
-
var Actions_default = Actions;
|
|
31
|
-
export {
|
|
32
|
-
Actions,
|
|
33
|
-
Actions_default as default
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=Actions.js.map
|
|
26
|
+
|
|
27
|
+
export { Actions, Actions as default };
|
package/esm/DSGroupBox.js
CHANGED
|
@@ -1,77 +1,128 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { PropTypes, describe } from 'react-desc';
|
|
12
|
+
import { GroupBoxWrapper, GroupBoxContent } from './components/blocks.js';
|
|
13
|
+
import { DSGroupBoxHeader } from './components/GroupHeader.js';
|
|
14
|
+
import { BOX_TYPES_ARRAY, BOX_TYPES } from './constants.js';
|
|
15
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
16
|
+
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
+
|
|
21
|
+
const DSGroupBox = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
containerProps = {},
|
|
24
|
+
labelProps = {
|
|
25
|
+
labelText: '',
|
|
26
|
+
borderBottom: false,
|
|
27
|
+
id: 'ds-group-box__header'
|
|
28
|
+
},
|
|
29
|
+
rightActions = [],
|
|
30
|
+
centerActions = [],
|
|
31
|
+
type = BOX_TYPES.CATEGORY,
|
|
32
|
+
asRow = false,
|
|
33
|
+
onlyHeader = false,
|
|
34
|
+
noBorder = true,
|
|
35
|
+
noPadding = false,
|
|
36
|
+
children: components = [],
|
|
37
|
+
// eslint-disable-next-line react/prop-types
|
|
38
|
+
isMain = true
|
|
39
|
+
} = _ref;
|
|
40
|
+
const {
|
|
41
|
+
labelText
|
|
42
|
+
} = labelProps;
|
|
43
|
+
return /*#__PURE__*/jsxs(GroupBoxWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
36
44
|
classProps: {
|
|
37
|
-
type,
|
|
38
|
-
asRow,
|
|
39
45
|
onlyHeader,
|
|
40
|
-
noPadding,
|
|
41
46
|
noBorder,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
type,
|
|
48
|
+
isMain
|
|
49
|
+
},
|
|
50
|
+
children: [labelText && /*#__PURE__*/_jsx(DSGroupBoxHeader, {
|
|
51
|
+
centerActions: centerActions,
|
|
52
|
+
isMain: isMain,
|
|
53
|
+
labelProps: labelProps,
|
|
54
|
+
noBorder: noBorder,
|
|
55
|
+
rightActions: rightActions,
|
|
56
|
+
type: type
|
|
57
|
+
}), /*#__PURE__*/_jsx(GroupBoxContent, {
|
|
58
|
+
classProps: {
|
|
59
|
+
type,
|
|
60
|
+
asRow,
|
|
61
|
+
onlyHeader,
|
|
62
|
+
noPadding,
|
|
63
|
+
noBorder,
|
|
64
|
+
noBorderTop: !!labelText
|
|
65
|
+
}
|
|
66
|
+
}, void 0, components && components.props ? React.Children.map(components, component => /*#__PURE__*/React.cloneElement(component, _objectSpread(_objectSpread({}, component.props), {}, {
|
|
67
|
+
isMain: false
|
|
68
|
+
})), null) : components)]
|
|
69
|
+
}));
|
|
48
70
|
};
|
|
71
|
+
|
|
49
72
|
const props = {
|
|
50
|
-
|
|
73
|
+
/** props to inject to wrapper */
|
|
74
|
+
containerProps: PropTypes.object.description('props to inject to wrapper'),
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Label attributes to be rendered
|
|
78
|
+
*/
|
|
51
79
|
labelProps: PropTypes.shape({
|
|
52
80
|
labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
53
81
|
borderBottom: PropTypes.bool,
|
|
54
82
|
id: PropTypes.string
|
|
55
|
-
}).description(
|
|
83
|
+
}).description('Label attributes to be rendered'),
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* ['category-box', 'group-box']
|
|
87
|
+
*/
|
|
56
88
|
type: PropTypes.oneOf(BOX_TYPES_ARRAY).description(BOX_TYPES_ARRAY.toString()),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Components to be rendered inside the box
|
|
92
|
+
*/
|
|
93
|
+
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired.description('Components to be rendered inside the box'),
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Actions on the right side of the label
|
|
97
|
+
*/
|
|
98
|
+
rightActions: PropTypes.arrayOf(PropTypes.element).description('Actions on the right side of the label'),
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Actions on the next to the label
|
|
102
|
+
*/
|
|
103
|
+
centerActions: PropTypes.arrayOf(PropTypes.element).description('Actions on the next to the label'),
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Display the content of the group box with flex direction row
|
|
107
|
+
*/
|
|
108
|
+
asRow: PropTypes.bool.description('Display the content of the group box with flex direction row'),
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Show border only on the header
|
|
112
|
+
*/
|
|
113
|
+
onlyHeader: PropTypes.bool.description('Show border only on the header'),
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Remove the wrapper border
|
|
117
|
+
*/
|
|
118
|
+
noBorder: PropTypes.bool.description('Remove the wrapper border'),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Remove the top and bottom padding from the content
|
|
122
|
+
*/
|
|
123
|
+
noPadding: PropTypes.bool.description('Remove the top and bottom padding from the content')
|
|
67
124
|
};
|
|
68
|
-
DSGroupBox.propTypes = props;
|
|
69
125
|
const DSGroupBoxWithSchema = describe(DSGroupBox);
|
|
70
126
|
DSGroupBoxWithSchema.propTypes = props;
|
|
71
|
-
|
|
72
|
-
export {
|
|
73
|
-
DSGroupBox,
|
|
74
|
-
DSGroupBoxWithSchema,
|
|
75
|
-
DSGroupBox_default as default
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=DSGroupBox.js.map
|
|
127
|
+
|
|
128
|
+
export { DSGroupBox, DSGroupBoxWithSchema, DSGroupBox as default };
|