@maif/react-forms 1.0.18 → 1.0.19
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/dist/react-form.js +1 -1
- package/lib/form.js +79 -27
- package/lib/inputs/Collapse.js +9 -3
- package/lib/inputs/SelectInput.js +3 -2
- package/lib/style.d.ts +19 -0
- package/lib/style.js +15 -1
- package/lib/styleContext.d.ts +1 -1
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +8 -2
- package/package.json +1 -1
package/lib/form.js
CHANGED
|
@@ -78,6 +78,7 @@ var usePrevious = function usePrevious(value) {
|
|
|
78
78
|
|
|
79
79
|
var BasicWrapper = function BasicWrapper(_ref) {
|
|
80
80
|
var entry = _ref.entry,
|
|
81
|
+
className = _ref.className,
|
|
81
82
|
label = _ref.label,
|
|
82
83
|
error = _ref.error,
|
|
83
84
|
help = _ref.help,
|
|
@@ -101,7 +102,7 @@ var BasicWrapper = function BasicWrapper(_ref) {
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
104
|
-
className: "form-group mt-3"
|
|
105
|
+
className: "form-group mt-3 ".concat(className)
|
|
105
106
|
}, label && /*#__PURE__*/_react["default"].createElement("label", {
|
|
106
107
|
className: "form-label d-flex align-content-center",
|
|
107
108
|
htmlFor: entry
|
|
@@ -238,9 +239,9 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
238
239
|
|
|
239
240
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, v));
|
|
240
241
|
} else if (!!v && _typeof(v) === 'object') {
|
|
241
|
-
var
|
|
242
|
+
var _subSchema$key;
|
|
242
243
|
|
|
243
|
-
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, cleanInputArray(v, ((
|
|
244
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, cleanInputArray(v, ((_subSchema$key = subSchema[key]) === null || _subSchema$key === void 0 ? void 0 : _subSchema$key.schema) || {})));
|
|
244
245
|
} else {
|
|
245
246
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, v));
|
|
246
247
|
}
|
|
@@ -269,9 +270,9 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
269
270
|
|
|
270
271
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, v));
|
|
271
272
|
} else if (!!v && _typeof(v) === 'object') {
|
|
272
|
-
var
|
|
273
|
+
var _subSchema$key2;
|
|
273
274
|
|
|
274
|
-
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, cleanOutputArray(v, ((
|
|
275
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, cleanOutputArray(v, ((_subSchema$key2 = subSchema[key]) === null || _subSchema$key2 === void 0 ? void 0 : _subSchema$key2.schema) || {})));
|
|
275
276
|
} else {
|
|
276
277
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, v));
|
|
277
278
|
}
|
|
@@ -282,7 +283,7 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
282
283
|
resolver: function resolver(data, context, options) {
|
|
283
284
|
return (0, _yup.yupResolver)(_resolver(data))(data, context, options);
|
|
284
285
|
},
|
|
285
|
-
defaultValues: cleanInputArray(value || defaultValues),
|
|
286
|
+
defaultValues: cleanInputArray(value || defaultValues, schema),
|
|
286
287
|
shouldFocusError: !options.autosubmit
|
|
287
288
|
});
|
|
288
289
|
var register = methods.register,
|
|
@@ -296,11 +297,11 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
296
297
|
setValue = methods.setValue;
|
|
297
298
|
(0, _react.useEffect)(function () {
|
|
298
299
|
if (value) {
|
|
299
|
-
_reset(cleanInputArray(value));
|
|
300
|
+
_reset(cleanInputArray(value, schema));
|
|
300
301
|
}
|
|
301
302
|
}, [value, _reset]);
|
|
302
303
|
(0, _react.useEffect)(function () {
|
|
303
|
-
_reset(cleanInputArray(value || defaultValues));
|
|
304
|
+
_reset(cleanInputArray(value || defaultValues, schema));
|
|
304
305
|
}, [schema]);
|
|
305
306
|
var data = watch();
|
|
306
307
|
var prevData = usePrevious(data);
|
|
@@ -308,7 +309,7 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
308
309
|
//todo: with debounce
|
|
309
310
|
if (!!options.autosubmit && JSON.stringify(data) !== JSON.stringify(prevData)) {
|
|
310
311
|
_handleSubmit(function (data) {
|
|
311
|
-
var clean = cleanOutputArray(data);
|
|
312
|
+
var clean = cleanOutputArray(data, schema);
|
|
312
313
|
onSubmit(clean);
|
|
313
314
|
}, onError)();
|
|
314
315
|
}
|
|
@@ -324,7 +325,7 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
324
325
|
return {
|
|
325
326
|
handleSubmit: function handleSubmit() {
|
|
326
327
|
return _handleSubmit(function (data) {
|
|
327
|
-
var clean = cleanOutputArray(data);
|
|
328
|
+
var clean = cleanOutputArray(data, schema);
|
|
328
329
|
onSubmit(clean);
|
|
329
330
|
}, onError)();
|
|
330
331
|
}
|
|
@@ -333,7 +334,7 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
333
334
|
return /*#__PURE__*/_react["default"].createElement(_reactHookForm.FormProvider, methods, /*#__PURE__*/_react["default"].createElement("form", {
|
|
334
335
|
className: className || "".concat(classes.pr_15, " ").concat(classes.full_width),
|
|
335
336
|
onSubmit: _handleSubmit(function (data) {
|
|
336
|
-
var clean = cleanOutputArray(data);
|
|
337
|
+
var clean = cleanOutputArray(data, schema);
|
|
337
338
|
onSubmit(clean);
|
|
338
339
|
}, onError)
|
|
339
340
|
}, formFlow.map(function (entry, idx) {
|
|
@@ -393,7 +394,7 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
393
394
|
return _reset(defaultValues);
|
|
394
395
|
},
|
|
395
396
|
valid: _handleSubmit(function (data) {
|
|
396
|
-
return onSubmit(cleanOutputArray(data));
|
|
397
|
+
return onSubmit(cleanOutputArray(data, schema));
|
|
397
398
|
}, onError),
|
|
398
399
|
actions: options.actions
|
|
399
400
|
})));
|
|
@@ -402,7 +403,7 @@ var Form = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
402
403
|
exports.Form = Form;
|
|
403
404
|
|
|
404
405
|
var Footer = function Footer(props) {
|
|
405
|
-
var _props$actions, _props$actions$submit, _props$actions2, _props$actions2$submi, _props$actions3, _props$actions3$reset, _props$
|
|
406
|
+
var _props$actions, _props$actions$submit, _props$actions2, _props$actions2$submi, _props$actions3, _props$actions3$cance, _props$actions5, _props$actions5$cance, _props$actions6, _props$actions6$reset, _props$actions7, _props$actions7$reset, _props$actions8, _props$actions8$submi;
|
|
406
407
|
|
|
407
408
|
var classes = (0, _styleContext.useCustomStyle)();
|
|
408
409
|
|
|
@@ -416,18 +417,27 @@ var Footer = function Footer(props) {
|
|
|
416
417
|
var isSubmitDisplayed = ((_props$actions = props.actions) === null || _props$actions === void 0 ? void 0 : (_props$actions$submit = _props$actions.submit) === null || _props$actions$submit === void 0 ? void 0 : _props$actions$submit.display) === undefined ? true : !!((_props$actions2 = props.actions) !== null && _props$actions2 !== void 0 && (_props$actions2$submi = _props$actions2.submit) !== null && _props$actions2$submi !== void 0 && _props$actions2$submi.display);
|
|
417
418
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
418
419
|
className: "".concat(classes.flex, " ").concat(classes.jc_end, " ").concat(classes.mt_5)
|
|
419
|
-
}, ((_props$actions3 = props.actions) === null || _props$actions3 === void 0 ? void 0 : (_props$actions3$
|
|
420
|
+
}, ((_props$actions3 = props.actions) === null || _props$actions3 === void 0 ? void 0 : (_props$actions3$cance = _props$actions3.cancel) === null || _props$actions3$cance === void 0 ? void 0 : _props$actions3$cance.display) && /*#__PURE__*/_react["default"].createElement("button", {
|
|
421
|
+
className: "".concat(classes.btn, " ").concat(classes.btn_red),
|
|
422
|
+
type: "button",
|
|
423
|
+
onClick: function onClick() {
|
|
424
|
+
var _props$actions4;
|
|
425
|
+
|
|
426
|
+
return (_props$actions4 = props.actions) === null || _props$actions4 === void 0 ? void 0 : _props$actions4.cancel.action();
|
|
427
|
+
}
|
|
428
|
+
}, ((_props$actions5 = props.actions) === null || _props$actions5 === void 0 ? void 0 : (_props$actions5$cance = _props$actions5.cancel) === null || _props$actions5$cance === void 0 ? void 0 : _props$actions5$cance.label) || 'Cancel'), ((_props$actions6 = props.actions) === null || _props$actions6 === void 0 ? void 0 : (_props$actions6$reset = _props$actions6.reset) === null || _props$actions6$reset === void 0 ? void 0 : _props$actions6$reset.display) && /*#__PURE__*/_react["default"].createElement("button", {
|
|
420
429
|
className: "".concat(classes.btn, " ").concat(classes.btn_red),
|
|
421
430
|
type: "button",
|
|
422
431
|
onClick: props.reset
|
|
423
|
-
}, ((_props$
|
|
432
|
+
}, ((_props$actions7 = props.actions) === null || _props$actions7 === void 0 ? void 0 : (_props$actions7$reset = _props$actions7.reset) === null || _props$actions7$reset === void 0 ? void 0 : _props$actions7$reset.label) || 'Reset'), isSubmitDisplayed && /*#__PURE__*/_react["default"].createElement("button", {
|
|
424
433
|
className: "".concat(classes.btn, " ").concat(classes.btn_green, " ").concat(classes.ml_10),
|
|
425
434
|
type: "submit"
|
|
426
|
-
}, ((_props$
|
|
435
|
+
}, ((_props$actions8 = props.actions) === null || _props$actions8 === void 0 ? void 0 : (_props$actions8$submi = _props$actions8.submit) === null || _props$actions8$submi === void 0 ? void 0 : _props$actions8$submi.label) || 'Save'));
|
|
427
436
|
};
|
|
428
437
|
|
|
429
438
|
var Step = function Step(_ref4) {
|
|
430
439
|
var entry = _ref4.entry,
|
|
440
|
+
realEntry = _ref4.realEntry,
|
|
431
441
|
step = _ref4.step,
|
|
432
442
|
error = _ref4.error,
|
|
433
443
|
errors = _ref4.errors,
|
|
@@ -448,11 +458,9 @@ var Step = function Step(_ref4) {
|
|
|
448
458
|
var errored = entry.flow.some(function (step) {
|
|
449
459
|
return !!errors[step];
|
|
450
460
|
});
|
|
451
|
-
return /*#__PURE__*/_react["default"].createElement(_index.Collapse, {
|
|
452
|
-
label: entry.label,
|
|
453
|
-
collapsed: entry.collapsed,
|
|
461
|
+
return /*#__PURE__*/_react["default"].createElement(_index.Collapse, _extends({}, entry, {
|
|
454
462
|
errored: errored
|
|
455
|
-
}, entry.flow.map(function (en, entryIdx) {
|
|
463
|
+
}), entry.flow.map(function (en, entryIdx) {
|
|
456
464
|
var stp = schema[en];
|
|
457
465
|
var err = _typeof(en) === 'object' ? undefined : en.split('.').reduce(function (object, key) {
|
|
458
466
|
return object && object[key];
|
|
@@ -481,6 +489,7 @@ var Step = function Step(_ref4) {
|
|
|
481
489
|
|
|
482
490
|
return /*#__PURE__*/_react["default"].createElement(BasicWrapper, {
|
|
483
491
|
key: "collapse-".concat(en, "-").concat(entryIdx),
|
|
492
|
+
className: classes.collapseInline,
|
|
484
493
|
entry: en,
|
|
485
494
|
error: err,
|
|
486
495
|
label: (stp === null || stp === void 0 ? void 0 : stp.label) === null ? null : (stp === null || stp === void 0 ? void 0 : stp.label) || en,
|
|
@@ -521,7 +530,7 @@ var Step = function Step(_ref4) {
|
|
|
521
530
|
|
|
522
531
|
return /*#__PURE__*/_react["default"].createElement(Step, {
|
|
523
532
|
entry: "".concat(entry, "[").concat(idx, "].value"),
|
|
524
|
-
step: _objectSpread(_objectSpread({}, schema[entry]), {}, {
|
|
533
|
+
step: _objectSpread(_objectSpread({}, schema[realEntry || entry]), {}, {
|
|
525
534
|
array: false
|
|
526
535
|
}),
|
|
527
536
|
error: error && ((_error$idx = error[idx]) === null || _error$idx === void 0 ? void 0 : _error$idx.value),
|
|
@@ -535,7 +544,7 @@ var Step = function Step(_ref4) {
|
|
|
535
544
|
inputWrapper: inputWrapper,
|
|
536
545
|
httpClient: httpClient,
|
|
537
546
|
defaultValue: props.defaultValue,
|
|
538
|
-
value: props.
|
|
547
|
+
value: props.value,
|
|
539
548
|
index: idx
|
|
540
549
|
});
|
|
541
550
|
}
|
|
@@ -810,7 +819,7 @@ var Step = function Step(_ref4) {
|
|
|
810
819
|
parent: entry,
|
|
811
820
|
inputWrapper: inputWrapper,
|
|
812
821
|
maybeCustomHttpClient: httpClient,
|
|
813
|
-
value: defaultValue,
|
|
822
|
+
value: getValues(entry) || defaultValue,
|
|
814
823
|
error: error,
|
|
815
824
|
index: index
|
|
816
825
|
}));
|
|
@@ -1046,6 +1055,12 @@ var NestedForm = function NestedForm(_ref16) {
|
|
|
1046
1055
|
watch = _useFormContext.watch; // retrieve all hook methods
|
|
1047
1056
|
|
|
1048
1057
|
|
|
1058
|
+
var _useState5 = (0, _react.useState)(false),
|
|
1059
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1060
|
+
collapsed = _useState6[0],
|
|
1061
|
+
setCollapsed = _useState6[1];
|
|
1062
|
+
|
|
1063
|
+
var classes = (0, _styleContext.useCustomStyle)();
|
|
1049
1064
|
var schemaAndFlow = (0, _Option.option)(step.conditionalSchema).map(function (condiSchema) {
|
|
1050
1065
|
var ref = (0, _Option.option)(condiSchema.ref).map(function (ref) {
|
|
1051
1066
|
return getValues(ref);
|
|
@@ -1070,7 +1085,7 @@ var NestedForm = function NestedForm(_ref16) {
|
|
|
1070
1085
|
});
|
|
1071
1086
|
var prevSchema = usePrevious(schemaAndFlow.schema);
|
|
1072
1087
|
(0, _react.useEffect)(function () {
|
|
1073
|
-
if (JSON.stringify(prevSchema) !== JSON.stringify(schemaAndFlow.schema)) {
|
|
1088
|
+
if (!!prevSchema && JSON.stringify(prevSchema) !== JSON.stringify(schemaAndFlow.schema)) {
|
|
1074
1089
|
var def = getDefaultValues(schemaAndFlow.flow, schemaAndFlow.schema);
|
|
1075
1090
|
setValue(parent, def, {
|
|
1076
1091
|
shouldValidate: false
|
|
@@ -1080,14 +1095,50 @@ var NestedForm = function NestedForm(_ref16) {
|
|
|
1080
1095
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1081
1096
|
style: {
|
|
1082
1097
|
borderLeft: '2px solid lightGray',
|
|
1083
|
-
paddingLeft: '
|
|
1084
|
-
marginBottom: '.5rem'
|
|
1098
|
+
paddingLeft: '1rem',
|
|
1099
|
+
marginBottom: '.5rem',
|
|
1100
|
+
position: 'relative'
|
|
1085
1101
|
}
|
|
1086
|
-
},
|
|
1102
|
+
}, collapsed && /*#__PURE__*/_react["default"].createElement(_reactFeather.ArrowDown, {
|
|
1103
|
+
size: 30,
|
|
1104
|
+
className: classes.cursor_pointer,
|
|
1105
|
+
style: {
|
|
1106
|
+
position: 'absolute',
|
|
1107
|
+
top: '5px',
|
|
1108
|
+
left: '-16px'
|
|
1109
|
+
},
|
|
1110
|
+
"stroke-width": "3",
|
|
1111
|
+
onClick: function onClick() {
|
|
1112
|
+
return setCollapsed(!collapsed);
|
|
1113
|
+
}
|
|
1114
|
+
}), !collapsed && /*#__PURE__*/_react["default"].createElement(_reactFeather.ArrowUp, {
|
|
1115
|
+
size: 30,
|
|
1116
|
+
className: classes.cursor_pointer,
|
|
1117
|
+
style: {
|
|
1118
|
+
position: 'absolute',
|
|
1119
|
+
top: '5px',
|
|
1120
|
+
left: '-16px'
|
|
1121
|
+
},
|
|
1122
|
+
"stroke-width": "3",
|
|
1123
|
+
onClick: function onClick() {
|
|
1124
|
+
return setCollapsed(!collapsed);
|
|
1125
|
+
}
|
|
1126
|
+
}), schemaAndFlow.flow.map(function (entry, idx) {
|
|
1127
|
+
var _schemaAndFlow$schema;
|
|
1128
|
+
|
|
1087
1129
|
var step = schemaAndFlow.schema[entry];
|
|
1088
1130
|
var realError = error && error[entry];
|
|
1131
|
+
console.debug({
|
|
1132
|
+
schema: schema,
|
|
1133
|
+
entry: entry,
|
|
1134
|
+
result: (0, _Option.option)((_schemaAndFlow$schema = schemaAndFlow.schema) === null || _schemaAndFlow$schema === void 0 ? void 0 : _schemaAndFlow$schema.collapseField).map(function (f) {
|
|
1135
|
+
return f === entry;
|
|
1136
|
+
}).getOrElse(idx > 0)
|
|
1137
|
+
});
|
|
1138
|
+
var isCollapsed = collapsed && (0, _Option.option)(!step.visibleOnCollapse).getOrElse(idx > 0);
|
|
1089
1139
|
return /*#__PURE__*/_react["default"].createElement(BasicWrapper, {
|
|
1090
1140
|
key: "".concat(entry, ".").concat(idx),
|
|
1141
|
+
className: (0, _classnames["default"])(_defineProperty({}, classes.display__none, isCollapsed)),
|
|
1091
1142
|
entry: "".concat(parent, ".").concat(entry),
|
|
1092
1143
|
error: realError,
|
|
1093
1144
|
label: (step === null || step === void 0 ? void 0 : step.label) === null ? null : (step === null || step === void 0 ? void 0 : step.label) || entry,
|
|
@@ -1096,6 +1147,7 @@ var NestedForm = function NestedForm(_ref16) {
|
|
|
1096
1147
|
}, /*#__PURE__*/_react["default"].createElement(Step, {
|
|
1097
1148
|
key: "step.".concat(entry, ".").concat(idx),
|
|
1098
1149
|
entry: "".concat(parent, ".").concat(entry),
|
|
1150
|
+
realEntry: entry,
|
|
1099
1151
|
step: schemaAndFlow.schema[entry],
|
|
1100
1152
|
error: realError,
|
|
1101
1153
|
register: register,
|
package/lib/inputs/Collapse.js
CHANGED
|
@@ -36,6 +36,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
36
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
37
|
|
|
38
38
|
var Collapse = function Collapse(props) {
|
|
39
|
+
var _classNames4;
|
|
40
|
+
|
|
39
41
|
var _useState = (0, _react.useState)(props.initCollapsed || props.collapsed),
|
|
40
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
43
|
collapsed = _useState2[0],
|
|
@@ -57,10 +59,14 @@ var Collapse = function Collapse(props) {
|
|
|
57
59
|
className: (0, _classnames["default"])(classes.collapse_label, _defineProperty({}, classes.collapse_error, props.errored))
|
|
58
60
|
}, props.label), /*#__PURE__*/_react["default"].createElement("button", {
|
|
59
61
|
type: "button",
|
|
60
|
-
className: (0, _classnames["default"])(classes.btn, _defineProperty({}, classes.collapse_error, props.errored)),
|
|
62
|
+
className: (0, _classnames["default"])(classes.btn, classes.btn_sm, _defineProperty({}, classes.collapse_error, props.errored)),
|
|
61
63
|
onClick: toggle
|
|
62
|
-
}, !!collapsed && /*#__PURE__*/_react["default"].createElement(_reactFeather.Eye,
|
|
63
|
-
|
|
64
|
+
}, !!collapsed && /*#__PURE__*/_react["default"].createElement(_reactFeather.Eye, {
|
|
65
|
+
size: 16
|
|
66
|
+
}), !collapsed && /*#__PURE__*/_react["default"].createElement(_reactFeather.EyeOff, {
|
|
67
|
+
size: 16
|
|
68
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
69
|
+
className: (0, _classnames["default"])(classes.ml_10, (_classNames4 = {}, _defineProperty(_classNames4, classes.display__none, !!collapsed), _defineProperty(_classNames4, classes.flex, !!props.inline), _classNames4))
|
|
64
70
|
}, props.children), props.lineEnd && /*#__PURE__*/_react["default"].createElement("hr", null));
|
|
65
71
|
};
|
|
66
72
|
|
|
@@ -118,9 +118,10 @@ var SelectInput = function SelectInput(props) {
|
|
|
118
118
|
|
|
119
119
|
if (cond) {
|
|
120
120
|
setLoading(true);
|
|
121
|
-
|
|
121
|
+
var promise = (0, _utils.isPromise)(props.optionsFrom) ? props.optionsFrom : props.httpClient(props.optionsFrom, 'GET').then(function (r) {
|
|
122
122
|
return r.json();
|
|
123
|
-
})
|
|
123
|
+
});
|
|
124
|
+
promise.then(function (values) {
|
|
124
125
|
return values.map(function (x) {
|
|
125
126
|
return props.transformer ? props.transformer(x) : valueToSelectOption(x, values, props.isMulti, props.transformer);
|
|
126
127
|
});
|
package/lib/style.d.ts
CHANGED
|
@@ -25,6 +25,9 @@ export namespace style {
|
|
|
25
25
|
export { fontSize_1 as fontSize };
|
|
26
26
|
const padding_1: string;
|
|
27
27
|
export { padding_1 as padding };
|
|
28
|
+
export const lineHeight: string;
|
|
29
|
+
const borderRadius_1: string;
|
|
30
|
+
export { borderRadius_1 as borderRadius };
|
|
28
31
|
}
|
|
29
32
|
const btn_group: {
|
|
30
33
|
"& > button:not(:last-child)": {
|
|
@@ -102,6 +105,13 @@ export namespace style {
|
|
|
102
105
|
const marginLeft_1: number;
|
|
103
106
|
export { marginLeft_1 as marginLeft };
|
|
104
107
|
}
|
|
108
|
+
namespace mr_5 {
|
|
109
|
+
const marginRight: number;
|
|
110
|
+
}
|
|
111
|
+
namespace mr_10 {
|
|
112
|
+
const marginRight_1: number;
|
|
113
|
+
export { marginRight_1 as marginRight };
|
|
114
|
+
}
|
|
105
115
|
namespace mt_5 {
|
|
106
116
|
const marginTop: number;
|
|
107
117
|
}
|
|
@@ -197,4 +207,13 @@ export namespace style {
|
|
|
197
207
|
const color_4: string;
|
|
198
208
|
export { color_4 as color };
|
|
199
209
|
}
|
|
210
|
+
namespace display__none {
|
|
211
|
+
const display_3: string;
|
|
212
|
+
export { display_3 as display };
|
|
213
|
+
}
|
|
214
|
+
const collapseInline: {
|
|
215
|
+
"&+ .form-group": {
|
|
216
|
+
marginLeft: string;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
200
219
|
}
|
package/lib/style.js
CHANGED
|
@@ -50,7 +50,9 @@ var style = (_style = {
|
|
|
50
50
|
},
|
|
51
51
|
btn_sm: {
|
|
52
52
|
fontSize: "0.875rem",
|
|
53
|
-
padding: ".25rem .5rem"
|
|
53
|
+
padding: ".25rem .5rem",
|
|
54
|
+
lineHeight: "1.5",
|
|
55
|
+
borderRadius: ".2rem"
|
|
54
56
|
},
|
|
55
57
|
btn_group: {
|
|
56
58
|
"& > button:not(:last-child)": {
|
|
@@ -75,6 +77,12 @@ var style = (_style = {
|
|
|
75
77
|
ml_10: {
|
|
76
78
|
marginLeft: 10
|
|
77
79
|
},
|
|
80
|
+
mr_5: {
|
|
81
|
+
marginRight: 5
|
|
82
|
+
},
|
|
83
|
+
mr_10: {
|
|
84
|
+
marginRight: 10
|
|
85
|
+
},
|
|
78
86
|
mt_5: {
|
|
79
87
|
marginTop: 5
|
|
80
88
|
},
|
|
@@ -149,5 +157,11 @@ var style = (_style = {
|
|
|
149
157
|
marginTop: ".25rem",
|
|
150
158
|
fontSize: "80%",
|
|
151
159
|
color: "#dc3545"
|
|
160
|
+
}), _defineProperty(_style, "display__none", {
|
|
161
|
+
display: "none"
|
|
162
|
+
}), _defineProperty(_style, "collapseInline", {
|
|
163
|
+
"&+ .form-group": {
|
|
164
|
+
marginLeft: '20px'
|
|
165
|
+
}
|
|
152
166
|
}), _style);
|
|
153
167
|
exports.style = style;
|
package/lib/styleContext.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
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" | "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">;
|
|
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" | "collapseInline">;
|
package/lib/utils.d.ts
CHANGED
package/lib/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.deepEqual = void 0;
|
|
6
|
+
exports.isPromise = exports.deepEqual = void 0;
|
|
7
7
|
|
|
8
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
9
|
|
|
@@ -28,4 +28,10 @@ var deepEqual = function deepEqual(a, b) {
|
|
|
28
28
|
return true;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
exports.deepEqual = deepEqual;
|
|
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;
|