@etsoo/materialui 1.6.21 → 1.6.22

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.
@@ -44,7 +44,10 @@ function InputItemUIs({ data }) {
44
44
  return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { container: true, spacing: 2, marginTop: 1, children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { size: { xs: 12, sm: 6 }, children: (0, jsx_runtime_1.jsx)(ComboBox_1.ComboBox, { name: "type", label: labels.type, inputRequired: true, size: "small", loadData: () => Promise.resolve(types.map((t) => ({ id: t, label: t }))), onValueChange: (item) => {
45
45
  const type = item?.id;
46
46
  optionsRef.current.disabled =
47
- type !== "combobox" && type !== "select";
47
+ type !== "combobox" &&
48
+ type !== "select" &&
49
+ type !== "checkbox" &&
50
+ type !== "radio";
48
51
  const nameInput = nameRef.current;
49
52
  if (nameInput.value === "" &&
50
53
  (type === "amountlabel" || type === "divider" || type === "label")) {
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CustomFieldUI = CustomFieldUI;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const CustomFieldUtils_1 = require("./CustomFieldUtils");
9
+ const ReactApp_1 = require("../app/ReactApp");
9
10
  /**
10
11
  * CustomFieldUI component
11
12
  * @param props Props
@@ -14,6 +15,8 @@ const CustomFieldUtils_1 = require("./CustomFieldUtils");
14
15
  function CustomFieldUI(props) {
15
16
  // Destruct
16
17
  const { fields, initialValue, mref, onChange } = props;
18
+ // App
19
+ const app = (0, ReactApp_1.useAppContext)();
17
20
  // Field component collections
18
21
  const collections = {};
19
22
  // Value reference
@@ -36,5 +39,5 @@ function CustomFieldUI(props) {
36
39
  }, (name, fieldValue) => {
37
40
  valueRef.current[name] = fieldValue;
38
41
  onChange?.(valueRef.current, name, fieldValue);
39
- });
42
+ }, (input) => app?.get(input) ?? input);
40
43
  }
@@ -38,7 +38,10 @@ function InputItemUIs({ data }) {
38
38
  return (_jsxs(Grid, { container: true, spacing: 2, marginTop: 1, children: [_jsx(Grid, { size: { xs: 12, sm: 6 }, children: _jsx(ComboBox, { name: "type", label: labels.type, inputRequired: true, size: "small", loadData: () => Promise.resolve(types.map((t) => ({ id: t, label: t }))), onValueChange: (item) => {
39
39
  const type = item?.id;
40
40
  optionsRef.current.disabled =
41
- type !== "combobox" && type !== "select";
41
+ type !== "combobox" &&
42
+ type !== "select" &&
43
+ type !== "checkbox" &&
44
+ type !== "radio";
42
45
  const nameInput = nameRef.current;
43
46
  if (nameInput.value === "" &&
44
47
  (type === "amountlabel" || type === "divider" || type === "label")) {
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { CustomFieldUtils } from "./CustomFieldUtils";
3
+ import { useAppContext } from "../app/ReactApp";
3
4
  /**
4
5
  * CustomFieldUI component
5
6
  * @param props Props
@@ -8,6 +9,8 @@ import { CustomFieldUtils } from "./CustomFieldUtils";
8
9
  export function CustomFieldUI(props) {
9
10
  // Destruct
10
11
  const { fields, initialValue, mref, onChange } = props;
12
+ // App
13
+ const app = useAppContext();
11
14
  // Field component collections
12
15
  const collections = {};
13
16
  // Value reference
@@ -30,5 +33,5 @@ export function CustomFieldUI(props) {
30
33
  }, (name, fieldValue) => {
31
34
  valueRef.current[name] = fieldValue;
32
35
  onChange?.(valueRef.current, name, fieldValue);
33
- });
36
+ }, (input) => app?.get(input) ?? input);
34
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.6.21",
3
+ "version": "1.6.22",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -43,12 +43,12 @@
43
43
  "@etsoo/notificationbase": "^1.1.66",
44
44
  "@etsoo/react": "^1.8.78",
45
45
  "@etsoo/shared": "^1.2.80",
46
- "@mui/icons-material": "^7.3.8",
47
- "@mui/material": "^7.3.8",
48
- "@mui/x-data-grid": "^8.27.3",
46
+ "@mui/icons-material": "^7.3.9",
47
+ "@mui/material": "^7.3.9",
48
+ "@mui/x-data-grid": "^8.27.4",
49
49
  "chart.js": "^4.5.1",
50
50
  "chartjs-plugin-datalabels": "^2.2.0",
51
- "dompurify": "^3.3.1",
51
+ "dompurify": "^3.3.2",
52
52
  "eventemitter3": "^5.0.4",
53
53
  "pica": "^9.0.1",
54
54
  "pulltorefreshjs": "^0.1.22",
@@ -68,7 +68,10 @@ function InputItemUIs({ data }: { data?: CustomFieldData }) {
68
68
  onValueChange={(item) => {
69
69
  const type = item?.id;
70
70
  optionsRef.current!.disabled =
71
- type !== "combobox" && type !== "select";
71
+ type !== "combobox" &&
72
+ type !== "select" &&
73
+ type !== "checkbox" &&
74
+ type !== "radio";
72
75
 
73
76
  const nameInput = nameRef.current!;
74
77
  if (
@@ -2,6 +2,7 @@ import { CustomFieldData, CustomFieldRef } from "@etsoo/appscript";
2
2
  import { CustomFieldReactCollection } from "@etsoo/react";
3
3
  import React from "react";
4
4
  import { CustomFieldUtils } from "./CustomFieldUtils";
5
+ import { useAppContext } from "../app/ReactApp";
5
6
 
6
7
  /**
7
8
  * CustomFieldUI component props
@@ -46,6 +47,9 @@ export function CustomFieldUI<D extends CustomFieldData = CustomFieldData>(
46
47
  // Destruct
47
48
  const { fields, initialValue, mref, onChange } = props;
48
49
 
50
+ // App
51
+ const app = useAppContext();
52
+
49
53
  // Field component collections
50
54
  const collections: CustomFieldReactCollection<D> = {};
51
55
 
@@ -78,6 +82,7 @@ export function CustomFieldUI<D extends CustomFieldData = CustomFieldData>(
78
82
  (name, fieldValue) => {
79
83
  valueRef.current[name] = fieldValue;
80
84
  onChange?.(valueRef.current, name, fieldValue);
81
- }
85
+ },
86
+ (input) => app?.get(input) ?? input
82
87
  );
83
88
  }