@m4l/components 0.1.5 → 0.1.6
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/components/LanguagePopover/index.d.ts +1 -2
- package/components/LanguagePopover/index.js +13 -11
- package/components/LanguagePopover/styles.d.ts +2 -0
- package/components/formatters/DateFormatter/index.js +6 -1
- package/components/formatters/DateFormatter/types.d.ts +2 -1
- package/core-js.js +16 -6
- package/index.js +1 -1
- package/package.json +1 -1
- package/components/LanguagePopover/types.d.ts +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
-
import { Skeleton, IconButton, Stack, MenuItem } from "@mui/material";
|
|
2
|
+
import { styled, Skeleton, IconButton, Stack, MenuItem } from "@mui/material";
|
|
3
3
|
import { I as Image } from "../Image/index.js";
|
|
4
4
|
import { useLocales } from "@m4l/graphics";
|
|
5
|
-
import "@m4l/core";
|
|
5
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
6
6
|
import "../Icon/index.js";
|
|
7
7
|
import "@mui/material/styles";
|
|
8
8
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
@@ -14,10 +14,13 @@ import { M as MenuPopover } from "../mui_extended/MenuPopover/index.js";
|
|
|
14
14
|
import "../CommonActions/components/Actions/index.js";
|
|
15
15
|
import "../mui_extended/Pager/index.js";
|
|
16
16
|
import "../mui_extended/Tab/index.js";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const LabelItem = styled("div")(({
|
|
18
|
+
theme
|
|
19
|
+
}) => ({
|
|
20
|
+
marginLeft: theme.spacing(1)
|
|
21
|
+
}));
|
|
22
|
+
function LanguagePopover() {
|
|
23
|
+
const isSkeleton = useModuleSkeleton();
|
|
21
24
|
const {
|
|
22
25
|
allLang,
|
|
23
26
|
currentLang,
|
|
@@ -76,11 +79,10 @@ function LanguagePopover(props) {
|
|
|
76
79
|
children: [/* @__PURE__ */ jsx(Image, {
|
|
77
80
|
alt: option.label,
|
|
78
81
|
src: option.icon,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}), option.label]
|
|
82
|
+
width: "24px"
|
|
83
|
+
}), /* @__PURE__ */ jsx(LabelItem, {
|
|
84
|
+
children: option.label
|
|
85
|
+
})]
|
|
84
86
|
}, option.value))
|
|
85
87
|
})
|
|
86
88
|
})]
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const LabelItem: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEnvironment, useHostTools } from "@m4l/core";
|
|
2
2
|
import require$$0 from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
4
4
|
function DateFormatter(props) {
|
|
5
5
|
const {
|
|
6
6
|
presentationType,
|
|
@@ -17,6 +17,11 @@ function DateFormatter(props) {
|
|
|
17
17
|
let finalFormat = format || dfnsFormat.datetime_format;
|
|
18
18
|
let result;
|
|
19
19
|
let resultDate;
|
|
20
|
+
if (value === void 0 || value === null) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
22
|
+
children: "-"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
20
25
|
switch (presentationType) {
|
|
21
26
|
case "datetime":
|
|
22
27
|
finalFormat = format || dfnsFormat.datetime_format;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Maybe } from '@m4l/core';
|
|
1
2
|
import { ComponentForrmaterType } from '../types';
|
|
2
3
|
export declare type PresentationType = 'date' | 'datetime' | 'time';
|
|
3
4
|
export interface DateFormatterProps {
|
|
4
5
|
Component?: ComponentForrmaterType;
|
|
5
6
|
presentationType: PresentationType;
|
|
6
7
|
format?: string;
|
|
7
|
-
value: Date | string | number
|
|
8
|
+
value: Maybe<Date | string | number>;
|
|
8
9
|
}
|
package/core-js.js
CHANGED
|
@@ -89,13 +89,23 @@ var requireObjectCoercible$5 = requireObjectCoercible$6;
|
|
|
89
89
|
var toIndexedObject$6 = function(it) {
|
|
90
90
|
return IndexedObject$3(requireObjectCoercible$5(it));
|
|
91
91
|
};
|
|
92
|
-
var
|
|
92
|
+
var documentAll$2 = typeof document == "object" && document.all;
|
|
93
|
+
var IS_HTMLDDA = typeof documentAll$2 == "undefined" && documentAll$2 !== void 0;
|
|
94
|
+
var documentAll_1 = {
|
|
95
|
+
all: documentAll$2,
|
|
96
|
+
IS_HTMLDDA
|
|
97
|
+
};
|
|
98
|
+
var $documentAll$1 = documentAll_1;
|
|
99
|
+
var documentAll$1 = $documentAll$1.all;
|
|
100
|
+
var isCallable$k = $documentAll$1.IS_HTMLDDA ? function(argument) {
|
|
101
|
+
return typeof argument == "function" || argument === documentAll$1;
|
|
102
|
+
} : function(argument) {
|
|
93
103
|
return typeof argument == "function";
|
|
94
104
|
};
|
|
95
105
|
var isCallable$j = isCallable$k;
|
|
96
|
-
var documentAll =
|
|
97
|
-
var
|
|
98
|
-
var isObject$d =
|
|
106
|
+
var $documentAll = documentAll_1;
|
|
107
|
+
var documentAll = $documentAll.all;
|
|
108
|
+
var isObject$d = $documentAll.IS_HTMLDDA ? function(it) {
|
|
99
109
|
return typeof it == "object" ? it !== null : isCallable$j(it) || it === documentAll;
|
|
100
110
|
} : function(it) {
|
|
101
111
|
return typeof it == "object" ? it !== null : isCallable$j(it);
|
|
@@ -207,10 +217,10 @@ var store$2 = sharedStore;
|
|
|
207
217
|
(shared$4.exports = function(key, value) {
|
|
208
218
|
return store$2[key] || (store$2[key] = value !== void 0 ? value : {});
|
|
209
219
|
})("versions", []).push({
|
|
210
|
-
version: "3.25.
|
|
220
|
+
version: "3.25.2",
|
|
211
221
|
mode: "global",
|
|
212
222
|
copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
|
|
213
|
-
license: "https://github.com/zloirock/core-js/blob/v3.25.
|
|
223
|
+
license: "https://github.com/zloirock/core-js/blob/v3.25.2/LICENSE",
|
|
214
224
|
source: "https://github.com/zloirock/core-js"
|
|
215
225
|
});
|
|
216
226
|
var requireObjectCoercible$4 = requireObjectCoercible$6;
|
package/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import "@mui/material/Button";
|
|
|
38
38
|
export { S as ScrollBar } from "./components/ScrollBar/index.js";
|
|
39
39
|
export { D as DynamicFilter, d as defaultDynamicFilterDictionary, g as getDynamicFilterComponentsDictionary } from "./components/DynamicFilter/index.js";
|
|
40
40
|
import "./simplebar.js";
|
|
41
|
+
export { L as LanguagePopover } from "./components/LanguagePopover/index.js";
|
|
41
42
|
import "./react-draggable.js";
|
|
42
43
|
export { M as ModalDialog, d as defaultModalDialogDictionary, g as getModalDialogComponentsDictionary } from "./components/ModalDialog/index.js";
|
|
43
44
|
export { R as Resizeable } from "./components/Resizeable/index.js";
|
|
@@ -70,7 +71,6 @@ export { A as ActionCancel } from "./components/CommonActions/components/ActionC
|
|
|
70
71
|
export { A as ActionIntro } from "./components/CommonActions/components/ActionIntro/index.js";
|
|
71
72
|
export { A as ActionFormCancel } from "./components/CommonActions/components/ActionFormCancel/index.js";
|
|
72
73
|
export { A as ActionFormIntro } from "./components/CommonActions/components/ActionFormIntro/index.js";
|
|
73
|
-
export { L as LanguagePopover } from "./components/LanguagePopover/index.js";
|
|
74
74
|
export { L as Loadable } from "./components/Loadable/index.js";
|
|
75
75
|
export { S as ScrollToTop } from "./components/ScrollToTop/index.js";
|
|
76
76
|
export { u as useModal } from "./hooks/useModal/index.js";
|
package/package.json
CHANGED