tntd 3.0.31 → 3.0.32
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.json +1034 -0
- package/CHANGELOG.md +605 -0
- package/es/checkbox/checkbox-group.js +5 -0
- package/es/checkbox/checkbox-group.js.map +1 -0
- package/es/query-form/Field/Composition/FieldPopover.js +9 -6
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -1
- package/es/query-form/Field/Composition/ValueTag.js +5 -4
- package/es/query-form/Field/Composition/ValueTag.js.map +1 -1
- package/es/query-form/Field/Composition/index.js +2 -11
- package/es/query-form/Field/Composition/index.js.map +1 -1
- package/es/query-form/Field/Composition/utils.js +7 -5
- package/es/query-form/Field/Composition/utils.js.map +1 -1
- package/es/radio/radio-group.js +5 -0
- package/es/radio/radio-group.js.map +1 -0
- package/es/steps/stepStyle/small.less +5 -0
- package/es/table/resizableTable/index.less +1 -1
- package/es/tntd-rc-select/style/index.less +27 -19
- package/es/tntd-virtual-tree/index.js +21 -14
- package/es/tntd-virtual-tree/index.js.map +1 -1
- package/es/tntd-virtual-tree/index.less +10 -7
- package/es/tntd-virtual-tree-select/index.js +2 -2
- package/es/tntd-virtual-tree-select/index.js.map +1 -1
- package/es/tntd-virtual-tree-select/index.less +0 -17
- package/es/tntd-virtual-tree-select/utils.js +2 -2
- package/es/tntd-virtual-tree-select/utils.js.map +1 -1
- package/lib/checkbox/checkbox-group.d.ts +8 -0
- package/lib/checkbox/checkbox-group.d.ts.map +1 -0
- package/lib/checkbox/checkbox-group.js +12 -0
- package/lib/checkbox/checkbox-group.js.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +9 -11
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -1
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/ValueTag.js +5 -6
- package/lib/query-form/Field/Composition/ValueTag.js.map +1 -1
- package/lib/query-form/Field/Composition/index.d.ts +0 -1
- package/lib/query-form/Field/Composition/index.js +2 -11
- package/lib/query-form/Field/Composition/index.js.map +1 -1
- package/lib/query-form/Field/Composition/utils.d.ts +1 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/utils.js +7 -7
- package/lib/query-form/Field/Composition/utils.js.map +1 -1
- package/lib/radio/radio-group.d.ts +8 -0
- package/lib/radio/radio-group.d.ts.map +1 -0
- package/lib/radio/radio-group.js +12 -0
- package/lib/radio/radio-group.js.map +1 -0
- package/lib/steps/stepStyle/small.less +5 -0
- package/lib/table/resizableTable/index.less +1 -1
- package/lib/tntd-rc-select/style/index.less +27 -19
- package/lib/tntd-virtual-tree/index.d.ts +1 -1
- package/lib/tntd-virtual-tree/index.d.ts.map +1 -1
- package/lib/tntd-virtual-tree/index.js +23 -14
- package/lib/tntd-virtual-tree/index.js.map +1 -1
- package/lib/tntd-virtual-tree/index.less +10 -7
- package/lib/tntd-virtual-tree-select/index.d.ts +1 -1
- package/lib/tntd-virtual-tree-select/index.js +2 -3
- package/lib/tntd-virtual-tree-select/index.js.map +1 -1
- package/lib/tntd-virtual-tree-select/index.less +0 -17
- package/lib/tntd-virtual-tree-select/utils.js +2 -2
- package/lib/tntd-virtual-tree-select/utils.js.map +1 -1
- package/package.json +2 -2
- package/es/query-form/Field/Composition/FieldPopover.less +0 -35
- package/es/query-form/Field/Composition/index.less +0 -144
- package/es/query-form-v2/index.less +0 -133
- package/es/scroll-bar/scrollBar.less +0 -59
- package/lib/query-form/Field/Composition/FieldPopover.less +0 -35
- package/lib/query-form/Field/Composition/index.less +0 -144
- package/lib/query-form-v2/Field/Checkbox.d.ts +0 -8
- package/lib/query-form-v2/Field/Checkbox.d.ts.map +0 -1
- package/lib/query-form-v2/Field/Checkbox.js +0 -28
- package/lib/query-form-v2/Field/Checkbox.js.map +0 -1
- package/lib/query-form-v2/Field/Select.d.ts +0 -4
- package/lib/query-form-v2/Field/Select.d.ts.map +0 -1
- package/lib/query-form-v2/Field/Select.js +0 -80
- package/lib/query-form-v2/Field/Select.js.map +0 -1
- package/lib/query-form-v2/Field/SelectInput.d.ts +0 -4
- package/lib/query-form-v2/Field/SelectInput.d.ts.map +0 -1
- package/lib/query-form-v2/Field/SelectInput.js +0 -88
- package/lib/query-form-v2/Field/SelectInput.js.map +0 -1
- package/lib/query-form-v2/Field/fieldsMap.d.ts +0 -24
- package/lib/query-form-v2/Field/fieldsMap.d.ts.map +0 -1
- package/lib/query-form-v2/Field/fieldsMap.js +0 -35
- package/lib/query-form-v2/Field/fieldsMap.js.map +0 -1
- package/lib/query-form-v2/Field/index.d.ts +0 -14
- package/lib/query-form-v2/Field/index.d.ts.map +0 -1
- package/lib/query-form-v2/Field/index.js +0 -146
- package/lib/query-form-v2/Field/index.js.map +0 -1
- package/lib/query-form-v2/createActions.d.ts +0 -14
- package/lib/query-form-v2/createActions.d.ts.map +0 -1
- package/lib/query-form-v2/createActions.js +0 -54
- package/lib/query-form-v2/createActions.js.map +0 -1
- package/lib/query-form-v2/index.d.ts +0 -39
- package/lib/query-form-v2/index.d.ts.map +0 -1
- package/lib/query-form-v2/index.js +0 -391
- package/lib/query-form-v2/index.js.map +0 -1
- package/lib/query-form-v2/index.less +0 -133
- package/lib/query-form-v2/useForm.d.ts +0 -13
- package/lib/query-form-v2/useForm.d.ts.map +0 -1
- package/lib/query-form-v2/useForm.js +0 -13
- package/lib/query-form-v2/useForm.js.map +0 -1
- package/lib/query-form-v3/Field/Checkbox.d.ts +0 -8
- package/lib/query-form-v3/Field/Checkbox.d.ts.map +0 -1
- package/lib/query-form-v3/Field/Checkbox.js +0 -28
- package/lib/query-form-v3/Field/Checkbox.js.map +0 -1
- package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts +0 -19
- package/lib/query-form-v3/Field/Composition/FieldPopover.d.ts.map +0 -1
- package/lib/query-form-v3/Field/Composition/FieldPopover.js +0 -381
- package/lib/query-form-v3/Field/Composition/FieldPopover.js.map +0 -1
- package/lib/query-form-v3/Field/Composition/FieldPopover.less +0 -35
- package/lib/query-form-v3/Field/Composition/Select.d.ts +0 -4
- package/lib/query-form-v3/Field/Composition/Select.d.ts.map +0 -1
- package/lib/query-form-v3/Field/Composition/Select.js +0 -131
- package/lib/query-form-v3/Field/Composition/Select.js.map +0 -1
- package/lib/query-form-v3/Field/Composition/index.d.ts +0 -10
- package/lib/query-form-v3/Field/Composition/index.d.ts.map +0 -1
- package/lib/query-form-v3/Field/Composition/index.js +0 -255
- package/lib/query-form-v3/Field/Composition/index.js.map +0 -1
- package/lib/query-form-v3/Field/Composition/index.less +0 -118
- package/lib/query-form-v3/Field/Composition/utils.d.ts +0 -22
- package/lib/query-form-v3/Field/Composition/utils.d.ts.map +0 -1
- package/lib/query-form-v3/Field/Composition/utils.js +0 -147
- package/lib/query-form-v3/Field/Composition/utils.js.map +0 -1
- package/lib/query-form-v3/Field/Select.d.ts +0 -4
- package/lib/query-form-v3/Field/Select.d.ts.map +0 -1
- package/lib/query-form-v3/Field/Select.js +0 -80
- package/lib/query-form-v3/Field/Select.js.map +0 -1
- package/lib/query-form-v3/Field/SelectInput.d.ts +0 -4
- package/lib/query-form-v3/Field/SelectInput.d.ts.map +0 -1
- package/lib/query-form-v3/Field/SelectInput.js +0 -100
- package/lib/query-form-v3/Field/SelectInput.js.map +0 -1
- package/lib/query-form-v3/Field/fieldsMap.d.ts +0 -27
- package/lib/query-form-v3/Field/fieldsMap.d.ts.map +0 -1
- package/lib/query-form-v3/Field/fieldsMap.js +0 -35
- package/lib/query-form-v3/Field/fieldsMap.js.map +0 -1
- package/lib/query-form-v3/Field/index.d.ts +0 -14
- package/lib/query-form-v3/Field/index.d.ts.map +0 -1
- package/lib/query-form-v3/Field/index.js +0 -147
- package/lib/query-form-v3/Field/index.js.map +0 -1
- package/lib/query-form-v3/createActions.d.ts +0 -14
- package/lib/query-form-v3/createActions.d.ts.map +0 -1
- package/lib/query-form-v3/createActions.js +0 -54
- package/lib/query-form-v3/createActions.js.map +0 -1
- package/lib/query-form-v3/index.d.ts +0 -27
- package/lib/query-form-v3/index.d.ts.map +0 -1
- package/lib/query-form-v3/index.js +0 -206
- package/lib/query-form-v3/index.js.map +0 -1
- package/lib/query-form-v3/index.less +0 -91
- package/lib/query-form-v3/useForm.d.ts +0 -13
- package/lib/query-form-v3/useForm.d.ts.map +0 -1
- package/lib/query-form-v3/useForm.js +0 -13
- package/lib/query-form-v3/useForm.js.map +0 -1
- package/lib/scroll-bar/scrollBar.less +0 -59
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
.tnt-queryform-field-popover {
|
|
2
|
-
min-width: 280px;
|
|
3
|
-
.ant-popover-inner-content {
|
|
4
|
-
padding: @padding-sm 0;
|
|
5
|
-
}
|
|
6
|
-
// .ant-calendar-picker {
|
|
7
|
-
// margin: @margin-xxs 0;
|
|
8
|
-
// }
|
|
9
|
-
label {
|
|
10
|
-
color: tint(@text-color, 50%);
|
|
11
|
-
margin-bottom: @margin-xs;
|
|
12
|
-
display: block;
|
|
13
|
-
padding: 0 @padding-sm;
|
|
14
|
-
}
|
|
15
|
-
.ant-select-dropdown-menu {
|
|
16
|
-
&-item {
|
|
17
|
-
padding: @padding-xxs @padding-sm;
|
|
18
|
-
&:hover {
|
|
19
|
-
background-color: @bg-color-quaternary;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
&-content {
|
|
24
|
-
padding: @padding-xxs @padding-sm;
|
|
25
|
-
}
|
|
26
|
-
.ant-select-selected-icon {
|
|
27
|
-
position: absolute;
|
|
28
|
-
right: @margin-base;
|
|
29
|
-
top: @margin-xs;
|
|
30
|
-
color: @blue-6;
|
|
31
|
-
}
|
|
32
|
-
.tnt-highlight {
|
|
33
|
-
color: @blue-6;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
@import '../../../style/themes/index';
|
|
2
|
-
@import '../../../style/mixins/index';
|
|
3
|
-
@import '../../../input/style/mixin';
|
|
4
|
-
|
|
5
|
-
.tnt-queryform-composition-input {
|
|
6
|
-
// width: 100%;
|
|
7
|
-
max-height: 162px;
|
|
8
|
-
overflow-x: hidden;
|
|
9
|
-
cursor: text;
|
|
10
|
-
padding: 2px @padding-xl;
|
|
11
|
-
position: relative;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
background-color: @select-background;
|
|
14
|
-
border: @border-width-base @border-style-base @select-border-color;
|
|
15
|
-
border-top-width: calc(@border-width-base + 0.02px);
|
|
16
|
-
border-radius: @border-radius-base;
|
|
17
|
-
outline: none;
|
|
18
|
-
transition: all 0.3s @ease-in-out;
|
|
19
|
-
user-select: none;
|
|
20
|
-
margin-bottom: @margin-sm;
|
|
21
|
-
|
|
22
|
-
&-prefix {
|
|
23
|
-
position: absolute;
|
|
24
|
-
left: @padding-sm;
|
|
25
|
-
top: 50%;
|
|
26
|
-
transform: translateY(-50%);
|
|
27
|
-
i.anticon {
|
|
28
|
-
color: #8B919E;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&-width {
|
|
33
|
-
height: 0;
|
|
34
|
-
opacity: 0;
|
|
35
|
-
width: auto;
|
|
36
|
-
position: absolute;
|
|
37
|
-
max-width: 100%;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&-items {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-wrap: wrap;
|
|
43
|
-
padding: 0;
|
|
44
|
-
list-style: none;
|
|
45
|
-
margin: 0;
|
|
46
|
-
width: 100%;
|
|
47
|
-
&-item {
|
|
48
|
-
padding: 3px 0;
|
|
49
|
-
}
|
|
50
|
-
li {
|
|
51
|
-
line-height: 1;
|
|
52
|
-
}
|
|
53
|
-
&-input {
|
|
54
|
-
flex: 1;
|
|
55
|
-
min-width: 160px;
|
|
56
|
-
.inputClass {
|
|
57
|
-
background: none;
|
|
58
|
-
border: none !important;
|
|
59
|
-
outline: none;
|
|
60
|
-
box-shadow: none !important;
|
|
61
|
-
width: 100% !important;
|
|
62
|
-
height: 26px;
|
|
63
|
-
line-height: 26px;
|
|
64
|
-
padding: 0;
|
|
65
|
-
input {
|
|
66
|
-
border: none !important;
|
|
67
|
-
outline: none !important;
|
|
68
|
-
box-shadow: none !important;
|
|
69
|
-
height: 26px;
|
|
70
|
-
line-height: 26px;
|
|
71
|
-
padding: 0;
|
|
72
|
-
}
|
|
73
|
-
textarea {
|
|
74
|
-
padding: 0;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
.inputClass-with-placeholder {
|
|
78
|
-
min-width: 398px !important;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
&-clear {
|
|
83
|
-
position: absolute;
|
|
84
|
-
right: @margin-sm;
|
|
85
|
-
top: 50%;
|
|
86
|
-
transform: translateY(-50%);
|
|
87
|
-
display: none;
|
|
88
|
-
i.anticon {
|
|
89
|
-
color: tint(@bg-color-spotilight, 50%);
|
|
90
|
-
}
|
|
91
|
-
&:hover {
|
|
92
|
-
.anticon {
|
|
93
|
-
color: @text-color-secondary !important;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
&-search {
|
|
98
|
-
position: absolute;
|
|
99
|
-
right: 0;
|
|
100
|
-
top: 0;
|
|
101
|
-
height: 100%;
|
|
102
|
-
border-left: @border-width-base @border-style-base @select-border-color;
|
|
103
|
-
background-color: @fill-color-quaternary;
|
|
104
|
-
display: flex;
|
|
105
|
-
width: 30px;
|
|
106
|
-
justify-content: center;
|
|
107
|
-
align-items: center;
|
|
108
|
-
transition: border-color 0.3s @ease-in-out;
|
|
109
|
-
cursor: pointer;
|
|
110
|
-
&:hover {
|
|
111
|
-
background-color: #E6F4FF;
|
|
112
|
-
i.anticon {
|
|
113
|
-
color: @primary-color;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
&:hover,
|
|
118
|
-
&:focus,
|
|
119
|
-
&:active {
|
|
120
|
-
border-color: @primary-color;
|
|
121
|
-
box-shadow: 0px 0px 4px 0px rgba(18, 107, 251, 0.10), 0px 0px 5px 0px rgba(18, 107, 251, 0.30);
|
|
122
|
-
outline: 0;
|
|
123
|
-
.tnt-queryform-composition-input-prefix {
|
|
124
|
-
i.anticon {
|
|
125
|
-
color: @text-color;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
.tnt-queryform-composition-input-clear {
|
|
129
|
-
display: block;
|
|
130
|
-
}
|
|
131
|
-
.tnt-queryform-composition-input-search {
|
|
132
|
-
border-color: @primary-color;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
.ant-tag {
|
|
136
|
-
padding: 0 @padding-xs;
|
|
137
|
-
border: none;
|
|
138
|
-
background: @fill-color-tertiary;
|
|
139
|
-
height: 20px;
|
|
140
|
-
.ant-tag-addon-wrap {
|
|
141
|
-
margin-top: -2px;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/query-form-v2/Field/Checkbox.js"],"names":[],"mappings":"AAIe;;;;sBAQd"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _checkbox = _interopRequireDefault(require("../../checkbox"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
13
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
15
|
-
}
|
|
16
|
-
return t;
|
|
17
|
-
};
|
|
18
|
-
var _default = exports["default"] = function _default(_a) {
|
|
19
|
-
var value = _a.value,
|
|
20
|
-
_onChange = _a.onChange,
|
|
21
|
-
props = __rest(_a, ["value", "onChange"]);
|
|
22
|
-
return _react["default"].createElement(_checkbox["default"], Object.assign({}, props, {
|
|
23
|
-
checked: value,
|
|
24
|
-
onChange: function onChange(evt) {
|
|
25
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(evt.target.checked);
|
|
26
|
-
}
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/query-form-v2/Field/Checkbox.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAyB;AAEzB,8DAAqC;AAErC,kBAAe,CAAC,EAA6B,EAAE,EAAE;QAAjC,EAAE,KAAK,EAAE,QAAQ,OAAY,EAAP,KAAK,cAA3B,qBAA6B,CAAF;IAAO,OAAA,CAChD,8BAAC,kBAAQ,oBACH,KAAK,IACT,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;YAChB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAChC,CAAC,IACD,CACH,CAAA;CAAA,CAAA","sourcesContent":["import React from 'react'\n\nimport Checkbox from '../../checkbox'\n\nexport default ({ value, onChange, ...props }) => (\n <Checkbox\n {...props}\n checked={value}\n onChange={(evt) => {\n onChange?.(evt.target.checked)\n }}\n />\n)\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/query-form-v2/Field/Select.js"],"names":[],"mappings":"AAMe,yDAkDd"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _select = _interopRequireDefault(require("../../select"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
13
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
23
|
-
var t = {};
|
|
24
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
25
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
27
|
-
}
|
|
28
|
-
return t;
|
|
29
|
-
};
|
|
30
|
-
var Option = _select["default"].Option;
|
|
31
|
-
var _default = exports["default"] = function _default(props) {
|
|
32
|
-
var options = props.options,
|
|
33
|
-
params = props.params,
|
|
34
|
-
_props$queryKey = props.queryKey,
|
|
35
|
-
queryKey = _props$queryKey === void 0 ? 'name' : _props$queryKey,
|
|
36
|
-
_props$fieldNames = props.fieldNames,
|
|
37
|
-
fieldNames = _props$fieldNames === void 0 ? {
|
|
38
|
-
label: 'label',
|
|
39
|
-
value: 'value'
|
|
40
|
-
} : _props$fieldNames,
|
|
41
|
-
loadData = props.loadData,
|
|
42
|
-
rest = __rest(props, ["options", "params", "queryKey", "fieldNames", "loadData"]);
|
|
43
|
-
var _useState = (0, _react.useState)(options || []),
|
|
44
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
-
items = _useState2[0],
|
|
46
|
-
setItems = _useState2[1];
|
|
47
|
-
var _useState3 = (0, _react.useState)(''),
|
|
48
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
-
query = _useState4[0],
|
|
50
|
-
setQuery = _useState4[1];
|
|
51
|
-
var onSearch = function onSearch(val) {
|
|
52
|
-
setQuery(val);
|
|
53
|
-
};
|
|
54
|
-
if (loadData) {
|
|
55
|
-
(0, _react.useEffect)(function () {
|
|
56
|
-
loadData(Object.assign(_defineProperty({}, queryKey, query), params || {})).then(function (items) {
|
|
57
|
-
setItems(items);
|
|
58
|
-
});
|
|
59
|
-
}, [params, query]);
|
|
60
|
-
}
|
|
61
|
-
(0, _react.useEffect)(function () {
|
|
62
|
-
setItems(options || []);
|
|
63
|
-
}, [options]);
|
|
64
|
-
return _react["default"].createElement(_select["default"], Object.assign({
|
|
65
|
-
allowClear: true,
|
|
66
|
-
showSearch: true,
|
|
67
|
-
optionFilterProp: "children",
|
|
68
|
-
onSearch: onSearch
|
|
69
|
-
}, rest), items.map(function (item) {
|
|
70
|
-
var labelKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label';
|
|
71
|
-
var valueKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value';
|
|
72
|
-
var value = item instanceof Object ? item[valueKey] : item;
|
|
73
|
-
var label = item instanceof Object ? item[labelKey] : item;
|
|
74
|
-
var optionProps = item instanceof Object ? item : {};
|
|
75
|
-
return _react["default"].createElement(Option, Object.assign({}, optionProps, {
|
|
76
|
-
key: value,
|
|
77
|
-
value: value
|
|
78
|
-
}), label);
|
|
79
|
-
}));
|
|
80
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/query-form-v2/Field/Select.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAElD,0DAAiC;AAEjC,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAM,CAAA;AAEzB,kBAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,GAAG,MAAM,EACjB,UAAU,GAAG;QACX,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO;KACf,EACD,QAAQ,KAEN,KAAK,EADJ,IAAI,UACL,KAAK,EAVH,2DAUL,CAAQ,CAAA;IACT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,IAAI,EAAE,CAAC,CAAA;IACjD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAA;IACtC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,EAAE;QACvB,QAAQ,CAAC,GAAG,CAAC,CAAA;IACf,CAAC,CAAA;IAED,IAAI,QAAQ,EAAE;QACZ,IAAA,iBAAS,EAAC,GAAG,EAAE;YACb,QAAQ,iBACN,CAAC,QAAQ,CAAC,EAAE,KAAK,IACd,CAAC,MAAM,IAAI,EAAE,CAAC,EACjB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;gBAChB,QAAQ,CAAC,KAAK,CAAC,CAAA;YACjB,CAAC,CAAC,CAAA;QACJ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;KACpB;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;IACzB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAEb,OAAO,CACL,8BAAC,gBAAM,kBAAC,UAAU,QAAC,UAAU,QAAC,gBAAgB,EAAC,UAAU,EAAC,QAAQ,EAAE,QAAQ,IAAM,IAAI,GACnF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClB,MAAM,QAAQ,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAA;QAC7C,MAAM,QAAQ,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAA;QAC7C,MAAM,KAAK,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAC5D,MAAM,KAAK,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAC5D,MAAM,WAAW,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;QAEtD,OAAO,CACL,8BAAC,MAAM,oBAAK,WAAW,IAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAC9C,KAAK,CACC,CACV,CAAA;IACH,CAAC,CAAC,CACK,CACV,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useState, useEffect } from 'react'\n\nimport Select from '../../select'\n\nconst { Option } = Select\n\nexport default (props) => {\n const {\n options,\n params,\n queryKey = 'name',\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n loadData,\n ...rest\n } = props\n const [items, setItems] = useState(options || [])\n const [query, setQuery] = useState('')\n const onSearch = (val) => {\n setQuery(val)\n }\n\n if (loadData) {\n useEffect(() => {\n loadData({\n [queryKey]: query,\n ...(params || {}),\n }).then((items) => {\n setItems(items)\n })\n }, [params, query])\n }\n\n useEffect(() => {\n setItems(options || [])\n }, [options])\n\n return (\n <Select allowClear showSearch optionFilterProp=\"children\" onSearch={onSearch} {...rest}>\n {items.map((item) => {\n const labelKey = fieldNames?.label || 'label'\n const valueKey = fieldNames?.value || 'value'\n const value = item instanceof Object ? item[valueKey] : item\n const label = item instanceof Object ? item[labelKey] : item\n const optionProps = item instanceof Object ? item : {}\n\n return (\n <Option {...optionProps} key={value} value={value}>\n {label}\n </Option>\n )\n })}\n </Select>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/query-form-v2/Field/SelectInput.js"],"names":[],"mappings":"AAQe,yDAsDd"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _select = _interopRequireDefault(require("../../select"));
|
|
11
|
-
var _input = _interopRequireDefault(require("../../input"));
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
23
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
25
|
-
var t = {};
|
|
26
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
27
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
|
-
var Option = _select["default"].Option;
|
|
33
|
-
var _default = exports["default"] = function _default(props) {
|
|
34
|
-
var _props$options = props.options,
|
|
35
|
-
options = _props$options === void 0 ? [] : _props$options,
|
|
36
|
-
addonBeforeStyle = props.addonBeforeStyle,
|
|
37
|
-
selectProps = props.selectProps,
|
|
38
|
-
inputProps = __rest(props, ["options", "addonBeforeStyle", "selectProps"]);
|
|
39
|
-
var _useState = (0, _react.useState)(options),
|
|
40
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
-
items = _useState2[0],
|
|
42
|
-
setItems = _useState2[1];
|
|
43
|
-
var getInitialKey = function getInitialKey() {
|
|
44
|
-
var key = (0, _get2["default"])(options, '0.value');
|
|
45
|
-
if (inputProps.value) {
|
|
46
|
-
key = (0, _get2["default"])(Object.keys(inputProps.value), '0') || key;
|
|
47
|
-
}
|
|
48
|
-
return key;
|
|
49
|
-
};
|
|
50
|
-
var _useState3 = (0, _react.useState)(getInitialKey()),
|
|
51
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
-
key = _useState4[0],
|
|
53
|
-
setKey = _useState4[1];
|
|
54
|
-
var onKeyChange = function onKeyChange(key) {
|
|
55
|
-
setKey(key);
|
|
56
|
-
props.onChange(_defineProperty({}, key, ''));
|
|
57
|
-
};
|
|
58
|
-
var onChange = function onChange(evt) {
|
|
59
|
-
props.onChange(_defineProperty({}, key, evt.target.value));
|
|
60
|
-
};
|
|
61
|
-
var addonBefore = _react["default"].createElement(_select["default"], Object.assign({
|
|
62
|
-
value: key,
|
|
63
|
-
onChange: onKeyChange,
|
|
64
|
-
style: Object.assign({
|
|
65
|
-
width: '120px'
|
|
66
|
-
}, addonBeforeStyle),
|
|
67
|
-
dropdownMatchSelectWidth: false
|
|
68
|
-
}, selectProps || {}), items.map(function (_ref) {
|
|
69
|
-
var label = _ref.label,
|
|
70
|
-
value = _ref.value;
|
|
71
|
-
return _react["default"].createElement(Option, {
|
|
72
|
-
key: value,
|
|
73
|
-
value: value
|
|
74
|
-
}, label);
|
|
75
|
-
}));
|
|
76
|
-
var getInputValue = function getInputValue() {
|
|
77
|
-
return (0, _get2["default"])(inputProps.value, key);
|
|
78
|
-
};
|
|
79
|
-
(0, _react.useEffect)(function () {
|
|
80
|
-
setItems(options);
|
|
81
|
-
setKey(getInitialKey());
|
|
82
|
-
}, [options, inputProps.value]);
|
|
83
|
-
return _react["default"].createElement(_input["default"], Object.assign({}, inputProps, {
|
|
84
|
-
value: getInputValue(),
|
|
85
|
-
addonBefore: addonBefore,
|
|
86
|
-
onChange: onChange
|
|
87
|
-
}));
|
|
88
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.js","sourceRoot":"","sources":["../../../src/query-form-v2/Field/SelectInput.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAClD,mCAA4B;AAE5B,0DAAiC;AACjC,wDAA+B;AAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAM,CAAA;AAEzB,kBAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,gBAAgB,EAAE,WAAW,KAAmB,KAAK,EAApB,UAAU,UAAK,KAAK,EAArE,8CAA6D,CAAQ,CAAA;IAC3E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,GAAG,GAAG,IAAA,YAAG,EAAC,OAAO,EAAE,SAAS,CAAC,CAAA;QAEjC,IAAI,UAAU,CAAC,KAAK,EAAE;YACpB,GAAG,GAAG,IAAA,YAAG,EAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,CAAA;SACrD;QAED,OAAO,GAAG,CAAA;IACZ,CAAC,CAAA;IACD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,IAAA,gBAAQ,EAAC,aAAa,EAAE,CAAC,CAAA;IAC/C,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,EAAE;QAC1B,MAAM,CAAC,GAAG,CAAC,CAAA;QACX,KAAK,CAAC,QAAQ,CAAC;YACb,CAAC,GAAG,CAAC,EAAE,EAAE;SACV,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,EAAE;QACvB,KAAK,CAAC,QAAQ,CAAC;YACb,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK;SACxB,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,MAAM,WAAW,GAAG,CAClB,8BAAC,gBAAM,kBACL,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,WAAW,EACrB,KAAK,kBACH,KAAK,EAAE,OAAO,IACX,gBAAgB,GAErB,wBAAwB,EAAE,KAAK,IAC3B,CAAC,WAAW,IAAE,EAAE,CAAC,GAEpB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC/B,8BAAC,MAAM,IAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAC7B,KAAK,CACC,CACV,CAAC,CACK,CACV,CAAA;IACD,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,OAAO,IAAA,YAAG,EAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACnC,CAAC,CAAA;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,OAAO,CAAC,CAAA;QACjB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAA;IACzB,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;IAE/B,OAAO,CACL,8BAAC,eAAK,oBAAK,UAAU,IAAE,KAAK,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAChG,CAAA;AACH,CAAC,CAAA","sourcesContent":["import React, { useState, useEffect } from 'react'\nimport { get } from 'lodash'\n\nimport Select from '../../select'\nimport Input from '../../input'\n\nconst { Option } = Select\n\nexport default (props) => {\n const { options = [], addonBeforeStyle, selectProps,...inputProps } = props\n const [items, setItems] = useState(options)\n const getInitialKey = () => {\n let key = get(options, '0.value')\n\n if (inputProps.value) {\n key = get(Object.keys(inputProps.value), '0') || key\n }\n\n return key\n }\n const [key, setKey] = useState(getInitialKey())\n const onKeyChange = (key) => {\n setKey(key)\n props.onChange({\n [key]: '',\n })\n }\n const onChange = (evt) => {\n props.onChange({\n [key]: evt.target.value,\n })\n }\n const addonBefore = (\n <Select\n value={key}\n onChange={onKeyChange}\n style={{\n width: '120px',\n ...addonBeforeStyle,\n }}\n dropdownMatchSelectWidth={false}\n {...(selectProps||{})}\n >\n {items.map(({ label, value }) => (\n <Option key={value} value={value}>\n {label}\n </Option>\n ))}\n </Select>\n )\n const getInputValue = () => {\n return get(inputProps.value, key)\n }\n\n useEffect(() => {\n setItems(options)\n setKey(getInitialKey())\n }, [options, inputProps.value])\n\n return (\n <Input {...inputProps} value={getInputValue()} addonBefore={addonBefore} onChange={onChange} />\n )\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const defaultFieldWidth: "200px";
|
|
2
|
-
export function getFieldWidth(type: any): any;
|
|
3
|
-
declare namespace _default {
|
|
4
|
-
export { Input as string };
|
|
5
|
-
export { Input as input };
|
|
6
|
-
export const search: import("react").ForwardRefExoticComponent<import("../../input").SearchProps & {
|
|
7
|
-
capitalize?: boolean | undefined;
|
|
8
|
-
} & import("react").RefAttributes<import("antd/lib/input/Search").default>>;
|
|
9
|
-
export { InputNumber as inputNumber };
|
|
10
|
-
export { InputNumber as number };
|
|
11
|
-
export { SelectField as select };
|
|
12
|
-
export { CheckboxField as checkbox };
|
|
13
|
-
export { DatePicker as date };
|
|
14
|
-
export const dateRange: import("react").ClassicComponentClass<import("antd/lib/date-picker/interface").RangePickerProps>;
|
|
15
|
-
export { SelectInput as selectInput };
|
|
16
|
-
}
|
|
17
|
-
export default _default;
|
|
18
|
-
import Input from "../../input";
|
|
19
|
-
import InputNumber from "../../input-number";
|
|
20
|
-
import SelectField from "./Select";
|
|
21
|
-
import CheckboxField from "./Checkbox";
|
|
22
|
-
import DatePicker from "../../date-picker";
|
|
23
|
-
import SelectInput from "./SelectInput";
|
|
24
|
-
//# sourceMappingURL=fieldsMap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldsMap.d.ts","sourceRoot":"","sources":["../../../src/query-form-v2/Field/fieldsMap.js"],"names":[],"mappings":"AAOA,wCAAwC;AAEjC,8CAWN"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getFieldWidth = exports.defaultFieldWidth = exports["default"] = void 0;
|
|
7
|
-
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
8
|
-
var _Select = _interopRequireDefault(require("./Select"));
|
|
9
|
-
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
10
|
-
var _datePicker = _interopRequireDefault(require("../../date-picker"));
|
|
11
|
-
var _input = _interopRequireDefault(require("../../input"));
|
|
12
|
-
var _inputNumber = _interopRequireDefault(require("../../input-number"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
-
var defaultFieldWidth = exports.defaultFieldWidth = '200px';
|
|
15
|
-
var getFieldWidth = exports.getFieldWidth = function getFieldWidth(type) {
|
|
16
|
-
if (type === 'dateRange') {
|
|
17
|
-
return '340px';
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
dateRange: '340px',
|
|
21
|
-
selectInput: '320px'
|
|
22
|
-
}[type] || defaultFieldWidth;
|
|
23
|
-
};
|
|
24
|
-
var _default = exports["default"] = {
|
|
25
|
-
string: _input["default"],
|
|
26
|
-
input: _input["default"],
|
|
27
|
-
search: _input["default"].Search,
|
|
28
|
-
inputNumber: _inputNumber["default"],
|
|
29
|
-
number: _inputNumber["default"],
|
|
30
|
-
select: _Select["default"],
|
|
31
|
-
checkbox: _Checkbox["default"],
|
|
32
|
-
date: _datePicker["default"],
|
|
33
|
-
dateRange: _datePicker["default"].RangePicker,
|
|
34
|
-
selectInput: _SelectInput["default"]
|
|
35
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldsMap.js","sourceRoot":"","sources":["../../../src/query-form-v2/Field/fieldsMap.js"],"names":[],"mappings":";;;;;;AAAA,0DAAsC;AACtC,sDAAkC;AAClC,gEAAuC;AACvC,oEAA0C;AAC1C,wDAA+B;AAC/B,sEAA4C;AAE/B,QAAA,iBAAiB,GAAG,OAAO,CAAA;AAEjC,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,EAAE;IACpC,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO,OAAO,CAAA;KACf;IAED,OAAO,CACL;QACE,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE,OAAO;KACrB,CAAC,IAAI,CAAC,IAAI,yBAAiB,CAC7B,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,aAAa,iBAWzB;AAED,kBAAe;IACb,MAAM,EAAE,eAAK;IACb,KAAK,EAAE,eAAK;IACZ,MAAM,EAAE,eAAK,CAAC,MAAM;IACpB,WAAW,EAAE,sBAAW;IACxB,MAAM,EAAE,sBAAW;IACnB,MAAM,EAAE,gBAAW;IACnB,QAAQ,EAAE,kBAAa;IACvB,IAAI,EAAE,qBAAU;IAChB,SAAS,EAAE,qBAAU,CAAC,WAAW;IACjC,WAAW,EAAE,qBAAW;CACzB,CAAA","sourcesContent":["import CheckboxField from './Checkbox'\nimport SelectField from './Select'\nimport SelectInput from './SelectInput'\nimport DatePicker from '../../date-picker'\nimport Input from '../../input'\nimport InputNumber from '../../input-number'\n\nexport const defaultFieldWidth = '200px'\n\nexport const getFieldWidth = (type) => {\n if (type === 'dateRange') {\n return '340px'\n }\n\n return (\n {\n dateRange: '340px',\n selectInput: '320px',\n }[type] || defaultFieldWidth\n )\n}\n\nexport default {\n string: Input,\n input: Input,\n search: Input.Search,\n inputNumber: InputNumber,\n number: InputNumber,\n select: SelectField,\n checkbox: CheckboxField,\n date: DatePicker,\n dateRange: DatePicker.RangePicker,\n selectInput: SelectInput,\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default class Field extends React.PureComponent<any, any, any> {
|
|
2
|
-
constructor(props: any);
|
|
3
|
-
state: {
|
|
4
|
-
value: any;
|
|
5
|
-
};
|
|
6
|
-
render(): React.JSX.Element;
|
|
7
|
-
updateValue: (name: any, value: any) => void;
|
|
8
|
-
onChange: (...args: any[]) => void;
|
|
9
|
-
onFormChange: (formData: any) => void;
|
|
10
|
-
componentDidMount(): void;
|
|
11
|
-
componentWillUnmount(): void;
|
|
12
|
-
}
|
|
13
|
-
import React from "react";
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/query-form-v2/Field/index.js"],"names":[],"mappings":"AAUA;IACE,wBAMC;IAHC;;MAEC;IAGH,4BAkCC;IAED,6CAKC;IAED,mCAaC;IAED,sCAIC;IAED,0BAKC;IAED,6BAKC;CACF"}
|