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,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 */
|
|
@@ -8,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
8
6
|
import { forwardRef, memo, useState, useEffect, useRef } from 'react';
|
|
9
7
|
import theme from '../../../theme/settings';
|
|
10
8
|
import { randomString } from '../../../utils';
|
|
9
|
+
import { typography } from '../../../styles/typography';
|
|
11
10
|
const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
12
11
|
id,
|
|
13
12
|
disabled,
|
|
@@ -44,10 +43,6 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
44
43
|
display: none;
|
|
45
44
|
position: absolute;
|
|
46
45
|
box-sizing: border-box;
|
|
47
|
-
padding-left: 2.19rem;
|
|
48
|
-
height: 1.57rem;
|
|
49
|
-
line-height: 1.57rem;
|
|
50
|
-
font-size: 16px;
|
|
51
46
|
&:disabled + label {
|
|
52
47
|
pointer-events: none;
|
|
53
48
|
}
|
|
@@ -103,11 +98,7 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
103
98
|
cursor: pointer;
|
|
104
99
|
position: relative;
|
|
105
100
|
padding-left: 2.19rem;
|
|
106
|
-
|
|
107
|
-
font-size: 1rem;
|
|
108
|
-
font-size: 16px;
|
|
109
|
-
font-weight: 500;
|
|
110
|
-
font-family: ${theme.typography.fontFamily};
|
|
101
|
+
${typography.paragraph1};
|
|
111
102
|
margin-bottom: 0;
|
|
112
103
|
transition: .28s ease;
|
|
113
104
|
-o-transition: .28s ease;
|
|
@@ -191,12 +182,13 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
191
182
|
}
|
|
192
183
|
};
|
|
193
184
|
}, [checked]);
|
|
194
|
-
return jsx("div",
|
|
185
|
+
return jsx("div", {
|
|
195
186
|
id: 'DGN-Core-Radio-' + (id || unique),
|
|
196
187
|
css: formCheck,
|
|
197
188
|
className: ['DGN-UI-Radio', disabled ? 'disabled' : '', className].join(' ').trim(),
|
|
198
|
-
ref: ref
|
|
199
|
-
|
|
189
|
+
ref: ref,
|
|
190
|
+
...props
|
|
191
|
+
}, jsx("input", { ...inputProps,
|
|
200
192
|
disabled: disabled,
|
|
201
193
|
ref: inputRef,
|
|
202
194
|
name: name,
|
|
@@ -206,7 +198,7 @@ const Radio = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
206
198
|
css: formCheckInput,
|
|
207
199
|
id: id || unique,
|
|
208
200
|
onChange: !!onChange ? handleChange : null
|
|
209
|
-
})
|
|
201
|
+
}), jsx("label", {
|
|
210
202
|
css: formCheckLabel,
|
|
211
203
|
htmlFor: id || unique
|
|
212
204
|
}, " ", label || value));
|
|
@@ -1,13 +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 { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { jsx, css } from '@emotion/core';
|
|
9
|
-
import { CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
|
|
10
|
-
import Icon from '../../../icons';
|
|
7
|
+
import { ButtonIcon, CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
|
|
11
8
|
import { renderIcon, onValidate } from '../../../utils';
|
|
12
9
|
const icons = {
|
|
13
10
|
default: `<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -307,46 +304,39 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
307
304
|
})) : /^(quick)?Edit/i.test(type) ? jsx("div", {
|
|
308
305
|
ref: iconRef,
|
|
309
306
|
css: TextInputIcon
|
|
310
|
-
}, jsx(
|
|
307
|
+
}, jsx(ButtonIcon, {
|
|
308
|
+
viewType: 'ghost',
|
|
311
309
|
name: 'Edit',
|
|
312
310
|
className: 'edit-icon-pen',
|
|
313
|
-
width: 20,
|
|
314
|
-
height: 20,
|
|
315
|
-
style: {
|
|
316
|
-
padding: 0
|
|
317
|
-
},
|
|
318
311
|
onClick: onClickQuickEdit
|
|
319
|
-
}), jsx(
|
|
312
|
+
}), jsx(ButtonIcon, {
|
|
313
|
+
viewType: 'ghost',
|
|
320
314
|
name: 'Approval',
|
|
321
315
|
className: 'edit-icon-confirm',
|
|
322
|
-
width: 20,
|
|
323
|
-
height: 20,
|
|
324
|
-
style: {
|
|
325
|
-
padding: 0
|
|
326
|
-
},
|
|
327
316
|
onClick: onConfirmEdit
|
|
328
317
|
}), jsx("span", {
|
|
329
318
|
className: 'circular'
|
|
330
319
|
}, jsx(Circular, {
|
|
331
320
|
width: 24,
|
|
332
321
|
strokeWidth: 2
|
|
333
|
-
})), jsx(
|
|
322
|
+
})), jsx(ButtonIcon, {
|
|
323
|
+
viewType: 'ghost',
|
|
334
324
|
name: 'Close',
|
|
335
325
|
className: 'edit-icon-clear',
|
|
336
|
-
width: 16,
|
|
337
|
-
height: 16,
|
|
338
326
|
onClick: onClear,
|
|
339
327
|
onMouseDown: onMouseDownHandler
|
|
340
328
|
})) : endIcon;
|
|
341
|
-
return jsx("div",
|
|
329
|
+
return jsx("div", {
|
|
342
330
|
ref: ref,
|
|
343
331
|
css: TextInputRoot,
|
|
344
332
|
className: ['DGN-UI-TextInput', className].join(' ').trim(),
|
|
345
|
-
style: style
|
|
346
|
-
|
|
333
|
+
style: style,
|
|
334
|
+
...props
|
|
335
|
+
}, !!label && jsx(Label, {
|
|
347
336
|
required: required,
|
|
348
|
-
disabled: disabled
|
|
349
|
-
|
|
337
|
+
disabled: disabled,
|
|
338
|
+
...labelProps
|
|
339
|
+
}, label), jsx(InputBase, {
|
|
350
340
|
type: /text|number|password/.test(type) ? type : 'text',
|
|
351
341
|
autoComplete: autoComplete,
|
|
352
342
|
inputRef: inputRef,
|
|
@@ -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 */
|
|
@@ -10,6 +8,7 @@ import { Cancel as CancelIcon, Clock as ClockIcon } from '../../../icons';
|
|
|
10
8
|
import { randomString, useOnClickOutside } from '../../../utils';
|
|
11
9
|
import theme from '../../../theme/settings';
|
|
12
10
|
import Swiper from './swiper';
|
|
11
|
+
import { typography } from '../../../styles/typography';
|
|
13
12
|
|
|
14
13
|
const formatDimension = x => {
|
|
15
14
|
const regexPercent = /^\d+%$/;
|
|
@@ -140,7 +139,6 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
140
139
|
outlined: css`
|
|
141
140
|
* {
|
|
142
141
|
box-sizing: border-box;
|
|
143
|
-
font-family: ${theme.typography.fontFamily};
|
|
144
142
|
}
|
|
145
143
|
margin: 0;
|
|
146
144
|
padding: 0;
|
|
@@ -210,16 +208,14 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
210
208
|
margin-bottom: 4px;
|
|
211
209
|
label {
|
|
212
210
|
color: ${theme.colors.label};
|
|
213
|
-
|
|
214
|
-
font-weight: 700;
|
|
211
|
+
${typography.heading6};
|
|
215
212
|
pointer-events: initial;
|
|
216
213
|
user-select: initial;
|
|
217
214
|
}
|
|
218
215
|
`,
|
|
219
216
|
required: css`
|
|
220
217
|
color: ${theme.colors.danger};
|
|
221
|
-
|
|
222
|
-
font-weight: bold;
|
|
218
|
+
${typography.heading6};
|
|
223
219
|
`
|
|
224
220
|
},
|
|
225
221
|
main: {
|
|
@@ -360,7 +356,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
360
356
|
outlined: css`
|
|
361
357
|
background-color: transparent;
|
|
362
358
|
border: 0;
|
|
363
|
-
|
|
359
|
+
${typography.paragraph1};
|
|
364
360
|
margin: 0;
|
|
365
361
|
outline: none;
|
|
366
362
|
padding: 10px 16px;
|
|
@@ -375,8 +371,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
375
371
|
underlined: css`
|
|
376
372
|
background-color: white;
|
|
377
373
|
border: 0;
|
|
378
|
-
|
|
379
|
-
line-height: 20px;
|
|
374
|
+
${typography.paragraph1};
|
|
380
375
|
margin: auto 0;
|
|
381
376
|
outline: none;
|
|
382
377
|
padding: 0;
|
|
@@ -395,15 +390,14 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
395
390
|
color: ${theme.colors.border};
|
|
396
391
|
cursor: pointer;
|
|
397
392
|
display: flex;
|
|
398
|
-
|
|
399
|
-
height: 20px;
|
|
393
|
+
height: 24px;
|
|
400
394
|
justify-content: center;
|
|
401
395
|
position: absolute;
|
|
402
396
|
top: 50%;
|
|
403
397
|
right: 20px;
|
|
404
398
|
transform: translateY(-50%);
|
|
405
399
|
transition: opacity 0.2s ease, color 0.2s ease;
|
|
406
|
-
width:
|
|
400
|
+
width: 24px;
|
|
407
401
|
&.svg-active {
|
|
408
402
|
opacity: 0;
|
|
409
403
|
visibility: hidden;
|
|
@@ -417,15 +411,14 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
417
411
|
color: ${theme.colors.border};
|
|
418
412
|
cursor: pointer;
|
|
419
413
|
display: flex;
|
|
420
|
-
|
|
421
|
-
height: 20px;
|
|
414
|
+
height: 24px;
|
|
422
415
|
justify-content: center;
|
|
423
416
|
position: absolute;
|
|
424
417
|
top: 50%;
|
|
425
418
|
right: 6px;
|
|
426
419
|
transform: translateY(-50%);
|
|
427
420
|
transition: opacity 0.2s ease, color 0.2s ease;
|
|
428
|
-
width:
|
|
421
|
+
width: 24px;
|
|
429
422
|
&.svg-active {
|
|
430
423
|
opacity: 0;
|
|
431
424
|
visibility: hidden;
|
|
@@ -438,17 +431,13 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
438
431
|
error: {
|
|
439
432
|
outlined: css`
|
|
440
433
|
color: ${theme.colors.danger};
|
|
441
|
-
|
|
442
|
-
font-weight: 400;
|
|
443
|
-
line-height: 12px;
|
|
434
|
+
${typography.paragraph3};
|
|
444
435
|
margin-top: 8px;
|
|
445
436
|
pointer-events: none;
|
|
446
437
|
`,
|
|
447
438
|
underlined: css`
|
|
448
439
|
color: ${theme.colors.danger};
|
|
449
|
-
|
|
450
|
-
font-weight: 400;
|
|
451
|
-
line-height: 12px;
|
|
440
|
+
${typography.paragraph3};
|
|
452
441
|
bottom: -20px;
|
|
453
442
|
position: absolute;
|
|
454
443
|
pointer-events: none;
|
|
@@ -699,7 +688,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
699
688
|
id: IDs.label,
|
|
700
689
|
htmlFor: IDs.inputTypeText
|
|
701
690
|
}, label), RequireMemo), [label, required, error, disabled]);
|
|
702
|
-
const InputMemo = useMemo(() => jsx("input",
|
|
691
|
+
const InputMemo = useMemo(() => jsx("input", { ...inputProps,
|
|
703
692
|
css: styles.input[viewType],
|
|
704
693
|
disabled: disabled,
|
|
705
694
|
id: IDs.inputTypeText,
|
|
@@ -708,7 +697,7 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
708
697
|
readOnly: true,
|
|
709
698
|
ref: inputRef,
|
|
710
699
|
type: 'text'
|
|
711
|
-
})
|
|
700
|
+
}), [allowSeconds, disabled, viewType]);
|
|
712
701
|
const IconMemo = useMemo(() => jsx(React.Fragment, null, jsx("span", {
|
|
713
702
|
css: styles.icon[viewType],
|
|
714
703
|
className: `${IDs.icon} svg-default`,
|
|
@@ -776,10 +765,10 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
776
765
|
css: styles.main[viewType],
|
|
777
766
|
ref: mainRef
|
|
778
767
|
}, InputMemo, IconMemo, ErrorMemo), [activeHeight, activeWidth, allowSeconds, defaultValue, disabled, error, value, viewType]);
|
|
779
|
-
return jsx("div",
|
|
768
|
+
return jsx("div", { ...props,
|
|
780
769
|
css: styles.container[viewType],
|
|
781
770
|
ref: ref
|
|
782
|
-
}
|
|
771
|
+
}, LabelMemo, MainMemo, ClockMemo);
|
|
783
772
|
}));
|
|
784
773
|
TimePicker.defaultProps = {
|
|
785
774
|
activeHeight: 200,
|
|
@@ -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 */
|
|
@@ -540,13 +538,13 @@ const Swiper = props => {
|
|
|
540
538
|
select(value);
|
|
541
539
|
}
|
|
542
540
|
}, [value]);
|
|
543
|
-
return jsx("div",
|
|
541
|
+
return jsx("div", { ...other,
|
|
544
542
|
className: IDs.container,
|
|
545
543
|
css: styles.container,
|
|
546
544
|
ref: containerRef,
|
|
547
545
|
style: { ...containerStyle
|
|
548
546
|
}
|
|
549
|
-
}
|
|
547
|
+
}, jsx("ul", {
|
|
550
548
|
className: IDs.mainSelector,
|
|
551
549
|
css: styles.mainSelector,
|
|
552
550
|
ref: mainSelectorRef,
|
|
@@ -1,11 +1,9 @@
|
|
|
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
|
-
import { forwardRef, memo, useEffect, useMemo, useRef } from 'react';
|
|
6
|
+
import { forwardRef, memo, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
7
|
import theme from '../../../theme/settings';
|
|
10
8
|
import generateRandom from '../../../utils/randomString';
|
|
11
9
|
import Typography from '../../typography';
|
|
@@ -28,6 +26,8 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
28
26
|
inputRef = useRef(null);
|
|
29
27
|
}
|
|
30
28
|
|
|
29
|
+
const [checkedState, setCheckedState] = useState(checked || defaultChecked);
|
|
30
|
+
|
|
31
31
|
if (size === 'small') {
|
|
32
32
|
height = 10;
|
|
33
33
|
width = 20;
|
|
@@ -146,13 +146,10 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
const handleClick = () => {
|
|
149
|
-
if (disabled)
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
inputRef.current.checked = !inputRef.current.checked;
|
|
149
|
+
if (disabled) return;
|
|
150
|
+
setChecked(checked !== undefined ? checked : !checkedState);
|
|
154
151
|
const e = {
|
|
155
|
-
value:
|
|
152
|
+
value: !checkedState,
|
|
156
153
|
target: inputRef.current
|
|
157
154
|
};
|
|
158
155
|
if (onChange) onChange(e);
|
|
@@ -171,22 +168,29 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
171
168
|
}
|
|
172
169
|
};
|
|
173
170
|
}, [disabled, onChange]);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
|
|
172
|
+
const setChecked = check => {
|
|
173
|
+
if (typeof check === 'boolean') {
|
|
174
|
+
setCheckedState(check);
|
|
177
175
|
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (checked !== undefined) setChecked(checked);
|
|
178
180
|
}, [checked]);
|
|
179
|
-
return useMemo(() => jsx("div",
|
|
181
|
+
return useMemo(() => jsx("div", {
|
|
180
182
|
id: 'DGN-Core-Toggle-' + (id ? id : idDefault),
|
|
181
183
|
css: formCheck,
|
|
182
|
-
ref: ref
|
|
183
|
-
|
|
184
|
+
ref: ref,
|
|
185
|
+
...props
|
|
186
|
+
}, jsx("input", { ...inputProps,
|
|
184
187
|
ref: inputRef,
|
|
185
188
|
hidden: true,
|
|
186
189
|
type: "checkbox",
|
|
187
190
|
css: checkbox,
|
|
188
|
-
|
|
189
|
-
|
|
191
|
+
checked: checkedState,
|
|
192
|
+
onChange: handleClick
|
|
193
|
+
}), jsx("label", {
|
|
190
194
|
css: toggle,
|
|
191
195
|
onClick: handleClick
|
|
192
196
|
}, jsx("span", {
|
|
@@ -197,7 +201,7 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
197
201
|
marginBottom: 0
|
|
198
202
|
},
|
|
199
203
|
mapping: 'label'
|
|
200
|
-
}, label))), [disabled, onChange]);
|
|
204
|
+
}, label))), [disabled, onChange, checkedState]);
|
|
201
205
|
}));
|
|
202
206
|
Toggle.defaultProps = {
|
|
203
207
|
disabled: false,
|
|
@@ -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
|
import React, { memo } from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
3
|
import { Typography } from '../';
|
|
@@ -13,12 +11,13 @@ const HelperText = /*#__PURE__*/memo(({
|
|
|
13
11
|
marginTop: 5,
|
|
14
12
|
marginBottom: 5
|
|
15
13
|
};
|
|
16
|
-
return /*#__PURE__*/React.createElement(Typography,
|
|
14
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
17
15
|
type: 'p3',
|
|
18
16
|
style: { ...helperText,
|
|
19
17
|
...style
|
|
20
|
-
}
|
|
21
|
-
|
|
18
|
+
},
|
|
19
|
+
...props
|
|
20
|
+
}, text);
|
|
22
21
|
});
|
|
23
22
|
HelperText.defaultProps = {
|
|
24
23
|
text: ''
|
|
@@ -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 */
|
|
@@ -51,9 +49,10 @@ const FormLabel = ({
|
|
|
51
49
|
utc: utc,
|
|
52
50
|
thousandSeparator: thousandSeparator,
|
|
53
51
|
thousandChar: thousandChar
|
|
54
|
-
}), jsx(HelperText,
|
|
55
|
-
text: text
|
|
56
|
-
|
|
52
|
+
}), jsx(HelperText, {
|
|
53
|
+
text: text,
|
|
54
|
+
...helperTextProps
|
|
55
|
+
}));
|
|
57
56
|
};
|
|
58
57
|
|
|
59
58
|
FormLabel.defaultProps = {
|
|
@@ -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 */
|
|
@@ -7,7 +5,7 @@ import { jsx, css } from '@emotion/core';
|
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { forwardRef, useRef, memo, useEffect, useMemo } from 'react';
|
|
9
7
|
import { dark4 } from '../../styles/colors';
|
|
10
|
-
import {
|
|
8
|
+
import { typography } from '../../styles/typography';
|
|
11
9
|
import { formatDate } from '../../utils';
|
|
12
10
|
const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
13
11
|
inputProps,
|
|
@@ -29,7 +27,7 @@ const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
29
27
|
flex: 1 1 auto;
|
|
30
28
|
align-items: center;
|
|
31
29
|
position: relative;
|
|
32
|
-
|
|
30
|
+
${typography.paragraph1};
|
|
33
31
|
padding-bottom: 6px;
|
|
34
32
|
padding-top: 6px;
|
|
35
33
|
&::before {
|
|
@@ -56,7 +54,7 @@ const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
56
54
|
flex: 1 1 auto;
|
|
57
55
|
align-items: center;
|
|
58
56
|
position: relative;
|
|
59
|
-
|
|
57
|
+
${typography.paragraph1};
|
|
60
58
|
border: 1px solid ${dark4};
|
|
61
59
|
border-radius: 4px;
|
|
62
60
|
height: 40px;
|
|
@@ -107,11 +105,11 @@ const InputView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
107
105
|
inputRef.current.innerHTML = dateWithFormat(value);
|
|
108
106
|
}
|
|
109
107
|
}, [value]);
|
|
110
|
-
return useMemo(() => jsx("span",
|
|
108
|
+
return useMemo(() => jsx("span", { ...inputProps,
|
|
111
109
|
style: inputStyleProps,
|
|
112
110
|
css: TextInput,
|
|
113
111
|
ref: inputRef
|
|
114
|
-
}
|
|
112
|
+
}, value));
|
|
115
113
|
}));
|
|
116
114
|
InputView.defaultProps = {
|
|
117
115
|
label: ''
|
|
@@ -5,7 +5,7 @@ import { jsx, css } from '@emotion/core';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
import { dark8 } from '../../styles/colors';
|
|
8
|
-
import {
|
|
8
|
+
import { typography } from '../../styles/typography';
|
|
9
9
|
const Label = /*#__PURE__*/memo(({
|
|
10
10
|
label,
|
|
11
11
|
labelProps
|
|
@@ -13,11 +13,7 @@ const Label = /*#__PURE__*/memo(({
|
|
|
13
13
|
const labelText = css`
|
|
14
14
|
display: block;
|
|
15
15
|
color: ${dark8};
|
|
16
|
-
|
|
17
|
-
font-style: normal;
|
|
18
|
-
font-weight: 500;
|
|
19
|
-
font-size: 12px;
|
|
20
|
-
line-height: 16px;
|
|
16
|
+
${typography.paragraph3};
|
|
21
17
|
margin-bottom: 5px;
|
|
22
18
|
`;
|
|
23
19
|
return jsx("label", {
|
|
@@ -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 */
|
|
@@ -7,7 +5,7 @@ import { memo, useRef, forwardRef, useEffect, useMemo } from 'react';
|
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { jsx, css } from '@emotion/core';
|
|
9
7
|
import theme from '../../theme/settings';
|
|
10
|
-
import
|
|
8
|
+
import { ButtonIcon } from '..';
|
|
11
9
|
const ListItemAction = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
12
10
|
children,
|
|
13
11
|
name,
|
|
@@ -41,19 +39,20 @@ const ListItemAction = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
41
39
|
let node = children;
|
|
42
40
|
|
|
43
41
|
if (!node) {
|
|
44
|
-
node = jsx(
|
|
42
|
+
node = jsx(ButtonIcon, {
|
|
43
|
+
viewType: 'ghost',
|
|
45
44
|
name: name,
|
|
46
|
-
viewBox: true,
|
|
47
45
|
onClick: onClick
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
return jsx("div",
|
|
49
|
+
return jsx("div", {
|
|
52
50
|
className: 'DGN-UI-List-Item-Action ' + className,
|
|
53
51
|
css: ListItemActionRoot,
|
|
54
52
|
ref: ref,
|
|
55
|
-
style: style
|
|
56
|
-
|
|
53
|
+
style: style,
|
|
54
|
+
...props
|
|
55
|
+
}, node);
|
|
57
56
|
}, [children, name, style]);
|
|
58
57
|
return ListItemActionView;
|
|
59
58
|
}));
|
|
@@ -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 */
|
|
@@ -45,12 +43,13 @@ const ListItemIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
return jsx("div",
|
|
46
|
+
return jsx("div", {
|
|
49
47
|
css: ListItemIconRoot,
|
|
50
48
|
className: 'DGN-UI-List-Item-Icon ' + className,
|
|
51
49
|
ref: ref,
|
|
52
|
-
style: style
|
|
53
|
-
|
|
50
|
+
style: style,
|
|
51
|
+
...props
|
|
52
|
+
}, node);
|
|
54
53
|
}, [children, name]);
|
|
55
54
|
return ListItemIconView;
|
|
56
55
|
}));
|
|
@@ -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 */
|
|
@@ -30,12 +28,13 @@ const ListItemText = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
30
28
|
useEffect(() => {
|
|
31
29
|
if (refs) refs(ref);
|
|
32
30
|
}, []);
|
|
33
|
-
const ListItemTextView = useMemo(() => jsx("div",
|
|
31
|
+
const ListItemTextView = useMemo(() => jsx("div", {
|
|
34
32
|
css: ListItemTextRoot,
|
|
35
33
|
className: 'DGN-UI-List-Item-Text ' + className,
|
|
36
34
|
ref: ref,
|
|
37
|
-
style: style
|
|
38
|
-
|
|
35
|
+
style: style,
|
|
36
|
+
...props
|
|
37
|
+
}, jsx(Typography, null, children)), [children]);
|
|
39
38
|
return ListItemTextView;
|
|
40
39
|
}));
|
|
41
40
|
ListItemText.defaultProps = {
|
|
@@ -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 */
|
|
@@ -78,13 +76,14 @@ const ListItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
78
76
|
}
|
|
79
77
|
};
|
|
80
78
|
}, [inset]);
|
|
81
|
-
const ListItemView = useMemo(() => jsx("div",
|
|
79
|
+
const ListItemView = useMemo(() => jsx("div", {
|
|
82
80
|
css: ListItemRoot,
|
|
83
81
|
className: 'DGN-UI-List-Item ' + (onClick ? 'click-able ' : '') + className,
|
|
84
82
|
ref: ref,
|
|
85
83
|
onClick: onClick ? handleClick : null,
|
|
86
|
-
style: style
|
|
87
|
-
|
|
84
|
+
style: style,
|
|
85
|
+
...props
|
|
86
|
+
}, children, button && jsx(Ripple, {
|
|
88
87
|
color: '#8F9BB3'
|
|
89
88
|
})), [children, button, style]);
|
|
90
89
|
return ListItemView;
|
package/components/list/list.js
CHANGED
|
@@ -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 */
|
|
@@ -110,11 +108,12 @@ const List = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
110
108
|
}
|
|
111
109
|
};
|
|
112
110
|
}, [style]);
|
|
113
|
-
const ListView = useMemo(() => jsx("div",
|
|
111
|
+
const ListView = useMemo(() => jsx("div", {
|
|
114
112
|
css: ListRoot,
|
|
115
113
|
ref: ref,
|
|
116
|
-
className: ('DGN-UI-List ' + className).trim()
|
|
117
|
-
|
|
114
|
+
className: ('DGN-UI-List ' + className).trim(),
|
|
115
|
+
...props
|
|
116
|
+
}, children), [children]);
|
|
118
117
|
return ListView;
|
|
119
118
|
}));
|
|
120
119
|
List.defaultProps = {
|
|
@@ -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 */
|
|
@@ -34,11 +32,12 @@ const ListSubHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
34
32
|
useEffect(() => {
|
|
35
33
|
if (refs) refs(ref);
|
|
36
34
|
}, []);
|
|
37
|
-
const ListSubHeaderRootView = useMemo(() => jsx("div",
|
|
35
|
+
const ListSubHeaderRootView = useMemo(() => jsx("div", {
|
|
38
36
|
css: ListSubHeaderRoot,
|
|
39
37
|
ref: ref,
|
|
40
|
-
style: style
|
|
41
|
-
|
|
38
|
+
style: style,
|
|
39
|
+
...props
|
|
40
|
+
}, jsx(Typography, {
|
|
42
41
|
type: 'h4',
|
|
43
42
|
color: theme.colors.disabled,
|
|
44
43
|
style: {
|