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 */
|
|
@@ -10,6 +8,7 @@ import { getGlobal } from '../../../global';
|
|
|
10
8
|
import locale from '../../../locale';
|
|
11
9
|
import theme from '../../../theme/settings';
|
|
12
10
|
import { date as moment } from '../../../utils';
|
|
11
|
+
import { typography } from "../../../styles/typography";
|
|
13
12
|
/**
|
|
14
13
|
* START STYLE
|
|
15
14
|
*/
|
|
@@ -117,14 +116,14 @@ const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) =>
|
|
|
117
116
|
&.${unique.day.active} {
|
|
118
117
|
span.${unique.day.day} {
|
|
119
118
|
background-color: ${theme.colors.focus};
|
|
120
|
-
|
|
119
|
+
${typography.heading5};
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
&.${unique.day.today} {
|
|
124
123
|
span {
|
|
125
124
|
border : ${theme.border.style} 1px ${theme.colors.primary};
|
|
126
125
|
box-sizing : border-box;
|
|
127
|
-
|
|
126
|
+
${typography.heading5}
|
|
128
127
|
/* text-decoration-line : underline;
|
|
129
128
|
text-decoration-thickness: 2px;
|
|
130
129
|
text-underline-offset : 1px */
|
|
@@ -293,12 +292,7 @@ const buttonTextProps = fn => {
|
|
|
293
292
|
|
|
294
293
|
|
|
295
294
|
const isValidDate = value => {
|
|
296
|
-
|
|
297
|
-
return true;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
;
|
|
301
|
-
return false;
|
|
295
|
+
return new Date(value) instanceof Date && !isNaN(new Date(value));
|
|
302
296
|
};
|
|
303
297
|
/**
|
|
304
298
|
*
|
|
@@ -431,7 +425,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
431
425
|
/*(displayAnotherMonth ? 0 : 1)*/
|
|
432
426
|
,
|
|
433
427
|
className: `${[className.table.data, 'previous_month', isToday(day, today, className.day.today), isActive(day, active, className.day.active), isBetween(day, active[0], active[1], className.day)].join(' ')}`
|
|
434
|
-
}, jsx(Typography, typographyProps(className.day.day)
|
|
428
|
+
}, jsx(Typography, { ...typographyProps(className.day.day)
|
|
429
|
+
}, '')));
|
|
435
430
|
}
|
|
436
431
|
/**
|
|
437
432
|
* days of this month
|
|
@@ -445,7 +440,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
445
440
|
"data-time": Date.parse(day),
|
|
446
441
|
className: `${[className.table.data, 'this_month', isToday(day, today, className.day.today), isActive(day, active, className.day.active), isLimit(day, max, min, className.day.limit), isBetween(day, active[0], active[1], className.day)].join(' ')}`,
|
|
447
442
|
onClick: onTableDataClick
|
|
448
|
-
}, jsx(Typography, typographyProps(className.day.day)
|
|
443
|
+
}, jsx(Typography, { ...typographyProps(className.day.day)
|
|
444
|
+
}, i + 1)));
|
|
449
445
|
}
|
|
450
446
|
/**
|
|
451
447
|
* days of next month
|
|
@@ -461,7 +457,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
461
457
|
/*(displayAnotherMonth ? 0 : 1)*/
|
|
462
458
|
,
|
|
463
459
|
className: `${[className.table.data, 'next_month', isToday(day, today, className.day.today), isActive(day, active, className.day.active), isBetween(day, active[0], active[1], className.day)].join(' ')}`
|
|
464
|
-
}, jsx(Typography, typographyProps(className.day.day)
|
|
460
|
+
}, jsx(Typography, { ...typographyProps(className.day.day)
|
|
461
|
+
}, '')));
|
|
465
462
|
}
|
|
466
463
|
} else {
|
|
467
464
|
/**
|
|
@@ -473,7 +470,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
473
470
|
key: `previous_month-${prevDate - i + 1}`,
|
|
474
471
|
"data-time": Date.parse(day) - (displayAnotherMonth ? 0 : 1),
|
|
475
472
|
className: `${[className.table.data, 'previous_month', isToday(day, today, className.day.today), isActive(day, active, className.day.active)].join(' ')}`
|
|
476
|
-
}, jsx(Typography, typographyProps(className.day.day)
|
|
473
|
+
}, jsx(Typography, { ...typographyProps(className.day.day)
|
|
474
|
+
}, displayAnotherMonth ? prevDate - i + 1 : '')));
|
|
477
475
|
}
|
|
478
476
|
/**
|
|
479
477
|
* days of this month
|
|
@@ -487,7 +485,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
487
485
|
"data-time": Date.parse(day),
|
|
488
486
|
className: `${[className.table.data, 'this_month', isToday(day, today, className.day.today), isActive(day, active, className.day.active), isLimit(day, max, min, className.day.limit)].join(' ')}`,
|
|
489
487
|
onClick: onTableDataClick
|
|
490
|
-
}, jsx(Typography, typographyProps(className.day.day)
|
|
488
|
+
}, jsx(Typography, { ...typographyProps(className.day.day)
|
|
489
|
+
}, i + 1)));
|
|
491
490
|
}
|
|
492
491
|
/**
|
|
493
492
|
* days of next month
|
|
@@ -500,7 +499,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
500
499
|
key: `next_month-${i + 1}`,
|
|
501
500
|
"data-time": Date.parse(day) + (displayAnotherMonth ? 0 : 1),
|
|
502
501
|
className: `${[className.table.data, 'next_month', isToday(day, today, className.day.today), isActive(day, active, className.day.active)].join(' ')}`
|
|
503
|
-
}, jsx(Typography, typographyProps(className.day.day)
|
|
502
|
+
}, jsx(Typography, { ...typographyProps(className.day.day)
|
|
503
|
+
}, displayAnotherMonth ? i + 1 : '')));
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
|
|
@@ -560,31 +560,32 @@ const renderNavigator = (className, refs, dbLeftFn, leftFn, rightFn, dbRightFn,
|
|
|
560
560
|
className: className.navigator.navigator
|
|
561
561
|
}, jsx("div", {
|
|
562
562
|
className: className.navigator.around
|
|
563
|
-
}, jsx(ButtonIcon,
|
|
563
|
+
}, jsx(ButtonIcon, { ...buttonIconProps(className.icon),
|
|
564
564
|
name: 'ArrowDoubleLeft',
|
|
565
565
|
onClick: dbLeftFn,
|
|
566
566
|
ref: refs.doubleLeft
|
|
567
|
-
})
|
|
567
|
+
}), jsx(ButtonIcon, { ...buttonIconProps(className.icon),
|
|
568
568
|
name: 'ArrowLeft',
|
|
569
569
|
onClick: leftFn,
|
|
570
570
|
ref: refs.left
|
|
571
|
-
}))
|
|
571
|
+
})), jsx("div", {
|
|
572
572
|
className: className.navigator.center
|
|
573
|
-
}, jsx(Button, buttonTextProps(fn)
|
|
573
|
+
}, jsx(Button, { ...buttonTextProps(fn)
|
|
574
|
+
}, jsx(Typography, {
|
|
574
575
|
color: 'primary',
|
|
575
576
|
type: 'h3',
|
|
576
577
|
ref: refs.content
|
|
577
578
|
}))), jsx("div", {
|
|
578
579
|
className: className.navigator.around
|
|
579
|
-
}, jsx(ButtonIcon,
|
|
580
|
+
}, jsx(ButtonIcon, { ...buttonIconProps(className.icon),
|
|
580
581
|
name: 'ArrowRight',
|
|
581
582
|
onClick: rightFn,
|
|
582
583
|
ref: refs.right
|
|
583
|
-
})
|
|
584
|
+
}), jsx(ButtonIcon, { ...buttonIconProps(className.icon),
|
|
584
585
|
name: 'ArrowDoubleRight',
|
|
585
586
|
onClick: dbRightFn,
|
|
586
587
|
ref: refs.doubleRight
|
|
587
|
-
})))
|
|
588
|
+
})));
|
|
588
589
|
/**
|
|
589
590
|
*
|
|
590
591
|
* @param {Date} time
|
|
@@ -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 */
|
|
@@ -209,11 +207,11 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
209
207
|
* END COMPONENT
|
|
210
208
|
*/
|
|
211
209
|
|
|
212
|
-
return jsx("div",
|
|
210
|
+
return jsx("div", { ...props,
|
|
213
211
|
className: [unique.container, className].join(' '),
|
|
214
212
|
css: generateCalendarCSS(unique),
|
|
215
213
|
ref: ref
|
|
216
|
-
}
|
|
214
|
+
}, renderNavigator(unique, navigatorRefs, setPrevYear, setPrevMonth, setNextMonth, setNextYear), tableMemo, actions);
|
|
217
215
|
}));
|
|
218
216
|
Calendar.defaultProps = {
|
|
219
217
|
actions: null,
|
|
@@ -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 */
|
|
@@ -256,12 +254,13 @@ const CalendarRange = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
256
254
|
onUpdate(defaultValue);
|
|
257
255
|
}
|
|
258
256
|
}, []);
|
|
259
|
-
return jsx("div",
|
|
257
|
+
return jsx("div", { ...props,
|
|
260
258
|
className: unique.container,
|
|
261
259
|
onMouseOver: onPickerHover,
|
|
262
260
|
css: containerCSS,
|
|
263
261
|
ref: ref
|
|
264
|
-
}
|
|
262
|
+
}, calendarFrom, jsx(Divider, { ...dividerProps
|
|
263
|
+
}), calendarTo, actions);
|
|
265
264
|
}));
|
|
266
265
|
CalendarRange.defaultProps = {
|
|
267
266
|
actions: null,
|
|
@@ -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,15 +5,20 @@ import { css, jsx } from '@emotion/core';
|
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { forwardRef, memo, useEffect, useRef, useState, useImperativeHandle } from 'react';
|
|
9
7
|
import { Typography } from '../..';
|
|
10
|
-
import
|
|
8
|
+
import { alignCenter, alignStart, borderBox, cursorPointer, displayBlock, flexRow, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from '../../../styles/general';
|
|
11
9
|
import { randomString } from '../../../utils';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
10
|
+
import { color as colors } from '../../../styles/colors';
|
|
11
|
+
const {
|
|
12
|
+
system: {
|
|
13
|
+
disabled: systemDisabled,
|
|
14
|
+
rest,
|
|
15
|
+
white
|
|
16
|
+
},
|
|
17
|
+
fill: {
|
|
18
|
+
hover,
|
|
19
|
+
focusshd
|
|
20
|
+
}
|
|
21
|
+
} = colors;
|
|
19
22
|
const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
20
23
|
id,
|
|
21
24
|
className,
|
|
@@ -39,6 +42,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
const ref = useRef(null);
|
|
45
|
+
const [checkedState, setCheckedState] = useState(checked || defaultChecked);
|
|
42
46
|
|
|
43
47
|
if (!id) {
|
|
44
48
|
[id] = useState('DGN-UI-' + randomString(10, {
|
|
@@ -55,8 +59,8 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
55
59
|
&::after {
|
|
56
60
|
transform: translate(-50%, -66%) scale(1) rotate(-45deg);
|
|
57
61
|
background:
|
|
58
|
-
linear-gradient(${
|
|
59
|
-
linear-gradient(${
|
|
62
|
+
linear-gradient(${white}, ${white}) left bottom/2px 100%,
|
|
63
|
+
linear-gradient(${white}, ${white}) left bottom/100% 2px;
|
|
60
64
|
background-repeat: no-repeat;
|
|
61
65
|
}
|
|
62
66
|
}
|
|
@@ -68,21 +72,23 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
68
72
|
}
|
|
69
73
|
`;
|
|
70
74
|
const CheckBoxSquare = css`
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
${flexRow}
|
|
76
|
+
${positionRelative}
|
|
77
|
+
${borderBox}
|
|
73
78
|
width: 18px;
|
|
79
|
+
min-width: 18px;
|
|
74
80
|
height: 18px;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
min-height: 18px;
|
|
82
|
+
background-color: ${white};
|
|
83
|
+
border: 2px solid ${rest};
|
|
78
84
|
border-radius: 2px;
|
|
79
85
|
&.determinate {
|
|
80
86
|
&::after {
|
|
87
|
+
${displayBlock}
|
|
88
|
+
${positionAbsolute}
|
|
81
89
|
content : '';
|
|
82
|
-
display : block;
|
|
83
90
|
height : 7px;
|
|
84
91
|
left : 50%;
|
|
85
|
-
position : absolute;
|
|
86
92
|
top : 43%;
|
|
87
93
|
transform : translate(-50%, -50%) scale(0) rotate(45deg);
|
|
88
94
|
transition: transform 0.3s;
|
|
@@ -91,9 +97,9 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
91
97
|
}
|
|
92
98
|
&.indeterminate {
|
|
93
99
|
&::after {
|
|
100
|
+
${flexRow}
|
|
101
|
+
${positionAbsolute}
|
|
94
102
|
content: "";
|
|
95
|
-
display: flex;
|
|
96
|
-
position: absolute;
|
|
97
103
|
background-color: white;
|
|
98
104
|
left: 2px;
|
|
99
105
|
top: 6px;
|
|
@@ -105,55 +111,55 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
105
111
|
}
|
|
106
112
|
&:hover {
|
|
107
113
|
box-shadow:
|
|
108
|
-
0 0 2px 2px ${
|
|
109
|
-
background-color:${
|
|
114
|
+
0 0 2px 2px ${focusshd};
|
|
115
|
+
background-color:${focusshd};
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
`;
|
|
113
119
|
const CheckBoxLabel = css`
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
${flexRow}
|
|
121
|
+
${positionRelative}
|
|
122
|
+
${alignCenter}
|
|
123
|
+
${borderBox}
|
|
117
124
|
padding-left: 8px;
|
|
118
|
-
box-sizing: border-box;
|
|
119
125
|
`;
|
|
120
126
|
const CheckBoxRoot = css`
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
${flexRow}
|
|
128
|
+
${positionRelative}
|
|
129
|
+
${alignStart}
|
|
130
|
+
${cursorPointer}
|
|
131
|
+
${userSelectNone}
|
|
132
|
+
${borderBox}
|
|
124
133
|
margin: 3px 0;
|
|
125
|
-
cursor: pointer;
|
|
126
|
-
user-select: none;
|
|
127
|
-
box-sizing: border-box;
|
|
128
134
|
&.disabled {
|
|
129
|
-
|
|
135
|
+
${pointerEventsNone}
|
|
130
136
|
.css-${CheckBoxSquare.name} {
|
|
131
|
-
border-color:${
|
|
137
|
+
border-color:${systemDisabled};
|
|
132
138
|
}
|
|
133
139
|
.css-${CheckBoxInput.name} {
|
|
134
140
|
&:checked {
|
|
135
141
|
&.determinate + span::after {
|
|
136
142
|
background:
|
|
137
|
-
linear-gradient(${
|
|
138
|
-
linear-gradient(${
|
|
143
|
+
linear-gradient(${white},${white}) left bottom/2px 100%,
|
|
144
|
+
linear-gradient(${white},${white}) left bottom/ 100% 2px;
|
|
139
145
|
background-repeat: no-repeat;
|
|
140
146
|
}
|
|
141
147
|
&.indeterminate + span::after {
|
|
142
|
-
background-color: ${
|
|
148
|
+
background-color: ${white};
|
|
143
149
|
}
|
|
144
150
|
& + span {
|
|
145
|
-
background-color:${
|
|
151
|
+
background-color:${systemDisabled};
|
|
146
152
|
}
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
}
|
|
150
156
|
&.read-only {
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
${pointerEventsNone}
|
|
158
|
+
${userSelectNone}
|
|
153
159
|
}
|
|
154
160
|
&:not(.disabled):hover {
|
|
155
161
|
.css-${CheckBoxSquare.name} {
|
|
156
|
-
background-color:${
|
|
162
|
+
background-color:${hover};
|
|
157
163
|
border-color:${colors[color] || color};
|
|
158
164
|
}
|
|
159
165
|
.css-${CheckBoxInput.name} {
|
|
@@ -172,8 +178,8 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
172
178
|
}
|
|
173
179
|
`;
|
|
174
180
|
const CheckboxContainer = css`
|
|
175
|
-
|
|
176
|
-
|
|
181
|
+
${displayBlock}
|
|
182
|
+
${positionRelative}
|
|
177
183
|
width: max-content;
|
|
178
184
|
&.disabled {
|
|
179
185
|
cursor: no-drop;
|
|
@@ -182,10 +188,9 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
182
188
|
|
|
183
189
|
const handleChange = () => {
|
|
184
190
|
if (readOnly || inputProps.readOnly || disabled || inputProps.disabled) return;
|
|
185
|
-
|
|
186
|
-
inputRef.current.checked = checked;
|
|
191
|
+
setChecked(checked !== undefined ? checked : !checkedState);
|
|
187
192
|
const e = {
|
|
188
|
-
value:
|
|
193
|
+
value: !checkedState,
|
|
189
194
|
target: inputRef.current
|
|
190
195
|
};
|
|
191
196
|
if (onChange) onChange(e, checked);
|
|
@@ -193,35 +198,45 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
193
198
|
|
|
194
199
|
const setChecked = check => {
|
|
195
200
|
if (typeof check === 'boolean') {
|
|
196
|
-
|
|
201
|
+
setCheckedState(check);
|
|
197
202
|
}
|
|
198
203
|
};
|
|
199
204
|
|
|
200
205
|
useEffect(() => {
|
|
201
|
-
setChecked(checked);
|
|
206
|
+
if (checked !== undefined) setChecked(checked);
|
|
202
207
|
}, [checked]);
|
|
203
208
|
useImperativeHandle(reference, () => {
|
|
204
|
-
ref.current
|
|
205
|
-
|
|
209
|
+
const currentRef = ref.current || {};
|
|
210
|
+
const _instance = {
|
|
211
|
+
determinate: determinate,
|
|
212
|
+
setChecked: setChecked,
|
|
213
|
+
getChecked: () => inputRef.current.checked
|
|
214
|
+
}; // methods
|
|
215
|
+
|
|
216
|
+
_instance.__proto__ = {}; // hidden methods
|
|
217
|
+
|
|
218
|
+
currentRef.instance = _instance;
|
|
219
|
+
currentRef.determinate = determinate;
|
|
220
|
+
currentRef.setChecked = setChecked;
|
|
206
221
|
|
|
207
|
-
|
|
222
|
+
currentRef.getChecked = () => inputRef.current.checked;
|
|
208
223
|
|
|
209
|
-
return
|
|
224
|
+
return currentRef;
|
|
210
225
|
});
|
|
211
|
-
return jsx("div",
|
|
226
|
+
return jsx("div", {
|
|
212
227
|
id: 'DGN-UI-Checkbox-' + id.replace('DGN-UI-', ''),
|
|
213
228
|
css: CheckboxContainer,
|
|
214
|
-
className: ['DGN-UI-Checkbox', disabled ? 'disabled' : '', className].join(' ').trim(),
|
|
215
|
-
ref: ref
|
|
216
|
-
|
|
229
|
+
className: ['DGN-UI-Checkbox', disabled ? 'disabled' : '', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
230
|
+
ref: ref,
|
|
231
|
+
...props,
|
|
217
232
|
onClick: handleChange
|
|
218
|
-
}
|
|
233
|
+
}, jsx("div", {
|
|
219
234
|
css: CheckBoxRoot,
|
|
220
235
|
className: disabled ? 'disabled' : readOnly ? 'read-only' : ''
|
|
221
|
-
}, jsx("input",
|
|
222
|
-
value: value
|
|
223
|
-
|
|
224
|
-
className: [determinate ? 'determinate' : 'indeterminate', inputProps.className || ''].join(' ').trim(),
|
|
236
|
+
}, jsx("input", {
|
|
237
|
+
value: value,
|
|
238
|
+
...inputProps,
|
|
239
|
+
className: [determinate ? 'determinate' : 'indeterminate', inputProps.className || ''].join(' ').trim().replace(/\s+/g, ' '),
|
|
225
240
|
readOnly: readOnly || inputProps.readOnly,
|
|
226
241
|
disabled: disabled || inputProps.disabled,
|
|
227
242
|
ref: inputRef,
|
|
@@ -229,9 +244,10 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
229
244
|
id: id,
|
|
230
245
|
name: name,
|
|
231
246
|
type: "checkbox",
|
|
232
|
-
|
|
247
|
+
checked: checkedState,
|
|
248
|
+
onChange: handleChange,
|
|
233
249
|
hidden: true
|
|
234
|
-
})
|
|
250
|
+
}), jsx("span", {
|
|
235
251
|
css: CheckBoxSquare,
|
|
236
252
|
className: determinate ? 'determinate' : 'indeterminate'
|
|
237
253
|
}), (children || label) && jsx("div", {
|
|
@@ -294,13 +310,11 @@ Checkbox.propTypes = {
|
|
|
294
310
|
onChange: PropTypes.func,
|
|
295
311
|
|
|
296
312
|
/**
|
|
297
|
-
*
|
|
298
|
-
|
|
299
|
-
* * setChecked:
|
|
300
|
-
* * getChecked:
|
|
313
|
+
* ref methods
|
|
314
|
+
*
|
|
315
|
+
* * setChecked: Set check for input
|
|
316
|
+
* * getChecked: Get check of input
|
|
301
317
|
*/
|
|
302
|
-
|
|
303
|
-
current: PropTypes.instanceOf(PropTypes.elementType)
|
|
304
|
-
})])
|
|
318
|
+
ref: PropTypes.any
|
|
305
319
|
};
|
|
306
320
|
export default Checkbox;
|
|
@@ -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,8 +5,8 @@ import { css, jsx } from '@emotion/core';
|
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { Children, forwardRef, memo, useEffect, useImperativeHandle, useLayoutEffect, useRef } from 'react';
|
|
9
7
|
import theme from '../../../theme/settings';
|
|
8
|
+
import { typography } from "../../../styles/typography";
|
|
10
9
|
const {
|
|
11
|
-
typography,
|
|
12
10
|
colors
|
|
13
11
|
} = theme;
|
|
14
12
|
const Control = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -26,7 +24,7 @@ const Control = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
26
24
|
error: 'DGN-UI-Control-error'
|
|
27
25
|
};
|
|
28
26
|
const controlRootCSS = css`
|
|
29
|
-
|
|
27
|
+
${typography.paragraph3};
|
|
30
28
|
margin-bottom: 20px;
|
|
31
29
|
position : relative;
|
|
32
30
|
&.${classes.disabled} {
|
|
@@ -61,12 +59,12 @@ const Control = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
61
|
}, [disabled, error]);
|
|
64
|
-
return jsx("div",
|
|
62
|
+
return jsx("div", { ...props,
|
|
65
63
|
className: ['DGN-UI-Control', className].join(' '),
|
|
66
64
|
css: controlRootCSS,
|
|
67
65
|
style: style,
|
|
68
66
|
ref: ref
|
|
69
|
-
}
|
|
67
|
+
}, children);
|
|
70
68
|
}));
|
|
71
69
|
Control.defaultProps = {
|
|
72
70
|
className: '',
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
// import { Calendar as CalendarIcon, Cancel as CancelIcon } from '../../../icons';
|
|
7
7
|
// import { randomString, useOnClickOutside } from '../../../utils';
|
|
8
8
|
// import { blue4, blue13, brand, danger5, danger8, dark, dark4, dark6, dark8, info5, info8, success5, white } from '../../../styles/colors';
|
|
9
|
-
// import { fontFamily } from '../../../styles/typography';
|
|
10
9
|
// // import CalendarNavigator from './calendar-navigator'
|
|
11
10
|
// const getElById = (id) => {
|
|
12
11
|
// return document.getElementById(id);
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
// container: css`
|
|
75
74
|
// * {
|
|
76
75
|
// box-sizing: border-box;
|
|
77
|
-
// font-family: ${fontFamily};
|
|
78
76
|
// }
|
|
79
77
|
// border-radius: 4px;
|
|
80
78
|
// box-sizing: border-box;
|