@symfony/ux-live-component 3.0.0 → 3.1.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/dist/live_controller.js +9 -10
- package/package.json +1 -1
package/dist/live_controller.js
CHANGED
|
@@ -623,12 +623,9 @@ var Idiomorph = (function() {
|
|
|
623
623
|
} else if (ctx.head.shouldRemove(currentHeadElt) !== false) removed.push(currentHeadElt);
|
|
624
624
|
}
|
|
625
625
|
nodesToAppend.push(...srcToNewHeadNodes.values());
|
|
626
|
-
log("to append: ", nodesToAppend);
|
|
627
626
|
let promises = [];
|
|
628
627
|
for (const newNode of nodesToAppend) {
|
|
629
|
-
log("adding: ", newNode);
|
|
630
628
|
let newElt = document.createRange().createContextualFragment(newNode.outerHTML).firstChild;
|
|
631
|
-
log(newElt);
|
|
632
629
|
if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {
|
|
633
630
|
if (newElt.href || newElt.src) {
|
|
634
631
|
let resolve = null;
|
|
@@ -656,7 +653,6 @@ var Idiomorph = (function() {
|
|
|
656
653
|
});
|
|
657
654
|
return promises;
|
|
658
655
|
}
|
|
659
|
-
function log() {}
|
|
660
656
|
function noOp() {}
|
|
661
657
|
function mergeDefaults(config) {
|
|
662
658
|
let finalConfig = {};
|
|
@@ -1494,9 +1490,11 @@ var Component = class {
|
|
|
1494
1490
|
this.unsyncedInputsTracker.resetUnsyncedFields();
|
|
1495
1491
|
const filesToSend = {};
|
|
1496
1492
|
for (const [key, value] of Object.entries(this.pendingFiles)) if (value.files) filesToSend[key] = value.files;
|
|
1493
|
+
const actionsToSend = this.pendingActions.slice(0, 50);
|
|
1494
|
+
const remainingActions = this.pendingActions.slice(50);
|
|
1497
1495
|
const requestConfig = {
|
|
1498
1496
|
props: this.valueStore.getOriginalProps(),
|
|
1499
|
-
actions:
|
|
1497
|
+
actions: actionsToSend,
|
|
1500
1498
|
updated: this.valueStore.getDirtyProps(),
|
|
1501
1499
|
children: {},
|
|
1502
1500
|
updatedPropsFromParent: this.valueStore.getUpdatedPropsFromParent(),
|
|
@@ -1505,9 +1503,9 @@ var Component = class {
|
|
|
1505
1503
|
this.hooks.triggerHook("request:started", requestConfig);
|
|
1506
1504
|
this.backendRequest = this.backend.makeRequest(requestConfig.props, requestConfig.actions, requestConfig.updated, requestConfig.children, requestConfig.updatedPropsFromParent, requestConfig.files);
|
|
1507
1505
|
this.hooks.triggerHook("loading.state:started", this.element, this.backendRequest);
|
|
1508
|
-
this.pendingActions =
|
|
1506
|
+
this.pendingActions = remainingActions;
|
|
1509
1507
|
this.valueStore.flushDirtyPropsToPending();
|
|
1510
|
-
this.isRequestPending =
|
|
1508
|
+
this.isRequestPending = remainingActions.length > 0;
|
|
1511
1509
|
this.backendRequest.promise.then(async (response) => {
|
|
1512
1510
|
const backendResponse = new BackendResponse_default(response);
|
|
1513
1511
|
const html = await backendResponse.getBody();
|
|
@@ -1750,7 +1748,8 @@ var ChildComponentPlugin_default = class {
|
|
|
1750
1748
|
constructor(component) {
|
|
1751
1749
|
this.parentModelBindings = [];
|
|
1752
1750
|
this.component = component;
|
|
1753
|
-
|
|
1751
|
+
const modelDirectives = getAllModelDirectiveFromElements(this.component.element);
|
|
1752
|
+
this.parentModelBindings = modelDirectives.map(get_model_binding_default);
|
|
1754
1753
|
}
|
|
1755
1754
|
attachToComponent(component) {
|
|
1756
1755
|
component.on("request:started", (requestData) => {
|
|
@@ -1825,8 +1824,8 @@ var LoadingPlugin_default = class {
|
|
|
1825
1824
|
this.handleLoadingToggle(component, false, targetElement, null);
|
|
1826
1825
|
}
|
|
1827
1826
|
handleLoadingToggle(component, isLoading, targetElement, backendRequest) {
|
|
1828
|
-
if (isLoading)
|
|
1829
|
-
else
|
|
1827
|
+
if (isLoading) targetElement.setAttribute("aria-busy", "true");
|
|
1828
|
+
else targetElement.removeAttribute("aria-busy");
|
|
1830
1829
|
this.getLoadingDirectives(component, targetElement).forEach(({ element, directives }) => {
|
|
1831
1830
|
if (isLoading) this.addAttributes(element, ["data-live-is-loading"]);
|
|
1832
1831
|
else this.removeAttributes(element, ["data-live-is-loading"]);
|
package/package.json
CHANGED