@hi-ui/table 4.5.6-alpha.0 → 4.6.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/CHANGELOG.md +334 -0
- package/lib/cjs/Table.js +17 -4
- package/lib/cjs/hooks/use-check.js +9 -1
- package/lib/cjs/packages/ui/radio/lib/esm/Radio.js +100 -0
- package/lib/cjs/packages/ui/radio/lib/esm/RadioGroup.js +104 -0
- package/lib/cjs/packages/ui/radio/lib/esm/context.js +37 -0
- package/lib/cjs/packages/ui/radio/lib/esm/index.js +33 -0
- package/lib/cjs/packages/ui/radio/lib/esm/styles/index.scss.js +35 -0
- package/lib/cjs/packages/ui/radio/lib/esm/types.js +34 -0
- package/lib/cjs/packages/ui/radio/lib/esm/use-radio-group.js +61 -0
- package/lib/cjs/packages/ui/radio/lib/esm/use-radio.js +88 -0
- package/lib/esm/Table.js +17 -4
- package/lib/esm/hooks/use-check.js +9 -1
- package/lib/esm/packages/ui/radio/lib/esm/Radio.js +88 -0
- package/lib/esm/packages/ui/radio/lib/esm/RadioGroup.js +92 -0
- package/lib/esm/packages/ui/radio/lib/esm/context.js +31 -0
- package/lib/esm/packages/ui/radio/lib/esm/index.js +26 -0
- package/lib/esm/packages/ui/radio/lib/esm/styles/index.scss.js +23 -0
- package/lib/esm/packages/ui/radio/lib/esm/types.js +27 -0
- package/lib/esm/packages/ui/radio/lib/esm/use-radio-group.js +56 -0
- package/lib/esm/packages/ui/radio/lib/esm/use-radio.js +83 -0
- package/lib/types/hooks/use-check.d.ts +1 -0
- package/lib/types/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, '__esModule', {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
require('./styles/index.scss.js');
|
|
16
|
+
var Radio$1 = require('./Radio.js');
|
|
17
|
+
var RadioGroup = require('./RadioGroup.js');
|
|
18
|
+
|
|
19
|
+
/** @LICENSE
|
|
20
|
+
* @hi-ui/radio
|
|
21
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
var Radio = Object.assign(Radio$1.Radio, {
|
|
29
|
+
Group: RadioGroup.RadioGroup
|
|
30
|
+
});
|
|
31
|
+
exports.Radio = Radio$1.Radio;
|
|
32
|
+
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
33
|
+
exports["default"] = Radio;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
13
|
+
Object.defineProperty(exports, '__esModule', {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
16
|
+
var __styleInject__ = require('@hi-ui/style-inject');
|
|
17
|
+
function _interopDefaultCompat(e) {
|
|
18
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
19
|
+
'default': e
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
var __styleInject____default = /*#__PURE__*/_interopDefaultCompat(__styleInject__);
|
|
23
|
+
|
|
24
|
+
/** @LICENSE
|
|
25
|
+
* @hi-ui/radio
|
|
26
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the MIT license found in the
|
|
31
|
+
* LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/
|
|
33
|
+
var css_248z = ".hi-v4-radio {overflow-wrap: break-word;font-size: var(--hi-v4-text-size-md, 0.875rem);line-height: var(--hi-v4-text-lineheight-md, 1.375rem);position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: pointer;display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;vertical-align: middle;}.hi-v4-radio--type-button {height: 32px;padding: 0 12px;color: var(--hi-v4-color-gray-600, #5f6a7a);background: var(--hi-v4-color-gray-100, #f2f4f7);cursor: pointer;-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);}.hi-v4-radio--type-button .hi-v4-radio__input {display: none;}.hi-v4-radio--type-button .hi-v4-radio__input:focus + .hi-v4-radio__label {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-button .hi-v4-radio__controller {display: none;}.hi-v4-radio--type-button:hover, .hi-v4-radio--type-button[data-checked] {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-button[data-disabled] {cursor: not-allowed;background: var(--hi-v4-color-gray-200, #ebedf0);color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-radio--type-button[data-checked].hi-v4-radio--type-button[data-disabled] {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-300, var(--hi-v4-color-brandblue-300, #70b8ff));}.hi-v4-radio--type-default .hi-v4-radio__input:focus + .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));}.hi-v4-radio--type-default .hi-v4-radio__controller {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;width: 16px;height: 16px;border: 1px solid var(--hi-v4-color-gray-300, #dfe2e8);border-radius: var(--hi-v4-border-radius-full, 9999px);-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);-webkit-box-flex: 0;-ms-flex: none;flex: none;}.hi-v4-radio--type-default .hi-v4-radio__controller::after {position: absolute;top: 0;left: 0;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;width: 14px;height: 14px;content: \"\";background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: var(--hi-v4-border-radius-full, 9999px);opacity: 0;-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);-webkit-transform: scale(0);transform: scale(0);}.hi-v4-radio--type-default .hi-v4-radio__label {-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-margin-start: var(--hi-v4-spacing-4, 8px);margin-inline-start: var(--hi-v4-spacing-4, 8px);color: var(--hi-v4-color-gray-700, #1f2733);}.hi-v4-radio--type-default:hover .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-default[data-checked] .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-default[data-checked] .hi-v4-radio__controller::after {opacity: 1;-webkit-transform: scale(0.3);transform: scale(0.3);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-radio--type-default[data-checked].hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));opacity: 0.4;}.hi-v4-radio--type-default[data-checked].hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller::after {opacity: 1;-webkit-transform: scale(0.3);transform: scale(0.3);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-radio--type-default[data-disabled] {cursor: not-allowed;}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller {border-color: var(--hi-v4-color-gray-300, #dfe2e8);background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller::after {background: var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__label {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-radio-group {position: relative;}.hi-v4-radio-group--data-wrap {display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;z-index: var(--hi-v4-zindex-normal, 0);}.hi-v4-radio-group--type-button {border-radius: var(--hi-v4-border-radius-md, 4px);overflow: hidden;}.hi-v4-radio-group--type-default.hi-v4-radio-group--data-wrap {gap: var(--hi-v4-spacing-8, 16px);}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--data-wrap {-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--auto-width {display: -webkit-box;display: -ms-flexbox;display: flex;}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--auto-width .hi-v4-radio--type-button {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-radio-group--placement-horizontal .hi-v4-radio--type-button::after {content: \"\";background: var(--hi-v4-color-gray-300, #dfe2e8);width: 1px;left: 100%;top: 8px;bottom: 8px;position: absolute;z-index: var(--hi-v4-zindex-absolute, 1);}.hi-v4-radio-group--placement-vertical {-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v4-radio-group--placement-vertical .hi-v4-radio--type-button::after {content: \"\";background: var(--hi-v4-color-gray-300, #dfe2e8);height: 1px;left: 8px;right: 8px;top: 100%;position: absolute;z-index: var(--hi-v4-zindex-absolute, 1);}";
|
|
34
|
+
__styleInject____default["default"](css_248z);
|
|
35
|
+
exports["default"] = css_248z;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, '__esModule', {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/** @LICENSE
|
|
17
|
+
* @hi-ui/radio
|
|
18
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#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
|
+
var RadioGroupPlacementEnum = {
|
|
26
|
+
VERTICAL: 'vertical',
|
|
27
|
+
HORIZONTAL: 'horizontal'
|
|
28
|
+
};
|
|
29
|
+
var RadioGroupTypeEnum = {
|
|
30
|
+
DEFAULT: 'default',
|
|
31
|
+
BUTTON: 'button'
|
|
32
|
+
};
|
|
33
|
+
exports.RadioGroupPlacementEnum = RadioGroupPlacementEnum;
|
|
34
|
+
exports.RadioGroupTypeEnum = RadioGroupTypeEnum;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, '__esModule', {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
var tslib = require('tslib');
|
|
16
|
+
var React = require('react');
|
|
17
|
+
var useUncontrolledState = require('@hi-ui/use-uncontrolled-state');
|
|
18
|
+
|
|
19
|
+
/** @LICENSE
|
|
20
|
+
* @hi-ui/radio
|
|
21
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
var useRadioGroup = function useRadioGroup(_a) {
|
|
29
|
+
var name = _a.name,
|
|
30
|
+
valueProp = _a.value,
|
|
31
|
+
onChange = _a.onChange,
|
|
32
|
+
_a$defaultValue = _a.defaultValue,
|
|
33
|
+
defaultValue = _a$defaultValue === void 0 ? '' : _a$defaultValue,
|
|
34
|
+
_a$disabled = _a.disabled,
|
|
35
|
+
disabled = _a$disabled === void 0 ? false : _a$disabled,
|
|
36
|
+
rest = tslib.__rest(_a, ["name", "value", "onChange", "defaultValue", "disabled"]);
|
|
37
|
+
var _useUncontrolledState = useUncontrolledState.useUncontrolledState(defaultValue, valueProp, onChange),
|
|
38
|
+
value = _useUncontrolledState[0],
|
|
39
|
+
tryChangeValue = _useUncontrolledState[1];
|
|
40
|
+
var handleChange = React.useCallback(function (value) {
|
|
41
|
+
if (disabled) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
tryChangeValue(value);
|
|
45
|
+
}, [disabled, tryChangeValue]);
|
|
46
|
+
var isChecked = React.useCallback(function (valueArg) {
|
|
47
|
+
return valueArg === value;
|
|
48
|
+
}, [value]);
|
|
49
|
+
var rootProps = Object.assign(Object.assign({}, rest), {
|
|
50
|
+
role: 'radiogroup'
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
rootProps: rootProps,
|
|
54
|
+
value: value,
|
|
55
|
+
onChange: handleChange,
|
|
56
|
+
name: name,
|
|
57
|
+
isChecked: isChecked,
|
|
58
|
+
disabled: disabled
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
exports.useRadioGroup = useRadioGroup;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, '__esModule', {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
var tslib = require('tslib');
|
|
16
|
+
var React = require('react');
|
|
17
|
+
var useUncontrolledState = require('@hi-ui/use-uncontrolled-state');
|
|
18
|
+
var domUtils = require('@hi-ui/dom-utils');
|
|
19
|
+
|
|
20
|
+
/** @LICENSE
|
|
21
|
+
* @hi-ui/radio
|
|
22
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
var useRadio = function useRadio(_a) {
|
|
30
|
+
var nameProp = _a.name,
|
|
31
|
+
valueProp = _a.value,
|
|
32
|
+
_a$autoFocus = _a.autoFocus,
|
|
33
|
+
autoFocus = _a$autoFocus === void 0 ? false : _a$autoFocus,
|
|
34
|
+
_a$defaultChecked = _a.defaultChecked,
|
|
35
|
+
defaultChecked = _a$defaultChecked === void 0 ? false : _a$defaultChecked,
|
|
36
|
+
onChange = _a.onChange,
|
|
37
|
+
checkedProp = _a.checked,
|
|
38
|
+
_a$readOnly = _a.readOnly,
|
|
39
|
+
readOnly = _a$readOnly === void 0 ? false : _a$readOnly,
|
|
40
|
+
_a$disabled = _a.disabled,
|
|
41
|
+
disabled = _a$disabled === void 0 ? false : _a$disabled,
|
|
42
|
+
rest = tslib.__rest(_a, ["name", "value", "autoFocus", "defaultChecked", "onChange", "checked", "readOnly", "disabled"]);
|
|
43
|
+
var _useUncontrolledState = useUncontrolledState.useUncontrolledState(defaultChecked, checkedProp, function (_, evt) {
|
|
44
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(evt);
|
|
45
|
+
}),
|
|
46
|
+
checked = _useUncontrolledState[0],
|
|
47
|
+
tryChangeChecked = _useUncontrolledState[1];
|
|
48
|
+
var nonInteractive = disabled || readOnly;
|
|
49
|
+
var handleChange = React.useCallback(function (evt) {
|
|
50
|
+
if (nonInteractive) {
|
|
51
|
+
// 不可交互,不触发事件的任何默认行为
|
|
52
|
+
evt.preventDefault();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
tryChangeChecked(evt.target.checked, evt);
|
|
56
|
+
}, [nonInteractive, tryChangeChecked]);
|
|
57
|
+
var getInputProps = React.useCallback(function () {
|
|
58
|
+
return {
|
|
59
|
+
style: domUtils.hiddenStyle,
|
|
60
|
+
type: 'radio',
|
|
61
|
+
checked: checked,
|
|
62
|
+
disabled: disabled,
|
|
63
|
+
readOnly: readOnly,
|
|
64
|
+
onChange: handleChange,
|
|
65
|
+
autoFocus: autoFocus,
|
|
66
|
+
name: nameProp,
|
|
67
|
+
value: valueProp
|
|
68
|
+
};
|
|
69
|
+
}, [nameProp, handleChange, checked, disabled, readOnly, autoFocus, valueProp]);
|
|
70
|
+
var state = React.useMemo(function () {
|
|
71
|
+
return {
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
checked: checked,
|
|
74
|
+
readOnly: readOnly
|
|
75
|
+
};
|
|
76
|
+
}, [disabled, checked, readOnly]);
|
|
77
|
+
var rootProps = Object.assign(Object.assign({}, rest), {
|
|
78
|
+
'data-disabled': domUtils.setAttrStatus(disabled),
|
|
79
|
+
'data-checked': domUtils.setAttrStatus(checked),
|
|
80
|
+
'data-readonly': domUtils.setAttrStatus(readOnly)
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
state: state,
|
|
84
|
+
rootProps: rootProps,
|
|
85
|
+
getInputProps: getInputProps
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
exports.useRadio = useRadio;
|
package/lib/esm/Table.js
CHANGED
|
@@ -20,6 +20,7 @@ import { withDefaultProps } from '@hi-ui/react-utils';
|
|
|
20
20
|
import { TableSettingMenu } from './TableSettingMenu.js';
|
|
21
21
|
import Loading from '@hi-ui/loading';
|
|
22
22
|
import Checkbox from '@hi-ui/checkbox';
|
|
23
|
+
import Radio from './packages/ui/radio/lib/esm/index.js';
|
|
23
24
|
import { useTableCheck } from './hooks/use-check.js';
|
|
24
25
|
import { isNullish } from '@hi-ui/type-assertion';
|
|
25
26
|
import { cloneTree, flattenTree } from '@hi-ui/tree-utils';
|
|
@@ -180,16 +181,19 @@ var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
180
181
|
tryCheckAllRow = _useTableCheck.tryCheckAllRow,
|
|
181
182
|
isCheckedRowKey = _useTableCheck.isCheckedRowKey,
|
|
182
183
|
onCheckedRowKeysChange = _useTableCheck.onCheckedRowKeysChange,
|
|
184
|
+
onRadioCheckedRowKeysChange = _useTableCheck.onRadioCheckedRowKeysChange,
|
|
183
185
|
checkRowIsDisabledCheckbox = _useTableCheck.checkRowIsDisabledCheckbox;
|
|
184
186
|
// 表格列多选操作区
|
|
185
187
|
var getSelectionColumn = React__default.useCallback(function (rowSelection) {
|
|
188
|
+
var _rowSelection$type = rowSelection.type,
|
|
189
|
+
type = _rowSelection$type === void 0 ? 'checkbox' : _rowSelection$type;
|
|
186
190
|
var renderCell = function renderCell(_, rowItem, rowIndex) {
|
|
187
191
|
var rowKey = getRowKeyField(rowItem);
|
|
188
192
|
var checked = isCheckedRowKey(rowKey);
|
|
189
193
|
var disabledCheckbox = checkRowIsDisabledCheckbox(rowItem);
|
|
190
194
|
return {
|
|
191
|
-
node: ( /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
192
|
-
checked:
|
|
195
|
+
node: type === 'checkbox' ? ( /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
196
|
+
checked: checked,
|
|
193
197
|
disabled: disabledCheckbox,
|
|
194
198
|
onChange: function onChange(evt) {
|
|
195
199
|
onCheckedRowKeysChange(rowItem, evt.target.checked);
|
|
@@ -197,6 +201,15 @@ var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
197
201
|
onClick: function onClick(evt) {
|
|
198
202
|
evt.stopPropagation();
|
|
199
203
|
}
|
|
204
|
+
})) : ( /*#__PURE__*/React__default.createElement(Radio, {
|
|
205
|
+
checked: checked,
|
|
206
|
+
disabled: disabledCheckbox,
|
|
207
|
+
onChange: function onChange(evt) {
|
|
208
|
+
onRadioCheckedRowKeysChange(rowItem, evt.target.checked);
|
|
209
|
+
},
|
|
210
|
+
onClick: function onClick(evt) {
|
|
211
|
+
evt.stopPropagation();
|
|
212
|
+
}
|
|
200
213
|
})),
|
|
201
214
|
checked: checked
|
|
202
215
|
};
|
|
@@ -247,12 +260,12 @@ var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
247
260
|
// selectionColumn 宽度固定,防止自动被拉伸
|
|
248
261
|
fixed: true,
|
|
249
262
|
className: prefixCls + "__selection-col",
|
|
250
|
-
title: renderSelectionTitleCell,
|
|
263
|
+
title: type === 'checkbox' ? renderSelectionTitleCell : undefined,
|
|
251
264
|
// @ts-ignore
|
|
252
265
|
render: renderSelectionCell
|
|
253
266
|
};
|
|
254
267
|
return selectionColumn;
|
|
255
|
-
}, [
|
|
268
|
+
}, [checkboxColWidth, prefixCls, getRowKeyField, isCheckedRowKey, checkRowIsDisabledCheckbox, onCheckedRowKeysChange, onRadioCheckedRowKeysChange, checkedAll, semiChecked, tryCheckAllRow]);
|
|
256
269
|
var mergedColumns = React__default.useMemo(function () {
|
|
257
270
|
if (rowSelection) {
|
|
258
271
|
var selectionColumn = getSelectionColumn(rowSelection);
|
|
@@ -59,6 +59,13 @@ var useTableCheck = function useTableCheck(_ref) {
|
|
|
59
59
|
}
|
|
60
60
|
handleCheckedRowKeysChange(rowItem, checked);
|
|
61
61
|
}, [checkedRowDataItems, checkedRowKeys, fieldKey, handleCheckedRowKeysChange]);
|
|
62
|
+
var onRadioCheckedRowKeysChange = React__default.useCallback(function (rowItem, checked) {
|
|
63
|
+
var _a;
|
|
64
|
+
checkedRowDataItemsRef.current = [rowItem];
|
|
65
|
+
trySetCheckedRowKeys((_a = checkedRowDataItemsRef.current) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
66
|
+
return item[fieldKey];
|
|
67
|
+
}), rowItem, checked, checkedRowDataItemsRef.current);
|
|
68
|
+
}, [fieldKey, trySetCheckedRowKeys]);
|
|
62
69
|
// 判断是否全选
|
|
63
70
|
var _React$useMemo = React__default.useMemo(function () {
|
|
64
71
|
if (rowSelection) {
|
|
@@ -118,12 +125,13 @@ var useTableCheck = function useTableCheck(_ref) {
|
|
|
118
125
|
});
|
|
119
126
|
return Array.from(checkedRowKeysSet);
|
|
120
127
|
}, targetRowItems, true, checkedRowDataItemsRef.current);
|
|
121
|
-
}, [
|
|
128
|
+
}, [flattedData, checkedAll, trySetCheckedRowKeys, checkRowIsDisabledCheckbox, fieldKey]);
|
|
122
129
|
return {
|
|
123
130
|
tryCheckAllRow: tryCheckAllRow,
|
|
124
131
|
checkedAll: checkedAll,
|
|
125
132
|
semiChecked: semiChecked,
|
|
126
133
|
onCheckedRowKeysChange: onCheckedRowKeysChange,
|
|
134
|
+
onRadioCheckedRowKeysChange: onRadioCheckedRowKeysChange,
|
|
127
135
|
isCheckedRowKey: isCheckedRowKey,
|
|
128
136
|
checkedRowKeys: checkedRowKeys,
|
|
129
137
|
trySetCheckedRowKeys: trySetCheckedRowKeys,
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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__default, { forwardRef } from 'react';
|
|
12
|
+
import { getPrefixCls, cx } from '@hi-ui/classname';
|
|
13
|
+
import { __DEV__ } from '@hi-ui/env';
|
|
14
|
+
import { useRadio } from './use-radio.js';
|
|
15
|
+
import { useRadioGroupContext } from './context.js';
|
|
16
|
+
import { isNullish } from '@hi-ui/type-assertion';
|
|
17
|
+
import { callAllFuncs } from '@hi-ui/func-utils';
|
|
18
|
+
|
|
19
|
+
/** @LICENSE
|
|
20
|
+
* @hi-ui/radio
|
|
21
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
var RADIO_PREFIX = getPrefixCls('radio');
|
|
29
|
+
/**
|
|
30
|
+
* 单选
|
|
31
|
+
*/
|
|
32
|
+
var Radio = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
33
|
+
var _a$prefixCls = _a.prefixCls,
|
|
34
|
+
prefixCls = _a$prefixCls === void 0 ? RADIO_PREFIX : _a$prefixCls,
|
|
35
|
+
_a$role = _a.role,
|
|
36
|
+
role = _a$role === void 0 ? 'radio' : _a$role,
|
|
37
|
+
className = _a.className,
|
|
38
|
+
children = _a.children,
|
|
39
|
+
rest = __rest(_a, ["prefixCls", "role", "className", "children"]);
|
|
40
|
+
var groupContext = useRadioGroupContext();
|
|
41
|
+
var _ref = groupContext || {},
|
|
42
|
+
disabledContext = _ref.disabled,
|
|
43
|
+
isCheckedContext = _ref.isChecked,
|
|
44
|
+
nameContext = _ref.name,
|
|
45
|
+
onChangeContext = _ref.onChange,
|
|
46
|
+
_ref$type = _ref.type,
|
|
47
|
+
type = _ref$type === void 0 ? 'default' : _ref$type;
|
|
48
|
+
var checkedProp = rest.checked,
|
|
49
|
+
valueProp = rest.value,
|
|
50
|
+
_rest$disabled = rest.disabled,
|
|
51
|
+
disabled = _rest$disabled === void 0 ? disabledContext : _rest$disabled,
|
|
52
|
+
_rest$name = rest.name,
|
|
53
|
+
name = _rest$name === void 0 ? nameContext : _rest$name,
|
|
54
|
+
onChangeProp = rest.onChange;
|
|
55
|
+
// Group's priority is higher than its own.
|
|
56
|
+
var checked = isCheckedContext && !isNullish(valueProp) ? isCheckedContext(valueProp) : checkedProp;
|
|
57
|
+
var onChange = onChangeContext && !isNullish(valueProp) ? callAllFuncs(function (evt) {
|
|
58
|
+
if (evt.target.checked) {
|
|
59
|
+
onChangeContext(valueProp);
|
|
60
|
+
}
|
|
61
|
+
}, onChangeProp) : onChangeProp;
|
|
62
|
+
var _useRadio = useRadio(Object.assign(Object.assign({}, rest), {
|
|
63
|
+
disabled: disabled,
|
|
64
|
+
name: name,
|
|
65
|
+
checked: checked,
|
|
66
|
+
onChange: onChange
|
|
67
|
+
})),
|
|
68
|
+
rootProps = _useRadio.rootProps,
|
|
69
|
+
getInputProps = _useRadio.getInputProps;
|
|
70
|
+
var inputProps = getInputProps();
|
|
71
|
+
var cls = cx(prefixCls, className, prefixCls + "--type-" + type);
|
|
72
|
+
return /*#__PURE__*/React__default.createElement("label", Object.assign({
|
|
73
|
+
ref: ref,
|
|
74
|
+
role: role,
|
|
75
|
+
className: cls
|
|
76
|
+
}, rootProps), /*#__PURE__*/React__default.createElement("input", Object.assign({}, inputProps, {
|
|
77
|
+
tabIndex: 0,
|
|
78
|
+
className: prefixCls + "__input"
|
|
79
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
80
|
+
className: prefixCls + "__controller"
|
|
81
|
+
}), children ? /*#__PURE__*/React__default.createElement("span", {
|
|
82
|
+
className: prefixCls + "__label"
|
|
83
|
+
}, children) : null);
|
|
84
|
+
});
|
|
85
|
+
if (__DEV__) {
|
|
86
|
+
Radio.displayName = 'Radio';
|
|
87
|
+
}
|
|
88
|
+
export { Radio };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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__default, { forwardRef, useMemo } from 'react';
|
|
12
|
+
import { getPrefixCls, cx } from '@hi-ui/classname';
|
|
13
|
+
import { __DEV__ } from '@hi-ui/env';
|
|
14
|
+
import { useRadioGroup } from './use-radio-group.js';
|
|
15
|
+
import { RadioGroupProvider } from './context.js';
|
|
16
|
+
import { RadioGroupTypeEnum, RadioGroupPlacementEnum } from './types.js';
|
|
17
|
+
import { isArrayNonEmpty } from '@hi-ui/type-assertion';
|
|
18
|
+
import { Radio } from './Radio.js';
|
|
19
|
+
|
|
20
|
+
/** @LICENSE
|
|
21
|
+
* @hi-ui/radio
|
|
22
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
var RADIO_GROUP_PREFIX = getPrefixCls('radio-group');
|
|
30
|
+
/**
|
|
31
|
+
* 单选组合器
|
|
32
|
+
*/
|
|
33
|
+
var RadioGroup = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
34
|
+
var _a$prefixCls = _a.prefixCls,
|
|
35
|
+
prefixCls = _a$prefixCls === void 0 ? RADIO_GROUP_PREFIX : _a$prefixCls,
|
|
36
|
+
className = _a.className,
|
|
37
|
+
children = _a.children,
|
|
38
|
+
data = _a.data,
|
|
39
|
+
_a$type = _a.type,
|
|
40
|
+
type = _a$type === void 0 ? RadioGroupTypeEnum.DEFAULT : _a$type,
|
|
41
|
+
_a$placement = _a.placement,
|
|
42
|
+
placement = _a$placement === void 0 ? RadioGroupPlacementEnum.HORIZONTAL : _a$placement,
|
|
43
|
+
_a$autoWidth = _a.autoWidth,
|
|
44
|
+
autoWidth = _a$autoWidth === void 0 ? false : _a$autoWidth,
|
|
45
|
+
rest = __rest(_a, ["prefixCls", "className", "children", "data", "type", "placement", "autoWidth"]);
|
|
46
|
+
var _useRadioGroup = useRadioGroup(rest),
|
|
47
|
+
rootProps = _useRadioGroup.rootProps,
|
|
48
|
+
name = _useRadioGroup.name,
|
|
49
|
+
value = _useRadioGroup.value,
|
|
50
|
+
onChange = _useRadioGroup.onChange,
|
|
51
|
+
isChecked = _useRadioGroup.isChecked,
|
|
52
|
+
disabled = _useRadioGroup.disabled;
|
|
53
|
+
var providedValue = useMemo(function () {
|
|
54
|
+
return {
|
|
55
|
+
name: name,
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
value: value,
|
|
58
|
+
isChecked: isChecked,
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
type: type,
|
|
61
|
+
placement: placement
|
|
62
|
+
};
|
|
63
|
+
}, [name, onChange, value, isChecked, disabled, type, placement]);
|
|
64
|
+
var hasData = isArrayNonEmpty(data);
|
|
65
|
+
// data 优先级大于内嵌式组合
|
|
66
|
+
if (hasData) {
|
|
67
|
+
children = data.map(function (_ref) {
|
|
68
|
+
var id = _ref.id,
|
|
69
|
+
disabled = _ref.disabled,
|
|
70
|
+
title = _ref.title;
|
|
71
|
+
return /*#__PURE__*/React__default.createElement(Radio, {
|
|
72
|
+
key: id,
|
|
73
|
+
value: id,
|
|
74
|
+
name: name,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
checked: isChecked(id),
|
|
77
|
+
className: prefixCls + "__item"
|
|
78
|
+
}, title);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
var cls = cx(prefixCls, className, prefixCls + "--placement-" + placement, autoWidth && type === RadioGroupTypeEnum.BUTTON && prefixCls + "--auto-width", prefixCls + "--type-" + type, hasData && prefixCls + "--data-wrap");
|
|
82
|
+
return /*#__PURE__*/React__default.createElement(RadioGroupProvider, {
|
|
83
|
+
value: providedValue
|
|
84
|
+
}, /*#__PURE__*/React__default.createElement("div", Object.assign({
|
|
85
|
+
ref: ref,
|
|
86
|
+
className: cls
|
|
87
|
+
}, rootProps), children));
|
|
88
|
+
});
|
|
89
|
+
if (__DEV__) {
|
|
90
|
+
RadioGroup.displayName = 'RadioGroup';
|
|
91
|
+
}
|
|
92
|
+
export { RadioGroup };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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 { useContext, createContext } from 'react';
|
|
11
|
+
|
|
12
|
+
/** @LICENSE
|
|
13
|
+
* @hi-ui/radio
|
|
14
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
var RadioGroupContext = /*#__PURE__*/createContext(null);
|
|
22
|
+
var RadioGroupProvider = RadioGroupContext.Provider;
|
|
23
|
+
var useRadioGroupContext = function useRadioGroupContext() {
|
|
24
|
+
var context = useContext(RadioGroupContext);
|
|
25
|
+
// 允许 Radio 单独存在,不做检查
|
|
26
|
+
// if (!context) {
|
|
27
|
+
// throw new Error('The RadioGroupContext context should using in Radio.')
|
|
28
|
+
// }
|
|
29
|
+
return context;
|
|
30
|
+
};
|
|
31
|
+
export { RadioGroupProvider, useRadioGroupContext };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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 './styles/index.scss.js';
|
|
11
|
+
import { Radio as Radio$1 } from './Radio.js';
|
|
12
|
+
import { RadioGroup } from './RadioGroup.js';
|
|
13
|
+
|
|
14
|
+
/** @LICENSE
|
|
15
|
+
* @hi-ui/radio
|
|
16
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the MIT license found in the
|
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/
|
|
23
|
+
var Radio = Object.assign(Radio$1, {
|
|
24
|
+
Group: RadioGroup
|
|
25
|
+
});
|
|
26
|
+
export { Radio$1 as Radio, RadioGroup, Radio as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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 __styleInject__ from '@hi-ui/style-inject';
|
|
11
|
+
|
|
12
|
+
/** @LICENSE
|
|
13
|
+
* @hi-ui/radio
|
|
14
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
var css_248z = ".hi-v4-radio {overflow-wrap: break-word;font-size: var(--hi-v4-text-size-md, 0.875rem);line-height: var(--hi-v4-text-lineheight-md, 1.375rem);position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: pointer;display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;vertical-align: middle;}.hi-v4-radio--type-button {height: 32px;padding: 0 12px;color: var(--hi-v4-color-gray-600, #5f6a7a);background: var(--hi-v4-color-gray-100, #f2f4f7);cursor: pointer;-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);}.hi-v4-radio--type-button .hi-v4-radio__input {display: none;}.hi-v4-radio--type-button .hi-v4-radio__input:focus + .hi-v4-radio__label {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-button .hi-v4-radio__controller {display: none;}.hi-v4-radio--type-button:hover, .hi-v4-radio--type-button[data-checked] {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-button[data-disabled] {cursor: not-allowed;background: var(--hi-v4-color-gray-200, #ebedf0);color: var(--hi-v4-color-gray-400, #b5bcc7);}.hi-v4-radio--type-button[data-checked].hi-v4-radio--type-button[data-disabled] {background: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe));color: var(--hi-v4-color-primary-300, var(--hi-v4-color-brandblue-300, #70b8ff));}.hi-v4-radio--type-default .hi-v4-radio__input:focus + .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));-webkit-box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));box-shadow: 0 0 0 2px var(--hi-v4-color-primary-100, var(--hi-v4-color-brandblue-100, #bde2ff));}.hi-v4-radio--type-default .hi-v4-radio__controller {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-orient: horizontal;-webkit-box-direction: normal;-ms-flex-direction: row;flex-direction: row;position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;width: 16px;height: 16px;border: 1px solid var(--hi-v4-color-gray-300, #dfe2e8);border-radius: var(--hi-v4-border-radius-full, 9999px);-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);-webkit-box-flex: 0;-ms-flex: none;flex: none;}.hi-v4-radio--type-default .hi-v4-radio__controller::after {position: absolute;top: 0;left: 0;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;width: 14px;height: 14px;content: \"\";background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));border-radius: var(--hi-v4-border-radius-full, 9999px);opacity: 0;-webkit-transition: all var(--hi-v4-motion-duration-normal, 200ms);transition: all var(--hi-v4-motion-duration-normal, 200ms);-webkit-transform: scale(0);transform: scale(0);}.hi-v4-radio--type-default .hi-v4-radio__label {-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-margin-start: var(--hi-v4-spacing-4, 8px);margin-inline-start: var(--hi-v4-spacing-4, 8px);color: var(--hi-v4-color-gray-700, #1f2733);}.hi-v4-radio--type-default:hover .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-default[data-checked] .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));}.hi-v4-radio--type-default[data-checked] .hi-v4-radio__controller::after {opacity: 1;-webkit-transform: scale(0.3);transform: scale(0.3);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-radio--type-default[data-checked].hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller {border-color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));opacity: 0.4;}.hi-v4-radio--type-default[data-checked].hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller::after {opacity: 1;-webkit-transform: scale(0.3);transform: scale(0.3);background-color: var(--hi-v4-color-static-white, #fff);}.hi-v4-radio--type-default[data-disabled] {cursor: not-allowed;}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller {border-color: var(--hi-v4-color-gray-300, #dfe2e8);background: var(--hi-v4-color-gray-100, #f2f4f7);}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__controller::after {background: var(--hi-v4-color-gray-300, #dfe2e8);}.hi-v4-radio--type-default[data-disabled] .hi-v4-radio__label {color: var(--hi-v4-color-gray-500, #929aa6);}.hi-v4-radio-group {position: relative;}.hi-v4-radio-group--data-wrap {display: -webkit-inline-box;display: -ms-inline-flexbox;display: inline-flex;z-index: var(--hi-v4-zindex-normal, 0);}.hi-v4-radio-group--type-button {border-radius: var(--hi-v4-border-radius-md, 4px);overflow: hidden;}.hi-v4-radio-group--type-default.hi-v4-radio-group--data-wrap {gap: var(--hi-v4-spacing-8, 16px);}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--data-wrap {-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--auto-width {display: -webkit-box;display: -ms-flexbox;display: flex;}.hi-v4-radio-group--placement-horizontal.hi-v4-radio-group--auto-width .hi-v4-radio--type-button {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;}.hi-v4-radio-group--placement-horizontal .hi-v4-radio--type-button::after {content: \"\";background: var(--hi-v4-color-gray-300, #dfe2e8);width: 1px;left: 100%;top: 8px;bottom: 8px;position: absolute;z-index: var(--hi-v4-zindex-absolute, 1);}.hi-v4-radio-group--placement-vertical {-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v4-radio-group--placement-vertical .hi-v4-radio--type-button::after {content: \"\";background: var(--hi-v4-color-gray-300, #dfe2e8);height: 1px;left: 8px;right: 8px;top: 100%;position: absolute;z-index: var(--hi-v4-zindex-absolute, 1);}";
|
|
22
|
+
__styleInject__(css_248z);
|
|
23
|
+
export { css_248z as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/table
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#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
|
+
/** @LICENSE
|
|
11
|
+
* @hi-ui/radio
|
|
12
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/radio#readme
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
var RadioGroupPlacementEnum = {
|
|
20
|
+
VERTICAL: 'vertical',
|
|
21
|
+
HORIZONTAL: 'horizontal'
|
|
22
|
+
};
|
|
23
|
+
var RadioGroupTypeEnum = {
|
|
24
|
+
DEFAULT: 'default',
|
|
25
|
+
BUTTON: 'button'
|
|
26
|
+
};
|
|
27
|
+
export { RadioGroupPlacementEnum, RadioGroupTypeEnum };
|