@tendaui/react 1.1.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/LICENSE +21 -0
- package/README.md +2 -0
- package/es/_chunks/dep-0QH2Ee4R.js +34 -0
- package/es/_chunks/dep-0QH2Ee4R.js.map +1 -0
- package/es/_chunks/dep-B7HmDtze.js +199 -0
- package/es/_chunks/dep-B7HmDtze.js.map +1 -0
- package/es/_chunks/dep-BH5n5r1M.js +55 -0
- package/es/_chunks/dep-BH5n5r1M.js.map +1 -0
- package/es/_chunks/dep-BP0-apUT.js +9 -0
- package/es/_chunks/dep-BP0-apUT.js.map +1 -0
- package/es/_chunks/dep-C1XcmShP.js +18 -0
- package/es/_chunks/dep-C1XcmShP.js.map +1 -0
- package/es/_chunks/dep-C36au4Ip.js +104 -0
- package/es/_chunks/dep-C36au4Ip.js.map +1 -0
- package/es/_chunks/dep-CgyDw_YI.js +20 -0
- package/es/_chunks/dep-CgyDw_YI.js.map +1 -0
- package/es/_chunks/dep-CoIiHOgo.js +162 -0
- package/es/_chunks/dep-CoIiHOgo.js.map +1 -0
- package/es/_chunks/dep-Cwish4GD.js +29 -0
- package/es/_chunks/dep-Cwish4GD.js.map +1 -0
- package/es/_chunks/dep-CzLhKWCf.js +56 -0
- package/es/_chunks/dep-CzLhKWCf.js.map +1 -0
- package/es/_chunks/dep-D-UKOauR.js +12 -0
- package/es/_chunks/dep-D-UKOauR.js.map +1 -0
- package/es/_chunks/dep-D6YxJv-F.js +31 -0
- package/es/_chunks/dep-D6YxJv-F.js.map +1 -0
- package/es/_chunks/dep-D7LanWes.js +171 -0
- package/es/_chunks/dep-D7LanWes.js.map +1 -0
- package/es/_chunks/dep-D8jki30S.js +31 -0
- package/es/_chunks/dep-D8jki30S.js.map +1 -0
- package/es/_chunks/dep-DB5wmwh1.js +48 -0
- package/es/_chunks/dep-DB5wmwh1.js.map +1 -0
- package/es/_chunks/dep-DGvfel3I.js +16 -0
- package/es/_chunks/dep-DGvfel3I.js.map +1 -0
- package/es/_chunks/dep-DHWwZ2Nj.js +139 -0
- package/es/_chunks/dep-DHWwZ2Nj.js.map +1 -0
- package/es/_chunks/dep-DN7d1SzH.js +24 -0
- package/es/_chunks/dep-DN7d1SzH.js.map +1 -0
- package/es/_chunks/dep-DZ_0EvBk.js +440 -0
- package/es/_chunks/dep-DZ_0EvBk.js.map +1 -0
- package/es/_chunks/dep-Dk2xX8lh.js +691 -0
- package/es/_chunks/dep-Dk2xX8lh.js.map +1 -0
- package/es/_chunks/dep-DwWrhxkd.js +26 -0
- package/es/_chunks/dep-DwWrhxkd.js.map +1 -0
- package/es/_chunks/dep-EcrDKDlu.js +1677 -0
- package/es/_chunks/dep-EcrDKDlu.js.map +1 -0
- package/es/_chunks/dep-PPA-yoAy.js +16 -0
- package/es/_chunks/dep-PPA-yoAy.js.map +1 -0
- package/es/_chunks/dep-U1T8CQY9.js +4 -0
- package/es/_chunks/dep-U1T8CQY9.js.map +1 -0
- package/es/_chunks/dep-bWaVq_y3.js +14 -0
- package/es/_chunks/dep-bWaVq_y3.js.map +1 -0
- package/es/_chunks/dep-u1x3x6MJ.js +9 -0
- package/es/_chunks/dep-u1x3x6MJ.js.map +1 -0
- package/es/alert/Alert.js +153 -0
- package/es/alert/Alert.js.map +1 -0
- package/es/alert/index.js +23 -0
- package/es/alert/index.js.map +1 -0
- package/es/alert/style/css.js +1 -0
- package/es/alert/style/index.css +172 -0
- package/es/alert/style/index.js +2 -0
- package/es/alert/style/index.js.map +1 -0
- package/es/badge/Badge.js +81 -0
- package/es/badge/Badge.js.map +1 -0
- package/es/badge/index.js +15 -0
- package/es/badge/index.js.map +1 -0
- package/es/badge/style/css.js +1 -0
- package/es/badge/style/index.css +60 -0
- package/es/badge/style/index.js +2 -0
- package/es/badge/style/index.js.map +1 -0
- package/es/button/Button.js +94 -0
- package/es/button/Button.js.map +1 -0
- package/es/button/index.js +28 -0
- package/es/button/index.js.map +1 -0
- package/es/button/style/css.js +1 -0
- package/es/button/style/index.css +1206 -0
- package/es/button/style/index.js +2 -0
- package/es/button/style/index.js.map +1 -0
- package/es/checkbox/Checkbox.js +17 -0
- package/es/checkbox/Checkbox.js.map +1 -0
- package/es/checkbox/CheckboxGroup.js +17 -0
- package/es/checkbox/CheckboxGroup.js.map +1 -0
- package/es/checkbox/index.js +22 -0
- package/es/checkbox/index.js.map +1 -0
- package/es/checkbox/style/css.js +1 -0
- package/es/checkbox/style/index.css +151 -0
- package/es/checkbox/style/index.js +2 -0
- package/es/checkbox/style/index.js.map +1 -0
- package/es/common/Check.js +101 -0
- package/es/common/Check.js.map +1 -0
- package/es/common/FakeArrow.js +28 -0
- package/es/common/FakeArrow.js.map +1 -0
- package/es/common/PluginContainer.js +19 -0
- package/es/common/PluginContainer.js.map +1 -0
- package/es/common/Portal.js +53 -0
- package/es/common/Portal.js.map +1 -0
- package/es/config-provider/ConfigContext.js +17 -0
- package/es/config-provider/ConfigContext.js.map +1 -0
- package/es/config-provider/ConfigProvider.js +45 -0
- package/es/config-provider/ConfigProvider.js.map +1 -0
- package/es/config-provider/index.js +12 -0
- package/es/config-provider/index.js.map +1 -0
- package/es/dialog/Dialog.js +575 -0
- package/es/dialog/Dialog.js.map +1 -0
- package/es/dialog/DialogCard.js +28 -0
- package/es/dialog/DialogCard.js.map +1 -0
- package/es/dialog/index.js +44 -0
- package/es/dialog/index.js.map +1 -0
- package/es/dialog/plugin.js +199 -0
- package/es/dialog/plugin.js.map +1 -0
- package/es/dialog/style/css.js +1 -0
- package/es/dialog/style/index.css +510 -0
- package/es/dialog/style/index.js +2 -0
- package/es/dialog/style/index.js.map +1 -0
- package/es/form/Form.js +190 -0
- package/es/form/Form.js.map +1 -0
- package/es/form/FormContext.js +38 -0
- package/es/form/FormContext.js.map +1 -0
- package/es/form/FormItem.js +39 -0
- package/es/form/FormItem.js.map +1 -0
- package/es/form/FormList.js +306 -0
- package/es/form/FormList.js.map +1 -0
- package/es/form/hooks/useFormItemStyle.js +10 -0
- package/es/form/hooks/useFormItemStyle.js.map +1 -0
- package/es/form/hooks/useInstance.js +326 -0
- package/es/form/hooks/useInstance.js.map +1 -0
- package/es/form/index.js +47 -0
- package/es/form/index.js.map +1 -0
- package/es/form/style/css.js +1 -0
- package/es/form/style/index.css +296 -0
- package/es/form/style/index.js +2 -0
- package/es/form/style/index.js.map +1 -0
- package/es/form/utils/index.js +75 -0
- package/es/form/utils/index.js.map +1 -0
- package/es/hooks/useDragSorter.js +137 -0
- package/es/hooks/useDragSorter.js.map +1 -0
- package/es/index.js +103 -0
- package/es/index.js.map +1 -0
- package/es/input/Input.js +375 -0
- package/es/input/Input.js.map +1 -0
- package/es/input/InputGroup.js +23 -0
- package/es/input/InputGroup.js.map +1 -0
- package/es/input/index.js +23 -0
- package/es/input/index.js.map +1 -0
- package/es/input/style/css.js +1 -0
- package/es/input/style/index.css +450 -0
- package/es/input/style/index.js +2 -0
- package/es/input/style/index.js.map +1 -0
- package/es/loading/Gradient.js +86 -0
- package/es/loading/Gradient.js.map +1 -0
- package/es/loading/Loading.js +147 -0
- package/es/loading/Loading.js.map +1 -0
- package/es/loading/index.js +24 -0
- package/es/loading/index.js.map +1 -0
- package/es/loading/style/css.js +1 -0
- package/es/loading/style/index.css +191 -0
- package/es/loading/style/index.js +2 -0
- package/es/loading/style/index.js.map +1 -0
- package/es/myform/index.js +2 -0
- package/es/myform/index.js.map +1 -0
- package/es/notification/NotifyContainer.js +78 -0
- package/es/notification/NotifyContainer.js.map +1 -0
- package/es/notification/NotifyContext.js +149 -0
- package/es/notification/NotifyContext.js.map +1 -0
- package/es/notification/NotifyItem.js +150 -0
- package/es/notification/NotifyItem.js.map +1 -0
- package/es/notification/index.js +32 -0
- package/es/notification/index.js.map +1 -0
- package/es/notification/style/css.js +1 -0
- package/es/notification/style/index.css +142 -0
- package/es/notification/style/index.js +2 -0
- package/es/notification/style/index.js.map +1 -0
- package/es/popup/Popup.js +790 -0
- package/es/popup/Popup.js.map +1 -0
- package/es/popup/index.js +28 -0
- package/es/popup/index.js.map +1 -0
- package/es/popup/style/css.js +1 -0
- package/es/popup/style/index.css +186 -0
- package/es/popup/style/index.js +2 -0
- package/es/popup/style/index.js.map +1 -0
- package/es/portal/Portal.js +48 -0
- package/es/portal/Portal.js.map +1 -0
- package/es/portal/index.js +7 -0
- package/es/portal/index.js.map +1 -0
- package/es/select/Option.js +118 -0
- package/es/select/Option.js.map +1 -0
- package/es/select/OptionGroup.js +9 -0
- package/es/select/OptionGroup.js.map +1 -0
- package/es/select/PopupContent.js +16 -0
- package/es/select/PopupContent.js.map +1 -0
- package/es/select/Select.js +709 -0
- package/es/select/Select.js.map +1 -0
- package/es/select/index.js +66 -0
- package/es/select/index.js.map +1 -0
- package/es/select/style/css.js +1 -0
- package/es/select/style/index.css +437 -0
- package/es/select/style/index.js +2 -0
- package/es/select/style/index.js.map +1 -0
- package/es/select-input/SelectInput.js +202 -0
- package/es/select-input/SelectInput.js.map +1 -0
- package/es/select-input/hook/useMultiple.js +118 -0
- package/es/select-input/hook/useMultiple.js.map +1 -0
- package/es/select-input/hook/useSingle.js +105 -0
- package/es/select-input/hook/useSingle.js.map +1 -0
- package/es/select-input/index.js +51 -0
- package/es/select-input/index.js.map +1 -0
- package/es/select-input/style/css.js +1 -0
- package/es/select-input/style/index.css +0 -0
- package/es/select-input/style/index.js +2 -0
- package/es/select-input/style/index.js.map +1 -0
- package/es/space/index.js +2 -0
- package/es/space/index.js.map +1 -0
- package/es/style/index.css +490 -0
- package/es/style/index.js +2 -0
- package/es/style/index.js.map +1 -0
- package/es/switch/Switch.js +174 -0
- package/es/switch/Switch.js.map +1 -0
- package/es/switch/index.js +28 -0
- package/es/switch/index.js.map +1 -0
- package/es/switch/style/css.js +1 -0
- package/es/switch/style/index.css +239 -0
- package/es/switch/style/index.js +2 -0
- package/es/switch/style/index.js.map +1 -0
- package/es/tag/Tag.js +1312 -0
- package/es/tag/Tag.js.map +1 -0
- package/es/tag/index.js +21 -0
- package/es/tag/index.js.map +1 -0
- package/es/tag/style/css.js +1 -0
- package/es/tag/style/index.css +236 -0
- package/es/tag/style/index.js +2 -0
- package/es/tag/style/index.js.map +1 -0
- package/es/tag-input/TagInput.js +360 -0
- package/es/tag-input/TagInput.js.map +1 -0
- package/es/tag-input/hooks/useTagList.js +167 -0
- package/es/tag-input/hooks/useTagList.js.map +1 -0
- package/es/tag-input/index.js +35 -0
- package/es/tag-input/index.js.map +1 -0
- package/es/tag-input/style/css.js +1 -0
- package/es/tag-input/style/index.css +223 -0
- package/es/tag-input/style/index.js +2 -0
- package/es/tag-input/style/index.js.map +1 -0
- package/es/tag-input/useTagList.js +167 -0
- package/es/tag-input/useTagList.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
.t-form {
|
|
2
|
+
font: var(--td-font-body-medium);
|
|
3
|
+
color: var(--td-text-color-primary);
|
|
4
|
+
-webkit-box-sizing: border-box;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
list-style: none;
|
|
9
|
+
font: var(--td-font-body-medium);
|
|
10
|
+
}
|
|
11
|
+
.t-form:not(.t-form-inline) .t-form__item:last-of-type {
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
.t-form__item {
|
|
15
|
+
margin-bottom: var(--td-comp-margin-xxl);
|
|
16
|
+
}
|
|
17
|
+
.t-form__item.t-form__item-with-help {
|
|
18
|
+
margin-bottom: var(--td-comp-margin-xs);
|
|
19
|
+
}
|
|
20
|
+
.t-form__item.t-form__item-with-extra {
|
|
21
|
+
margin-bottom: var(--td-comp-margin-xxl);
|
|
22
|
+
}
|
|
23
|
+
.t-form__label {
|
|
24
|
+
float: left;
|
|
25
|
+
padding-right: var(--td-comp-paddingLR-xl);
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
line-height: var(--td-comp-margin-xxxl);
|
|
28
|
+
color: var(--td-text-color-primary);
|
|
29
|
+
-webkit-box-sizing: border-box;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
}
|
|
33
|
+
.t-form__label--top {
|
|
34
|
+
float: none;
|
|
35
|
+
min-height: var(--td-comp-margin-xxxl);
|
|
36
|
+
}
|
|
37
|
+
.t-form__label--left {
|
|
38
|
+
text-align: left;
|
|
39
|
+
}
|
|
40
|
+
.t-form__label--right {
|
|
41
|
+
text-align: right;
|
|
42
|
+
}
|
|
43
|
+
.t-form__label--required:not(.t-form__label--required-right) label::before {
|
|
44
|
+
display: inline-block;
|
|
45
|
+
margin-right: var(--td-comp-margin-xs);
|
|
46
|
+
color: var(--td-error-color);
|
|
47
|
+
line-height: var(--td-line-height-body-medium);
|
|
48
|
+
content: "*";
|
|
49
|
+
}
|
|
50
|
+
.t-form__label--required-right label::after {
|
|
51
|
+
display: inline-block;
|
|
52
|
+
margin-left: var(--td-comp-margin-xs);
|
|
53
|
+
color: var(--td-error-color);
|
|
54
|
+
line-height: var(--td-line-height-body-medium);
|
|
55
|
+
content: "*";
|
|
56
|
+
}
|
|
57
|
+
.t-form__label--colon label::after {
|
|
58
|
+
content: ":";
|
|
59
|
+
position: relative;
|
|
60
|
+
margin: 0 var(--td-comp-margin-xxs);
|
|
61
|
+
}
|
|
62
|
+
.t-form__controls {
|
|
63
|
+
min-height: var(--td-comp-margin-xxxl);
|
|
64
|
+
display: flow-root;
|
|
65
|
+
position: relative;
|
|
66
|
+
}
|
|
67
|
+
.t-form__controls-content {
|
|
68
|
+
display: -webkit-box;
|
|
69
|
+
display: -ms-flexbox;
|
|
70
|
+
display: flex;
|
|
71
|
+
-webkit-box-align: center;
|
|
72
|
+
-ms-flex-align: center;
|
|
73
|
+
align-items: center;
|
|
74
|
+
min-height: var(--td-comp-margin-xxxl);
|
|
75
|
+
}
|
|
76
|
+
.t-form__controls .t-form__item {
|
|
77
|
+
margin-bottom: 0;
|
|
78
|
+
margin-right: var(--td-comp-margin-xxl);
|
|
79
|
+
}
|
|
80
|
+
.t-form__controls.t-is-success .t-form__status .t-icon {
|
|
81
|
+
color: var(--td-success-color);
|
|
82
|
+
}
|
|
83
|
+
.t-form__controls.t-is-success .t-input__extra {
|
|
84
|
+
color: var(--td-success-color);
|
|
85
|
+
}
|
|
86
|
+
.t-form__controls.t-form--success-border .t-is-success .t-input__extra {
|
|
87
|
+
color: var(--td-success-color);
|
|
88
|
+
}
|
|
89
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-input,
|
|
90
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-select,
|
|
91
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-radio-button,
|
|
92
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-cascader,
|
|
93
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-range-input,
|
|
94
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-textarea__inner {
|
|
95
|
+
border-color: var(--td-success-color);
|
|
96
|
+
}
|
|
97
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-input--focused,
|
|
98
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-select--focused,
|
|
99
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-radio-button--focused,
|
|
100
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-cascader--focused,
|
|
101
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-range-input--focused,
|
|
102
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-textarea__inner--focused {
|
|
103
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-success-color-focus);
|
|
104
|
+
box-shadow: 0 0 0 2px var(--td-success-color-focus);
|
|
105
|
+
}
|
|
106
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-input .t-icon,
|
|
107
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-input .t-fake-arrow,
|
|
108
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-select .t-icon,
|
|
109
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-select .t-fake-arrow,
|
|
110
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-radio-button .t-icon,
|
|
111
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-radio-button .t-fake-arrow,
|
|
112
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-cascader .t-icon,
|
|
113
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-cascader .t-fake-arrow,
|
|
114
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-range-input .t-icon,
|
|
115
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-range-input .t-fake-arrow,
|
|
116
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-textarea__inner .t-icon,
|
|
117
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-textarea__inner .t-fake-arrow {
|
|
118
|
+
color: var(--td-success-color);
|
|
119
|
+
}
|
|
120
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-select > .t-select__right-icon:not(.t-select__right-icon-clear) {
|
|
121
|
+
color: var(--td-success-color);
|
|
122
|
+
}
|
|
123
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-radio-button:last-child {
|
|
124
|
+
border-right-color: var(--td-success-color);
|
|
125
|
+
}
|
|
126
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-textarea__inner.t-is-focused {
|
|
127
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-success-color);
|
|
128
|
+
box-shadow: 0 0 0 2px var(--td-success-color);
|
|
129
|
+
}
|
|
130
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-cascader.t-is-active,
|
|
131
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-select.t-is-active {
|
|
132
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-success-color-focus);
|
|
133
|
+
box-shadow: 0 0 0 2px var(--td-success-color-focus);
|
|
134
|
+
}
|
|
135
|
+
.t-form__controls.t-form--success-border .t-is-success .t-form__controls-content .t-form__status .t-icon {
|
|
136
|
+
color: var(--td-success-color);
|
|
137
|
+
}
|
|
138
|
+
.t-form__status {
|
|
139
|
+
display: -webkit-box;
|
|
140
|
+
display: -ms-flexbox;
|
|
141
|
+
display: flex;
|
|
142
|
+
margin: 0 var(--td-comp-margin-s);
|
|
143
|
+
}
|
|
144
|
+
.t-form__status > .t-icon {
|
|
145
|
+
font-size: var(--td-comp-size-xxxs);
|
|
146
|
+
}
|
|
147
|
+
.t-form__status-without-icon {
|
|
148
|
+
width: 25px;
|
|
149
|
+
height: 25px;
|
|
150
|
+
}
|
|
151
|
+
.t-form__status button {
|
|
152
|
+
width: var(--td-comp-size-m);
|
|
153
|
+
}
|
|
154
|
+
.t-form__status button + button {
|
|
155
|
+
margin-left: var(--td-comp-margin-s);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.t-form-inline {
|
|
159
|
+
display: -webkit-box;
|
|
160
|
+
display: -ms-flexbox;
|
|
161
|
+
display: flex;
|
|
162
|
+
-ms-flex-wrap: wrap;
|
|
163
|
+
flex-wrap: wrap;
|
|
164
|
+
row-gap: var(--td-comp-margin-l);
|
|
165
|
+
}
|
|
166
|
+
.t-form-inline .t-form__item {
|
|
167
|
+
margin: 0;
|
|
168
|
+
min-width: 200px;
|
|
169
|
+
display: inline-block;
|
|
170
|
+
margin-right: var(--td-comp-margin-xxl);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.t-input__extra,
|
|
174
|
+
.t-input__help {
|
|
175
|
+
margin: 0;
|
|
176
|
+
width: 100%;
|
|
177
|
+
height: auto;
|
|
178
|
+
min-height: var(--td-line-height-body-small);
|
|
179
|
+
font: var(--td-font-body-small);
|
|
180
|
+
color: var(--td-text-color-placeholder);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.t-input__extra {
|
|
184
|
+
position: absolute;
|
|
185
|
+
bottom: calc(0px - var(--td-line-height-body-small));
|
|
186
|
+
max-width: 100%;
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
text-overflow: ellipsis;
|
|
189
|
+
white-space: nowrap;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.t-is-warning .t-input__extra {
|
|
193
|
+
color: var(--td-warning-color);
|
|
194
|
+
}
|
|
195
|
+
.t-is-warning .t-form__controls-content .t-input,
|
|
196
|
+
.t-is-warning .t-form__controls-content .t-select,
|
|
197
|
+
.t-is-warning .t-form__controls-content .t-radio-button,
|
|
198
|
+
.t-is-warning .t-form__controls-content .t-cascader,
|
|
199
|
+
.t-is-warning .t-form__controls-content .t-range-input,
|
|
200
|
+
.t-is-warning .t-form__controls-content .t-textarea__inner {
|
|
201
|
+
border-color: var(--td-warning-color);
|
|
202
|
+
}
|
|
203
|
+
.t-is-warning .t-form__controls-content .t-input--focused,
|
|
204
|
+
.t-is-warning .t-form__controls-content .t-select--focused,
|
|
205
|
+
.t-is-warning .t-form__controls-content .t-radio-button--focused,
|
|
206
|
+
.t-is-warning .t-form__controls-content .t-cascader--focused,
|
|
207
|
+
.t-is-warning .t-form__controls-content .t-range-input--focused,
|
|
208
|
+
.t-is-warning .t-form__controls-content .t-textarea__inner--focused {
|
|
209
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-warning-color-focus);
|
|
210
|
+
box-shadow: 0 0 0 2px var(--td-warning-color-focus);
|
|
211
|
+
}
|
|
212
|
+
.t-is-warning .t-form__controls-content .t-input .t-icon,
|
|
213
|
+
.t-is-warning .t-form__controls-content .t-input .t-fake-arrow,
|
|
214
|
+
.t-is-warning .t-form__controls-content .t-select .t-icon,
|
|
215
|
+
.t-is-warning .t-form__controls-content .t-select .t-fake-arrow,
|
|
216
|
+
.t-is-warning .t-form__controls-content .t-radio-button .t-icon,
|
|
217
|
+
.t-is-warning .t-form__controls-content .t-radio-button .t-fake-arrow,
|
|
218
|
+
.t-is-warning .t-form__controls-content .t-cascader .t-icon,
|
|
219
|
+
.t-is-warning .t-form__controls-content .t-cascader .t-fake-arrow,
|
|
220
|
+
.t-is-warning .t-form__controls-content .t-range-input .t-icon,
|
|
221
|
+
.t-is-warning .t-form__controls-content .t-range-input .t-fake-arrow,
|
|
222
|
+
.t-is-warning .t-form__controls-content .t-textarea__inner .t-icon,
|
|
223
|
+
.t-is-warning .t-form__controls-content .t-textarea__inner .t-fake-arrow {
|
|
224
|
+
color: var(--td-warning-color);
|
|
225
|
+
}
|
|
226
|
+
.t-is-warning .t-form__controls-content .t-select > .t-select__right-icon:not(.t-select__right-icon-clear) {
|
|
227
|
+
color: var(--td-warning-color);
|
|
228
|
+
}
|
|
229
|
+
.t-is-warning .t-form__controls-content .t-radio-button:last-child {
|
|
230
|
+
border-right-color: var(--td-warning-color);
|
|
231
|
+
}
|
|
232
|
+
.t-is-warning .t-form__controls-content .t-textarea__inner.t-is-focused {
|
|
233
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-warning-color);
|
|
234
|
+
box-shadow: 0 0 0 2px var(--td-warning-color);
|
|
235
|
+
}
|
|
236
|
+
.t-is-warning .t-form__controls-content .t-cascader.t-is-active,
|
|
237
|
+
.t-is-warning .t-form__controls-content .t-select.t-is-active {
|
|
238
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-warning-color-focus);
|
|
239
|
+
box-shadow: 0 0 0 2px var(--td-warning-color-focus);
|
|
240
|
+
}
|
|
241
|
+
.t-is-warning .t-form__controls-content .t-form__status .t-icon {
|
|
242
|
+
color: var(--td-warning-color);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.t-is-error .t-input__extra {
|
|
246
|
+
color: var(--td-error-color);
|
|
247
|
+
}
|
|
248
|
+
.t-is-error .t-form__controls-content .t-input,
|
|
249
|
+
.t-is-error .t-form__controls-content .t-select,
|
|
250
|
+
.t-is-error .t-form__controls-content .t-radio-button,
|
|
251
|
+
.t-is-error .t-form__controls-content .t-cascader,
|
|
252
|
+
.t-is-error .t-form__controls-content .t-range-input,
|
|
253
|
+
.t-is-error .t-form__controls-content .t-textarea__inner {
|
|
254
|
+
border-color: var(--td-error-color);
|
|
255
|
+
}
|
|
256
|
+
.t-is-error .t-form__controls-content .t-input--focused,
|
|
257
|
+
.t-is-error .t-form__controls-content .t-select--focused,
|
|
258
|
+
.t-is-error .t-form__controls-content .t-radio-button--focused,
|
|
259
|
+
.t-is-error .t-form__controls-content .t-cascader--focused,
|
|
260
|
+
.t-is-error .t-form__controls-content .t-range-input--focused,
|
|
261
|
+
.t-is-error .t-form__controls-content .t-textarea__inner--focused {
|
|
262
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-error-color-focus);
|
|
263
|
+
box-shadow: 0 0 0 2px var(--td-error-color-focus);
|
|
264
|
+
}
|
|
265
|
+
.t-is-error .t-form__controls-content .t-input .t-icon,
|
|
266
|
+
.t-is-error .t-form__controls-content .t-input .t-fake-arrow,
|
|
267
|
+
.t-is-error .t-form__controls-content .t-select .t-icon,
|
|
268
|
+
.t-is-error .t-form__controls-content .t-select .t-fake-arrow,
|
|
269
|
+
.t-is-error .t-form__controls-content .t-radio-button .t-icon,
|
|
270
|
+
.t-is-error .t-form__controls-content .t-radio-button .t-fake-arrow,
|
|
271
|
+
.t-is-error .t-form__controls-content .t-cascader .t-icon,
|
|
272
|
+
.t-is-error .t-form__controls-content .t-cascader .t-fake-arrow,
|
|
273
|
+
.t-is-error .t-form__controls-content .t-range-input .t-icon,
|
|
274
|
+
.t-is-error .t-form__controls-content .t-range-input .t-fake-arrow,
|
|
275
|
+
.t-is-error .t-form__controls-content .t-textarea__inner .t-icon,
|
|
276
|
+
.t-is-error .t-form__controls-content .t-textarea__inner .t-fake-arrow {
|
|
277
|
+
color: var(--td-error-color);
|
|
278
|
+
}
|
|
279
|
+
.t-is-error .t-form__controls-content .t-select > .t-select__right-icon:not(.t-select__right-icon-clear) {
|
|
280
|
+
color: var(--td-error-color);
|
|
281
|
+
}
|
|
282
|
+
.t-is-error .t-form__controls-content .t-radio-button:last-child {
|
|
283
|
+
border-right-color: var(--td-error-color);
|
|
284
|
+
}
|
|
285
|
+
.t-is-error .t-form__controls-content .t-textarea__inner.t-is-focused {
|
|
286
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-error-color);
|
|
287
|
+
box-shadow: 0 0 0 2px var(--td-error-color);
|
|
288
|
+
}
|
|
289
|
+
.t-is-error .t-form__controls-content .t-cascader.t-is-active,
|
|
290
|
+
.t-is-error .t-form__controls-content .t-select.t-is-active {
|
|
291
|
+
-webkit-box-shadow: 0 0 0 2px var(--td-error-color-focus);
|
|
292
|
+
box-shadow: 0 0 0 2px var(--td-error-color-focus);
|
|
293
|
+
}
|
|
294
|
+
.t-is-error .t-form__controls-content .t-form__status .t-icon {
|
|
295
|
+
color: var(--td-error-color);
|
|
296
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { _ as _slicedToArray } from '../../_chunks/dep-CzLhKWCf.js';
|
|
2
|
+
import { _ as _defineProperty } from '../../_chunks/dep-Cwish4GD.js';
|
|
3
|
+
import { _ as _toConsumableArray } from '../../_chunks/dep-CgyDw_YI.js';
|
|
4
|
+
import { isObject, isArray, isEmpty, has, get } from 'lodash-es';
|
|
5
|
+
import '../../_chunks/dep-D-UKOauR.js';
|
|
6
|
+
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
+
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; } }
|
|
9
|
+
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; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function getMapValue(name, formMapRef) {
|
|
13
|
+
if (!formMapRef.current) return;
|
|
14
|
+
var mapKeys = _toConsumableArray(formMapRef.current.keys());
|
|
15
|
+
var key = mapKeys.find(function (key2) {
|
|
16
|
+
return String(key2) === String(name);
|
|
17
|
+
});
|
|
18
|
+
return formMapRef.current.get(key);
|
|
19
|
+
}
|
|
20
|
+
function objectToArray(obj) {
|
|
21
|
+
var result = [];
|
|
22
|
+
function traverse(current) {
|
|
23
|
+
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
24
|
+
if (isObject(current) && !isArray(current) && !isEmpty(current)) {
|
|
25
|
+
Object.keys(current).forEach(function (key) {
|
|
26
|
+
traverse(current[key], [].concat(_toConsumableArray(path), [key]));
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
result.push(path);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
traverse(obj);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
function calcFieldValue(name, value) {
|
|
36
|
+
var isFormList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
37
|
+
if (Array.isArray(name)) {
|
|
38
|
+
if (isFormList) {
|
|
39
|
+
var fieldValue = name.reduceRight(function (prev, curr) {
|
|
40
|
+
var arr = [];
|
|
41
|
+
if (/^\d+$/.test(String(curr))) arr[curr] = prev;
|
|
42
|
+
return arr.length ? arr : _defineProperty({}, curr, prev);
|
|
43
|
+
}, value);
|
|
44
|
+
return _objectSpread({}, fieldValue);
|
|
45
|
+
}
|
|
46
|
+
return name.reduceRight(function (prev, curr, currentIndex) {
|
|
47
|
+
if (currentIndex === name.length - 1) {
|
|
48
|
+
return _defineProperty({}, curr, value);
|
|
49
|
+
}
|
|
50
|
+
return _defineProperty({}, curr, prev);
|
|
51
|
+
}, {});
|
|
52
|
+
}
|
|
53
|
+
return _defineProperty({}, name, value);
|
|
54
|
+
}
|
|
55
|
+
function travelMapFromObject(obj, formMapRef, callback) {
|
|
56
|
+
var _iterator = _createForOfIteratorHelper(formMapRef.current.entries()),
|
|
57
|
+
_step;
|
|
58
|
+
try {
|
|
59
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
60
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
61
|
+
mapName = _step$value[0],
|
|
62
|
+
formItemRef = _step$value[1];
|
|
63
|
+
if (has(obj, mapName)) {
|
|
64
|
+
callback(formItemRef, get(obj, mapName));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
_iterator.e(err);
|
|
69
|
+
} finally {
|
|
70
|
+
_iterator.f();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { calcFieldValue, getMapValue, objectToArray, travelMapFromObject };
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../components/form/utils/index.ts"],"sourcesContent":["import { has, get, isObject, isArray, isEmpty } from \"lodash-es\";\nimport type { NamePath } from \"../type\";\n\n// 获取 formMap 管理的数据\nexport function getMapValue(name: NamePath, formMapRef: React.RefObject<Map<NamePath, React.RefObject<unknown>>>) {\n if (!formMapRef.current) return;\n\n // 提取所有 map key\n const mapKeys = [...formMapRef.current.keys()];\n // 转译为字符串后比对 key 兼容数组格式\n const key = mapKeys.find((key) => String(key) === String(name));\n // 拿到 key 引用地址获取 value\n return formMapRef.current.get(key);\n}\n\n// { user: { name: '' } } => [['user', 'name']]\n// 不处理数组类型\n// { user: [{ name: '' }]} => [['user']]\nexport function objectToArray(obj: Record<string | number, unknown>) {\n const result: (string | number)[][] = [];\n\n function traverse(current: unknown, path: string[] = []) {\n if (isObject(current) && !isArray(current) && !isEmpty(current)) {\n Object.keys(current).forEach((key) => {\n traverse(current[key], [...path, key]);\n });\n } else {\n result.push(path);\n }\n }\n\n traverse(obj);\n return result;\n}\n\n// 将数据整理成对象,数组 name 转化嵌套对象: ['user', 'name'] => { user: { name: '' } }\nexport function calcFieldValue(name: NamePath, value: unknown, isFormList = true) {\n if (Array.isArray(name)) {\n if (isFormList) {\n const fieldValue = name.reduceRight((prev, curr) => {\n const arr = [];\n if (/^\\d+$/.test(String(curr))) arr[curr] = prev;\n return arr.length ? arr : { [curr]: prev };\n }, value);\n return { ...(fieldValue as Record<string, unknown>) };\n }\n return name.reduceRight((prev, curr, currentIndex) => {\n if (currentIndex === name.length - 1) {\n return { [curr]: value };\n }\n return { [curr]: prev };\n }, {});\n }\n\n return { [name]: value };\n}\n\n// 通过对象数据类型获取 map 引用: { user: { name: '' } } => formMap.get(['user', 'name'])\nexport function travelMapFromObject(\n obj: Record<string, unknown>,\n formMapRef: React.RefObject<Map<NamePath, React.RefObject<unknown>>>,\n callback: (...args: unknown[]) => unknown\n) {\n for (const [mapName, formItemRef] of formMapRef.current.entries()) {\n if (has(obj, mapName)) {\n callback(formItemRef, get(obj, mapName));\n }\n }\n}\n"],"names":["getMapValue","name","formMapRef","current","mapKeys","keys","key","find","String","get","objectToArray","obj","result","traverse","path","arguments","length","undefined","isObject","isArray","isEmpty","Object","forEach","concat","_toConsumableArray","push","calcFieldValue","value","isFormList","Array","fieldValue","reduceRight","prev","curr","arr","test","_defineProperty","_objectSpread","currentIndex","travelMapFromObject","callback","_iterator","_createForOfIteratorHelper","entries","_step","s","n","done","_step$value","_slicedToArray","mapName","formItemRef","has","err","e","f"],"mappings":";;;;;;;;;;;AAIO,SAASA,WAAAA,CAAYC,MAAgBC,UAAA,EAAsE;AAChH,EAAA,IAAI,CAACA,WAAWC,OAAA,EAAS;EAGzB,IAAMC,6BAAcF,UAAA,CAAWC,OAAA,CAAQE,MAAM,CAAA;AAE7C,EAAA,IAAMC,GAAA,GAAMF,OAAA,CAAQG,IAAA,CAAK,UAACD,IAAAA,EAAAA;IAAAA,OAAQE,OAAOF,IAAG,CAAA,KAAME,MAAA,CAAOP,IAAI,CAAC;EAAA,CAAA,CAAA;AAE9D,EAAA,OAAOC,UAAA,CAAWC,OAAA,CAAQM,GAAA,CAAIH,GAAG,CAAA;AACnC;AAKO,SAASI,cAAcC,GAAA,EAAuC;EACnE,IAAMC,SAAgC,EAAC;EAEvC,SAASC,QAAAA,CAASV,OAAA,EAAuC;AAAA,IAAA,IAArBW,IAAA,GAAAC,SAAA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;IAAAZ,SAAA,CAAAa,CAAA,CAAAD,GAAA,CAAA;AAAA,EAAA,CAAA,SAAA;AAAAZ,IAAAA,SAAA,CAAAc,CAAA,EAAA;AAAA,EAAA;AACF;;;;"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { _ as _slicedToArray } from '../_chunks/dep-CzLhKWCf.js';
|
|
2
|
+
import React, { useState, useCallback } from 'react';
|
|
3
|
+
import { n as noop } from '../_chunks/dep-U1T8CQY9.js';
|
|
4
|
+
|
|
5
|
+
var useInsertionEffect = typeof window !== "undefined" ? React.useInsertionEffect || React.useLayoutEffect : noop;
|
|
6
|
+
function useEventCallbackShouldNotBeInvokedBeforeMount() {
|
|
7
|
+
throw new Error("INVALID_USEEVENTCALLBACK_INVOCATION: the callback from useEventCallback cannot be invoked before the component has mounted.");
|
|
8
|
+
}
|
|
9
|
+
function useEventCallback(callback) {
|
|
10
|
+
var latestRef = React.useRef(useEventCallbackShouldNotBeInvokedBeforeMount);
|
|
11
|
+
useInsertionEffect(function () {
|
|
12
|
+
latestRef.current = callback;
|
|
13
|
+
}, [callback]);
|
|
14
|
+
var stableRef = React.useRef(null);
|
|
15
|
+
if (!stableRef.current) {
|
|
16
|
+
stableRef.current = function () {
|
|
17
|
+
return latestRef.current.apply(latestRef, arguments);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return stableRef.current;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function useDragSorter(props) {
|
|
24
|
+
var sortOnDraggable = props.sortOnDraggable,
|
|
25
|
+
onDragSort = props.onDragSort,
|
|
26
|
+
onDragOverCheck = props.onDragOverCheck;
|
|
27
|
+
var _useState = useState(-1),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
draggingIndex = _useState2[0],
|
|
30
|
+
setDraggingIndex = _useState2[1];
|
|
31
|
+
var _useState3 = useState(null),
|
|
32
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
+
dragStartData = _useState4[0],
|
|
34
|
+
setDragStartData = _useState4[1];
|
|
35
|
+
var _useState5 = useState(null),
|
|
36
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
+
isDropped = _useState6[0],
|
|
38
|
+
setIsDropped = _useState6[1];
|
|
39
|
+
var _useState7 = useState({
|
|
40
|
+
nodeX: 0,
|
|
41
|
+
nodeWidth: 0,
|
|
42
|
+
mouseX: 0
|
|
43
|
+
}),
|
|
44
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
+
startInfo = _useState8[0],
|
|
46
|
+
setStartInfo = _useState8[1];
|
|
47
|
+
var onDragSortEvent = useEventCallback(onDragSort);
|
|
48
|
+
var _onDragOver = useCallback(function (e, index, record) {
|
|
49
|
+
var _e$target;
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
if (draggingIndex === index || draggingIndex === -1) return;
|
|
52
|
+
if (onDragOverCheck !== null && onDragOverCheck !== void 0 && onDragOverCheck.targetClassNameRegExp && !(onDragOverCheck !== null && onDragOverCheck !== void 0 && onDragOverCheck.targetClassNameRegExp.test((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.className))) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (onDragOverCheck !== null && onDragOverCheck !== void 0 && onDragOverCheck.x) {
|
|
56
|
+
if (!startInfo.nodeWidth) return;
|
|
57
|
+
var _e$target$getBounding = e.target.getBoundingClientRect(),
|
|
58
|
+
x = _e$target$getBounding.x,
|
|
59
|
+
width = _e$target$getBounding.width;
|
|
60
|
+
var targetNodeMiddleX = x + width / 2;
|
|
61
|
+
var clientX = e.clientX || 0;
|
|
62
|
+
var draggingNodeLeft = clientX - (startInfo.mouseX - startInfo.nodeX);
|
|
63
|
+
var draggingNodeRight = draggingNodeLeft + startInfo.nodeWidth;
|
|
64
|
+
var overlap = false;
|
|
65
|
+
if (draggingNodeLeft > x && draggingNodeLeft < x + width) {
|
|
66
|
+
overlap = draggingNodeLeft < targetNodeMiddleX;
|
|
67
|
+
} else {
|
|
68
|
+
overlap = draggingNodeRight > targetNodeMiddleX;
|
|
69
|
+
}
|
|
70
|
+
if (!overlap) return;
|
|
71
|
+
}
|
|
72
|
+
onDragSortEvent({
|
|
73
|
+
currentIndex: draggingIndex,
|
|
74
|
+
current: dragStartData,
|
|
75
|
+
target: record,
|
|
76
|
+
targetIndex: index
|
|
77
|
+
});
|
|
78
|
+
setDraggingIndex(index);
|
|
79
|
+
}, [draggingIndex, onDragOverCheck === null || onDragOverCheck === void 0 ? void 0 : onDragOverCheck.targetClassNameRegExp, onDragOverCheck === null || onDragOverCheck === void 0 ? void 0 : onDragOverCheck.x, dragStartData, startInfo.nodeWidth, startInfo.mouseX, startInfo.nodeX, onDragSortEvent]);
|
|
80
|
+
if (!sortOnDraggable) {
|
|
81
|
+
return {};
|
|
82
|
+
}
|
|
83
|
+
function _onDragStart(e, index, record) {
|
|
84
|
+
setDraggingIndex(index);
|
|
85
|
+
setDragStartData(record);
|
|
86
|
+
if (onDragOverCheck) {
|
|
87
|
+
var _e$target$getBounding2 = e.target.getBoundingClientRect(),
|
|
88
|
+
x = _e$target$getBounding2.x,
|
|
89
|
+
width = _e$target$getBounding2.width;
|
|
90
|
+
setStartInfo({
|
|
91
|
+
nodeX: x,
|
|
92
|
+
nodeWidth: width,
|
|
93
|
+
mouseX: e.clientX || 0
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function _onDrop() {
|
|
98
|
+
setIsDropped(true);
|
|
99
|
+
}
|
|
100
|
+
function _onDragEnd() {
|
|
101
|
+
if (!isDropped) {}
|
|
102
|
+
setIsDropped(false);
|
|
103
|
+
setDraggingIndex(-1);
|
|
104
|
+
setDragStartData(null);
|
|
105
|
+
}
|
|
106
|
+
function getDragProps(index, record) {
|
|
107
|
+
if (sortOnDraggable) {
|
|
108
|
+
return {
|
|
109
|
+
draggable: true,
|
|
110
|
+
onDragStart: function onDragStart(e) {
|
|
111
|
+
_onDragStart(e, index, record);
|
|
112
|
+
},
|
|
113
|
+
onDragOver: function onDragOver(e) {
|
|
114
|
+
_onDragOver(e, index, record);
|
|
115
|
+
},
|
|
116
|
+
onDrop: function onDrop() {
|
|
117
|
+
_onDrop();
|
|
118
|
+
},
|
|
119
|
+
onDragEnd: function onDragEnd() {
|
|
120
|
+
_onDragEnd();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return {};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
onDragStart: _onDragStart,
|
|
128
|
+
onDragOver: _onDragOver,
|
|
129
|
+
onDrop: _onDrop,
|
|
130
|
+
onDragEnd: _onDragEnd,
|
|
131
|
+
getDragProps: getDragProps,
|
|
132
|
+
dragging: draggingIndex !== -1
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export { useDragSorter as default };
|
|
137
|
+
//# sourceMappingURL=useDragSorter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDragSorter.js","sources":["../../../components/hooks/useEventCallback.ts","../../../components/hooks/useDragSorter.tsx"],"sourcesContent":["// https://github.com/scottrippey/react-use-event-hook/blob/75ba34af9175dc311afb3fb302d6fea44e4a5203/src/useEvent.ts\n// [RFC](https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md)\nimport React from \"react\";\nimport noop from \"../utils/noop\";\n\ntype AnyFunction = (...args: unknown[]) => unknown;\n\n/**\n * Suppress the warning when using useLayoutEffect with SSR. (https://reactjs.org/link/uselayouteffect-ssr)\n * Make use of useInsertionEffect if available.\n */\nconst useInsertionEffect = typeof window !== \"undefined\" ? React.useInsertionEffect || React.useLayoutEffect : noop;\n\n/**\n * Render methods should be pure, especially when concurrency is used,\n * so we will throw this error if the callback is called while rendering.\n */\nfunction useEventCallbackShouldNotBeInvokedBeforeMount() {\n throw new Error(\n \"INVALID_USEEVENTCALLBACK_INVOCATION: the callback from useEventCallback cannot be invoked before the component has mounted.\"\n );\n}\n\n/**\n * Similar to useCallback, with a few subtle differences:\n * - The returned function is a stable reference, and will always be the same between renders\n * - No dependency lists required\n * - Properties or state accessed within the callback will always be \"current\"\n */\nexport default function useEventCallback<TCallback extends AnyFunction>(callback: TCallback): TCallback {\n // Keep track of the latest callback:\n const latestRef = React.useRef<TCallback>(useEventCallbackShouldNotBeInvokedBeforeMount as TCallback);\n useInsertionEffect(() => {\n latestRef.current = callback;\n }, [callback]);\n\n // Create a stable callback that always calls the latest callback:\n // using useRef instead of useCallback avoids creating and empty array on every render\n const stableRef = React.useRef<TCallback>(null);\n if (!stableRef.current) {\n stableRef.current = function (...args: Parameters<TCallback>) {\n return latestRef.current(...args);\n } as TCallback;\n }\n\n return stableRef.current;\n}\n","import { useCallback, useState } from \"react\";\nimport useEventCallback from \"./useEventCallback\";\n\ninterface DragSortProps<T> {\n sortOnDraggable: boolean;\n onDragSort?: (context: DragSortContext<T>) => void;\n onDragOverCheck?: {\n x?: boolean;\n targetClassNameRegExp?: RegExp;\n };\n}\n\ntype DragFnType<T = unknown> = (e?: React.DragEvent<HTMLTableRowElement>, index?: number, record?: T) => void;\ninterface DragSortInnerData<T = unknown> {\n dragging?: boolean;\n draggable?: boolean;\n onDragStart?: DragFnType<T>;\n onDragOver?: DragFnType<T>;\n onDrop?: DragFnType<T>;\n onDragEnd?: DragFnType<T>;\n}\n\nexport interface DragSortInnerProps<T = unknown> extends DragSortInnerData<T> {\n getDragProps?: (index?: number, record?: T) => DragSortInnerData<T>;\n}\n\nexport interface DragSortContext<T> {\n currentIndex: number;\n current: T;\n targetIndex: number;\n target: T;\n}\n\nfunction useDragSorter<T>(props: DragSortProps<T>): DragSortInnerProps<T> {\n const { sortOnDraggable, onDragSort, onDragOverCheck } = props;\n const [draggingIndex, setDraggingIndex] = useState(-1);\n const [dragStartData, setDragStartData] = useState(null);\n const [isDropped, setIsDropped] = useState(null);\n const [startInfo, setStartInfo] = useState({\n nodeX: 0,\n nodeWidth: 0,\n mouseX: 0\n });\n const onDragSortEvent = useEventCallback(onDragSort as (context: DragSortContext<T>) => void);\n\n const onDragOver = useCallback(\n (e, index, record: T) => {\n e.preventDefault();\n if (draggingIndex === index || draggingIndex === -1) return;\n if (onDragOverCheck?.targetClassNameRegExp && !onDragOverCheck?.targetClassNameRegExp.test(e.target?.className)) {\n return;\n }\n\n if (onDragOverCheck?.x) {\n if (!startInfo.nodeWidth) return;\n\n const { x, width } = e.target.getBoundingClientRect();\n const targetNodeMiddleX = x + width / 2;\n const clientX = e.clientX || 0;\n const draggingNodeLeft = clientX - (startInfo.mouseX - startInfo.nodeX);\n const draggingNodeRight = draggingNodeLeft + startInfo.nodeWidth;\n\n let overlap = false;\n if (draggingNodeLeft > x && draggingNodeLeft < x + width) {\n overlap = draggingNodeLeft < targetNodeMiddleX;\n } else {\n overlap = draggingNodeRight > targetNodeMiddleX;\n }\n if (!overlap) return;\n }\n\n onDragSortEvent({\n currentIndex: draggingIndex,\n current: dragStartData,\n target: record,\n targetIndex: index\n });\n setDraggingIndex(index);\n },\n [\n draggingIndex,\n onDragOverCheck?.targetClassNameRegExp,\n onDragOverCheck?.x,\n dragStartData,\n startInfo.nodeWidth,\n startInfo.mouseX,\n startInfo.nodeX,\n onDragSortEvent\n ]\n );\n\n if (!sortOnDraggable) {\n return {};\n }\n\n function onDragStart(e, index, record: T) {\n setDraggingIndex(index);\n setDragStartData(record);\n if (onDragOverCheck) {\n const { x, width } = e.target.getBoundingClientRect();\n setStartInfo({\n nodeX: x,\n nodeWidth: width,\n mouseX: e.clientX || 0\n });\n }\n }\n\n function onDrop() {\n setIsDropped(true);\n }\n function onDragEnd() {\n if (!isDropped) {\n // 取消排序,待扩展 api,输出 dragStartData\n }\n setIsDropped(false);\n setDraggingIndex(-1);\n setDragStartData(null);\n }\n function getDragProps(index, record: T) {\n if (sortOnDraggable) {\n return {\n draggable: true,\n onDragStart: (e) => {\n onDragStart(e, index, record);\n },\n onDragOver: (e) => {\n onDragOver(e, index, record);\n },\n onDrop: () => {\n onDrop();\n },\n onDragEnd: () => {\n onDragEnd();\n }\n };\n }\n return {};\n }\n\n return {\n onDragStart,\n onDragOver,\n onDrop,\n onDragEnd,\n getDragProps,\n dragging: draggingIndex !== -1\n };\n}\n\nexport default useDragSorter;\n"],"names":["useInsertionEffect","window","React","useLayoutEffect","noop","useEventCallbackShouldNotBeInvokedBeforeMount","Error","useEventCallback","callback","latestRef","useRef","current","stableRef","apply","arguments","useDragSorter","props","sortOnDraggable","onDragSort","onDragOverCheck","_useState","useState","_useState2","_slicedToArray","draggingIndex","setDraggingIndex","_useState3","_useState4","dragStartData","setDragStartData","_useState5","_useState6","isDropped","setIsDropped","_useState7","nodeX","nodeWidth","mouseX","_useState8","startInfo","setStartInfo","onDragSortEvent","onDragOver","useCallback","e","index","record","_e$target","preventDefault","targetClassNameRegExp","test","target","className","x","_e$target$getBounding","getBoundingClientRect","width","targetNodeMiddleX","clientX","draggingNodeLeft","draggingNodeRight","overlap","currentIndex","targetIndex","onDragStart","_e$target$getBounding2","onDrop","onDragEnd","getDragProps","draggable","dragging"],"mappings":";;;;AAWA,IAAMA,qBAAqB,OAAOC,MAAA,KAAW,cAAcC,KAAA,CAAMF,kBAAA,IAAsBE,MAAMC,eAAA,GAAkBC,IAAA;AAM/G,SAASC,6CAAAA,GAAgD;AACvD,EAAA,MAAM,IAAIC,KAAA,CACR,6HACF,CAAA;AACF;AAQA,SAAwBC,iBAAgDC,QAAA,EAAgC;AAEtG,EAAA,IAAMC,SAAA,GAAYP,KAAA,CAAMQ,MAAA,CAAkBL,6CAA0D,CAAA;AACpGL,EAAAA,kBAAA,CAAmB,YAAM;IACvBS,SAAA,CAAUE,OAAA,GAAUH,QAAA;AACtB,EAAA,CAAA,EAAG,CAACA,QAAQ,CAAC,CAAA;AAIb,EAAA,IAAMI,SAAA,GAAYV,KAAA,CAAMQ,MAAA,CAAkB,IAAI,CAAA;AAC9C,EAAA,IAAI,CAACE,UAAUD,OAAA,EAAS;IACtBC,SAAA,C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index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export { Loading } from './loading/index.js';
|
|
2
|
+
export { Popup } from './popup/index.js';
|
|
3
|
+
export { Button } from './button/index.js';
|
|
4
|
+
export { Input, InputGroup } from './input/index.js';
|
|
5
|
+
export { Alert } from './alert/index.js';
|
|
6
|
+
export { Badge } from './badge/index.js';
|
|
7
|
+
export { Checkbox } from './checkbox/index.js';
|
|
8
|
+
import './config-provider/index.js';
|
|
9
|
+
export { Tag } from './tag/index.js';
|
|
10
|
+
export { TagInput } from './tag-input/index.js';
|
|
11
|
+
export { Select } from './select/index.js';
|
|
12
|
+
export { SelectInput } from './select-input/index.js';
|
|
13
|
+
export { notification } from './notification/index.js';
|
|
14
|
+
export { Dialog, DialogCard, DialogPlugin, dialog } from './dialog/index.js';
|
|
15
|
+
export { Switch } from './switch/index.js';
|
|
16
|
+
export { Form } from './form/index.js';
|
|
17
|
+
export { default as ConfigContext } from './config-provider/ConfigContext.js';
|
|
18
|
+
export { default as ConfigProvider, merge } from './config-provider/ConfigProvider.js';
|
|
19
|
+
export { NotificationProvider, useNotification } from './notification/NotifyContext.js';
|
|
20
|
+
import './loading/Loading.js';
|
|
21
|
+
import './_chunks/dep-Cwish4GD.js';
|
|
22
|
+
import './_chunks/dep-D-UKOauR.js';
|
|
23
|
+
import './_chunks/dep-CzLhKWCf.js';
|
|
24
|
+
import 'react';
|
|
25
|
+
import 'classnames';
|
|
26
|
+
import './_chunks/dep-0QH2Ee4R.js';
|
|
27
|
+
import 'lodash-es';
|
|
28
|
+
import './_chunks/dep-u1x3x6MJ.js';
|
|
29
|
+
import './common/Portal.js';
|
|
30
|
+
import 'react-dom';
|
|
31
|
+
import './loading/Gradient.js';
|
|
32
|
+
import './_chunks/dep-DHWwZ2Nj.js';
|
|
33
|
+
import './_chunks/dep-DN7d1SzH.js';
|
|
34
|
+
import './_chunks/dep-PPA-yoAy.js';
|
|
35
|
+
import './_chunks/dep-DGvfel3I.js';
|
|
36
|
+
import './_chunks/dep-BH5n5r1M.js';
|
|
37
|
+
import './loading/style/css.js';
|
|
38
|
+
import './popup/Popup.js';
|
|
39
|
+
import './portal/Portal.js';
|
|
40
|
+
import './_chunks/dep-DwWrhxkd.js';
|
|
41
|
+
import 'react-is';
|
|
42
|
+
import './_chunks/dep-C1XcmShP.js';
|
|
43
|
+
import './_chunks/dep-CgyDw_YI.js';
|
|
44
|
+
import '@popperjs/core';
|
|
45
|
+
import 'react-fast-compare';
|
|
46
|
+
import 'react-transition-group';
|
|
47
|
+
import './popup/style/css.js';
|
|
48
|
+
import './button/Button.js';
|
|
49
|
+
import './_chunks/dep-D6YxJv-F.js';
|
|
50
|
+
import './button/style/css.js';
|
|
51
|
+
import './input/Input.js';
|
|
52
|
+
import '@tendaui/icons';
|
|
53
|
+
import './input/InputGroup.js';
|
|
54
|
+
import './input/style/css.js';
|
|
55
|
+
import './alert/Alert.js';
|
|
56
|
+
import './_chunks/dep-U1T8CQY9.js';
|
|
57
|
+
import './_chunks/dep-bWaVq_y3.js';
|
|
58
|
+
import './alert/style/css.js';
|
|
59
|
+
import './badge/Badge.js';
|
|
60
|
+
import './badge/style/css.js';
|
|
61
|
+
import './_chunks/dep-B7HmDtze.js';
|
|
62
|
+
import './_chunks/dep-BP0-apUT.js';
|
|
63
|
+
import 'hoist-non-react-statics';
|
|
64
|
+
import './common/Check.js';
|
|
65
|
+
import './checkbox/style/css.js';
|
|
66
|
+
import './tag/Tag.js';
|
|
67
|
+
import './tag/style/css.js';
|
|
68
|
+
import './tag-input/TagInput.js';
|
|
69
|
+
import './tag-input/hooks/useTagList.js';
|
|
70
|
+
import './hooks/useDragSorter.js';
|
|
71
|
+
import './tag-input/style/css.js';
|
|
72
|
+
import './select/Select.js';
|
|
73
|
+
import './_chunks/dep-Dk2xX8lh.js';
|
|
74
|
+
import './_chunks/dep-DB5wmwh1.js';
|
|
75
|
+
import './select/Option.js';
|
|
76
|
+
import './common/FakeArrow.js';
|
|
77
|
+
import './_chunks/dep-D8jki30S.js';
|
|
78
|
+
import './select/style/css.js';
|
|
79
|
+
import './select-input/SelectInput.js';
|
|
80
|
+
import './select-input/hook/useSingle.js';
|
|
81
|
+
import './select-input/hook/useMultiple.js';
|
|
82
|
+
import './select-input/style/css.js';
|
|
83
|
+
import './notification/style/css.js';
|
|
84
|
+
import './dialog/Dialog.js';
|
|
85
|
+
import './_chunks/dep-CoIiHOgo.js';
|
|
86
|
+
import './dialog/plugin.js';
|
|
87
|
+
import './_chunks/dep-DZ_0EvBk.js';
|
|
88
|
+
import './common/PluginContainer.js';
|
|
89
|
+
import './dialog/style/css.js';
|
|
90
|
+
import './switch/Switch.js';
|
|
91
|
+
import './switch/style/css.js';
|
|
92
|
+
import './form/Form.js';
|
|
93
|
+
import './form/hooks/useInstance.js';
|
|
94
|
+
import './form/utils/index.js';
|
|
95
|
+
import './_chunks/dep-D7LanWes.js';
|
|
96
|
+
import './form/FormContext.js';
|
|
97
|
+
import './_chunks/dep-EcrDKDlu.js';
|
|
98
|
+
import './_chunks/dep-C36au4Ip.js';
|
|
99
|
+
import './form/FormList.js';
|
|
100
|
+
import './form/style/css.js';
|
|
101
|
+
import './notification/NotifyContainer.js';
|
|
102
|
+
import './notification/NotifyItem.js';
|
|
103
|
+
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|