@elliemae/ds-form-layout-blocks 2.2.0-alpha.2 → 2.2.0-next.1
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/form-layout-block-item/DSFormLayoutBlockItem.js +46 -68
- package/cjs/form-layout-block-item/index.d.js +2 -27
- package/cjs/form-layout-block-item/index.js +10 -28
- package/cjs/form-layout-block-item/propTypes.js +21 -48
- package/cjs/form-layout-block-item/styles.js +91 -124
- package/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +28 -50
- package/cjs/form-layout-checkbox-group/config/useValidateProps.js +25 -55
- package/cjs/form-layout-checkbox-group/defaultProps.js +7 -35
- package/cjs/form-layout-checkbox-group/index.d.js +2 -27
- package/cjs/form-layout-checkbox-group/index.js +10 -28
- package/cjs/form-layout-checkbox-group/propTypes.js +9 -36
- package/cjs/form-layout-checkbox-group/styles.js +45 -49
- package/cjs/index.d.js +2 -29
- package/cjs/index.js +13 -29
- package/esm/form-layout-block-item/DSFormLayoutBlockItem.js +34 -36
- package/esm/form-layout-block-item/index.d.js +1 -2
- package/esm/form-layout-block-item/index.js +1 -3
- package/esm/form-layout-block-item/propTypes.js +16 -18
- package/esm/form-layout-block-item/styles.js +80 -96
- package/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js +15 -17
- package/esm/form-layout-checkbox-group/config/useValidateProps.js +17 -26
- package/esm/form-layout-checkbox-group/defaultProps.js +3 -6
- package/esm/form-layout-checkbox-group/index.d.js +1 -2
- package/esm/form-layout-checkbox-group/index.js +1 -3
- package/esm/form-layout-checkbox-group/propTypes.js +5 -7
- package/esm/form-layout-checkbox-group/styles.js +38 -21
- package/esm/index.d.js +1 -4
- package/esm/index.js +2 -4
- package/package.json +2 -2
- package/cjs/form-layout-block-item/DSFormLayoutBlockItem.js.map +0 -7
- package/cjs/form-layout-block-item/index.d.js.map +0 -7
- package/cjs/form-layout-block-item/index.js.map +0 -7
- package/cjs/form-layout-block-item/propTypes.js.map +0 -7
- package/cjs/form-layout-block-item/styles.js.map +0 -7
- package/cjs/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +0 -7
- package/cjs/form-layout-checkbox-group/config/useValidateProps.js.map +0 -7
- package/cjs/form-layout-checkbox-group/defaultProps.js.map +0 -7
- package/cjs/form-layout-checkbox-group/index.d.js.map +0 -7
- package/cjs/form-layout-checkbox-group/index.js.map +0 -7
- package/cjs/form-layout-checkbox-group/propTypes.js.map +0 -7
- package/cjs/form-layout-checkbox-group/styles.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/esm/form-layout-block-item/DSFormLayoutBlockItem.js.map +0 -7
- package/esm/form-layout-block-item/index.d.js.map +0 -7
- package/esm/form-layout-block-item/index.js.map +0 -7
- package/esm/form-layout-block-item/propTypes.js.map +0 -7
- package/esm/form-layout-block-item/styles.js.map +0 -7
- package/esm/form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js.map +0 -7
- package/esm/form-layout-checkbox-group/config/useValidateProps.js.map +0 -7
- package/esm/form-layout-checkbox-group/defaultProps.js.map +0 -7
- package/esm/form-layout-checkbox-group/index.d.js.map +0 -7
- package/esm/form-layout-checkbox-group/index.js.map +0 -7
- package/esm/form-layout-checkbox-group/propTypes.js.map +0 -7
- package/esm/form-layout-checkbox-group/styles.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
|
@@ -1,66 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (
|
|
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 useValidateProps_exports = {};
|
|
29
|
-
__export(useValidateProps_exports, {
|
|
30
|
-
useValidateProps: () => useValidateProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
const getVariableType = (arg) => {
|
|
35
|
-
if (Array.isArray(arg))
|
|
36
|
-
return "array";
|
|
37
|
-
if (arg === null)
|
|
38
|
-
return "null";
|
|
39
|
-
if (arg === void 0)
|
|
40
|
-
return "undefined";
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
11
|
+
const getVariableType = arg => {
|
|
12
|
+
if (Array.isArray(arg)) return 'array';
|
|
13
|
+
if (arg === null) return 'null';
|
|
14
|
+
if (arg === undefined) return 'undefined';
|
|
41
15
|
return typeof arg;
|
|
42
16
|
};
|
|
43
|
-
const throwCheckboxGroupDirectionError = (invalidProp) => {
|
|
44
|
-
throw new Error(`You are trying to pass a not valid "direction" property value for a checkbox group, please provide a valid type.
|
|
45
17
|
|
|
46
|
-
|
|
47
|
-
Expected: "horizontal" or "vertical" (string)
|
|
48
|
-
`);
|
|
18
|
+
const throwCheckboxGroupDirectionError = invalidProp => {
|
|
19
|
+
throw new Error("You are trying to pass a not valid \"direction\" property value for a checkbox group, please provide a valid type.\n\n Received: ".concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: \"horizontal\" or \"vertical\" (string)\n "));
|
|
49
20
|
};
|
|
21
|
+
|
|
50
22
|
const throwCheckboxGroupChildrenError = () => {
|
|
51
|
-
throw new Error(
|
|
52
|
-
|
|
53
|
-
Received: (null)
|
|
54
|
-
Expected: React children
|
|
55
|
-
`);
|
|
23
|
+
throw new Error("You are trying to use a checkbox group without any React children, please provide at least one children to use.\n \n Received: (null)\n Expected: React children\n ");
|
|
56
24
|
};
|
|
57
|
-
|
|
58
|
-
|
|
25
|
+
|
|
26
|
+
const useValidateProps = props => {
|
|
27
|
+
if (props.direction !== undefined && props.direction !== 'vertical' && props.direction !== 'horizontal') {
|
|
59
28
|
throwCheckboxGroupDirectionError(props.direction);
|
|
60
29
|
}
|
|
61
|
-
|
|
30
|
+
|
|
31
|
+
if (!React__default["default"].Children.count(props.children)) {
|
|
62
32
|
throwCheckboxGroupChildrenError();
|
|
63
33
|
}
|
|
64
34
|
};
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
|
|
36
|
+
exports.useValidateProps = useValidateProps;
|
|
@@ -1,37 +1,9 @@
|
|
|
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 defaultProps_exports = {};
|
|
29
|
-
__export(defaultProps_exports, {
|
|
30
|
-
defaultProps: () => defaultProps
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
33
5
|
const defaultProps = {
|
|
34
|
-
direction:
|
|
6
|
+
direction: 'horizontal'
|
|
35
7
|
};
|
|
36
|
-
|
|
37
|
-
|
|
8
|
+
|
|
9
|
+
exports.defaultProps = defaultProps;
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var form_layout_checkbox_group_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(form_layout_checkbox_group_exports, __toESM(require("./DSFormLayoutCheckboxGroup")));
|
|
27
|
-
module.exports = __toCommonJS(form_layout_checkbox_group_exports);
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSFormLayoutCheckboxGroup = require('./DSFormLayoutCheckboxGroup.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.DSFormLayoutCheckboxGroup = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroup;
|
|
10
|
+
exports.DSFormLayoutCheckboxGroupWithSchema = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroupWithSchema;
|
|
@@ -1,38 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
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 propTypes_exports = {};
|
|
29
|
-
__export(propTypes_exports, {
|
|
30
|
-
propTypes: () => propTypes
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
|
|
34
7
|
const propTypes = {
|
|
35
|
-
direction:
|
|
8
|
+
direction: reactDesc.PropTypes.oneOf(['horizontal', 'vertical']).description('Set direction for the checkbox group.')
|
|
36
9
|
};
|
|
37
|
-
|
|
38
|
-
|
|
10
|
+
|
|
11
|
+
exports.propTypes = propTypes;
|
|
@@ -1,50 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
|
+
|
|
11
|
+
const StyledContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
12
|
+
componentId: "sc-1wopk9q-0"
|
|
13
|
+
})(["display:inline-flex;flex-wrap:wrap;flex-direction:", ";margin-left:", ";margin-right:", ";margin-top:", ";& div{padding:0;margin-bottom:", ";}& div:not(:last-child){margin-right:", ";}"], _ref => {
|
|
14
|
+
let {
|
|
15
|
+
direction
|
|
16
|
+
} = _ref;
|
|
17
|
+
return direction === 'horizontal' ? 'row' : 'column';
|
|
18
|
+
}, _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
theme
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return theme.space.xs;
|
|
23
|
+
}, _ref3 => {
|
|
24
|
+
let {
|
|
25
|
+
theme
|
|
26
|
+
} = _ref3;
|
|
27
|
+
return theme.space.xs;
|
|
28
|
+
}, _ref4 => {
|
|
29
|
+
let {
|
|
30
|
+
theme
|
|
31
|
+
} = _ref4;
|
|
32
|
+
return theme.space.xxs;
|
|
33
|
+
}, _ref5 => {
|
|
34
|
+
let {
|
|
35
|
+
theme
|
|
36
|
+
} = _ref5;
|
|
37
|
+
return theme.space.xxs;
|
|
38
|
+
}, _ref6 => {
|
|
39
|
+
let {
|
|
40
|
+
theme,
|
|
41
|
+
direction
|
|
42
|
+
} = _ref6;
|
|
43
|
+
return direction === 'horizontal' ? theme.space.s : '0';
|
|
31
44
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const StyledContainer = import_styled_components.default.div`
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
flex-wrap: wrap;
|
|
37
|
-
flex-direction: ${({ direction }) => direction === "horizontal" ? "row" : "column"};
|
|
38
|
-
margin-left: ${({ theme }) => theme.space.xs};
|
|
39
|
-
margin-right: ${({ theme }) => theme.space.xs};
|
|
40
|
-
margin-top: ${({ theme }) => theme.space.xxs};
|
|
41
|
-
& div {
|
|
42
|
-
padding: 0;
|
|
43
|
-
margin-bottom: ${({ theme }) => theme.space.xxs};
|
|
44
|
-
}
|
|
45
|
-
& div:not(:last-child) {
|
|
46
|
-
margin-right: ${({ theme, direction }) => direction === "horizontal" ? theme.space.s : "0"};
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
module.exports = __toCommonJS(styles_exports);
|
|
50
|
-
//# sourceMappingURL=styles.js.map
|
|
45
|
+
|
|
46
|
+
exports.StyledContainer = StyledContainer;
|
package/cjs/index.d.js
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(index_d_exports, __toESM(require("./form-layout-block-item/index.d")));
|
|
27
|
-
__reExport(index_d_exports, __toESM(require("./form-layout-checkbox-group/index.d")));
|
|
28
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
29
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/index.js
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var src_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(src_exports, __toESM(require("./form-layout-block-item")));
|
|
27
|
-
__reExport(src_exports, __toESM(require("./form-layout-checkbox-group")));
|
|
28
|
-
module.exports = __toCommonJS(src_exports);
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DSFormLayoutBlockItem = require('./form-layout-block-item/DSFormLayoutBlockItem.js');
|
|
6
|
+
var DSFormLayoutCheckboxGroup = require('./form-layout-checkbox-group/DSFormLayoutCheckboxGroup.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DSFormLayoutBlockItem = DSFormLayoutBlockItem.DSFormLayoutBlockItem;
|
|
11
|
+
exports.DSFormLayoutBlockItemWithSchema = DSFormLayoutBlockItem.DSFormLayoutBlockItemWithSchema;
|
|
12
|
+
exports.DSFormLayoutCheckboxGroup = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroup;
|
|
13
|
+
exports.DSFormLayoutCheckboxGroupWithSchema = DSFormLayoutCheckboxGroup.DSFormLayoutCheckboxGroupWithSchema;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { describe } from
|
|
4
|
-
import { uid } from
|
|
5
|
-
import { propTypes } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { describe } from 'react-desc';
|
|
4
|
+
import { uid } from 'uid';
|
|
5
|
+
import { propTypes } from './propTypes.js';
|
|
6
|
+
import { StyledContainer, StyledLabel, StyledMark, ScreenReaderOnly, StyledMessage } from './styles.js';
|
|
7
|
+
|
|
8
|
+
const DSFormLayoutBlockItem = props => {
|
|
8
9
|
const {
|
|
9
10
|
label,
|
|
10
11
|
feedbackMessage,
|
|
@@ -21,40 +22,37 @@ const DSFormLayoutBlockItem = (props) => {
|
|
|
21
22
|
isGroup = false
|
|
22
23
|
} = props;
|
|
23
24
|
const instanceUID = useMemo(() => uid(6), []);
|
|
24
|
-
return
|
|
25
|
-
leftLabel,
|
|
26
|
-
fitContent,
|
|
27
|
-
hideLabel,
|
|
28
|
-
withHighlight,
|
|
29
|
-
as: isGroup ?
|
|
30
|
-
isGroup,
|
|
31
|
-
"aria-describedby":
|
|
32
|
-
},
|
|
25
|
+
return /*#__PURE__*/_jsx(StyledContainer, {
|
|
26
|
+
leftLabel: leftLabel,
|
|
27
|
+
fitContent: fitContent,
|
|
28
|
+
hideLabel: hideLabel,
|
|
29
|
+
withHighlight: withHighlight,
|
|
30
|
+
as: isGroup ? 'fieldset' : 'div',
|
|
31
|
+
isGroup: isGroup,
|
|
32
|
+
"aria-describedby": "".concat(inputID || instanceUID, "_feedback_message")
|
|
33
|
+
}, void 0, /*#__PURE__*/_jsx(StyledLabel, {
|
|
33
34
|
htmlFor: inputID,
|
|
34
|
-
leftLabel,
|
|
35
|
-
hideLabel,
|
|
35
|
+
leftLabel: leftLabel,
|
|
36
|
+
hideLabel: hideLabel,
|
|
36
37
|
"aria-hidden": isGroup
|
|
37
|
-
}, label, (required || optional) &&
|
|
38
|
-
required
|
|
39
|
-
})), isGroup &&
|
|
38
|
+
}, void 0, label, (required || optional) && /*#__PURE__*/_jsx(StyledMark, {
|
|
39
|
+
required: required
|
|
40
|
+
})), isGroup && /*#__PURE__*/_jsx(ScreenReaderOnly, {
|
|
40
41
|
as: "legend"
|
|
41
|
-
}, label), children, feedbackMessage && !hasError &&
|
|
42
|
-
leftLabel,
|
|
43
|
-
hideLabel,
|
|
42
|
+
}, void 0, label), children, feedbackMessage && !hasError && /*#__PURE__*/_jsx(StyledMessage, {
|
|
43
|
+
leftLabel: leftLabel,
|
|
44
|
+
hideLabel: hideLabel,
|
|
44
45
|
"aria-hidden": isGroup,
|
|
45
|
-
id:
|
|
46
|
-
}, feedbackMessage), validationMessage && hasError &&
|
|
47
|
-
hasError,
|
|
48
|
-
leftLabel,
|
|
49
|
-
hideLabel,
|
|
46
|
+
id: "".concat(inputID || instanceUID, "_feedback_message")
|
|
47
|
+
}, void 0, feedbackMessage), validationMessage && hasError && /*#__PURE__*/_jsx(StyledMessage, {
|
|
48
|
+
hasError: hasError,
|
|
49
|
+
leftLabel: leftLabel,
|
|
50
|
+
hideLabel: hideLabel,
|
|
50
51
|
role: "alert"
|
|
51
|
-
}, validationMessage));
|
|
52
|
+
}, void 0, validationMessage));
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
+
|
|
54
55
|
const DSFormLayoutBlockItemWithSchema = describe(DSFormLayoutBlockItem);
|
|
55
56
|
DSFormLayoutBlockItemWithSchema.propTypes = propTypes;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
DSFormLayoutBlockItemWithSchema
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=DSFormLayoutBlockItem.js.map
|
|
57
|
+
|
|
58
|
+
export { DSFormLayoutBlockItem, DSFormLayoutBlockItemWithSchema };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
|
|
3
3
|
const propTypes = {
|
|
4
|
-
children: PropTypes.node.isRequired.description(
|
|
5
|
-
label: PropTypes.string.isRequired.description(
|
|
4
|
+
children: PropTypes.node.isRequired.description('Input component. '),
|
|
5
|
+
label: PropTypes.string.isRequired.description('Label property for the input component. This property is required for accesibility purposes.'),
|
|
6
6
|
inputID: PropTypes.string.isRequired.description("String that matches the input component's id. This property is required for accesibility purposes."),
|
|
7
|
-
feedbackMessage: PropTypes.string.description(
|
|
8
|
-
validationMessage: PropTypes.string.description(
|
|
9
|
-
hasError: PropTypes.bool.description(
|
|
10
|
-
required: PropTypes.bool.description(
|
|
11
|
-
optional: PropTypes.bool.description(
|
|
12
|
-
fitContent: PropTypes.bool.description(
|
|
13
|
-
leftLabel: PropTypes.bool.description(
|
|
14
|
-
hideLabel: PropTypes.bool.description(
|
|
15
|
-
withHighlight: PropTypes.bool.description(
|
|
16
|
-
isGroup: PropTypes.bool.description(
|
|
7
|
+
feedbackMessage: PropTypes.string.description('Feedback message to show below the input component.'),
|
|
8
|
+
validationMessage: PropTypes.string.description('Validation message to show below the input component. It requires hasError property set to true to be visible.'),
|
|
9
|
+
hasError: PropTypes.bool.description('Helper boolean property for the validation message.'),
|
|
10
|
+
required: PropTypes.bool.description('Adds required extra styling.'),
|
|
11
|
+
optional: PropTypes.bool.description('Adds optional extra styling.'),
|
|
12
|
+
fitContent: PropTypes.bool.description('Set the width of the layout to the input component.'),
|
|
13
|
+
leftLabel: PropTypes.bool.description('Adds the label at the left of the input component.'),
|
|
14
|
+
hideLabel: PropTypes.bool.description('Hides the input label. It still requires label and labelFor property for accesibility purposes'),
|
|
15
|
+
withHighlight: PropTypes.bool.description('Adds highlight extra styling. It requires extra spacing, please check withHighlight explanation tab.'),
|
|
16
|
+
isGroup: PropTypes.bool.description('Sets the HTML elements as fieldset and legend. This should be used when you want to group more than one input.')
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=propTypes.js.map
|
|
18
|
+
|
|
19
|
+
export { propTypes };
|