@schukai/monster 4.148.8 → 4.149.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/package.json +1 -1
- package/source/components/accessibility/stylesheet/locale-picker.mjs +61 -1
- package/source/components/content/image-editor.mjs +79 -11
- package/source/components/content/style/copy.pcss +1 -1
- package/source/components/content/stylesheet/camera-capture.mjs +1 -1
- package/source/components/content/stylesheet/copy.mjs +1 -1
- package/source/components/content/stylesheet/fetch-box.mjs +1 -1
- package/source/components/content/stylesheet/viewer.mjs +61 -1
- package/source/components/data/kpi-tile.mjs +5 -3
- package/source/components/data/metric-graph.mjs +22 -20
- package/source/components/data/metric.mjs +20 -18
- package/source/components/data/style/kpi-tile.pcss +65 -43
- package/source/components/data/style/metric-graph.pcss +35 -18
- package/source/components/data/style/metric.pcss +35 -28
- package/source/components/data/stylesheet/kpi-tile.mjs +61 -1
- package/source/components/data/stylesheet/metric-graph.mjs +61 -1
- package/source/components/data/stylesheet/metric.mjs +61 -1
- package/source/components/datatable/columnbar.mjs +4 -2
- package/source/components/datatable/datatable.mjs +73 -15
- package/source/components/datatable/filter/date-range.mjs +61 -61
- package/source/components/datatable/filter/date-time.mjs +5 -1
- package/source/components/datatable/filter/range.mjs +3 -3
- package/source/components/datatable/filter/select-operator.mjs +7 -1
- package/source/components/datatable/filter/text-operator.mjs +11 -3
- package/source/components/datatable/filter.mjs +16 -0
- package/source/components/datatable/pagination.mjs +2 -2
- package/source/components/datatable/style/column-bar.pcss +115 -23
- package/source/components/datatable/style/datatable.pcss +257 -29
- package/source/components/datatable/style/embedded-pagination.pcss +63 -34
- package/source/components/datatable/style/filter-button.pcss +1 -1
- package/source/components/datatable/style/filter-controls-defaults.pcss +49 -3
- package/source/components/datatable/style/filter-select.pcss +4 -1
- package/source/components/datatable/style/filter.pcss +18 -1
- package/source/components/datatable/stylesheet/change-button.mjs +61 -1
- package/source/components/datatable/stylesheet/column-bar.mjs +69 -1
- package/source/components/datatable/stylesheet/dataset.mjs +61 -1
- package/source/components/datatable/stylesheet/datatable.mjs +71 -1
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
- package/source/components/datatable/stylesheet/filter-button.mjs +1 -1
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +1 -1
- package/source/components/datatable/stylesheet/filter-select.mjs +61 -1
- package/source/components/datatable/stylesheet/filter.mjs +61 -1
- package/source/components/datatable/stylesheet/pagination.mjs +67 -1
- package/source/components/datatable/stylesheet/save-button.mjs +61 -1
- package/source/components/datatable/stylesheet/status.mjs +61 -1
- package/source/components/form/action-button.mjs +2 -1
- package/source/components/form/button-bar.mjs +7 -2
- package/source/components/form/context-error.mjs +4 -3
- package/source/components/form/context-help.mjs +10 -4
- package/source/components/form/context-hint.mjs +1 -1
- package/source/components/form/context-info.mjs +1 -1
- package/source/components/form/context-note.mjs +1 -1
- package/source/components/form/context-success.mjs +1 -1
- package/source/components/form/context-warning.mjs +1 -1
- package/source/components/form/control-bar.mjs +300 -14
- package/source/components/form/credential-button.mjs +4 -2
- package/source/components/form/digits.mjs +28 -1
- package/source/components/form/field-set.mjs +30 -0
- package/source/components/form/login.mjs +13 -10
- package/source/components/form/password.mjs +6 -0
- package/source/components/form/popper-button.mjs +1 -1
- package/source/components/form/quantity.mjs +14 -6
- package/source/components/form/register-wizard.mjs +46 -26
- package/source/components/form/select.mjs +17 -10
- package/source/components/form/sheet.mjs +13 -2
- package/source/components/form/style/action-button.pcss +131 -5
- package/source/components/form/style/button-bar.pcss +204 -3
- package/source/components/form/style/control-bar.pcss +254 -26
- package/source/components/form/style/digits.pcss +7 -6
- package/source/components/form/style/input-group.pcss +65 -1
- package/source/components/form/style/login.pcss +1 -1
- package/source/components/form/style/mixin/field-set-layout.pcss +8 -0
- package/source/components/form/style/password.pcss +25 -1
- package/source/components/form/style/popper-button.pcss +1 -0
- package/source/components/form/style/quantity.pcss +11 -20
- package/source/components/form/style/select.pcss +52 -7
- package/source/components/form/style/sheet.pcss +70 -1
- package/source/components/form/style/state-button.pcss +5 -2
- package/source/components/form/style/toggle-switch.pcss +7 -4
- package/source/components/form/stylesheet/action-button.mjs +63 -1
- package/source/components/form/stylesheet/button-bar.mjs +153 -1
- package/source/components/form/stylesheet/button.mjs +61 -1
- package/source/components/form/stylesheet/control-bar.mjs +163 -1
- package/source/components/form/stylesheet/digits.mjs +1 -1
- package/source/components/form/stylesheet/field-layout.mjs +1 -1
- package/source/components/form/stylesheet/field-set.mjs +1 -1
- package/source/components/form/stylesheet/form.mjs +1 -1
- package/source/components/form/stylesheet/input-group.mjs +15 -1
- package/source/components/form/stylesheet/login.mjs +1 -1
- package/source/components/form/stylesheet/password.mjs +7 -1
- package/source/components/form/stylesheet/popper-button.mjs +61 -1
- package/source/components/form/stylesheet/quantity.mjs +1 -1
- package/source/components/form/stylesheet/register-wizard.mjs +1 -1
- package/source/components/form/stylesheet/select.mjs +3 -1
- package/source/components/form/stylesheet/sheet.mjs +1 -1
- package/source/components/form/stylesheet/state-button.mjs +3 -1
- package/source/components/form/stylesheet/toggle-switch.mjs +1 -1
- package/source/components/form/stylesheet/wizard.mjs +1 -1
- package/source/components/form/util/floating-ui.mjs +35 -7
- package/source/components/host/call-button.mjs +3 -1
- package/source/components/host/stylesheet/call-button.mjs +61 -1
- package/source/components/host/stylesheet/host.mjs +1 -1
- package/source/components/host/stylesheet/toggle-button.mjs +61 -1
- package/source/components/layout/full-screen.mjs +31 -23
- package/source/components/layout/iframe.mjs +5 -1
- package/source/components/layout/popper.mjs +34 -4
- package/source/components/layout/style/full-screen.pcss +94 -23
- package/source/components/layout/style/split-panel.pcss +57 -5
- package/source/components/layout/style/tabs.pcss +277 -47
- package/source/components/layout/style/vertical-tabs.pcss +147 -0
- package/source/components/layout/stylesheet/collapse.mjs +61 -1
- package/source/components/layout/stylesheet/details.mjs +61 -1
- package/source/components/layout/stylesheet/full-screen.mjs +23 -1
- package/source/components/layout/stylesheet/overlay.mjs +1 -1
- package/source/components/layout/stylesheet/panel.mjs +1 -1
- package/source/components/layout/stylesheet/slider.mjs +1 -1
- package/source/components/layout/stylesheet/split-panel.mjs +17 -1
- package/source/components/layout/stylesheet/tabs.mjs +97 -1
- package/source/components/layout/stylesheet/vertical-tabs.mjs +33 -95
- package/source/components/layout/tabs.mjs +63 -0
- package/source/components/layout/vertical-tabs.mjs +63 -0
- package/source/components/navigation/stylesheet/site-navigation.mjs +1 -1
- package/source/components/navigation/stylesheet/table-of-content.mjs +1 -1
- package/source/components/navigation/stylesheet/wizard-navigation.mjs +1 -1
- package/source/components/navigation/table-of-content.mjs +13 -0
- package/source/components/notify/style/notify.pcss +1 -2
- package/source/components/notify/stylesheet/message.mjs +1 -1
- package/source/components/notify/stylesheet/notify.mjs +1 -1
- package/source/components/state/style/log.pcss +1 -0
- package/source/components/state/style/state.pcss +5 -1
- package/source/components/state/stylesheet/log.mjs +1 -1
- package/source/components/state/stylesheet/state.mjs +7 -1
- package/source/components/style/button.css +61 -205
- package/source/components/style/button.pcss +78 -34
- package/source/components/style/common.css +1 -170
- package/source/components/style/common.pcss +5 -9
- package/source/components/style/form.css +1 -49
- package/source/components/style/form.pcss +24 -6
- package/source/components/style/link.css +1 -39
- package/source/components/style/link.pcss +8 -16
- package/source/components/style/mixin/button.pcss +19 -10
- package/source/components/style/mixin/property.pcss +8 -0
- package/source/components/style/mixin/skeleton.pcss +11 -5
- package/source/components/style/normalize.css +1 -144
- package/source/components/style/normalize.pcss +5 -5
- package/source/components/style/property.css +1 -387
- package/source/components/style/skeleton.css +1 -198
- package/source/components/style/skeleton.pcss +8 -2
- package/source/components/style/theme-modern.css +74 -0
- package/source/components/style/theme-modern.pcss +498 -0
- package/source/components/stylesheet/button.mjs +61 -1
- package/source/components/stylesheet/common.mjs +1 -1
- package/source/components/stylesheet/form.mjs +1 -1
- package/source/components/stylesheet/link.mjs +1 -1
- package/source/components/stylesheet/normalize.mjs +1 -1
- package/source/components/stylesheet/property.mjs +1 -1
- package/source/components/stylesheet/skeleton.mjs +1 -1
- package/source/components/stylesheet/theme-modern.mjs +110 -0
- package/source/components/time/stylesheet/day.mjs +61 -1
- package/source/components/time/stylesheet/month-calendar.mjs +61 -1
- package/source/components/time/timeline/stylesheet/appointment.mjs +61 -1
- package/source/components/time/timeline/stylesheet/segment.mjs +61 -1
- package/source/components/tree-menu/style/tree-menu.pcss +26 -37
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +1 -1
- package/source/dom/customelement.mjs +105 -40
- package/source/dom/updater.mjs +381 -119
- package/test/cases/components/content/image-editor.mjs +19 -0
- package/test/cases/components/datatable/accessibility-defaults.mjs +112 -0
- package/test/cases/components/datatable/filter-availability.mjs +37 -0
- package/test/cases/components/datatable/filter-date-range-layout.mjs +40 -0
- package/test/cases/components/datatable/filter-select-operator.mjs +118 -0
- package/test/cases/components/datatable/mobile-layout.mjs +203 -0
- package/test/cases/components/datatable/responsive-breakpoint.mjs +41 -0
- package/test/cases/components/datatable/selection.mjs +149 -0
- package/test/cases/components/form/action-button-style.mjs +85 -0
- package/test/cases/components/form/button-bar.mjs +222 -3
- package/test/cases/components/form/context-theme-colors.mjs +59 -0
- package/test/cases/components/form/control-bar.mjs +228 -3
- package/test/cases/components/form/control-heights.mjs +103 -0
- package/test/cases/components/form/digits-accessibility.mjs +65 -0
- package/test/cases/components/form/field-set.mjs +54 -0
- package/test/cases/components/form/floating-ui.mjs +74 -0
- package/test/cases/components/form/input-group.mjs +61 -28
- package/test/cases/components/form/login.mjs +47 -0
- package/test/cases/components/form/password.mjs +63 -0
- package/test/cases/components/form/popper-button.mjs +30 -15
- package/test/cases/components/form/quantity-accessibility.mjs +46 -0
- package/test/cases/components/form/register-wizard.mjs +79 -0
- package/test/cases/components/form/select.mjs +94 -2
- package/test/cases/components/form/sheet.mjs +56 -2
- package/test/cases/components/host/toggle-button.mjs +50 -0
- package/test/cases/components/layout/full-screen.mjs +60 -0
- package/test/cases/components/layout/iframe-accessibility.mjs +44 -0
- package/test/cases/components/layout/popper.mjs +128 -0
- package/test/cases/components/layout/slit-panel.mjs +30 -1
- package/test/cases/components/layout/tabs.mjs +93 -0
- package/test/cases/components/navigation/table-of-content.mjs +18 -0
- package/test/cases/components/state/state-style.mjs +31 -0
- package/test/cases/components/style/action-menu.mjs +74 -0
- package/test/cases/components/style/form-controls.mjs +37 -0
- package/test/cases/components/style/kpi-tile.mjs +60 -0
- package/test/cases/components/style/legacy-theme-compatibility.mjs +137 -0
- package/test/cases/components/style/metric-layout.mjs +94 -0
- package/test/cases/components/style/skeleton.mjs +69 -0
- package/test/cases/components/style/theme-component-catalog.mjs +853 -0
- package/test/cases/components/style/theme-modern.mjs +439 -0
- package/test/cases/components/style/theme-review-regressions.mjs +41 -0
- package/test/cases/dom/customelement.mjs +136 -1
- package/test/cases/dom/updater.mjs +174 -0
|
@@ -170,6 +170,7 @@ let htmlPatchVsReplace = `
|
|
|
170
170
|
|
|
171
171
|
describe("DOM", function () {
|
|
172
172
|
let Updater = null;
|
|
173
|
+
let addObjectWithUpdaterToElement = null;
|
|
173
174
|
|
|
174
175
|
before(function (done) {
|
|
175
176
|
const options = {};
|
|
@@ -177,6 +178,7 @@ describe("DOM", function () {
|
|
|
177
178
|
import("../../../source/dom/updater.mjs")
|
|
178
179
|
.then((m) => {
|
|
179
180
|
Updater = m.Updater;
|
|
181
|
+
addObjectWithUpdaterToElement = m.addObjectWithUpdaterToElement;
|
|
180
182
|
|
|
181
183
|
if (!customElements.get("monster-test-property")) {
|
|
182
184
|
class MonsterTestProperty extends HTMLElement {
|
|
@@ -1907,6 +1909,50 @@ describe("DOM", function () {
|
|
|
1907
1909
|
});
|
|
1908
1910
|
|
|
1909
1911
|
describe("Updater reactive updates", function () {
|
|
1912
|
+
it("should enable configured batching before the initial run issue #517", async function () {
|
|
1913
|
+
const originalRun = Updater.prototype.run;
|
|
1914
|
+
const originalSetBatchUpdates = Updater.prototype.setBatchUpdates;
|
|
1915
|
+
const batchedUpdaters = new WeakSet();
|
|
1916
|
+
const batchStateAtRun = [];
|
|
1917
|
+
const symbol = Symbol("initial-batch-test");
|
|
1918
|
+
const element = document.createElement("div");
|
|
1919
|
+
element.setAttribute("data-monster-replace", "path:value");
|
|
1920
|
+
document.getElementById("mocks").appendChild(element);
|
|
1921
|
+
|
|
1922
|
+
Updater.prototype.setBatchUpdates = function (enabled) {
|
|
1923
|
+
if (enabled === true) {
|
|
1924
|
+
batchedUpdaters.add(this);
|
|
1925
|
+
}
|
|
1926
|
+
return originalSetBatchUpdates.call(this, enabled);
|
|
1927
|
+
};
|
|
1928
|
+
Updater.prototype.run = function () {
|
|
1929
|
+
batchStateAtRun.push(batchedUpdaters.has(this));
|
|
1930
|
+
return originalRun.call(this);
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
let updaters = [];
|
|
1934
|
+
try {
|
|
1935
|
+
updaters = await Promise.all(
|
|
1936
|
+
addObjectWithUpdaterToElement.call(
|
|
1937
|
+
element,
|
|
1938
|
+
element,
|
|
1939
|
+
symbol,
|
|
1940
|
+
{ value: "initial" },
|
|
1941
|
+
{ batchUpdates: true },
|
|
1942
|
+
),
|
|
1943
|
+
);
|
|
1944
|
+
|
|
1945
|
+
expect(batchStateAtRun).to.deep.equal([true]);
|
|
1946
|
+
expect(element.textContent).to.equal("initial");
|
|
1947
|
+
} finally {
|
|
1948
|
+
Updater.prototype.run = originalRun;
|
|
1949
|
+
Updater.prototype.setBatchUpdates = originalSetBatchUpdates;
|
|
1950
|
+
for (const updater of updaters) {
|
|
1951
|
+
updater.dispose();
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
|
|
1910
1956
|
[false, true].forEach((batchUpdates) => {
|
|
1911
1957
|
it(`should preserve microtask changes with batchUpdates=${batchUpdates} issue #496`, async function () {
|
|
1912
1958
|
let mocks = document.getElementById("mocks");
|
|
@@ -1938,6 +1984,134 @@ describe("DOM", function () {
|
|
|
1938
1984
|
});
|
|
1939
1985
|
});
|
|
1940
1986
|
|
|
1987
|
+
[false, true].forEach((batchUpdates) => {
|
|
1988
|
+
it(`should render each binding once per snapshot with batchUpdates=${batchUpdates} issue #517`, async function () {
|
|
1989
|
+
const mocks = document.getElementById("mocks");
|
|
1990
|
+
const staticBindings = Array.from(
|
|
1991
|
+
{ length: 20 },
|
|
1992
|
+
(_, index) =>
|
|
1993
|
+
`<span data-index="${index}" data-monster-replace="static:marker | call:trackStatic"></span>`,
|
|
1994
|
+
).join("");
|
|
1995
|
+
mocks.innerHTML = `
|
|
1996
|
+
<span id="snapshot-items" data-monster-replace="path:items | call:lastItem"></span>
|
|
1997
|
+
${staticBindings}
|
|
1998
|
+
<span id="snapshot-attribute" data-monster-attributes="title path:items | call:trackAttribute"></span>
|
|
1999
|
+
<input id="snapshot-property" data-monster-properties="value path:items | call:trackProperty">
|
|
2000
|
+
`;
|
|
2001
|
+
|
|
2002
|
+
const updater = new Updater(mocks, { items: [] });
|
|
2003
|
+
updater.setBatchUpdates(batchUpdates);
|
|
2004
|
+
let staticRenderCount = 0;
|
|
2005
|
+
let attributeRenderCount = 0;
|
|
2006
|
+
let propertyRenderCount = 0;
|
|
2007
|
+
updater.setCallback("trackStatic", (value) => {
|
|
2008
|
+
staticRenderCount++;
|
|
2009
|
+
return value;
|
|
2010
|
+
});
|
|
2011
|
+
updater.setCallback("lastItem", (value) => value.at(-1) ?? "");
|
|
2012
|
+
updater.setCallback("trackAttribute", (value) => {
|
|
2013
|
+
attributeRenderCount++;
|
|
2014
|
+
return value;
|
|
2015
|
+
});
|
|
2016
|
+
updater.setCallback("trackProperty", (value) => {
|
|
2017
|
+
propertyRenderCount++;
|
|
2018
|
+
return value;
|
|
2019
|
+
});
|
|
2020
|
+
|
|
2021
|
+
let innerHTMLDescriptor = null;
|
|
2022
|
+
let replacementWrites = 0;
|
|
2023
|
+
try {
|
|
2024
|
+
await updater.run();
|
|
2025
|
+
staticRenderCount = 0;
|
|
2026
|
+
attributeRenderCount = 0;
|
|
2027
|
+
propertyRenderCount = 0;
|
|
2028
|
+
|
|
2029
|
+
innerHTMLDescriptor = Object.getOwnPropertyDescriptor(
|
|
2030
|
+
Element.prototype,
|
|
2031
|
+
"innerHTML",
|
|
2032
|
+
);
|
|
2033
|
+
Object.defineProperty(Element.prototype, "innerHTML", {
|
|
2034
|
+
configurable: innerHTMLDescriptor.configurable,
|
|
2035
|
+
enumerable: innerHTMLDescriptor.enumerable,
|
|
2036
|
+
get: innerHTMLDescriptor.get,
|
|
2037
|
+
set(value) {
|
|
2038
|
+
if (
|
|
2039
|
+
mocks.contains(this) &&
|
|
2040
|
+
this.hasAttribute("data-monster-replace")
|
|
2041
|
+
) {
|
|
2042
|
+
replacementWrites++;
|
|
2043
|
+
}
|
|
2044
|
+
return innerHTMLDescriptor.set.call(this, value);
|
|
2045
|
+
},
|
|
2046
|
+
});
|
|
2047
|
+
|
|
2048
|
+
const items = updater.getSubject().items;
|
|
2049
|
+
for (let index = 0; index < 500; index++) {
|
|
2050
|
+
items.push(`new-${index}`);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
await new Promise((resolve) => setTimeout(resolve, 30));
|
|
2054
|
+
|
|
2055
|
+
expect(document.getElementById("snapshot-items").textContent).to.equal(
|
|
2056
|
+
"new-499",
|
|
2057
|
+
);
|
|
2058
|
+
expect(staticRenderCount).to.equal(20);
|
|
2059
|
+
expect(attributeRenderCount).to.equal(1);
|
|
2060
|
+
expect(propertyRenderCount).to.equal(1);
|
|
2061
|
+
expect(replacementWrites).to.equal(1);
|
|
2062
|
+
} finally {
|
|
2063
|
+
updater.dispose();
|
|
2064
|
+
if (innerHTMLDescriptor) {
|
|
2065
|
+
Object.defineProperty(
|
|
2066
|
+
Element.prototype,
|
|
2067
|
+
"innerHTML",
|
|
2068
|
+
innerHTMLDescriptor,
|
|
2069
|
+
);
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
});
|
|
2074
|
+
|
|
2075
|
+
it("should not rewrite unchanged replacement content issue #517", async function () {
|
|
2076
|
+
const mocks = document.getElementById("mocks");
|
|
2077
|
+
mocks.innerHTML = `
|
|
2078
|
+
<span id="unchanged-replacement" data-monster-replace="static:same"></span>
|
|
2079
|
+
`;
|
|
2080
|
+
|
|
2081
|
+
const element = document.getElementById("unchanged-replacement");
|
|
2082
|
+
const descriptor = Object.getOwnPropertyDescriptor(
|
|
2083
|
+
Element.prototype,
|
|
2084
|
+
"innerHTML",
|
|
2085
|
+
);
|
|
2086
|
+
let writes = 0;
|
|
2087
|
+
|
|
2088
|
+
Object.defineProperty(Element.prototype, "innerHTML", {
|
|
2089
|
+
configurable: descriptor.configurable,
|
|
2090
|
+
enumerable: descriptor.enumerable,
|
|
2091
|
+
get: descriptor.get,
|
|
2092
|
+
set(value) {
|
|
2093
|
+
if (this === element) {
|
|
2094
|
+
writes++;
|
|
2095
|
+
}
|
|
2096
|
+
return descriptor.set.call(this, value);
|
|
2097
|
+
},
|
|
2098
|
+
});
|
|
2099
|
+
|
|
2100
|
+
const updater = new Updater(mocks, { trigger: 0 });
|
|
2101
|
+
try {
|
|
2102
|
+
await updater.run();
|
|
2103
|
+
writes = 0;
|
|
2104
|
+
updater.getSubject().trigger = 1;
|
|
2105
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
2106
|
+
|
|
2107
|
+
expect(element.textContent).to.equal("same");
|
|
2108
|
+
expect(writes).to.equal(0);
|
|
2109
|
+
} finally {
|
|
2110
|
+
updater.dispose();
|
|
2111
|
+
Object.defineProperty(Element.prototype, "innerHTML", descriptor);
|
|
2112
|
+
}
|
|
2113
|
+
});
|
|
2114
|
+
|
|
1941
2115
|
it("should update the DOM when the subject changes", function (done) {
|
|
1942
2116
|
let mocks = document.getElementById("mocks");
|
|
1943
2117
|
mocks.innerHTML = html1;
|