@hi-ui/tree-select 4.0.0-alpha.3
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/LICENSE +21 -0
- package/README.md +11 -0
- package/lib/cjs/TreeSelect.js +275 -0
- package/lib/cjs/TreeSelect.js.map +1 -0
- package/lib/cjs/hooks/use-merge-refs/lib/esm/index.js +61 -0
- package/lib/cjs/hooks/use-merge-refs/lib/esm/index.js.map +1 -0
- package/lib/cjs/index.js +22 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/styles/index.scss.js +22 -0
- package/lib/cjs/styles/index.scss.js.map +1 -0
- package/lib/cjs/ui/input/lib/esm/Input.js +258 -0
- package/lib/cjs/ui/input/lib/esm/Input.js.map +1 -0
- package/lib/cjs/ui/input/lib/esm/MockInput.js +161 -0
- package/lib/cjs/ui/input/lib/esm/MockInput.js.map +1 -0
- package/lib/cjs/ui/input/lib/esm/styles/index.scss.js +32 -0
- package/lib/cjs/ui/input/lib/esm/styles/index.scss.js.map +1 -0
- package/lib/esm/TreeSelect.js +242 -0
- package/lib/esm/TreeSelect.js.map +1 -0
- package/lib/esm/hooks/use-merge-refs/lib/esm/index.js +54 -0
- package/lib/esm/hooks/use-merge-refs/lib/esm/index.js.map +1 -0
- package/lib/esm/index.js +12 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/styles/index.scss.js +17 -0
- package/lib/esm/styles/index.scss.js.map +1 -0
- package/lib/esm/ui/input/lib/esm/Input.js +234 -0
- package/lib/esm/ui/input/lib/esm/Input.js.map +1 -0
- package/lib/esm/ui/input/lib/esm/MockInput.js +139 -0
- package/lib/esm/ui/input/lib/esm/MockInput.js.map +1 -0
- package/lib/esm/ui/input/lib/esm/styles/index.scss.js +27 -0
- package/lib/esm/ui/input/lib/esm/styles/index.scss.js.map +1 -0
- package/lib/types/TreeSelect.d.ts +127 -0
- package/lib/types/context.d.ts +7 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/types.d.ts +57 -0
- package/lib/types/use-tree-select.d.ts +8 -0
- package/package.json +73 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
/** @LICENSE
|
2
|
+
* @hi-ui/tree-select
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/tree-select#readme
|
4
|
+
*
|
5
|
+
* Copyright (c) HIUI <mi-hiui@xiaomi.com>.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
import { __rest } from 'tslib';
|
11
|
+
import React, { forwardRef, useMemo, useCallback, useState } from 'react';
|
12
|
+
import { getPrefixCls, cx } from '@hi-ui/classname';
|
13
|
+
import { __DEV__ } from '@hi-ui/env';
|
14
|
+
import { useUncontrolledState } from '@hi-ui/use-uncontrolled-state';
|
15
|
+
import { CloseCircleFilled } from '@hi-ui/icons';
|
16
|
+
/** @LICENSE
|
17
|
+
* @hi-ui/input
|
18
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/input#readme
|
19
|
+
*
|
20
|
+
* Copyright (c) HIUI <mi-hiui@xiaomi.com>.
|
21
|
+
*
|
22
|
+
* This source code is licensed under the MIT license found in the
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
24
|
+
*/
|
25
|
+
|
26
|
+
var _role = 'mock-input';
|
27
|
+
|
28
|
+
var _prefix = getPrefixCls(_role);
|
29
|
+
|
30
|
+
var NOOP_VALUE = '';
|
31
|
+
var NOOP_ARRAY = [];
|
32
|
+
/**
|
33
|
+
* 支持自定义渲染输入框内容,暂时仅供内部 Picker 类组件使用,不对外提供
|
34
|
+
*/
|
35
|
+
|
36
|
+
var MockInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
37
|
+
var _a$prefixCls = _a.prefixCls,
|
38
|
+
prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
|
39
|
+
_a$role = _a.role,
|
40
|
+
role = _a$role === void 0 ? _role : _a$role,
|
41
|
+
className = _a.className,
|
42
|
+
_a$data = _a.data,
|
43
|
+
data = _a$data === void 0 ? NOOP_ARRAY : _a$data,
|
44
|
+
_a$defaultValue = _a.defaultValue,
|
45
|
+
defaultValue = _a$defaultValue === void 0 ? NOOP_VALUE : _a$defaultValue,
|
46
|
+
valueProp = _a.value,
|
47
|
+
onChange = _a.onChange,
|
48
|
+
placeholder = _a.placeholder,
|
49
|
+
_a$disabled = _a.disabled,
|
50
|
+
disabled = _a$disabled === void 0 ? false : _a$disabled,
|
51
|
+
_a$clearable = _a.clearable,
|
52
|
+
clearable = _a$clearable === void 0 ? false : _a$clearable,
|
53
|
+
_a$focused = _a.focused,
|
54
|
+
focused = _a$focused === void 0 ? false : _a$focused,
|
55
|
+
_a$invalid = _a.invalid,
|
56
|
+
invalid = _a$invalid === void 0 ? false : _a$invalid,
|
57
|
+
_a$readOnly = _a.readOnly,
|
58
|
+
readOnly = _a$readOnly === void 0 ? false : _a$readOnly,
|
59
|
+
_a$size = _a.size,
|
60
|
+
size = _a$size === void 0 ? 'md' : _a$size,
|
61
|
+
_a$appearance = _a.appearance,
|
62
|
+
appearance = _a$appearance === void 0 ? 'outline' : _a$appearance,
|
63
|
+
_a$clearableTrigger = _a.clearableTrigger,
|
64
|
+
clearableTrigger = _a$clearableTrigger === void 0 ? 'hover' : _a$clearableTrigger,
|
65
|
+
displayRender = _a.displayRender,
|
66
|
+
suffix = _a.suffix,
|
67
|
+
_onMouseOver = _a.onMouseOver,
|
68
|
+
_onMouseLeave = _a.onMouseLeave,
|
69
|
+
rest = __rest(_a, ["prefixCls", "role", "className", "data", "defaultValue", "value", "onChange", "placeholder", "disabled", "clearable", "focused", "invalid", "readOnly", "size", "appearance", "clearableTrigger", "displayRender", "suffix", "onMouseOver", "onMouseLeave"]);
|
70
|
+
|
71
|
+
var _useUncontrolledState = useUncontrolledState(defaultValue, valueProp, onChange),
|
72
|
+
value = _useUncontrolledState[0],
|
73
|
+
tryChangeValue = _useUncontrolledState[1];
|
74
|
+
|
75
|
+
var displayValue = useMemo(function () {
|
76
|
+
if (value === '') return null;
|
77
|
+
var displayItem = data.find(function (item) {
|
78
|
+
return item.id === value;
|
79
|
+
});
|
80
|
+
if (!displayItem) return null;
|
81
|
+
|
82
|
+
if (displayRender) {
|
83
|
+
return displayRender(displayItem);
|
84
|
+
}
|
85
|
+
|
86
|
+
return displayItem.title;
|
87
|
+
}, [data, value, displayRender]);
|
88
|
+
var handleClear = useCallback(function (evt) {
|
89
|
+
if (disabled) return;
|
90
|
+
evt.stopPropagation();
|
91
|
+
tryChangeValue(NOOP_VALUE);
|
92
|
+
}, [tryChangeValue, disabled]);
|
93
|
+
|
94
|
+
var _useState = useState(false),
|
95
|
+
hover = _useState[0],
|
96
|
+
setHover = _useState[1];
|
97
|
+
|
98
|
+
var trySetHover = useCallback(function (hovered) {
|
99
|
+
if (disabled) return;
|
100
|
+
setHover(hovered);
|
101
|
+
}, [disabled]);
|
102
|
+
var hasValue = !!displayValue; // 在开启 clearable 下展示 清除内容按钮,可点击进行内容清除
|
103
|
+
|
104
|
+
var showClearableIcon = useMemo(function () {
|
105
|
+
return clearable && hasValue && !disabled && (clearableTrigger === 'always' || hover);
|
106
|
+
}, [clearable, hasValue, disabled, clearableTrigger, hover]);
|
107
|
+
var cls = cx(prefixCls, className, prefixCls + "--appearance-" + appearance, prefixCls + "--size-" + size, focused && "focused", disabled && 'disabled', readOnly && 'readonly', invalid && 'invalid');
|
108
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
109
|
+
ref: ref,
|
110
|
+
role: role,
|
111
|
+
className: cls,
|
112
|
+
onMouseOver: function onMouseOver(evt) {
|
113
|
+
trySetHover(true);
|
114
|
+
_onMouseOver === null || _onMouseOver === void 0 ? void 0 : _onMouseOver(evt);
|
115
|
+
},
|
116
|
+
onMouseLeave: function onMouseLeave(evt) {
|
117
|
+
trySetHover(false);
|
118
|
+
_onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(evt);
|
119
|
+
}
|
120
|
+
}, rest), hasValue ? /*#__PURE__*/React.createElement("span", {
|
121
|
+
className: prefixCls + "__value"
|
122
|
+
}, displayValue) : /*#__PURE__*/React.createElement("span", {
|
123
|
+
className: prefixCls + "__placeholder"
|
124
|
+
}, placeholder), suffix || showClearableIcon ? /*#__PURE__*/React.createElement("span", {
|
125
|
+
className: prefixCls + "__suffix"
|
126
|
+
}, showClearableIcon ? /*#__PURE__*/React.createElement("span", {
|
127
|
+
role: "button",
|
128
|
+
tabIndex: -1,
|
129
|
+
className: cx(prefixCls + "__clear", 'active'),
|
130
|
+
onClick: handleClear
|
131
|
+
}, /*#__PURE__*/React.createElement(CloseCircleFilled, null)) : suffix) : null);
|
132
|
+
});
|
133
|
+
|
134
|
+
if (__DEV__) {
|
135
|
+
MockInput.displayName = 'MockInput';
|
136
|
+
}
|
137
|
+
|
138
|
+
export { MockInput };
|
139
|
+
//# sourceMappingURL=MockInput.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MockInput.js","sources":["../../../../../../../input/lib/esm/MockInput.js"],"sourcesContent":["/** @LICENSE\n * @hi-ui/input\n * https://github.com/XiaoMi/hiui/tree/master/packages/ui/input#readme\n *\n * Copyright (c) HIUI <mi-hiui@xiaomi.com>.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { __rest } from 'tslib';\nimport React, { forwardRef, useMemo, useCallback, useState } from 'react';\nimport { getPrefixCls, cx } from '@hi-ui/classname';\nimport { __DEV__ } from '@hi-ui/env';\nimport { useUncontrolledState } from '@hi-ui/use-uncontrolled-state';\nimport { CloseCircleFilled } from '@hi-ui/icons';\nvar _role = 'mock-input';\n\nvar _prefix = getPrefixCls(_role);\n\nvar NOOP_VALUE = '';\nvar NOOP_ARRAY = [];\n/**\n * 支持自定义渲染输入框内容,暂时仅供内部 Picker 类组件使用,不对外提供\n */\n\nvar MockInput = /*#__PURE__*/forwardRef(function (_a, ref) {\n var _a$prefixCls = _a.prefixCls,\n prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,\n _a$role = _a.role,\n role = _a$role === void 0 ? _role : _a$role,\n className = _a.className,\n _a$data = _a.data,\n data = _a$data === void 0 ? NOOP_ARRAY : _a$data,\n _a$defaultValue = _a.defaultValue,\n defaultValue = _a$defaultValue === void 0 ? NOOP_VALUE : _a$defaultValue,\n valueProp = _a.value,\n onChange = _a.onChange,\n placeholder = _a.placeholder,\n _a$disabled = _a.disabled,\n disabled = _a$disabled === void 0 ? false : _a$disabled,\n _a$clearable = _a.clearable,\n clearable = _a$clearable === void 0 ? false : _a$clearable,\n _a$focused = _a.focused,\n focused = _a$focused === void 0 ? false : _a$focused,\n _a$invalid = _a.invalid,\n invalid = _a$invalid === void 0 ? false : _a$invalid,\n _a$readOnly = _a.readOnly,\n readOnly = _a$readOnly === void 0 ? false : _a$readOnly,\n _a$size = _a.size,\n size = _a$size === void 0 ? 'md' : _a$size,\n _a$appearance = _a.appearance,\n appearance = _a$appearance === void 0 ? 'outline' : _a$appearance,\n _a$clearableTrigger = _a.clearableTrigger,\n clearableTrigger = _a$clearableTrigger === void 0 ? 'hover' : _a$clearableTrigger,\n displayRender = _a.displayRender,\n suffix = _a.suffix,\n _onMouseOver = _a.onMouseOver,\n _onMouseLeave = _a.onMouseLeave,\n rest = __rest(_a, [\"prefixCls\", \"role\", \"className\", \"data\", \"defaultValue\", \"value\", \"onChange\", \"placeholder\", \"disabled\", \"clearable\", \"focused\", \"invalid\", \"readOnly\", \"size\", \"appearance\", \"clearableTrigger\", \"displayRender\", \"suffix\", \"onMouseOver\", \"onMouseLeave\"]);\n\n var _useUncontrolledState = useUncontrolledState(defaultValue, valueProp, onChange),\n value = _useUncontrolledState[0],\n tryChangeValue = _useUncontrolledState[1];\n\n var displayValue = useMemo(function () {\n if (value === '') return null;\n var displayItem = data.find(function (item) {\n return item.id === value;\n });\n if (!displayItem) return null;\n\n if (displayRender) {\n return displayRender(displayItem);\n }\n\n return displayItem.title;\n }, [data, value, displayRender]);\n var handleClear = useCallback(function (evt) {\n if (disabled) return;\n evt.stopPropagation();\n tryChangeValue(NOOP_VALUE);\n }, [tryChangeValue, disabled]);\n\n var _useState = useState(false),\n hover = _useState[0],\n setHover = _useState[1];\n\n var trySetHover = useCallback(function (hovered) {\n if (disabled) return;\n setHover(hovered);\n }, [disabled]);\n var hasValue = !!displayValue; // 在开启 clearable 下展示 清除内容按钮,可点击进行内容清除\n\n var showClearableIcon = useMemo(function () {\n return clearable && hasValue && !disabled && (clearableTrigger === 'always' || hover);\n }, [clearable, hasValue, disabled, clearableTrigger, hover]);\n var cls = cx(prefixCls, className, prefixCls + \"--appearance-\" + appearance, prefixCls + \"--size-\" + size, focused && \"focused\", disabled && 'disabled', readOnly && 'readonly', invalid && 'invalid');\n return /*#__PURE__*/React.createElement(\"div\", Object.assign({\n ref: ref,\n role: role,\n className: cls,\n onMouseOver: function onMouseOver(evt) {\n trySetHover(true);\n _onMouseOver === null || _onMouseOver === void 0 ? void 0 : _onMouseOver(evt);\n },\n onMouseLeave: function onMouseLeave(evt) {\n trySetHover(false);\n _onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(evt);\n }\n }, rest), hasValue ? /*#__PURE__*/React.createElement(\"span\", {\n className: prefixCls + \"__value\"\n }, displayValue) : /*#__PURE__*/React.createElement(\"span\", {\n className: prefixCls + \"__placeholder\"\n }, placeholder), suffix || showClearableIcon ? /*#__PURE__*/React.createElement(\"span\", {\n className: prefixCls + \"__suffix\"\n }, showClearableIcon ? /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n tabIndex: -1,\n className: cx(prefixCls + \"__clear\", 'active'),\n onClick: handleClear\n }, /*#__PURE__*/React.createElement(CloseCircleFilled, null)) : suffix) : null);\n});\n\nif (__DEV__) {\n MockInput.displayName = 'MockInput';\n}\n\nexport { MockInput };\n//# sourceMappingURL=MockInput.js.map\n"],"names":["_role","_prefix","getPrefixCls","NOOP_VALUE","NOOP_ARRAY","MockInput","forwardRef","_a","ref","prefixCls","role","className","data","defaultValue","valueProp","value","onChange","placeholder","disabled","_a$disabled","clearable","_a$clearable","focused","_a$focused","invalid","_a$invalid","readOnly","_a$readOnly","size","_a$size","appearance","_a$appearance","clearableTrigger","_a$clearableTrigger","displayRender","suffix","onMouseOver","onMouseLeave","rest","useUncontrolledState","_useUncontrolledState","tryChangeValue","displayValue","useMemo","displayItem","find","item","title","handleClear","useCallback","evt","useState","hover","_useState","setHover","trySetHover","hovered","hasValue","showClearableIcon","cls","cx","React","tabIndex","onClick","__DEV__"],"mappings":"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"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/** @LICENSE
|
2
|
+
* @hi-ui/tree-select
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/tree-select#readme
|
4
|
+
*
|
5
|
+
* Copyright (c) HIUI <mi-hiui@xiaomi.com>.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
|
11
|
+
/** @LICENSE
|
12
|
+
* @hi-ui/input
|
13
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/input#readme
|
14
|
+
*
|
15
|
+
* Copyright (c) HIUI <mi-hiui@xiaomi.com>.
|
16
|
+
*
|
17
|
+
* This source code is licensed under the MIT license found in the
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
19
|
+
*/
|
20
|
+
var css_248z = "@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n.hi-v4-mock-input {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: text;\n background-color: transparent;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n overflow: hidden;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n -webkit-transition-property: all;\n transition-property: all;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n -webkit-transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n -webkit-transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n width: 100%;\n height: auto;\n z-index: auto;\n font-size: inherit;\n line-height: inherit;\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733);\n border: 1px solid transparent;\n border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-static-transparent, transparent);\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff); }\n.hi-v4-mock-input:not(.disabled):hover {\n z-index: calc(1 + 1);\n z-index: calc(var(--hi-v4-zindex-absolute, 1) + 1); }\n.hi-v4-mock-input:not(.disabled).focused {\n z-index: calc(1 + 1);\n z-index: calc(var(--hi-v4-zindex-absolute, 1) + 1); }\n.hi-v4-mock-input.disabled {\n cursor: not-allowed; }\n.hi-v4-mock-input__suffix, .hi-v4-mock-input__placeholder {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-mock-input__clear {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: 16px;\n height: 16px;\n font-size: 0.875rem;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n text-align: center;\n color: #929aa6;\n color: var(--hi-v4-color-gray-500, #929aa6);\n -ms-flex-negative: 0;\n flex-shrink: 0;\n cursor: pointer;\n visibility: hidden;\n opacity: 0;\n -webkit-transition-property: all;\n transition-property: all;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n -webkit-transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n -webkit-transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1)); }\n.hi-v4-mock-input__clear:hover {\n color: #000;\n color: var(--hi-v4-color-static-black, #000); }\n.hi-v4-mock-input__clear.active {\n visibility: visible;\n opacity: 1; }\n.hi-v4-mock-input__suffix {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6);\n font-size: 1rem;\n font-size: var(--hi-v4-text-size-lg, 1rem);\n padding-left: 8px;\n padding-left: var(--hi-v4-spacing-4, 8px);\n text-align: center; }\n.hi-v4-mock-input__value {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n width: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n.hi-v4-mock-input--size-sm {\n height: 24px;\n height: var(--hi-v4-height-xs, 24px);\n font-size: 0.75rem;\n font-size: var(--hi-v4-text-size-sm, 0.75rem);\n line-height: 1.25rem;\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n padding: 1px calc(12px - 1px);\n padding: 1px calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-mock-input--size-md {\n height: 32px;\n height: var(--hi-v4-height-normal, 32px);\n font-size: 0.875rem;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n line-height: 1.375rem;\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n padding: 4px calc(12px - 1px);\n padding: 4px calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-mock-input--size-lg {\n height: 40px;\n height: var(--hi-v4-height-xl, 40px);\n font-size: 1rem;\n font-size: var(--hi-v4-text-size-lg, 1rem);\n line-height: 1.5rem;\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n padding: 7px calc(12px - 1px);\n padding: 7px calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-mock-input--appearance-outline {\n border-color: #dfe2e8;\n border-color: var(--hi-v4-color-gray-300, #dfe2e8); }\n.hi-v4-mock-input--appearance-outline:not(.disabled):hover {\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-mock-input--appearance-outline:not(.disabled).focused {\n -webkit-box-shadow: 0 0 0 2px #bde2ff;\n box-shadow: 0 0 0 2px #bde2ff;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-mock-input--appearance-outline:not(.disabled).invalid {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-mock-input--appearance-outline:not(.disabled).invalid.hover {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-mock-input--appearance-outline:not(.disabled).invalid.focused {\n -webkit-box-shadow: 0 0 0 2px #ffd1c9;\n box-shadow: 0 0 0 2px #ffd1c9;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9);\n box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9); }\n.hi-v4-mock-input--appearance-unset {\n width: auto;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n border-color: transparent; }\n.hi-v4-mock-input--appearance-unset:not(.disabled):hover {\n background-color: #f2f4f7;\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-mock-input--appearance-unset:not(.disabled).focused {\n -webkit-box-shadow: 0 0 0 2px #bde2ff;\n box-shadow: 0 0 0 2px #bde2ff;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-mock-input--appearance-unset:not(.disabled).invalid {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-mock-input--appearance-unset:not(.disabled).invalid.hover {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-mock-input--appearance-unset:not(.disabled).invalid.focused {\n -webkit-box-shadow: 0 0 0 2px #ffd1c9;\n box-shadow: 0 0 0 2px #ffd1c9;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9);\n box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9); }\n.hi-v4-mock-input--appearance-filled {\n background-color: #f2f4f7;\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-mock-input--appearance-filled:not(.disabled):hover {\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-mock-input--appearance-filled:not(.disabled).focused {\n -webkit-box-shadow: 0 0 0 2px #bde2ff;\n box-shadow: 0 0 0 2px #bde2ff;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa);\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff); }\n.hi-v4-mock-input--appearance-filled:not(.disabled).invalid {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-mock-input--appearance-filled:not(.disabled).invalid.hover {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-mock-input--appearance-filled:not(.disabled).invalid.focused {\n -webkit-box-shadow: 0 0 0 2px #ffd1c9;\n box-shadow: 0 0 0 2px #ffd1c9;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9);\n box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9); }\n.hi-v4-mock-input--appearance-outline.disabled, .hi-v4-mock-input--appearance-unset.disabled, .hi-v4-mock-input--appearance-filled.disabled {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-mock-input--appearance-outline.disabled, .hi-v4-mock-input--appearance-filled.disabled {\n background-color: #ebedf0;\n background-color: var(--hi-v4-color-gray-200, #ebedf0); }\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n.hi-v4-input {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: text;\n background-color: transparent;\n -webkit-tap-highlight-color: transparent;\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n display: inline-block;\n box-sizing: border-box;\n -webkit-transition-property: all;\n transition-property: all;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n -webkit-transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n -webkit-transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n width: 100%;\n font-size: inherit;\n line-height: inherit;\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733); }\n.hi-v4-input::-webkit-input-placeholder {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-input::-moz-placeholder {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-input::-ms-input-placeholder {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-input:-ms-input-placeholder {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-input::placeholder {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6); }\n.hi-v4-input:disabled {\n cursor: not-allowed; }\n.hi-v4-input__inner {\n position: relative;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n height: auto;\n width: 100%;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-size: inherit;\n border: 1px solid transparent;\n border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-static-transparent, transparent);\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff);\n -webkit-transition-property: all;\n transition-property: all;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n -webkit-transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n -webkit-transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n outline: none;\n z-index: auto; }\n.hi-v4-input__inner:not(.disabled):hover {\n z-index: calc(1 + 1);\n z-index: calc(var(--hi-v4-zindex-absolute, 1) + 1); }\n.hi-v4-input__inner:not(.disabled).focused {\n z-index: calc(1 + 1);\n z-index: calc(var(--hi-v4-zindex-absolute, 1) + 1); }\n.hi-v4-input__outer {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n margin: 0;\n padding: 0;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n height: auto;\n width: 100%;\n vertical-align: middle; }\n.hi-v4-input__clear {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: auto;\n text-align: center;\n font-size: 0.875rem;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n color: #929aa6;\n color: var(--hi-v4-color-gray-500, #929aa6);\n -ms-flex-negative: 0;\n flex-shrink: 0;\n cursor: pointer;\n -webkit-transition-property: all;\n transition-property: all;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n -webkit-transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n -webkit-transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n visibility: hidden;\n opacity: 0; }\n.hi-v4-input__clear:hover {\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733); }\n.hi-v4-input__clear.active {\n visibility: visible;\n opacity: 1; }\n.hi-v4-input__inner--suffix .hi-v4-input__clear {\n -webkit-margin-end: 4px;\n margin-inline-end: 4px;\n -webkit-margin-end: var(--hi-v4-spacing-2, 4px);\n margin-inline-end: var(--hi-v4-spacing-2, 4px); }\n.hi-v4-input__prefix, .hi-v4-input__suffix {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733);\n font-size: inherit;\n text-align: center; }\n.hi-v4-input__prefix {\n padding-left: calc(12px - 1px);\n padding-left: calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input__suffix {\n padding-right: calc(12px - 1px);\n padding-right: calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input__prepend, .hi-v4-input__append {\n position: relative;\n color: #1f2733;\n color: var(--hi-v4-color-gray-700, #1f2733);\n background-color: #f5f7fa;\n background-color: var(--hi-v4-color-gray-50, #f5f7fa);\n -ms-flex-negative: 0;\n flex-shrink: 0;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-size: inherit;\n text-align: center;\n padding: 0 calc(12px - 1px);\n padding: 0 calc(var(--hi-v4-spacing-6, 12px) - 1px);\n border: 1px solid transparent;\n border: var(--hi-v4-border-size-normal, 1px solid) var(--hi-v4-color-static-transparent, transparent);\n white-space: nowrap;\n -webkit-transition-property: all;\n transition-property: all;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n transition-duration: var(--hi-v4-motion-duration-normal, 200ms);\n -webkit-transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n transition-timing-function: cubic-bezier(0.37, 0.02, 0.34, 1);\n -webkit-transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n transition-timing-function: var(--hi-v4-motion-bezier-normal, cubic-bezier(0.37, 0.02, 0.34, 1));\n z-index: 1;\n z-index: var(--hi-v4-zindex-absolute, 1); }\n.hi-v4-input__prepend {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px; }\n.hi-v4-input__append {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n margin-left: -1px; }\n.hi-v4-input--size-sm {\n height: 24px;\n height: var(--hi-v4-height-xs, 24px);\n font-size: 0.75rem;\n font-size: var(--hi-v4-text-size-sm, 0.75rem);\n line-height: 1.25rem; }\n.hi-v4-input--size-sm .hi-v4-input {\n padding: 1px calc(12px - 1px);\n padding: 1px calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--size-sm .hi-v4-input__inner,\n .hi-v4-input--size-sm .hi-v4-input__prepend,\n .hi-v4-input--size-sm .hi-v4-input__append {\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px); }\n.hi-v4-input--size-sm .hi-v4-input__prepend {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n.hi-v4-input--size-sm .hi-v4-input__append {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n.hi-v4-input--size-md {\n height: 32px;\n height: var(--hi-v4-height-normal, 32px);\n font-size: 0.875rem;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n line-height: 1.375rem; }\n.hi-v4-input--size-md .hi-v4-input {\n padding: 4px calc(12px - 1px);\n padding: 4px calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--size-md .hi-v4-input__inner,\n .hi-v4-input--size-md .hi-v4-input__prepend,\n .hi-v4-input--size-md .hi-v4-input__append {\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px); }\n.hi-v4-input--size-md .hi-v4-input__prepend {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n.hi-v4-input--size-md .hi-v4-input__append {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n.hi-v4-input--size-lg {\n height: 40px;\n height: var(--hi-v4-height-xl, 40px);\n font-size: 1rem;\n font-size: var(--hi-v4-text-size-lg, 1rem);\n line-height: 1.5rem; }\n.hi-v4-input--size-lg .hi-v4-input {\n padding: 7px calc(12px - 1px);\n padding: 7px calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--size-lg .hi-v4-input__inner,\n .hi-v4-input--size-lg .hi-v4-input__prepend,\n .hi-v4-input--size-lg .hi-v4-input__append {\n border-radius: 4px;\n border-radius: var(--hi-v4-border-radius-normal, 4px); }\n.hi-v4-input--size-lg .hi-v4-input__prepend {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n.hi-v4-input--size-lg .hi-v4-input__append {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n.hi-v4-input--appearance-outline .hi-v4-input__inner {\n border-color: #dfe2e8;\n border-color: var(--hi-v4-color-gray-300, #dfe2e8); }\n.hi-v4-input--appearance-outline .hi-v4-input__inner:not(.disabled):hover {\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-input--appearance-outline .hi-v4-input__inner:not(.disabled).focused {\n -webkit-box-shadow: 0 0 0 2px #bde2ff;\n box-shadow: 0 0 0 2px #bde2ff;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-input--appearance-outline .hi-v4-input__inner:not(.disabled).invalid {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-input--appearance-outline .hi-v4-input__inner:not(.disabled).invalid.hover {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-input--appearance-outline .hi-v4-input__inner:not(.disabled).invalid.focused {\n -webkit-box-shadow: 0 0 0 2px #ffd1c9;\n box-shadow: 0 0 0 2px #ffd1c9;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9);\n box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9); }\n.hi-v4-input--appearance-outline .hi-v4-input__prepend,\n .hi-v4-input--appearance-outline .hi-v4-input__append {\n border-color: #dfe2e8;\n border-color: var(--hi-v4-color-gray-300, #dfe2e8); }\n.hi-v4-input--appearance-unset .hi-v4-input {\n padding-left: 0;\n padding-right: 0; }\n.hi-v4-input--appearance-unset.hi-v4-input__outer--prepend .hi-v4-input,\n .hi-v4-input--appearance-unset .hi-v4-input__inner--prefix .hi-v4-input {\n padding-left: calc(12px - 1px);\n padding-left: calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--appearance-unset.hi-v4-input__outer--append .hi-v4-input,\n .hi-v4-input--appearance-unset .hi-v4-input__inner--suffix .hi-v4-input {\n padding-right: calc(12px - 1px);\n padding-right: calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--appearance-unset .hi-v4-input__inner {\n border-radius: 0; }\n.hi-v4-input--appearance-filled .hi-v4-input__inner {\n background-color: #f2f4f7;\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-input--appearance-filled .hi-v4-input__inner:not(.disabled):hover {\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-input--appearance-filled .hi-v4-input__inner:not(.disabled).focused {\n -webkit-box-shadow: 0 0 0 2px #bde2ff;\n box-shadow: 0 0 0 2px #bde2ff;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n box-shadow: 0 0 0 2px var(--hi-v4-color-brandblue-100, #bde2ff);\n border-color: #237ffa;\n border-color: var(--hi-v4-color-brandblue-500, #237ffa);\n background-color: #fff;\n background-color: var(--hi-v4-color-static-white, #fff); }\n.hi-v4-input--appearance-filled .hi-v4-input__inner:not(.disabled).invalid {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-input--appearance-filled .hi-v4-input__inner:not(.disabled).invalid.hover {\n border-color: #ff5959;\n border-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-input--appearance-filled .hi-v4-input__inner:not(.disabled).invalid.focused {\n -webkit-box-shadow: 0 0 0 2px #ffd1c9;\n box-shadow: 0 0 0 2px #ffd1c9;\n -webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9);\n box-shadow: 0 0 0 2px var(--hi-v4-color-red-100, #ffd1c9); }\n.hi-v4-input--appearance-underline .hi-v4-input {\n padding-left: 0;\n padding-right: 0; }\n.hi-v4-input--appearance-underline.hi-v4-input__outer--prepend .hi-v4-input,\n .hi-v4-input--appearance-underline .hi-v4-input__inner--prefix .hi-v4-input {\n padding-left: calc(12px - 1px);\n padding-left: calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--appearance-underline.hi-v4-input__outer--append .hi-v4-input,\n .hi-v4-input--appearance-underline .hi-v4-input__inner--suffix .hi-v4-input {\n padding-right: calc(12px - 1px);\n padding-right: calc(var(--hi-v4-spacing-6, 12px) - 1px); }\n.hi-v4-input--appearance-underline .hi-v4-input__inner {\n border-radius: 0; }\n.hi-v4-input--appearance-underline .hi-v4-input__inner::after {\n content: '';\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: block;\n position: absolute;\n bottom: 0;\n left: -1px;\n right: -1px;\n border-bottom: 1px solid #dfe2e8;\n border-bottom: 1px solid var(--hi-v4-color-gray-300, #dfe2e8);\n -webkit-transition: all 0.3s;\n transition: all 0.3s; }\n.hi-v4-input--appearance-underline .hi-v4-input__inner:not(.disabled):hover::after {\n border-bottom-color: #237ffa;\n border-bottom-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-input--appearance-underline .hi-v4-input__inner:not(.disabled).focused::after {\n border-bottom-color: #237ffa;\n border-bottom-color: var(--hi-v4-color-brandblue-500, #237ffa); }\n.hi-v4-input--appearance-underline .hi-v4-input__inner:not(.disabled).invalid::after {\n border-bottom-color: #ff5959;\n border-bottom-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-input--appearance-underline .hi-v4-input__inner:not(.disabled).invalid.hover::after {\n border-bottom-color: #ff5959;\n border-bottom-color: var(--hi-v4-color-red-500, #ff5959); }\n.hi-v4-input--appearance-outline .hi-v4-input__inner.disabled, .hi-v4-input--appearance-unset .hi-v4-input__inner.disabled, .hi-v4-input--appearance-filled .hi-v4-input__inner.disabled, .hi-v4-input--appearance-underline .hi-v4-input__inner.disabled {\n color: #c9ced6;\n color: var(--hi-v4-color-gray-400, #c9ced6);\n background-color: #ebedf0;\n background-color: var(--hi-v4-color-gray-200, #ebedf0); }\n.hi-v4-input__outer--prepend .hi-v4-input__inner {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n.hi-v4-input__outer--prepend-unset .hi-v4-input__prepend {\n border: none;\n padding: 0; }\n.hi-v4-input__outer--prepend-unset .hi-v4-input__prepend .hi-v4-mock-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n.hi-v4-input__outer--prepend-unset .hi-v4-input__prepend .hi-v4-button {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n.hi-v4-input__outer--append .hi-v4-input__inner {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n.hi-v4-input__outer--append-unset .hi-v4-input__append {\n border: none;\n padding: 0; }\n.hi-v4-input__outer--append-unset .hi-v4-input__append .hi-v4-mock-input {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n.hi-v4-input__outer--append-unset .hi-v4-input__append .hi-v4-button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n";
|
21
|
+
|
22
|
+
var __styleInject__ = require('style-inject/dist/style-inject.es.js')["default"];
|
23
|
+
|
24
|
+
__styleInject__(css_248z);
|
25
|
+
|
26
|
+
export default css_248z;
|
27
|
+
//# sourceMappingURL=index.scss.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { DataSourceFunc, FieldNames, TreeSelectDataItem, TreeSelectDataSource } from './types';
|
3
|
+
import { PopperProps } from '@hi-ui/popper';
|
4
|
+
import { TreeNodeEventData } from '@hi-ui/tree';
|
5
|
+
import { PickerProps } from '@hi-ui/picker';
|
6
|
+
/**
|
7
|
+
* TODO: What is TreeSelect
|
8
|
+
*/
|
9
|
+
export declare const TreeSelect: React.ForwardRefExoticComponent<TreeSelectProps & React.RefAttributes<HTMLDivElement | null>>;
|
10
|
+
export interface TreeSelectProps extends Omit<PickerProps, 'data' | 'onChange' | 'trigger'> {
|
11
|
+
/**
|
12
|
+
* 展示数据
|
13
|
+
*/
|
14
|
+
data?: TreeSelectDataItem[];
|
15
|
+
/**
|
16
|
+
* 设置 data 中 id, title, disabled, children 对应的 key (3.0 新增) object - { title: 'title', id: 'id',disabled:'disabled', children: 'children'}
|
17
|
+
*/
|
18
|
+
fieldNames?: FieldNames;
|
19
|
+
/**
|
20
|
+
* 数据回显模式 string
|
21
|
+
* ALL: 所有被选中节点,不区分父子节点
|
22
|
+
* PARENT: 当所有子节点被选中时将只保留父节点
|
23
|
+
* CHILD: 仅显示子节点
|
24
|
+
*/
|
25
|
+
showCheckedMode?: 'ALL' | 'PARENT' | 'CHILD';
|
26
|
+
/**
|
27
|
+
* 数据选择类型
|
28
|
+
*/
|
29
|
+
type?: 'single' | 'multiple';
|
30
|
+
/**
|
31
|
+
* 是否有边框
|
32
|
+
*/
|
33
|
+
bordered?: boolean;
|
34
|
+
/**
|
35
|
+
* 是否禁用
|
36
|
+
*/
|
37
|
+
disabled?: boolean;
|
38
|
+
/**
|
39
|
+
* 是否默认展开所有树节点
|
40
|
+
*/
|
41
|
+
defaultExpandAll?: boolean;
|
42
|
+
/**
|
43
|
+
* 展开的节点(受控)
|
44
|
+
*/
|
45
|
+
expandedIds?: React.ReactText[];
|
46
|
+
/**
|
47
|
+
* 默认展开的节点(非受控)
|
48
|
+
*/
|
49
|
+
defaultExpandedIds?: React.ReactText[];
|
50
|
+
/**
|
51
|
+
* 节点被点击(展开/收起)时触发
|
52
|
+
*/
|
53
|
+
onExpand?: () => void;
|
54
|
+
/**
|
55
|
+
* 默认选中项 (非受控)
|
56
|
+
*/
|
57
|
+
defaultValue?: React.ReactText;
|
58
|
+
/**
|
59
|
+
* 默认选中项 (受控)
|
60
|
+
*/
|
61
|
+
value?: React.ReactText;
|
62
|
+
/**
|
63
|
+
* 自定义渲染 Input 中展示内容
|
64
|
+
*/
|
65
|
+
displayRender?: (item: TreeSelectDataItem) => React.ReactNode;
|
66
|
+
/**
|
67
|
+
* 输入框占位 string - 请选择
|
68
|
+
*/
|
69
|
+
placeholder?: string;
|
70
|
+
/**
|
71
|
+
* 节点搜索模式,仅在mode=normal模式下生效
|
72
|
+
*/
|
73
|
+
searchMode?: 'highlight' | 'filter';
|
74
|
+
/**
|
75
|
+
* 自定义搜索过滤器,仅在 searchable 为 true 时有效
|
76
|
+
* 第一个参数为输入的关键字,
|
77
|
+
* 第二个为数据项,返回值为 true 时将出现在结果项
|
78
|
+
*/
|
79
|
+
filterOption?: (keyword: string, item: TreeSelectDataItem) => boolean;
|
80
|
+
/**
|
81
|
+
* 自定义渲染节点的 title 内容
|
82
|
+
*/
|
83
|
+
titleRender?: (node: TreeNodeEventData) => React.ReactNode;
|
84
|
+
/**
|
85
|
+
* 点击异步加载子项
|
86
|
+
*/
|
87
|
+
onLoadChildren?: (node: TreeNodeEventData) => void | Promise<TreeSelectDataItem[] | void>;
|
88
|
+
/**
|
89
|
+
* 从远端获取数据,初始时是否自动加载
|
90
|
+
*/
|
91
|
+
autoload?: boolean;
|
92
|
+
/**
|
93
|
+
* 异步加载数据
|
94
|
+
*/
|
95
|
+
dataSource?: DataSourceFunc | TreeSelectDataSource | Promise<TreeSelectDataItem[]>;
|
96
|
+
/**
|
97
|
+
* 没有选项时的提示
|
98
|
+
*/
|
99
|
+
emptyContent?: React.ReactNode;
|
100
|
+
/**
|
101
|
+
* 自定义下拉选项宽度
|
102
|
+
*/
|
103
|
+
optionWidth?: number;
|
104
|
+
/**
|
105
|
+
* 下拉根元素的类名称 (3.0 新增)
|
106
|
+
*/
|
107
|
+
overlayClassName?: string;
|
108
|
+
/**
|
109
|
+
* 选中时触发
|
110
|
+
* checkedIds | checkedId: 选中项 ID 集合 | ID
|
111
|
+
* checkedNodes | checkedNode: 选中项数据项集合|数据项
|
112
|
+
* currentNode: 当前操作节点
|
113
|
+
*/
|
114
|
+
onChange?: (selectedIds: React.ReactText, changedItem: TreeSelectDataItem, currentNode: TreeSelectDataItem) => void;
|
115
|
+
/**
|
116
|
+
* 是否可清空
|
117
|
+
*/
|
118
|
+
clearable?: boolean;
|
119
|
+
/**
|
120
|
+
* 自定义控制 popper 行为
|
121
|
+
*/
|
122
|
+
popper?: PopperProps;
|
123
|
+
/**
|
124
|
+
* 设置展现形式
|
125
|
+
*/
|
126
|
+
appearance?: 'outline' | 'unset' | 'filled';
|
127
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export interface TreeSelectDataItem {
|
3
|
+
/**
|
4
|
+
* 节点唯一 id
|
5
|
+
*/
|
6
|
+
id: React.ReactText;
|
7
|
+
/**
|
8
|
+
* 节点标题
|
9
|
+
*/
|
10
|
+
title: React.ReactNode;
|
11
|
+
/**
|
12
|
+
* 子级数据
|
13
|
+
*/
|
14
|
+
children?: TreeSelectDataItem[];
|
15
|
+
/**
|
16
|
+
* 是否禁用
|
17
|
+
*/
|
18
|
+
disabled?: boolean;
|
19
|
+
}
|
20
|
+
export interface TreeSelectDataSource<T = any> {
|
21
|
+
/**
|
22
|
+
* 请求的 url
|
23
|
+
*/
|
24
|
+
url?: string;
|
25
|
+
/**
|
26
|
+
* 请求方法
|
27
|
+
*/
|
28
|
+
type?: 'get' | 'post';
|
29
|
+
/**
|
30
|
+
* post 请求时请求体参数
|
31
|
+
*/
|
32
|
+
data?: object;
|
33
|
+
/**
|
34
|
+
* url 查询参数
|
35
|
+
*/
|
36
|
+
params?: object;
|
37
|
+
/**
|
38
|
+
* 请求头
|
39
|
+
*/
|
40
|
+
headers?: object;
|
41
|
+
/**
|
42
|
+
* 请求模式
|
43
|
+
*/
|
44
|
+
mode?: 'same-origin' | 'cors' | 'no-cors' | 'navigate' | 'same-origin';
|
45
|
+
/**
|
46
|
+
* 成功时的回调,用于对数据进行预处理
|
47
|
+
*/
|
48
|
+
transformResponse?: (response: object) => T;
|
49
|
+
}
|
50
|
+
export declare type FilterOptionFunc = (keyword: string, item: TreeSelectDataItem) => boolean;
|
51
|
+
export declare type DataSourceFunc = (keyword: string) => TreeSelectDataSource;
|
52
|
+
export declare type FieldNames = {
|
53
|
+
id?: string;
|
54
|
+
title?: string;
|
55
|
+
disabled?: string;
|
56
|
+
children?: string;
|
57
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { TreeSelectDataItem } from './types';
|
2
|
+
export declare const useTreeSelect: ({ data: dataProp, ...rest }: UseTreeSelectProps) => {
|
3
|
+
rootProps: {};
|
4
|
+
};
|
5
|
+
export interface UseTreeSelectProps {
|
6
|
+
data?: TreeSelectDataItem[];
|
7
|
+
}
|
8
|
+
export declare type UseTreeSelectReturn = ReturnType<typeof useTreeSelect>;
|
package/package.json
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
{
|
2
|
+
"name": "@hi-ui/tree-select",
|
3
|
+
"version": "4.0.0-alpha.3",
|
4
|
+
"description": "A sub-package for @hi-ui/hiui.",
|
5
|
+
"keywords": [],
|
6
|
+
"author": "HIUI <mi-hiui@xiaomi.com>",
|
7
|
+
"homepage": "https://github.com/XiaoMi/hiui/tree/master/packages/ui/tree-select#readme",
|
8
|
+
"license": "MIT",
|
9
|
+
"directories": {
|
10
|
+
"lib": "lib",
|
11
|
+
"test": "__tests__"
|
12
|
+
},
|
13
|
+
"files": [
|
14
|
+
"lib"
|
15
|
+
],
|
16
|
+
"main": "lib/cjs/index.js",
|
17
|
+
"module": "lib/esm/index.js",
|
18
|
+
"types": "lib/types/index.d.ts",
|
19
|
+
"typings": "lib/types/index.d.ts",
|
20
|
+
"exports": {
|
21
|
+
".": {
|
22
|
+
"require": "./lib/cjs/index.js",
|
23
|
+
"default": "./lib/esm/index.js"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"publishConfig": {
|
27
|
+
"access": "public"
|
28
|
+
},
|
29
|
+
"repository": {
|
30
|
+
"type": "git",
|
31
|
+
"url": "git+https://github.com/XiaoMi/hiui.git"
|
32
|
+
},
|
33
|
+
"scripts": {
|
34
|
+
"test": "jest",
|
35
|
+
"clean": "rimraf lib",
|
36
|
+
"prebuild": "yarn clean",
|
37
|
+
"build:esm": "hi-build ./src/index.ts --format esm -d ./lib/esm",
|
38
|
+
"build:cjs": "hi-build ./src/index.ts --format cjs -d ./lib/cjs",
|
39
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib/types",
|
40
|
+
"build": "concurrently yarn:build:*"
|
41
|
+
},
|
42
|
+
"bugs": {
|
43
|
+
"url": "https://github.com/XiaoMi/hiui/issues"
|
44
|
+
},
|
45
|
+
"dependencies": {
|
46
|
+
"@hi-ui/classname": "^4.0.0-alpha.0",
|
47
|
+
"@hi-ui/core": "^4.0.0-alpha.10",
|
48
|
+
"@hi-ui/core-css": "^4.0.0-alpha.8",
|
49
|
+
"@hi-ui/env": "^4.0.0-alpha.0",
|
50
|
+
"@hi-ui/highlighter": "^4.0.0-alpha.2",
|
51
|
+
"@hi-ui/icons": "^4.0.0-alpha.15",
|
52
|
+
"@hi-ui/picker": "^4.0.0-alpha.2",
|
53
|
+
"@hi-ui/popper": "^4.0.0-alpha.13",
|
54
|
+
"@hi-ui/tag-input": "^4.0.0-alpha.10",
|
55
|
+
"@hi-ui/tree": "^4.0.0-alpha.23",
|
56
|
+
"@hi-ui/tree-utils": "^4.0.0-alpha.6",
|
57
|
+
"@hi-ui/type-assertion": "^4.0.0-alpha.11",
|
58
|
+
"@hi-ui/use-search-mode": "^4.0.0-alpha.2",
|
59
|
+
"@hi-ui/use-toggle": "^4.0.0-alpha.8",
|
60
|
+
"@hi-ui/use-uncontrolled-state": "^4.0.0-alpha.10",
|
61
|
+
"lodash": "^4.17.21"
|
62
|
+
},
|
63
|
+
"peerDependencies": {
|
64
|
+
"react": "^17.0.1",
|
65
|
+
"react-dom": "^17.0.1"
|
66
|
+
},
|
67
|
+
"devDependencies": {
|
68
|
+
"@hi-ui/hi-build": "^4.0.0-alpha.0",
|
69
|
+
"react": "^17.0.1",
|
70
|
+
"react-dom": "^17.0.1"
|
71
|
+
},
|
72
|
+
"gitHead": "734a594a67ed76aa6e36772532e67b53048f2dae"
|
73
|
+
}
|