@jsenv/navi 0.27.39 → 0.27.41
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 +202 -129
- package/dist/jsenv_navi.js.map +31 -57
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -33853,27 +33853,39 @@ const formatIntlUnit = (unit, {
|
|
|
33853
33853
|
}
|
|
33854
33854
|
};
|
|
33855
33855
|
|
|
33856
|
-
|
|
33857
|
-
|
|
33858
|
-
|
|
33859
|
-
|
|
33860
|
-
|
|
33861
|
-
|
|
33862
|
-
|
|
33863
|
-
|
|
33864
|
-
|
|
33856
|
+
/**
|
|
33857
|
+
* Wraps multiple inputs together and handles keyboard navigation and paste
|
|
33858
|
+
* distribution between them.
|
|
33859
|
+
*
|
|
33860
|
+
* Keyboard navigation:
|
|
33861
|
+
* ArrowRight at the end of an input moves focus to the next input.
|
|
33862
|
+
* ArrowLeft at the start of an input moves focus to the previous input.
|
|
33863
|
+
* navi_input_full (emitted when an input reaches maxLength) also moves forward.
|
|
33864
|
+
*
|
|
33865
|
+
* Paste distribution:
|
|
33866
|
+
* When an input has a data-separator attribute, pasting a string that
|
|
33867
|
+
* contains that separator (e.g. "27/04/1990" into a day input with
|
|
33868
|
+
* data-separator="/") splits the text on each separator and fills the
|
|
33869
|
+
* corresponding sub-inputs in order.
|
|
33870
|
+
*/
|
|
33871
|
+
const useInputGroup = (ref) => {
|
|
33865
33872
|
const debugFocus = useDebugFocus();
|
|
33873
|
+
|
|
33866
33874
|
useEffect(() => {
|
|
33867
33875
|
const el = ref.current;
|
|
33868
33876
|
if (!el) {
|
|
33869
33877
|
return () => {};
|
|
33870
33878
|
}
|
|
33871
|
-
|
|
33872
|
-
const
|
|
33879
|
+
|
|
33880
|
+
const getInputs = () =>
|
|
33881
|
+
Array.from(el.querySelectorAll(".navi_control_input"));
|
|
33882
|
+
|
|
33883
|
+
const focusInput = (input) => {
|
|
33873
33884
|
input.focus();
|
|
33874
33885
|
input.select();
|
|
33875
33886
|
};
|
|
33876
|
-
|
|
33887
|
+
|
|
33888
|
+
const handleKeyDown = (e) => {
|
|
33877
33889
|
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") {
|
|
33878
33890
|
return;
|
|
33879
33891
|
}
|
|
@@ -33882,28 +33894,49 @@ const useInputGroup = ref => {
|
|
|
33882
33894
|
return;
|
|
33883
33895
|
}
|
|
33884
33896
|
if (e.key === "ArrowRight") {
|
|
33885
|
-
const allSelected =
|
|
33886
|
-
|
|
33897
|
+
const allSelected =
|
|
33898
|
+
active.selectionStart === 0 &&
|
|
33899
|
+
active.selectionEnd === active.value.length;
|
|
33900
|
+
const atEnd =
|
|
33901
|
+
allSelected ||
|
|
33902
|
+
(active.selectionStart === active.value.length &&
|
|
33903
|
+
active.selectionEnd === active.value.length);
|
|
33887
33904
|
if (!atEnd) {
|
|
33888
33905
|
return;
|
|
33889
33906
|
}
|
|
33890
33907
|
const inputs = getInputs();
|
|
33891
33908
|
const idx = inputs.indexOf(active);
|
|
33892
33909
|
if (idx === -1) {
|
|
33893
|
-
debugFocus(
|
|
33910
|
+
debugFocus(
|
|
33911
|
+
e,
|
|
33912
|
+
"InputGroup ArrowRight on non group input → do nothing",
|
|
33913
|
+
);
|
|
33894
33914
|
return;
|
|
33895
33915
|
}
|
|
33896
33916
|
if (idx === inputs.length - 1) {
|
|
33897
|
-
debugFocus(
|
|
33917
|
+
debugFocus(
|
|
33918
|
+
e,
|
|
33919
|
+
"InputGroup ArrowRight at end of last input → do nothing",
|
|
33920
|
+
);
|
|
33898
33921
|
return;
|
|
33899
33922
|
}
|
|
33900
|
-
|
|
33923
|
+
|
|
33924
|
+
debugFocus(
|
|
33925
|
+
e,
|
|
33926
|
+
"InputGroup ArrowRight at end of input[%d] → focus input[%d]",
|
|
33927
|
+
idx,
|
|
33928
|
+
idx + 1,
|
|
33929
|
+
);
|
|
33901
33930
|
e.preventDefault();
|
|
33902
33931
|
focusInput(inputs[idx + 1]);
|
|
33903
33932
|
return;
|
|
33904
33933
|
}
|
|
33905
|
-
const allSelected =
|
|
33906
|
-
|
|
33934
|
+
const allSelected =
|
|
33935
|
+
active.selectionStart === 0 &&
|
|
33936
|
+
active.selectionEnd === active.value.length;
|
|
33937
|
+
const atStart =
|
|
33938
|
+
allSelected ||
|
|
33939
|
+
(active.selectionStart === 0 && active.selectionEnd === 0);
|
|
33907
33940
|
if (!atStart) {
|
|
33908
33941
|
return;
|
|
33909
33942
|
}
|
|
@@ -33912,11 +33945,17 @@ const useInputGroup = ref => {
|
|
|
33912
33945
|
if (idx === 0) {
|
|
33913
33946
|
return;
|
|
33914
33947
|
}
|
|
33915
|
-
debugFocus(
|
|
33948
|
+
debugFocus(
|
|
33949
|
+
e,
|
|
33950
|
+
"InputGroup ArrowLeft at start of input[%d] → focus input[%d]",
|
|
33951
|
+
idx,
|
|
33952
|
+
idx - 1,
|
|
33953
|
+
);
|
|
33916
33954
|
e.preventDefault();
|
|
33917
33955
|
focusInput(inputs[idx - 1]);
|
|
33918
33956
|
};
|
|
33919
|
-
|
|
33957
|
+
|
|
33958
|
+
const handleNaviInputFull = (e) => {
|
|
33920
33959
|
if (!e.detail.event?.isTrusted) {
|
|
33921
33960
|
// Programmatic value change (e.g. ArrowUp/Down) — don't auto-advance.
|
|
33922
33961
|
return;
|
|
@@ -33934,7 +33973,12 @@ const useInputGroup = ref => {
|
|
|
33934
33973
|
return;
|
|
33935
33974
|
}
|
|
33936
33975
|
const nextInput = inputs[idx + 1];
|
|
33937
|
-
debugFocus(
|
|
33976
|
+
debugFocus(
|
|
33977
|
+
e,
|
|
33978
|
+
"InputGroup navi_input_full on input -> move to next input",
|
|
33979
|
+
input,
|
|
33980
|
+
nextInput,
|
|
33981
|
+
);
|
|
33938
33982
|
e.preventDefault();
|
|
33939
33983
|
focusInput(nextInput);
|
|
33940
33984
|
};
|
|
@@ -33988,15 +34032,11 @@ const useInputGroup = ref => {
|
|
|
33988
34032
|
// focusInput(inputs[lastFilledIdx]);
|
|
33989
34033
|
// };
|
|
33990
34034
|
|
|
33991
|
-
el.addEventListener("keydown", handleKeyDown, {
|
|
33992
|
-
capture: true
|
|
33993
|
-
});
|
|
34035
|
+
el.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
33994
34036
|
el.addEventListener("navi_input_full", handleNaviInputFull);
|
|
33995
34037
|
// el.addEventListener("paste", handlePaste, { capture: true });
|
|
33996
34038
|
return () => {
|
|
33997
|
-
el.removeEventListener("keydown", handleKeyDown, {
|
|
33998
|
-
capture: true
|
|
33999
|
-
});
|
|
34039
|
+
el.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
34000
34040
|
el.removeEventListener("navi_input_full", handleNaviInputFull);
|
|
34001
34041
|
// el.removeEventListener("paste", handlePaste, { capture: true });
|
|
34002
34042
|
};
|
|
@@ -34013,7 +34053,7 @@ const useInputGroup = ref => {
|
|
|
34013
34053
|
// });
|
|
34014
34054
|
// };
|
|
34015
34055
|
|
|
34016
|
-
const isTextInputElement = el => {
|
|
34056
|
+
const isTextInputElement = (el) => {
|
|
34017
34057
|
if (!el) {
|
|
34018
34058
|
return false;
|
|
34019
34059
|
}
|
|
@@ -34024,7 +34064,15 @@ const isTextInputElement = el => {
|
|
|
34024
34064
|
return false;
|
|
34025
34065
|
}
|
|
34026
34066
|
const type = el.type || "text";
|
|
34027
|
-
return
|
|
34067
|
+
return (
|
|
34068
|
+
type === "text" ||
|
|
34069
|
+
type === "search" ||
|
|
34070
|
+
type === "url" ||
|
|
34071
|
+
type === "tel" ||
|
|
34072
|
+
type === "email" ||
|
|
34073
|
+
type === "password" ||
|
|
34074
|
+
type === "number"
|
|
34075
|
+
);
|
|
34028
34076
|
};
|
|
34029
34077
|
|
|
34030
34078
|
installImportMetaCssBuild(import.meta);const css$t = /* css */`
|
|
@@ -34092,20 +34140,26 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`
|
|
|
34092
34140
|
*/
|
|
34093
34141
|
const InputDuration = props => {
|
|
34094
34142
|
import.meta.css = [css$t, "@jsenv/navi/src/control/input/input_duration.jsx"];
|
|
34143
|
+
const defaultRef = useRef();
|
|
34144
|
+
props.ref = props.ref || defaultRef;
|
|
34095
34145
|
props.max = props.max || "23h59";
|
|
34096
|
-
const minDuration = parseDuration(props.min);
|
|
34097
|
-
const maxDuration = parseDuration(props.max);
|
|
34098
|
-
const stepDuration = parseDuration(props.step);
|
|
34099
|
-
const hasValue = Object.hasOwn(props, "value");
|
|
34100
34146
|
const {
|
|
34147
|
+
ref,
|
|
34148
|
+
uiAction,
|
|
34149
|
+
action,
|
|
34101
34150
|
unitHour,
|
|
34102
34151
|
textAlign = "auto"
|
|
34103
34152
|
} = props;
|
|
34153
|
+
const minDuration = parseDuration(props.min);
|
|
34154
|
+
const maxDuration = parseDuration(props.max);
|
|
34155
|
+
const stepDuration = parseDuration(props.step);
|
|
34156
|
+
const hasValue = Object.hasOwn(props, "value");
|
|
34104
34157
|
const minSeconds = minDuration ? durationToSeconds(minDuration) : undefined;
|
|
34105
34158
|
const maxSeconds = durationToSeconds(maxDuration);
|
|
34106
34159
|
const stepSeconds = stepDuration ? durationToSeconds(stepDuration) : undefined;
|
|
34107
34160
|
const renderSource = hasValue ? props.value : props.defaultValue;
|
|
34108
34161
|
const components = parseDuration(renderSource);
|
|
34162
|
+
const initialIsoString = components ? durationToISOString(components) ?? "" : "";
|
|
34109
34163
|
const valueHasSeconds = components?.seconds !== undefined;
|
|
34110
34164
|
const valueHasMinutes = components?.minutes !== undefined;
|
|
34111
34165
|
// Fractional seconds (e.g. 0.5 from "PT0.5S") also imply milliseconds.
|
|
@@ -34125,13 +34179,6 @@ const InputDuration = props => {
|
|
|
34125
34179
|
// Exception: if the current value already has minutes, show them read-only so
|
|
34126
34180
|
// the stored precision is faithfully displayed.
|
|
34127
34181
|
const showMinutes = maxSeconds >= 60 && (stepSeconds === undefined || stepSeconds % 3600 !== 0 || valueHasMinutes);
|
|
34128
|
-
const defaultRef = useRef();
|
|
34129
|
-
props.ref = props.ref || defaultRef;
|
|
34130
|
-
const {
|
|
34131
|
-
uiAction,
|
|
34132
|
-
action,
|
|
34133
|
-
ref
|
|
34134
|
-
} = props;
|
|
34135
34182
|
|
|
34136
34183
|
// Mirror the single-input behaviour: a controlled value with no handler makes the field read-only.
|
|
34137
34184
|
const implicitReadOnly = hasValue && !uiAction && !action;
|
|
@@ -34218,16 +34265,92 @@ const InputDuration = props => {
|
|
|
34218
34265
|
disabled,
|
|
34219
34266
|
basePseudoState
|
|
34220
34267
|
} = groupHostProps;
|
|
34221
|
-
const
|
|
34222
|
-
|
|
34223
|
-
|
|
34224
|
-
|
|
34225
|
-
|
|
34268
|
+
const groupRef = useRef();
|
|
34269
|
+
useInputGroup(groupRef);
|
|
34270
|
+
const clipboardProps = useClipboardProps(groupRef);
|
|
34271
|
+
const hourValue = components?.hours;
|
|
34272
|
+
const minuteValue = components?.minutes;
|
|
34273
|
+
const rawSecondValue = components?.seconds;
|
|
34274
|
+
// ISO 8601 fractional seconds encode ms (e.g. 0.5 = 500ms); split them.
|
|
34275
|
+
let secondValue = rawSecondValue;
|
|
34276
|
+
let millisecondValue = components?.milliseconds;
|
|
34277
|
+
if (typeof rawSecondValue === "number" && rawSecondValue % 1 !== 0 && millisecondValue === undefined) {
|
|
34278
|
+
secondValue = Math.floor(rawSecondValue);
|
|
34279
|
+
millisecondValue = Math.round(rawSecondValue % 1 * 1000);
|
|
34280
|
+
}
|
|
34281
|
+
return jsxs(Box, {
|
|
34282
|
+
ref: groupRef,
|
|
34283
|
+
className: "navi_input_duration",
|
|
34284
|
+
"data-callout-arrow-x": "center",
|
|
34285
|
+
width: "fit-content",
|
|
34286
|
+
...groupRootProps,
|
|
34287
|
+
unit: undefined,
|
|
34288
|
+
unitHour: undefined,
|
|
34289
|
+
...clipboardProps,
|
|
34290
|
+
children: [jsx("input", {
|
|
34291
|
+
...groupHostProps,
|
|
34292
|
+
type: "hidden",
|
|
34293
|
+
basePseudoState: undefined // eslint-disable-line react/no-unknown-property
|
|
34294
|
+
,
|
|
34295
|
+
|
|
34296
|
+
...(hasValue ? {
|
|
34297
|
+
value: initialIsoString
|
|
34298
|
+
} : {
|
|
34299
|
+
defaultValue: initialIsoString
|
|
34300
|
+
})
|
|
34301
|
+
}), jsx(Box, {
|
|
34302
|
+
flex: true,
|
|
34303
|
+
spacing: "xxs",
|
|
34304
|
+
width: "fit-content",
|
|
34305
|
+
children: jsx(ControlgroupChildrenWrapper, {
|
|
34306
|
+
...childrenWrapperProps,
|
|
34307
|
+
name: undefined,
|
|
34308
|
+
children: jsx(InputDurationFields, {
|
|
34309
|
+
showHours: showHours,
|
|
34310
|
+
showMinutes: showMinutes,
|
|
34311
|
+
showSeconds: showSeconds,
|
|
34312
|
+
showMilliseconds: showMilliseconds,
|
|
34313
|
+
minutesReadOnly: minutesReadOnly,
|
|
34314
|
+
secondsReadOnly: secondsReadOnly,
|
|
34315
|
+
millisecondsReadOnly: millisecondsReadOnly,
|
|
34316
|
+
stepHasMilliseconds: stepHasMilliseconds,
|
|
34317
|
+
controlled: hasValue,
|
|
34318
|
+
hourValue: hourValue,
|
|
34319
|
+
minuteValue: minuteValue,
|
|
34320
|
+
secondValue: secondValue,
|
|
34321
|
+
millisecondValue: millisecondValue,
|
|
34322
|
+
minSeconds: minSeconds,
|
|
34323
|
+
maxSeconds: maxSeconds,
|
|
34324
|
+
stepSeconds: stepSeconds,
|
|
34325
|
+
unitHour: unitHour,
|
|
34326
|
+
textAlign: textAlign,
|
|
34327
|
+
required: required,
|
|
34328
|
+
readOnly: readOnly,
|
|
34329
|
+
disabled: disabled,
|
|
34330
|
+
basePseudoState: basePseudoState
|
|
34331
|
+
})
|
|
34332
|
+
})
|
|
34333
|
+
})]
|
|
34334
|
+
});
|
|
34335
|
+
};
|
|
34336
|
+
const getVisibleFields = container => {
|
|
34337
|
+
return ["hour", "minute", "second", "millisecond"].filter(f => container.querySelector(`[navi-input-type="${f}"]`) !== null);
|
|
34338
|
+
};
|
|
34339
|
+
const useClipboardProps = groupRef => {
|
|
34226
34340
|
const getClipboardPayload = () => {
|
|
34227
|
-
const
|
|
34228
|
-
if (!
|
|
34341
|
+
const groupEl = groupRef.current;
|
|
34342
|
+
if (!groupEl) {
|
|
34343
|
+
return null;
|
|
34344
|
+
}
|
|
34345
|
+
const hiddenInput = groupEl.querySelector('input[type="hidden"]');
|
|
34346
|
+
const isoString = hiddenInput.value;
|
|
34347
|
+
if (!isoString) {
|
|
34348
|
+
return null;
|
|
34349
|
+
}
|
|
34229
34350
|
const parsed = parseDuration(isoString);
|
|
34230
|
-
if (!parsed)
|
|
34351
|
+
if (!parsed) {
|
|
34352
|
+
return null;
|
|
34353
|
+
}
|
|
34231
34354
|
const rawS = parsed.seconds;
|
|
34232
34355
|
const wholeS = rawS !== undefined ? Math.floor(rawS) : undefined;
|
|
34233
34356
|
const ms = typeof rawS === "number" && rawS % 1 !== 0 ? Math.round(rawS % 1 * 1000) : parsed.milliseconds ?? undefined;
|
|
@@ -34237,6 +34360,8 @@ const InputDuration = props => {
|
|
|
34237
34360
|
second: wholeS,
|
|
34238
34361
|
millisecond: ms
|
|
34239
34362
|
};
|
|
34363
|
+
const visibleFields = getVisibleFields(groupEl);
|
|
34364
|
+
const showMilliseconds = visibleFields.includes("millisecond");
|
|
34240
34365
|
const parts = visibleFields.filter(f => f !== "millisecond").map((f, i) => {
|
|
34241
34366
|
const v = byField[f] ?? 0;
|
|
34242
34367
|
return i === 0 ? String(v) : String(v).padStart(2, "0");
|
|
@@ -34251,7 +34376,7 @@ const InputDuration = props => {
|
|
|
34251
34376
|
};
|
|
34252
34377
|
};
|
|
34253
34378
|
const applyToGroup = (isoValue, e) => {
|
|
34254
|
-
const host =
|
|
34379
|
+
const host = groupRef.current;
|
|
34255
34380
|
dispatchRequestInteraction(host, {
|
|
34256
34381
|
event: e,
|
|
34257
34382
|
name: "subpaste",
|
|
@@ -34263,27 +34388,25 @@ const InputDuration = props => {
|
|
|
34263
34388
|
});
|
|
34264
34389
|
e.preventDefault();
|
|
34265
34390
|
};
|
|
34266
|
-
const
|
|
34391
|
+
const onCopy = e => {
|
|
34267
34392
|
const payload = getClipboardPayload();
|
|
34268
|
-
if (!payload)
|
|
34393
|
+
if (!payload) {
|
|
34394
|
+
return;
|
|
34395
|
+
}
|
|
34269
34396
|
e.clipboardData.setData("text/plain", payload.plainText);
|
|
34270
34397
|
e.clipboardData.setData("application/x-navi", payload.isoString);
|
|
34271
34398
|
e.preventDefault();
|
|
34272
34399
|
};
|
|
34273
|
-
const
|
|
34400
|
+
const onCut = e => {
|
|
34274
34401
|
const payload = getClipboardPayload();
|
|
34275
|
-
if (!payload)
|
|
34402
|
+
if (!payload) {
|
|
34403
|
+
return;
|
|
34404
|
+
}
|
|
34276
34405
|
e.clipboardData.setData("text/plain", payload.plainText);
|
|
34277
34406
|
e.clipboardData.setData("application/x-navi", payload.isoString);
|
|
34278
34407
|
applyToGroup("", e);
|
|
34279
34408
|
};
|
|
34280
|
-
const
|
|
34281
|
-
hour: "hours",
|
|
34282
|
-
minute: "minutes",
|
|
34283
|
-
second: "seconds",
|
|
34284
|
-
millisecond: "milliseconds"
|
|
34285
|
-
};
|
|
34286
|
-
const handlePaste = e => {
|
|
34409
|
+
const onPaste = e => {
|
|
34287
34410
|
const naviData = e.clipboardData.getData("application/x-navi");
|
|
34288
34411
|
const textData = e.clipboardData.getData("text/plain");
|
|
34289
34412
|
let isoValue = null;
|
|
@@ -34297,6 +34420,7 @@ const InputDuration = props => {
|
|
|
34297
34420
|
} else {
|
|
34298
34421
|
// Colon-split fallback: "1:30", "1:30:45", "1:30:45.500"
|
|
34299
34422
|
const colonParts = textData.trim().split(":");
|
|
34423
|
+
const visibleFields = getVisibleFields(groupRef.current);
|
|
34300
34424
|
if (colonParts.length > 1 || visibleFields.length === 1) {
|
|
34301
34425
|
const durationObj = {};
|
|
34302
34426
|
colonParts.forEach((part, i) => {
|
|
@@ -34319,59 +34443,17 @@ const InputDuration = props => {
|
|
|
34319
34443
|
if (!isoValue) return;
|
|
34320
34444
|
applyToGroup(isoValue, e);
|
|
34321
34445
|
};
|
|
34322
|
-
|
|
34323
|
-
|
|
34324
|
-
|
|
34325
|
-
|
|
34326
|
-
|
|
34327
|
-
|
|
34328
|
-
|
|
34329
|
-
|
|
34330
|
-
|
|
34331
|
-
|
|
34332
|
-
|
|
34333
|
-
className: "navi_input_duration",
|
|
34334
|
-
"data-callout-arrow-x": "center",
|
|
34335
|
-
width: "fit-content",
|
|
34336
|
-
...groupRootProps,
|
|
34337
|
-
unit: undefined,
|
|
34338
|
-
unitHour: undefined,
|
|
34339
|
-
onCopy: handleCopy,
|
|
34340
|
-
onCut: handleCut,
|
|
34341
|
-
onPaste: handlePaste,
|
|
34342
|
-
children: [jsx("input", {
|
|
34343
|
-
...groupHostProps,
|
|
34344
|
-
type: "hidden",
|
|
34345
|
-
basePseudoState: undefined
|
|
34346
|
-
}), jsx(ControlgroupChildrenWrapper, {
|
|
34347
|
-
...childrenWrapperProps,
|
|
34348
|
-
name: undefined,
|
|
34349
|
-
children: jsx(InputDurationFields, {
|
|
34350
|
-
showHours: showHours,
|
|
34351
|
-
showMinutes: showMinutes,
|
|
34352
|
-
showSeconds: showSeconds,
|
|
34353
|
-
showMilliseconds: showMilliseconds,
|
|
34354
|
-
minutesReadOnly: minutesReadOnly,
|
|
34355
|
-
secondsReadOnly: secondsReadOnly,
|
|
34356
|
-
millisecondsReadOnly: millisecondsReadOnly,
|
|
34357
|
-
stepHasMilliseconds: stepHasMilliseconds,
|
|
34358
|
-
controlled: hasValue,
|
|
34359
|
-
hourValue: hourValue,
|
|
34360
|
-
minuteValue: minuteValue,
|
|
34361
|
-
secondValue: secondValue,
|
|
34362
|
-
millisecondValue: millisecondValue,
|
|
34363
|
-
minSeconds: minSeconds,
|
|
34364
|
-
maxSeconds: maxSeconds,
|
|
34365
|
-
stepSeconds: stepSeconds,
|
|
34366
|
-
unitHour: unitHour,
|
|
34367
|
-
textAlign: textAlign,
|
|
34368
|
-
required: required,
|
|
34369
|
-
readOnly: readOnly,
|
|
34370
|
-
disabled: disabled,
|
|
34371
|
-
basePseudoState: basePseudoState
|
|
34372
|
-
})
|
|
34373
|
-
})]
|
|
34374
|
-
});
|
|
34446
|
+
return {
|
|
34447
|
+
onCopy,
|
|
34448
|
+
onCut,
|
|
34449
|
+
onPaste
|
|
34450
|
+
};
|
|
34451
|
+
};
|
|
34452
|
+
const FIELD_TO_KEY = {
|
|
34453
|
+
hour: "hours",
|
|
34454
|
+
minute: "minutes",
|
|
34455
|
+
second: "seconds",
|
|
34456
|
+
millisecond: "milliseconds"
|
|
34375
34457
|
};
|
|
34376
34458
|
|
|
34377
34459
|
// Renders the appropriate combination of hour/minute/second sub-inputs based
|
|
@@ -34395,8 +34477,6 @@ const InputDurationFields = ({
|
|
|
34395
34477
|
stepSeconds,
|
|
34396
34478
|
unitHour,
|
|
34397
34479
|
textAlign,
|
|
34398
|
-
// Loading is displayed on the InputGroup wrapper, not on individual sub-inputs.
|
|
34399
|
-
basePseudoState,
|
|
34400
34480
|
...childProps
|
|
34401
34481
|
}) => {
|
|
34402
34482
|
// Hour bounds (in hours)
|
|
@@ -34503,13 +34583,7 @@ const InputDurationFields = ({
|
|
|
34503
34583
|
if (inputs.length === 1) {
|
|
34504
34584
|
return inputs[0];
|
|
34505
34585
|
}
|
|
34506
|
-
return
|
|
34507
|
-
flex: true,
|
|
34508
|
-
spacing: "xxs",
|
|
34509
|
-
width: "fit-content",
|
|
34510
|
-
basePseudoState: basePseudoState,
|
|
34511
|
-
children: inputs
|
|
34512
|
-
});
|
|
34586
|
+
return inputs;
|
|
34513
34587
|
};
|
|
34514
34588
|
const InputDurationPart = ({
|
|
34515
34589
|
unit,
|
|
@@ -36942,6 +37016,7 @@ installImportMetaCssBuild(import.meta);const css$n = /* css */`
|
|
|
36942
37016
|
position: relative;
|
|
36943
37017
|
font-size: var(--navi-control-font-size);
|
|
36944
37018
|
font-family: var(--navi-control-font-family);
|
|
37019
|
+
-webkit-tap-highlight-color: var(--navi-control-tap-highlight-color);
|
|
36945
37020
|
}
|
|
36946
37021
|
}
|
|
36947
37022
|
|
|
@@ -40114,13 +40189,11 @@ const isWithinPickerContent = (el, pickerEl) => {
|
|
|
40114
40189
|
};
|
|
40115
40190
|
const PickerInput = props => {
|
|
40116
40191
|
return jsx(Box, {
|
|
40117
|
-
as: "input"
|
|
40118
|
-
// readOnly because user MUST use the picker to change the value
|
|
40119
|
-
,
|
|
40120
|
-
|
|
40121
|
-
readOnly: true,
|
|
40192
|
+
as: "input",
|
|
40122
40193
|
"data-readonly-forced": props.readOnly ? undefined : "",
|
|
40123
40194
|
...props,
|
|
40195
|
+
// must be readOnly to prevent opening keyboard on mobile (and direct update via keyboard too, we want people to use the picker)
|
|
40196
|
+
readOnly: true,
|
|
40124
40197
|
className: "navi_picker_input",
|
|
40125
40198
|
pseudoClasses: PickerInputPseudoClasses,
|
|
40126
40199
|
onKeyDown: e => {
|
|
@@ -46170,5 +46243,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
46170
46243
|
})
|
|
46171
46244
|
});
|
|
46172
46245
|
|
|
46173
|
-
export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, BadgeList, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, CheckboxGroup, CloseSvg, Code, Col, Colgroup, Color, ConstructionSvg, ControlGroup, Details, Dialog, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Field, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, InputDuration,
|
|
46246
|
+
export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, BadgeList, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, CheckboxGroup, CloseSvg, Code, Col, Colgroup, Color, ConstructionSvg, ControlGroup, Details, Dialog, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Field, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, InputDuration, Interpolate, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, List, ListItem, ListItemGroup, Loading, LoadingDotsSvg, LoadingIndicator, LoadingIndicatorFluid, LoadingOutline, MessageBox, Meter, Nav, NaviDebug, Paragraph, Picker, Popover, Quantity, RadioGroup, Route, RowNumberCol, RowNumberTableCell, SVGMaskOverlay, SearchSvg, SelectableInput, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, TextBox, Thead, Time, Title, Tr, UITransition, Unit, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, anyMatchingRouteSignal, applySearch, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSearch, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, ensureDocumentStartViewTransition, filterTableSelection, formatDatetime, formatDay, formatDayRelative, formatMonth, formatNumber, formatTime, formatTimeRelative, getNowHours, getNowHoursRoundedToStep, interpolateText, isCellSelected, isColumnSelected, isRowSelected, isToday, langSignal, localStorageSignal, moveArrayItemByIndex, navBack, navForward, navTo, naviI18n, openCallout, rawUrlPart, registerGlobalConstraint, reload, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, swapArrayItemByIndex, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutRequestClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDependenciesDiff, useDisplayedLayoutEffect, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSearchText, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage, windowWidthSignal };
|
|
46174
46247
|
//# sourceMappingURL=jsenv_navi.js.map
|