@symfony/ux-live-component 2.32.0 → 2.34.0
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 +6 -5
- package/dist/live.min.css +1 -1
- package/dist/live_controller.d.ts +214 -219
- package/dist/live_controller.js +2243 -2994
- package/package.json +6 -9
package/README.md
CHANGED
|
@@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-live-component](https://packagist.org/packa
|
|
|
6
6
|
|
|
7
7
|
This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.).
|
|
8
8
|
|
|
9
|
-
We **strongly recommend not installing this package directly**, but instead
|
|
9
|
+
We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-live-component](https://packagist.org/packages/symfony/ux-live-component) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled.
|
|
10
10
|
|
|
11
11
|
If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-live-component](https://packagist.org/packages/symfony/ux-live-component) PHP package version:
|
|
12
|
+
|
|
12
13
|
```shell
|
|
13
14
|
composer require symfony/ux-live-component:2.23.0
|
|
14
15
|
npm add @symfony/ux-live-component@2.23.0
|
|
@@ -18,7 +19,7 @@ npm add @symfony/ux-live-component@2.23.0
|
|
|
18
19
|
|
|
19
20
|
## Resources
|
|
20
21
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
- [Documentation](https://symfony.com/bundles/ux-live-component/current/index.html)
|
|
23
|
+
- [Report issues](https://github.com/symfony/ux/issues) and
|
|
24
|
+
[send Pull Requests](https://github.com/symfony/ux/pulls)
|
|
25
|
+
in the [main Symfony UX repository](https://github.com/symfony/ux)
|
package/dist/live.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-loading=""],[data-loading=show],[data-loading*=\|show]{display:none}
|
|
1
|
+
[data-loading=""],[data-loading=show],[data-loading*=\|show]{display:none}
|
|
@@ -1,247 +1,242 @@
|
|
|
1
|
-
import { Controller } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getLiveUrl(): string | null;
|
|
1
|
+
import { Controller } from "@hotwired/stimulus";
|
|
2
|
+
declare class export_default$2 {
|
|
3
|
+
response: Response;
|
|
4
|
+
private body;
|
|
5
|
+
private liveUrl;
|
|
6
|
+
constructor(response: Response);
|
|
7
|
+
getBody(): Promise<string>;
|
|
8
|
+
getLiveUrl(): string | null;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
areAnyModelsUpdated(targetedModels: string[]): boolean;
|
|
10
|
+
declare class export_default$1 {
|
|
11
|
+
promise: Promise<Response>;
|
|
12
|
+
actions: string[];
|
|
13
|
+
updatedModels: string[];
|
|
14
|
+
isResolved: boolean;
|
|
15
|
+
constructor(promise: Promise<Response>, actions: string[], updateModels: string[]);
|
|
16
|
+
containsOneOfActions(targetedActions: string[]): boolean;
|
|
17
|
+
areAnyModelsUpdated(targetedModels: string[]): boolean;
|
|
20
18
|
}
|
|
21
|
-
|
|
22
19
|
interface ChildrenFingerprints {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
[key: string]: {
|
|
21
|
+
fingerprint: string;
|
|
22
|
+
tag: string;
|
|
23
|
+
};
|
|
27
24
|
}
|
|
28
25
|
interface BackendInterface {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
makeRequest(props: any, actions: BackendAction[], updated: {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}, children: ChildrenFingerprints, updatedPropsFromParent: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}, files: {
|
|
31
|
+
[key: string]: FileList;
|
|
32
|
+
}): export_default$1;
|
|
36
33
|
}
|
|
37
34
|
interface BackendAction {
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
name: string;
|
|
36
|
+
args: Record<string, string>;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
interface ElementDriver {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
getModelName(element: HTMLElement): string | null;
|
|
40
|
+
getComponentProps(): any;
|
|
41
|
+
getEventsToEmit(): Array<{
|
|
42
|
+
event: string;
|
|
43
|
+
data: any;
|
|
44
|
+
target: string | null;
|
|
45
|
+
componentName: string | null;
|
|
46
|
+
}>;
|
|
47
|
+
getBrowserEventsToDispatch(): Array<{
|
|
48
|
+
event: string;
|
|
49
|
+
payload: any;
|
|
50
|
+
}>;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
52
|
interface PluginInterface {
|
|
58
|
-
|
|
53
|
+
attachToComponent(component: Component): void;
|
|
59
54
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
storeNewPropsFromParent(props: any): boolean;
|
|
55
|
+
declare class export_default {
|
|
56
|
+
private props;
|
|
57
|
+
private dirtyProps;
|
|
58
|
+
private pendingProps;
|
|
59
|
+
private updatedPropsFromParent;
|
|
60
|
+
constructor(props: any);
|
|
61
|
+
get(name: string): any;
|
|
62
|
+
has(name: string): boolean;
|
|
63
|
+
set(name: string, value: any): boolean;
|
|
64
|
+
getOriginalProps(): any;
|
|
65
|
+
getDirtyProps(): any;
|
|
66
|
+
getUpdatedPropsFromParent(): any;
|
|
67
|
+
flushDirtyPropsToPending(): void;
|
|
68
|
+
reinitializeAllProps(props: any): void;
|
|
69
|
+
pushPendingPropsBackToDirty(): void;
|
|
70
|
+
storeNewPropsFromParent(props: any): boolean;
|
|
77
71
|
}
|
|
78
|
-
|
|
79
72
|
type MaybePromise<T = void> = T | Promise<T>;
|
|
80
73
|
type ComponentHooks = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
74
|
+
connect: (component: Component) => MaybePromise;
|
|
75
|
+
disconnect: (component: Component) => MaybePromise;
|
|
76
|
+
'request:started': (requestConfig: any) => MaybePromise;
|
|
77
|
+
'render:finished': (component: Component) => MaybePromise;
|
|
78
|
+
'response:error': (backendResponse: export_default$2, controls: {
|
|
79
|
+
displayError: boolean;
|
|
80
|
+
}) => MaybePromise;
|
|
81
|
+
'loading.state:started': (element: HTMLElement, request: export_default$1) => MaybePromise;
|
|
82
|
+
'loading.state:finished': (element: HTMLElement) => MaybePromise;
|
|
83
|
+
'model:set': (model: string, value: any, component: Component) => MaybePromise;
|
|
91
84
|
};
|
|
92
85
|
type ComponentHookName = keyof ComponentHooks;
|
|
93
86
|
type ComponentHookCallback<T extends string = ComponentHookName> = T extends ComponentHookName ? ComponentHooks[T] : (...args: any[]) => MaybePromise;
|
|
94
87
|
declare class Component {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
88
|
+
readonly element: HTMLElement;
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly listeners: Map<string, string[]>;
|
|
91
|
+
private backend;
|
|
92
|
+
readonly elementDriver: ElementDriver;
|
|
93
|
+
id: string | null;
|
|
94
|
+
fingerprint: string;
|
|
95
|
+
readonly valueStore: export_default;
|
|
96
|
+
private readonly unsyncedInputsTracker;
|
|
97
|
+
private hooks;
|
|
98
|
+
defaultDebounce: number;
|
|
99
|
+
private backendRequest;
|
|
100
|
+
private pendingActions;
|
|
101
|
+
private pendingFiles;
|
|
102
|
+
private isRequestPending;
|
|
103
|
+
private requestDebounceTimeout;
|
|
104
|
+
private nextRequestPromise;
|
|
105
|
+
private nextRequestPromiseResolve;
|
|
106
|
+
private externalMutationTracker;
|
|
107
|
+
constructor(element: HTMLElement, name: string, props: any, listeners: Array<{
|
|
108
|
+
event: string;
|
|
109
|
+
action: string;
|
|
110
|
+
}>, id: string | null, backend: BackendInterface, elementDriver: ElementDriver);
|
|
111
|
+
addPlugin(plugin: PluginInterface): void;
|
|
112
|
+
connect(): void;
|
|
113
|
+
disconnect(): void;
|
|
114
|
+
on<T extends string | ComponentHookName = ComponentHookName>(hookName: T, callback: ComponentHookCallback<T>): void;
|
|
115
|
+
off<T extends string | ComponentHookName = ComponentHookName>(hookName: T, callback: ComponentHookCallback<T>): void;
|
|
116
|
+
set(model: string, value: any, reRender?: boolean, debounce?: number | boolean): Promise<export_default$2>;
|
|
117
|
+
getData(model: string): any;
|
|
118
|
+
action(name: string, args?: any, debounce?: number | boolean): Promise<export_default$2>;
|
|
119
|
+
files(key: string, input: HTMLInputElement): void;
|
|
120
|
+
render(): Promise<export_default$2>;
|
|
121
|
+
getUnsyncedModels(): string[];
|
|
122
|
+
emit(name: string, data: any, onlyMatchingComponentsNamed?: string | null): void;
|
|
123
|
+
emitUp(name: string, data: any, onlyMatchingComponentsNamed?: string | null): void;
|
|
124
|
+
emitSelf(name: string, data: any): void;
|
|
125
|
+
private performEmit;
|
|
126
|
+
private doEmit;
|
|
127
|
+
private isTurboEnabled;
|
|
128
|
+
private tryStartingRequest;
|
|
129
|
+
private performRequest;
|
|
130
|
+
private processRerender;
|
|
131
|
+
private calculateDebounce;
|
|
132
|
+
private clearRequestDebounceTimeout;
|
|
133
|
+
private debouncedStartRequest;
|
|
134
|
+
private renderError;
|
|
135
|
+
private resetPromise;
|
|
136
|
+
_updateFromParentProps(props: any): void;
|
|
144
137
|
}
|
|
145
|
-
|
|
146
138
|
declare const getComponent: (element: HTMLElement) => Promise<Component>;
|
|
147
|
-
|
|
148
139
|
interface LiveEvent extends CustomEvent {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
140
|
+
detail: {
|
|
141
|
+
controller: LiveController;
|
|
142
|
+
component: Component;
|
|
143
|
+
};
|
|
153
144
|
}
|
|
154
145
|
interface LiveController {
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
element: HTMLElement;
|
|
147
|
+
component: Component;
|
|
157
148
|
}
|
|
158
149
|
declare class LiveControllerDefault extends Controller<HTMLElement> implements LiveController {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
};
|
|
166
|
-
propsUpdatedFromParent: {
|
|
167
|
-
type: ObjectConstructor;
|
|
168
|
-
default: {};
|
|
169
|
-
};
|
|
170
|
-
listeners: {
|
|
171
|
-
type: ArrayConstructor;
|
|
172
|
-
default: never[];
|
|
173
|
-
};
|
|
174
|
-
eventsToEmit: {
|
|
175
|
-
type: ArrayConstructor;
|
|
176
|
-
default: never[];
|
|
177
|
-
};
|
|
178
|
-
eventsToDispatch: {
|
|
179
|
-
type: ArrayConstructor;
|
|
180
|
-
default: never[];
|
|
181
|
-
};
|
|
182
|
-
debounce: {
|
|
183
|
-
type: NumberConstructor;
|
|
184
|
-
default: number;
|
|
185
|
-
};
|
|
186
|
-
fingerprint: {
|
|
187
|
-
type: StringConstructor;
|
|
188
|
-
default: string;
|
|
189
|
-
};
|
|
190
|
-
requestMethod: {
|
|
191
|
-
type: StringConstructor;
|
|
192
|
-
default: string;
|
|
193
|
-
};
|
|
150
|
+
static values: {
|
|
151
|
+
name: StringConstructor;
|
|
152
|
+
url: StringConstructor;
|
|
153
|
+
props: {
|
|
154
|
+
type: ObjectConstructor;
|
|
155
|
+
default: {};
|
|
194
156
|
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
157
|
+
propsUpdatedFromParent: {
|
|
158
|
+
type: ObjectConstructor;
|
|
159
|
+
default: {};
|
|
160
|
+
};
|
|
161
|
+
listeners: {
|
|
162
|
+
type: ArrayConstructor;
|
|
163
|
+
default: never[];
|
|
164
|
+
};
|
|
165
|
+
eventsToEmit: {
|
|
166
|
+
type: ArrayConstructor;
|
|
167
|
+
default: never[];
|
|
168
|
+
};
|
|
169
|
+
eventsToDispatch: {
|
|
170
|
+
type: ArrayConstructor;
|
|
171
|
+
default: never[];
|
|
172
|
+
};
|
|
173
|
+
debounce: {
|
|
174
|
+
type: NumberConstructor;
|
|
175
|
+
default: number;
|
|
176
|
+
};
|
|
177
|
+
fingerprint: {
|
|
178
|
+
type: StringConstructor;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
181
|
+
requestMethod: {
|
|
182
|
+
type: StringConstructor;
|
|
183
|
+
default: string;
|
|
184
|
+
};
|
|
185
|
+
fetchCredentials: {
|
|
186
|
+
type: StringConstructor;
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
readonly nameValue: string;
|
|
191
|
+
readonly urlValue: string;
|
|
192
|
+
readonly propsValue: any;
|
|
193
|
+
propsUpdatedFromParentValue: any;
|
|
194
|
+
readonly listenersValue: Array<{
|
|
195
|
+
event: string;
|
|
196
|
+
action: string;
|
|
197
|
+
}>;
|
|
198
|
+
readonly eventsToEmitValue: Array<{
|
|
199
|
+
event: string;
|
|
200
|
+
data: any;
|
|
201
|
+
target: string | null;
|
|
202
|
+
componentName: string | null;
|
|
203
|
+
}>;
|
|
204
|
+
readonly eventsToDispatchValue: Array<{
|
|
205
|
+
event: string;
|
|
206
|
+
payload: any;
|
|
207
|
+
}>;
|
|
208
|
+
readonly hasDebounceValue: boolean;
|
|
209
|
+
readonly debounceValue: number;
|
|
210
|
+
readonly fingerprintValue: string;
|
|
211
|
+
readonly requestMethodValue: 'get' | 'post';
|
|
212
|
+
readonly fetchCredentialsValue: RequestCredentials;
|
|
213
|
+
private proxiedComponent;
|
|
214
|
+
private mutationObserver;
|
|
215
|
+
component: Component;
|
|
216
|
+
pendingActionTriggerModelElement: HTMLElement | null;
|
|
217
|
+
private elementEventListeners;
|
|
218
|
+
private pendingFiles;
|
|
219
|
+
static backendFactory: (controller: LiveControllerDefault) => BackendInterface;
|
|
220
|
+
initialize(): void;
|
|
221
|
+
connect(): void;
|
|
222
|
+
disconnect(): void;
|
|
223
|
+
update(event: any): void;
|
|
224
|
+
action(event: any): void;
|
|
225
|
+
$render(): Promise<export_default$2>;
|
|
226
|
+
emit(event: any): void;
|
|
227
|
+
emitUp(event: any): void;
|
|
228
|
+
emitSelf(event: any): void;
|
|
229
|
+
$updateModel(model: string, value: any, shouldRender?: boolean, debounce?: number | boolean): Promise<export_default$2>;
|
|
230
|
+
propsUpdatedFromParentValueChanged(): void;
|
|
231
|
+
fingerprintValueChanged(): void;
|
|
232
|
+
private getEmitDirectives;
|
|
233
|
+
private createComponent;
|
|
234
|
+
private connectComponent;
|
|
235
|
+
private disconnectComponent;
|
|
236
|
+
private handleInputEvent;
|
|
237
|
+
private handleChangeEvent;
|
|
238
|
+
private updateModelFromElementEvent;
|
|
239
|
+
private dispatchEvent;
|
|
240
|
+
private onMutations;
|
|
245
241
|
}
|
|
246
|
-
|
|
247
|
-
export { Component, type LiveController, type LiveEvent, LiveControllerDefault as default, getComponent };
|
|
242
|
+
export { Component, LiveController, LiveEvent, LiveControllerDefault as default, getComponent };
|