@jsenv/navi 0.14.28 → 0.14.30
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 +254 -205
- package/dist/jsenv_navi.js.map +24 -29
- package/dist/jsenv_navi_side_effects.js +7 -7
- package/dist/jsenv_navi_side_effects.js.map +1 -1
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -9076,7 +9076,6 @@ const FormActionContext = createContext();
|
|
|
9076
9076
|
const renderActionableComponent = (props, {
|
|
9077
9077
|
Basic,
|
|
9078
9078
|
WithAction,
|
|
9079
|
-
InsideForm,
|
|
9080
9079
|
WithActionInsideForm
|
|
9081
9080
|
}) => {
|
|
9082
9081
|
const {
|
|
@@ -9089,7 +9088,6 @@ const renderActionableComponent = (props, {
|
|
|
9089
9088
|
if (hasActionProps && WithAction) {
|
|
9090
9089
|
if (considerInsideForm && WithActionInsideForm) {
|
|
9091
9090
|
return jsx(WithActionInsideForm, {
|
|
9092
|
-
formContext: formContext,
|
|
9093
9091
|
...props
|
|
9094
9092
|
});
|
|
9095
9093
|
}
|
|
@@ -9097,12 +9095,6 @@ const renderActionableComponent = (props, {
|
|
|
9097
9095
|
...props
|
|
9098
9096
|
});
|
|
9099
9097
|
}
|
|
9100
|
-
if (considerInsideForm && InsideForm) {
|
|
9101
|
-
return jsx(InsideForm, {
|
|
9102
|
-
formContext: formContext,
|
|
9103
|
-
...props
|
|
9104
|
-
});
|
|
9105
|
-
}
|
|
9106
9098
|
return jsx(Basic, {
|
|
9107
9099
|
...props
|
|
9108
9100
|
});
|
|
@@ -13856,6 +13848,27 @@ const installCustomConstraintValidation = (
|
|
|
13856
13848
|
});
|
|
13857
13849
|
}
|
|
13858
13850
|
|
|
13851
|
+
request_on_checkbox_change: {
|
|
13852
|
+
const isCheckbox =
|
|
13853
|
+
element.tagName === "INPUT" && element.type === "checkbox";
|
|
13854
|
+
if (!isCheckbox) {
|
|
13855
|
+
break request_on_checkbox_change;
|
|
13856
|
+
}
|
|
13857
|
+
const onchange = (e) => {
|
|
13858
|
+
if (element.parentNode.hasAttribute("data-action")) {
|
|
13859
|
+
dispatchActionRequestedCustomEvent(element, {
|
|
13860
|
+
event: e,
|
|
13861
|
+
requester: element,
|
|
13862
|
+
});
|
|
13863
|
+
return;
|
|
13864
|
+
}
|
|
13865
|
+
};
|
|
13866
|
+
element.addEventListener("change", onchange);
|
|
13867
|
+
addTeardown(() => {
|
|
13868
|
+
element.removeEventListener("change", onchange);
|
|
13869
|
+
});
|
|
13870
|
+
}
|
|
13871
|
+
|
|
13859
13872
|
execute_on_form_submit: {
|
|
13860
13873
|
if (!isForm) {
|
|
13861
13874
|
break execute_on_form_submit;
|
|
@@ -16056,6 +16069,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16056
16069
|
--button-border-color: light-dark(#767676, #8e8e93);
|
|
16057
16070
|
--button-background-color: light-dark(#f3f4f6, #2d3748);
|
|
16058
16071
|
--button-color: currentColor;
|
|
16072
|
+
--button-cursor: pointer;
|
|
16059
16073
|
|
|
16060
16074
|
/* Hover */
|
|
16061
16075
|
--button-border-color-hover: color-mix(
|
|
@@ -16109,6 +16123,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16109
16123
|
--x-button-border-color: var(--button-border-color);
|
|
16110
16124
|
--x-button-background-color: var(--button-background-color);
|
|
16111
16125
|
--x-button-color: var(--button-color);
|
|
16126
|
+
--x-button-cursor: var(--button-cursor);
|
|
16112
16127
|
|
|
16113
16128
|
position: relative;
|
|
16114
16129
|
box-sizing: border-box;
|
|
@@ -16119,7 +16134,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16119
16134
|
border: none;
|
|
16120
16135
|
border-radius: var(--x-button-border-radius);
|
|
16121
16136
|
outline: none;
|
|
16122
|
-
cursor:
|
|
16137
|
+
cursor: var(--x-button-cursor);
|
|
16123
16138
|
|
|
16124
16139
|
&[data-icon] {
|
|
16125
16140
|
--button-padding: 0;
|
|
@@ -16207,6 +16222,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16207
16222
|
--x-button-border-color: var(--button-border-color-readonly);
|
|
16208
16223
|
--x-button-background-color: var(--button-background-color-readonly);
|
|
16209
16224
|
--x-button-color: var(--button-color-readonly);
|
|
16225
|
+
--x-button-cursor: default;
|
|
16210
16226
|
}
|
|
16211
16227
|
/* Focus */
|
|
16212
16228
|
&[data-focus-visible] {
|
|
@@ -16223,9 +16239,9 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16223
16239
|
--x-button-border-color: var(--button-border-color-disabled);
|
|
16224
16240
|
--x-button-background-color: var(--button-background-color-disabled);
|
|
16225
16241
|
--x-button-color: var(--button-color-disabled);
|
|
16242
|
+
--x-button-cursor: default;
|
|
16226
16243
|
|
|
16227
16244
|
color: unset;
|
|
16228
|
-
cursor: default;
|
|
16229
16245
|
|
|
16230
16246
|
/* Remove active effects */
|
|
16231
16247
|
.navi_button_content {
|
|
@@ -16267,7 +16283,6 @@ const Button = props => {
|
|
|
16267
16283
|
return renderActionableComponent(props, {
|
|
16268
16284
|
Basic: ButtonBasic,
|
|
16269
16285
|
WithAction: ButtonWithAction,
|
|
16270
|
-
InsideForm: ButtonInsideForm,
|
|
16271
16286
|
WithActionInsideForm: ButtonWithActionInsideForm
|
|
16272
16287
|
});
|
|
16273
16288
|
};
|
|
@@ -16406,32 +16421,9 @@ const ButtonWithAction = props => {
|
|
|
16406
16421
|
children: children
|
|
16407
16422
|
});
|
|
16408
16423
|
};
|
|
16409
|
-
const ButtonInsideForm = props => {
|
|
16410
|
-
const {
|
|
16411
|
-
// eslint-disable-next-line no-unused-vars
|
|
16412
|
-
formContext,
|
|
16413
|
-
type,
|
|
16414
|
-
children,
|
|
16415
|
-
loading,
|
|
16416
|
-
readOnly,
|
|
16417
|
-
...rest
|
|
16418
|
-
} = props;
|
|
16419
|
-
const innerLoading = loading;
|
|
16420
|
-
const innerReadOnly = readOnly;
|
|
16421
|
-
return jsx(ButtonBasic, {
|
|
16422
|
-
...rest,
|
|
16423
|
-
type: type,
|
|
16424
|
-
loading: innerLoading,
|
|
16425
|
-
readOnly: innerReadOnly,
|
|
16426
|
-
children: children
|
|
16427
|
-
});
|
|
16428
|
-
};
|
|
16429
16424
|
const ButtonWithActionInsideForm = props => {
|
|
16430
16425
|
const formAction = useContext(FormActionContext);
|
|
16431
16426
|
const {
|
|
16432
|
-
// eslint-disable-next-line no-unused-vars
|
|
16433
|
-
formContext,
|
|
16434
|
-
// to avoid passing it to the button element
|
|
16435
16427
|
type,
|
|
16436
16428
|
action,
|
|
16437
16429
|
loading,
|
|
@@ -16657,7 +16649,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16657
16649
|
.navi_message_box {
|
|
16658
16650
|
.navi_title {
|
|
16659
16651
|
margin-top: 0;
|
|
16660
|
-
margin-bottom: var(--navi-
|
|
16652
|
+
margin-bottom: var(--navi-s);
|
|
16661
16653
|
color: var(--x-message-color);
|
|
16662
16654
|
}
|
|
16663
16655
|
}
|
|
@@ -17635,6 +17627,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17635
17627
|
`;
|
|
17636
17628
|
const ReportReadOnlyOnLabelContext = createContext();
|
|
17637
17629
|
const ReportDisabledOnLabelContext = createContext();
|
|
17630
|
+
const LabelPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":-navi-loading"];
|
|
17638
17631
|
const Label = props => {
|
|
17639
17632
|
const {
|
|
17640
17633
|
readOnly,
|
|
@@ -17649,9 +17642,10 @@ const Label = props => {
|
|
|
17649
17642
|
return jsx(Box, {
|
|
17650
17643
|
...rest,
|
|
17651
17644
|
as: "label",
|
|
17645
|
+
pseudoClasses: LabelPseudoClasses,
|
|
17652
17646
|
basePseudoState: {
|
|
17653
|
-
|
|
17654
|
-
disabled: innerDisabled
|
|
17647
|
+
":read-only": innerReadOnly,
|
|
17648
|
+
":disabled": innerDisabled
|
|
17655
17649
|
},
|
|
17656
17650
|
children: jsx(ReportReadOnlyOnLabelContext.Provider, {
|
|
17657
17651
|
value: setInputReadOnly,
|
|
@@ -17677,7 +17671,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17677
17671
|
--loader-color: var(--navi-loader-color);
|
|
17678
17672
|
--border-color: light-dark(#767676, #8e8e93);
|
|
17679
17673
|
--background-color: white;
|
|
17680
|
-
--color: light-dark(#4476ff, #3b82f6);
|
|
17674
|
+
--background-color-checked: var(--color, light-dark(#4476ff, #3b82f6));
|
|
17675
|
+
--border-color-checked: var(--color, light-dark(#4476ff, #3b82f6));
|
|
17681
17676
|
--checkmark-color-light: white;
|
|
17682
17677
|
--checkmark-color-dark: rgb(55, 55, 55);
|
|
17683
17678
|
--checkmark-color: var(--checkmark-color-light);
|
|
@@ -17690,12 +17685,13 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17690
17685
|
--border-color-hover: color-mix(in srgb, var(--border-color) 60%, black);
|
|
17691
17686
|
--border-color-hover-checked: color-mix(
|
|
17692
17687
|
in srgb,
|
|
17693
|
-
var(--color) 80%,
|
|
17688
|
+
var(--border-color-checked) 80%,
|
|
17694
17689
|
var(--color-mix)
|
|
17695
17690
|
);
|
|
17691
|
+
--background-color-hover: var(--background-color);
|
|
17696
17692
|
--background-color-hover-checked: color-mix(
|
|
17697
17693
|
in srgb,
|
|
17698
|
-
var(--color) 80%,
|
|
17694
|
+
var(--background-color-checked) 80%,
|
|
17699
17695
|
var(--color-mix)
|
|
17700
17696
|
);
|
|
17701
17697
|
/* Readonly */
|
|
@@ -17713,20 +17709,15 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17713
17709
|
--checkmark-color-disabled: #eeeeee;
|
|
17714
17710
|
--border-color-disabled-checked: #d3d3d3;
|
|
17715
17711
|
--background-color-disabled-checked: #d3d3d3;
|
|
17716
|
-
}
|
|
17717
17712
|
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17713
|
+
&[data-dark] {
|
|
17714
|
+
--color-mix: var(--color-mix-dark);
|
|
17715
|
+
--checkmark-color: var(--navi-checkmark-color-dark);
|
|
17716
|
+
}
|
|
17721
17717
|
}
|
|
17722
17718
|
}
|
|
17723
17719
|
|
|
17724
17720
|
.navi_checkbox {
|
|
17725
|
-
position: relative;
|
|
17726
|
-
display: inline-flex;
|
|
17727
|
-
box-sizing: content-box;
|
|
17728
|
-
margin: 3px 3px 3px 4px;
|
|
17729
|
-
|
|
17730
17721
|
--x-border-radius: var(--border-radius);
|
|
17731
17722
|
--x-outline-offset: var(--outline-offset);
|
|
17732
17723
|
--x-outline-width: var(--outline-width);
|
|
@@ -17738,82 +17729,198 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17738
17729
|
--x-border-color: var(--border-color);
|
|
17739
17730
|
--x-color: var(--color);
|
|
17740
17731
|
--x-checkmark-color: var(--checkmark-color);
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
position: absolute;
|
|
17744
|
-
inset: 0;
|
|
17745
|
-
margin: 0;
|
|
17746
|
-
padding: 0;
|
|
17747
|
-
border: none;
|
|
17748
|
-
opacity: 0;
|
|
17749
|
-
cursor: inherit;
|
|
17750
|
-
}
|
|
17751
|
-
.navi_checkbox .navi_checkbox_field {
|
|
17732
|
+
|
|
17733
|
+
position: relative;
|
|
17752
17734
|
display: inline-flex;
|
|
17753
|
-
box-sizing:
|
|
17754
|
-
|
|
17755
|
-
height: var(--x-height);
|
|
17756
|
-
background-color: var(--x-background-color);
|
|
17757
|
-
border-width: var(--x-border-width);
|
|
17758
|
-
border-style: solid;
|
|
17759
|
-
border-color: var(--x-border-color);
|
|
17760
|
-
border-radius: var(--x-border-radius);
|
|
17761
|
-
outline-width: var(--x-outline-width);
|
|
17762
|
-
outline-style: none;
|
|
17763
|
-
outline-color: var(--x-outline-color);
|
|
17764
|
-
outline-offset: var(--x-outline-offset);
|
|
17765
|
-
}
|
|
17766
|
-
.navi_checkbox_marker {
|
|
17767
|
-
width: 100%;
|
|
17768
|
-
height: 100%;
|
|
17769
|
-
opacity: 0;
|
|
17770
|
-
stroke: var(--x-checkmark-color);
|
|
17771
|
-
transform: scale(0.5);
|
|
17772
|
-
transition: all 0.15s ease;
|
|
17773
|
-
pointer-events: none;
|
|
17774
|
-
}
|
|
17775
|
-
.navi_checkbox[data-checked] .navi_checkbox_marker {
|
|
17776
|
-
opacity: 1;
|
|
17777
|
-
transform: scale(1);
|
|
17778
|
-
}
|
|
17735
|
+
box-sizing: content-box;
|
|
17736
|
+
margin: 3px 3px 3px 4px;
|
|
17779
17737
|
|
|
17780
|
-
|
|
17781
|
-
|
|
17782
|
-
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17738
|
+
.navi_native_field {
|
|
17739
|
+
position: absolute;
|
|
17740
|
+
inset: 0;
|
|
17741
|
+
margin: 0;
|
|
17742
|
+
padding: 0;
|
|
17743
|
+
border: none;
|
|
17744
|
+
opacity: 0;
|
|
17745
|
+
cursor: inherit;
|
|
17746
|
+
}
|
|
17747
|
+
|
|
17748
|
+
.navi_checkbox_field {
|
|
17749
|
+
display: inline-flex;
|
|
17750
|
+
box-sizing: border-box;
|
|
17751
|
+
width: var(--x-width);
|
|
17752
|
+
height: var(--x-height);
|
|
17753
|
+
background-color: var(--x-background-color);
|
|
17754
|
+
border-width: var(--x-border-width);
|
|
17755
|
+
border-style: solid;
|
|
17756
|
+
border-color: var(--x-border-color);
|
|
17757
|
+
border-radius: var(--x-border-radius);
|
|
17758
|
+
outline-width: var(--x-outline-width);
|
|
17759
|
+
outline-style: none;
|
|
17760
|
+
outline-color: var(--x-outline-color);
|
|
17761
|
+
outline-offset: var(--x-outline-offset);
|
|
17762
|
+
pointer-events: none;
|
|
17763
|
+
|
|
17764
|
+
.navi_checkbox_marker {
|
|
17765
|
+
width: 100%;
|
|
17766
|
+
height: 100%;
|
|
17767
|
+
opacity: 0;
|
|
17768
|
+
stroke: var(--x-checkmark-color);
|
|
17769
|
+
transform: scale(0.5);
|
|
17770
|
+
}
|
|
17771
|
+
}
|
|
17772
|
+
|
|
17773
|
+
/* Focus */
|
|
17774
|
+
&[data-focus-visible] {
|
|
17775
|
+
.navi_checkbox_field {
|
|
17776
|
+
outline-style: solid;
|
|
17777
|
+
}
|
|
17778
|
+
}
|
|
17779
|
+
/* Hover */
|
|
17780
|
+
&[data-hover] {
|
|
17781
|
+
--x-background-color: var(--background-color-hover);
|
|
17782
|
+
--x-border-color: var(--border-color-hover);
|
|
17783
|
+
|
|
17784
|
+
&[data-checked] {
|
|
17785
|
+
--x-border-color: var(--border-color-hover-checked);
|
|
17786
|
+
--x-background-color: var(--background-color-hover-checked);
|
|
17787
|
+
}
|
|
17788
|
+
}
|
|
17789
|
+
/* Checked */
|
|
17790
|
+
&[data-checked] {
|
|
17791
|
+
--x-background-color: var(--background-color-checked);
|
|
17792
|
+
--x-border-color: var(--border-color-checked);
|
|
17793
|
+
|
|
17794
|
+
.navi_checkbox_marker {
|
|
17795
|
+
opacity: 1;
|
|
17796
|
+
transform: scale(1);
|
|
17797
|
+
transition-property: opacity, transform;
|
|
17798
|
+
transition-duration: 0.15s;
|
|
17799
|
+
transition-timing-function: ease;
|
|
17800
|
+
}
|
|
17801
|
+
}
|
|
17802
|
+
/* Readonly */
|
|
17803
|
+
&[data-readonly],
|
|
17804
|
+
&[data-readonly][data-hover] {
|
|
17805
|
+
--x-border-color: var(--border-color-readonly);
|
|
17806
|
+
--x-background-color: var(--background-color-readonly);
|
|
17807
|
+
|
|
17808
|
+
&[data-checked] {
|
|
17809
|
+
--x-border-color: var(--border-color-readonly-checked);
|
|
17810
|
+
--x-background-color: var(--background-color-readonly-checked);
|
|
17811
|
+
--x-checkmark-color: var(--checkmark-color-readonly);
|
|
17812
|
+
}
|
|
17813
|
+
}
|
|
17814
|
+
|
|
17815
|
+
/* Disabled */
|
|
17816
|
+
&[data-disabled] {
|
|
17817
|
+
--x-border-color: var(--border-color-disabled);
|
|
17818
|
+
--x-background-color: var(--background-color-disabled);
|
|
17819
|
+
|
|
17820
|
+
&[data-checked] {
|
|
17821
|
+
--x-border-color: var(--border-color-disabled-checked);
|
|
17822
|
+
--x-background-color: var(--background-color-disabled-checked);
|
|
17823
|
+
--x-checkmark-color: var(--checkmark-color-disabled);
|
|
17824
|
+
}
|
|
17825
|
+
}
|
|
17826
|
+
|
|
17827
|
+
/* Toggle appearance */
|
|
17828
|
+
&[data-toggle] {
|
|
17829
|
+
--toggle-width: 3em;
|
|
17830
|
+
--toggle-thumb-size: 1.2em;
|
|
17831
|
+
--toggle-padding: 2px;
|
|
17832
|
+
--toggle-thumb-border-radius: 50%;
|
|
17833
|
+
--toggle-background-color: light-dark(#767676, #8e8e93);
|
|
17834
|
+
--toggle-background-color-checked: var(
|
|
17835
|
+
--color,
|
|
17836
|
+
light-dark(#4476ff, #3b82f6)
|
|
17837
|
+
);
|
|
17838
|
+
--toggle-background-color-hover: color-mix(
|
|
17839
|
+
in srgb,
|
|
17840
|
+
var(--toggle-background-color) 60%,
|
|
17841
|
+
white
|
|
17842
|
+
);
|
|
17843
|
+
--toggle-background-color-readonly: color-mix(
|
|
17844
|
+
in srgb,
|
|
17845
|
+
var(--toggle-background-color) 40%,
|
|
17846
|
+
transparent
|
|
17847
|
+
);
|
|
17848
|
+
--toggle-background-color-disabled: color-mix(
|
|
17849
|
+
in srgb,
|
|
17850
|
+
var(--toggle-background-color) 15%,
|
|
17851
|
+
#d3d3d3
|
|
17852
|
+
);
|
|
17853
|
+
--toggle-background-color-hover-checked: color-mix(
|
|
17854
|
+
in srgb,
|
|
17855
|
+
var(--toggle-background-color-checked) 60%,
|
|
17856
|
+
black
|
|
17857
|
+
);
|
|
17858
|
+
--toggle-background-color-readonly-checked: color-mix(
|
|
17859
|
+
in srgb,
|
|
17860
|
+
var(--toggle-background-color-checked) 40%,
|
|
17861
|
+
transparent
|
|
17862
|
+
);
|
|
17863
|
+
--toggle-background-color-disabled-checked: color-mix(
|
|
17864
|
+
in srgb,
|
|
17865
|
+
var(--toggle-background-color-checked) 15%,
|
|
17866
|
+
#d3d3d3
|
|
17867
|
+
);
|
|
17868
|
+
|
|
17869
|
+
--toggle-thumb-color: white;
|
|
17870
|
+
|
|
17871
|
+
--background-color: var(--toggle-background-color);
|
|
17872
|
+
--background-color-hover: var(--toggle-background-color-hover);
|
|
17873
|
+
--background-color-readonly: var(--toggle-background-color-readonly);
|
|
17874
|
+
--background-color-disabled: var(--toggle-background-color-disabled);
|
|
17875
|
+
--background-color-checked: var(--toggle-background-color-checked);
|
|
17876
|
+
--background-color-hover-checked: var(
|
|
17877
|
+
--toggle-background-color-hover-checked
|
|
17878
|
+
);
|
|
17879
|
+
--background-color-readonly-checked: var(
|
|
17880
|
+
--toggle-background-color-readonly-checked
|
|
17881
|
+
);
|
|
17882
|
+
--background-color-disabled-checked: var(
|
|
17883
|
+
--toggle-background-color-disabled-checked
|
|
17884
|
+
);
|
|
17885
|
+
|
|
17886
|
+
margin: 0;
|
|
17887
|
+
border-radius: calc(
|
|
17888
|
+
var(--toggle-thumb-size) / 2 + calc(var(--toggle-padding) * 2)
|
|
17889
|
+
);
|
|
17890
|
+
|
|
17891
|
+
.navi_native_field {
|
|
17892
|
+
border-radius: inherit;
|
|
17893
|
+
appearance: none; /* This allows border-radius to have an effect */
|
|
17894
|
+
}
|
|
17895
|
+
|
|
17896
|
+
.navi_checkbox_field {
|
|
17897
|
+
position: relative;
|
|
17898
|
+
width: var(--toggle-width);
|
|
17899
|
+
height: auto;
|
|
17900
|
+
padding: var(--toggle-padding);
|
|
17901
|
+
background-color: var(--x-background-color);
|
|
17902
|
+
border-color: transparent;
|
|
17903
|
+
border-radius: inherit;
|
|
17904
|
+
user-select: none;
|
|
17905
|
+
|
|
17906
|
+
.navi_checkbox_marker {
|
|
17907
|
+
width: var(--toggle-thumb-size);
|
|
17908
|
+
height: var(--toggle-thumb-size);
|
|
17909
|
+
border-radius: var(--toggle-thumb-border-radius);
|
|
17910
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
17911
|
+
opacity: 1;
|
|
17912
|
+
fill: var(--toggle-thumb-color);
|
|
17913
|
+
transform: translateX(0);
|
|
17914
|
+
transition: transform 0.2s ease;
|
|
17915
|
+
}
|
|
17916
|
+
}
|
|
17917
|
+
|
|
17918
|
+
&[data-checked] {
|
|
17919
|
+
.navi_checkbox_marker {
|
|
17920
|
+
transform: translateX(calc(100% + var(--toggle-padding) * 2));
|
|
17921
|
+
}
|
|
17922
|
+
}
|
|
17923
|
+
}
|
|
17817
17924
|
}
|
|
17818
17925
|
`;
|
|
17819
17926
|
const InputCheckbox = props => {
|
|
@@ -17830,8 +17937,7 @@ const InputCheckbox = props => {
|
|
|
17830
17937
|
const uiState = useUIState(uiStateController);
|
|
17831
17938
|
const checkbox = renderActionableComponent(props, {
|
|
17832
17939
|
Basic: InputCheckboxBasic,
|
|
17833
|
-
WithAction: InputCheckboxWithAction
|
|
17834
|
-
InsideForm: InputCheckboxInsideForm
|
|
17940
|
+
WithAction: InputCheckboxWithAction
|
|
17835
17941
|
});
|
|
17836
17942
|
return jsx(UIStateControllerContext.Provider, {
|
|
17837
17943
|
value: uiStateController,
|
|
@@ -17886,6 +17992,7 @@ const InputCheckboxBasic = props => {
|
|
|
17886
17992
|
defaultChecked,
|
|
17887
17993
|
/* eslint-enable no-unused-vars */
|
|
17888
17994
|
|
|
17995
|
+
id,
|
|
17889
17996
|
name,
|
|
17890
17997
|
readOnly,
|
|
17891
17998
|
disabled,
|
|
@@ -17895,6 +18002,7 @@ const InputCheckboxBasic = props => {
|
|
|
17895
18002
|
onClick,
|
|
17896
18003
|
onInput,
|
|
17897
18004
|
color,
|
|
18005
|
+
toggle,
|
|
17898
18006
|
...rest
|
|
17899
18007
|
} = props;
|
|
17900
18008
|
const defaultRef = useRef();
|
|
@@ -17923,6 +18031,7 @@ const InputCheckboxBasic = props => {
|
|
|
17923
18031
|
});
|
|
17924
18032
|
const renderCheckbox = checkboxProps => jsx(Box, {
|
|
17925
18033
|
...checkboxProps,
|
|
18034
|
+
id: id,
|
|
17926
18035
|
as: "input",
|
|
17927
18036
|
ref: ref,
|
|
17928
18037
|
type: "checkbox",
|
|
@@ -17940,7 +18049,7 @@ const InputCheckboxBasic = props => {
|
|
|
17940
18049
|
uiStateController.setUIState(e.detail.value, e);
|
|
17941
18050
|
}
|
|
17942
18051
|
});
|
|
17943
|
-
const renderCheckboxMemoized = useCallback(renderCheckbox, [innerName, checked, innerRequired]);
|
|
18052
|
+
const renderCheckboxMemoized = useCallback(renderCheckbox, [id, innerName, checked, innerRequired]);
|
|
17944
18053
|
useLayoutEffect(() => {
|
|
17945
18054
|
const naviCheckbox = ref.current;
|
|
17946
18055
|
const lightColor = "var(--checkmark-color-light)";
|
|
@@ -17956,6 +18065,7 @@ const InputCheckboxBasic = props => {
|
|
|
17956
18065
|
as: "span",
|
|
17957
18066
|
...remainingProps,
|
|
17958
18067
|
ref: undefined,
|
|
18068
|
+
"data-toggle": toggle ? "" : undefined,
|
|
17959
18069
|
baseClassName: "navi_checkbox",
|
|
17960
18070
|
pseudoStateSelector: ".navi_native_field",
|
|
17961
18071
|
styleCSSVars: CheckboxStyleCSSVars,
|
|
@@ -17968,13 +18078,24 @@ const InputCheckboxBasic = props => {
|
|
|
17968
18078
|
},
|
|
17969
18079
|
color: color,
|
|
17970
18080
|
hasChildFunction: true,
|
|
18081
|
+
preventInitialTransition: true,
|
|
17971
18082
|
children: [jsx(LoaderBackground, {
|
|
17972
18083
|
loading: innerLoading,
|
|
17973
18084
|
inset: -1,
|
|
17974
|
-
color: "var(--loader-color)"
|
|
18085
|
+
color: "var(--loader-color)",
|
|
18086
|
+
targetSelector: ".navi_checkbox_field"
|
|
17975
18087
|
}), renderCheckboxMemoized, jsx("div", {
|
|
17976
18088
|
className: "navi_checkbox_field",
|
|
17977
|
-
children: jsx("svg", {
|
|
18089
|
+
children: toggle ? jsx("svg", {
|
|
18090
|
+
viewBox: "0 0 12 12",
|
|
18091
|
+
"aria-hidden": "true",
|
|
18092
|
+
className: "navi_checkbox_marker",
|
|
18093
|
+
children: jsx("circle", {
|
|
18094
|
+
cx: "6",
|
|
18095
|
+
cy: "6",
|
|
18096
|
+
r: "5"
|
|
18097
|
+
})
|
|
18098
|
+
}) : jsx("svg", {
|
|
17978
18099
|
viewBox: "0 0 12 12",
|
|
17979
18100
|
"aria-hidden": "true",
|
|
17980
18101
|
className: "navi_checkbox_marker",
|
|
@@ -17993,7 +18114,6 @@ const InputCheckboxWithAction = props => {
|
|
|
17993
18114
|
const {
|
|
17994
18115
|
action,
|
|
17995
18116
|
onCancel,
|
|
17996
|
-
onChange,
|
|
17997
18117
|
actionErrorEffect,
|
|
17998
18118
|
onActionPrevented,
|
|
17999
18119
|
onActionStart,
|
|
@@ -18024,6 +18144,7 @@ const InputCheckboxWithAction = props => {
|
|
|
18024
18144
|
uiStateController.resetUIState(e);
|
|
18025
18145
|
onCancel?.(e, reason);
|
|
18026
18146
|
},
|
|
18147
|
+
onRequested: e => forwardActionRequested(e, actionBoundToUIState),
|
|
18027
18148
|
onPrevented: onActionPrevented,
|
|
18028
18149
|
onAction: executeAction,
|
|
18029
18150
|
onStart: onActionStart,
|
|
@@ -18043,16 +18164,9 @@ const InputCheckboxWithAction = props => {
|
|
|
18043
18164
|
"data-action": actionBoundToUIState.name,
|
|
18044
18165
|
...rest,
|
|
18045
18166
|
ref: ref,
|
|
18046
|
-
loading: loading || actionLoading
|
|
18047
|
-
onChange: e => {
|
|
18048
|
-
requestAction(e.target, actionBoundToUIState, {
|
|
18049
|
-
event: e
|
|
18050
|
-
});
|
|
18051
|
-
onChange?.(e);
|
|
18052
|
-
}
|
|
18167
|
+
loading: loading || actionLoading
|
|
18053
18168
|
});
|
|
18054
18169
|
};
|
|
18055
|
-
const InputCheckboxInsideForm = InputCheckboxBasic;
|
|
18056
18170
|
|
|
18057
18171
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
18058
18172
|
@layer navi {
|
|
@@ -18388,8 +18502,7 @@ const InputRadio = props => {
|
|
|
18388
18502
|
const uiState = useUIState(uiStateController);
|
|
18389
18503
|
const radio = renderActionableComponent(props, {
|
|
18390
18504
|
Basic: InputRadioBasic,
|
|
18391
|
-
WithAction: InputRadioWithAction
|
|
18392
|
-
InsideForm: InputRadioInsideForm
|
|
18505
|
+
WithAction: InputRadioWithAction
|
|
18393
18506
|
});
|
|
18394
18507
|
return jsx(UIStateControllerContext.Provider, {
|
|
18395
18508
|
value: uiStateController,
|
|
@@ -18590,7 +18703,6 @@ const InputRadioBasic = props => {
|
|
|
18590
18703
|
const InputRadioWithAction = () => {
|
|
18591
18704
|
throw new Error(`<Input type="radio" /> with an action make no sense. Use <RadioList action={something} /> instead`);
|
|
18592
18705
|
};
|
|
18593
|
-
const InputRadioInsideForm = InputRadio;
|
|
18594
18706
|
|
|
18595
18707
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
18596
18708
|
@layer navi {
|
|
@@ -18806,8 +18918,7 @@ const InputRange = props => {
|
|
|
18806
18918
|
const uiState = useUIState(uiStateController);
|
|
18807
18919
|
const input = renderActionableComponent(props, {
|
|
18808
18920
|
Basic: InputRangeBasic,
|
|
18809
|
-
WithAction: InputRangeWithAction
|
|
18810
|
-
InsideForm: InputRangeInsideForm
|
|
18921
|
+
WithAction: InputRangeWithAction
|
|
18811
18922
|
});
|
|
18812
18923
|
return jsx(UIStateControllerContext.Provider, {
|
|
18813
18924
|
value: uiStateController,
|
|
@@ -19054,17 +19165,6 @@ const InputRangeWithAction = props => {
|
|
|
19054
19165
|
loading: loading || actionLoading
|
|
19055
19166
|
});
|
|
19056
19167
|
};
|
|
19057
|
-
const InputRangeInsideForm = props => {
|
|
19058
|
-
const {
|
|
19059
|
-
// We destructure formContext to avoid passing it to the underlying input element
|
|
19060
|
-
// eslint-disable-next-line no-unused-vars
|
|
19061
|
-
formContext,
|
|
19062
|
-
...rest
|
|
19063
|
-
} = props;
|
|
19064
|
-
return jsx(InputRangeBasic, {
|
|
19065
|
-
...rest
|
|
19066
|
-
});
|
|
19067
|
-
};
|
|
19068
19168
|
|
|
19069
19169
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
19070
19170
|
@layer navi {
|
|
@@ -19190,8 +19290,7 @@ const InputTextual = props => {
|
|
|
19190
19290
|
const uiState = useUIState(uiStateController);
|
|
19191
19291
|
const input = renderActionableComponent(props, {
|
|
19192
19292
|
Basic: InputTextualBasic,
|
|
19193
|
-
WithAction: InputTextualWithAction
|
|
19194
|
-
InsideForm: InputTextualInsideForm
|
|
19293
|
+
WithAction: InputTextualWithAction
|
|
19195
19294
|
});
|
|
19196
19295
|
return jsx(UIStateControllerContext.Provider, {
|
|
19197
19296
|
value: uiStateController,
|
|
@@ -19385,17 +19484,6 @@ const InputTextualWithAction = props => {
|
|
|
19385
19484
|
loading: loading || actionLoading
|
|
19386
19485
|
});
|
|
19387
19486
|
};
|
|
19388
|
-
const InputTextualInsideForm = props => {
|
|
19389
|
-
const {
|
|
19390
|
-
// We destructure formContext to avoid passing it to the underlying input element
|
|
19391
|
-
// eslint-disable-next-line no-unused-vars
|
|
19392
|
-
formContext,
|
|
19393
|
-
...rest
|
|
19394
|
-
} = props;
|
|
19395
|
-
return jsx(InputTextualBasic, {
|
|
19396
|
-
...rest
|
|
19397
|
-
});
|
|
19398
|
-
};
|
|
19399
19487
|
|
|
19400
19488
|
// As explained in https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/datetime-local#setting_timezones
|
|
19401
19489
|
// datetime-local does not support timezones
|
|
@@ -20243,45 +20331,6 @@ forwardRef((props, ref) => {
|
|
|
20243
20331
|
})
|
|
20244
20332
|
});
|
|
20245
20333
|
});
|
|
20246
|
-
forwardRef((props, ref) => {
|
|
20247
|
-
const {
|
|
20248
|
-
id,
|
|
20249
|
-
name,
|
|
20250
|
-
value: externalValue,
|
|
20251
|
-
children,
|
|
20252
|
-
...rest
|
|
20253
|
-
} = props;
|
|
20254
|
-
const innerRef = useRef();
|
|
20255
|
-
useImperativeHandle(ref, () => innerRef.current);
|
|
20256
|
-
const [navState, setNavState] = useNavState();
|
|
20257
|
-
const [value, setValue, initialValue] = [name, externalValue, navState];
|
|
20258
|
-
useEffect(() => {
|
|
20259
|
-
setNavState(value);
|
|
20260
|
-
}, [value]);
|
|
20261
|
-
useFormEvents(innerRef, {
|
|
20262
|
-
onFormReset: () => {
|
|
20263
|
-
setValue(undefined);
|
|
20264
|
-
},
|
|
20265
|
-
onFormActionAbort: () => {
|
|
20266
|
-
setValue(initialValue);
|
|
20267
|
-
},
|
|
20268
|
-
onFormActionError: () => {
|
|
20269
|
-
setValue(initialValue);
|
|
20270
|
-
}
|
|
20271
|
-
});
|
|
20272
|
-
return jsx(SelectControlled, {
|
|
20273
|
-
ref: innerRef,
|
|
20274
|
-
name: name,
|
|
20275
|
-
value: value,
|
|
20276
|
-
onChange: event => {
|
|
20277
|
-
const select = event.target;
|
|
20278
|
-
const selectedValue = select.checked;
|
|
20279
|
-
setValue(selectedValue);
|
|
20280
|
-
},
|
|
20281
|
-
...rest,
|
|
20282
|
-
children: children
|
|
20283
|
-
});
|
|
20284
|
-
});
|
|
20285
20334
|
|
|
20286
20335
|
const TableSelectionContext = createContext();
|
|
20287
20336
|
const useTableSelectionContextValue = (
|