@colixsystems/widget-sdk 0.268.0 → 0.268.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/README.md +5 -1
- package/dist/datetimepicker-time-columns.js +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
86
86
|
|
|
87
87
|
## Status
|
|
88
88
|
|
|
89
|
-
`v0.268.
|
|
89
|
+
`v0.268.1` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
|
|
90
|
+
|
|
91
|
+
### What's new in 0.268.1 (contract 1.218.0)
|
|
92
|
+
|
|
93
|
+
**The web `DateTimePicker`'s hour and minute columns no longer look broken.** The browser drew its scrollbar inside each narrow column, which cut the chosen hour and minute off on one side. The columns now hide the scrollbar and fade their top and bottom edges to show they scroll. The keyboard focus ring is drawn in full, and a row reached with the arrow keys stops clear of the fade. No API change; native keeps the operating system's picker.
|
|
90
94
|
|
|
91
95
|
### What's new in 0.268.0 (contract 1.218.0)
|
|
92
96
|
|
|
@@ -14,6 +14,9 @@ const COLUMN_WIDTH = 64;
|
|
|
14
14
|
const HOURS = Array.from({ length: 24 }, (_, i) => i);
|
|
15
15
|
const MINUTES = Array.from({ length: 60 }, (_, i) => i);
|
|
16
16
|
const LIST_KEYS = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
17
|
+
// Fades the edges in place of a scrollbar, which would clip cells.
|
|
18
|
+
const FADE = 24;
|
|
19
|
+
const EDGE_FADE = `linear-gradient(to bottom, transparent, #000 ${FADE}px, #000 calc(100% - ${FADE}px), transparent)`;
|
|
17
20
|
|
|
18
21
|
/** @param {{View: any, Text: any, Pressable: any, ScrollView: any, Platform: any}} rn */
|
|
19
22
|
export function makeTimeColumns(rn) {
|
|
@@ -27,7 +30,7 @@ export function makeTimeColumns(rn) {
|
|
|
27
30
|
React.useEffect(() => {
|
|
28
31
|
if (!mounted.current) {
|
|
29
32
|
mounted.current = true;
|
|
30
|
-
const top = values.indexOf(chosen) * (ITEM_HEIGHT + ITEM_GAP) - (height - ITEM_HEIGHT) / 2;
|
|
33
|
+
const top = FADE + values.indexOf(chosen) * (ITEM_HEIGHT + ITEM_GAP) - (height - ITEM_HEIGHT) / 2;
|
|
31
34
|
if (scroller.current && typeof scroller.current.scrollTo === "function") {
|
|
32
35
|
scroller.current.scrollTo({ y: Math.max(0, top), animated: false });
|
|
33
36
|
}
|
|
@@ -76,7 +79,7 @@ export function makeTimeColumns(rn) {
|
|
|
76
79
|
"aria-selected": selected,
|
|
77
80
|
disabled: option.disabled,
|
|
78
81
|
testID: testID ? `${testID}-${field}-${twoDigits(option.value)}` : undefined,
|
|
79
|
-
style: cellStyle(t, { selected, current: false, disabled: option.disabled, width: COLUMN_WIDTH, height: ITEM_HEIGHT, round: true }),
|
|
82
|
+
style: cellStyle(t, { selected, current: false, disabled: option.disabled, width: COLUMN_WIDTH - 2 * ITEM_GAP, height: ITEM_HEIGHT, round: true }),
|
|
80
83
|
},
|
|
81
84
|
h(Text, { style: cellText(t, { selected }) }, twoDigits(option.value)),
|
|
82
85
|
);
|
|
@@ -87,7 +90,15 @@ export function makeTimeColumns(rn) {
|
|
|
87
90
|
h(Text, { "aria-hidden": true, style: { textAlign: "center", fontFamily: t.fontFamily, fontSize: t.helperSize, fontWeight: "500", color: t.helperColor } }, name),
|
|
88
91
|
h(
|
|
89
92
|
ScrollView,
|
|
90
|
-
{
|
|
93
|
+
{
|
|
94
|
+
ref: scroller,
|
|
95
|
+
role: "listbox",
|
|
96
|
+
accessibilityLabel: name,
|
|
97
|
+
showsVerticalScrollIndicator: false,
|
|
98
|
+
style: { height, maskImage: EDGE_FADE, WebkitMaskImage: EDGE_FADE, scrollPaddingBlock: FADE },
|
|
99
|
+
// The first and last rows can scroll clear of the fade.
|
|
100
|
+
contentContainerStyle: { gap: ITEM_GAP, paddingVertical: FADE, paddingHorizontal: ITEM_GAP },
|
|
101
|
+
},
|
|
91
102
|
...options.map(item),
|
|
92
103
|
),
|
|
93
104
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.268.
|
|
3
|
+
"version": "0.268.1",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
5
|
"homepage": "https://github.com/Colix-AB/AppStudio",
|
|
6
6
|
"type": "module",
|