@jsswift/ui 1.0.54 → 2.0.1
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/css/animation.css +36 -36
- package/dist/css/base.css +374 -374
- package/dist/css/docs.css +54 -54
- package/dist/css/fonts-nunito.css +2 -2
- package/dist/css/min-ui.css +1 -1
- package/dist/css/responsive-base.css +549 -549
- package/dist/css/responsive.css +3225 -3225
- package/dist/css/ui-components.css +2902 -2930
- package/dist/css/ui-light.css +3853 -3881
- package/dist/css/ui-light.min.css +1 -1
- package/dist/css/ui.css +6530 -6558
- package/dist/css/ui.min.css +1 -1
- package/dist/min-ui.js +12 -12
- package/dist/ui.js +4354 -9379
- package/dist/ui.min.js +12 -12
- package/package.json +2 -2
- package/src/00-bootstrap.js +305 -305
- package/src/01-foundation-helpers.js +328 -325
- package/src/10-primitives-layout.js +242 -242
- package/src/20-display-content.js +76 -76
- package/src/21-list-content.js +21 -21
- package/src/22-banner-content.js +376 -376
- package/src/23-tooltip.js +9 -9
- package/src/31-form-advanced.js +141 -141
- package/src/40-navigation.js +81 -81
- package/src/41-tab-panel.js +37 -37
- package/src/50-feedback.js +52 -52
- package/src/51-feedback-service.js +166 -166
- package/src/60-shell-app.js +1082 -1082
- package/src/61-form-service.js +5 -5
- package/src/70-dialog.js +34 -34
- package/src/71-menu-overlays.js +73 -73
- package/src/80-data.js +38 -38
- package/src/css/animation.css +36 -36
- package/src/css/base.css +374 -374
- package/src/css/docs.css +54 -54
- package/src/css/fonts-nunito.css +2 -2
- package/src/css/responsive.css +3225 -3225
- package/src/css/ui-components.css +2902 -2930
package/src/31-form-advanced.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
const isRadio = type === "radio";
|
|
5
5
|
const isToggle = options.appearance === "toggle";
|
|
6
6
|
const supportsStandby = !isRadio;
|
|
7
|
-
const id = props.id || (`
|
|
7
|
+
const id = props.id || (`jss-${type}-` + Math.random().toString(36).slice(2));
|
|
8
8
|
const model = resolveModel(
|
|
9
9
|
props.model,
|
|
10
10
|
options.modelName || (isRadio ? "UI.Radio:model" : "UI.Checkbox:model")
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
inputProps.type = type;
|
|
22
22
|
inputProps.id = id;
|
|
23
23
|
if (isRadio && props.name != null) inputProps.name = props.name;
|
|
24
|
-
inputProps.class = uiClass([`
|
|
24
|
+
inputProps.class = uiClass([`jss-${type}`, "jss-choice-input", props.inputClass]);
|
|
25
25
|
const input = _.input(inputProps);
|
|
26
26
|
|
|
27
27
|
const labelNodes = renderSlotToArray(slots, "label", {}, props.label);
|
|
28
28
|
const labelContent = labelNodes.length ? labelNodes : renderSlotToArray(slots, "default", {}, children);
|
|
29
|
-
const shortcodeHint = uiCreateShortcodeHint(props, { className: "
|
|
29
|
+
const shortcodeHint = uiCreateShortcodeHint(props, { className: "jss-shortcode jss-choice-shortcode" });
|
|
30
30
|
const finalLabelContent = shortcodeHint ? [...labelContent, shortcodeHint] : labelContent;
|
|
31
31
|
|
|
32
32
|
const wrapProps = JSswift.omit(props, [
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"shortcode", "shortcut", "hotkey", "showShortcode", "showShortcut"
|
|
40
40
|
]);
|
|
41
41
|
wrapProps.class = uiClass([
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
`
|
|
46
|
-
uiWhen(isToggle, "
|
|
47
|
-
uiWhen(isToggle && isRadio, "
|
|
48
|
-
uiWhen(isToggle && !isRadio, "
|
|
42
|
+
"jss-clear-set",
|
|
43
|
+
"jss-singularity-check",
|
|
44
|
+
"jss-choice-wrap",
|
|
45
|
+
`jss-${type}-wrap`,
|
|
46
|
+
uiWhen(isToggle, "jss-toggle-wrap"),
|
|
47
|
+
uiWhen(isToggle && isRadio, "jss-toggle-radio-wrap"),
|
|
48
|
+
uiWhen(isToggle && !isRadio, "jss-toggle-checkbox-wrap"),
|
|
49
49
|
uiWhen(props.dense, "dense"),
|
|
50
50
|
props.class
|
|
51
51
|
]);
|
|
@@ -53,19 +53,19 @@
|
|
|
53
53
|
|
|
54
54
|
const sizeValue = uiUnwrap(props.size);
|
|
55
55
|
if (sizeValue != null && !(typeof sizeValue === "string" && JSswift.uiSizes?.includes(sizeValue))) {
|
|
56
|
-
wrapProps.style["--
|
|
56
|
+
wrapProps.style["--jss-choice-size"] = toCssSize(sizeValue);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const marker = _.span({
|
|
60
60
|
class: uiClass([
|
|
61
|
-
"
|
|
62
|
-
isRadio ? "
|
|
63
|
-
uiWhen(isToggle, "
|
|
61
|
+
"jss-choice-mark",
|
|
62
|
+
isRadio ? "jss-choice-radio-mark" : "jss-choice-checkbox-mark",
|
|
63
|
+
uiWhen(isToggle, "jss-toggle-mark")
|
|
64
64
|
])
|
|
65
65
|
});
|
|
66
|
-
const indicatorHost = isToggle ? _.span({ class: "
|
|
66
|
+
const indicatorHost = isToggle ? _.span({ class: "jss-toggle-thumb" }) : marker;
|
|
67
67
|
if (isToggle) marker.appendChild(indicatorHost);
|
|
68
|
-
const labelNode = finalLabelContent.length ? _.span({ class: "
|
|
68
|
+
const labelNode = finalLabelContent.length ? _.span({ class: "jss-choice-label" }, ...finalLabelContent) : null;
|
|
69
69
|
|
|
70
70
|
const wrap = _.label(
|
|
71
71
|
wrapProps,
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
|
|
133
133
|
if (isToggle) {
|
|
134
134
|
if (state == null) {
|
|
135
|
-
indicatorHost.style.transform = "translateX(calc((var(--
|
|
135
|
+
indicatorHost.style.transform = "translateX(calc((var(--jss-toggle-width) - var(--jss-toggle-thumb-size) - 1px) / 2))";
|
|
136
136
|
} else {
|
|
137
137
|
indicatorHost.style.removeProperty("transform");
|
|
138
138
|
}
|
|
@@ -249,26 +249,26 @@
|
|
|
249
249
|
"selectionColor", "trackColor", "thumbColor", "inputClass", "readonly", "size"
|
|
250
250
|
]);
|
|
251
251
|
inputProps.type = "range";
|
|
252
|
-
inputProps.class = uiClass(["
|
|
252
|
+
inputProps.class = uiClass(["jss-slider-input", props.inputClass]);
|
|
253
253
|
const input = _.input(inputProps);
|
|
254
254
|
|
|
255
255
|
const sliderStyle = { ...(props.style || {}) };
|
|
256
256
|
const sizeValue = uiUnwrap(props.size);
|
|
257
257
|
if (sizeValue != null) {
|
|
258
258
|
const sliderSize = (typeof sizeValue === "string" && JSswift.uiSizes?.includes(sizeValue))
|
|
259
|
-
? `var(--
|
|
259
|
+
? `var(--jss-size-${sizeValue})`
|
|
260
260
|
: toCssSize(sizeValue);
|
|
261
|
-
sliderStyle["--
|
|
262
|
-
sliderStyle["--
|
|
263
|
-
sliderStyle["--
|
|
264
|
-
sliderStyle["--
|
|
261
|
+
sliderStyle["--jss-slider-size"] = sliderSize;
|
|
262
|
+
sliderStyle["--jss-slider-track-size"] = `max(4px, calc(${sliderSize} / 4))`;
|
|
263
|
+
sliderStyle["--jss-slider-box-height"] = `calc(${sliderSize} * 1.5)`;
|
|
264
|
+
sliderStyle["--jss-slider-marker-size"] = `max(6px, calc(${sliderSize} / 3))`;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
const wrap = _.label({
|
|
268
268
|
class: uiClass([
|
|
269
|
-
"
|
|
270
|
-
"
|
|
271
|
-
"
|
|
269
|
+
"jss-clear-set",
|
|
270
|
+
"jss-singularity-check",
|
|
271
|
+
"jss-slider-wrap",
|
|
272
272
|
uiWhen(props.dense, "dense"),
|
|
273
273
|
props.class
|
|
274
274
|
]),
|
|
@@ -277,69 +277,69 @@
|
|
|
277
277
|
setPropertyProps(wrap, props);
|
|
278
278
|
|
|
279
279
|
const header = _.div({
|
|
280
|
-
class: "
|
|
280
|
+
class: "jss-slider-header"
|
|
281
281
|
});
|
|
282
282
|
const labelHost = _.span({
|
|
283
|
-
class: "
|
|
283
|
+
class: "jss-slider-label"
|
|
284
284
|
});
|
|
285
285
|
const valueHost = _.span({
|
|
286
|
-
class: "
|
|
286
|
+
class: "jss-slider-value"
|
|
287
287
|
});
|
|
288
288
|
header.append(labelHost, valueHost);
|
|
289
289
|
|
|
290
290
|
const body = _.div({
|
|
291
|
-
class: "
|
|
291
|
+
class: "jss-slider-body"
|
|
292
292
|
});
|
|
293
293
|
const startIconHost = _.span({
|
|
294
|
-
class: "
|
|
294
|
+
class: "jss-slider-icon jss-slider-icon-left"
|
|
295
295
|
});
|
|
296
296
|
const startLabelHost = _.span({
|
|
297
|
-
class: "
|
|
297
|
+
class: "jss-slider-edge-label jss-slider-edge-label-left"
|
|
298
298
|
});
|
|
299
299
|
const main = _.div({
|
|
300
|
-
class: "
|
|
300
|
+
class: "jss-slider-main"
|
|
301
301
|
});
|
|
302
302
|
const sliderBox = _.div({
|
|
303
|
-
class: "
|
|
303
|
+
class: "jss-slider-box",
|
|
304
304
|
style: {
|
|
305
|
-
minHeight: "var(--
|
|
305
|
+
minHeight: "var(--jss-slider-box-height, 36px)"
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
308
|
const rail = _.span({
|
|
309
|
-
class: "
|
|
309
|
+
class: "jss-slider-rail",
|
|
310
310
|
style: {
|
|
311
|
-
height: "var(--
|
|
311
|
+
height: "var(--jss-slider-track-size, 6px)"
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
314
|
const selection = _.span({
|
|
315
|
-
class: "
|
|
315
|
+
class: "jss-slider-selection",
|
|
316
316
|
style: {
|
|
317
|
-
height: "var(--
|
|
317
|
+
height: "var(--jss-slider-track-size, 6px)"
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
320
|
const thumb = _.span({
|
|
321
|
-
class: "
|
|
321
|
+
class: "jss-slider-thumb",
|
|
322
322
|
style: {
|
|
323
|
-
width: "var(--
|
|
324
|
-
height: "var(--
|
|
323
|
+
width: "var(--jss-slider-size, 24px)",
|
|
324
|
+
height: "var(--jss-slider-size, 24px)"
|
|
325
325
|
}
|
|
326
326
|
});
|
|
327
327
|
const thumbIconHost = _.span({
|
|
328
|
-
class: "
|
|
328
|
+
class: "jss-slider-thumb-icon"
|
|
329
329
|
});
|
|
330
330
|
const thumbLabelHost = _.span({
|
|
331
|
-
class: "
|
|
331
|
+
class: "jss-slider-thumb-label"
|
|
332
332
|
});
|
|
333
333
|
thumb.append(thumbLabelHost, thumbIconHost);
|
|
334
334
|
|
|
335
335
|
const markersHost = _.div({
|
|
336
|
-
class: "
|
|
336
|
+
class: "jss-slider-markers"
|
|
337
337
|
});
|
|
338
338
|
const endLabelHost = _.span({
|
|
339
|
-
class: "
|
|
339
|
+
class: "jss-slider-edge-label jss-slider-edge-label-right"
|
|
340
340
|
});
|
|
341
341
|
const endIconHost = _.span({
|
|
342
|
-
class: "
|
|
342
|
+
class: "jss-slider-icon jss-slider-icon-right"
|
|
343
343
|
});
|
|
344
344
|
|
|
345
345
|
sliderBox.append(rail, selection, thumb, input);
|
|
@@ -485,10 +485,10 @@
|
|
|
485
485
|
const active = uiUnwrap(props.reverse) ? getValue() <= marker.value : getValue() >= marker.value;
|
|
486
486
|
const item = _.button({
|
|
487
487
|
type: "button",
|
|
488
|
-
class: uiClass(["
|
|
488
|
+
class: uiClass(["jss-slider-marker", marker.className, uiWhen(() => active, "active")]),
|
|
489
489
|
style: {
|
|
490
490
|
left: `${ratio * 100}%`,
|
|
491
|
-
color: active ? (uiUnwrap(props.color) || "var(--
|
|
491
|
+
color: active ? (uiUnwrap(props.color) || "var(--jss-primary)") : "var(--jss-muted)",
|
|
492
492
|
cursor: (uiUnwrap(props.disabled) || uiUnwrap(props.readonly)) ? "default" : "pointer"
|
|
493
493
|
},
|
|
494
494
|
disabled: !!uiUnwrap(props.disabled) || !!uiUnwrap(props.readonly),
|
|
@@ -513,11 +513,11 @@
|
|
|
513
513
|
: JSswift.ui.slot(marker.icon, { ...markerCtx, as: "marker" });
|
|
514
514
|
}
|
|
515
515
|
const markerTick = _.span({
|
|
516
|
-
class: "
|
|
516
|
+
class: "jss-slider-marker-tick",
|
|
517
517
|
style: {
|
|
518
|
-
width: "var(--
|
|
519
|
-
height: "var(--
|
|
520
|
-
background: active ? (uiUnwrap(props.color) || "var(--
|
|
518
|
+
width: "var(--jss-slider-marker-size, 8px)",
|
|
519
|
+
height: "var(--jss-slider-marker-size, 8px)",
|
|
520
|
+
background: active ? (uiUnwrap(props.color) || "var(--jss-primary)") : "var(--jss-border-color)"
|
|
521
521
|
}
|
|
522
522
|
});
|
|
523
523
|
const markerNodes = markerNode == null
|
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
markerNodes.forEach((node) => item.appendChild(node));
|
|
530
530
|
if (labelNodes.length) {
|
|
531
531
|
item.appendChild(_.span({
|
|
532
|
-
class: "
|
|
532
|
+
class: "jss-slider-marker-label"
|
|
533
533
|
}, ...labelNodes));
|
|
534
534
|
}
|
|
535
535
|
markersHost.appendChild(item);
|
|
@@ -593,8 +593,8 @@
|
|
|
593
593
|
const step = getStep();
|
|
594
594
|
const ratio = ratioFromValue(value);
|
|
595
595
|
const percent = `${ratio * 100}%`;
|
|
596
|
-
const color = uiUnwrap(props.color) || uiUnwrap(props.selectionColor) || "var(--
|
|
597
|
-
const trackColor = uiUnwrap(props.trackColor) || "var(--
|
|
596
|
+
const color = uiUnwrap(props.color) || uiUnwrap(props.selectionColor) || "var(--jss-primary)";
|
|
597
|
+
const trackColor = uiUnwrap(props.trackColor) || "var(--jss-border-color)";
|
|
598
598
|
const thumbColor = uiUnwrap(props.thumbColor) || color;
|
|
599
599
|
const readonly = !!uiUnwrap(props.readonly);
|
|
600
600
|
const disabled = !!uiUnwrap(props.disabled);
|
|
@@ -659,7 +659,7 @@
|
|
|
659
659
|
|
|
660
660
|
if (props.withQItem || props.qitem || props.item === true) {
|
|
661
661
|
const item = UI.Item({
|
|
662
|
-
class: uiClass(["
|
|
662
|
+
class: uiClass(["jss-slider-item", props.itemClass]),
|
|
663
663
|
style: props.itemStyle
|
|
664
664
|
}, wrap);
|
|
665
665
|
item._input = input;
|
|
@@ -679,7 +679,7 @@
|
|
|
679
679
|
const slots = props.slots || {};
|
|
680
680
|
const boundValue = props.model || ((uiIsSignal(props.value) || uiIsRod(props.value)) ? props.value : null);
|
|
681
681
|
const model = resolveModel(boundValue, "UI.Rating:model");
|
|
682
|
-
const id = props.id || (`
|
|
682
|
+
const id = props.id || (`jss-rating-` + Math.random().toString(36).slice(2));
|
|
683
683
|
const inputProps = JSswift.omit(props, [
|
|
684
684
|
"model", "value", "max", "class", "style", "dense", "readonly", "disabled", "clearable",
|
|
685
685
|
"half", "allowHalf", "noDimming", "label", "slots", "onChange", "onInput", "onHover",
|
|
@@ -691,7 +691,7 @@
|
|
|
691
691
|
inputProps.type = "hidden";
|
|
692
692
|
inputProps.id = id;
|
|
693
693
|
if (props.name != null) inputProps.name = props.name;
|
|
694
|
-
inputProps.class = uiClass(["
|
|
694
|
+
inputProps.class = uiClass(["jss-rating-input", "jss-choice-input", props.inputClass]);
|
|
695
695
|
const input = _.input(inputProps);
|
|
696
696
|
|
|
697
697
|
const wrapProps = JSswift.omit(props, [
|
|
@@ -703,26 +703,26 @@
|
|
|
703
703
|
"hoverColor", "size", "gap", "tabindex", "tabIndex", "inputClass"
|
|
704
704
|
]);
|
|
705
705
|
wrapProps.class = uiClass([
|
|
706
|
-
"
|
|
707
|
-
"
|
|
708
|
-
"
|
|
709
|
-
"
|
|
710
|
-
"
|
|
706
|
+
"jss-clear-set",
|
|
707
|
+
"jss-singularity-check",
|
|
708
|
+
"jss-choice-wrap",
|
|
709
|
+
"jss-rating",
|
|
710
|
+
"jss-rating-wrap",
|
|
711
711
|
uiWhen(props.dense, "dense"),
|
|
712
712
|
props.class
|
|
713
713
|
]);
|
|
714
714
|
wrapProps.style = { ...(props.style || {}) };
|
|
715
715
|
const sizeValue = uiUnwrap(props.size);
|
|
716
716
|
if (sizeValue != null && !(typeof sizeValue === "string" && JSswift.uiSizes?.includes(sizeValue))) {
|
|
717
|
-
wrapProps.style["--
|
|
717
|
+
wrapProps.style["--jss-rating-size"] = toCssSize(sizeValue);
|
|
718
718
|
}
|
|
719
719
|
const gapValue = uiUnwrap(props.gap);
|
|
720
720
|
if (gapValue != null) {
|
|
721
|
-
wrapProps.style["--
|
|
721
|
+
wrapProps.style["--jss-rating-gap"] = toCssSize(gapValue);
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
const control = _.span({
|
|
725
|
-
class: "
|
|
725
|
+
class: "jss-rating-control",
|
|
726
726
|
onMouseleave: (e) => {
|
|
727
727
|
if (hoverValue == null) return;
|
|
728
728
|
hoverValue = null;
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
setRatingValue(next, e, { emit: true });
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
|
-
const labelHost = _.span({ class: "
|
|
769
|
+
const labelHost = _.span({ class: "jss-choice-label jss-rating-label" });
|
|
770
770
|
const wrap = _.label(wrapProps, input, control, labelHost);
|
|
771
771
|
setPropertyProps(wrap, props);
|
|
772
772
|
|
|
@@ -827,10 +827,10 @@
|
|
|
827
827
|
return "empty";
|
|
828
828
|
};
|
|
829
829
|
const getStateColor = (state, hovered) => {
|
|
830
|
-
const selectedColor = uiUnwrap(props.colorSelected ?? props.activeColor ?? props.color ?? props.textColor) || "var(--
|
|
830
|
+
const selectedColor = uiUnwrap(props.colorSelected ?? props.activeColor ?? props.color ?? props.textColor) || "var(--jss-warning, #f0b429)";
|
|
831
831
|
const halfColor = uiUnwrap(props.colorHalf ?? props.halfColor ?? props.colorSelected ?? props.activeColor ?? props.color ?? props.textColor) || selectedColor;
|
|
832
832
|
const hoveredColor = uiUnwrap(props.colorHovered ?? props.hoverColor ?? props.colorSelected ?? props.activeColor ?? props.color ?? props.textColor) || selectedColor;
|
|
833
|
-
const inactiveColor = uiUnwrap(props.colorInactive ?? props.colorOff ?? props.color) || "var(--
|
|
833
|
+
const inactiveColor = uiUnwrap(props.colorInactive ?? props.colorOff ?? props.color) || "var(--jss-muted)";
|
|
834
834
|
if (hovered) return hoveredColor;
|
|
835
835
|
if (state === "full") return selectedColor;
|
|
836
836
|
if (state === "half") return halfColor;
|
|
@@ -873,9 +873,9 @@
|
|
|
873
873
|
items = [];
|
|
874
874
|
clearHost(control);
|
|
875
875
|
for (let index = 1; index <= max; index++) {
|
|
876
|
-
const iconHost = _.span({ class: "
|
|
876
|
+
const iconHost = _.span({ class: "jss-rating-item-icon" });
|
|
877
877
|
const item = _.span({
|
|
878
|
-
class: "
|
|
878
|
+
class: "jss-rating-item",
|
|
879
879
|
role: "radio",
|
|
880
880
|
tabIndex: -1,
|
|
881
881
|
onMousemove: (e) => {
|
|
@@ -952,7 +952,7 @@
|
|
|
952
952
|
setValue: (next) => setRatingValue(next, null, { emit: false })
|
|
953
953
|
};
|
|
954
954
|
item.className = uiClassStatic([
|
|
955
|
-
"
|
|
955
|
+
"jss-rating-item",
|
|
956
956
|
`is-${state}`,
|
|
957
957
|
uiWhen(hovered, "is-hovered")
|
|
958
958
|
]);
|
|
@@ -1179,7 +1179,7 @@
|
|
|
1179
1179
|
};
|
|
1180
1180
|
const section = _.div({
|
|
1181
1181
|
class: uiClass([
|
|
1182
|
-
"
|
|
1182
|
+
"jss-time-section",
|
|
1183
1183
|
uiWhen(embedded, "is-embedded"),
|
|
1184
1184
|
uiWhen(withSeconds, "has-seconds"),
|
|
1185
1185
|
className
|
|
@@ -1187,7 +1187,7 @@
|
|
|
1187
1187
|
});
|
|
1188
1188
|
const shortcutList = uiUnwrap(shortcuts) || [];
|
|
1189
1189
|
if (Array.isArray(shortcutList) && shortcutList.length) {
|
|
1190
|
-
const shortcutWrap = _.div({ class: "
|
|
1190
|
+
const shortcutWrap = _.div({ class: "jss-time-shortcuts" });
|
|
1191
1191
|
shortcutList.forEach((item, index) => {
|
|
1192
1192
|
if (!item) return;
|
|
1193
1193
|
const rawValue = typeof item.value === "function"
|
|
@@ -1204,17 +1204,17 @@
|
|
|
1204
1204
|
const labelNode = renderNamedSlot("shortcut", ctx, item.label ?? item.text ?? ctx.displayValue);
|
|
1205
1205
|
shortcutWrap.appendChild(_.button({
|
|
1206
1206
|
type: "button",
|
|
1207
|
-
class: uiClass(["
|
|
1207
|
+
class: uiClass(["jss-time-shortcut", uiWhen(!!selectedParts && uiCompareTimeValue(normalizedValue, selectedParts) === 0, "is-selected")]),
|
|
1208
1208
|
disabled: disabled || readonly,
|
|
1209
1209
|
onClick: () => onSelect?.(normalizedValue, { shortcut: item, index })
|
|
1210
1210
|
}, ...renderSlotToArray(null, "default", ctx, labelNode)));
|
|
1211
1211
|
});
|
|
1212
1212
|
if (shortcutWrap.childNodes.length) section.appendChild(shortcutWrap);
|
|
1213
1213
|
}
|
|
1214
|
-
const columns = _.div({ class: "
|
|
1214
|
+
const columns = _.div({ class: "jss-time-columns" });
|
|
1215
1215
|
const createColumn = (title, part, values) => {
|
|
1216
|
-
const column = _.div({ class: "
|
|
1217
|
-
const optionsWrap = _.div({ class: "
|
|
1216
|
+
const column = _.div({ class: "jss-time-column", "data-time-part": part });
|
|
1217
|
+
const optionsWrap = _.div({ class: "jss-time-options" });
|
|
1218
1218
|
values.forEach((optionValue) => {
|
|
1219
1219
|
const requested = makeRequestedValue(part, optionValue);
|
|
1220
1220
|
const normalized = uiConstrainTimeParts(requested, { withSeconds, min: props.min, max: props.max });
|
|
@@ -1233,12 +1233,12 @@
|
|
|
1233
1233
|
const pointNodes = selected ? renderPointNodes(ctx) : [];
|
|
1234
1234
|
optionsWrap.appendChild(_.button({
|
|
1235
1235
|
type: "button",
|
|
1236
|
-
class: uiClass(["
|
|
1236
|
+
class: uiClass(["jss-time-option", uiWhen(selected, "is-selected"), uiWhen(optionDisabled, "is-disabled")]),
|
|
1237
1237
|
disabled: optionDisabled,
|
|
1238
1238
|
onClick: () => onSelect?.(normalized, { part, optionValue })
|
|
1239
1239
|
},
|
|
1240
|
-
_.span({ class: "
|
|
1241
|
-
pointNodes.length ? _.span({ class: "
|
|
1240
|
+
_.span({ class: "jss-time-option-label" }, ...renderSlotToArray(null, "default", ctx, optionNode)),
|
|
1241
|
+
pointNodes.length ? _.span({ class: "jss-time-option-point" }, ...pointNodes) : null
|
|
1242
1242
|
));
|
|
1243
1243
|
});
|
|
1244
1244
|
column.appendChild(optionsWrap);
|
|
@@ -1256,7 +1256,7 @@
|
|
|
1256
1256
|
const uiCaptureTimeColumnScrollState = (root) => {
|
|
1257
1257
|
if (!root) return null;
|
|
1258
1258
|
const state = {};
|
|
1259
|
-
root.querySelectorAll(".
|
|
1259
|
+
root.querySelectorAll(".jss-time-column").forEach((column, index) => {
|
|
1260
1260
|
const key = column.getAttribute("data-time-part") || String(index);
|
|
1261
1261
|
state[key] = column.scrollTop;
|
|
1262
1262
|
});
|
|
@@ -1267,11 +1267,11 @@
|
|
|
1267
1267
|
if (!root) return;
|
|
1268
1268
|
const scrollState = options.scrollState || null;
|
|
1269
1269
|
const behavior = options.behavior ?? "smooth";
|
|
1270
|
-
root.querySelectorAll(".
|
|
1270
|
+
root.querySelectorAll(".jss-time-column").forEach((column, index) => {
|
|
1271
1271
|
const key = column.getAttribute("data-time-part") || String(index);
|
|
1272
1272
|
const previousTop = scrollState && Number.isFinite(scrollState[key]) ? scrollState[key] : null;
|
|
1273
1273
|
if (previousTop != null) column.scrollTop = previousTop;
|
|
1274
|
-
const selectedOption = column.querySelector(".
|
|
1274
|
+
const selectedOption = column.querySelector(".jss-time-option.is-selected");
|
|
1275
1275
|
if (!selectedOption) return;
|
|
1276
1276
|
const maxTop = Math.max(0, column.scrollHeight - column.clientHeight);
|
|
1277
1277
|
const targetTop = selectedOption.offsetTop - ((column.clientHeight - selectedOption.offsetHeight) / 2);
|
|
@@ -1294,7 +1294,7 @@
|
|
|
1294
1294
|
const slots = props.slots || {};
|
|
1295
1295
|
const sizeValue = uiComputed(props.size, () => {
|
|
1296
1296
|
const value = String(uiUnwrap(props.size) || "").toLowerCase();
|
|
1297
|
-
return ["xs", "sm", "md", "lg", "xl"].includes(value) ? `
|
|
1297
|
+
return ["xs", "sm", "md", "lg", "xl"].includes(value) ? `jss-size-${value}` : "";
|
|
1298
1298
|
});
|
|
1299
1299
|
const requestedMode = String(
|
|
1300
1300
|
uiUnwrap(
|
|
@@ -1712,7 +1712,7 @@
|
|
|
1712
1712
|
: (mode === "multiple" ? "Seleziona date" : "Seleziona data"));
|
|
1713
1713
|
|
|
1714
1714
|
const displayInput = isCalendar ? null : _.input({
|
|
1715
|
-
class: uiClass(["
|
|
1715
|
+
class: uiClass(["jss-input", "jss-date-display", sizeValue, uiWhen(props.manualInput, "is-manual"), props.inputClass]),
|
|
1716
1716
|
type: "text",
|
|
1717
1717
|
autocomplete: "off",
|
|
1718
1718
|
placeholder: hasFloatingLabel ? "" : (props.placeholder ?? defaultPlaceholder),
|
|
@@ -1721,7 +1721,7 @@
|
|
|
1721
1721
|
value: formatDisplayValue(localValue, localTimeValue)
|
|
1722
1722
|
});
|
|
1723
1723
|
const hiddenHost = _.div({ style: { display: "contents" } });
|
|
1724
|
-
const controlNode = isCalendar ? null : _.div({ class: "
|
|
1724
|
+
const controlNode = isCalendar ? null : _.div({ class: "jss-date-control", style: { display: "contents" } }, displayInput, hiddenHost);
|
|
1725
1725
|
|
|
1726
1726
|
const field = isCalendar ? null : UI.FormField({
|
|
1727
1727
|
...fieldProps,
|
|
@@ -2054,14 +2054,14 @@
|
|
|
2054
2054
|
const start = new Date(year, month, 1);
|
|
2055
2055
|
const offset = (start.getDay() - getFirstDayOfWeek() + 7) % 7;
|
|
2056
2056
|
const gridStart = new Date(year, month, 1 - offset);
|
|
2057
|
-
const monthBox = _.div({ class: "
|
|
2058
|
-
monthBox.appendChild(_.div({ class: "
|
|
2057
|
+
const monthBox = _.div({ class: "jss-date-month" });
|
|
2058
|
+
monthBox.appendChild(_.div({ class: "jss-date-month-title" }, monthLabelFormatter.format(start)));
|
|
2059
2059
|
|
|
2060
|
-
const weekdays = _.div({ class: "
|
|
2061
|
-
titleDates.forEach((label) => weekdays.appendChild(_.div({ class: "
|
|
2060
|
+
const weekdays = _.div({ class: "jss-date-weekdays" });
|
|
2061
|
+
titleDates.forEach((label) => weekdays.appendChild(_.div({ class: "jss-date-weekday" }, label)));
|
|
2062
2062
|
monthBox.appendChild(weekdays);
|
|
2063
2063
|
|
|
2064
|
-
const grid = _.div({ class: "
|
|
2064
|
+
const grid = _.div({ class: "jss-date-grid" });
|
|
2065
2065
|
for (let index = 0; index < 42; index += 1) {
|
|
2066
2066
|
const date = new Date(gridStart.getFullYear(), gridStart.getMonth(), gridStart.getDate() + index);
|
|
2067
2067
|
const iso = toIsoDate(date);
|
|
@@ -2088,7 +2088,7 @@
|
|
|
2088
2088
|
const dayBtn = _.button({
|
|
2089
2089
|
type: "button",
|
|
2090
2090
|
class: uiClass([
|
|
2091
|
-
"
|
|
2091
|
+
"jss-date-day",
|
|
2092
2092
|
uiWhen(!inMonth, "is-outside"),
|
|
2093
2093
|
uiWhen(selected, "is-selected"),
|
|
2094
2094
|
uiWhen(inRange, "is-in-range"),
|
|
@@ -2116,8 +2116,8 @@
|
|
|
2116
2116
|
onMouseEnter: () => updateRangeHover(iso),
|
|
2117
2117
|
onFocus: () => updateRangeHover(iso, { render: false })
|
|
2118
2118
|
},
|
|
2119
|
-
_.span({ class: "
|
|
2120
|
-
pointNodes.length ? _.span({ class: "
|
|
2119
|
+
_.span({ class: "jss-date-day-label" }, ...labelNodes),
|
|
2120
|
+
pointNodes.length ? _.span({ class: "jss-date-day-point" }, ...pointNodes) : null
|
|
2121
2121
|
);
|
|
2122
2122
|
grid.appendChild(dayBtn);
|
|
2123
2123
|
}
|
|
@@ -2151,7 +2151,7 @@
|
|
|
2151
2151
|
const yearStart = Number(uiUnwrap(props.yearStart ?? (min ? fromIsoDate(min)?.getFullYear() : null) ?? inferredYearStart));
|
|
2152
2152
|
const yearEnd = Number(uiUnwrap(props.yearEnd ?? (max ? fromIsoDate(max)?.getFullYear() : null) ?? inferredYearEnd));
|
|
2153
2153
|
const monthSelect = _.select({
|
|
2154
|
-
class: "
|
|
2154
|
+
class: "jss-date-select",
|
|
2155
2155
|
value: String(viewMonth.getMonth()),
|
|
2156
2156
|
onChange: (event) => {
|
|
2157
2157
|
viewMonth = new Date(viewMonth.getFullYear(), Number(event.currentTarget.value), 1);
|
|
@@ -2162,7 +2162,7 @@
|
|
|
2162
2162
|
...Array.from({ length: 12 }, (_, index) => uiOptionNode({ value: String(index) }, new Intl.DateTimeFormat(locale, { month: "long" }).format(new Date(2024, index, 1))))
|
|
2163
2163
|
);
|
|
2164
2164
|
const yearSelect = _.select({
|
|
2165
|
-
class: "
|
|
2165
|
+
class: "jss-date-select jss-date-select-year",
|
|
2166
2166
|
value: String(viewMonth.getFullYear()),
|
|
2167
2167
|
onChange: (event) => {
|
|
2168
2168
|
viewMonth = new Date(Number(event.currentTarget.value), viewMonth.getMonth(), 1);
|
|
@@ -2176,20 +2176,20 @@
|
|
|
2176
2176
|
})
|
|
2177
2177
|
);
|
|
2178
2178
|
|
|
2179
|
-
const header = _.div({ class: "
|
|
2179
|
+
const header = _.div({ class: "jss-date-header" },
|
|
2180
2180
|
_.button({
|
|
2181
2181
|
type: "button",
|
|
2182
|
-
class: "
|
|
2182
|
+
class: "jss-date-nav",
|
|
2183
2183
|
onClick: () => {
|
|
2184
2184
|
viewMonth = shiftMonths(viewMonth, -1);
|
|
2185
2185
|
props.onNavigate?.({ month: viewMonth.getMonth() + 1, year: viewMonth.getFullYear() });
|
|
2186
2186
|
renderPanel();
|
|
2187
2187
|
}
|
|
2188
2188
|
}, UI.Icon({ name: "chevron_left", size: 16 })),
|
|
2189
|
-
_.div({ class: "
|
|
2189
|
+
_.div({ class: "jss-date-header-center" }, monthSelect, yearSelect),
|
|
2190
2190
|
_.button({
|
|
2191
2191
|
type: "button",
|
|
2192
|
-
class: "
|
|
2192
|
+
class: "jss-date-nav",
|
|
2193
2193
|
onClick: () => {
|
|
2194
2194
|
viewMonth = shiftMonths(viewMonth, 1);
|
|
2195
2195
|
props.onNavigate?.({ month: viewMonth.getMonth() + 1, year: viewMonth.getFullYear() });
|
|
@@ -2198,7 +2198,7 @@
|
|
|
2198
2198
|
}, UI.Icon({ name: "chevron_right", size: 16 }))
|
|
2199
2199
|
);
|
|
2200
2200
|
|
|
2201
|
-
const shortcuts = _.div({ class: "
|
|
2201
|
+
const shortcuts = _.div({ class: "jss-date-shortcuts" });
|
|
2202
2202
|
const shortcutList = uiUnwrap(props.shortcuts ?? props.presets) || [];
|
|
2203
2203
|
shortcutList.forEach((item, index) => {
|
|
2204
2204
|
if (!item) return;
|
|
@@ -2206,17 +2206,17 @@
|
|
|
2206
2206
|
const label = item.label ?? item.text ?? `Preset ${index + 1}`;
|
|
2207
2207
|
shortcuts.appendChild(_.button({
|
|
2208
2208
|
type: "button",
|
|
2209
|
-
class: "
|
|
2209
|
+
class: "jss-date-shortcut",
|
|
2210
2210
|
onClick: () => setWorkingOrCommit(rawValue, null, { preserveTime: isTimeEnabled(), timeValue: getCurrentTimeValue() })
|
|
2211
2211
|
}, label));
|
|
2212
2212
|
});
|
|
2213
2213
|
|
|
2214
|
-
const months = _.div({ class: "
|
|
2214
|
+
const months = _.div({ class: "jss-date-months" });
|
|
2215
2215
|
for (let index = 0; index < getMonthsToShow(); index += 1) {
|
|
2216
2216
|
months.appendChild(renderMonth(shiftMonths(viewMonth, index), index));
|
|
2217
2217
|
}
|
|
2218
2218
|
const footerDisplayValue = formatDisplayValue(pickerValue, getCurrentTimeValue());
|
|
2219
|
-
const footerValue = _.div({ class: "
|
|
2219
|
+
const footerValue = _.div({ class: "jss-date-value" },
|
|
2220
2220
|
...renderSlotToArray(
|
|
2221
2221
|
slots,
|
|
2222
2222
|
"value",
|
|
@@ -2224,10 +2224,10 @@
|
|
|
2224
2224
|
footerDisplayValue || renderSlotToArray(slots, "default", {}, children)
|
|
2225
2225
|
)
|
|
2226
2226
|
);
|
|
2227
|
-
const headerTime = _.div({ class: "
|
|
2228
|
-
const columnsTime = _.div({ class: "
|
|
2229
|
-
_.div({ class: "
|
|
2230
|
-
_.div({ class: "
|
|
2227
|
+
const headerTime = _.div({ class: "jss-time-header" });
|
|
2228
|
+
const columnsTime = _.div({ class: "jss-time-columns-2" },
|
|
2229
|
+
_.div({ class: "jss-time-column-title" }, uiUnwrap(props.hoursLabel) || "Ore"),
|
|
2230
|
+
_.div({ class: "jss-time-column-title" }, uiUnwrap(props.minutesLabel) || "Min")
|
|
2231
2231
|
);
|
|
2232
2232
|
headerTime.appendChild(columnsTime);
|
|
2233
2233
|
const bodyTime = isTimeEnabled()
|
|
@@ -2258,30 +2258,30 @@
|
|
|
2258
2258
|
}
|
|
2259
2259
|
})
|
|
2260
2260
|
: null;
|
|
2261
|
-
const footerInfo = _.div({ class: "
|
|
2261
|
+
const footerInfo = _.div({ class: "jss-date-footer-info" },
|
|
2262
2262
|
footerValue
|
|
2263
2263
|
);
|
|
2264
2264
|
|
|
2265
|
-
const footer = _.div({ class: uiClass(["
|
|
2265
|
+
const footer = _.div({ class: uiClass(["jss-date-footer", uiWhen(isTimeEnabled(), "has-time")]) },
|
|
2266
2266
|
footerInfo,
|
|
2267
|
-
_.div({ class: "
|
|
2268
|
-
_.button({ type: "button", class: "
|
|
2267
|
+
_.div({ class: "jss-date-actions" },
|
|
2268
|
+
_.button({ type: "button", class: "jss-date-action", onClick: jumpToToday }, uiUnwrap(props.todayLabel) || "Oggi"),
|
|
2269
2269
|
uiUnwrap(props.clearable) !== false
|
|
2270
|
-
? _.button({ type: "button", class: "
|
|
2270
|
+
? _.button({ type: "button", class: "jss-date-action", onClick: clearValue }, uiUnwrap(props.clearLabel) || "Reset")
|
|
2271
2271
|
: null,
|
|
2272
2272
|
uiUnwrap(props.confirm)
|
|
2273
|
-
? _.button({ type: "button", class: "
|
|
2273
|
+
? _.button({ type: "button", class: "jss-date-action is-primary", onClick: applyWorkingValue }, uiUnwrap(props.applyLabel) || "Applica")
|
|
2274
2274
|
: null
|
|
2275
2275
|
)
|
|
2276
2276
|
);
|
|
2277
2277
|
|
|
2278
|
-
const footerTimer = _.div(_.button({ type: "button", class: "
|
|
2278
|
+
const footerTimer = _.div(_.button({ type: "button", class: "jss-date-action jss-w-lg", onClick: jumpToNow }, uiUnwrap(props.nowLabel) || "Ora"));
|
|
2279
2279
|
|
|
2280
|
-
const contentTimer = isTimeEnabled() ? _.div({ class: "
|
|
2280
|
+
const contentTimer = isTimeEnabled() ? _.div({ class: "jss-date-time" }, headerTime, bodyTime, footerTimer) : null;
|
|
2281
2281
|
|
|
2282
2282
|
panelRoot.replaceChildren(
|
|
2283
2283
|
_.div({
|
|
2284
|
-
class: "
|
|
2284
|
+
class: "jss-date-panel-root",
|
|
2285
2285
|
onKeydown: (event) => {
|
|
2286
2286
|
if (event.key === "Escape") {
|
|
2287
2287
|
event.preventDefault();
|
|
@@ -2292,7 +2292,7 @@
|
|
|
2292
2292
|
},
|
|
2293
2293
|
header,
|
|
2294
2294
|
shortcutList.length ? shortcuts : null,
|
|
2295
|
-
_.div({ class: '
|
|
2295
|
+
_.div({ class: 'jss-data-time' }, months, contentTimer),
|
|
2296
2296
|
footer
|
|
2297
2297
|
)
|
|
2298
2298
|
);
|
|
@@ -2308,7 +2308,7 @@
|
|
|
2308
2308
|
entry = JSswift.overlay.open(({ close }) => {
|
|
2309
2309
|
const fallback = (mode === "range" || mode === "range-multiple") ? 2 : 1;
|
|
2310
2310
|
const raw = Number(uiUnwrap(props.monthsToShow) ?? fallback);
|
|
2311
|
-
panelRoot = _.div({ class: uiClassStatic(["
|
|
2311
|
+
panelRoot = _.div({ class: uiClassStatic(["jss-date-panel", uiUnwrap(sizeValue), uiWhen(raw > 1, "multi-month"), props.panelClass]) });
|
|
2312
2312
|
renderPanel();
|
|
2313
2313
|
return panelRoot;
|
|
2314
2314
|
}, {
|
|
@@ -2324,7 +2324,7 @@
|
|
|
2324
2324
|
closeOnBackdrop: false,
|
|
2325
2325
|
closeOnEsc: true,
|
|
2326
2326
|
autoFocus: false,
|
|
2327
|
-
className: uiClassStatic(["
|
|
2327
|
+
className: uiClassStatic(["jss-date-overlay", props.panelClass, uiWhen(isTimeEnabled(), "has-time")]),
|
|
2328
2328
|
onClose: () => {
|
|
2329
2329
|
entry = null;
|
|
2330
2330
|
panelRoot = null;
|
|
@@ -2352,8 +2352,8 @@
|
|
|
2352
2352
|
const raw = Number(uiUnwrap(props.monthsToShow) ?? fallback);
|
|
2353
2353
|
panelRoot = _.div({
|
|
2354
2354
|
class: uiClassStatic([
|
|
2355
|
-
"
|
|
2356
|
-
"
|
|
2355
|
+
"jss-date-panel",
|
|
2356
|
+
"jss-date-calendar",
|
|
2357
2357
|
uiUnwrap(sizeValue),
|
|
2358
2358
|
uiWhen(raw > 1, "multi-month"),
|
|
2359
2359
|
props.panelClass,
|
|
@@ -2476,7 +2476,7 @@
|
|
|
2476
2476
|
const slots = props.slots || {};
|
|
2477
2477
|
const sizeValue = uiComputed(props.size, () => {
|
|
2478
2478
|
const value = String(uiUnwrap(props.size) || "").toLowerCase();
|
|
2479
|
-
return ["xs", "sm", "md", "lg", "xl"].includes(value) ? `
|
|
2479
|
+
return ["xs", "sm", "md", "lg", "xl"].includes(value) ? `jss-size-${value}` : "";
|
|
2480
2480
|
});
|
|
2481
2481
|
const getTimeOptions = () => {
|
|
2482
2482
|
const detectedTime = uiExportTimeValue(
|
|
@@ -2518,7 +2518,7 @@
|
|
|
2518
2518
|
const hasFloatingLabel = fieldProps.label != null || JSswift.ui.getSlot(slots, "label") != null;
|
|
2519
2519
|
|
|
2520
2520
|
const displayInput = _.input({
|
|
2521
|
-
class: uiClass(["
|
|
2521
|
+
class: uiClass(["jss-input", "jss-time-display", sizeValue, uiWhen(props.manualInput, "is-manual"), props.inputClass]),
|
|
2522
2522
|
type: "text",
|
|
2523
2523
|
autocomplete: "off",
|
|
2524
2524
|
placeholder: hasFloatingLabel ? "" : (props.placeholder ?? "Seleziona orario"),
|
|
@@ -2528,7 +2528,7 @@
|
|
|
2528
2528
|
});
|
|
2529
2529
|
displayInput.setAttribute("aria-haspopup", "dialog");
|
|
2530
2530
|
const hiddenHost = _.div({ style: { display: "contents" } });
|
|
2531
|
-
const controlNode = _.div({ class: "
|
|
2531
|
+
const controlNode = _.div({ class: "jss-time-control", style: { display: "contents" } }, displayInput, hiddenHost);
|
|
2532
2532
|
|
|
2533
2533
|
const field = UI.FormField({
|
|
2534
2534
|
...fieldProps,
|
|
@@ -2604,14 +2604,14 @@
|
|
|
2604
2604
|
if (!panelRoot) return;
|
|
2605
2605
|
const currentValue = getCurrentValue();
|
|
2606
2606
|
const footerDisplayValue = formatDisplayValue(currentValue);
|
|
2607
|
-
const header = _.div({ class: "
|
|
2608
|
-
const columns = _.div({ class: "
|
|
2609
|
-
_.div({ class: "
|
|
2610
|
-
_.div({ class: "
|
|
2607
|
+
const header = _.div({ class: "jss-time-header" });
|
|
2608
|
+
const columns = _.div({ class: "jss-time-columns" },
|
|
2609
|
+
_.div({ class: "jss-time-column-title" }, uiUnwrap(props.hoursLabel) || "Ore"),
|
|
2610
|
+
_.div({ class: "jss-time-column-title" }, uiUnwrap(props.minutesLabel) || "Min")
|
|
2611
2611
|
);
|
|
2612
2612
|
const withSeconds = getTimeOptions().withSeconds;
|
|
2613
2613
|
if (withSeconds) {
|
|
2614
|
-
columns.appendChild(_.div({ class: "
|
|
2614
|
+
columns.appendChild(_.div({ class: "jss-time-column-title" }, uiUnwrap(props.secondsLabel) || "Sec"));
|
|
2615
2615
|
}
|
|
2616
2616
|
header.appendChild(columns);
|
|
2617
2617
|
const body = uiCreateTimePickerSection({
|
|
@@ -2639,8 +2639,8 @@
|
|
|
2639
2639
|
if (shouldCloseOnSelect(meta)) closePanel();
|
|
2640
2640
|
}
|
|
2641
2641
|
});
|
|
2642
|
-
const footer = _.div({ class: "
|
|
2643
|
-
_.div({ class: "
|
|
2642
|
+
const footer = _.div({ class: "jss-time-footer" },
|
|
2643
|
+
_.div({ class: "jss-time-value" },
|
|
2644
2644
|
...renderSlotToArray(
|
|
2645
2645
|
slots,
|
|
2646
2646
|
"value",
|
|
@@ -2648,18 +2648,18 @@
|
|
|
2648
2648
|
footerDisplayValue || renderSlotToArray(slots, "default", {}, children)
|
|
2649
2649
|
)
|
|
2650
2650
|
),
|
|
2651
|
-
_.div({ class: "
|
|
2652
|
-
_.button({ type: "button", class: "
|
|
2651
|
+
_.div({ class: "jss-time-actions" },
|
|
2652
|
+
_.button({ type: "button", class: "jss-time-action", onClick: jumpToNow }, uiUnwrap(props.nowLabel) || "Ora"),
|
|
2653
2653
|
uiUnwrap(props.clearable) !== false
|
|
2654
|
-
? _.button({ type: "button", class: "
|
|
2654
|
+
? _.button({ type: "button", class: "jss-time-action", onClick: () => setTimeState(null, null, { commit: !uiUnwrap(props.confirm) }) }, uiUnwrap(props.clearLabel) || "Reset")
|
|
2655
2655
|
: null,
|
|
2656
2656
|
uiUnwrap(props.confirm)
|
|
2657
|
-
? _.button({ type: "button", class: "
|
|
2657
|
+
? _.button({ type: "button", class: "jss-time-action is-primary", onClick: applyWorkingValue }, uiUnwrap(props.applyLabel) || "Applica")
|
|
2658
2658
|
: null
|
|
2659
2659
|
)
|
|
2660
2660
|
);
|
|
2661
2661
|
panelRoot.replaceChildren(_.div({
|
|
2662
|
-
class: "
|
|
2662
|
+
class: "jss-time-panel-root",
|
|
2663
2663
|
onKeydown: (event) => {
|
|
2664
2664
|
if (event.key === "Escape") {
|
|
2665
2665
|
event.preventDefault();
|
|
@@ -2673,7 +2673,7 @@
|
|
|
2673
2673
|
if (entry || uiUnwrap(props.disabled) || uiUnwrap(props.readonly)) return entry;
|
|
2674
2674
|
workingValue = uiCloneTimeParts(localValue);
|
|
2675
2675
|
entry = JSswift.overlay.open(() => {
|
|
2676
|
-
panelRoot = _.div({ class: uiClassStatic(["
|
|
2676
|
+
panelRoot = _.div({ class: uiClassStatic(["jss-time-panel", uiUnwrap(sizeValue), props.panelClass]) });
|
|
2677
2677
|
renderPanel();
|
|
2678
2678
|
return panelRoot;
|
|
2679
2679
|
}, {
|
|
@@ -2689,7 +2689,7 @@
|
|
|
2689
2689
|
closeOnBackdrop: false,
|
|
2690
2690
|
closeOnEsc: true,
|
|
2691
2691
|
autoFocus: false,
|
|
2692
|
-
className: uiClassStatic(["
|
|
2692
|
+
className: uiClassStatic(["jss-time-overlay", props.panelClass]),
|
|
2693
2693
|
onClose: () => {
|
|
2694
2694
|
entry = null;
|
|
2695
2695
|
panelRoot = null;
|