@jsenv/navi 0.29.384 → 0.29.385
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/dev/jsenv_navi.js +37 -13
- package/dist/dev/jsenv_navi.js.map +2 -2
- package/dist/jsenv_navi.js +37 -13
- package/dist/jsenv_navi.js.map +2 -2
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -4900,14 +4900,40 @@ const timeFromMinutes = (minutes) => {
|
|
|
4900
4900
|
|
|
4901
4901
|
const padTwo$1 = (value) => String(value).padStart(2, "0");
|
|
4902
4902
|
|
|
4903
|
-
//
|
|
4904
|
-
//
|
|
4905
|
-
//
|
|
4906
|
-
|
|
4903
|
+
// What a bound signal's type says is what its VALUE is (a validity type);
|
|
4904
|
+
// what a control's `type` says is what the control IS. This table is the whole
|
|
4905
|
+
// bridge between the two vocabularies: a value type with a row here asks for
|
|
4906
|
+
// that control, one without a row asks for nothing and the control keeps its
|
|
4907
|
+
// own default. "string" has no row on purpose — it is the value every typeless
|
|
4908
|
+
// control already holds — and a name only one side knows must never cross as
|
|
4909
|
+
// is: a control type nobody implements is a plain text field that writes an
|
|
4910
|
+
// object as "[object Object]" (see warnOnUnknownPickerType in picker.jsx).
|
|
4911
|
+
// Numeric value types map to navi_number rather than the native type="number"
|
|
4912
|
+
// (spinner buttons, poor UX).
|
|
4913
|
+
const CONTROL_TYPE_BY_SIGNAL_TYPE = {
|
|
4907
4914
|
boolean: "checkbox",
|
|
4908
4915
|
number: "navi_number",
|
|
4909
4916
|
integer: "navi_number",
|
|
4917
|
+
float: "navi_number",
|
|
4918
|
+
ratio: "navi_number",
|
|
4919
|
+
longitude: "navi_number",
|
|
4920
|
+
latitude: "navi_number",
|
|
4921
|
+
second: "navi_number",
|
|
4922
|
+
minute: "navi_number",
|
|
4923
|
+
hour: "navi_number",
|
|
4924
|
+
year: "navi_number",
|
|
4910
4925
|
percentage: "navi_percentage",
|
|
4926
|
+
date: "date",
|
|
4927
|
+
month: "month",
|
|
4928
|
+
week: "week",
|
|
4929
|
+
time: "time",
|
|
4930
|
+
datetime: "datetime",
|
|
4931
|
+
duration: "duration",
|
|
4932
|
+
color: "color",
|
|
4933
|
+
email: "email",
|
|
4934
|
+
url: "url",
|
|
4935
|
+
array: "array",
|
|
4936
|
+
object: "object",
|
|
4911
4937
|
};
|
|
4912
4938
|
|
|
4913
4939
|
// Conceptual navi types: defaults, plus the host type they resolve to.
|
|
@@ -5038,18 +5064,16 @@ const resolveInputProps = (props, { controlType = "input" } = {}) => {
|
|
|
5038
5064
|
}
|
|
5039
5065
|
}
|
|
5040
5066
|
if (props.type === undefined && signalOptions.type !== undefined) {
|
|
5041
|
-
const typeFromSignal =
|
|
5042
|
-
|
|
5043
|
-
//
|
|
5044
|
-
//
|
|
5045
|
-
//
|
|
5046
|
-
//
|
|
5047
|
-
// control, with no popup to open. A picker asked to hold a yes/no keeps
|
|
5048
|
-
// its two rows and stays itself.
|
|
5067
|
+
const typeFromSignal = CONTROL_TYPE_BY_SIGNAL_TYPE[signalOptions.type];
|
|
5068
|
+
// A value type and the control for it usually agree — a date-typed
|
|
5069
|
+
// signal wants a date field — but a boolean one maps to a checkbox, and
|
|
5070
|
+
// a picker made into a checkbox is not a picker with a different look:
|
|
5071
|
+
// it is another control, with no popup to open. A picker asked to hold
|
|
5072
|
+
// a yes/no keeps its two rows and stays itself.
|
|
5049
5073
|
const wouldChangeWhatTheControlIs =
|
|
5050
5074
|
controlType === "picker" &&
|
|
5051
5075
|
(typeFromSignal === "checkbox" || typeFromSignal === "radio");
|
|
5052
|
-
if (!wouldChangeWhatTheControlIs) {
|
|
5076
|
+
if (typeFromSignal !== undefined && !wouldChangeWhatTheControlIs) {
|
|
5053
5077
|
props.type = typeFromSignal;
|
|
5054
5078
|
}
|
|
5055
5079
|
}
|