@rio-cloud/rio-uikit 0.16.0-beta-2 → 0.16.0-beta-3
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/lib/components/filepicker/FilePicker.js +65 -96
- package/lib/es/useFullscreen.d.ts +4 -0
- package/lib/hooks/useFullscreen.js +1 -3
- package/lib/style/css/_exports/rio-website.less +6 -2
- package/lib/style/css/components/Select.less +14 -0
- package/lib/style/fonts/rioglyph/rioglyph.less +6 -1
- package/lib/style/fonts/rioglyph/rioglyph.woff +0 -0
- package/lib/types.ts +32 -2
- package/lib/version.json +1 -1
- package/package.json +4 -4
|
@@ -9,124 +9,90 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
23
15
|
|
|
24
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
25
17
|
|
|
26
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
19
|
|
|
28
|
-
var _reactDropzone =
|
|
20
|
+
var _reactDropzone = _interopRequireWildcard(require("react-dropzone"));
|
|
29
21
|
|
|
30
22
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
31
23
|
|
|
32
24
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
25
|
|
|
26
|
+
var _excluded = ["label", "accept", "multiple", "maxSize", "displayMode", "onPick", "className", "children"];
|
|
27
|
+
|
|
34
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
29
|
|
|
36
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
className: (0, _classnames.default)('invisible')
|
|
92
|
-
}, dropzoneProps);
|
|
93
|
-
|
|
94
|
-
var content = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_reactDropzone.default, dropzoneProps), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
95
|
-
onClick: this.onOpenClick.bind(this),
|
|
96
|
-
className: this.props.className
|
|
97
|
-
}, this.props.label)); // }
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
className: "FilePicker"
|
|
102
|
-
}, content);
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "onPick",
|
|
106
|
-
value: function onPick(acceptedFiles, rejectedFiles) {
|
|
107
|
-
this.props.onPick(acceptedFiles, rejectedFiles);
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "onOpenClick",
|
|
111
|
-
value: function onOpenClick() {
|
|
112
|
-
this.thisDropzone.open();
|
|
113
|
-
}
|
|
114
|
-
}]);
|
|
115
|
-
return FilePicker;
|
|
116
|
-
}(_react.Component);
|
|
117
|
-
|
|
118
|
-
exports.default = FilePicker;
|
|
32
|
+
var FilePicker = function FilePicker(props) {
|
|
33
|
+
var label = props.label,
|
|
34
|
+
accept = props.accept,
|
|
35
|
+
multiple = props.multiple,
|
|
36
|
+
maxSize = props.maxSize,
|
|
37
|
+
displayMode = props.displayMode,
|
|
38
|
+
onPick = props.onPick,
|
|
39
|
+
className = props.className,
|
|
40
|
+
children = props.children,
|
|
41
|
+
remainigProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
42
|
+
var dropzoneRef = (0, _react.useRef)();
|
|
43
|
+
var isButton = displayMode === 'button';
|
|
44
|
+
var isDropzone = displayMode === 'dropzone';
|
|
45
|
+
var isFull = displayMode === 'full';
|
|
46
|
+
var showButton = isButton || isFull;
|
|
47
|
+
var showDropzone = isDropzone || isFull;
|
|
48
|
+
var handleDrop = (0, _react.useCallback)(function (acceptedFiles, rejectedFiles) {
|
|
49
|
+
var files = accept.includes('image') ? acceptedFiles.map(function (file) {
|
|
50
|
+
return Object.assign(file, {
|
|
51
|
+
preview: URL.createObjectURL(file)
|
|
52
|
+
});
|
|
53
|
+
}) : acceptedFiles;
|
|
54
|
+
onPick(files, rejectedFiles);
|
|
55
|
+
}, [onPick, accept]);
|
|
56
|
+
|
|
57
|
+
var onOpenClick = function onOpenClick() {
|
|
58
|
+
return dropzoneRef.current.open();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: "FilePicker"
|
|
63
|
+
}, showButton && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
64
|
+
onClick: onOpenClick,
|
|
65
|
+
className: className
|
|
66
|
+
}, label), /*#__PURE__*/_react.default.createElement(_reactDropzone.default, (0, _extends2.default)({}, remainigProps, {
|
|
67
|
+
onDrop: handleDrop,
|
|
68
|
+
accept: accept,
|
|
69
|
+
multiple: multiple,
|
|
70
|
+
maxSize: maxSize,
|
|
71
|
+
ref: dropzoneRef
|
|
72
|
+
}), function (_ref) {
|
|
73
|
+
var getRootProps = _ref.getRootProps,
|
|
74
|
+
getInputProps = _ref.getInputProps,
|
|
75
|
+
isDragActive = _ref.isDragActive;
|
|
76
|
+
return showDropzone && /*#__PURE__*/_react.default.createElement("div", getRootProps(), /*#__PURE__*/_react.default.createElement("input", getInputProps()), children && children({
|
|
77
|
+
isDragActive: isDragActive
|
|
78
|
+
}));
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
FilePicker.DISPLAY_MODE_BUTTON = 'button';
|
|
83
|
+
FilePicker.DISPLAY_MODE_DROPZONE = 'dropzone';
|
|
84
|
+
FilePicker.DISPLAY_MODE_FULL = 'full';
|
|
119
85
|
FilePicker.defaultProps = {
|
|
120
86
|
displayMode: 'button',
|
|
121
87
|
multiple: true,
|
|
122
|
-
label: 'Select
|
|
88
|
+
label: 'Select Files',
|
|
123
89
|
accept: '',
|
|
124
90
|
onPick: function onPick() {},
|
|
125
91
|
className: ''
|
|
126
92
|
};
|
|
127
93
|
FilePicker.propTypes = {
|
|
128
94
|
displayMode: _propTypes.default.string
|
|
129
|
-
/* Display mode: 'dropzone' / 'button' */
|
|
95
|
+
/* Display mode: 'dropzone' / 'button' / 'full' */
|
|
130
96
|
,
|
|
131
97
|
multiple: _propTypes.default.bool
|
|
132
98
|
/* Allow multiple file selections or not */
|
|
@@ -145,5 +111,8 @@ FilePicker.propTypes = {
|
|
|
145
111
|
,
|
|
146
112
|
className: _propTypes.default.string
|
|
147
113
|
/* Custom className for the displayed component (dropzone/button) */
|
|
148
|
-
|
|
149
|
-
|
|
114
|
+
,
|
|
115
|
+
children: _propTypes.default.any
|
|
116
|
+
};
|
|
117
|
+
var _default = FilePicker;
|
|
118
|
+
exports.default = _default;
|
|
@@ -52,10 +52,8 @@ var defaultValue = {
|
|
|
52
52
|
requestFullscreen: _noop.default,
|
|
53
53
|
exitFullscreen: _noop.default,
|
|
54
54
|
toggleFullscreen: _noop.default,
|
|
55
|
-
isEnabled: false,
|
|
56
55
|
isFullscreen: false,
|
|
57
|
-
|
|
58
|
-
onError: _noop.default
|
|
56
|
+
isEnabled: false
|
|
59
57
|
}; // type RequestFullscreenOptions = {
|
|
60
58
|
// // string will help to ease type casting
|
|
61
59
|
// navigationUI?: string | 'auto' | 'hide' | 'show';
|
|
@@ -1604,12 +1604,12 @@ body .module-content {
|
|
|
1604
1604
|
@media (max-width: @screen-md) {
|
|
1605
1605
|
.marketplace-search-header {
|
|
1606
1606
|
&:before {
|
|
1607
|
-
background: linear-gradient(0deg,
|
|
1607
|
+
background: linear-gradient(0deg,rgba(0,0,0,.85),rgba(0,0,0,.50));
|
|
1608
1608
|
bottom: 0;
|
|
1609
1609
|
content: "";
|
|
1610
1610
|
left: 0;
|
|
1611
1611
|
position: absolute;
|
|
1612
|
-
height:
|
|
1612
|
+
height: 100%;
|
|
1613
1613
|
width: 100%;
|
|
1614
1614
|
}
|
|
1615
1615
|
}
|
|
@@ -1789,6 +1789,10 @@ blockquote {
|
|
|
1789
1789
|
overflow: hidden;
|
|
1790
1790
|
text-overflow: ellipsis;
|
|
1791
1791
|
white-space: nowrap;
|
|
1792
|
+
|
|
1793
|
+
.marketplace-details-panel & {
|
|
1794
|
+
max-width: calc(~"100vw - 110px");
|
|
1795
|
+
}
|
|
1792
1796
|
}
|
|
1793
1797
|
|
|
1794
1798
|
// no scale animations on mobile
|
|
@@ -188,6 +188,20 @@
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
&.dropup.open .dropdown-menu {
|
|
192
|
+
bottom: 0;
|
|
193
|
+
left: 0;
|
|
194
|
+
transform: translateY(~"-@{btn-size-default}");
|
|
195
|
+
|
|
196
|
+
.input-sm & {
|
|
197
|
+
transform: translateY(~"-@{btn-size-sm}");
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.input-lg & {
|
|
201
|
+
transform: translateY(~"-@{btn-size-lg}");
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
191
205
|
.inactiveIcon {
|
|
192
206
|
.rioglyph, span {
|
|
193
207
|
color: @gray-light!important;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@font-face {
|
|
4
4
|
font-family: "rioglyph";
|
|
5
|
-
src: url("rioglyph.woff?
|
|
5
|
+
src: url("rioglyph.woff?14b6680c6235c42a26bca0913e1eea27") format("woff");
|
|
6
6
|
font-weight: normal;
|
|
7
7
|
font-style: normal;
|
|
8
8
|
}
|
|
@@ -1094,6 +1094,11 @@
|
|
|
1094
1094
|
.hover-rioglyph-share-alt:hover:before {
|
|
1095
1095
|
content: "\e982";
|
|
1096
1096
|
}
|
|
1097
|
+
@rioglyph-ship: "\f18d";
|
|
1098
|
+
.rioglyph-ship:before,
|
|
1099
|
+
.hover-rioglyph-ship:hover:before {
|
|
1100
|
+
content: "\f18d";
|
|
1101
|
+
}
|
|
1097
1102
|
@rioglyph-shopping-cart: "\e98b";
|
|
1098
1103
|
.rioglyph-shopping-cart:before,
|
|
1099
1104
|
.hover-rioglyph-shopping-cart:hover:before {
|
|
Binary file
|
package/lib/types.ts
CHANGED
|
@@ -633,14 +633,19 @@ export interface FadeProps {
|
|
|
633
633
|
onExited?: Function;
|
|
634
634
|
}
|
|
635
635
|
|
|
636
|
+
type FilePickerRenderProps = {
|
|
637
|
+
isDragActive: boolean;
|
|
638
|
+
};
|
|
639
|
+
|
|
636
640
|
export interface FilePickerProps {
|
|
637
|
-
displayMode?: 'button';
|
|
641
|
+
displayMode?: 'button' | 'dropzone' | 'full';
|
|
638
642
|
multiple?: boolean; // multi select
|
|
639
643
|
label?: string | React.ReactNode;
|
|
640
644
|
maxSize?: number; // max file size
|
|
641
|
-
onPick: (files: FileList | null) =>
|
|
645
|
+
onPick: (files: FileList | null) => void;
|
|
642
646
|
className?: string;
|
|
643
647
|
accept?: string;
|
|
648
|
+
children?: ({ isDragActive }: FilePickerRenderProps) => any;
|
|
644
649
|
}
|
|
645
650
|
|
|
646
651
|
export interface ForbiddenStateProps extends BaseStateProps {}
|
|
@@ -2047,6 +2052,31 @@ export type UseEvent<T extends keyof WindowEventMap> = (
|
|
|
2047
2052
|
target?: HTMLElement
|
|
2048
2053
|
) => void;
|
|
2049
2054
|
|
|
2055
|
+
type EventCallback = (this: Document, event_: any) => any;
|
|
2056
|
+
type OnChangeEventCallback = (this: Document, event_: any, isOpen: boolean) => any;
|
|
2057
|
+
|
|
2058
|
+
type RequestFullscreenOptions = {
|
|
2059
|
+
// string will help to ease type casting
|
|
2060
|
+
navigationUI?: string | 'auto' | 'hide' | 'show';
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
type FullScreenOptions = {
|
|
2064
|
+
element?: HTMLElement;
|
|
2065
|
+
onChange?: OnChangeEventCallback;
|
|
2066
|
+
onError?: EventCallback;
|
|
2067
|
+
requestFullscreenOptions?: RequestFullscreenOptions;
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
type FullscreenApi = {
|
|
2071
|
+
requestFullscreen: () => void | ((element?: HTMLElement) => Promise<unknown>);
|
|
2072
|
+
exitFullscreen: () => void | (() => Promise<unknown>);
|
|
2073
|
+
toggleFullscreen: () => void | ((element?: HTMLElement) => Promise<unknown>);
|
|
2074
|
+
isEnabled: boolean;
|
|
2075
|
+
isFullscreen: boolean;
|
|
2076
|
+
};
|
|
2077
|
+
|
|
2078
|
+
export type UseFullscreen = ({}: FullScreenOptions) => FullscreenApi | undefined;
|
|
2079
|
+
|
|
2050
2080
|
export type UseInterval = (callback: () => void, delay?: number) => React.MutableRefObject<object>;
|
|
2051
2081
|
|
|
2052
2082
|
export type UseKey<T extends keyof WindowEventMap> = (
|
package/lib/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rio-cloud/rio-uikit",
|
|
3
|
-
"version": "0.16.0-beta-
|
|
3
|
+
"version": "0.16.0-beta-3",
|
|
4
4
|
"description": "The RIO UIKIT component library",
|
|
5
5
|
"repository": "https://collaboration.msi.audi.com/stash/projects/RIOFRONT/repos/uikit-web/browse",
|
|
6
6
|
"scripts": {
|
|
@@ -123,19 +123,19 @@
|
|
|
123
123
|
"react-dom": ">16.8.6"
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@popperjs/core": "2.11.
|
|
126
|
+
"@popperjs/core": "2.11.5",
|
|
127
127
|
"classlist-polyfill": "1.2.0",
|
|
128
128
|
"classnames": "2.3.1",
|
|
129
129
|
"cssuseragent": "2.1.31",
|
|
130
130
|
"lodash": "4.17.21",
|
|
131
|
-
"moment": "2.29.
|
|
131
|
+
"moment": "2.29.2",
|
|
132
132
|
"natural-orderby": "2.0.3",
|
|
133
133
|
"prop-types": "15.8.1",
|
|
134
134
|
"react-bootstrap": "1.6.4",
|
|
135
135
|
"react-content-loader": "6.1.0",
|
|
136
136
|
"react-datetime": "github:rio-cloud/react-datetime#v3.1.0-1-merged",
|
|
137
137
|
"react-debounce-input": "3.2.5",
|
|
138
|
-
"react-dropzone": "
|
|
138
|
+
"react-dropzone": "12.0.4",
|
|
139
139
|
"react-input-mask": "3.0.0-alpha.2",
|
|
140
140
|
"react-motion": "0.5.2",
|
|
141
141
|
"react-notifications": "1.7.3",
|