easy-component-ui 1.0.3 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/.github/workflows/publish.yml +28 -0
  2. package/components/Base.js +1 -90
  3. package/components/ea-alert/index.js +1 -298
  4. package/components/ea-alert/src/style/stylesheet.js +1 -0
  5. package/components/ea-aside/index.js +1 -0
  6. package/components/ea-avatar/index.js +1 -277
  7. package/components/ea-avatar/src/assets/defaultAvatar.js +1 -0
  8. package/components/ea-avatar/src/assets/errorAvatar.js +1 -0
  9. package/components/ea-avatar/src/assets/iconAndTextAvatar.js +1 -0
  10. package/components/ea-avatar/src/style/stylesheet.js +1 -0
  11. package/components/ea-backtop/index.js +1 -232
  12. package/components/ea-backtop/src/style/stylesheet.js +1 -0
  13. package/components/ea-badge/index.js +1 -160
  14. package/components/ea-badge/src/style/stylesheet.js +1 -0
  15. package/components/ea-breadcrumb/index.js +1 -0
  16. package/components/ea-breadcrumb/src/style/stylesheet.js +1 -0
  17. package/components/ea-breadcrumb-item/index.js +1 -0
  18. package/components/ea-breadcrumb-item/src/style/style.js +1 -0
  19. package/components/ea-button/index.js +1 -584
  20. package/components/ea-button/src/components/ButtonComm.js +1 -0
  21. package/components/ea-button/src/components/HrefComm.js +1 -0
  22. package/components/ea-button/src/style/stylesheet.js +1 -0
  23. package/components/ea-button-group/index.js +1 -459
  24. package/components/ea-button-group/src/style/stylesheet.js +1 -0
  25. package/components/ea-calendar/index.js +1 -409
  26. package/components/ea-calendar/src/style/stylesheet.js +1 -0
  27. package/components/ea-calendar/src/utils/createChangerElement.js +1 -0
  28. package/components/ea-calendar/src/utils/createThead.js +1 -0
  29. package/components/ea-calendar/src/utils/getDate.js +1 -0
  30. package/components/ea-calendar/src/utils/getUserWeekStart.js +1 -0
  31. package/components/ea-card/index.js +1 -77
  32. package/components/ea-card/src/style/stylesheet.js +1 -0
  33. package/components/ea-carousel/index.js +1 -434
  34. package/components/ea-carousel/src/style/stylesheet.js +1 -0
  35. package/components/ea-carousel/src/utils/handleIndexOverflow.js +1 -0
  36. package/components/ea-carousel-item/index.js +1 -0
  37. package/components/ea-carousel-item/src/style/stylesheet.js +1 -0
  38. package/components/ea-checkbox/index.js +1 -314
  39. package/components/ea-checkbox/src/style/stylesheet.js +1 -0
  40. package/components/ea-checkbox-group/index.js +1 -107
  41. package/components/ea-checkbox-group/src/style/stylesheet.js +1 -0
  42. package/components/ea-collapse/index.js +1 -293
  43. package/components/ea-collapse-item/index.js +1 -0
  44. package/components/ea-collapse-item/src/style/stylesheet.js +1 -0
  45. package/components/ea-container/index.js +1 -0
  46. package/components/ea-date-picker/index.js +1 -0
  47. package/components/ea-date-picker/src/style/stylesheet.js +1 -0
  48. package/components/ea-descriptions/index.js +1 -240
  49. package/components/ea-descriptions/src/components/contentTemplate.js +1 -0
  50. package/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -0
  51. package/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -0
  52. package/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -0
  53. package/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -0
  54. package/components/ea-descriptions/src/style/stylesheet.js +1 -0
  55. package/components/ea-descriptions-item/index.js +1 -110
  56. package/components/ea-descriptions-item/src/stylesheet.js +1 -0
  57. package/components/ea-drawer/index.js +1 -0
  58. package/components/ea-drawer/src/style/stylesheet.js +1 -0
  59. package/components/ea-empty/index.js +1 -141
  60. package/components/ea-empty/src/assets/emptyStatusSVG.js +1 -0
  61. package/components/ea-empty/src/style/stylesheet.js +1 -0
  62. package/components/ea-footer/index.js +1 -0
  63. package/components/ea-form/index.js +1 -0
  64. package/components/ea-form-item/index.js +1 -0
  65. package/components/ea-form-item/src/style/stylesheet.js +1 -0
  66. package/components/ea-header/index.js +1 -0
  67. package/components/ea-icon/config.json +1029 -1017
  68. package/components/ea-icon/css/animation.css +85 -85
  69. package/components/ea-icon/css/fontello.css +226 -224
  70. package/components/ea-icon/font/fontello.eot +0 -0
  71. package/components/ea-icon/font/fontello.svg +350 -683
  72. package/components/ea-icon/font/fontello.ttf +0 -0
  73. package/components/ea-icon/font/fontello.woff +0 -0
  74. package/components/ea-icon/font/fontello.woff2 +0 -0
  75. package/components/ea-icon/index.js +1 -47
  76. package/components/ea-image/index.js +1 -412
  77. package/components/ea-image/src/assets/errorImage.js +1 -0
  78. package/components/ea-image/src/style/stylesheet.js +1 -0
  79. package/components/ea-image/src/utils/createPreviewTools.js +1 -0
  80. package/components/ea-infinite-scroll/index.js +1 -170
  81. package/components/ea-infinite-scroll-item/index.js +1 -0
  82. package/components/ea-input/index.js +1 -765
  83. package/components/ea-input/src/components/createFixIcon.js +1 -0
  84. package/components/ea-input/src/components/createSuggestionBoard.js +1 -0
  85. package/components/ea-input/src/components/createWordLimitElement.js +1 -0
  86. package/components/ea-input/src/style/stylesheet.js +1 -0
  87. package/components/ea-input/src/utils/dispatchEvent.js +1 -0
  88. package/components/ea-input/src/utils/handleSearchResult.js +1 -0
  89. package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +1 -0
  90. package/components/ea-input-number/index.js +1 -458
  91. package/components/ea-input-number/src/style/stylesheet.js +1 -0
  92. package/components/ea-input-number/src/utils/handleCustomEvent.js +1 -0
  93. package/components/ea-link/index.js +1 -200
  94. package/components/ea-link/src/style/stylesheet.js +1 -0
  95. package/components/ea-loading/index.js +1 -218
  96. package/components/ea-loading/src/style/stylesheet.js +1 -0
  97. package/components/ea-main/index.js +1 -0
  98. package/components/ea-menu/index.js +1 -0
  99. package/components/ea-menu/src/style/stylesheet.js +1 -0
  100. package/components/ea-menu/src/utils/handleMenuItemEvent.js +1 -0
  101. package/components/ea-menu-item/index.js +1 -0
  102. package/components/ea-menu-item/src/style/stylesheet.js +1 -0
  103. package/components/ea-menu-item-group/index.js +1 -0
  104. package/components/ea-menu-item-group/src/style/stylesheet.js +1 -0
  105. package/components/ea-message/index.js +1 -233
  106. package/components/ea-message/src/style/stylesheet.js +1 -0
  107. package/components/ea-message/src/utils/MessageClass.js +1 -0
  108. package/components/ea-message-box/index.js +1 -202
  109. package/components/ea-message-box/src/style/stylesheet.js +1 -0
  110. package/components/ea-message-box/src/utils/EaMessageBoxClass.js +1 -0
  111. package/components/ea-option/index.js +1 -0
  112. package/components/ea-option/src/style/stylesheet.js +1 -0
  113. package/components/ea-option-gropu/index.js +1 -0
  114. package/components/ea-page-header/index.js +1 -0
  115. package/components/ea-page-header/src/style/stylesheet.js +1 -0
  116. package/components/ea-pagination/index.js +1 -444
  117. package/components/ea-pagination/src/components/getMoreItem.js +1 -0
  118. package/components/ea-pagination/src/components/getPageItem.js +1 -0
  119. package/components/ea-pagination/src/components/getShowTotalItem.js +1 -0
  120. package/components/ea-pagination/src/style/stylesheet.js +1 -0
  121. package/components/ea-pane/index.js +1 -0
  122. package/components/ea-pane/src/stylesheet.js +1 -0
  123. package/components/ea-progress/index.js +1 -333
  124. package/components/ea-progress/src/components/SVGComm.js +1 -0
  125. package/components/ea-progress/src/style/stylesheet.js +1 -0
  126. package/components/ea-radio/index.js +1 -287
  127. package/components/ea-radio/src/style/stylesheet.js +1 -0
  128. package/components/ea-radio-group/index.js +1 -59
  129. package/components/ea-rate/index.js +1 -326
  130. package/components/ea-rate/src/components/rateComm.js +1 -0
  131. package/components/ea-rate/src/style/stylesheet.js +1 -0
  132. package/components/ea-result/index.js +1 -167
  133. package/components/ea-result/src/style/stylesheet.js +1 -0
  134. package/components/ea-select/index.js +1 -34
  135. package/components/ea-select/src/style/stylesheet.js +1 -0
  136. package/components/ea-skeleton/index.js +1 -341
  137. package/components/ea-skeleton/src/style/stylesheet.js +1 -0
  138. package/components/ea-skeleton/src/utils/createSkeletonElement.js +1 -0
  139. package/components/ea-skeleton-item/index.js +1 -0
  140. package/components/ea-skeleton-item/src/assets/imageSVG.js +1 -0
  141. package/components/ea-skeleton-item/src/style/stylesheet.js +1 -0
  142. package/components/ea-step/index.js +1 -0
  143. package/components/ea-step/src/style/stylesheet.js +1 -0
  144. package/components/ea-steps/index.js +1 -0
  145. package/components/ea-steps/src/style/stylesheet.js +1 -0
  146. package/components/ea-submenu/index.js +1 -0
  147. package/components/ea-submenu/src/style/stylesheet.js +1 -0
  148. package/components/ea-switch/index.js +1 -301
  149. package/components/ea-switch/src/style/stylesheet.js +1 -0
  150. package/components/ea-tab/index.js +1 -0
  151. package/components/ea-tab/src/style/stylesheet.js +1 -0
  152. package/components/ea-table/index.js +1 -0
  153. package/components/ea-table/src/style/stylesheet.js +1 -0
  154. package/components/ea-table-column/index.js +1 -0
  155. package/components/ea-tabs/index.js +1 -0
  156. package/components/ea-tabs/src/style/stylesheet.js +1 -0
  157. package/components/ea-tag/index.js +1 -212
  158. package/components/ea-tag/src/style/stylesheet.js +1 -0
  159. package/components/ea-textarea/index.js +1 -333
  160. package/components/ea-textarea/src/style/stylesheet.js +1 -0
  161. package/components/ea-time-picker/index.js +1 -0
  162. package/components/ea-time-picker/src/style/stylesheet.js +1 -0
  163. package/components/ea-timeline/index.js +1 -334
  164. package/components/ea-timeline/style/stylesheet.js +1 -0
  165. package/components/ea-timeline-item/index.js +1 -0
  166. package/components/ea-timeline-item/src/style/stylesheet.js +1 -0
  167. package/package.json +11 -11
  168. package/utils/Validator.js +1 -0
  169. package/utils/createElement.js +1 -30
  170. package/utils/handleDefaultAttrIsTrue.js +1 -0
  171. package/utils/handleTemplate.js +1 -19
  172. package/utils/setStyle.js +1 -8
  173. package/utils/timeout.js +1 -0
  174. package/components/ea-message/MessageClass.js +0 -71
  175. package/components/ea-message-box/EaMessageBoxClass.js +0 -48
  176. package/components/ea-ui-base-style.css +0 -0
@@ -1,459 +1 @@
1
- // @ts-nocheck
2
- import Base from '../Base.js';
3
-
4
- const stylesheet = `
5
- :host {
6
- --margin-right: 1rem;
7
- --border-radius: 6px;
8
- --border-size: 1px;
9
- }
10
-
11
- :host([href]) > a {
12
- text-decoration: none;
13
- }
14
-
15
- :host-context(ea-button-group) {
16
- --margin-right: 0;
17
- --border-size: 0;
18
- }
19
-
20
- .__ea-button {
21
- box-sizing: border-box;
22
- padding: 0.5rem 1rem;
23
- margin-right: var(--margin-right);
24
- cursor: pointer;
25
- font-size: 1rem;
26
- line-height: 1.25;
27
- font-weight: 500;
28
- transition: background-color 0.1s, color 0.1s;
29
- border-radius: var(--border-radius);
30
- }
31
- .__ea-button.normal {
32
- border: var(--border-size) solid #dcdfe6;
33
- color: #606266;
34
- background-color: transparent;
35
- /* ------- 按钮样式 ------- */
36
- /* #region */
37
- /* #endregion */
38
- /* ------- end ------- */
39
- /* ------- 按钮大小 ------- */
40
- /* #region */
41
- /* #endregion */
42
- /* ------- end ------- */
43
- }
44
- .__ea-button.normal.disabled {
45
- cursor: not-allowed !important;
46
- background-image: none !important;
47
- background-color: rgba(64, 64, 64, 0) !important;
48
- border-color: white !important;
49
- color: white !important;
50
- pointer-events: none;
51
- border-color: #ebedf1 !important;
52
- color: #babcbe !important;
53
- }
54
- .__ea-button.normal.plain {
55
- background-color: rgba(92, 92, 92, 0);
56
- border: var(--border-size) solid white;
57
- color: transparent;
58
- background-color: transparent;
59
- border: var(--border-size) solid #dcdfe6;
60
- color: #606266;
61
- }
62
- .__ea-button.normal.plain:hover {
63
- background-color: transparent;
64
- }
65
- .__ea-button.normal.round {
66
- --border-radius: 999px;
67
- }
68
- .__ea-button.normal.medium {
69
- font-size: 14px;
70
- }
71
- .__ea-button.normal.small {
72
- font-size: 12px;
73
- }
74
- .__ea-button.normal.mini {
75
- font-size: 10px;
76
- }
77
- .__ea-button.normal:hover {
78
- border: var(--border-size) solid rgba(160, 207, 255, 0.4);
79
- color: #3a9bff;
80
- background-color: rgba(160, 207, 255, 0.05);
81
- }
82
- .__ea-button.normal:active {
83
- background-color: rgba(7, 130, 255, 0.05);
84
- border: var(--border-size) solid rgba(33, 143, 255, 0.4);
85
- }
86
- .__ea-button > i {
87
- font-size: 1rem;
88
- margin-right: 0.5rem;
89
- }
90
- .__ea-button.primary {
91
- border: var(--border-size) solid #409eff;
92
- color: #fff;
93
- background-color: #409eff;
94
- /* ------- 按钮样式 ------- */
95
- /* #region */
96
- /* #endregion */
97
- /* ------- end ------- */
98
- /* ------- 按钮大小 ------- */
99
- /* #region */
100
- /* #endregion */
101
- /* ------- end ------- */
102
- }
103
- .__ea-button.primary.disabled {
104
- cursor: not-allowed !important;
105
- background-image: none !important;
106
- background-color: #c0dfff !important;
107
- border-color: #c0dfff !important;
108
- color: white !important;
109
- pointer-events: none;
110
- }
111
- .__ea-button.primary.plain {
112
- background-color: #f8fbff;
113
- border: var(--border-size) solid #c0dfff;
114
- color: #409eff;
115
- }
116
- .__ea-button.primary.round {
117
- --border-radius: 999px;
118
- }
119
- .__ea-button.primary.medium {
120
- font-size: 14px;
121
- }
122
- .__ea-button.primary.small {
123
- font-size: 12px;
124
- }
125
- .__ea-button.primary.mini {
126
- font-size: 10px;
127
- }
128
- .__ea-button.primary:hover {
129
- border: var(--border-size) solid #73b8ff;
130
- color: white;
131
- background-color: #73b8ff;
132
- }
133
- .__ea-button.primary:active {
134
- background-color: #006bd9;
135
- }
136
- .__ea-button > i {
137
- font-size: 1rem;
138
- margin-right: 0.5rem;
139
- }
140
- .__ea-button.success {
141
- border: var(--border-size) solid #67c23a;
142
- color: #fff;
143
- background-color: #67c23a;
144
- /* ------- 按钮样式 ------- */
145
- /* #region */
146
- /* #endregion */
147
- /* ------- end ------- */
148
- /* ------- 按钮大小 ------- */
149
- /* #region */
150
- /* #endregion */
151
- /* ------- end ------- */
152
- }
153
- .__ea-button.success.disabled {
154
- cursor: not-allowed !important;
155
- background-image: none !important;
156
- background-color: #b2e19b !important;
157
- border-color: #b2e19b !important;
158
- color: white !important;
159
- pointer-events: none;
160
- }
161
- .__ea-button.success.plain {
162
- background-color: #d3eec6;
163
- border: var(--border-size) solid #b2e19b;
164
- color: #67c23a;
165
- }
166
- .__ea-button.success.round {
167
- --border-radius: 999px;
168
- }
169
- .__ea-button.success.medium {
170
- font-size: 14px;
171
- }
172
- .__ea-button.success.small {
173
- font-size: 12px;
174
- }
175
- .__ea-button.success.mini {
176
- font-size: 10px;
177
- }
178
- .__ea-button.success:hover {
179
- border: var(--border-size) solid #85cf60;
180
- color: white;
181
- background-color: #85cf60;
182
- }
183
- .__ea-button.success:active {
184
- background-color: #3d7323;
185
- }
186
- .__ea-button > i {
187
- font-size: 1rem;
188
- margin-right: 0.5rem;
189
- }
190
- .__ea-button.info {
191
- border: var(--border-size) solid #909399;
192
- color: #fff;
193
- background-color: #909399;
194
- /* ------- 按钮样式 ------- */
195
- /* #region */
196
- /* #endregion */
197
- /* ------- end ------- */
198
- /* ------- 按钮大小 ------- */
199
- /* #region */
200
- /* #endregion */
201
- /* ------- end ------- */
202
- }
203
- .__ea-button.info.disabled {
204
- cursor: not-allowed !important;
205
- background-image: none !important;
206
- background-color: #d2d4d6 !important;
207
- border-color: #d2d4d6 !important;
208
- color: white !important;
209
- pointer-events: none;
210
- }
211
- .__ea-button.info.plain {
212
- background-color: #f0f0f1;
213
- border: var(--border-size) solid #d2d4d6;
214
- color: #909399;
215
- }
216
- .__ea-button.info.round {
217
- --border-radius: 999px;
218
- }
219
- .__ea-button.info.medium {
220
- font-size: 14px;
221
- }
222
- .__ea-button.info.small {
223
- font-size: 12px;
224
- }
225
- .__ea-button.info.mini {
226
- font-size: 10px;
227
- }
228
- .__ea-button.info:hover {
229
- border: var(--border-size) solid #abadb1;
230
- color: white;
231
- background-color: #abadb1;
232
- }
233
- .__ea-button.info:active {
234
- background-color: #5d6066;
235
- }
236
- .__ea-button > i {
237
- font-size: 1rem;
238
- margin-right: 0.5rem;
239
- }
240
- .__ea-button.warning {
241
- border: var(--border-size) solid #e6a23c;
242
- color: #fff;
243
- background-color: #e6a23c;
244
- /* ------- 按钮样式 ------- */
245
- /* #region */
246
- /* #endregion */
247
- /* ------- end ------- */
248
- /* ------- 按钮大小 ------- */
249
- /* #region */
250
- /* #endregion */
251
- /* ------- end ------- */
252
- }
253
- .__ea-button.warning.disabled {
254
- cursor: not-allowed !important;
255
- background-image: none !important;
256
- background-color: #f4d8ad !important;
257
- border-color: #f4d8ad !important;
258
- color: white !important;
259
- pointer-events: none;
260
- }
261
- .__ea-button.warning.plain {
262
- background-color: #fbf0df;
263
- border: var(--border-size) solid #f4d8ad;
264
- color: #e6a23c;
265
- }
266
- .__ea-button.warning.round {
267
- --border-radius: 999px;
268
- }
269
- .__ea-button.warning.medium {
270
- font-size: 14px;
271
- }
272
- .__ea-button.warning.small {
273
- font-size: 12px;
274
- }
275
- .__ea-button.warning.mini {
276
- font-size: 10px;
277
- }
278
- .__ea-button.warning:hover {
279
- border: var(--border-size) solid #ecb869;
280
- color: white;
281
- background-color: #ecb869;
282
- }
283
- .__ea-button.warning:active {
284
- background-color: #a76d15;
285
- }
286
- .__ea-button > i {
287
- font-size: 1rem;
288
- margin-right: 0.5rem;
289
- }
290
- .__ea-button.danger {
291
- border: var(--border-size) solid #f56c6c;
292
- color: #fff;
293
- background-color: #f56c6c;
294
- /* ------- 按钮样式 ------- */
295
- /* #region */
296
- /* #endregion */
297
- /* ------- end ------- */
298
- /* ------- 按钮大小 ------- */
299
- /* #region */
300
- /* #endregion */
301
- /* ------- end ------- */
302
- }
303
- .__ea-button.danger.disabled {
304
- cursor: not-allowed !important;
305
- background-image: none !important;
306
- background-color: #fde3e3 !important;
307
- border-color: #fde3e3 !important;
308
- color: white !important;
309
- pointer-events: none;
310
- }
311
- .__ea-button.danger.plain {
312
- background-color: white;
313
- border: var(--border-size) solid #fde3e3;
314
- color: #f56c6c;
315
- background-color: #fde8e8;
316
- }
317
- .__ea-button.danger.round {
318
- --border-radius: 999px;
319
- }
320
- .__ea-button.danger.medium {
321
- font-size: 14px;
322
- }
323
- .__ea-button.danger.small {
324
- font-size: 12px;
325
- }
326
- .__ea-button.danger.mini {
327
- font-size: 10px;
328
- }
329
- .__ea-button.danger:hover {
330
- border: var(--border-size) solid #f89c9c;
331
- color: white;
332
- background-color: #f89c9c;
333
- }
334
- .__ea-button.danger:active {
335
- background-color: #eb1010;
336
- }
337
- .__ea-button > i {
338
- font-size: 1rem;
339
- margin-right: 0.5rem;
340
- }
341
- .__ea-button.text {
342
- border: var(--border-size) solid transparent;
343
- color: #409eff;
344
- background-color: transparent;
345
- /* ------- 按钮样式 ------- */
346
- /* #region */
347
- /* #endregion */
348
- /* ------- end ------- */
349
- /* ------- 按钮大小 ------- */
350
- /* #region */
351
- /* #endregion */
352
- /* ------- end ------- */
353
- }
354
- .__ea-button.text.disabled {
355
- cursor: not-allowed !important;
356
- background-image: none !important;
357
- background-color: rgba(64, 64, 64, 0) !important;
358
- border-color: rgba(64, 64, 64, 0) !important;
359
- color: white !important;
360
- pointer-events: none;
361
- color: #c0c4cc !important;
362
- }
363
- .__ea-button.text.plain {
364
- background-color: rgba(92, 92, 92, 0);
365
- border: var(--border-size) solid rgba(64, 64, 64, 0);
366
- color: transparent;
367
- }
368
- .__ea-button.text.round {
369
- --border-radius: 999px;
370
- }
371
- .__ea-button.text.medium {
372
- font-size: 14px;
373
- }
374
- .__ea-button.text.small {
375
- font-size: 12px;
376
- }
377
- .__ea-button.text.mini {
378
- font-size: 10px;
379
- }
380
- .__ea-button.text:hover {
381
- border: var(--border-size) solid rgba(26, 26, 26, 0);
382
- color: #73b8ff;
383
- background-color: rgba(26, 26, 26, 0);
384
- }
385
- .__ea-button.text:active {
386
- background-color: rgba(0, 0, 0, 0);
387
- }
388
- .__ea-button > i {
389
- font-size: 1rem;
390
- margin-right: 0.5rem;
391
- }
392
- .__ea-button.first-child {
393
- border-radius: 4px 0 0 4px;
394
- }
395
- .__ea-button.middle-child {
396
- border-radius: 0;
397
- }
398
- .__ea-button.last-child {
399
- border-radius: 0 4px 4px 0;
400
- }
401
-
402
- .__ea-button-group {
403
- display: flex;
404
- align-items: center;
405
- margin-right: 0.5rem;
406
- }
407
- .__ea-button-group ::slotted(ea-button:first-of-type) {
408
- --border-radius: 4px 0 0 4px;
409
- border-right: 1px solid rgba(255, 255, 255, 0.3);
410
- }
411
- .__ea-button-group ::slotted(ea-button:last-of-type) {
412
- --border-radius: 0 4px 4px 0;
413
- border-left: 1px solid rgba(255, 255, 255, 0.3);
414
- }
415
- .__ea-button-group ::slotted(ea-button) {
416
- --margin-right: 0;
417
- }
418
- `;
419
-
420
- export class EaButtonGroup extends Base {
421
-
422
- constructor() {
423
- super();
424
-
425
- const shadowRoot = this.attachShadow({ mode: 'open' });
426
-
427
- const dom = document.createElement('div');
428
- shadowRoot.appendChild(dom);
429
-
430
- const slot = document.createElement('slot');
431
- dom.className = "__ea-button-group";
432
- dom.appendChild(slot);
433
-
434
- this.dom = dom;
435
-
436
- this.build(shadowRoot, stylesheet);
437
-
438
- shadowRoot.appendChild(dom);
439
- }
440
-
441
- // 指定各个按钮的样式
442
- connectedCallback() {
443
- Array.from(this.children).map((child, index, arr) => {
444
- const button = !child.shadowRoot ? child : child.shadowRoot.querySelector('button');
445
-
446
- if (index === 0) {
447
- button.style.setProperty('--border-radius', '4px 0 0 4px');
448
- } else if (index === arr.length - 1) {
449
- button.style.setProperty('--border-radius', '0 4px 4px 0');
450
- } else {
451
- button.style.setProperty('--border-radius', '0');
452
- }
453
- })
454
- }
455
- }
456
-
457
- if (!window.customElements.get("ea-button-group")) {
458
- window.customElements.define("ea-button-group", EaButtonGroup);
459
- }
1
+ import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaButtonGroup extends Base{constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-button-group">\n <slot></slot>\n </div>\n ',this.build(t,stylesheet)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.toggleAttr("disabled",t),Array.from(this.children).forEach((e=>{e.disabled=t}))}connectedCallback(){this.disabled=this.disabled}}window.customElements.get("ea-button-group")||window.customElements.define("ea-button-group",EaButtonGroup);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-button-group {\n display: flex;\n align-items: center;\n}\n.ea-button-group ::slotted(ea-button) {\n --border-radius: 0;\n}\n.ea-button-group ::slotted(ea-button:not([type=normal])) {\n border-right: 1px solid rgba(255, 255, 255, 0.3);\n}\n.ea-button-group ::slotted(ea-button:first-of-type) {\n --border-radius: 4px 0 0 4px;\n}\n.ea-button-group ::slotted(ea-button:last-of-type) {\n --border-radius: 0 4px 4px 0;\n}\n";