@jobber/components-native 0.81.2-cleanup-fo-1e1db4e.33 → 0.81.2
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/package.json +2 -2
- package/dist/src/Checkbox/Checkbox.js +3 -3
- package/dist/src/Checkbox/Checkbox.style.js +2 -1
- package/dist/src/Form/Form.js +10 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Checkbox/Checkbox.style.d.ts +2 -1
- package/package.json +2 -2
- package/src/Checkbox/Checkbox.style.ts +2 -1
- package/src/Checkbox/Checkbox.tsx +9 -5
- package/src/Form/Form.test.tsx +0 -26
- package/src/Form/Form.tsx +10 -17
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.81.2
|
|
3
|
+
"version": "0.81.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"react-native-safe-area-context": "^4.5.2",
|
|
81
81
|
"react-native-svg": ">=12.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "cf3a355dd95152faff62049df5e68c70dba26d27"
|
|
84
84
|
}
|
|
@@ -42,15 +42,15 @@ function CheckboxInternal({ label, checked, defaultChecked, indeterminate = fals
|
|
|
42
42
|
} },
|
|
43
43
|
React.createElement(View, { style: styles.checkBoxContainer },
|
|
44
44
|
label && (React.createElement(View, { style: styles.label },
|
|
45
|
-
React.createElement(Text, { variation: textVariation, align: "start" }, label)
|
|
45
|
+
React.createElement(Text, { variation: textVariation, align: "start" }, label),
|
|
46
|
+
assistiveText && (React.createElement(Text, { level: "textSupporting", align: "start", variation: textVariation }, assistiveText)))),
|
|
46
47
|
React.createElement(View, { style: [
|
|
47
48
|
styles.checkbox,
|
|
48
49
|
disabled && styles.disabledCheckbox,
|
|
49
50
|
{
|
|
50
51
|
backgroundColor,
|
|
51
52
|
},
|
|
52
|
-
] }, (internalValue || indeterminate) && (React.createElement(Icon, { name: iconName, color: "white" }))))
|
|
53
|
-
assistiveText && (React.createElement(Text, { level: "textSupporting", align: "start", variation: textVariation }, assistiveText))));
|
|
53
|
+
] }, (internalValue || indeterminate) && (React.createElement(Icon, { name: iconName, color: "white" }))))));
|
|
54
54
|
}
|
|
55
55
|
function getBackgroundColor(checked, disabled, indeterminate) {
|
|
56
56
|
const { tokens } = useAtlantisTheme();
|
|
@@ -9,11 +9,12 @@ export const useStyles = buildThemedStyles(tokens => {
|
|
|
9
9
|
width: "100%",
|
|
10
10
|
justifyContent: "space-between",
|
|
11
11
|
flexDirection: "row",
|
|
12
|
-
alignItems: "
|
|
12
|
+
alignItems: "flex-start",
|
|
13
13
|
paddingVertical: tokens["space-small"],
|
|
14
14
|
},
|
|
15
15
|
label: {
|
|
16
16
|
flex: 1,
|
|
17
|
+
gap: tokens["space-smaller"],
|
|
17
18
|
},
|
|
18
19
|
checkbox: {
|
|
19
20
|
borderRadius: tokens["radius-base"],
|
package/dist/src/Form/Form.js
CHANGED
|
@@ -106,7 +106,7 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
106
106
|
React.createElement(React.Fragment, null,
|
|
107
107
|
(isSubmitting || isSecondaryActionLoading) && React.createElement(FormMask, null),
|
|
108
108
|
React.createElement(FormCache, { localCacheKey: localCacheKey, localCacheExclude: localCacheExclude, setLocalCache: setLocalCache }),
|
|
109
|
-
React.createElement(FormBody, { keyboardHeight: calculateSaveButtonOffset(), submit:
|
|
109
|
+
React.createElement(FormBody, { keyboardHeight: calculateSaveButtonOffset(), submit: handleSubmit(internalSubmit), isFormSubmitting: isSubmitting, saveButtonLabel: saveButtonLabel, shouldRenderActionBar: saveButtonPosition === "sticky", renderStickySection: renderStickySection, secondaryActions: secondaryActions, setSecondaryActionLoading: setIsSecondaryActionLoading, setSaveButtonHeight: setSaveButtonHeight, saveButtonOffset: saveButtonOffset },
|
|
110
110
|
React.createElement(KeyboardAwareScrollView, Object.assign({ enableResetScrollToCoords: false, enableAutomaticScroll: true, keyboardOpeningTime: Platform.OS === "ios" ? tokens["timing-slowest"] : 0, keyboardShouldPersistTaps: "handled", ref: scrollViewRef }, keyboardProps, { extraHeight: headerHeight, contentContainerStyle: !keyboardHeight && styles.scrollContentContainer }),
|
|
111
111
|
React.createElement(View, { onLayout: ({ nativeEvent }) => {
|
|
112
112
|
setFormContentHeight(nativeEvent.layout.height);
|
|
@@ -117,7 +117,7 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
117
117
|
React.createElement(View, { style: styles.formChildContainer },
|
|
118
118
|
React.createElement(React.Fragment, null,
|
|
119
119
|
React.createElement(View, { style: styles.formContent }, children),
|
|
120
|
-
saveButtonPosition === "inline" && (React.createElement(View, { style: styles.fixedSaveButton }, renderStickySection ? (renderStickySection(
|
|
120
|
+
saveButtonPosition === "inline" && (React.createElement(View, { style: styles.fixedSaveButton }, renderStickySection ? (renderStickySection(handleSubmit(internalSubmit), saveButtonLabel, isSubmitting)) : (React.createElement(FormSaveButton, { primaryAction: handleSubmit(internalSubmit), label: saveButtonLabel, loading: isSubmitting, secondaryActions: secondaryActions, setSecondaryActionLoading: setIsSecondaryActionLoading, onOpenBottomSheet: () => setIsBottomSheetOpen(true), onCloseBottomSheet: () => setIsBottomSheetOpen(false) })))),
|
|
121
121
|
renderFooter))),
|
|
122
122
|
React.createElement(View, { style: styles.safeArea, ref: bottomViewRef })))),
|
|
123
123
|
React.createElement(FormMessage, null)));
|
|
@@ -141,18 +141,6 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
141
141
|
setKeyboardHeight(0);
|
|
142
142
|
setKeyboardScreenY(0);
|
|
143
143
|
}
|
|
144
|
-
function callHandleSubmit() {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
var _a;
|
|
147
|
-
let result;
|
|
148
|
-
yield handleSubmit((data) => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
const saveResult = yield internalSubmit(data);
|
|
150
|
-
result = saveResult;
|
|
151
|
-
}))();
|
|
152
|
-
(_a = removeListenerRef.current) === null || _a === void 0 ? void 0 : _a.call(removeListenerRef);
|
|
153
|
-
onSubmitSuccess(result);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
144
|
function internalSubmit(data) {
|
|
157
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
146
|
let performSubmit = true;
|
|
@@ -161,7 +149,13 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
161
149
|
}
|
|
162
150
|
if (performSubmit) {
|
|
163
151
|
Keyboard.dismiss();
|
|
164
|
-
return onSubmit(data)
|
|
152
|
+
return onSubmit(data)
|
|
153
|
+
.then((result) => {
|
|
154
|
+
var _a;
|
|
155
|
+
(_a = removeListenerRef.current) === null || _a === void 0 ? void 0 : _a.call(removeListenerRef);
|
|
156
|
+
onSubmitSuccess(result);
|
|
157
|
+
})
|
|
158
|
+
.catch(handleSubmitCatch);
|
|
165
159
|
}
|
|
166
160
|
});
|
|
167
161
|
}
|
|
@@ -183,7 +177,7 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
183
177
|
}
|
|
184
178
|
function handleRetry() {
|
|
185
179
|
clearFormErrors();
|
|
186
|
-
return
|
|
180
|
+
return handleSubmit(internalSubmit)();
|
|
187
181
|
}
|
|
188
182
|
function calculateSaveButtonOffset() {
|
|
189
183
|
if (saveButtonOffset) {
|