@jsenv/navi 0.27.64 → 0.27.66
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 +46 -21
- package/dist/jsenv_navi.js.map +10 -8
- package/package.json +3 -3
package/dist/jsenv_navi.js
CHANGED
|
@@ -6369,6 +6369,16 @@ const applyOnTwoCSSProps = (cssStyleA, cssStyleB) => {
|
|
|
6369
6369
|
};
|
|
6370
6370
|
};
|
|
6371
6371
|
};
|
|
6372
|
+
const applyOnFourCSSProps = (cssStyleA, cssStyleB, cssStyleC, cssStyleD) => {
|
|
6373
|
+
return (value) => {
|
|
6374
|
+
return {
|
|
6375
|
+
[cssStyleA]: value,
|
|
6376
|
+
[cssStyleB]: value,
|
|
6377
|
+
[cssStyleC]: value,
|
|
6378
|
+
[cssStyleD]: value,
|
|
6379
|
+
};
|
|
6380
|
+
};
|
|
6381
|
+
};
|
|
6372
6382
|
const applyToCssPropWhenTruthy = (
|
|
6373
6383
|
cssProp,
|
|
6374
6384
|
cssPropValue,
|
|
@@ -6420,7 +6430,16 @@ const LAYOUT_PROPS = {
|
|
|
6420
6430
|
column: () => {},
|
|
6421
6431
|
};
|
|
6422
6432
|
const OUTER_PROPS = {
|
|
6423
|
-
margin
|
|
6433
|
+
// expanded into longhands (not PASS_THROUGH) so the shorthand "margin" CSS
|
|
6434
|
+
// property is never written to the DOM: setting element.style.margin resets
|
|
6435
|
+
// all four margin-* longhands, which would silently wipe out an explicit
|
|
6436
|
+
// marginLeft/marginRight/marginTop/marginBottom applied alongside it.
|
|
6437
|
+
margin: applyOnFourCSSProps(
|
|
6438
|
+
"marginTop",
|
|
6439
|
+
"marginRight",
|
|
6440
|
+
"marginBottom",
|
|
6441
|
+
"marginLeft",
|
|
6442
|
+
),
|
|
6424
6443
|
marginLeft: PASS_THROUGH,
|
|
6425
6444
|
marginRight: PASS_THROUGH,
|
|
6426
6445
|
marginTop: PASS_THROUGH,
|
|
@@ -6433,7 +6452,15 @@ const OUTER_PROPS = {
|
|
|
6433
6452
|
viewTransitionName: PASS_THROUGH,
|
|
6434
6453
|
};
|
|
6435
6454
|
const INNER_PROPS = {
|
|
6436
|
-
|
|
6455
|
+
// expanded into longhands for the same reason as "margin" above: the
|
|
6456
|
+
// shorthand would otherwise reset paddingLeft/Right/Top/Bottom when both
|
|
6457
|
+
// are applied on the same element (e.g. padding="xs" paddingLeft="m").
|
|
6458
|
+
padding: applyOnFourCSSProps(
|
|
6459
|
+
"paddingTop",
|
|
6460
|
+
"paddingRight",
|
|
6461
|
+
"paddingBottom",
|
|
6462
|
+
"paddingLeft",
|
|
6463
|
+
),
|
|
6437
6464
|
paddingLeft: PASS_THROUGH,
|
|
6438
6465
|
paddingRight: PASS_THROUGH,
|
|
6439
6466
|
paddingTop: PASS_THROUGH,
|
|
@@ -6494,6 +6521,7 @@ const DIMENSION_PROPS = {
|
|
|
6494
6521
|
if (parentBoxFlow === "flex-y" || parentBoxFlow === "inline-flex-y") {
|
|
6495
6522
|
return {
|
|
6496
6523
|
alignSelf: "stretch",
|
|
6524
|
+
width: "100%",
|
|
6497
6525
|
};
|
|
6498
6526
|
}
|
|
6499
6527
|
// Can't use flexGrow — parent is not flex-x
|
|
@@ -28703,7 +28731,6 @@ const ButtonStyleCSSVars = {
|
|
|
28703
28731
|
"borderWidth": "--button-border-width",
|
|
28704
28732
|
"borderRadius": "--button-border-radius",
|
|
28705
28733
|
"border": "--button-border",
|
|
28706
|
-
"padding": "--button-padding",
|
|
28707
28734
|
"paddingX": "--button-padding-x",
|
|
28708
28735
|
"paddingY": "--button-padding-y",
|
|
28709
28736
|
"paddingTop": "--button-padding-top",
|
|
@@ -31473,24 +31500,15 @@ const FieldAsLabel = props => {
|
|
|
31473
31500
|
children
|
|
31474
31501
|
} = props;
|
|
31475
31502
|
props.paddingWithControl = resolveSpacingSize(props.paddingWithControl, "s");
|
|
31476
|
-
const [messageProps, remainingProps] = extractMessageAndRemainingProps(props);
|
|
31477
|
-
const messagePropsRef = useRef();
|
|
31478
|
-
messagePropsRef.current = messageProps;
|
|
31479
31503
|
return jsx(Label, {
|
|
31480
31504
|
"navi-field": "",
|
|
31481
31505
|
styleCSSVars: FieldCSSVars,
|
|
31482
31506
|
flex: vertical ? "y" : undefined,
|
|
31483
31507
|
alignX: vertical ? "start" : undefined,
|
|
31484
31508
|
"data-vertical": vertical ? "" : undefined,
|
|
31485
|
-
...
|
|
31509
|
+
...props,
|
|
31486
31510
|
vertical: undefined,
|
|
31487
|
-
children:
|
|
31488
|
-
value: messagePropsRef,
|
|
31489
|
-
children: jsx(ControlIdContext.Provider, {
|
|
31490
|
-
value: props.htmlFor,
|
|
31491
|
-
children: children
|
|
31492
|
-
})
|
|
31493
|
-
})
|
|
31511
|
+
children: children
|
|
31494
31512
|
});
|
|
31495
31513
|
};
|
|
31496
31514
|
const FieldCSSVars = {
|
|
@@ -31530,8 +31548,7 @@ const FIELD_PSEUDO_CLASSES = [":hover", ":active", ":focus", ":focus-visible", "
|
|
|
31530
31548
|
const Label = props => {
|
|
31531
31549
|
import.meta.css = [css$A, "@jsenv/navi/src/control/field.jsx"];
|
|
31532
31550
|
const {
|
|
31533
|
-
children
|
|
31534
|
-
...rest
|
|
31551
|
+
children
|
|
31535
31552
|
} = props;
|
|
31536
31553
|
const controlId = useContext(ControlIdContext);
|
|
31537
31554
|
const [disabled, setDisabled] = useState(false);
|
|
@@ -31539,6 +31556,9 @@ const Label = props => {
|
|
|
31539
31556
|
const [connected, setConnected] = useState(false);
|
|
31540
31557
|
const defaultId = useId();
|
|
31541
31558
|
const htmlFor = props.htmlFor || controlId || `label_auto_${defaultId}`;
|
|
31559
|
+
const [messageProps, remainingProps] = extractMessageAndRemainingProps(props);
|
|
31560
|
+
const messagePropsRef = useRef();
|
|
31561
|
+
messagePropsRef.current = messageProps;
|
|
31542
31562
|
return jsx(Box, {
|
|
31543
31563
|
as: "label",
|
|
31544
31564
|
htmlFor: htmlFor,
|
|
@@ -31549,7 +31569,7 @@ const Label = props => {
|
|
|
31549
31569
|
":disabled": disabled,
|
|
31550
31570
|
":read-only": readOnly
|
|
31551
31571
|
},
|
|
31552
|
-
...
|
|
31572
|
+
...remainingProps,
|
|
31553
31573
|
onnavi_control_state: e => {
|
|
31554
31574
|
setConnected(true);
|
|
31555
31575
|
setDisabled(e.detail.disabled);
|
|
@@ -31560,9 +31580,12 @@ const Label = props => {
|
|
|
31560
31580
|
setDisabled(false);
|
|
31561
31581
|
setReadOnly(false);
|
|
31562
31582
|
},
|
|
31563
|
-
children: jsx(
|
|
31564
|
-
value:
|
|
31565
|
-
children:
|
|
31583
|
+
children: jsx(MessagePropsRefContext.Provider, {
|
|
31584
|
+
value: messagePropsRef,
|
|
31585
|
+
children: jsx(ControlIdContext.Provider, {
|
|
31586
|
+
value: htmlFor,
|
|
31587
|
+
children: children
|
|
31588
|
+
})
|
|
31566
31589
|
})
|
|
31567
31590
|
});
|
|
31568
31591
|
};
|
|
@@ -40920,6 +40943,7 @@ const PickerButton = props => {
|
|
|
40920
40943
|
ref,
|
|
40921
40944
|
variant,
|
|
40922
40945
|
icon,
|
|
40946
|
+
iconSize = "m",
|
|
40923
40947
|
placeholder,
|
|
40924
40948
|
ui,
|
|
40925
40949
|
maxLines = 1
|
|
@@ -40953,6 +40977,7 @@ const PickerButton = props => {
|
|
|
40953
40977
|
styleCSSVars: PickerStyleCSSVars,
|
|
40954
40978
|
variant: undefined,
|
|
40955
40979
|
icon: undefined,
|
|
40980
|
+
iconSize: undefined,
|
|
40956
40981
|
ui: undefined,
|
|
40957
40982
|
maxLines: undefined,
|
|
40958
40983
|
dayLabel: undefined
|
|
@@ -41064,7 +41089,7 @@ const PickerButton = props => {
|
|
|
41064
41089
|
}), variant === "headless" || ui === "default" ? null : jsx("span", {
|
|
41065
41090
|
className: "navi_picker_right_slot",
|
|
41066
41091
|
children: jsx(Icon, {
|
|
41067
|
-
size:
|
|
41092
|
+
size: iconSize,
|
|
41068
41093
|
children: icon === undefined ? jsx(ChevronDownSvg, {}) : icon
|
|
41069
41094
|
})
|
|
41070
41095
|
}), jsx(ControlFacadeChildrenWrapper, {
|