aport-tools 4.4.2 → 4.4.4
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/forms/FormContext.d.ts +107 -3
- package/dist/forms/Stepper.d.ts +41 -0
- package/dist/index.esm.js +46 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +45 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! aport-tools v4.4.
|
1
|
+
/*! aport-tools v4.4.4 | ISC */
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
var React = require('react');
|
@@ -233,17 +233,50 @@ var Stepper = function Stepper(_a) {
|
|
233
233
|
switch (stepType) {
|
234
234
|
case "icon":
|
235
235
|
if (Array.isArray(icon)) {
|
236
|
-
|
236
|
+
var stepIcon = icon[index];
|
237
|
+
if (typeof stepIcon === "string") {
|
238
|
+
return /*#__PURE__*/React.createElement(reactNative.Image, {
|
239
|
+
source: {
|
240
|
+
uri: stepIcon
|
241
|
+
},
|
242
|
+
style: {
|
243
|
+
width: 24,
|
244
|
+
height: 24
|
245
|
+
},
|
246
|
+
resizeMode: "contain"
|
247
|
+
});
|
248
|
+
} else {
|
249
|
+
console.error("Invalid icon value for step ".concat(index, ". Expected a string URI."));
|
250
|
+
return null;
|
251
|
+
}
|
237
252
|
}
|
238
|
-
|
239
|
-
|
253
|
+
if (typeof icon === "string") {
|
254
|
+
return /*#__PURE__*/React.createElement(reactNative.Image, {
|
255
|
+
source: {
|
256
|
+
uri: icon
|
257
|
+
},
|
258
|
+
style: {
|
259
|
+
width: 24,
|
260
|
+
height: 24
|
261
|
+
},
|
262
|
+
resizeMode: "contain"
|
263
|
+
});
|
264
|
+
}
|
265
|
+
console.error("Icon prop must be a string or an array of strings.");
|
266
|
+
return null;
|
240
267
|
case "empty":
|
241
268
|
return null;
|
242
|
-
// Render nothing inside the step circle
|
243
269
|
case "number":
|
244
270
|
default:
|
245
|
-
return
|
246
|
-
|
271
|
+
return /*#__PURE__*/React.createElement(Text, {
|
272
|
+
b: true,
|
273
|
+
typeFont: "primary",
|
274
|
+
style: [currentStep >= index ? {
|
275
|
+
color: colors.textButton.hex
|
276
|
+
} : {
|
277
|
+
color: colors.text.hex
|
278
|
+
}]
|
279
|
+
}, index + 1);
|
247
280
|
}
|
248
281
|
};
|
249
282
|
return /*#__PURE__*/React.createElement(reactNative.View, {
|
@@ -262,10 +295,8 @@ var Stepper = function Stepper(_a) {
|
|
262
295
|
return _onPress && _onPress(index);
|
263
296
|
}
|
264
297
|
}, /*#__PURE__*/React.createElement(reactNative.View, {
|
265
|
-
style: [styles$9.step, stepStyle === "square" && styles$9.squareStep,
|
266
|
-
backgroundColor: colors.primary.hex
|
267
|
-
}, {
|
268
|
-
backgroundColor: colors.body.hex
|
298
|
+
style: [styles$9.step, stepStyle === "square" && styles$9.squareStep, {
|
299
|
+
backgroundColor: currentStep >= index ? colors.primary.hex : colors.body.hex
|
269
300
|
}]
|
270
301
|
}, renderStepContent(index)), steps && /*#__PURE__*/React.createElement(Text, {
|
271
302
|
style: styles$9.stepText
|
@@ -275,7 +306,8 @@ var Stepper = function Stepper(_a) {
|
|
275
306
|
style: styles$9.separatorBackground
|
276
307
|
}), /*#__PURE__*/React.createElement(reactNative.Animated.View, {
|
277
308
|
style: [styles$9.separatorProgress, {
|
278
|
-
width: getSeparatorWidth(index)
|
309
|
+
width: getSeparatorWidth(index),
|
310
|
+
backgroundColor: colors.primary.hex
|
279
311
|
}]
|
280
312
|
}))));
|
281
313
|
}));
|
@@ -328,7 +360,6 @@ var styles$9 = reactNative.StyleSheet.create({
|
|
328
360
|
separatorProgress: {
|
329
361
|
position: "absolute",
|
330
362
|
height: "100%",
|
331
|
-
backgroundColor: "#3498db",
|
332
363
|
borderRadius: 2
|
333
364
|
}
|
334
365
|
});
|
@@ -388,7 +419,7 @@ var Form = function Form(_a) {
|
|
388
419
|
}
|
389
420
|
}, stepper && (/*#__PURE__*/React.createElement(Stepper, {
|
390
421
|
steps: stepper.steps,
|
391
|
-
currentStep: stepper.
|
422
|
+
currentStep: stepper.currentStep,
|
392
423
|
presseable: stepper.presseable,
|
393
424
|
onPress: stepper.onPress,
|
394
425
|
totalSteps: stepper.totalSteps,
|