@neatui/css 4.6.0 → 4.7.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.
Files changed (32) hide show
  1. package/components/anim/am-view-aa.scss +17 -39
  2. package/components/anim/am-view-ab.scss +10 -50
  3. package/components/anim/am-view-ac.scss +27 -66
  4. package/components/anim/am-view-ad.scss +12 -62
  5. package/components/anim/am-view-ae.scss +10 -60
  6. package/components/anim/am-view-af.scss +23 -64
  7. package/components/anim/am-view-ag.scss +12 -293
  8. package/components/anim/am-view-ah.scss +7 -70
  9. package/components/anim/am-view-ai.scss +10 -67
  10. package/components/anim/am-view-aj.scss +9 -60
  11. package/components/anim/am-view-ak.scss +18 -59
  12. package/components/anim/am-view-al.scss +11 -50
  13. package/components/anim/am-view-am.scss +11 -49
  14. package/components/anim/am-view-an.scss +12 -62
  15. package/components/anim/am-view-ao.scss +21 -68
  16. package/components/anim/am-view-ap.scss +16 -47
  17. package/components/anim/am-view-aq.scss +14 -47
  18. package/components/anim/am-view-ar.scss +13 -63
  19. package/components/anim/am-view-as.scss +10 -50
  20. package/components/anim/am-view-at.scss +10 -54
  21. package/components/anim/am-view-core.scss +36 -0
  22. package/components/form/form@a/textarea.scss +2 -59
  23. package/components/form/form@b/textarea.scss +2 -59
  24. package/components/form/form@c/textarea.scss +5 -61
  25. package/components/form/form@d/textarea.scss +2 -59
  26. package/components/form/vars.scss +101 -0
  27. package/components/table/table@d.scss +7 -0
  28. package/dist/neatui.css +589 -860
  29. package/dist/neatui.min.css +13 -1
  30. package/dist/neatui.preview.css +589 -860
  31. package/dist/neatui.preview.min.css +13 -1
  32. package/package.json +1 -1
@@ -11,23 +11,18 @@ size 规定输入字段的宽度(以字符计)。
11
11
  step 规定输入字段的合法数字间隔。
12
12
  value 规定输入字段的默认值。
13
13
  */
14
- @use 'sass:math';
15
14
  @use '../vars.scss' as *;
16
15
 
17
16
  [ui-form~='@c'] {
18
17
  &[ui-form~='type:textarea'] {
19
- position: relative;
20
- min-width: 2.5em;
21
- line-height: 1.5em;
22
- padding: 0.5em;
23
- border-radius: 0.35em;
24
- transition: all 0.5s;
25
- border: 1px solid var(--bg-weak);
26
- background-color: var(--bg-weak);
18
+ @include textarea-structure(0.5em, 0.25em);
19
+
20
+ border: 1px solid var(--bg-weak, transparent);
21
+ background-color: var(--bg-weak, transparent);
27
22
 
28
23
  &.form-focus,
29
24
  &:focus-within {
30
- background-color: var(--bg-weak);
25
+ background-color: var(--bg-weak, transparent);
31
26
  border-color: var(--co-main-o-mm);
32
27
  box-shadow: 0 0 0 2px var(--co-main-o-ss);
33
28
  }
@@ -64,56 +59,5 @@ value 规定输入字段的默认值。
64
59
  }
65
60
  }
66
61
 
67
- textarea {
68
- width: 100%;
69
- }
70
-
71
- &[ui-form~='disabled'] {
72
- cursor: not-allowed;
73
- opacity: 0.5;
74
- textarea {
75
- cursor: not-allowed;
76
- }
77
- }
78
-
79
- &[ui-form~='readonly'] {
80
- cursor: text;
81
- textarea {
82
- cursor: text;
83
- }
84
- }
85
-
86
- &[ui-form~=':block'] {
87
- display: flex;
88
- width: 100%;
89
- flex-grow: 1;
90
- flex-shrink: 1;
91
- }
92
-
93
- &[ui-form~='preview'] {
94
- &,
95
- &:hover,
96
- &:focus-within {
97
- cursor: default;
98
- border-color: transparent !important;
99
- background-color: transparent !important;
100
- box-shadow: none !important;
101
- }
102
-
103
- textarea {
104
- cursor: default;
105
- }
106
- }
107
-
108
- $sz_base: 1.5em;
109
- @each $s in $form-sz {
110
- &[ui-form~='sz:#{$s}'] {
111
- textarea {
112
- height: $sz_base;
113
- min-height: $sz_base;
114
- }
115
- }
116
- $sz_base: $sz_base + 0.5;
117
- }
118
62
  }
119
63
  }
@@ -11,17 +11,11 @@ size 规定输入字段的宽度(以字符计)。
11
11
  step 规定输入字段的合法数字间隔。
12
12
  value 规定输入字段的默认值。
13
13
  */
14
- @use 'sass:math';
15
14
  @use '../vars.scss' as *;
16
15
 
17
16
  [ui-form~='@d'] {
18
17
  &[ui-form~='type:textarea'] {
19
- position: relative;
20
- min-width: 2.5em;
21
- line-height: 1.5em;
22
- padding: 0.5em;
23
- border-radius: 0.35em;
24
- transition: all 0.5s;
18
+ @include textarea-structure(0.5em, 0.25em);
25
19
 
26
20
  // @include theme {
27
21
  border: 1px solid var(--co-case);
@@ -73,7 +67,7 @@ value 规定输入字段的默认值。
73
67
  }
74
68
 
75
69
  &,
76
- textarea {
70
+ > textarea {
77
71
  &:-webkit-autofill {
78
72
  box-shadow: 0 0 0 1000px var(--co-fore) inset;
79
73
  color: var(--co-read);
@@ -85,56 +79,5 @@ value 规定输入字段的默认值。
85
79
  }
86
80
  }
87
81
 
88
- textarea {
89
- width: 100%;
90
- }
91
-
92
- &[ui-form~='disabled'] {
93
- cursor: not-allowed;
94
- opacity: 0.5;
95
- textarea {
96
- cursor: not-allowed;
97
- }
98
- }
99
-
100
- &[ui-form~='readonly'] {
101
- cursor: text;
102
- textarea {
103
- cursor: text;
104
- }
105
- }
106
-
107
- &[ui-form~=':block'] {
108
- display: flex;
109
- width: 100%;
110
- flex-grow: 1;
111
- flex-shrink: 1;
112
- }
113
-
114
- &[ui-form~='preview'] {
115
- &,
116
- &:hover,
117
- &:focus-within {
118
- cursor: default;
119
- border-color: transparent !important;
120
- background-color: transparent !important;
121
- box-shadow: none !important;
122
- }
123
-
124
- textarea {
125
- cursor: default;
126
- }
127
- }
128
-
129
- $sz_base: 1.5em;
130
- @each $s in $form-sz {
131
- &[ui-form~='sz:#{$s}'] {
132
- textarea {
133
- height: $sz_base;
134
- min-height: $sz_base;
135
- }
136
- }
137
- $sz_base: $sz_base + 0.5;
138
- }
139
82
  }
140
83
  }
@@ -1,2 +1,103 @@
1
1
  $form-co: 'main', 'info', 'well', 'warn', 'risk';
2
2
  $form-sz: 'xs', 's', 'm', 'l', 'xl';
3
+
4
+ @mixin textarea-structure($outer-inline-padding, $text-inline-padding, $border-block-size: 2px) {
5
+ --form-textarea-control-height: 2.5em;
6
+ --form-textarea-line-height: min(1.5em, calc(var(--form-textarea-control-height) - #{$border-block-size}));
7
+ --form-textarea-padding-block: max(
8
+ 0px,
9
+ calc((var(--form-textarea-control-height) - var(--form-textarea-line-height) - #{$border-block-size}) / 2)
10
+ );
11
+
12
+ position: relative;
13
+ min-width: 2.5em;
14
+ line-height: var(--form-textarea-line-height);
15
+ border-radius: 0.35em;
16
+ transition:
17
+ border-color 0.5s,
18
+ background-color 0.5s,
19
+ box-shadow 0.5s,
20
+ color 0.5s;
21
+ resize: none;
22
+
23
+ &:is(textarea) {
24
+ display: block;
25
+ width: 100%;
26
+ padding: var(--form-textarea-padding-block) ($outer-inline-padding + $text-inline-padding);
27
+ resize: none;
28
+ }
29
+
30
+ &:not(textarea) {
31
+ display: inline-flex;
32
+ align-items: flex-start;
33
+ padding: 0 $outer-inline-padding var(--form-textarea-padding-block);
34
+
35
+ > textarea {
36
+ flex: 1 1 auto;
37
+ width: 100%;
38
+ min-width: 0;
39
+ padding: var(--form-textarea-padding-block) $text-inline-padding 0;
40
+ border: 0;
41
+ line-height: inherit;
42
+ background-color: transparent;
43
+ resize: none;
44
+ }
45
+
46
+ > [ui-form-prefix],
47
+ > [ui-form-suffix] {
48
+ align-self: flex-start;
49
+ margin-top: calc(var(--form-textarea-padding-block) + (var(--form-textarea-line-height) - 1em) / 2);
50
+ }
51
+
52
+ &[ui-form~='auto-height'] > textarea {
53
+ overflow-y: hidden;
54
+ }
55
+ }
56
+
57
+ &[ui-form~='disabled'] {
58
+ cursor: not-allowed;
59
+ opacity: 0.5;
60
+
61
+ > textarea {
62
+ cursor: not-allowed;
63
+ }
64
+ }
65
+
66
+ &[ui-form~='readonly'] {
67
+ cursor: text;
68
+
69
+ > textarea {
70
+ cursor: text;
71
+ }
72
+ }
73
+
74
+ &[ui-form~=':block'] {
75
+ display: flex;
76
+ width: 100%;
77
+ flex-grow: 1;
78
+ flex-shrink: 1;
79
+ }
80
+
81
+ &[ui-form~='preview'] {
82
+ &,
83
+ &:hover,
84
+ &:focus-within {
85
+ cursor: default;
86
+ border-color: transparent !important;
87
+ background-color: transparent !important;
88
+ box-shadow: none !important;
89
+ }
90
+
91
+ > textarea {
92
+ cursor: default;
93
+ }
94
+ }
95
+
96
+ $size: 1.5em;
97
+ @each $name in $form-sz {
98
+ &[ui-form~='sz:#{$name}'] {
99
+ --form-textarea-control-height: #{$size};
100
+ }
101
+ $size: $size + 0.5;
102
+ }
103
+ }
@@ -5,6 +5,13 @@
5
5
  & {
6
6
  border-collapse: separate;
7
7
  border-spacing: 0 0.5em;
8
+ // border-spacing 会在首行上方也留空;固定表头时这条缝会跟着滚,整体上移抵消
9
+ margin-block-start: -0.5em;
10
+ }
11
+
12
+ // 固定头部需实底,避免行卡片从下方透出
13
+ .table-head-fixed {
14
+ background-color: var(--co-fore);
8
15
  }
9
16
 
10
17
  thead,