diginet-core-ui 1.3.90-beta.1 → 1.3.90-beta.2
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/components/form-control/calendar/function.js +63 -119
- package/package.json +1 -1
- package/styles/general.js +11 -11
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
|
|
4
3
|
import { css, jsx } from '@emotion/core';
|
|
5
|
-
import { render } from 'react-dom';
|
|
6
4
|
import { Button, ButtonIcon, Typography } from "../..";
|
|
7
5
|
import { getGlobal } from "../../../global";
|
|
8
6
|
import locale from "../../../locale";
|
|
9
|
-
import
|
|
7
|
+
import { render } from 'react-dom';
|
|
8
|
+
import { bgColor, border, borderRadius, boxBorder, cursorDefault, cursorPointer, displayFlex, flexCol, flexRow, inset, itemsCenter, justifyBetween, mg, parseHeight, parseMaxWidth, parseMinWidth, parseWidth, pointerEventsNone, positionAbsolute, positionRelative, textCenter, textColor, userSelectNone } from "../../../styles/general";
|
|
9
|
+
import { useTheme } from "../../../theme";
|
|
10
10
|
import { date as moment } from "../../../utils";
|
|
11
|
-
import { useColor as colors } from "../../../theme";
|
|
12
|
-
import { typography } from "../../../styles/typography";
|
|
13
|
-
import { itemsCenter, border, boxBorder, borderRadius4px, cursorPointer, flexCol, flexRow, displayInlineFlex, justifyBetween, pointerEventsNone, positionAbsolute, positionRelative, textCenter, userSelectNone } from "../../../styles/general";
|
|
14
|
-
const {
|
|
15
|
-
heading6
|
|
16
|
-
} = typography;
|
|
17
11
|
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
fill: {
|
|
23
|
-
hover: fillHover,
|
|
24
|
-
focus: fillFocus,
|
|
25
|
-
pressed: fillPressed
|
|
26
|
-
},
|
|
27
|
-
text: {
|
|
28
|
-
main,
|
|
29
|
-
normal_label
|
|
30
|
-
},
|
|
31
|
-
danger8,
|
|
32
|
-
info8
|
|
33
|
-
} = colors;
|
|
12
|
+
boxShadows: {
|
|
13
|
+
large: boxShadowsLarge
|
|
14
|
+
}
|
|
15
|
+
} = useTheme();
|
|
34
16
|
|
|
35
17
|
/**
|
|
36
18
|
* START STYLE
|
|
@@ -43,81 +25,52 @@ const {
|
|
|
43
25
|
* @returns
|
|
44
26
|
*/
|
|
45
27
|
const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) => css`
|
|
46
|
-
${
|
|
47
|
-
${
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
${displayFlex};
|
|
29
|
+
${flexCol};
|
|
30
|
+
${boxBorder};
|
|
31
|
+
${borderRadius('0px 0px 4px 4px')};
|
|
32
|
+
${bgColor('system.white')};
|
|
33
|
+
${parseWidth('100%')};
|
|
34
|
+
${parseMinWidth(260)};
|
|
35
|
+
${parseMaxWidth(400)};
|
|
36
|
+
box-shadow: ${boxShadow ? boxShadowsLarge : 'none'};
|
|
54
37
|
.${unique.navigator.navigator} {
|
|
55
|
-
${
|
|
56
|
-
${
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
width: calc(100% - 28px);
|
|
38
|
+
${displayFlex};
|
|
39
|
+
${flexRow};
|
|
40
|
+
${justifyBetween};
|
|
41
|
+
${itemsCenter};
|
|
42
|
+
${parseMaxWidth(400)};
|
|
43
|
+
${mg([4, 4, 0])};
|
|
62
44
|
.${unique.navigator.around} {
|
|
63
|
-
${
|
|
64
|
-
${
|
|
65
|
-
height : 28px;
|
|
66
|
-
width: 64px;
|
|
45
|
+
${displayFlex};
|
|
46
|
+
${flexRow};
|
|
67
47
|
}
|
|
68
48
|
.${unique.navigator.center} {
|
|
69
|
-
${
|
|
70
|
-
${itemsCenter}
|
|
71
|
-
${textCenter}
|
|
72
|
-
${userSelectNone}
|
|
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}
|
|
49
|
+
${parseWidth('100%')};
|
|
93
50
|
}
|
|
94
51
|
}
|
|
95
52
|
.${unique.table.container} {
|
|
96
|
-
${
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
width: 100%;
|
|
53
|
+
${displayFlex};
|
|
54
|
+
${flexRow};
|
|
55
|
+
${mg([2, 0])};
|
|
100
56
|
}
|
|
101
57
|
.${unique.table.table} {
|
|
58
|
+
${mg([0, 4])};
|
|
59
|
+
${parseWidth('calc(100% - 32px)')};
|
|
102
60
|
border-collapse: separate;
|
|
103
|
-
margin: 0 16px;
|
|
104
61
|
padding: 0;
|
|
105
62
|
table-layout: fixed;
|
|
106
|
-
width: calc(100% - 32px);
|
|
107
63
|
.${unique.table.data} {
|
|
108
|
-
${cursorPointer}
|
|
109
|
-
${positionRelative}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
height: 24px;
|
|
114
|
-
min-width: 24px;
|
|
115
|
-
padding: 1px;
|
|
64
|
+
${cursorPointer};
|
|
65
|
+
${positionRelative};
|
|
66
|
+
${textCenter};
|
|
67
|
+
${userSelectNone};
|
|
68
|
+
${textColor('text.main')};
|
|
116
69
|
&:nth-of-type(7n - 1) {
|
|
117
|
-
|
|
70
|
+
${textColor('info8')};
|
|
118
71
|
}
|
|
119
72
|
&:nth-of-type(7n) {
|
|
120
|
-
|
|
73
|
+
${textColor('danger8')};
|
|
121
74
|
}
|
|
122
75
|
&.next_month,
|
|
123
76
|
&.previous_month,
|
|
@@ -125,45 +78,42 @@ const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) =>
|
|
|
125
78
|
opacity: 0.25;
|
|
126
79
|
}
|
|
127
80
|
&.${unique.day.limit} {
|
|
128
|
-
${pointerEventsNone}
|
|
129
|
-
|
|
81
|
+
${pointerEventsNone};
|
|
82
|
+
${cursorDefault};
|
|
130
83
|
}
|
|
131
84
|
&:hover {
|
|
132
85
|
span.${unique.day.day} {
|
|
133
|
-
|
|
86
|
+
${bgColor('fill.hover')};
|
|
134
87
|
}
|
|
135
88
|
}
|
|
136
|
-
${onClickActive
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
89
|
+
${onClickActive && css`
|
|
90
|
+
&:active {
|
|
91
|
+
span.${unique.day.day} {
|
|
92
|
+
${bgColor('fill.pressed')};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`}
|
|
141
96
|
&.${unique.day.active} {
|
|
142
97
|
span.${unique.day.day} {
|
|
143
|
-
${
|
|
144
|
-
background-color: ${fillFocus};
|
|
98
|
+
${bgColor('fill.focus')};
|
|
145
99
|
}
|
|
146
100
|
}
|
|
147
101
|
&.${unique.day.today} {
|
|
148
102
|
span {
|
|
149
|
-
${
|
|
150
|
-
${
|
|
151
|
-
${border(1, active)}
|
|
152
|
-
/* text-decoration-line : underline;
|
|
153
|
-
text-decoration-thickness: 2px;
|
|
154
|
-
text-underline-offset : 1px */
|
|
103
|
+
${boxBorder};
|
|
104
|
+
${border(1, 'system.active')};
|
|
155
105
|
}
|
|
156
106
|
}
|
|
157
107
|
&.${unique.day.between} {
|
|
158
108
|
opacity: 1;
|
|
159
109
|
&::before {
|
|
160
|
-
|
|
110
|
+
${bgColor('fill.hover')};
|
|
161
111
|
}
|
|
162
112
|
}
|
|
163
113
|
&.${unique.day.from} {
|
|
164
114
|
opacity: 1;
|
|
165
115
|
&::before {
|
|
166
|
-
|
|
116
|
+
${bgColor('fill.hover')};
|
|
167
117
|
border-bottom-left-radius: 12px;
|
|
168
118
|
border-top-left-radius: 12px;
|
|
169
119
|
left: calc((100% - 24px) / 2);
|
|
@@ -172,31 +122,28 @@ const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) =>
|
|
|
172
122
|
&.${unique.day.to} {
|
|
173
123
|
opacity: 1;
|
|
174
124
|
&::before {
|
|
175
|
-
|
|
125
|
+
${bgColor('fill.hover')};
|
|
176
126
|
border-bottom-right-radius: 12px;
|
|
177
127
|
border-top-right-radius: 12px;
|
|
178
128
|
right: calc((100% - 24px) / 2);
|
|
179
129
|
}
|
|
180
130
|
}
|
|
181
131
|
::before {
|
|
182
|
-
${positionAbsolute}
|
|
183
|
-
inset
|
|
132
|
+
${positionAbsolute};
|
|
133
|
+
${inset('1px -2px')};
|
|
184
134
|
content: '';
|
|
185
135
|
}
|
|
186
136
|
}
|
|
187
137
|
.${unique.table.header} {
|
|
188
|
-
${userSelectNone}
|
|
189
|
-
${textCenter}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
min-width: 24px;
|
|
193
|
-
padding: 0;
|
|
194
|
-
padding-bottom: 6px;
|
|
138
|
+
${userSelectNone};
|
|
139
|
+
${textCenter};
|
|
140
|
+
${parseHeight(24)};
|
|
141
|
+
${textColor('text.normal_label')};
|
|
195
142
|
&:nth-of-type(6) {
|
|
196
|
-
|
|
143
|
+
${textColor('info8')};
|
|
197
144
|
}
|
|
198
145
|
&:nth-of-type(7) {
|
|
199
|
-
|
|
146
|
+
${textColor('danger8')};
|
|
200
147
|
}
|
|
201
148
|
}
|
|
202
149
|
}
|
|
@@ -280,10 +227,8 @@ const buttonIconProps = className => {
|
|
|
280
227
|
return {
|
|
281
228
|
className,
|
|
282
229
|
circular: true,
|
|
283
|
-
height: 28,
|
|
284
|
-
viewBox: true,
|
|
285
230
|
viewType: 'text',
|
|
286
|
-
|
|
231
|
+
size: 'small'
|
|
287
232
|
};
|
|
288
233
|
};
|
|
289
234
|
/**
|
|
@@ -296,10 +241,9 @@ const buttonTextProps = fn => {
|
|
|
296
241
|
return {
|
|
297
242
|
onClick: fn,
|
|
298
243
|
color: 'primary',
|
|
244
|
+
size: 'small',
|
|
299
245
|
style: {
|
|
300
246
|
borderRadius: 20,
|
|
301
|
-
margin: 0,
|
|
302
|
-
padding: '2px 4px',
|
|
303
247
|
textTransform: 'initial',
|
|
304
248
|
width: '100%'
|
|
305
249
|
}
|
package/package.json
CHANGED
package/styles/general.js
CHANGED
|
@@ -4,10 +4,10 @@ export const rootSpacing = 4;
|
|
|
4
4
|
export let rootZIndex = 1500;
|
|
5
5
|
export const typographyTypes = ['t1', 't2', 't3', 't4', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p1', 'p2', 'p3', 'title1', 'title2', 'title3', 'title4', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6', 'paragraph1', 'paragraph2', 'paragraph3'];
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* get value spacing with rootZIndex
|
|
9
|
-
* @param number
|
|
10
|
-
* @return {number}
|
|
7
|
+
/**
|
|
8
|
+
* get value spacing with rootZIndex
|
|
9
|
+
* @param number
|
|
10
|
+
* @return {number}
|
|
11
11
|
*/
|
|
12
12
|
export const zIndex = number => {
|
|
13
13
|
number = Number(number || 0);
|
|
@@ -15,10 +15,10 @@ export const zIndex = number => {
|
|
|
15
15
|
return rootZIndex + number;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* get value spacing with rootSpacing
|
|
20
|
-
* @param {(number|number[])} vl - default 1
|
|
21
|
-
* @returns {(number|string)}
|
|
18
|
+
/**
|
|
19
|
+
* get value spacing with rootSpacing
|
|
20
|
+
* @param {(number|number[])} vl - default 1
|
|
21
|
+
* @returns {(number|string)}
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
export const getSpacing = (vl = 1) => {
|
|
@@ -28,9 +28,9 @@ export const getSpacing = (vl = 1) => {
|
|
|
28
28
|
} else return vl;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* replace rootZIndex
|
|
33
|
-
* @param number
|
|
31
|
+
/**
|
|
32
|
+
* replace rootZIndex
|
|
33
|
+
* @param number
|
|
34
34
|
*/
|
|
35
35
|
export const setZIndex = number => {
|
|
36
36
|
number = Number(number || 0);
|