@dooboostore/simple-web-component 1.0.23 → 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 -3212
- 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 +97 -109
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +135 -0
- package/dist/cjs/decorators/applyStyle.js.map +7 -0
- package/dist/cjs/decorators/attribute.js +24 -11
- 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 +78 -3
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +78 -3
- 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/index.js +4 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/utils/Utils.js +141 -2
- 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 +97 -109
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +116 -0
- package/dist/esm/decorators/applyStyle.js.map +7 -0
- package/dist/esm/decorators/attribute.js +24 -11
- 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 +78 -3
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +78 -3
- 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/index.js +4 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/utils/Utils.js +141 -2
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +3191 -506
- 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 +18 -104
- 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 +12 -14
- 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 +68 -4
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +70 -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/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +49 -0
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +3191 -506
- 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 +126 -225
- package/src/decorators/applyStyle.ts +128 -0
- package/src/decorators/attribute.ts +42 -43
- package/src/decorators/changedAttributeHost.ts +2 -2
- 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 +148 -6
- package/src/decorators/queryAll.ts +149 -3
- package/src/elements/SwcAppEngine.ts +32 -4
- package/src/elements/SwcAppMixin.ts +2 -0
- package/src/index.ts +6 -6
- package/src/utils/Utils.ts +146 -1
- package/dist/cjs/decorators/classList.js +0 -134
- 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 +0 -114
- package/dist/cjs/decorators/style.js.map +0 -7
- package/dist/cjs/utils/TemplateUtils.js +0 -109
- package/dist/cjs/utils/TemplateUtils.js.map +0 -7
- package/dist/esm/decorators/classList.js +0 -115
- 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 +0 -95
- package/dist/esm/decorators/style.js.map +0 -7
- package/dist/esm/utils/TemplateUtils.js +0 -90
- package/dist/esm/utils/TemplateUtils.js.map +0 -7
- package/dist/types/decorators/classList.d.ts +0 -61
- 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 -49
- package/dist/types/decorators/style.d.ts.map +0 -1
- package/dist/types/utils/TemplateUtils.d.ts +0 -59
- package/dist/types/utils/TemplateUtils.d.ts.map +0 -1
- package/src/decorators/classList.ts +0 -172
- package/src/decorators/setAttribute.ts +0 -113
- package/src/decorators/style.ts +0 -140
- package/src/utils/TemplateUtils.ts +0 -92
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/decorators/setAttribute.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit, getElementConfig } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions } from '../types';\n\nexport interface SetAttributeMetadata {\n propertyKey: string | symbol;\n selector: string;\n name: string;\n options: SwcQueryOptions;\n}\n\nexport const SET_ATTRIBUTE_METADATA_KEY = Symbol('simple-web-component:set-attribute');\n\n/**\n * @setAttribute decorator to surgically update an attribute of a target element.\n * Usage: @setAttribute(':host', 'count')\n * Usage: @setAttribute('#child', 'disabled')\n */\nexport function setAttribute(selector: string, name: string): MethodDecorator;\nexport function setAttribute(selector: string, name: string, options?: SwcQueryOptions): MethodDecorator;\nexport function setAttribute(selector: string, name: string, options: SwcQueryOptions = {}): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(SET_ATTRIBUTE_METADATA_KEY, constructor) as Map<string | symbol, SetAttributeMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, SetAttributeMetadata>();\n ReflectUtils.defineMetadata(SET_ATTRIBUTE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, { propertyKey, selector, name, options });\n\n const original = descriptor.value;\n descriptor.value = async function (...args: any[]) {\n ensureInit(this);\n const res = await original.apply(this, args);\n if (res !== undefined) {\n const hostSet = SwcUtils.getHostSet(this as any);\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as Window);\n\n const targetEls: any[] = [];\n const r = options.root || 'auto';\n\n const applyRoot = (t: any) => {\n if (!t) return;\n if (r === 'auto') {\n targetEls.push((t as any).shadowRoot || t);\n return;\n }\n if (r === 'light' || r === 'all') targetEls.push(t);\n if ((r === 'shadow' || r === 'all') && (t as any).shadowRoot) targetEls.push((t as any).shadowRoot);\n };\n\n if (selector === ':window') targetEls.push(currentWin);\n else if (selector === ':document') targetEls.push(currentWin.document as any);\n else 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(this);\n else {\n const roots: any[] = [];\n if (r === 'shadow') {\n if ((this as any).shadowRoot) roots.push((this as any).shadowRoot);\n } else if (r === 'light') {\n roots.push(this as any);\n } else if (r === 'all') {\n roots.push(this as any);\n if ((this as any).shadowRoot) roots.push((this as any).shadowRoot);\n } else {\n roots.push((this as any).shadowRoot || (this as any));\n }\n roots.forEach(root => targetEls.push(...root.querySelectorAll(selector)));\n }\n\n targetEls.forEach(targetEl => {\n if (!targetEl || typeof (targetEl as any).setAttribute !== 'function') return;\n if (res === null) (targetEl as any).removeAttribute(name);\n else (targetEl as any).setAttribute(name, String(res));\n })\n }\n return res;\n };\n };\n}\n\nexport const getSetAttributeMetadata = (target: any): Map<string | symbol, SetAttributeMetadata> | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(SET_ATTRIBUTE_METADATA_KEY, constructor);\n};\n\nexport const findAllSetAttributeMetadata = (target: any): Map<string | symbol, SetAttributeMetadata> => {\n const result = new Map<string | symbol, SetAttributeMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, SetAttributeMetadata>>(SET_ATTRIBUTE_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\n/**\n * @setAttributeHost decorator - simplified version of @setAttribute for :host selector\n * Usage: @setAttributeHost('aria-disabled')\n */\nexport function setAttributeHost(name: string, options?: SwcQueryOptions): MethodDecorator {\n return setAttribute(':host', name, options);\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,wBAAwB;AAC7C,SAAS,gBAAgB;AAUlB,MAAM,6BAA6B,OAAO,oCAAoC;AAS9E,SAAS,aAAa,UAAkB,MAAc,UAA2B,CAAC,GAAoB;AAC3G,SAAO,CAAC,QAAgB,aAA8B,eAAmC;AACvF,UAAM,cAAc,OAAO;AAC3B,QAAI,WAAW,aAAa,eAAe,4BAA4B,WAAW;AAClF,QAAI,CAAC,UAAU;AACb,iBAAW,oBAAI,IAA2C;AAC1D,mBAAa,eAAe,4BAA4B,UAAU,WAAW;AAAA,IAC/E;AACA,aAAS,IAAI,aAAa,EAAE,aAAa,UAAU,MAAM,QAAQ,CAAC;AAElE,UAAM,WAAW,WAAW;AAC5B,eAAW,QAAQ,kBAAmB,MAAa;AACjD,iBAAW,IAAI;AACf,YAAM,MAAM,MAAM,SAAS,MAAM,MAAM,IAAI;AAC3C,UAAI,QAAQ,QAAW;AACrB,cAAM,UAAU,SAAS,WAAW,IAAW;AAC/C,cAAM,OAAO,iBAAiB,IAAI;AAClC,cAAM,aAAc,KAAa,iBAAiB,IAAI,MAAO,OAAO,WAAW,cAAc,SAAS;AAEtG,cAAM,YAAmB,CAAC;AAC1B,cAAM,IAAI,QAAQ,QAAQ;AAE1B,cAAM,YAAY,CAAC,MAAW;AAC5B,cAAI,CAAC,EAAG;AACR,cAAI,MAAM,QAAQ;AAChB,sBAAU,KAAM,EAAU,cAAc,CAAC;AACzC;AAAA,UACF;AACA,cAAI,MAAM,WAAW,MAAM,MAAO,WAAU,KAAK,CAAC;AAClD,eAAK,MAAM,YAAY,MAAM,UAAW,EAAU,WAAY,WAAU,KAAM,EAAU,UAAU;AAAA,QACpG;AAEA,YAAI,aAAa,UAAW,WAAU,KAAK,UAAU;AAAA,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O;AACjE,SAAO,aAAa,YAAY,4BAA4B,WAAW;AACzE;AAEO,MAAM,8BAA8B,CAAC,WAA4D;AACtG,QAAM,SAAS,oBAAI,IAA2C;AAC9D,QAAM,OAAO,aAAa,gBAA4D,4BAA4B,MAAM;AACxH,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;AAMO,SAAS,iBAAiB,MAAc,SAA4C;AACzF,SAAO,aAAa,SAAS,MAAM,OAAO;AAC5C;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { ReflectUtils } from "@dooboostore/core";
|
|
2
|
-
import { ensureInit } from "./elementDefine.js";
|
|
3
|
-
import { SwcUtils } from "../utils/Utils.js";
|
|
4
|
-
const STYLE_METADATA_KEY = Symbol("simple-web-component:style");
|
|
5
|
-
function createStyleDecorator(action) {
|
|
6
|
-
return (selector, options = {}) => {
|
|
7
|
-
return (target, propertyKey, descriptor) => {
|
|
8
|
-
const constructor = target.constructor;
|
|
9
|
-
let metaList = ReflectUtils.getOwnMetadata(STYLE_METADATA_KEY, constructor);
|
|
10
|
-
if (!metaList) {
|
|
11
|
-
metaList = /* @__PURE__ */ new Map();
|
|
12
|
-
ReflectUtils.defineMetadata(STYLE_METADATA_KEY, metaList, constructor);
|
|
13
|
-
}
|
|
14
|
-
metaList.set(propertyKey, { propertyKey, selector, action, options });
|
|
15
|
-
const original = descriptor.value;
|
|
16
|
-
descriptor.value = async function(...args) {
|
|
17
|
-
ensureInit(this);
|
|
18
|
-
const res = await original.apply(this, args);
|
|
19
|
-
if (res !== void 0) {
|
|
20
|
-
const r = options.root || "auto";
|
|
21
|
-
const hostSet = SwcUtils.getHostSet(this);
|
|
22
|
-
const targetEls = [];
|
|
23
|
-
if (selector === ":host" || !selector) {
|
|
24
|
-
targetEls.push(this);
|
|
25
|
-
} else if (selector === ":parentHost") {
|
|
26
|
-
if (hostSet.$parentHost) targetEls.push(hostSet.$parentHost);
|
|
27
|
-
} else if (selector === ":appHost") {
|
|
28
|
-
if (hostSet.$appHost) targetEls.push(hostSet.$appHost);
|
|
29
|
-
} else {
|
|
30
|
-
if (r === "shadow") {
|
|
31
|
-
const found = this.shadowRoot?.querySelectorAll(selector);
|
|
32
|
-
if (found) targetEls.push(...found);
|
|
33
|
-
} else if (r === "light") {
|
|
34
|
-
const found = this.querySelectorAll(selector);
|
|
35
|
-
if (found) targetEls.push(...found);
|
|
36
|
-
} else if (r === "all") {
|
|
37
|
-
const sFound = this.shadowRoot?.querySelectorAll(selector);
|
|
38
|
-
const lFound = this.querySelectorAll(selector);
|
|
39
|
-
if (sFound) targetEls.push(...sFound);
|
|
40
|
-
if (lFound) targetEls.push(...lFound);
|
|
41
|
-
} else {
|
|
42
|
-
const found = (this.shadowRoot || this).querySelectorAll(selector);
|
|
43
|
-
if (found) targetEls.push(...found);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
targetEls.forEach((targetEl) => {
|
|
47
|
-
if (action === "set") {
|
|
48
|
-
targetEl.style.cssText = "";
|
|
49
|
-
if (typeof res === "object" && res !== null) {
|
|
50
|
-
Object.assign(targetEl.style, res);
|
|
51
|
-
} else if (typeof res === "string") {
|
|
52
|
-
targetEl.style.cssText = res;
|
|
53
|
-
}
|
|
54
|
-
} else if (action === "update") {
|
|
55
|
-
if (typeof res === "object" && res !== null) {
|
|
56
|
-
Object.assign(targetEl.style, res);
|
|
57
|
-
}
|
|
58
|
-
} else if (action === "remove") {
|
|
59
|
-
const props = Array.isArray(res) ? res : [res];
|
|
60
|
-
props.forEach((p) => targetEl.style.removeProperty(String(p)));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return res;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const setStyle = (selector, options = {}) => createStyleDecorator("set")(selector, options);
|
|
70
|
-
const setStyleHost = (options = {}) => createStyleDecorator("set")(":host", options);
|
|
71
|
-
const updateStyle = (selector, options = {}) => createStyleDecorator("update")(selector, options);
|
|
72
|
-
const updateStyleHost = (options = {}) => createStyleDecorator("update")(":host", options);
|
|
73
|
-
const removeStyle = (selector, options = {}) => createStyleDecorator("remove")(selector, options);
|
|
74
|
-
const removeStyleHost = (options = {}) => createStyleDecorator("remove")(":host", options);
|
|
75
|
-
const findAllStyleMetadata = (target) => {
|
|
76
|
-
const result = /* @__PURE__ */ new Map();
|
|
77
|
-
const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
|
|
78
|
-
maps.forEach((map) => {
|
|
79
|
-
if (map instanceof Map) {
|
|
80
|
-
map.forEach((v, k) => result.set(k, v));
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
return result;
|
|
84
|
-
};
|
|
85
|
-
export {
|
|
86
|
-
STYLE_METADATA_KEY,
|
|
87
|
-
findAllStyleMetadata,
|
|
88
|
-
removeStyle,
|
|
89
|
-
removeStyleHost,
|
|
90
|
-
setStyle,
|
|
91
|
-
setStyleHost,
|
|
92
|
-
updateStyle,
|
|
93
|
-
updateStyleHost
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=style.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/decorators/style.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SwcQueryOptions } from '../types';\n\nexport type StyleAction = 'set' | 'update' | 'remove';\n\nexport interface StyleOptions extends SwcQueryOptions {\n}\n\nexport interface StyleMetadata {\n propertyKey: string | symbol;\n selector: string;\n action: StyleAction;\n options: StyleOptions;\n}\n\nexport const STYLE_METADATA_KEY = Symbol('simple-web-component:style');\n\nfunction createStyleDecorator(action: StyleAction) {\n return (selector: string, options: StyleOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(STYLE_METADATA_KEY, constructor) as Map<string | symbol, StyleMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, StyleMetadata>();\n ReflectUtils.defineMetadata(STYLE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, { propertyKey, selector, action, options });\n\n const original = descriptor.value;\n descriptor.value = async function (...args: any[]) {\n ensureInit(this);\n const res = await original.apply(this, args);\n if (res !== undefined) {\n const r = options.root || 'auto';\n const hostSet = SwcUtils.getHostSet(this as any);\n const targetEls: HTMLElement[] = [];\n\n if (selector === ':host' || !selector) {\n targetEls.push(this as any);\n } else if (selector === ':parentHost') {\n if (hostSet.$parentHost) targetEls.push(hostSet.$parentHost);\n } else if (selector === ':appHost') {\n if (hostSet.$appHost) targetEls.push(hostSet.$appHost);\n } else {\n if (r === 'shadow') {\n const found = this.shadowRoot?.querySelectorAll(selector);\n if (found) targetEls.push(...found);\n } else if (r === 'light') {\n const found = (this as any).querySelectorAll(selector);\n if (found) targetEls.push(...found);\n } else if (r === 'all') {\n const sFound = this.shadowRoot?.querySelectorAll(selector);\n const lFound = (this as any).querySelectorAll(selector);\n if (sFound) targetEls.push(...sFound);\n if (lFound) targetEls.push(...lFound);\n } else {\n // auto\n const found = (this.shadowRoot || (this as any)).querySelectorAll(selector);\n if (found) targetEls.push(...found);\n }\n }\n\n targetEls.forEach(targetEl => {\n if (action === 'set') {\n targetEl.style.cssText = '';\n if (typeof res === 'object' && res !== null) {\n Object.assign(targetEl.style, res);\n } else if (typeof res === 'string') {\n targetEl.style.cssText = res;\n }\n } else if (action === 'update') {\n if (typeof res === 'object' && res !== null) {\n Object.assign(targetEl.style, res);\n }\n } else if (action === 'remove') {\n const props = Array.isArray(res) ? res : [res];\n props.forEach(p => targetEl.style.removeProperty(String(p)));\n }\n });\n }\n return res;\n };\n };\n };\n}\n\n/**\n * @setStyle decorator to surgically set styles on a target element (replaces all existing styles).\n * Usage: @setStyle('#box') getStyles() { return { color: 'red', display: 'block' }; }\n * Usage: @setStyle('#box', { root: 'shadow' }) getStyles() { return { color: 'red' }; }\n */\nexport const setStyle = (selector: string, options: StyleOptions = {}) => createStyleDecorator('set')(selector, options);\n\n/**\n * @setStyleHost decorator - simplified version of @setStyle for :host selector.\n * Usage: @setStyleHost getStyles() { return { color: 'red', display: 'block' }; }\n * Usage: @setStyleHost({ root: 'shadow' }) getStyles() { return { color: 'red' }; }\n */\nexport const setStyleHost = (options: StyleOptions = {}) => createStyleDecorator('set')(':host', options);\n\n/**\n * @updateStyle decorator to surgically update styles on a target element (merges with existing styles).\n * Usage: @updateStyle('#box') updateStyles() { return { color: 'blue' }; }\n * Usage: @updateStyle('#box', { root: 'shadow' }) updateStyles() { return { color: 'blue' }; }\n */\nexport const updateStyle = (selector: string, options: StyleOptions = {}) => createStyleDecorator('update')(selector, options);\n\n/**\n * @updateStyleHost decorator - simplified version of @updateStyle for :host selector.\n * Usage: @updateStyleHost updateStyles() { return { color: 'blue' }; }\n * Usage: @updateStyleHost({ root: 'shadow' }) updateStyles() { return { color: 'blue' }; }\n */\nexport const updateStyleHost = (options: StyleOptions = {}) => createStyleDecorator('update')(':host', options);\n\n/**\n * @removeStyle decorator to surgically remove styles from a target element.\n * Usage: @removeStyle('#box') clearStyles() { return ['color', 'display']; }\n * Usage: @removeStyle('#box', { root: 'shadow' }) clearStyles() { return ['color']; }\n */\nexport const removeStyle = (selector: string, options: StyleOptions = {}) => createStyleDecorator('remove')(selector, options);\n\n/**\n * @removeStyleHost decorator - simplified version of @removeStyle for :host selector.\n * Usage: @removeStyleHost clearStyles() { return ['color', 'display']; }\n * Usage: @removeStyleHost({ root: 'shadow' }) clearStyles() { return ['color']; }\n */\nexport const removeStyleHost = (options: StyleOptions = {}) => createStyleDecorator('remove')(':host', options);\n\nexport const findAllStyleMetadata = (target: any): Map<string | symbol, StyleMetadata> => {\n const result = new Map<string | symbol, StyleMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, StyleMetadata>>(STYLE_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,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAelB,MAAM,qBAAqB,OAAO,4BAA4B;AAErE,SAAS,qBAAqB,QAAqB;AACjD,SAAO,CAAC,UAAkB,UAAwB,CAAC,MAAuB;AACxE,WAAO,CAAC,QAAgB,aAA8B,eAAmC;AACvF,YAAM,cAAc,OAAO;AAC3B,UAAI,WAAW,aAAa,eAAe,oBAAoB,WAAW;AAC1E,UAAI,CAAC,UAAU;AACb,mBAAW,oBAAI,IAAoC;AACnD,qBAAa,eAAe,oBAAoB,UAAU,WAAW;AAAA,MACvE;AACA,eAAS,IAAI,aAAa,EAAE,aAAa,UAAU,QAAQ,QAAQ,CAAC;AAEpE,YAAM,WAAW,WAAW;AAC5B,iBAAW,QAAQ,kBAAmB,MAAa;AACjD,mBAAW,IAAI;AACf,cAAM,MAAM,MAAM,SAAS,MAAM,MAAM,IAAI;AAC3C,YAAI,QAAQ,QAAW;AACrB,gBAAM,IAAI,QAAQ,QAAQ;AAC1B,gBAAM,UAAU,SAAS,WAAW,IAAW;AAC/C,gBAAM,YAA2B,CAAC;AAElC,cAAI,aAAa,WAAW,CAAC,UAAU;AACrC,sBAAU,KAAK,IAAW;AAAA,UAC5B,WAAW,aAAa,eAAe;AACrC,gBAAI,QAAQ,YAAa,WAAU,KAAK,QAAQ,WAAW;AAAA,UAC7D,WAAW,aAAa,YAAY;AAClC,gBAAI,QAAQ,SAAU,WAAU,KAAK,QAAQ,QAAQ;AAAA,UACvD,OAAO;AACL,gBAAI,MAAM,UAA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AK,EAAE,UAAU,OAAO;AAOhH,MAAM,eAAe,CAAC,UAAwB,CAAC,MAAM,qBAAqB,KAAK,EAAE,SAAS,OAAO;AAOjG,MAAM,cAAc,CAAC,UAAkB,UAAwB,CAAC,MAAM,qBAAqB,QAAQ,EAAE,UAAU,OAAO;AAOtH,MAAM,kBAAkB,CAAC,UAAwB,CAAC,MAAM,qBAAqB,QAAQ,EAAE,SAAS,OAAO;AAOvG,MAAM,cAAc,CAAC,UAAkB,UAAwB,CAAC,MAAM,qBAAqB,QAAQ,EAAE,UAAU,OAAO;AAOtH,MAAM,kBAAkB,CAAC,UAAwB,CAAC,MAAM,qBAAqB,QAAQ,EAAE,SAAS,OAAO;AAEvG,MAAM,uBAAuB,CAAC,WAAqD;AACxF,QAAM,SAAS,oBAAI,IAAoC;AACvD,QAAM,OAAO,aAAa,gBAAqD,oBAAoB,MAAM;AACzG,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
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var TemplateUtils;
|
|
2
|
-
((TemplateUtils2) => {
|
|
3
|
-
TemplateUtils2.htmlFragment = (strings, ...values) => {
|
|
4
|
-
const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
5
|
-
const template = document.createElement("template");
|
|
6
|
-
template.innerHTML = raw.trim();
|
|
7
|
-
return template.content;
|
|
8
|
-
};
|
|
9
|
-
TemplateUtils2.textNode = (strings, ...values) => {
|
|
10
|
-
const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
11
|
-
return document.createTextNode(raw);
|
|
12
|
-
};
|
|
13
|
-
TemplateUtils2.commentNode = (strings, ...values) => {
|
|
14
|
-
const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
15
|
-
return document.createComment(raw);
|
|
16
|
-
};
|
|
17
|
-
TemplateUtils2.createElement = (info, attrs = {}) => {
|
|
18
|
-
const el = document.createElement(info.tagName);
|
|
19
|
-
if (info.innerHtml !== void 0) el.innerHTML = info.innerHtml;
|
|
20
|
-
Object.entries(attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
21
|
-
return el;
|
|
22
|
-
};
|
|
23
|
-
const createTagFunction = (tagName) => {
|
|
24
|
-
return (strings, ...values) => {
|
|
25
|
-
const el = document.createElement(tagName);
|
|
26
|
-
el.innerHTML = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
27
|
-
return el;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
TemplateUtils2.htmlDivElement = createTagFunction("div");
|
|
31
|
-
TemplateUtils2.htmlSpanElement = createTagFunction("span");
|
|
32
|
-
TemplateUtils2.htmlButtonElement = createTagFunction("button");
|
|
33
|
-
TemplateUtils2.htmlUlElement = createTagFunction("ul");
|
|
34
|
-
TemplateUtils2.htmlLiElement = createTagFunction("li");
|
|
35
|
-
TemplateUtils2.htmlInputElement = createTagFunction("input");
|
|
36
|
-
TemplateUtils2.htmlAElement = createTagFunction("a");
|
|
37
|
-
TemplateUtils2.htmlPElement = createTagFunction("p");
|
|
38
|
-
TemplateUtils2.htmlH1Element = createTagFunction("h1");
|
|
39
|
-
TemplateUtils2.htmlH2Element = createTagFunction("h2");
|
|
40
|
-
TemplateUtils2.htmlH3Element = createTagFunction("h3");
|
|
41
|
-
TemplateUtils2.htmlH4Element = createTagFunction("h4");
|
|
42
|
-
TemplateUtils2.htmlH5Element = createTagFunction("h5");
|
|
43
|
-
TemplateUtils2.htmlH6Element = createTagFunction("h6");
|
|
44
|
-
TemplateUtils2.htmlSectionElement = createTagFunction("section");
|
|
45
|
-
TemplateUtils2.htmlArticleElement = createTagFunction("article");
|
|
46
|
-
})(TemplateUtils || (TemplateUtils = {}));
|
|
47
|
-
const htmlFragment = TemplateUtils.htmlFragment;
|
|
48
|
-
const textNode = TemplateUtils.textNode;
|
|
49
|
-
const commentNode = TemplateUtils.commentNode;
|
|
50
|
-
const createElement = TemplateUtils.createElement;
|
|
51
|
-
const htmlDivElement = TemplateUtils.htmlDivElement;
|
|
52
|
-
const htmlSpanElement = TemplateUtils.htmlSpanElement;
|
|
53
|
-
const htmlButtonElement = TemplateUtils.htmlButtonElement;
|
|
54
|
-
const htmlUlElement = TemplateUtils.htmlUlElement;
|
|
55
|
-
const htmlLiElement = TemplateUtils.htmlLiElement;
|
|
56
|
-
const htmlInputElement = TemplateUtils.htmlInputElement;
|
|
57
|
-
const htmlAElement = TemplateUtils.htmlAElement;
|
|
58
|
-
const htmlPElement = TemplateUtils.htmlPElement;
|
|
59
|
-
const htmlH1Element = TemplateUtils.htmlH1Element;
|
|
60
|
-
const htmlH2Element = TemplateUtils.htmlH2Element;
|
|
61
|
-
const htmlH3Element = TemplateUtils.htmlH3Element;
|
|
62
|
-
const htmlH4Element = TemplateUtils.htmlH4Element;
|
|
63
|
-
const htmlH5Element = TemplateUtils.htmlH5Element;
|
|
64
|
-
const htmlH6Element = TemplateUtils.htmlH6Element;
|
|
65
|
-
const htmlSectionElement = TemplateUtils.htmlSectionElement;
|
|
66
|
-
const htmlArticleElement = TemplateUtils.htmlArticleElement;
|
|
67
|
-
export {
|
|
68
|
-
TemplateUtils,
|
|
69
|
-
commentNode,
|
|
70
|
-
createElement,
|
|
71
|
-
htmlAElement,
|
|
72
|
-
htmlArticleElement,
|
|
73
|
-
htmlButtonElement,
|
|
74
|
-
htmlDivElement,
|
|
75
|
-
htmlFragment,
|
|
76
|
-
htmlH1Element,
|
|
77
|
-
htmlH2Element,
|
|
78
|
-
htmlH3Element,
|
|
79
|
-
htmlH4Element,
|
|
80
|
-
htmlH5Element,
|
|
81
|
-
htmlH6Element,
|
|
82
|
-
htmlInputElement,
|
|
83
|
-
htmlLiElement,
|
|
84
|
-
htmlPElement,
|
|
85
|
-
htmlSectionElement,
|
|
86
|
-
htmlSpanElement,
|
|
87
|
-
htmlUlElement,
|
|
88
|
-
textNode
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=TemplateUtils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/utils/TemplateUtils.ts"],
|
|
4
|
-
"sourcesContent": ["export interface CreateElementInfo {\n tagName: string;\n innerHtml?: string;\n}\n\nexport namespace TemplateUtils {\n /**\n * Tagged template function to create a DocumentFragment from HTML string.\n */\n export const htmlFragment = (strings: TemplateStringsArray, ...values: any[]): DocumentFragment => {\n const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== undefined ? values[i] : ''), '');\n const template = document.createElement('template');\n template.innerHTML = raw.trim();\n return template.content;\n };\n\n /**\n * Tagged template function to create a Text node from string.\n */\n export const textNode = (strings: TemplateStringsArray, ...values: any[]): Text => {\n const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== undefined ? values[i] : ''), '');\n return document.createTextNode(raw);\n };\n\n /**\n * Tagged template function to create a Comment node from string.\n */\n export const commentNode = (strings: TemplateStringsArray, ...values: any[]): Comment => {\n const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== undefined ? values[i] : ''), '');\n return document.createComment(raw);\n };\n\n /**\n * Generic element creator using a configuration object and attribute map.\n */\n export const createElement = <T extends HTMLElement>(info: CreateElementInfo, attrs: Record<string, any> = {}): T => {\n const el = document.createElement(info.tagName) as T;\n if (info.innerHtml !== undefined) el.innerHTML = info.innerHtml;\n Object.entries(attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));\n return el;\n };\n\n /**\n * Internal factory to create tagged template functions for specific HTML elements.\n */\n const createTagFunction = <T extends HTMLElement>(tagName: string) => {\n return (strings: TemplateStringsArray, ...values: any[]): T => {\n const el = document.createElement(tagName) as T;\n el.innerHTML = strings.reduce((acc, str, i) => acc + str + (values[i] !== undefined ? values[i] : ''), '');\n return el;\n };\n };\n\n // Specific Element Factories\n export const htmlDivElement = createTagFunction<HTMLDivElement>('div');\n export const htmlSpanElement = createTagFunction<HTMLSpanElement>('span');\n export const htmlButtonElement = createTagFunction<HTMLButtonElement>('button');\n export const htmlUlElement = createTagFunction<HTMLUListElement>('ul');\n export const htmlLiElement = createTagFunction<HTMLLIElement>('li');\n export const htmlInputElement = createTagFunction<HTMLInputElement>('input');\n export const htmlAElement = createTagFunction<HTMLAnchorElement>('a');\n export const htmlPElement = createTagFunction<HTMLParagraphElement>('p');\n export const htmlH1Element = createTagFunction<HTMLHeadingElement>('h1');\n export const htmlH2Element = createTagFunction<HTMLHeadingElement>('h2');\n export const htmlH3Element = createTagFunction<HTMLHeadingElement>('h3');\n export const htmlH4Element = createTagFunction<HTMLHeadingElement>('h4');\n export const htmlH5Element = createTagFunction<HTMLHeadingElement>('h5');\n export const htmlH6Element = createTagFunction<HTMLHeadingElement>('h6');\n export const htmlSectionElement = createTagFunction<HTMLElement>('section');\n export const htmlArticleElement = createTagFunction<HTMLElement>('article');\n}\n\nexport const htmlFragment = TemplateUtils.htmlFragment;\nexport const textNode = TemplateUtils.textNode;\nexport const commentNode = TemplateUtils.commentNode;\nexport const createElement = TemplateUtils.createElement;\nexport const htmlDivElement = TemplateUtils.htmlDivElement;\nexport const htmlSpanElement = TemplateUtils.htmlSpanElement;\nexport const htmlButtonElement = TemplateUtils.htmlButtonElement;\nexport const htmlUlElement = TemplateUtils.htmlUlElement;\nexport const htmlLiElement = TemplateUtils.htmlLiElement;\nexport const htmlInputElement = TemplateUtils.htmlInputElement;\nexport const htmlAElement = TemplateUtils.htmlAElement;\nexport const htmlPElement = TemplateUtils.htmlPElement;\nexport const htmlH1Element = TemplateUtils.htmlH1Element;\nexport const htmlH2Element = TemplateUtils.htmlH2Element;\nexport const htmlH3Element = TemplateUtils.htmlH3Element;\nexport const htmlH4Element = TemplateUtils.htmlH4Element;\nexport const htmlH5Element = TemplateUtils.htmlH5Element;\nexport const htmlH6Element = TemplateUtils.htmlH6Element;\nexport const htmlSectionElement = TemplateUtils.htmlSectionElement;\nexport const htmlArticleElement = TemplateUtils.htmlArticleElement;\n"],
|
|
5
|
-
"mappings": "AAKO,IAAU;AAAA,CAAV,CAAUA,mBAAV;AAIE,EAAMA,eAAA,eAAe,CAAC,YAAkC,WAAoC;AACjG,UAAM,MAAM,QAAQ,OAAO,CAAC,KAAK,KAAK,MAAM,MAAM,OAAO,OAAO,CAAC,MAAM,SAAY,OAAO,CAAC,IAAI,KAAK,EAAE;AACtG,UAAM,WAAW,SAAS,cAAc,UAAU;AAClD,aAAS,YAAY,IAAI,KAAK;AAC9B,WAAO,SAAS;AAAA,EAClB;AAKO,EAAMA,eAAA,WAAW,CAAC,YAAkC,WAAwB;AACjF,UAAM,MAAM,QAAQ,OAAO,CAAC,KAAK,KAAK,MAAM,MAAM,OAAO,OAAO,CAAC,MAAM,SAAY,OAAO,CAAC,IAAI,KAAK,EAAE;AACtG,WAAO,SAAS,eAAe,GAAG;AAAA,EACpC;AAKO,EAAMA,eAAA,cAAc,CAAC,YAAkC,WAA2B;AACvF,UAAM,MAAM,QAAQ,OAAO,CAAC,KAAK,KAAK,MAAM,MAAM,OAAO,OAAO,CAAC,MAAM,SAAY,OAAO,CAAC,IAAI,KAAK,EAAE;AACtG,WAAO,SAAS,cAAc,GAAG;AAAA,EACnC;AAKO,EAAMA,eAAA,gBAAgB,CAAwB,MAAyB,QAA6B,CAAC,MAAS;AACnH,UAAM,KAAK,SAAS,cAAc,KAAK,OAAO;AAC9C,QAAI,KAAK,cAAc,OAAW,IAAG,YAAY,KAAK;AACtD,WAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;AACvE,WAAO;AAAA,EACT;AAKA,QAAM,oBAAoB,CAAwB,YAAoB;AAC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gBAAgB,cAAc;AACpC,MAAM,gBAAgB,cAAc;AACpC,MAAM,gBAAgB,cAAc;AACpC,MAAM,gBAAgB,cAAc;AACpC,MAAM,gBAAgB,cAAc;AACpC,MAAM,gBAAgB,cAAc;AACpC,MAAM,qBAAqB,cAAc;AACzC,MAAM,qBAAqB,cAAc;",
|
|
6
|
-
"names": ["TemplateUtils"]
|
|
7
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { SwcQueryOptions } from '../types';
|
|
2
|
-
export declare const CLASS_LIST_METADATA_KEY: unique symbol;
|
|
3
|
-
export type ClassListAction = 'set' | 'update' | 'add' | 'remove' | 'toggle';
|
|
4
|
-
export interface ClassListMetadata {
|
|
5
|
-
propertyKey: string | symbol;
|
|
6
|
-
selector: string;
|
|
7
|
-
action: ClassListAction;
|
|
8
|
-
options: SwcQueryOptions;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @setClassList decorator to surgically replace all classes on a target element.
|
|
12
|
-
* Returns: string | string[]
|
|
13
|
-
*/
|
|
14
|
-
export declare const setClassList: (selector: string, options?: SwcQueryOptions) => MethodDecorator;
|
|
15
|
-
/**
|
|
16
|
-
* @updateClassList decorator to surgically update specific classes.
|
|
17
|
-
* Returns: Record<string, boolean> (toggle with force) | string | string[] (add)
|
|
18
|
-
*/
|
|
19
|
-
export declare const updateClassList: (selector: string, options?: SwcQueryOptions) => MethodDecorator;
|
|
20
|
-
/**
|
|
21
|
-
* @addClassList decorator to surgically add classes to a target element.
|
|
22
|
-
* Returns: string | string[]
|
|
23
|
-
*/
|
|
24
|
-
export declare const addClassList: (selector: string, options?: SwcQueryOptions) => MethodDecorator;
|
|
25
|
-
/**
|
|
26
|
-
* @removeClassList decorator to surgically remove classes from a target element.
|
|
27
|
-
* Returns: string | string[]
|
|
28
|
-
*/
|
|
29
|
-
export declare const removeClassList: (selector: string, options?: SwcQueryOptions) => MethodDecorator;
|
|
30
|
-
/**
|
|
31
|
-
* @toggleClassList decorator to surgically toggle classes on a target element.
|
|
32
|
-
* Returns: string | string[]
|
|
33
|
-
*/
|
|
34
|
-
export declare const toggleClassList: (selector: string, options?: SwcQueryOptions) => MethodDecorator;
|
|
35
|
-
/**
|
|
36
|
-
* @setClassListHost decorator to set classes on :host element.
|
|
37
|
-
* Returns: string | string[]
|
|
38
|
-
*/
|
|
39
|
-
export declare const setClassListHost: (options?: SwcQueryOptions) => MethodDecorator;
|
|
40
|
-
/**
|
|
41
|
-
* @updateClassListHost decorator to update specific classes on :host.
|
|
42
|
-
* Returns: Record<string, boolean> (toggle with force) | string | string[] (add)
|
|
43
|
-
*/
|
|
44
|
-
export declare const updateClassListHost: (options?: SwcQueryOptions) => MethodDecorator;
|
|
45
|
-
/**
|
|
46
|
-
* @addClassListHost decorator to add classes to :host element.
|
|
47
|
-
* Returns: string | string[]
|
|
48
|
-
*/
|
|
49
|
-
export declare const addClassListHost: (options?: SwcQueryOptions) => MethodDecorator;
|
|
50
|
-
/**
|
|
51
|
-
* @removeClassListHost decorator to remove classes from :host element.
|
|
52
|
-
* Returns: string | string[]
|
|
53
|
-
*/
|
|
54
|
-
export declare const removeClassListHost: (options?: SwcQueryOptions) => MethodDecorator;
|
|
55
|
-
/**
|
|
56
|
-
* @toggleClassListHost decorator to toggle classes on :host element.
|
|
57
|
-
* Returns: string | string[]
|
|
58
|
-
*/
|
|
59
|
-
export declare const toggleClassListHost: (options?: SwcQueryOptions) => MethodDecorator;
|
|
60
|
-
export declare const findAllClassListMetadata: (target: any) => Map<string | symbol, ClassListMetadata>;
|
|
61
|
-
//# sourceMappingURL=classList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"classList.d.ts","sourceRoot":"","sources":["../../../src/decorators/classList.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,uBAAuB,eAA4C,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG,KAAK,GA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export interface SetAttributeMetadata {
|
|
3
|
-
propertyKey: string | symbol;
|
|
4
|
-
selector: string;
|
|
5
|
-
name: string;
|
|
6
|
-
options: SwcQueryOptions;
|
|
7
|
-
}
|
|
8
|
-
export declare const SET_ATTRIBUTE_METADATA_KEY: unique symbol;
|
|
9
|
-
/**
|
|
10
|
-
* @setAttribute decorator to surgically update an attribute of a target element.
|
|
11
|
-
* Usage: @setAttribute(':host', 'count')
|
|
12
|
-
* Usage: @setAttribute('#child', 'disabled')
|
|
13
|
-
*/
|
|
14
|
-
export declare function setAttribute(selector: string, name: string): MethodDecorator;
|
|
15
|
-
export declare function setAttribute(selector: string, name: string, options?: SwcQueryOptions): MethodDecorator;
|
|
16
|
-
export declare const getSetAttributeMetadata: (target: any) => Map<string | symbol, SetAttributeMetadata> | undefined;
|
|
17
|
-
export declare const findAllSetAttributeMetadata: (target: any) => Map<string | symbol, SetAttributeMetadata>;
|
|
18
|
-
/**
|
|
19
|
-
* @setAttributeHost decorator - simplified version of @setAttribute for :host selector
|
|
20
|
-
* Usage: @setAttributeHost('aria-disabled')
|
|
21
|
-
*/
|
|
22
|
-
export declare function setAttributeHost(name: string, options?: SwcQueryOptions): MethodDecorator;
|
|
23
|
-
//# sourceMappingURL=setAttribute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setAttribute.d.ts","sourceRoot":"","sources":["../../../src/decorators/setAttribute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,0BAA0B,eAA+C,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;AAC9E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,eAAe,CAAC;AAsEzG,eAAO,MAAM,uBAAuB,GAAI,QAAQ,GAAG,KAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,oBAAoB,CAAC,GAAG,SAGlG,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,QAAQ,GAAG,KAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,oBAAoB,CASlG,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,eAAe,CAEzF"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { SwcQueryOptions } from '../types';
|
|
2
|
-
export type StyleAction = 'set' | 'update' | 'remove';
|
|
3
|
-
export interface StyleOptions extends SwcQueryOptions {
|
|
4
|
-
}
|
|
5
|
-
export interface StyleMetadata {
|
|
6
|
-
propertyKey: string | symbol;
|
|
7
|
-
selector: string;
|
|
8
|
-
action: StyleAction;
|
|
9
|
-
options: StyleOptions;
|
|
10
|
-
}
|
|
11
|
-
export declare const STYLE_METADATA_KEY: unique symbol;
|
|
12
|
-
/**
|
|
13
|
-
* @setStyle decorator to surgically set styles on a target element (replaces all existing styles).
|
|
14
|
-
* Usage: @setStyle('#box') getStyles() { return { color: 'red', display: 'block' }; }
|
|
15
|
-
* Usage: @setStyle('#box', { root: 'shadow' }) getStyles() { return { color: 'red' }; }
|
|
16
|
-
*/
|
|
17
|
-
export declare const setStyle: (selector: string, options?: StyleOptions) => MethodDecorator;
|
|
18
|
-
/**
|
|
19
|
-
* @setStyleHost decorator - simplified version of @setStyle for :host selector.
|
|
20
|
-
* Usage: @setStyleHost getStyles() { return { color: 'red', display: 'block' }; }
|
|
21
|
-
* Usage: @setStyleHost({ root: 'shadow' }) getStyles() { return { color: 'red' }; }
|
|
22
|
-
*/
|
|
23
|
-
export declare const setStyleHost: (options?: StyleOptions) => MethodDecorator;
|
|
24
|
-
/**
|
|
25
|
-
* @updateStyle decorator to surgically update styles on a target element (merges with existing styles).
|
|
26
|
-
* Usage: @updateStyle('#box') updateStyles() { return { color: 'blue' }; }
|
|
27
|
-
* Usage: @updateStyle('#box', { root: 'shadow' }) updateStyles() { return { color: 'blue' }; }
|
|
28
|
-
*/
|
|
29
|
-
export declare const updateStyle: (selector: string, options?: StyleOptions) => MethodDecorator;
|
|
30
|
-
/**
|
|
31
|
-
* @updateStyleHost decorator - simplified version of @updateStyle for :host selector.
|
|
32
|
-
* Usage: @updateStyleHost updateStyles() { return { color: 'blue' }; }
|
|
33
|
-
* Usage: @updateStyleHost({ root: 'shadow' }) updateStyles() { return { color: 'blue' }; }
|
|
34
|
-
*/
|
|
35
|
-
export declare const updateStyleHost: (options?: StyleOptions) => MethodDecorator;
|
|
36
|
-
/**
|
|
37
|
-
* @removeStyle decorator to surgically remove styles from a target element.
|
|
38
|
-
* Usage: @removeStyle('#box') clearStyles() { return ['color', 'display']; }
|
|
39
|
-
* Usage: @removeStyle('#box', { root: 'shadow' }) clearStyles() { return ['color']; }
|
|
40
|
-
*/
|
|
41
|
-
export declare const removeStyle: (selector: string, options?: StyleOptions) => MethodDecorator;
|
|
42
|
-
/**
|
|
43
|
-
* @removeStyleHost decorator - simplified version of @removeStyle for :host selector.
|
|
44
|
-
* Usage: @removeStyleHost clearStyles() { return ['color', 'display']; }
|
|
45
|
-
* Usage: @removeStyleHost({ root: 'shadow' }) clearStyles() { return ['color']; }
|
|
46
|
-
*/
|
|
47
|
-
export declare const removeStyleHost: (options?: StyleOptions) => MethodDecorator;
|
|
48
|
-
export declare const findAllStyleMetadata: (target: any) => Map<string | symbol, StyleMetadata>;
|
|
49
|
-
//# sourceMappingURL=style.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/decorators/style.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,YAAa,SAAQ,eAAe;CACpD;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,eAAuC,CAAC;AAuEvE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,EAAE,UAAS,YAAiB,oBAAmD,CAAC;AAEzH;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,UAAS,YAAiB,oBAAkD,CAAC;AAE1G;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,UAAS,YAAiB,oBAAsD,CAAC;AAE/H;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,UAAS,YAAiB,oBAAqD,CAAC;AAEhH;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,UAAS,YAAiB,oBAAsD,CAAC;AAE/H;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,UAAS,YAAiB,oBAAqD,CAAC;AAEhH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,GAAG,KAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,aAAa,CASpF,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export interface CreateElementInfo {
|
|
2
|
-
tagName: string;
|
|
3
|
-
innerHtml?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare namespace TemplateUtils {
|
|
6
|
-
/**
|
|
7
|
-
* Tagged template function to create a DocumentFragment from HTML string.
|
|
8
|
-
*/
|
|
9
|
-
const htmlFragment: (strings: TemplateStringsArray, ...values: any[]) => DocumentFragment;
|
|
10
|
-
/**
|
|
11
|
-
* Tagged template function to create a Text node from string.
|
|
12
|
-
*/
|
|
13
|
-
const textNode: (strings: TemplateStringsArray, ...values: any[]) => Text;
|
|
14
|
-
/**
|
|
15
|
-
* Tagged template function to create a Comment node from string.
|
|
16
|
-
*/
|
|
17
|
-
const commentNode: (strings: TemplateStringsArray, ...values: any[]) => Comment;
|
|
18
|
-
/**
|
|
19
|
-
* Generic element creator using a configuration object and attribute map.
|
|
20
|
-
*/
|
|
21
|
-
const createElement: <T extends HTMLElement>(info: CreateElementInfo, attrs?: Record<string, any>) => T;
|
|
22
|
-
const htmlDivElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLDivElement;
|
|
23
|
-
const htmlSpanElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLSpanElement;
|
|
24
|
-
const htmlButtonElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLButtonElement;
|
|
25
|
-
const htmlUlElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLUListElement;
|
|
26
|
-
const htmlLiElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLLIElement;
|
|
27
|
-
const htmlInputElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLInputElement;
|
|
28
|
-
const htmlAElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLAnchorElement;
|
|
29
|
-
const htmlPElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLParagraphElement;
|
|
30
|
-
const htmlH1Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
31
|
-
const htmlH2Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
32
|
-
const htmlH3Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
33
|
-
const htmlH4Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
34
|
-
const htmlH5Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
35
|
-
const htmlH6Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
36
|
-
const htmlSectionElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLElement;
|
|
37
|
-
const htmlArticleElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLElement;
|
|
38
|
-
}
|
|
39
|
-
export declare const htmlFragment: (strings: TemplateStringsArray, ...values: any[]) => DocumentFragment;
|
|
40
|
-
export declare const textNode: (strings: TemplateStringsArray, ...values: any[]) => Text;
|
|
41
|
-
export declare const commentNode: (strings: TemplateStringsArray, ...values: any[]) => Comment;
|
|
42
|
-
export declare const createElement: <T extends HTMLElement>(info: CreateElementInfo, attrs?: Record<string, any>) => T;
|
|
43
|
-
export declare const htmlDivElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLDivElement;
|
|
44
|
-
export declare const htmlSpanElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLSpanElement;
|
|
45
|
-
export declare const htmlButtonElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLButtonElement;
|
|
46
|
-
export declare const htmlUlElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLUListElement;
|
|
47
|
-
export declare const htmlLiElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLLIElement;
|
|
48
|
-
export declare const htmlInputElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLInputElement;
|
|
49
|
-
export declare const htmlAElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLAnchorElement;
|
|
50
|
-
export declare const htmlPElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLParagraphElement;
|
|
51
|
-
export declare const htmlH1Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
52
|
-
export declare const htmlH2Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
53
|
-
export declare const htmlH3Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
54
|
-
export declare const htmlH4Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
55
|
-
export declare const htmlH5Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
56
|
-
export declare const htmlH6Element: (strings: TemplateStringsArray, ...values: any[]) => HTMLHeadingElement;
|
|
57
|
-
export declare const htmlSectionElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLElement;
|
|
58
|
-
export declare const htmlArticleElement: (strings: TemplateStringsArray, ...values: any[]) => HTMLElement;
|
|
59
|
-
//# sourceMappingURL=TemplateUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TemplateUtils.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yBAAiB,aAAa,CAAC;IAC7B;;OAEG;IACI,MAAM,YAAY,GAAI,SAAS,oBAAoB,EAAE,GAAG,QAAQ,GAAG,EAAE,KAAG,gBAK9E,CAAC;IAEF;;OAEG;IACI,MAAM,QAAQ,GAAI,SAAS,oBAAoB,EAAE,GAAG,QAAQ,GAAG,EAAE,KAAG,IAG1E,CAAC;IAEF;;OAEG;IACI,MAAM,WAAW,GAAI,SAAS,oBAAoB,EAAE,GAAG,QAAQ,GAAG,EAAE,KAAG,OAG7E,CAAC;IAEF;;OAEG;IACI,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,EAAE,MAAM,iBAAiB,EAAE,QAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,KAAG,CAK/G,CAAC;IAcK,MAAM,cAAc,YARR,oBAAoB,aAAa,GAAG,EAAE,mBAQa,CAAC;IAChE,MAAM,eAAe,YATT,oBAAoB,aAAa,GAAG,EAAE,oBASgB,CAAC;IACnE,MAAM,iBAAiB,YAVX,oBAAoB,aAAa,GAAG,EA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