@maif/react-forms 1.0.2 → 1.0.6
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/.github/workflows/release.yml +1 -1
- package/README.md +21 -3
- package/dist/react-form.js +1 -1
- package/dist/react-form.js.LICENSE.txt +8 -0
- package/lib/constraints.d.ts +2 -0
- package/lib/constraints.js +12 -1
- package/lib/form.d.ts +1 -1
- package/lib/form.js +171 -88
- package/lib/inputs/BooleanInput.js +8 -11
- package/lib/inputs/CodeInput.d.ts +3 -1
- package/lib/inputs/CodeInput.js +11 -3
- package/lib/inputs/Collapse.js +1 -1
- package/lib/inputs/SelectInput.js +46 -23
- package/lib/resolvers/utils.js +3 -1
- package/lib/style.d.ts +156 -0
- package/lib/style.js +148 -0
- package/lib/styleContext.d.ts +1 -0
- package/lib/styleContext.js +29 -0
- package/package.json +3 -2
package/lib/inputs/CodeInput.js
CHANGED
|
@@ -15,10 +15,14 @@ require("ace-builds/src-noconflict/mode-json");
|
|
|
15
15
|
|
|
16
16
|
require("ace-builds/src-noconflict/mode-javascript");
|
|
17
17
|
|
|
18
|
+
require("ace-builds/src-noconflict/mode-css");
|
|
19
|
+
|
|
18
20
|
require("ace-builds/src-noconflict/mode-markdown");
|
|
19
21
|
|
|
20
22
|
require("ace-builds/src-noconflict/theme-monokai");
|
|
21
23
|
|
|
24
|
+
require("ace-builds/src-noconflict/theme-tomorrow");
|
|
25
|
+
|
|
22
26
|
require("ace-builds/src-noconflict/ext-searchbox");
|
|
23
27
|
|
|
24
28
|
require("ace-builds/src-noconflict/ext-language_tools");
|
|
@@ -30,7 +34,11 @@ var CodeInput = function CodeInput(_ref) {
|
|
|
30
34
|
value = _ref.value,
|
|
31
35
|
_ref$className = _ref.className,
|
|
32
36
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
33
|
-
readOnly = _ref.readOnly
|
|
37
|
+
readOnly = _ref.readOnly,
|
|
38
|
+
_ref$theme = _ref.theme,
|
|
39
|
+
theme = _ref$theme === void 0 ? 'monokai' : _ref$theme,
|
|
40
|
+
_ref$mode = _ref.mode,
|
|
41
|
+
mode = _ref$mode === void 0 ? 'javascript' : _ref$mode;
|
|
34
42
|
return /*#__PURE__*/_react["default"].createElement(_reactAce["default"], {
|
|
35
43
|
className: className,
|
|
36
44
|
readOnly: readOnly,
|
|
@@ -38,8 +46,8 @@ var CodeInput = function CodeInput(_ref) {
|
|
|
38
46
|
zIndex: 0,
|
|
39
47
|
isolation: 'isolate'
|
|
40
48
|
},
|
|
41
|
-
mode:
|
|
42
|
-
theme:
|
|
49
|
+
mode: mode,
|
|
50
|
+
theme: theme,
|
|
43
51
|
onChange: onChange,
|
|
44
52
|
value: value,
|
|
45
53
|
name: "scriptParam",
|
package/lib/inputs/Collapse.js
CHANGED
|
@@ -49,7 +49,7 @@ var Collapse = function Collapse(props) {
|
|
|
49
49
|
}, /*#__PURE__*/_react["default"].createElement("hr", null), /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
50
|
className: "form-group row"
|
|
51
51
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
-
className: "col-sm-
|
|
52
|
+
className: "col-sm-12",
|
|
53
53
|
onClick: toggle,
|
|
54
54
|
style: {
|
|
55
55
|
cursor: 'pointer'
|
|
@@ -23,6 +23,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
|
|
24
24
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
25
|
|
|
26
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
+
|
|
32
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
33
|
+
|
|
26
34
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
35
|
|
|
28
36
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -36,7 +44,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
36
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
45
|
|
|
38
46
|
var valueToSelectOption = function valueToSelectOption(value) {
|
|
39
|
-
var
|
|
47
|
+
var possibleValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
48
|
+
var isMulti = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
40
49
|
|
|
41
50
|
if (value === null) {
|
|
42
51
|
return null;
|
|
@@ -44,39 +53,51 @@ var valueToSelectOption = function valueToSelectOption(value) {
|
|
|
44
53
|
|
|
45
54
|
if (isMulti) {
|
|
46
55
|
return value.map(function (x) {
|
|
47
|
-
return valueToSelectOption(x);
|
|
56
|
+
return valueToSelectOption(x, possibleValues, false);
|
|
48
57
|
});
|
|
49
58
|
}
|
|
50
59
|
|
|
60
|
+
var maybeValue = (0, _Option.option)(possibleValues.find(function (v) {
|
|
61
|
+
return v.value === value;
|
|
62
|
+
}));
|
|
51
63
|
return {
|
|
52
|
-
label: (
|
|
53
|
-
|
|
64
|
+
label: maybeValue.map(function (v) {
|
|
65
|
+
return v.label;
|
|
66
|
+
}).getOrElse(value),
|
|
67
|
+
value: maybeValue.map(function (v) {
|
|
68
|
+
return v.value;
|
|
69
|
+
}).getOrElse(value)
|
|
54
70
|
};
|
|
55
71
|
};
|
|
56
72
|
|
|
57
73
|
var SelectInput = function SelectInput(props) {
|
|
74
|
+
var possibleValues = (props.possibleValues || []).map(function (v) {
|
|
75
|
+
return props.transformer ? props.transformer(v) : v;
|
|
76
|
+
}).map(function (v) {
|
|
77
|
+
return {
|
|
78
|
+
label: (v === null || v === void 0 ? void 0 : v.label) || v,
|
|
79
|
+
value: (v === null || v === void 0 ? void 0 : v.value) || v
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
|
|
58
83
|
var _useState = (0, _react.useState)(false),
|
|
59
84
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
85
|
loading = _useState2[0],
|
|
61
86
|
setLoading = _useState2[1];
|
|
62
87
|
|
|
63
|
-
var _useState3 = (0, _react.useState)(
|
|
88
|
+
var _useState3 = (0, _react.useState)(possibleValues),
|
|
64
89
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
65
|
-
|
|
66
|
-
|
|
90
|
+
values = _useState4[0],
|
|
91
|
+
setValues = _useState4[1];
|
|
67
92
|
|
|
68
|
-
var _useState5 = (0, _react.useState)((props.
|
|
69
|
-
return props.transformer ? props.transformer(v) : v;
|
|
70
|
-
}).map(function (v) {
|
|
71
|
-
return valueToSelectOption(v);
|
|
72
|
-
})),
|
|
93
|
+
var _useState5 = (0, _react.useState)(valueToSelectOption(props.value || props.defaultValue, possibleValues, props.isMulti)),
|
|
73
94
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
74
|
-
|
|
75
|
-
|
|
95
|
+
value = _useState6[0],
|
|
96
|
+
setValue = _useState6[1];
|
|
76
97
|
|
|
77
98
|
(0, _react.useEffect)(function () {
|
|
78
|
-
setValue(valueToSelectOption(props.value
|
|
79
|
-
}, [props.value,
|
|
99
|
+
setValue(valueToSelectOption(props.value, values, props.isMulti));
|
|
100
|
+
}, [props.value, values]);
|
|
80
101
|
(0, _react.useEffect)(function () {
|
|
81
102
|
if (props.optionsFrom) {
|
|
82
103
|
var cond = (0, _Option.option)(props.fetchCondition).map(function (cond) {
|
|
@@ -114,6 +135,13 @@ var SelectInput = function SelectInput(props) {
|
|
|
114
135
|
}
|
|
115
136
|
};
|
|
116
137
|
|
|
138
|
+
var createOption = function createOption(option) {
|
|
139
|
+
var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
|
140
|
+
fn(option);
|
|
141
|
+
setValues([].concat(_toConsumableArray(values), [valueToSelectOption(option, values)]));
|
|
142
|
+
onChange([].concat(_toConsumableArray(value), [valueToSelectOption(option, [].concat(_toConsumableArray(values), [valueToSelectOption(option, values)]))]));
|
|
143
|
+
};
|
|
144
|
+
|
|
117
145
|
if (props.createOption) {
|
|
118
146
|
return /*#__PURE__*/_react["default"].createElement(_creatable["default"], _extends({}, props, {
|
|
119
147
|
name: "".concat(props.label, "-search"),
|
|
@@ -125,13 +153,8 @@ var SelectInput = function SelectInput(props) {
|
|
|
125
153
|
onChange: onChange,
|
|
126
154
|
options: values,
|
|
127
155
|
onCreateOption: function onCreateOption(option) {
|
|
128
|
-
return props.onCreateOption ? props.onCreateOption
|
|
129
|
-
}
|
|
130
|
-
,
|
|
131
|
-
formatCreateLabel: function formatCreateLabel(value) {
|
|
132
|
-
return props.formatCreateLabel ? props.formatCreateLabel(value) : "create ".concat(value, " ?");
|
|
133
|
-
} //todo: default formatCreateLabel
|
|
134
|
-
,
|
|
156
|
+
return props.onCreateOption ? createOption(option, props.onCreateOption) : createOption(option);
|
|
157
|
+
},
|
|
135
158
|
classNamePrefix: "react-form-select",
|
|
136
159
|
className: props.className
|
|
137
160
|
}));
|
package/lib/resolvers/utils.js
CHANGED
|
@@ -56,7 +56,9 @@ var buildSubResolver = function buildSubResolver(props, key, dependencies, rawDa
|
|
|
56
56
|
} else if (props.schema) {
|
|
57
57
|
var deps = [];
|
|
58
58
|
subResolver = yup.object().shape(getShapeAndDependencies(props.flow || Object.keys(props.schema), props.schema, deps, rawData).shape, deps);
|
|
59
|
-
arrayResolver = arrayResolver.of(
|
|
59
|
+
arrayResolver = arrayResolver.of(yup.object().shape({
|
|
60
|
+
value: subResolver
|
|
61
|
+
}));
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
return constraints.reduce(function (resolver, constraint) {
|
package/lib/style.d.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export namespace style {
|
|
2
|
+
const input: {
|
|
3
|
+
display: string;
|
|
4
|
+
width: string;
|
|
5
|
+
padding: string;
|
|
6
|
+
fontSize: string;
|
|
7
|
+
color: string;
|
|
8
|
+
border: string;
|
|
9
|
+
borderRadius: number;
|
|
10
|
+
"&[readonly]": {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
opacity: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
namespace btn {
|
|
16
|
+
const borderRadius: number;
|
|
17
|
+
const padding: number;
|
|
18
|
+
const fontSize: string;
|
|
19
|
+
const cursor: string;
|
|
20
|
+
const border: number;
|
|
21
|
+
}
|
|
22
|
+
namespace btn_sm {
|
|
23
|
+
const fontSize_1: string;
|
|
24
|
+
export { fontSize_1 as fontSize };
|
|
25
|
+
const padding_1: string;
|
|
26
|
+
export { padding_1 as padding };
|
|
27
|
+
}
|
|
28
|
+
const btn_group: {
|
|
29
|
+
"& > button:not(:last-child)": {
|
|
30
|
+
borderTopRightRadius: number;
|
|
31
|
+
borderBottomRightRadius: number;
|
|
32
|
+
};
|
|
33
|
+
"& > button:not(:first-child)": {
|
|
34
|
+
borderTopLeftRadius: number;
|
|
35
|
+
borderBottomLeftRadius: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const btn_red: {
|
|
39
|
+
color: string;
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
borderColor: string;
|
|
42
|
+
"&:hover": {
|
|
43
|
+
backgroundColor: string;
|
|
44
|
+
borderColor: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const btn_green: {
|
|
48
|
+
color: string;
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
borderColor: string;
|
|
51
|
+
"&:hover": {
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
borderColor: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const btn_blue: {
|
|
57
|
+
color: string;
|
|
58
|
+
backgroundColor: string;
|
|
59
|
+
borderColor: string;
|
|
60
|
+
"&:hover": {
|
|
61
|
+
backgroundColor: string;
|
|
62
|
+
borderColor: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const btn_grey: {
|
|
66
|
+
color: string;
|
|
67
|
+
backgroundColor: string;
|
|
68
|
+
borderColor: string;
|
|
69
|
+
"&:hover": {
|
|
70
|
+
backgroundColor: string;
|
|
71
|
+
borderColor: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
namespace txt_red {
|
|
75
|
+
const color: string;
|
|
76
|
+
}
|
|
77
|
+
namespace ml_5 {
|
|
78
|
+
const marginLeft: number;
|
|
79
|
+
}
|
|
80
|
+
namespace ml_10 {
|
|
81
|
+
const marginLeft_1: number;
|
|
82
|
+
export { marginLeft_1 as marginLeft };
|
|
83
|
+
}
|
|
84
|
+
namespace mt_5 {
|
|
85
|
+
const marginTop: number;
|
|
86
|
+
}
|
|
87
|
+
namespace mt_10 {
|
|
88
|
+
const marginTop_1: number;
|
|
89
|
+
export { marginTop_1 as marginTop };
|
|
90
|
+
}
|
|
91
|
+
namespace mt_20 {
|
|
92
|
+
const marginTop_2: number;
|
|
93
|
+
export { marginTop_2 as marginTop };
|
|
94
|
+
}
|
|
95
|
+
namespace mb_5 {
|
|
96
|
+
const marginBottom: number;
|
|
97
|
+
}
|
|
98
|
+
namespace p_15 {
|
|
99
|
+
const padding_2: number;
|
|
100
|
+
export { padding_2 as padding };
|
|
101
|
+
}
|
|
102
|
+
namespace pr_15 {
|
|
103
|
+
const paddingRight: number;
|
|
104
|
+
}
|
|
105
|
+
namespace d_none {
|
|
106
|
+
const display: string;
|
|
107
|
+
}
|
|
108
|
+
namespace flex {
|
|
109
|
+
const display_1: string;
|
|
110
|
+
export { display_1 as display };
|
|
111
|
+
}
|
|
112
|
+
namespace flexDirection {
|
|
113
|
+
const flexDirection_1: string;
|
|
114
|
+
export { flexDirection_1 as flexDirection };
|
|
115
|
+
}
|
|
116
|
+
namespace jc_end {
|
|
117
|
+
const justifyContent: string;
|
|
118
|
+
}
|
|
119
|
+
namespace ac_center {
|
|
120
|
+
const alignContent: string;
|
|
121
|
+
}
|
|
122
|
+
namespace ai_center {
|
|
123
|
+
const alignItems: string;
|
|
124
|
+
}
|
|
125
|
+
namespace cursor_pointer {
|
|
126
|
+
const cursor_1: string;
|
|
127
|
+
export { cursor_1 as cursor };
|
|
128
|
+
}
|
|
129
|
+
namespace collapse {
|
|
130
|
+
const display_2: string;
|
|
131
|
+
export { display_2 as display };
|
|
132
|
+
const justifyContent_1: string;
|
|
133
|
+
export { justifyContent_1 as justifyContent };
|
|
134
|
+
const cursor_2: string;
|
|
135
|
+
export { cursor_2 as cursor };
|
|
136
|
+
}
|
|
137
|
+
namespace collapse_label {
|
|
138
|
+
export const fontWeight: string;
|
|
139
|
+
const marginTop_3: number;
|
|
140
|
+
export { marginTop_3 as marginTop };
|
|
141
|
+
}
|
|
142
|
+
const datepicker: {
|
|
143
|
+
"& input": {
|
|
144
|
+
borderRadius: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
const code: {};
|
|
148
|
+
namespace input__boolean__on {
|
|
149
|
+
const color_1: string;
|
|
150
|
+
export { color_1 as color };
|
|
151
|
+
}
|
|
152
|
+
namespace input__boolean__off {
|
|
153
|
+
const color_2: string;
|
|
154
|
+
export { color_2 as color };
|
|
155
|
+
}
|
|
156
|
+
}
|
package/lib/style.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.style = void 0;
|
|
7
|
+
var style = {
|
|
8
|
+
input: {
|
|
9
|
+
display: "block",
|
|
10
|
+
width: "100%",
|
|
11
|
+
padding: "8px 12px",
|
|
12
|
+
fontSize: "1rem",
|
|
13
|
+
color: "#495057",
|
|
14
|
+
border: "1px solid #ced4da",
|
|
15
|
+
borderRadius: 4,
|
|
16
|
+
"&[readonly]": {
|
|
17
|
+
backgroundColor: "#e9ecef",
|
|
18
|
+
opacity: 1
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
btn: {
|
|
22
|
+
borderRadius: 5,
|
|
23
|
+
padding: 10,
|
|
24
|
+
fontSize: "1rem",
|
|
25
|
+
cursor: "pointer",
|
|
26
|
+
border: 0
|
|
27
|
+
},
|
|
28
|
+
btn_sm: {
|
|
29
|
+
fontSize: "0.875rem",
|
|
30
|
+
padding: ".25rem .5rem"
|
|
31
|
+
},
|
|
32
|
+
btn_group: {
|
|
33
|
+
"& > button:not(:last-child)": {
|
|
34
|
+
borderTopRightRadius: 0,
|
|
35
|
+
borderBottomRightRadius: 0
|
|
36
|
+
},
|
|
37
|
+
"& > button:not(:first-child)": {
|
|
38
|
+
borderTopLeftRadius: 0,
|
|
39
|
+
borderBottomLeftRadius: 0
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
btn_red: {
|
|
43
|
+
color: "#fff",
|
|
44
|
+
backgroundColor: "#dc3545",
|
|
45
|
+
borderColor: "#dc3545",
|
|
46
|
+
"&:hover": {
|
|
47
|
+
backgroundColor: "#c82333",
|
|
48
|
+
borderColor: "#bd2130"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
btn_green: {
|
|
52
|
+
color: "#fff",
|
|
53
|
+
backgroundColor: "#28a745",
|
|
54
|
+
borderColor: "#28a745",
|
|
55
|
+
"&:hover": {
|
|
56
|
+
backgroundColor: "#218838",
|
|
57
|
+
borderColor: "#1e7e34"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
btn_blue: {
|
|
61
|
+
color: "#fff",
|
|
62
|
+
backgroundColor: "#007bff",
|
|
63
|
+
borderColor: "#007bff",
|
|
64
|
+
"&:hover": {
|
|
65
|
+
backgroundColor: "#0069d9",
|
|
66
|
+
borderColor: "#0062cc"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
btn_grey: {
|
|
70
|
+
color: "#fff",
|
|
71
|
+
backgroundColor: "#6c757d",
|
|
72
|
+
borderColor: "#6c757d",
|
|
73
|
+
"&:hover": {
|
|
74
|
+
backgroundColor: "#5c636a",
|
|
75
|
+
borderColor: "#5c636a"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
txt_red: {
|
|
79
|
+
color: "#dc3545"
|
|
80
|
+
},
|
|
81
|
+
ml_5: {
|
|
82
|
+
marginLeft: 5
|
|
83
|
+
},
|
|
84
|
+
ml_10: {
|
|
85
|
+
marginLeft: 10
|
|
86
|
+
},
|
|
87
|
+
mt_5: {
|
|
88
|
+
marginTop: 5
|
|
89
|
+
},
|
|
90
|
+
mt_10: {
|
|
91
|
+
marginTop: 10
|
|
92
|
+
},
|
|
93
|
+
mt_20: {
|
|
94
|
+
marginTop: 20
|
|
95
|
+
},
|
|
96
|
+
mb_5: {
|
|
97
|
+
marginBottom: 5
|
|
98
|
+
},
|
|
99
|
+
p_15: {
|
|
100
|
+
padding: 15
|
|
101
|
+
},
|
|
102
|
+
pr_15: {
|
|
103
|
+
paddingRight: 15
|
|
104
|
+
},
|
|
105
|
+
d_none: {
|
|
106
|
+
display: "none"
|
|
107
|
+
},
|
|
108
|
+
flex: {
|
|
109
|
+
display: "flex"
|
|
110
|
+
},
|
|
111
|
+
flexDirection: {
|
|
112
|
+
flexDirection: "column"
|
|
113
|
+
},
|
|
114
|
+
jc_end: {
|
|
115
|
+
justifyContent: "end"
|
|
116
|
+
},
|
|
117
|
+
ac_center: {
|
|
118
|
+
alignContent: "center"
|
|
119
|
+
},
|
|
120
|
+
ai_center: {
|
|
121
|
+
alignItems: "center"
|
|
122
|
+
},
|
|
123
|
+
cursor_pointer: {
|
|
124
|
+
cursor: "pointer"
|
|
125
|
+
},
|
|
126
|
+
collapse: {
|
|
127
|
+
display: "flex",
|
|
128
|
+
justifyContent: "space-between",
|
|
129
|
+
cursor: "pointer"
|
|
130
|
+
},
|
|
131
|
+
collapse_label: {
|
|
132
|
+
fontWeight: "bold",
|
|
133
|
+
marginTop: 7
|
|
134
|
+
},
|
|
135
|
+
datepicker: {
|
|
136
|
+
"& input": {
|
|
137
|
+
borderRadius: "4px"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
code: {},
|
|
141
|
+
input__boolean__on: {
|
|
142
|
+
color: "MediumSeaGreen"
|
|
143
|
+
},
|
|
144
|
+
input__boolean__off: {
|
|
145
|
+
color: "tomato"
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
exports.style = style;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function useCustomStyle(overrideStyle?: {}): import("jss").Classes<"code" | "flex" | "flexDirection" | "input" | "btn" | "btn_sm" | "btn_group" | "btn_red" | "btn_green" | "btn_blue" | "btn_grey" | "txt_red" | "ml_5" | "ml_10" | "mt_5" | "mt_10" | "mt_20" | "mb_5" | "p_15" | "pr_15" | "d_none" | "jc_end" | "ac_center" | "ai_center" | "cursor_pointer" | "collapse" | "collapse_label" | "datepicker" | "input__boolean__on" | "input__boolean__off">;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCustomStyle = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactJss = require("react-jss");
|
|
11
|
+
|
|
12
|
+
var _style = require("./style");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
+
|
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
|
|
22
|
+
var useCustomStyle = function useCustomStyle() {
|
|
23
|
+
var overrideStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
|
+
var useStyle = (0, _reactJss.createUseStyles)(_objectSpread(_objectSpread({}, _style.style), overrideStyle));
|
|
25
|
+
var classes = useStyle();
|
|
26
|
+
return classes;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.useCustomStyle = useCustomStyle;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maif/react-forms",
|
|
3
3
|
"description": "Build react safe forms as fast as possible",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "MAIF team",
|
|
7
7
|
"keywords": [
|
|
@@ -113,8 +113,9 @@
|
|
|
113
113
|
"react-ace": "9.4.3",
|
|
114
114
|
"react-feather": "2.0.9",
|
|
115
115
|
"react-hook-form": "7.17.1",
|
|
116
|
+
"react-jss": "10.8.2",
|
|
116
117
|
"react-rainbow-components": "1.26.0",
|
|
117
|
-
"react-select": "
|
|
118
|
+
"react-select": "5.2.1",
|
|
118
119
|
"react-tooltip": "4.2.21",
|
|
119
120
|
"showdown": "1.9.1",
|
|
120
121
|
"typescript": "^4.3.5",
|