@dooboostore/simple-web-component 1.0.35 → 1.0.36

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.
Files changed (136) hide show
  1. package/README.md +21 -21
  2. package/dist/cjs/decorators/addEventListener.js +12 -4
  3. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  4. package/dist/cjs/decorators/applyAttribute.js +19 -18
  5. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  6. package/dist/cjs/decorators/applyClass.js +23 -22
  7. package/dist/cjs/decorators/applyClass.js.map +2 -2
  8. package/dist/cjs/decorators/applyNode.js +18 -17
  9. package/dist/cjs/decorators/applyNode.js.map +2 -2
  10. package/dist/cjs/decorators/applyStyle.js +20 -19
  11. package/dist/cjs/decorators/applyStyle.js.map +2 -2
  12. package/dist/cjs/decorators/attribute.js +16 -15
  13. package/dist/cjs/decorators/attribute.js.map +2 -2
  14. package/dist/cjs/decorators/{changedAttributeHost.js → changedAttributeThis.js} +6 -6
  15. package/dist/cjs/decorators/changedAttributeThis.js.map +7 -0
  16. package/dist/cjs/decorators/elementDefine.js +21 -20
  17. package/dist/cjs/decorators/elementDefine.js.map +2 -2
  18. package/dist/cjs/decorators/emitCustomEvent.js +18 -16
  19. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  20. package/dist/cjs/decorators/index.js +1 -1
  21. package/dist/cjs/decorators/index.js.map +1 -1
  22. package/dist/cjs/decorators/query.js +38 -60
  23. package/dist/cjs/decorators/query.js.map +2 -2
  24. package/dist/cjs/decorators/queryAll.js +31 -63
  25. package/dist/cjs/decorators/queryAll.js.map +2 -2
  26. package/dist/cjs/decorators/setProperty.js +13 -12
  27. package/dist/cjs/decorators/setProperty.js.map +2 -2
  28. package/dist/cjs/elements/SwcAsync.js +6 -6
  29. package/dist/cjs/elements/SwcAsync.js.map +1 -1
  30. package/dist/cjs/elements/SwcChoose.js +5 -5
  31. package/dist/cjs/elements/SwcChoose.js.map +1 -1
  32. package/dist/cjs/elements/SwcIf.js +6 -6
  33. package/dist/cjs/elements/SwcIf.js.map +1 -1
  34. package/dist/cjs/elements/SwcLoop.js +5 -5
  35. package/dist/cjs/elements/SwcLoop.js.map +1 -1
  36. package/dist/cjs/elements/register.js +18 -18
  37. package/dist/cjs/elements/register.js.map +1 -1
  38. package/dist/cjs/types.js.map +1 -1
  39. package/dist/cjs/utils/Utils.js +13 -13
  40. package/dist/cjs/utils/Utils.js.map +2 -2
  41. package/dist/esm/decorators/addEventListener.js +12 -4
  42. package/dist/esm/decorators/addEventListener.js.map +2 -2
  43. package/dist/esm/decorators/applyAttribute.js +19 -18
  44. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  45. package/dist/esm/decorators/applyClass.js +23 -22
  46. package/dist/esm/decorators/applyClass.js.map +2 -2
  47. package/dist/esm/decorators/applyNode.js +18 -17
  48. package/dist/esm/decorators/applyNode.js.map +2 -2
  49. package/dist/esm/decorators/applyStyle.js +20 -19
  50. package/dist/esm/decorators/applyStyle.js.map +2 -2
  51. package/dist/esm/decorators/attribute.js +16 -15
  52. package/dist/esm/decorators/attribute.js.map +2 -2
  53. package/dist/esm/decorators/{changedAttributeHost.js → changedAttributeThis.js} +3 -3
  54. package/dist/esm/decorators/changedAttributeThis.js.map +7 -0
  55. package/dist/esm/decorators/elementDefine.js +19 -18
  56. package/dist/esm/decorators/elementDefine.js.map +2 -2
  57. package/dist/esm/decorators/emitCustomEvent.js +18 -16
  58. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  59. package/dist/esm/decorators/index.js +1 -1
  60. package/dist/esm/decorators/index.js.map +1 -1
  61. package/dist/esm/decorators/query.js +38 -60
  62. package/dist/esm/decorators/query.js.map +2 -2
  63. package/dist/esm/decorators/queryAll.js +31 -63
  64. package/dist/esm/decorators/queryAll.js.map +2 -2
  65. package/dist/esm/decorators/setProperty.js +13 -12
  66. package/dist/esm/decorators/setProperty.js.map +2 -2
  67. package/dist/esm/elements/SwcAsync.js +7 -7
  68. package/dist/esm/elements/SwcAsync.js.map +1 -1
  69. package/dist/esm/elements/SwcChoose.js +6 -6
  70. package/dist/esm/elements/SwcChoose.js.map +1 -1
  71. package/dist/esm/elements/SwcIf.js +7 -7
  72. package/dist/esm/elements/SwcIf.js.map +1 -1
  73. package/dist/esm/elements/SwcLoop.js +6 -6
  74. package/dist/esm/elements/SwcLoop.js.map +1 -1
  75. package/dist/esm/elements/register.js +19 -19
  76. package/dist/esm/elements/register.js.map +1 -1
  77. package/dist/esm/types.js.map +1 -1
  78. package/dist/esm/utils/Utils.js +13 -13
  79. package/dist/esm/utils/Utils.js.map +2 -2
  80. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +271 -308
  81. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  82. package/dist/types/decorators/addEventListener.d.ts +5 -7
  83. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  84. package/dist/types/decorators/applyAttribute.d.ts +4 -4
  85. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  86. package/dist/types/decorators/applyClass.d.ts +6 -6
  87. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  88. package/dist/types/decorators/applyNode.d.ts +6 -6
  89. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  90. package/dist/types/decorators/applyStyle.d.ts +4 -4
  91. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  92. package/dist/types/decorators/attribute.d.ts +5 -5
  93. package/dist/types/decorators/attribute.d.ts.map +1 -1
  94. package/dist/types/decorators/changedAttributeThis.d.ts +18 -0
  95. package/dist/types/decorators/changedAttributeThis.d.ts.map +1 -0
  96. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  97. package/dist/types/decorators/emitCustomEvent.d.ts +4 -9
  98. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  99. package/dist/types/decorators/index.d.ts +1 -1
  100. package/dist/types/decorators/query.d.ts +17 -63
  101. package/dist/types/decorators/query.d.ts.map +1 -1
  102. package/dist/types/decorators/queryAll.d.ts +6 -63
  103. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  104. package/dist/types/decorators/setProperty.d.ts +1 -1
  105. package/dist/types/decorators/setProperty.d.ts.map +1 -1
  106. package/dist/types/types.d.ts +2 -2
  107. package/dist/types/types.d.ts.map +1 -1
  108. package/dist/types/utils/Utils.d.ts +7 -7
  109. package/dist/types/utils/Utils.d.ts.map +1 -1
  110. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +271 -308
  111. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  112. package/package.json +4 -4
  113. package/src/decorators/addEventListener.ts +11 -9
  114. package/src/decorators/applyAttribute.ts +16 -15
  115. package/src/decorators/applyClass.ts +18 -17
  116. package/src/decorators/applyNode.ts +21 -20
  117. package/src/decorators/applyStyle.ts +17 -16
  118. package/src/decorators/attribute.ts +20 -19
  119. package/src/decorators/{changedAttributeHost.ts → changedAttributeThis.ts} +10 -12
  120. package/src/decorators/elementDefine.ts +21 -20
  121. package/src/decorators/emitCustomEvent.ts +21 -26
  122. package/src/decorators/index.ts +1 -1
  123. package/src/decorators/query.ts +51 -124
  124. package/src/decorators/queryAll.ts +30 -127
  125. package/src/decorators/setProperty.ts +12 -11
  126. package/src/elements/SwcAsync.ts +7 -7
  127. package/src/elements/SwcChoose.ts +6 -6
  128. package/src/elements/SwcIf.ts +8 -8
  129. package/src/elements/SwcLoop.ts +6 -6
  130. package/src/elements/register.ts +20 -20
  131. package/src/types.ts +5 -5
  132. package/src/utils/Utils.ts +17 -18
  133. package/dist/cjs/decorators/changedAttributeHost.js.map +0 -7
  134. package/dist/esm/decorators/changedAttributeHost.js.map +0 -7
  135. package/dist/types/decorators/changedAttributeHost.d.ts +0 -20
  136. package/dist/types/decorators/changedAttributeHost.d.ts.map +0 -1
@@ -30,8 +30,6 @@ export function query(selectorOrTarget: string, options: any = {}): PropertyDeco
30
30
  }
31
31
  queries.push({ propertyKey, selector: selectorOrTarget, options });
32
32
 
33
- // const propertyType = Reflect.getMetadata("design:type", targetObj, propertyKey);
34
- // console.log(`Property ${String(propertyKey)} type is:`, propertyType.name);
35
33
  Object.defineProperty(targetObj, propertyKey, {
36
34
  get(this: HTMLElement) {
37
35
  ensureInit(this);
@@ -43,25 +41,26 @@ export function query(selectorOrTarget: string, options: any = {}): PropertyDeco
43
41
  if (r === 'auto') return t.shadowRoot || t;
44
42
  if (r === 'shadow') return t.shadowRoot;
45
43
  if (r === 'light') return t;
46
- if (r === 'all') return t.shadowRoot || t; // query only returns one, so shadow preferred
44
+ if (r === 'all') return t.shadowRoot || t;
47
45
  return t;
48
46
  };
49
47
 
50
48
  // --- Special Selectors: HostSet ---
51
49
  const hostSet = SwcUtils.getHostSet(this);
52
- if (selector === ':parentHost') return applyRoot(hostSet.$parentHost);
53
- if (selector === ':appHost') return applyRoot(hostSet.$appHost);
54
- if (selector === ':firstHost') return applyRoot(hostSet.$firstHost);
55
- if (selector === ':lastHost') return applyRoot(hostSet.$lastHost);
56
- if (selector === ':firstAppHost') return applyRoot(hostSet.$firstAppHost);
57
- if (selector === ':lastAppHost') return applyRoot(hostSet.$lastAppHost);
50
+ if (selector === '$this') return applyRoot(this);
51
+ if (selector === '$host') return applyRoot(hostSet.$host);
52
+ if (selector === '$parentHost') return applyRoot(hostSet.$parentHost);
53
+ if (selector === '$appHost') return applyRoot(hostSet.$appHost);
54
+ if (selector === '$firstHost') return applyRoot(hostSet.$firstHost);
55
+ if (selector === '$lastHost') return applyRoot(hostSet.$lastHost);
56
+ if (selector === '$firstAppHost') return applyRoot(hostSet.$firstAppHost);
57
+ if (selector === '$lastAppHost') return applyRoot(hostSet.$lastAppHost);
58
58
 
59
59
  // --- Special Selectors: Env ---
60
60
  const config = getElementConfig(this);
61
61
  const win = config?.window || window;
62
- if (selector === ':window') return win;
63
- if (selector === ':document') return win.document;
64
- if (selector === ':host') return applyRoot(this);
62
+ if (selector === '$window') return win;
63
+ if (selector === '$document') return win.document;
65
64
 
66
65
  // --- Standard Selectors ---
67
66
  if (r === 'shadow') return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
@@ -76,7 +75,7 @@ export function query(selectorOrTarget: string, options: any = {}): PropertyDeco
76
75
  ensureInit(this);
77
76
  if (nv === null || nv === undefined) {
78
77
  const selector = selectorOrTarget;
79
- if (selector.startsWith(':') && selector !== ':host') return;
78
+ if (selector.startsWith('$') && selector !== '$this') return;
80
79
 
81
80
  const r = options.root || 'auto';
82
81
  const targets: Element[] = [];
@@ -103,157 +102,85 @@ export function query(selectorOrTarget: string, options: any = {}): PropertyDeco
103
102
  }
104
103
 
105
104
  /**
106
- * @queryHost decorator - simplified version of @query for :host selector
107
- * Usage: @queryHost testzzs: HTMLElement | undefined;
108
- * Usage: @queryHost() testzzs: HTMLElement | undefined;
109
- * Usage: @queryHost({ root: 'shadow' }) testzzs: HTMLElement | undefined;
105
+ * @queryThis decorator - simplified version of @query for $this selector
110
106
  */
111
- export function queryHost(target: Object, propertyKey: string | symbol): void;
112
- export function queryHost(): PropertyDecorator;
113
- export function queryHost(options: SwcQueryOptions): PropertyDecorator;
114
- export function queryHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
115
- // Direct decorator usage: @queryHost (no parentheses)
116
- if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
117
- return query(':host', {})(targetOrOptions, propertyKey);
118
- }
119
-
120
- // @queryHost() or @queryHost(options)
121
- if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
122
- return query(':host', targetOrOptions as SwcQueryOptions);
123
- } else {
124
- return query(':host', {});
125
- }
126
- }
127
-
128
- /**
129
- * @host - Alias for @queryHost decorator
130
- * Usage: @host element: HTMLElement | undefined;
131
- * Usage: @host() element: HTMLElement | undefined;
132
- * Usage: @host({ root: 'shadow' }) element: HTMLElement | undefined;
133
- */
134
- export const host = queryHost;
135
-
136
- /**
137
- * @parentHost - Query :parentHost (Direct parent SWC component)
138
- * Usage: @parentHost parent: HTMLElement | undefined;
139
- * Usage: @parentHost() parent: HTMLElement | undefined;
140
- * Usage: @parentHost({ root: 'shadow' }) parent: HTMLElement | undefined;
141
- */
142
- export function parentHost(target: Object, propertyKey: string | symbol): void;
143
- export function parentHost(): PropertyDecorator;
144
- export function parentHost(options: SwcQueryOptions): PropertyDecorator;
145
- export function parentHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
107
+ export function queryThis(target: Object, propertyKey: string | symbol): void;
108
+ export function queryThis(): PropertyDecorator;
109
+ export function queryThis(options: SwcQueryOptions): PropertyDecorator;
110
+ export function queryThis(targetOrOptions?: any, propertyKey?: string | symbol): any {
146
111
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
147
- return query(':parentHost', {})(targetOrOptions, propertyKey);
112
+ return query('$this', {})(targetOrOptions, propertyKey);
148
113
  }
149
114
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
150
- return query(':parentHost', targetOrOptions as SwcQueryOptions);
115
+ return query('$this', targetOrOptions as SwcQueryOptions);
151
116
  } else {
152
- return query(':parentHost', {});
117
+ return query('$this', {});
153
118
  }
154
119
  }
155
120
 
156
- /**
157
- * @appHost - Query :appHost (Nearest <swc-app>)
158
- * Usage: @appHost app: SwcAppInterface | undefined;
159
- * Usage: @appHost() app: SwcAppInterface | undefined;
160
- * Usage: @appHost({ root: 'shadow' }) app: SwcAppInterface | undefined;
161
- */
162
- export function appHost(target: Object, propertyKey: string | symbol): void;
163
- export function appHost(): PropertyDecorator;
164
- export function appHost(options: SwcQueryOptions): PropertyDecorator;
165
- export function appHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
166
- if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
167
- return query(':appHost', {})(targetOrOptions, propertyKey);
168
- }
169
- if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
170
- return query(':appHost', targetOrOptions as SwcQueryOptions);
171
- } else {
172
- return query(':appHost', {});
173
- }
174
- }
175
121
 
176
- /**
177
- * @firstHost - Query :firstHost (First component in hierarchy)
178
- * Usage: @firstHost first: HTMLElement | undefined;
179
- * Usage: @firstHost() first: HTMLElement | undefined;
180
- * Usage: @firstHost({ root: 'shadow' }) first: HTMLElement | undefined;
181
- */
182
- export function firstHost(target: Object, propertyKey: string | symbol): void;
183
- export function firstHost(): PropertyDecorator;
184
- export function firstHost(options: SwcQueryOptions): PropertyDecorator;
185
- export function firstHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
122
+ export function queryWindow(target: Object, propertyKey: string | symbol): void;
123
+ export function queryWindow(): PropertyDecorator;
124
+ export function queryWindow(options: SwcQueryOptions): PropertyDecorator;
125
+ export function queryWindow(targetOrOptions?: any, propertyKey?: string | symbol): any {
186
126
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
187
- return query(':firstHost', {})(targetOrOptions, propertyKey);
127
+ return query('$window', {})(targetOrOptions, propertyKey);
188
128
  }
189
129
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
190
- return query(':firstHost', targetOrOptions as SwcQueryOptions);
130
+ return query('$window', targetOrOptions as SwcQueryOptions);
191
131
  } else {
192
- return query(':firstHost', {});
132
+ return query('$window', {});
193
133
  }
194
134
  }
195
135
 
196
- /**
197
- * @lastHost - Query :lastHost (Last component in hierarchy)
198
- * Usage: @lastHost last: HTMLElement | undefined;
199
- * Usage: @lastHost() last: HTMLElement | undefined;
200
- * Usage: @lastHost({ root: 'shadow' }) last: HTMLElement | undefined;
201
- */
202
- export function lastHost(target: Object, propertyKey: string | symbol): void;
203
- export function lastHost(): PropertyDecorator;
204
- export function lastHost(options: SwcQueryOptions): PropertyDecorator;
205
- export function lastHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
136
+ export function queryDocument(target: Object, propertyKey: string | symbol): void;
137
+ export function queryDocument(): PropertyDecorator;
138
+ export function queryDocument(options: SwcQueryOptions): PropertyDecorator;
139
+ export function queryDocument(targetOrOptions?: any, propertyKey?: string | symbol): any {
206
140
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
207
- return query(':lastHost', {})(targetOrOptions, propertyKey);
141
+ return query('$document', {})(targetOrOptions, propertyKey);
208
142
  }
209
143
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
210
- return query(':lastHost', targetOrOptions as SwcQueryOptions);
144
+ return query('$document', targetOrOptions as SwcQueryOptions);
211
145
  } else {
212
- return query(':lastHost', {});
146
+ return query('$document', {});
213
147
  }
214
148
  }
215
-
216
149
  /**
217
- * @firstAppHost - Query :firstAppHost (First <swc-app> in hierarchy)
218
- * Usage: @firstAppHost app: SwcAppInterface | undefined;
219
- * Usage: @firstAppHost() app: SwcAppInterface | undefined;
220
- * Usage: @firstAppHost({ root: 'shadow' }) app: SwcAppInterface | undefined;
150
+ * @host - Query $host (Direct parent SWC component)
221
151
  */
222
- export function firstAppHost(target: Object, propertyKey: string | symbol): void;
223
- export function firstAppHost(): PropertyDecorator;
224
- export function firstAppHost(options: SwcQueryOptions): PropertyDecorator;
225
- export function firstAppHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
152
+ export function queryHost(target: Object, propertyKey: string | symbol): void;
153
+ export function queryHost(): PropertyDecorator;
154
+ export function queryHost(options: SwcQueryOptions): PropertyDecorator;
155
+ export function queryHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
226
156
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
227
- return query(':firstAppHost', {})(targetOrOptions, propertyKey);
157
+ return query('$host', {})(targetOrOptions, propertyKey);
228
158
  }
229
159
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
230
- return query(':firstAppHost', targetOrOptions as SwcQueryOptions);
160
+ return query('$host', targetOrOptions as SwcQueryOptions);
231
161
  } else {
232
- return query(':firstAppHost', {});
162
+ return query('$host', {});
233
163
  }
234
164
  }
235
165
 
236
166
  /**
237
- * @lastAppHost - Query :lastAppHost (Last <swc-app> in hierarchy)
238
- * Usage: @lastAppHost app: SwcAppInterface | undefined;
239
- * Usage: @lastAppHost() app: SwcAppInterface | undefined;
240
- * Usage: @lastAppHost({ root: 'shadow' }) app: SwcAppInterface | undefined;
167
+ * @appHost - Query $appHost (Nearest <swc-app>)
241
168
  */
242
- export function lastAppHost(target: Object, propertyKey: string | symbol): void;
243
- export function lastAppHost(): PropertyDecorator;
244
- export function lastAppHost(options: SwcQueryOptions): PropertyDecorator;
245
- export function lastAppHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
169
+ export function queryAppHost(target: Object, propertyKey: string | symbol): void;
170
+ export function queryAppHost(): PropertyDecorator;
171
+ export function queryAppHost(options: SwcQueryOptions): PropertyDecorator;
172
+ export function queryAppHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
246
173
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
247
- return query(':lastAppHost', {})(targetOrOptions, propertyKey);
174
+ return query('$appHost', {})(targetOrOptions, propertyKey);
248
175
  }
249
176
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
250
- return query(':lastAppHost', targetOrOptions as SwcQueryOptions);
177
+ return query('$appHost', targetOrOptions as SwcQueryOptions);
251
178
  } else {
252
- return query(':lastAppHost', {});
179
+ return query('$appHost', {});
253
180
  }
254
181
  }
255
182
 
256
183
  export const getQueryMetadata = (target: any): QueryMetadata[] | undefined => {
257
184
  const constructor = target instanceof Function ? target : target.constructor;
258
185
  return ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
259
- };
186
+ };
@@ -56,15 +56,22 @@ export function queryAll(selectorOrTarget: string, options: any = {}): PropertyD
56
56
 
57
57
  // --- Special Selectors: HostSet ---
58
58
  const hostSet = SwcUtils.getHostSet(this);
59
- if (selector === ':hosts') return applyRoot(hostSet.$hosts);
60
- if (selector === ':appHosts') return applyRoot(hostSet.$appHosts);
59
+ if (selector === '$hosts') return applyRoot(hostSet.$hosts);
60
+ if (selector === '$appHosts') return applyRoot(hostSet.$appHosts);
61
+ if (selector === '$host') return applyRoot(hostSet.$host);
62
+ if (selector === '$parentHost') return applyRoot(hostSet.$parentHost);
63
+ if (selector === '$appHost') return applyRoot(hostSet.$appHost);
64
+ if (selector === '$firstHost') return applyRoot(hostSet.$firstHost);
65
+ if (selector === '$lastHost') return applyRoot(hostSet.$lastHost);
66
+ if (selector === '$firstAppHost') return applyRoot(hostSet.$firstAppHost);
67
+ if (selector === '$lastAppHost') return applyRoot(hostSet.$lastAppHost);
61
68
 
62
69
  // --- Special Selectors: Env ---
63
70
  const config = getElementConfig(this);
64
71
  const win = config?.window || window;
65
- if (selector === ':window') return [win];
66
- if (selector === ':document') return [win.document];
67
- if (selector === ':host') return applyRoot(this);
72
+ if (selector === '$window') return [win];
73
+ if (selector === '$document') return [win.document];
74
+ if (selector === '$this') return applyRoot(this);
68
75
 
69
76
  // --- Standard Selectors ---
70
77
  if (r === 'shadow') return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
@@ -81,7 +88,7 @@ export function queryAll(selectorOrTarget: string, options: any = {}): PropertyD
81
88
  ensureInit(this);
82
89
  if (nv === null || nv === undefined || (Array.isArray(nv) && nv.length === 0)) {
83
90
  const selector = selectorOrTarget;
84
- if (selector.startsWith(':') && selector !== ':host') return;
91
+ if (selector.startsWith('$') && selector !== '$this') return;
85
92
 
86
93
  const r = options.root || 'auto';
87
94
  let targets: (Element | Node)[] = [];
@@ -102,164 +109,60 @@ export function queryAll(selectorOrTarget: string, options: any = {}): PropertyD
102
109
  });
103
110
  };
104
111
  }
112
+
105
113
  /**
106
- * @hostQueryAll decorator - simplified version of @queryAll for :host selector
107
- * Usage: @hostQueryAll()
108
- * Usage: @hostQueryAll({ root: 'shadow' })
109
- */
110
- /**
111
- * @queryAllHost decorator - simplified version of @queryAll for :host selector
112
- * Usage: @queryAllHost items: HTMLElement[];
113
- * Usage: @queryAllHost() items: HTMLElement[];
114
- * Usage: @queryAllHost({ root: 'shadow' }) items: HTMLElement[];
114
+ * @queryAllThis decorator - simplified version of @queryAll for $this selector
115
115
  */
116
- export function queryAllHost(target: Object, propertyKey: string | symbol): void;
117
- export function queryAllHost(): PropertyDecorator;
118
- export function queryAllHost(options: SwcQueryOptions): PropertyDecorator;
119
- export function queryAllHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
120
- // Direct decorator usage: @queryAllHost (no parentheses)
116
+ export function queryAllThis(target: Object, propertyKey: string | symbol): void;
117
+ export function queryAllThis(): PropertyDecorator;
118
+ export function queryAllThis(options: SwcQueryOptions): PropertyDecorator;
119
+ export function queryAllThis(targetOrOptions?: any, propertyKey?: string | symbol): any {
121
120
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
122
- return queryAll(':host', {})(targetOrOptions, propertyKey);
121
+ return queryAll('$this', {})(targetOrOptions, propertyKey);
123
122
  }
124
123
 
125
- // @queryAllHost() or @queryAllHost(options)
126
124
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
127
- return queryAll(':host', targetOrOptions as SwcQueryOptions);
125
+ return queryAll('$this', targetOrOptions as SwcQueryOptions);
128
126
  } else {
129
- return queryAll(':host', {});
127
+ return queryAll('$this', {});
130
128
  }
131
129
  }
132
130
 
133
131
  /**
134
- * @allHost - Alias for @queryAllHost decorator
135
- * Usage: @allHost items: HTMLElement[];
136
- * Usage: @allHost() items: HTMLElement[];
137
- * Usage: @allHost({ root: 'shadow' }) items: HTMLElement[];
138
- */
139
- export const allHost = queryAllHost;
140
- /**
141
- * @allParentHost - Query all :parentHost (All parent SWC components)
142
- * Usage: @allParentHost parents: HTMLElement[];
143
- * Usage: @allParentHost() parents: HTMLElement[];
144
- * Usage: @allParentHost({ root: 'shadow' }) parents: HTMLElement[];
132
+ * @allParentHost - Query all parent SWC components
145
133
  */
146
134
  export function allParentHost(target: Object, propertyKey: string | symbol): void;
147
135
  export function allParentHost(): PropertyDecorator;
148
136
  export function allParentHost(options: SwcQueryOptions): PropertyDecorator;
149
137
  export function allParentHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
150
138
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
151
- return queryAll(':parentHost', {})(targetOrOptions, propertyKey);
139
+ return queryAll('$host', {})(targetOrOptions, propertyKey);
152
140
  }
153
141
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
154
- return queryAll(':parentHost', targetOrOptions as SwcQueryOptions);
142
+ return queryAll('$host', targetOrOptions as SwcQueryOptions);
155
143
  } else {
156
- return queryAll(':parentHost', {});
144
+ return queryAll('$host', {});
157
145
  }
158
146
  }
159
147
 
160
148
  /**
161
- * @allAppHost - Query all :appHost (All <swc-app> instances)
162
- * Usage: @allAppHost apps: SwcAppInterface[];
163
- * Usage: @allAppHost() apps: SwcAppInterface[];
164
- * Usage: @allAppHost({ root: 'shadow' }) apps: SwcAppInterface[];
149
+ * @allAppHost - Query all $appHost (All <swc-app> instances)
165
150
  */
166
151
  export function allAppHost(target: Object, propertyKey: string | symbol): void;
167
152
  export function allAppHost(): PropertyDecorator;
168
153
  export function allAppHost(options: SwcQueryOptions): PropertyDecorator;
169
154
  export function allAppHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
170
155
  if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
171
- return queryAll(':appHost', {})(targetOrOptions, propertyKey);
172
- }
173
- if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
174
- return queryAll(':appHost', targetOrOptions as SwcQueryOptions);
175
- } else {
176
- return queryAll(':appHost', {});
177
- }
178
- }
179
-
180
- /**
181
- * @allFirstHost - Query all :firstHost (All first components in hierarchy)
182
- * Usage: @allFirstHost firsts: HTMLElement[];
183
- * Usage: @allFirstHost() firsts: HTMLElement[];
184
- * Usage: @allFirstHost({ root: 'shadow' }) firsts: HTMLElement[];
185
- */
186
- export function allFirstHost(target: Object, propertyKey: string | symbol): void;
187
- export function allFirstHost(): PropertyDecorator;
188
- export function allFirstHost(options: SwcQueryOptions): PropertyDecorator;
189
- export function allFirstHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
190
- if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
191
- return queryAll(':firstHost', {})(targetOrOptions, propertyKey);
156
+ return queryAll('$appHost', {})(targetOrOptions, propertyKey);
192
157
  }
193
158
  if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
194
- return queryAll(':firstHost', targetOrOptions as SwcQueryOptions);
159
+ return queryAll('$appHost', targetOrOptions as SwcQueryOptions);
195
160
  } else {
196
- return queryAll(':firstHost', {});
161
+ return queryAll('$appHost', {});
197
162
  }
198
163
  }
199
164
 
200
- /**
201
- * @allLastHost - Query all :lastHost (All last components in hierarchy)
202
- * Usage: @allLastHost lasts: HTMLElement[];
203
- * Usage: @allLastHost() lasts: HTMLElement[];
204
- * Usage: @allLastHost({ root: 'shadow' }) lasts: HTMLElement[];
205
- */
206
- export function allLastHost(target: Object, propertyKey: string | symbol): void;
207
- export function allLastHost(): PropertyDecorator;
208
- export function allLastHost(options: SwcQueryOptions): PropertyDecorator;
209
- export function allLastHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
210
- if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
211
- return queryAll(':lastHost', {})(targetOrOptions, propertyKey);
212
- }
213
- if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
214
- return queryAll(':lastHost', targetOrOptions as SwcQueryOptions);
215
- } else {
216
- return queryAll(':lastHost', {});
217
- }
218
- }
219
-
220
- /**
221
- * @allFirstAppHost - Query all :firstAppHost (All first <swc-app> in hierarchy)
222
- * Usage: @allFirstAppHost apps: SwcAppInterface[];
223
- * Usage: @allFirstAppHost() apps: SwcAppInterface[];
224
- * Usage: @allFirstAppHost({ root: 'shadow' }) apps: SwcAppInterface[];
225
- */
226
- export function allFirstAppHost(target: Object, propertyKey: string | symbol): void;
227
- export function allFirstAppHost(): PropertyDecorator;
228
- export function allFirstAppHost(options: SwcQueryOptions): PropertyDecorator;
229
- export function allFirstAppHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
230
- if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
231
- return queryAll(':firstAppHost', {})(targetOrOptions, propertyKey);
232
- }
233
- if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
234
- return queryAll(':firstAppHost', targetOrOptions as SwcQueryOptions);
235
- } else {
236
- return queryAll(':firstAppHost', {});
237
- }
238
- }
239
-
240
- /**
241
- * @allLastAppHost - Query all :lastAppHost (All last <swc-app> in hierarchy)
242
- * Usage: @allLastAppHost apps: SwcAppInterface[];
243
- * Usage: @allLastAppHost() apps: SwcAppInterface[];
244
- * Usage: @allLastAppHost({ root: 'shadow' }) apps: SwcAppInterface[];
245
- */
246
- export function allLastAppHost(target: Object, propertyKey: string | symbol): void;
247
- export function allLastAppHost(): PropertyDecorator;
248
- export function allLastAppHost(options: SwcQueryOptions): PropertyDecorator;
249
- export function allLastAppHost(targetOrOptions?: any, propertyKey?: string | symbol): any {
250
- if (propertyKey !== undefined && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {
251
- return queryAll(':lastAppHost', {})(targetOrOptions, propertyKey);
252
- }
253
- if (typeof targetOrOptions === 'object' && targetOrOptions !== null) {
254
- return queryAll(':lastAppHost', targetOrOptions as SwcQueryOptions);
255
- } else {
256
- return queryAll(':lastAppHost', {});
257
- }
258
- }
259
-
260
-
261
165
  export const getQueryAllMetadata = (target: any): QueryAllMetadata[] | undefined => {
262
166
  const constructor = target instanceof Function ? target : target.constructor;
263
167
  return ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
264
168
  };
265
-
@@ -56,15 +56,16 @@ export const setProperty = (selector: string, propertyNameOrOptions?: string | P
56
56
  targetEls.push(t);
57
57
  };
58
58
 
59
- if (selector === ':parentHost') applyRoot(hostSet.$parentHost);
60
- else if (selector === ':appHost') applyRoot(hostSet.$appHost);
61
- else if (selector === ':firstHost') applyRoot(hostSet.$firstHost);
62
- else if (selector === ':lastHost') applyRoot(hostSet.$lastHost);
63
- else if (selector === ':firstAppHost') applyRoot(hostSet.$firstAppHost);
64
- else if (selector === ':lastAppHost') applyRoot(hostSet.$lastAppHost);
65
- else if (selector === ':hosts') hostSet.$hosts.forEach(applyRoot);
66
- else if (selector === ':appHosts') hostSet.$appHosts.forEach(applyRoot);
67
- else if (selector === ':host' || !selector) applyRoot(host);
59
+ if (selector === '$this' || !selector) applyRoot(host);
60
+ else if (selector === '$host') applyRoot(hostSet.$host);
61
+ else if (selector === '$parentHost') applyRoot(hostSet.$parentHost);
62
+ else if (selector === '$appHost') applyRoot(hostSet.$appHost);
63
+ else if (selector === '$firstHost') applyRoot(hostSet.$firstHost);
64
+ else if (selector === '$lastHost') applyRoot(hostSet.$lastHost);
65
+ else if (selector === '$firstAppHost') applyRoot(hostSet.$firstAppHost);
66
+ else if (selector === '$lastAppHost') applyRoot(hostSet.$lastAppHost);
67
+ else if (selector === '$hosts') hostSet.$hosts.forEach(applyRoot);
68
+ else if (selector === '$appHosts') hostSet.$appHosts.forEach(applyRoot);
68
69
  else {
69
70
  const targetRoot = r === 'auto' ? (host.shadowRoot || host) : (r === 'shadow' ? host.shadowRoot : host);
70
71
  if (targetRoot) {
@@ -106,6 +107,6 @@ export const setProperty = (selector: string, propertyNameOrOptions?: string | P
106
107
  };
107
108
  };
108
109
 
109
- export const setPropertyHost = (propertyNameOrOptions?: string | PropertySetOptions, options: PropertySetOptions = {}): MethodDecorator => {
110
- return setProperty(':host', propertyNameOrOptions, options);
110
+ export const setPropertyThis = (propertyNameOrOptions?: string | PropertySetOptions, options: PropertySetOptions = {}): MethodDecorator => {
111
+ return setProperty('$this', propertyNameOrOptions, options);
111
112
  };
@@ -1,15 +1,15 @@
1
- import { changedAttributeHost } from '../decorators/changedAttributeHost';
1
+ import { changedAttributeThis } from '../decorators/changedAttributeThis';
2
2
  import { SwcUtils } from '../utils/Utils';
3
3
  import { FunctionUtils, ActionExpression } from '@dooboostore/core';
4
4
  import { ConvertUtils } from '@dooboostore/core-web';
5
- import { attributeHost } from '../decorators';
5
+ import { attributeThis } from '../decorators';
6
6
 
7
7
  class SwcAsync extends HTMLTemplateElement {
8
- @attributeHost('value')
8
+ @attributeThis('value')
9
9
  _value: any;
10
- @attributeHost('replace-wrap-start')
10
+ @attributeThis('replace-wrap-start')
11
11
  _replaceWrapStart: string | null;
12
- @attributeHost('replace-wrap-end')
12
+ @attributeThis('replace-wrap-end')
13
13
  _replaceWrapEnd: string | null; resultValue?: any;
14
14
 
15
15
  get value(): boolean {
@@ -22,12 +22,12 @@ class SwcAsync extends HTMLTemplateElement {
22
22
 
23
23
  private _nodes: Node[] = [];
24
24
 
25
- @changedAttributeHost('value')
25
+ @changedAttributeThis('value')
26
26
  private setValue(valueAttr?: string | null) {
27
27
  this.executeAsync(this._value);
28
28
  }
29
29
 
30
- // @changedAttributeHost('replace-wrap')
30
+ // @changedAttributeThis('replace-wrap')
31
31
  // private setReplaceWrap() {
32
32
  // this.executeAsync(this._value);
33
33
  // }
@@ -1,16 +1,16 @@
1
- import { changedAttributeHost } from '../decorators/changedAttributeHost';
1
+ import { changedAttributeThis } from '../decorators/changedAttributeThis';
2
2
  import { SwcUtils } from '../utils/Utils';
3
3
  import { FunctionUtils, ActionExpression } from '@dooboostore/core';
4
4
  import { ConvertUtils } from '@dooboostore/core-web';
5
5
  import { SwcChooseInterface } from '../types';
6
- import { attributeHost, getAttributeValue, getElementConfig } from '../decorators';
6
+ import { attributeThis, getAttributeValue, getElementConfig } from '../decorators';
7
7
 
8
8
  class SwcChoose extends HTMLTemplateElement implements SwcChooseInterface {
9
9
  _value: any;
10
10
 
11
- @attributeHost('replace-wrap-start')
11
+ @attributeThis('replace-wrap-start')
12
12
  _replaceWrapStart: string | null;
13
- @attributeHost('replace-wrap-end')
13
+ @attributeThis('replace-wrap-end')
14
14
  _replaceWrapEnd: string | null;
15
15
 
16
16
  private _nodes: Node[] = [];
@@ -39,14 +39,14 @@ class SwcChoose extends HTMLTemplateElement implements SwcChooseInterface {
39
39
  // console.log('-----------------choooooooose attr origin', na, o, n);
40
40
  }
41
41
 
42
- @changedAttributeHost('value')
42
+ @changedAttributeThis('value')
43
43
  private setValue(value: any, o: string, n: string) {
44
44
  console.log('chooooooose value', value)
45
45
  this._value = value;
46
46
  this.refresh(this._value);
47
47
  }
48
48
 
49
- // @changedAttributeHost('replace-wrap')
49
+ // @changedAttributeThis('replace-wrap')
50
50
  // private setReplaceWrap(replaceWrapAttr?: string | null) {
51
51
  // this.refresh();
52
52
  // }
@@ -1,21 +1,21 @@
1
- import { changedAttributeHost } from '../decorators/changedAttributeHost';
1
+ import { changedAttributeThis } from '../decorators/changedAttributeThis';
2
2
  import { SwcUtils } from '../utils/Utils';
3
3
  import { FunctionUtils, ActionExpression } from '@dooboostore/core';
4
4
  import { ConvertUtils } from '@dooboostore/core-web';
5
5
  import { SwcIfInterface } from '../types';
6
- import { attributeHost, getAttributeValue } from '../decorators';
6
+ import { attributeThis, getAttributeValue } from '../decorators';
7
7
 
8
8
  class SwcIf extends HTMLTemplateElement implements SwcIfInterface {
9
9
  // id =
10
- // @attributeHost('value')
10
+ // @attributeThis('value')
11
11
  _value: any;
12
12
 
13
- @attributeHost('replace-wrap-start')
13
+ @attributeThis('replace-wrap-start')
14
14
  _replaceWrapStart: string | null;
15
- @attributeHost('replace-wrap-end')
15
+ @attributeThis('replace-wrap-end')
16
16
  _replaceWrapEnd: string | null;
17
17
 
18
- @attributeHost('skip-if-same')
18
+ @attributeThis('skip-if-same')
19
19
  _skipIfSame: string | null;
20
20
 
21
21
  private _nodes: Node[] = [];
@@ -33,13 +33,13 @@ class SwcIf extends HTMLTemplateElement implements SwcIfInterface {
33
33
  super();
34
34
  }
35
35
 
36
- @changedAttributeHost('value')
36
+ @changedAttributeThis('value')
37
37
  private setValue(value: any, o: string, n: string) {
38
38
  this._value = value;
39
39
  this.refresh(this._value);
40
40
  }
41
41
 
42
- // @changedAttributeHost('replace-wrap')
42
+ // @changedAttributeThis('replace-wrap')
43
43
  // private setReplaceWrap(replaceWrapAttr?: string | null) {
44
44
  // this.refresh();
45
45
  // }