@flexmatch-dev/react-ui 0.0.2 → 0.0.3
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/cjs/components/Input/Selectable/InputButtonMultiSelect.d.ts +14 -0
- package/cjs/components/Input/Selectable/InputButtonMultiSelect.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputButtonMultiSelect.js +96 -0
- package/cjs/components/Input/Selectable/InputButtonSelect.d.ts +14 -0
- package/cjs/components/Input/Selectable/InputButtonSelect.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputButtonSelect.js +65 -0
- package/cjs/components/Input/Selectable/InputButtonSelectButton.d.ts +14 -0
- package/cjs/components/Input/Selectable/InputButtonSelectButton.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputButtonSelectButton.js +78 -0
- package/cjs/components/Input/Selectable/InputCardSelect.d.ts +2 -1
- package/cjs/components/Input/Selectable/InputCardSelect.d.ts.map +1 -1
- package/cjs/components/Input/Selectable/InputCardSelect.js +4 -1
- package/cjs/components/Input/Selectable/InputCardSelectButton.d.ts +2 -1
- package/cjs/components/Input/Selectable/InputCardSelectButton.d.ts.map +1 -1
- package/cjs/components/Input/Selectable/InputCardSelectButton.js +4 -2
- package/cjs/components/Input/Selectable/InputRadiobutton.d.ts.map +1 -1
- package/cjs/components/Input/Selectable/InputRadiobutton.js +6 -30
- package/cjs/components/atoms/card-select.ui.d.ts.map +1 -1
- package/cjs/components/atoms/index.d.ts +1 -0
- package/cjs/components/atoms/index.d.ts.map +1 -1
- package/cjs/components/atoms/index.js +7 -0
- package/cjs/components/atoms/radio.ui.d.ts +14 -0
- package/cjs/components/atoms/radio.ui.d.ts.map +1 -0
- package/cjs/components/atoms/radio.ui.js +52 -0
- package/cjs/components/atoms/textbox.ui.d.ts +2 -1
- package/cjs/components/atoms/textbox.ui.d.ts.map +1 -1
- package/cjs/components/atoms/textbox.ui.js +11 -8
- package/cjs/context/Input.d.ts +10 -0
- package/cjs/context/Input.d.ts.map +1 -1
- package/cjs/index.d.ts +3 -0
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +21 -0
- package/dist/index.css +74 -10
- package/lib/components/Input/Selectable/InputButtonMultiSelect.d.ts +14 -0
- package/lib/components/Input/Selectable/InputButtonMultiSelect.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputButtonMultiSelect.js +89 -0
- package/lib/components/Input/Selectable/InputButtonSelect.d.ts +14 -0
- package/lib/components/Input/Selectable/InputButtonSelect.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputButtonSelect.js +58 -0
- package/lib/components/Input/Selectable/InputButtonSelectButton.d.ts +14 -0
- package/lib/components/Input/Selectable/InputButtonSelectButton.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputButtonSelectButton.js +71 -0
- package/lib/components/Input/Selectable/InputCardSelect.d.ts +2 -1
- package/lib/components/Input/Selectable/InputCardSelect.d.ts.map +1 -1
- package/lib/components/Input/Selectable/InputCardSelect.js +4 -1
- package/lib/components/Input/Selectable/InputCardSelectButton.d.ts +2 -1
- package/lib/components/Input/Selectable/InputCardSelectButton.d.ts.map +1 -1
- package/lib/components/Input/Selectable/InputCardSelectButton.js +4 -2
- package/lib/components/Input/Selectable/InputRadiobutton.d.ts.map +1 -1
- package/lib/components/Input/Selectable/InputRadiobutton.js +7 -31
- package/lib/components/atoms/card-select.ui.d.ts.map +1 -1
- package/lib/components/atoms/index.d.ts +1 -0
- package/lib/components/atoms/index.d.ts.map +1 -1
- package/lib/components/atoms/index.js +2 -1
- package/lib/components/atoms/radio.ui.d.ts +14 -0
- package/lib/components/atoms/radio.ui.d.ts.map +1 -0
- package/lib/components/atoms/radio.ui.js +45 -0
- package/lib/components/atoms/textbox.ui.d.ts +2 -1
- package/lib/components/atoms/textbox.ui.d.ts.map +1 -1
- package/lib/components/atoms/textbox.ui.js +11 -8
- package/lib/context/Input.d.ts +10 -0
- package/lib/context/Input.d.ts.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputMultiSelectableProps, InputSelectableExtraOption } from '@/context/Input';
|
|
2
|
+
export interface InputButtonMultiSelectProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputMultiSelectableProps<T> {
|
|
3
|
+
id?: string | undefined;
|
|
4
|
+
title?: string | undefined;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
extraOptions: InputSelectableExtraOption<T>[];
|
|
7
|
+
size?: 'small' | 'normal';
|
|
8
|
+
}
|
|
9
|
+
declare const InputButtonMultiSelect: {
|
|
10
|
+
<T>({ id, className, options, size, value, onChange, title, description, extraOptions, ...props }: InputButtonMultiSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default InputButtonMultiSelect;
|
|
14
|
+
//# sourceMappingURL=InputButtonMultiSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputButtonMultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputButtonMultiSelect.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAIxF,MAAM,WAAW,2BAA2B,CAAC,CAAC,CAC5C,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC;IAC5F,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AACD,QAAA,MAAM,sBAAsB;KAAI,CAAC,iGAW9B,2BAA2B,CAAC,CAAC,CAAC;;CAqDhC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _InputButtonSelectButton = _interopRequireDefault(require("./InputButtonSelectButton"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _excluded = ["id", "className", "options", "size", "value", "onChange", "title", "description", "extraOptions"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
20
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
+
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; } }
|
|
22
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
23
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
var InputButtonMultiSelect = function InputButtonMultiSelect(_ref) {
|
|
28
|
+
var id = _ref.id,
|
|
29
|
+
className = _ref.className,
|
|
30
|
+
options = _ref.options,
|
|
31
|
+
_ref$size = _ref.size,
|
|
32
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
33
|
+
value = _ref.value,
|
|
34
|
+
onChange = _ref.onChange,
|
|
35
|
+
title = _ref.title,
|
|
36
|
+
description = _ref.description,
|
|
37
|
+
extraOptions = _ref.extraOptions,
|
|
38
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
+
var trueOptions = (0, _react.useMemo)(function () {
|
|
40
|
+
return options.filter(function (option) {
|
|
41
|
+
return option.value !== '*';
|
|
42
|
+
}).map(function (_ref2) {
|
|
43
|
+
var value = _ref2.value;
|
|
44
|
+
return value;
|
|
45
|
+
});
|
|
46
|
+
}, [options]);
|
|
47
|
+
var handleSelect = (0, _react.useCallback)(function (eventKey) {
|
|
48
|
+
if (eventKey !== null) {
|
|
49
|
+
var option = options.find(function (opt) {
|
|
50
|
+
return String(opt.value) === String(eventKey);
|
|
51
|
+
});
|
|
52
|
+
if (option && onChange) {
|
|
53
|
+
if (option.value === '*') {
|
|
54
|
+
if ((value === null || value === void 0 ? void 0 : value.length) === trueOptions.length) {
|
|
55
|
+
onChange([]);
|
|
56
|
+
} else {
|
|
57
|
+
onChange(trueOptions);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
var isSelected = value === null || value === void 0 ? void 0 : value.includes(option.value);
|
|
61
|
+
if (isSelected) {
|
|
62
|
+
var _value$filter;
|
|
63
|
+
onChange((_value$filter = value === null || value === void 0 ? void 0 : value.filter(function (v) {
|
|
64
|
+
return v !== option.value;
|
|
65
|
+
})) !== null && _value$filter !== void 0 ? _value$filter : []);
|
|
66
|
+
} else {
|
|
67
|
+
onChange([].concat(_toConsumableArray(value !== null && value !== void 0 ? value : []), [option.value]));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, [options, onChange, value, trueOptions]);
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
|
|
74
|
+
id: id,
|
|
75
|
+
className: (0, _clsx["default"])(className, 'flexmatch-button-select-container')
|
|
76
|
+
}, props), {}, {
|
|
77
|
+
children: options.map(function (option) {
|
|
78
|
+
var extraOption = extraOptions.find(function (opt) {
|
|
79
|
+
return opt.value === option.value;
|
|
80
|
+
});
|
|
81
|
+
var isSelected = option.value === '*' ? (value === null || value === void 0 ? void 0 : value.length) === trueOptions.length : value === null || value === void 0 ? void 0 : value.includes(option.value);
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputButtonSelectButton["default"], {
|
|
83
|
+
size: size,
|
|
84
|
+
disabled: option.disabled,
|
|
85
|
+
isSelected: isSelected,
|
|
86
|
+
eventKey: String(option.value),
|
|
87
|
+
onSelect: handleSelect,
|
|
88
|
+
title: option.label,
|
|
89
|
+
description: extraOption === null || extraOption === void 0 ? void 0 : extraOption.description,
|
|
90
|
+
icon: extraOption === null || extraOption === void 0 ? void 0 : extraOption.icon
|
|
91
|
+
}, String(option.value));
|
|
92
|
+
})
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
InputButtonMultiSelect.displayName = 'InputButtonMultiSelect';
|
|
96
|
+
var _default = exports["default"] = InputButtonMultiSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputSelectableExtraOption, InputSelectableProps } from '@/context/Input';
|
|
2
|
+
export interface InputButtonSelectProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputSelectableProps<T> {
|
|
3
|
+
id?: string | undefined;
|
|
4
|
+
title?: string | undefined;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
extraOptions: InputSelectableExtraOption<T>[];
|
|
7
|
+
size?: 'small' | 'normal';
|
|
8
|
+
}
|
|
9
|
+
declare const InputButtonSelect: {
|
|
10
|
+
<T>({ id, className, options, size, value, onChange, title, description, extraOptions, ...props }: InputButtonSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default InputButtonSelect;
|
|
14
|
+
//# sourceMappingURL=InputButtonSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputButtonSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputButtonSelect.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAInF,MAAM,WAAW,sBAAsB,CAAC,CAAC,CACvC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AACD,QAAA,MAAM,iBAAiB;KAAI,CAAC,iGAWzB,sBAAsB,CAAC,CAAC,CAAC;;CAiC3B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _InputButtonSelectButton = _interopRequireDefault(require("./InputButtonSelectButton"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _excluded = ["id", "className", "options", "size", "value", "onChange", "title", "description", "extraOptions"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
var InputButtonSelect = function InputButtonSelect(_ref) {
|
|
22
|
+
var id = _ref.id,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
options = _ref.options,
|
|
25
|
+
_ref$size = _ref.size,
|
|
26
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
27
|
+
value = _ref.value,
|
|
28
|
+
onChange = _ref.onChange,
|
|
29
|
+
title = _ref.title,
|
|
30
|
+
description = _ref.description,
|
|
31
|
+
extraOptions = _ref.extraOptions,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
var handleSelect = (0, _react.useCallback)(function (eventKey) {
|
|
34
|
+
if (eventKey !== null) {
|
|
35
|
+
var option = options.find(function (opt) {
|
|
36
|
+
return String(opt.value) === String(eventKey);
|
|
37
|
+
});
|
|
38
|
+
if (option && onChange) {
|
|
39
|
+
onChange(option.value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, [options, onChange]);
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
|
|
44
|
+
id: id,
|
|
45
|
+
className: (0, _clsx["default"])(className, 'flexmatch-button-select-container')
|
|
46
|
+
}, props), {}, {
|
|
47
|
+
children: options.map(function (option) {
|
|
48
|
+
var extraOption = extraOptions.find(function (opt) {
|
|
49
|
+
return opt.value === option.value;
|
|
50
|
+
});
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputButtonSelectButton["default"], {
|
|
52
|
+
size: size,
|
|
53
|
+
disabled: option.disabled,
|
|
54
|
+
isSelected: option.value === value,
|
|
55
|
+
eventKey: String(option.value),
|
|
56
|
+
onSelect: handleSelect,
|
|
57
|
+
title: option.label,
|
|
58
|
+
description: extraOption === null || extraOption === void 0 ? void 0 : extraOption.description,
|
|
59
|
+
icon: extraOption === null || extraOption === void 0 ? void 0 : extraOption.icon
|
|
60
|
+
}, String(option.value));
|
|
61
|
+
})
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
InputButtonSelect.displayName = 'InputButtonSelect';
|
|
65
|
+
var _default = exports["default"] = InputButtonSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface InputButtonSelectButtonProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onSelect'> {
|
|
2
|
+
size?: 'small' | 'normal';
|
|
3
|
+
title?: string | undefined;
|
|
4
|
+
icon?: React.ReactNode | undefined;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
isSelected?: boolean | undefined;
|
|
8
|
+
eventKey?: string | number | null | undefined;
|
|
9
|
+
onSelect?: ((eventKey: string | number | null, event: React.SyntheticEvent<HTMLButtonElement>) => void) | undefined;
|
|
10
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
11
|
+
}
|
|
12
|
+
declare const InputButtonSelectButton: ({ title, size, icon, description, disabled, isSelected, eventKey, onSelect, onClick, children, className, ...props }: InputButtonSelectButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default InputButtonSelectButton;
|
|
14
|
+
//# sourceMappingURL=InputButtonSelectButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputButtonSelectButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputButtonSelectButton.tsx"],"names":[],"mappings":"AAKA,UAAU,4BAA6B,SAAQ,IAAI,CACjD,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,EACvC,UAAU,CACX;IACC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAEnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,EACL,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC,GAC5F,SAAS,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;CAClE;AAED,QAAA,MAAM,uBAAuB,GAAI,sHAa9B,4BAA4B,4CAgE9B,CAAC;AACF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _atoms = require("../../atoms");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _excluded = ["title", "size", "icon", "description", "disabled", "isSelected", "eventKey", "onSelect", "onClick", "children", "className"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
var InputButtonSelectButton = function InputButtonSelectButton(_ref) {
|
|
22
|
+
var title = _ref.title,
|
|
23
|
+
_ref$size = _ref.size,
|
|
24
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
25
|
+
icon = _ref.icon,
|
|
26
|
+
description = _ref.description,
|
|
27
|
+
disabled = _ref.disabled,
|
|
28
|
+
isSelected = _ref.isSelected,
|
|
29
|
+
eventKey = _ref.eventKey,
|
|
30
|
+
onSelect = _ref.onSelect,
|
|
31
|
+
onClick = _ref.onClick,
|
|
32
|
+
children = _ref.children,
|
|
33
|
+
className = _ref.className,
|
|
34
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
var handleClick = (0, _react.useCallback)(function (e) {
|
|
36
|
+
if (disabled) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (onClick) {
|
|
42
|
+
onClick(e);
|
|
43
|
+
}
|
|
44
|
+
if (!e.defaultPrevented) {
|
|
45
|
+
if (onSelect) {
|
|
46
|
+
onSelect(eventKey !== null && eventKey !== void 0 ? eventKey : null, e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, [disabled, onClick, onSelect, eventKey]);
|
|
50
|
+
var handleKeyDown = (0, _react.useCallback)(function (e) {
|
|
51
|
+
if (disabled) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
if (onClick) {
|
|
59
|
+
onClick(e);
|
|
60
|
+
}
|
|
61
|
+
if (!e.defaultPrevented) {
|
|
62
|
+
if (onSelect) {
|
|
63
|
+
onSelect(eventKey !== null && eventKey !== void 0 ? eventKey : null, e);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, [disabled, onClick, onSelect, eventKey]);
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_atoms.ButtonUI, _objectSpread(_objectSpread({
|
|
69
|
+
className: (0, _clsx["default"])('flexmatch-button-select-button-container', className, isSelected && 'selected', size === 'small' && 'small', size === 'normal' && 'normal'),
|
|
70
|
+
onClick: handleClick,
|
|
71
|
+
onKeyDown: handleKeyDown,
|
|
72
|
+
tabIndex: disabled ? -1 : 0,
|
|
73
|
+
"aria-disabled": disabled
|
|
74
|
+
}, props), {}, {
|
|
75
|
+
children: [icon, title]
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
var _default = exports["default"] = InputButtonSelectButton;
|
|
@@ -4,9 +4,10 @@ export interface InputCardSelectProps<T> extends Omit<React.HTMLAttributes<HTMLD
|
|
|
4
4
|
title?: string | undefined;
|
|
5
5
|
description?: string | undefined;
|
|
6
6
|
extraOptions: InputSelectableExtraOption<T>[];
|
|
7
|
+
size?: 'small' | 'normal';
|
|
7
8
|
}
|
|
8
9
|
declare const InputCardSelect: {
|
|
9
|
-
<T>({ id, className, options, value, onChange, title, description, extraOptions, ...props }: InputCardSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
<T>({ id, className, options, size, value, onChange, title, description, extraOptions, ...props }: InputCardSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
displayName: string;
|
|
11
12
|
};
|
|
12
13
|
export default InputCardSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputCardSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCardSelect.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAInF,MAAM,WAAW,oBAAoB,CAAC,CAAC,CACrC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"InputCardSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCardSelect.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAInF,MAAM,WAAW,oBAAoB,CAAC,CAAC,CACrC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AACD,QAAA,MAAM,eAAe;KAAI,CAAC,iGAWvB,oBAAoB,CAAC,CAAC,CAAC;;CAiCzB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -9,7 +9,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _InputCardSelectButton = _interopRequireDefault(require("./InputCardSelectButton"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _excluded = ["id", "className", "options", "value", "onChange", "title", "description", "extraOptions"];
|
|
12
|
+
var _excluded = ["id", "className", "options", "size", "value", "onChange", "title", "description", "extraOptions"];
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -22,6 +22,8 @@ var InputCardSelect = function InputCardSelect(_ref) {
|
|
|
22
22
|
var id = _ref.id,
|
|
23
23
|
className = _ref.className,
|
|
24
24
|
options = _ref.options,
|
|
25
|
+
_ref$size = _ref.size,
|
|
26
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
25
27
|
value = _ref.value,
|
|
26
28
|
onChange = _ref.onChange,
|
|
27
29
|
title = _ref.title,
|
|
@@ -47,6 +49,7 @@ var InputCardSelect = function InputCardSelect(_ref) {
|
|
|
47
49
|
return opt.value === option.value;
|
|
48
50
|
});
|
|
49
51
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputCardSelectButton["default"], {
|
|
52
|
+
size: size,
|
|
50
53
|
disabled: option.disabled,
|
|
51
54
|
isSelected: option.value === value,
|
|
52
55
|
eventKey: String(option.value),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
interface InputCardSelectButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
2
|
+
size?: 'small' | 'normal';
|
|
2
3
|
title?: string | undefined;
|
|
3
4
|
icon?: React.ReactNode | undefined;
|
|
4
5
|
description?: string | undefined;
|
|
@@ -8,6 +9,6 @@ interface InputCardSelectButtonProps extends Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
8
9
|
onSelect?: ((eventKey: string | number | null, event: React.SyntheticEvent<HTMLElement>) => void) | undefined;
|
|
9
10
|
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
10
11
|
}
|
|
11
|
-
declare const InputCardSelectButton:
|
|
12
|
+
declare const InputCardSelectButton: ({ title, size, icon, description, disabled, isSelected, eventKey, onSelect, onClick, children, className, ...props }: InputCardSelectButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export default InputCardSelectButton;
|
|
13
14
|
//# sourceMappingURL=InputCardSelectButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputCardSelectButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCardSelectButton.tsx"],"names":[],"mappings":"AAUA,UAAU,0BAA2B,SAAQ,IAAI,CAC/C,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX;IACC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAEnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,EACL,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,GACtF,SAAS,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC/D;AAED,QAAA,MAAM,qBAAqB,GAAI,
|
|
1
|
+
{"version":3,"file":"InputCardSelectButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCardSelectButton.tsx"],"names":[],"mappings":"AAUA,UAAU,0BAA2B,SAAQ,IAAI,CAC/C,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX;IACC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAEnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,EACL,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,GACtF,SAAS,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC/D;AAED,QAAA,MAAM,qBAAqB,GAAI,sHAa5B,0BAA0B,4CAgE5B,CAAC;AACF,eAAe,qBAAqB,CAAC"}
|
|
@@ -9,7 +9,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _cardSelect = require("../../atoms/card-select.ui");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _excluded = ["title", "icon", "description", "disabled", "isSelected", "eventKey", "onSelect", "onClick", "children", "className"];
|
|
12
|
+
var _excluded = ["title", "size", "icon", "description", "disabled", "isSelected", "eventKey", "onSelect", "onClick", "children", "className"];
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -20,6 +20,8 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
20
20
|
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; }
|
|
21
21
|
var InputCardSelectButton = function InputCardSelectButton(_ref) {
|
|
22
22
|
var title = _ref.title,
|
|
23
|
+
_ref$size = _ref.size,
|
|
24
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
23
25
|
icon = _ref.icon,
|
|
24
26
|
description = _ref.description,
|
|
25
27
|
disabled = _ref.disabled,
|
|
@@ -64,7 +66,7 @@ var InputCardSelectButton = function InputCardSelectButton(_ref) {
|
|
|
64
66
|
}
|
|
65
67
|
}, [disabled, onClick, onSelect, eventKey]);
|
|
66
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_cardSelect.CardSelectContainerUI, _objectSpread(_objectSpread({
|
|
67
|
-
className: (0, _clsx["default"])(className, isSelected && 'selected'),
|
|
69
|
+
className: (0, _clsx["default"])(className, isSelected && 'selected', size === 'small' && 'small', size === 'normal' && 'normal'),
|
|
68
70
|
onClick: handleClick,
|
|
69
71
|
onKeyDown: handleKeyDown,
|
|
70
72
|
tabIndex: disabled ? -1 : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputRadiobutton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputRadiobutton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputRadiobutton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputRadiobutton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,qBAAqB,CAAC,CAAC,CACtC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,QAAA,MAAM,gBAAgB;KAAI,CAAC,gDAMxB,qBAAqB,CAAC,CAAC,CAAC;;CA2B1B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
7
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _atoms = require("../../atoms");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
12
|
var InputRadiobutton = function InputRadiobutton(_ref) {
|
|
@@ -14,16 +15,6 @@ var InputRadiobutton = function InputRadiobutton(_ref) {
|
|
|
14
15
|
options = _ref.options,
|
|
15
16
|
value = _ref.value,
|
|
16
17
|
onChange = _ref.onChange;
|
|
17
|
-
var handleSelect = (0, _react.useCallback)(function (eventKey) {
|
|
18
|
-
if (eventKey !== null) {
|
|
19
|
-
var option = options.find(function (opt) {
|
|
20
|
-
return String(opt.value) === String(eventKey);
|
|
21
|
-
});
|
|
22
|
-
if (option && onChange) {
|
|
23
|
-
onChange(option.value);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}, [options, onChange]);
|
|
27
18
|
var handleClick = (0, _react.useCallback)(function (eventKey) {
|
|
28
19
|
if (eventKey !== null) {
|
|
29
20
|
var option = options.find(function (opt) {
|
|
@@ -38,29 +29,14 @@ var InputRadiobutton = function InputRadiobutton(_ref) {
|
|
|
38
29
|
id: id,
|
|
39
30
|
className: (0, _clsx["default"])(className, 'flexmatch-radiobutton-container'),
|
|
40
31
|
children: options.map(function (option) {
|
|
41
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.RadioUI, {
|
|
42
33
|
className: 'flexmatch-radiobutton-item',
|
|
43
34
|
onClick: function onClick() {
|
|
44
35
|
return !option.disabled && handleClick(String(option.value));
|
|
45
36
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
checked: option.value === value,
|
|
50
|
-
disabled: !!option.disabled,
|
|
51
|
-
onChange: function onChange() {
|
|
52
|
-
return handleSelect(String(option.value));
|
|
53
|
-
},
|
|
54
|
-
className: 'flexmatch-radiobutton-input'
|
|
55
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
56
|
-
className: (0, _clsx["default"])('flexmatch-radiobutton-icon', option.value === value && 'checked'),
|
|
57
|
-
children: option.value === value && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
|
-
className: 'flexmatch-radiobutton-icon-checked'
|
|
59
|
-
})
|
|
60
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
61
|
-
className: (0, _clsx["default"])('text-b2 flexmatch-radiobutton-label', option.disabled && 'disabled'),
|
|
62
|
-
children: option.label
|
|
63
|
-
})]
|
|
37
|
+
checked: option.value === value,
|
|
38
|
+
disabled: !!option.disabled,
|
|
39
|
+
children: option.label
|
|
64
40
|
}, String(option.value));
|
|
65
41
|
})
|
|
66
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-select.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/card-select.ui.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"card-select.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/card-select.ui.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,eAAO,MAAM,qBAAqB,GAAI,mCAInC,cAAc,CAAC,cAAc,CAAC,4CAMhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,mCAI9B,cAAc,CAAC,cAAc,CAAC,4CAMhC,CAAC;AACF,UAAU,wBAAyB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,eAAO,MAAM,mBAAmB,GAAI,6CAKjC,wBAAwB,4CAW1B,CAAC;AACF,UAAU,8BAA+B,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,eAAO,MAAM,yBAAyB,GAAI,qCAIvC,8BAA8B,4CAShC,CAAC"}
|
|
@@ -5,4 +5,5 @@ export { default as TextboxUI } from './textbox.ui';
|
|
|
5
5
|
export { default as TextareaUI } from './textarea.ui';
|
|
6
6
|
export { default as InfoCardUI } from './info-card.ui';
|
|
7
7
|
export { default as SelectBoxUI } from './select.ui';
|
|
8
|
+
export { default as RadioUI } from './radio.ui';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "InfoCardUI", {
|
|
|
27
27
|
return _infoCard["default"];
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "RadioUI", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _radio["default"];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "SelectBoxUI", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function get() {
|
|
@@ -52,4 +58,5 @@ var _textbox = _interopRequireDefault(require("./textbox.ui"));
|
|
|
52
58
|
var _textarea = _interopRequireDefault(require("./textarea.ui"));
|
|
53
59
|
var _infoCard = _interopRequireDefault(require("./info-card.ui"));
|
|
54
60
|
var _select = _interopRequireDefault(require("./select.ui"));
|
|
61
|
+
var _radio = _interopRequireDefault(require("./radio.ui"));
|
|
55
62
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
interface RadioItemUIProps extends HTMLAttributes<HTMLInputElement> {
|
|
3
|
+
id?: string | undefined;
|
|
4
|
+
value?: string | number | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
checked?: boolean | undefined;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const RadioUI: {
|
|
10
|
+
({ id, value, disabled, checked, onClick, children, className, ...props }: RadioItemUIProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default RadioUI;
|
|
14
|
+
//# sourceMappingURL=radio.ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/radio.ui.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,gBAAiB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AACD,QAAA,MAAM,OAAO;+EASV,gBAAgB;;CAuBlB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
var _excluded = ["id", "value", "disabled", "checked", "onClick", "children", "className"];
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
var RadioUI = function RadioUI(_ref) {
|
|
20
|
+
var id = _ref.id,
|
|
21
|
+
value = _ref.value,
|
|
22
|
+
disabled = _ref.disabled,
|
|
23
|
+
checked = _ref.checked,
|
|
24
|
+
_onClick = _ref.onClick,
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
29
|
+
className: (0, _clsx["default"])('flexmatch-radiobutton-item', className),
|
|
30
|
+
onClick: function onClick() {
|
|
31
|
+
return !disabled && (_onClick === null || _onClick === void 0 ? void 0 : _onClick());
|
|
32
|
+
},
|
|
33
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread({}, props), {}, {
|
|
34
|
+
type: "radio",
|
|
35
|
+
name: id,
|
|
36
|
+
readOnly: true,
|
|
37
|
+
checked: checked,
|
|
38
|
+
disabled: !!disabled,
|
|
39
|
+
className: 'flexmatch-radiobutton-input'
|
|
40
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
41
|
+
className: (0, _clsx["default"])('flexmatch-radiobutton-icon', checked && 'checked'),
|
|
42
|
+
children: checked && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
43
|
+
className: 'flexmatch-radiobutton-icon-checked'
|
|
44
|
+
})
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
46
|
+
className: (0, _clsx["default"])('text-b2 flexmatch-radiobutton-label', disabled && 'disabled'),
|
|
47
|
+
children: children
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
RadioUI.displayName = 'RadioContainerUI';
|
|
52
|
+
var _default = exports["default"] = RadioUI;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface TextboxUIProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
-
label?: string;
|
|
2
|
+
label?: string | React.ReactNode | undefined;
|
|
3
3
|
error?: boolean;
|
|
4
4
|
height?: string | number | undefined;
|
|
5
|
+
labelSide?: 'left' | 'right';
|
|
5
6
|
}
|
|
6
7
|
declare const TextboxUI: import("react").ForwardRefExoticComponent<TextboxUIProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
7
8
|
export default TextboxUI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textbox.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/textbox.ui.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAe,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"textbox.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/textbox.ui.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAe,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAC1E,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AACD,QAAA,MAAM,SAAS,6GAsDd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|