@wpmoo/ui 1.0.0-rc.6 → 1.0.0-rc.8
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/ASSET_LICENSE.md +1 -1
- package/README.md +37 -6
- package/certification.json +6 -2
- package/dist/assets/css/moo-ui.css +7799 -8113
- package/dist/assets/css/moo-ui.min.css +5 -5
- package/dist/assets/css/moo.css +707 -685
- package/dist/assets/css/moo.min.css +5 -5
- package/dist/js/chart.js +57 -5
- package/dist/js/chart.min.js +3 -3
- package/dist/js/combobox.js +1 -1
- package/dist/js/context-menu.js +1 -1
- package/dist/js/datatable.js +114 -213
- package/dist/js/datepicker.js +79 -37
- package/dist/js/datepicker.min.js +2 -2
- package/dist/js/moo-ui.js +169 -52
- package/dist/js/moo-ui.min.js +3 -3
- package/dist/js/sidebar.js +122 -175
- package/dist/js/slider.js +1 -1
- package/dist/js/theme-prepaint.js +91 -0
- package/dist/release-manifest.json +24 -0
- package/package.json +12 -8
- package/scss/_components.scss +1 -4
- package/scss/components/_alert.scss +1 -2
- package/scss/components/_card.scss +5 -5
- package/scss/components/_close_button.scss +8 -3
- package/scss/components/_dialog.scss +16 -0
- package/scss/components/_dropdown.scss +12 -7
- package/scss/components/_search_trigger.scss +62 -0
- package/scss/components/_sidebar.scss +1 -2
- package/scss/components/_switch.scss +13 -5
- package/scss/components/_tabs.scss +1 -1
- package/scss/components/sidebar/_base.scss +93 -0
- package/scss/components/sidebar/_collapsed.scss +9 -90
- package/scss/foundations/_backdrop.scss +128 -0
- package/scss/foundations/_scope.scss +8 -0
- package/scss/layouts/_app.scss +77 -0
- package/scss/layouts/app/sidebar/_base.scss +117 -0
- package/scss/layouts/app/sidebar/_default.scss +26 -0
- package/scss/layouts/app/sidebar/_floating.scss +44 -0
- package/scss/layouts/app/sidebar/_inset.scss +29 -0
- package/scss/mixins/_banner.scss +3 -0
- package/scss/moo-core.scss +6 -34
- package/scss/moo-ui.scss +6 -6
- package/scss/settings/_bootstrap_overrides.scss +4 -0
- package/scss/settings/_component_variables.scss +20 -1
- package/scss/settings/_options.scss +2 -0
- package/scss/settings/_palette.scss +1 -1
- package/scss/themes/_forms.scss +15 -0
- package/scss/themes/_root.scss +16 -0
- package/scss/themes/_standalone.scss +5 -0
- package/scss/themes/{_scoped_core.scss → _theme.scss} +1 -0
- package/scss/components/sidebar/_inset.scss +0 -59
- package/scss/components/sidebar/_layout.scss +0 -176
- package/scss/foundations/_core_state_layer.scss +0 -25
- package/scss/foundations/_overlay_backdrop.scss +0 -19
- package/scss/themes/_standalone_root.scss +0 -119
- /package/scss/foundations/{_core_global_primitives.scss → _globals.scss} +0 -0
package/dist/js/chart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI chart.js v1.0.0-rc.
|
|
2
|
+
* Moo UI chart.js v1.0.0-rc.8 (https://ui.wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo (https://wpmoo.org)
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
@@ -14562,12 +14562,57 @@ function readThemeColors(themeElement, window2) {
|
|
|
14562
14562
|
return colors2;
|
|
14563
14563
|
}
|
|
14564
14564
|
function resolveThemeElement(element) {
|
|
14565
|
-
|
|
14565
|
+
const scoped = element?.closest?.("[data-bs-theme]");
|
|
14566
|
+
if (scoped) return scoped;
|
|
14567
|
+
const documentBody = element?.ownerDocument?.body;
|
|
14568
|
+
if (documentBody?.hasAttribute?.("data-bs-theme")) {
|
|
14569
|
+
return documentBody;
|
|
14570
|
+
}
|
|
14571
|
+
return element?.ownerDocument?.documentElement || null;
|
|
14566
14572
|
}
|
|
14567
14573
|
function themeElementIsDark(element) {
|
|
14568
14574
|
const theme = element?.getAttribute?.("data-bs-theme") || element?.dataset?.bsTheme;
|
|
14569
14575
|
return theme === "dark";
|
|
14570
14576
|
}
|
|
14577
|
+
function clampColorChannel(value) {
|
|
14578
|
+
return Math.min(255, Math.max(0, Math.round(value)));
|
|
14579
|
+
}
|
|
14580
|
+
function normalizeColorComponent(value) {
|
|
14581
|
+
const component = String(value).trim();
|
|
14582
|
+
if (component.endsWith("%")) {
|
|
14583
|
+
const percentage = Number.parseFloat(component.slice(0, -1));
|
|
14584
|
+
return Number.isFinite(percentage) ? clampColorChannel(percentage / 100 * 255) : null;
|
|
14585
|
+
}
|
|
14586
|
+
const normalized = Number.parseFloat(component);
|
|
14587
|
+
return Number.isFinite(normalized) ? clampColorChannel(normalized * 255) : null;
|
|
14588
|
+
}
|
|
14589
|
+
function normalizeColorAlpha(value) {
|
|
14590
|
+
if (value === void 0) return 1;
|
|
14591
|
+
const alpha2 = String(value).trim();
|
|
14592
|
+
if (alpha2.endsWith("%")) {
|
|
14593
|
+
const percentage = Number.parseFloat(alpha2.slice(0, -1));
|
|
14594
|
+
return Number.isFinite(percentage) ? Math.min(1, Math.max(0, percentage / 100)) : null;
|
|
14595
|
+
}
|
|
14596
|
+
const numeric = Number.parseFloat(alpha2);
|
|
14597
|
+
return Number.isFinite(numeric) ? Math.min(1, Math.max(0, numeric)) : null;
|
|
14598
|
+
}
|
|
14599
|
+
function normalizeCanvasColor(value) {
|
|
14600
|
+
if (typeof value !== "string") return null;
|
|
14601
|
+
const color2 = value.trim();
|
|
14602
|
+
const match = color2.match(
|
|
14603
|
+
/^color\(\s*srgb\s+([^\s/]+)\s+([^\s/]+)\s+([^\s/]+)(?:\s*\/\s*([^\s)]+))?\s*\)$/i
|
|
14604
|
+
);
|
|
14605
|
+
if (!match) return color2 || null;
|
|
14606
|
+
const channels = match.slice(1, 4).map(normalizeColorComponent);
|
|
14607
|
+
const alpha2 = normalizeColorAlpha(match[4]);
|
|
14608
|
+
if (channels.some((channel) => channel === null) || alpha2 === null) {
|
|
14609
|
+
return null;
|
|
14610
|
+
}
|
|
14611
|
+
if (alpha2 >= 1) {
|
|
14612
|
+
return `rgb(${channels.join(", ")})`;
|
|
14613
|
+
}
|
|
14614
|
+
return `rgba(${channels.join(", ")}, ${Number(alpha2.toFixed(3))})`;
|
|
14615
|
+
}
|
|
14571
14616
|
function resolveCanvasColor(document2, window2, value, fallback, themeElement) {
|
|
14572
14617
|
const createElement = document2?.createElement;
|
|
14573
14618
|
const getComputedStyle2 = window2?.getComputedStyle;
|
|
@@ -14581,7 +14626,7 @@ function resolveCanvasColor(document2, window2, value, fallback, themeElement) {
|
|
|
14581
14626
|
parent.appendChild(probe);
|
|
14582
14627
|
try {
|
|
14583
14628
|
const resolved = getComputedStyle2.call(window2, probe).color;
|
|
14584
|
-
return resolved || fallback;
|
|
14629
|
+
return normalizeCanvasColor(resolved) || fallback;
|
|
14585
14630
|
} finally {
|
|
14586
14631
|
probe.remove();
|
|
14587
14632
|
}
|
|
@@ -14853,7 +14898,7 @@ function applyThemeToChart(chart, theme, metadata, explicitColorFields = []) {
|
|
|
14853
14898
|
chart.options.plugins.tooltip.bodyColor = theme.secondaryText;
|
|
14854
14899
|
chart.options.plugins.tooltip.borderColor = theme.borderColor;
|
|
14855
14900
|
}
|
|
14856
|
-
chart.update(
|
|
14901
|
+
chart.update();
|
|
14857
14902
|
}
|
|
14858
14903
|
function themedGrid(theme) {
|
|
14859
14904
|
return {
|
|
@@ -15174,9 +15219,16 @@ var MooChart = class _MooChart {
|
|
|
15174
15219
|
}
|
|
15175
15220
|
});
|
|
15176
15221
|
});
|
|
15177
|
-
|
|
15222
|
+
const observerOptions = {
|
|
15178
15223
|
attributes: true,
|
|
15179
15224
|
attributeFilter: ["data-bs-theme", "style"]
|
|
15225
|
+
};
|
|
15226
|
+
const observerTargets = [
|
|
15227
|
+
this._themeElement,
|
|
15228
|
+
this._document?.documentElement
|
|
15229
|
+
].filter((target, index2, targets) => target && targets.indexOf(target) === index2);
|
|
15230
|
+
observerTargets.forEach((target) => {
|
|
15231
|
+
this._observer.observe(target, observerOptions);
|
|
15180
15232
|
});
|
|
15181
15233
|
}
|
|
15182
15234
|
instances2.set(element, this);
|