@alifd/chat 0.3.40-beta.0 → 0.3.40-beta.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 (241) hide show
  1. package/es/ai-loading/types.d.ts +1 -0
  2. package/es/button/button.d.ts +1 -2
  3. package/es/button/button.js +13 -19
  4. package/es/button/group.js +5 -42
  5. package/es/button/main.scss +36 -77
  6. package/es/card/main.scss +1 -1
  7. package/es/checkbox-group/main.scss +6 -7
  8. package/es/checkbox-group/types.d.ts +6 -0
  9. package/es/code-view/index.d.ts +11 -0
  10. package/es/code-view/index.js +63 -0
  11. package/es/code-view/main.scss +54 -0
  12. package/es/code-view/style.d.ts +4 -0
  13. package/es/code-view/style.js +4 -0
  14. package/es/code-view/types.d.ts +27 -0
  15. package/es/code-view/types.js +1 -0
  16. package/es/collapse/index.d.ts +157 -0
  17. package/es/collapse/index.js +20 -0
  18. package/es/collapse/main.scss +95 -0
  19. package/es/collapse/style.d.ts +2 -0
  20. package/es/collapse/style.js +2 -0
  21. package/es/collapse/types.d.ts +82 -0
  22. package/es/collapse/types.js +2 -0
  23. package/es/core/variables.scss +27 -12
  24. package/es/date-picker/DatePicker.d.ts +5 -0
  25. package/es/date-picker/DatePicker.js +15 -0
  26. package/es/date-picker/MonthPicker.d.ts +4 -0
  27. package/es/date-picker/MonthPicker.js +15 -0
  28. package/es/date-picker/RangePicker.d.ts +4 -0
  29. package/es/date-picker/RangePicker.js +17 -0
  30. package/es/date-picker/YearPicker.d.ts +4 -0
  31. package/es/date-picker/YearPicker.js +15 -0
  32. package/es/date-picker/index.d.ts +5 -23
  33. package/es/date-picker/index.js +11 -29
  34. package/es/date-picker/main.scss +23 -1
  35. package/es/date-picker/style.d.ts +1 -0
  36. package/es/date-picker/style.js +1 -0
  37. package/es/date-picker/types.d.ts +161 -81
  38. package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
  39. package/es/form/style.d.ts +0 -1
  40. package/es/form/style.js +2 -1
  41. package/es/form/types.d.ts +3 -517
  42. package/es/form/types.js +5 -1
  43. package/es/html-render/index.d.ts +1 -1
  44. package/es/html-render/index.js +118 -106
  45. package/es/html-render/main.scss +27 -8
  46. package/es/html-render/style.d.ts +1 -0
  47. package/es/html-render/style.js +1 -0
  48. package/es/icon/index.d.ts +1 -1
  49. package/es/index.d.ts +3 -0
  50. package/es/index.js +4 -1
  51. package/es/input/index.d.ts +1 -1
  52. package/es/input/index.js +16 -6
  53. package/es/input/main.scss +25 -0
  54. package/es/input/style.d.ts +1 -0
  55. package/es/input/style.js +1 -0
  56. package/es/input/types.d.ts +58 -15
  57. package/es/markdown/index.d.ts +1 -2
  58. package/es/markdown/index.js +26 -15
  59. package/es/markdown/main.scss +4 -3
  60. package/es/markdown/style.d.ts +2 -1
  61. package/es/markdown/style.js +2 -1
  62. package/es/markdown/types.d.ts +20 -9
  63. package/es/message/index.d.ts +4 -4
  64. package/es/person-picker/index.d.ts +3 -190
  65. package/es/person-picker/index.js +23 -21
  66. package/es/person-picker/main.scss +15 -1
  67. package/es/person-picker/types.d.ts +53 -11
  68. package/es/radio-group/index.d.ts +1 -1
  69. package/es/radio-group/index.js +9 -3
  70. package/es/radio-group/main.scss +13 -5
  71. package/es/radio-group/types.d.ts +5 -3
  72. package/es/reference/index.d.ts +1 -1
  73. package/es/reference/index.js +14 -15
  74. package/es/reference/main.scss +1 -1
  75. package/es/reference/types.d.ts +1 -0
  76. package/es/select/button.d.ts +3 -0
  77. package/es/select/button.js +70 -0
  78. package/es/select/index.d.ts +79 -79
  79. package/es/select/index.js +13 -57
  80. package/es/select/main.scss +22 -4
  81. package/es/select/types.d.ts +108 -1
  82. package/es/step/index.js +2 -2
  83. package/es/step/main.scss +115 -66
  84. package/es/step/types.d.ts +13 -2
  85. package/es/table/index.d.ts +12 -0
  86. package/es/table/index.js +23 -0
  87. package/es/table/main.scss +30 -0
  88. package/es/table/style.d.ts +2 -0
  89. package/es/table/style.js +2 -0
  90. package/es/table/types.d.ts +98 -0
  91. package/es/table/types.js +1 -0
  92. package/es/tag/index.d.ts +5 -3
  93. package/es/tag/index.js +18 -2
  94. package/es/tag/main.scss +20 -4
  95. package/es/tag/types.d.ts +55 -0
  96. package/es/text/index.js +1 -1
  97. package/es/text/main.scss +4 -1
  98. package/es/text/types.d.ts +8 -0
  99. package/es/time-picker/index.d.ts +6 -15
  100. package/es/time-picker/index.js +71 -24
  101. package/es/time-picker/main.scss +19 -1
  102. package/es/time-picker/style.d.ts +1 -0
  103. package/es/time-picker/style.js +1 -0
  104. package/es/time-picker/types.d.ts +133 -8
  105. package/es/tool-status/index.d.ts +1 -1
  106. package/es/tool-status/index.js +1 -1
  107. package/es/tool-status/main.scss +2 -1
  108. package/es/tool-status/types.d.ts +7 -2
  109. package/es/utils/func.d.ts +1 -0
  110. package/es/utils/func.js +13 -0
  111. package/es/utils/github-dark.scss +137 -0
  112. package/es/utils/github.scss +137 -0
  113. package/es/utils/hoc/main.scss +166 -0
  114. package/es/utils/hoc/withLabel.d.ts +94 -0
  115. package/es/utils/hoc/withLabel.js +57 -0
  116. package/es/utils/index.d.ts +1 -0
  117. package/es/utils/index.js +1 -0
  118. package/lib/ai-loading/types.d.ts +1 -0
  119. package/lib/button/button.d.ts +1 -2
  120. package/lib/button/button.js +13 -19
  121. package/lib/button/group.js +4 -41
  122. package/lib/button/main.scss +36 -77
  123. package/lib/card/main.scss +1 -1
  124. package/lib/checkbox-group/main.scss +6 -7
  125. package/lib/checkbox-group/types.d.ts +6 -0
  126. package/lib/code-view/index.d.ts +11 -0
  127. package/lib/code-view/index.js +66 -0
  128. package/lib/code-view/main.scss +54 -0
  129. package/lib/code-view/style.d.ts +4 -0
  130. package/lib/code-view/style.js +6 -0
  131. package/lib/code-view/types.d.ts +27 -0
  132. package/lib/code-view/types.js +2 -0
  133. package/lib/collapse/index.d.ts +157 -0
  134. package/lib/collapse/index.js +22 -0
  135. package/lib/collapse/main.scss +95 -0
  136. package/lib/collapse/style.d.ts +2 -0
  137. package/lib/collapse/style.js +4 -0
  138. package/lib/collapse/types.d.ts +82 -0
  139. package/lib/collapse/types.js +3 -0
  140. package/lib/core/variables.scss +27 -12
  141. package/lib/date-picker/DatePicker.d.ts +5 -0
  142. package/lib/date-picker/DatePicker.js +17 -0
  143. package/lib/date-picker/MonthPicker.d.ts +4 -0
  144. package/lib/date-picker/MonthPicker.js +17 -0
  145. package/lib/date-picker/RangePicker.d.ts +4 -0
  146. package/lib/date-picker/RangePicker.js +19 -0
  147. package/lib/date-picker/YearPicker.d.ts +4 -0
  148. package/lib/date-picker/YearPicker.js +17 -0
  149. package/lib/date-picker/index.d.ts +5 -23
  150. package/lib/date-picker/index.js +10 -27
  151. package/lib/date-picker/main.scss +23 -1
  152. package/lib/date-picker/style.d.ts +1 -0
  153. package/lib/date-picker/style.js +1 -0
  154. package/lib/date-picker/types.d.ts +161 -81
  155. package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
  156. package/lib/form/style.d.ts +0 -1
  157. package/lib/form/style.js +1 -2
  158. package/lib/form/types.d.ts +3 -517
  159. package/lib/form/types.js +4 -1
  160. package/lib/html-render/index.d.ts +1 -1
  161. package/lib/html-render/index.js +118 -106
  162. package/lib/html-render/main.scss +27 -8
  163. package/lib/html-render/style.d.ts +1 -0
  164. package/lib/html-render/style.js +1 -0
  165. package/lib/icon/index.d.ts +1 -1
  166. package/lib/index.d.ts +3 -0
  167. package/lib/index.js +8 -2
  168. package/lib/input/index.d.ts +1 -1
  169. package/lib/input/index.js +16 -6
  170. package/lib/input/main.scss +25 -0
  171. package/lib/input/style.d.ts +1 -0
  172. package/lib/input/style.js +1 -0
  173. package/lib/input/types.d.ts +58 -15
  174. package/lib/markdown/index.d.ts +1 -2
  175. package/lib/markdown/index.js +26 -15
  176. package/lib/markdown/main.scss +4 -3
  177. package/lib/markdown/style.d.ts +2 -1
  178. package/lib/markdown/style.js +2 -1
  179. package/lib/markdown/types.d.ts +20 -9
  180. package/lib/message/index.d.ts +4 -4
  181. package/lib/person-picker/index.d.ts +3 -190
  182. package/lib/person-picker/index.js +22 -20
  183. package/lib/person-picker/main.scss +15 -1
  184. package/lib/person-picker/types.d.ts +53 -11
  185. package/lib/radio-group/index.d.ts +1 -1
  186. package/lib/radio-group/index.js +8 -2
  187. package/lib/radio-group/main.scss +13 -5
  188. package/lib/radio-group/types.d.ts +5 -3
  189. package/lib/reference/index.d.ts +1 -1
  190. package/lib/reference/index.js +17 -18
  191. package/lib/reference/main.scss +1 -1
  192. package/lib/reference/types.d.ts +1 -0
  193. package/lib/select/button.d.ts +3 -0
  194. package/lib/select/button.js +74 -0
  195. package/lib/select/index.d.ts +79 -79
  196. package/lib/select/index.js +11 -55
  197. package/lib/select/main.scss +22 -4
  198. package/lib/select/types.d.ts +108 -1
  199. package/lib/step/index.js +2 -2
  200. package/lib/step/main.scss +115 -66
  201. package/lib/step/types.d.ts +13 -2
  202. package/lib/table/index.d.ts +12 -0
  203. package/lib/table/index.js +25 -0
  204. package/lib/table/main.scss +30 -0
  205. package/lib/table/style.d.ts +2 -0
  206. package/lib/table/style.js +4 -0
  207. package/lib/table/types.d.ts +98 -0
  208. package/lib/table/types.js +2 -0
  209. package/lib/tag/index.d.ts +5 -3
  210. package/lib/tag/index.js +17 -1
  211. package/lib/tag/main.scss +20 -4
  212. package/lib/tag/types.d.ts +55 -0
  213. package/lib/text/index.js +1 -1
  214. package/lib/text/main.scss +4 -1
  215. package/lib/text/types.d.ts +8 -0
  216. package/lib/time-picker/index.d.ts +6 -15
  217. package/lib/time-picker/index.js +71 -23
  218. package/lib/time-picker/main.scss +19 -1
  219. package/lib/time-picker/style.d.ts +1 -0
  220. package/lib/time-picker/style.js +1 -0
  221. package/lib/time-picker/types.d.ts +133 -8
  222. package/lib/tool-status/index.d.ts +1 -1
  223. package/lib/tool-status/index.js +1 -1
  224. package/lib/tool-status/main.scss +2 -1
  225. package/lib/tool-status/types.d.ts +7 -2
  226. package/lib/utils/func.d.ts +1 -0
  227. package/lib/utils/func.js +15 -0
  228. package/lib/utils/github-dark.scss +137 -0
  229. package/lib/utils/github.scss +137 -0
  230. package/lib/utils/hoc/main.scss +166 -0
  231. package/lib/utils/hoc/withLabel.d.ts +94 -0
  232. package/lib/utils/hoc/withLabel.js +60 -0
  233. package/lib/utils/index.d.ts +1 -0
  234. package/lib/utils/index.js +1 -0
  235. package/package.json +49 -4
  236. package/es/form/index.d.ts +0 -23
  237. package/es/form/index.js +0 -33
  238. package/es/form/main.scss +0 -5
  239. package/lib/form/index.d.ts +0 -23
  240. package/lib/form/index.js +0 -35
  241. package/lib/form/main.scss +0 -5
@@ -0,0 +1,137 @@
1
+ .ct-hljs-dark {
2
+ pre code.hljs {
3
+ display: block;
4
+ overflow-x: auto;
5
+ padding: 1em
6
+ }
7
+
8
+ code.hljs {
9
+ padding: 3px 5px
10
+ }
11
+
12
+ /*!
13
+ Theme: GitHub Dark
14
+ Description: Dark theme as seen on github.com
15
+ Author: github.com
16
+ Maintainer: @Hirse
17
+ Updated: 2021-05-15
18
+
19
+ Outdated base version: https://github.com/primer/github-syntax-dark
20
+ Current colors taken from GitHub's CSS
21
+ */
22
+ .hljs {
23
+ color: #c9d1d9;
24
+ background: #0d1117
25
+ }
26
+
27
+ .hljs-doctag,
28
+ .hljs-keyword,
29
+ .hljs-meta .hljs-keyword,
30
+ .hljs-template-tag,
31
+ .hljs-template-variable,
32
+ .hljs-type,
33
+ .hljs-variable.language_ {
34
+ /* prettylights-syntax-keyword */
35
+ color: #ff7b72
36
+ }
37
+
38
+ .hljs-title,
39
+ .hljs-title.class_,
40
+ .hljs-title.class_.inherited__,
41
+ .hljs-title.function_ {
42
+ /* prettylights-syntax-entity */
43
+ color: #d2a8ff
44
+ }
45
+
46
+ .hljs-attr,
47
+ .hljs-attribute,
48
+ .hljs-literal,
49
+ .hljs-meta,
50
+ .hljs-number,
51
+ .hljs-operator,
52
+ .hljs-variable,
53
+ .hljs-selector-attr,
54
+ .hljs-selector-class,
55
+ .hljs-selector-id {
56
+ /* prettylights-syntax-constant */
57
+ color: #79c0ff
58
+ }
59
+
60
+ .hljs-regexp,
61
+ .hljs-string,
62
+ .hljs-meta .hljs-string {
63
+ /* prettylights-syntax-string */
64
+ color: #a5d6ff
65
+ }
66
+
67
+ .hljs-built_in,
68
+ .hljs-symbol {
69
+ /* prettylights-syntax-variable */
70
+ color: #ffa657
71
+ }
72
+
73
+ .hljs-comment,
74
+ .hljs-code,
75
+ .hljs-formula {
76
+ /* prettylights-syntax-comment */
77
+ color: #8b949e
78
+ }
79
+
80
+ .hljs-name,
81
+ .hljs-quote,
82
+ .hljs-selector-tag,
83
+ .hljs-selector-pseudo {
84
+ /* prettylights-syntax-entity-tag */
85
+ color: #7ee787
86
+ }
87
+
88
+ .hljs-subst {
89
+ /* prettylights-syntax-storage-modifier-import */
90
+ color: #c9d1d9
91
+ }
92
+
93
+ .hljs-section {
94
+ /* prettylights-syntax-markup-heading */
95
+ color: #1f6feb;
96
+ font-weight: bold
97
+ }
98
+
99
+ .hljs-bullet {
100
+ /* prettylights-syntax-markup-list */
101
+ color: #f2cc60
102
+ }
103
+
104
+ .hljs-emphasis {
105
+ /* prettylights-syntax-markup-italic */
106
+ color: #c9d1d9;
107
+ font-style: italic
108
+ }
109
+
110
+ .hljs-strong {
111
+ /* prettylights-syntax-markup-bold */
112
+ color: #c9d1d9;
113
+ font-weight: bold
114
+ }
115
+
116
+ .hljs-addition {
117
+ /* prettylights-syntax-markup-inserted */
118
+ color: #aff5b4;
119
+ background-color: #033a16
120
+ }
121
+
122
+ .hljs-deletion {
123
+ /* prettylights-syntax-markup-deleted */
124
+ color: #ffdcd7;
125
+ background-color: #67060c
126
+ }
127
+
128
+ .hljs-char.escape_,
129
+ .hljs-link,
130
+ .hljs-params,
131
+ .hljs-property,
132
+ .hljs-punctuation,
133
+ .hljs-tag {
134
+ /* purposely ignored */
135
+
136
+ }
137
+ }
@@ -0,0 +1,137 @@
1
+ .ct-hljs-light {
2
+ pre code.hljs {
3
+ display: block;
4
+ overflow-x: auto;
5
+ padding: 1em
6
+ }
7
+
8
+ code.hljs {
9
+ padding: 3px 5px
10
+ }
11
+
12
+ /*!
13
+ Theme: GitHub
14
+ Description: Light theme as seen on github.com
15
+ Author: github.com
16
+ Maintainer: @Hirse
17
+ Updated: 2021-05-15
18
+
19
+ Outdated base version: https://github.com/primer/github-syntax-light
20
+ Current colors taken from GitHub's CSS
21
+ */
22
+ .hljs {
23
+ color: #24292e;
24
+ background: #ffffff
25
+ }
26
+
27
+ .hljs-doctag,
28
+ .hljs-keyword,
29
+ .hljs-meta .hljs-keyword,
30
+ .hljs-template-tag,
31
+ .hljs-template-variable,
32
+ .hljs-type,
33
+ .hljs-variable.language_ {
34
+ /* prettylights-syntax-keyword */
35
+ color: #d73a49
36
+ }
37
+
38
+ .hljs-title,
39
+ .hljs-title.class_,
40
+ .hljs-title.class_.inherited__,
41
+ .hljs-title.function_ {
42
+ /* prettylights-syntax-entity */
43
+ color: #6f42c1
44
+ }
45
+
46
+ .hljs-attr,
47
+ .hljs-attribute,
48
+ .hljs-literal,
49
+ .hljs-meta,
50
+ .hljs-number,
51
+ .hljs-operator,
52
+ .hljs-variable,
53
+ .hljs-selector-attr,
54
+ .hljs-selector-class,
55
+ .hljs-selector-id {
56
+ /* prettylights-syntax-constant */
57
+ color: #005cc5
58
+ }
59
+
60
+ .hljs-regexp,
61
+ .hljs-string,
62
+ .hljs-meta .hljs-string {
63
+ /* prettylights-syntax-string */
64
+ color: #032f62
65
+ }
66
+
67
+ .hljs-built_in,
68
+ .hljs-symbol {
69
+ /* prettylights-syntax-variable */
70
+ color: #e36209
71
+ }
72
+
73
+ .hljs-comment,
74
+ .hljs-code,
75
+ .hljs-formula {
76
+ /* prettylights-syntax-comment */
77
+ color: #6a737d
78
+ }
79
+
80
+ .hljs-name,
81
+ .hljs-quote,
82
+ .hljs-selector-tag,
83
+ .hljs-selector-pseudo {
84
+ /* prettylights-syntax-entity-tag */
85
+ color: #22863a
86
+ }
87
+
88
+ .hljs-subst {
89
+ /* prettylights-syntax-storage-modifier-import */
90
+ color: #24292e
91
+ }
92
+
93
+ .hljs-section {
94
+ /* prettylights-syntax-markup-heading */
95
+ color: #005cc5;
96
+ font-weight: bold
97
+ }
98
+
99
+ .hljs-bullet {
100
+ /* prettylights-syntax-markup-list */
101
+ color: #735c0f
102
+ }
103
+
104
+ .hljs-emphasis {
105
+ /* prettylights-syntax-markup-italic */
106
+ color: #24292e;
107
+ font-style: italic
108
+ }
109
+
110
+ .hljs-strong {
111
+ /* prettylights-syntax-markup-bold */
112
+ color: #24292e;
113
+ font-weight: bold
114
+ }
115
+
116
+ .hljs-addition {
117
+ /* prettylights-syntax-markup-inserted */
118
+ color: #22863a;
119
+ background-color: #f0fff4
120
+ }
121
+
122
+ .hljs-deletion {
123
+ /* prettylights-syntax-markup-deleted */
124
+ color: #b31d28;
125
+ background-color: #ffeef0
126
+ }
127
+
128
+ .hljs-char.escape_,
129
+ .hljs-link,
130
+ .hljs-params,
131
+ .hljs-property,
132
+ .hljs-punctuation,
133
+ .hljs-tag {
134
+ /* purposely ignored */
135
+
136
+ }
137
+ }
@@ -0,0 +1,166 @@
1
+ @import "../../core/variables.scss";
2
+
3
+ .#{$prefix}field-wrapper {
4
+ &-hover-enabled {
5
+ &:not(.#{$prefix}field-wrapper-disabled, .#{$prefix}field-wrapper-readonly) {
6
+
7
+ &.#{$prefix}field-wrapper-focused,
8
+ &:hover {
9
+ border-color: var(--input-focus-border-color, #5584FF);
10
+ background-color: var(--input-focus-bg-color, #FFFFFF);
11
+ box-shadow: 0 0 0 var(--input-focus-shadow-spread, 2px) var(--color-calculate-input-focus-shadow, rgba(85, 132, 255, 0.2));
12
+ }
13
+ }
14
+ }
15
+
16
+ &-style {
17
+ background: var(--color-fill1-1, #f6f8fc);
18
+ border-radius: var(--form-element-medium-corner, 3px);
19
+ border: var(--input-border-width, 1px) solid var(--color-fill1-1, #f6f8fc);
20
+ }
21
+
22
+ &-medium {
23
+ width: 100%;
24
+ }
25
+
26
+ /**
27
+ * 组件的整体布局
28
+ * horizontal: 水平布局
29
+ * vertical: 垂直布局
30
+ */
31
+ &-horizontal {
32
+ flex-direction: row;
33
+ align-items: center;
34
+ display: inline-flex;
35
+ width: 100%;
36
+ align-items: flex-start;
37
+
38
+ .#{$prefix}field-wrapper-content {
39
+ width: 100%;
40
+ position: relative;
41
+ }
42
+
43
+ .#{$prefix}label-required::before {
44
+ position: absolute;
45
+ left: 4px;
46
+ }
47
+
48
+ .#{$prefix}label {
49
+ max-width: 9em;
50
+ padding: var(--input-m-label-padding-left, 8px) 0;
51
+ padding-left: 12px;
52
+ }
53
+ }
54
+
55
+ &-vertical {
56
+ flex-direction: column;
57
+ align-items: flex-start;
58
+ display: inline-flex;
59
+ width: 100%;
60
+
61
+ .#{$prefix}label {
62
+ padding-left: 0;
63
+ margin-left: 0;
64
+ color: var(--color-text1-3, #6A6C70);
65
+ margin-bottom: var(--s-2, 8px);
66
+ line-height: 20px;
67
+ }
68
+
69
+ .#{$prefix}field-wrapper-content {
70
+ width: 100%;
71
+ }
72
+
73
+ .#{$prefix}label-required::before {
74
+ display: none;
75
+ }
76
+ .#{$prefix}label-required::after {
77
+ content: "*";
78
+ color: var(--color-error-3, #F34810);
79
+ margin-left: 2px;
80
+ font-size: calc(var(--form-element-medium-font-size, 12px) - 2px);
81
+ display: inline;
82
+ }
83
+ }
84
+
85
+ .#{$prefix}label {
86
+ position: relative;
87
+ color: var(--input-label-color, #666);
88
+ display: inline-block;
89
+ flex-shrink: 0;
90
+ flex-grow: 0;
91
+ overflow: hidden;
92
+ text-overflow: ellipsis;
93
+ font-size: var(--form-element-medium-font-size, 12px);
94
+ line-height: 17px;
95
+
96
+ &-text {
97
+ display: block;
98
+ }
99
+
100
+ &-required::before {
101
+ content: "*";
102
+ color: var(--color-error-3, #F34810);
103
+ margin-right: 2px;
104
+ }
105
+
106
+ &.#{$prefix}label-required::before {
107
+ font-size: calc(var(--form-element-medium-font-size, 12px) - 2px);
108
+ }
109
+ }
110
+
111
+ &-content {
112
+ min-width: 120px;
113
+ flex-grow: 1;
114
+ flex-shrink: 1;
115
+ align-items: stretch;
116
+ display: inline-flex;
117
+ }
118
+
119
+ &-error {
120
+ border-color: var(--input-feedback-error-border-color, #FF3000);
121
+ background-color: var(--input-feedback-error-bg-color, #FFFFFF);
122
+ }
123
+
124
+ &-disabled {
125
+ cursor: not-allowed;
126
+ background-color: var(--input-disabled-bg-color, #F6F8FC);
127
+
128
+ .#{$prefix}label {
129
+ cursor: not-allowed;
130
+ }
131
+
132
+ .#{$prefix}content {
133
+ cursor: not-allowed;
134
+ }
135
+
136
+ ;
137
+ }
138
+
139
+ .next-input {
140
+ box-shadow: none !important;
141
+ background-color: transparent;
142
+ border: transparent !important;
143
+ width: 100%;
144
+ }
145
+
146
+ .next-date-picker2-input,
147
+ .next-time-picker2-input {
148
+ border: none !important;
149
+ background-color: transparent !important;
150
+ box-shadow: none !important;
151
+ }
152
+
153
+ .ct-date-picker2,
154
+ .ct-time-picker2 {
155
+ width: 100%;
156
+
157
+ .next-input {
158
+ display: inline-flex;
159
+ align-items: center;
160
+ }
161
+
162
+ .next-input-control {
163
+ width: 20px;
164
+ }
165
+ }
166
+ }
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import './main.scss';
3
+ export interface WithLabelProps {
4
+ /**
5
+ * 标签文本
6
+ * @en Label text
7
+ */
8
+ label?: React.ReactNode;
9
+ /**
10
+ * 标签布局方式
11
+ * @en Label layout mode
12
+ */
13
+ labelLayout?: 'horizontal' | 'vertical';
14
+ /**
15
+ * 组件尺寸
16
+ * @en Component size
17
+ */
18
+ size?: 'small' | 'medium' | 'large';
19
+ /**
20
+ * 状态
21
+ * @en Component state
22
+ */
23
+ state?: 'error' | 'warning' | 'loading' | 'normal';
24
+ /**
25
+ * 是否禁用
26
+ * @en Whether the component is disabled
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * 包装器的类名
31
+ * @en Wrapper className
32
+ */
33
+ className?: string;
34
+ /**
35
+ * 包装器的样式
36
+ * @en Wrapper style
37
+ */
38
+ style?: React.CSSProperties;
39
+ /**
40
+ * 是否必填
41
+ * @en Whether the field is required
42
+ */
43
+ required?: boolean;
44
+ /**
45
+ * 是否只读
46
+ * @en Whether the field is readonly
47
+ */
48
+ readOnly?: boolean;
49
+ /**
50
+ * 获取焦点时的回调
51
+ * @en Callback when component gets focus
52
+ */
53
+ onFocus?: (e: React.FocusEvent<any>) => void;
54
+ /**
55
+ * 失去焦点时的回调
56
+ * @en Callback when component loses focus
57
+ */
58
+ onBlur?: (e: React.FocusEvent<any>) => void;
59
+ /**
60
+ * label 宽度
61
+ */
62
+ labelWidth?: string;
63
+ }
64
+ type ComponentWithLabelProps<P> = P & WithLabelProps;
65
+ interface WithLabelConfig {
66
+ /**
67
+ * 标签布局方式
68
+ * - horizontal: 水平布局
69
+ * - vertical: 垂直布局
70
+ * @defaultValue 'horizontal'
71
+ */
72
+ labelLayout?: 'horizontal' | 'vertical';
73
+ /**
74
+ * 使用默认样式
75
+ */
76
+ coverStyle?: boolean;
77
+ /**
78
+ * 是否启用悬停状态样式
79
+ * @defaultValue true
80
+ */
81
+ enableHoverState?: boolean;
82
+ /**
83
+ * 是否启用焦点状态样式
84
+ * @defaultValue true
85
+ */
86
+ enableFocusState?: boolean;
87
+ /**
88
+ * 是否启用禁用状态样式
89
+ * @defaultValue true
90
+ */
91
+ enableDisabledState?: boolean;
92
+ }
93
+ export declare function withLabel<P>(WrappedComponent: React.ComponentType<P>, defaultConfig?: WithLabelConfig): React.ForwardRefExoticComponent<React.PropsWithoutRef<ComponentWithLabelProps<P>> & React.RefAttributes<any>>;
94
+ export {};
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withLabel = withLabel;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
7
+ const index_1 = require("../index");
8
+ require("./main.scss");
9
+ function withLabel(WrappedComponent, defaultConfig = {}) {
10
+ const WithLabel = react_1.default.forwardRef((props, ref) => {
11
+ var _a;
12
+ const { label, size = 'medium', state, disabled, className, style, required, readOnly: readonly, onFocus, onBlur, labelLayout: propsLabelLayout, labelWidth } = props, rest = tslib_1.__rest(props, ["label", "size", "state", "disabled", "className", "style", "required", "readOnly", "onFocus", "onBlur", "labelLayout", "labelWidth"]);
13
+ const { labelLayout: defaultLabelLayout, coverStyle = true, enableHoverState = true, enableFocusState = true, enableDisabledState = true } = defaultConfig;
14
+ // Use defaultConfig labelLayout as higher priority
15
+ const labelLayout = (_a = defaultLabelLayout !== null && defaultLabelLayout !== void 0 ? defaultLabelLayout : propsLabelLayout) !== null && _a !== void 0 ? _a : 'horizontal';
16
+ const [focused, setFocused] = react_1.default.useState(false);
17
+ const handleFocus = react_1.default.useCallback((e) => {
18
+ if (enableFocusState) {
19
+ setFocused(true);
20
+ }
21
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
22
+ }, [onFocus, enableFocusState]);
23
+ const handleBlur = react_1.default.useCallback((e) => {
24
+ if (enableFocusState) {
25
+ setFocused(false);
26
+ }
27
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
28
+ }, [onBlur, enableFocusState]);
29
+ const wrapperClassName = (0, classnames_1.default)({
30
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-style`]: coverStyle,
31
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-${size}`]: size,
32
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-${state}`]: coverStyle && state && state !== 'normal',
33
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-disabled`]: enableDisabledState && disabled,
34
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-readonly`]: enableDisabledState && readonly,
35
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-focused`]: enableFocusState && focused && state !== 'error' && state !== 'warning',
36
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-hover-enabled`]: enableHoverState && state !== 'error' && state !== 'warning',
37
+ [`${index_1.PREFIX_DEFAULT}field-wrapper-${labelLayout}`]: label,
38
+ }, className);
39
+ const labelElement = label ? (react_1.default.createElement("label", { className: (0, classnames_1.default)({
40
+ [`${index_1.PREFIX_DEFAULT}label`]: true,
41
+ [`${index_1.PREFIX_DEFAULT}label-required`]: required
42
+ }) },
43
+ react_1.default.createElement("span", { className: `${index_1.PREFIX_DEFAULT}label-text`, style: {
44
+ width: labelLayout === 'horizontal' && labelWidth ? labelWidth : 'auto',
45
+ } }, label))) : null;
46
+ if (labelLayout === 'vertical') {
47
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)(`${index_1.PREFIX_DEFAULT}field-wrapper-vertical`, `${index_1.PREFIX_DEFAULT}field-wrapper`) },
48
+ labelElement,
49
+ react_1.default.createElement("div", { className: wrapperClassName, style: style },
50
+ react_1.default.createElement("span", { className: `${index_1.PREFIX_DEFAULT}field-wrapper-content` },
51
+ react_1.default.createElement(WrappedComponent, Object.assign({}, rest, { ref: ref, size: size, state: state, disabled: disabled, readonly: readonly, onFocus: handleFocus, onBlur: handleBlur }))))));
52
+ }
53
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)(wrapperClassName, `${index_1.PREFIX_DEFAULT}field-wrapper`, `${index_1.PREFIX_DEFAULT}field-wrapper-horizontal`), style: style },
54
+ labelElement,
55
+ react_1.default.createElement("span", { className: `${index_1.PREFIX_DEFAULT}field-wrapper-content` },
56
+ react_1.default.createElement(WrappedComponent, Object.assign({}, rest, { ref: ref, size: size, state: state, disabled: disabled, readonly: readonly, onFocus: handleFocus, onBlur: handleBlur })))));
57
+ });
58
+ WithLabel.displayName = `WithLabel(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;
59
+ return WithLabel;
60
+ }
@@ -2,6 +2,7 @@ export * from './consts';
2
2
  export * from './types';
3
3
  export * from './common';
4
4
  export * from './func';
5
+ export * from './hoc/withLabel';
5
6
  export { useControlable } from './hooks/useControlable';
6
7
  export { useDebounce } from './hooks/useDebounce';
7
8
  export { useThrottle } from './hooks/useThrottle';
@@ -6,6 +6,7 @@ tslib_1.__exportStar(require("./consts"), exports);
6
6
  tslib_1.__exportStar(require("./types"), exports);
7
7
  tslib_1.__exportStar(require("./common"), exports);
8
8
  tslib_1.__exportStar(require("./func"), exports);
9
+ tslib_1.__exportStar(require("./hoc/withLabel"), exports);
9
10
  var useControlable_1 = require("./hooks/useControlable");
10
11
  Object.defineProperty(exports, "useControlable", { enumerable: true, get: function () { return useControlable_1.useControlable; } });
11
12
  var useDebounce_1 = require("./hooks/useDebounce");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alifd/chat",
3
- "version": "0.3.40-beta.0",
3
+ "version": "0.3.40-beta.1",
4
4
  "description": "A configurable component library for chat built on React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -465,6 +465,42 @@
465
465
  "./tool-status/style.js": {
466
466
  "import": "./es/tool-status/style.js",
467
467
  "require": "./lib/tool-status/style.js"
468
+ },
469
+ "./code-view": {
470
+ "import": "./es/code-view/index.js",
471
+ "require": "./lib/code-view/index.js"
472
+ },
473
+ "./code-view/style": {
474
+ "import": "./es/code-view/style.js",
475
+ "require": "./lib/code-view/style.js"
476
+ },
477
+ "./code-view/style.js": {
478
+ "import": "./es/code-view/style.js",
479
+ "require": "./lib/code-view/style.js"
480
+ },
481
+ "./collapse": {
482
+ "import": "./es/collapse/index.js",
483
+ "require": "./lib/collapse/index.js"
484
+ },
485
+ "./collapse/style": {
486
+ "import": "./es/collapse/style.js",
487
+ "require": "./lib/collapse/style.js"
488
+ },
489
+ "./collapse/style.js": {
490
+ "import": "./es/collapse/style.js",
491
+ "require": "./lib/collapse/style.js"
492
+ },
493
+ "./table": {
494
+ "import": "./es/table/index.js",
495
+ "require": "./lib/table/index.js"
496
+ },
497
+ "./table/style": {
498
+ "import": "./es/table/style.js",
499
+ "require": "./lib/table/style.js"
500
+ },
501
+ "./table/style.js": {
502
+ "import": "./es/table/style.js",
503
+ "require": "./lib/table/style.js"
468
504
  }
469
505
  },
470
506
  "files": [
@@ -479,7 +515,15 @@
479
515
  "build:lib": "rm -rf lib && tsc -p ./tsconfig.build.json --outDir lib --module commonjs",
480
516
  "build:others": "tsx ./scripts/build.ts",
481
517
  "changelog": "tsx ./scripts/changelog.ts",
482
- "prepublishOnly": "npm run build"
518
+ "prepublishOnly": "npm run build",
519
+ "prepare": "husky",
520
+ "lint": "eslint . --ext .ts,.tsx,.js,.jsx",
521
+ "lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix"
522
+ },
523
+ "lint-staged": {
524
+ "*.{ts,tsx,js,jsx}": [
525
+ "eslint --fix"
526
+ ]
483
527
  },
484
528
  "devDependencies": {
485
529
  "@alifd/eslint-config-next": "^2.0.0",
@@ -519,8 +563,10 @@
519
563
  "fs-extra": "^11.2.0",
520
564
  "glob": "^10.3.10",
521
565
  "hastscript": "^9.0.0",
566
+ "husky": "^9.1.7",
522
567
  "inquirer": "^10.0.0",
523
568
  "json5": "^2.2.3",
569
+ "lint-staged": "^13.3.0",
524
570
  "lodash": "^4.17.21",
525
571
  "minimist": "^1.2.8",
526
572
  "moment": "^2.30.1",
@@ -564,8 +610,7 @@
564
610
  "react-copy-to-clipboard": "^5.1.0",
565
611
  "react-photo-view": "^1.2.6",
566
612
  "sanitize-html": "~2.7.3",
567
- "tslib": "^2.6.2",
568
- "github-markdown-css": "^5.0.1"
613
+ "tslib": "^2.6.2"
569
614
  },
570
615
  "sideEffects": [
571
616
  "es/**/style.js",