@jsenv/navi 0.27.53 → 0.27.55
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/jsenv_navi.js +230 -107
- package/dist/jsenv_navi.js.map +32 -29
- package/dist/jsenv_navi_side_effects.js +40 -2
- package/dist/jsenv_navi_side_effects.js.map +10 -7
- package/package.json +2 -2
package/dist/jsenv_navi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { installImportMetaCssBuild } from "./jsenv_navi_side_effects.js";
|
|
1
|
+
import { installImportMetaCssBuild, windowWidthSignal } from "./jsenv_navi_side_effects.js";
|
|
2
2
|
import { isValidElement, createContext, h, toChildArray, render, Fragment, cloneElement } from "preact";
|
|
3
3
|
import { useErrorBoundary, useLayoutEffect, useEffect, useContext, useMemo, useRef, useState, useCallback, useId } from "preact/hooks";
|
|
4
4
|
import { jsxs, jsx, Fragment as Fragment$1 } from "preact/jsx-runtime";
|
|
@@ -8891,11 +8891,35 @@ import.meta.css = [/* css */`
|
|
|
8891
8891
|
const PSEUDO_CLASSES_DEFAULT = [];
|
|
8892
8892
|
const PSEUDO_ELEMENTS_DEFAULT = [];
|
|
8893
8893
|
const STYLE_CSS_VARS_DEFAULT = {};
|
|
8894
|
-
const PROPS_CSS_VARS_DEFAULT = {};
|
|
8895
8894
|
// When only pseudoStateSelector is set (no visualSelector), the box owns its
|
|
8896
8895
|
// visual identity. Only event handlers and these explicit props are forwarded
|
|
8897
8896
|
// to the inner semantic/interactive child element.
|
|
8898
8897
|
const PSEUDO_STATE_CHILD_PROP_SET = new Set(["tabIndex", "tabindex"]);
|
|
8898
|
+
|
|
8899
|
+
/**
|
|
8900
|
+
* @type {import("ignore:preact").FunctionComponent<{
|
|
8901
|
+
* as?: string,
|
|
8902
|
+
* className?: string,
|
|
8903
|
+
* style?: import("ignore:preact").JSX.CSSProperties & { [pseudo: string]: import("ignore:preact").JSX.CSSProperties },
|
|
8904
|
+
* styleCSSVars?: { [stylePropName: string]: string },
|
|
8905
|
+
* inline?: boolean,
|
|
8906
|
+
* block?: boolean,
|
|
8907
|
+
* flex?: "x" | "y" | boolean,
|
|
8908
|
+
* grid?: boolean,
|
|
8909
|
+
* display?: "inherit",
|
|
8910
|
+
* pseudoState?: { [stateName: string]: boolean },
|
|
8911
|
+
* pseudoClasses?: string[],
|
|
8912
|
+
* pseudoElements?: string[],
|
|
8913
|
+
* visualSelector?: string,
|
|
8914
|
+
* pseudoStateSelector?: string,
|
|
8915
|
+
* hasChildUsingForwardedProps?: boolean,
|
|
8916
|
+
* childPropSet?: Set<string>,
|
|
8917
|
+
* preventInitialTransition?: boolean,
|
|
8918
|
+
* separator?: import("ignore:preact").ComponentChildren | ((index: number) => import("ignore:preact").ComponentChildren),
|
|
8919
|
+
* children?: import("ignore:preact").ComponentChildren,
|
|
8920
|
+
* [key: string]: any,
|
|
8921
|
+
* }>}
|
|
8922
|
+
*/
|
|
8899
8923
|
const Box = props => {
|
|
8900
8924
|
const {
|
|
8901
8925
|
ref,
|
|
@@ -8906,7 +8930,6 @@ const Box = props => {
|
|
|
8906
8930
|
// style management
|
|
8907
8931
|
style,
|
|
8908
8932
|
styleCSSVars = STYLE_CSS_VARS_DEFAULT,
|
|
8909
|
-
propsCSSVars = PROPS_CSS_VARS_DEFAULT,
|
|
8910
8933
|
basePseudoState,
|
|
8911
8934
|
pseudoState,
|
|
8912
8935
|
// for demo purposes it's possible to control pseudo state from props
|
|
@@ -9165,13 +9188,6 @@ const Box = props => {
|
|
|
9165
9188
|
addStyle(value, name, styleContext, boxStylesTarget, context);
|
|
9166
9189
|
return;
|
|
9167
9190
|
}
|
|
9168
|
-
const propCssVar = propsCSSVars[name];
|
|
9169
|
-
if (propCssVar) {
|
|
9170
|
-
if (value !== undefined) {
|
|
9171
|
-
addCSSVar(value, propCssVar, boxStylesTarget);
|
|
9172
|
-
}
|
|
9173
|
-
return;
|
|
9174
|
-
}
|
|
9175
9191
|
const isPseudoStyle = styleOrigin === "pseudo_style";
|
|
9176
9192
|
if (isStyleProp(name)) {
|
|
9177
9193
|
// it's a style prop, we need first to check if we have css var to handle them
|
|
@@ -9205,6 +9221,13 @@ const Box = props => {
|
|
|
9205
9221
|
}
|
|
9206
9222
|
return;
|
|
9207
9223
|
}
|
|
9224
|
+
const cssVarName = styleCSSVars[name];
|
|
9225
|
+
if (cssVarName) {
|
|
9226
|
+
if (value !== undefined) {
|
|
9227
|
+
addCSSVar(value, cssVarName, boxStylesTarget);
|
|
9228
|
+
}
|
|
9229
|
+
return;
|
|
9230
|
+
}
|
|
9208
9231
|
// not a style prop what do we do with it?
|
|
9209
9232
|
// When pseudoStateSelector is set, the child element is the semantic/interactive one
|
|
9210
9233
|
// When both selectors are set the child IS the component (e.g. Button with scale
|
|
@@ -17601,11 +17624,32 @@ const createI18n = ({
|
|
|
17601
17624
|
return interpolateText(template, values);
|
|
17602
17625
|
};
|
|
17603
17626
|
|
|
17627
|
+
const has = (key, { lang = activeLang } = {}) => {
|
|
17628
|
+
const resolvedLang = lang ? matchLang(lang, languageMap) : null;
|
|
17629
|
+
if (resolvedLang) {
|
|
17630
|
+
const translations = languageMap.get(resolvedLang);
|
|
17631
|
+
if (translations && key in translations) {
|
|
17632
|
+
return true;
|
|
17633
|
+
}
|
|
17634
|
+
}
|
|
17635
|
+
if (fallbackLang) {
|
|
17636
|
+
const resolvedFallbackLang = matchLang(fallbackLang, languageMap);
|
|
17637
|
+
if (resolvedFallbackLang) {
|
|
17638
|
+
const fallbackTranslations = languageMap.get(resolvedFallbackLang);
|
|
17639
|
+
if (fallbackTranslations && key in fallbackTranslations) {
|
|
17640
|
+
return true;
|
|
17641
|
+
}
|
|
17642
|
+
}
|
|
17643
|
+
}
|
|
17644
|
+
return false;
|
|
17645
|
+
};
|
|
17646
|
+
|
|
17604
17647
|
// The i18n instance is itself a callable function
|
|
17605
17648
|
const i18n = (key, values, opts) => format(key, values, opts);
|
|
17606
17649
|
i18n.add = add;
|
|
17607
17650
|
i18n.addAll = addAll;
|
|
17608
17651
|
i18n.addLangKeys = addLangKeys;
|
|
17652
|
+
i18n.has = has;
|
|
17609
17653
|
i18n.format = format;
|
|
17610
17654
|
i18n.languageMap = languageMap;
|
|
17611
17655
|
|
|
@@ -27347,57 +27391,74 @@ const shouldInjectSpacingBetween = (left, right) => {
|
|
|
27347
27391
|
};
|
|
27348
27392
|
|
|
27349
27393
|
/**
|
|
27350
|
-
*
|
|
27351
|
-
*
|
|
27352
|
-
*
|
|
27353
|
-
*
|
|
27354
|
-
*
|
|
27355
|
-
*
|
|
27356
|
-
*
|
|
27357
|
-
*
|
|
27358
|
-
*
|
|
27359
|
-
*
|
|
27360
|
-
*
|
|
27361
|
-
*
|
|
27362
|
-
*
|
|
27363
|
-
*
|
|
27364
|
-
*
|
|
27365
|
-
*
|
|
27366
|
-
*
|
|
27394
|
+
* @type {import("ignore:preact").FunctionComponent<{
|
|
27395
|
+
* children?: import("ignore:preact").ComponentChildren,
|
|
27396
|
+
* as?: string,
|
|
27397
|
+
* className?: string,
|
|
27398
|
+
* style?: import("ignore:preact").JSX.CSSProperties,
|
|
27399
|
+
* bold?: boolean,
|
|
27400
|
+
* noWrap?: boolean,
|
|
27401
|
+
* maxLines?: number,
|
|
27402
|
+
* spacing?: string | number | import("ignore:preact").ComponentChildren,
|
|
27403
|
+
* loading?: boolean,
|
|
27404
|
+
* skeleton?: boolean,
|
|
27405
|
+
* preventSpaceUnderlines?: boolean,
|
|
27406
|
+
* holdSpaceForStyle?: import("ignore:preact").JSX.CSSProperties,
|
|
27407
|
+
* boldStable?: boolean,
|
|
27408
|
+
* shrinkWrap?: boolean,
|
|
27409
|
+
* capitalize?: boolean,
|
|
27410
|
+
* selectRange?: string | [number, number],
|
|
27411
|
+
* childrenOutsideFlow?: import("ignore:preact").ComponentChildren,
|
|
27412
|
+
* [key: string]: any,
|
|
27413
|
+
* }>}
|
|
27367
27414
|
*
|
|
27368
|
-
* @param {
|
|
27369
|
-
*
|
|
27370
|
-
*
|
|
27371
|
-
*
|
|
27372
|
-
*
|
|
27373
|
-
*
|
|
27374
|
-
*
|
|
27375
|
-
*
|
|
27376
|
-
*
|
|
27377
|
-
*
|
|
27378
|
-
* @param {
|
|
27379
|
-
*
|
|
27380
|
-
*
|
|
27381
|
-
*
|
|
27382
|
-
*
|
|
27383
|
-
*
|
|
27384
|
-
*
|
|
27385
|
-
*
|
|
27386
|
-
*
|
|
27387
|
-
*
|
|
27388
|
-
*
|
|
27389
|
-
*
|
|
27390
|
-
*
|
|
27391
|
-
*
|
|
27392
|
-
*
|
|
27393
|
-
*
|
|
27394
|
-
*
|
|
27395
|
-
* @param {
|
|
27396
|
-
*
|
|
27397
|
-
*
|
|
27398
|
-
*
|
|
27399
|
-
*
|
|
27400
|
-
*
|
|
27415
|
+
* @param {number} [maxLines]
|
|
27416
|
+
* Truncates overflowing text with an ellipsis. `maxLines={1}` produces a
|
|
27417
|
+
* single-line truncation; `maxLines={n}` (n > 1) uses `-webkit-line-clamp`
|
|
27418
|
+
* to allow up to n lines before clipping.
|
|
27419
|
+
*
|
|
27420
|
+
* @param {string|number} [spacing]
|
|
27421
|
+
* Separator injected between child nodes. Accepts a size token (`"s"`, `"m"`, …),
|
|
27422
|
+
* a CSS length string, a number (interpreted as px), or `"pre"` / `0` to
|
|
27423
|
+
* disable spacing entirely. Defaults to a regular space character.
|
|
27424
|
+
*
|
|
27425
|
+
* @param {boolean} [loading]
|
|
27426
|
+
* Renders a shimmer skeleton animation in place of the text content.
|
|
27427
|
+
*
|
|
27428
|
+
* @param {boolean} [skeleton]
|
|
27429
|
+
* Same as `loading` but without the shimmer animation — a static grey bar.
|
|
27430
|
+
*
|
|
27431
|
+
* @param {boolean} [preventSpaceUnderlines]
|
|
27432
|
+
* Replaces real space characters between children with padding-based spaces.
|
|
27433
|
+
* Useful inside `<a>` elements where browsers draw an underline under spaces.
|
|
27434
|
+
*
|
|
27435
|
+
* @param {import("ignore:preact").JSX.CSSProperties} [holdSpaceForStyle]
|
|
27436
|
+
* Prevents layout shifts when text styles change (e.g. font-weight, font-size).
|
|
27437
|
+
* Pass the CSS properties representing the "largest" visual state of the text.
|
|
27438
|
+
* An invisible placeholder rendered with those styles reserves the space; the
|
|
27439
|
+
* real visible text is layered on top via `position: absolute`.
|
|
27440
|
+
* Best combined with `noWrap` — does not work reliably on multi-line text.
|
|
27441
|
+
*
|
|
27442
|
+
* @param {boolean} [boldStable]
|
|
27443
|
+
* Alternative to `holdSpaceForStyle` for multi-line text. Keeps a consistent
|
|
27444
|
+
* visual width across bold/normal transitions by painting normal-weight text
|
|
27445
|
+
* over a bold background using `background-clip: text`. Does not handle
|
|
27446
|
+
* font-size changes.
|
|
27447
|
+
*
|
|
27448
|
+
* @param {boolean} [shrinkWrap]
|
|
27449
|
+
* Forces the element width to match its longest visual line, preventing the
|
|
27450
|
+
* text block from being wider than its content when inside a flex/grid container.
|
|
27451
|
+
*
|
|
27452
|
+
* @param {boolean} [capitalize]
|
|
27453
|
+
* Uppercases the first letter of the text content via CSS.
|
|
27454
|
+
*
|
|
27455
|
+
* @param {string|[number,number]} [selectRange]
|
|
27456
|
+
* Selects a portion of the text on mount. Pass a substring to search for, or
|
|
27457
|
+
* a `[start, end]` character-offset tuple.
|
|
27458
|
+
*
|
|
27459
|
+
* @param {import("ignore:preact").ComponentChildren} [childrenOutsideFlow]
|
|
27460
|
+
* Rendered after children but outside the text spacing/flow logic. Used
|
|
27461
|
+
* internally for overlays such as the skeleton container.
|
|
27401
27462
|
*/
|
|
27402
27463
|
const Text = props => {
|
|
27403
27464
|
const defaultRef = useRef();
|
|
@@ -34374,21 +34435,13 @@ const Unit = ({
|
|
|
34374
34435
|
let unitText = unit;
|
|
34375
34436
|
if (label) {
|
|
34376
34437
|
unitText = label;
|
|
34377
|
-
} else {
|
|
34438
|
+
} else if (naviI18n.has(unit, {
|
|
34439
|
+
lang
|
|
34440
|
+
})) {
|
|
34378
34441
|
const singularText = naviI18n(unit, undefined, {
|
|
34379
34442
|
lang
|
|
34380
34443
|
});
|
|
34381
|
-
if (
|
|
34382
|
-
// naviI18n has no translation — try Intl.NumberFormat with style:"unit"
|
|
34383
|
-
const intlText = formatIntlUnit(unit, {
|
|
34384
|
-
plural,
|
|
34385
|
-
lang,
|
|
34386
|
-
format
|
|
34387
|
-
});
|
|
34388
|
-
if (intlText !== null) {
|
|
34389
|
-
unitText = intlText;
|
|
34390
|
-
}
|
|
34391
|
-
} else if (format === "short" || format === "narrow") {
|
|
34444
|
+
if (format === "short" || format === "narrow") {
|
|
34392
34445
|
const shortKey = `${unit}__short`;
|
|
34393
34446
|
const shortText = naviI18n(shortKey, undefined, {
|
|
34394
34447
|
lang
|
|
@@ -34404,6 +34457,18 @@ const Unit = ({
|
|
|
34404
34457
|
} else {
|
|
34405
34458
|
unitText = singularText;
|
|
34406
34459
|
}
|
|
34460
|
+
} else {
|
|
34461
|
+
// naviI18n has no translation — try Intl.NumberFormat with style:"unit"
|
|
34462
|
+
const intlText = formatIntlUnit(unit, {
|
|
34463
|
+
plural,
|
|
34464
|
+
lang,
|
|
34465
|
+
format
|
|
34466
|
+
});
|
|
34467
|
+
if (intlText === null) {
|
|
34468
|
+
unitText = unit;
|
|
34469
|
+
} else {
|
|
34470
|
+
unitText = intlText;
|
|
34471
|
+
}
|
|
34407
34472
|
}
|
|
34408
34473
|
return jsx(Text, {
|
|
34409
34474
|
baseClassName: "navi_unit",
|
|
@@ -35291,12 +35356,6 @@ const renderSafe = (value) => {
|
|
|
35291
35356
|
|
|
35292
35357
|
const PickerContext = createContext();
|
|
35293
35358
|
|
|
35294
|
-
const windowWidthSignal = signal(window.innerWidth);
|
|
35295
|
-
|
|
35296
|
-
window.addEventListener("resize", () => {
|
|
35297
|
-
windowWidthSignal.value = window.innerWidth;
|
|
35298
|
-
});
|
|
35299
|
-
|
|
35300
35359
|
/**
|
|
35301
35360
|
* Mirrors what browsers do when navigating to a page:
|
|
35302
35361
|
* 1. Focus the first element with [navi-autofocus] (but not [navi-autofocus="fallback"]) inside the container
|
|
@@ -35573,12 +35632,17 @@ const Dialog = props => {
|
|
|
35573
35632
|
pseudoClasses: DIALOG_PSEUDO_CLASSES,
|
|
35574
35633
|
onMouseDown: e => {
|
|
35575
35634
|
rest.onMouseDown?.(e);
|
|
35576
|
-
//
|
|
35577
|
-
//
|
|
35635
|
+
// Detect backdrop click: the click must land outside the dialog's
|
|
35636
|
+
// bounding rect. Checking coordinates is necessary because clicking
|
|
35637
|
+
// on the dialog's own padding also sets e.target === ref.current.
|
|
35578
35638
|
if (!pointerTrap && e.button === 0 && e.target === ref.current) {
|
|
35579
|
-
|
|
35580
|
-
|
|
35581
|
-
|
|
35639
|
+
const rect = ref.current.getBoundingClientRect();
|
|
35640
|
+
const isBackdrop = e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom;
|
|
35641
|
+
if (isBackdrop) {
|
|
35642
|
+
onRequestClose(e, {
|
|
35643
|
+
isClickOutside: true
|
|
35644
|
+
});
|
|
35645
|
+
}
|
|
35582
35646
|
}
|
|
35583
35647
|
},
|
|
35584
35648
|
onCancel: e => {
|
|
@@ -35834,22 +35898,48 @@ const POPOVER_PSEUDO_CLASSES = [":hover", ":active", ":focus", ":focus-visible",
|
|
|
35834
35898
|
|
|
35835
35899
|
installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
35836
35900
|
.navi_picker {
|
|
35901
|
+
/* Shared by popover and dialog */
|
|
35902
|
+
--picker-popup-background-color: var(--picker-background-color);
|
|
35903
|
+
--picker-popup-border-radius: var(--picker-border-radius);
|
|
35904
|
+
--picker-popup-border-width: var(--picker-border-width);
|
|
35905
|
+
/* Popover */
|
|
35906
|
+
--picker-popover-max-height: 300px; /* soft: user-configurable preferred max-height */
|
|
35907
|
+
--picker-popover-maxmax-height: calc(0.95 * var(--navi-vvh));
|
|
35908
|
+
--picker-popover-maxmax-width: calc(0.95 * var(--navi-vvw));
|
|
35909
|
+
/* --picker-popover-max-width: soft, leave unset to rely on maxmax */
|
|
35910
|
+
/* Dialog */
|
|
35911
|
+
--picker-dialog-margin: 3dvw; /* min gap between dialog edges and viewport */
|
|
35912
|
+
--picker-dialog-maxmax-width: calc(
|
|
35913
|
+
var(--navi-vvw) - 2 * var(--picker-dialog-margin)
|
|
35914
|
+
);
|
|
35915
|
+
--picker-dialog-maxmax-height: calc(
|
|
35916
|
+
var(--navi-vvh) - 2 * var(--picker-dialog-margin)
|
|
35917
|
+
);
|
|
35918
|
+
--picker-dialog-border-width: 0px; /* Dialog do not need border like popover (they stand out more) */
|
|
35919
|
+
|
|
35837
35920
|
/* popover */
|
|
35838
35921
|
&[aria-haspopup="listbox"] {
|
|
35839
35922
|
.navi_picker_popover {
|
|
35840
35923
|
position: absolute;
|
|
35841
35924
|
inset: unset;
|
|
35842
35925
|
min-width: var(--anchor-width, 0px);
|
|
35843
|
-
max-width:
|
|
35926
|
+
max-width: min(
|
|
35927
|
+
var(--picker-popover-max-width, var(--picker-popover-maxmax-width)),
|
|
35928
|
+
var(--picker-popover-maxmax-width)
|
|
35929
|
+
);
|
|
35844
35930
|
/* max-height covers the placeholder + list; the list scrolls internally */
|
|
35845
|
-
max-height: min(
|
|
35931
|
+
max-height: min(
|
|
35932
|
+
var(--picker-popover-max-height),
|
|
35933
|
+
var(--space-available, var(--picker-popover-maxmax-height)),
|
|
35934
|
+
var(--picker-popover-maxmax-height)
|
|
35935
|
+
);
|
|
35846
35936
|
margin: 0;
|
|
35847
35937
|
padding: 0;
|
|
35848
|
-
background: var(--picker-background-color);
|
|
35938
|
+
background: var(--picker-popup-background-color);
|
|
35849
35939
|
border-width: var(--picker-border-width);
|
|
35850
35940
|
border-style: solid;
|
|
35851
35941
|
border-color: var(--x-picker-border-color);
|
|
35852
|
-
border-radius: var(--picker-border-radius);
|
|
35942
|
+
border-radius: var(--picker-popup-border-radius);
|
|
35853
35943
|
outline-width: var(--picker-outline-width);
|
|
35854
35944
|
outline-color: var(--picker-outline-color);
|
|
35855
35945
|
outline-offset: 0px;
|
|
@@ -35857,7 +35947,7 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
35857
35947
|
0 4px 8px rgba(0, 0, 0, 0.08),
|
|
35858
35948
|
0 12px 40px rgba(0, 0, 0, 0.22);
|
|
35859
35949
|
cursor: default; /* Reset pointer cursor within the select */
|
|
35860
|
-
overflow:
|
|
35950
|
+
overflow: auto;
|
|
35861
35951
|
overscroll-behavior: none;
|
|
35862
35952
|
|
|
35863
35953
|
/* The anchor placeholder is a non-interactive visual clone of the
|
|
@@ -35905,7 +35995,7 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
35905
35995
|
width: 100%;
|
|
35906
35996
|
border-radius: max(
|
|
35907
35997
|
0px,
|
|
35908
|
-
var(--picker-border-radius) - var(--picker-border-width)
|
|
35998
|
+
var(--picker-popup-border-radius) - var(--picker-border-width)
|
|
35909
35999
|
);
|
|
35910
36000
|
overflow: auto;
|
|
35911
36001
|
overscroll-behavior: none;
|
|
@@ -35934,16 +36024,20 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
35934
36024
|
/* dialog */
|
|
35935
36025
|
&[aria-haspopup="dialog"] {
|
|
35936
36026
|
.navi_picker_dialog {
|
|
35937
|
-
--dialog-max-width: 95dvw;
|
|
35938
|
-
--dialog-max-height: 95dvh;
|
|
35939
|
-
|
|
35940
36027
|
min-width: var(--anchor-width, 0px);
|
|
35941
|
-
max-width:
|
|
35942
|
-
|
|
36028
|
+
max-width: min(
|
|
36029
|
+
var(--picker-dialog-max-width, var(--picker-dialog-maxmax-width)),
|
|
36030
|
+
var(--picker-dialog-maxmax-width)
|
|
36031
|
+
);
|
|
36032
|
+
max-height: min(
|
|
36033
|
+
var(--picker-dialog-max-height, var(--picker-dialog-maxmax-height)),
|
|
36034
|
+
var(--picker-dialog-maxmax-height)
|
|
36035
|
+
);
|
|
35943
36036
|
padding: 0;
|
|
35944
|
-
background: var(--picker-background-color);
|
|
35945
|
-
border: var(--picker-border-width) solid
|
|
35946
|
-
|
|
36037
|
+
background: var(--picker-popup-background-color);
|
|
36038
|
+
border: var(--picker-dialog-border-width) solid
|
|
36039
|
+
var(--x-picker-border-color);
|
|
36040
|
+
border-radius: var(--picker-popup-border-radius);
|
|
35947
36041
|
outline-width: var(--picker-outline-width);
|
|
35948
36042
|
outline-color: var(--picker-outline-color);
|
|
35949
36043
|
outline-offset: 0;
|
|
@@ -35954,10 +36048,10 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
35954
36048
|
/* overscroll-behavior: contain; */
|
|
35955
36049
|
|
|
35956
36050
|
&[data-expand-x] {
|
|
35957
|
-
width: var(--dialog-
|
|
36051
|
+
width: var(--picker-dialog-maxmax-width);
|
|
35958
36052
|
}
|
|
35959
36053
|
&[data-expand-y] {
|
|
35960
|
-
height: var(--dialog-
|
|
36054
|
+
height: var(--picker-dialog-maxmax-height);
|
|
35961
36055
|
}
|
|
35962
36056
|
|
|
35963
36057
|
&[open] {
|
|
@@ -35978,7 +36072,7 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
35978
36072
|
width: 100%;
|
|
35979
36073
|
border-radius: max(
|
|
35980
36074
|
0px,
|
|
35981
|
-
var(--picker-border-radius) - var(--picker-border-width)
|
|
36075
|
+
var(--picker-popup-border-radius) - var(--picker-border-width)
|
|
35982
36076
|
);
|
|
35983
36077
|
overflow: auto;
|
|
35984
36078
|
overscroll-behavior: none;
|
|
@@ -36322,11 +36416,14 @@ const PickerCustom = props => {
|
|
|
36322
36416
|
};
|
|
36323
36417
|
}
|
|
36324
36418
|
});
|
|
36419
|
+
const isWithinPopup = el => {
|
|
36420
|
+
const popupEl = popupRef.current;
|
|
36421
|
+
return el === popupEl || popupEl.contains(el);
|
|
36422
|
+
};
|
|
36325
36423
|
Object.assign(pickerProps, {
|
|
36326
36424
|
eventReactionDefinitions: {
|
|
36327
36425
|
mouseDown: e => {
|
|
36328
|
-
|
|
36329
|
-
if (popupEl && popupEl.contains(e.target)) {
|
|
36426
|
+
if (isWithinPopup(e.target)) {
|
|
36330
36427
|
return null;
|
|
36331
36428
|
}
|
|
36332
36429
|
if (expandedRef.current) {
|
|
@@ -36347,8 +36444,7 @@ const PickerCustom = props => {
|
|
|
36347
36444
|
};
|
|
36348
36445
|
},
|
|
36349
36446
|
click: e => {
|
|
36350
|
-
|
|
36351
|
-
if (popupEl && popupEl.contains(e.target)) {
|
|
36447
|
+
if (isWithinPopup(e.target)) {
|
|
36352
36448
|
return null;
|
|
36353
36449
|
}
|
|
36354
36450
|
// When a label is clicked it transfers focus to the select
|
|
@@ -40902,6 +40998,10 @@ const PickerStyleCSSVars = {
|
|
|
40902
40998
|
"outlineWidth": "--picker-outline-width",
|
|
40903
40999
|
"borderWidth": "--picker-border-width",
|
|
40904
41000
|
"borderRadius": "--picker-border-radius",
|
|
41001
|
+
"popoverMaxHeight": "--picker-popover-max-height",
|
|
41002
|
+
"popupBackgroundColor": "--picker-popup-background-color",
|
|
41003
|
+
"popupBorderRadius": "--picker-popup-border-radius",
|
|
41004
|
+
"dialogBorderWidth": "--picker-dialog-border-width",
|
|
40905
41005
|
"padding": "--picker-padding",
|
|
40906
41006
|
"paddingX": "--picker-padding-x",
|
|
40907
41007
|
"paddingY": "--picker-padding-y",
|
|
@@ -40976,6 +41076,9 @@ const PickerFirstResolver = props => {
|
|
|
40976
41076
|
* variant?: "icon" | "headless",
|
|
40977
41077
|
* icon?: import("ignore:preact").ComponentChildren,
|
|
40978
41078
|
* maxLines?: number,
|
|
41079
|
+
* popoverMaxHeight?: number | string,
|
|
41080
|
+
* popupBackgroundColor?: string,
|
|
41081
|
+
* popupBorderRadius?: number | string,
|
|
40979
41082
|
* dialogExpand?: boolean,
|
|
40980
41083
|
* dialogExpandX?: boolean,
|
|
40981
41084
|
* dialogExpandY?: boolean,
|
|
@@ -45854,6 +45957,26 @@ installImportMetaCssBuild(import.meta);const css$7 = /* css */`
|
|
|
45854
45957
|
}
|
|
45855
45958
|
}
|
|
45856
45959
|
`;
|
|
45960
|
+
|
|
45961
|
+
/**
|
|
45962
|
+
* @type {import("ignore:preact").FunctionComponent<{
|
|
45963
|
+
* children?: number | string,
|
|
45964
|
+
* unit?: string,
|
|
45965
|
+
* unitPosition?: "right" | "bottom",
|
|
45966
|
+
* unitSize?: string,
|
|
45967
|
+
* unitSizeRatio?: number,
|
|
45968
|
+
* unitColor?: string,
|
|
45969
|
+
* label?: string,
|
|
45970
|
+
* size?: string,
|
|
45971
|
+
* lang?: string,
|
|
45972
|
+
* integer?: boolean,
|
|
45973
|
+
* loading?: boolean,
|
|
45974
|
+
* readOnly?: boolean,
|
|
45975
|
+
* disabled?: boolean,
|
|
45976
|
+
* bold?: boolean,
|
|
45977
|
+
* [key: string]: any,
|
|
45978
|
+
* }>}
|
|
45979
|
+
*/
|
|
45857
45980
|
const Quantity = ({
|
|
45858
45981
|
children,
|
|
45859
45982
|
unit,
|
|
@@ -45881,7 +46004,7 @@ const Quantity = ({
|
|
|
45881
46004
|
return jsxs(Text, {
|
|
45882
46005
|
baseClassName: "navi_quantity",
|
|
45883
46006
|
"data-unit-bottom": unitBottom ? "" : undefined,
|
|
45884
|
-
|
|
46007
|
+
styleCSSVars: QuantityStyleCSSVars,
|
|
45885
46008
|
basePseudoState: {
|
|
45886
46009
|
":read-only": readOnly,
|
|
45887
46010
|
":disabled": disabled,
|
|
@@ -45915,7 +46038,7 @@ const Quantity = ({
|
|
|
45915
46038
|
})]
|
|
45916
46039
|
});
|
|
45917
46040
|
};
|
|
45918
|
-
const
|
|
46041
|
+
const QuantityStyleCSSVars = {
|
|
45919
46042
|
unitColor: "--unit-color"
|
|
45920
46043
|
};
|
|
45921
46044
|
const QuantityPseudoClasses = [":hover", ":active", ":read-only", ":disabled", ":-navi-loading"];
|
|
@@ -46795,7 +46918,7 @@ const SidePanel = ({
|
|
|
46795
46918
|
value: onClose,
|
|
46796
46919
|
children: jsxs(Box, {
|
|
46797
46920
|
baseClassName: "navi_side_panel",
|
|
46798
|
-
|
|
46921
|
+
styleCSSVars: SidePanelStyleCSSVars,
|
|
46799
46922
|
width: width,
|
|
46800
46923
|
"data-opening": phase === "opening" ? "" : undefined,
|
|
46801
46924
|
"data-closing": phase === "closing" ? "" : undefined,
|