acsi-core 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CoreInputCompact/index.d.ts +13 -0
- package/dist/components/CoreSelectCompact/index.d.ts +20 -0
- package/dist/components/CoreTextArea/index.d.ts +2 -0
- package/dist/components/CoreTitleInput/index.d.ts +13 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/index.css +81 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +346 -44
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +341 -42
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/icons/Info.d.ts +3 -0
- package/dist/utils/icons/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IProps {
|
|
3
|
+
name?: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (name: string, value: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const CoreInputCompact: (props: IProps) => React.JSX.Element;
|
|
13
|
+
export default CoreInputCompact;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IOprion {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
interface IProps {
|
|
7
|
+
name?: string;
|
|
8
|
+
options: IOprion[];
|
|
9
|
+
value: string | null | string[];
|
|
10
|
+
onChange: (name: string, value: string) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
isMulti?: boolean;
|
|
16
|
+
isShowDropdown?: boolean;
|
|
17
|
+
error?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const CoreSelectCompact: (props: IProps) => React.JSX.Element;
|
|
20
|
+
export default CoreSelectCompact;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IProps {
|
|
3
|
+
name?: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (name: string, value: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
width?: number;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
error?: boolean;
|
|
10
|
+
size?: "h1" | "h2";
|
|
11
|
+
}
|
|
12
|
+
declare const CoreTitleInput: (props: IProps) => React.JSX.Element;
|
|
13
|
+
export default CoreTitleInput;
|
|
@@ -8,3 +8,6 @@ export { default as CoreModal } from "./CoreModal";
|
|
|
8
8
|
export { default as CoreRange } from "./CoreRange";
|
|
9
9
|
export { default as CoreTextArea } from "./CoreTextArea";
|
|
10
10
|
export { default as CoreSearch } from "./CoreSearch";
|
|
11
|
+
export { default as CoreSelectCompact } from "./CoreSelectCompact";
|
|
12
|
+
export { default as CoreInputCompact } from "./CoreInputCompact";
|
|
13
|
+
export { default as CoreTitleInput } from "./CoreTitleInput";
|
package/dist/index.css
CHANGED
|
@@ -296,10 +296,18 @@
|
|
|
296
296
|
._1b_C3 textarea::placeholder {
|
|
297
297
|
color: #a6a6ad; }
|
|
298
298
|
|
|
299
|
-
._1b_C3
|
|
300
|
-
font-size:
|
|
301
|
-
font-weight:
|
|
302
|
-
margin-bottom: 4px;
|
|
299
|
+
._1b_C3 ._15n2K {
|
|
300
|
+
font-size: 14px;
|
|
301
|
+
font-weight: 400;
|
|
302
|
+
margin-bottom: 4px;
|
|
303
|
+
color: #585869;
|
|
304
|
+
display: flex;
|
|
305
|
+
align-items: center;
|
|
306
|
+
gap: 2px; }
|
|
307
|
+
._1b_C3 ._15n2K ._1fHZB {
|
|
308
|
+
color: #a6a6ad; }
|
|
309
|
+
._1b_C3 ._15n2K ._38AfS {
|
|
310
|
+
cursor: pointer; }
|
|
303
311
|
|
|
304
312
|
._wyI1K {
|
|
305
313
|
height: 32px;
|
|
@@ -329,3 +337,72 @@
|
|
|
329
337
|
min-width: 0; }
|
|
330
338
|
._wyI1K ._1nhXy {
|
|
331
339
|
cursor: pointer; }
|
|
340
|
+
|
|
341
|
+
._3ql5D label {
|
|
342
|
+
font-weight: 400 !important;
|
|
343
|
+
color: #212126 !important;
|
|
344
|
+
margin-top: 2px; }
|
|
345
|
+
|
|
346
|
+
._3ql5D ._3fPQC {
|
|
347
|
+
display: flex;
|
|
348
|
+
align-items: center;
|
|
349
|
+
gap: 4px;
|
|
350
|
+
font-size: 14px;
|
|
351
|
+
font-weight: 400;
|
|
352
|
+
color: #585869;
|
|
353
|
+
padding: 4px; }
|
|
354
|
+
|
|
355
|
+
._1qmXW {
|
|
356
|
+
display: flex;
|
|
357
|
+
flex-direction: column; }
|
|
358
|
+
._1qmXW ._1argp {
|
|
359
|
+
display: flex;
|
|
360
|
+
align-items: center;
|
|
361
|
+
gap: 4px;
|
|
362
|
+
font-size: 14px;
|
|
363
|
+
font-weight: 400;
|
|
364
|
+
color: #585869;
|
|
365
|
+
padding: 4px; }
|
|
366
|
+
._1qmXW input {
|
|
367
|
+
border: none;
|
|
368
|
+
outline: none;
|
|
369
|
+
border-radius: 6px;
|
|
370
|
+
height: 26px;
|
|
371
|
+
font-size: 14px;
|
|
372
|
+
font-weight: 400;
|
|
373
|
+
color: #212126; }
|
|
374
|
+
._1qmXW input:hover {
|
|
375
|
+
background-color: #e5f9ff !important; }
|
|
376
|
+
._1qmXW input::-moz-placeholder {
|
|
377
|
+
color: #a6a6ad; }
|
|
378
|
+
._1qmXW input::placeholder {
|
|
379
|
+
color: #a6a6ad; }
|
|
380
|
+
._1qmXW input:disabled {
|
|
381
|
+
pointer-events: none;
|
|
382
|
+
background-color: transparent;
|
|
383
|
+
color: #212126; }
|
|
384
|
+
._1qmXW input:focus-visible {
|
|
385
|
+
box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.1); }
|
|
386
|
+
|
|
387
|
+
._2YqZu {
|
|
388
|
+
display: flex;
|
|
389
|
+
flex-direction: column; }
|
|
390
|
+
._2YqZu input {
|
|
391
|
+
border: none;
|
|
392
|
+
outline: none;
|
|
393
|
+
border-radius: 6px;
|
|
394
|
+
color: #212126; }
|
|
395
|
+
._2YqZu input::-moz-placeholder {
|
|
396
|
+
color: #a6a6ad; }
|
|
397
|
+
._2YqZu input::placeholder {
|
|
398
|
+
color: #a6a6ad; }
|
|
399
|
+
|
|
400
|
+
._23-uu {
|
|
401
|
+
font-size: 24px;
|
|
402
|
+
font-weight: 700;
|
|
403
|
+
line-height: 32.74px; }
|
|
404
|
+
|
|
405
|
+
._16lQL {
|
|
406
|
+
font-size: 18px;
|
|
407
|
+
font-weight: 700;
|
|
408
|
+
line-height: 24.55px; }
|
package/dist/index.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ import { ToastContainer, toast } from "react-toastify";
|
|
|
13
13
|
import { Role } from "./containers/Login/configs/constants";
|
|
14
14
|
import CustomPagination from "./components/Paginations/CustomPagination";
|
|
15
15
|
import useGoogleSignOut from "./utils/hooks/useGoogleSignOut";
|
|
16
|
-
import { CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch } from "./components";
|
|
16
|
+
import { CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, CoreSelectCompact, CoreInputCompact, CoreTitleInput } from "./components";
|
|
17
17
|
import { getErrorMessage } from "./utils/getErrorMessage";
|
|
18
18
|
import CustomSelect from "./components/Selects/CustomSelect";
|
|
19
19
|
import CustomAsyncSelect from "./components/Selects/CustomAsyncSelect";
|
|
20
20
|
import CustomCreatable from "./components/Selects/CustomCreatable";
|
|
21
21
|
import CustomSelectOption from "./components/Selects/CustomSelectOption";
|
|
22
|
-
export { setLoading, BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, Login, store, historyCore, setAlert, setUser, setMenuCollapse, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, ToastContainer, toast, Role, CustomPagination, useGoogleSignOut, CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, getErrorMessage, CustomSelect, CustomAsyncSelect, CustomCreatable, CustomSelectOption };
|
|
22
|
+
export { setLoading, BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, Login, store, historyCore, setAlert, setUser, setMenuCollapse, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, ToastContainer, toast, Role, CustomPagination, useGoogleSignOut, CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, CoreSelectCompact, CoreInputCompact, CoreTitleInput, getErrorMessage, CustomSelect, CustomAsyncSelect, CustomCreatable, CustomSelectOption };
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,8 @@ var reactRedux = require('react-redux');
|
|
|
14
14
|
var gapiScript = require('gapi-script');
|
|
15
15
|
var material = require('@mui/material');
|
|
16
16
|
var reactToastify = require('react-toastify');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
17
|
+
var ReactSelect = require('react-select');
|
|
18
|
+
var ReactSelect__default = _interopDefault(ReactSelect);
|
|
19
19
|
var fa = require('react-icons/fa');
|
|
20
20
|
var CreatableSelect = _interopDefault(require('react-select/creatable'));
|
|
21
21
|
|
|
@@ -76,7 +76,8 @@ var COLORS = {
|
|
|
76
76
|
darkBrandBlue: "#025675",
|
|
77
77
|
darkBrandBlueHover: "#007a99",
|
|
78
78
|
brandAccent: "#ffce09",
|
|
79
|
-
red: "#ce3636"
|
|
79
|
+
red: "#ce3636",
|
|
80
|
+
lightYellow: "#fff5ce"
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
var styleGlobal = {"signup_wrap":"_1KLz9","box-signin":"_2Jo1o","signin_title":"_3egBO","signup_link":"_1DoIT","google_button":"_34hK_","box-field":"_2e9xO","box-input":"_3zXRp","box-button-email":"_21FPk","box-signin-container":"_1QERu","box-signin-text":"_2-znH","box-signin-logo":"_1aB2m","box-right":"_3qndF","box-right-body":"_JzdCr","box-right-footer":"_19aCA","pr-30":"_2HB5r"};
|
|
@@ -1073,7 +1074,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
1073
1074
|
var styles$3 = {"core-select":"_2sg12","label":"_1-XBo"};
|
|
1074
1075
|
|
|
1075
1076
|
var Option = function Option(props) {
|
|
1076
|
-
return React__default.createElement("div", null, React__default.createElement(
|
|
1077
|
+
return React__default.createElement("div", null, React__default.createElement(ReactSelect.components.Option, Object.assign({}, props), React__default.createElement(CoreInput$1, {
|
|
1077
1078
|
checked: props.isSelected,
|
|
1078
1079
|
onChange: function onChange() {
|
|
1079
1080
|
return null;
|
|
@@ -1228,7 +1229,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
1228
1229
|
}
|
|
1229
1230
|
}, label && React__default.createElement("span", {
|
|
1230
1231
|
className: styles$3["label"]
|
|
1231
|
-
}, label), React__default.createElement(
|
|
1232
|
+
}, label), React__default.createElement(ReactSelect__default, {
|
|
1232
1233
|
name: name,
|
|
1233
1234
|
value: options.filter(function (i) {
|
|
1234
1235
|
return value && (isMulti ? value.includes(i.value) : i.value === value);
|
|
@@ -1386,40 +1387,7 @@ var CoreRange = function CoreRange(props) {
|
|
|
1386
1387
|
}));
|
|
1387
1388
|
};
|
|
1388
1389
|
|
|
1389
|
-
var styles$8 = {"core-text-area":"_1b_C3"};
|
|
1390
|
-
|
|
1391
|
-
var CoreTextArea = function CoreTextArea(props) {
|
|
1392
|
-
var name = props.name,
|
|
1393
|
-
_onChange = props.onChange,
|
|
1394
|
-
value = props.value,
|
|
1395
|
-
_props$cols = props.cols,
|
|
1396
|
-
cols = _props$cols === void 0 ? 0 : _props$cols,
|
|
1397
|
-
label = props.label,
|
|
1398
|
-
_props$rows = props.rows,
|
|
1399
|
-
rows = _props$rows === void 0 ? 2 : _props$rows,
|
|
1400
|
-
_props$placeholder = props.placeholder,
|
|
1401
|
-
placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
|
|
1402
|
-
width = props.width;
|
|
1403
|
-
return React__default.createElement("div", {
|
|
1404
|
-
className: styles$8["core-text-area"],
|
|
1405
|
-
style: {
|
|
1406
|
-
width: width != null ? width : "100%"
|
|
1407
|
-
}
|
|
1408
|
-
}, label && React__default.createElement("label", null, label), React__default.createElement("textarea", {
|
|
1409
|
-
style: {
|
|
1410
|
-
whiteSpace: "pre-wrap"
|
|
1411
|
-
},
|
|
1412
|
-
placeholder: placeholder,
|
|
1413
|
-
value: value,
|
|
1414
|
-
cols: cols,
|
|
1415
|
-
rows: rows,
|
|
1416
|
-
onChange: function onChange(e) {
|
|
1417
|
-
return _onChange(name, e.target.value);
|
|
1418
|
-
}
|
|
1419
|
-
}));
|
|
1420
|
-
};
|
|
1421
|
-
|
|
1422
|
-
var styles$9 = {"core-search":"_wyI1K","input":"_9XW-D","clear":"_1nhXy"};
|
|
1390
|
+
var styles$8 = {"core-text-area":"_1b_C3","label":"_15n2K","optional":"_1fHZB","icon":"_38AfS"};
|
|
1423
1391
|
|
|
1424
1392
|
var Search = function Search(props) {
|
|
1425
1393
|
var _props$size = props.size,
|
|
@@ -1483,6 +1451,85 @@ var Close = function Close(props) {
|
|
|
1483
1451
|
}))));
|
|
1484
1452
|
};
|
|
1485
1453
|
|
|
1454
|
+
var Info = function Info() {
|
|
1455
|
+
return React__default.createElement("svg", {
|
|
1456
|
+
width: "12",
|
|
1457
|
+
height: "12",
|
|
1458
|
+
viewBox: "0 0 12 12",
|
|
1459
|
+
fill: "none",
|
|
1460
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1461
|
+
}, React__default.createElement("path", {
|
|
1462
|
+
"fill-rule": "evenodd",
|
|
1463
|
+
"clip-rule": "evenodd",
|
|
1464
|
+
d: "M6.0002 2.1002C3.84628 2.1002 2.1002 3.84628 2.1002 6.0002C2.1002 8.15411 3.84628 9.9002 6.0002 9.9002C8.15411 9.9002 9.9002 8.15411 9.9002 6.0002C9.9002 3.84628 8.15411 2.1002 6.0002 2.1002ZM1.2002 6.0002C1.2002 3.34923 3.34923 1.2002 6.0002 1.2002C8.65116 1.2002 10.8002 3.34923 10.8002 6.0002C10.8002 8.65116 8.65116 10.8002 6.0002 10.8002C3.34923 10.8002 1.2002 8.65116 1.2002 6.0002Z",
|
|
1465
|
+
fill: "#A6A6AD"
|
|
1466
|
+
}), React__default.createElement("path", {
|
|
1467
|
+
"fill-rule": "evenodd",
|
|
1468
|
+
"clip-rule": "evenodd",
|
|
1469
|
+
d: "M5.9998 5.1001C6.24833 5.1001 6.4498 5.30157 6.4498 5.5501V8.2915C6.4498 8.54003 6.24833 8.7415 5.9998 8.7415C5.75128 8.7415 5.5498 8.54003 5.5498 8.2915V5.5501C5.5498 5.30157 5.75128 5.1001 5.9998 5.1001Z",
|
|
1470
|
+
fill: "#A6A6AD"
|
|
1471
|
+
}), React__default.createElement("path", {
|
|
1472
|
+
d: "M5.9999 4.6502C5.6687 4.6502 5.3999 4.3808 5.3999 4.0502C5.3999 3.7196 5.6687 3.4502 5.9999 3.4502C6.3311 3.4502 6.5999 3.7196 6.5999 4.0502C6.5999 4.3808 6.3311 4.6502 5.9999 4.6502Z",
|
|
1473
|
+
fill: "#A6A6AD"
|
|
1474
|
+
}));
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1477
|
+
var CoreTextArea = function CoreTextArea(props) {
|
|
1478
|
+
var name = props.name,
|
|
1479
|
+
_onChange = props.onChange,
|
|
1480
|
+
value = props.value,
|
|
1481
|
+
_props$cols = props.cols,
|
|
1482
|
+
cols = _props$cols === void 0 ? 0 : _props$cols,
|
|
1483
|
+
label = props.label,
|
|
1484
|
+
_props$rows = props.rows,
|
|
1485
|
+
rows = _props$rows === void 0 ? 2 : _props$rows,
|
|
1486
|
+
_props$placeholder = props.placeholder,
|
|
1487
|
+
placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
|
|
1488
|
+
width = props.width,
|
|
1489
|
+
_props$tooltip = props.tooltip,
|
|
1490
|
+
tooltip = _props$tooltip === void 0 ? '' : _props$tooltip,
|
|
1491
|
+
_props$isOptional = props.isOptional,
|
|
1492
|
+
isOptional = _props$isOptional === void 0 ? false : _props$isOptional;
|
|
1493
|
+
var _useState = React.useState(false),
|
|
1494
|
+
isOpenTooltip = _useState[0],
|
|
1495
|
+
setIsOpenTooltip = _useState[1];
|
|
1496
|
+
var toggleTooltip = function toggleTooltip() {
|
|
1497
|
+
return setIsOpenTooltip(!isOpenTooltip);
|
|
1498
|
+
};
|
|
1499
|
+
return React__default.createElement("div", {
|
|
1500
|
+
className: styles$8["core-text-area"],
|
|
1501
|
+
style: {
|
|
1502
|
+
width: width != null ? width : "100%"
|
|
1503
|
+
}
|
|
1504
|
+
}, label && React__default.createElement("div", {
|
|
1505
|
+
className: styles$8['label']
|
|
1506
|
+
}, React__default.createElement("div", {
|
|
1507
|
+
className: styles$8['text']
|
|
1508
|
+
}, label), isOptional && React__default.createElement("div", {
|
|
1509
|
+
className: styles$8['optional']
|
|
1510
|
+
}, "(optional)"), React__default.createElement("div", {
|
|
1511
|
+
className: styles$8['icon'],
|
|
1512
|
+
id: name
|
|
1513
|
+
}, React__default.createElement(Info, null)), tooltip ? React__default.createElement(reactstrap.Tooltip, {
|
|
1514
|
+
target: name,
|
|
1515
|
+
isOpen: isOpenTooltip,
|
|
1516
|
+
toggle: toggleTooltip
|
|
1517
|
+
}, tooltip) : null), React__default.createElement("textarea", {
|
|
1518
|
+
style: {
|
|
1519
|
+
whiteSpace: "pre-wrap"
|
|
1520
|
+
},
|
|
1521
|
+
placeholder: placeholder,
|
|
1522
|
+
value: value,
|
|
1523
|
+
cols: cols,
|
|
1524
|
+
rows: rows,
|
|
1525
|
+
onChange: function onChange(e) {
|
|
1526
|
+
return _onChange(name, e.target.value);
|
|
1527
|
+
}
|
|
1528
|
+
}));
|
|
1529
|
+
};
|
|
1530
|
+
|
|
1531
|
+
var styles$9 = {"core-search":"_wyI1K","input":"_9XW-D","clear":"_1nhXy"};
|
|
1532
|
+
|
|
1486
1533
|
var CoreSearch = function CoreSearch(props) {
|
|
1487
1534
|
var _props$name = props.name,
|
|
1488
1535
|
name = _props$name === void 0 ? "" : _props$name,
|
|
@@ -1513,6 +1560,258 @@ var CoreSearch = function CoreSearch(props) {
|
|
|
1513
1560
|
}, React__default.createElement(Close, null)) : null);
|
|
1514
1561
|
};
|
|
1515
1562
|
|
|
1563
|
+
var styles$a = {"core-select-compact":"_3ql5D","label":"_3fPQC"};
|
|
1564
|
+
|
|
1565
|
+
var Option$1 = function Option(props) {
|
|
1566
|
+
return React__default.createElement("div", null, React__default.createElement(ReactSelect.components.Option, Object.assign({}, props), React__default.createElement(CoreInput$1, {
|
|
1567
|
+
checked: props.isSelected,
|
|
1568
|
+
onChange: function onChange() {
|
|
1569
|
+
return null;
|
|
1570
|
+
},
|
|
1571
|
+
name: "",
|
|
1572
|
+
label: props.label
|
|
1573
|
+
})));
|
|
1574
|
+
};
|
|
1575
|
+
var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
1576
|
+
var _props$name = props.name,
|
|
1577
|
+
name = _props$name === void 0 ? "" : _props$name,
|
|
1578
|
+
options = props.options,
|
|
1579
|
+
value = props.value,
|
|
1580
|
+
onChange = props.onChange,
|
|
1581
|
+
_props$disabled = props.disabled,
|
|
1582
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1583
|
+
label = props.label,
|
|
1584
|
+
width = props.width,
|
|
1585
|
+
_props$placeholder = props.placeholder,
|
|
1586
|
+
placeholder = _props$placeholder === void 0 ? "Select" : _props$placeholder,
|
|
1587
|
+
_props$isMulti = props.isMulti,
|
|
1588
|
+
isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
|
|
1589
|
+
_props$isShowDropdown = props.isShowDropdown,
|
|
1590
|
+
isShowDropdown = _props$isShowDropdown === void 0 ? false : _props$isShowDropdown,
|
|
1591
|
+
_props$error = props.error,
|
|
1592
|
+
error = _props$error === void 0 ? false : _props$error;
|
|
1593
|
+
var handleChange = function handleChange(value) {
|
|
1594
|
+
var newValue = isMulti ? value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
1595
|
+
return item.value;
|
|
1596
|
+
}) : value === null || value === void 0 ? void 0 : value.value;
|
|
1597
|
+
onChange(name, newValue);
|
|
1598
|
+
};
|
|
1599
|
+
var controlStyle = function controlStyle(base, state) {
|
|
1600
|
+
var styles = _extends({}, base, {
|
|
1601
|
+
fontSize: "14px",
|
|
1602
|
+
fontWeight: "400",
|
|
1603
|
+
padding: "0",
|
|
1604
|
+
backgroundColor: state.isDisabled ? "transparent" : error ? COLORS.lightYellow : COLORS.white,
|
|
1605
|
+
border: "none",
|
|
1606
|
+
height: isMulti ? undefined : "26px",
|
|
1607
|
+
minHeight: "26px",
|
|
1608
|
+
boxShadow: "none",
|
|
1609
|
+
cursor: "pointer",
|
|
1610
|
+
"&:hover": {
|
|
1611
|
+
backgroundColor: COLORS.lightBlueHover
|
|
1612
|
+
},
|
|
1613
|
+
"&>div": {
|
|
1614
|
+
padding: "0 2px"
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
return styles;
|
|
1618
|
+
};
|
|
1619
|
+
var inputStyles = function inputStyles(base) {
|
|
1620
|
+
var styles = _extends({}, base, {
|
|
1621
|
+
margin: "0",
|
|
1622
|
+
padding: "0",
|
|
1623
|
+
color: "inherit",
|
|
1624
|
+
position: "relative",
|
|
1625
|
+
top: "-2px"
|
|
1626
|
+
});
|
|
1627
|
+
return styles;
|
|
1628
|
+
};
|
|
1629
|
+
var placeholderStyles = function placeholderStyles(base) {
|
|
1630
|
+
var styles = _extends({}, base, {
|
|
1631
|
+
color: COLORS.lightGray
|
|
1632
|
+
});
|
|
1633
|
+
return styles;
|
|
1634
|
+
};
|
|
1635
|
+
var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
|
|
1636
|
+
var styles = _extends({}, base, {
|
|
1637
|
+
position: "relative",
|
|
1638
|
+
padding: "2px 0"
|
|
1639
|
+
});
|
|
1640
|
+
return styles;
|
|
1641
|
+
};
|
|
1642
|
+
var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
|
|
1643
|
+
var styles = _extends({}, base, {
|
|
1644
|
+
display: isShowDropdown && !isMulti ? "block" : "none"
|
|
1645
|
+
});
|
|
1646
|
+
return styles;
|
|
1647
|
+
};
|
|
1648
|
+
var valueContainerStyles = function valueContainerStyles(base) {
|
|
1649
|
+
var styles = _extends({}, base, {
|
|
1650
|
+
height: isMulti ? undefined : "26px",
|
|
1651
|
+
position: "relative"
|
|
1652
|
+
});
|
|
1653
|
+
return styles;
|
|
1654
|
+
};
|
|
1655
|
+
var singleValueStyles = function singleValueStyles(base) {
|
|
1656
|
+
var styles = _extends({}, base);
|
|
1657
|
+
return styles;
|
|
1658
|
+
};
|
|
1659
|
+
var optionStyles = function optionStyles(base, state) {
|
|
1660
|
+
var styles = _extends({}, base, {
|
|
1661
|
+
padding: "8px",
|
|
1662
|
+
borderRadius: "8px",
|
|
1663
|
+
cursor: "pointer",
|
|
1664
|
+
fontSize: "14px",
|
|
1665
|
+
fontWeight: 400,
|
|
1666
|
+
color: COLORS.blackText,
|
|
1667
|
+
backgroundColor: state.isSelected ? COLORS.lightBlueHover : "transparent",
|
|
1668
|
+
"&:hover": {
|
|
1669
|
+
backgroundColor: COLORS.lightBlueHover
|
|
1670
|
+
}
|
|
1671
|
+
});
|
|
1672
|
+
return styles;
|
|
1673
|
+
};
|
|
1674
|
+
var multiValueStyles = function multiValueStyles(base) {
|
|
1675
|
+
var styles = _extends({}, base, {
|
|
1676
|
+
backgroundColor: COLORS.lightBlue,
|
|
1677
|
+
borderRadius: "4px",
|
|
1678
|
+
padding: "0 4px",
|
|
1679
|
+
display: "flex",
|
|
1680
|
+
alignItems: "center",
|
|
1681
|
+
fontSize: "13px",
|
|
1682
|
+
color: COLORS.blackText
|
|
1683
|
+
});
|
|
1684
|
+
return styles;
|
|
1685
|
+
};
|
|
1686
|
+
var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
|
|
1687
|
+
var styles = _extends({}, base, {
|
|
1688
|
+
color: COLORS.lightGray,
|
|
1689
|
+
cursor: "pointer"
|
|
1690
|
+
});
|
|
1691
|
+
return styles;
|
|
1692
|
+
};
|
|
1693
|
+
var multiValueLabelStyles = function multiValueLabelStyles(base) {
|
|
1694
|
+
var styles = _extends({}, base, {
|
|
1695
|
+
color: COLORS.blackText,
|
|
1696
|
+
fontWeight: "400",
|
|
1697
|
+
fontSize: "13px",
|
|
1698
|
+
padding: 0
|
|
1699
|
+
});
|
|
1700
|
+
return styles;
|
|
1701
|
+
};
|
|
1702
|
+
return React__default.createElement("div", {
|
|
1703
|
+
className: "" + styles$a["core-select-compact"],
|
|
1704
|
+
style: {
|
|
1705
|
+
width: width != null ? width : "100%"
|
|
1706
|
+
}
|
|
1707
|
+
}, label && React__default.createElement("div", {
|
|
1708
|
+
className: styles$a["label"]
|
|
1709
|
+
}, React__default.createElement("label", null, label), React__default.createElement(Info, null)), React__default.createElement(ReactSelect__default, {
|
|
1710
|
+
name: name,
|
|
1711
|
+
value: options.filter(function (i) {
|
|
1712
|
+
return value && (isMulti ? value.includes(i.value) : i.value === value);
|
|
1713
|
+
}),
|
|
1714
|
+
onChange: handleChange,
|
|
1715
|
+
placeholder: placeholder,
|
|
1716
|
+
isDisabled: disabled,
|
|
1717
|
+
isMulti: isMulti,
|
|
1718
|
+
closeMenuOnSelect: !isMulti,
|
|
1719
|
+
hideSelectedOptions: false,
|
|
1720
|
+
options: options,
|
|
1721
|
+
components: isMulti ? {
|
|
1722
|
+
Option: Option$1
|
|
1723
|
+
} : undefined,
|
|
1724
|
+
styles: {
|
|
1725
|
+
control: controlStyle,
|
|
1726
|
+
input: inputStyles,
|
|
1727
|
+
placeholder: placeholderStyles,
|
|
1728
|
+
dropdownIndicator: dropdownIndicatorStyles,
|
|
1729
|
+
indicatorSeparator: function indicatorSeparator() {
|
|
1730
|
+
return {
|
|
1731
|
+
display: "none"
|
|
1732
|
+
};
|
|
1733
|
+
},
|
|
1734
|
+
indicatorsContainer: indicatorsContainerStyles,
|
|
1735
|
+
valueContainer: valueContainerStyles,
|
|
1736
|
+
singleValue: singleValueStyles,
|
|
1737
|
+
option: optionStyles,
|
|
1738
|
+
multiValue: multiValueStyles,
|
|
1739
|
+
multiValueRemove: multiValueRemoveStyles,
|
|
1740
|
+
multiValueLabel: multiValueLabelStyles
|
|
1741
|
+
}
|
|
1742
|
+
}));
|
|
1743
|
+
};
|
|
1744
|
+
|
|
1745
|
+
var styles$b = {"core-input-compact":"_1qmXW","label":"_1argp"};
|
|
1746
|
+
|
|
1747
|
+
var CoreInputCompact = function CoreInputCompact(props) {
|
|
1748
|
+
var _props$name = props.name,
|
|
1749
|
+
name = _props$name === void 0 ? "" : _props$name,
|
|
1750
|
+
value = props.value,
|
|
1751
|
+
_onChange = props.onChange,
|
|
1752
|
+
_props$disabled = props.disabled,
|
|
1753
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1754
|
+
label = props.label,
|
|
1755
|
+
width = props.width,
|
|
1756
|
+
_props$placeholder = props.placeholder,
|
|
1757
|
+
placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
|
|
1758
|
+
error = props.error;
|
|
1759
|
+
return React__default.createElement("div", {
|
|
1760
|
+
className: "" + styles$b["core-input-compact"],
|
|
1761
|
+
style: {
|
|
1762
|
+
width: width != null ? width : "100%"
|
|
1763
|
+
}
|
|
1764
|
+
}, label && React__default.createElement("div", {
|
|
1765
|
+
className: styles$b["label"]
|
|
1766
|
+
}, React__default.createElement("label", null, label), React__default.createElement(Info, null)), React__default.createElement("input", {
|
|
1767
|
+
style: {
|
|
1768
|
+
backgroundColor: error ? COLORS.lightYellow : "transparent"
|
|
1769
|
+
},
|
|
1770
|
+
name: name,
|
|
1771
|
+
value: value,
|
|
1772
|
+
onChange: function onChange(e) {
|
|
1773
|
+
return _onChange(name, e.target.value);
|
|
1774
|
+
},
|
|
1775
|
+
disabled: disabled,
|
|
1776
|
+
placeholder: placeholder
|
|
1777
|
+
}));
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
var styles$c = {"core-label-input":"_2YqZu","size-h1":"_23-uu","size-h2":"_16lQL"};
|
|
1781
|
+
|
|
1782
|
+
var CoreTitleInput = function CoreTitleInput(props) {
|
|
1783
|
+
var _props$name = props.name,
|
|
1784
|
+
name = _props$name === void 0 ? "" : _props$name,
|
|
1785
|
+
value = props.value,
|
|
1786
|
+
_onChange = props.onChange,
|
|
1787
|
+
_props$disabled = props.disabled,
|
|
1788
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1789
|
+
width = props.width,
|
|
1790
|
+
_props$placeholder = props.placeholder,
|
|
1791
|
+
placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
|
|
1792
|
+
error = props.error,
|
|
1793
|
+
_props$size = props.size,
|
|
1794
|
+
size = _props$size === void 0 ? "h1" : _props$size;
|
|
1795
|
+
return React__default.createElement("div", {
|
|
1796
|
+
className: "" + styles$c["core-label-input"],
|
|
1797
|
+
style: {
|
|
1798
|
+
width: width != null ? width : "100%"
|
|
1799
|
+
}
|
|
1800
|
+
}, React__default.createElement("input", {
|
|
1801
|
+
className: "" + styles$c["size-" + size],
|
|
1802
|
+
style: {
|
|
1803
|
+
backgroundColor: error ? COLORS.lightYellow : "transparent"
|
|
1804
|
+
},
|
|
1805
|
+
name: name,
|
|
1806
|
+
value: value,
|
|
1807
|
+
onChange: function onChange(e) {
|
|
1808
|
+
return _onChange(name, e.target.value);
|
|
1809
|
+
},
|
|
1810
|
+
disabled: disabled,
|
|
1811
|
+
placeholder: placeholder
|
|
1812
|
+
}));
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1516
1815
|
var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
|
|
1517
1816
|
var _error$response, _error$response$data, _error$response2, _error$response3, _error$response3$data;
|
|
1518
1817
|
var errorMessage = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title;
|
|
@@ -1564,13 +1863,13 @@ var customStyles = {
|
|
|
1564
1863
|
};
|
|
1565
1864
|
|
|
1566
1865
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
1567
|
-
return React__default.createElement(
|
|
1866
|
+
return React__default.createElement(ReactSelect.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
|
|
1568
1867
|
size: 20,
|
|
1569
1868
|
color: styleGlobal.darker
|
|
1570
1869
|
}));
|
|
1571
1870
|
};
|
|
1572
1871
|
var CustomOption = function CustomOption(props) {
|
|
1573
|
-
return React__default.createElement(
|
|
1872
|
+
return React__default.createElement(ReactSelect.components.Option, Object.assign({}, props), React__default.createElement("div", {
|
|
1574
1873
|
style: {
|
|
1575
1874
|
fontSize: "14px",
|
|
1576
1875
|
fontWeight: 500
|
|
@@ -1594,7 +1893,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
1594
1893
|
}) : options === null || options === void 0 ? void 0 : options.find(function (i) {
|
|
1595
1894
|
return i.value == value;
|
|
1596
1895
|
});
|
|
1597
|
-
return React__default.createElement(
|
|
1896
|
+
return React__default.createElement(ReactSelect__default, Object.assign({
|
|
1598
1897
|
isDisabled: isDisabled,
|
|
1599
1898
|
options: options,
|
|
1600
1899
|
value: !isDefault ? initialValues != null ? initialValues : null : undefined,
|
|
@@ -1629,7 +1928,7 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
|
1629
1928
|
}) : options.find(function (i) {
|
|
1630
1929
|
return i.value == value;
|
|
1631
1930
|
});
|
|
1632
|
-
return React__default.createElement(
|
|
1931
|
+
return React__default.createElement(ReactSelect__default, Object.assign({
|
|
1633
1932
|
isDisabled: isDisabled,
|
|
1634
1933
|
options: options,
|
|
1635
1934
|
value: !isDefault ? initialValues : undefined,
|
|
@@ -1694,7 +1993,7 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
|
1694
1993
|
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
|
|
1695
1994
|
return option.value === defaultValue;
|
|
1696
1995
|
}) || null : null;
|
|
1697
|
-
return React__default.createElement(
|
|
1996
|
+
return React__default.createElement(ReactSelect__default, Object.assign({
|
|
1698
1997
|
isDisabled: isDisabled,
|
|
1699
1998
|
options: options,
|
|
1700
1999
|
value: value,
|
|
@@ -1735,12 +2034,15 @@ exports.CoreButton = CoreButton;
|
|
|
1735
2034
|
exports.CoreCheckbox = CoreInput$1;
|
|
1736
2035
|
exports.CoreError = CoreError;
|
|
1737
2036
|
exports.CoreInput = CoreInput;
|
|
2037
|
+
exports.CoreInputCompact = CoreInputCompact;
|
|
1738
2038
|
exports.CoreModal = CoreModal;
|
|
1739
2039
|
exports.CoreRadio = CoreRadio;
|
|
1740
2040
|
exports.CoreRange = CoreRange;
|
|
1741
2041
|
exports.CoreSearch = CoreSearch;
|
|
1742
2042
|
exports.CoreSelect = CoreSelect;
|
|
2043
|
+
exports.CoreSelectCompact = CoreSelectCompact;
|
|
1743
2044
|
exports.CoreTextArea = CoreTextArea;
|
|
2045
|
+
exports.CoreTitleInput = CoreTitleInput;
|
|
1744
2046
|
exports.CustomAsyncSelect = CustomAsyncSelect;
|
|
1745
2047
|
exports.CustomCreatable = CustomCreatable;
|
|
1746
2048
|
exports.CustomPagination = CustomPagination;
|