diginet-core-ui 1.3.39 → 1.3.40-beta.1

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.
@@ -144,8 +144,6 @@ export const SummaryRootCSS = css`
144
144
  ${displayInlineBlock};
145
145
  ${positionRelative};
146
146
  ${cursorPointer};
147
- width: 24px;
148
- height: 24px;
149
147
  transition: transform 200ms linear;
150
148
  .Accordion-Expand-Icon {
151
149
  transform: scale(1);
@@ -10,6 +10,7 @@ import ButtonIcon from '../button/icon';
10
10
  import Icon from '../../icons';
11
11
  import { hexToRGBA } from '../../styles/color-helper';
12
12
  import { typography } from '../../styles/typography';
13
+ import { useTheme } from '../../theme';
13
14
  import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
14
15
  const {
15
16
  heading3,
@@ -25,6 +26,9 @@ const {
25
26
  white
26
27
  }
27
28
  } = colors;
29
+ const {
30
+ zIndex
31
+ } = useTheme();
28
32
  const iconMap = new Map([['info', 'Info'], ['success', 'ApprovalFilled'], ['warning', 'Warning'], ['danger', 'CancelFilled']]);
29
33
  const maxWidthMap = new Map([['tiny', 320], ['small', 400], ['medium', 480]]);
30
34
  const primaryTypoMap = new Map([['tiny', heading5], ['small', heading4], ['medium', heading3]]);
@@ -173,7 +177,7 @@ const AlertContainerCSS = (size, progressing, duration) => css`
173
177
  transition: opacity ${progressing ? duration / 2 + 1 : duration * 1}s ease ${progressing ? duration / 2 : 0}s;
174
178
  margin-bottom: 1rem;
175
179
  pointer-events: auto;
176
- z-index: 9001;
180
+ z-index: ${zIndex(1)}; ;
177
181
  `;
178
182
 
179
183
  const AlertInfoCSS = (mainColor, opacityColor) => css`
@@ -3,10 +3,14 @@ import ReactDOM from 'react-dom';
3
3
  import PropTypes from 'prop-types';
4
4
  import Alert from './';
5
5
  import { randomString } from '../../utils';
6
+ import { useTheme } from '../../theme';
7
+ const {
8
+ zIndex
9
+ } = useTheme();
6
10
  const positions = {
7
11
  general: {
8
12
  position: 'fixed',
9
- zIndex: 9002,
13
+ zIndex: zIndex(2),
10
14
  backgroundColor: 'transparent',
11
15
  pointerEvents: 'none'
12
16
  },
@@ -114,8 +114,7 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
114
114
  className: size
115
115
  }, jsx(Typography, {
116
116
  type: size === 'small' ? 'p2' : 'p1',
117
- color: 'inherit',
118
- lineClamp: 1
117
+ color: 'inherit'
119
118
  }, renderLabel()));
120
119
  }, [label, size, startIcon, endIcon, clearAble]);
121
120
  const endIconView = useMemo(() => {
@@ -36,216 +36,210 @@ const {
36
36
  */
37
37
 
38
38
  /**
39
- *
40
- * @param {Object} unique
41
- * @param {Boolean} boxShadow
42
- * @returns
39
+ *
40
+ * @param {Object} unique
41
+ * @param {Boolean} boxShadow
42
+ * @returns
43
43
  */
44
44
 
45
45
  const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) => css`
46
- ${borderRadius4px}
47
- ${borderBox}
46
+ ${borderRadius4px}
47
+ ${borderBox}
48
48
  ${flexCol}
49
49
  background-color: ${white};
50
- box-shadow: ${boxShadow ? theme.boxShadows.large : 'none'};
51
- max-width: 400px;
52
- min-width: 260px;
53
- width: 100%;
54
- .${unique.navigator.navigator} {
55
- ${flexRow}
56
- ${justifyBetween}
50
+ box-shadow : ${boxShadow ? theme.boxShadows.large : 'none'};
51
+ max-width : 400px;
52
+ min-width : 260px;
53
+ width : 100%;
54
+ .${unique.navigator.navigator} {
55
+ ${flexRow}
56
+ ${justifyBetween}
57
57
  height : 28px;
58
- margin: 0px 14px;
59
- margin-top: 14px;
60
- max-width: 400px;
61
- width: calc(100% - 28px);
62
- .${unique.navigator.around} {
63
- ${flexRow}
64
- ${userSelectNone}
58
+ margin : 0px 14px;
59
+ margin-top : 14px;
60
+ max-width : 400px;
61
+ width : calc(100% - 28px);
62
+ .${unique.navigator.around} {
63
+ ${flexRow}
64
+ ${userSelectNone}
65
65
  height : 28px;
66
- width: 64px;
67
- }
68
- .${unique.navigator.center} {
69
- ${inlineFlex}
70
- ${alignCenter}
66
+ width : 64px;
67
+ }
68
+ .${unique.navigator.center} {
69
+ ${inlineFlex}
70
+ ${alignCenter}
71
71
  ${textCenter}
72
72
  ${userSelectNone}
73
73
  height : 28px;
74
- margin: 0 4px;
75
- min-width: 150px;
76
- width: 100%;
77
- button {
78
- height: 28px;
79
- }
80
- .DGN-UI-Typography {
81
- min-width: 150px;
82
- }
83
- }
84
- }
85
- .${unique.icon} {
86
- height: 28px;
87
- margin: 0 2px;
88
- width: 28px;
89
- svg,
90
- path,
91
- g {
92
- ${pointerEventsNone}
93
- }
94
- }
95
- .${unique.table.container} {
96
- ${flexRow}
97
- margin : 10px 0;
98
- margin-top: 6px;
99
- width: 100%;
100
- }
101
- .${unique.table.table} {
102
- border-collapse: separate;
103
- margin: 0 16px;
104
- padding: 0;
105
- table-layout: fixed;
106
- width: calc(100% - 32px);
107
- .${unique.table.data} {
108
- ${cursorPointer}
109
- ${positionRelative}
74
+ margin : 0 4px;
75
+ min-width : 150px;
76
+ width : 100%;
77
+ button {
78
+ height: 28px;
79
+ }
80
+ .DGN-UI-Typography {
81
+ min-width : 150px;
82
+ }
83
+ }
84
+ }
85
+ .${unique.icon} {
86
+ height: 28px;
87
+ margin: 0 2px;
88
+ width : 28px;
89
+ svg, path, g {
90
+ ${pointerEventsNone}
91
+ }
92
+ }
93
+ .${unique.table.container} {
94
+ ${flexRow}
95
+ margin : 10px 0;
96
+ margin-top: 6px;
97
+ width : 100%;
98
+ }
99
+ .${unique.table.table} {
100
+ border-collapse: separate;
101
+ margin : 0 16px;
102
+ padding : 0;
103
+ table-layout : fixed;
104
+ width : calc(100% - 32px);
105
+ .${unique.table.data} {
106
+ ${cursorPointer}
107
+ ${positionRelative}
110
108
  ${textCenter}
111
109
  ${userSelectNone}
112
110
  color : ${main};
113
- height: 24px;
114
- min-width: 24px;
115
- padding: 1px;
116
- &:nth-of-type(7n - 1) {
117
- color: ${info8} !important;
118
- }
119
- &:nth-of-type(7n) {
120
- color: ${danger8} !important;
121
- }
122
- &.next_month,
123
- &.previous_month,
124
- &.${unique.day.limit} {
125
- opacity: 0.25;
126
- }
127
- &.${unique.day.limit} {
128
- ${pointerEventsNone}
129
- cursor: default;
130
- }
131
- &:hover {
132
- span.${unique.day.day} {
133
- background-color: ${fillHover};
134
- }
135
- }
136
- ${onClickActive ? `&:active {
111
+ height : 24px;
112
+ min-width : 24px;
113
+ padding : 1px;
114
+ &:nth-of-type(7n - 1) {
115
+ color: ${info8} !important;
116
+ }
117
+ &:nth-of-type(7n) {
118
+ color: ${danger8} !important;
119
+ }
120
+ &.next_month, &.previous_month, &.${unique.day.limit} {
121
+ opacity : 0.25;
122
+ }
123
+ &.${unique.day.limit} {
124
+ ${pointerEventsNone}
125
+ cursor: default;
126
+ }
127
+ &:hover {
128
+ span.${unique.day.day} {
129
+ background-color: ${fillHover};
130
+ }
131
+ }
132
+ ${onClickActive ? `&:active {
137
133
  span.${unique.day.day} {
138
134
  background-color: ${fillPressed};
139
135
  }
140
136
  }` : ''}
141
- &.${unique.day.active} {
142
- span.${unique.day.day} {
143
- ${heading6};
144
- background-color: ${fillFocus};
145
- }
146
- }
147
- &.${unique.day.today} {
148
- span {
149
- ${heading6}
150
- ${borderBox}
137
+ &.${unique.day.active} {
138
+ span.${unique.day.day} {
139
+ ${heading6};
140
+ background-color: ${fillFocus};
141
+ }
142
+ }
143
+ &.${unique.day.today} {
144
+ span {
145
+ ${heading6}
146
+ ${borderBox}
151
147
  ${border(1, active)}
152
148
  /* text-decoration-line : underline;
153
149
  text-decoration-thickness: 2px;
154
150
  text-underline-offset : 1px */
155
- }
156
- }
157
- &.${unique.day.between} {
158
- opacity: 1;
159
- &::before {
160
- background-color: ${fillHover};
161
- }
162
- }
163
- &.${unique.day.from} {
164
- opacity: 1;
165
- &::before {
166
- background-color: ${fillHover};
167
- border-bottom-left-radius: 12px;
168
- border-top-left-radius: 12px;
169
- left: calc((100% - 24px) / 2);
170
- }
171
- }
172
- &.${unique.day.to} {
173
- opacity: 1;
174
- &::before {
175
- background-color: ${fillHover};
176
- border-bottom-right-radius: 12px;
177
- border-top-right-radius: 12px;
178
- right: calc((100% - 24px) / 2);
179
- }
180
- }
181
- ::before {
182
- ${positionAbsolute}
183
- inset: 1px -2px;
184
- content: '';
185
- }
186
- }
187
- .${unique.table.header} {
188
- ${userSelectNone}
189
- ${textCenter}
151
+ }
152
+ }
153
+ &.${unique.day.between} {
154
+ opacity: 1;
155
+ &::before{
156
+ background-color: ${fillHover};
157
+ }
158
+ }
159
+ &.${unique.day.from} {
160
+ opacity: 1;
161
+ &::before{
162
+ background-color : ${fillHover};
163
+ border-bottom-left-radius: 12px;
164
+ border-top-left-radius : 12px;
165
+ left : calc((100% - 24px)/2);
166
+ }
167
+ }
168
+ &.${unique.day.to} {
169
+ opacity: 1;
170
+ &::before{
171
+ background-color : ${fillHover};
172
+ border-bottom-right-radius: 12px;
173
+ border-top-right-radius : 12px;
174
+ right : calc((100% - 24px)/2);
175
+ }
176
+ }
177
+ ::before {
178
+ ${positionAbsolute}
179
+ inset: 1px -2px;
180
+ content: '';
181
+ }
182
+ }
183
+ .${unique.table.header} {
184
+ ${userSelectNone}
185
+ ${textCenter}
190
186
  color : ${normal_label};
191
- height: 24px;
192
- min-width: 24px;
193
- padding: 0;
194
- padding-bottom: 6px;
195
- &:nth-of-type(6) {
196
- color: ${info8} !important;
197
- }
198
- &:nth-of-type(7) {
199
- color: ${danger8} !important;
200
- }
201
- }
202
- }
203
- @media only screen and (max-width: 599px) {
204
- .${unique.navigator.navigator} {
205
- height: 24px;
206
- margin-top: 14px;
207
- .${unique.navigator.center} {
208
- height: 24px;
209
- margin: 0;
210
- min-width: 130px;
211
- button {
212
- height: 24px;
213
- }
214
- .DGN-UI-Typography {
215
- font-size: 18px;
216
- min-width: 130px;
217
- }
218
- }
219
- .${unique.navigator.around} {
220
- height: 24px;
221
- width: 56px;
222
- }
223
- .${unique.icon} {
224
- height: 24px;
225
- margin: 0 2px;
226
- width: 24px;
227
- svg,
228
- path,
229
- g {
230
- ${pointerEventsNone}
231
- }
232
- }
233
- }
234
- .${unique.table.container} {
235
- margin: 6px 0;
236
- }
237
- .${unique.table.table} {
238
- margin: 0 10px;
239
- width: calc(100% - 20px);
240
- .DGN-UI-Typography {
241
- font-size: 14px;
242
- }
243
- }
244
- }
187
+ height : 24px;
188
+ min-width : 24px;
189
+ padding : 0;
190
+ padding-bottom: 6px;
191
+ &:nth-of-type(6) {
192
+ color: ${info8} !important;
193
+ }
194
+ &:nth-of-type(7) {
195
+ color: ${danger8} !important;
196
+ }
197
+ }
198
+ }
199
+ @media only screen and (max-width: 599px) {
200
+ .${unique.navigator.navigator} {
201
+ height : 24px;
202
+ margin-top: 14px;
203
+ .${unique.navigator.center} {
204
+ height : 24px;
205
+ margin : 0;
206
+ min-width: 130px;
207
+ button {
208
+ height: 24px;
209
+ }
210
+ .DGN-UI-Typography {
211
+ font-size: 18px;
212
+ min-width: 130px;
213
+ }
214
+ }
215
+ .${unique.navigator.around} {
216
+ height: 24px;
217
+ width : 56px;
218
+ }
219
+ .${unique.icon} {
220
+ height: 24px;
221
+ margin: 0 2px;
222
+ width : 24px;
223
+ svg, path, g {
224
+ ${pointerEventsNone}
225
+ }
226
+ }
227
+ }
228
+ .${unique.table.container} {
229
+ margin: 6px 0;
230
+ }
231
+ .${unique.table.table} {
232
+ margin: 0 10px;
233
+ width : calc(100% - 20px);
234
+ .DGN-UI-Typography {
235
+ font-size: 14px;
236
+ }
237
+ }
238
+ }
245
239
  `;
246
240
  /**
247
- * END STYLE
248
- */
241
+ * END STYLE
242
+ */
249
243
 
250
244
  /**
251
245
  *
@@ -273,9 +267,9 @@ const typographyProps = className => {
273
267
  };
274
268
  };
275
269
  /**
276
- *
270
+ *
277
271
  * @description return props of the button icon.
278
- * @param {String} className
272
+ * @param {String} className
279
273
  * @returns {Object} props of the button icon
280
274
  */
281
275
 
@@ -291,9 +285,9 @@ const buttonIconProps = className => {
291
285
  };
292
286
  };
293
287
  /**
294
- *
288
+ *
295
289
  * @description return props of the button icon.
296
- * @param {Function} fn
290
+ * @param {Function} fn
297
291
  * @returns {Object} props of the button text
298
292
  */
299
293
 
@@ -313,7 +307,7 @@ const buttonTextProps = fn => {
313
307
  };
314
308
  /**
315
309
  * @description detect value is a Date object
316
- * @param {String | Number | Array} value
310
+ * @param {String | Number | Array} value
317
311
  * @returns boolean
318
312
  */
319
313
 
@@ -409,15 +403,15 @@ const isAfterLimit = (max, time) => {
409
403
  return max && isValidDate(max) && moment(time).diff(new Date(max).setHours(0, 0, 0, 0)) > 0;
410
404
  };
411
405
  /**
412
- *
406
+ *
413
407
  * @description return the table body of the calendar.
414
408
  * @param {Date} time
415
409
  * @param {Date} activeValue
416
410
  * @param {Object} className
417
411
  * @param {Boolean} displayAnotherMonth
418
412
  * @param {Function} onTableDataClick
419
- * @param {Date} min
420
- * @param {Date} max
413
+ * @param {Date} min
414
+ * @param {Date} max
421
415
  * @returns {Element}
422
416
  */
423
417
 
@@ -548,9 +542,9 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
548
542
  return tableBody;
549
543
  };
550
544
  /**
551
- *
552
- * @param {Object} className
553
- * @returns
545
+ *
546
+ * @param {Object} className
547
+ * @returns
554
548
  */
555
549
 
556
550
 
@@ -574,13 +568,13 @@ const renderHeader = className => {
574
568
  return header;
575
569
  };
576
570
  /**
577
- *
578
- * @param {Object} className
579
- * @param {Object} refs
580
- * @param {Function} dbLeftFn
581
- * @param {Function} leftFn
582
- * @param {Function} rightFn
583
- * @param {Function} dbRightFn
571
+ *
572
+ * @param {Object} className
573
+ * @param {Object} refs
574
+ * @param {Function} dbLeftFn
575
+ * @param {Function} leftFn
576
+ * @param {Function} rightFn
577
+ * @param {Function} dbRightFn
584
578
  * @returns navigator
585
579
  */
586
580
 
@@ -616,8 +610,8 @@ const renderNavigator = (className, refs, dbLeftFn, leftFn, rightFn, dbRightFn,
616
610
  ref: refs.doubleRight
617
611
  })));
618
612
  /**
619
- *
620
- * @param {Date} time
613
+ *
614
+ * @param {Date} time
621
615
  * @returns {String} month year
622
616
  */
623
617
 
@@ -628,11 +622,11 @@ const renderNavigatorContent = time => {
628
622
  return [months[value.getMonth()], value.getFullYear()];
629
623
  };
630
624
  /**
631
- *
632
- * @param {Date} time
633
- * @param {Object} refs
634
- * @param {Date} min
635
- * @param {Date} max
625
+ *
626
+ * @param {Date} time
627
+ * @param {Object} refs
628
+ * @param {Date} min
629
+ * @param {Date} max
636
630
  */
637
631
 
638
632
 
@@ -675,17 +669,17 @@ const onUpdateNavigator = (time, refs, min, max) => {
675
669
  }
676
670
  };
677
671
  /**
678
- *
679
- * @param {Date} time
680
- * @param {Object} navigatorRefs
681
- * @param {Date} min
682
- * @param {Date} max
683
- * @param {Element} table
684
- * @param {Date} activeValue
685
- * @param {Object} className
686
- * @param {Boolean} displayAnotherMonth
687
- * @param {Function} onTableDataClick
688
- * @param {Function} onUpdateNavigatorValue
672
+ *
673
+ * @param {Date} time
674
+ * @param {Object} navigatorRefs
675
+ * @param {Date} min
676
+ * @param {Date} max
677
+ * @param {Element} table
678
+ * @param {Date} activeValue
679
+ * @param {Object} className
680
+ * @param {Boolean} displayAnotherMonth
681
+ * @param {Function} onTableDataClick
682
+ * @param {Function} onUpdateNavigatorValue
689
683
  */
690
684
 
691
685
 
@@ -10,6 +10,7 @@ import { randomString } from '../../../utils';
10
10
  import { color as colors } from '../../../styles/colors';
11
11
  import { typography } from '../../../styles/typography';
12
12
  import { borderBox, borderRadius4px, displayBlock, positionFixed, positionRelative } from '../../../styles/general';
13
+ import { useTheme } from '../../../theme';
13
14
  const {
14
15
  paragraph1
15
16
  } = typography;
@@ -25,6 +26,9 @@ const {
25
26
  'scrollbar-tabbar': scrollbar
26
27
  }
27
28
  } = colors;
29
+ const {
30
+ zIndex: zIndexCORE
31
+ } = useTheme();
28
32
  const timing = {};
29
33
  const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
30
34
  className,
@@ -248,7 +252,7 @@ DropdownBox.defaultProps = {
248
252
  viewType: 'underlined',
249
253
  inputProps: {},
250
254
  delayOnInput: 700,
251
- zIndex: 9001
255
+ zIndex: zIndexCORE(1)
252
256
  };
253
257
  DropdownBox.propTypes = {
254
258
  /** class for dropdown */