@flexmatch-dev/react-ui 0.0.1 → 0.0.2
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/assets/icon-check.d.ts +7 -0
- package/cjs/assets/icon-check.d.ts.map +1 -0
- package/cjs/assets/icon-check.js +28 -0
- package/cjs/assets/icon-close.d.ts +3 -0
- package/cjs/assets/icon-close.d.ts.map +1 -0
- package/cjs/assets/icon-close.js +24 -0
- package/cjs/assets/icon-selectbox-arrow.d.ts +7 -0
- package/cjs/assets/icon-selectbox-arrow.d.ts.map +1 -0
- package/cjs/assets/icon-selectbox-arrow.js +28 -0
- package/cjs/assets/index.d.ts +4 -0
- package/cjs/assets/index.d.ts.map +1 -0
- package/cjs/assets/index.js +27 -0
- package/cjs/components/Input/Chip/InputChipButton.d.ts +5 -0
- package/cjs/components/Input/Chip/InputChipButton.d.ts.map +1 -0
- package/cjs/components/Input/Chip/InputChipButton.js +31 -0
- package/cjs/components/Input/Chip/InputChipRow.d.ts +13 -0
- package/cjs/components/Input/Chip/InputChipRow.d.ts.map +1 -0
- package/cjs/components/Input/Chip/InputChipRow.js +96 -0
- package/cjs/components/Input/Chip/InputTextbox.d.ts +5 -0
- package/cjs/components/Input/Chip/InputTextbox.d.ts.map +1 -0
- package/cjs/components/Input/Chip/InputTextbox.js +30 -0
- package/cjs/components/Input/Chip/index.d.ts +15 -0
- package/cjs/components/Input/Chip/index.d.ts.map +1 -0
- package/cjs/components/Input/Chip/index.js +17 -0
- package/cjs/components/Input/Selectable/InputCardSelect.d.ts +13 -0
- package/cjs/components/Input/Selectable/InputCardSelect.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputCardSelect.js +62 -0
- package/cjs/components/Input/Selectable/InputCardSelectButton.d.ts +13 -0
- package/cjs/components/Input/Selectable/InputCardSelectButton.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputCardSelectButton.js +83 -0
- package/cjs/components/Input/Selectable/InputCheckbox.d.ts +11 -0
- package/cjs/components/Input/Selectable/InputCheckbox.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputCheckbox.js +43 -0
- package/cjs/components/Input/Selectable/InputOptionSwitch.d.ts.map +1 -1
- package/cjs/components/Input/Selectable/InputOptionSwitch.js +5 -2
- package/cjs/components/Input/Selectable/InputOptionSwitchButton.d.ts +2 -1
- package/cjs/components/Input/Selectable/InputOptionSwitchButton.d.ts.map +1 -1
- package/cjs/components/Input/Selectable/InputOptionSwitchButton.js +5 -1
- package/cjs/components/Input/Selectable/InputRadiobutton.d.ts +10 -0
- package/cjs/components/Input/Selectable/InputRadiobutton.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputRadiobutton.js +69 -0
- package/cjs/components/Input/Selectable/InputSelectbox.d.ts +12 -0
- package/cjs/components/Input/Selectable/InputSelectbox.d.ts.map +1 -0
- package/cjs/components/Input/Selectable/InputSelectbox.js +92 -0
- package/cjs/components/atoms/button.ui.d.ts +6 -0
- package/cjs/components/atoms/button.ui.d.ts.map +1 -0
- package/cjs/components/atoms/button.ui.js +31 -0
- package/cjs/components/atoms/card-select.ui.d.ts +14 -0
- package/cjs/components/atoms/card-select.ui.d.ts.map +1 -0
- package/cjs/components/atoms/card-select.ui.js +72 -0
- package/cjs/components/atoms/checkbox.ui.d.ts +9 -0
- package/cjs/components/atoms/checkbox.ui.d.ts.map +1 -0
- package/cjs/components/atoms/checkbox.ui.js +86 -0
- package/cjs/components/atoms/chip.ui.d.ts +10 -0
- package/cjs/components/atoms/chip.ui.d.ts.map +1 -0
- package/cjs/components/atoms/chip.ui.js +35 -0
- package/cjs/components/atoms/index.d.ts +8 -0
- package/cjs/components/atoms/index.d.ts.map +1 -0
- package/cjs/components/atoms/index.js +55 -0
- package/cjs/components/atoms/info-card.ui.d.ts +7 -0
- package/cjs/components/atoms/info-card.ui.d.ts.map +1 -0
- package/cjs/components/atoms/info-card.ui.js +36 -0
- package/cjs/components/atoms/select.ui.d.ts +19 -0
- package/cjs/components/atoms/select.ui.d.ts.map +1 -0
- package/cjs/components/atoms/select.ui.js +87 -0
- package/cjs/components/atoms/textarea.ui.d.ts +5 -0
- package/cjs/components/atoms/textarea.ui.d.ts.map +1 -0
- package/cjs/components/atoms/textarea.ui.js +33 -0
- package/cjs/components/atoms/textbox.ui.d.ts +5 -1
- package/cjs/components/atoms/textbox.ui.d.ts.map +1 -1
- package/cjs/components/atoms/textbox.ui.js +51 -7
- package/cjs/constant/chip.constant.d.ts +5 -0
- package/cjs/constant/chip.constant.d.ts.map +1 -0
- package/cjs/constant/chip.constant.js +10 -0
- package/cjs/context/Input.d.ts +5 -0
- package/cjs/context/Input.d.ts.map +1 -1
- package/cjs/index.d.ts +9 -1
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +56 -16
- package/dist/index.css +1019 -3
- package/lib/assets/icon-check.d.ts +7 -0
- package/lib/assets/icon-check.d.ts.map +1 -0
- package/lib/assets/icon-check.js +22 -0
- package/lib/assets/icon-close.d.ts +3 -0
- package/lib/assets/icon-close.d.ts.map +1 -0
- package/lib/assets/icon-close.js +18 -0
- package/lib/assets/icon-selectbox-arrow.d.ts +7 -0
- package/lib/assets/icon-selectbox-arrow.d.ts.map +1 -0
- package/lib/assets/icon-selectbox-arrow.js +22 -0
- package/lib/assets/index.d.ts +4 -0
- package/lib/assets/index.d.ts.map +1 -0
- package/lib/assets/index.js +3 -0
- package/lib/components/Input/Chip/InputChipButton.d.ts +5 -0
- package/lib/components/Input/Chip/InputChipButton.d.ts.map +1 -0
- package/lib/components/Input/Chip/InputChipButton.js +24 -0
- package/lib/components/Input/Chip/InputChipRow.d.ts +13 -0
- package/lib/components/Input/Chip/InputChipRow.d.ts.map +1 -0
- package/lib/components/Input/Chip/InputChipRow.js +89 -0
- package/lib/components/Input/Chip/InputTextbox.d.ts +5 -0
- package/lib/components/Input/Chip/InputTextbox.d.ts.map +1 -0
- package/lib/components/Input/Chip/InputTextbox.js +23 -0
- package/lib/components/Input/Chip/index.d.ts +15 -0
- package/lib/components/Input/Chip/index.d.ts.map +1 -0
- package/lib/components/Input/Chip/index.js +10 -0
- package/lib/components/Input/Selectable/InputCardSelect.d.ts +13 -0
- package/lib/components/Input/Selectable/InputCardSelect.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputCardSelect.js +55 -0
- package/lib/components/Input/Selectable/InputCardSelectButton.d.ts +13 -0
- package/lib/components/Input/Selectable/InputCardSelectButton.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputCardSelectButton.js +76 -0
- package/lib/components/Input/Selectable/InputCheckbox.d.ts +11 -0
- package/lib/components/Input/Selectable/InputCheckbox.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputCheckbox.js +37 -0
- package/lib/components/Input/Selectable/InputOptionSwitch.d.ts.map +1 -1
- package/lib/components/Input/Selectable/InputOptionSwitch.js +6 -2
- package/lib/components/Input/Selectable/InputOptionSwitchButton.d.ts +2 -1
- package/lib/components/Input/Selectable/InputOptionSwitchButton.d.ts.map +1 -1
- package/lib/components/Input/Selectable/InputOptionSwitchButton.js +4 -1
- package/lib/components/Input/Selectable/InputRadiobutton.d.ts +10 -0
- package/lib/components/Input/Selectable/InputRadiobutton.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputRadiobutton.js +62 -0
- package/lib/components/Input/Selectable/InputSelectbox.d.ts +12 -0
- package/lib/components/Input/Selectable/InputSelectbox.d.ts.map +1 -0
- package/lib/components/Input/Selectable/InputSelectbox.js +85 -0
- package/lib/components/atoms/button.ui.d.ts +6 -0
- package/lib/components/atoms/button.ui.d.ts.map +1 -0
- package/lib/components/atoms/button.ui.js +24 -0
- package/lib/components/atoms/card-select.ui.d.ts +14 -0
- package/lib/components/atoms/card-select.ui.d.ts.map +1 -0
- package/lib/components/atoms/card-select.ui.js +65 -0
- package/lib/components/atoms/checkbox.ui.d.ts +9 -0
- package/lib/components/atoms/checkbox.ui.d.ts.map +1 -0
- package/lib/components/atoms/checkbox.ui.js +79 -0
- package/lib/components/atoms/chip.ui.d.ts +10 -0
- package/lib/components/atoms/chip.ui.d.ts.map +1 -0
- package/lib/components/atoms/chip.ui.js +28 -0
- package/lib/components/atoms/index.d.ts +8 -0
- package/lib/components/atoms/index.d.ts.map +1 -0
- package/lib/components/atoms/index.js +7 -0
- package/lib/components/atoms/info-card.ui.d.ts +7 -0
- package/lib/components/atoms/info-card.ui.d.ts.map +1 -0
- package/lib/components/atoms/info-card.ui.js +29 -0
- package/lib/components/atoms/select.ui.d.ts +19 -0
- package/lib/components/atoms/select.ui.d.ts.map +1 -0
- package/lib/components/atoms/select.ui.js +80 -0
- package/lib/components/atoms/textarea.ui.d.ts +5 -0
- package/lib/components/atoms/textarea.ui.d.ts.map +1 -0
- package/lib/components/atoms/textarea.ui.js +26 -0
- package/lib/components/atoms/textbox.ui.d.ts +5 -1
- package/lib/components/atoms/textbox.ui.d.ts.map +1 -1
- package/lib/components/atoms/textbox.ui.js +53 -9
- package/lib/constant/chip.constant.d.ts +5 -0
- package/lib/constant/chip.constant.d.ts.map +1 -0
- package/lib/constant/chip.constant.js +4 -0
- package/lib/context/Input.d.ts +5 -0
- package/lib/context/Input.d.ts.map +1 -1
- package/lib/index.d.ts +9 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +14 -3
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-check.d.ts","sourceRoot":"","sources":["../../src/assets/icon-check.tsx"],"names":[],"mappings":"AAAA,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,QAAA,MAAM,SAAS,GAAI,iBAAuC,cAAc,4CAkBvE,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
var IconCheck = function IconCheck(_ref) {
|
|
3
|
+
var _ref$color = _ref.color,
|
|
4
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
5
|
+
_ref$size = _ref.size,
|
|
6
|
+
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
7
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
14
|
+
d: "M12.6667 4L5.33333 11.3333L2.66667 8.66667",
|
|
15
|
+
stroke: color,
|
|
16
|
+
strokeWidth: "1.5",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round"
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export default IconCheck;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-close.d.ts","sourceRoot":"","sources":["../../src/assets/icon-close.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,SAAS,+CAYd,CAAC;AACF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
var IconClose = function IconClose() {
|
|
3
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
4
|
+
width: "12",
|
|
5
|
+
height: "12",
|
|
6
|
+
viewBox: "0 0 12 12",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
10
|
+
d: "M9 3L3 9M3 3L9 9",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: "1.5",
|
|
13
|
+
strokeLinecap: "round",
|
|
14
|
+
strokeLinejoin: "round"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export default IconClose;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface IconSelectboxArrowProps {
|
|
2
|
+
color?: string;
|
|
3
|
+
size?: number;
|
|
4
|
+
}
|
|
5
|
+
declare const IconSelectboxArrow: ({ color, size }: IconSelectboxArrowProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default IconSelectboxArrow;
|
|
7
|
+
//# sourceMappingURL=icon-selectbox-arrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-selectbox-arrow.d.ts","sourceRoot":"","sources":["../../src/assets/icon-selectbox-arrow.tsx"],"names":[],"mappings":"AAAA,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,QAAA,MAAM,kBAAkB,GAAI,iBAAuC,uBAAuB,4CAgBzF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
var IconSelectboxArrow = function IconSelectboxArrow(_ref) {
|
|
3
|
+
var _ref$color = _ref.color,
|
|
4
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
5
|
+
_ref$size = _ref.size,
|
|
6
|
+
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
7
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: color,
|
|
13
|
+
strokeWidth: "2",
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
className: "lucide lucide-chevron-down",
|
|
17
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
18
|
+
d: "M6 9l6 6 6-6"
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export default IconSelectboxArrow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
type InputChipButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
3
|
+
declare const InputChipButton: ({ onClick, ...props }: InputChipButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default InputChipButton;
|
|
5
|
+
//# sourceMappingURL=InputChipButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputChipButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Chip/InputChipButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,KAAK,oBAAoB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AACpE,QAAA,MAAM,eAAe,GAAI,uBAAuB,oBAAoB,4CAMnE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["onClick"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import ButtonUI from "../../atoms/button.ui";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
var InputChipButton = function InputChipButton(_ref) {
|
|
13
|
+
var onClick = _ref.onClick,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
return /*#__PURE__*/_jsx(ButtonUI, _objectSpread(_objectSpread({
|
|
16
|
+
variant: "chip-add",
|
|
17
|
+
onClick: onClick
|
|
18
|
+
}, props), {}, {
|
|
19
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
20
|
+
children: "\uCD94\uAC00"
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
export default InputChipButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface InputChipRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
values: string[];
|
|
5
|
+
onChange: (values: string[]) => void;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const InputChipRow: {
|
|
9
|
+
({ values, onChange, placeholder, className, limit, ...props }: InputChipRowProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default InputChipRow;
|
|
13
|
+
//# sourceMappingURL=InputChipRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputChipRow.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Chip/InputChipRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAyB,MAAM,OAAO,CAAC;AAY9D,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,YAAY;oEAOf,iBAAiB;;CAiEnB,CAAC;AAGF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["values", "onChange", "placeholder", "className", "limit"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
9
|
+
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."); }
|
|
10
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
11
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
12
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
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; } }
|
|
15
|
+
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; }
|
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
import clsx from 'clsx';
|
|
21
|
+
import { useCallback, useState } from 'react';
|
|
22
|
+
import { CHIP_REGEX_DOUBLE_SPACES, CHIP_REGEX_WHITELIST, CHIP_REGEX_BLACKLIST, CHIP_REGEX_SINGLE_SPACE } from "../../../constant/chip.constant";
|
|
23
|
+
import InputChipButton from "./InputChipButton";
|
|
24
|
+
import InputChipTextbox from "./InputTextbox";
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
var InputChipRow = function InputChipRow(_ref) {
|
|
27
|
+
var values = _ref.values,
|
|
28
|
+
onChange = _ref.onChange,
|
|
29
|
+
placeholder = _ref.placeholder,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
limit = _ref.limit,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
var _useState = useState(false),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
isExceededLimit = _useState2[0],
|
|
36
|
+
setIsExceededLimit = _useState2[1];
|
|
37
|
+
var _useState3 = useState(''),
|
|
38
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
+
inputValue = _useState4[0],
|
|
40
|
+
setInputValue = _useState4[1];
|
|
41
|
+
var handleChange = useCallback(function (value) {
|
|
42
|
+
var trimmedInput = value.trim().replace(CHIP_REGEX_DOUBLE_SPACES, ' ');
|
|
43
|
+
var isAvailable = trimmedInput && CHIP_REGEX_WHITELIST.test(trimmedInput);
|
|
44
|
+
var isUnavailable = !trimmedInput || CHIP_REGEX_BLACKLIST.test(trimmedInput);
|
|
45
|
+
if (isAvailable) {
|
|
46
|
+
if (limit && values.length >= limit) {
|
|
47
|
+
setIsExceededLimit(true);
|
|
48
|
+
} else {
|
|
49
|
+
setInputValue('');
|
|
50
|
+
onChange([].concat(_toConsumableArray(values.filter(function (value) {
|
|
51
|
+
return value.toLowerCase().replace(CHIP_REGEX_SINGLE_SPACE, '') !== trimmedInput.toLowerCase().replace(CHIP_REGEX_SINGLE_SPACE, '');
|
|
52
|
+
})), [trimmedInput]));
|
|
53
|
+
}
|
|
54
|
+
} else if (isUnavailable) {
|
|
55
|
+
var newInput = trimmedInput.replace(CHIP_REGEX_BLACKLIST, '');
|
|
56
|
+
setInputValue(newInput);
|
|
57
|
+
}
|
|
58
|
+
}, [values, limit, onChange]);
|
|
59
|
+
var handleButtonClick = useCallback(function () {
|
|
60
|
+
handleChange(inputValue);
|
|
61
|
+
}, [inputValue, handleChange]);
|
|
62
|
+
var handleKeyDown = useCallback(function (e) {
|
|
63
|
+
if (e.key === 'Enter' && e.nativeEvent.isComposing === false) {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
handleChange(inputValue);
|
|
66
|
+
}
|
|
67
|
+
}, [inputValue, handleChange]);
|
|
68
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
69
|
+
className: clsx('flex flex-row gap-2 items-center', isExceededLimit && 'flexmatch-chip-row-buzz', className)
|
|
70
|
+
}, props), {}, {
|
|
71
|
+
children: [/*#__PURE__*/_jsx(InputChipTextbox, {
|
|
72
|
+
value: inputValue,
|
|
73
|
+
error: isExceededLimit,
|
|
74
|
+
onFocus: function onFocus() {
|
|
75
|
+
return limit && setIsExceededLimit(false);
|
|
76
|
+
},
|
|
77
|
+
onChange: function onChange(e) {
|
|
78
|
+
var _e$target$value;
|
|
79
|
+
return setInputValue((_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : '');
|
|
80
|
+
},
|
|
81
|
+
onKeyDown: handleKeyDown,
|
|
82
|
+
placeholder: placeholder
|
|
83
|
+
}), /*#__PURE__*/_jsx(InputChipButton, {
|
|
84
|
+
onClick: handleButtonClick
|
|
85
|
+
})]
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
InputChipRow.displayName = 'InputChipRow';
|
|
89
|
+
export default InputChipRow;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const InputChipTextbox: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
2
|
+
error?: boolean;
|
|
3
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
4
|
+
export default InputChipTextbox;
|
|
5
|
+
//# sourceMappingURL=InputTextbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputTextbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Chip/InputTextbox.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,gBAAgB;YAHZ,OAAO;oDAOhB,CAAC;AAGF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["error"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
import TextboxUI from "../../atoms/textbox.ui";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
var InputChipTextbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
|
+
var error = _ref.error,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
return /*#__PURE__*/_jsx(TextboxUI, _objectSpread(_objectSpread({
|
|
17
|
+
ref: ref
|
|
18
|
+
}, props), {}, {
|
|
19
|
+
error: error
|
|
20
|
+
}));
|
|
21
|
+
});
|
|
22
|
+
InputChipTextbox.displayName = 'InputTextboxChip';
|
|
23
|
+
export default InputChipTextbox;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const InputChip: {
|
|
2
|
+
({ values, onChange, placeholder, className, limit, ...props }: import("./InputChipRow").InputChipRowProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
displayName: string;
|
|
4
|
+
} & {
|
|
5
|
+
Chip: {
|
|
6
|
+
({ className, onDelete, ...props }: import("../../atoms/chip.ui").ChipUIProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
Textbox: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
10
|
+
error?: boolean;
|
|
11
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
|
+
Button: ({ onClick, ...props }: import("react").ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export default InputChip;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Chip/index.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,SAAS;;;;;;;;;;;;CAIb,CAAC;AACH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChipUI } from "../../atoms";
|
|
2
|
+
import InputChipButton from "./InputChipButton";
|
|
3
|
+
import InputChipRow from "./InputChipRow";
|
|
4
|
+
import InputChipTextbox from "./InputTextbox";
|
|
5
|
+
var InputChip = Object.assign(InputChipRow, {
|
|
6
|
+
Chip: ChipUI,
|
|
7
|
+
Textbox: InputChipTextbox,
|
|
8
|
+
Button: InputChipButton
|
|
9
|
+
});
|
|
10
|
+
export default InputChip;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InputSelectableExtraOption, InputSelectableProps } from '@/context/Input';
|
|
2
|
+
export interface InputCardSelectProps<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
|
+
}
|
|
8
|
+
declare const InputCardSelect: {
|
|
9
|
+
<T>({ id, className, options, value, onChange, title, description, extraOptions, ...props }: InputCardSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default InputCardSelect;
|
|
13
|
+
//# sourceMappingURL=InputCardSelect.d.ts.map
|
|
@@ -0,0 +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;CAC/C;AACD,QAAA,MAAM,eAAe;KAAI,CAAC,2FAUvB,oBAAoB,CAAC,CAAC,CAAC;;CAgCzB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["id", "className", "options", "value", "onChange", "title", "description", "extraOptions"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { useCallback } from 'react';
|
|
12
|
+
import InputCardSelectButton from "./InputCardSelectButton";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
var InputCardSelect = function InputCardSelect(_ref) {
|
|
15
|
+
var id = _ref.id,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
options = _ref.options,
|
|
18
|
+
value = _ref.value,
|
|
19
|
+
onChange = _ref.onChange,
|
|
20
|
+
title = _ref.title,
|
|
21
|
+
description = _ref.description,
|
|
22
|
+
extraOptions = _ref.extraOptions,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
var handleSelect = useCallback(function (eventKey) {
|
|
25
|
+
if (eventKey !== null) {
|
|
26
|
+
var option = options.find(function (opt) {
|
|
27
|
+
return String(opt.value) === String(eventKey);
|
|
28
|
+
});
|
|
29
|
+
if (option && onChange) {
|
|
30
|
+
onChange(option.value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, [options, onChange]);
|
|
34
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
35
|
+
id: id,
|
|
36
|
+
className: clsx(className, 'flexmatch-card-select-container')
|
|
37
|
+
}, props), {}, {
|
|
38
|
+
children: options.map(function (option) {
|
|
39
|
+
var extraOption = extraOptions.find(function (opt) {
|
|
40
|
+
return opt.value === option.value;
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/_jsx(InputCardSelectButton, {
|
|
43
|
+
disabled: option.disabled,
|
|
44
|
+
isSelected: option.value === value,
|
|
45
|
+
eventKey: String(option.value),
|
|
46
|
+
onSelect: handleSelect,
|
|
47
|
+
title: option.label,
|
|
48
|
+
description: extraOption === null || extraOption === void 0 ? void 0 : extraOption.description,
|
|
49
|
+
icon: extraOption === null || extraOption === void 0 ? void 0 : extraOption.icon
|
|
50
|
+
}, String(option.value));
|
|
51
|
+
})
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
InputCardSelect.displayName = 'InputCardSelect';
|
|
55
|
+
export default InputCardSelect;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface InputCardSelectButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
2
|
+
title?: string | undefined;
|
|
3
|
+
icon?: React.ReactNode | undefined;
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
isSelected?: boolean | undefined;
|
|
7
|
+
eventKey?: string | number | null | undefined;
|
|
8
|
+
onSelect?: ((eventKey: string | number | null, event: React.SyntheticEvent<HTMLElement>) => void) | undefined;
|
|
9
|
+
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const InputCardSelectButton: <T>({ title, icon, description, disabled, isSelected, eventKey, onSelect, onClick, children, className, ...props }: InputCardSelectButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default InputCardSelectButton;
|
|
13
|
+
//# sourceMappingURL=InputCardSelectButton.d.ts.map
|
|
@@ -0,0 +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,CAAC,EAAG,gHAYhC,0BAA0B,4CA2D5B,CAAC;AACF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["title", "icon", "description", "disabled", "isSelected", "eventKey", "onSelect", "onClick", "children", "className"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { useCallback } from 'react';
|
|
12
|
+
import { CardSelectContainerUI, CardSelectIconUI, CardSelectContentUI, CardSelectContentButtonUI } from "../../atoms/card-select.ui";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var InputCardSelectButton = function InputCardSelectButton(_ref) {
|
|
15
|
+
var title = _ref.title,
|
|
16
|
+
icon = _ref.icon,
|
|
17
|
+
description = _ref.description,
|
|
18
|
+
disabled = _ref.disabled,
|
|
19
|
+
isSelected = _ref.isSelected,
|
|
20
|
+
eventKey = _ref.eventKey,
|
|
21
|
+
onSelect = _ref.onSelect,
|
|
22
|
+
onClick = _ref.onClick,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var handleClick = useCallback(function (e) {
|
|
27
|
+
if (disabled) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (onClick) {
|
|
33
|
+
onClick(e);
|
|
34
|
+
}
|
|
35
|
+
if (!e.defaultPrevented) {
|
|
36
|
+
if (onSelect) {
|
|
37
|
+
onSelect(eventKey !== null && eventKey !== void 0 ? eventKey : null, e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, [disabled, onClick, onSelect, eventKey]);
|
|
41
|
+
var handleKeyDown = useCallback(function (e) {
|
|
42
|
+
if (disabled) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
if (onClick) {
|
|
50
|
+
onClick(e);
|
|
51
|
+
}
|
|
52
|
+
if (!e.defaultPrevented) {
|
|
53
|
+
if (onSelect) {
|
|
54
|
+
onSelect(eventKey !== null && eventKey !== void 0 ? eventKey : null, e);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, [disabled, onClick, onSelect, eventKey]);
|
|
59
|
+
return /*#__PURE__*/_jsxs(CardSelectContainerUI, _objectSpread(_objectSpread({
|
|
60
|
+
className: clsx(className, isSelected && 'selected'),
|
|
61
|
+
onClick: handleClick,
|
|
62
|
+
onKeyDown: handleKeyDown,
|
|
63
|
+
tabIndex: disabled ? -1 : 0,
|
|
64
|
+
"aria-disabled": disabled
|
|
65
|
+
}, props), {}, {
|
|
66
|
+
children: [/*#__PURE__*/_jsx(CardSelectIconUI, {
|
|
67
|
+
children: icon
|
|
68
|
+
}), /*#__PURE__*/_jsx(CardSelectContentUI, {
|
|
69
|
+
title: title,
|
|
70
|
+
description: description
|
|
71
|
+
}), /*#__PURE__*/_jsx(CardSelectContentButtonUI, {
|
|
72
|
+
isSelected: isSelected
|
|
73
|
+
})]
|
|
74
|
+
}));
|
|
75
|
+
};
|
|
76
|
+
export default InputCardSelectButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputSelectableProps } from '@/context/Input';
|
|
2
|
+
export interface InputCheckboxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputSelectableProps<boolean> {
|
|
3
|
+
id?: string | undefined;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
label?: string | undefined;
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
required?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const InputCheckbox: import("react").ForwardRefExoticComponent<InputCheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export default InputCheckbox;
|
|
11
|
+
//# sourceMappingURL=InputCheckbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputCheckbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCheckbox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC;IAC7F,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,iHAiBlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["id", "className", "label", "disabled", "value", "onChange", "size", "required"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
import { CheckboxUI } from "../../atoms";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
var InputCheckbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
|
+
var id = _ref.id,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
label = _ref.label,
|
|
17
|
+
disabled = _ref.disabled,
|
|
18
|
+
value = _ref.value,
|
|
19
|
+
onChange = _ref.onChange,
|
|
20
|
+
_ref$size = _ref.size,
|
|
21
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
22
|
+
required = _ref.required,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
return /*#__PURE__*/_jsx(CheckboxUI, _objectSpread({
|
|
25
|
+
id: id,
|
|
26
|
+
className: className,
|
|
27
|
+
label: label,
|
|
28
|
+
disabled: disabled,
|
|
29
|
+
checked: value !== null && value !== void 0 ? value : true,
|
|
30
|
+
onChange: onChange,
|
|
31
|
+
size: size,
|
|
32
|
+
required: required,
|
|
33
|
+
ref: ref
|
|
34
|
+
}, props));
|
|
35
|
+
});
|
|
36
|
+
InputCheckbox.displayName = 'InputCheckbox';
|
|
37
|
+
export default InputCheckbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOptionSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputOptionSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"InputOptionSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputOptionSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAStD,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;CACzB;AAED,QAAA,MAAM,iBAAiB;KAAI,CAAC,gDAMzB,sBAAsB,CAAC,CAAC,CAAC;;CAqC3B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { OptionSwitchContainerUI, OptionSwitchSelectionUI } from "../../atoms/option-switch.ui";
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import InputOptionSwitchButton from "./InputOptionSwitchButton";
|
|
4
|
+
|
|
5
|
+
// 값이 이원화되어있습니다.
|
|
6
|
+
// 해당 값을 변경할 경우 react-ui/src/css/option-switch.ui.css 파일의 --flexmatch-input-option-switch-size 값을 수정해주세요.
|
|
4
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
8
|
+
var FLEXMATCH_INPUT_OPTION_SWITCH_SIZE = 100;
|
|
6
9
|
var InputOptionSwitch = function InputOptionSwitch(_ref) {
|
|
7
10
|
var id = _ref.id,
|
|
8
11
|
className = _ref.className,
|
|
@@ -16,7 +19,7 @@ var InputOptionSwitch = function InputOptionSwitch(_ref) {
|
|
|
16
19
|
if (index === -1) {
|
|
17
20
|
return 0;
|
|
18
21
|
}
|
|
19
|
-
return index *
|
|
22
|
+
return index * FLEXMATCH_INPUT_OPTION_SWITCH_SIZE;
|
|
20
23
|
}, [options, value]);
|
|
21
24
|
var handleSelect = useCallback(function (eventKey) {
|
|
22
25
|
if (eventKey !== null) {
|
|
@@ -37,6 +40,7 @@ var InputOptionSwitch = function InputOptionSwitch(_ref) {
|
|
|
37
40
|
}
|
|
38
41
|
}), options.map(function (option) {
|
|
39
42
|
return /*#__PURE__*/_jsx(InputOptionSwitchButton, {
|
|
43
|
+
isSelected: option.value === value,
|
|
40
44
|
eventKey: String(option.value),
|
|
41
45
|
disabled: !!option.disabled,
|
|
42
46
|
onSelect: function onSelect(eventKey) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export interface InputOptionSwitchButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
2
2
|
disabled?: boolean | undefined;
|
|
3
|
+
isSelected?: boolean | undefined;
|
|
3
4
|
eventKey?: string | number | null | undefined;
|
|
4
5
|
onSelect?: ((eventKey: string | number | null, event: React.SyntheticEvent<HTMLElement>) => void) | undefined;
|
|
5
6
|
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
6
7
|
}
|
|
7
|
-
declare const InputOptionSwitchButton: ({ disabled, eventKey, onSelect, onClick, children, ...props }: InputOptionSwitchButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const InputOptionSwitchButton: ({ disabled, isSelected, eventKey, onSelect, onClick, children, ...props }: InputOptionSwitchButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default InputOptionSwitchButton;
|
|
9
10
|
//# sourceMappingURL=InputOptionSwitchButton.d.ts.map
|