@etsoo/materialui 1.5.81 → 1.5.82

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.
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.EmailInput = EmailInput;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const TextField_1 = __importDefault(require("@mui/material/TextField"));
9
+ const ReactApp_1 = require("./app/ReactApp");
9
10
  /**
10
11
  * Email input
11
12
  * @param props Props
12
13
  */
13
14
  function EmailInput(props) {
15
+ // Global app
16
+ const app = (0, ReactApp_1.useAppContext)();
14
17
  // Destruct
15
- const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "email", fullWidth = true, name = "email", ...rest } = props;
18
+ const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "email", fullWidth = true, label = app?.get("email"), name = "email", ...rest } = props;
16
19
  // Layout
17
- return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "email", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, name: name, slotProps: {
20
+ return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "email", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
18
21
  htmlInput: { inputMode: "email", maxLength: 128 },
19
22
  ...slotProps
20
23
  }, ...rest }));
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.MobileInput = MobileInput;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const TextField_1 = __importDefault(require("@mui/material/TextField"));
9
+ const ReactApp_1 = require("./app/ReactApp");
9
10
  /**
10
11
  * Mobile input
11
12
  * @param props Props
12
13
  */
13
14
  function MobileInput(props) {
15
+ // Global app
16
+ const app = (0, ReactApp_1.useAppContext)();
14
17
  // Destruct
15
- const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "mobile", fullWidth = true, name = "mobile", ...rest } = props;
18
+ const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "mobile", fullWidth = true, label = app?.get("mobile"), name = "mobile", ...rest } = props;
16
19
  // Layout
17
- return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, name: name, slotProps: {
20
+ return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
18
21
  htmlInput: { inputMode: "tel", maxLength: 18 },
19
22
  ...slotProps
20
23
  }, ...rest }));
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PhoInput = PhoInput;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const TextField_1 = __importDefault(require("@mui/material/TextField"));
9
+ const ReactApp_1 = require("./app/ReactApp");
9
10
  /**
10
11
  * Phone input
11
12
  * @param props Props
12
13
  */
13
14
  function PhoInput(props) {
15
+ // Global app
16
+ const app = (0, ReactApp_1.useAppContext)();
14
17
  // Destruct
15
- const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "phone", fullWidth = true, name = "phone", ...rest } = props;
18
+ const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "phone", fullWidth = true, label = app?.get("phone"), name = "phone", ...rest } = props;
16
19
  // Layout
17
- return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, name: name, slotProps: {
20
+ return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
18
21
  htmlInput: { inputMode: "tel", maxLength: 18 },
19
22
  ...slotProps
20
23
  }, ...rest }));
@@ -1,14 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import TextField from "@mui/material/TextField";
3
+ import { useAppContext } from "./app/ReactApp";
3
4
  /**
4
5
  * Email input
5
6
  * @param props Props
6
7
  */
7
8
  export function EmailInput(props) {
9
+ // Global app
10
+ const app = useAppContext();
8
11
  // Destruct
9
- const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "email", fullWidth = true, name = "email", ...rest } = props;
12
+ const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "email", fullWidth = true, label = app?.get("email"), name = "email", ...rest } = props;
10
13
  // Layout
11
- return (_jsx(TextField, { type: "email", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, name: name, slotProps: {
14
+ return (_jsx(TextField, { type: "email", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
12
15
  htmlInput: { inputMode: "email", maxLength: 128 },
13
16
  ...slotProps
14
17
  }, ...rest }));
@@ -1,14 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import TextField from "@mui/material/TextField";
3
+ import { useAppContext } from "./app/ReactApp";
3
4
  /**
4
5
  * Mobile input
5
6
  * @param props Props
6
7
  */
7
8
  export function MobileInput(props) {
9
+ // Global app
10
+ const app = useAppContext();
8
11
  // Destruct
9
- const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "mobile", fullWidth = true, name = "mobile", ...rest } = props;
12
+ const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "mobile", fullWidth = true, label = app?.get("mobile"), name = "mobile", ...rest } = props;
10
13
  // Layout
11
- return (_jsx(TextField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, name: name, slotProps: {
14
+ return (_jsx(TextField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
12
15
  htmlInput: { inputMode: "tel", maxLength: 18 },
13
16
  ...slotProps
14
17
  }, ...rest }));
@@ -1,14 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import TextField from "@mui/material/TextField";
3
+ import { useAppContext } from "./app/ReactApp";
3
4
  /**
4
5
  * Phone input
5
6
  * @param props Props
6
7
  */
7
8
  export function PhoInput(props) {
9
+ // Global app
10
+ const app = useAppContext();
8
11
  // Destruct
9
- const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "phone", fullWidth = true, name = "phone", ...rest } = props;
12
+ const { slotProps, autoCapitalize = "none", autoCorrect = "off", autoComplete = "phone", fullWidth = true, label = app?.get("phone"), name = "phone", ...rest } = props;
10
13
  // Layout
11
- return (_jsx(TextField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, name: name, slotProps: {
14
+ return (_jsx(TextField, { type: "tel", autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, autoComplete: autoComplete, fullWidth: fullWidth, label: label, name: name, slotProps: {
12
15
  htmlInput: { inputMode: "tel", maxLength: 18 },
13
16
  ...slotProps
14
17
  }, ...rest }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.81",
3
+ "version": "1.5.82",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -46,7 +46,7 @@
46
46
  "@etsoo/shared": "^1.2.79",
47
47
  "@mui/icons-material": "^7.3.5",
48
48
  "@mui/material": "^7.3.5",
49
- "@mui/x-data-grid": "^8.16.0",
49
+ "@mui/x-data-grid": "^8.17.0",
50
50
  "chart.js": "^4.5.1",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
52
52
  "dompurify": "^3.3.0",
@@ -1,4 +1,5 @@
1
1
  import TextField, { TextFieldProps } from "@mui/material/TextField";
2
+ import { useAppContext } from "./app/ReactApp";
2
3
 
3
4
  /**
4
5
  * Email input props
@@ -10,6 +11,9 @@ export type EmailInputProps = Omit<TextFieldProps, "type"> & {};
10
11
  * @param props Props
11
12
  */
12
13
  export function EmailInput(props: EmailInputProps) {
14
+ // Global app
15
+ const app = useAppContext();
16
+
13
17
  // Destruct
14
18
  const {
15
19
  slotProps,
@@ -17,6 +21,7 @@ export function EmailInput(props: EmailInputProps) {
17
21
  autoCorrect = "off",
18
22
  autoComplete = "email",
19
23
  fullWidth = true,
24
+ label = app?.get("email"),
20
25
  name = "email",
21
26
  ...rest
22
27
  } = props;
@@ -29,6 +34,7 @@ export function EmailInput(props: EmailInputProps) {
29
34
  autoCorrect={autoCorrect}
30
35
  autoComplete={autoComplete}
31
36
  fullWidth={fullWidth}
37
+ label={label}
32
38
  name={name}
33
39
  slotProps={{
34
40
  htmlInput: { inputMode: "email", maxLength: 128 },
@@ -1,4 +1,5 @@
1
1
  import TextField, { TextFieldProps } from "@mui/material/TextField";
2
+ import { useAppContext } from "./app/ReactApp";
2
3
 
3
4
  /**
4
5
  * Mobile input props
@@ -10,6 +11,9 @@ export type MobileInputProps = Omit<TextFieldProps, "type"> & {};
10
11
  * @param props Props
11
12
  */
12
13
  export function MobileInput(props: MobileInputProps) {
14
+ // Global app
15
+ const app = useAppContext();
16
+
13
17
  // Destruct
14
18
  const {
15
19
  slotProps,
@@ -17,6 +21,7 @@ export function MobileInput(props: MobileInputProps) {
17
21
  autoCorrect = "off",
18
22
  autoComplete = "mobile",
19
23
  fullWidth = true,
24
+ label = app?.get("mobile"),
20
25
  name = "mobile",
21
26
  ...rest
22
27
  } = props;
@@ -29,6 +34,7 @@ export function MobileInput(props: MobileInputProps) {
29
34
  autoCorrect={autoCorrect}
30
35
  autoComplete={autoComplete}
31
36
  fullWidth={fullWidth}
37
+ label={label}
32
38
  name={name}
33
39
  slotProps={{
34
40
  htmlInput: { inputMode: "tel", maxLength: 18 },
@@ -1,4 +1,5 @@
1
1
  import TextField, { TextFieldProps } from "@mui/material/TextField";
2
+ import { useAppContext } from "./app/ReactApp";
2
3
 
3
4
  /**
4
5
  * Phone input props
@@ -10,6 +11,9 @@ export type PhoneInputProps = Omit<TextFieldProps, "type"> & {};
10
11
  * @param props Props
11
12
  */
12
13
  export function PhoInput(props: PhoneInputProps) {
14
+ // Global app
15
+ const app = useAppContext();
16
+
13
17
  // Destruct
14
18
  const {
15
19
  slotProps,
@@ -17,6 +21,7 @@ export function PhoInput(props: PhoneInputProps) {
17
21
  autoCorrect = "off",
18
22
  autoComplete = "phone",
19
23
  fullWidth = true,
24
+ label = app?.get("phone"),
20
25
  name = "phone",
21
26
  ...rest
22
27
  } = props;
@@ -29,6 +34,7 @@ export function PhoInput(props: PhoneInputProps) {
29
34
  autoCorrect={autoCorrect}
30
35
  autoComplete={autoComplete}
31
36
  fullWidth={fullWidth}
37
+ label={label}
32
38
  name={name}
33
39
  slotProps={{
34
40
  htmlInput: { inputMode: "tel", maxLength: 18 },