@rio-cloud/rio-uikit 0.16.3-beta.2 → 0.16.3-beta.5
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/Colors.d.ts +1 -1
- package/IncidentsLayer.d.ts +1 -1
- package/README.md +1 -1
- package/RuleContainer.d.ts +1 -1
- package/RulesWrapper.d.ts +1 -1
- package/SortDirection.d.ts +1 -1
- package/TrafficLayer.d.ts +1 -1
- package/TruckLayer.d.ts +1 -1
- package/components/actionBarItem/ActionBarItem.js +6 -2
- package/components/assetTree/Tree.js +2 -1
- package/components/bottomSheet/BottomSheet.js +22 -19
- package/components/fade/Fade.js +23 -7
- package/components/map/components/features/basics/marker/DomMarker.js +1 -1
- package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +28 -28
- package/hooks/useDebugInfo.js +1 -1
- package/hooks/usePrevious.js +18 -0
- package/index.js +1 -0
- package/lib/.DS_Store +0 -0
- package/lib/es/Colors.d.ts +1 -1
- package/lib/es/IncidentsLayer.d.ts +1 -1
- package/lib/es/RuleContainer.d.ts +1 -1
- package/lib/es/RulesWrapper.d.ts +1 -1
- package/lib/es/SortDirection.d.ts +1 -1
- package/lib/es/TrafficLayer.d.ts +1 -1
- package/lib/es/TruckLayer.d.ts +1 -1
- package/lib/es/components/actionBarItem/ActionBarItem.js +6 -2
- package/lib/es/components/assetTree/Tree.js +2 -1
- package/lib/es/components/bottomSheet/BottomSheet.js +22 -19
- package/lib/es/components/fade/Fade.js +26 -7
- package/lib/es/components/map/components/features/basics/marker/DomMarker.js +1 -1
- package/lib/es/components/responsiveColumnStripe/ResponsiveColumnStripe.js +28 -28
- package/lib/es/hooks/useDebugInfo.js +1 -1
- package/lib/es/hooks/usePrevious.js +25 -0
- package/lib/es/index.js +8 -0
- package/lib/es/styles/components/ApplicationHeader.less +27 -12
- package/lib/es/styles/components/BottomSheet.less +10 -1
- package/lib/es/styles/components/Dialog.less +38 -44
- package/lib/es/styles/components/Sidebar.less +10 -1
- package/lib/es/styles/design/popovers.less +1 -1
- package/lib/es/styles/design/utilities.less +8 -0
- package/lib/es/styles/variables/colors.json +72 -72
- package/lib/es/themes/Website/styles/rio-website.less +2 -1
- package/lib/es/types.ts +7 -2
- package/lib/es/usePrevious.d.ts +4 -0
- package/lib/es/usePrevious.js +13 -0
- package/lib/es/utils/cssuseragent.js +66 -66
- package/lib/es/utils/searchNormalized.js +14 -0
- package/lib/es/version.json +2 -2
- package/package.json +35 -26
- package/styles/components/ApplicationHeader.less +27 -12
- package/styles/components/BottomSheet.less +10 -1
- package/styles/components/Dialog.less +38 -44
- package/styles/components/Sidebar.less +10 -1
- package/styles/design/popovers.less +1 -1
- package/styles/design/utilities.less +8 -0
- package/styles/variables/colors.json +72 -72
- package/themes/Website/styles/rio-website.less +2 -1
- package/types.ts +7 -2
- package/usePrevious.d.ts +4 -0
- package/usePrevious.js +2 -0
- package/utils/cssuseragent.js +66 -66
- package/utils/searchNormalized.js +6 -0
- package/version.json +2 -2
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
@modal-title-x-padding: 20px;
|
|
5
5
|
@modal-content-bg: var(--color-white);
|
|
6
6
|
@modal-content-border-color: var(--gray-light);
|
|
7
|
-
@modal-backdrop-bg: var(--always-color-black);
|
|
8
7
|
@modal-header-border-color: var(--gray-lighter);
|
|
9
8
|
@modal-footer-border-color: var(--gray-lighter);
|
|
10
9
|
|
|
10
|
+
// Animation variables
|
|
11
|
+
@modal-animation-transition: all 200ms ease-out;
|
|
12
|
+
|
|
11
13
|
// Custom variables
|
|
12
14
|
@modal-sm: @screen-xs;
|
|
13
15
|
@modal-md: @screen-sm;
|
|
@@ -283,6 +285,23 @@ body {
|
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
287
|
}
|
|
288
|
+
|
|
289
|
+
// .modal-footer {
|
|
290
|
+
// &:before {
|
|
291
|
+
// content: '';
|
|
292
|
+
// height: 20px;
|
|
293
|
+
// left: 0;
|
|
294
|
+
// pointer-events: none;
|
|
295
|
+
// position: absolute;
|
|
296
|
+
// top: -21px;
|
|
297
|
+
// width: 100%;
|
|
298
|
+
// background: linear-gradient(
|
|
299
|
+
// 0deg,
|
|
300
|
+
// .hsla(@color-white-hsl, 1.0)[@result],
|
|
301
|
+
// .hsla(@color-white-hsl, 0)[@result],
|
|
302
|
+
// );
|
|
303
|
+
// }
|
|
304
|
+
// }
|
|
286
305
|
}
|
|
287
306
|
}
|
|
288
307
|
|
|
@@ -327,24 +346,16 @@ body {
|
|
|
327
346
|
}
|
|
328
347
|
|
|
329
348
|
.modal-backdrop {
|
|
330
|
-
background-color: @modal-backdrop-bg;
|
|
331
349
|
bottom: 0;
|
|
332
350
|
display: block;
|
|
333
351
|
left: 0;
|
|
334
|
-
opacity: 0.5;
|
|
335
352
|
position: fixed;
|
|
336
353
|
right: 0;
|
|
337
354
|
top: 0;
|
|
355
|
+
transition: @modal-animation-transition;
|
|
338
356
|
z-index: @zindex-modal-background;
|
|
339
357
|
|
|
340
|
-
// Fade for backdrop
|
|
341
|
-
&.fade { opacity: 0 }
|
|
342
|
-
&.in { opacity: 0.5 }
|
|
343
|
-
|
|
344
|
-
// Bluring
|
|
345
358
|
@supports ((-webkit-backdrop-filter: blur()) or (backdrop-filter: blur())) {
|
|
346
|
-
opacity: 0.99;
|
|
347
|
-
background-color: .hsla(@always-color-black-hsl, 0.5)[@result];
|
|
348
359
|
backdrop-filter: blur(1px);
|
|
349
360
|
}
|
|
350
361
|
}
|
|
@@ -460,11 +471,17 @@ body {
|
|
|
460
471
|
.modal-content {
|
|
461
472
|
display: block;
|
|
462
473
|
opacity: 0;
|
|
463
|
-
transform:
|
|
474
|
+
transform: translateY(-25%);
|
|
464
475
|
}
|
|
476
|
+
}
|
|
465
477
|
|
|
478
|
+
[class*="modal-enter"] {
|
|
466
479
|
.modal-backdrop {
|
|
467
|
-
|
|
480
|
+
background-color: .hsla(@color-black-hsl, 0.5)[@result];
|
|
481
|
+
|
|
482
|
+
[data-theme*="dark"] & {
|
|
483
|
+
background-color: .hsla(@gray-darkest-hsl, 0.3)[@result];
|
|
484
|
+
}
|
|
468
485
|
}
|
|
469
486
|
}
|
|
470
487
|
|
|
@@ -472,13 +489,8 @@ body {
|
|
|
472
489
|
.modal-content {
|
|
473
490
|
display: block;
|
|
474
491
|
opacity: 1;
|
|
475
|
-
transform:
|
|
476
|
-
transition:
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.modal-backdrop {
|
|
480
|
-
opacity: 0.5;
|
|
481
|
-
transition: all 200ms ease-out;
|
|
492
|
+
transform: translateY(0);
|
|
493
|
+
transition: @modal-animation-transition;
|
|
482
494
|
}
|
|
483
495
|
}
|
|
484
496
|
|
|
@@ -486,32 +498,14 @@ body {
|
|
|
486
498
|
.modal-content {
|
|
487
499
|
opacity: 0;
|
|
488
500
|
transform: translateY(-50%);
|
|
489
|
-
transition:
|
|
501
|
+
transition: @modal-animation-transition;
|
|
490
502
|
}
|
|
491
503
|
|
|
492
504
|
.modal-backdrop {
|
|
493
|
-
|
|
494
|
-
}
|
|
495
|
-
}
|
|
505
|
+
background-color: .hsla(@color-black-hsl, 0.0)[@result];
|
|
496
506
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
// @media (max-width: @modal-sm) {
|
|
503
|
-
// height: calc(~"var(--vh, 1vh) * 100 - 170px") !important;
|
|
504
|
-
// }
|
|
505
|
-
// }
|
|
506
|
-
|
|
507
|
-
// // no modal-footer version
|
|
508
|
-
// &:last-child {
|
|
509
|
-
// &.height-100vh {
|
|
510
|
-
// height: calc(~"var(--vh, 1vh) * 100 - 120px") !important;
|
|
511
|
-
|
|
512
|
-
// @media (max-width: @modal-sm) {
|
|
513
|
-
// height: calc(~"var(--vh, 1vh) * 100 - 90px") !important;
|
|
514
|
-
// }
|
|
515
|
-
// }
|
|
516
|
-
// }
|
|
517
|
-
// }
|
|
507
|
+
[data-theme*="dark"] & {
|
|
508
|
+
background-color: .hsla(@gray-darkest-hsl, 0.0)[@result];
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
@@ -160,6 +160,15 @@
|
|
|
160
160
|
|
|
161
161
|
.SidebarBackdrop {
|
|
162
162
|
&.sidebar-backdrop-bg {
|
|
163
|
-
background: .hsla(@
|
|
163
|
+
background-color: .hsla(@color-black-hsl, 0.5)[@result];
|
|
164
|
+
|
|
165
|
+
[data-theme*="dark"] & {
|
|
166
|
+
background-color: .hsla(@gray-darkest-hsl, 0.3)[@result];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@supports ((-webkit-backdrop-filter: blur()) or (backdrop-filter: blur())) {
|
|
170
|
+
opacity: 0.99;
|
|
171
|
+
backdrop-filter: blur(1px);
|
|
172
|
+
}
|
|
164
173
|
}
|
|
165
174
|
}
|
|
@@ -12,12 +12,20 @@
|
|
|
12
12
|
&-margin-top-0:first-child {
|
|
13
13
|
margin-top: 0 !important;
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
&-border-top-none:first-child {
|
|
17
|
+
border-top: none !important;
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.last-child {
|
|
18
22
|
&-margin-bottom-0:last-child {
|
|
19
23
|
margin-bottom: 0 !important;
|
|
20
24
|
}
|
|
25
|
+
|
|
26
|
+
&-border-bottom-none:last-child {
|
|
27
|
+
border-bottom: none !important;
|
|
28
|
+
}
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
.clearance {
|
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
2
|
+
"always-color-white": "#ffffff",
|
|
3
|
+
"always-color-black": "#000000",
|
|
4
|
+
"color-white": "#ffffff",
|
|
5
|
+
"color-black": "#000000",
|
|
6
|
+
"gray-darkest": "#2a3740",
|
|
7
|
+
"gray-darker": "#4C5667",
|
|
8
|
+
"gray-dark": "#697A8B",
|
|
9
|
+
"gray": "#A7AFBB",
|
|
10
|
+
"gray-light": "#D0D8DE",
|
|
11
|
+
"gray-lighter": "#E5EBF0",
|
|
12
|
+
"gray-lightest": "#f6f8f9",
|
|
13
|
+
"brand-primary": "#30b4c0",
|
|
14
|
+
"brand-secondary": "#b23672",
|
|
15
|
+
"brand-primary-decent": "#f4fbfc",
|
|
16
|
+
"brand-secondary-decent": "#fbf5f8",
|
|
17
|
+
"brand-info": "#4B80A6",
|
|
18
|
+
"brand-success": "#5cb85c",
|
|
19
|
+
"brand-warning": "#ff8e3c",
|
|
20
|
+
"brand-danger": "#d90000",
|
|
21
|
+
"brand-info-decent": "#f5f8fb",
|
|
22
|
+
"brand-success-decent": "#f6fbf5",
|
|
23
|
+
"brand-warning-decent": "#fdf5f0",
|
|
24
|
+
"brand-danger-decent": "#fdf3f3",
|
|
25
|
+
"color-code": "#f3f3f4",
|
|
26
|
+
"color-status-available": "#239b7d",
|
|
27
|
+
"color-status-driving": "#3690ae",
|
|
28
|
+
"color-status-resting": "#626b72",
|
|
29
|
+
"color-status-working": "#94488b",
|
|
30
|
+
"color-map-marker-active": "#ffffff",
|
|
31
|
+
"color-map-marker-asset": "#2a3740",
|
|
32
|
+
"color-map-marker-poi": "#b23672",
|
|
33
|
+
"color-map-marker-geofence": "#5a4876",
|
|
34
|
+
"color-map-marker-route": "#3690ae",
|
|
35
|
+
"color-map-marker-text": "#ffffff",
|
|
36
|
+
"color-map-marker-active-night": "#ededed",
|
|
37
|
+
"color-map-marker-asset-night": "#6e757a",
|
|
38
|
+
"color-map-marker-poi-night": "#b23672",
|
|
39
|
+
"color-map-marker-geofence-night": "#79619f",
|
|
40
|
+
"color-map-marker-route-night": "#3b9fc1",
|
|
41
|
+
"color-map-marker-text-night": "#ededed",
|
|
42
|
+
"color-rating-1": "#d90000",
|
|
43
|
+
"color-rating-2": "#ff8e3c",
|
|
44
|
+
"color-rating-3": "#f8c575",
|
|
45
|
+
"color-rating-4": "#5cb85c",
|
|
46
|
+
"color-rating-5": "#4b924c",
|
|
47
|
+
"color-highlight-darkest": "#114146",
|
|
48
|
+
"color-highlight-darker": "#1c686e",
|
|
49
|
+
"color-highlight-dark": "#268e97",
|
|
50
|
+
"color-highlight": "#30b4c0",
|
|
51
|
+
"color-highlight-light": "#8ddbe3",
|
|
52
|
+
"color-highlight-lighter": "#cef0f3",
|
|
53
|
+
"color-highlight-lightest": "#ebf9fa",
|
|
54
|
+
"color-highlight-decent": "#f3fbfc",
|
|
55
|
+
"color-coldplay-wine": "#520D4E",
|
|
56
|
+
"color-coldplay-aubergine": "#5a4876",
|
|
57
|
+
"color-coldplay-kashmir": "#536E8B",
|
|
58
|
+
"color-coldplay-fountain": "#67abc5",
|
|
59
|
+
"color-coldplay-turquoise": "#4ECCC1",
|
|
60
|
+
"color-coldplay-bermuda": "#79D4B3",
|
|
61
|
+
"color-coldplay-moos": "#A1DAA3",
|
|
62
|
+
"color-coldplay-primrose": "#C7E291",
|
|
63
|
+
"color-coldplay-khaki": "#F0EB83",
|
|
64
|
+
"color-warmup-crimson": "#31144F",
|
|
65
|
+
"color-warmup-victoria": "#493D6D",
|
|
66
|
+
"color-warmup-cadillac": "#7E3E72",
|
|
67
|
+
"color-warmup-raspberry": "#B23672",
|
|
68
|
+
"color-warmup-cerise": "#E72472",
|
|
69
|
+
"color-warmup-charm": "#C9778D",
|
|
70
|
+
"color-warmup-salmon": "#F19588",
|
|
71
|
+
"color-warmup-cherokee": "#F5BB89",
|
|
72
|
+
"color-warmup-corn": "#FDE082"
|
|
73
|
+
}
|
package/types.ts
CHANGED
|
@@ -16,8 +16,11 @@ export interface ActionBarItemPopoverProps {
|
|
|
16
16
|
|
|
17
17
|
export interface ActionBarItemProps {
|
|
18
18
|
id?: string;
|
|
19
|
-
className?: string;
|
|
20
19
|
title?: string | React.ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
hidePopoverOnClick?: boolean;
|
|
22
|
+
popoverWidth?: 100 | 150 | 200 | 250 | 300 | 350 | 400 | 450 | 500;
|
|
23
|
+
mobileDialogBodyClassName?: string;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export interface ActionBarItemListProps {
|
|
@@ -297,7 +300,7 @@ export interface BottomSheetProps {
|
|
|
297
300
|
showCloseButton?: boolean;
|
|
298
301
|
showMaximizeButton?: boolean;
|
|
299
302
|
onHeightChange?: Function;
|
|
300
|
-
|
|
303
|
+
detach?: boolean;
|
|
301
304
|
useBackdrop?: boolean;
|
|
302
305
|
onBackdropClick?: Function;
|
|
303
306
|
bodyRef?: React.MutableRefObject<object>;
|
|
@@ -2236,6 +2239,8 @@ export type UseWindowResize = (callback: () => void, timeout?: number) => void;
|
|
|
2236
2239
|
|
|
2237
2240
|
export type UseDarkMode = () => boolean;
|
|
2238
2241
|
|
|
2242
|
+
export type UsePrevious = <T>(state: T | undefined | null) => T | undefined | null;
|
|
2243
|
+
|
|
2239
2244
|
export type UseMutationObserver = (
|
|
2240
2245
|
targetElement: HTMLElement | React.MutableRefObject<object> | null | undefined,
|
|
2241
2246
|
callback: MutationCallback | undefined,
|
package/usePrevious.d.ts
ADDED
package/usePrevious.js
ADDED
package/utils/cssuseragent.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CssUserAgent (cssua.js) v2.1.31
|
|
3
|
-
* http://cssuseragent.org
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c)2006-2015 Stephen M. McKamey.
|
|
6
|
-
* Licensed under The MIT License.
|
|
1
|
+
/**
|
|
2
|
+
* CssUserAgent (cssua.js) v2.1.31
|
|
3
|
+
* http://cssuseragent.org
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c)2006-2015 Stephen M. McKamey.
|
|
6
|
+
* Licensed under The MIT License.
|
|
7
7
|
*/
|
|
8
8
|
/*jshint smarttabs:true, regexp:false, browser:true */
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* @param html {Object} root DOM element
|
|
12
|
-
* @param userAgent {string} browser userAgent string
|
|
13
|
-
* @return {Object}
|
|
10
|
+
/**
|
|
11
|
+
* @param html {Object} root DOM element
|
|
12
|
+
* @param userAgent {string} browser userAgent string
|
|
13
|
+
* @return {Object}
|
|
14
14
|
*/
|
|
15
15
|
export var cssua = function cssua(html, userAgent, sa) {
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* @const
|
|
20
|
-
* @type {string}
|
|
18
|
+
/**
|
|
19
|
+
* @const
|
|
20
|
+
* @type {string}
|
|
21
21
|
*/
|
|
22
22
|
var PREFIX = ' ua-';
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* @const
|
|
26
|
-
* @type {RegExp}
|
|
24
|
+
/**
|
|
25
|
+
* @const
|
|
26
|
+
* @type {RegExp}
|
|
27
27
|
*/
|
|
28
28
|
var R_Platform = /\s*([\-\w ]+)[\s\/\:]([\d_]+\b(?:[\-\._\/]\w+)*)/;
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* @const
|
|
32
|
-
* @type {RegExp}
|
|
30
|
+
/**
|
|
31
|
+
* @const
|
|
32
|
+
* @type {RegExp}
|
|
33
33
|
*/
|
|
34
34
|
var R_Version = /([\w\-\.]+[\s\/][v]?[\d_]+\b(?:[\-\._\/]\w+)*)/g;
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* @const
|
|
38
|
-
* @type {RegExp}
|
|
36
|
+
/**
|
|
37
|
+
* @const
|
|
38
|
+
* @type {RegExp}
|
|
39
39
|
*/
|
|
40
40
|
var R_BlackBerry = /\b(?:(blackberry\w*|bb10)|(rim tablet os))(?:\/(\d+\.\d+(?:\.\w+)*))?/;
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* @const
|
|
44
|
-
* @type {RegExp}
|
|
42
|
+
/**
|
|
43
|
+
* @const
|
|
44
|
+
* @type {RegExp}
|
|
45
45
|
*/
|
|
46
46
|
var R_Silk = /\bsilk-accelerated=true\b/;
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* @const
|
|
50
|
-
* @type {RegExp}
|
|
48
|
+
/**
|
|
49
|
+
* @const
|
|
50
|
+
* @type {RegExp}
|
|
51
51
|
*/
|
|
52
52
|
var R_FluidApp = /\bfluidapp\b/;
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* @const
|
|
56
|
-
* @type {RegExp}
|
|
54
|
+
/**
|
|
55
|
+
* @const
|
|
56
|
+
* @type {RegExp}
|
|
57
57
|
*/
|
|
58
58
|
var R_desktop = /(\bwindows\b|\bmacintosh\b|\blinux\b|\bunix\b)/;
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
* @const
|
|
62
|
-
* @type {RegExp}
|
|
60
|
+
/**
|
|
61
|
+
* @const
|
|
62
|
+
* @type {RegExp}
|
|
63
63
|
*/
|
|
64
64
|
var R_mobile = /(\bandroid\b|\bipad\b|\bipod\b|\bwindows phone\b|\bwpdesktop\b|\bxblwp7\b|\bzunewp7\b|\bwindows ce\b|\bblackberry\w*|\bbb10\b|\brim tablet os\b|\bmeego|\bwebos\b|\bpalm|\bsymbian|\bj2me\b|\bdocomo\b|\bpda\b|\bchtml\b|\bmidp\b|\bcldc\b|\w*?mobile\w*?|\w*?phone\w*?)/;
|
|
65
65
|
|
|
66
|
-
/**
|
|
67
|
-
* @const
|
|
68
|
-
* @type {RegExp}
|
|
66
|
+
/**
|
|
67
|
+
* @const
|
|
68
|
+
* @type {RegExp}
|
|
69
69
|
*/
|
|
70
70
|
var R_game = /(\bxbox\b|\bplaystation\b|\bnintendo\s+\w+)/;
|
|
71
71
|
|
|
72
|
-
/**
|
|
73
|
-
* The root CssUserAgent
|
|
74
|
-
* @type {Object}
|
|
72
|
+
/**
|
|
73
|
+
* The root CssUserAgent
|
|
74
|
+
* @type {Object}
|
|
75
75
|
*/
|
|
76
76
|
var cssua = {
|
|
77
77
|
parse:
|
|
78
|
-
/**
|
|
79
|
-
* @param uaStr {string}
|
|
80
|
-
* @return {Object}
|
|
78
|
+
/**
|
|
79
|
+
* @param uaStr {string}
|
|
80
|
+
* @return {Object}
|
|
81
81
|
*/
|
|
82
82
|
function parse(uaStr, sa) {
|
|
83
|
-
/**
|
|
84
|
-
* @type {Object}
|
|
83
|
+
/**
|
|
84
|
+
* @type {Object}
|
|
85
85
|
*/
|
|
86
86
|
var ua = {};
|
|
87
87
|
if (sa) {
|
|
@@ -234,21 +234,21 @@ export var cssua = function cssua(html, userAgent, sa) {
|
|
|
234
234
|
return ua;
|
|
235
235
|
},
|
|
236
236
|
format:
|
|
237
|
-
/**
|
|
238
|
-
* @param ua {Object}
|
|
239
|
-
* @return {string}
|
|
237
|
+
/**
|
|
238
|
+
* @param ua {Object}
|
|
239
|
+
* @return {string}
|
|
240
240
|
*/
|
|
241
241
|
function format(ua) {
|
|
242
|
-
/**
|
|
243
|
-
* @param b {string} browser key
|
|
244
|
-
* @param v {string} browser value
|
|
245
|
-
* @return {string} formatted CSS classes
|
|
242
|
+
/**
|
|
243
|
+
* @param b {string} browser key
|
|
244
|
+
* @param v {string} browser value
|
|
245
|
+
* @return {string} formatted CSS classes
|
|
246
246
|
*/
|
|
247
247
|
function format(b, v) {
|
|
248
248
|
b = b.split('.').join('-');
|
|
249
249
|
|
|
250
|
-
/**
|
|
251
|
-
* @type {string}
|
|
250
|
+
/**
|
|
251
|
+
* @type {string}
|
|
252
252
|
*/
|
|
253
253
|
var css = PREFIX + b;
|
|
254
254
|
if (typeof v === 'string') {
|
|
@@ -265,8 +265,8 @@ export var cssua = function cssua(html, userAgent, sa) {
|
|
|
265
265
|
return css;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
/**
|
|
269
|
-
* @type {string}
|
|
268
|
+
/**
|
|
269
|
+
* @type {string}
|
|
270
270
|
*/
|
|
271
271
|
var uaCss = '';
|
|
272
272
|
for (var b in ua) {
|
|
@@ -279,10 +279,10 @@ export var cssua = function cssua(html, userAgent, sa) {
|
|
|
279
279
|
return uaCss;
|
|
280
280
|
},
|
|
281
281
|
encode:
|
|
282
|
-
/**
|
|
283
|
-
* Encodes parsed userAgent object as a compact URI-Encoded key-value collection
|
|
284
|
-
* @param ua {Object}
|
|
285
|
-
* @return {string}
|
|
282
|
+
/**
|
|
283
|
+
* Encodes parsed userAgent object as a compact URI-Encoded key-value collection
|
|
284
|
+
* @param ua {Object}
|
|
285
|
+
* @return {string}
|
|
286
286
|
*/
|
|
287
287
|
function encode(ua) {
|
|
288
288
|
var query = '';
|
|
@@ -298,15 +298,15 @@ export var cssua = function cssua(html, userAgent, sa) {
|
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
300
|
|
|
301
|
-
/**
|
|
302
|
-
* @const
|
|
303
|
-
* @type {Object}
|
|
301
|
+
/**
|
|
302
|
+
* @const
|
|
303
|
+
* @type {Object}
|
|
304
304
|
*/
|
|
305
305
|
cssua.userAgent = cssua.ua = cssua.parse(userAgent, sa);
|
|
306
306
|
|
|
307
|
-
/**
|
|
308
|
-
* @const
|
|
309
|
-
* @type {string}
|
|
307
|
+
/**
|
|
308
|
+
* @const
|
|
309
|
+
* @type {string}
|
|
310
310
|
*/
|
|
311
311
|
var ua = cssua.format(cssua.ua) + ' js';
|
|
312
312
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var normalizeForSearch = function normalizeForSearch(input) {
|
|
2
|
+
return input.replaceAll(/\s+/g, ' ').toLowerCase();
|
|
3
|
+
};
|
|
4
|
+
export var searchNormalized = function searchNormalized(input, search) {
|
|
5
|
+
return normalizeForSearch(input).includes(normalizeForSearch(search));
|
|
6
|
+
};
|
package/version.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.16.3-beta.
|
|
3
|
-
}
|
|
2
|
+
"version": "0.16.3-beta.5"
|
|
3
|
+
}
|