diginet-core-ui 1.3.24 → 1.3.29
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/fonts/SF-Pro-Display-Bold.otf +0 -0
- package/assets/fonts/SF-Pro-Display-Medium.otf +0 -0
- package/assets/fonts/SF-Pro-Display-Regular.otf +0 -0
- package/assets/images/icons/wifi.svg +3 -0
- package/assets/images/menu/dhr/MHRM09N0004.svg +14 -0
- package/assets/images/menu/dhr/MHRP09N0028.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0029.svg +14 -0
- package/assets/images/menu/dhr/MHRP09N0030.svg +4 -0
- package/assets/images/menu/dhr/MHRP09N0031.svg +5 -0
- package/assets/images/menu/dhr/MHRP29N0012.svg +7 -0
- package/assets/images/menu/dhr/MHRP29N0021.svg +8 -0
- package/assets/images/menu/dhr/MHRP29N0022.svg +9 -0
- package/assets/images/menu/dhr/MHRP29N0023.svg +22 -0
- package/assets/images/menu/dhr/MHRP39N0015.svg +5 -0
- package/assets/images/menu/dhr/TASK.svg +9 -0
- package/assets/images/menu/erp/D05.svg +8 -0
- package/assets/images/menu/erp/D06.svg +4 -0
- package/assets/images/menu/erp/D90R.svg +9 -0
- package/assets/images/menu/erp/DBC.svg +9 -0
- package/assets/images/menu/erp/{W05F0006.svg → W05F0006N0000.svg} +0 -0
- package/assets/images/menu/erp/{W05F0008.svg → W05F0008N0000.svg} +0 -0
- package/assets/images/menu/erp/{W05F4000.svg → W05F4000N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0005.svg → W06F0005N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0006.svg → W06F0006N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0008.svg → W06F0008N0000.svg} +0 -0
- package/assets/images/menu/erp/W94F1000N0000.svg +9 -0
- package/assets/images/menu/erp/W94F1000N0001.svg +9 -0
- package/components/accordion/css.js +42 -33
- package/components/accordion/details.js +29 -17
- package/components/accordion/group.js +23 -23
- package/components/accordion/index.js +36 -27
- package/components/accordion/summary.js +10 -11
- package/components/alert/index.js +97 -91
- package/components/alert/notify.js +10 -8
- package/components/avatar/index.js +19 -17
- package/components/badge/index.js +122 -139
- package/components/button/icon.js +242 -334
- package/components/button/index.js +272 -427
- package/components/button/more.js +4 -5
- package/components/button/ripple-effect.js +4 -6
- package/components/card/body-card.js +4 -6
- package/components/card/card.js +4 -8
- package/components/card/index.js +4 -5
- package/components/chart/Pie/Sector.js +4 -5
- package/components/chart/Pie/Sectors.js +5 -5
- package/components/chart/Pie/index.js +8 -9
- package/components/chart/Pie-v2/Sector.js +4 -5
- package/components/chart/Pie-v2/Sectors.js +7 -8
- package/components/chart/Pie-v2/index.js +11 -16
- package/components/chart/bar/Bar.js +2 -3
- package/components/chart/bar/Labels.js +9 -11
- package/components/chart/bar/index.js +17 -9
- package/components/chart/bar-v2/Bar.js +2 -3
- package/components/chart/bar-v2/Labels.js +9 -11
- package/components/chart/bar-v2/index.js +17 -9
- package/components/chart/line/Labels.js +8 -10
- package/components/chart/line/Point.js +2 -3
- package/components/chart/line/index.js +17 -9
- package/components/chart/line-v2/Labels.js +8 -10
- package/components/chart/line-v2/Point.js +2 -3
- package/components/chart/line-v2/index.js +17 -9
- package/components/chip/attach.js +12 -16
- package/components/chip/index.js +8 -11
- package/components/collapse/index.js +4 -5
- package/components/divider/index.js +27 -14
- package/components/form-control/attachment/index.js +143 -87
- package/components/form-control/calendar/function.js +24 -23
- package/components/form-control/calendar/index.js +2 -4
- package/components/form-control/calendar/range.js +3 -4
- package/components/form-control/checkbox/index.js +85 -71
- package/components/form-control/control/index.js +4 -6
- package/components/form-control/date-picker/index-old.js +0 -2
- package/components/form-control/date-picker/index.js +39 -43
- package/components/form-control/date-range-picker/index.js +26 -28
- package/components/form-control/dropdown/index.js +173 -202
- package/components/form-control/dropdown-box/index.js +72 -49
- package/components/form-control/form-group/index.js +4 -5
- package/components/form-control/helper-text/index.js +4 -5
- package/components/form-control/input-base/index.js +28 -38
- package/components/form-control/label/index.js +23 -13
- package/components/form-control/money-input/index.js +6 -6
- package/components/form-control/number-input/index.js +12 -14
- package/components/form-control/phone-input/index.js +4 -5
- package/components/form-control/radio/index.js +7 -15
- package/components/form-control/text-input/index.js +14 -24
- package/components/form-control/time-picker/index.js +15 -26
- package/components/form-control/time-picker/swiper.js +2 -4
- package/components/form-control/toggle/index.js +22 -18
- package/components/form-view/helper-text.js +4 -5
- package/components/form-view/index.js +4 -5
- package/components/form-view/input.js +5 -7
- package/components/form-view/label.js +2 -6
- package/components/list/list-item-action.js +7 -8
- package/components/list/list-item-icon.js +4 -5
- package/components/list/list-item-text.js +4 -5
- package/components/list/list-item.js +4 -5
- package/components/list/list.js +4 -5
- package/components/list/sub-header.js +4 -5
- package/components/modal/body.js +4 -6
- package/components/modal/footer.js +4 -6
- package/components/modal/header.js +8 -14
- package/components/modal/index.js +4 -5
- package/components/modal/modal.js +6 -13
- package/components/others/extra/index.js +4 -8
- package/components/others/option-wrapper/index.js +57 -0
- package/components/others/scrollbar/index.js +4 -5
- package/components/paging/page-info.js +282 -231
- package/components/paging/page-selector.js +4 -7
- package/components/popover/index.js +6 -7
- package/components/popup/danger_popup.js +8 -18
- package/components/popup/index.js +26 -34
- package/components/popup/proposals_popup.js +9 -16
- package/components/popup/v2/danger-popup.js +4 -6
- package/components/popup/v2/index.js +116 -98
- package/components/popup/v2/info-popup.js +4 -6
- package/components/popup/v2/success-popup.js +4 -6
- package/components/popup/v2/warning-popup.js +4 -6
- package/components/popup/v2/yes-no-popup.js +4 -6
- package/components/progress/circular.js +17 -26
- package/components/progress/linear.js +11 -13
- package/components/rating/index.js +114 -233
- package/components/slider/slider-container.js +15 -10
- package/components/slider/slider-item.js +10 -12
- package/components/status/index.js +63 -57
- package/components/tab/tab-container.js +26 -24
- package/components/tab/tab-header.js +36 -27
- package/components/tab/tab-panel.js +32 -15
- package/components/tab/tab.js +79 -80
- package/components/tooltip/index.js +4 -4
- package/components/transfer/index.js +10 -11
- package/components/tree-view/css.js +2 -0
- package/components/tree-view/index.js +14 -13
- package/components/typography/index.js +6 -112
- package/css/styles.css +1 -1
- package/css/styles.css.map +1 -1
- package/global/index.js +2 -0
- package/icons/basic.js +1648 -959
- package/icons/effect.js +45 -103
- package/package.json +1 -1
- package/readme.md +66 -0
- package/styles/color-helper.js +7 -146
- package/styles/colors.js +6 -2
- package/styles/font.js +9 -0
- package/styles/general.js +100 -7
- package/styles/typography.js +25 -26
- package/theme/settings.js +9 -2
- package/theme/theme-provider.js +15 -7
- package/theme/with-styles.js +2 -4
- package/theme/with-theme.js +2 -4
- package/utils/isMobile.js +21 -0
- package/utils/renderHTML.js +4 -5
- package/utils/renderIcon.js +15 -11
- package/utils/updatePosition.js +2 -2
package/icons/effect.js
CHANGED
|
@@ -1,59 +1,22 @@
|
|
|
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
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
6
|
-
import { memo, useRef,
|
|
4
|
+
import { memo, useRef, useMemo, forwardRef } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { jsx, css } from '@emotion/core';
|
|
9
|
-
import {
|
|
7
|
+
import { color as colors } from '../styles/colors';
|
|
10
8
|
import * as Icons from './basic';
|
|
11
9
|
import { capitalize } from '../utils';
|
|
12
|
-
import { useTheme } from '../theme';
|
|
13
10
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const getColor = name => {
|
|
18
|
-
switch (capitalize(name)) {
|
|
19
|
-
case 'Approval':
|
|
20
|
-
return {
|
|
21
|
-
color: success5,
|
|
22
|
-
pressed: success7
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
case 'Delete':
|
|
26
|
-
return {
|
|
27
|
-
color: warning5,
|
|
28
|
-
pressed: warning7
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
case 'Cancel':
|
|
32
|
-
case 'Close':
|
|
33
|
-
return {
|
|
34
|
-
color: danger5,
|
|
35
|
-
pressed: danger7
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
case 'Edit':
|
|
39
|
-
case 'View':
|
|
40
|
-
return {
|
|
41
|
-
color: info5,
|
|
42
|
-
pressed: info7
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
default:
|
|
46
|
-
return {
|
|
47
|
-
color: brand,
|
|
48
|
-
pressed: '#697CCE'
|
|
49
|
-
};
|
|
11
|
+
system: {
|
|
12
|
+
rest
|
|
50
13
|
}
|
|
51
|
-
};
|
|
52
|
-
|
|
14
|
+
} = colors;
|
|
53
15
|
const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
54
16
|
type,
|
|
55
17
|
name,
|
|
56
18
|
className,
|
|
19
|
+
style,
|
|
57
20
|
color,
|
|
58
21
|
width,
|
|
59
22
|
height,
|
|
@@ -67,80 +30,62 @@ const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
67
30
|
}
|
|
68
31
|
|
|
69
32
|
const dgnIcon = css`
|
|
70
|
-
display:
|
|
33
|
+
display: flex;
|
|
71
34
|
justify-content: center;
|
|
72
35
|
align-items: center;
|
|
73
36
|
width: max-content;
|
|
74
37
|
height: max-content;
|
|
75
38
|
min-width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
76
39
|
min-height: ${width ? isNaN(height) ? height : height + 'px' : '24px'};
|
|
77
|
-
padding: ${viewBox ? type === 'filled' ? 0 : 4 : Math.floor((width || 24) / 8)}px;
|
|
78
|
-
margin: ${type === 'filled' ? 4 : 0}px;
|
|
79
|
-
color: ${type === 'filled' ? 'white' : colors[color] || color};
|
|
80
|
-
background-color: ${type === 'filled' ? brand : 'transparent'};
|
|
81
|
-
border-radius: 50%;
|
|
82
40
|
outline: none;
|
|
83
41
|
box-sizing: border-box;
|
|
84
|
-
cursor: ${onClick ? 'pointer' : 'default'};
|
|
85
42
|
user-select: none;
|
|
86
|
-
&:hover {
|
|
87
|
-
color: ${getColor(name).color};
|
|
88
|
-
background-color: ${type === 'filled' ? blue13 : 'transparent'};
|
|
89
|
-
}
|
|
90
|
-
&:focus {
|
|
91
|
-
color: ${type === 'filled' ? 'white' : getColor(name).pressed};
|
|
92
|
-
background-color: ${type === 'filled' ? getColor(name).pressed : 'transparent'};
|
|
93
|
-
}
|
|
94
|
-
&:active {
|
|
95
|
-
color: ${getColor(name).color};
|
|
96
|
-
background-color: ${dark1};
|
|
97
|
-
}
|
|
98
|
-
&.disabled {
|
|
99
|
-
color: ${dark4} !important;
|
|
100
|
-
background-color: ${dark12} !important;
|
|
101
|
-
pointer-events: none;
|
|
102
|
-
}
|
|
103
43
|
`;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}, [disabled]);
|
|
115
|
-
const IconEffect = useMemo(() => {
|
|
44
|
+
const NotFoundIcon = css`
|
|
45
|
+
display: flex;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
48
|
+
height: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
49
|
+
border: 1px dashed ${rest};
|
|
50
|
+
`;
|
|
51
|
+
return useMemo(() => {
|
|
116
52
|
if (!name) return null;
|
|
53
|
+
let node = null;
|
|
117
54
|
const IconComp = Icons[capitalize(name)];
|
|
118
|
-
|
|
119
|
-
|
|
55
|
+
|
|
56
|
+
if (IconComp) {
|
|
57
|
+
node = jsx(IconComp, {
|
|
58
|
+
width: width,
|
|
59
|
+
height: height,
|
|
60
|
+
color: color,
|
|
61
|
+
viewBox: viewBox
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
node = jsx("span", {
|
|
65
|
+
css: NotFoundIcon
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return jsx("span", {
|
|
120
70
|
className: 'DGN-UI-Icon ' + className,
|
|
71
|
+
style: style,
|
|
121
72
|
css: dgnIcon,
|
|
122
|
-
tabIndex: -1,
|
|
123
73
|
ref: ref,
|
|
124
|
-
onClick: onClick
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
color: 'currentColor',
|
|
129
|
-
viewBox: viewBox
|
|
130
|
-
}));
|
|
131
|
-
}, [name, type, color, width, height, onClick]);
|
|
132
|
-
return IconEffect;
|
|
74
|
+
onClick: onClick,
|
|
75
|
+
...props
|
|
76
|
+
}, node);
|
|
77
|
+
}, [name, color, width, height, className, style, viewBox, onClick]);
|
|
133
78
|
}));
|
|
134
79
|
Icon.defaultProps = {
|
|
135
|
-
type: 'default',
|
|
136
80
|
className: '',
|
|
137
|
-
color:
|
|
138
|
-
|
|
139
|
-
viewBox: false
|
|
81
|
+
color: rest,
|
|
82
|
+
viewBox: true
|
|
140
83
|
};
|
|
141
84
|
Icon.propTypes = {
|
|
142
|
-
/**
|
|
143
|
-
|
|
85
|
+
/** name of icon in icons store */
|
|
86
|
+
name: PropTypes.string.isRequired,
|
|
87
|
+
|
|
88
|
+
/** the width of icon */
|
|
144
89
|
|
|
145
90
|
/** color of icon<br />
|
|
146
91
|
* default: #7F828E
|
|
@@ -150,8 +95,8 @@ Icon.propTypes = {
|
|
|
150
95
|
/** className of icon in icons store */
|
|
151
96
|
className: PropTypes.string,
|
|
152
97
|
|
|
153
|
-
/**
|
|
154
|
-
|
|
98
|
+
/** style of icon in icons store */
|
|
99
|
+
style: PropTypes.object,
|
|
155
100
|
|
|
156
101
|
/** the width of icon */
|
|
157
102
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -162,10 +107,7 @@ Icon.propTypes = {
|
|
|
162
107
|
/** have view box if true */
|
|
163
108
|
viewBox: PropTypes.bool,
|
|
164
109
|
|
|
165
|
-
/**
|
|
166
|
-
disabled: PropTypes.bool,
|
|
167
|
-
|
|
168
|
-
/** function for click event on icon */
|
|
110
|
+
/** have view box if true */
|
|
169
111
|
onClick: PropTypes.func
|
|
170
112
|
};
|
|
171
113
|
export default Icon;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -37,6 +37,72 @@ To test run
|
|
|
37
37
|
npm test
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
## Changelog
|
|
41
|
+
## 1.3.28
|
|
42
|
+
- \[Added\]: Icon - Bug, Link
|
|
43
|
+
- \[Added\]: MenuIcon - MHRM09N0004, MHRP29N0023
|
|
44
|
+
- \[Changed\]: Accordion - Update Accordion, add expended like expend (keep prop expend), fix logic
|
|
45
|
+
- \[Changed\]: Button - Add HOC OptionWrapper to Button
|
|
46
|
+
- \[Changed\]: ButtonIcon - Add custom width height
|
|
47
|
+
- \[Fixed\]: Button - Fix Typography white-space nowrap, icon width height, add min-width, hide prop 'text'
|
|
48
|
+
- \[Fixed\]: Dropdown - Fix bug clear data Dropdown close DropdownBox
|
|
49
|
+
- \[Fixed\]: PopupV2 - Fix wrong icon color of type danger
|
|
50
|
+
- \[Fixed\]: Accordion - Fix css min-height AccordionSummary
|
|
51
|
+
- \[Fixed\]: Button, ButtonIcon - Remove prop disabled in tag <button>
|
|
52
|
+
- \[Fixed\]: ButtonIcon - Fix ref of ButtonIcon, Add HOC OptionWrapper
|
|
53
|
+
- \[Fixed\]: Tab - Fix css, Add style, className
|
|
54
|
+
|
|
55
|
+
## 1.3.27
|
|
56
|
+
- \[Added\]: MenuIcon - D05, D06, D90R, DBC, MHRP09N0030, MHRP09N0031, MHRP29N0021, MHRP29N0022
|
|
57
|
+
- \[Added\]: Icon - Share, InsuranceHistory, School, Assessment, Ninedot, MoreHoriz, HalfClock, List, Treeview, NotificationV2, Website, Update, InfoCancel, CheckList, SpeedHigh, SpeedLow, PersonSync, SaveCancel, ApprovalOutLine, ApprovalCancel, FilterFilled
|
|
58
|
+
- \[Changed\]: TECH - Check and correct typography of all components
|
|
59
|
+
- \[Changed\]: TECH - Check and correct colors of some components
|
|
60
|
+
- \[Changed\]: PageInfo - Phát triển lại component PageInfo
|
|
61
|
+
- \[Changed\]: Icon - Remove effect; fix css; change storybook
|
|
62
|
+
- \[Changed\]: PopupV2 - Replace close button with ButtonIcon (Design update)
|
|
63
|
+
- \[Changed\]: ButtonIcon - Add props colorHover to custom hover color for ButtonIcon with color 'default'
|
|
64
|
+
- \[Changed\]: Badge - Phát triển lại component Badge
|
|
65
|
+
- \[Changed\]: Icon - Change icon Archive to ApprovalFilled
|
|
66
|
+
- \[Changed\]: DropdownBox - Add props onChangeInput, delayOnInput
|
|
67
|
+
- \[Changed\]: Icon - Fix storybook remove outlineIcon, underlineIcon
|
|
68
|
+
- \[Changed\]: Icon - PersonRate, Warehouse, PersonHistory, FolderInsurance, Maximize, Minimize, Scan, ArrowLeftFilled, ArrowRightFilled, ArrowUpFilled, ArrowDownFilled, CancelFilled, CloseFilled, BackFilled, AddFilled, PlusFilled, MinusFilled, Setting, Notification, Logout, LogoutV2, Login, Failed, PaperFilled, ListAprroval, StarFilled, StarOutline
|
|
69
|
+
- \[Fixed\]: Status - Fix height not flexible; Fix perfect pixel
|
|
70
|
+
- \[Fixed\]: Button - Fix perfect pixel
|
|
71
|
+
- \[Fixed\]: Dropdown - Optimize code
|
|
72
|
+
- \[Fixed\]: PopupV2 - Fix bug show less, more of description
|
|
73
|
+
- \[Fixed\]: Alert - Fix perfect pixel; Add size tiny
|
|
74
|
+
- \[Fixed\]: Attachment - Update localize
|
|
75
|
+
- \[Fixed\]: Button - Remove margin css
|
|
76
|
+
- \[Fixed\]: Label - Add css ellipsis, fix colors
|
|
77
|
+
- \[Fixed\]: Divider - Fix css, colors
|
|
78
|
+
- \[Fixed\]: Dropdown - Fix show wrong icon clear
|
|
79
|
+
- \[Fixed\]: Rating - Optimize code
|
|
80
|
+
- \[Fixed\]: DropdownBox - Fix bug not show dropdown
|
|
81
|
+
- \[Fixed\]: Button - Fix css Button with icon and Button without icon not in same row
|
|
82
|
+
- \[Fixed\]: TECH - Fix wrong color of Alert, Button, ButtonIcon, Paging, PopupV2, Rating
|
|
83
|
+
- \[Fixed\]: Dropdown - Fix bug show hide wrong on mobile
|
|
84
|
+
- \[Fixed\]: Datepicker - Fix bug not show defaultValue, warning when pass moment instance to date prop
|
|
85
|
+
- \[Fixed\]: Status - Fix css text to nowrap
|
|
86
|
+
- \[Fixed\]: Dropdown - Fix bug not show error when use multiple
|
|
87
|
+
|
|
88
|
+
## 1.3.25
|
|
89
|
+
- \[Added\]: Icon - PersonRate
|
|
90
|
+
- \[Added\]: MenuIcon - MHRP39N0015, MHRP29N0012, TASK, MHRP09N0028, MHRP09N0029
|
|
91
|
+
- \[Changed\]: MenuIcon - Rename Menu Icon ERP
|
|
92
|
+
- \[Changed\]: ButtonIcon - Update UI (Design update)
|
|
93
|
+
- \[Changed\]: Fonts - Add fonts to assets
|
|
94
|
+
- \[Changed\]: TECH - Replace <Icon /> with <ButtonIcon />
|
|
95
|
+
- \[Changed\]: Icon - Bag, Calendar, Clock, Copy, Edit, Export, Login, Logout, Mail, Mapping, Marker, Paper, Phone, PlanePaper, QuestionMark, Save, Send, Wait, Menu
|
|
96
|
+
- \[Fixed\]: Chip - Fix css width not max-content
|
|
97
|
+
- \[Fixed\]: Avatar - Fix bug Cannot read properties of null (reading 'querySelector')
|
|
98
|
+
- \[Fixed\]: DropdownBox - Fix bug DropdownBox not close when open modal
|
|
99
|
+
- \[Fixed\]: Dropdown - Remove ::after border-color when focus
|
|
100
|
+
- \[Changed\]: InputBase - Add text-overflow ellipsis
|
|
101
|
+
- \[Fixed\]: Dropdown - Fix bug cannot read properties of null (reading 'childNodes')
|
|
102
|
+
- \[Fixed\]: Dropdown - Fix bug scrollbar covering search bar of treeview
|
|
103
|
+
- \[Fixed\]: Avatar - Fix bug wrong size of default icon
|
|
104
|
+
- \[Fixed\]: PopupV2 - Fix bug not set open state when call onConfirm, onCancel
|
|
105
|
+
|
|
40
106
|
## Changelog
|
|
41
107
|
## 1.3.24
|
|
42
108
|
- \[Add\]: Icon - HourGlass
|
package/styles/color-helper.js
CHANGED
|
@@ -286,6 +286,8 @@ export const darken = (color, coefficient) => {
|
|
|
286
286
|
*/
|
|
287
287
|
|
|
288
288
|
export const lighten = (color, coefficient) => {
|
|
289
|
+
if (isColorName(color)) color = isColorName(color);
|
|
290
|
+
if (!isColor(color)) return;
|
|
289
291
|
color = decomposeColor(color);
|
|
290
292
|
coefficient = clamp(coefficient);
|
|
291
293
|
|
|
@@ -329,149 +331,6 @@ export const detectColor = color => {
|
|
|
329
331
|
|
|
330
332
|
return null;
|
|
331
333
|
};
|
|
332
|
-
export const colorNames = {
|
|
333
|
-
aliceblue: '#f0f8ff',
|
|
334
|
-
antiquewhite: '#faebd7',
|
|
335
|
-
aqua: '#00ffff',
|
|
336
|
-
aquamarine: '#7fffd4',
|
|
337
|
-
azure: '#f0ffff',
|
|
338
|
-
beige: '#f5f5dc',
|
|
339
|
-
bisque: '#ffe4c4',
|
|
340
|
-
black: '#000000',
|
|
341
|
-
blanchedalmond: '#ffebcd',
|
|
342
|
-
blue: '#0000ff',
|
|
343
|
-
blueviolet: '#8a2be2',
|
|
344
|
-
brown: '#a52a2a',
|
|
345
|
-
burlywood: '#deb887',
|
|
346
|
-
cadetblue: '#5f9ea0',
|
|
347
|
-
chartreuse: '#7fff00',
|
|
348
|
-
chocolate: '#d2691e',
|
|
349
|
-
coral: '#ff7f50',
|
|
350
|
-
cornflowerblue: '#6495ed',
|
|
351
|
-
cornsilk: '#fff8dc',
|
|
352
|
-
crimson: '#dc143c',
|
|
353
|
-
cyan: '#00ffff',
|
|
354
|
-
darkblue: '#00008b',
|
|
355
|
-
darkcyan: '#008b8b',
|
|
356
|
-
darkgoldenrod: '#b8860b',
|
|
357
|
-
darkgray: '#a9a9a9',
|
|
358
|
-
darkgreen: '#006400',
|
|
359
|
-
darkkhaki: '#bdb76b',
|
|
360
|
-
darkmagenta: '#8b008b',
|
|
361
|
-
darkolivegreen: '#556b2f',
|
|
362
|
-
darkorange: '#ff8c00',
|
|
363
|
-
darkorchid: '#9932cc',
|
|
364
|
-
darkred: '#8b0000',
|
|
365
|
-
darksalmon: '#e9967a',
|
|
366
|
-
darkseagreen: '#8fbc8f',
|
|
367
|
-
darkslateblue: '#483d8b',
|
|
368
|
-
darkslategray: '#2f4f4f',
|
|
369
|
-
darkturquoise: '#00ced1',
|
|
370
|
-
darkviolet: '#9400d3',
|
|
371
|
-
deeppink: '#ff1493',
|
|
372
|
-
deepskyblue: '#00bfff',
|
|
373
|
-
dimgray: '#696969',
|
|
374
|
-
dodgerblue: '#1e90ff',
|
|
375
|
-
firebrick: '#b22222',
|
|
376
|
-
floralwhite: '#fffaf0',
|
|
377
|
-
forestgreen: '#228b22',
|
|
378
|
-
fuchsia: '#ff00ff',
|
|
379
|
-
gainsboro: '#dcdcdc',
|
|
380
|
-
ghostwhite: '#f8f8ff',
|
|
381
|
-
gold: '#ffd700',
|
|
382
|
-
goldenrod: '#daa520',
|
|
383
|
-
gray: '#808080',
|
|
384
|
-
green: '#008000',
|
|
385
|
-
greenyellow: '#adff2f',
|
|
386
|
-
honeydew: '#f0fff0',
|
|
387
|
-
hotpink: '#ff69b4',
|
|
388
|
-
indianred: '#cd5c5c',
|
|
389
|
-
indigo: '#4b0082',
|
|
390
|
-
ivory: '#fffff0',
|
|
391
|
-
khaki: '#f0e68c',
|
|
392
|
-
lavender: '#e6e6fa',
|
|
393
|
-
lavenderblush: '#fff0f5',
|
|
394
|
-
lawngreen: '#7cfc00',
|
|
395
|
-
lemonchiffon: '#fffacd',
|
|
396
|
-
lightblue: '#add8e6',
|
|
397
|
-
lightcoral: '#f08080',
|
|
398
|
-
lightcyan: '#e0ffff',
|
|
399
|
-
lightgoldenrodyellow: '#fafad2',
|
|
400
|
-
lightgreen: '#90ee90',
|
|
401
|
-
lightgrey: '#d3d3d3',
|
|
402
|
-
lightpink: '#ffb6c1',
|
|
403
|
-
lightsalmon: '#ffa07a',
|
|
404
|
-
lightseagreen: '#20b2aa',
|
|
405
|
-
lightskyblue: '#87cefa',
|
|
406
|
-
lightslategray: '#778899',
|
|
407
|
-
lightsteelblue: '#b0c4de',
|
|
408
|
-
lightyellow: '#ffffe0',
|
|
409
|
-
lime: '#00ff00',
|
|
410
|
-
limegreen: '#32cd32',
|
|
411
|
-
linen: '#faf0e6',
|
|
412
|
-
magenta: '#ff00ff',
|
|
413
|
-
maroon: '#800000',
|
|
414
|
-
mediumaquamarine: '#66cdaa',
|
|
415
|
-
mediumblue: '#0000cd',
|
|
416
|
-
mediumorchid: '#ba55d3',
|
|
417
|
-
mediumpurple: '#9370d8',
|
|
418
|
-
mediumseagreen: '#3cb371',
|
|
419
|
-
mediumslateblue: '#7b68ee',
|
|
420
|
-
mediumspringgreen: '#00fa9a',
|
|
421
|
-
mediumturquoise: '#48d1cc',
|
|
422
|
-
mediumvioletred: '#c71585',
|
|
423
|
-
midnightblue: '#191970',
|
|
424
|
-
mintcream: '#f5fffa',
|
|
425
|
-
mistyrose: '#ffe4e1',
|
|
426
|
-
moccasin: '#ffe4b5',
|
|
427
|
-
navajowhite: '#ffdead',
|
|
428
|
-
navy: '#000080',
|
|
429
|
-
oldlace: '#fdf5e6',
|
|
430
|
-
olive: '#808000',
|
|
431
|
-
olivedrab: '#6b8e23',
|
|
432
|
-
orange: '#ffa500',
|
|
433
|
-
orangered: '#ff4500',
|
|
434
|
-
orchid: '#da70d6',
|
|
435
|
-
palegoldenrod: '#eee8aa',
|
|
436
|
-
palegreen: '#98fb98',
|
|
437
|
-
paleturquoise: '#afeeee',
|
|
438
|
-
palevioletred: '#d87093',
|
|
439
|
-
papayawhip: '#ffefd5',
|
|
440
|
-
peachpuff: '#ffdab9',
|
|
441
|
-
peru: '#cd853f',
|
|
442
|
-
pink: '#ffc0cb',
|
|
443
|
-
plum: '#dda0dd',
|
|
444
|
-
powderblue: '#b0e0e6',
|
|
445
|
-
purple: '#800080',
|
|
446
|
-
rebeccapurple: '#663399',
|
|
447
|
-
red: '#ff0000',
|
|
448
|
-
rosybrown: '#bc8f8f',
|
|
449
|
-
royalblue: '#4169e1',
|
|
450
|
-
saddlebrown: '#8b4513',
|
|
451
|
-
salmon: '#fa8072',
|
|
452
|
-
sandybrown: '#f4a460',
|
|
453
|
-
seagreen: '#2e8b57',
|
|
454
|
-
seashell: '#fff5ee',
|
|
455
|
-
sienna: '#a0522d',
|
|
456
|
-
silver: '#c0c0c0',
|
|
457
|
-
skyblue: '#87ceeb',
|
|
458
|
-
slateblue: '#6a5acd',
|
|
459
|
-
slategray: '#708090',
|
|
460
|
-
snow: '#fffafa',
|
|
461
|
-
springgreen: '#00ff7f',
|
|
462
|
-
steelblue: '#4682b4',
|
|
463
|
-
tan: '#d2b48c',
|
|
464
|
-
teal: '#008080',
|
|
465
|
-
thistle: '#d8bfd8',
|
|
466
|
-
tomato: '#ff6347',
|
|
467
|
-
turquoise: '#40e0d0',
|
|
468
|
-
violet: '#ee82ee',
|
|
469
|
-
wheat: '#f5deb3',
|
|
470
|
-
white: '#ffffff',
|
|
471
|
-
whitesmoke: '#f5f5f5',
|
|
472
|
-
yellow: '#ffff00',
|
|
473
|
-
yellowgreen: '#9acd32'
|
|
474
|
-
};
|
|
475
334
|
/**
|
|
476
335
|
* Validate a color name.
|
|
477
336
|
*
|
|
@@ -480,9 +339,9 @@ export const colorNames = {
|
|
|
480
339
|
*/
|
|
481
340
|
|
|
482
341
|
export const isColorName = color => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return false;
|
|
342
|
+
let ctx = document.createElement('canvas').getContext('2d');
|
|
343
|
+
ctx.fillStyle = color;
|
|
344
|
+
return ctx.fillStyle === '#000000' ? false : ctx.fillStyle;
|
|
486
345
|
};
|
|
487
346
|
/**
|
|
488
347
|
* Convert from #ffffff to rgba()
|
|
@@ -492,6 +351,8 @@ export const isColorName = color => {
|
|
|
492
351
|
*/
|
|
493
352
|
|
|
494
353
|
export const hexToRGBA = (hex, alpha) => {
|
|
354
|
+
if (isColorName(hex)) hex = isColorName(hex);
|
|
355
|
+
if (!isColor(hex)) return;
|
|
495
356
|
var r = parseInt(hex.slice(1, 3), 16),
|
|
496
357
|
g = parseInt(hex.slice(3, 5), 16),
|
|
497
358
|
b = parseInt(hex.slice(5, 7), 16);
|
package/styles/colors.js
CHANGED
|
@@ -273,7 +273,6 @@ color.fill = {
|
|
|
273
273
|
sidebar: color.white,
|
|
274
274
|
headerbar: color.brand12,
|
|
275
275
|
tabbar: color.brand12,
|
|
276
|
-
"tabbar-active": color.brand,
|
|
277
276
|
"scrollbar-tabbar": color.brand13,
|
|
278
277
|
"odd_raw": color.brand21,
|
|
279
278
|
"even_raw": color.white,
|
|
@@ -303,4 +302,9 @@ color.line = {
|
|
|
303
302
|
"grid_w_header": color.white,
|
|
304
303
|
category: color.dark2,
|
|
305
304
|
tab: color.dark2
|
|
306
|
-
};
|
|
305
|
+
};
|
|
306
|
+
color.primary = color.system.active;
|
|
307
|
+
color.success = color.semantic.success;
|
|
308
|
+
color.warning = color.semantic.warning;
|
|
309
|
+
color.danger = color.semantic.danger;
|
|
310
|
+
color.info = color.semantic.info;
|
package/styles/font.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const font = {
|
|
2
|
+
fontFamily: `"SF Pro Display"`,
|
|
3
|
+
fontFamilyLink: require("../assets/fonts/SF-Pro-Display-Regular.otf"),
|
|
4
|
+
fontFamilyMedium: `"SF Pro Display Medium"`,
|
|
5
|
+
fontFamilyMediumLink: require("../assets/fonts/SF-Pro-Display-Medium.otf"),
|
|
6
|
+
fontFamilyBold: `"SF Pro Display Bold"`,
|
|
7
|
+
fontFamilyBoldLink: require("../assets/fonts/SF-Pro-Display-Bold.otf"),
|
|
8
|
+
fontSize: "16px"
|
|
9
|
+
};
|
package/styles/general.js
CHANGED
|
@@ -32,17 +32,110 @@ export const fontSizes = {
|
|
|
32
32
|
xxlarge: '1.424rem'
|
|
33
33
|
};
|
|
34
34
|
export const flexRow = css`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
display: flex;
|
|
36
|
+
`;
|
|
37
|
+
export const inlineFlex = css`
|
|
38
|
+
display: inline-flex;
|
|
38
39
|
`;
|
|
39
40
|
export const flexCol = css`
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
`;
|
|
44
|
+
export const flexRowReverse = css`
|
|
45
|
+
flex-direction: row-reverse;
|
|
46
|
+
`;
|
|
47
|
+
export const flexWrap = css`
|
|
48
|
+
flex-wrap: wrap;
|
|
49
|
+
`;
|
|
50
|
+
export const alignStart = css`
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
`;
|
|
53
|
+
export const alignCenter = css`
|
|
54
|
+
align-items: center;
|
|
55
|
+
`;
|
|
56
|
+
export const alignEnd = css`
|
|
57
|
+
align-items: flex-end;
|
|
58
|
+
`;
|
|
59
|
+
export const justifyStart = css`
|
|
60
|
+
justify-content: flex-start;
|
|
61
|
+
`;
|
|
62
|
+
export const justifyCenter = css`
|
|
63
|
+
justify-content: center;
|
|
64
|
+
`;
|
|
65
|
+
export const justifyEnd = css`
|
|
66
|
+
justify-content: flex-end;
|
|
67
|
+
`;
|
|
68
|
+
export const displayBlock = css`
|
|
69
|
+
display: block;
|
|
70
|
+
`;
|
|
71
|
+
export const displayInlineBlock = css`
|
|
72
|
+
display: inline-block;
|
|
73
|
+
`;
|
|
74
|
+
export const positionRelative = css`
|
|
75
|
+
position: relative;
|
|
76
|
+
`;
|
|
77
|
+
export const positionAbsolute = css`
|
|
78
|
+
position: absolute;
|
|
79
|
+
`;
|
|
80
|
+
export const positionFixed = css`
|
|
81
|
+
position: fixed;
|
|
82
|
+
`;
|
|
83
|
+
export const borderRadius4px = css`
|
|
84
|
+
border-radius: 4px;
|
|
85
|
+
`;
|
|
86
|
+
export const borderBox = css`
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
`;
|
|
89
|
+
export const cursorPointer = css`
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
`;
|
|
92
|
+
export const overflowHidden = css`
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
`;
|
|
95
|
+
export const backgroundTransparent = css`
|
|
96
|
+
background-color: transparent;
|
|
97
|
+
`;
|
|
98
|
+
export const ellipsis = css`
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
text-overflow: ellipsis;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
`;
|
|
103
|
+
export const whiteSpaceNoWrap = css`
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
`;
|
|
106
|
+
export const breakWord = css`
|
|
107
|
+
word-break: break-word;
|
|
108
|
+
`;
|
|
109
|
+
export const textCapitalize = css`
|
|
110
|
+
text-transform: capitalize;
|
|
111
|
+
`;
|
|
112
|
+
export const textUppercase = css`
|
|
113
|
+
text-transform: uppercase;
|
|
114
|
+
`;
|
|
115
|
+
export const outlineNone = css`
|
|
116
|
+
outline: none;
|
|
117
|
+
`;
|
|
118
|
+
export const userSelectNone = css`
|
|
119
|
+
user-select: none;
|
|
120
|
+
`;
|
|
121
|
+
export const pointerEventsNone = css`
|
|
122
|
+
pointer-events: none;
|
|
123
|
+
`;
|
|
124
|
+
export const borderNone = css`
|
|
125
|
+
border: none;
|
|
126
|
+
`;
|
|
127
|
+
export const textCenter = css`
|
|
128
|
+
text-align: center;
|
|
42
129
|
`;
|
|
43
130
|
export const noMargin = css`
|
|
44
|
-
|
|
131
|
+
margin: 0 !important;
|
|
132
|
+
`;
|
|
133
|
+
export const noPadding = css`
|
|
134
|
+
padding: 0 !important;
|
|
135
|
+
`;
|
|
136
|
+
export const noBorder = css`
|
|
137
|
+
border: none !important;
|
|
45
138
|
`;
|
|
46
139
|
export const border = (withVl, colorVl) => css`
|
|
47
|
-
|
|
140
|
+
border: ${parseToPixel(withVl)} solid ${colorVl || color.dark};
|
|
48
141
|
`;
|