@tendaui/components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +176 -0
- package/alert/Alert.tsx +147 -0
- package/alert/defaultProps.ts +3 -0
- package/alert/index.ts +9 -0
- package/alert/style/css.js +1 -0
- package/alert/style/index.js +1 -0
- package/alert/type.ts +44 -0
- package/badge/Badge.tsx +85 -0
- package/badge/defaultProps.ts +10 -0
- package/badge/index.ts +9 -0
- package/badge/style/css.js +1 -0
- package/badge/style/index.js +1 -0
- package/badge/type.ts +51 -0
- package/button/Button.tsx +95 -0
- package/button/defaultProps.ts +13 -0
- package/button/index.ts +7 -0
- package/button/style/css.js +1 -0
- package/button/style/index.js +1 -0
- package/button/type.ts +82 -0
- package/checkbox/Checkbox.tsx +19 -0
- package/checkbox/CheckboxGroup.tsx +207 -0
- package/checkbox/defaultProps.ts +14 -0
- package/checkbox/index.ts +10 -0
- package/checkbox/style/css.js +1 -0
- package/checkbox/style/index.js +1 -0
- package/checkbox/type.ts +117 -0
- package/common/Check.tsx +131 -0
- package/common/FakeArrow.tsx +36 -0
- package/common/PluginContainer.tsx +21 -0
- package/common/Portal.tsx +67 -0
- package/common.ts +76 -0
- package/config-provider/ConfigContext.tsx +21 -0
- package/config-provider/ConfigProvider.tsx +53 -0
- package/config-provider/index.ts +9 -0
- package/config-provider/type.ts +1062 -0
- package/dialog/Dialog.tsx +254 -0
- package/dialog/DialogCard.tsx +152 -0
- package/dialog/defaultProps.ts +25 -0
- package/dialog/hooks/useDialogDrag.ts +50 -0
- package/dialog/hooks/useDialogEsc.ts +31 -0
- package/dialog/hooks/useDialogPosition.ts +36 -0
- package/dialog/hooks/useLockStyle.ts +54 -0
- package/dialog/index.ts +13 -0
- package/dialog/plugin.tsx +78 -0
- package/dialog/style/css.js +1 -0
- package/dialog/style/index.js +1 -0
- package/dialog/type.ts +241 -0
- package/dialog/utils.ts +4 -0
- package/form/Form.tsx +136 -0
- package/form/FormContext.tsx +64 -0
- package/form/FormItem.tsx +554 -0
- package/form/FormList.tsx +303 -0
- package/form/const.ts +6 -0
- package/form/defaultProps.ts +26 -0
- package/form/formModel.ts +117 -0
- package/form/hooks/interface.ts +20 -0
- package/form/hooks/useForm.ts +122 -0
- package/form/hooks/useFormItemInitialData.ts +95 -0
- package/form/hooks/useFormItemStyle.tsx +122 -0
- package/form/hooks/useInstance.tsx +275 -0
- package/form/hooks/useWatch.ts +42 -0
- package/form/index.ts +11 -0
- package/form/style/css.js +1 -0
- package/form/style/index.js +1 -0
- package/form/type.ts +519 -0
- package/form/utils/index.ts +69 -0
- package/hooks/useAttach.ts +24 -0
- package/hooks/useCommonClassName.ts +45 -0
- package/hooks/useConfig.ts +3 -0
- package/hooks/useControlled.ts +39 -0
- package/hooks/useDefaultProps.ts +16 -0
- package/hooks/useDomCallback.ts +13 -0
- package/hooks/useDomRefCallback.ts +12 -0
- package/hooks/useDragSorter.tsx +151 -0
- package/hooks/useEventCallback.ts +47 -0
- package/hooks/useGlobalConfig.ts +14 -0
- package/hooks/useGlobalIcon.ts +14 -0
- package/hooks/useLastest.ts +13 -0
- package/hooks/useLayoutEffect.ts +7 -0
- package/hooks/useMouseEvent.ts +142 -0
- package/hooks/useMutationObserver.ts +56 -0
- package/hooks/usePopper.ts +189 -0
- package/hooks/useRipple.ts +0 -0
- package/hooks/useSetState.ts +25 -0
- package/hooks/useVirtualScroll.ts +246 -0
- package/hooks/useWindowSize.ts +31 -0
- package/index.ts +70 -0
- package/input/Input.tsx +383 -0
- package/input/InputGroup.tsx +29 -0
- package/input/defaultProps.ts +22 -0
- package/input/index.ts +11 -0
- package/input/style/css.js +1 -0
- package/input/style/index.js +1 -0
- package/input/type.ts +219 -0
- package/loading/Gradient.tsx +36 -0
- package/loading/Loading.tsx +169 -0
- package/loading/circleAdapter.ts +44 -0
- package/loading/defaultProps.ts +12 -0
- package/loading/index.ts +13 -0
- package/loading/style/css.js +1 -0
- package/loading/style/index.js +1 -0
- package/loading/type.ts +71 -0
- package/loading/utils/setStyle.ts +13 -0
- package/myform/index.ts +0 -0
- package/notification/Notify.ts +24 -0
- package/notification/NotifyContainer.tsx +90 -0
- package/notification/NotifyContext.tsx +173 -0
- package/notification/NotifyItem.tsx +121 -0
- package/notification/index.ts +3 -0
- package/notification/style/css.js +1 -0
- package/notification/style/index.js +1 -0
- package/notification/type.ts +23 -0
- package/package.json +52 -0
- package/popup/Popup.tsx +264 -0
- package/popup/defaultProps.ts +13 -0
- package/popup/hooks/useTrigger.ts +276 -0
- package/popup/index.ts +6 -0
- package/popup/style/css.js +1 -0
- package/popup/style/index.js +1 -0
- package/popup/type.ts +130 -0
- package/portal/Portal.tsx +63 -0
- package/portal/index.ts +1 -0
- package/select/Option.tsx +162 -0
- package/select/OptionGroup.tsx +30 -0
- package/select/PopupContent.tsx +271 -0
- package/select/Select.tsx +586 -0
- package/select/defaultProps.ts +27 -0
- package/select/hooks/useOptions.ts +120 -0
- package/select/hooks/usePanelVirtualScroll.ts +111 -0
- package/select/index.ts +9 -0
- package/select/style/css.js +1 -0
- package/select/style/index.js +2 -0
- package/select/type.ts +382 -0
- package/select/utils/helper.ts +256 -0
- package/select-input/SelectInput.tsx +98 -0
- package/select-input/defaultProps.ts +15 -0
- package/select-input/hook/useMultiple.tsx +100 -0
- package/select-input/hook/useOverlayInnerStyle.ts +84 -0
- package/select-input/hook/useSingle.tsx +112 -0
- package/select-input/index.ts +6 -0
- package/select-input/interface.ts +18 -0
- package/select-input/style/css.js +1 -0
- package/select-input/style/index.js +1 -0
- package/select-input/type.ts +280 -0
- package/space/defaultProps.ts +0 -0
- package/space/index.ts +0 -0
- package/space/type.ts +0 -0
- package/style/index.js +2 -0
- package/styles/_global.scss +39 -0
- package/styles/_vars.scss +386 -0
- package/styles/components/alert/_index.scss +175 -0
- package/styles/components/alert/_vars.scss +39 -0
- package/styles/components/badge/_index.scss +70 -0
- package/styles/components/badge/_vars.scss +25 -0
- package/styles/components/button/_index.scss +511 -0
- package/styles/components/button/_mixins.scss +39 -0
- package/styles/components/button/_vars.scss +122 -0
- package/styles/components/checkbox/_index.scss +158 -0
- package/styles/components/checkbox/_mixin.scss +0 -0
- package/styles/components/checkbox/_var.scss +60 -0
- package/styles/components/dialog/_animate.scss +135 -0
- package/styles/components/dialog/_index.scss +311 -0
- package/styles/components/dialog/_mixins.scss +0 -0
- package/styles/components/dialog/_vars.scss +59 -0
- package/styles/components/form/_index.scss +174 -0
- package/styles/components/form/_mixins.scss +76 -0
- package/styles/components/form/_vars.scss +100 -0
- package/styles/components/input/_index.scss +349 -0
- package/styles/components/input/_map.scss +0 -0
- package/styles/components/input/_mixins.scss +116 -0
- package/styles/components/input/_vars.scss +134 -0
- package/styles/components/loading/_index.scss +112 -0
- package/styles/components/loading/_vars.scss +39 -0
- package/styles/components/notification/_index.scss +160 -0
- package/styles/components/notification/_mixins.scss +12 -0
- package/styles/components/notification/_vars.scss +59 -0
- package/styles/components/popup/_index.scss +82 -0
- package/styles/components/popup/_mixin.scss +149 -0
- package/styles/components/popup/_var.scss +31 -0
- package/styles/components/select/_index.scss +290 -0
- package/styles/components/select/_var.scss +65 -0
- package/styles/components/select-input/_index.scss +5 -0
- package/styles/components/select-input/_var.scss +3 -0
- package/styles/components/switch/_index.scss +279 -0
- package/styles/components/switch/_mixins.scss +0 -0
- package/styles/components/switch/_vars.scss +61 -0
- package/styles/components/tag/_index.scss +316 -0
- package/styles/components/tag/_var.scss +85 -0
- package/styles/components/tag-input/_index.scss +163 -0
- package/styles/components/tag-input/_vars.scss +16 -0
- package/styles/globals.css +250 -0
- package/styles/mixins/_focus.scss +7 -0
- package/styles/mixins/_layout.scss +32 -0
- package/styles/mixins/_reset.scss +10 -0
- package/styles/mixins/_scrollbar.scss +31 -0
- package/styles/mixins/_text.scss +48 -0
- package/styles/rillple.css +16 -0
- package/styles/scrollbar.css +42 -0
- package/styles/themes/_dark.scss +191 -0
- package/styles/themes/_font.scss +79 -0
- package/styles/themes/_index.scss +5 -0
- package/styles/themes/_light.scss +190 -0
- package/styles/themes/_radius.scss +9 -0
- package/styles/themes/_size.scss +68 -0
- package/styles/themes.css +66 -0
- package/styles/utilities/_animation.scss +57 -0
- package/styles/utilities/_tips.scss +9 -0
- package/switch/Switch.tsx +120 -0
- package/switch/defaultProps.ts +3 -0
- package/switch/index.ts +7 -0
- package/switch/style/css.js +1 -0
- package/switch/style/index.js +1 -0
- package/switch/type.ts +46 -0
- package/tag/Tag.tsx +149 -0
- package/tag/defaultProps.ts +19 -0
- package/tag/index.ts +8 -0
- package/tag/style/css.js +1 -0
- package/tag/style/index.js +1 -0
- package/tag/type.ts +170 -0
- package/tag-input/TagInput.tsx +215 -0
- package/tag-input/defaultProps.ts +15 -0
- package/tag-input/hooks/useHover.ts +28 -0
- package/tag-input/hooks/useTagList.tsx +131 -0
- package/tag-input/hooks/useTagScroll.ts +105 -0
- package/tag-input/index.ts +9 -0
- package/tag-input/style/css.js +1 -0
- package/tag-input/style/index.js +1 -0
- package/tag-input/type.ts +224 -0
- package/tag-input/useTagList.tsx +131 -0
- package/utils/composeRefs.ts +14 -0
- package/utils/dom.ts +29 -0
- package/utils/forwardRefWithStatics.ts +12 -0
- package/utils/getScrollbarWidth.ts +11 -0
- package/utils/helper.ts +161 -0
- package/utils/isFragment.ts +22 -0
- package/utils/listener.ts +37 -0
- package/utils/noop.ts +3 -0
- package/utils/parentTNode.ts +38 -0
- package/utils/parseTNode.ts +38 -0
- package/utils/react-render.ts +108 -0
- package/utils/ref.ts +6 -0
- package/utils/refs.ts +81 -0
- package/utils/style.ts +60 -0
- package/utils/transition.ts +28 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
$dialog-border-color: transparent;
|
|
2
|
+
$dialog-bg-color: $bg-color-container;
|
|
3
|
+
$dialog-header-text-color: $text-color-primary;
|
|
4
|
+
$dialog-header-bg-color-fullscreen: $bg-color-secondarycontainer;
|
|
5
|
+
$dialog-close-icon-fullscreen-hover: $bg-color-secondarycontainer-hover;
|
|
6
|
+
$dialog-close-icon-fullscreen-active: $bg-color-secondarycontainer-active;
|
|
7
|
+
$dialog-body-text-color: $text-color-secondary;
|
|
8
|
+
$dialog-close-icon-hover: $bg-color-container-hover;
|
|
9
|
+
$dialog-close-icon-active: $bg-color-container-active;
|
|
10
|
+
$dialog-info-icon-color: $brand-color;
|
|
11
|
+
$dialog-success-icon-color: $success-color;
|
|
12
|
+
$dialog-warning-icon-color: $warning-color;
|
|
13
|
+
$dialog-error-icon-color: $error-color;
|
|
14
|
+
$dialog-close-color: $text-color-secondary;
|
|
15
|
+
$dialog-mask-bg-color: $mask-active;
|
|
16
|
+
|
|
17
|
+
// 字体
|
|
18
|
+
$dialog-header-font: $font-title-medium;
|
|
19
|
+
$dialog-header-weight: 600;
|
|
20
|
+
$dialog-body-text-font: $font-body-medium;
|
|
21
|
+
|
|
22
|
+
// 尺寸
|
|
23
|
+
$dialog-width: 480px;
|
|
24
|
+
$dialog-header-height-fullscreen: $comp-size-xxxl;
|
|
25
|
+
$dialog-icon-size: calc($font-size-l + 8px);
|
|
26
|
+
$dialog-close-icon-size: calc($font-size-l + 4px);
|
|
27
|
+
$dialog-footer-height-fullscreen: $comp-size-xxxxl;
|
|
28
|
+
|
|
29
|
+
// 间距
|
|
30
|
+
$dialog-spacer: $comp-paddingTB-xxl $comp-paddingLR-xxl;
|
|
31
|
+
$dialog-default-spacer: $comp-paddingTB-xxl $comp-paddingLR-xxl;
|
|
32
|
+
$dialog-default-padding: $dialog-spacer;
|
|
33
|
+
$dialog-header-icon-margin-right: $comp-margin-s;
|
|
34
|
+
$dialog-header-icon-margin-top: $size-1;
|
|
35
|
+
$dialog-header-content-margin-right: $comp-margin-s;
|
|
36
|
+
$dialog-header-padding-fullscreen: 0 $comp-paddingLR-xxl;
|
|
37
|
+
$dialog-closebtn-padding: $comp-paddingTB-xxs $comp-paddingLR-xxs;
|
|
38
|
+
$dialog-body-padding: $comp-paddingTB-l 0;
|
|
39
|
+
$dialog-body-padding-fullscreen: $comp-paddingTB-xl $comp-paddingLR-xxl;
|
|
40
|
+
$dialog-body-icon-padding: $comp-paddingTB-l 0;
|
|
41
|
+
$dialog-footer-button-margin-left: $comp-margin-s;
|
|
42
|
+
$dialog-footer-padding: $comp-paddingTB-l 0 0;
|
|
43
|
+
$dialog-footer-padding-fullscreen: 0 $comp-paddingLR-xxl $comp-paddingTB-xxl;
|
|
44
|
+
|
|
45
|
+
// 边框
|
|
46
|
+
$dialog-border: 1px solid $border-level-1-color;
|
|
47
|
+
$dialog-border-radius: $border-radius-medium;
|
|
48
|
+
$dialog-close-border-radius: $border-radius-medium;
|
|
49
|
+
|
|
50
|
+
// 位置
|
|
51
|
+
$dialog-close-position-top: $spacer-3;
|
|
52
|
+
$dialog-close-position-right: $spacer-3;
|
|
53
|
+
// 此处不能使用20% 因为定位是paddingTop 所以20% 会根据屏幕宽度
|
|
54
|
+
$dialog-top-position-top: 20vh;
|
|
55
|
+
|
|
56
|
+
// 动画
|
|
57
|
+
$dialog-anim-duration: $anim-duration-base;
|
|
58
|
+
$dialog-anim-time-fn-enter: $anim-time-fn-easing;
|
|
59
|
+
$dialog-anim-time-fn-exit: $anim-time-fn-easing;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// 组件允许单个组件打包,因此默认引入公共基础样式
|
|
2
|
+
|
|
3
|
+
@import '../../_vars.scss';
|
|
4
|
+
|
|
5
|
+
@import './_vars.scss';
|
|
6
|
+
|
|
7
|
+
@import './_mixins.scss';
|
|
8
|
+
|
|
9
|
+
@import '../../mixins/_reset.scss';
|
|
10
|
+
|
|
11
|
+
.#{$prefix}-form {
|
|
12
|
+
@include reset;
|
|
13
|
+
|
|
14
|
+
font: $form-font;
|
|
15
|
+
|
|
16
|
+
&:not(.#{$prefix}-form-inline) {
|
|
17
|
+
.#{$prefix}-form__item {
|
|
18
|
+
&:last-of-type {
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__item {
|
|
25
|
+
margin-bottom: $form-item-margin-bottom;
|
|
26
|
+
|
|
27
|
+
// 文档流撑开内容补足剩余的 4px
|
|
28
|
+
&.#{$prefix}-form__item-with-help {
|
|
29
|
+
margin-bottom: $form-item-with-help-margin-bottom;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 绝对定位布局需要重设底部间距
|
|
33
|
+
&.#{$prefix}-form__item-with-extra {
|
|
34
|
+
margin-bottom: $form-item-margin-bottom;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__label {
|
|
39
|
+
float: left;
|
|
40
|
+
padding-right: $form-label-padding-right;
|
|
41
|
+
vertical-align: middle;
|
|
42
|
+
line-height: $form-item-control-height;
|
|
43
|
+
color: $form-color-label;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
|
|
47
|
+
&--top {
|
|
48
|
+
float: none;
|
|
49
|
+
min-height: $form-item-control-height;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&--left {
|
|
53
|
+
text-align: left;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--right {
|
|
57
|
+
text-align: right;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--required:not(.#{$prefix}-form__label--required-right) {
|
|
61
|
+
label::before {
|
|
62
|
+
display: inline-block;
|
|
63
|
+
margin-right: $form-label-margin-right-required;
|
|
64
|
+
color: $form-color-error;
|
|
65
|
+
line-height: $form-label-line-height;
|
|
66
|
+
content: '*';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--required-right {
|
|
71
|
+
label::after {
|
|
72
|
+
display: inline-block;
|
|
73
|
+
margin-left: $form-label-margin-left-required;
|
|
74
|
+
color: $form-color-error;
|
|
75
|
+
line-height: $form-label-line-height;
|
|
76
|
+
content: '*';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--colon {
|
|
81
|
+
label::after {
|
|
82
|
+
content: ':';
|
|
83
|
+
position: relative;
|
|
84
|
+
margin: $form-label-margin-colon;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&__controls {
|
|
90
|
+
min-height: $form-item-control-height;
|
|
91
|
+
display: flow-root;
|
|
92
|
+
position: relative;
|
|
93
|
+
|
|
94
|
+
&-content {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
min-height: $form-item-control-height;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// formItem 嵌套情况无间距
|
|
101
|
+
.#{$prefix}-form__item {
|
|
102
|
+
margin-bottom: 0;
|
|
103
|
+
margin-right: $form-item-margin-right-inline;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&__controls.#{$prefix}-is-success {
|
|
108
|
+
@include input-status-icon(success);
|
|
109
|
+
@include input-status-extra(success);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__controls.#{$prefix}-form--success-border {
|
|
113
|
+
// 输入框状态
|
|
114
|
+
@include input-status(success);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__status {
|
|
118
|
+
display: flex;
|
|
119
|
+
margin: $form-status-margin;
|
|
120
|
+
|
|
121
|
+
> .t-icon {
|
|
122
|
+
font-size: $form-status-icon-size;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&-without-icon {
|
|
126
|
+
width: 25px;
|
|
127
|
+
height: 25px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
button {
|
|
131
|
+
width: $form-status-button-width;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
button + button {
|
|
135
|
+
margin-left: $form-status-button-margin;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.#{$prefix}-form-inline {
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-wrap: wrap;
|
|
143
|
+
row-gap: $form-item-row-gap;
|
|
144
|
+
|
|
145
|
+
.#{$prefix}-form__item {
|
|
146
|
+
margin: 0;
|
|
147
|
+
min-width: 200px;
|
|
148
|
+
display: inline-block;
|
|
149
|
+
margin-right: $form-item-margin-right-inline;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.#{$prefix}-input__extra,
|
|
154
|
+
.#{$prefix}-input__help {
|
|
155
|
+
margin: 0;
|
|
156
|
+
width: 100%;
|
|
157
|
+
height: auto;
|
|
158
|
+
min-height: $form-item-help-line-height;
|
|
159
|
+
font: $form-item-help-font;
|
|
160
|
+
color: $form-color-extra;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.#{$prefix}-input__extra {
|
|
164
|
+
position: absolute;
|
|
165
|
+
bottom: calc(0px - $form-item-help-line-height);
|
|
166
|
+
max-width: 100%;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
text-overflow: ellipsis;
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// 输入框状态
|
|
173
|
+
@include input-status(warning);
|
|
174
|
+
@include input-status(error);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
@mixin input-status($status) {
|
|
4
|
+
.#{$prefix}-is-#{$status} {
|
|
5
|
+
// 辅助文字
|
|
6
|
+
@include input-status-extra($status);
|
|
7
|
+
|
|
8
|
+
.#{$prefix}-form__controls-content {
|
|
9
|
+
// TODO: 兼容目前未使用SelectInput重构的组件的样式 全部重构后可以都由input层控制状态变化
|
|
10
|
+
.#{$prefix}-input,
|
|
11
|
+
.#{$prefix}-select,
|
|
12
|
+
.#{$prefix}-radio-button,
|
|
13
|
+
.#{$prefix}-cascader,
|
|
14
|
+
.#{$prefix}-range-input,
|
|
15
|
+
.#{$prefix}-textarea__inner {
|
|
16
|
+
border-color: map.get(map.get($input-color, border), $status);
|
|
17
|
+
|
|
18
|
+
&--focused {
|
|
19
|
+
box-shadow: 0 0 0 2px
|
|
20
|
+
map.get(map.get($input-color, box-shadow), $status);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 处理组件内icon颜色
|
|
24
|
+
.t-icon,
|
|
25
|
+
.#{$prefix}-fake-arrow {
|
|
26
|
+
color: map.get(map.get($input-color, border), $status);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.#{$prefix}-select {
|
|
31
|
+
> .#{$prefix}-select__right-icon:not(
|
|
32
|
+
.#{$prefix}-select__right-icon-clear
|
|
33
|
+
) {
|
|
34
|
+
color: map.get(map.get($input-color, border), $status);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.#{$prefix}-radio-button {
|
|
39
|
+
&:last-child {
|
|
40
|
+
border-right-color: map.get(map.get($input-color, border), $status);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.#{$prefix}-textarea__inner {
|
|
45
|
+
&.#{$prefix}-is-focused {
|
|
46
|
+
box-shadow: 0 0 0 2px map.get(map.get($input-color, border), $status);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.#{$prefix}-cascader,
|
|
51
|
+
.#{$prefix}-select {
|
|
52
|
+
&.#{$prefix}-is-active {
|
|
53
|
+
box-shadow: 0 0 0 2px
|
|
54
|
+
map.get(map.get($input-color, box-shadow), $status);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 右侧状态图标
|
|
59
|
+
@include input-status-icon($status);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@mixin input-status-icon($status) {
|
|
65
|
+
.#{$prefix}-form__status {
|
|
66
|
+
.t-icon {
|
|
67
|
+
color: map.get($form-color, $status);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@mixin input-status-extra($status) {
|
|
73
|
+
.#{$prefix}-input__extra {
|
|
74
|
+
color: map.get($form-color, $status);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// 组件变量
|
|
2
|
+
// 名称可按如下规则定义:
|
|
3
|
+
// <component>-[type]-[attrtype]-<attr>-[status]
|
|
4
|
+
|
|
5
|
+
// component:组件名,如button,
|
|
6
|
+
// type: 组件类型,如 button 的次要按钮(line)
|
|
7
|
+
// attrtype: 属性的具体应用场景。如颜色,用于背景(bg)、文本(text)、边框(border)等
|
|
8
|
+
// attr: 属性名称,如color、height、radius等
|
|
9
|
+
// status: 表示组件状态或尺寸,如 hover、disabled、s、l 等
|
|
10
|
+
|
|
11
|
+
// 如:$button-line-bg-color-hover
|
|
12
|
+
// 如:$button-line-height-s
|
|
13
|
+
//字体
|
|
14
|
+
|
|
15
|
+
$form-font: $font-body-medium;
|
|
16
|
+
$form-item-help-font: $font-body-small;
|
|
17
|
+
|
|
18
|
+
// 行高
|
|
19
|
+
$form-item-help-line-height: $text-line-height-s;
|
|
20
|
+
|
|
21
|
+
// 颜色
|
|
22
|
+
$form-color-label: $text-color-primary;
|
|
23
|
+
$form-color-error: $error-color;
|
|
24
|
+
$form-color-warning: $warning-color;
|
|
25
|
+
$form-color-success: $success-color;
|
|
26
|
+
$form-color-extra: $text-color-placeholder;
|
|
27
|
+
|
|
28
|
+
$form-color: (
|
|
29
|
+
label: $text-color-primary,
|
|
30
|
+
error: $error-color,
|
|
31
|
+
warning: $warning-color,
|
|
32
|
+
success: $success-color,
|
|
33
|
+
extra: $text-color-placeholder,
|
|
34
|
+
);
|
|
35
|
+
// 间距
|
|
36
|
+
$form-item-margin-bottom: $comp-margin-xxl;
|
|
37
|
+
$form-item-with-help-margin-bottom: $comp-margin-xs;
|
|
38
|
+
$form-item-control-height: $comp-margin-xxxl;
|
|
39
|
+
$form-item-row-gap: $comp-margin-l;
|
|
40
|
+
$form-item-padding-bottom: $comp-paddingTB-xs;
|
|
41
|
+
$form-item-margin-right-inline: $comp-margin-xxl;
|
|
42
|
+
|
|
43
|
+
$form-label-line-height: $text-line-height-base;
|
|
44
|
+
$form-label-padding-right: $comp-paddingLR-xl;
|
|
45
|
+
$form-label-margin-left-required: $comp-margin-xs;
|
|
46
|
+
$form-label-margin-right-required: $comp-margin-xs;
|
|
47
|
+
$form-label-margin-colon: 0 $comp-margin-xxs;
|
|
48
|
+
$form-status-margin: 0 $comp-margin-s;
|
|
49
|
+
$form-status-button-margin: $comp-margin-s;
|
|
50
|
+
$form-status-button-width: $comp-size-m;
|
|
51
|
+
$from-help-text-margin-top: $comp-margin-xs;
|
|
52
|
+
$form-status-icon-size: $comp-size-xxxs;
|
|
53
|
+
|
|
54
|
+
// status
|
|
55
|
+
$input-border-color-success: $success-color;
|
|
56
|
+
$input-box-shadow-color-success-focus: $success-color-focus;
|
|
57
|
+
$input-border-color-warning: $warning-color;
|
|
58
|
+
$input-box-shadow-color-warning-focus: $warning-color-focus;
|
|
59
|
+
$input-border-color-error: $error-color;
|
|
60
|
+
$input-box-shadow-color-error-focus: $error-color-focus;
|
|
61
|
+
|
|
62
|
+
$input-color: (
|
|
63
|
+
border: (
|
|
64
|
+
default: (
|
|
65
|
+
hover: $brand-color,
|
|
66
|
+
focus: $brand-color,
|
|
67
|
+
),
|
|
68
|
+
success: $success-color,
|
|
69
|
+
warning: $warning-color,
|
|
70
|
+
error: $error-color,
|
|
71
|
+
),
|
|
72
|
+
text: (
|
|
73
|
+
default: $text-color-primary,
|
|
74
|
+
success: $success-color,
|
|
75
|
+
warning: $warning-color,
|
|
76
|
+
error: $error-color,
|
|
77
|
+
readonly: $text-color-primary,
|
|
78
|
+
tips: $text-color-placeholder,
|
|
79
|
+
disabled: $text-color-disabled,
|
|
80
|
+
),
|
|
81
|
+
bg-color: (
|
|
82
|
+
default: $text-color-placeholder,
|
|
83
|
+
readonly: $bg-color-specialcomponent,
|
|
84
|
+
disabled: $bg-color-component-disabled,
|
|
85
|
+
),
|
|
86
|
+
extra: (
|
|
87
|
+
default: $text-color-placeholder,
|
|
88
|
+
success: $success-color,
|
|
89
|
+
warning: $warning-color,
|
|
90
|
+
error: $error-color,
|
|
91
|
+
),
|
|
92
|
+
append: $bg-color-secondarycontainer-hover,
|
|
93
|
+
limit: $text-color-placeholder,
|
|
94
|
+
box-shadow: (
|
|
95
|
+
default: $brand-color-focus,
|
|
96
|
+
success: $success-color-focus,
|
|
97
|
+
warning: $warning-color-focus,
|
|
98
|
+
error: $error-color-focus,
|
|
99
|
+
),
|
|
100
|
+
);
|