@dloizides/ui-forms 1.39.0 → 1.40.0
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/CHANGELOG.md +3 -0
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
### Changed
|
|
6
|
+
- `FormSwitch`: the consumer `testID` now lands on the whole label + switch row (the pressable, at least 44 px tall) instead of RN-web's 40x20 switch wrapper, so a probe or e2e tap on `testID` hits the full target; the native switch is `${testID}-switch`, the old `${testID}-row` id is gone (D-FUNDS-18 in FINREG-FUNDS-1 "Tenant funds, deal gate, blocking roles").
|
|
7
|
+
|
|
5
8
|
### Added
|
|
6
9
|
- `LineItems`: repeating lines as one labelled card each ("Line N" + a header slot such as a Debit/Credit switch + Remove), cells through `renderCell({ item, index, columnKey, wide })`; at 1280 px and wider the column headers show once and each line is one aligned row, below that the cells stack in a `FormGrid`; Add line, `minItems` (default 1), `isLineItemsWide`, `canRemoveLine` exported (D-JL-5 "Journal line layout" in FINREG-JOURNAL-LINES-1 "Journal lines read as lines").
|
|
7
10
|
- `SearchSelect.renderTrigger({ open, selected, onPress, ref })`: draw your own trigger (a chip, a button) in place of the field box; the package keeps the pressable, its label, hint, expanded state, testID, the 44 px hit box and the focus return on close. A dropdown from a narrow trigger opens at least 240 px wide inside the viewport (`fitDropdownWidth`) (D-INPUTS-19 in FINREG-INPUTS-1 "Searchable dropdowns, shared country field, formatted IBAN/BIC inputs").
|
package/dist/index.js
CHANGED
|
@@ -1734,7 +1734,7 @@ var FormSwitch = ({
|
|
|
1734
1734
|
onPress: toggle,
|
|
1735
1735
|
style: [styles13.container, containerStyle],
|
|
1736
1736
|
tabIndex: -1,
|
|
1737
|
-
testID
|
|
1737
|
+
testID,
|
|
1738
1738
|
children: [
|
|
1739
1739
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles13.textColumn, children: [
|
|
1740
1740
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.label, themeStyles.label], children: label }),
|
|
@@ -1747,7 +1747,7 @@ var FormSwitch = ({
|
|
|
1747
1747
|
accessibilityLabel: label,
|
|
1748
1748
|
accessibilityState: { checked: value, disabled },
|
|
1749
1749
|
disabled,
|
|
1750
|
-
testID
|
|
1750
|
+
testID: `${testID}-switch`,
|
|
1751
1751
|
value,
|
|
1752
1752
|
onValueChange
|
|
1753
1753
|
}
|
|
@@ -4029,13 +4029,15 @@ var LINE_HEIGHT = 20;
|
|
|
4029
4029
|
var COUNTER_FONT = 12;
|
|
4030
4030
|
var BRANCH_OPACITY = 0.5;
|
|
4031
4031
|
var GAP2 = 8;
|
|
4032
|
+
var INPUT_PAD_V2 = 13;
|
|
4032
4033
|
var ghostStyles = reactNative.StyleSheet.create({
|
|
4033
4034
|
field: { flex: 1, justifyContent: "center", minHeight: LINE_HEIGHT },
|
|
4034
4035
|
mono: { fontFamily: "monospace", fontSize: FONT_SIZE, lineHeight: LINE_HEIGHT },
|
|
4035
|
-
layer: { position: "absolute", left: 0, top:
|
|
4036
|
+
layer: { position: "absolute", left: 0, top: INPUT_PAD_V2, bottom: INPUT_PAD_V2 },
|
|
4036
4037
|
hidden: { opacity: 0 },
|
|
4037
4038
|
branch: { opacity: BRANCH_OPACITY },
|
|
4038
|
-
input: { padding: 0, borderWidth: 0, minHeight: LINE_HEIGHT },
|
|
4039
|
+
input: { padding: 0, paddingVertical: INPUT_PAD_V2, borderWidth: 0, minHeight: LINE_HEIGHT },
|
|
4040
|
+
trigger: { paddingVertical: 0 },
|
|
4039
4041
|
counter: { fontSize: COUNTER_FONT, marginLeft: GAP2 }
|
|
4040
4042
|
});
|
|
4041
4043
|
|
|
@@ -4139,7 +4141,7 @@ function IbanInput({ value, onChange, onVerdict, accessibilityLabel, accessibili
|
|
|
4139
4141
|
onLeft?.();
|
|
4140
4142
|
}, [onLeave, onVerdict, value, onLeft]);
|
|
4141
4143
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
4142
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], children: [
|
|
4144
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [controlStyles.selectTrigger, ghostStyles.trigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], children: [
|
|
4143
4145
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: ghostStyles.field, children: [
|
|
4144
4146
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { "aria-hidden": true, style: [ghostStyles.mono, ghostStyles.layer], children: [
|
|
4145
4147
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: ghostStyles.hidden, children: draft.display }),
|
|
@@ -4223,7 +4225,7 @@ function BicInput({ value, onChange, onVerdict, accessibilityLabel, accessibilit
|
|
|
4223
4225
|
onLeft?.();
|
|
4224
4226
|
}, [onLeave, onVerdict, value, onLeft]);
|
|
4225
4227
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
4226
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: ghostStyles.field, children: [
|
|
4228
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [controlStyles.selectTrigger, ghostStyles.trigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: ghostStyles.field, children: [
|
|
4227
4229
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { "aria-hidden": true, style: [ghostStyles.mono, ghostStyles.layer], children: [
|
|
4228
4230
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: ghostStyles.hidden, children: draft.value }),
|
|
4229
4231
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: colors.textSecondary }, children: draft.ghost }),
|