@datability/8ui 0.1.17 → 0.1.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/components/Blackdrop/index.js +1 -1
- package/dist/components/Blackdrop/index.scss +1 -1
- package/dist/components/Button/index.js +3 -3
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/index.scss +18 -0
- package/dist/components/Button/index.type.d.ts +1 -0
- package/dist/components/Chip/index.js +6 -6
- package/dist/components/Chip/index.scss +2 -2
- package/dist/components/Input/InputAutoComplete/index.js +2 -2
- package/dist/components/Input/InputAutoComplete/index.scss +2 -2
- package/dist/components/Input/InputBase/index.js +3 -3
- package/dist/components/Input/InputBase/index.scss +2 -2
- package/dist/components/Input/InputBasic/index.js +1 -1
- package/dist/components/Input/InputCheckbox/index.js +1 -1
- package/dist/components/Input/InputCheckbox/index.scss +1 -1
- package/dist/components/Input/InputDateRangePicker/index.js +1 -1
- package/dist/components/Input/InputDateRangePicker/index.scss +1 -1
- package/dist/components/Input/InputNumber/index.js +1 -1
- package/dist/components/Input/InputPassword/index.js +1 -1
- package/dist/components/Input/InputRadio/index.js +1 -1
- package/dist/components/Input/InputRadio/index.scss +1 -1
- package/dist/components/Input/InputSelect/index.js +4 -4
- package/dist/components/Input/InputSelect/index.scss +5 -5
- package/dist/components/Input/InputTextarea/index.js +1 -1
- package/dist/components/Input/extend.scss +1 -1
- package/dist/components/InputNonContext/InputSwitch/index.d.ts +5 -0
- package/dist/components/InputNonContext/InputSwitch/index.js +19 -0
- package/dist/components/InputNonContext/InputSwitch/index.js.map +1 -0
- package/dist/components/InputNonContext/InputSwitch/index.scss +84 -0
- package/dist/components/InputNonContext/InputSwitch/index.type.d.ts +6 -0
- package/dist/components/InputNonContext/InputSwitch/index.type.js +2 -0
- package/dist/components/InputNonContext/InputSwitch/index.type.js.map +1 -0
- package/dist/components/Menu/index.js +2 -2
- package/dist/components/Menu/index.scss +1 -1
- package/dist/components/Modal/index.js +3 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import './index.scss';
|
|
6
6
|
var Blackdrop = function (_a) {
|
|
7
7
|
var children = _a.children, open = _a.open;
|
|
8
|
-
return (React.createElement("div", { className: "DBui-blackdrop", "
|
|
8
|
+
return (React.createElement("div", { className: "DBui-blackdrop", "data-hidden": !open }, children));
|
|
9
9
|
};
|
|
10
10
|
export default Blackdrop;
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,13 +4,13 @@ import React from 'react';
|
|
|
4
4
|
// Include in project
|
|
5
5
|
import './index.scss';
|
|
6
6
|
var Button = function (_a) {
|
|
7
|
-
var name = _a.name, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onClick = _a.onClick, StartIcon = _a.startIcon, EndIcon = _a.endIcon, className = _a.className, style = _a.style;
|
|
8
|
-
return (React.createElement("button", { type: type, className: "DBui-button ".concat(className ? className : ''), onClick: onClick && onClick, disabled: disabled, style: style ? style : {} },
|
|
7
|
+
var name = _a.name, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, onClick = _a.onClick, StartIcon = _a.startIcon, EndIcon = _a.endIcon, className = _a.className, style = _a.style, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d;
|
|
8
|
+
return (React.createElement("button", { type: type, className: "DBui-button ".concat(className ? className : ''), onClick: onClick && onClick, disabled: isLoading || disabled, style: style ? style : {} }, isLoading ? (React.createElement("div", { className: "DBui-loaderSpinButton" })) : (React.createElement(React.Fragment, null,
|
|
9
9
|
StartIcon && typeof StartIcon === 'string' && React.createElement("img", { src: StartIcon, alt: "startIcon" }),
|
|
10
10
|
StartIcon && typeof StartIcon !== 'string' && React.createElement(StartIcon, { alt: "startIcon" }),
|
|
11
11
|
name,
|
|
12
12
|
EndIcon && typeof EndIcon === 'string' && React.createElement("img", { src: EndIcon, alt: "endIcon" }),
|
|
13
|
-
EndIcon && typeof EndIcon !== 'string' && React.createElement(EndIcon, { alt: "endIcon" })));
|
|
13
|
+
EndIcon && typeof EndIcon !== 'string' && React.createElement(EndIcon, { alt: "endIcon" })))));
|
|
14
14
|
};
|
|
15
15
|
export default Button;
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,SAAS;AAET,qBAAqB;AACrB,OAAO,cAAc,CAAA;AAGrB,IAAM,MAAM,GAA0B,UAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,SAAS;AAET,qBAAqB;AACrB,OAAO,cAAc,CAAA;AAGrB,IAAM,MAAM,GAA0B,UAAC,EAUtC;QATC,IAAI,UAAA,EACJ,YAAe,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,OAAO,aAAA,EACI,SAAS,eAAA,EACX,OAAO,aAAA,EAChB,SAAS,eAAA,EACT,KAAK,WAAA,EACL,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA;IAEjB,OAAO,CACL,gCACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,sBAAe,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAE,EACtD,OAAO,EAAE,OAAO,IAAI,OAAO,EAC3B,QAAQ,EAAE,SAAS,IAAI,QAAQ,EAC/B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAExB,SAAS,CAAC,CAAC,CAAC,CACX,6BAAK,SAAS,EAAC,uBAAuB,GAAG,CAC1C,CAAC,CAAC,CAAC,CACF;QACG,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,6BAAK,GAAG,EAAE,SAAS,EAAE,GAAG,EAAC,WAAW,GAAG;QACrF,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,oBAAC,SAAS,IAAC,GAAG,EAAC,WAAW,GAAG;QAC3E,IAAI;QACJ,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,6BAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,GAAG;QAC7E,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,oBAAC,OAAO,IAAC,GAAG,EAAC,SAAS,GAAG,CACnE,CACJ,CACM,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -19,4 +19,22 @@
|
|
|
19
19
|
cursor: not-allowed;
|
|
20
20
|
opacity: 0.5;
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
.DBui-loaderSpinButton {
|
|
24
|
+
width: 30px;
|
|
25
|
+
height: 30px;
|
|
26
|
+
border: 3px solid #aaaaae;
|
|
27
|
+
border-bottom-color: #FFFFFF;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
animation: rotation 1s linear infinite;
|
|
30
|
+
|
|
31
|
+
@keyframes rotation {
|
|
32
|
+
0% {
|
|
33
|
+
transform: rotate(0deg);
|
|
34
|
+
}
|
|
35
|
+
100% {
|
|
36
|
+
transform: rotate(360deg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
22
40
|
}
|
|
@@ -6,13 +6,13 @@ import closedSVG from '../assets/closed.svg';
|
|
|
6
6
|
import './index.scss';
|
|
7
7
|
var Chip = function (_a) {
|
|
8
8
|
var label = _a.label, onDelete = _a.onDelete, onClick = _a.onClick, Icon = _a.icon, className = _a.className, style = _a.style;
|
|
9
|
-
return (React.createElement("div", { className: "DBui-chip ".concat(className ? className : ''), style: style ? style : {}, "
|
|
9
|
+
return (React.createElement("div", { className: "DBui-chip ".concat(className ? className : ''), style: style ? style : {}, "data-checked": Boolean(onClick), onClick: onClick && onClick },
|
|
10
10
|
label,
|
|
11
|
-
onDelete && !Icon && (React.createElement("img", { src: closedSVG, alt: "icon", className: "DBui-chipIcon", "
|
|
12
|
-
onDelete && Icon && typeof Icon === 'string' && (React.createElement("img", { src: Icon, alt: "icon", className: "DBui-chipIcon", "
|
|
13
|
-
onDelete && Icon && typeof Icon !== 'string' && (React.createElement(Icon, { alt: "icon", className: "DBui-chipIcon", "
|
|
14
|
-
!onDelete && Icon && typeof Icon === 'string' && (React.createElement("img", { src: Icon, alt: "icon", className: "DBui-chipIcon", "
|
|
15
|
-
!onDelete && Icon && typeof Icon !== 'string' && (React.createElement(Icon, { alt: "icon", className: "DBui-chipIcon", "
|
|
11
|
+
onDelete && !Icon && (React.createElement("img", { src: closedSVG, alt: "icon", className: "DBui-chipIcon", "data-checked": Boolean(onDelete), onClick: onDelete })),
|
|
12
|
+
onDelete && Icon && typeof Icon === 'string' && (React.createElement("img", { src: Icon, alt: "icon", className: "DBui-chipIcon", "data-checked": Boolean(onDelete), onClick: onDelete })),
|
|
13
|
+
onDelete && Icon && typeof Icon !== 'string' && (React.createElement(Icon, { alt: "icon", className: "DBui-chipIcon", "data-checked": Boolean(onDelete), onClick: onDelete })),
|
|
14
|
+
!onDelete && Icon && typeof Icon === 'string' && (React.createElement("img", { src: Icon, alt: "icon", className: "DBui-chipIcon", "data-checked": Boolean(onDelete), onClick: onDelete })),
|
|
15
|
+
!onDelete && Icon && typeof Icon !== 'string' && (React.createElement(Icon, { alt: "icon", className: "DBui-chipIcon", "data-checked": Boolean(onDelete), onClick: onDelete }))));
|
|
16
16
|
};
|
|
17
17
|
export default Chip;
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
background-color: #618aea;
|
|
9
9
|
gap: 0.5em;
|
|
10
10
|
|
|
11
|
-
&[
|
|
11
|
+
&[data-checked='true'] {
|
|
12
12
|
cursor: pointer;
|
|
13
13
|
|
|
14
14
|
&:hover {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
width: 20px;
|
|
21
21
|
height: 20px;
|
|
22
22
|
|
|
23
|
-
&[
|
|
23
|
+
&[data-checked='true'] {
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
|
|
26
26
|
&:hover {
|
|
@@ -41,7 +41,7 @@ var InputAutoComplete = function (_a) {
|
|
|
41
41
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
42
42
|
React.createElement(Menu, { disabled: disabled, trigger: function () {
|
|
43
43
|
var _a;
|
|
44
|
-
return (React.createElement("div", { className: "DBui-wrapInputAutoComplete", "
|
|
44
|
+
return (React.createElement("div", { className: "DBui-wrapInputAutoComplete", "data-invalid": isInvalid, "data-disabled": disabled },
|
|
45
45
|
isMultiple &&
|
|
46
46
|
getIn(values, name).map(function (data, index) {
|
|
47
47
|
var selected = options.find(function (e) { return e.value === data; });
|
|
@@ -55,7 +55,7 @@ var InputAutoComplete = function (_a) {
|
|
|
55
55
|
React.createElement("input", { className: "DBui-inputAutoComplete", type: "text", placeholder: !((_a = getIn(values, name)) === null || _a === void 0 ? void 0 : _a.length) ? placeholder : '', disabled: disabled, name: name, value: isMultiple ? searchText : getIn(values, name)[0] || '', onChange: function (e) { return handleChange(e.target.value); } })));
|
|
56
56
|
} }, suggestions.map(function (data, index) {
|
|
57
57
|
var isChecked = Boolean(getIn(values, name).find(function (ele) { return ele === data.value; }));
|
|
58
|
-
return (React.createElement("p", { key: index, className: "DBui-menuItemInputAutoComplete", onClick: function () { return !isChecked && handleClickSelectOption(data.value); }, "
|
|
58
|
+
return (React.createElement("p", { key: index, className: "DBui-menuItemInputAutoComplete", onClick: function () { return !isChecked && handleClickSelectOption(data.value); }, "data-checked": isChecked }, data.label));
|
|
59
59
|
}))));
|
|
60
60
|
};
|
|
61
61
|
export default InputAutoComplete;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
gap: 0.3em;
|
|
10
10
|
height: 36px;
|
|
11
11
|
|
|
12
|
-
&[
|
|
12
|
+
&[data-disabled='true'] {
|
|
13
13
|
@extend .DBui-disabled;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
background-color: #FAFAFA;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
&[
|
|
49
|
+
&[data-checked='true'] {
|
|
50
50
|
background-color: #6F5EE0;
|
|
51
51
|
color: #FFFFFF;
|
|
52
52
|
}
|
|
@@ -10,13 +10,13 @@ var InputBase = function (_a) {
|
|
|
10
10
|
var styleDiv = {
|
|
11
11
|
width: !fullWidth ? 'fit-content' : '100%'
|
|
12
12
|
};
|
|
13
|
-
return (React.createElement("div", { className: "DBui-inputBase", style: styleDiv, "
|
|
13
|
+
return (React.createElement("div", { className: "DBui-inputBase", style: styleDiv, "data-invalid": isInvalid },
|
|
14
14
|
label && (React.createElement("p", { className: "DBui-inputLabel" },
|
|
15
15
|
React.createElement("small", null, label),
|
|
16
16
|
" ",
|
|
17
|
-
React.createElement("span", { className: "DBui-
|
|
17
|
+
React.createElement("span", { className: "DBui-dataInvalid" }, require && '*'))),
|
|
18
18
|
children,
|
|
19
|
-
getIn(touched, name) && getIn(errors, name) && (React.createElement("p", { className: "DBui-
|
|
19
|
+
getIn(touched, name) && getIn(errors, name) && (React.createElement("p", { className: "DBui-dataInvalid" },
|
|
20
20
|
React.createElement("small", null, getIn(errors, name))))));
|
|
21
21
|
};
|
|
22
22
|
export default InputBase;
|
|
@@ -10,7 +10,7 @@ var Input = function (_a) {
|
|
|
10
10
|
var _f = useFormikContext(), values = _f.values, touched = _f.touched, errors = _f.errors, handleChange = _f.handleChange;
|
|
11
11
|
var isInvalid = getIn(touched, name) && Boolean(getIn(errors, name));
|
|
12
12
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
13
|
-
React.createElement("input", { className: "DBui-inputBasic", type: type, placeholder: placeholder, disabled: disabled, value: getIn(values, name), onChange: handleChange, name: name, "
|
|
13
|
+
React.createElement("input", { className: "DBui-inputBasic", type: type, placeholder: placeholder, disabled: disabled, value: getIn(values, name), onChange: handleChange, name: name, "data-invalid": isInvalid })));
|
|
14
14
|
};
|
|
15
15
|
export default Input;
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -12,7 +12,7 @@ var InputCheckbox = function (_a) {
|
|
|
12
12
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
13
13
|
React.createElement("div", { className: "DBui-wrapInputCheckboxList" }, options.map(function (data, index) { return (React.createElement("div", { key: index, className: "DBui-wrapInputCheckbox" },
|
|
14
14
|
React.createElement("input", { className: "DBui-inputCheckbox", type: "checkbox", disabled: disabled, value: data.value, onChange: handleChange, name: name, checked: getIn(values, name).includes(data.value) }),
|
|
15
|
-
React.createElement("p", { className: "DBui-labelCheckbox", "
|
|
15
|
+
React.createElement("p", { className: "DBui-labelCheckbox", "data-invalid": isInvalid },
|
|
16
16
|
React.createElement("small", null, data.label)))); }))));
|
|
17
17
|
};
|
|
18
18
|
export default InputCheckbox;
|
|
@@ -13,7 +13,7 @@ var InputDateRangePicker = function (_a) {
|
|
|
13
13
|
var _f = getIn(values, name), startDate = _f[0], endDate = _f[1];
|
|
14
14
|
var isInvalid = getIn(touched, name) && Boolean(getIn(errors, name));
|
|
15
15
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
16
|
-
React.createElement("div", { className: "react-datepicler-custom", "
|
|
16
|
+
React.createElement("div", { className: "react-datepicler-custom", "data-invalid": isInvalid },
|
|
17
17
|
React.createElement(DatePicker, { selectsRange: true, startDate: startDate, endDate: endDate, onChange: function (update) {
|
|
18
18
|
setFieldValue(name, update);
|
|
19
19
|
}, disabled: disabled, placeholderText: placeholder }))));
|
|
@@ -43,7 +43,7 @@ var InputNumber = function (_a) {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
46
|
-
React.createElement("input", { className: "DBui-inputNumber", type: "text", placeholder: placeholder, disabled: disabled, value: showValue, onChange: handleChange, name: name, pattern: "[0-9]*\\.?[0-9]*", "
|
|
46
|
+
React.createElement("input", { className: "DBui-inputNumber", type: "text", placeholder: placeholder, disabled: disabled, value: showValue, onChange: handleChange, name: name, pattern: "[0-9]*\\.?[0-9]*", "data-invalid": isInvalid })));
|
|
47
47
|
};
|
|
48
48
|
export default InputNumber;
|
|
49
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -14,7 +14,7 @@ var InputPassword = function (_a) {
|
|
|
14
14
|
var _f = useState(false), isShow = _f[0], setIsShow = _f[1];
|
|
15
15
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
16
16
|
React.createElement("div", { className: "DBui-wrapInputPassword" },
|
|
17
|
-
React.createElement("input", { className: "DBui-inputPassword", type: isShow ? 'text' : 'password', placeholder: placeholder, disabled: disabled, value: getIn(values, name), onChange: handleChange, name: name, "
|
|
17
|
+
React.createElement("input", { className: "DBui-inputPassword", type: isShow ? 'text' : 'password', placeholder: placeholder, disabled: disabled, value: getIn(values, name), onChange: handleChange, name: name, "data-invalid": isInvalid }),
|
|
18
18
|
React.createElement("img", { className: "DBui-inputPasswordIcon", src: isShow ? visibilitySVG : visibilityOffSVG, onClick: function () { return setIsShow(!isShow); } }))));
|
|
19
19
|
};
|
|
20
20
|
export default InputPassword;
|
|
@@ -12,7 +12,7 @@ var InputRadio = function (_a) {
|
|
|
12
12
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
13
13
|
React.createElement("div", { className: "DBui-wrapInputRadioList" }, options.map(function (data, index) { return (React.createElement("div", { key: index, className: "DBui-wrapInputRadio" },
|
|
14
14
|
React.createElement("input", { className: "DBui-inputRadio", type: "radio", disabled: disabled, value: data.value, onChange: handleChange, name: name, checked: getIn(values, name) === data.value }),
|
|
15
|
-
React.createElement("p", { className: "DBui-labelRadio", "
|
|
15
|
+
React.createElement("p", { className: "DBui-labelRadio", "data-invalid": isInvalid },
|
|
16
16
|
React.createElement("small", null, data.label)))); }))));
|
|
17
17
|
};
|
|
18
18
|
export default InputRadio;
|
|
@@ -26,15 +26,15 @@ var InputSelect = function (_a) {
|
|
|
26
26
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
27
27
|
React.createElement(Menu, { disabled: disabled, trigger: function (_a) {
|
|
28
28
|
var isOpen = _a.isOpen;
|
|
29
|
-
return (React.createElement("div", { className: "DBui-wrapperInputSelect", "
|
|
29
|
+
return (React.createElement("div", { className: "DBui-wrapperInputSelect", "data-invalid": isInvalid, "data-disabled": disabled },
|
|
30
30
|
React.createElement("div", { className: "DBui-wrapperLabelInputSelect" },
|
|
31
31
|
(selected === null || selected === void 0 ? void 0 : selected.label) ? (React.createElement("p", { className: "DBui-wrapperLabel" },
|
|
32
32
|
React.createElement("small", null, selected === null || selected === void 0 ? void 0 : selected.label))) : (React.createElement("p", { className: "DBui-placeholder" },
|
|
33
33
|
React.createElement("small", null, placeholder))),
|
|
34
|
-
React.createElement("img", { src: closedSVG, className: "DBui-clearIconInputSelect", onClick: handleCleaState, "
|
|
35
|
-
React.createElement("img", { src: expandArrowSVG, className: "DBui-arrowIconInputSelect", "
|
|
34
|
+
React.createElement("img", { src: closedSVG, className: "DBui-clearIconInputSelect", onClick: handleCleaState, "data-hidden": !Boolean(getIn(values, name)) || disabled || notShowClearValue || isHideClearIcon })),
|
|
35
|
+
React.createElement("img", { src: expandArrowSVG, className: "DBui-arrowIconInputSelect", "data-checked": disabled ? true : !isOpen })));
|
|
36
36
|
} }, options.map(function (data, index) {
|
|
37
|
-
return (React.createElement("p", { key: index, className: "DBui-menuItemInputSelect", onClick: function () { return handleClick(data.value); }, "
|
|
37
|
+
return (React.createElement("p", { key: index, className: "DBui-menuItemInputSelect", onClick: function () { return handleClick(data.value); }, "data-checked": (selected === null || selected === void 0 ? void 0 : selected.value) === data.value }, data.label));
|
|
38
38
|
}))));
|
|
39
39
|
};
|
|
40
40
|
export default InputSelect;
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
color: #000000;
|
|
13
13
|
display: flex;
|
|
14
14
|
|
|
15
|
-
&[
|
|
15
|
+
&[data-invalid='true'] {
|
|
16
16
|
border: 1px solid #eb5757;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
&[
|
|
19
|
+
&[data-disabled='true'] {
|
|
20
20
|
@extend .DBui-disabled;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
.DBui-clearIconInputSelect {
|
|
42
42
|
width: 20px;
|
|
43
43
|
|
|
44
|
-
&[
|
|
44
|
+
&[data-hidden='true'] {
|
|
45
45
|
display: none !important;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
transform: translateY(-50%);
|
|
59
59
|
transition: transform 0.2s;
|
|
60
60
|
|
|
61
|
-
&[
|
|
61
|
+
&[data-checked='false'] {
|
|
62
62
|
transform: rotate(180deg) translateY(50%);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
background-color: #fafafa;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
&[
|
|
77
|
+
&[data-checked='true'] {
|
|
78
78
|
background-color: #6f5ee0;
|
|
79
79
|
color: #ffffff;
|
|
80
80
|
}
|
|
@@ -10,7 +10,7 @@ var InputTextarea = function (_a) {
|
|
|
10
10
|
var _g = useFormikContext(), values = _g.values, touched = _g.touched, errors = _g.errors, handleChange = _g.handleChange;
|
|
11
11
|
var isInvalid = getIn(touched, name) && Boolean(getIn(errors, name));
|
|
12
12
|
return (React.createElement(InputBase, { name: name, label: label, require: require, fullWidth: fullWidth, isInvalid: isInvalid },
|
|
13
|
-
React.createElement("textarea", { className: "DBui-inputTextarea", placeholder: placeholder, disabled: disabled, value: getIn(values, name), onChange: handleChange, name: name, rows: rows, cols: cols, "
|
|
13
|
+
React.createElement("textarea", { className: "DBui-inputTextarea", placeholder: placeholder, disabled: disabled, value: getIn(values, name), onChange: handleChange, name: name, rows: rows, cols: cols, "data-invalid": isInvalid })));
|
|
14
14
|
};
|
|
15
15
|
export default InputTextarea;
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Lib
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Images
|
|
4
|
+
// Include in project
|
|
5
|
+
import './index.scss';
|
|
6
|
+
var InputNonContextSwitch = function (_a) {
|
|
7
|
+
var value = _a.value, onChange = _a.onChange, checked = _a.checked, disabled = _a.disabled;
|
|
8
|
+
return (React.createElement("div", { className: "DBui-wrapInputList", "data-disabled": disabled },
|
|
9
|
+
React.createElement("label", { className: "DBui-switch" },
|
|
10
|
+
React.createElement("span", { className: "DBui-minus" }),
|
|
11
|
+
React.createElement("span", { className: "DBui-miniCircle" }),
|
|
12
|
+
React.createElement("input", { type: "checkbox", checked: Boolean(checked), onChange: function (e) {
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
onChange === null || onChange === void 0 ? void 0 : onChange();
|
|
15
|
+
}, disabled: disabled, value: value }),
|
|
16
|
+
React.createElement("span", { className: "DBui-slider" }))));
|
|
17
|
+
};
|
|
18
|
+
export default InputNonContextSwitch;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/InputNonContext/InputSwitch/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,SAAS;AAET,qBAAqB;AACrB,OAAO,cAAc,CAAA;AAGrB,IAAM,qBAAqB,GAAyC,UAAC,EAKpE;QAJC,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,QAAQ,cAAA;IAER,OAAO,CACL,6BAAK,SAAS,EAAC,oBAAoB,mBAAgB,QAAQ;QACzD,+BAAO,SAAS,EAAC,aAAa;YAC5B,8BAAM,SAAS,EAAC,YAAY,GAAQ;YACpC,8BAAM,SAAS,EAAC,iBAAiB,GAAQ;YACzC,+BACE,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,QAAQ,EAAE,UAAC,CAAC;oBACV,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAA;gBACd,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ;YACF,8BAAM,SAAS,EAAC,aAAa,GAAQ,CAC/B,CACJ,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.DBui-switch {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
width: 51px;
|
|
5
|
+
height: 28px;
|
|
6
|
+
|
|
7
|
+
input {
|
|
8
|
+
opacity: 0;
|
|
9
|
+
width: 0;
|
|
10
|
+
height: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.DBui-minus {
|
|
14
|
+
position: absolute;
|
|
15
|
+
height: 9px;
|
|
16
|
+
width: 1px;
|
|
17
|
+
left: 18px;
|
|
18
|
+
bottom: 9px;
|
|
19
|
+
background-color: #1C1C1E;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
border-radius: 999px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.DBui-miniCircle {
|
|
25
|
+
position: absolute;
|
|
26
|
+
border-radius: 100%;
|
|
27
|
+
height: 7px;
|
|
28
|
+
width: 7px;
|
|
29
|
+
right: 11px;
|
|
30
|
+
bottom: 10px;
|
|
31
|
+
box-shadow: 0 0 0px 1px #000000;
|
|
32
|
+
z-index: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.DBui-slider {
|
|
36
|
+
border-radius: 34px;
|
|
37
|
+
|
|
38
|
+
position: absolute;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
top: 0;
|
|
41
|
+
left: 0;
|
|
42
|
+
right: 0;
|
|
43
|
+
bottom: 0;
|
|
44
|
+
background-color: #AAAAAA;
|
|
45
|
+
-webkit-transition: 0.3s cubic-bezier(0.61, -0.01, 0.2, 1.37);
|
|
46
|
+
transition: 0.3s cubic-bezier(0.61, -0.01, 0.2, 1.37);
|
|
47
|
+
|
|
48
|
+
&:before {
|
|
49
|
+
border-radius: 50%;
|
|
50
|
+
z-index: 2;
|
|
51
|
+
|
|
52
|
+
position: absolute;
|
|
53
|
+
content: '';
|
|
54
|
+
height: 20px;
|
|
55
|
+
width: 20px;
|
|
56
|
+
left: 4px;
|
|
57
|
+
bottom: 4px;
|
|
58
|
+
background-color: #1C1C1E;
|
|
59
|
+
box-shadow: 0px 0.31px 10px 0px #00000004;
|
|
60
|
+
-webkit-transition: 0.3s cubic-bezier(0.61, -0.01, 0.2, 1.37);
|
|
61
|
+
transition: 0.3s cubic-bezier(0.61, -0.01, 0.2, 1.37);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
input:checked+.DBui-slider {
|
|
66
|
+
background-color: #6F5EE0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
input:checked+.DBui-slider:before {
|
|
70
|
+
-webkit-transform: translateX(22px);
|
|
71
|
+
-ms-transform: translateX(22px);
|
|
72
|
+
transform: translateX(22px);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.DBui-wrapInputList {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
|
|
79
|
+
&[data-disabled='true'] {
|
|
80
|
+
opacity: 0.6;
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.type.js","sourceRoot":"","sources":["../../../../src/components/InputNonContext/InputSwitch/index.type.tsx"],"names":[],"mappings":""}
|
|
@@ -145,8 +145,8 @@ var Menu = function (_a) {
|
|
|
145
145
|
return (React.createElement("div", { ref: menuRef },
|
|
146
146
|
React.createElement("div", { onClick: handleToggle, className: "cursor", ref: triggerRef }, trigger({ isOpen: isOpen })),
|
|
147
147
|
mounted &&
|
|
148
|
-
createPortal(React.createElement("div", { className: "DBui-wrapperMenuItem", "
|
|
149
|
-
!mounted && (React.createElement("div", { className: "DBui-wrapperMenuItem", "
|
|
148
|
+
createPortal(React.createElement("div", { className: "DBui-wrapperMenuItem", "data-hidden": !(isOpen && !disabled), style: menuStyle, ref: menuItemRef }, children), document.getElementById('root') || document.getElementById('__next')),
|
|
149
|
+
!mounted && (React.createElement("div", { className: "DBui-wrapperMenuItem", "data-hidden": true, style: menuStyle, ref: menuItemRef }, children))));
|
|
150
150
|
};
|
|
151
151
|
export default Menu;
|
|
152
152
|
//# sourceMappingURL=index.js.map
|
|
@@ -53,9 +53,9 @@ var Modal = function (_a) {
|
|
|
53
53
|
var modalElements = document.querySelectorAll('.DBui-modalBase');
|
|
54
54
|
// Convert NodeList to an array to use filter method
|
|
55
55
|
var modalArray = Array.from(modalElements);
|
|
56
|
-
// Filter the array based on
|
|
56
|
+
// Filter the array based on data-hidden attribute
|
|
57
57
|
var showModals = modalArray.filter(function (modal) {
|
|
58
|
-
return modal.getAttribute('
|
|
58
|
+
return modal.getAttribute('data-hidden') === 'false';
|
|
59
59
|
});
|
|
60
60
|
var topLayerShowModal = showModals[showModals.length - 1];
|
|
61
61
|
// Check if the pressed key is the Escape key
|
|
@@ -73,7 +73,7 @@ var Modal = function (_a) {
|
|
|
73
73
|
};
|
|
74
74
|
}, [open]);
|
|
75
75
|
return (React.createElement(Blackdrop, { open: open },
|
|
76
|
-
React.createElement("div", { className: "DBui-modalBase DBui-modalContent", "
|
|
76
|
+
React.createElement("div", { className: "DBui-modalBase DBui-modalContent", "data-hidden": !open, style: styleWidth, ref: modalRef, id: id },
|
|
77
77
|
React.createElement("img", { src: closedSVG, alt: "", className: "DBui-close", onClick: onClose }),
|
|
78
78
|
React.createElement("div", null, children))));
|
|
79
79
|
};
|
|
@@ -27,6 +27,8 @@ export { default as InputSelect } from './Input/InputSelect';
|
|
|
27
27
|
export type { PropsInputSelect } from './Input/InputSelect/index.type';
|
|
28
28
|
export { default as InputAutoComplete } from './Input/InputAutoComplete';
|
|
29
29
|
export type { PropsInputAutoComplete } from './Input/InputAutoComplete/index.type';
|
|
30
|
+
export { default as InputSwitch } from './InputNonContext/InputSwitch';
|
|
31
|
+
export type { PropsInputNonContextSwitch } from './InputNonContext/InputSwitch/index.type';
|
|
30
32
|
export type TValueOption = string | number;
|
|
31
33
|
export type TOption = {
|
|
32
34
|
label: string;
|
package/dist/components/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { default as InputCheckbox } from './Input/InputCheckbox';
|
|
|
13
13
|
export { default as InputTextarea } from './Input/InputTextarea';
|
|
14
14
|
export { default as InputSelect } from './Input/InputSelect';
|
|
15
15
|
export { default as InputAutoComplete } from './Input/InputAutoComplete';
|
|
16
|
+
export { default as InputSwitch } from './InputNonContext/InputSwitch';
|
|
16
17
|
// Context
|
|
17
18
|
export { DBuiContext, DBuiProvider } from './context';
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAG5C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA,CAAC,mCAAmC;AAGtF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AAGxC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA,CAAC,+BAA+B;AAGxE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA,CAAC,kCAAkC;AAG7E,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAG9E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAG5C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA,CAAC,mCAAmC;AAGtF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AAGxC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA,CAAC,+BAA+B;AAGxE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA,CAAC,kCAAkC;AAG7E,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAG9E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAGxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAUtE,UAAU;AACV,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datability/8ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/components/index.js",
|
|
6
6
|
"types": "dist/components/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"start": "
|
|
11
|
+
"start": "react-scripts start",
|
|
12
12
|
"cp-svg": "copyfiles -u 1 src/components/**/*.svg dist/",
|
|
13
13
|
"cp-scss": "copyfiles -u 1 src/components/**/*.scss dist/",
|
|
14
14
|
"cp-scss-2": "copyfiles -u 1 src/components/**/**/*.scss dist/",
|