@mtes-mct/monitor-ui 5.9.0 → 5.9.1
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/CHANGELOG.md +7 -0
- package/components/Dialog/index.d.ts +2 -2
- package/index.js +69 -68
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [5.9.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.8.1...v5.9.0) (2023-05-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **components:** add Dialog ([89057d2](https://github.com/MTES-MCT/monitor-ui/commit/89057d25674f76b8298fc432a6bd1f521b25f605))
|
|
7
|
+
|
|
1
8
|
## [5.8.1](https://github.com/MTES-MCT/monitor-ui/compare/v5.8.0...v5.8.1) (2023-05-04)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
export type DialogProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
isAbsolute?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function RawDialog({ children, isAbsolute, ...nativeProps }: DialogProps): JSX.Element;
|
|
5
|
+
export declare function RawDialog({ children, className, isAbsolute, ...nativeProps }: DialogProps): JSX.Element;
|
|
6
6
|
export declare namespace RawDialog {
|
|
7
7
|
var displayName: string;
|
|
8
8
|
}
|
package/index.js
CHANGED
|
@@ -2163,6 +2163,68 @@ function ThemeProvider({ children, theme = {} }) {
|
|
|
2163
2163
|
return jsx(UntypedStyledComponentsThemeProvider, { theme: finalTheme, children: children });
|
|
2164
2164
|
}
|
|
2165
2165
|
|
|
2166
|
+
var classnames = {exports: {}};
|
|
2167
|
+
|
|
2168
|
+
/*!
|
|
2169
|
+
Copyright (c) 2018 Jed Watson.
|
|
2170
|
+
Licensed under the MIT License (MIT), see
|
|
2171
|
+
http://jedwatson.github.io/classnames
|
|
2172
|
+
*/
|
|
2173
|
+
|
|
2174
|
+
(function (module) {
|
|
2175
|
+
/* global define */
|
|
2176
|
+
|
|
2177
|
+
(function () {
|
|
2178
|
+
|
|
2179
|
+
var hasOwn = {}.hasOwnProperty;
|
|
2180
|
+
|
|
2181
|
+
function classNames() {
|
|
2182
|
+
var classes = [];
|
|
2183
|
+
|
|
2184
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
2185
|
+
var arg = arguments[i];
|
|
2186
|
+
if (!arg) continue;
|
|
2187
|
+
|
|
2188
|
+
var argType = typeof arg;
|
|
2189
|
+
|
|
2190
|
+
if (argType === 'string' || argType === 'number') {
|
|
2191
|
+
classes.push(arg);
|
|
2192
|
+
} else if (Array.isArray(arg)) {
|
|
2193
|
+
if (arg.length) {
|
|
2194
|
+
var inner = classNames.apply(null, arg);
|
|
2195
|
+
if (inner) {
|
|
2196
|
+
classes.push(inner);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
} else if (argType === 'object') {
|
|
2200
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
2201
|
+
classes.push(arg.toString());
|
|
2202
|
+
continue;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
for (var key in arg) {
|
|
2206
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
2207
|
+
classes.push(key);
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
return classes.join(' ');
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
if (module.exports) {
|
|
2217
|
+
classNames.default = classNames;
|
|
2218
|
+
module.exports = classNames;
|
|
2219
|
+
} else {
|
|
2220
|
+
window.classNames = classNames;
|
|
2221
|
+
}
|
|
2222
|
+
}());
|
|
2223
|
+
} (classnames));
|
|
2224
|
+
|
|
2225
|
+
var classnamesExports = classnames.exports;
|
|
2226
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
2227
|
+
|
|
2166
2228
|
const Action = styled.div `
|
|
2167
2229
|
background-color: ${p => p.theme.color.white};
|
|
2168
2230
|
border-bottom-left-radius: 2px;
|
|
@@ -2218,8 +2280,13 @@ const Title = styled.h4 `
|
|
|
2218
2280
|
text-align: center;
|
|
2219
2281
|
`;
|
|
2220
2282
|
|
|
2221
|
-
function
|
|
2222
|
-
|
|
2283
|
+
function stopMouseEventPropagation(event) {
|
|
2284
|
+
event.stopPropagation();
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
function RawDialog({ children, className, isAbsolute = false, ...nativeProps }) {
|
|
2288
|
+
const controlledClassName = useMemo(() => classNames('Component-Dialog', className), [className]);
|
|
2289
|
+
return (jsxs(Box$g, { "$isAbsolute": isAbsolute, className: controlledClassName, ...nativeProps, onClick: stopMouseEventPropagation, children: [jsx(Overlay, { "$isAbsolute": isAbsolute }), jsx(Window, { "$isAbsolute": isAbsolute, children: children })] }));
|
|
2223
2290
|
}
|
|
2224
2291
|
const Box$g = styled.div `
|
|
2225
2292
|
position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
|
|
@@ -2637,10 +2704,6 @@ function toWindowFeatures(features) {
|
|
|
2637
2704
|
.join(',');
|
|
2638
2705
|
}
|
|
2639
2706
|
|
|
2640
|
-
function stopMouseEventPropagation(event) {
|
|
2641
|
-
event.stopPropagation();
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
2707
|
const ICON_SIZE = {
|
|
2645
2708
|
[Size.LARGE]: 20,
|
|
2646
2709
|
[Size.NORMAL]: 20,
|
|
@@ -3247,68 +3310,6 @@ const StyledIconButton = styled(IconButton) `
|
|
|
3247
3310
|
}
|
|
3248
3311
|
`;
|
|
3249
3312
|
|
|
3250
|
-
var classnames = {exports: {}};
|
|
3251
|
-
|
|
3252
|
-
/*!
|
|
3253
|
-
Copyright (c) 2018 Jed Watson.
|
|
3254
|
-
Licensed under the MIT License (MIT), see
|
|
3255
|
-
http://jedwatson.github.io/classnames
|
|
3256
|
-
*/
|
|
3257
|
-
|
|
3258
|
-
(function (module) {
|
|
3259
|
-
/* global define */
|
|
3260
|
-
|
|
3261
|
-
(function () {
|
|
3262
|
-
|
|
3263
|
-
var hasOwn = {}.hasOwnProperty;
|
|
3264
|
-
|
|
3265
|
-
function classNames() {
|
|
3266
|
-
var classes = [];
|
|
3267
|
-
|
|
3268
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
3269
|
-
var arg = arguments[i];
|
|
3270
|
-
if (!arg) continue;
|
|
3271
|
-
|
|
3272
|
-
var argType = typeof arg;
|
|
3273
|
-
|
|
3274
|
-
if (argType === 'string' || argType === 'number') {
|
|
3275
|
-
classes.push(arg);
|
|
3276
|
-
} else if (Array.isArray(arg)) {
|
|
3277
|
-
if (arg.length) {
|
|
3278
|
-
var inner = classNames.apply(null, arg);
|
|
3279
|
-
if (inner) {
|
|
3280
|
-
classes.push(inner);
|
|
3281
|
-
}
|
|
3282
|
-
}
|
|
3283
|
-
} else if (argType === 'object') {
|
|
3284
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
3285
|
-
classes.push(arg.toString());
|
|
3286
|
-
continue;
|
|
3287
|
-
}
|
|
3288
|
-
|
|
3289
|
-
for (var key in arg) {
|
|
3290
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
3291
|
-
classes.push(key);
|
|
3292
|
-
}
|
|
3293
|
-
}
|
|
3294
|
-
}
|
|
3295
|
-
}
|
|
3296
|
-
|
|
3297
|
-
return classes.join(' ');
|
|
3298
|
-
}
|
|
3299
|
-
|
|
3300
|
-
if (module.exports) {
|
|
3301
|
-
classNames.default = classNames;
|
|
3302
|
-
module.exports = classNames;
|
|
3303
|
-
} else {
|
|
3304
|
-
window.classNames = classNames;
|
|
3305
|
-
}
|
|
3306
|
-
}());
|
|
3307
|
-
} (classnames));
|
|
3308
|
-
|
|
3309
|
-
var classnamesExports = classnames.exports;
|
|
3310
|
-
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
3311
|
-
|
|
3312
3313
|
const Field$2 = styled.div.attrs(props => ({
|
|
3313
3314
|
className: classNames('Element-Field', props.className)
|
|
3314
3315
|
})) `
|