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.
- package/.github/workflows/publish.yml +28 -0
- package/components/Base.js +1 -90
- package/components/ea-alert/index.js +1 -298
- package/components/ea-alert/src/style/stylesheet.js +1 -0
- package/components/ea-aside/index.js +1 -0
- package/components/ea-avatar/index.js +1 -277
- package/components/ea-avatar/src/assets/defaultAvatar.js +1 -0
- package/components/ea-avatar/src/assets/errorAvatar.js +1 -0
- package/components/ea-avatar/src/assets/iconAndTextAvatar.js +1 -0
- package/components/ea-avatar/src/style/stylesheet.js +1 -0
- package/components/ea-backtop/index.js +1 -232
- package/components/ea-backtop/src/style/stylesheet.js +1 -0
- package/components/ea-badge/index.js +1 -160
- package/components/ea-badge/src/style/stylesheet.js +1 -0
- package/components/ea-breadcrumb/index.js +1 -0
- package/components/ea-breadcrumb/src/style/stylesheet.js +1 -0
- package/components/ea-breadcrumb-item/index.js +1 -0
- package/components/ea-breadcrumb-item/src/style/style.js +1 -0
- package/components/ea-button/index.js +1 -584
- package/components/ea-button/src/components/ButtonComm.js +1 -0
- package/components/ea-button/src/components/HrefComm.js +1 -0
- package/components/ea-button/src/style/stylesheet.js +1 -0
- package/components/ea-button-group/index.js +1 -459
- package/components/ea-button-group/src/style/stylesheet.js +1 -0
- package/components/ea-calendar/index.js +1 -409
- package/components/ea-calendar/src/style/stylesheet.js +1 -0
- package/components/ea-calendar/src/utils/createChangerElement.js +1 -0
- package/components/ea-calendar/src/utils/createThead.js +1 -0
- package/components/ea-calendar/src/utils/getDate.js +1 -0
- package/components/ea-calendar/src/utils/getUserWeekStart.js +1 -0
- package/components/ea-card/index.js +1 -77
- package/components/ea-card/src/style/stylesheet.js +1 -0
- package/components/ea-carousel/index.js +1 -434
- package/components/ea-carousel/src/style/stylesheet.js +1 -0
- package/components/ea-carousel/src/utils/handleIndexOverflow.js +1 -0
- package/components/ea-carousel-item/index.js +1 -0
- package/components/ea-carousel-item/src/style/stylesheet.js +1 -0
- package/components/ea-checkbox/index.js +1 -314
- package/components/ea-checkbox/src/style/stylesheet.js +1 -0
- package/components/ea-checkbox-group/index.js +1 -107
- package/components/ea-checkbox-group/src/style/stylesheet.js +1 -0
- package/components/ea-collapse/index.js +1 -293
- package/components/ea-collapse-item/index.js +1 -0
- package/components/ea-collapse-item/src/style/stylesheet.js +1 -0
- package/components/ea-container/index.js +1 -0
- package/components/ea-date-picker/index.js +1 -0
- package/components/ea-date-picker/src/style/stylesheet.js +1 -0
- package/components/ea-descriptions/index.js +1 -240
- package/components/ea-descriptions/src/components/contentTemplate.js +1 -0
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -0
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -0
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -0
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -0
- package/components/ea-descriptions/src/style/stylesheet.js +1 -0
- package/components/ea-descriptions-item/index.js +1 -110
- package/components/ea-descriptions-item/src/stylesheet.js +1 -0
- package/components/ea-drawer/index.js +1 -0
- package/components/ea-drawer/src/style/stylesheet.js +1 -0
- package/components/ea-empty/index.js +1 -141
- package/components/ea-empty/src/assets/emptyStatusSVG.js +1 -0
- package/components/ea-empty/src/style/stylesheet.js +1 -0
- package/components/ea-footer/index.js +1 -0
- package/components/ea-form/index.js +1 -0
- package/components/ea-form-item/index.js +1 -0
- package/components/ea-form-item/src/style/stylesheet.js +1 -0
- package/components/ea-header/index.js +1 -0
- package/components/ea-icon/config.json +1029 -1017
- package/components/ea-icon/css/animation.css +85 -85
- package/components/ea-icon/css/fontello.css +226 -224
- package/components/ea-icon/font/fontello.eot +0 -0
- package/components/ea-icon/font/fontello.svg +350 -683
- package/components/ea-icon/font/fontello.ttf +0 -0
- package/components/ea-icon/font/fontello.woff +0 -0
- package/components/ea-icon/font/fontello.woff2 +0 -0
- package/components/ea-icon/index.js +1 -47
- package/components/ea-image/index.js +1 -412
- package/components/ea-image/src/assets/errorImage.js +1 -0
- package/components/ea-image/src/style/stylesheet.js +1 -0
- package/components/ea-image/src/utils/createPreviewTools.js +1 -0
- package/components/ea-infinite-scroll/index.js +1 -170
- package/components/ea-infinite-scroll-item/index.js +1 -0
- package/components/ea-input/index.js +1 -765
- package/components/ea-input/src/components/createFixIcon.js +1 -0
- package/components/ea-input/src/components/createSuggestionBoard.js +1 -0
- package/components/ea-input/src/components/createWordLimitElement.js +1 -0
- package/components/ea-input/src/style/stylesheet.js +1 -0
- package/components/ea-input/src/utils/dispatchEvent.js +1 -0
- package/components/ea-input/src/utils/handleSearchResult.js +1 -0
- package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +1 -0
- package/components/ea-input-number/index.js +1 -458
- package/components/ea-input-number/src/style/stylesheet.js +1 -0
- package/components/ea-input-number/src/utils/handleCustomEvent.js +1 -0
- package/components/ea-link/index.js +1 -200
- package/components/ea-link/src/style/stylesheet.js +1 -0
- package/components/ea-loading/index.js +1 -218
- package/components/ea-loading/src/style/stylesheet.js +1 -0
- package/components/ea-main/index.js +1 -0
- package/components/ea-menu/index.js +1 -0
- package/components/ea-menu/src/style/stylesheet.js +1 -0
- package/components/ea-menu/src/utils/handleMenuItemEvent.js +1 -0
- package/components/ea-menu-item/index.js +1 -0
- package/components/ea-menu-item/src/style/stylesheet.js +1 -0
- package/components/ea-menu-item-group/index.js +1 -0
- package/components/ea-menu-item-group/src/style/stylesheet.js +1 -0
- package/components/ea-message/index.js +1 -233
- package/components/ea-message/src/style/stylesheet.js +1 -0
- package/components/ea-message/src/utils/MessageClass.js +1 -0
- package/components/ea-message-box/index.js +1 -202
- package/components/ea-message-box/src/style/stylesheet.js +1 -0
- package/components/ea-message-box/src/utils/EaMessageBoxClass.js +1 -0
- package/components/ea-option/index.js +1 -0
- package/components/ea-option/src/style/stylesheet.js +1 -0
- package/components/ea-option-gropu/index.js +1 -0
- package/components/ea-page-header/index.js +1 -0
- package/components/ea-page-header/src/style/stylesheet.js +1 -0
- package/components/ea-pagination/index.js +1 -444
- package/components/ea-pagination/src/components/getMoreItem.js +1 -0
- package/components/ea-pagination/src/components/getPageItem.js +1 -0
- package/components/ea-pagination/src/components/getShowTotalItem.js +1 -0
- package/components/ea-pagination/src/style/stylesheet.js +1 -0
- package/components/ea-pane/index.js +1 -0
- package/components/ea-pane/src/stylesheet.js +1 -0
- package/components/ea-progress/index.js +1 -333
- package/components/ea-progress/src/components/SVGComm.js +1 -0
- package/components/ea-progress/src/style/stylesheet.js +1 -0
- package/components/ea-radio/index.js +1 -287
- package/components/ea-radio/src/style/stylesheet.js +1 -0
- package/components/ea-radio-group/index.js +1 -59
- package/components/ea-rate/index.js +1 -326
- package/components/ea-rate/src/components/rateComm.js +1 -0
- package/components/ea-rate/src/style/stylesheet.js +1 -0
- package/components/ea-result/index.js +1 -167
- package/components/ea-result/src/style/stylesheet.js +1 -0
- package/components/ea-select/index.js +1 -34
- package/components/ea-select/src/style/stylesheet.js +1 -0
- package/components/ea-skeleton/index.js +1 -341
- package/components/ea-skeleton/src/style/stylesheet.js +1 -0
- package/components/ea-skeleton/src/utils/createSkeletonElement.js +1 -0
- package/components/ea-skeleton-item/index.js +1 -0
- package/components/ea-skeleton-item/src/assets/imageSVG.js +1 -0
- package/components/ea-skeleton-item/src/style/stylesheet.js +1 -0
- package/components/ea-step/index.js +1 -0
- package/components/ea-step/src/style/stylesheet.js +1 -0
- package/components/ea-steps/index.js +1 -0
- package/components/ea-steps/src/style/stylesheet.js +1 -0
- package/components/ea-submenu/index.js +1 -0
- package/components/ea-submenu/src/style/stylesheet.js +1 -0
- package/components/ea-switch/index.js +1 -301
- package/components/ea-switch/src/style/stylesheet.js +1 -0
- package/components/ea-tab/index.js +1 -0
- package/components/ea-tab/src/style/stylesheet.js +1 -0
- package/components/ea-table/index.js +1 -0
- package/components/ea-table/src/style/stylesheet.js +1 -0
- package/components/ea-table-column/index.js +1 -0
- package/components/ea-tabs/index.js +1 -0
- package/components/ea-tabs/src/style/stylesheet.js +1 -0
- package/components/ea-tag/index.js +1 -212
- package/components/ea-tag/src/style/stylesheet.js +1 -0
- package/components/ea-textarea/index.js +1 -333
- package/components/ea-textarea/src/style/stylesheet.js +1 -0
- package/components/ea-time-picker/index.js +1 -0
- package/components/ea-time-picker/src/style/stylesheet.js +1 -0
- package/components/ea-timeline/index.js +1 -334
- package/components/ea-timeline/style/stylesheet.js +1 -0
- package/components/ea-timeline-item/index.js +1 -0
- package/components/ea-timeline-item/src/style/stylesheet.js +1 -0
- package/package.json +11 -11
- package/utils/Validator.js +1 -0
- package/utils/createElement.js +1 -30
- package/utils/handleDefaultAttrIsTrue.js +1 -0
- package/utils/handleTemplate.js +1 -19
- package/utils/setStyle.js +1 -8
- package/utils/timeout.js +1 -0
- package/components/ea-message/MessageClass.js +0 -71
- package/components/ea-message-box/EaMessageBoxClass.js +0 -48
- package/components/ea-ui-base-style.css +0 -0
|
@@ -1,293 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import Base from '../Base.js';
|
|
3
|
-
import { createElement, createSlotElement } from '../../utils/createElement.js';
|
|
4
|
-
|
|
5
|
-
const stylesheet = `
|
|
6
|
-
|
|
7
|
-
.ea-collapse-item_wrap .ea-collapse-item_title {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: space-between;
|
|
11
|
-
border-bottom: 1px solid #ebeef5;
|
|
12
|
-
height: 48px;
|
|
13
|
-
line-height: 48px;
|
|
14
|
-
font-size: 13px;
|
|
15
|
-
font-weight: 700;
|
|
16
|
-
color: #303133;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|
|
19
|
-
.ea-collapse-item_wrap .ea-collapse-item_title .ea-collapse-item_title-icon {
|
|
20
|
-
width: 0.35rem;
|
|
21
|
-
height: 0.35rem;
|
|
22
|
-
margin-right: 1rem;
|
|
23
|
-
border: 3px solid #9ca0a5;
|
|
24
|
-
border-left-color: transparent;
|
|
25
|
-
border-top-color: transparent;
|
|
26
|
-
rotate: -45deg;
|
|
27
|
-
transition: rotate 0.3s;
|
|
28
|
-
}
|
|
29
|
-
.ea-collapse-item_wrap .ea-collapse-item_content {
|
|
30
|
-
will-change: height;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
height: 0;
|
|
33
|
-
padding-bottom: 0;
|
|
34
|
-
transition: height 0.3s, padding-bottom 0.3s;
|
|
35
|
-
font-size: 13px;
|
|
36
|
-
color: #303133;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
export class EaCollapse extends Base {
|
|
41
|
-
#wrap;
|
|
42
|
-
constructor() {
|
|
43
|
-
super();
|
|
44
|
-
|
|
45
|
-
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
46
|
-
|
|
47
|
-
const slot = createSlotElement('');
|
|
48
|
-
const wrap = createElement('div', 'ea-collapse_wrap', [slot]);
|
|
49
|
-
|
|
50
|
-
this.#wrap = wrap;
|
|
51
|
-
|
|
52
|
-
this.build(shadowRoot, stylesheet);
|
|
53
|
-
this.shadowRoot.appendChild(wrap);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ------- active 当前展开项 -------
|
|
57
|
-
// #region
|
|
58
|
-
get active() {
|
|
59
|
-
return this.getAttribute('active') || 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
set active(name) {
|
|
63
|
-
this.setAttribute('active', name);
|
|
64
|
-
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
this.#handleCollapse(this.accordion, name);
|
|
67
|
-
}, 20);
|
|
68
|
-
}
|
|
69
|
-
// #endregion
|
|
70
|
-
// ------- end -------
|
|
71
|
-
|
|
72
|
-
// ------- accordion 是否为手风琴模式 -------
|
|
73
|
-
// #region
|
|
74
|
-
get accordion() {
|
|
75
|
-
return this.getAttrBoolean('accordion') || false;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
set accordion(flag) {
|
|
79
|
-
this.setAttribute('accordion', flag);
|
|
80
|
-
|
|
81
|
-
setTimeout(() => {
|
|
82
|
-
this.#handleCollapse(flag, this.active);
|
|
83
|
-
}, 20);
|
|
84
|
-
}
|
|
85
|
-
// #endregion
|
|
86
|
-
// ------- end -------
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 处理折叠面板的展开/折叠状态。
|
|
90
|
-
* 根据传入的标志位flag和激活项名称activeItemName,来决定哪些折叠项应该展开。
|
|
91
|
-
* 当flag为true时,只允许一个折叠项展开,即单选模式;
|
|
92
|
-
* 当flag为false时,可以允许多个折叠项展开,即多选模式。
|
|
93
|
-
*
|
|
94
|
-
* @param {boolean} flag - 控制单选或多选模式的标志。true表示单选模式,false表示多选模式。
|
|
95
|
-
* @param {string} activeItemName - 激活项的名称,用于决定哪些折叠项应该展开。
|
|
96
|
-
*/
|
|
97
|
-
#handleCollapse(flag, activeItemName) {
|
|
98
|
-
const that = this;
|
|
99
|
-
// 将所有ea-collapse-item元素转换为数组
|
|
100
|
-
const items = Array.from(this.querySelectorAll('ea-collapse-item'));
|
|
101
|
-
// 初始化用于记录展开状态的变量
|
|
102
|
-
let collapseItem = flag ? "" : [];
|
|
103
|
-
|
|
104
|
-
// 遍历每个折叠项,绑定状态改变事件的监听器
|
|
105
|
-
items.forEach(item => {
|
|
106
|
-
item.addEventListener('collapseItemStatusChange', (e) => {
|
|
107
|
-
// 在单选模式下,关闭所有其他折叠项
|
|
108
|
-
if (flag) items.forEach(item => {
|
|
109
|
-
item.isOpen = false;
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// 更新当前折叠项的展开状态
|
|
113
|
-
item.isOpen = !e.detail.isOpen;
|
|
114
|
-
|
|
115
|
-
// 触发change事件,通知外部当前折叠项的状态改变
|
|
116
|
-
that.dispatchEvent(new CustomEvent("change", {
|
|
117
|
-
detail: {
|
|
118
|
-
name: item.name,
|
|
119
|
-
isOpen: item.isOpen,
|
|
120
|
-
},
|
|
121
|
-
}))
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
try {
|
|
126
|
-
// 根据flag的值来处理折叠项的展开状态
|
|
127
|
-
if (flag) {
|
|
128
|
-
// 在单选模式下,根据activeItemName确定哪个折叠项应该展开
|
|
129
|
-
collapseItem = activeItemName.toString().trim()[0];
|
|
130
|
-
|
|
131
|
-
items.forEach(item => {
|
|
132
|
-
// 根据collapseItem的值,决定当前折叠项是否展开
|
|
133
|
-
if (item.name === collapseItem) {
|
|
134
|
-
item.isOpen = true;
|
|
135
|
-
} else {
|
|
136
|
-
item.isOpen = false;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
} else {
|
|
140
|
-
// 在多选模式下,将activeItemName解析为数组,并处理每个折叠项的展开状态
|
|
141
|
-
collapseItem = activeItemName.split(',').map(item => {
|
|
142
|
-
return item.trim();
|
|
143
|
-
}).concat();
|
|
144
|
-
|
|
145
|
-
items.forEach(item => {
|
|
146
|
-
// 根据collapseItem数组中的值,决定当前折叠项是否展开
|
|
147
|
-
if (collapseItem.includes(item.name)) {
|
|
148
|
-
item.isOpen = true;
|
|
149
|
-
} else {
|
|
150
|
-
item.isOpen = false;
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
} catch (error) { }
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
#handleChildrenItemName() {
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
init() {
|
|
163
|
-
const that = this;
|
|
164
|
-
|
|
165
|
-
this.accordion = this.accordion;
|
|
166
|
-
|
|
167
|
-
this.active = this.active;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
connectedCallback() {
|
|
171
|
-
this.init();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if (!customElements.get('ea-collapse')) {
|
|
176
|
-
customElements.define('ea-collapse', EaCollapse);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export class EaCollapseItem extends Base {
|
|
180
|
-
#wrap;
|
|
181
|
-
|
|
182
|
-
#titleWrap;
|
|
183
|
-
#titleContent;
|
|
184
|
-
#titleIcon;
|
|
185
|
-
|
|
186
|
-
#contentWrap;
|
|
187
|
-
|
|
188
|
-
constructor() {
|
|
189
|
-
super();
|
|
190
|
-
|
|
191
|
-
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
192
|
-
|
|
193
|
-
const titleContent = createElement('span', 'ea-collapse-item_title-content');
|
|
194
|
-
const icon = createElement('span', 'ea-collapse-item_title-icon');
|
|
195
|
-
const titleWrap = createElement('div', 'ea-collapse-item_title', [titleContent, icon]);
|
|
196
|
-
const contentSlot = createSlotElement('');
|
|
197
|
-
const contentWrap = createElement('div', 'ea-collapse-item_content', [contentSlot]);
|
|
198
|
-
|
|
199
|
-
const wrap = createElement('div', 'ea-collapse-item_wrap', [titleWrap, contentWrap]);
|
|
200
|
-
|
|
201
|
-
this.#wrap = wrap;
|
|
202
|
-
this.#titleWrap = titleWrap;
|
|
203
|
-
this.#titleContent = titleContent;
|
|
204
|
-
this.#titleIcon = icon;
|
|
205
|
-
this.#contentWrap = contentWrap;
|
|
206
|
-
|
|
207
|
-
this.build(shadowRoot, stylesheet);
|
|
208
|
-
this.shadowRoot.appendChild(wrap);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// ------- title 标题 -------
|
|
212
|
-
// #region
|
|
213
|
-
get title() {
|
|
214
|
-
return this.getAttribute('title');
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
set title(title) {
|
|
218
|
-
this.setAttribute('title', title);
|
|
219
|
-
|
|
220
|
-
this.#titleContent.innerHTML = title;
|
|
221
|
-
}
|
|
222
|
-
// #endregion
|
|
223
|
-
// ------- end -------
|
|
224
|
-
|
|
225
|
-
// ------- name 唯一标识符 -------
|
|
226
|
-
// #region
|
|
227
|
-
get name() {
|
|
228
|
-
return this.getAttribute('name');
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
set name(name) {
|
|
232
|
-
this.setAttribute('name', name);
|
|
233
|
-
}
|
|
234
|
-
// #endregion
|
|
235
|
-
// ------- end -------
|
|
236
|
-
|
|
237
|
-
// ------- isOpen 是否展开 -------
|
|
238
|
-
// #region
|
|
239
|
-
get isOpen() {
|
|
240
|
-
return this.getAttrBoolean('is-open') || false;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
set isOpen(flag) {
|
|
244
|
-
if (flag === this.isOpen) return;
|
|
245
|
-
|
|
246
|
-
this.toggleAttr('is-open', flag);
|
|
247
|
-
|
|
248
|
-
const height = this.#contentWrap.scrollHeight;
|
|
249
|
-
|
|
250
|
-
if (this.isOpen) {
|
|
251
|
-
this.#contentWrap.style.height = `${height}px`;
|
|
252
|
-
this.#contentWrap.style.paddingBottom = '20px';
|
|
253
|
-
this.#titleIcon.style.rotate = '45deg';
|
|
254
|
-
|
|
255
|
-
} else {
|
|
256
|
-
this.#contentWrap.style.height = '0px';
|
|
257
|
-
this.#contentWrap.style.paddingBottom = '0px';
|
|
258
|
-
this.#titleIcon.style.rotate = '-45deg';
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
// #endregion
|
|
262
|
-
// ------- end -------
|
|
263
|
-
|
|
264
|
-
#initCollapseChange() {
|
|
265
|
-
const that = this;
|
|
266
|
-
|
|
267
|
-
this.#titleWrap.addEventListener('click', () => {
|
|
268
|
-
that.dispatchEvent(new CustomEvent('collapseItemStatusChange', {
|
|
269
|
-
detail: {
|
|
270
|
-
name: that.name,
|
|
271
|
-
isOpen: that.isOpen,
|
|
272
|
-
},
|
|
273
|
-
}));
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
init() {
|
|
278
|
-
const that = this;
|
|
279
|
-
|
|
280
|
-
this.title = this.title;
|
|
281
|
-
this.name = this.name;
|
|
282
|
-
|
|
283
|
-
this.#initCollapseChange();
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
connectedCallback() {
|
|
287
|
-
this.init();
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (!customElements.get('ea-collapse-item')) {
|
|
292
|
-
customElements.define('ea-collapse-item', EaCollapseItem);
|
|
293
|
-
}
|
|
1
|
+
import Base from"../Base.js";import"../ea-collapse-item/index.js";export class EaCollapse extends Base{constructor(){super();this.attachShadow({mode:"open"}).innerHTML='\n <div class="ea-collapse_wrap" part="container">\n <slot></slot>\n </div>\n '}get active(){return this.getAttribute("active")||1}set active(e){this.setAttribute("active",e),setTimeout((()=>{this.#e(this.accordion,e)}),20)}get accordion(){return this.getAttrBoolean("accordion")||!1}set accordion(e){this.setAttribute("accordion",e),setTimeout((()=>{this.#e(e,this.active)}),20)}#e(e,t){const a=Array.from(this.querySelectorAll("ea-collapse-item"));let s=e?"":[];a.forEach((t=>{t.addEventListener("collapseItemStatusChange",(s=>{e&&a.forEach((e=>{e.isOpen=!1})),t.isOpen=!s.detail.isOpen,this.dispatchEvent(new CustomEvent("change",{detail:{name:t.name,isOpen:t.isOpen}}))}))})),e?(s=t.toString().trim()[0],a.forEach((e=>{e.isOpen=e.name===s}))):(s=t.split(",").map((e=>e.trim())).concat(),a.forEach((e=>{e.isOpen=s.includes(e.name)})))}connectedCallback(){this.accordion=this.accordion,this.active=this.active}}customElements.get("ea-collapse")||customElements.define("ea-collapse",EaCollapse);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaCollapseItem extends Base{#t;#e;#s;#i;#n;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-collapse-item_wrap" part="container">\n <div class="ea-collapse-item_title" part="title-wrap">\n <span class="ea-collapse-item_title-content" part="title-content"></span>\n <span class="ea-collapse-item_title-icon" part="title-icon"></span>\n </div>\n <div class="ea-collapse-item_content" part="content-wrap">\n <slot></slot>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-collapse-item_wrap"),this.#e=t.querySelector(".ea-collapse-item_title"),this.#s=t.querySelector(".ea-collapse-item_title-content"),this.#i=t.querySelector(".ea-collapse-item_title-icon"),this.#n=t.querySelector(".ea-collapse-item_content"),this.build(t,stylesheet)}get title(){return this.getAttribute("title")}set title(t){this.setAttribute("title",t),this.#s.innerHTML=t}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get isOpen(){return this.getAttrBoolean("is-open")||!1}set isOpen(t){if(t===this.isOpen)return;this.toggleAttr("is-open",t);const e=this.#n.scrollHeight;this.isOpen?(this.#n.style.height=`${e}px`,this.#n.style.paddingBottom="20px",this.#i.style.rotate="45deg"):(this.#n.style.height="0px",this.#n.style.paddingBottom="0px",this.#i.style.rotate="-45deg")}connectedCallback(){this.title=this.title,this.name=this.name,this.#e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("collapseItemStatusChange",{detail:{name:this.name,isOpen:this.isOpen}}))}))}}customElements.get("ea-collapse-item")||customElements.define("ea-collapse-item",EaCollapseItem);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const stylesheet="\n.ea-collapse-item_wrap .ea-collapse-item_title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 1px solid #ebeef5;\n height: 48px;\n line-height: 48px;\n font-size: 13px;\n font-weight: 700;\n color: #303133;\n cursor: pointer;\n}\n.ea-collapse-item_wrap .ea-collapse-item_title .ea-collapse-item_title-icon {\n width: 0.35rem;\n height: 0.35rem;\n margin-right: 1rem;\n border: 3px solid #9ca0a5;\n border-left-color: transparent;\n border-top-color: transparent;\n rotate: -45deg;\n transition: rotate 0.3s;\n}\n.ea-collapse-item_wrap .ea-collapse-item_content {\n will-change: height;\n overflow: hidden;\n height: 0;\n padding-bottom: 0;\n transition: height 0.3s, padding-bottom 0.3s;\n font-size: 13px;\n color: #303133;\n}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";const stylesheet="\n.ea-container_wrap {\n display: flex;\n flex-direction: row;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n.ea-container_wrap.is-vertical {\n flex-direction: column;\n}\n.ea-container_wrap ::slotted(ea-main) {\n flex: 1;\n}\n";export class EaContainer extends Base{#e;get CONTAINER_TYPE(){return["ea-header","ea-main","ea-footer","ea-container","ea-aside"]}constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-container_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#e=e.querySelector(".ea-container_wrap"),this.build(e,stylesheet)}get direction(){return["horizontal","vertical"].includes(this.getAttribute("direction"))||"horizontal"}set direction(e){this.setAttribute("direction",e),this.#e.classList.toggle("is-vertical","horizontal"===e)}#t(e){const t=e.map((e=>e.tagName.toLowerCase()));e.forEach((e=>{this.CONTAINER_TYPE.includes(e.tagName.toLowerCase())||e.remove(),"ea-container"===e.tagName.toLowerCase()&&(e.style.flex="1")})),t.includes("ea-header")||t.includes("ea-footer")?this.direction="horizontal":this.direction=this.direction}connectedCallback(){const e=Array.from(this.children);this.#t(e)}}customElements.get("ea-container")||customElements.define("ea-container",EaContainer);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-calendar/index.js";import"../ea-input/index.js";import{stylesheet}from"./src/style/stylesheet.js";import{timeout}from"../../utils/timeout.js";export class EaDatePicker extends Base{#e;#t;#a;#i;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML="\n <div class='ea-date-picker_wrap' part='container'>\n <div class='ea-date-picker_input-wrap' part='input-wrap'>\n <ea-input class=\"ea-date-picker_input\" part='input' prefix-icon=\"icon-calendar-times-o\" readonly></ea-input>\n </div>\n <div class='ea-date-picker_dropdown-wrap' part='dropdown-wrap'>\n <ea-calendar class=\"ea-date-picker_calendar\" size=\"mini\" part='calendar'></ea-calendar>\n </div>\n </div>\n ",this.#e=e.querySelector(".ea-date-picker_wrap"),this.#t=e.querySelector(".ea-date-picker_dropdown-wrap"),this.#a=e.querySelector(".ea-date-picker_calendar"),this.#i=e.querySelector(".ea-date-picker_input"),this.build(e,stylesheet)}get name(){return this.getAttribute("name")||"datePicker"}set name(e){this.setAttribute("name",e)}get width(){return this.getAttribute("width")||"200px"}set width(e){this.setAttribute("width",e),this.#e.style.width=e,this.#t.style.width=e,this.style.display="inline-block",this.style.width=e}get value(){return this.getAttribute("value")||""}set value(e){if(isNaN(new Date(e))&&""!==e){const t=new Date(Date.now());e=`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`}this.setAttribute("value",e),this.#i.value=e}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(e){this.setAttribute("placeholder",e),this.#i.placeholder=e}get disabled(){return this.getAttrBoolean("disabled")||!1}set disabled(e){this.toggleAttr("disabled",e),this.#i.disabled=e}get align(){return this.getAttribute("align")||"left"}set align(e){this.setAttribute("align",e),this.#i.shadowRoot.querySelector("input").style.textAlign=e}#n(){this.#a.addEventListener("select",(e=>{const{year:t,month:a,date:i,day:n}=e.detail;this.value=`${t}-${a}-${i}`,this.#i.value=`${t}-${a}-${i}`,this.dispatchEvent(new CustomEvent("change",{detail:{fulllDate:`${t}-${a}-${i}`,year:t,month:a,date:i,week:n}}))}))}#s(){this.#i.addEventListener("focus",(()=>{this.#e.classList.add("is-open")})),window.addEventListener("click",(e=>{this.contains(e.target)?this.#i.shadowRoot.querySelector(".ea-input_inner").focus():this.#e.classList.remove("is-open")}))}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.width=this.width,this.value=this.value,this.placeholder=this.placeholder,this.disabled=this.disabled,this.align=this.align,this.#n(),this.#s(),timeout((()=>{this.#e.classList.add("with-transition")}),300)}}customElements.get("ea-date-picker")||customElements.define("ea-date-picker",EaDatePicker);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const stylesheet="\n.ea-date-picker_wrap .ea-date-picker_input-wrap {\n position: relative;\n}\n.ea-date-picker_wrap .ea-date-picker_dropdown-wrap {\n position: absolute;\n background-color: #fff;\n transform-origin: top center;\n transform: scaleY(0);\n box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);\n z-index: 2;\n}\n.ea-date-picker_wrap.is-open .ea-date-picker_dropdown-wrap {\n transform: scaleY(1);\n}\n.ea-date-picker_wrap.with-transition .ea-date-picker_dropdown-wrap {\n transition: transform 0.3s;\n}\n";
|
|
@@ -1,240 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import Base from '../Base.js';
|
|
3
|
-
|
|
4
|
-
const stylesheet = `
|
|
5
|
-
.ea-descriptions_wrap {
|
|
6
|
-
font-size: 14px;
|
|
7
|
-
}
|
|
8
|
-
.ea-descriptions_wrap .ea-descriptions_header {
|
|
9
|
-
font-size: 1rem;
|
|
10
|
-
font-weight: 700;
|
|
11
|
-
margin-bottom: 20px;
|
|
12
|
-
}
|
|
13
|
-
.ea-descriptions_wrap .ea-descriptions_body table {
|
|
14
|
-
width: 100%;
|
|
15
|
-
border-collapse: collapse;
|
|
16
|
-
table-layout: fixed;
|
|
17
|
-
}
|
|
18
|
-
.ea-descriptions_wrap .ea-descriptions_body table th {
|
|
19
|
-
background-color: #fafafa;
|
|
20
|
-
}
|
|
21
|
-
.ea-descriptions_wrap .ea-descriptions_body table td {
|
|
22
|
-
vertical-align: baseline;
|
|
23
|
-
}
|
|
24
|
-
.ea-descriptions_wrap .ea-descriptions-item_label,
|
|
25
|
-
.ea-descriptions_wrap .ea-descriptions-item_content {
|
|
26
|
-
font-weight: normal;
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
vertical-align: middle;
|
|
29
|
-
}
|
|
30
|
-
.ea-descriptions_wrap .ea-descriptions-item_label.is-border,
|
|
31
|
-
.ea-descriptions_wrap .ea-descriptions-item_content.is-border {
|
|
32
|
-
border: 1px solid #ebeef5;
|
|
33
|
-
}
|
|
34
|
-
.ea-descriptions_wrap .ea-descriptions-item_cell {
|
|
35
|
-
text-align: left;
|
|
36
|
-
padding: 12px 10px;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
const getThTemplate_normal = (label, content, colspan) => {
|
|
41
|
-
return `
|
|
42
|
-
<td class="ea-descriptions-item" colspan="${colspan}">
|
|
43
|
-
<span class="ea-descriptions-item_label">${label}:</span>
|
|
44
|
-
<span class="ea-descriptions-item_content">${content}</span>
|
|
45
|
-
</td>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const getTdTemplate_border = (label, content, colspan) => {
|
|
50
|
-
return `
|
|
51
|
-
<th class="ea-descriptions-item_label ea-descriptions-item_cell is-border" colspan="${1}">${label}</th>
|
|
52
|
-
<td class="ea-descriptions-item_content ea-descriptions-item_cell is-border" colspan="${colspan}">${content}</td>
|
|
53
|
-
`
|
|
54
|
-
}
|
|
55
|
-
const getThTemplate_direction = (label, hasBorder) => {
|
|
56
|
-
return `
|
|
57
|
-
<th class="ea-descriptions-item_label ea-descriptions-item_cell ${hasBorder ? 'is-border' : ''}" colspan="${1}">
|
|
58
|
-
${label}${hasBorder ? '' : ':'}
|
|
59
|
-
</th>`
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const getTdTemplate_direction = (text, hasBorder, colspan) => {
|
|
63
|
-
return `
|
|
64
|
-
<td class="ea-descriptions-item_content ea-descriptions-item_cell ${hasBorder ? 'is-border' : ''}" colspan="${colspan}">
|
|
65
|
-
${text}
|
|
66
|
-
</td>`
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const contentTemplate = (item, colspan, hasBorder) => {
|
|
70
|
-
let label = item.getAttribute("label");
|
|
71
|
-
let content = item.innerHTML;
|
|
72
|
-
|
|
73
|
-
if (!label) label = item.querySelector('[slot="label"]')?.innerHTML || "";
|
|
74
|
-
|
|
75
|
-
return hasBorder ? getTdTemplate_border(label, content, colspan) : getThTemplate_normal(label, content, colspan);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export class EaDescriptions extends Base {
|
|
79
|
-
#wrap;
|
|
80
|
-
|
|
81
|
-
#table;
|
|
82
|
-
#tableHeader;
|
|
83
|
-
#tableBody;
|
|
84
|
-
|
|
85
|
-
#slot;
|
|
86
|
-
|
|
87
|
-
constructor() {
|
|
88
|
-
super();
|
|
89
|
-
|
|
90
|
-
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
91
|
-
const wrap = document.createElement('div');
|
|
92
|
-
wrap.className = 'ea-descriptions_wrap';
|
|
93
|
-
|
|
94
|
-
const header = document.createElement('div');
|
|
95
|
-
header.className = 'ea-descriptions_header';
|
|
96
|
-
wrap.appendChild(header);
|
|
97
|
-
|
|
98
|
-
const body = document.createElement('div');
|
|
99
|
-
const table = document.createElement('table');
|
|
100
|
-
const thead = document.createElement('thead');
|
|
101
|
-
|
|
102
|
-
const slot = document.createElement('slot');
|
|
103
|
-
body.className = 'ea-descriptions_body';
|
|
104
|
-
body.appendChild(table);
|
|
105
|
-
table.appendChild(thead);
|
|
106
|
-
wrap.appendChild(body);
|
|
107
|
-
|
|
108
|
-
this.#wrap = wrap;
|
|
109
|
-
this.#table = table;
|
|
110
|
-
this.#tableHeader = header;
|
|
111
|
-
this.#slot = slot;
|
|
112
|
-
|
|
113
|
-
this.build(shadowRoot, stylesheet);
|
|
114
|
-
this.shadowRoot.appendChild(wrap);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// ------- title 设置标题 -------
|
|
118
|
-
// #region
|
|
119
|
-
get title() {
|
|
120
|
-
return this.getAttribute('title') || "";
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
set title(value) {
|
|
124
|
-
this.setAttribute('title', value);
|
|
125
|
-
|
|
126
|
-
this.#tableHeader.innerHTML = value;
|
|
127
|
-
}
|
|
128
|
-
// #endregion
|
|
129
|
-
// ------- end -------
|
|
130
|
-
|
|
131
|
-
// ------- col 一行显示多少个item -------
|
|
132
|
-
// #region
|
|
133
|
-
get col() {
|
|
134
|
-
return this.getAttrNumber('col') || 3;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
set col(value) {
|
|
138
|
-
this.setAttribute('col', value);
|
|
139
|
-
}
|
|
140
|
-
// #endregion
|
|
141
|
-
// ------- end -------
|
|
142
|
-
|
|
143
|
-
// ------- border 是否显示边框 -------
|
|
144
|
-
// #region
|
|
145
|
-
get border() {
|
|
146
|
-
return this.getAttrBoolean('border');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
set border(value) {
|
|
150
|
-
this.toggleAttr('border', value);
|
|
151
|
-
}
|
|
152
|
-
// #endregion
|
|
153
|
-
// ------- end -------
|
|
154
|
-
|
|
155
|
-
// ------- direction 显示方向 -------
|
|
156
|
-
// #region
|
|
157
|
-
get direction() {
|
|
158
|
-
return this.getAttribute('direction') || "horizontal";
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
set direction(value) {
|
|
162
|
-
this.setAttribute('direction', value);
|
|
163
|
-
}
|
|
164
|
-
// #endregion
|
|
165
|
-
// ------- end -------
|
|
166
|
-
|
|
167
|
-
initDescriptionsItem(colNumber, items, hasBorder, direction) {
|
|
168
|
-
const length = Number(items.length);
|
|
169
|
-
|
|
170
|
-
for (let i = 0; i < length; i += 3) {
|
|
171
|
-
let colspanCount = 0;
|
|
172
|
-
const tbody = document.createElement('tbody');
|
|
173
|
-
|
|
174
|
-
switch (direction) {
|
|
175
|
-
case "horizontal": {
|
|
176
|
-
const tr = document.createElement('tr');
|
|
177
|
-
|
|
178
|
-
for (let j = i; j < colNumber + i; j++) {
|
|
179
|
-
const colspan = Number(items[j]?.getAttribute("span")) || 1;
|
|
180
|
-
let temp = colspanCount + colspan;
|
|
181
|
-
|
|
182
|
-
if (temp > colNumber || !items[j]) break;
|
|
183
|
-
|
|
184
|
-
tr.innerHTML += contentTemplate(items[j], colspan, hasBorder);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
tbody.appendChild(tr);
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
case "vertical": {
|
|
191
|
-
const th_tr = document.createElement('tr');
|
|
192
|
-
const td_tr = document.createElement('tr');
|
|
193
|
-
|
|
194
|
-
for (let j = i; j < colNumber + i; j++) {
|
|
195
|
-
const colspan = Number(items[j]?.getAttribute("span")) || 1;
|
|
196
|
-
let temp = colspanCount + colspan;
|
|
197
|
-
|
|
198
|
-
if (temp > colNumber || !items[j]) break;
|
|
199
|
-
|
|
200
|
-
th_tr.innerHTML += getThTemplate_direction(items[j].getAttribute("label"), hasBorder);
|
|
201
|
-
td_tr.innerHTML += getTdTemplate_direction(items[j].innerHTML, hasBorder, colspan);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
tbody.appendChild(th_tr);
|
|
205
|
-
tbody.appendChild(td_tr);
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
this.#table.appendChild(tbody);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
items.forEach(el => {
|
|
214
|
-
el.remove();
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
init() {
|
|
219
|
-
const that = this;
|
|
220
|
-
|
|
221
|
-
this.title = this.title;
|
|
222
|
-
|
|
223
|
-
this.col = this.col;
|
|
224
|
-
|
|
225
|
-
this.border = this.border;
|
|
226
|
-
|
|
227
|
-
this.direction = this.direction;
|
|
228
|
-
|
|
229
|
-
const items = this.querySelectorAll('ea-descriptions-item');
|
|
230
|
-
this.initDescriptionsItem(this.col, items, this.border, this.direction);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
connectedCallback() {
|
|
234
|
-
this.init();
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (!customElements.get('ea-descriptions')) {
|
|
239
|
-
customElements.define('ea-descriptions', EaDescriptions);
|
|
240
|
-
}
|
|
1
|
+
import Base from"../Base.js";import"../ea-descriptions-item/index.js";import{getThTemplate_direction}from"./src/components/getThTemplate_direction.js";import{getTdTemplate_direction}from"./src/components/getTdTemplate_direction.js";import{contentTemplate}from"./src/components/contentTemplate.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaDescriptions extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-descriptions_wrap" part="container">\n <div class="ea-descriptions_header" part="header-wrap"></div>\n <div class="ea-descriptions_body" part="body-wrap">\n <table class="ea-descriptions_table" part="table-wrap"></table>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-descriptions_table"),this.#e=t.querySelector(".ea-descriptions_header"),this.build(t,stylesheet)}get title(){return this.getAttribute("title")||""}set title(t){this.setAttribute("title",t),this.#e.innerHTML=t}get col(){return this.getAttrNumber("col")||3}set col(t){this.setAttribute("col",t)}get border(){return this.getAttrBoolean("border")}set border(t){this.toggleAttr("border",t)}get direction(){return this.getAttribute("direction")||"horizontal"}set direction(t){this.setAttribute("direction",t)}#i(t){const e=Number(t.length);for(let i=0;i<e;i+=3){let e=0;const r=document.createElement("tbody");switch(this.direction){case"horizontal":{const s=document.createElement("tr");for(let r=i;r<this.col+i;r++){const i=Number(t[r]?.getAttribute("span"))||1;if(e+i>this.col||!t[r])break;s.innerHTML+=contentTemplate(t[r],i,this.border)}r.appendChild(s);break}case"vertical":{const s=document.createElement("tr"),o=document.createElement("tr");for(let r=i;r<this.col+i;r++){const i=Number(t[r]?.getAttribute("span"))||1;if(e+i>this.col||!t[r])break;s.innerHTML+=getThTemplate_direction(t[r].getAttribute("label"),this.border),o.innerHTML+=getTdTemplate_direction(t[r].innerHTML,this.border,i)}r.appendChild(s),r.appendChild(o);break}}this.#t.appendChild(r)}t.forEach((t=>{t.remove()}))}connectedCallback(){this.title=this.title,this.col=this.col,this.border=this.border,this.direction=this.direction;const t=this.querySelectorAll("ea-descriptions-item");this.#i(t)}}customElements.get("ea-descriptions")||customElements.define("ea-descriptions",EaDescriptions);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getTdTemplate_border}from"./getTdTemplate_border.js";import{getThTemplate_normal}from"./getThTemplate_normal.js";export const contentTemplate=(e,t,r)=>{let l=e.getAttribute("label"),o=e.innerHTML;return l||(l=e.querySelector('[slot="label"]')?.innerHTML||""),r?getTdTemplate_border(l,o,t):getThTemplate_normal(l,o,t)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getTdTemplate_border=(e,t,s)=>`\n <th class="ea-descriptions-item_label ea-descriptions-item_cell is-border" colspan="1">${e}</th>\n <td class="ea-descriptions-item_content ea-descriptions-item_cell is-border" colspan="${s}">${t}</td>\n `;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getTdTemplate_direction=(e,t,n)=>`\n <td class="ea-descriptions-item_content ea-descriptions-item_cell ${t?"is-border":""}" colspan="${n}">\n ${e}\n </td>\n `;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getThTemplate_direction=(e,t)=>`\n <th class="ea-descriptions-item_label ea-descriptions-item_cell ${t?"is-border":""}" colspan="1">\n ${e}${t?"":":"}\n </th>\n `;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getThTemplate_normal=(s,n,e)=>`\n <td class="ea-descriptions-item" colspan="${e}">\n <span class="ea-descriptions-item_label">${s}:</span>\n <span class="ea-descriptions-item_content">${n}</span>\n </td>\n `;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const stylesheet="\n.ea-descriptions_wrap {\n font-size: 14px;\n}\n.ea-descriptions_wrap .ea-descriptions_header {\n font-size: 1rem;\n font-weight: 700;\n margin-bottom: 20px;\n}\n.ea-descriptions_wrap .ea-descriptions_body table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n.ea-descriptions_wrap .ea-descriptions_body table th {\n background-color: #fafafa;\n}\n.ea-descriptions_wrap .ea-descriptions_body table td {\n vertical-align: baseline;\n}\n.ea-descriptions_wrap .ea-descriptions-item_label,\n.ea-descriptions_wrap .ea-descriptions-item_content {\n font-weight: normal;\n font-size: 14px;\n vertical-align: middle;\n}\n.ea-descriptions_wrap .ea-descriptions-item_label.is-border,\n.ea-descriptions_wrap .ea-descriptions-item_content.is-border {\n border: 1px solid #ebeef5;\n}\n.ea-descriptions_wrap .ea-descriptions-item_cell {\n text-align: left;\n padding: 12px 10px;\n}\n";
|