@dooboostore/simple-web-component 1.0.50 → 1.0.51
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 +735 -354
- package/dist/cjs/SwcAppEngine.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js +64 -146
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +36 -48
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +9 -12
- package/dist/cjs/decorators/applyClass.js.map +2 -2
- package/dist/cjs/decorators/applyNode.js +14 -22
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +12 -42
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applySlot.js +3 -3
- package/dist/cjs/decorators/applySlot.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +9 -12
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/around.js +124 -0
- package/dist/cjs/decorators/around.js.map +7 -0
- package/dist/cjs/decorators/changedAttribute.js +40 -12
- package/dist/cjs/decorators/changedAttribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +224 -195
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +14 -12
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/eventMedia.js +36 -8
- package/dist/cjs/decorators/eventMedia.js.map +2 -2
- package/dist/cjs/decorators/fetch.js +278 -0
- package/dist/cjs/decorators/fetch.js.map +7 -0
- package/dist/cjs/decorators/index.js +5 -2
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/intersectionObserver.js +33 -13
- package/dist/cjs/decorators/intersectionObserver.js.map +2 -2
- package/dist/cjs/decorators/lifecycles.js +11 -11
- package/dist/cjs/decorators/lifecycles.js.map +2 -2
- package/dist/cjs/decorators/mutationObserver.js +55 -39
- package/dist/cjs/decorators/mutationObserver.js.map +3 -3
- package/dist/cjs/decorators/parameter.js +92 -9
- package/dist/cjs/decorators/parameter.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +2 -2
- package/dist/cjs/decorators/query.js +11 -5
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/requestAnimationFrame.js +7 -16
- package/dist/cjs/decorators/requestAnimationFrame.js.map +2 -2
- package/dist/cjs/decorators/resizeObserver.js +41 -17
- package/dist/cjs/decorators/resizeObserver.js.map +3 -3
- package/dist/cjs/decorators/setInterval.js +36 -25
- package/dist/cjs/decorators/setInterval.js.map +2 -2
- package/dist/cjs/decorators/setTimeout.js +36 -25
- package/dist/cjs/decorators/setTimeout.js.map +2 -2
- package/dist/cjs/decorators/state.js +13 -10
- package/dist/cjs/decorators/state.js.map +2 -2
- package/dist/cjs/decorators/{subscribeSwcAppMessageWhileConnected.js → subscribeSwcAppMessage.js} +20 -21
- package/dist/cjs/decorators/subscribeSwcAppMessage.js.map +7 -0
- package/dist/cjs/decorators/{subscribeSwcAppRouteChangeWhileConnected.js → subscribeSwcAppRouteChange.js} +23 -19
- package/dist/cjs/decorators/subscribeSwcAppRouteChange.js.map +7 -0
- package/dist/cjs/decorators/swcAppRoute.js +149 -0
- package/dist/cjs/decorators/swcAppRoute.js.map +7 -0
- package/dist/cjs/elements/SwcApp.js +70 -0
- package/dist/cjs/elements/SwcApp.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +256 -83
- package/dist/cjs/elements/SwcAppMixin.js.map +3 -3
- package/dist/cjs/types/index.js +5 -1
- package/dist/cjs/types/index.js.map +2 -2
- package/dist/cjs/utils/Utils.js +36 -15
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/SwcAppEngine.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +64 -146
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +36 -48
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +9 -12
- package/dist/esm/decorators/applyClass.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +15 -23
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +12 -42
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applySlot.js +3 -3
- package/dist/esm/decorators/applySlot.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +9 -12
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/around.js +105 -0
- package/dist/esm/decorators/around.js.map +7 -0
- package/dist/esm/decorators/changedAttribute.js +40 -12
- package/dist/esm/decorators/changedAttribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +222 -193
- package/dist/esm/decorators/elementDefine.js.map +3 -3
- package/dist/esm/decorators/emitCustomEvent.js +15 -13
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/eventMedia.js +36 -8
- package/dist/esm/decorators/eventMedia.js.map +2 -2
- package/dist/esm/decorators/fetch.js +259 -0
- package/dist/esm/decorators/fetch.js.map +7 -0
- package/dist/esm/decorators/index.js +5 -2
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/intersectionObserver.js +33 -13
- package/dist/esm/decorators/intersectionObserver.js.map +2 -2
- package/dist/esm/decorators/lifecycles.js +11 -11
- package/dist/esm/decorators/lifecycles.js.map +2 -2
- package/dist/esm/decorators/mutationObserver.js +55 -39
- package/dist/esm/decorators/mutationObserver.js.map +3 -3
- package/dist/esm/decorators/parameter.js +92 -9
- package/dist/esm/decorators/parameter.js.map +2 -2
- package/dist/esm/decorators/publishSwcAppMessage.js +2 -2
- package/dist/esm/decorators/publishSwcAppMessage.js.map +2 -2
- package/dist/esm/decorators/query.js +11 -5
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/requestAnimationFrame.js +8 -17
- package/dist/esm/decorators/requestAnimationFrame.js.map +2 -2
- package/dist/esm/decorators/resizeObserver.js +41 -17
- package/dist/esm/decorators/resizeObserver.js.map +2 -2
- package/dist/esm/decorators/setInterval.js +37 -26
- package/dist/esm/decorators/setInterval.js.map +2 -2
- package/dist/esm/decorators/setTimeout.js +37 -26
- package/dist/esm/decorators/setTimeout.js.map +2 -2
- package/dist/esm/decorators/state.js +13 -10
- package/dist/esm/decorators/state.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppMessage.js +53 -0
- package/dist/esm/decorators/subscribeSwcAppMessage.js.map +7 -0
- package/dist/esm/decorators/{subscribeSwcAppRouteChangeWhileConnected.js → subscribeSwcAppRouteChange.js} +20 -16
- package/dist/esm/decorators/subscribeSwcAppRouteChange.js.map +7 -0
- package/dist/esm/decorators/swcAppRoute.js +130 -0
- package/dist/esm/decorators/swcAppRoute.js.map +7 -0
- package/dist/esm/elements/SwcApp.js +70 -0
- package/dist/esm/elements/SwcApp.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +258 -85
- package/dist/esm/elements/SwcAppMixin.js.map +3 -3
- package/dist/esm/types/index.js +5 -1
- package/dist/esm/types/index.js.map +2 -2
- package/dist/esm/utils/Utils.js +36 -15
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +1886 -999
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/SwcAppEngine.d.ts +1 -0
- package/dist/types/SwcAppEngine.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +923 -960
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +26 -38
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +1 -3
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +15 -17
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +25 -45
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +1 -3
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/around.d.ts +87 -0
- package/dist/types/decorators/around.d.ts.map +1 -0
- package/dist/types/decorators/changedAttribute.d.ts +21 -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/emitCustomEvent.d.ts +0 -1
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/eventMedia.d.ts +24 -1
- package/dist/types/decorators/eventMedia.d.ts.map +1 -1
- package/dist/types/decorators/fetch.d.ts +139 -0
- package/dist/types/decorators/fetch.d.ts.map +1 -0
- package/dist/types/decorators/index.d.ts +5 -2
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/intersectionObserver.d.ts +24 -11
- package/dist/types/decorators/intersectionObserver.d.ts.map +1 -1
- package/dist/types/decorators/lifecycles.d.ts +8 -7
- package/dist/types/decorators/lifecycles.d.ts.map +1 -1
- package/dist/types/decorators/mutationObserver.d.ts +26 -13
- package/dist/types/decorators/mutationObserver.d.ts.map +1 -1
- package/dist/types/decorators/parameter.d.ts +84 -6
- package/dist/types/decorators/parameter.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +0 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +7 -7
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/requestAnimationFrame.d.ts +1 -1
- package/dist/types/decorators/requestAnimationFrame.d.ts.map +1 -1
- package/dist/types/decorators/resizeObserver.d.ts +26 -13
- package/dist/types/decorators/resizeObserver.d.ts.map +1 -1
- package/dist/types/decorators/setInterval.d.ts +10 -0
- package/dist/types/decorators/setInterval.d.ts.map +1 -1
- package/dist/types/decorators/setTimeout.d.ts +10 -0
- package/dist/types/decorators/setTimeout.d.ts.map +1 -1
- package/dist/types/decorators/state.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppMessage.d.ts +44 -0
- package/dist/types/decorators/subscribeSwcAppMessage.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts +60 -0
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts.map +1 -0
- package/dist/types/decorators/swcAppRoute.d.ts +94 -0
- package/dist/types/decorators/swcAppRoute.d.ts.map +1 -0
- package/dist/types/elements/SwcApp.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +423 -388
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +43 -4
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +15 -5
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +1886 -999
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +8 -6
- package/src/SwcAppEngine.ts +1 -0
- package/src/decorators/addEventListener.ts +102 -96
- package/src/decorators/applyAttribute.ts +76 -138
- package/src/decorators/applyClass.ts +8 -14
- package/src/decorators/applyNode.ts +33 -41
- package/src/decorators/applyProperty.ts +51 -99
- package/src/decorators/applySlot.ts +3 -3
- package/src/decorators/applyStyle.ts +8 -14
- package/src/decorators/around.ts +196 -0
- package/src/decorators/changedAttribute.ts +39 -15
- package/src/decorators/elementDefine.ts +270 -219
- package/src/decorators/emitCustomEvent.ts +17 -13
- package/src/decorators/eventMedia.ts +50 -9
- package/src/decorators/fetch.ts +454 -0
- package/src/decorators/index.ts +5 -2
- package/src/decorators/intersectionObserver.ts +38 -24
- package/src/decorators/lifecycles.ts +24 -22
- package/src/decorators/mutationObserver.ts +71 -52
- package/src/decorators/parameter.ts +145 -14
- package/src/decorators/publishSwcAppMessage.ts +3 -4
- package/src/decorators/query.ts +22 -14
- package/src/decorators/requestAnimationFrame.ts +10 -19
- package/src/decorators/resizeObserver.ts +50 -29
- package/src/decorators/setInterval.ts +37 -26
- package/src/decorators/setTimeout.ts +37 -26
- package/src/decorators/state.ts +19 -13
- package/src/decorators/subscribeSwcAppMessage.ts +106 -0
- package/src/decorators/subscribeSwcAppRouteChange.ts +131 -0
- package/src/decorators/swcAppRoute.ts +231 -0
- package/src/elements/SwcApp.ts +40 -10
- package/src/elements/SwcAppMixin.ts +330 -101
- package/src/types/index.ts +38 -5
- package/src/utils/Utils.ts +50 -18
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +0 -7
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +0 -7
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +0 -54
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +0 -7
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +0 -7
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +0 -23
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +0 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +0 -31
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +0 -1
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +0 -91
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +0 -107
|
@@ -26,16 +26,9 @@ module.exports = __toCommonJS(setTimeout_exports);
|
|
|
26
26
|
var import_core = require("@dooboostore/core");
|
|
27
27
|
var import_elementDefine = require("./elementDefine");
|
|
28
28
|
var import_Utils = require("../utils/Utils");
|
|
29
|
+
var import_parameter = require("./parameter");
|
|
29
30
|
const SET_TIMEOUT_METADATA_KEY = Symbol.for("simple-web-component:set-timeout");
|
|
30
|
-
const
|
|
31
|
-
const getActiveEntries = (inst) => {
|
|
32
|
-
let entries = activeMap.get(inst);
|
|
33
|
-
if (!entries) {
|
|
34
|
-
entries = [];
|
|
35
|
-
activeMap.set(inst, entries);
|
|
36
|
-
}
|
|
37
|
-
return entries;
|
|
38
|
-
};
|
|
31
|
+
const getActiveEntries = (inst) => inst.__swc_timeoutIds ?? (inst.__swc_timeoutIds = []);
|
|
39
32
|
function setTimeout(delay, options = {}) {
|
|
40
33
|
return (target, propertyKey, descriptor) => {
|
|
41
34
|
const constructor = target.constructor;
|
|
@@ -56,8 +49,7 @@ function setTimeout(delay, options = {}) {
|
|
|
56
49
|
const tickFn = typeof res === "function" ? res : res && typeof res === "object" && typeof res[vk] === "function" ? res[vk] : void 0;
|
|
57
50
|
if (tickFn) {
|
|
58
51
|
(0, import_elementDefine.ensureInit)(this);
|
|
59
|
-
const
|
|
60
|
-
const win = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
|
|
52
|
+
const win = import_Utils.SwcUtils.resolveWindow(this);
|
|
61
53
|
const id = win.setTimeout(() => {
|
|
62
54
|
const entries = getActiveEntries(this);
|
|
63
55
|
const idx = entries.indexOf(id);
|
|
@@ -68,7 +60,7 @@ function setTimeout(delay, options = {}) {
|
|
|
68
60
|
console.error("[SWC] setTimeout fire error:", e);
|
|
69
61
|
}
|
|
70
62
|
}, delay);
|
|
71
|
-
normalizedOptions.created?.(import_Utils.SwcUtils.getHelperAndHostSet(
|
|
63
|
+
normalizedOptions.created?.(import_Utils.SwcUtils.getHelperAndHostSet(this), id);
|
|
72
64
|
getActiveEntries(this).push(id);
|
|
73
65
|
}
|
|
74
66
|
return res;
|
|
@@ -77,26 +69,45 @@ function setTimeout(delay, options = {}) {
|
|
|
77
69
|
};
|
|
78
70
|
}
|
|
79
71
|
const findAllSetTimeoutMetadata = (target) => {
|
|
80
|
-
const constructor = target
|
|
72
|
+
const constructor = typeof target === "function" ? target : target.constructor;
|
|
81
73
|
return (import_core.ReflectUtils.findAllMetadata(SET_TIMEOUT_METADATA_KEY, constructor) || []).flat();
|
|
82
74
|
};
|
|
83
75
|
class SetTimeoutLifeCycler {
|
|
84
76
|
onConnected(helperHostSet) {
|
|
85
77
|
const inst = helperHostSet.$this;
|
|
86
|
-
|
|
78
|
+
inst.__swc_timeoutIds = [];
|
|
87
79
|
for (const meta of findAllSetTimeoutMetadata(inst)) {
|
|
88
80
|
if (meta.options.type !== "onConnected") continue;
|
|
89
81
|
const id = helperHostSet.$w.setTimeout(() => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
void (async () => {
|
|
83
|
+
const helper = import_Utils.SwcUtils.getHelperAndHostSet(inst);
|
|
84
|
+
if (meta.options.filter && !await meta.options.filter(helper)) return;
|
|
85
|
+
const paramArgs = meta.options.parameter?.(helperHostSet) ?? [];
|
|
86
|
+
const hostSet = import_Utils.SwcUtils.getHostSet(inst);
|
|
87
|
+
const helperSet = import_Utils.SwcUtils.getHelperSet(helperHostSet.$w);
|
|
88
|
+
const buildArgs = (beforeReturn) => (0, import_parameter.buildSwcParameterArgs)(inst, meta.propertyKey, {
|
|
89
|
+
hostSet,
|
|
90
|
+
helperHostSet: helper,
|
|
91
|
+
helperSet,
|
|
92
|
+
setTimeoutBeforeReturn: beforeReturn
|
|
93
|
+
}, [...paramArgs, beforeReturn]);
|
|
94
|
+
let args = buildArgs(void 0);
|
|
95
|
+
if (meta.options.before) {
|
|
96
|
+
const br = await meta.options.before(helper);
|
|
97
|
+
args = buildArgs(br);
|
|
98
|
+
}
|
|
99
|
+
let result, error;
|
|
100
|
+
try {
|
|
101
|
+
result = await inst[meta.propertyKey](...args);
|
|
102
|
+
const vk = meta.options.valueKey ?? SET_TIMEOUT_METADATA_KEY;
|
|
103
|
+
if (result && typeof result === "object" && typeof result[vk] === "function") result[vk](id);
|
|
104
|
+
} catch (e) {
|
|
105
|
+
error = e;
|
|
106
|
+
} finally {
|
|
107
|
+
if (meta.options.finally) await meta.options.finally(helper, { args, result, error });
|
|
96
108
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
109
|
+
if (error) console.error("[SWC] setTimeout fire error:", error);
|
|
110
|
+
})().catch((e) => console.error("[SWC] setTimeout fire error:", e));
|
|
100
111
|
}, meta.delay);
|
|
101
112
|
meta.options.created?.(helperHostSet, id);
|
|
102
113
|
getActiveEntries(inst).push(id);
|
|
@@ -104,14 +115,14 @@ class SetTimeoutLifeCycler {
|
|
|
104
115
|
}
|
|
105
116
|
onDisconnected(helperHostSet) {
|
|
106
117
|
const inst = helperHostSet.$this;
|
|
107
|
-
for (const id of
|
|
118
|
+
for (const id of inst.__swc_timeoutIds ?? []) {
|
|
108
119
|
try {
|
|
109
120
|
helperHostSet.$w.clearTimeout(id);
|
|
110
121
|
} catch (e) {
|
|
111
122
|
console.error("[SWC] clearTimeout error:", e);
|
|
112
123
|
}
|
|
113
124
|
}
|
|
114
|
-
|
|
125
|
+
inst.__swc_timeoutIds = [];
|
|
115
126
|
}
|
|
116
127
|
}
|
|
117
128
|
//# sourceMappingURL=setTimeout.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/setTimeout.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAC7B,
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { buildSwcParameterArgs } from './parameter';\nimport { ElementDefineLifeCycler, HelperHostSet } from '../types';\n\nexport const SET_TIMEOUT_METADATA_KEY = Symbol.for('simple-web-component:set-timeout');\n\nexport type SetTimeoutType = 'onConnected' | 'returnValue';\n\nexport interface SetTimeoutOptions {\n /**\n * 'onConnected' (connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uC608\uC57D, disconnect \uC2DC \uC790\uB3D9 \uC815\uB9AC) |\n * 'returnValue' (\uAE30\uBCF8\uAC12 - \uC790\uB3D9 \uC608\uC57D \uC5C6\uC74C. \uAC1C\uBC1C\uC790\uAC00 \uC774 \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC608\uC57D\uB418\uACE0,\n * \uADF8 \uD638\uCD9C\uC758 \uB9AC\uD134\uAC12\uC774 \uC2E4\uC81C\uB85C \uC2E4\uD589\uB420 \uD568\uC218\uAC00 \uB41C\uB2E4 - \uC544\uB798 \uC124\uBA85 \uCC38\uACE0).\n */\n type?: SetTimeoutType;\n /** \uC2E4\uD589 \uC2DC \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uC5D0 \uB118\uAE38 \uC778\uC790\uB97C \uACC4\uC0B0. type:'onConnected'\uC5D0\uC11C\uB9CC \uC758\uBBF8\uAC00 \uC788\uC74C (\uC5C6\uC73C\uBA74 \uC778\uC790 \uC5C6\uC774 \uD638\uCD9C). */\n parameter?: (set: HelperHostSet) => any[];\n /** \uD0C0\uC774\uBA38 \uB4F1\uB85D \uC9C1\uD6C4 1\uD68C \uD638\uCD9C (\uB514\uBC84\uAE45/\uB85C\uAE45\uC6A9). id\uB294 \uC2E4\uC81C setTimeout \uBC18\uD658\uAC12 - cleanup\uC740 \uC790\uB3D9\uC73C\uB85C \uCC98\uB9AC\uB418\uBBC0\uB85C \uC9C1\uC811 clear\uD560 \uD544\uC694 \uC5C6\uC74C. */\n created?: (set: HelperHostSet, id: number) => void;\n /** [type:'onConnected' \uC804\uC6A9] \uBC1C\uD654 \uC5EC\uBD80 \uAC8C\uC774\uD2B8. Promise<boolean>\uB3C4 \uAC00\uB2A5. false\uBA74 \uC2A4\uD0B5. */\n filter?: (set: HelperHostSet) => boolean | Promise<boolean>;\n /** [type:'onConnected' \uC804\uC6A9] \uD578\uB4E4\uB7EC \uC9C1\uC804 \uD6C5. await\uB418\uACE0, \uB9AC\uD134\uAC12\uC740 @setTimeoutBeforeReturn \uC73C\uB85C \uC8FC\uC785\uB41C\uB2E4. */\n before?: (set: HelperHostSet) => any | Promise<any>;\n /** [type:'onConnected' \uC804\uC6A9] \uD578\uB4E4\uB7EC\uAC00 \uC131\uACF5/\uC2E4\uD328\uD574\uB3C4 \uD56D\uC0C1 \uC2E4\uD589\uB418\uB294 \uC815\uB9AC \uD6C5. ctx\uB85C \uC778\uC790/\uACB0\uACFC/\uC5D0\uB7EC. */\n finally?: (set: HelperHostSet, ctx: { args: any[]; result?: any; error?: any }) => any | Promise<any>;\n /**\n * type:'onConnected' - fire \uC2DC \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uC758 \uB9AC\uD134\uAC12\uC774 \uAC1D\uCCB4\uC774\uACE0 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC774\uBA74 (id: number)\uB85C \uD638\uCD9C\uD55C\uB2E4.\n * type:'returnValue' - \uB9AC\uD134\uAC12\uC774 \uD568\uC218\uBA74 \uADF8 \uC790\uCCB4\uB97C, \uAC1D\uCCB4\uBA74 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC77C \uB54C \uADF8 \uAC12\uC744 \"\uC2E4\uC81C\uB85C \uC2E4\uD589\uB420 \uD568\uC218\"\uB85C \uC0AC\uC6A9\uD55C\uB2E4.\n * \uC548 \uC8FC\uBA74 SET_TIMEOUT_METADATA_KEY\uB85C \uD3F4\uBC31\uD55C\uB2E4 - applyAttribute.ts/applyNode.ts\uC758 valueKey\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158\n * (\uB9AC\uD134 \uAC1D\uCCB4\uC5D0\uC11C \uC774 \uB370\uCF54\uB808\uC774\uD130 \uBAAB\uB9CC \uBF51\uC544 \uC4F0\uACE0, \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uC2A4\uD0DD\uD560 \uB54C\uB9CC \uCEE4\uC2A4\uD140 \uD0A4\uB85C \uAD6C\uBD84\uD558\uBA74 \uB41C\uB2E4).\n */\n valueKey?: symbol | string;\n}\n\nexport interface SetTimeoutMetadata {\n propertyKey: string | symbol;\n delay: number;\n options: SetTimeoutOptions;\n}\n\nconst getActiveEntries = (inst: any): number[] => (inst.__swc_timeoutIds ??= []);\n\n/**\n * type:'onConnected' - connect \uC2DC \uC790\uB3D9\uC73C\uB85C setTimeout\uC744 \uAC78\uACE0, disconnect \uC2DC (\uC544\uC9C1 \uC2E4\uD589 \uC804\uC774\uB77C\uBA74) \uC790\uB3D9\uC73C\uB85C clearTimeout \uD55C\uB2E4.\n * type:'returnValue'(\uAE30\uBCF8\uAC12) - \uBA54\uC11C\uB4DC\uB97C \uAC10\uC2F8\uC9C0 \uC54A\uB294 \uB300\uC2E0, \uD638\uCD9C\uB420 \uB54C\uB9C8\uB2E4(\uAC1C\uBC1C\uC790\uAC00 \uC9C1\uC811 \uD638\uCD9C) \uC6D0\uBCF8 \uB85C\uC9C1\uC744\n * \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uACE0 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uD568\uC218\uBA74 \uADF8 \uD568\uC218\uB97C \uC0C8 setTimeout\uC73C\uB85C \uC608\uC57D\uD55C\uB2E4.\n * \uD638\uCD9C\uD560 \uB54C\uB9C8\uB2E4 \uBCC4\uB3C4\uC758 \uC0C8 \uD0C0\uC774\uBA38\uAC00 \uC0DD\uAE30\uBA70, disconnect \uC2DC (\uC544\uC9C1 \uC2E4\uD589 \uC804\uC778 \uAC83\uB4E4\uC740) \uC804\uBD80 \uC815\uB9AC\uB41C\uB2E4.\n * \uC6D0\uBCF8 \uB9AC\uD134\uAC12\uC740 \uADF8\uB300\uB85C \uD1B5\uACFC\uC2DC\uD0A4\uBBC0\uB85C \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0 \uC2A4\uD0DD\uD574\uB3C4 \uC21C\uC11C\uC5D0 \uC0C1\uAD00\uC5C6\uC774 \uC548\uC804\uD558\uB2E4.\n */\nexport function setTimeout(delay: number, options: SetTimeoutOptions = {}): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n const normalizedOptions: SetTimeoutOptions = { ...options, type: options.type ?? 'returnValue' };\n\n let metaList = ReflectUtils.getOwnMetadata(SET_TIMEOUT_METADATA_KEY, constructor) as SetTimeoutMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(SET_TIMEOUT_METADATA_KEY, metaList, constructor);\n }\n metaList.push({ propertyKey, delay, options: normalizedOptions });\n\n if (normalizedOptions.type === 'onConnected' || !descriptor) {\n return; // LifeCycler\uAC00 connect/disconnect\uB97C \uC804\uB2F4 - wrapping \uBD88\uD544\uC694\n }\n\n const original = descriptor.value;\n descriptor.value = function (this: any, ...args: any[]) {\n const res = original.apply(this, args);\n // valueKey\uB97C \uC548 \uC8FC\uBA74 \uC774 \uB370\uCF54\uB808\uC774\uD130 \uC804\uC6A9 METADATA_KEY\uB85C \uD3F4\uBC31 (applyAttribute.ts/applyNode.ts\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158)\n const vk = normalizedOptions.valueKey ?? SET_TIMEOUT_METADATA_KEY;\n const tickFn: ((id: number) => void) | undefined =\n typeof res === 'function' ? res : res && typeof res === 'object' && typeof res[vk] === 'function' ? res[vk] : undefined;\n\n if (tickFn) {\n ensureInit(this);\n const win = SwcUtils.resolveWindow(this);\n const id = win.setTimeout(() => {\n const entries = getActiveEntries(this);\n const idx = entries.indexOf(id);\n if (idx >= 0) entries.splice(idx, 1);\n try {\n tickFn(id);\n } catch (e) {\n console.error('[SWC] setTimeout fire error:', e);\n }\n }, delay);\n normalizedOptions.created?.(SwcUtils.getHelperAndHostSet(this), id);\n getActiveEntries(this).push(id);\n }\n return res;\n };\n return descriptor;\n };\n}\n\nexport const findAllSetTimeoutMetadata = (target: any): SetTimeoutMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return (ReflectUtils.findAllMetadata<SetTimeoutMetadata[]>(SET_TIMEOUT_METADATA_KEY, constructor) || []).flat();\n};\n\nexport class SetTimeoutLifeCycler implements ElementDefineLifeCycler {\n onConnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n inst.__swc_timeoutIds = []; // \uC7AC\uC5F0\uACB0 \uB300\uBE44 \uB9AC\uC14B\n for (const meta of findAllSetTimeoutMetadata(inst)) {\n if (meta.options.type !== 'onConnected') continue; // returnValue \uD0C0\uC785\uC740 \uC218\uB3D9 \uD638\uCD9C\uC744 \uAE30\uB2E4\uB9BC\n const id = helperHostSet.$w.setTimeout(() => {\n void (async () => {\n const helper = SwcUtils.getHelperAndHostSet(inst);\n if (meta.options.filter && !(await meta.options.filter(helper))) return;\n const paramArgs = meta.options.parameter?.(helperHostSet) ?? [];\n const hostSet = SwcUtils.getHostSet(inst);\n const helperSet = SwcUtils.getHelperSet(helperHostSet.$w);\n const buildArgs = (beforeReturn: any) => buildSwcParameterArgs(inst, meta.propertyKey, {\n hostSet, helperHostSet: helper, helperSet, setTimeoutBeforeReturn: beforeReturn\n }, [...paramArgs, beforeReturn]);\n let args = buildArgs(undefined);\n if (meta.options.before) { const br = await meta.options.before(helper); args = buildArgs(br); }\n let result: any, error: any;\n try {\n result = await inst[meta.propertyKey](...args);\n const vk = meta.options.valueKey ?? SET_TIMEOUT_METADATA_KEY;\n if (result && typeof result === 'object' && typeof result[vk] === 'function') result[vk](id);\n } catch (e) {\n error = e;\n } finally {\n if (meta.options.finally) await meta.options.finally(helper, { args, result, error });\n }\n if (error) console.error('[SWC] setTimeout fire error:', error);\n })().catch(e => console.error('[SWC] setTimeout fire error:', e));\n }, meta.delay);\n meta.options.created?.(helperHostSet, id);\n getActiveEntries(inst).push(id);\n }\n }\n\n onDisconnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n for (const id of inst.__swc_timeoutIds ?? []) {\n try {\n helperHostSet.$w.clearTimeout(id);\n } catch (e) {\n console.error('[SWC] clearTimeout error:', e);\n }\n }\n inst.__swc_timeoutIds = [];\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAC7B,2BAA2B;AAC3B,mBAAyB;AACzB,uBAAsC;AAG/B,MAAM,2BAA2B,OAAO,IAAI,kCAAkC;AAoCrF,MAAM,mBAAmB,CAAC,SAAyB,KAAK,qBAAL,KAAK,mBAAqB,CAAC;AASvE,SAAS,WAAW,OAAe,UAA6B,CAAC,GAAoB;AAC1F,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,OAAO;AAC3B,UAAM,oBAAuC,EAAE,GAAG,SAAS,MAAM,QAAQ,QAAQ,cAAc;AAE/F,QAAI,WAAW,yBAAa,eAAe,0BAA0B,WAAW;AAChF,QAAI,CAAC,UAAU;AACb,iBAAW,CAAC;AACZ,+BAAa,eAAe,0BAA0B,UAAU,WAAW;AAAA,IAC7E;AACA,aAAS,KAAK,EAAE,aAAa,OAAO,SAAS,kBAAkB,CAAC;AAEhE,QAAI,kBAAkB,SAAS,iBAAiB,CAAC,YAAY;AAC3D;AAAA,IACF;AAEA,UAAM,WAAW,WAAW;AAC5B,eAAW,QAAQ,YAAwB,MAAa;AACtD,YAAM,MAAM,SAAS,MAAM,MAAM,IAAI;AAErC,YAAM,KAAK,kBAAkB,YAAY;AACzC,YAAM,SACJ,OAAO,QAAQ,aAAa,MAAM,OAAO,OAAO,QAAQ,YAAY,OAAO,IAAI,EAAE,MAAM,aAAa,IAAI,EAAE,IAAI;AAEhH,U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("@dooboostore/core");
|
|
26
26
|
var import_core_web = require("@dooboostore/core-web");
|
|
27
27
|
var import_Utils = require("../utils/Utils");
|
|
28
|
-
var import_elementDefine = require("./elementDefine");
|
|
29
28
|
const STATE_METADATA_KEY = Symbol.for("simple-web-component:state");
|
|
30
29
|
function state(nameOrTarget, propertyKey) {
|
|
31
30
|
const stateDefine = (targetObj, stateMetadata) => {
|
|
32
|
-
|
|
31
|
+
const storageKey = Symbol(`state:${String(stateMetadata.propertyKey)}`);
|
|
33
32
|
Object.defineProperty(targetObj, stateMetadata.propertyKey, {
|
|
34
33
|
set(nv) {
|
|
35
|
-
|
|
36
|
-
const config = (0, import_elementDefine.getElementConfig)(this);
|
|
34
|
+
this[storageKey] = nv;
|
|
37
35
|
const ea = new import_core_web.ElementApply(this, { id: this._swcId });
|
|
38
|
-
const helperHostSet = import_Utils.SwcUtils.getHelperAndHostSet(
|
|
36
|
+
const helperHostSet = import_Utils.SwcUtils.getHelperAndHostSet(this);
|
|
39
37
|
const stateContext = { ...helperHostSet };
|
|
40
38
|
findAllStateMetadata(this).forEach((it) => {
|
|
41
39
|
stateContext[it.name] = this[it.propertyKey];
|
|
@@ -43,7 +41,12 @@ function state(nameOrTarget, propertyKey) {
|
|
|
43
41
|
ea.apply({ context: stateContext, targetVariableName: stateMetadata.name, bind: this });
|
|
44
42
|
},
|
|
45
43
|
get() {
|
|
46
|
-
|
|
44
|
+
const own = Object.getOwnPropertyDescriptor(this, stateMetadata.propertyKey);
|
|
45
|
+
if (own && "value" in own) {
|
|
46
|
+
delete this[stateMetadata.propertyKey];
|
|
47
|
+
this[storageKey] = own.value;
|
|
48
|
+
}
|
|
49
|
+
return this[storageKey];
|
|
47
50
|
},
|
|
48
51
|
enumerable: true,
|
|
49
52
|
configurable: true
|
|
@@ -53,7 +56,7 @@ function state(nameOrTarget, propertyKey) {
|
|
|
53
56
|
const targetObj = nameOrTarget;
|
|
54
57
|
const name = String(propertyKey);
|
|
55
58
|
const constructor = targetObj.constructor;
|
|
56
|
-
let states = import_core.ReflectUtils.
|
|
59
|
+
let states = import_core.ReflectUtils.getOwnMetadata(STATE_METADATA_KEY, constructor);
|
|
57
60
|
if (!states) {
|
|
58
61
|
states = [];
|
|
59
62
|
import_core.ReflectUtils.defineMetadata(STATE_METADATA_KEY, states, constructor);
|
|
@@ -66,7 +69,7 @@ function state(nameOrTarget, propertyKey) {
|
|
|
66
69
|
return (targetObj, propertyKey2) => {
|
|
67
70
|
const name = String(nameOrTarget);
|
|
68
71
|
const constructor = targetObj.constructor;
|
|
69
|
-
let states = import_core.ReflectUtils.
|
|
72
|
+
let states = import_core.ReflectUtils.getOwnMetadata(STATE_METADATA_KEY, constructor);
|
|
70
73
|
if (!states) {
|
|
71
74
|
states = [];
|
|
72
75
|
import_core.ReflectUtils.defineMetadata(STATE_METADATA_KEY, states, constructor);
|
|
@@ -77,7 +80,7 @@ function state(nameOrTarget, propertyKey) {
|
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
const findAllStateMetadata = (target) => {
|
|
80
|
-
const constructor = target
|
|
81
|
-
return import_core.ReflectUtils.
|
|
83
|
+
const constructor = typeof target === "function" ? target : target.constructor;
|
|
84
|
+
return import_core.ReflectUtils.findAllMetadata(STATE_METADATA_KEY, constructor).flat();
|
|
82
85
|
};
|
|
83
86
|
//# sourceMappingURL=state.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/state.ts"],
|
|
4
|
-
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {ElementApply} from \"@dooboostore/core-web\";\nimport {SwcUtils} from \"../utils/Utils\";\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAC3B,sBAA2B;AAC3B,mBAAuB;
|
|
4
|
+
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {ElementApply} from \"@dooboostore/core-web\";\nimport {SwcUtils} from \"../utils/Utils\";\n\nexport interface StateMetadata {\n propertyKey: string | symbol;\n name: string;\n}\n\nexport const STATE_METADATA_KEY = Symbol.for('simple-web-component:state');\n\n// export function state(target: SpecialSelector): PropertyDecorator;\n// export function state(): PropertyDecorator;\nexport function state(target: Object, propertyKey: string | symbol): void;\nexport function state(name: string): PropertyDecorator;\n/**\n * Forms (\uBE48 \uAD04\uD638 @state() \uB294 \uD0C0\uC785 \uC5D0\uB7EC):\n * - @state\n * - @state('selector')\n */\nexport function state(nameOrTarget?: string | Object, propertyKey?: string | symbol): any {\n\n const stateDefine = (targetObj: any, stateMetadata: StateMetadata) => {\n\n // around.ts\uC640 \uB3D9\uC77C: \uD074\uB85C\uC800 \uBCC0\uC218\uC5D0 \uB450\uBA74 \uBAA8\uB4E0 \uC778\uC2A4\uD134\uC2A4\uAC00 \uACF5\uC720\uD574\uBC84\uB9AC\uBBC0\uB85C\n // \uC778\uC2A4\uD134\uC2A4 \uC804\uC6A9 Symbol \uC2AC\uB86F\uC5D0 \uC2E4\uC81C \uAC12\uC744 \uB454\uB2E4.\n const storageKey = Symbol(`state:${String(stateMetadata.propertyKey)}`);\n Object.defineProperty(targetObj, stateMetadata.propertyKey, {\n set(this: any, nv: string) {\n this[storageKey] = nv;\n const ea = new ElementApply(this, {id: this._swcId});\n const helperHostSet = SwcUtils.getHelperAndHostSet(this);\n const stateContext: any = {...helperHostSet};\n findAllStateMetadata(this).forEach(it => {\n stateContext[it.name] = this[it.propertyKey]\n })\n ea.apply({context:stateContext, targetVariableName: stateMetadata.name, bind: this});\n },\n get(this: any) {\n // \uC548\uC804\uB9DD: \uD544\uB4DC \uC774\uB2C8\uC15C\uB77C\uC774\uC800\uC758 own property\uAC00 \uB0A8\uC544\uC788\uB2E4\uBA74(ensureInit\uC774 \uC548 \uB3C8\n // \uC77C\uBC18 \uD074\uB798\uC2A4 \uB4F1) \uC2AC\uB86F\uC73C\uB85C \uD68C\uC218\uD55C\uB2E4. setter \uACBD\uC720\uB294 \uC548 \uD568 \u2014 setter\uC758 DOM\n // \uB3D9\uAE30\uD654\uB294 \uCD08\uAE30\uD654 \uC804\uC5D0 \uB3CC\uBA74 \uC548 \uB418\uBBC0\uB85C \uC9C1\uC811 \uC2AC\uB86F\uC5D0 \uB454\uB2E4.\n const own = Object.getOwnPropertyDescriptor(this, stateMetadata.propertyKey);\n if (own && 'value' in own) {\n delete this[stateMetadata.propertyKey];\n this[storageKey] = own.value;\n }\n return this[storageKey];\n },\n enumerable: true,\n configurable: true\n });\n }\n\n // If used as @state (no parentheses), TypeScript will call this function with (target, propertyKey)\n if (typeof nameOrTarget === 'object' && propertyKey) {\n const targetObj = nameOrTarget as Object;\n const name = String(propertyKey);\n const constructor = (targetObj as any).constructor;\n let states = ReflectUtils.getOwnMetadata(STATE_METADATA_KEY, constructor) as StateMetadata[] | undefined;\n if (!states) {\n states = [];\n ReflectUtils.defineMetadata(STATE_METADATA_KEY, states, constructor);\n }\n const stateMetadata = {propertyKey, name};\n states.push(stateMetadata);\n stateDefine(targetObj, stateMetadata);\n return;\n }\n\n // Otherwise return a decorator factory\n return (targetObj: Object, propertyKey: string | symbol): void => {\n const name = String(nameOrTarget);\n const constructor = targetObj.constructor;\n let states = ReflectUtils.getOwnMetadata(STATE_METADATA_KEY, constructor) as StateMetadata[] | undefined;\n if (!states) {\n states = [];\n ReflectUtils.defineMetadata(STATE_METADATA_KEY, states, constructor);\n }\n const stateMetadata = {propertyKey, name};\n states.push(stateMetadata);\n stateDefine(targetObj, stateMetadata);\n };\n}\n\nexport const findAllStateMetadata = (target: any): StateMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.findAllMetadata<any[]>(STATE_METADATA_KEY, constructor).flat();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAC3B,sBAA2B;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ACpC;AAAA,EACF;AAGA,SAAO,CAAC,WAAmBA,iBAAuC;AAChE,UAAM,OAAO,OAAO,YAAY;AAChC,UAAM,cAAc,UAAU;AAC9B,QAAI,SAAS,yBAAa,eAAe,oBAAoB,WAAW;AACxE,QAAI,CAAC,QAAQ;AACX,eAAS,CAAC;AACV,+BAAa,eAAe,oBAAoB,QAAQ,WAAW;AAAA,IACrE;AACA,UAAM,gBAAgB,EAAC,aAAAA,cAAa,KAAI;AACxC,WAAO,KAAK,aAAa;AACzB,gBAAY,WAAW,aAAa;AAAA,EACtC;AACF;AAEO,MAAM,uBAAuB,CAAC,WAAiC;AACpE,QAAM,cAAc,OAAO,WAAW,aAAa,SAAS,OAAO;AACnE,SAAO,yBAAa,gBAAuB,oBAAoB,WAAW,EAAE,KAAK;AACnF;",
|
|
6
6
|
"names": ["propertyKey"]
|
|
7
7
|
}
|
package/dist/cjs/decorators/{subscribeSwcAppMessageWhileConnected.js → subscribeSwcAppMessage.js}
RENAMED
|
@@ -15,35 +15,34 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var subscribeSwcAppMessage_exports = {};
|
|
19
|
+
__export(subscribeSwcAppMessage_exports, {
|
|
20
20
|
MessageSubscribeLifeCycler: () => MessageSubscribeLifeCycler,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY: () => SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY,
|
|
22
|
+
getSubscribeSwcAppMessageMetadata: () => getSubscribeSwcAppMessageMetadata,
|
|
23
23
|
receiveMessage: () => receiveMessage,
|
|
24
|
-
|
|
24
|
+
subscribeSwcAppMessage: () => subscribeSwcAppMessage
|
|
25
25
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
26
|
+
module.exports = __toCommonJS(subscribeSwcAppMessage_exports);
|
|
27
27
|
var import_core = require("@dooboostore/core");
|
|
28
|
-
const
|
|
29
|
-
function
|
|
28
|
+
const SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for("simple-web-component:subscribe-swc-app-message");
|
|
29
|
+
function createSubscribeSwcAppMessage(options, messageType) {
|
|
30
30
|
return (target, propertyKey, descriptor) => {
|
|
31
|
-
const filter = options?.filter;
|
|
32
31
|
const constructor = target.constructor;
|
|
33
|
-
let list = import_core.ReflectUtils.getOwnMetadata(
|
|
32
|
+
let list = import_core.ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY, constructor);
|
|
34
33
|
if (!list) {
|
|
35
34
|
list = [];
|
|
36
|
-
import_core.ReflectUtils.defineMetadata(
|
|
35
|
+
import_core.ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);
|
|
37
36
|
}
|
|
38
|
-
list.push({ propertyKey, messageType, filter });
|
|
37
|
+
list.push({ propertyKey, messageType, filter: options?.filter, before: options?.before, finally: options?.finally, subject: options?.subject, trigger: options?.trigger });
|
|
39
38
|
return descriptor;
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
|
-
function
|
|
41
|
+
function subscribeSwcAppMessage(targetOrMessageTypeOrOptions, optionsOrPropertyKey, descriptor) {
|
|
43
42
|
if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === "object" && optionsOrPropertyKey && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol") && descriptor) {
|
|
44
43
|
const target = targetOrMessageTypeOrOptions;
|
|
45
44
|
const propertyKey = optionsOrPropertyKey;
|
|
46
|
-
return
|
|
45
|
+
return createSubscribeSwcAppMessage({})(target, propertyKey, descriptor);
|
|
47
46
|
}
|
|
48
47
|
let messageType;
|
|
49
48
|
let options = {};
|
|
@@ -55,19 +54,19 @@ function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions, opti
|
|
|
55
54
|
} else if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === "object") {
|
|
56
55
|
options = targetOrMessageTypeOrOptions;
|
|
57
56
|
}
|
|
58
|
-
return
|
|
57
|
+
return createSubscribeSwcAppMessage(options, messageType);
|
|
59
58
|
}
|
|
60
|
-
const receiveMessage =
|
|
61
|
-
const
|
|
62
|
-
const constructor = target
|
|
63
|
-
return import_core.ReflectUtils.
|
|
59
|
+
const receiveMessage = subscribeSwcAppMessage;
|
|
60
|
+
const getSubscribeSwcAppMessageMetadata = (target) => {
|
|
61
|
+
const constructor = typeof target === "function" ? target : target.constructor;
|
|
62
|
+
return import_core.ReflectUtils.findAllMetadata(SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY, constructor).flat();
|
|
64
63
|
};
|
|
65
64
|
class MessageSubscribeLifeCycler {
|
|
66
65
|
onConnected(_helperHostSet) {
|
|
67
66
|
}
|
|
68
67
|
/** SwcAppMixin 이 구독 대상 메타를 꺼낼 때 사용 */
|
|
69
68
|
getMetadata(helperHostSet) {
|
|
70
|
-
return
|
|
69
|
+
return getSubscribeSwcAppMessageMetadata(helperHostSet.$this);
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
//# sourceMappingURL=
|
|
72
|
+
//# sourceMappingURL=subscribeSwcAppMessage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/subscribeSwcAppMessage.ts"],
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { SwcAppMessage, SwcAppMessageSubject, SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';\n\nexport const SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-message');\n\nexport interface SwcAppMessageOptions<Data = any, BeforeReturn = any, Result = any> {\n /** \uBA54\uC2DC\uC9C0 \uC218\uC2E0 \uC2DC \uD578\uB4E4\uB7EC \uC2E4\uD589 \uC5EC\uBD80 \uAC8C\uC774\uD2B8. Promise<boolean>\uB3C4 \uB418\uC5B4 async \uD310\uC815 \uAC00\uB2A5. false\uBA74 \uC2A4\uD0B5. */\n filter?: (message: SwcAppMessage<Data>, currentThis: any) => boolean | Promise<boolean>;\n /** filter \uD1B5\uACFC \uD6C4 \uD578\uB4E4\uB7EC \uC9C1\uC804 \uD6C5. await\uB418\uACE0, \uB9AC\uD134\uAC12\uC740 @appMessageBeforeReturn \uC73C\uB85C \uD578\uB4E4\uB7EC\uC5D0 \uC8FC\uC785\uB41C\uB2E4. */\n before?: (message: SwcAppMessage<Data>, currentThis: any) => BeforeReturn | Promise<BeforeReturn>;\n /** \uD578\uB4E4\uB7EC\uAC00 \uC131\uACF5/\uC2E4\uD328\uD574\uB3C4 \uD56D\uC0C1 \uC2E4\uD589\uB418\uB294 \uC815\uB9AC \uD6C5. ctx\uB85C \uD578\uB4E4\uB7EC \uC778\uC790/\uACB0\uACFC/\uC5D0\uB7EC\uB97C \uBC1B\uB294\uB2E4. \uC5D0\uB7EC\uB294 \uC0BC\uD0A4\uC9C0 \uC54A\uACE0 \uC804\uD30C. */\n finally?: (message: SwcAppMessage<Data>, currentThis: any, ctx: { args: any[]; result?: Result; error?: any }) => any | Promise<any>;\n /**\n * \uB2A6\uAC8C \uC5F0\uACB0\uB41C \uACBD\uC6B0 \uACFC\uAC70 \uBA54\uC2DC\uC9C0 \uC7AC\uC0DD \uBC29\uC2DD. \uC774\uBBF8 \uC5F0\uACB0\uB41C \uAD6C\uB3C5\uC790\uC5D0\uAC8C\uB294 \uD56D\uC0C1 live\uB85C \uC3E8.\n * - \uBBF8\uC9C0\uC815/'subject': live\uB9CC. \uC9C0\uB098\uAC04 \uAC74 \uBABB \uBC1B\uC74C (\uAE30\uBCF8\uAC12, \uAE30\uC874 \uB3D9\uC791)\n * - 'behavior': \uB9C8\uC9C0\uB9C9 1\uAC1C \uC7AC\uC0DD\n * - 'replay': \uBC84\uD37C \uC804\uCCB4 \uC2DC\uAC04\uC21C \uC7AC\uC0DD\n */\n subject?: SwcAppMessageSubject;\n /**\n * \uC7AC\uC0DD \uC2DC\uC810. \uAE30\uBCF8 'connected' (\uC5F0\uACB0 \uC989\uC2DC).\n * - 'connectedDone': \uC5D8\uB9AC\uBA3C\uD2B8 render \uC644\uB8CC \uD6C4 (_connectedDone). @innerHtml \uB4F1\n * DOM \uD0C0\uAC9F\uC774 \uD544\uC694\uD55C \uD578\uB4E4\uB7EC\uB294 \uC774\uAC78\uB85C (replay\uAC00 render\uBCF4\uB2E4 \uBA3C\uC800 \uC640\uC11C \uC99D\uBC1C\uD558\uB294 \uB808\uC774\uC2A4 \uBC29\uC9C0).\n */\n trigger?: 'connected' | 'connectedDone';\n}\n\nexport interface SwcAppMessageSubscriberMetadata extends SwcAppMessageOptions {\n propertyKey: string | symbol;\n messageType?: string;\n}\n\nfunction createSubscribeSwcAppMessage(options?: SwcAppMessageOptions, messageType?: string): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY, constructor) as SwcAppMessageSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, messageType, filter: options?.filter, before: options?.before, finally: options?.finally, subject: options?.subject, trigger: options?.trigger });\n \n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppMessage(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uBA54\uC2DC\uC9C0 \uD0C0\uC785\uB9CC\nexport function subscribeSwcAppMessage(messageType: string): MethodDecorator;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uC635\uC158\uB9CC\nexport function subscribeSwcAppMessage<Data = any, BeforeReturn = any, Result = any>(options: SwcAppMessageOptions<NoInfer<Data>, NoInfer<BeforeReturn>, NoInfer<Result>>): MethodDecorator;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C) - \uBA54\uC2DC\uC9C0 \uD0C0\uC785 + \uC635\uC158\nexport function subscribeSwcAppMessage<Data = any, BeforeReturn = any, Result = any>(messageType: string, options: SwcAppMessageOptions<NoInfer<Data>, NoInfer<BeforeReturn>, NoInfer<Result>>): MethodDecorator;\n\nexport function subscribeSwcAppMessage(targetOrMessageTypeOrOptions?: any, optionsOrPropertyKey?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppMessage\n if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object' && \n optionsOrPropertyKey && (typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') &&\n descriptor) {\n const target = targetOrMessageTypeOrOptions;\n const propertyKey = optionsOrPropertyKey;\n return createSubscribeSwcAppMessage({})(target, propertyKey, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C)\n let messageType: string | undefined;\n let options: SwcAppMessageOptions = {};\n\n if (typeof targetOrMessageTypeOrOptions === 'string') {\n // \uBA54\uC2DC\uC9C0 \uD0C0\uC785 \uC804\uB2EC: @subscribeSwcAppMessage('messageType') \uB610\uB294 @subscribeSwcAppMessage('messageType', options)\n messageType = targetOrMessageTypeOrOptions;\n if (optionsOrPropertyKey && typeof optionsOrPropertyKey === 'object') {\n options = optionsOrPropertyKey;\n }\n } else if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === 'object') {\n // \uC635\uC158\uB9CC \uC804\uB2EC: @subscribeSwcAppMessage({ filter: ... })\n options = targetOrMessageTypeOrOptions;\n }\n\n return createSubscribeSwcAppMessage(options, messageType);\n}\n\nexport const receiveMessage = subscribeSwcAppMessage;\n// Helper function to retrieve message subscribers metadata\nexport const getSubscribeSwcAppMessageMetadata = (target: any): SwcAppMessageSubscriberMetadata[] | undefined => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.findAllMetadata<any[]>(SUBSCRIBE_SWC_APP_MESSAGE_METADATA_KEY, constructor).flat();\n};\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// MessageSubscribeLifeCycler\n// NOTE: \uC2E4\uC81C \uAD6C\uB3C5 \uB85C\uC9C1\uC740 SwcAppMixin._connected \uC5D0\uC11C \uCC98\uB9AC\uB41C\uB2E4.\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nimport { ElementDefineLifeCycler } from '../types';\n\nexport class MessageSubscribeLifeCycler implements ElementDefineLifeCycler {\n onConnected(_helperHostSet: HelperHostSet): void {\n // \uC2E4\uC81C \uAD6C\uB3C5\uC740 SwcAppMixin._connected \uC5D0\uC11C \uCC98\uB9AC\n }\n\n /** SwcAppMixin \uC774 \uAD6C\uB3C5 \uB300\uC0C1 \uBA54\uD0C0\uB97C \uAEBC\uB0BC \uB54C \uC0AC\uC6A9 */\n getMetadata(helperHostSet: HelperHostSet): SwcAppMessageSubscriberMetadata[] | undefined {\n return getSubscribeSwcAppMessageMetadata(helperHostSet.$this);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAGtB,MAAM,yCAAyC,OAAO,IAAI,gDAAgD;AA6BjH,SAAS,6BAA6B,SAAgC,aAAuC;AAC3G,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,yBAAa,eAAe,wCAAwC,WAAW;AAC1F,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,+BAAa,eAAe,wCAAwC,MAAM,WAAW;AAAA,IACvF;AACA,SAAK,KAAK,EAAE,aAAa,aAAa,QAAQ,SAAS,QAAQ,QAAQ,SAAS,QAAQ,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,QAAQ,CAAC;AAEzK,WAAO;AAAA,EACT;AACF;AAWO,SAAS,uBAAuB,8BAAoC,sBAA4B,YAAsC;AAE3I,MAAI,gCAAgC,OAAO,iCAAiC,YACxE,yBAAyB,OAAO,yBAAyB,YAAY,OAAO,yBAAyB,aACrG,YAAY;AACd,UAAM,SAAS;AACf,UAAM,cAAc;AACpB,WAAO,6BAA6B,CAAC,CAAC,EAAE,QAAQ,aAAa,UAAU;AAAA,EACzE;AAGA,MAAI;AACJ,MAAI,UAAgC,CAAC;AAErC,MAAI,OAAO,iCAAiC,UAAU;AAEpD,kBAAc;AACd,QAAI,wBAAwB,OAAO,yBAAyB,UAAU;AACpE,gBAAU;AAAA,IACZ;AAAA,EACF,WAAW,gCAAgC,OAAO,iCAAiC,UAAU;AAE3F,cAAU;AAAA,EACZ;AAEA,SAAO,6BAA6B,SAAS,WAAW;AAC1D;AAEO,MAAM,iBAAiB;AAEvB,MAAM,oCAAoC,CAAC,WAA+D;AAC/G,QAAM,cAAc,OAAO,WAAW,aAAa,SAAS,OAAO;AACnE,SAAO,yBAAa,gBAAuB,wCAAwC,WAAW,EAAE,KAAK;AACvG;AAQO,MAAM,2BAA8D;AAAA,EACzE,YAAY,gBAAqC;AAAA,EAEjD;AAAA;AAAA,EAGA,YAAY,eAA6E;AACvF,WAAO,kCAAkC,cAAc,KAAK;AAAA,EAC9D;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -15,34 +15,35 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var subscribeSwcAppRouteChange_exports = {};
|
|
19
|
+
__export(subscribeSwcAppRouteChange_exports, {
|
|
20
20
|
RouteSubscribeLifeCycler: () => RouteSubscribeLifeCycler,
|
|
21
|
-
|
|
21
|
+
SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY: () => SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY,
|
|
22
22
|
changedRoute: () => changedRoute,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
getSubscribeSwcAppRouteChangeMetadata: () => getSubscribeSwcAppRouteChangeMetadata,
|
|
24
|
+
subscribeSwcAppRouteChange: () => subscribeSwcAppRouteChange,
|
|
25
|
+
subscribeSwcAppRouteChangeConnectedDone: () => subscribeSwcAppRouteChangeConnectedDone
|
|
25
26
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
27
|
+
module.exports = __toCommonJS(subscribeSwcAppRouteChange_exports);
|
|
27
28
|
var import_core = require("@dooboostore/core");
|
|
28
|
-
const
|
|
29
|
-
function
|
|
29
|
+
const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY = Symbol.for("simple-web-component:subscribe-swc-app-route-change");
|
|
30
|
+
function createSubscribeSwcAppRouteChange(options) {
|
|
30
31
|
return (target, propertyKey, descriptor) => {
|
|
31
32
|
const pathPattern = options?.path;
|
|
32
33
|
const filter = options?.filter;
|
|
33
34
|
const constructor = target.constructor;
|
|
34
|
-
let list = import_core.ReflectUtils.getOwnMetadata(
|
|
35
|
+
let list = import_core.ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY, constructor);
|
|
35
36
|
if (!list) {
|
|
36
37
|
list = [];
|
|
37
|
-
import_core.ReflectUtils.defineMetadata(
|
|
38
|
+
import_core.ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY, list, constructor);
|
|
38
39
|
}
|
|
39
40
|
list.push({ propertyKey, options });
|
|
40
41
|
return descriptor;
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function subscribeSwcAppRouteChange(targetOrOptions, propertyKeyOrConfig, descriptor) {
|
|
44
45
|
if (propertyKeyOrConfig && (typeof propertyKeyOrConfig === "string" || typeof propertyKeyOrConfig === "symbol")) {
|
|
45
|
-
return
|
|
46
|
+
return createSubscribeSwcAppRouteChange({})(targetOrOptions, propertyKeyOrConfig, descriptor);
|
|
46
47
|
}
|
|
47
48
|
let options = {};
|
|
48
49
|
if (Array.isArray(targetOrOptions)) {
|
|
@@ -58,12 +59,15 @@ function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKeyOr
|
|
|
58
59
|
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
59
60
|
options = targetOrOptions;
|
|
60
61
|
}
|
|
61
|
-
return
|
|
62
|
+
return createSubscribeSwcAppRouteChange(options);
|
|
62
63
|
}
|
|
63
|
-
const changedRoute =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
const changedRoute = subscribeSwcAppRouteChange;
|
|
65
|
+
function subscribeSwcAppRouteChangeConnectedDone(pathPattern, config) {
|
|
66
|
+
return subscribeSwcAppRouteChange(pathPattern, { ...config, trigger: "connectedDone" });
|
|
67
|
+
}
|
|
68
|
+
const getSubscribeSwcAppRouteChangeMetadata = (target) => {
|
|
69
|
+
const constructor = typeof target === "function" ? target : target.constructor;
|
|
70
|
+
const results = import_core.ReflectUtils.findAllMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY, constructor).flat();
|
|
67
71
|
if (!results) return [];
|
|
68
72
|
return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));
|
|
69
73
|
};
|
|
@@ -72,7 +76,7 @@ class RouteSubscribeLifeCycler {
|
|
|
72
76
|
}
|
|
73
77
|
/** SwcAppMixin 이 구독 대상 메타를 꺼낼 때 사용 */
|
|
74
78
|
getMetadata(helperHostSet) {
|
|
75
|
-
return
|
|
79
|
+
return getSubscribeSwcAppRouteChangeMetadata(helperHostSet.$this);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
|
-
//# sourceMappingURL=
|
|
82
|
+
//# sourceMappingURL=subscribeSwcAppRouteChange.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/subscribeSwcAppRouteChange.ts"],
|
|
4
|
+
"sourcesContent": ["import {ReflectUtils} from '@dooboostore/core';\nimport {Router} from '@dooboostore/core-web';\nimport {HelperHostSet} from '../types';\n\nexport const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-route-change');\n\nexport type RoutePathType = string | string[] | ((currentThis: any) => string | string[]);\n\nexport interface SwcAppRouteChangeSubscriberMetadata {\n propertyKey: string | symbol;\n options?: SwcAppRouteChangeOptions;\n}\n\nexport interface SwcAppRouteChangeOptions<BeforeReturn = any, Result = any> {\n path?: RoutePathType;\n /** \uB77C\uC6B0\uD2B8 \uBCC0\uACBD \uC2DC \uD578\uB4E4\uB7EC \uC2E4\uD589 \uC5EC\uBD80 \uAC8C\uC774\uD2B8. Promise<boolean>\uB3C4 \uB418\uC5B4 async \uAC00\uB4DC(\uC778\uC99D \uCCB4\uD06C \uB4F1) \uAC00\uB2A5. false\uBA74 \uC2A4\uD0B5. */\n filter?: (router: Router, meta: { currentThis: any; helper: HelperHostSet }) => boolean | Promise<boolean>;\n /** filter \uD1B5\uACFC \uD6C4 \uD578\uB4E4\uB7EC \uC9C1\uC804 \uD6C5. await\uB418\uACE0, \uB9AC\uD134\uAC12\uC740 @routeChangeBeforeReturn \uC73C\uB85C \uD578\uB4E4\uB7EC\uC5D0 \uC8FC\uC785\uB41C\uB2E4. */\n before?: (router: Router, meta: { currentThis: any; helper: HelperHostSet }) => BeforeReturn | Promise<BeforeReturn>;\n /** \uD578\uB4E4\uB7EC\uAC00 \uC131\uACF5/\uC2E4\uD328\uD574\uB3C4 \uD56D\uC0C1 \uC2E4\uD589\uB418\uB294 \uC815\uB9AC \uD6C5. ctx\uB85C \uD578\uB4E4\uB7EC \uC778\uC790/\uACB0\uACFC/\uC5D0\uB7EC\uB97C \uBC1B\uB294\uB2E4. \uC5D0\uB7EC\uB294 \uC0BC\uD0A4\uC9C0 \uC54A\uACE0 \uC804\uD30C. */\n finally?: (router: Router, meta: { currentThis: any; helper: HelperHostSet }, ctx: { args: any[]; result?: Result; error?: any }) => any | Promise<any>;\n order?: number;\n valueKey?: symbol | string;\n /**\n * \uB2A6\uAC8C \uBD99\uC740 \uC778\uC2A4\uD134\uC2A4\uC5D0 \uB9C8\uC9C0\uB9C9 \uB77C\uC6B0\uD2B8 \uC7AC\uC0DD \uC2DC\uC810. \uAE30\uBCF8 'connected'.\n * - 'connectedDone': render \uC644\uB8CC \uD6C4 (_connectedDone). DOM \uD0C0\uAC9F \uD544\uC694\uD55C \uD578\uB4E4\uB7EC\uC6A9.\n * - live \uB77C\uC6B0\uD2B8 \uBCC0\uACBD(\uC804\uCCB4 \uBC29\uC1A1) \uB54C\uB294 \uD56D\uC0C1 \uC2E4\uD589. replay\uC5D0\uB9CC \uC801\uC6A9.\n */\n trigger?: 'connected' | 'connectedDone';\n /**\n * \uC5B8\uC81C \uC2E4\uD589\uD560\uC9C0. \uAE30\uBCF8 'match'(\uACBD\uB85C\uAC00 \uB9DE\uC744 \uB54C\uB9C8\uB2E4 \u2014 \uAE30\uC874 \uB3D9\uC791).\n * - 'enter': \uC548 \uB9DE\uB2E4\uAC00 \uB9DE\uAC8C \uB410\uC744 \uB54C (\uCC98\uC74C \uBD99\uC744 \uB54C\uC758 \uC7AC\uC0DD \uD3EC\uD568)\n * - 'update': \uACC4\uC18D \uB9DE\uB294\uB370 \uACBD\uB85C\uB098 query \uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C\n * - 'leave': \uB9DE\uB2E4\uAC00 \uC548 \uB9DE\uAC8C \uB410\uC744 \uB54C (\uC694\uC18C\uAC00 \uBD99\uC5B4 \uC788\uC744 \uB54C\uB9CC \u2014 \uAD50\uCCB4\uB418\uB294 \uD398\uC774\uC9C0\uB294 onDisconnected \uAC00 \uB2F4\uB2F9)\n * - 'beforeLeave': \uC774 \uACBD\uB85C\uB97C \uB5A0\uB098\uAE30 \uC804. false(\uB610\uB294 Promise<false>)\uB97C \uB9AC\uD134\uD558\uBA74 \uC774\uB3D9 \uCDE8\uC18C (router.go / \uB4A4\uB85C\u00B7\uC55E\uC73C\uB85C \uAC00\uAE30)\n */\n on?: 'match' | 'enter' | 'update' | 'leave' | 'beforeLeave';\n}\n\nfunction createSubscribeSwcAppRouteChange(options?: SwcAppRouteChangeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const pathPattern = options?.path;\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY, constructor) as SwcAppRouteChangeSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n\n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppRouteChange(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function subscribeSwcAppRouteChange(pathPattern: RoutePathType): MethodDecorator;\nexport function subscribeSwcAppRouteChange<BeforeReturn = any, Result = any>(pathPattern: RoutePathType, config: Omit<SwcAppRouteChangeOptions<NoInfer<BeforeReturn>, NoInfer<Result>>, 'path'>): MethodDecorator;\nexport function subscribeSwcAppRouteChange<BeforeReturn = any, Result = any>(options: SwcAppRouteChangeOptions<NoInfer<BeforeReturn>, NoInfer<Result>>): MethodDecorator;\n\n// \uC2E4\uC81C \uAD6C\uD604 (\uC774\uC911 \uBAA8\uB4DC)\nexport function subscribeSwcAppRouteChange(targetOrOptions?: any, propertyKeyOrConfig?: any, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppRouteChange\n // propertyKey\uAC00 string | symbol\uC774\uACE0 descriptor\uAC00 \uC788\uC73C\uBA74 \uC9C1\uC811 \uC0AC\uC6A9\n if (propertyKeyOrConfig && (typeof propertyKeyOrConfig === 'string' || typeof propertyKeyOrConfig === 'symbol')) {\n return createSubscribeSwcAppRouteChange({})(targetOrOptions, propertyKeyOrConfig, descriptor);\n }\n\n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uC778\uC790 \uC788\uC74C): @subscribeSwcAppRouteChange('/path')\n let options: SwcAppRouteChangeOptions = {};\n\n if (Array.isArray(targetOrOptions)) {\n // \uBC30\uC5F4: @subscribeSwcAppRouteChange(['/path1', '/path2'])\n // \uB610\uB294: @subscribeSwcAppRouteChange(['/path1', '/path2'], { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (typeof targetOrOptions === 'string' || typeof targetOrOptions === 'function') {\n // \uBB38\uC790\uC5F4 \uB610\uB294 \uD568\uC218: @subscribeSwcAppRouteChange('/path')\n // \uB610\uB294: @subscribeSwcAppRouteChange('/path', { order: 1 })\n options.path = targetOrOptions;\n if (propertyKeyOrConfig && typeof propertyKeyOrConfig === 'object') {\n options = { ...options, ...propertyKeyOrConfig };\n }\n } else if (targetOrOptions && typeof targetOrOptions === 'object') {\n // \uAC1D\uCCB4: @subscribeSwcAppRouteChange({ path: '/path', filter: ..., order: 1 })\n options = targetOrOptions;\n }\n\n return createSubscribeSwcAppRouteChange(options);\n}\nexport const changedRoute = subscribeSwcAppRouteChange;\n\n// \uB2A6\uAC8C \uBD99\uC740 \uC778\uC2A4\uD134\uC2A4\uB3C4 \uB80C\uB354 \uC644\uB8CC \uD6C4 \uB9C8\uC9C0\uB9C9 \uB77C\uC6B0\uD2B8\uB97C \uC7AC\uC0DD \u2014 DOM \uD0C0\uAC9F \uD578\uB4E4\uB7EC\uC6A9.\n// @subscribeSwcAppRouteChange(path, { trigger: 'connectedDone' }) \uC758 \uB2E8\uCD95\uD615.\nexport function subscribeSwcAppRouteChangeConnectedDone<BeforeReturn = any, Result = any>(pathPattern: RoutePathType, config?: Omit<SwcAppRouteChangeOptions<NoInfer<BeforeReturn>, NoInfer<Result>>, 'path' | 'trigger'>): MethodDecorator {\n return subscribeSwcAppRouteChange(pathPattern, { ...config, trigger: 'connectedDone' });\n}\n\n// Helper function to retrieve route change subscribers metadata\nexport const getSubscribeSwcAppRouteChangeMetadata = (target: any): SwcAppRouteChangeSubscriberMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n const results = ReflectUtils.findAllMetadata<any[]>(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_METADATA_KEY, constructor).flat();\n if (!results) return [];\n \n // Sort by order (default 0 if not specified)\n return [...results].sort((a, b) => (a.options?.order ?? 0) - (b.options?.order ?? 0));\n};\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// RouteSubscribeLifeCycler\n// NOTE: \uC2E4\uC81C \uAD6C\uB3C5 \uB85C\uC9C1\uC740 SwcAppMixin._connected \uC5D0\uC11C \uCC98\uB9AC\uB41C\uB2E4.\n// \uC774 cycler \uB294 \uBA54\uD0C0\uB370\uC774\uD130 \uC811\uADFC \uC9C4\uC785\uC810 \uC5ED\uD560\uB9CC \uD558\uBA70,\n// \uD5A5\uD6C4 SwcAppMixin \uC5D0\uC11C \uB85C\uC9C1\uC744 \uBD84\uB9AC\uD560 \uB54C \uC774 \uD074\uB798\uC2A4\uB85C \uC774\uC804\uD55C\uB2E4.\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nimport { ElementDefineLifeCycler } from '../types';\n\nexport class RouteSubscribeLifeCycler implements ElementDefineLifeCycler {\n onConnected(_helperHostSet: HelperHostSet): void {\n // \uC2E4\uC81C \uAD6C\uB3C5\uC740 SwcAppMixin._connected \uC5D0\uC11C \uCC98\uB9AC\n }\n\n /** SwcAppMixin \uC774 \uAD6C\uB3C5 \uB300\uC0C1 \uBA54\uD0C0\uB97C \uAEBC\uB0BC \uB54C \uC0AC\uC6A9 */\n getMetadata(helperHostSet: HelperHostSet): SwcAppRouteChangeSubscriberMetadata[] {\n return getSubscribeSwcAppRouteChangeMetadata(helperHostSet.$this);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAIpB,MAAM,8CAA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