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
|
@@ -1,29 +1,34 @@
|
|
|
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
4
|
import { memo, useMemo, useRef, useState, useEffect, forwardRef, Fragment } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { jsx, css } from '@emotion/core';
|
|
9
|
-
import
|
|
10
|
-
import { Star } from '../../icons';
|
|
7
|
+
import { StarHalf, StarOutline } from '../../icons';
|
|
11
8
|
import { randomString } from '../../utils';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
import { hexToRGBA } from '../../styles/color-helper';
|
|
10
|
+
import { color as colors } from '../../styles/colors';
|
|
11
|
+
import { typography } from '../../styles/typography';
|
|
12
|
+
import { alignCenter, border, cursorPointer, flexRow, flexRowReverse, inlineFlex, outlineNone, overflowHidden, pointerEventsNone, positionAbsolute, positionRelative } from '../../styles/general';
|
|
13
|
+
const {
|
|
14
|
+
paragraph3
|
|
15
|
+
} = typography;
|
|
16
|
+
const {
|
|
17
|
+
system: {
|
|
18
|
+
active,
|
|
19
|
+
rest
|
|
20
|
+
},
|
|
21
|
+
semantic: {
|
|
22
|
+
success,
|
|
23
|
+
warning,
|
|
24
|
+
danger,
|
|
25
|
+
info
|
|
26
|
+
},
|
|
27
|
+
line: {
|
|
28
|
+
normal
|
|
25
29
|
}
|
|
26
|
-
};
|
|
30
|
+
} = colors;
|
|
31
|
+
const colorMap = new Map([['primary', active], ['success', success], ['warning', warning], ['danger', danger], ['info', info]]);
|
|
27
32
|
const Rating = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
28
33
|
disabled,
|
|
29
34
|
readOnly,
|
|
@@ -50,287 +55,163 @@ const Rating = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
50
55
|
allowSymbol: false,
|
|
51
56
|
allowNumber: false
|
|
52
57
|
}));
|
|
58
|
+
const [valueState, setValueState] = useState(value || defaultValue);
|
|
59
|
+
|
|
60
|
+
const _color = colorMap.get(color) || color;
|
|
61
|
+
|
|
62
|
+
const RatingRoot = css`
|
|
63
|
+
${inlineFlex}
|
|
64
|
+
${flexRowReverse}
|
|
65
|
+
${positionRelative}
|
|
66
|
+
&.disabled, &.read-only {
|
|
67
|
+
${pointerEventsNone}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
const RatingSelect = css`
|
|
71
|
+
${positionRelative}
|
|
72
|
+
${outlineNone}
|
|
73
|
+
${paragraph3}
|
|
74
|
+
${border(1, normal)}
|
|
75
|
+
margin-left: 4px;
|
|
76
|
+
color: ${active};
|
|
77
|
+
&:hover {
|
|
78
|
+
border-color: ${active};
|
|
79
|
+
background-color: ${hexToRGBA(active, 0.2)};
|
|
80
|
+
}
|
|
81
|
+
&:active,
|
|
82
|
+
&:focus {
|
|
83
|
+
border-color: ${info};
|
|
84
|
+
}
|
|
85
|
+
option {
|
|
86
|
+
background-color: white;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
53
89
|
const RatingItemHaft = css`
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
90
|
+
${flexRow}
|
|
91
|
+
${positionAbsolute}
|
|
92
|
+
${alignCenter}
|
|
93
|
+
${overflowHidden}
|
|
94
|
+
width: 50%;
|
|
58
95
|
svg {
|
|
59
|
-
|
|
96
|
+
${cursorPointer}
|
|
60
97
|
color: transparent;
|
|
61
|
-
cursor: pointer;
|
|
62
98
|
transition: color 0.15s linear;
|
|
63
|
-
|
|
64
|
-
left: 50%;
|
|
65
|
-
&.left {
|
|
66
|
-
transform: rotateY(180deg);
|
|
99
|
+
transform: scale(2);
|
|
67
100
|
transform-origin: left;
|
|
68
101
|
}
|
|
69
102
|
&.right {
|
|
103
|
+
transform: rotateY(180deg);
|
|
70
104
|
right: 0;
|
|
71
105
|
}
|
|
72
106
|
&.half {
|
|
73
|
-
svg:hover
|
|
74
|
-
|
|
75
|
-
}
|
|
107
|
+
svg:hover,
|
|
108
|
+
&.right:hover + span svg,
|
|
76
109
|
&.chosen svg {
|
|
77
|
-
color: ${
|
|
110
|
+
color: ${_color};
|
|
78
111
|
}
|
|
79
|
-
&.
|
|
80
|
-
svg {
|
|
81
|
-
color: ${
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
&.right:hover + span {
|
|
85
|
-
svg {
|
|
86
|
-
color: ${colors[color] || color} !important;
|
|
112
|
+
&.chosen {
|
|
113
|
+
&.disabled svg {
|
|
114
|
+
color: ${rest} !important;
|
|
87
115
|
}
|
|
88
116
|
}
|
|
89
117
|
}
|
|
90
118
|
`;
|
|
91
119
|
const RatingItem = css`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
&:hover {
|
|
98
|
-
color: ${colors[color] || color} !important;
|
|
99
|
-
}
|
|
100
|
-
&:hover ~ span {
|
|
101
|
-
color: ${colors[color] || color} !important;
|
|
102
|
-
}
|
|
103
|
-
&:hover ~ span > span.css-${RatingItemHaft.name},
|
|
104
|
-
${half ? '' : `&:hover,`}
|
|
105
|
-
&:hover ~ span.full {
|
|
106
|
-
svg {
|
|
107
|
-
color: ${colors[color] || color} !important;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
&.chosen {
|
|
111
|
-
color: ${colors.chosen[color] || color};
|
|
112
|
-
}
|
|
113
|
-
&.chosen ~ span {
|
|
114
|
-
color: ${colors.chosen[color] || color};
|
|
120
|
+
${inlineFlex}
|
|
121
|
+
${positionRelative}
|
|
122
|
+
${alignCenter}
|
|
123
|
+
svg {
|
|
124
|
+
transition: color 0.15s linear;
|
|
115
125
|
}
|
|
116
|
-
|
|
117
|
-
${half ? '' : `&.chosen,`}
|
|
118
|
-
&.chosen ~ span.full {
|
|
126
|
+
&:hover ~ span > span.css-${RatingItemHaft.name}, ${half ? '' : `&:hover,`} &:hover ~ span.full,
|
|
127
|
+
&.chosen ~ span > span.css-${RatingItemHaft.name}, ${half ? '' : `&.chosen,`} &.chosen ~ span.full {
|
|
119
128
|
svg {
|
|
120
|
-
color: ${
|
|
129
|
+
color: ${_color};
|
|
121
130
|
}
|
|
122
131
|
}
|
|
123
132
|
&.disabled {
|
|
124
|
-
color: ${theme.colors.disabled} !important;
|
|
125
133
|
&.chosen {
|
|
126
|
-
color: ${theme.colors.disabled} !important;
|
|
127
|
-
svg {
|
|
128
|
-
color: ${theme.colors.disabled} !important;
|
|
129
|
-
}
|
|
130
|
-
.DGN-UI-Rating-Item-Star.half.right:not(.chosen) {
|
|
131
|
-
svg {
|
|
132
|
-
color: transparent !important;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
&.chosen ~ span {
|
|
137
|
-
color: ${theme.colors.disabled} !important;
|
|
138
|
-
}
|
|
139
|
-
&.chosen ~ span > span.css-${RatingItemHaft.name},
|
|
140
|
-
&.chosen ~ span.full {
|
|
141
134
|
svg {
|
|
142
|
-
color: ${
|
|
135
|
+
color: ${rest} !important;
|
|
143
136
|
}
|
|
144
137
|
}
|
|
145
138
|
}
|
|
146
139
|
`;
|
|
147
|
-
const RatingSelect = css`
|
|
148
|
-
position: relative;
|
|
149
|
-
outline: none;
|
|
150
|
-
font-family: ${theme.typography.fontFamily};
|
|
151
|
-
margin-left: 4px;
|
|
152
|
-
color: ${theme.colors.default};
|
|
153
|
-
border-color: ${theme.colors.default};
|
|
154
|
-
`;
|
|
155
|
-
const RatingRoot = css`
|
|
156
|
-
display: inline-flex;
|
|
157
|
-
flex-direction: row-reverse;
|
|
158
|
-
position: relative;
|
|
159
|
-
&.disabled {
|
|
160
|
-
pointer-events: none;
|
|
161
|
-
}
|
|
162
|
-
&.read-only {
|
|
163
|
-
pointer-events: none;
|
|
164
|
-
.DGN-UI-Rating-Item {
|
|
165
|
-
pointer-events: none;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
const onRatingHandler = (e, num, halfRating = 0) => {
|
|
171
|
-
removeChosenRating();
|
|
172
|
-
|
|
173
|
-
if (half) {
|
|
174
|
-
e.currentTarget.parentNode.classList.add('chosen');
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
e.currentTarget.classList.add('chosen');
|
|
178
|
-
|
|
179
|
-
if (selectRef.current) {
|
|
180
|
-
selectRef.current.value = num + halfRating / 2;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
e.value = num + halfRating / 2;
|
|
184
|
-
!!onRating && onRating(e);
|
|
185
|
-
};
|
|
186
140
|
|
|
187
141
|
const onSelectValue = e => {
|
|
142
|
+
if (disabled || readOnly) return;
|
|
188
143
|
const newValue = +e.target.value;
|
|
189
144
|
e.value = newValue;
|
|
190
|
-
|
|
145
|
+
setValueState(newValue);
|
|
191
146
|
!!onRating && onRating(e);
|
|
192
147
|
};
|
|
193
148
|
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
star = quantity;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const position = quantity - Math.floor(star);
|
|
202
|
-
const childNodes = ref.current.querySelectorAll(`.css-${RatingItem.name}`);
|
|
203
|
-
|
|
204
|
-
if (half) {
|
|
205
|
-
const halfRating = star * 10 % 10;
|
|
206
|
-
|
|
207
|
-
if (halfRating >= 5) {
|
|
208
|
-
childNodes[position - 1].classList.add('chosen');
|
|
209
|
-
childNodes[position - 1].querySelector('span.left').classList.add('chosen');
|
|
210
|
-
} else if (star > 0) {
|
|
211
|
-
childNodes[position].classList.add('chosen');
|
|
212
|
-
childNodes[position].querySelector('span.right').classList.add('chosen');
|
|
213
|
-
}
|
|
214
|
-
} else if (star >= 1) {
|
|
215
|
-
childNodes[position].classList.add('chosen');
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (selectRef.current) {
|
|
219
|
-
selectRef.current.value = star;
|
|
220
|
-
|
|
221
|
-
if (selectRef.current.firstChild && !selectRef.current.firstChild.value) {
|
|
222
|
-
selectRef.current.firstChild.remove();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
const removeChosenRating = () => {
|
|
228
|
-
const chosenNode = ref.current.querySelectorAll('.chosen');
|
|
229
|
-
|
|
230
|
-
if (chosenNode && chosenNode.length) {
|
|
231
|
-
chosenNode.forEach(node => {
|
|
232
|
-
node.classList.remove('chosen');
|
|
233
|
-
});
|
|
234
|
-
}
|
|
149
|
+
const _onRating = (e, value, isHalf = false) => {
|
|
150
|
+
if (disabled || readOnly || half && !isHalf) return;
|
|
151
|
+
setValueState(value);
|
|
152
|
+
!!onRating && onRating(e);
|
|
235
153
|
};
|
|
236
154
|
|
|
237
155
|
useEffect(() => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
}, []);
|
|
242
|
-
useEffect(() => {
|
|
243
|
-
if (disabled) {
|
|
244
|
-
ref.current.classList.add('disabled');
|
|
245
|
-
ref.current.querySelectorAll('.DGN-UI-Rating-Item').forEach(star => {
|
|
246
|
-
star.classList.add('disabled');
|
|
247
|
-
});
|
|
248
|
-
return () => {
|
|
249
|
-
if (ref.current) {
|
|
250
|
-
ref.current.classList.remove('disabled');
|
|
251
|
-
ref.current.querySelectorAll('.DGN-UI-Rating-Item').forEach(star => {
|
|
252
|
-
star.classList.remove('disabled');
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
}, [disabled]);
|
|
258
|
-
useEffect(() => {
|
|
259
|
-
if (typeof value === 'number') {
|
|
260
|
-
setRating(value);
|
|
261
|
-
}
|
|
262
|
-
}, [value, quantity, half]);
|
|
156
|
+
setValueState(value);
|
|
157
|
+
}, [value]);
|
|
263
158
|
return useMemo(() => {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
height = width === 20 ? 19 : width * 19 / 20;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (!width && height) {
|
|
271
|
-
width = height * 20 / 19;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
for (let i = 0; i < quantity; i++) {
|
|
275
|
-
ArrayRating.push(i);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return jsx("div", _extends({
|
|
159
|
+
let ArrayRating = [];
|
|
160
|
+
[...Array(quantity).keys()].reverse().forEach(item => ArrayRating = [...ArrayRating, item + 1]);
|
|
161
|
+
return jsx("div", {
|
|
279
162
|
css: RatingRoot,
|
|
280
163
|
ref: ref,
|
|
281
164
|
style: style,
|
|
282
|
-
className: ['DGN-UI-Rating', className, readOnly ? 'read-only' : ''].join(' ').trim()
|
|
283
|
-
|
|
165
|
+
className: ['DGN-UI-Rating', className, disabled && 'disabled', readOnly ? 'read-only' : ''].join(' ').trim(),
|
|
166
|
+
...props
|
|
167
|
+
}, selector && jsx("select", {
|
|
284
168
|
css: RatingSelect,
|
|
285
169
|
ref: selectRef,
|
|
286
170
|
name: `Rating-Select-${unique}`,
|
|
287
171
|
id: `Rating-Select-${unique}`,
|
|
288
172
|
disabled: disabled,
|
|
289
|
-
|
|
173
|
+
value: valueState,
|
|
290
174
|
onChange: onSelectValue
|
|
291
175
|
}, jsx("option", {
|
|
292
176
|
value: '',
|
|
293
177
|
id: unique + '-0'
|
|
294
|
-
}, 0), ArrayRating.map(i => half ? jsx(Fragment, {
|
|
178
|
+
}, 0), ArrayRating.map((i, idx) => half ? jsx(Fragment, {
|
|
295
179
|
key: i
|
|
296
180
|
}, jsx("option", {
|
|
297
|
-
value:
|
|
298
|
-
},
|
|
299
|
-
value:
|
|
300
|
-
},
|
|
181
|
+
value: idx + 0.5
|
|
182
|
+
}, idx + 0.5), jsx("option", {
|
|
183
|
+
value: idx + 1
|
|
184
|
+
}, idx + 1)) : jsx("option", {
|
|
301
185
|
key: i,
|
|
302
|
-
value:
|
|
303
|
-
},
|
|
186
|
+
value: idx + 1
|
|
187
|
+
}, idx + 1))), ArrayRating.map(i => jsx("span", {
|
|
304
188
|
css: RatingItem,
|
|
305
189
|
style: starStyle,
|
|
306
190
|
key: i,
|
|
307
|
-
className: 'DGN-UI-Rating-Item',
|
|
308
|
-
onClick:
|
|
309
|
-
}, jsx(
|
|
191
|
+
className: ['DGN-UI-Rating-Item', disabled && 'disabled', i <= valueState && 'chosen'].join(' ').trim().replace(/\s+/g, ' '),
|
|
192
|
+
onClick: e => _onRating(e, i)
|
|
193
|
+
}, jsx(StarOutline, {
|
|
310
194
|
width: width,
|
|
311
195
|
height: height,
|
|
312
|
-
|
|
313
|
-
color: color || 'currentColor'
|
|
196
|
+
color: disabled ? rest : color || 'currentColor'
|
|
314
197
|
}), jsx("span", {
|
|
315
198
|
css: RatingItemHaft,
|
|
316
|
-
className: 'DGN-UI-Rating-Item-Star right'
|
|
317
|
-
onClick:
|
|
318
|
-
}, jsx(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
height: height * 14 / 19,
|
|
199
|
+
className: ['DGN-UI-Rating-Item-Star right', disabled && 'disabled', half && 'half', i <= valueState && 'chosen'].join(' ').trim().replace(/\s+/g, ' '),
|
|
200
|
+
onClick: e => _onRating(e, i, true)
|
|
201
|
+
}, jsx(StarHalf, {
|
|
202
|
+
width: width,
|
|
203
|
+
height: height,
|
|
322
204
|
color: 'currentColor'
|
|
323
205
|
})), jsx("span", {
|
|
324
206
|
css: RatingItemHaft,
|
|
325
|
-
className: 'DGN-UI-Rating-Item-Star left'
|
|
326
|
-
onClick:
|
|
327
|
-
}, jsx(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
height: height * 14 / 19,
|
|
207
|
+
className: ['DGN-UI-Rating-Item-Star left', disabled && 'disabled', half && 'half', i - 0.5 <= valueState && 'chosen'].join(' ').trim().replace(/\s+/g, ' '),
|
|
208
|
+
onClick: e => _onRating(e, i - 0.5, true)
|
|
209
|
+
}, jsx(StarHalf, {
|
|
210
|
+
width: width,
|
|
211
|
+
height: height,
|
|
331
212
|
color: 'currentColor'
|
|
332
213
|
})))));
|
|
333
|
-
}, [half, color, quantity, readOnly, disabled, selector, width, height, onRating]);
|
|
214
|
+
}, [half, color, quantity, readOnly, disabled, selector, width, height, onRating, valueState]);
|
|
334
215
|
}));
|
|
335
216
|
Rating.defaultProps = {
|
|
336
217
|
disabled: false,
|
|
@@ -1,12 +1,10 @@
|
|
|
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
4
|
import { css, jsx } from '@emotion/core';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
9
|
-
import
|
|
7
|
+
import { ButtonIcon } from '..';
|
|
10
8
|
import theme from '../../theme/settings';
|
|
11
9
|
import { randomString } from '../../utils';
|
|
12
10
|
import SliderItem from './slider-item';
|
|
@@ -289,17 +287,23 @@ const SliderContainer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
289
287
|
const IconLeft = useMemo(() => jsx("span", {
|
|
290
288
|
className: [IDs.icon, IDs.iconLeft].join(' '),
|
|
291
289
|
ref: iconLeftRef
|
|
292
|
-
}, jsx(
|
|
290
|
+
}, jsx(ButtonIcon, {
|
|
291
|
+
circular: true,
|
|
292
|
+
viewType: 'filled',
|
|
293
|
+
size: 'tiny',
|
|
294
|
+
color: 'primary',
|
|
293
295
|
name: 'ArrowLeft',
|
|
294
|
-
type: 'filled',
|
|
295
296
|
style: styles.icon
|
|
296
297
|
})), [children, data]);
|
|
297
298
|
const IconRight = useMemo(() => jsx("span", {
|
|
298
299
|
className: [IDs.icon, IDs.iconRight].join(' '),
|
|
299
300
|
ref: iconRightRef
|
|
300
|
-
}, jsx(
|
|
301
|
+
}, jsx(ButtonIcon, {
|
|
302
|
+
circular: true,
|
|
303
|
+
viewType: 'filled',
|
|
304
|
+
size: 'tiny',
|
|
305
|
+
color: 'primary',
|
|
301
306
|
name: 'ArrowRight',
|
|
302
|
-
type: 'filled',
|
|
303
307
|
style: styles.icon
|
|
304
308
|
})), [children, data]);
|
|
305
309
|
const Navigation = useMemo(() => jsx("div", {
|
|
@@ -313,13 +317,14 @@ const SliderContainer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
313
317
|
id: IDs.navigationList,
|
|
314
318
|
ref: navigationListRef
|
|
315
319
|
})), [animation, autoChangeTime, children, data, onShowNavigation]);
|
|
316
|
-
return jsx("div",
|
|
320
|
+
return jsx("div", {
|
|
317
321
|
css: styles.container,
|
|
318
322
|
className: [IDs.container, className].join(' '),
|
|
319
323
|
id: IDs.container,
|
|
320
324
|
style: style,
|
|
321
|
-
ref: ref
|
|
322
|
-
|
|
325
|
+
ref: ref,
|
|
326
|
+
...props
|
|
327
|
+
}, Slider, IconLeft, IconRight, Navigation);
|
|
323
328
|
}));
|
|
324
329
|
SliderContainer.defaultProps = {
|
|
325
330
|
animation: true,
|
|
@@ -1,5 +1,3 @@
|
|
|
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 */
|
|
@@ -95,34 +93,34 @@ const SliderItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
95
93
|
switch (fileType) {
|
|
96
94
|
case 'image':
|
|
97
95
|
{
|
|
98
|
-
return jsx("img",
|
|
96
|
+
return jsx("img", { ...props,
|
|
99
97
|
className: IDs.image,
|
|
100
98
|
css: styles.image,
|
|
101
99
|
src: filePath
|
|
102
|
-
})
|
|
100
|
+
});
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
case 'word':
|
|
106
104
|
case 'sheet':
|
|
107
105
|
{
|
|
108
|
-
return jsx("iframe",
|
|
106
|
+
return jsx("iframe", { ...props,
|
|
109
107
|
className: IDs.frame,
|
|
110
108
|
css: styles.frame,
|
|
111
109
|
frameBorder: 0,
|
|
112
110
|
src: `http://view.officeapps.live.com/op/view.aspx?src=${filePath}`,
|
|
113
111
|
title: fileName
|
|
114
|
-
})
|
|
112
|
+
});
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
case 'pdf':
|
|
118
116
|
{
|
|
119
|
-
return jsx("iframe",
|
|
117
|
+
return jsx("iframe", { ...props,
|
|
120
118
|
className: IDs.frame,
|
|
121
119
|
css: styles.frame,
|
|
122
120
|
frameBorder: 0,
|
|
123
121
|
src: `https://docs.google.com/gview?url=${filePath}&embedded=true`,
|
|
124
122
|
title: fileName
|
|
125
|
-
})
|
|
123
|
+
});
|
|
126
124
|
}
|
|
127
125
|
|
|
128
126
|
case 'mp4':
|
|
@@ -141,24 +139,24 @@ const SliderItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
141
139
|
|
|
142
140
|
case 'another':
|
|
143
141
|
{
|
|
144
|
-
return jsx("iframe",
|
|
142
|
+
return jsx("iframe", { ...props,
|
|
145
143
|
className: IDs.frame,
|
|
146
144
|
css: styles.frame,
|
|
147
145
|
frameBorder: 0,
|
|
148
146
|
src: checkURL(filePath),
|
|
149
147
|
title: fileName
|
|
150
|
-
})
|
|
148
|
+
});
|
|
151
149
|
}
|
|
152
150
|
|
|
153
151
|
default:
|
|
154
152
|
{
|
|
155
|
-
return jsx("iframe",
|
|
153
|
+
return jsx("iframe", { ...props,
|
|
156
154
|
className: IDs.frame,
|
|
157
155
|
css: styles.frame,
|
|
158
156
|
frameBorder: 0,
|
|
159
157
|
src: filePath,
|
|
160
158
|
title: fileName
|
|
161
|
-
})
|
|
159
|
+
});
|
|
162
160
|
}
|
|
163
161
|
}
|
|
164
162
|
};
|