@zohodesk/components 1.2.12 → 1.2.13
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/.cli/PropLessFiles.html +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +5 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/coverage/Button/Button.js.html +1 -1
- package/coverage/Button/css/Button.module.css.html +1 -1
- package/coverage/Button/css/cssJSLogic.js.html +1 -1
- package/coverage/Button/css/index.html +1 -1
- package/coverage/Button/index.html +1 -1
- package/coverage/Button/props/defaultProps.js.html +1 -1
- package/coverage/Button/props/index.html +1 -1
- package/coverage/Button/props/propTypes.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
- package/coverage/Buttongroup/index.html +1 -1
- package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
- package/coverage/Buttongroup/props/index.html +1 -1
- package/coverage/Buttongroup/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +10 -10
- package/coverage/coverage-summary.json +10 -10
- package/coverage/index.html +1 -1
- package/coverage/utils/dummyFunction.js.html +1 -1
- package/coverage/utils/index.html +1 -1
- package/es/DateTime/DateTime.module.css +12 -1
- package/es/v1/DateTime/CalendarView.js +43 -10
- package/es/v1/DateTime/DateTime.js +8 -4
- package/es/v1/DateTime/DateTimePopupFooter.js +2 -2
- package/es/v1/DateTime/DateTimePopupHeader.js +1 -1
- package/es/v1/DateTime/DateWidget.js +8 -4
- package/es/v1/DateTime/DaysRow.js +1 -1
- package/es/v1/DateTime/Time.js +2 -2
- package/es/v1/DateTime/YearView.js +2 -2
- package/es/v1/DateTime/props/defaultProps.js +57 -0
- package/es/v1/DateTime/props/propTypes.js +195 -0
- package/es/v1/Typography/Typography.js +4 -4
- package/es/v1/Typography/css/Typography.module.css +33 -0
- package/es/v1/Typography/css/cssJSLogic.js +14 -8
- package/es/v1/Typography/props/defaultProps.js +4 -4
- package/es/v1/Typography/props/propTypes.js +8 -5
- package/lib/DateTime/DateTime.module.css +12 -1
- package/lib/v1/DateTime/CalendarView.js +44 -10
- package/lib/v1/DateTime/DateTime.js +8 -4
- package/lib/v1/DateTime/DateTimePopupFooter.js +2 -2
- package/lib/v1/DateTime/DateTimePopupHeader.js +1 -1
- package/lib/v1/DateTime/DateWidget.js +8 -4
- package/lib/v1/DateTime/DaysRow.js +1 -1
- package/lib/v1/DateTime/Time.js +2 -2
- package/lib/v1/DateTime/YearView.js +2 -2
- package/lib/v1/DateTime/props/defaultProps.js +70 -0
- package/lib/v1/DateTime/props/propTypes.js +227 -0
- package/lib/v1/Typography/Typography.js +3 -3
- package/lib/v1/Typography/css/Typography.module.css +33 -0
- package/lib/v1/Typography/css/cssJSLogic.js +8 -5
- package/lib/v1/Typography/props/defaultProps.js +4 -4
- package/lib/v1/Typography/props/propTypes.js +8 -5
- package/package.json +1 -1
- package/result.json +1 -1
package/es/v1/DateTime/Time.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/** ** Libraries *** */
|
|
4
4
|
import React, { PureComponent } from 'react';
|
|
5
|
-
import { Time_propTypes } from '
|
|
6
|
-
import { Time_defaultProps } from '
|
|
5
|
+
import { Time_propTypes } from './props/propTypes';
|
|
6
|
+
import { Time_defaultProps } from './props/defaultProps';
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
9
|
import { Container, Box } from '../Layout';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**** Libraries ****/
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { YearView_propTypes } from '
|
|
4
|
-
import { YearView_defaultProps } from '
|
|
3
|
+
import { YearView_propTypes } from './props/propTypes';
|
|
4
|
+
import { YearView_defaultProps } from './props/defaultProps';
|
|
5
5
|
/**** Components ****/
|
|
6
6
|
|
|
7
7
|
import { Virtualizer } from '@zohodesk/virtualizer';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const CalendarView_defaultProps = {
|
|
2
|
+
dataId: 'dateContainer',
|
|
3
|
+
needBorder: true
|
|
4
|
+
};
|
|
5
|
+
export const Span_defaultProps = {
|
|
6
|
+
dataId: 'calendar-view'
|
|
7
|
+
};
|
|
8
|
+
export const DateTime_defaultProps = {
|
|
9
|
+
isDateTimeField: true,
|
|
10
|
+
dataId: 'dateTime',
|
|
11
|
+
needDefaultTime: true,
|
|
12
|
+
isAbsolute: true,
|
|
13
|
+
isAnimate: true,
|
|
14
|
+
needAction: true,
|
|
15
|
+
boxSize: 'large',
|
|
16
|
+
className: '',
|
|
17
|
+
innerClass: '',
|
|
18
|
+
dateFormat: 'dd/MM/yyyy',
|
|
19
|
+
isPadding: false,
|
|
20
|
+
i18nKeys: {},
|
|
21
|
+
is24Hour: false,
|
|
22
|
+
isDefaultPosition: false,
|
|
23
|
+
customDateFormat: null
|
|
24
|
+
};
|
|
25
|
+
export const DateWidget_defaultProps = {
|
|
26
|
+
borderColor: 'default',
|
|
27
|
+
dataId: 'dateWidget',
|
|
28
|
+
dateFormat: 'MM/dd/yyyy',
|
|
29
|
+
isDateTime: false,
|
|
30
|
+
isDisabled: false,
|
|
31
|
+
isPopupOpenOnEnter: false,
|
|
32
|
+
isReadOnly: false,
|
|
33
|
+
needBorder: true,
|
|
34
|
+
needDefaultTime: true,
|
|
35
|
+
placeholder: '-None-',
|
|
36
|
+
textBoxSize: 'medium',
|
|
37
|
+
textBoxVariant: 'default',
|
|
38
|
+
timeZone: null,
|
|
39
|
+
isPopupOpenOnClick: true,
|
|
40
|
+
isPopupCloseOnClick: false,
|
|
41
|
+
cantEditOnPopupOpen: true,
|
|
42
|
+
i18nKeys: {},
|
|
43
|
+
needErrorOnBlur: false,
|
|
44
|
+
isEditable: false,
|
|
45
|
+
iconOnHover: false,
|
|
46
|
+
is24Hour: false
|
|
47
|
+
};
|
|
48
|
+
export const YearView_defaultProps = {
|
|
49
|
+
dataId: 'dateContainer',
|
|
50
|
+
needBorder: true
|
|
51
|
+
};
|
|
52
|
+
export const DateTimePopupFooter_defaultProps = {
|
|
53
|
+
dataId: 'DateTimePopupFooter'
|
|
54
|
+
};
|
|
55
|
+
export const Time_defaultProps = {
|
|
56
|
+
dataId: 'Time'
|
|
57
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { dataFormatList } from '../../../DateTime/dateFormatUtils/dateFormats';
|
|
3
|
+
export const CalendarView_propTypes = {
|
|
4
|
+
dataId: PropTypes.string,
|
|
5
|
+
date: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
6
|
+
month: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
7
|
+
needBorder: PropTypes.bool,
|
|
8
|
+
onSelect: PropTypes.func,
|
|
9
|
+
year: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
10
|
+
dayNames: PropTypes.array,
|
|
11
|
+
dayNamesShort: PropTypes.array,
|
|
12
|
+
todayMonth: PropTypes.string,
|
|
13
|
+
todayDate: PropTypes.string,
|
|
14
|
+
todayYear: PropTypes.string,
|
|
15
|
+
startDate: PropTypes.string,
|
|
16
|
+
endDate: PropTypes.string
|
|
17
|
+
};
|
|
18
|
+
export const Span_propTypes = {
|
|
19
|
+
dataId: PropTypes.string,
|
|
20
|
+
handleSelect: PropTypes.func,
|
|
21
|
+
i: PropTypes.number,
|
|
22
|
+
incremday: PropTypes.number,
|
|
23
|
+
isActive: PropTypes.bool,
|
|
24
|
+
tdclass: PropTypes.string,
|
|
25
|
+
userSeeMonth: PropTypes.number,
|
|
26
|
+
userSeeYear: PropTypes.number,
|
|
27
|
+
isToday: PropTypes.bool,
|
|
28
|
+
startDate: PropTypes.string,
|
|
29
|
+
endDate: PropTypes.string
|
|
30
|
+
};
|
|
31
|
+
export const DateTime_propTypes = {
|
|
32
|
+
boxSize: PropTypes.string,
|
|
33
|
+
className: PropTypes.string,
|
|
34
|
+
dataId: PropTypes.string,
|
|
35
|
+
dateFormat: PropTypes.string,
|
|
36
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
37
|
+
defaultTime: PropTypes.string,
|
|
38
|
+
getMethods: PropTypes.func,
|
|
39
|
+
getRef: PropTypes.func,
|
|
40
|
+
i18nKeys: PropTypes.shape({
|
|
41
|
+
timeText: PropTypes.string.isRequired,
|
|
42
|
+
submitText: PropTypes.string.isRequired,
|
|
43
|
+
cancelText: PropTypes.string.isRequired,
|
|
44
|
+
hourEmptyText: PropTypes.string.isRequired,
|
|
45
|
+
minuteEmptyText: PropTypes.string.isRequired,
|
|
46
|
+
nextMonthTitleText: PropTypes.string.isRequired,
|
|
47
|
+
prevMonthTitleText: PropTypes.string.isRequired
|
|
48
|
+
}),
|
|
49
|
+
innerClass: PropTypes.string,
|
|
50
|
+
isAbsolute: PropTypes.bool,
|
|
51
|
+
isActive: PropTypes.bool,
|
|
52
|
+
isAnimate: PropTypes.bool,
|
|
53
|
+
isDateTimeField: PropTypes.bool,
|
|
54
|
+
isPadding: PropTypes.bool,
|
|
55
|
+
isReady: PropTypes.bool,
|
|
56
|
+
max: PropTypes.string,
|
|
57
|
+
maxErrorText: PropTypes.string,
|
|
58
|
+
min: PropTypes.string,
|
|
59
|
+
minErrorText: PropTypes.string,
|
|
60
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
61
|
+
needAction: PropTypes.bool,
|
|
62
|
+
needDefaultTime: PropTypes.bool,
|
|
63
|
+
needResponsive: PropTypes.bool,
|
|
64
|
+
onChange: PropTypes.func,
|
|
65
|
+
onClear: PropTypes.func,
|
|
66
|
+
onClick: PropTypes.func,
|
|
67
|
+
onDateSelect: PropTypes.func,
|
|
68
|
+
onError: PropTypes.func,
|
|
69
|
+
onSelect: PropTypes.func,
|
|
70
|
+
position: PropTypes.string,
|
|
71
|
+
timeZone: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
72
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
73
|
+
is24Hour: PropTypes.bool,
|
|
74
|
+
isDefaultPosition: PropTypes.bool,
|
|
75
|
+
customDateFormat: PropTypes.string,
|
|
76
|
+
positionsOffset: PropTypes.array,
|
|
77
|
+
targetOffset: PropTypes.string,
|
|
78
|
+
isRestrictScroll: PropTypes.bool,
|
|
79
|
+
dropBoxPortalId: PropTypes.string,
|
|
80
|
+
startDate: PropTypes.string,
|
|
81
|
+
endDate: PropTypes.string
|
|
82
|
+
};
|
|
83
|
+
export const DateWidget_propTypes = {
|
|
84
|
+
borderColor: PropTypes.oneOf(['transparent', 'default']),
|
|
85
|
+
cantEditOnPopupOpen: PropTypes.bool,
|
|
86
|
+
children: PropTypes.object,
|
|
87
|
+
className: PropTypes.string,
|
|
88
|
+
closePopupOnly: PropTypes.func,
|
|
89
|
+
dataId: PropTypes.string,
|
|
90
|
+
dateFormat: PropTypes.oneOf([...dataFormatList]),
|
|
91
|
+
defaultPosition: PropTypes.oneOf(['top', 'bottom', 'right', 'left']),
|
|
92
|
+
defaultTime: PropTypes.string,
|
|
93
|
+
getContainerRef: PropTypes.func,
|
|
94
|
+
getMethods: PropTypes.func,
|
|
95
|
+
getRef: PropTypes.func,
|
|
96
|
+
getTargetRef: PropTypes.func,
|
|
97
|
+
i18nKeys: PropTypes.object,
|
|
98
|
+
id: PropTypes.string,
|
|
99
|
+
isDateTime: PropTypes.bool,
|
|
100
|
+
isDisabled: PropTypes.bool,
|
|
101
|
+
isEditable: PropTypes.bool,
|
|
102
|
+
isPopupCloseOnClick: PropTypes.bool,
|
|
103
|
+
isPopupOpen: PropTypes.bool,
|
|
104
|
+
isPopupOpenOnClick: PropTypes.bool,
|
|
105
|
+
isPopupOpenOnEnter: PropTypes.bool,
|
|
106
|
+
isPopupReady: PropTypes.bool,
|
|
107
|
+
isReadOnly: PropTypes.bool,
|
|
108
|
+
max: PropTypes.string,
|
|
109
|
+
maxErrorText: PropTypes.string,
|
|
110
|
+
min: PropTypes.string,
|
|
111
|
+
minErrorText: PropTypes.string,
|
|
112
|
+
needBorder: PropTypes.bool,
|
|
113
|
+
needDefaultTime: PropTypes.bool,
|
|
114
|
+
needErrorOnBlur: PropTypes.bool,
|
|
115
|
+
needResponsive: PropTypes.bool,
|
|
116
|
+
onFailValidation: PropTypes.func,
|
|
117
|
+
onKeyDown: PropTypes.func,
|
|
118
|
+
onPassValidation: PropTypes.func,
|
|
119
|
+
onSelect: PropTypes.func,
|
|
120
|
+
placeholder: PropTypes.string,
|
|
121
|
+
position: PropTypes.string,
|
|
122
|
+
removeClose: PropTypes.func,
|
|
123
|
+
textBoxSize: PropTypes.string,
|
|
124
|
+
textBoxVariant: PropTypes.string,
|
|
125
|
+
timeZone: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
126
|
+
togglePopup: PropTypes.func,
|
|
127
|
+
validation: PropTypes.shape({
|
|
128
|
+
validate: PropTypes.bool,
|
|
129
|
+
validateOn: PropTypes.string,
|
|
130
|
+
rulesOrder: PropTypes.arrayOf(PropTypes.string),
|
|
131
|
+
rules: PropTypes.object,
|
|
132
|
+
messages: PropTypes.object
|
|
133
|
+
}),
|
|
134
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
135
|
+
htmlId: PropTypes.string,
|
|
136
|
+
iconOnHover: PropTypes.bool,
|
|
137
|
+
is24Hour: PropTypes.bool,
|
|
138
|
+
isHideCurrentYear: PropTypes.bool,
|
|
139
|
+
onFocus: PropTypes.func,
|
|
140
|
+
onBlur: PropTypes.func,
|
|
141
|
+
boxSize: PropTypes.string,
|
|
142
|
+
onError: PropTypes.func,
|
|
143
|
+
isAbsolutePositioningNeeded: PropTypes.bool,
|
|
144
|
+
positionsOffset: PropTypes.array,
|
|
145
|
+
targetOffset: PropTypes.array,
|
|
146
|
+
isRestrictScroll: PropTypes.bool,
|
|
147
|
+
dropBoxPortalId: PropTypes.string,
|
|
148
|
+
a11y: PropTypes.object,
|
|
149
|
+
startDate: PropTypes.string,
|
|
150
|
+
endDate: PropTypes.string
|
|
151
|
+
};
|
|
152
|
+
export const YearView_propTypes = {
|
|
153
|
+
onSelectMonth: PropTypes.func,
|
|
154
|
+
onSelectYear: PropTypes.func,
|
|
155
|
+
viewedYear: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
156
|
+
viewedMonth: PropTypes.string,
|
|
157
|
+
monthNamesShort: PropTypes.array,
|
|
158
|
+
isMonthOpen: PropTypes.bool
|
|
159
|
+
};
|
|
160
|
+
export const DateTimePopupFooter_propTypes = {
|
|
161
|
+
submitText: PropTypes.string,
|
|
162
|
+
onSubmit: PropTypes.func,
|
|
163
|
+
cancelText: PropTypes.string,
|
|
164
|
+
onCancel: PropTypes.func,
|
|
165
|
+
dataId: PropTypes.string
|
|
166
|
+
};
|
|
167
|
+
export const DateTimePopupHeader_propTypes = {
|
|
168
|
+
onOpenYearView: PropTypes.func,
|
|
169
|
+
showMonthTxt: PropTypes.string,
|
|
170
|
+
isYearView: PropTypes.bool,
|
|
171
|
+
prevMonthTitleText: PropTypes.string,
|
|
172
|
+
nextMonthTitleText: PropTypes.string,
|
|
173
|
+
onModifyCalendar: PropTypes.func
|
|
174
|
+
};
|
|
175
|
+
export const DaysRow_propTypes = {
|
|
176
|
+
dayNames: PropTypes.array,
|
|
177
|
+
dayNamesShort: PropTypes.object
|
|
178
|
+
};
|
|
179
|
+
export const Time_propTypes = {
|
|
180
|
+
timeText: PropTypes.string,
|
|
181
|
+
dataId: PropTypes.string,
|
|
182
|
+
hourSuggestions: PropTypes.array,
|
|
183
|
+
onHourSelect: PropTypes.func,
|
|
184
|
+
hours: PropTypes.string,
|
|
185
|
+
hourEmptyText: PropTypes.string,
|
|
186
|
+
needResponsive: PropTypes.bool,
|
|
187
|
+
minSuggestions: PropTypes.array,
|
|
188
|
+
onMinutesSelect: PropTypes.func,
|
|
189
|
+
mins: PropTypes.string,
|
|
190
|
+
minuteEmptyText: PropTypes.string,
|
|
191
|
+
ampmSuggestions: PropTypes.array,
|
|
192
|
+
onAmPmSelect: PropTypes.func,
|
|
193
|
+
amPm: PropTypes.string,
|
|
194
|
+
is24Hour: PropTypes.bool
|
|
195
|
+
};
|
|
@@ -12,8 +12,8 @@ const Typography = props => {
|
|
|
12
12
|
$i18n_dataTitle,
|
|
13
13
|
testId,
|
|
14
14
|
customId,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
$tagAttributes_text,
|
|
16
|
+
$a11yAttributes_text,
|
|
17
17
|
customStyle
|
|
18
18
|
} = props;
|
|
19
19
|
const style = mergeStyle(defaultStyle, customStyle);
|
|
@@ -28,8 +28,8 @@ const Typography = props => {
|
|
|
28
28
|
'data-title': $i18n_dataTitle,
|
|
29
29
|
'data-id': customId,
|
|
30
30
|
'data-test-id': testId,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
...$tagAttributes_text,
|
|
32
|
+
...$a11yAttributes_text
|
|
33
33
|
}, children);
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -106,6 +106,39 @@
|
|
|
106
106
|
composes:dotted_clamp;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
.wordBreak_breakAll{
|
|
110
|
+
word-break: break-all
|
|
111
|
+
}
|
|
112
|
+
.wordBreak_keepAll{
|
|
113
|
+
word-break: keep-all
|
|
114
|
+
}
|
|
115
|
+
.wordBreak_breakWord{
|
|
116
|
+
word-break: break-word
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.wordWrap_normal{
|
|
120
|
+
word-wrap:normal;
|
|
121
|
+
}
|
|
122
|
+
.wordWrap_break{
|
|
123
|
+
word-wrap:break-word
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.whiteSpace_normal{
|
|
127
|
+
white-space:normal
|
|
128
|
+
}
|
|
129
|
+
.whiteSpace_noWrap{
|
|
130
|
+
white-space:nowrap
|
|
131
|
+
}
|
|
132
|
+
.whiteSpace_pre{
|
|
133
|
+
white-space:pre
|
|
134
|
+
}
|
|
135
|
+
.whiteSpace_preLine{
|
|
136
|
+
white-space:pre-line
|
|
137
|
+
}
|
|
138
|
+
.whiteSpace_preWrap{
|
|
139
|
+
white-space:pre-wrap
|
|
140
|
+
}
|
|
141
|
+
|
|
109
142
|
|
|
110
143
|
|
|
111
144
|
/*...............Font Size Start.........*/
|
|
@@ -6,19 +6,22 @@ export default function cssJSLogic(_ref) {
|
|
|
6
6
|
style
|
|
7
7
|
} = _ref;
|
|
8
8
|
let {
|
|
9
|
-
$
|
|
10
|
-
$
|
|
9
|
+
$flag_reset,
|
|
10
|
+
$flag_dotted,
|
|
11
11
|
$ui_size,
|
|
12
12
|
$ui_lineClamp,
|
|
13
13
|
$ui_lineHeight,
|
|
14
14
|
$ui_display,
|
|
15
|
-
$
|
|
15
|
+
$ui_weight,
|
|
16
16
|
$ui_typeFace,
|
|
17
17
|
$ui_textAlign,
|
|
18
18
|
$ui_letterSpacing,
|
|
19
19
|
$ui_transform,
|
|
20
20
|
$ui_decoration,
|
|
21
|
-
$ui_className
|
|
21
|
+
$ui_className,
|
|
22
|
+
$ui_wordBreak,
|
|
23
|
+
$ui_wordWrap,
|
|
24
|
+
$ui_whiteSpace
|
|
22
25
|
} = props;
|
|
23
26
|
|
|
24
27
|
if ($ui_letterSpacing && $ui_letterSpacing.match(/\./g)) {
|
|
@@ -26,19 +29,22 @@ export default function cssJSLogic(_ref) {
|
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
let typographyClass = compileClassNames({
|
|
29
|
-
[style.reset]: $
|
|
30
|
-
[style.dotted]: $
|
|
32
|
+
[style.reset]: $flag_reset,
|
|
33
|
+
[style.dotted]: $flag_dotted,
|
|
31
34
|
[style[`size${$ui_size}`]]: !!$ui_size,
|
|
32
35
|
[style[`lineclamp_${$ui_lineClamp}`]]: !!$ui_lineClamp,
|
|
33
36
|
[style[`lineheight_${$ui_lineHeight}`]]: !!$ui_lineHeight,
|
|
34
37
|
[style[`display_${$ui_display}`]]: !!$ui_display,
|
|
35
|
-
[style[`font_${$
|
|
38
|
+
[style[`font_${$ui_weight}`]]: !!$ui_weight,
|
|
36
39
|
[style[`fontStyles_${$ui_typeFace}`]]: !!$ui_typeFace,
|
|
37
40
|
[style[`textalign_${$ui_textAlign}`]]: !!$ui_textAlign,
|
|
38
41
|
[style[`letterspacing_${$ui_letterSpacing}`]]: !!$ui_letterSpacing,
|
|
39
42
|
[style[`transform_${$ui_transform}`]]: !!$ui_transform,
|
|
40
43
|
[style[`decoration_${$ui_decoration}`]]: !!$ui_decoration,
|
|
41
|
-
[$ui_className]: !!$ui_className
|
|
44
|
+
[$ui_className]: !!$ui_className,
|
|
45
|
+
[style[`wordBreak_${$ui_wordBreak}`]]: !!$ui_wordBreak,
|
|
46
|
+
[style[`wordWrap_${$ui_wordWrap}`]]: !!$ui_wordWrap,
|
|
47
|
+
[style[`whiteSpace_${$ui_whiteSpace}`]]: !!$ui_whiteSpace
|
|
42
48
|
});
|
|
43
49
|
return {
|
|
44
50
|
typographyClass
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const defaultProps = {
|
|
2
2
|
$ui_className: '',
|
|
3
3
|
$ui_tagName: 'div',
|
|
4
|
-
$
|
|
5
|
-
$
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
$flag_reset: false,
|
|
5
|
+
$flag_dotted: false,
|
|
6
|
+
$tagAttributes_text: {},
|
|
7
|
+
$a11yAttributes_text: {}
|
|
8
8
|
};
|
|
@@ -3,10 +3,10 @@ export const propTypes = {
|
|
|
3
3
|
children: PropTypes.node,
|
|
4
4
|
$ui_className: PropTypes.string,
|
|
5
5
|
$ui_tagName: PropTypes.string,
|
|
6
|
-
$
|
|
7
|
-
$
|
|
6
|
+
$flag_reset: PropTypes.bool,
|
|
7
|
+
$flag_dotted: PropTypes.bool,
|
|
8
8
|
$ui_display: PropTypes.oneOf(['block', 'inlineBlock', 'inline', 'initial']),
|
|
9
|
-
$
|
|
9
|
+
$ui_weight: PropTypes.oneOf(['regular', 'light', 'semibold', 'bold']),
|
|
10
10
|
$ui_textAlign: PropTypes.oneOf(['left', 'right', 'center', 'justify']),
|
|
11
11
|
$ui_transform: PropTypes.oneOf(['default', 'upper', 'lower', 'capital']),
|
|
12
12
|
$ui_lineClamp: PropTypes.oneOf(['1', '2', '3', '4', '5']),
|
|
@@ -15,10 +15,13 @@ export const propTypes = {
|
|
|
15
15
|
$ui_size: PropTypes.oneOf(['7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '28', '29', '30', '32', '34', '35', '36', '40', '50', 'inherit']),
|
|
16
16
|
$ui_lineHeight: PropTypes.oneOf(['0', '1', '8', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '27', '28', '29', '30', '32', '33', '34', '35', '36', '38', '40', '41', '42', '45', '50', '52', '54', '55', '60', '70', '75', '120', 'inherit']),
|
|
17
17
|
$ui_letterSpacing: PropTypes.oneOf(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '2', '4', 'inherit']),
|
|
18
|
+
$ui_wordBreak: PropTypes.oneOf(['breakAll', 'keepAll', 'breakWord']),
|
|
19
|
+
$ui_wordWrap: PropTypes.oneOf(['normal', 'break']),
|
|
20
|
+
$ui_whiteSpace: PropTypes.oneOf(['normal', 'noWrap', 'pre', 'preLine', 'preWrap']),
|
|
18
21
|
$i18n_dataTitle: PropTypes.string,
|
|
19
22
|
testId: PropTypes.string,
|
|
20
23
|
customId: PropTypes.string,
|
|
21
24
|
customStyle: PropTypes.object,
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
$a11yAttributes_text: PropTypes.object,
|
|
26
|
+
$tagAttributes_text: PropTypes.object
|
|
24
27
|
};
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
color: var(--zdt_datetime_invalid_text);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.invalidDate.sunday {
|
|
125
|
+
.invalidDate.sunday,.inActiveDate.sunday:hover {
|
|
126
126
|
color: var(--zdt_datetime_invaliddate_text);
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -147,7 +147,18 @@
|
|
|
147
147
|
background-color: var(--zdt_datetime_selected_bg);
|
|
148
148
|
border-radius: 50%;
|
|
149
149
|
}
|
|
150
|
+
.inActiveDate{
|
|
151
|
+
color: var(--zdt_datetime_invalid_text);
|
|
152
|
+
cursor: no-drop;
|
|
153
|
+
}
|
|
154
|
+
.inActiveDate:hover
|
|
155
|
+
{
|
|
156
|
+
color: var(--zdt_datetime_invalid_text);
|
|
157
|
+
}
|
|
158
|
+
.inActiveDate:hover, .inActiveDate.sunday:hover{
|
|
159
|
+
background-color: var(--zdt_datetime_inactivedate_hover_bg);
|
|
150
160
|
|
|
161
|
+
}
|
|
151
162
|
|
|
152
163
|
|
|
153
164
|
.timesection {
|
|
@@ -9,9 +9,9 @@ exports["default"] = exports.Span = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = require("
|
|
12
|
+
var _propTypes = require("./props/propTypes");
|
|
13
13
|
|
|
14
|
-
var _defaultProps = require("
|
|
14
|
+
var _defaultProps = require("./props/defaultProps");
|
|
15
15
|
|
|
16
16
|
var _Layout = require("../Layout");
|
|
17
17
|
|
|
@@ -19,6 +19,8 @@ var _DateTimeModule = _interopRequireDefault(require("../../DateTime/DateTime.mo
|
|
|
19
19
|
|
|
20
20
|
var _common = require("../../utils/datetime/common");
|
|
21
21
|
|
|
22
|
+
var _index = require("../../DateTime/dateFormatUtils/index");
|
|
23
|
+
|
|
22
24
|
var _DaysRow = _interopRequireDefault(require("./DaysRow"));
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -80,7 +82,9 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
80
82
|
dayNamesShort = _this$props.dayNamesShort,
|
|
81
83
|
todayMonth = _this$props.todayMonth,
|
|
82
84
|
todayDate = _this$props.todayDate,
|
|
83
|
-
todayYear = _this$props.todayYear
|
|
85
|
+
todayYear = _this$props.todayYear,
|
|
86
|
+
startDate = _this$props.startDate,
|
|
87
|
+
endDate = _this$props.endDate;
|
|
84
88
|
var userSeeDate = new Date(year, month, 1);
|
|
85
89
|
var userSeeDay = userSeeDate.getDay() + 1;
|
|
86
90
|
var userSeeYear = userSeeDate.getFullYear();
|
|
@@ -109,7 +113,7 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
109
113
|
var dayArr = [];
|
|
110
114
|
var output = null;
|
|
111
115
|
|
|
112
|
-
for (var i = 1; i
|
|
116
|
+
for (var i = 1; i <= 7; i++) {
|
|
113
117
|
var tdclass = "".concat(_DateTimeModule["default"].datesStr, " ").concat(_DateTimeModule["default"].grid);
|
|
114
118
|
|
|
115
119
|
if (i === 1) {
|
|
@@ -136,7 +140,9 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
136
140
|
userSeeMonth: userSeeMonth,
|
|
137
141
|
userSeeYear: userSeeYear,
|
|
138
142
|
dataId: isSelectedDay ? "".concat(dataId, "_dateSelected") : "".concat(dataId, "_date"),
|
|
139
|
-
isToday: isToday
|
|
143
|
+
isToday: isToday,
|
|
144
|
+
startDate: startDate,
|
|
145
|
+
endDate: endDate
|
|
140
146
|
});
|
|
141
147
|
incremday++;
|
|
142
148
|
} else if (incremleti < userSeeDay) {
|
|
@@ -162,7 +168,9 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
162
168
|
userSeeMonth: prevMonth,
|
|
163
169
|
userSeeYear: prevYear,
|
|
164
170
|
dataId: isSelectedDay ? "".concat(dataId, "_dateSelected") : "".concat(dataId, "_invalidDate") // isToday={isToday}
|
|
165
|
-
|
|
171
|
+
,
|
|
172
|
+
startDate: startDate,
|
|
173
|
+
endDate: endDate
|
|
166
174
|
});
|
|
167
175
|
} else if (incremleti > monthEnd) {
|
|
168
176
|
var nextMonth = userSeeMonth + 1;
|
|
@@ -186,7 +194,9 @@ var CalendarView = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
186
194
|
userSeeMonth: nextMonth,
|
|
187
195
|
userSeeYear: nextYear,
|
|
188
196
|
dataId: isSelectedDay ? "".concat(dataId, "_dateSelected") : "".concat(dataId, "_invalidDate") //isToday={isToday}
|
|
189
|
-
|
|
197
|
+
,
|
|
198
|
+
startDate: startDate,
|
|
199
|
+
endDate: endDate
|
|
190
200
|
});
|
|
191
201
|
} else {
|
|
192
202
|
output = /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
@@ -266,12 +276,36 @@ var Span = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
266
276
|
i = _this$props3.i,
|
|
267
277
|
dataId = _this$props3.dataId,
|
|
268
278
|
isActive = _this$props3.isActive,
|
|
269
|
-
isToday = _this$props3.isToday
|
|
279
|
+
isToday = _this$props3.isToday,
|
|
280
|
+
userSeeMonth = _this$props3.userSeeMonth,
|
|
281
|
+
userSeeYear = _this$props3.userSeeYear,
|
|
282
|
+
startDate = _this$props3.startDate,
|
|
283
|
+
endDate = _this$props3.endDate;
|
|
284
|
+
var userSeeDate = new Date(userSeeYear, userSeeMonth, incremday);
|
|
285
|
+
var startDateRange, endDateRange;
|
|
286
|
+
|
|
287
|
+
if (startDate && endDate) {
|
|
288
|
+
startDateRange = new Date(startDate);
|
|
289
|
+
endDateRange = new Date(endDate);
|
|
290
|
+
} else if (!startDate && endDate) {
|
|
291
|
+
startDateRange = new Date((0, _index.getYearDetails)(4).startPoint, 0, 1);
|
|
292
|
+
endDateRange = new Date(endDate);
|
|
293
|
+
} else if (!endDate && startDate) {
|
|
294
|
+
startDateRange = new Date(startDate);
|
|
295
|
+
endDateRange = new Date((0, _index.getYearDetails)(4).endPoint, 11, 31);
|
|
296
|
+
} else {
|
|
297
|
+
startDateRange = new Date((0, _index.getYearDetails)(4).startPoint, 0, 1);
|
|
298
|
+
endDateRange = new Date((0, _index.getYearDetails)(4).endPoint, 11, 31);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
startDateRange = new Date(startDateRange.getFullYear(), startDateRange.getMonth(), startDateRange.getDate());
|
|
302
|
+
endDateRange = new Date(endDateRange.getFullYear(), endDateRange.getMonth(), endDateRange.getDate());
|
|
303
|
+
var isActiveDate = startDateRange <= userSeeDate && endDateRange >= userSeeDate;
|
|
270
304
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
271
305
|
dataId: dataId,
|
|
272
|
-
className: "".concat(tdclass, " ").concat(isActive ? _DateTimeModule["default"].active : '', " ").concat(isToday ? _DateTimeModule["default"].today : ''),
|
|
306
|
+
className: "".concat(tdclass, " ").concat(isActive && isActiveDate ? _DateTimeModule["default"].active : '', " ").concat(isToday ? _DateTimeModule["default"].today : '', " ").concat(!isActiveDate ? _DateTimeModule["default"].inActiveDate : ''),
|
|
273
307
|
key: i,
|
|
274
|
-
onClick: this.handleSelectChild,
|
|
308
|
+
onClick: isActiveDate ? this.handleSelectChild : undefined,
|
|
275
309
|
"aria-label": incremday
|
|
276
310
|
}, incremday);
|
|
277
311
|
}
|
|
@@ -9,9 +9,9 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = require("
|
|
12
|
+
var _propTypes = require("./props/propTypes");
|
|
13
13
|
|
|
14
|
-
var _defaultProps = require("
|
|
14
|
+
var _defaultProps = require("./props/defaultProps");
|
|
15
15
|
|
|
16
16
|
var _datetimejs = _interopRequireDefault(require("@zohodesk/datetimejs"));
|
|
17
17
|
|
|
@@ -751,7 +751,9 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
751
751
|
positionsOffset = _this$props7.positionsOffset,
|
|
752
752
|
targetOffset = _this$props7.targetOffset,
|
|
753
753
|
isRestrictScroll = _this$props7.isRestrictScroll,
|
|
754
|
-
dropBoxPortalId = _this$props7.dropBoxPortalId
|
|
754
|
+
dropBoxPortalId = _this$props7.dropBoxPortalId,
|
|
755
|
+
startDate = _this$props7.startDate,
|
|
756
|
+
endDate = _this$props7.endDate;
|
|
755
757
|
var _i18nKeys$timeText = i18nKeys.timeText,
|
|
756
758
|
timeText = _i18nKeys$timeText === void 0 ? 'Time' : _i18nKeys$timeText,
|
|
757
759
|
_i18nKeys$submitText = i18nKeys.submitText,
|
|
@@ -801,7 +803,9 @@ var DateTime = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
801
803
|
dayNamesShort: dayNamesShort,
|
|
802
804
|
todayDate: todayDate,
|
|
803
805
|
todayMonth: todayMonth,
|
|
804
|
-
todayYear: todayYear
|
|
806
|
+
todayYear: todayYear,
|
|
807
|
+
startDate: startDate,
|
|
808
|
+
endDate: endDate
|
|
805
809
|
}), isDateTimeField ? /*#__PURE__*/_react["default"].createElement(_Time["default"], {
|
|
806
810
|
timeText: timeText,
|
|
807
811
|
dataId: dataId,
|
|
@@ -9,9 +9,9 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = require("
|
|
12
|
+
var _propTypes = require("./props/propTypes");
|
|
13
13
|
|
|
14
|
-
var _defaultProps = require("
|
|
14
|
+
var _defaultProps = require("./props/defaultProps");
|
|
15
15
|
|
|
16
16
|
var _Layout = require("../Layout");
|
|
17
17
|
|
|
@@ -9,9 +9,9 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = require("
|
|
12
|
+
var _propTypes = require("./props/propTypes");
|
|
13
13
|
|
|
14
|
-
var _defaultProps = require("
|
|
14
|
+
var _defaultProps = require("./props/defaultProps");
|
|
15
15
|
|
|
16
16
|
var _datetimejs = _interopRequireDefault(require("@zohodesk/datetimejs"));
|
|
17
17
|
|
|
@@ -1008,7 +1008,9 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1008
1008
|
dropBoxPortalId = _this$props11.dropBoxPortalId,
|
|
1009
1009
|
a11y = _this$props11.a11y,
|
|
1010
1010
|
boxSize = _this$props11.boxSize,
|
|
1011
|
-
onError = _this$props11.onError
|
|
1011
|
+
onError = _this$props11.onError,
|
|
1012
|
+
startDate = _this$props11.startDate,
|
|
1013
|
+
endDate = _this$props11.endDate;
|
|
1012
1014
|
var _this$state5 = this.state,
|
|
1013
1015
|
_this$state5$selected = _this$state5.selected,
|
|
1014
1016
|
value = _this$state5$selected === void 0 ? '' : _this$state5$selected,
|
|
@@ -1097,7 +1099,9 @@ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1097
1099
|
isRestrictScroll: isRestrictScroll,
|
|
1098
1100
|
dropBoxPortalId: dropBoxPortalId,
|
|
1099
1101
|
boxSize: boxSize,
|
|
1100
|
-
onError: onError
|
|
1102
|
+
onError: onError,
|
|
1103
|
+
startDate: startDate,
|
|
1104
|
+
endDate: endDate
|
|
1101
1105
|
}));
|
|
1102
1106
|
}
|
|
1103
1107
|
}]);
|
|
@@ -9,7 +9,7 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _propTypes = require("
|
|
12
|
+
var _propTypes = require("./props/propTypes");
|
|
13
13
|
|
|
14
14
|
var _DateTimeModule = _interopRequireDefault(require("../../DateTime/DateTime.module.css"));
|
|
15
15
|
|