@codeleap/web 1.4.10 → 1.4.11
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/components/Select/Custom.d.ts +5 -0
- package/dist/components/Select/Custom.js +6 -4
- package/dist/components/Select/Custom.js.map +1 -1
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Select/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CustomSelectProps } from './types';
|
|
3
|
+
import { SelectRenderFNProps } from '.';
|
|
4
|
+
export declare const SelectItem: React.FC<SelectRenderFNProps<any> & {
|
|
5
|
+
iconName?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const InputWrapper: (props: any) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
8
|
export declare const CustomSelect: React.FC<CustomSelectProps<any>>;
|
|
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
return t;
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.CustomSelect = void 0;
|
|
25
|
+
exports.CustomSelect = exports.InputWrapper = exports.SelectItem = void 0;
|
|
26
26
|
var react_1 = require("@emotion/react");
|
|
27
27
|
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
28
|
var common_1 = require("@codeleap/common");
|
|
@@ -38,10 +38,12 @@ var SelectItem = function (_a) {
|
|
|
38
38
|
var styles = _a.styles, iconName = _a.iconName, onPress = _a.onPress, label = _a.label, inList = _a.inList;
|
|
39
39
|
return ((0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, __assign({ onPress: onPress, css: inList ? [styles.itemWrapper] : [styles.buttonWrapper] }, { children: [typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: label, css: inList ? styles.itemText : styles.buttonText })) : (label), !inList && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: iconName, style: styles.buttonIcon }))] })));
|
|
40
40
|
};
|
|
41
|
+
exports.SelectItem = SelectItem;
|
|
41
42
|
var InputWrapper = function (props) {
|
|
42
43
|
var styles = props.styles, label = props.label, children = props.children, currentContent = props.currentContent, open = props.open, id = props.id, error = props.error, wrapperProps = __rest(props, ["styles", "label", "children", "currentContent", "open", "id", "error"]);
|
|
43
44
|
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.wrapper }, wrapperProps, { children: [(0, jsx_runtime_1.jsx)(TextInput_1.InputLabel, { label: label, style: styles.label }), (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.inputWrapper, id: id }, { children: [currentContent, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ css: styles.list }, { children: children }))] })), (0, jsx_runtime_1.jsx)(TextInput_1.FormError, { message: error.message, style: styles.error })] })));
|
|
44
45
|
};
|
|
46
|
+
exports.InputWrapper = InputWrapper;
|
|
45
47
|
var CustomSelect = function (selectProps) {
|
|
46
48
|
var _a = selectProps.options, options = _a === void 0 ? [] : _a, value = selectProps.value, onValueChange = selectProps.onValueChange, renderCurrentlySelected = selectProps.renderCurrentlySelected, renderItem = selectProps.renderItem, placeholder = selectProps.placeholder, onDropdownToggle = selectProps.onDropdownToggle, variants = selectProps.variants, responsiveVariants = selectProps.responsiveVariants, styles = selectProps.styles, validate = selectProps.validate, disabled = selectProps.disabled, arrowIconName = selectProps.arrowIconName, props = __rest(selectProps, ["options", "value", "onValueChange", "renderCurrentlySelected", "renderItem", "placeholder", "onDropdownToggle", "variants", "responsiveVariants", "styles", "validate", "disabled", "arrowIconName"]);
|
|
47
49
|
var _b = (0, common_1.useBooleanToggle)(false), isOpen = _b[0], setOpen = _b[1];
|
|
@@ -63,8 +65,8 @@ var CustomSelect = function (selectProps) {
|
|
|
63
65
|
variants: variants,
|
|
64
66
|
responsiveVariants: responsiveVariants,
|
|
65
67
|
});
|
|
66
|
-
var CurrentContent = renderCurrentlySelected || SelectItem;
|
|
67
|
-
var Item = renderItem || SelectItem;
|
|
68
|
+
var CurrentContent = renderCurrentlySelected || exports.SelectItem;
|
|
69
|
+
var Item = renderItem || exports.SelectItem;
|
|
68
70
|
var isValueEmpty = value === null || typeof value === 'undefined';
|
|
69
71
|
var currentOption = isValueEmpty
|
|
70
72
|
? { label: placeholder, value: value }
|
|
@@ -77,7 +79,7 @@ var CustomSelect = function (selectProps) {
|
|
|
77
79
|
if (append === void 0) { append = {}; }
|
|
78
80
|
return __assign(__assign(__assign(__assign(__assign(__assign({}, variantStyles[key]), (0, common_1.optionalObject)(isOpen, variantStyles["".concat(key, ":open")], {})), (0, common_1.optionalObject)(isHovering, variantStyles["".concat(key, ":hover")], {})), (0, common_1.optionalObject)(showError, variantStyles["".concat(key, ":error")], {})), (0, common_1.optionalObject)(disabled, variantStyles["".concat(key, ":disabled")], {})), append);
|
|
79
81
|
}
|
|
80
|
-
return ((0, jsx_runtime_1.jsx)(InputWrapper, __assign({ currentContent: (0, jsx_runtime_1.jsx)(CurrentContent, __assign({}, currentOption, { onPress: function () { return setOpen(); }, styles: {
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(exports.InputWrapper, __assign({ currentContent: (0, jsx_runtime_1.jsx)(CurrentContent, __assign({}, currentOption, { onPress: function () { return setOpen(); }, styles: {
|
|
81
83
|
buttonIcon: getStyles('buttonIcon'),
|
|
82
84
|
buttonText: getStyles('buttonText'),
|
|
83
85
|
buttonWrapper: getStyles('buttonWrapper'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Custom.js","sourceRoot":"","sources":["../../../src/components/Select/Custom.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAQyB;AACzB,+BAAuC;AACvC,0CAAoD;AACpD,gCAA8B;AAC9B,0CAAwC;AACxC,gCAA8B;AAC9B,gCAA8B;AAC9B,yCAAiD;AAIjD,6BAAyB;
|
|
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AAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,CACrB,2BAAC,IAAI,eACC,IAAI,IACR,MAAM,QACN,OAAO,EAAE;gBACP,OAAO,CAAC,KAAK,CAAC,CAAA;gBACd,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC3B,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,EAC9B,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,MAAM,EAAE;gBACN,QAAQ,EAAE,SAAS,CAAC,UAAU,eACzB,IAAA,uBAAc,EACf,IAAI,CAAC,KAAK,KAAK,KAAK,EACpB,aAAa,CAAC,mBAAmB,CAAC,EAClC,EAAE,CACH,EACD;gBACF,WAAW,EAAE,SAAS,CAAC,aAAa,eAC/B,IAAA,uBAAc,EACf,IAAI,CAAC,KAAK,KAAK,KAAK,EACpB,aAAa,CAAC,sBAAsB,CAAC,EACrC,EAAE,CACH,EACD;aACH,IACD,CACH,EA3BsB,CA2BtB,CAAC,IACW,CAChB,CAAA;AACH,CAAC,CAAA;AAlIY,QAAA,YAAY,gBAkIxB"}
|
|
@@ -7,4 +7,5 @@ export declare type SelectProps<T extends string | number = string> = ({
|
|
|
7
7
|
} & CustomSelectProps<T>);
|
|
8
8
|
export * from './types';
|
|
9
9
|
export * from './styles';
|
|
10
|
+
export * from './Custom';
|
|
10
11
|
export declare const Select: <T extends string | number = string>(props: SelectProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -31,6 +31,7 @@ var Custom_1 = require("./Custom");
|
|
|
31
31
|
var Native_1 = require("./Native");
|
|
32
32
|
__exportStar(require("./types"), exports);
|
|
33
33
|
__exportStar(require("./styles"), exports);
|
|
34
|
+
__exportStar(require("./Custom"), exports);
|
|
34
35
|
var Select = function (props) {
|
|
35
36
|
if (props.type === 'native') {
|
|
36
37
|
return (0, jsx_runtime_1.jsx)(Native_1.NativeSelect, __assign({}, props));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAuC;AACvC,mCAA0D;AAW1D,0CAAuB;AACvB,2CAAwB;AAEjB,IAAM,MAAM,GAAG,UACpB,KAAqB;IAErB,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC3B,OAAO,uBAAC,qBAAY,eAAK,KAAK,EAAI,CAAA;KACnC;IAED,OAAO,uBAAC,qBAAY,eAAK,KAAK,EAAI,CAAA;AACpC,CAAC,CAAA;AARY,QAAA,MAAM,UAQlB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAuC;AACvC,mCAA0D;AAW1D,0CAAuB;AACvB,2CAAwB;AACxB,2CAAwB;AAEjB,IAAM,MAAM,GAAG,UACpB,KAAqB;IAErB,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC3B,OAAO,uBAAC,qBAAY,eAAK,KAAK,EAAI,CAAA;KACnC;IAED,OAAO,uBAAC,qBAAY,eAAK,KAAK,EAAI,CAAA;AACpC,CAAC,CAAA;AARY,QAAA,MAAM,UAQlB"}
|