@dooboostore/simple-web-component 1.0.24 → 1.0.25
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 +64 -3406
- package/dist/cjs/decorators/addEventListener.js +1 -1
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +148 -0
- package/dist/cjs/decorators/applyAttribute.js.map +7 -0
- package/dist/cjs/decorators/applyClass.js +164 -0
- package/dist/cjs/decorators/applyClass.js.map +7 -0
- package/dist/cjs/decorators/applyNode.js +87 -194
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/{style.js → applyStyle.js} +50 -60
- package/dist/cjs/decorators/applyStyle.js.map +7 -0
- package/dist/cjs/decorators/attribute.js +10 -16
- package/dist/cjs/decorators/attribute.js.map +2 -2
- package/dist/cjs/decorators/changedAttributeHost.js +1 -1
- package/dist/cjs/decorators/changedAttributeHost.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +14 -23
- package/dist/cjs/decorators/elementDefine.js.map +2 -2
- package/dist/cjs/decorators/emitCustomEvent.js +5 -2
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/index.js +3 -3
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/lifecycles.js +9 -9
- package/dist/cjs/decorators/lifecycles.js.map +2 -2
- package/dist/cjs/decorators/query.js +1 -1
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +1 -1
- package/dist/cjs/decorators/queryAll.js.map +2 -2
- package/dist/cjs/elements/SwcAppEngine.js +19 -4
- package/dist/cjs/elements/SwcAppEngine.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +2 -0
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/utils/Utils.js +1 -1
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +1 -1
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +129 -0
- package/dist/esm/decorators/applyAttribute.js.map +7 -0
- package/dist/esm/decorators/applyClass.js +145 -0
- package/dist/esm/decorators/applyClass.js.map +7 -0
- package/dist/esm/decorators/applyNode.js +87 -194
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/{style.js → applyStyle.js} +47 -57
- package/dist/esm/decorators/applyStyle.js.map +7 -0
- package/dist/esm/decorators/attribute.js +10 -16
- package/dist/esm/decorators/attribute.js.map +2 -2
- package/dist/esm/decorators/changedAttributeHost.js +1 -1
- package/dist/esm/decorators/changedAttributeHost.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +14 -23
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +5 -2
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/index.js +3 -3
- package/dist/esm/decorators/index.js.map +1 -1
- package/dist/esm/decorators/lifecycles.js +9 -9
- package/dist/esm/decorators/lifecycles.js.map +2 -2
- package/dist/esm/decorators/query.js +1 -1
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +1 -1
- package/dist/esm/decorators/queryAll.js.map +2 -2
- package/dist/esm/elements/SwcAppEngine.js +19 -4
- package/dist/esm/elements/SwcAppEngine.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +2 -0
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/utils/Utils.js +1 -1
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +2884 -586
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +22 -0
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -0
- package/dist/types/decorators/applyClass.d.ts +65 -0
- package/dist/types/decorators/applyClass.d.ts.map +1 -0
- package/dist/types/decorators/applyNode.d.ts +15 -123
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +21 -0
- package/dist/types/decorators/applyStyle.d.ts.map +1 -0
- package/dist/types/decorators/attribute.d.ts +10 -19
- package/dist/types/decorators/attribute.d.ts.map +1 -1
- package/dist/types/decorators/changedAttributeHost.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +3 -3
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/lifecycles.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/elements/SwcAppEngine.d.ts +7 -0
- package/dist/types/elements/SwcAppEngine.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +2884 -586
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/decorators/addEventListener.ts +1 -1
- package/src/decorators/applyAttribute.ts +147 -0
- package/src/decorators/applyClass.ts +158 -0
- package/src/decorators/applyNode.ts +112 -330
- package/src/decorators/applyStyle.ts +128 -0
- package/src/decorators/attribute.ts +21 -55
- package/src/decorators/changedAttributeHost.ts +1 -1
- package/src/decorators/elementDefine.ts +18 -39
- package/src/decorators/emitCustomEvent.ts +6 -3
- package/src/decorators/index.ts +3 -3
- package/src/decorators/lifecycles.ts +9 -11
- package/src/decorators/query.ts +1 -1
- package/src/decorators/queryAll.ts +1 -1
- package/src/elements/SwcAppEngine.ts +32 -4
- package/src/elements/SwcAppMixin.ts +2 -0
- package/src/utils/Utils.ts +2 -1
- package/dist/cjs/decorators/classList.js +0 -177
- package/dist/cjs/decorators/classList.js.map +0 -7
- package/dist/cjs/decorators/setAttribute.js +0 -111
- package/dist/cjs/decorators/setAttribute.js.map +0 -7
- package/dist/cjs/decorators/style.js.map +0 -7
- package/dist/esm/decorators/classList.js +0 -158
- package/dist/esm/decorators/classList.js.map +0 -7
- package/dist/esm/decorators/setAttribute.js +0 -92
- package/dist/esm/decorators/setAttribute.js.map +0 -7
- package/dist/esm/decorators/style.js.map +0 -7
- package/dist/types/decorators/classList.d.ts +0 -71
- package/dist/types/decorators/classList.d.ts.map +0 -1
- package/dist/types/decorators/setAttribute.d.ts +0 -23
- package/dist/types/decorators/setAttribute.d.ts.map +0 -1
- package/dist/types/decorators/style.d.ts +0 -58
- package/dist/types/decorators/style.d.ts.map +0 -1
- package/src/decorators/classList.ts +0 -234
- package/src/decorators/setAttribute.ts +0 -114
- package/src/decorators/style.ts +0 -185
|
@@ -24,7 +24,7 @@ __export(addEventListener_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(addEventListener_exports);
|
|
26
26
|
var import_core = require("@dooboostore/core");
|
|
27
|
-
const ADD_EVENT_LISTENER_METADATA_KEY = Symbol("simple-web-component:add-event-listener");
|
|
27
|
+
const ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for("simple-web-component:add-event-listener");
|
|
28
28
|
function addEventListener(selectorOrTarget, type, options = {}) {
|
|
29
29
|
return (targetObj, propertyKey, descriptor) => {
|
|
30
30
|
const constructor = targetObj.constructor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/addEventListener.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions } from '../types';\n\nexport interface AddEventListenerBaseOptions extends EventListenerOptions {\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n stopPropagation?: boolean;\n stopImmediatePropagation?: boolean;\n preventDefault?: boolean;\n removeOnDisconnected?: boolean;\n delegate?: boolean;\n}\n\nexport interface AddEventListenerMetadata {\n propertyKey: string | symbol;\n selector: string;\n type: string;\n options: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean };\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol('simple-web-component:add-event-listener');\n\nexport function addEventListener(target: SpecialSelector, type: string, options?: AddEventListenerBaseOptions): MethodDecorator;\nexport function addEventListener(selector: string, type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean }): MethodDecorator;\n/**\n * @addEventListener decorator to bind events to elements.\n */\nexport function addEventListener(selectorOrTarget: string, type: string, options: any = {}): MethodDecorator {\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.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\n listeners.push({ propertyKey, selector: selectorOrTarget, type, options });\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\n/**\n * @addEventListenerHost decorator - simplified version of @addEventListener for :host selector\n * Usage: @addEventListenerHost('click')\n * Usage: @addEventListenerHost('click', { stopPropagation: true })\n */\nexport function addEventListenerHost(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener(':host', type, options);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAqBtB,MAAM,kCAAkC,OAAO,yCAAyC;
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SpecialSelector, SwcQueryOptions } from '../types';\n\nexport interface AddEventListenerBaseOptions extends EventListenerOptions {\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n stopPropagation?: boolean;\n stopImmediatePropagation?: boolean;\n preventDefault?: boolean;\n removeOnDisconnected?: boolean;\n delegate?: boolean;\n}\n\nexport interface AddEventListenerMetadata {\n propertyKey: string | symbol;\n selector: string;\n type: string;\n options: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean };\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol.for('simple-web-component:add-event-listener');\n\nexport function addEventListener(target: SpecialSelector, type: string, options?: AddEventListenerBaseOptions): MethodDecorator;\nexport function addEventListener(selector: string, type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions & { delegate?: boolean }): MethodDecorator;\n/**\n * @addEventListener decorator to bind events to elements.\n */\nexport function addEventListener(selectorOrTarget: string, type: string, options: any = {}): MethodDecorator {\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.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\n listeners.push({ propertyKey, selector: selectorOrTarget, type, options });\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\n/**\n * @addEventListenerHost decorator - simplified version of @addEventListener for :host selector\n * Usage: @addEventListenerHost('click')\n * Usage: @addEventListenerHost('click', { stopPropagation: true })\n */\nexport function addEventListenerHost(type: string, options?: AddEventListenerBaseOptions & SwcQueryOptions): MethodDecorator {\n return addEventListener(':host', type, options);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAqBtB,MAAM,kCAAkC,OAAO,IAAI,yCAAyC;AAO5F,SAAS,iBAAiB,kBAA0B,MAAc,UAAe,CAAC,GAAoB;AAC3G,SAAO,CAAC,WAAmB,aAA8B,eAAmC;AAC1F,UAAM,cAAc,UAAU;AAE9B,QAAI,YAAY,yBAAa,YAAwC,iCAAiC,WAAW;AACjH,QAAI,CAAC,WAAW;AACd,kBAAY,CAAC;AACb,+BAAa,eAAe,iCAAiC,WAAW,WAAW;AAAA,IACrF;AAEA,cAAU,KAAK,EAAE,aAAa,UAAU,kBAAkB,MAAM,QAAQ,CAAC;AAAA,EAC3E;AACF;AAEO,MAAM,8BAA8B,CAAC,WAAwD;AAClG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,yBAAa,YAAY,iCAAiC,WAAW;AAC9E;AAOO,SAAS,qBAAqB,MAAc,SAA0E;AAC3H,SAAO,iBAAiB,SAAS,MAAM,OAAO;AAChD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var applyAttribute_exports = {};
|
|
19
|
+
__export(applyAttribute_exports, {
|
|
20
|
+
ATTRIBUTE_APPLY_METADATA_KEY: () => ATTRIBUTE_APPLY_METADATA_KEY,
|
|
21
|
+
applyAttribute: () => applyAttribute,
|
|
22
|
+
applyAttributeHost: () => applyAttributeHost,
|
|
23
|
+
findAllAttributeApplyMetadata: () => findAllAttributeApplyMetadata,
|
|
24
|
+
removeAttribute: () => removeAttribute,
|
|
25
|
+
removeAttributeHost: () => removeAttributeHost,
|
|
26
|
+
setAttribute: () => setAttribute,
|
|
27
|
+
setAttributeHost: () => setAttributeHost,
|
|
28
|
+
updateAttribute: () => updateAttribute,
|
|
29
|
+
updateAttributeHost: () => updateAttributeHost
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(applyAttribute_exports);
|
|
32
|
+
var import_core = require("@dooboostore/core");
|
|
33
|
+
var import_elementDefine = require("./elementDefine");
|
|
34
|
+
var import_Utils = require("../utils/Utils");
|
|
35
|
+
const ATTRIBUTE_APPLY_METADATA_KEY = Symbol.for("simple-web-component:attribute-apply");
|
|
36
|
+
function createAttributeDecorator(action) {
|
|
37
|
+
return (selector, nameOrOptions, options = {}) => {
|
|
38
|
+
return (target, propertyKey, descriptor) => {
|
|
39
|
+
const constructor = target.constructor;
|
|
40
|
+
let metaList = import_core.ReflectUtils.getOwnMetadata(ATTRIBUTE_APPLY_METADATA_KEY, constructor);
|
|
41
|
+
if (!metaList) {
|
|
42
|
+
metaList = /* @__PURE__ */ new Map();
|
|
43
|
+
import_core.ReflectUtils.defineMetadata(ATTRIBUTE_APPLY_METADATA_KEY, metaList, constructor);
|
|
44
|
+
}
|
|
45
|
+
let attributeName = typeof nameOrOptions === "string" ? nameOrOptions : void 0;
|
|
46
|
+
let finalOptions = options;
|
|
47
|
+
if (typeof nameOrOptions === "object" && nameOrOptions !== null) {
|
|
48
|
+
finalOptions = nameOrOptions;
|
|
49
|
+
}
|
|
50
|
+
metaList.set(propertyKey, {
|
|
51
|
+
propertyKey,
|
|
52
|
+
selector,
|
|
53
|
+
action,
|
|
54
|
+
options: { ...finalOptions, name: attributeName }
|
|
55
|
+
});
|
|
56
|
+
const original = descriptor.value;
|
|
57
|
+
descriptor.value = async function(...args) {
|
|
58
|
+
(0, import_elementDefine.ensureInit)(this);
|
|
59
|
+
const res = await original.apply(this, args);
|
|
60
|
+
if (res !== void 0) {
|
|
61
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
62
|
+
const host = this;
|
|
63
|
+
const hostSet = { ...import_Utils.SwcUtils.getHelperAndHostSet(win, host), $this: this };
|
|
64
|
+
const r = finalOptions.root || "auto";
|
|
65
|
+
const targetEls = [];
|
|
66
|
+
const applyRoot = (t) => {
|
|
67
|
+
if (!t || !(t instanceof win.HTMLElement)) return;
|
|
68
|
+
targetEls.push(t);
|
|
69
|
+
};
|
|
70
|
+
if (selector === ":parentHost") applyRoot(hostSet.$parentHost);
|
|
71
|
+
else if (selector === ":appHost") applyRoot(hostSet.$appHost);
|
|
72
|
+
else if (selector === ":firstHost") applyRoot(hostSet.$firstHost);
|
|
73
|
+
else if (selector === ":lastHost") applyRoot(hostSet.$lastHost);
|
|
74
|
+
else if (selector === ":firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
75
|
+
else if (selector === ":lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
76
|
+
else if (selector === ":hosts") hostSet.$hosts.forEach(applyRoot);
|
|
77
|
+
else if (selector === ":appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
78
|
+
else if (selector === ":host" || !selector) applyRoot(host);
|
|
79
|
+
else {
|
|
80
|
+
const targetRoot = r === "auto" ? host.shadowRoot || host : r === "shadow" ? host.shadowRoot : host;
|
|
81
|
+
if (targetRoot) {
|
|
82
|
+
const found = targetRoot.querySelectorAll(selector);
|
|
83
|
+
if (found) targetEls.push(...Array.from(found));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
targetEls.forEach((targetEl) => {
|
|
87
|
+
const resolvedRes = typeof res === "function" ? res(targetEl, hostSet) : res;
|
|
88
|
+
if (action === "set" || action === "update") {
|
|
89
|
+
if (attributeName) {
|
|
90
|
+
if (resolvedRes === null || resolvedRes === void 0 || resolvedRes === false) {
|
|
91
|
+
targetEl.removeAttribute(attributeName);
|
|
92
|
+
} else {
|
|
93
|
+
targetEl.setAttribute(attributeName, resolvedRes === true ? "" : String(resolvedRes));
|
|
94
|
+
}
|
|
95
|
+
} else if (typeof resolvedRes === "object" && resolvedRes !== null && !Array.isArray(resolvedRes)) {
|
|
96
|
+
Object.entries(resolvedRes).forEach(([attr, val]) => {
|
|
97
|
+
const finalVal = typeof val === "function" ? val(targetEl, hostSet) : val;
|
|
98
|
+
if (finalVal === null || finalVal === void 0 || finalVal === false) {
|
|
99
|
+
targetEl.removeAttribute(attr);
|
|
100
|
+
} else {
|
|
101
|
+
targetEl.setAttribute(attr, finalVal === true ? "" : String(finalVal));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
} else if (action === "remove") {
|
|
106
|
+
if (attributeName) {
|
|
107
|
+
targetEl.removeAttribute(attributeName);
|
|
108
|
+
} else if (typeof resolvedRes === "object" && resolvedRes !== null && !Array.isArray(resolvedRes)) {
|
|
109
|
+
Object.entries(resolvedRes).forEach(([attr, val]) => {
|
|
110
|
+
const shouldRemove = typeof val === "function" ? val(targetEl, hostSet) : !!val;
|
|
111
|
+
if (shouldRemove) targetEl.removeAttribute(attr);
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
const attrs = Array.isArray(resolvedRes) ? resolvedRes : [resolvedRes];
|
|
115
|
+
attrs.forEach((a) => targetEl.removeAttribute(String(a)));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return res;
|
|
121
|
+
};
|
|
122
|
+
return descriptor;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function applyAttribute(selector, action = "update", options = {}) {
|
|
127
|
+
return createAttributeDecorator(action)(selector, options);
|
|
128
|
+
}
|
|
129
|
+
const setAttribute = (selector, nameOrOptions, options = {}) => createAttributeDecorator("set")(selector, nameOrOptions, options);
|
|
130
|
+
const updateAttribute = (selector, nameOrOptions, options = {}) => createAttributeDecorator("update")(selector, nameOrOptions, options);
|
|
131
|
+
const removeAttribute = (selector, nameOrOptions, options = {}) => createAttributeDecorator("remove")(selector, nameOrOptions, options);
|
|
132
|
+
function applyAttributeHost(action = "update", options = {}) {
|
|
133
|
+
return createAttributeDecorator(action)(":host", options);
|
|
134
|
+
}
|
|
135
|
+
const setAttributeHost = (nameOrOptions, options = {}) => createAttributeDecorator("set")(":host", nameOrOptions, options);
|
|
136
|
+
const updateAttributeHost = (nameOrOptions, options = {}) => createAttributeDecorator("update")(":host", nameOrOptions, options);
|
|
137
|
+
const removeAttributeHost = (nameOrOptions, options = {}) => createAttributeDecorator("remove")(":host", nameOrOptions, options);
|
|
138
|
+
const findAllAttributeApplyMetadata = (target) => {
|
|
139
|
+
const result = /* @__PURE__ */ new Map();
|
|
140
|
+
const maps = import_core.ReflectUtils.findAllMetadata(ATTRIBUTE_APPLY_METADATA_KEY, target);
|
|
141
|
+
maps.forEach((map) => {
|
|
142
|
+
if (map instanceof Map) {
|
|
143
|
+
map.forEach((v, k) => result.set(k, v));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return result;
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=applyAttribute.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/applyAttribute.ts"],
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions, HelperHostSet } from '../types';\n\nexport type AttributeAction = 'set' | 'update' | 'remove';\n\nexport interface AttributeApplyOptions extends SwcQueryOptions {\n name?: string;\n}\n\nexport interface AttributeApplyMetadata {\n propertyKey: string | symbol;\n selector: string;\n action: AttributeAction;\n options: AttributeApplyOptions;\n}\n\nexport const ATTRIBUTE_APPLY_METADATA_KEY = Symbol.for('simple-web-component:attribute-apply');\n\nfunction createAttributeDecorator(action: AttributeAction) {\n return (selector: string, nameOrOptions?: string | AttributeApplyOptions, options: AttributeApplyOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(ATTRIBUTE_APPLY_METADATA_KEY, constructor) as Map<string | symbol, AttributeApplyMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, AttributeApplyMetadata>();\n ReflectUtils.defineMetadata(ATTRIBUTE_APPLY_METADATA_KEY, metaList, constructor);\n }\n\n let attributeName = typeof nameOrOptions === 'string' ? nameOrOptions : undefined;\n let finalOptions = options;\n \n if (typeof nameOrOptions === 'object' && nameOrOptions !== null) {\n finalOptions = nameOrOptions as AttributeApplyOptions;\n }\n\n metaList.set(propertyKey, { \n propertyKey, \n selector, \n action, \n options: { ...finalOptions, name: attributeName } \n });\n\n const original = descriptor.value;\n descriptor.value = async function (...args: any[]) {\n ensureInit(this);\n const res = await (original as any).apply(this, args);\n if (res !== undefined) {\n const win = (this as any).ownerDocument?.defaultView || window;\n const host = this as unknown as HTMLElement;\n const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };\n const r = finalOptions.root || 'auto';\n const targetEls: HTMLElement[] = [];\n\n const applyRoot = (t: any) => {\n if (!t || !(t instanceof win.HTMLElement)) return;\n targetEls.push(t);\n };\n\n if (selector === ':parentHost') applyRoot(hostSet.$parentHost);\n else if (selector === ':appHost') applyRoot(hostSet.$appHost);\n else if (selector === ':firstHost') applyRoot(hostSet.$firstHost);\n else if (selector === ':lastHost') applyRoot(hostSet.$lastHost);\n else if (selector === ':firstAppHost') applyRoot(hostSet.$firstAppHost);\n else if (selector === ':lastAppHost') applyRoot(hostSet.$lastAppHost);\n else if (selector === ':hosts') hostSet.$hosts.forEach(applyRoot);\n else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRoot);\n else if (selector === ':host' || !selector) applyRoot(host);\n else {\n const targetRoot = r === 'auto' ? (host.shadowRoot || host) : (r === 'shadow' ? host.shadowRoot : host);\n if (targetRoot) {\n const found = targetRoot.querySelectorAll(selector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n }\n }\n\n targetEls.forEach(targetEl => {\n const resolvedRes = typeof res === 'function' ? (res as any)(targetEl, hostSet) : res;\n\n if (action === 'set' || action === 'update') {\n if (attributeName) {\n // Case: @setAttribute(selector, 'name')\n if (resolvedRes === null || resolvedRes === undefined || resolvedRes === false) {\n targetEl.removeAttribute(attributeName);\n } else {\n targetEl.setAttribute(attributeName, resolvedRes === true ? '' : String(resolvedRes));\n }\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n // Case: @applyAttribute(selector) with Object return\n Object.entries(resolvedRes as any).forEach(([attr, val]) => {\n const finalVal = typeof val === 'function' ? val(targetEl, hostSet) : val;\n if (finalVal === null || finalVal === undefined || finalVal === false) {\n targetEl.removeAttribute(attr);\n } else {\n targetEl.setAttribute(attr, finalVal === true ? '' : String(finalVal));\n }\n });\n }\n } else if (action === 'remove') {\n if (attributeName) {\n targetEl.removeAttribute(attributeName);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([attr, val]) => {\n const shouldRemove = typeof val === 'function' ? val(targetEl, hostSet) : !!val;\n if (shouldRemove) targetEl.removeAttribute(attr);\n });\n } else {\n const attrs = Array.isArray(resolvedRes) ? resolvedRes : [resolvedRes];\n attrs.forEach(a => targetEl.removeAttribute(String(a)));\n }\n }\n });\n }\n return res;\n };\n return descriptor;\n };\n };\n}\n\nexport function applyAttribute(selector: string, action: AttributeAction = 'update', options: AttributeApplyOptions = {}): MethodDecorator {\n return createAttributeDecorator(action)(selector, options);\n}\n\nexport const setAttribute = (selector: string, nameOrOptions?: string | AttributeApplyOptions, options: AttributeApplyOptions = {}) => createAttributeDecorator('set')(selector, nameOrOptions, options);\nexport const updateAttribute = (selector: string, nameOrOptions?: string | AttributeApplyOptions, options: AttributeApplyOptions = {}) => createAttributeDecorator('update')(selector, nameOrOptions, options);\nexport const removeAttribute = (selector: string, nameOrOptions?: string | AttributeApplyOptions, options: AttributeApplyOptions = {}) => createAttributeDecorator('remove')(selector, nameOrOptions, options);\n\n// Host versions\nexport function applyAttributeHost(action: AttributeAction = 'update', options: AttributeApplyOptions = {}): MethodDecorator {\n return createAttributeDecorator(action)(':host', options);\n}\nexport const setAttributeHost = (nameOrOptions: string | AttributeApplyOptions, options: AttributeApplyOptions = {}) => createAttributeDecorator('set')(':host', nameOrOptions, options);\nexport const updateAttributeHost = (nameOrOptions: string | AttributeApplyOptions, options: AttributeApplyOptions = {}) => createAttributeDecorator('update')(':host', nameOrOptions, options);\nexport const removeAttributeHost = (nameOrOptions?: string | AttributeApplyOptions, options: AttributeApplyOptions = {}) => createAttributeDecorator('remove')(':host', nameOrOptions, options);\n\nexport const findAllAttributeApplyMetadata = (target: any): Map<string | symbol, AttributeApplyMetadata> => {\n const result = new Map<string | symbol, AttributeApplyMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, AttributeApplyMetadata>>(ATTRIBUTE_APPLY_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};\n"],
|
|
5
|
+
"mappings": ";;;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iC,CAAC,GAAoB;AAC3H,SAAO,yBAAyB,MAAM,EAAE,SAAS,OAAO;AAC1D;AACO,MAAM,mBAAmB,CAAC,eAA+C,UAAiC,CAAC,MAAM,yBAAyB,KAAK,EAAE,SAAS,eAAe,OAAO;AAChL,MAAM,sBAAsB,CAAC,eAA+C,UAAiC,CAAC,MAAM,yBAAyB,QAAQ,EAAE,SAAS,eAAe,OAAO;AACtL,MAAM,sBAAsB,CAAC,eAAgD,UAAiC,CAAC,MAAM,yBAAyB,QAAQ,EAAE,SAAS,eAAe,OAAO;AAEvL,MAAM,gCAAgC,CAAC,WAA8D;AAC1G,QAAM,SAAS,oBAAI,IAA6C;AAChE,QAAM,OAAO,yBAAa,gBAA8D,8BAA8B,MAAM;AAC5H,OAAK,QAAQ,SAAO;AAClB,QAAI,eAAe,KAAK;AACtB,UAAI,QAAQ,CAAC,GAAG,MAAM,OAAO,IAAI,GAAG,CAAC,CAAC;AAAA,IACxC;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var applyClass_exports = {};
|
|
19
|
+
__export(applyClass_exports, {
|
|
20
|
+
CLASS_METADATA_KEY: () => CLASS_METADATA_KEY,
|
|
21
|
+
addClass: () => addClass,
|
|
22
|
+
addClassHost: () => addClassHost,
|
|
23
|
+
applyClass: () => applyClass,
|
|
24
|
+
applyClassHost: () => applyClassHost,
|
|
25
|
+
findAllClassMetadata: () => findAllClassMetadata,
|
|
26
|
+
removeClass: () => removeClass,
|
|
27
|
+
removeClassHost: () => removeClassHost,
|
|
28
|
+
setClass: () => setClass,
|
|
29
|
+
setClassHost: () => setClassHost,
|
|
30
|
+
toggleClass: () => toggleClass,
|
|
31
|
+
toggleClassHost: () => toggleClassHost,
|
|
32
|
+
updateClass: () => updateClass,
|
|
33
|
+
updateClassHost: () => updateClassHost
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(applyClass_exports);
|
|
36
|
+
var import_core = require("@dooboostore/core");
|
|
37
|
+
var import_elementDefine = require("./elementDefine");
|
|
38
|
+
var import_Utils = require("../utils/Utils");
|
|
39
|
+
const CLASS_METADATA_KEY = Symbol.for("simple-web-component:class");
|
|
40
|
+
function createClassDecorator(action) {
|
|
41
|
+
return (selector, classMapOrOptions, options = {}) => {
|
|
42
|
+
return (target, propertyKey, descriptor) => {
|
|
43
|
+
const constructor = target.constructor;
|
|
44
|
+
let metaList = import_core.ReflectUtils.getOwnMetadata(CLASS_METADATA_KEY, constructor);
|
|
45
|
+
if (!metaList) {
|
|
46
|
+
metaList = /* @__PURE__ */ new Map();
|
|
47
|
+
import_core.ReflectUtils.defineMetadata(CLASS_METADATA_KEY, metaList, constructor);
|
|
48
|
+
}
|
|
49
|
+
let classMap = void 0;
|
|
50
|
+
let finalOptions = options;
|
|
51
|
+
if (typeof classMapOrOptions === "string" || typeof classMapOrOptions === "object" && classMapOrOptions !== null && !("root" in classMapOrOptions)) {
|
|
52
|
+
classMap = classMapOrOptions;
|
|
53
|
+
} else if (typeof classMapOrOptions === "object" && classMapOrOptions !== null && "root" in classMapOrOptions) {
|
|
54
|
+
finalOptions = classMapOrOptions;
|
|
55
|
+
}
|
|
56
|
+
metaList.set(propertyKey, { propertyKey, selector, action, options: finalOptions });
|
|
57
|
+
const original = descriptor.value;
|
|
58
|
+
descriptor.value = async function(...args) {
|
|
59
|
+
(0, import_elementDefine.ensureInit)(this);
|
|
60
|
+
const res = await original.apply(this, args);
|
|
61
|
+
if (res !== void 0) {
|
|
62
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
63
|
+
const host = this;
|
|
64
|
+
const hostSet = { ...import_Utils.SwcUtils.getHelperAndHostSet(win, host), $this: this };
|
|
65
|
+
const r = finalOptions.root || "auto";
|
|
66
|
+
const targetEls = [];
|
|
67
|
+
const applyRoot = (t) => {
|
|
68
|
+
if (!t || !(t instanceof win.HTMLElement)) return;
|
|
69
|
+
targetEls.push(t);
|
|
70
|
+
};
|
|
71
|
+
if (selector === ":parentHost") applyRoot(hostSet.$parentHost);
|
|
72
|
+
else if (selector === ":appHost") applyRoot(hostSet.$appHost);
|
|
73
|
+
else if (selector === ":firstHost") applyRoot(hostSet.$firstHost);
|
|
74
|
+
else if (selector === ":lastHost") applyRoot(hostSet.$lastHost);
|
|
75
|
+
else if (selector === ":firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
76
|
+
else if (selector === ":lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
77
|
+
else if (selector === ":hosts") hostSet.$hosts.forEach(applyRoot);
|
|
78
|
+
else if (selector === ":appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
79
|
+
else if (selector === ":host" || !selector) applyRoot(host);
|
|
80
|
+
else {
|
|
81
|
+
const targetRoot = r === "auto" ? host.shadowRoot || host : r === "shadow" ? host.shadowRoot : host;
|
|
82
|
+
if (targetRoot) {
|
|
83
|
+
const found = targetRoot.querySelectorAll(selector);
|
|
84
|
+
if (found) targetEls.push(...Array.from(found));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
targetEls.forEach((targetEl) => {
|
|
88
|
+
const resolvedRes = typeof res === "function" ? res(targetEl, hostSet) : res;
|
|
89
|
+
if (action === "set") {
|
|
90
|
+
let classes = "";
|
|
91
|
+
if (classMap && typeof classMap === "string") {
|
|
92
|
+
classes = resolvedRes ? classMap : "";
|
|
93
|
+
} else if (typeof resolvedRes === "object" && resolvedRes !== null && !Array.isArray(resolvedRes)) {
|
|
94
|
+
classes = Object.entries(resolvedRes).filter(([_, force]) => typeof force === "function" ? force(targetEl, hostSet) : !!force).map(([cls]) => cls).join(" ");
|
|
95
|
+
} else {
|
|
96
|
+
classes = Array.isArray(resolvedRes) ? resolvedRes.join(" ") : String(resolvedRes);
|
|
97
|
+
}
|
|
98
|
+
targetEl.className = classes;
|
|
99
|
+
} else if (action === "update" || action === "toggle") {
|
|
100
|
+
if (classMap && typeof classMap === "string") {
|
|
101
|
+
targetEl.classList.toggle(classMap, !!resolvedRes);
|
|
102
|
+
} else if (typeof resolvedRes === "object" && resolvedRes !== null && !Array.isArray(resolvedRes)) {
|
|
103
|
+
Object.entries(resolvedRes).forEach(([cls, force]) => {
|
|
104
|
+
const isActive = typeof force === "function" ? force(targetEl, hostSet) : !!force;
|
|
105
|
+
targetEl.classList.toggle(cls, isActive);
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
const classes = Array.isArray(resolvedRes) ? resolvedRes.map(String) : [String(resolvedRes)];
|
|
109
|
+
if (action === "update") targetEl.classList.add(...classes);
|
|
110
|
+
else classes.forEach((c) => targetEl.classList.toggle(c));
|
|
111
|
+
}
|
|
112
|
+
} else if (action === "add" || action === "remove") {
|
|
113
|
+
if (classMap && typeof classMap === "string" && !!resolvedRes) {
|
|
114
|
+
if (action === "add") targetEl.classList.add(classMap);
|
|
115
|
+
else targetEl.classList.remove(classMap);
|
|
116
|
+
} else if (typeof resolvedRes === "object" && resolvedRes !== null && !Array.isArray(resolvedRes)) {
|
|
117
|
+
Object.entries(resolvedRes).forEach(([cls, force]) => {
|
|
118
|
+
const shouldExecute = typeof force === "function" ? force(targetEl, hostSet) : !!force;
|
|
119
|
+
if (shouldExecute) {
|
|
120
|
+
if (action === "add") targetEl.classList.add(cls);
|
|
121
|
+
else targetEl.classList.remove(cls);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
const classes = Array.isArray(resolvedRes) ? resolvedRes.map(String) : [String(resolvedRes)];
|
|
126
|
+
if (action === "add") targetEl.classList.add(...classes);
|
|
127
|
+
else targetEl.classList.remove(...classes);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return res;
|
|
133
|
+
};
|
|
134
|
+
return descriptor;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function applyClass(selector, action = "update", options = {}) {
|
|
139
|
+
return createClassDecorator(action)(selector, options);
|
|
140
|
+
}
|
|
141
|
+
const setClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("set")(selector, classMapOrOptions, options);
|
|
142
|
+
const updateClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("update")(selector, classMapOrOptions, options);
|
|
143
|
+
const addClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("add")(selector, classMapOrOptions, options);
|
|
144
|
+
const removeClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("remove")(selector, classMapOrOptions, options);
|
|
145
|
+
const toggleClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("toggle")(selector, classMapOrOptions, options);
|
|
146
|
+
function applyClassHost(action = "update", options = {}) {
|
|
147
|
+
return createClassDecorator(action)(":host", options);
|
|
148
|
+
}
|
|
149
|
+
const setClassHost = (classMapOrOptions, options = {}) => createClassDecorator("set")(":host", classMapOrOptions, options);
|
|
150
|
+
const updateClassHost = (classMapOrOptions, options = {}) => createClassDecorator("update")(":host", classMapOrOptions, options);
|
|
151
|
+
const addClassHost = (classMapOrOptions, options = {}) => createClassDecorator("add")(":host", classMapOrOptions, options);
|
|
152
|
+
const removeClassHost = (classMapOrOptions, options = {}) => createClassDecorator("remove")(":host", classMapOrOptions, options);
|
|
153
|
+
const toggleClassHost = (classMapOrOptions, options = {}) => createClassDecorator("toggle")(":host", classMapOrOptions, options);
|
|
154
|
+
const findAllClassMetadata = (target) => {
|
|
155
|
+
const result = /* @__PURE__ */ new Map();
|
|
156
|
+
const maps = import_core.ReflectUtils.findAllMetadata(CLASS_METADATA_KEY, target);
|
|
157
|
+
maps.forEach((map) => {
|
|
158
|
+
if (map instanceof Map) {
|
|
159
|
+
map.forEach((v, k) => result.set(k, v));
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
return result;
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=applyClass.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/applyClass.ts"],
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions, HelperHostSet } from '../types';\n\nexport const CLASS_METADATA_KEY = Symbol.for('simple-web-component:class');\n\nexport type ClassAction = 'set' | 'update' | 'add' | 'remove' | 'toggle';\n\nexport interface ClassApplyOptions extends SwcQueryOptions {}\n\nexport interface ClassApplyMetadata {\n propertyKey: string | symbol;\n selector: string;\n action: ClassAction;\n options: ClassApplyOptions;\n}\n\nfunction createClassDecorator(action: ClassAction) {\n return (selector: string, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(CLASS_METADATA_KEY, constructor) as Map<string | symbol, ClassApplyMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ClassApplyMetadata>();\n ReflectUtils.defineMetadata(CLASS_METADATA_KEY, metaList, constructor);\n }\n\n let classMap: any = undefined;\n let finalOptions = options;\n\n if (typeof classMapOrOptions === 'string' || (typeof classMapOrOptions === 'object' && classMapOrOptions !== null && !('root' in classMapOrOptions))) {\n classMap = classMapOrOptions;\n } else if (typeof classMapOrOptions === 'object' && classMapOrOptions !== null && 'root' in classMapOrOptions) {\n finalOptions = classMapOrOptions as ClassApplyOptions;\n }\n\n metaList.set(propertyKey, { propertyKey, selector, action, options: finalOptions });\n\n const original = descriptor.value;\n descriptor.value = async function (...args: any[]) {\n ensureInit(this);\n const res = await (original as any).apply(this, args);\n if (res !== undefined) {\n const win = (this as any).ownerDocument?.defaultView || window;\n const host = this as unknown as HTMLElement;\n const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };\n const r = finalOptions.root || 'auto';\n const targetEls: HTMLElement[] = [];\n\n const applyRoot = (t: any) => {\n if (!t || !(t instanceof win.HTMLElement)) return;\n targetEls.push(t);\n };\n\n if (selector === ':parentHost') applyRoot(hostSet.$parentHost);\n else if (selector === ':appHost') applyRoot(hostSet.$appHost);\n else if (selector === ':firstHost') applyRoot(hostSet.$firstHost);\n else if (selector === ':lastHost') applyRoot(hostSet.$lastHost);\n else if (selector === ':firstAppHost') applyRoot(hostSet.$firstAppHost);\n else if (selector === ':lastAppHost') applyRoot(hostSet.$lastAppHost);\n else if (selector === ':hosts') hostSet.$hosts.forEach(applyRoot);\n else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRoot);\n else if (selector === ':host' || !selector) applyRoot(host);\n else {\n const targetRoot = r === 'auto' ? (host.shadowRoot || host) : (r === 'shadow' ? host.shadowRoot : host);\n if (targetRoot) {\n const found = targetRoot.querySelectorAll(selector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n }\n }\n\n targetEls.forEach(targetEl => {\n const resolvedRes = typeof res === 'function' ? (res as any)(targetEl, hostSet) : res;\n\n if (action === 'set') {\n let classes = '';\n if (classMap && typeof classMap === 'string') {\n classes = resolvedRes ? classMap : '';\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n classes = Object.entries(resolvedRes as any)\n .filter(([_, force]) => typeof force === 'function' ? force(targetEl, hostSet) : !!force)\n .map(([cls]) => cls)\n .join(' ');\n } else {\n classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).join(' ') : String(resolvedRes);\n }\n targetEl.className = classes;\n } else if (action === 'update' || action === 'toggle') {\n if (classMap && typeof classMap === 'string') {\n targetEl.classList.toggle(classMap, !!resolvedRes);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([cls, force]) => {\n const isActive = typeof force === 'function' ? force(targetEl, hostSet) : !!force;\n targetEl.classList.toggle(cls, isActive);\n });\n } else {\n const classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).map(String) : [String(resolvedRes)];\n if (action === 'update') targetEl.classList.add(...classes);\n else classes.forEach(c => targetEl.classList.toggle(c));\n }\n } else if (action === 'add' || action === 'remove') {\n if (classMap && typeof classMap === 'string' && !!resolvedRes) {\n if (action === 'add') targetEl.classList.add(classMap);\n else targetEl.classList.remove(classMap);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([cls, force]) => {\n const shouldExecute = typeof force === 'function' ? force(targetEl, hostSet) : !!force;\n if (shouldExecute) {\n if (action === 'add') targetEl.classList.add(cls);\n else targetEl.classList.remove(cls);\n }\n });\n } else {\n const classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).map(String) : [String(resolvedRes)];\n if (action === 'add') targetEl.classList.add(...classes);\n else targetEl.classList.remove(...classes);\n }\n }\n });\n }\n return res;\n };\n return descriptor;\n };\n };\n}\n\nexport function applyClass(selector: string, action: ClassAction = 'update', options: ClassApplyOptions = {}): MethodDecorator {\n return createClassDecorator(action)(selector, options);\n}\n\nexport const setClass = (selector: string, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('set')(selector, classMapOrOptions, options);\nexport const updateClass = (selector: string, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('update')(selector, classMapOrOptions, options);\nexport const addClass = (selector: string, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('add')(selector, classMapOrOptions, options);\nexport const removeClass = (selector: string, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('remove')(selector, classMapOrOptions, options);\nexport const toggleClass = (selector: string, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('toggle')(selector, classMapOrOptions, options);\n\n// Host versions\nexport function applyClassHost(action: ClassAction = 'update', options: ClassApplyOptions = {}): MethodDecorator {\n return createClassDecorator(action)(':host', options);\n}\nexport const setClassHost = (classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('set')(':host', classMapOrOptions, options);\nexport const updateClassHost = (classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('update')(':host', classMapOrOptions, options);\nexport const addClassHost = (classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('add')(':host', classMapOrOptions, options);\nexport const removeClassHost = (classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('remove')(':host', classMapOrOptions, options);\nexport const toggleClassHost = (classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}) => createClassDecorator('toggle')(':host', classMapOrOptions, options);\n\nexport const findAllClassMetadata = (target: any): Map<string | symbol, ClassApplyMetadata> => {\n const result = new Map<string | symbol, ClassApplyMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ClassApplyMetadata>>(CLASS_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAC7B,2BAA2B;AAC3B,mBAAyB;AAGlB,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAazE,SAAS,qBAAqB,QAAqB;AACjD,SAAO,CAAC,UAAkB,mBAA4J,UAA6B,CAAC,MAAuB;AACzO,WAAO,CAAC,QAAgB,aAA8B,eAAmC;AACvF,YAAM,cAAc,OAAO;AAC3B,UAAI,WAAW,yBAAa,eAAe,oBAAoB,WAAW;AAC1E,UAAI,CAAC,UAAU;AACb,mBAAW,oBAAI,IAAyC;AACxD,iCAAa,eAAe,oBAAoB,UAAU,WAAW;AAAA,MACvE;AAEA,UAAI,WAAgB;AACpB,UAAI,eAAe;AAEnB,U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