@zohodesk/components 1.0.0-temp-211.2 → 1.0.0-temp-217
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/propValidation_report.html +1 -1
- package/README.md +118 -31
- package/es/AvatarTeam/props/propTypes.js +2 -1
- package/es/CheckBox/CheckBox.js +6 -5
- package/es/CheckBox/CheckBox.module.css +5 -2
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +64 -64
- package/es/DateTime/CalendarView.js +17 -12
- package/es/DateTime/DateTime.js +26 -8
- package/es/DateTime/DateTime.module.css +5 -5
- package/es/DateTime/DateWidget.js +13 -2
- package/es/DateTime/DaysRow.js +3 -2
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +7 -7
- package/es/DateTime/props/defaultProps.js +9 -3
- package/es/DateTime/props/propTypes.js +16 -4
- package/es/DropBox/DropBoxElement/DropBoxElement.js +3 -1
- package/es/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +1 -0
- package/es/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +1 -0
- package/es/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +1 -0
- package/es/ListItem/ListItemWithAvatar.js +7 -3
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2 -2
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +1 -1
- package/es/ListItem/props/propTypes.js +6 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +4 -2
- package/es/MultiSelect/AdvancedMultiSelect.js +4 -2
- package/es/MultiSelect/MultiSelect.js +11 -3
- package/es/MultiSelect/props/propTypes.js +6 -3
- package/es/Popup/Popup.js +125 -7
- package/es/Popup/intersectionObserver.js +49 -0
- package/es/Popup/props/propTypes.js +30 -0
- package/es/Radio/Radio.js +9 -7
- package/es/Radio/Radio.module.css +1 -1
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +77 -77
- package/es/Responsive/ResizeObserver.js +21 -85
- package/es/Responsive/ResizeObserverWithPolyfill.js +140 -0
- package/es/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +1 -0
- package/es/Select/GroupSelect.js +15 -3
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Select/props/propTypes.js +5 -1
- package/es/Tag/Tag.js +10 -3
- package/es/Tag/props/defaultProps.js +2 -1
- package/es/Tag/props/propTypes.js +7 -1
- package/es/TextBox/TextBox.js +1 -1
- package/es/Textarea/Textarea.js +4 -2
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +41 -41
- package/es/Textarea/props/propTypes.js +2 -1
- package/es/Typography/Typography.js +38 -0
- package/es/Typography/css/Typography.module.css +489 -0
- package/es/Typography/css/cssJSLogic.js +56 -0
- package/es/Typography/props/defaultProps.js +8 -0
- package/es/Typography/props/propTypes.js +27 -0
- package/es/Typography/utils/index.js +50 -0
- package/es/index.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +0 -6
- package/es/v1/DateTime/CalendarView.js +9 -6
- package/es/v1/DateTime/DateTime.js +18 -4
- package/es/v1/DateTime/DateWidget.js +5 -1
- package/es/v1/DateTime/DaysRow.js +3 -2
- package/es/v1/DateTime/props/defaultProps.js +9 -3
- package/es/v1/DateTime/props/propTypes.js +11 -4
- package/es/v1/MultiSelect/MultiSelect.js +7 -1
- package/es/v1/Select/GroupSelect.js +5 -0
- package/es/v1/Typography/Typography.js +1 -1
- package/lib/AvatarTeam/props/propTypes.js +3 -1
- package/lib/CheckBox/CheckBox.js +5 -4
- package/lib/CheckBox/CheckBox.module.css +5 -2
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +64 -64
- package/lib/DateTime/CalendarView.js +17 -12
- package/lib/DateTime/DateTime.js +38 -9
- package/lib/DateTime/DateTime.module.css +5 -5
- package/lib/DateTime/DateWidget.js +13 -2
- package/lib/DateTime/DaysRow.js +3 -2
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +7 -7
- package/lib/DateTime/props/defaultProps.js +9 -3
- package/lib/DateTime/props/propTypes.js +16 -4
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +3 -1
- package/lib/DropBox/DropBoxElement/__tests__/__snapshots__/DropBoxElement.spec.js.snap +1 -0
- package/lib/DropBox/__tests__/__snapshots__/DropBox.spec.js.snap +1 -0
- package/lib/DropDown/__tests__/__snapshots__/DropDown.spec.js.snap +1 -0
- package/lib/ListItem/ListItemWithAvatar.js +8 -4
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2 -2
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +1 -1
- package/lib/ListItem/props/propTypes.js +8 -1
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +4 -2
- package/lib/MultiSelect/MultiSelect.js +11 -3
- package/lib/MultiSelect/props/propTypes.js +8 -6
- package/lib/Popup/Popup.js +135 -8
- package/lib/Popup/intersectionObserver.js +72 -0
- package/lib/Popup/props/propTypes.js +51 -0
- package/lib/Radio/Radio.js +10 -7
- package/lib/Radio/Radio.module.css +1 -1
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +77 -77
- package/lib/Responsive/ResizeObserver.js +20 -88
- package/lib/Responsive/ResizeObserverWithPolyfill.js +168 -0
- package/lib/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +1 -0
- package/lib/Select/GroupSelect.js +17 -5
- package/lib/Select/props/defaultProps.js +2 -1
- package/lib/Select/props/propTypes.js +5 -1
- package/lib/Tag/Tag.js +10 -5
- package/lib/Tag/props/defaultProps.js +2 -1
- package/lib/Tag/props/propTypes.js +9 -1
- package/lib/TextBox/TextBox.js +1 -1
- package/lib/Textarea/Textarea.js +4 -2
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +41 -41
- package/lib/Textarea/props/propTypes.js +2 -1
- package/lib/Typography/Typography.js +56 -0
- package/lib/Typography/css/Typography.module.css +489 -0
- package/lib/Typography/css/cssJSLogic.js +48 -0
- package/lib/Typography/props/defaultProps.js +15 -0
- package/lib/Typography/props/propTypes.js +38 -0
- package/lib/Typography/utils/index.js +59 -0
- package/lib/index.js +1 -1
- package/lib/v1/AppContainer/AppContainer.js +0 -12
- package/lib/v1/DateTime/CalendarView.js +9 -6
- package/lib/v1/DateTime/DateTime.js +27 -4
- package/lib/v1/DateTime/DateWidget.js +5 -1
- package/lib/v1/DateTime/DaysRow.js +3 -2
- package/lib/v1/DateTime/props/defaultProps.js +9 -3
- package/lib/v1/DateTime/props/propTypes.js +11 -4
- package/lib/v1/MultiSelect/MultiSelect.js +7 -1
- package/lib/v1/Select/GroupSelect.js +5 -0
- package/lib/v1/Typography/Typography.js +2 -2
- package/package.json +8 -8
- package/propValidationArg.json +1 -1
- /package/es/v1/Typography/css/{Typography.module.css → v1_Typography.module.css} +0 -0
- /package/lib/v1/Typography/css/{Typography.module.css → v1_Typography.module.css} +0 -0
package/es/DateTime/DateTime.js
CHANGED
|
@@ -650,10 +650,15 @@ export default class DateTime extends React.PureComponent {
|
|
|
650
650
|
targetOffset,
|
|
651
651
|
isRestrictScroll,
|
|
652
652
|
dropBoxPortalId,
|
|
653
|
-
|
|
653
|
+
renderCustomHeader,
|
|
654
|
+
renderCustomFooter,
|
|
655
|
+
customProps = {},
|
|
656
|
+
weekStartDay,
|
|
657
|
+
holidays
|
|
654
658
|
} = this.props;
|
|
655
659
|
const {
|
|
656
|
-
TimeProps = {}
|
|
660
|
+
TimeProps = {},
|
|
661
|
+
DropBoxProps = {}
|
|
657
662
|
} = customProps;
|
|
658
663
|
const {
|
|
659
664
|
timeText = 'Time',
|
|
@@ -669,12 +674,22 @@ export default class DateTime extends React.PureComponent {
|
|
|
669
674
|
dayNamesShort = dayNamesShortDefault
|
|
670
675
|
} = i18nKeys;
|
|
671
676
|
const showmonthtxt = title(date, year, month, monthNames);
|
|
677
|
+
let customDayNames = dayNames,
|
|
678
|
+
customDayNamesShort = dayNamesShort,
|
|
679
|
+
customizedHolidays = holidays;
|
|
680
|
+
|
|
681
|
+
if (weekStartDay !== 0) {
|
|
682
|
+
customDayNames = [...dayNames.slice(weekStartDay), ...dayNames.slice(0, weekStartDay)];
|
|
683
|
+
customDayNamesShort = [...dayNamesShort.slice(weekStartDay), ...dayNamesShort.slice(0, weekStartDay)];
|
|
684
|
+
customizedHolidays = holidays.map(dayIndex => customDayNames.indexOf(dayNames[dayIndex]));
|
|
685
|
+
}
|
|
686
|
+
|
|
672
687
|
const childEle = /*#__PURE__*/React.createElement("div", {
|
|
673
688
|
className: `${style.container} ${innerClass}`,
|
|
674
689
|
"data-id": `${dataId}_Calendar`,
|
|
675
690
|
"data-test-id": `${dataId}_Calendar`,
|
|
676
691
|
onClick: this.closePopup
|
|
677
|
-
}, /*#__PURE__*/React.createElement(DateTimePopupHeader, {
|
|
692
|
+
}, renderCustomHeader, /*#__PURE__*/React.createElement(DateTimePopupHeader, {
|
|
678
693
|
onOpenYearView: this.handleOpenYearView,
|
|
679
694
|
showMonthTxt: showmonthtxt,
|
|
680
695
|
isYearView: isYearView,
|
|
@@ -690,11 +705,13 @@ export default class DateTime extends React.PureComponent {
|
|
|
690
705
|
year: year,
|
|
691
706
|
month: month,
|
|
692
707
|
onSelect: this.dateSelect,
|
|
693
|
-
dayNames:
|
|
694
|
-
dayNamesShort:
|
|
708
|
+
dayNames: customDayNames,
|
|
709
|
+
dayNamesShort: customDayNamesShort,
|
|
695
710
|
todayDate: todayDate,
|
|
696
711
|
todayMonth: todayMonth,
|
|
697
|
-
todayYear: todayYear
|
|
712
|
+
todayYear: todayYear,
|
|
713
|
+
weekStartDay: weekStartDay,
|
|
714
|
+
holidays: customizedHolidays
|
|
698
715
|
}), isDateTimeField ? /*#__PURE__*/React.createElement(Time, {
|
|
699
716
|
timeText: timeText,
|
|
700
717
|
dataId: dataId,
|
|
@@ -728,7 +745,7 @@ export default class DateTime extends React.PureComponent {
|
|
|
728
745
|
monthNames: monthNames,
|
|
729
746
|
monthNamesShort: monthNamesShort,
|
|
730
747
|
isMonthOpen: isMonthOpen
|
|
731
|
-
})) : null));
|
|
748
|
+
})) : null), renderCustomFooter);
|
|
732
749
|
return isDefaultPosition ? /*#__PURE__*/React.createElement("div", {
|
|
733
750
|
className: `${style.dropBox} ${className}`,
|
|
734
751
|
"data-id": `${dataId}_dateBoxContainer`,
|
|
@@ -752,7 +769,8 @@ export default class DateTime extends React.PureComponent {
|
|
|
752
769
|
positionsOffset: positionsOffset,
|
|
753
770
|
targetOffset: targetOffset,
|
|
754
771
|
isRestrictScroll: isRestrictScroll,
|
|
755
|
-
portalId: dropBoxPortalId
|
|
772
|
+
portalId: dropBoxPortalId,
|
|
773
|
+
...DropBoxProps
|
|
756
774
|
}, /*#__PURE__*/React.createElement(Box, null, childEle)) : null;
|
|
757
775
|
}
|
|
758
776
|
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
margin-bottom: 0 ;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.
|
|
116
|
-
.
|
|
117
|
-
.invalidDate.
|
|
115
|
+
.holiday,
|
|
116
|
+
.holiday:hover,
|
|
117
|
+
.invalidDate.holiday:hover {
|
|
118
118
|
color: var(--zdt_datetime_invalid_hover_text);
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
color: var(--zdt_datetime_invalid_text);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.invalidDate.
|
|
125
|
+
.invalidDate.holiday,.inActiveDate.holiday:hover {
|
|
126
126
|
color: var(--zdt_datetime_invaliddate_text);
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -155,7 +155,7 @@ cursor: no-drop;
|
|
|
155
155
|
{
|
|
156
156
|
color: var(--zdt_datetime_invalid_text);
|
|
157
157
|
}
|
|
158
|
-
.inActiveDate:hover, .inActiveDate.
|
|
158
|
+
.inActiveDate:hover, .inActiveDate.holiday:hover{
|
|
159
159
|
background-color: var(--zdt_datetime_inactivedate_hover_bg);
|
|
160
160
|
|
|
161
161
|
}
|
|
@@ -128,7 +128,8 @@ class DateWidgetComponent extends React.Component {
|
|
|
128
128
|
dateFormat = '',
|
|
129
129
|
is24Hour,
|
|
130
130
|
isHideCurrentYear,
|
|
131
|
-
getPopupProps
|
|
131
|
+
getPopupProps,
|
|
132
|
+
onDropboxClose
|
|
132
133
|
} = this.props;
|
|
133
134
|
|
|
134
135
|
if (validation && validation.validate) {
|
|
@@ -162,6 +163,8 @@ class DateWidgetComponent extends React.Component {
|
|
|
162
163
|
if (prevProps.isPopupReady !== isPopupReady) {
|
|
163
164
|
if (isPopupReady) {
|
|
164
165
|
this.resetLocalDate && this.resetLocalDate();
|
|
166
|
+
} else {
|
|
167
|
+
typeof onDropboxClose === 'function' && onDropboxClose();
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
if (getPopupProps) {
|
|
@@ -1004,6 +1007,10 @@ class DateWidgetComponent extends React.Component {
|
|
|
1004
1007
|
a11y,
|
|
1005
1008
|
boxSize,
|
|
1006
1009
|
onError,
|
|
1010
|
+
renderCustomHeader,
|
|
1011
|
+
renderCustomFooter,
|
|
1012
|
+
weekStartDay,
|
|
1013
|
+
holidays,
|
|
1007
1014
|
customProps = {}
|
|
1008
1015
|
} = this.props;
|
|
1009
1016
|
const {
|
|
@@ -1106,7 +1113,11 @@ class DateWidgetComponent extends React.Component {
|
|
|
1106
1113
|
dropBoxPortalId: dropBoxPortalId,
|
|
1107
1114
|
boxSize: boxSize,
|
|
1108
1115
|
onError: onError,
|
|
1109
|
-
|
|
1116
|
+
renderCustomHeader: renderCustomHeader,
|
|
1117
|
+
renderCustomFooter: renderCustomFooter,
|
|
1118
|
+
customProps: DateTimeProps,
|
|
1119
|
+
weekStartDay: weekStartDay,
|
|
1120
|
+
holidays: holidays
|
|
1110
1121
|
}));
|
|
1111
1122
|
}
|
|
1112
1123
|
|
package/es/DateTime/DaysRow.js
CHANGED
|
@@ -13,7 +13,8 @@ export default class DaysRow extends PureComponent {
|
|
|
13
13
|
render() {
|
|
14
14
|
const {
|
|
15
15
|
dayNames,
|
|
16
|
-
dayNamesShort
|
|
16
|
+
dayNamesShort,
|
|
17
|
+
holidays
|
|
17
18
|
} = this.props;
|
|
18
19
|
return /*#__PURE__*/React.createElement(Container, {
|
|
19
20
|
alignBox: "row",
|
|
@@ -21,7 +22,7 @@ export default class DaysRow extends PureComponent {
|
|
|
21
22
|
className: style.days
|
|
22
23
|
}, dayNames.map((dayName, index) => /*#__PURE__*/React.createElement(Box, {
|
|
23
24
|
key: dayName,
|
|
24
|
-
className: `${style.daysStr} ${style.grid} ${index
|
|
25
|
+
className: `${style.daysStr} ${style.grid} ${holidays.includes(index) ? style.holiday : ''}`,
|
|
25
26
|
"data-title": dayName,
|
|
26
27
|
"aria-label": dayName
|
|
27
28
|
}, dayNamesShort[index])));
|
|
@@ -96,7 +96,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
96
96
|
>
|
|
97
97
|
<div
|
|
98
98
|
aria-label="Sunday"
|
|
99
|
-
class="daysStr grid
|
|
99
|
+
class="daysStr grid holiday shrinkOff"
|
|
100
100
|
data-id="boxComponent"
|
|
101
101
|
data-selector-id="box"
|
|
102
102
|
data-test-id="boxComponent"
|
|
@@ -178,7 +178,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
178
178
|
>
|
|
179
179
|
<div
|
|
180
180
|
aria-label="25"
|
|
181
|
-
class="datesStr grid
|
|
181
|
+
class="datesStr grid holiday invalidDate shrinkOff"
|
|
182
182
|
data-id="dateTime_invalidDate"
|
|
183
183
|
data-selector-id="box"
|
|
184
184
|
data-test-id="dateTime_invalidDate"
|
|
@@ -248,7 +248,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
248
248
|
>
|
|
249
249
|
<div
|
|
250
250
|
aria-label="2"
|
|
251
|
-
class="datesStr grid
|
|
251
|
+
class="datesStr grid holiday shrinkOff"
|
|
252
252
|
data-id="dateTime_date"
|
|
253
253
|
data-selector-id="box"
|
|
254
254
|
data-test-id="dateTime_date"
|
|
@@ -318,7 +318,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
318
318
|
>
|
|
319
319
|
<div
|
|
320
320
|
aria-label="9"
|
|
321
|
-
class="datesStr grid
|
|
321
|
+
class="datesStr grid holiday shrinkOff"
|
|
322
322
|
data-id="dateTime_date"
|
|
323
323
|
data-selector-id="box"
|
|
324
324
|
data-test-id="dateTime_date"
|
|
@@ -388,7 +388,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
388
388
|
>
|
|
389
389
|
<div
|
|
390
390
|
aria-label="16"
|
|
391
|
-
class="datesStr grid
|
|
391
|
+
class="datesStr grid holiday shrinkOff"
|
|
392
392
|
data-id="dateTime_date"
|
|
393
393
|
data-selector-id="box"
|
|
394
394
|
data-test-id="dateTime_date"
|
|
@@ -458,7 +458,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
458
458
|
>
|
|
459
459
|
<div
|
|
460
460
|
aria-label="23"
|
|
461
|
-
class="datesStr grid
|
|
461
|
+
class="datesStr grid holiday shrinkOff"
|
|
462
462
|
data-id="dateTime_date"
|
|
463
463
|
data-selector-id="box"
|
|
464
464
|
data-test-id="dateTime_date"
|
|
@@ -528,7 +528,7 @@ exports[`DateTime rendering the isActive is true and isDefaultPosition is true 1
|
|
|
528
528
|
>
|
|
529
529
|
<div
|
|
530
530
|
aria-label="30"
|
|
531
|
-
class="datesStr grid
|
|
531
|
+
class="datesStr grid holiday shrinkOff"
|
|
532
532
|
data-id="dateTime_date"
|
|
533
533
|
data-selector-id="box"
|
|
534
534
|
data-test-id="dateTime_date"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export const CalendarView_defaultProps = {
|
|
2
2
|
dataId: 'dateContainer',
|
|
3
|
-
needBorder: true
|
|
3
|
+
needBorder: true,
|
|
4
|
+
weekStartDay: 0,
|
|
5
|
+
holidays: [0]
|
|
4
6
|
};
|
|
5
7
|
export const Span_defaultProps = {
|
|
6
8
|
dataId: 'calendar-view'
|
|
@@ -21,7 +23,9 @@ export const DateTime_defaultProps = {
|
|
|
21
23
|
is24Hour: false,
|
|
22
24
|
isDefaultPosition: false,
|
|
23
25
|
customDateFormat: null,
|
|
24
|
-
customProps: {}
|
|
26
|
+
customProps: {},
|
|
27
|
+
weekStartDay: 0,
|
|
28
|
+
holidays: [0]
|
|
25
29
|
};
|
|
26
30
|
export const DateWidget_defaultProps = {
|
|
27
31
|
borderColor: 'default',
|
|
@@ -44,7 +48,9 @@ export const DateWidget_defaultProps = {
|
|
|
44
48
|
needErrorOnBlur: false,
|
|
45
49
|
isEditable: false,
|
|
46
50
|
iconOnHover: false,
|
|
47
|
-
is24Hour: false
|
|
51
|
+
is24Hour: false,
|
|
52
|
+
weekStartDay: 0,
|
|
53
|
+
holidays: [0]
|
|
48
54
|
};
|
|
49
55
|
export const YearView_defaultProps = {
|
|
50
56
|
dataId: 'dateContainer',
|
|
@@ -11,7 +11,9 @@ export const CalendarView_propTypes = {
|
|
|
11
11
|
dayNamesShort: PropTypes.array,
|
|
12
12
|
todayMonth: PropTypes.string,
|
|
13
13
|
todayDate: PropTypes.string,
|
|
14
|
-
todayYear: PropTypes.string
|
|
14
|
+
todayYear: PropTypes.string,
|
|
15
|
+
weekStartDay: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]),
|
|
16
|
+
holidays: PropTypes.arrayOf(PropTypes.number)
|
|
15
17
|
};
|
|
16
18
|
export const Span_propTypes = {
|
|
17
19
|
dataId: PropTypes.string,
|
|
@@ -73,7 +75,11 @@ export const DateTime_propTypes = {
|
|
|
73
75
|
targetOffset: PropTypes.string,
|
|
74
76
|
isRestrictScroll: PropTypes.bool,
|
|
75
77
|
dropBoxPortalId: PropTypes.string,
|
|
76
|
-
|
|
78
|
+
renderCustomHeader: PropTypes.node,
|
|
79
|
+
renderCustomFooter: PropTypes.node,
|
|
80
|
+
customProps: PropTypes.object,
|
|
81
|
+
weekStartDay: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]),
|
|
82
|
+
holidays: PropTypes.arrayOf(PropTypes.number)
|
|
77
83
|
};
|
|
78
84
|
export const DateWidget_propTypes = {
|
|
79
85
|
borderColor: PropTypes.oneOf(['transparent', 'default']),
|
|
@@ -142,7 +148,12 @@ export const DateWidget_propTypes = {
|
|
|
142
148
|
dropBoxPortalId: PropTypes.string,
|
|
143
149
|
a11y: PropTypes.object,
|
|
144
150
|
getPopupProps: PropTypes.func,
|
|
145
|
-
|
|
151
|
+
renderCustomHeader: PropTypes.node,
|
|
152
|
+
renderCustomFooter: PropTypes.node,
|
|
153
|
+
onDropboxClose: PropTypes.func,
|
|
154
|
+
customProps: PropTypes.object,
|
|
155
|
+
weekStartDay: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]),
|
|
156
|
+
holidays: PropTypes.arrayOf(PropTypes.number)
|
|
146
157
|
};
|
|
147
158
|
export const YearView_propTypes = {
|
|
148
159
|
onSelectMonth: PropTypes.func,
|
|
@@ -169,7 +180,8 @@ export const DateTimePopupHeader_propTypes = {
|
|
|
169
180
|
};
|
|
170
181
|
export const DaysRow_propTypes = {
|
|
171
182
|
dayNames: PropTypes.array,
|
|
172
|
-
dayNamesShort: PropTypes.object
|
|
183
|
+
dayNamesShort: PropTypes.object,
|
|
184
|
+
holidays: PropTypes.arrayOf(PropTypes.number)
|
|
173
185
|
};
|
|
174
186
|
export const Time_propTypes = {
|
|
175
187
|
timeText: PropTypes.string,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/no-unknown-property */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import useDropboxPosCalc from './useDropboxPosCalc';
|
|
3
4
|
import cssJSLogic from './css/cssJSLogic';
|
|
@@ -108,7 +109,8 @@ export default function DropBoxElement(props) {
|
|
|
108
109
|
"aria-labelledby": ariaLabelledby,
|
|
109
110
|
tabIndex: tabIndex,
|
|
110
111
|
onAnimationEnd: isAnimate && FireOnAnimationEnd,
|
|
111
|
-
"data-a11y-focus-main-area": true
|
|
112
|
+
"data-a11y-focus-main-area": true,
|
|
113
|
+
"dot-ui-element": "dropbox"
|
|
112
114
|
}, /*#__PURE__*/React.createElement("div", {
|
|
113
115
|
tabIndex: "-1",
|
|
114
116
|
className: `${subContainerClass} ${style[`${palette}Palette`]}`,
|
|
@@ -78,7 +78,9 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
78
78
|
} = this.props;
|
|
79
79
|
let {
|
|
80
80
|
ListItemProps = {},
|
|
81
|
-
ContainerProps = {}
|
|
81
|
+
ContainerProps = {},
|
|
82
|
+
AvatarTeamProps = {},
|
|
83
|
+
AvatarProps = {}
|
|
82
84
|
} = customProps;
|
|
83
85
|
let {
|
|
84
86
|
customListItem = '',
|
|
@@ -127,7 +129,8 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
127
129
|
customClass: {
|
|
128
130
|
customAvatar: customAvatar,
|
|
129
131
|
customAvatarTeam: customAvatarTeam
|
|
130
|
-
}
|
|
132
|
+
},
|
|
133
|
+
...AvatarTeamProps
|
|
131
134
|
}) : /*#__PURE__*/React.createElement(Avatar, {
|
|
132
135
|
name: name,
|
|
133
136
|
size: "small",
|
|
@@ -136,7 +139,8 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
136
139
|
textPalette: isDarkPalette ? 'white' : '',
|
|
137
140
|
needTitle: needAvatarTitle,
|
|
138
141
|
palette: isDarkPalette ? 'info' : avatarPalette,
|
|
139
|
-
customClass: customAvatar
|
|
142
|
+
customClass: customAvatar,
|
|
143
|
+
...AvatarProps
|
|
140
144
|
})) : null, value ? /*#__PURE__*/React.createElement(Box, {
|
|
141
145
|
flexible: true,
|
|
142
146
|
shrink: true,
|
|
@@ -21,7 +21,7 @@ exports[`ListItemWithCheckBox rendering the defult props 1`] = `
|
|
|
21
21
|
aria-checked="false"
|
|
22
22
|
aria-hidden="true"
|
|
23
23
|
class="container pointer primary
|
|
24
|
-
|
|
24
|
+
inflex rowdir vCenter"
|
|
25
25
|
data-id="checkBox"
|
|
26
26
|
data-selector-id="container"
|
|
27
27
|
data-test-id="checkBox"
|
|
@@ -29,7 +29,7 @@ exports[`ListItemWithCheckBox rendering the defult props 1`] = `
|
|
|
29
29
|
tabindex="-1"
|
|
30
30
|
>
|
|
31
31
|
<div
|
|
32
|
-
class="boxContainer medium filled
|
|
32
|
+
class="boxContainer medium filled shrinkOff"
|
|
33
33
|
data-id="boxComponent"
|
|
34
34
|
data-selector-id="box"
|
|
35
35
|
data-test-id="boxComponent"
|
|
@@ -30,7 +30,7 @@ exports[`ListItemWithRadio rendering the defult props 1`] = `
|
|
|
30
30
|
>
|
|
31
31
|
<div
|
|
32
32
|
class="radio
|
|
33
|
-
hoverprimary medium filled centerPathprimary
|
|
33
|
+
hoverprimary medium filled centerPathprimary shrinkOff"
|
|
34
34
|
data-id="boxComponent"
|
|
35
35
|
data-selector-id="box"
|
|
36
36
|
data-test-id="boxComponent"
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { propTypes as AvatarProps } from '../../Avatar/props/propTypes.js';
|
|
3
|
+
import { propTypes as AvatarTeamProps } from '../../AvatarTeam/props/propTypes.js';
|
|
2
4
|
export const ListContainer_Props = {
|
|
3
5
|
active: PropTypes.bool,
|
|
4
6
|
autoHover: PropTypes.bool,
|
|
@@ -101,7 +103,10 @@ export const ListItemWithAvatar_Props = {
|
|
|
101
103
|
}),
|
|
102
104
|
needMultiLineText: PropTypes.bool,
|
|
103
105
|
customProps: PropTypes.shape({
|
|
104
|
-
ListItemProps: PropTypes.object
|
|
106
|
+
ListItemProps: PropTypes.object,
|
|
107
|
+
ContainerProps: PropTypes.object,
|
|
108
|
+
AvatarTeamProps: PropTypes.exact(AvatarTeamProps),
|
|
109
|
+
AvatarProps: PropTypes.exact(AvatarProps)
|
|
105
110
|
})
|
|
106
111
|
};
|
|
107
112
|
export const ListItemWithCheckBox_Props = {
|
|
@@ -875,7 +875,8 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
875
875
|
palette,
|
|
876
876
|
needEffect,
|
|
877
877
|
autoComplete,
|
|
878
|
-
getTargetRef
|
|
878
|
+
getTargetRef,
|
|
879
|
+
isFocus
|
|
879
880
|
} = this.props;
|
|
880
881
|
let {
|
|
881
882
|
clearText = 'Clear all'
|
|
@@ -904,6 +905,7 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
904
905
|
let setAriaId = this.getNextAriaId();
|
|
905
906
|
let ariaErrorId = this.getNextAriaId();
|
|
906
907
|
const isShowClearIcon = !isReadOnly && !isDisabled && selectedGroupOptions.length > 1;
|
|
908
|
+
const isEditable = !(isReadOnly || isDisabled);
|
|
907
909
|
return /*#__PURE__*/React.createElement("div", {
|
|
908
910
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
909
911
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
@@ -920,7 +922,7 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
920
922
|
}, children) : /*#__PURE__*/React.createElement(Container, {
|
|
921
923
|
align: "vertical",
|
|
922
924
|
alignBox: "row",
|
|
923
|
-
className: `${style.container} ${style[size]} ${isActive && needBorder ? style.active : ''} ${needBorder ? style.hasBorder : ''} ${style[`borderColor_${borderColor}`]} ${customClass}`,
|
|
925
|
+
className: `${style.container} ${style[size]} ${isActive && needBorder || isEditable && isFocus && needBorder ? style.active : ''} ${needBorder ? style.hasBorder : ''} ${style[`borderColor_${borderColor}`]} ${customClass}`,
|
|
924
926
|
eleRef: this.selectedOptionContainerRef,
|
|
925
927
|
wrap: "wrap"
|
|
926
928
|
}, /*#__PURE__*/React.createElement(SelectedOptions, {
|
|
@@ -372,7 +372,8 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
372
372
|
isAbsolutePositioningNeeded,
|
|
373
373
|
positionsOffset,
|
|
374
374
|
targetOffset,
|
|
375
|
-
isRestrictScroll
|
|
375
|
+
isRestrictScroll,
|
|
376
|
+
isFocus
|
|
376
377
|
} = this.props;
|
|
377
378
|
let {
|
|
378
379
|
SuggestionsProps = {},
|
|
@@ -414,6 +415,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
414
415
|
disabledOptions
|
|
415
416
|
});
|
|
416
417
|
let isShowClearIcon = !isReadOnly && !isDisabled && isShowClear;
|
|
418
|
+
const isEditable = !(isReadOnly || isDisabled);
|
|
417
419
|
return /*#__PURE__*/React.createElement("div", {
|
|
418
420
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${containerClass}`,
|
|
419
421
|
"data-id": dataIdMultiSelectComp,
|
|
@@ -424,7 +426,7 @@ export class AdvancedMultiSelectComponent extends MultiSelectComponent {
|
|
|
424
426
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
425
427
|
align: "vertical",
|
|
426
428
|
alignBox: "row",
|
|
427
|
-
className: `${style.container} ${style[size]} ${isActive && needBorder ? style.active : ''} ${needBorder ? style.hasBorder : ''} ${needBorder ? !isDisabled ? style[`borderColor_${borderColor}`] : style.borderColor_transparent : ''}`,
|
|
429
|
+
className: `${style.container} ${style[size]} ${isActive && needBorder || isEditable && isFocus && needBorder ? style.active : ''} ${needBorder ? style.hasBorder : ''} ${needBorder ? !isDisabled ? style[`borderColor_${borderColor}`] : style.borderColor_transparent : ''}`,
|
|
428
430
|
eleRef: this.selectedOptionContainerRef,
|
|
429
431
|
wrap: "wrap"
|
|
430
432
|
}, /*#__PURE__*/React.createElement(SelectedOptions, {
|
|
@@ -191,7 +191,13 @@ export class MultiSelectComponent extends React.Component {
|
|
|
191
191
|
} //Need To MultiselectNew Component
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
this.handleComponentDidUpdate(prevProps, prevState);
|
|
194
|
+
this.handleComponentDidUpdate(prevProps, prevState); // if (isPopupOpen && isNextOptions && prevProps.selectedOptions.length !== selectedOptions.length) {
|
|
195
|
+
// let { scrollHeight, clientHeight } = this.suggestionContainer || {};
|
|
196
|
+
// let isElementScrollable = scrollHeight > clientHeight;
|
|
197
|
+
// if (!isElementScrollable) {
|
|
198
|
+
// this.handleScrollFuncCall();
|
|
199
|
+
// }
|
|
200
|
+
// }
|
|
195
201
|
}
|
|
196
202
|
|
|
197
203
|
componentWillUnmount() {
|
|
@@ -865,7 +871,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
865
871
|
setAriaId,
|
|
866
872
|
isPopupOpen,
|
|
867
873
|
ariaErrorId,
|
|
868
|
-
customProps
|
|
874
|
+
customProps,
|
|
875
|
+
isFocus
|
|
869
876
|
} = this.props;
|
|
870
877
|
let {
|
|
871
878
|
isActive,
|
|
@@ -887,13 +894,14 @@ export class MultiSelectComponent extends React.Component {
|
|
|
887
894
|
disabledOptions
|
|
888
895
|
});
|
|
889
896
|
const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && isShowClear;
|
|
897
|
+
const isEditable = !(isReadOnly || isDisabled || disableAction);
|
|
890
898
|
let {
|
|
891
899
|
TextBoxIconProps = {}
|
|
892
900
|
} = customProps;
|
|
893
901
|
return /*#__PURE__*/React.createElement(Container, {
|
|
894
902
|
align: "vertical",
|
|
895
903
|
alignBox: "row",
|
|
896
|
-
className: `${style.container} ${style[size]} ${needBorder ? !disableAction ? style[`borderColor_${borderColor}`] : style.borderColor_transparent : ''} ${isActive && needBorder || isResponsive ? style.active : ''} ${textBoxClass} ${needBorder ? style.hasBorder : ''}`,
|
|
904
|
+
className: `${style.container} ${style[size]} ${needBorder ? !disableAction ? style[`borderColor_${borderColor}`] : style.borderColor_transparent : ''} ${isActive && needBorder || isResponsive || isEditable && isFocus && needBorder ? style.active : ''} ${textBoxClass} ${needBorder ? style.hasBorder : ''}`,
|
|
897
905
|
eleRef: this.selectedOptionContainerRef,
|
|
898
906
|
wrap: "wrap"
|
|
899
907
|
}, /*#__PURE__*/React.createElement(SelectedOptions, {
|
|
@@ -111,7 +111,8 @@ export const MultiSelect_propTypes = {
|
|
|
111
111
|
ariaErrorId: PropTypes.string,
|
|
112
112
|
customProps: PropTypes.shape({
|
|
113
113
|
TextBoxIconProps: PropTypes.object
|
|
114
|
-
})
|
|
114
|
+
}),
|
|
115
|
+
isFocus: PropTypes.bool
|
|
115
116
|
};
|
|
116
117
|
export const MultiSelectHeader_propTypes = {
|
|
117
118
|
dataId: PropTypes.string,
|
|
@@ -246,7 +247,8 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
246
247
|
needToCloseOnSelect: PropTypes.func,
|
|
247
248
|
searchStr: PropTypes.string,
|
|
248
249
|
children: PropTypes.node,
|
|
249
|
-
dataSelectorId: PropTypes.string
|
|
250
|
+
dataSelectorId: PropTypes.string,
|
|
251
|
+
isFocus: PropTypes.bool
|
|
250
252
|
};
|
|
251
253
|
export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
252
254
|
selectedOptionDetails: PropTypes.string,
|
|
@@ -321,5 +323,6 @@ export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
|
321
323
|
}),
|
|
322
324
|
isLoading: PropTypes.bool,
|
|
323
325
|
dataSelectorId: PropTypes.string,
|
|
324
|
-
customClass: PropTypes.object
|
|
326
|
+
customClass: PropTypes.object,
|
|
327
|
+
isFocus: PropTypes.bool
|
|
325
328
|
};
|