@dooboostore/simple-web-component 1.0.54 → 1.0.55
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 +308 -56
- package/dist/cjs/decorators/addEventListener.js +37 -14
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +6 -3
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +18 -2
- package/dist/cjs/decorators/applyClass.js.map +2 -2
- package/dist/cjs/decorators/applyNode.js +10 -3
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/changedAttribute.js +2 -5
- package/dist/cjs/decorators/changedAttribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +13 -2
- package/dist/cjs/decorators/elementDefine.js.map +2 -2
- package/dist/cjs/decorators/eventMedia.js +2 -5
- package/dist/cjs/decorators/eventMedia.js.map +2 -2
- package/dist/cjs/decorators/fetch.js +216 -82
- package/dist/cjs/decorators/fetch.js.map +3 -3
- package/dist/cjs/decorators/index.js +1 -0
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/intersectionObserver.js +3 -6
- package/dist/cjs/decorators/intersectionObserver.js.map +2 -2
- package/dist/cjs/decorators/mutationObserver.js +3 -6
- package/dist/cjs/decorators/mutationObserver.js.map +2 -2
- package/dist/cjs/decorators/parameter.js +197 -33
- package/dist/cjs/decorators/parameter.js.map +3 -3
- package/dist/cjs/decorators/persistState.js +474 -0
- package/dist/cjs/decorators/persistState.js.map +7 -0
- package/dist/cjs/decorators/resizeObserver.js +3 -6
- package/dist/cjs/decorators/resizeObserver.js.map +2 -2
- package/dist/cjs/decorators/setInterval.js +2 -5
- package/dist/cjs/decorators/setInterval.js.map +2 -2
- package/dist/cjs/decorators/setTimeout.js +2 -5
- package/dist/cjs/decorators/setTimeout.js.map +2 -2
- package/dist/cjs/decorators/subscribeSwcAppMessage.js.map +1 -1
- package/dist/cjs/elements/SwcAppMixin.js +50 -2
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +38 -15
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +6 -3
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +18 -2
- package/dist/esm/decorators/applyClass.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +10 -3
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/changedAttribute.js +3 -6
- package/dist/esm/decorators/changedAttribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +15 -4
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/eventMedia.js +3 -6
- package/dist/esm/decorators/eventMedia.js.map +2 -2
- package/dist/esm/decorators/fetch.js +216 -82
- package/dist/esm/decorators/fetch.js.map +3 -3
- package/dist/esm/decorators/index.js +1 -0
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/intersectionObserver.js +4 -7
- package/dist/esm/decorators/intersectionObserver.js.map +2 -2
- package/dist/esm/decorators/mutationObserver.js +4 -7
- package/dist/esm/decorators/mutationObserver.js.map +2 -2
- package/dist/esm/decorators/parameter.js +197 -33
- package/dist/esm/decorators/parameter.js.map +3 -3
- package/dist/esm/decorators/persistState.js +455 -0
- package/dist/esm/decorators/persistState.js.map +7 -0
- package/dist/esm/decorators/resizeObserver.js +4 -7
- package/dist/esm/decorators/resizeObserver.js.map +2 -2
- package/dist/esm/decorators/setInterval.js +3 -6
- package/dist/esm/decorators/setInterval.js.map +2 -2
- package/dist/esm/decorators/setTimeout.js +3 -6
- package/dist/esm/decorators/setTimeout.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppMessage.js.map +1 -1
- package/dist/esm/elements/SwcAppMixin.js +51 -3
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +3226 -2391
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/addEventListener.d.ts +15 -0
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +1 -0
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +4 -2
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/eventMedia.d.ts.map +1 -1
- package/dist/types/decorators/fetch.d.ts +52 -31
- package/dist/types/decorators/fetch.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +1 -0
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/intersectionObserver.d.ts.map +1 -1
- package/dist/types/decorators/mutationObserver.d.ts.map +1 -1
- package/dist/types/decorators/parameter.d.ts +169 -31
- package/dist/types/decorators/parameter.d.ts.map +1 -1
- package/dist/types/decorators/persistState.d.ts +66 -0
- package/dist/types/decorators/persistState.d.ts.map +1 -0
- package/dist/types/decorators/resizeObserver.d.ts.map +1 -1
- package/dist/types/decorators/setInterval.d.ts.map +1 -1
- package/dist/types/decorators/setTimeout.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppMessage.d.ts +1 -1
- package/dist/types/decorators/subscribeSwcAppMessage.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +12 -0
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +3226 -2391
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/decorators/addEventListener.ts +23 -15
- package/src/decorators/applyAttribute.ts +8 -3
- package/src/decorators/applyClass.ts +22 -2
- package/src/decorators/applyNode.ts +18 -6
- package/src/decorators/changedAttribute.ts +3 -4
- package/src/decorators/elementDefine.ts +19 -7
- package/src/decorators/eventMedia.ts +3 -6
- package/src/decorators/fetch.ts +270 -140
- package/src/decorators/index.ts +1 -0
- package/src/decorators/intersectionObserver.ts +4 -5
- package/src/decorators/mutationObserver.ts +4 -5
- package/src/decorators/parameter.ts +326 -42
- package/src/decorators/persistState.ts +408 -0
- package/src/decorators/resizeObserver.ts +4 -5
- package/src/decorators/setInterval.ts +3 -4
- package/src/decorators/setTimeout.ts +3 -4
- package/src/decorators/subscribeSwcAppMessage.ts +1 -1
- package/src/elements/SwcAppMixin.ts +64 -5
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { ReflectUtils } from "@dooboostore/core";
|
|
2
|
+
import { SwcUtils } from "../utils/Utils.js";
|
|
3
|
+
import { resolveQueryElements, pickElements } from "./query.js";
|
|
4
|
+
import { getAttributeValue } from "./applyAttribute.js";
|
|
5
|
+
import { persistRead, persistReadAsync } from "./persistState.js";
|
|
2
6
|
const SWC_PARAMETER_METADATA_KEY = Symbol.for("simple-web-component:parameter");
|
|
3
7
|
const registerParam = (kind, target, propertyKey, parameterIndex, key) => {
|
|
4
|
-
if (!propertyKey)
|
|
8
|
+
if (!propertyKey)
|
|
9
|
+
return;
|
|
5
10
|
const constructor = target.constructor;
|
|
6
11
|
const saves = ReflectUtils.getOwnMetadata(SWC_PARAMETER_METADATA_KEY, constructor, propertyKey) ?? [];
|
|
7
12
|
saves.push(key === void 0 ? { index: parameterIndex, kind } : { index: parameterIndex, kind, key });
|
|
@@ -25,14 +30,43 @@ function helperSet(target, propertyKey, parameterIndex) {
|
|
|
25
30
|
function swcAppRouterEvent(target, propertyKey, parameterIndex) {
|
|
26
31
|
registerParam("swcAppRouterEvent", target, propertyKey, parameterIndex);
|
|
27
32
|
}
|
|
28
|
-
function
|
|
29
|
-
registerParam("
|
|
33
|
+
function swcAppRouter(target, propertyKey, parameterIndex) {
|
|
34
|
+
registerParam("swcAppRouter", target, propertyKey, parameterIndex);
|
|
35
|
+
}
|
|
36
|
+
function swcAppSimpleApplication(target, propertyKey, parameterIndex) {
|
|
37
|
+
registerParam("swcAppSimpleApplication", target, propertyKey, parameterIndex);
|
|
38
|
+
}
|
|
39
|
+
function swcAppHost(target, propertyKey, parameterIndex) {
|
|
40
|
+
registerParam("swcAppHost", target, propertyKey, parameterIndex);
|
|
41
|
+
}
|
|
42
|
+
const SWC_MESSAGE_FIELD_METADATA_KEY = Symbol.for("simple-web-component:message-field");
|
|
43
|
+
const applySwcAppMessage = (target, propertyKey, parameterIndex, options) => {
|
|
44
|
+
if (typeof parameterIndex === "number")
|
|
45
|
+
return registerParam("swcAppMessage", target, propertyKey, parameterIndex);
|
|
46
|
+
if (propertyKey === void 0)
|
|
47
|
+
return;
|
|
48
|
+
const constructor = target.constructor;
|
|
49
|
+
const list = ReflectUtils.getOwnMetadata(SWC_MESSAGE_FIELD_METADATA_KEY, constructor) ?? [];
|
|
50
|
+
list.push({ propertyKey, ...options?.messageType ? { messageType: options.messageType } : {}, ...options?.subject ? { subject: options.subject } : {} });
|
|
51
|
+
ReflectUtils.defineMetadata(SWC_MESSAGE_FIELD_METADATA_KEY, list, constructor);
|
|
52
|
+
};
|
|
53
|
+
const getSwcAppMessageFieldMetadata = (target) => {
|
|
54
|
+
const constructor = target instanceof Function ? target : target?.constructor;
|
|
55
|
+
if (!constructor)
|
|
56
|
+
return [];
|
|
57
|
+
return (ReflectUtils.findAllMetadata(SWC_MESSAGE_FIELD_METADATA_KEY, constructor) || []).flat();
|
|
58
|
+
};
|
|
59
|
+
function swcAppMessage(a, b, c) {
|
|
60
|
+
if (typeof b === "string" || typeof b === "symbol")
|
|
61
|
+
return applySwcAppMessage(a, b, c);
|
|
62
|
+
const options = typeof a === "string" ? { ...b ?? {}, messageType: a } : { ...a ?? {} };
|
|
63
|
+
return (target, propertyKey, parameterIndex) => applySwcAppMessage(target, propertyKey, parameterIndex, options);
|
|
30
64
|
}
|
|
31
65
|
function eventBeforeReturn(target, propertyKey, parameterIndex) {
|
|
32
66
|
registerParam("eventBeforeReturn", target, propertyKey, parameterIndex);
|
|
33
67
|
}
|
|
34
|
-
function
|
|
35
|
-
registerParam("
|
|
68
|
+
function swcAppMessageBeforeReturn(target, propertyKey, parameterIndex) {
|
|
69
|
+
registerParam("swcAppMessageBeforeReturn", target, propertyKey, parameterIndex);
|
|
36
70
|
}
|
|
37
71
|
function routeChangeBeforeReturn(target, propertyKey, parameterIndex) {
|
|
38
72
|
registerParam("routeChangeBeforeReturn", target, propertyKey, parameterIndex);
|
|
@@ -58,8 +92,47 @@ function setTimeoutBeforeReturn(target, propertyKey, parameterIndex) {
|
|
|
58
92
|
function setIntervalBeforeReturn(target, propertyKey, parameterIndex) {
|
|
59
93
|
registerParam("setIntervalBeforeReturn", target, propertyKey, parameterIndex);
|
|
60
94
|
}
|
|
61
|
-
function
|
|
62
|
-
registerParam("
|
|
95
|
+
function fetchPromise(target, propertyKey, parameterIndex) {
|
|
96
|
+
registerParam("fetchPromise", target, propertyKey, parameterIndex);
|
|
97
|
+
}
|
|
98
|
+
function querySelectorParam(selector, options) {
|
|
99
|
+
return (target, propertyKey, parameterIndex) => registerParam("querySelectorParam", target, propertyKey, parameterIndex, { selector, options });
|
|
100
|
+
}
|
|
101
|
+
function querySelectorAllParam(selector, options) {
|
|
102
|
+
return (target, propertyKey, parameterIndex) => registerParam("querySelectorAllParam", target, propertyKey, parameterIndex, { selector, options });
|
|
103
|
+
}
|
|
104
|
+
function querySelectorShadowParam(selector, options) {
|
|
105
|
+
return querySelectorParam(selector, { ...options ?? {}, root: "shadow" });
|
|
106
|
+
}
|
|
107
|
+
function querySelectorLightParam(selector, options) {
|
|
108
|
+
return querySelectorParam(selector, { ...options ?? {}, root: "light" });
|
|
109
|
+
}
|
|
110
|
+
function querySelectorAllRootsParam(selector, options) {
|
|
111
|
+
return querySelectorParam(selector, { ...options ?? {}, root: "all" });
|
|
112
|
+
}
|
|
113
|
+
function querySelectorAllShadowParam(selector, options) {
|
|
114
|
+
return querySelectorAllParam(selector, { ...options ?? {}, root: "shadow" });
|
|
115
|
+
}
|
|
116
|
+
function querySelectorAllLightParam(selector, options) {
|
|
117
|
+
return querySelectorAllParam(selector, { ...options ?? {}, root: "light" });
|
|
118
|
+
}
|
|
119
|
+
function querySelectorAllAllParam(selector, options) {
|
|
120
|
+
return querySelectorAllParam(selector, { ...options ?? {}, root: "all" });
|
|
121
|
+
}
|
|
122
|
+
function attributeParam(selectorOrName, attrNameOrOptions, maybeOptions) {
|
|
123
|
+
const withSelector = typeof attrNameOrOptions === "string";
|
|
124
|
+
const attributeName = withSelector ? attrNameOrOptions : selectorOrName;
|
|
125
|
+
const options = (withSelector ? maybeOptions : attrNameOrOptions) ?? {};
|
|
126
|
+
const resolved = withSelector ? { ...options, selector: selectorOrName } : options;
|
|
127
|
+
return (target, propertyKey, parameterIndex) => registerParam("attributeParam", target, propertyKey, parameterIndex, { attributeName, options: resolved });
|
|
128
|
+
}
|
|
129
|
+
const keyedStorageParam = (kind) => (key, options) => (target, propertyKey, parameterIndex) => registerParam(kind, target, propertyKey, parameterIndex, { key, options });
|
|
130
|
+
const localStorageParam = keyedStorageParam("localStorageParam");
|
|
131
|
+
const sessionStorageParam = keyedStorageParam("sessionStorageParam");
|
|
132
|
+
const cookieParam = keyedStorageParam("cookieParam");
|
|
133
|
+
const indexedDbParam = keyedStorageParam("indexedDbParam");
|
|
134
|
+
function fetchParam(input, init) {
|
|
135
|
+
return (target, propertyKey, parameterIndex) => registerParam("fetchParam", target, propertyKey, parameterIndex, { input, init });
|
|
63
136
|
}
|
|
64
137
|
const getParameterMetadata = (target, propertyKey) => {
|
|
65
138
|
const constructor = typeof target === "function" ? target : target.constructor;
|
|
@@ -67,54 +140,143 @@ const getParameterMetadata = (target, propertyKey) => {
|
|
|
67
140
|
};
|
|
68
141
|
const buildSwcParameterArgs = (target, propertyKey, kindValues, legacyArgs) => {
|
|
69
142
|
const saves = getParameterMetadata(target, propertyKey);
|
|
70
|
-
if (saves.length === 0)
|
|
71
|
-
|
|
72
|
-
const
|
|
143
|
+
if (saves.length === 0)
|
|
144
|
+
return legacyArgs;
|
|
145
|
+
const maxIndex = Math.max(Math.max(...saves.map((s) => s.index)), legacyArgs.length - 1);
|
|
146
|
+
const args = legacyArgs.slice(0, maxIndex + 1);
|
|
73
147
|
for (const s of saves) {
|
|
74
148
|
const value = kindValues[s.kind];
|
|
75
149
|
args[s.index] = s.key !== void 0 && typeof value === "function" ? value(s.key) : value;
|
|
76
150
|
}
|
|
77
151
|
return args;
|
|
78
152
|
};
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
153
|
+
const simpleFetchJsonOrText = async (win, input, init) => {
|
|
154
|
+
const fetchFn = typeof win?.fetch === "function" ? win.fetch.bind(win) : fetch;
|
|
155
|
+
const res = await fetchFn(input, init);
|
|
156
|
+
if (!res.ok)
|
|
157
|
+
throw new Error(`[SWC] @fetchParam failed: ${res.status} ${String(input)}`);
|
|
158
|
+
const text = await res.text();
|
|
159
|
+
if (!text)
|
|
160
|
+
return void 0;
|
|
161
|
+
return (res.headers.get("Content-Type") ?? "").includes("json") ? JSON.parse(text) : text;
|
|
162
|
+
};
|
|
163
|
+
const buildDomStorageKindValues = (inst, win) => ({
|
|
164
|
+
querySelectorParam: (cfg) => pickElements(resolveQueryElements(inst, cfg.selector, cfg.options ?? {}, win), cfg.options?.pick ?? "first"),
|
|
165
|
+
querySelectorAllParam: (cfg) => pickElements(resolveQueryElements(inst, cfg.selector, cfg.options ?? {}, win), "all"),
|
|
166
|
+
attributeParam: (cfg) => getAttributeValue(inst, cfg.attributeName, cfg.options),
|
|
167
|
+
localStorageParam: (cfg) => persistRead(inst, cfg.key, { ...cfg.options, storage: "local" }),
|
|
168
|
+
sessionStorageParam: (cfg) => persistRead(inst, cfg.key, { ...cfg.options, storage: "session" }),
|
|
169
|
+
cookieParam: (cfg) => persistRead(inst, cfg.key, { ...cfg.options, storage: "cookie" }),
|
|
170
|
+
indexedDbParam: (cfg) => persistReadAsync(inst, cfg.key, { ...cfg.options, storage: "indexeddb" }),
|
|
171
|
+
fetchParam: (cfg) => {
|
|
172
|
+
const helper = SwcUtils.getHelperAndHostSet(inst, win);
|
|
173
|
+
const resolvedInput = typeof cfg.input === "function" ? cfg.input(inst, helper) : cfg.input;
|
|
174
|
+
const resolvedInit = typeof cfg.init === "function" ? cfg.init(inst, helper) : cfg.init;
|
|
175
|
+
return simpleFetchJsonOrText(win, resolvedInput, resolvedInit);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
const buildCommonKindValues = (inst, win) => {
|
|
179
|
+
const hostSet2 = SwcUtils.getHostSet(inst);
|
|
180
|
+
const helperSet2 = SwcUtils.getHelperSet(win);
|
|
181
|
+
const helperHostSet2 = { ...helperSet2, ...hostSet2, $this: inst };
|
|
182
|
+
return {
|
|
183
|
+
hostSet: hostSet2,
|
|
184
|
+
helperSet: helperSet2,
|
|
185
|
+
helperHostSet: helperHostSet2,
|
|
186
|
+
swcAppRouter: hostSet2.$appHost?.router,
|
|
187
|
+
swcAppSimpleApplication: hostSet2.$appHost?.simpleApplication,
|
|
188
|
+
swcAppHost: hostSet2.$appHost,
|
|
189
|
+
...buildDomStorageKindValues(inst, win)
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
const SWC_ROUTE_FIELD_METADATA_KEY = Symbol.for("simple-web-component:route-field");
|
|
193
|
+
const isPathKind = (kind) => kind.includes("PathVariable");
|
|
194
|
+
const registerRouteField = (kind, target, propertyKey, key, options) => {
|
|
195
|
+
if (isPathKind(kind) && !options?.path) {
|
|
196
|
+
console.warn(`[SWC] @${kind} on field "${String(propertyKey)}" needs { path } (e.g. { path: '/user/{id}' }) \u2014 it will stay empty without it.`);
|
|
197
|
+
}
|
|
198
|
+
const constructor = target.constructor;
|
|
199
|
+
const list = ReflectUtils.getOwnMetadata(SWC_ROUTE_FIELD_METADATA_KEY, constructor) ?? [];
|
|
200
|
+
list.push({ propertyKey, kind, ...key !== void 0 ? { key } : {}, ...options?.path ? { path: options.path } : {} });
|
|
201
|
+
ReflectUtils.defineMetadata(SWC_ROUTE_FIELD_METADATA_KEY, list, constructor);
|
|
202
|
+
};
|
|
203
|
+
const getSwcRouteFieldMetadata = (target) => {
|
|
204
|
+
const constructor = target instanceof Function ? target : target?.constructor;
|
|
205
|
+
if (!constructor)
|
|
206
|
+
return [];
|
|
207
|
+
return (ReflectUtils.findAllMetadata(SWC_ROUTE_FIELD_METADATA_KEY, constructor) || []).flat();
|
|
208
|
+
};
|
|
209
|
+
const applyRouteParam = (kind, target, propertyKey, parameterIndex, key, options) => {
|
|
210
|
+
if (typeof parameterIndex === "number")
|
|
211
|
+
return registerParam(kind, target, propertyKey, parameterIndex, key);
|
|
212
|
+
if (propertyKey !== void 0)
|
|
213
|
+
registerRouteField(kind, target, propertyKey, key, options);
|
|
214
|
+
};
|
|
215
|
+
const keyedQueryParam = (kind) => (key) => (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex, key);
|
|
216
|
+
const keyedPathParam = (kind) => (key, options) => (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex, key, options);
|
|
217
|
+
const queryParam = (kind) => (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex);
|
|
218
|
+
const pathParam = (kind) => function(...args) {
|
|
219
|
+
if (args.length >= 2)
|
|
220
|
+
return applyRouteParam(kind, args[0], args[1], args[2]);
|
|
221
|
+
const options = args[0];
|
|
222
|
+
return (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex, void 0, options);
|
|
223
|
+
};
|
|
224
|
+
const swcAppRouteQueryParam = keyedQueryParam("swcAppRouteQueryParam");
|
|
225
|
+
const swcAppRouteFirstQueryParam = keyedQueryParam("swcAppRouteFirstQueryParam");
|
|
226
|
+
const swcAppRouteLastQueryParam = keyedQueryParam("swcAppRouteLastQueryParam");
|
|
227
|
+
const swcAppRouteQueryParams = keyedQueryParam("swcAppRouteQueryParams");
|
|
228
|
+
const swcAppRouteQueryParamObject = queryParam("swcAppRouteQueryParamObject");
|
|
229
|
+
const swcAppRouteFirstQueryParamObject = queryParam("swcAppRouteFirstQueryParamObject");
|
|
230
|
+
const swcAppRouteLastQueryParamObject = queryParam("swcAppRouteLastQueryParamObject");
|
|
231
|
+
const swcAppRouteQueryParamsObject = queryParam("swcAppRouteQueryParamsObject");
|
|
232
|
+
const swcAppRouteURLSearchParams = queryParam("swcAppRouteURLSearchParams");
|
|
233
|
+
const swcAppRoutePathVariable = keyedPathParam("swcAppRoutePathVariable");
|
|
234
|
+
const swcAppRouteFirstPathVariable = keyedPathParam("swcAppRouteFirstPathVariable");
|
|
235
|
+
const swcAppRouteLastPathVariable = keyedPathParam("swcAppRouteLastPathVariable");
|
|
236
|
+
const swcAppRoutePathVariables = keyedPathParam("swcAppRoutePathVariables");
|
|
237
|
+
const swcAppRoutePathVariableObject = pathParam("swcAppRoutePathVariableObject");
|
|
238
|
+
const swcAppRouteFirstPathVariableObject = pathParam("swcAppRouteFirstPathVariableObject");
|
|
239
|
+
const swcAppRouteLastPathVariableObject = pathParam("swcAppRouteLastPathVariableObject");
|
|
240
|
+
const swcAppRoutePathVariablesObject = pathParam("swcAppRoutePathVariablesObject");
|
|
98
241
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
242
|
+
attributeParam,
|
|
243
|
+
buildCommonKindValues,
|
|
244
|
+
buildDomStorageKindValues,
|
|
101
245
|
buildSwcParameterArgs,
|
|
102
246
|
changedAttributeBeforeReturn,
|
|
247
|
+
cookieParam,
|
|
103
248
|
eventBeforeReturn,
|
|
104
249
|
eventMediaBeforeReturn,
|
|
105
250
|
eventObject,
|
|
106
|
-
|
|
251
|
+
fetchParam,
|
|
252
|
+
fetchPromise,
|
|
107
253
|
getParameterMetadata,
|
|
254
|
+
getSwcAppMessageFieldMetadata,
|
|
255
|
+
getSwcRouteFieldMetadata,
|
|
108
256
|
helperHostSet,
|
|
109
257
|
helperSet,
|
|
110
258
|
hostSet,
|
|
259
|
+
indexedDbParam,
|
|
111
260
|
intersectionObserverBeforeReturn,
|
|
261
|
+
localStorageParam,
|
|
112
262
|
matchedElement,
|
|
113
263
|
mutationObserverBeforeReturn,
|
|
264
|
+
querySelectorAllAllParam,
|
|
265
|
+
querySelectorAllLightParam,
|
|
266
|
+
querySelectorAllParam,
|
|
267
|
+
querySelectorAllRootsParam,
|
|
268
|
+
querySelectorAllShadowParam,
|
|
269
|
+
querySelectorLightParam,
|
|
270
|
+
querySelectorParam,
|
|
271
|
+
querySelectorShadowParam,
|
|
114
272
|
resizeObserverBeforeReturn,
|
|
115
273
|
routeChangeBeforeReturn,
|
|
274
|
+
sessionStorageParam,
|
|
116
275
|
setIntervalBeforeReturn,
|
|
117
276
|
setTimeoutBeforeReturn,
|
|
277
|
+
swcAppHost,
|
|
278
|
+
swcAppMessage,
|
|
279
|
+
swcAppMessageBeforeReturn,
|
|
118
280
|
swcAppRouteFirstPathVariable,
|
|
119
281
|
swcAppRouteFirstPathVariableObject,
|
|
120
282
|
swcAppRouteFirstQueryParam,
|
|
@@ -132,6 +294,8 @@ export {
|
|
|
132
294
|
swcAppRouteQueryParams,
|
|
133
295
|
swcAppRouteQueryParamsObject,
|
|
134
296
|
swcAppRouteURLSearchParams,
|
|
135
|
-
|
|
297
|
+
swcAppRouter,
|
|
298
|
+
swcAppRouterEvent,
|
|
299
|
+
swcAppSimpleApplication
|
|
136
300
|
};
|
|
137
301
|
//# sourceMappingURL=parameter.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/parameter.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\n\n/**\n * @eventObject/@matchedElement/@hostSet/@helperHostSet/@helperSet/@swcAppRouterEvent/@appMessage/@eventBeforeReturn \u2014\n * @event/lifecycle/subscribeSwcAppRouteChange/subscribeSwcAppMessage\n * \uACC4\uC5F4 \uD578\uB4E4\uB7EC\uC758 \uD30C\uB77C\uBBF8\uD130\uB97C \uC21C\uC11C \uBB34\uAD00\uD558\uAC8C \uC120\uC5B8\uD560 \uC218 \uC788\uAC8C \uD574\uC8FC\uB294 \uD30C\uB77C\uBBF8\uD130 \uB370\uCF54\uB808\uC774\uD130.\n * @dooboostore/simple-boot\uC758 @Inject\uC640 \uB3D9\uC77C\uD55C \uC778\uB371\uC2A4 \uAE30\uBC18 \uBA54\uD0C0\uB370\uC774\uD130 \uD328\uD134\uC744 \uB530\uB978\uB2E4:\n * \uB370\uCF54\uB808\uC774\uD130\uAC00 \uC2E4\uD589\uB418\uB294 \uC21C\uC11C\uAC00 \uC544\uB2C8\uB77C \uC2E4\uC81C parameterIndex\uB85C \uC2AC\uB86F\uC744 \uB9E4\uCE6D\uD558\uBBC0\uB85C,\n * \uC0AC\uC6A9\uC790\uAC00 \uD30C\uB77C\uBBF8\uD130 \uC120\uC5B8 \uC21C\uC11C\uB97C \uC790\uC720\uB86D\uAC8C \uBC14\uAFD4\uB3C4 \uB41C\uB2E4.\n */\nexport type SwcParamKind = 'eventObject' | 'matchedElement' | 'hostSet' | 'helperHostSet' | 'helperSet' | 'swcAppRouterEvent' | 'appMessage' | 'eventBeforeReturn' | 'appMessageBeforeReturn' | 'routeChangeBeforeReturn' | 'eventMediaBeforeReturn' | 'mutationObserverBeforeReturn' | 'intersectionObserverBeforeReturn' | 'resizeObserverBeforeReturn' | 'changedAttributeBeforeReturn' | 'setTimeoutBeforeReturn' | 'setIntervalBeforeReturn' | 'fetchSettled'\n | SwcRouteParamKind;\n\n/** \uB77C\uC6B0\uD2B8 \uD578\uB4E4\uB7EC \uC804\uC6A9 (subscribeSwcAppRouteChange \uAC00 \uCC44\uC6C0). kind \uC774\uB984 = \uB370\uCF54\uB808\uC774\uD130 \uC774\uB984 */\nexport type SwcRouteParamKind =\n | 'swcAppRouteQueryParam' | 'swcAppRouteFirstQueryParam' | 'swcAppRouteLastQueryParam' | 'swcAppRouteQueryParams'\n | 'swcAppRouteQueryParamObject' | 'swcAppRouteFirstQueryParamObject' | 'swcAppRouteLastQueryParamObject' | 'swcAppRouteQueryParamsObject'\n | 'swcAppRouteURLSearchParams'\n | 'swcAppRoutePathVariable' | 'swcAppRouteFirstPathVariable' | 'swcAppRouteLastPathVariable' | 'swcAppRoutePathVariables'\n | 'swcAppRoutePathVariableObject' | 'swcAppRouteFirstPathVariableObject' | 'swcAppRouteLastPathVariableObject' | 'swcAppRoutePathVariablesObject';\n\nconst SWC_PARAMETER_METADATA_KEY = Symbol.for('simple-web-component:parameter');\n\n/** key: @swcAppRouteQueryParam('q') \uCC98\uB7FC \uD0A4\uB97C \uBC1B\uB294 \uD30C\uB77C\uBBF8\uD130 \uB370\uCF54\uB808\uC774\uD130\uC758 \uD0A4 */\ntype SaveParamConfig = { index: number; kind: SwcParamKind; key?: string };\n\nconst registerParam = (kind: SwcParamKind, target: Object, propertyKey: string | symbol | undefined, parameterIndex: number, key?: string) => {\n if (!propertyKey) return;\n const constructor = target.constructor;\n const saves = (ReflectUtils.getOwnMetadata(SWC_PARAMETER_METADATA_KEY, constructor, propertyKey) ?? []) as SaveParamConfig[];\n saves.push(key === undefined ? { index: parameterIndex, kind } : { index: parameterIndex, kind, key });\n ReflectUtils.defineMetadata(SWC_PARAMETER_METADATA_KEY, saves, constructor, propertyKey);\n};\n\n/** \uC774\uBCA4\uD2B8 \uD578\uB4E4\uB7EC\uC758 \uC6D0\uBCF8 Event \uAC1D\uCCB4\uB97C \uC8FC\uC785\uD55C\uB2E4. */\nexport function eventObject(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('eventObject', target, propertyKey, parameterIndex);\n}\n\n/** delegate\uB85C \uB9E4\uCE6D\uB41C \uC2E4\uC81C \uC5D8\uB9AC\uBA3C\uD2B8($matchedElement)\uB97C \uC8FC\uC785\uD55C\uB2E4. */\nexport function matchedElement(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('matchedElement', target, propertyKey, parameterIndex);\n}\n\n/** HostSet(\uD638\uC2A4\uD2B8 \uD2B8\uB9AC \uC815\uBCF4 \u2014 $host/$hosts/$firstHost/$appHost \uB4F1)\uC744 \uC8FC\uC785\uD55C\uB2E4. */\nexport function hostSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('hostSet', target, propertyKey, parameterIndex);\n}\n\n/** HelperHostSet(HelperSet + HostSet + $this \uC804\uCCB4 \uBB36\uC74C)\uC744 \uC8FC\uC785\uD55C\uB2E4. */\nexport function helperHostSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('helperHostSet', target, propertyKey, parameterIndex);\n}\n\n/** HelperSet($d/$w/$q/$qa/$qi \uB4F1 \uC21C\uC218 DOM/window \uD5EC\uD37C, \uD638\uC2A4\uD2B8 \uD2B8\uB9AC \uC815\uBCF4 \uC5C6\uC74C)\uC744 \uC8FC\uC785\uD55C\uB2E4. */\nexport function helperSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('helperSet', target, propertyKey, parameterIndex);\n}\n\n/** @subscribeSwcAppRouteChange \uD578\uB4E4\uB7EC\uC758 \uB77C\uC6B0\uD2B8 \uBCC0\uACBD \uC774\uBCA4\uD2B8({...RouterEventType, pathData})\uB97C \uC8FC\uC785\uD55C\uB2E4. */\nexport function swcAppRouterEvent(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('swcAppRouterEvent', target, propertyKey, parameterIndex);\n}\n\n/** @subscribeSwcAppMessage \uD578\uB4E4\uB7EC\uC758 SwcAppMessage \uD398\uC774\uB85C\uB4DC\uB97C \uC8FC\uC785\uD55C\uB2E4. */\nexport function appMessage(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('appMessage', target, propertyKey, parameterIndex);\n}\n\n/**\n * @event \uACC4\uC5F4\uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4.\n * (before\uC5D0\uC11C async\uB85C \uC900\uBE44\uD55C \uB370\uC774\uD130\uB97C \uD578\uB4E4\uB7EC\uAC00 \uBC1B\uB294 \uC6A9\uB3C4. before \uC5C6\uC73C\uBA74 undefined)\n * \uC608: @eventClick({ before: () => loadUser() }) onClick(@eventBeforeReturn user) { ... }\n */\nexport function eventBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('eventBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @subscribeSwcAppMessage \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4.\n * (before\uC5D0\uC11C async\uB85C \uC900\uBE44\uD55C \uB370\uC774\uD130\uB97C \uD578\uB4E4\uB7EC\uAC00 \uBC1B\uB294 \uC6A9\uB3C4. \uC5C6\uC73C\uBA74 undefined)\n * \uC608: onMsg(@appMessage m, @appMessageBeforeReturn prepared) { ... }\n */\nexport function appMessageBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('appMessageBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @subscribeSwcAppRouteChange \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4.\n * (before\uC5D0\uC11C async \uAC00\uB4DC/\uC900\uBE44\uD55C \uB370\uC774\uD130\uB97C \uD578\uB4E4\uB7EC\uAC00 \uBC1B\uB294 \uC6A9\uB3C4. \uC5C6\uC73C\uBA74 undefined)\n * \uC608: routeChanged(@swcAppRouterEvent e, @routeChangeBeforeReturn guard) { ... }\n */\nexport function routeChangeBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('routeChangeBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @eventMedia \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined)\n * \uC608: @eventMediaChange('(max-width:600px)', { before: () => ... }) onMobile(@eventMediaBeforeReturn v) { ... }\n */\nexport function eventMediaBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('eventMediaBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @mutationObserver \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined) */\nexport function mutationObserverBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('mutationObserverBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @intersectionObserver \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined) */\nexport function intersectionObserverBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('intersectionObserverBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @resizeObserver \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined) */\nexport function resizeObserverBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('resizeObserverBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @changedAttribute \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined) */\nexport function changedAttributeBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('changedAttributeBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @setTimeout(type:'onConnected') \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined) */\nexport function setTimeoutBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('setTimeoutBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @setInterval(type:'onConnected') \uC758 before \uD6C5\uC774 \uC774\uBC88 \uD638\uCD9C\uC5D0 \uB9AC\uD134\uD55C \uAC12\uC744 \uC8FC\uC785\uD55C\uB2E4. (before \uC5C6\uC73C\uBA74 undefined) */\nexport function setIntervalBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('setIntervalBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @fetch(trigger:'before') \uC758 fetch settled \uACB0\uACFC(PromiseSettledResult)\uB97C \uC8FC\uC785\uD55C\uB2E4.\n * \uC608: save(@fetchSettled settled) { ... }\n */\nexport function fetchSettled(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('fetchSettled', target, propertyKey, parameterIndex);\n}\n\nexport const getParameterMetadata = (target: any, propertyKey: string | symbol): SaveParamConfig[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.getMetadata(SWC_PARAMETER_METADATA_KEY, constructor, propertyKey) ?? [];\n};\n\n/**\n * \uC704 \uD30C\uB77C\uBBF8\uD130 \uB370\uCF54\uB808\uC774\uD130 \uBA54\uD0C0\uB370\uC774\uD130\uAC00 \uD558\uB098\uB77C\uB3C4 \uC788\uC73C\uBA74 kind\uBCC4 \uAC12\uC744 index \uC21C\uC11C\uC5D0 \uB9DE\uAC8C\n * \uBC30\uC5F4\uB85C \uC870\uB9BD\uD558\uACE0, \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 \uAE30\uC874 \uC704\uCE58 \uC778\uC790(legacyArgs)\uB97C \uADF8\uB300\uB85C \uBC18\uD658\uD55C\uB2E4 \u2014 \uC644\uC804 \uD558\uC704\uD638\uD658.\n */\nexport const buildSwcParameterArgs = (\n target: any,\n propertyKey: string | symbol,\n kindValues: Partial<Record<SwcParamKind, any>>,\n legacyArgs: any[]\n): any[] => {\n const saves = getParameterMetadata(target, propertyKey);\n if (saves.length === 0) return legacyArgs;\n const maxIndex = Math.max(...saves.map(s => s.index));\n const args: any[] = new Array(maxIndex + 1);\n for (const s of saves) {\n const value = kindValues[s.kind];\n // \uD0A4\uB97C \uBC1B\uB294 kind \uB294 kindValues \uC5D0 (key) => \uAC12 resolver \uAC00 \uB4E4\uC5B4 \uC788\uB2E4\n args[s.index] = s.key !== undefined && typeof value === 'function' ? value(s.key) : value;\n }\n return args;\n};\n\n// \u2500\u2500\u2500 \uB77C\uC6B0\uD2B8 \uD30C\uB77C\uBBF8\uD130 (@subscribeSwcAppRouteChange \uD578\uB4E4\uB7EC) \u2500\u2500\u2500\n// \uADDC\uCE59: \uC811\uB450\uC5B4 \uC5C6\uC74C = First, First/Last = \uAC19\uC740 \uD0A4\uAC00 \uC5EC\uB7EC \uBC88\uC77C \uB54C \uCCAB/\uB9C8\uC9C0\uB9C9 \uAC12, \uBCF5\uC218\uD615 = \uBAA8\uB4E0 \uAC12 \uBC30\uC5F4.\n\nconst keyedRouteParam = (kind: SwcRouteParamKind) => (key: string): ParameterDecorator =>\n (target, propertyKey, parameterIndex) => registerParam(kind, target, propertyKey, parameterIndex, key);\nconst routeParam = (kind: SwcRouteParamKind): ParameterDecorator =>\n (target, propertyKey, parameterIndex) => registerParam(kind, target, propertyKey, parameterIndex);\n\n/** ?tag=a&tag=b \u2192 @swcAppRouteQueryParam('tag') = 'a' (\uC5C6\uC73C\uBA74 null) */\nexport const swcAppRouteQueryParam = keyedRouteParam('swcAppRouteQueryParam');\n/** = swcAppRouteQueryParam */\nexport const swcAppRouteFirstQueryParam = keyedRouteParam('swcAppRouteFirstQueryParam');\n/** ?tag=a&tag=b \u2192 'b' */\nexport const swcAppRouteLastQueryParam = keyedRouteParam('swcAppRouteLastQueryParam');\n/** ?tag=a&tag=b \u2192 ['a', 'b'] */\nexport const swcAppRouteQueryParams = keyedRouteParam('swcAppRouteQueryParams');\n/** ?tag=a&tag=b \u2192 { tag: 'a' } */\nexport const swcAppRouteQueryParamObject = routeParam('swcAppRouteQueryParamObject');\n/** = swcAppRouteQueryParamObject */\nexport const swcAppRouteFirstQueryParamObject = routeParam('swcAppRouteFirstQueryParamObject');\n/** ?tag=a&tag=b \u2192 { tag: 'b' } */\nexport const swcAppRouteLastQueryParamObject = routeParam('swcAppRouteLastQueryParamObject');\n/** ?tag=a&tag=b \u2192 { tag: ['a', 'b'] } */\nexport const swcAppRouteQueryParamsObject = routeParam('swcAppRouteQueryParamsObject');\n/** URLSearchParams \uADF8\uB300\uB85C */\nexport const swcAppRouteURLSearchParams = routeParam('swcAppRouteURLSearchParams');\n\n/** '/a/{id}/b/{id}' \u2190 '/a/1/b/2' \u2192 @swcAppRoutePathVariable('id') = '1' */\nexport const swcAppRoutePathVariable = keyedRouteParam('swcAppRoutePathVariable');\n/** = swcAppRoutePathVariable */\nexport const swcAppRouteFirstPathVariable = keyedRouteParam('swcAppRouteFirstPathVariable');\n/** \u2192 '2' */\nexport const swcAppRouteLastPathVariable = keyedRouteParam('swcAppRouteLastPathVariable');\n/** \u2192 ['1', '2'] */\nexport const swcAppRoutePathVariables = keyedRouteParam('swcAppRoutePathVariables');\n/** \u2192 { id: '1' } */\nexport const swcAppRoutePathVariableObject = routeParam('swcAppRoutePathVariableObject');\n/** = swcAppRoutePathVariableObject */\nexport const swcAppRouteFirstPathVariableObject = routeParam('swcAppRouteFirstPathVariableObject');\n/** \u2192 { id: '2' } */\nexport const swcAppRouteLastPathVariableObject = routeParam('swcAppRouteLastPathVariableObject');\n/** \u2192 { id: ['1', '2'] } */\nexport const swcAppRoutePathVariablesObject = routeParam('swcAppRoutePathVariablesObject');\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SwcUtils } from '../utils/Utils';\nimport { QuerySelector, QueryOptions, QueryBaseOptions, resolveQueryElements, pickElements } from './query';\nimport { AttributeOptions, AttributeSelector, getAttributeValue } from './applyAttribute';\nimport { PersistOptions, persistRead, persistReadAsync } from './persistState';\nimport type { HelperHostSet, SwcAppMessageSubject } from '../types';\n\n/**\n * @eventObject/@matchedElement/@hostSet/@helperHostSet/@helperSet/@swcAppRouterEvent/@swcAppMessage/@eventBeforeReturn —\n * @event/lifecycle/subscribeSwcAppRouteChange/subscribeSwcAppMessage\n * 계열 핸들러의 파라미터를 순서 무관하게 선언할 수 있게 해주는 파라미터 데코레이터.\n * @dooboostore/simple-boot의 @Inject와 동일한 인덱스 기반 메타데이터 패턴을 따른다:\n * 데코레이터가 실행되는 순서가 아니라 실제 parameterIndex로 슬롯을 매칭하므로,\n * 사용자가 파라미터 선언 순서를 자유롭게 바꿔도 된다.\n */\nexport type SwcParamKind = 'eventObject' | 'matchedElement' | 'hostSet' | 'helperHostSet' | 'helperSet' | 'swcAppRouterEvent' | 'swcAppRouter' | 'swcAppSimpleApplication' | 'swcAppHost' | 'swcAppMessage' | 'eventBeforeReturn' | 'swcAppMessageBeforeReturn' | 'routeChangeBeforeReturn' | 'eventMediaBeforeReturn' | 'mutationObserverBeforeReturn' | 'intersectionObserverBeforeReturn' | 'resizeObserverBeforeReturn' | 'changedAttributeBeforeReturn' | 'setTimeoutBeforeReturn' | 'setIntervalBeforeReturn' | 'fetchPromise'\n | 'querySelectorParam' | 'querySelectorAllParam' | 'attributeParam' | 'localStorageParam' | 'sessionStorageParam' | 'cookieParam' | 'indexedDbParam' | 'fetchParam'\n | SwcRouteParamKind;\n\n/** 라우트 값 (kind 이름 = 데코레이터 이름). 파라미터면 subscribeSwcAppRouteChange 핸들러 인자로, 필드면 SwcApp 이 라우트 변경 때 채운다 */\nexport type SwcRouteParamKind =\n | 'swcAppRouteQueryParam' | 'swcAppRouteFirstQueryParam' | 'swcAppRouteLastQueryParam' | 'swcAppRouteQueryParams'\n | 'swcAppRouteQueryParamObject' | 'swcAppRouteFirstQueryParamObject' | 'swcAppRouteLastQueryParamObject' | 'swcAppRouteQueryParamsObject'\n | 'swcAppRouteURLSearchParams'\n | 'swcAppRoutePathVariable' | 'swcAppRouteFirstPathVariable' | 'swcAppRouteLastPathVariable' | 'swcAppRoutePathVariables'\n | 'swcAppRoutePathVariableObject' | 'swcAppRouteFirstPathVariableObject' | 'swcAppRouteLastPathVariableObject' | 'swcAppRoutePathVariablesObject';\n\nconst SWC_PARAMETER_METADATA_KEY = Symbol.for('simple-web-component:parameter');\n\n/** key: @swcAppRouteQueryParam('q') 처럼 키를 받는 파라미터 데코레이터의 키 (querySelectorParam/attributeParam은 객체를 담는다) */\ntype SaveParamConfig = { index: number; kind: SwcParamKind; key?: any };\n\nconst registerParam = (kind: SwcParamKind, target: Object, propertyKey: string | symbol | undefined, parameterIndex: number, key?: any) => {\n if (!propertyKey) return;\n const constructor = target.constructor;\n const saves = (ReflectUtils.getOwnMetadata(SWC_PARAMETER_METADATA_KEY, constructor, propertyKey) ?? []) as SaveParamConfig[];\n saves.push(key === undefined ? { index: parameterIndex, kind } : { index: parameterIndex, kind, key });\n ReflectUtils.defineMetadata(SWC_PARAMETER_METADATA_KEY, saves, constructor, propertyKey);\n};\n\n/** 이벤트 핸들러의 원본 Event 객체를 주입한다. */\nexport function eventObject(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('eventObject', target, propertyKey, parameterIndex);\n}\n\n/** delegate로 매칭된 실제 엘리먼트($matchedElement)를 주입한다. */\nexport function matchedElement(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('matchedElement', target, propertyKey, parameterIndex);\n}\n\n/** HostSet(호스트 트리 정보 — $host/$hosts/$firstHost/$appHost 등)을 주입한다. */\nexport function hostSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('hostSet', target, propertyKey, parameterIndex);\n}\n\n/** HelperHostSet(HelperSet + HostSet + $this 전체 묶음)을 주입한다. */\nexport function helperHostSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('helperHostSet', target, propertyKey, parameterIndex);\n}\n\n/** HelperSet($d/$w/$q/$qa/$qi 등 순수 DOM/window 헬퍼, 호스트 트리 정보 없음)을 주입한다. */\nexport function helperSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('helperSet', target, propertyKey, parameterIndex);\n}\n\n/** @subscribeSwcAppRouteChange 핸들러의 라우트 변경 이벤트({...RouterEventType, pathData})를 주입한다. */\nexport function swcAppRouterEvent(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('swcAppRouterEvent', target, propertyKey, parameterIndex);\n}\n\n/**\n * Router 인스턴스($appHost.router)를 주입한다 — @Inject(DI) 없이도 router.go()/pathData 등에 바로 접근.\n * SwcApp 트리 밖(standalone, $appHost 없음)이면 undefined.\n */\nexport function swcAppRouter(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('swcAppRouter', target, propertyKey, parameterIndex);\n}\n\n/**\n * SimpleApplication(DI 컨테이너) 인스턴스($appHost.simpleApplication)를 주입한다 —\n * simstanceManager 등 컨테이너 자체를 직접 다뤄야 할 때. 보통은 @inject로 충분하니 그거부터 고려할 것.\n * SwcApp 트리 밖이거나 DI 컨테이너 없이 쓰는 standalone이면 undefined.\n */\nexport function swcAppSimpleApplication(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('swcAppSimpleApplication', target, propertyKey, parameterIndex);\n}\n\n/**\n * SwcApp 호스트 엘리먼트 자신($appHost)을 주입한다 — @hostSet으로도 hs.$appHost로 바로 꺼내지지만,\n * HostSet 전체 말고 호스트 하나만 필요할 때 짧게 쓰는 용도. SwcApp 트리 밖이면 undefined.\n */\nexport function swcAppHost(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('swcAppHost', target, propertyKey, parameterIndex);\n}\n\n// ─── @swcAppMessage: 파라미터(@subscribeSwcAppMessage 핸들러의 메시지) · 필드(발행될 때마다 최신 메시지) ───\n\n/** 필드용 옵션 — @subscribeSwcAppMessage 와 같은 규칙. subject 는 messageType 이 있을 때만 의미가 있다 */\nexport type SwcAppMessageFieldOptions = { messageType?: string; subject?: SwcAppMessageSubject };\nexport type SwcAppMessageFieldConfig = { propertyKey: string | symbol; messageType?: string; subject?: SwcAppMessageSubject };\n/** 파라미터·필드 겸용 데코레이터. 세 번째 인자가 숫자면 파라미터, 아니면 필드 */\nexport type SwcAppMessageDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex?: number) => void;\n\nconst SWC_MESSAGE_FIELD_METADATA_KEY = Symbol.for('simple-web-component:message-field');\n\nconst applySwcAppMessage = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number | undefined, options?: SwcAppMessageFieldOptions) => {\n if (typeof parameterIndex === 'number') return registerParam('swcAppMessage', target, propertyKey, parameterIndex);\n if (propertyKey === undefined) return;\n const constructor = target.constructor;\n const list = (ReflectUtils.getOwnMetadata(SWC_MESSAGE_FIELD_METADATA_KEY, constructor) ?? []) as SwcAppMessageFieldConfig[];\n list.push({ propertyKey, ...(options?.messageType ? { messageType: options.messageType } : {}), ...(options?.subject ? { subject: options.subject } : {}) });\n ReflectUtils.defineMetadata(SWC_MESSAGE_FIELD_METADATA_KEY, list, constructor);\n};\n\n/** 상속 체인 전체의 메시지 필드 설정 */\nexport const getSwcAppMessageFieldMetadata = (target: any): SwcAppMessageFieldConfig[] => {\n const constructor = target instanceof Function ? target : target?.constructor;\n if (!constructor) return [];\n return (ReflectUtils.findAllMetadata<SwcAppMessageFieldConfig[]>(SWC_MESSAGE_FIELD_METADATA_KEY, constructor) || []).flat();\n};\n\n/**\n * 파라미터: @subscribeSwcAppMessage 핸들러의 SwcAppMessage 를 주입한다 — onMsg(@swcAppMessage m) { ... }\n * 필드: SwcApp 이 메시지를 발행할 때마다 그 필드에 최신 SwcAppMessage 를 넣는다 (같은 요소의 구독 핸들러보다 먼저).\n * @swcAppMessage last?: SwcAppMessage 전 타입 (live만)\n * @swcAppMessage('login') login?: SwcAppMessage login (live만 — subject 기본값)\n * @swcAppMessage('login', { subject: 'behavior' }) login? 늦게 붙어도 마지막 1개로 채움\n * @swcAppMessage({ messageType: 'login', subject: 'replay' }) ... 버퍼를 시간순으로 넣음 (마지막 값이 남음)\n */\nexport function swcAppMessage(target: Object, propertyKey: string | symbol | undefined, parameterIndex?: number): void;\nexport function swcAppMessage(messageType: string, options?: Omit<SwcAppMessageFieldOptions, 'messageType'>): SwcAppMessageDecorator;\nexport function swcAppMessage(options: SwcAppMessageFieldOptions): SwcAppMessageDecorator;\nexport function swcAppMessage(a: any, b?: any, c?: any): any {\n // 데코레이터로 바로 불렸으면 (target, propertyKey, …) — propertyKey 는 문자열/심볼\n if (typeof b === 'string' || typeof b === 'symbol') return applySwcAppMessage(a, b, c);\n const options: SwcAppMessageFieldOptions = typeof a === 'string' ? { ...(b ?? {}), messageType: a } : { ...(a ?? {}) };\n return ((target, propertyKey, parameterIndex) => applySwcAppMessage(target, propertyKey, parameterIndex, options)) as SwcAppMessageDecorator;\n}\n\n/**\n * @event 계열의 before 훅이 이번 호출에 리턴한 값을 주입한다.\n * (before에서 async로 준비한 데이터를 핸들러가 받는 용도. before 없으면 undefined)\n * 예: @eventClick({ before: () => loadUser() }) onClick(@eventBeforeReturn user) { ... }\n */\nexport function eventBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('eventBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @subscribeSwcAppMessage 의 before 훅이 이번 호출에 리턴한 값을 주입한다.\n * (before에서 async로 준비한 데이터를 핸들러가 받는 용도. 없으면 undefined)\n * 예: onMsg(@swcAppMessage m, @swcAppMessageBeforeReturn prepared) { ... }\n * 핸들러 호출마다 생기는 값이라 파라미터 전용이다 (필드에는 붙이지 않는다).\n */\nexport function swcAppMessageBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('swcAppMessageBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @subscribeSwcAppRouteChange 의 before 훅이 이번 호출에 리턴한 값을 주입한다.\n * (before에서 async 가드/준비한 데이터를 핸들러가 받는 용도. 없으면 undefined)\n * 예: routeChanged(@swcAppRouterEvent e, @routeChangeBeforeReturn guard) { ... }\n */\nexport function routeChangeBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('routeChangeBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @eventMedia 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined)\n * 예: @eventMediaChange('(max-width:600px)', { before: () => ... }) onMobile(@eventMediaBeforeReturn v) { ... }\n */\nexport function eventMediaBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('eventMediaBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @mutationObserver 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined) */\nexport function mutationObserverBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('mutationObserverBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @intersectionObserver 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined) */\nexport function intersectionObserverBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('intersectionObserverBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @resizeObserver 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined) */\nexport function resizeObserverBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('resizeObserverBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @changedAttribute 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined) */\nexport function changedAttributeBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('changedAttributeBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @setTimeout(type:'onConnected') 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined) */\nexport function setTimeoutBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('setTimeoutBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/** @setInterval(type:'onConnected') 의 before 훅이 이번 호출에 리턴한 값을 주입한다. (before 없으면 undefined) */\nexport function setIntervalBeforeReturn(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('setIntervalBeforeReturn', target, propertyKey, parameterIndex);\n}\n\n/**\n * @fetch(before 모드)가 시작한 요청의 Promise 를 주입한다. 메서드는 요청을 기다리지 않고 바로 불리고,\n * 기다릴지·어떻게 처리할지(then/catch/finally)는 메서드가 정한다. 실패는 reject, 프레임워크가 끊으면 끝나지 않는다.\n * 예: load(@fetchPromise p: Promise<Post>) { return p.then(post => post.title); }\n */\nexport function fetchPromise(target: Object, propertyKey: string | symbol, parameterIndex: number): void {\n registerParam('fetchPromise', target, propertyKey, parameterIndex);\n}\n\n/**\n * 셀렉터로 찾은 DOM 요소 하나를 주입한다 — 필드용 @query 데코레이터(query.ts)와 같은 탐색 엔진 재사용.\n * options.root로 'light'/'shadow'/'auto'(기본)/'all' 탐색 범위를 그대로 지정할 수 있다(@query와 동일).\n * onConnectedAfter/addEventListener/setInterval 등 \"자동 트리거\" 메서드에서만 채워진다\n * (buildCommonKindValues를 거치는 호출부 한정 — 임의로 직접 호출하는 메서드에는 못 꽂는다).\n * URL의 query parameter와 헷갈리지 않도록 \"query\"가 아니라 \"querySelector\"로 이름 붙였다.\n * 예: onReady(@querySelectorParam('#name') input: HTMLInputElement) { ... }\n */\nexport function querySelectorParam(selector: QuerySelector, options?: QueryOptions): ParameterDecorator {\n return (target, propertyKey, parameterIndex) => registerParam('querySelectorParam', target, propertyKey, parameterIndex, { selector, options });\n}\n\n/** @querySelectorParam의 복수형 — 매칭된 모든 요소를 배열로 주입한다(= @queryAll, pick 고정 'all'). */\nexport function querySelectorAllParam(selector: QuerySelector, options?: Omit<QueryOptions, 'pick'>): ParameterDecorator {\n return (target, propertyKey, parameterIndex) => registerParam('querySelectorAllParam', target, propertyKey, parameterIndex, { selector, options });\n}\n\n// ─── root별 편의 alias — query.ts의 queryShadow/queryLight/queryAllRoots/queryAllShadow/queryAllLight/queryAllAll과 1:1 대응 ───\n\n/** shadow DOM에서 요소 하나를 찾아 주입한다 (= @querySelectorParam(selector, {root:'shadow'})). */\nexport function querySelectorShadowParam(selector: QuerySelector, options?: QueryBaseOptions): ParameterDecorator {\n return querySelectorParam(selector, { ...(options ?? {}), root: 'shadow' });\n}\n/** light DOM에서 요소 하나를 찾아 주입한다. */\nexport function querySelectorLightParam(selector: QuerySelector, options?: QueryBaseOptions): ParameterDecorator {\n return querySelectorParam(selector, { ...(options ?? {}), root: 'light' });\n}\n/** shadow+light 모두에서 찾아 하나만 주입한다 (pick 기본 'first') — \"All\"은 탐색 범위가 전부라는 뜻. */\nexport function querySelectorAllRootsParam(selector: QuerySelector, options?: QueryBaseOptions): ParameterDecorator {\n return querySelectorParam(selector, { ...(options ?? {}), root: 'all' });\n}\n/** shadow DOM에서 매칭된 모든 요소를 배열로 주입한다. */\nexport function querySelectorAllShadowParam(selector: QuerySelector, options?: Omit<QueryBaseOptions, 'pick'>): ParameterDecorator {\n return querySelectorAllParam(selector, { ...(options ?? {}), root: 'shadow' });\n}\n/** light DOM에서 매칭된 모든 요소를 배열로 주입한다. */\nexport function querySelectorAllLightParam(selector: QuerySelector, options?: Omit<QueryBaseOptions, 'pick'>): ParameterDecorator {\n return querySelectorAllParam(selector, { ...(options ?? {}), root: 'light' });\n}\n/** shadow+light 모두에서 매칭된 모든 요소를 배열로 주입한다. */\nexport function querySelectorAllAllParam(selector: QuerySelector, options?: Omit<QueryBaseOptions, 'pick'>): ParameterDecorator {\n return querySelectorAllParam(selector, { ...(options ?? {}), root: 'all' });\n}\n// skipped: queryIn처럼 root+pick을 동적으로 조합하는 팩토리형 alias — 필요해지면 그때 추가.\n\n/**\n * attribute 값을 주입한다 — 필드용 @attribute 데코레이터(applyAttribute.ts)와 같은 엔진 재사용.\n * - attributeParam('data-x', options?) — 이 엘리먼트 자신의 attribute.\n * - attributeParam(selector, 'data-x', options?) — selector(+options.root)로 찾은 다른 요소의 attribute.\n * 필드용 @attribute(selector?, attrName, options?)와 동일한 2-form 시그니처.\n */\nexport function attributeParam(attributeName: string, options?: AttributeOptions): ParameterDecorator;\nexport function attributeParam(selector: AttributeSelector, attributeName: string, options?: AttributeOptions): ParameterDecorator;\nexport function attributeParam(selectorOrName: AttributeSelector | string, attrNameOrOptions?: string | AttributeOptions, maybeOptions?: AttributeOptions): ParameterDecorator {\n const withSelector = typeof attrNameOrOptions === 'string';\n const attributeName = withSelector ? attrNameOrOptions as string : selectorOrName as string;\n const options = (withSelector ? maybeOptions : attrNameOrOptions as AttributeOptions | undefined) ?? {};\n const resolved: AttributeOptions & { selector?: AttributeSelector } = withSelector ? { ...options, selector: selectorOrName as AttributeSelector } : options;\n return (target, propertyKey, parameterIndex) => registerParam('attributeParam', target, propertyKey, parameterIndex, { attributeName, options: resolved });\n}\n\nconst keyedStorageParam = (kind: SwcParamKind) => (key: string, options?: Omit<PersistOptions, 'storage'>): ParameterDecorator =>\n (target, propertyKey, parameterIndex) => registerParam(kind, target, propertyKey, parameterIndex, { key, options });\n\n/** localStorage에 저장된 값을 주입한다 (persistState.ts의 persistRead 재사용). */\nexport const localStorageParam = keyedStorageParam('localStorageParam');\n/** sessionStorage에 저장된 값을 주입한다. */\nexport const sessionStorageParam = keyedStorageParam('sessionStorageParam');\n/** 쿠키에 저장된 값을 주입한다. */\nexport const cookieParam = keyedStorageParam('cookieParam');\n/**\n * IndexedDB에 저장된 값을 주입한다 — 단, 비동기 백엔드라 (동기 호출 계약상) resolve된 값이 아니라\n * **Promise 자체**가 꽂힌다. 메서드 쪽에서 타입을 Promise로 받고 await 하면 된다.\n * 예: async onReady(@indexedDbParam('wow') wow: Promise<string>) { const v = await wow; ... }\n */\nexport const indexedDbParam = keyedStorageParam('indexedDbParam');\n\n/** url/init 자리에 고정값 대신 (currentThis, helper) => ... 콜백을 줄 수 있다 — query.ts 함수 셀렉터·fetch.ts FetchUrlFactory와 동일한 패턴. */\nexport type FetchParamUrlFactory = (currentThis: any, helper: HelperHostSet) => RequestInfo | URL;\nexport type FetchParamInitFactory = (currentThis: any, helper: HelperHostSet) => RequestInit | undefined;\n\n/**\n * 간단 버전 fetch — 네이티브 fetch(url, init) 그대로, 성공하면 Content-Type 보고 JSON/텍스트로 파싱한 뒤\n * **그 Promise를 주입**한다 (indexedDbParam과 동일한 계약 — 비동기라 resolve된 값이 아니라 Promise 자체).\n * abort/abortPrevious 같은 건 없다 — 그런 게 필요하면 @fetch/@fetchManual + @fetchPromise를 쓴다\n * (disconnect 시 자동 abort까지 되는 더 안전한 버전). 이건 딱 \"그냥 fetch 결과를 파라미터로 받고 싶다\"는 경우용.\n *\n * url/init은 고정값뿐 아니라 (currentThis, helper) => ... 콜백도 받는다 — 인스턴스 필드를 참조해서\n * URL이나 body를 동적으로 만들어야 할 때 쓴다.\n * 예: async onReady(@fetchParam('/api/products/1') p: Promise<Product>) { const data = await p; }\n * 예: async onSave(@fetchParam(\n * (self) => `/api/products/${self.productId}`,\n * (self) => ({ method: 'POST', body: JSON.stringify({ qty: self.qty }) })\n * ) p: Promise<any>) { const result = await p; }\n */\nexport function fetchParam(\n input: RequestInfo | URL | FetchParamUrlFactory,\n init?: RequestInit | FetchParamInitFactory\n): ParameterDecorator {\n return (target, propertyKey, parameterIndex) => registerParam('fetchParam', target, propertyKey, parameterIndex, { input, init });\n}\n\nexport const getParameterMetadata = (target: any, propertyKey: string | symbol): SaveParamConfig[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.getMetadata(SWC_PARAMETER_METADATA_KEY, constructor, propertyKey) ?? [];\n};\n\n/**\n * 위 파라미터 데코레이터 메타데이터가 하나라도 있으면 kind별 값을 index 순서에 맞게\n * 배열로 조립하고, 하나도 없으면 기존 위치 인자(legacyArgs)를 그대로 반환한다 — 완전 하위호환.\n * 데코레이터가 안 붙은 인덱스는 legacyArgs의 같은 자리 값으로 채운다 — 그래야\n * onId(nv, old, @querySelectorParam('#x') el) 처럼 기존 위치 인자와 섞어 써도 nv/old가 undefined로 날아가지 않는다.\n */\nexport const buildSwcParameterArgs = (\n target: any,\n propertyKey: string | symbol,\n kindValues: Partial<Record<SwcParamKind, any>>,\n legacyArgs: any[]\n): any[] => {\n const saves = getParameterMetadata(target, propertyKey);\n if (saves.length === 0) return legacyArgs;\n const maxIndex = Math.max(Math.max(...saves.map(s => s.index)), legacyArgs.length - 1);\n const args: any[] = legacyArgs.slice(0, maxIndex + 1);\n for (const s of saves) {\n const value = kindValues[s.kind];\n // 키를 받는 kind 는 kindValues 에 (key) => 값 resolver 가 들어 있다\n args[s.index] = s.key !== undefined && typeof value === 'function' ? value(s.key) : value;\n }\n return args;\n};\n\n/** @fetchParam 전용 — 네이티브 fetch, 실패하면 상태코드를 담아 던지고, 성공하면 Content-Type 보고 json/text로 파싱. */\nconst simpleFetchJsonOrText = async (win: Window, input: RequestInfo | URL, init?: RequestInit): Promise<any> => {\n const fetchFn: typeof fetch = typeof (win as any)?.fetch === 'function' ? (win as any).fetch.bind(win) : fetch;\n const res = await fetchFn(input, init);\n if (!res.ok) throw new Error(`[SWC] @fetchParam failed: ${res.status} ${String(input)}`);\n const text = await res.text();\n if (!text) return undefined;\n return (res.headers.get('Content-Type') ?? '').includes('json') ? JSON.parse(text) : text;\n};\n\n/**\n * @querySelectorParam/@querySelectorAllParam/@attributeParam/@local·session·cookie·indexedDb·fetchParam 리졸버만 —\n * hostSet 3종과 분리해서, 이미 자기만의 hostSet/helperHostSet 계산 방식을 가진 호출부\n * (예: elementDefine._invokeLifecycleMethod)에서도 기존 계산은 그대로 둔 채 이 kind들만 얹을 수 있게 한다.\n * indexedDB/fetch는 비동기라 (동기 호출 계약상) resolve된 값이 아니라 Promise 자체를 반환한다 —\n * 둘 다 async 함수라 호출 즉시 Promise를 반환하므로 await 없이도 동기 리졸버 계약을 지킨다.\n */\nexport const buildDomStorageKindValues = (inst: any, win: Window): Partial<Record<SwcParamKind, any>> => ({\n querySelectorParam: (cfg: { selector: QuerySelector; options?: QueryOptions }) =>\n pickElements(resolveQueryElements(inst, cfg.selector, cfg.options ?? {}, win), cfg.options?.pick ?? 'first'),\n querySelectorAllParam: (cfg: { selector: QuerySelector; options?: Omit<QueryOptions, 'pick'> }) =>\n pickElements(resolveQueryElements(inst, cfg.selector, cfg.options ?? {}, win), 'all'),\n attributeParam: (cfg: { attributeName: string; options?: AttributeOptions & { selector?: AttributeSelector } }) =>\n getAttributeValue(inst, cfg.attributeName, cfg.options),\n localStorageParam: (cfg: { key: string; options?: Omit<PersistOptions, 'storage'> }) =>\n persistRead(inst, cfg.key, { ...(cfg.options as any), storage: 'local' }),\n sessionStorageParam: (cfg: { key: string; options?: Omit<PersistOptions, 'storage'> }) =>\n persistRead(inst, cfg.key, { ...(cfg.options as any), storage: 'session' }),\n cookieParam: (cfg: { key: string; options?: Omit<PersistOptions, 'storage'> }) =>\n persistRead(inst, cfg.key, { ...(cfg.options as any), storage: 'cookie' }),\n indexedDbParam: (cfg: { key: string; options?: Omit<PersistOptions, 'storage'> }): Promise<any> =>\n persistReadAsync(inst, cfg.key, { ...(cfg.options as any), storage: 'indexeddb' }),\n fetchParam: (cfg: { input: RequestInfo | URL | FetchParamUrlFactory; init?: RequestInit | FetchParamInitFactory }): Promise<any> => {\n const helper = SwcUtils.getHelperAndHostSet(inst, win);\n const resolvedInput = typeof cfg.input === 'function' ? (cfg.input as FetchParamUrlFactory)(inst, helper) : cfg.input;\n const resolvedInit = typeof cfg.init === 'function' ? (cfg.init as FetchParamInitFactory)(inst, helper) : cfg.init;\n return simpleFetchJsonOrText(win, resolvedInput, resolvedInit);\n },\n});\n\n/**\n * 트리거 데코레이터(onConnectedAfter/addEventListener/setInterval/setTimeout/옵저버 계열/...)가\n * 공통으로 필요로 하는 kindValues 베이스 — hostSet/helperSet/helperHostSet 3종 + buildDomStorageKindValues를\n * 한 번에 만든다. 각 호출부는 자기만의 kind(eventObject, setTimeoutBeforeReturn 등)만 추가로 섞어 쓰면 된다.\n */\nexport const buildCommonKindValues = (inst: any, win: Window): Partial<Record<SwcParamKind, any>> => {\n const hostSet = SwcUtils.getHostSet(inst);\n const helperSet = SwcUtils.getHelperSet(win);\n const helperHostSet = { ...helperSet, ...hostSet, $this: inst };\n return {\n hostSet, helperSet, helperHostSet,\n swcAppRouter: hostSet.$appHost?.router,\n swcAppSimpleApplication: hostSet.$appHost?.simpleApplication,\n swcAppHost: hostSet.$appHost,\n ...buildDomStorageKindValues(inst, win)\n };\n};\n\n// ─── 라우트 파라미터 (@subscribeSwcAppRouteChange 핸들러 파라미터 · 필드) ───\n// 규칙: 접두어 없음 = First, First/Last = 같은 키가 여러 번일 때 첫/마지막 값, 복수형 = 모든 값 배열.\n// 같은 데코레이터를 파라미터에도, 필드에도 붙인다. 파라미터면 핸들러 인자로, 필드면 SwcApp 이 라우트가 바뀔 때마다\n// (그리고 요소가 붙을 때 마지막 라우트로) 그 필드에 값을 넣는다 — SwcAppMixin._applyRouteFields.\n\n/** 파라미터·필드 겸용 데코레이터. 세 번째 인자가 숫자면 파라미터, 아니면(필드) undefined */\nexport type SwcRouteParamDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex?: number) => void;\n/** path 변수 필드용 — 어떤 패턴에서 값을 뽑을지. @subscribeSwcAppRouteChange 의 path 와 같은 형태 */\nexport type SwcRouteFieldOptions = { path?: string | string[] | ((currentThis: any) => string | string[]) };\n/** 맨 데코레이터로도(@swcAppRoutePathVariableObject), 옵션을 받는 팩토리로도(@swcAppRoutePathVariableObject({ path })) 쓴다 */\nexport type SwcRouteParamDecoratorOrFactory = SwcRouteParamDecorator & ((options?: SwcRouteFieldOptions) => SwcRouteParamDecorator);\n\nexport type SwcRouteFieldConfig = { propertyKey: string | symbol; kind: SwcRouteParamKind; key?: string; path?: SwcRouteFieldOptions['path'] };\nconst SWC_ROUTE_FIELD_METADATA_KEY = Symbol.for('simple-web-component:route-field');\n\nconst isPathKind = (kind: SwcRouteParamKind) => kind.includes('PathVariable');\n\nconst registerRouteField = (kind: SwcRouteParamKind, target: Object, propertyKey: string | symbol, key?: string, options?: SwcRouteFieldOptions) => {\n if (isPathKind(kind) && !options?.path) {\n // 필드에는 @subscribeSwcAppRouteChange 처럼 매칭할 패턴이 없다 → 늘 비게 된다. 실수일 가능성이 커서 알린다.\n console.warn(`[SWC] @${kind} on field \"${String(propertyKey)}\" needs { path } (e.g. { path: '/user/{id}' }) — it will stay empty without it.`);\n }\n const constructor = target.constructor;\n const list = (ReflectUtils.getOwnMetadata(SWC_ROUTE_FIELD_METADATA_KEY, constructor) ?? []) as SwcRouteFieldConfig[];\n list.push({ propertyKey, kind, ...(key !== undefined ? { key } : {}), ...(options?.path ? { path: options.path } : {}) });\n ReflectUtils.defineMetadata(SWC_ROUTE_FIELD_METADATA_KEY, list, constructor);\n};\n\n/** 상속 체인 전체의 라우트 필드 설정 (부모 → 자식). 같은 필드를 자식이 다시 선언하면 자식 것이 뒤에 와서 이긴다 */\nexport const getSwcRouteFieldMetadata = (target: any): SwcRouteFieldConfig[] => {\n const constructor = target instanceof Function ? target : target?.constructor;\n if (!constructor) return [];\n return (ReflectUtils.findAllMetadata<SwcRouteFieldConfig[]>(SWC_ROUTE_FIELD_METADATA_KEY, constructor) || []).flat();\n};\n\nconst applyRouteParam = (kind: SwcRouteParamKind, target: Object, propertyKey: string | symbol | undefined, parameterIndex: number | undefined, key?: string, options?: SwcRouteFieldOptions) => {\n if (typeof parameterIndex === 'number') return registerParam(kind, target, propertyKey, parameterIndex, key);\n if (propertyKey !== undefined) registerRouteField(kind, target, propertyKey, key, options);\n};\n\n/** 키를 받는 query 계열: @swcAppRouteQueryParam('tag') */\nconst keyedQueryParam = (kind: SwcRouteParamKind) => (key: string): SwcRouteParamDecorator =>\n (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex, key);\n/** 키를 받는 path 변수 계열: @swcAppRoutePathVariable('id') · 필드면 @swcAppRoutePathVariable('id', { path: '/user/{id}' }) */\nconst keyedPathParam = (kind: SwcRouteParamKind) => (key: string, options?: SwcRouteFieldOptions): SwcRouteParamDecorator =>\n (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex, key, options);\n/** 키 없는 query 계열 — 맨 데코레이터: @swcAppRouteQueryParamObject */\nconst queryParam = (kind: SwcRouteParamKind): SwcRouteParamDecorator =>\n (target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex);\n/** 키 없는 path 변수 계열 — 맨 데코레이터(파라미터) 또는 팩토리(필드: { path }) 둘 다 */\nconst pathParam = (kind: SwcRouteParamKind): SwcRouteParamDecoratorOrFactory =>\n function (this: unknown, ...args: any[]) {\n // 데코레이터 호출은 (target, propertyKey, …) 로 인자가 2개 이상, 팩토리 호출은 (options?) 하나 이하\n if (args.length >= 2) return applyRouteParam(kind, args[0], args[1], args[2]);\n const options = args[0] as SwcRouteFieldOptions | undefined;\n return ((target, propertyKey, parameterIndex) => applyRouteParam(kind, target, propertyKey, parameterIndex, undefined, options)) as SwcRouteParamDecorator;\n } as SwcRouteParamDecoratorOrFactory;\n\n/** ?tag=a&tag=b → @swcAppRouteQueryParam('tag') = 'a' (없으면 null) */\nexport const swcAppRouteQueryParam = keyedQueryParam('swcAppRouteQueryParam');\n/** = swcAppRouteQueryParam */\nexport const swcAppRouteFirstQueryParam = keyedQueryParam('swcAppRouteFirstQueryParam');\n/** ?tag=a&tag=b → 'b' */\nexport const swcAppRouteLastQueryParam = keyedQueryParam('swcAppRouteLastQueryParam');\n/** ?tag=a&tag=b → ['a', 'b'] */\nexport const swcAppRouteQueryParams = keyedQueryParam('swcAppRouteQueryParams');\n/** ?tag=a&tag=b → { tag: 'a' } */\nexport const swcAppRouteQueryParamObject = queryParam('swcAppRouteQueryParamObject');\n/** = swcAppRouteQueryParamObject */\nexport const swcAppRouteFirstQueryParamObject = queryParam('swcAppRouteFirstQueryParamObject');\n/** ?tag=a&tag=b → { tag: 'b' } */\nexport const swcAppRouteLastQueryParamObject = queryParam('swcAppRouteLastQueryParamObject');\n/** ?tag=a&tag=b → { tag: ['a', 'b'] } */\nexport const swcAppRouteQueryParamsObject = queryParam('swcAppRouteQueryParamsObject');\n/** URLSearchParams 그대로 */\nexport const swcAppRouteURLSearchParams = queryParam('swcAppRouteURLSearchParams');\n\n/** '/a/{id}/b/{id}' ← '/a/1/b/2' → @swcAppRoutePathVariable('id') = '1' · 필드: @swcAppRoutePathVariable('id', { path: '/a/{id}/b/{id}' }) */\nexport const swcAppRoutePathVariable = keyedPathParam('swcAppRoutePathVariable');\n/** = swcAppRoutePathVariable */\nexport const swcAppRouteFirstPathVariable = keyedPathParam('swcAppRouteFirstPathVariable');\n/** → '2' */\nexport const swcAppRouteLastPathVariable = keyedPathParam('swcAppRouteLastPathVariable');\n/** → ['1', '2'] */\nexport const swcAppRoutePathVariables = keyedPathParam('swcAppRoutePathVariables');\n/** → { id: '1' } · 필드: @swcAppRoutePathVariableObject({ path: '/a/{id}/b/{id}' }) */\nexport const swcAppRoutePathVariableObject = pathParam('swcAppRoutePathVariableObject');\n/** = swcAppRoutePathVariableObject */\nexport const swcAppRouteFirstPathVariableObject = pathParam('swcAppRouteFirstPathVariableObject');\n/** → { id: '2' } */\nexport const swcAppRouteLastPathVariableObject = pathParam('swcAppRouteLastPathVariableObject');\n/** → { id: ['1', '2'] } */\nexport const swcAppRoutePathVariablesObject = pathParam('swcAppRoutePathVariablesObject');\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAwD,sBAAsB,oBAAoB;AAClG,SAA8C,yBAAyB;AACvE,SAAyB,aAAa,wBAAwB;AAuB9D,MAAM,6BAA6B,OAAO,IAAI,gCAAgC;AAK9E,MAAM,gBAAgB,CAAC,MAAoB,QAAgB,aAA0C,gBAAwB,QAAa;AACxI,MAAI,CAAC;AAAa;AAClB,QAAM,cAAc,OAAO;AAC3B,QAAM,QAAS,aAAa,eAAe,4BAA4B,aAAa,WAAW,KAAK,CAAA;AACpG,QAAM,KAAK,QAAQ,SAAY,EAAE,OAAO,gBAAgB,KAAI,IAAK,EAAE,OAAO,gBAAgB,MAAM,IAAG,CAAE;AACrG,eAAa,eAAe,4BAA4B,OAAO,aAAa,WAAW;AACzF;AAGM,SAAU,YAAY,QAAgB,aAA8B,gBAAsB;AAC9F,gBAAc,eAAe,QAAQ,aAAa,cAAc;AAClE;AAGM,SAAU,eAAe,QAAgB,aAA8B,gBAAsB;AACjG,gBAAc,kBAAkB,QAAQ,aAAa,cAAc;AACrE;AAGM,SAAU,QAAQ,QAAgB,aAA8B,gBAAsB;AAC1F,gBAAc,WAAW,QAAQ,aAAa,cAAc;AAC9D;AAGM,SAAU,cAAc,QAAgB,aAA8B,gBAAsB;AAChG,gBAAc,iBAAiB,QAAQ,aAAa,cAAc;AACpE;AAGM,SAAU,UAAU,QAAgB,aAA8B,gBAAsB;AAC5F,gBAAc,aAAa,QAAQ,aAAa,cAAc;AAChE;AAGM,SAAU,kB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