@neko-os/ui 0.5.3 → 0.5.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/abstractions/Image.native.js +1 -1
- package/dist/abstractions/Image.web.js +1 -1
- package/dist/components/form/useNewForm.js +2 -0
- package/dist/components/inputs/InputWrapper.js +12 -11
- package/dist/components/inputs/SegmentedPicker.js +3 -2
- package/dist/components/presentation/Avatar.js +3 -3
- package/dist/modifiers/flex.js +8 -3
- package/dist/theme/default/blackTheme.js +3 -1
- package/dist/theme/default/cyberpunkTheme.js +3 -1
- package/dist/theme/default/darkTheme.js +3 -1
- package/dist/theme/default/hackerTheme.js +3 -1
- package/dist/theme/default/lightTheme.js +3 -1
- package/dist/theme/default/paperTheme.js +3 -1
- package/package.json +1 -1
- package/src/abstractions/Image.native.js +1 -1
- package/src/abstractions/Image.web.js +1 -1
- package/src/components/form/useNewForm.js +2 -0
- package/src/components/inputs/InputWrapper.js +3 -2
- package/src/components/inputs/SegmentedPicker.js +2 -1
- package/src/components/presentation/Avatar.js +2 -2
- package/src/modifiers/flex.js +7 -2
- package/src/theme/default/blackTheme.js +2 -0
- package/src/theme/default/cyberpunkTheme.js +2 -0
- package/src/theme/default/darkTheme.js +2 -0
- package/src/theme/default/hackerTheme.js +2 -0
- package/src/theme/default/lightTheme.js +2 -0
- package/src/theme/default/paperTheme.js +2 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/Image.native.js";var _excluded = ["src", "source", "resizeMode"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { Image as RNImage } from "react-native-web";import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
export function AbsImage(_ref) {var src = _ref.src,source = _ref.source,_ref$resizeMode = _ref.resizeMode,resizeMode = _ref$resizeMode === void 0 ? 'cover' : _ref$resizeMode,props = _objectWithoutProperties(_ref, _excluded);
|
|
4
|
-
if (!source &&
|
|
4
|
+
if (!source && src != null) source = typeof src === 'string' ? { uri: src } : src;
|
|
5
5
|
|
|
6
6
|
return _jsx(RNImage, Object.assign({ source: source, resizeMode: resizeMode }, props));
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/Image.web.js";var _excluded = ["src", "source", "resizeMode"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { Image as RNImage } from "react-native-web";import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
export function AbsImage(_ref) {var src = _ref.src,source = _ref.source,_ref$resizeMode = _ref.resizeMode,resizeMode = _ref$resizeMode === void 0 ? 'cover' : _ref$resizeMode,props = _objectWithoutProperties(_ref, _excluded);
|
|
4
|
-
if (!source &&
|
|
4
|
+
if (!source && src != null) source = typeof src === 'string' ? { uri: src } : src;
|
|
5
5
|
|
|
6
6
|
return _jsx(RNImage, Object.assign({ source: source, resizeMode: resizeMode }, props));
|
|
7
7
|
}
|
|
@@ -64,11 +64,13 @@ export function useNewForm() {var _ref = arguments.length > 0 && arguments[0] !=
|
|
|
64
64
|
|
|
65
65
|
var isTouched = function isTouched(name) {
|
|
66
66
|
if (!name) return touchedRef.current.size > 0;
|
|
67
|
+
if (Array.isArray(name)) return name.some(function (n) {return touchedRef.current.has(toKey(n));});
|
|
67
68
|
return touchedRef.current.has(toKey(name));
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
var isDirty = function isDirty(name) {
|
|
71
72
|
if (!name) return dirtyRef.current.size > 0;
|
|
73
|
+
if (Array.isArray(name)) return name.some(function (n) {return dirtyRef.current.has(toKey(n));});
|
|
72
74
|
return dirtyRef.current.has(toKey(name));
|
|
73
75
|
};
|
|
74
76
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/InputWrapper.js";var _excluded = ["prefix", "suffix", "prefixIcon", "prefixIconColor", "suffixIcon", "suffixIconColor", "loading", "error", "multiline", "children", "ref"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/InputWrapper.js";var _excluded = ["prefix", "suffix", "prefixIcon", "prefixIconColor", "suffixIcon", "suffixIconColor", "loading", "error", "multiline", "children", "ref"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { pipe, is } from 'ramda';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { Icon } from "../presentation/Icon";
|
|
@@ -9,16 +9,17 @@ import { useDefaultModifier } from "../../modifiers/default";
|
|
|
9
9
|
import { useSizeConverter } from "../../modifiers/sizeConverter";
|
|
10
10
|
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
|
-
var DEFAULT_PROPS = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
var DEFAULT_PROPS = function DEFAULT_PROPS(_ref) {var _ref2 = _slicedToArray(_ref, 1),sizeCode = _ref2[0].sizeCode;return {
|
|
13
|
+
paddingH: 'sm',
|
|
14
|
+
bg: 'overlayBG',
|
|
15
|
+
border: true,
|
|
16
|
+
br: 'md',
|
|
17
|
+
row: true,
|
|
18
|
+
gap: 'sm',
|
|
19
|
+
br: sizeCode
|
|
20
|
+
};};
|
|
20
21
|
|
|
21
|
-
export function InputWrapper(
|
|
22
|
+
export function InputWrapper(_ref3)
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
|
|
@@ -31,7 +32,7 @@ export function InputWrapper(_ref)
|
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
{var prefix =
|
|
35
|
+
{var prefix = _ref3.prefix,suffix = _ref3.suffix,prefixIcon = _ref3.prefixIcon,prefixIconColor = _ref3.prefixIconColor,suffixIcon = _ref3.suffixIcon,suffixIconColor = _ref3.suffixIconColor,loading = _ref3.loading,error = _ref3.error,multiline = _ref3.multiline,children = _ref3.children,ref = _ref3.ref,rootProps = _objectWithoutProperties(_ref3, _excluded);
|
|
35
36
|
var _React$useState = React.useState(false),_React$useState2 = _slicedToArray(_React$useState, 2),hover = _React$useState2[0],setHover = _React$useState2[1];
|
|
36
37
|
var fallbackInputRef = React.useRef();
|
|
37
38
|
var inputRef = ref || fallbackInputRef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/presentation/Avatar.js";var _excluded = ["initials", "name", "icon", "src", "invert", "textProps", "iconProps", "iconSize"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { pipe } from 'ramda';
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/presentation/Avatar.js";var _excluded = ["initials", "name", "icon", "src", "invert", "textProps", "iconProps", "iconSize", "imageProps"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { pipe } from 'ramda';
|
|
2
2
|
|
|
3
3
|
import { AbsView } from "../../abstractions/View";
|
|
4
4
|
import { IconLabel } from "./IconLabel";
|
|
@@ -54,7 +54,7 @@ export function Avatar(rootProps) {
|
|
|
54
54
|
useOverflowModifier
|
|
55
55
|
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],fontColor = _pipe2$.fontColor,sizeCode = _pipe2$.sizeCode,formattedProps = _pipe2[1];
|
|
56
56
|
|
|
57
|
-
var initials = formattedProps.initials,name = formattedProps.name,icon = formattedProps.icon,src = formattedProps.src,invert = formattedProps.invert,textProps = formattedProps.textProps,iconProps = formattedProps.iconProps,iconSize = formattedProps.iconSize,props = _objectWithoutProperties(formattedProps, _excluded);
|
|
57
|
+
var initials = formattedProps.initials,name = formattedProps.name,icon = formattedProps.icon,src = formattedProps.src,invert = formattedProps.invert,textProps = formattedProps.textProps,iconProps = formattedProps.iconProps,iconSize = formattedProps.iconSize,imageProps = formattedProps.imageProps,props = _objectWithoutProperties(formattedProps, _excluded);
|
|
58
58
|
initials = initials || getInitials(name);
|
|
59
59
|
|
|
60
60
|
var content =
|
|
@@ -69,7 +69,7 @@ export function Avatar(rootProps) {
|
|
|
69
69
|
iconProps: Object.assign({ size: iconSize }, iconProps) }
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
if (!!src) content = _jsx(Image, { br: 0, src: src, width: sizeCode, height: sizeCode });
|
|
72
|
+
if (!!src) content = _jsx(Image, Object.assign({ br: 0, src: src, width: sizeCode, height: sizeCode }, imageProps));
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
75
|
_jsx(AbsView, Object.assign({ className: "neko-avatar" }, props, { children:
|
package/dist/modifiers/flex.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
var _excluded = ["flex"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { clearProps, flattenStyle } from "./_helpers";
|
|
1
|
+
var _excluded = ["flex", "alignSelf", "selfStretch", "selfCenter", "selfStart", "selfEnd"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { clearProps, flattenStyle } from "./_helpers";
|
|
2
2
|
|
|
3
3
|
export function useFlexModifier(_ref) {var _ref2 = _slicedToArray(_ref, 2),values = _ref2[0],props = _ref2[1];
|
|
4
|
-
var flex = props.flex,restProps = _objectWithoutProperties(props, _excluded);
|
|
4
|
+
var flex = props.flex,alignSelf = props.alignSelf,selfStretch = props.selfStretch,selfCenter = props.selfCenter,selfStart = props.selfStart,selfEnd = props.selfEnd,restProps = _objectWithoutProperties(props, _excluded);
|
|
5
5
|
|
|
6
6
|
if (flex === true) flex = 1;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
if (selfStretch) alignSelf = 'stretch';
|
|
9
|
+
if (selfCenter) alignSelf = 'center';
|
|
10
|
+
if (selfStart) alignSelf = 'flex-start';
|
|
11
|
+
if (selfEnd) alignSelf = 'flex-end';
|
|
12
|
+
|
|
13
|
+
var style = clearProps({ flex: flex, minWidth: 0, alignSelf: alignSelf });
|
|
9
14
|
|
|
10
15
|
return [
|
|
11
16
|
values, Object.assign({},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Image as RNImage } from 'react-native'
|
|
2
2
|
|
|
3
3
|
export function AbsImage({ src, source, resizeMode = 'cover', ...props }) {
|
|
4
|
-
if (!source &&
|
|
4
|
+
if (!source && src != null) source = typeof src === 'string' ? { uri: src } : src
|
|
5
5
|
|
|
6
6
|
return <RNImage source={source} resizeMode={resizeMode} {...props} />
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Image as RNImage } from 'react-native'
|
|
2
2
|
|
|
3
3
|
export function AbsImage({ src, source, resizeMode = 'cover', ...props }) {
|
|
4
|
-
if (!source &&
|
|
4
|
+
if (!source && src != null) source = typeof src === 'string' ? { uri: src } : src
|
|
5
5
|
|
|
6
6
|
return <RNImage source={source} resizeMode={resizeMode} {...props} />
|
|
7
7
|
}
|
|
@@ -64,11 +64,13 @@ export function useNewForm({ initialValues = {}, validate, onSubmit, onValuesCha
|
|
|
64
64
|
|
|
65
65
|
const isTouched = (name) => {
|
|
66
66
|
if (!name) return touchedRef.current.size > 0
|
|
67
|
+
if (Array.isArray(name)) return name.some((n) => touchedRef.current.has(toKey(n)))
|
|
67
68
|
return touchedRef.current.has(toKey(name))
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
const isDirty = (name) => {
|
|
71
72
|
if (!name) return dirtyRef.current.size > 0
|
|
73
|
+
if (Array.isArray(name)) return name.some((n) => dirtyRef.current.has(toKey(n)))
|
|
72
74
|
return dirtyRef.current.has(toKey(name))
|
|
73
75
|
}
|
|
74
76
|
|
|
@@ -9,14 +9,15 @@ import { useDefaultModifier } from '../../modifiers/default'
|
|
|
9
9
|
import { useSizeConverter } from '../../modifiers/sizeConverter'
|
|
10
10
|
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
11
11
|
|
|
12
|
-
const DEFAULT_PROPS = {
|
|
12
|
+
const DEFAULT_PROPS = ([{ sizeCode }]) => ({
|
|
13
13
|
paddingH: 'sm',
|
|
14
14
|
bg: 'overlayBG',
|
|
15
15
|
border: true,
|
|
16
16
|
br: 'md',
|
|
17
17
|
row: true,
|
|
18
18
|
gap: 'sm',
|
|
19
|
-
|
|
19
|
+
br: sizeCode,
|
|
20
|
+
})
|
|
20
21
|
|
|
21
22
|
export function InputWrapper({
|
|
22
23
|
prefix,
|
|
@@ -54,7 +54,7 @@ export function Avatar(rootProps) {
|
|
|
54
54
|
useOverflowModifier
|
|
55
55
|
)([{}, rootProps])
|
|
56
56
|
|
|
57
|
-
let { initials, name, icon, src, invert, textProps, iconProps, iconSize, ...props } = formattedProps
|
|
57
|
+
let { initials, name, icon, src, invert, textProps, iconProps, iconSize, imageProps, ...props } = formattedProps
|
|
58
58
|
initials = initials || getInitials(name)
|
|
59
59
|
|
|
60
60
|
let content = (
|
|
@@ -69,7 +69,7 @@ export function Avatar(rootProps) {
|
|
|
69
69
|
iconProps={{ size: iconSize, ...iconProps }}
|
|
70
70
|
/>
|
|
71
71
|
)
|
|
72
|
-
if (!!src) content = <Image br={0} src={src} width={sizeCode} height={sizeCode} />
|
|
72
|
+
if (!!src) content = <Image br={0} src={src} width={sizeCode} height={sizeCode} {...imageProps} />
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
75
|
<AbsView className="neko-avatar" {...props}>
|
package/src/modifiers/flex.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { clearProps, flattenStyle } from './_helpers'
|
|
2
2
|
|
|
3
3
|
export function useFlexModifier([values, props]) {
|
|
4
|
-
let { flex, ...restProps } = props
|
|
4
|
+
let { flex, alignSelf, selfStretch, selfCenter, selfStart, selfEnd, ...restProps } = props
|
|
5
5
|
|
|
6
6
|
if (flex === true) flex = 1
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
if (selfStretch) alignSelf = 'stretch'
|
|
9
|
+
if (selfCenter) alignSelf = 'center'
|
|
10
|
+
if (selfStart) alignSelf = 'flex-start'
|
|
11
|
+
if (selfEnd) alignSelf = 'flex-end'
|
|
12
|
+
|
|
13
|
+
const style = clearProps({ flex, minWidth: 0, alignSelf })
|
|
9
14
|
|
|
10
15
|
return [
|
|
11
16
|
values,
|