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,135 @@
|
|
|
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, useRef, useState, useEffect, forwardRef } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { jsx, css } from '@emotion/core';
|
|
9
|
+
import Button from './';
|
|
10
|
+
import Icon from './icon';
|
|
11
|
+
import { ArrowDown, Close } from '../../icons';
|
|
12
|
+
import { Popover } from '../';
|
|
13
|
+
const ButtonMore = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
14
|
+
viewType,
|
|
15
|
+
color,
|
|
16
|
+
size,
|
|
17
|
+
disabled,
|
|
18
|
+
children,
|
|
19
|
+
loading,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
22
|
+
if (!ref) {
|
|
23
|
+
ref = useRef(null);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
|
+
const ButtonMoreStyle = css`
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
button {
|
|
30
|
+
:first-of-type {
|
|
31
|
+
border-top-right-radius: 0;
|
|
32
|
+
border-bottom-right-radius: 0;
|
|
33
|
+
margin-right: 1px;
|
|
34
|
+
}
|
|
35
|
+
:last-of-type {
|
|
36
|
+
border-top-left-radius: 0;
|
|
37
|
+
border-bottom-left-radius: 0;
|
|
38
|
+
margin-left: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.more-icon-close {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const showMoreOption = e => {
|
|
47
|
+
if (!open) {
|
|
48
|
+
setOpen(true);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const iconCloseEl = ref.current.querySelector('.more-icon-close');
|
|
54
|
+
const iconDownEl = ref.current.querySelector('.more-icon-down');
|
|
55
|
+
|
|
56
|
+
if (open) {
|
|
57
|
+
iconCloseEl.style.display = 'block';
|
|
58
|
+
iconDownEl.style.display = 'none';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return () => {
|
|
62
|
+
if (open) {
|
|
63
|
+
iconCloseEl.style.display = null;
|
|
64
|
+
iconDownEl.style.display = null;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}, [open]);
|
|
68
|
+
return jsx("div", {
|
|
69
|
+
css: ButtonMoreStyle,
|
|
70
|
+
ref: ref
|
|
71
|
+
}, jsx(Button, _extends({
|
|
72
|
+
viewType: viewType,
|
|
73
|
+
color: color,
|
|
74
|
+
size: size,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
loading: loading
|
|
77
|
+
}, props)), jsx(Icon, {
|
|
78
|
+
viewType: viewType,
|
|
79
|
+
color: color,
|
|
80
|
+
size: size,
|
|
81
|
+
disabled: disabled,
|
|
82
|
+
onClick: showMoreOption
|
|
83
|
+
}, jsx("span", {
|
|
84
|
+
className: 'more-icon-down'
|
|
85
|
+
}, jsx(ArrowDown, {
|
|
86
|
+
color: 'currentColor'
|
|
87
|
+
})), jsx("span", {
|
|
88
|
+
className: 'more-icon-close'
|
|
89
|
+
}, jsx(Close, {
|
|
90
|
+
color: 'currentColor',
|
|
91
|
+
viewBox: true
|
|
92
|
+
}))), jsx(Popover, {
|
|
93
|
+
open: open,
|
|
94
|
+
anchor: ref,
|
|
95
|
+
fullScreen: false,
|
|
96
|
+
onClose: () => setOpen(false),
|
|
97
|
+
anchorOrigin: {
|
|
98
|
+
vertical: 'bottom',
|
|
99
|
+
horizontal: 'left'
|
|
100
|
+
},
|
|
101
|
+
transformOrigin: {
|
|
102
|
+
vertical: 'top',
|
|
103
|
+
horizontal: 'left'
|
|
104
|
+
}
|
|
105
|
+
}, children));
|
|
106
|
+
}));
|
|
107
|
+
ButtonMore.defaultProps = {
|
|
108
|
+
viewType: 'filled',
|
|
109
|
+
color: 'primary',
|
|
110
|
+
size: 'medium',
|
|
111
|
+
disabled: false
|
|
112
|
+
};
|
|
113
|
+
ButtonMore.propTypes = {
|
|
114
|
+
/** used to fill background for button */
|
|
115
|
+
viewType: PropTypes.oneOf(['text', 'outlined', 'filled']),
|
|
116
|
+
|
|
117
|
+
/** color for button */
|
|
118
|
+
color: PropTypes.string,
|
|
119
|
+
|
|
120
|
+
/** size button */
|
|
121
|
+
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant']),
|
|
122
|
+
|
|
123
|
+
/** prevent all event if true */
|
|
124
|
+
disabled: PropTypes.bool,
|
|
125
|
+
|
|
126
|
+
/** more options element to display */
|
|
127
|
+
children: PropTypes.node,
|
|
128
|
+
|
|
129
|
+
/** any props else for Button component */
|
|
130
|
+
props: PropTypes.any,
|
|
131
|
+
|
|
132
|
+
/** status loading of button */
|
|
133
|
+
loading: PropTypes.bool
|
|
134
|
+
};
|
|
135
|
+
export default ButtonMore;
|
|
@@ -0,0 +1,85 @@
|
|
|
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 { jsx, css } from '@emotion/core';
|
|
7
|
+
import React, { useLayoutEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
const useDebouncedRippleCleanUp = (rippleCount, duration, cleanUpFunction) => {
|
|
10
|
+
useLayoutEffect(() => {
|
|
11
|
+
if (rippleCount > 0) {
|
|
12
|
+
const bounce = setTimeout(() => cleanUpFunction(), duration);
|
|
13
|
+
return () => clearTimeout(bounce);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return undefined;
|
|
17
|
+
}, [rippleCount, duration, cleanUpFunction]);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const Ripple = ({
|
|
21
|
+
duration = 850,
|
|
22
|
+
color = '#fff',
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
const [rippleArray, setRippleArray] = useState([]);
|
|
26
|
+
useDebouncedRippleCleanUp(rippleArray.length, duration, () => {
|
|
27
|
+
setRippleArray([]);
|
|
28
|
+
});
|
|
29
|
+
const RippleContainer = css`
|
|
30
|
+
position: absolute;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
top: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
bottom: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
|
|
37
|
+
span {
|
|
38
|
+
transform: scale(0);
|
|
39
|
+
border-radius: 100%;
|
|
40
|
+
position: absolute;
|
|
41
|
+
opacity: 0.75;
|
|
42
|
+
background-color: ${color};
|
|
43
|
+
animation-name: ripple;
|
|
44
|
+
animation-duration: ${duration}ms;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes ripple {
|
|
48
|
+
to {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
transform: scale(2);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
const addRipple = event => {
|
|
56
|
+
const rippleContainer = event.currentTarget.getBoundingClientRect();
|
|
57
|
+
const size = rippleContainer.width > rippleContainer.height ? rippleContainer.width : rippleContainer.height;
|
|
58
|
+
const x = event.pageX - rippleContainer.x - rippleContainer.width / 2;
|
|
59
|
+
const y = event.pageY - rippleContainer.y - rippleContainer.width / 2;
|
|
60
|
+
const newRippleArray = {
|
|
61
|
+
x,
|
|
62
|
+
y,
|
|
63
|
+
size
|
|
64
|
+
};
|
|
65
|
+
setRippleArray(prevState => [...prevState, newRippleArray]);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return jsx("span", _extends({
|
|
69
|
+
css: RippleContainer
|
|
70
|
+
}, props, {
|
|
71
|
+
onMouseDown: addRipple
|
|
72
|
+
}), rippleArray.length > 0 && rippleArray.map((ripple, index) => {
|
|
73
|
+
return jsx("span", {
|
|
74
|
+
key: 'ripple_' + index,
|
|
75
|
+
style: {
|
|
76
|
+
top: ripple.y,
|
|
77
|
+
left: ripple.x,
|
|
78
|
+
width: ripple.size,
|
|
79
|
+
height: ripple.size
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default /*#__PURE__*/React.memo(Ripple);
|
|
@@ -0,0 +1,67 @@
|
|
|
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, useMemo, useEffect, forwardRef } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { jsx, css } from '@emotion/core';
|
|
9
|
+
import theme from '../../theme/settings';
|
|
10
|
+
const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
11
|
+
children,
|
|
12
|
+
background,
|
|
13
|
+
style,
|
|
14
|
+
refs,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) => {
|
|
17
|
+
const CardBodyBox = css`
|
|
18
|
+
display: block;
|
|
19
|
+
position: relative;
|
|
20
|
+
background-color: ${background};
|
|
21
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
padding: 12px 24px;
|
|
25
|
+
overflow: auto;
|
|
26
|
+
order: 2;
|
|
27
|
+
height: auto;
|
|
28
|
+
width: 100%;
|
|
29
|
+
img{
|
|
30
|
+
object-fit: cover;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
border-radius: 20px;
|
|
34
|
+
}
|
|
35
|
+
&::-webkit-scrollbar {
|
|
36
|
+
width: 8px;
|
|
37
|
+
height: 8px;
|
|
38
|
+
}
|
|
39
|
+
&::-webkit-scrollbar-thumb{
|
|
40
|
+
border-radius: 10px;
|
|
41
|
+
mix-blend-mode: normal;
|
|
42
|
+
background-color: ${theme.colors.bgDisabled};
|
|
43
|
+
background-clip: content-box;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
!!refs && refs(ref);
|
|
48
|
+
}, []);
|
|
49
|
+
const Body = useMemo(() => jsx("div", _extends({
|
|
50
|
+
css: CardBodyBox
|
|
51
|
+
}, props, {
|
|
52
|
+
style: style,
|
|
53
|
+
ref: ref
|
|
54
|
+
}), children), [children, style]);
|
|
55
|
+
return Body;
|
|
56
|
+
}));
|
|
57
|
+
CardBody.propTypes = {
|
|
58
|
+
/** customize style inline */
|
|
59
|
+
style: PropTypes.object,
|
|
60
|
+
|
|
61
|
+
/** get card header ref by function */
|
|
62
|
+
refs: PropTypes.func,
|
|
63
|
+
|
|
64
|
+
/** child content in header (like title) */
|
|
65
|
+
children: PropTypes.node
|
|
66
|
+
};
|
|
67
|
+
export default CardBody;
|
|
@@ -0,0 +1,127 @@
|
|
|
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, useRef, forwardRef, useMemo } from 'react';
|
|
7
|
+
import { createPortal } from 'react-dom';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { jsx, css } from '@emotion/core';
|
|
10
|
+
import CardContext from './context';
|
|
11
|
+
import theme from '../../theme/settings';
|
|
12
|
+
const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
13
|
+
open,
|
|
14
|
+
type,
|
|
15
|
+
title,
|
|
16
|
+
style,
|
|
17
|
+
top,
|
|
18
|
+
pressESCToClose,
|
|
19
|
+
darkTheme,
|
|
20
|
+
autoFocus,
|
|
21
|
+
refs,
|
|
22
|
+
onClose,
|
|
23
|
+
onConfirm,
|
|
24
|
+
onCancel,
|
|
25
|
+
children,
|
|
26
|
+
width,
|
|
27
|
+
...props
|
|
28
|
+
}, ref) => {
|
|
29
|
+
if (!ref) {
|
|
30
|
+
ref = useRef(null);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const cardBoxRef = useRef(null);
|
|
34
|
+
const CardBox = css`
|
|
35
|
+
background-color: white;
|
|
36
|
+
border-radius: 4px;
|
|
37
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
border-radius: 10px;
|
|
40
|
+
display: flex;
|
|
41
|
+
position: relative;
|
|
42
|
+
max-height: calc(100% - ${isNaN(top) ? top : +top + 'px'});
|
|
43
|
+
min-width: 150px;
|
|
44
|
+
max-width: 90%;
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
height: max-content;
|
|
47
|
+
width: ${isNaN(width) ? width : width + 'px'};
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
font-family: ${theme.typography.fontFamily};
|
|
50
|
+
-webkit-box-orient: vertical;
|
|
51
|
+
-webkit-box-direction: normal;
|
|
52
|
+
/* min-height: 152px; */
|
|
53
|
+
cursor: 'initial';
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const onShowCard = () => {
|
|
57
|
+
setOpenState(true);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const onCloseCard = () => {
|
|
61
|
+
if (onClose) onClose();else {
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
setOpenState(false);
|
|
64
|
+
}, 500);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (ref.current) {
|
|
68
|
+
ref.current.style.opacity = null;
|
|
69
|
+
ref.current.firstChild.classList.remove('show');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const CardView = useMemo(() => {
|
|
74
|
+
const node = jsx("div", {
|
|
75
|
+
className: 'DGN-UI-Card'
|
|
76
|
+
}, jsx("div", _extends({
|
|
77
|
+
css: CardBox,
|
|
78
|
+
ref: cardBoxRef
|
|
79
|
+
}, props, {
|
|
80
|
+
style: style
|
|
81
|
+
}), jsx(CardContext.Provider, {
|
|
82
|
+
value: {
|
|
83
|
+
show: onShowCard,
|
|
84
|
+
close: onCloseCard
|
|
85
|
+
}
|
|
86
|
+
}, children)));
|
|
87
|
+
return /*#__PURE__*/createPortal(node, document.body);
|
|
88
|
+
});
|
|
89
|
+
return CardView;
|
|
90
|
+
}));
|
|
91
|
+
Card.defaultProps = {
|
|
92
|
+
autoFocus: true,
|
|
93
|
+
top: '',
|
|
94
|
+
width: '70%'
|
|
95
|
+
};
|
|
96
|
+
Card.propTypes = {
|
|
97
|
+
/** park a good colored background under the card box if true */
|
|
98
|
+
darkTheme: PropTypes.bool,
|
|
99
|
+
|
|
100
|
+
/** show card if true */
|
|
101
|
+
open: PropTypes.bool,
|
|
102
|
+
|
|
103
|
+
/** focusing after open card */
|
|
104
|
+
autoFocus: PropTypes.bool,
|
|
105
|
+
|
|
106
|
+
/** customize the vertical position of the screen, if not set, the card will be fixed in the middle of the screen */
|
|
107
|
+
top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
108
|
+
|
|
109
|
+
/** width of the card */
|
|
110
|
+
width: PropTypes.string,
|
|
111
|
+
|
|
112
|
+
/** customize style inline */
|
|
113
|
+
style: PropTypes.object,
|
|
114
|
+
|
|
115
|
+
/** get card ref by function */
|
|
116
|
+
refs: PropTypes.func,
|
|
117
|
+
|
|
118
|
+
/** the function to run when close card */
|
|
119
|
+
onClose: PropTypes.func,
|
|
120
|
+
|
|
121
|
+
/** child content in body */
|
|
122
|
+
children: PropTypes.node,
|
|
123
|
+
|
|
124
|
+
/** any props else */
|
|
125
|
+
props: PropTypes.any
|
|
126
|
+
};
|
|
127
|
+
export default Card;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
import React, { memo, useEffect, useRef, forwardRef } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import Card from './card';
|
|
6
|
+
import BodyCard from './body-card';
|
|
7
|
+
const Popup = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
8
|
+
style,
|
|
9
|
+
bodyStyle,
|
|
10
|
+
refs,
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}, ref) => {
|
|
14
|
+
if (!ref) {
|
|
15
|
+
ref = useRef(null);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (refs) refs(ref);
|
|
20
|
+
}, []);
|
|
21
|
+
return /*#__PURE__*/React.createElement(Card, _extends({
|
|
22
|
+
ref: ref,
|
|
23
|
+
style: style
|
|
24
|
+
}, props), /*#__PURE__*/React.createElement(BodyCard, {
|
|
25
|
+
style: bodyStyle
|
|
26
|
+
}, children));
|
|
27
|
+
}));
|
|
28
|
+
Popup.defaultProps = {
|
|
29
|
+
title: ''
|
|
30
|
+
};
|
|
31
|
+
Popup.propTypes = {
|
|
32
|
+
/** customize style inline */
|
|
33
|
+
style: PropTypes.object,
|
|
34
|
+
|
|
35
|
+
/** custom style inline for body */
|
|
36
|
+
bodyStyle: PropTypes.object,
|
|
37
|
+
|
|
38
|
+
/** get card ref by function */
|
|
39
|
+
refs: PropTypes.func,
|
|
40
|
+
|
|
41
|
+
/** title for header */
|
|
42
|
+
title: PropTypes.node,
|
|
43
|
+
|
|
44
|
+
/** child content in body */
|
|
45
|
+
children: PropTypes.node,
|
|
46
|
+
|
|
47
|
+
/** any props else */
|
|
48
|
+
props: PropTypes.any
|
|
49
|
+
};
|
|
50
|
+
export default Popup;
|