@datability/8ui 0.1.68 → 1.0.0
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 +68 -18
- package/dist/assets/index-BYmsRLQS.js +48 -0
- package/dist/assets/index-QxCDX2bt.css +1 -0
- package/dist/index.html +14 -0
- package/dist/vite.svg +1 -0
- package/package.json +29 -27
- package/dist/components/Blackdrop/index.d.ts +0 -5
- package/dist/components/Blackdrop/index.js +0 -11
- package/dist/components/Blackdrop/index.js.map +0 -1
- package/dist/components/Blackdrop/index.scss +0 -16
- package/dist/components/Blackdrop/index.type.d.ts +0 -6
- package/dist/components/Blackdrop/index.type.js +0 -2
- package/dist/components/Blackdrop/index.type.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -5
- package/dist/components/Button/index.js +0 -16
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Button/index.scss +0 -40
- package/dist/components/Button/index.type.d.ts +0 -12
- package/dist/components/Button/index.type.js +0 -2
- package/dist/components/Button/index.type.js.map +0 -1
- package/dist/components/Chip/index.d.ts +0 -5
- package/dist/components/Chip/index.js +0 -18
- package/dist/components/Chip/index.js.map +0 -1
- package/dist/components/Chip/index.scss +0 -32
- package/dist/components/Chip/index.type.d.ts +0 -9
- package/dist/components/Chip/index.type.js +0 -2
- package/dist/components/Chip/index.type.js.map +0 -1
- package/dist/components/Divider/index.d.ts +0 -4
- package/dist/components/Divider/index.js +0 -10
- package/dist/components/Divider/index.js.map +0 -1
- package/dist/components/Divider/index.scss +0 -4
- package/dist/components/Input/InputAutoComplete/index.d.ts +0 -5
- package/dist/components/Input/InputAutoComplete/index.js +0 -68
- package/dist/components/Input/InputAutoComplete/index.js.map +0 -1
- package/dist/components/Input/InputAutoComplete/index.scss +0 -53
- package/dist/components/Input/InputAutoComplete/index.type.d.ts +0 -12
- package/dist/components/Input/InputAutoComplete/index.type.js +0 -2
- package/dist/components/Input/InputAutoComplete/index.type.js.map +0 -1
- package/dist/components/Input/InputBase/index.d.ts +0 -5
- package/dist/components/Input/InputBase/index.js +0 -23
- package/dist/components/Input/InputBase/index.js.map +0 -1
- package/dist/components/Input/InputBase/index.scss +0 -14
- package/dist/components/Input/InputBase/index.type.d.ts +0 -9
- package/dist/components/Input/InputBase/index.type.js +0 -2
- package/dist/components/Input/InputBase/index.type.js.map +0 -1
- package/dist/components/Input/InputBasic/index.d.ts +0 -5
- package/dist/components/Input/InputBasic/index.js +0 -16
- package/dist/components/Input/InputBasic/index.js.map +0 -1
- package/dist/components/Input/InputBasic/index.scss +0 -9
- package/dist/components/Input/InputBasic/index.type.d.ts +0 -10
- package/dist/components/Input/InputBasic/index.type.js +0 -2
- package/dist/components/Input/InputBasic/index.type.js.map +0 -1
- package/dist/components/Input/InputCheckbox/index.d.ts +0 -5
- package/dist/components/Input/InputCheckbox/index.js +0 -19
- package/dist/components/Input/InputCheckbox/index.js.map +0 -1
- package/dist/components/Input/InputCheckbox/index.scss +0 -30
- package/dist/components/Input/InputCheckbox/index.type.d.ts +0 -11
- package/dist/components/Input/InputCheckbox/index.type.js +0 -2
- package/dist/components/Input/InputCheckbox/index.type.js.map +0 -1
- package/dist/components/Input/InputDate/index.d.ts +0 -23
- package/dist/components/Input/InputDate/index.js +0 -190
- package/dist/components/Input/InputDate/index.js.map +0 -1
- package/dist/components/Input/InputDate/index.scss +0 -102
- package/dist/components/Input/InputDate/index.type.d.ts +0 -11
- package/dist/components/Input/InputDate/index.type.js +0 -2
- package/dist/components/Input/InputDate/index.type.js.map +0 -1
- package/dist/components/Input/InputDateRange/index.d.ts +0 -5
- package/dist/components/Input/InputDateRange/index.js +0 -137
- package/dist/components/Input/InputDateRange/index.js.map +0 -1
- package/dist/components/Input/InputDateRange/index.scss +0 -101
- package/dist/components/Input/InputDateRange/index.type.d.ts +0 -11
- package/dist/components/Input/InputDateRange/index.type.js +0 -2
- package/dist/components/Input/InputDateRange/index.type.js.map +0 -1
- package/dist/components/Input/InputDateTime/index.d.ts +0 -5
- package/dist/components/Input/InputDateTime/index.js +0 -185
- package/dist/components/Input/InputDateTime/index.js.map +0 -1
- package/dist/components/Input/InputDateTime/index.scss +0 -179
- package/dist/components/Input/InputDateTime/index.type.d.ts +0 -11
- package/dist/components/Input/InputDateTime/index.type.js +0 -2
- package/dist/components/Input/InputDateTime/index.type.js.map +0 -1
- package/dist/components/Input/InputNumber/index.d.ts +0 -5
- package/dist/components/Input/InputNumber/index.js +0 -78
- package/dist/components/Input/InputNumber/index.js.map +0 -1
- package/dist/components/Input/InputNumber/index.scss +0 -9
- package/dist/components/Input/InputNumber/index.type.d.ts +0 -10
- package/dist/components/Input/InputNumber/index.type.js +0 -2
- package/dist/components/Input/InputNumber/index.type.js.map +0 -1
- package/dist/components/Input/InputPassword/index.d.ts +0 -5
- package/dist/components/Input/InputPassword/index.js +0 -21
- package/dist/components/Input/InputPassword/index.js.map +0 -1
- package/dist/components/Input/InputPassword/index.scss +0 -22
- package/dist/components/Input/InputPassword/index.type.d.ts +0 -8
- package/dist/components/Input/InputPassword/index.type.js +0 -2
- package/dist/components/Input/InputPassword/index.type.js.map +0 -1
- package/dist/components/Input/InputRadio/index.d.ts +0 -5
- package/dist/components/Input/InputRadio/index.js +0 -19
- package/dist/components/Input/InputRadio/index.js.map +0 -1
- package/dist/components/Input/InputRadio/index.scss +0 -35
- package/dist/components/Input/InputRadio/index.type.d.ts +0 -12
- package/dist/components/Input/InputRadio/index.type.js +0 -2
- package/dist/components/Input/InputRadio/index.type.js.map +0 -1
- package/dist/components/Input/InputSelect/index.d.ts +0 -5
- package/dist/components/Input/InputSelect/index.js +0 -45
- package/dist/components/Input/InputSelect/index.js.map +0 -1
- package/dist/components/Input/InputSelect/index.scss +0 -81
- package/dist/components/Input/InputSelect/index.type.d.ts +0 -14
- package/dist/components/Input/InputSelect/index.type.js +0 -2
- package/dist/components/Input/InputSelect/index.type.js.map +0 -1
- package/dist/components/Input/InputTextarea/index.d.ts +0 -5
- package/dist/components/Input/InputTextarea/index.js +0 -16
- package/dist/components/Input/InputTextarea/index.js.map +0 -1
- package/dist/components/Input/InputTextarea/index.scss +0 -10
- package/dist/components/Input/InputTextarea/index.type.d.ts +0 -10
- package/dist/components/Input/InputTextarea/index.type.js +0 -2
- package/dist/components/Input/InputTextarea/index.type.js.map +0 -1
- package/dist/components/Input/extend.scss +0 -19
- package/dist/components/InputNonContext/InputSwitch/index.d.ts +0 -5
- package/dist/components/InputNonContext/InputSwitch/index.js +0 -19
- package/dist/components/InputNonContext/InputSwitch/index.js.map +0 -1
- package/dist/components/InputNonContext/InputSwitch/index.scss +0 -84
- package/dist/components/InputNonContext/InputSwitch/index.type.d.ts +0 -6
- package/dist/components/InputNonContext/InputSwitch/index.type.js +0 -2
- package/dist/components/InputNonContext/InputSwitch/index.type.js.map +0 -1
- package/dist/components/Menu/index.d.ts +0 -5
- package/dist/components/Menu/index.js +0 -103
- package/dist/components/Menu/index.js.map +0 -1
- package/dist/components/Menu/index.scss +0 -30
- package/dist/components/Menu/index.type.d.ts +0 -11
- package/dist/components/Menu/index.type.js +0 -2
- package/dist/components/Menu/index.type.js.map +0 -1
- package/dist/components/Modal/index.d.ts +0 -5
- package/dist/components/Modal/index.js +0 -83
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/index.scss +0 -33
- package/dist/components/Modal/index.type.d.ts +0 -7
- package/dist/components/Modal/index.type.js +0 -2
- package/dist/components/Modal/index.type.js.map +0 -1
- package/dist/components/assets/closed.svg +0 -4
- package/dist/components/assets/expandArrow.svg +0 -3
- package/dist/components/assets/visibility.svg +0 -5
- package/dist/components/assets/visibilityOff.svg +0 -5
- package/dist/components/context.d.ts +0 -8
- package/dist/components/context.js +0 -12
- package/dist/components/context.js.map +0 -1
- package/dist/components/index.d.ts +0 -41
- package/dist/components/index.js +0 -21
- package/dist/components/index.js.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Lib
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { getIn, useFormikContext } from 'formik';
|
|
4
|
-
// Images
|
|
5
|
-
// Include in project
|
|
6
|
-
import './index.scss';
|
|
7
|
-
import InputBase from '../InputBase';
|
|
8
|
-
var InputTextarea = function (_a) {
|
|
9
|
-
var name = _a.name, label = _a.label, placeholder = _a.placeholder, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.require, require = _c === void 0 ? false : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, _e = _a.rows, rows = _e === void 0 ? 2 : _e, _f = _a.cols, cols = _f === void 0 ? 50 : _f;
|
|
10
|
-
var _g = useFormikContext(), values = _g.values, touched = _g.touched, errors = _g.errors, handleChange = _g.handleChange;
|
|
11
|
-
var isInvalid = getIn(touched, name) && Boolean(getIn(errors, name));
|
|
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, "data-invalid": isInvalid })));
|
|
14
|
-
};
|
|
15
|
-
export default InputTextarea;
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Input/InputTextarea/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAEhD,SAAS;AAET,qBAAqB;AACrB,OAAO,cAAc,CAAA;AACrB,OAAO,SAAS,MAAM,cAAc,CAAA;AAGpC,IAAM,aAAa,GAAiC,UAAC,EASpD;QARC,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA,EACf,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EACR,YAAS,EAAT,IAAI,mBAAG,EAAE,KAAA;IAEH,IAAA,KAA4C,gBAAgB,EAAE,EAA5D,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,YAAY,kBAAuB,CAAA;IACpE,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAEtE,OAAO,CACL,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QAC/F,kCACE,SAAS,EAAC,oBAAoB,EAC9B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,EAC1B,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,kBACI,SAAS,GACvB,CACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.js","sourceRoot":"","sources":["../../../../src/components/Input/InputTextarea/index.type.tsx"],"names":[],"mappings":""}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Disable
|
|
2
|
-
.DBui-disabled {
|
|
3
|
-
cursor: not-allowed;
|
|
4
|
-
background-color: #FAFAFA;
|
|
5
|
-
color: #000000;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.DBui-input {
|
|
9
|
-
width: 100%;
|
|
10
|
-
padding: 0.3em 0.5em;
|
|
11
|
-
border-radius: 0.3em;
|
|
12
|
-
border: 1px solid #E3E3E8;
|
|
13
|
-
background-color: #FFFFFF;
|
|
14
|
-
color: #000000;
|
|
15
|
-
|
|
16
|
-
&[data-invalid='true'] {
|
|
17
|
-
border: 1px solid #EB5757;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.js","sourceRoot":"","sources":["../../../../src/components/InputNonContext/InputSwitch/index.type.tsx"],"names":[],"mappings":""}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// Lib
|
|
2
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import './index.scss';
|
|
5
|
-
var Menu = function (_a) {
|
|
6
|
-
var children = _a.children, trigger = _a.trigger, disabled = _a.disabled, _b = _a.isInModal, isInModal = _b === void 0 ? false : _b;
|
|
7
|
-
var _c = useState(false), isOpen = _c[0], setIsOpen = _c[1];
|
|
8
|
-
var _d = useState({}), menuStyle = _d[0], setMenuStyle = _d[1];
|
|
9
|
-
var triggerRef = useRef(null);
|
|
10
|
-
var menuRef = useRef(null);
|
|
11
|
-
// Toggle dropdown
|
|
12
|
-
var toggleMenu = function () {
|
|
13
|
-
if (!disabled)
|
|
14
|
-
setIsOpen(function (prev) { return !prev; });
|
|
15
|
-
};
|
|
16
|
-
// ------------ MAIN POSITIONING FUNCTION ------------
|
|
17
|
-
var calculateMenuPosition = function () {
|
|
18
|
-
if (!triggerRef.current || !menuRef.current)
|
|
19
|
-
return;
|
|
20
|
-
var triggerRect = triggerRef.current.getBoundingClientRect();
|
|
21
|
-
var menu = menuRef.current;
|
|
22
|
-
var viewportH = window.innerHeight;
|
|
23
|
-
var viewportW = window.innerWidth;
|
|
24
|
-
var menuWidth = menu.offsetWidth;
|
|
25
|
-
var spaceAbove = triggerRect.top;
|
|
26
|
-
var spaceBelow = viewportH - triggerRect.bottom;
|
|
27
|
-
// วางล่างถ้าพื้นที่ล่างมากกว่า
|
|
28
|
-
var placeBottom = spaceBelow >= spaceAbove;
|
|
29
|
-
var top = placeBottom
|
|
30
|
-
? triggerRect.bottom // show below
|
|
31
|
-
: triggerRect.top - menu.offsetHeight; // show above (height กำหนดจาก CSS max-height)
|
|
32
|
-
// เปลี่ยน logic ตรงนี้ → กันเมนูล้นจอจาก CSS max-height
|
|
33
|
-
// ถ้าด้านบนพื้นที่ไม่พอ ให้ clamp
|
|
34
|
-
if (!placeBottom) {
|
|
35
|
-
var minTop = 8;
|
|
36
|
-
if (top < minTop)
|
|
37
|
-
top = minTop;
|
|
38
|
-
}
|
|
39
|
-
var left = triggerRect.left;
|
|
40
|
-
if (left + menuWidth > viewportW - 8) {
|
|
41
|
-
left = viewportW - menuWidth - 8;
|
|
42
|
-
}
|
|
43
|
-
if (left < 8)
|
|
44
|
-
left = 8;
|
|
45
|
-
setMenuStyle({
|
|
46
|
-
position: 'fixed',
|
|
47
|
-
top: top,
|
|
48
|
-
left: left
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
// ------------ Double RAF (ให้ DOM render ก่อน 100%) ------------
|
|
52
|
-
useEffect(function () {
|
|
53
|
-
if (!isOpen)
|
|
54
|
-
return;
|
|
55
|
-
requestAnimationFrame(function () {
|
|
56
|
-
requestAnimationFrame(function () {
|
|
57
|
-
calculateMenuPosition();
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}, [isOpen, children]);
|
|
61
|
-
// ------------ Reposition when scroll/resize/orientation ------------
|
|
62
|
-
useEffect(function () {
|
|
63
|
-
if (!isOpen)
|
|
64
|
-
return;
|
|
65
|
-
var handler = function () { return calculateMenuPosition(); };
|
|
66
|
-
window.addEventListener('scroll', handler, true);
|
|
67
|
-
window.addEventListener('resize', handler);
|
|
68
|
-
window.addEventListener('orientationchange', handler);
|
|
69
|
-
return function () {
|
|
70
|
-
window.removeEventListener('scroll', handler, true);
|
|
71
|
-
window.removeEventListener('resize', handler);
|
|
72
|
-
window.removeEventListener('orientationchange', handler);
|
|
73
|
-
};
|
|
74
|
-
}, [isOpen, children]);
|
|
75
|
-
// ------------ Close On Click Outside ------------
|
|
76
|
-
useEffect(function () {
|
|
77
|
-
if (!isOpen)
|
|
78
|
-
return;
|
|
79
|
-
var handleClick = function (e) {
|
|
80
|
-
var t = triggerRef.current;
|
|
81
|
-
var m = menuRef.current;
|
|
82
|
-
if (!t || !m)
|
|
83
|
-
return;
|
|
84
|
-
if (!t.contains(e.target) && !m.contains(e.target)) {
|
|
85
|
-
setIsOpen(false);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
document.addEventListener('mousedown', handleClick);
|
|
89
|
-
return function () { return document.removeEventListener('mousedown', handleClick); };
|
|
90
|
-
}, [isOpen]);
|
|
91
|
-
// Portal root
|
|
92
|
-
var portalRoot = document.getElementById('root') || document.getElementById('__next') || document.body;
|
|
93
|
-
return (React.createElement(React.Fragment, null,
|
|
94
|
-
React.createElement("div", { ref: triggerRef, className: "DBui-wrapperMenu", onClick: toggleMenu }, trigger({ isOpen: isOpen })),
|
|
95
|
-
isOpen &&
|
|
96
|
-
createPortal(React.createElement("div", { ref: menuRef, className: "DBui-wrapperMenuItem", style: menuStyle, "data-hidden": !isOpen, "data-is-in-modal": isInModal }, typeof children === 'function'
|
|
97
|
-
? children({
|
|
98
|
-
close: function () { return setIsOpen(false); }
|
|
99
|
-
})
|
|
100
|
-
: children), portalRoot)));
|
|
101
|
-
};
|
|
102
|
-
export default Menu;
|
|
103
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Menu/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,cAAc,CAAA;AAGrB,IAAM,IAAI,GAAwB,UAAC,EAAkD;QAAhD,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA;IAC3E,IAAA,KAAsB,QAAQ,CAAC,KAAK,CAAC,EAApC,MAAM,QAAA,EAAE,SAAS,QAAmB,CAAA;IACrC,IAAA,KAA4B,QAAQ,CAAM,EAAE,CAAC,EAA5C,SAAS,QAA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AAU,CACX,CACF,CACJ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.DBui-wrapperMenu {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.DBui-wrapperMenuItem {
|
|
8
|
-
position: fixed;
|
|
9
|
-
background: #fff;
|
|
10
|
-
color: #000;
|
|
11
|
-
border-radius: 0.3em;
|
|
12
|
-
min-width: 140px;
|
|
13
|
-
max-width: 320px;
|
|
14
|
-
max-height: 45%;
|
|
15
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 4px 12px;
|
|
16
|
-
overflow-y: auto;
|
|
17
|
-
overflow-x: hidden;
|
|
18
|
-
transition: opacity 0.1s ease;
|
|
19
|
-
z-index: var(--z-index-menu);
|
|
20
|
-
|
|
21
|
-
&[data-hidden='true'] {
|
|
22
|
-
opacity: 0;
|
|
23
|
-
visibility: hidden;
|
|
24
|
-
pointer-events: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&[data-is-in-modal='true'] {
|
|
28
|
-
z-index: var(--z-index-menu-in-modal);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.js","sourceRoot":"","sources":["../../../src/components/Menu/index.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Lib
|
|
2
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
3
|
-
//Images
|
|
4
|
-
import closedSVG from '../assets/closed.svg';
|
|
5
|
-
// Include in project
|
|
6
|
-
import './index.scss';
|
|
7
|
-
import Blackdrop from '../Blackdrop';
|
|
8
|
-
import { DBuiContext } from '../context';
|
|
9
|
-
var Modal = function (_a) {
|
|
10
|
-
var children = _a.children, open = _a.open, onClose = _a.onClose, id = _a.id;
|
|
11
|
-
var _b = useContext(DBuiContext), openModalCount = _b.openModalCount, setOpenModalCount = _b.setOpenModalCount;
|
|
12
|
-
var setModalIncress = function () { return setOpenModalCount === null || setOpenModalCount === void 0 ? void 0 : setOpenModalCount(function (prev) { return prev + 1; }); };
|
|
13
|
-
var setModalDecress = function () { return setOpenModalCount === null || setOpenModalCount === void 0 ? void 0 : setOpenModalCount(function (prev) { return prev - 1; }); };
|
|
14
|
-
var setModalZero = function () { return setOpenModalCount === null || setOpenModalCount === void 0 ? void 0 : setOpenModalCount(0); };
|
|
15
|
-
var modalRef = useRef(null);
|
|
16
|
-
// whitelist for portal UI
|
|
17
|
-
var WHITELIST_CLASSES = [
|
|
18
|
-
'DBui-wrapperMenuItem',
|
|
19
|
-
'DBui-inputDateWrapperCalendar',
|
|
20
|
-
'DBui-inputDateRangeRowMonthYearSelected',
|
|
21
|
-
'DBui-inputDateTimeWrapperCalendar',
|
|
22
|
-
];
|
|
23
|
-
useEffect(function () {
|
|
24
|
-
// Update the global counter and adjust the overflow style
|
|
25
|
-
if (open) {
|
|
26
|
-
setModalIncress();
|
|
27
|
-
document.body.style.overflow = 'hidden';
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
if (openModalCount <= 0) {
|
|
31
|
-
setModalZero();
|
|
32
|
-
document.body.style.overflow = 'visible';
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
setModalDecress();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return function () {
|
|
39
|
-
if (openModalCount === 0) {
|
|
40
|
-
document.body.style.overflow = 'visible';
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}, [open]);
|
|
44
|
-
useEffect(function () {
|
|
45
|
-
var modalElements = document.querySelectorAll('.DBui-modalBase');
|
|
46
|
-
var modalArray = Array.from(modalElements);
|
|
47
|
-
var showModals = modalArray.filter(function (modal) { return modal.getAttribute('data-hidden') === 'false'; });
|
|
48
|
-
var topModal = showModals[showModals.length - 1];
|
|
49
|
-
if ((topModal === null || topModal === void 0 ? void 0 : topModal.getAttribute('id')) !== id)
|
|
50
|
-
return;
|
|
51
|
-
// ---------- ESC CLOSE ----------
|
|
52
|
-
function handleKeydown(event) {
|
|
53
|
-
if (event.key === 'Escape' || event.keyCode === 27) {
|
|
54
|
-
onClose();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// ---------- CLICK OUTSIDE CLOSE ----------
|
|
58
|
-
function handleClickOutside(e) {
|
|
59
|
-
var _a;
|
|
60
|
-
var target = e.target;
|
|
61
|
-
// ถ้า click ใน modal → ไม่ปิด
|
|
62
|
-
if ((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))
|
|
63
|
-
return;
|
|
64
|
-
// ถ้า click ใน whitelist (menu, dropdown, select panel)
|
|
65
|
-
var isInWhitelist = WHITELIST_CLASSES.some(function (cls) { return target.closest('.' + cls); });
|
|
66
|
-
if (isInWhitelist)
|
|
67
|
-
return;
|
|
68
|
-
onClose();
|
|
69
|
-
}
|
|
70
|
-
document.addEventListener('keydown', handleKeydown);
|
|
71
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
72
|
-
return function () {
|
|
73
|
-
document.removeEventListener('keydown', handleKeydown);
|
|
74
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
75
|
-
};
|
|
76
|
-
}, [openModalCount]);
|
|
77
|
-
return (React.createElement(Blackdrop, { open: open },
|
|
78
|
-
React.createElement("div", { className: "DBui-modalBase DBui-modalContent", "data-hidden": !open, ref: modalRef, id: id },
|
|
79
|
-
React.createElement("img", { src: closedSVG, alt: "", className: "DBui-close", onClick: onClose }),
|
|
80
|
-
React.createElement("div", null, children))));
|
|
81
|
-
};
|
|
82
|
-
export default Modal;
|
|
83
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAAA,MAAM;AACN,OAAO,K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AwD;YACxD,IAAM,aAAa,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,EAAzB,CAAyB,CAAC,CAAA;YAChF,IAAI,aAAa;gBAAE,OAAM;YAEzB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;QACnD,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;QAE1D,OAAO;YACL,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;YACtD,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;QAC/D,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAA;IAEpB,OAAO,CACL,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI;QACnB,6BAAK,SAAS,EAAC,kCAAkC,iBAAc,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE;YACzF,6BAAK,GAAG,EAAE,SAAS,EAAE,GAAG,EAAC,EAAE,EAAC,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,OAAO,GAAI;YACvE,iCAAM,QAAQ,CAAO,CACjB,CACI,CACb,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
.DBui-modalContent {
|
|
2
|
-
top: 50%;
|
|
3
|
-
left: 50%;
|
|
4
|
-
transform: translate(-50%, -50%);
|
|
5
|
-
position: absolute;
|
|
6
|
-
border-radius: 1em;
|
|
7
|
-
background-color: #FFFFFF;
|
|
8
|
-
box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
|
|
9
|
-
min-width: 320px;
|
|
10
|
-
min-height: 150px;
|
|
11
|
-
overflow-x: hidden;
|
|
12
|
-
overflow-y: scroll;
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
|
|
16
|
-
&::-webkit-scrollbar {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.DBui-close {
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: 10px;
|
|
23
|
-
right: 10px;
|
|
24
|
-
width: 30px;
|
|
25
|
-
height: 30px;
|
|
26
|
-
z-index: var(--z-index-normale);
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
opacity: 0.5;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.js","sourceRoot":"","sources":["../../../src/components/Modal/index.type.tsx"],"names":[],"mappings":""}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M18 6L6 18" stroke="#B1B1B1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
<path d="M6 6L18 18" stroke="#B1B1B1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M4.21967 8.46967C4.51256 8.17678 4.98744 8.17678 5.28033 8.46967L12 15.1893L18.7197 8.46967C19.0126 8.17678 19.4874 8.17678 19.7803 8.46967C20.0732 8.76256 20.0732 9.23744 19.7803 9.53033L12.5303 16.7803C12.2374 17.0732 11.7626 17.0732 11.4697 16.7803L4.21967 9.53033C3.92678 9.23744 3.92678 8.76256 4.21967 8.46967Z" fill="#B1B1B1"/>
|
|
3
|
-
</svg>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="19" height="20" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g opacity="0.2">
|
|
3
|
-
<path d="M18.355 9.75953C18.3291 9.7009 17.7004 8.30633 16.3029 6.90879C14.4407 5.04664 12.0887 4.0625 9.49999 4.0625C6.91124 4.0625 4.55925 5.04664 2.6971 6.90879C1.29956 8.30633 0.667962 9.70313 0.644954 9.75953C0.611194 9.83547 0.59375 9.91764 0.59375 10.0007C0.59375 10.0838 0.611194 10.166 0.644954 10.242C0.67093 10.3006 1.29956 11.6944 2.6971 13.092C4.55925 14.9534 6.91124 15.9375 9.49999 15.9375C12.0887 15.9375 14.4407 14.9534 16.3029 13.092C17.7004 11.6944 18.3291 10.3006 18.355 10.242C18.3888 10.166 18.4062 10.0838 18.4062 10.0007C18.4062 9.91764 18.3888 9.83547 18.355 9.75953ZM9.49999 12.9688C8.91283 12.9688 8.33885 12.7946 7.85064 12.4684C7.36244 12.1422 6.98192 11.6786 6.75723 11.1361C6.53253 10.5936 6.47374 9.99671 6.58829 9.42083C6.70284 8.84494 6.98558 8.31596 7.40077 7.90078C7.81596 7.48559 8.34494 7.20284 8.92082 7.08829C9.4967 6.97374 10.0936 7.03253 10.6361 7.25723C11.1786 7.48193 11.6422 7.86244 11.9684 8.35065C12.2946 8.83886 12.4687 9.41284 12.4687 10C12.4687 10.7874 12.156 11.5425 11.5992 12.0992C11.0425 12.656 10.2874 12.9688 9.49999 12.9688Z" fill="#1B1C1E"/>
|
|
4
|
-
</g>
|
|
5
|
-
</svg>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="19" height="20" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g opacity="0.2">
|
|
3
|
-
<path d="M4.00187 3.07082C3.94973 3.01204 3.88644 2.9642 3.81567 2.93006C3.7449 2.89592 3.66806 2.87617 3.5896 2.87195C3.51114 2.86773 3.43263 2.87912 3.35861 2.90547C3.28458 2.93182 3.21653 2.97259 3.15838 3.02544C3.10023 3.07828 3.05315 3.14214 3.01987 3.21331C2.98658 3.28448 2.96775 3.36156 2.96447 3.44006C2.96119 3.51856 2.97353 3.59693 3.00076 3.67064C3.02799 3.74434 3.06958 3.8119 3.12312 3.86941L4.55109 5.44062C1.85546 7.09496 0.696165 9.64511 0.644954 9.76089C0.611194 9.83683 0.59375 9.919 0.59375 10.0021C0.59375 10.0852 0.611194 10.1674 0.644954 10.2433C0.67093 10.3019 1.29956 11.6958 2.6971 13.0933C4.55925 14.9547 6.91124 15.9389 9.49999 15.9389C10.8305 15.9464 12.1475 15.6725 13.3646 15.1351L14.9974 16.9319C15.0495 16.9907 15.1128 17.0385 15.1836 17.0727C15.2543 17.1068 15.3312 17.1266 15.4096 17.1308C15.4881 17.135 15.5666 17.1236 15.6406 17.0973C15.7147 17.0709 15.7827 17.0301 15.8409 16.9773C15.899 16.9244 15.9461 16.8606 15.9794 16.7894C16.0127 16.7182 16.0315 16.6412 16.0348 16.5627C16.0381 16.4842 16.0257 16.4058 15.9985 16.3321C15.9713 16.2584 15.9297 16.1908 15.8761 16.1333L4.00187 3.07082ZM10.6073 12.1025C10.1416 12.3475 9.6077 12.4309 9.08944 12.3396C8.57118 12.2483 8.09793 11.9874 7.74399 11.598C7.39006 11.2085 7.17549 10.7126 7.13398 10.188C7.09246 9.66336 7.22636 9.13982 7.51464 8.69957L10.6073 12.1025ZM18.355 10.2433C18.3239 10.3131 17.572 11.9778 15.8791 13.4941C15.7624 13.5988 15.6091 13.6531 15.4525 13.6452C15.296 13.6373 15.1489 13.5677 15.0434 13.4518L7.52577 5.18234C7.45386 5.10342 7.40455 5.00657 7.38305 4.90199C7.36155 4.79741 7.36864 4.68896 7.40359 4.58807C7.43853 4.48718 7.50004 4.39759 7.58162 4.32871C7.66321 4.25984 7.76186 4.21424 7.86718 4.19671C8.40687 4.1076 8.953 4.06317 9.49999 4.06386C12.0887 4.06386 14.4407 5.048 16.3029 6.91015C17.7004 8.30769 18.3291 9.70226 18.355 9.76089C18.3888 9.83683 18.4062 9.919 18.4062 10.0021C18.4062 10.0852 18.3888 10.1674 18.355 10.2433Z" fill="#1B1C1E"/>
|
|
4
|
-
</g>
|
|
5
|
-
</svg>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type TContext = {
|
|
3
|
-
openModalCount: number;
|
|
4
|
-
setOpenModalCount?: React.Dispatch<React.SetStateAction<number>>;
|
|
5
|
-
};
|
|
6
|
-
export declare const DBuiContext: React.Context<TContext>;
|
|
7
|
-
export declare const DBuiProvider: (props: any) => React.JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useState } from 'react';
|
|
2
|
-
export var DBuiContext = createContext({
|
|
3
|
-
openModalCount: 0
|
|
4
|
-
});
|
|
5
|
-
export var DBuiProvider = function (props) {
|
|
6
|
-
var _a = useState(0), openModalCount = _a[0], setOpenModalCount = _a[1];
|
|
7
|
-
return (React.createElement(DBuiContext.Provider, { value: {
|
|
8
|
-
openModalCount: openModalCount,
|
|
9
|
-
setOpenModalCount: setOpenModalCount
|
|
10
|
-
} }, props.children));
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/components/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAOtD,MAAM,CAAC,IAAM,WAAW,GAAG,aAAa,CAAW;IACjD,cAAc,EAAE,CAAC;CAClB,CAAC,CAAA;AACF,MAAM,CAAC,IAAM,YAAY,GAAG,UAAC,KAAU;IAC/B,IAAA,KAAsC,QAAQ,CAAC,CAAC,CAAC,EAAhD,cAAc,QAAA,EAAE,iBAAiB,QAAe,CAAA;IAEvD,OAAO,CACL,oBAAC,WAAW,CAAC,QAAQ,IACnB,KAAK,EAAE;YACL,cAAc,gBAAA;YACd,iBAAiB,mBAAA;SAClB,IAEA,KAAK,CAAC,QAAQ,CACM,CACxB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button';
|
|
2
|
-
export type { PropsButton } from './Button/index.type';
|
|
3
|
-
export { default as Blackdrop } from './Blackdrop';
|
|
4
|
-
export type { PropsBlackdrop } from './Blackdrop/index.type';
|
|
5
|
-
export { default as Chip } from './Chip';
|
|
6
|
-
export type { PropsChip } from './Chip/index.type';
|
|
7
|
-
export { default as Divider } from './Divider';
|
|
8
|
-
export { default as Menu } from './Menu';
|
|
9
|
-
export type { PropsMenu } from './Menu/index.type';
|
|
10
|
-
export { default as Modal } from './Modal';
|
|
11
|
-
export type { PropsModal } from './Modal/index.type';
|
|
12
|
-
export { default as Input } from './Input/InputBasic';
|
|
13
|
-
export type { PropsInputBasic as PropsInput } from './Input/InputBasic/index.type';
|
|
14
|
-
export { default as InputNumber } from './Input/InputNumber';
|
|
15
|
-
export type { PropsInputNumber } from './Input/InputNumber/index.type';
|
|
16
|
-
export { default as InputDate } from './Input/InputDate';
|
|
17
|
-
export type { PropsInputDate } from './Input/InputDate/index.type';
|
|
18
|
-
export { default as InputDateRange } from './Input/InputDateRange';
|
|
19
|
-
export type { PropsInputDateRange } from './Input/InputDateRange/index.type';
|
|
20
|
-
export { default as InputDateTime } from './Input/InputDateTime';
|
|
21
|
-
export type { PropsInputDateTime } from './Input/InputDateTime/index.type';
|
|
22
|
-
export { default as InputPassword } from './Input/InputPassword';
|
|
23
|
-
export type { PropsInputPassword } from './Input/InputPassword/index.type';
|
|
24
|
-
export { default as InputRadio } from './Input/InputRadio';
|
|
25
|
-
export type { PropsInputRadio } from './Input/InputRadio/index.type';
|
|
26
|
-
export { default as InputCheckbox } from './Input/InputCheckbox';
|
|
27
|
-
export type { PropsInputCheckbox } from './Input/InputCheckbox/index.type';
|
|
28
|
-
export { default as InputTextarea } from './Input/InputTextarea';
|
|
29
|
-
export type { PropsInputTextarea } from './Input/InputTextarea/index.type';
|
|
30
|
-
export { default as InputSelect } from './Input/InputSelect';
|
|
31
|
-
export type { PropsInputSelect } from './Input/InputSelect/index.type';
|
|
32
|
-
export { default as InputAutoComplete } from './Input/InputAutoComplete';
|
|
33
|
-
export type { PropsInputAutoComplete } from './Input/InputAutoComplete/index.type';
|
|
34
|
-
export { default as InputNonContextSwitch } from './InputNonContext/InputSwitch';
|
|
35
|
-
export type { PropsInputNonContextSwitch } from './InputNonContext/InputSwitch/index.type';
|
|
36
|
-
export type TValueOption = string | number;
|
|
37
|
-
export type TOption = {
|
|
38
|
-
label: string;
|
|
39
|
-
value: TValueOption;
|
|
40
|
-
};
|
|
41
|
-
export { DBuiContext, DBuiProvider } from './context';
|