easy-component-ui 3.0.12 → 3.0.14

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 (168) hide show
  1. package/package.json +308 -304
  2. package/dist/assets/icon.css +0 -1
  3. package/dist/components/Base.js +0 -873
  4. package/dist/components/ea-alert.js +0 -196
  5. package/dist/components/ea-avatar.js +0 -159
  6. package/dist/components/ea-backtop.js +0 -136
  7. package/dist/components/ea-badge.js +0 -144
  8. package/dist/components/ea-breadcrumb.js +0 -148
  9. package/dist/components/ea-button.js +0 -265
  10. package/dist/components/ea-calendar.js +0 -10
  11. package/dist/components/ea-calendar2.js +0 -671
  12. package/dist/components/ea-card.js +0 -85
  13. package/dist/components/ea-carousel.js +0 -415
  14. package/dist/components/ea-checkbox.js +0 -446
  15. package/dist/components/ea-collapse.js +0 -313
  16. package/dist/components/ea-color-picker.js +0 -891
  17. package/dist/components/ea-container.js +0 -177
  18. package/dist/components/ea-countdown.js +0 -142
  19. package/dist/components/ea-date-picker.js +0 -649
  20. package/dist/components/ea-descriptions.js +0 -474
  21. package/dist/components/ea-dialog.js +0 -249
  22. package/dist/components/ea-drawer.js +0 -211
  23. package/dist/components/ea-dropdown.js +0 -228
  24. package/dist/components/ea-empty.js +0 -93
  25. package/dist/components/ea-icon.js +0 -68
  26. package/dist/components/ea-image-preview.js +0 -488
  27. package/dist/components/ea-image.js +0 -302
  28. package/dist/components/ea-infinite-scroll.js +0 -109
  29. package/dist/components/ea-input-number.js +0 -367
  30. package/dist/components/ea-input.js +0 -588
  31. package/dist/components/ea-layout.js +0 -125
  32. package/dist/components/ea-link.js +0 -101
  33. package/dist/components/ea-loading.js +0 -151
  34. package/dist/components/ea-menu.js +0 -433
  35. package/dist/components/ea-message-box.js +0 -624
  36. package/dist/components/ea-message.js +0 -251
  37. package/dist/components/ea-notification.js +0 -331
  38. package/dist/components/ea-overlay.js +0 -167
  39. package/dist/components/ea-page-header.js +0 -108
  40. package/dist/components/ea-pagination.js +0 -481
  41. package/dist/components/ea-popconfirm.js +0 -275
  42. package/dist/components/ea-popover.js +0 -123
  43. package/dist/components/ea-popper.js +0 -203
  44. package/dist/components/ea-progress.js +0 -286
  45. package/dist/components/ea-radio.js +0 -364
  46. package/dist/components/ea-rate.js +0 -241
  47. package/dist/components/ea-result.js +0 -100
  48. package/dist/components/ea-scrollbar.js +0 -235
  49. package/dist/components/ea-segmented.js +0 -215
  50. package/dist/components/ea-select.js +0 -609
  51. package/dist/components/ea-skeleton.js +0 -263
  52. package/dist/components/ea-slider.js +0 -421
  53. package/dist/components/ea-space.js +0 -123
  54. package/dist/components/ea-splitter.js +0 -217
  55. package/dist/components/ea-statistic.js +0 -74
  56. package/dist/components/ea-steps.js +0 -346
  57. package/dist/components/ea-switch.js +0 -271
  58. package/dist/components/ea-table.js +0 -1124
  59. package/dist/components/ea-tabs.js +0 -501
  60. package/dist/components/ea-tag.js +0 -228
  61. package/dist/components/ea-text.js +0 -113
  62. package/dist/components/ea-time-picker.js +0 -514
  63. package/dist/components/ea-timeline.js +0 -185
  64. package/dist/components/ea-tooltip.js +0 -121
  65. package/dist/components/ea-tour.js +0 -544
  66. package/dist/components/ea-transfer.js +0 -949
  67. package/dist/components/ea-tree.js +0 -1125
  68. package/dist/components/index.js +0 -61
  69. package/dist/core/FormBase.js +0 -238
  70. package/dist/css/ea-alert.style.js +0 -4
  71. package/dist/css/ea-aside.style.js +0 -4
  72. package/dist/css/ea-avatar.style.js +0 -4
  73. package/dist/css/ea-backtop.style.js +0 -4
  74. package/dist/css/ea-badge.style.js +0 -4
  75. package/dist/css/ea-breadcrumb-item.style.js +0 -4
  76. package/dist/css/ea-breadcrumb.style.js +0 -4
  77. package/dist/css/ea-button-group.style.js +0 -4
  78. package/dist/css/ea-button.style.js +0 -4
  79. package/dist/css/ea-calendar.style.js +0 -4
  80. package/dist/css/ea-card.style.js +0 -4
  81. package/dist/css/ea-carousel-item.style.js +0 -4
  82. package/dist/css/ea-carousel.style.js +0 -4
  83. package/dist/css/ea-check-tag.style.js +0 -4
  84. package/dist/css/ea-checkbox-group.style.js +0 -4
  85. package/dist/css/ea-checkbox.style.js +0 -4
  86. package/dist/css/ea-col.style.js +0 -4
  87. package/dist/css/ea-collapse-item.style.js +0 -4
  88. package/dist/css/ea-collapse.style.js +0 -4
  89. package/dist/css/ea-color-picker-panel.style.js +0 -4
  90. package/dist/css/ea-color-picker.style.js +0 -4
  91. package/dist/css/ea-container.style.js +0 -4
  92. package/dist/css/ea-date-picker.style.js +0 -4
  93. package/dist/css/ea-descriptions-item.style.js +0 -4
  94. package/dist/css/ea-descriptions.style.js +0 -4
  95. package/dist/css/ea-dialog.style.js +0 -4
  96. package/dist/css/ea-drawer.style.js +0 -4
  97. package/dist/css/ea-dropdown-item.style.js +0 -4
  98. package/dist/css/ea-dropdown-menu.style.js +0 -4
  99. package/dist/css/ea-dropdown.style.js +0 -4
  100. package/dist/css/ea-empty.style.js +0 -4
  101. package/dist/css/ea-footer.style.js +0 -4
  102. package/dist/css/ea-header.style.js +0 -4
  103. package/dist/css/ea-icon.style.js +0 -4
  104. package/dist/css/ea-image-preview.style.js +0 -4
  105. package/dist/css/ea-image.style.js +0 -4
  106. package/dist/css/ea-infinite-scroll.style.js +0 -4
  107. package/dist/css/ea-input-number.style.js +0 -4
  108. package/dist/css/ea-input.style.js +0 -4
  109. package/dist/css/ea-link.style.js +0 -4
  110. package/dist/css/ea-main.style.js +0 -4
  111. package/dist/css/ea-menu-item-group.style.js +0 -4
  112. package/dist/css/ea-menu-item.style.js +0 -4
  113. package/dist/css/ea-menu.style.js +0 -4
  114. package/dist/css/ea-message-box.style.js +0 -4
  115. package/dist/css/ea-message.style.js +0 -4
  116. package/dist/css/ea-notification.style.js +0 -4
  117. package/dist/css/ea-option-gropu.style.js +0 -4
  118. package/dist/css/ea-option.style.js +0 -4
  119. package/dist/css/ea-overlay.style.js +0 -4
  120. package/dist/css/ea-page-header.style.js +0 -4
  121. package/dist/css/ea-pagination.style.js +0 -4
  122. package/dist/css/ea-popconfirm.style.js +0 -4
  123. package/dist/css/ea-popover.style.js +0 -4
  124. package/dist/css/ea-popper.style.js +0 -4
  125. package/dist/css/ea-progress.style.js +0 -4
  126. package/dist/css/ea-radio-group.style.js +0 -4
  127. package/dist/css/ea-radio.style.js +0 -4
  128. package/dist/css/ea-rate.style.js +0 -4
  129. package/dist/css/ea-result.style.js +0 -4
  130. package/dist/css/ea-row.style.js +0 -4
  131. package/dist/css/ea-scrollbar.style.js +0 -4
  132. package/dist/css/ea-segmented.style.js +0 -4
  133. package/dist/css/ea-select.style.js +0 -4
  134. package/dist/css/ea-skeleton-item.style.js +0 -4
  135. package/dist/css/ea-skeleton.style.js +0 -4
  136. package/dist/css/ea-slider.style.js +0 -4
  137. package/dist/css/ea-space.style.js +0 -4
  138. package/dist/css/ea-splitter-bar.style.js +0 -4
  139. package/dist/css/ea-splitter-panel.style.js +0 -4
  140. package/dist/css/ea-splitter.style.js +0 -4
  141. package/dist/css/ea-statistic.style.js +0 -4
  142. package/dist/css/ea-step.style.js +0 -4
  143. package/dist/css/ea-steps.style.js +0 -4
  144. package/dist/css/ea-sub-menu.style.js +0 -4
  145. package/dist/css/ea-switch.style.js +0 -4
  146. package/dist/css/ea-tab-panel.style.js +0 -4
  147. package/dist/css/ea-tab.style.js +0 -4
  148. package/dist/css/ea-table-column.style.js +0 -4
  149. package/dist/css/ea-table.style.js +0 -4
  150. package/dist/css/ea-tabs.style.js +0 -4
  151. package/dist/css/ea-tag.style.js +0 -4
  152. package/dist/css/ea-text.style.js +0 -4
  153. package/dist/css/ea-time-picker.style.js +0 -4
  154. package/dist/css/ea-timeline-item.style.js +0 -4
  155. package/dist/css/ea-timeline.style.js +0 -4
  156. package/dist/css/ea-tooltip.style.js +0 -4
  157. package/dist/css/ea-tour-step.style.js +0 -4
  158. package/dist/css/ea-tour.style.js +0 -4
  159. package/dist/css/ea-transfer.style.js +0 -5
  160. package/dist/css/ea-tree.style.js +0 -6
  161. package/dist/css/ea-ui-component.style.js +0 -4
  162. package/dist/favicon.ico +0 -0
  163. package/dist/utils/Color.js +0 -439
  164. package/dist/utils/I18nManager.js +0 -218
  165. package/dist/utils/Utils.js +0 -65
  166. package/dist/utils/Variables.js +0 -12
  167. package/dist/utils/parseTime.js +0 -73
  168. package/dist/utils/timeout.js +0 -9
@@ -1,123 +0,0 @@
1
- var m = Object.defineProperty;
2
- var n = (t) => {
3
- throw TypeError(t);
4
- };
5
- var b = (t, s, e) => s in t ? m(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
6
- var p = (t, s, e) => b(t, typeof s != "symbol" ? s + "" : s, e), c = (t, s, e) => s.has(t) || n("Cannot " + e);
7
- var u = (t, s, e) => (c(t, s, "read from private field"), e ? e.call(t) : s.get(t)), d = (t, s, e) => s.has(t) ? n("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), h = (t, s, e, a) => (c(t, s, "write to private field"), a ? a.call(t, e) : s.set(t, e), e);
8
- import { B as g } from "./Base.js";
9
- import { s as y } from "../css/ea-space.style.js";
10
- var r;
11
- class v extends g {
12
- constructor() {
13
- super();
14
- /** @type {HTMLElement} */
15
- d(this, r);
16
- p(this, "state", this.properties({
17
- wrap: {
18
- type: Boolean,
19
- default: !1,
20
- observer: (e) => {
21
- this.style.setProperty("--ea-space-wrap", e ? "wrap" : "nowrap");
22
- }
23
- },
24
- alignment: {
25
- type: ["", "center", "flex-start", "flex-end", "baseline", "stretch"],
26
- default: "",
27
- observer: (e) => {
28
- if (!CSS.supports("align-items", e))
29
- return console.warn(`[ea-space] Invalid alignment value ${e}`);
30
- this.style.setProperty("--ea-space-alignment", e);
31
- }
32
- },
33
- direction: {
34
- type: ["vertical", "horizontal"],
35
- default: "horizontal",
36
- observer: () => {
37
- this.updateContainerClasslist();
38
- }
39
- },
40
- size: {
41
- type: String,
42
- default: "default",
43
- observer: (e) => {
44
- if (["large", "small", "default"].includes(e))
45
- this.updateContainerClasslist();
46
- else {
47
- if (!CSS.supports("gap", e))
48
- return console.warn("[ea-space] Invalid size value");
49
- this.style.setProperty("--ea-space-gap", e);
50
- }
51
- }
52
- },
53
- spacer: {
54
- type: String,
55
- default: "",
56
- observer: (e) => {
57
- if (this.querySelectorAll('[part="spacer"]').forEach((i) => i.remove()), !e) return;
58
- const o = [...this.children];
59
- o.forEach((i, f) => {
60
- if (f < o.length - 1) {
61
- const l = document.createElement("span");
62
- l.innerText = e, l.part = "spacer", this.insertBefore(l, i.nextSibling);
63
- }
64
- });
65
- }
66
- },
67
- fill: {
68
- type: Boolean,
69
- default: !1,
70
- observer: () => {
71
- this.updateContainerClasslist();
72
- }
73
- },
74
- "fill-ratio": {
75
- type: Number,
76
- default: 100,
77
- observer: (e) => {
78
- Number.isNaN(Number(e)) || this.toggleAttribute("fill", !0), this.style.setProperty("--ea-space-fill-ratio", `${e}%`);
79
- }
80
- }
81
- }));
82
- this.stylesheet = y, this.$render();
83
- }
84
- static get observedAttributes() {
85
- return [
86
- ...super.observedAttributes,
87
- "wrap",
88
- "direction",
89
- "size",
90
- "spacer",
91
- "alignment",
92
- "fill",
93
- "fill-ratio"
94
- ];
95
- }
96
- /**
97
- * 获取 classlist 列表
98
- * @return {string} 属性值
99
- */
100
- updateContainerClasslist() {
101
- const e = this.computedClasslist("ea-space", {
102
- [`--${this.size}`]: !CSS.supports("gap", this.size),
103
- ["--" + this.direction]: this.direction,
104
- "--fill": this.fill
105
- });
106
- return u(this, r).className = e, e;
107
- }
108
- $render() {
109
- this.shadowRoot.innerHTML = `
110
- <div class="ea-space" part="container">
111
- <slot></slot>
112
- </div>
113
- `, h(this, r, this.shadowRoot.querySelector(".ea-space")), this.updateContainerClasslist();
114
- }
115
- connectedCallback() {
116
- super.connectedCallback();
117
- }
118
- }
119
- r = new WeakMap();
120
- window.customElements.get("ea-space") || window.customElements.define("ea-space", v);
121
- export {
122
- v as EaSpace
123
- };
@@ -1,217 +0,0 @@
1
- var $ = Object.defineProperty;
2
- var W = (e) => {
3
- throw TypeError(e);
4
- };
5
- var k = (e, s, t) => s in e ? $(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
6
- var f = (e, s, t) => k(e, typeof s != "symbol" ? s + "" : s, t), L = (e, s, t) => s.has(e) || W("Cannot " + t);
7
- var n = (e, s, t) => (L(e, s, "read from private field"), t ? t.call(e) : s.get(e)), c = (e, s, t) => s.has(e) ? W("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), b = (e, s, t, i) => (L(e, s, "write to private field"), i ? i.call(e, t) : s.set(e, t), t);
8
- import { B as N } from "./Base.js";
9
- import { s as I } from "../css/ea-splitter.style.js";
10
- import { s as M } from "../css/ea-splitter-panel.style.js";
11
- import { s as q } from "../css/ea-splitter-bar.style.js";
12
- const d = (e) => e.endsWith("px") ? parseInt(e.replace("px", "")) : e.endsWith("%") ? Number(e.replace("%", "")) / 100 : parseInt(e);
13
- var a, m, h, y, v;
14
- class D extends N {
15
- constructor() {
16
- super();
17
- /** @type {HTMLElement} */
18
- c(this, a);
19
- /** @type {AbortController} */
20
- c(this, m);
21
- f(this, "state", this.properties({
22
- layout: {
23
- type: ["horizontal", "vertical"],
24
- default: "horizontal",
25
- observer: (t) => {
26
- n(this, a).style.setProperty("--ea-splitter-direction", t === "vertical" ? "column" : "row"), n(this, a).className = this.updateContainerClasslist();
27
- }
28
- }
29
- }));
30
- /**
31
- * 派发 resizeStart 事件
32
- * @param {string} eventName 事件名称
33
- */
34
- c(this, h, (t) => {
35
- this.dispatchEvent(new CustomEvent(t, {
36
- detail: {
37
- size: [...this.children].filter((i) => i.tagName === "EA-SPLITTER-PANEL").map((i) => {
38
- var o;
39
- return (o = i.getBoundingClientRect()) == null ? void 0 : o[this.layout === "vertical" ? "height" : "width"];
40
- })
41
- }
42
- }));
43
- });
44
- /**
45
- * `layout="horizontal"` 时的 `resize` 事件监听
46
- * @param {MouseEvent} e
47
- */
48
- c(this, y, (t) => {
49
- t.preventDefault(), t.stopPropagation();
50
- const i = new AbortController(), o = Number(t.target.getAttribute("data-index")), r = this.children[o - 1], l = this.children[o + 1], R = t.clientX, z = r.getBoundingClientRect().width, P = l.getBoundingClientRect().width;
51
- n(this, h).call(this, "panel-resize-start");
52
- const S = (H) => {
53
- t.preventDefault(), t.stopPropagation();
54
- const g = H.clientX - R, C = z + g, w = P - g;
55
- let p = 0, u = 0;
56
- r.min.endsWith("%") ? (p = n(this, a).clientWidth * d(r.min), u = n(this, a).clientWidth * d(l.min)) : r.min.endsWith("px") && (p = d(r.min), u = d(l.min)), !(C <= p || w <= u) && (r.size = C + "px", l.size = w + "px", n(this, h).call(this, "panel-resize"));
57
- }, A = () => {
58
- i.abort(), n(this, h).call(this, "panel-resize-end");
59
- };
60
- window.addEventListener("mousemove", S, { signal: i.signal }), window.addEventListener("mouseup", A, { signal: i.signal });
61
- });
62
- /**
63
- * `layout="vertical"` 时的 `resize` 事件监听
64
- * @param {MouseEvent} e
65
- */
66
- c(this, v, (t) => {
67
- t.preventDefault(), t.stopPropagation();
68
- const i = new AbortController(), o = Number(t.target.getAttribute("data-index")), r = this.children[o - 1], l = this.children[o + 1], R = t.clientY, z = r.getBoundingClientRect().height, P = l.getBoundingClientRect().height;
69
- n(this, h).call(this, "resize-start");
70
- const S = (H) => {
71
- t.preventDefault(), t.stopPropagation();
72
- const g = H.clientY - R, C = z + g, w = P - g;
73
- let p = 0, u = 0;
74
- r.min.endsWith("%") ? (p = n(this, a).clientHeight * d(r.min), u = n(this, a).clientHeight * d(l.min)) : r.min.endsWith("px") && (p = d(r.min), u = d(l.min)), !(C <= p || w <= u) && (r.size = C + "px", l.size = w + "px", n(this, h).call(this, "panel-resize"));
75
- }, A = () => {
76
- i.abort(), n(this, h).call(this, "panel-resize-end");
77
- };
78
- window.addEventListener("mousemove", S, { signal: i.signal }), window.addEventListener("mouseup", A, { signal: i.signal });
79
- });
80
- this.stylesheet = I, this.$render();
81
- }
82
- static get observedAttributes() {
83
- return ["layout"];
84
- }
85
- $render() {
86
- this.shadowRoot.innerHTML = `
87
- <div class="ea-splitter" part="container">
88
- <slot></slot>
89
- </div>
90
- `, b(this, a, this.shadowRoot.querySelector(".ea-splitter"));
91
- }
92
- /**
93
- * 获取 classlist 列表
94
- * @return {string} 属性值
95
- */
96
- updateContainerClasslist() {
97
- return this.computedClasslist("ea-splitter", {
98
- ["--" + this.layout]: !!(this.layout || this.layout === "")
99
- });
100
- }
101
- connectedCallback() {
102
- super.connectedCallback(), b(this, m, new AbortController()), queueMicrotask(() => {
103
- let t = [...this.children];
104
- [...this.children].forEach((i, o) => {
105
- if (i.tagName === "EA-SPLITTER-PANEL" && (i.layout = this.layout, i.setAttribute("data-panel-index", o), o < t.length - 1)) {
106
- const r = document.createElement("ea-splitter-bar");
107
- this.insertBefore(r, i.nextSibling);
108
- }
109
- }), t = [...this.children], t.forEach((i, o) => {
110
- i.tagName === "EA-SPLITTER-BAR" && (i.setAttribute("data-index", o), i.layout = this.layout, i.addEventListener("mousedown", this.layout === "horizontal" ? n(this, y) : n(this, v), { signal: n(this, m).signal }));
111
- });
112
- });
113
- }
114
- $beforeUnmounted() {
115
- var t;
116
- (t = n(this, m)) == null || t.abort();
117
- }
118
- }
119
- a = new WeakMap(), m = new WeakMap(), h = new WeakMap(), y = new WeakMap(), v = new WeakMap();
120
- window.customElements.get("ea-splitter") || window.customElements.define("ea-splitter", D);
121
- var E;
122
- class X extends N {
123
- constructor() {
124
- super();
125
- /** @type {HTMLElement} */
126
- c(this, E);
127
- f(this, "state", this.properties({
128
- size: {
129
- type: String,
130
- default: "",
131
- observer: (t) => {
132
- CSS.supports("width", t) && this.style.setProperty("--ea-splitter-panel-size", t);
133
- }
134
- },
135
- min: {
136
- type: String,
137
- default: "",
138
- observer: (t) => {
139
- CSS.supports("width", t) && this.style.setProperty("--ea-splitter-panel-min-size", t);
140
- }
141
- },
142
- layout: {
143
- type: ["vertical", "horizontal"],
144
- default: "horizontal",
145
- observer: (t) => {
146
- }
147
- }
148
- }));
149
- this.stylesheet = M, this.$render();
150
- }
151
- static get observedAttributes() {
152
- return ["size", "min", "layout"];
153
- }
154
- /**
155
- * 获取 classlist 列表
156
- * @return {string} 属性值
157
- */
158
- updateContainerClasslist() {
159
- return this.computedClasslist(
160
- "ea-splitter-panel",
161
- {
162
- // ['--' + this.state.type]: this.state.type,
163
- }
164
- );
165
- }
166
- $render() {
167
- this.shadowRoot.innerHTML = `
168
- <div class="ea-splitter-panel" part="container">
169
- <slot></slot>
170
- </div>
171
- `, b(this, E, this.shadowRoot.querySelector(".ea-splitter-panel"));
172
- }
173
- connectedCallback() {
174
- super.connectedCallback();
175
- }
176
- }
177
- E = new WeakMap();
178
- window.customElements.get("ea-splitter-panel") || window.customElements.define("ea-splitter-panel", X);
179
- var x;
180
- class Y extends N {
181
- constructor() {
182
- super();
183
- /** @type {HTMLElement} */
184
- c(this, x);
185
- f(this, "state", this.properties({
186
- layout: {
187
- type: ["vertical", "horizontal"],
188
- default: "",
189
- observer: (t) => {
190
- }
191
- }
192
- }));
193
- this.stylesheet = q, this.$render();
194
- }
195
- static get observedAttributes() {
196
- return ["layout"];
197
- }
198
- /**
199
- * 获取 classlist 列表
200
- * @return {string} 属性值
201
- */
202
- updateContainerClasslist() {
203
- return this.computedClasslist("ea-splitter-bar", {
204
- // ['--' + this.state.type]: this.state.type,
205
- });
206
- }
207
- $render() {
208
- this.shadowRoot.innerHTML = `
209
- <div class="ea-splitter-bar" part="container"></div>
210
- `, b(this, x, this.shadowRoot.querySelector(".ea-splitter-bar"));
211
- }
212
- connectedCallback() {
213
- super.connectedCallback();
214
- }
215
- }
216
- x = new WeakMap();
217
- window.customElements.get("ea-splitter-bar") || window.customElements.define("ea-splitter-bar", Y);
@@ -1,74 +0,0 @@
1
- var m = Object.defineProperty;
2
- var p = (t) => {
3
- throw TypeError(t);
4
- };
5
- var _ = (t, e, s) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
- var d = (t, e, s) => _(t, typeof e != "symbol" ? e + "" : e, s), f = (t, e, s) => e.has(t) || p("Cannot " + s);
7
- var h = (t, e, s) => (f(t, e, "read from private field"), s ? s.call(t) : e.get(t)), a = (t, e, s) => e.has(t) ? p("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), i = (t, e, s, u) => (f(t, e, "write to private field"), u ? u.call(t, s) : e.set(t, s), s);
8
- import { B as x } from "./Base.js";
9
- import { s as b } from "../css/ea-statistic.style.js";
10
- var n, r, o, c, l;
11
- class w extends x {
12
- constructor() {
13
- super();
14
- /** @type {HTMLElement} */
15
- a(this, n);
16
- /** @type {HTMLElement} */
17
- a(this, r);
18
- /** @type {HTMLElement} */
19
- a(this, o);
20
- /** @type {HTMLElement} */
21
- a(this, c);
22
- /** @type {HTMLElement} */
23
- a(this, l);
24
- d(this, "state", this.properties({
25
- title: {
26
- type: String,
27
- default: "",
28
- observer: (s) => {
29
- h(this, r).textContent = s;
30
- }
31
- },
32
- value: {
33
- type: Number,
34
- default: 0,
35
- /** @param {Number} newVal */
36
- observer: (s) => {
37
- h(this, o).textContent = s.toLocaleString();
38
- }
39
- }
40
- }));
41
- this.stylesheet = b, this.$render();
42
- }
43
- static get observedAttributes() {
44
- return [...super.observedAttributes, "title", "value"];
45
- }
46
- $render() {
47
- this.shadowRoot.innerHTML = `
48
- <div class='ea-statistic' part='container'>
49
- <header class='ea-statistic__header' part='title'>
50
- <slot name='title'></slot>
51
- </header>
52
- <main class='ea-statistic__content' part='content'>
53
- <span class='ea-statistic__prefix' part='prefix'>
54
- <slot name='prefix'></slot>
55
- </span>
56
- <span class='ea-statistic__number' part='number'>
57
- <slot></slot>
58
- </span>
59
- <span class='ea-statistic__suffix' part='suffix'>
60
- <slot name='suffix'></slot>
61
- </span>
62
- </main>
63
- </div>
64
- `, i(this, n, this.shadowRoot.querySelector(".ea-statistic")), i(this, r, this.shadowRoot.querySelector(".ea-statistic__header slot")), i(this, o, this.shadowRoot.querySelector(".ea-statistic__number")), i(this, c, this.shadowRoot.querySelector(".ea-statistic__prefix slot")), i(this, l, this.shadowRoot.querySelector(".ea-statistic__suffix slot"));
65
- }
66
- connectedCallback() {
67
- super.connectedCallback();
68
- }
69
- }
70
- n = new WeakMap(), r = new WeakMap(), o = new WeakMap(), c = new WeakMap(), l = new WeakMap();
71
- window.customElements.get("ea-statistic") || window.customElements.define("ea-statistic", w);
72
- export {
73
- w as EaStatistic
74
- };