@jobber/components-native 0.61.0 → 0.61.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.
@@ -13,6 +13,10 @@ export interface InputTextProps extends Pick<InputFieldWrapperProps, "toolbar" |
13
13
  * Disable the input
14
14
  */
15
15
  readonly disabled?: boolean;
16
+ /**
17
+ * Makes the input read-only
18
+ */
19
+ readonly readonly?: boolean;
16
20
  /**
17
21
  * Name of the input.
18
22
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.61.0",
3
+ "version": "0.61.1",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -84,5 +84,5 @@
84
84
  "react-native-reanimated": "^2.0.0 || ^3.0.0",
85
85
  "react-native-safe-area-context": "^4.5.2"
86
86
  },
87
- "gitHead": "662e7a827dff223858db0606e4f61e5be812b2f8"
87
+ "gitHead": "795bb0dade3059e9d4fa3e3d1d5e12bfb1a0330d"
88
88
  }
@@ -75,6 +75,17 @@ describe("InputText", () => {
75
75
  );
76
76
  });
77
77
 
78
+ describe("readonly", () => {
79
+ it.each([[false], [true]])("sets the readOnly to %s", expected => {
80
+ const { getByTestId } = renderInputText({
81
+ testID: "InputText",
82
+ readonly: expected,
83
+ });
84
+
85
+ expect(getByTestId("InputText").props.readOnly).toBe(expected);
86
+ });
87
+ });
88
+
78
89
  it("renders a InputText with placeholder", () => {
79
90
  const props = { placeholder: "Foobar" };
80
91
  renderInputText(props);
@@ -44,6 +44,11 @@ export interface InputTextProps
44
44
  */
45
45
  readonly disabled?: boolean;
46
46
 
47
+ /**
48
+ * Makes the input read-only
49
+ */
50
+ readonly readonly?: boolean;
51
+
47
52
  /**
48
53
  * Name of the input.
49
54
  */
@@ -237,6 +242,7 @@ function InputTextInternal(
237
242
  {
238
243
  invalid,
239
244
  disabled,
245
+ readonly = false,
240
246
  name,
241
247
  placeholder,
242
248
  assistiveText,
@@ -386,6 +392,8 @@ function InputTextInternal(
386
392
  multiline && hasMiniLabel && styles.multiLineInputWithMini,
387
393
  styleOverride?.inputText,
388
394
  ]}
395
+ // @ts-expect-error - does exist on 0.71 and up https://github.com/facebook/react-native/pull/39281
396
+ readOnly={readonly}
389
397
  editable={!disabled}
390
398
  keyboardType={keyboard}
391
399
  value={inputTransform(internalValue)}