@schukai/monster 5.2.0 → 5.2.2
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/CHANGELOG.md +20 -0
- package/package.json +1 -1
- package/source/components/content/stylesheet/fetch-box.mjs +1 -1
- package/source/components/content/viewer/stylesheet/message.mjs +1 -1
- package/source/components/data/stylesheet/kpi-tile.mjs +1 -1
- package/source/components/data/stylesheet/metric-graph.mjs +1 -1
- package/source/components/data/stylesheet/metric.mjs +1 -1
- package/source/components/datatable/stylesheet/dataset.mjs +1 -1
- package/source/components/datatable/stylesheet/datatable.mjs +2 -2
- package/source/components/form/stylesheet/button-bar.mjs +1 -1
- package/source/components/form/stylesheet/button.mjs +1 -1
- package/source/components/form/stylesheet/buy-box.mjs +1 -1
- package/source/components/form/stylesheet/cart-control.mjs +1 -1
- package/source/components/form/stylesheet/confirm-button.mjs +1 -1
- package/source/components/form/stylesheet/control-bar.mjs +1 -1
- package/source/components/form/stylesheet/form.mjs +1 -1
- package/source/components/form/stylesheet/input-group.mjs +1 -1
- package/source/components/form/stylesheet/login.mjs +1 -1
- package/source/components/form/stylesheet/message-state-button.mjs +1 -1
- package/source/components/form/stylesheet/password.mjs +1 -1
- package/source/components/form/stylesheet/popper-button.mjs +1 -1
- package/source/components/form/stylesheet/register-wizard.mjs +1 -1
- package/source/components/form/stylesheet/state-button.mjs +1 -1
- package/source/components/form/stylesheet/variant-select.mjs +1 -1
- package/source/components/form/stylesheet/wizard.mjs +1 -1
- package/source/components/host/stylesheet/host.mjs +1 -1
- package/source/components/layout/stylesheet/overlay.mjs +1 -1
- package/source/components/state/stylesheet/state.mjs +1 -1
- package/source/components/style/mixin/typography.pcss +1 -2
- package/source/components/style/skeleton.css +1 -1
- package/source/components/style/skeleton.pcss +2 -2
- package/source/components/style/surface.css +3 -1
- package/source/components/style/surface.pcss +4 -1
- package/source/components/style/theme-modern.css +1 -1
- package/source/components/style/theme-modern.pcss +1 -0
- package/source/components/style/typography.css +1 -1
- package/source/components/style/typography.pcss +26 -0
- package/source/components/stylesheet/skeleton.mjs +1 -1
- package/source/components/stylesheet/surface.mjs +3 -1
- package/source/components/stylesheet/theme-modern.mjs +1 -1
- package/source/components/stylesheet/typography.mjs +1 -1
- package/source/components/time/stylesheet/day.mjs +1 -1
- package/source/components/time/stylesheet/month-calendar.mjs +1 -1
- package/source/components/time/timeline/stylesheet/appointment.mjs +1 -1
- package/source/components/time/timeline/stylesheet/segment.mjs +1 -1
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +1 -1
- package/source/dom/updater.mjs +3 -0
- package/source/types/version.mjs +1 -1
- package/test/cases/components/layout/tabs.mjs +101 -3
- package/test/cases/components/style/skeleton.mjs +35 -2
- package/test/cases/components/style/surface.mjs +6 -1
- package/test/cases/components/style/theme-modern.mjs +19 -0
- package/test/cases/components/style/typography.mjs +63 -0
- package/test/cases/dom/updater.mjs +48 -0
|
@@ -860,6 +860,54 @@ describe("DOM", function () {
|
|
|
860
860
|
});
|
|
861
861
|
});
|
|
862
862
|
|
|
863
|
+
[false, true].forEach((batchUpdates) => {
|
|
864
|
+
it(`should isolate nested insert ownership with batchUpdates=${batchUpdates} issue #607`, async function () {
|
|
865
|
+
document.getElementById("mocks").innerHTML = `
|
|
866
|
+
<template id="shared-row">
|
|
867
|
+
<strong data-monster-replace="path:shared-row.label"></strong>
|
|
868
|
+
<em data-monster-replace="path:shared-row.label"></em>
|
|
869
|
+
</template>
|
|
870
|
+
<div id="outer-rows" data-monster-insert="shared-row path:rows.outer">
|
|
871
|
+
<div id="inner-rows" data-monster-insert="shared-row path:rows.inner"></div>
|
|
872
|
+
</div>
|
|
873
|
+
`;
|
|
874
|
+
const outer = document.getElementById("outer-rows");
|
|
875
|
+
const inner = document.getElementById("inner-rows");
|
|
876
|
+
const updater = new Updater(outer, {
|
|
877
|
+
rows: {
|
|
878
|
+
outer: [{ label: "Outer" }],
|
|
879
|
+
inner: [{ label: "Inner" }, { label: "Extra" }],
|
|
880
|
+
},
|
|
881
|
+
});
|
|
882
|
+
updater.setBatchUpdates(batchUpdates);
|
|
883
|
+
const owned = () => Array.from(outer.children).filter((node) => node !== inner);
|
|
884
|
+
try {
|
|
885
|
+
await updater.run();
|
|
886
|
+
const innerNodes = Array.from(inner.children);
|
|
887
|
+
expect(innerNodes).to.have.length(4);
|
|
888
|
+
expect(owned()).to.have.length(2);
|
|
889
|
+
const firstOuter = owned()[0];
|
|
890
|
+
updater.getSubject().rows.outer = [];
|
|
891
|
+
await waitUntil(() => owned().length === 0, "outer rows should be removed");
|
|
892
|
+
expect(Array.from(inner.children)).to.deep.equal(innerNodes);
|
|
893
|
+
expect(outer.hasAttribute("data-monster-error")).to.equal(false);
|
|
894
|
+
|
|
895
|
+
updater.getSubject().rows.outer = [{ label: "Returned" }, { label: "Second" }];
|
|
896
|
+
await waitUntil(() => owned().length === 4, "outer rows must not reuse inner nodes");
|
|
897
|
+
expect(owned()[0]).to.not.equal(firstOuter);
|
|
898
|
+
expect(owned().map((node) => node.textContent)).to.deep.equal([
|
|
899
|
+
"Returned", "Returned", "Second", "Second",
|
|
900
|
+
]);
|
|
901
|
+
expect(Array.from(inner.children)).to.deep.equal(innerNodes);
|
|
902
|
+
updater.getSubject().rows.inner = [];
|
|
903
|
+
await waitUntil(() => inner.children.length === 0, "inner rows should be removed");
|
|
904
|
+
expect(owned().length).to.equal(4);
|
|
905
|
+
} finally {
|
|
906
|
+
updater.dispose();
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
});
|
|
910
|
+
|
|
863
911
|
it("should process two insert containers with the same data path issue #548", async function () {
|
|
864
912
|
const mocks = document.getElementById("mocks");
|
|
865
913
|
mocks.innerHTML = `
|