@zohodesk/dot 1.0.0-temp-200.7 → 1.0.0-temp-200.8
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 +5 -0
- package/es/AttachmentViewer/Attachment.js +32 -32
- package/es/AttachmentViewer/AttachmentViewer.js +6 -2
- package/es/AttachmentViewer/props/defaultProps.js +2 -10
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +30 -7
- package/es/dropdown/ToggleDropDown/props/defaultProps.js +2 -1
- package/es/dropdown/ToggleDropDown/props/propTypes.js +2 -1
- package/lib/AttachmentViewer/Attachment.js +32 -32
- package/lib/AttachmentViewer/AttachmentViewer.js +6 -2
- package/lib/AttachmentViewer/props/defaultProps.js +2 -10
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +34 -11
- package/lib/dropdown/ToggleDropDown/props/defaultProps.js +2 -1
- package/lib/dropdown/ToggleDropDown/props/propTypes.js +2 -1
- package/package.json +7 -7
- package/result.json +1 -1
- package/unittest/index.html +2 -10
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
In this Library, we Provide Some Basic Components to Build Your Application
|
|
4
4
|
|
|
5
|
+
# 1.7.17
|
|
6
|
+
|
|
7
|
+
- **ToggleDropDown** - SecondaryValue supported for listitems and searchFields prop supported
|
|
8
|
+
|
|
9
|
+
|
|
5
10
|
# 1.7.16
|
|
6
11
|
|
|
7
12
|
- **DotProvider** - Theme entry for component_v1 added.
|
|
@@ -19,44 +19,44 @@ export function isBrowserSupportedFile(fileName) {
|
|
|
19
19
|
export function getAttachmentIconDetails(fileName) {
|
|
20
20
|
const extension = getExtensionFromFileName(fileName)?.toLowerCase();
|
|
21
21
|
if (!extension) return 'ZD-GN-fileUnknown';
|
|
22
|
-
const imageExtensions =
|
|
23
|
-
const docExtensions =
|
|
24
|
-
const pdfExtensions =
|
|
25
|
-
const htmlExtensions =
|
|
26
|
-
const pptExtensions =
|
|
27
|
-
const zipExtensions =
|
|
28
|
-
const wordExtensions =
|
|
29
|
-
const xmlExtensions =
|
|
30
|
-
const sheetExtensions =
|
|
31
|
-
const audioExtensions =
|
|
32
|
-
const videoExtensions =
|
|
33
|
-
const mailExtensions =
|
|
34
|
-
const linuxExtensions =
|
|
35
|
-
const cssExtensions =
|
|
36
|
-
const exeExtensions =
|
|
37
|
-
const eventExtensions =
|
|
38
|
-
if (imageExtensions.
|
|
39
|
-
if (docExtensions.
|
|
40
|
-
if (pdfExtensions.
|
|
41
|
-
if (pptExtensions.
|
|
42
|
-
if (zipExtensions.
|
|
22
|
+
const imageExtensions = ['jpeg', 'jpg', 'png', 'apng', 'gif', 'bmp', 'tiff', 'tif', 'ico', 'svg', 'heic', 'webp'];
|
|
23
|
+
const docExtensions = ['txt'];
|
|
24
|
+
const pdfExtensions = ['pdf'];
|
|
25
|
+
const htmlExtensions = ['html', 'htm', 'xhtml'];
|
|
26
|
+
const pptExtensions = ['ppt', 'pps', 'odp', 'sxi', 'pptx', 'ppsx', 'pot', 'potx', 'key'];
|
|
27
|
+
const zipExtensions = ['rar', 'jar', 'zip'];
|
|
28
|
+
const wordExtensions = ['doc', 'docx', 'sxw', 'odt', 'docm', 'dot', 'dotm', 'dotx', 'rtf', 'pages'];
|
|
29
|
+
const xmlExtensions = ['xml'];
|
|
30
|
+
const sheetExtensions = ['xls', 'xlsx', 'xlsm', 'xlsb', 'sxc', 'ods', 'csv', 'tsv', 'numbers'];
|
|
31
|
+
const audioExtensions = ['mp3', 'wav', 'wma', 'aac', 'm4r', 'ogg', 'opus'];
|
|
32
|
+
const videoExtensions = ['mp4', 'mkv', 'mov', 'mpeg', 'flv', 'wmv', 'avi', 'webm', 'ogv'];
|
|
33
|
+
const mailExtensions = ['eml', 'msg'];
|
|
34
|
+
const linuxExtensions = ['sh', 'bin'];
|
|
35
|
+
const cssExtensions = ['css'];
|
|
36
|
+
const exeExtensions = ['exe'];
|
|
37
|
+
const eventExtensions = ['ics'];
|
|
38
|
+
if (imageExtensions.includes(extension)) return 'ZD-EF-fileImage';
|
|
39
|
+
if (docExtensions.includes(extension)) return 'ZD-GN-fileDoc';
|
|
40
|
+
if (pdfExtensions.includes(extension)) return 'ZD-EF-filePdf';
|
|
41
|
+
if (pptExtensions.includes(extension)) return 'ZD-GN-filePpt';
|
|
42
|
+
if (zipExtensions.includes(extension)) return 'ZD-EF-fileZip';
|
|
43
43
|
|
|
44
|
-
if (wordExtensions.
|
|
44
|
+
if (wordExtensions.includes(extension)) {
|
|
45
45
|
const OSName = navigator.platform?.toLowerCase() || '';
|
|
46
46
|
return OSName.includes('mac') || OSName.includes('linux') ? 'ZD-EF-fileOffice' : 'ZD-EF-fileWord';
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
if (xmlExtensions.
|
|
50
|
-
if (sheetExtensions.
|
|
51
|
-
if (audioExtensions.
|
|
52
|
-
if (videoExtensions.
|
|
53
|
-
if (mailExtensions.
|
|
54
|
-
if (linuxExtensions.
|
|
55
|
-
if (cssExtensions.
|
|
56
|
-
if (exeExtensions.
|
|
57
|
-
if (eventExtensions.
|
|
49
|
+
if (xmlExtensions.includes(extension)) return 'ZD-EF-fileXml';
|
|
50
|
+
if (sheetExtensions.includes(extension)) return 'ZD-GN-fileSheet';
|
|
51
|
+
if (audioExtensions.includes(extension)) return 'ZD-EF-fileMp3';
|
|
52
|
+
if (videoExtensions.includes(extension)) return 'ZD-EF-fileMp4';
|
|
53
|
+
if (mailExtensions.includes(extension)) return 'ZD-GN-fileMail';
|
|
54
|
+
if (linuxExtensions.includes(extension)) return 'ZD-EF-linux';
|
|
55
|
+
if (cssExtensions.includes(extension)) return 'ZD-EF-clrCss';
|
|
56
|
+
if (exeExtensions.includes(extension)) return 'ZD-EF-exe';
|
|
57
|
+
if (eventExtensions.includes(extension)) return 'ZD-TK-event';
|
|
58
58
|
|
|
59
|
-
if (htmlExtensions.
|
|
59
|
+
if (htmlExtensions.includes(extension)) {
|
|
60
60
|
const browser = getBrowserWithVersion()?.toLowerCase() || '';
|
|
61
61
|
if (browser.includes('chrome') || browser.includes('safari')) return 'ZD-EF-fileXml';
|
|
62
62
|
if (browser.includes('ie') || browser.includes('edge')) return 'ZD-EF-explorer';
|
|
@@ -373,6 +373,10 @@ export default class AttachmentViewer extends Component {
|
|
|
373
373
|
} = customClass;
|
|
374
374
|
const retainZoom = canZoom && selectedIndex == i && maintainZoom;
|
|
375
375
|
const extension = getExtensionFromFileName(name);
|
|
376
|
+
const {
|
|
377
|
+
previewUnsupportedText = "Preview not available for the selected file type.",
|
|
378
|
+
downloadText = "Download"
|
|
379
|
+
} = i18nKeys;
|
|
376
380
|
return /*#__PURE__*/React.createElement(Container, {
|
|
377
381
|
className: style.imgBox,
|
|
378
382
|
id: `imgBox${i}`,
|
|
@@ -420,14 +424,14 @@ export default class AttachmentViewer extends Component {
|
|
|
420
424
|
}, _this.getPreviewIconData(name, '70')), /*#__PURE__*/React.createElement(Typography, {
|
|
421
425
|
$ui_size: "20",
|
|
422
426
|
$ui_weight: "semibold"
|
|
423
|
-
},
|
|
427
|
+
}, previewUnsupportedText), /*#__PURE__*/React.createElement(Link, {
|
|
424
428
|
href: downloadUrl,
|
|
425
429
|
className: style.downloadLink,
|
|
426
430
|
hasReload: true,
|
|
427
431
|
download: true
|
|
428
432
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
429
433
|
palette: "primaryFilled",
|
|
430
|
-
text:
|
|
434
|
+
text: downloadText
|
|
431
435
|
}))))));
|
|
432
436
|
});
|
|
433
437
|
}
|
|
@@ -8,17 +8,9 @@ export const AttachmentImage_defaultProps = {
|
|
|
8
8
|
export const AttachmentViewer_defaultProps = {
|
|
9
9
|
responsiveId: "Helmet",
|
|
10
10
|
needDownload: true,
|
|
11
|
-
i18nKeys: {
|
|
12
|
-
previewUnsupportedText: 'Preview not available for the selected file type.'
|
|
13
|
-
},
|
|
14
11
|
maintainZoom: false,
|
|
15
12
|
isActive: false,
|
|
16
13
|
dataId: 'AttachmentViewer',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
audio: [],
|
|
20
|
-
video: [],
|
|
21
|
-
image: [],
|
|
22
|
-
document: []
|
|
23
|
-
}
|
|
14
|
+
i18nKeys: {},
|
|
15
|
+
customProps: {}
|
|
24
16
|
};
|
|
@@ -4,7 +4,7 @@ import { propTypes } from "./props/propTypes";
|
|
|
4
4
|
import { Icon } from '@zohodesk/icons';
|
|
5
5
|
import Popup from '@zohodesk/components/lib/Popup/Popup';
|
|
6
6
|
import { Box, Container } from '@zohodesk/components/lib/Layout';
|
|
7
|
-
import ListItem from '@zohodesk/components/
|
|
7
|
+
import ListItem from '@zohodesk/components/es/ListItem/ListItem';
|
|
8
8
|
import ListItemWithIcon from '@zohodesk/components/lib/ListItem/ListItemWithIcon';
|
|
9
9
|
import DropDownHeading from '@zohodesk/components/lib/DropDown/DropDownHeading';
|
|
10
10
|
import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
|
|
@@ -210,9 +210,11 @@ export class ToggleDropDown extends Component {
|
|
|
210
210
|
keyName,
|
|
211
211
|
isGroupDropDown,
|
|
212
212
|
groupOptionsKey,
|
|
213
|
-
groupNameKey
|
|
213
|
+
groupNameKey,
|
|
214
|
+
searchFields
|
|
214
215
|
} = this.props;
|
|
215
216
|
searchValue = searchValue.trim().toLowerCase();
|
|
217
|
+
searchFields.push(keyName !== 'value' ? keyName : 'value');
|
|
216
218
|
let result = [];
|
|
217
219
|
|
|
218
220
|
if (isGroupDropDown) {
|
|
@@ -224,8 +226,15 @@ export class ToggleDropDown extends Component {
|
|
|
224
226
|
const name = group[groupNameKey];
|
|
225
227
|
const groupOptions = group[groupOptionsKey];
|
|
226
228
|
const datas = groupOptions.filter(list => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
+
return searchFields.some(key => {
|
|
230
|
+
let val = list[key];
|
|
231
|
+
|
|
232
|
+
if (val === null || val === undefined) {
|
|
233
|
+
return false;
|
|
234
|
+
} else {
|
|
235
|
+
return val.toLowerCase().includes(searchValue);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
229
238
|
});
|
|
230
239
|
|
|
231
240
|
if (datas.length) {
|
|
@@ -243,7 +252,15 @@ export class ToggleDropDown extends Component {
|
|
|
243
252
|
return true;
|
|
244
253
|
}
|
|
245
254
|
|
|
246
|
-
return
|
|
255
|
+
return searchFields.some(key => {
|
|
256
|
+
let val = item[key];
|
|
257
|
+
|
|
258
|
+
if (val === null || val === undefined) {
|
|
259
|
+
return false;
|
|
260
|
+
} else {
|
|
261
|
+
return val.toLowerCase().includes(searchValue);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
247
264
|
});
|
|
248
265
|
|
|
249
266
|
if (filteredOptions.length) {
|
|
@@ -717,7 +734,8 @@ export class ToggleDropDown extends Component {
|
|
|
717
734
|
iconClass,
|
|
718
735
|
title,
|
|
719
736
|
disableTitle = '',
|
|
720
|
-
isDisabled = false
|
|
737
|
+
isDisabled = false,
|
|
738
|
+
secondaryValue
|
|
721
739
|
} = item;
|
|
722
740
|
listIndex += 1;
|
|
723
741
|
return iconName ? /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
@@ -747,6 +765,7 @@ export class ToggleDropDown extends Component {
|
|
|
747
765
|
ariaSelected: selectedId === item[idName],
|
|
748
766
|
ariaLabel: item[keyName]
|
|
749
767
|
},
|
|
768
|
+
secondaryValue: secondaryValue,
|
|
750
769
|
...ListItemWithIconProps
|
|
751
770
|
}) : /*#__PURE__*/React.createElement(ListItem, {
|
|
752
771
|
key: listIndex,
|
|
@@ -772,6 +791,7 @@ export class ToggleDropDown extends Component {
|
|
|
772
791
|
ariaSelected: selectedId === item[idName],
|
|
773
792
|
ariaLabel: item[keyName]
|
|
774
793
|
},
|
|
794
|
+
secondaryValue: secondaryValue,
|
|
775
795
|
...ListItemProps
|
|
776
796
|
});
|
|
777
797
|
}));
|
|
@@ -786,7 +806,8 @@ export class ToggleDropDown extends Component {
|
|
|
786
806
|
title,
|
|
787
807
|
needDivider,
|
|
788
808
|
isDisabled = false,
|
|
789
|
-
disableTitle = ''
|
|
809
|
+
disableTitle = '',
|
|
810
|
+
secondaryValue
|
|
790
811
|
} = item;
|
|
791
812
|
|
|
792
813
|
if (!needDivider) {
|
|
@@ -824,6 +845,7 @@ export class ToggleDropDown extends Component {
|
|
|
824
845
|
ariaSelected: selectedId === item[idName],
|
|
825
846
|
ariaLabel: item[keyName]
|
|
826
847
|
},
|
|
848
|
+
secondaryValue: secondaryValue,
|
|
827
849
|
...ListItemWithIconProps
|
|
828
850
|
}) : /*#__PURE__*/React.createElement(ListItem, {
|
|
829
851
|
key: listIndex,
|
|
@@ -849,6 +871,7 @@ export class ToggleDropDown extends Component {
|
|
|
849
871
|
ariaSelected: selectedId === item[idName],
|
|
850
872
|
ariaLabel: item[keyName]
|
|
851
873
|
},
|
|
874
|
+
secondaryValue: secondaryValue,
|
|
852
875
|
...ListItemProps
|
|
853
876
|
}));
|
|
854
877
|
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
@@ -36,46 +36,46 @@ function getAttachmentIconDetails(fileName) {
|
|
|
36
36
|
|
|
37
37
|
var extension = (_getExtensionFromFile = getExtensionFromFileName(fileName)) === null || _getExtensionFromFile === void 0 ? void 0 : _getExtensionFromFile.toLowerCase();
|
|
38
38
|
if (!extension) return 'ZD-GN-fileUnknown';
|
|
39
|
-
var imageExtensions =
|
|
40
|
-
var docExtensions =
|
|
41
|
-
var pdfExtensions =
|
|
42
|
-
var htmlExtensions =
|
|
43
|
-
var pptExtensions =
|
|
44
|
-
var zipExtensions =
|
|
45
|
-
var wordExtensions =
|
|
46
|
-
var xmlExtensions =
|
|
47
|
-
var sheetExtensions =
|
|
48
|
-
var audioExtensions =
|
|
49
|
-
var videoExtensions =
|
|
50
|
-
var mailExtensions =
|
|
51
|
-
var linuxExtensions =
|
|
52
|
-
var cssExtensions =
|
|
53
|
-
var exeExtensions =
|
|
54
|
-
var eventExtensions =
|
|
55
|
-
if (imageExtensions.
|
|
56
|
-
if (docExtensions.
|
|
57
|
-
if (pdfExtensions.
|
|
58
|
-
if (pptExtensions.
|
|
59
|
-
if (zipExtensions.
|
|
39
|
+
var imageExtensions = ['jpeg', 'jpg', 'png', 'apng', 'gif', 'bmp', 'tiff', 'tif', 'ico', 'svg', 'heic', 'webp'];
|
|
40
|
+
var docExtensions = ['txt'];
|
|
41
|
+
var pdfExtensions = ['pdf'];
|
|
42
|
+
var htmlExtensions = ['html', 'htm', 'xhtml'];
|
|
43
|
+
var pptExtensions = ['ppt', 'pps', 'odp', 'sxi', 'pptx', 'ppsx', 'pot', 'potx', 'key'];
|
|
44
|
+
var zipExtensions = ['rar', 'jar', 'zip'];
|
|
45
|
+
var wordExtensions = ['doc', 'docx', 'sxw', 'odt', 'docm', 'dot', 'dotm', 'dotx', 'rtf', 'pages'];
|
|
46
|
+
var xmlExtensions = ['xml'];
|
|
47
|
+
var sheetExtensions = ['xls', 'xlsx', 'xlsm', 'xlsb', 'sxc', 'ods', 'csv', 'tsv', 'numbers'];
|
|
48
|
+
var audioExtensions = ['mp3', 'wav', 'wma', 'aac', 'm4r', 'ogg', 'opus'];
|
|
49
|
+
var videoExtensions = ['mp4', 'mkv', 'mov', 'mpeg', 'flv', 'wmv', 'avi', 'webm', 'ogv'];
|
|
50
|
+
var mailExtensions = ['eml', 'msg'];
|
|
51
|
+
var linuxExtensions = ['sh', 'bin'];
|
|
52
|
+
var cssExtensions = ['css'];
|
|
53
|
+
var exeExtensions = ['exe'];
|
|
54
|
+
var eventExtensions = ['ics'];
|
|
55
|
+
if (imageExtensions.includes(extension)) return 'ZD-EF-fileImage';
|
|
56
|
+
if (docExtensions.includes(extension)) return 'ZD-GN-fileDoc';
|
|
57
|
+
if (pdfExtensions.includes(extension)) return 'ZD-EF-filePdf';
|
|
58
|
+
if (pptExtensions.includes(extension)) return 'ZD-GN-filePpt';
|
|
59
|
+
if (zipExtensions.includes(extension)) return 'ZD-EF-fileZip';
|
|
60
60
|
|
|
61
|
-
if (wordExtensions.
|
|
61
|
+
if (wordExtensions.includes(extension)) {
|
|
62
62
|
var _navigator$platform;
|
|
63
63
|
|
|
64
64
|
var OSName = ((_navigator$platform = navigator.platform) === null || _navigator$platform === void 0 ? void 0 : _navigator$platform.toLowerCase()) || '';
|
|
65
65
|
return OSName.includes('mac') || OSName.includes('linux') ? 'ZD-EF-fileOffice' : 'ZD-EF-fileWord';
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
if (xmlExtensions.
|
|
69
|
-
if (sheetExtensions.
|
|
70
|
-
if (audioExtensions.
|
|
71
|
-
if (videoExtensions.
|
|
72
|
-
if (mailExtensions.
|
|
73
|
-
if (linuxExtensions.
|
|
74
|
-
if (cssExtensions.
|
|
75
|
-
if (exeExtensions.
|
|
76
|
-
if (eventExtensions.
|
|
68
|
+
if (xmlExtensions.includes(extension)) return 'ZD-EF-fileXml';
|
|
69
|
+
if (sheetExtensions.includes(extension)) return 'ZD-GN-fileSheet';
|
|
70
|
+
if (audioExtensions.includes(extension)) return 'ZD-EF-fileMp3';
|
|
71
|
+
if (videoExtensions.includes(extension)) return 'ZD-EF-fileMp4';
|
|
72
|
+
if (mailExtensions.includes(extension)) return 'ZD-GN-fileMail';
|
|
73
|
+
if (linuxExtensions.includes(extension)) return 'ZD-EF-linux';
|
|
74
|
+
if (cssExtensions.includes(extension)) return 'ZD-EF-clrCss';
|
|
75
|
+
if (exeExtensions.includes(extension)) return 'ZD-EF-exe';
|
|
76
|
+
if (eventExtensions.includes(extension)) return 'ZD-TK-event';
|
|
77
77
|
|
|
78
|
-
if (htmlExtensions.
|
|
78
|
+
if (htmlExtensions.includes(extension)) {
|
|
79
79
|
var _getBrowserWithVersio;
|
|
80
80
|
|
|
81
81
|
var browser = ((_getBrowserWithVersio = (0, _General.getBrowserWithVersion)()) === null || _getBrowserWithVersio === void 0 ? void 0 : _getBrowserWithVersio.toLowerCase()) || '';
|
|
@@ -470,6 +470,10 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
470
470
|
customChildrenClass = _customClass$customCh === void 0 ? '' : _customClass$customCh;
|
|
471
471
|
var retainZoom = canZoom && selectedIndex == i && maintainZoom;
|
|
472
472
|
var extension = (0, _Attachment.getExtensionFromFileName)(name);
|
|
473
|
+
var _i18nKeys$previewUnsu = i18nKeys.previewUnsupportedText,
|
|
474
|
+
previewUnsupportedText = _i18nKeys$previewUnsu === void 0 ? "Preview not available for the selected file type." : _i18nKeys$previewUnsu,
|
|
475
|
+
_i18nKeys$downloadTex = i18nKeys.downloadText,
|
|
476
|
+
downloadText = _i18nKeys$downloadTex === void 0 ? "Download" : _i18nKeys$downloadTex;
|
|
473
477
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
474
478
|
className: _AttachmentViewerModule["default"].imgBox,
|
|
475
479
|
id: "imgBox".concat(i),
|
|
@@ -516,14 +520,14 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
516
520
|
}, _this5.getPreviewIconData(name, '70')), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
517
521
|
$ui_size: "20",
|
|
518
522
|
$ui_weight: "semibold"
|
|
519
|
-
},
|
|
523
|
+
}, previewUnsupportedText), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
520
524
|
href: downloadUrl,
|
|
521
525
|
className: _AttachmentViewerModule["default"].downloadLink,
|
|
522
526
|
hasReload: true,
|
|
523
527
|
download: true
|
|
524
528
|
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
525
529
|
palette: "primaryFilled",
|
|
526
|
-
text:
|
|
530
|
+
text: downloadText
|
|
527
531
|
}))))));
|
|
528
532
|
});
|
|
529
533
|
}
|
|
@@ -15,18 +15,10 @@ exports.AttachmentImage_defaultProps = AttachmentImage_defaultProps;
|
|
|
15
15
|
var AttachmentViewer_defaultProps = {
|
|
16
16
|
responsiveId: "Helmet",
|
|
17
17
|
needDownload: true,
|
|
18
|
-
i18nKeys: {
|
|
19
|
-
previewUnsupportedText: 'Preview not available for the selected file type.'
|
|
20
|
-
},
|
|
21
18
|
maintainZoom: false,
|
|
22
19
|
isActive: false,
|
|
23
20
|
dataId: 'AttachmentViewer',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
audio: [],
|
|
27
|
-
video: [],
|
|
28
|
-
image: [],
|
|
29
|
-
document: []
|
|
30
|
-
}
|
|
21
|
+
i18nKeys: {},
|
|
22
|
+
customProps: {}
|
|
31
23
|
};
|
|
32
24
|
exports.AttachmentViewer_defaultProps = AttachmentViewer_defaultProps;
|
|
@@ -19,7 +19,7 @@ var _Popup = _interopRequireDefault(require("@zohodesk/components/lib/Popup/Popu
|
|
|
19
19
|
|
|
20
20
|
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
21
21
|
|
|
22
|
-
var _ListItem = _interopRequireDefault(require("@zohodesk/components/
|
|
22
|
+
var _ListItem = _interopRequireDefault(require("@zohodesk/components/es/ListItem/ListItem"));
|
|
23
23
|
|
|
24
24
|
var _ListItemWithIcon = _interopRequireDefault(require("@zohodesk/components/lib/ListItem/ListItemWithIcon"));
|
|
25
25
|
|
|
@@ -281,8 +281,10 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
281
281
|
keyName = _this$props6.keyName,
|
|
282
282
|
isGroupDropDown = _this$props6.isGroupDropDown,
|
|
283
283
|
groupOptionsKey = _this$props6.groupOptionsKey,
|
|
284
|
-
groupNameKey = _this$props6.groupNameKey
|
|
284
|
+
groupNameKey = _this$props6.groupNameKey,
|
|
285
|
+
searchFields = _this$props6.searchFields;
|
|
285
286
|
searchValue = searchValue.trim().toLowerCase();
|
|
287
|
+
searchFields.push(keyName !== 'value' ? keyName : 'value');
|
|
286
288
|
var result = [];
|
|
287
289
|
|
|
288
290
|
if (isGroupDropDown) {
|
|
@@ -292,8 +294,15 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
292
294
|
var name = group[groupNameKey];
|
|
293
295
|
var groupOptions = group[groupOptionsKey];
|
|
294
296
|
var datas = groupOptions.filter(function (list) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
+
return searchFields.some(function (key) {
|
|
298
|
+
var val = list[key];
|
|
299
|
+
|
|
300
|
+
if (val === null || val === undefined) {
|
|
301
|
+
return false;
|
|
302
|
+
} else {
|
|
303
|
+
return val.toLowerCase().includes(searchValue);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
297
306
|
});
|
|
298
307
|
|
|
299
308
|
if (datas.length) {
|
|
@@ -309,7 +318,15 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
309
318
|
return true;
|
|
310
319
|
}
|
|
311
320
|
|
|
312
|
-
return
|
|
321
|
+
return searchFields.some(function (key) {
|
|
322
|
+
var val = item[key];
|
|
323
|
+
|
|
324
|
+
if (val === null || val === undefined) {
|
|
325
|
+
return false;
|
|
326
|
+
} else {
|
|
327
|
+
return val.toLowerCase().includes(searchValue);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
313
330
|
});
|
|
314
331
|
|
|
315
332
|
if (filteredOptions.length) {
|
|
@@ -783,7 +800,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
783
800
|
_item$disableTitle = item.disableTitle,
|
|
784
801
|
disableTitle = _item$disableTitle === void 0 ? '' : _item$disableTitle,
|
|
785
802
|
_item$isDisabled = item.isDisabled,
|
|
786
|
-
isDisabled = _item$isDisabled === void 0 ? false : _item$isDisabled
|
|
803
|
+
isDisabled = _item$isDisabled === void 0 ? false : _item$isDisabled,
|
|
804
|
+
secondaryValue = item.secondaryValue;
|
|
787
805
|
listIndex += 1;
|
|
788
806
|
return iconName ? /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], _extends({
|
|
789
807
|
key: listIndex,
|
|
@@ -811,7 +829,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
811
829
|
role: isSearch ? 'option' : 'menuitem',
|
|
812
830
|
ariaSelected: selectedId === item[idName],
|
|
813
831
|
ariaLabel: item[keyName]
|
|
814
|
-
}
|
|
832
|
+
},
|
|
833
|
+
secondaryValue: secondaryValue
|
|
815
834
|
}, ListItemWithIconProps)) : /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
|
|
816
835
|
key: listIndex,
|
|
817
836
|
dataId: item[keyName],
|
|
@@ -835,7 +854,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
835
854
|
role: isSearch ? 'option' : 'menuitem',
|
|
836
855
|
ariaSelected: selectedId === item[idName],
|
|
837
856
|
ariaLabel: item[keyName]
|
|
838
|
-
}
|
|
857
|
+
},
|
|
858
|
+
secondaryValue: secondaryValue
|
|
839
859
|
}, ListItemProps));
|
|
840
860
|
}));
|
|
841
861
|
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -850,7 +870,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
850
870
|
_item$isDisabled2 = item.isDisabled,
|
|
851
871
|
isDisabled = _item$isDisabled2 === void 0 ? false : _item$isDisabled2,
|
|
852
872
|
_item$disableTitle2 = item.disableTitle,
|
|
853
|
-
disableTitle = _item$disableTitle2 === void 0 ? '' : _item$disableTitle2
|
|
873
|
+
disableTitle = _item$disableTitle2 === void 0 ? '' : _item$disableTitle2,
|
|
874
|
+
secondaryValue = item.secondaryValue;
|
|
854
875
|
|
|
855
876
|
if (!needDivider) {
|
|
856
877
|
listIndex += 1;
|
|
@@ -886,7 +907,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
886
907
|
role: isSearch ? 'option' : 'menuitem',
|
|
887
908
|
ariaSelected: selectedId === item[idName],
|
|
888
909
|
ariaLabel: item[keyName]
|
|
889
|
-
}
|
|
910
|
+
},
|
|
911
|
+
secondaryValue: secondaryValue
|
|
890
912
|
}, ListItemWithIconProps)) : /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
|
|
891
913
|
key: listIndex,
|
|
892
914
|
dataId: item[keyName],
|
|
@@ -910,7 +932,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
910
932
|
role: isSearch ? 'option' : 'menuitem',
|
|
911
933
|
ariaSelected: selectedId === item[idName],
|
|
912
934
|
ariaLabel: item[keyName]
|
|
913
|
-
}
|
|
935
|
+
},
|
|
936
|
+
secondaryValue: secondaryValue
|
|
914
937
|
}, ListItemProps)));
|
|
915
938
|
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
916
939
|
isCover: false,
|
|
@@ -89,6 +89,7 @@ var propTypes = {
|
|
|
89
89
|
positionsOffset: _propTypes["default"].object,
|
|
90
90
|
targetOffset: _propTypes["default"].object,
|
|
91
91
|
from: _propTypes["default"].string,
|
|
92
|
-
top: _propTypes["default"].number
|
|
92
|
+
top: _propTypes["default"].number,
|
|
93
|
+
searchFields: _propTypes["default"].array
|
|
93
94
|
};
|
|
94
95
|
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/dot",
|
|
3
|
-
"version": "1.0.0-temp-200.
|
|
3
|
+
"version": "1.0.0-temp-200.8",
|
|
4
4
|
"main": "lib/index",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"sstest": "react-cli sstest",
|
|
38
38
|
"common_package_build": "cd ../common && npm run build && cd ../dot",
|
|
39
39
|
"docs": "npm run css:review && review:props && react-cli docs",
|
|
40
|
-
"prepublishOnly": "node prePublish.js && npm run
|
|
40
|
+
"prepublishOnly": "node prePublish.js && npm run css:review && npm run review:props",
|
|
41
41
|
"postpublish": "node postPublish.js",
|
|
42
|
-
"test-clean": "react-cli clean coverage && react-cli clean ./unittest",
|
|
42
|
+
"test-clean": "react-cli clean ./coverage && react-cli clean ./unittest react-cli clean ./es && react-cli clean ./lib && react-cli clean ./package-lock.json && react-cli clean ./result.json",
|
|
43
43
|
"download": "react-cli clean ./node_modules ./package-lock.json && npm install",
|
|
44
44
|
"expublish": "npm publish --tag experimental-version",
|
|
45
45
|
"css:lineheight:validate": "node ./node_modules/@zohodesk-private/node-plugins/es/lineheight_automation/lineHeightErrorCheck.js ./src/",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@zohodesk-private/css-variable-migrator": "^1.0.8",
|
|
63
63
|
"@zohodesk-private/node-plugins": "1.1.8",
|
|
64
64
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
65
|
-
"@zohodesk/a11y": "2.3.
|
|
66
|
-
"@zohodesk/components": "1.4.
|
|
65
|
+
"@zohodesk/a11y": "2.3.5",
|
|
66
|
+
"@zohodesk/components": "1.4.3",
|
|
67
67
|
"@zohodesk/hooks": "2.0.5",
|
|
68
68
|
"@zohodesk/icons": "1.0.79",
|
|
69
69
|
"@zohodesk/layout": "^3.1.0",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"velocity-react": "1.4.3",
|
|
79
79
|
"@zohodesk/variables": "1.0.0",
|
|
80
|
-
"@zohodesk/components": "1.4.
|
|
80
|
+
"@zohodesk/components": "1.4.3",
|
|
81
81
|
"@zohodesk/icons": "1.0.79",
|
|
82
82
|
"@zohodesk/svg": "1.1.22",
|
|
83
83
|
"@zohodesk/virtualizer": "1.0.3",
|
|
84
84
|
"react-sortable-hoc": "^0.8.3",
|
|
85
85
|
"@zohodesk/hooks": "2.0.5",
|
|
86
86
|
"@zohodesk/utils": "1.3.14",
|
|
87
|
-
"@zohodesk/a11y": "2.3.
|
|
87
|
+
"@zohodesk/a11y": "2.3.5",
|
|
88
88
|
"@zohodesk/layout": "3.1.0"
|
|
89
89
|
}
|
|
90
90
|
}
|