dtable-ui-component 6.0.6 → 6.0.7
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.
|
@@ -26,17 +26,18 @@ const RGB_COLORS_MAP = {
|
|
|
26
26
|
BLUE: 'b'
|
|
27
27
|
};
|
|
28
28
|
const LOCAL_STORAGE_KEY = 'dtable-color-picker';
|
|
29
|
-
const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((
|
|
30
|
-
|
|
29
|
+
const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
30
|
+
let {
|
|
31
31
|
onToggle,
|
|
32
32
|
popoverStyle,
|
|
33
|
-
color,
|
|
33
|
+
color = '#ffffff',
|
|
34
34
|
defaultColors,
|
|
35
35
|
useProtal,
|
|
36
36
|
target,
|
|
37
37
|
scrollContainerId,
|
|
38
|
-
throttleDelay = 20
|
|
39
|
-
|
|
38
|
+
throttleDelay = 20,
|
|
39
|
+
onSubmit
|
|
40
|
+
} = _ref;
|
|
40
41
|
const initialRgbaColor = (0, _utils.hexToRgba)(color);
|
|
41
42
|
const [value, setValue] = (0, _react.useState)(initialRgbaColor);
|
|
42
43
|
const [hexVal, setHexVal] = (0, _react.useState)((0, _utils.getInitialHexVal)(color));
|
|
@@ -186,7 +187,7 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
186
187
|
const updateValue = newValue => {
|
|
187
188
|
setValue(newValue);
|
|
188
189
|
const submitHex = (0, _utils.rgbaToHex)(newValue);
|
|
189
|
-
|
|
190
|
+
onSubmit(submitHex);
|
|
190
191
|
};
|
|
191
192
|
const onAlphaInputBlur = () => {
|
|
192
193
|
if ((0, _dtableUtils.isEmpty)(alphaVal) || alphaVal < 0 || alphaVal > 100) {
|
|
@@ -348,7 +349,4 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
348
349
|
}
|
|
349
350
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, colorPicker);
|
|
350
351
|
});
|
|
351
|
-
DTableColorPicker.defaultProps = {
|
|
352
|
-
color: '#ffffff'
|
|
353
|
-
};
|
|
354
352
|
var _default = exports.default = DTableColorPicker;
|
package/lib/DTableRadio/index.js
CHANGED
|
@@ -8,34 +8,35 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
require("./index.css");
|
|
11
|
-
function DTableRadio(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
function DTableRadio(_ref) {
|
|
12
|
+
let {
|
|
13
|
+
disabled = false,
|
|
14
|
+
name = 'dtable-radio-input',
|
|
15
|
+
onCheckedChange = () => {},
|
|
16
|
+
className,
|
|
17
|
+
isChecked,
|
|
18
|
+
value,
|
|
19
|
+
label
|
|
20
|
+
} = _ref;
|
|
15
21
|
return /*#__PURE__*/_react.default.createElement("label", {
|
|
16
22
|
className: (0, _classnames.default)('dtable-radio w-100 align-items-center', {
|
|
17
|
-
'dtable-radio-disable':
|
|
23
|
+
'dtable-radio-disable': disabled,
|
|
18
24
|
[className]: className
|
|
19
25
|
})
|
|
20
26
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
21
27
|
type: "radio",
|
|
22
28
|
className: "dtable-radio-input position-absolute",
|
|
23
|
-
checked:
|
|
24
|
-
onChange:
|
|
25
|
-
name:
|
|
26
|
-
value:
|
|
29
|
+
checked: isChecked,
|
|
30
|
+
onChange: disabled ? () => {} : onCheckedChange,
|
|
31
|
+
name: name,
|
|
32
|
+
value: value
|
|
27
33
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
28
34
|
className: (0, _classnames.default)('dtable-radio-indicator position-relative', {
|
|
29
|
-
'dtable-radio-selected-indicator':
|
|
30
|
-
'dtable-radio-indicator-disable':
|
|
35
|
+
'dtable-radio-selected-indicator': isChecked,
|
|
36
|
+
'dtable-radio-indicator-disable': disabled
|
|
31
37
|
})
|
|
32
38
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
33
39
|
className: "dtable-radio-description text-truncate ml-2"
|
|
34
|
-
},
|
|
40
|
+
}, label));
|
|
35
41
|
}
|
|
36
|
-
DTableRadio.defaultProps = {
|
|
37
|
-
disabled: false,
|
|
38
|
-
name: 'dtable-radio-input',
|
|
39
|
-
onCheckedChange: () => {}
|
|
40
|
-
};
|
|
41
42
|
var _default = exports.default = DTableRadio;
|
|
@@ -9,9 +9,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
require("./dtable-select-label.css");
|
|
10
10
|
function DTableSelectLabel(_ref) {
|
|
11
11
|
let {
|
|
12
|
-
classname,
|
|
13
|
-
name,
|
|
14
|
-
isSelect
|
|
12
|
+
classname = '',
|
|
13
|
+
name = '',
|
|
14
|
+
isSelect = false
|
|
15
15
|
} = _ref;
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
17
|
className: "".concat(classname, " w-100 d-flex justify-content-between")
|
|
@@ -21,9 +21,4 @@ function DTableSelectLabel(_ref) {
|
|
|
21
21
|
className: "dtable-font dtable-icon-check-mark"
|
|
22
22
|
})));
|
|
23
23
|
}
|
|
24
|
-
DTableSelectLabel.defaultProps = {
|
|
25
|
-
classname: '',
|
|
26
|
-
name: '',
|
|
27
|
-
isSelect: false
|
|
28
|
-
};
|
|
29
24
|
var _default = exports.default = DTableSelectLabel;
|
|
@@ -9,16 +9,16 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
11
|
require("./index.css");
|
|
12
|
-
function DTableSwitch(
|
|
13
|
-
|
|
12
|
+
function DTableSwitch(_ref) {
|
|
13
|
+
let {
|
|
14
14
|
onChange,
|
|
15
|
-
checked,
|
|
15
|
+
checked = false,
|
|
16
16
|
placeholder,
|
|
17
17
|
disabled,
|
|
18
|
-
size,
|
|
19
|
-
switchPosition,
|
|
18
|
+
size = 'sm',
|
|
19
|
+
switchPosition = 'right',
|
|
20
20
|
switchClassName
|
|
21
|
-
} =
|
|
21
|
+
} = _ref;
|
|
22
22
|
const switchNode = /*#__PURE__*/_react.default.createElement("span", {
|
|
23
23
|
className: "custom-switch-indicator"
|
|
24
24
|
});
|
|
@@ -46,9 +46,4 @@ function DTableSwitch(props) {
|
|
|
46
46
|
id: 'dtable-switch-' + (0, _dtableUtils.generatorBase64Code)(12)
|
|
47
47
|
}), switchPosition === 'left' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, switchNode, textNode), switchPosition === 'right' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, textNode, switchNode)));
|
|
48
48
|
}
|
|
49
|
-
DTableSwitch.defaultProps = {
|
|
50
|
-
checked: false,
|
|
51
|
-
size: 'sm',
|
|
52
|
-
switchPosition: 'right'
|
|
53
|
-
};
|
|
54
49
|
var _default = exports.default = DTableSwitch;
|
|
@@ -10,13 +10,13 @@ var _dtableUtils = require("dtable-utils");
|
|
|
10
10
|
var _constants = require("../constants");
|
|
11
11
|
var _lang = require("../../lang");
|
|
12
12
|
require("./index.css");
|
|
13
|
-
function SelectedDepartments(
|
|
14
|
-
|
|
13
|
+
function SelectedDepartments(_ref) {
|
|
14
|
+
let {
|
|
15
15
|
value,
|
|
16
16
|
removeDepartment,
|
|
17
|
-
isShowRemoveIcon,
|
|
18
|
-
departments
|
|
19
|
-
} =
|
|
17
|
+
isShowRemoveIcon = false,
|
|
18
|
+
departments = []
|
|
19
|
+
} = _ref;
|
|
20
20
|
const idDepartmentMap = (0, _react.useMemo)(() => {
|
|
21
21
|
let idDepartmentMap = {};
|
|
22
22
|
departments.forEach(department => {
|
|
@@ -81,8 +81,4 @@ function SelectedDepartments(props) {
|
|
|
81
81
|
}) : null;
|
|
82
82
|
return dom;
|
|
83
83
|
}
|
|
84
|
-
SelectedDepartments.defaultProps = {
|
|
85
|
-
isShowRemoveIcon: false,
|
|
86
|
-
departments: []
|
|
87
|
-
};
|
|
88
84
|
var _default = exports.default = SelectedDepartments;
|