@maif/react-forms 1.0.29 → 1.0.32
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/README.md +5 -4
- package/lib/esm/index.js +30260 -0
- package/lib/index.js +30281 -39
- package/package.json +29 -36
- package/rollup.config.js +53 -0
- package/dist/react-form.js +0 -2
- package/dist/react-form.js.LICENSE.txt +0 -103
- package/lib/Option.d.ts +0 -39
- package/lib/Option.js +0 -66
- package/lib/constraints.d.ts +0 -90
- package/lib/constraints.js +0 -371
- package/lib/form.d.ts +0 -2
- package/lib/form.js +0 -1361
- package/lib/format.d.ts +0 -12
- package/lib/format.js +0 -19
- package/lib/index.d.ts +0 -4
- package/lib/inputs/ArrayInput.d.ts +0 -1
- package/lib/inputs/ArrayInput.js +0 -141
- package/lib/inputs/BooleanInput.d.ts +0 -4
- package/lib/inputs/BooleanInput.js +0 -35
- package/lib/inputs/CodeInput.d.ts +0 -9
- package/lib/inputs/CodeInput.js +0 -89
- package/lib/inputs/Collapse.d.ts +0 -1
- package/lib/inputs/Collapse.js +0 -73
- package/lib/inputs/MarkdownInput.d.ts +0 -1
- package/lib/inputs/MarkdownInput.js +0 -433
- package/lib/inputs/SelectInput.d.ts +0 -1
- package/lib/inputs/SelectInput.js +0 -236
- package/lib/inputs/index.d.ts +0 -7
- package/lib/inputs/index.js +0 -96
- package/lib/inputs/objectInput.d.ts +0 -1
- package/lib/inputs/objectInput.js +0 -115
- package/lib/resolvers/index.d.ts +0 -2
- package/lib/resolvers/index.js +0 -19
- package/lib/resolvers/utils.d.ts +0 -5
- package/lib/resolvers/utils.js +0 -133
- package/lib/style.d.ts +0 -230
- package/lib/style.js +0 -178
- package/lib/styleContext.d.ts +0 -1
- package/lib/styleContext.js +0 -29
- package/lib/type.d.ts +0 -8
- package/lib/type.js +0 -15
- package/lib/utils.d.ts +0 -2
- package/lib/utils.js +0 -37
package/lib/style.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.style = void 0;
|
|
7
|
-
|
|
8
|
-
var _style;
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
var buttonOutline = function buttonOutline(color, darker) {
|
|
13
|
-
return {
|
|
14
|
-
color: color,
|
|
15
|
-
borderColor: color,
|
|
16
|
-
"&:hover": {
|
|
17
|
-
color: '#fff',
|
|
18
|
-
backgroundColor: color,
|
|
19
|
-
borderColor: darker
|
|
20
|
-
},
|
|
21
|
-
"&.active": {
|
|
22
|
-
color: '#fff',
|
|
23
|
-
backgroundColor: color,
|
|
24
|
-
borderColor: darker
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var style = (_style = {
|
|
30
|
-
input: {
|
|
31
|
-
display: "block",
|
|
32
|
-
width: "100%",
|
|
33
|
-
padding: "8px 12px",
|
|
34
|
-
fontSize: "1rem",
|
|
35
|
-
color: "#495057",
|
|
36
|
-
border: "1px solid #ced4da",
|
|
37
|
-
borderRadius: 4,
|
|
38
|
-
"&[readonly]": {
|
|
39
|
-
backgroundColor: "#e9ecef",
|
|
40
|
-
opacity: 1
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
btn: {
|
|
44
|
-
borderRadius: 5,
|
|
45
|
-
padding: 10,
|
|
46
|
-
fontSize: "1rem",
|
|
47
|
-
cursor: "pointer",
|
|
48
|
-
borderWidth: '1px',
|
|
49
|
-
backgroundColor: '#fff',
|
|
50
|
-
'&:disabled': {
|
|
51
|
-
opacity: .6,
|
|
52
|
-
cursor: 'not-allowed'
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
btn_sm: {
|
|
56
|
-
fontSize: "0.875rem",
|
|
57
|
-
padding: ".25rem .5rem",
|
|
58
|
-
lineHeight: "1.5",
|
|
59
|
-
borderRadius: ".2rem"
|
|
60
|
-
},
|
|
61
|
-
btn_group: {
|
|
62
|
-
"& > button:not(:last-child)": {
|
|
63
|
-
borderTopRightRadius: 0,
|
|
64
|
-
borderBottomRightRadius: 0
|
|
65
|
-
},
|
|
66
|
-
"& > button:not(:first-child)": {
|
|
67
|
-
borderTopLeftRadius: 0,
|
|
68
|
-
borderBottomLeftRadius: 0
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
btn_red: buttonOutline("#dc3545", "#bd2130"),
|
|
72
|
-
btn_green: buttonOutline("#28a745", "#1e7e34"),
|
|
73
|
-
btn_blue: buttonOutline("#007bff", "#0069d9"),
|
|
74
|
-
btn_grey: buttonOutline("#6c757d", "#5c636a"),
|
|
75
|
-
txt_red: {
|
|
76
|
-
color: "#dc3545"
|
|
77
|
-
},
|
|
78
|
-
ml_5: {
|
|
79
|
-
marginLeft: 5
|
|
80
|
-
},
|
|
81
|
-
ml_10: {
|
|
82
|
-
marginLeft: 10
|
|
83
|
-
},
|
|
84
|
-
mr_5: {
|
|
85
|
-
marginRight: 5
|
|
86
|
-
},
|
|
87
|
-
mr_10: {
|
|
88
|
-
marginRight: 10
|
|
89
|
-
},
|
|
90
|
-
mt_5: {
|
|
91
|
-
marginTop: 5
|
|
92
|
-
},
|
|
93
|
-
mt_10: {
|
|
94
|
-
marginTop: 10
|
|
95
|
-
},
|
|
96
|
-
mt_20: {
|
|
97
|
-
marginTop: 20
|
|
98
|
-
},
|
|
99
|
-
mb_5: {
|
|
100
|
-
marginBottom: 5
|
|
101
|
-
},
|
|
102
|
-
p_15: {
|
|
103
|
-
padding: 15
|
|
104
|
-
},
|
|
105
|
-
pr_15: {
|
|
106
|
-
paddingRight: 15
|
|
107
|
-
},
|
|
108
|
-
full_width: {
|
|
109
|
-
width: '100%'
|
|
110
|
-
},
|
|
111
|
-
d_none: {
|
|
112
|
-
display: "none"
|
|
113
|
-
},
|
|
114
|
-
flex: {
|
|
115
|
-
display: "flex"
|
|
116
|
-
},
|
|
117
|
-
flexColumn: {
|
|
118
|
-
flexDirection: "column"
|
|
119
|
-
},
|
|
120
|
-
justifyContentBetween: {
|
|
121
|
-
justifyContent: "space-between"
|
|
122
|
-
},
|
|
123
|
-
jc_end: {
|
|
124
|
-
justifyContent: "end"
|
|
125
|
-
},
|
|
126
|
-
ac_center: {
|
|
127
|
-
alignContent: "center"
|
|
128
|
-
},
|
|
129
|
-
ai_center: {
|
|
130
|
-
alignItems: "center"
|
|
131
|
-
},
|
|
132
|
-
cursor_pointer: {
|
|
133
|
-
cursor: "pointer"
|
|
134
|
-
},
|
|
135
|
-
collapse: {
|
|
136
|
-
display: "flex",
|
|
137
|
-
justifyContent: "space-between",
|
|
138
|
-
cursor: "pointer"
|
|
139
|
-
},
|
|
140
|
-
collapse_label: {
|
|
141
|
-
fontWeight: "bold",
|
|
142
|
-
marginTop: 7
|
|
143
|
-
}
|
|
144
|
-
}, _defineProperty(_style, "collapse_label", {
|
|
145
|
-
fontWeight: "bold",
|
|
146
|
-
marginTop: 7
|
|
147
|
-
}), _defineProperty(_style, "collapse_error", {
|
|
148
|
-
color: '#dc3545'
|
|
149
|
-
}), _defineProperty(_style, "datepicker", {
|
|
150
|
-
"& input": {
|
|
151
|
-
borderRadius: "4px"
|
|
152
|
-
}
|
|
153
|
-
}), _defineProperty(_style, "code", {}), _defineProperty(_style, "input__boolean__on", {
|
|
154
|
-
color: "MediumSeaGreen"
|
|
155
|
-
}), _defineProperty(_style, "input__boolean__off", {
|
|
156
|
-
color: "tomato"
|
|
157
|
-
}), _defineProperty(_style, "input__invalid", {
|
|
158
|
-
borderColor: '#dc3545 !important'
|
|
159
|
-
}), _defineProperty(_style, "invalid_feedback", {
|
|
160
|
-
width: "100%",
|
|
161
|
-
marginTop: ".25rem",
|
|
162
|
-
fontSize: "80%",
|
|
163
|
-
color: "#dc3545"
|
|
164
|
-
}), _defineProperty(_style, "display__none", {
|
|
165
|
-
display: "none"
|
|
166
|
-
}), _defineProperty(_style, "collapse__inline", {
|
|
167
|
-
"& .form-group+.form-group": {
|
|
168
|
-
marginLeft: '20px'
|
|
169
|
-
}
|
|
170
|
-
}), _defineProperty(_style, "nestedform__border", {
|
|
171
|
-
borderLeft: '2px solid lightGray',
|
|
172
|
-
paddingLeft: '1rem',
|
|
173
|
-
marginBottom: '.5rem',
|
|
174
|
-
position: 'relative'
|
|
175
|
-
}), _defineProperty(_style, "border__error", {
|
|
176
|
-
borderColor: "#dc3545"
|
|
177
|
-
}), _style);
|
|
178
|
-
exports.style = style;
|
package/lib/styleContext.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function useCustomStyle(overrideStyle?: {}): import("jss").Classes<"code" | "flex" | "input" | "btn" | "btn_sm" | "btn_group" | "btn_red" | "btn_green" | "btn_blue" | "btn_grey" | "txt_red" | "ml_5" | "ml_10" | "mr_5" | "mr_10" | "mt_5" | "mt_10" | "mt_20" | "mb_5" | "p_15" | "pr_15" | "full_width" | "d_none" | "flexColumn" | "justifyContentBetween" | "jc_end" | "ac_center" | "ai_center" | "cursor_pointer" | "collapse" | "collapse_label" | "collapse_error" | "datepicker" | "input__boolean__on" | "input__boolean__off" | "input__invalid" | "invalid_feedback" | "display__none" | "collapse__inline" | "nestedform__border" | "border__error">;
|
package/lib/styleContext.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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/lib/type.d.ts
DELETED
package/lib/type.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.type = void 0;
|
|
7
|
-
var type = {
|
|
8
|
-
string: 'string',
|
|
9
|
-
number: 'number',
|
|
10
|
-
bool: 'bool',
|
|
11
|
-
date: 'date',
|
|
12
|
-
object: 'object',
|
|
13
|
-
file: 'file'
|
|
14
|
-
};
|
|
15
|
-
exports.type = type;
|
package/lib/utils.d.ts
DELETED
package/lib/utils.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isPromise = exports.deepEqual = void 0;
|
|
7
|
-
|
|
8
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
9
|
-
|
|
10
|
-
var deepEqual = function deepEqual(a, b) {
|
|
11
|
-
if (a === b) return true;
|
|
12
|
-
if (_typeof(a) !== 'object' || _typeof(b) !== 'object' || a === null || b === null) return false;
|
|
13
|
-
var keysA = Object.keys(a),
|
|
14
|
-
keysB = Object.keys(b);
|
|
15
|
-
if (keysA.length !== keysB.length) return false;
|
|
16
|
-
|
|
17
|
-
for (var _i = 0, _keysA = keysA; _i < _keysA.length; _i++) {
|
|
18
|
-
var key = _keysA[_i];
|
|
19
|
-
if (!keysB.includes(key)) return false;
|
|
20
|
-
|
|
21
|
-
if (typeof a[key] === 'function' || typeof b[key] === 'function') {
|
|
22
|
-
if (a[key].toString() !== b[key].toString()) return false;
|
|
23
|
-
} else {
|
|
24
|
-
if (!deepEqual(a[key], b[key])) return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return true;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
exports.deepEqual = deepEqual;
|
|
32
|
-
|
|
33
|
-
var isPromise = function isPromise(value) {
|
|
34
|
-
return Boolean(value && typeof value.then === 'function');
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
exports.isPromise = isPromise;
|