@pagopa/io-app-design-system 7.1.1 → 7.2.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/lib/commonjs/components/index.js +0 -11
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +15 -8
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputValidation.js +6 -2
- package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/module/components/index.js +0 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +15 -8
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/textInput/TextInputValidation.js +7 -3
- package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/typescript/components/index.d.ts +0 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts +8 -2
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts +1 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +2 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/index.tsx +0 -1
- package/src/components/textInput/TextInputBase.tsx +22 -9
- package/src/components/textInput/TextInputValidation.tsx +11 -5
- package/src/utils/types.ts +5 -1
- package/lib/commonjs/components/claimsSelector/ClaimsSelector.js +0 -167
- package/lib/commonjs/components/claimsSelector/ClaimsSelector.js.map +0 -1
- package/lib/commonjs/components/claimsSelector/__test__/ClaimsSelector.test.js +0 -64
- package/lib/commonjs/components/claimsSelector/__test__/ClaimsSelector.test.js.map +0 -1
- package/lib/commonjs/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +0 -1918
- package/lib/commonjs/components/claimsSelector/index.js +0 -17
- package/lib/commonjs/components/claimsSelector/index.js.map +0 -1
- package/lib/module/components/claimsSelector/ClaimsSelector.js +0 -160
- package/lib/module/components/claimsSelector/ClaimsSelector.js.map +0 -1
- package/lib/module/components/claimsSelector/__test__/ClaimsSelector.test.js +0 -64
- package/lib/module/components/claimsSelector/__test__/ClaimsSelector.test.js.map +0 -1
- package/lib/module/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +0 -1918
- package/lib/module/components/claimsSelector/index.js +0 -4
- package/lib/module/components/claimsSelector/index.js.map +0 -1
- package/lib/typescript/components/claimsSelector/ClaimsSelector.d.ts +0 -48
- package/lib/typescript/components/claimsSelector/ClaimsSelector.d.ts.map +0 -1
- package/lib/typescript/components/claimsSelector/__test__/ClaimsSelector.test.d.ts +0 -2
- package/lib/typescript/components/claimsSelector/__test__/ClaimsSelector.test.d.ts.map +0 -1
- package/lib/typescript/components/claimsSelector/index.d.ts +0 -2
- package/lib/typescript/components/claimsSelector/index.d.ts.map +0 -1
- package/src/components/claimsSelector/ClaimsSelector.tsx +0 -231
- package/src/components/claimsSelector/__test__/ClaimsSelector.test.tsx +0 -72
- package/src/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +0 -1918
- package/src/components/claimsSelector/index.tsx +0 -1
|
@@ -63,7 +63,13 @@ type InputTextProps = WithTestID<{
|
|
|
63
63
|
isPassword?: boolean;
|
|
64
64
|
onBlur?: () => void;
|
|
65
65
|
onFocus?: () => void;
|
|
66
|
-
autoFocus?: boolean;
|
|
66
|
+
// autoFocus?: boolean; --- Ignore since this bug is open https://github.com/react-navigation/react-navigation/issues/11643 ---
|
|
67
|
+
/**
|
|
68
|
+
* Optional external ref to the underlying React Native `TextInput`. When
|
|
69
|
+
* provided, the consumer can imperatively call `focus()` / `blur()` on the
|
|
70
|
+
* input. Useful to work around autoFocus issues on React Navigation v7.
|
|
71
|
+
*/
|
|
72
|
+
inputRef?: React.RefObject<TextInput | null>;
|
|
67
73
|
}>;
|
|
68
74
|
|
|
69
75
|
const inputMarginTop: IOSpacingScale = 16;
|
|
@@ -232,10 +238,13 @@ export const TextInputBase = ({
|
|
|
232
238
|
onBlur,
|
|
233
239
|
onFocus,
|
|
234
240
|
isPassword,
|
|
235
|
-
autoFocus,
|
|
241
|
+
// autoFocus,
|
|
242
|
+
inputRef: externalInputRef,
|
|
236
243
|
testID
|
|
237
244
|
}: InputTextProps) => {
|
|
238
|
-
const
|
|
245
|
+
const internalInputRef = useRef<TextInput>(null);
|
|
246
|
+
const inputRef = externalInputRef ?? internalInputRef;
|
|
247
|
+
const isSecretInput = useMemo(() => isPassword, [isPassword]);
|
|
239
248
|
const [inputStatus, setInputStatus] = useState<InputStatus>(
|
|
240
249
|
disabled ? "disabled" : "initial"
|
|
241
250
|
);
|
|
@@ -337,7 +346,8 @@ export const TextInputBase = ({
|
|
|
337
346
|
}
|
|
338
347
|
focusedState.value = 1;
|
|
339
348
|
setInputStatus("focused");
|
|
340
|
-
|
|
349
|
+
// This now works again!
|
|
350
|
+
inputRef.current?.focus();
|
|
341
351
|
};
|
|
342
352
|
|
|
343
353
|
const onChangeTextHandler = useCallback(
|
|
@@ -379,9 +389,12 @@ export const TextInputBase = ({
|
|
|
379
389
|
}, [focusedState, onBlur]);
|
|
380
390
|
|
|
381
391
|
const onFocusHandler = () => {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
392
|
+
// Only update if not already focused to prevent redundant layout passes
|
|
393
|
+
if (focusedState.value !== 1) {
|
|
394
|
+
focusedState.value = 1;
|
|
395
|
+
onFocus?.();
|
|
396
|
+
setInputStatus("focused");
|
|
397
|
+
}
|
|
385
398
|
};
|
|
386
399
|
|
|
387
400
|
const derivedInputProps = useMemo(
|
|
@@ -458,7 +471,7 @@ export const TextInputBase = ({
|
|
|
458
471
|
importantForAccessibility="yes"
|
|
459
472
|
accessibilityElementsHidden={false}
|
|
460
473
|
editable={!disabled}
|
|
461
|
-
secureTextEntry={
|
|
474
|
+
secureTextEntry={isSecretInput}
|
|
462
475
|
disableFullscreenUI={true}
|
|
463
476
|
accessibilityState={{ disabled }}
|
|
464
477
|
accessibilityLabel={accessibilityLabel ?? placeholder}
|
|
@@ -486,7 +499,7 @@ export const TextInputBase = ({
|
|
|
486
499
|
? { color: inputTextColor }
|
|
487
500
|
: { color: inputDisabledTextColor }
|
|
488
501
|
]}
|
|
489
|
-
autoFocus={
|
|
502
|
+
autoFocus={false}
|
|
490
503
|
value={inputValue}
|
|
491
504
|
/>
|
|
492
505
|
{/* We translate the label to the right if icon is present
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
useCallback,
|
|
5
5
|
useImperativeHandle,
|
|
6
6
|
useMemo,
|
|
7
|
+
useRef,
|
|
7
8
|
useState
|
|
8
9
|
} from "react";
|
|
9
|
-
import { AccessibilityInfo, View } from "react-native";
|
|
10
|
+
import { AccessibilityInfo, TextInput, View } from "react-native";
|
|
10
11
|
import Animated from "react-native-reanimated";
|
|
11
|
-
import { TextInputValidationRefProps } from "../../utils/types";
|
|
12
12
|
import { useIOTheme } from "../../context";
|
|
13
13
|
import { IOColors } from "../../core/IOColors";
|
|
14
14
|
import {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
exitTransitionInputIcon
|
|
17
17
|
} from "../../core/IOTransitions";
|
|
18
18
|
import { triggerHaptic } from "../../functions";
|
|
19
|
+
import { TextInputValidationRefProps } from "../../utils/types";
|
|
19
20
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
20
21
|
import { TextInputBase } from "./TextInputBase";
|
|
21
22
|
|
|
@@ -23,7 +24,7 @@ export type ValidationWithOptions = { isValid: boolean; errorMessage: string };
|
|
|
23
24
|
|
|
24
25
|
type TextInputValidationProps = Omit<
|
|
25
26
|
ComponentProps<typeof TextInputBase>,
|
|
26
|
-
"rightElement" | "status" | "bottomMessageColor" | "isPassword"
|
|
27
|
+
"rightElement" | "status" | "bottomMessageColor" | "isPassword" | "ref"
|
|
27
28
|
> & {
|
|
28
29
|
ref?: Ref<TextInputValidationRefProps>;
|
|
29
30
|
/**
|
|
@@ -100,6 +101,8 @@ export const TextInputValidation = ({
|
|
|
100
101
|
[accessibilityErrorLabel]
|
|
101
102
|
);
|
|
102
103
|
|
|
104
|
+
const inputRef = useRef<TextInput>(null);
|
|
105
|
+
|
|
103
106
|
const validateInput = useCallback(() => {
|
|
104
107
|
const validation = onValidate(value);
|
|
105
108
|
|
|
@@ -110,9 +113,11 @@ export const TextInputValidation = ({
|
|
|
110
113
|
}
|
|
111
114
|
}, [value, errorMessage, onValidate, getErrorFeedback]);
|
|
112
115
|
|
|
113
|
-
// Expose the validateInput function to the parent component
|
|
116
|
+
// Expose the validateInput function and focus/blur controls to the parent component
|
|
114
117
|
useImperativeHandle(ref, () => ({
|
|
115
|
-
validateInput
|
|
118
|
+
validateInput,
|
|
119
|
+
focus: () => inputRef.current?.focus(),
|
|
120
|
+
blur: () => inputRef.current?.blur()
|
|
116
121
|
}));
|
|
117
122
|
|
|
118
123
|
const onBlurHandler = useCallback(() => {
|
|
@@ -176,6 +181,7 @@ export const TextInputValidation = ({
|
|
|
176
181
|
return (
|
|
177
182
|
<TextInputBase
|
|
178
183
|
{...props}
|
|
184
|
+
inputRef={inputRef}
|
|
179
185
|
value={value}
|
|
180
186
|
status={isValid === false ? "error" : undefined}
|
|
181
187
|
bottomMessage={labelError}
|
package/src/utils/types.ts
CHANGED
|
@@ -45,4 +45,8 @@ export type Nullable<T> = T | null;
|
|
|
45
45
|
*/
|
|
46
46
|
export type Optional<T> = T | undefined;
|
|
47
47
|
|
|
48
|
-
export type TextInputValidationRefProps = {
|
|
48
|
+
export type TextInputValidationRefProps = {
|
|
49
|
+
validateInput: () => void;
|
|
50
|
+
focus: () => void;
|
|
51
|
+
blur: () => void;
|
|
52
|
+
};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ClaimsSelector = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
|
-
var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
|
|
11
|
-
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
12
|
-
var _context = require("../../context");
|
|
13
|
-
var _core = require("../../core");
|
|
14
|
-
var _useAccordionAnimation = require("../../hooks/useAccordionAnimation");
|
|
15
|
-
var _icons = require("../icons");
|
|
16
|
-
var _layout = require("../layout");
|
|
17
|
-
var _listitems = require("../listitems");
|
|
18
|
-
var _typography = require("../typography");
|
|
19
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
-
const accordionBodySpacing = 16;
|
|
23
|
-
|
|
24
|
-
// Threshold to determine when the accordion is considered fully collapsed
|
|
25
|
-
const COLLAPSED_RADIUS_THRESHOLD = 0.001;
|
|
26
|
-
|
|
27
|
-
// Border width offset to ensure gradient fits within the border curves
|
|
28
|
-
const COLLAPSIBLE_BORDER = 1;
|
|
29
|
-
const ClaimsSelector = ({
|
|
30
|
-
title,
|
|
31
|
-
items,
|
|
32
|
-
defaultExpanded,
|
|
33
|
-
onItemSelected,
|
|
34
|
-
onToggle,
|
|
35
|
-
accessibilityLabel,
|
|
36
|
-
selectedItemIds,
|
|
37
|
-
selectionEnabled = true,
|
|
38
|
-
headerGradientColors
|
|
39
|
-
}) => {
|
|
40
|
-
const theme = (0, _context.useIOTheme)();
|
|
41
|
-
const {
|
|
42
|
-
expanded,
|
|
43
|
-
toggleAccordion,
|
|
44
|
-
onBodyLayout,
|
|
45
|
-
iconAnimatedStyle,
|
|
46
|
-
bodyAnimatedStyle,
|
|
47
|
-
bodyInnerStyle,
|
|
48
|
-
progress
|
|
49
|
-
} = (0, _useAccordionAnimation.useAccordionAnimation)({
|
|
50
|
-
defaultExpanded
|
|
51
|
-
});
|
|
52
|
-
const accordionBackground = theme["appBackground-primary"];
|
|
53
|
-
const accordionBorder = theme["cardBorder-default"];
|
|
54
|
-
const onItemPress = () => {
|
|
55
|
-
toggleAccordion();
|
|
56
|
-
onToggle?.(!expanded);
|
|
57
|
-
};
|
|
58
|
-
const hasHeaderGradient = headerGradientColors && headerGradientColors.length >= 2;
|
|
59
|
-
const headerForegroundColor = hasHeaderGradient ? "black" : theme["textBody-default"];
|
|
60
|
-
const headerRadiusAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
61
|
-
/**
|
|
62
|
-
* Dynamically adjust bottom corner radius based on the expansion progress.
|
|
63
|
-
* Bottom corners are rounded only when the accordion is fully collapsed to
|
|
64
|
-
* ensure visual consistency with the outer container.
|
|
65
|
-
*/
|
|
66
|
-
const bottomRadius = progress.value < COLLAPSED_RADIUS_THRESHOLD ? _core.IOAccordionRadius : 0;
|
|
67
|
-
return {
|
|
68
|
-
borderTopLeftRadius: _core.IOAccordionRadius - COLLAPSIBLE_BORDER,
|
|
69
|
-
borderTopRightRadius: _core.IOAccordionRadius - COLLAPSIBLE_BORDER,
|
|
70
|
-
borderBottomLeftRadius: bottomRadius - COLLAPSIBLE_BORDER,
|
|
71
|
-
borderBottomRightRadius: bottomRadius - COLLAPSIBLE_BORDER,
|
|
72
|
-
overflow: "hidden"
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
const renderClaimItem = (item, index) => {
|
|
76
|
-
const {
|
|
77
|
-
id,
|
|
78
|
-
value,
|
|
79
|
-
description,
|
|
80
|
-
type = "text",
|
|
81
|
-
endElement
|
|
82
|
-
} = item;
|
|
83
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
84
|
-
children: [index !== 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.Divider, {}),
|
|
85
|
-
// We do not support checkbox selection for images, as it is not needed now
|
|
86
|
-
selectionEnabled && type === "text" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_listitems.ListItemCheckbox, {
|
|
87
|
-
value: value,
|
|
88
|
-
description: description,
|
|
89
|
-
selected: selectedItemIds?.includes(id),
|
|
90
|
-
onValueChange: onItemSelected ? selected => onItemSelected(item, selected) : undefined
|
|
91
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_listitems.ListItemInfo, {
|
|
92
|
-
value: type === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
93
|
-
source: {
|
|
94
|
-
uri: value
|
|
95
|
-
},
|
|
96
|
-
style: styles.imageClaim,
|
|
97
|
-
resizeMode: "contain",
|
|
98
|
-
accessibilityIgnoresInvertColors: true
|
|
99
|
-
}) : value,
|
|
100
|
-
label: description,
|
|
101
|
-
accessibilityRole: type,
|
|
102
|
-
reversed: true,
|
|
103
|
-
endElement: endElement
|
|
104
|
-
})]
|
|
105
|
-
}, id);
|
|
106
|
-
};
|
|
107
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
108
|
-
style: [styles.accordionWrapper, {
|
|
109
|
-
backgroundColor: _core.IOColors[accordionBackground],
|
|
110
|
-
borderColor: _core.IOColors[accordionBorder]
|
|
111
|
-
}],
|
|
112
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.TouchableWithoutFeedback, {
|
|
113
|
-
accessible: true,
|
|
114
|
-
accessibilityRole: "button",
|
|
115
|
-
accessibilityState: {
|
|
116
|
-
expanded
|
|
117
|
-
},
|
|
118
|
-
accessibilityLabel: accessibilityLabel ?? title,
|
|
119
|
-
onPress: onItemPress,
|
|
120
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
|
|
121
|
-
style: [styles.textContainer, headerRadiusAnimatedStyle],
|
|
122
|
-
children: [hasHeaderGradient && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeLinearGradient.default, {
|
|
123
|
-
colors: headerGradientColors,
|
|
124
|
-
style: _reactNative.StyleSheet.absoluteFill
|
|
125
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.H6, {
|
|
126
|
-
color: headerForegroundColor,
|
|
127
|
-
children: title
|
|
128
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
129
|
-
style: iconAnimatedStyle,
|
|
130
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
131
|
-
name: "chevronBottom",
|
|
132
|
-
color: headerForegroundColor
|
|
133
|
-
})
|
|
134
|
-
})]
|
|
135
|
-
})
|
|
136
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
137
|
-
style: bodyAnimatedStyle,
|
|
138
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
139
|
-
style: [bodyInnerStyle, styles.bodyInnerContainer],
|
|
140
|
-
onLayout: onBodyLayout,
|
|
141
|
-
children: items.map(renderClaimItem)
|
|
142
|
-
})
|
|
143
|
-
})]
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
exports.ClaimsSelector = ClaimsSelector;
|
|
147
|
-
const styles = _reactNative.StyleSheet.create({
|
|
148
|
-
accordionWrapper: {
|
|
149
|
-
borderWidth: 1,
|
|
150
|
-
borderRadius: _core.IOAccordionRadius,
|
|
151
|
-
borderCurve: "continuous"
|
|
152
|
-
},
|
|
153
|
-
textContainer: {
|
|
154
|
-
padding: accordionBodySpacing,
|
|
155
|
-
flexDirection: "row",
|
|
156
|
-
alignItems: "center",
|
|
157
|
-
justifyContent: "space-between"
|
|
158
|
-
},
|
|
159
|
-
bodyInnerContainer: {
|
|
160
|
-
width: "100%"
|
|
161
|
-
},
|
|
162
|
-
imageClaim: {
|
|
163
|
-
width: 160,
|
|
164
|
-
aspectRatio: 3 / 4
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
//# sourceMappingURL=ClaimsSelector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeGestureHandler","_reactNativeLinearGradient","_interopRequireDefault","_reactNativeReanimated","_interopRequireWildcard","_context","_core","_useAccordionAnimation","_icons","_layout","_listitems","_typography","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","accordionBodySpacing","COLLAPSED_RADIUS_THRESHOLD","COLLAPSIBLE_BORDER","ClaimsSelector","title","items","defaultExpanded","onItemSelected","onToggle","accessibilityLabel","selectedItemIds","selectionEnabled","headerGradientColors","theme","useIOTheme","expanded","toggleAccordion","onBodyLayout","iconAnimatedStyle","bodyAnimatedStyle","bodyInnerStyle","progress","useAccordionAnimation","accordionBackground","accordionBorder","onItemPress","hasHeaderGradient","length","headerForegroundColor","headerRadiusAnimatedStyle","useAnimatedStyle","bottomRadius","value","IOAccordionRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","overflow","renderClaimItem","item","index","id","description","type","endElement","jsxs","Fragment","children","jsx","Divider","ListItemCheckbox","selected","includes","onValueChange","undefined","ListItemInfo","Image","source","uri","style","styles","imageClaim","resizeMode","accessibilityIgnoresInvertColors","label","accessibilityRole","reversed","View","accordionWrapper","backgroundColor","IOColors","borderColor","TouchableWithoutFeedback","accessible","accessibilityState","onPress","textContainer","colors","StyleSheet","absoluteFill","H6","color","Icon","name","bodyInnerContainer","onLayout","map","exports","create","borderWidth","borderRadius","borderCurve","padding","flexDirection","alignItems","justifyContent","width","aspectRatio"],"sourceRoot":"../../../../src","sources":["components/claimsSelector/ClaimsSelector.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAAmC,IAAAc,WAAA,GAAAd,OAAA;AAAA,SAAAM,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,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AoB;IAC7B8F,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDX,kBAAkB,EAAE;IAClBY,KAAK,EAAE;EACT,CAAC;EACDnC,UAAU,EAAE;IACVmC,KAAK,EAAE,GAAG;IACVC,WAAW,EAAE,CAAC,GAAG;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _reactNative = require("@testing-library/react-native");
|
|
4
|
-
var _ClaimsSelector = require("../ClaimsSelector");
|
|
5
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
-
describe("ClaimsSelector", () => {
|
|
7
|
-
it("ClaimsSelector Snapshot (controlled)", () => {
|
|
8
|
-
const {
|
|
9
|
-
toJSON
|
|
10
|
-
} = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ClaimsSelector.ClaimsSelector, {
|
|
11
|
-
title: "Patente di guida",
|
|
12
|
-
selectedItemIds: ["name"],
|
|
13
|
-
items: [{
|
|
14
|
-
id: "name",
|
|
15
|
-
value: "Mario Rossi",
|
|
16
|
-
description: "Nome e cognome"
|
|
17
|
-
}]
|
|
18
|
-
}));
|
|
19
|
-
expect(toJSON()).toMatchSnapshot();
|
|
20
|
-
});
|
|
21
|
-
it("ClaimsSelector Snapshot (uncontrolled)", () => {
|
|
22
|
-
const {
|
|
23
|
-
toJSON
|
|
24
|
-
} = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ClaimsSelector.ClaimsSelector, {
|
|
25
|
-
title: "Patente di guida",
|
|
26
|
-
items: [{
|
|
27
|
-
id: "name",
|
|
28
|
-
value: "Mario Rossi",
|
|
29
|
-
description: "Nome e cognome"
|
|
30
|
-
}]
|
|
31
|
-
}));
|
|
32
|
-
expect(toJSON()).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
it("ClaimsSelector Snapshot (unselectable items)", () => {
|
|
35
|
-
const {
|
|
36
|
-
toJSON
|
|
37
|
-
} = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ClaimsSelector.ClaimsSelector, {
|
|
38
|
-
title: "Patente di guida",
|
|
39
|
-
selectionEnabled: false,
|
|
40
|
-
items: [{
|
|
41
|
-
id: "name",
|
|
42
|
-
value: "Mario Rossi",
|
|
43
|
-
description: "Nome e cognome"
|
|
44
|
-
}]
|
|
45
|
-
}));
|
|
46
|
-
expect(toJSON()).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
it("ClaimsSelector Snapshot (custom component)", () => {
|
|
49
|
-
const {
|
|
50
|
-
toJSON
|
|
51
|
-
} = (0, _reactNative.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ClaimsSelector.ClaimsSelector, {
|
|
52
|
-
title: "Patente di guida",
|
|
53
|
-
selectionEnabled: false,
|
|
54
|
-
items: [{
|
|
55
|
-
id: "name",
|
|
56
|
-
value: "data:image/png;base64,iVBORw0KGgoAAAANSUh",
|
|
57
|
-
description: "Nome e cognome",
|
|
58
|
-
type: "image"
|
|
59
|
-
}]
|
|
60
|
-
}));
|
|
61
|
-
expect(toJSON()).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
//# sourceMappingURL=ClaimsSelector.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_ClaimsSelector","_jsxRuntime","describe","it","toJSON","render","jsx","ClaimsSelector","title","selectedItemIds","items","id","value","description","expect","toMatchSnapshot","selectionEnabled","type"],"sourceRoot":"../../../../../src","sources":["components/claimsSelector/__test__/ClaimsSelector.test.tsx"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAAmD,IAAAE,WAAA,GAAAF,OAAA;AAEnDG,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BC,EAAE,C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