tntd 3.0.0-beta.9 → 3.0.1
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/array-input/index.js +57 -42
- package/es/array-input/index.js.map +1 -1
- package/es/array-input/index.less +4 -1
- package/es/button/button.js +3 -7
- package/es/button/button.js.map +1 -1
- package/es/button/button.less +17 -12
- package/es/collapse/collapse.less +3 -3
- package/es/date-picker/index.less +6 -6
- package/es/date-picker/style/Calendar.less +1 -1
- package/es/date-picker/style/RangePicker.less +3 -3
- package/es/descriptions/descriptions.js +36 -18
- package/es/descriptions/descriptions.js.map +1 -1
- package/es/descriptions/descriptions.less +6 -2
- package/es/descriptions/style/index.less +1 -0
- package/es/drawer/drawer.js +32 -22
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/index.less +13 -14
- package/es/drawer/style/drawer.less +2 -4
- package/es/form/form.less +12 -6
- package/es/form/style/index.less +6 -6
- package/es/handle-icon/index.js +201 -0
- package/es/handle-icon/index.js.map +1 -0
- package/es/handle-icon/index.less +53 -0
- package/es/icon/style/style.less +1 -1
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/input/input.js +10 -6
- package/es/input/input.js.map +1 -1
- package/es/input/style/mixin.less +1 -2
- package/es/locale/en_US.js +3 -0
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +3 -0
- package/es/locale/zh_CN.js.map +1 -1
- package/es/mentions/style/index.less +1 -0
- package/es/modal/style/confirm.less +6 -10
- package/es/modal/style/modal.less +1 -1
- package/es/page-container/index.js +1 -1
- package/es/page-container/index.js.map +1 -1
- package/es/page-container/index.less +1 -0
- package/es/page-loading/index.js +1 -1
- package/es/page-loading/index.js.map +1 -1
- package/es/query-form/Field/SelectInput.js +4 -22
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/fieldsMap.js +2 -2
- package/es/query-form/Field/fieldsMap.js.map +1 -1
- package/es/query-form/Field/index.js +0 -1
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-form/index.js +127 -117
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +9 -12
- package/es/{query-form → query-form-backup}/Field/Composition/index.less +1 -1
- package/es/query-form-backup/index.less +90 -0
- package/es/query-list-scene/QueryForm.js +1 -3
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/select/select.js +5 -3
- package/es/select/select.js.map +1 -1
- package/es/select/select.less +1 -3
- package/es/select/style/index.less +7 -6
- package/es/spin/index.js +3 -2
- package/es/spin/index.js.map +1 -1
- package/es/spin/spin.js +36 -0
- package/es/spin/spin.js.map +1 -0
- package/es/spin/spin.less +9 -0
- package/es/style/themes/default.less +1 -1
- package/es/table/expand.less +49 -0
- package/es/table/hooks/index.js +2 -1
- package/es/table/hooks/index.js.map +1 -1
- package/es/table/hooks/use-expand-fixed.js +80 -0
- package/es/table/hooks/use-expand-fixed.js.map +1 -0
- package/es/table/index.js +1 -0
- package/es/table/index.js.map +1 -1
- package/es/table/style/index.less +58 -88
- package/es/table/table.js +48 -14
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +13 -22
- package/es/table/table.stories.js +413 -2
- package/es/table/table.stories.js.map +1 -1
- package/es/table/utils.js +11 -0
- package/es/table/utils.js.map +1 -1
- package/es/table-container/index.js +1 -1
- package/es/table-container/index.js.map +1 -1
- package/es/table-container/index.less +14 -14
- package/es/tabs/tabs.js +9 -1
- package/es/tabs/tabs.js.map +1 -1
- package/es/tabs/tabs.less +52 -62
- package/es/tabs-container/index.js +1 -1
- package/es/tabs-container/index.js.map +1 -1
- package/es/tag/color.less +28 -18
- package/es/tag/index.js +1 -1
- package/es/tag/index.js.map +1 -1
- package/es/tag/tag.less +41 -5
- package/es/title/index.js +4 -3
- package/es/title/index.js.map +1 -1
- package/es/tntd-action/Action.js +58 -12
- package/es/tntd-action/Action.js.map +1 -1
- package/es/tntd-action/index.less +5 -3
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/index.less +14 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
- package/es/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
- package/es/tntd-form/FormItem/ItemHolder.js +1 -6
- package/es/tntd-form/FormItem/ItemHolder.js.map +1 -1
- package/es/tntd-form/FormItemLabel.js +2 -0
- package/es/tntd-form/FormItemLabel.js.map +1 -1
- package/es/tntd-select/index.js +13 -9
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-select/index.less +7 -0
- package/es/tooltip/index.js +1 -0
- package/es/tooltip/index.js.map +1 -1
- package/es/tooltip/index.less +1 -2
- package/lib/array-input/index.d.ts +1 -12
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +62 -55
- package/lib/array-input/index.js.map +1 -1
- package/lib/array-input/index.less +4 -1
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +3 -15
- package/lib/button/button.js.map +1 -1
- package/lib/button/button.less +17 -12
- package/lib/collapse/collapse.less +3 -3
- package/lib/date-picker/index.less +6 -6
- package/lib/date-picker/style/Calendar.less +1 -1
- package/lib/date-picker/style/RangePicker.less +3 -3
- package/lib/descriptions/descriptions.d.ts.map +1 -1
- package/lib/descriptions/descriptions.js +40 -20
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/descriptions.less +6 -2
- package/lib/descriptions/style/index.less +1 -0
- package/lib/drawer/drawer.d.ts +3 -0
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +30 -20
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/index.less +13 -14
- package/lib/drawer/style/drawer.less +2 -4
- package/lib/form/form.less +12 -6
- package/lib/form/style/index.less +6 -6
- package/lib/handle-icon/index.d.ts +7 -0
- package/lib/handle-icon/index.d.ts.map +1 -0
- package/lib/handle-icon/index.js +221 -0
- package/lib/handle-icon/index.js.map +1 -0
- package/lib/handle-icon/index.less +53 -0
- package/lib/icon/style/style.less +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +8 -4
- package/lib/input/input.js.map +1 -1
- package/lib/input/style/mixin.less +1 -2
- package/lib/locale/default.d.ts +3 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +3 -0
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +3 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +3 -0
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/mentions/style/index.less +1 -0
- package/lib/modal/style/confirm.less +6 -10
- package/lib/modal/style/modal.less +1 -1
- package/lib/page-container/index.js +1 -1
- package/lib/page-container/index.js.map +1 -1
- package/lib/page-container/index.less +1 -0
- package/lib/page-loading/index.js +1 -1
- package/lib/page-loading/index.js.map +1 -1
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +3 -15
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.d.ts +3 -6
- package/lib/query-form/Field/fieldsMap.js +2 -2
- package/lib/query-form/Field/fieldsMap.js.map +1 -1
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +0 -1
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/index.d.ts +7 -4
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +149 -143
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +9 -12
- package/lib/{query-form → query-form-backup}/Field/Composition/index.less +1 -1
- package/lib/query-form-backup/index.less +90 -0
- package/lib/query-list-scene/QueryForm.js +2 -3
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/select/select.d.ts.map +1 -1
- package/lib/select/select.js +4 -2
- package/lib/select/select.js.map +1 -1
- package/lib/select/select.less +1 -3
- package/lib/select/style/index.less +7 -6
- package/lib/spin/index.d.ts +3 -2
- package/lib/spin/index.d.ts.map +1 -1
- package/lib/spin/index.js +4 -6
- package/lib/spin/index.js.map +1 -1
- package/lib/spin/spin.d.ts +9 -0
- package/lib/spin/spin.d.ts.map +1 -0
- package/lib/spin/spin.js +44 -0
- package/lib/spin/spin.js.map +1 -0
- package/lib/spin/spin.less +9 -0
- package/lib/style/themes/default.less +1 -1
- package/lib/table/expand.less +49 -0
- package/lib/table/hooks/index.d.ts +1 -0
- package/lib/table/hooks/index.d.ts.map +1 -1
- package/lib/table/hooks/index.js +11 -0
- package/lib/table/hooks/index.js.map +1 -1
- package/lib/table/hooks/use-expand-fixed.d.ts +4 -0
- package/lib/table/hooks/use-expand-fixed.d.ts.map +1 -0
- package/lib/table/hooks/use-expand-fixed.js +110 -0
- package/lib/table/hooks/use-expand-fixed.js.map +1 -0
- package/lib/table/index.d.ts +1 -0
- package/lib/table/index.d.ts.map +1 -1
- package/lib/table/index.js +1 -0
- package/lib/table/index.js.map +1 -1
- package/lib/table/style/index.less +58 -88
- package/lib/table/table.d.ts +3 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +49 -11
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +13 -22
- package/lib/table/table.stories.d.ts +106 -29
- package/lib/table/table.stories.d.ts.map +1 -1
- package/lib/table/table.stories.js +426 -3
- package/lib/table/table.stories.js.map +1 -1
- package/lib/table/utils.d.ts +1 -0
- package/lib/table/utils.d.ts.map +1 -1
- package/lib/table/utils.js +13 -0
- package/lib/table/utils.js.map +1 -1
- package/lib/table-container/index.d.ts.map +1 -1
- package/lib/table-container/index.js +1 -1
- package/lib/table-container/index.js.map +1 -1
- package/lib/table-container/index.less +14 -14
- package/lib/tabs/tabs.d.ts.map +1 -1
- package/lib/tabs/tabs.js +8 -0
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tabs/tabs.less +52 -62
- package/lib/tabs-container/index.js +1 -1
- package/lib/tabs-container/index.js.map +1 -1
- package/lib/tag/color.less +28 -18
- package/lib/tag/index.js +1 -1
- package/lib/tag/index.js.map +1 -1
- package/lib/tag/tag.less +41 -5
- package/lib/title/index.d.ts +1 -0
- package/lib/title/index.d.ts.map +1 -1
- package/lib/title/index.js +3 -2
- package/lib/title/index.js.map +1 -1
- package/lib/tntd-action/Action.d.ts +1 -1
- package/lib/tntd-action/Action.js +63 -13
- package/lib/tntd-action/Action.js.map +1 -1
- package/lib/tntd-action/index.less +5 -3
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.d.ts.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -11
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.less +14 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.d.ts.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +3 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.d.ts.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +1 -0
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
- package/lib/tntd-form/FormItem/ItemHolder.js +1 -6
- package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -1
- package/lib/tntd-form/FormItemLabel.d.ts.map +1 -1
- package/lib/tntd-form/FormItemLabel.js +2 -0
- package/lib/tntd-form/FormItemLabel.js.map +1 -1
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +12 -8
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-select/index.less +7 -0
- package/lib/tooltip/index.d.ts +1 -0
- package/lib/tooltip/index.d.ts.map +1 -1
- package/lib/tooltip/index.js +1 -0
- package/lib/tooltip/index.js.map +1 -1
- package/lib/tooltip/index.less +1 -2
- package/package.json +4 -3
- package/themes/default/variables.less +2 -2
- package/themes/default/variablesVar.less +2 -2
- package/es/array-input/1.png +0 -1
- package/es/array-input/111.gif +0 -0
- package/es/array-input/icon.js +0 -25
- package/es/array-input/icon.js.map +0 -1
- package/es/query-form/Field/Composition/FieldPopover.js +0 -308
- package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/es/query-form/Field/Composition/Select.js +0 -104
- package/es/query-form/Field/Composition/Select.js.map +0 -1
- package/es/query-form/Field/Composition/index.js +0 -299
- package/es/query-form/Field/Composition/index.js.map +0 -1
- package/es/query-form/Field/Composition/utils.js +0 -19
- package/es/query-form/Field/Composition/utils.js.map +0 -1
- package/lib/array-input/1.png +0 -1
- package/lib/array-input/111.gif +0 -0
- package/lib/array-input/icon.d.ts +0 -4
- package/lib/array-input/icon.d.ts.map +0 -1
- package/lib/array-input/icon.js +0 -32
- package/lib/array-input/icon.js.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +0 -19
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.js +0 -347
- package/lib/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/lib/query-form/Field/Composition/Select.d.ts +0 -4
- package/lib/query-form/Field/Composition/Select.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/Select.js +0 -128
- package/lib/query-form/Field/Composition/Select.js.map +0 -1
- package/lib/query-form/Field/Composition/index.d.ts +0 -14
- package/lib/query-form/Field/Composition/index.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/index.js +0 -349
- package/lib/query-form/Field/Composition/index.js.map +0 -1
- package/lib/query-form/Field/Composition/utils.d.ts +0 -6
- package/lib/query-form/Field/Composition/utils.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/utils.js +0 -27
- package/lib/query-form/Field/Composition/utils.js.map +0 -1
- /package/es/{query-form → query-form-backup}/Field/Composition/FieldPopover.less +0 -0
- /package/lib/{query-form → query-form-backup}/Field/Composition/FieldPopover.less +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.tnt-queryform {
|
|
2
|
+
&-top {
|
|
3
|
+
display: flex;
|
|
4
|
+
&-body {
|
|
5
|
+
flex: 1;
|
|
6
|
+
.ant-btn {
|
|
7
|
+
margin-right: 10px;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-extra {
|
|
13
|
+
& > * {
|
|
14
|
+
margin-left: 10px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ant-form {
|
|
19
|
+
// margin-bottom: @margin-sm;
|
|
20
|
+
&.ant-form-inline {
|
|
21
|
+
flex-wrap: unset;
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.ant-form-inline .ant-form-item {
|
|
26
|
+
margin-right: 10px;
|
|
27
|
+
margin-bottom: @margin-sm;
|
|
28
|
+
display: inline-block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ant-form-item-control {
|
|
32
|
+
// min-width: 160px;
|
|
33
|
+
line-height: unset;
|
|
34
|
+
.ant-calendar-picker-input {
|
|
35
|
+
padding: 0 @padding-sm;
|
|
36
|
+
}
|
|
37
|
+
.ant-form-item-children {
|
|
38
|
+
& > .ant-input,
|
|
39
|
+
& > .ant-input-affix-wrapper {
|
|
40
|
+
width: 160px;
|
|
41
|
+
// width: 200px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&-drawer {
|
|
48
|
+
margin-top: @margin-xxl;
|
|
49
|
+
&.large-size {
|
|
50
|
+
margin-top: 60px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.ant-drawer.ant-drawer-open {
|
|
54
|
+
.ant-drawer-mask {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
background: unset;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
.ant-drawer-body {
|
|
60
|
+
.ant-form-item {
|
|
61
|
+
display: block;
|
|
62
|
+
margin-right: 0;
|
|
63
|
+
margin-bottom: @margin-md;
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
.ant-form-item-label {
|
|
67
|
+
display: block;
|
|
68
|
+
text-align: left;
|
|
69
|
+
line-height: 22px;
|
|
70
|
+
margin-bottom: 10px;
|
|
71
|
+
}
|
|
72
|
+
.ant-form-item-control-wrapper,
|
|
73
|
+
.ant-form-item-control,
|
|
74
|
+
.ant-calendar-picker,
|
|
75
|
+
.ant-input {
|
|
76
|
+
min-width: 100%;
|
|
77
|
+
width: 100%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
& > .ant-btn {
|
|
81
|
+
display: block;
|
|
82
|
+
width: 100%;
|
|
83
|
+
margin-bottom: 10px;
|
|
84
|
+
&.ant-btn-primary {
|
|
85
|
+
margin-top: @margin-md;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _queryForm = _interopRequireDefault(require("../query-form"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
13
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
14
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -128,7 +127,7 @@ var QueryForm = exports["default"] = /*#__PURE__*/function (_React$PureComponent
|
|
|
128
127
|
props = __rest(_a, ["className", "actions", "extraActions", "extralActions", "qlsProps"]);
|
|
129
128
|
return _react["default"].createElement(_queryForm["default"], Object.assign({}, props, {
|
|
130
129
|
form: this.form,
|
|
131
|
-
className: (0,
|
|
130
|
+
className: (0, _classnames["default"])(clsPrefix, className),
|
|
132
131
|
// 前期拼写错误,导致需要兼容错误的api
|
|
133
132
|
extraActions: extraActions || extralActions,
|
|
134
133
|
onChange: this.onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryForm.js","sourceRoot":"","sources":["../../src/query-list-scene/QueryForm.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,4DAAmC;AACnC,+DAAgC;AAEhC,MAAM,SAAS,GAAG,8BAA8B,CAAA;AAEhD,MAAqB,SAAU,SAAQ,eAAK,CAAC,aAAa;IACxD,YAAY,KAAK;QACf,KAAK,CAAC,KAAK,CAAC,CAAA;QA0Cd;;;;mBAAW,CAAC,SAAS,EAAE,EAAE;gBACvB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;gB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AAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,IACrB,CACH,CAAA;IACH,CAAC;IAED,iBAAiB;QACf,MAAM,EAAE,aAAa,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEpE,IAAI,QAAQ,CAAC,MAAM,IAAI,MAAM,EAAE;YAC7B,OAAO,CAAC,WAAW,iCAEZ,aAAa,GACb,OAAO,CAAC,WAAW,EAAE,GAE1B,KAAK,CACN,CAAA;SACF;aAAM;YACL,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;SAC3C;IACH,CAAC;IA6CD,oBAAoB;QAClB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE9B,OAAO,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;QACvD,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;IAC7D,CAAC;CACF;AA7FD,4BA6FC;AAED,SAAS,CAAC,KAAK,GAAG,oBAAI,CAAC,KAAK,CAAA","sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\nimport Form from '../query-form'\n\nconst clsPrefix = 'tnt-querylistscene-queryform'\n\nexport default class QueryForm extends React.PureComponent {\n constructor(props) {\n super(props)\n const { actions, form } = props\n\n this.form = form || Form.createForm()\n\n actions.on('setFormData', this.setFormData)\n actions.on('resetFormData', this.resetFormData)\n }\n\n render() {\n const { className, actions, extraActions, extralActions, qlsProps, ...props } = this.props\n\n return (\n <Form\n {...props}\n form={this.form}\n className={classnames(clsPrefix, className)}\n // 前期拼写错误,导致需要兼容错误的api\n extraActions={extraActions || extralActions}\n onChange={this.onChange}\n onSearch={this.onSearch}\n onReset={this.onReset}\n />\n )\n }\n\n componentDidMount() {\n const { initialValues = {}, actions, qlsProps, memory } = this.props\n\n if (qlsProps.memory || memory) {\n actions.setFormData(\n {\n ...initialValues,\n ...actions.getFormData(),\n },\n false\n )\n } else {\n actions.setData('formData', initialValues)\n }\n }\n\n onSearch = (searchObj) => {\n const { onSearch, actions } = this.props\n const values = actions.getFormData()\n const params = { ...values, ...(searchObj || {}), current: 1 }\n\n // memory 与 url解析setForm时 监听事件异步\n actions.setData('formData', values)\n Promise.resolve().then(() => {\n onSearch && onSearch(params)\n actions.emit('search', params)\n })\n }\n\n onReset = () => {\n const { initialValues, onReset, actions } = this.props\n\n actions.setFormData(initialValues, false)\n\n onReset?.(initialValues)\n this.onSearch()\n }\n\n onChange = (newValues, changedInfo, ...rest) => {\n const { onChange, actions } = this.props\n\n actions.setFormData(newValues, false)\n onChange?.(newValues, changedInfo, ...rest)\n }\n\n setFormData = (data, needSearch) => {\n const { actions } = this.props\n actions.setData('formData', data)\n this.form.setValues(data)\n needSearch && this.onSearch()\n }\n\n resetFormData = (needSearch) => {\n const { initialValues, actions } = this.props\n\n actions.setFormData(initialValues, needSearch)\n this.form.resetValues()\n }\n\n componentWillUnmount() {\n const { actions } = this.props\n\n actions.removeListener('setFormData', this.setFormData)\n actions.removeListener('resetFormData', this.resetFormData)\n }\n}\n\nQueryForm.Field = Form.Field\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMpE,MAAM,WAAW,WAAY,SAAQ,eAAe;IAElD,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EA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MAAM,CAAA;QACd,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,UAAU,eACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACtF,QAAQ,EAAE,OAAO,UAAU,CAAC,QAAQ,CAAA;IACpC,MAAM,EAAE,OAAO,UAAU,CAAC,MAAM,CAAA;CACjC;AAMD,eAAO,MAAM,cAAc,iBA2CP,CAAA;AAEpB,eAAO,MAAM,MAAM,iBAGC,CAAA"}
|
package/lib/select/select.js
CHANGED
|
@@ -35,10 +35,12 @@ var InternalSelect = exports.InternalSelect = (0, _react.forwardRef)(function (_
|
|
|
35
35
|
options = _a.options,
|
|
36
36
|
fieldNames = _a.fieldNames,
|
|
37
37
|
children = _a.children,
|
|
38
|
-
|
|
38
|
+
placeholder = _a.placeholder,
|
|
39
|
+
capitalize = _a.capitalize,
|
|
40
|
+
props = __rest(_a, ["className", "borderStyle", "options", "fieldNames", "children", "placeholder", "capitalize"]);
|
|
39
41
|
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
|
|
40
42
|
return _react["default"].createElement(_select["default"], Object.assign({}, props, {
|
|
41
|
-
placeholder: (0, _utils.capitalizeFirstLetter)(
|
|
43
|
+
placeholder: (0, _utils.capitalizeFirstLetter)(placeholder, capitalize),
|
|
42
44
|
className: (0, _classnames["default"])(className, tntPrefixCls, _defineProperty(_defineProperty({}, "".concat(tntPrefixCls, "-outline"), borderStyle === 'outline'), "".concat(tntPrefixCls, "-fill"), borderStyle === 'fill')),
|
|
43
45
|
ref: ref
|
|
44
46
|
}), children ? children : options === null || options === void 0 ? void 0 : options.map(function (option) {
|
package/lib/select/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;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Q;YACV,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;gBACtB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;oBAC9B,OAAO,CACL,8BAAC,MAAM,IACL,GAAG,EAAE,IAAA,YAAG,EAAC,MAAM,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAC,EAC9C,KAAK,EAAE,IAAA,YAAG,EAAC,MAAM,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAC,EAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,IAE1B,IAAA,YAAG,EAAC,MAAM,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,OAAO,CAAC,CACnC,CACV,CAAA;iBACF;gBAED,OAAO,CACL,8BAAC,MAAM,IAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAC/B,MAAM,CACA,CACV,CAAA;YACH,CAAC,CAAC,CACK,CACd,CAAA;IACH,CAAC,CACc,CAClB,CAAA;CAAA,CACiB,CAAA;AAEP,QAAA,MAAM,GAAG,IAAA,kCAAwB,EAC5C,sBAAc,EACd,sBAAW,CAAC,MAAM,CACA,CAAA;AAEpB,cAAM,CAAC,QAAQ,GAAG,gBAAU,CAAC,QAAQ,CAAA;AACrC,cAAM,CAAC,MAAM,GAAG,gBAAU,CAAC,MAAM,CAAA","sourcesContent":["import React, { ReactNode, forwardRef } from 'react'\nimport { default as AntdSelect } from 'antd/lib/select'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport type { SelectProps as AntdSelectProps } from 'antd/lib/select'\nimport classNames from 'classnames'\nimport { get } from 'lodash'\nimport { connectReadonlyComponent } from '../connect'\nimport PreviewText from '../preview-text'\nimport { capitalizeFirstLetter } from '../utils'\nexport interface SelectProps extends AntdSelectProps {\n // 线框风格\n borderStyle?: 'outline' | 'fill'\n children?: ReactNode\n options?: Array<\n | string\n | number\n | {\n label: string\n value: string | number\n disabled?: boolean\n }\n >\n fieldNames?: {\n label?: string\n value?: string\n options?: string\n }\n readonly?: boolean\n}\n\ninterface SelectComponent\n extends React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<AntdSelect>> {\n OptGroup: typeof AntdSelect.OptGroup\n Option: typeof AntdSelect.Option\n}\n\nconst { Option } = AntdSelect\n\nconst tntPrefixCls = 'tnt-select'\n\nexport const InternalSelect = forwardRef<AntdSelect, SelectProps & { capitalize?: boolean }>(\n (\n { className, borderStyle, options, fieldNames, children, placeholder, capitalize, ...props },\n ref\n ) => (\n <ConfigConsumer>\n {() => {\n return (\n <AntdSelect\n {...props}\n placeholder={capitalizeFirstLetter(placeholder, capitalize)}\n className={classNames(className, tntPrefixCls, {\n [`${tntPrefixCls}-outline`]: borderStyle === 'outline',\n [`${tntPrefixCls}-fill`]: borderStyle === 'fill',\n })}\n ref={ref}\n >\n {children\n ? children\n : options?.map((option) => {\n if (typeof option === 'object') {\n return (\n <Option\n key={get(option, fieldNames?.value || 'value')}\n value={get(option, fieldNames?.value || 'value')}\n disabled={!!option.disabled}\n >\n {get(option, fieldNames?.label || 'label')}\n </Option>\n )\n }\n\n return (\n <Option key={option} value={option}>\n {option}\n </Option>\n )\n })}\n </AntdSelect>\n )\n }}\n </ConfigConsumer>\n )\n) as SelectComponent\n\nexport const Select = connectReadonlyComponent(\n InternalSelect,\n PreviewText.Select\n) as SelectComponent\n\nSelect.OptGroup = AntdSelect.OptGroup\nSelect.Option = AntdSelect.Option\n"]}
|
package/lib/select/select.less
CHANGED
|
@@ -59,9 +59,6 @@
|
|
|
59
59
|
// 未选择值的时候的样式
|
|
60
60
|
.@{select-prefix-cls}-selection {
|
|
61
61
|
&__clear {
|
|
62
|
-
width: 16px;
|
|
63
|
-
height: 16px;
|
|
64
|
-
margin-top: -8px;
|
|
65
62
|
color: @bg-color-spotilight-tint-50;
|
|
66
63
|
}
|
|
67
64
|
&:not(:has(.ant-select-selection-selected-value, .ant-select-selection__choice)) {
|
|
@@ -82,6 +79,7 @@
|
|
|
82
79
|
border-color: @bg-grey-default;
|
|
83
80
|
.tntd-anticon {
|
|
84
81
|
font-size: 12px;
|
|
82
|
+
vertical-align: middle;
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
}
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
.selection__clear() {
|
|
8
8
|
position: absolute;
|
|
9
9
|
top: 50%;
|
|
10
|
-
right: calc(@control-padding-horizontal -
|
|
10
|
+
right: calc(@control-padding-horizontal - 4px);
|
|
11
11
|
z-index: 1;
|
|
12
12
|
display: inline-block;
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
15
|
-
margin-top: -
|
|
13
|
+
width: 16px;
|
|
14
|
+
height: 16px;
|
|
15
|
+
margin-top: -8px;
|
|
16
16
|
color: @disabled-color;
|
|
17
17
|
font-size: @font-size-sm;
|
|
18
18
|
font-style: normal;
|
|
19
|
-
line-height:
|
|
19
|
+
line-height: 16px;
|
|
20
20
|
text-align: center;
|
|
21
21
|
text-transform: none;
|
|
22
22
|
background: @component-background;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
position: absolute;
|
|
59
59
|
top: 50%;
|
|
60
|
-
right: calc(@control-padding-horizontal -
|
|
60
|
+
right: calc(@control-padding-horizontal - 4px);
|
|
61
61
|
// margin-top: calc(-@font-size-sm / 2);
|
|
62
62
|
margin-top: -8px;
|
|
63
63
|
color: @disabled-color;
|
|
@@ -476,6 +476,7 @@
|
|
|
476
476
|
overflow: auto;
|
|
477
477
|
list-style: none;
|
|
478
478
|
outline: none;
|
|
479
|
+
border-radius: @border-radius-base;
|
|
479
480
|
|
|
480
481
|
&-item-group-list {
|
|
481
482
|
margin: 0;
|
package/lib/spin/index.d.ts
CHANGED
package/lib/spin/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spin/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spin/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAChB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,aAAa,CAAA;AAEpB,cAAc,QAAQ,CAAA;AAEtB,eAAe,IAAI,CAAA"}
|
package/lib/spin/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
var _exportNames = {};
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
8
|
+
require("./style");
|
|
9
|
+
var _spin = require("./spin");
|
|
10
10
|
Object.keys(_spin).forEach(function (key) {
|
|
11
11
|
if (key === "default" || key === "__esModule") return;
|
|
12
12
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -18,7 +18,5 @@ Object.keys(_spin).forEach(function (key) {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
require("./
|
|
22
|
-
|
|
23
|
-
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; }
|
|
24
|
-
var _default = exports["default"] = _spin["default"];
|
|
21
|
+
require("./spin.less");
|
|
22
|
+
var _default = exports["default"] = _spin.Spin;
|
package/lib/spin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mBAAgB;AAChB,iCAA6B;AAC7B,uBAAoB;AAEpB,yCAAsB;AAEtB,kBAAe,WAAI,CAAA","sourcesContent":["import './style'\nimport { Spin } from './spin'\nimport './spin.less'\n\nexport * from './spin'\n\nexport default Spin\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SpinProps as AntdSpinProps } from 'antd/lib/spin';
|
|
3
|
+
import { default as AntdSpin } from 'antd/lib/spin';
|
|
4
|
+
import './spin.less';
|
|
5
|
+
interface SpinComponent extends React.ForwardRefExoticComponent<AntdSpinProps & React.RefAttributes<AntdSpin>> {
|
|
6
|
+
}
|
|
7
|
+
export declare const Spin: SpinComponent;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=spin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spin.d.ts","sourceRoot":"","sources":["../../src/spin/spin.tsx"],"names":[],"mappings":"AASA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,aAAa,CAAA;AAEpB,UAAU,aACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;CAAG;AAE3F,eAAO,MAAM,IAAI,eAgBE,CAAA"}
|
package/lib/spin/spin.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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.Spin = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _configProvider = require("antd/lib/config-provider");
|
|
10
|
+
var _spin = _interopRequireDefault(require("antd/lib/spin"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
require("./spin.less");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
/*
|
|
17
|
+
* @Author: 周泽飞 zefei.zhou@tongdun.net
|
|
18
|
+
* @Date: 2024-07-19 18:49:24
|
|
19
|
+
* @LastEditors: 周泽飞 zefei.zhou@tongdun.net
|
|
20
|
+
* @LastEditTime: 2024-07-19 18:54:42
|
|
21
|
+
* @FilePath: /tntd/packages/tntd/src/spin/spin.tsx
|
|
22
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
23
|
+
*/
|
|
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 Spin = exports.Spin = (0, _react.forwardRef)(function (props, ref) {
|
|
33
|
+
var className = props.className,
|
|
34
|
+
wrapperClassName = props.wrapperClassName,
|
|
35
|
+
restProps = __rest(props, ["className", "wrapperClassName"]);
|
|
36
|
+
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
|
|
37
|
+
return _react["default"].createElement(_spin["default"], Object.assign({
|
|
38
|
+
wrapperClassName: (0, _classnames["default"])('tnt-spin-nested', className || ''),
|
|
39
|
+
className: (0, _classnames["default"])('tnt-spin', className || '')
|
|
40
|
+
}, restProps, {
|
|
41
|
+
ref: ref
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spin.js","sourceRoot":"","sources":["../../src/spin/spin.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAyC;AAEzC,6DAAwD;AACxD,wDAAkD;AAClD,4DAAmC;AAEnC,uBAAoB;AAKP,QAAA,IAAI,GAAG,IAAA,kBAAU,EAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrE,MAAM,EAAE,SAAS,EAAE,gBAAgB,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAArD,iCAA6C,CAAQ,CAAA;IAC3D,OAAO,CACL,8BAAC,gCAAc,QACZ,GAAG,EAAE;QACJ,OAAO,CACL,8BAAC,cAAQ,kBACP,gBAAgB,EAAE,IAAA,oBAAU,EAAC,iBAAiB,EAAE,SAAS,IAAI,EAAE,CAAC,EAChE,SAAS,EAAE,IAAA,oBAAU,EAAC,UAAU,EAAE,SAAS,IAAI,EAAE,CAAC,IAC9C,SAAS,IACb,GAAG,EAAE,GAAG,IACR,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAkB,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-07-19 18:49:24\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-07-19 18:54:42\n * @FilePath: /tntd/packages/tntd/src/spin/spin.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\n\nimport React, { forwardRef } from 'react'\nimport type { SpinProps as AntdSpinProps } from 'antd/lib/spin'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport { default as AntdSpin } from 'antd/lib/spin'\nimport classNames from 'classnames'\n\nimport './spin.less'\n\ninterface SpinComponent\n extends React.ForwardRefExoticComponent<AntdSpinProps & React.RefAttributes<AntdSpin>> {}\n\nexport const Spin = forwardRef<AntdSpin, AntdSpinProps>((props, ref) => {\n const { className, wrapperClassName, ...restProps } = props\n return (\n <ConfigConsumer>\n {() => {\n return (\n <AntdSpin\n wrapperClassName={classNames('tnt-spin-nested', className || '')}\n className={classNames('tnt-spin', className || '')}\n {...restProps}\n ref={ref}\n />\n )\n }}\n </ConfigConsumer>\n )\n}) as SpinComponent\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@table-prefix-cls: ~'@{ant-prefix}-table';
|
|
2
|
+
|
|
3
|
+
// .@{table-prefix-cls} {
|
|
4
|
+
.tnt-table-wrapper {
|
|
5
|
+
// customize the fixed of table
|
|
6
|
+
&.@{table-prefix-cls}-sticky {
|
|
7
|
+
.@{table-prefix-cls}-scroll,
|
|
8
|
+
.@{table-prefix-cls}-default {
|
|
9
|
+
.@{table-prefix-cls}-body table {
|
|
10
|
+
table-layout: fixed;
|
|
11
|
+
|
|
12
|
+
tr.@{table-prefix-cls}-expanded-row.@{table-prefix-cls}-expanded-row-level-1 {
|
|
13
|
+
position: relative;
|
|
14
|
+
z-index: 10;
|
|
15
|
+
|
|
16
|
+
> td:not([colspan]) {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 兼容低版本浏览器
|
|
21
|
+
> td[colspan] {
|
|
22
|
+
position: relative;
|
|
23
|
+
z-index: 100;
|
|
24
|
+
padding: 0;
|
|
25
|
+
|
|
26
|
+
> .@{table-prefix-cls}-expanded-row-fixed {
|
|
27
|
+
position: sticky;
|
|
28
|
+
left: 0px;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
padding: 0px 16px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.@{table-prefix-cls}-fixed-left table, .@{table-prefix-cls}-fixed-right table {
|
|
38
|
+
width: fit-content;
|
|
39
|
+
|
|
40
|
+
tr.@{table-prefix-cls}-expanded-row.@{table-prefix-cls}-expanded-row-level-1 {
|
|
41
|
+
> td {
|
|
42
|
+
position: relative;
|
|
43
|
+
z-index: -1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA"}
|
package/lib/table/hooks/index.js
CHANGED
|
@@ -13,4 +13,15 @@ Object.keys(_useColumnSetting).forEach(function (key) {
|
|
|
13
13
|
return _useColumnSetting[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _useExpandFixed = require("./use-expand-fixed");
|
|
18
|
+
Object.keys(_useExpandFixed).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _useExpandFixed[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _useExpandFixed[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
16
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC","sourcesContent":["export * from './use-column-setting'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,qDAAkC","sourcesContent":["export * from './use-column-setting'\nexport * from './use-expand-fixed'\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare type keyType = string | number | null;
|
|
2
|
+
export declare const useExpandFixed: () => readonly [keyType, (key: string) => void];
|
|
3
|
+
export declare const findRowKey: (record: any, rowKey: string | ((record: any, index: number) => string)) => string | number;
|
|
4
|
+
//# sourceMappingURL=use-expand-fixed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-expand-fixed.d.ts","sourceRoot":"","sources":["../../../src/table/hooks/use-expand-fixed.ts"],"names":[],"mappings":"AAGA,oBAAY,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;AAQ5C,eAAO,MAAM,cAAc,iCA+FqB,MAAM,KAAK,IAAI,CAC9D,CAAA;AAED,eAAO,MAAM,UAAU,WACb,GAAG,6BACgB,GAAG,SAAS,MAAM,KAAK,MAAM,qBAUzD,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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.useExpandFixed = exports.findRowKey = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _utils = require("../utils");
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
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."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
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; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
|
+
var useExpandFixed = exports.useExpandFixed = function useExpandFixed() {
|
|
20
|
+
var curTableKey = (0, _react.useRef)((0, _utils.makeRandomCode)());
|
|
21
|
+
var activeKeyRef = (0, _react.useRef)(null);
|
|
22
|
+
var oldActiveKeyRef = (0, _react.useRef)({
|
|
23
|
+
main: null,
|
|
24
|
+
right: null,
|
|
25
|
+
left: null
|
|
26
|
+
});
|
|
27
|
+
var container = (0, _react.useRef)(null);
|
|
28
|
+
var observer = (0, _react.useRef)(null);
|
|
29
|
+
var getDom = function getDom(key) {
|
|
30
|
+
var main = document.querySelector(".".concat(curTableKey.current, " .ant-table-scroll [data-row-key=\"").concat(key, "-extra-row\"]")) || document.querySelector(".".concat(curTableKey.current, " .ant-table-default [data-row-key=\"").concat(key, "-extra-row\"]"));
|
|
31
|
+
var right = document.querySelector(".".concat(curTableKey.current, " .ant-table-fixed-right [data-row-key=\"").concat(key, "-extra-row\"]"));
|
|
32
|
+
var left = document.querySelector(".".concat(curTableKey.current, " .ant-table-fixed-left [data-row-key=\"").concat(key, "-extra-row\"]"));
|
|
33
|
+
return [main, right, left];
|
|
34
|
+
};
|
|
35
|
+
var expand = /*#__PURE__*/function () {
|
|
36
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
|
+
var _getDom, _getDom2, main, right, left, border, height, td, colspan, Oldcolspan, newColspan;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_getDom = getDom(String(activeKeyRef.current) || ''), _getDom2 = _slicedToArray(_getDom, 3), main = _getDom2[0], right = _getDom2[1], left = _getDom2[2];
|
|
42
|
+
border = 2;
|
|
43
|
+
height = (main === null || main === void 0 ? void 0 : main.offsetHeight) - border || 0;
|
|
44
|
+
if (right) {
|
|
45
|
+
right.setAttribute('style', "display: inline-block; height: ".concat(height, "px; overflow: hidden;"));
|
|
46
|
+
}
|
|
47
|
+
if (left) {
|
|
48
|
+
left.setAttribute('style', "display: inline-block; height: ".concat(height, "px; overflow: hidden;"));
|
|
49
|
+
}
|
|
50
|
+
if (main) {
|
|
51
|
+
// 解决 expandIconAsCell为true 且 iconCell的td元素为display: none;时, 展开内容滚动到最右边,会多出一部分iconCell所占据的空间 的问题
|
|
52
|
+
td = main.childNodes[1];
|
|
53
|
+
colspan = td.getAttribute('colspan') || 0;
|
|
54
|
+
Oldcolspan = td.getAttribute('oldcolspan') || 0;
|
|
55
|
+
newColspan = Oldcolspan ? Oldcolspan : Number(colspan) + 1 + '';
|
|
56
|
+
if (!Oldcolspan) td.setAttribute('oldcolspan', newColspan);
|
|
57
|
+
td.setAttribute('colspan', newColspan);
|
|
58
|
+
//
|
|
59
|
+
}
|
|
60
|
+
oldActiveKeyRef.current = {
|
|
61
|
+
main: main,
|
|
62
|
+
right: right,
|
|
63
|
+
left: left
|
|
64
|
+
};
|
|
65
|
+
case 7:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}, _callee);
|
|
70
|
+
}));
|
|
71
|
+
return function expand() {
|
|
72
|
+
return _ref.apply(this, arguments);
|
|
73
|
+
};
|
|
74
|
+
}();
|
|
75
|
+
var ob = function ob() {
|
|
76
|
+
var classname = curTableKey.current;
|
|
77
|
+
if (!classname) return;
|
|
78
|
+
container.current = document.querySelector(".".concat(classname, ".ant-table-wrapper.collapse-panel > .ant-spin-nested-loading > .ant-spin-container > .ant-table"));
|
|
79
|
+
observer.current = new MutationObserver(expand);
|
|
80
|
+
if (container.current) {
|
|
81
|
+
observer.current.observe(container.current, {
|
|
82
|
+
childList: true,
|
|
83
|
+
attributes: true
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var setChangedKey = function setChangedKey(key) {
|
|
88
|
+
activeKeyRef.current = key;
|
|
89
|
+
};
|
|
90
|
+
var trigger = function trigger(key) {
|
|
91
|
+
setChangedKey(key);
|
|
92
|
+
var className = curTableKey.current;
|
|
93
|
+
if (!className) return;
|
|
94
|
+
var dom = document === null || document === void 0 ? void 0 : document.querySelector(".".concat(className, ".ant-table-wrapper.collapse-panel > .ant-spin-nested-loading > .ant-spin-container > .ant-table"));
|
|
95
|
+
dom === null || dom === void 0 ? void 0 : dom.setAttribute('c-data', 'Mutation');
|
|
96
|
+
};
|
|
97
|
+
(0, _react.useEffect)(function () {
|
|
98
|
+
ob();
|
|
99
|
+
}, [curTableKey.current]);
|
|
100
|
+
return [curTableKey.current, trigger];
|
|
101
|
+
};
|
|
102
|
+
var findRowKey = exports.findRowKey = function findRowKey(record, rowKey) {
|
|
103
|
+
var res = '';
|
|
104
|
+
if (typeof rowKey === 'function') {
|
|
105
|
+
res = [record].map(rowKey)[0];
|
|
106
|
+
} else if (typeof rowKey === 'string') {
|
|
107
|
+
res = record[rowKey];
|
|
108
|
+
}
|
|
109
|
+
return res;
|
|
110
|
+
};
|