@codeleap/web 2.0.0 → 2.3.12
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/ActivityIndicator/index.d.ts +12 -12
- package/dist/components/ActivityIndicator/index.js +60 -60
- package/dist/components/ActivityIndicator/styles.d.ts +53 -53
- package/dist/components/ActivityIndicator/styles.js +21 -21
- package/dist/components/Button.d.ts +18 -18
- package/dist/components/Button.js +66 -66
- package/dist/components/CenterWrapper.d.ts +7 -7
- package/dist/components/CenterWrapper.js +27 -27
- package/dist/components/Checkbox/index.d.ts +12 -12
- package/dist/components/Checkbox/index.js +61 -61
- package/dist/components/Checkbox/styles.d.ts +53 -53
- package/dist/components/Checkbox/styles.js +63 -63
- package/dist/components/Collapse.d.ts +20 -20
- package/dist/components/Collapse.js +67 -67
- package/dist/components/ContentView.d.ts +10 -10
- package/dist/components/ContentView.js +51 -51
- package/dist/components/Drawer.d.ts +23 -23
- package/dist/components/Drawer.js +72 -72
- package/dist/components/FileInput.d.ts +8 -8
- package/dist/components/FileInput.js +72 -72
- package/dist/components/HorizontalScroll.d.ts +3 -3
- package/dist/components/HorizontalScroll.js +41 -41
- package/dist/components/Icon.d.ts +8 -8
- package/dist/components/Icon.js +54 -54
- package/dist/components/Link.d.ts +7 -7
- package/dist/components/Link.js +62 -62
- package/dist/components/List.d.ts +18 -18
- package/dist/components/List.js +51 -51
- package/dist/components/Modal/index.d.ts +21 -21
- package/dist/components/Modal/index.js +119 -119
- package/dist/components/Modal/styles.d.ts +56 -56
- package/dist/components/Modal/styles.js +35 -35
- package/dist/components/Overlay.d.ts +10 -10
- package/dist/components/Overlay.js +40 -40
- package/dist/components/RadioInput/index.d.ts +21 -21
- package/dist/components/RadioInput/index.js +54 -54
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +43 -43
- package/dist/components/RouterPage/Menu.d.ts +10 -10
- package/dist/components/RouterPage/Menu.js +35 -35
- package/dist/components/RouterPage/MenuItem.d.ts +12 -12
- package/dist/components/RouterPage/MenuItem.js +41 -41
- package/dist/components/RouterPage/Router.d.ts +8 -8
- package/dist/components/RouterPage/Router.js +26 -26
- package/dist/components/RouterPage/index.d.ts +29 -29
- package/dist/components/RouterPage/index.js +88 -88
- package/dist/components/RouterPage/styles.d.ts +54 -54
- package/dist/components/RouterPage/styles.js +86 -86
- package/dist/components/Scroll.d.ts +5 -5
- package/dist/components/Scroll.js +23 -23
- package/dist/components/Select/Custom.d.ts +8 -8
- package/dist/components/Select/Custom.js +103 -103
- package/dist/components/Select/Custom.js.map +1 -1
- package/dist/components/Select/Multi.d.ts +3 -0
- package/dist/components/Select/Multi.js +105 -0
- package/dist/components/Select/Multi.js.map +1 -0
- package/dist/components/Select/Native.d.ts +17 -17
- package/dist/components/Select/Native.js +43 -43
- package/dist/components/Select/index.d.ts +12 -11
- package/dist/components/Select/index.js +43 -41
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +5 -5
- package/dist/components/Select/styles.js +56 -56
- package/dist/components/Select/types.d.ts +49 -31
- package/dist/components/Select/types.js +2 -2
- package/dist/components/Slider.d.ts +5 -5
- package/dist/components/Slider.js +35 -35
- package/dist/components/Text.d.ts +9 -9
- package/dist/components/Text.js +40 -40
- package/dist/components/TextInput.d.ts +150 -150
- package/dist/components/TextInput.js +124 -124
- package/dist/components/Tooltip.d.ts +12 -12
- package/dist/components/Tooltip.js +121 -123
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Touchable.d.ts +15 -15
- package/dist/components/Touchable.js +51 -51
- package/dist/components/View.d.ts +10 -10
- package/dist/components/View.js +61 -61
- package/dist/components/index.d.ts +24 -24
- package/dist/components/index.js +40 -40
- package/dist/index.d.ts +6 -6
- package/dist/index.js +28 -28
- package/dist/lib/OSAlert.d.ts +21 -21
- package/dist/lib/OSAlert.js +139 -139
- package/dist/lib/Toast.d.ts +13 -13
- package/dist/lib/Toast.js +31 -31
- package/dist/lib/hooks.d.ts +28 -33
- package/dist/lib/hooks.js +182 -154
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/logger.d.ts +2 -2
- package/dist/lib/logger.js +15 -15
- package/dist/lib/utils/cookies.d.ts +6 -6
- package/dist/lib/utils/cookies.js +14 -14
- package/dist/lib/utils/index.d.ts +4 -4
- package/dist/lib/utils/index.js +26 -26
- package/dist/lib/utils/pollyfils/scroll.d.ts +1 -1
- package/dist/lib/utils/pollyfils/scroll.js +65 -65
- package/dist/lib/utils/stopPropagation.d.ts +1 -1
- package/dist/lib/utils/stopPropagation.js +19 -19
- package/dist/types/utility.d.ts +2 -2
- package/dist/types/utility.js +2 -2
- package/package.json +47 -47
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.CustomSelect = exports.InputWrapper = exports.SelectItem = void 0;
|
|
26
|
-
var react_1 = require("@emotion/react");
|
|
27
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
-
var common_1 = require("@codeleap/common");
|
|
29
|
-
var react_2 = require("react");
|
|
30
|
-
var TextInput_1 = require("../TextInput");
|
|
31
|
-
var Icon_1 = require("../Icon");
|
|
32
|
-
var Touchable_1 = require("../Touchable");
|
|
33
|
-
var View_1 = require("../View");
|
|
34
|
-
var Text_1 = require("../Text");
|
|
35
|
-
var hooks_1 = require("../../lib/hooks");
|
|
36
|
-
var SelectItem = function (_a) {
|
|
37
|
-
var styles = _a.styles, iconName = _a.iconName, onPress = _a.onPress, label = _a.label, icon = _a.icon, inList = _a.inList;
|
|
38
|
-
var showIcon = (!inList || !!icon);
|
|
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), showIcon && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon || iconName, style: styles.buttonIcon }))] })));
|
|
40
|
-
};
|
|
41
|
-
exports.SelectItem = SelectItem;
|
|
42
|
-
exports.InputWrapper = (0, react_2.forwardRef)(function (props, ref) {
|
|
43
|
-
var styles = props.styles, label = props.label, children = props.children, currentContent = props.currentContent, open = props.open, error = props.error, wrapperProps = __rest(props, ["styles", "label", "children", "currentContent", "open", "error"]);
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.wrapper, ref: ref }, 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 }, { 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 })] })));
|
|
45
|
-
});
|
|
46
|
-
var CustomSelect = function (selectProps) {
|
|
47
|
-
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, _b = selectProps.autoClose, autoClose = _b === void 0 ? true : _b, props = __rest(selectProps, ["options", "value", "onValueChange", "renderCurrentlySelected", "renderItem", "placeholder", "onDropdownToggle", "variants", "responsiveVariants", "styles", "validate", "disabled", "arrowIconName", "autoClose"]);
|
|
48
|
-
var _c = (0, common_1.useBooleanToggle)(false), isOpen = _c[0], setOpen = _c[1];
|
|
49
|
-
var _d = (0, common_1.useBooleanToggle)(false), isHovering = _d[0], setHovering = _d[1];
|
|
50
|
-
var optionLabelMap = (0, react_2.useMemo)(function () {
|
|
51
|
-
return Object.fromEntries(options.map(function (_a) {
|
|
52
|
-
var label = _a.label, value = _a.value;
|
|
53
|
-
return [value, label];
|
|
54
|
-
}));
|
|
55
|
-
}, [options]);
|
|
56
|
-
var
|
|
57
|
-
if (isOpen) {
|
|
58
|
-
setOpen(false);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (autoClose) {
|
|
94
|
-
setOpen(false);
|
|
95
|
-
}
|
|
96
|
-
onValueChange(item.value);
|
|
97
|
-
}, selected: item.value === value, key: item.value, styles: {
|
|
98
|
-
itemText: getStyles('itemText', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['itemText:selected'], {}))),
|
|
99
|
-
itemWrapper: getStyles('itemWrapper', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['itemWrapper:selected'], {}))),
|
|
100
|
-
buttonIcon: getStyles('buttonIcon', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['buttonIcon:selected'], {}))),
|
|
101
|
-
} }))); }) })));
|
|
102
|
-
};
|
|
103
|
-
exports.CustomSelect = CustomSelect;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.CustomSelect = exports.InputWrapper = exports.SelectItem = void 0;
|
|
26
|
+
var react_1 = require("@emotion/react");
|
|
27
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
+
var common_1 = require("@codeleap/common");
|
|
29
|
+
var react_2 = require("react");
|
|
30
|
+
var TextInput_1 = require("../TextInput");
|
|
31
|
+
var Icon_1 = require("../Icon");
|
|
32
|
+
var Touchable_1 = require("../Touchable");
|
|
33
|
+
var View_1 = require("../View");
|
|
34
|
+
var Text_1 = require("../Text");
|
|
35
|
+
var hooks_1 = require("../../lib/hooks");
|
|
36
|
+
var SelectItem = function (_a) {
|
|
37
|
+
var styles = _a.styles, iconName = _a.iconName, onPress = _a.onPress, label = _a.label, icon = _a.icon, inList = _a.inList;
|
|
38
|
+
var showIcon = (!inList || !!icon);
|
|
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), showIcon && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: icon || iconName, style: styles.buttonIcon }))] })));
|
|
40
|
+
};
|
|
41
|
+
exports.SelectItem = SelectItem;
|
|
42
|
+
exports.InputWrapper = (0, react_2.forwardRef)(function (props, ref) {
|
|
43
|
+
var styles = props.styles, label = props.label, children = props.children, currentContent = props.currentContent, open = props.open, error = props.error, wrapperProps = __rest(props, ["styles", "label", "children", "currentContent", "open", "error"]);
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: styles.wrapper, ref: ref }, 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 }, { 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 })] })));
|
|
45
|
+
});
|
|
46
|
+
var CustomSelect = function (selectProps) {
|
|
47
|
+
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, _b = selectProps.autoClose, autoClose = _b === void 0 ? true : _b, props = __rest(selectProps, ["options", "value", "onValueChange", "renderCurrentlySelected", "renderItem", "placeholder", "onDropdownToggle", "variants", "responsiveVariants", "styles", "validate", "disabled", "arrowIconName", "autoClose"]);
|
|
48
|
+
var _c = (0, common_1.useBooleanToggle)(false), isOpen = _c[0], setOpen = _c[1];
|
|
49
|
+
var _d = (0, common_1.useBooleanToggle)(false), isHovering = _d[0], setHovering = _d[1];
|
|
50
|
+
var optionLabelMap = (0, react_2.useMemo)(function () {
|
|
51
|
+
return Object.fromEntries(options.map(function (_a) {
|
|
52
|
+
var label = _a.label, value = _a.value;
|
|
53
|
+
return [value, label];
|
|
54
|
+
}));
|
|
55
|
+
}, [options]);
|
|
56
|
+
var wrapperRef = (0, hooks_1.useClickOutside)(function () {
|
|
57
|
+
if (isOpen) {
|
|
58
|
+
setOpen(false);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Select', {
|
|
62
|
+
styles: styles,
|
|
63
|
+
variants: variants,
|
|
64
|
+
responsiveVariants: responsiveVariants,
|
|
65
|
+
});
|
|
66
|
+
var CurrentContent = renderCurrentlySelected || exports.SelectItem;
|
|
67
|
+
var Item = renderItem || exports.SelectItem;
|
|
68
|
+
var isValueEmpty = value === null || typeof value === 'undefined';
|
|
69
|
+
var currentOption = isValueEmpty
|
|
70
|
+
? { label: placeholder, value: value }
|
|
71
|
+
: { label: optionLabelMap[value], value: value };
|
|
72
|
+
(0, common_1.onUpdate)(function () {
|
|
73
|
+
onDropdownToggle === null || onDropdownToggle === void 0 ? void 0 : onDropdownToggle(isOpen);
|
|
74
|
+
}, [isOpen]);
|
|
75
|
+
var _e = (0, common_1.useValidate)(value, validate), showError = _e.showError, error = _e.error;
|
|
76
|
+
function getStyles(key, append) {
|
|
77
|
+
if (append === void 0) { append = {}; }
|
|
78
|
+
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
|
+
}
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(exports.InputWrapper, __assign({ currentContent: (0, jsx_runtime_1.jsx)(CurrentContent, __assign({}, currentOption, { onPress: function () { return setOpen(); }, styles: {
|
|
81
|
+
buttonIcon: getStyles('buttonIcon'),
|
|
82
|
+
buttonText: getStyles('buttonText'),
|
|
83
|
+
buttonWrapper: getStyles('buttonWrapper'),
|
|
84
|
+
}, open: isOpen, iconName: arrowIconName || 'selectArrow' })), error: error, styles: {
|
|
85
|
+
wrapper: getStyles('wrapper'),
|
|
86
|
+
label: getStyles('label'),
|
|
87
|
+
inputWrapper: getStyles('inputWrapper'),
|
|
88
|
+
list: getStyles('list'),
|
|
89
|
+
error: getStyles('error'),
|
|
90
|
+
},
|
|
91
|
+
// id={inputId}
|
|
92
|
+
ref: wrapperRef, onHover: setHovering }, props, { children: options.map(function (item) { return ((0, react_1.createElement)(Item, __assign({}, item, { inList: true, onPress: function () {
|
|
93
|
+
if (autoClose) {
|
|
94
|
+
setOpen(false);
|
|
95
|
+
}
|
|
96
|
+
onValueChange(item.value);
|
|
97
|
+
}, selected: item.value === value, key: item.value, styles: {
|
|
98
|
+
itemText: getStyles('itemText', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['itemText:selected'], {}))),
|
|
99
|
+
itemWrapper: getStyles('itemWrapper', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['itemWrapper:selected'], {}))),
|
|
100
|
+
buttonIcon: getStyles('buttonIcon', __assign({}, (0, common_1.optionalObject)(item.value === value, variantStyles['buttonIcon:selected'], {}))),
|
|
101
|
+
} }))); }) })));
|
|
102
|
+
};
|
|
103
|
+
exports.CustomSelect = CustomSelect;
|
|
104
104
|
//# sourceMappingURL=Custom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Custom.js","sourceRoot":"","sources":["../../../src/components/Select/Custom.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAQyB;AACzB,+BAAmD;AACnD,0CAAoD;AACpD,gCAA8B;AAC9B,0CAAwC;AACxC,gCAA8B;AAC9B,gCAA8B;AAC9B,yCAAiD;AAK1C,IAAM,UAAU,GAEnB,UAAC,EAAkD;QAAhD,MAAM,YAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA,EAAE,IAAI,UAAA,EAAE,MAAM,YAAA;IACnD,IAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAA;IAEpC,OAAO,CACL,wBAAC,qBAAS,aACR,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,iBAE1D,OAAO,KAAK,KAAK,QAAQ,CAAC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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;gBACF,UAAU,EAAE,SAAS,CAAC,YAAY,eAC7B,IAAA,uBAAc,EACf,IAAI,CAAC,KAAK,KAAK,KAAK,EACpB,aAAa,CAAC,qBAAqB,CAAC,EACpC,EAAE,CACH,EACD;aACH,IACD,CACH,EApCsB,CAoCtB,CAAC,IACW,CAChB,CAAA;AACH,CAAC,CAAA;AA1IY,QAAA,YAAY,gBA0IxB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
25
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
26
|
+
if (ar || !(i in from)) {
|
|
27
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
28
|
+
ar[i] = from[i];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.MultiSelect = void 0;
|
|
35
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
36
|
+
var common_1 = require("@codeleap/common");
|
|
37
|
+
var react_1 = require("react");
|
|
38
|
+
var hooks_1 = require("../../lib/hooks");
|
|
39
|
+
var Custom_1 = require("./Custom");
|
|
40
|
+
var MultiSelect = function (selectProps) {
|
|
41
|
+
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"]);
|
|
42
|
+
var _b = (0, common_1.useBooleanToggle)(false), isOpen = _b[0], setOpen = _b[1];
|
|
43
|
+
var _c = (0, common_1.useBooleanToggle)(false), isHovering = _c[0], setHovering = _c[1];
|
|
44
|
+
var optionLabelMap = (0, react_1.useMemo)(function () {
|
|
45
|
+
return Object.fromEntries(options.map(function (_a) {
|
|
46
|
+
var label = _a.label, value = _a.value;
|
|
47
|
+
return [value, label];
|
|
48
|
+
}));
|
|
49
|
+
}, [options]);
|
|
50
|
+
var wrapperRef = (0, hooks_1.useClickOutside)(function () {
|
|
51
|
+
if (isOpen) {
|
|
52
|
+
setOpen(false);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Select', {
|
|
56
|
+
styles: styles,
|
|
57
|
+
variants: variants,
|
|
58
|
+
responsiveVariants: responsiveVariants,
|
|
59
|
+
});
|
|
60
|
+
var CurrentContent = renderCurrentlySelected || Custom_1.SelectItem;
|
|
61
|
+
var Item = renderItem || Custom_1.SelectItem;
|
|
62
|
+
var isValueEmpty = value === null || typeof value === 'undefined' || (common_1.TypeGuards.isArray(value) && !value.length);
|
|
63
|
+
var currentOption = isValueEmpty
|
|
64
|
+
? { label: placeholder, value: null }
|
|
65
|
+
: { label: value.map(function (o) { return optionLabelMap[o]; }).join(','), value: null };
|
|
66
|
+
(0, common_1.onUpdate)(function () {
|
|
67
|
+
onDropdownToggle === null || onDropdownToggle === void 0 ? void 0 : onDropdownToggle(isOpen);
|
|
68
|
+
}, [isOpen]);
|
|
69
|
+
var _d = (0, common_1.useValidate)(value, validate), showError = _d.showError, error = _d.error;
|
|
70
|
+
function getStyles(key, append) {
|
|
71
|
+
if (append === void 0) { append = {}; }
|
|
72
|
+
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);
|
|
73
|
+
}
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)(Custom_1.InputWrapper, __assign({ currentContent: (0, jsx_runtime_1.jsx)(CurrentContent, __assign({}, currentOption, { onPress: function () { return setOpen(); }, styles: {
|
|
75
|
+
buttonIcon: getStyles('buttonIcon'),
|
|
76
|
+
buttonText: getStyles('buttonText'),
|
|
77
|
+
buttonWrapper: getStyles('buttonWrapper'),
|
|
78
|
+
}, open: isOpen, iconName: arrowIconName || 'selectArrow' })), error: error, styles: {
|
|
79
|
+
wrapper: getStyles('wrapper'),
|
|
80
|
+
label: getStyles('label'),
|
|
81
|
+
inputWrapper: getStyles('inputWrapper'),
|
|
82
|
+
list: getStyles('list'),
|
|
83
|
+
error: getStyles('error'),
|
|
84
|
+
},
|
|
85
|
+
// id={inputId}
|
|
86
|
+
ref: wrapperRef, onHover: setHovering }, props, { children: options.map(function (item) {
|
|
87
|
+
var isSelected = value.includes(item.value);
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(Item, { value: item.value, label: item.label, inList: true, onPress: function () {
|
|
89
|
+
var newArr = __spreadArray([], value, true);
|
|
90
|
+
if (value.includes(item.value)) {
|
|
91
|
+
newArr = newArr.filter(function (x) { return x !== item.value; });
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
newArr.push(item.value);
|
|
95
|
+
}
|
|
96
|
+
onValueChange(newArr);
|
|
97
|
+
}, selected: isSelected, styles: {
|
|
98
|
+
itemText: getStyles('itemText', __assign({}, (0, common_1.optionalObject)(isSelected, variantStyles['itemText:selected'], {}))),
|
|
99
|
+
itemWrapper: getStyles('itemWrapper', __assign({}, (0, common_1.optionalObject)(isSelected, variantStyles['itemWrapper:selected'], {}))),
|
|
100
|
+
buttonIcon: getStyles('buttonIcon', __assign({}, (0, common_1.optionalObject)(isSelected, variantStyles['buttonIcon:selected'], {}))),
|
|
101
|
+
} }, item.value));
|
|
102
|
+
}) })));
|
|
103
|
+
};
|
|
104
|
+
exports.MultiSelect = MultiSelect;
|
|
105
|
+
//# sourceMappingURL=Multi.js.map
|
|
@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IAAI,MAAM,qBAAO,KAAK,OAAC,CAAA;oBACvB,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;wBAC9B,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,IAAI,CAAC,KAAK,EAAhB,CAAgB,CAAC,CAAA;qBAC9C;yBAAM;wBACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;qBACxB;oBACD,aAAa,CAAC,MAAM,CAAC,CAAA;gBACvB,CAAC,EACD,QAAQ,EAAE,UAAU,EAEpB,MAAM,EAAE;oBACN,QAAQ,EAAE,SAAS,CAAC,UAAU,eACzB,IAAA,uBAAc,EACf,UAAU,EACV,aAAa,CAAC,mBAAmB,CAAC,EAClC,EAAE,CACH,EACD;oBACF,WAAW,EAAE,SAAS,CAAC,aAAa,eAC/B,IAAA,uBAAc,EACf,UAAU,EACV,aAAa,CAAC,sBAAsB,CAAC,EACrC,EAAE,CACH,EACD;oBACF,UAAU,EAAE,SAAS,CAAC,YAAY,eAC7B,IAAA,uBAAc,EACf,UAAU,EACV,aAAa,CAAC,qBAAqB,CAAC,EACpC,EAAE,CACH,EACD;iBACH,IAvBI,IAAI,CAAC,KAAK,CAwBf,CACH,CAAA;QAEH,CAAC,CAAC,IACW,CAChB,CAAA;AACH,CAAC,CAAA;AA/IY,QAAA,WAAW,eA+IvB"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { SelectStyles, ComponentVariants, StylesOf, SelectComposition } from '@codeleap/common';
|
|
2
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
-
import { ViewProps } from '../View';
|
|
4
|
-
declare type HTMLSelectProps = ComponentPropsWithRef<'select'>;
|
|
5
|
-
declare type Option = {
|
|
6
|
-
label: string;
|
|
7
|
-
value: string | number;
|
|
8
|
-
};
|
|
9
|
-
export declare type NativeSelectProps = HTMLSelectProps & {
|
|
10
|
-
options: Array<Option>;
|
|
11
|
-
styles?: StylesOf<SelectComposition>;
|
|
12
|
-
label?: string | ReactNode;
|
|
13
|
-
wrapperProps?: ViewProps<'div'>;
|
|
14
|
-
onValueChange?: (value: string | number) => void;
|
|
15
|
-
} & ComponentVariants<typeof SelectStyles>;
|
|
16
|
-
export declare const NativeSelect: (selectProps: NativeSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
1
|
+
import { SelectStyles, ComponentVariants, StylesOf, SelectComposition } from '@codeleap/common';
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
+
import { ViewProps } from '../View';
|
|
4
|
+
declare type HTMLSelectProps = ComponentPropsWithRef<'select'>;
|
|
5
|
+
declare type Option = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
};
|
|
9
|
+
export declare type NativeSelectProps = HTMLSelectProps & {
|
|
10
|
+
options: Array<Option>;
|
|
11
|
+
styles?: StylesOf<SelectComposition>;
|
|
12
|
+
label?: string | ReactNode;
|
|
13
|
+
wrapperProps?: ViewProps<'div'>;
|
|
14
|
+
onValueChange?: (value: string | number) => void;
|
|
15
|
+
} & ComponentVariants<typeof SelectStyles>;
|
|
16
|
+
export declare const NativeSelect: (selectProps: NativeSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.NativeSelect = void 0;
|
|
26
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
-
var common_1 = require("@codeleap/common");
|
|
28
|
-
var View_1 = require("../View");
|
|
29
|
-
var Text_1 = require("../Text");
|
|
30
|
-
var NativeSelect = function (selectProps) {
|
|
31
|
-
var _a = selectProps.variants, variants = _a === void 0 ? [] : _a, _b = selectProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, options = selectProps.options, styles = selectProps.styles, label = selectProps.label, onValueChange = selectProps.onValueChange, wrapperProps = selectProps.wrapperProps, value = selectProps.value, props = __rest(selectProps, ["variants", "responsiveVariants", "options", "styles", "label", "onValueChange", "wrapperProps", "value"]);
|
|
32
|
-
var variantStyles = (0, common_1.useDefaultComponentStyle)('Select', {
|
|
33
|
-
responsiveVariants: responsiveVariants,
|
|
34
|
-
variants: variants,
|
|
35
|
-
styles: styles,
|
|
36
|
-
});
|
|
37
|
-
function handleChange(e) {
|
|
38
|
-
props.onChange && props.onChange(e);
|
|
39
|
-
onValueChange && onValueChange(e.target.value);
|
|
40
|
-
}
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: variantStyles.wrapper }, wrapperProps, { children: [label ? (typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { css: variantStyles.label, text: label })) : (label)) : null, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ component: 'select', css: variantStyles.select }, props, { onChange: handleChange }, { children: options.map(function (option, index) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: option.value, selected: value == option.value }, { children: option.label }), index)); }) }))] })));
|
|
42
|
-
};
|
|
43
|
-
exports.NativeSelect = NativeSelect;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.NativeSelect = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
27
|
+
var common_1 = require("@codeleap/common");
|
|
28
|
+
var View_1 = require("../View");
|
|
29
|
+
var Text_1 = require("../Text");
|
|
30
|
+
var NativeSelect = function (selectProps) {
|
|
31
|
+
var _a = selectProps.variants, variants = _a === void 0 ? [] : _a, _b = selectProps.responsiveVariants, responsiveVariants = _b === void 0 ? {} : _b, options = selectProps.options, styles = selectProps.styles, label = selectProps.label, onValueChange = selectProps.onValueChange, wrapperProps = selectProps.wrapperProps, value = selectProps.value, props = __rest(selectProps, ["variants", "responsiveVariants", "options", "styles", "label", "onValueChange", "wrapperProps", "value"]);
|
|
32
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Select', {
|
|
33
|
+
responsiveVariants: responsiveVariants,
|
|
34
|
+
variants: variants,
|
|
35
|
+
styles: styles,
|
|
36
|
+
});
|
|
37
|
+
function handleChange(e) {
|
|
38
|
+
props.onChange && props.onChange(e);
|
|
39
|
+
onValueChange && onValueChange(e.target.value);
|
|
40
|
+
}
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ css: variantStyles.wrapper }, wrapperProps, { children: [label ? (typeof label === 'string' ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { css: variantStyles.label, text: label })) : (label)) : null, (0, jsx_runtime_1.jsx)(View_1.View, __assign({ component: 'select', css: variantStyles.select }, props, { onChange: handleChange }, { children: options.map(function (option, index) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: option.value, selected: value == option.value }, { children: option.label }), index)); }) }))] })));
|
|
42
|
+
};
|
|
43
|
+
exports.NativeSelect = NativeSelect;
|
|
44
44
|
//# sourceMappingURL=Native.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { NativeSelectProps } from './Native';
|
|
2
|
-
import { CustomSelectProps } from './types';
|
|
3
|
-
export declare type SelectProps<T extends string | number = string> = ({
|
|
4
|
-
type?: 'native';
|
|
5
|
-
} & NativeSelectProps) | ({
|
|
6
|
-
type?: never;
|
|
7
|
-
} & CustomSelectProps<T>);
|
|
8
|
-
export * from './types';
|
|
9
|
-
export * from './styles';
|
|
10
|
-
export * from './Custom';
|
|
11
|
-
export
|
|
1
|
+
import { NativeSelectProps } from './Native';
|
|
2
|
+
import { CustomSelectProps } from './types';
|
|
3
|
+
export declare type SelectProps<T extends string | number = string> = ({
|
|
4
|
+
type?: 'native';
|
|
5
|
+
} & NativeSelectProps) | ({
|
|
6
|
+
type?: never;
|
|
7
|
+
} & CustomSelectProps<T>);
|
|
8
|
+
export * from './types';
|
|
9
|
+
export * from './styles';
|
|
10
|
+
export * from './Custom';
|
|
11
|
+
export * from './Multi';
|
|
12
|
+
export declare const Select: <T extends string | number = string>(props: SelectProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.Select = void 0;
|
|
29
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
-
var Custom_1 = require("./Custom");
|
|
31
|
-
var Native_1 = require("./Native");
|
|
32
|
-
__exportStar(require("./types"), exports);
|
|
33
|
-
__exportStar(require("./styles"), exports);
|
|
34
|
-
__exportStar(require("./Custom"), exports);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Select = void 0;
|
|
29
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
30
|
+
var Custom_1 = require("./Custom");
|
|
31
|
+
var Native_1 = require("./Native");
|
|
32
|
+
__exportStar(require("./types"), exports);
|
|
33
|
+
__exportStar(require("./styles"), exports);
|
|
34
|
+
__exportStar(require("./Custom"), exports);
|
|
35
|
+
__exportStar(require("./Multi"), exports);
|
|
36
|
+
var Select = function (props) {
|
|
37
|
+
if (props.type === 'native') {
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(Native_1.NativeSelect, __assign({}, props));
|
|
39
|
+
}
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
return (0, jsx_runtime_1.jsx)(Custom_1.CustomSelect, __assign({}, props));
|
|
42
|
+
};
|
|
43
|
+
exports.Select = Select;
|
|
42
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;AACxB,2CAAwB;
|
|
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;AACxB,0CAAuB;AAEhB,IAAM,MAAM,GAAG,UACpB,KAAqB;IAErB,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC3B,OAAO,uBAAC,qBAAY,eAAK,KAAK,EAAI,CAAA;KACnC;IACD,aAAa;IACb,OAAO,uBAAC,qBAAY,eAAK,KAAK,EAAI,CAAA;AACpC,CAAC,CAAA;AARY,QAAA,MAAM,UAQlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare type WebSelectParts = 'wrapper' | 'label' | 'inputWrapper' | 'list' | 'itemWrapper' | 'itemWrapper:selected' | 'itemText' | 'itemText:selected' | 'buttonWrapper' | 'buttonText' | 'buttonIcon' | 'error';
|
|
2
|
-
export declare type WebSelectComposition = `${WebSelectParts}:hover` | `${WebSelectParts}:open` | `${WebSelectParts}:error` | `${WebSelectParts}:disabled` | WebSelectParts;
|
|
3
|
-
export declare const WebSelectStyles: {
|
|
4
|
-
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebSelectComposition, any>>;
|
|
5
|
-
};
|
|
1
|
+
export declare type WebSelectParts = 'wrapper' | 'label' | 'inputWrapper' | 'list' | 'itemWrapper' | 'itemWrapper:selected' | 'itemText' | 'itemText:selected' | 'buttonWrapper' | 'buttonText' | 'buttonIcon' | 'error';
|
|
2
|
+
export declare type WebSelectComposition = `${WebSelectParts}:hover` | `${WebSelectParts}:open` | `${WebSelectParts}:error` | `${WebSelectParts}:disabled` | WebSelectParts;
|
|
3
|
+
export declare const WebSelectStyles: {
|
|
4
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<WebSelectComposition, any>>;
|
|
5
|
+
};
|