@dloizides/ui-forms 1.58.0 → 1.59.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/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React41, { createContext, forwardRef, useRef, useImperativeHandle, useState, useCallback, useMemo, useEffect,
|
|
1
|
+
import React41, { createContext, forwardRef, useRef, useImperativeHandle, useState, useCallback, useMemo, useEffect, useContext, useLayoutEffect } from 'react';
|
|
2
2
|
import { Platform, StyleSheet, TextInput, View, Text, Pressable, useWindowDimensions, ScrollView, Animated, Easing, AccessibilityInfo, Image, TouchableOpacity, Switch, Modal } from 'react-native';
|
|
3
3
|
import { useUi } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -2259,6 +2259,10 @@ function useSelectLookMetrics() {
|
|
|
2259
2259
|
const { width } = useWindowDimensions();
|
|
2260
2260
|
return selectLookMetrics(config, width);
|
|
2261
2261
|
}
|
|
2262
|
+
function lookInputBox(m) {
|
|
2263
|
+
if (m === void 0) return void 0;
|
|
2264
|
+
return { minHeight: m.height, height: m.height, paddingHorizontal: m.paddingHorizontal, paddingVertical: m.paddingVertical, fontSize: m.fontSize, borderRadius: m.borderRadius };
|
|
2265
|
+
}
|
|
2262
2266
|
function chevronDataUri(color) {
|
|
2263
2267
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="${color}" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6l4 4 4-4"/></svg>`;
|
|
2264
2268
|
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
@@ -2857,6 +2861,7 @@ function TypeaheadControlImpl(props, ref) {
|
|
|
2857
2861
|
const options = "options" in props ? props.options : void 0;
|
|
2858
2862
|
const maxSuggestions = ("search" in props ? props.search.maxResults : props.maxSuggestions) ?? DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS;
|
|
2859
2863
|
const { theme } = useUi();
|
|
2864
|
+
const look = useSelectLookMetrics();
|
|
2860
2865
|
const { colors, palette } = theme;
|
|
2861
2866
|
const anchorRef = useRef(null);
|
|
2862
2867
|
const state = useTypeaheadState({ options, search, value, minChars, maxSuggestions, onChange, onSubmit });
|
|
@@ -2888,7 +2893,7 @@ function TypeaheadControlImpl(props, ref) {
|
|
|
2888
2893
|
onBlur: handleBlur,
|
|
2889
2894
|
onKeyPress: state.handleKeyPress,
|
|
2890
2895
|
onSubmitEditing: state.handleSubmit,
|
|
2891
|
-
style: [controlStyles.input, { borderColor: hasError ? fieldErrorInk(theme) : colors.border, backgroundColor: colors.surface, color: colors.text }],
|
|
2896
|
+
style: [controlStyles.input, { borderColor: hasError ? fieldErrorInk(theme) : colors.border, backgroundColor: colors.surface, color: colors.text }, lookInputBox(look)],
|
|
2892
2897
|
testID: search?.inputTestID ?? `${testID}-input`
|
|
2893
2898
|
}
|
|
2894
2899
|
),
|
|
@@ -2918,8 +2923,8 @@ var NATIVE_INPUT_BOX = {
|
|
|
2918
2923
|
fontFamily: "inherit",
|
|
2919
2924
|
width: "100%"
|
|
2920
2925
|
};
|
|
2921
|
-
function buildNativeInputStyle(themed) {
|
|
2922
|
-
const { paddingHorizontal, paddingVertical, ...box } = StyleSheet.flatten(controlStyles.input);
|
|
2926
|
+
function buildNativeInputStyle(themed, look) {
|
|
2927
|
+
const { paddingHorizontal, paddingVertical, ...box } = StyleSheet.flatten([controlStyles.input, look]);
|
|
2923
2928
|
return {
|
|
2924
2929
|
...box,
|
|
2925
2930
|
...themed,
|
|
@@ -2931,6 +2936,7 @@ function buildNativeInputStyle(themed) {
|
|
|
2931
2936
|
function WebDateInput({ fieldProps, context, webInputType }) {
|
|
2932
2937
|
const { label, value, onChange, onSubmit, accessibilityHint, testID, required, disabled = false, min, max } = fieldProps;
|
|
2933
2938
|
const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });
|
|
2939
|
+
const look = lookInputBox(useSelectLookMetrics());
|
|
2934
2940
|
const webA11y = webFieldA11y({
|
|
2935
2941
|
describedById: context.describedById,
|
|
2936
2942
|
hasError: context.hasError,
|
|
@@ -2954,7 +2960,7 @@ function WebDateInput({ fieldProps, context, webInputType }) {
|
|
|
2954
2960
|
id: context.controlId,
|
|
2955
2961
|
max,
|
|
2956
2962
|
min,
|
|
2957
|
-
style: buildNativeInputStyle(style),
|
|
2963
|
+
style: buildNativeInputStyle(style, look),
|
|
2958
2964
|
title: accessibilityHint,
|
|
2959
2965
|
type: webInputType,
|
|
2960
2966
|
value,
|
|
@@ -3724,6 +3730,7 @@ function DatePickerInput({ fieldProps, context, onTypedError }) {
|
|
|
3724
3730
|
const typed = useTypedDate({ value, onChange, bounds, format: displayFormatter(display), onError: onTypedError, editOnType: true });
|
|
3725
3731
|
const edit = typedEditBind(typed);
|
|
3726
3732
|
const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });
|
|
3733
|
+
const look = lookInputBox(useSelectLookMetrics());
|
|
3727
3734
|
const focus = focusBind;
|
|
3728
3735
|
const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError, required });
|
|
3729
3736
|
const close = useCallback(() => setOpen(false), []);
|
|
@@ -3756,7 +3763,7 @@ function DatePickerInput({ fieldProps, context, onTypedError }) {
|
|
|
3756
3763
|
"data-testid": testID,
|
|
3757
3764
|
disabled,
|
|
3758
3765
|
id: context.controlId,
|
|
3759
|
-
style: { ...buildNativeInputStyle(style), paddingInlineEnd: ICON_ROOM },
|
|
3766
|
+
style: { ...buildNativeInputStyle(style, look), paddingInlineEnd: ICON_ROOM },
|
|
3760
3767
|
title: accessibilityHint,
|
|
3761
3768
|
type: "text",
|
|
3762
3769
|
value: typed.display,
|
|
@@ -6561,6 +6568,6 @@ var PasswordField = React41.forwardRef(function PasswordField2({ label, value, o
|
|
|
6561
6568
|
] }) });
|
|
6562
6569
|
});
|
|
6563
6570
|
|
|
6564
|
-
export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, CheckboxLookProvider, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FileInput, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, MultiSelectField, PHONE_MAX_WIDTH, PasswordField, PasswordRules, PasswordRulesDisplay, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, RevealToggle, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, SelectControl, SelectField, SelectLookProvider, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, selectLookMetrics, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
|
6571
|
+
export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, CheckboxLookProvider, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FileInput, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, MultiSelectField, PHONE_MAX_WIDTH, PasswordField, PasswordRules, PasswordRulesDisplay, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, RevealToggle, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, SelectControl, SelectField, SelectLookProvider, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, lookInputBox, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, selectLookMetrics, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useSelectLookMetrics, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
|
6565
6572
|
//# sourceMappingURL=index.mjs.map
|
|
6566
6573
|
//# sourceMappingURL=index.mjs.map
|