@jqhtml/core 2.3.13 → 2.3.35
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/dist/component.d.ts +95 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/index.cjs +3607 -3217
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3607 -3218
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/jqhtml-core.esm.js +3608 -3219
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jquery-plugin.d.ts.map +1 -1
- package/dist/lifecycle-manager.d.ts +15 -4
- package/dist/lifecycle-manager.d.ts.map +1 -1
- package/dist/load-coordinator.d.ts +16 -3
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/template-renderer.d.ts +5 -0
- package/dist/template-renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export declare class Jqhtml_Component {
|
|
|
34
34
|
private _data_before_render;
|
|
35
35
|
private _lifecycle_callbacks;
|
|
36
36
|
private _lifecycle_states;
|
|
37
|
-
private __loading;
|
|
38
37
|
private _did_first_render;
|
|
39
38
|
private _render_count;
|
|
40
39
|
private _args_on_last_render;
|
|
@@ -50,6 +49,12 @@ export declare class Jqhtml_Component {
|
|
|
50
49
|
private _should_cache_html_after_ready;
|
|
51
50
|
private _is_dynamic;
|
|
52
51
|
private _on_render_complete;
|
|
52
|
+
private _use_cached_data_hit;
|
|
53
|
+
private _skip_render_and_ready;
|
|
54
|
+
private _skip_ready;
|
|
55
|
+
private _has_rendered;
|
|
56
|
+
private _load_queue;
|
|
57
|
+
private __has_custom_on_load;
|
|
53
58
|
constructor(element?: any, args?: Record<string, any>);
|
|
54
59
|
/**
|
|
55
60
|
* Protect lifecycle methods from manual invocation
|
|
@@ -70,6 +75,13 @@ export declare class Jqhtml_Component {
|
|
|
70
75
|
* @private
|
|
71
76
|
*/
|
|
72
77
|
private _call_lifecycle_sync;
|
|
78
|
+
/**
|
|
79
|
+
* Check if on_load() is overridden in a subclass
|
|
80
|
+
* Used to skip the load phase entirely for components that don't fetch data
|
|
81
|
+
* Returns cached value set in _boot() for O(1) performance
|
|
82
|
+
* @private
|
|
83
|
+
*/
|
|
84
|
+
private _has_on_load;
|
|
73
85
|
/**
|
|
74
86
|
* Boot - Start the full component lifecycle
|
|
75
87
|
* Called immediately after construction by instruction processor
|
|
@@ -110,16 +122,47 @@ export declare class Jqhtml_Component {
|
|
|
110
122
|
redraw(id?: string | null): void;
|
|
111
123
|
/**
|
|
112
124
|
* Create phase - Quick setup, prepare UI
|
|
113
|
-
*
|
|
125
|
+
* SYNCHRONOUS - no awaits, no yields
|
|
114
126
|
*/
|
|
115
|
-
create():
|
|
127
|
+
create(): void;
|
|
116
128
|
/**
|
|
117
|
-
* Load phase - Fetch data
|
|
129
|
+
* Load phase - Fetch asynchronous data
|
|
118
130
|
* Called bottom-up, fully parallel
|
|
119
131
|
* NO DOM MODIFICATIONS ALLOWED IN THIS PHASE
|
|
132
|
+
*
|
|
133
|
+
* Key design: on_load() runs on a DETACHED proxy with a clone of this.data.
|
|
134
|
+
* The real component's this.data is not touched during on_load execution.
|
|
135
|
+
* After on_load completes, the result is applied via a sequential queue.
|
|
136
|
+
*
|
|
120
137
|
* @private - Internal lifecycle method, not for external use
|
|
121
138
|
*/
|
|
122
139
|
_load(): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Execute on_load() on a fully detached proxy.
|
|
142
|
+
*
|
|
143
|
+
* The proxy has:
|
|
144
|
+
* - A CLONE of this.data (from __initial_data_snapshot)
|
|
145
|
+
* - Read-only access to this.args
|
|
146
|
+
* - No access to anything else (this.$, this.sid, etc.)
|
|
147
|
+
*
|
|
148
|
+
* This ensures on_load runs completely isolated from the component instance.
|
|
149
|
+
*
|
|
150
|
+
* @param use_load_coordinator - If true, register with Load_Coordinator for deduplication
|
|
151
|
+
* @returns The resulting data from the proxy after on_load completes
|
|
152
|
+
* @private
|
|
153
|
+
*/
|
|
154
|
+
private _execute_on_load_detached;
|
|
155
|
+
/**
|
|
156
|
+
* Apply the result of on_load() to this.data via the sequential queue.
|
|
157
|
+
*
|
|
158
|
+
* Multiple _load calls can execute on_load in parallel, but this method
|
|
159
|
+
* ensures that setting this.data happens in FIFO order.
|
|
160
|
+
*
|
|
161
|
+
* @param result_data - The data returned from _execute_on_load_detached
|
|
162
|
+
* @param data_before_load - JSON string of this.data before on_load (for change detection), or null
|
|
163
|
+
* @private
|
|
164
|
+
*/
|
|
165
|
+
private _apply_load_result;
|
|
123
166
|
/**
|
|
124
167
|
* Ready phase - Component fully initialized
|
|
125
168
|
* Called bottom-up (children before parent)
|
|
@@ -148,6 +191,24 @@ export declare class Jqhtml_Component {
|
|
|
148
191
|
* @param callback Optional callback to execute when ready
|
|
149
192
|
*/
|
|
150
193
|
ready(callback?: () => void): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Returns a promise that resolves when the component has completed its
|
|
196
|
+
* synchronous render chain (after on_load's re-render if applicable,
|
|
197
|
+
* or after first render if no on_load override).
|
|
198
|
+
*
|
|
199
|
+
* This fires BEFORE on_ready() and before children are waited on.
|
|
200
|
+
* Use this when you need to know the component's DOM is stable but
|
|
201
|
+
* don't need to wait for the full async ready phase.
|
|
202
|
+
*
|
|
203
|
+
* The 'rendered' event fires exactly once per component lifecycle.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* await component.rendered();
|
|
207
|
+
* // DOM is now stable, on_render has completed
|
|
208
|
+
*
|
|
209
|
+
* @param callback Optional callback to execute when rendered
|
|
210
|
+
*/
|
|
211
|
+
rendered(callback?: () => void): Promise<void>;
|
|
151
212
|
/**
|
|
152
213
|
* Wait for all child components to reach ready state
|
|
153
214
|
* Ensures bottom-up ordering (children ready before parent)
|
|
@@ -237,11 +298,11 @@ export declare class Jqhtml_Component {
|
|
|
237
298
|
* Leaves DOM intact, just stops lifecycle engine and fires cleanup hooks
|
|
238
299
|
*/
|
|
239
300
|
stop(): void;
|
|
240
|
-
on_render(): void
|
|
241
|
-
on_create(): void
|
|
242
|
-
on_load(): Promise<void>;
|
|
301
|
+
on_render(): void;
|
|
302
|
+
on_create(): void;
|
|
303
|
+
on_load(): void | Promise<void>;
|
|
243
304
|
on_ready(): Promise<void>;
|
|
244
|
-
on_stop(): void
|
|
305
|
+
on_stop(): void;
|
|
245
306
|
/**
|
|
246
307
|
* Optional: Override cache key generation
|
|
247
308
|
*
|
|
@@ -273,18 +334,42 @@ export declare class Jqhtml_Component {
|
|
|
273
334
|
* Lifecycle event callbacks fire after the lifecycle method completes
|
|
274
335
|
* If a lifecycle event has already occurred, the callback fires immediately AND registers for future occurrences
|
|
275
336
|
* Custom events only fire when explicitly triggered via .trigger()
|
|
337
|
+
*
|
|
338
|
+
* Callback signature: (component, data?) => void
|
|
339
|
+
* - component: The component instance that triggered the event
|
|
340
|
+
* - data: Optional data passed as second parameter to trigger()
|
|
276
341
|
*/
|
|
277
|
-
on(event_name: string, callback: (component: Jqhtml_Component) => void): this;
|
|
342
|
+
on(event_name: string, callback: (component: Jqhtml_Component, data?: any) => void): this;
|
|
278
343
|
/**
|
|
279
344
|
* Trigger a lifecycle event - fires all registered callbacks
|
|
280
345
|
* Marks event as occurred so future .on() calls fire immediately
|
|
346
|
+
*
|
|
347
|
+
* @param event_name - Name of the event to trigger
|
|
348
|
+
* @param data - Optional data to pass to callbacks as second parameter
|
|
281
349
|
*/
|
|
282
|
-
trigger(event_name: string): void;
|
|
350
|
+
trigger(event_name: string, data?: any): void;
|
|
283
351
|
/**
|
|
284
352
|
* Check if any callbacks are registered for a given event
|
|
285
353
|
* Used to determine if cleanup logic needs to run
|
|
286
354
|
*/
|
|
287
355
|
_on_registered(event_name: string): boolean;
|
|
356
|
+
/**
|
|
357
|
+
* Invalidate a lifecycle event - removes the "already occurred" marker
|
|
358
|
+
*
|
|
359
|
+
* This is the opposite of trigger(). After invalidate() is called:
|
|
360
|
+
* - New .on() handlers will NOT fire immediately
|
|
361
|
+
* - The ready() promise will NOT resolve immediately
|
|
362
|
+
* - Handlers wait for the next trigger() call
|
|
363
|
+
*
|
|
364
|
+
* Existing registered callbacks are NOT removed - they'll fire on next trigger().
|
|
365
|
+
*
|
|
366
|
+
* Use case: Call invalidate('ready') at the start of reload() or render()
|
|
367
|
+
* so that any new .on('ready') handlers wait for the reload/render to complete
|
|
368
|
+
* rather than firing immediately based on the previous lifecycle's state.
|
|
369
|
+
*
|
|
370
|
+
* @param event_name - Name of the event to invalidate
|
|
371
|
+
*/
|
|
372
|
+
invalidate(event_name: string): void;
|
|
288
373
|
/**
|
|
289
374
|
* Find element by scoped ID
|
|
290
375
|
*
|
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE;YACb,GAAG,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;YACjF,UAAU,EAAE,MAAM,IAAI,CAAC;SACxB,CAAC;KACH;CACF;AAED,qBAAa,gBAAgB;IAE3B,MAAM,CAAC,kBAAkB,UAAQ;IACjC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGtB,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,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