@zohodesk/dot 1.0.0-temp-187.2 → 1.0.0-temp-200
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 +4 -0
- package/es/Attachment/Attachment.js +2 -1
- package/es/Attachment/Attachment.module.css +7 -3
- package/es/AttachmentViewer/Attachment.js +60 -1
- package/es/AttachmentViewer/AttachmentViewer.js +146 -12
- package/es/AttachmentViewer/AttachmentViewer.module.css +124 -4
- package/es/DotProvider/__tests__/DotProvider.spec.js +174 -0
- package/es/DotProvider/__tests__/__snapshots__/DotProvider.spec.js.snap +478 -0
- package/es/common/dot_common.module.css +35 -0
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -4
- package/es/list/DepartmentDropDown/DepartmentDropDown.js +2 -7
- package/es/list/DepartmentDropDown/props/defaultProps.js +1 -2
- package/es/list/DepartmentDropDown/props/propTypes.js +1 -2
- package/es/list/status/StatusListItem/StatusListItem.module.css +5 -35
- package/es/lookup/header/Search/LookupSearch.module.css +33 -27
- package/es/lookup/header/Search/Search.js +58 -40
- package/es/lookup/header/Search/__tests__/Search.spec.js +67 -1
- package/es/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +316 -3
- package/es/lookup/header/Search/props/defaultProps.js +3 -1
- package/es/lookup/header/Search/props/propTypes.js +6 -1
- package/lib/Attachment/Attachment.js +3 -1
- package/lib/Attachment/Attachment.module.css +7 -3
- package/lib/AttachmentViewer/Attachment.js +88 -1
- package/lib/AttachmentViewer/AttachmentViewer.js +147 -13
- package/lib/AttachmentViewer/AttachmentViewer.module.css +124 -4
- package/lib/DotProvider/__tests__/DotProvider.spec.js +441 -0
- package/lib/DotProvider/__tests__/__snapshots__/DotProvider.spec.js.snap +478 -0
- package/lib/common/dot_common.module.css +35 -0
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -5
- package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -8
- package/lib/list/DepartmentDropDown/props/defaultProps.js +1 -2
- package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
- package/lib/list/status/StatusListItem/StatusListItem.module.css +5 -35
- package/lib/lookup/header/Search/LookupSearch.module.css +33 -27
- package/lib/lookup/header/Search/Search.js +76 -66
- package/lib/lookup/header/Search/__tests__/Search.spec.js +65 -0
- package/lib/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +316 -3
- package/lib/lookup/header/Search/props/defaultProps.js +3 -1
- package/lib/lookup/header/Search/props/propTypes.js +6 -1
- package/package.json +8 -8
- package/result.json +1 -1
- package/unittest/index.html +2 -6
- /package/images/{audio_thumbnail.png → audio_thumbnail_old.png} +0 -0
|
@@ -1,13 +1,196 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`Search rendering the customized style search 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="wrapper searchWrapperClass borderType
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
flex rowdir vCenter"
|
|
10
|
+
data-id="containerComponent"
|
|
11
|
+
data-selector-id="container"
|
|
12
|
+
data-test-id="containerComponent"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="grow basis shrinkOff"
|
|
16
|
+
data-id="boxComponent"
|
|
17
|
+
data-selector-id="box"
|
|
18
|
+
data-test-id="boxComponent"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
class="container effect flex rowdir"
|
|
22
|
+
data-id="containerComponent"
|
|
23
|
+
data-selector-id="textBoxIcon"
|
|
24
|
+
data-test-id="containerComponent"
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
class="grow basis shrinkOff"
|
|
28
|
+
data-id="boxComponent"
|
|
29
|
+
data-selector-id="box"
|
|
30
|
+
data-test-id="boxComponent"
|
|
31
|
+
>
|
|
32
|
+
<input
|
|
33
|
+
class=" container small default effect borderColor_default "
|
|
34
|
+
data-a11y-autofocus="true"
|
|
35
|
+
data-id="textBoxIcon"
|
|
36
|
+
data-selector-id="textBoxIcon"
|
|
37
|
+
data-test-id="textBoxIcon"
|
|
38
|
+
maxlength="250"
|
|
39
|
+
type="text"
|
|
40
|
+
value=""
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
class="iconContainer shrinkOff"
|
|
45
|
+
data-id="boxComponent"
|
|
46
|
+
data-selector-id="box"
|
|
47
|
+
data-test-id="boxComponent"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
class="flex cover rowdir"
|
|
51
|
+
data-id="containerComponent"
|
|
52
|
+
data-selector-id="container"
|
|
53
|
+
data-test-id="containerComponent"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</DocumentFragment>
|
|
60
|
+
`;
|
|
61
|
+
|
|
3
62
|
exports[`Search rendering the defult props 1`] = `
|
|
4
63
|
<DocumentFragment>
|
|
5
64
|
<div
|
|
6
|
-
class="
|
|
65
|
+
class="wrapper borderType
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
flex rowdir vCenter"
|
|
69
|
+
data-id="containerComponent"
|
|
70
|
+
data-selector-id="container"
|
|
71
|
+
data-test-id="containerComponent"
|
|
72
|
+
>
|
|
73
|
+
<div
|
|
74
|
+
class="grow basis shrinkOff"
|
|
75
|
+
data-id="boxComponent"
|
|
76
|
+
data-selector-id="box"
|
|
77
|
+
data-test-id="boxComponent"
|
|
78
|
+
>
|
|
79
|
+
<div
|
|
80
|
+
class="container effect flex rowdir"
|
|
81
|
+
data-id="containerComponent"
|
|
82
|
+
data-selector-id="textBoxIcon"
|
|
83
|
+
data-test-id="containerComponent"
|
|
84
|
+
>
|
|
85
|
+
<div
|
|
86
|
+
class="grow basis shrinkOff"
|
|
87
|
+
data-id="boxComponent"
|
|
88
|
+
data-selector-id="box"
|
|
89
|
+
data-test-id="boxComponent"
|
|
90
|
+
>
|
|
91
|
+
<input
|
|
92
|
+
class=" container small default effect borderColor_default "
|
|
93
|
+
data-a11y-autofocus="true"
|
|
94
|
+
data-id="textBoxIcon"
|
|
95
|
+
data-selector-id="textBoxIcon"
|
|
96
|
+
data-test-id="textBoxIcon"
|
|
97
|
+
maxlength="250"
|
|
98
|
+
type="text"
|
|
99
|
+
value=""
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
<div
|
|
103
|
+
class="iconContainer shrinkOff"
|
|
104
|
+
data-id="boxComponent"
|
|
105
|
+
data-selector-id="box"
|
|
106
|
+
data-test-id="boxComponent"
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
class="flex cover rowdir"
|
|
110
|
+
data-id="containerComponent"
|
|
111
|
+
data-selector-id="container"
|
|
112
|
+
data-test-id="containerComponent"
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</DocumentFragment>
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
exports[`Search rendering the prop hasSeparator is false 1`] = `
|
|
122
|
+
<DocumentFragment>
|
|
123
|
+
<div
|
|
124
|
+
class="wrapper borderType
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
flex rowdir vCenter"
|
|
128
|
+
data-id="containerComponent"
|
|
129
|
+
data-selector-id="container"
|
|
130
|
+
data-test-id="containerComponent"
|
|
131
|
+
>
|
|
132
|
+
<div
|
|
133
|
+
class="grow basis shrinkOff"
|
|
134
|
+
data-id="boxComponent"
|
|
135
|
+
data-selector-id="box"
|
|
136
|
+
data-test-id="boxComponent"
|
|
137
|
+
>
|
|
138
|
+
<div
|
|
139
|
+
class="container effect flex rowdir"
|
|
140
|
+
data-id="containerComponent"
|
|
141
|
+
data-selector-id="textBoxIcon"
|
|
142
|
+
data-test-id="containerComponent"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
class="grow basis shrinkOff"
|
|
146
|
+
data-id="boxComponent"
|
|
147
|
+
data-selector-id="box"
|
|
148
|
+
data-test-id="boxComponent"
|
|
149
|
+
>
|
|
150
|
+
<input
|
|
151
|
+
class=" container small default effect borderColor_default "
|
|
152
|
+
data-a11y-autofocus="true"
|
|
153
|
+
data-id="textBoxIcon"
|
|
154
|
+
data-selector-id="textBoxIcon"
|
|
155
|
+
data-test-id="textBoxIcon"
|
|
156
|
+
maxlength="250"
|
|
157
|
+
type="text"
|
|
158
|
+
value=""
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
<div
|
|
162
|
+
class="iconContainer shrinkOff"
|
|
163
|
+
data-id="boxComponent"
|
|
164
|
+
data-selector-id="box"
|
|
165
|
+
data-test-id="boxComponent"
|
|
166
|
+
>
|
|
167
|
+
<div
|
|
168
|
+
class="flex cover rowdir"
|
|
169
|
+
data-id="containerComponent"
|
|
170
|
+
data-selector-id="container"
|
|
171
|
+
data-test-id="containerComponent"
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</DocumentFragment>
|
|
178
|
+
`;
|
|
179
|
+
|
|
180
|
+
exports[`Search rendering the prop hasSeparator is true 1`] = `
|
|
181
|
+
<DocumentFragment>
|
|
182
|
+
<div
|
|
183
|
+
class="wrapper borderType
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
flex rowdir vCenter"
|
|
7
187
|
data-id="containerComponent"
|
|
8
188
|
data-selector-id="container"
|
|
9
189
|
data-test-id="containerComponent"
|
|
10
190
|
>
|
|
191
|
+
<div
|
|
192
|
+
class="separator"
|
|
193
|
+
/>
|
|
11
194
|
<div
|
|
12
195
|
class="grow basis shrinkOff"
|
|
13
196
|
data-id="boxComponent"
|
|
@@ -50,9 +233,139 @@ exports[`Search rendering the defult props 1`] = `
|
|
|
50
233
|
data-test-id="containerComponent"
|
|
51
234
|
/>
|
|
52
235
|
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</DocumentFragment>
|
|
240
|
+
`;
|
|
241
|
+
|
|
242
|
+
exports[`Search rendering the renderChildren props via function 1`] = `
|
|
243
|
+
<DocumentFragment>
|
|
244
|
+
<div
|
|
245
|
+
class="wrapper"
|
|
246
|
+
data-selector-id="toggleDropdown"
|
|
247
|
+
>
|
|
248
|
+
<div
|
|
249
|
+
class="flex rowdir vCenter"
|
|
250
|
+
data-id="containerComponent"
|
|
251
|
+
data-selector-id="container"
|
|
252
|
+
data-test-id="containerComponent"
|
|
253
|
+
>
|
|
254
|
+
<div
|
|
255
|
+
class="wrapper borderType
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
flex rowdir vCenter"
|
|
259
|
+
data-id="containerComponent"
|
|
260
|
+
data-selector-id="container"
|
|
261
|
+
data-test-id="containerComponent"
|
|
262
|
+
>
|
|
263
|
+
<div>
|
|
264
|
+
All Fields
|
|
265
|
+
</div>
|
|
53
266
|
<div
|
|
54
|
-
class="
|
|
55
|
-
|
|
267
|
+
class="grow basis shrinkOff"
|
|
268
|
+
data-id="boxComponent"
|
|
269
|
+
data-selector-id="box"
|
|
270
|
+
data-test-id="boxComponent"
|
|
271
|
+
>
|
|
272
|
+
<div
|
|
273
|
+
class="container effect flex rowdir"
|
|
274
|
+
data-id="containerComponent"
|
|
275
|
+
data-selector-id="textBoxIcon"
|
|
276
|
+
data-test-id="containerComponent"
|
|
277
|
+
>
|
|
278
|
+
<div
|
|
279
|
+
class="grow basis shrinkOff"
|
|
280
|
+
data-id="boxComponent"
|
|
281
|
+
data-selector-id="box"
|
|
282
|
+
data-test-id="boxComponent"
|
|
283
|
+
>
|
|
284
|
+
<input
|
|
285
|
+
class=" container small default effect borderColor_default "
|
|
286
|
+
data-a11y-autofocus="true"
|
|
287
|
+
data-id="textBoxIcon"
|
|
288
|
+
data-selector-id="textBoxIcon"
|
|
289
|
+
data-test-id="textBoxIcon"
|
|
290
|
+
maxlength="250"
|
|
291
|
+
type="text"
|
|
292
|
+
value=""
|
|
293
|
+
/>
|
|
294
|
+
</div>
|
|
295
|
+
<div
|
|
296
|
+
class="iconContainer shrinkOff"
|
|
297
|
+
data-id="boxComponent"
|
|
298
|
+
data-selector-id="box"
|
|
299
|
+
data-test-id="boxComponent"
|
|
300
|
+
>
|
|
301
|
+
<div
|
|
302
|
+
class="flex cover rowdir"
|
|
303
|
+
data-id="containerComponent"
|
|
304
|
+
data-selector-id="container"
|
|
305
|
+
data-test-id="containerComponent"
|
|
306
|
+
/>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
</DocumentFragment>
|
|
314
|
+
`;
|
|
315
|
+
|
|
316
|
+
exports[`Search rendering the search active 1`] = `
|
|
317
|
+
<DocumentFragment>
|
|
318
|
+
<div
|
|
319
|
+
class="wrapper borderType
|
|
320
|
+
active
|
|
321
|
+
focusWidth
|
|
322
|
+
flex rowdir vCenter"
|
|
323
|
+
data-id="containerComponent"
|
|
324
|
+
data-selector-id="container"
|
|
325
|
+
data-test-id="containerComponent"
|
|
326
|
+
>
|
|
327
|
+
<div
|
|
328
|
+
class="grow basis shrinkOff"
|
|
329
|
+
data-id="boxComponent"
|
|
330
|
+
data-selector-id="box"
|
|
331
|
+
data-test-id="boxComponent"
|
|
332
|
+
>
|
|
333
|
+
<div
|
|
334
|
+
class="container effect effectFocused flex rowdir"
|
|
335
|
+
data-id="containerComponent"
|
|
336
|
+
data-selector-id="textBoxIcon"
|
|
337
|
+
data-test-id="containerComponent"
|
|
338
|
+
>
|
|
339
|
+
<div
|
|
340
|
+
class="grow basis shrinkOff"
|
|
341
|
+
data-id="boxComponent"
|
|
342
|
+
data-selector-id="box"
|
|
343
|
+
data-test-id="boxComponent"
|
|
344
|
+
>
|
|
345
|
+
<input
|
|
346
|
+
class=" container small default effect borderColor_default "
|
|
347
|
+
data-a11y-autofocus="true"
|
|
348
|
+
data-id="textBoxIcon"
|
|
349
|
+
data-selector-id="textBoxIcon"
|
|
350
|
+
data-test-id="textBoxIcon"
|
|
351
|
+
maxlength="250"
|
|
352
|
+
type="text"
|
|
353
|
+
value=""
|
|
354
|
+
/>
|
|
355
|
+
</div>
|
|
356
|
+
<div
|
|
357
|
+
class="iconContainer shrinkOff"
|
|
358
|
+
data-id="boxComponent"
|
|
359
|
+
data-selector-id="box"
|
|
360
|
+
data-test-id="boxComponent"
|
|
361
|
+
>
|
|
362
|
+
<div
|
|
363
|
+
class="flex cover rowdir"
|
|
364
|
+
data-id="containerComponent"
|
|
365
|
+
data-selector-id="container"
|
|
366
|
+
data-test-id="containerComponent"
|
|
367
|
+
/>
|
|
368
|
+
</div>
|
|
56
369
|
</div>
|
|
57
370
|
</div>
|
|
58
371
|
</div>
|
|
@@ -6,6 +6,7 @@ export const Search_propTypes = {
|
|
|
6
6
|
onSelect: PropTypes.func,
|
|
7
7
|
options: PropTypes.array,
|
|
8
8
|
selectedId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
9
|
+
renderChildren: PropTypes.func,
|
|
9
10
|
value: PropTypes.string
|
|
10
11
|
};
|
|
11
12
|
export const SearchUI_propTypes = {
|
|
@@ -24,5 +25,9 @@ export const SearchUI_propTypes = {
|
|
|
24
25
|
options: PropTypes.array,
|
|
25
26
|
placeHolder: PropTypes.string,
|
|
26
27
|
searchStr: PropTypes.string,
|
|
27
|
-
title: PropTypes.string
|
|
28
|
+
title: PropTypes.string,
|
|
29
|
+
isActive: PropTypes.bool,
|
|
30
|
+
hasSeparator: PropTypes.bool,
|
|
31
|
+
renderChildren: PropTypes.func,
|
|
32
|
+
customStyle: PropTypes.object
|
|
28
33
|
};
|
|
@@ -70,7 +70,9 @@ var Attachment = /*#__PURE__*/function (_React$Component) {
|
|
|
70
70
|
fileInfo = _this$props.fileInfo,
|
|
71
71
|
i18nKeys = _this$props.i18nKeys,
|
|
72
72
|
dataSelectorId = _this$props.dataSelectorId,
|
|
73
|
-
isDisabled = _this$props.isDisabled
|
|
73
|
+
isDisabled = _this$props.isDisabled,
|
|
74
|
+
_this$props$iconPalet = _this$props.iconPalette,
|
|
75
|
+
iconPalette = _this$props$iconPalet === void 0 ? "white" : _this$props$iconPalet;
|
|
74
76
|
var _i18nKeys$downloadTit = i18nKeys.downloadTitle,
|
|
75
77
|
downloadTitle = _i18nKeys$downloadTit === void 0 ? 'Download' : _i18nKeys$downloadTit;
|
|
76
78
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
height: 100% ;
|
|
15
15
|
width: 100% ;
|
|
16
16
|
position: absolute;
|
|
17
|
-
top:0
|
|
17
|
+
top: 0
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
[dir=ltr] .disableLayer {
|
|
21
|
-
left:0
|
|
21
|
+
left: 0
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
[dir=rtl] .disableLayer {
|
|
25
|
-
right:0
|
|
25
|
+
right: 0
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.attachmentHover {
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
height: var(--zd_size40) ;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
.attachleft {
|
|
70
|
+
padding: var(--zd_size3) ;
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
[dir=ltr] .attachleft {
|
|
70
74
|
border-right: 1px solid var(--zdt_attachment_default_border);
|
|
71
75
|
}
|
|
@@ -3,15 +3,89 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.designFileTypes = designFileTypes;
|
|
7
|
+
exports.docsFileTypes = docsFileTypes;
|
|
6
8
|
exports.getExtensionFromFileName = getExtensionFromFileName;
|
|
7
9
|
exports.isAudioFile = isAudioFile;
|
|
8
10
|
exports.isBrowserSupportedFile = isBrowserSupportedFile;
|
|
11
|
+
exports.isDocsFile = isDocsFile;
|
|
12
|
+
exports.isEmailFile = isEmailFile;
|
|
13
|
+
exports.isImageFile = isImageFile;
|
|
14
|
+
exports.isPdfFile = isPdfFile;
|
|
15
|
+
exports.isSheetFile = isSheetFile;
|
|
16
|
+
exports.isShowFile = isShowFile;
|
|
17
|
+
exports.isVideoFile = isVideoFile;
|
|
18
|
+
exports.openInNewTabWithNoopener = openInNewTabWithNoopener;
|
|
19
|
+
exports.openNewTab = openNewTab;
|
|
20
|
+
exports.sheetFileTypes = sheetFileTypes;
|
|
21
|
+
exports.showFileTypes = showFileTypes;
|
|
22
|
+
exports.zipFileType = zipFileType;
|
|
9
23
|
var UNASSIGNED = 'Unassigned';
|
|
10
24
|
var BROWSER_SUPPORTED_FILES = ['pdf', 'text', 'txt', 'css', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'ico', 'sh', 'mp3', 'wav', 'ogg'];
|
|
11
25
|
|
|
12
26
|
function isAudioFile(fileName) {
|
|
13
27
|
var extension = getExtensionFromFileName(fileName);
|
|
14
|
-
return /mp3|wav|ogg/i.test(extension);
|
|
28
|
+
return /mp3|wav|ogg|oga|m4a|weba|opus|m4b|webma|aac/i.test(extension);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function isVideoFile(fileName) {
|
|
32
|
+
var extension = getExtensionFromFileName(fileName);
|
|
33
|
+
return /mp4|webm|ogg/i.test(extension);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function isPdfFile(fileName) {
|
|
37
|
+
var extension = getExtensionFromFileName(fileName);
|
|
38
|
+
return /pdf/i.test(extension);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isDocsFile(fileName) {
|
|
42
|
+
var extension = getExtensionFromFileName(fileName);
|
|
43
|
+
return /docx|doc|docm|rtf|odt|dot|dotm|dotx|pages/i.test(extension);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isSheetFile(fileName) {
|
|
47
|
+
var extension = getExtensionFromFileName(fileName);
|
|
48
|
+
return /xlsx|numbers/i.test(extension);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isShowFile(fileName) {
|
|
52
|
+
var extension = getExtensionFromFileName(fileName);
|
|
53
|
+
return /pptx|ppt|pps|ppsx|key/i.test(extension);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isEmailFile(fileName) {
|
|
57
|
+
var extension = getExtensionFromFileName(fileName);
|
|
58
|
+
return /eml|msg/i.test(extension);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function isImageFile(fileName) {
|
|
62
|
+
var extension = getExtensionFromFileName(fileName);
|
|
63
|
+
return /jpeg|jpg|png|gif|bmp|tiff|tif|ico/i.test(extension);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function docsFileTypes(fileName) {
|
|
67
|
+
var extension = getExtensionFromFileName(fileName);
|
|
68
|
+
return /docx|doc|docm|rtf|odt|dot|dotm|dotx|sxw|odt|ott|txt|pages/i.test(extension);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function sheetFileTypes(fileName) {
|
|
72
|
+
var extension = getExtensionFromFileName(fileName);
|
|
73
|
+
return /xls|xlsx|sxc|ods|csv|tsv|ots|xlsm|xlsb|xlt|xltx|xltm|numbers/i.test(extension);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function showFileTypes(fileName) {
|
|
77
|
+
var extension = getExtensionFromFileName(fileName);
|
|
78
|
+
return /pptx|ppt|pps|ppsx|odp|sxi|key|pot|potx/i.test(extension);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function designFileTypes(fileName) {
|
|
82
|
+
var extension = getExtensionFromFileName(fileName);
|
|
83
|
+
return /sketch|xd|psd|ai|fig|svg/i.test(extension);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function zipFileType(fileName) {
|
|
87
|
+
var extension = getExtensionFromFileName(fileName);
|
|
88
|
+
return /zip/i.test(extension);
|
|
15
89
|
}
|
|
16
90
|
|
|
17
91
|
function getExtensionFromFileName(fileName) {
|
|
@@ -25,4 +99,17 @@ function getExtensionFromFileName(fileName) {
|
|
|
25
99
|
function isBrowserSupportedFile(fileName) {
|
|
26
100
|
var extension = getExtensionFromFileName(fileName);
|
|
27
101
|
return BROWSER_SUPPORTED_FILES.indexOf(extension) !== -1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function openInNewTabWithNoopener(url) {
|
|
105
|
+
var targetnName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '_blank';
|
|
106
|
+
var aTag = document.createElement('a');
|
|
107
|
+
aTag.rel = 'noopener noreferrer';
|
|
108
|
+
aTag.target = targetnName;
|
|
109
|
+
aTag.href = url;
|
|
110
|
+
aTag.click();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function openNewTab(href) {
|
|
114
|
+
openInNewTabWithNoopener(href);
|
|
28
115
|
}
|