@dooboostore/simple-web-component 1.0.15 → 1.0.16
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/README.md +183 -92
- package/dist/cjs/decorators/addEventListener.js +2 -3
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +89 -33
- package/dist/cjs/decorators/elementDefine.js.map +2 -2
- package/dist/cjs/decorators/emitCustomEvent.js +2 -14
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/query.js +25 -36
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +28 -36
- package/dist/cjs/decorators/queryAll.js.map +2 -2
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/utils/Utils.js +36 -143
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +2 -3
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +89 -33
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +2 -14
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/query.js +25 -36
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +28 -36
- package/dist/esm/decorators/queryAll.js.map +2 -2
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +2 -2
- package/dist/esm/utils/Utils.js +36 -143
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +183 -266
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +3 -3
- package/dist/types/decorators/addEventListener.d.ts +9 -4
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +6 -5
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +6 -5
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +6 -14
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +183 -266
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +3 -3
- package/package.json +3 -3
- package/src/decorators/addEventListener.ts +10 -7
- package/src/decorators/elementDefine.ts +86 -31
- package/src/decorators/emitCustomEvent.ts +5 -21
- package/src/decorators/query.ts +33 -46
- package/src/decorators/queryAll.ts +36 -46
- package/src/types.ts +6 -4
- package/src/utils/Utils.ts +40 -176
package/dist/cjs/utils/Utils.js
CHANGED
|
@@ -21,149 +21,45 @@ __export(Utils_exports, {
|
|
|
21
21
|
SwcUtils: () => SwcUtils
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Utils_exports);
|
|
24
|
+
var import_elementDefine = require("../decorators/elementDefine");
|
|
24
25
|
const SWC_NOT_FOUND = Symbol("SWC_NOT_FOUND");
|
|
25
26
|
class SwcUtils {
|
|
26
27
|
static getValueByPath(obj, path, rootName) {
|
|
27
28
|
if (!obj || !path) return SWC_NOT_FOUND;
|
|
28
29
|
const parts = path.split(".");
|
|
29
|
-
|
|
30
|
-
const subParts = parts.slice(1);
|
|
31
|
-
let subResult = obj;
|
|
32
|
-
for (const part of subParts) {
|
|
33
|
-
if (subResult === null || typeof subResult !== "object" || !(part in subResult)) return SWC_NOT_FOUND;
|
|
34
|
-
subResult = subResult[part];
|
|
35
|
-
}
|
|
36
|
-
return subResult;
|
|
37
|
-
}
|
|
38
|
-
let result = obj;
|
|
30
|
+
let current = obj;
|
|
39
31
|
for (const part of parts) {
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
result = result[part];
|
|
44
|
-
}
|
|
45
|
-
if (result !== obj && !(result instanceof HTMLElement)) {
|
|
46
|
-
return result;
|
|
32
|
+
if (current === null || current === void 0) return SWC_NOT_FOUND;
|
|
33
|
+
current = current[part];
|
|
47
34
|
}
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
static evalExpression(expr, context) {
|
|
51
|
-
try {
|
|
52
|
-
const keys = Object.keys(context);
|
|
53
|
-
const values = Object.values(context);
|
|
54
|
-
return new Function(...keys, `return (${expr})`).apply(null, values);
|
|
55
|
-
} catch {
|
|
56
|
-
return SWC_NOT_FOUND;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
static applyData(node, data, options) {
|
|
60
|
-
const { asKey, asIndexKey, index, hostContext } = options;
|
|
61
|
-
const context = {};
|
|
62
|
-
if (index !== void 0) {
|
|
63
|
-
context[asIndexKey] = index;
|
|
64
|
-
}
|
|
65
|
-
if (data !== null && data !== void 0) {
|
|
66
|
-
context[asKey] = data;
|
|
67
|
-
context["value"] = data;
|
|
68
|
-
}
|
|
69
|
-
const fullContext = { ...hostContext || {}, ...context };
|
|
70
|
-
const resolveExpr = (expr, match) => {
|
|
71
|
-
expr = expr.trim();
|
|
72
|
-
const simpleVal = SwcUtils.getValueByPath(data, expr, asKey);
|
|
73
|
-
if (simpleVal !== SWC_NOT_FOUND && typeof simpleVal !== "symbol") {
|
|
74
|
-
return simpleVal === null || simpleVal === void 0 ? "" : String(simpleVal);
|
|
75
|
-
}
|
|
76
|
-
const exprVal = SwcUtils.evalExpression(expr, fullContext);
|
|
77
|
-
if (exprVal !== SWC_NOT_FOUND && typeof exprVal !== "symbol") {
|
|
78
|
-
return exprVal === null || exprVal === void 0 ? "" : String(exprVal);
|
|
79
|
-
}
|
|
80
|
-
return match;
|
|
81
|
-
};
|
|
82
|
-
const walk = (n) => {
|
|
83
|
-
if (n.nodeType === Node.TEXT_NODE) {
|
|
84
|
-
if (!n._original) n._original = n.textContent;
|
|
85
|
-
let text = n._original;
|
|
86
|
-
text = text.replace(/{{(.*?)}}/g, (match, path) => {
|
|
87
|
-
return resolveExpr(path, match);
|
|
88
|
-
});
|
|
89
|
-
if (n.textContent !== text) n.textContent = text;
|
|
90
|
-
} else if (n.nodeType === Node.ELEMENT_NODE) {
|
|
91
|
-
const el = n;
|
|
92
|
-
Array.from(el.attributes).forEach((a) => {
|
|
93
|
-
if (!a._original) a._original = a.value;
|
|
94
|
-
let val = a._original;
|
|
95
|
-
val = val.replace(/{{(.*?)}}/g, (match, path) => {
|
|
96
|
-
return resolveExpr(path, match);
|
|
97
|
-
});
|
|
98
|
-
if (a.value !== val) a.value = val;
|
|
99
|
-
});
|
|
100
|
-
el.childNodes.forEach(walk);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
walk(node);
|
|
104
|
-
}
|
|
105
|
-
static createReactiveProxy(target, onChange, onIndexChange) {
|
|
106
|
-
const makeRecursiveProxy = (obj) => {
|
|
107
|
-
if (typeof obj !== "object" || obj === null || obj instanceof Node) return obj;
|
|
108
|
-
if (obj.__swc_is_proxy) return obj;
|
|
109
|
-
const IS_PROXY_KEY = "__swc_is_proxy";
|
|
110
|
-
const proxy = new Proxy(obj, {
|
|
111
|
-
get: (t, prop) => {
|
|
112
|
-
if (prop === IS_PROXY_KEY) return true;
|
|
113
|
-
if (typeof prop === "symbol") return t[prop];
|
|
114
|
-
return t[prop];
|
|
115
|
-
},
|
|
116
|
-
set: (t, prop, val) => {
|
|
117
|
-
if (prop === IS_PROXY_KEY) return true;
|
|
118
|
-
if (typeof prop === "symbol") {
|
|
119
|
-
t[prop] = val;
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
const oldVal = t[prop];
|
|
123
|
-
if (oldVal === val) return true;
|
|
124
|
-
t[prop] = makeRecursiveProxy(val);
|
|
125
|
-
const isIndex = !isNaN(Number(prop)) && Array.isArray(t);
|
|
126
|
-
if (isIndex && onIndexChange) {
|
|
127
|
-
onIndexChange(Number(prop), val);
|
|
128
|
-
} else {
|
|
129
|
-
onChange();
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
},
|
|
133
|
-
deleteProperty: (t, prop) => {
|
|
134
|
-
delete t[prop];
|
|
135
|
-
onChange();
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
return proxy;
|
|
140
|
-
};
|
|
141
|
-
return makeRecursiveProxy(target);
|
|
35
|
+
return current;
|
|
142
36
|
}
|
|
143
37
|
static findNearestSwcHost(el) {
|
|
144
|
-
|
|
145
|
-
|
|
38
|
+
let current = el instanceof Node && !(el instanceof HTMLElement) ? el.host : el;
|
|
39
|
+
current = current?.parentElement || current?.getRootNode()?.host;
|
|
40
|
+
while (current) {
|
|
41
|
+
if ((0, import_elementDefine.getElementConfig)(current)) return current;
|
|
42
|
+
current = current.parentElement || current?.getRootNode()?.host;
|
|
43
|
+
}
|
|
44
|
+
return void 0;
|
|
146
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Returns all SWC ancestors (excluding self) in [root, ..., parent] order.
|
|
48
|
+
*/
|
|
147
49
|
static findAllSwcHosts(el) {
|
|
148
50
|
const hosts = [];
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
curr = curr.parentElement || curr?.getRootNode()?.host;
|
|
51
|
+
let current = this.findNearestSwcHost(el);
|
|
52
|
+
while (current) {
|
|
53
|
+
hosts.push(current);
|
|
54
|
+
current = this.findNearestSwcHost(current);
|
|
154
55
|
}
|
|
155
56
|
return hosts.reverse();
|
|
156
57
|
}
|
|
157
58
|
static getHosts(el) {
|
|
158
|
-
return this.findAllSwcHosts(el);
|
|
59
|
+
return [...this.findAllSwcHosts(el), el];
|
|
159
60
|
}
|
|
160
61
|
static getHost(el) {
|
|
161
|
-
|
|
162
|
-
return hosts.length > 0 ? hosts[hosts.length - 1] : void 0;
|
|
163
|
-
}
|
|
164
|
-
static getFirstHost(el) {
|
|
165
|
-
const hosts = this.getHosts(el);
|
|
166
|
-
return hosts.length > 0 ? hosts[0] : void 0;
|
|
62
|
+
return el;
|
|
167
63
|
}
|
|
168
64
|
static getAppHosts(el) {
|
|
169
65
|
const hosts = this.getHosts(el);
|
|
@@ -171,31 +67,28 @@ class SwcUtils {
|
|
|
171
67
|
}
|
|
172
68
|
static getAppHost(el) {
|
|
173
69
|
const appHosts = this.getAppHosts(el);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
static getFirstAppHost(el) {
|
|
177
|
-
const appHosts = this.getAppHosts(el);
|
|
178
|
-
return appHosts.length > 0 ? appHosts[0] : void 0;
|
|
179
|
-
}
|
|
180
|
-
static getLastAppHost(el) {
|
|
181
|
-
return this.getAppHost(el);
|
|
70
|
+
const appHostsWithoutSelf = appHosts.filter((h) => h !== el);
|
|
71
|
+
return appHostsWithoutSelf.length > 0 ? appHostsWithoutSelf[appHostsWithoutSelf.length - 1] : void 0;
|
|
182
72
|
}
|
|
183
73
|
static getHostSet(el) {
|
|
184
|
-
const
|
|
185
|
-
const $
|
|
186
|
-
const $
|
|
187
|
-
const $
|
|
188
|
-
const $
|
|
189
|
-
const $
|
|
74
|
+
const ancestors = this.findAllSwcHosts(el);
|
|
75
|
+
const $host = el;
|
|
76
|
+
const $hosts = [...ancestors, $host];
|
|
77
|
+
const $parentHost = ancestors.length > 0 ? ancestors[ancestors.length - 1] : null;
|
|
78
|
+
const $firstHost = ancestors.length > 0 ? ancestors[0] : null;
|
|
79
|
+
const $appHosts = $hosts.filter((h) => h.tagName.toLowerCase() === "swc-app" || h.getAttribute("is")?.startsWith("swc-app-"));
|
|
80
|
+
const $appHost = $appHosts.length > 0 ? $appHosts[$appHosts.length - 1] === el ? $appHosts.length > 1 ? $appHosts[$appHosts.length - 2] : null : $appHosts[$appHosts.length - 1] : null;
|
|
81
|
+
const $firstAppHost = $appHosts.length > 0 ? $appHosts[0] : null;
|
|
190
82
|
return {
|
|
191
|
-
$host
|
|
83
|
+
$host,
|
|
84
|
+
$parentHost,
|
|
192
85
|
$hosts,
|
|
193
86
|
$firstHost,
|
|
194
|
-
$lastHost,
|
|
195
|
-
$appHost
|
|
87
|
+
$lastHost: $parentHost,
|
|
88
|
+
$appHost,
|
|
196
89
|
$appHosts,
|
|
197
90
|
$firstAppHost,
|
|
198
|
-
$lastAppHost
|
|
91
|
+
$lastAppHost: $appHost
|
|
199
92
|
};
|
|
200
93
|
}
|
|
201
94
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/Utils.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { SwcAppInterface, HostSet } from '../types';\nimport { getElementConfig } from '../decorators/elementDefine';\n\nexport const SWC_NOT_FOUND = Symbol('SWC_NOT_FOUND');\n\nexport class SwcUtils {\n static getValueByPath(obj: any, path: string, rootName: string) {\n if (!obj || !path) return SWC_NOT_FOUND;\n\n const parts = path.split('.');\n let current = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined) return SWC_NOT_FOUND;\n current = current[part];\n }\n return current;\n }\n\n static findNearestSwcHost(el: HTMLElement | Node): HTMLElement | undefined {\n let current: any = el instanceof Node && !(el instanceof HTMLElement) ? (el as any).host : el;\n current = current?.parentElement || (current?.getRootNode() as any)?.host;\n\n while (current) {\n if (getElementConfig(current)) return current as HTMLElement;\n current = current.parentElement || (current?.getRootNode() as any)?.host;\n }\n return undefined;\n }\n\n /**\n * Returns all SWC ancestors (excluding self) in [root, ..., parent] order.\n */\n static findAllSwcHosts(el: HTMLElement | Node): HTMLElement[] {\n const hosts: HTMLElement[] = [];\n let current = this.findNearestSwcHost(el);\n while (current) {\n hosts.push(current);\n current = this.findNearestSwcHost(current);\n }\n return hosts.reverse();\n }\n\n static getHosts(el: HTMLElement): HTMLElement[] {\n return [...this.findAllSwcHosts(el), el];\n }\n\n static getHost(el: HTMLElement): HTMLElement | undefined {\n return el;\n }\n\n static getAppHosts(el: HTMLElement): SwcAppInterface[] {\n const hosts = this.getHosts(el);\n return hosts.filter(host => host.tagName.toLowerCase() === 'swc-app' || host.getAttribute('is')?.startsWith('swc-app-')) as SwcAppInterface[];\n }\n\n static getAppHost(el: HTMLElement): SwcAppInterface | undefined {\n const appHosts = this.getAppHosts(el);\n const appHostsWithoutSelf = appHosts.filter(h => h !== el);\n // Nearest app host is the last one in [root, ..., parent]\n return appHostsWithoutSelf.length > 0 ? appHostsWithoutSelf[appHostsWithoutSelf.length - 1] : undefined;\n }\n\n static getHostSet(el: HTMLElement): HostSet {\n const ancestors = this.findAllSwcHosts(el); // [root, ..., parent]\n const $host = el;\n const $hosts = [...ancestors, $host]; // [root, ..., parent, self]\n const $parentHost = ancestors.length > 0 ? ancestors[ancestors.length - 1] : null;\n const $firstHost = ancestors.length > 0 ? ancestors[0] : null;\n\n const $appHosts = $hosts.filter(h => h.tagName.toLowerCase() === 'swc-app' || h.getAttribute('is')?.startsWith('swc-app-')) as SwcAppInterface[];\n const $appHost = $appHosts.length > 0 ? ($appHosts[$appHosts.length - 1] === el ? ($appHosts.length > 1 ? $appHosts[$appHosts.length - 2] : null) : $appHosts[$appHosts.length - 1]) : null;\n const $firstAppHost = $appHosts.length > 0 ? $appHosts[0] : null;\n\n return {\n $host,\n $parentHost,\n $hosts,\n $firstHost,\n $lastHost: $parentHost,\n $appHost,\n $appHosts,\n $firstAppHost,\n $lastAppHost: $appHost\n };\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAAiC;AAE1B,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,SAAS;AAAA,EACpB,OAAO,eAAe,KAAU,MAAc,UAAkB;AAC9D,QAAI,CAAC,OAAO,CAAC,KAAM,QAAO;AAE1B,UAAM,QAAQ,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A,EAEA,OAAO,WAAW,IAA0B;AAC1C,UAAM,YAAY,KAAK,gBAAgB,EAAE;AACzC,UAAM,QAAQ;AACd,UAAM,SAAS,CAAC,GAAG,WAAW,KAAK;AACnC,UAAM,cAAc,UAAU,SAAS,IAAI,UAAU,UAAU,SAAS,CAAC,IAAI;AAC7E,UAAM,aAAa,UAAU,SAAS,IAAI,UAAU,CAAC,IAAI;AAEzD,UAAM,YAAY,OAAO,OAAO,OAAK,EAAE,QAAQ,YAAY,MAAM,aAAa,EAAE,aAAa,IAAI,GAAG,WAAW,UAAU,CAAC;AAC1H,UAAM,WAAW,UAAU,SAAS,IAAK,UAAU,UAAU,SAAS,CAAC,MAAM,KAAM,UAAU,SAAS,IAAI,UAAU,UAAU,SAAS,CAAC,IAAI,OAAQ,UAAU,UAAU,SAAS,CAAC,IAAK;AACvL,UAAM,gBAAgB,UAAU,SAAS,IAAI,UAAU,CAAC,IAAI;AAE5D,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ReflectUtils } from "@dooboostore/core/reflect/ReflectUtils";
|
|
2
2
|
const ADD_EVENT_LISTENER_METADATA_KEY = Symbol("simple-web-component:add-event-listener");
|
|
3
|
-
function addEventListener(
|
|
3
|
+
function addEventListener(selector, type, options = {}) {
|
|
4
4
|
return (target, propertyKey, descriptor) => {
|
|
5
5
|
const constructor = target.constructor;
|
|
6
|
-
const options = typeof arg1 === "string" ? { type: arg1, query: arg2 } : arg1;
|
|
7
6
|
let listeners = ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
|
|
8
7
|
if (!listeners) {
|
|
9
8
|
listeners = [];
|
|
10
9
|
ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);
|
|
11
10
|
}
|
|
12
|
-
listeners.push({ options, propertyKey });
|
|
11
|
+
listeners.push({ selector, type, options, propertyKey });
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
const getAddEventListenerMetadata = (target) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/addEventListener.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n root?: 'light' | 'shadow' | 'all' | 'auto';\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n stopPropagation?: boolean;\n stopImmediatePropagation?: boolean;\n preventDefault?: boolean;\n delegate?: boolean;\n}\n\nexport interface AddEventListenerMetadata {\n selector: string;\n type: string;\n options: AddEventListenerOptions;\n propertyKey: string | symbol;\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol('simple-web-component:add-event-listener');\n\n/**\n * @addEventListener decorator to bind events to elements.\n * Usage: @addEventListener('.btn', 'click') onClick() { ... }\n * Usage: @addEventListener('', 'scroll', { passive: true }) onScroll() { ... }\n */\nexport function addEventListener(selector: string, type: string, options: AddEventListenerOptions = {}): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n\n let listeners = ReflectUtils.getMetadata<AddEventListenerMetadata[]>(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n if (!listeners) {\n listeners = [];\n ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);\n }\n listeners.push({ selector, type, options, propertyKey });\n };\n}\n\nexport const getAddEventListenerMetadata = (target: any): AddEventListenerMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAoBtB,MAAM,kCAAkC,OAAO,yCAAyC;AAOxF,SAAS,iBAAiB,UAAkB,MAAc,UAAmC,CAAC,GAAoB;AACvH,SAAO,CAAC,QAAgB,aAA8B,eAAmC;AACvF,UAAM,cAAc,OAAO;AAE3B,QAAI,YAAY,aAAa,YAAwC,iCAAiC,WAAW;AACjH,QAAI,CAAC,WAAW;AACd,kBAAY,CAAC;AACb,mBAAa,eAAe,iCAAiC,WAAW,WAAW;AAAA,IACrF;AACA,cAAU,KAAK,EAAE,UAAU,MAAM,SAAS,YAAY,CAAC;AAAA,EACzD;AACF;AAEO,MAAM,8BAA8B,CAAC,WAAwD;AAClG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,iCAAiC,WAAW;AAC9E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -88,10 +88,12 @@ const elementDefine = (inConfig) => (constructor) => {
|
|
|
88
88
|
return this[methodName](...extraArgs);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
_bindAttributeEvent(el, attrName, script) {
|
|
92
|
-
if (!
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
_bindAttributeEvent(el, attrName, script, eventName) {
|
|
92
|
+
if (!eventName) {
|
|
93
|
+
if (!attrName.startsWith("swc-on-"))
|
|
94
|
+
return;
|
|
95
|
+
eventName = attrName.substring(7);
|
|
96
|
+
}
|
|
95
97
|
if (swcLifecycleAttributes.includes(attrName))
|
|
96
98
|
return;
|
|
97
99
|
const elHandlers = getHandlers(this);
|
|
@@ -152,44 +154,79 @@ const elementDefine = (inConfig) => (constructor) => {
|
|
|
152
154
|
this.innerHTML = lContent;
|
|
153
155
|
}
|
|
154
156
|
addEventListenerList.forEach((meta) => {
|
|
155
|
-
const {
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
} else {
|
|
160
|
-
const searchRoots = [];
|
|
157
|
+
const { selector, type, options } = meta;
|
|
158
|
+
const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate } = options;
|
|
159
|
+
if (delegate && selector && selector !== ":host") {
|
|
160
|
+
const bindRoots = [];
|
|
161
161
|
const r = root || "auto";
|
|
162
162
|
if (r === "auto") {
|
|
163
|
-
|
|
163
|
+
bindRoots.push(this.shadowRoot || this);
|
|
164
164
|
} else if (r === "light") {
|
|
165
|
-
|
|
165
|
+
bindRoots.push(this);
|
|
166
166
|
} else if (r === "shadow") {
|
|
167
167
|
if (this.shadowRoot)
|
|
168
|
-
|
|
168
|
+
bindRoots.push(this.shadowRoot);
|
|
169
169
|
} else if (r === "all") {
|
|
170
|
-
|
|
170
|
+
bindRoots.push(this);
|
|
171
171
|
if (this.shadowRoot)
|
|
172
|
-
|
|
172
|
+
bindRoots.push(this.shadowRoot);
|
|
173
|
+
}
|
|
174
|
+
bindRoots.forEach((bindRoot) => {
|
|
175
|
+
const handler = (event) => {
|
|
176
|
+
const target = event.target;
|
|
177
|
+
const matchedEl = target.closest(selector);
|
|
178
|
+
if (matchedEl && bindRoot.contains(matchedEl)) {
|
|
179
|
+
if (stopPropagation)
|
|
180
|
+
event.stopPropagation();
|
|
181
|
+
if (stopImmediatePropagation)
|
|
182
|
+
event.stopImmediatePropagation();
|
|
183
|
+
if (preventDefault)
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
const hostSet2 = SwcUtils.getHostSet(this);
|
|
186
|
+
this._invokeLifecycleMethod(meta.propertyKey, hostSet2, [event, hostSet2, matchedEl]);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
bindRoot.addEventListener(type, handler, { capture, once, passive });
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
const targetEls = [];
|
|
193
|
+
if (!selector || selector === ":host") {
|
|
194
|
+
targetEls.push(this);
|
|
195
|
+
} else {
|
|
196
|
+
const searchRoots = [];
|
|
197
|
+
const r = root || "auto";
|
|
198
|
+
if (r === "auto") {
|
|
199
|
+
searchRoots.push(this.shadowRoot || this);
|
|
200
|
+
} else if (r === "light") {
|
|
201
|
+
searchRoots.push(this);
|
|
202
|
+
} else if (r === "shadow") {
|
|
203
|
+
if (this.shadowRoot)
|
|
204
|
+
searchRoots.push(this.shadowRoot);
|
|
205
|
+
} else if (r === "all") {
|
|
206
|
+
searchRoots.push(this);
|
|
207
|
+
if (this.shadowRoot)
|
|
208
|
+
searchRoots.push(this.shadowRoot);
|
|
209
|
+
}
|
|
210
|
+
searchRoots.forEach((sr) => {
|
|
211
|
+
const found = sr.querySelectorAll(selector);
|
|
212
|
+
found.forEach((el) => targetEls.push(el));
|
|
213
|
+
});
|
|
173
214
|
}
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
215
|
+
targetEls.forEach((el) => {
|
|
216
|
+
const handler = (event) => {
|
|
217
|
+
if (stopPropagation)
|
|
218
|
+
event.stopPropagation();
|
|
219
|
+
if (stopImmediatePropagation)
|
|
220
|
+
event.stopImmediatePropagation();
|
|
221
|
+
if (preventDefault)
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
const hostSet2 = SwcUtils.getHostSet(this);
|
|
224
|
+
this._invokeLifecycleMethod(meta.propertyKey, hostSet2, [event, hostSet2]);
|
|
225
|
+
};
|
|
226
|
+
const opts = { capture, once, passive };
|
|
227
|
+
el.addEventListener(type, handler, opts);
|
|
177
228
|
});
|
|
178
229
|
}
|
|
179
|
-
targetEls.forEach((el) => {
|
|
180
|
-
const handler = (event) => {
|
|
181
|
-
if (stopPropagation)
|
|
182
|
-
event.stopPropagation();
|
|
183
|
-
if (stopImmediatePropagation)
|
|
184
|
-
event.stopImmediatePropagation();
|
|
185
|
-
if (preventDefault)
|
|
186
|
-
event.preventDefault();
|
|
187
|
-
const hostSet2 = SwcUtils.getHostSet(this);
|
|
188
|
-
this._invokeLifecycleMethod(meta.propertyKey, hostSet2, [event, hostSet2]);
|
|
189
|
-
};
|
|
190
|
-
const options = { capture, once, passive };
|
|
191
|
-
el.addEventListener(type, handler, options);
|
|
192
|
-
});
|
|
193
230
|
});
|
|
194
231
|
if (super.connectedCallback)
|
|
195
232
|
await super.connectedCallback();
|
|
@@ -234,7 +271,9 @@ const elementDefine = (inConfig) => (constructor) => {
|
|
|
234
271
|
super.attributeChangedCallback(name, old, newVal);
|
|
235
272
|
if (name.startsWith("swc-on-") && !swcLifecycleAttributes.includes(name)) {
|
|
236
273
|
if (newVal !== null) {
|
|
237
|
-
|
|
274
|
+
const customEventMeta = emitCustomEventList.find((it) => it.options.attributeName === name);
|
|
275
|
+
const eventName = customEventMeta ? customEventMeta.options.type : name.substring(7);
|
|
276
|
+
this._bindAttributeEvent(this, name, newVal, eventName);
|
|
238
277
|
}
|
|
239
278
|
}
|
|
240
279
|
const mKeys = attrChangeMap.get(name);
|
|
@@ -259,6 +298,23 @@ const elementDefine = (inConfig) => (constructor) => {
|
|
|
259
298
|
};
|
|
260
299
|
}
|
|
261
300
|
});
|
|
301
|
+
emitCustomEventList.forEach((meta) => {
|
|
302
|
+
const { propertyKey, options } = meta;
|
|
303
|
+
const original = NewClass.prototype[propertyKey];
|
|
304
|
+
if (typeof original === "function") {
|
|
305
|
+
NewClass.prototype[propertyKey] = function(...args) {
|
|
306
|
+
const detail = original.apply(this, args);
|
|
307
|
+
const event = new CustomEvent(options.type, {
|
|
308
|
+
detail,
|
|
309
|
+
bubbles: options.bubbles,
|
|
310
|
+
composed: options.composed,
|
|
311
|
+
cancelable: options.cancelable
|
|
312
|
+
});
|
|
313
|
+
this.dispatchEvent(event);
|
|
314
|
+
return detail;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
});
|
|
262
318
|
const originalProto = constructor.prototype;
|
|
263
319
|
const newProto = NewClass.prototype;
|
|
264
320
|
Object.getOwnPropertyNames(originalProto).forEach((name) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/elementDefine.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getInnerHtmlMetadataList } from './innerHtml';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { getAddEventListenerMetadata } from './addEventListener';\nimport { ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, ON_ADD_EVENT_LISTENER_METADATA_KEY, ATTRIBUTE_CHANGED_WILDCARD, findAllLifecycleMetadata } from './lifecycles';\nimport { getEmitCustomEventMetadataList } from './emitCustomEvent';\nimport { changedAttribute, findAllAttributeChangedMetadata } from './changedAttribute';\nimport { setAttribute, findAllSetAttributeMetadata } from './setAttribute';\nimport { SwcUtils } from '../utils/Utils';\nimport { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from '../config/config';\nimport { SituationType, SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { InjectSituationType, HostSet, SwcAppInterface } from '../types';\n\n// --- Core Interfaces & Types (Integrated) ---\n\nexport interface ElementConfig {\n name: string;\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: CustomElementRegistry;\n window?: Window;\n}\n\nexport const ELEMENT_CONFIG_KEY = Symbol('simple-web-component:element-config');\n\n// --- Environment Initialization Helper ---\n\nfunction buildEnv(configWindow?: Window) {\n const win: any = configWindow || (typeof window !== 'undefined' ? window : undefined);\n const doc: Document = win?.document;\n\n const builtInTagMap = new Map<any, string>();\n for (const [cls, tag] of HTML_TAG_ENTRIES) {\n if (win?.[cls]) builtInTagMap.set(win[cls], tag);\n }\n\n const domHelpers = {\n $d: doc,\n $w: win,\n $q: (sel: string, root?: Element | Document | ShadowRoot) => (root ?? doc).querySelector(sel),\n $qa: (sel: string, root?: Element | Document | ShadowRoot) => Array.from((root ?? doc).querySelectorAll(sel)),\n $qi: (id: string, root?: Document | ShadowRoot) => (root ?? doc).getElementById(id)\n } as const;\n\n return { win, doc, builtInTagMap, domHelpers };\n}\n\nconst getHandlers = (inst: any) => {\n if (!inst.__swc_attributeEventHandlers) inst.__swc_attributeEventHandlers = new Map();\n return inst.__swc_attributeEventHandlers;\n};\n\nexport const elementDefine =\n (inConfig: ElementConfig | string): ClassDecorator =>\n (constructor: any) => {\n const config: ElementConfig = typeof inConfig === 'string' ? { name: inConfig } : inConfig;\n const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);\n config.window = win;\n const SWC_DOM_HELPER_KEYS = Object.keys(SWC_DOM_HELPERS) as (keyof typeof SWC_DOM_HELPERS)[];\n const SWC_DOM_HELPER_VALS = () => SWC_DOM_HELPER_KEYS.map(k => (SWC_DOM_HELPERS as any)[k]);\n\n let extendsTagName = config.extends;\n if (!extendsTagName) {\n let proto = constructor;\n while (proto && proto !== HTMLElement && proto !== Function.prototype) {\n extendsTagName = BUILT_IN_TAG_MAP.get(proto);\n if (extendsTagName) break;\n proto = Object.getPrototypeOf(proto);\n }\n config.extends = extendsTagName;\n }\n\n const emitCustomEventList = getEmitCustomEventMetadataList(constructor) || [];\n const addEventListenerList = getAddEventListenerMetadata(constructor) || [];\n const attrChangeMap = findAllAttributeChangedMetadata(constructor);\n const setAttrMap = findAllSetAttributeMetadata(constructor);\n\n const swcLifecycleAttributes = ['swc-on-constructor', 'swc-on-connected', 'swc-on-disconnected', 'swc-on-before-connected', 'swc-on-after-connected', 'swc-on-before-disconnected', 'swc-on-after-disconnected', 'swc-on-before-adopted', 'swc-on-after-adopted', 'swc-on-attribute-changed'];\n const swcOnEvents = DOM_EVENT_NAMES.map(e => `swc-on-${e}`);\n\n const mergedObservedAttributes = [...new Set([...(config.observedAttributes ?? []), ...attrChangeMap.keys(), ...setAttrMap.keys(), ...emitCustomEventList.map(it => it.options.attributeName!), ...swcLifecycleAttributes, ...swcOnEvents])];\n const innerHtmlList = getInnerHtmlMetadataList(constructor) || [];\n\n const NewClass = class extends (constructor as any) {\n private _swcId = Math.random().toString(36).substring(2, 11);\n private _emitHandlers = new Map<string, EventListener>();\n\n private _executeSwcScript(attrName: string, hostSet: HostSet, extraArgs: Record<string, any> = {}) {\n const script = this.getAttribute(attrName);\n if (script) {\n try {\n const args = { ...hostSet, ...SWC_DOM_HELPERS, ...extraArgs };\n const argNames = Object.keys(args);\n const argValues = Object.values(args);\n new Function(...argNames, script).apply(this, argValues);\n } catch (e) {\n console.error(`[SWC] Failed to execute ${attrName}:`, e);\n }\n }\n }\n\n private async _invokeLifecycleMethod(methodName: string | symbol, hostSet: HostSet, extraArgs: any[] = []) {\n if (typeof (this as any)[methodName] !== 'function') return;\n const app = hostSet.$appHost?.simpleApplication;\n\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({ situationType: InjectSituationType.HOST_SET, data: hostSet }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOST, data: hostSet.$appHost }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOSTS, data: hostSet.$appHosts }), new SituationTypeContainer({ situationType: InjectSituationType.HOST, data: hostSet.$host }), new SituationTypeContainer({ situationType: InjectSituationType.HOSTS, data: hostSet.$hosts }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_HOST, data: hostSet.$firstHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_HOST, data: hostSet.$lastHost }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_APP_HOST, data: hostSet.$firstAppHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_APP_HOST, data: hostSet.$lastAppHost })]);\n otherStorage.set(SituationTypeContainers, situations);\n\n return app.simstanceManager.executeBindParameterSimPromise(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs\n },\n otherStorage\n );\n } else {\n return (this as any)[methodName](...extraArgs);\n }\n }\n\n private _bindAttributeEvent(el: HTMLElement, attrName: string, script: string) {\n if (!attrName.startsWith('swc-on-')) return;\n const eventName = attrName.substring(7);\n if (swcLifecycleAttributes.includes(attrName)) return;\n\n const elHandlers = getHandlers(this);\n let handlers = elHandlers.get(el);\n if (!handlers) {\n handlers = new Map();\n elHandlers.set(el, handlers);\n }\n\n const oldHandler = handlers.get(attrName);\n if (oldHandler) el.removeEventListener(eventName, oldHandler);\n\n const handler = (event: any) => {\n const hostSet = SwcUtils.getHostSet(el);\n const argNames = Object.keys(hostSet);\n const argValues = Object.values(hostSet);\n new Function('event', '$data', ...argNames, ...SWC_DOM_HELPER_KEYS, script).call(el, event, (event as CustomEvent).detail, ...argValues, ...SWC_DOM_HELPER_VALS());\n };\n\n el.addEventListener(eventName, handler);\n handlers.set(attrName, handler);\n }\n\n constructor(...args: any[]) {\n super(...args);\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-constructor', hostSet);\n\n if (innerHtmlList.some(it => it.options.useShadow === true) && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n }\n\n static get observedAttributes() {\n return mergedObservedAttributes;\n }\n\n async connectedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n\n this._executeSwcScript('swc-on-before-connected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_CONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n if (typeof (this as any).initCore === 'function') (this as any).initCore();\n\n if (innerHtmlList.length > 0) {\n let sContent = '',\n lContent = '';\n for (const meta of innerHtmlList) {\n const res = await (this as any)[meta.propertyKey]();\n if (res !== undefined) {\n if (meta.options.useShadow) sContent += res;\n else lContent += res;\n }\n }\n if (this.shadowRoot) this.shadowRoot.innerHTML = sContent;\n if (lContent) this.innerHTML = lContent;\n }\n\n // --- @addEventListener binding ---\n addEventListenerList.forEach(meta => {\n const { type, query, root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault } = meta.options;\n const targetEls: (HTMLElement | Element | Document | ShadowRoot | Window)[] = [];\n\n if (!query) {\n targetEls.push(this as any);\n } else {\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') {\n searchRoots.push((this.shadowRoot || (this as any)) as any);\n } else if (r === 'light') {\n searchRoots.push(this as any);\n } else if (r === 'shadow') {\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n searchRoots.push(this as any);\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n }\n\n searchRoots.forEach(sr => {\n const found = sr.querySelectorAll(query);\n found.forEach(el => targetEls.push(el as any));\n });\n }\n\n targetEls.forEach(el => {\n const handler = (event: Event) => {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n\n const hostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, hostSet, [event, hostSet]);\n };\n const options = { capture, once, passive };\n el.addEventListener(type, handler, options);\n });\n });\n\n if (super.connectedCallback) await super.connectedCallback();\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_CONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n this._executeSwcScript('swc-on-connected', hostSet);\n this._executeSwcScript('swc-on-after-connected', hostSet);\n }\n\n disconnectedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-disconnected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n if (super.disconnectedCallback) super.disconnectedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-disconnected', hostSet);\n this._executeSwcScript('swc-on-after-disconnected', hostSet);\n }\n\n adoptedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-adopted', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n if (super.adoptedCallback) super.adoptedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-adopted', hostSet);\n this._executeSwcScript('swc-on-after-adopted', hostSet);\n }\n\n attributeChangedCallback(name: string, old: string | null, newVal: string | null) {\n if (super.attributeChangedCallback) super.attributeChangedCallback(name, old, newVal);\n\n if (name.startsWith('swc-on-') && !swcLifecycleAttributes.includes(name)) {\n if (newVal !== null) {\n this._bindAttributeEvent(this as any, name, newVal);\n }\n }\n\n const mKeys = attrChangeMap.get(name);\n if (mKeys && Array.isArray(mKeys)) {\n const hSet = SwcUtils.getHostSet(this as any);\n mKeys.forEach(key => this._invokeLifecycleMethod(key, hSet, [newVal, old, name]));\n }\n }\n };\n\n // --- @setAttribute wrapping logic ---\n setAttrMap.forEach((methodName, attrName) => {\n const original = NewClass.prototype[methodName as any];\n if (typeof original === 'function') {\n NewClass.prototype[methodName as any] = function (...args: any[]) {\n const res = original.apply(this, args);\n if (res !== undefined) {\n if (res === null) this.removeAttribute(attrName);\n else this.setAttribute(attrName, String(res));\n }\n return res;\n };\n }\n });\n\n const originalProto = constructor.prototype;\n const newProto = NewClass.prototype;\n Object.getOwnPropertyNames(originalProto).forEach(name => {\n if (name === 'constructor') return;\n const keys = Reflect.getMetadataKeys(originalProto, name);\n keys.forEach(key => Reflect.defineMetadata(key, Reflect.getMetadata(key, originalProto, name), newProto, name));\n });\n\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, NewClass);\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, constructor);\n const registry = config.customElementRegistry || (win as any)?.customElements;\n if (registry && !registry.get(config.name)) {\n registry.define(config.name, NewClass as any, config.extends ? { extends: config.extends } : undefined);\n }\n return NewClass as any;\n };\n\nexport const getElementConfig = (target: any): ElementConfig | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ELEMENT_CONFIG_KEY, constructor);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AAGzC,SAAS,mCAAmC;AAC5C,SAAS,kCAAkC,iCAAiC,qCAAqC,oCAAoC,gCAAgC,+BAA+F,gCAAgC;AACpT,SAAS,sCAAsC;AAC/C,SAA2B,uCAAuC;AAClE,SAAuB,mCAAmC;AAC1D,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAAuB;AAClD,SAAwB,wBAAwB,+BAA+B;AAE/E,SAAS,2BAAqD;AAYvD,MAAM,qBAAqB,OAAO,qCAAqC;AAI9E,SAAS,SAAS,cAAqB;AACrC,QAAM,MAAW,iBAAiB,OAAO,WAAW,cAAc,SAAS;AAC3E,QAAM,MAAgB,KAAK;AAE3B,QAAM,gBAAgB,oBAAI,IAAG;AAC7B,aAAW,CAAC,KAAK,GAAG,KAAK,kBAAkB;AACzC,QAAI,MAAM,GAAG;AAAG,oBAAc,IAAI,IAAI,GAAG,GAAG,GAAG;EACjD;AAEA,QAAM,aAAa;IACjB,IAAI;IACJ,IAAI;IACJ,IAAI,CAAC,KAAa,UAA4C,QAAQ,KAAK,cAAc,GAAG;I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AAuB,EAAE,eAAe,oBAAoB,YAAY,MAAM,QAAQ,WAAU,CAAE,GAAG,IAAI,uBAAuB,EAAE,eAAe,oBAAoB,WAAW,MAAM,QAAQ,UAAS,CAAE,GAAG,IAAI,uBAAuB,EAAE,eAAe,oBAAoB,gBAAgB,MAAM,QAAQ,cAAa,CAAE,GAAG,IAAI,uBAAuB,EAAE,eAAe,oBAAoB,eAAe,MAAM,QAAQ,aAAY,CAAE,CAAC,CAAC;AACn8B,qBAAa,IAAI,yBAAyB,UAAU;AAEpD,eAAO,IAAI,iBAAiB,+BAC1B;UACE,QAAQ;UACR,WAAW;UACX,iBAAiB;WAEnB,YAAY;MAEhB,OAAO;AACL,eAAQ,KAAa,UAAU,EAAE,GAAG,SAAS;MAC/C;IACF;IAEQ,oBAAoB,IAAiB,UAAkB,
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getInnerHtmlMetadataList } from './innerHtml';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { getAddEventListenerMetadata } from './addEventListener';\nimport { ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, ON_ADD_EVENT_LISTENER_METADATA_KEY, ATTRIBUTE_CHANGED_WILDCARD, findAllLifecycleMetadata } from './lifecycles';\nimport { getEmitCustomEventMetadataList } from './emitCustomEvent';\nimport { changedAttribute, findAllAttributeChangedMetadata } from './changedAttribute';\nimport { setAttribute, findAllSetAttributeMetadata } from './setAttribute';\nimport { SwcUtils } from '../utils/Utils';\nimport { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from '../config/config';\nimport { SituationType, SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { InjectSituationType, HostSet, SwcAppInterface } from '../types';\n\n// --- Core Interfaces & Types (Integrated) ---\n\nexport interface ElementConfig {\n name: string;\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: CustomElementRegistry;\n window?: Window;\n}\n\nexport const ELEMENT_CONFIG_KEY = Symbol('simple-web-component:element-config');\n\n// --- Environment Initialization Helper ---\n\nfunction buildEnv(configWindow?: Window) {\n const win: any = configWindow || (typeof window !== 'undefined' ? window : undefined);\n const doc: Document = win?.document;\n\n const builtInTagMap = new Map<any, string>();\n for (const [cls, tag] of HTML_TAG_ENTRIES) {\n if (win?.[cls]) builtInTagMap.set(win[cls], tag);\n }\n\n const domHelpers = {\n $d: doc,\n $w: win,\n $q: (sel: string, root?: Element | Document | ShadowRoot) => (root ?? doc).querySelector(sel),\n $qa: (sel: string, root?: Element | Document | ShadowRoot) => Array.from((root ?? doc).querySelectorAll(sel)),\n $qi: (id: string, root?: Document | ShadowRoot) => (root ?? doc).getElementById(id)\n } as const;\n\n return { win, doc, builtInTagMap, domHelpers };\n}\n\nconst getHandlers = (inst: any) => {\n if (!inst.__swc_attributeEventHandlers) inst.__swc_attributeEventHandlers = new Map();\n return inst.__swc_attributeEventHandlers;\n};\n\nexport const elementDefine =\n (inConfig: ElementConfig | string): ClassDecorator =>\n (constructor: any) => {\n const config: ElementConfig = typeof inConfig === 'string' ? { name: inConfig } : inConfig;\n const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);\n config.window = win;\n const SWC_DOM_HELPER_KEYS = Object.keys(SWC_DOM_HELPERS) as (keyof typeof SWC_DOM_HELPERS)[];\n const SWC_DOM_HELPER_VALS = () => SWC_DOM_HELPER_KEYS.map(k => (SWC_DOM_HELPERS as any)[k]);\n\n let extendsTagName = config.extends;\n if (!extendsTagName) {\n let proto = constructor;\n while (proto && proto !== HTMLElement && proto !== Function.prototype) {\n extendsTagName = BUILT_IN_TAG_MAP.get(proto);\n if (extendsTagName) break;\n proto = Object.getPrototypeOf(proto);\n }\n config.extends = extendsTagName;\n }\n\n const emitCustomEventList = getEmitCustomEventMetadataList(constructor) || [];\n const addEventListenerList = getAddEventListenerMetadata(constructor) || [];\n const attrChangeMap = findAllAttributeChangedMetadata(constructor);\n const setAttrMap = findAllSetAttributeMetadata(constructor);\n\n const swcLifecycleAttributes = ['swc-on-constructor', 'swc-on-connected', 'swc-on-disconnected', 'swc-on-before-connected', 'swc-on-after-connected', 'swc-on-before-disconnected', 'swc-on-after-disconnected', 'swc-on-before-adopted', 'swc-on-after-adopted', 'swc-on-attribute-changed'];\n const swcOnEvents = DOM_EVENT_NAMES.map(e => `swc-on-${e}`);\n\n const mergedObservedAttributes = [...new Set([...(config.observedAttributes ?? []), ...attrChangeMap.keys(), ...setAttrMap.keys(), ...emitCustomEventList.map(it => it.options.attributeName!), ...swcLifecycleAttributes, ...swcOnEvents])];\n const innerHtmlList = getInnerHtmlMetadataList(constructor) || [];\n\n const NewClass = class extends (constructor as any) {\n private _swcId = Math.random().toString(36).substring(2, 11);\n private _emitHandlers = new Map<string, EventListener>();\n\n private _executeSwcScript(attrName: string, hostSet: HostSet, extraArgs: Record<string, any> = {}) {\n const script = this.getAttribute(attrName);\n if (script) {\n try {\n const args = { ...hostSet, ...SWC_DOM_HELPERS, ...extraArgs };\n const argNames = Object.keys(args);\n const argValues = Object.values(args);\n new Function(...argNames, script).apply(this, argValues);\n } catch (e) {\n console.error(`[SWC] Failed to execute ${attrName}:`, e);\n }\n }\n }\n\n private async _invokeLifecycleMethod(methodName: string | symbol, hostSet: HostSet, extraArgs: any[] = []) {\n if (typeof (this as any)[methodName] !== 'function') return;\n const app = hostSet.$appHost?.simpleApplication;\n\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({ situationType: InjectSituationType.HOST_SET, data: hostSet }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOST, data: hostSet.$appHost }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOSTS, data: hostSet.$appHosts }), new SituationTypeContainer({ situationType: InjectSituationType.HOST, data: hostSet.$host }), new SituationTypeContainer({ situationType: InjectSituationType.HOSTS, data: hostSet.$hosts }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_HOST, data: hostSet.$firstHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_HOST, data: hostSet.$lastHost }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_APP_HOST, data: hostSet.$firstAppHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_APP_HOST, data: hostSet.$lastAppHost })]);\n otherStorage.set(SituationTypeContainers, situations);\n\n return app.simstanceManager.executeBindParameterSimPromise(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs\n },\n otherStorage\n );\n } else {\n return (this as any)[methodName](...extraArgs);\n }\n }\n\n private _bindAttributeEvent(el: HTMLElement, attrName: string, script: string, eventName?: string) {\n if (!eventName) {\n if (!attrName.startsWith('swc-on-')) return;\n eventName = attrName.substring(7);\n }\n if (swcLifecycleAttributes.includes(attrName)) return;\n\n const elHandlers = getHandlers(this);\n let handlers = elHandlers.get(el);\n if (!handlers) {\n handlers = new Map();\n elHandlers.set(el, handlers);\n }\n\n const oldHandler = handlers.get(attrName);\n if (oldHandler) el.removeEventListener(eventName, oldHandler);\n\n const handler = (event: any) => {\n const hostSet = SwcUtils.getHostSet(el);\n const argNames = Object.keys(hostSet);\n const argValues = Object.values(hostSet);\n new Function('event', '$data', ...argNames, ...SWC_DOM_HELPER_KEYS, script).call(el, event, (event as CustomEvent).detail, ...argValues, ...SWC_DOM_HELPER_VALS());\n };\n\n el.addEventListener(eventName, handler);\n handlers.set(attrName, handler);\n }\n\n constructor(...args: any[]) {\n super(...args);\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-constructor', hostSet);\n\n if (innerHtmlList.some(it => it.options.useShadow === true) && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n }\n\n static get observedAttributes() {\n return mergedObservedAttributes;\n }\n\n async connectedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n\n this._executeSwcScript('swc-on-before-connected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_CONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n if (typeof (this as any).initCore === 'function') (this as any).initCore();\n\n if (innerHtmlList.length > 0) {\n let sContent = '',\n lContent = '';\n for (const meta of innerHtmlList) {\n const res = await (this as any)[meta.propertyKey]();\n if (res !== undefined) {\n if (meta.options.useShadow) sContent += res;\n else lContent += res;\n }\n }\n if (this.shadowRoot) this.shadowRoot.innerHTML = sContent;\n if (lContent) this.innerHTML = lContent;\n }\n\n // --- @addEventListener binding ---\n addEventListenerList.forEach(meta => {\n const { selector, type, options } = meta;\n const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate } = options;\n\n if (delegate && selector && selector !== ':host') {\n const bindRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') {\n bindRoots.push(this.shadowRoot || (this as any));\n } else if (r === 'light') {\n bindRoots.push(this as any);\n } else if (r === 'shadow') {\n if (this.shadowRoot) bindRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n bindRoots.push(this as any);\n if (this.shadowRoot) bindRoots.push(this.shadowRoot as any);\n }\n\n bindRoots.forEach(bindRoot => {\n const handler = (event: Event) => {\n const target = event.target as HTMLElement;\n const matchedEl = target.closest(selector);\n if (matchedEl && (bindRoot as any).contains(matchedEl)) {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n\n const hostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, hostSet, [event, hostSet, matchedEl]);\n }\n };\n bindRoot.addEventListener(type, handler, { capture, once, passive });\n });\n } else {\n const targetEls: (HTMLElement | Element | Document | ShadowRoot | Window)[] = [];\n if (!selector || selector === ':host') {\n targetEls.push(this as any);\n } else {\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') {\n searchRoots.push((this.shadowRoot || (this as any)) as any);\n } else if (r === 'light') {\n searchRoots.push(this as any);\n } else if (r === 'shadow') {\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n searchRoots.push(this as any);\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n }\n\n searchRoots.forEach(sr => {\n const found = sr.querySelectorAll(selector);\n found.forEach(el => targetEls.push(el as any));\n });\n }\n\n targetEls.forEach(el => {\n const handler = (event: Event) => {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n\n const hostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, hostSet, [event, hostSet]);\n };\n const opts = { capture, once, passive };\n el.addEventListener(type, handler, opts);\n });\n }\n });\n\n if (super.connectedCallback) await super.connectedCallback();\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_CONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n this._executeSwcScript('swc-on-connected', hostSet);\n this._executeSwcScript('swc-on-after-connected', hostSet);\n }\n\n disconnectedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-disconnected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n if (super.disconnectedCallback) super.disconnectedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-disconnected', hostSet);\n this._executeSwcScript('swc-on-after-disconnected', hostSet);\n }\n\n adoptedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-adopted', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n if (super.adoptedCallback) super.adoptedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-adopted', hostSet);\n this._executeSwcScript('swc-on-after-adopted', hostSet);\n }\n\n attributeChangedCallback(name: string, old: string | null, newVal: string | null) {\n if (super.attributeChangedCallback) super.attributeChangedCallback(name, old, newVal);\n\n if (name.startsWith('swc-on-') && !swcLifecycleAttributes.includes(name)) {\n if (newVal !== null) {\n const customEventMeta = emitCustomEventList.find(it => it.options.attributeName === name);\n const eventName = customEventMeta ? customEventMeta.options.type : name.substring(7);\n this._bindAttributeEvent(this as any, name, newVal, eventName);\n }\n }\n\n const mKeys = attrChangeMap.get(name);\n if (mKeys && Array.isArray(mKeys)) {\n const hSet = SwcUtils.getHostSet(this as any);\n mKeys.forEach(key => this._invokeLifecycleMethod(key, hSet, [newVal, old, name]));\n }\n }\n };\n\n // --- @setAttribute wrapping logic ---\n setAttrMap.forEach((methodName, attrName) => {\n const original = NewClass.prototype[methodName as any];\n if (typeof original === 'function') {\n NewClass.prototype[methodName as any] = function (...args: any[]) {\n const res = original.apply(this, args);\n if (res !== undefined) {\n if (res === null) this.removeAttribute(attrName);\n else this.setAttribute(attrName, String(res));\n }\n return res;\n };\n }\n });\n\n // --- @emitCustomEvent wrapping logic ---\n emitCustomEventList.forEach(meta => {\n const { propertyKey, options } = meta;\n const original = NewClass.prototype[propertyKey as any];\n if (typeof original === 'function') {\n NewClass.prototype[propertyKey as any] = function (...args: any[]) {\n const detail = original.apply(this, args);\n const event = new CustomEvent(options.type, {\n detail,\n bubbles: options.bubbles,\n composed: options.composed,\n cancelable: options.cancelable\n });\n this.dispatchEvent(event);\n return detail;\n };\n }\n });\n\n const originalProto = constructor.prototype;\n const newProto = NewClass.prototype;\n Object.getOwnPropertyNames(originalProto).forEach(name => {\n if (name === 'constructor') return;\n const keys = Reflect.getMetadataKeys(originalProto, name);\n keys.forEach(key => Reflect.defineMetadata(key, Reflect.getMetadata(key, originalProto, name), newProto, name));\n });\n\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, NewClass);\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, constructor);\n const registry = config.customElementRegistry || (win as any)?.customElements;\n if (registry && !registry.get(config.name)) {\n registry.define(config.name, NewClass as any, config.extends ? { extends: config.extends } : undefined);\n }\n return NewClass as any;\n };\n\nexport const getElementConfig = (target: any): ElementConfig | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ELEMENT_CONFIG_KEY, constructor);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AAGzC,SAAS,mCAAmC;AAC5C,SAAS,kCAAkC,iCAAiC,qCAAqC,oCAAoC,gCAAgC,+BAA+F,gCAAgC;AACpT,SAAS,sCAAsC;AAC/C,SAA2B,uCAAuC;AAClE,SAAuB,mCAAmC;AAC1D,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAAuB;AAClD,SAAwB,wBAAwB,+BAA+B;AAE/E,SAAS,2BAAqD;AAYvD,MAAM,qBAAqB,OAAO,qCAAqC;AAI9E,SAAS,SAAS,cAAqB;AACrC,QAAM,MAAW,iBAAiB,OAAO,WAAW,cAAc,SAAS;AAC3E,QAAM,MAAgB,KAAK;AAE3B,QAAM,gBAAgB,oBAAI,IAAG;AAC7B,aAAW,CAAC,KAAK,GAAG,KAAK,kBAAkB;AACzC,QAAI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