diginet-core-ui 1.3.66 → 1.3.67

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.
Files changed (46) hide show
  1. package/assets/storybook/avatar01.svg +9 -0
  2. package/assets/storybook/cover01.svg +9 -0
  3. package/components/accordion/css.js +6 -6
  4. package/components/accordion/details.js +13 -18
  5. package/components/accordion/group.js +16 -17
  6. package/components/accordion/index.js +17 -22
  7. package/components/accordion/summary.js +55 -32
  8. package/components/avatar/index.js +23 -28
  9. package/components/badge/index.js +9 -14
  10. package/components/button/icon.js +25 -30
  11. package/components/button/index.js +275 -280
  12. package/components/card/body.js +47 -0
  13. package/components/card/extra.js +47 -0
  14. package/components/card/footer.js +47 -0
  15. package/components/card/header.js +50 -0
  16. package/components/card/index.js +175 -37
  17. package/components/chart/Pie-v2/Sector.js +2 -2
  18. package/components/chip/attach.js +5 -5
  19. package/components/form-control/attachment/index.js +26 -24
  20. package/components/form-control/calendar/function.js +133 -123
  21. package/components/form-control/calendar/index.js +16 -16
  22. package/components/form-control/dropdown/index.js +71 -10
  23. package/components/form-control/helper-text/index.js +8 -3
  24. package/components/form-control/number-input/index.js +11 -11
  25. package/components/form-control/phone-input/index.js +7 -7
  26. package/components/grid/Container.js +110 -0
  27. package/components/grid/Row.js +1 -1
  28. package/components/grid/index.js +35 -5
  29. package/components/index.js +7 -2
  30. package/components/others/option-wrapper/index.js +21 -27
  31. package/components/paging/page-info.js +31 -40
  32. package/components/popover/index.js +29 -27
  33. package/components/progress/circular.js +12 -12
  34. package/components/transfer/index.js +3 -3
  35. package/components/tree-view/index.js +10 -6
  36. package/icons/basic.js +120 -0
  37. package/icons/effect.js +4 -9
  38. package/package.json +1 -1
  39. package/readme.md +14 -0
  40. package/styles/color-helper.js +103 -103
  41. package/styles/utils.js +17 -5
  42. package/utils/error/error.js +2 -2
  43. package/utils/renderIcon.js +5 -5
  44. package/components/card/body-card.js +0 -65
  45. package/components/card/card.js +0 -125
  46. package/components/card/context.js +0 -6
@@ -1,8 +1,8 @@
1
1
  import { extend } from '../object/extend';
2
2
  import { logger } from '../console';
3
3
  import { format } from '../string/string';
4
- /**
5
- * future
4
+ /**
5
+ * future
6
6
  */
7
7
 
8
8
  const ERROR_URL = 'http://core.diginet.com.vn/ui/error/';
@@ -5,11 +5,11 @@ import { jsx } from '@emotion/core';
5
5
  import { ButtonIcon } from '../components';
6
6
  import * as Icons from '../icons';
7
7
  import { parseTextToHTML, capitalize } from './';
8
- /**
9
- * render icon form source (dynamic type)
10
- * @param {String|jsx} source data of icon, maybe svg text | image link | name of icon in icons store or a jsx element
11
- * @param {String} type text to parse text to HTML, img link to use img tag, name to use icon form icons store
12
- * @param {Object} options properties of Icon component if us type is name {width, height, color, viewBox, ...}
8
+ /**
9
+ * render icon form source (dynamic type)
10
+ * @param {String|jsx} source data of icon, maybe svg text | image link | name of icon in icons store or a jsx element
11
+ * @param {String} type text to parse text to HTML, img link to use img tag, name to use icon form icons store
12
+ * @param {Object} options properties of Icon component if us type is name {width, height, color, viewBox, ...}
13
13
  */
14
14
 
15
15
  const renderIcon = (source, type, options = {}) => {
@@ -1,65 +0,0 @@
1
- /** @jsxRuntime classic */
2
-
3
- /** @jsx jsx */
4
- import { memo, useMemo, useEffect, forwardRef } from 'react';
5
- import PropTypes from 'prop-types';
6
- import { jsx, css } from '@emotion/core';
7
- import theme from '../../theme/settings';
8
- const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
9
- children,
10
- background,
11
- style,
12
- refs,
13
- ...props
14
- }, ref) => {
15
- const CardBodyBox = css`
16
- display: block;
17
- position: relative;
18
- background-color: ${background};
19
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
20
- border-radius: 4px;
21
- box-sizing: border-box;
22
- padding: 12px 24px;
23
- overflow: auto;
24
- order: 2;
25
- height: auto;
26
- width: 100%;
27
- img{
28
- object-fit: cover;
29
- max-width: 100%;
30
- height: 100%;
31
- border-radius: 20px;
32
- }
33
- &::-webkit-scrollbar {
34
- width: 8px;
35
- height: 8px;
36
- }
37
- &::-webkit-scrollbar-thumb{
38
- border-radius: 10px;
39
- mix-blend-mode: normal;
40
- background-color: ${theme.colors.dark12};
41
- background-clip: content-box;
42
- }
43
- `;
44
- useEffect(() => {
45
- !!refs && refs(ref);
46
- }, []);
47
- const Body = useMemo(() => jsx("div", {
48
- css: CardBodyBox,
49
- ...props,
50
- style: style,
51
- ref: ref
52
- }, children), [children, style]);
53
- return Body;
54
- }));
55
- CardBody.propTypes = {
56
- /** customize style inline */
57
- style: PropTypes.object,
58
-
59
- /** get card header ref by function */
60
- refs: PropTypes.func,
61
-
62
- /** child content in header (like title) */
63
- children: PropTypes.node
64
- };
65
- export default CardBody;
@@ -1,125 +0,0 @@
1
- /* eslint-disable no-undef */
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
- const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
12
- // open,
13
- // type,
14
- // title,
15
- style,
16
- top,
17
- // pressESCToClose,
18
- // darkTheme,
19
- // autoFocus,
20
- // refs,
21
- onClose,
22
- // onConfirm,
23
- // onCancel,
24
- children,
25
- width,
26
- ...props
27
- }, ref) => {
28
- if (!ref) {
29
- ref = useRef(null);
30
- }
31
-
32
- const cardBoxRef = useRef(null);
33
- const CardBox = css`
34
- background-color: white;
35
- border-radius: 4px;
36
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
37
- box-sizing: border-box;
38
- border-radius: 10px;
39
- display: flex;
40
- position: relative;
41
- max-height: calc(100% - ${isNaN(top) ? top : +top + 'px'});
42
- min-width: 150px;
43
- max-width: 90%;
44
- margin: 0 auto;
45
- height: max-content;
46
- width: ${isNaN(width) ? width : width + 'px'};
47
- flex-direction: column;
48
- -webkit-box-orient: vertical;
49
- -webkit-box-direction: normal;
50
- /* min-height: 152px; */
51
- cursor: 'initial';
52
- `;
53
-
54
- const onShowCard = () => {
55
- setOpenState(true);
56
- };
57
-
58
- const onCloseCard = () => {
59
- if (onClose) onClose();else {
60
- setTimeout(() => {
61
- setOpenState(false);
62
- }, 500);
63
- }
64
-
65
- if (ref.current) {
66
- ref.current.style.opacity = null;
67
- ref.current.firstChild.classList.remove('show');
68
- }
69
- };
70
-
71
- const CardView = useMemo(() => {
72
- const node = jsx("div", {
73
- className: 'DGN-UI-Card'
74
- }, jsx("div", {
75
- css: CardBox,
76
- ref: cardBoxRef,
77
- ...props,
78
- style: style
79
- }, jsx(CardContext.Provider, {
80
- value: {
81
- show: onShowCard,
82
- close: onCloseCard
83
- }
84
- }, children)));
85
- return /*#__PURE__*/createPortal(node, document.body);
86
- });
87
- return CardView;
88
- }));
89
- Card.defaultProps = {
90
- autoFocus: true,
91
- top: '',
92
- width: '70%'
93
- };
94
- Card.propTypes = {
95
- /** park a good colored background under the card box if true */
96
- darkTheme: PropTypes.bool,
97
-
98
- /** show card if true */
99
- open: PropTypes.bool,
100
-
101
- /** focusing after open card */
102
- autoFocus: PropTypes.bool,
103
-
104
- /** customize the vertical position of the screen, if not set, the card will be fixed in the middle of the screen */
105
- top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
106
-
107
- /** width of the card */
108
- width: PropTypes.string,
109
-
110
- /** customize style inline */
111
- style: PropTypes.object,
112
-
113
- /** get card ref by function */
114
- refs: PropTypes.func,
115
-
116
- /** the function to run when close card */
117
- onClose: PropTypes.func,
118
-
119
- /** child content in body */
120
- children: PropTypes.node,
121
-
122
- /** any props else */
123
- props: PropTypes.any
124
- };
125
- export default Card;
@@ -1,6 +0,0 @@
1
- import { createContext } from 'react';
2
- const CardContext = /*#__PURE__*/createContext({
3
- show: () => {},
4
- close: () => {}
5
- });
6
- export default CardContext;