diginet-core-ui 1.3.24
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/assets/avatar/default.svg +3 -0
- package/assets/images/menu/dhr/Default.svg +13 -0
- package/assets/images/menu/dhr/MHRM00N0001.svg +14 -0
- package/assets/images/menu/dhr/MHRM09N0001.svg +1 -0
- package/assets/images/menu/dhr/MHRM09N0002.svg +3 -0
- package/assets/images/menu/dhr/MHRM09N0003.svg +25 -0
- package/assets/images/menu/dhr/MHRM25N0001.svg +26 -0
- package/assets/images/menu/dhr/MHRM29N0001.svg +30 -0
- package/assets/images/menu/dhr/MHRM29N0015.svg +63 -0
- package/assets/images/menu/dhr/MHRM39N0012.svg +43 -0
- package/assets/images/menu/dhr/MHRM39N0013.svg +24 -0
- package/assets/images/menu/dhr/MHRM39N0014.svg +14 -0
- package/assets/images/menu/dhr/MHRM39N0015.svg +36 -0
- package/assets/images/menu/dhr/MHRM39N0016.svg +23 -0
- package/assets/images/menu/dhr/MHRM77N0001.svg +28 -0
- package/assets/images/menu/dhr/MHRM84N0001.svg +27 -0
- package/assets/images/menu/dhr/MHRM84N0002.svg +24 -0
- package/assets/images/menu/dhr/MHRM89N0001.svg +16 -0
- package/assets/images/menu/dhr/MHRP00N0001.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0001.svg +22 -0
- package/assets/images/menu/dhr/MHRP09N0002.svg +19 -0
- package/assets/images/menu/dhr/MHRP09N0003.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0004.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0005.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0006.svg +17 -0
- package/assets/images/menu/dhr/MHRP09N0007.svg +15 -0
- package/assets/images/menu/dhr/MHRP09N0008.svg +8 -0
- package/assets/images/menu/dhr/MHRP09N0009.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0010.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0011.svg +16 -0
- package/assets/images/menu/dhr/MHRP09N0012.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0013.svg +8 -0
- package/assets/images/menu/dhr/MHRP09N0014.svg +11 -0
- package/assets/images/menu/dhr/MHRP09N0015.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0016.svg +18 -0
- package/assets/images/menu/dhr/MHRP09N0017.svg +18 -0
- package/assets/images/menu/dhr/MHRP09N0018.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0019.svg +13 -0
- package/assets/images/menu/dhr/MHRP09N0020.svg +17 -0
- package/assets/images/menu/dhr/MHRP09N0021.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0022.svg +16 -0
- package/assets/images/menu/dhr/MHRP09N0023.svg +8 -0
- package/assets/images/menu/dhr/MHRP09N0024.svg +15 -0
- package/assets/images/menu/dhr/MHRP09N0025.svg +16 -0
- package/assets/images/menu/dhr/MHRP09N0026.svg +13 -0
- package/assets/images/menu/dhr/MHRP09N0027.svg +10 -0
- package/assets/images/menu/dhr/MHRP13N0001.svg +9 -0
- package/assets/images/menu/dhr/MHRP21N0001.svg +12 -0
- package/assets/images/menu/dhr/MHRP21N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP25N0001.svg +13 -0
- package/assets/images/menu/dhr/MHRP25N0002.svg +16 -0
- package/assets/images/menu/dhr/MHRP25N0003.svg +38 -0
- package/assets/images/menu/dhr/MHRP25N0004.svg +17 -0
- package/assets/images/menu/dhr/MHRP25N0005.svg +20 -0
- package/assets/images/menu/dhr/MHRP29N0001.svg +18 -0
- package/assets/images/menu/dhr/MHRP29N0002.svg +15 -0
- package/assets/images/menu/dhr/MHRP29N0003.svg +20 -0
- package/assets/images/menu/dhr/MHRP29N0004.svg +21 -0
- package/assets/images/menu/dhr/MHRP29N0005.svg +21 -0
- package/assets/images/menu/dhr/MHRP29N0006.svg +14 -0
- package/assets/images/menu/dhr/MHRP29N0007.svg +19 -0
- package/assets/images/menu/dhr/MHRP29N0008.svg +20 -0
- package/assets/images/menu/dhr/MHRP29N0009.svg +11 -0
- package/assets/images/menu/dhr/MHRP29N0010.svg +11 -0
- package/assets/images/menu/dhr/MHRP29N0011.svg +12 -0
- package/assets/images/menu/dhr/MHRP29N0013.svg +27 -0
- package/assets/images/menu/dhr/MHRP29N0014.svg +32 -0
- package/assets/images/menu/dhr/MHRP29N0016.svg +54 -0
- package/assets/images/menu/dhr/MHRP29N0017.svg +24 -0
- package/assets/images/menu/dhr/MHRP29N0018.svg +44 -0
- package/assets/images/menu/dhr/MHRP29N0019.svg +17 -0
- package/assets/images/menu/dhr/MHRP29N0020.svg +11 -0
- package/assets/images/menu/dhr/MHRP38N0001.svg +13 -0
- package/assets/images/menu/dhr/MHRP38N0002.svg +14 -0
- package/assets/images/menu/dhr/MHRP39N0001.svg +15 -0
- package/assets/images/menu/dhr/MHRP39N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP39N0003.svg +16 -0
- package/assets/images/menu/dhr/MHRP39N0004.svg +22 -0
- package/assets/images/menu/dhr/MHRP39N0005.svg +16 -0
- package/assets/images/menu/dhr/MHRP39N0006.svg +17 -0
- package/assets/images/menu/dhr/MHRP39N0007.svg +13 -0
- package/assets/images/menu/dhr/MHRP39N0008.svg +3 -0
- package/assets/images/menu/dhr/MHRP39N0009.svg +3 -0
- package/assets/images/menu/dhr/MHRP39N0010.svg +7 -0
- package/assets/images/menu/dhr/MHRP39N0011.svg +14 -0
- package/assets/images/menu/dhr/MHRP39N0013.svg +10 -0
- package/assets/images/menu/dhr/MHRP39N0014.svg +11 -0
- package/assets/images/menu/dhr/MHRP39N1222.svg +12 -0
- package/assets/images/menu/dhr/MHRP51N0001.svg +9 -0
- package/assets/images/menu/dhr/MHRP51N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP52N0001.svg +21 -0
- package/assets/images/menu/dhr/MHRP52N0002.svg +21 -0
- package/assets/images/menu/dhr/MHRP52N0003.svg +16 -0
- package/assets/images/menu/dhr/MHRP75N0001.svg +19 -0
- package/assets/images/menu/dhr/MHRP75N0002.svg +25 -0
- package/assets/images/menu/dhr/MHRP75N0003.svg +3 -0
- package/assets/images/menu/dhr/MHRP75N0006.svg +14 -0
- package/assets/images/menu/dhr/MHRP75N0007.svg +19 -0
- package/assets/images/menu/dhr/MHRP75N0008.svg +19 -0
- package/assets/images/menu/dhr/MHRP77N0007.svg +28 -0
- package/assets/images/menu/dhr/MHRP77N0008.svg +17 -0
- package/assets/images/menu/dhr/MHRP77N0009.svg +19 -0
- package/assets/images/menu/dhr/MHRP77N0010.svg +20 -0
- package/assets/images/menu/dhr/MHRP89N1000.svg +6 -0
- package/assets/images/menu/dhr/MHRP89N1001.svg +6 -0
- package/assets/images/menu/dhr/W00F0001.svg +3 -0
- package/assets/images/menu/dhr/W00F0002.svg +3 -0
- package/assets/images/menu/dhr/W00F0003.svg +3 -0
- package/assets/images/menu/dhr/W00F0004.svg +3 -0
- package/assets/images/menu/dhr/W00F0005.svg +1 -0
- package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -0
- package/assets/images/menu/dhr/W09F2000.svg +6 -0
- package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -0
- package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -0
- package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -0
- package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -0
- package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -0
- package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -0
- package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -0
- package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -0
- package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -0
- package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -0
- package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -0
- package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -0
- package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -0
- package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -0
- package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -0
- package/assets/images/menu/dhr/W77F1011.svg +19 -0
- package/assets/images/menu/dhr/W77F1013.svg +22 -0
- package/assets/images/menu/erp/W00F0001.svg +3 -0
- package/assets/images/menu/erp/W00F0002.svg +3 -0
- package/assets/images/menu/erp/W00F0003.svg +3 -0
- package/assets/images/menu/erp/W00F0004.svg +3 -0
- package/assets/images/menu/erp/W05F0001.svg +16 -0
- package/assets/images/menu/erp/W05F0001N0000.svg +16 -0
- package/assets/images/menu/erp/W05F0004N0000.svg +6 -0
- package/assets/images/menu/erp/W05F0006.svg +30 -0
- package/assets/images/menu/erp/W05F0007N0000.svg +6 -0
- package/assets/images/menu/erp/W05F0008.svg +14 -0
- package/assets/images/menu/erp/W05F4000.svg +9 -0
- package/assets/images/menu/erp/W06F0001.svg +17 -0
- package/assets/images/menu/erp/W06F0001N0000.svg +17 -0
- package/assets/images/menu/erp/W06F0004N0000.svg +22 -0
- package/assets/images/menu/erp/W06F0005.svg +22 -0
- package/assets/images/menu/erp/W06F0006.svg +55 -0
- package/assets/images/menu/erp/W06F0008.svg +17 -0
- package/assets/images/menu/erp/WA3F1025.svg +5 -0
- package/assets/images/menu/erp/WA3F2100.svg +10 -0
- package/components/accordion/context.js +6 -0
- package/components/accordion/css.js +159 -0
- package/components/accordion/details.js +60 -0
- package/components/accordion/group.js +122 -0
- package/components/accordion/index.js +117 -0
- package/components/accordion/summary.js +175 -0
- package/components/alert/index.js +264 -0
- package/components/alert/notify.js +192 -0
- package/components/avatar/index.js +556 -0
- package/components/badge/index.js +223 -0
- package/components/button/icon.js +493 -0
- package/components/button/index.js +653 -0
- package/components/button/more.js +135 -0
- package/components/button/ripple-effect.js +85 -0
- package/components/card/body-card.js +67 -0
- package/components/card/card.js +127 -0
- package/components/card/context.js +6 -0
- package/components/card/index.js +50 -0
- package/components/chart/Pie/Circle.js +50 -0
- package/components/chart/Pie/Sector.js +142 -0
- package/components/chart/Pie/Sectors.js +91 -0
- package/components/chart/Pie/index.js +311 -0
- package/components/chart/Pie-v2/Circle.js +50 -0
- package/components/chart/Pie-v2/Sector.js +128 -0
- package/components/chart/Pie-v2/Sectors.js +224 -0
- package/components/chart/Pie-v2/index.js +397 -0
- package/components/chart/bar/Axis.js +79 -0
- package/components/chart/bar/Bar.js +365 -0
- package/components/chart/bar/Grid.js +115 -0
- package/components/chart/bar/Labels.js +175 -0
- package/components/chart/bar/Points.js +111 -0
- package/components/chart/bar/index.js +172 -0
- package/components/chart/bar-v2/Axis.js +79 -0
- package/components/chart/bar-v2/Bar.js +374 -0
- package/components/chart/bar-v2/Grid.js +115 -0
- package/components/chart/bar-v2/Labels.js +175 -0
- package/components/chart/bar-v2/Points.js +111 -0
- package/components/chart/bar-v2/index.js +172 -0
- package/components/chart/line/Axis.js +79 -0
- package/components/chart/line/Grid.js +115 -0
- package/components/chart/line/Labels.js +172 -0
- package/components/chart/line/Path.js +163 -0
- package/components/chart/line/Point.js +348 -0
- package/components/chart/line/Title.js +56 -0
- package/components/chart/line/index.js +174 -0
- package/components/chart/line-v2/Axis.js +79 -0
- package/components/chart/line-v2/Grid.js +115 -0
- package/components/chart/line-v2/Labels.js +172 -0
- package/components/chart/line-v2/Path.js +163 -0
- package/components/chart/line-v2/Point.js +354 -0
- package/components/chart/line-v2/Title.js +56 -0
- package/components/chart/line-v2/index.js +174 -0
- package/components/check-text/index.js +157 -0
- package/components/check-text/interview-confirmation.js +172 -0
- package/components/check-text/interview-status.js +138 -0
- package/components/chip/attach.js +180 -0
- package/components/chip/index.js +340 -0
- package/components/collapse/index.js +67 -0
- package/components/dialogs/colors.js +11 -0
- package/components/divider/index.js +71 -0
- package/components/divider/style.js +12 -0
- package/components/form-control/attachment/index.js +1890 -0
- package/components/form-control/calendar/function.js +673 -0
- package/components/form-control/calendar/index.js +248 -0
- package/components/form-control/calendar/range.js +293 -0
- package/components/form-control/checkbox/index.js +306 -0
- package/components/form-control/control/index.js +92 -0
- package/components/form-control/date-picker/index-old.js +953 -0
- package/components/form-control/date-picker/index.js +676 -0
- package/components/form-control/date-range-picker/index.js +1305 -0
- package/components/form-control/dropdown/index.js +1865 -0
- package/components/form-control/dropdown-box/index.js +292 -0
- package/components/form-control/form/context.js +5 -0
- package/components/form-control/form/index.js +41 -0
- package/components/form-control/form-group/index.js +118 -0
- package/components/form-control/helper-text/index.js +71 -0
- package/components/form-control/input-base/index.js +733 -0
- package/components/form-control/label/index.js +73 -0
- package/components/form-control/money-input/index.js +491 -0
- package/components/form-control/number-input/index.js +633 -0
- package/components/form-control/phone-input/index.js +433 -0
- package/components/form-control/radio/index.js +263 -0
- package/components/form-control/text-input/index.js +523 -0
- package/components/form-control/time-picker/index.js +829 -0
- package/components/form-control/time-picker/swiper.js +590 -0
- package/components/form-control/toggle/index.js +250 -0
- package/components/form-view/helper-text.js +33 -0
- package/components/form-view/index.js +107 -0
- package/components/form-view/input.js +129 -0
- package/components/form-view/label.js +38 -0
- package/components/index.js +100 -0
- package/components/list/list-item-action.js +82 -0
- package/components/list/list-item-icon.js +76 -0
- package/components/list/list-item-text.js +57 -0
- package/components/list/list-item.js +114 -0
- package/components/list/list.js +155 -0
- package/components/list/sub-header.js +61 -0
- package/components/modal/body.js +71 -0
- package/components/modal/context.js +6 -0
- package/components/modal/footer.js +63 -0
- package/components/modal/header.js +108 -0
- package/components/modal/index.js +69 -0
- package/components/modal/modal.js +339 -0
- package/components/others/extra/index.js +124 -0
- package/components/others/scrollbar/index.js +95 -0
- package/components/paging/page-info.js +298 -0
- package/components/paging/page-selector.js +281 -0
- package/components/paper/index.js +119 -0
- package/components/popover/index.js +417 -0
- package/components/popup/danger_popup.js +215 -0
- package/components/popup/index.js +469 -0
- package/components/popup/proposals_popup.js +364 -0
- package/components/popup/v2/danger-popup.js +17 -0
- package/components/popup/v2/index.js +460 -0
- package/components/popup/v2/info-popup.js +17 -0
- package/components/popup/v2/success-popup.js +17 -0
- package/components/popup/v2/warning-popup.js +17 -0
- package/components/popup/v2/yes-no-popup.js +20 -0
- package/components/progress/circular.js +414 -0
- package/components/progress/linear.js +327 -0
- package/components/rating/index.js +392 -0
- package/components/slider/slider-container.js +356 -0
- package/components/slider/slider-item.js +183 -0
- package/components/status/index.js +123 -0
- package/components/tab/context.js +3 -0
- package/components/tab/tab-container.js +83 -0
- package/components/tab/tab-header.js +133 -0
- package/components/tab/tab-panel.js +51 -0
- package/components/tab/tab.js +206 -0
- package/components/tooltip/index.js +602 -0
- package/components/tooltip/portal.js +13 -0
- package/components/transfer/index.js +489 -0
- package/components/tree-view/css.js +94 -0
- package/components/tree-view/index.js +1009 -0
- package/components/typography/index.js +218 -0
- package/css/styles.css +1 -0
- package/css/styles.css.map +1 -0
- package/global/index.js +175 -0
- package/icons/basic.js +6326 -0
- package/icons/effect.js +171 -0
- package/icons/general/clock/clock.js +21 -0
- package/icons/general/color-handler/background.js +41 -0
- package/icons/general/color-handler/text.js +41 -0
- package/icons/general/emoji/emoji.js +35 -0
- package/icons/general/font-properties/bold.js +21 -0
- package/icons/general/font-properties/font-family.js +35 -0
- package/icons/general/font-properties/font-size.js +27 -0
- package/icons/general/font-properties/italic.js +21 -0
- package/icons/general/font-properties/underline.js +31 -0
- package/icons/general/hyperlink/hyperlink.js +38 -0
- package/icons/general/indent/decrease.js +55 -0
- package/icons/general/indent/increase.js +55 -0
- package/icons/general/index.js +21 -0
- package/icons/general/list/bullets.js +77 -0
- package/icons/general/list/numbering.js +71 -0
- package/icons/general/picture/picture.js +21 -0
- package/icons/general/steps/redo.js +21 -0
- package/icons/general/steps/undo.js +21 -0
- package/icons/general/text-align/center.js +21 -0
- package/icons/general/text-align/justify.js +21 -0
- package/icons/general/text-align/left.js +21 -0
- package/icons/general/text-align/right.js +21 -0
- package/icons/index.js +3 -0
- package/icons/menu/dhr.js +2440 -0
- package/icons/menu/erp.js +490 -0
- package/icons/menu/index.js +5 -0
- package/icons/menu/v2/index.js +52 -0
- package/locale/index.js +11 -0
- package/package.json +45 -0
- package/readme.md +517 -0
- package/styles/animation.js +890 -0
- package/styles/color-helper.js +504 -0
- package/styles/colors.js +306 -0
- package/styles/general.js +48 -0
- package/styles/media-queries.js +10 -0
- package/styles/typography.js +122 -0
- package/styles/utils.js +10 -0
- package/theme/index.js +5 -0
- package/theme/make-styles.js +95 -0
- package/theme/set-theme.js +39 -0
- package/theme/settings.js +230 -0
- package/theme/theme-provider.js +68 -0
- package/theme/theme.js +56 -0
- package/theme/with-styles.js +17 -0
- package/theme/with-theme.js +11 -0
- package/utils/array/array.js +186 -0
- package/utils/console.js +34 -0
- package/utils/date.js +471 -0
- package/utils/error/error.js +62 -0
- package/utils/error/errors.js +247 -0
- package/utils/getFileType.js +32 -0
- package/utils/index.js +23 -0
- package/utils/iterator.js +45 -0
- package/utils/map-parent.js +53 -0
- package/utils/number.js +64 -0
- package/utils/object/extend.js +57 -0
- package/utils/object/object.js +68 -0
- package/utils/parseHTML.js +8 -0
- package/utils/promisify.js +38 -0
- package/utils/randomString.js +33 -0
- package/utils/remove-unicode.js +6 -0
- package/utils/render-portal.js +90 -0
- package/utils/renderHTML.js +21 -0
- package/utils/renderIcon.js +57 -0
- package/utils/string/capitalize.js +3 -0
- package/utils/string/capitalizeSentenceCase.js +10 -0
- package/utils/string/string.js +81 -0
- package/utils/type.js +90 -0
- package/utils/updatePosition.js +36 -0
- package/utils/useOnClickOutside.js +23 -0
- package/utils/usePortal.js +56 -0
- package/utils/validate.js +149 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
/** @jsxRuntime classic */
|
|
4
|
+
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { jsx, css } from '@emotion/core';
|
|
9
|
+
import { CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
|
|
10
|
+
import Icon from '../../../icons';
|
|
11
|
+
import { renderIcon, onValidate } from '../../../utils';
|
|
12
|
+
const icons = {
|
|
13
|
+
default: `<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M15.5616 19.0007C15.4036 19.0007 15.2446 18.9637 15.0986 18.8877L9.99962 16.2237L4.90162 18.8877C4.56362 19.0627 4.15562 19.0327 3.84962 18.8087C3.54162 18.5847 3.38862 18.2057 3.45362 17.8307L4.42462 12.2027L0.304623 8.21765C0.030623 7.95265 -0.068377 7.55465 0.048623 7.19065C0.165623 6.82865 0.478623 6.56365 0.856623 6.50965L6.55662 5.68165L9.10462 0.555654C9.44262 -0.124346 10.5576 -0.124346 10.8956 0.555654L13.4436 5.68165L19.1436 6.50965C19.5216 6.56365 19.8346 6.82865 19.9516 7.19065C20.0686 7.55465 19.9696 7.95265 19.6956 8.21765L15.5756 12.2027L16.5466 17.8307C16.6116 18.2057 16.4576 18.5847 16.1506 18.8087C15.9766 18.9367 15.7696 19.0007 15.5616 19.0007Z" fill="#7F828E"/>
|
|
15
|
+
</svg>`,
|
|
16
|
+
success: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M18.997 8.974H19C19.551 8.974 19.999 9.42 20 9.971C20.008 12.642 18.975 15.157 17.091 17.051C15.208 18.945 12.7 19.992 10.029 20H10C7.33905 20 4.83605 18.968 2.94905 17.091C1.05505 15.208 0.00804612 12.7 4.61203e-05 10.029C-0.00795388 7.357 1.02505 4.843 2.90905 2.949C4.79205 1.055 7.30005 0.008 9.97105 0C10.766 0.012 11.576 0.092 12.352 0.278C12.888 0.408 13.219 0.948 13.089 1.485C12.96 2.021 12.417 2.351 11.883 2.223C11.262 2.073 10.603 2.01 9.97705 2C7.84005 2.006 5.83305 2.844 4.32705 4.359C2.82005 5.874 1.99405 7.886 2.00005 10.023C2.00605 12.16 2.84405 14.166 4.35905 15.673C5.86905 17.174 7.87105 18 10 18H10.023C12.16 17.994 14.167 17.156 15.673 15.641C17.18 14.125 18.006 12.114 18 9.977C17.999 9.425 18.445 8.975 18.997 8.974ZM6.29305 9.2929C6.68405 8.9019 7.31605 8.9019 7.70705 9.2929L9.95105 11.5369L16.248 4.3409C16.612 3.9279 17.243 3.8839 17.659 4.2479C18.074 4.6109 18.116 5.2429 17.752 5.6589L10.752 13.6589C10.57 13.8669 10.31 13.9899 10.033 13.9999H10C9.73505 13.9999 9.48105 13.8949 9.29305 13.7069L6.29305 10.7069C5.90205 10.3159 5.90205 9.6839 6.29305 9.2929Z" fill="#00C875"/>
|
|
18
|
+
</svg>`,
|
|
19
|
+
warning: `<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
20
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M14.7736 2.56003C14.4236 3.00003 14.5036 3.63003 14.9336 3.97003C16.6136 5.29003 17.6836 7.18003 17.9336 9.31003C18.1936 11.43 17.6036 13.53 16.2836 15.21L16.2736 15.23C14.9536 16.9 13.0636 17.96 10.9536 18.21C8.83361 18.46 6.73361 17.88 5.05361 16.56C3.37361 15.24 2.30361 13.34 2.05361 11.22C1.79361 9.09003 2.38361 7.00003 3.70361 5.32003C4.10361 4.84003 4.55361 4.36003 5.06361 3.96003C5.49361 3.62003 5.57361 2.99003 5.23361 2.56003C4.89361 2.13003 4.26361 2.05003 3.83361 2.39003C3.19361 2.88003 2.63361 3.47003 2.13361 4.08003C0.48361 6.18003 -0.246391 8.80003 0.0736095 11.45C0.393609 14.1 1.72361 16.47 3.82361 18.12C5.92361 19.77 8.54361 20.5 11.1936 20.18C13.8336 19.86 16.1936 18.54 17.8436 16.45L17.8636 16.43C19.5136 14.33 20.2436 11.71 19.9236 9.06003C19.6036 6.41003 18.2736 4.04003 16.1736 2.39003C15.7436 2.05003 15.1136 2.13003 14.7736 2.56003Z" fill="#FFAA00"/>
|
|
21
|
+
<path d="M12.0835 15.01C12.0535 16.17 11.0935 17.08 9.9335 17.05C8.8235 17.02 7.9235 16.13 7.8935 15.01V14.96C7.9235 13.8 8.8835 12.89 10.0435 12.92C11.1535 12.95 12.0535 13.84 12.0835 14.96V15.01ZM12.1335 1.23L11.0935 10.27C11.0935 10.88 10.6035 11.37 9.9935 11.37C9.3835 11.37 8.8935 10.88 8.8935 10.27L7.8535 1.23C7.7235 0.69 8.0535 0.16 8.5935 0.03C8.6735 0.01 8.7435 0 8.8135 0H11.1635C11.7235 0.01 12.1635 0.47 12.1535 1.02C12.1635 1.09 12.1535 1.16 12.1335 1.23Z" fill="#FFAA00"/>
|
|
22
|
+
</svg>`,
|
|
23
|
+
none: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
24
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M2 10C2 8.154 2.635 6.458 3.688 5.103L14.897 16.312C13.542 17.366 11.846 18 10 18C5.589 18 2 14.411 2 10ZM18 10C18 11.846 17.365 13.542 16.312 14.897L5.103 3.688C6.458 2.634 8.154 2 10 2C14.411 2 18 5.589 18 10ZM10 0C4.486 0 0 4.486 0 10C0 15.514 4.486 20 10 20C15.514 20 20 15.514 20 10C20 4.486 15.514 0 10 0Z" fill="#FF3D71"/>
|
|
25
|
+
</svg>`,
|
|
26
|
+
danger: `<svg width="16" height="22" style="max-height:20px" viewBox="0 0 16 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
27
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M7.11087 22.0002C6.99687 22.0002 6.88187 21.9802 6.76887 21.9392C6.33687 21.7822 6.06687 21.3502 6.11687 20.8932L6.88487 13.8002H0.999871C0.630871 13.8002 0.291871 13.5972 0.117871 13.2712C-0.056129 12.9452 -0.036129 12.5512 0.168871 12.2442L8.05687 0.444182C8.31287 0.0611818 8.79687 -0.0978183 9.22987 0.0611817C9.66287 0.218182 9.93187 0.650182 9.88187 1.10718L9.11387 8.20018H14.9999C15.3689 8.20018 15.7079 8.40318 15.8819 8.72918C16.0549 9.05518 16.0359 9.44918 15.8309 9.75618L7.94187 21.5562C7.75287 21.8402 7.43687 22.0002 7.11087 22.0002Z" fill="#FF3D71"/>
|
|
28
|
+
</svg>`
|
|
29
|
+
};
|
|
30
|
+
const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
31
|
+
type,
|
|
32
|
+
viewType,
|
|
33
|
+
required,
|
|
34
|
+
loading,
|
|
35
|
+
autoIncreaseBot,
|
|
36
|
+
className,
|
|
37
|
+
label,
|
|
38
|
+
defaultValue,
|
|
39
|
+
value,
|
|
40
|
+
placeholder,
|
|
41
|
+
resize,
|
|
42
|
+
startIcon,
|
|
43
|
+
endIcon,
|
|
44
|
+
startIconProps,
|
|
45
|
+
endIconProps,
|
|
46
|
+
status,
|
|
47
|
+
icon,
|
|
48
|
+
autoComplete,
|
|
49
|
+
autoFocus,
|
|
50
|
+
disabled,
|
|
51
|
+
readOnly,
|
|
52
|
+
multiline,
|
|
53
|
+
onConfirm,
|
|
54
|
+
refs,
|
|
55
|
+
rows,
|
|
56
|
+
maxRows,
|
|
57
|
+
style,
|
|
58
|
+
iconStyle,
|
|
59
|
+
inputRef,
|
|
60
|
+
inputProps,
|
|
61
|
+
inputStyle,
|
|
62
|
+
labelProps,
|
|
63
|
+
errorProps,
|
|
64
|
+
error,
|
|
65
|
+
onChange,
|
|
66
|
+
onBlur,
|
|
67
|
+
onFocus,
|
|
68
|
+
onInput,
|
|
69
|
+
onKeyDown,
|
|
70
|
+
onKeyUp,
|
|
71
|
+
onPaste,
|
|
72
|
+
validates,
|
|
73
|
+
...props
|
|
74
|
+
}, reference) => {
|
|
75
|
+
const ref = useRef(null);
|
|
76
|
+
|
|
77
|
+
if (!inputRef) {
|
|
78
|
+
inputRef = useRef(null);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const iconRef = useRef(null);
|
|
82
|
+
let currentValue = '';
|
|
83
|
+
const isError = !!error && !value && value !== 0;
|
|
84
|
+
/* Start styled */
|
|
85
|
+
|
|
86
|
+
const TextInputRoot = css`
|
|
87
|
+
display: block;
|
|
88
|
+
position: relative;
|
|
89
|
+
margin-bottom: 20px;
|
|
90
|
+
`;
|
|
91
|
+
const TextInputIcon = css`
|
|
92
|
+
display: flex;
|
|
93
|
+
color: inherit;
|
|
94
|
+
.edit-icon-pen {
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
.edit-icon-confirm {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
.edit-icon-clear {
|
|
101
|
+
display: none;
|
|
102
|
+
margin-left: 12px;
|
|
103
|
+
}
|
|
104
|
+
.circular {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
/* End styled */
|
|
109
|
+
|
|
110
|
+
/* Start handler */
|
|
111
|
+
|
|
112
|
+
const onMouseDownHandler = () => {
|
|
113
|
+
ref.current.querySelector(`.css-${TextInputBox.name}`).style.backgroundColor = 'transparent';
|
|
114
|
+
inputRef.current.style.backgroundColor = 'transparent';
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const onPressTab = e => {
|
|
118
|
+
if (e.key === 'Tab') {
|
|
119
|
+
onClickOutsideOfInput({
|
|
120
|
+
target: null
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const onFocusInput = () => {
|
|
128
|
+
if (!inputRef.current.readOnly) {
|
|
129
|
+
iconRef.current.querySelector('.edit-icon-pen').style.display = 'none';
|
|
130
|
+
iconRef.current.querySelector('.edit-icon-confirm').style.display = 'flex';
|
|
131
|
+
iconRef.current.querySelector('.edit-icon-clear').style.display = 'flex';
|
|
132
|
+
document.addEventListener('click', onClickOutsideOfInput);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const onClickOutsideOfInput = event => {
|
|
137
|
+
if (!inputRef.current || !iconRef.current) {
|
|
138
|
+
document.removeEventListener('click', onClickOutsideOfInput);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (!inputRef.current.contains(event.target) && !iconRef.current.contains(event.target)) {
|
|
143
|
+
if (!inputRef.current.readOnly) {
|
|
144
|
+
onConfirmEdit();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
document.removeEventListener('click', onClickOutsideOfInput);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const onClickQuickEdit = () => {
|
|
152
|
+
inputRef.current.focus();
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const onConfirmEdit = () => {
|
|
156
|
+
const value = inputRef.current.value;
|
|
157
|
+
|
|
158
|
+
if (!value || value === currentValue) {
|
|
159
|
+
inputRef.current.value = currentValue;
|
|
160
|
+
goToStart();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
;
|
|
165
|
+
currentValue = value;
|
|
166
|
+
if (onConfirm) onConfirm({
|
|
167
|
+
value
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const onClear = () => {
|
|
172
|
+
inputRef.current.value = '';
|
|
173
|
+
inputRef.current.focus();
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const goToStart = () => {
|
|
177
|
+
iconRef.current.querySelector('.circular').style.display = null;
|
|
178
|
+
iconRef.current.querySelector('.edit-icon-pen').style.display = null;
|
|
179
|
+
iconRef.current.querySelector('.edit-icon-confirm').style.display = null;
|
|
180
|
+
iconRef.current.querySelector('.edit-icon-confirm').style.opacity = null;
|
|
181
|
+
iconRef.current.querySelector('.edit-icon-clear').style = null;
|
|
182
|
+
inputRef.current.disabled = false;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
!!refs && refs(ref);
|
|
187
|
+
|
|
188
|
+
if (defaultValue !== undefined && defaultValue !== '') {
|
|
189
|
+
currentValue = defaultValue;
|
|
190
|
+
}
|
|
191
|
+
}, []);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
if (/^(quick)?Edit/i.test(type) && !multiline) {
|
|
194
|
+
inputRef.current.addEventListener('focus', onFocusInput);
|
|
195
|
+
inputRef.current.addEventListener('keydown', onPressTab);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (autoFocus) {
|
|
199
|
+
inputRef.current.focus();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return () => {
|
|
203
|
+
if (/^(quick)?Edit/i.test(type) && !multiline) {
|
|
204
|
+
if (inputRef.current) {
|
|
205
|
+
inputRef.current.removeEventListener('focus', onFocusInput);
|
|
206
|
+
inputRef.current.removeEventListener('keydown', onPressTab);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}, [type, multiline]);
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
if (/inform/i.test(type) && !multiline) {
|
|
213
|
+
const regexp = /(success)|(warning)|(danger)/ig;
|
|
214
|
+
const existedClass = ref.current.classList.value.match(regexp);
|
|
215
|
+
|
|
216
|
+
if (existedClass) {
|
|
217
|
+
ref.current.classList.remove(existedClass[0]);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
ref.current.classList.add(status);
|
|
221
|
+
|
|
222
|
+
if (!icon) {
|
|
223
|
+
iconRef.current.innerHTML = icons[status];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}, [status]);
|
|
227
|
+
useEffect(() => {
|
|
228
|
+
if (error && !value && value !== 0) {
|
|
229
|
+
ref.current.classList.add('danger');
|
|
230
|
+
|
|
231
|
+
if (autoIncreaseBot) {
|
|
232
|
+
const helperTextNode = ref.current.querySelector('.DGN-UI-HelperText');
|
|
233
|
+
|
|
234
|
+
if (helperTextNode) {
|
|
235
|
+
if (helperTextNode.offsetHeight > 20) {
|
|
236
|
+
ref.current.style.marginBottom = helperTextNode.offsetHeight + 4 + 'px';
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return () => {
|
|
242
|
+
if (ref.current) {
|
|
243
|
+
ref.current.classList.remove('danger');
|
|
244
|
+
ref.current.style.marginBottom = null;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}, [error, value]);
|
|
249
|
+
useEffect(() => {
|
|
250
|
+
if (placeholder !== undefined) {
|
|
251
|
+
inputRef.current.placeholder = placeholder;
|
|
252
|
+
}
|
|
253
|
+
}, [placeholder]);
|
|
254
|
+
useEffect(() => {
|
|
255
|
+
inputRef.current.readOnly = !!readOnly;
|
|
256
|
+
|
|
257
|
+
if (/^(quick)?Edit/i.test(type) && !multiline && readOnly) {
|
|
258
|
+
inputRef.current.parentNode.parentNode.classList.add('readOnly');
|
|
259
|
+
iconRef.current.querySelector('.edit-icon-pen').style.pointerEvents = 'none';
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (disabled) {
|
|
263
|
+
ref.current.classList.add('disabled');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return () => {
|
|
267
|
+
if (/^(quick)?Edit/i.test(type) && !multiline && readOnly) {
|
|
268
|
+
inputRef.current.parentNode.parentNode.classList.remove('readOnly');
|
|
269
|
+
iconRef.current.querySelector('.edit-icon-pen').style.pointerEvents = null;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
ref.current && ref.current.classList.remove('disabled');
|
|
273
|
+
};
|
|
274
|
+
}, [disabled, readOnly]);
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
if (/^(quick)?Edit/i.test(type) && iconRef.current) {
|
|
277
|
+
if (loading) {
|
|
278
|
+
iconRef.current.querySelector('.circular').style.display = 'flex';
|
|
279
|
+
iconRef.current.querySelector('.edit-icon-confirm').style.opacity = 0;
|
|
280
|
+
iconRef.current.querySelector('.edit-icon-clear').style.pointerEvents = 'none';
|
|
281
|
+
inputRef.current.disabled = true;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return () => {
|
|
285
|
+
if (loading) {
|
|
286
|
+
goToStart();
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}, [loading]);
|
|
291
|
+
/* End handler */
|
|
292
|
+
|
|
293
|
+
useImperativeHandle(reference, () => ref.current);
|
|
294
|
+
const validateResult = validates && onValidate(value, validates, true);
|
|
295
|
+
const startIconCustom = icon && type !== 'inform' ? icon : startIcon;
|
|
296
|
+
const endIconCustom = /^inform$/i.test(type) ? jsx("div", {
|
|
297
|
+
ref: iconRef,
|
|
298
|
+
css: TextInputIcon,
|
|
299
|
+
style: {
|
|
300
|
+
maxHeight: '20px'
|
|
301
|
+
}
|
|
302
|
+
}, renderIcon(icon, null, {
|
|
303
|
+
style: {
|
|
304
|
+
maxHeight: '20px',
|
|
305
|
+
...iconStyle
|
|
306
|
+
}
|
|
307
|
+
})) : /^(quick)?Edit/i.test(type) ? jsx("div", {
|
|
308
|
+
ref: iconRef,
|
|
309
|
+
css: TextInputIcon
|
|
310
|
+
}, jsx(Icon, {
|
|
311
|
+
name: 'Edit',
|
|
312
|
+
className: 'edit-icon-pen',
|
|
313
|
+
width: 20,
|
|
314
|
+
height: 20,
|
|
315
|
+
style: {
|
|
316
|
+
padding: 0
|
|
317
|
+
},
|
|
318
|
+
onClick: onClickQuickEdit
|
|
319
|
+
}), jsx(Icon, {
|
|
320
|
+
name: 'Approval',
|
|
321
|
+
className: 'edit-icon-confirm',
|
|
322
|
+
width: 20,
|
|
323
|
+
height: 20,
|
|
324
|
+
style: {
|
|
325
|
+
padding: 0
|
|
326
|
+
},
|
|
327
|
+
onClick: onConfirmEdit
|
|
328
|
+
}), jsx("span", {
|
|
329
|
+
className: 'circular'
|
|
330
|
+
}, jsx(Circular, {
|
|
331
|
+
width: 24,
|
|
332
|
+
strokeWidth: 2
|
|
333
|
+
})), jsx(Icon, {
|
|
334
|
+
name: 'Close',
|
|
335
|
+
className: 'edit-icon-clear',
|
|
336
|
+
width: 16,
|
|
337
|
+
height: 16,
|
|
338
|
+
onClick: onClear,
|
|
339
|
+
onMouseDown: onMouseDownHandler
|
|
340
|
+
})) : endIcon;
|
|
341
|
+
return jsx("div", _extends({
|
|
342
|
+
ref: ref,
|
|
343
|
+
css: TextInputRoot,
|
|
344
|
+
className: ['DGN-UI-TextInput', className].join(' ').trim(),
|
|
345
|
+
style: style
|
|
346
|
+
}, props), !!label && jsx(Label, _extends({
|
|
347
|
+
required: required,
|
|
348
|
+
disabled: disabled
|
|
349
|
+
}, labelProps), label), jsx(InputBase, {
|
|
350
|
+
type: /text|number|password/.test(type) ? type : 'text',
|
|
351
|
+
autoComplete: autoComplete,
|
|
352
|
+
inputRef: inputRef,
|
|
353
|
+
viewType: viewType,
|
|
354
|
+
defaultValue: defaultValue,
|
|
355
|
+
value: value,
|
|
356
|
+
placeholder: placeholder,
|
|
357
|
+
autoFocus: autoFocus,
|
|
358
|
+
disabled: disabled,
|
|
359
|
+
readOnly: readOnly,
|
|
360
|
+
multiline: multiline,
|
|
361
|
+
rows: rows,
|
|
362
|
+
maxRows: maxRows,
|
|
363
|
+
status: isError || validateResult ? 'danger' : 'default',
|
|
364
|
+
inputProps: inputProps,
|
|
365
|
+
inputStyle: inputStyle,
|
|
366
|
+
startIcon: startIconCustom,
|
|
367
|
+
startIconProps: startIconProps,
|
|
368
|
+
endIcon: endIconCustom,
|
|
369
|
+
endIconProps: endIconProps,
|
|
370
|
+
onChange: onChange,
|
|
371
|
+
onBlur: onBlur,
|
|
372
|
+
onFocus: onFocus,
|
|
373
|
+
onInput: onInput,
|
|
374
|
+
onKeyDown: onKeyDown,
|
|
375
|
+
onKeyUp: onKeyUp,
|
|
376
|
+
onPaste: onPaste
|
|
377
|
+
}), isError && jsx(HelperText, {
|
|
378
|
+
disabled: disabled,
|
|
379
|
+
status: status
|
|
380
|
+
}, error), !isError && validateResult && jsx(HelperText, {
|
|
381
|
+
disabled: disabled
|
|
382
|
+
}, validateResult));
|
|
383
|
+
}));
|
|
384
|
+
TextInput.defaultProps = {
|
|
385
|
+
type: 'text',
|
|
386
|
+
viewType: 'underlined',
|
|
387
|
+
label: '',
|
|
388
|
+
className: '',
|
|
389
|
+
defaultValue: '',
|
|
390
|
+
placeholder: '',
|
|
391
|
+
status: 'default',
|
|
392
|
+
error: '',
|
|
393
|
+
resize: 'none',
|
|
394
|
+
autoComplete: 'off',
|
|
395
|
+
required: false,
|
|
396
|
+
loading: false,
|
|
397
|
+
autoFocus: false,
|
|
398
|
+
autoIncreaseBot: false,
|
|
399
|
+
disabled: false,
|
|
400
|
+
readOnly: false,
|
|
401
|
+
multiline: false,
|
|
402
|
+
iconStyle: {}
|
|
403
|
+
};
|
|
404
|
+
TextInput.propTypes = {
|
|
405
|
+
/** type of input */
|
|
406
|
+
type: PropTypes.oneOf(['inform', 'edit', 'quickEdit', 'text', 'number', 'password']),
|
|
407
|
+
|
|
408
|
+
/** the type of border you want to display */
|
|
409
|
+
viewType: PropTypes.oneOf(['underlined', 'outlined']),
|
|
410
|
+
|
|
411
|
+
/** label for input */
|
|
412
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
413
|
+
|
|
414
|
+
/** class for input */
|
|
415
|
+
className: PropTypes.string,
|
|
416
|
+
|
|
417
|
+
/** default value is displayed for first render */
|
|
418
|
+
defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
419
|
+
|
|
420
|
+
/** the displayed value for each change */
|
|
421
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
422
|
+
|
|
423
|
+
/** hints for input */
|
|
424
|
+
placeholder: PropTypes.string,
|
|
425
|
+
|
|
426
|
+
/** status type to display color for input (only available for type is inform) */
|
|
427
|
+
status: PropTypes.oneOf(['default', 'warning', 'success', 'danger']),
|
|
428
|
+
|
|
429
|
+
/** error for input */
|
|
430
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
431
|
+
|
|
432
|
+
/** the number of rows of textarea */
|
|
433
|
+
rows: PropTypes.number,
|
|
434
|
+
|
|
435
|
+
/** the maximum of rows of textarea */
|
|
436
|
+
maxRows: PropTypes.number,
|
|
437
|
+
|
|
438
|
+
/** type auto complete of input (like new-password) */
|
|
439
|
+
autoComplete: PropTypes.string,
|
|
440
|
+
|
|
441
|
+
/** allow resize multiline input (resize css style) */
|
|
442
|
+
resize: PropTypes.string,
|
|
443
|
+
|
|
444
|
+
/** prevent all event if true, hide all icon */
|
|
445
|
+
disabled: PropTypes.bool,
|
|
446
|
+
|
|
447
|
+
/** prevent all event if true */
|
|
448
|
+
readOnly: PropTypes.bool,
|
|
449
|
+
|
|
450
|
+
/** auto focus after first render */
|
|
451
|
+
autoFocus: PropTypes.bool,
|
|
452
|
+
|
|
453
|
+
/** auto increase margin-bottom if error too long */
|
|
454
|
+
autoIncreaseBot: PropTypes.bool,
|
|
455
|
+
|
|
456
|
+
/** At least one character is required */
|
|
457
|
+
required: PropTypes.bool,
|
|
458
|
+
|
|
459
|
+
/** icon element display in the right of input (only use for type is inform, if not, use startIcon instead) */
|
|
460
|
+
icon: PropTypes.any,
|
|
461
|
+
|
|
462
|
+
/** icon element display in the left of input */
|
|
463
|
+
startIcon: PropTypes.any,
|
|
464
|
+
|
|
465
|
+
/** icon element display in the right of input */
|
|
466
|
+
endIcon: PropTypes.any,
|
|
467
|
+
|
|
468
|
+
/** props of start icon in InputBase component */
|
|
469
|
+
startIconProps: PropTypes.object,
|
|
470
|
+
|
|
471
|
+
/** props of end icon in InputBase component */
|
|
472
|
+
endIconProps: PropTypes.object,
|
|
473
|
+
|
|
474
|
+
/** style inline for icon */
|
|
475
|
+
iconStyle: PropTypes.object,
|
|
476
|
+
|
|
477
|
+
/** style inline for dropdown */
|
|
478
|
+
style: PropTypes.object,
|
|
479
|
+
|
|
480
|
+
/** props of input in TextInput component */
|
|
481
|
+
inputProps: PropTypes.object,
|
|
482
|
+
|
|
483
|
+
/** style inline of input in TextInput component */
|
|
484
|
+
inputStyle: PropTypes.object,
|
|
485
|
+
|
|
486
|
+
/** any props of label in TextInput component */
|
|
487
|
+
labelProps: PropTypes.object,
|
|
488
|
+
|
|
489
|
+
/** any props of error in TextInput component */
|
|
490
|
+
errorProps: PropTypes.object,
|
|
491
|
+
|
|
492
|
+
/** The function to get ref of Dropdown component */
|
|
493
|
+
refs: PropTypes.func,
|
|
494
|
+
|
|
495
|
+
/** on key down function */
|
|
496
|
+
onKeyDown: PropTypes.func,
|
|
497
|
+
|
|
498
|
+
/** on key up function */
|
|
499
|
+
onKeyUp: PropTypes.func,
|
|
500
|
+
|
|
501
|
+
/** on input function */
|
|
502
|
+
onInput: PropTypes.func,
|
|
503
|
+
|
|
504
|
+
/** on change function */
|
|
505
|
+
onChange: PropTypes.func,
|
|
506
|
+
|
|
507
|
+
/** on blur function */
|
|
508
|
+
onBlur: PropTypes.func,
|
|
509
|
+
|
|
510
|
+
/** on focus function */
|
|
511
|
+
onFocus: PropTypes.func,
|
|
512
|
+
|
|
513
|
+
/** validation value, argument can:<br/>
|
|
514
|
+
* * string: the validation rule. Example required.<br/>
|
|
515
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
516
|
+
* * array: the validation rule list, insist object/string
|
|
517
|
+
*/
|
|
518
|
+
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
519
|
+
|
|
520
|
+
/** inputRef of TextInput component */
|
|
521
|
+
inputRef: PropTypes.any
|
|
522
|
+
};
|
|
523
|
+
export default TextInput;
|