@dartech/arsenal-ui 1.3.93 → 1.3.94
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/index.js +130 -31
- package/package.json +3 -2
- package/src/lib/Forms/ControlDate.d.ts +5 -2
- package/src/lib/Forms/ControlDateTime.d.ts +5 -2
- package/src/lib/Forms/ControlPhoneInput.d.ts +10 -0
- package/src/lib/Forms/index.d.ts +1 -0
- package/src/lib/Property/UpsertProperty/PropertyValueField/BooleanValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/DateTimeValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/DateValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/JsonValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/TimeValueField.d.ts +0 -1
- package/src/lib/Property/ViewProperty/PropertyItem.d.ts +0 -1
package/index.js
CHANGED
@@ -9,7 +9,7 @@ import DialogTitle from '@mui/material/DialogTitle';
|
|
9
9
|
import Box from '@mui/material/Box';
|
10
10
|
import CircularProgress from '@mui/material/CircularProgress';
|
11
11
|
import { __rest, __awaiter } from 'tslib';
|
12
|
-
import { useController, useWatch, useFormContext, useFieldArray } from 'react-hook-form';
|
12
|
+
import { useController, useWatch, useFormContext, Controller, useFieldArray } from 'react-hook-form';
|
13
13
|
import TextField from '@mui/material/TextField';
|
14
14
|
import React, { useRef, useEffect, useState, useCallback, useMemo, createElement, forwardRef, createContext, useContext, memo, Suspense } from 'react';
|
15
15
|
import MenuItem from '@mui/material/MenuItem';
|
@@ -40,6 +40,7 @@ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
40
40
|
import Chip from '@mui/material/Chip';
|
41
41
|
import Grid from '@mui/material/Unstable_Grid2';
|
42
42
|
import { toString, parse as parse$1 } from 'duration-fns';
|
43
|
+
import InputMask from 'react-input-mask';
|
43
44
|
import Pagination from '@mui/material/Pagination';
|
44
45
|
import MuiTablePagination from '@mui/material/TablePagination';
|
45
46
|
import { useGridApiContext, useGridSelector, gridPageSelector, gridPageCountSelector, gridRowCountSelector, gridPageSizeSelector, GridColumnMenuContainer, GridFilterMenuItem, DataGrid, GridActionsCellItem } from '@mui/x-data-grid';
|
@@ -2037,14 +2038,26 @@ const ControlSwitch = _a => {
|
|
2037
2038
|
});
|
2038
2039
|
};
|
2039
2040
|
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
})
|
2041
|
+
var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";
|
2042
|
+
var DateIcon = img$3;
|
2043
|
+
|
2044
|
+
const DateIconComponent$1 = () => {
|
2045
|
+
return jsx("img", {
|
2046
|
+
src: DateIcon,
|
2047
|
+
alt: ""
|
2048
|
+
});
|
2049
|
+
};
|
2050
|
+
const ControlDate = _a => {
|
2051
|
+
var {
|
2052
|
+
control,
|
2053
|
+
name,
|
2054
|
+
required,
|
2055
|
+
label,
|
2056
|
+
format: format$1 = DATE_DEFAULT_FORMAT,
|
2057
|
+
hideErrorMessage = false,
|
2058
|
+
textFieldProps = {}
|
2059
|
+
} = _a,
|
2060
|
+
datePickerProps = __rest(_a, ["control", "name", "required", "label", "format", "hideErrorMessage", "textFieldProps"]);
|
2048
2061
|
const [localFormat, setLocalFormat] = useState(DATE_DEFAULT_FORMAT);
|
2049
2062
|
const {
|
2050
2063
|
field,
|
@@ -2069,14 +2082,14 @@ const ControlDate = ({
|
|
2069
2082
|
field.onChange(isValid(date) ? format(date, localFormat) : date);
|
2070
2083
|
}, [field, localFormat]);
|
2071
2084
|
useEffect(() => {
|
2072
|
-
const fixedTimeZone =
|
2085
|
+
const fixedTimeZone = format$1.replace(/[Z,z,x]+/g, 'XX');
|
2073
2086
|
try {
|
2074
2087
|
isMatch(format(new Date(), fixedTimeZone), fixedTimeZone);
|
2075
2088
|
setLocalFormat(fixedTimeZone);
|
2076
2089
|
} catch (e) {
|
2077
2090
|
console.error(e);
|
2078
2091
|
}
|
2079
|
-
}, [
|
2092
|
+
}, [format$1]);
|
2080
2093
|
return jsx(DatePicker, Object.assign({}, field, {
|
2081
2094
|
label: required ? jsxs(Fragment, {
|
2082
2095
|
children: [label, " ", jsx("span", {
|
@@ -2086,7 +2099,11 @@ const ControlDate = ({
|
|
2086
2099
|
inputFormat: localFormat,
|
2087
2100
|
value: localFormat ? parse(field.value, localFormat, new Date()) : field.value,
|
2088
2101
|
onChange: handleChange,
|
2089
|
-
|
2102
|
+
components: {
|
2103
|
+
OpenPickerIcon: DateIconComponent$1
|
2104
|
+
}
|
2105
|
+
}, datePickerProps, {
|
2106
|
+
renderInput: params => jsx(TextField, Object.assign({}, params, {
|
2090
2107
|
fullWidth: true,
|
2091
2108
|
size: "small",
|
2092
2109
|
sx: {
|
@@ -2097,19 +2114,28 @@ const ControlDate = ({
|
|
2097
2114
|
variant: "outlined",
|
2098
2115
|
name: name,
|
2099
2116
|
error: !!error,
|
2100
|
-
helperText: !
|
2101
|
-
}))
|
2117
|
+
helperText: !hideErrorMessage && (error === null || error === void 0 ? void 0 : error.message)
|
2118
|
+
}, textFieldProps))
|
2102
2119
|
}));
|
2103
2120
|
};
|
2104
2121
|
|
2105
|
-
const
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2122
|
+
const DateIconComponent = () => {
|
2123
|
+
return jsx("img", {
|
2124
|
+
src: DateIcon,
|
2125
|
+
alt: ""
|
2126
|
+
});
|
2127
|
+
};
|
2128
|
+
const ControlDateTime = _a => {
|
2129
|
+
var {
|
2130
|
+
control,
|
2131
|
+
name,
|
2132
|
+
required,
|
2133
|
+
label,
|
2134
|
+
format: format$1 = DATE_TIME_DEFAULT_FORMAT,
|
2135
|
+
hideErrorMessage = false,
|
2136
|
+
textFieldProps
|
2137
|
+
} = _a,
|
2138
|
+
dateTimePickerProps = __rest(_a, ["control", "name", "required", "label", "format", "hideErrorMessage", "textFieldProps"]);
|
2113
2139
|
const [localFormat, setLocalFormat] = useState(DATE_TIME_DEFAULT_FORMAT);
|
2114
2140
|
const {
|
2115
2141
|
field,
|
@@ -2133,14 +2159,14 @@ const ControlDateTime = ({
|
|
2133
2159
|
field.onChange(isValid(date) ? format(date, localFormat) : date);
|
2134
2160
|
}, [field, localFormat]);
|
2135
2161
|
useEffect(() => {
|
2136
|
-
const fixedTimeZone =
|
2162
|
+
const fixedTimeZone = format$1.replace(/[Z,z,x]+/g, 'XX');
|
2137
2163
|
try {
|
2138
2164
|
isMatch(format(new Date(), fixedTimeZone), fixedTimeZone);
|
2139
2165
|
setLocalFormat(fixedTimeZone);
|
2140
2166
|
} catch (e) {
|
2141
2167
|
console.error(e);
|
2142
2168
|
}
|
2143
|
-
}, [
|
2169
|
+
}, [format$1]);
|
2144
2170
|
return jsx(DateTimePicker, Object.assign({}, field, {
|
2145
2171
|
ampm: false,
|
2146
2172
|
label: required ? jsxs(Fragment, {
|
@@ -2151,7 +2177,11 @@ const ControlDateTime = ({
|
|
2151
2177
|
value: localFormat ? parse(field.value, localFormat, new Date()) : field.value,
|
2152
2178
|
inputFormat: localFormat,
|
2153
2179
|
onChange: handleChange,
|
2154
|
-
|
2180
|
+
components: {
|
2181
|
+
OpenPickerIcon: DateIconComponent
|
2182
|
+
}
|
2183
|
+
}, dateTimePickerProps, {
|
2184
|
+
renderInput: params => jsx(TextField, Object.assign({}, params, {
|
2155
2185
|
fullWidth: true,
|
2156
2186
|
size: "small",
|
2157
2187
|
sx: {
|
@@ -2162,8 +2192,8 @@ const ControlDateTime = ({
|
|
2162
2192
|
variant: "outlined",
|
2163
2193
|
name: name,
|
2164
2194
|
error: !!error,
|
2165
|
-
helperText: !
|
2166
|
-
}))
|
2195
|
+
helperText: !hideErrorMessage && (error === null || error === void 0 ? void 0 : error.message)
|
2196
|
+
}, textFieldProps))
|
2167
2197
|
}));
|
2168
2198
|
};
|
2169
2199
|
|
@@ -2508,6 +2538,75 @@ const ControlPeriodInput = ({
|
|
2508
2538
|
});
|
2509
2539
|
};
|
2510
2540
|
|
2541
|
+
var img$2 = "data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
2542
|
+
var FlagKz = img$2;
|
2543
|
+
|
2544
|
+
const ControlPhoneInput = _a => {
|
2545
|
+
var {
|
2546
|
+
name,
|
2547
|
+
label,
|
2548
|
+
required,
|
2549
|
+
mask = '+7 (799) 999 99 99'
|
2550
|
+
} = _a,
|
2551
|
+
textFieldProps = __rest(_a, ["name", "label", "required", "mask"]);
|
2552
|
+
const {
|
2553
|
+
control,
|
2554
|
+
watch,
|
2555
|
+
trigger
|
2556
|
+
} = useFormContext();
|
2557
|
+
const phoneNumber = watch(name);
|
2558
|
+
useEffect(() => {
|
2559
|
+
if (/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(phoneNumber)) {
|
2560
|
+
trigger(name);
|
2561
|
+
}
|
2562
|
+
}, [phoneNumber, trigger, name]);
|
2563
|
+
return jsx(Controller, {
|
2564
|
+
control: control,
|
2565
|
+
name: name,
|
2566
|
+
rules: {
|
2567
|
+
required: required && 'Please, fill this field',
|
2568
|
+
validate: val => {
|
2569
|
+
if (/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(val)) {
|
2570
|
+
return true;
|
2571
|
+
}
|
2572
|
+
return 'Incorrect phone number format';
|
2573
|
+
}
|
2574
|
+
},
|
2575
|
+
render: ({
|
2576
|
+
field,
|
2577
|
+
fieldState: {
|
2578
|
+
error
|
2579
|
+
}
|
2580
|
+
}) => jsx(InputMask, Object.assign({
|
2581
|
+
mask: mask
|
2582
|
+
}, field, {
|
2583
|
+
children: () => jsx(TextField, Object.assign({
|
2584
|
+
fullWidth: true,
|
2585
|
+
size: "small",
|
2586
|
+
label: required && label ? jsxs(Fragment, {
|
2587
|
+
children: [label, " ", jsx("span", {
|
2588
|
+
children: "*"
|
2589
|
+
})]
|
2590
|
+
}) : label,
|
2591
|
+
inputMode: "numeric",
|
2592
|
+
InputProps: {
|
2593
|
+
startAdornment: jsx(InputAdornment, Object.assign({
|
2594
|
+
position: "start"
|
2595
|
+
}, {
|
2596
|
+
children: jsx("img", {
|
2597
|
+
src: FlagKz,
|
2598
|
+
alt: ""
|
2599
|
+
})
|
2600
|
+
}))
|
2601
|
+
}
|
2602
|
+
}, textFieldProps, {
|
2603
|
+
error: !!error,
|
2604
|
+
helperText: error === null || error === void 0 ? void 0 : error.message
|
2605
|
+
}))
|
2606
|
+
}))
|
2607
|
+
});
|
2608
|
+
};
|
2609
|
+
|
2511
2610
|
const TablePagination = () => {
|
2512
2611
|
const apiRef = useGridApiContext();
|
2513
2612
|
const page = useGridSelector(apiRef, gridPageSelector);
|
@@ -5146,7 +5245,7 @@ const CreatePropertiesList = ({
|
|
5146
5245
|
entityReferenceValueComponent,
|
5147
5246
|
fileReferenceValueComponent
|
5148
5247
|
}) => {
|
5149
|
-
var _a;
|
5248
|
+
var _a, _b;
|
5150
5249
|
const fieldName = useMemo(() => parentFieldName ? `${parentFieldName}.properties` : `properties`, [parentFieldName]);
|
5151
5250
|
const {
|
5152
5251
|
clearErrors,
|
@@ -5216,7 +5315,7 @@ const CreatePropertiesList = ({
|
|
5216
5315
|
children: jsx(Typography, Object.assign({
|
5217
5316
|
color: "secondary"
|
5218
5317
|
}, {
|
5219
|
-
children: error.message
|
5318
|
+
children: ((_a = error.root) === null || _a === void 0 ? void 0 : _a.message) || error.message
|
5220
5319
|
}))
|
5221
5320
|
})), Array.isArray(properties) && propFields.map((item, index) => jsx(Grid, Object.assign({
|
5222
5321
|
sm: 12,
|
@@ -5271,7 +5370,7 @@ const CreatePropertiesList = ({
|
|
5271
5370
|
})), error && jsx(FormHelperText, Object.assign({
|
5272
5371
|
error: true
|
5273
5372
|
}, {
|
5274
|
-
children: (
|
5373
|
+
children: (_b = error.root) === null || _b === void 0 ? void 0 : _b.message
|
5275
5374
|
}))]
|
5276
5375
|
}))]
|
5277
5376
|
});
|
@@ -7019,4 +7118,4 @@ const defaultDefinitionObjectValue = {
|
|
7019
7118
|
properties: {}
|
7020
7119
|
};
|
7021
7120
|
|
7022
|
-
export { AlertDialog, BackButton, Breadcrumbs, ContentLayout, ControlAceEditor, ControlArrayInput, ControlAutocomplete, ControlCheckbox, ControlDate, ControlDateTime, ControlDebouncedInput, ControlInput, ControlNumberInput, ControlPeriodInput, ControlQueryAutocomplete, ControlRadio, ControlSelect, ControlSwitch, ControlTime, CopyButton, CreateDefinition, CreatePropertiesList, CreatePropertyFormFields, DATE_DEFAULT_FORMAT, DATE_TIME_DEFAULT_FORMAT, DefinitionFiller, DefinitionValueView, InfoItem, JsonModalView, JsonPathPicker, JsonView, Loader, MenuIcon, MultiplePropertyFiller, PropertyFiller, PropertyType, PropertyValueField, RoundingMode, RouteTabs, Sidebar, SimpleTable, Status, StepperView, TIME_DEFAULT_FORMAT, TabPanel, Table, TableAction, TableActionCell, ViewPropertiesList, ViewProperty, capitalize, deepParseJson, defaultDefinitionArrayValue, defaultDefinitionObjectValue, digitsOnly, floatsOnly, formatDefinitionData, formatTableRowValue, getDemPropertyDateFormat, getEntityStarterValue, getJsonStringValue, getMultiplePropertyFillOptions, getSinglePropertyFillOptions, isDateType, isExpression, isPropertyValueEmpty, propertiesArrayToObject, propertiesObjectToArray, removeArrayItem, safeParseJson, sortArrayOfObjects, theme, useDebounce, useToggle, validateJson };
|
7121
|
+
export { AlertDialog, BackButton, Breadcrumbs, ContentLayout, ControlAceEditor, ControlArrayInput, ControlAutocomplete, ControlCheckbox, ControlDate, ControlDateTime, ControlDebouncedInput, ControlInput, ControlNumberInput, ControlPeriodInput, ControlPhoneInput, ControlQueryAutocomplete, ControlRadio, ControlSelect, ControlSwitch, ControlTime, CopyButton, CreateDefinition, CreatePropertiesList, CreatePropertyFormFields, DATE_DEFAULT_FORMAT, DATE_TIME_DEFAULT_FORMAT, DefinitionFiller, DefinitionValueView, InfoItem, JsonModalView, JsonPathPicker, JsonView, Loader, MenuIcon, MultiplePropertyFiller, PropertyFiller, PropertyType, PropertyValueField, RoundingMode, RouteTabs, Sidebar, SimpleTable, Status, StepperView, TIME_DEFAULT_FORMAT, TabPanel, Table, TableAction, TableActionCell, ViewPropertiesList, ViewProperty, capitalize, deepParseJson, defaultDefinitionArrayValue, defaultDefinitionObjectValue, digitsOnly, floatsOnly, formatDefinitionData, formatTableRowValue, getDemPropertyDateFormat, getEntityStarterValue, getJsonStringValue, getMultiplePropertyFillOptions, getSinglePropertyFillOptions, isDateType, isExpression, isPropertyValueEmpty, propertiesArrayToObject, propertiesObjectToArray, removeArrayItem, safeParseJson, sortArrayOfObjects, theme, useDebounce, useToggle, validateJson };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dartech/arsenal-ui",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.94",
|
4
4
|
"author": "DAR",
|
5
5
|
"publishConfig": {
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
@@ -27,7 +27,8 @@
|
|
27
27
|
"classnames": "^2.3.1",
|
28
28
|
"@tanstack/react-query": "^4.24.10",
|
29
29
|
"@rollup/plugin-node-resolve": "13.3.0",
|
30
|
-
"qs": "6.11.0"
|
30
|
+
"qs": "6.11.0",
|
31
|
+
"react-input-mask": "2.0.4"
|
31
32
|
},
|
32
33
|
"module": "./index.js",
|
33
34
|
"main": "./index.js",
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
3
|
+
import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
|
2
4
|
import { Control } from 'react-hook-form';
|
3
|
-
type
|
5
|
+
type ControlDateProps = Partial<DatePickerProps<unknown, unknown>> & {
|
4
6
|
/**
|
5
7
|
* React Hook Form `control`
|
6
8
|
*/
|
@@ -13,6 +15,7 @@ type Props = {
|
|
13
15
|
label?: ReactNode;
|
14
16
|
format?: string;
|
15
17
|
hideErrorMessage?: boolean;
|
18
|
+
textFieldProps?: TextFieldProps;
|
16
19
|
};
|
17
|
-
export declare const ControlDate: ({ control, name, required, label, format, hideErrorMessage, }:
|
20
|
+
export declare const ControlDate: ({ control, name, required, label, format, hideErrorMessage, textFieldProps, ...datePickerProps }: ControlDateProps) => JSX.Element;
|
18
21
|
export default ControlDate;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
3
|
+
import { DateTimePickerProps } from '@mui/x-date-pickers/DateTimePicker';
|
2
4
|
import { Control } from 'react-hook-form';
|
3
|
-
type
|
5
|
+
type dateTimePickerProps = Partial<DateTimePickerProps<unknown, unknown>> & {
|
4
6
|
/**
|
5
7
|
* React Hook Form `control`
|
6
8
|
*/
|
@@ -13,6 +15,7 @@ type Props = {
|
|
13
15
|
label?: ReactNode;
|
14
16
|
format?: string;
|
15
17
|
hideErrorMessage?: boolean;
|
18
|
+
textFieldProps?: TextFieldProps;
|
16
19
|
};
|
17
|
-
export declare const ControlDateTime: ({ control, name, required, label, format, hideErrorMessage, }:
|
20
|
+
export declare const ControlDateTime: ({ control, name, required, label, format, hideErrorMessage, textFieldProps, ...dateTimePickerProps }: dateTimePickerProps) => JSX.Element;
|
18
21
|
export default ControlDateTime;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
3
|
+
type Props = TextFieldProps & {
|
4
|
+
name: string;
|
5
|
+
required?: boolean;
|
6
|
+
mask?: string;
|
7
|
+
label?: ReactNode;
|
8
|
+
};
|
9
|
+
export declare const ControlPhoneInput: ({ name, label, required, mask, ...textFieldProps }: Props) => JSX.Element;
|
10
|
+
export default ControlPhoneInput;
|
package/src/lib/Forms/index.d.ts
CHANGED