@xqmsg/ui-core 0.14.4 → 0.14.5
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/components/input/StackedCheckbox/StackedCheckbox.d.ts +10 -0
- package/dist/ui-core.cjs.development.js +18 -18
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +19 -19
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.stories.tsx +6 -0
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +27 -0
- package/src/components/input/StackedSwitch/index.tsx +2 -0
- package/src/components/input/index.tsx +5 -3
- package/src/components/table/index.tsx +2 -7
- package/dist/components/input/StackedCheckbox/StackedCheckboxGroup.d.ts +0 -10
- package/src/components/input/StackedCheckbox/StackedCheckboxGroup.tsx +0 -29
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectFieldProps } from '../InputTypes';
|
|
3
|
+
export interface StackedCheckboxProps extends SelectFieldProps {
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
8
|
+
*/
|
|
9
|
+
declare const StackedCheckbox: React.ForwardRefExoticComponent<StackedCheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export default StackedCheckbox;
|
|
@@ -409,18 +409,15 @@ function Form(_ref) {
|
|
|
409
409
|
* A functional React component utilized to render the `StackedCheckbox` component.
|
|
410
410
|
*/
|
|
411
411
|
|
|
412
|
-
var
|
|
413
|
-
var
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
value: option.value
|
|
422
|
-
}, option.label));
|
|
423
|
-
}));
|
|
412
|
+
var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
|
|
413
|
+
var value = _ref2.value,
|
|
414
|
+
label = _ref2.label,
|
|
415
|
+
defaultValue = _ref2.defaultValue;
|
|
416
|
+
return /*#__PURE__*/React__default.createElement(react.Checkbox, {
|
|
417
|
+
ref: _ref,
|
|
418
|
+
value: String(value),
|
|
419
|
+
defaultChecked: Boolean(defaultValue)
|
|
420
|
+
}, label);
|
|
424
421
|
});
|
|
425
422
|
|
|
426
423
|
function _extends() {
|
|
@@ -1107,6 +1104,7 @@ var StackedSwitch = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
1107
1104
|
var isRequired = _ref2.isRequired,
|
|
1108
1105
|
_onChange = _ref2.onChange,
|
|
1109
1106
|
value = _ref2.value;
|
|
1107
|
+
if (value === null) return null;
|
|
1110
1108
|
return /*#__PURE__*/React__default.createElement(react.Switch, {
|
|
1111
1109
|
size: "lg",
|
|
1112
1110
|
ref: _ref,
|
|
@@ -1225,17 +1223,18 @@ function Input(_ref) {
|
|
|
1225
1223
|
});
|
|
1226
1224
|
|
|
1227
1225
|
case 'checkbox':
|
|
1228
|
-
return /*#__PURE__*/React__default.createElement(
|
|
1226
|
+
return /*#__PURE__*/React__default.createElement(StackedCheckbox, {
|
|
1229
1227
|
className: "input-" + inputType + " " + (className != null ? className : ''),
|
|
1230
1228
|
name: name,
|
|
1231
1229
|
id: name,
|
|
1232
1230
|
isInvalid: isInvalid,
|
|
1233
|
-
options: options,
|
|
1234
1231
|
onChange: onChange,
|
|
1235
1232
|
onBlur: onBlur,
|
|
1236
1233
|
ref: ref,
|
|
1237
1234
|
disabled: disabled,
|
|
1238
|
-
value: value
|
|
1235
|
+
value: value,
|
|
1236
|
+
defaultValue: defaultValue,
|
|
1237
|
+
label: label
|
|
1239
1238
|
});
|
|
1240
1239
|
|
|
1241
1240
|
case 'multi-select':
|
|
@@ -1286,7 +1285,8 @@ function Input(_ref) {
|
|
|
1286
1285
|
onChange: onChange,
|
|
1287
1286
|
onBlur: onBlur,
|
|
1288
1287
|
ref: ref,
|
|
1289
|
-
value: value
|
|
1288
|
+
value: value,
|
|
1289
|
+
defaultValue: defaultValue
|
|
1290
1290
|
});
|
|
1291
1291
|
|
|
1292
1292
|
default:
|
|
@@ -1609,10 +1609,10 @@ function Table(_ref) {
|
|
|
1609
1609
|
border: "none",
|
|
1610
1610
|
overflowX: "auto",
|
|
1611
1611
|
bg: "white",
|
|
1612
|
-
width: "
|
|
1612
|
+
width: "100%"
|
|
1613
1613
|
}, /*#__PURE__*/React__default.createElement(react.Table, {
|
|
1614
1614
|
variant: "unstyled",
|
|
1615
|
-
width: "
|
|
1615
|
+
width: "100%",
|
|
1616
1616
|
style: {
|
|
1617
1617
|
borderCollapse: 'separate',
|
|
1618
1618
|
borderSpacing: '0px'
|