assui 3.0.71 → 3.0.73
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/es/condition-select-input/index.d.ts +35 -0
- package/es/condition-select-input/index.js +134 -0
- package/es/condition-select-input/style/index.css +23 -0
- package/es/condition-select-input/style/index.d.ts +3 -0
- package/es/condition-select-input/style/index.js +3 -0
- package/es/condition-select-input/style/index.less +28 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/lib/condition-select-input/index.d.ts +35 -0
- package/lib/condition-select-input/index.js +178 -0
- package/lib/condition-select-input/style/index.css +23 -0
- package/lib/condition-select-input/style/index.d.ts +3 -0
- package/lib/condition-select-input/style/index.js +8 -0
- package/lib/condition-select-input/style/index.less +28 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -1
- package/package.json +3 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SelectProps } from 'antd/lib/select';
|
|
2
|
+
import type { ConditionInputProps } from '../condition-input';
|
|
3
|
+
export declare enum InputTypeEnum {
|
|
4
|
+
CONDITION_INPUT = "conditionInput",
|
|
5
|
+
SELECT = "select"
|
|
6
|
+
}
|
|
7
|
+
declare type SelectOptionsType = {
|
|
8
|
+
value: number;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
export interface MainSelectOptionsType extends SelectOptionsType {
|
|
12
|
+
children?: SelectOptionsType[];
|
|
13
|
+
}
|
|
14
|
+
export interface ValueType {
|
|
15
|
+
selectValue?: number | string | null;
|
|
16
|
+
inputValue?: SelectProps['value'] | ConditionInputProps['value'];
|
|
17
|
+
}
|
|
18
|
+
export interface ConditionSelectInputProps {
|
|
19
|
+
value?: ValueType;
|
|
20
|
+
/** 不需要展示联动输入框的字段值 */
|
|
21
|
+
hiddenInputKeys?: ValueType['selectValue'][];
|
|
22
|
+
/** selectProps */
|
|
23
|
+
selectProps?: SelectProps;
|
|
24
|
+
/** 联动inputProps */
|
|
25
|
+
conditionInputProps?: ConditionInputProps;
|
|
26
|
+
/** 联动selectProps */
|
|
27
|
+
conditionSelectProps?: SelectProps;
|
|
28
|
+
onChange?: (value: ValueType) => void;
|
|
29
|
+
/** 输入框类型 */
|
|
30
|
+
inputType?: InputTypeEnum;
|
|
31
|
+
/** select options */
|
|
32
|
+
optionsList: MainSelectOptionsType[];
|
|
33
|
+
}
|
|
34
|
+
declare const ConditionSelectInput: (props: ConditionSelectInputProps) => JSX.Element;
|
|
35
|
+
export default ConditionSelectInput;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = this && this.__read || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o),
|
|
17
|
+
r,
|
|
18
|
+
ar = [],
|
|
19
|
+
e;
|
|
20
|
+
try {
|
|
21
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
22
|
+
ar.push(r.value);
|
|
23
|
+
}
|
|
24
|
+
} catch (error) {
|
|
25
|
+
e = {
|
|
26
|
+
error: error
|
|
27
|
+
};
|
|
28
|
+
} finally {
|
|
29
|
+
try {
|
|
30
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
31
|
+
} finally {
|
|
32
|
+
if (e) throw e.error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
import isNil from 'lodash/isNil';
|
|
38
|
+
import classNames from 'classnames';
|
|
39
|
+
import Select from "antd/es/select";
|
|
40
|
+
import React, { useEffect, useState } from 'react';
|
|
41
|
+
import useControllableValue from "ahooks/es/useControllableValue";
|
|
42
|
+
import ConditionInput from '../condition-input';
|
|
43
|
+
export var InputTypeEnum;
|
|
44
|
+
(function (InputTypeEnum) {
|
|
45
|
+
InputTypeEnum["CONDITION_INPUT"] = "conditionInput";
|
|
46
|
+
InputTypeEnum["SELECT"] = "select";
|
|
47
|
+
})(InputTypeEnum || (InputTypeEnum = {}));
|
|
48
|
+
var ConditionSelectInput = function ConditionSelectInput(props) {
|
|
49
|
+
var value = props.value,
|
|
50
|
+
_a = props.hiddenInputKeys,
|
|
51
|
+
hiddenInputKeys = _a === void 0 ? [] : _a,
|
|
52
|
+
selectProps = props.selectProps,
|
|
53
|
+
conditionInputProps = props.conditionInputProps,
|
|
54
|
+
conditionSelectProps = props.conditionSelectProps,
|
|
55
|
+
_b = props.inputType,
|
|
56
|
+
inputType = _b === void 0 ? InputTypeEnum.CONDITION_INPUT : _b,
|
|
57
|
+
_c = props.optionsList,
|
|
58
|
+
optionsList = _c === void 0 ? [] : _c;
|
|
59
|
+
var isInput = inputType === InputTypeEnum.CONDITION_INPUT;
|
|
60
|
+
var _d = __read(useControllableValue(props), 2),
|
|
61
|
+
selectInputValue = _d[0],
|
|
62
|
+
setSelectInputValue = _d[1];
|
|
63
|
+
var _e = __read(useState([]), 2),
|
|
64
|
+
subSelectOptions = _e[0],
|
|
65
|
+
setSubSelectOptions = _e[1];
|
|
66
|
+
useEffect(function () {
|
|
67
|
+
if (value && value.selectValue && optionsList.length) {
|
|
68
|
+
var _a = __read(optionsList.filter(function (item) {
|
|
69
|
+
return item.value === value.selectValue;
|
|
70
|
+
}), 1),
|
|
71
|
+
selectValueItem = _a[0];
|
|
72
|
+
if (selectValueItem && selectValueItem.children) {
|
|
73
|
+
setSubSelectOptions(selectValueItem.children);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, [value, optionsList]);
|
|
77
|
+
var onSelectChange = function onSelectChange(selectValue) {
|
|
78
|
+
var inputValue = isInput ? '' : undefined;
|
|
79
|
+
setSelectInputValue({
|
|
80
|
+
selectValue: selectValue,
|
|
81
|
+
inputValue: inputValue
|
|
82
|
+
});
|
|
83
|
+
if (isInput || isNil(selectValue)) {
|
|
84
|
+
setSubSelectOptions([]);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
var _a = __read(optionsList.filter(function (item) {
|
|
88
|
+
return item.value === selectValue;
|
|
89
|
+
}), 1),
|
|
90
|
+
selectValueItem = _a[0];
|
|
91
|
+
if (selectValueItem.children) {
|
|
92
|
+
setSubSelectOptions(selectValueItem.children);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var onInputChange = function onInputChange(inputValue) {
|
|
96
|
+
setSelectInputValue({
|
|
97
|
+
selectValue: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue,
|
|
98
|
+
inputValue: inputValue
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
var onTypeSelectChange = function onTypeSelectChange(inputValue) {
|
|
102
|
+
setSelectInputValue({
|
|
103
|
+
selectValue: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue,
|
|
104
|
+
inputValue: inputValue
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
// 是否展示输入框
|
|
108
|
+
var isShowInput = !isNil(selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue) && !(hiddenInputKeys === null || hiddenInputKeys === void 0 ? void 0 : hiddenInputKeys.includes(selectInputValue.selectValue));
|
|
109
|
+
var typeInput = isInput ? /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: "condition-select-input"
|
|
111
|
+
}, /*#__PURE__*/React.createElement(ConditionInput, __assign({}, conditionInputProps, {
|
|
112
|
+
onChange: onInputChange,
|
|
113
|
+
value: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.inputValue
|
|
114
|
+
}))) : /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: "condition-select-select-input"
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Select, __assign({}, conditionSelectProps, {
|
|
117
|
+
onChange: onTypeSelectChange,
|
|
118
|
+
value: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.inputValue,
|
|
119
|
+
options: subSelectOptions
|
|
120
|
+
})));
|
|
121
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: "condition-select-wrap"
|
|
123
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: classNames('condition-select-selecter', {
|
|
125
|
+
'condition-two-select-selecter': !isInput,
|
|
126
|
+
'condition-only-selecter': !isShowInput
|
|
127
|
+
})
|
|
128
|
+
}, /*#__PURE__*/React.createElement(Select, __assign({}, selectProps, {
|
|
129
|
+
onChange: onSelectChange,
|
|
130
|
+
value: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue,
|
|
131
|
+
options: optionsList
|
|
132
|
+
}))), isShowInput && typeInput);
|
|
133
|
+
};
|
|
134
|
+
export default ConditionSelectInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.condition-select-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
.condition-select-selecter {
|
|
7
|
+
width: 30%;
|
|
8
|
+
margin-right: 8px;
|
|
9
|
+
}
|
|
10
|
+
.condition-select-input {
|
|
11
|
+
width: 70%;
|
|
12
|
+
}
|
|
13
|
+
.condition-two-select-selecter {
|
|
14
|
+
width: 50%;
|
|
15
|
+
margin-right: 8px;
|
|
16
|
+
}
|
|
17
|
+
.condition-only-selecter {
|
|
18
|
+
width: 100%;
|
|
19
|
+
margin-right: 0;
|
|
20
|
+
}
|
|
21
|
+
.condition-select-select-input {
|
|
22
|
+
width: 50%;
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.condition-select-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.condition-select-selecter {
|
|
8
|
+
width: 30%;
|
|
9
|
+
margin-right: 8px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.condition-select-input {
|
|
13
|
+
width: 70%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.condition-two-select-selecter {
|
|
17
|
+
width: 50%;
|
|
18
|
+
margin-right: 8px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.condition-only-selecter {
|
|
22
|
+
width: 100%;
|
|
23
|
+
margin-right: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.condition-select-select-input {
|
|
27
|
+
width: 50%;
|
|
28
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type { ButtonModalProps } from './button-modal';
|
|
|
4
4
|
export { default as ButtonModal } from './button-modal';
|
|
5
5
|
export type { ConditionInputProps } from './condition-input';
|
|
6
6
|
export { default as ConditionInput } from './condition-input';
|
|
7
|
+
export type { ConditionSelectInputProps } from './condition-select-input';
|
|
8
|
+
export { default as ConditionSelectInput } from './condition-select-input';
|
|
7
9
|
export type { ConfigProviderProps } from './config-provider';
|
|
8
10
|
export { default as ConfigProvider } from './config-provider';
|
|
9
11
|
export { default as NumberFormatInput } from './number-format-input';
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as ButtonDrawer } from './button-drawer';
|
|
2
2
|
export { default as ButtonModal } from './button-modal';
|
|
3
3
|
export { default as ConditionInput } from './condition-input';
|
|
4
|
+
export { default as ConditionSelectInput } from './condition-select-input';
|
|
4
5
|
export { default as ConfigProvider } from './config-provider';
|
|
5
6
|
export { default as NumberFormatInput } from './number-format-input';
|
|
6
7
|
export { default as CopyToClipboard } from './copy-to-clipboard';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SelectProps } from 'antd/lib/select';
|
|
2
|
+
import type { ConditionInputProps } from '../condition-input';
|
|
3
|
+
export declare enum InputTypeEnum {
|
|
4
|
+
CONDITION_INPUT = "conditionInput",
|
|
5
|
+
SELECT = "select"
|
|
6
|
+
}
|
|
7
|
+
declare type SelectOptionsType = {
|
|
8
|
+
value: number;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
export interface MainSelectOptionsType extends SelectOptionsType {
|
|
12
|
+
children?: SelectOptionsType[];
|
|
13
|
+
}
|
|
14
|
+
export interface ValueType {
|
|
15
|
+
selectValue?: number | string | null;
|
|
16
|
+
inputValue?: SelectProps['value'] | ConditionInputProps['value'];
|
|
17
|
+
}
|
|
18
|
+
export interface ConditionSelectInputProps {
|
|
19
|
+
value?: ValueType;
|
|
20
|
+
/** 不需要展示联动输入框的字段值 */
|
|
21
|
+
hiddenInputKeys?: ValueType['selectValue'][];
|
|
22
|
+
/** selectProps */
|
|
23
|
+
selectProps?: SelectProps;
|
|
24
|
+
/** 联动inputProps */
|
|
25
|
+
conditionInputProps?: ConditionInputProps;
|
|
26
|
+
/** 联动selectProps */
|
|
27
|
+
conditionSelectProps?: SelectProps;
|
|
28
|
+
onChange?: (value: ValueType) => void;
|
|
29
|
+
/** 输入框类型 */
|
|
30
|
+
inputType?: InputTypeEnum;
|
|
31
|
+
/** select options */
|
|
32
|
+
optionsList: MainSelectOptionsType[];
|
|
33
|
+
}
|
|
34
|
+
declare const ConditionSelectInput: (props: ConditionSelectInputProps) => JSX.Element;
|
|
35
|
+
export default ConditionSelectInput;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __assign = this && this.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
return __assign.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return m[k];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
} : function (o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
});
|
|
31
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
32
|
+
Object.defineProperty(o, "default", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
value: v
|
|
35
|
+
});
|
|
36
|
+
} : function (o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = this && this.__importStar || function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k in mod) {
|
|
43
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
44
|
+
}
|
|
45
|
+
__setModuleDefault(result, mod);
|
|
46
|
+
return result;
|
|
47
|
+
};
|
|
48
|
+
var __read = this && this.__read || function (o, n) {
|
|
49
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
50
|
+
if (!m) return o;
|
|
51
|
+
var i = m.call(o),
|
|
52
|
+
r,
|
|
53
|
+
ar = [],
|
|
54
|
+
e;
|
|
55
|
+
try {
|
|
56
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
57
|
+
ar.push(r.value);
|
|
58
|
+
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
e = {
|
|
61
|
+
error: error
|
|
62
|
+
};
|
|
63
|
+
} finally {
|
|
64
|
+
try {
|
|
65
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
66
|
+
} finally {
|
|
67
|
+
if (e) throw e.error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return ar;
|
|
71
|
+
};
|
|
72
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
73
|
+
return mod && mod.__esModule ? mod : {
|
|
74
|
+
"default": mod
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
Object.defineProperty(exports, "__esModule", {
|
|
78
|
+
value: true
|
|
79
|
+
});
|
|
80
|
+
exports.InputTypeEnum = void 0;
|
|
81
|
+
var isNil_1 = __importDefault(require("lodash/isNil"));
|
|
82
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
83
|
+
var select_1 = __importDefault(require("antd/lib/select"));
|
|
84
|
+
var react_1 = __importStar(require("react"));
|
|
85
|
+
var useControllableValue_1 = __importDefault(require("ahooks/lib/useControllableValue"));
|
|
86
|
+
var condition_input_1 = __importDefault(require("../condition-input"));
|
|
87
|
+
var InputTypeEnum;
|
|
88
|
+
(function (InputTypeEnum) {
|
|
89
|
+
InputTypeEnum["CONDITION_INPUT"] = "conditionInput";
|
|
90
|
+
InputTypeEnum["SELECT"] = "select";
|
|
91
|
+
})(InputTypeEnum = exports.InputTypeEnum || (exports.InputTypeEnum = {}));
|
|
92
|
+
var ConditionSelectInput = function ConditionSelectInput(props) {
|
|
93
|
+
var value = props.value,
|
|
94
|
+
_a = props.hiddenInputKeys,
|
|
95
|
+
hiddenInputKeys = _a === void 0 ? [] : _a,
|
|
96
|
+
selectProps = props.selectProps,
|
|
97
|
+
conditionInputProps = props.conditionInputProps,
|
|
98
|
+
conditionSelectProps = props.conditionSelectProps,
|
|
99
|
+
_b = props.inputType,
|
|
100
|
+
inputType = _b === void 0 ? InputTypeEnum.CONDITION_INPUT : _b,
|
|
101
|
+
_c = props.optionsList,
|
|
102
|
+
optionsList = _c === void 0 ? [] : _c;
|
|
103
|
+
var isInput = inputType === InputTypeEnum.CONDITION_INPUT;
|
|
104
|
+
var _d = __read((0, useControllableValue_1["default"])(props), 2),
|
|
105
|
+
selectInputValue = _d[0],
|
|
106
|
+
setSelectInputValue = _d[1];
|
|
107
|
+
var _e = __read((0, react_1.useState)([]), 2),
|
|
108
|
+
subSelectOptions = _e[0],
|
|
109
|
+
setSubSelectOptions = _e[1];
|
|
110
|
+
(0, react_1.useEffect)(function () {
|
|
111
|
+
if (value && value.selectValue && optionsList.length) {
|
|
112
|
+
var _a = __read(optionsList.filter(function (item) {
|
|
113
|
+
return item.value === value.selectValue;
|
|
114
|
+
}), 1),
|
|
115
|
+
selectValueItem = _a[0];
|
|
116
|
+
if (selectValueItem && selectValueItem.children) {
|
|
117
|
+
setSubSelectOptions(selectValueItem.children);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [value, optionsList]);
|
|
121
|
+
var onSelectChange = function onSelectChange(selectValue) {
|
|
122
|
+
var inputValue = isInput ? '' : undefined;
|
|
123
|
+
setSelectInputValue({
|
|
124
|
+
selectValue: selectValue,
|
|
125
|
+
inputValue: inputValue
|
|
126
|
+
});
|
|
127
|
+
if (isInput || (0, isNil_1["default"])(selectValue)) {
|
|
128
|
+
setSubSelectOptions([]);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
var _a = __read(optionsList.filter(function (item) {
|
|
132
|
+
return item.value === selectValue;
|
|
133
|
+
}), 1),
|
|
134
|
+
selectValueItem = _a[0];
|
|
135
|
+
if (selectValueItem.children) {
|
|
136
|
+
setSubSelectOptions(selectValueItem.children);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var onInputChange = function onInputChange(inputValue) {
|
|
140
|
+
setSelectInputValue({
|
|
141
|
+
selectValue: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue,
|
|
142
|
+
inputValue: inputValue
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var onTypeSelectChange = function onTypeSelectChange(inputValue) {
|
|
146
|
+
setSelectInputValue({
|
|
147
|
+
selectValue: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue,
|
|
148
|
+
inputValue: inputValue
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
// 是否展示输入框
|
|
152
|
+
var isShowInput = !(0, isNil_1["default"])(selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue) && !(hiddenInputKeys === null || hiddenInputKeys === void 0 ? void 0 : hiddenInputKeys.includes(selectInputValue.selectValue));
|
|
153
|
+
var typeInput = isInput ? react_1["default"].createElement("div", {
|
|
154
|
+
className: "condition-select-input"
|
|
155
|
+
}, react_1["default"].createElement(condition_input_1["default"], __assign({}, conditionInputProps, {
|
|
156
|
+
onChange: onInputChange,
|
|
157
|
+
value: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.inputValue
|
|
158
|
+
}))) : react_1["default"].createElement("div", {
|
|
159
|
+
className: "condition-select-select-input"
|
|
160
|
+
}, react_1["default"].createElement(select_1["default"], __assign({}, conditionSelectProps, {
|
|
161
|
+
onChange: onTypeSelectChange,
|
|
162
|
+
value: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.inputValue,
|
|
163
|
+
options: subSelectOptions
|
|
164
|
+
})));
|
|
165
|
+
return react_1["default"].createElement("div", {
|
|
166
|
+
className: "condition-select-wrap"
|
|
167
|
+
}, react_1["default"].createElement("div", {
|
|
168
|
+
className: (0, classnames_1["default"])('condition-select-selecter', {
|
|
169
|
+
'condition-two-select-selecter': !isInput,
|
|
170
|
+
'condition-only-selecter': !isShowInput
|
|
171
|
+
})
|
|
172
|
+
}, react_1["default"].createElement(select_1["default"], __assign({}, selectProps, {
|
|
173
|
+
onChange: onSelectChange,
|
|
174
|
+
value: selectInputValue === null || selectInputValue === void 0 ? void 0 : selectInputValue.selectValue,
|
|
175
|
+
options: optionsList
|
|
176
|
+
}))), isShowInput && typeInput);
|
|
177
|
+
};
|
|
178
|
+
exports["default"] = ConditionSelectInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.condition-select-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
.condition-select-selecter {
|
|
7
|
+
width: 30%;
|
|
8
|
+
margin-right: 8px;
|
|
9
|
+
}
|
|
10
|
+
.condition-select-input {
|
|
11
|
+
width: 70%;
|
|
12
|
+
}
|
|
13
|
+
.condition-two-select-selecter {
|
|
14
|
+
width: 50%;
|
|
15
|
+
margin-right: 8px;
|
|
16
|
+
}
|
|
17
|
+
.condition-only-selecter {
|
|
18
|
+
width: 100%;
|
|
19
|
+
margin-right: 0;
|
|
20
|
+
}
|
|
21
|
+
.condition-select-select-input {
|
|
22
|
+
width: 50%;
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.condition-select-wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.condition-select-selecter {
|
|
8
|
+
width: 30%;
|
|
9
|
+
margin-right: 8px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.condition-select-input {
|
|
13
|
+
width: 70%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.condition-two-select-selecter {
|
|
17
|
+
width: 50%;
|
|
18
|
+
margin-right: 8px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.condition-only-selecter {
|
|
22
|
+
width: 100%;
|
|
23
|
+
margin-right: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.condition-select-select-input {
|
|
27
|
+
width: 50%;
|
|
28
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type { ButtonModalProps } from './button-modal';
|
|
|
4
4
|
export { default as ButtonModal } from './button-modal';
|
|
5
5
|
export type { ConditionInputProps } from './condition-input';
|
|
6
6
|
export { default as ConditionInput } from './condition-input';
|
|
7
|
+
export type { ConditionSelectInputProps } from './condition-select-input';
|
|
8
|
+
export { default as ConditionSelectInput } from './condition-select-input';
|
|
7
9
|
export type { ConfigProviderProps } from './config-provider';
|
|
8
10
|
export { default as ConfigProvider } from './config-provider';
|
|
9
11
|
export { default as NumberFormatInput } from './number-format-input';
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
|
10
10
|
});
|
|
11
|
-
exports.Resizable = exports.BeautifulDnd = exports.RichTextEditor = exports.LabelCustomizeRangePicker = exports.TableCol = exports.LabelTreeSelect = exports.LabelConditionInput = exports.LabelNumberInput = exports.LabelAutoComplete = exports.LabelDatePicker = exports.LabelRangePicker = exports.JsonEditor = exports.AreaText = exports.LabelTextArea = exports.ASelect = exports.LabelSelect = exports.ColorSelect = exports.LabelInput = exports.TextInput = exports.TextArea = exports.SplitPane = exports.sortableHoc = exports.SingleImgUpload = exports.RcTransitionGroup = exports.RcQRcode = exports.RcEcharts = exports.StepNumberInput = exports.LabelRangeNumber = exports.NumberInput = exports.RcMotion = exports.KeepTab = exports.ImgCrop = exports.HighlightWords = exports.HighlightTextarea = exports.CopyToClipboard = exports.NumberFormatInput = exports.ConfigProvider = exports.ConditionInput = exports.ButtonModal = exports.ButtonDrawer = void 0;
|
|
11
|
+
exports.Resizable = exports.BeautifulDnd = exports.RichTextEditor = exports.LabelCustomizeRangePicker = exports.TableCol = exports.LabelTreeSelect = exports.LabelConditionInput = exports.LabelNumberInput = exports.LabelAutoComplete = exports.LabelDatePicker = exports.LabelRangePicker = exports.JsonEditor = exports.AreaText = exports.LabelTextArea = exports.ASelect = exports.LabelSelect = exports.ColorSelect = exports.LabelInput = exports.TextInput = exports.TextArea = exports.SplitPane = exports.sortableHoc = exports.SingleImgUpload = exports.RcTransitionGroup = exports.RcQRcode = exports.RcEcharts = exports.StepNumberInput = exports.LabelRangeNumber = exports.NumberInput = exports.RcMotion = exports.KeepTab = exports.ImgCrop = exports.HighlightWords = exports.HighlightTextarea = exports.CopyToClipboard = exports.NumberFormatInput = exports.ConfigProvider = exports.ConditionSelectInput = exports.ConditionInput = exports.ButtonModal = exports.ButtonDrawer = void 0;
|
|
12
12
|
var button_drawer_1 = require("./button-drawer");
|
|
13
13
|
Object.defineProperty(exports, "ButtonDrawer", {
|
|
14
14
|
enumerable: true,
|
|
@@ -30,6 +30,13 @@ Object.defineProperty(exports, "ConditionInput", {
|
|
|
30
30
|
return __importDefault(condition_input_1)["default"];
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
+
var condition_select_input_1 = require("./condition-select-input");
|
|
34
|
+
Object.defineProperty(exports, "ConditionSelectInput", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function get() {
|
|
37
|
+
return __importDefault(condition_select_input_1)["default"];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
33
40
|
var config_provider_1 = require("./config-provider");
|
|
34
41
|
Object.defineProperty(exports, "ConfigProvider", {
|
|
35
42
|
enumerable: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.73",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
36
|
"@types/react-color": "^3.0.6",
|
|
37
37
|
"@types/react-resizable": "^3.0.0",
|
|
38
|
-
"a-icons": "^1.1.
|
|
38
|
+
"a-icons": "^1.1.33",
|
|
39
39
|
"aa-utils": "^2.1.17",
|
|
40
40
|
"ahooks": "^3.0.8",
|
|
41
41
|
"bignumber.js": "^9.0.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"node": ">=10.0.0"
|
|
81
81
|
},
|
|
82
82
|
"license": "MIT",
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "9210e49443fa4e8c53997f1797b0be4a3add80b9"
|
|
84
84
|
}
|