@pallasoft/ps-mobile-components 1.15.0 → 1.16.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PsSearchFieldProps } from './ps-search-field-props';
|
|
2
|
-
export declare const PsSearchField: ({ clearLabel, isLoading, onChange, placeholder, value, }: PsSearchFieldProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const PsSearchField: ({ clearLabel, isLoading, onChange, onScan, placeholder, scanLabel, value, }: PsSearchFieldProps) => import("react").JSX.Element;
|
|
@@ -12,7 +12,7 @@ import { PsRippleService } from '../../services/ps-ripple-service';
|
|
|
12
12
|
import { PsSearchFieldService } from '../../services/ps-search-field-service';
|
|
13
13
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
14
14
|
import { PsSkeleton } from '../ps-skeleton/ps-skeleton';
|
|
15
|
-
export const PsSearchField = ({ clearLabel, isLoading = false, onChange, placeholder, value, }) => {
|
|
15
|
+
export const PsSearchField = ({ clearLabel, isLoading = false, onChange, onScan, placeholder, scanLabel, value, }) => {
|
|
16
16
|
const theme = usePsMobileTheme();
|
|
17
17
|
const focus = usePsFocus();
|
|
18
18
|
if (PsSearchFieldService.isSkeleton(isLoading, value, focus.isFocused))
|
|
@@ -24,5 +24,5 @@ export const PsSearchField = ({ clearLabel, isLoading = false, onChange, placeho
|
|
|
24
24
|
isFocused: focus.isFocused,
|
|
25
25
|
}),
|
|
26
26
|
{ gap: PsMobileControlConfig.buttonIconSpacing },
|
|
27
|
-
], children: [_jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Search, size: PsMobileControlConfig.iconSizeInline }), _jsx(TextInput, { accessibilityLabel: placeholder, autoCorrect: false, onBlur: focus.onBlur, onChangeText: onChange, onFocus: focus.onFocus, placeholder: placeholder, placeholderTextColor: theme.muted, returnKeyType: 'search', selectionColor: theme.primary, style: PsControlStyleService.input(theme), value: value }), value === '' ? null : (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Borderless), accessibilityLabel: clearLabel, accessibilityRole: 'button', hitSlop: PsLayoutConfig.hitSlop, onPress: () => onChange(''), children: _jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Close, size: PsMobileControlConfig.iconSizeInline }) }))] }));
|
|
27
|
+
], children: [_jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Search, size: PsMobileControlConfig.iconSizeInline }), _jsx(TextInput, { accessibilityLabel: placeholder, autoCorrect: false, onBlur: focus.onBlur, onChangeText: onChange, onFocus: focus.onFocus, placeholder: placeholder, placeholderTextColor: theme.muted, returnKeyType: 'search', selectionColor: theme.primary, style: PsControlStyleService.input(theme), value: value }), value === '' ? null : (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Borderless), accessibilityLabel: clearLabel, accessibilityRole: 'button', hitSlop: PsLayoutConfig.hitSlop, onPress: () => onChange(''), children: _jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Close, size: PsMobileControlConfig.iconSizeInline }) })), onScan === undefined ? null : (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Borderless), accessibilityLabel: scanLabel, accessibilityRole: 'button', hitSlop: PsLayoutConfig.hitSlop, onPress: onScan, children: _jsx(PsIcon, { color: theme.primaryText, iconKey: PsIconKey.Scan, size: PsMobileControlConfig.iconSizeInline }) }))] }));
|
|
28
28
|
};
|
package/package.json
CHANGED