@m4l/components 0.1.5 → 0.1.7

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.
@@ -19,7 +19,7 @@ import "../../react-lazy-load-image-component.js";
19
19
  import "../Image/index.js";
20
20
  import "../hook-form/RHFUpload/index.js";
21
21
  import { I as IconButton } from "../mui_extended/IconButton/index.js";
22
- import "../../simplebar.js";
22
+ import "simplebar/dist/simplebar.min.css";
23
23
  import { F as FilterButton } from "../mui_extended/Button/index.js";
24
24
  import { L as LabelMemuItem, b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.js";
25
25
  import { M as MenuPopover } from "../mui_extended/MenuPopover/index.js";
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
- import { defaultProps } from './types';
3
- export declare function LanguagePopover(props: defaultProps): JSX.Element;
2
+ export declare function LanguagePopover(): JSX.Element;
@@ -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
- function LanguagePopover(props) {
18
- const {
19
- isSkeleton
20
- } = props;
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
- sx: {
80
- width: 28,
81
- mr: 2
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,4 +1,4 @@
1
- import { S as SimpleBar } from "../../simplebar.js";
1
+ import SimpleBarReact from "simplebar-react";
2
2
  import { styled, alpha } from "@mui/material/styles";
3
3
  import { Box } from "@mui/material";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -7,7 +7,7 @@ const RootStyle = styled("div")(() => ({
7
7
  height: "100%",
8
8
  overflow: "hidden"
9
9
  }));
10
- const SimpleBarStyle = styled(SimpleBar)(({
10
+ const SimpleBarStyle = styled(SimpleBarReact)(({
11
11
  theme
12
12
  }) => ({
13
13
  maxHeight: "100%",
@@ -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/index.js CHANGED
@@ -37,7 +37,8 @@ export { M as ModalContext, a as ModalProvider } from "./contexts/ModalContext/i
37
37
  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
- import "./simplebar.js";
40
+ import "simplebar/dist/simplebar.min.css";
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";
@@ -81,10 +81,8 @@ import "react-dom";
81
81
  import "prop-types";
82
82
  import "clsx";
83
83
  import "./utils/index.js";
84
- import "./juggle.js";
85
84
  import "./react-data-grid.js";
85
+ import "simplebar-react";
86
86
  import "yup";
87
- import "./core-js.js";
88
- import "./can-use-dom.js";
89
87
  import "./react-resizable.js";
90
88
  import "react-helmet-async";