@cashub/ui 0.4.2 → 0.5.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/Tab/Tab.js +28 -0
- package/Tab/TabContext.js +12 -0
- package/Tab/TabList.js +47 -0
- package/Tab/TabPanel.js +85 -0
- package/Tab/TabTab.js +63 -0
- package/Tab/index.js +24 -0
- package/assets/font/helvetica/Helvetica.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/assets/icons/app-management.png +0 -0
- package/assets/icons/burger.png +0 -0
- package/assets/icons/map_icon1.png +0 -0
- package/assets/icons/map_icon4.png +0 -0
- package/assets/images/bg-chart-circle.png +0 -0
- package/assets/images/bg-chart-triangle.png +0 -0
- package/assets/images/cashub-logo-only.png +0 -0
- package/assets/images/logo-cashub.png +0 -0
- package/assets/images/map.png +0 -0
- package/assets/images/qrcode.png +0 -0
- package/billing/BarChart.js +58 -0
- package/billing/Grid.js +49 -0
- package/billing/Header2.js +28 -0
- package/billing/Header3.js +44 -0
- package/billing/Paragraph.js +39 -0
- package/billing/ParagraphGroup.js +25 -0
- package/billing/ParagraphText.js +31 -0
- package/billing/Section.js +60 -0
- package/billing/SectionBody.js +20 -0
- package/billing/SectionHeader.js +31 -0
- package/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/billing/__stories__/Grid.stories.js_bak +57 -0
- package/billing/__stories__/Header2.stories.js_bak +62 -0
- package/billing/__stories__/Header3.stories.js_bak +69 -0
- package/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/billing/__stories__/Section.stories.js_bak +115 -0
- package/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/callout/Callout.js +36 -0
- package/callout/index.js +15 -0
- package/chart/BarChart.js +130 -0
- package/chart/DoughnutChart.js +59 -0
- package/chart/LineChart.js +121 -0
- package/chart/SingleBarChart.js +31 -0
- package/chart/index.js +39 -0
- package/container/FlexContainer.js +25 -0
- package/container/index.js +15 -0
- package/datetimePicker/Accordion.js +342 -0
- package/datetimePicker/CustomTimeInput.js +77 -0
- package/datetimePicker/DatePicker.js +401 -0
- package/datetimePicker/DatePickerV2.js +432 -0
- package/datetimePicker/DateTimePickerContext.js +12 -0
- package/datetimePicker/DatetimePicker.js +80 -0
- package/datetimePicker/DatetimePickerV2.js +438 -0
- package/datetimePicker/TimeInput.js +37 -0
- package/datetimePicker/TimePicker.js +324 -0
- package/datetimePicker/accordion/Month.js +188 -0
- package/datetimePicker/accordion/Year.js +247 -0
- package/datetimePicker/hooks/index.js +31 -0
- package/datetimePicker/hooks/useChangeNumber.js +55 -0
- package/datetimePicker/hooks/useDecrease.js +54 -0
- package/datetimePicker/hooks/useIncrease.js +54 -0
- package/datetimePicker/index.js +47 -0
- package/datetimePicker/provider/constant.js +44 -0
- package/datetimePicker/utils/pad.js +17 -0
- package/descriptionList/DescriptionDetail.js +22 -0
- package/descriptionList/DescriptionList.js +22 -0
- package/descriptionList/DescriptionTerm.js +19 -0
- package/descriptionList/index.js +31 -0
- package/divider/Divider.js +22 -0
- package/divider/index.js +15 -0
- package/dropdown/Dropdown.js +92 -0
- package/dropdown/DropdownButtonOption.js +19 -0
- package/dropdown/DropdownContent.js +94 -0
- package/dropdown/DropdownContext.js +12 -0
- package/dropdown/DropdownDivOption.js +19 -0
- package/dropdown/DropdownItem.js +32 -0
- package/dropdown/DropdownLinkOption.js +20 -0
- package/dropdown/DropdownToggle.js +58 -0
- package/dropdown/index.js +53 -0
- package/geolocation/MapInteractor.js +41 -0
- package/geolocation/MapSearchBoxControl.js +100 -0
- package/geolocation/ReverseGeolocation.js +160 -0
- package/geolocation/index.js +23 -0
- package/grid/Column.js +33 -0
- package/grid/Grid.js +28 -0
- package/grid/index.js +23 -0
- package/heading/Heading1.js +22 -0
- package/heading/Heading2.js +25 -0
- package/heading/Heading3.js +4 -4
- package/heading/index.js +31 -0
- package/icon/IconFigure.js +36 -0
- package/icon/index.js +15 -0
- package/iconbox/ApplicationIconBox.js +51 -0
- package/iconbox/IconBox.js +56 -0
- package/iconbox/IconBoxFigure.js +37 -0
- package/iconbox/IconBoxImage.js +32 -0
- package/iconbox/IconBoxV2.js +42 -0
- package/iconbox/index.js +31 -0
- package/index.js +377 -0
- package/jsoneditor/JsonEditor.js +53 -0
- package/jsoneditor/index.js +15 -0
- package/layout/Backdrop.js +25 -0
- package/layout/Container.js +34 -0
- package/layout/Footer.js +32 -0
- package/layout/Logo.js +34 -0
- package/layout/MenuIcon.js +43 -0
- package/link/LinkSpan.js +57 -0
- package/link/index.js +15 -0
- package/map/CustomLeafletMapContainer.js +23 -0
- package/map/LeafletMap.js +224 -0
- package/map/index.js +23 -0
- package/module/geolocation/api.js +51 -0
- package/module/message/index.js +59 -0
- package/package.json +16 -1
- package/paginate/Paginate.js +110 -0
- package/paginate/index.js +15 -0
- package/popover/Popover.js +122 -0
- package/popover/index.js +15 -0
- package/qrcode/QRCode.js +57 -0
- package/qrcode/QRCodeContainter.js +34 -0
- package/qrcode/index.js +23 -0
- package/ribbon/Ribbon.js +28 -0
- package/ribbon/index.js +15 -0
- package/section/Section.js +64 -0
- package/section/SectionBody.js +38 -0
- package/section/SectionHeader.js +42 -0
- package/section/SectionToolbar.js +22 -0
- package/section/index.js +50 -0
- package/select/ListBox.js +26 -0
- package/select/Option.js +28 -0
- package/select/OptionGroup.js +20 -0
- package/select/Options.js +25 -0
- package/select/SearchBox.js +52 -0
- package/select/Select.js +625 -0
- package/select/SelectedMultiple.js +34 -0
- package/select/SelectedSingle.js +20 -0
- package/select/index.js +15 -0
- package/services/api/index.js +73 -0
- package/styles/header.style.js +11 -0
- package/styles/sidebar.style.js +18 -0
- package/styles/theme/dark.theme.js +95 -0
- package/styles/theme/index.js +16 -0
- package/table/ImageBox.js +39 -0
- package/table/Logo.js +40 -0
- package/table/PermissionTable.js +42 -0
- package/table/Table.js +377 -0
- package/table/TableFooter.js +19 -0
- package/table/TableFooterInfo.js +19 -0
- package/table/TableFooterPager.js +19 -0
- package/table/TableHeadCell.js +39 -0
- package/table/TableSort.js +34 -0
- package/table/hooks/index.js +31 -0
- package/table/hooks/useLimitChange.js +34 -0
- package/table/hooks/usePageChange.js +33 -0
- package/table/hooks/useSortChange.js +35 -0
- package/table/index.js +31 -0
- package/tagify/Tags.js +55 -0
- package/tagify/index.js +15 -0
- package/text/Paragraph.js +34 -0
- package/text/index.js +15 -0
- package/timeline/Timeline.js +51 -0
- package/timeline/index.js +15 -0
- package/toast/CustomToastContainer.js +20 -0
- package/toast/index.js +23 -0
- package/tooltip/Tooltip.js +154 -0
- package/tooltip/index.js +15 -0
- package/utils/array/generateRange.js +19 -0
- package/utils/chart/customTooltip.js +89 -0
- package/utils/chart/padEmptyChartBar.js +48 -0
- package/utils/format/datetimeFormat.js +71 -0
- package/utils/format/formatDate.js +46 -0
- package/utils/hooks/useCustomPopper.js +50 -0
- package/utils/hooks/useForkRef.js +28 -0
- package/utils/hooks/usePagination.js +86 -0
- package/utils/react/setRef.js +17 -0
- package/utils/regex/check.js +13 -0
- package/wizard/Wizard.js +217 -0
- package/wizard/index.js +15 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _go = require("react-icons/go");
|
|
13
|
+
|
|
14
|
+
var _inputPlaceholder = _interopRequireDefault(require("../styles/mixin/inputPlaceholder"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
28
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
|
|
30
|
+
var SearchBox = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
31
|
+
var handleClick = function handleClick(e) {
|
|
32
|
+
e.stopPropagation();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
36
|
+
onClick: handleClick,
|
|
37
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_go.GoSearch, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SearchInput, _objectSpread({
|
|
38
|
+
type: "text",
|
|
39
|
+
ref: ref
|
|
40
|
+
}, props))]
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n padding: var(--spacing-xs);\n\n > svg {\n color: var(--font-on-mute);\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: calc(var(--spacing-s) + var(--spacing-xs));\n }\n"])));
|
|
45
|
+
|
|
46
|
+
Wrapper.displayName = 'Wrapper';
|
|
47
|
+
|
|
48
|
+
var SearchInput = _styledComponents.default.input(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-background1);\n color: var(--color-white);\n border-radius: var(--border-radius-l);\n border: var(--border-width) solid var(--border-color);\n outline: none;\n width: 100%;\n padding: 10px var(--spacing-s) 10px calc(var(--spacing-s) * 2 + 8px);\n max-height: 36px;\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ", "\n"])), (0, _inputPlaceholder.default)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: var(--font-on-mute);\n "]))));
|
|
49
|
+
|
|
50
|
+
SearchInput.displayName = 'SearchInput';
|
|
51
|
+
var _default = SearchBox;
|
|
52
|
+
exports.default = _default;
|
package/select/Select.js
ADDED
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _reactOutsideClickHandler = _interopRequireDefault(require("react-outside-click-handler"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _lodash = _interopRequireDefault(require("lodash.uniqueid"));
|
|
15
|
+
|
|
16
|
+
var _media = _interopRequireDefault(require("../styles/mixin/media"));
|
|
17
|
+
|
|
18
|
+
var _ti = require("react-icons/ti");
|
|
19
|
+
|
|
20
|
+
var _md = require("react-icons/md");
|
|
21
|
+
|
|
22
|
+
var _useCustomPopper2 = _interopRequireDefault(require("../utils/hooks/useCustomPopper"));
|
|
23
|
+
|
|
24
|
+
var _keycode = _interopRequireDefault(require("../utils/aria/keycode"));
|
|
25
|
+
|
|
26
|
+
var _SelectedSingle = _interopRequireDefault(require("./SelectedSingle"));
|
|
27
|
+
|
|
28
|
+
var _SelectedMultiple = _interopRequireDefault(require("./SelectedMultiple"));
|
|
29
|
+
|
|
30
|
+
var _ListBox = _interopRequireDefault(require("./ListBox"));
|
|
31
|
+
|
|
32
|
+
var _SearchBox = _interopRequireDefault(require("./SearchBox"));
|
|
33
|
+
|
|
34
|
+
var _Options = _interopRequireDefault(require("./Options"));
|
|
35
|
+
|
|
36
|
+
var _OptionGroup = _interopRequireDefault(require("./OptionGroup"));
|
|
37
|
+
|
|
38
|
+
var _Option = _interopRequireDefault(require("./Option"));
|
|
39
|
+
|
|
40
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
|
+
|
|
42
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
43
|
+
|
|
44
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
|
+
|
|
46
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
47
|
+
|
|
48
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
49
|
+
|
|
50
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
51
|
+
|
|
52
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
+
|
|
54
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
55
|
+
|
|
56
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
57
|
+
|
|
58
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
59
|
+
|
|
60
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
61
|
+
|
|
62
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
63
|
+
|
|
64
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
65
|
+
|
|
66
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
67
|
+
|
|
68
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
69
|
+
|
|
70
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
71
|
+
|
|
72
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
73
|
+
|
|
74
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
75
|
+
|
|
76
|
+
var Select = function Select(_ref) {
|
|
77
|
+
var options = _ref.options,
|
|
78
|
+
selected = _ref.selected,
|
|
79
|
+
onSelect = _ref.onSelect,
|
|
80
|
+
onDeselect = _ref.onDeselect,
|
|
81
|
+
_ref$multiple = _ref.multiple,
|
|
82
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
83
|
+
_ref$allowClear = _ref.allowClear,
|
|
84
|
+
allowClear = _ref$allowClear === void 0 ? false : _ref$allowClear,
|
|
85
|
+
_ref$allowSearch = _ref.allowSearch,
|
|
86
|
+
allowSearch = _ref$allowSearch === void 0 ? true : _ref$allowSearch,
|
|
87
|
+
disabled = _ref.disabled,
|
|
88
|
+
_ref$placeholder = _ref.placeholder,
|
|
89
|
+
placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
|
|
90
|
+
fullWidth = _ref.fullWidth,
|
|
91
|
+
large = _ref.large,
|
|
92
|
+
fill = _ref.fill,
|
|
93
|
+
fillReverse = _ref.fillReverse;
|
|
94
|
+
|
|
95
|
+
var _useState = (0, _react.useState)((0, _lodash.default)('select-')),
|
|
96
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
97
|
+
id = _useState2[0];
|
|
98
|
+
|
|
99
|
+
var _useState3 = (0, _react.useState)(false),
|
|
100
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
101
|
+
display = _useState4[0],
|
|
102
|
+
setDisplay = _useState4[1];
|
|
103
|
+
|
|
104
|
+
var _useState5 = (0, _react.useState)(null),
|
|
105
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
106
|
+
listBoxElement = _useState6[0],
|
|
107
|
+
setListBoxElement = _useState6[1];
|
|
108
|
+
|
|
109
|
+
var _useState7 = (0, _react.useState)(null),
|
|
110
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
111
|
+
dropdownElement = _useState8[0],
|
|
112
|
+
setDropdownElement = _useState8[1];
|
|
113
|
+
|
|
114
|
+
var optionsElementRef = (0, _react.useRef)(null);
|
|
115
|
+
var searchBoxElement = (0, _react.useRef)(null);
|
|
116
|
+
|
|
117
|
+
var _useState9 = (0, _react.useState)(0),
|
|
118
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
119
|
+
listBoxWidth = _useState10[0],
|
|
120
|
+
setListBoxWidth = _useState10[1];
|
|
121
|
+
|
|
122
|
+
var _useState11 = (0, _react.useState)([]),
|
|
123
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
124
|
+
optionList = _useState12[0],
|
|
125
|
+
setOptionList = _useState12[1];
|
|
126
|
+
|
|
127
|
+
var _useState13 = (0, _react.useState)(null),
|
|
128
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
129
|
+
focusedOption = _useState14[0],
|
|
130
|
+
setFocusedOption = _useState14[1];
|
|
131
|
+
|
|
132
|
+
var _useState15 = (0, _react.useState)([]),
|
|
133
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
134
|
+
selectedOptions = _useState16[0],
|
|
135
|
+
setSelectedOptions = _useState16[1];
|
|
136
|
+
|
|
137
|
+
var _useState17 = (0, _react.useState)(options),
|
|
138
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
139
|
+
filteredOptions = _useState18[0],
|
|
140
|
+
setFilteredOptions = _useState18[1];
|
|
141
|
+
|
|
142
|
+
var _useState19 = (0, _react.useState)(''),
|
|
143
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
144
|
+
search = _useState20[0],
|
|
145
|
+
setSearch = _useState20[1];
|
|
146
|
+
|
|
147
|
+
var _useCustomPopper = (0, _useCustomPopper2.default)(listBoxElement, dropdownElement),
|
|
148
|
+
styles = _useCustomPopper.styles,
|
|
149
|
+
attributes = _useCustomPopper.attributes,
|
|
150
|
+
state = _useCustomPopper.state,
|
|
151
|
+
update = _useCustomPopper.update; // parse all value to string
|
|
152
|
+
// for subsequently determine whether it is a selected item
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
var parsedSelected = (0, _react.useMemo)(function () {
|
|
156
|
+
if (selected || selected === 0) {
|
|
157
|
+
// multiple value
|
|
158
|
+
if (Array.isArray(selected) && selected.length > 0) {
|
|
159
|
+
return selected.map(function (value) {
|
|
160
|
+
return value.toString();
|
|
161
|
+
});
|
|
162
|
+
} // single value
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
return selected.toString();
|
|
166
|
+
}
|
|
167
|
+
}, [selected]); // set focused option
|
|
168
|
+
|
|
169
|
+
var handleFocusItem = (0, _react.useCallback)(function (element) {
|
|
170
|
+
if (!optionsElementRef.current) return;
|
|
171
|
+
setFocusedOption(element);
|
|
172
|
+
var container = optionsElementRef.current;
|
|
173
|
+
|
|
174
|
+
if (container.scrollHeight > container.clientHeight) {
|
|
175
|
+
var scrollBottom = container.clientHeight + container.scrollTop;
|
|
176
|
+
var elementBottom = element.offsetTop + element.offsetHeight;
|
|
177
|
+
|
|
178
|
+
if (elementBottom > scrollBottom) {
|
|
179
|
+
container.scrollTop = elementBottom - container.clientHeight;
|
|
180
|
+
} else if (element.offsetTop < container.scrollTop) {
|
|
181
|
+
container.scrollTop = element.offsetTop;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, []);
|
|
185
|
+
var focusFirstItem = (0, _react.useCallback)(function () {
|
|
186
|
+
var firstItem = dropdownElement.querySelector('[role="option"]');
|
|
187
|
+
|
|
188
|
+
if (firstItem) {
|
|
189
|
+
handleFocusItem(firstItem);
|
|
190
|
+
}
|
|
191
|
+
}, [dropdownElement, handleFocusItem]);
|
|
192
|
+
var setupFocus = (0, _react.useCallback)(function () {
|
|
193
|
+
if (!dropdownElement) return;
|
|
194
|
+
var selectedItem = dropdownElement.querySelector('[aria-selected="true"]');
|
|
195
|
+
|
|
196
|
+
if (selectedItem) {
|
|
197
|
+
handleFocusItem(selectedItem);
|
|
198
|
+
} else if (optionList.length > 0) {
|
|
199
|
+
focusFirstItem();
|
|
200
|
+
} else {
|
|
201
|
+
setFocusedOption(null);
|
|
202
|
+
}
|
|
203
|
+
}, [dropdownElement, handleFocusItem, focusFirstItem, optionList]);
|
|
204
|
+
var findPreviousItem = (0, _react.useCallback)(function (currentItem) {
|
|
205
|
+
var allItem = _toConsumableArray(dropdownElement.querySelectorAll('[role="option"]'));
|
|
206
|
+
|
|
207
|
+
var currentItemIndex = allItem.indexOf(currentItem);
|
|
208
|
+
var previousItem = null;
|
|
209
|
+
|
|
210
|
+
if (currentItemIndex !== -1 && currentItemIndex > 0) {
|
|
211
|
+
previousItem = allItem[currentItemIndex - 1];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return previousItem;
|
|
215
|
+
}, [dropdownElement]);
|
|
216
|
+
var findNextItem = (0, _react.useCallback)(function (currentItem) {
|
|
217
|
+
var allItem = _toConsumableArray(dropdownElement.querySelectorAll('[role="option"]'));
|
|
218
|
+
|
|
219
|
+
var currentItemIndex = allItem.indexOf(currentItem);
|
|
220
|
+
var nextItem = null;
|
|
221
|
+
|
|
222
|
+
if (currentItemIndex !== -1 && currentItemIndex < allItem.length - 1) {
|
|
223
|
+
nextItem = allItem[currentItemIndex + 1];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return nextItem;
|
|
227
|
+
}, [dropdownElement]);
|
|
228
|
+
var handleOnSelect = (0, _react.useCallback)(function (e, value) {
|
|
229
|
+
e.stopPropagation();
|
|
230
|
+
if (disabled === true) return; //禁按就跳出
|
|
231
|
+
|
|
232
|
+
onSelect(value);
|
|
233
|
+
setSearch('');
|
|
234
|
+
setDisplay(false);
|
|
235
|
+
}, [disabled, onSelect]);
|
|
236
|
+
var handleOnDeselect = (0, _react.useCallback)(function (e, value) {
|
|
237
|
+
e.stopPropagation();
|
|
238
|
+
if (disabled === true) return;
|
|
239
|
+
onDeselect(value);
|
|
240
|
+
}, [disabled, onDeselect]); // list all selected option
|
|
241
|
+
|
|
242
|
+
var selectedItem = (0, _react.useMemo)(function () {
|
|
243
|
+
if (selectedOptions.length > 0) {
|
|
244
|
+
if (multiple) {
|
|
245
|
+
return selectedOptions.map(function (value) {
|
|
246
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedMultiple.default, {
|
|
247
|
+
content: value.text,
|
|
248
|
+
onClick: function onClick(e) {
|
|
249
|
+
return handleOnDeselect(e, value.id);
|
|
250
|
+
}
|
|
251
|
+
}, value.id);
|
|
252
|
+
});
|
|
253
|
+
} else {
|
|
254
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedSingle.default, {
|
|
255
|
+
children: selectedOptions[0].text
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
return placeholder;
|
|
260
|
+
}
|
|
261
|
+
}, [placeholder, handleOnDeselect, multiple, selectedOptions]);
|
|
262
|
+
var optionItem = (0, _react.useMemo)(function () {
|
|
263
|
+
if (optionList.length <= 0) return null;
|
|
264
|
+
return optionList.map(function (option) {
|
|
265
|
+
if (option.child && option.child.length > 0) {
|
|
266
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_OptionGroup.default, {
|
|
267
|
+
"aria-labelledby": option.text,
|
|
268
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, {
|
|
269
|
+
role: "presentation",
|
|
270
|
+
id: option.text,
|
|
271
|
+
children: option.text
|
|
272
|
+
}), option.child.map(function (option) {
|
|
273
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, {
|
|
274
|
+
role: "option",
|
|
275
|
+
tabIndex: "0",
|
|
276
|
+
id: option.id,
|
|
277
|
+
onClick: function onClick(e) {
|
|
278
|
+
return handleOnSelect(e, option.id);
|
|
279
|
+
},
|
|
280
|
+
focus: focusedOption && focusedOption.id === option.id.toString(),
|
|
281
|
+
selected: option.selected,
|
|
282
|
+
"aria-selected": option.selected,
|
|
283
|
+
children: option.text
|
|
284
|
+
}, option.id);
|
|
285
|
+
})]
|
|
286
|
+
}, option.text);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, {
|
|
290
|
+
role: "option",
|
|
291
|
+
tabIndex: "0",
|
|
292
|
+
id: option.id,
|
|
293
|
+
onClick: function onClick(e) {
|
|
294
|
+
return handleOnSelect(e, option.id);
|
|
295
|
+
},
|
|
296
|
+
focus: focusedOption && focusedOption.id === option.id.toString(),
|
|
297
|
+
selected: option.selected,
|
|
298
|
+
"aria-selected": option.selected,
|
|
299
|
+
children: option.text
|
|
300
|
+
}, option.id);
|
|
301
|
+
});
|
|
302
|
+
}, [optionList, focusedOption, handleOnSelect]); // show or hide dropdown
|
|
303
|
+
// and set dropdown width according to listbox current width
|
|
304
|
+
|
|
305
|
+
var handleToggle = function handleToggle() {
|
|
306
|
+
if (disabled === true) return;
|
|
307
|
+
var tmpDisplay = !display;
|
|
308
|
+
|
|
309
|
+
if (!tmpDisplay) {
|
|
310
|
+
setFocusedOption(null);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
setDisplay(tmpDisplay);
|
|
314
|
+
update();
|
|
315
|
+
}; // handle keyboard interaction
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
var handleKeyUp = function handleKeyUp(event) {
|
|
319
|
+
var key = event.keyCode;
|
|
320
|
+
|
|
321
|
+
switch (key) {
|
|
322
|
+
case _keycode.default.ENTER:
|
|
323
|
+
if (!display) {
|
|
324
|
+
handleToggle();
|
|
325
|
+
} else if (focusedOption) {
|
|
326
|
+
handleOnSelect(event, focusedOption.id);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
break;
|
|
330
|
+
|
|
331
|
+
case _keycode.default.ESCAPE:
|
|
332
|
+
if (display) {
|
|
333
|
+
handleToggle();
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
break;
|
|
337
|
+
|
|
338
|
+
case _keycode.default.UP:
|
|
339
|
+
if (!focusedOption) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
var previousItem = findPreviousItem(focusedOption);
|
|
344
|
+
|
|
345
|
+
if (previousItem) {
|
|
346
|
+
handleFocusItem(previousItem);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
break;
|
|
350
|
+
|
|
351
|
+
case _keycode.default.DOWN:
|
|
352
|
+
if (!focusedOption) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
var nextItem = findNextItem(focusedOption);
|
|
357
|
+
|
|
358
|
+
if (nextItem) {
|
|
359
|
+
handleFocusItem(nextItem);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
break;
|
|
363
|
+
|
|
364
|
+
case _keycode.default.END:
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
var itemList = dropdownElement.querySelectorAll('[role="option"]');
|
|
367
|
+
|
|
368
|
+
if (itemList.length) {
|
|
369
|
+
handleFocusItem(itemList[itemList.length - 1]);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
break;
|
|
373
|
+
|
|
374
|
+
case _keycode.default.HOME:
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
focusFirstItem();
|
|
377
|
+
break;
|
|
378
|
+
|
|
379
|
+
default:
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
385
|
+
var key = event.keyCode;
|
|
386
|
+
|
|
387
|
+
switch (key) {
|
|
388
|
+
case _keycode.default.ENTER:
|
|
389
|
+
case _keycode.default.ESCAPE:
|
|
390
|
+
case _keycode.default.UP:
|
|
391
|
+
case _keycode.default.DOWN:
|
|
392
|
+
case _keycode.default.END:
|
|
393
|
+
case _keycode.default.HOME:
|
|
394
|
+
event.preventDefault();
|
|
395
|
+
break;
|
|
396
|
+
|
|
397
|
+
default:
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
}; // handle search keyword change
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
var handleSearchChange = function handleSearchChange(e) {
|
|
404
|
+
setSearch(e.target.value);
|
|
405
|
+
}; // determine selected option(s)
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
(0, _react.useEffect)(function () {
|
|
409
|
+
if (!options) return;
|
|
410
|
+
var tmpSelectedOptions = [];
|
|
411
|
+
options.forEach(function (option) {
|
|
412
|
+
if (option.child && option.child.length > 0) {
|
|
413
|
+
option.child.forEach(function (option) {
|
|
414
|
+
if (multiple && parsedSelected.includes(option.id.toString())) {
|
|
415
|
+
tmpSelectedOptions.push(option);
|
|
416
|
+
} else if (parsedSelected === option.id.toString()) {
|
|
417
|
+
tmpSelectedOptions.push(option);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
if (multiple && parsedSelected.includes(option.id.toString())) {
|
|
422
|
+
tmpSelectedOptions.push(option);
|
|
423
|
+
} else if (parsedSelected === option.id.toString()) {
|
|
424
|
+
tmpSelectedOptions.push(option);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return false;
|
|
429
|
+
});
|
|
430
|
+
setSelectedOptions(tmpSelectedOptions);
|
|
431
|
+
}, [options, parsedSelected, multiple]);
|
|
432
|
+
(0, _react.useEffect)(function () {
|
|
433
|
+
if (update) {
|
|
434
|
+
setTimeout(function () {
|
|
435
|
+
update();
|
|
436
|
+
}, 100);
|
|
437
|
+
}
|
|
438
|
+
}, [update, listBoxWidth]); // observe element resized
|
|
439
|
+
|
|
440
|
+
(0, _react.useEffect)(function () {
|
|
441
|
+
if (!listBoxElement) return;
|
|
442
|
+
var resizeObserverInstance = new ResizeObserver(function (entries) {
|
|
443
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
444
|
+
_step;
|
|
445
|
+
|
|
446
|
+
try {
|
|
447
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
448
|
+
var entry = _step.value;
|
|
449
|
+
|
|
450
|
+
if (entry.target) {
|
|
451
|
+
var borderBoxSize = entry.target.clientWidth;
|
|
452
|
+
setListBoxWidth(borderBoxSize);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
} catch (err) {
|
|
456
|
+
_iterator.e(err);
|
|
457
|
+
} finally {
|
|
458
|
+
_iterator.f();
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
resizeObserverInstance.observe(listBoxElement);
|
|
462
|
+
return function () {
|
|
463
|
+
// unobserve element
|
|
464
|
+
resizeObserverInstance.unobserve(listBoxElement);
|
|
465
|
+
};
|
|
466
|
+
}, [listBoxElement]); // re-setup focus when option list changed and update popper position
|
|
467
|
+
|
|
468
|
+
(0, _react.useEffect)(function () {
|
|
469
|
+
setupFocus();
|
|
470
|
+
if (update) update();
|
|
471
|
+
}, [setupFocus, optionList, update]); // parse option list when filtered options change
|
|
472
|
+
|
|
473
|
+
(0, _react.useEffect)(function () {
|
|
474
|
+
if (!filteredOptions) return;
|
|
475
|
+
setOptionList(filteredOptions.map(function (option) {
|
|
476
|
+
if (option.child && option.child.length > 0) {
|
|
477
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
478
|
+
child: option.child.map(function (option) {
|
|
479
|
+
var selected = false;
|
|
480
|
+
|
|
481
|
+
if (multiple && parsedSelected.includes(option.id.toString())) {
|
|
482
|
+
selected = true;
|
|
483
|
+
} else if (parsedSelected === option.id.toString()) {
|
|
484
|
+
selected = true;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
488
|
+
selected: selected
|
|
489
|
+
});
|
|
490
|
+
})
|
|
491
|
+
});
|
|
492
|
+
} else {
|
|
493
|
+
var _selected = false;
|
|
494
|
+
|
|
495
|
+
if (multiple && parsedSelected.includes(option.id.toString())) {
|
|
496
|
+
_selected = true;
|
|
497
|
+
} else if (parsedSelected === option.id.toString()) {
|
|
498
|
+
_selected = true;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
502
|
+
selected: _selected
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}));
|
|
506
|
+
}, [filteredOptions, multiple, parsedSelected]); // filter options on search keyword changed
|
|
507
|
+
|
|
508
|
+
(0, _react.useEffect)(function () {
|
|
509
|
+
var tmpFilteredOptions = [];
|
|
510
|
+
options.forEach(function (option) {
|
|
511
|
+
if (option.child && option.child.length > 0) {
|
|
512
|
+
var tmpFilteredChildOptions = option.child.filter(function (option) {
|
|
513
|
+
return option.text.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
if (tmpFilteredChildOptions.length > 0) {
|
|
517
|
+
tmpFilteredOptions.push(_objectSpread(_objectSpread({}, option), {}, {
|
|
518
|
+
child: tmpFilteredChildOptions
|
|
519
|
+
}));
|
|
520
|
+
}
|
|
521
|
+
} else if (option.text.toLowerCase().indexOf(search.toLowerCase()) !== -1) {
|
|
522
|
+
tmpFilteredOptions.push(option);
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
setFilteredOptions(tmpFilteredOptions);
|
|
526
|
+
}, [search, options]);
|
|
527
|
+
(0, _react.useEffect)(function () {
|
|
528
|
+
if (display) {
|
|
529
|
+
setupFocus();
|
|
530
|
+
|
|
531
|
+
if (allowSearch) {
|
|
532
|
+
searchBoxElement.current.focus();
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}, [setupFocus, display, allowSearch]);
|
|
536
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactOutsideClickHandler.default, {
|
|
537
|
+
onOutsideClick: function onOutsideClick() {
|
|
538
|
+
setDisplay(false);
|
|
539
|
+
},
|
|
540
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Combobox, {
|
|
541
|
+
role: "combobox",
|
|
542
|
+
tabIndex: "0",
|
|
543
|
+
"aria-haspopup": "listbox",
|
|
544
|
+
"aria-expanded": display,
|
|
545
|
+
"aria-owns": id,
|
|
546
|
+
ref: setListBoxElement,
|
|
547
|
+
onClick: handleToggle,
|
|
548
|
+
onKeyUp: handleKeyUp,
|
|
549
|
+
onKeyDown: handleKeyDown,
|
|
550
|
+
$display: display,
|
|
551
|
+
disabled: disabled,
|
|
552
|
+
fullWidth: fullWidth,
|
|
553
|
+
large: large,
|
|
554
|
+
$fill: fill,
|
|
555
|
+
fillReverse: fillReverse,
|
|
556
|
+
children: [selectedItem, selectedOptions.length > 0 && !multiple && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
557
|
+
onClick: function onClick() {
|
|
558
|
+
onSelect('');
|
|
559
|
+
}
|
|
560
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandArrow, {
|
|
561
|
+
"aria-haspopup": "listbox",
|
|
562
|
+
"aria-expanded": display
|
|
563
|
+
})]
|
|
564
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, _objectSpread(_objectSpread({
|
|
565
|
+
role: "listbox",
|
|
566
|
+
tabIndex: "0",
|
|
567
|
+
id: id,
|
|
568
|
+
ref: setDropdownElement,
|
|
569
|
+
onKeyUp: handleKeyUp,
|
|
570
|
+
onKeyDown: handleKeyDown,
|
|
571
|
+
width: listBoxWidth,
|
|
572
|
+
$display: display,
|
|
573
|
+
style: styles.popper
|
|
574
|
+
}, attributes.popper), {}, {
|
|
575
|
+
placement: state && state.placement,
|
|
576
|
+
children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
|
|
577
|
+
ref: searchBoxElement,
|
|
578
|
+
placeholder: "Search",
|
|
579
|
+
onChange: handleSearchChange,
|
|
580
|
+
value: search
|
|
581
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Options.default, {
|
|
582
|
+
ref: optionsElementRef,
|
|
583
|
+
allowSearch: allowSearch,
|
|
584
|
+
children: optionItem || /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, {
|
|
585
|
+
children: "No results found"
|
|
586
|
+
})
|
|
587
|
+
})]
|
|
588
|
+
}))]
|
|
589
|
+
});
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
var Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n min-width: 160px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--color-white);\n font-size: var(--font-body1);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-l);\n padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);\n\n &:focus {\n ", ";\n }\n\n ", "\n\n ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref2) {
|
|
593
|
+
var disabled = _ref2.disabled;
|
|
594
|
+
return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
|
|
595
|
+
}, function (_ref3) {
|
|
596
|
+
var $display = _ref3.$display;
|
|
597
|
+
return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
|
|
598
|
+
}, function (_ref4) {
|
|
599
|
+
var disabled = _ref4.disabled;
|
|
600
|
+
return disabled && "cursor: not-allowed;opacity: 0.5;";
|
|
601
|
+
}, function (_ref5) {
|
|
602
|
+
var fullWidth = _ref5.fullWidth;
|
|
603
|
+
return fullWidth ? 'width: 100%' : 'max-width: 320px';
|
|
604
|
+
}, function (_ref6) {
|
|
605
|
+
var large = _ref6.large;
|
|
606
|
+
return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
|
|
607
|
+
}, function (_ref7) {
|
|
608
|
+
var $fill = _ref7.$fill;
|
|
609
|
+
return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
|
|
610
|
+
}, function (_ref8) {
|
|
611
|
+
var fillReverse = _ref8.fillReverse;
|
|
612
|
+
return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
Combobox.displayName = 'Combobox';
|
|
616
|
+
var CloseButton = (0, _styledComponents.default)(_md.MdClose)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n color: var(--color-primary);\n font-size: var(--font-body1);\n right: var(--spacing-l);\n\n ", ";\n"])), _media.default.tablet(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n right: calc(var(--spacing) + var(--spacing-s));\n "]))));
|
|
617
|
+
CloseButton.displayName = 'CloseButton';
|
|
618
|
+
var ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n color: var(--color-primary);\n font-size: var(--font-body1);\n right: var(--spacing-s);\n"])));
|
|
619
|
+
ExpandArrow.displayName = 'ExpandArrow';
|
|
620
|
+
|
|
621
|
+
var Message = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 0;\n padding: 12px var(--spacing-s);\n"])));
|
|
622
|
+
|
|
623
|
+
Message.displayName = 'Message';
|
|
624
|
+
var _default = Select;
|
|
625
|
+
exports.default = _default;
|