agile-core 3.0.7 → 3.0.9
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/dist/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.d.ts +23 -4
- package/dist/core.d.ts.map +1 -1
- package/dist/core.es.js +163 -134
- package/dist/core.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +2 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.es.js +38 -35
- package/dist/plugin.es.js.map +1 -1
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -1,49 +1,58 @@
|
|
|
1
|
-
import { createApp as e, defineComponent as t, useAttrs as n, shallowRef as
|
|
2
|
-
import { merge as
|
|
1
|
+
import { createApp as e, defineComponent as t, useAttrs as n, shallowRef as o, ref as r, useSlots as i, onMounted as s, onUpdated as a, h as l } from "vue";
|
|
2
|
+
import { merge as u } from "ts-deepmerge";
|
|
3
3
|
var h, c;
|
|
4
|
-
const d =
|
|
5
|
-
|
|
4
|
+
const d = function() {
|
|
5
|
+
try {
|
|
6
|
+
return __AUI_CONFIG__;
|
|
7
|
+
} catch (e2) {
|
|
8
|
+
return { tagPrefix: "aui" };
|
|
9
|
+
}
|
|
10
|
+
}().tagPrefix || "aui", p = "data-v-aui", m = "auix", f = Symbol("shadow");
|
|
11
|
+
const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = f, c) {
|
|
6
12
|
constructor(e2) {
|
|
7
13
|
super(), this.__hasVue__ = false, this[h] = { needHook: false, slot: {} }, this[_AuiComponent.shadowSymbol].options = e2 || {}, this.$initAttrs();
|
|
8
14
|
}
|
|
9
15
|
connectedCallback() {
|
|
10
|
-
this.$needInit() && (this.$
|
|
11
|
-
}
|
|
12
|
-
set textContent(e2) {
|
|
13
|
-
this.$needHook() ? this.$textContent(e2) : super.textContent = e2;
|
|
14
|
-
}
|
|
15
|
-
get textContent() {
|
|
16
|
-
return this.$needHook() ? this.$textContent("default") : super.textContent || "";
|
|
16
|
+
this.$needInit() && (this.$initVue(), this.$needHook(true));
|
|
17
17
|
}
|
|
18
18
|
set innerHTML(e2) {
|
|
19
|
-
this.$needHook() ? this.$innerHTML(e2) :
|
|
19
|
+
this.$needHook() ? this.$innerHTML("default", e2) : Reflect.set(HTMLElement.prototype, "innerHTML", e2, this);
|
|
20
20
|
}
|
|
21
21
|
get innerHTML() {
|
|
22
|
-
return this.$needHook() ? this.$innerHTML("default") :
|
|
22
|
+
return this.$needHook() ? this.$innerHTML("default") : Reflect.get(HTMLElement.prototype, "innerHTML", this) || "";
|
|
23
23
|
}
|
|
24
|
-
set
|
|
25
|
-
this.$
|
|
24
|
+
set textContent(e2) {
|
|
25
|
+
this.$needHook() ? this.$textContent("default", e2) : Reflect.set(HTMLElement.prototype, "innerHTML", e2, this);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.$prepend("default", e2);
|
|
27
|
+
get textContent() {
|
|
28
|
+
return this.$needHook() ? this.$textContent("default") : Reflect.get(HTMLElement.prototype, "innerHTML", this) || "";
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
set innerText(e2) {
|
|
31
|
+
this.$ignoreLog("innerText"), Reflect.set(HTMLElement.prototype, "innerText", e2, this);
|
|
33
32
|
}
|
|
34
33
|
set value(e2) {
|
|
35
34
|
let t2 = e2;
|
|
36
35
|
const n2 = this[_AuiComponent.shadowSymbol].value;
|
|
37
|
-
let
|
|
38
|
-
this.$isArrayValue() ? (t2 = _AuiComponent.$anyToArray(e2),
|
|
36
|
+
let o2;
|
|
37
|
+
this.$isArrayValue() ? (t2 = _AuiComponent.$anyToArray(e2), o2 = JSON.stringify(t2)) : o2 = t2.toString(), n2 !== o2 && (this[_AuiComponent.shadowSymbol].value = o2, this[_AuiComponent.shadowSymbol].el && this.$attrChange("value"));
|
|
39
38
|
}
|
|
40
39
|
get value() {
|
|
41
40
|
const e2 = this[_AuiComponent.shadowSymbol].value;
|
|
42
41
|
return this.$isArrayValue() && "string" == typeof e2 ? JSON.parse(e2) : e2;
|
|
43
42
|
}
|
|
43
|
+
prepend(e2) {
|
|
44
|
+
if (!this.$needHook()) return HTMLElement.prototype.prepend.call(this, e2);
|
|
45
|
+
this.$prepend("default", e2);
|
|
46
|
+
}
|
|
47
|
+
appendChild(e2) {
|
|
48
|
+
return this.$needHook() ? this.$appendChild("default", e2) : HTMLElement.prototype.appendChild.call(this, e2);
|
|
49
|
+
}
|
|
50
|
+
insertBefore(e2, t2) {
|
|
51
|
+
return this.$needHook() ? this.$insertBefore("default", e2, t2) : HTMLElement.prototype.insertBefore.call(this, e2, t2);
|
|
52
|
+
}
|
|
44
53
|
hasAttribute(e2) {
|
|
45
54
|
const t2 = this[_AuiComponent.shadowSymbol].el;
|
|
46
|
-
return t2 ? t2.hasAttribute(e2) :
|
|
55
|
+
return t2 ? t2.hasAttribute(e2) : HTMLElement.prototype.hasAttribute.call(this, e2);
|
|
47
56
|
}
|
|
48
57
|
setAttribute(e2, t2) {
|
|
49
58
|
t2 = t2.toString();
|
|
@@ -52,7 +61,7 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
52
61
|
if (n2.getAttribute(e2) === t2) return;
|
|
53
62
|
n2.setAttribute(e2, t2);
|
|
54
63
|
}
|
|
55
|
-
this.$isShowProp(
|
|
64
|
+
this.$isShowProp(b.vueAttrName(e2)) && HTMLElement.prototype.setAttribute.call(this, e2, t2), "value" === e2 && n2 ? this.value = n2.getAttribute(e2) : this.$attrChange(e2);
|
|
56
65
|
}
|
|
57
66
|
getAttribute(e2) {
|
|
58
67
|
const t2 = this[_AuiComponent.shadowSymbol].el;
|
|
@@ -61,11 +70,11 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
61
70
|
removeAttribute(e2) {
|
|
62
71
|
const t2 = this[_AuiComponent.shadowSymbol].el;
|
|
63
72
|
t2 && t2.removeAttribute(e2);
|
|
64
|
-
this.$isShowProp(
|
|
73
|
+
this.$isShowProp(b.vueAttrName(e2)) && HTMLElement.prototype.removeAttribute.call(this, e2), this.$attrChange(e2);
|
|
65
74
|
}
|
|
66
75
|
attributeChangedCallback(e2, t2, n2) {
|
|
67
|
-
const
|
|
68
|
-
|
|
76
|
+
const o2 = this[_AuiComponent.shadowSymbol].el;
|
|
77
|
+
o2 && t2 !== n2 && (this.$isShowProp(b.vueAttrName(e2)) || HTMLElement.prototype.removeAttribute.call(this, e2), o2.setAttribute(e2, n2 || ""), "value" !== e2 && this.$attrChange(e2));
|
|
69
78
|
}
|
|
70
79
|
static $anyToArray(e2) {
|
|
71
80
|
let t2 = [];
|
|
@@ -79,6 +88,9 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
79
88
|
} else e2 instanceof Array && (t2 = e2);
|
|
80
89
|
return t2;
|
|
81
90
|
}
|
|
91
|
+
$resetShadowSymbol() {
|
|
92
|
+
this[_AuiComponent.shadowSymbol] = { needHook: false, slot: {} };
|
|
93
|
+
}
|
|
82
94
|
$customEvent(e2, t2) {
|
|
83
95
|
this.dispatchEvent(new CustomEvent(e2, Object.assign({ bubbles: false, composed: false, cancelable: true }, t2 || {})));
|
|
84
96
|
}
|
|
@@ -86,17 +98,17 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
86
98
|
let e2 = null;
|
|
87
99
|
const t2 = this[_AuiComponent.shadowSymbol].slot;
|
|
88
100
|
for (const n2 in t2) {
|
|
89
|
-
const
|
|
90
|
-
e2 || (e2 = {}), e2[n2] =
|
|
101
|
+
const o2 = this.$slotCollection(t2[n2]);
|
|
102
|
+
e2 || (e2 = {}), e2[n2] = o2;
|
|
91
103
|
}
|
|
92
104
|
e2 && (this[_AuiComponent.shadowSymbol].slotCollection = e2), this.$customEvent("aui-force-update");
|
|
93
105
|
}
|
|
94
106
|
$slotCollection(e2) {
|
|
95
107
|
var _a;
|
|
96
|
-
const { start: t2, end: n2 } = e2,
|
|
97
|
-
let
|
|
98
|
-
for (; t2 && (
|
|
99
|
-
return
|
|
108
|
+
const { start: t2, end: n2 } = e2, o2 = [];
|
|
109
|
+
let r2;
|
|
110
|
+
for (; t2 && (r2 = t2.nextSibling) && r2 !== n2; ) (_a = t2.parentNode) == null ? void 0 : _a.removeChild(r2), o2.push(r2);
|
|
111
|
+
return o2;
|
|
100
112
|
}
|
|
101
113
|
$slotReplace() {
|
|
102
114
|
const e2 = this[_AuiComponent.shadowSymbol].slotCollection;
|
|
@@ -109,29 +121,30 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
109
121
|
}
|
|
110
122
|
$textContent(e2, ...t2) {
|
|
111
123
|
if (0 === t2.length) {
|
|
112
|
-
const t3 = [], { start: n2, end:
|
|
113
|
-
let
|
|
114
|
-
for (;
|
|
124
|
+
const t3 = [], { start: n2, end: o2 } = this.$slot(e2) || {};
|
|
125
|
+
let r2 = n2;
|
|
126
|
+
for (; r2 && (r2 = r2.nextSibling) && r2 !== o2; ) t3.push(r2.textContent);
|
|
115
127
|
return t3.join("");
|
|
116
128
|
}
|
|
117
|
-
return this.$replaceChildren(e2, [document.createTextNode(t2[0] || "")]), "";
|
|
129
|
+
return this.$hasSlot() ? (this.$replaceChildren(e2, [document.createTextNode(t2[0] || "")]), "") : "";
|
|
118
130
|
}
|
|
119
131
|
$innerHTML(e2, ...t2) {
|
|
120
132
|
if (0 === t2.length) {
|
|
121
|
-
const t3 = [], { start: n2, end:
|
|
122
|
-
let
|
|
123
|
-
for (;
|
|
133
|
+
const t3 = [], { start: n2, end: o2 } = this.$slot(e2) || {};
|
|
134
|
+
let r2 = n2;
|
|
135
|
+
for (; r2 && (r2 = r2.nextSibling) && r2 !== o2; ) if (r2.outerHTML) t3.push(r2.outerHTML);
|
|
124
136
|
else {
|
|
125
|
-
let e3 =
|
|
126
|
-
|
|
137
|
+
let e3 = r2.textContent;
|
|
138
|
+
r2 instanceof Comment && (e3 = `<!--${e3}-->`), t3.push(e3);
|
|
127
139
|
}
|
|
128
140
|
return t3.join("");
|
|
129
141
|
}
|
|
130
142
|
{
|
|
143
|
+
if (!this.$hasSlot()) return "";
|
|
131
144
|
const n2 = document.createElement("div");
|
|
132
145
|
n2.innerHTML = t2[0] || "";
|
|
133
|
-
const
|
|
134
|
-
this.$replaceChildren(e2,
|
|
146
|
+
const o2 = this.$moveChildren(n2);
|
|
147
|
+
this.$replaceChildren(e2, o2.default);
|
|
135
148
|
}
|
|
136
149
|
return "";
|
|
137
150
|
}
|
|
@@ -145,29 +158,36 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
145
158
|
const { end: n2 } = this.$slot(e2) || {};
|
|
146
159
|
return (_a = n2 == null ? void 0 : n2.parentNode) == null ? void 0 : _a.insertBefore(t2, n2), t2;
|
|
147
160
|
}
|
|
161
|
+
$insertBefore(e2, t2, n2) {
|
|
162
|
+
const { start: o2 } = this.$slot(e2) || {}, r2 = (o2 == null ? void 0 : o2.parentNode) || this;
|
|
163
|
+
return n2 ? r2 === this ? HTMLElement.prototype.insertBefore.call(this, t2, n2) : r2.insertBefore(t2, n2) : this.appendChild(t2), t2;
|
|
164
|
+
}
|
|
148
165
|
$childNodes(e2) {
|
|
149
|
-
const t2 = [], { start: n2, end:
|
|
150
|
-
let
|
|
151
|
-
for (;
|
|
166
|
+
const t2 = [], { start: n2, end: o2 } = this.$slot(e2) || {};
|
|
167
|
+
let r2 = n2;
|
|
168
|
+
for (; r2 && (r2 = r2.nextSibling) && r2 !== o2; ) t2.push(r2);
|
|
152
169
|
return t2;
|
|
153
170
|
}
|
|
154
171
|
$children(e2) {
|
|
155
|
-
const t2 = [], { start: n2, end:
|
|
156
|
-
let
|
|
157
|
-
for (;
|
|
172
|
+
const t2 = [], { start: n2, end: o2 } = this.$slot(e2) || {};
|
|
173
|
+
let r2 = n2;
|
|
174
|
+
for (; r2 && (r2 = r2.nextSibling) && r2 !== o2; ) r2 instanceof HTMLElement && t2.push(r2);
|
|
158
175
|
return t2;
|
|
159
176
|
}
|
|
160
177
|
$replaceChildren(e2, t2) {
|
|
161
178
|
var _a, _b;
|
|
162
|
-
const { start: n2, end:
|
|
163
|
-
let
|
|
164
|
-
for (; n2 && (
|
|
165
|
-
if (
|
|
179
|
+
const { start: n2, end: o2 } = this.$slot(e2) || {};
|
|
180
|
+
let r2 = null;
|
|
181
|
+
for (; n2 && (r2 = n2.nextSibling) && r2 !== o2; ) (_a = r2.parentNode) == null ? void 0 : _a.removeChild(r2);
|
|
182
|
+
if (o2) for (; r2 = t2.shift(); ) (_b = o2.parentNode) == null ? void 0 : _b.insertBefore(r2, o2);
|
|
166
183
|
}
|
|
167
184
|
$slot(e2, t2) {
|
|
168
185
|
if (e2 = e2 || "default", !t2) return this[_AuiComponent.shadowSymbol].slot[e2];
|
|
169
186
|
this[_AuiComponent.shadowSymbol].slot[e2] = t2;
|
|
170
187
|
}
|
|
188
|
+
$hasSlot() {
|
|
189
|
+
return Object.keys(this[_AuiComponent.shadowSymbol].slot).length > 0;
|
|
190
|
+
}
|
|
171
191
|
$needHook(e2) {
|
|
172
192
|
return "boolean" == typeof e2 && (this[_AuiComponent.shadowSymbol].needHook = e2), this[_AuiComponent.shadowSymbol].needHook;
|
|
173
193
|
}
|
|
@@ -177,13 +197,13 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
177
197
|
var _a;
|
|
178
198
|
const t2 = (e2 = e2 || this).childNodes, n2 = { default: [] };
|
|
179
199
|
for (; t2.length > 0; ) {
|
|
180
|
-
const
|
|
181
|
-
if ((_a =
|
|
182
|
-
const t3 =
|
|
200
|
+
const o2 = t2[0];
|
|
201
|
+
if ((_a = o2.parentNode) == null ? void 0 : _a.removeChild(o2), $.$isForAuiSlot(o2)) {
|
|
202
|
+
const t3 = o2.getAttribute("for") || "default";
|
|
183
203
|
n2[t3] = n2[t3] || [];
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
} else n2.default.push(
|
|
204
|
+
const r2 = Array.prototype.slice.call(o2.childNodes);
|
|
205
|
+
$.prototype.$bind.call(o2, e2), n2[t3].push(...r2);
|
|
206
|
+
} else n2.default.push(o2);
|
|
187
207
|
}
|
|
188
208
|
return n2;
|
|
189
209
|
}
|
|
@@ -194,54 +214,54 @@ const _AuiComponent = class _AuiComponent extends (c = HTMLElement, h = m, c) {
|
|
|
194
214
|
$attrChange(e2) {
|
|
195
215
|
if ("value" === e2) {
|
|
196
216
|
const e3 = this.value;
|
|
197
|
-
|
|
217
|
+
HTMLElement.prototype.hasAttribute.call(this, p) ? this.$call("$emit", "update:value", e3) : this.$customEvent("input", { bubbles: true, composed: true });
|
|
198
218
|
}
|
|
199
|
-
this.$customEvent("aui-attr-change", { bubbles: true, composed: true, detail: { attributeName:
|
|
219
|
+
this.$customEvent("aui-attr-change", { bubbles: true, composed: true, detail: { attributeName: b.vueAttrName(e2) } });
|
|
200
220
|
}
|
|
201
221
|
$initAttrs() {
|
|
202
222
|
const e2 = this.attributes, t2 = document.createElement("div");
|
|
203
223
|
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
204
|
-
const
|
|
205
|
-
t2.setAttribute(
|
|
224
|
+
const o2 = e2[n2];
|
|
225
|
+
t2.setAttribute(o2.name, o2.value), this.$isShowProp(b.vueAttrName(o2.name)) || HTMLElement.prototype.removeAttribute.call(this, o2.name), "value" === o2.name && (this.value = o2.value);
|
|
206
226
|
}
|
|
207
227
|
Object.defineProperty(this, "attributes", { get value() {
|
|
208
228
|
return t2.attributes;
|
|
209
229
|
}, writable: false }), this[_AuiComponent.shadowSymbol].el = t2;
|
|
210
230
|
}
|
|
211
231
|
$isShowProp(e2) {
|
|
212
|
-
if (
|
|
232
|
+
if (b.isVueAttr(e2)) return true;
|
|
213
233
|
const t2 = this.$getProp(e2), n2 = t2 == null ? void 0 : t2.show;
|
|
214
234
|
return n2;
|
|
215
235
|
}
|
|
216
236
|
$getProp(e2) {
|
|
217
237
|
var _a;
|
|
218
|
-
const t2 =
|
|
238
|
+
const t2 = b.cache.getAuiVueDefined(this.tagName);
|
|
219
239
|
return (((_a = t2 == null ? void 0 : t2.origin) == null ? void 0 : _a.props) || {})[e2];
|
|
220
240
|
}
|
|
221
241
|
$initVue() {
|
|
222
242
|
if (this.__hasVue__) return;
|
|
223
243
|
this.__hasVue__ = true;
|
|
224
244
|
const t2 = this.tagName.toLowerCase();
|
|
225
|
-
|
|
245
|
+
b.cache.getAuiVueDefined(t2) && e(b.createVueComponent(t2, this)).mount(this);
|
|
226
246
|
}
|
|
227
247
|
$needInit() {
|
|
228
|
-
return !
|
|
248
|
+
return !HTMLElement.prototype.hasAttribute.call(this, p);
|
|
229
249
|
}
|
|
230
250
|
$bindVue(e2) {
|
|
231
251
|
var _a, _b;
|
|
232
252
|
if (this[_AuiComponent.shadowSymbol].ref) return;
|
|
233
253
|
this[_AuiComponent.shadowSymbol].ref = e2, this.__hasVue__ = true, this.$customEvent("aui-init", { bubbles: false, detail: { code: 0 } });
|
|
234
|
-
const t2 = (_b = (_a =
|
|
254
|
+
const t2 = (_b = (_a = b.cache.getAuiVueDefined(this.tagName)) == null ? void 0 : _a.origin) == null ? void 0 : _b.auiInit;
|
|
235
255
|
t2 && t2.call(e2);
|
|
236
256
|
}
|
|
237
257
|
$call(e2, ...t2) {
|
|
238
258
|
const n2 = this[_AuiComponent.shadowSymbol].ref;
|
|
239
|
-
return
|
|
259
|
+
return b.$call(n2, e2, ...t2);
|
|
240
260
|
}
|
|
241
261
|
};
|
|
242
|
-
_AuiComponent.shadowSymbol =
|
|
262
|
+
_AuiComponent.shadowSymbol = f;
|
|
243
263
|
let AuiComponent = _AuiComponent;
|
|
244
|
-
class
|
|
264
|
+
class $ extends HTMLElement {
|
|
245
265
|
constructor() {
|
|
246
266
|
super();
|
|
247
267
|
}
|
|
@@ -250,67 +270,75 @@ class f extends HTMLElement {
|
|
|
250
270
|
}
|
|
251
271
|
set textContent(e2) {
|
|
252
272
|
var _a;
|
|
253
|
-
this._name_ ? (_a = this._el_) == null ? void 0 : _a.$textContent(this._name_, e2) :
|
|
273
|
+
this._name_ ? (_a = this._el_) == null ? void 0 : _a.$textContent(this._name_, e2) : Reflect.set(HTMLElement.prototype, "textContent", e2, this);
|
|
254
274
|
}
|
|
255
275
|
set innerHTML(e2) {
|
|
256
276
|
var _a;
|
|
257
|
-
this._name_ ? (_a = this._el_) == null ? void 0 : _a.$innerHTML(this._name_, e2) :
|
|
277
|
+
this._name_ ? (_a = this._el_) == null ? void 0 : _a.$innerHTML(this._name_, e2) : Reflect.set(HTMLElement.prototype, "innerHTML", e2, this);
|
|
258
278
|
}
|
|
259
279
|
prepend(e2) {
|
|
260
280
|
var _a;
|
|
261
|
-
this._name_ ? (_a = this._el_) == null ? void 0 : _a.$prepend(this._name_, e2) :
|
|
281
|
+
this._name_ ? (_a = this._el_) == null ? void 0 : _a.$prepend(this._name_, e2) : HTMLElement.prototype.prepend.call(this, e2);
|
|
262
282
|
}
|
|
263
283
|
appendChild(e2) {
|
|
264
284
|
var _a;
|
|
265
|
-
return this._name_ ? ((_a = this._el_) == null ? void 0 : _a.$appendChild(this._name_, e2), e2) :
|
|
285
|
+
return this._name_ ? ((_a = this._el_) == null ? void 0 : _a.$appendChild(this._name_, e2), e2) : HTMLElement.prototype.appendChild.call(this, e2);
|
|
266
286
|
}
|
|
267
287
|
static $isAuiSlot(e2) {
|
|
268
288
|
return !(!e2 || e2.nodeType !== Node.ELEMENT_NODE) && "aui-slot" === e2.tagName.toLowerCase();
|
|
269
289
|
}
|
|
270
290
|
static $isForAuiSlot(e2) {
|
|
271
|
-
return !(
|
|
291
|
+
return !(!$.$isAuiSlot(e2) || !e2.hasAttribute("for"));
|
|
272
292
|
}
|
|
273
293
|
$bind(e2) {
|
|
274
294
|
this._el_ = e2, this._name_ = this.getAttribute("for") || "default";
|
|
275
295
|
}
|
|
276
296
|
$replace(e2) {
|
|
277
|
-
const t2 = this.getAttribute("name") || "default", n2 = document.createComment(`aui-slot-${t2}-start`),
|
|
278
|
-
e2.$slot(t2, { start: n2, end:
|
|
297
|
+
const t2 = this.getAttribute("name") || "default", n2 = document.createComment(`aui-slot-${t2}-start`), o2 = document.createComment(`aui-slot-${t2}-end`);
|
|
298
|
+
e2.$slot(t2, { start: n2, end: o2 }), this.$replaceWith(n2, o2);
|
|
299
|
+
}
|
|
300
|
+
$replaceWith(...e2) {
|
|
301
|
+
var _a;
|
|
302
|
+
e2.forEach((e3) => {
|
|
303
|
+
var _a2;
|
|
304
|
+
(_a2 = this.parentNode) == null ? void 0 : _a2.insertBefore(e3, this);
|
|
305
|
+
}), (_a = this.parentNode) == null ? void 0 : _a.removeChild(this);
|
|
279
306
|
}
|
|
280
307
|
}
|
|
281
|
-
const
|
|
282
|
-
|
|
308
|
+
const b = { init: () => (b.defineSlot(), b), defineSlot() {
|
|
309
|
+
b.defineCustomElement("aui-slot", $);
|
|
283
310
|
}, $call(e2, t2, ...n2) {
|
|
284
311
|
if (!e2) return new Error("not init");
|
|
285
312
|
if (!t2) return e2;
|
|
286
313
|
if ("function" == typeof e2[t2]) return e2[t2].call(e2, ...n2);
|
|
287
|
-
const
|
|
288
|
-
let
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
314
|
+
const o2 = t2.split(".");
|
|
315
|
+
let r2 = e2, i2 = null;
|
|
316
|
+
const s2 = o2.pop() || "";
|
|
317
|
+
for (; i2 = o2.shift(); ) {
|
|
318
|
+
if (!Object.prototype.hasOwnProperty.call(r2, i2)) return new Error("no match name");
|
|
319
|
+
r2 = r2[i2];
|
|
320
|
+
}
|
|
321
|
+
return 0 === n2.length ? r2[s2] : (r2[s2] = n2[0], null);
|
|
294
322
|
}, formatName: (e2) => e2 ? (e2 = e2.replace(/[A-Z]/g, function(e3) {
|
|
295
323
|
return "-" + e3.toLowerCase();
|
|
296
|
-
}), d + e2) : "", cache: { defined:
|
|
324
|
+
}), d + e2) : "", cache: { defined: {}, getAuiVueDefined: (e2) => (e2 = e2.toLowerCase(), b.cache.defined[e2]), getAuiPropNames(e2) {
|
|
297
325
|
var _a;
|
|
298
|
-
const t2 =
|
|
299
|
-
for (const e3 in n2)
|
|
300
|
-
return
|
|
326
|
+
const t2 = b.cache.getAuiVueDefined(e2), n2 = ((_a = t2 == null ? void 0 : t2.origin) == null ? void 0 : _a.props) || {}, o2 = [];
|
|
327
|
+
for (const e3 in n2) o2.push(b.auiAttrName(e3));
|
|
328
|
+
return -1 === o2.indexOf(m) && o2.push(m), o2;
|
|
301
329
|
}, addHooks(e2, t2) {
|
|
302
330
|
e2 = e2.toLowerCase();
|
|
303
|
-
const n2 =
|
|
304
|
-
n2 ? (n2.hooks = n2.hooks || [], n2.hooks.push(t2)) :
|
|
331
|
+
const n2 = b.cache.getAuiVueDefined(e2);
|
|
332
|
+
n2 ? (n2.hooks = n2.hooks || [], n2.hooks.push(t2)) : b.cache.defined[e2] = { hooks: [t2] };
|
|
305
333
|
} }, createExtendComp: (e2) => {
|
|
306
334
|
var _a, _b;
|
|
307
|
-
return t({ props: {
|
|
335
|
+
return t({ props: { [m]: { type: String }, value: { type: ((_b = (_a = e2.props) == null ? void 0 : _a.value) == null ? void 0 : _b.type) || [String, Number, Array] } }, methods: { $anyToArray: AuiComponent.$anyToArray, $value(...e3) {
|
|
308
336
|
const t2 = this.$aui();
|
|
309
337
|
if (0 === e3.length) return t2 == null ? void 0 : t2.value;
|
|
310
338
|
t2 && (t2.value = e3[0]);
|
|
311
339
|
}, $call(e3, ...t2) {
|
|
312
340
|
const n2 = this.$aui();
|
|
313
|
-
return n2 ?
|
|
341
|
+
return n2 ? b.$call(n2, e3, ...t2) : null;
|
|
314
342
|
}, $aui() {
|
|
315
343
|
var _a2;
|
|
316
344
|
return (_a2 = this.$el) == null ? void 0 : _a2.parentNode;
|
|
@@ -318,21 +346,21 @@ const $ = { init: () => ($.defineSlot(), $), defineSlot() {
|
|
|
318
346
|
}, patchDefaultProps(e2) {
|
|
319
347
|
var _a, _b;
|
|
320
348
|
const t2 = (_b = (_a = e2.props) == null ? void 0 : _a.value) == null ? void 0 : _b.type;
|
|
321
|
-
return e2.mixins || (e2.mixins = []), e2.mixins.push(
|
|
349
|
+
return e2.mixins || (e2.mixins = []), e2.mixins.push(b.createExtendComp(e2)), t2;
|
|
322
350
|
}, defineAuiComponent(e2, t2, n2) {
|
|
323
351
|
var _a, _b;
|
|
324
|
-
const
|
|
325
|
-
if ((_a =
|
|
352
|
+
const o2 = b.patchDefaultProps(n2);
|
|
353
|
+
if ((_a = b.cache.defined[e2]) == null ? void 0 : _a.origin) b.cache.defined[e2].origin = n2;
|
|
326
354
|
else {
|
|
327
|
-
class
|
|
355
|
+
class r2 extends AuiComponent {
|
|
328
356
|
constructor() {
|
|
329
|
-
super({ valueType:
|
|
357
|
+
super({ valueType: o2 });
|
|
330
358
|
}
|
|
331
359
|
static get observedAttributes() {
|
|
332
|
-
return
|
|
360
|
+
return b.cache.getAuiPropNames(e2);
|
|
333
361
|
}
|
|
334
362
|
}
|
|
335
|
-
|
|
363
|
+
b.cache.defined[e2] = { aui: r2, vue: t2, origin: n2, hooks: ((_b = b.cache.defined[e2]) == null ? void 0 : _b.hooks) || [] }, b.defineCustomElement(e2, r2);
|
|
336
364
|
}
|
|
337
365
|
}, defineCustomElement(e2, t2) {
|
|
338
366
|
try {
|
|
@@ -341,73 +369,74 @@ const $ = { init: () => ($.defineSlot(), $), defineSlot() {
|
|
|
341
369
|
}
|
|
342
370
|
}, sameComponent(e2, t2) {
|
|
343
371
|
if (!Object.prototype.hasOwnProperty.call(t2, "__hmrId")) return false;
|
|
344
|
-
const n2 =
|
|
345
|
-
return !!
|
|
372
|
+
const n2 = b.cache.getAuiVueDefined(e2), o2 = n2 == null ? void 0 : n2.origin;
|
|
373
|
+
return !!o2 && t2.__hmrId === o2.__hmrId;
|
|
346
374
|
}, notifyComponentUpdate(e2) {
|
|
347
375
|
document.querySelectorAll(e2).forEach((e3) => {
|
|
348
376
|
e3.$forceUpdate();
|
|
349
377
|
});
|
|
350
378
|
}, define(e2, t2 = true) {
|
|
351
|
-
const n2 =
|
|
379
|
+
const n2 = b.formatName(e2.name);
|
|
352
380
|
if (!n2) return e2;
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
return
|
|
381
|
+
const o2 = b.cache.getAuiVueDefined(n2);
|
|
382
|
+
if (o2 && o2.vue) return (t2 || b.sameComponent(n2, e2)) && (b.defineAuiComponent(n2, o2.vue, e2), b.notifyComponentUpdate(n2)), o2.vue;
|
|
383
|
+
const r2 = b.createVueComponent(n2);
|
|
384
|
+
return b.defineAuiComponent(n2, r2, e2), r2;
|
|
357
385
|
}, createTempSlot(e2) {
|
|
358
386
|
const t2 = {};
|
|
359
387
|
return Object.keys(e2).forEach((e3) => {
|
|
360
|
-
t2[e3] = () =>
|
|
388
|
+
t2[e3] = () => l("aui-slot", { name: e3 });
|
|
361
389
|
}), t2;
|
|
362
390
|
}, replaceTempSlot(e2, t2) {
|
|
363
391
|
Object.keys(t2).forEach((n2) => {
|
|
364
|
-
const
|
|
365
|
-
|
|
392
|
+
const o2 = e2.querySelector(`aui-slot[name="${n2}"]`);
|
|
393
|
+
o2 && ($.prototype.$replace.call(o2, e2), e2.$replaceChildren(n2, t2[n2]));
|
|
366
394
|
});
|
|
367
395
|
}, createVueComponent(e2, t2) {
|
|
368
|
-
const
|
|
396
|
+
const u2 = t2 ? t2.$moveChildren() : { default: [] };
|
|
369
397
|
return { setup() {
|
|
370
|
-
const h2 = n(), c2 =
|
|
398
|
+
const h2 = n(), c2 = o(null), d2 = o(null), m2 = r({}), f2 = o(t2 ? b.createTempSlot(u2) : i()), $2 = o(null);
|
|
371
399
|
return s(() => {
|
|
372
|
-
c2.value && d2.value && d2.value.$bindVue && (d2.value.$bindVue(c2.value), t2 &&
|
|
373
|
-
d2.value && (m2.value =
|
|
400
|
+
c2.value && d2.value && d2.value.$bindVue && (d2.value.$bindVue(c2.value), t2 && b.replaceTempSlot(t2, u2), d2.value.addEventListener("aui-attr-change", () => {
|
|
401
|
+
d2.value && (m2.value = b.getAuiAttrs(d2.value));
|
|
374
402
|
}), d2.value.addEventListener("aui-force-update", () => {
|
|
375
|
-
|
|
403
|
+
$2.value = null;
|
|
376
404
|
}), d2.value.$call("$emit", "update:value", d2.value.value));
|
|
377
405
|
}), a(() => {
|
|
378
406
|
d2.value && d2.value.$slotReplace();
|
|
379
407
|
}), () => {
|
|
380
|
-
if (t2 && (d2.value = t2, m2.value =
|
|
381
|
-
const n2 =
|
|
382
|
-
return t2 ? n2 :
|
|
408
|
+
if (t2 && (d2.value = t2, m2.value = b.getAuiAttrs(t2)), $2.value || ($2.value = b.formatStructure(e2)), !$2.value) return null;
|
|
409
|
+
const n2 = l($2.value, { ...h2, ...m2.value, ref: c2 }, f2.value || {});
|
|
410
|
+
return t2 ? n2 : l(e2, { ref: d2, [p]: "" }, [n2]);
|
|
383
411
|
};
|
|
384
412
|
} };
|
|
385
413
|
}, getAuiAttrs(e2) {
|
|
386
414
|
const t2 = {}, n2 = e2.attributes;
|
|
387
415
|
for (let e3 = 0; e3 < n2.length; e3++) {
|
|
388
|
-
const
|
|
389
|
-
|
|
416
|
+
const o2 = n2[e3];
|
|
417
|
+
o2.name === d || b.isVueAttr(o2.name) || (t2[o2.name] = o2.value);
|
|
390
418
|
}
|
|
391
419
|
return null !== e2.value && (t2.value = e2.value), t2;
|
|
392
|
-
}, isVueAttr: (e2) => 0 === e2.indexOf("data-v-"), auiAttrName: (e2) => e2.replace(/([A-Z])/g, (e3) => "-" + e3.toLowerCase()), vueAttrName: (e2) =>
|
|
393
|
-
|
|
420
|
+
}, isVueAttr: (e2) => 0 === e2.indexOf("data-v-"), auiAttrName: (e2) => e2.replace(/([A-Z])/g, (e3) => "-" + e3.toLowerCase()), vueAttrName: (e2) => b.isVueAttr(e2) ? e2 : e2.replace(/-([a-z])/g, (e3, t2) => t2.toUpperCase()), hookStructure(e2, t2) {
|
|
421
|
+
b.cache.addHooks(e2, t2);
|
|
394
422
|
}, getHookStructure(e2) {
|
|
395
|
-
const t2 =
|
|
423
|
+
const t2 = b.cache.getAuiVueDefined(e2);
|
|
396
424
|
return ((t2 == null ? void 0 : t2.hooks) || []).slice(0);
|
|
397
425
|
}, formatStructure(e2) {
|
|
398
|
-
const t2 =
|
|
426
|
+
const t2 = b.cache.getAuiVueDefined(e2);
|
|
399
427
|
if (!(t2 == null ? void 0 : t2.origin)) return null;
|
|
400
|
-
let n2 =
|
|
401
|
-
const
|
|
402
|
-
let
|
|
403
|
-
for (;
|
|
404
|
-
const e3 =
|
|
428
|
+
let n2 = u({}, t2.origin);
|
|
429
|
+
const o2 = b.getHookStructure(e2);
|
|
430
|
+
let r2;
|
|
431
|
+
for (; r2 = o2.shift(); ) {
|
|
432
|
+
const e3 = r2(n2);
|
|
405
433
|
e3 && (n2 = e3);
|
|
406
434
|
}
|
|
407
435
|
return n2;
|
|
408
|
-
} },
|
|
436
|
+
} }, y = b.init();
|
|
409
437
|
export {
|
|
410
438
|
AuiComponent,
|
|
411
|
-
|
|
439
|
+
$ as AuiSlot,
|
|
440
|
+
y as default
|
|
412
441
|
};
|
|
413
442
|
//# sourceMappingURL=core.es.js.map
|