diginet-core-ui 1.3.79 → 1.3.80
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/components/accordion/css.js +2 -2
- package/components/accordion/details.js +3 -3
- package/components/accordion/group.js +3 -3
- package/components/accordion/index.js +5 -5
- package/components/accordion/summary.js +4 -4
- package/components/alert/index.js +8 -8
- package/components/alert/notify.js +4 -4
- package/components/avatar/index.js +11 -12
- package/components/badge/index.js +5 -5
- package/components/button/icon.js +9 -9
- package/components/button/index.js +10 -10
- package/components/button/more.js +181 -109
- package/components/button/ripple-effect.js +2 -2
- package/components/card/body.js +2 -2
- package/components/card/extra.js +2 -2
- package/components/card/footer.js +2 -2
- package/components/card/header.js +3 -3
- package/components/card/index.js +8 -8
- package/components/chart/Pie/index.js +37 -38
- package/components/chart/Pie-v2/Sectors.js +3 -3
- package/components/chart/Pie-v2/index.js +6 -6
- package/components/chart/bar/Bar.js +2 -2
- package/components/chart/bar/Labels.js +2 -3
- package/components/chart/bar/index.js +6 -6
- package/components/chart/bar-v2/Bar.js +3 -3
- package/components/chart/bar-v2/Labels.js +2 -3
- package/components/chart/bar-v2/index.js +6 -6
- package/components/chart/line/Labels.js +2 -3
- package/components/chart/line/Path.js +1 -1
- package/components/chart/line/Point.js +2 -2
- package/components/chart/line/Title.js +1 -1
- package/components/chart/line/index.js +6 -6
- package/components/chart/line-v2/Labels.js +2 -3
- package/components/chart/line-v2/Point.js +2 -2
- package/components/chart/line-v2/Title.js +1 -1
- package/components/chart/line-v2/index.js +6 -6
- package/components/check-text/index.js +2 -2
- package/components/check-text/interview-confirmation.js +2 -2
- package/components/check-text/interview-status.js +2 -2
- package/components/chip/attach.js +4 -4
- package/components/chip/index.js +5 -5
- package/components/collapse/index.js +1 -1
- package/components/divider/index.js +2 -2
- package/components/form-control/attachment/index.js +6 -6
- package/components/form-control/calendar/function.js +8 -8
- package/components/form-control/calendar/index.js +2 -2
- package/components/form-control/calendar/range.js +3 -3
- package/components/form-control/checkbox/index.js +5 -5
- package/components/form-control/control/index.js +2 -2
- package/components/form-control/date-picker/index.js +10 -10
- package/components/form-control/date-range-picker/index.js +8 -8
- package/components/form-control/dropdown/index.js +7 -7
- package/components/form-control/dropdown-box/index.js +6 -6
- package/components/form-control/form/index.js +1 -1
- package/components/form-control/form-group/index.js +1 -1
- package/components/form-control/helper-text/index.js +4 -4
- package/components/form-control/input-base/index.js +7 -7
- package/components/form-control/label/index.js +13 -13
- package/components/form-control/money-input/index.js +5 -5
- package/components/form-control/number-input/index.js +3 -3
- package/components/form-control/number-input/index2.js +36 -27
- package/components/form-control/phone-input/index.js +2 -2
- package/components/form-control/radio/index.js +4 -4
- package/components/form-control/text-input/index.js +4 -4
- package/components/form-control/time-picker/index.js +7 -7
- package/components/form-control/time-picker/swiper.js +1 -1
- package/components/form-control/toggle/index.js +4 -4
- package/components/form-view/helper-text.js +1 -1
- package/components/form-view/index.js +4 -4
- package/components/form-view/input.js +3 -3
- package/components/form-view/label.js +2 -2
- package/components/grid/Col.js +2 -2
- package/components/grid/Container.js +1 -1
- package/components/grid/Row.js +1 -1
- package/components/grid/index.js +5 -5
- package/components/image/index.js +5 -5
- package/components/index.js +83 -83
- package/components/list/list-item-action.js +1 -1
- package/components/list/list-item-icon.js +2 -2
- package/components/list/list-item-text.js +1 -1
- package/components/list/list-item.js +2 -2
- package/components/list/list.js +1 -1
- package/components/list/sub-header.js +2 -2
- package/components/modal/body.js +4 -4
- package/components/modal/footer.js +3 -3
- package/components/modal/header.js +5 -5
- package/components/modal/index.js +4 -4
- package/components/modal/modal.js +6 -6
- package/components/others/extra/index.js +2 -2
- package/components/others/import/index.js +1 -1
- package/components/others/scrollbar/index.js +1 -3
- package/components/paging/page-info.js +5 -5
- package/components/paging/page-selector.js +3 -3
- package/components/paging/page-selector2.js +5 -5
- package/components/paper/index.js +2 -2
- package/components/popover/body.js +4 -4
- package/components/popover/footer.js +4 -4
- package/components/popover/header.js +5 -5
- package/components/popover/index.js +4 -4
- package/components/popup/danger_popup.js +5 -5
- package/components/popup/index.js +6 -6
- package/components/popup/proposals_popup.js +5 -5
- package/components/popup/v2/index.js +9 -9
- package/components/progress/circular.js +169 -260
- package/components/progress/linear.js +2 -2
- package/components/rating/index.js +6 -6
- package/components/slider/slider-container.js +4 -4
- package/components/slider/slider-item.js +5 -5
- package/components/status/index.js +5 -5
- package/components/tab/tab-container.js +4 -4
- package/components/tab/tab-header.js +5 -5
- package/components/tab/tab-panel.js +4 -4
- package/components/tab/tab.js +8 -8
- package/components/tooltip/index.js +3 -3
- package/components/tooltip/portal.js +1 -1
- package/components/transfer/index.js +5 -5
- package/components/tree-view/css.js +2 -2
- package/components/tree-view/index.js +4 -4
- package/components/typography/index.js +3 -3
- package/global/index.js +1 -1
- package/icons/basic.js +1 -1
- package/icons/effect.js +5 -5
- package/icons/general/index.js +21 -21
- package/icons/index.js +2 -2
- package/icons/menu/index.js +2 -2
- package/icons/menu/v2/index.js +1 -1
- package/locale/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +6 -0
- package/styles/animation.js +1 -1
- package/styles/colors.js +1 -1
- package/styles/font.js +3 -3
- package/styles/general.js +3 -2
- package/styles/typography.js +2 -2
- package/styles/utils.js +1 -1
- package/theme/index.js +3 -3
- package/theme/make-styles.js +1 -1
- package/theme/set-theme.js +1 -1
- package/theme/settings.js +6 -6
- package/theme/theme-provider.js +2 -2
- package/theme/theme.js +1 -1
- package/utils/array/array.js +3 -3
- package/utils/console.js +1 -1
- package/utils/date.js +2 -2
- package/utils/error/error.js +3 -3
- package/utils/error/errors.js +1 -1
- package/utils/handleBreakpoints.js +2 -2
- package/utils/index.js +28 -28
- package/utils/object/extend.js +1 -1
- package/utils/object/object.js +1 -1
- package/utils/render-portal.js +1 -1
- package/utils/renderHTML.js +1 -1
- package/utils/renderIcon.js +3 -3
- package/utils/sb-template.js +4 -4
- package/utils/string/capitalizeSentenceCase.js +1 -1
- package/utils/string/string.js +1 -1
- package/utils/useElementSize.js +1 -1
- package/utils/validate.js +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/core';
|
|
2
|
-
import theme from
|
|
3
|
-
import { alignCenter, backgroundTransparent, borderBox, borderRadius4px, breakWord, cursorPointer, displayInlineBlock, flexRow, flexRowReverse, inlineFlex, justifyBetween, justifyCenter, justifyEnd, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from
|
|
2
|
+
import theme from "../../theme/settings";
|
|
3
|
+
import { alignCenter, backgroundTransparent, borderBox, borderRadius4px, breakWord, cursorPointer, displayInlineBlock, flexRow, flexRowReverse, inlineFlex, justifyBetween, justifyCenter, justifyEnd, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from "../../styles/general";
|
|
4
4
|
const {
|
|
5
5
|
colors: {
|
|
6
6
|
system: {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { memo, forwardRef, useRef, useMemo, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import { borderBox, displayBlock, overflowHidden, parseHeight, pointerEventsNone, positionRelative, userSelectNone } from
|
|
7
|
-
import { classNames } from
|
|
8
|
-
import theme from
|
|
6
|
+
import { borderBox, displayBlock, overflowHidden, parseHeight, pointerEventsNone, positionRelative, userSelectNone } from "../../styles/general";
|
|
7
|
+
import { classNames } from "../../utils";
|
|
8
|
+
import theme from "../../theme/settings";
|
|
9
9
|
const {
|
|
10
10
|
colors: {
|
|
11
11
|
text: {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { memo, useRef, forwardRef, Children, cloneElement, useMemo, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import { borderRadius4px } from
|
|
7
|
-
import classNames from
|
|
8
|
-
import theme from
|
|
6
|
+
import { borderRadius4px } from "../../styles/general";
|
|
7
|
+
import classNames from "../../utils/classNames";
|
|
8
|
+
import theme from "../../theme/settings";
|
|
9
9
|
const {
|
|
10
10
|
spacing
|
|
11
11
|
} = theme;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { memo, useEffect, useRef, forwardRef, useState, useMemo, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import AccordionContext from
|
|
7
|
-
import Divider from
|
|
8
|
-
import { borderRadius4px, displayBlock, parseWidth, positionRelative } from
|
|
9
|
-
import classNames from
|
|
10
|
-
import theme from
|
|
6
|
+
import AccordionContext from "./context";
|
|
7
|
+
import Divider from "../divider";
|
|
8
|
+
import { borderRadius4px, displayBlock, parseWidth, positionRelative } from "../../styles/general";
|
|
9
|
+
import classNames from "../../utils/classNames";
|
|
10
|
+
import theme from "../../theme/settings";
|
|
11
11
|
const {
|
|
12
12
|
colors: {
|
|
13
13
|
line: {
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { memo, useEffect, useRef, useContext, forwardRef, useMemo, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
|
-
import { SummaryRootCSS } from
|
|
7
|
-
import AccordionContext from
|
|
6
|
+
import { SummaryRootCSS } from "./css";
|
|
7
|
+
import AccordionContext from "./context";
|
|
8
8
|
import { ButtonIcon, Typography } from '..';
|
|
9
|
-
import { classNames } from
|
|
10
|
-
import theme from
|
|
9
|
+
import { classNames } from "../../utils";
|
|
10
|
+
import theme from "../../theme/settings";
|
|
11
11
|
const {
|
|
12
12
|
colors: {
|
|
13
13
|
system: {
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import LinearProgress from
|
|
7
|
-
import ButtonIcon from
|
|
8
|
-
import Icon from
|
|
9
|
-
import { hexToRGBA } from
|
|
10
|
-
import { animations } from
|
|
11
|
-
import { classNames, useDelayUnmount } from
|
|
12
|
-
import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from
|
|
13
|
-
import { useTheme, useColor as colors } from
|
|
6
|
+
import LinearProgress from "../progress/linear";
|
|
7
|
+
import ButtonIcon from "../button/icon";
|
|
8
|
+
import Icon from "../../icons";
|
|
9
|
+
import { hexToRGBA } from "../../styles/color-helper";
|
|
10
|
+
import { animations } from "../../styles/animation";
|
|
11
|
+
import { classNames, useDelayUnmount } from "../../utils";
|
|
12
|
+
import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from "../../styles/general";
|
|
13
|
+
import { useTheme, useColor as colors } from "../../theme";
|
|
14
14
|
const {
|
|
15
15
|
colors: {
|
|
16
16
|
system: {
|
|
@@ -4,10 +4,10 @@ import { memo, useEffect, forwardRef, useImperativeHandle, useRef, useState } fr
|
|
|
4
4
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
|
-
import Alert from
|
|
8
|
-
import theme from
|
|
9
|
-
import { classNames, refType as ref } from
|
|
10
|
-
import { backgroundTransparent, pointerEventsNone, positionFixed } from
|
|
7
|
+
import Alert from "./";
|
|
8
|
+
import theme from "../../theme/settings";
|
|
9
|
+
import { classNames, refType as ref } from "../../utils";
|
|
10
|
+
import { backgroundTransparent, pointerEventsNone, positionFixed } from "../../styles/general";
|
|
11
11
|
const {
|
|
12
12
|
zIndex: zIndexCORE
|
|
13
13
|
} = theme;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { Fragment, memo, useRef, forwardRef, useState, useEffect, useMemo, useImperativeHandle, isValidElement } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import { jsx, css, keyframes } from '@emotion/core';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import isMobile from
|
|
14
|
-
import
|
|
4
|
+
import AvatarDefault from "../../assets/avatar/default.svg";
|
|
5
|
+
import { ButtonIcon, ModalSample, Popover, Popup, Typography } from "./..";
|
|
6
|
+
import { getGlobal } from "../../global";
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { forwardRef, Fragment, isValidElement, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
9
|
+
import { alignCenter, borderNone, displayBlock, displayNone, flexCol, inlineFlex, overflowHidden, parseWidthHeight, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from "../../styles/general";
|
|
10
|
+
import { useTheme } from "../../theme";
|
|
11
|
+
import { classNames, isMobile, randomString } from "../../utils";
|
|
12
|
+
import { useIntersection } from "../../utils/intersectionObserver";
|
|
13
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
15
14
|
const {
|
|
16
15
|
colors: {
|
|
17
16
|
system: {
|
|
@@ -26,7 +25,7 @@ const {
|
|
|
26
25
|
},
|
|
27
26
|
spacing,
|
|
28
27
|
zIndex: zIndexCORE
|
|
29
|
-
} =
|
|
28
|
+
} = useTheme();
|
|
30
29
|
const existed = {},
|
|
31
30
|
urlAvatar = {},
|
|
32
31
|
popupHandler = {};
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { memo, useRef, forwardRef, useMemo, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import { color as colors } from
|
|
8
|
-
import { typography } from
|
|
9
|
-
import { alignCenter, borderBox, borderRadius4px, flexRow, flexWrap, inlineFlex, justifyCenter, pointerEventsNone, positionAbsolute, positionRelative } from
|
|
10
|
-
import Icon from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import { color as colors } from "../../styles/colors";
|
|
8
|
+
import { typography } from "../../styles/typography";
|
|
9
|
+
import { alignCenter, borderBox, borderRadius4px, flexRow, flexWrap, inlineFlex, justifyCenter, pointerEventsNone, positionAbsolute, positionRelative } from "../../styles/general";
|
|
10
|
+
import Icon from "../../icons";
|
|
11
11
|
const {
|
|
12
12
|
paragraph1,
|
|
13
13
|
paragraph2,
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import * as allColors from
|
|
8
|
-
import { hexToRGBA } from
|
|
9
|
-
import { capitalize, classNames, refType as ref } from
|
|
10
|
-
import Icon from
|
|
11
|
-
import Ripple from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import * as allColors from "../../styles/colors";
|
|
8
|
+
import { hexToRGBA } from "../../styles/color-helper";
|
|
9
|
+
import { capitalize, classNames, refType as ref } from "../../utils";
|
|
10
|
+
import Icon from "../../icons";
|
|
11
|
+
import Ripple from "./ripple-effect";
|
|
12
12
|
import { getClassNameFromColor, getRippleColor } from '.';
|
|
13
|
-
import CircularProgress from
|
|
14
|
-
import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, borderRadius50, cursorPointer, flexRow, inlineFlex, justifyCenter, noBorder, outlineNone, parseMinWidthHeight, parseWidthHeight, pointerEventsNone, positionRelative, userSelectNone } from
|
|
15
|
-
import { useColor as colors, useTheme } from
|
|
13
|
+
import CircularProgress from "../progress/circular";
|
|
14
|
+
import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, borderRadius50, cursorPointer, flexRow, inlineFlex, justifyCenter, noBorder, outlineNone, parseMinWidthHeight, parseWidthHeight, pointerEventsNone, positionRelative, userSelectNone } from "../../styles/general";
|
|
15
|
+
import { useColor as colors, useTheme } from "../../theme";
|
|
16
16
|
const {
|
|
17
17
|
colors: {
|
|
18
18
|
system: {
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
6
|
-
import { Typography } from
|
|
7
|
-
import Icon from
|
|
8
|
-
import { detectColor, fade, hexToRGBA, hslToRgb, isColor, isColorName, rgbaToHexA, rgbToHex } from
|
|
9
|
-
import * as allColors from
|
|
10
|
-
import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, cursorPointer, flexRow, inlineFlex, justifyCenter, noBorder, noMargin, noPadding, outlineNone, overflowHidden, parseHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidthHeight, pointerEventsNone, positionRelative, userSelectNone } from
|
|
11
|
-
import { useColor as colors, useTheme } from
|
|
12
|
-
import { classNames, refType as ref } from
|
|
13
|
-
import OptionWrapper from
|
|
14
|
-
import CircularProgress from
|
|
15
|
-
import Ripple from
|
|
6
|
+
import { Typography } from "../";
|
|
7
|
+
import Icon from "../../icons";
|
|
8
|
+
import { detectColor, fade, hexToRGBA, hslToRgb, isColor, isColorName, rgbaToHexA, rgbToHex } from "../../styles/color-helper";
|
|
9
|
+
import * as allColors from "../../styles/colors";
|
|
10
|
+
import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, cursorPointer, flexRow, inlineFlex, justifyCenter, noBorder, noMargin, noPadding, outlineNone, overflowHidden, parseHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidthHeight, pointerEventsNone, positionRelative, userSelectNone } from "../../styles/general";
|
|
11
|
+
import { useColor as colors, useTheme } from "../../theme";
|
|
12
|
+
import { classNames, refType as ref } from "../../utils";
|
|
13
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
14
|
+
import CircularProgress from "../progress/circular";
|
|
15
|
+
import Ripple from "./ripple-effect";
|
|
16
16
|
const {
|
|
17
17
|
colors: {
|
|
18
18
|
system: {
|
|
@@ -1,122 +1,194 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import {
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { forwardRef, isValidElement, memo, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { ButtonIcon, Icon, Popover, Typography } from "../";
|
|
7
|
+
import { alignCenter, borderNone, cursorPointer, flexCol, flexRow, outlineNone, parseHeight } from "../../styles/general";
|
|
8
|
+
import { useTheme } from "../../theme";
|
|
9
|
+
import { classNames, refType as ref } from "../../utils";
|
|
10
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
11
|
+
const {
|
|
12
|
+
colors: {
|
|
13
|
+
system: {
|
|
14
|
+
dark: systemDark,
|
|
15
|
+
white: systemWhite
|
|
16
|
+
},
|
|
17
|
+
fill: {
|
|
18
|
+
hover: fillHover,
|
|
19
|
+
pressed: fillPressed
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
spacing
|
|
23
|
+
} = useTheme();
|
|
10
24
|
const ButtonMore = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
action = {},
|
|
26
|
+
buttonProps,
|
|
27
|
+
className,
|
|
14
28
|
disabled,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
margin-right: 1px;
|
|
30
|
-
}
|
|
31
|
-
:last-of-type {
|
|
32
|
-
border-top-left-radius: 0;
|
|
33
|
-
border-bottom-left-radius: 0;
|
|
34
|
-
margin-left: 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
.more-icon-close {
|
|
38
|
-
display: none;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
const showMoreOption = () => {
|
|
42
|
-
if (!open) {
|
|
43
|
-
setOpen(true);
|
|
44
|
-
}
|
|
29
|
+
id,
|
|
30
|
+
labelProp,
|
|
31
|
+
options,
|
|
32
|
+
optionType,
|
|
33
|
+
popoverProp,
|
|
34
|
+
style
|
|
35
|
+
}, reference) => {
|
|
36
|
+
const isOptionFull = optionType === 'full';
|
|
37
|
+
const ref = useRef(null);
|
|
38
|
+
const [openState, setOpenState] = useState(false);
|
|
39
|
+
const [iconState, setIconState] = useState(false);
|
|
40
|
+
const _PopoverCSS = PopoverCSS(isOptionFull);
|
|
41
|
+
const openPopover = () => {
|
|
42
|
+
setOpenState(true);
|
|
45
43
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
const closePopover = () => {
|
|
45
|
+
setOpenState(false);
|
|
46
|
+
};
|
|
47
|
+
useImperativeHandle(reference, () => {
|
|
48
|
+
const currentRef = ref.current || {};
|
|
49
|
+
currentRef.element = ref.current;
|
|
50
|
+
const _instance = {
|
|
51
|
+
...action
|
|
52
|
+
}; // methods
|
|
53
|
+
_instance.__proto__ = {}; // hidden methods
|
|
54
|
+
currentRef.instance = _instance;
|
|
55
|
+
return currentRef;
|
|
56
|
+
});
|
|
57
|
+
const renderOptions = () => {
|
|
58
|
+
return options.map((item, idx) => {
|
|
59
|
+
if ( /*#__PURE__*/isValidElement(item)) return item;else {
|
|
60
|
+
const icon = item === null || item === void 0 ? void 0 : item.icon;
|
|
61
|
+
const label = item === null || item === void 0 ? void 0 : item.label;
|
|
62
|
+
const action = () => {
|
|
63
|
+
closePopover();
|
|
64
|
+
if (typeof (item === null || item === void 0 ? void 0 : item.action) === 'function') item === null || item === void 0 ? void 0 : item.action();
|
|
65
|
+
};
|
|
66
|
+
if (icon && !iconState) setIconState(true);
|
|
67
|
+
return isOptionFull ? jsx("button", {
|
|
68
|
+
key: idx,
|
|
69
|
+
css: OptionFullCSS,
|
|
70
|
+
className: 'DGN-UI-ButtonMore-Option',
|
|
71
|
+
onClick: action
|
|
72
|
+
}, icon ? jsx(Icon, {
|
|
73
|
+
className: 'DGN-UI-ButtonMore-Option-Icon',
|
|
74
|
+
name: icon,
|
|
75
|
+
width: 20,
|
|
76
|
+
height: 20,
|
|
77
|
+
color: systemDark
|
|
78
|
+
}) : null, jsx(Typography, {
|
|
79
|
+
css: !icon && iconState && ExtraPaddingCSS,
|
|
80
|
+
className: 'DGN-UI-ButtonMore-Label',
|
|
81
|
+
...labelProp
|
|
82
|
+
}, label)) : jsx(ButtonIcon, {
|
|
83
|
+
key: idx,
|
|
84
|
+
className: 'DGN-UI-ButtonMore-Option',
|
|
85
|
+
circular: true,
|
|
86
|
+
name: icon,
|
|
87
|
+
onClick: action,
|
|
88
|
+
viewType: 'text'
|
|
89
|
+
});
|
|
57
90
|
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
fullScreen: false,
|
|
89
|
-
onClose: () => setOpen(false),
|
|
90
|
-
anchorOrigin: {
|
|
91
|
-
vertical: 'bottom',
|
|
92
|
-
horizontal: 'left'
|
|
93
|
-
},
|
|
94
|
-
transformOrigin: {
|
|
95
|
-
vertical: 'top',
|
|
96
|
-
horizontal: 'left'
|
|
97
|
-
}
|
|
98
|
-
}, children));
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
return useMemo(() => {
|
|
94
|
+
return jsx(Popover, {
|
|
95
|
+
css: _PopoverCSS,
|
|
96
|
+
open: openState,
|
|
97
|
+
onClose: closePopover,
|
|
98
|
+
anchorOrigin: {
|
|
99
|
+
vertical: 'bottom',
|
|
100
|
+
horizontal: 'left'
|
|
101
|
+
},
|
|
102
|
+
transformOrigin: {
|
|
103
|
+
vertical: 'top',
|
|
104
|
+
horizontal: 'left'
|
|
105
|
+
},
|
|
106
|
+
anchor: jsx(ButtonIcon, {
|
|
107
|
+
ref: ref,
|
|
108
|
+
circular: true,
|
|
109
|
+
name: 'more',
|
|
110
|
+
viewType: 'text',
|
|
111
|
+
id: id,
|
|
112
|
+
style: style,
|
|
113
|
+
className: classNames('DGN-UI-ButtonMore', className),
|
|
114
|
+
disabled: disabled,
|
|
115
|
+
onClick: openPopover,
|
|
116
|
+
...buttonProps
|
|
117
|
+
}),
|
|
118
|
+
...popoverProp
|
|
119
|
+
}, renderOptions());
|
|
120
|
+
}, [buttonProps, className, disabled, id, options, optionType, popoverProp, style, iconState, openState]);
|
|
99
121
|
}));
|
|
122
|
+
const PopoverCSS = isOptionFull => css`
|
|
123
|
+
${isOptionFull ? flexCol : flexRow};
|
|
124
|
+
padding: ${isOptionFull ? spacing([1, 0]) : spacing([0, 2])};
|
|
125
|
+
`;
|
|
126
|
+
const OptionFullCSS = css`
|
|
127
|
+
${flexRow};
|
|
128
|
+
${alignCenter};
|
|
129
|
+
${cursorPointer};
|
|
130
|
+
${outlineNone};
|
|
131
|
+
${borderNone}
|
|
132
|
+
${parseHeight(28)};
|
|
133
|
+
padding: ${spacing([0, 4])};
|
|
134
|
+
gap: ${spacing([0, 1])};
|
|
135
|
+
background-color: ${systemWhite};
|
|
136
|
+
transition: all 0.5s ease;
|
|
137
|
+
&:hover,
|
|
138
|
+
&:focus {
|
|
139
|
+
background-color: ${fillHover};
|
|
140
|
+
}
|
|
141
|
+
&:active {
|
|
142
|
+
background-color: ${fillPressed};
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
const ExtraPaddingCSS = css`
|
|
146
|
+
padding-left: ${spacing([6])};
|
|
147
|
+
`;
|
|
100
148
|
ButtonMore.defaultProps = {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
149
|
+
buttonProps: {},
|
|
150
|
+
className: '',
|
|
151
|
+
disabled: false,
|
|
152
|
+
options: [],
|
|
153
|
+
optionType: 'full',
|
|
154
|
+
style: {}
|
|
105
155
|
};
|
|
106
156
|
ButtonMore.propTypes = {
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant']),
|
|
113
|
-
/** prevent all event if true */
|
|
157
|
+
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/buttonicon) applied to the main `ButtonIcon`. */
|
|
158
|
+
buttonProps: PropTypes.object,
|
|
159
|
+
/** Class for component. */
|
|
160
|
+
className: PropTypes.string,
|
|
161
|
+
/** If `true`, the component is disabled. */
|
|
114
162
|
disabled: PropTypes.bool,
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
163
|
+
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/typography) applied to the `Typography` label. */
|
|
164
|
+
labelProp: PropTypes.object,
|
|
165
|
+
/** Option(s) in popover. */
|
|
166
|
+
option: PropTypes.arrayOf(PropTypes.shape({
|
|
167
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
168
|
+
icon: PropTypes.string,
|
|
169
|
+
action: PropTypes.func
|
|
170
|
+
})),
|
|
171
|
+
/** The variant of option's type. */
|
|
172
|
+
optionType: PropTypes.oneOf(['full', 'icon']),
|
|
173
|
+
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/overplay-popover) applied to the main `Popover`. */
|
|
174
|
+
popoverProp: PropTypes.object,
|
|
175
|
+
/** Style inline of component. */
|
|
176
|
+
style: PropTypes.object,
|
|
177
|
+
/**
|
|
178
|
+
* ref methods (ref.current.instance.*method*)
|
|
179
|
+
*
|
|
180
|
+
* * option(): Gets all UI component properties
|
|
181
|
+
* * Returns value - object
|
|
182
|
+
* * option(optionName): Gets the value of a single property
|
|
183
|
+
* * @param {optionName} - string
|
|
184
|
+
* * Returns value - any
|
|
185
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
186
|
+
* * @param {optionName} - string
|
|
187
|
+
* * @param {optionValue} - any
|
|
188
|
+
* * option(options): Updates the values of several properties
|
|
189
|
+
* * @param {options} - object
|
|
190
|
+
*/
|
|
191
|
+
reference: ref
|
|
121
192
|
};
|
|
122
|
-
export
|
|
193
|
+
export { ButtonMore };
|
|
194
|
+
export default OptionWrapper(ButtonMore);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { css, jsx, keyframes } from '@emotion/core';
|
|
5
5
|
import { forwardRef, memo, useImperativeHandle, useLayoutEffect, useState } from 'react';
|
|
6
|
-
import { borderRadius100, borderRadius50, overflowHidden, positionAbsolute } from
|
|
7
|
-
import { useTheme } from
|
|
6
|
+
import { borderRadius100, borderRadius50, overflowHidden, positionAbsolute } from "../../styles/general";
|
|
7
|
+
import { useTheme } from "../../theme";
|
|
8
8
|
const {
|
|
9
9
|
colors: {
|
|
10
10
|
system: {
|
package/components/card/body.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import { classNames } from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import { classNames } from "../../utils";
|
|
8
8
|
const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
children,
|
package/components/card/extra.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import { classNames } from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import { classNames } from "../../utils";
|
|
8
8
|
const CardExtra = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
children,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import { classNames } from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import { classNames } from "../../utils";
|
|
8
8
|
const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
children,
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import Typography from
|
|
8
|
-
import { classNames } from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import Typography from "../typography";
|
|
8
|
+
import { classNames } from "../../utils";
|
|
9
9
|
const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
10
|
action = {},
|
|
11
11
|
children,
|
package/components/card/index.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import OptionWrapper from
|
|
7
|
-
import theme from
|
|
8
|
-
import { borderBox, borderRadius4px, flexCol, flexRow, justifyEnd, overflowHidden, parseWidth, parseWidthHeight, positionAbsolute, positionRelative } from
|
|
9
|
-
import CardHeader from
|
|
10
|
-
import { CardFooter } from
|
|
11
|
-
import { CardBody } from
|
|
12
|
-
import { getColor } from
|
|
13
|
-
import { classNames } from
|
|
6
|
+
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
+
import theme from "../../theme/settings";
|
|
8
|
+
import { borderBox, borderRadius4px, flexCol, flexRow, justifyEnd, overflowHidden, parseWidth, parseWidthHeight, positionAbsolute, positionRelative } from "../../styles/general";
|
|
9
|
+
import CardHeader from "./header";
|
|
10
|
+
import { CardFooter } from "./footer";
|
|
11
|
+
import { CardBody } from "./body";
|
|
12
|
+
import { getColor } from "../../styles/utils";
|
|
13
|
+
import { classNames } from "../../utils";
|
|
14
14
|
const {
|
|
15
15
|
colors: {
|
|
16
16
|
system: {
|